# API of `@koobiq/components/popover`

Documented on [Popover](https://koobiq.io/en/components/popover.md). NgModule: `KbqPopoverModule`.

## Components

### KbqPopoverComponent (component)

```ts
@Component({ selector: 'kbq-popover-component' })
class KbqPopoverComponent extends KbqPopUp {
    readonly cdkTrapFocus: Signal<CdkTrapFocus>;
    prefix: string;
    header: string | TemplateRef<any>;
    footer: string | TemplateRef<any>;
    trigger: KbqPopoverTrigger | undefined;
    isTrapFocus: boolean;
    hasCloseButton: boolean;
    panelId: string | undefined;
    ariaLabel: string | undefined;
    get elementRef(): ElementRef<HTMLElement>;
    get headerId(): string;
    readonly destroyRef: DestroyRef;
    readonly hovered: Signal<boolean>;
    content: string | TemplateRef<unknown>;
    context: { $implicit: unknown } | null;
    arrow: boolean;
    arrowCentered: boolean;
    defaultPaddings: boolean;
    offset: number | null;
    visibleChange: EventEmitter<boolean>;
    classMap: {};
    visibility: PopUpVisibility;
    updateClassMap(
        placement: string,
        customClass: string,
        size: KbqPopUpSizeValues
    ): void;
    updateTrapFocus(isTrapFocus: boolean): void;
    onEscape(event?: Event): void;
    isTemplateRef<C>(value: unknown): value is TemplateRef<C>;
    show(delay: number): void;
    hide(delay: number): void;
    isVisible(): boolean;
    afterHidden(): Observable<void>;
    detectChanges(): void;
}
```

- `trigger`: `KbqPopoverTrigger | undefined` — The trigger that opened the panel; a panel rendered on its own has none.
- `panelId`: `string | undefined` — Id of the panel element, referenced by the trigger's `aria-controls`. Written by the trigger.
- `ariaLabel`: `string | undefined` — Accessible name of the panel, used when there is no header to label it. Written by the trigger.
- `elementRef`: `ElementRef<HTMLElement>` — Panel element (`.kbq-popover`), not the component host.

  Deliberately shadows the injected `KbqPopUp.elementRef`: the base measures and decorates the visible
  panel, so both `applyPopupMargins` here and `setStickPosition`/`addEventListenerForHide` in the base
  must resolve to the same element. The confirm template carries the matching `#popover` reference.
- `headerId`: `string` — Id of the header text node, referenced by the panel's `aria-labelledby`.
- `hovered`: `Signal<boolean>` — Whether the pointer is over the pop-up.
- `arrowCentered`: `boolean` — Whether the arrow points at the origin center while the panel keeps its placement. Defaults to `false`.
- `classMap`: `{}` — CSS classes of the pop-up element: the placement, the custom class and the modifiers of the subclass.
- `visibility`: `PopUpVisibility` — Stage of the pop-up's life: not shown yet, visible, or hidden.
- `onEscape()`: `void` — Closes the panel on `Escape` inside it, unless a control there spent the key closing a popup of its own.
- `hide()`: `void` — Hides the popup after a specified delay.

  The hide timeout triggers the hiding of the popup by updating visibility and emitting relevant events.
  - `delay`: `number` — The delay in milliseconds before hiding the popup.
- `afterHidden()`: `Observable<void>` — Returns an observable that notifies when the tooltip has been hidden from view.

### KbqPopoverConfirmComponent (component)

```ts
@Component({ selector: 'kbq-popover-confirm-component' })
class KbqPopoverConfirmComponent extends KbqPopoverComponent {
    confirmButtonText: string;
    confirmText: string;
    readonly cdkTrapFocus: Signal<CdkTrapFocus>;
    prefix: string;
    header: string | TemplateRef<any>;
    footer: string | TemplateRef<any>;
    trigger: KbqPopoverTrigger | undefined;
    isTrapFocus: boolean;
    hasCloseButton: boolean;
    panelId: string | undefined;
    ariaLabel: string | undefined;
    get elementRef(): ElementRef<HTMLElement>;
    get headerId(): string;
    readonly destroyRef: DestroyRef;
    readonly hovered: Signal<boolean>;
    content: string | TemplateRef<unknown>;
    context: { $implicit: unknown } | null;
    arrow: boolean;
    arrowCentered: boolean;
    defaultPaddings: boolean;
    offset: number | null;
    visibleChange: EventEmitter<boolean>;
    classMap: {};
    visibility: PopUpVisibility;
    updateClassMap(
        placement: string,
        customClass: string,
        size: KbqPopUpSizeValues
    ): void;
    updateTrapFocus(isTrapFocus: boolean): void;
    onEscape(event?: Event): void;
    isTemplateRef<C>(value: unknown): value is TemplateRef<C>;
    show(delay: number): void;
    hide(delay: number): void;
    isVisible(): boolean;
    afterHidden(): Observable<void>;
    detectChanges(): void;
}
```

- `confirmButtonText`: `string` — Caption of the confirm button. Written by the trigger.
- `confirmText`: `string` — Question rendered in the panel. Written by the trigger.
- `trigger`: `KbqPopoverTrigger | undefined` — The trigger that opened the panel; a panel rendered on its own has none.
- `panelId`: `string | undefined` — Id of the panel element, referenced by the trigger's `aria-controls`. Written by the trigger.
- `ariaLabel`: `string | undefined` — Accessible name of the panel, used when there is no header to label it. Written by the trigger.
- `elementRef`: `ElementRef<HTMLElement>` — Panel element (`.kbq-popover`), not the component host.

  Deliberately shadows the injected `KbqPopUp.elementRef`: the base measures and decorates the visible
  panel, so both `applyPopupMargins` here and `setStickPosition`/`addEventListenerForHide` in the base
  must resolve to the same element. The confirm template carries the matching `#popover` reference.
- `headerId`: `string` — Id of the header text node, referenced by the panel's `aria-labelledby`.
- `hovered`: `Signal<boolean>` — Whether the pointer is over the pop-up.
- `arrowCentered`: `boolean` — Whether the arrow points at the origin center while the panel keeps its placement. Defaults to `false`.
- `classMap`: `{}` — CSS classes of the pop-up element: the placement, the custom class and the modifiers of the subclass.
- `visibility`: `PopUpVisibility` — Stage of the pop-up's life: not shown yet, visible, or hidden.
- `onEscape()`: `void` — Closes the panel on `Escape` inside it, unless a control there spent the key closing a popup of its own.
- `hide()`: `void` — Hides the popup after a specified delay.

  The hide timeout triggers the hiding of the popup by updating visibility and emitting relevant events.
  - `delay`: `number` — The delay in milliseconds before hiding the popup.
- `afterHidden()`: `Observable<void>` — Returns an observable that notifies when the tooltip has been hidden from view.

## Directives

### KbqPopoverConfirmTrigger (directive)

```ts
@Directive({ selector: '[kbqPopoverConfirm]', exportAs: 'kbqPopoverConfirm' })
class KbqPopoverConfirmTrigger extends KbqPopoverTrigger {
    readonly popoverHideIfNotInViewPort = input<boolean>(true, {
        alias: 'kbqPopoverHideIfNotInViewPort'
    });
    readonly confirm = output<void>();
    confirmText: string;
    confirmButtonText: string;
    readonly placementChange: EventEmitter<KbqPopUpPlacementValues>;
    readonly visibleChange: EventEmitter<boolean>;
    readonly panelId: string;
    preventClose: boolean;
    defaultPaddings: boolean;
    stickToWindow: KbqStickToWindowPlacementValues | undefined;
    container: HTMLElement | undefined;
    arrow: boolean;
    arrowCentered: boolean;
    offset: number | null;
    autoFocus: boolean;
    relativeToPointer: boolean;
    enterDelay: number;
    set popoverDefaultPaddings(value: boolean);
    popoverVisible: boolean;
    popoverPlacement: KbqPopUpPlacementValues;
    popoverPlacementPriority: string | string[] | null;
    set popoverContainer(value: HTMLElement | undefined);
    hasBackdrop: boolean;
    set popoverHasBackdrop(value: boolean);
    header: string | TemplateRef<any>;
    content: string | TemplateRef<any>;
    footer: string | TemplateRef<any>;
    disabled: boolean;
    trigger: string;
    size: KbqPopUpSizeValues;
    customClass: string;
    context: unknown;
    ariaLabel: string | undefined;
    hasCloseButton: boolean;
    set popoverHasCloseButton(value: boolean);
    closeOnScroll: boolean | null;
    set popoverCloseOnScroll(value: boolean);
    get hasClickTrigger(): boolean;
    get capturesFocusOnOpen(): boolean;
    backdropClass: string;
    set popoverBackdropClass(value: string);
    popoverOrigin: KbqOverlayOrigin | null;
    set kbqLeaveDelay(value: number);
    isOpen: boolean;
    get isAttached(): boolean;
    get openedChange(): Observable<boolean>;
    updatePosition(reapplyPosition?: boolean): void;
    restoreFocus(): void;
    close(): void;
    updateOrigin(origin: KbqOverlayOrigin | null): void;
}
```

- `[kbqPopoverHideIfNotInViewPort]`: `boolean` — Input (`kbqPopoverHideIfNotInViewPort`) — whether the popover closes once its trigger scrolls out of the
  nearest scrollable ancestor. A bound `null` or `undefined` restores the default, `true`.
- `(confirm)`: `void` — Emits when the user confirms the action.
- `confirmText`: `string` — Input (`kbqPopoverConfirmText`) — question rendered in the panel. Falls back to
  `KBQ_POPOVER_CONFIRM_TEXT` and then to the `popoverConfirm` section of the active locale while
  unset or `undefined`.
- `confirmButtonText`: `string` — Input (`kbqPopoverConfirmButtonText`) — caption of the confirm button. Falls back to
  `KBQ_POPOVER_CONFIRM_BUTTON_TEXT` and then to the `popoverConfirm` section of the active locale
  while unset or `undefined`.
- `placementChange`: `EventEmitter<KbqPopUpPlacementValues>` — Emits the resolved placement whenever the panel is repositioned.

  Declared as `string` to match the abstract member on `KbqPopUpTrigger`: `EventEmitter` is invariant,
  so a narrower emitter cannot override a wider one. Narrowing both is a change to the shared pop-up
  base and belongs to the branch that owns it.
- `visibleChange`: `EventEmitter<boolean>` — Emits `true` when the panel opens and `false` when it closes.
- `panelId`: `string` — Id of the panel this trigger controls, shared with `aria-controls`.
- `preventClose`: `boolean` — prevents closure by any event
- `defaultPaddings`: `boolean` — Whether the header, content and footer keep their default paddings. Bound with `kbqPopoverDefaultPaddings`.
- `stickToWindow`: `KbqStickToWindowPlacementValues | undefined` — Additionally positions the element relative to the window side (Top, Right, Bottom and Left).
  If container is specified, the positioning will be relative to it.
- `container`: `HTMLElement | undefined` — Container for additional positioning, used with `kbqPopoverStickToWindow`. Bound with `kbqPopoverContainer`.
- `arrow`: `boolean` — Input (`kbqPopoverArrow`) — renders the arrow pointing at the trigger.
- `arrowCentered`: `boolean` — Input (`kbqPopoverArrowCentered`) — centers the arrow on the trigger while preserving the panel placement.
  Defaults to `false`.
- `offset`: `number | null` — Input (`kbqPopoverOffset`) — distance between the trigger and the panel, in pixels.
- `autoFocus`: `boolean` — Input (`kbqPopoverAutoFocus`) — whether opening the popover moves the keyboard focus into the panel. Turn it
  off for a panel that must not disturb what the reader is doing: taking focus away from a text selection
  collapses it. Focus then never enters the panel, so its content has to be reachable some other way.
- `relativeToPointer`: `boolean` — Input (`kbqRelativeToPointer`) — positions a click-opened popover at the click point. Keyboard and
  programmatic opens stay on the trigger. An explicit `kbqPopoverOrigin` takes precedence. Defaults to `false`.
- `enterDelay`: `number` — Input (`kbqEnterDelay`) — delay before opening, in milliseconds. Defaults to `0`.
- `popoverDefaultPaddings`: `boolean` — Input (`kbqPopoverDefaultPaddings`) — sets `defaultPaddings`.
- `popoverVisible`: `boolean` — Input (`kbqPopoverVisible`) — opens the popover when set to `true` and closes it when set to `false`.
- `popoverPlacement`: `KbqPopUpPlacementValues` — Input (`kbqPopoverPlacement`) — preferred placement of the panel relative to the trigger.
- `popoverPlacementPriority`: `string | string[] | null` — Input (`kbqPopoverPlacementPriority`) — ordered placements tried before the default strategy.
- `popoverContainer`: `HTMLElement | undefined` — Input (`kbqPopoverContainer`) — sets `container`.
- `hasBackdrop`: `boolean` — Whether a backdrop is rendered behind the panel. With a backdrop the popover closes on a backdrop click
  instead of on any outside pointer event. Bound with `kbqPopoverHasBackdrop`.
- `popoverHasBackdrop`: `boolean` — Input (`kbqPopoverHasBackdrop`) — sets `hasBackdrop`.
- `header`: `string | TemplateRef<any>` — Input (`kbqPopoverHeader`) — header of the panel, as a string or a template.
- `content`: `string | TemplateRef<any>` — Input (`kbqPopoverContent`) — content of the panel, as a string or a template.
- `footer`: `string | TemplateRef<any>` — Input (`kbqPopoverFooter`) — footer of the panel, as a string or a template.
- `disabled`: `boolean` — Input (`kbqPopoverDisabled`) — disables the trigger and closes an open popover.
- `trigger`: `string` — Input (`kbqTrigger`) with the comma-separated trigger events. An empty value resets to click + keydown
  and rebinds listeners. The alias is shared with `kbqTooltip`, so binding it on an element that carries
  both reconfigures both.
- `size`: `KbqPopUpSizeValues` — Input (`kbqPopoverSize`) — preset width of the panel. An unknown value falls back to `medium`.
- `customClass`: `string` — Input (`kbqPopoverClass`) with extra CSS classes applied to the panel.
- `context`: `unknown` — Context for popover templates (kbqPopoverHeader, kbqPopoverContent and kbqPopoverFooter).
- `ariaLabel`: `string | undefined` — Accessible name of the panel. Ignored while a string `kbqPopoverHeader` is set — the header labels the
  dialog then — and recommended for every header-less popover.
- `hasCloseButton`: `boolean` — Renders the icon-only close button in the top corner of the panel. Bound with `kbqPopoverHasCloseButton`.
- `popoverHasCloseButton`: `boolean` — Input (`kbqPopoverHasCloseButton`) — sets `hasCloseButton`.
- `closeOnScroll`: `boolean | null` — Controls the behavior of closing the component on scroll. Bound with `kbqPopoverCloseOnScroll`. Three
  states:
  - `null` (default) — the popover survives a scroll, except when it scrolls out of a
    `.kbq-hide-nested-popup` container, which closes it;
  - `true` — any scroll closes the popover;
  - `false` — no scroll closes the popover, not even a `.kbq-hide-nested-popup` one.

  Use CloseScrollStrategy as alternative
- `popoverCloseOnScroll`: `boolean` — Input (`kbqPopoverCloseOnScroll`) — sets `closeOnScroll`.
- `hasClickTrigger`: `boolean` — Whether the trigger opens the popover on click, which is also what makes it a labelled dialog opener.
- `capturesFocusOnOpen`: `boolean` — Whether opening the popover should move the keyboard focus into the panel. Only deliberate opens
  (click, keyboard, programmatic) do — a hover- or focus-triggered popover must not steal focus.
- `backdropClass`: `string` — CSS class applied to the backdrop, when there is one. Bound with `kbqPopoverBackdropClass`.
- `popoverBackdropClass`: `string` — Input (`kbqPopoverBackdropClass`) — sets `backdropClass`.
- `popoverOrigin`: `KbqOverlayOrigin | null` — Input (`kbqPopoverOrigin`) — what the panel is positioned against: an element, or a rectangle in viewport
  coordinates such as the one `kbqCreateCaretOrigin` keeps on the caret. `null` anchors it to the trigger.

  Bind it before `kbqPopoverVisible`, which opens the panel as it is written.
- `kbqLeaveDelay`: `number` — Input (`kbqLeaveDelay`) — delay before closing, in milliseconds. Defaults to `0`, and to
  `defaultHoverLeaveDelay` when `kbqTrigger` includes `hover`.
- `isOpen`: `boolean` — Whether the pop-up overlay is currently open.
- `isAttached`: `boolean` — Whether the pop-up overlay is currently attached.

  Unlike `isOpen`, which follows the visibility of the pop-up component and therefore lags a task behind
  `show()`/`hide()`, this flips synchronously — it is the window during which the overlay (and its
  backdrop) is present in the DOM. Part of the `KbqSiblingPopup` contract.
- `openedChange`: `Observable<boolean>` — Emits `true` when the pop-up opens and `false` when it closes. Part of the `KbqSiblingPopup` contract.
- `updatePosition()`: `void` — Re-applies the overlay position.

  Deliberately narrower than the inherited one, which also rebuilds the closing-action subscription:
  that stream carries a `delay(0)`, so a reposition coalesced into the same task as an outside click —
  which is the task in which that click's change detection writes a popover input — would drop the
  close the click had already scheduled.
- `restoreFocus()`: `void` — Returns focus to the trigger when the popover is closed while focus is still inside its panel.

  Goes through `FocusMonitor` rather than a native `focus()` call: the kbq focus ring is only rendered
  for a monitored origin, and a `program` origin keeps a tooltip on the same element from re-opening.
- `close()`: `void` — Closes the popover on a deliberate action — the panel's close button, or `Escape` inside the panel.

  `hide()` keeps a hover popover open while the pointer rests on the panel, so that the pointer can
  travel from the trigger to the content; that is exactly where the pointer is when the close button is
  clicked, so a deliberate close answers to `kbqPopoverPreventClose` and to nothing else.
- `updateOrigin()`: `void` — Positions the pop-up against `origin` — an element, or a rectangle in viewport coordinates such as the one
  `kbqCreateCaretOrigin` keeps on the caret — instead of the host element; `null` restores the host
  element. An open pop-up moves to the new origin at once.

  This moves the position origin only. `setExternalNativeElement` moves the host itself, and with it
  the trigger's event listeners, its focus target and the scroll containers the pop-up follows.

### KbqPopoverTrigger (directive)

```ts
@Directive({ selector: '[kbqPopover]', exportAs: 'kbqPopover' })
class KbqPopoverTrigger extends KbqPopUpTrigger<KbqPopoverComponent> {
    readonly popoverHideIfNotInViewPort = input<boolean>(true, {
        alias: 'kbqPopoverHideIfNotInViewPort'
    });
    readonly placementChange: EventEmitter<KbqPopUpPlacementValues>;
    readonly visibleChange: EventEmitter<boolean>;
    readonly panelId: string;
    preventClose: boolean;
    defaultPaddings: boolean;
    stickToWindow: KbqStickToWindowPlacementValues | undefined;
    container: HTMLElement | undefined;
    arrow: boolean;
    arrowCentered: boolean;
    offset: number | null;
    autoFocus: boolean;
    relativeToPointer: boolean;
    enterDelay: number;
    set popoverDefaultPaddings(value: boolean);
    popoverVisible: boolean;
    popoverPlacement: KbqPopUpPlacementValues;
    popoverPlacementPriority: string | string[] | null;
    set popoverContainer(value: HTMLElement | undefined);
    hasBackdrop: boolean;
    set popoverHasBackdrop(value: boolean);
    header: string | TemplateRef<any>;
    content: string | TemplateRef<any>;
    footer: string | TemplateRef<any>;
    disabled: boolean;
    trigger: string;
    size: KbqPopUpSizeValues;
    customClass: string;
    context: unknown;
    ariaLabel: string | undefined;
    hasCloseButton: boolean;
    set popoverHasCloseButton(value: boolean);
    closeOnScroll: boolean | null;
    set popoverCloseOnScroll(value: boolean);
    get hasClickTrigger(): boolean;
    get capturesFocusOnOpen(): boolean;
    backdropClass: string;
    set popoverBackdropClass(value: string);
    popoverOrigin: KbqOverlayOrigin | null;
    set kbqLeaveDelay(value: number);
    isOpen: boolean;
    get isAttached(): boolean;
    get openedChange(): Observable<boolean>;
    updatePosition(reapplyPosition?: boolean): void;
    restoreFocus(): void;
    close(): void;
    updateOrigin(origin: KbqOverlayOrigin | null): void;
}
```

- `[kbqPopoverHideIfNotInViewPort]`: `boolean` — Input (`kbqPopoverHideIfNotInViewPort`) — whether the popover closes once its trigger scrolls out of the
  nearest scrollable ancestor. A bound `null` or `undefined` restores the default, `true`.
- `placementChange`: `EventEmitter<KbqPopUpPlacementValues>` — Emits the resolved placement whenever the panel is repositioned.

  Declared as `string` to match the abstract member on `KbqPopUpTrigger`: `EventEmitter` is invariant,
  so a narrower emitter cannot override a wider one. Narrowing both is a change to the shared pop-up
  base and belongs to the branch that owns it.
- `visibleChange`: `EventEmitter<boolean>` — Emits `true` when the panel opens and `false` when it closes.
- `panelId`: `string` — Id of the panel this trigger controls, shared with `aria-controls`.
- `preventClose`: `boolean` — prevents closure by any event
- `defaultPaddings`: `boolean` — Whether the header, content and footer keep their default paddings. Bound with `kbqPopoverDefaultPaddings`.
- `stickToWindow`: `KbqStickToWindowPlacementValues | undefined` — Additionally positions the element relative to the window side (Top, Right, Bottom and Left).
  If container is specified, the positioning will be relative to it.
- `container`: `HTMLElement | undefined` — Container for additional positioning, used with `kbqPopoverStickToWindow`. Bound with `kbqPopoverContainer`.
- `arrow`: `boolean` — Input (`kbqPopoverArrow`) — renders the arrow pointing at the trigger.
- `arrowCentered`: `boolean` — Input (`kbqPopoverArrowCentered`) — centers the arrow on the trigger while preserving the panel placement.
  Defaults to `false`.
- `offset`: `number | null` — Input (`kbqPopoverOffset`) — distance between the trigger and the panel, in pixels.
- `autoFocus`: `boolean` — Input (`kbqPopoverAutoFocus`) — whether opening the popover moves the keyboard focus into the panel. Turn it
  off for a panel that must not disturb what the reader is doing: taking focus away from a text selection
  collapses it. Focus then never enters the panel, so its content has to be reachable some other way.
- `relativeToPointer`: `boolean` — Input (`kbqRelativeToPointer`) — positions a click-opened popover at the click point. Keyboard and
  programmatic opens stay on the trigger. An explicit `kbqPopoverOrigin` takes precedence. Defaults to `false`.
- `enterDelay`: `number` — Input (`kbqEnterDelay`) — delay before opening, in milliseconds. Defaults to `0`.
- `popoverDefaultPaddings`: `boolean` — Input (`kbqPopoverDefaultPaddings`) — sets `defaultPaddings`.
- `popoverVisible`: `boolean` — Input (`kbqPopoverVisible`) — opens the popover when set to `true` and closes it when set to `false`.
- `popoverPlacement`: `KbqPopUpPlacementValues` — Input (`kbqPopoverPlacement`) — preferred placement of the panel relative to the trigger.
- `popoverPlacementPriority`: `string | string[] | null` — Input (`kbqPopoverPlacementPriority`) — ordered placements tried before the default strategy.
- `popoverContainer`: `HTMLElement | undefined` — Input (`kbqPopoverContainer`) — sets `container`.
- `hasBackdrop`: `boolean` — Whether a backdrop is rendered behind the panel. With a backdrop the popover closes on a backdrop click
  instead of on any outside pointer event. Bound with `kbqPopoverHasBackdrop`.
- `popoverHasBackdrop`: `boolean` — Input (`kbqPopoverHasBackdrop`) — sets `hasBackdrop`.
- `header`: `string | TemplateRef<any>` — Input (`kbqPopoverHeader`) — header of the panel, as a string or a template.
- `content`: `string | TemplateRef<any>` — Input (`kbqPopoverContent`) — content of the panel, as a string or a template.
- `footer`: `string | TemplateRef<any>` — Input (`kbqPopoverFooter`) — footer of the panel, as a string or a template.
- `disabled`: `boolean` — Input (`kbqPopoverDisabled`) — disables the trigger and closes an open popover.
- `trigger`: `string` — Input (`kbqTrigger`) with the comma-separated trigger events. An empty value resets to click + keydown
  and rebinds listeners. The alias is shared with `kbqTooltip`, so binding it on an element that carries
  both reconfigures both.
- `size`: `KbqPopUpSizeValues` — Input (`kbqPopoverSize`) — preset width of the panel. An unknown value falls back to `medium`.
- `customClass`: `string` — Input (`kbqPopoverClass`) with extra CSS classes applied to the panel.
- `context`: `unknown` — Context for popover templates (kbqPopoverHeader, kbqPopoverContent and kbqPopoverFooter).
- `ariaLabel`: `string | undefined` — Accessible name of the panel. Ignored while a string `kbqPopoverHeader` is set — the header labels the
  dialog then — and recommended for every header-less popover.
- `hasCloseButton`: `boolean` — Renders the icon-only close button in the top corner of the panel. Bound with `kbqPopoverHasCloseButton`.
- `popoverHasCloseButton`: `boolean` — Input (`kbqPopoverHasCloseButton`) — sets `hasCloseButton`.
- `closeOnScroll`: `boolean | null` — Controls the behavior of closing the component on scroll. Bound with `kbqPopoverCloseOnScroll`. Three
  states:
  - `null` (default) — the popover survives a scroll, except when it scrolls out of a
    `.kbq-hide-nested-popup` container, which closes it;
  - `true` — any scroll closes the popover;
  - `false` — no scroll closes the popover, not even a `.kbq-hide-nested-popup` one.

  Use CloseScrollStrategy as alternative
- `popoverCloseOnScroll`: `boolean` — Input (`kbqPopoverCloseOnScroll`) — sets `closeOnScroll`.
- `hasClickTrigger`: `boolean` — Whether the trigger opens the popover on click, which is also what makes it a labelled dialog opener.
- `capturesFocusOnOpen`: `boolean` — Whether opening the popover should move the keyboard focus into the panel. Only deliberate opens
  (click, keyboard, programmatic) do — a hover- or focus-triggered popover must not steal focus.
- `backdropClass`: `string` — CSS class applied to the backdrop, when there is one. Bound with `kbqPopoverBackdropClass`.
- `popoverBackdropClass`: `string` — Input (`kbqPopoverBackdropClass`) — sets `backdropClass`.
- `popoverOrigin`: `KbqOverlayOrigin | null` — Input (`kbqPopoverOrigin`) — what the panel is positioned against: an element, or a rectangle in viewport
  coordinates such as the one `kbqCreateCaretOrigin` keeps on the caret. `null` anchors it to the trigger.

  Bind it before `kbqPopoverVisible`, which opens the panel as it is written.
- `kbqLeaveDelay`: `number` — Input (`kbqLeaveDelay`) — delay before closing, in milliseconds. Defaults to `0`, and to
  `defaultHoverLeaveDelay` when `kbqTrigger` includes `hover`.
- `isOpen`: `boolean` — Whether the pop-up overlay is currently open.
- `isAttached`: `boolean` — Whether the pop-up overlay is currently attached.

  Unlike `isOpen`, which follows the visibility of the pop-up component and therefore lags a task behind
  `show()`/`hide()`, this flips synchronously — it is the window during which the overlay (and its
  backdrop) is present in the DOM. Part of the `KbqSiblingPopup` contract.
- `openedChange`: `Observable<boolean>` — Emits `true` when the pop-up opens and `false` when it closes. Part of the `KbqSiblingPopup` contract.
- `updatePosition()`: `void` — Re-applies the overlay position.

  Deliberately narrower than the inherited one, which also rebuilds the closing-action subscription:
  that stream carries a `delay(0)`, so a reposition coalesced into the same task as an outside click —
  which is the task in which that click's change detection writes a popover input — would drop the
  close the click had already scheduled.
- `restoreFocus()`: `void` — Returns focus to the trigger when the popover is closed while focus is still inside its panel.

  Goes through `FocusMonitor` rather than a native `focus()` call: the kbq focus ring is only rendered
  for a monitored origin, and a `program` origin keeps a tooltip on the same element from re-opening.
- `close()`: `void` — Closes the popover on a deliberate action — the panel's close button, or `Escape` inside the panel.

  `hide()` keeps a hover popover open while the pointer rests on the panel, so that the pointer can
  travel from the trigger to the content; that is exactly where the pointer is when the close button is
  clicked, so a deliberate close answers to `kbqPopoverPreventClose` and to nothing else.
- `updateOrigin()`: `void` — Positions the pop-up against `origin` — an element, or a rectangle in viewport coordinates such as the one
  `kbqCreateCaretOrigin` keeps on the caret — instead of the host element; `null` restores the host
  element. An open pop-up moves to the new origin at once.

  This moves the position origin only. `setExternalNativeElement` moves the host itself, and with it
  the trigger's event listeners, its focus target and the scroll containers the pop-up follows.

## Constants

### defaultHoverLeaveDelay (const)

Leave delay applied to a hover-triggered popover when `kbqLeaveDelay` is not bound.

```ts
const defaultHoverLeaveDelay: number;
```

### defaultOffsetYWithArrow (const)

```ts
const defaultOffsetYWithArrow: number;
```

### KBQ_POPOVER_CONFIRM_BUTTON_TEXT (const)

Overrides the confirm-button caption of every confirmation popover in the injector scope. Takes precedence
over the locale, but not over the `kbqPopoverConfirmButtonText` input.

```ts
const KBQ_POPOVER_CONFIRM_BUTTON_TEXT: InjectionToken<string>;
```

### KBQ_POPOVER_CONFIRM_TEXT (const)

Overrides the question of every confirmation popover in the injector scope. Takes precedence over the
locale, but not over the `kbqPopoverConfirmText` input.

```ts
const KBQ_POPOVER_CONFIRM_TEXT: InjectionToken<string>;
```

### KBQ_POPOVER_SCROLL_STRATEGY (const)

```ts
const KBQ_POPOVER_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
```
