@cngx/common 0.0.1-rc.0 → 0.1.0-rc.0
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/a11y/README.md +13 -16
- package/card/README.md +2 -21
- package/chart/README.md +5 -8
- package/data/README.md +45 -47
- package/dialog/README.md +12 -15
- package/display/README.md +5 -9
- package/fesm2022/cngx-common-a11y.mjs +140 -40
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +157 -69
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +389 -92
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +311 -151
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +167 -29
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +445 -110
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +2025 -435
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +188 -31
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +711 -90
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +1258 -60
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +247 -41
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +2 -2
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/interactive/README.md +5 -5
- package/layout/README.md +2 -2
- package/package.json +5 -4
- package/popover/README.md +8 -34
- package/stepper/README.md +49 -8
- package/tabs/README.md +6 -6
- package/theming/components/cngx-async.css +74 -0
- package/theming/components/cngx-backdrop.css +73 -0
- package/theming/components/cngx-badge.css +340 -0
- package/theming/components/cngx-bottom-sheet.css +201 -0
- package/theming/components/cngx-button-toggle.css +99 -0
- package/theming/components/cngx-dialog.css +358 -0
- package/theming/components/cngx-divider.css +145 -0
- package/theming/components/cngx-listbox.css +220 -0
- package/theming/components/cngx-menu.css +371 -0
- package/theming/components/cngx-ripple.css +116 -0
- package/theming/components/cngx-tooltip.css +265 -0
- package/theming/system-tokens.css +24 -0
- package/types/cngx-common-a11y.d.ts +136 -36
- package/types/cngx-common-card.d.ts +137 -22
- package/types/cngx-common-chart.d.ts +337 -40
- package/types/cngx-common-data.d.ts +277 -45
- package/types/cngx-common-dialog.d.ts +162 -22
- package/types/cngx-common-display.d.ts +422 -78
- package/types/cngx-common-interactive.d.ts +1862 -305
- package/types/cngx-common-layout.d.ts +191 -28
- package/types/cngx-common-popover.d.ts +632 -87
- package/types/cngx-common-stepper.d.ts +1110 -38
- package/types/cngx-common-tabs.d.ts +306 -32
- package/types/cngx-common.d.ts +1 -1
- package/README.md +0 -18
|
@@ -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 */\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 */\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/** Injection token to access the nearest `DialogRef` from inside a dialog. */\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@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 */\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@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@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/** Ref-count map for scroll lock — one lock per document root, shared across stacked modals. */\nconst lockCounts = new WeakMap<HTMLElement, number>();\n\n/** Acquire a scroll lock on the document root, preserving prior overflow styles. */\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/** Release a scroll lock. Restores prior overflow styles when the count reaches zero. */\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@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() ? null : '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 // Reset result and submit state from previous cycle\n this.resultSignal.set(undefined);\n this.submitStatusState.set('idle');\n this.submitErrorState.set(undefined);\n\n // Store trigger element for focus return\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 // External [state] takes full precedence — submitAction is ignored\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@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 // Explicit override wins\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 // Check text content — if descriptive (multi-char word), no label needed\n const text = el.textContent?.trim() ?? '';\n if (text.length > 1) {\n return null;\n }\n\n // Icon-only or single char (e.g. \"X\", \"x\") — set default\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/** Injection token for data passed to a programmatically opened dialog via `CngxDialogOpener.open()`. */\nexport const CNGX_DIALOG_DATA = new InjectionToken<unknown>('CngxDialogData');\n\n/**\n * Configuration for programmatically opened dialogs.\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 */\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@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 // Build a child injector that provides DIALOG_REF and CNGX_DIALOG_DATA\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 */\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@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 // Auto-wire: swipe → dismiss (when CngxSwipeDismiss is on the same element)\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@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":";;;;;;;;AAgDA;MACa,UAAU,GAAG,IAAI,cAAc,CAAY,eAAe;;AC/CvE;;;;;;;AAOG;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,E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AAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,6BAAA,EAAA,cAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAV/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,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;;;AC9CD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
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,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,8E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