@cngx/common 0.1.0-rc.8 → 0.1.0-rc.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/command/README.md +29 -0
  2. package/data/README.md +5 -2
  3. package/fesm2022/cngx-common-a11y.mjs +403 -84
  4. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  5. package/fesm2022/cngx-common-audio.mjs +16 -13
  6. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  7. package/fesm2022/cngx-common-card.mjs +4 -3
  8. package/fesm2022/cngx-common-card.mjs.map +1 -1
  9. package/fesm2022/cngx-common-chart.mjs +55 -36
  10. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  11. package/fesm2022/cngx-common-command.mjs +60 -6
  12. package/fesm2022/cngx-common-command.mjs.map +1 -1
  13. package/fesm2022/cngx-common-data.mjs +185 -37
  14. package/fesm2022/cngx-common-data.mjs.map +1 -1
  15. package/fesm2022/cngx-common-dialog.mjs +86 -48
  16. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  17. package/fesm2022/cngx-common-display.mjs +27 -23
  18. package/fesm2022/cngx-common-display.mjs.map +1 -1
  19. package/fesm2022/cngx-common-interactive.mjs +324 -122
  20. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  21. package/fesm2022/cngx-common-layout.mjs +129 -26
  22. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  23. package/fesm2022/cngx-common-popover.mjs +947 -33
  24. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  25. package/fesm2022/cngx-common-stepper.mjs +300 -166
  26. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  27. package/fesm2022/cngx-common-tabs.mjs +251 -80
  28. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  29. package/fesm2022/cngx-common-timeline.mjs +16 -10
  30. package/fesm2022/cngx-common-timeline.mjs.map +1 -1
  31. package/fesm2022/cngx-common.mjs +1 -1
  32. package/layout/README.md +16 -0
  33. package/package.json +20 -7
  34. package/popover/README.md +40 -0
  35. package/schematics/collection.json +9 -0
  36. package/schematics/ng-add/index.js +9 -0
  37. package/schematics/ng-add/schema.json +91 -0
  38. package/schematics/package.json +3 -0
  39. package/stepper/README.md +5 -4
  40. package/theming/components/cngx-popover-sheet.css +402 -0
  41. package/theming/components/cngx-popover.css +10 -6
  42. package/types/cngx-common-a11y.d.ts +167 -14
  43. package/types/cngx-common-chart.d.ts +8 -7
  44. package/types/cngx-common-command.d.ts +19 -2
  45. package/types/cngx-common-data.d.ts +164 -26
  46. package/types/cngx-common-dialog.d.ts +3 -7
  47. package/types/cngx-common-interactive.d.ts +52 -17
  48. package/types/cngx-common-layout.d.ts +37 -5
  49. package/types/cngx-common-popover.d.ts +353 -13
  50. package/types/cngx-common-stepper.d.ts +168 -129
  51. package/types/cngx-common-tabs.d.ts +149 -30
  52. package/types/cngx-common-timeline.d.ts +27 -7
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-common-popover.mjs","sources":["../../../projects/common/popover/anchor-positioning.ts","../../../projects/common/popover/popover-arrow-bounds.ts","../../../projects/common/popover/floating-fallback.ts","../../../projects/common/popover/popover.directive.ts","../../../projects/common/popover/popover-trigger.directive.ts","../../../projects/common/popover/popover-anchor.directive.ts","../../../projects/common/popover/tooltip.directive.ts","../../../projects/common/popover/popover-panel.config.ts","../../../projects/common/popover/i18n/popover-language-section.ts","../../../projects/common/popover/popover-panel-slots.ts","../../../projects/common/popover/popover-panel.component.ts","../../../projects/common/popover/popover-action.component.ts","../../../projects/common/popover/popover-divider.directive.ts","../../../projects/common/popover/public-api.ts","../../../projects/common/popover/cngx-common-popover.ts"],"sourcesContent":["import type { CngxDirection } from '@cngx/core';\n\nimport type { PopoverPlacement } from './popover.types';\n\n/**\n * @internal\n * Detect CSS Anchor Positioning support.\n *\n * The spec renamed `inset-area` to `position-area` (Chrome 129+, Safari 18.4+).\n * Chrome 125-128 only supports the old `inset-area` name.\n * We detect whichever is available and use it consistently.\n */\nfunction detectAnchorSupport(): { supported: boolean; propertyName: string } {\n if (typeof CSS === 'undefined') {\n return { supported: false, propertyName: 'position-area' };\n }\n if (CSS.supports('position-area', 'bottom')) {\n return { supported: true, propertyName: 'position-area' };\n }\n if (CSS.supports('inset-area', 'bottom')) {\n return { supported: true, propertyName: 'inset-area' };\n }\n return { supported: false, propertyName: 'position-area' };\n}\n\n/** @internal */\nconst ANCHOR_SUPPORT = detectAnchorSupport();\n\n/** @internal `true` when the browser supports CSS Anchor Positioning. */\nexport const SUPPORTS_ANCHOR = ANCHOR_SUPPORT.supported;\n\n/** @internal The CSS property name for anchor area positioning (`position-area` or `inset-area`). */\nexport const ANCHOR_AREA_PROPERTY = ANCHOR_SUPPORT.propertyName;\n\n/**\n * @internal\n * CSS anchor area values mapped from logical placement tokens.\n *\n * Uses physical keywords only - Chrome does not support logical keywords\n * (`start`/`end`/`span-inline-*`) in `position-area` as of Chrome 140.\n *\n * `*-start` and `*-end` resolve to a `<direction> <span-*>` pair, NOT a\n * corner cell (`top right` etc.). Corner-cell values produce diagonal\n * placement relative to the anchor - visually wrong for edge-aligned\n * popovers. The `<direction> <span-*>` form keeps the popover on the\n * named edge while spanning toward the named alignment:\n * `right-start` → `right span-bottom` (right column, anchor's top edge aligned)\n * `right-end` → `right span-top` (right column, anchor's bottom edge aligned)\n * Single-keyword placements (`top`/`bottom`/`left`/`right`) resolve to\n * the edge-centered case (`position-area: right` + default\n * `justify-self: anchor-center`) and need no span keyword.\n */\nexport const POSITION_AREA: Record<PopoverPlacement, string> = {\n top: 'top span-all',\n 'top-start': 'top span-right',\n 'top-end': 'top span-left',\n bottom: 'bottom span-all',\n 'bottom-start': 'bottom span-right',\n 'bottom-end': 'bottom span-left',\n left: 'left span-all',\n 'left-start': 'left span-bottom',\n 'left-end': 'left span-top',\n right: 'right span-all',\n 'right-start': 'right span-bottom',\n 'right-end': 'right span-top',\n};\n\n/**\n * @internal\n * CSS `margin` shorthand that puts `offsetPx` between the popover and its\n * anchor on the placement's main axis only: the block axis for `top` /\n * `bottom`, the inline axis for `left` / `right`. The cross axis stays at\n * `0`, so `-start` / `-end` placements sit flush with the anchor edge -\n * the same geometry `makeOffsetMiddleware` produces on the floating-ui\n * path.\n *\n * Both sides of the main axis carry the offset so the gap survives every\n * `position-try-fallbacks` tactic: `flip-block` / `flip-inline` mirror\n * within the axis, `flip-start` transposes the margin together with the\n * `position-area`. There is deliberately no cross-axis margin, so a\n * cross-aligned popover may touch the viewport edge; overflow recovery\n * belongs to `position-try-fallbacks`.\n *\n * Takes the requested, direction-resolved placement, never the measured\n * edge, so the margin never feeds geometry back into geometry.\n */\nexport function resolveAnchorMargin(placement: PopoverPlacement, offsetPx: number): string {\n const side = placement.split('-')[0];\n const isBlockSide = side === 'top' || side === 'bottom';\n return isBlockSide ? `${offsetPx}px 0` : `0 ${offsetPx}px`;\n}\n\n/**\n * @internal\n * Full physical mirror of every placement token under `rtl`: the left/right\n * side swaps, and a block-placement's inline *alignment* (`-start <-> -end`)\n * swaps too. Feeds the CSS-anchor path only - {@link POSITION_AREA} uses\n * physical keywords with no direction awareness, so the whole mirror must\n * happen in TS. The block edge (`top`/`bottom`) never flips.\n *\n * Total `Record` (identity entries for `top`/`bottom`) so a future placement\n * token fails the exhaustiveness check at compile time rather than silently\n * losing its mirror at runtime - the same guard {@link POSITION_AREA} and\n * `FLOATING_PLACEMENT` already carry.\n */\nconst INLINE_MIRROR: Record<PopoverPlacement, PopoverPlacement> = {\n top: 'top',\n bottom: 'bottom',\n 'top-start': 'top-end',\n 'top-end': 'top-start',\n 'bottom-start': 'bottom-end',\n 'bottom-end': 'bottom-start',\n left: 'right',\n right: 'left',\n 'left-start': 'right-start',\n 'right-start': 'left-start',\n 'left-end': 'right-end',\n 'right-end': 'left-end',\n};\n\n/**\n * @internal\n * Side-only mirror for the floating-ui path under `rtl`: the left/right side\n * swaps (keeping any `-start`/`-end` suffix), but a block-placement's inline\n * alignment is left untouched. `@floating-ui/dom`'s `computePosition` already\n * flips the alignment of vertical placements under `rtl` (its default\n * `platform.isRTL` reads the floating element's `direction`), while keeping\n * the side physical. Pre-flipping the alignment here as well would double-flip\n * `top-start` / `bottom-end` back to their ltr position - so the floating path\n * mirrors the side and defers alignment to floating-ui.\n *\n * Total `Record` for the same compile-time exhaustiveness guard as\n * {@link INLINE_MIRROR}.\n */\nconst FLOATING_MIRROR: Record<PopoverPlacement, PopoverPlacement> = {\n top: 'top',\n bottom: 'bottom',\n 'top-start': 'top-start',\n 'top-end': 'top-end',\n 'bottom-start': 'bottom-start',\n 'bottom-end': 'bottom-end',\n left: 'right',\n right: 'left',\n 'left-start': 'right-start',\n 'right-start': 'left-start',\n 'left-end': 'right-end',\n 'right-end': 'left-end',\n};\n\n/**\n * @internal\n * Resolve a logical placement token for the **CSS-anchor** path against the\n * writing direction: full inline mirror under `rtl`, identity under `ltr`.\n * {@link POSITION_AREA} is keyed by physical placement with no direction\n * awareness, so mirroring the key here - before the lookup - is what places\n * the panel on the direction-forward side.\n *\n * The block axis never flips: `top`/`bottom` (no inline component) are the\n * identity, and `top-start`/`bottom-start` mirror only their inline\n * *alignment* (`-start <-> -end`), not the block edge. Same inline-only rule\n * the keyboard direction-awareness applies (`resolveInlineStep`).\n *\n * NOTE: the floating-ui path must NOT use this - floating-ui flips vertical\n * alignment itself under `rtl`. Use {@link resolveFloatingPlacement} there.\n *\n * Pure, O(1) lookup - a mechanical kernel, not a DI chokepoint; each surface\n * injects its own direction and calls this at its CSS-anchor placement source.\n *\n * @param placement The logical placement token the consumer requested.\n * @param direction The document writing direction from `injectDirection`.\n * @returns The fully inline-mirrored token under `rtl`, else `placement`.\n */\nexport function resolveDirectionalPlacement(\n placement: PopoverPlacement,\n direction: CngxDirection,\n): PopoverPlacement {\n if (direction !== 'rtl') {\n return placement;\n }\n return INLINE_MIRROR[placement];\n}\n\n/**\n * @internal\n * Resolve a logical placement token for the **floating-ui fallback** path\n * against the writing direction: side-only mirror under `rtl`, identity under\n * `ltr`. `@floating-ui/dom` already flips the inline alignment of vertical\n * placements under `rtl`, so this mirrors the side (`left <-> right`, suffix\n * preserved) and leaves the alignment for floating-ui - avoiding the\n * double-flip that a full mirror would cause on `top-start` / `bottom-end`.\n *\n * @param placement The logical placement token the consumer requested.\n * @param direction The document writing direction from `injectDirection`.\n * @returns The side-mirrored token under `rtl`, else `placement`.\n */\nexport function resolveFloatingPlacement(\n placement: PopoverPlacement,\n direction: CngxDirection,\n): PopoverPlacement {\n if (direction !== 'rtl') {\n return placement;\n }\n return FLOATING_MIRROR[placement];\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Geometry contract for the popover panel's arrow ornament.\n *\n * Provided by `CngxPopoverPanel` (via `useExisting`) so that `CngxPopover`\n * can read panel-side layout constants - primarily the border-radius\n * used to clamp the arrow inside the panel's rounded corners - through a\n * typed contract rather than reaching into the panel's CSS custom\n * properties directly. Inverts the atom -> molecule dependency direction\n * that an earlier `getComputedStyle('--cngx-popover-panel-border-radius')`\n * read had introduced on `CngxPopover`.\n *\n * `CngxPopover` injects the token with `{ optional: true }` so it keeps\n * working when used outside a `CngxPopoverPanel` (e.g. bare `[cngxPopover]`\n * on a `<div>`). The fallback value matches the panel's default\n * border-radius initial value (12 px).\n *\n * @category common/popover\n */\nexport interface CngxPopoverArrowBounds {\n /**\n * Panel border-radius in CSS pixels. Used by `CngxPopover` to clamp\n * the arrow offset inside the panel's rounded-corner extent.\n */\n readonly borderRadius: number;\n}\n\n/**\n * Injection token for the arrow-bounds contract.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-arrow-bounds.ts\n * @since 0.1.0\n */\nexport const CNGX_POPOVER_ARROW_BOUNDS = new InjectionToken<CngxPopoverArrowBounds>(\n 'CngxPopoverArrowBounds',\n);\n","import { InjectionToken, type Provider } from '@angular/core';\n\nimport type { PopoverPlacement } from './popover.types';\n\n/**\n * Signature matching `@floating-ui/dom` `computePosition`.\n * The consumer provides the actual function - the library never imports it directly.\n *\n * @category common/popover\n */\nexport type ComputePositionFn = (\n reference: HTMLElement,\n floating: HTMLElement,\n options?: {\n placement?: string;\n middleware?: unknown[];\n },\n) => Promise<{ x: number; y: number; placement: string }>;\n\n/**\n * Configuration for the Floating UI positioning fallback.\n *\n * @category common/popover\n */\nexport interface FloatingFallbackConfig {\n /** The `computePosition` function from `@floating-ui/dom`. */\n computePosition: ComputePositionFn;\n /**\n * Middleware array (e.g. `[flip(), shift()]`). The popover prepends its own\n * offset middleware, so do not pass `offset()` here.\n */\n middleware?: unknown[];\n}\n\n/**\n * Injection token for the Floating UI fallback.\n * `null` when not provided - CSS Anchor Positioning is used instead.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/floating-fallback.ts\n * @since 0.1.0\n */\nexport const CNGX_FLOATING_FALLBACK = new InjectionToken<FloatingFallbackConfig | null>(\n 'CngxFloatingFallback',\n { factory: () => null },\n);\n\n/**\n * Provides the Floating UI positioning fallback for browsers without\n * CSS Anchor Positioning support.\n *\n * The consumer must install `@floating-ui/dom` themselves - this library\n * never imports it directly, keeping the bundle at zero cost for modern browsers.\n *\n * ```typescript\n * import { computePosition, flip, shift } from '@floating-ui/dom';\n *\n * // In app.config.ts or component providers:\n * providers: [\n * provideFloatingFallback(computePosition, [flip(), shift()]),\n * ]\n * ```\n *\n * @category common/popover\n */\nexport function provideFloatingFallback(\n computePosition: ComputePositionFn,\n middleware?: unknown[],\n): Provider {\n return {\n provide: CNGX_FLOATING_FALLBACK,\n useValue: { computePosition, middleware } satisfies FloatingFallbackConfig,\n };\n}\n\n/**\n * @internal\n * Inputs for {@link createFloatingPositioner}. All element/config reads are\n * thunks so the positioner always sees the live value - placement and offset\n * are signal-backed on both call sites.\n */\nexport interface FloatingPositionerOptions {\n /** The consumer-provided fallback config from `CNGX_FLOATING_FALLBACK`. */\n fallback: FloatingFallbackConfig;\n /** Anchor (trigger) element. `null` skips the positioning pass. */\n getAnchor: () => HTMLElement | null;\n /** The floating element. `null` skips the positioning pass. */\n getElement: () => HTMLElement | null;\n /** Resolved Floating UI placement string (a `FLOATING_PLACEMENT` value). */\n getPlacement: () => string;\n /** Gap between anchor and floating element in px. */\n getOffset: () => number;\n /** Open guard - closes drop queued listener re-runs and in-flight writes. */\n isOpen: () => boolean;\n /** Invoked after every applied coordinate write. */\n onPositioned?: () => void;\n}\n\n/** @internal Handle returned by {@link createFloatingPositioner}. */\nexport interface FloatingPositioner {\n /** One positioning pass (no-op unless open with anchor + element). */\n update(): void;\n /** Position now and re-run on scroll/resize until {@link stop}. */\n start(): void;\n /** Detach the scroll/resize listeners. Idempotent. */\n stop(): void;\n}\n\n/**\n * @internal\n * Offset expressed as a Floating UI middleware literal instead of a margin\n * write: margin pushes the panel along BOTH axes and is invisible to the\n * consumer's flip/shift middleware, so collision recovery would compute\n * against the un-offset rect. Runs first in the chain for the same reason\n * `offset()` must in `@floating-ui/dom`.\n */\nfunction makeOffsetMiddleware(offsetPx: number): unknown {\n return {\n name: 'cngxOffset',\n fn: (state: { x: number; y: number; placement: string }): { x?: number; y?: number } => {\n const side = state.placement.split('-')[0];\n if (side === 'top') {\n return { y: state.y - offsetPx };\n }\n if (side === 'bottom') {\n return { y: state.y + offsetPx };\n }\n if (side === 'left') {\n return { x: state.x - offsetPx };\n }\n if (side === 'right') {\n return { x: state.x + offsetPx };\n }\n return {};\n },\n };\n}\n\n/**\n * @internal\n * The one floating-ui fallback engine shared by `CngxPopover` and\n * `CngxTooltip`. Owns the three concerns the per-directive copies each\n * half-implemented: the offset (as middleware, see above), the re-run on\n * scroll/resize while open (CSS Anchor tracks the anchor natively; the\n * fallback must do it by hand), and the state guard on the async\n * `computePosition` write (a close during the in-flight promise must not\n * resurrect stale coordinates).\n */\nexport function createFloatingPositioner(options: FloatingPositionerOptions): FloatingPositioner {\n let listening = false;\n let listenerDoc: Document | null = null;\n\n const update = (): void => {\n const anchor = options.getAnchor();\n const el = options.getElement();\n if (!anchor || !el || !options.isOpen()) {\n return;\n }\n const fb = options.fallback;\n const middleware = [makeOffsetMiddleware(options.getOffset()), ...(fb.middleware ?? [])];\n void fb\n .computePosition(anchor, el, { placement: options.getPlacement(), middleware })\n .then(({ x, y }) => {\n if (!options.isOpen()) {\n return;\n }\n const target = options.getElement();\n if (!target) {\n return;\n }\n target.style.left = `${x}px`;\n target.style.top = `${y}px`;\n options.onPositioned?.();\n });\n };\n\n const handleReposition = (): void => update();\n\n return {\n update,\n start(): void {\n update();\n if (listening) {\n return;\n }\n const doc = options.getElement()?.ownerDocument ?? null;\n const view = doc?.defaultView ?? null;\n if (!doc || !view) {\n return;\n }\n // Capture phase: scroll events from inner scroll containers do not\n // bubble, but they do traverse the capture path.\n doc.addEventListener('scroll', handleReposition, true);\n view.addEventListener('resize', handleReposition);\n listenerDoc = doc;\n listening = true;\n },\n stop(): void {\n if (!listening) {\n return;\n }\n listenerDoc?.removeEventListener('scroll', handleReposition, true);\n listenerDoc?.defaultView?.removeEventListener('resize', handleReposition);\n listenerDoc = null;\n listening = false;\n },\n };\n}\n\n/** @internal Maps cngx placement tokens to Floating UI placement strings. */\nexport const FLOATING_PLACEMENT: Record<PopoverPlacement, string> = {\n top: 'top',\n 'top-start': 'top-start',\n 'top-end': 'top-end',\n bottom: 'bottom',\n 'bottom-start': 'bottom-start',\n 'bottom-end': 'bottom-end',\n left: 'left',\n 'left-start': 'left-start',\n 'left-end': 'left-end',\n right: 'right',\n 'right-start': 'right-start',\n 'right-end': 'right-end',\n};\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n isDevMode,\n signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent } from 'rxjs';\n\nimport { injectDirection } from '@cngx/core';\nimport {\n createSlotRegistry,\n hasTransition,\n nextUid,\n onTransitionDone,\n type TransitionDoneHandle,\n} from '@cngx/core/utils';\n\nimport {\n ANCHOR_AREA_PROPERTY,\n POSITION_AREA,\n resolveAnchorMargin,\n resolveDirectionalPlacement,\n resolveFloatingPlacement,\n SUPPORTS_ANCHOR,\n} from './anchor-positioning';\nimport { CNGX_POPOVER_ARROW_BOUNDS, type CngxPopoverArrowBounds } from './popover-arrow-bounds';\nimport {\n CNGX_FLOATING_FALLBACK,\n createFloatingPositioner,\n FLOATING_PLACEMENT,\n} from './floating-fallback';\nimport type {\n ArrowEdge,\n PopoverHaspopup,\n PopoverMode,\n PopoverPlacement,\n PopoverPositionTryFallback,\n PopoverState,\n} from './popover.types';\n\n/**\n * @internal Module-level registry of open popovers (insertion-ordered).\n */\nconst openPopovers = new Set<CngxPopover>();\n\n/**\n * @internal\n * Derive the panel's actual placement relative to the trigger from the live\n * rects. The arrow always sits on the panel edge that *faces* the trigger,\n * so a `position-try-fallbacks` flip (e.g. requested `bottom`, browser\n * resolved to `top` because there is no room below) routes the arrow to the\n * opposite edge without the consumer touching anything.\n *\n * Returns the requested placement's primary edge when the rects overlap -\n * the only case where no clean side is geometrically correct.\n */\nfunction resolveActualEdge(\n trigger: DOMRect,\n panel: DOMRect,\n requested: PopoverPlacement,\n): ArrowEdge {\n const tolerance = 4;\n if (panel.top >= trigger.bottom - tolerance) {\n return 'bottom';\n }\n if (panel.bottom <= trigger.top + tolerance) {\n return 'top';\n }\n if (panel.right <= trigger.left + tolerance) {\n return 'left';\n }\n if (panel.left >= trigger.right - tolerance) {\n return 'right';\n }\n return requested.split('-')[0] as ArrowEdge;\n}\n\n/** @internal Tracks which Documents already have the global Escape listener. */\nconst escapeListenerDocs = new WeakSet<Document>();\n/** @internal */\nfunction installGlobalEscapeListener(doc: Document): void {\n if (escapeListenerDocs.has(doc)) {\n return;\n }\n escapeListenerDocs.add(doc);\n doc.addEventListener('keydown', (e: KeyboardEvent) => {\n if (e.key !== 'Escape' || openPopovers.size === 0) {\n return;\n }\n // most-recently-opened wins (relies on Set's insertion-order iteration)\n const last = [...openPopovers].at(-1);\n if (last?.closeOnEscape()) {\n e.stopPropagation();\n last.hide();\n }\n });\n}\n\n/** @internal Tracks which Documents already have the global outside-click listener. */\nconst outsideClickListenerDocs = new WeakSet<Document>();\n/** @internal */\nfunction installGlobalOutsideClickListener(doc: Document): void {\n if (outsideClickListenerDocs.has(doc)) {\n return;\n }\n outsideClickListenerDocs.add(doc);\n // Capture phase so the dismiss decision runs before in-popover handlers can\n // stopPropagation. Snapshot the set: hide() mutates `openPopovers` mid-loop.\n doc.addEventListener(\n 'pointerdown',\n (e: PointerEvent) => {\n if (openPopovers.size === 0) {\n return;\n }\n for (const popover of [...openPopovers]) {\n popover.closeIfOutsidePointerDown(e.target);\n }\n },\n true,\n );\n}\n\n/** @internal Tracks which Documents have already warned about missing Popover API. */\nconst popoverApiWarnedDocs = new WeakSet<Document>();\n/** @internal */\nfunction warnMissingPopoverApi(el: HTMLElement): void {\n const doc = el.ownerDocument;\n if (popoverApiWarnedDocs.has(doc) || !isDevMode()) {\n return;\n }\n if (typeof el.showPopover !== 'function') {\n popoverApiWarnedDocs.add(doc);\n console.warn(\n 'CngxPopover: The native Popover API is not supported in this browser. ' +\n 'Install @oddbird/popover-polyfill and import it in your polyfills:\\n\\n' +\n ' npm install @oddbird/popover-polyfill\\n' +\n ' // polyfills.ts\\n' +\n \" import '@oddbird/popover-polyfill';\\n\",\n );\n }\n}\n\n/** @internal Tracks which Documents have already warned about missing Floating-UI middleware. */\nconst floatingMiddlewareWarnedDocs = new WeakSet<Document>();\n\n/**\n * @internal - test hook. Resets the per-Document warning suppression so\n * specs can exercise the warning path against a shared jsdom Document.\n * Do not call from production code.\n */\nexport function __resetFloatingMiddlewareWarnings(doc: Document): void {\n floatingMiddlewareWarnedDocs.delete(doc);\n}\n/** @internal */\nfunction warnMissingFloatingMiddleware(doc: Document): void {\n if (floatingMiddlewareWarnedDocs.has(doc) || !isDevMode()) {\n return;\n }\n floatingMiddlewareWarnedDocs.add(doc);\n console.warn(\n 'CngxPopover: provideFloatingFallback(computePosition) was registered without middleware. ' +\n 'Popovers in browsers without CSS Anchor Positioning will clip against the viewport edge ' +\n 'because no flip/shift recovery is configured. Pass middleware on registration:\\n\\n' +\n \" import { computePosition, flip, shift } from '@floating-ui/dom';\\n\\n\" +\n ' providers: [\\n' +\n ' provideFloatingFallback(computePosition, [flip(), shift()]),\\n' +\n ' ],\\n',\n );\n}\n\n/**\n * Signal-driven state machine for the native Popover API.\n *\n * Wraps the browser's `popover` attribute with reactive state,\n * CSS-transition-aware lifecycle, and CSS Anchor Positioning.\n * Pure state machine - contains no trigger logic, no delays.\n *\n * State lifecycle: `closed` → `opening` → `open` → `closing` → `closed`.\n * CSS classes `cngx-popover--opening`, `cngx-popover--open`, and\n * `cngx-popover--closing` are applied to the host for transition hooks.\n *\n * ### Declarative click popover\n * ```html\n * <button [cngxPopoverTrigger]=\"pop\" (click)=\"pop.toggle()\">Menu</button>\n * <div cngxPopover #pop=\"cngxPopover\" placement=\"bottom-start\">\n * <menu><li>Edit</li><li>Delete</li></menu>\n * </div>\n * ```\n *\n * ### Controlled open state\n * ```html\n * <div cngxPopover [cngxPopoverOpen]=\"showErrors()\" role=\"alert\">\n * {{ errorSummary() }}\n * </div>\n * ```\n * <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>\n * <example-url>http://localhost:4200/#/common/popover/click-popover</example-url>\n * <example-url>http://localhost:4200/#/common/popover/controlled-open</example-url>\n * <example-url>http://localhost:4200/#/common/popover/escape-mode</example-url>\n * <example-url>http://localhost:4200/#/common/popover/placement-variants</example-url>\n *\n * ### Collision recovery with `<try-tactic>` fallbacks\n * Apply CSS Anchor Positioning's `position-try-fallbacks` declaratively\n * by binding the new `positionTryFallbacks` input. Each entry is a CSS\n * `<try-tactic>` keyword (or composed pair) written verbatim into the\n * host's `position-try-fallbacks` property. Mirrors the precedent in\n * `@cngx/forms/select` panels.\n *\n * ```html\n * <div cngxPopover\n * placement=\"right-start\"\n * [positionTryFallbacks]=\"['flip-inline', 'flip-block', 'flip-block flip-inline']\">\n * <!-- popover content -->\n * </div>\n * ```\n *\n * When the array is empty (default), the host does not write a\n * `position-try-fallbacks` style - the browser positions the popover at\n * the declared `placement` regardless of viewport clipping.\n *\n * @category common/popover\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverTrigger, CngxPopoverPanel, CngxTooltip\n */\n@Directive({\n selector: '[cngxPopover]',\n exportAs: 'cngxPopover',\n standalone: true,\n host: {\n '[attr.popover]': 'mode()',\n '[id]': 'id()',\n '[attr.aria-hidden]': '!isVisible()',\n '[attr.data-arrow-placement]': 'resolvedEdge()',\n '[class.cngx-popover--opening]': 'isOpening()',\n '[class.cngx-popover--open]': 'isOpen()',\n '[class.cngx-popover--closing]': 'isClosing()',\n '[style.position-anchor]': 'cssAnchorRef()',\n '[style.position-try-fallbacks]': 'cssPositionTryFallbacks()',\n '[style.margin]': 'cssMargin()',\n '[style.--cngx-popover-arrow-offset]': 'arrowOffset()',\n '(toggle)': 'handleToggle($event)',\n },\n})\nexport class CngxPopover {\n /**\n * Host ElementRef. Public for consumers that need to pass the\n * popover's native element to APIs expecting an `ElementRef`\n * (scroll observers, intersection observers, focus managers, …).\n * Notable consumer: `injectRecycler({ scrollElement: pop.elementRef })`\n * for `@cngx/forms/select` virtualisation - the popover IS the\n * scroll container when `select-base.css`'s `max-height + overflow-y`\n * rules apply.\n */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly elRef = this.elementRef;\n private readonly destroyRef = inject(DestroyRef);\n private readonly doc = inject(DOCUMENT);\n private readonly floatingFallback = inject(CNGX_FLOATING_FALLBACK, { optional: true });\n private readonly _injector = inject(Injector);\n private readonly direction = injectDirection();\n\n // Armed while a close transition runs; cancelled on destroy so the\n // transitionend listener and fallback timer never outlive the directive.\n private pendingClose: TransitionDoneHandle | null = null;\n /**\n * Arrow-bounds contract resolved lazily on first use.\n * Eager inject() would loop: CngxPopover (host directive on the panel)\n * is constructed BEFORE the panel itself, so `useExisting: CngxPopoverPanel`\n * cannot resolve at directive-construction time.\n */\n private _arrowBounds: CngxPopoverArrowBounds | null | undefined = undefined;\n private getArrowBounds(): CngxPopoverArrowBounds | null {\n if (this._arrowBounds === undefined) {\n this._arrowBounds = this._injector.get(CNGX_POPOVER_ARROW_BOUNDS, null);\n }\n return this._arrowBounds;\n }\n\n /** Anchor-relative placement. */\n readonly placement = input<PopoverPlacement>('bottom');\n\n /**\n * CSS `<try-tactic>` fallbacks for `position-try-fallbacks`. Empty\n * array (default) means the host does not write the property at all.\n * Non-empty entries are written verbatim, comma-joined, in declaration\n * order. Spec-compatible vocabulary only (no cngx placement tokens).\n */\n readonly positionTryFallbacks = input<readonly PopoverPositionTryFallback[]>([]);\n\n /**\n * Gap between anchor and popover in px, on the placement's main axis\n * (block axis for `top` / `bottom`, inline axis for `left` / `right`);\n * the cross axis stays flush. Same on both positioning engines.\n */\n readonly offset = input(8);\n\n /** Whether Escape key dismisses the popover. */\n readonly closeOnEscape = input(true);\n\n /**\n * Whether a `pointerdown` outside both the popover and its anchor (trigger)\n * dismisses it - menu / listbox light-dismiss. Opt-in (default `false`) so\n * existing manual-mode popovers keep full control; the anchor is excluded so\n * a click on the trigger toggles via the trigger's own handler instead of\n * being closed here and immediately reopened.\n */\n readonly closeOnOutsideClick = input(false);\n\n /** Native popover mode. `'manual'` for full control, `'auto'` for browser light dismiss. */\n readonly mode = input<PopoverMode>('manual');\n\n /**\n * Controlled open state. When set, drives the popover reactively.\n * `undefined` = uncontrolled (default).\n */\n readonly controlledOpen = input<boolean | undefined>(undefined, {\n alias: 'cngxPopoverOpen',\n });\n\n /**\n * When `true` (default), opening this popover closes any other open\n * `CngxPopover` instance. Set to `false` to allow multiple popovers\n * open simultaneously.\n *\n * Exclusivity governs sibling popovers only: a popover nested inside\n * another open popover (a select panel or submenu opening within a\n * popover-hosted surface) is that container's child, not a rival, and\n * never evicts its ancestor.\n */\n readonly exclusive = input(true);\n\n /**\n * Programmatic override of {@link exclusive}. `null` (default) defers to the\n * `[exclusive]` input; a boolean wins over it. Lets a composing organism\n * (e.g. a submenu wiring in `@cngx/ui/context-menu`) open a nested panel\n * non-exclusively without a consumer-side `[exclusive]=\"false\"` handgrip.\n * Controlled+uncontrolled derivation: {@link effectiveExclusive} resolves\n * the override first, then the input.\n */\n private readonly exclusiveOverrideState = signal<boolean | null>(null);\n\n /**\n * @internal Read-only view of the programmatic {@link exclusive} override.\n * Written via {@link setExclusiveOverride}.\n */\n readonly exclusiveOverride = this.exclusiveOverrideState.asReadonly();\n\n /** Effective exclusivity - override wins, else the `[exclusive]` input. */\n private readonly effectiveExclusive = computed<boolean>(\n () => this.exclusiveOverride() ?? this.exclusive(),\n );\n\n /**\n * Programmatic override of {@link placement}. `null` (default) defers to the\n * `[placement]` input; a value wins over it. Lets a composing organism (the\n * submenu wiring in `@cngx/ui/context-menu`) flank a nested panel to the\n * inline-end without a consumer-side `[placement]` handgrip. Mirrors\n * {@link exclusiveOverride}; {@link effectivePlacement} resolves the override\n * first, then the input.\n */\n private readonly placementOverrideState = signal<PopoverPlacement | null>(null);\n\n /**\n * @internal Read-only view of the programmatic {@link placement} override.\n * Written via {@link setPlacementOverride}.\n */\n readonly placementOverride = this.placementOverrideState.asReadonly();\n\n /**\n * Effective placement for the CSS-anchor path - override wins, else the\n * `[placement]` input, then fully mirrored against the ambient writing\n * direction. Feeds the `POSITION_AREA` write, the token-split arrow edge,\n * and `resolveActualEdge`: `POSITION_AREA` uses physical keywords with no\n * direction awareness, so the whole mirror happens here. A submenu that\n * flanks inline-end under `ltr` flanks the physically-opposite side under\n * `rtl`, matching the shipped keyboard direction-awareness.\n */\n private readonly effectivePlacement = computed<PopoverPlacement>(() =>\n resolveDirectionalPlacement(this.placementOverride() ?? this.placement(), this.direction()),\n );\n\n /**\n * Effective placement for the floating-ui fallback path - the same source\n * as {@link effectivePlacement} but mirrored side-only. `@floating-ui/dom`\n * flips the inline alignment of vertical placements under `rtl` itself, so\n * feeding it the fully-mirrored token would double-flip `top-start` /\n * `bottom-end`. This path mirrors the side and defers alignment to\n * floating-ui.\n */\n private readonly floatingPlacement = computed<PopoverPlacement>(() =>\n resolveFloatingPlacement(this.placementOverride() ?? this.placement(), this.direction()),\n );\n\n /**\n * Programmatic override of {@link positionTryFallbacks}, paired with\n * {@link placementOverride} so a submenu wiring installs the flip chain too.\n * `null` (default) defers to the `[positionTryFallbacks]` input.\n */\n private readonly positionTryFallbacksOverrideState = signal<\n readonly PopoverPositionTryFallback[] | null\n >(null);\n\n /**\n * @internal Read-only view of the programmatic {@link positionTryFallbacks}\n * override. Written via {@link setPositionTryFallbacksOverride}.\n */\n readonly positionTryFallbacksOverride = this.positionTryFallbacksOverrideState.asReadonly();\n\n /** Effective try-fallbacks - override wins, else the `[positionTryFallbacks]` input. */\n private readonly effectivePositionTryFallbacks = computed<readonly PopoverPositionTryFallback[]>(\n () => this.positionTryFallbacksOverride() ?? this.positionTryFallbacks(),\n );\n\n private readonly stateSignal = signal<PopoverState>('closed');\n private readonly idSignal = signal(nextUid('cngx-popover'));\n\n /** Current lifecycle state. */\n readonly state = this.stateSignal.asReadonly();\n\n /** Unique auto-generated ID for this popover instance. */\n readonly id = this.idSignal.asReadonly();\n\n /** Backing state for {@link focusOrigin}. */\n private readonly focusOriginState = signal<HTMLElement | null>(null);\n\n /**\n * The element that held focus when {@link show} was entered, captured\n * synchronously BEFORE the native `showPopover()` call - content\n * autofocus inside the panel therefore cannot displace it.\n * `CngxPopoverTrigger`'s `restoreFocus` reads it as the restore\n * target; cleared on finalize.\n */\n readonly focusOrigin = this.focusOriginState.asReadonly();\n\n /**\n * Implicit anchor slot, written by `CngxPopoverTrigger` and composing\n * organisms via {@link setAnchorElement}.\n */\n private readonly anchorElementState = signal<HTMLElement | null>(null);\n\n /** Explicit anchor slot, claimed by `CngxPopoverAnchor`. */\n private readonly explicitAnchorElementSlot = createSlotRegistry<HTMLElement>();\n\n /**\n * The element a `CngxPopoverAnchor` registered via\n * {@link registerAnchorElement}, or `null`. While non-null it shadows\n * the implicit anchor and `CngxPopoverTrigger` yields its\n * `anchor-name`.\n */\n readonly explicitAnchorElement = this.explicitAnchorElementSlot.current;\n\n /**\n * The anchor element for Floating UI fallback positioning, the\n * arrow-offset geometry and the outside-click guard. Precedence: the\n * explicit anchor ({@link registerAnchorElement}, `CngxPopoverAnchor`)\n * wins over the implicit one ({@link setAnchorElement},\n * `CngxPopoverTrigger` or a composing organism).\n */\n readonly anchorElement = computed<HTMLElement | null>(\n () => this.explicitAnchorElement() ?? this.anchorElementState(),\n );\n\n /**\n * Inline-axis position the arrow ornament should sit at, expressed as\n * a CSS length pinned to the anchor's centre. Computed from\n * `anchorElement()` + the panel's own bounding box on every show /\n * reposition / window resize.\n *\n * Why a JS-computed CSS variable instead of `anchor(center)` in the\n * arrow's stylesheet: CSS Anchor Positioning's `anchor()` function does\n * not resolve from descendants of a top-layer element back to anchors\n * in the regular document flow. The panel itself can anchor to the\n * trigger, but the arrow inside the panel cannot. Writing the offset\n * from JS sidesteps that limitation and works identically in the\n * CSS-Anchor path and the Floating-UI fallback path.\n */\n private readonly _arrowOffset = signal<string | null>(null);\n\n /**\n * Public read-only view of the arrow's inline-axis offset (`<px>` or\n * `null` before the first geometry read). Consumers projecting a\n * `cngxPopoverArrow` template use this to render their own glyph at\n * the same coordinate the default arrow ornament would.\n */\n readonly arrowOffset = this._arrowOffset.asReadonly();\n\n /** Backing state for {@link haspopup}. */\n private readonly haspopupState = signal<PopoverHaspopup | undefined>(undefined);\n\n /**\n * Hint for the `CngxPopoverTrigger`'s `aria-haspopup` value. Composers\n * such as `CngxPopoverPanel` install it via {@link setHaspopup} so any\n * trigger pointing at the popover defaults to the right role without\n * the consumer having to set `haspopup` on every trigger element.\n * Consumer-supplied `haspopup` on the trigger still wins.\n */\n readonly haspopup = this.haspopupState.asReadonly();\n\n protected readonly isOpening = computed(() => this.stateSignal() === 'opening');\n protected readonly isOpen = computed(() => this.stateSignal() === 'open');\n protected readonly isClosing = computed(() => this.stateSignal() === 'closing');\n readonly isVisible = computed(() => this.stateSignal() !== 'closed');\n\n protected readonly cssAnchorRef = computed(() =>\n SUPPORTS_ANCHOR ? `--cngx-pop-${this.idSignal()}` : null,\n );\n\n /**\n * Primary edge of the placement, written from the live trigger and panel\n * rects so the arrow lands on the side that actually faces the trigger.\n * Falls back to the requested placement's edge before the first geometry\n * read so the arrow CSS rules still match on the very first paint.\n * Browsers normalise compound `position-area` values to a\n * non-deterministic keyword order; an explicit attribute is the stable\n * hook for the arrow stylesheet.\n */\n private readonly resolvedEdgeSignal = signal<ArrowEdge | null>(null);\n\n /**\n * Primary edge of the panel facing the trigger after browser-driven\n * shift / flip recovery. `top` | `bottom` | `left` | `right`. Public\n * so consumers projecting a `cngxPopoverArrow` template can rotate\n * their own glyph to match the rendered placement.\n */\n readonly resolvedEdge = computed<ArrowEdge>(\n () => this.resolvedEdgeSignal() ?? (this.effectivePlacement().split('-')[0] as ArrowEdge),\n );\n\n protected readonly cssMargin = computed(() =>\n SUPPORTS_ANCHOR ? resolveAnchorMargin(this.effectivePlacement(), this.offset()) : null,\n );\n\n /**\n * Comma-joined `position-try-fallbacks` value, or `null` to skip the\n * style write. Bound via host binding so empty / cleared lists drop the\n * property cleanly. Unsupported browsers ignore the unknown property -\n * gating on `SUPPORTS_ANCHOR` would only suppress a harmless write.\n */\n protected readonly cssPositionTryFallbacks = computed(() => {\n const list = this.effectivePositionTryFallbacks();\n return list.length > 0 ? list.join(', ') : null;\n });\n\n constructor() {\n // Host binding needs a static property name; position-area/inset-area name flips per browser.\n if (SUPPORTS_ANCHOR) {\n effect(() => {\n this.elRef.nativeElement.style.setProperty(\n ANCHOR_AREA_PROPERTY,\n POSITION_AREA[this.effectivePlacement()],\n );\n });\n }\n effect(() => {\n const desired = this.controlledOpen();\n if (desired === undefined) {\n return;\n }\n const current = untracked(() => this.stateSignal());\n if (desired && current === 'closed') {\n this.show();\n }\n if (!desired && (current === 'open' || current === 'opening')) {\n this.hide();\n }\n });\n\n this.destroyRef.onDestroy(() => {\n // finalize() disarms pendingClose; a 'closed' state means it already\n // ran and the handle is gone.\n if (this.stateSignal() !== 'closed') {\n this.finalize();\n }\n });\n\n // Recompute arrow offset on viewport resize while the popover is open.\n // takeUntilDestroyed handles teardown so finalize() does not need an\n // explicit removeEventListener pair.\n const view = this.doc.defaultView;\n if (view) {\n fromEvent(view, 'resize')\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n if (this.stateSignal() !== 'closed') {\n this.updateArrowOffset();\n }\n });\n }\n }\n\n /** Open the popover. No-op if not `closed`. */\n show(): void {\n warnMissingPopoverApi(this.elRef.nativeElement);\n if (this.stateSignal() !== 'closed') {\n return;\n }\n // Snapshot the pre-open focus target before showPopover() runs -\n // autofocus content inside the panel lands right after that call,\n // and a post-CD capture (the trigger's effect) would store the\n // panel content instead of the element to restore to.\n this.focusOriginState.set(this.doc.activeElement as HTMLElement | null);\n if (this.effectiveExclusive()) {\n // Snapshot the set: hide() mutates `openPopovers` mid-loop. An ancestor\n // is this popover's container, not a rival - hiding it would take this\n // panel down with it (the ancestor's display: none cascades).\n for (const other of [...openPopovers]) {\n if (other !== this && !other.elRef.nativeElement.contains(this.elRef.nativeElement)) {\n other.hide();\n }\n }\n }\n openPopovers.add(this);\n this.stateSignal.set('opening');\n this.elRef.nativeElement.showPopover();\n installGlobalEscapeListener(this.doc);\n installGlobalOutsideClickListener(this.doc);\n this.applyFloatingPosition();\n requestAnimationFrame(() => {\n if (this.stateSignal() === 'opening') {\n this.stateSignal.set('open');\n }\n // After layout settles the browser's anchor / shift recovery has\n // already placed the panel; reading its rect now reflects the\n // final position the arrow needs to point at. The panel-side\n // border-radius arrives through CNGX_POPOVER_ARROW_BOUNDS - no\n // getComputedStyle read on this directive's side.\n this.updateArrowOffset();\n });\n }\n\n /** Close the popover. No-op if already `closed` or `closing`. */\n hide(): void {\n if (this.stateSignal() === 'closed' || this.stateSignal() === 'closing') {\n return;\n }\n this.startClosing();\n }\n\n /** Toggle between open and closed. */\n toggle(): void {\n if (this.stateSignal() === 'closed') {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Register the anchor element for fallback positioning and arrow\n * geometry, or clear it with `null`. Called by `CngxPopoverTrigger`\n * on registration/destroy and by composing organisms that anchor a\n * panel to a virtual element (context-menu pointer coords).\n */\n setAnchorElement(element: HTMLElement | null): void {\n this.anchorElementState.set(element);\n }\n\n /**\n * Release the implicit anchor slot - but only while `element` still\n * holds it. A trigger destroyed after another writer claimed the slot\n * leaves that writer untouched.\n */\n releaseAnchorElement(element: HTMLElement): void {\n this.anchorElementState.update((held) => (held === element ? null : held));\n }\n\n /**\n * Claim the explicit anchor slot. Called by `CngxPopoverAnchor`; last\n * registration wins. The explicit anchor shadows every\n * {@link setAnchorElement} writer (trigger, submenu, context-menu\n * virtual anchor) for positioning, arrow geometry and outside-click\n * handling until it is unregistered.\n */\n registerAnchorElement(element: HTMLElement): void {\n this.explicitAnchorElementSlot.register(element);\n }\n\n /**\n * Release the explicit anchor slot - but only while `element` still\n * holds it. A stale anchor releasing after a successor registered is\n * a no-op.\n */\n unregisterAnchorElement(element: HTMLElement): void {\n this.explicitAnchorElementSlot.unregister(element);\n }\n\n /**\n * Install the `aria-haspopup` hint triggers fall back to when the\n * consumer sets none. Composers (`CngxPopoverPanel`, menu wirings)\n * call this once at construction; `undefined` clears the hint.\n */\n setHaspopup(value: PopoverHaspopup | undefined): void {\n this.haspopupState.set(value);\n }\n\n /**\n * @internal Install or clear the programmatic {@link exclusive} override.\n * `null` defers back to the `[exclusive]` input.\n */\n setExclusiveOverride(value: boolean | null): void {\n this.exclusiveOverrideState.set(value);\n }\n\n /**\n * @internal Install or clear the programmatic {@link placement} override.\n * `null` defers back to the `[placement]` input.\n */\n setPlacementOverride(value: PopoverPlacement | null): void {\n this.placementOverrideState.set(value);\n }\n\n /**\n * @internal Install or clear the programmatic {@link positionTryFallbacks}\n * override. `null` defers back to the `[positionTryFallbacks]` input.\n */\n setPositionTryFallbacksOverride(value: readonly PopoverPositionTryFallback[] | null): void {\n this.positionTryFallbacksOverrideState.set(value);\n }\n\n protected handleToggle(e: ToggleEvent): void {\n // Sync with browser when it closes the popover (e.g. popover=\"auto\" light\n // dismiss). Must run the full finalize() teardown, not just the state\n // write: a bare state sync leaves the instance in the module registry,\n // where it swallows the next Escape and leaks past destroy.\n if (e.newState === 'closed' && this.stateSignal() !== 'closed') {\n this.finalize();\n }\n }\n\n /**\n * @internal Called by the global outside-click listener for every open\n * popover. Hides this one when it opted into `closeOnOutsideClick` and the\n * pointerdown landed outside its panel, its anchor and its trigger (the\n * implicit anchor holder, which differs from the anchor while a\n * `CngxPopoverAnchor` holds the popover).\n */\n closeIfOutsidePointerDown(target: EventTarget | null): void {\n if (!this.closeOnOutsideClick()) {\n return;\n }\n const node = target as Node | null;\n const panel = this.popoverElement;\n const anchor = this.anchorElement();\n const trigger = this.anchorElementState();\n if (panel.contains(node) || anchor?.contains(node) || trigger?.contains(node)) {\n return;\n }\n this.hide();\n }\n\n /**\n * Shared fallback engine - offset middleware, scroll/resize re-run while\n * open, state-guarded writes. `null` when no fallback is provided.\n */\n private readonly floatingPositioner = this.floatingFallback\n ? createFloatingPositioner({\n fallback: this.floatingFallback,\n getAnchor: () => this.anchorElement(),\n getElement: () => this.popoverElement,\n getPlacement: () => FLOATING_PLACEMENT[this.floatingPlacement()],\n getOffset: () => this.offset(),\n isOpen: () => this.stateSignal() !== 'closed',\n onPositioned: () => this.updateArrowOffset(),\n })\n : null;\n\n /**\n * Apply Floating UI positioning when CSS Anchor is not supported\n * and the consumer has provided the fallback via `provideFloatingFallback()`.\n */\n private applyFloatingPosition(): void {\n if (SUPPORTS_ANCHOR || !this.floatingPositioner) {\n return;\n }\n if (!this.anchorElement()) {\n return;\n }\n if ((this.floatingFallback?.middleware ?? []).length === 0) {\n warnMissingFloatingMiddleware(this.popoverElement.ownerDocument);\n }\n this.floatingPositioner.start();\n }\n\n /**\n * Recompute the arrow's edge and inline offset from the live anchor and\n * panel rects. The resolved edge captures any browser-driven flip; the\n * offset is clamped inside the panel's rounded-corner bounds so the\n * arrow's base stays flush with the panel's straight edge even when the\n * anchor sits outside the panel's inline extent.\n */\n private updateArrowOffset(): void {\n const anchor = this.anchorElement();\n if (!anchor) {\n this._arrowOffset.set(null);\n this.resolvedEdgeSignal.set(null);\n return;\n }\n const panel = this.elRef.nativeElement;\n const panelRect = panel.getBoundingClientRect();\n if (panelRect.width === 0 || panelRect.height === 0) {\n this._arrowOffset.set(null);\n this.resolvedEdgeSignal.set(null);\n return;\n }\n const triggerRect = anchor.getBoundingClientRect();\n const edge = resolveActualEdge(triggerRect, panelRect, this.effectivePlacement());\n this.resolvedEdgeSignal.set(edge);\n const horizontal = edge === 'top' || edge === 'bottom';\n const triggerCentre = horizontal\n ? triggerRect.left + triggerRect.width / 2\n : triggerRect.top + triggerRect.height / 2;\n const panelStart = horizontal ? panelRect.left : panelRect.top;\n const panelDim = horizontal ? panelRect.width : panelRect.height;\n const radius = this.getArrowBounds()?.borderRadius ?? 12;\n const raw = triggerCentre - panelStart;\n const clamped = Math.max(radius, Math.min(raw, panelDim - radius));\n this._arrowOffset.set(`${clamped}px`);\n }\n\n private get popoverElement(): HTMLElement {\n return this.elRef.nativeElement;\n }\n\n private startClosing(): void {\n // Cascade to open descendants: the ancestor's display: none would take\n // their panels down visually while state, ARIA, and the registry still\n // said open - and the next Escape would route to an invisible panel.\n const host = this.popoverElement;\n for (const other of [...openPopovers]) {\n if (other !== this && host.contains(other.popoverElement)) {\n other.hide();\n }\n }\n if (hasTransition(this.popoverElement)) {\n this.stateSignal.set('closing');\n this.pendingClose = onTransitionDone(this.popoverElement, () => this.finalize());\n } else {\n this.finalize();\n }\n }\n\n private finalize(): void {\n // Disarm any pending close wait no matter which path got here - the\n // browser's own light dismiss routes through handleToggle straight to\n // finalize(), and a stale armed handle would force-close a reopened\n // panel when its fallback timer fires.\n this.pendingClose?.cancel();\n this.pendingClose = null;\n this.floatingPositioner?.stop();\n openPopovers.delete(this);\n this._arrowOffset.set(null);\n this.resolvedEdgeSignal.set(null);\n this.focusOriginState.set(null);\n const el = this.popoverElement;\n // Move focus out of the panel BEFORE it flips to aria-hidden (state ->\n // 'closed'). Closing while a descendant (e.g. the close button, or a\n // control reached by keyboard) still holds focus would trap that focus\n // under aria-hidden - the browser blocks it and warns. Blurring here\n // relocates to the document synchronously, matching the eventual\n // display:none end state; opt-in `restoreFocus` still returns focus to\n // the trigger afterwards.\n const active = this.doc.activeElement as HTMLElement | null;\n if (active && el.contains(active) && typeof active.blur === 'function') {\n active.blur();\n }\n try {\n el.hidePopover();\n } catch {\n // Element may already be hidden or disconnected\n }\n this.stateSignal.set('closed');\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n untracked,\n} from '@angular/core';\n\nimport { SUPPORTS_ANCHOR } from './anchor-positioning';\nimport { type CngxPopover } from './popover.directive';\nimport type { PopoverHaspopup } from './popover.types';\n\n/**\n * ARIA wiring atom for elements that trigger a `CngxPopover`.\n *\n * Sets `aria-expanded`, `aria-controls`, and `aria-haspopup` based on the\n * referenced popover's state. Also sets `anchor-name` for CSS Anchor\n * Positioning and registers the anchor element on the popover for fallback\n * positioning. Both geometry jobs take effect only while no `CngxPopoverAnchor`\n * holds the popover: when the focusable trigger is not the visible box the\n * panel should hang under, put `[cngxPopoverAnchor]` on that box and the\n * trigger yields its `anchor-name` while keeping every ARIA attribute.\n *\n * Contains **no event handlers** - the consumer binds interactions directly:\n *\n * ```html\n * <button [cngxPopoverTrigger]=\"pop\" (click)=\"pop.toggle()\">Menu</button>\n * <div cngxPopover #pop=\"cngxPopover\" placement=\"bottom-start\">…</div>\n * ```\n *\n * ### Focus restoration\n * Opt in with `[restoreFocus]=\"true\"` to restore focus on close to the\n * element that was focused before the popover opened (the popover\n * snapshots it synchronously in `show()`, so content autofocus cannot\n * displace the restore target). Useful for menus, confirm panels, and\n * dialogs that steal focus from the trigger.\n *\n * @category common/popover\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-trigger.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPopover, CngxPopoverAnchor, CngxPopoverPanel, CngxTooltip\n * <example-url>http://localhost:4200/#/common/popover/click-popover</example-url>\n * <example-url>http://localhost:4200/#/common/popover/controlled-open</example-url>\n * <example-url>http://localhost:4200/#/common/popover/escape-mode</example-url>\n * <example-url>http://localhost:4200/#/common/popover/placement-variants</example-url>\n * <example-url>http://localhost:4200/#/common/popover/anchor/field-box-anchor</example-url>\n */\n@Directive({\n selector: '[cngxPopoverTrigger]',\n exportAs: 'cngxPopoverTrigger',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'popoverRef().isVisible()',\n '[attr.aria-controls]': 'popoverRef().id()',\n '[attr.aria-haspopup]': 'haspopup()',\n '[style.anchor-name]': 'cssAnchorName()',\n },\n})\nexport class CngxPopoverTrigger {\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Explicit reference to the popover this trigger controls. */\n readonly popoverRef = input.required<CngxPopover>({\n alias: 'cngxPopoverTrigger',\n });\n\n /**\n * ARIA haspopup override. When set, wins over the popover-supplied\n * hint (`popoverRef().haspopup()`, populated by composers such as\n * `CngxPopoverPanel`). Final fallback when neither is set is `'true'`.\n * Accepts the W3C-spec values for supported popup-container roles:\n * `'dialog'`, `'listbox'`, `'menu'`, `'tree'`, or `'true'`.\n *\n * Pass `'none'` to emit no `aria-haspopup` at all - correct for a\n * disclosure whose popup is not one of the recognised widget types\n * (e.g. a list of links), where `aria-expanded` alone describes the\n * trigger. `'none'` wins over the composer hint, so it also cancels a\n * `CngxPopoverPanel`'s `'dialog'` default.\n */\n readonly haspopupInput = input<PopoverHaspopup | 'none' | undefined>(undefined, {\n alias: 'haspopup',\n });\n\n /**\n * When `true`, remembers the popover's pre-open focus target (the\n * popover snapshots `document.activeElement` synchronously inside\n * `show()`, before content autofocus can land in the panel) and\n * restores focus to it when the popover closes. Defaults to `false`\n * so the trigger stays a passive ARIA atom; opt in for menus,\n * confirm panels, and dialogs that move focus away from the trigger.\n */\n readonly restoreFocus = input(false);\n\n /**\n * Resolved `aria-haspopup`. Consumer override (`haspopup` on the\n * trigger element) wins; otherwise the popover's `haspopup` signal\n * (set by composers like `CngxPopoverPanel`) decides; final fallback\n * is `'true'`. The `'none'` sentinel resolves to `null` so the host\n * binding drops the attribute entirely.\n */\n protected readonly haspopup = computed<PopoverHaspopup | null>(() => {\n const resolved = this.haspopupInput() ?? this.popoverRef().haspopup() ?? 'true';\n return resolved === 'none' ? null : resolved;\n });\n\n /**\n * CSS anchor name, yielded (`null`) while a `CngxPopoverAnchor` holds\n * the popover's explicit anchor slot.\n */\n protected readonly cssAnchorName = computed(() =>\n SUPPORTS_ANCHOR && this.popoverRef().explicitAnchorElement() === null\n ? `--cngx-pop-${this.popoverRef().id()}`\n : null,\n );\n\n private savedFocus: HTMLElement | null = null;\n\n constructor() {\n // Register this element as the anchor for fallback positioning.\n effect(() => {\n const pop = this.popoverRef();\n untracked(() => pop.setAnchorElement(this.elRef.nativeElement));\n });\n\n // Release the implicit anchor slot on destroy. The popover guards on\n // identity, so a trigger that registered later is not clobbered.\n this.destroyRef.onDestroy(() => {\n this.popoverRef().releaseAnchorElement(this.elRef.nativeElement);\n });\n\n // Focus restoration: adopt the popover's pre-show focus snapshot on\n // open, restore on close. Inert until `restoreFocus` is opted into.\n effect(() => {\n if (!this.restoreFocus()) {\n return;\n }\n const visible = this.popoverRef().isVisible();\n if (visible) {\n untracked(() => {\n this.savedFocus = this.popoverRef().focusOrigin() ?? this.elRef.nativeElement;\n });\n } else if (this.savedFocus) {\n const target = this.savedFocus;\n this.savedFocus = null;\n untracked(() => {\n if (typeof target.focus === 'function' && target.isConnected) {\n target.focus();\n }\n });\n }\n });\n }\n}\n","import { computed, Directive, effect, ElementRef, inject, input, untracked } from '@angular/core';\n\nimport { SUPPORTS_ANCHOR } from './anchor-positioning';\nimport { type CngxPopover } from './popover.directive';\n\n/**\n * Geometry anchor atom: positions a `CngxPopover` against its host\n * element instead of against the popover's trigger.\n *\n * Reach for it when the focusable trigger is not the visible box the\n * panel should hang under - an `<input>` inside a bordered field row, an\n * icon button inside a toolbar segment. The trigger keeps every ARIA\n * attribute (`aria-expanded`, `aria-controls`, `aria-haspopup`); this\n * atom owns only the geometry. It is the cngx counterpart of Material's\n * `matAutocompleteOrigin`.\n *\n * ```html\n * <div class=\"field\" [cngxPopoverAnchor]=\"pop\">\n * <input [cngxPopoverTrigger]=\"pop\" (focus)=\"pop.show()\" aria-label=\"City\" />\n * </div>\n * <div cngxPopover #pop=\"cngxPopover\" placement=\"bottom-start\">…</div>\n * ```\n *\n * While the atom holds the popover's explicit anchor slot it emits\n * `anchor-name` for CSS Anchor Positioning and is the reference element\n * of the Floating UI fallback, the arrow geometry and the outside-click\n * guard; `CngxPopoverTrigger` yields its own `anchor-name`. The explicit\n * anchor wins over every `setAnchorElement` writer. With two atoms on one\n * popover the last registered wins, and only the holder emits\n * `anchor-name`. On destroy (or when the bound popover changes) the atom\n * releases the slot identity-guarded and the trigger becomes the anchor\n * again.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-anchor.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPopover, CngxPopoverTrigger\n * <example-url>http://localhost:4200/#/common/popover/anchor/field-box-anchor</example-url>\n */\n@Directive({\n selector: '[cngxPopoverAnchor]',\n exportAs: 'cngxPopoverAnchor',\n standalone: true,\n host: {\n '[style.anchor-name]': 'cssAnchorName()',\n },\n})\nexport class CngxPopoverAnchor {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /** The popover this element anchors. */\n readonly popoverRef = input.required<CngxPopover>({\n alias: 'cngxPopoverAnchor',\n });\n\n /** Whether this host currently holds the popover's explicit anchor slot. */\n protected readonly isAnchor = computed(\n () => this.popoverRef().explicitAnchorElement() === this.host,\n );\n\n protected readonly cssAnchorName = computed(() =>\n SUPPORTS_ANCHOR && this.isAnchor() ? `--cngx-pop-${this.popoverRef().id()}` : null,\n );\n\n constructor() {\n // Cross-directive registration keyed on the input; onCleanup releases\n // the previous popover on a ref swap and on destroy.\n effect((onCleanup) => {\n const pop = this.popoverRef();\n untracked(() => pop.registerAnchorElement(this.host));\n onCleanup(() => pop.unregisterAnchorElement(this.host));\n });\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n Renderer2,\n signal,\n untracked,\n} from '@angular/core';\n\nimport { CngxReducedMotion } from '@cngx/common/a11y';\nimport { injectDirection } from '@cngx/core';\nimport { nextUid } from '@cngx/core/utils';\n\nimport {\n ANCHOR_AREA_PROPERTY,\n POSITION_AREA,\n resolveAnchorMargin,\n resolveDirectionalPlacement,\n resolveFloatingPlacement,\n SUPPORTS_ANCHOR,\n} from './anchor-positioning';\nimport {\n CNGX_FLOATING_FALLBACK,\n createFloatingPositioner,\n FLOATING_PLACEMENT,\n} from './floating-fallback';\nimport type {\n PopoverPlacement,\n PopoverPositionTryFallback,\n PopoverState,\n TooltipTriggerMode,\n} from './popover.types';\n\n/** @internal Small debounce to prevent SR announcement storms during rapid Tab navigation. */\nconst FOCUS_DEBOUNCE_MS = 50;\n\n/**\n * String-input tooltip directive applied to the trigger element.\n *\n * Creates the tooltip popover element internally via `Renderer2` and manages\n * the full lifecycle: hover/focus triggers, open/close delays, Escape dismiss,\n * CSS Anchor Positioning, and ARIA wiring (`aria-describedby` + `role=\"tooltip\"`).\n *\n * The consumer sees only the attribute - no extra elements in the template.\n *\n * ### Basic\n * ```html\n * <button cngxTooltip=\"Ctrl+S\">Save</button>\n * ```\n *\n * ### With configuration\n * ```html\n * <button cngxTooltip=\"Ctrl+S\" tooltipPlacement=\"top\" [tooltipDelay]=\"500\">\n * Save\n * </button>\n * ```\n *\n * @category common/popover\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/tooltip.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPopover, CngxPopoverTrigger\n * <example-url>http://localhost:4200/#/common/popover/tooltip/basic-tooltip</example-url>\n * <example-url>http://localhost:4200/#/common/popover/tooltip/custom-delay</example-url>\n * <example-url>http://localhost:4200/#/common/popover/tooltip/disabled-state</example-url>\n * <example-url>http://localhost:4200/#/common/popover/tooltip/keyboard-navigation</example-url>\n * <example-url>http://localhost:4200/#/common/popover/tooltip/placement</example-url>\n * <example-url>http://localhost:4200/#/common/popover/tooltip/programmatic-control</example-url>\n */\n@Directive({\n selector: '[cngxTooltip]',\n exportAs: 'cngxTooltip',\n standalone: true,\n hostDirectives: [CngxReducedMotion],\n host: {\n '[attr.aria-describedby]': 'ariaDescribedBy()',\n '[style.anchor-name]': 'cssAnchorName()',\n '(mouseenter)': 'handleMouseEnter()',\n '(mouseleave)': 'handleMouseLeave()',\n '(focus)': 'handleFocus()',\n '(blur)': 'handleBlur()',\n },\n})\nexport class CngxTooltip {\n private readonly renderer = inject(Renderer2);\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly floatingFallback = inject(CNGX_FLOATING_FALLBACK, { optional: true });\n private readonly direction = injectDirection();\n\n /** Tooltip text content. */\n readonly text = input.required<string>({ alias: 'cngxTooltip' });\n\n /** Anchor-relative placement. */\n readonly placement = input<PopoverPlacement>('top', { alias: 'tooltipPlacement' });\n\n /**\n * @internal\n * `placement` fully mirrored against the ambient writing direction, for the\n * CSS-anchor path (`POSITION_AREA`, physical keywords, no direction\n * awareness).\n */\n private readonly directionalPlacement = computed(() =>\n resolveDirectionalPlacement(this.placement(), this.direction()),\n );\n\n /**\n * @internal\n * `placement` mirrored side-only, for the floating-ui fallback path.\n * `@floating-ui/dom` flips the inline alignment of vertical placements under\n * `rtl` itself, so a full mirror would double-flip `top-start` / `bottom-end`\n * here. This path mirrors the side and defers alignment to floating-ui.\n */\n private readonly floatingPlacement = computed(() =>\n resolveFloatingPlacement(this.placement(), this.direction()),\n );\n\n /** Gap between trigger and tooltip in px. */\n readonly offset = input(8, { alias: 'tooltipOffset' });\n\n /** Delay in ms before opening on mouseenter. */\n readonly openDelay = input(300, { alias: 'tooltipDelay' });\n\n /** Delay in ms before closing on mouseleave. */\n readonly closeDelay = input(100);\n\n /** Whether the tooltip is active. When `false`, no tooltip appears and ARIA is cleared. */\n readonly enabled = input(true);\n\n /**\n * Trigger mode. `'auto'` (default) opens on hover/focus with the\n * configured delays; `'manual'` opts the host out of the hover/focus\n * listeners so only `show()` / `hide()` open or close the tooltip.\n * Escape still dismisses an open tooltip in either mode.\n */\n readonly triggers = input<TooltipTriggerMode>('auto');\n\n /**\n * CSS `<try-tactic>` fallbacks for `position-try-fallbacks`. Empty array\n * (default) means no fallback CSS is written; the tooltip stays at the\n * declared `tooltipPlacement` regardless of viewport clipping. Tooltips\n * are decorative - collision recovery is opt-in per-tooltip.\n */\n readonly positionTryFallbacks = input<readonly PopoverPositionTryFallback[]>([], {\n alias: 'tooltipPositionTryFallbacks',\n });\n\n private readonly stateSignal = signal<PopoverState>('closed');\n private readonly idSignal = signal(nextUid('cngx-tooltip'));\n\n /** Current lifecycle state. */\n readonly state = this.stateSignal.asReadonly();\n\n private tooltipEl: HTMLElement | null = null;\n private openTimer: ReturnType<typeof setTimeout> | null = null;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n\n protected readonly ariaDescribedBy = computed(() => (this.enabled() ? this.idSignal() : null));\n\n protected readonly cssAnchorName = computed(() =>\n SUPPORTS_ANCHOR ? `--cngx-tip-${this.idSignal()}` : null,\n );\n\n constructor() {\n this.createTooltipElement();\n\n effect(() => {\n const text = this.text();\n const el = untracked(() => this.tooltipEl);\n if (el) {\n el.textContent = text;\n }\n });\n\n effect(() => {\n const placement = this.directionalPlacement();\n const offset = this.offset();\n const el = untracked(() => this.tooltipEl);\n if (!el) {\n return;\n }\n\n if (SUPPORTS_ANCHOR) {\n el.style.setProperty('position-anchor', `--cngx-tip-${this.idSignal()}`);\n el.style.setProperty(ANCHOR_AREA_PROPERTY, POSITION_AREA[placement]);\n el.style.setProperty('margin', resolveAnchorMargin(placement, offset));\n }\n });\n\n // position-try-fallbacks is written unconditionally - unsupported\n // browsers ignore the unknown property, and the write keeps a uniform\n // test surface across jsdom + real browsers.\n effect(() => {\n const fallbacks = this.positionTryFallbacks();\n const el = untracked(() => this.tooltipEl);\n if (!el) {\n return;\n }\n if (fallbacks.length > 0) {\n el.style.setProperty('position-try-fallbacks', fallbacks.join(', '));\n } else {\n el.style.removeProperty('position-try-fallbacks');\n }\n });\n\n effect(() => {\n const enabled = this.enabled();\n if (!enabled) {\n const current = untracked(() => this.stateSignal());\n if (current !== 'closed') {\n this.hide();\n }\n }\n });\n\n this.destroyRef.onDestroy(() => {\n this.clearTimers();\n this.floatingPositioner?.stop();\n this.elRef.nativeElement.ownerDocument.removeEventListener(\n 'keydown',\n this.handleDocumentEscape,\n true,\n );\n this.tooltipEl?.remove();\n });\n }\n\n /** Show the tooltip immediately (bypassing delay). */\n show(): void {\n if (!this.enabled() || this.stateSignal() !== 'closed') {\n return;\n }\n this.stateSignal.set('opening');\n // The element ships aria-hidden while closed; an open tooltip must be\n // exposed - it is the live target of the trigger's aria-describedby.\n this.tooltipEl!.removeAttribute('aria-hidden');\n this.tooltipEl!.showPopover();\n this.elRef.nativeElement.ownerDocument.addEventListener(\n 'keydown',\n this.handleDocumentEscape,\n true,\n );\n this.applyFloatingPosition();\n requestAnimationFrame(() => {\n if (this.stateSignal() === 'opening') {\n this.stateSignal.set('open');\n }\n });\n }\n\n /** Hide the tooltip immediately (bypassing delay). */\n hide(): void {\n if (this.stateSignal() === 'closed' || this.stateSignal() === 'closing') {\n return;\n }\n this.clearTimers();\n this.finalize();\n }\n\n protected handleMouseEnter(): void {\n if (this.triggers() !== 'auto' || !this.enabled()) {\n return;\n }\n this.clearCloseTimer();\n const delay = this.openDelay();\n if (delay > 0) {\n this.openTimer = setTimeout(() => this.show(), delay);\n } else {\n this.show();\n }\n }\n\n protected handleMouseLeave(): void {\n if (this.triggers() !== 'auto') {\n return;\n }\n this.clearOpenTimer();\n const delay = this.closeDelay();\n if (delay > 0) {\n this.closeTimer = setTimeout(() => this.hide(), delay);\n } else {\n this.hide();\n }\n }\n\n protected handleFocus(): void {\n if (this.triggers() !== 'auto' || !this.enabled()) {\n return;\n }\n // Debounce prevents SR announcement storm when user rapidly Tabs\n // through a toolbar of tooltipped buttons.\n this.clearTimers();\n this.openTimer = setTimeout(() => this.show(), FOCUS_DEBOUNCE_MS);\n }\n\n protected handleBlur(): void {\n if (this.triggers() !== 'auto') {\n return;\n }\n this.clearTimers();\n this.hide();\n }\n\n /**\n * Document-level Escape while open (capture phase). A hover-opened tooltip\n * has no focus relationship with its trigger, so a host keydown binding\n * never fires - WCAG 1.4.13 requires Escape to dismiss regardless of where\n * the keyboard focus sits. stopPropagation keeps parent overlays (dialog,\n * popover) open: Escape dismisses the innermost surface only.\n */\n private readonly handleDocumentEscape = (event: KeyboardEvent): void => {\n if (event.key !== 'Escape' || this.stateSignal() === 'closed') {\n return;\n }\n event.stopPropagation();\n this.hide();\n };\n\n /**\n * Shared fallback engine (same as `CngxPopover`) - offset middleware,\n * scroll/resize re-run while open, state-guarded writes. First step of\n * folding the tooltip onto the popover state machine. `null` when no\n * fallback is provided.\n */\n private readonly floatingPositioner = this.floatingFallback\n ? createFloatingPositioner({\n fallback: this.floatingFallback,\n getAnchor: () => this.elRef.nativeElement,\n getElement: () => this.tooltipEl,\n getPlacement: () => FLOATING_PLACEMENT[this.floatingPlacement()],\n getOffset: () => this.offset(),\n isOpen: () => this.stateSignal() !== 'closed',\n })\n : null;\n\n private applyFloatingPosition(): void {\n if (SUPPORTS_ANCHOR || !this.floatingPositioner) {\n return;\n }\n this.floatingPositioner.start();\n }\n\n private createTooltipElement(): void {\n const el = this.renderer.createElement('div') as HTMLElement;\n el.setAttribute('popover', 'manual');\n el.setAttribute('role', 'tooltip');\n el.id = this.idSignal();\n el.setAttribute('aria-hidden', 'true');\n el.classList.add('cngx-tooltip');\n\n const trigger = this.elRef.nativeElement;\n if (trigger.parentElement) {\n this.renderer.insertBefore(trigger.parentElement, el, trigger.nextSibling);\n } else {\n // A parentless trigger cannot host the tooltip inside itself: void and\n // replaced elements drop the child silently. The tooltip renders in the\n // top layer anyway, so body is the correct fallback host.\n this.renderer.appendChild(trigger.ownerDocument.body, el);\n }\n\n this.tooltipEl = el;\n }\n\n private finalize(): void {\n this.floatingPositioner?.stop();\n this.elRef.nativeElement.ownerDocument.removeEventListener(\n 'keydown',\n this.handleDocumentEscape,\n true,\n );\n if (this.tooltipEl) {\n try {\n this.tooltipEl.hidePopover();\n } catch {\n // May already be hidden or disconnected\n }\n this.tooltipEl.setAttribute('aria-hidden', 'true');\n }\n this.stateSignal.set('closed');\n }\n\n private clearTimers(): void {\n this.clearOpenTimer();\n this.clearCloseTimer();\n }\n\n private clearOpenTimer(): void {\n if (this.openTimer) {\n clearTimeout(this.openTimer);\n this.openTimer = null;\n }\n }\n\n private clearCloseTimer(): void {\n if (this.closeTimer) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n}\n","import { InjectionToken, type Provider, type Signal, type TemplateRef } from '@angular/core';\n\nimport type { CngxPopoverArrowContext } from './popover-panel-slots';\nimport type {\n CngxPopoverPanelConfig,\n CngxPopoverPanelLabels,\n PopoverPanelFeature,\n} from './popover-panel.types';\n\n/** @internal Default configuration - no auto-dismiss, no close-on-success, variant='default'. */\nconst DEFAULT_CONFIG: CngxPopoverPanelConfig = {\n defaultVariant: 'default',\n};\n\n/**\n * Injection token for popover panel configuration.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel.config.ts\n * @since 0.1.0\n */\nexport const CNGX_POPOVER_PANEL_CONFIG = new InjectionToken<CngxPopoverPanelConfig>(\n 'CngxPopoverPanelConfig',\n { factory: () => DEFAULT_CONFIG },\n);\n\n/**\n * Provides configuration for `CngxPopoverPanel` instances.\n *\n * ```typescript\n * providers: [\n * providePopoverPanel(\n * withAutoDismiss({ info: 5000, success: 3000 }),\n * withCloseOnSuccess(300),\n * ),\n * ]\n * ```\n *\n * @category common/popover\n */\nexport function providePopoverPanel(...features: PopoverPanelFeature[]): Provider {\n const config = features.reduce((acc, f) => f(acc), { ...DEFAULT_CONFIG });\n return { provide: CNGX_POPOVER_PANEL_CONFIG, useValue: config };\n}\n\n/**\n * Auto-dismiss the panel after a timeout, per variant.\n *\n * @param timing - Map of variant name to dismiss duration in ms.\n * ```typescript\n * withAutoDismiss({ info: 5000, success: 3000 })\n * ```\n *\n * @category common/popover\n */\nexport function withAutoDismiss(timing: Record<string, number>): PopoverPanelFeature {\n return (config) => ({ ...config, autoDismiss: { ...config.autoDismiss, ...timing } });\n}\n\n/**\n * Auto-close the panel after an async action in the footer succeeds.\n *\n * @param delay - Delay in ms before closing. Defaults to `300`.\n *\n * @category common/popover\n */\nexport function withCloseOnSuccess(delay = 300): PopoverPanelFeature {\n return (config) => ({ ...config, closeOnSuccessDelay: delay });\n}\n\n/**\n * Set the default variant applied when no `variant` input is set.\n *\n * @category common/popover\n */\nexport function withDefaultVariant(variant: string): PopoverPanelFeature {\n return (config) => ({ ...config, defaultVariant: variant });\n}\n\n/**\n * Show the close button on all panels by default.\n *\n * @category common/popover\n */\nexport function withCloseButton(show = true): PopoverPanelFeature {\n return (config) => ({ ...config, showClose: show });\n}\n\n/**\n * Show the arrow on all panels by default.\n *\n * @category common/popover\n */\nexport function withArrow(show = true): PopoverPanelFeature {\n return (config) => ({ ...config, showArrow: show });\n}\n\n/**\n * Register an app-wide default template for the panel's arrow ornament.\n * The template receives a `CngxPopoverArrowContext` with `edge` and\n * `offsetPx` so the consumer's glyph can match the resolved placement.\n *\n * Per-instance `*cngxPopoverArrow` still wins over this default; the\n * library's rotated-diamond fallback only renders when neither tier is\n * set.\n *\n * ```typescript\n * providers: [\n * providePopoverPanel(withArrowTemplate(brandArrowTpl)),\n * ]\n * ```\n *\n * @category common/popover\n */\nexport function withArrowTemplate(tpl: TemplateRef<CngxPopoverArrowContext>): PopoverPanelFeature {\n return (config) => ({ ...config, templates: { ...config.templates, arrow: tpl } });\n}\n\n/**\n * Set the app-wide panel copy. Unset keys keep the language pack's copy, or\n * the English default; pass a\n * `Signal` of a partial bundle to switch languages at runtime. A later call\n * replaces the whole bundle. Mirrors `withDialogLabels`.\n *\n * ```typescript\n * providers: [\n * providePopoverPanel(withPopoverPanelLabels({ close: 'Schliessen' })),\n * ]\n * ```\n *\n * @category common/popover\n * @since 0.1.0\n */\nexport function withPopoverPanelLabels(\n labels: Partial<CngxPopoverPanelLabels> | Signal<Partial<CngxPopoverPanelLabels>>,\n): PopoverPanelFeature {\n return (config) => ({ ...config, labels });\n}\n","// Pulls the augmented module into the program; ng-packagr rejects `declare module` (TS2664) otherwise.\nimport type {} from '@cngx/core/i18n';\n\n/**\n * The popover section of a {@link CngxLanguagePack}: the copy of\n * `CngxPopoverPanel`. `providePopoverPanel(withPopoverPanelLabels(...))`\n * overrides single keys on top of it.\n *\n * @category common/popover\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, withPopoverPanelLabels\n */\nexport interface CngxPopoverLanguageSection {\n /** Accessible name of the built-in close button. */\n readonly close: string;\n}\n\n/**\n * The English popover section: the single source of the popover panel's\n * English copy.\n *\n * @category common/popover\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel\n */\nexport const CNGX_POPOVER_LANGUAGE_EN: CngxPopoverLanguageSection = {\n close: 'Close',\n};\n\ndeclare module '@cngx/core/i18n' {\n interface CngxLanguagePack {\n readonly popover: CngxPopoverLanguageSection;\n }\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { ArrowEdge } from './popover.types';\n\n/**\n * Context object passed to a `*cngxPopoverArrow` template.\n *\n * The consumer's glyph receives the resolved panel edge (`top` / `bottom` /\n * `left` / `right`) and the inline-axis offset in CSS pixels that the\n * library would have placed the default diamond at. Either can be used to\n * rotate, translate, or theme the custom glyph so it tracks the trigger.\n *\n * @category common/popover\n */\nexport interface CngxPopoverArrowContext {\n /** Primary edge of the panel facing the trigger. */\n readonly edge: ArrowEdge;\n /**\n * Inline-axis offset from the panel edge to the trigger's centre, in\n * CSS pixels. `null` before the first geometry read (the consumer\n * should treat `null` as \"centre the glyph\" - the default diamond\n * falls back to `50%` in the same case).\n */\n readonly offsetPx: number | null;\n}\n\n/**\n * Marks the header content inside `cngx-popover-panel`.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverBody, CngxPopoverFooter\n */\n@Directive({ selector: '[cngxPopoverHeader]', standalone: true })\nexport class CngxPopoverHeader {}\n\n/**\n * Marks the body content inside `cngx-popover-panel`.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverHeader, CngxPopoverFooter\n */\n@Directive({ selector: '[cngxPopoverBody]', standalone: true })\nexport class CngxPopoverBody {}\n\n/**\n * Marks the footer content inside `cngx-popover-panel`.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverHeader, CngxPopoverBody, CngxPopoverAction\n */\n@Directive({ selector: '[cngxPopoverFooter]', standalone: true })\nexport class CngxPopoverFooter {}\n\n/**\n * Custom close button template. Overrides the default close button.\n *\n * ```html\n * <ng-template cngxPopoverClose>\n * <button mat-icon-button (click)=\"panel.popover.hide()\">\n * <mat-icon>close</mat-icon>\n * </button>\n * </ng-template>\n * ```\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel\n */\n@Directive({ selector: 'ng-template[cngxPopoverClose]', standalone: true })\nexport class CngxPopoverClose {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Template shown while panel content is loading.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverEmpty, CngxPopoverError\n */\n@Directive({ selector: 'ng-template[cngxPopoverLoading]', standalone: true })\nexport class CngxPopoverLoading {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Template shown when panel content is empty.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverLoading, CngxPopoverError\n */\n@Directive({ selector: 'ng-template[cngxPopoverEmpty]', standalone: true })\nexport class CngxPopoverEmpty {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Template shown when panel content failed to load. Context: `$implicit` = error.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverLoading, CngxPopoverEmpty\n */\n@Directive({ selector: 'ng-template[cngxPopoverError]', standalone: true })\nexport class CngxPopoverError {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Custom arrow ornament template. Overrides the default rotated-diamond\n * arrow when projected as a child of `<cngx-popover-panel>`. The library\n * routes the resolved panel edge and the live inline-axis offset to the\n * template via `CngxPopoverArrowContext`.\n *\n * ```html\n * <cngx-popover-panel #pop [showArrow]=\"true\">\n * <ng-template cngxPopoverArrow let-edge=\"edge\" let-offsetPx=\"offsetPx\">\n * <svg class=\"brand-arrow\" [attr.data-edge]=\"edge\"\n * [style.--offset]=\"offsetPx ? offsetPx + 'px' : '50%'\">\n * <use href=\"#arrow-glyph\" />\n * </svg>\n * </ng-template>\n * </cngx-popover-panel>\n * ```\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopover\n */\n@Directive({ selector: 'ng-template[cngxPopoverArrow]', standalone: true })\nexport class CngxPopoverArrow {\n readonly templateRef = inject<TemplateRef<CngxPopoverArrowContext>>(TemplateRef);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { CngxCloseButton } from '@cngx/common/interactive';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n DestroyRef,\n ElementRef,\n effect,\n inject,\n input,\n untracked,\n ViewEncapsulation,\n} from '@angular/core';\nimport { createLanguageSection } from '@cngx/core/i18n';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { createOverrideMerge, nextUid } from '@cngx/core/utils';\n\nimport { CNGX_POPOVER_ARROW_BOUNDS, type CngxPopoverArrowBounds } from './popover-arrow-bounds';\nimport { CNGX_POPOVER_LANGUAGE_EN } from './i18n/popover-language-section';\nimport { CNGX_POPOVER_PANEL_CONFIG } from './popover-panel.config';\nimport {\n CngxPopoverArrow,\n type CngxPopoverArrowContext,\n CngxPopoverClose,\n CngxPopoverEmpty,\n CngxPopoverError,\n CngxPopoverFooter,\n CngxPopoverHeader,\n CngxPopoverLoading,\n} from './popover-panel-slots';\nimport { CngxPopover } from './popover.directive';\nimport type { PopoverPanelRole } from './popover.types';\n\n/**\n * @internal The popover section of the active language pack over the English\n * copy, shared app-wide so every panel merges `config.labels` over the same\n * signal - and `createOverrideMerge` then shares one merge per config object.\n */\nconst injectPopoverPanelLanguage = createLanguageSection('popover', CNGX_POPOVER_LANGUAGE_EN);\n\n/**\n * Rich popover panel molecule with header/body/footer slots, variant\n * styling, arrow, close button, and content state templates.\n *\n * Composes `CngxPopover` via `hostDirectives` - all popover inputs\n * (`placement`, `positionTryFallbacks`, `offset`, `closeOnEscape`,\n * `closeOnOutsideClick`, `mode`, `exclusive`, `cngxPopoverOpen`) are\n * forwarded.\n *\n * The `variant` input is a free-form string mapped to a CSS class\n * (`cngx-popover-panel--{variant}`). Five variants are pre-themed\n * in `popover-panel-theme.scss`: `default`, `info`, `warning`,\n * `danger`, `success`. Add custom variants via CSS.\n *\n * ### Basic with header/body/footer\n * ```html\n * <button [cngxPopoverTrigger]=\"panel\" (click)=\"panel.popover.toggle()\">Menu</button>\n * <cngx-popover-panel #panel variant=\"danger\" [showClose]=\"true\" [showArrow]=\"true\">\n * <span cngxPopoverHeader>Delete Item?</span>\n * <p cngxPopoverBody>This action cannot be undone.</p>\n * <div cngxPopoverFooter>\n * <cngx-popover-action role=\"dismiss\">Cancel</cngx-popover-action>\n * <cngx-popover-action role=\"confirm\" [action]=\"delete\" variant=\"danger\">\n * Delete\n * </cngx-popover-action>\n * </div>\n * </cngx-popover-panel>\n * ```\n *\n * ### With loading state\n * ```html\n * <cngx-popover-panel [loading]=\"isLoading()\" [error]=\"loadError()\">\n * <p cngxPopoverBody>Loaded content here</p>\n * <ng-template cngxPopoverLoading>Loading...</ng-template>\n * <ng-template cngxPopoverError let-err>Failed: {{ err }}</ng-template>\n * </cngx-popover-panel>\n * ```\n *\n * @category common/popover\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel.component.ts\n * @since 0.1.0\n * @relatedTo CngxPopover, CngxPopoverAction, CngxPopoverHeader, CngxPopoverBody, CngxPopoverFooter\n * @slot cngxPopoverArrow Replaces the pointer that ties the panel to its trigger.\n * @slot cngxPopoverClose Replaces the dismiss control.\n * @slot cngxPopoverLoading Rendered while the panel's content is loading.\n * @slot cngxPopoverEmpty Rendered when the panel has nothing to show.\n * @slot cngxPopoverError Rendered when the panel's content failed to load.\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/content-states</example-url>\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/variants</example-url>\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/with-footer-actions</example-url>\n */\n@Component({\n selector: 'cngx-popover-panel',\n standalone: true,\n imports: [NgTemplateOutlet, CngxCloseButton],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'cngxPopoverPanel',\n providers: [{ provide: CNGX_POPOVER_ARROW_BOUNDS, useExisting: CngxPopoverPanel }],\n hostDirectives: [\n {\n directive: CngxPopover,\n inputs: [\n 'placement',\n 'positionTryFallbacks',\n 'offset',\n 'closeOnEscape',\n 'closeOnOutsideClick',\n 'mode',\n 'exclusive',\n 'cngxPopoverOpen',\n ],\n },\n ],\n host: {\n '[class]': 'hostClass()',\n '[attr.role]': 'role()',\n '[attr.aria-labelledby]': 'ariaLabelledBy()',\n '[attr.aria-describedby]': 'ariaDescribedBy()',\n '[attr.aria-busy]': 'effectiveLoading() || null',\n },\n template: `\n @if (showArrow()) {\n @if (arrowTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: arrowContext()\" />\n } @else {\n <div class=\"cngx-popover-panel__arrow\"></div>\n }\n }\n\n @if (effectiveLoading()) {\n @if (loadingTpl(); as tpl) {\n <div class=\"cngx-popover-panel__loading\">\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n </div>\n }\n } @else if (effectiveError(); as err) {\n @if (errorTpl(); as tpl) {\n <div class=\"cngx-popover-panel__error\">\n <ng-container *ngTemplateOutlet=\"tpl.templateRef; context: { $implicit: err }\" />\n </div>\n }\n } @else if (effectiveEmpty()) {\n @if (emptyTpl(); as tpl) {\n <div class=\"cngx-popover-panel__empty\">\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n </div>\n }\n } @else {\n @if (hasHeader() || showClose()) {\n <div class=\"cngx-popover-panel__header-row\">\n <div class=\"cngx-popover-panel__header\" [id]=\"headerId\">\n <ng-content select=\"[cngxPopoverHeader]\" />\n </div>\n @if (showClose()) {\n @if (closeTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else {\n <cngx-close-button\n [label]=\"closeLabel()\"\n class=\"cngx-popover-panel__close\"\n (click)=\"popover.hide()\"\n />\n }\n }\n </div>\n }\n <div class=\"cngx-popover-panel__body\" [id]=\"bodyId\">\n <ng-content select=\"[cngxPopoverBody]\" />\n <ng-content />\n </div>\n @if (hasFooter()) {\n <div class=\"cngx-popover-panel__footer\">\n <ng-content select=\"[cngxPopoverFooter]\" />\n </div>\n }\n }\n `,\n styleUrls: ['./popover-panel.component.css'],\n})\nexport class CngxPopoverPanel implements CngxPopoverArrowBounds {\n /** The underlying popover state machine. */\n readonly popover = inject(CngxPopover, { self: true });\n private readonly config = inject(CNGX_POPOVER_PANEL_CONFIG);\n private readonly destroyRef = inject(DestroyRef);\n private readonly hostRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Cached panel border-radius. Read lazily from the host's computed\n * style on first access so `CngxPopover` can consume it via\n * `CNGX_POPOVER_ARROW_BOUNDS` without forcing a layout flush per\n * resize tick. The custom property is declared on `:scope` so the\n * value is valid from instantiation onward.\n */\n private _cachedBorderRadius: number | null = null;\n\n /** @internal - implements `CngxPopoverArrowBounds`. */\n get borderRadius(): number {\n if (this._cachedBorderRadius === null) {\n const raw = getComputedStyle(this.hostRef.nativeElement).getPropertyValue(\n '--cngx-popover-panel-border-radius',\n );\n this._cachedBorderRadius = Number.parseFloat(raw) || 12;\n }\n return this._cachedBorderRadius;\n }\n\n /**\n * Variant string - mapped to CSS class `cngx-popover-panel--{variant}`.\n * Pre-themed: `default`, `info`, `warning`, `danger`, `success`.\n * Add custom variants via CSS.\n */\n readonly variant = input<string | undefined>(undefined);\n\n /**\n * ARIA role applied to the panel host. Defaults to `'dialog'` because\n * the panel pairs `aria-labelledby` (header) with `aria-describedby`\n * (body) - the standard dialog pattern. Override with `'alertdialog'`\n * for irrecoverable confirmations, `'tooltip'` for passive callouts,\n * or `'menu'` when the panel hosts a menu.\n *\n * The trigger's `aria-haspopup` is hinted to `'dialog'` in tandem via\n * the popover's `haspopup` signal; consumers overriding `role` here\n * should also override `haspopup` on the trigger to match.\n */\n readonly role = input<PopoverPanelRole>('dialog');\n\n /** Show a close button. Falls back to global config from `providePopoverPanel(withCloseButton())`. */\n readonly showCloseInput = input<boolean | undefined>(undefined, { alias: 'showClose' });\n\n /** Show an arrow. Falls back to global config from `providePopoverPanel(withArrow())`. */\n readonly showArrowInput = input<boolean | undefined>(undefined, { alias: 'showArrow' });\n\n /**\n * Panel copy: `config.labels` over the popover section of the active\n * language pack, one shared merge per config object.\n */\n private readonly labels = createOverrideMerge(injectPopoverPanelLanguage(), this.config.labels);\n\n /** Accessible name of the built-in close button. */\n protected readonly closeLabel = computed(() => this.labels().close);\n\n /** Resolved showClose - input takes precedence over config. */\n readonly showClose = computed(() => this.showCloseInput() ?? this.config.showClose ?? false);\n\n /** Resolved showArrow - input takes precedence over config. */\n readonly showArrow = computed(() => this.showArrowInput() ?? this.config.showArrow ?? false);\n\n /**\n * Bind an async state - drives loading, error, and empty slots from a single source.\n * When set, takes precedence over individual `[loading]`, `[error]`, `[empty]` inputs.\n */\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /** Whether the panel content is in a loading state. Fallback when `[state]` is not set. */\n readonly loading = input(false);\n\n /** Error value when content loading failed. Fallback when `[state]` is not set. */\n readonly error = input<unknown>(undefined);\n\n /** Whether the panel content is empty. Fallback when `[state]` is not set. */\n readonly empty = input(false);\n\n /** @internal Resolved loading - state takes precedence over boolean input. */\n protected readonly effectiveLoading = computed(\n () => this.state()?.isFirstLoad() ?? this.loading(),\n );\n\n /** @internal Resolved error - state takes precedence over direct input. */\n protected readonly effectiveError = computed(() => this.state()?.error() ?? this.error());\n\n /** @internal Resolved empty - state takes precedence over boolean input. */\n protected readonly effectiveEmpty = computed(() => this.state()?.isEmpty() ?? this.empty());\n\n protected readonly headerSlot = contentChild(CngxPopoverHeader);\n protected readonly footerSlot = contentChild(CngxPopoverFooter);\n protected readonly closeTpl = contentChild(CngxPopoverClose);\n protected readonly loadingTpl = contentChild(CngxPopoverLoading);\n protected readonly emptyTpl = contentChild(CngxPopoverEmpty);\n protected readonly errorTpl = contentChild(CngxPopoverError);\n protected readonly arrowTplDirective = contentChild(CngxPopoverArrow);\n\n /**\n * Three-stage cascade for the arrow ornament:\n * 1. Per-instance `*cngxPopoverArrow` template (contentChild).\n * 2. App-wide `CNGX_POPOVER_PANEL_CONFIG.templates.arrow`\n * (via `providePopoverPanel(withArrowTemplate(...))`).\n * 3. `null` -> the panel renders the default rotated-diamond markup.\n */\n protected readonly arrowTpl = computed(\n () => this.arrowTplDirective()?.templateRef ?? this.config.templates?.arrow ?? null,\n );\n\n /**\n * Context surface for projected `*cngxPopoverArrow` templates.\n * `equal` keeps the reference stable across re-evaluations whose\n * inputs round-trip to the same `{ edge, offsetPx }` - required for\n * any object-returning computed per the Equality discipline rule.\n */\n protected readonly arrowContext = computed<CngxPopoverArrowContext>(\n () => {\n const raw = this.popover.arrowOffset();\n const parsed = raw === null ? null : Number.parseFloat(raw);\n return {\n edge: this.popover.resolvedEdge(),\n offsetPx: parsed !== null && Number.isFinite(parsed) ? parsed : null,\n };\n },\n { equal: (a, b) => a.edge === b.edge && a.offsetPx === b.offsetPx },\n );\n\n /** Auto-detected from projected `[cngxPopoverHeader]` content. */\n protected readonly hasHeader = computed(() => !!this.headerSlot());\n\n /** Auto-detected from projected `[cngxPopoverFooter]` content. */\n protected readonly hasFooter = computed(() => !!this.footerSlot());\n\n private readonly uid = nextUid('cngx-pp');\n protected readonly headerId = `${this.uid}-header`;\n protected readonly bodyId = `${this.uid}-body`;\n\n /**\n * Only point to the header when one is projected - a bare id reference\n * resolves even against an element that never renders (the header row is\n * gated on `hasHeader()`), leaving AT with an empty accessible name.\n */\n protected readonly ariaLabelledBy = computed(() => (this.hasHeader() ? this.headerId : null));\n\n /** Only point to body when default content is showing (not loading/error/empty). */\n protected readonly ariaDescribedBy = computed(() =>\n this.effectiveLoading() || this.effectiveError() || this.effectiveEmpty() ? null : this.bodyId,\n );\n\n protected readonly hostClass = computed(() => {\n const v = this.variant() ?? this.config.defaultVariant ?? 'default';\n let cls = `cngx-popover-panel cngx-popover-panel--${v}`;\n if (this.showArrow()) {\n cls += ' cngx-popover-panel--arrow';\n }\n return cls;\n });\n\n private autoDismissTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n // Hint any CngxPopoverTrigger pointing at this popover to default\n // `aria-haspopup=\"dialog\"`. Consumer override on the trigger wins.\n this.popover.setHaspopup('dialog');\n\n effect(() => {\n const isVisible = this.popover.isVisible();\n const v = this.variant() ?? untracked(() => this.config.defaultVariant) ?? 'default';\n const timing = untracked(() => this.config.autoDismiss);\n\n if (this.autoDismissTimer) {\n clearTimeout(this.autoDismissTimer);\n this.autoDismissTimer = null;\n }\n if (isVisible && timing?.[v]) {\n this.autoDismissTimer = setTimeout(() => this.popover.hide(), timing[v]);\n }\n });\n\n this.destroyRef.onDestroy(() => {\n if (this.autoDismissTimer) {\n clearTimeout(this.autoDismissTimer);\n }\n });\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n DestroyRef,\n effect,\n inject,\n input,\n isDevMode,\n untracked,\n ViewEncapsulation,\n viewChild,\n} from '@angular/core';\nimport type { AsyncStatus } from '@cngx/core/utils';\nimport {\n CngxAsyncClick,\n CngxFailed,\n CngxPending,\n CngxSucceeded,\n type AsyncAction,\n} from '@cngx/common/interactive';\n\nimport { CNGX_POPOVER_PANEL_CONFIG } from './popover-panel.config';\nimport { CngxPopover } from './popover.directive';\n\n/**\n * Visual variant for the action button.\n *\n * @category common/popover\n */\nexport type PopoverActionVariant = 'primary' | 'secondary' | 'danger' | 'ghost';\n\n/**\n * Action button for use inside `cngx-popover-panel` footer.\n *\n * Two roles:\n * - `'dismiss'` - closes the panel on click (no async action).\n * - `'confirm'` - executes an async action, shows status templates,\n * optionally auto-closes the panel on success.\n *\n * Supports the same `cngxPending`/`cngxSucceeded`/`cngxFailed` templates\n * as `CngxActionButton`, or use `status()` + `@switch` for full control.\n *\n * ### Dismiss button\n * ```html\n * <cngx-popover-action role=\"dismiss\">Cancel</cngx-popover-action>\n * ```\n *\n * ### Confirm with templates\n * ```html\n * <cngx-popover-action role=\"confirm\" [action]=\"save\" variant=\"primary\">\n * Save\n * <ng-template cngxPending>Saving...</ng-template>\n * <ng-template cngxSucceeded>Saved!</ng-template>\n * <ng-template cngxFailed let-err>{{ err }}</ng-template>\n * </cngx-popover-action>\n * ```\n *\n * ### With @switch\n * ```html\n * <cngx-popover-action role=\"confirm\" [action]=\"save\" #act=\"cngxPopoverAction\">\n * @switch (act.status()) {\n * @case ('pending') { Saving... }\n * @case ('success') { Done }\n * @default { Save }\n * }\n * </cngx-popover-action>\n * ```\n *\n * @category common/popover\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-action.component.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverFooter\n * @slot cngxPending Rendered while the action is running.\n * @slot cngxSucceeded Rendered after the action succeeds.\n * @slot cngxFailed Rendered when the action fails; gets the error.\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/content-states</example-url>\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/variants</example-url>\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/with-footer-actions</example-url>\n */\n@Component({\n selector: 'cngx-popover-action',\n standalone: true,\n imports: [NgTemplateOutlet, CngxAsyncClick],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'cngxPopoverAction',\n host: { style: 'display: contents' },\n template: `\n <ng-template #idle><ng-content /></ng-template>\n\n @if (role() === 'dismiss') {\n <button\n type=\"button\"\n [class]=\"'cngx-popover-action cngx-popover-action--' + variant()\"\n (click)=\"handleDismiss()\"\n >\n <ng-container *ngTemplateOutlet=\"idle\" />\n </button>\n } @else {\n <button\n type=\"button\"\n [cngxAsyncClick]=\"action()!\"\n #btn=\"cngxAsyncClick\"\n [feedbackDuration]=\"feedbackDuration()\"\n [autoAnnounce]=\"false\"\n [class]=\"'cngx-popover-action cngx-popover-action--' + variant()\"\n >\n @switch (btn.status()) {\n @case ('pending') {\n @if (pendingTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('success') {\n @if (succeededTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('error') {\n @if (failedTpl(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl.templateRef; context: { $implicit: btn.error() }\"\n />\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @default {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n </button>\n <span aria-live=\"polite\" aria-atomic=\"true\" class=\"cngx-popover-action__sr-only\">\n {{ btn.announcement() }}\n </span>\n }\n `,\n styleUrls: ['./popover-action.component.css'],\n})\nexport class CngxPopoverAction {\n private readonly popover = inject(CngxPopover, { optional: true });\n private readonly config = inject(CNGX_POPOVER_PANEL_CONFIG);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Button role: `'dismiss'` closes immediately, `'confirm'` runs an async action. */\n readonly role = input<'dismiss' | 'confirm'>('confirm');\n\n /** The async action to execute (only for `role=\"confirm\"`). */\n readonly action = input<AsyncAction | undefined>(undefined);\n\n /** Visual variant for the button. */\n readonly variant = input<PopoverActionVariant>('secondary');\n\n /** Duration in ms to show success/error feedback. */\n readonly feedbackDuration = input(2000);\n\n protected readonly pendingTpl = contentChild(CngxPending);\n protected readonly succeededTpl = contentChild(CngxSucceeded);\n protected readonly failedTpl = contentChild(CngxFailed);\n\n private readonly asyncClick = viewChild(CngxAsyncClick);\n\n /**\n * Lifecycle status of the confirm action - `'idle' | 'pending' | 'success'\n * | 'error'`, mirroring the internal `CngxAsyncClick`. Always `'idle'` for\n * `role=\"dismiss\"` (there is no async lifecycle to report).\n */\n readonly status = computed<AsyncStatus>(() => this.asyncClick()?.status() ?? 'idle');\n\n private closeOnSuccessTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n // withCloseOnSuccess(): a confirmed footer action hides the composing\n // popover after the configured delay. A follow-up run cancels the\n // pending close so a re-triggered action never yanks the panel away\n // mid-interaction.\n effect(() => {\n const status = this.status();\n const delay = untracked(() => this.config.closeOnSuccessDelay);\n if (status === 'pending') {\n this.clearCloseOnSuccessTimer();\n }\n if (status === 'success' && delay !== undefined && this.popover) {\n this.clearCloseOnSuccessTimer();\n this.closeOnSuccessTimer = setTimeout(() => {\n this.closeOnSuccessTimer = null;\n this.popover?.hide();\n }, delay);\n }\n });\n\n this.destroyRef.onDestroy(() => this.clearCloseOnSuccessTimer());\n\n if (isDevMode()) {\n afterNextRender(() => {\n if (this.role() === 'confirm' && !this.action()) {\n console.warn(\n 'CngxPopoverAction: role=\"confirm\" without an [action] renders a button whose ' +\n 'click does nothing. Bind [action] or use role=\"dismiss\".',\n );\n }\n });\n }\n }\n\n protected handleDismiss(): void {\n this.popover?.hide();\n }\n\n private clearCloseOnSuccessTimer(): void {\n if (this.closeOnSuccessTimer) {\n clearTimeout(this.closeOnSuccessTimer);\n this.closeOnSuccessTimer = null;\n }\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { CngxDivider } from '@cngx/common/display';\n\n/**\n * Separator for use inside `cngx-popover-panel` (or a bare `[cngxPopover]`).\n *\n * Composes `CngxDivider` via `hostDirectives` so the popover-context\n * separator carries proper `role=\"separator\"` + `aria-orientation`\n * semantics without the consumer having to remember the ARIA wiring.\n * The `orientation` and `inset` inputs forward to the underlying\n * `CngxDivider` host directive.\n *\n * Project anywhere inside the panel content - typically between menu\n * item groups (destructive vs non-destructive), between body sections,\n * or between footer action groups.\n *\n * ### Menu item group separator (horizontal)\n * ```html\n * <menu>\n * <li><button (click)=\"pop.hide()\">Edit</button></li>\n * <li><button (click)=\"pop.hide()\">Duplicate</button></li>\n * <li cngxPopoverDivider></li>\n * <li><button (click)=\"pop.hide()\">Delete</button></li>\n * </menu>\n * ```\n *\n * ### Vertical separator between footer action groups\n * ```html\n * <div cngxPopoverFooter>\n * <cngx-popover-action role=\"dismiss\">Cancel</cngx-popover-action>\n * <span cngxPopoverDivider orientation=\"vertical\"></span>\n * <cngx-popover-action role=\"confirm\" [action]=\"save\">Save</cngx-popover-action>\n * </div>\n * ```\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-divider.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxDivider\n */\n@Directive({\n selector: '[cngxPopoverDivider]',\n exportAs: 'cngxPopoverDivider',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxDivider,\n inputs: ['orientation', 'inset'],\n },\n ],\n host: {\n class: 'cngx-popover-divider',\n },\n})\nexport class CngxPopoverDivider {}\n","/**\n * @module @cngx/common/popover\n */\n\n// Atoms\nexport type {\n ArrowEdge,\n PopoverPlacement,\n PopoverPositionTryFallback,\n PopoverState,\n PopoverMode,\n PopoverHaspopup,\n PopoverPanelRole,\n TooltipTriggerMode,\n} from './popover.types';\nexport { CngxPopover } from './popover.directive';\nexport { CngxPopoverTrigger } from './popover-trigger.directive';\nexport { CngxPopoverAnchor } from './popover-anchor.directive';\nexport { CngxTooltip } from './tooltip.directive';\n\n// Floating UI fallback (opt-in)\nexport {\n CNGX_FLOATING_FALLBACK,\n provideFloatingFallback,\n type ComputePositionFn,\n type FloatingFallbackConfig,\n} from './floating-fallback';\n\n// Panel molecule\nexport type {\n CngxPopoverPanelConfig,\n CngxPopoverPanelLabels,\n PopoverPanelFeature,\n} from './popover-panel.types';\nexport {\n CNGX_POPOVER_PANEL_CONFIG,\n providePopoverPanel,\n withAutoDismiss,\n withCloseOnSuccess,\n withDefaultVariant,\n withCloseButton,\n withArrow,\n withArrowTemplate,\n withPopoverPanelLabels,\n} from './popover-panel.config';\nexport {\n CNGX_POPOVER_LANGUAGE_EN,\n type CngxPopoverLanguageSection,\n} from './i18n/popover-language-section';\nexport { CngxPopoverPanel } from './popover-panel.component';\nexport { CngxPopoverAction, type PopoverActionVariant } from './popover-action.component';\nexport {\n CNGX_POPOVER_ARROW_BOUNDS,\n type CngxPopoverArrowBounds,\n} from './popover-arrow-bounds';\nexport {\n CngxPopoverArrow,\n type CngxPopoverArrowContext,\n CngxPopoverHeader,\n CngxPopoverBody,\n CngxPopoverFooter,\n CngxPopoverClose,\n CngxPopoverLoading,\n CngxPopoverEmpty,\n CngxPopoverError,\n} from './popover-panel-slots';\nexport { CngxPopoverDivider } from './popover-divider.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.CngxPopover","i1"],"mappings":";;;;;;;;;;;;;;AAIA;;;;;;;AAOG;AACH,SAAS,mBAAmB,GAAA;AAC1B,IAAA,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE;QAC9B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE;IAC5D;IACA,IAAI,GAAG,CAAC,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,EAAE;QAC3C,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE;IAC3D;IACA,IAAI,GAAG,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE;QACxC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE;IACxD;IACA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE;AAC5D;AAEA;AACA,MAAM,cAAc,GAAG,mBAAmB,EAAE;AAE5C;AACO,MAAM,eAAe,GAAG,cAAc,CAAC,SAAS;AAEvD;AACO,MAAM,oBAAo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,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAd9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,cAAc,EAAE;AACd,wBAAA;AACE,4BAAA,SAAS,EAAE,WAAW;AACtB,4BAAA,MAAM,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC;AACjC,yBAAA;AACF,qBAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,sBAAsB;AAC9B,qBAAA;AACF,iBAAA;;;ACtDD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"cngx-common-popover.mjs","sources":["../../../projects/common/popover/anchor-positioning.ts","../../../projects/common/popover/popover-arrow-bounds.ts","../../../projects/common/popover/popover-presentation.ts","../../../projects/common/popover/floating-fallback.ts","../../../projects/common/popover/popover.directive.ts","../../../projects/common/popover/popover-trigger.directive.ts","../../../projects/common/popover/popover-anchor.directive.ts","../../../projects/common/popover/tooltip.directive.ts","../../../projects/common/popover/popover-sheet-breakpoint.ts","../../../projects/common/popover/popover-sheet-host.ts","../../../projects/common/popover/popover-sheet.directive.ts","../../../projects/common/popover/popover-sheet-parts.ts","../../../projects/common/popover/popover-panel.config.ts","../../../projects/common/popover/i18n/popover-language-section.ts","../../../projects/common/popover/popover-panel-slots.ts","../../../projects/common/popover/popover-panel.component.ts","../../../projects/common/popover/popover-action.component.ts","../../../projects/common/popover/popover-divider.directive.ts","../../../projects/common/popover/public-api.ts","../../../projects/common/popover/cngx-common-popover.ts"],"sourcesContent":["import type { CngxDirection } from '@cngx/core';\n\nimport type { PopoverPlacement } from './popover.types';\n\n/**\n * @internal\n * Detect CSS Anchor Positioning support.\n *\n * The spec renamed `inset-area` to `position-area` (Chrome 129+, Safari 18.4+).\n * Chrome 125-128 only supports the old `inset-area` name.\n * We detect whichever is available and use it consistently.\n */\nfunction detectAnchorSupport(): { supported: boolean; propertyName: string } {\n if (typeof CSS === 'undefined') {\n return { supported: false, propertyName: 'position-area' };\n }\n if (CSS.supports('position-area', 'bottom')) {\n return { supported: true, propertyName: 'position-area' };\n }\n if (CSS.supports('inset-area', 'bottom')) {\n return { supported: true, propertyName: 'inset-area' };\n }\n return { supported: false, propertyName: 'position-area' };\n}\n\n/** @internal */\nconst ANCHOR_SUPPORT = detectAnchorSupport();\n\n/** @internal `true` when the browser supports CSS Anchor Positioning. */\nexport const SUPPORTS_ANCHOR = ANCHOR_SUPPORT.supported;\n\n/** @internal The CSS property name for anchor area positioning (`position-area` or `inset-area`). */\nexport const ANCHOR_AREA_PROPERTY = ANCHOR_SUPPORT.propertyName;\n\n/**\n * @internal\n * CSS anchor area values mapped from logical placement tokens.\n *\n * Uses physical keywords only - Chrome does not support logical keywords\n * (`start`/`end`/`span-inline-*`) in `position-area` as of Chrome 140.\n *\n * `*-start` and `*-end` resolve to a `<direction> <span-*>` pair, NOT a\n * corner cell (`top right` etc.). Corner-cell values produce diagonal\n * placement relative to the anchor - visually wrong for edge-aligned\n * popovers. The `<direction> <span-*>` form keeps the popover on the\n * named edge while spanning toward the named alignment:\n * `right-start` → `right span-bottom` (right column, anchor's top edge aligned)\n * `right-end` → `right span-top` (right column, anchor's bottom edge aligned)\n * Single-keyword placements (`top`/`bottom`/`left`/`right`) resolve to\n * the edge-centered case (`position-area: right` + default\n * `justify-self: anchor-center`) and need no span keyword.\n */\nexport const POSITION_AREA: Record<PopoverPlacement, string> = {\n top: 'top span-all',\n 'top-start': 'top span-right',\n 'top-end': 'top span-left',\n bottom: 'bottom span-all',\n 'bottom-start': 'bottom span-right',\n 'bottom-end': 'bottom span-left',\n left: 'left span-all',\n 'left-start': 'left span-bottom',\n 'left-end': 'left span-top',\n right: 'right span-all',\n 'right-start': 'right span-bottom',\n 'right-end': 'right span-top',\n};\n\n/**\n * @internal\n * CSS `margin` shorthand that puts `offsetPx` between the popover and its\n * anchor on the placement's main axis only: the block axis for `top` /\n * `bottom`, the inline axis for `left` / `right`. The cross axis stays at\n * `0`, so `-start` / `-end` placements sit flush with the anchor edge -\n * the same geometry `makeOffsetMiddleware` produces on the floating-ui\n * path.\n *\n * Both sides of the main axis carry the offset so the gap survives every\n * `position-try-fallbacks` tactic: `flip-block` / `flip-inline` mirror\n * within the axis, `flip-start` transposes the margin together with the\n * `position-area`. There is deliberately no cross-axis margin, so a\n * cross-aligned popover may touch the viewport edge; overflow recovery\n * belongs to `position-try-fallbacks`.\n *\n * Takes the requested, direction-resolved placement, never the measured\n * edge, so the margin never feeds geometry back into geometry.\n */\nexport function resolveAnchorMargin(placement: PopoverPlacement, offsetPx: number): string {\n const side = placement.split('-')[0];\n const isBlockSide = side === 'top' || side === 'bottom';\n return isBlockSide ? `${offsetPx}px 0` : `0 ${offsetPx}px`;\n}\n\n/**\n * @internal\n * Full physical mirror of every placement token under `rtl`: the left/right\n * side swaps, and a block-placement's inline *alignment* (`-start <-> -end`)\n * swaps too. Feeds the CSS-anchor path only - {@link POSITION_AREA} uses\n * physical keywords with no direction awareness, so the whole mirror must\n * happen in TS. The block edge (`top`/`bottom`) never flips.\n *\n * Total `Record` (identity entries for `top`/`bottom`) so a future placement\n * token fails the exhaustiveness check at compile time rather than silently\n * losing its mirror at runtime - the same guard {@link POSITION_AREA} and\n * `FLOATING_PLACEMENT` already carry.\n */\nconst INLINE_MIRROR: Record<PopoverPlacement, PopoverPlacement> = {\n top: 'top',\n bottom: 'bottom',\n 'top-start': 'top-end',\n 'top-end': 'top-start',\n 'bottom-start': 'bottom-end',\n 'bottom-end': 'bottom-start',\n left: 'right',\n right: 'left',\n 'left-start': 'right-start',\n 'right-start': 'left-start',\n 'left-end': 'right-end',\n 'right-end': 'left-end',\n};\n\n/**\n * @internal\n * Side-only mirror for the floating-ui path under `rtl`: the left/right side\n * swaps (keeping any `-start`/`-end` suffix), but a block-placement's inline\n * alignment is left untouched. `@floating-ui/dom`'s `computePosition` already\n * flips the alignment of vertical placements under `rtl` (its default\n * `platform.isRTL` reads the floating element's `direction`), while keeping\n * the side physical. Pre-flipping the alignment here as well would double-flip\n * `top-start` / `bottom-end` back to their ltr position - so the floating path\n * mirrors the side and defers alignment to floating-ui.\n *\n * Total `Record` for the same compile-time exhaustiveness guard as\n * {@link INLINE_MIRROR}.\n */\nconst FLOATING_MIRROR: Record<PopoverPlacement, PopoverPlacement> = {\n top: 'top',\n bottom: 'bottom',\n 'top-start': 'top-start',\n 'top-end': 'top-end',\n 'bottom-start': 'bottom-start',\n 'bottom-end': 'bottom-end',\n left: 'right',\n right: 'left',\n 'left-start': 'right-start',\n 'right-start': 'left-start',\n 'left-end': 'right-end',\n 'right-end': 'left-end',\n};\n\n/**\n * @internal\n * Resolve a logical placement token for the **CSS-anchor** path against the\n * writing direction: full inline mirror under `rtl`, identity under `ltr`.\n * {@link POSITION_AREA} is keyed by physical placement with no direction\n * awareness, so mirroring the key here - before the lookup - is what places\n * the panel on the direction-forward side.\n *\n * The block axis never flips: `top`/`bottom` (no inline component) are the\n * identity, and `top-start`/`bottom-start` mirror only their inline\n * *alignment* (`-start <-> -end`), not the block edge. Same inline-only rule\n * the keyboard direction-awareness applies (`resolveInlineStep`).\n *\n * NOTE: the floating-ui path must NOT use this - floating-ui flips vertical\n * alignment itself under `rtl`. Use {@link resolveFloatingPlacement} there.\n *\n * Pure, O(1) lookup - a mechanical kernel, not a DI chokepoint; each surface\n * injects its own direction and calls this at its CSS-anchor placement source.\n *\n * @param placement The logical placement token the consumer requested.\n * @param direction The document writing direction from `injectDirection`.\n * @returns The fully inline-mirrored token under `rtl`, else `placement`.\n */\nexport function resolveDirectionalPlacement(\n placement: PopoverPlacement,\n direction: CngxDirection,\n): PopoverPlacement {\n if (direction !== 'rtl') {\n return placement;\n }\n return INLINE_MIRROR[placement];\n}\n\n/**\n * @internal\n * Resolve a logical placement token for the **floating-ui fallback** path\n * against the writing direction: side-only mirror under `rtl`, identity under\n * `ltr`. `@floating-ui/dom` already flips the inline alignment of vertical\n * placements under `rtl`, so this mirrors the side (`left <-> right`, suffix\n * preserved) and leaves the alignment for floating-ui - avoiding the\n * double-flip that a full mirror would cause on `top-start` / `bottom-end`.\n *\n * @param placement The logical placement token the consumer requested.\n * @param direction The document writing direction from `injectDirection`.\n * @returns The side-mirrored token under `rtl`, else `placement`.\n */\nexport function resolveFloatingPlacement(\n placement: PopoverPlacement,\n direction: CngxDirection,\n): PopoverPlacement {\n if (direction !== 'rtl') {\n return placement;\n }\n return FLOATING_MIRROR[placement];\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Geometry contract for the popover panel's arrow ornament.\n *\n * Provided by `CngxPopoverPanel` (via `useExisting`) so that `CngxPopover`\n * can read panel-side layout constants - primarily the border-radius\n * used to clamp the arrow inside the panel's rounded corners - through a\n * typed contract rather than reaching into the panel's CSS custom\n * properties directly. Inverts the atom -> molecule dependency direction\n * that an earlier `getComputedStyle('--cngx-popover-panel-border-radius')`\n * read had introduced on `CngxPopover`.\n *\n * `CngxPopover` injects the token with `{ optional: true }` so it keeps\n * working when used outside a `CngxPopoverPanel` (e.g. bare `[cngxPopover]`\n * on a `<div>`). The fallback value matches the panel's default\n * border-radius initial value (12 px).\n *\n * @category common/popover\n */\nexport interface CngxPopoverArrowBounds {\n /**\n * Panel border-radius in CSS pixels. Used by `CngxPopover` to clamp\n * the arrow offset inside the panel's rounded-corner extent.\n */\n readonly borderRadius: number;\n}\n\n/**\n * Injection token for the arrow-bounds contract.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-arrow-bounds.ts\n * @since 0.1.0\n */\nexport const CNGX_POPOVER_ARROW_BOUNDS = new InjectionToken<CngxPopoverArrowBounds>(\n 'CngxPopoverArrowBounds',\n);\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * How an open popover is laid out: anchored to its trigger, as a bottom\n * sheet, or filling the viewport.\n *\n * @category common/popover\n * @since 0.1.0\n */\nexport type CngxPopoverPresentation = 'anchored' | 'sheet' | 'fullscreen';\n\n/**\n * @internal Contract between `CngxPopover` and a presentation modifier on the\n * same element. `CngxPopover` drops every anchor and floating write while\n * `presentation()` is not `'anchored'`, and calls `onShown()` / `onHide()`\n * synchronously inside `show()` / `hide()` so the modifier can move focus and\n * release page state in the caller's stack.\n */\nexport interface CngxPopoverPresentationSeam {\n readonly presentation: Signal<CngxPopoverPresentation>;\n /** Runs right after `showPopover()`, with the host already `aria-hidden=\"false\"`. */\n onShown(): void;\n /** Runs once per `hide()`, before any close transition starts (state still open). */\n onHide(): void;\n}\n\n/** @internal Resolved by `CngxPopover` on its own element only (`self: true`). */\nexport const CNGX_POPOVER_PRESENTATION = new InjectionToken<CngxPopoverPresentationSeam>(\n 'CngxPopoverPresentation',\n);\n","import { InjectionToken, type Provider } from '@angular/core';\n\nimport type { PopoverPlacement } from './popover.types';\n\n// Declared as a method so TypeScript checks its parameters bivariantly: the\n// real `computePosition` narrows `placement` to Floating UI's `Placement`\n// union and `middleware` to its `Middleware` type, and a function-type\n// alias would reject it under `strictFunctionTypes`. The library only ever\n// passes valid placements and middleware objects.\ninterface ComputePositionSignature {\n computePosition(\n reference: HTMLElement,\n floating: HTMLElement,\n options?: {\n placement?: string;\n middleware?: unknown[];\n },\n ): Promise<{ x: number; y: number; placement: string }>;\n}\n\n/**\n * Signature matching `@floating-ui/dom` `computePosition`.\n * The consumer provides the actual function - the library never imports it directly.\n *\n * @category common/popover\n */\nexport type ComputePositionFn = ComputePositionSignature['computePosition'];\n\n/**\n * Configuration for the Floating UI positioning fallback.\n *\n * @category common/popover\n */\nexport interface FloatingFallbackConfig {\n /** The `computePosition` function from `@floating-ui/dom`. */\n computePosition: ComputePositionFn;\n /**\n * Middleware array (e.g. `[flip(), shift()]`). The popover prepends its own\n * offset middleware, so do not pass `offset()` here.\n */\n middleware?: unknown[];\n}\n\n/**\n * Injection token for the Floating UI fallback.\n * `null` when not provided - CSS Anchor Positioning is used instead.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/floating-fallback.ts\n * @since 0.1.0\n */\nexport const CNGX_FLOATING_FALLBACK = new InjectionToken<FloatingFallbackConfig | null>(\n 'CngxFloatingFallback',\n { factory: () => null },\n);\n\n/**\n * Provides the Floating UI positioning fallback for browsers without\n * CSS Anchor Positioning support.\n *\n * The consumer must install `@floating-ui/dom` themselves - this library\n * never imports it directly, keeping the bundle at zero cost for modern browsers.\n *\n * ```typescript\n * import { computePosition, flip, shift } from '@floating-ui/dom';\n *\n * // In app.config.ts or component providers:\n * providers: [\n * provideFloatingFallback(computePosition, [flip(), shift()]),\n * ]\n * ```\n *\n * @category common/popover\n */\nexport function provideFloatingFallback(\n computePosition: ComputePositionFn,\n middleware?: unknown[],\n): Provider {\n return {\n provide: CNGX_FLOATING_FALLBACK,\n useValue: { computePosition, middleware } satisfies FloatingFallbackConfig,\n };\n}\n\n/**\n * @internal\n * Inputs for {@link createFloatingPositioner}. All element/config reads are\n * thunks so the positioner always sees the live value - placement and offset\n * are signal-backed on both call sites.\n */\nexport interface FloatingPositionerOptions {\n /** The consumer-provided fallback config from `CNGX_FLOATING_FALLBACK`. */\n fallback: FloatingFallbackConfig;\n /** Anchor (trigger) element. `null` skips the positioning pass. */\n getAnchor: () => HTMLElement | null;\n /** The floating element. `null` skips the positioning pass. */\n getElement: () => HTMLElement | null;\n /** Resolved Floating UI placement string (a `FLOATING_PLACEMENT` value). */\n getPlacement: () => string;\n /** Gap between anchor and floating element in px. */\n getOffset: () => number;\n /** Open guard - closes drop queued listener re-runs and in-flight writes. */\n isOpen: () => boolean;\n /** Invoked after every applied coordinate write. */\n onPositioned?: () => void;\n}\n\n/** @internal Handle returned by {@link createFloatingPositioner}. */\nexport interface FloatingPositioner {\n /** One positioning pass (no-op unless open with anchor + element). */\n update(): void;\n /** Position now and re-run on scroll/resize until {@link stop}. */\n start(): void;\n /** Detach the scroll/resize listeners. Idempotent. */\n stop(): void;\n}\n\n/**\n * @internal\n * Offset expressed as a Floating UI middleware literal instead of a margin\n * write: margin pushes the panel along BOTH axes and is invisible to the\n * consumer's flip/shift middleware, so collision recovery would compute\n * against the un-offset rect. Runs first in the chain for the same reason\n * `offset()` must in `@floating-ui/dom`.\n */\nfunction makeOffsetMiddleware(offsetPx: number): unknown {\n return {\n name: 'cngxOffset',\n fn: (state: { x: number; y: number; placement: string }): { x?: number; y?: number } => {\n const side = state.placement.split('-')[0];\n if (side === 'top') {\n return { y: state.y - offsetPx };\n }\n if (side === 'bottom') {\n return { y: state.y + offsetPx };\n }\n if (side === 'left') {\n return { x: state.x - offsetPx };\n }\n if (side === 'right') {\n return { x: state.x + offsetPx };\n }\n return {};\n },\n };\n}\n\n/**\n * @internal\n * The one floating-ui fallback engine shared by `CngxPopover` and\n * `CngxTooltip`. Owns the three concerns the per-directive copies each\n * half-implemented: the offset (as middleware, see above), the re-run on\n * scroll/resize while open (CSS Anchor tracks the anchor natively; the\n * fallback must do it by hand), and the state guard on the async\n * `computePosition` write (a close during the in-flight promise must not\n * resurrect stale coordinates).\n */\nexport function createFloatingPositioner(options: FloatingPositionerOptions): FloatingPositioner {\n let listening = false;\n let listenerDoc: Document | null = null;\n\n const update = (): void => {\n const anchor = options.getAnchor();\n const el = options.getElement();\n if (!anchor || !el || !options.isOpen()) {\n return;\n }\n const fb = options.fallback;\n const middleware = [makeOffsetMiddleware(options.getOffset()), ...(fb.middleware ?? [])];\n void fb\n .computePosition(anchor, el, { placement: options.getPlacement(), middleware })\n .then(({ x, y }) => {\n if (!options.isOpen()) {\n return;\n }\n const target = options.getElement();\n if (!target) {\n return;\n }\n target.style.left = `${x}px`;\n target.style.top = `${y}px`;\n options.onPositioned?.();\n });\n };\n\n const handleReposition = (): void => update();\n\n return {\n update,\n start(): void {\n update();\n if (listening) {\n return;\n }\n const doc = options.getElement()?.ownerDocument ?? null;\n const view = doc?.defaultView ?? null;\n if (!doc || !view) {\n return;\n }\n // Capture phase: scroll events from inner scroll containers do not\n // bubble, but they do traverse the capture path.\n doc.addEventListener('scroll', handleReposition, true);\n view.addEventListener('resize', handleReposition);\n listenerDoc = doc;\n listening = true;\n },\n stop(): void {\n if (!listening) {\n return;\n }\n listenerDoc?.removeEventListener('scroll', handleReposition, true);\n listenerDoc?.defaultView?.removeEventListener('resize', handleReposition);\n listenerDoc = null;\n listening = false;\n },\n };\n}\n\n/** @internal Maps cngx placement tokens to Floating UI placement strings. */\nexport const FLOATING_PLACEMENT: Record<PopoverPlacement, string> = {\n top: 'top',\n 'top-start': 'top-start',\n 'top-end': 'top-end',\n bottom: 'bottom',\n 'bottom-start': 'bottom-start',\n 'bottom-end': 'bottom-end',\n left: 'left',\n 'left-start': 'left-start',\n 'left-end': 'left-end',\n right: 'right',\n 'right-start': 'right-start',\n 'right-end': 'right-end',\n};\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent } from 'rxjs';\n\nimport { injectDirection } from '@cngx/core';\nimport {\n createSlotRegistry,\n hasTransition,\n nextUid,\n onTransitionDone,\n type TransitionDoneHandle,\n} from '@cngx/core/utils';\nimport { cngxDevWarn } from '@cngx/utils';\n\nimport {\n ANCHOR_AREA_PROPERTY,\n POSITION_AREA,\n resolveAnchorMargin,\n resolveDirectionalPlacement,\n resolveFloatingPlacement,\n SUPPORTS_ANCHOR,\n} from './anchor-positioning';\nimport { CNGX_POPOVER_ARROW_BOUNDS, type CngxPopoverArrowBounds } from './popover-arrow-bounds';\nimport {\n CNGX_POPOVER_PRESENTATION,\n type CngxPopoverPresentationSeam,\n} from './popover-presentation';\nimport {\n CNGX_FLOATING_FALLBACK,\n createFloatingPositioner,\n FLOATING_PLACEMENT,\n} from './floating-fallback';\nimport type {\n ArrowEdge,\n PopoverHaspopup,\n PopoverMode,\n PopoverPlacement,\n PopoverPositionTryFallback,\n PopoverState,\n} from './popover.types';\n\n/**\n * @internal Module-level registry of open popovers (insertion-ordered).\n */\nconst openPopovers = new Set<CngxPopover>();\n\n/**\n * @internal\n * Derive the panel's actual placement relative to the trigger from the live\n * rects. The arrow always sits on the panel edge that *faces* the trigger,\n * so a `position-try-fallbacks` flip (e.g. requested `bottom`, browser\n * resolved to `top` because there is no room below) routes the arrow to the\n * opposite edge without the consumer touching anything.\n *\n * Returns the requested placement's primary edge when the rects overlap -\n * the only case where no clean side is geometrically correct.\n */\nfunction resolveActualEdge(\n trigger: DOMRect,\n panel: DOMRect,\n requested: PopoverPlacement,\n): ArrowEdge {\n const tolerance = 4;\n if (panel.top >= trigger.bottom - tolerance) {\n return 'bottom';\n }\n if (panel.bottom <= trigger.top + tolerance) {\n return 'top';\n }\n if (panel.right <= trigger.left + tolerance) {\n return 'left';\n }\n if (panel.left >= trigger.right - tolerance) {\n return 'right';\n }\n return requested.split('-')[0] as ArrowEdge;\n}\n\n/** @internal Tracks which Documents already have the global Escape listener. */\nconst escapeListenerDocs = new WeakSet<Document>();\n/** @internal */\nfunction installGlobalEscapeListener(doc: Document): void {\n if (escapeListenerDocs.has(doc)) {\n return;\n }\n escapeListenerDocs.add(doc);\n doc.addEventListener('keydown', (e: KeyboardEvent) => {\n if (e.key !== 'Escape' || openPopovers.size === 0) {\n return;\n }\n // most-recently-opened wins (relies on Set's insertion-order iteration)\n const last = [...openPopovers].at(-1);\n if (last?.closeOnEscape()) {\n e.stopPropagation();\n last.hide();\n }\n });\n}\n\n/** @internal Tracks which Documents already have the global outside-click listener. */\nconst outsideClickListenerDocs = new WeakSet<Document>();\n/** @internal */\nfunction installGlobalOutsideClickListener(doc: Document): void {\n if (outsideClickListenerDocs.has(doc)) {\n return;\n }\n outsideClickListenerDocs.add(doc);\n // Capture phase so the dismiss decision runs before in-popover handlers can\n // stopPropagation. Snapshot the set: hide() mutates `openPopovers` mid-loop.\n doc.addEventListener(\n 'pointerdown',\n (e: PointerEvent) => {\n if (openPopovers.size === 0) {\n return;\n }\n for (const popover of [...openPopovers]) {\n popover.closeIfOutsidePointerDown(e.target);\n }\n },\n true,\n );\n}\n\n/** @internal Tracks which Documents have already warned about missing Popover API. */\nconst popoverApiWarnedDocs = new WeakSet<Document>();\n\n/**\n * @internal - test hook. Resets the per-Document warning suppression so\n * specs can exercise the warning path against a shared jsdom Document.\n * Do not call from production code.\n */\nexport function __resetPopoverApiWarnings(doc: Document): void {\n popoverApiWarnedDocs.delete(doc);\n}\n/** @internal Shared with `CngxTooltip`, which opens its own popover element. */\nexport function warnMissingPopoverApi(el: HTMLElement, owner: 'cngxPopover' | 'cngxTooltip'): void {\n if (!(typeof ngDevMode !== 'undefined' && ngDevMode)) {\n return;\n }\n const doc = el.ownerDocument;\n if (popoverApiWarnedDocs.has(doc)) {\n return;\n }\n if (typeof el.showPopover !== 'function') {\n popoverApiWarnedDocs.add(doc);\n cngxDevWarn(\n 'CNGX1036',\n `[${owner}] the native Popover API is not supported in this browser. ` +\n 'Install @oddbird/popover-polyfill and import it in your polyfills:\\n\\n' +\n ' npm install @oddbird/popover-polyfill\\n' +\n ' // polyfills.ts\\n' +\n \" import '@oddbird/popover-polyfill';\\n\",\n );\n }\n}\n\n/** @internal Tracks which Documents have already warned about missing Floating-UI middleware. */\nconst floatingMiddlewareWarnedDocs = new WeakSet<Document>();\n\n/**\n * @internal - test hook. Resets the per-Document warning suppression so\n * specs can exercise the warning path against a shared jsdom Document.\n * Do not call from production code.\n */\nexport function __resetFloatingMiddlewareWarnings(doc: Document): void {\n floatingMiddlewareWarnedDocs.delete(doc);\n}\n/** @internal */\nfunction warnMissingFloatingMiddleware(doc: Document): void {\n if (!(typeof ngDevMode !== 'undefined' && ngDevMode)) {\n return;\n }\n if (floatingMiddlewareWarnedDocs.has(doc)) {\n return;\n }\n floatingMiddlewareWarnedDocs.add(doc);\n cngxDevWarn(\n 'CNGX1037',\n '[cngxPopover] provideFloatingFallback(computePosition) was registered without middleware. ' +\n 'Popovers in browsers without CSS Anchor Positioning will clip against the viewport edge ' +\n 'because no flip/shift recovery is configured. Pass middleware on registration:\\n\\n' +\n \" import { computePosition, flip, shift } from '@floating-ui/dom';\\n\\n\" +\n ' providers: [\\n' +\n ' provideFloatingFallback(computePosition, [flip(), shift()]),\\n' +\n ' ],\\n',\n );\n}\n\n/**\n * Signal-driven state machine for the native Popover API.\n *\n * Wraps the browser's `popover` attribute with reactive state,\n * CSS-transition-aware lifecycle, and CSS Anchor Positioning.\n * Pure state machine - contains no trigger logic, no delays.\n *\n * State lifecycle: `closed` → `opening` → `open` → `closing` → `closed`.\n * CSS classes `cngx-popover--opening`, `cngx-popover--open`, and\n * `cngx-popover--closing` are applied to the host for transition hooks.\n *\n * ### Declarative click popover\n * ```html\n * <button [cngxPopoverTrigger]=\"pop\" (click)=\"pop.toggle()\">Menu</button>\n * <div cngxPopover #pop=\"cngxPopover\" placement=\"bottom-start\">\n * <menu><li>Edit</li><li>Delete</li></menu>\n * </div>\n * ```\n *\n * ### Controlled open state\n * ```html\n * <div cngxPopover [cngxPopoverOpen]=\"showErrors()\" role=\"alert\">\n * {{ errorSummary() }}\n * </div>\n * ```\n * <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>\n * <example-url>http://localhost:4200/#/common/popover/click-popover</example-url>\n * <example-url>http://localhost:4200/#/common/popover/controlled-open</example-url>\n * <example-url>http://localhost:4200/#/common/popover/escape-mode</example-url>\n * <example-url>http://localhost:4200/#/common/popover/placement-variants</example-url>\n *\n * ### Collision recovery with `<try-tactic>` fallbacks\n * Apply CSS Anchor Positioning's `position-try-fallbacks` declaratively\n * by binding the new `positionTryFallbacks` input. Each entry is a CSS\n * `<try-tactic>` keyword (or composed pair) written verbatim into the\n * host's `position-try-fallbacks` property. Mirrors the precedent in\n * `@cngx/forms/select` panels.\n *\n * ```html\n * <div cngxPopover\n * placement=\"right-start\"\n * [positionTryFallbacks]=\"['flip-inline', 'flip-block', 'flip-block flip-inline']\">\n * <!-- popover content -->\n * </div>\n * ```\n *\n * When the array is empty (default), the host does not write a\n * `position-try-fallbacks` style - the browser positions the popover at\n * the declared `placement` regardless of viewport clipping.\n *\n * @category common/popover\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverTrigger, CngxPopoverPanel, CngxTooltip\n */\n@Directive({\n selector: '[cngxPopover]',\n exportAs: 'cngxPopover',\n standalone: true,\n host: {\n '[attr.popover]': 'mode()',\n '[id]': 'id()',\n '[attr.aria-hidden]': '!isVisible()',\n '[attr.data-arrow-placement]': 'resolvedEdge()',\n '[class.cngx-popover--opening]': 'isOpening()',\n '[class.cngx-popover--open]': 'isOpen()',\n '[class.cngx-popover--closing]': 'isClosing()',\n '[style.position-anchor]': 'cssAnchorRef()',\n '[style.position-try-fallbacks]': 'cssPositionTryFallbacks()',\n '[style.margin]': 'cssMargin()',\n '[style.--cngx-popover-arrow-offset]': 'arrowOffset()',\n '(toggle)': 'handleToggle($event)',\n },\n})\nexport class CngxPopover {\n /**\n * Host ElementRef. Public for consumers that need to pass the\n * popover's native element to APIs expecting an `ElementRef`\n * (scroll observers, intersection observers, focus managers, …).\n * Notable consumer: `injectRecycler({ scrollElement: pop.elementRef })`\n * for `@cngx/forms/select` virtualisation - the popover IS the\n * scroll container when `select-base.css`'s `max-height + overflow-y`\n * rules apply.\n */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly elRef = this.elementRef;\n private readonly destroyRef = inject(DestroyRef);\n private readonly doc = inject(DOCUMENT);\n private readonly floatingFallback = inject(CNGX_FLOATING_FALLBACK, { optional: true });\n private readonly _injector = inject(Injector);\n private readonly direction = injectDirection();\n\n // Armed while a close transition runs; cancelled on destroy so the\n // transitionend listener and fallback timer never outlive the directive.\n private pendingClose: TransitionDoneHandle | null = null;\n /**\n * Arrow-bounds contract resolved lazily on first use.\n * Eager inject() would loop: CngxPopover (host directive on the panel)\n * is constructed BEFORE the panel itself, so `useExisting: CngxPopoverPanel`\n * cannot resolve at directive-construction time.\n */\n private _arrowBounds: CngxPopoverArrowBounds | null | undefined = undefined;\n private getArrowBounds(): CngxPopoverArrowBounds | null {\n if (this._arrowBounds === undefined) {\n this._arrowBounds = this._injector.get(CNGX_POPOVER_ARROW_BOUNDS, null);\n }\n return this._arrowBounds;\n }\n\n /**\n * Presentation seam resolved lazily on first use, same reason as\n * {@link getArrowBounds}: the modifier providing it constructs after this\n * directive. `self: true` keeps a popover nested inside a sheet's host from\n * picking up the outer sheet's seam.\n */\n private _presentationSeam: CngxPopoverPresentationSeam | null | undefined = undefined;\n private presentationSeam(): CngxPopoverPresentationSeam | null {\n if (this._presentationSeam === undefined) {\n this._presentationSeam = this._injector.get(CNGX_POPOVER_PRESENTATION, null, {\n self: true,\n });\n }\n return this._presentationSeam;\n }\n\n /**\n * `false` while a presentation modifier lays the panel out as a sheet or\n * fullscreen. Gates every anchor, margin, fallback and floating write:\n * inline styles beat author CSS, so the sheet stylesheet cannot win\n * against them.\n */\n private readonly anchored = computed(\n () => (this.presentationSeam()?.presentation() ?? 'anchored') === 'anchored',\n );\n\n // Re-entrancy guard for hide(): a hide() / toggle() from inside the\n // seam's onHide() must not start a second close.\n private hiding = false;\n\n /** Anchor-relative placement. */\n readonly placement = input<PopoverPlacement>('bottom');\n\n /**\n * CSS `<try-tactic>` fallbacks for `position-try-fallbacks`. Empty\n * array (default) means the host does not write the property at all.\n * Non-empty entries are written verbatim, comma-joined, in declaration\n * order. Spec-compatible vocabulary only (no cngx placement tokens).\n */\n readonly positionTryFallbacks = input<readonly PopoverPositionTryFallback[]>([]);\n\n /**\n * Gap between anchor and popover in px, on the placement's main axis\n * (block axis for `top` / `bottom`, inline axis for `left` / `right`);\n * the cross axis stays flush. Same on both positioning engines.\n */\n readonly offset = input(8);\n\n /** Whether Escape key dismisses the popover. */\n readonly closeOnEscape = input(true);\n\n /**\n * Whether a `pointerdown` outside both the popover and its anchor (trigger)\n * dismisses it - menu / listbox light-dismiss. Opt-in (default `false`) so\n * existing manual-mode popovers keep full control; the anchor is excluded so\n * a click on the trigger toggles via the trigger's own handler instead of\n * being closed here and immediately reopened.\n */\n readonly closeOnOutsideClick = input(false);\n\n /** Native popover mode. `'manual'` for full control, `'auto'` for browser light dismiss. */\n readonly mode = input<PopoverMode>('manual');\n\n /**\n * Controlled open state. When set, drives the popover reactively.\n * `undefined` = uncontrolled (default).\n */\n readonly controlledOpen = input<boolean | undefined>(undefined, {\n alias: 'cngxPopoverOpen',\n });\n\n /**\n * When `true` (default), opening this popover closes any other open\n * `CngxPopover` instance. Set to `false` to allow multiple popovers\n * open simultaneously.\n *\n * Exclusivity governs sibling popovers only: a popover nested inside\n * another open popover (a select panel or submenu opening within a\n * popover-hosted surface) is that container's child, not a rival, and\n * never evicts its ancestor.\n */\n readonly exclusive = input(true);\n\n /**\n * Programmatic override of {@link exclusive}. `null` (default) defers to the\n * `[exclusive]` input; a boolean wins over it. Lets a composing organism\n * (e.g. a submenu wiring in `@cngx/ui/context-menu`) open a nested panel\n * non-exclusively without a consumer-side `[exclusive]=\"false\"` handgrip.\n * Controlled+uncontrolled derivation: {@link effectiveExclusive} resolves\n * the override first, then the input.\n */\n private readonly exclusiveOverrideState = signal<boolean | null>(null);\n\n /**\n * @internal Read-only view of the programmatic {@link exclusive} override.\n * Written via {@link setExclusiveOverride}.\n */\n readonly exclusiveOverride = this.exclusiveOverrideState.asReadonly();\n\n /** Effective exclusivity - override wins, else the `[exclusive]` input. */\n private readonly effectiveExclusive = computed<boolean>(\n () => this.exclusiveOverride() ?? this.exclusive(),\n );\n\n /**\n * Programmatic override of {@link placement}. `null` (default) defers to the\n * `[placement]` input; a value wins over it. Lets a composing organism (the\n * submenu wiring in `@cngx/ui/context-menu`) flank a nested panel to the\n * inline-end without a consumer-side `[placement]` handgrip. Mirrors\n * {@link exclusiveOverride}; {@link effectivePlacement} resolves the override\n * first, then the input.\n */\n private readonly placementOverrideState = signal<PopoverPlacement | null>(null);\n\n /**\n * @internal Read-only view of the programmatic {@link placement} override.\n * Written via {@link setPlacementOverride}.\n */\n readonly placementOverride = this.placementOverrideState.asReadonly();\n\n /**\n * Effective placement for the CSS-anchor path - override wins, else the\n * `[placement]` input, then fully mirrored against the ambient writing\n * direction. Feeds the `POSITION_AREA` write, the token-split arrow edge,\n * and `resolveActualEdge`: `POSITION_AREA` uses physical keywords with no\n * direction awareness, so the whole mirror happens here. A submenu that\n * flanks inline-end under `ltr` flanks the physically-opposite side under\n * `rtl`, matching the shipped keyboard direction-awareness.\n */\n private readonly effectivePlacement = computed<PopoverPlacement>(() =>\n resolveDirectionalPlacement(this.placementOverride() ?? this.placement(), this.direction()),\n );\n\n /**\n * Effective placement for the floating-ui fallback path - the same source\n * as {@link effectivePlacement} but mirrored side-only. `@floating-ui/dom`\n * flips the inline alignment of vertical placements under `rtl` itself, so\n * feeding it the fully-mirrored token would double-flip `top-start` /\n * `bottom-end`. This path mirrors the side and defers alignment to\n * floating-ui.\n */\n private readonly floatingPlacement = computed<PopoverPlacement>(() =>\n resolveFloatingPlacement(this.placementOverride() ?? this.placement(), this.direction()),\n );\n\n /**\n * Programmatic override of {@link positionTryFallbacks}, paired with\n * {@link placementOverride} so a submenu wiring installs the flip chain too.\n * `null` (default) defers to the `[positionTryFallbacks]` input.\n */\n private readonly positionTryFallbacksOverrideState = signal<\n readonly PopoverPositionTryFallback[] | null\n >(null);\n\n /**\n * @internal Read-only view of the programmatic {@link positionTryFallbacks}\n * override. Written via {@link setPositionTryFallbacksOverride}.\n */\n readonly positionTryFallbacksOverride = this.positionTryFallbacksOverrideState.asReadonly();\n\n /** Effective try-fallbacks - override wins, else the `[positionTryFallbacks]` input. */\n private readonly effectivePositionTryFallbacks = computed<readonly PopoverPositionTryFallback[]>(\n () => this.positionTryFallbacksOverride() ?? this.positionTryFallbacks(),\n );\n\n private readonly stateSignal = signal<PopoverState>('closed');\n private readonly idSignal = signal(nextUid('cngx-popover'));\n\n /** Current lifecycle state. */\n readonly state = this.stateSignal.asReadonly();\n\n /** Unique auto-generated ID for this popover instance. */\n readonly id = this.idSignal.asReadonly();\n\n /** Backing state for {@link focusOrigin}. */\n private readonly focusOriginState = signal<HTMLElement | null>(null);\n\n /**\n * The element that held focus when {@link show} was entered, captured\n * synchronously BEFORE the native `showPopover()` call - content\n * autofocus inside the panel therefore cannot displace it.\n * `CngxPopoverTrigger`'s `restoreFocus` reads it as the restore\n * target; cleared on finalize.\n */\n readonly focusOrigin = this.focusOriginState.asReadonly();\n\n /**\n * Implicit anchor slot, written by `CngxPopoverTrigger` and composing\n * organisms via {@link setAnchorElement}.\n */\n private readonly anchorElementState = signal<HTMLElement | null>(null);\n\n /** Explicit anchor slot, claimed by `CngxPopoverAnchor`. */\n private readonly explicitAnchorElementSlot = createSlotRegistry<HTMLElement>();\n\n /**\n * The element a `CngxPopoverAnchor` registered via\n * {@link registerAnchorElement}, or `null`. While non-null it shadows\n * the implicit anchor and `CngxPopoverTrigger` yields its\n * `anchor-name`.\n */\n readonly explicitAnchorElement = this.explicitAnchorElementSlot.current;\n\n /**\n * The anchor element for Floating UI fallback positioning, the\n * arrow-offset geometry and the outside-click guard. Precedence: the\n * explicit anchor ({@link registerAnchorElement}, `CngxPopoverAnchor`)\n * wins over the implicit one ({@link setAnchorElement},\n * `CngxPopoverTrigger` or a composing organism).\n */\n readonly anchorElement = computed<HTMLElement | null>(\n () => this.explicitAnchorElement() ?? this.anchorElementState(),\n );\n\n /**\n * Inline-axis position the arrow ornament should sit at, expressed as\n * a CSS length pinned to the anchor's centre. Computed from\n * `anchorElement()` + the panel's own bounding box on every show /\n * reposition / window resize.\n *\n * Why a JS-computed CSS variable instead of `anchor(center)` in the\n * arrow's stylesheet: CSS Anchor Positioning's `anchor()` function does\n * not resolve from descendants of a top-layer element back to anchors\n * in the regular document flow. The panel itself can anchor to the\n * trigger, but the arrow inside the panel cannot. Writing the offset\n * from JS sidesteps that limitation and works identically in the\n * CSS-Anchor path and the Floating-UI fallback path.\n */\n private readonly _arrowOffset = signal<string | null>(null);\n\n /**\n * Public read-only view of the arrow's inline-axis offset (`<px>` or\n * `null` before the first geometry read). Consumers projecting a\n * `cngxPopoverArrow` template use this to render their own glyph at\n * the same coordinate the default arrow ornament would.\n */\n readonly arrowOffset = computed(() => (this.anchored() ? this._arrowOffset() : null));\n\n /** Backing state for {@link haspopup}. */\n private readonly haspopupState = signal<PopoverHaspopup | undefined>(undefined);\n\n /**\n * Hint for the `CngxPopoverTrigger`'s `aria-haspopup` value. Composers\n * such as `CngxPopoverPanel` install it via {@link setHaspopup} so any\n * trigger pointing at the popover defaults to the right role without\n * the consumer having to set `haspopup` on every trigger element.\n * Consumer-supplied `haspopup` on the trigger still wins.\n */\n readonly haspopup = computed<PopoverHaspopup | undefined>(() =>\n // A sheet or fullscreen presentation is a modal dialog, whatever a\n // composer installed for the anchored layout.\n this.anchored() ? this.haspopupState() : 'dialog',\n );\n\n protected readonly isOpening = computed(() => this.stateSignal() === 'opening');\n protected readonly isOpen = computed(() => this.stateSignal() === 'open');\n protected readonly isClosing = computed(() => this.stateSignal() === 'closing');\n readonly isVisible = computed(() => this.stateSignal() !== 'closed');\n\n protected readonly cssAnchorRef = computed(() =>\n SUPPORTS_ANCHOR && this.anchored() ? `--cngx-pop-${this.idSignal()}` : null,\n );\n\n /**\n * Primary edge of the placement, written from the live trigger and panel\n * rects so the arrow lands on the side that actually faces the trigger.\n * Falls back to the requested placement's edge before the first geometry\n * read so the arrow CSS rules still match on the very first paint.\n * Browsers normalise compound `position-area` values to a\n * non-deterministic keyword order; an explicit attribute is the stable\n * hook for the arrow stylesheet.\n */\n private readonly resolvedEdgeSignal = signal<ArrowEdge | null>(null);\n\n /**\n * Primary edge of the panel facing the trigger after browser-driven\n * shift / flip recovery. `top` | `bottom` | `left` | `right`. Public\n * so consumers projecting a `cngxPopoverArrow` template can rotate\n * their own glyph to match the rendered placement.\n */\n readonly resolvedEdge = computed<ArrowEdge>(\n () =>\n (this.anchored() ? this.resolvedEdgeSignal() : null) ??\n (this.effectivePlacement().split('-')[0] as ArrowEdge),\n );\n\n protected readonly cssMargin = computed(() =>\n SUPPORTS_ANCHOR && this.anchored()\n ? resolveAnchorMargin(this.effectivePlacement(), this.offset())\n : null,\n );\n\n /**\n * Comma-joined `position-try-fallbacks` value, or `null` to skip the\n * style write. Bound via host binding so empty / cleared lists drop the\n * property cleanly. Unsupported browsers ignore the unknown property -\n * gating on `SUPPORTS_ANCHOR` would only suppress a harmless write.\n */\n protected readonly cssPositionTryFallbacks = computed(() => {\n if (!this.anchored()) {\n return null;\n }\n const list = this.effectivePositionTryFallbacks();\n return list.length > 0 ? list.join(', ') : null;\n });\n\n constructor() {\n // Host binding needs a static property name; position-area/inset-area name flips per browser.\n if (SUPPORTS_ANCHOR) {\n effect(() => {\n const style = this.elRef.nativeElement.style;\n if (!this.anchored()) {\n style.removeProperty(ANCHOR_AREA_PROPERTY);\n return;\n }\n style.setProperty(ANCHOR_AREA_PROPERTY, POSITION_AREA[this.effectivePlacement()]);\n });\n }\n // A presentation flip while open: leaving the anchored layout stops the\n // floating engine (the arrow geometry is gated in its computeds); coming\n // back re-positions right away instead of waiting for the next scroll or\n // resize.\n effect(() => {\n const anchored = this.anchored();\n untracked(() => {\n if (this.stateSignal() === 'closed') {\n return;\n }\n if (!anchored) {\n this.floatingPositioner?.stop();\n this.clearFloatingPosition();\n return;\n }\n this.applyFloatingPosition();\n this.cancelArrowFrame();\n this.arrowFrame = requestAnimationFrame(() => {\n this.arrowFrame = null;\n this.updateArrowOffset();\n });\n });\n });\n this.destroyRef.onDestroy(() => this.cancelArrowFrame());\n effect(() => {\n const desired = this.controlledOpen();\n if (desired === undefined) {\n return;\n }\n const current = untracked(() => this.stateSignal());\n if (desired && current === 'closed') {\n this.show();\n }\n if (!desired && (current === 'open' || current === 'opening')) {\n this.hide();\n }\n });\n\n this.destroyRef.onDestroy(() => {\n // finalize() disarms pendingClose; a 'closed' state means it already\n // ran and the handle is gone.\n if (this.stateSignal() !== 'closed') {\n this.finalize();\n }\n });\n\n // Recompute arrow offset on viewport resize while the popover is open.\n // takeUntilDestroyed handles teardown so finalize() does not need an\n // explicit removeEventListener pair.\n const view = this.doc.defaultView;\n if (view) {\n fromEvent(view, 'resize')\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n if (this.stateSignal() !== 'closed') {\n this.updateArrowOffset();\n }\n });\n }\n }\n\n /** Open the popover. No-op if not `closed`. */\n show(): void {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n warnMissingPopoverApi(this.elRef.nativeElement, 'cngxPopover');\n }\n if (this.stateSignal() !== 'closed') {\n return;\n }\n // Without the native Popover API (no polyfill) the open cannot happen.\n // Bail before any state change, so the popover stays closed and can open\n // once a polyfill lands instead of latching in 'opening'.\n if (typeof this.elRef.nativeElement.showPopover !== 'function') {\n return;\n }\n // Snapshot the pre-open focus target before showPopover() runs -\n // autofocus content inside the panel lands right after that call,\n // and a post-CD capture (the trigger's effect) would store the\n // panel content instead of the element to restore to.\n this.focusOriginState.set(this.doc.activeElement as HTMLElement | null);\n if (this.effectiveExclusive()) {\n // Snapshot the set: hide() mutates `openPopovers` mid-loop. An ancestor\n // is this popover's container, not a rival - hiding it would take this\n // panel down with it (the ancestor's display: none cascades).\n for (const other of [...openPopovers]) {\n if (other !== this && !other.elRef.nativeElement.contains(this.elRef.nativeElement)) {\n other.hide();\n }\n }\n }\n openPopovers.add(this);\n this.stateSignal.set('opening');\n if (!this.anchored()) {\n this.clearFloatingPosition();\n }\n this.elRef.nativeElement.showPopover();\n // The host binding writes aria-hidden on the next change detection; the\n // seam may move focus into the panel right now, which must not land\n // under a stale aria-hidden=\"true\".\n this.elRef.nativeElement.setAttribute('aria-hidden', 'false');\n this.presentationSeam()?.onShown();\n installGlobalEscapeListener(this.doc);\n installGlobalOutsideClickListener(this.doc);\n this.applyFloatingPosition();\n requestAnimationFrame(() => {\n if (this.stateSignal() === 'opening') {\n this.stateSignal.set('open');\n }\n // After layout settles the browser's anchor / shift recovery has\n // already placed the panel; reading its rect now reflects the\n // final position the arrow needs to point at. The panel-side\n // border-radius arrives through CNGX_POPOVER_ARROW_BOUNDS - no\n // getComputedStyle read on this directive's side.\n this.updateArrowOffset();\n });\n }\n\n /** Close the popover. No-op if already `closed` or `closing`. */\n hide(): void {\n if (this.stateSignal() === 'closed' || this.stateSignal() === 'closing') {\n return;\n }\n if (this.hiding) {\n return;\n }\n this.hiding = true;\n try {\n this.presentationSeam()?.onHide();\n this.startClosing();\n } finally {\n this.hiding = false;\n }\n }\n\n /** Toggle between open and closed. */\n toggle(): void {\n if (this.stateSignal() === 'closed') {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Register the anchor element for fallback positioning and arrow\n * geometry, or clear it with `null`. Called by `CngxPopoverTrigger`\n * on registration/destroy and by composing organisms that anchor a\n * panel to a virtual element (context-menu pointer coords).\n */\n setAnchorElement(element: HTMLElement | null): void {\n this.anchorElementState.set(element);\n }\n\n /**\n * Release the implicit anchor slot - but only while `element` still\n * holds it. A trigger destroyed after another writer claimed the slot\n * leaves that writer untouched.\n */\n releaseAnchorElement(element: HTMLElement): void {\n this.anchorElementState.update((held) => (held === element ? null : held));\n }\n\n /**\n * Claim the explicit anchor slot. Called by `CngxPopoverAnchor`; last\n * registration wins. The explicit anchor shadows every\n * {@link setAnchorElement} writer (trigger, submenu, context-menu\n * virtual anchor) for positioning, arrow geometry and outside-click\n * handling until it is unregistered.\n */\n registerAnchorElement(element: HTMLElement): void {\n this.explicitAnchorElementSlot.register(element);\n }\n\n /**\n * Release the explicit anchor slot - but only while `element` still\n * holds it. A stale anchor releasing after a successor registered is\n * a no-op.\n */\n unregisterAnchorElement(element: HTMLElement): void {\n this.explicitAnchorElementSlot.unregister(element);\n }\n\n /**\n * Install the `aria-haspopup` hint triggers fall back to when the\n * consumer sets none. Composers (`CngxPopoverPanel`, menu wirings)\n * call this once at construction; `undefined` clears the hint.\n */\n setHaspopup(value: PopoverHaspopup | undefined): void {\n this.haspopupState.set(value);\n }\n\n /**\n * @internal Install or clear the programmatic {@link exclusive} override.\n * `null` defers back to the `[exclusive]` input.\n */\n setExclusiveOverride(value: boolean | null): void {\n this.exclusiveOverrideState.set(value);\n }\n\n /**\n * @internal Install or clear the programmatic {@link placement} override.\n * `null` defers back to the `[placement]` input.\n */\n setPlacementOverride(value: PopoverPlacement | null): void {\n this.placementOverrideState.set(value);\n }\n\n /**\n * @internal Install or clear the programmatic {@link positionTryFallbacks}\n * override. `null` defers back to the `[positionTryFallbacks]` input.\n */\n setPositionTryFallbacksOverride(value: readonly PopoverPositionTryFallback[] | null): void {\n this.positionTryFallbacksOverrideState.set(value);\n }\n\n protected handleToggle(e: ToggleEvent): void {\n // Sync with browser when it closes the popover (e.g. popover=\"auto\" light\n // dismiss). Must run the full finalize() teardown, not just the state\n // write: a bare state sync leaves the instance in the module registry,\n // where it swallows the next Escape and leaks past destroy.\n if (e.newState === 'closed' && this.stateSignal() !== 'closed') {\n this.finalize();\n }\n }\n\n /**\n * @internal Called by the global outside-click listener for every open\n * popover. Hides this one when it opted into `closeOnOutsideClick` and the\n * pointerdown landed outside its panel, its anchor and its trigger (the\n * implicit anchor holder, which differs from the anchor while a\n * `CngxPopoverAnchor` holds the popover).\n */\n closeIfOutsidePointerDown(target: EventTarget | null): void {\n // Outside a sheet the presentation modifier owns the tap and routes it\n // through its close request; hiding here would bypass that policy.\n if (!this.closeOnOutsideClick() || !this.anchored()) {\n return;\n }\n const node = target as Node | null;\n const panel = this.popoverElement;\n const anchor = this.anchorElement();\n const trigger = this.anchorElementState();\n if (panel.contains(node) || anchor?.contains(node) || trigger?.contains(node)) {\n return;\n }\n this.hide();\n }\n\n /**\n * Shared fallback engine - offset middleware, scroll/resize re-run while\n * open, state-guarded writes. `null` when no fallback is provided.\n */\n private readonly floatingPositioner = this.floatingFallback\n ? createFloatingPositioner({\n fallback: this.floatingFallback,\n getAnchor: () => this.anchorElement(),\n getElement: () => this.popoverElement,\n getPlacement: () => FLOATING_PLACEMENT[this.floatingPlacement()],\n getOffset: () => this.offset(),\n // A position request in flight when the panel leaves the anchored\n // layout must not land on the sheet.\n isOpen: () => this.stateSignal() !== 'closed' && this.anchored(),\n onPositioned: () => this.updateArrowOffset(),\n })\n : null;\n\n /**\n * Apply Floating UI positioning when CSS Anchor is not supported\n * and the consumer has provided the fallback via `provideFloatingFallback()`.\n */\n private applyFloatingPosition(): void {\n if (SUPPORTS_ANCHOR || !this.floatingPositioner || !this.anchored()) {\n return;\n }\n if (!this.anchorElement()) {\n return;\n }\n if (\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n (this.floatingFallback?.middleware ?? []).length === 0\n ) {\n warnMissingFloatingMiddleware(this.popoverElement.ownerDocument);\n }\n this.floatingPositioner.start();\n }\n\n /**\n * Recompute the arrow's edge and inline offset from the live anchor and\n * panel rects. The resolved edge captures any browser-driven flip; the\n * offset is clamped inside the panel's rounded-corner bounds so the\n * arrow's base stays flush with the panel's straight edge even when the\n * anchor sits outside the panel's inline extent.\n */\n private updateArrowOffset(): void {\n if (!this.anchored()) {\n return;\n }\n const anchor = this.anchorElement();\n if (!anchor) {\n this._arrowOffset.set(null);\n this.resolvedEdgeSignal.set(null);\n return;\n }\n const panel = this.elRef.nativeElement;\n const panelRect = panel.getBoundingClientRect();\n if (panelRect.width === 0 || panelRect.height === 0) {\n this._arrowOffset.set(null);\n this.resolvedEdgeSignal.set(null);\n return;\n }\n const triggerRect = anchor.getBoundingClientRect();\n const edge = resolveActualEdge(triggerRect, panelRect, this.effectivePlacement());\n this.resolvedEdgeSignal.set(edge);\n const horizontal = edge === 'top' || edge === 'bottom';\n const triggerCentre = horizontal\n ? triggerRect.left + triggerRect.width / 2\n : triggerRect.top + triggerRect.height / 2;\n const panelStart = horizontal ? panelRect.left : panelRect.top;\n const panelDim = horizontal ? panelRect.width : panelRect.height;\n const radius = this.getArrowBounds()?.borderRadius ?? 12;\n const raw = triggerCentre - panelStart;\n const clamped = Math.max(radius, Math.min(raw, panelDim - radius));\n this._arrowOffset.set(`${clamped}px`);\n }\n\n private arrowFrame: number | null = null;\n\n // The floating fallback writes inline left/top, which beat any stylesheet;\n // a sheet opened after an anchored open must not inherit them.\n private clearFloatingPosition(): void {\n if (!this.floatingPositioner) {\n return;\n }\n this.popoverElement.style.removeProperty('left');\n this.popoverElement.style.removeProperty('top');\n }\n\n private cancelArrowFrame(): void {\n if (this.arrowFrame !== null) {\n cancelAnimationFrame(this.arrowFrame);\n this.arrowFrame = null;\n }\n }\n\n private get popoverElement(): HTMLElement {\n return this.elRef.nativeElement;\n }\n\n private startClosing(): void {\n // Cascade to open descendants: the ancestor's display: none would take\n // their panels down visually while state, ARIA, and the registry still\n // said open - and the next Escape would route to an invisible panel.\n const host = this.popoverElement;\n for (const other of [...openPopovers]) {\n if (other !== this && host.contains(other.popoverElement)) {\n other.hide();\n }\n }\n if (hasTransition(this.popoverElement)) {\n this.stateSignal.set('closing');\n this.pendingClose = onTransitionDone(this.popoverElement, () => this.finalize());\n } else {\n this.finalize();\n }\n }\n\n private finalize(): void {\n // Disarm any pending close wait no matter which path got here - the\n // browser's own light dismiss routes through handleToggle straight to\n // finalize(), and a stale armed handle would force-close a reopened\n // panel when its fallback timer fires.\n this.pendingClose?.cancel();\n this.pendingClose = null;\n this.floatingPositioner?.stop();\n openPopovers.delete(this);\n this._arrowOffset.set(null);\n this.resolvedEdgeSignal.set(null);\n this.focusOriginState.set(null);\n const el = this.popoverElement;\n // Move focus out of the panel BEFORE it flips to aria-hidden (state ->\n // 'closed'). Closing while a descendant (e.g. the close button, or a\n // control reached by keyboard) still holds focus would trap that focus\n // under aria-hidden - the browser blocks it and warns. Blurring here\n // relocates to the document synchronously, matching the eventual\n // display:none end state; opt-in `restoreFocus` still returns focus to\n // the trigger afterwards.\n const active = this.doc.activeElement as HTMLElement | null;\n if (active && el.contains(active) && typeof active.blur === 'function') {\n active.blur();\n }\n try {\n el.hidePopover();\n } catch {\n // Element may already be hidden or disconnected\n }\n this.stateSignal.set('closed');\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n untracked,\n} from '@angular/core';\n\nimport { SUPPORTS_ANCHOR } from './anchor-positioning';\nimport { type CngxPopover } from './popover.directive';\nimport type { PopoverHaspopup } from './popover.types';\n\n/**\n * ARIA wiring atom for elements that trigger a `CngxPopover`.\n *\n * Sets `aria-expanded`, `aria-controls`, and `aria-haspopup` based on the\n * referenced popover's state. Also sets `anchor-name` for CSS Anchor\n * Positioning and registers the anchor element on the popover for fallback\n * positioning. Both geometry jobs take effect only while no `CngxPopoverAnchor`\n * holds the popover: when the focusable trigger is not the visible box the\n * panel should hang under, put `[cngxPopoverAnchor]` on that box and the\n * trigger yields its `anchor-name` while keeping every ARIA attribute.\n *\n * Contains **no event handlers** - the consumer binds interactions directly:\n *\n * ```html\n * <button [cngxPopoverTrigger]=\"pop\" (click)=\"pop.toggle()\">Menu</button>\n * <div cngxPopover #pop=\"cngxPopover\" placement=\"bottom-start\">…</div>\n * ```\n *\n * ### Focus restoration\n * Opt in with `[restoreFocus]=\"true\"` to restore focus on close to the\n * element that was focused before the popover opened (the popover\n * snapshots it synchronously in `show()`, so content autofocus cannot\n * displace the restore target). Useful for menus, confirm panels, and\n * dialogs that steal focus from the trigger.\n *\n * @category common/popover\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-trigger.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPopover, CngxPopoverAnchor, CngxPopoverPanel, CngxTooltip\n * <example-url>http://localhost:4200/#/common/popover/click-popover</example-url>\n * <example-url>http://localhost:4200/#/common/popover/controlled-open</example-url>\n * <example-url>http://localhost:4200/#/common/popover/escape-mode</example-url>\n * <example-url>http://localhost:4200/#/common/popover/placement-variants</example-url>\n * <example-url>http://localhost:4200/#/common/popover/anchor/field-box-anchor</example-url>\n */\n@Directive({\n selector: '[cngxPopoverTrigger]',\n exportAs: 'cngxPopoverTrigger',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'popoverRef().isVisible()',\n '[attr.aria-controls]': 'controls()',\n '[attr.aria-haspopup]': 'haspopup()',\n '[style.anchor-name]': 'cssAnchorName()',\n },\n})\nexport class CngxPopoverTrigger {\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Explicit reference to the popover this trigger controls. */\n readonly popoverRef = input.required<CngxPopover>({\n alias: 'cngxPopoverTrigger',\n });\n\n /**\n * ARIA haspopup override. When set, wins over the popover-supplied\n * hint (`popoverRef().haspopup()`, populated by composers such as\n * `CngxPopoverPanel`). Final fallback when neither is set is `'true'`.\n * Accepts the W3C-spec values for supported popup-container roles:\n * `'dialog'`, `'listbox'`, `'menu'`, `'tree'`, or `'true'`.\n *\n * Pass `'none'` to emit no `aria-haspopup` at all - correct for a\n * disclosure whose popup is not one of the recognised widget types\n * (e.g. a list of links), where `aria-expanded` alone describes the\n * trigger. `'none'` wins over the composer hint, so it also cancels a\n * `CngxPopoverPanel`'s `'dialog'` default.\n */\n readonly haspopupInput = input<PopoverHaspopup | 'none' | undefined>(undefined, {\n alias: 'haspopup',\n });\n\n /**\n * ARIA controls override. When set, `aria-controls` names this id instead\n * of the popover element - correct when the popup role sits on an element\n * inside the popover (a `role=\"listbox\"` or `role=\"tree\"` panel). `null`\n * or unset falls back to `popoverRef().id()`.\n */\n readonly controlsInput = input<string | null | undefined>(undefined, {\n alias: 'controls',\n });\n\n /**\n * When `true`, remembers the popover's pre-open focus target (the\n * popover snapshots `document.activeElement` synchronously inside\n * `show()`, before content autofocus can land in the panel) and\n * restores focus to it when the popover closes. Defaults to `false`\n * so the trigger stays a passive ARIA atom; opt in for menus,\n * confirm panels, and dialogs that move focus away from the trigger.\n */\n readonly restoreFocus = input(false);\n\n /**\n * Resolved `aria-haspopup`. Consumer override (`haspopup` on the\n * trigger element) wins; otherwise the popover's `haspopup` signal\n * (set by composers like `CngxPopoverPanel`) decides; final fallback\n * is `'true'`. The `'none'` sentinel resolves to `null` so the host\n * binding drops the attribute entirely.\n */\n protected readonly haspopup = computed<PopoverHaspopup | null>(() => {\n const resolved = this.haspopupInput() ?? this.popoverRef().haspopup() ?? 'true';\n return resolved === 'none' ? null : resolved;\n });\n\n /** Resolved `aria-controls`: the consumer override, else the popover id. */\n protected readonly controls = computed<string>(\n () => this.controlsInput() ?? this.popoverRef().id(),\n );\n\n /**\n * CSS anchor name, yielded (`null`) while a `CngxPopoverAnchor` holds\n * the popover's explicit anchor slot.\n */\n protected readonly cssAnchorName = computed(() =>\n SUPPORTS_ANCHOR && this.popoverRef().explicitAnchorElement() === null\n ? `--cngx-pop-${this.popoverRef().id()}`\n : null,\n );\n\n private savedFocus: HTMLElement | null = null;\n\n constructor() {\n // Register this element as the anchor for fallback positioning.\n effect(() => {\n const pop = this.popoverRef();\n untracked(() => pop.setAnchorElement(this.elRef.nativeElement));\n });\n\n // Release the implicit anchor slot on destroy. The popover guards on\n // identity, so a trigger that registered later is not clobbered.\n this.destroyRef.onDestroy(() => {\n this.popoverRef().releaseAnchorElement(this.elRef.nativeElement);\n });\n\n // Focus restoration: adopt the popover's pre-show focus snapshot on\n // open, restore on close. Inert until `restoreFocus` is opted into.\n effect(() => {\n if (!this.restoreFocus()) {\n return;\n }\n const visible = this.popoverRef().isVisible();\n if (visible) {\n untracked(() => {\n this.savedFocus = this.popoverRef().focusOrigin() ?? this.elRef.nativeElement;\n });\n } else if (this.savedFocus) {\n const target = this.savedFocus;\n this.savedFocus = null;\n untracked(() => {\n if (typeof target.focus === 'function' && target.isConnected) {\n target.focus();\n }\n });\n }\n });\n }\n}\n","import { computed, Directive, effect, ElementRef, inject, input, untracked } from '@angular/core';\n\nimport { SUPPORTS_ANCHOR } from './anchor-positioning';\nimport { type CngxPopover } from './popover.directive';\n\n/**\n * Geometry anchor atom: positions a `CngxPopover` against its host\n * element instead of against the popover's trigger.\n *\n * Reach for it when the focusable trigger is not the visible box the\n * panel should hang under - an `<input>` inside a bordered field row, an\n * icon button inside a toolbar segment. The trigger keeps every ARIA\n * attribute (`aria-expanded`, `aria-controls`, `aria-haspopup`); this\n * atom owns only the geometry. It is the cngx counterpart of Material's\n * `matAutocompleteOrigin`.\n *\n * ```html\n * <div class=\"field\" [cngxPopoverAnchor]=\"pop\">\n * <input [cngxPopoverTrigger]=\"pop\" (focus)=\"pop.show()\" aria-label=\"City\" />\n * </div>\n * <div cngxPopover #pop=\"cngxPopover\" placement=\"bottom-start\">…</div>\n * ```\n *\n * While the atom holds the popover's explicit anchor slot it emits\n * `anchor-name` for CSS Anchor Positioning and is the reference element\n * of the Floating UI fallback, the arrow geometry and the outside-click\n * guard; `CngxPopoverTrigger` yields its own `anchor-name`. The explicit\n * anchor wins over every `setAnchorElement` writer. With two atoms on one\n * popover the last registered wins, and only the holder emits\n * `anchor-name`. On destroy (or when the bound popover changes) the atom\n * releases the slot identity-guarded and the trigger becomes the anchor\n * again.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-anchor.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPopover, CngxPopoverTrigger\n * <example-url>http://localhost:4200/#/common/popover/anchor/field-box-anchor</example-url>\n */\n@Directive({\n selector: '[cngxPopoverAnchor]',\n exportAs: 'cngxPopoverAnchor',\n standalone: true,\n host: {\n '[style.anchor-name]': 'cssAnchorName()',\n },\n})\nexport class CngxPopoverAnchor {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /** The popover this element anchors. */\n readonly popoverRef = input.required<CngxPopover>({\n alias: 'cngxPopoverAnchor',\n });\n\n /** Whether this host currently holds the popover's explicit anchor slot. */\n protected readonly isAnchor = computed(\n () => this.popoverRef().explicitAnchorElement() === this.host,\n );\n\n protected readonly cssAnchorName = computed(() =>\n SUPPORTS_ANCHOR && this.isAnchor() ? `--cngx-pop-${this.popoverRef().id()}` : null,\n );\n\n constructor() {\n // Cross-directive registration keyed on the input; onCleanup releases\n // the previous popover on a ref swap and on destroy.\n effect((onCleanup) => {\n const pop = this.popoverRef();\n untracked(() => pop.registerAnchorElement(this.host));\n onCleanup(() => pop.unregisterAnchorElement(this.host));\n });\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n Renderer2,\n signal,\n untracked,\n} from '@angular/core';\n\nimport { CngxReducedMotion } from '@cngx/common/a11y';\nimport { injectDirection } from '@cngx/core';\nimport { nextUid } from '@cngx/core/utils';\n\nimport {\n ANCHOR_AREA_PROPERTY,\n POSITION_AREA,\n resolveAnchorMargin,\n resolveDirectionalPlacement,\n resolveFloatingPlacement,\n SUPPORTS_ANCHOR,\n} from './anchor-positioning';\nimport {\n CNGX_FLOATING_FALLBACK,\n createFloatingPositioner,\n FLOATING_PLACEMENT,\n} from './floating-fallback';\nimport type {\n PopoverPlacement,\n PopoverPositionTryFallback,\n PopoverState,\n TooltipTriggerMode,\n} from './popover.types';\nimport { warnMissingPopoverApi } from './popover.directive';\n\n/** @internal Small debounce to prevent SR announcement storms during rapid Tab navigation. */\nconst FOCUS_DEBOUNCE_MS = 50;\n\n/**\n * String-input tooltip directive applied to the trigger element.\n *\n * Creates the tooltip popover element internally via `Renderer2` and manages\n * the full lifecycle: hover/focus triggers, open/close delays, Escape dismiss,\n * CSS Anchor Positioning, and ARIA wiring (`aria-describedby` + `role=\"tooltip\"`).\n *\n * The consumer sees only the attribute - no extra elements in the template.\n *\n * ### Basic\n * ```html\n * <button cngxTooltip=\"Ctrl+S\">Save</button>\n * ```\n *\n * ### With configuration\n * ```html\n * <button cngxTooltip=\"Ctrl+S\" tooltipPlacement=\"top\" [tooltipDelay]=\"500\">\n * Save\n * </button>\n * ```\n *\n * @category common/popover\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/tooltip.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPopover, CngxPopoverTrigger\n * <example-url>http://localhost:4200/#/common/popover/tooltip/basic-tooltip</example-url>\n * <example-url>http://localhost:4200/#/common/popover/tooltip/custom-delay</example-url>\n * <example-url>http://localhost:4200/#/common/popover/tooltip/disabled-state</example-url>\n * <example-url>http://localhost:4200/#/common/popover/tooltip/keyboard-navigation</example-url>\n * <example-url>http://localhost:4200/#/common/popover/tooltip/placement</example-url>\n * <example-url>http://localhost:4200/#/common/popover/tooltip/programmatic-control</example-url>\n */\n@Directive({\n selector: '[cngxTooltip]',\n exportAs: 'cngxTooltip',\n standalone: true,\n hostDirectives: [CngxReducedMotion],\n host: {\n '[attr.aria-describedby]': 'ariaDescribedBy()',\n '[style.anchor-name]': 'cssAnchorName()',\n '(mouseenter)': 'handleMouseEnter()',\n '(mouseleave)': 'handleMouseLeave()',\n '(focus)': 'handleFocus()',\n '(blur)': 'handleBlur()',\n },\n})\nexport class CngxTooltip {\n private readonly renderer = inject(Renderer2);\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly floatingFallback = inject(CNGX_FLOATING_FALLBACK, { optional: true });\n private readonly direction = injectDirection();\n\n /** Tooltip text content. */\n readonly text = input.required<string>({ alias: 'cngxTooltip' });\n\n /** Anchor-relative placement. */\n readonly placement = input<PopoverPlacement>('top', { alias: 'tooltipPlacement' });\n\n /**\n * @internal\n * `placement` fully mirrored against the ambient writing direction, for the\n * CSS-anchor path (`POSITION_AREA`, physical keywords, no direction\n * awareness).\n */\n private readonly directionalPlacement = computed(() =>\n resolveDirectionalPlacement(this.placement(), this.direction()),\n );\n\n /**\n * @internal\n * `placement` mirrored side-only, for the floating-ui fallback path.\n * `@floating-ui/dom` flips the inline alignment of vertical placements under\n * `rtl` itself, so a full mirror would double-flip `top-start` / `bottom-end`\n * here. This path mirrors the side and defers alignment to floating-ui.\n */\n private readonly floatingPlacement = computed(() =>\n resolveFloatingPlacement(this.placement(), this.direction()),\n );\n\n /** Gap between trigger and tooltip in px. */\n readonly offset = input(8, { alias: 'tooltipOffset' });\n\n /** Delay in ms before opening on mouseenter. */\n readonly openDelay = input(300, { alias: 'tooltipDelay' });\n\n /** Delay in ms before closing on mouseleave. */\n readonly closeDelay = input(100);\n\n /** Whether the tooltip is active. When `false`, no tooltip appears and ARIA is cleared. */\n readonly enabled = input(true);\n\n /**\n * Trigger mode. `'auto'` (default) opens on hover/focus with the\n * configured delays; `'manual'` opts the host out of the hover/focus\n * listeners so only `show()` / `hide()` open or close the tooltip.\n * Escape still dismisses an open tooltip in either mode.\n */\n readonly triggers = input<TooltipTriggerMode>('auto');\n\n /**\n * CSS `<try-tactic>` fallbacks for `position-try-fallbacks`. Empty array\n * (default) means no fallback CSS is written; the tooltip stays at the\n * declared `tooltipPlacement` regardless of viewport clipping. Tooltips\n * are decorative - collision recovery is opt-in per-tooltip.\n */\n readonly positionTryFallbacks = input<readonly PopoverPositionTryFallback[]>([], {\n alias: 'tooltipPositionTryFallbacks',\n });\n\n private readonly stateSignal = signal<PopoverState>('closed');\n private readonly idSignal = signal(nextUid('cngx-tooltip'));\n\n /** Current lifecycle state. */\n readonly state = this.stateSignal.asReadonly();\n\n private tooltipEl: HTMLElement | null = null;\n private openTimer: ReturnType<typeof setTimeout> | null = null;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n\n protected readonly ariaDescribedBy = computed(() => (this.enabled() ? this.idSignal() : null));\n\n protected readonly cssAnchorName = computed(() =>\n SUPPORTS_ANCHOR ? `--cngx-tip-${this.idSignal()}` : null,\n );\n\n constructor() {\n this.createTooltipElement();\n\n effect(() => {\n const text = this.text();\n const el = untracked(() => this.tooltipEl);\n if (el) {\n el.textContent = text;\n }\n });\n\n effect(() => {\n const placement = this.directionalPlacement();\n const offset = this.offset();\n const el = untracked(() => this.tooltipEl);\n if (!el) {\n return;\n }\n\n if (SUPPORTS_ANCHOR) {\n el.style.setProperty('position-anchor', `--cngx-tip-${this.idSignal()}`);\n el.style.setProperty(ANCHOR_AREA_PROPERTY, POSITION_AREA[placement]);\n el.style.setProperty('margin', resolveAnchorMargin(placement, offset));\n }\n });\n\n // position-try-fallbacks is written unconditionally - unsupported\n // browsers ignore the unknown property, and the write keeps a uniform\n // test surface across jsdom + real browsers.\n effect(() => {\n const fallbacks = this.positionTryFallbacks();\n const el = untracked(() => this.tooltipEl);\n if (!el) {\n return;\n }\n if (fallbacks.length > 0) {\n el.style.setProperty('position-try-fallbacks', fallbacks.join(', '));\n } else {\n el.style.removeProperty('position-try-fallbacks');\n }\n });\n\n effect(() => {\n const enabled = this.enabled();\n if (!enabled) {\n const current = untracked(() => this.stateSignal());\n if (current !== 'closed') {\n this.hide();\n }\n }\n });\n\n this.destroyRef.onDestroy(() => {\n this.clearTimers();\n this.floatingPositioner?.stop();\n this.elRef.nativeElement.ownerDocument.removeEventListener(\n 'keydown',\n this.handleDocumentEscape,\n true,\n );\n this.tooltipEl?.remove();\n });\n }\n\n /** Show the tooltip immediately (bypassing delay). */\n show(): void {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n warnMissingPopoverApi(this.tooltipEl!, 'cngxTooltip');\n }\n if (!this.enabled() || this.stateSignal() !== 'closed') {\n return;\n }\n // Without the Popover API the open cannot happen; stay closed instead of\n // latching in 'opening', so the tooltip opens once a polyfill lands.\n if (typeof this.tooltipEl!.showPopover !== 'function') {\n return;\n }\n this.stateSignal.set('opening');\n // The element ships aria-hidden while closed; an open tooltip must be\n // exposed - it is the live target of the trigger's aria-describedby.\n this.tooltipEl!.removeAttribute('aria-hidden');\n this.tooltipEl!.showPopover();\n this.elRef.nativeElement.ownerDocument.addEventListener(\n 'keydown',\n this.handleDocumentEscape,\n true,\n );\n this.applyFloatingPosition();\n requestAnimationFrame(() => {\n if (this.stateSignal() === 'opening') {\n this.stateSignal.set('open');\n }\n });\n }\n\n /** Hide the tooltip immediately (bypassing delay). */\n hide(): void {\n if (this.stateSignal() === 'closed' || this.stateSignal() === 'closing') {\n return;\n }\n this.clearTimers();\n this.finalize();\n }\n\n protected handleMouseEnter(): void {\n if (this.triggers() !== 'auto' || !this.enabled()) {\n return;\n }\n this.clearCloseTimer();\n const delay = this.openDelay();\n if (delay > 0) {\n this.openTimer = setTimeout(() => this.show(), delay);\n } else {\n this.show();\n }\n }\n\n protected handleMouseLeave(): void {\n if (this.triggers() !== 'auto') {\n return;\n }\n this.clearOpenTimer();\n const delay = this.closeDelay();\n if (delay > 0) {\n this.closeTimer = setTimeout(() => this.hide(), delay);\n } else {\n this.hide();\n }\n }\n\n protected handleFocus(): void {\n if (this.triggers() !== 'auto' || !this.enabled()) {\n return;\n }\n // Debounce prevents SR announcement storm when user rapidly Tabs\n // through a toolbar of tooltipped buttons.\n this.clearTimers();\n this.openTimer = setTimeout(() => this.show(), FOCUS_DEBOUNCE_MS);\n }\n\n protected handleBlur(): void {\n if (this.triggers() !== 'auto') {\n return;\n }\n this.clearTimers();\n this.hide();\n }\n\n /**\n * Document-level Escape while open (capture phase). A hover-opened tooltip\n * has no focus relationship with its trigger, so a host keydown binding\n * never fires - WCAG 1.4.13 requires Escape to dismiss regardless of where\n * the keyboard focus sits. stopPropagation keeps parent overlays (dialog,\n * popover) open: Escape dismisses the innermost surface only.\n */\n private readonly handleDocumentEscape = (event: KeyboardEvent): void => {\n if (event.key !== 'Escape' || this.stateSignal() === 'closed') {\n return;\n }\n event.stopPropagation();\n this.hide();\n };\n\n /**\n * Shared fallback engine (same as `CngxPopover`) - offset middleware,\n * scroll/resize re-run while open, state-guarded writes. First step of\n * folding the tooltip onto the popover state machine. `null` when no\n * fallback is provided.\n */\n private readonly floatingPositioner = this.floatingFallback\n ? createFloatingPositioner({\n fallback: this.floatingFallback,\n getAnchor: () => this.elRef.nativeElement,\n getElement: () => this.tooltipEl,\n getPlacement: () => FLOATING_PLACEMENT[this.floatingPlacement()],\n getOffset: () => this.offset(),\n isOpen: () => this.stateSignal() !== 'closed',\n })\n : null;\n\n private applyFloatingPosition(): void {\n if (SUPPORTS_ANCHOR || !this.floatingPositioner) {\n return;\n }\n this.floatingPositioner.start();\n }\n\n private createTooltipElement(): void {\n const el = this.renderer.createElement('div') as HTMLElement;\n el.setAttribute('popover', 'manual');\n el.setAttribute('role', 'tooltip');\n el.id = this.idSignal();\n el.setAttribute('aria-hidden', 'true');\n el.classList.add('cngx-tooltip');\n\n const trigger = this.elRef.nativeElement;\n if (trigger.parentElement) {\n this.renderer.insertBefore(trigger.parentElement, el, trigger.nextSibling);\n } else {\n // A parentless trigger cannot host the tooltip inside itself: void and\n // replaced elements drop the child silently. The tooltip renders in the\n // top layer anyway, so body is the correct fallback host.\n this.renderer.appendChild(trigger.ownerDocument.body, el);\n }\n\n this.tooltipEl = el;\n }\n\n private finalize(): void {\n this.floatingPositioner?.stop();\n this.elRef.nativeElement.ownerDocument.removeEventListener(\n 'keydown',\n this.handleDocumentEscape,\n true,\n );\n if (this.tooltipEl) {\n try {\n this.tooltipEl.hidePopover();\n } catch {\n // May already be hidden or disconnected\n }\n this.tooltipEl.setAttribute('aria-hidden', 'true');\n }\n this.stateSignal.set('closed');\n }\n\n private clearTimers(): void {\n this.clearOpenTimer();\n this.clearCloseTimer();\n }\n\n private clearOpenTimer(): void {\n if (this.openTimer) {\n clearTimeout(this.openTimer);\n this.openTimer = null;\n }\n }\n\n private clearCloseTimer(): void {\n if (this.closeTimer) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, inject, InjectionToken, type Signal } from '@angular/core';\nimport { createContainerSize } from '@cngx/common/layout';\nimport { injectWindow } from '@cngx/core/tokens';\n\nconst BREAKPOINT_PROPERTY = '--cngx-popover-sheet-breakpoint';\n\n/**\n * @internal The `--cngx-popover-sheet-breakpoint` value `cngx-popover-sheet.css`\n * writes on the root: `'1'` on coarse, narrow viewports, `'0'` otherwise, `''`\n * before the first resize entry or without the stylesheet. One observer per\n * application, shared by every sheet.\n */\nexport const CNGX_POPOVER_SHEET_BREAKPOINT = new InjectionToken<Signal<string>>(\n 'CngxPopoverSheetBreakpoint',\n {\n providedIn: 'root',\n factory: () =>\n createContainerSize(\n inject(DOCUMENT).documentElement,\n inject(DestroyRef),\n injectWindow(),\n ).property(BREAKPOINT_PROPERTY),\n },\n);\n","import { inject, InjectionToken, type Signal } from '@angular/core';\nimport type { KeyedRegistry, SlotRegistry } from '@cngx/core/utils';\nimport { CngxRuntimeError } from '@cngx/utils';\n\n/**\n * Why a sheet asked to close: a swipe on the header or handle, a tap outside\n * the panel, the Android back gesture, or a close control inside the sheet.\n *\n * @category common/popover\n */\nexport type CngxPopoverSheetCloseReason = 'swipe' | 'backdrop' | 'back' | 'close';\n\n/** @internal Handle a `CngxPopoverSheetTitle` registers. */\nexport interface CngxPopoverSheetTitleHandle {\n readonly id: Signal<string>;\n}\n\n/** @internal Handle a `CngxPopoverSheetInitialFocus` registers. */\nexport interface CngxPopoverSheetFocusHandle {\n readonly element: HTMLElement;\n /** Whether the element takes part in the next open. Absent means it does. */\n readonly enabled?: Signal<boolean>;\n}\n\n/**\n * @internal What the sheet parts need from `CngxPopoverSheet`. A token\n * instead of the directive class keeps the parts free of the directive\n * import (dialog-title precedent, `CNGX_DIALOG_ARIA_REGISTRY`).\n */\nexport interface CngxPopoverSheetPartsHost {\n readonly titleRegistry: SlotRegistry<CngxPopoverSheetTitleHandle>;\n /** Keyed by a per-handle uid; the first enabled handle in document order wins. */\n readonly initialFocusRegistry: KeyedRegistry<CngxPopoverSheetFocusHandle>;\n /** `true` while the sheet lays the panel out as sheet or fullscreen. */\n readonly modal: Signal<boolean>;\n requestClose(reason: CngxPopoverSheetCloseReason): void;\n}\n\n/** @internal Provided by `CngxPopoverSheet` for its parts. */\nexport const CNGX_POPOVER_SHEET_HOST = new InjectionToken<CngxPopoverSheetPartsHost>(\n 'CngxPopoverSheetHost',\n);\n\n/**\n * @internal The sheet a part belongs to. A part outside a sheet would render\n * nothing useful (an unnamed dialog, a dead swipe), so it throws instead.\n */\nexport function injectPopoverSheetHost(part: string): CngxPopoverSheetPartsHost {\n const host = inject(CNGX_POPOVER_SHEET_HOST, { optional: true });\n if (!host) {\n throw new CngxRuntimeError(\n 'CNGX1066',\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n `[${part}] must be placed inside an element with [cngxPopoverSheet].`,\n );\n }\n return host;\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n output,\n untracked,\n} from '@angular/core';\nimport {\n type AriaLivePoliteness,\n CNGX_FOCUS_TRAP_DRIVER,\n CngxFocusTrap,\n type CngxFocusTrapDriver,\n CngxLiveAnnouncer,\n injectScopedLiveRegion,\n} from '@cngx/common/a11y';\nimport { createPinnedScrollLock } from '@cngx/common/layout';\nimport { injectWindow } from '@cngx/core/tokens';\nimport { createKeyedRegistry, createSlotRegistry, createTransitionTracker } from '@cngx/core/utils';\nimport { cngxDevWarn, CngxRuntimeError } from '@cngx/utils';\n\nimport { CngxPopover } from './popover.directive';\nimport {\n CNGX_POPOVER_PRESENTATION,\n type CngxPopoverPresentation,\n type CngxPopoverPresentationSeam,\n} from './popover-presentation';\nimport { CNGX_POPOVER_SHEET_BREAKPOINT } from './popover-sheet-breakpoint';\nimport {\n CNGX_POPOVER_SHEET_HOST,\n type CngxPopoverSheetCloseReason,\n type CngxPopoverSheetFocusHandle,\n type CngxPopoverSheetPartsHost,\n type CngxPopoverSheetTitleHandle,\n} from './popover-sheet-host';\n\n/**\n * What a consumer asks for: a fixed presentation, or `'auto'` to let the\n * breakpoint in `cngx-popover-sheet.css` decide.\n *\n * @category common/popover\n */\nexport type CngxPopoverPresentationRequest = 'auto' | CngxPopoverPresentation;\n\nconst SETTLING_ATTRIBUTE = 'data-cngx-sheet-settling';\nconst SETTLING_FRAME_CAP = 4;\nconst LIVE_REGION_SELECTOR = '[aria-live], [role=\"status\"], [role=\"alert\"], [role=\"log\"]';\nconst FOCUS_TRAP_ANCHOR_CLASS = 'cdk-focus-trap-anchor';\n// Longer than a tap's pointerdown-to-click gap, shorter than a second tap.\nconst CLICK_SWALLOW_MS = 600;\n\n// Not in lib.dom yet; Chromium only (Android back gesture, Escape).\ninterface CloseWatcherLike {\n onclose: (() => void) | null;\n destroy(): void;\n}\ntype CloseWatcherCtor = new () => CloseWatcherLike;\n\n// Engaged modal sheets, oldest first. Only the topmost answers an outside\n// tap: a tap on a later sheet is outside an earlier one that is not its\n// DOM ancestor, and must not close both.\nconst engagedSheets: CngxPopoverSheet[] = [];\n\n// How many engaged sheets want each element inert. Several sheets can be\n// open at once (`[exclusive]=\"false\"`), so an element stays inert until the\n// last sheet that claimed it lets go, and one sheet's release never makes\n// the page live under another. Elements inert before any sheet are never\n// claimed and never touched.\nconst inertClaims = new WeakMap<HTMLElement, number>();\n\n// The sheet is a presentation of the popover on its own element; without\n// one there is nothing to present.\nfunction injectSheetPopover(): CngxPopover {\n const popover = inject(CngxPopover, { self: true, optional: true });\n if (!popover) {\n throw new CngxRuntimeError(\n 'CNGX1067',\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n '[cngxPopoverSheet] must be placed on an element with [cngxPopover].',\n );\n }\n return popover;\n}\n\n/**\n * Turns a `CngxPopover` into a modal bottom sheet or fullscreen panel on\n * coarse, narrow viewports, and leaves it anchored everywhere else.\n *\n * Place it on the `[cngxPopover]` element. With the default `'auto'` request,\n * the breakpoint written once in `cngx-popover-sheet.css`\n * (`(pointer: coarse) and (max-width: 48rem)`) picks between the anchored\n * panel and `autoPresentation` (`'sheet'` or `'fullscreen'`). Pass a fixed\n * presentation to override it.\n *\n * Both non-anchored presentations are modal: the host becomes\n * `role=\"dialog\"` + `aria-modal=\"true\"`, named by its\n * `CngxPopoverSheetTitle`; focus moves into the panel inside `show()`, onto\n * the first enabled `CngxPopoverSheetInitialFocus` (a marked search input\n * focused there keeps the iOS keyboard of a tap open), Tab is trapped, every page\n * sibling is `inert`, the page is pinned, and announcements go through\n * {@link announce} into a live region inside the panel, the only region\n * VoiceOver speaks under `aria-modal`. On close the page is live again and\n * focus is back on the opener before the close transition starts.\n *\n * The sheet never closes itself. Header swipes, outside taps and the Android\n * back gesture arrive as `closeRequested` with a reason; the popover hides\n * unless `closeOnRequest` is `false`, which lets a consumer apply its own\n * dismiss policy. Escape stays with `CngxPopover`'s `closeOnEscape`.\n *\n * Requires `mode=\"manual\"` on the popover (the default): native light dismiss\n * would bypass `closeRequested`.\n *\n * ```html\n * <button type=\"button\" (click)=\"pop.show()\">Choose city</button>\n * <div cngxPopover #pop=\"cngxPopover\" cngxPopoverSheet #sheet=\"cngxPopoverSheet\">\n * <header cngxPopoverSheetHeader cngxSwipeDismiss=\"down\">\n * <span cngxPopoverSheetHandle></span>\n * <h2 cngxPopoverSheetTitle>City</h2>\n * <button type=\"button\" (click)=\"sheet.requestClose('close')\">Close</button>\n * </header>\n * <ul>...</ul>\n * </div>\n * ```\n *\n * @category common/popover\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-sheet.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPopover, CngxSwipeDismiss, CngxFocusTrap, createPinnedScrollLock, injectScopedLiveRegion\n * <example-url>http://localhost:4200/#/common/popover/sheet/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/popover/sheet/fullscreen-search</example-url>\n */\n@Directive({\n selector: '[cngxPopoverSheet]',\n exportAs: 'cngxPopoverSheet',\n standalone: true,\n hostDirectives: [{ directive: CngxFocusTrap, inputs: [], outputs: [] }],\n providers: [\n { provide: CNGX_POPOVER_PRESENTATION, useExisting: CngxPopoverSheet },\n { provide: CNGX_POPOVER_SHEET_HOST, useExisting: CngxPopoverSheet },\n { provide: CNGX_FOCUS_TRAP_DRIVER, useExisting: CngxPopoverSheet },\n ],\n host: {\n class: 'cngx-popover-sheet',\n '[attr.data-cngx-sheet]': 'request()',\n '[attr.data-cngx-presentation]': 'presentation()',\n '[attr.role]': 'roleAttr()',\n '[attr.aria-modal]': 'ariaModal()',\n '[attr.aria-labelledby]': 'ariaLabelledBy()',\n '[attr.tabindex]': 'tabindexAttr()',\n '(beforetoggle)': 'handleBeforeToggle($event)',\n },\n})\nexport class CngxPopoverSheet\n implements CngxPopoverPresentationSeam, CngxPopoverSheetPartsHost, CngxFocusTrapDriver\n{\n private readonly popover = injectSheetPopover();\n private readonly trap = inject(CngxFocusTrap, { self: true });\n private readonly announcer = inject(CngxLiveAnnouncer);\n private readonly doc = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private readonly win = injectWindow();\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n // Static attributes the consumer wrote are what the anchored presentation\n // keeps; the bindings below only take over while the sheet is modal.\n private readonly staticRole = this.host.getAttribute('role');\n private readonly staticLabelledBy = this.host.getAttribute('aria-labelledby');\n private readonly staticTabindex = this.host.getAttribute('tabindex');\n\n /**\n * Requested presentation. `'auto'` (default, also the bare attribute)\n * resolves through the stylesheet breakpoint.\n */\n readonly request = input<CngxPopoverPresentationRequest, CngxPopoverPresentationRequest | ''>(\n 'auto',\n { alias: 'cngxPopoverSheet', transform: (v) => (v === '' ? 'auto' : v) },\n );\n\n /**\n * What `'auto'` resolves to below the breakpoint: a content-sized `'sheet'`\n * or a `'fullscreen'` panel (for panels led by a text input).\n */\n readonly autoPresentation = input<'sheet' | 'fullscreen'>('sheet');\n\n /** Id of the element naming the dialog. Wins over a registered `CngxPopoverSheetTitle`. */\n readonly labelledBy = input<string | undefined>(undefined);\n\n /**\n * Whether the sheet returns focus on close (to `restoreTarget`, else to the\n * element focused before it opened). Turn it off when a `closing` handler\n * moves focus itself.\n */\n readonly restoreFocus = input(true);\n\n /** Element to return focus to on close. Defaults to the element focused before open. */\n readonly restoreTarget = input<HTMLElement | undefined>(undefined);\n\n /**\n * Whether a close request hides the popover. `false` only emits\n * `closeRequested`, so the consumer decides.\n */\n readonly closeOnRequest = input(true);\n\n /** A swipe, outside tap, back gesture or close control asked the sheet to close. */\n readonly closeRequested = output<CngxPopoverSheetCloseReason>();\n\n /**\n * Emits synchronously inside `hide()` while the page is already live again,\n * before the close transition. The place to move focus out of the panel.\n * Fires only for a modal close.\n */\n readonly closing = output<void>();\n\n private readonly breakpoint = inject(CNGX_POPOVER_SHEET_BREAKPOINT);\n\n /** Resolved presentation, reflected as `data-cngx-presentation`. */\n readonly presentation = computed<CngxPopoverPresentation>(() => {\n const request = this.request();\n if (request !== 'auto') {\n return request;\n }\n return this.breakpoint() === '1' ? this.autoPresentation() : 'anchored';\n });\n\n /** `true` in the sheet and fullscreen presentations. */\n readonly modal = computed(() => this.presentation() !== 'anchored');\n\n /** @internal Drives the composed `CngxFocusTrap`: Tab stays inside while modal and visible. */\n readonly focusTrapEnabled = computed(() => this.modal() && this.popover.isVisible());\n /** @internal The sheet moves focus itself, inside `show()`. */\n readonly focusTrapAutoFocus = false;\n\n /** @internal */\n readonly titleRegistry = createSlotRegistry<CngxPopoverSheetTitleHandle>();\n /** @internal */\n readonly initialFocusRegistry = createKeyedRegistry<CngxPopoverSheetFocusHandle>({\n name: 'CngxPopoverSheet',\n });\n\n protected readonly roleAttr = computed(() => (this.modal() ? 'dialog' : this.staticRole));\n protected readonly ariaModal = computed(() => (this.modal() ? 'true' : null));\n protected readonly ariaLabelledBy = computed(() =>\n this.modal()\n ? (this.labelledBy() ?? this.titleRegistry.current()?.id() ?? null)\n : this.staticLabelledBy,\n );\n // Last-resort focus target: a modal sheet with nothing tabbable inside\n // still takes focus on its host.\n protected readonly tabindexAttr = computed(() =>\n this.modal() ? (this.staticTabindex ?? '-1') : this.staticTabindex,\n );\n\n private readonly region = injectScopedLiveRegion(this.host);\n\n private engaged = false;\n private savedFocus: HTMLElement | null = null;\n private inerted: HTMLElement[] = [];\n // Own host and ancestors an earlier sheet made inert, lifted while this\n // sheet is engaged so it stays reachable.\n private lifted: HTMLElement[] = [];\n private releaseLock: (() => void) | null = null;\n private settlingFrame: number | null = null;\n private warnedTitle = false;\n private warnedMode = false;\n private closeWatcher: CloseWatcherLike | null = null;\n\n // Capture phase: the tap must be seen before anything under it reacts.\n // The page siblings are inert, so a tap outside the panel lands on a\n // non-inert ancestor; the popover ::backdrop does not catch taps on iOS\n // or Android.\n private readonly outsidePointerDown = (event: PointerEvent): void => {\n this.disarmClickSwallow();\n if (engagedSheets.at(-1) !== this) {\n return;\n }\n const target = event.target;\n if (target instanceof Node && this.host.contains(target)) {\n return;\n }\n this.armClickSwallow();\n this.requestClose('backdrop');\n };\n\n // Closing on pointerdown releases inert before the gesture's click lands,\n // so that click would hit the page element under the tap. Swallow the\n // one click that belongs to this gesture; the next pointerdown or a short\n // timeout disarms it, so a later tap is never eaten.\n private clickSwallowTimer: ReturnType<typeof setTimeout> | null = null;\n\n // Chromium also turns an unhandled Escape keydown into a CloseWatcher close\n // request. Escape belongs to CngxPopover (gated by closeOnEscape, topmost\n // popover only), so a watcher close that comes from the same keypress is\n // not a back gesture. The flag lives for the keydown task only.\n private escapeKeyTimer: ReturnType<typeof setTimeout> | null = null;\n private readonly escapeKeydown = (event: KeyboardEvent): void => {\n if (event.key !== 'Escape') {\n return;\n }\n if (this.escapeKeyTimer !== null) {\n clearTimeout(this.escapeKeyTimer);\n }\n this.escapeKeyTimer = setTimeout(() => {\n this.escapeKeyTimer = null;\n });\n };\n private readonly swallowClick = (event: MouseEvent): void => {\n event.preventDefault();\n event.stopPropagation();\n this.disarmClickSwallow();\n };\n\n constructor() {\n // A breakpoint crossing or request flip while open. Open and close\n // themselves run through onShown() / onHide(), which engage first, so\n // this effect only sees edges nobody handled yet.\n const active = createTransitionTracker(() => this.modal() && this.popover.isVisible());\n effect(() => {\n const now = active.current();\n const previous = active.previous();\n untracked(() => {\n if (now && !previous && !this.engaged) {\n this.engage(!this.host.contains(this.doc.activeElement));\n }\n if (!now && previous && this.engaged) {\n const opener = this.savedFocus;\n this.release();\n if (this.popover.isVisible()) {\n this.rehomeFocusAfterFlip(opener);\n }\n }\n });\n });\n\n // Destroyed while open: the host leaves the DOM, so focus would drop to\n // body. Restore it like a close, without emitting from a dying directive.\n inject(DestroyRef).onDestroy(() => {\n this.disengage(false);\n this.release();\n this.disarmClickSwallow();\n });\n }\n\n /** @internal Seam call from `CngxPopover.show()`, after `showPopover()`. */\n onShown(): void {\n if (!this.modal()) {\n return;\n }\n this.engage(true);\n }\n\n /** @internal Seam call from `CngxPopover.hide()`, before the close transition. */\n onHide(): void {\n this.disengage(true);\n }\n\n /**\n * Ask the sheet to close. Emits `closeRequested` once per open (no-op\n * unless the popover is opening or open) and hides when `closeOnRequest`\n * is on.\n */\n requestClose(reason: CngxPopoverSheetCloseReason): void {\n const state = this.popover.state();\n if (state !== 'open' && state !== 'opening') {\n return;\n }\n this.closeRequested.emit(reason);\n if (this.closeOnRequest()) {\n this.popover.hide();\n }\n }\n\n /**\n * Speak `message` from the live region inside the panel. Use it for\n * every announcement while the sheet is modal: VoiceOver drops body-level\n * regions under `aria-modal`.\n */\n announce(message: string, politeness: AriaLivePoliteness = 'polite'): void {\n this.region.announce(message, politeness);\n }\n\n /**\n * Move focus to the first enabled `CngxPopoverSheetInitialFocus` in\n * document order, else the first tabbable element, else the host. Runs on\n * every modal open.\n */\n focusInitial(): void {\n const target = this.initialFocusTarget();\n if (target) {\n target.focus();\n return;\n }\n if (!this.trap.focusFirstNow()) {\n this.host.focus();\n }\n }\n\n private initialFocusTarget(): HTMLElement | null {\n let first: HTMLElement | null = null;\n for (const handle of this.initialFocusRegistry.values()) {\n const enabled = handle.enabled?.() ?? true;\n const precedes =\n first === null ||\n (first.compareDocumentPosition(handle.element) & first.DOCUMENT_POSITION_PRECEDING) !== 0;\n if (enabled && precedes) {\n first = handle.element;\n }\n }\n return first;\n }\n\n protected handleBeforeToggle(event: ToggleEvent): void {\n // Native close paths (light dismiss, a direct hidePopover()) skip hide()\n // but owe the same page release and focus return.\n if (event.newState === 'closed') {\n this.disengage(true);\n }\n }\n\n // Close order: page live again, pending messages handed over, consumers\n // told, focus back on the opener, lock released. Idempotent through\n // `engaged`.\n private disengage(emitClosing: boolean): void {\n if (!this.engaged) {\n return;\n }\n this.restoreInert();\n this.handOffPendingAnnouncements();\n if (emitClosing) {\n this.closing.emit();\n }\n // On body counts as lost: CngxPopover's own teardown blurs the panel\n // before this one runs when both are destroyed together.\n const active = this.doc.activeElement;\n const focusLost = !active || active === this.doc.body || this.host.contains(active);\n if (this.restoreFocus() && focusLost) {\n this.focusFirstTaker([this.restoreTarget(), this.savedFocus, this.focusableAnchor()]);\n }\n this.release();\n }\n\n // Open order: focus, then inert, then lock. Focus first so the move\n // happens while the trigger is still focusable and inside the opening\n // gesture; inert after so the page never holds focus under inert.\n private engage(moveFocus: boolean): void {\n if (this.engaged) {\n return;\n }\n this.engaged = true;\n engagedSheets.push(this);\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n this.warnOnMisconfiguration();\n }\n this.savedFocus = this.openerToRestore();\n this.region.ensure();\n this.liftOwnInert();\n if (moveFocus) {\n this.focusInitial();\n }\n this.applyInert();\n this.releaseLock = createPinnedScrollLock(this.doc.documentElement);\n this.startSettling();\n this.doc.addEventListener('pointerdown', this.outsidePointerDown, true);\n this.doc.addEventListener('keydown', this.escapeKeydown, true);\n this.armCloseWatcher();\n }\n\n // A flip back to anchored while open strips the modal focus targets (the\n // listbox loses its tabindex), so focus would drop to body. Independent of\n // `restoreFocus`, which governs a close, not a flip.\n private rehomeFocusAfterFlip(opener: HTMLElement | null): void {\n afterNextRender(\n () => {\n const active = this.doc.activeElement;\n const lost = !active || active === this.doc.body || this.host.contains(active);\n if (lost) {\n this.focusFirstTaker([this.focusableAnchor(), opener]);\n }\n },\n { injector: this.injector },\n );\n }\n\n // A target can refuse focus: the opener of a sheet chain sits inside the\n // sheet the exclusive eviction just hid. Take the first one that holds it.\n private focusFirstTaker(candidates: readonly (HTMLElement | null | undefined)[]): void {\n for (const target of candidates) {\n if (!target?.isConnected) {\n continue;\n }\n target.focus();\n if (this.doc.activeElement === target) {\n return;\n }\n }\n }\n\n private focusableAnchor(): HTMLElement | null {\n const anchor = this.popover.anchorElement();\n return anchor && anchor.tabIndex >= 0 ? anchor : null;\n }\n\n // iOS Safari does not focus a button on tap (with or without VoiceOver),\n // so the pre-open snapshot is often body. Fall back to the popover's\n // anchor when it can take focus, so the close lands back on the opener.\n private openerToRestore(): HTMLElement | null {\n const origin = this.popover.focusOrigin();\n if (origin && origin !== this.doc.body) {\n return origin;\n }\n return this.focusableAnchor();\n }\n\n // Idempotent: hide(), the native toggle, a flip back to anchored and\n // destroy can all reach it.\n private release(): void {\n this.doc.removeEventListener('pointerdown', this.outsidePointerDown, true);\n this.doc.removeEventListener('keydown', this.escapeKeydown, true);\n if (this.escapeKeyTimer !== null) {\n clearTimeout(this.escapeKeyTimer);\n this.escapeKeyTimer = null;\n }\n this.disarmCloseWatcher();\n this.restoreInert();\n this.releaseLock?.();\n this.releaseLock = null;\n this.stopSettling();\n this.engaged = false;\n this.savedFocus = null;\n const index = engagedSheets.indexOf(this);\n if (index !== -1) {\n engagedSheets.splice(index, 1);\n }\n }\n\n // Created inside the opening call, so a tap-opened sheet creates it under\n // the tap's user activation (Chrome groups watchers created without one).\n // Without CloseWatcher (iOS Safari) the back gesture leaves the page.\n private armCloseWatcher(): void {\n const Watcher = (this.win as { CloseWatcher?: CloseWatcherCtor } | null)?.CloseWatcher;\n if (typeof Watcher !== 'function') {\n return;\n }\n const watcher = new Watcher();\n watcher.onclose = () => {\n if (this.closeWatcher === watcher) {\n this.closeWatcher = null;\n }\n if (this.escapeKeyTimer !== null) {\n if (this.engaged) {\n this.armCloseWatcher();\n }\n return;\n }\n this.requestClose('back');\n // A blocked request leaves the sheet open; the spent watcher would let\n // the next back gesture navigate away.\n if (this.engaged && this.closeWatcher === null) {\n this.armCloseWatcher();\n }\n };\n this.closeWatcher = watcher;\n }\n\n private armClickSwallow(): void {\n this.doc.addEventListener('click', this.swallowClick, true);\n this.clickSwallowTimer = setTimeout(() => this.disarmClickSwallow(), CLICK_SWALLOW_MS);\n }\n\n private disarmClickSwallow(): void {\n this.doc.removeEventListener('click', this.swallowClick, true);\n if (this.clickSwallowTimer !== null) {\n clearTimeout(this.clickSwallowTimer);\n this.clickSwallowTimer = null;\n }\n }\n\n private disarmCloseWatcher(): void {\n const watcher = this.closeWatcher;\n this.closeWatcher = null;\n watcher?.destroy();\n }\n\n private liftOwnInert(): void {\n let node: HTMLElement | null = this.host;\n while (node && node !== this.doc.body) {\n if ((inertClaims.get(node) ?? 0) > 0 && node.hasAttribute('inert')) {\n node.removeAttribute('inert');\n this.lifted.push(node);\n }\n node = node.parentElement;\n }\n }\n\n private applyInert(): void {\n const body = this.doc.body;\n let node: HTMLElement = this.host;\n while (node !== body && node.parentElement) {\n const parent: HTMLElement = node.parentElement;\n for (const sibling of Array.from(parent.children)) {\n if (sibling === node || !(sibling instanceof HTMLElement) || this.skipsInert(sibling)) {\n continue;\n }\n inertClaims.set(sibling, (inertClaims.get(sibling) ?? 0) + 1);\n sibling.setAttribute('inert', '');\n this.inerted.push(sibling);\n }\n node = parent;\n }\n }\n\n private skipsInert(el: HTMLElement): boolean {\n const preExisting = el.hasAttribute('inert') && !inertClaims.get(el);\n return (\n preExisting ||\n el.classList.contains(FOCUS_TRAP_ANCHOR_CLASS) ||\n el.matches(LIVE_REGION_SELECTOR)\n );\n }\n\n private restoreInert(): void {\n for (const el of this.inerted) {\n const claims = (inertClaims.get(el) ?? 1) - 1;\n if (claims > 0) {\n inertClaims.set(el, claims);\n continue;\n }\n inertClaims.delete(el);\n el.removeAttribute('inert');\n }\n this.inerted = [];\n for (const el of this.lifted) {\n if ((inertClaims.get(el) ?? 0) > 0) {\n el.setAttribute('inert', '');\n }\n }\n this.lifted = [];\n }\n\n // A message announced right before close would land in a region that is\n // about to hide; the root announcer speaks it after the close instead.\n private handOffPendingAnnouncements(): void {\n for (const pending of this.region.takePending()) {\n this.announcer.announce(pending.message, pending.politeness);\n }\n }\n\n // The pinned lock shifts the page for one frame on iOS. Keep the panel\n // invisible until two consecutive frames report the same rect.\n private startSettling(): void {\n const raf = this.win?.requestAnimationFrame?.bind(this.win);\n if (!raf) {\n return;\n }\n this.host.setAttribute(SETTLING_ATTRIBUTE, '');\n let previous: DOMRect | null = null;\n let frames = 0;\n const check = () => {\n frames += 1;\n const rect = this.host.getBoundingClientRect();\n const stable =\n previous !== null &&\n previous.top === rect.top &&\n previous.left === rect.left &&\n previous.width === rect.width &&\n previous.height === rect.height;\n if (stable || frames >= SETTLING_FRAME_CAP) {\n this.stopSettling();\n return;\n }\n previous = rect;\n this.settlingFrame = raf(check);\n };\n this.settlingFrame = raf(check);\n }\n\n private stopSettling(): void {\n if (this.settlingFrame !== null) {\n this.win?.cancelAnimationFrame?.(this.settlingFrame);\n this.settlingFrame = null;\n }\n this.host.removeAttribute(SETTLING_ATTRIBUTE);\n }\n\n private warnOnMisconfiguration(): void {\n const unnamed = !this.labelledBy() && !this.titleRegistry.current();\n if (typeof ngDevMode !== 'undefined' && ngDevMode && !this.warnedTitle && unnamed) {\n this.warnedTitle = true;\n cngxDevWarn(\n 'CNGX1064',\n '[cngxPopoverSheet] opened as a modal sheet without a name. Add a ' +\n 'cngxPopoverSheetTitle inside the panel or bind [labelledBy].',\n this.host,\n );\n }\n const mode = this.popover.mode();\n if (typeof ngDevMode !== 'undefined' && ngDevMode && !this.warnedMode && mode !== 'manual') {\n this.warnedMode = true;\n cngxDevWarn(\n 'CNGX1065',\n `[cngxPopoverSheet] needs mode=\"manual\" on the popover, got \"${mode}\". ` +\n 'Native light dismiss and Escape bypass closeRequested in that mode.',\n this.host,\n );\n }\n }\n}\n","import { computed, DestroyRef, Directive, ElementRef, inject, input, signal } from '@angular/core';\nimport { CngxSwipeDismiss } from '@cngx/common/interactive';\nimport { nextUid } from '@cngx/core/utils';\n\nimport {\n type CngxPopoverSheetFocusHandle,\n type CngxPopoverSheetTitleHandle,\n injectPopoverSheetHost,\n} from './popover-sheet-host';\n\n// Header and handle share the swipe wiring: a CngxSwipeDismiss on the same\n// element closes the sheet through closeRequested (CngxBottomSheet precedent).\nfunction routeSwipeToSheet(part: string): void {\n const sheet = injectPopoverSheetHost(part);\n const swipe = inject(CngxSwipeDismiss, { self: true, optional: true });\n if (!swipe) {\n return;\n }\n const sub = swipe.swiped.subscribe(() => sheet.requestClose('swipe'));\n inject(DestroyRef).onDestroy(() => sub.unsubscribe());\n}\n\n/**\n * Header row of a `CngxPopoverSheet`. Stays put while the content below it\n * scrolls; add `cngxSwipeDismiss=\"down\"` to close the sheet by swiping it.\n *\n * @category common/popover\n * @since 0.1.0\n * @relatedTo CngxPopoverSheet, CngxSwipeDismiss\n */\n@Directive({\n selector: '[cngxPopoverSheetHeader]',\n standalone: true,\n host: { class: 'cngx-popover-sheet-header' },\n})\nexport class CngxPopoverSheetHeader {\n constructor() {\n routeSwipeToSheet('cngxPopoverSheetHeader');\n }\n}\n\n/**\n * The element that names a modal `CngxPopoverSheet`. The sheet points its\n * `aria-labelledby` here, never at the header that also holds buttons.\n *\n * @category common/popover\n * @since 0.1.0\n * @relatedTo CngxPopoverSheet\n */\n@Directive({\n selector: '[cngxPopoverSheetTitle]',\n standalone: true,\n host: { '[id]': 'id()' },\n})\nexport class CngxPopoverSheetTitle implements CngxPopoverSheetTitleHandle {\n /** Generated id the sheet references. */\n readonly id = signal(nextUid('cngx-popover-sheet-title')).asReadonly();\n\n constructor() {\n const sheet = injectPopoverSheetHost('cngxPopoverSheetTitle');\n sheet.titleRegistry.register(this);\n inject(DestroyRef).onDestroy(() => sheet.titleRegistry.unregister(this));\n }\n}\n\n/**\n * Decorative drag handle. Always `aria-hidden`: screen-reader users close\n * the sheet through its close control, since their swipe is consumed by\n * navigation.\n *\n * @category common/popover\n * @since 0.1.0\n * @relatedTo CngxPopoverSheet\n */\n@Directive({\n selector: '[cngxPopoverSheetHandle]',\n standalone: true,\n host: { class: 'cngx-popover-sheet-handle', 'aria-hidden': 'true' },\n})\nexport class CngxPopoverSheetHandle {\n constructor() {\n routeSwipeToSheet('cngxPopoverSheetHandle');\n }\n}\n\n/**\n * Marks the element that receives focus when a modal `CngxPopoverSheet`\n * opens, e.g. the search input of a fullscreen panel. Without one the first\n * tabbable element is focused.\n *\n * A panel can mark several elements. The first enabled one in document order\n * takes focus, so a search field that should lead only some opens binds\n * `[cngxPopoverSheetInitialFocus]=\"condition\"` and the list below it carries\n * the bare attribute as the default target. The condition is read when the\n * sheet opens.\n *\n * @category common/popover\n * @since 0.1.0\n * @relatedTo CngxPopoverSheet\n */\n@Directive({\n selector: '[cngxPopoverSheetInitialFocus]',\n standalone: true,\n})\nexport class CngxPopoverSheetInitialFocus implements CngxPopoverSheetFocusHandle {\n /** The element focused on open. */\n readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /**\n * `false` keeps this element out of the next open's focus choice. The bare\n * attribute, or no binding, leaves it enabled.\n */\n readonly enabledInput = input<boolean | undefined, boolean | '' | undefined>(undefined, {\n alias: 'cngxPopoverSheetInitialFocus',\n transform: (v) => (typeof v === 'string' ? undefined : v),\n });\n\n /** @internal Read by the sheet on open. */\n readonly enabled = computed(() => this.enabledInput() !== false);\n\n private readonly key = nextUid('cngx-popover-sheet-initial-focus');\n\n constructor() {\n const sheet = injectPopoverSheetHost('cngxPopoverSheetInitialFocus');\n sheet.initialFocusRegistry.register(this.key, this);\n inject(DestroyRef).onDestroy(() => sheet.initialFocusRegistry.unregister(this.key, this));\n }\n}\n","import { InjectionToken, type Provider, type Signal, type TemplateRef } from '@angular/core';\n\nimport type { CngxPopoverArrowContext } from './popover-panel-slots';\nimport type {\n CngxPopoverPanelConfig,\n CngxPopoverPanelLabels,\n PopoverPanelFeature,\n} from './popover-panel.types';\n\n/** @internal Default configuration - no auto-dismiss, no close-on-success, variant='default'. */\nconst DEFAULT_CONFIG: CngxPopoverPanelConfig = {\n defaultVariant: 'default',\n};\n\n/**\n * Injection token for popover panel configuration.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel.config.ts\n * @since 0.1.0\n */\nexport const CNGX_POPOVER_PANEL_CONFIG = new InjectionToken<CngxPopoverPanelConfig>(\n 'CngxPopoverPanelConfig',\n { factory: () => DEFAULT_CONFIG },\n);\n\n/**\n * Provides configuration for `CngxPopoverPanel` instances.\n *\n * ```typescript\n * providers: [\n * providePopoverPanel(\n * withAutoDismiss({ info: 5000, success: 3000 }),\n * withCloseOnSuccess(300),\n * ),\n * ]\n * ```\n *\n * @category common/popover\n */\nexport function providePopoverPanel(...features: PopoverPanelFeature[]): Provider {\n const config = features.reduce((acc, f) => f(acc), { ...DEFAULT_CONFIG });\n return { provide: CNGX_POPOVER_PANEL_CONFIG, useValue: config };\n}\n\n/**\n * Auto-dismiss the panel after a timeout, per variant.\n *\n * @param timing - Map of variant name to dismiss duration in ms.\n * ```typescript\n * withAutoDismiss({ info: 5000, success: 3000 })\n * ```\n *\n * @category common/popover\n */\nexport function withAutoDismiss(timing: Record<string, number>): PopoverPanelFeature {\n return (config) => ({ ...config, autoDismiss: { ...config.autoDismiss, ...timing } });\n}\n\n/**\n * Auto-close the panel after an async action in the footer succeeds.\n *\n * @param delay - Delay in ms before closing. Defaults to `300`.\n *\n * @category common/popover\n */\nexport function withCloseOnSuccess(delay = 300): PopoverPanelFeature {\n return (config) => ({ ...config, closeOnSuccessDelay: delay });\n}\n\n/**\n * Set the default variant applied when no `variant` input is set.\n *\n * @category common/popover\n */\nexport function withDefaultVariant(variant: string): PopoverPanelFeature {\n return (config) => ({ ...config, defaultVariant: variant });\n}\n\n/**\n * Show the close button on all panels by default.\n *\n * @category common/popover\n */\nexport function withCloseButton(show = true): PopoverPanelFeature {\n return (config) => ({ ...config, showClose: show });\n}\n\n/**\n * Show the arrow on all panels by default.\n *\n * @category common/popover\n */\nexport function withArrow(show = true): PopoverPanelFeature {\n return (config) => ({ ...config, showArrow: show });\n}\n\n/**\n * Register an app-wide default template for the panel's arrow ornament.\n * The template receives a `CngxPopoverArrowContext` with `edge` and\n * `offsetPx` so the consumer's glyph can match the resolved placement.\n *\n * Per-instance `*cngxPopoverArrow` still wins over this default; the\n * library's rotated-diamond fallback only renders when neither tier is\n * set.\n *\n * ```typescript\n * providers: [\n * providePopoverPanel(withArrowTemplate(brandArrowTpl)),\n * ]\n * ```\n *\n * @category common/popover\n */\nexport function withArrowTemplate(tpl: TemplateRef<CngxPopoverArrowContext>): PopoverPanelFeature {\n return (config) => ({ ...config, templates: { ...config.templates, arrow: tpl } });\n}\n\n/**\n * Set the app-wide panel copy. Unset keys keep the language pack's copy, or\n * the English default; pass a\n * `Signal` of a partial bundle to switch languages at runtime. A later call\n * replaces the whole bundle. Mirrors `withDialogLabels`.\n *\n * ```typescript\n * providers: [\n * providePopoverPanel(withPopoverPanelLabels({ close: 'Schliessen' })),\n * ]\n * ```\n *\n * @category common/popover\n * @since 0.1.0\n */\nexport function withPopoverPanelLabels(\n labels: Partial<CngxPopoverPanelLabels> | Signal<Partial<CngxPopoverPanelLabels>>,\n): PopoverPanelFeature {\n return (config) => ({ ...config, labels });\n}\n","// Pulls the augmented module into the program; ng-packagr rejects `declare module` (TS2664) otherwise.\nimport type {} from '@cngx/core/i18n';\n\n/**\n * The popover section of a {@link CngxLanguagePack}: the copy of\n * `CngxPopoverPanel`. `providePopoverPanel(withPopoverPanelLabels(...))`\n * overrides single keys on top of it.\n *\n * @category common/popover\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, withPopoverPanelLabels\n */\nexport interface CngxPopoverLanguageSection {\n /** Accessible name of the built-in close button. */\n readonly close: string;\n}\n\n/**\n * The English popover section: the single source of the popover panel's\n * English copy.\n *\n * @category common/popover\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel\n */\nexport const CNGX_POPOVER_LANGUAGE_EN: CngxPopoverLanguageSection = {\n close: 'Close',\n};\n\ndeclare module '@cngx/core/i18n' {\n interface CngxLanguagePack {\n readonly popover: CngxPopoverLanguageSection;\n }\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { ArrowEdge } from './popover.types';\n\n/**\n * Context object passed to a `*cngxPopoverArrow` template.\n *\n * The consumer's glyph receives the resolved panel edge (`top` / `bottom` /\n * `left` / `right`) and the inline-axis offset in CSS pixels that the\n * library would have placed the default diamond at. Either can be used to\n * rotate, translate, or theme the custom glyph so it tracks the trigger.\n *\n * @category common/popover\n */\nexport interface CngxPopoverArrowContext {\n /** Primary edge of the panel facing the trigger. */\n readonly edge: ArrowEdge;\n /**\n * Inline-axis offset from the panel edge to the trigger's centre, in\n * CSS pixels. `null` before the first geometry read (the consumer\n * should treat `null` as \"centre the glyph\" - the default diamond\n * falls back to `50%` in the same case).\n */\n readonly offsetPx: number | null;\n}\n\n/**\n * Marks the header content inside `cngx-popover-panel`.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverBody, CngxPopoverFooter\n */\n@Directive({ selector: '[cngxPopoverHeader]', standalone: true })\nexport class CngxPopoverHeader {}\n\n/**\n * Marks the body content inside `cngx-popover-panel`.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverHeader, CngxPopoverFooter\n */\n@Directive({ selector: '[cngxPopoverBody]', standalone: true })\nexport class CngxPopoverBody {}\n\n/**\n * Marks the footer content inside `cngx-popover-panel`.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverHeader, CngxPopoverBody, CngxPopoverAction\n */\n@Directive({ selector: '[cngxPopoverFooter]', standalone: true })\nexport class CngxPopoverFooter {}\n\n/**\n * Custom close button template. Overrides the default close button.\n *\n * ```html\n * <ng-template cngxPopoverClose>\n * <button mat-icon-button (click)=\"panel.popover.hide()\">\n * <mat-icon>close</mat-icon>\n * </button>\n * </ng-template>\n * ```\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel\n */\n@Directive({ selector: 'ng-template[cngxPopoverClose]', standalone: true })\nexport class CngxPopoverClose {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Template shown while panel content is loading.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverEmpty, CngxPopoverError\n */\n@Directive({ selector: 'ng-template[cngxPopoverLoading]', standalone: true })\nexport class CngxPopoverLoading {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Template shown when panel content is empty.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverLoading, CngxPopoverError\n */\n@Directive({ selector: 'ng-template[cngxPopoverEmpty]', standalone: true })\nexport class CngxPopoverEmpty {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Template shown when panel content failed to load. Context: `$implicit` = error.\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverLoading, CngxPopoverEmpty\n */\n@Directive({ selector: 'ng-template[cngxPopoverError]', standalone: true })\nexport class CngxPopoverError {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Custom arrow ornament template. Overrides the default rotated-diamond\n * arrow when projected as a child of `<cngx-popover-panel>`. The library\n * routes the resolved panel edge and the live inline-axis offset to the\n * template via `CngxPopoverArrowContext`.\n *\n * ```html\n * <cngx-popover-panel #pop [showArrow]=\"true\">\n * <ng-template cngxPopoverArrow let-edge=\"edge\" let-offsetPx=\"offsetPx\">\n * <svg class=\"brand-arrow\" [attr.data-edge]=\"edge\"\n * [style.--offset]=\"offsetPx ? offsetPx + 'px' : '50%'\">\n * <use href=\"#arrow-glyph\" />\n * </svg>\n * </ng-template>\n * </cngx-popover-panel>\n * ```\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopover\n */\n@Directive({ selector: 'ng-template[cngxPopoverArrow]', standalone: true })\nexport class CngxPopoverArrow {\n readonly templateRef = inject<TemplateRef<CngxPopoverArrowContext>>(TemplateRef);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { CngxCloseButton } from '@cngx/common/interactive';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n DestroyRef,\n ElementRef,\n effect,\n inject,\n input,\n untracked,\n ViewEncapsulation,\n} from '@angular/core';\nimport { createLanguageSection } from '@cngx/core/i18n';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { createOverrideMerge, nextUid } from '@cngx/core/utils';\n\nimport { CNGX_POPOVER_ARROW_BOUNDS, type CngxPopoverArrowBounds } from './popover-arrow-bounds';\nimport { CNGX_POPOVER_LANGUAGE_EN } from './i18n/popover-language-section';\nimport { CNGX_POPOVER_PANEL_CONFIG } from './popover-panel.config';\nimport {\n CngxPopoverArrow,\n type CngxPopoverArrowContext,\n CngxPopoverClose,\n CngxPopoverEmpty,\n CngxPopoverError,\n CngxPopoverFooter,\n CngxPopoverHeader,\n CngxPopoverLoading,\n} from './popover-panel-slots';\nimport { CngxPopover } from './popover.directive';\nimport type { PopoverPanelRole } from './popover.types';\n\n/**\n * @internal The popover section of the active language pack over the English\n * copy, shared app-wide so every panel merges `config.labels` over the same\n * signal - and `createOverrideMerge` then shares one merge per config object.\n */\nconst injectPopoverPanelLanguage = createLanguageSection('popover', CNGX_POPOVER_LANGUAGE_EN);\n\n/**\n * Rich popover panel molecule with header/body/footer slots, variant\n * styling, arrow, close button, and content state templates.\n *\n * Composes `CngxPopover` via `hostDirectives` - all popover inputs\n * (`placement`, `positionTryFallbacks`, `offset`, `closeOnEscape`,\n * `closeOnOutsideClick`, `mode`, `exclusive`, `cngxPopoverOpen`) are\n * forwarded.\n *\n * The `variant` input is a free-form string mapped to a CSS class\n * (`cngx-popover-panel--{variant}`). Five variants are pre-themed\n * in `popover-panel-theme.scss`: `default`, `info`, `warning`,\n * `danger`, `success`. Add custom variants via CSS.\n *\n * ### Basic with header/body/footer\n * ```html\n * <button [cngxPopoverTrigger]=\"panel\" (click)=\"panel.popover.toggle()\">Menu</button>\n * <cngx-popover-panel #panel variant=\"danger\" [showClose]=\"true\" [showArrow]=\"true\">\n * <span cngxPopoverHeader>Delete Item?</span>\n * <p cngxPopoverBody>This action cannot be undone.</p>\n * <div cngxPopoverFooter>\n * <cngx-popover-action role=\"dismiss\">Cancel</cngx-popover-action>\n * <cngx-popover-action role=\"confirm\" [action]=\"delete\" variant=\"danger\">\n * Delete\n * </cngx-popover-action>\n * </div>\n * </cngx-popover-panel>\n * ```\n *\n * ### With loading state\n * ```html\n * <cngx-popover-panel [loading]=\"isLoading()\" [error]=\"loadError()\">\n * <p cngxPopoverBody>Loaded content here</p>\n * <ng-template cngxPopoverLoading>Loading...</ng-template>\n * <ng-template cngxPopoverError let-err>Failed: {{ err }}</ng-template>\n * </cngx-popover-panel>\n * ```\n *\n * @category common/popover\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel.component.ts\n * @since 0.1.0\n * @relatedTo CngxPopover, CngxPopoverAction, CngxPopoverHeader, CngxPopoverBody, CngxPopoverFooter\n * @slot cngxPopoverArrow Replaces the pointer that ties the panel to its trigger.\n * @slot cngxPopoverClose Replaces the dismiss control.\n * @slot cngxPopoverLoading Rendered while the panel's content is loading.\n * @slot cngxPopoverEmpty Rendered when the panel has nothing to show.\n * @slot cngxPopoverError Rendered when the panel's content failed to load.\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/content-states</example-url>\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/variants</example-url>\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/with-footer-actions</example-url>\n */\n@Component({\n selector: 'cngx-popover-panel',\n standalone: true,\n imports: [NgTemplateOutlet, CngxCloseButton],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'cngxPopoverPanel',\n providers: [{ provide: CNGX_POPOVER_ARROW_BOUNDS, useExisting: CngxPopoverPanel }],\n hostDirectives: [\n {\n directive: CngxPopover,\n inputs: [\n 'placement',\n 'positionTryFallbacks',\n 'offset',\n 'closeOnEscape',\n 'closeOnOutsideClick',\n 'mode',\n 'exclusive',\n 'cngxPopoverOpen',\n ],\n },\n ],\n host: {\n '[class]': 'hostClass()',\n '[attr.role]': 'role()',\n '[attr.aria-labelledby]': 'ariaLabelledBy()',\n '[attr.aria-describedby]': 'ariaDescribedBy()',\n '[attr.aria-busy]': 'effectiveLoading() || null',\n },\n template: `\n @if (showArrow()) {\n @if (arrowTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: arrowContext()\" />\n } @else {\n <div class=\"cngx-popover-panel__arrow\"></div>\n }\n }\n\n @if (effectiveLoading()) {\n @if (loadingTpl(); as tpl) {\n <div class=\"cngx-popover-panel__loading\">\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n </div>\n }\n } @else if (effectiveError(); as err) {\n @if (errorTpl(); as tpl) {\n <div class=\"cngx-popover-panel__error\">\n <ng-container *ngTemplateOutlet=\"tpl.templateRef; context: { $implicit: err }\" />\n </div>\n }\n } @else if (effectiveEmpty()) {\n @if (emptyTpl(); as tpl) {\n <div class=\"cngx-popover-panel__empty\">\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n </div>\n }\n } @else {\n @if (hasHeader() || showClose()) {\n <div class=\"cngx-popover-panel__header-row\">\n <div class=\"cngx-popover-panel__header\" [id]=\"headerId\">\n <ng-content select=\"[cngxPopoverHeader]\" />\n </div>\n @if (showClose()) {\n @if (closeTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else {\n <cngx-close-button\n [label]=\"closeLabel()\"\n class=\"cngx-popover-panel__close\"\n (click)=\"popover.hide()\"\n />\n }\n }\n </div>\n }\n <div class=\"cngx-popover-panel__body\" [id]=\"bodyId\">\n <ng-content select=\"[cngxPopoverBody]\" />\n <ng-content />\n </div>\n @if (hasFooter()) {\n <div class=\"cngx-popover-panel__footer\">\n <ng-content select=\"[cngxPopoverFooter]\" />\n </div>\n }\n }\n `,\n styleUrls: ['./popover-panel.component.css'],\n})\nexport class CngxPopoverPanel implements CngxPopoverArrowBounds {\n /** The underlying popover state machine. */\n readonly popover = inject(CngxPopover, { self: true });\n private readonly config = inject(CNGX_POPOVER_PANEL_CONFIG);\n private readonly destroyRef = inject(DestroyRef);\n private readonly hostRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Cached panel border-radius. Read lazily from the host's computed\n * style on first access so `CngxPopover` can consume it via\n * `CNGX_POPOVER_ARROW_BOUNDS` without forcing a layout flush per\n * resize tick. The custom property is declared on `:scope` so the\n * value is valid from instantiation onward.\n */\n private _cachedBorderRadius: number | null = null;\n\n /** @internal - implements `CngxPopoverArrowBounds`. */\n get borderRadius(): number {\n if (this._cachedBorderRadius === null) {\n const raw = getComputedStyle(this.hostRef.nativeElement).getPropertyValue(\n '--cngx-popover-panel-border-radius',\n );\n this._cachedBorderRadius = Number.parseFloat(raw) || 12;\n }\n return this._cachedBorderRadius;\n }\n\n /**\n * Variant string - mapped to CSS class `cngx-popover-panel--{variant}`.\n * Pre-themed: `default`, `info`, `warning`, `danger`, `success`.\n * Add custom variants via CSS.\n */\n readonly variant = input<string | undefined>(undefined);\n\n /**\n * ARIA role applied to the panel host. Defaults to `'dialog'` because\n * the panel pairs `aria-labelledby` (header) with `aria-describedby`\n * (body) - the standard dialog pattern. Override with `'alertdialog'`\n * for irrecoverable confirmations, `'tooltip'` for passive callouts,\n * or `'menu'` when the panel hosts a menu.\n *\n * The trigger's `aria-haspopup` is hinted to `'dialog'` in tandem via\n * the popover's `haspopup` signal; consumers overriding `role` here\n * should also override `haspopup` on the trigger to match.\n */\n readonly role = input<PopoverPanelRole>('dialog');\n\n /** Show a close button. Falls back to global config from `providePopoverPanel(withCloseButton())`. */\n readonly showCloseInput = input<boolean | undefined>(undefined, { alias: 'showClose' });\n\n /** Show an arrow. Falls back to global config from `providePopoverPanel(withArrow())`. */\n readonly showArrowInput = input<boolean | undefined>(undefined, { alias: 'showArrow' });\n\n /**\n * Panel copy: `config.labels` over the popover section of the active\n * language pack, one shared merge per config object.\n */\n private readonly labels = createOverrideMerge(injectPopoverPanelLanguage(), this.config.labels);\n\n /** Accessible name of the built-in close button. */\n protected readonly closeLabel = computed(() => this.labels().close);\n\n /** Resolved showClose - input takes precedence over config. */\n readonly showClose = computed(() => this.showCloseInput() ?? this.config.showClose ?? false);\n\n /** Resolved showArrow - input takes precedence over config. */\n readonly showArrow = computed(() => this.showArrowInput() ?? this.config.showArrow ?? false);\n\n /**\n * Bind an async state - drives loading, error, and empty slots from a single source.\n * When set, takes precedence over individual `[loading]`, `[error]`, `[empty]` inputs.\n */\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /** Whether the panel content is in a loading state. Fallback when `[state]` is not set. */\n readonly loading = input(false);\n\n /** Error value when content loading failed. Fallback when `[state]` is not set. */\n readonly error = input<unknown>(undefined);\n\n /** Whether the panel content is empty. Fallback when `[state]` is not set. */\n readonly empty = input(false);\n\n /** @internal Resolved loading - state takes precedence over boolean input. */\n protected readonly effectiveLoading = computed(\n () => this.state()?.isFirstLoad() ?? this.loading(),\n );\n\n /** @internal Resolved error - state takes precedence over direct input. */\n protected readonly effectiveError = computed(() => this.state()?.error() ?? this.error());\n\n /** @internal Resolved empty - state takes precedence over boolean input. */\n protected readonly effectiveEmpty = computed(() => this.state()?.isEmpty() ?? this.empty());\n\n protected readonly headerSlot = contentChild(CngxPopoverHeader);\n protected readonly footerSlot = contentChild(CngxPopoverFooter);\n protected readonly closeTpl = contentChild(CngxPopoverClose);\n protected readonly loadingTpl = contentChild(CngxPopoverLoading);\n protected readonly emptyTpl = contentChild(CngxPopoverEmpty);\n protected readonly errorTpl = contentChild(CngxPopoverError);\n protected readonly arrowTplDirective = contentChild(CngxPopoverArrow);\n\n /**\n * Three-stage cascade for the arrow ornament:\n * 1. Per-instance `*cngxPopoverArrow` template (contentChild).\n * 2. App-wide `CNGX_POPOVER_PANEL_CONFIG.templates.arrow`\n * (via `providePopoverPanel(withArrowTemplate(...))`).\n * 3. `null` -> the panel renders the default rotated-diamond markup.\n */\n protected readonly arrowTpl = computed(\n () => this.arrowTplDirective()?.templateRef ?? this.config.templates?.arrow ?? null,\n );\n\n /**\n * Context surface for projected `*cngxPopoverArrow` templates.\n * `equal` keeps the reference stable across re-evaluations whose\n * inputs round-trip to the same `{ edge, offsetPx }` - required for\n * any object-returning computed per the Equality discipline rule.\n */\n protected readonly arrowContext = computed<CngxPopoverArrowContext>(\n () => {\n const raw = this.popover.arrowOffset();\n const parsed = raw === null ? null : Number.parseFloat(raw);\n return {\n edge: this.popover.resolvedEdge(),\n offsetPx: parsed !== null && Number.isFinite(parsed) ? parsed : null,\n };\n },\n { equal: (a, b) => a.edge === b.edge && a.offsetPx === b.offsetPx },\n );\n\n /** Auto-detected from projected `[cngxPopoverHeader]` content. */\n protected readonly hasHeader = computed(() => !!this.headerSlot());\n\n /** Auto-detected from projected `[cngxPopoverFooter]` content. */\n protected readonly hasFooter = computed(() => !!this.footerSlot());\n\n private readonly uid = nextUid('cngx-pp');\n protected readonly headerId = `${this.uid}-header`;\n protected readonly bodyId = `${this.uid}-body`;\n\n /**\n * Only point to the header when one is projected - a bare id reference\n * resolves even against an element that never renders (the header row is\n * gated on `hasHeader()`), leaving AT with an empty accessible name.\n */\n protected readonly ariaLabelledBy = computed(() => (this.hasHeader() ? this.headerId : null));\n\n /** Only point to body when default content is showing (not loading/error/empty). */\n protected readonly ariaDescribedBy = computed(() =>\n this.effectiveLoading() || this.effectiveError() || this.effectiveEmpty() ? null : this.bodyId,\n );\n\n protected readonly hostClass = computed(() => {\n const v = this.variant() ?? this.config.defaultVariant ?? 'default';\n let cls = `cngx-popover-panel cngx-popover-panel--${v}`;\n if (this.showArrow()) {\n cls += ' cngx-popover-panel--arrow';\n }\n return cls;\n });\n\n private autoDismissTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n // Hint any CngxPopoverTrigger pointing at this popover to default\n // `aria-haspopup=\"dialog\"`. Consumer override on the trigger wins.\n this.popover.setHaspopup('dialog');\n\n effect(() => {\n const isVisible = this.popover.isVisible();\n const v = this.variant() ?? untracked(() => this.config.defaultVariant) ?? 'default';\n const timing = untracked(() => this.config.autoDismiss);\n\n if (this.autoDismissTimer) {\n clearTimeout(this.autoDismissTimer);\n this.autoDismissTimer = null;\n }\n if (isVisible && timing?.[v]) {\n this.autoDismissTimer = setTimeout(() => this.popover.hide(), timing[v]);\n }\n });\n\n this.destroyRef.onDestroy(() => {\n if (this.autoDismissTimer) {\n clearTimeout(this.autoDismissTimer);\n }\n });\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n DestroyRef,\n effect,\n inject,\n input,\n untracked,\n ViewEncapsulation,\n viewChild,\n} from '@angular/core';\nimport type { AsyncStatus } from '@cngx/core/utils';\nimport {\n CngxAsyncClick,\n CngxFailed,\n CngxPending,\n CngxSucceeded,\n type AsyncAction,\n} from '@cngx/common/interactive';\nimport { cngxDevWarn } from '@cngx/utils';\n\nimport { CNGX_POPOVER_PANEL_CONFIG } from './popover-panel.config';\nimport { CngxPopover } from './popover.directive';\n\n/**\n * Visual variant for the action button.\n *\n * @category common/popover\n */\nexport type PopoverActionVariant = 'primary' | 'secondary' | 'danger' | 'ghost';\n\n/**\n * Action button for use inside `cngx-popover-panel` footer.\n *\n * Two roles:\n * - `'dismiss'` - closes the panel on click (no async action).\n * - `'confirm'` - executes an async action, shows status templates,\n * optionally auto-closes the panel on success.\n *\n * Supports the same `cngxPending`/`cngxSucceeded`/`cngxFailed` templates\n * as `CngxActionButton`, or use `status()` + `@switch` for full control.\n *\n * ### Dismiss button\n * ```html\n * <cngx-popover-action role=\"dismiss\">Cancel</cngx-popover-action>\n * ```\n *\n * ### Confirm with templates\n * ```html\n * <cngx-popover-action role=\"confirm\" [action]=\"save\" variant=\"primary\">\n * Save\n * <ng-template cngxPending>Saving...</ng-template>\n * <ng-template cngxSucceeded>Saved!</ng-template>\n * <ng-template cngxFailed let-err>{{ err }}</ng-template>\n * </cngx-popover-action>\n * ```\n *\n * ### With @switch\n * ```html\n * <cngx-popover-action role=\"confirm\" [action]=\"save\" #act=\"cngxPopoverAction\">\n * @switch (act.status()) {\n * @case ('pending') { Saving... }\n * @case ('success') { Done }\n * @default { Save }\n * }\n * </cngx-popover-action>\n * ```\n *\n * @category common/popover\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-action.component.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxPopoverFooter\n * @slot cngxPending Rendered while the action is running.\n * @slot cngxSucceeded Rendered after the action succeeds.\n * @slot cngxFailed Rendered when the action fails; gets the error.\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/content-states</example-url>\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/variants</example-url>\n * <example-url>http://localhost:4200/#/common/popover/popover-panel/with-footer-actions</example-url>\n */\n@Component({\n selector: 'cngx-popover-action',\n standalone: true,\n imports: [NgTemplateOutlet, CngxAsyncClick],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'cngxPopoverAction',\n host: { style: 'display: contents' },\n template: `\n <ng-template #idle><ng-content /></ng-template>\n\n @if (role() === 'dismiss') {\n <button\n type=\"button\"\n [class]=\"'cngx-popover-action cngx-popover-action--' + variant()\"\n (click)=\"handleDismiss()\"\n >\n <ng-container *ngTemplateOutlet=\"idle\" />\n </button>\n } @else if (action(); as act) {\n <button\n type=\"button\"\n [cngxAsyncClick]=\"act\"\n #btn=\"cngxAsyncClick\"\n [feedbackDuration]=\"feedbackDuration()\"\n [autoAnnounce]=\"false\"\n [class]=\"'cngx-popover-action cngx-popover-action--' + variant()\"\n >\n @switch (btn.status()) {\n @case ('pending') {\n @if (pendingTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('success') {\n @if (succeededTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('error') {\n @if (failedTpl(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl.templateRef; context: { $implicit: btn.error() }\"\n />\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @default {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n </button>\n <span aria-live=\"polite\" aria-atomic=\"true\" class=\"cngx-popover-action__sr-only\">\n {{ btn.announcement() }}\n </span>\n } @else {\n <!-- confirm without [action]: CNGX1035; the click runs nothing -->\n <button\n type=\"button\"\n aria-disabled=\"true\"\n [class]=\"'cngx-popover-action cngx-popover-action--' + variant()\"\n >\n <ng-container *ngTemplateOutlet=\"idle\" />\n </button>\n }\n `,\n styleUrls: ['./popover-action.component.css'],\n})\nexport class CngxPopoverAction {\n private readonly popover = inject(CngxPopover, { optional: true });\n private readonly config = inject(CNGX_POPOVER_PANEL_CONFIG);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Button role: `'dismiss'` closes immediately, `'confirm'` runs an async action. */\n readonly role = input<'dismiss' | 'confirm'>('confirm');\n\n /** The async action to execute (only for `role=\"confirm\"`). */\n readonly action = input<AsyncAction | undefined>(undefined);\n\n /** Visual variant for the button. */\n readonly variant = input<PopoverActionVariant>('secondary');\n\n /** Duration in ms to show success/error feedback. */\n readonly feedbackDuration = input(2000);\n\n protected readonly pendingTpl = contentChild(CngxPending);\n protected readonly succeededTpl = contentChild(CngxSucceeded);\n protected readonly failedTpl = contentChild(CngxFailed);\n\n private readonly asyncClick = viewChild(CngxAsyncClick);\n\n /**\n * Lifecycle status of the confirm action - `'idle' | 'pending' | 'success'\n * | 'error'`, mirroring the internal `CngxAsyncClick`. Always `'idle'` for\n * `role=\"dismiss\"` (there is no async lifecycle to report).\n */\n readonly status = computed<AsyncStatus>(() => this.asyncClick()?.status() ?? 'idle');\n\n private closeOnSuccessTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n // withCloseOnSuccess(): a confirmed footer action hides the composing\n // popover after the configured delay. A follow-up run cancels the\n // pending close so a re-triggered action never yanks the panel away\n // mid-interaction.\n effect(() => {\n const status = this.status();\n const delay = untracked(() => this.config.closeOnSuccessDelay);\n if (status === 'pending') {\n this.clearCloseOnSuccessTimer();\n }\n if (status === 'success' && delay !== undefined && this.popover) {\n this.clearCloseOnSuccessTimer();\n this.closeOnSuccessTimer = setTimeout(() => {\n this.closeOnSuccessTimer = null;\n this.popover?.hide();\n }, delay);\n }\n });\n\n this.destroyRef.onDestroy(() => this.clearCloseOnSuccessTimer());\n\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n afterNextRender(() => {\n if (this.role() === 'confirm' && !this.action()) {\n cngxDevWarn(\n 'CNGX1035',\n '[cngx-popover-action] role=\"confirm\" without an [action] renders a button whose ' +\n 'click runs nothing and leaves the popover open. Bind [action] or use role=\"dismiss\".',\n );\n }\n });\n }\n }\n\n protected handleDismiss(): void {\n this.popover?.hide();\n }\n\n private clearCloseOnSuccessTimer(): void {\n if (this.closeOnSuccessTimer) {\n clearTimeout(this.closeOnSuccessTimer);\n this.closeOnSuccessTimer = null;\n }\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { CngxDivider } from '@cngx/common/display';\n\n/**\n * Separator for use inside `cngx-popover-panel` (or a bare `[cngxPopover]`).\n *\n * Composes `CngxDivider` via `hostDirectives` so the popover-context\n * separator carries proper `role=\"separator\"` + `aria-orientation`\n * semantics without the consumer having to remember the ARIA wiring.\n * The `orientation` and `inset` inputs forward to the underlying\n * `CngxDivider` host directive.\n *\n * Project anywhere inside the panel content - typically between menu\n * item groups (destructive vs non-destructive), between body sections,\n * or between footer action groups.\n *\n * ### Menu item group separator (horizontal)\n * ```html\n * <menu>\n * <li><button (click)=\"pop.hide()\">Edit</button></li>\n * <li><button (click)=\"pop.hide()\">Duplicate</button></li>\n * <li cngxPopoverDivider></li>\n * <li><button (click)=\"pop.hide()\">Delete</button></li>\n * </menu>\n * ```\n *\n * ### Vertical separator between footer action groups\n * ```html\n * <div cngxPopoverFooter>\n * <cngx-popover-action role=\"dismiss\">Cancel</cngx-popover-action>\n * <span cngxPopoverDivider orientation=\"vertical\"></span>\n * <cngx-popover-action role=\"confirm\" [action]=\"save\">Save</cngx-popover-action>\n * </div>\n * ```\n *\n * @category common/popover\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-divider.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPopoverPanel, CngxDivider\n */\n@Directive({\n selector: '[cngxPopoverDivider]',\n exportAs: 'cngxPopoverDivider',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxDivider,\n inputs: ['orientation', 'inset'],\n },\n ],\n host: {\n class: 'cngx-popover-divider',\n },\n})\nexport class CngxPopoverDivider {}\n","/**\n * @module @cngx/common/popover\n */\n\n// Atoms\nexport type {\n ArrowEdge,\n PopoverPlacement,\n PopoverPositionTryFallback,\n PopoverState,\n PopoverMode,\n PopoverHaspopup,\n PopoverPanelRole,\n TooltipTriggerMode,\n} from './popover.types';\nexport { CngxPopover } from './popover.directive';\nexport { CngxPopoverTrigger } from './popover-trigger.directive';\nexport { CngxPopoverAnchor } from './popover-anchor.directive';\nexport { CngxTooltip } from './tooltip.directive';\nexport type { CngxPopoverPresentation } from './popover-presentation';\nexport { CngxPopoverSheet, type CngxPopoverPresentationRequest } from './popover-sheet.directive';\nexport type { CngxPopoverSheetCloseReason } from './popover-sheet-host';\nexport {\n CngxPopoverSheetHeader,\n CngxPopoverSheetTitle,\n CngxPopoverSheetHandle,\n CngxPopoverSheetInitialFocus,\n} from './popover-sheet-parts';\n\n// Floating UI fallback (opt-in)\nexport {\n CNGX_FLOATING_FALLBACK,\n provideFloatingFallback,\n type ComputePositionFn,\n type FloatingFallbackConfig,\n} from './floating-fallback';\n\n// Panel molecule\nexport type {\n CngxPopoverPanelConfig,\n CngxPopoverPanelLabels,\n PopoverPanelFeature,\n} from './popover-panel.types';\nexport {\n CNGX_POPOVER_PANEL_CONFIG,\n providePopoverPanel,\n withAutoDismiss,\n withCloseOnSuccess,\n withDefaultVariant,\n withCloseButton,\n withArrow,\n withArrowTemplate,\n withPopoverPanelLabels,\n} from './popover-panel.config';\nexport {\n CNGX_POPOVER_LANGUAGE_EN,\n type CngxPopoverLanguageSection,\n} from './i18n/popover-language-section';\nexport { CngxPopoverPanel } from './popover-panel.component';\nexport { CngxPopoverAction, type PopoverActionVariant } from './popover-action.component';\nexport { CNGX_POPOVER_ARROW_BOUNDS, type CngxPopoverArrowBounds } from './popover-arrow-bounds';\nexport {\n CngxPopoverArrow,\n type CngxPopoverArrowContext,\n CngxPopoverHeader,\n CngxPopoverBody,\n CngxPopoverFooter,\n CngxPopoverClose,\n CngxPopoverLoading,\n CngxPopoverEmpty,\n CngxPopoverError,\n} from './popover-panel-slots';\nexport { CngxPopoverDivider } from './popover-divider.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.CngxPopover","i1"],"mappings":";;;;;;;;;;;;;;;;;AAIA;;;;;;;AAOG;AACH,SAAS,mBAAmB,GAAA;AAC1B,IAAA,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE;QAC9B,OAAO,EAAE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