Popover

Un panneau non modal ancré à son déclencheur, placé de n'importe quel côté, qui prend le focus et se ferme avec Échap ou un clic à l'extérieur.

Disponible pour
  • Angular: disponible
  • Vue: disponible
  • React: disponible
  • React Native: disponible

Utilisation

Importation

ts
import {
  SonePopoverDescriptionDirective,
  SonePopoverDirective,
  SonePopoverHeaderDirective,
  SonePopoverTitleDirective,
  SonePopoverTriggerDirective,
} from "@surface-one/angular/popover";

Référence de l’API

SonePopoverDescriptionDirectiveDirective

`[sonePopoverDescription]` — a secondary line under the title.

Sélecteur
[sonePopoverDescription]

SonePopoverDirectiveDirective

`[sonePopover]` (or `[sonePopoverContent]`) — the popover surface (spartan/ui Popover content): opaque, padded, `role="dialog"` by default — name it with `aria-labelledby` (its `sonePopoverTitle`) or `aria-label`. Put it in the `<ng-template>` a `sonePopoverTrigger` opens, or pass it to the trigger by reference (`#pop="sonePopover"`): it stays hidden in place until the trigger opens it.

Sélecteur
[sonePopover], [sonePopoverContent]
Exporté sous
sonePopover
Inputs
NomType Par défaut
role

`dialog` by default; `null` (or another role) when the panel is not one.

string | null"dialog"

SonePopoverHeaderDirectiveDirective

`[sonePopoverHeader]` — the title and description at the top of a popover.

Sélecteur
[sonePopoverHeader]

SonePopoverTitleDirectiveDirective

`[sonePopoverTitle]` — the popover's title; give it an `id` the popover names itself by.

Sélecteur
[sonePopoverTitle]

SonePopoverTriggerDirectiveDirective

`[sonePopoverTrigger]` — opens a non-modal popover next to its host (spartan/ui `brnPopoverTrigger`). Pass an `<ng-template>` (`let-close` closes it) or a `[sonePopover]` panel by reference (`#pop="sonePopover"`). It closes on Escape and on a click outside, returning focus to the trigger; inside a `sone-dialog` the panel joins the dialog's focus trap.

Sélecteur
[sonePopoverTrigger]
Exporté sous
sonePopoverTrigger
Inputs
NomType Par défaut
side

The side of the trigger the panel opens on; it flips when that side lacks room.

FloatingSide"bottom"
align

Alignment along the trigger's edge.

FloatingAlign"start"
offset

Gap between the trigger and the panel, in px.

number4
openbidirectionnel

Shown or not — `[(open)]`.

booleanfalse
keepOpenOnOutsideClick

Keep the panel open on a click outside it (Escape still closes it).

booleanfalse
sonePopoverTriggerSoneOverlayContent | nullnull