@cngx/common 0.1.0-rc.5 → 0.1.0-rc.7
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.
- package/chart/README.md +85 -0
- package/command/README.md +157 -0
- package/data/README.md +23 -0
- package/fesm2022/cngx-common-a11y.mjs +247 -85
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +37 -37
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +13 -9
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +3404 -1392
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +144 -0
- package/fesm2022/cngx-common-command.mjs.map +1 -0
- package/fesm2022/cngx-common-data.mjs +304 -213
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +369 -100
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +144 -30
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +1089 -459
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +113 -61
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +430 -54
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +107 -49
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1170 -752
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +1086 -0
- package/fesm2022/cngx-common-timeline.mjs.map +1 -0
- package/fesm2022/cngx-common.mjs +2 -2
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/package.json +11 -1
- package/stepper/README.md +1 -1
- package/theming/components/cngx-accordion.css +20 -6
- package/theming/components/cngx-badge.css +22 -0
- package/theming/components/cngx-bottom-sheet.css +14 -2
- package/theming/components/cngx-breadcrumb.css +9 -1
- package/theming/components/cngx-button-toggle.css +44 -2
- package/theming/components/cngx-data-grid.css +69 -4
- package/theming/components/cngx-dialog.css +12 -0
- package/theming/components/cngx-divider.css +12 -0
- package/theming/components/cngx-listbox.css +27 -0
- package/theming/components/cngx-menu.css +36 -0
- package/theming/components/cngx-ripple.css +1 -1
- package/theming/components/cngx-slider.css +1 -1
- package/theming/components/cngx-tooltip.css +11 -0
- package/types/cngx-common-a11y.d.ts +63 -17
- package/types/cngx-common-audio.d.ts +32 -32
- package/types/cngx-common-card.d.ts +10 -3
- package/types/cngx-common-chart.d.ts +1281 -141
- package/types/cngx-common-command.d.ts +167 -0
- package/types/cngx-common-data.d.ts +264 -98
- package/types/cngx-common-dialog.d.ts +214 -25
- package/types/cngx-common-display.d.ts +83 -13
- package/types/cngx-common-interactive.d.ts +708 -174
- package/types/cngx-common-layout.d.ts +48 -1
- package/types/cngx-common-popover.d.ts +120 -3
- package/types/cngx-common-stepper.d.ts +55 -5
- package/types/cngx-common-tabs.d.ts +386 -25
- package/types/cngx-common-timeline.d.ts +1059 -0
- package/types/cngx-common.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-common-dialog.mjs","sources":["../../../projects/common/dialog/dialog/dialog-ref.ts","../../../projects/common/dialog/dialog/dialog-stack.ts","../../../projects/common/dialog/dialog/dialog-title.directive.ts","../../../projects/common/dialog/dialog/dialog-description.directive.ts","../../../projects/common/dialog/dialog/dialog.directive.ts","../../../projects/common/dialog/dialog/dialog-close.directive.ts","../../../projects/common/dialog/dialog/dialog-config.ts","../../../projects/common/dialog/dialog/dialog-outlet.ts","../../../projects/common/dialog/dialog/dialog.service.ts","../../../projects/common/dialog/bottom-sheet/bottom-sheet.directive.ts","../../../projects/common/dialog/draggable/dialog-draggable.directive.ts","../../../projects/common/dialog/public-api.ts","../../../projects/common/dialog/cngx-common-dialog.ts"],"sourcesContent":["import { InjectionToken, type Signal } from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Lifecycle states of a `CngxDialog`.\n *\n * @category common/dialog\n */\nexport type DialogState = 'closed' | 'opening' | 'open' | 'closing';\n\n/**\n * Signal-based dialog reference.\n *\n * - **Outside** (parent template): access via `exportAs` - `#dlg=\"cngxDialog\"`\n * - **Inside** (dialog content): access via DI - `inject(DIALOG_REF)`\n *\n * @category common/dialog\n */\nexport interface DialogRef<T = unknown> {\n /** Current lifecycle state of the dialog. */\n readonly lifecycle: Signal<DialogState>;\n\n /**\n * The typed result of the dialog.\n *\n * - `undefined` before the dialog closes (reset on each `open()`)\n * - `'dismissed'` when dismissed via Escape or backdrop click\n * - `T` when closed with an explicit value\n */\n readonly result: Signal<T | 'dismissed' | undefined>;\n\n /** Unique ID of this dialog instance. */\n readonly id: Signal<string>;\n\n /**\n * Async state of the submit channel.\n *\n * Populated when `[submitAction]` is set - tracks the submit lifecycle\n * (`idle` -> `pending` -> `success`/`error`). When `submitAction` is not set,\n * this is a static idle state.\n *\n * Bind to any state consumer: `<cngx-alert [state]=\"dlg.submitState\" />`.\n */\n readonly submitState: CngxAsyncState<unknown>;\n\n /** Close the dialog with a typed result value. */\n close(value: T): void;\n\n /** Dismiss the dialog without a result (Escape / backdrop). */\n dismiss(): void;\n}\n\n/**\n * Injection token to access the nearest `DialogRef` from inside a dialog.\n *\n * @category common/dialog\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-ref.ts\n * @since 0.1.0\n */\nexport const DIALOG_REF = new InjectionToken<DialogRef>('CngxDialogRef');\n","import { computed, Injectable, signal, type Provider } from '@angular/core';\n\n/**\n * Tracks open dialog instances as a stack for backdrop management.\n *\n * Provided in root - always available, no manual provider setup needed.\n * When multiple modal dialogs are stacked, only the topmost shows\n * its `::backdrop`. Each `CngxDialog` reads `isTopmost` from this service\n * to control `--cngx-dialog-backdrop-opacity`.\n *\n * @category common/dialog\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-stack.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxDialogOpener\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Injectable({ providedIn: 'root' })\nexport class CngxDialogStack {\n private readonly stackState = signal<readonly string[]>([]);\n\n /** Readonly snapshot of the current stack (bottom → top). */\n readonly stack = this.stackState.asReadonly();\n\n /** ID of the topmost (most recently opened) dialog, or `null`. */\n readonly topmost = computed(() => this.stackState().at(-1) ?? null);\n\n /** Push a dialog ID onto the stack (called on open). */\n push(id: string): void {\n this.stackState.update((s) => [...s, id]);\n }\n\n /** Remove a dialog ID from the stack (called on close). */\n pop(id: string): void {\n this.stackState.update((s) => s.filter((x) => x !== id));\n }\n}\n\n/**\n * Provide a scoped `CngxDialogStack` instance for nested dialog backdrop management.\n *\n * By default, `CngxDialogStack` is `providedIn: 'root'`, so all dialogs share\n * one stack. Call `provideDialogStack()` in a component's `providers` array to\n * create an isolated stack scope (e.g., for a sub-application or dialog group).\n *\n * ```typescript\n * @Component({\n * providers: [provideDialogStack()],\n * })\n * export class NestedDialogHost { }\n * ```\n *\n * @category common/dialog\n */\nexport function provideDialogStack(): Provider {\n return CngxDialogStack;\n}\n","import { computed, Directive, ElementRef, inject, signal } from '@angular/core';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { DIALOG_REF } from './dialog-ref';\n\n/**\n * Marks an element as the dialog's title for ARIA labelling.\n *\n * Automatically generates a deterministic ID and registers with the\n * parent `CngxDialog` for `aria-labelledby`. The title text is also\n * announced via `aria-live` when the dialog transitions to `'open'`.\n *\n * ```html\n * <dialog cngxDialog>\n * <h2 cngxDialogTitle>Confirm Delete</h2>\n * …\n * </dialog>\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-title.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxDialogDescription, CngxDialogClose\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Directive({\n selector: '[cngxDialogTitle]',\n exportAs: 'cngxDialogTitle',\n standalone: true,\n host: {\n '[id]': 'id()',\n },\n})\nexport class CngxDialogTitle {\n private readonly elRef = inject(ElementRef<HTMLElement>);\n private readonly dialogRef = inject(DIALOG_REF, { optional: true });\n\n /**\n * Auto-generated unique ID bound to the host `[id]` attribute.\n *\n * Used by `CngxDialog` for `aria-labelledby`. When a parent `CngxDialog`\n * is present, the ID is derived from the dialog's ID (e.g. `cngx-dialog-0-title`).\n */\n readonly id = signal(nextUid('cngx-dialog-title'));\n\n /**\n * Text content of the title element.\n *\n * Read by `CngxDialog` on open to announce the dialog title via\n * an `aria-live` region for screen readers.\n */\n readonly textContent = computed(\n () => (this.elRef.nativeElement as HTMLElement).textContent?.trim() ?? '',\n );\n\n constructor() {\n if (this.dialogRef) {\n this.id.set(`${this.dialogRef.id()}-title`);\n }\n }\n}\n","import { Directive, inject, signal } from '@angular/core';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { DIALOG_REF } from './dialog-ref';\n\n/**\n * Marks an element as the dialog's description for ARIA.\n *\n * Automatically generates a deterministic ID and registers with the\n * parent `CngxDialog` for `aria-describedby`.\n *\n * ```html\n * <dialog cngxDialog>\n * <h2 cngxDialogTitle>Delete item?</h2>\n * <p cngxDialogDescription>This action cannot be undone.</p>\n * …\n * </dialog>\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-description.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxDialogTitle, CngxDialogClose\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Directive({\n selector: '[cngxDialogDescription]',\n exportAs: 'cngxDialogDescription',\n standalone: true,\n host: {\n '[id]': 'id()',\n },\n})\nexport class CngxDialogDescription {\n private readonly dialogRef = inject(DIALOG_REF, { optional: true });\n\n /**\n * Auto-generated unique ID bound to the host `[id]` attribute.\n *\n * Used by `CngxDialog` for `aria-describedby`. When a parent `CngxDialog`\n * is present, the ID is derived from the dialog's ID (e.g. `cngx-dialog-0-desc`).\n */\n readonly id = signal(nextUid('cngx-dialog-desc'));\n\n constructor() {\n if (this.dialogRef) {\n this.id.set(`${this.dialogRef.id()}-desc`);\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n contentChild,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n Renderer2,\n signal,\n} from '@angular/core';\n\nimport { buildAsyncStateView, type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\nimport { hasTransition, nextUid, onTransitionDone } from '@cngx/core/utils';\nimport { firstValueFrom, isObservable, type Observable } from 'rxjs';\n\nimport { DIALOG_REF, type DialogRef, type DialogState } from './dialog-ref';\nimport { CngxDialogStack } from './dialog-stack';\nimport { CngxDialogTitle } from './dialog-title.directive';\nimport { CngxDialogDescription } from './dialog-description.directive';\n\n/**\n * Ref-count map for scroll lock - one lock per document root, shared across stacked modals.\n *\n * @internal\n */\nconst lockCounts = new WeakMap<HTMLElement, number>();\n\n/**\n * Acquire a scroll lock on the document root, preserving prior overflow styles.\n *\n * @internal\n */\nfunction acquireScrollLock(html: HTMLElement): void {\n const count = lockCounts.get(html) ?? 0;\n if (count === 0) {\n html.dataset['cngxPrevOverflow'] = html.style.overflow;\n html.dataset['cngxPrevScrollbarGutter'] = html.style.scrollbarGutter;\n html.style.overflow = 'hidden';\n html.style.scrollbarGutter = 'stable';\n }\n lockCounts.set(html, count + 1);\n}\n\n/**\n * Release a scroll lock. Restores prior overflow styles when the count reaches zero.\n *\n * @internal\n */\nfunction releaseScrollLock(html: HTMLElement): void {\n const count = lockCounts.get(html) ?? 0;\n if (count <= 1) {\n html.style.overflow = html.dataset['cngxPrevOverflow'] ?? '';\n html.style.scrollbarGutter = html.dataset['cngxPrevScrollbarGutter'] ?? '';\n delete html.dataset['cngxPrevOverflow'];\n delete html.dataset['cngxPrevScrollbarGutter'];\n lockCounts.set(html, 0);\n } else {\n lockCounts.set(html, count - 1);\n }\n}\n\n/**\n * Signal-driven state machine for native `<dialog>`.\n *\n * Wraps the browser's `<dialog>` element with reactive state, typed results,\n * deterministic focus management, and full ARIA communication. Supports both\n * modal and non-modal modes, CSS transition-aware open/close lifecycle, and\n * ref-counted scroll locking for stacked modals.\n *\n * The directive implements `DialogRef<T>` and provides itself via `DIALOG_REF`,\n * so child directives (`CngxDialogTitle`, `CngxDialogClose`, etc.) can inject\n * the reference without explicit wiring.\n *\n * State lifecycle: `closed` -> `opening` -> `open` -> `closing` -> `closed`.\n * CSS classes `cngx-dialog--opening`, `cngx-dialog--open`, and\n * `cngx-dialog--closing` are applied to the host for transition hooks.\n *\n * ### Declarative (template-driven)\n * ```html\n * <dialog cngxDialog #dlg=\"cngxDialog\">\n * <h2 cngxDialogTitle>Delete item?</h2>\n * <p cngxDialogDescription>This cannot be undone.</p>\n * <button [cngxDialogClose]=\"false\">Cancel</button>\n * <button [cngxDialogClose]=\"true\">Delete</button>\n * </dialog>\n * <button (click)=\"dlg.open()\">Delete</button>\n *\n * @if (dlg.lifecycle() === 'closed' && dlg.result() === true) {\n * <p>Item deleted.</p>\n * }\n * ```\n *\n * ### Programmatic (via CngxDialogOpener)\n * ```typescript\n * const ref = this.dialogService.open<boolean>(ConfirmDialog, {\n * data: { message: 'Delete item?' },\n * });\n *\n * ref.afterClosed().subscribe(result => {\n * if (result === true) this.delete();\n * });\n * ```\n *\n * ### Non-modal dialog\n * ```html\n * <dialog cngxDialog [modal]=\"false\" #tooltip=\"cngxDialog\">\n * <p>Inline tooltip content</p>\n * </dialog>\n * ```\n *\n * ### Custom focus target\n * ```html\n * <dialog cngxDialog [autoFocus]=\"'#name-input'\">\n * <input id=\"name-input\" />\n * </dialog>\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog.directive.ts\n * @since 0.1.0\n * @relatedTo CngxBottomSheet, CngxDialogOpener, CngxDialogTitle, CngxDialogClose, CngxDialogDraggable\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Directive({\n selector: 'dialog[cngxDialog]',\n exportAs: 'cngxDialog',\n standalone: true,\n providers: [{ provide: DIALOG_REF, useExisting: CngxDialog }],\n host: {\n '[class.cngx-dialog--opening]': 'isOpening()',\n '[class.cngx-dialog--open]': 'isOpen()',\n '[class.cngx-dialog--closing]': 'isClosing()',\n '[class.cngx-dialog--modal]': 'modal()',\n '[attr.aria-modal]': 'ariaModal()',\n '[attr.aria-labelledby]': 'ariaLabelledBy()',\n '[attr.aria-describedby]': 'ariaDescribedBy()',\n '[class.cngx-dialog--pending]': 'isPending()',\n '[attr.aria-busy]': 'isPending() || null',\n '[class.cngx-dialog--error]': 'effectiveError()',\n '[style.--cngx-dialog-backdrop-opacity]': 'backdropOpacity()',\n '(cancel)': 'handleCancel($event)',\n '(click)': 'handleClick($event)',\n },\n})\nexport class CngxDialog<T = unknown> implements DialogRef<T> {\n private readonly elRef = inject<ElementRef<HTMLDialogElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly renderer = inject(Renderer2);\n private readonly destroyRef = inject(DestroyRef);\n private readonly dialogStack = inject(CngxDialogStack);\n\n private readonly titleDirective = contentChild(CngxDialogTitle);\n private readonly descriptionDirective = contentChild(CngxDialogDescription);\n\n /**\n * Whether the dialog opens as modal (`showModal()`) or non-modal (`show()`).\n *\n * Modal dialogs block interaction with the rest of the page, acquire a\n * scroll lock, and participate in the `CngxDialogStack` for backdrop\n * management. Non-modal dialogs do not.\n *\n * @defaultValue `true`\n */\n readonly modal = input(true);\n\n /**\n * Whether clicking the backdrop dismisses the dialog.\n *\n * Only applies to modal dialogs. When `true`, a click on the\n * `::backdrop` pseudo-element calls `dismiss()`.\n *\n * @defaultValue `true`\n */\n readonly closeOnBackdropClick = input(true);\n\n /**\n * Whether pressing Escape dismisses the dialog.\n *\n * Only applies to modal dialogs. The native `cancel` event is always\n * prevented; this input controls whether `dismiss()` is called in response.\n *\n * @defaultValue `true`\n */\n readonly closeOnEscape = input(true);\n\n /**\n * Focus strategy applied after the dialog transitions to `'open'`.\n *\n * Only applies to modal dialogs.\n *\n * - `'first-focusable'` -- focus the first `[autofocus]` element, or the\n * first focusable element in DOM order (default)\n * - `'none'` -- do not move focus\n * - Any CSS selector string -- focus the first element matching the selector\n *\n * @defaultValue `'first-focusable'`\n */\n readonly autoFocus = input<'first-focusable' | 'none' | (string & {})>('first-focusable');\n\n /**\n * Fallback element to focus when the original trigger element has been\n * removed from the DOM by the time the dialog closes.\n *\n * When not set and the trigger is gone, no focus return occurs.\n */\n readonly focusFallback = input<HTMLElement | undefined>(undefined);\n\n /**\n * Bind an async state - drives pending (aria-busy, prevents close) and\n * error from a single source. When set, takes precedence over the\n * `[error]` boolean input and `[submitAction]`.\n *\n * When `state.status()` is `'pending'`, the dialog prevents close/dismiss\n * and applies `aria-busy`. When `state.status()` is `'error'`, the dialog\n * applies `cngx-dialog--error` and announces the error via the SR live region.\n */\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /**\n * Async action to execute when `close(value)` is called.\n *\n * Receives the close value as parameter. On success, the dialog auto-closes.\n * On error, the dialog stays open with `cngx-dialog--error` and the error\n * is announced to screen readers.\n *\n * When set, `close(value)` no longer closes immediately - it enters a\n * `submitting` phase (`isPending() = true`, `aria-busy`, close blocked).\n *\n * The submit lifecycle is exposed via `submitState: CngxAsyncState<unknown>`.\n * Ignored when `[state]` input is also set (external state takes precedence).\n */\n readonly submitAction = input<((value: T) => Promise<unknown> | Observable<unknown>) | undefined>(\n undefined,\n );\n\n /**\n * Whether the dialog is in an error state. Fallback when neither `[state]`\n * nor `[submitAction]` is set.\n *\n * When `true`, applies the `cngx-dialog--error` CSS class on the host.\n * Use this to communicate form submission failures or other error\n * conditions visually.\n *\n * Pair with `cngx-form-errors` (`role=\"alert\"`) inside the dialog for\n * WCAG-compliant error announcements.\n *\n * @defaultValue `false`\n */\n readonly error = input(false);\n\n private readonly lifecycleSignal = signal<DialogState>('closed');\n private readonly resultSignal = signal<T | 'dismissed' | undefined>(undefined);\n private readonly idSignal = signal(nextUid('cngx-dialog'));\n private readonly triggerElement = signal<HTMLElement | null>(null);\n\n /**\n * Current lifecycle state of the dialog.\n *\n * Possible values: `'closed'`, `'opening'`, `'open'`, `'closing'`.\n */\n readonly lifecycle = this.lifecycleSignal.asReadonly();\n\n /**\n * The typed result of the dialog.\n *\n * - `undefined` before close (reset on each `open()` call)\n * - `'dismissed'` when dismissed via Escape or backdrop click\n * - `T` when closed with an explicit value via `close(value)`\n */\n readonly result = this.resultSignal.asReadonly();\n\n /** Unique auto-generated ID for this dialog instance. Used for ARIA and stack tracking. */\n readonly id = this.idSignal.asReadonly();\n\n private readonly submitStatusState = signal<AsyncStatus>('idle');\n private readonly submitErrorState = signal<unknown>(undefined);\n\n /**\n * Async state of the submit channel.\n *\n * Populated when `[submitAction]` is set. Tracks `idle` -> `pending` ->\n * `success`/`error`. When `submitAction` is not set, remains at `'idle'`.\n *\n * Bind to any state consumer: `<cngx-alert [state]=\"dlg.submitState\" />`.\n */\n readonly submitState: CngxAsyncState<unknown> = buildAsyncStateView<unknown>({\n status: this.submitStatusState.asReadonly(),\n data: computed(() => undefined),\n error: this.submitErrorState.asReadonly(),\n });\n\n /**\n * `true` when any async operation is pending. Blocks close/dismiss and sets `aria-busy`.\n *\n * External `[state]` short-circuits - when set, `submitAction` is ignored by the\n * `close()` guard (`action && !this.state()`), so `submitStatusState` stays `'idle'`.\n */\n readonly isPending = computed(() => {\n const ext = this.state();\n if (ext) {\n return ext.isPending();\n }\n return this.submitStatusState() === 'pending';\n });\n\n /**\n * Resolved error - external `[state]` takes precedence over submit state,\n * which takes precedence over the boolean `[error]` input.\n */\n protected readonly effectiveError = computed(() => {\n const ext = this.state();\n if (ext) {\n return !!ext.error();\n }\n // Use !== undefined to catch falsy error values (0, '', false)\n if (this.submitErrorState() !== undefined) {\n return true;\n }\n return this.error();\n });\n\n protected readonly isOpening = computed(() => this.lifecycleSignal() === 'opening');\n protected readonly isOpen = computed(() => this.lifecycleSignal() === 'open');\n protected readonly isClosing = computed(() => this.lifecycleSignal() === 'closing');\n\n protected readonly ariaModal = computed(() =>\n this.modal() && this.lifecycleSignal() !== 'closed' ? 'true' : null,\n );\n\n protected readonly ariaLabelledBy = computed(() => this.titleDirective()?.id() ?? null);\n\n protected readonly ariaDescribedBy = computed(() => this.descriptionDirective()?.id() ?? null);\n\n protected readonly backdropOpacity = computed(() =>\n this.dialogStack.topmost() === this.idSignal() ? '1' : '0',\n );\n\n private liveRegion: HTMLSpanElement | null = null;\n\n constructor() {\n this.createLiveRegion();\n\n effect(() => {\n if (this.lifecycleSignal() === 'open') {\n const titleText = this.titleDirective()?.textContent() ?? '';\n if (titleText && this.liveRegion) {\n this.liveRegion.textContent = titleText;\n // Clear after one frame so subsequent opens re-announce\n requestAnimationFrame(() => {\n if (this.liveRegion) {\n this.liveRegion.textContent = '';\n }\n });\n }\n }\n });\n\n effect(() => {\n if (this.effectiveError() && this.liveRegion) {\n const errMsg = this.state()?.error() ?? this.submitErrorState();\n this.liveRegion.textContent = typeof errMsg === 'string' ? errMsg : 'An error occurred';\n }\n });\n\n this.destroyRef.onDestroy(() => {\n if (this.lifecycleSignal() !== 'closed') {\n this.finalize();\n }\n });\n }\n\n /**\n * Open the dialog.\n *\n * Resets the result from any previous open/close cycle, stores the\n * currently focused element for focus return, and calls the native\n * `showModal()` or `show()` depending on the `modal` input.\n *\n * No-op if the dialog is already open or in a transition state.\n */\n open(): void {\n if (this.lifecycleSignal() !== 'closed') {\n return;\n }\n\n const dialog = this.dialogElement;\n\n this.resultSignal.set(undefined);\n this.submitStatusState.set('idle');\n this.submitErrorState.set(undefined);\n\n this.triggerElement.set(this.doc.activeElement as HTMLElement | null);\n\n this.lifecycleSignal.set('opening');\n\n if (this.modal()) {\n dialog.showModal();\n this.acquireScrollLock();\n this.dialogStack.push(this.idSignal());\n } else {\n dialog.show();\n this.warnNonModalA11y();\n }\n\n // Transition to open after browser paints the opening class\n requestAnimationFrame(() => {\n if (this.lifecycleSignal() !== 'opening') {\n return;\n }\n this.lifecycleSignal.set('open');\n this.moveFocus();\n });\n }\n\n /**\n * Close the dialog with a typed result.\n *\n * When `[submitAction]` is set and `[state]` is not set, executes the action\n * with `value` before closing. The dialog enters a submitting phase\n * (`isPending() = true`) - on success it auto-closes, on error it stays open.\n *\n * When `[submitAction]` is not set (or `[state]` overrides), closes immediately.\n *\n * No-op if the dialog is not in the `'open'` or `'opening'` state, or if\n * already pending.\n *\n * @param value - The typed result to deliver to consumers.\n */\n close(value: T): void {\n if (this.lifecycleSignal() !== 'open' && this.lifecycleSignal() !== 'opening') {\n return;\n }\n if (this.isPending()) {\n return;\n }\n\n const action = this.submitAction();\n if (action && !this.state()) {\n void this.executeSubmit(action, value);\n } else {\n this.resultSignal.set(value);\n this.startClosing();\n }\n }\n\n /**\n * Dismiss the dialog without a typed result.\n *\n * Sets `result` to `'dismissed'`, then initiates the closing transition.\n * Typically triggered by Escape key or backdrop click, but can be called\n * directly. No-op if the dialog is not in the `'open'` or `'opening'` state.\n */\n dismiss(): void {\n if (this.lifecycleSignal() !== 'open' && this.lifecycleSignal() !== 'opening') {\n return;\n }\n if (this.isPending()) {\n return;\n }\n this.resultSignal.set('dismissed');\n this.startClosing();\n }\n\n private async executeSubmit(\n action: (value: T) => Promise<unknown> | Observable<unknown>,\n value: T,\n ): Promise<void> {\n this.submitStatusState.set('pending');\n this.submitErrorState.set(undefined);\n\n try {\n const result$ = action(value);\n const promise = isObservable(result$)\n ? firstValueFrom(result$, { defaultValue: undefined })\n : result$;\n await promise;\n\n // Guard against post-destroy signal writes\n if (this.lifecycleSignal() === 'closed') {\n return;\n }\n\n this.submitStatusState.set('success');\n this.resultSignal.set(value);\n this.startClosing();\n } catch (err: unknown) {\n // Guard against post-destroy signal writes\n if (this.lifecycleSignal() === 'closed') {\n return;\n }\n\n this.submitStatusState.set('error');\n this.submitErrorState.set(err);\n }\n }\n\n protected handleCancel(event: Event): void {\n event.preventDefault();\n if (this.closeOnEscape() && this.modal()) {\n this.dismiss();\n }\n }\n\n protected handleClick(event: MouseEvent): void {\n if (!this.modal() || !this.closeOnBackdropClick()) {\n return;\n }\n if (this.lifecycleSignal() !== 'open') {\n return;\n }\n\n // Detect backdrop click: click coordinates outside dialog content rect\n const rect = this.dialogElement.getBoundingClientRect();\n if (\n event.clientX < rect.left ||\n event.clientX > rect.right ||\n event.clientY < rect.top ||\n event.clientY > rect.bottom\n ) {\n this.dismiss();\n }\n }\n\n private get dialogElement(): HTMLDialogElement {\n return this.elRef.nativeElement;\n }\n\n private startClosing(): void {\n if (hasTransition(this.dialogElement)) {\n this.lifecycleSignal.set('closing');\n onTransitionDone(this.dialogElement, () => this.finalize());\n } else {\n this.finalize();\n }\n }\n\n private finalize(): void {\n const dialog = this.dialogElement;\n\n if (dialog.open) {\n dialog.close();\n }\n\n if (this.modal()) {\n this.releaseScrollLock();\n this.dialogStack.pop(this.idSignal());\n }\n\n this.lifecycleSignal.set('closed');\n this.returnFocus();\n }\n\n private moveFocus(): void {\n if (!this.modal()) {\n return;\n }\n\n const strategy = this.autoFocus();\n const dialog = this.dialogElement;\n\n if (strategy === 'none') {\n return;\n }\n\n if (strategy === 'first-focusable') {\n // Native dialog with autofocus attribute works; otherwise focus first focusable\n const autofocusEl = dialog.querySelector<HTMLElement>('[autofocus]');\n if (autofocusEl) {\n autofocusEl.focus();\n return;\n }\n\n const focusable = dialog.querySelector<HTMLElement>(\n 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n );\n focusable?.focus();\n } else {\n const target = dialog.querySelector<HTMLElement>(strategy);\n target?.focus();\n }\n }\n\n private returnFocus(): void {\n const trigger = this.triggerElement();\n\n if (trigger?.isConnected) {\n trigger.focus();\n } else {\n const fallback = this.focusFallback();\n fallback?.focus();\n }\n\n this.triggerElement.set(null);\n }\n\n private createLiveRegion(): void {\n const span = this.renderer.createElement('span') as HTMLSpanElement;\n span.setAttribute('aria-live', 'polite');\n span.setAttribute('aria-atomic', 'true');\n span.className = 'cngx-sr-only';\n span.style.position = 'absolute';\n span.style.width = '1px';\n span.style.height = '1px';\n span.style.padding = '0';\n span.style.margin = '-1px';\n span.style.overflow = 'hidden';\n span.style.clip = 'rect(0, 0, 0, 0)';\n span.style.whiteSpace = 'nowrap';\n span.style.border = '0';\n this.renderer.appendChild(this.dialogElement, span);\n this.liveRegion = span;\n }\n\n private acquireScrollLock(): void {\n acquireScrollLock(this.doc.documentElement);\n }\n\n private releaseScrollLock(): void {\n releaseScrollLock(this.doc.documentElement);\n }\n\n private warnNonModalA11y(): void {\n if (!isDevMode()) {\n return;\n }\n\n // Non-modal dialogs are silent to SR. Warn if no aria-live sibling found.\n const trigger = this.triggerElement();\n if (trigger) {\n const parent = trigger.parentElement;\n if (parent && !parent.querySelector('[aria-live]')) {\n console.warn(\n `CngxDialog [${this.idSignal()}]: Non-modal dialog opened without an ` +\n '`aria-live` region near the trigger. Screen reader users will not ' +\n 'be notified that the dialog appeared. Add `aria-live=\"polite\"` to a ' +\n 'sibling element that announces the dialog presence.',\n );\n }\n }\n }\n}\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { DIALOG_REF } from './dialog-ref';\n\n/**\n * Close trigger for a dialog. Place on any clickable element inside a dialog.\n *\n * - With a value: `[cngxDialogClose]=\"'confirm'\"` calls `dialogRef.close(value)`\n * - Without a value: `cngxDialogClose` calls `dialogRef.dismiss()`\n *\n * Automatically sets `type=\"button\"` on `<button>` hosts to prevent\n * accidental form submission. Sets a default `aria-label=\"Close dialog\"`\n * when the host has no descriptive text content (icon-only buttons).\n *\n * ```html\n * <dialog cngxDialog>\n * <button [cngxDialogClose]=\"false\">Cancel</button>\n * <button [cngxDialogClose]=\"true\">Confirm</button>\n * </dialog>\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-close.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxDialogTitle, CngxDialogDescription\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Directive({\n selector: '[cngxDialogClose]',\n exportAs: 'cngxDialogClose',\n standalone: true,\n host: {\n '(click)': 'handleClick()',\n '[attr.type]': 'hostType',\n '[attr.aria-label]': 'ariaLabel()',\n },\n})\nexport class CngxDialogClose {\n private readonly dialogRef = inject(DIALOG_REF);\n private readonly elRef = inject(ElementRef<HTMLElement>);\n\n /** Value to pass to `close()`. When `undefined`, calls `dismiss()` instead. */\n readonly value = input<unknown>(undefined, { alias: 'cngxDialogClose' });\n\n /**\n * Explicit `aria-label` override.\n *\n * When not set, the directive auto-detects whether the host element\n * has descriptive text content. If it does (e.g. \"Cancel\", \"Confirm\"),\n * no `aria-label` is added. If the content is a single character,\n * empty, or visually an icon, `aria-label` defaults to `\"Close dialog\"`.\n */\n readonly label = input<string | undefined>(undefined, { alias: 'cngxDialogCloseLabel' });\n\n /** Set type=\"button\" on <button> hosts to prevent form submit. */\n protected readonly hostType =\n (this.elRef.nativeElement as HTMLElement).tagName === 'BUTTON' ? 'button' : null;\n\n /**\n * Computed `aria-label`. Returns:\n * - explicit `label()` input if set\n * - `null` if host text is descriptive (> 1 char, not whitespace-only)\n * - `'Close dialog'` for icon-only / single-char content\n */\n protected readonly ariaLabel = computed(() => {\n const explicit = this.label();\n if (explicit !== undefined) {\n return explicit || null;\n }\n\n // If host already has aria-label attribute set by the consumer, don't override\n const el = this.elRef.nativeElement as HTMLElement;\n if (el.hasAttribute('aria-label')) {\n return null;\n }\n\n const text = el.textContent?.trim() ?? '';\n if (text.length > 1) {\n return null;\n }\n\n return 'Close dialog';\n });\n\n protected handleClick(): void {\n const v = this.value();\n // Static attribute `cngxDialogClose` (no binding) resolves to '' - treat as dismiss.\n // Only `[cngxDialogClose]=\"value\"` with an explicit value calls close().\n if (v !== undefined && v !== '') {\n this.dialogRef.close(v);\n } else {\n this.dialogRef.dismiss();\n }\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Injection token for data passed to a programmatically opened dialog via `CngxDialogOpener.open()`.\n *\n * @category common/dialog\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-config.ts\n * @since 0.1.0\n */\nexport const CNGX_DIALOG_DATA = new InjectionToken<unknown>('CngxDialogData');\n\n/**\n * Configuration for programmatically opened dialogs.\n *\n * @category common/dialog\n */\nexport interface CngxDialogConfig<D = unknown> {\n /** Data to inject via `CNGX_DIALOG_DATA` inside the dialog component. */\n data?: D;\n /** Whether the dialog opens as modal (`showModal()`) or non-modal (`show()`). Default: `true`. */\n modal?: boolean;\n /** Whether clicking the backdrop dismisses the dialog. Default: `true`. */\n closeOnBackdropClick?: boolean;\n /** Whether pressing Escape dismisses the dialog. Default: `true`. */\n closeOnEscape?: boolean;\n /** Focus strategy on open. Default: `'first-focusable'`. */\n autoFocus?: 'first-focusable' | 'none' | (string & {});\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n input,\n viewChild,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { CngxDialog } from './dialog.directive';\n\n/**\n * Internal container component for programmatically opened dialogs.\n *\n * Not part of the public API — instantiated exclusively by `CngxDialogOpener`.\n * Renders the native `<dialog>` shell and exposes a `<ng-container>` outlet\n * where the content component or template is inserted.\n *\n * @internal\n */\n@Component({\n selector: 'cngx-dialog-outlet',\n standalone: true,\n imports: [CngxDialog],\n template: `\n <dialog\n cngxDialog\n [modal]=\"modal()\"\n [closeOnBackdropClick]=\"closeOnBackdropClick()\"\n [closeOnEscape]=\"closeOnEscape()\"\n [autoFocus]=\"autoFocus()\"\n #dialog=\"cngxDialog\"\n >\n <ng-container #contentOutlet />\n </dialog>\n `,\n styles: `\n :host {\n display: contents;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CngxDialogOutlet {\n readonly modal = input(true);\n readonly closeOnBackdropClick = input(true);\n readonly closeOnEscape = input(true);\n readonly autoFocus = input<string>('first-focusable');\n\n readonly dialog = viewChild.required(CngxDialog);\n readonly contentOutlet = viewChild('contentOutlet', { read: ViewContainerRef });\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n type ComponentRef,\n createComponent,\n effect,\n EnvironmentInjector,\n inject,\n Injectable,\n Injector,\n type Provider,\n type TemplateRef,\n type Type,\n} from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { filter, map, type Observable, take } from 'rxjs';\n\nimport type { CngxDialogConfig } from './dialog-config';\nimport { CNGX_DIALOG_DATA } from './dialog-config';\nimport { DIALOG_REF, type DialogRef } from './dialog-ref';\nimport { CngxDialogOutlet } from './dialog-outlet';\n\n/**\n * Reference to a programmatically opened dialog.\n *\n * Returned by `CngxDialogOpener.open()`. Provides both Signal-based access\n * (`state`, `result`) and Observable convenience methods (`afterClosed()`,\n * `afterOpened()`) for migration compatibility with `MatDialogRef`.\n *\n * ### Signal-based result reading\n * ```typescript\n * const ref = dialog.open<boolean>(ConfirmDialog);\n *\n * // In a computed or effect:\n * const wasCancelled = ref.result() === 'dismissed';\n * ```\n *\n * ### Observable-based result reading\n * ```typescript\n * ref.afterClosed().subscribe(result => {\n * if (result !== 'dismissed') console.log('Confirmed:', result);\n * });\n * ```\n *\n * @category common/dialog\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog.service.ts\n * @since 0.1.0\n * @relatedTo CngxDialogOpener, CngxDialog, CNGX_DIALOG_DATA\n */\nexport class CngxDialogRef<T = unknown> {\n /** @internal */\n readonly _outletRef: ComponentRef<CngxDialogOutlet>;\n\n /** @internal */\n constructor(\n private readonly inner: DialogRef<T>,\n outletRef: ComponentRef<CngxDialogOutlet>,\n private readonly contentRef: ComponentRef<unknown> | null,\n private readonly injector: Injector,\n ) {\n this._outletRef = outletRef;\n }\n\n /**\n * Current lifecycle state of the dialog.\n *\n * Possible values: `'closed'`, `'opening'`, `'open'`, `'closing'`.\n */\n get lifecycle() {\n return this.inner.lifecycle;\n }\n\n /**\n * The typed result signal.\n *\n * - `undefined` before the dialog closes (reset on each open cycle)\n * - `'dismissed'` when dismissed via Escape or backdrop click\n * - `T` when closed with an explicit value\n */\n get result() {\n return this.inner.result;\n }\n\n /** Unique auto-generated ID for this dialog instance. */\n get id() {\n return this.inner.id;\n }\n\n /**\n * Close the dialog with a typed result value.\n *\n * @param value - The result to deliver to consumers.\n */\n close(value: T): void {\n this.inner.close(value);\n }\n\n /**\n * Dismiss the dialog without a typed result.\n *\n * Sets the result to `'dismissed'`. Use for cancellation actions.\n */\n dismiss(): void {\n this.inner.dismiss();\n }\n\n /**\n * Observable that emits the result when the dialog closes.\n *\n * Emits exactly once with `T | 'dismissed'`, then completes.\n * Compatible with `MatDialogRef.afterClosed()` usage patterns.\n */\n afterClosed(): Observable<T | 'dismissed'> {\n return toObservable(this.inner.lifecycle, { injector: this.injector }).pipe(\n filter((s): s is 'closed' => s === 'closed'),\n take(1),\n map(() => this.inner.result() as T | 'dismissed'),\n );\n }\n\n /**\n * Observable that emits when the dialog finishes opening.\n *\n * Emits exactly once with `void` when the state transitions to `'open'`,\n * then completes. Useful for post-open logic (e.g., focusing a specific\n * element after animation completes).\n */\n afterOpened(): Observable<void> {\n return toObservable(this.inner.lifecycle, { injector: this.injector }).pipe(\n filter((s): s is 'open' => s === 'open'),\n take(1),\n map(() => undefined),\n );\n }\n\n /**\n * Reference to the content component instance.\n *\n * Returns `null` when the dialog was opened with a `TemplateRef` instead\n * of a component type.\n */\n get componentRef(): ComponentRef<unknown> | null {\n return this.contentRef;\n }\n}\n\n/**\n * Service for opening dialogs programmatically.\n *\n * Works like `MatDialog.open()` - pass a component type and config,\n * get back a typed `CngxDialogRef<T>`.\n *\n * Must be provided via `provideDialog()`.\n *\n * ### Open a component dialog\n * ```typescript\n * const ref = this.dialog.open<User>(EditUserDialog, {\n * data: { userId: 123 },\n * });\n *\n * ref.afterClosed().subscribe(result => {\n * if (result !== 'dismissed') saveUser(result);\n * });\n * ```\n *\n * ### Inside the dialog component\n * ```typescript\n * class EditUserDialog {\n * private readonly data = inject(CNGX_DIALOG_DATA) as { userId: number };\n * private readonly dialogRef = inject(DIALOG_REF) as DialogRef<User>;\n *\n * save(user: User) { this.dialogRef.close(user); }\n * }\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog.service.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxDialogRef, CNGX_DIALOG_DATA, CngxDialogStack\n */\n@Injectable()\nexport class CngxDialogOpener {\n private readonly appRef = inject(ApplicationRef);\n private readonly envInjector = inject(EnvironmentInjector);\n private readonly injector = inject(Injector);\n private readonly doc = inject(DOCUMENT);\n\n private readonly openDialogs: CngxDialogRef<unknown>[] = [];\n\n /**\n * Open a dialog with the given component.\n *\n * @param component - The component type to render inside the dialog.\n * @param config - Optional dialog configuration.\n * @returns A typed `CngxDialogRef<T>` for reading the result and controlling the dialog.\n */\n open<T = unknown, D = unknown>(\n component: Type<unknown>,\n config?: CngxDialogConfig<D>,\n ): CngxDialogRef<T>;\n\n /**\n * Open a dialog with the given template.\n *\n * @param templateRef - The template to render inside the dialog.\n * @param config - Optional dialog configuration.\n * @returns A typed `CngxDialogRef<T>`.\n */\n open<T = unknown, D = unknown>(\n templateRef: TemplateRef<unknown>,\n config?: CngxDialogConfig<D>,\n ): CngxDialogRef<T>;\n\n open<T = unknown, D = unknown>(\n content: Type<unknown> | TemplateRef<unknown>,\n config: CngxDialogConfig<D> = {},\n ): CngxDialogRef<T> {\n const outletRef = createComponent(CngxDialogOutlet, {\n environmentInjector: this.envInjector,\n });\n\n outletRef.setInput('modal', config.modal ?? true);\n outletRef.setInput('closeOnBackdropClick', config.closeOnBackdropClick ?? true);\n outletRef.setInput('closeOnEscape', config.closeOnEscape ?? true);\n if (config.autoFocus) {\n outletRef.setInput('autoFocus', config.autoFocus);\n }\n\n // Attach to ApplicationRef so change detection runs\n this.appRef.attachView(outletRef.hostView);\n\n const hostEl = outletRef.location.nativeElement as HTMLElement;\n this.doc.body.appendChild(hostEl);\n\n const innerDialog = outletRef.instance.dialog() as DialogRef<T>;\n\n const outletVcr = outletRef.instance.contentOutlet();\n let contentRef: ComponentRef<unknown> | null = null;\n\n const childInjector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: DIALOG_REF, useValue: innerDialog },\n { provide: CNGX_DIALOG_DATA, useValue: config.data ?? null },\n ],\n });\n\n if (outletVcr) {\n if (typeof content === 'function') {\n contentRef = outletVcr.createComponent(content, {\n injector: childInjector,\n });\n } else {\n outletVcr.createEmbeddedView(\n content,\n { $implicit: innerDialog },\n { injector: childInjector },\n );\n }\n }\n\n const dialogRef = new CngxDialogRef<T>(innerDialog, outletRef, contentRef, this.injector);\n\n this.openDialogs.push(dialogRef as CngxDialogRef<unknown>);\n\n // CngxDialog has open() but the DialogRef<T> interface does not - call the concrete instance.\n const dialogInstance = outletRef.instance.dialog();\n dialogInstance.open();\n\n effect(\n () => {\n if (\n innerDialog.lifecycle() === 'closed' &&\n outletRef.hostView &&\n !outletRef.hostView.destroyed\n ) {\n this.cleanup(dialogRef);\n }\n },\n { injector: childInjector },\n );\n\n return dialogRef;\n }\n\n /**\n * Dismiss all programmatically opened dialogs.\n *\n * Calls `dismiss()` on each open dialog in reverse order (most recent first).\n * Useful for route guards or global teardown.\n */\n closeAll(): void {\n for (const ref of [...this.openDialogs]) {\n ref.dismiss();\n }\n }\n\n private cleanup(ref: CngxDialogRef<unknown>): void {\n const idx = this.openDialogs.indexOf(ref);\n if (idx >= 0) {\n this.openDialogs.splice(idx, 1);\n }\n\n if (ref.componentRef && !ref.componentRef.hostView.destroyed) {\n ref.componentRef.destroy();\n }\n\n const outletRef = ref._outletRef;\n if (outletRef && !outletRef.hostView.destroyed) {\n this.appRef.detachView(outletRef.hostView);\n (outletRef.location.nativeElement as HTMLElement).remove();\n outletRef.destroy();\n }\n }\n}\n\n/**\n * Provide `CngxDialogOpener` for programmatic dialog opening.\n *\n * Must be called in the application's `providers` array or a route's\n * `providers` for `CngxDialogOpener` to be injectable.\n *\n * ```typescript\n * bootstrapApplication(AppComponent, {\n * providers: [provideDialog()],\n * });\n * ```\n *\n * @category common/dialog\n */\nexport function provideDialog(): Provider[] {\n return [CngxDialogOpener];\n}\n","import { DestroyRef, Directive, inject, input } from '@angular/core';\nimport { CngxSwipeDismiss } from '@cngx/common/interactive';\n\nimport { DIALOG_REF } from '../dialog/dialog-ref';\n\n/**\n * Bottom sheet molecule - a `CngxDialog` positioned at the viewport bottom\n * with swipe-to-dismiss support.\n *\n * Place on the same `<dialog>` element alongside `cngxDialog`. Adds the\n * `cngx-bottom-sheet` CSS class (styled by `bottom-sheet-theme.scss`).\n * When `CngxSwipeDismiss` is also present, auto-wires the swipe output\n * to `dialogRef.dismiss()` - no manual `(swiped)` binding needed.\n *\n * ### Basic bottom sheet\n * ```html\n * <dialog cngxDialog cngxBottomSheet [cngxSwipeDismiss]=\"'down'\"\n * #sheet=\"cngxDialog\">\n * <h2 cngxDialogTitle>Share</h2>\n * <button [cngxDialogClose]=\"'copy'\">Copy Link</button>\n * <button [cngxDialogClose]=\"'email'\">Email</button>\n * <button cngxDialogClose>Cancel</button>\n * </dialog>\n * <button (click)=\"sheet.open()\">Share</button>\n * ```\n *\n * ### Without swipe (static bottom sheet)\n * ```html\n * <dialog cngxDialog cngxBottomSheet #sheet=\"cngxDialog\">\n * <p>Content positioned at the bottom.</p>\n * </dialog>\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/bottom-sheet/bottom-sheet.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxSwipeDismiss, CngxDialogClose\n */\n@Directive({\n selector: 'dialog[cngxBottomSheet]',\n exportAs: 'cngxBottomSheet',\n standalone: true,\n host: {\n class: 'cngx-bottom-sheet',\n },\n})\nexport class CngxBottomSheet {\n private readonly dialogRef = inject(DIALOG_REF);\n private readonly swipe = inject(CngxSwipeDismiss, { self: true, optional: true });\n\n /**\n * Whether the drag handle bar is visible.\n *\n * The handle itself is rendered via CSS (`::before` pseudo-element on the host).\n * Set to `false` to hide it.\n *\n * @defaultValue `true`\n */\n readonly showHandle = input(true);\n\n constructor() {\n if (this.swipe) {\n const sub = this.swipe.swiped.subscribe(() => this.dialogRef.dismiss());\n inject(DestroyRef).onDestroy(() => sub.unsubscribe());\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n} from '@angular/core';\n\n/**\n * Opt-in drag behavior for `CngxDialog`.\n *\n * Uses Pointer Events for unified mouse/touch handling. Position is exposed\n * as CSS custom properties `--cngx-dialog-x` and `--cngx-dialog-y` - the\n * consumer applies the transform via CSS.\n *\n * Keyboard-based moving is mandatory for accessibility:\n * - Arrow keys move 10px\n * - Shift + Arrow moves 50px\n * - Home resets to origin\n *\n * ```html\n * <dialog cngxDialog cngxDialogDraggable>\n * <div class=\"dialog-header\" #handle>Title</div>\n * …\n * </dialog>\n * ```\n *\n * ```css\n * dialog[cngxDialogDraggable] {\n * transform: translate(var(--cngx-dialog-x, 0px), var(--cngx-dialog-y, 0px));\n * }\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/draggable/dialog-draggable.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxBottomSheet\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Directive({\n selector: '[cngxDialogDraggable]',\n exportAs: 'cngxDialogDraggable',\n standalone: true,\n host: {\n '[style.--cngx-dialog-x]': 'cssX()',\n '[style.--cngx-dialog-y]': 'cssY()',\n '[class.cngx-dialog--dragging]': 'isDragging()',\n },\n})\nexport class CngxDialogDraggable {\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Handle element for initiating drag. If not set, entire dialog is the handle. */\n readonly handle = input<HTMLElement | undefined>(undefined);\n\n /** Clamp position to viewport bounds. */\n readonly constrainToViewport = input(false);\n\n /**\n * Snap position to a grid in pixels.\n *\n * When set to a positive number, the dialog position snaps to the nearest\n * grid increment. When `snapMode` is `'live'`, snapping happens during drag.\n * When `'release'`, position is free during drag and snaps on pointer up.\n *\n * @defaultValue `0` (no grid)\n */\n readonly gridSize = input(0);\n\n /**\n * When to apply grid snapping.\n *\n * - `'live'` - position snaps continuously during drag (default)\n * - `'release'` - position is free during drag, snaps on pointer up\n *\n * @defaultValue `'live'`\n */\n readonly snapMode = input<'live' | 'release'>('live');\n\n private readonly positionState = signal({ x: 0, y: 0 });\n private readonly draggingState = signal(false);\n\n /** Current offset position. */\n readonly position = this.positionState.asReadonly();\n\n /** Whether a drag operation is in progress. */\n readonly isDragging = this.draggingState.asReadonly();\n\n protected readonly cssX = computed(() => `${this.positionState().x}px`);\n protected readonly cssY = computed(() => `${this.positionState().y}px`);\n\n // Drag state - not reactive, perf critical (pointermove runs at framerate).\n private dragStartX = 0;\n private dragStartY = 0;\n private posStartX = 0;\n private posStartY = 0;\n private boundMove: ((e: PointerEvent) => void) | null = null;\n private boundUp: ((e: PointerEvent) => void) | null = null;\n\n constructor() {\n effect(() => {\n const handleEl = this.handle() ?? this.elRef.nativeElement;\n this.setupHandle(handleEl);\n });\n\n this.destroyRef.onDestroy(() => this.cleanup());\n }\n\n private currentHandle: HTMLElement | null = null;\n private boundPointerDown: ((e: PointerEvent) => void) | null = null;\n private boundKeyDown: ((e: KeyboardEvent) => void) | null = null;\n\n /** Attach pointer and keyboard listeners to `el`, cleaning up the previous handle first. */\n private setupHandle(el: HTMLElement): void {\n if (this.currentHandle && this.boundPointerDown) {\n this.currentHandle.removeEventListener('pointerdown', this.boundPointerDown);\n }\n if (this.currentHandle && this.boundKeyDown) {\n this.currentHandle.removeEventListener('keydown', this.boundKeyDown);\n }\n\n this.currentHandle = el;\n\n // A11y: make handle focusable and describe as draggable\n if (!el.hasAttribute('tabindex') && el !== this.elRef.nativeElement) {\n el.setAttribute('tabindex', '0');\n }\n if (!el.hasAttribute('aria-roledescription') && el !== this.elRef.nativeElement) {\n el.setAttribute('aria-roledescription', 'draggable');\n el.setAttribute('aria-label', 'Move dialog');\n }\n el.style.cursor = 'var(--cngx-dialog-drag-cursor, grab)';\n el.style.touchAction = 'none';\n\n this.boundPointerDown = (e: PointerEvent) => this.handlePointerDown(e);\n this.boundKeyDown = (e: KeyboardEvent) => this.handleKeyDown(e);\n el.addEventListener('pointerdown', this.boundPointerDown);\n el.addEventListener('keydown', this.boundKeyDown);\n }\n\n private handlePointerDown(event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n\n // Don't drag if the target is an interactive element inside the handle\n const target = event.target as HTMLElement;\n if (\n target.closest('button, a, input, select, textarea, [tabindex]') &&\n target !== this.currentHandle\n ) {\n return;\n }\n\n event.preventDefault();\n (this.currentHandle ?? this.elRef.nativeElement).setPointerCapture(event.pointerId);\n\n this.dragStartX = event.clientX;\n this.dragStartY = event.clientY;\n this.posStartX = this.positionState().x;\n this.posStartY = this.positionState().y;\n this.draggingState.set(true);\n\n // Prevent text selection during drag\n this.doc.documentElement.style.userSelect = 'none';\n if (this.currentHandle) {\n this.currentHandle.style.cursor = 'var(--cngx-dialog-dragging-cursor, grabbing)';\n }\n\n this.boundMove = (e: PointerEvent) => this.handlePointerMove(e);\n this.boundUp = (e: PointerEvent) => this.handlePointerUp(e);\n this.doc.addEventListener('pointermove', this.boundMove);\n this.doc.addEventListener('pointerup', this.boundUp);\n }\n\n private handlePointerMove(event: PointerEvent): void {\n let x = this.posStartX + (event.clientX - this.dragStartX);\n let y = this.posStartY + (event.clientY - this.dragStartY);\n\n if (this.constrainToViewport()) {\n const win = this.doc.defaultView;\n if (win) {\n const rect = this.elRef.nativeElement.getBoundingClientRect();\n const baseX = rect.left - this.positionState().x;\n const baseY = rect.top - this.positionState().y;\n\n x = Math.max(-baseX, Math.min(x, win.innerWidth - baseX - rect.width));\n y = Math.max(-baseY, Math.min(y, win.innerHeight - baseY - rect.height));\n }\n }\n\n if (this.gridSize() > 0 && this.snapMode() === 'live') {\n ({ x, y } = this.snap(x, y));\n }\n\n this.positionState.set({ x, y });\n }\n\n private handlePointerUp(event: PointerEvent): void {\n (this.currentHandle ?? this.elRef.nativeElement).releasePointerCapture(event.pointerId);\n this.draggingState.set(false);\n this.doc.documentElement.style.userSelect = '';\n if (this.currentHandle) {\n this.currentHandle.style.cursor = 'var(--cngx-dialog-drag-cursor, grab)';\n }\n\n if (this.gridSize() > 0 && this.snapMode() === 'release') {\n const { x, y } = this.positionState();\n this.positionState.set(this.snap(x, y));\n }\n\n if (this.boundMove) {\n this.doc.removeEventListener('pointermove', this.boundMove);\n }\n if (this.boundUp) {\n this.doc.removeEventListener('pointerup', this.boundUp);\n }\n this.boundMove = null;\n this.boundUp = null;\n }\n\n private handleKeyDown(event: KeyboardEvent): void {\n const grid = this.gridSize();\n // When grid is active, Arrow keys step by grid size (Shift = 5x grid)\n const step = grid > 0 ? (event.shiftKey ? grid * 5 : grid) : event.shiftKey ? 50 : 10;\n const { x, y } = this.positionState();\n\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault();\n this.positionState.set(this.snap(x - step, y));\n break;\n case 'ArrowRight':\n event.preventDefault();\n this.positionState.set(this.snap(x + step, y));\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.positionState.set(this.snap(x, y - step));\n break;\n case 'ArrowDown':\n event.preventDefault();\n this.positionState.set(this.snap(x, y + step));\n break;\n case 'Home':\n event.preventDefault();\n this.positionState.set({ x: 0, y: 0 });\n break;\n }\n }\n\n /** Snap `x`/`y` to the nearest `gridSize` increment. Pass-through when grid is disabled. */\n private snap(x: number, y: number): { x: number; y: number } {\n const grid = this.gridSize();\n if (grid <= 0) {\n return { x, y };\n }\n return {\n x: Math.round(x / grid) * grid,\n y: Math.round(y / grid) * grid,\n };\n }\n\n private cleanup(): void {\n if (this.boundMove) {\n this.doc.removeEventListener('pointermove', this.boundMove);\n }\n if (this.boundUp) {\n this.doc.removeEventListener('pointerup', this.boundUp);\n }\n if (this.currentHandle && this.boundPointerDown) {\n this.currentHandle.removeEventListener('pointerdown', this.boundPointerDown);\n }\n if (this.currentHandle && this.boundKeyDown) {\n this.currentHandle.removeEventListener('keydown', this.boundKeyDown);\n }\n }\n}\n","/**\n * @module @cngx/common/dialog\n */\nexport { type DialogRef, type DialogState, DIALOG_REF } from './dialog/dialog-ref';\nexport { CngxDialog } from './dialog/dialog.directive';\nexport { CngxDialogTitle } from './dialog/dialog-title.directive';\nexport { CngxDialogDescription } from './dialog/dialog-description.directive';\nexport { CngxDialogClose } from './dialog/dialog-close.directive';\nexport { CngxDialogStack, provideDialogStack } from './dialog/dialog-stack';\nexport { CNGX_DIALOG_DATA, type CngxDialogConfig } from './dialog/dialog-config';\nexport { CngxDialogOpener, CngxDialogRef, provideDialog } from './dialog/dialog.service';\nexport { CngxBottomSheet } from './bottom-sheet/bottom-sheet.directive';\nexport { CngxDialogDraggable } from './draggable/dialog-draggable.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAoDA;;;;;;AAMG;MACU,UAAU,GAAG,IAAI,cAAc,CAAY,eAAe;;ACzDvE;;;;;;;;;;;;;;;;;;;;;;AAsBG;MAEU,eAAe,CAAA;AACT,IAAA,UAAU,GAAG,MAAM,CAAoB,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AQ,EAAE,uBAAuB;AACjC,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACJ,wBAAA,yBAAyB,EAAE,QAAQ;AACnC,wBAAA,yBAAyB,EAAE,QAAQ;AACnC,wBAAA,+BAA+B,EAAE,cAAc;AAChD,qBAAA;AACF,iBAAA;;;AC/DD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cngx-common-dialog.mjs","sources":["../../../projects/common/dialog/dialog/dialog-ref.ts","../../../projects/common/dialog/dialog/dialog-aria-registry.ts","../../../projects/common/dialog/dialog/dialog-stack.ts","../../../projects/common/dialog/dialog/dialog-title.directive.ts","../../../projects/common/dialog/dialog/dialog-description.directive.ts","../../../projects/common/dialog/dialog/sr-only.ts","../../../projects/common/dialog/dialog/dialog.directive.ts","../../../projects/common/dialog/dialog/dialog-close.directive.ts","../../../projects/common/dialog/dialog/dialog-config.ts","../../../projects/common/dialog/dialog/dialog-outlet.ts","../../../projects/common/dialog/dialog/dialog.service.ts","../../../projects/common/dialog/bottom-sheet/bottom-sheet.directive.ts","../../../projects/common/dialog/draggable/dialog-draggable.directive.ts","../../../projects/common/dialog/public-api.ts","../../../projects/common/dialog/cngx-common-dialog.ts"],"sourcesContent":["import { InjectionToken, type Signal } from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Lifecycle states of a `CngxDialog`.\n *\n * @category common/dialog\n */\nexport type DialogState = 'closed' | 'opening' | 'open' | 'closing';\n\n/**\n * Signal-based dialog reference.\n *\n * - **Outside** (parent template): access via `exportAs` - `#dlg=\"cngxDialog\"`\n * - **Inside** (dialog content): access via DI - `inject(DIALOG_REF)`\n *\n * @category common/dialog\n */\nexport interface DialogRef<T = unknown> {\n /** Current lifecycle state of the dialog. */\n readonly lifecycle: Signal<DialogState>;\n\n /**\n * The typed result of the dialog.\n *\n * - `undefined` before the dialog closes (reset on each `open()`)\n * - `'dismissed'` when dismissed via Escape or backdrop click\n * - `T` when closed with an explicit value\n */\n readonly result: Signal<T | 'dismissed' | undefined>;\n\n /** Unique ID of this dialog instance. */\n readonly id: Signal<string>;\n\n /**\n * Async state of the submit channel.\n *\n * Populated when `[submitAction]` is set - tracks the submit lifecycle\n * (`idle` -> `pending` -> `success`/`error`). When `submitAction` is not set,\n * this is a static idle state.\n *\n * Bind to any state consumer: `<cngx-alert [state]=\"dlg.submitState\" />`.\n */\n readonly submitState: CngxAsyncState<unknown>;\n\n /** Close the dialog with a typed result value. */\n close(value: T): void;\n\n /** Dismiss the dialog without a result (Escape / backdrop). */\n dismiss(): void;\n}\n\n/**\n * Injection token to access the nearest `DialogRef` from inside a dialog.\n *\n * @category common/dialog\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-ref.ts\n * @since 0.1.0\n */\nexport const DIALOG_REF = new InjectionToken<DialogRef>('CngxDialogRef');\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Labelling handle a title or description source registers with the\n * dialog's ARIA registry.\n *\n * `id` feeds the dialog's `aria-labelledby` / `aria-describedby`\n * derivation; `textContent` (title only) is read at announce time so the\n * live region speaks the current DOM text, not a cached first read.\n */\nexport interface DialogLabelHandle {\n /** Element id referenced from the dialog host's ARIA attributes. */\n readonly id: Signal<string>;\n\n /** Fresh text read for the open announce. Optional - descriptions are never announced. */\n readonly textContent?: () => string;\n}\n\n/**\n * Registration contract between `CngxDialog` and its labelling sources.\n *\n * Content queries only see nodes declared in the projection template, so a\n * programmatically opened dialog (content created into the outlet's\n * `ViewContainerRef`) is invisible to `contentChild()`. Sources therefore\n * push their handles through this token instead of being pulled by query -\n * the same inversion as `CNGX_POPOVER_ARROW_BOUNDS`.\n *\n * `CngxDialog` provides the token via `useExisting` and stays the single\n * owner of the `aria-describedby` derivation: directives sharing the dialog\n * host must never bind `attr.aria-describedby` themselves (two host\n * bindings on one attribute clobber each other) - they register an id here\n * and the dialog merges it.\n *\n * Each `register*` call returns a release function (single-slot per kind:\n * one title, one description, N anonymous describedby ids) - tie it to\n * `DestroyRef.onDestroy`.\n *\n * Internal contract - intentionally not exported from `public-api.ts`.\n */\nexport interface CngxDialogAriaRegistry {\n /** Register the labelling source for `aria-labelledby` and the open announce. */\n registerTitle(handle: DialogLabelHandle): () => void;\n\n /** Register the primary description source for `aria-describedby`. */\n registerDescription(handle: DialogLabelHandle): () => void;\n\n /**\n * Register a supplemental `aria-describedby` id (e.g. an interaction\n * instruction). Accepts a plain string for ids that are fixed for the\n * registration's lifetime; pass a signal only when the id itself changes.\n */\n registerDescribedBy(id: string | Signal<string>): () => void;\n}\n\n/**\n * Injection token for the dialog ARIA registry.\n *\n * Provided by `CngxDialog` (`useExisting`) on the dialog element and by\n * `CngxDialogOpener` on the programmatic content's child injector.\n */\nexport const CNGX_DIALOG_ARIA_REGISTRY = new InjectionToken<CngxDialogAriaRegistry>(\n 'CngxDialogAriaRegistry',\n);\n","import { computed, Injectable, signal, type Provider } from '@angular/core';\n\n/**\n * Tracks open dialog instances as a stack for backdrop management.\n *\n * Provided in root - always available, no manual provider setup needed.\n * When multiple modal dialogs are stacked, only the topmost shows\n * its `::backdrop`. Each `CngxDialog` reads `isTopmost` from this service\n * to control `--cngx-dialog-backdrop-opacity`.\n *\n * @category common/dialog\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-stack.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxDialogOpener\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Injectable({ providedIn: 'root' })\nexport class CngxDialogStack {\n private readonly stackState = signal<readonly string[]>([]);\n\n /** Readonly snapshot of the current stack (bottom → top). */\n readonly stack = this.stackState.asReadonly();\n\n /** ID of the topmost (most recently opened) dialog, or `null`. */\n readonly topmost = computed(() => this.stackState().at(-1) ?? null);\n\n /** Push a dialog ID onto the stack (called on open). */\n push(id: string): void {\n this.stackState.update((s) => [...s, id]);\n }\n\n /** Remove a dialog ID from the stack (called on close). */\n pop(id: string): void {\n this.stackState.update((s) => s.filter((x) => x !== id));\n }\n}\n\n/**\n * Provide a scoped `CngxDialogStack` instance for nested dialog backdrop management.\n *\n * By default, `CngxDialogStack` is `providedIn: 'root'`, so all dialogs share\n * one stack. Call `provideDialogStack()` in a component's `providers` array to\n * create an isolated stack scope (e.g., for a sub-application or dialog group).\n *\n * ```typescript\n * @Component({\n * providers: [provideDialogStack()],\n * })\n * export class NestedDialogHost { }\n * ```\n *\n * @category common/dialog\n */\nexport function provideDialogStack(): Provider {\n return CngxDialogStack;\n}\n","import { DestroyRef, Directive, ElementRef, inject, signal } from '@angular/core';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_DIALOG_ARIA_REGISTRY } from './dialog-aria-registry';\nimport { DIALOG_REF } from './dialog-ref';\n\n/**\n * Marks an element as the dialog's title for ARIA labelling.\n *\n * Automatically generates a deterministic ID and registers with the\n * parent `CngxDialog` for `aria-labelledby`. The title text is also\n * announced via `aria-live` when the dialog transitions to `'open'`.\n *\n * ```html\n * <dialog cngxDialog>\n * <h2 cngxDialogTitle>Confirm Delete</h2>\n * …\n * </dialog>\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-title.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxDialogDescription, CngxDialogClose\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Directive({\n selector: '[cngxDialogTitle]',\n exportAs: 'cngxDialogTitle',\n standalone: true,\n host: {\n '[id]': 'id()',\n },\n})\nexport class CngxDialogTitle {\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly dialogRef = inject(DIALOG_REF, { optional: true });\n private readonly ariaRegistry = inject(CNGX_DIALOG_ARIA_REGISTRY, { optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly idState = signal(nextUid('cngx-dialog-title'));\n\n /**\n * Auto-generated unique ID bound to the host `[id]` attribute.\n *\n * Used by `CngxDialog` for `aria-labelledby`. When a parent `CngxDialog`\n * is present, the ID is derived from the dialog's ID (e.g. `cngx-dialog-0-title`).\n * Read-only: an externally mutated id would silently break the ARIA wiring.\n */\n readonly id = this.idState.asReadonly();\n\n /**\n * Text content of the title element, read fresh on every call.\n *\n * Read by `CngxDialog` at announce time (each `'open'` transition) so a\n * changed title - translation swap, interpolated data - is what screen\n * readers hear. A `computed` would cache the first non-reactive DOM read\n * forever.\n */\n readonly textContent = (): string => this.elRef.nativeElement.textContent?.trim() ?? '';\n\n constructor() {\n if (this.dialogRef) {\n this.idState.set(`${this.dialogRef.id()}-title`);\n }\n // Push registration: content queries cannot see dynamically created\n // views, so programmatic dialogs rely on this channel exclusively.\n if (this.ariaRegistry) {\n this.destroyRef.onDestroy(this.ariaRegistry.registerTitle(this));\n }\n }\n}\n","import { DestroyRef, Directive, inject, signal } from '@angular/core';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_DIALOG_ARIA_REGISTRY } from './dialog-aria-registry';\nimport { DIALOG_REF } from './dialog-ref';\n\n/**\n * Marks an element as the dialog's description for ARIA.\n *\n * Automatically generates a deterministic ID and registers with the\n * parent `CngxDialog` for `aria-describedby`.\n *\n * ```html\n * <dialog cngxDialog>\n * <h2 cngxDialogTitle>Delete item?</h2>\n * <p cngxDialogDescription>This action cannot be undone.</p>\n * …\n * </dialog>\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-description.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxDialogTitle, CngxDialogClose\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Directive({\n selector: '[cngxDialogDescription]',\n exportAs: 'cngxDialogDescription',\n standalone: true,\n host: {\n '[id]': 'id()',\n },\n})\nexport class CngxDialogDescription {\n private readonly dialogRef = inject(DIALOG_REF, { optional: true });\n private readonly ariaRegistry = inject(CNGX_DIALOG_ARIA_REGISTRY, { optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly idState = signal(nextUid('cngx-dialog-desc'));\n\n /**\n * Auto-generated unique ID bound to the host `[id]` attribute.\n *\n * Used by `CngxDialog` for `aria-describedby`. When a parent `CngxDialog`\n * is present, the ID is derived from the dialog's ID (e.g. `cngx-dialog-0-desc`).\n * Read-only: an externally mutated id would silently break the ARIA wiring.\n */\n readonly id = this.idState.asReadonly();\n\n constructor() {\n if (this.dialogRef) {\n this.idState.set(`${this.dialogRef.id()}-desc`);\n }\n // Push registration: content queries cannot see dynamically created\n // views, so programmatic dialogs rely on this channel exclusively.\n if (this.ariaRegistry) {\n this.destroyRef.onDestroy(this.ariaRegistry.registerDescription(this));\n }\n }\n}\n","/**\n * Apply the visually-hidden (screen-reader-only) recipe to a dynamically\n * created dialog node.\n *\n * Inline styles instead of relying on the `cngx-sr-only` class alone so the\n * live region and the drag instruction stay hidden even when no cngx\n * stylesheet is loaded. The node remains perceivable to AT - describedby\n * targets and live regions must never be `display: none`.\n *\n * Internal helper - intentionally not exported from `public-api.ts`.\n */\nexport function applySrOnly(el: HTMLElement): void {\n el.className = 'cngx-sr-only';\n el.style.position = 'absolute';\n el.style.width = '1px';\n el.style.height = '1px';\n el.style.padding = '0';\n el.style.margin = '-1px';\n el.style.overflow = 'hidden';\n el.style.clip = 'rect(0, 0, 0, 0)';\n el.style.whiteSpace = 'nowrap';\n el.style.border = '0';\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n contentChild,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n Renderer2,\n signal,\n type Signal,\n untracked,\n} from '@angular/core';\n\nimport { buildAsyncStateView, type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\nimport { hasTransition, nextUid, onTransitionDone } from '@cngx/core/utils';\nimport { createScrollLock } from '@cngx/common/layout';\nimport { firstValueFrom, isObservable, type Observable } from 'rxjs';\n\nimport { DIALOG_REF, type DialogRef, type DialogState } from './dialog-ref';\nimport {\n CNGX_DIALOG_ARIA_REGISTRY,\n type CngxDialogAriaRegistry,\n type DialogLabelHandle,\n} from './dialog-aria-registry';\nimport { CngxDialogStack } from './dialog-stack';\nimport { CngxDialogTitle } from './dialog-title.directive';\nimport { CngxDialogDescription } from './dialog-description.directive';\nimport { applySrOnly } from './sr-only';\n\n/**\n * Signal-driven state machine for native `<dialog>`.\n *\n * Wraps the browser's `<dialog>` element with reactive state, typed results,\n * deterministic focus management, and full ARIA communication. Supports both\n * modal and non-modal modes, CSS transition-aware open/close lifecycle, and\n * ref-counted scroll locking for stacked modals.\n *\n * The directive implements `DialogRef<T>` and provides itself via `DIALOG_REF`,\n * so child directives (`CngxDialogTitle`, `CngxDialogClose`, etc.) can inject\n * the reference without explicit wiring.\n *\n * State lifecycle: `closed` -> `opening` -> `open` -> `closing` -> `closed`.\n * CSS classes `cngx-dialog--opening`, `cngx-dialog--open`, and\n * `cngx-dialog--closing` are applied to the host for transition hooks.\n *\n * ### Declarative (template-driven)\n * ```html\n * <dialog cngxDialog #dlg=\"cngxDialog\">\n * <h2 cngxDialogTitle>Delete item?</h2>\n * <p cngxDialogDescription>This cannot be undone.</p>\n * <button [cngxDialogClose]=\"false\">Cancel</button>\n * <button [cngxDialogClose]=\"true\">Delete</button>\n * </dialog>\n * <button (click)=\"dlg.open()\">Delete</button>\n *\n * @if (dlg.lifecycle() === 'closed' && dlg.result() === true) {\n * <p>Item deleted.</p>\n * }\n * ```\n *\n * ### Programmatic (via CngxDialogOpener)\n * ```typescript\n * const ref = this.dialogService.open<boolean>(ConfirmDialog, {\n * data: { message: 'Delete item?' },\n * });\n *\n * ref.afterClosed().subscribe(result => {\n * if (result === true) this.delete();\n * });\n * ```\n *\n * ### Non-modal dialog\n * ```html\n * <dialog cngxDialog [modal]=\"false\" #tooltip=\"cngxDialog\">\n * <p>Inline tooltip content</p>\n * </dialog>\n * ```\n *\n * ### Custom focus target\n * ```html\n * <dialog cngxDialog [autoFocus]=\"'#name-input'\">\n * <input id=\"name-input\" />\n * </dialog>\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog.directive.ts\n * @since 0.1.0\n * @relatedTo CngxBottomSheet, CngxDialogOpener, CngxDialogTitle, CngxDialogClose, CngxDialogDraggable\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Directive({\n selector: 'dialog[cngxDialog]',\n exportAs: 'cngxDialog',\n standalone: true,\n providers: [\n { provide: DIALOG_REF, useExisting: CngxDialog },\n { provide: CNGX_DIALOG_ARIA_REGISTRY, useExisting: CngxDialog },\n ],\n host: {\n '[class.cngx-dialog--opening]': 'isOpening()',\n '[class.cngx-dialog--open]': 'isOpen()',\n '[class.cngx-dialog--closing]': 'isClosing()',\n '[class.cngx-dialog--modal]': 'modal()',\n '[attr.aria-modal]': 'ariaModal()',\n '[attr.aria-labelledby]': 'ariaLabelledBy()',\n '[attr.aria-describedby]': 'ariaDescribedBy()',\n '[class.cngx-dialog--pending]': 'isPending()',\n '[attr.aria-busy]': 'isPending() || null',\n '[class.cngx-dialog--error]': 'effectiveError()',\n '[style.--cngx-dialog-backdrop-opacity]': 'backdropOpacity()',\n '(cancel)': 'handleCancel($event)',\n '(pointerdown)': 'handlePointerDown($event)',\n '(click)': 'handleClick($event)',\n },\n})\nexport class CngxDialog<T = unknown> implements DialogRef<T>, CngxDialogAriaRegistry {\n private readonly elRef = inject<ElementRef<HTMLDialogElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly renderer = inject(Renderer2);\n private readonly destroyRef = inject(DestroyRef);\n private readonly dialogStack = inject(CngxDialogStack);\n\n private readonly titleDirective = contentChild(CngxDialogTitle);\n private readonly descriptionDirective = contentChild(CngxDialogDescription);\n\n // Push-registered counterparts of the content queries above. Programmatic\n // content lives in a dynamically created view the queries cannot see, so\n // sources register through CNGX_DIALOG_ARIA_REGISTRY instead.\n private readonly registeredTitle = signal<DialogLabelHandle | null>(null);\n private readonly registeredDescription = signal<DialogLabelHandle | null>(null);\n private readonly supplementalDescribedByIds = signal<readonly (string | Signal<string>)[]>([]);\n\n /**\n * Whether the dialog opens as modal (`showModal()`) or non-modal (`show()`).\n *\n * Modal dialogs block interaction with the rest of the page, acquire a\n * scroll lock, and participate in the `CngxDialogStack` for backdrop\n * management. Non-modal dialogs do not.\n *\n * @defaultValue `true`\n */\n readonly modal = input(true);\n\n /**\n * Whether clicking the backdrop dismisses the dialog.\n *\n * Only applies to modal dialogs. When `true`, a click on the\n * `::backdrop` pseudo-element calls `dismiss()`.\n *\n * @defaultValue `true`\n */\n readonly closeOnBackdropClick = input(true);\n\n /**\n * Whether pressing Escape dismisses the dialog.\n *\n * Only applies to modal dialogs. The native `cancel` event is always\n * prevented; this input controls whether `dismiss()` is called in response.\n *\n * @defaultValue `true`\n */\n readonly closeOnEscape = input(true);\n\n /**\n * Focus strategy applied after the dialog transitions to `'open'`.\n *\n * Only applies to modal dialogs.\n *\n * - `'first-focusable'` -- focus the first `[autofocus]` element, or the\n * first focusable element in DOM order (default)\n * - `'none'` -- do not move focus\n * - Any CSS selector string -- focus the first element matching the selector\n *\n * @defaultValue `'first-focusable'`\n */\n readonly autoFocus = input<'first-focusable' | 'none' | (string & {})>('first-focusable');\n\n /**\n * Fallback element to focus when the original trigger element has been\n * removed from the DOM by the time the dialog closes.\n *\n * When not set and the trigger is gone, no focus return occurs.\n */\n readonly focusFallback = input<HTMLElement | undefined>(undefined);\n\n /**\n * Bind an async state - drives pending (aria-busy, prevents close) and\n * error from a single source. When set, takes precedence over the\n * `[error]` boolean input and `[submitAction]`.\n *\n * When `state.status()` is `'pending'`, the dialog prevents close/dismiss\n * and applies `aria-busy`. When `state.status()` is `'error'`, the dialog\n * applies `cngx-dialog--error` and announces the error via the SR live region.\n */\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /**\n * Async action to execute when `close(value)` is called.\n *\n * Receives the close value as parameter. On success, the dialog auto-closes.\n * On error, the dialog stays open with `cngx-dialog--error` and the error\n * is announced to screen readers.\n *\n * When set, `close(value)` no longer closes immediately - it enters a\n * `submitting` phase (`isPending() = true`, `aria-busy`, close blocked).\n *\n * The submit lifecycle is exposed via `submitState: CngxAsyncState<unknown>`.\n * Ignored when `[state]` input is also set (external state takes precedence).\n */\n readonly submitAction = input<((value: T) => Promise<unknown> | Observable<unknown>) | undefined>(\n undefined,\n );\n\n /**\n * Whether the dialog is in an error state. Fallback when neither `[state]`\n * nor `[submitAction]` is set.\n *\n * When `true`, applies the `cngx-dialog--error` CSS class on the host.\n * Use this to communicate form submission failures or other error\n * conditions visually.\n *\n * Pair with `cngx-form-errors` (`role=\"alert\"`) inside the dialog for\n * WCAG-compliant error announcements.\n *\n * @defaultValue `false`\n */\n readonly error = input(false);\n\n private readonly lifecycleSignal = signal<DialogState>('closed');\n private readonly resultSignal = signal<T | 'dismissed' | undefined>(undefined);\n private readonly idSignal = signal(nextUid('cngx-dialog'));\n private readonly triggerElement = signal<HTMLElement | null>(null);\n\n /**\n * Current lifecycle state of the dialog.\n *\n * Possible values: `'closed'`, `'opening'`, `'open'`, `'closing'`.\n */\n readonly lifecycle = this.lifecycleSignal.asReadonly();\n\n /**\n * The typed result of the dialog.\n *\n * - `undefined` before close (reset on each `open()` call)\n * - `'dismissed'` when dismissed via Escape or backdrop click\n * - `T` when closed with an explicit value via `close(value)`\n */\n readonly result = this.resultSignal.asReadonly();\n\n /** Unique auto-generated ID for this dialog instance. Used for ARIA and stack tracking. */\n readonly id = this.idSignal.asReadonly();\n\n private readonly submitStatusState = signal<AsyncStatus>('idle');\n private readonly submitErrorState = signal<unknown>(undefined);\n\n /**\n * Async state of the submit channel.\n *\n * Populated when `[submitAction]` is set. Tracks `idle` -> `pending` ->\n * `success`/`error`. When `submitAction` is not set, remains at `'idle'`.\n *\n * Bind to any state consumer: `<cngx-alert [state]=\"dlg.submitState\" />`.\n */\n readonly submitState: CngxAsyncState<unknown> = buildAsyncStateView<unknown>({\n status: this.submitStatusState.asReadonly(),\n data: computed(() => undefined),\n error: this.submitErrorState.asReadonly(),\n });\n\n /**\n * `true` when any async operation is pending. Blocks close/dismiss and sets `aria-busy`.\n *\n * External `[state]` short-circuits - when set, `submitAction` is ignored by the\n * `close()` guard (`action && !this.state()`), so `submitStatusState` stays `'idle'`.\n */\n readonly isPending = computed(() => {\n const ext = this.state();\n if (ext) {\n return ext.isPending();\n }\n return this.submitStatusState() === 'pending';\n });\n\n /**\n * Resolved error - external `[state]` takes precedence over submit state,\n * which takes precedence over the boolean `[error]` input.\n */\n protected readonly effectiveError = computed(() => {\n const ext = this.state();\n if (ext) {\n return !!ext.error();\n }\n // Use !== undefined to catch falsy error values (0, '', false)\n if (this.submitErrorState() !== undefined) {\n return true;\n }\n return this.error();\n });\n\n protected readonly isOpening = computed(() => this.lifecycleSignal() === 'opening');\n protected readonly isOpen = computed(() => this.lifecycleSignal() === 'open');\n protected readonly isClosing = computed(() => this.lifecycleSignal() === 'closing');\n\n protected readonly ariaModal = computed(() =>\n this.openedAsModal() && this.lifecycleSignal() !== 'closed' ? 'true' : null,\n );\n\n protected readonly ariaLabelledBy = computed(\n () => (this.titleDirective() ?? this.registeredTitle())?.id() ?? null,\n );\n\n protected readonly ariaDescribedBy = computed(() => {\n const ids: string[] = [];\n\n const descriptionId = (this.descriptionDirective() ?? this.registeredDescription())?.id();\n if (descriptionId) {\n ids.push(descriptionId);\n }\n for (const id of this.supplementalDescribedByIds()) {\n ids.push(typeof id === 'string' ? id : id());\n }\n\n return ids.length > 0 ? ids.join(' ') : null;\n });\n\n protected readonly backdropOpacity = computed(() =>\n this.dialogStack.topmost() === this.idSignal() ? '1' : '0',\n );\n\n private liveRegion: HTMLSpanElement | null = null;\n\n /**\n * The modal mode latched at `open()`. Everything that depends on how the\n * dialog actually opened derives from this - scroll-lock release, stack\n * pop, Escape/backdrop dismissal, focus strategy, and `aria-modal` -\n * so toggling `[modal]` while open can neither unbalance the ref count\n * nor strand a rendered backdrop without its dismissal surface.\n */\n private readonly openedAsModal = signal(false);\n\n constructor() {\n this.createLiveRegion();\n\n effect(() => {\n if (this.lifecycleSignal() === 'open') {\n const titleText = untracked(\n () => (this.titleDirective() ?? this.registeredTitle())?.textContent?.() ?? '',\n );\n if (titleText && this.liveRegion) {\n this.liveRegion.textContent = titleText;\n // Clear after one frame so subsequent opens re-announce\n requestAnimationFrame(() => {\n if (this.liveRegion) {\n this.liveRegion.textContent = '';\n }\n });\n }\n }\n });\n\n effect(() => {\n // The error VALUE is the announce trigger and stays tracked: the\n // boolean effectiveError() alone is equal-cut on true -> false -> true,\n // so a retried identical failure would never re-fire this effect.\n if (this.effectiveError() && this.liveRegion) {\n const errMsg = this.state()?.error() ?? this.submitErrorState();\n this.liveRegion.textContent = typeof errMsg === 'string' ? errMsg : 'An error occurred';\n // Clear after one frame (same pattern as the title announce) so a\n // repeated identical error is a fresh mutation the SR re-announces.\n requestAnimationFrame(() => {\n if (this.liveRegion) {\n this.liveRegion.textContent = '';\n }\n });\n }\n });\n\n this.destroyRef.onDestroy(() => {\n if (this.lifecycleSignal() !== 'closed') {\n this.finalize();\n }\n });\n }\n\n /**\n * Register the labelling source for `aria-labelledby` and the open announce.\n *\n * A present content-queried title wins over the registered handle (same\n * directive in the declarative case - identical id either way).\n *\n * @internal CNGX_DIALOG_ARIA_REGISTRY implementation - not public API.\n */\n registerTitle(handle: DialogLabelHandle): () => void {\n this.warnDoubleRegistration('title', untracked(this.registeredTitle), handle);\n this.registeredTitle.set(handle);\n return () =>\n this.registeredTitle.update((current) => (current === handle ? null : current));\n }\n\n /**\n * Register the primary description source for `aria-describedby`.\n *\n * @internal CNGX_DIALOG_ARIA_REGISTRY implementation - not public API.\n */\n registerDescription(handle: DialogLabelHandle): () => void {\n this.warnDoubleRegistration('description', untracked(this.registeredDescription), handle);\n this.registeredDescription.set(handle);\n return () =>\n this.registeredDescription.update((current) => (current === handle ? null : current));\n }\n\n /**\n * Register a supplemental `aria-describedby` id, merged after the\n * description id in registration order.\n *\n * @internal CNGX_DIALOG_ARIA_REGISTRY implementation - not public API.\n */\n registerDescribedBy(id: string | Signal<string>): () => void {\n this.supplementalDescribedByIds.update((ids) => [...ids, id]);\n return () => this.supplementalDescribedByIds.update((ids) => ids.filter((x) => x !== id));\n }\n\n /**\n * Open the dialog.\n *\n * Resets the result from any previous open/close cycle, stores the\n * currently focused element for focus return, and calls the native\n * `showModal()` or `show()` depending on the `modal` input.\n *\n * No-op if the dialog is already open or in a transition state.\n */\n open(): void {\n if (this.lifecycleSignal() !== 'closed') {\n return;\n }\n\n const dialog = this.dialogElement;\n\n this.resultSignal.set(undefined);\n this.submitStatusState.set('idle');\n this.submitErrorState.set(undefined);\n\n this.triggerElement.set(this.doc.activeElement as HTMLElement | null);\n\n this.lifecycleSignal.set('opening');\n\n this.openedAsModal.set(this.modal());\n if (this.openedAsModal()) {\n dialog.showModal();\n this.acquireScrollLock();\n this.dialogStack.push(this.idSignal());\n } else {\n dialog.show();\n this.warnNonModalA11y();\n }\n\n // Transition to open after browser paints the opening class\n requestAnimationFrame(() => {\n if (this.lifecycleSignal() !== 'opening') {\n return;\n }\n this.lifecycleSignal.set('open');\n this.moveFocus();\n });\n }\n\n /**\n * Close the dialog with a typed result.\n *\n * When `[submitAction]` is set and `[state]` is not set, executes the action\n * with `value` before closing. The dialog enters a submitting phase\n * (`isPending() = true`) - on success it auto-closes, on error it stays open.\n *\n * When `[submitAction]` is not set (or `[state]` overrides), closes immediately.\n *\n * No-op if the dialog is not in the `'open'` or `'opening'` state, or if\n * already pending.\n *\n * @param value - The typed result to deliver to consumers.\n */\n close(value: T): void {\n if (this.lifecycleSignal() !== 'open' && this.lifecycleSignal() !== 'opening') {\n return;\n }\n if (this.isPending()) {\n return;\n }\n\n const action = this.submitAction();\n if (action && !this.state()) {\n void this.executeSubmit(action, value);\n } else {\n this.resultSignal.set(value);\n this.startClosing();\n }\n }\n\n /**\n * Dismiss the dialog without a typed result.\n *\n * Sets `result` to `'dismissed'`, then initiates the closing transition.\n * Typically triggered by Escape key or backdrop click, but can be called\n * directly. No-op if the dialog is not in the `'open'` or `'opening'` state.\n */\n dismiss(): void {\n if (this.lifecycleSignal() !== 'open' && this.lifecycleSignal() !== 'opening') {\n return;\n }\n if (this.isPending()) {\n return;\n }\n this.resultSignal.set('dismissed');\n this.startClosing();\n }\n\n private async executeSubmit(\n action: (value: T) => Promise<unknown> | Observable<unknown>,\n value: T,\n ): Promise<void> {\n this.submitStatusState.set('pending');\n this.submitErrorState.set(undefined);\n\n try {\n const result$ = action(value);\n const promise = isObservable(result$)\n ? firstValueFrom(result$, { defaultValue: undefined })\n : result$;\n await promise;\n\n // Guard against post-destroy signal writes\n if (this.lifecycleSignal() === 'closed') {\n return;\n }\n\n this.submitStatusState.set('success');\n this.resultSignal.set(value);\n this.startClosing();\n } catch (err: unknown) {\n // Guard against post-destroy signal writes\n if (this.lifecycleSignal() === 'closed') {\n return;\n }\n\n this.submitStatusState.set('error');\n this.submitErrorState.set(err);\n }\n }\n\n protected handleCancel(event: Event): void {\n event.preventDefault();\n if (this.closeOnEscape() && this.openedAsModal()) {\n this.dismiss();\n }\n }\n\n /**\n * `true` when the last pointerdown landed on the backdrop (the dialog\n * element itself, outside the content rect). Backdrop dismissal requires\n * the interaction to START there: a text-selection drag that begins inside\n * the content and releases over the backdrop synthesises a click with\n * outside coordinates and must not dismiss.\n */\n private pointerDownOnBackdrop = false;\n\n protected handlePointerDown(event: PointerEvent): void {\n this.pointerDownOnBackdrop =\n event.target === this.dialogElement && this.isOutsideContentRect(event.clientX, event.clientY);\n }\n\n protected handleClick(event: MouseEvent): void {\n const startedOnBackdrop = this.pointerDownOnBackdrop;\n this.pointerDownOnBackdrop = false;\n\n if (!this.openedAsModal() || !this.closeOnBackdropClick()) {\n return;\n }\n if (this.lifecycleSignal() !== 'open') {\n return;\n }\n // Keyboard \"clicks\" (Enter/Space on a child control) report (0, 0)\n // coordinates - the target guard rejects them because they target the\n // control, never the dialog element itself.\n if (event.target !== this.dialogElement || !startedOnBackdrop) {\n return;\n }\n if (this.isOutsideContentRect(event.clientX, event.clientY)) {\n this.dismiss();\n }\n }\n\n /** Backdrop test: coordinates outside the dialog's content rect. */\n private isOutsideContentRect(x: number, y: number): boolean {\n const rect = this.dialogElement.getBoundingClientRect();\n return x < rect.left || x > rect.right || y < rect.top || y > rect.bottom;\n }\n\n private get dialogElement(): HTMLDialogElement {\n return this.elRef.nativeElement;\n }\n\n private startClosing(): void {\n if (hasTransition(this.dialogElement)) {\n this.lifecycleSignal.set('closing');\n onTransitionDone(this.dialogElement, () => this.finalize());\n } else {\n this.finalize();\n }\n }\n\n private finalize(): void {\n const dialog = this.dialogElement;\n\n if (dialog.open) {\n dialog.close();\n }\n\n if (this.openedAsModal()) {\n this.releaseScrollLock();\n this.dialogStack.pop(this.idSignal());\n this.openedAsModal.set(false);\n }\n\n this.lifecycleSignal.set('closed');\n this.returnFocus();\n }\n\n private moveFocus(): void {\n if (!this.openedAsModal()) {\n return;\n }\n\n const strategy = this.autoFocus();\n const dialog = this.dialogElement;\n\n if (strategy === 'none') {\n return;\n }\n\n if (strategy === 'first-focusable') {\n // Native dialog with autofocus attribute works; otherwise focus first focusable\n const autofocusEl = dialog.querySelector<HTMLElement>('[autofocus]');\n if (autofocusEl) {\n autofocusEl.focus();\n return;\n }\n\n const focusable = dialog.querySelector<HTMLElement>(\n 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n );\n focusable?.focus();\n } else {\n const target = dialog.querySelector<HTMLElement>(strategy);\n target?.focus();\n }\n }\n\n private returnFocus(): void {\n const trigger = this.triggerElement();\n\n if (trigger?.isConnected) {\n trigger.focus();\n } else {\n const fallback = this.focusFallback();\n fallback?.focus();\n }\n\n this.triggerElement.set(null);\n }\n\n private createLiveRegion(): void {\n const span = this.renderer.createElement('span') as HTMLSpanElement;\n span.setAttribute('aria-live', 'polite');\n span.setAttribute('aria-atomic', 'true');\n applySrOnly(span);\n this.renderer.appendChild(this.dialogElement, span);\n this.liveRegion = span;\n }\n\n /**\n * Release function of the currently held scroll lock, `null` while not\n * locked. The shared `createScrollLock` core (single WeakMap owner in\n * `@cngx/common/layout`) keeps this instance's count in the same registry\n * as `CngxScrollLock`, so interleaved dialog + directive locks restore the\n * saved overflow values correctly.\n */\n private scrollLockRelease: (() => void) | null = null;\n\n private acquireScrollLock(): void {\n this.scrollLockRelease ??= createScrollLock(this.doc.documentElement);\n }\n\n private releaseScrollLock(): void {\n this.scrollLockRelease?.();\n this.scrollLockRelease = null;\n }\n\n /**\n * The registry is single-slot per kind, so a second live registration\n * silently wins - surface the authoring error instead of letting the\n * two open paths resolve different labelling.\n */\n private warnDoubleRegistration(\n kind: 'title' | 'description',\n current: DialogLabelHandle | null,\n next: DialogLabelHandle,\n ): void {\n if (!isDevMode() || current === null || current === next) {\n return;\n }\n console.warn(\n `CngxDialog [${this.idSignal()}]: a second ${kind} registered while another ` +\n `is live. The dialog references one ${kind} id - the newest registration ` +\n `wins. Remove the extra cngxDialog${kind === 'title' ? 'Title' : 'Description'} element.`,\n );\n }\n\n private warnNonModalA11y(): void {\n if (!isDevMode()) {\n return;\n }\n\n // Non-modal dialogs are silent to SR. Warn if no aria-live sibling found.\n const trigger = this.triggerElement();\n if (trigger) {\n const parent = trigger.parentElement;\n if (parent && !parent.querySelector('[aria-live]')) {\n console.warn(\n `CngxDialog [${this.idSignal()}]: Non-modal dialog opened without an ` +\n '`aria-live` region near the trigger. Screen reader users will not ' +\n 'be notified that the dialog appeared. Add `aria-live=\"polite\"` to a ' +\n 'sibling element that announces the dialog presence.',\n );\n }\n }\n }\n}\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { DIALOG_REF } from './dialog-ref';\n\n/**\n * Close trigger for a dialog. Place on any clickable element inside a dialog.\n *\n * - With a value: `[cngxDialogClose]=\"'confirm'\"` calls `dialogRef.close(value)`\n * - Without a value: `cngxDialogClose` calls `dialogRef.dismiss()`\n *\n * Automatically sets `type=\"button\"` on `<button>` hosts to prevent\n * accidental form submission. Sets a default `aria-label=\"Close dialog\"`\n * when the host has no descriptive text content (icon-only buttons).\n *\n * ```html\n * <dialog cngxDialog>\n * <button [cngxDialogClose]=\"false\">Cancel</button>\n * <button [cngxDialogClose]=\"true\">Confirm</button>\n * </dialog>\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-close.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxDialogTitle, CngxDialogDescription\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Directive({\n selector: '[cngxDialogClose]',\n exportAs: 'cngxDialogClose',\n standalone: true,\n host: {\n '(click)': 'handleClick()',\n '[attr.type]': 'hostType',\n '[attr.aria-label]': 'ariaLabel()',\n },\n})\nexport class CngxDialogClose {\n private readonly dialogRef = inject(DIALOG_REF);\n private readonly elRef = inject(ElementRef<HTMLElement>);\n\n /** Value to pass to `close()`. When `undefined`, calls `dismiss()` instead. */\n readonly value = input<unknown>(undefined, { alias: 'cngxDialogClose' });\n\n /**\n * Explicit `aria-label` override.\n *\n * When not set, the directive auto-detects whether the host element\n * has descriptive text content. If it does (e.g. \"Cancel\", \"Confirm\"),\n * no `aria-label` is added. If the content is a single character,\n * empty, or visually an icon, `aria-label` defaults to `\"Close dialog\"`.\n */\n readonly label = input<string | undefined>(undefined, { alias: 'cngxDialogCloseLabel' });\n\n /** Set type=\"button\" on <button> hosts to prevent form submit. */\n protected readonly hostType =\n (this.elRef.nativeElement as HTMLElement).tagName === 'BUTTON' ? 'button' : null;\n\n /**\n * Computed `aria-label`. Returns:\n * - explicit `label()` input if set\n * - `null` if host text is descriptive (> 1 char, not whitespace-only)\n * - `'Close dialog'` for icon-only / single-char content\n */\n protected readonly ariaLabel = computed(() => {\n const explicit = this.label();\n if (explicit !== undefined) {\n return explicit || null;\n }\n\n // If host already has aria-label attribute set by the consumer, don't override\n const el = this.elRef.nativeElement as HTMLElement;\n if (el.hasAttribute('aria-label')) {\n return null;\n }\n\n const text = el.textContent?.trim() ?? '';\n if (text.length > 1) {\n return null;\n }\n\n return 'Close dialog';\n });\n\n protected handleClick(): void {\n const v = this.value();\n // Static attribute `cngxDialogClose` (no binding) resolves to '' - treat as dismiss.\n // Only `[cngxDialogClose]=\"value\"` with an explicit value calls close().\n if (v !== undefined && v !== '') {\n this.dialogRef.close(v);\n } else {\n this.dialogRef.dismiss();\n }\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport type { Observable } from 'rxjs';\n\n/**\n * Injection token for data passed to a programmatically opened dialog via `CngxDialogOpener.open()`.\n *\n * @category common/dialog\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog-config.ts\n * @since 0.1.0\n */\nexport const CNGX_DIALOG_DATA = new InjectionToken<unknown>('CngxDialogData');\n\n/**\n * Configuration for programmatically opened dialogs.\n *\n * Mirrors the declarative `CngxDialog` input surface - everything a\n * template-driven dialog can bind is also reachable through\n * `CngxDialogOpener.open()`.\n *\n * @category common/dialog\n */\nexport interface CngxDialogConfig<D = unknown, T = unknown> {\n /** Data to inject via `CNGX_DIALOG_DATA` inside the dialog component. */\n data?: D;\n /** Whether the dialog opens as modal (`showModal()`) or non-modal (`show()`). Default: `true`. */\n modal?: boolean;\n /** Whether clicking the backdrop dismisses the dialog. Default: `true`. */\n closeOnBackdropClick?: boolean;\n /** Whether pressing Escape dismisses the dialog. Default: `true`. */\n closeOnEscape?: boolean;\n /** Focus strategy on open. Default: `'first-focusable'`. */\n autoFocus?: 'first-focusable' | 'none' | (string & {});\n /**\n * Async action executed when the dialog closes with a value. Same contract\n * as the declarative `[submitAction]` input: on success the dialog\n * auto-closes, on error it stays open with the error announced. The submit\n * lifecycle is exposed on `CngxDialogRef.submitState`.\n */\n submitAction?: (value: T) => Promise<unknown> | Observable<unknown>;\n /**\n * External async state driving pending/error, same contract as the\n * declarative `[state]` input. Takes precedence over `submitAction`.\n */\n state?: CngxAsyncState<unknown>;\n /** Initial error flag, same contract as the declarative `[error]` input. */\n error?: boolean;\n /**\n * Fallback element to focus when the trigger element is gone by the time\n * the dialog closes, same contract as the declarative `[focusFallback]`.\n */\n focusFallback?: HTMLElement;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n input,\n viewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport type { Observable } from 'rxjs';\n\nimport { CngxDialog } from './dialog.directive';\n\n/**\n * Internal container component for programmatically opened dialogs.\n *\n * Not part of the public API - instantiated exclusively by `CngxDialogOpener`.\n * Renders the native `<dialog>` shell and exposes a `<ng-container>` outlet\n * where the content component or template is inserted.\n *\n * @internal\n */\n@Component({\n selector: 'cngx-dialog-outlet',\n standalone: true,\n imports: [CngxDialog],\n template: `\n <dialog\n cngxDialog\n [modal]=\"modal()\"\n [closeOnBackdropClick]=\"closeOnBackdropClick()\"\n [closeOnEscape]=\"closeOnEscape()\"\n [autoFocus]=\"autoFocus()\"\n [submitAction]=\"submitAction()\"\n [state]=\"state()\"\n [error]=\"error()\"\n [focusFallback]=\"focusFallback()\"\n #dialog=\"cngxDialog\"\n >\n <ng-container #contentOutlet />\n </dialog>\n `,\n styles: `\n :host {\n display: contents;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CngxDialogOutlet {\n readonly modal = input(true);\n readonly closeOnBackdropClick = input(true);\n readonly closeOnEscape = input(true);\n readonly autoFocus = input<string>('first-focusable');\n readonly submitAction = input<\n ((value: unknown) => Promise<unknown> | Observable<unknown>) | undefined\n >(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n readonly error = input(false);\n readonly focusFallback = input<HTMLElement | undefined>(undefined);\n\n readonly dialog = viewChild.required(CngxDialog);\n readonly contentOutlet = viewChild('contentOutlet', { read: ViewContainerRef });\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n type ComponentRef,\n createComponent,\n effect,\n type EffectRef,\n EnvironmentInjector,\n inject,\n Injectable,\n Injector,\n type Provider,\n type TemplateRef,\n type Type,\n untracked,\n} from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { filter, map, type Observable, take } from 'rxjs';\n\nimport { CNGX_DIALOG_ARIA_REGISTRY } from './dialog-aria-registry';\nimport type { CngxDialogConfig } from './dialog-config';\nimport { CNGX_DIALOG_DATA } from './dialog-config';\nimport { DIALOG_REF, type DialogRef } from './dialog-ref';\nimport { CngxDialogOutlet } from './dialog-outlet';\n\n/**\n * Reference to a programmatically opened dialog.\n *\n * Returned by `CngxDialogOpener.open()`. Provides both Signal-based access\n * (`state`, `result`) and Observable convenience methods (`afterClosed()`,\n * `afterOpened()`) for migration compatibility with `MatDialogRef`.\n *\n * ### Signal-based result reading\n * ```typescript\n * const ref = dialog.open<boolean>(ConfirmDialog);\n *\n * // In a computed or effect:\n * const wasCancelled = ref.result() === 'dismissed';\n * ```\n *\n * ### Observable-based result reading\n * ```typescript\n * ref.afterClosed().subscribe(result => {\n * if (result !== 'dismissed') console.log('Confirmed:', result);\n * });\n * ```\n *\n * @category common/dialog\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog.service.ts\n * @since 0.1.0\n * @relatedTo CngxDialogOpener, CngxDialog, CNGX_DIALOG_DATA\n */\nexport class CngxDialogRef<T = unknown> {\n /** @internal */\n readonly _outletRef: ComponentRef<CngxDialogOutlet>;\n\n /** @internal */\n constructor(\n private readonly inner: DialogRef<T>,\n outletRef: ComponentRef<CngxDialogOutlet>,\n private readonly contentRef: ComponentRef<unknown> | null,\n private readonly injector: Injector,\n ) {\n this._outletRef = outletRef;\n }\n\n /**\n * Current lifecycle state of the dialog.\n *\n * Possible values: `'closed'`, `'opening'`, `'open'`, `'closing'`.\n */\n get lifecycle() {\n return this.inner.lifecycle;\n }\n\n /**\n * The typed result signal.\n *\n * - `undefined` before the dialog closes (reset on each open cycle)\n * - `'dismissed'` when dismissed via Escape or backdrop click\n * - `T` when closed with an explicit value\n */\n get result() {\n return this.inner.result;\n }\n\n /** Unique auto-generated ID for this dialog instance. */\n get id() {\n return this.inner.id;\n }\n\n /**\n * Async state of the submit channel - same surface a declarative dialog\n * exposes. Populated when the open config carries a `submitAction`;\n * remains at `'idle'` otherwise.\n *\n * Bind to any state consumer: `<cngx-alert [state]=\"ref.submitState\" />`.\n */\n get submitState() {\n return this.inner.submitState;\n }\n\n /**\n * Close the dialog with a typed result value.\n *\n * @param value - The result to deliver to consumers.\n */\n close(value: T): void {\n this.inner.close(value);\n }\n\n /**\n * Dismiss the dialog without a typed result.\n *\n * Sets the result to `'dismissed'`. Use for cancellation actions.\n */\n dismiss(): void {\n this.inner.dismiss();\n }\n\n /**\n * Observable that emits the result when the dialog closes.\n *\n * Emits exactly once with `T | 'dismissed'`, then completes.\n * Compatible with `MatDialogRef.afterClosed()` usage patterns.\n */\n afterClosed(): Observable<T | 'dismissed'> {\n return toObservable(this.inner.lifecycle, { injector: this.injector }).pipe(\n filter((s): s is 'closed' => s === 'closed'),\n take(1),\n map(() => this.inner.result() as T | 'dismissed'),\n );\n }\n\n /**\n * Observable that emits when the dialog finishes opening.\n *\n * Emits exactly once with `void` when the state transitions to `'open'`,\n * then completes. Useful for post-open logic (e.g., focusing a specific\n * element after animation completes).\n */\n afterOpened(): Observable<void> {\n return toObservable(this.inner.lifecycle, { injector: this.injector }).pipe(\n filter((s): s is 'open' => s === 'open'),\n take(1),\n map(() => undefined),\n );\n }\n\n /**\n * Reference to the content component instance.\n *\n * Returns `null` when the dialog was opened with a `TemplateRef` instead\n * of a component type.\n */\n get componentRef(): ComponentRef<unknown> | null {\n return this.contentRef;\n }\n}\n\n/**\n * Service for opening dialogs programmatically.\n *\n * Works like `MatDialog.open()` - pass a component type and config,\n * get back a typed `CngxDialogRef<T>`.\n *\n * Must be provided via `provideDialog()`.\n *\n * ### Open a component dialog\n * ```typescript\n * const ref = this.dialog.open<User>(EditUserDialog, {\n * data: { userId: 123 },\n * });\n *\n * ref.afterClosed().subscribe(result => {\n * if (result !== 'dismissed') saveUser(result);\n * });\n * ```\n *\n * ### Inside the dialog component\n * ```typescript\n * class EditUserDialog {\n * private readonly data = inject(CNGX_DIALOG_DATA) as { userId: number };\n * private readonly dialogRef = inject(DIALOG_REF) as DialogRef<User>;\n *\n * save(user: User) { this.dialogRef.close(user); }\n * }\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/dialog/dialog.service.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxDialogRef, CNGX_DIALOG_DATA, CngxDialogStack\n */\n@Injectable()\nexport class CngxDialogOpener {\n private readonly appRef = inject(ApplicationRef);\n private readonly envInjector = inject(EnvironmentInjector);\n private readonly injector = inject(Injector);\n private readonly doc = inject(DOCUMENT);\n\n private readonly openDialogs: CngxDialogRef<unknown>[] = [];\n\n /**\n * Per-open close-watcher effects, keyed by ref. Owned here (not on the\n * public `CngxDialogRef`) - the effect's injector outlives the dialog, so\n * without the explicit destroy in `cleanup()` every `open()` would leak\n * one live effect.\n */\n private readonly cleanupEffects = new WeakMap<CngxDialogRef<unknown>, EffectRef>();\n\n /**\n * Open a dialog with the given component.\n *\n * @param component - The component type to render inside the dialog.\n * @param config - Optional dialog configuration.\n * @returns A typed `CngxDialogRef<T>` for reading the result and controlling the dialog.\n */\n open<T = unknown, D = unknown>(\n component: Type<unknown>,\n config?: CngxDialogConfig<D, T>,\n ): CngxDialogRef<T>;\n\n /**\n * Open a dialog with the given template.\n *\n * @param templateRef - The template to render inside the dialog.\n * @param config - Optional dialog configuration.\n * @returns A typed `CngxDialogRef<T>`.\n */\n open<T = unknown, D = unknown>(\n templateRef: TemplateRef<unknown>,\n config?: CngxDialogConfig<D, T>,\n ): CngxDialogRef<T>;\n\n open<T = unknown, D = unknown>(\n content: Type<unknown> | TemplateRef<unknown>,\n config: CngxDialogConfig<D, T> = {},\n ): CngxDialogRef<T> {\n const outletRef = createComponent(CngxDialogOutlet, {\n environmentInjector: this.envInjector,\n });\n\n outletRef.setInput('modal', config.modal ?? true);\n outletRef.setInput('closeOnBackdropClick', config.closeOnBackdropClick ?? true);\n outletRef.setInput('closeOnEscape', config.closeOnEscape ?? true);\n if (config.autoFocus) {\n outletRef.setInput('autoFocus', config.autoFocus);\n }\n if (config.submitAction) {\n outletRef.setInput('submitAction', config.submitAction);\n }\n if (config.state) {\n outletRef.setInput('state', config.state);\n }\n if (config.error !== undefined) {\n outletRef.setInput('error', config.error);\n }\n if (config.focusFallback) {\n outletRef.setInput('focusFallback', config.focusFallback);\n }\n\n // Attach to ApplicationRef so change detection runs\n this.appRef.attachView(outletRef.hostView);\n\n const hostEl = outletRef.location.nativeElement as HTMLElement;\n this.doc.body.appendChild(hostEl);\n\n // CngxDialog has open() but the DialogRef<T> interface does not - keep\n // the concrete instance for the open() call below.\n const dialogInstance = outletRef.instance.dialog();\n const innerDialog = dialogInstance as DialogRef<T>;\n\n const outletVcr = outletRef.instance.contentOutlet();\n let contentRef: ComponentRef<unknown> | null = null;\n\n const childInjector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: DIALOG_REF, useValue: innerDialog },\n // Content lives in a dynamically created view the dialog's content\n // queries cannot see - labelling flows through the registry instead.\n { provide: CNGX_DIALOG_ARIA_REGISTRY, useValue: dialogInstance },\n { provide: CNGX_DIALOG_DATA, useValue: config.data ?? null },\n ],\n });\n\n if (outletVcr) {\n if (typeof content === 'function') {\n contentRef = outletVcr.createComponent(content, {\n injector: childInjector,\n });\n } else {\n outletVcr.createEmbeddedView(\n content,\n { $implicit: innerDialog },\n { injector: childInjector },\n );\n }\n }\n\n const dialogRef = new CngxDialogRef<T>(innerDialog, outletRef, contentRef, this.injector);\n\n this.openDialogs.push(dialogRef as CngxDialogRef<unknown>);\n\n dialogInstance.open();\n\n this.cleanupEffects.set(\n dialogRef as CngxDialogRef<unknown>,\n effect(\n () => {\n if (\n innerDialog.lifecycle() === 'closed' &&\n outletRef.hostView &&\n !outletRef.hostView.destroyed\n ) {\n untracked(() => this.cleanup(dialogRef));\n }\n },\n { injector: childInjector },\n ),\n );\n\n return dialogRef;\n }\n\n /**\n * Dismiss all programmatically opened dialogs.\n *\n * Calls `dismiss()` on each open dialog in reverse order (most recent first).\n * Useful for route guards or global teardown.\n */\n closeAll(): void {\n for (const ref of [...this.openDialogs]) {\n ref.dismiss();\n }\n }\n\n private cleanup(ref: CngxDialogRef<unknown>): void {\n this.cleanupEffects.get(ref)?.destroy();\n this.cleanupEffects.delete(ref);\n\n const idx = this.openDialogs.indexOf(ref);\n if (idx >= 0) {\n this.openDialogs.splice(idx, 1);\n }\n\n if (ref.componentRef && !ref.componentRef.hostView.destroyed) {\n ref.componentRef.destroy();\n }\n\n const outletRef = ref._outletRef;\n if (outletRef && !outletRef.hostView.destroyed) {\n this.appRef.detachView(outletRef.hostView);\n (outletRef.location.nativeElement as HTMLElement).remove();\n outletRef.destroy();\n }\n }\n}\n\n/**\n * Provide `CngxDialogOpener` for programmatic dialog opening.\n *\n * Must be called in the application's `providers` array or a route's\n * `providers` for `CngxDialogOpener` to be injectable.\n *\n * ```typescript\n * bootstrapApplication(AppComponent, {\n * providers: [provideDialog()],\n * });\n * ```\n *\n * @category common/dialog\n */\nexport function provideDialog(): Provider[] {\n return [CngxDialogOpener];\n}\n","import { DestroyRef, Directive, inject, input } from '@angular/core';\nimport { CngxSwipeDismiss } from '@cngx/common/interactive';\n\nimport { DIALOG_REF } from '../dialog/dialog-ref';\n\n/**\n * Bottom sheet molecule - a `CngxDialog` positioned at the viewport bottom\n * with swipe-to-dismiss support.\n *\n * Place on the same `<dialog>` element alongside `cngxDialog`. Adds the\n * `cngx-bottom-sheet` CSS class (styled by `bottom-sheet-theme.scss`).\n * When `CngxSwipeDismiss` is also present, auto-wires the swipe output\n * to `dialogRef.dismiss()` - no manual `(swiped)` binding needed.\n *\n * ### Basic bottom sheet\n * ```html\n * <dialog cngxDialog cngxBottomSheet [cngxSwipeDismiss]=\"'down'\"\n * #sheet=\"cngxDialog\">\n * <h2 cngxDialogTitle>Share</h2>\n * <button [cngxDialogClose]=\"'copy'\">Copy Link</button>\n * <button [cngxDialogClose]=\"'email'\">Email</button>\n * <button cngxDialogClose>Cancel</button>\n * </dialog>\n * <button (click)=\"sheet.open()\">Share</button>\n * ```\n *\n * ### Without swipe (static bottom sheet)\n * ```html\n * <dialog cngxDialog cngxBottomSheet #sheet=\"cngxDialog\">\n * <p>Content positioned at the bottom.</p>\n * </dialog>\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/bottom-sheet/bottom-sheet.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxSwipeDismiss, CngxDialogClose\n */\n@Directive({\n selector: 'dialog[cngxBottomSheet]',\n exportAs: 'cngxBottomSheet',\n standalone: true,\n host: {\n class: 'cngx-bottom-sheet',\n '[class.cngx-bottom-sheet--handle]': 'showHandle()',\n },\n})\nexport class CngxBottomSheet {\n private readonly dialogRef = inject(DIALOG_REF);\n private readonly swipe = inject(CngxSwipeDismiss, { self: true, optional: true });\n\n /**\n * Whether the drag handle bar is visible.\n *\n * The handle itself is rendered via CSS (`::before` pseudo-element, gated\n * on the `cngx-bottom-sheet--handle` modifier class this input binds).\n * Set to `false` to hide it.\n *\n * @defaultValue `true`\n */\n readonly showHandle = input(true);\n\n constructor() {\n if (this.swipe) {\n const sub = this.swipe.swiped.subscribe(() => this.dialogRef.dismiss());\n inject(DestroyRef).onDestroy(() => sub.unsubscribe());\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_DIALOG_ARIA_REGISTRY } from '../dialog/dialog-aria-registry';\nimport { applySrOnly } from '../dialog/sr-only';\n\n/**\n * Opt-in drag behavior for `CngxDialog`.\n *\n * Uses Pointer Events for unified mouse/touch handling. Position is exposed\n * as CSS custom properties `--cngx-dialog-x` and `--cngx-dialog-y` - the\n * consumer applies the transform via CSS.\n *\n * Keyboard-based moving is mandatory for accessibility:\n * - Arrow keys move 10px\n * - Shift + Arrow moves 50px\n * - Home resets to origin\n *\n * Keys move the dialog only while the handle element itself has focus -\n * arrows inside form fields keep moving the caret. Without an explicit\n * `[handle]` the dialog element becomes focusable (`tabindex=\"0\"`) and is\n * the keyboard drag surface.\n *\n * ```html\n * <dialog cngxDialog cngxDialogDraggable>\n * <div class=\"dialog-header\" #handle>Title</div>\n * …\n * </dialog>\n * ```\n *\n * ```css\n * dialog[cngxDialogDraggable] {\n * transform: translate(var(--cngx-dialog-x, 0px), var(--cngx-dialog-y, 0px));\n * }\n * ```\n *\n * @category common/dialog\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/draggable/dialog-draggable.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDialog, CngxBottomSheet\n * <example-url>http://localhost:4200/#/common/dialog/alert-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/bottom-sheet</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/cngxdialogopener-programmatic</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/draggable-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/fully-declarative</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/grid-snap-live-vs-release</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/nested-dialogs-cngxdialogstack</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/non-modal-panel</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/programmatic-control</example-url>\n * <example-url>http://localhost:4200/#/common/dialog/template-directives</example-url>\n */\n@Directive({\n selector: '[cngxDialogDraggable]',\n exportAs: 'cngxDialogDraggable',\n standalone: true,\n host: {\n '[style.--cngx-dialog-x]': 'cssX()',\n '[style.--cngx-dialog-y]': 'cssY()',\n '[class.cngx-dialog--dragging]': 'isDragging()',\n },\n})\nexport class CngxDialogDraggable {\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly ariaRegistry = inject(CNGX_DIALOG_ARIA_REGISTRY, { optional: true });\n\n /** Handle element for initiating drag. If not set, entire dialog is the handle. */\n readonly handle = input<HTMLElement | undefined>(undefined);\n\n /** Clamp position to viewport bounds. */\n readonly constrainToViewport = input(false);\n\n /**\n * Snap position to a grid in pixels.\n *\n * When set to a positive number, the dialog position snaps to the nearest\n * grid increment. When `snapMode` is `'live'`, snapping happens during drag.\n * When `'release'`, position is free during drag and snaps on pointer up.\n *\n * @defaultValue `0` (no grid)\n */\n readonly gridSize = input(0);\n\n /**\n * When to apply grid snapping.\n *\n * - `'live'` - position snaps continuously during drag (default)\n * - `'release'` - position is free during drag, snaps on pointer up\n *\n * @defaultValue `'live'`\n */\n readonly snapMode = input<'live' | 'release'>('live');\n\n // equal keeps live grid-snap quiet: every pointermove produces a fresh\n // {x, y} literal, and under snapping most of them carry identical values.\n private readonly positionState = signal(\n { x: 0, y: 0 },\n { equal: (a, b) => a.x === b.x && a.y === b.y },\n );\n private readonly draggingState = signal(false);\n\n /** Current offset position. */\n readonly position = this.positionState.asReadonly();\n\n /** Whether a drag operation is in progress. */\n readonly isDragging = this.draggingState.asReadonly();\n\n protected readonly cssX = computed(() => `${this.positionState().x}px`);\n protected readonly cssY = computed(() => `${this.positionState().y}px`);\n\n // Drag state - not reactive, perf critical (pointermove runs at framerate).\n private dragStartX = 0;\n private dragStartY = 0;\n private posStartX = 0;\n private posStartY = 0;\n private boundMove: ((e: PointerEvent) => void) | null = null;\n private boundUp: ((e: PointerEvent) => void) | null = null;\n\n constructor() {\n effect(() => {\n const handleEl = this.handle() ?? this.elRef.nativeElement;\n // untracked: setupHandle registers with the dialog's aria registry -\n // a signal write that must not become a tracked dependency.\n untracked(() => this.setupHandle(handleEl));\n });\n\n this.destroyRef.onDestroy(() => this.cleanup());\n }\n\n private currentHandle: HTMLElement | null = null;\n private boundPointerDown: ((e: PointerEvent) => void) | null = null;\n private boundKeyDown: ((e: KeyboardEvent) => void) | null = null;\n private handleAddedTabindex = false;\n private handleAddedAria = false;\n\n /** Attach pointer and keyboard listeners to `el`, cleaning up the previous handle first. */\n private setupHandle(el: HTMLElement): void {\n this.teardownHandle();\n\n this.currentHandle = el;\n\n // A11y: the handle must be keyboard-reachable - the target-scoped keydown\n // guard makes it the only element arrow keys can move the dialog from,\n // so an unfocusable handle would strip the keyboard path entirely.\n if (!el.hasAttribute('tabindex')) {\n el.setAttribute('tabindex', '0');\n this.handleAddedTabindex = true;\n }\n // Labelling stays off the host-as-handle: aria-label/aria-roledescription\n // on the dialog element itself would clobber its accessible name (the\n // title) and its role text.\n if (!el.hasAttribute('aria-roledescription') && el !== this.elRef.nativeElement) {\n el.setAttribute('aria-roledescription', 'draggable');\n el.setAttribute('aria-label', 'Move dialog');\n this.handleAddedAria = true;\n }\n // The keyboard path is live on every handle, so the instruction is too.\n // The registry channel exists only because CngxDialog owns\n // aria-describedby on its host; everywhere else (explicit handle,\n // draggable on a non-dialog element) nothing owns the attribute and it\n // is set directly - guarded like tabindex, a consumer-authored\n // describedby wins.\n const instruction = this.createInstructionNode();\n if (el === this.elRef.nativeElement && this.ariaRegistry) {\n this.releaseInstruction = this.ariaRegistry.registerDescribedBy(instruction.id);\n } else if (!el.hasAttribute('aria-describedby')) {\n el.setAttribute('aria-describedby', instruction.id);\n this.handleAddedDescribedBy = true;\n }\n el.style.cursor = 'var(--cngx-dialog-drag-cursor, grab)';\n el.style.touchAction = 'none';\n\n this.boundPointerDown = (e: PointerEvent) => this.handlePointerDown(e);\n this.boundKeyDown = (e: KeyboardEvent) => this.handleKeyDown(e);\n el.addEventListener('pointerdown', this.boundPointerDown);\n el.addEventListener('keydown', this.boundKeyDown);\n }\n\n private handlePointerDown(event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n\n // Don't drag if the target is an interactive element inside the handle\n const target = event.target as HTMLElement;\n if (\n target.closest('button, a, input, select, textarea, [tabindex]') &&\n target !== this.currentHandle\n ) {\n return;\n }\n\n event.preventDefault();\n (this.currentHandle ?? this.elRef.nativeElement).setPointerCapture(event.pointerId);\n\n this.dragStartX = event.clientX;\n this.dragStartY = event.clientY;\n this.posStartX = this.positionState().x;\n this.posStartY = this.positionState().y;\n this.draggingState.set(true);\n\n // Prevent text selection during drag\n this.doc.documentElement.style.userSelect = 'none';\n if (this.currentHandle) {\n this.currentHandle.style.cursor = 'var(--cngx-dialog-dragging-cursor, grabbing)';\n }\n\n this.boundMove = (e: PointerEvent) => this.handlePointerMove(e);\n this.boundUp = (e: PointerEvent) => this.handlePointerUp(e);\n this.doc.addEventListener('pointermove', this.boundMove);\n this.doc.addEventListener('pointerup', this.boundUp);\n // A cancelled pointer (touch interrupted, capture stolen) never fires\n // pointerup - without this the drag state sticks and userSelect stays off.\n this.doc.addEventListener('pointercancel', this.boundUp);\n }\n\n private handlePointerMove(event: PointerEvent): void {\n let x = this.posStartX + (event.clientX - this.dragStartX);\n let y = this.posStartY + (event.clientY - this.dragStartY);\n\n if (this.constrainToViewport()) {\n const win = this.doc.defaultView;\n if (win) {\n const rect = this.elRef.nativeElement.getBoundingClientRect();\n const baseX = rect.left - this.positionState().x;\n const baseY = rect.top - this.positionState().y;\n\n x = Math.max(-baseX, Math.min(x, win.innerWidth - baseX - rect.width));\n y = Math.max(-baseY, Math.min(y, win.innerHeight - baseY - rect.height));\n }\n }\n\n if (this.gridSize() > 0 && this.snapMode() === 'live') {\n ({ x, y } = this.snap(x, y));\n }\n\n this.positionState.set({ x, y });\n }\n\n private handlePointerUp(event: PointerEvent): void {\n (this.currentHandle ?? this.elRef.nativeElement).releasePointerCapture(event.pointerId);\n this.draggingState.set(false);\n this.doc.documentElement.style.userSelect = '';\n if (this.currentHandle) {\n this.currentHandle.style.cursor = 'var(--cngx-dialog-drag-cursor, grab)';\n }\n\n if (this.gridSize() > 0 && this.snapMode() === 'release') {\n const { x, y } = this.positionState();\n this.positionState.set(this.snap(x, y));\n }\n\n if (this.boundMove) {\n this.doc.removeEventListener('pointermove', this.boundMove);\n }\n if (this.boundUp) {\n this.doc.removeEventListener('pointerup', this.boundUp);\n this.doc.removeEventListener('pointercancel', this.boundUp);\n }\n this.boundMove = null;\n this.boundUp = null;\n }\n\n private handleKeyDown(event: KeyboardEvent): void {\n // When the whole dialog is the handle, every keydown inside it bubbles\n // here - arrows typed into form fields must move the caret, not the\n // dialog. Only keys originating on the handle element itself may drag.\n if (event.target !== this.currentHandle) {\n return;\n }\n const grid = this.gridSize();\n // When grid is active, Arrow keys step by grid size (Shift = 5x grid)\n const step = grid > 0 ? (event.shiftKey ? grid * 5 : grid) : event.shiftKey ? 50 : 10;\n const { x, y } = this.positionState();\n\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault();\n this.positionState.set(this.snap(x - step, y));\n break;\n case 'ArrowRight':\n event.preventDefault();\n this.positionState.set(this.snap(x + step, y));\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.positionState.set(this.snap(x, y - step));\n break;\n case 'ArrowDown':\n event.preventDefault();\n this.positionState.set(this.snap(x, y + step));\n break;\n case 'Home':\n event.preventDefault();\n this.positionState.set({ x: 0, y: 0 });\n break;\n }\n }\n\n /** Snap `x`/`y` to the nearest `gridSize` increment. Pass-through when grid is disabled. */\n private snap(x: number, y: number): { x: number; y: number } {\n const grid = this.gridSize();\n if (grid <= 0) {\n return { x, y };\n }\n return {\n x: Math.round(x / grid) * grid,\n y: Math.round(y / grid) * grid,\n };\n }\n\n private instructionNode: HTMLElement | null = null;\n private releaseInstruction: (() => void) | null = null;\n private handleAddedDescribedBy = false;\n\n /**\n * Visually hidden keyboard-drag instruction, appended to the host so it\n * lives inside the dialog for both handle modes. Same hidden technique as\n * the dialog's live region - a referenced node must stay perceivable to\n * AT, not `display: none`.\n */\n private createInstructionNode(): HTMLElement {\n const node = this.doc.createElement('span');\n node.id = nextUid('cngx-dialog-drag-hint');\n node.textContent = 'Use arrow keys to move the dialog; Shift for larger steps';\n applySrOnly(node);\n this.elRef.nativeElement.appendChild(node);\n this.instructionNode = node;\n return node;\n }\n\n /**\n * Detach listeners from the current handle and restore every attribute and\n * style this directive added. A demoted handle must not stay focusable or\n * keep announcing \"Move dialog\" with a dead keyboard path behind it.\n *\n * The instruction node and its describedby registration leave atomically\n * with the capability they describe: a handle swap away from host-as-handle\n * removes the arrow-keys-on-the-dialog path itself, so keeping an orphan\n * description would misinform AT, not inform it.\n */\n private teardownHandle(): void {\n this.releaseInstruction?.();\n this.releaseInstruction = null;\n this.instructionNode?.remove();\n this.instructionNode = null;\n\n const handle = this.currentHandle;\n if (!handle) {\n return;\n }\n if (this.handleAddedDescribedBy) {\n handle.removeAttribute('aria-describedby');\n this.handleAddedDescribedBy = false;\n }\n if (this.boundPointerDown) {\n handle.removeEventListener('pointerdown', this.boundPointerDown);\n }\n if (this.boundKeyDown) {\n handle.removeEventListener('keydown', this.boundKeyDown);\n }\n if (this.handleAddedTabindex) {\n handle.removeAttribute('tabindex');\n this.handleAddedTabindex = false;\n }\n if (this.handleAddedAria) {\n handle.removeAttribute('aria-roledescription');\n handle.removeAttribute('aria-label');\n this.handleAddedAria = false;\n }\n handle.style.cursor = '';\n handle.style.touchAction = '';\n this.currentHandle = null;\n }\n\n private cleanup(): void {\n if (this.boundMove) {\n this.doc.removeEventListener('pointermove', this.boundMove);\n }\n if (this.boundUp) {\n this.doc.removeEventListener('pointerup', this.boundUp);\n this.doc.removeEventListener('pointercancel', this.boundUp);\n }\n // A destroy mid-drag skips handlePointerUp - the global style must not\n // outlive the directive.\n this.doc.documentElement.style.userSelect = '';\n this.teardownHandle();\n }\n}\n","/**\n * @module @cngx/common/dialog\n */\nexport { type DialogRef, type DialogState, DIALOG_REF } from './dialog/dialog-ref';\nexport { CngxDialog } from './dialog/dialog.directive';\nexport { CngxDialogTitle } from './dialog/dialog-title.directive';\nexport { CngxDialogDescription } from './dialog/dialog-description.directive';\nexport { CngxDialogClose } from './dialog/dialog-close.directive';\nexport { CngxDialogStack, provideDialogStack } from './dialog/dialog-stack';\nexport { CNGX_DIALOG_DATA, type CngxDialogConfig } from './dialog/dialog-config';\nexport { CngxDialogOpener, CngxDialogRef, provideDialog } from './dialog/dialog.service';\nexport { CngxBottomSheet } from './bottom-sheet/bottom-sheet.directive';\nexport { CngxDialogDraggable } from './draggable/dialog-draggable.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAoDA;;;;;;AAMG;MACU,UAAU,GAAG,IAAI,cAAc,CAAY,eAAe;;ACLvE;;;;;AAKG;AACI,MAAM,yBAAyB,GAAG,IAAI,cAAc,CACzD,wBAAwB,CACzB;;AC5DD;;;;;;;;;;;;;;;;;;;;;;AAsBG;MAEU,eAAe,CAAA;AACT,IAAA,UAAU,GAAG,MAAM,CAAoB,EAAE,iFAAC;;AAGlD,IAAA,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE;;AAGpC,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,8EAAC;;AAGnE,IAAA,IAAI,CAAC,EAAU,EAAA;AACb,QAAA,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAC3C;;AAGA,IAAA,GAAG,CAAC,EAAU,EAAA;QACZ,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IAC1D;uGAjBW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAf,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cADF,MAAM,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