Popover

トリガーに固定される非モーダルのパネル。どの辺にも配置でき、フォーカスを受け取り、Escape キーや外側のクリックで閉じます。

対応フレームワーク
  • Angular: 対応
  • Vue: 対応
  • React: 対応
  • React Native: 対応

使い方

インポート

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

API リファレンス

SonePopoverDescriptionDirectiveディレクティブ

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

セレクター
[sonePopoverDescription]

SonePopoverDirectiveディレクティブ

`[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.

セレクター
[sonePopover], [sonePopoverContent]
エクスポート名
sonePopover
入力
名前型 デフォルト
role

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

string | null"dialog"

SonePopoverHeaderDirectiveディレクティブ

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

セレクター
[sonePopoverHeader]

SonePopoverTitleDirectiveディレクティブ

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

セレクター
[sonePopoverTitle]

SonePopoverTriggerDirectiveディレクティブ

`[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.

セレクター
[sonePopoverTrigger]
エクスポート名
sonePopoverTrigger
入力
名前型 デフォルト
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
open双方向

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

booleanfalse
keepOpenOnOutsideClick

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

booleanfalse
sonePopoverTriggerSoneOverlayContent | nullnull