@cngx/common 0.1.0-rc.4 → 0.1.0-rc.6
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/audio/README.md +180 -0
- package/fesm2022/cngx-common-audio.mjs +1205 -0
- package/fesm2022/cngx-common-audio.mjs.map +1 -0
- package/fesm2022/cngx-common-chart.mjs +2 -2
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +309 -7
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +8 -8
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +37 -12
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/package.json +5 -1
- package/theming/components/cngx-accordion.css +17 -6
- package/theming/components/cngx-breadcrumb.css +1 -1
- package/theming/components/cngx-data-grid.css +3 -4
- package/theming/components/cngx-slider.css +1 -1
- package/types/cngx-common-audio.d.ts +736 -0
- package/types/cngx-common-data.d.ts +191 -3
- package/types/cngx-common-interactive.d.ts +14 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-common-interactive.mjs","sources":["../../../projects/common/interactive/async-click/async-click.directive.ts","../../../projects/common/interactive/async-click/async-status-templates.ts","../../../projects/common/interactive/async-status/async-status.directive.ts","../../../projects/common/interactive/copy/copy-text.directive.ts","../../../projects/common/interactive/copy/copy-block.ts","../../../projects/common/interactive/ripple/ripple.directive.ts","../../../projects/common/interactive/ripple/pressable.directive.ts","../../../projects/common/interactive/ripple/press-ripple.directive.ts","../../../projects/common/interactive/nav/nav-group-registry.ts","../../../projects/common/interactive/nav/nav-config.ts","../../../projects/common/interactive/nav/disclosure.directive.ts","../../../projects/common/interactive/nav/nav-group.directive.ts","../../../projects/common/interactive/nav/nav-label.directive.ts","../../../projects/common/interactive/nav/nav-link.directive.ts","../../../projects/common/interactive/nav/nav-badge.directive.ts","../../../projects/common/interactive/expandable/expandable.directive.ts","../../../projects/common/interactive/hover-intent/hover-intent.directive.ts","../../../projects/common/interactive/control-value/control-value.token.ts","../../../projects/common/interactive/slider/slider-core.ts","../../../projects/common/interactive/slider/slider-interaction.ts","../../../projects/common/interactive/slider/slider.directive.ts","../../../projects/common/interactive/slider/slider-ticks.ts","../../../projects/common/interactive/slider/slider.component.ts","../../../projects/common/interactive/slider/range-slider.token.ts","../../../projects/common/interactive/slider/range-slider.directive.ts","../../../projects/common/interactive/slider/slider-thumb.directive.ts","../../../projects/common/interactive/slider/range-slider.component.ts","../../../projects/common/interactive/accordion/accordion-keyboard-nav.ts","../../../projects/common/interactive/accordion/accordion.token.ts","../../../projects/common/interactive/accordion/accordion.directive.ts","../../../projects/common/interactive/accordion/accordion-panel.directive.ts","../../../projects/common/interactive/breadcrumb/breadcrumb.token.ts","../../../projects/common/interactive/breadcrumb/breadcrumb-item.directive.ts","../../../projects/common/interactive/breadcrumb/breadcrumb-collapse.ts","../../../projects/common/interactive/breadcrumb/breadcrumb-collapse.token.ts","../../../projects/common/interactive/breadcrumb/breadcrumb.directive.ts","../../../projects/common/interactive/breadcrumb/breadcrumb-separator.directive.ts","../../../projects/common/interactive/breadcrumb/breadcrumb-responsive.ts","../../../projects/common/interactive/error-aggregator/error-aggregator.token.ts","../../../projects/common/interactive/toggle/toggle.component.ts","../../../projects/common/interactive/checkbox/checkbox.component.ts","../../../projects/common/interactive/checkbox-group/checkbox-group.component.ts","../../../projects/common/interactive/button-toggle/button-toggle-group.token.ts","../../../projects/common/interactive/button-toggle/button-toggle-group.component.ts","../../../projects/common/interactive/button-toggle/button-multi-toggle-group.token.ts","../../../projects/common/interactive/button-toggle/button-multi-toggle-group.component.ts","../../../projects/common/interactive/button-toggle/button-toggle.directive.ts","../../../projects/common/interactive/radio/radio-group.token.ts","../../../projects/common/interactive/radio/radio-group.component.ts","../../../projects/common/interactive/radio/radio.component.ts","../../../projects/common/interactive/chip-group/chip-group-host.token.ts","../../../projects/common/interactive/chip-interaction/chip-interaction.directive.ts","../../../projects/common/interactive/chip-in-group/chip-in-group.directive.ts","../../../projects/common/interactive/chip-group/chip-group.component.ts","../../../projects/common/interactive/multi-chip-group/multi-chip-group.component.ts","../../../projects/common/interactive/chip-input/chip-input.directive.ts","../../../projects/common/interactive/tree-controller/tree-config.ts","../../../projects/common/interactive/tree-controller/tree-controller.ts","../../../projects/common/interactive/tree-controller/tree-ad-items.ts","../../../projects/common/interactive/hierarchical-nav/hierarchical-nav-strategy.ts","../../../projects/common/interactive/hierarchical-nav/hierarchical-nav.directive.ts","../../../projects/common/interactive/retry/with-retry.ts","../../../projects/common/interactive/optimistic/optimistic.ts","../../../projects/common/interactive/gestures/long-press.directive.ts","../../../projects/common/interactive/gestures/swipe.directive.ts","../../../projects/common/interactive/gestures/swipe-dismiss.directive.ts","../../../projects/common/interactive/reorder/reorder.directive.ts","../../../projects/common/interactive/reorder/chip-strip-roving.ts","../../../projects/common/interactive/keyboard/keyboard-shortcut.directive.ts","../../../projects/common/interactive/keyboard/search.directive.ts","../../../projects/common/interactive/keyboard/click-outside.directive.ts","../../../projects/common/interactive/guard/before-unload.directive.ts","../../../projects/common/interactive/guard/can-deactivate.ts","../../../projects/common/interactive/close-button/close-button.ts","../../../projects/common/interactive/hoverable/hoverable.directive.ts","../../../projects/common/interactive/speak/speak.directive.ts","../../../projects/common/interactive/listbox/option-container.ts","../../../projects/common/interactive/listbox/option-filter-host.ts","../../../projects/common/interactive/listbox/option-interaction-host.ts","../../../projects/common/interactive/listbox/option-status-host.ts","../../../projects/common/interactive/listbox/option.directive.ts","../../../projects/common/interactive/listbox/option-group.directive.ts","../../../projects/common/interactive/listbox/listbox.directive.ts","../../../projects/common/interactive/listbox/listbox-search.directive.ts","../../../projects/common/interactive/listbox/listbox-trigger.directive.ts","../../../projects/common/interactive/menu/menu-announcer.ts","../../../projects/common/interactive/menu/menu-config.ts","../../../projects/common/interactive/menu/menu-host.token.ts","../../../projects/common/interactive/menu/menu-submenu.token.ts","../../../projects/common/interactive/menu/menu.directive.ts","../../../projects/common/interactive/menu/menu-item.directive.ts","../../../projects/common/interactive/menu/menu-item-slot.directives.ts","../../../projects/common/interactive/menu/menu-item-submenu.directive.ts","../../../projects/common/interactive/menu/submenu-defaults.ts","../../../projects/common/interactive/menu/menu-item-checkbox.directive.ts","../../../projects/common/interactive/menu/menu-radio-controller.ts","../../../projects/common/interactive/menu/menu-item-radio.directive.ts","../../../projects/common/interactive/menu/menu-group.directive.ts","../../../projects/common/interactive/menu/menu-separator.directive.ts","../../../projects/common/interactive/menu/menu-nav-strategy.ts","../../../projects/common/interactive/menu/menu-config-features.ts","../../../projects/common/interactive/menu/dismiss-handler.ts","../../../projects/common/interactive/menu/context-menu-trigger.directive.ts","../../../projects/common/interactive/menu/provide-cngx-menu.ts","../../../projects/common/interactive/menu/menu-trigger.directive.ts","../../../projects/common/interactive/error-state/error-state.directive.ts","../../../projects/common/interactive/error-scope/error-scope.token.ts","../../../projects/common/interactive/error-registry/equal-fns.ts","../../../projects/common/interactive/error-registry/error-registry.ts","../../../projects/common/interactive/error-scope/error-scope.directive.ts","../../../projects/common/interactive/error-source/error-source.directive.ts","../../../projects/common/interactive/error-registry/aggregator-contract.ts","../../../projects/common/interactive/error-aggregator/error-aggregator.directive.ts","../../../projects/common/interactive/error-registry/inject-error-scope.ts","../../../projects/common/interactive/error-registry/inject-error-aggregator.ts","../../../projects/common/interactive/error-registry/provide-error-registry.ts","../../../projects/common/interactive/public-api.ts","../../../projects/common/interactive/cngx-common-interactive.ts"],"sourcesContent":["import {\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n signal,\n type Signal,\n} from '@angular/core';\nimport { buildAsyncStateView, type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\nimport { firstValueFrom, isObservable, type Observable } from 'rxjs';\n\n/**\n * Action function that returns a Promise or Observable.\n *\n * @category common/interactive\n */\nexport type AsyncAction = () => Promise<unknown> | Observable<unknown>;\n\n/**\n * Async action handler with loading state, auto-disable, and success/error feedback.\n *\n * Place on any clickable element (button, link, div). Executes the provided\n * async action on click, tracks the full lifecycle as a state machine, auto-disables\n * during execution, announces state changes to screen readers, and guards against\n * double-clicks.\n *\n * ### Basic usage\n * ```html\n * <button [cngxAsyncClick]=\"saveAction\" #btn=\"cngxAsyncClick\">\n * @switch (btn.status()) {\n * @case ('pending') { Saving... }\n * @case ('success') { Saved! }\n * @case ('error') { Failed }\n * @default { Save }\n * }\n * </button>\n * ```\n *\n * ### With Material\n * ```html\n * <button mat-raised-button [cngxAsyncClick]=\"submitForm\" #btn=\"cngxAsyncClick\">\n * @if (btn.pending()) { <mat-spinner diameter=\"20\" /> Submitting... }\n * @else { Submit }\n * </button>\n * ```\n *\n * ### On any element\n * ```html\n * <a role=\"button\" [cngxAsyncClick]=\"navigate\" #btn=\"cngxAsyncClick\">Go</a>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-click.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPending, CngxSucceeded, CngxFailed, CngxActionButton\n * <example-url>http://localhost:4200/#/common/interactive/retry/optimistic-instant-like-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/retry/withretry-cngxasyncclick</example-url>\n */\n@Directive({\n selector: '[cngxAsyncClick]',\n standalone: true,\n exportAs: 'cngxAsyncClick',\n host: {\n '(click)': 'handleClick($event)',\n '[class.cngx-async--pending]': 'pending()',\n '[class.cngx-async--success]': 'succeeded()',\n '[class.cngx-async--error]': 'failed()',\n '[attr.aria-busy]': 'pending() || null',\n '[attr.aria-disabled]': 'pending() || null',\n '[attr.disabled]': 'shouldDisable()',\n },\n})\nexport class CngxAsyncClick {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n\n /** The async action to execute on click. */\n readonly action = input.required<AsyncAction>({ alias: 'cngxAsyncClick' });\n\n /** Duration in ms to show success/error state before reset. */\n readonly feedbackDuration = input<number>(2000);\n\n /** When `false`, clicks are ignored (does not set `disabled` attribute). */\n readonly enabled = input<boolean>(true);\n\n /** Label announced to screen readers on success. */\n readonly succeededAnnouncement = input<string>('Action succeeded');\n\n /** Label announced to screen readers on failure. */\n readonly failedAnnouncement = input<string>('Action failed');\n\n private readonly pendingState = signal(false);\n private readonly succeededState = signal(false);\n private readonly failedState = signal(false);\n private readonly errorState = signal<unknown>(undefined);\n private readonly lastUpdatedState = signal<Date | undefined>(undefined);\n private feedbackTimer: ReturnType<typeof setTimeout> | null = null;\n private readonly supportsDisabled: boolean;\n private destroyed = false;\n\n constructor() {\n const tag = this.el.nativeElement.tagName;\n this.supportsDisabled =\n tag === 'BUTTON' || tag === 'INPUT' || tag === 'SELECT' || tag === 'TEXTAREA';\n\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n if (this.feedbackTimer != null) {\n clearTimeout(this.feedbackTimer);\n }\n });\n }\n\n /** `true` while the action is executing. */\n readonly pending: Signal<boolean> = this.pendingState.asReadonly();\n\n /** `true` for `feedbackDuration` ms after a successful action. */\n readonly succeeded: Signal<boolean> = this.succeededState.asReadonly();\n\n /** `true` for `feedbackDuration` ms after a failed action. */\n readonly failed: Signal<boolean> = this.failedState.asReadonly();\n\n /** The error value from a failed action. Cleared on reset. */\n readonly error: Signal<unknown> = this.errorState.asReadonly();\n\n /** Current lifecycle status - use in `@switch` for template branching. */\n readonly status = computed<AsyncStatus>(() => {\n if (this.pendingState()) {\n return 'pending';\n }\n if (this.succeededState()) {\n return 'success';\n }\n if (this.failedState()) {\n return 'error';\n }\n return 'idle';\n });\n\n /** Screen reader announcement for the current state - bind to an `aria-live` region. */\n readonly announcement = computed(() => {\n if (this.succeededState()) {\n return this.succeededAnnouncement();\n }\n if (this.failedState()) {\n return this.failedAnnouncement();\n }\n return '';\n });\n\n /**\n * Full `CngxAsyncState` view of this directive's lifecycle.\n *\n * Bind to any state consumer (`[state]=\"btn.state\"`) to connect the\n * feedback system - toasts, alerts, skeletons, async containers.\n */\n readonly state: CngxAsyncState<unknown> = buildAsyncStateView<unknown>({\n status: this.status,\n data: computed(() => undefined),\n error: this.error,\n lastUpdated: this.lastUpdatedState.asReadonly(),\n });\n\n /** @internal */\n protected readonly shouldDisable = computed(() =>\n this.pendingState() && this.supportsDisabled ? '' : null,\n );\n\n /** @internal */\n protected async handleClick(event: Event): Promise<void> {\n if (!this.enabled() || this.pendingState()) {\n event.preventDefault();\n return;\n }\n\n this.clearFeedback();\n this.pendingState.set(true);\n\n try {\n const actionFn = this.action();\n const result$ = actionFn();\n const promise = isObservable(result$)\n ? firstValueFrom(result$, { defaultValue: undefined })\n : result$;\n await promise;\n if (this.destroyed) {\n return;\n }\n this.pendingState.set(false);\n this.succeededState.set(true);\n this.lastUpdatedState.set(new Date());\n this.scheduleFeedbackReset();\n } catch (err: unknown) {\n if (this.destroyed) {\n return;\n }\n this.pendingState.set(false);\n this.failedState.set(true);\n this.errorState.set(err);\n this.scheduleFeedbackReset();\n }\n }\n\n private scheduleFeedbackReset(): void {\n if (this.feedbackTimer != null) {\n clearTimeout(this.feedbackTimer);\n }\n this.feedbackTimer = setTimeout(() => {\n this.succeededState.set(false);\n this.failedState.set(false);\n this.errorState.set(undefined);\n this.feedbackTimer = null;\n }, this.feedbackDuration());\n }\n\n private clearFeedback(): void {\n if (this.feedbackTimer != null) {\n clearTimeout(this.feedbackTimer);\n this.feedbackTimer = null;\n }\n this.succeededState.set(false);\n this.failedState.set(false);\n this.errorState.set(undefined);\n }\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Template shown while an async action is executing.\n *\n * Used by `CngxActionButton` and `CngxPopoverAction` to project\n * custom pending-state content.\n *\n * ```html\n * <ng-template cngxPending>Saving...</ng-template>\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-status-templates.ts\n * @since 0.1.0\n * @relatedTo CngxSucceeded, CngxFailed, CngxAsyncClick\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>\n */\n@Directive({ selector: 'ng-template[cngxPending]', standalone: true })\nexport class CngxPending {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Template shown after an async action succeeds (for `feedbackDuration` ms).\n *\n * ```html\n * <ng-template cngxSucceeded>Saved!</ng-template>\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-status-templates.ts\n * @since 0.1.0\n * @relatedTo CngxPending, CngxFailed, CngxAsyncClick\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>\n */\n@Directive({ selector: 'ng-template[cngxSucceeded]', standalone: true })\nexport class CngxSucceeded {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Template shown after an async action fails (for `feedbackDuration` ms).\n * The implicit template context provides the error value.\n *\n * ```html\n * <ng-template cngxFailed let-err>Failed: {{ err }}</ng-template>\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-status-templates.ts\n * @since 0.1.0\n * @relatedTo CngxPending, CngxSucceeded, CngxAsyncClick\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>\n */\n@Directive({ selector: 'ng-template[cngxFailed]', standalone: true })\nexport class CngxFailed {\n readonly templateRef = inject(TemplateRef);\n}\n","import {\n computed,\n Directive,\n contentChild,\n inject,\n input,\n isDevMode,\n type Signal,\n type TemplateRef,\n} from '@angular/core';\n\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\nimport { CngxAsyncClick } from '../async-click/async-click.directive';\nimport { CngxFailed, CngxPending, CngxSucceeded } from '../async-click/async-status-templates';\n\n/**\n * Display bucket a reflector collapses an {@link CngxAsyncState} into.\n * The `loading` / `refreshing` busy variants fold into `pending` for the\n * visible status, while `isBusy` carries the full busy set for ARIA.\n *\n * @category common/interactive\n */\nexport type CngxAsyncDisplayStatus = 'idle' | 'pending' | 'success' | 'error';\n\n/**\n * Single source for collapsing a {@link CngxAsyncState} into its display\n * bucket. Owned by the {@link CngxAsyncStatus} reflector so every consumer\n * (the reflector directive, `CngxActionButton`'s `[externalState]` branch)\n * maps an externally-owned state the same way - one reflection code path.\n *\n * @category common/interactive\n */\nexport function reflectAsyncDisplayStatus(\n state: CngxAsyncState<unknown> | null | undefined,\n): CngxAsyncDisplayStatus {\n switch (state?.status()) {\n case 'pending':\n case 'loading':\n case 'refreshing':\n return 'pending';\n case 'success':\n return 'success';\n case 'error':\n return 'error';\n default:\n return 'idle';\n }\n}\n\n/**\n * Reflects an externally-owned {@link CngxAsyncState} onto its host -\n * the read-only sibling of `CngxAsyncClick`. Where `CngxAsyncClick`\n * *runs* an action and owns its own lifecycle, `CngxAsyncStatus` *reads*\n * a state someone else produces (a presenter's `commitState`, a resource)\n * and surfaces it as `aria-busy`, an optional disabled gate, and the\n * pending / succeeded / failed slot markers.\n *\n * One responsibility - reflection - kept distinct from running an action\n * (Pillar 3). `aria-busy` lives in the `computed()` graph (Pillar 2) and\n * is owned here exclusively: never co-place this with `CngxAsyncClick` on\n * the same element, since both bind `aria-busy` (dev mode warns).\n *\n * ```html\n * <button [cngxAsyncStatus]=\"presenter.commitState\" disableWhilePending>\n * Continue\n * <ng-template cngxPending>Saving…</ng-template>\n * </button>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-status/async-status.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAsyncClick, CngxPending, CngxSucceeded, CngxFailed\n */\n@Directive({\n selector: '[cngxAsyncStatus]',\n standalone: true,\n exportAs: 'cngxAsyncStatus',\n host: {\n '[attr.aria-busy]': 'isBusy() || null',\n '[attr.aria-disabled]': 'disabledAttr() !== null || null',\n '[attr.disabled]': 'disabledAttr()',\n },\n})\nexport class CngxAsyncStatus {\n private readonly coPlacedAsyncClick = inject(CngxAsyncClick, { self: true, optional: true });\n\n constructor() {\n if (isDevMode() && this.coPlacedAsyncClick) {\n console.warn(\n 'CngxAsyncStatus: [cngxAsyncStatus] and [cngxAsyncClick] on the same element ' +\n 'both bind aria-busy. Use one or the other.',\n );\n }\n }\n\n /** The externally-owned state to reflect. `null` reflects as idle. */\n readonly state = input<CngxAsyncState<unknown> | null>(null, { alias: 'cngxAsyncStatus' });\n\n /** When `true`, the host reflects `aria-disabled` / `disabled` while busy. */\n readonly disableWhilePending = input<boolean>(false);\n\n /** Display bucket of the reflected state (`loading`/`refreshing` → `pending`). */\n readonly status: Signal<CngxAsyncDisplayStatus> = computed(() =>\n reflectAsyncDisplayStatus(this.state()),\n );\n\n /** `true` while the reflected state is busy (`loading` | `pending` | `refreshing`). */\n readonly isBusy: Signal<boolean> = computed(() => this.state()?.isBusy() ?? false);\n\n /** The reflected error value, or `undefined`. */\n readonly error: Signal<unknown> = computed(() => this.state()?.error());\n\n /** @internal */\n protected readonly pendingTpl = contentChild(CngxPending);\n /** @internal */\n protected readonly succeededTpl = contentChild(CngxSucceeded);\n /** @internal */\n protected readonly failedTpl = contentChild(CngxFailed);\n\n /**\n * The projected slot marker matching the current display bucket, or\n * `null` when none is projected. Bind via\n * `*ngTemplateOutlet=\"status.activeTemplate()\"`.\n */\n readonly activeTemplate: Signal<TemplateRef<unknown> | null> = computed(() => {\n switch (this.status()) {\n case 'pending':\n return this.pendingTpl()?.templateRef ?? null;\n case 'success':\n return this.succeededTpl()?.templateRef ?? null;\n case 'error':\n return this.failedTpl()?.templateRef ?? null;\n default:\n return null;\n }\n });\n\n /** @internal - `''` (set) while gated-and-busy, else `null` (absent). */\n protected readonly disabledAttr = computed<'' | null>(() =>\n this.disableWhilePending() && this.isBusy() ? '' : null,\n );\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, inject, input, output, signal, type Signal } from '@angular/core';\n\n/**\n * Clipboard copy behavior - forms-free version for `@cngx/common`.\n *\n * Place on a button or any clickable element. Copies the provided text to the\n * clipboard. Shows a `copied` signal for visual feedback (auto-resets after\n * `resetDelay`). Falls back to `execCommand('copy')` when Clipboard API is\n * unavailable.\n *\n * Unlike `CngxCopyValue` from `@cngx/forms/input`, this has no forms dependency\n * and lives at Level 2 (`@cngx/common`), making it available to any consumer.\n *\n * ### Copy a token\n * ```html\n * <code>{{ apiKey() }}</code>\n * <button [cngxCopyText]=\"apiKey()\" #cp=\"cngxCopyText\">\n * {{ cp.copied() ? 'Copied!' : 'Copy' }}\n * </button>\n * ```\n *\n * ### Copy with SR announcement\n * ```html\n * <button [cngxCopyText]=\"shareUrl()\">Copy Link</button>\n * <span aria-live=\"polite\" class=\"sr-only\">\n * {{ cp.copied() ? 'Link copied to clipboard' : '' }}\n * </span>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/copy/copy-text.directive.ts\n * @since 0.1.0\n * @relatedTo CngxCopyBlock, CngxCopyValue\n * <example-url>http://localhost:4200/#/common/interactive/copy/text/copy-token</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/copy/text/copy-url-with-sr-announcement</example-url>\n */\n@Directive({\n selector: '[cngxCopyText]',\n standalone: true,\n exportAs: 'cngxCopyText',\n host: {\n '(click)': 'copy()',\n },\n})\nexport class CngxCopyText {\n private readonly destroyRef = inject(DestroyRef);\n private readonly doc = inject(DOCUMENT);\n\n /** The text to copy to the clipboard. */\n readonly text = input.required<string>({ alias: 'cngxCopyText' });\n\n /** Duration in ms to keep `copied` true after a successful copy. */\n readonly resetDelay = input<number>(2000);\n\n private readonly copiedState = signal(false);\n private readonly failedState = signal(false);\n private resetTimer: ReturnType<typeof setTimeout> | null = null;\n\n /** `true` for `resetDelay` ms after a successful copy. */\n readonly copied: Signal<boolean> = this.copiedState.asReadonly();\n\n /** `true` when the last copy attempt failed (permission denied, etc.). Resets on next attempt. */\n readonly failed: Signal<boolean> = this.failedState.asReadonly();\n\n /** Whether the Clipboard API is available in this environment. */\n readonly supported = typeof navigator !== 'undefined' && !!navigator.clipboard;\n\n /** Emitted after a successful copy with the copied text. */\n readonly didCopy = output<string>();\n\n /** Emitted when a copy attempt fails. */\n readonly copyFailed = output<unknown>();\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n if (this.resetTimer != null) {\n clearTimeout(this.resetTimer);\n }\n });\n }\n\n /** Copies the text to the clipboard. */\n async copy(): Promise<void> {\n const value = this.text();\n if (!value) {\n return;\n }\n\n this.failedState.set(false);\n\n try {\n if (this.supported) {\n await navigator.clipboard.writeText(value);\n } else {\n this.fallbackCopy(value);\n }\n\n this.copiedState.set(true);\n this.didCopy.emit(value);\n\n if (this.resetTimer != null) {\n clearTimeout(this.resetTimer);\n }\n this.resetTimer = setTimeout(() => {\n this.copiedState.set(false);\n this.resetTimer = null;\n }, this.resetDelay());\n } catch (err: unknown) {\n this.failedState.set(true);\n this.copyFailed.emit(err);\n }\n }\n\n /** execCommand fallback for environments without Clipboard API. */\n private fallbackCopy(text: string): void {\n const textarea = this.doc.createElement('textarea');\n textarea.value = text;\n textarea.style.position = 'fixed';\n textarea.style.left = '-9999px';\n textarea.style.opacity = '0';\n this.doc.body.appendChild(textarea);\n textarea.select();\n this.doc.execCommand('copy');\n this.doc.body.removeChild(textarea);\n }\n}\n","import { ChangeDetectionStrategy, Component, input, ViewEncapsulation } from '@angular/core';\n\nimport { CngxCopyText } from './copy-text.directive';\n\n/**\n * Molecule: code/text block with a built-in copy button.\n *\n * Renders content in a container with a \"Copy\" button that uses `CngxCopyText`\n * internally. Shows \"Copied!\" feedback automatically. The copy button includes\n * an `aria-live` region for screen reader announcements.\n *\n * ### Copy a code snippet\n * ```html\n * <cngx-copy-block [value]=\"'npm install @cngx/common'\">\n * <code>npm install @cngx/common</code>\n * </cngx-copy-block>\n * ```\n *\n * ### Copy an API key\n * ```html\n * <cngx-copy-block [value]=\"apiKey()\" buttonLabel=\"Copy Key\">\n * {{ apiKey() }}\n * </cngx-copy-block>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/copy/copy-block.ts\n * @since 0.1.0\n * @relatedTo CngxCopyText\n * <example-url>http://localhost:4200/#/common/interactive/copy/block/api-key</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/copy/block/code-snippet</example-url>\n */\n@Component({\n selector: 'cngx-copy-block',\n exportAs: 'cngxCopyBlock',\n standalone: true,\n imports: [CngxCopyText],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-copy-block',\n },\n template: `\n <div class=\"cngx-copy-block__content\">\n <ng-content />\n </div>\n <button\n type=\"button\"\n class=\"cngx-copy-block__button\"\n [cngxCopyText]=\"value()\"\n #cp=\"cngxCopyText\"\n [class.cngx-copy-block__button--copied]=\"cp.copied()\"\n >\n {{ cp.copied() ? copiedLabel() : buttonLabel() }}\n <span aria-live=\"polite\" class=\"cngx-sr-only\">\n {{ cp.copied() ? srAnnouncement() : '' }}\n </span>\n </button>\n `,\n styleUrls: ['./copy-block.css'],\n})\nexport class CngxCopyBlock {\n /** The text value to copy to clipboard. */\n readonly value = input.required<string>();\n /** Label for the copy button. */\n readonly buttonLabel = input<string>('Copy');\n /** Label shown after successful copy. */\n readonly copiedLabel = input<string>('Copied!');\n /** Screen reader announcement on copy. */\n readonly srAnnouncement = input<string>('Copied to clipboard');\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, input, signal } from '@angular/core';\n\n/**\n * Touch/click ripple feedback without Material dependency.\n *\n * Creates a `<span class=\"cngx-ripple__wave\">` on pointer contact, positions it\n * via CSS custom properties (`--cngx-ripple-x`, `--cngx-ripple-y`, `--cngx-ripple-size`),\n * and removes it after the animation completes. ALL visual treatment - color, duration,\n * shape - is the consumer's CSS responsibility.\n *\n * Ships a companion `_ripple.scss` with sensible defaults.\n *\n * ### Button with ripple\n * ```html\n * <button cngxRipple>Click me</button>\n * ```\n *\n * ### Centered ripple for icon buttons\n * ```html\n * <button cngxRipple [rippleCentered]=\"true\" class=\"icon-btn\">\n * <mat-icon>favorite</mat-icon>\n * </button>\n * ```\n *\n * ### Disable ripple\n * ```html\n * <button cngxRipple [rippleDisabled]=\"isReducedMotion()\">Click</button>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/ripple/ripple.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPressable, CngxPressRipple, CngxHoverable\n * <example-url>http://localhost:4200/#/common/interactive/ripple/base/button-ripples</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/ripple/base/card-with-ripple</example-url>\n */\n@Directive({\n selector: '[cngxRipple]',\n exportAs: 'cngxRipple',\n standalone: true,\n host: {\n '[style.position]': '\"relative\"',\n '[style.overflow]': '\"hidden\"',\n '(pointerdown)': 'handlePointerDown($event)',\n },\n})\nexport class CngxRipple {\n /** Ripple color - passed as `--cngx-ripple-color` on the wave element. */\n readonly color = input<string>('currentColor', { alias: 'rippleColor' });\n /** Whether the ripple originates from the center of the host. */\n readonly centered = input<boolean>(false, { alias: 'rippleCentered' });\n /** Whether the ripple effect is disabled. */\n readonly disabled = input<boolean>(false, { alias: 'rippleDisabled' });\n\n private readonly activeState = signal(false);\n /** Whether a ripple animation is currently playing. */\n readonly active = this.activeState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n private prefersReducedMotion = false;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n const win = this.doc.defaultView;\n\n // Detect reduced motion preference (matchMedia may not exist in test/SSR)\n if (win?.matchMedia) {\n const mql = win.matchMedia('(prefers-reduced-motion: reduce)');\n this.prefersReducedMotion = mql.matches;\n const handler = (e: MediaQueryListEvent) => (this.prefersReducedMotion = e.matches);\n mql.addEventListener('change', handler);\n destroyRef.onDestroy(() => mql.removeEventListener('change', handler));\n }\n }\n\n /** @internal */\n protected handlePointerDown(event: PointerEvent): void {\n if (this.disabled() || this.prefersReducedMotion) {\n return;\n }\n\n const host = this.el.nativeElement as HTMLElement;\n const rect = host.getBoundingClientRect();\n\n let x: number;\n let y: number;\n if (this.centered()) {\n x = rect.width / 2;\n y = rect.height / 2;\n } else {\n x = event.clientX - rect.left;\n y = event.clientY - rect.top;\n }\n\n // Ripple size = diameter of circle that covers the entire host from the origin point\n const size =\n Math.max(\n Math.hypot(x, y),\n Math.hypot(rect.width - x, y),\n Math.hypot(x, rect.height - y),\n Math.hypot(rect.width - x, rect.height - y),\n ) * 2;\n\n const wave = this.doc.createElement('span');\n wave.className = 'cngx-ripple__wave';\n wave.style.setProperty('--cngx-ripple-x', `${x}px`);\n wave.style.setProperty('--cngx-ripple-y', `${y}px`);\n wave.style.setProperty('--cngx-ripple-size', `${size}px`);\n wave.style.setProperty('--cngx-ripple-color', this.color());\n\n host.appendChild(wave);\n this.activeState.set(true);\n\n // Remove after animation completes - guard against double-invocation\n let cleaned = false;\n const cleanup = () => {\n if (cleaned) {\n return;\n }\n cleaned = true;\n clearTimeout(fallbackTimer);\n wave.remove();\n this.activeState.set(false);\n };\n\n wave.addEventListener('animationend', cleanup, { once: true });\n // Fallback timeout in case animationend doesn't fire (e.g. display:none)\n const fallbackTimer = setTimeout(cleanup, 1000);\n }\n}\n","import { DestroyRef, Directive, inject, input, signal } from '@angular/core';\n\n/**\n * Provides instant press feedback via CSS class on `pointerdown`.\n *\n * Click feedback fires too late - press feedback is immediate (0ms latency).\n * The class is removed on `pointerup` with an optional delay to prevent\n * a visual flash on quick taps.\n *\n * The directive only toggles the `cngx-pressed` class. All visual treatment\n * (scale, opacity, color) is the consumer's CSS responsibility.\n *\n * ```css\n * .cngx-pressed { transform: scale(0.97); }\n * ```\n *\n * ### Button with press feedback\n * ```html\n * <button cngxPressable>Click me</button>\n * ```\n *\n * ### Card with custom delay\n * ```html\n * <div cngxPressable [pressableReleaseDelay]=\"120\" class=\"card\">\n * Tappable card\n * </div>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/ripple/pressable.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRipple, CngxPressRipple, CngxHoverable\n * <example-url>http://localhost:4200/#/common/interactive/gestures/pressable/press-feedback-on-buttons</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/gestures/pressable/tappable-card</example-url>\n */\n@Directive({\n selector: '[cngxPressable]',\n exportAs: 'cngxPressable',\n standalone: true,\n host: {\n '[class.cngx-pressed]': 'pressed()',\n '(pointerdown)': 'handlePointerDown()',\n '(pointerup)': 'handlePointerUp()',\n '(pointercancel)': 'handlePointerCancel()',\n '(pointerleave)': 'handlePointerCancel()',\n },\n})\nexport class CngxPressable {\n /** Minimum time in ms the pressed class stays active - prevents flash on quick taps. */\n readonly releaseDelay = input<number>(80, { alias: 'pressableReleaseDelay' });\n\n private readonly pressedState = signal(false);\n /** Whether the element is currently in the pressed state. */\n readonly pressed = this.pressedState.asReadonly();\n\n /** Pending timer handle for the delayed release. */\n private releaseTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n // Cancel any pending release timer on destroy to avoid writing to a dead directive.\n inject(DestroyRef).onDestroy(() => this.clearTimer());\n }\n\n /** @internal - sets pressed state immediately on pointer contact (0ms latency). */\n protected handlePointerDown(): void {\n this.clearTimer();\n this.pressedState.set(true);\n }\n\n /** @internal - releases after `releaseDelay` ms to prevent flash on quick taps. */\n protected handlePointerUp(): void {\n const delay = this.releaseDelay();\n if (delay > 0) {\n this.releaseTimer = setTimeout(() => this.pressedState.set(false), delay);\n } else {\n this.pressedState.set(false);\n }\n }\n\n /** @internal - immediate release on cancel/leave (no delay). */\n protected handlePointerCancel(): void {\n this.clearTimer();\n this.pressedState.set(false);\n }\n\n private clearTimer(): void {\n if (this.releaseTimer !== null) {\n clearTimeout(this.releaseTimer);\n this.releaseTimer = null;\n }\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { CngxPressable } from './pressable.directive';\nimport { CngxRipple } from './ripple.directive';\n\n/**\n * Molecule combining press feedback + ripple in a single directive.\n *\n * Composes `CngxPressable` and `CngxRipple` as `hostDirectives` so the consumer\n * gets both behaviors with one attribute. The `cngx-pressed` class and ripple wave\n * both activate on pointer contact.\n *\n * ### Button with press + ripple\n * ```html\n * <button cngxPressRipple>Click me</button>\n * ```\n *\n * ### With custom ripple color\n * ```html\n * <button cngxPressRipple [rippleColor]=\"'rgba(0,0,0,0.2)'\">Click</button>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/ripple/press-ripple.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPressable, CngxRipple\n * <example-url>http://localhost:4200/#/common/interactive/ripple/press/buttons-with-press-ripple</example-url>\n */\n@Directive({\n selector: '[cngxPressRipple]',\n exportAs: 'cngxPressRipple',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxPressable,\n inputs: ['pressableReleaseDelay'],\n },\n {\n directive: CngxRipple,\n inputs: ['rippleColor', 'rippleCentered', 'rippleDisabled'],\n },\n ],\n})\nexport class CngxPressRipple {}\n","import { Injectable } from '@angular/core';\nimport type { CngxDisclosure } from './disclosure.directive';\n\n/** Minimal interface for nav group instances tracked by the registry. */\nexport interface NavGroupRef {\n readonly disclosure: CngxDisclosure;\n}\n\n/**\n * Scoped registry for single-accordion coordination.\n *\n * Provided at the sidebar/nav container level - only groups within the\n * same provider scope coordinate. Not `providedIn: 'root'` on purpose.\n *\n * ```typescript\n * @Component({\n * providers: [\n * provideNavConfig({ singleAccordion: true }),\n * CngxNavGroupRegistry,\n * ],\n * })\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-group-registry.ts\n * @since 0.1.0\n * @relatedTo CngxNavGroup, CngxDisclosure\n */\n@Injectable()\nexport class CngxNavGroupRegistry {\n private readonly groups = new Set<NavGroupRef>();\n\n /** @internal */\n register(group: NavGroupRef): void {\n this.groups.add(group);\n }\n\n /** @internal */\n unregister(group: NavGroupRef): void {\n this.groups.delete(group);\n }\n\n /** Closes all groups except the specified one. */\n closeOthers(except: NavGroupRef): void {\n this.groups.forEach((group) => {\n if (group !== except && group.disclosure.opened()) {\n group.disclosure.close();\n }\n });\n }\n}\n","import { inject, InjectionToken, type Provider } from '@angular/core';\nimport { CngxNavGroupRegistry } from './nav-group-registry';\n\n/**\n * Configuration options for the cngx nav system.\n *\n * @category common/interactive\n */\nexport interface CngxNavConfig {\n /**\n * Indentation in px per depth level.\n * Applied via `--cngx-nav-indent` CSS custom property.\n * @default 12\n */\n indent?: number;\n\n /**\n * When `true`, only one `CngxNavGroup` can be open at a time within\n * the same provider scope. Opening one group closes the others.\n * @default false\n */\n singleAccordion?: boolean;\n\n /**\n * Default animation duration in ms for disclosure transitions.\n * Applied via `--cngx-nav-transition` CSS custom property.\n * @default 150\n */\n animationDuration?: number;\n}\n\n/**\n * A feature configuration function returned by `withXxx()` helpers.\n *\n * @category common/interactive\n */\nexport interface NavConfigFeature {\n /** @internal */\n readonly apply: (config: CngxNavConfig) => CngxNavConfig;\n /** @internal */\n readonly providers?: Provider[];\n}\n\n/** Default nav configuration values. */\nexport const CNGX_NAV_DEFAULTS: Readonly<Required<CngxNavConfig>> = {\n indent: 12,\n singleAccordion: false,\n animationDuration: 150,\n};\n\n/**\n * Injection token for nav system configuration.\n *\n * ### Using feature functions\n * ```typescript\n * @Component({\n * providers: [provideNavConfig(withSingleAccordion(), withNavIndent(16))],\n * })\n * class SidebarComponent { }\n * ```\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-config.ts\n * @since 0.1.0\n */\nexport const CNGX_NAV_CONFIG = new InjectionToken<CngxNavConfig>('CNGX_NAV_CONFIG');\n\n/**\n * Provides nav system configuration. Accepts `withXxx()` feature functions\n * for composable setup.\n *\n * Automatically includes `CngxNavGroupRegistry` when `singleAccordion` is enabled\n * (either directly or via `withSingleAccordion()`).\n *\n * ```typescript\n * providers: [provideNavConfig(withSingleAccordion(), withNavIndent(16))]\n * ```\n *\n * @category common/interactive\n */\nexport function provideNavConfig(...features: NavConfigFeature[]): Provider[] {\n const config = features.reduce<CngxNavConfig>((c, f) => f.apply(c), {});\n const extraProviders = features.flatMap((f) => f.providers ?? []);\n return [\n { provide: CNGX_NAV_CONFIG, useValue: config },\n ...extraProviders,\n ...(config.singleAccordion ? [CngxNavGroupRegistry] : []),\n ];\n}\n\n/**\n * Enables single-accordion mode - only one nav group can be open at a time.\n *\n * @category common/interactive\n */\nexport function withSingleAccordion(): NavConfigFeature {\n return { apply: (c) => ({ ...c, singleAccordion: true }) };\n}\n\n/**\n * Sets the indentation per depth level in px.\n *\n * @category common/interactive\n */\nexport function withNavIndent(px: number): NavConfigFeature {\n return { apply: (c) => ({ ...c, indent: px }) };\n}\n\n/**\n * Sets the animation duration for nav group expand/collapse in ms.\n *\n * @category common/interactive\n */\nexport function withNavAnimation(ms: number): NavConfigFeature {\n return { apply: (c) => ({ ...c, animationDuration: ms }) };\n}\n\n/**\n * Injects the resolved nav config, merging provided values with defaults.\n * Must be called in an injection context.\n *\n * @category common/interactive\n */\nexport function injectNavConfig(): Readonly<Required<CngxNavConfig>> {\n return { ...CNGX_NAV_DEFAULTS, ...inject(CNGX_NAV_CONFIG, { optional: true }) };\n}\n","import { computed, Directive, input, output, signal } from '@angular/core';\n\n/**\n * Generic expand/collapse (disclosure) behavior.\n *\n * Applied to the **trigger** element (button, heading, etc.). Manages\n * `aria-expanded` and `aria-controls` host attributes directly - no need\n * to compose `CngxAriaExpanded` separately.\n *\n * Supports controlled (`[cngxDisclosureOpened]`) and uncontrolled modes,\n * following the same pattern as `CngxDrawer` and `CngxSort`.\n *\n * The consumer decides how to render/hide the content. Two approaches:\n *\n * **DOM removal** (simplest, no animation):\n * ```html\n * @if (group.opened()) { <div id=\"content\">…</div> }\n * ```\n *\n * **Hidden attribute** (enables CSS transitions):\n * ```html\n * <div id=\"content\" [hidden]=\"!group.opened()\">…</div>\n * ```\n *\n * ### FAQ accordion\n * ```html\n * <button cngxDisclosure #faq=\"cngxDisclosure\" [controls]=\"'answer-1'\">\n * Question 1\n * </button>\n * @if (faq.opened()) {\n * <div id=\"answer-1\">Answer to question 1.</div>\n * }\n * ```\n *\n * ### Nav group with animation\n * ```html\n * <button cngxDisclosure #group=\"cngxDisclosure\" [controls]=\"'nav-items'\">\n * Settings\n * </button>\n * <div id=\"nav-items\" [hidden]=\"!group.opened()\" class=\"collapsible\">\n * <a href=\"/general\">General</a>\n * <a href=\"/security\">Security</a>\n * </div>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/disclosure.directive.ts\n * @since 0.1.0\n * @relatedTo CngxNavGroup, CngxExpandable\n * <example-url>http://localhost:4200/#/common/interactive/disclosure/basic-uncontrolled</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/disclosure/controlled-mode</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/disclosure/faq-accordion</example-url>\n */\n@Directive({\n selector: '[cngxDisclosure]',\n exportAs: 'cngxDisclosure',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'opened()',\n '[attr.aria-controls]': 'controls() ?? null',\n '(click)': 'toggle()',\n '(keydown.enter)': 'toggle()',\n '(keydown.space)': 'toggle(); $event.preventDefault()',\n },\n})\nexport class CngxDisclosure {\n /** Controlled opened state. When bound, takes precedence over internal state. */\n readonly openedInput = input<boolean | undefined>(undefined, { alias: 'cngxDisclosureOpened' });\n\n /** The `id` of the controlled content element. Sets `aria-controls`. */\n readonly controls = input<string | undefined>(undefined);\n\n private readonly openedState = signal(false);\n\n /** Resolved opened state - controlled input wins over internal state. */\n readonly opened = computed(() => this.openedInput() ?? this.openedState());\n\n /** Emitted when the opened state changes. */\n readonly openedChange = output<boolean>();\n\n /** Opens the disclosure. */\n open(): void {\n this.openedState.set(true);\n this.openedChange.emit(true);\n }\n\n /** Closes the disclosure. */\n close(): void {\n if (!this.opened()) {\n return;\n }\n this.openedState.set(false);\n this.openedChange.emit(false);\n }\n\n /** Toggles the disclosure between open and closed. */\n toggle(): void {\n if (this.opened()) {\n this.close();\n } else {\n this.open();\n }\n }\n}\n","import { DestroyRef, Directive, effect, inject, input } from '@angular/core';\nimport { CngxDisclosure } from './disclosure.directive';\nimport { CNGX_NAV_CONFIG, CNGX_NAV_DEFAULTS } from './nav-config';\nimport { CngxNavGroupRegistry } from './nav-group-registry';\n\n/**\n * Navigation accordion group - a collapsible section in a sidebar nav.\n *\n * Composes `CngxDisclosure` as a `hostDirective` for expand/collapse behavior.\n * Adds nav-specific semantics: depth tracking and CSS classes for styling.\n *\n * When `CNGX_NAV_CONFIG` is provided with `singleAccordion: true` and a\n * `CngxNavGroupRegistry` is in scope, opening this group closes all other\n * groups registered in the same registry.\n *\n * Applied to the **trigger** element (the group header button).\n * The consumer renders the content separately and wires `role=\"group\"`\n * and `aria-labelledby` on the content container.\n *\n * ### Basic\n * ```html\n * <button cngxNavGroup #group=\"cngxNavGroup\" [controls]=\"'settings-nav'\"\n * [depth]=\"0\" id=\"settings-label\">\n * Settings\n * </button>\n * @if (group.disclosure.opened()) {\n * <div id=\"settings-nav\" role=\"group\" [attr.aria-labelledby]=\"'settings-label'\">\n * <a cngxNavLink [depth]=\"1\">General</a>\n * <a cngxNavLink [depth]=\"1\">Security</a>\n * </div>\n * }\n * ```\n *\n * ### Single-accordion mode\n * ```typescript\n * @Component({\n * providers: [\n * provideNavConfig({ singleAccordion: true }),\n * CngxNavGroupRegistry,\n * ],\n * })\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-group.directive.ts\n * @since 0.1.0\n * @relatedTo CngxNavLink, CngxDisclosure, CngxNavGroupRegistry, CngxNavLabel\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>\n */\n@Directive({\n selector: '[cngxNavGroup]',\n exportAs: 'cngxNavGroup',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxDisclosure,\n inputs: ['cngxDisclosureOpened', 'controls'],\n outputs: ['openedChange'],\n },\n ],\n host: {\n '[class.cngx-nav-group]': 'true',\n '[class.cngx-nav-group--open]': 'disclosure.opened()',\n '[style.--cngx-nav-depth]': 'depth()',\n },\n})\nexport class CngxNavGroup {\n /** The composed disclosure instance - use `disclosure.opened()` to read state. */\n readonly disclosure = inject(CngxDisclosure, { host: true });\n\n /** Nesting depth for indentation. Consumer sets manually. */\n readonly depth = input<number>(0);\n\n private readonly registry = inject(CngxNavGroupRegistry, { optional: true });\n private readonly config = inject(CNGX_NAV_CONFIG, { optional: true });\n\n constructor() {\n this.registry?.register(this);\n inject(DestroyRef).onDestroy(() => this.registry?.unregister(this));\n\n const singleAccordion = this.config?.singleAccordion ?? CNGX_NAV_DEFAULTS.singleAccordion;\n const registry = this.registry;\n if (singleAccordion && registry) {\n effect(() => {\n if (this.disclosure.opened()) {\n registry.closeOthers(this);\n }\n });\n }\n }\n}\n","import { Directive, input } from '@angular/core';\n\n/**\n * Non-interactive section header for navigation groups.\n *\n * Renders as a visual label without semantic heading role by default.\n * Use `[heading]=\"true\"` to opt in to `role=\"heading\"` with `aria-level`\n * when the label genuinely represents a heading in the document outline.\n *\n * ### Section label (default - no heading role)\n * ```html\n * <span cngxNavLabel>@cngx/common</span>\n * ```\n *\n * ### With heading semantics (opt-in)\n * ```html\n * <span cngxNavLabel [heading]=\"true\" [level]=\"3\">Settings</span>\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-label.directive.ts\n * @since 0.1.0\n * @relatedTo CngxNavLink, CngxNavGroup, CngxNavBadge\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>\n */\n@Directive({\n selector: '[cngxNavLabel]',\n exportAs: 'cngxNavLabel',\n standalone: true,\n host: {\n '[class.cngx-nav-label]': 'true',\n '[attr.role]': 'heading() ? \"heading\" : null',\n '[attr.aria-level]': 'heading() ? level() : null',\n },\n})\nexport class CngxNavLabel {\n /** Whether to apply `role=\"heading\"`. Off by default to avoid inflating the heading outline. */\n readonly heading = input<boolean>(false);\n\n /** The heading level (2–6) when `heading` is true. */\n readonly level = input<number>(3);\n}\n","import {\n afterNextRender,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n} from '@angular/core';\n\n/**\n * Navigation link atom. Applied to `<a>` or `<button>` elements in a\n * sidebar or nav menu.\n *\n * Sets a `--cngx-nav-depth` CSS custom property for indentation and\n * toggles an `active` class. Does NOT depend on `@angular/router` -\n * the consumer wires `routerLinkActive` or binds `[active]` manually.\n *\n * ### With Router\n * ```html\n * <a cngxNavLink routerLink=\"/dashboard\" routerLinkActive\n * #rla=\"routerLinkActive\" [active]=\"rla.isActive\">\n * Dashboard\n * </a>\n * ```\n *\n * ### Manual active state\n * ```html\n * <a cngxNavLink [active]=\"currentRoute() === '/settings'\" href=\"/settings\">\n * Settings\n * </a>\n * ```\n *\n * ### Nested (depth-based indentation)\n * ```html\n * <a cngxNavLink [depth]=\"0\">Top level</a>\n * <a cngxNavLink [depth]=\"1\">Nested</a>\n * <a cngxNavLink [depth]=\"2\">Deep nested</a>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-link.directive.ts\n * @selector [cngxNavLink]\n * @since 0.1.0\n * @relatedTo CngxNavGroup, CngxNavLabel, CngxNavBadge, CngxDisclosure\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>\n */\n@Directive({\n selector: 'a[cngxNavLink], button[cngxNavLink]',\n exportAs: 'cngxNavLink',\n standalone: true,\n host: {\n '[class.cngx-nav-link]': 'true',\n '[class.cngx-nav-link--active]': 'active()',\n '[attr.aria-current]': 'active() ? ariaCurrent() : null',\n '[attr.tabindex]': 'needsFocusFix() ? 0 : null',\n '[attr.role]': \"needsFocusFix() ? 'link' : null\",\n '[style.--cngx-nav-depth]': 'depth()',\n },\n})\nexport class CngxNavLink {\n /**\n * `true` when the host `<a>` lacks an `href` attribute and needs `tabindex=\"0\"`\n * + `role=\"link\"` for keyboard focusability.\n *\n * Evaluated after the first render so Angular bindings such as `[href]` are\n * already resolved before the check runs.\n */\n readonly needsFocusFix = signal(false);\n\n private readonly initialized = signal(false);\n\n constructor() {\n const el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n\n afterNextRender(() => {\n if (el.tagName === 'A') {\n this.needsFocusFix.set(!el.hasAttribute('href'));\n }\n const text = el.textContent?.trim();\n if (text && !Object.hasOwn(el.dataset, 'initial')) {\n el.dataset['initial'] = text.charAt(0).toUpperCase();\n }\n this.initialized.set(true);\n });\n\n // Scroll into view when becoming active (e.g., after route change).\n // Skips the initial render to avoid scroll jank on page load.\n effect(() => {\n if (!this.initialized() || !this.active() || !this.scrollOnActive()) {\n return;\n }\n el.scrollIntoView?.({ block: 'nearest', behavior: 'smooth' });\n });\n }\n\n /** Whether this link is the currently active route/item. */\n readonly active = input<boolean>(false);\n\n /** Whether to scroll this link into view when it becomes active. */\n readonly scrollOnActive = input<boolean>(true);\n\n /**\n * The `aria-current` value when active. Screen readers announce this\n * to indicate the current page/step/location.\n *\n * Common values: `'page'` (default), `'step'`, `'location'`, `'true'`.\n */\n readonly ariaCurrent = input<string>('page');\n\n /** Nesting depth for indentation. Consumer sets manually - no ancestor injection. */\n readonly depth = input<number>(0);\n}\n","import { computed, Directive, input } from '@angular/core';\n\n/**\n * Visual variant for the nav badge.\n *\n * @category common/interactive\n */\nexport type NavBadgeVariant = 'count' | 'dot' | 'status';\n\n/**\n * Inline badge for navigation items - shows counts, dots, or status indicators.\n *\n * For generic in-place counter/dot indicators on arbitrary hosts (buttons,\n * avatars, icons), prefer `CngxBadge` from `@cngx/common/display`. `CngxNavBadge`\n * stays specialised for sidebar/link usage where the badge *is* the host span\n * and style is applied directly to it rather than to an injected child.\n *\n * Applies `aria-hidden=\"true\"` by default because badges typically duplicate\n * information already conveyed by the link text. When the badge conveys\n * unique information (e.g., unread count), provide `[ariaLabel]` to make\n * it accessible - this removes `aria-hidden` and adds a visually-hidden label.\n *\n * ### Decorative badge (aria-hidden, default)\n * ```html\n * <a cngxNavLink>Inbox <span cngxNavBadge [value]=\"5\">5</span></a>\n * ```\n *\n * ### Accessible badge (unique information)\n * ```html\n * <a cngxNavLink>\n * Notifications\n * <span cngxNavBadge [value]=\"3\" ariaLabel=\"3 unread\">3</span>\n * </a>\n * ```\n *\n * ### Dot indicator\n * ```html\n * <a cngxNavLink>Updates <span cngxNavBadge variant=\"dot\" [value]=\"1\"></span></a>\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-badge.directive.ts\n * @since 0.1.0\n * @relatedTo CngxNavLink, CngxNavGroup, CngxNavLabel, CngxBadge\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>\n */\n@Directive({\n selector: '[cngxNavBadge]',\n exportAs: 'cngxNavBadge',\n standalone: true,\n host: {\n '[class.cngx-nav-badge]': 'true',\n '[class.cngx-nav-badge--count]': \"variant() === 'count'\",\n '[class.cngx-nav-badge--dot]': \"variant() === 'dot'\",\n '[class.cngx-nav-badge--status]': \"variant() === 'status'\",\n '[class.cngx-nav-badge--hidden]': 'isEmpty()',\n '[attr.aria-hidden]': 'ariaLabel() ? null : true',\n '[attr.aria-label]': 'ariaLabel() ?? null',\n },\n})\nexport class CngxNavBadge {\n /** The badge value. Hidden when empty string, null, undefined, or 0. */\n readonly value = input<string | number | null | undefined>(undefined);\n\n /** Visual variant: `'count'` (number), `'dot'` (presence indicator), `'status'` (text). */\n readonly variant = input<NavBadgeVariant>('count');\n\n /**\n * Accessible label for the badge. When provided, `aria-hidden` is removed\n * and this label is announced by screen readers.\n */\n readonly ariaLabel = input<string | undefined>(undefined);\n\n /** Whether the badge should be visually hidden (empty/zero value). */\n readonly isEmpty = computed(() => {\n const v = this.value();\n return v === null || v === undefined || v === '' || v === 0;\n });\n}\n","import { computed, Directive, input, output, signal } from '@angular/core';\n\n/**\n * Passive expand/collapse contract for elements whose open state is driven\n * from the outside - typically a `CngxTreeController` or any component that\n * manages a shared expansion set. Mirrors `aria-expanded` and (optionally)\n * `aria-controls` into the host; carries no interaction of its own.\n *\n * Use `CngxDisclosure` instead for self-triggering expanders (FAQ, accordion\n * headings). The distinction is deliberate: a tree-item row is a selection\n * target, not a toggle - clicks, Enter, and Space belong to the selection\n * flow, while expand/collapse is wired to ArrowLeft/Right via a sibling nav\n * directive or to a dedicated twisty button.\n *\n * ```html\n * <div role=\"tree\" aria-label=\"Files\">\n * <div\n * role=\"treeitem\"\n * aria-level=\"1\"\n * cngxExpandable\n * [cngxExpandableOpen]=\"ctrl.isExpanded(id)()\"\n * [controls]=\"childrenId\"\n * >\n * <button\n * type=\"button\"\n * tabindex=\"-1\"\n * (click)=\"ctrl.toggle(id)\"\n * >▸</button>\n * <span>{{ label }}</span>\n * </div>\n * <div [id]=\"childrenId\" [hidden]=\"!ctrl.isExpanded(id)()\">…</div>\n * </div>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/expandable/expandable.directive.ts\n * @since 0.1.0\n * @relatedTo CngxHierarchicalNav, CngxTreeController, CngxRovingTabindex\n */\n@Directive({\n selector: '[cngxExpandable]',\n exportAs: 'cngxExpandable',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': 'controls() ?? null',\n },\n})\nexport class CngxExpandable {\n /** Controlled expanded state. When bound, wins over internal state. */\n readonly expandedInput = input<boolean | undefined>(undefined, {\n alias: 'cngxExpandableOpen',\n });\n\n /** `id` of the controlled content element, bound to `aria-controls`. */\n readonly controls = input<string | undefined>(undefined);\n\n private readonly expandedState = signal(false);\n\n /** Resolved expanded state (controlled input wins over internal state). */\n readonly expanded = computed(() => this.expandedInput() ?? this.expandedState());\n\n /** Emitted when the expanded state changes. */\n readonly expandedChange = output<boolean>();\n\n expand(): void {\n if (this.expanded()) {\n return;\n }\n this.expandedState.set(true);\n this.expandedChange.emit(true);\n }\n\n collapse(): void {\n if (!this.expanded()) {\n return;\n }\n this.expandedState.set(false);\n this.expandedChange.emit(false);\n }\n\n toggle(): void {\n if (this.expanded()) {\n this.collapse();\n } else {\n this.expand();\n }\n }\n}\n","import {\n DestroyRef,\n Directive,\n inject,\n InjectionToken,\n input,\n output,\n signal,\n} from '@angular/core';\n\n/**\n * Optional app-wide defaults for `CngxHoverIntent`'s dwell timings. Provide it\n * to move the `enterDelay` / `leaveDelay` fallbacks an organism composes the\n * atom with, without touching the per-instance input surface. Every key is\n * optional - an unset key keeps the atom's literal (120 / 0).\n *\n * @category common/interactive\n * @since 0.1.0\n */\nexport interface CngxHoverIntentDefaults {\n /** Fallback for `enterDelay` (ms) when the input is not bound. */\n readonly enterDelay?: number;\n /** Fallback for `leaveDelay` (ms) when the input is not bound. */\n readonly leaveDelay?: number;\n}\n\n/**\n * Optional DI fallback for `CngxHoverIntent`'s `enterDelay` / `leaveDelay`\n * input defaults. Resolution is `bound input -> injected default -> literal`\n * (120 / 0). A hostDirective input default cannot be overridden by the host\n * that composes it, so this token is the layered extension point any\n * hover-to-reveal organism uses to set app-wide dwell defaults. `optional`, so\n * standalone `[cngxHoverIntent]` stays byte-identical when the token is absent.\n *\n * @category common/interactive\n * @relatedTo CngxHoverIntent\n * @since 0.1.0\n */\nexport const CNGX_HOVER_INTENT_DEFAULTS = new InjectionToken<CngxHoverIntentDefaults>(\n 'CNGX_HOVER_INTENT_DEFAULTS',\n);\n\n/**\n * Debounced hover-intent primitive. Turns raw pointer enter/leave into a\n * boolean signal that flips `true` only after the pointer has rested on the\n * host for `enterDelay` ms of continuous hover, and back to `false` after\n * `leaveDelay` ms of continuous un-hover.\n *\n * A pointer that merely passes over the host never fires: the pending timer\n * is cancelled by the opposite event before it elapses. Use it for\n * hover-to-reveal panels, hover-to-prefetch triggers, or any affordance that\n * reads as nervous when it reacts to an instant `mouseenter`.\n *\n * The `active` signal is read-only - it is derived from pointer events and is\n * never consumer-writable, so it is exposed via `asReadonly()` plus an\n * `intentChange` output rather than a two-way `model()`. Pointer-only, no\n * keyboard surface: hover intent is a mouse concept and carries no ARIA.\n *\n * ### Hover to reveal\n * ```html\n * <div cngxHoverIntent #hi=\"cngxHoverIntent\" [enterDelay]=\"150\">\n * <span>Card</span>\n * @if (hi.active()) { <div class=\"detail\">…</div> }\n * </div>\n * ```\n *\n * ### Bind the edge\n * ```html\n * <a cngxHoverIntent (intentChange)=\"$event && prefetch()\">Link</a>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/hover-intent/hover-intent.directive.ts\n * @since 0.1.0\n * @relatedTo CngxHoverable, CngxLongPress, CngxExpandable\n * <example-url>http://localhost:4200/#/common/interactive/hover-intent/hover-to-reveal</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/hover-intent/hover-to-prefetch</example-url>\n */\n@Directive({\n selector: '[cngxHoverIntent]',\n exportAs: 'cngxHoverIntent',\n standalone: true,\n host: {\n '(pointerenter)': 'handleEnter()',\n '(pointerleave)': 'handleLeave()',\n },\n})\nexport class CngxHoverIntent {\n /**\n * Optional app-wide dwell defaults. Declared first so the input initialisers\n * below can source their fallback from it. Absent by default - standalone\n * `[cngxHoverIntent]` then keeps the 120 / 0 literals.\n */\n private readonly defaults = inject(CNGX_HOVER_INTENT_DEFAULTS, { optional: true });\n\n /** ms of continuous hover before `active` settles to `true`. */\n readonly enterDelay = input<number>(this.defaults?.enterDelay ?? 120);\n /** ms of continuous un-hover before `active` settles back to `false`. */\n readonly leaveDelay = input<number>(this.defaults?.leaveDelay ?? 0);\n\n private readonly intentState = signal(false);\n /** Debounced hover-intent state. `true` only after `enterDelay` ms of continuous hover. */\n readonly active = this.intentState.asReadonly();\n\n /** Emitted on every debounced edge: `true` on settle-in, `false` on settle-out. */\n readonly intentChange = output<boolean>();\n\n private pendingTimer: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.clearPending());\n }\n\n protected handleEnter(): void {\n this.schedule(true, this.enterDelay());\n }\n\n protected handleLeave(): void {\n this.schedule(false, this.leaveDelay());\n }\n\n private schedule(target: boolean, delay: number): void {\n this.clearPending();\n this.pendingTimer = setTimeout(() => {\n this.pendingTimer = undefined;\n if (this.intentState() === target) {\n return;\n }\n this.intentState.set(target);\n this.intentChange.emit(target);\n }, delay);\n }\n\n private clearPending(): void {\n if (this.pendingTimer !== undefined) {\n clearTimeout(this.pendingTimer);\n this.pendingTimer = undefined;\n }\n }\n}\n","import { InjectionToken, type ModelSignal, type WritableSignal } from '@angular/core';\n\n/**\n * Structural contract every cngx interactive value-bearing atom exposes\n * to its surrounding form-bridge. Consumers (`CngxFormBridge`, custom\n * adapters, test harnesses) pull the token off the host element and\n * reach the atom's primary value plus its disabled flag without\n * importing the concrete directive class.\n *\n * Two-way binding flows through `value` (a `ModelSignal<T>`, never a\n * plain `WritableSignal<T>`); the `model<T>()` requirement is part of\n * the contract because Signal Forms relies on `value()` being callable\n * AND `value.set(v)` triggering the change-event Angular emits for\n * `[(value)]` template syntax.\n *\n * `disabled` stays a `WritableSignal<boolean>` because consumers\n * typically derive it externally (`computed(() => parentDisabled() ||\n * fieldDisabled())` and forward into the atom) - `model<boolean>()`\n * would force every implementer into a two-way binding they do not\n * need.\n *\n * @category common/interactive\n */\nexport interface CngxControlValue<T = unknown> {\n readonly value: ModelSignal<T>;\n readonly disabled: WritableSignal<boolean>;\n}\n\n/**\n * DI token every cngx interactive atom registers via `useExisting:\n * <self>` so its host element doubles as a value-shape contract for\n * `CngxFormBridge` and any future Reactive-Forms / Signal-Forms\n * integration in `@cngx/forms/controls`.\n *\n * No `providedIn`, no factory: providing the token is the atom's\n * responsibility. A surrounding consumer that wants a sane fallback\n * (e.g. an inert read-only value) supplies one in its own `providers`\n * block - the token deliberately does not invent a default because\n * \"what is the value of an unbound control?\" has no library-level\n * answer.\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/control-value/control-value.token.ts\n * @since 0.1.0\n */\nexport const CNGX_CONTROL_VALUE = new InjectionToken<CngxControlValue>('CngxControlValue');\n","import { computed, type Signal, type WritableSignal } from '@angular/core';\nimport { decimalPlaces } from '@cngx/utils';\n\n/**\n * Inputs for {@link createSliderCore}. Every field is a `Signal`, so the\n * derived values track their sources without any manual sync. `value` is\n * the single writable source of truth - the only thing the keyboard and\n * pointer handlers ever mutate. `boundedMin` / `boundedMax` default to\n * `min` / `max`; a dual-thumb host narrows them to the sibling-thumb bound\n * so the cross-clamp math lives here rather than in an effect.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-core.ts\n * @since 0.1.0\n */\nexport interface CngxSliderCoreOptions {\n /** Writable source of truth. The only signal the core ever writes. */\n readonly value: WritableSignal<number>;\n /** Track lower bound. Also the snap-to-step origin. */\n readonly min: Signal<number>;\n /** Track upper bound. */\n readonly max: Signal<number>;\n /** Step granularity. `<= 0` disables snapping (continuous slider). */\n readonly step: Signal<number>;\n /** Effective lower bound (sibling clamp for a range thumb). Defaults to `min`. */\n readonly boundedMin?: Signal<number>;\n /** Effective upper bound (sibling clamp for a range thumb). Defaults to `max`. */\n readonly boundedMax?: Signal<number>;\n /**\n * Maps the current value to an `aria-valuetext` string (currency, dates,\n * t-shirt sizes). When omitted, `aria-valuetext` mirrors the numeric value.\n */\n readonly valueText?: (value: number) => string;\n}\n\n/**\n * Derived view and write surface produced by {@link createSliderCore}. All\n * read members are `computed()` from the option signals; all mutation goes\n * through the four imperative helpers, which snap-to-step and clamp before\n * writing. The directive binds `clampedValue` to `aria-valuenow`, `fraction`\n * to its thumb-position CSS var, and `ariaValueText` to `aria-valuetext`.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-core.ts\n * @since 0.1.0\n */\nexport interface CngxSliderCore {\n /** Raw model value (may sit outside the effective bounds until first write). */\n readonly value: Signal<number>;\n /** `value` snapped to step and clamped to the effective bounds - bind to `aria-valuenow`. */\n readonly clampedValue: Signal<number>;\n /** Position along the track in `[0, 1]` - bind to the thumb-position CSS var. */\n readonly fraction: Signal<number>;\n /** `fraction` as a `0..100` percentage. */\n readonly percent: Signal<number>;\n /** `aria-valuetext` string (formatter output or the numeric value). */\n readonly ariaValueText: Signal<string>;\n /** True when the clamped value sits on the effective lower bound. */\n readonly atMin: Signal<boolean>;\n /** True when the clamped value sits on the effective upper bound. */\n readonly atMax: Signal<boolean>;\n /** Snap and clamp `next`, then write it (no-op when unchanged). */\n setValue(next: number): void;\n /** Map a `[0, 1]` track fraction to a value, then {@link setValue} it. */\n setFromFraction(fraction: number): void;\n /** Move by `stepCount` steps from the current value (negative to decrease). */\n stepBy(stepCount: number): void;\n /** Jump to the effective lower bound. */\n stepToMin(): void;\n /** Jump to the effective upper bound. */\n stepToMax(): void;\n}\n\nfunction snapToStep(raw: number, origin: number, step: number): number {\n if (step <= 0 || !Number.isFinite(step)) {\n return raw;\n }\n const steps = Math.round((raw - origin) / step);\n const snapped = origin + steps * step;\n // Float-drift correction: 0.1 * 3 = 0.30000000000000004 otherwise leaks\n // into aria-valuenow. Round to the precision the step itself carries.\n const decimals = Math.max(decimalPlaces(step), decimalPlaces(origin));\n return Number(snapped.toFixed(decimals));\n}\n\nfunction clamp(value: number, lo: number, hi: number): number {\n if (hi < lo) {\n return lo;\n }\n return Math.min(hi, Math.max(lo, value));\n}\n\n/**\n * Pure factory for a slider's value derivation - the brain shared by\n * {@link CngxSlider} and each {@link CngxSliderThumb} of a range slider. It\n * owns no DI and no DOM: hand it the source signals, get back the clamped\n * value, the track fraction, the `aria-valuetext` string, and the four\n * mutation helpers the keyboard / pointer handlers call. Snapping and\n * bound-clamping live in {@link CngxSliderCore.setValue}, so every write\n * path stays valid without an effect syncing state (Pillar 1).\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-core.ts\n * @since 0.1.0\n * @relatedTo CngxSlider, CngxRangeSlider, CngxSliderThumb\n */\nexport function createSliderCore(options: CngxSliderCoreOptions): CngxSliderCore {\n const { value, min, max, step } = options;\n const boundedMin = options.boundedMin ?? min;\n const boundedMax = options.boundedMax ?? max;\n\n const clampedValue = computed(() =>\n clamp(snapToStep(value(), min(), step()), boundedMin(), boundedMax()),\n );\n\n const fraction = computed(() => {\n const lo = min();\n const span = max() - lo;\n if (span <= 0) {\n return 0;\n }\n return clamp((clampedValue() - lo) / span, 0, 1);\n });\n\n const percent = computed(() => fraction() * 100);\n\n const ariaValueText = computed(() => {\n const current = clampedValue();\n const format = options.valueText;\n return format ? format(current) : String(current);\n });\n\n const atMin = computed(() => clampedValue() <= boundedMin());\n const atMax = computed(() => clampedValue() >= boundedMax());\n\n const setValue = (next: number): void => {\n if (!Number.isFinite(next)) {\n return;\n }\n const resolved = clamp(snapToStep(next, min(), step()), boundedMin(), boundedMax());\n if (resolved !== value()) {\n value.set(resolved);\n }\n };\n\n return {\n value,\n clampedValue,\n fraction,\n percent,\n ariaValueText,\n atMin,\n atMax,\n setValue,\n setFromFraction: (f) => setValue(min() + clamp(f, 0, 1) * (max() - min())),\n stepBy: (stepCount) => setValue(clampedValue() + stepCount * (step() > 0 ? step() : 1)),\n stepToMin: () => setValue(boundedMin()),\n stepToMax: () => setValue(boundedMax()),\n };\n}\n","import type { CngxSliderCore } from './slider-core';\n\n/**\n * Maps a pointer position to a `0..1` track fraction against `el`'s geometry.\n * Vertical sliders measure bottom-up (fraction 0 at the lower edge) to match the\n * skin's bottom-anchored fill. Shared by the single slider and the range host so\n * the geometry math lives in exactly one place.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-interaction.ts\n * @since 0.1.0\n */\nexport function pointerFraction(\n el: HTMLElement,\n orientation: 'horizontal' | 'vertical',\n clientX: number,\n clientY: number,\n): number {\n const rect = el.getBoundingClientRect();\n const fraction =\n orientation === 'vertical'\n ? rect.height > 0\n ? (rect.bottom - clientY) / rect.height\n : 0\n : rect.width > 0\n ? (clientX - rect.left) / rect.width\n : 0;\n return Math.min(1, Math.max(0, fraction));\n}\n\n/** Options for {@link createSliderInteraction}. */\nexport interface CngxSliderInteractionOptions {\n /** The value core the handlers drive. */\n readonly core: CngxSliderCore;\n /** The focusable host element (pointer-capture target). */\n readonly el: HTMLElement;\n /** Whether interaction is currently disabled. */\n disabled(): boolean;\n /** Page-key jump size (absolute). */\n pageStep(): number;\n /** Map a pointer position to a `0..1` track fraction. */\n fractionFromPointer(clientX: number, clientY: number): number;\n}\n\n/** APG keyboard + pointer-drag handlers produced by {@link createSliderInteraction}. */\nexport interface CngxSliderInteraction {\n handleKeydown(event: KeyboardEvent): void;\n handlePointerDown(event: PointerEvent): void;\n handlePointerMove(event: PointerEvent): void;\n handlePointerUp(event: PointerEvent): void;\n}\n\n/**\n * Pure factory for a slider's keyboard + pointer-drag behaviour - the shared\n * interaction brain for both {@link CngxSlider} (single) and each\n * {@link CngxSliderThumb} (range). Arrow / Page / Home / End map onto the core's\n * step helpers; pointer-down captures the pointer and drags via the supplied\n * `fractionFromPointer`. Keeping this in one factory means the track and the\n * thumb cannot drift apart.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-interaction.ts\n * @since 0.1.0\n * @relatedTo createSliderCore, CngxSlider, CngxSliderThumb\n */\nexport function createSliderInteraction(\n options: CngxSliderInteractionOptions,\n): CngxSliderInteraction {\n const { core, el } = options;\n let dragging = false;\n\n const updateFromPointer = (event: PointerEvent): void => {\n core.setFromFraction(options.fractionFromPointer(event.clientX, event.clientY));\n };\n\n return {\n handleKeydown(event: KeyboardEvent): void {\n if (options.disabled()) {\n return;\n }\n const big = options.pageStep();\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n core.stepBy(1);\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n core.stepBy(-1);\n break;\n case 'PageUp':\n core.setValue(core.clampedValue() + big);\n break;\n case 'PageDown':\n core.setValue(core.clampedValue() - big);\n break;\n case 'Home':\n core.stepToMin();\n break;\n case 'End':\n core.stepToMax();\n break;\n default:\n return;\n }\n event.preventDefault();\n },\n\n handlePointerDown(event: PointerEvent): void {\n if (options.disabled()) {\n return;\n }\n try {\n el.setPointerCapture(event.pointerId);\n } catch {\n // setPointerCapture throws on an invalid pointerId (synthetic events in\n // some test envs) - the drag still works without capture.\n }\n dragging = true;\n el.focus();\n updateFromPointer(event);\n event.preventDefault();\n },\n\n handlePointerMove(event: PointerEvent): void {\n if (!dragging) {\n return;\n }\n updateFromPointer(event);\n },\n\n handlePointerUp(event: PointerEvent): void {\n if (!dragging) {\n return;\n }\n dragging = false;\n try {\n el.releasePointerCapture(event.pointerId);\n } catch {\n // Already released by the browser (e.g. on pointercancel) - ignore.\n }\n },\n };\n}\n","import { computed, Directive, ElementRef, inject, input, model } from '@angular/core';\n\nimport { createSliderCore } from './slider-core';\nimport { createSliderInteraction, pointerFraction } from './slider-interaction';\n\n/**\n * Headless single-thumb slider brain. Put `cngxSliderTrack` on your own track\n * element and the directive turns it into an APG-conformant `role=\"slider\"`:\n * full keyboard (Arrow / Page / Home / End), pointer-drag with capture, and the\n * whole ARIA value surface (`aria-valuemin/max/now/valuetext/orientation`)\n * computed from `value`/`min`/`max`/`step`. The value is a `model<number>()`,\n * so Angular Signal Forms binds it two-way via `[control]` with no forms import.\n *\n * Most consumers want the finished {@link CngxSlider} component (`<cngx-slider>`)\n * which renders the track / fill / thumb for you and uses this directive as its\n * brain. Reach for `cngxSliderTrack` only when you want to own the skin markup.\n *\n * Positioning is left to the skin: the directive publishes the thumb position\n * as the inherited custom property `--cngx-slider-fraction` (0..1), which the\n * track / fill / thumb read. The default look ships as Track-B CSS in\n * `@cngx/themes/cngx.css`.\n *\n * ```html\n * <label id=\"vol-label\">Volume</label>\n * <div cngxSliderTrack aria-labelledby=\"vol-label\" [(value)]=\"volume\" [min]=\"0\" [max]=\"11\">\n * <span class=\"cngx-slider__track\"><span class=\"cngx-slider__fill\"></span></span>\n * <span class=\"cngx-slider__thumb\"></span>\n * </div>\n * ```\n *\n * Reach for {@link CngxRangeSliderTrack} when you need two thumbs (a min/max range).\n *\n * @category common/interactive/slider\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSlider, CngxRangeSliderTrack, CngxSliderThumb, createSliderCore\n */\n@Directive({\n selector: '[cngxSliderTrack]',\n exportAs: 'cngxSliderTrack',\n standalone: true,\n host: {\n role: 'slider',\n '[attr.aria-valuemin]': 'min()',\n '[attr.aria-valuemax]': 'max()',\n '[attr.aria-valuenow]': 'core.clampedValue()',\n '[attr.aria-valuetext]': 'core.ariaValueText()',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.aria-disabled]': 'disabled() || null',\n '[attr.tabindex]': 'disabled() ? -1 : 0',\n '[style.touch-action]': \"'none'\",\n '[style.--cngx-slider-fraction]': 'core.fraction()',\n '(keydown)': 'interaction.handleKeydown($event)',\n '(pointerdown)': 'interaction.handlePointerDown($event)',\n '(pointermove)': 'interaction.handlePointerMove($event)',\n '(pointerup)': 'interaction.handlePointerUp($event)',\n '(pointercancel)': 'interaction.handlePointerUp($event)',\n },\n})\nexport class CngxSliderTrack {\n /** Two-way value. The only state the keyboard / pointer handlers write. */\n readonly value = model<number>(0);\n /** Track lower bound (`aria-valuemin`). */\n readonly min = input<number>(0);\n /** Track upper bound (`aria-valuemax`). */\n readonly max = input<number>(100);\n /** Step granularity. `<= 0` makes the slider continuous. */\n readonly step = input<number>(1);\n /**\n * Page-key jump size (absolute, not a step multiple). Defaults to the\n * larger of one step and a tenth of the range.\n */\n readonly largeStep = input<number | undefined>(undefined);\n /** Whether the slider is disabled (blocks keyboard and pointer, `tabindex=-1`). */\n readonly disabled = input<boolean>(false);\n /** Track axis. Drives `aria-orientation` and the pointer-to-fraction math. */\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n /** Optional `aria-valuetext` formatter (currency, dates, named stops). */\n readonly valueText = input<((value: number) => string) | undefined>(undefined);\n\n private readonly el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n\n /** Shared value/step/aria derivation. */\n protected readonly core = createSliderCore({\n value: this.value,\n min: this.min,\n max: this.max,\n step: this.step,\n valueText: (v) => {\n const format = this.valueText();\n return format ? format(v) : String(v);\n },\n });\n\n /** Thumb position along the track in `[0, 1]`. For a skin to read. */\n readonly fraction = this.core.fraction;\n /** Snapped + clamped value (`aria-valuenow`). For a skin to read. */\n readonly currentValue = this.core.clampedValue;\n /** Formatted display string (`aria-valuetext`). For a visible value label. */\n readonly displayValue = this.core.ariaValueText;\n\n private readonly pageStep = computed(() => {\n const explicit = this.largeStep();\n if (explicit && explicit > 0) {\n return explicit;\n }\n const grid = this.step() > 0 ? this.step() : 1;\n return Math.max(grid, (this.max() - this.min()) / 10);\n });\n\n /** Shared keyboard + pointer-drag handlers (same factory the range thumb uses). */\n protected readonly interaction = createSliderInteraction({\n core: this.core,\n el: this.el,\n disabled: () => this.disabled(),\n pageStep: () => this.pageStep(),\n fractionFromPointer: (x, y) => pointerFraction(this.el, this.orientation(), x, y),\n });\n}\n","/**\n * Tick stops from `min` to `max` stepping by `step`, for rendering tick marks +\n * labels. Returns `[]` when the step grid is invalid or denser than `maxCount`\n * (a guard against pathological DOM, e.g. step 1 over a 0..10000 range).\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-ticks.ts\n * @since 0.1.0\n */\nimport { computed, type Signal } from '@angular/core';\nimport { arrayEqual, decimalPlaces } from '@cngx/utils';\n\n/** Tick view produced by {@link createSliderTicks}. */\nexport interface CngxSliderTicksView {\n /** Tick spacing as a track percentage string (e.g. `\"5%\"`), or `null` when marks are off. */\n readonly interval: Signal<string | null>;\n /** Numeric tick stops for labels (empty when labels are off or the grid is too dense). */\n readonly values: Signal<number[]>;\n /** Track fraction `[0, 1]` of a tick value, for positioning its label. */\n fractionOf(value: number): number;\n}\n\n/**\n * Derives a slider's tick marks + labels from its bounds, shared by\n * {@link CngxSlider} and {@link CngxRangeSlider} so the math lives once. `marks`\n * gates the repeating-gradient interval; `labels` gates the numeric stops; both\n * are independent. The values signal is `arrayEqual`-guarded.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-ticks.ts\n * @since 0.1.0\n */\nexport function createSliderTicks(options: {\n readonly min: Signal<number>;\n readonly max: Signal<number>;\n readonly step: Signal<number>;\n readonly marks: Signal<boolean>;\n readonly labels: Signal<boolean>;\n}): CngxSliderTicksView {\n const { min, max, step, marks, labels } = options;\n\n const interval = computed<string | null>(() => {\n if (!marks()) {\n return null;\n }\n const span = max() - min();\n if (span <= 0 || step() <= 0) {\n return null;\n }\n return `${(step() / span) * 100}%`;\n });\n\n const values = computed<number[]>(\n () => (labels() ? sliderTickValues(min(), max(), step()) : []),\n { equal: arrayEqual },\n );\n\n return {\n interval,\n values,\n fractionOf: (value) => {\n const span = max() - min();\n return span > 0 ? (value - min()) / span : 0;\n },\n };\n}\n\nexport function sliderTickValues(min: number, max: number, step: number, maxCount = 21): number[] {\n const span = max - min;\n if (step <= 0 || span <= 0) {\n return [];\n }\n const count = Math.floor(span / step);\n if (count + 1 > maxCount) {\n return [];\n }\n const decimals = decimalPlaces(step);\n const stops: number[] = [];\n for (let i = 0; i <= count; i++) {\n stops.push(Number((min + i * step).toFixed(decimals)));\n }\n return stops;\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n inject,\n input,\n type TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { CngxSliderTrack } from './slider.directive';\nimport { createSliderTicks } from './slider-ticks';\n\n/**\n * Finished single-thumb slider. The 90% API: drop it in, bind `[(value)]`, done -\n * it renders the track, fill, and thumb for you and wires the full APG keyboard\n * and pointer-drag through its {@link CngxSliderTrack} brain (applied as a host\n * directive). The value is a `model<number>()`, so it binds two-way in Angular\n * Signal Forms via `[control]`; the `cngx-form-field` integration lives in\n * `@cngx/forms` ({@link CngxSliderFieldBridge}).\n *\n * Value display: `showValue` floats the formatted value permanently above the\n * thumb; `showValueBubble` shows it as a bubble only while the slider is focused\n * or dragged (Material-style). `showTicks` paints a step mark; `showTickLabels`\n * adds numeric labels (formatted through `valueText`); `thumbGlyph` projects your\n * own handle content; `orientation=\"vertical\"` rotates the skin. Reach for the\n * headless {@link CngxSliderTrack} directive only when you need to own the skin;\n * use {@link CngxRangeSlider} for a two-thumb range.\n *\n * ```html\n * <label id=\"vol\">Volume</label>\n * <cngx-slider aria-labelledby=\"vol\" [(value)]=\"volume\" [min]=\"0\" [max]=\"100\" [step]=\"5\" showValueBubble />\n * ```\n *\n * @category common/interactive/slider\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider.component.ts\n * @since 0.1.0\n * @relatedTo CngxSliderTrack, CngxRangeSlider, CngxSliderFieldBridge\n */\n@Component({\n selector: 'cngx-slider',\n exportAs: 'cngxSlider',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrl: './slider.component.css',\n imports: [NgTemplateOutlet],\n hostDirectives: [\n {\n directive: CngxSliderTrack,\n inputs: ['value', 'min', 'max', 'step', 'largeStep', 'disabled', 'orientation', 'valueText'],\n outputs: ['valueChange'],\n },\n ],\n host: {\n class: 'cngx-slider',\n '[class.cngx-slider--ticks]': 'showTicks()',\n '[class.cngx-slider--bubble]': 'showValueBubble()',\n '[style.--cngx-slider-tick-interval]': 'ticks.interval()',\n },\n template: `\n <span class=\"cngx-slider__track\"><span class=\"cngx-slider__fill\"></span></span>\n <span class=\"cngx-slider__thumb\">\n @if (thumbGlyph(); as glyph) {\n <ng-container *ngTemplateOutlet=\"glyph\" />\n }\n </span>\n @if (ticks.values().length) {\n <span class=\"cngx-slider__ticks\" aria-hidden=\"true\">\n @for (tick of ticks.values(); track tick) {\n <span class=\"cngx-slider__tick-label\" [style.--cngx-slider-tick-fraction]=\"ticks.fractionOf(tick)\">\n {{ format(tick) }}\n </span>\n }\n </span>\n }\n @if (showValue() && !showValueBubble()) {\n <span class=\"cngx-slider__value\" aria-hidden=\"true\">{{ brain.displayValue() }}</span>\n }\n @if (showValueBubble()) {\n <span class=\"cngx-slider__bubble\" aria-hidden=\"true\">{{ brain.displayValue() }}</span>\n }\n `,\n})\nexport class CngxSlider {\n /** Float the formatted current value permanently above the thumb (visual only). */\n readonly showValue = input(false, { transform: booleanAttribute });\n /** Show the formatted value as a bubble only while focused / dragged (visual only). */\n readonly showValueBubble = input(false, { transform: booleanAttribute });\n /** Paint a tick mark every `step` along the track. */\n readonly showTicks = input(false, { transform: booleanAttribute });\n /** Render a numeric label at every step stop (independent of `showTicks`). */\n readonly showTickLabels = input(false, { transform: booleanAttribute });\n /** Optional content projected into the thumb (an icon, a dot, a custom handle). */\n readonly thumbGlyph = input<TemplateRef<void> | null>(null);\n\n /** The brain host directive - exposes the derived value/fraction the skin reads. */\n protected readonly brain = inject(CngxSliderTrack);\n\n /** Tick marks + labels derivation (shared factory). */\n protected readonly ticks = createSliderTicks({\n min: this.brain.min,\n max: this.brain.max,\n step: this.brain.step,\n marks: this.showTicks,\n labels: this.showTickLabels,\n });\n\n /** Format a value through the bound `valueText` (so tick labels match the thumb). */\n protected format(value: number): string {\n const formatter = this.brain.valueText();\n return formatter ? formatter(value) : String(value);\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/** Which end of a range slider a {@link CngxSliderThumb} drives. */\nexport type CngxSliderThumbPosition = 'start' | 'end';\n\n/** Effective, sibling-clamped bounds a single thumb may move within. */\nexport interface CngxSliderThumbBounds {\n /** Lower bound: the track min for the start thumb, the start value for the end thumb. */\n readonly min: Signal<number>;\n /** Upper bound: the end value for the start thumb, the track max for the end thumb. */\n readonly max: Signal<number>;\n}\n\n/**\n * Contract a {@link CngxRangeSlider} provides so each {@link CngxSliderThumb}\n * can read the shared track config, learn its sibling-clamped bounds, and\n * write its end of the tuple - all without injecting the concrete parent\n * class (which would create a cyclic type and block Atomic Decompose). The\n * cross-clamp lives in {@link boundsFor}, so two thumbs can never pass each\n * other and no effect is needed to keep them ordered.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/range-slider.token.ts\n * @since 0.1.0\n * @relatedTo CngxRangeSlider, CngxSliderThumb\n */\nexport interface CngxSliderRangeHost {\n /** Track lower bound. */\n readonly min: Signal<number>;\n /** Track upper bound. */\n readonly max: Signal<number>;\n /** Step granularity shared by both thumbs. */\n readonly step: Signal<number>;\n /** Page-key jump size shared by both thumbs (absolute). Undefined = derive from range. */\n readonly largeStep: Signal<number | undefined>;\n /** Whether the whole range slider is disabled. */\n readonly disabled: Signal<boolean>;\n /** Track axis shared by both thumbs. */\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n /** Current `[start, end]` tuple - the single source of truth. */\n readonly value: Signal<readonly [number, number]>;\n /** Optional `aria-valuetext` formatter shared across both thumbs. */\n readonly valueText: Signal<((value: number) => string) | undefined>;\n /** Sibling-clamped bounds for one thumb, preventing thumb-cross. */\n boundsFor(position: CngxSliderThumbPosition): CngxSliderThumbBounds;\n /** Write one end of the tuple (the thumb's core has already snapped + clamped). */\n commit(position: CngxSliderThumbPosition, value: number): void;\n /**\n * Map a pointer position to a `0..1` fraction along the shared track, using\n * the range host's own geometry. A thumb cannot measure this itself - its\n * element is the tiny handle, not the full track - so the host owns the math.\n */\n fractionFromPointer(clientX: number, clientY: number): number;\n}\n\n/**\n * DI token for the {@link CngxSliderRangeHost} contract. {@link CngxRangeSlider}\n * provides it via `useExisting`; each {@link CngxSliderThumb} injects it up the\n * element-injector hierarchy.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/range-slider.token.ts\n * @since 0.1.0\n * @relatedTo CngxRangeSlider, CngxSliderThumb\n */\nexport const CNGX_SLIDER_RANGE = new InjectionToken<CngxSliderRangeHost>('CNGX_SLIDER_RANGE');\n","import { computed, Directive, ElementRef, inject, input, model } from '@angular/core';\n\nimport { pointerFraction } from './slider-interaction';\nimport {\n CNGX_SLIDER_RANGE,\n type CngxSliderRangeHost,\n type CngxSliderThumbBounds,\n type CngxSliderThumbPosition,\n} from './range-slider.token';\n\n/**\n * Headless dual-thumb (range) slider brain. Put `cngxRangeSliderTrack` on your\n * own track container and host two {@link CngxSliderThumb} children\n * (`start` / `end`); the value is a `model<[number, number]>()` tuple this\n * directive owns. It provides {@link CNGX_SLIDER_RANGE} so each thumb reads the\n * shared config, learns its sibling-clamped bounds, and commits its end. The\n * thumbs cannot cross because {@link boundsFor} narrows each thumb's range to\n * the other thumb's current value - clamp math, not an effect (Pillar 1).\n *\n * Most consumers want the finished {@link CngxRangeSlider} component\n * (`<cngx-range-slider>`) which renders the track, fill band, and both thumbs\n * and uses this directive as its brain. Reach for `cngxRangeSliderTrack` only\n * when you want to own the skin markup.\n *\n * ```html\n * <div cngxRangeSliderTrack role=\"group\" aria-label=\"Price range\" [(value)]=\"price\" [min]=\"0\" [max]=\"1000\">\n * <span class=\"cngx-slider__track\"></span>\n * <span cngxSliderThumb=\"start\" aria-label=\"Minimum\"></span>\n * <span cngxSliderThumb=\"end\" aria-label=\"Maximum\"></span>\n * </div>\n * ```\n *\n * @category common/interactive/slider\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/range-slider.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRangeSlider, CngxSliderThumb, createSliderCore\n */\n@Directive({\n selector: '[cngxRangeSliderTrack]',\n exportAs: 'cngxRangeSliderTrack',\n standalone: true,\n providers: [{ provide: CNGX_SLIDER_RANGE, useExisting: CngxRangeSliderTrack }],\n host: {\n role: 'group',\n '[attr.aria-disabled]': 'disabled() || null',\n '[attr.aria-orientation]': 'orientation()',\n '[style.--cngx-slider-start-fraction]': 'startFraction()',\n '[style.--cngx-slider-end-fraction]': 'endFraction()',\n },\n})\nexport class CngxRangeSliderTrack implements CngxSliderRangeHost {\n /** Two-way `[start, end]` tuple - the single source of truth for both thumbs. */\n readonly value = model<[number, number]>([0, 100]);\n /** Track lower bound. */\n readonly min = input<number>(0);\n /** Track upper bound. */\n readonly max = input<number>(100);\n /** Step granularity shared by both thumbs. */\n readonly step = input<number>(1);\n /**\n * Page-key jump size for both thumbs (absolute, not a step multiple).\n * Defaults to the larger of one step and a tenth of the range.\n */\n readonly largeStep = input<number | undefined>(undefined);\n /** Whether the range slider is disabled. */\n readonly disabled = input<boolean>(false);\n /** Track axis shared by both thumbs. */\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n /** Optional `aria-valuetext` formatter shared across both thumbs. */\n readonly valueText = input<((value: number) => string) | undefined>(undefined);\n\n // Sibling-clamp bounds. The start thumb's ceiling tracks the end value;\n // the end thumb's floor tracks the start value. Held as stable signals\n // (not recreated per boundsFor call) so each thumb's core reads one node.\n private readonly startBounds: CngxSliderThumbBounds = {\n min: this.min,\n max: computed(() => this.value()[1]),\n };\n private readonly endBounds: CngxSliderThumbBounds = {\n min: computed(() => this.value()[0]),\n max: this.max,\n };\n\n private readonly el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n\n // Track fractions of each thumb, published as CSS vars so the skin can paint\n // a fill between them. Derived from the tuple - never synced (Pillar 1).\n readonly startFraction = computed(() => this.fractionOf(this.value()[0]));\n readonly endFraction = computed(() => this.fractionOf(this.value()[1]));\n\n private fractionOf(value: number): number {\n const span = this.max() - this.min();\n if (span <= 0) {\n return 0;\n }\n return Math.min(1, Math.max(0, (value - this.min()) / span));\n }\n\n boundsFor(position: CngxSliderThumbPosition): CngxSliderThumbBounds {\n return position === 'start' ? this.startBounds : this.endBounds;\n }\n\n commit(position: CngxSliderThumbPosition, value: number): void {\n const [start, end] = this.value();\n if (position === 'start') {\n if (value !== start) {\n this.value.set([value, end]);\n }\n } else if (value !== end) {\n this.value.set([start, value]);\n }\n }\n\n fractionFromPointer(clientX: number, clientY: number): number {\n return pointerFraction(this.el, this.orientation(), clientX, clientY);\n }\n}\n","import {\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n type Signal,\n type WritableSignal,\n} from '@angular/core';\n\nimport { createSliderCore } from './slider-core';\nimport { createSliderInteraction } from './slider-interaction';\nimport {\n CNGX_SLIDER_RANGE,\n type CngxSliderRangeHost,\n type CngxSliderThumbPosition,\n} from './range-slider.token';\n\n/**\n * Builds a `WritableSignal<number>` view over one end of the range tuple:\n * reads `range.value()[index]` reactively, routes writes through\n * `range.commit(position, …)`. Lets a thumb run an ordinary\n * {@link createSliderCore} (which writes a `WritableSignal`) while the tuple\n * stays the single source of truth - no local state, no effect sync.\n */\nfunction createThumbValue(\n range: CngxSliderRangeHost,\n position: Signal<CngxSliderThumbPosition>,\n): WritableSignal<number> {\n const read = computed(() => {\n const [start, end] = range.value();\n return position() === 'start' ? start : end;\n });\n const accessor = Object.assign(() => read(), {\n set: (next: number) => range.commit(position(), next),\n update: (updater: (prev: number) => number) => range.commit(position(), updater(read())),\n asReadonly: () => read,\n });\n return accessor as unknown as WritableSignal<number>;\n}\n\n/**\n * One focusable thumb of a {@link CngxRangeSlider}. Place `cngxSliderThumb` on\n * each thumb element with `\"start\"` or `\"end\"`; the directive turns it into an\n * independent `role=\"slider\"` with its own `aria-valuenow`/`valuetext` and APG\n * keyboard, bounded by the sibling thumb so the two can never cross. It reads\n * the shared track config from {@link CNGX_SLIDER_RANGE} (injected up the\n * element-injector hierarchy) and commits its end through the host.\n *\n * Two focusable thumbs cannot be derived from a single host element, so each\n * thumb is its own directive - the headless contract the skin marks up.\n *\n * @category common/interactive/slider\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-thumb.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRangeSlider, CngxRangeSliderTrack, createSliderCore\n */\n@Directive({\n selector: '[cngxSliderThumb]',\n exportAs: 'cngxSliderThumb',\n standalone: true,\n host: {\n role: 'slider',\n '[attr.aria-valuemin]': 'bounds().min()',\n '[attr.aria-valuemax]': 'bounds().max()',\n '[attr.aria-valuenow]': 'core.clampedValue()',\n '[attr.aria-valuetext]': 'core.ariaValueText()',\n '[attr.aria-orientation]': 'range.orientation()',\n '[attr.aria-disabled]': 'range.disabled() || null',\n '[attr.tabindex]': 'range.disabled() ? -1 : 0',\n '[style.touch-action]': \"'none'\",\n '[style.--cngx-slider-fraction]': 'core.fraction()',\n '(keydown)': 'interaction.handleKeydown($event)',\n '(pointerdown)': 'interaction.handlePointerDown($event)',\n '(pointermove)': 'interaction.handlePointerMove($event)',\n '(pointerup)': 'interaction.handlePointerUp($event)',\n '(pointercancel)': 'interaction.handlePointerUp($event)',\n },\n})\nexport class CngxSliderThumb {\n /** Which end of the range this thumb drives. Bound from the selector. */\n readonly position = input.required<CngxSliderThumbPosition>({ alias: 'cngxSliderThumb' });\n\n protected readonly range = inject(CNGX_SLIDER_RANGE);\n private readonly el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n\n /** Sibling-clamped bounds for this thumb, selected reactively by position. */\n protected readonly bounds = computed(() => this.range.boundsFor(this.position()));\n\n private readonly value = createThumbValue(this.range, this.position);\n\n /** Shared value/step/aria derivation, bounded by the sibling thumb. */\n protected readonly core = createSliderCore({\n value: this.value,\n min: this.range.min,\n max: this.range.max,\n step: this.range.step,\n boundedMin: computed(() => this.bounds().min()),\n boundedMax: computed(() => this.bounds().max()),\n valueText: (v) => {\n const format = this.range.valueText();\n return format ? format(v) : String(v);\n },\n });\n\n private readonly pageStep = computed(() => {\n const explicit = this.range.largeStep();\n if (explicit && explicit > 0) {\n return explicit;\n }\n const grid = this.range.step() > 0 ? this.range.step() : 1;\n return Math.max(grid, (this.range.max() - this.range.min()) / 10);\n });\n\n // Shared keyboard + pointer-drag handlers. The pointer math measures against\n // the shared track (the range host owns the geometry), not this thumb's own\n // tiny handle element.\n protected readonly interaction = createSliderInteraction({\n core: this.core,\n el: this.el,\n disabled: () => this.range.disabled(),\n pageStep: () => this.pageStep(),\n fractionFromPointer: (x, y) => this.range.fractionFromPointer(x, y),\n });\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n type TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { CngxRangeSliderTrack } from './range-slider.directive';\nimport { CngxSliderThumb } from './slider-thumb.directive';\nimport { createSliderTicks } from './slider-ticks';\n\n/**\n * Finished two-thumb (range) slider. Drop it in, bind `[(value)]` to a\n * `[number, number]` tuple - it renders the track, the fill band between the\n * thumbs, and both draggable handles, and wires the full APG keyboard +\n * pointer-drag through its {@link CngxRangeSliderTrack} brain. The thumbs cannot\n * cross because the brain clamps each to the other.\n *\n * `showValue` floats a single `start - end` label between the thumbs (so the two\n * never overlap); `showTicks` paints a step tick along the track; `thumbGlyph`\n * projects content into both handles; `orientation=\"vertical\"` rotates the skin.\n * Reach for the headless {@link CngxRangeSliderTrack} directive only when you\n * need to own the skin markup; use {@link CngxSlider} for a single thumb.\n *\n * ```html\n * <cngx-range-slider aria-label=\"Price\" [(value)]=\"price\" [min]=\"0\" [max]=\"1000\" [step]=\"10\" />\n * ```\n *\n * @category common/interactive/slider\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/range-slider.component.ts\n * @since 0.1.0\n * @relatedTo CngxRangeSliderTrack, CngxSlider, CngxSliderThumb\n */\n@Component({\n selector: 'cngx-range-slider',\n exportAs: 'cngxRangeSlider',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrl: './range-slider.component.css',\n imports: [CngxSliderThumb, NgTemplateOutlet],\n hostDirectives: [\n {\n directive: CngxRangeSliderTrack,\n inputs: ['value', 'min', 'max', 'step', 'largeStep', 'disabled', 'orientation', 'valueText'],\n outputs: ['valueChange'],\n },\n ],\n host: {\n class: 'cngx-slider cngx-range-slider',\n '[class.cngx-slider--ticks]': 'showTicks()',\n '[class.cngx-slider--bubble]': 'showValueBubble()',\n '[style.--cngx-slider-tick-interval]': 'ticks.interval()',\n },\n template: `\n <span class=\"cngx-slider__track\"></span>\n <span cngxSliderThumb=\"start\" [attr.aria-label]=\"startLabel()\">\n @if (thumbGlyph(); as glyph) {\n <ng-container *ngTemplateOutlet=\"glyph\" />\n }\n </span>\n <span cngxSliderThumb=\"end\" [attr.aria-label]=\"endLabel()\">\n @if (thumbGlyph(); as glyph) {\n <ng-container *ngTemplateOutlet=\"glyph\" />\n }\n </span>\n @if (ticks.values().length) {\n <span class=\"cngx-slider__ticks\" aria-hidden=\"true\">\n @for (tick of ticks.values(); track tick) {\n <span class=\"cngx-slider__tick-label\" [style.--cngx-slider-tick-fraction]=\"ticks.fractionOf(tick)\">\n {{ format(tick) }}\n </span>\n }\n </span>\n }\n @if (showValue() || showValueBubble()) {\n <span\n class=\"cngx-slider__value cngx-slider__value--range\"\n [class.cngx-slider__bubble]=\"showValueBubble()\"\n aria-hidden=\"true\"\n [style.--cngx-slider-mid-fraction]=\"midFraction()\"\n >\n {{ format(brain.value()[0]) }} - {{ format(brain.value()[1]) }}\n </span>\n }\n `,\n})\nexport class CngxRangeSlider {\n /** Accessible name of the start (minimum) thumb. EN default. */\n readonly startLabel = input<string>('Minimum');\n /** Accessible name of the end (maximum) thumb. EN default. */\n readonly endLabel = input<string>('Maximum');\n /** Render the formatted `start - end` values centred between the thumbs (visual only). */\n readonly showValue = input(false, { transform: booleanAttribute });\n /** Show the combined `start - end` value as a bubble only while focused / dragged. */\n readonly showValueBubble = input(false, { transform: booleanAttribute });\n /** Paint a tick mark every `step` along the track. */\n readonly showTicks = input(false, { transform: booleanAttribute });\n /** Render a numeric label at every step stop (independent of `showTicks`). */\n readonly showTickLabels = input(false, { transform: booleanAttribute });\n /** Optional content projected into both thumbs. */\n readonly thumbGlyph = input<TemplateRef<void> | null>(null);\n\n /** The brain host directive - owns the tuple and the track geometry. */\n protected readonly brain = inject(CngxRangeSliderTrack);\n\n /** Midpoint of the two thumbs (0..1) - anchors the single combined value label. */\n protected readonly midFraction = computed(\n () => (this.brain.startFraction() + this.brain.endFraction()) / 2,\n );\n\n /** Tick marks + labels derivation (shared factory). */\n protected readonly ticks = createSliderTicks({\n min: this.brain.min,\n max: this.brain.max,\n step: this.brain.step,\n marks: this.showTicks,\n labels: this.showTickLabels,\n });\n\n protected format(value: number): string {\n const formatter = this.brain.valueText();\n return formatter ? formatter(value) : String(value);\n }\n}\n","import type { Signal } from '@angular/core';\n\n/**\n * Registration handle a {@link CngxAccordionPanel} header passes to its\n * coordinator so the keyboard-nav factory can rove between headers without\n * discovering them through `contentChildren`. `contentChildren` never crosses\n * a child component's view boundary, so an accordion skin that renders each\n * header inside its own item view would rove over zero items; a registered\n * handle carries the header's live `element` and `disabled` state by reference\n * and is immune to that boundary.\n *\n * @category common/interactive/accordion\n */\nexport interface CngxAccordionHeaderHandle {\n /** Stable id of the panel this header controls. */\n readonly id: string;\n /** The header button element, used for DOM-order sorting and focus movement. */\n readonly element: HTMLElement;\n /** Whether this header is disabled (skipped by roving, not a tab stop). */\n readonly disabled: Signal<boolean>;\n}\n\n/**\n * Resolved keyboard surface for an accordion's headers. The panel binds\n * `tabindex` from {@link headerTabindex} and routes its `(keydown)` through\n * {@link handleKeydown}; a single header - the coordinator's `rovingActiveId` -\n * is the group's lone tab stop, so `Tab` always lands on it.\n *\n * @category common/interactive/accordion\n */\nexport interface CngxAccordionKeyboardNav {\n /**\n * Roving `tabindex` for a header: `0` for the header whose id matches the\n * coordinator's `rovingActiveId`, `-1` for every other. Derived from a\n * single source (Pillar 1 - never a second index to keep in sync).\n */\n headerTabindex(handle: CngxAccordionHeaderHandle): 0 | -1;\n /**\n * WAI-ARIA accordion navigation: ArrowUp/ArrowDown move between headers in\n * DOM order (Home/End jump to the first/last), skipping disabled headers,\n * looping at the edges. Moves DOM focus to the target and records it via\n * `host.setRovingActive(id)`. Returns silently for any other key so the\n * caller can chain further handlers.\n */\n handleKeydown(event: KeyboardEvent): void;\n}\n\n/**\n * Coordinator surface {@link createAccordionKeyboardNav} reads. The\n * `CngxAccordion` directive implements it; the factory stays a pure\n * `create*` (no `inject()`) so it works in any injection context and is\n * trivially unit-testable.\n *\n * @category common/interactive/accordion\n */\nexport interface CngxAccordionKeyboardNavHost {\n /** Every registered header, in registration order (the factory re-sorts by DOM position). */\n readonly headers: Signal<readonly CngxAccordionHeaderHandle[]>;\n /** Id of the header that is currently the group's single tab stop, or `null`. */\n readonly rovingActiveId: Signal<string | null>;\n /** Record the header the roving stop should move to. */\n setRovingActive(id: string): void;\n}\n\n/**\n * Inputs to {@link createAccordionKeyboardNav}. The coordinator owns the\n * registry and the roving source; focus scoping needs no container reference\n * because each handle carries its own `element`.\n *\n * @category common/interactive/accordion\n */\nexport interface CngxAccordionKeyboardNavOptions {\n readonly host: CngxAccordionKeyboardNavHost;\n}\n\n/**\n * Level-2 factory implementing the WAI-ARIA APG accordion keyboard model over\n * a registration model rather than `contentChildren` roving. Registration is\n * immune to component-view boundaries, so any accordion skin - the\n * `@cngx/ui/accordion` organism, or a future one that renders each header in\n * its own view - gets working Arrow/Home/End nav.\n *\n * Pillar 1 (Ableitung statt Verwaltung): the tab stop is derived from the\n * coordinator's `rovingActiveId`, not managed as a second index. Focus\n * movement is a DOM concern the factory owns - the coordinator only records\n * which header should be the stop; it never touches the DOM.\n *\n * @category common/interactive/accordion\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/accordion/accordion-keyboard-nav.ts\n * @since 0.1.0\n * @relatedTo CngxAccordion, CngxAccordionPanel, createTabKeyboardNav\n */\nexport function createAccordionKeyboardNav(\n opts: CngxAccordionKeyboardNavOptions,\n): CngxAccordionKeyboardNav {\n // Registered headers sorted by DOM position. `compareDocumentPosition`\n // orders elements as they appear in the composed document, so headers\n // rendered inside separate item views still rove in visual order - the\n // whole reason this replaces `contentChildren` roving.\n const orderedHeaders = (): readonly CngxAccordionHeaderHandle[] => {\n return opts.host.headers().slice().sort((a, b) => {\n const relation = a.element.compareDocumentPosition(b.element);\n if (relation & Node.DOCUMENT_POSITION_FOLLOWING) {\n return -1;\n }\n if (relation & Node.DOCUMENT_POSITION_PRECEDING) {\n return 1;\n }\n return 0;\n });\n };\n\n // Index of the header that currently owns the roving stop, clamped into the\n // sorted list. Navigation always originates from this header.\n const activeIndex = (headers: readonly CngxAccordionHeaderHandle[]): number => {\n const id = opts.host.rovingActiveId();\n const found = headers.findIndex((h) => h.id === id);\n return found >= 0 ? found : 0;\n };\n\n // Next enabled header index in `direction`, looping at the edges. Mirrors the\n // step geometry of `createTabKeyboardNav`; the two copies are tolerated until\n // a third roving-nav factory justifies a shared primitive (rule of three).\n const step = (\n headers: readonly CngxAccordionHeaderHandle[],\n from: number,\n direction: 1 | -1,\n ): number | null => {\n const len = headers.length;\n if (len === 0) {\n return null;\n }\n let idx = from + direction;\n for (let i = 0; i < len; i++) {\n idx = ((idx % len) + len) % len;\n if (!headers[idx].disabled()) {\n return idx;\n }\n idx += direction;\n }\n return null;\n };\n\n // First (direction 1) or last (direction -1) enabled header, for Home/End.\n const edge = (\n headers: readonly CngxAccordionHeaderHandle[],\n direction: 1 | -1,\n ): number | null => {\n const len = headers.length;\n if (direction === 1) {\n for (let i = 0; i < len; i++) {\n if (!headers[i].disabled()) {\n return i;\n }\n }\n } else {\n for (let i = len - 1; i >= 0; i--) {\n if (!headers[i].disabled()) {\n return i;\n }\n }\n }\n return null;\n };\n\n return {\n headerTabindex: (handle) => (handle.id === opts.host.rovingActiveId() ? 0 : -1),\n handleKeydown: (event) => {\n const headers = orderedHeaders();\n if (headers.length === 0) {\n return;\n }\n const from = activeIndex(headers);\n let target: number | null;\n switch (event.key) {\n case 'ArrowDown':\n target = step(headers, from, 1);\n break;\n case 'ArrowUp':\n target = step(headers, from, -1);\n break;\n case 'Home':\n target = edge(headers, 1);\n break;\n case 'End':\n target = edge(headers, -1);\n break;\n default:\n return;\n }\n if (target === null) {\n return;\n }\n event.preventDefault();\n const header = headers[target];\n opts.host.setRovingActive(header.id);\n header.element.focus();\n },\n };\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\nimport type {\n CngxAccordionHeaderHandle,\n CngxAccordionKeyboardNav,\n} from './accordion-keyboard-nav';\n\n/**\n * Contract a {@link CngxAccordion} provides so each {@link CngxAccordionPanel}\n * can read the open/closed arbitration and self-wire keyboard navigation\n * without injecting the concrete parent class (which would create a cyclic\n * type and block Atomic Decompose). The coordinator owns the single open-set\n * signal plus the header registry; panels call {@link toggle}, register their\n * header handle, and bind `tabindex`/`keydown` through {@link nav}.\n *\n * @category common/interactive/accordion\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/accordion/accordion.token.ts\n * @since 0.1.0\n * @relatedTo CngxAccordion, CngxAccordionPanel, createAccordionKeyboardNav\n */\nexport interface CngxAccordionHost {\n /** Whether more than one panel may stay open at once. */\n readonly multi: Signal<boolean>;\n /** Whether the panel with this id is currently open (reads the open-set signal). */\n isOpen(panelId: string): boolean;\n /** Toggle the panel; in single mode this closes every sibling first. */\n toggle(panelId: string): void;\n\n /** Every registered header handle (the coordinator's roving registry). */\n readonly headers: Signal<readonly CngxAccordionHeaderHandle[]>;\n /** Id of the header that is the group's single tab stop, or `null`. */\n readonly rovingActiveId: Signal<string | null>;\n /** Resolved keyboard surface panels bind `tabindex` / `keydown` through. */\n readonly nav: CngxAccordionKeyboardNav;\n /** Register a header handle on init (view-boundary-immune, unlike `contentChildren`). */\n registerHeader(handle: CngxAccordionHeaderHandle): void;\n /** Deregister a header handle on destroy. */\n unregisterHeader(handle: CngxAccordionHeaderHandle): void;\n /** Record the header the roving tab stop should move to. */\n setRovingActive(id: string): void;\n}\n\n/**\n * DI token for the {@link CngxAccordionHost} contract. {@link CngxAccordion}\n * provides it via `useExisting`; each {@link CngxAccordionPanel} injects it up\n * the element-injector hierarchy.\n *\n * @category common/interactive/accordion\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/accordion/accordion.token.ts\n * @since 0.1.0\n * @relatedTo CngxAccordion, CngxAccordionPanel\n */\nexport const CNGX_ACCORDION = new InjectionToken<CngxAccordionHost>('CNGX_ACCORDION');\n","import { computed, Directive, input, linkedSignal, model, signal } from '@angular/core';\nimport { setEqual } from '@cngx/utils';\n\nimport {\n createAccordionKeyboardNav,\n type CngxAccordionHeaderHandle,\n type CngxAccordionKeyboardNav,\n} from './accordion-keyboard-nav';\nimport { CNGX_ACCORDION, type CngxAccordionHost } from './accordion.token';\n\n/**\n * Coordinating directive for an accordion. Put `cngxAccordion` on the\n * container; each header carries {@link CngxAccordionPanel}. The container owns\n * two single sources of truth - one `openIds` set signal (expansion) and one\n * header registry (`rovingActiveId`) - and arbitrates single- vs multi-open. No\n * panel owns mutable expansion state and no effect syncs siblings: every\n * panel's `aria-expanded` derives from the open-set signal (Pillar 1).\n *\n * Header arrow-key navigation runs through {@link createAccordionKeyboardNav}\n * over a header registry rather than `contentChildren` roving. Panels register\n * their header handle on init, so navigation survives a skin that renders each\n * header inside its own component view - the reason {@link CngxAccordionPanel}\n * self-wires `tabindex`/`keydown` instead of relying on a container-level\n * roving directive.\n *\n * ```html\n * <div cngxAccordion #acc=\"cngxAccordion\" [multi]=\"false\">\n * <button cngxAccordionPanel id=\"head-a\" panelId=\"a\" controls=\"region-a\">Section A</button>\n * <div role=\"region\" id=\"region-a\" aria-labelledby=\"head-a\" [hidden]=\"!acc.isOpen('a')\">…</div>\n * <button cngxAccordionPanel id=\"head-b\" panelId=\"b\" controls=\"region-b\">Section B</button>\n * <div role=\"region\" id=\"region-b\" aria-labelledby=\"head-b\" [hidden]=\"!acc.isOpen('b')\">…</div>\n * </div>\n * ```\n *\n * @category common/interactive/accordion\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/accordion/accordion.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAccordionPanel, createAccordionKeyboardNav\n */\n@Directive({\n selector: '[cngxAccordion]',\n exportAs: 'cngxAccordion',\n standalone: true,\n providers: [{ provide: CNGX_ACCORDION, useExisting: CngxAccordion }],\n})\nexport class CngxAccordion implements CngxAccordionHost {\n /** Whether more than one panel may stay open at once. */\n readonly multi = input<boolean>(false);\n\n /**\n * Controlled set of open panel ids - the accordion's primary value, exposed\n * as a `model` so a consumer can seed initially-open panels or drive\n * expansion declaratively (router / SSR). `model()` takes no `equal`, so the\n * equality discipline lives on {@link effectiveOpenIds} below - the derived\n * set every panel reads. `toggle()` is the only writer on interaction; the\n * consumer may also write it. No effect syncs it (Pillar 1).\n */\n readonly openIds = model<ReadonlySet<string>>(new Set());\n\n // Single-open arbitration is a derivation, never an effect: a consumer-seeded\n // multi-id set is clamped to the last id when `!multi()`, projecting an\n // invalid single-mode seed valid without writing it back (controlled-wins).\n // `setEqual` guards the collection so an identical open-set never re-fires the\n // panels' `aria-expanded` computeds (Pillar 1 equality discipline).\n private readonly effectiveOpenIds = computed<ReadonlySet<string>>(\n () => {\n const ids = this.openIds();\n return this.multi() || ids.size <= 1 ? ids : new Set([...ids].slice(-1));\n },\n { equal: setEqual },\n );\n\n // Header registry, keyed by handle identity. `headersEqual` is an\n // order-independent identity-set compare so a re-register of the same\n // handles never re-fires the roving derivation.\n private readonly headersState = signal<readonly CngxAccordionHeaderHandle[]>([], {\n equal: headersEqual,\n });\n readonly headers = this.headersState.asReadonly();\n\n /**\n * The group's single tab stop, derived-not-managed from the registry. When\n * the registry changes, keep the previous stop while it is still registered\n * and enabled, else fall back to the first enabled header. Never reset by an\n * unrelated header registering or unregistering (Pillar 1 preserve-then-\n * default); `setRovingActive` writes it directly for keyboard movement.\n */\n readonly rovingActiveId = linkedSignal<readonly CngxAccordionHeaderHandle[], string | null>({\n source: this.headers,\n computation: (headers, prev) =>\n headers.some((h) => h.id === prev?.value && !h.disabled())\n ? prev!.value\n : (headers.find((h) => !h.disabled())?.id ?? null),\n });\n\n readonly nav: CngxAccordionKeyboardNav = createAccordionKeyboardNav({ host: this });\n\n registerHeader(handle: CngxAccordionHeaderHandle): void {\n this.headersState.update((headers) =>\n headers.includes(handle) ? headers : [...headers, handle],\n );\n }\n\n unregisterHeader(handle: CngxAccordionHeaderHandle): void {\n this.headersState.update((headers) => headers.filter((h) => h !== handle));\n }\n\n setRovingActive(id: string): void {\n this.rovingActiveId.set(id);\n }\n\n isOpen(panelId: string): boolean {\n return this.effectiveOpenIds().has(panelId);\n }\n\n toggle(panelId: string): void {\n // Read the clamped set, not the raw model, so the mutate base matches what\n // isOpen() reports: clicking a panel the clamp has hidden opens it rather\n // than acting on a stale raw-set membership. Identical to the raw model in\n // every valid case (clamp == model when multi, or the set holds <= 1 id).\n const open = this.effectiveOpenIds();\n // Single mode collapses every sibling by seeding an empty set; multi mode\n // preserves the others. Either way the coordinator is the only writer.\n const next = new Set<string>(this.multi() ? open : []);\n if (open.has(panelId)) {\n next.delete(panelId);\n } else {\n next.add(panelId);\n }\n this.openIds.set(next);\n }\n}\n\n/**\n * Order-independent identity-set equality for the header registry. Two arrays\n * are equal when they hold the same handle references, regardless of\n * registration order. Handles are stable per panel (carrying `disabled` by\n * signal reference), so this comparator only suppresses re-fires from a\n * re-register of the same set; it does not gate the roving derivation on\n * disabled state - `rovingActiveId` reads each handle's `disabled()` directly,\n * so a disabled flip still re-runs it (which is what keeps the tab stop off a\n * newly-disabled header).\n */\nfunction headersEqual(\n a: readonly CngxAccordionHeaderHandle[],\n b: readonly CngxAccordionHeaderHandle[],\n): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n const seen = new Set(b);\n return a.every((handle) => seen.has(handle));\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n signal,\n type OnInit,\n} from '@angular/core';\n\nimport { CNGX_ACCORDION } from './accordion.token';\nimport type { CngxAccordionHeaderHandle } from './accordion-keyboard-nav';\n\n/**\n * Accordion header. Put `cngxAccordionPanel` on the header `<button>`; the\n * directive mirrors `aria-expanded` from the coordinator, points\n * `aria-controls` at the region, and toggles the panel on click. It registers\n * a header handle with the coordinator on init (and deregisters on destroy),\n * binds its own roving `tabindex`, and routes `keydown` through the\n * coordinator's keyboard-nav factory - so arrow/Home/End navigation works even\n * when a skin renders the header inside its own component view (registration is\n * immune to the `contentChildren` view boundary).\n *\n * Expansion state is never owned here: `aria-expanded` is a `computed()` over\n * the coordinator's open-set, so single-open arbitration is pure derivation,\n * not sibling syncing (Pillar 1). Use a native `<button>` so Enter / Space\n * activate it through the browser's own click synthesis.\n *\n * @category common/interactive/accordion\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/accordion/accordion-panel.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAccordion, createAccordionKeyboardNav\n */\n@Directive({\n selector: '[cngxAccordionPanel]',\n exportAs: 'cngxAccordionPanel',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': 'controls() ?? null',\n '[attr.aria-disabled]': 'disabled() || null',\n '[attr.tabindex]': 'tabindex()',\n '(click)': 'toggle()',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxAccordionPanel implements OnInit {\n /** Stable id identifying this panel within its accordion. */\n readonly panelId = input.required<string>();\n /** `id` of the region this header controls, bound to `aria-controls`. */\n readonly controls = input<string | undefined>(undefined);\n /**\n * Disabled header: skipped by roving, reports `tabindex=\"-1\"` +\n * `aria-disabled=\"true\"`, and its click never flips the panel open. The\n * visually-hidden `aria-describedby` reason element is a skin concern owned\n * by the organism, not this brain directive.\n */\n readonly disabled = input<boolean>(false);\n\n private readonly accordion = inject(CNGX_ACCORDION);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly destroyRef = inject(DestroyRef);\n\n // Set once in ngOnInit. A signal (not a plain field) so the tabindex computed\n // tracks it reactively instead of relying on write-before-first-read ordering.\n private readonly handle = signal<CngxAccordionHeaderHandle | null>(null);\n\n /** `aria-expanded`, derived from the coordinator's open-set. */\n protected readonly expanded = computed(() => this.accordion.isOpen(this.panelId()));\n\n /**\n * Roving `tabindex` for this header, derived from the coordinator's single\n * `rovingActiveId` source (Pillar 1). `-1` until the handle registers.\n */\n protected readonly tabindex = computed(() => {\n const handle = this.handle();\n return handle ? this.accordion.nav.headerTabindex(handle) : -1;\n });\n\n ngOnInit(): void {\n // Register in ngOnInit, not the constructor: the bound `[panelId]` input is\n // not applied until the first change detection, and the id is the registry\n // key the coordinator roves and unregisters by.\n const handle: CngxAccordionHeaderHandle = {\n id: this.panelId(),\n element: this.element,\n disabled: this.disabled,\n };\n this.handle.set(handle);\n this.accordion.registerHeader(handle);\n this.destroyRef.onDestroy(() => this.accordion.unregisterHeader(handle));\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n this.accordion.nav.handleKeydown(event);\n }\n\n protected toggle(): void {\n if (this.disabled()) {\n return;\n }\n this.accordion.toggle(this.panelId());\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n// Type-only edge: erased at compile time (isolatedModules), so no runtime\n// module cycle forms. The only runtime edge is item -> token (inject).\nimport type { CngxBreadcrumbItem } from './breadcrumb-item.directive';\n\n/**\n * Contract a {@link CngxBreadcrumb} provides to its items and to a drop-in\n * overflow via DI. Item-keyed queries stay methods; the collapse set is\n * exposed as signals so a decoupled overflow can derive off them without\n * injecting the concrete coordinator class.\n */\nexport interface CngxBreadcrumbHost {\n /** Whether this item is the terminal crumb (gets `aria-current=\"page\"`). */\n isTerminal(item: CngxBreadcrumbItem): boolean;\n /** Whether this item is collapsed into the overflow menu (hidden in the trail). */\n isCollapsed(item: CngxBreadcrumbItem): boolean;\n /** The crumbs currently collapsed into the overflow, in DOM order. */\n readonly collapsedItems: Signal<readonly CngxBreadcrumbItem[]>;\n /** Whether any crumb is collapsed (drives the overflow trigger's visibility). */\n readonly hasCollapsed: Signal<boolean>;\n}\n\n/**\n * DI token for the {@link CngxBreadcrumbHost} contract. {@link CngxBreadcrumb}\n * provides it via `useExisting`; each {@link CngxBreadcrumbItem} injects it.\n *\n * @category common/interactive/breadcrumb\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb.token.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, CngxBreadcrumbItem\n */\nexport const CNGX_BREADCRUMB = new InjectionToken<CngxBreadcrumbHost>('CNGX_BREADCRUMB');\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { CNGX_BREADCRUMB } from './breadcrumb.token';\n\n/**\n * A single crumb. Put `cngxBreadcrumbItem` on the crumb element. Intermediate\n * crumbs are links (`<a href>`); the terminal crumb may be either a `<span>` or\n * an `<a [attr.href]=\"null\">` - both derive `aria-current=\"page\"` purely from\n * position in the trail (no manual flag). The item hides itself with `[hidden]`\n * when the coordinator collapses it into the overflow menu.\n *\n * @category common/interactive/breadcrumb\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb-item.directive.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, CngxBreadcrumbSeparator\n * <example-url>http://localhost:4200/#/common/interactive/breadcrumb/basic-trail</example-url>\n */\n@Directive({\n selector: '[cngxBreadcrumbItem]',\n exportAs: 'cngxBreadcrumbItem',\n standalone: true,\n host: {\n '[attr.aria-current]': \"terminal() ? 'page' : null\",\n '[hidden]': 'collapsed()',\n },\n})\nexport class CngxBreadcrumbItem {\n private readonly breadcrumb = inject(CNGX_BREADCRUMB);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Explicit accessible label for the overflow menu, when the crumb's rendered\n * text is not the right string to list (e.g. an icon-only crumb). Reactive:\n * bind it when the crumb text is dynamic.\n */\n readonly label = input<string>('', { alias: 'cngxBreadcrumbItemLabel' });\n\n /** Whether this is the terminal crumb (the current page). */\n protected readonly terminal = computed(() => this.breadcrumb.isTerminal(this));\n /** Whether this crumb is collapsed into the overflow menu. */\n protected readonly collapsed = computed(() => this.breadcrumb.isCollapsed(this));\n\n /**\n * Readable label for the collapsed-crumb list. Prefers the explicit\n * {@link label} input; otherwise falls back to the projected text.\n *\n * The fallback is a **one-shot DOM read at call time**, not reactive - it\n * reflects the text present when called. For crumbs whose text changes at\n * runtime, bind `[cngxBreadcrumbItemLabel]` so the reactive path is used.\n */\n resolvedLabel(): string {\n const explicit = this.label();\n if (explicit) {\n return explicit;\n }\n return this.host.nativeElement.textContent?.trim() ?? '';\n }\n}\n","/**\n * A collapse strategy decides which crumb indices fold into the overflow menu.\n * Pure and synchronous: given the total crumb count and the `maxVisible` cap it\n * returns the set of indices to hide. Swap it via\n * {@link CNGX_BREADCRUMB_COLLAPSE_STRATEGY} to change the rule (width-aware,\n * keep-first-N, mobile parent-only, ...) without forking {@link CngxBreadcrumb}.\n */\nexport type CngxBreadcrumbCollapseStrategy = (\n total: number,\n maxVisible: number,\n) => ReadonlySet<number>;\n\nconst NO_COLLAPSE: ReadonlySet<number> = new Set();\n\n/**\n * The default collapse rule: keep the first crumb and the last\n * `maxVisible - 1`, folding the middle into the overflow menu. Returns an empty\n * set when `maxVisible` is unset/invalid (`< 1`) or the trail already fits\n * (`total <= maxVisible`), so a short trail never collapses.\n *\n * @category common/interactive/breadcrumb\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb-collapse.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, CNGX_BREADCRUMB_COLLAPSE_STRATEGY\n */\nexport function createBreadcrumbCollapse(): CngxBreadcrumbCollapseStrategy {\n return (total, maxVisible) => {\n if (!maxVisible || maxVisible < 1 || total <= maxVisible) {\n return NO_COLLAPSE;\n }\n const keepTail = maxVisible - 1;\n const collapsed = new Set<number>();\n for (let i = 1; i < total - keepTail; i++) {\n collapsed.add(i);\n }\n return collapsed;\n };\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { createBreadcrumbCollapse, type CngxBreadcrumbCollapseStrategy } from './breadcrumb-collapse';\n\n/**\n * DI token for the breadcrumb collapse rule. Defaults to\n * {@link createBreadcrumbCollapse} (keep the first crumb + the last\n * `maxVisible - 1`). Override it in `providers` (app-wide) or `viewProviders`\n * (per {@link CngxBreadcrumb} instance) to swap the rule - width-aware,\n * keep-first-N, mobile parent-only - without forking the coordinator.\n *\n * ```ts\n * viewProviders: [{\n * provide: CNGX_BREADCRUMB_COLLAPSE_STRATEGY,\n * useValue: (total, max) => new Set(range(2, total - 2)),\n * }]\n * ```\n *\n * @category common/interactive/breadcrumb\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb-collapse.token.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, createBreadcrumbCollapse\n */\nexport const CNGX_BREADCRUMB_COLLAPSE_STRATEGY = new InjectionToken<CngxBreadcrumbCollapseStrategy>(\n 'CNGX_BREADCRUMB_COLLAPSE_STRATEGY',\n { providedIn: 'root', factory: () => createBreadcrumbCollapse() },\n);\n","import { computed, contentChildren, Directive, inject, input } from '@angular/core';\nimport { arrayEqual, setEqual } from '@cngx/utils';\n\nimport { CngxBreadcrumbItem } from './breadcrumb-item.directive';\nimport { CNGX_BREADCRUMB_COLLAPSE_STRATEGY } from './breadcrumb-collapse.token';\nimport { CNGX_BREADCRUMB, type CngxBreadcrumbHost } from './breadcrumb.token';\n\n/**\n * Linear breadcrumb navigation. Put `cngxBreadcrumb` on the `<nav>`; it names\n * the landmark (`aria-label`, EN default \"Breadcrumb\") and, when the trail\n * exceeds `[maxVisible]`, derives which middle crumbs collapse - keeping the\n * first crumb and the last `maxVisible - 1`. The collapse set is a `computed()`\n * over the projected items, so terminal-crumb marking and overflow are pure\n * derivation, never synced (Pillar 1). Consumers render the collapsed crumbs in\n * an ellipsis `CngxMenu` and may truncate long labels with `CngxTruncate`.\n *\n * ```html\n * <nav cngxBreadcrumb [maxVisible]=\"4\" #bc=\"cngxBreadcrumb\">\n * <ol>\n * <li><a cngxBreadcrumbItem href=\"/\">Home</a></li>\n * <li cngxBreadcrumbSeparator>/</li>\n * <li><a cngxBreadcrumbItem href=\"/library\">Library</a></li>\n * <li cngxBreadcrumbSeparator>/</li>\n * <li><span cngxBreadcrumbItem>Current page</span></li>\n * </ol>\n * </nav>\n * ```\n *\n * @category common/interactive/breadcrumb\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb.directive.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumbItem, CngxBreadcrumbSeparator, CngxBreadcrumbBar\n * <example-url>http://localhost:4200/#/common/interactive/breadcrumb/basic-trail</example-url>\n */\n@Directive({\n selector: '[cngxBreadcrumb]',\n exportAs: 'cngxBreadcrumb',\n standalone: true,\n providers: [{ provide: CNGX_BREADCRUMB, useExisting: CngxBreadcrumb }],\n host: {\n '[attr.aria-label]': 'label()',\n },\n})\nexport class CngxBreadcrumb implements CngxBreadcrumbHost {\n /** Accessible name of the navigation landmark. EN default. */\n readonly label = input<string>('Breadcrumb');\n /** Maximum crumbs to show before the middle collapses. Unset = never collapse. */\n readonly maxVisible = input<number | undefined>(undefined);\n\n /** Swappable collapse rule; defaults to keep-first + last (max - 1). */\n private readonly collapse = inject(CNGX_BREADCRUMB_COLLAPSE_STRATEGY);\n\n /** Projected crumbs in DOM order (items may be nested in `<ol>`/`<li>`). */\n private readonly items = contentChildren(CngxBreadcrumbItem, { descendants: true });\n\n // Item -> index lookup for isTerminal/isCollapsed (O(1), was O(n) indexOf).\n // No `equal`: its sole dependency is items(), so it recomputes only when the\n // item set changes, at which point a fresh WeakMap is the correct downstream\n // signal - a WeakMap keyed by directive instances has no structural equality.\n private readonly indexByItem = computed(() => {\n const map = new WeakMap<CngxBreadcrumbItem, number>();\n this.items().forEach((item, index) => map.set(item, index));\n return map;\n });\n\n private readonly collapsedIndices = computed<ReadonlySet<number>>(\n () => this.collapse(this.items().length, this.maxVisible() ?? 0),\n { equal: setEqual },\n );\n\n /** The crumbs currently collapsed into the overflow menu, in order. */\n readonly collapsedItems = computed(\n () => this.items().filter((_, index) => this.collapsedIndices().has(index)),\n { equal: arrayEqual },\n );\n\n /** Whether any crumb is collapsed (drives the ellipsis trigger's visibility). */\n readonly hasCollapsed = computed(() => this.collapsedIndices().size > 0);\n\n isTerminal(item: CngxBreadcrumbItem): boolean {\n const index = this.indexByItem().get(item);\n return index !== undefined && index === this.items().length - 1;\n }\n\n isCollapsed(item: CngxBreadcrumbItem): boolean {\n const index = this.indexByItem().get(item);\n return index !== undefined && this.collapsedIndices().has(index);\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Visual separator between crumbs (slash, chevron, projected icon). Put\n * `cngxBreadcrumbSeparator` on the separator element; it is marked\n * `aria-hidden=\"true\"` so assistive tech reads the trail as a clean list of\n * links without the decorative glyphs.\n *\n * @category common/interactive/breadcrumb\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb-separator.directive.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, CngxBreadcrumbItem\n * <example-url>http://localhost:4200/#/common/interactive/breadcrumb/custom-separator</example-url>\n */\n@Directive({\n selector: '[cngxBreadcrumbSeparator]',\n exportAs: 'cngxBreadcrumbSeparator',\n standalone: true,\n host: {\n 'aria-hidden': 'true',\n },\n})\nexport class CngxBreadcrumbSeparator {}\n","/**\n * One width breakpoint for the responsive breadcrumb collapse: at `minWidth`\n * pixels and above, show at most `maxVisible` crumbs before the middle folds\n * into the overflow menu. A tier list is resolved by {@link resolveBreadcrumbTier}.\n */\nexport interface CngxBreadcrumbWidthTier {\n /** Lower bound (inclusive, px) at which this tier's `maxVisible` applies. */\n readonly minWidth: number;\n /** Crumb cap once this tier is the active one. Fed to the count-based collapse. */\n readonly maxVisible: number;\n}\n\n/**\n * Default width tiers, matching the headless `responsive-collapse` recipe: 640px\n * and up shows 6, 440px and up shows 4, anything narrower shows 2. The `0` floor\n * guarantees a match for every non-negative width.\n */\nexport const DEFAULT_BREADCRUMB_WIDTH_TIERS: readonly CngxBreadcrumbWidthTier[] = [\n { minWidth: 640, maxVisible: 6 },\n { minWidth: 440, maxVisible: 4 },\n { minWidth: 0, maxVisible: 2 },\n];\n\n/**\n * Pure width->count resolver: returns the `maxVisible` of the tier with the\n * highest `minWidth` that is still `<= width`. Order-independent - the tier list\n * is normalised (sorted by descending `minWidth`) before matching, so a consumer\n * may pass tiers in any order. When `width` sits below every tier's `minWidth`\n * the narrowest tier's `maxVisible` is the floor; an empty tier list yields\n * `Number.POSITIVE_INFINITY` (never collapse), leaving the trail intact.\n *\n * No DOM, no Angular - the width source (a `CngxResizeObserver`) lives in the\n * bar; this stays jsdom-testable and shared by the bar and the headless recipe.\n *\n * @category common/interactive/breadcrumb\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb-responsive.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, CngxBreadcrumbWidthTier, DEFAULT_BREADCRUMB_WIDTH_TIERS\n */\nexport function resolveBreadcrumbTier(\n width: number,\n tiers: readonly CngxBreadcrumbWidthTier[],\n): number {\n if (tiers.length === 0) {\n return Number.POSITIVE_INFINITY;\n }\n const sorted = [...tiers].sort((a, b) => b.minWidth - a.minWidth);\n for (const tier of sorted) {\n if (width >= tier.minWidth) {\n return tier.maxVisible;\n }\n }\n return sorted[sorted.length - 1].maxVisible;\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * One registered error source within an {@link CngxErrorAggregatorContract}.\n *\n * `key` uniquely identifies the source within its aggregator. `condition`\n * is the live signal the aggregator reads on every recompute. `label` is\n * an optional human-readable string included in announcements.\n *\n * @category common/interactive/error\n */\nexport interface CngxErrorAggregatorSourceEntry {\n readonly key: string;\n readonly condition: Signal<boolean>;\n readonly label?: string | null;\n}\n\n/**\n * Contract every {@link CngxErrorAggregator} (or external override) fulfils.\n *\n * The aggregator is the live A11y surface - it computes `hasError` /\n * `errorCount` / `activeErrors` / `errorLabels` / `shouldShow` /\n * `announcement` from its registered sources and exposes them to the\n * surrounding host. Sources register via {@link addSource} on init and\n * deregister via {@link removeSource} on teardown.\n *\n * @category common/interactive/error\n */\nexport interface CngxErrorAggregatorContract {\n /** `true` when at least one registered source's condition is `true`. */\n readonly hasError: Signal<boolean>;\n /** Count of currently active error sources. */\n readonly errorCount: Signal<number>;\n /** Keys of currently active error sources, in registration order. */\n readonly activeErrors: Signal<readonly string[]>;\n /** Labels of currently active error sources (only entries with non-null labels). */\n readonly errorLabels: Signal<readonly string[]>;\n /** `true` when errors should be visible - `hasError` AND scope reveal-state. */\n readonly shouldShow: Signal<boolean>;\n /** SR-friendly announcement text - joins active labels into one phrase. */\n readonly announcement: Signal<string>;\n /** Registers (or replaces) a source by `key`. */\n addSource(entry: CngxErrorAggregatorSourceEntry): void;\n /** Deregisters the source with `key` (no-op if absent). */\n removeSource(key: string): void;\n}\n\n/**\n * DI token resolving to the nearest {@link CngxErrorAggregatorContract}\n * ancestor.\n *\n * Provided by {@link CngxErrorAggregator} via `useExisting`; descendant\n * `CngxErrorSource` directives inject with `{ optional: true }` so they\n * function as no-ops outside an aggregator.\n *\n * @category common/interactive/error\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-aggregator/error-aggregator.token.ts\n * @since 0.1.0\n */\nexport const CNGX_ERROR_AGGREGATOR = new InjectionToken<CngxErrorAggregatorContract>(\n 'CngxErrorAggregator',\n);\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n signal,\n type TemplateRef,\n} from '@angular/core';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Single-value boolean switch with W3C `role=\"switch\"` semantics. Click,\n * Space, and Enter all flip `value`; the directive form (`[cngxToggle]`)\n * applies the contract to a host element that owns its own markup, while\n * the element form (`<cngx-toggle>`) renders a track + thumb skin and\n * accepts label content via `<ng-content>`.\n *\n * `value` is a `ModelSignal<boolean>` - consumers two-way-bind via\n * `[(value)]` and the directive emits `valueChange` on every flip.\n * `disabled` is also a `ModelSignal<boolean>` so the\n * `CngxFormBridge` (Phase 7) can drive it via `setDisabledState`\n * without a separate write path; consumers usually only read or set\n * one direction.\n *\n * `disabledReason` is consumer-supplied free text (no library default\n * per `feedback_en_default_locale`) - when present it lands in a hidden\n * `<span>` referenced by the host's `aria-describedby`. Per Pillar 2,\n * the description span is always in the DOM (visibility toggles via\n * `aria-hidden`); the host's `aria-describedby` is only emitted when a\n * reason is set so AT does not announce an empty description.\n *\n * Typical usage prefers the `<div>`/`<cngx-toggle>` element form because\n * `role=\"switch\"` on a native `<button>` would conflict with the\n * browser's own Space → click synthesis and produce double-toggles.\n *\n * ```html\n * <cngx-toggle [(value)]=\"emailNotifications\">\n * E-mails empfangen\n * </cngx-toggle>\n *\n * <div\n * cngxToggle\n * [(value)]=\"dark\"\n * [disabled]=\"systemPreferenceLocked()\"\n * disabledReason=\"Locked by your OS preference\"\n * >Dark mode</div>\n * ```\n *\n * ```html\n * <ng-template #icon><span aria-hidden=\"true\">★</span></ng-template>\n * <cngx-toggle [(value)]=\"featured\" [thumbGlyph]=\"icon\">Featured</cngx-toggle>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/toggle/toggle.component.ts\n * @selector cngx-toggle\n * @since 0.1.0\n * @relatedTo CngxCheckbox, CngxButtonToggle, CngxRadio\n * <example-url>http://localhost:4200/#/common/interactive/toggle/basic-two-way-binding</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/toggle/custom-thumb-glyph</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/toggle/disabled-with-reason</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/toggle/label-position</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: '[cngxToggle], cngx-toggle',\n exportAs: 'cngxToggle',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'cngx-toggle',\n role: 'switch',\n '[attr.id]': 'id()',\n '[attr.aria-checked]': 'value() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-describedby]': 'describedById()',\n '[attr.tabindex]': 'disabled() ? -1 : 0',\n '[class.cngx-toggle--checked]': 'value()',\n '[class.cngx-toggle--disabled]': 'disabled()',\n '[class.cngx-toggle--label-before]': 'labelPosition() === \"before\"',\n '(click)': 'handleClick()',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxToggle },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxToggle },\n ],\n imports: [NgTemplateOutlet],\n template: `\n <span class=\"cngx-toggle__track\" aria-hidden=\"true\">\n <span class=\"cngx-toggle__thumb\">\n @if (thumbGlyph(); as glyph) {\n <ng-container *ngTemplateOutlet=\"glyph\" />\n }\n </span>\n </span>\n <span class=\"cngx-toggle__label\">\n <ng-content />\n </span>\n <span\n [id]=\"describedId\"\n class=\"cngx-toggle__sr-only\"\n [attr.aria-hidden]=\"disabledReason() ? null : 'true'\"\n >{{ disabledReason() }}</span\n >\n `,\n styleUrls: ['./toggle.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxToggle implements CngxControlValue<boolean>, CngxFormFieldControl {\n readonly value = model<boolean>(false);\n readonly disabled = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element (e.g. a sibling\n * rendered by `<cngx-form-field>` or a consumer-owned `<span>`).\n * When set, the host emits `aria-errormessage=\"<id>\"` so AT can\n * locate the message; consumers MUST render an element with that id\n * - passing an id without a matching element produces a dangling\n * AT reference. Default `null` skips the attribute entirely.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly disabledReason = input<string>('');\n readonly labelPosition = input<'before' | 'after'>('after');\n readonly thumbGlyph = input<TemplateRef<void> | null>(null);\n\n protected readonly describedId = nextUid('cngx-toggle-desc');\n\n protected readonly describedById = computed(() =>\n this.disabledReason() ? this.describedId : null,\n );\n\n /** Stable per-instance id used for `<label for>` wiring. */\n readonly id = signal(nextUid('cngx-toggle-')).asReadonly();\n\n private readonly focusedState = signal(false);\n /** Whether the host element currently has DOM focus. */\n readonly focused = this.focusedState.asReadonly();\n\n /** True when the toggle is `false` (off) - boolean atom semantics. */\n readonly empty = computed(() => this.value() === false);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n /**\n * Field-host→aggregator cascade. Inside `<cngx-form-field>` the\n * presenter governs visibility (touched / strategy / scope). Outside\n * form-field but inside `<cngxErrorAggregator>` the aggregator's\n * `shouldShow` (reveal-aware) wins. Outside both contexts the atom\n * paints no error skin.\n */\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n protected handleClick(): void {\n if (this.disabled()) {\n return;\n }\n this.value.update((v) => !v);\n }\n\n protected handleKeydown(event: Event): void {\n if (this.disabled()) {\n return;\n }\n event.preventDefault();\n this.value.update((v) => !v);\n }\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n signal,\n type TemplateRef,\n} from '@angular/core';\nimport { CngxRovingItem, CngxRovingTabindex } from '@cngx/common/a11y';\nimport { CngxCheckboxIndicator } from '@cngx/common/display';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Single-value boolean checkbox with indeterminate support and W3C\n * `role=\"checkbox\"` semantics. Click, Space, and Enter all advance\n * `value`; an indeterminate checkbox advances to `value=true`,\n * `indeterminate=false` in a single step (per WAI-ARIA tristate\n * semantics - there is no path that lands the checkbox back in\n * `'mixed'` from a user click).\n *\n * `value` and `indeterminate` are both `ModelSignal<boolean>` so\n * consumers can two-way-bind both: `[(value)]` for the canonical\n * checked/unchecked state, `[(indeterminate)]` for the tri-state\n * marker most often driven by a parent group's \"some-but-not-all\"\n * computation. `disabled` is also a `ModelSignal<boolean>` to keep\n * the `CngxFormBridge`'s `setDisabledState` write path consistent\n * across the family.\n *\n * Visual indicator state is delegated to `<cngx-checkbox-indicator>`\n * from `@cngx/common/display`; this interactive molecule owns role,\n * keyboard, and ARIA wiring and composes the display atom. Per\n * Pillar 3, the visual atom is\n * reused - never re-drawn here.\n *\n * `aria-checked` is a reactive computed: `indeterminate() ? 'mixed' :\n * value() ? 'true' : 'false'`. The description span for\n * `disabledReason` follows the same always-in-DOM rule as\n * `CngxToggle`.\n *\n * ```html\n * <cngx-checkbox [(value)]=\"acceptTerms\">I accept the terms</cngx-checkbox>\n *\n * <cngx-checkbox\n * [(value)]=\"allSelected()\"\n * [(indeterminate)]=\"someSelected() && !allSelected()\"\n * (valueChange)=\"toggleAll($event)\"\n * >Select all</cngx-checkbox>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/checkbox/checkbox.component.ts\n * @selector cngx-checkbox\n * @since 0.1.0\n * @relatedTo CngxCheckboxGroup, CngxCheckboxIndicator, CngxToggle, CngxRadio\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/group/basic-select-all-master-projected-leaves</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/group/disabled-cascade</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/base/basic-two-way-binding</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/base/custom-check-dash-glyphs</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/base/disabled</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/base/tri-state-select-all-pattern</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-checkbox, [cngxCheckbox]',\n exportAs: 'cngxCheckbox',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingItem,\n inputs: ['cngxRovingItemDisabled: disabled'],\n },\n ],\n imports: [CngxCheckboxIndicator],\n host: {\n class: 'cngx-checkbox',\n role: 'checkbox',\n '[attr.id]': 'id()',\n '[attr.aria-checked]': 'ariaChecked()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-invalid]': 'ariaInvalid() ? \"true\" : null',\n '[attr.aria-errormessage]': 'ariaInvalid() ? errorMessageId() : null',\n '[attr.aria-describedby]': 'describedId',\n '[attr.tabindex]': 'hostTabindex()',\n '[class.cngx-checkbox--checked]': 'value()',\n '[class.cngx-checkbox--indeterminate]': 'indeterminate()',\n '[class.cngx-checkbox--disabled]': 'disabled()',\n '(click)': 'handleClick()',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxCheckbox },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxCheckbox },\n ],\n template: `\n <cngx-checkbox-indicator\n variant=\"checkbox\"\n [checked]=\"value()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"disabled()\"\n [checkGlyph]=\"checkGlyph()\"\n [dashGlyph]=\"dashGlyph()\"\n />\n <span class=\"cngx-checkbox__label\">\n <ng-content />\n </span>\n <span\n [id]=\"describedId\"\n class=\"cngx-checkbox__sr-only\"\n [attr.aria-hidden]=\"disabledReason() ? null : 'true'\"\n >{{ disabledReason() }}</span\n >\n `,\n styleUrls: ['./checkbox.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldControl {\n readonly value = model<boolean>(false);\n readonly indeterminate = model<boolean>(false);\n readonly disabled = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element (e.g. a sibling\n * rendered by `<cngx-form-field>` or a consumer-owned `<span>`).\n * The host emits `aria-errormessage=\"<id>\"` only when\n * `aria-invalid=\"true\"` — symmetric with the sibling `aria-invalid`\n * host binding (both gate on `invalid() || errorState()`). Consumers\n * MUST render an element with the supplied id; passing an id without\n * a matching element produces a dangling AT reference. Default\n * `null` skips the attribute entirely.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly disabledReason = input<string>('');\n readonly checkGlyph = input<TemplateRef<void> | null>(null);\n readonly dashGlyph = input<TemplateRef<void> | null>(null);\n\n protected readonly describedId = nextUid('cngx-checkbox-desc');\n\n private readonly rovingParent = inject(CngxRovingTabindex, {\n optional: true,\n skipSelf: true,\n });\n\n /**\n * When inside a `CngxRovingTabindex` parent (typically `CngxCheckboxGroup`),\n * yields `null` so the roving controller owns the `tabindex` attribute\n * uncontested. Standalone, falls back to the WAI-ARIA default of\n * `0` (or `-1` when disabled). Mirrors `CngxCard.hostTabindex`.\n */\n protected readonly hostTabindex = computed<number | null>(() =>\n this.rovingParent ? null : this.disabled() ? -1 : 0,\n );\n\n protected readonly ariaChecked = computed<'true' | 'false' | 'mixed'>(() =>\n this.indeterminate() ? 'mixed' : this.value() ? 'true' : 'false',\n );\n\n readonly id = signal(nextUid('cngx-checkbox-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /**\n * Empty when value is `false` AND not in tri-state intermediate. An\n * indeterminate checkbox carries user-visible state, so it does not\n * count as empty for forms purposes.\n */\n readonly empty = computed(() => this.value() === false && !this.indeterminate());\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n protected readonly ariaInvalid = computed(() => this.invalid() || this.errorState());\n\n protected handleClick(): void {\n this.advance();\n }\n\n protected handleKeydown(event: Event): void {\n if (this.disabled()) {\n return;\n }\n event.preventDefault();\n this.advance();\n }\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n\n private advance(): void {\n if (this.disabled()) {\n return;\n }\n if (this.indeterminate()) {\n this.value.set(true);\n this.indeterminate.set(false);\n return;\n }\n this.value.update((v) => !v);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n DestroyRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport {\n CNGX_SELECTION_CONTROLLER_FACTORY,\n nextUid,\n type CngxAsyncState,\n type SelectionController,\n} from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Multi-value checkbox-group molecule. Owns a `selectedValues` model\n * (the canonical multi-value source) and exposes membership\n * derivations (`allSelected`, `someSelected`, `noneSelected`,\n * `selectedCount`) plus the toggle-all triad (`toggleAll`, `select`,\n * `deselect`) every consumer needs to wire a \"select all\" master\n * checkbox to the group.\n *\n * Internals lean on `createSelectionController` from `@cngx/core/utils`\n * for membership tracking - the controller's structural-equality\n * `selected` snapshot prevents downstream computed cascades from\n * thrashing when a re-emission produces the same logical contents\n * with a different array reference.\n *\n * `value` is a structural alias of `selectedValues` so the group\n * satisfies `CngxControlValue<T[]>` without owning two synchronised\n * models - both names point to the same `ModelSignal<T[]>` instance.\n *\n * Per Pillar 1 (Ableitung statt Verwaltung), every derived flag is a\n * `computed()` - there is no manual sync between membership and the\n * exposed flags. Per Pillar 3 (Komposition statt Konfiguration), the\n * group composes `CngxRovingTabindex` as a host directive and emits\n * no implicit children - consumers project `<cngx-checkbox>` instances\n * (or any other CNGX_CONTROL_VALUE-bearing leaf) and bind each leaf's\n * value-tracking themselves.\n *\n * `[allValues]` is optional; when supplied, `allSelected` reflects\n * \"every option ticked\" rather than the vacuous \"every selected value\n * is still selected\" default. Consumers that wire a master checkbox\n * pass the full option pool here so `toggleAll()` can\n * select-or-clear-all per the user's mental model.\n *\n * `[keyFn]` lets consumers with object-typed values map each value\n * to a stable membership key (typically `(v) => v.id`). Without it,\n * membership uses identity / primitive equality - which silently\n * breaks across re-emissions when the consumer refetches array\n * elements with the same id but new references.\n *\n * `[state]` is an optional `CngxAsyncState<unknown>` input; when bound,\n * `aria-busy` reflects `state.status() === 'loading'` reactively so AT\n * announces the busy moment without the consumer wiring the attribute\n * by hand.\n *\n * ```html\n * <cngx-checkbox-group\n * label=\"Notifications\"\n * [allValues]=\"options\"\n * [(selectedValues)]=\"picked\"\n * >\n * <cngx-checkbox\n * *ngFor=\"let opt of options\"\n * [value]=\"opt\"\n * >{{ opt }}</cngx-checkbox>\n * </cngx-checkbox-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/checkbox-group/checkbox-group.component.ts\n * @selector cngx-checkbox-group\n * @since 0.1.0\n * @relatedTo CngxCheckbox, CngxRovingTabindex, CngxRadioGroup\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/group/basic-select-all-master-projected-leaves</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/group/disabled-cascade</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-checkbox-group, [cngxCheckboxGroup]',\n exportAs: 'cngxCheckboxGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingTabindex,\n inputs: ['orientation'],\n },\n ],\n host: {\n class: 'cngx-checkbox-group',\n role: 'group',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': 'ariaInvalid() ? \"true\" : null',\n '[attr.aria-errormessage]': 'ariaInvalid() ? errorMessageId() : null',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-checkbox-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxCheckboxGroup },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxCheckboxGroup },\n ],\n template: `<ng-content />`,\n styleUrls: ['./checkbox-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxCheckboxGroup<T = unknown> implements CngxControlValue<T[]>, CngxFormFieldControl {\n readonly selectedValues = model<T[]>([]);\n readonly value = this.selectedValues;\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. The host emits\n * `aria-errormessage=\"<id>\"` only when `aria-invalid=\"true\"` —\n * symmetric with the sibling `aria-invalid` host binding (both gate\n * on `invalid() || errorState()`). Consumers MUST render an element\n * with the supplied id. Default `null` skips the attribute.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n readonly label = input<string | undefined>(undefined);\n readonly allValues = input<readonly T[] | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n readonly keyFn = input<(value: T) => unknown>((v) => v);\n\n private readonly controller: SelectionController<T> = inject(\n CNGX_SELECTION_CONTROLLER_FACTORY,\n )<T>(this.selectedValues, {\n keyFn: (v) => this.keyFn()(v),\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.controller.destroy());\n }\n\n readonly selectedCount = this.controller.selectedCount;\n\n readonly noneSelected = computed(() => this.selectedCount() === 0);\n\n readonly allSelected = computed(() => {\n const pool = this.allValues();\n if (pool === undefined) {\n return this.selectedCount() > 0;\n }\n if (pool.length === 0) {\n return false;\n }\n for (const v of pool) {\n if (!this.controller.isSelected(v)()) {\n return false;\n }\n }\n return true;\n });\n\n readonly someSelected = computed(() => this.selectedCount() > 0 && !this.allSelected());\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n toggleAll(): void {\n if (this.disabled()) {\n return;\n }\n const pool = this.allValues();\n if (pool !== undefined) {\n this.controller.toggleAll(pool);\n return;\n }\n if (this.selectedCount() > 0) {\n this.controller.clear();\n }\n }\n\n select(value: T): void {\n if (this.disabled()) {\n return;\n }\n this.controller.select(value);\n }\n\n deselect(value: T): void {\n if (this.disabled()) {\n return;\n }\n this.controller.deselect(value);\n }\n\n readonly id = signal(nextUid('cngx-checkbox-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no values selected. */\n readonly empty = computed(() => this.selectedValues().length === 0);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n protected readonly ariaInvalid = computed(() => this.invalid() || this.errorState());\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import { InjectionToken, type ModelSignal, type Signal } from '@angular/core';\n\n/**\n * Single-select parent contract every `CngxButtonToggleGroup` provides\n * via `useExisting`. `CngxButtonToggle` leaves inject this token (or\n * `CNGX_BUTTON_MULTI_TOGGLE_GROUP` for the multi case) - never the\n * concrete group class - so the leaf stays decompose-ready and free\n * of cyclic type dependencies.\n *\n * `value` is a `ModelSignal<T | undefined>` because the group's\n * canonical value is two-way-bindable from the consumer (`[(value)]`)\n * and the active leaf writes it via `value.set(this.value())` on\n * pick. `disabled` is a read-only `Signal<boolean>` so the leaf can\n * combine it with its own per-toggle `disabled()` to compute\n * `toggleDisabled`.\n *\n * @category common/interactive\n */\nexport interface CngxButtonToggleGroupContract<T = unknown> {\n readonly value: ModelSignal<T | undefined>;\n readonly disabled: Signal<boolean>;\n /**\n * Consume the group's \"last interaction was a roving-arrow keydown\"\n * flag. Called by a leaf's `(focus)` handler - when the flag is\n * true, the leaf forwards its value to the group's `value` model\n * (W3C APG auto-select-on-arrow-nav semantics, radiogroup variant)\n * and the flag is cleared so a subsequent Tab-into focus does not\n * double-select. Returns whether the group actually consumed the\n * flag, so the leaf can short-circuit redundant work.\n */\n consumePendingArrowSelect(value: T): boolean;\n}\n\n/**\n * DI token a `CngxButtonToggle` leaf injects to find its single-mode\n * parent group. Always provided via\n * `{ provide: CNGX_BUTTON_TOGGLE_GROUP, useExisting:\n * CngxButtonToggleGroup }` - never via concrete-class injection (per\n * `reference_atomic_decompose` §4).\n *\n * The leaf injects this token AND `CNGX_BUTTON_MULTI_TOGGLE_GROUP`\n * with `{ optional: true }` on both; the present token determines the\n * leaf's keyboard semantics + ARIA pattern (`aria-checked` for single,\n * `aria-selected` for multi), chosen at injection time, NOT at\n * runtime - there is no `[selectionMode]` flag.\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-toggle-group.token.ts\n * @since 0.1.0\n */\nexport const CNGX_BUTTON_TOGGLE_GROUP = new InjectionToken<CngxButtonToggleGroupContract>(\n 'CngxButtonToggleGroup',\n);\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid, type CngxAsyncState } from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\nimport {\n CNGX_BUTTON_TOGGLE_GROUP,\n type CngxButtonToggleGroupContract,\n} from './button-toggle-group.token';\n\n/**\n * Single-select button-toggle group. Owns a `value = model<T |\n * undefined>` (the canonical single-value source) and exposes the\n * parent contract via `CNGX_BUTTON_TOGGLE_GROUP`. Behaves as a W3C\n * APG `radiogroup` - arrow keys move focus AND select (auto-select\n * variant); Tab + programmatic focus do not select on focus alone;\n * Space and Enter select the currently-focused toggle.\n *\n * Mode is **static**: this component is the single-select half of a\n * deliberate split (per `feedback_select_family_split`). Consumers\n * pick `<cngx-button-toggle-group>` for radiogroup semantics or\n * `<cngx-button-multi-toggle-group>` for toolbar semantics - never a\n * runtime `[selectionMode]` flag, never a shape-shifter. The leaf\n * `CngxButtonToggle` injects EITHER this token OR\n * `CNGX_BUTTON_MULTI_TOGGLE_GROUP` (`{ optional: true }` on both)\n * and chooses its ARIA pattern at injection time, not at runtime.\n *\n * Auto-select wiring follows the same contract as `CngxRadioGroup`:\n * the host `CngxRovingTabindex` raises its navigation-key intent before\n * it moves focus; each focused leaf consumes that intent in its\n * `(focus)` handler via `consumePendingArrowSelect()`, which reads\n * `roving.consumeNavigationKey()`. Reading an already-set fact (instead\n * of a group-owned `(keydown)` flag) closes the one-press-behind race\n * (#135). The value write happens inside a DOM event handler - never\n * inside an `effect()`.\n *\n * ```html\n * <cngx-button-toggle-group label=\"Layout\" [(value)]=\"view\">\n * <button cngxButtonToggle value=\"grid\">Grid</button>\n * <button cngxButtonToggle value=\"list\">List</button>\n * <button cngxButtonToggle value=\"table\">Table</button>\n * </cngx-button-toggle-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-toggle-group.component.ts\n * @selector cngx-button-toggle-group\n * @since 0.1.0\n * @relatedTo CngxButtonToggle, CngxRadioGroup\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/basic-view-switcher</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/disabled-group-cascade-vs-per-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/vertical-orientation</example-url>\n */\n@Component({\n selector: 'cngx-button-toggle-group, [cngxButtonToggleGroup]',\n exportAs: 'cngxButtonToggleGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingTabindex,\n inputs: ['orientation'],\n },\n ],\n host: {\n class: 'cngx-button-toggle-group',\n role: 'radiogroup',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-button-toggle-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_BUTTON_TOGGLE_GROUP, useExisting: CngxButtonToggleGroup },\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxButtonToggleGroup },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxButtonToggleGroup },\n ],\n template: `<ng-content />`,\n styleUrls: ['./button-toggle-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxButtonToggleGroup<T = unknown>\n implements CngxButtonToggleGroupContract<T>, CngxControlValue<T | undefined>, CngxFormFieldControl\n{\n readonly value = model<T | undefined>(undefined);\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. When set, the\n * host emits `aria-errormessage=\"<id>\"`; consumers MUST render an\n * element with that id. Default `null` skips the attribute.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly label = input<string | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n private readonly roving = inject(CngxRovingTabindex, { host: true });\n\n consumePendingArrowSelect(value: T): boolean {\n if (!this.roving.consumeNavigationKey()) {\n return false;\n }\n if (this.disabled()) {\n return false;\n }\n this.value.set(value);\n return true;\n }\n\n readonly id = signal(nextUid('cngx-button-toggle-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no toggle is selected. */\n readonly empty = computed(() => this.value() === undefined);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import { InjectionToken, type ModelSignal, type Signal } from '@angular/core';\n\n/**\n * Multi-select parent contract every `CngxButtonMultiToggleGroup`\n * provides via `useExisting`. `CngxButtonToggle` leaves that detect\n * a multi-mode parent (via `inject(CNGX_BUTTON_MULTI_TOGGLE_GROUP, {\n * optional: true })`) bind `aria-selected` (toolbar APG) instead of\n * `aria-checked` (radiogroup APG) AT INJECTION TIME. Mode is static\n * per atom instance - there is no `[selectionMode]` flag.\n *\n * `selectedValues` is a `ModelSignal<T[]>` so the consumer can\n * two-way-bind via `[(selectedValues)]` and the leaves can mutate\n * it on toggle. `disabled` is a read-only `Signal<boolean>` the\n * leaf combines with its own per-toggle `disabled()`.\n *\n * `isSelected(value)` returns the per-value membership signal from\n * the group's internal `SelectionController` so the leaf can render\n * `aria-selected` reactively without re-querying the array on every\n * keystroke. The signal identity is stable per value (per\n * `createSelectionController` contract) - safe to read inside a\n * `computed()` on the leaf.\n *\n * `toggle(value)` is the single mutation entry-point the leaf calls\n * on Space / Enter / click. The group routes it through its\n * controller and writes `selectedValues` accordingly.\n *\n * @category common/interactive\n */\nexport interface CngxButtonMultiToggleGroupContract<T = unknown> {\n readonly selectedValues: ModelSignal<T[]>;\n readonly disabled: Signal<boolean>;\n isSelected(value: T): Signal<boolean>;\n toggle(value: T): void;\n}\n\n/**\n * DI token a `CngxButtonToggle` leaf injects to find its multi-mode\n * parent group. Always provided via\n * `{ provide: CNGX_BUTTON_MULTI_TOGGLE_GROUP, useExisting:\n * CngxButtonMultiToggleGroup }` - never via concrete-class injection\n * (per `reference_atomic_decompose` §4).\n *\n * The leaf injects this token with `{ optional: true }` alongside\n * `CNGX_BUTTON_TOGGLE_GROUP` (also optional). Exactly one parent\n * must be present; the leaf throws a dev-mode error otherwise.\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-multi-toggle-group.token.ts\n * @since 0.1.0\n */\nexport const CNGX_BUTTON_MULTI_TOGGLE_GROUP =\n new InjectionToken<CngxButtonMultiToggleGroupContract>('CngxButtonMultiToggleGroup');\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n DestroyRef,\n inject,\n input,\n model,\n signal,\n type Signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport {\n CNGX_SELECTION_CONTROLLER_FACTORY,\n nextUid,\n type CngxAsyncState,\n type SelectionController,\n} from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\nimport {\n CNGX_BUTTON_MULTI_TOGGLE_GROUP,\n type CngxButtonMultiToggleGroupContract,\n} from './button-multi-toggle-group.token';\n\n/**\n * Multi-select button-toggle group. Owns a `selectedValues =\n * model<T[]>([])` (the canonical multi-value source) and exposes the\n * parent contract via `CNGX_BUTTON_MULTI_TOGGLE_GROUP`.\n * Behaves as a W3C APG `toolbar` - arrow keys MOVE focus only (no auto-select);\n * Space and Enter on a focused leaf toggle that leaf's membership.\n *\n * Mode is **static**: this is the multi-select half of the\n * deliberate single/multi split (per\n * `feedback_select_family_split`). Consumers pick this component or\n * `<cngx-button-toggle-group>` at template authoring time. Leaves\n * (`CngxButtonToggle`) inject EITHER token with `{ optional: true }`\n * and choose `aria-checked` (single) vs `aria-selected` (multi)\n * AT INJECTION TIME, never at runtime.\n *\n * Internals lean on `createSelectionController` from\n * `@cngx/core/utils` for membership tracking - the controller's\n * stable per-value `isSelected` signals (memoised by key) let leaves\n * read membership inside their own `computed()` without triggering a\n * fresh array walk on every change-detection pass.\n *\n * `value` is a structural alias of `selectedValues` so the group\n * satisfies `CngxControlValue<T[]>` without owning two synchronised\n * models - both names point to the same `ModelSignal<T[]>` instance.\n *\n * ```html\n * <cngx-button-multi-toggle-group label=\"Filters\" [(selectedValues)]=\"filters\">\n * <button cngxButtonToggle value=\"open\">Open</button>\n * <button cngxButtonToggle value=\"closed\">Closed</button>\n * <button cngxButtonToggle value=\"archived\">Archived</button>\n * </cngx-button-multi-toggle-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-multi-toggle-group.component.ts\n * @selector cngx-button-multi-toggle-group\n * @since 0.1.0\n * @relatedTo CngxButtonToggle, CngxButtonToggleGroup\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/basic-multi-filter-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/disabled-group-cascade-vs-per-toggle</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-button-multi-toggle-group, [cngxButtonMultiToggleGroup]',\n exportAs: 'cngxButtonMultiToggleGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingTabindex,\n inputs: ['orientation'],\n },\n ],\n host: {\n class: 'cngx-button-multi-toggle-group',\n role: 'toolbar',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-button-multi-toggle-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n {\n provide: CNGX_BUTTON_MULTI_TOGGLE_GROUP,\n useExisting: CngxButtonMultiToggleGroup,\n },\n {\n provide: CNGX_CONTROL_VALUE,\n useExisting: CngxButtonMultiToggleGroup,\n },\n {\n provide: CNGX_FORM_FIELD_CONTROL,\n useExisting: CngxButtonMultiToggleGroup,\n },\n ],\n template: `<ng-content />`,\n styleUrls: ['./button-toggle-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxButtonMultiToggleGroup<T = unknown>\n implements CngxButtonMultiToggleGroupContract<T>, CngxControlValue<T[]>, CngxFormFieldControl\n{\n readonly selectedValues = model<T[]>([]);\n readonly value = this.selectedValues;\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. When set, the\n * host emits `aria-errormessage=\"<id>\"`; consumers MUST render an\n * element with that id. Default `null` skips the attribute.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly label = input<string | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n readonly keyFn = input<(value: T) => unknown>((v) => v);\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n private readonly controller: SelectionController<T> = inject(\n CNGX_SELECTION_CONTROLLER_FACTORY,\n )<T>(this.selectedValues, {\n keyFn: (v) => this.keyFn()(v),\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.controller.destroy());\n }\n\n isSelected(value: T): Signal<boolean> {\n return this.controller.isSelected(value);\n }\n\n toggle(value: T): void {\n if (this.disabled()) {\n return;\n }\n this.controller.toggle(value);\n }\n\n readonly id = signal(nextUid('cngx-button-multi-toggle-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no toggles are selected. */\n readonly empty = computed(() => this.selectedValues().length === 0);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import { Directive, computed, inject, input } from '@angular/core';\nimport { CngxRovingItem } from '@cngx/common/a11y';\n\nimport {\n CNGX_BUTTON_MULTI_TOGGLE_GROUP,\n type CngxButtonMultiToggleGroupContract,\n} from './button-multi-toggle-group.token';\nimport {\n CNGX_BUTTON_TOGGLE_GROUP,\n type CngxButtonToggleGroupContract,\n} from './button-toggle-group.token';\n\n/** @internal */\ninterface SingleResolution<T> {\n readonly mode: 'single';\n readonly group: CngxButtonToggleGroupContract<T>;\n}\n\n/** @internal */\ninterface MultiResolution<T> {\n readonly mode: 'multi';\n readonly group: CngxButtonMultiToggleGroupContract<T>;\n}\n\ntype ParentResolution<T> = SingleResolution<T> | MultiResolution<T>;\n\n/**\n * Button-toggle leaf. Restricted to `<button>` elements via the\n * `button[cngxButtonToggle]` selector so consumers cannot\n * accidentally apply the directive to a `<div>` and lose the\n * native button semantics (Space + Enter activation, focus ring,\n * disabled propagation to the form-submission engine).\n *\n * Injects EITHER `CNGX_BUTTON_TOGGLE_GROUP` (single, radiogroup) OR\n * `CNGX_BUTTON_MULTI_TOGGLE_GROUP` (multi, toolbar) - never the\n * concrete group class - both with `{ optional: true }`.\n *\n * Exactly one parent must be present; the constructor throws when both or\n * neither resolve. The resolved parent is stored as a discriminated\n * union (`{ mode: 'single' | 'multi'; group }`) so every downstream\n * branch narrows without non-null assertions.\n *\n * The present token determines:\n *\n * - the ARIA pattern (`aria-checked` for single, `aria-selected` for\n * multi), bound on the host AT INJECTION TIME,\n * - the activation contract (single: `group.value.set(...)`; multi:\n * `group.toggle(...)`),\n * - whether `(focus)` consumes the parent's pending arrow-select\n * flag (single only - multi follows toolbar APG, which does not\n * auto-select on arrow nav).\n *\n * Mode is **static** per atom instance.\n * There is no runtime `[selectionMode]` flag. Per `feedback_select_family_split`,\n * single + multi are two distinct groups reusing this leaf; the\n * decision is made by the consumer at template-authoring time.\n *\n * Composes `CngxRovingItem` as a host directive with input\n * forwarding (`'cngxRovingItemDisabled: disabled'`) so arrow-key\n * navigation in either parent group skips per-toggle-disabled leaves\n * automatically.\n *\n * **Group-disabled cascade vs roving.**\n * Thev group-level `[disabled]` cascade short-circuits `handleSelect` /\n * `handleKeydown` / `handleFocus` (see `toggleDisabled` computed),\n * but does NOT propagate into `CngxRovingItem.disabled`.\n * Angular forbids re-binding a host-directive's read-only `InputSignal`\n * input from a wrapping host. As a result, a fully-disabled group\n * lets visual focus transit through its toggles via Arrow keys;\n * every selection pathway short-circuits silently.\n * Re-evaluation is gated on `CngxRovingItem.disabled` becoming a\n * writable surface in `@cngx/common/a11y`.\n *\n * **Disabled \"why\" via aria-describedby.** Pillar 2 requires\n * disabled state to communicate a reason. The leaf exposes\n * `[describedBy]` (alias `cngxDescribedBy`).\n * A reactive input that binds to the host's `aria-describedby`. Consumers render the\n * description element themselves and pass its id; the directive does\n * not own a sr-only span (it is a `@Directive` on a native\n * `<button>` - no template to inject siblings into).\n * Native `<button aria-describedby>` semantics apply.\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-toggle.directive.ts\n * @selector button[cngxButtonToggle]\n * @since 0.1.0\n * @relatedTo CngxButtonToggleGroup, CngxButtonMultiToggleGroup, CngxRadio\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/basic-multi-filter-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/disabled-group-cascade-vs-per-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/basic-view-switcher</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/disabled-group-cascade-vs-per-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/vertical-orientation</example-url>\n */\n@Directive({\n selector: 'button[cngxButtonToggle]',\n exportAs: 'cngxButtonToggle',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxRovingItem,\n inputs: ['cngxRovingItemDisabled: disabled'],\n },\n ],\n host: {\n class: 'cngx-button-toggle',\n type: 'button',\n '[attr.aria-checked]': 'ariaChecked()',\n '[attr.aria-selected]': 'ariaSelected()',\n '[attr.aria-disabled]': 'toggleDisabled() ? \"true\" : null',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.disabled]': 'toggleDisabled() ? \"\" : null',\n '[class.cngx-button-toggle--checked]': 'toggleChecked()',\n '[class.cngx-button-toggle--disabled]': 'toggleDisabled()',\n '(focus)': 'handleFocus()',\n '(click)': 'handleSelect()',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n },\n})\nexport class CngxButtonToggle<T = unknown> {\n private readonly resolved: ParentResolution<T> = resolveParent<T>();\n\n readonly value = input.required<T>();\n readonly disabled = input<boolean>(false);\n readonly describedBy = input<string | null>(null, {\n alias: 'cngxDescribedBy',\n });\n\n protected readonly toggleChecked = computed(() => {\n if (this.resolved.mode === 'single') {\n return this.resolved.group.value() === this.value();\n }\n return this.resolved.group.isSelected(this.value())();\n });\n\n protected readonly toggleDisabled = computed(\n () => this.resolved.group.disabled() || this.disabled(),\n );\n\n protected readonly ariaChecked = computed(() =>\n this.resolved.mode === 'single' ? (this.toggleChecked() ? 'true' : 'false') : null,\n );\n\n protected readonly ariaSelected = computed(() =>\n this.resolved.mode === 'multi' ? (this.toggleChecked() ? 'true' : 'false') : null,\n );\n\n protected handleFocus(): void {\n if (this.toggleDisabled()) {\n return;\n }\n if (this.resolved.mode === 'single') {\n this.resolved.group.consumePendingArrowSelect(this.value());\n }\n }\n\n protected handleSelect(): void {\n if (this.toggleDisabled()) {\n return;\n }\n if (this.resolved.mode === 'single') {\n this.resolved.group.value.set(this.value());\n return;\n }\n this.resolved.group.toggle(this.value());\n }\n\n protected handleKeydown(event: Event): void {\n if (this.toggleDisabled()) {\n return;\n }\n event.preventDefault();\n if (this.resolved.mode === 'single') {\n this.resolved.group.value.set(this.value());\n return;\n }\n this.resolved.group.toggle(this.value());\n }\n}\n\nfunction resolveParent<T>(): ParentResolution<T> {\n const single = inject<CngxButtonToggleGroupContract<T>>(CNGX_BUTTON_TOGGLE_GROUP, {\n optional: true,\n });\n const multi = inject<CngxButtonMultiToggleGroupContract<T>>(CNGX_BUTTON_MULTI_TOGGLE_GROUP, {\n optional: true,\n });\n if (single && multi) {\n throw new Error(\n 'CngxButtonToggle: both CngxButtonToggleGroup and ' +\n 'CngxButtonMultiToggleGroup parents are present in the injector ' +\n 'tree. Exactly one is required - single + multi semantics are ' +\n 'incompatible.',\n );\n }\n if (single) {\n return { mode: 'single', group: single };\n }\n if (multi) {\n return { mode: 'multi', group: multi };\n }\n throw new Error(\n 'CngxButtonToggle requires a parent CngxButtonToggleGroup or ' +\n 'CngxButtonMultiToggleGroup to provide the value contract.',\n );\n}\n","import { InjectionToken, type ModelSignal, type Signal } from '@angular/core';\n\n/**\n * Structural surface a `CngxRadio` leaf exposes when it registers\n * itself with a parent `CngxRadioGroup`. The group keeps the\n * registry in DOM order so arrow-key navigation (driven by\n * `CngxRovingTabindex` host directive) and the\n * value-equality check (`group.value() === radio.value()`) both\n * have access to the leaf without injecting the concrete radio\n * class.\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.token.ts\n * @since 0.1.0\n */\nexport interface CngxRadioRegistration<T = unknown> {\n readonly id: string;\n readonly value: () => T | undefined;\n readonly disabled: () => boolean;\n}\n\n/**\n * Parent-child contract every `CngxRadioGroup` provides via\n * `useExisting`. `CngxRadio` injects this token (never the\n * concrete `CngxRadioGroup` class) so the leaf stays decompose-\n * ready and free of cyclic type dependencies.\n *\n * `value` is a `ModelSignal<T | undefined>` because the group's\n * canonical value is two-way-bindable from the consumer\n * (`[(value)]`) and writable by the leaf when the user picks a\n * radio (`group.value.set(radio.value())`). `disabled` is a\n * read-only `Signal<boolean>` projected from the group's own\n * `model<boolean>`; leaves combine it with their own per-radio\n * `disabled()` to compute `radioDisabled`. `name` is the HTML\n * `name` attribute applied to all radio inputs in this group -\n * defaults to a `nextUid('cngx-radio-group')` value when the\n * consumer does not supply one.\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.token.ts\n * @since 0.1.0\n */\nexport interface CngxRadioGroupContract<T = unknown> {\n readonly value: ModelSignal<T | undefined>;\n readonly disabled: Signal<boolean>;\n readonly name: Signal<string>;\n register(radio: CngxRadioRegistration<T>): void;\n unregister(id: string): void;\n /**\n * Consume the group's \"last interaction was a roving-arrow keydown\"\n * flag. Called by a leaf's `(focus)` handler - when the flag is\n * true, the leaf forwards its value to the group's `value` model\n * (W3C APG auto-select-on-arrow-nav semantics) and the flag is\n * cleared so a subsequent Tab-into focus does not double-select.\n * Returns whether the group actually consumed the flag, so the\n * leaf can short-circuit redundant work.\n */\n consumePendingArrowSelect(value: T): boolean;\n}\n\n/**\n * DI token a `CngxRadio` leaf injects to find its parent group.\n * Always provided via\n * `{ provide: CNGX_RADIO_GROUP, useExisting: CngxRadioGroup }`\n * - never via concrete-class injection (per\n * `reference_atomic_decompose` §4).\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.token.ts\n * @since 0.1.0\n */\nexport const CNGX_RADIO_GROUP = new InjectionToken<CngxRadioGroupContract>('CngxRadioGroup');\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid, type CngxAsyncState } from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\nimport {\n CNGX_RADIO_GROUP,\n type CngxRadioGroupContract,\n type CngxRadioRegistration,\n} from './radio-group.token';\n\n/**\n * Radio-group molecule that owns the canonical `value` for a set of\n * `CngxRadio` leaves and provides the parent contract via\n * `CNGX_RADIO_GROUP`. The group composes `CngxRovingTabindex` as a\n * host directive (with `inputs: ['orientation']` exposed) so arrow-\n * key navigation across radios is wired from day one. Leaf\n * registration is imperative - `register()` / `unregister()` keep a\n * Map in declaration order so the group can resolve the active\n * radio by id without re-querying content children on every change\n * detection cycle.\n *\n * Per W3C ARIA radio-group authoring practice, `Tab` enters the\n * group; arrow keys move focus AND select (auto-select variant);\n * Space/Enter also select the currently-focused radio. The group's\n * `value` is the source of truth; each leaf computes\n * `radioChecked = computed(() => group.value() === radio.value())`\n * against its own `value` input.\n *\n * **Auto-select wiring (no signal-write-in-effect).** Per the\n * pillar §6 hard rule, the group does NOT subscribe to\n * `CngxRovingTabindex.activeIndex` via an effect that writes\n * `value`. Instead, the host `CngxRovingTabindex` raises its\n * navigation-key intent before it moves focus; the newly-focused\n * leaf's `(focus)` handler calls\n * `group.consumePendingArrowSelect(this.value())`, which reads\n * `roving.consumeNavigationKey()` and writes `value` (a signal write\n * inside a DOM event handler, not an effect - legal under the pillar\n * rules). Reading an already-set fact instead of a group-owned\n * `(keydown)` flag closes the one-press-behind race (#135).\n * Tab-into-group fires focus without a preceding navigation key, so\n * the hook reads false and no auto-select happens - Tab leaves the\n * consumer's `value` untouched.\n *\n * ```html\n * <cngx-radio-group [(value)]=\"payment\" name=\"payment-method\">\n * <cngx-radio value=\"card\">Card</cngx-radio>\n * <cngx-radio value=\"cash\">Cash</cngx-radio>\n * <cngx-radio value=\"invoice\" disabled>Invoice</cngx-radio>\n * </cngx-radio-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.component.ts\n * @selector cngx-radio-group\n * @since 0.1.0\n * @relatedTo CngxRadio, CngxButtonToggleGroup, CngxChipGroup\n * <example-url>http://localhost:4200/#/common/interactive/radio/basic-vertical-group</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/custom-dot-glyph</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/disabled-group-cascades-per-radio-overrides</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/orientation-horizontal</example-url>\n */\n@Component({\n selector: 'cngx-radio-group, [cngxRadioGroup]',\n exportAs: 'cngxRadioGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [CngxRovingTabindex],\n host: {\n class: 'cngx-radio-group',\n role: 'radiogroup',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-radio-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_RADIO_GROUP, useExisting: CngxRadioGroup },\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxRadioGroup },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxRadioGroup },\n ],\n template: `<ng-content />`,\n styleUrls: ['./radio-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxRadioGroup<T = unknown>\n implements CngxRadioGroupContract<T>, CngxControlValue<T | undefined>, CngxFormFieldControl\n{\n readonly value = model<T | undefined>(undefined);\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. When set, the\n * host emits `aria-errormessage=\"<id>\"`; consumers MUST render an\n * element with that id. Default `null` skips the attribute.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n readonly label = input<string | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n readonly nameInput = input<string | undefined>(undefined, { alias: 'name' });\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n private readonly fallbackName = nextUid('cngx-radio-group');\n\n readonly name = computed(() => this.nameInput() ?? this.fallbackName);\n\n private readonly registry = new Map<string, CngxRadioRegistration<T>>();\n private readonly roving = inject(CngxRovingTabindex, { host: true });\n\n readonly id = signal(nextUid('cngx-radio-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no radio is selected. */\n readonly empty = computed(() => this.value() === undefined);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n constructor() {\n /* Per WAI-ARIA APG Radio Group, all four arrow keys navigate\n regardless of the cosmetic group layout - the consumer-set\n `orientation` controls aria-orientation + the visual flex\n direction only, never the keyboard axis. Force the host\n roving directive to `'both'` so a vertical group still\n responds to ArrowLeft / ArrowRight and vice versa. */\n this.roving.orientation.set('both');\n }\n\n register(radio: CngxRadioRegistration<T>): void {\n this.registry.set(radio.id, radio);\n }\n\n unregister(id: string): void {\n this.registry.delete(id);\n }\n\n consumePendingArrowSelect(value: T): boolean {\n if (!this.roving.consumeNavigationKey()) {\n return false;\n }\n if (this.disabled()) {\n return false;\n }\n this.value.set(value);\n return true;\n }\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n DestroyRef,\n inject,\n input,\n model,\n type TemplateRef,\n} from '@angular/core';\nimport { CngxRovingItem } from '@cngx/common/a11y';\nimport { CngxRadioIndicator } from '@cngx/common/display';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_RADIO_GROUP, type CngxRadioGroupContract } from './radio-group.token';\n\n/**\n * Single radio leaf. Injects the parent group via `CNGX_RADIO_GROUP`\n * (token, never the concrete `CngxRadioGroup` class) and writes\n * `group.value.set(this.value())` when the user picks it. The leaf\n * does not own a value of its own - `value` is a required `input<T>`\n * supplied by the consumer; checked-ness is derived from\n * `group.value() === this.value()`.\n *\n * Composes `CngxRovingItem` as a host directive with input\n * forwarding (`'cngxRovingItemDisabled: disabled'`) so the\n * consumer's `[disabled]` binding flows into both the radio's\n * own `disabled` model AND the roving directive's skip-test -\n * arrow-key navigation in the parent group (driven by\n * `CngxRovingTabindex`) skips per-radio-disabled leaves\n * automatically. Group-level `[disabled]` is a separate cascade\n * via `radioDisabled = computed(() => group.disabled() ||\n * disabled())`; it blocks click + Space/Enter + auto-select\n * (`consumePendingArrowSelect` returns false when the group is\n * disabled) but is NOT forwarded to roving - a fully-disabled\n * group lets focus transit visually while every selection\n * pathway short-circuits.\n *\n * Selection on click, Space, or Enter (auto-select also fires\n * on arrow nav via `consumePendingArrowSelect`); Tab and\n * programmatic focus do not select on focus alone (W3C APG\n * variant - the parent group's keyboard contract makes this\n * explicit).\n *\n * The `[attr.name]` host binding is **cosmetic** (parity with\n * native `<input type=\"radio\" name=\"…\">` markup expectations);\n * the `<div role=\"radio\">` host does not participate in HTML\n * form submission, so the attribute carries no functional\n * weight.\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio.component.ts\n * @selector cngx-radio\n * @since 0.1.0\n * @relatedTo CngxRadioGroup, CngxButtonToggle, CngxChipInGroup\n * <example-url>http://localhost:4200/#/common/interactive/radio/basic-vertical-group</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/custom-dot-glyph</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/disabled-group-cascades-per-radio-overrides</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/orientation-horizontal</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-radio, [cngxRadio]',\n exportAs: 'cngxRadio',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingItem,\n inputs: ['cngxRovingItemDisabled: disabled'],\n },\n ],\n imports: [CngxRadioIndicator],\n host: {\n class: 'cngx-radio',\n role: 'radio',\n '[attr.aria-checked]': 'radioChecked() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'radioDisabled() ? \"true\" : null',\n '[attr.aria-describedby]': 'describedById()',\n '[attr.name]': 'group.name()',\n '[class.cngx-radio--checked]': 'radioChecked()',\n '[class.cngx-radio--disabled]': 'radioDisabled()',\n '(focus)': 'handleFocus()',\n '(click)': 'handleSelect()',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n },\n template: `\n <cngx-radio-indicator\n [checked]=\"radioChecked()\"\n [disabled]=\"radioDisabled()\"\n [dotGlyph]=\"dotGlyph()\"\n />\n <span class=\"cngx-radio__label\">\n <ng-content />\n </span>\n <span\n [id]=\"describedId\"\n class=\"cngx-radio__sr-only\"\n [attr.aria-hidden]=\"disabledReason() ? null : 'true'\"\n >{{ disabledReason() }}</span\n >\n `,\n styleUrls: ['./radio.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxRadio<T = unknown> {\n protected readonly group = inject<CngxRadioGroupContract<T>>(CNGX_RADIO_GROUP);\n\n readonly value = input.required<T>();\n readonly disabled = model<boolean>(false);\n readonly disabledReason = input<string>('');\n readonly dotGlyph = input<TemplateRef<void> | null>(null);\n\n private readonly id = nextUid('cngx-radio');\n protected readonly describedId = nextUid('cngx-radio-desc');\n\n protected readonly radioChecked = computed(() => this.group.value() === this.value());\n\n protected readonly radioDisabled = computed(() => this.group.disabled() || this.disabled());\n\n protected readonly describedById = computed(() =>\n this.disabledReason() ? this.describedId : null,\n );\n\n constructor() {\n this.group.register({\n id: this.id,\n value: () => this.value(),\n disabled: () => this.radioDisabled(),\n });\n inject(DestroyRef).onDestroy(() => this.group.unregister(this.id));\n }\n\n protected handleFocus(): void {\n if (this.radioDisabled()) {\n return;\n }\n this.group.consumePendingArrowSelect(this.value());\n }\n\n protected handleSelect(): void {\n if (this.radioDisabled()) {\n return;\n }\n this.group.value.set(this.value());\n }\n\n protected handleKeydown(event: Event): void {\n if (this.radioDisabled()) {\n return;\n }\n event.preventDefault();\n this.group.value.set(this.value());\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Parent contract every chip-group molecule (`CngxChipGroup` single,\n * `CngxMultiChipGroup` multi) provides via `useExisting`.\n * `CngxChipInGroup` leaves inject this token (NOT optional) - never\n * the concrete group class - so the leaf stays decompose-ready and\n * free of cyclic type dependencies, and the Phase 5 split between\n * single + multi groups can share the same leaf implementation.\n *\n * Selection state is queried via `isSelected(value)` and mutated via\n * `toggle(value)` / `remove(value)`. `isDisabled` is a\n * `Signal<boolean>` so the leaf's reactive `aria-disabled` and the\n * disabled-cascade derivation track it without re-injection. Per\n * `reference_atomic_decompose` §4 - leaf communicates with its\n * parent via DI token, never via concrete parent-class injection.\n *\n * Mode (single vs multi) is intentionally NOT exposed on this\n * contract: the leaf does not branch behaviour on mode, and no\n * consumer / bridge surface in scope reads it. A future feature\n * that needs mode discovery can extend the interface then; until\n * then the field stays out of the public surface.\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-group/chip-group-host.token.ts\n * @since 0.1.0\n */\nexport interface CngxChipGroupHost<T = unknown> {\n isSelected(value: T): boolean;\n toggle(value: T): void;\n remove(value: T): void;\n readonly isDisabled: Signal<boolean>;\n}\n\n/**\n * DI token a `CngxChipInGroup` leaf injects to find its parent chip\n * group. Always provided via\n * `{ provide: CNGX_CHIP_GROUP_HOST, useExisting: <Self> }` - never\n * via concrete-class injection. Required (NOT optional) on the leaf\n * side: a leaf without a parent throws `NullInjectorError` at\n * construction (fail-fast - silent dual-source-of-truth would be\n * worse).\n *\n * Standalone chips outside any group use `[cngxChipInteraction]`\n * instead, which provides `CNGX_CONTROL_VALUE` directly without ever\n * touching this token.\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-group/chip-group-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_CHIP_GROUP_HOST = new InjectionToken<CngxChipGroupHost>('CngxChipGroupHost');\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n isDevMode,\n model,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_CHIP_GROUP_HOST } from '../chip-group/chip-group-host.token';\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Standalone interactive chip - applies onto `<cngx-chip>` from\n * `@cngx/common/display` and wires `role=\"option\"` selection\n * semantics with a local-owned form-bound boolean. Provides\n * `CNGX_CONTROL_VALUE` so `CngxFormBridge` (Phase 7) can adapt it\n * to Reactive Forms and `<cngx-form-field [field]>` paths can drive\n * it through Signal Forms.\n *\n * **Use this when** the chip stands alone (e.g. a removable filter\n * tag, a single suggestion chip outside any chip-group). For chips\n * inside a `<cngx-chip-group>` / `<cngx-multi-chip-group>`, use\n * `[cngxChipInGroup]` instead - that variant derives `selected`\n * from the parent's selection controller as a `computed()`,\n * eliminating the dual-source-of-truth a local model would create.\n * A dev-mode guard (via `afterNextRender`) throws if a standalone\n * chip is mistakenly nested inside a group.\n *\n * **Naming note.** The `CngxControlValue<boolean>` contract requires\n * a `value: ModelSignal<boolean>` field; the plan's API surface\n * uses `[(selected)]` for the form state and `[value]` for the\n * chip's payload. Double aliasing reconciles both: the form-bound\n * `value` field is aliased to template binding `[(selected)]`, and\n * the payload `chipValue` field is aliased to template binding\n * `[value]`. Consumers write\n * `<cngx-chip cngxChipInteraction [value]=\"x\" [(selected)]=\"b\">`\n * unchanged.\n *\n * **A11y.** `role=\"option\"` + reactive `aria-selected`,\n * `aria-disabled`, and `tabindex` (-1 when disabled, 0 otherwise).\n * Click + Space + Enter toggle. Backspace + Delete fire\n * `removeRequest` - an output, NOT a state mutation. The consumer\n * decides whether removing the chip means dropping it from a list,\n * deselecting, or something else.\n *\n * **Close-button click guard.** The display chip's own\n * `<button class=\"cngx-chip__remove\">` is a child of the host; its\n * click event bubbles. `handleClick` short-circuits when the click\n * originates from inside that button so the chip's own `(click)`\n * toggle does not double-fire alongside the chip's `(remove)`\n * output.\n *\n * **Disabled \"why\".** When `disabledReason` is set, the directive\n * appends a hidden span to the host via `Renderer2` (always-in-DOM\n * per Pillar 2 - the id stays stable across renders). When\n * `disabledReason` is empty, consumers may still pass a custom id\n * via `cngxDescribedBy` and the `aria-describedby` host binding\n * routes to that. The two paths are mutually exclusive: a non-empty\n * `disabledReason` wins.\n *\n * ```html\n * <cngx-chip cngxChipInteraction [value]=\"'red'\" [(selected)]=\"redOn\">\n * Red\n * </cngx-chip>\n *\n * <span id=\"chip-locked-reason\" hidden>Tag is locked by your role</span>\n * <cngx-chip\n * cngxChipInteraction\n * [value]=\"tag\"\n * [(selected)]=\"picked\"\n * [removable]=\"true\"\n * (removeRequest)=\"onRemoveTag(tag)\"\n * [disabled]=\"locked()\"\n * cngxDescribedBy=\"chip-locked-reason\"\n * >{{ tag }}</cngx-chip>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-interaction/chip-interaction.directive.ts\n * @since 0.1.0\n * @relatedTo CngxChipInGroup, CngxChipGroup, CngxMultiChipGroup, CngxChipInput\n * <example-url>http://localhost:4200/#/common/interactive/chip/interaction/basic-toggle-on-click-space-or-enter</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/chip/interaction/disabled-state</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/chip/interaction/removable-with-removerequest-on-backspace-delete</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Directive({\n selector: '[cngxChipInteraction]',\n exportAs: 'cngxChipInteraction',\n standalone: true,\n host: {\n class: 'cngx-chip-interaction',\n role: 'option',\n '[attr.id]': 'id()',\n '[attr.aria-selected]': 'value() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-describedby]': 'resolvedDescribedBy()',\n '[attr.tabindex]': 'disabled() ? -1 : 0',\n '[class.cngx-chip-interaction--selected]': 'value()',\n '[class.cngx-chip-interaction--disabled]': 'disabled()',\n '(click)': 'handleClick($event)',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n '(keydown.delete)': 'handleRemoveKeydown($event)',\n '(keydown.backspace)': 'handleRemoveKeydown($event)',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxChipInteraction },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxChipInteraction },\n ],\n})\nexport class CngxChipInteraction<T = unknown>\n implements CngxControlValue<boolean>, CngxFormFieldControl\n{\n /**\n * Chip payload - required identifier the consumer associates with\n * this chip (e.g. a tag string, filter id, entity reference). The\n * directive does not inspect or compare it; it is forwarded to\n * `(removeRequest)` listeners and visible in the DOM via the\n * consumer's own bindings. Aliased so consumers write `[value]=\"x\"`\n * - see naming note in the class JSDoc.\n */\n readonly chipValue = input.required<T>({ alias: 'value' });\n\n /**\n * Form-bound selection state. Aliased so consumers write\n * `[(selected)]=\"b\"`; the field name is `value` to satisfy the\n * `CngxControlValue<boolean>` contract used by `CngxFormBridge`\n * (Phase 7). See class JSDoc.\n */\n readonly value = model<boolean>(false, { alias: 'selected' });\n\n readonly disabled = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element (e.g. a sibling\n * rendered by `<cngx-form-field>` or a consumer-owned `<span>`).\n * When set, the host emits `aria-errormessage=\"<id>\"` so AT can\n * locate the message; consumers MUST render an element with that id\n * - passing an id without a matching element produces a dangling\n * AT reference. Default `null` skips the attribute entirely.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly disabledReason = input<string>('');\n\n /**\n * Optional consumer-supplied id of an external description element\n * (e.g. a sibling sr-only `<span>`). Consumers bind via\n * `[cngxDescribedBy]=\"someId\"`. Field name `describedBy` matches\n * sibling atoms (`CngxChipInGroup`, `CngxButtonToggle`); the alias\n * preserves the consumer-facing template attribute. Resolved into\n * `aria-describedby` via `resolvedDescribedBy`, which prefers the\n * internal disabled-reason id when `disabledReason` is set.\n */\n readonly describedBy = input<string | null>(null, {\n alias: 'cngxDescribedBy',\n });\n\n /** Fires on Backspace/Delete keydown - consumer owns the removal. */\n readonly removeRequest = output<void>();\n\n private readonly describedId = nextUid('cngx-chip-desc');\n\n protected readonly resolvedDescribedBy = computed<string | null>(() => {\n if (this.disabledReason()) {\n return this.describedId;\n }\n return this.describedBy();\n });\n\n readonly id = signal(nextUid('cngx-chip-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when the chip is unselected - boolean atom semantics. */\n readonly empty = computed(() => this.value() === false);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly errorAggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.errorAggregator?.shouldShow() ?? false,\n );\n\n constructor() {\n const hostEl = (inject(ElementRef) as ElementRef<HTMLElement>).nativeElement;\n const renderer = inject(Renderer2);\n const span = renderer.createElement('span') as HTMLSpanElement;\n renderer.setAttribute(span, 'id', this.describedId);\n renderer.setAttribute(span, 'aria-hidden', 'true');\n // sr-only via inline styles - directive runs in arbitrary markup, can't\n // require a consumer stylesheet. Every value reads `--cngx-sr-only-*`\n // first so consumers can still override (structural/thematic split).\n renderer.setStyle(span, 'position', 'var(--cngx-sr-only-position, absolute)');\n renderer.setStyle(span, 'width', 'var(--cngx-sr-only-size, 1px)');\n renderer.setStyle(span, 'height', 'var(--cngx-sr-only-size, 1px)');\n renderer.setStyle(span, 'overflow', 'var(--cngx-sr-only-overflow, hidden)');\n renderer.setStyle(span, 'clip', 'var(--cngx-sr-only-clip, rect(0, 0, 0, 0))');\n renderer.setStyle(span, 'white-space', 'var(--cngx-sr-only-white-space, nowrap)');\n renderer.appendChild(hostEl, span);\n\n // Host may outlive the directive (structural re-projection, sibling\n // clear) - without explicit removal the span leaks and the next\n // instance collides on `describedId`.\n inject(DestroyRef).onDestroy(() => {\n // Host may already be detached by a parent structural directive at\n // the same destroy tick; removeChild on a stale parent throws.\n if (span.parentNode === hostEl) {\n renderer.removeChild(hostEl, span);\n }\n });\n\n effect(() => {\n const reason = this.disabledReason();\n untracked(() => {\n if (reason) {\n renderer.removeAttribute(span, 'aria-hidden');\n span.textContent = reason;\n } else {\n renderer.setAttribute(span, 'aria-hidden', 'true');\n span.textContent = '';\n }\n });\n });\n\n if (!isDevMode()) {\n return;\n }\n const ancestor = inject(CNGX_CHIP_GROUP_HOST, {\n optional: true,\n skipSelf: true,\n });\n afterNextRender(() => {\n if (ancestor !== null) {\n throw new Error(\n 'CngxChipInteraction must NOT be used inside <cngx-chip-group> / <cngx-multi-chip-group>; use [cngxChipInGroup] instead.',\n );\n }\n });\n }\n\n protected handleClick(event: MouseEvent): void {\n if (this.disabled() || isCloseButtonClick(event)) {\n return;\n }\n this.value.update((v) => !v);\n }\n\n protected handleKeydown(event: Event): void {\n if (this.disabled()) {\n return;\n }\n event.preventDefault();\n this.value.update((v) => !v);\n }\n\n protected handleRemoveKeydown(event: Event): void {\n if (this.disabled()) {\n return;\n }\n event.preventDefault();\n this.removeRequest.emit();\n }\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n\n/** @internal */\nfunction isCloseButtonClick(event: Event): boolean {\n const target = event.target;\n if (!(target instanceof Element)) {\n return false;\n }\n return target.closest('.cngx-chip__remove') !== null;\n}\n","import { Directive, computed, inject, input } from '@angular/core';\nimport { CngxRovingItem } from '@cngx/common/a11y';\n\nimport { CNGX_CHIP_GROUP_HOST, type CngxChipGroupHost } from '../chip-group/chip-group-host.token';\n\n/**\n * In-group chip leaf - applies onto `<cngx-chip>` from\n * `@cngx/common/display` and wires `role=\"option\"` semantics that\n * defer all selection mutations to the surrounding chip-group via\n * `CNGX_CHIP_GROUP_HOST`. Required parent (NOT optional): a\n * `[cngxChipInGroup]` outside any group throws `NullInjectorError`\n * at construction. Standalone interactive chips use\n * `[cngxChipInteraction]` instead.\n *\n * **No local model.** `selected` is a `computed()` reading\n * `parent.isSelected(value())`; the chip never holds its own\n * selection state. This is the fix for the dual-source-of-truth\n * problem flagged in `cngx-plan-review` (form-primitives §1) - a\n * single value-flow per directive: the parent's selection\n * controller is canonical, the leaf is a pure projection of it.\n *\n * **Activation.** Click + Space + Enter call `parent.toggle(value())`.\n * Delete + Backspace call `parent.remove(value())`. Close-button\n * clicks bubbling from `<cngx-chip>`'s internal remove button are\n * filtered so the chip's `(click)` toggle does not double-fire\n * alongside the chip's own `(remove)` output.\n *\n * **Roving composition.** Composes `CngxRovingItem` as a host\n * directive with `disabled` forwarding so arrow-key navigation in\n * the parent (driven by `CngxRovingTabindex` on `<cngx-chip-group>`\n * / `<cngx-multi-chip-group>`) skips per-chip-disabled leaves\n * automatically. Same pattern as `CngxRadio` and `CngxButtonToggle`.\n *\n * **Group-disabled cascade vs roving (accepted debt §4).** The\n * group-level `[disabled]` cascade short-circuits `handleSelect` /\n * `handleRemove` (see `chipDisabled` computed), but does NOT\n * propagate into `CngxRovingItem.disabled` - Angular forbids\n * re-binding a host-directive's read-only `InputSignal`. As a\n * result, a fully-disabled group lets visual focus transit through\n * its chips via Arrow keys; every selection / remove pathway\n * short-circuits silently. Behaviour mirrors `CngxRadio` and\n * `CngxButtonToggle`; tracked in `form-primitives-accepted-debt §4`.\n * Re-evaluation is gated on `CngxRovingItem.disabled` becoming a\n * writable surface in `@cngx/common/a11y`.\n *\n * **Disabled \"why\".** No internal sr-only span - the directive\n * applies onto a projected `<cngx-chip>` and has no template.\n * Consumers wanting a reason announcement render the description\n * element themselves and pass its id via `[describedBy]`. Same\n * pattern as `CngxButtonToggle` / `CngxChipInteraction`.\n *\n * ```html\n * <cngx-chip-group [(selected)]=\"size\" label=\"Size\">\n * <cngx-chip cngxChipInGroup [value]=\"'sm'\">Small</cngx-chip>\n * <cngx-chip cngxChipInGroup [value]=\"'md'\">Medium</cngx-chip>\n * <cngx-chip cngxChipInGroup [value]=\"'lg'\">Large</cngx-chip>\n * </cngx-chip-group>\n *\n * <cngx-multi-chip-group [(selectedValues)]=\"tags\" label=\"Tags\">\n * @for (tag of tags(); track tag) {\n * <cngx-chip\n * cngxChipInGroup\n * [value]=\"tag\"\n * [removable]=\"true\"\n * >{{ tag }}</cngx-chip>\n * }\n * </cngx-multi-chip-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-in-group/chip-in-group.directive.ts\n * @since 0.1.0\n * @relatedTo CngxChipGroup, CngxMultiChipGroup, CngxChipInteraction\n * <example-url>http://localhost:4200/#/common/interactive/chip/group/basic-pick-exactly-one-size</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/chip/multi-group/multi-select-chips-with-selection-count</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Directive({\n selector: '[cngxChipInGroup]',\n exportAs: 'cngxChipInGroup',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxRovingItem,\n inputs: ['cngxRovingItemDisabled: disabled'],\n },\n ],\n host: {\n class: 'cngx-chip-in-group',\n role: 'option',\n '[attr.aria-selected]': 'selected() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'chipDisabled() ? \"true\" : null',\n '[attr.aria-describedby]': 'describedBy()',\n '[class.cngx-chip-in-group--selected]': 'selected()',\n '[class.cngx-chip-in-group--disabled]': 'chipDisabled()',\n '(click)': 'handleClick($event)',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n '(keydown.delete)': 'handleRemove($event)',\n '(keydown.backspace)': 'handleRemove($event)',\n },\n})\nexport class CngxChipInGroup<T = unknown> {\n protected readonly parent = inject<CngxChipGroupHost<T>>(CNGX_CHIP_GROUP_HOST, { host: true });\n\n readonly value = input.required<T>();\n readonly disabled = input<boolean>(false);\n readonly describedBy = input<string | null>(null, {\n alias: 'cngxDescribedBy',\n });\n\n protected readonly selected = computed(() => this.parent.isSelected(this.value()));\n\n protected readonly chipDisabled = computed(() => this.parent.isDisabled() || this.disabled());\n\n protected handleClick(event: MouseEvent): void {\n if (this.chipDisabled() || isCloseButtonClick(event)) {\n return;\n }\n this.parent.toggle(this.value());\n }\n\n protected handleKeydown(event: Event): void {\n if (this.chipDisabled()) {\n return;\n }\n event.preventDefault();\n this.parent.toggle(this.value());\n }\n\n protected handleRemove(event: Event): void {\n if (this.chipDisabled()) {\n return;\n }\n event.preventDefault();\n this.parent.remove(this.value());\n }\n}\n\n/** @internal */\nfunction isCloseButtonClick(event: Event): boolean {\n const target = event.target;\n if (!(target instanceof Element)) {\n return false;\n }\n return target.closest('.cngx-chip__remove') !== null;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid, type CngxAsyncState } from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\nimport { CNGX_CHIP_GROUP_HOST, type CngxChipGroupHost } from './chip-group-host.token';\n\n/**\n * Single-select chip group. Owns a `selected = model<T | undefined>`\n * (the canonical single-value source) and exposes the parent contract\n * via `CNGX_CHIP_GROUP_HOST`. Behaves as a `role=\"listbox\"` with\n * `CngxRovingTabindex`-driven keyboard navigation; consumers project\n * `<cngx-chip cngxChipInGroup>` children that derive their own\n * `aria-selected` from this group's `isSelected(value)`.\n *\n * Mode is **static** per `feedback_select_family_split`: this is the\n * single-select half of a deliberate split. Consumers pick\n * `<cngx-chip-group>` for single-pick semantics or\n * `<cngx-multi-chip-group>` for multi-pick semantics - never a\n * runtime `[selectionMode]` flag.\n *\n * `value` is a structural alias of `selected` so the group satisfies\n * `CngxControlValue<T | undefined>` without owning two synchronised\n * models - both names point to the same `ModelSignal<T | undefined>`\n * instance. Mirrors `CngxCheckboxGroup`'s `selectedValues` / `value`\n * pairing.\n *\n * `[state]` accepts `CngxAsyncState<unknown>` for async-loaded chip\n * lists; reactively drives `aria-busy` so AT announces the busy\n * moment without consumer wiring. Slot directives for\n * skeleton/empty/error are deferred - the harmonized Phase 3-4 group\n * surface ships only the `aria-busy` projection of `[state]`, and\n * chip-group follows that precedent for cross-family consistency\n * (plan deviation 2026-05-01: skeleton/empty/error slot directives\n * declared in the plan body are dropped at execute time pending a\n * cross-family harmonization pass).\n *\n * Per Pillar 1 (Ableitung statt Verwaltung), `aria-busy` is a\n * `computed()` from `state.status()` - never a manual write. Per\n * Pillar 3 (Komposition statt Konfiguration), the group composes\n * `CngxRovingTabindex` and emits no implicit children - consumers\n * project chip rows themselves.\n *\n * ```html\n * <cngx-chip-group label=\"Size\" [(selected)]=\"size\">\n * <cngx-chip cngxChipInGroup [value]=\"'sm'\">Small</cngx-chip>\n * <cngx-chip cngxChipInGroup [value]=\"'md'\">Medium</cngx-chip>\n * <cngx-chip cngxChipInGroup [value]=\"'lg'\">Large</cngx-chip>\n * </cngx-chip-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-group/chip-group.component.ts\n * @selector cngx-chip-group\n * @since 0.1.0\n * @relatedTo CngxMultiChipGroup, CngxChipInGroup, CngxChipInteraction, CngxRadioGroup\n * <example-url>http://localhost:4200/#/common/interactive/chip/group/basic-pick-exactly-one-size</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-chip-group, [cngxChipGroup]',\n exportAs: 'cngxChipGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingTabindex,\n inputs: ['orientation'],\n },\n ],\n host: {\n class: 'cngx-chip-group',\n role: 'listbox',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-chip-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CHIP_GROUP_HOST, useExisting: CngxChipGroup },\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxChipGroup },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxChipGroup },\n ],\n template: `<ng-content />`,\n styleUrls: ['./chip-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxChipGroup<T = unknown>\n implements CngxControlValue<T | undefined>, CngxChipGroupHost<T>, CngxFormFieldControl\n{\n readonly selected = model<T | undefined>(undefined);\n readonly value = this.selected;\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. When set, the\n * host emits `aria-errormessage=\"<id>\"`; consumers MUST render an\n * element with that id. Default `null` skips the attribute.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly label = input<string | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /** CngxChipGroupHost - leaf-side cascade source. */\n readonly isDisabled = this.disabled;\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n isSelected(value: T): boolean {\n return Object.is(this.selected(), value);\n }\n\n toggle(value: T): void {\n if (this.disabled()) {\n return;\n }\n if (this.isSelected(value)) {\n this.selected.set(undefined);\n return;\n }\n this.selected.set(value);\n }\n\n remove(value: T): void {\n if (this.disabled()) {\n return;\n }\n if (this.isSelected(value)) {\n this.selected.set(undefined);\n }\n }\n\n readonly id = signal(nextUid('cngx-chip-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no chip is selected. */\n readonly empty = computed(() => this.selected() === undefined);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly errorAggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.errorAggregator?.shouldShow() ?? false,\n );\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n DestroyRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport {\n CNGX_SELECTION_CONTROLLER_FACTORY,\n nextUid,\n type CngxAsyncState,\n type SelectionController,\n} from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_CHIP_GROUP_HOST, type CngxChipGroupHost } from '../chip-group/chip-group-host.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Multi-select chip group. Owns a `selectedValues = model<T[]>([])`\n * (the canonical multi-value source) and exposes the parent contract\n * via `CNGX_CHIP_GROUP_HOST`. Behaves as a `role=\"listbox\"\n * aria-multiselectable=\"true\"` with `CngxRovingTabindex`-driven\n * keyboard navigation; consumers project `<cngx-chip cngxChipInGroup>`\n * children that derive their own `aria-selected` from this group's\n * `isSelected(value)`.\n *\n * Mode is **static** per `feedback_select_family_split`: this is the\n * multi-select half of the chip-group split.\n *\n * Internals lean on `createSelectionController` from `@cngx/core/utils`\n * for membership tracking - the controller's structural-equality\n * `selected` snapshot prevents downstream computed cascades from\n * thrashing when a re-emission produces the same logical contents\n * with a different array reference. Mirrors `CngxCheckboxGroup`'s\n * controller wiring.\n *\n * `value` is a structural alias of `selectedValues` so the group\n * satisfies `CngxControlValue<T[]>` without owning two synchronised\n * models - both names point to the same `ModelSignal<T[]>` instance.\n *\n * `[keyFn]` lets consumers with object-typed values map each value\n * to a stable membership key (typically `(v) => v.id`). Without it,\n * membership uses identity / primitive equality.\n *\n * `[state]` accepts `CngxAsyncState<unknown>` for async-loaded chip\n * lists; reactively drives `aria-busy`. Slot directives for\n * skeleton/empty/error are deferred - the harmonized Phase 3-4 group\n * surface ships only the `aria-busy` projection of `[state]`, and\n * chip-group follows that precedent for cross-family consistency\n * (plan deviation 2026-05-01: see `CngxChipGroup` JSDoc).\n *\n * **Roving strategy (accepted-debt §5).** This molecule uses\n * `CngxRovingTabindex` (per the harmonized Phase 3-4 group precedent),\n * NOT `createChipStripRoving`. The strip-roving controller would solve\n * clamp-on-removal automatically but its tabindex contract requires\n * the parent to bind `[attr.tabindex]` per chip wrapper at the\n * template level - which a content-projected `CngxChipInGroup` leaf\n * model does not allow. Tracked in `form-primitives-accepted-debt §5`;\n * UX consequence is a one-shot focus reset to index 0 after\n * mid-strip removal, instead of clamping to the next valid sibling.\n *\n * **Removal flow (plan deviation).** Plan revision claimed\n * `createChipRemovalHandler` from `@cngx/forms/select` would drive\n * the remove path. That import is a layer violation\n * (`@cngx/common/interactive` is Level 2; `@cngx/forms/select` is\n * Level 3). Removal here is a thin `controller.deselect(value)` -\n * the WeakMap-closure-cache machinery in the select-family handler\n * targets `ngTemplateOutlet` chip-slot stability, which content-\n * projected chip-in-group leaves do not exhibit.\n *\n * Per Pillar 1 (Ableitung statt Verwaltung), `aria-busy` is a\n * `computed()` from `state.status()`. Per Pillar 3 (Komposition\n * statt Konfiguration), the group composes `CngxRovingTabindex` and\n * emits no implicit children - consumers project chip rows themselves.\n *\n * ```html\n * <cngx-multi-chip-group label=\"Tags\" [(selectedValues)]=\"tags\">\n * @for (tag of options(); track tag) {\n * <cngx-chip cngxChipInGroup [value]=\"tag\">{{ tag }}</cngx-chip>\n * }\n * </cngx-multi-chip-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/multi-chip-group/multi-chip-group.component.ts\n * @selector cngx-multi-chip-group\n * @since 0.1.0\n * @relatedTo CngxChipGroup, CngxChipInGroup, CngxChipInput, CngxChipInteraction\n * <example-url>http://localhost:4200/#/common/interactive/chip/multi-group/multi-select-chips-with-selection-count</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-multi-chip-group, [cngxMultiChipGroup]',\n exportAs: 'cngxMultiChipGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingTabindex,\n inputs: ['orientation'],\n },\n ],\n host: {\n class: 'cngx-multi-chip-group',\n role: 'listbox',\n 'aria-multiselectable': 'true',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-multi-chip-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CHIP_GROUP_HOST, useExisting: CngxMultiChipGroup },\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxMultiChipGroup },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxMultiChipGroup },\n ],\n template: `<ng-content />`,\n styleUrls: ['./multi-chip-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxMultiChipGroup<T = unknown>\n implements CngxControlValue<T[]>, CngxChipGroupHost<T>, CngxFormFieldControl\n{\n readonly selectedValues = model<T[]>([]);\n readonly value = this.selectedValues;\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. When set, the\n * host emits `aria-errormessage=\"<id>\"`; consumers MUST render an\n * element with that id. Default `null` skips the attribute.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly label = input<string | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n readonly keyFn = input<(value: T) => unknown>((v) => v);\n\n /** CngxChipGroupHost - leaf-side cascade source. */\n readonly isDisabled = this.disabled;\n\n private readonly controller: SelectionController<T> = inject(\n CNGX_SELECTION_CONTROLLER_FACTORY,\n )<T>(this.selectedValues, {\n keyFn: (v) => this.keyFn()(v),\n });\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n /** Public membership count - useful for label hints + announcements. */\n readonly selectedCount = this.controller.selectedCount;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.controller.destroy());\n }\n\n isSelected(value: T): boolean {\n return this.controller.isSelected(value)();\n }\n\n toggle(value: T): void {\n if (this.disabled()) {\n return;\n }\n this.controller.toggle(value);\n }\n\n remove(value: T): void {\n if (this.disabled()) {\n return;\n }\n this.controller.deselect(value);\n }\n\n readonly id = signal(nextUid('cngx-multi-chip-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no chips are selected. */\n readonly empty = computed(() => this.selectedValues().length === 0);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly errorAggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.errorAggregator?.shouldShow() ?? false,\n );\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import { Directive, ElementRef, computed, inject, input, output, signal } from '@angular/core';\nimport {\n buildAsyncStateView,\n CNGX_STATEFUL,\n type AsyncStatus,\n type CngxAsyncState,\n type CngxStateful,\n} from '@cngx/core/utils';\nimport { firstValueFrom, isObservable, type Observable } from 'rxjs';\n\n/**\n * Tokenizing input that turns user-entered strings into emitted\n * `tokenCreated` events on separator keys (default: comma + Enter)\n * and on multi-token paste. Pairs naturally with\n * `<cngx-multi-chip-group>` or any consumer-managed chip list.\n *\n * **Validation slot - async-state producer.** The directive provides\n * `CNGX_STATEFUL` via `useExisting`, exposing a\n * `ManualAsyncState<string>` slot driven by `[validateToken]`\n * invocations. Bridge directives (`<cngx-toast-on />`,\n * `<cngx-banner-on />`) auto-discover this slot through the\n * `CNGX_STATEFUL` token without an explicit `[state]` input wiring.\n *\n * State machine: `idle → pending → success | error` per separator-key\n * invocation. Concurrent validations supersede via a monotonic\n * `validationId` - when a second token is entered before the first\n * resolves, the first's resolution is dropped and only the latest\n * outcome touches the slot. Mirrors `createCommitController`'s\n * supersede contract.\n *\n * **Removal contract.** `(tokenRemoved)` fires on Backspace at empty\n * input - semantically \"user wants to remove the last chip\". The\n * directive does not own the chip list; the consumer drops the last\n * entry from their state in response.\n *\n * **Duplicates.** `[existingTokens]` is read on every separator-key\n * invocation; when `allowDuplicates` is `false` (default), a token\n * already present in the list is silently dropped. The directive\n * does not track a private \"previously emitted\" set - that would be\n * an unbounded memory leak. Consumers pass their canonical chip\n * list as `[existingTokens]`.\n *\n * **Paste.** Pasting text containing one or more single-character\n * separators (e.g. `\"red, green, blue\"`) emits one `tokenCreated`\n * per non-empty fragment. Multi-char separators (`'Enter'`) are\n * keyboard-only and ignored by the paste path. Single-token paste\n * (no embedded separator) is left to the default paste behaviour\n * so the input value populates normally and the user can decide.\n *\n * ```html\n * <input\n * cngxChipInput\n * placeholder=\"Type a tag and press Enter\"\n * [existingTokens]=\"tags()\"\n * (tokenCreated)=\"addTag($event)\"\n * (tokenRemoved)=\"popTag()\"\n * [validateToken]=\"validateTag\"\n * />\n * <cngx-toast-on />\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-input/chip-input.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMultiChipGroup, CngxChipInteraction, CngxChipInGroup\n * <example-url>http://localhost:4200/#/common/interactive/chip/input/async-validation-with-supersede-semantics</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/chip/input/synchronous-tokenization</example-url>\n */\n@Directive({\n selector: 'input[cngxChipInput]',\n exportAs: 'cngxChipInput',\n standalone: true,\n host: {\n class: 'cngx-chip-input',\n '[attr.aria-busy]': 'isPending() ? \"true\" : null',\n '[attr.aria-invalid]': 'isInvalid() ? \"true\" : null',\n '(keydown)': 'handleKeydown($event)',\n '(paste)': 'handlePaste($event)',\n },\n providers: [{ provide: CNGX_STATEFUL, useExisting: CngxChipInput }],\n})\nexport class CngxChipInput implements CngxStateful<string> {\n readonly separators = input<readonly string[]>([',', 'Enter']);\n readonly allowDuplicates = input<boolean>(false);\n readonly trimWhitespace = input<boolean>(true);\n readonly existingTokens = input<readonly string[]>([]);\n readonly validateToken = input<\n ((value: string) => Promise<string> | Observable<string>) | undefined\n >(undefined);\n\n readonly tokenCreated = output<string>();\n readonly tokenRemoved = output<void>();\n readonly validationError = output<unknown>();\n\n private readonly statusState = signal<AsyncStatus>('idle');\n private readonly dataState = signal<string | undefined>(undefined);\n private readonly errorState = signal<unknown>(undefined);\n private readonly hadSuccess = signal(false);\n\n /**\n * Validation slot - `CngxStateful<string>` contract surface. The\n * view is built from raw signals via `buildAsyncStateView` rather\n * than `createManualState` (which lives in `@cngx/common/data`)\n * because `@cngx/common/data → @cngx/common/interactive` already\n * exists via `CngxSearch`, and re-importing data from interactive\n * would create a circular package dependency. The 30-LOC inline\n * is acceptable scope-wise; a future refactor relocating\n * `createManualState` to `@cngx/core/utils` would let this\n * collapse to a single call.\n */\n readonly state: CngxAsyncState<string> = buildAsyncStateView<string>({\n status: this.statusState.asReadonly(),\n data: this.dataState.asReadonly(),\n error: this.errorState.asReadonly(),\n progress: signal<number | undefined>(undefined).asReadonly(),\n isFirstLoad: computed(() => !this.hadSuccess()),\n lastUpdated: signal<Date | undefined>(undefined).asReadonly(),\n });\n\n private readonly hostEl = inject<ElementRef<HTMLInputElement>>(ElementRef).nativeElement;\n private validationId = 0;\n\n protected readonly isPending = computed(() => this.state.status() === 'pending');\n protected readonly isInvalid = computed(() => this.state.status() === 'error');\n\n protected handleKeydown(event: KeyboardEvent): void {\n if (this.separators().includes(event.key)) {\n event.preventDefault();\n const raw = this.hostEl.value;\n this.hostEl.value = '';\n this.createToken(raw);\n return;\n }\n if (event.key === 'Backspace' && this.hostEl.value === '') {\n this.tokenRemoved.emit();\n }\n }\n\n protected handlePaste(event: ClipboardEvent): void {\n const text = event.clipboardData?.getData('text');\n if (text === undefined || text === '') {\n return;\n }\n const charSeps = this.separators().filter((s) => s.length === 1);\n if (charSeps.length === 0) {\n return;\n }\n const escaped = charSeps.map(escapeForCharClass).join('');\n const splitter = new RegExp(`[${escaped}]`);\n const fragments = text.split(splitter).filter((f) => f.length > 0);\n if (fragments.length <= 1) {\n return;\n }\n event.preventDefault();\n this.hostEl.value = '';\n for (const fragment of fragments) {\n this.createToken(fragment);\n }\n }\n\n private createToken(rawValue: string): void {\n const trimmed = this.trimWhitespace() ? rawValue.trim() : rawValue;\n if (trimmed === '') {\n return;\n }\n if (!this.allowDuplicates() && this.existingTokens().includes(trimmed)) {\n return;\n }\n\n const validate = this.validateToken();\n if (validate === undefined) {\n this.tokenCreated.emit(trimmed);\n return;\n }\n\n const id = ++this.validationId;\n this.statusState.set('pending');\n\n void this.runValidation(validate, trimmed, id);\n }\n\n private async runValidation(\n validate: (value: string) => Promise<string> | Observable<string>,\n value: string,\n id: number,\n ): Promise<void> {\n try {\n const result = validate(value);\n const accepted: string = isObservable(result) ? await firstValueFrom(result) : await result;\n if (id !== this.validationId) {\n return;\n }\n this.dataState.set(accepted);\n this.errorState.set(undefined);\n this.hadSuccess.set(true);\n this.statusState.set('success');\n this.tokenCreated.emit(accepted);\n } catch (err) {\n if (id !== this.validationId) {\n return;\n }\n this.errorState.set(err);\n this.statusState.set('error');\n this.validationError.emit(err);\n }\n }\n}\n\n/**\n * Escape a single character for safe inclusion inside a regex\n * character class `[...]`. Unlike general-context escaping, the\n * meta set is narrower (`\\`, `]`, `^`, `-`) but `^` and `-` matter\n * because they would otherwise act as character-class operators\n * (negation at position 0, range between siblings) and silently\n * change the splitter's behaviour for separators like `'-'` or\n * `'^'`. Always-escaping these four is safe inside `[...]`.\n *\n * @internal\n */\nfunction escapeForCharClass(value: string): string {\n return value.replace(/[\\\\\\]\\-^]/g, '\\\\$&');\n}\n","import { inject, InjectionToken, type Provider } from '@angular/core';\n\n/**\n * App-wide tree-controller configuration. Populated via\n * {@link provideTreeConfig} in the root providers (or\n * {@link provideTreeConfigAt} in a component's `viewProviders` for a\n * sub-tree scope).\n *\n * Priority for every field is:\n *\n * ```\n * Per-controller option (CngxTreeControllerOptions.*)\n * ↑ falls through to\n * Component/scope viewProviders (provideTreeConfigAt)\n * ↑ falls through to\n * Root providers (provideTreeConfig)\n * ↑ falls through to\n * Library default (createTreeController / flattenTree)\n * ```\n *\n * All fields are optional - omit the ones you don't need. Typed with\n * `unknown` T-parameters because config values flow through the DI\n * system where per-instance generics can't be preserved; per-\n * controller options are still properly typed via the call site's\n * `CngxTreeControllerOptions<T>`.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport interface CngxTreeConfig {\n /**\n * Fallback for `nodeIdFn` when a caller omits it. With a config\n * default set, `CngxTreeControllerOptions.nodeIdFn` becomes\n * effectively optional - the factory throws in dev mode only when\n * neither place provides a function.\n */\n readonly defaultNodeIdFn?: (value: unknown, path: readonly number[]) => string;\n /** Fallback for `labelFn`. Library default is `String(value)`. */\n readonly defaultLabelFn?: (value: unknown) => string;\n /** Fallback for `keyFn`. Library default is identity. */\n readonly defaultKeyFn?: (value: unknown) => unknown;\n /**\n * Bound the `isExpanded(id)` signal cache. Default: unlimited -\n * keeps the stable-identity guarantee (`isExpanded(v) === isExpanded(v)`\n * always holds for the lifetime of the controller). When set, the\n * cache FIFO-evicts its oldest entry as soon as the size exceeds\n * `cacheLimit`; a re-queried id then receives a NEW signal instance\n * (values are equivalent, references differ). Set this only at\n * grid/tree scale (100k+ nodes) where memory retention matters\n * more than reference stability.\n */\n readonly cacheLimit?: number;\n /** Fallback for `initiallyExpanded`. */\n readonly defaultInitiallyExpanded?: 'all' | 'none' | readonly string[];\n}\n\n/**\n * DI token carrying the merged {@link CngxTreeConfig}. Defaults to an\n * empty object so consumers who never call {@link provideTreeConfig}\n * see library-default behaviour unchanged.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport const CNGX_TREE_CONFIG = new InjectionToken<CngxTreeConfig>('CngxTreeConfig', {\n providedIn: 'root',\n factory: (): CngxTreeConfig => ({}),\n});\n\n/**\n * Feature returned by a `with*` function - merged by\n * {@link provideTreeConfig}.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport interface CngxTreeConfigFeature {\n readonly config: Partial<CngxTreeConfig>;\n}\n\n/** @internal */\nfunction feature(mix: Partial<CngxTreeConfig>): CngxTreeConfigFeature {\n return { config: mix };\n}\n\n/**\n * App-wide default `nodeIdFn`. Per-controller options still override.\n * Use this to enforce a domain id convention across the whole app\n * (e.g. `(v) => (v as { uuid: string }).uuid`) without repeating it\n * at every call site.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function withDefaultNodeIdFn<T>(\n fn: (value: T, path: readonly number[]) => string,\n): CngxTreeConfigFeature {\n return feature({\n defaultNodeIdFn: fn as (value: unknown, path: readonly number[]) => string,\n });\n}\n\n/**\n * App-wide default `labelFn`. Library default is `String(value)`.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function withDefaultLabelFn<T>(fn: (value: T) => string): CngxTreeConfigFeature {\n return feature({ defaultLabelFn: fn as (value: unknown) => string });\n}\n\n/**\n * App-wide default `keyFn`. Library default is identity.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function withDefaultKeyFn<T>(fn: (value: T) => unknown): CngxTreeConfigFeature {\n return feature({ defaultKeyFn: fn as (value: unknown) => unknown });\n}\n\n/**\n * Bound the `isExpanded(id)` signal cache. See\n * {@link CngxTreeConfig.cacheLimit} for the trade-off.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function withTreeCacheLimit(limit: number): CngxTreeConfigFeature {\n return feature({ cacheLimit: limit });\n}\n\n/**\n * App-wide default `initiallyExpanded` seed.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function withDefaultInitiallyExpanded(\n mode: 'all' | 'none' | readonly string[],\n): CngxTreeConfigFeature {\n return feature({ defaultInitiallyExpanded: mode });\n}\n\n/**\n * Register an app-wide {@link CngxTreeConfig} composed from `with*`\n * features.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideTreeConfig(\n * withDefaultNodeIdFn<MyDomain>((v) => v.uuid),\n * withDefaultKeyFn<MyDomain>((v) => v.uuid),\n * withTreeCacheLimit(5000),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function provideTreeConfig(...features: CngxTreeConfigFeature[]): Provider[] {\n const merged = features.reduce<CngxTreeConfig>((acc, f) => ({ ...acc, ...f.config }), {});\n return [{ provide: CNGX_TREE_CONFIG, useValue: merged }];\n}\n\n/**\n * Sub-tree / component-scoped variant - use in `viewProviders` so the\n * tree config only applies to descendants of this component.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function provideTreeConfigAt(...features: CngxTreeConfigFeature[]): Provider[] {\n return provideTreeConfig(...features);\n}\n\n/**\n * Inject the currently-resolved config. Safe to call in any injection\n * context; returns `{}` if no `provideTreeConfig` is registered.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function injectTreeConfig(): CngxTreeConfig {\n return inject(CNGX_TREE_CONFIG);\n}\n","import { computed, inject, InjectionToken, signal, type Signal, untracked } from '@angular/core';\nimport {\n type CngxTreeNode,\n type FlatTreeNode,\n collectDescendantValues,\n flattenTree,\n isNodeVisible,\n} from '@cngx/utils';\nimport { CNGX_TREE_CONFIG } from './tree-config';\n\n/**\n * Configuration for {@link createTreeController}.\n *\n * `nodeIdFn` is required on purpose: the controller hands its ids out to\n * `expandedIds`, to selection memoization (`keyFn` consumers), and to the\n * stable-identity `isExpanded(id)` signal cache. A non-stable id (e.g. the\n * path-based fallback from `flattenTree`) silently breaks all three the\n * moment the tree is sorted or filtered - exactly the Sort/Filter\n * integration pattern this stack is designed to support. Forcing the\n * caller to think about identity at construction eliminates that whole\n * class of heisenbugs.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts\n * @since 0.1.0\n */\nexport interface CngxTreeControllerOptions<T> {\n /** Source tree - the controller re-derives on every change. */\n readonly nodes: Signal<readonly CngxTreeNode<T>[]>;\n /**\n * Derives a stable id per flat node - must survive re-ordering and\n * filtering of the source tree. Use a domain id (`(v) => v.id`)\n * rather than a positional fallback.\n *\n * Resolution: per-options > app-wide `provideTreeConfig` default >\n * dev-mode error. At least one source must provide the function.\n */\n readonly nodeIdFn?: (value: T, path: readonly number[]) => string;\n /**\n * Visible label. Defaults (in resolution order): per-options >\n * `provideTreeConfig` default > `String(value)`.\n */\n readonly labelFn?: (value: T) => string;\n /**\n * Membership key. Defaults (in resolution order): per-options >\n * `provideTreeConfig` default > identity.\n */\n readonly keyFn?: (value: T) => unknown;\n /**\n * Initial expansion. Resolution: per-options >\n * `provideTreeConfig.defaultInitiallyExpanded` > `'none'`.\n * Evaluated once at construction; later tree changes do not re-apply.\n * Re-trigger via `expandAll()` if needed.\n */\n readonly initiallyExpanded?: 'all' | 'none' | readonly string[];\n /**\n * Bound the `isExpanded(id)` signal cache. Default: unlimited.\n * Resolution: per-options > `provideTreeConfig.cacheLimit` >\n * unlimited. See {@link CngxTreeConfig.cacheLimit} for trade-offs.\n */\n readonly cacheLimit?: number;\n}\n\n/**\n * Signal-native tree controller. Produces flat-projected views of a\n * hierarchical source, owns the expansion-set, and exposes value- and\n * id-based lookups used by the surrounding render / keyboard-nav layers.\n *\n * ## Derivation contract\n * - No `effect()`, no subscriptions. The only writable slot is the internal\n * expandedIds set; every other accessor is a `computed()` or pure fn.\n * - `isExpanded(id)` returns the SAME `Signal` instance per id across the\n * controller's lifetime - safe to pass into OnPush children without churn.\n * - Controller is a11y-agnostic - adapters like `createTreeAdItems` live\n * in sibling files so `@cngx/core`-level reuse stays clean.\n *\n * ## Reactivity contract\n * The surface splits into two classes of accessors, **by design**:\n *\n * - **Reactive** (`Signal<…>` returners): `flatNodes`, `visibleNodes`,\n * `expandedIds`, `isExpanded(id)`. Bind these in templates and wrap in\n * `computed()` freely - Angular tracks their dependencies automatically.\n *\n * - **Snapshot** (plain-return methods): `findById`, `parentOf`,\n * `firstChildOf`, `childrenOfValue`, `descendantsOfValue`. These read\n * the underlying indexes reactively when called inside a tracked\n * context, but intentionally return raw values rather than signals.\n * They are intended for imperative call-sites - keydown handlers,\n * commit flows, AD-activation dispatch - where the caller wants a\n * one-shot lookup, not a subscription. If you *do* call them from\n * inside an `effect()` that should NOT re-fire on tree changes, wrap\n * the call in `untracked(() => ctrl.parentOf(id))`.\n *\n * ## Mutations\n * All mutators (`expand`, `collapse`, `toggle`, `expandAll`, `collapseAll`)\n * peek at the expansion set via `untracked()` so invoking them from\n * inside an `effect()` never latches that effect onto the expansion set.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts\n * @since 0.1.0\n */\nexport interface CngxTreeController<T> {\n /** Flat DFS projection with ARIA metadata + backref to the source node. */\n readonly flatNodes: Signal<readonly FlatTreeNode<T>[]>;\n /** Flat nodes minus those under a collapsed ancestor. */\n readonly visibleNodes: Signal<readonly FlatTreeNode<T>[]>;\n /** Read-only view of the expansion set. */\n readonly expandedIds: Signal<ReadonlySet<string>>;\n /** Stable-identity membership signal per id. */\n isExpanded(id: string): Signal<boolean>;\n /**\n * Direct-children values of a node, for selection `childrenFn`.\n *\n * Returns a fresh array per call. SelectionController's cascade\n * `isIndeterminate` walk invokes `childrenFn` once per tree node on\n * every membership change - a cascade-toggle on a 10k-descendant root\n * triggers O(n) fresh allocations per recompute. Tracked as a perf\n * follow-up: memoize by (tree-version, value-key) if the 10k demo\n * surfaces measurable jitter; spec `tree-controller.spec.ts` carries\n * a reserved baseline-benchmark slot (`it.todo`).\n */\n childrenOfValue(value: T): T[];\n /**\n * All descendant values (DFS, exclusive of self), for cascade-select.\n * Same allocation caveat as `childrenOfValue` - returns a fresh array;\n * cascade-select on wide subtrees allocates O(descendants) per call.\n */\n descendantsOfValue(value: T): T[];\n expand(id: string): void;\n collapse(id: string): void;\n toggle(id: string): void;\n /** Expand every node that has children. No-op when already fully expanded. */\n expandAll(): void;\n collapseAll(): void;\n findById(id: string): FlatTreeNode<T> | undefined;\n /**\n * O(1) lookup of the flat projection for a value, using the same\n * `keyFn` that backs selection membership. Returns `undefined` when\n * the value is not in the current tree (stale selection, swapped\n * source, etc.). Prefer this over a linear scan of `flatNodes()`.\n */\n findByValue(value: T): FlatTreeNode<T> | undefined;\n parentOf(id: string): FlatTreeNode<T> | undefined;\n firstChildOf(id: string): FlatTreeNode<T> | undefined;\n /**\n * Release the `isExpanded(id)` signal-cache. **Soft contract** - matches\n * `createSelectionController`'s destroy semantics:\n * - New `isExpanded(id)` queries return a shared `Signal<false>` constant.\n * - Existing signal bindings created before destroy keep working - the\n * underlying `expandedIds` signal is still live, so downstream updates\n * continue to propagate.\n * - Mutators (`expand` / `collapse` / `toggle` / `expandAll` /\n * `collapseAll`) continue to function; post-destroy writes do NOT\n * repopulate the cache.\n *\n * Idempotent. Prefer this over a hard teardown so long-lived consumer\n * bindings that outlive the controller's active phase degrade\n * gracefully rather than throwing.\n */\n destroy(): void;\n}\n\n/**\n * Factory signature carried by the DI token.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts\n * @since 0.1.0\n */\nexport type CngxTreeControllerFactory = <T>(\n opts: CngxTreeControllerOptions<T>,\n) => CngxTreeController<T>;\n\n/**\n * Injection token that resolves the factory used to instantiate a\n * {@link CngxTreeController}. Defaults to {@link createTreeController};\n * override via `providers`/`viewProviders` for telemetry wrappers, audit\n * logging, or server-synced expansion state.\n *\n * Symmetrical to `CNGX_SELECTION_CONTROLLER_FACTORY` in `@cngx/core/utils` -\n * same override surface, one concern below: tree-aware derived views.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts\n * @since 0.1.0\n */\nexport const CNGX_TREE_CONTROLLER_FACTORY = new InjectionToken<CngxTreeControllerFactory>(\n 'CngxTreeControllerFactory',\n {\n providedIn: 'root',\n factory: () => createTreeController,\n },\n);\n\n/**\n * Shared `Signal<false>` returned post-destroy and as an always-false fallback.\n *\n * @internal\n */\nconst POST_DESTROY_FALSE: Signal<boolean> = signal(false).asReadonly();\n\n/** @internal */\nfunction flatEq<T>(a: readonly FlatTreeNode<T>[], b: readonly FlatTreeNode<T>[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const ai = a[i];\n const bi = b[i];\n if (\n ai.id !== bi.id ||\n !Object.is(ai.value, bi.value) ||\n ai.disabled !== bi.disabled ||\n ai.hasChildren !== bi.hasChildren ||\n ai.depth !== bi.depth\n ) {\n return false;\n }\n }\n return true;\n}\n\n/** @internal */\ninterface TreeIndexes<T> {\n readonly byId: ReadonlyMap<string, FlatTreeNode<T>>;\n /** `keyFn(value)` → flat-projected node. Source `CngxTreeNode` is reachable via `.node`. */\n readonly byValue: ReadonlyMap<unknown, FlatTreeNode<T>>;\n readonly firstChildById: ReadonlyMap<string, FlatTreeNode<T>>;\n}\n\n/**\n * Plain factory for a signal-native tree controller. Reads `opts.nodes`\n * reactively, derives flat / visible projections via `computed`, and\n * tracks expanded-id state internally. Must be called in an injection\n * context (reads {@link CNGX_TREE_CONFIG} for defaults).\n *\n * See {@link CngxTreeController} for the returned surface and\n * {@link CngxTreeControllerOptions} for the configuration cascade.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts\n * @since 0.1.0\n */\nexport function createTreeController<T>(opts: CngxTreeControllerOptions<T>): CngxTreeController<T> {\n const { nodes } = opts;\n const config = inject(CNGX_TREE_CONFIG, { optional: true }) ?? {};\n\n // Resolution: per-options > provideTreeConfig default > library default.\n const resolvedNodeIdFn =\n opts.nodeIdFn ??\n (config.defaultNodeIdFn as ((v: T, path: readonly number[]) => string) | undefined);\n if (!resolvedNodeIdFn) {\n throw new Error(\n 'createTreeController: `nodeIdFn` is required. Provide it via ' +\n 'CngxTreeControllerOptions.nodeIdFn or app-wide through ' +\n '`provideTreeConfig(withDefaultNodeIdFn(...))`.',\n );\n }\n const resolvedLabelFn = opts.labelFn ?? (config.defaultLabelFn as ((v: T) => string) | undefined);\n const resolvedKeyFn: (v: T) => unknown =\n opts.keyFn ??\n (config.defaultKeyFn as ((v: T) => unknown) | undefined) ??\n ((v: T) => v as unknown);\n const resolvedInitiallyExpanded = opts.initiallyExpanded ?? config.defaultInitiallyExpanded;\n const resolvedCacheLimit = opts.cacheLimit ?? config.cacheLimit;\n\n const keyFn = resolvedKeyFn;\n\n const flatNodes = computed(() => flattenTree(nodes(), resolvedNodeIdFn, resolvedLabelFn), {\n equal: flatEq,\n });\n\n // One pass over flatNodes produces every index the controller needs:\n // id → FlatTreeNode, value-key → source CngxTreeNode, parentId →\n // first-child FlatTreeNode. All lookups are O(1); the old linear\n // scan in firstChildOf is gone.\n const indexes = computed<TreeIndexes<T>>(() => {\n const byId = new Map<string, FlatTreeNode<T>>();\n const byValue = new Map<unknown, FlatTreeNode<T>>();\n const firstChildById = new Map<string, FlatTreeNode<T>>();\n for (const n of flatNodes()) {\n byId.set(n.id, n);\n byValue.set(keyFn(n.value), n);\n const pids = n.parentIds;\n if (pids.length > 0) {\n const parentId = pids[pids.length - 1];\n if (!firstChildById.has(parentId)) {\n firstChildById.set(parentId, n);\n }\n }\n }\n return { byId, byValue, firstChildById };\n });\n\n const collectExpandAllIds = (): Set<string> => {\n const next = new Set<string>();\n for (const n of flatNodes()) {\n if (n.hasChildren) {\n next.add(n.id);\n }\n }\n return next;\n };\n\n // Seed the expansion set once. `untracked` is defensive - if the factory\n // is mistakenly called from an outer reactive context, this read must not\n // leak `flatNodes` / `nodes` into that context's dependency graph.\n const initialSet = untracked(() => {\n if (resolvedInitiallyExpanded === 'all') {\n return collectExpandAllIds();\n }\n if (Array.isArray(resolvedInitiallyExpanded)) {\n return new Set(resolvedInitiallyExpanded);\n }\n return new Set<string>();\n });\n\n const expandedIdsWritable = signal<ReadonlySet<string>>(initialSet);\n const expandedIds = expandedIdsWritable.asReadonly();\n\n const visibleNodes = computed(() => flatNodes().filter((n) => isNodeVisible(n, expandedIds())), {\n equal: flatEq,\n });\n\n // `Map` preserves insertion order → FIFO eviction when `cacheLimit`\n // is set. Without a limit the cache grows unbounded over the\n // controller's lifetime (bounded by unique-id count in practice).\n // Re-inserting an existing key via `set` does NOT re-order the entry\n // in modern JS engines, which keeps the eviction order predictable\n // (oldest-inserted, not least-recently-used).\n const expandedCache = new Map<string, Signal<boolean>>();\n let destroyed = false;\n\n const evictOldestIfOverLimit = (): void => {\n if (resolvedCacheLimit === undefined) {\n return;\n }\n while (expandedCache.size > resolvedCacheLimit) {\n const oldestKey = expandedCache.keys().next().value;\n if (oldestKey === undefined) {\n return;\n }\n expandedCache.delete(oldestKey);\n }\n };\n\n const isExpanded = (id: string): Signal<boolean> => {\n if (destroyed) {\n return POST_DESTROY_FALSE;\n }\n let sig = expandedCache.get(id);\n if (!sig) {\n sig = computed(() => expandedIds().has(id));\n expandedCache.set(id, sig);\n evictOldestIfOverLimit();\n }\n return sig;\n };\n\n const childrenOfValue = (v: T): T[] => {\n const flat = indexes().byValue.get(keyFn(v));\n const children = flat?.node.children ?? [];\n return children.map((c) => c.value);\n };\n\n const descendantsOfValue = (v: T): T[] => {\n const flat = indexes().byValue.get(keyFn(v));\n return flat ? collectDescendantValues(flat.node) : [];\n };\n\n const findById = (id: string): FlatTreeNode<T> | undefined => indexes().byId.get(id);\n\n const findByValue = (v: T): FlatTreeNode<T> | undefined => indexes().byValue.get(keyFn(v));\n\n const parentOf = (id: string): FlatTreeNode<T> | undefined => {\n const byId = indexes().byId;\n const node = byId.get(id);\n if (!node || node.parentIds.length === 0) {\n return undefined;\n }\n return byId.get(node.parentIds[node.parentIds.length - 1]);\n };\n\n const firstChildOf = (id: string): FlatTreeNode<T> | undefined =>\n indexes().firstChildById.get(id);\n\n // Mutation helpers read the writable signal via `untracked()` - these\n // methods can be invoked from anywhere (event handlers, effects, async\n // callbacks); reading outside a tracked context keeps consumer `effect()`\n // graphs from latching onto the expansion set accidentally.\n const peekExpanded = (): ReadonlySet<string> => untracked(() => expandedIdsWritable());\n\n const expand = (id: string): void => {\n if (peekExpanded().has(id)) {\n return;\n }\n expandedIdsWritable.update((s) => {\n const next = new Set(s);\n next.add(id);\n return next;\n });\n };\n\n const collapse = (id: string): void => {\n if (!peekExpanded().has(id)) {\n return;\n }\n expandedIdsWritable.update((s) => {\n const next = new Set(s);\n next.delete(id);\n return next;\n });\n };\n\n const toggle = (id: string): void => {\n if (peekExpanded().has(id)) {\n collapse(id);\n } else {\n expand(id);\n }\n };\n\n const setsEqual = (a: ReadonlySet<string>, b: ReadonlySet<string>): boolean => {\n if (a === b) {\n return true;\n }\n if (a.size !== b.size) {\n return false;\n }\n for (const id of a) {\n if (!b.has(id)) {\n return false;\n }\n }\n return true;\n };\n\n const expandAll = (): void => {\n const next = untracked(() => collectExpandAllIds());\n if (setsEqual(peekExpanded(), next)) {\n return;\n }\n expandedIdsWritable.set(next);\n };\n\n const collapseAll = (): void => {\n if (peekExpanded().size === 0) {\n return;\n }\n expandedIdsWritable.set(new Set());\n };\n\n const destroy = (): void => {\n if (destroyed) {\n return;\n }\n destroyed = true;\n expandedCache.clear();\n };\n\n return {\n flatNodes,\n visibleNodes,\n expandedIds,\n isExpanded,\n childrenOfValue,\n descendantsOfValue,\n expand,\n collapse,\n toggle,\n expandAll,\n collapseAll,\n findById,\n findByValue,\n parentOf,\n firstChildOf,\n destroy,\n };\n}\n","import { computed, type Signal } from '@angular/core';\nimport { type ActiveDescendantItem } from '@cngx/common/a11y';\nimport { type CngxTreeController } from './tree-controller';\n\n/** @internal */\nfunction adEq(a: ActiveDescendantItem[], b: ActiveDescendantItem[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const ai = a[i];\n const bi = b[i];\n if (\n ai.id !== bi.id ||\n !Object.is(ai.value, bi.value) ||\n ai.disabled !== bi.disabled ||\n ai.label !== bi.label\n ) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Projects a tree controller's `visibleNodes` into the\n * `ActiveDescendantItem[]` shape consumed by `CngxActiveDescendant.items`.\n * Kept as a helper (not a method on the controller) so\n * `CngxTreeController` stays free of the `@cngx/common/a11y` import and\n * can be reused from contexts that do not render through AD.\n *\n * Returns a structurally-equal memoized computed - consumers can pass the\n * signal straight into `[items]=\"adItems()\"` without worrying about cascade\n * re-renders on irrelevant tree re-emissions.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-ad-items.ts\n * @since 0.1.0\n */\nexport function createTreeAdItems<T>(ctrl: CngxTreeController<T>): Signal<ActiveDescendantItem[]> {\n return computed(\n () =>\n ctrl.visibleNodes().map<ActiveDescendantItem>((n) => ({\n id: n.id,\n value: n.value,\n label: n.label,\n disabled: n.disabled,\n })),\n { equal: adEq },\n );\n}\n","import { InjectionToken } from '@angular/core';\nimport { type CngxActiveDescendant } from '@cngx/common/a11y';\nimport { type CngxTreeController } from '../tree-controller/tree-controller';\n\n/**\n * Outcome dispatched by a {@link CngxHierarchicalNavStrategy} step.\n * `CngxHierarchicalNav` interprets the action: fires the matching\n * output, calls `event.preventDefault()` for anything non-`noop`, and\n * (for move actions) relies on the strategy having already called\n * `ad.highlightByValue` on the context.\n *\n * @category common/interactive/tree\n */\nexport type CngxHierarchicalNavAction =\n | { readonly kind: 'expand'; readonly id: string }\n | { readonly kind: 'collapse'; readonly id: string }\n | { readonly kind: 'movedToChild'; readonly id: string }\n | { readonly kind: 'movedToParent'; readonly id: string }\n | { readonly kind: 'noop' };\n\n/**\n * Context passed to every strategy step. `ad` is guaranteed non-null\n * (the directive checks before invoking the strategy); `activeId` is\n * the current `ad.activeId()` snapshot captured at key-press time.\n *\n * @category common/interactive/tree\n */\nexport interface CngxHierarchicalNavContext<T> {\n readonly controller: CngxTreeController<T>;\n readonly ad: CngxActiveDescendant;\n readonly activeId: string;\n}\n\n/**\n * Pluggable keyboard policy for {@link CngxHierarchicalNav}. The\n * default implementation ({@link createW3CTreeStrategy}) matches the\n * W3C APG treeview pattern; consumers who need different semantics\n * (e.g. \"ArrowRight always expands but never moves to first child\",\n * \"ArrowLeft collapses but never jumps to parent\") can register their\n * own strategy via `CNGX_HIERARCHICAL_NAV_STRATEGY`.\n *\n * Strategy steps are synchronous, side-effect-allowed functions -\n * they may call `ctrl.expand()` / `ctrl.collapse()` / `ad.highlightByValue()`\n * before returning the corresponding action. The directive then emits\n * the informational output + prevents default key handling.\n *\n * @category common/interactive/tree\n */\nexport interface CngxHierarchicalNavStrategy {\n onArrowRight<T>(ctx: CngxHierarchicalNavContext<T>): CngxHierarchicalNavAction;\n onArrowLeft<T>(ctx: CngxHierarchicalNavContext<T>): CngxHierarchicalNavAction;\n}\n\n/** @internal */\nconst NOOP: CngxHierarchicalNavAction = { kind: 'noop' };\n\n/**\n * Default W3C APG treeview keyboard policy:\n *\n * - **ArrowRight** on a collapsed parent expands it. On an already-open\n * parent it moves the active-descendant to the first child. On a leaf\n * it is a no-op.\n * - **ArrowLeft** on an open node collapses it. On a closed node (or\n * leaf) with a parent it moves the active-descendant to the parent.\n * On a root leaf it is a no-op.\n *\n * Move actions internally verify that `ad.highlightByValue` actually\n * changed `activeId` (e.g. disabled skip rejection), and downgrade to\n * `'noop'` when it didn't - so consumers bound to `(movedToChild)` /\n * `(movedToParent)` only see state-change-truthful emissions.\n *\n * @category common/interactive/tree\n */\nexport function createW3CTreeStrategy(): CngxHierarchicalNavStrategy {\n const attemptMove = <T>(\n ctx: CngxHierarchicalNavContext<T>,\n targetValue: unknown,\n targetId: string,\n kind: 'movedToChild' | 'movedToParent',\n ): CngxHierarchicalNavAction => {\n const before = ctx.ad.activeId();\n ctx.ad.highlightByValue(targetValue);\n if (ctx.ad.activeId() === before) {\n return NOOP;\n }\n return { kind, id: targetId };\n };\n\n return {\n onArrowRight<T>(ctx: CngxHierarchicalNavContext<T>): CngxHierarchicalNavAction {\n const node = ctx.controller.findById(ctx.activeId);\n if (!node?.hasChildren) {\n return NOOP;\n }\n if (!ctx.controller.isExpanded(ctx.activeId)()) {\n ctx.controller.expand(ctx.activeId);\n return { kind: 'expand', id: ctx.activeId };\n }\n const firstChild = ctx.controller.firstChildOf(ctx.activeId);\n if (!firstChild) {\n return NOOP;\n }\n return attemptMove(ctx, firstChild.value, firstChild.id, 'movedToChild');\n },\n\n onArrowLeft<T>(ctx: CngxHierarchicalNavContext<T>): CngxHierarchicalNavAction {\n if (ctx.controller.isExpanded(ctx.activeId)()) {\n ctx.controller.collapse(ctx.activeId);\n return { kind: 'collapse', id: ctx.activeId };\n }\n const parent = ctx.controller.parentOf(ctx.activeId);\n if (!parent) {\n return NOOP;\n }\n return attemptMove(ctx, parent.value, parent.id, 'movedToParent');\n },\n };\n}\n\n/**\n * DI token carrying the {@link CngxHierarchicalNavStrategy} that\n * `CngxHierarchicalNav` consults on every ArrowLeft/Right press.\n * Defaults to {@link createW3CTreeStrategy}; override via\n * `providers`/`viewProviders` for alternative keyboard semantics.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * {\n * provide: CNGX_HIERARCHICAL_NAV_STRATEGY,\n * useFactory: () => ({\n * onArrowRight: (ctx) => {\n * // Expand only; never traverse to first child.\n * const node = ctx.controller.findById(ctx.activeId);\n * if (!node?.hasChildren) return { kind: 'noop' };\n * ctx.controller.expand(ctx.activeId);\n * return { kind: 'expand', id: ctx.activeId };\n * },\n * onArrowLeft: (ctx) => ({ kind: 'noop' }),\n * }),\n * },\n * ],\n * });\n * ```\n *\n * @category common/interactive/tree\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/hierarchical-nav/hierarchical-nav-strategy.ts\n * @since 0.1.0\n */\nexport const CNGX_HIERARCHICAL_NAV_STRATEGY = new InjectionToken<CngxHierarchicalNavStrategy>(\n 'CngxHierarchicalNavStrategy',\n {\n providedIn: 'root',\n factory: createW3CTreeStrategy,\n },\n);\n","import { Directive, inject, input, output } from '@angular/core';\nimport { CngxActiveDescendant } from '@cngx/common/a11y';\nimport { type CngxTreeController } from '../tree-controller/tree-controller';\nimport {\n CNGX_HIERARCHICAL_NAV_STRATEGY,\n type CngxHierarchicalNavAction,\n} from './hierarchical-nav-strategy';\n\n/**\n * W3C-tree keyboard extension. Wires `ArrowRight` / `ArrowLeft` to a\n * pluggable {@link CngxHierarchicalNavStrategy}; the default strategy\n * implements the\n * [APG treeview pattern](https://www.w3.org/WAI/ARIA/apg/patterns/treeview/):\n *\n * - **ArrowRight** on a collapsed parent expands it. On an already-open\n * parent it moves the active-descendant to the first child. On a leaf\n * it is a no-op.\n * - **ArrowLeft** on an open node collapses it. On a closed node (or\n * leaf) with a parent it moves the active-descendant to the parent.\n * On a root leaf it is a no-op.\n *\n * Swap the strategy via `CNGX_HIERARCHICAL_NAV_STRATEGY` to customise\n * the semantics (expand-only, never-traverse, exotic drag-drop flows)\n * without forking the directive.\n *\n * Attaches on the same element as `CngxActiveDescendant`; injects the AD\n * instance (`host: true`, optional) and leaves vertical `ArrowUp`/`Down`,\n * `Home`/`End`, and typeahead to AD's own handler. The two directives\n * coexist without conflict - in vertical orientation AD's `isNavKey`\n * branches for `ArrowLeft`/`ArrowRight` are already no-ops.\n *\n * Outputs are informational and state-change-truthful: `expand` /\n * `collapse` / `movedToChild` / `movedToParent` fire only when the\n * strategy reports the corresponding action. A disabled target the\n * strategy's `attemptMove` couldn't highlight never triggers a\n * `movedToChild` / `movedToParent` emission.\n *\n * ```html\n * <ul\n * role=\"tree\"\n * aria-multiselectable=\"true\"\n * cngxActiveDescendant\n * [items]=\"adItems()\"\n * [cngxHierarchicalNav]=\"treeController\"\n * tabindex=\"0\"\n * ></ul>\n * ```\n *\n * @category common/interactive/tree\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/hierarchical-nav/hierarchical-nav.directive.ts\n * @since 0.1.0\n * @relatedTo CngxActiveDescendant, CngxTreeController, CngxRovingTabindex\n */\n@Directive({\n selector: '[cngxHierarchicalNav]',\n exportAs: 'cngxHierarchicalNav',\n standalone: true,\n host: {\n '(keydown.arrowleft)': 'handleLeft($event)',\n '(keydown.arrowright)': 'handleRight($event)',\n },\n})\nexport class CngxHierarchicalNav<T = unknown> {\n /**\n * The tree controller that owns expansion state. Required - without it\n * the directive has nothing to reason about.\n */\n readonly controller = input.required<CngxTreeController<T>>({\n alias: 'cngxHierarchicalNav',\n });\n\n private readonly ad = inject(CngxActiveDescendant, {\n host: true,\n optional: true,\n });\n\n private readonly strategy = inject(CNGX_HIERARCHICAL_NAV_STRATEGY);\n\n /** Emitted with the id that was just expanded via ArrowRight. */\n readonly expand = output<string>();\n /** Emitted with the id that was just collapsed via ArrowLeft. */\n readonly collapse = output<string>();\n /** Emitted with the id of the parent the active-descendant moved to. */\n readonly movedToParent = output<string>();\n /** Emitted with the id of the child the active-descendant moved to. */\n readonly movedToChild = output<string>();\n\n handleRight(event: Event): void {\n this.dispatch(event, (ctx) => this.strategy.onArrowRight(ctx));\n }\n\n handleLeft(event: Event): void {\n this.dispatch(event, (ctx) => this.strategy.onArrowLeft(ctx));\n }\n\n /**\n * Shared guard + action-dispatch wrapper. Degrades silently when AD\n * isn't composed on the host or nothing is highlighted.\n */\n private dispatch(\n event: Event,\n step: (ctx: {\n readonly controller: CngxTreeController<T>;\n readonly ad: CngxActiveDescendant;\n readonly activeId: string;\n }) => CngxHierarchicalNavAction,\n ): void {\n const ad = this.ad;\n if (!ad) {\n return;\n }\n const activeId = ad.activeId();\n if (activeId === null) {\n return;\n }\n const action = step({ controller: this.controller(), ad, activeId });\n if (action.kind === 'noop') {\n return;\n }\n switch (action.kind) {\n case 'expand':\n this.expand.emit(action.id);\n break;\n case 'collapse':\n this.collapse.emit(action.id);\n break;\n case 'movedToChild':\n this.movedToChild.emit(action.id);\n break;\n case 'movedToParent':\n this.movedToParent.emit(action.id);\n break;\n }\n event.preventDefault();\n }\n}\n","import { computed, signal, type Signal } from '@angular/core';\nimport { buildAsyncStateView, type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\nimport { firstValueFrom, isObservable, timer } from 'rxjs';\n\nimport type { AsyncAction } from '../async-click/async-click.directive';\n\n/**\n * Configuration for `withRetry()`.\n *\n * @category common/interactive/retry\n */\nexport interface RetryConfig {\n /** Maximum number of attempts (including the first). Default: `3`. */\n maxAttempts?: number;\n /** Base delay in ms between retries. Default: `1000`. */\n delay?: number;\n /** Backoff strategy. `'exponential'` doubles the delay each attempt. Default: `'exponential'`. */\n backoff?: 'linear' | 'exponential';\n}\n\n/**\n * State exposed by the retryable action — read-only signals for UI feedback.\n *\n * @category common/interactive/retry\n */\nexport interface RetryState {\n /** Current attempt number (1-based). `0` before first invocation. */\n readonly attempt: Signal<number>;\n /** Total attempts allowed. */\n readonly maxAttempts: Signal<number>;\n /** Whether a retry is currently pending (waiting for delay). */\n readonly retrying: Signal<boolean>;\n /** Whether all attempts have been exhausted. */\n readonly exhausted: Signal<boolean>;\n /** The last error from a failed attempt. */\n readonly lastError: Signal<unknown>;\n /**\n * Full `CngxAsyncState` view of the retry lifecycle.\n *\n * Bind to any `[state]` consumer to connect the feedback system.\n * `retrying` (delay between retries) maps to `'pending'` — the feedback\n * system sees \"still working\" during retry delays.\n */\n readonly state: CngxAsyncState<unknown>;\n /** Manually reset — clears exhausted state, resets attempt counter. */\n reset(): void;\n}\n\n/**\n * Wraps an `AsyncAction` with automatic retry logic.\n *\n * Returns a tuple: `[action, retryState]` where `action` is a new `AsyncAction`\n * that retries on failure, and `retryState` exposes attempt/retry signals and\n * a `state: CngxAsyncState` for feedback system integration.\n *\n * Composes naturally with `CngxAsyncClick` and `CngxActionButton`:\n *\n * ```typescript\n * const [saveWithRetry, retryState] = withRetry(\n * () => this.http.post('/api/save', data),\n * { maxAttempts: 3, delay: 1000, backoff: 'exponential' }\n * );\n *\n * // Use with CngxAsyncClick + toast\n * <button [cngxAsyncClick]=\"saveWithRetry\">Save</button>\n * <ng-container [cngxToastOn]=\"retryState.state\"\n * toastSuccess=\"Saved\" toastError=\"All retries failed\" />\n * ```\n *\n * @category common/interactive/retry\n */\nexport function withRetry(action: AsyncAction, config?: RetryConfig): [AsyncAction, RetryState] {\n const maxAttempts = config?.maxAttempts ?? 3;\n const baseDelay = config?.delay ?? 1000;\n const backoff = config?.backoff ?? 'exponential';\n\n const attemptState = signal(0);\n const retryingState = signal(false);\n const exhaustedState = signal(false);\n const succeededState = signal(false);\n const lastErrorState = signal<unknown>(undefined);\n\n const statusComputed = computed<AsyncStatus>(() => {\n if (attemptState() === 0) {\n return 'idle';\n }\n if (exhaustedState()) {\n return 'error';\n }\n if (succeededState()) {\n return 'success';\n }\n return 'pending';\n });\n\n const asyncState = buildAsyncStateView<unknown>({\n status: statusComputed,\n data: computed(() => undefined),\n error: lastErrorState.asReadonly(),\n });\n\n const retryState: RetryState = {\n attempt: attemptState.asReadonly(),\n maxAttempts: computed(() => maxAttempts),\n retrying: retryingState.asReadonly(),\n exhausted: exhaustedState.asReadonly(),\n lastError: lastErrorState.asReadonly(),\n state: asyncState,\n reset() {\n attemptState.set(0);\n retryingState.set(false);\n exhaustedState.set(false);\n succeededState.set(false);\n lastErrorState.set(undefined);\n },\n };\n\n // Generation counter cancels any in-flight retry loop on re-invocation.\n let generation = 0;\n\n const retryableAction: AsyncAction = async () => {\n const thisGeneration = ++generation;\n attemptState.set(0);\n retryingState.set(false);\n exhaustedState.set(false);\n succeededState.set(false);\n\n for (let attempt = 1; attempt <= maxAttempts; attempt++) {\n if (generation !== thisGeneration) {\n return;\n }\n attemptState.set(attempt);\n\n try {\n const result$ = action();\n if (isObservable(result$)) {\n await firstValueFrom(result$, { defaultValue: undefined });\n } else {\n await result$;\n }\n if (generation !== thisGeneration) {\n return;\n }\n retryingState.set(false);\n succeededState.set(true);\n return;\n } catch (err: unknown) {\n if (generation !== thisGeneration) {\n return;\n }\n lastErrorState.set(err);\n\n if (attempt >= maxAttempts) {\n exhaustedState.set(true);\n retryingState.set(false);\n throw err;\n }\n\n retryingState.set(true);\n const delayMs =\n backoff === 'exponential' ? baseDelay * Math.pow(2, attempt - 1) : baseDelay * attempt;\n await firstValueFrom(timer(delayMs), { defaultValue: undefined });\n if (generation !== thisGeneration) {\n return;\n }\n retryingState.set(false);\n }\n }\n };\n\n return [retryableAction, retryState];\n}\n","import { computed, signal, type WritableSignal, type Signal } from '@angular/core';\nimport { buildAsyncStateView, type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\nimport { type Observable, type Subscription, take } from 'rxjs';\n\n/**\n * State exposed by the optimistic action.\n *\n * @category common/interactive/optimistic\n */\nexport interface OptimisticState {\n /** Whether a rollback occurred on the last invocation. */\n readonly rolledBack: Signal<boolean>;\n /** The error from the last failed action (`undefined` if successful). */\n readonly error: Signal<unknown>;\n /**\n * Full `CngxAsyncState` view of the optimistic lifecycle.\n *\n * Bind to any `[state]` consumer to connect the feedback system.\n * Status is `'pending'` while the confirming Observable is in flight,\n * `'success'` on confirmation, `'error'` on rollback.\n */\n readonly state: CngxAsyncState<unknown>;\n}\n\n/**\n * Creates an optimistic update function for a signal.\n *\n * Sets the new value immediately (optimistic), then confirms via the async action.\n * On success, applies the server-confirmed value. On failure, rolls back to the\n * previous value.\n *\n * This is a utility function, not a directive — it composes with any signal.\n *\n * ```typescript\n * readonly name = signal('Alice');\n * readonly [updateName, nameState] = optimistic(\n * this.name,\n * (value) => this.http.put('/api/name', { name: value })\n * );\n *\n * // In template:\n * <input [value]=\"name()\" (change)=\"updateName($event.target.value)\" />\n * <ng-container [cngxToastOn]=\"nameState.state\" toastError=\"Update failed\" />\n * @if (nameState.rolledBack()) { <span>Reverted</span> }\n * ```\n *\n * **Note:** The internal subscription is unmanaged — there is no `DestroyRef` available\n * in a plain factory function. If the component is destroyed mid-flight, the subscription\n * completes silently. For long-running actions, ensure the component outlives the action\n * or cancel via the Observable itself.\n *\n * @param current - The writable signal to update optimistically.\n * @param action - Async action that confirms the value. Should return the confirmed value.\n * @returns Tuple of `[applyFn, state]`.\n *\n * @category common/interactive/optimistic\n */\nexport function optimistic<T>(\n current: WritableSignal<T>,\n action: (value: T) => Observable<T>,\n): [(newValue: T) => void, OptimisticState] {\n const rolledBackState = signal(false);\n const errorState = signal<unknown>(undefined);\n const statusState = signal<AsyncStatus>('idle');\n\n const asyncState = buildAsyncStateView<unknown>({\n status: statusState.asReadonly(),\n data: computed(() => undefined),\n error: errorState.asReadonly(),\n });\n\n const state: OptimisticState = {\n rolledBack: rolledBackState.asReadonly(),\n error: errorState.asReadonly(),\n state: asyncState,\n };\n\n // Last confirmed value — rollback target under concurrent calls.\n let confirmedValue = current();\n let activeSub: Subscription | undefined;\n\n const apply = (newValue: T): void => {\n // Cancel in-flight subscription — prevents stale closure rollback\n activeSub?.unsubscribe();\n\n rolledBackState.set(false);\n errorState.set(undefined);\n statusState.set('pending');\n\n current.set(newValue);\n\n activeSub = action(newValue)\n .pipe(take(1))\n .subscribe({\n next: (confirmed) => {\n confirmedValue = confirmed;\n current.set(confirmed);\n statusState.set('success');\n activeSub = undefined;\n },\n error: (err: unknown) => {\n // Rollback to last confirmed value (not the stale optimistic one)\n current.set(confirmedValue);\n rolledBackState.set(true);\n errorState.set(err);\n statusState.set('error');\n activeSub = undefined;\n },\n });\n };\n\n return [apply, state];\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, input, output, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent, filter, switchMap, takeUntil, timer, tap, merge } from 'rxjs';\n\n/**\n * Detects long-press gestures via Pointer Events.\n *\n * @category common/interactive/gestures\n *\n * Fires `longPressed` after the pointer is held down for the `threshold` duration\n * without moving more than 10px. Cancels on pointer move (prevents accidental\n * triggers during scrolling), pointer up, pointer cancel, and pointer leave.\n *\n * Exposes `longPressing` signal for real-time visual feedback while the user holds.\n *\n * ### Context menu on long press\n * ```html\n * <div cngxLongPress (longPressed)=\"showContextMenu($event)\">\n * Long press me\n * </div>\n * ```\n *\n * ### With visual feedback\n * ```html\n * <div cngxLongPress #lp=\"cngxLongPress\"\n * [class.holding]=\"lp.longPressing()\">\n * Hold for action\n * </div>\n * ```\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/gestures/long-press.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSwipeDismiss, CngxPressable\n * <example-url>http://localhost:4200/#/common/interactive/gestures/long-press/custom-threshold</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/gestures/long-press/long-press-with-visual-feedback</example-url>\n */\n@Directive({\n selector: '[cngxLongPress]',\n exportAs: 'cngxLongPress',\n standalone: true,\n})\nexport class CngxLongPress {\n /** Time in ms the pointer must be held to trigger. */\n readonly threshold = input<number>(500);\n /** Whether the directive is active. */\n readonly enabled = input<boolean>(true);\n /** Maximum pointer movement in px before the gesture is cancelled. */\n readonly moveThreshold = input<number>(10);\n\n /** Emitted when a long-press gesture completes. */\n readonly longPressed = output<PointerEvent>();\n\n private readonly longPressingState = signal(false);\n /** Whether a long-press gesture is currently building (pointer held, timer running). */\n readonly longPressing = this.longPressingState.asReadonly();\n\n constructor() {\n const el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n const doc = inject(DOCUMENT);\n\n // up/move on document so the gesture survives drifting outside the host.\n const pointerDown$ = fromEvent<PointerEvent>(el, 'pointerdown');\n const pointerUp$ = fromEvent<PointerEvent>(doc, 'pointerup');\n const pointerMove$ = fromEvent<PointerEvent>(doc, 'pointermove');\n const pointerCancel$ = fromEvent<PointerEvent>(el, 'pointercancel');\n const pointerLeave$ = fromEvent<PointerEvent>(el, 'pointerleave');\n\n pointerDown$\n .pipe(\n filter(() => this.enabled()),\n switchMap((start) => {\n const startX = start.clientX;\n const startY = start.clientY;\n this.longPressingState.set(true);\n\n const cancel$ = merge(\n pointerUp$,\n pointerCancel$,\n pointerLeave$,\n pointerMove$.pipe(\n filter((move) => {\n const dx = move.clientX - startX;\n const dy = move.clientY - startY;\n return Math.hypot(dx, dy) > this.moveThreshold();\n }),\n ),\n ).pipe(tap(() => this.longPressingState.set(false)));\n\n return timer(this.threshold()).pipe(\n tap(() => {\n this.longPressingState.set(false);\n this.longPressed.emit(start);\n }),\n takeUntil(cancel$),\n );\n }),\n takeUntilDestroyed(),\n )\n .subscribe();\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { computed, Directive, ElementRef, inject, input, output, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent, merge, switchMap, takeUntil, tap, filter, map } from 'rxjs';\n\nimport type { SwipeAxis, SwipeDirection } from './swipe-direction';\n\ninterface SwipeReading {\n readonly direction: SwipeDirection;\n readonly distance: number;\n}\n\n/**\n * Detects directional swipe gestures via Pointer Events and reports the\n * resolved direction.\n *\n * @category common/interactive/gestures\n *\n * Generic navigation atom: unlike {@link CngxSwipeDismiss} (one fixed\n * direction, dismiss intent), this emits `swiped` with the dominant\n * direction so a single host can drive bidirectional flows - carousels,\n * paged views, prev/next steppers. The `axis` input pins the gesture to\n * horizontal or vertical so an orthogonal scroll never fires it.\n * Exposes `swiping`, `swipeProgress`, and `swipeDirection` signals for\n * real-time feedback mid-gesture.\n *\n * ### Carousel: route left/right into a presenter\n * ```html\n * <section cngxSwipe axis=\"x\" (swiped)=\"onSwipe($event)\">…</section>\n * ```\n * ```ts\n * onSwipe(direction: SwipeDirection): void {\n * if (direction === 'left') {\n * this.next();\n * } else if (direction === 'right') {\n * this.previous();\n * }\n * }\n * ```\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/gestures/swipe.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSwipeDismiss, CngxLongPress\n * <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/mobile-carousel</example-url>\n */\n@Directive({\n selector: '[cngxSwipe]',\n exportAs: 'cngxSwipe',\n standalone: true,\n host: {\n // Communicate the gesture's axis intent to the browser so it\n // never claims the swipe as a scroll. Derived from `axis`, not\n // hand-set in consumer CSS: every host of this directive gets the\n // correct touch-action for free instead of re-discovering the bug.\n '[style.touch-action]': 'touchAction()',\n // Scope user-select suppression to the in-flight gesture. A\n // bare `user-select: none` on the host kills text selection\n // permanently inside the swipe surface even when the user is\n // just reading; gating on `swiping()` keeps the gesture-vs-\n // selection arbitration tight to the drag.\n '[style.user-select]': \"swiping() ? 'none' : null\",\n '[style.-webkit-user-select]': \"swiping() ? 'none' : null\",\n },\n})\nexport class CngxSwipe {\n /** Minimum distance in px on the dominant axis to register a swipe. */\n readonly threshold = input<number>(50);\n /** Axis the gesture is allowed to register on. */\n readonly axis = input<SwipeAxis>('both');\n /** Whether the directive is active. */\n readonly enabled = input<boolean>(true);\n /** Emitted with the dominant direction when a swipe passes the threshold. */\n readonly swiped = output<SwipeDirection>();\n\n private readonly swipingState = signal(false);\n private readonly swipeProgressState = signal(0);\n private readonly swipeDirectionState = signal<SwipeDirection | null>(null);\n\n /** Whether a swipe gesture is currently in progress. */\n readonly swiping = this.swipingState.asReadonly();\n /** Progress of the current swipe from 0 to 1 (clamped). */\n readonly swipeProgress = this.swipeProgressState.asReadonly();\n /** Dominant direction of the in-flight gesture, or `null` when idle. */\n readonly swipeDirection = this.swipeDirectionState.asReadonly();\n\n /**\n * The `touch-action` the host should advertise, derived from `axis`.\n * A pinned axis hands the orthogonal direction back to native\n * scrolling (`x` -> `pan-y`, `y` -> `pan-x`); `both` claims the\n * whole surface (`none`). When disabled, no value is written so the\n * element keeps its native scroll behaviour untouched.\n */\n protected readonly touchAction = computed<string | null>(() => {\n if (!this.enabled()) {\n return null;\n }\n switch (this.axis()) {\n case 'x':\n return 'pan-y';\n case 'y':\n return 'pan-x';\n default:\n return 'none';\n }\n });\n\n constructor() {\n const nativeEl = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n const doc = inject(DOCUMENT);\n\n const pointerDown$ = fromEvent<PointerEvent>(nativeEl, 'pointerdown');\n const pointerMove$ = fromEvent<PointerEvent>(doc, 'pointermove');\n const pointerUp$ = fromEvent<PointerEvent>(doc, 'pointerup');\n // pointercancel fires when the browser takes the pointer back\n // (system gesture, popup, JS-triggered focus loss). Without an\n // explicit arm the in-flight state would stay stuck at\n // `swiping = true` because pointerup never arrives.\n const pointerCancel$ = fromEvent<PointerEvent>(doc, 'pointercancel');\n\n const resetState = (pointerId: number | undefined): void => {\n if (pointerId !== undefined) {\n try {\n nativeEl.releasePointerCapture(pointerId);\n } catch {\n // releasePointerCapture throws when the pointer is no\n // longer captured (e.g. the browser already released it\n // before firing pointercancel) - safe to ignore.\n }\n }\n this.swipingState.set(false);\n this.swipeProgressState.set(0);\n this.swipeDirectionState.set(null);\n };\n\n pointerDown$\n .pipe(\n filter(() => this.enabled()),\n switchMap((start) => {\n const startX = start.clientX;\n const startY = start.clientY;\n const pointerId = start.pointerId;\n // Capture the pointer on the swipe host so subsequent\n // move / up events route here even when the cursor leaves\n // the original element (real mouse drags drift off the\n // panel into the strip / page chrome and would otherwise\n // skip the directive).\n try {\n nativeEl.setPointerCapture(pointerId);\n } catch {\n // setPointerCapture throws if pointerId is invalid (e.g.\n // synthetic event in some test envs) - safe to ignore.\n }\n\n const settle$ = merge(\n pointerUp$.pipe(\n map((end) => ({\n reading: this.read(startX, startY, end.clientX, end.clientY),\n })),\n ),\n pointerCancel$.pipe(map(() => ({ reading: null }))),\n );\n\n return pointerMove$.pipe(\n tap((move) => {\n const reading = this.read(startX, startY, move.clientX, move.clientY);\n if (reading) {\n this.swipingState.set(true);\n this.swipeDirectionState.set(reading.direction);\n this.swipeProgressState.set(Math.min(1, reading.distance / this.threshold()));\n }\n }),\n takeUntil(\n settle$.pipe(\n tap(({ reading }) => {\n if (reading && reading.distance >= this.threshold()) {\n this.swiped.emit(reading.direction);\n }\n resetState(pointerId);\n }),\n ),\n ),\n );\n }),\n takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n /**\n * Resolve the swipe direction + distance for a pointer delta.\n *\n * When `axis` is pinned, only that axis's delta decides direction\n * and distance - the orthogonal component is irrelevant, not an\n * abort reason. The previous endpoint-dominance check (`|dx| >= |dy|`)\n * discarded a clearly horizontal drag the moment a natural thumb arc\n * left `|dy|` slightly larger at release, which made a pinned swipe\n * register only on a near-perfect straight line. `touch-action`\n * (advertised from the same `axis`) is the real guard against an\n * orthogonal scroll firing the gesture: the browser cancels the\n * pointer before pointerup, so a clean cycle reaching here is already\n * the intended direction. `both` keeps the dominant-axis heuristic.\n */\n private read(startX: number, startY: number, endX: number, endY: number): SwipeReading | null {\n const dx = endX - startX;\n const dy = endY - startY;\n const axis = this.axis();\n\n if (axis === 'x') {\n return { direction: dx < 0 ? 'left' : 'right', distance: Math.abs(dx) };\n }\n if (axis === 'y') {\n return { direction: dy < 0 ? 'up' : 'down', distance: Math.abs(dy) };\n }\n\n const horizontal = Math.abs(dx) >= Math.abs(dy);\n return horizontal\n ? { direction: dx < 0 ? 'left' : 'right', distance: Math.abs(dx) }\n : { direction: dy < 0 ? 'up' : 'down', distance: Math.abs(dy) };\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, input, output, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent, switchMap, takeUntil, tap, filter, map } from 'rxjs';\n\nimport type { SwipeDirection } from './swipe-direction';\n\n/**\n * Detects directional swipe gestures via Pointer Events.\n *\n * @category common/interactive/gestures\n *\n * Generic atom usable for drawers (swipe-to-close), bottom sheets,\n * carousels, and dismissible cards. Emits `swiped` when the gesture\n * completes past the threshold. Exposes `swiping` and `swipeProgress`\n * signals for real-time visual feedback during the gesture.\n *\n * ### Close drawer on swipe-left\n * ```html\n * <nav [cngxDrawerPanel]=\"drawer\"\n * cngxSwipeDismiss=\"left\" (swiped)=\"drawer.close()\">\n * …\n * </nav>\n * ```\n *\n * ### Bottom sheet with progress\n * ```html\n * <div cngxSwipeDismiss=\"down\" #swipe=\"cngxSwipeDismiss\"\n * [style.transform]=\"'translateY(' + (swipe.swipeProgress() * 100) + '%)'\">\n * …\n * </div>\n * ```\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/gestures/swipe-dismiss.directive.ts\n * @since 0.1.0\n * @relatedTo CngxLongPress, CngxDrawer\n * <example-url>http://localhost:4200/#/common/interactive/gestures/swipe-dismiss/directional-swipe</example-url>\n */\n@Directive({\n selector: '[cngxSwipeDismiss]',\n exportAs: 'cngxSwipeDismiss',\n standalone: true,\n})\nexport class CngxSwipeDismiss {\n /** Direction of the swipe that triggers dismissal. */\n readonly direction = input.required<SwipeDirection>({ alias: 'cngxSwipeDismiss' });\n /** Minimum distance in px to register as a completed swipe. */\n readonly threshold = input<number>(50);\n /** Whether the directive is active. */\n readonly enabled = input<boolean>(true);\n /** Emitted when a swipe gesture completes past the threshold. */\n readonly swiped = output<void>();\n\n private readonly swipingState = signal(false);\n private readonly swipeProgressState = signal(0);\n\n /** Whether a swipe gesture is currently in progress. */\n readonly swiping = this.swipingState.asReadonly();\n /** Progress of the current swipe from 0 to 1 (clamped). */\n readonly swipeProgress = this.swipeProgressState.asReadonly();\n\n constructor() {\n const nativeEl = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n const doc = inject(DOCUMENT);\n\n const pointerDown$ = fromEvent<PointerEvent>(nativeEl, 'pointerdown');\n const pointerMove$ = fromEvent<PointerEvent>(doc, 'pointermove');\n const pointerUp$ = fromEvent<PointerEvent>(doc, 'pointerup');\n\n pointerDown$\n .pipe(\n filter(() => this.enabled()),\n switchMap((start) => {\n const startX = start.clientX;\n const startY = start.clientY;\n\n return pointerMove$.pipe(\n tap((move) => {\n const delta = this.getDelta(startX, startY, move.clientX, move.clientY);\n if (delta > 0) {\n this.swipingState.set(true);\n this.swipeProgressState.set(Math.min(1, delta / this.threshold()));\n }\n }),\n takeUntil(\n pointerUp$.pipe(\n map((end) => this.getDelta(startX, startY, end.clientX, end.clientY)),\n tap((delta) => {\n if (delta >= this.threshold()) {\n this.swiped.emit();\n }\n this.swipingState.set(false);\n this.swipeProgressState.set(0);\n }),\n ),\n ),\n );\n }),\n takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n private getDelta(startX: number, startY: number, endX: number, endY: number): number {\n const dir = this.direction();\n switch (dir) {\n case 'left':\n return startX - endX;\n case 'right':\n return endX - startX;\n case 'up':\n return startY - endY;\n case 'down':\n return endY - startY;\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n afterNextRender,\n computed,\n inject,\n input,\n isDevMode,\n output,\n signal,\n type Signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { filter, fromEvent, map, merge, switchMap, takeUntil, tap } from 'rxjs';\n\n/**\n * Modifier key that arms the keyboard-reorder handler. Plain arrow keys\n * keep their default meaning (focus navigation) - only the configured\n * modifier + arrow produces a move.\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/reorder.directive.ts\n * @since 0.1.0\n */\nexport type CngxReorderModifier = 'ctrl' | 'alt' | 'meta';\n\n/**\n * Payload emitted by `(reordered)` whenever a pointer drag or a modifier +\n * arrow keyboard move settles on a new position.\n *\n * `next` is a fresh array - the source signal is never mutated in place,\n * so downstream `computed()` graphs see a new reference and re-evaluate.\n * Consumers own the write back to the source signal (directly, or via a\n * commit controller for optimistic / pessimistic policies).\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/reorder.directive.ts\n * @since 0.1.0\n */\nexport interface CngxReorderEvent<T> {\n readonly fromIndex: number;\n readonly toIndex: number;\n readonly next: readonly T[];\n}\n\n/** @internal */\ninterface ActiveDrag {\n readonly pointerId: number;\n readonly fromIndex: number;\n readonly currentIndex: number;\n}\n\n/**\n * Level-2 atom that turns any flat container into a reorderable list.\n *\n * **Pointer flow.** A `pointerdown` on a drag-handle (any element matching\n * `handleSelector`) inside an item (any element matching `itemSelector`)\n * starts a drag. Pointer capture stays on the host so the gesture keeps\n * tracking when the user drifts outside the container. The drop target is\n * resolved from `document.elementFromPoint` on every `pointermove`. The\n * drag ends on `pointerup`, `pointercancel`, or a top-level `Escape`\n * press - only the first two emit `reordered`; Escape cancels the drag\n * without a mutation.\n *\n * **Keyboard flow.** When the focused element is inside an item and the\n * configured modifier + `ArrowLeft` / `ArrowRight` / `Home` / `End` is\n * pressed, the directive emits `reordered` with the new array and lets\n * the consumer re-focus the moved item (usually via `afterNextRender`).\n *\n * **Forms / commit action agnostic.** The directive never writes to the\n * source signal; it only emits events. Composers (e.g.\n * `CngxReorderableMultiSelect`) route the emission through their commit\n * controller so optimistic / pessimistic behaviour stays owned by the\n * composing component, not by this atom.\n *\n * ### Basic chip-strip reorder\n * ```html\n * <span class=\"chip-strip\" [cngxReorder]=\"values\" (reordered)=\"apply($event)\">\n * @for (v of values(); track v; let i = $index) {\n * <span class=\"chip\" [attr.data-reorder-index]=\"i\">\n * <button cngxReorderHandle aria-label=\"Verschieben\">⋮⋮</button>\n * {{ v.label }}\n * </span>\n * }\n * </span>\n * ```\n *\n * @category common/interactive/reorder\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/reorder.directive.ts\n * @since 0.1.0\n * @relatedTo CngxReorderableMultiSelect, CngxChipStripRovingController\n * <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/basic-drag-chips-via-mouse-touch</example-url>\n * <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/commit-action-optimistic-pessimistic-with-supersede</example-url>\n * <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/keyboard-reorder-alt-arrow-home-end</example-url>\n * <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/optional-drag-handle-glyph</example-url>\n * <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/pre-seeded-values-reorder-log</example-url>\n */\n@Directive({\n selector: '[cngxReorder]',\n exportAs: 'cngxReorder',\n standalone: true,\n host: {\n '[class.cngx-reorder-container]': 'true',\n '[class.cngx-reorder-dragging]': 'dragging()',\n },\n})\nexport class CngxReorder<T = unknown> {\n /**\n * Signal describing the current, authoritative order. The directive\n * reads it lazily at drag-start and at keyboard-move time so drag\n * sessions always resolve against the freshest value - consumers that\n * mutate the source signal during a drag (rare) still get consistent\n * results.\n */\n readonly items = input.required<Signal<readonly T[]>>({ alias: 'cngxReorder' });\n\n /**\n * CSS selector matched against `pointerdown` targets (via\n * `Element.closest`) to decide whether the gesture starts. Defaults\n * cover both the convention-based attribute hook\n * `[data-reorder-handle]` and the explicit semantic selector\n * `[cngxReorderHandle]` so consumers can pick whichever reads better\n * in their template.\n */\n readonly handleSelector = input<string>('[cngxReorderHandle], [data-reorder-handle]');\n\n /**\n * CSS selector matched against every reorderable child (via\n * `Element.closest`). The matched element's `data-reorder-index`\n * attribute is parsed as the `fromIndex` / `toIndex` used in the\n * emission.\n */\n readonly itemSelector = input<string>('[data-reorder-index]');\n\n /**\n * Optional escape-hatch selector for drag targets. When set and the\n * `pointerdown` target matches `ignoreSelector` (via `closest`), the\n * gesture is dropped - useful when the whole item is draggable but\n * interactive children (close buttons, inline edit fields, menu\n * triggers) must keep their own click semantics. Applied after\n * `handleSelector`, so the two can overlap: e.g.\n * `handleSelector = '[data-reorder-index]'` +\n * `ignoreSelector = 'button, a, [contenteditable]'` yields\n * whole-row drag with interactive child exemptions.\n *\n * `null` (default) disables the filter - the `handleSelector` alone\n * decides whether a drag starts.\n */\n readonly ignoreSelector = input<string | null>(null);\n\n /** Modifier key required for keyboard-driven reorder. Defaults to `'alt'`. */\n readonly keyboardModifier = input<CngxReorderModifier>('alt');\n\n /** Disables both pointer and keyboard flows. */\n readonly disabled = input<boolean>(false);\n\n /** Emitted once a drag or keyboard move settles on a new position. */\n readonly reordered = output<CngxReorderEvent<T>>();\n\n /** Informational - index of the item picked up by pointer drag. */\n readonly dragStart = output<number>();\n\n /** Informational - fires after `reordered` (or alone, if Escape cancelled). */\n readonly dragEnd = output<void>();\n\n private readonly activeDrag = signal<ActiveDrag | null>(null);\n\n /** `true` while a pointer drag is in progress. */\n readonly dragging = computed(() => this.activeDrag() !== null);\n\n /**\n * Index of the item currently being dragged, or `null` when no drag\n * is active. Useful for applying a `.chip--dragging` class via\n * `@for` index comparison.\n */\n readonly dragFromIndex = computed(() => this.activeDrag()?.fromIndex ?? null);\n\n /**\n * Index of the item the pointer is currently hovering over during a\n * drag, or `null` when no drag is active. Drives ghost-placeholder\n * positioning in the host template.\n */\n readonly dragOverIndex = computed(() => this.activeDrag()?.currentIndex ?? null);\n\n private readonly hostEl = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.wirePointer();\n this.wireKeyboard();\n this.wireDevModeCheck();\n }\n\n private wirePointer(): void {\n const down$ = fromEvent<PointerEvent>(this.hostEl, 'pointerdown');\n const move$ = fromEvent<PointerEvent>(this.doc, 'pointermove');\n const up$ = fromEvent<PointerEvent>(this.doc, 'pointerup');\n const cancel$ = fromEvent<PointerEvent>(this.doc, 'pointercancel');\n const escape$ = fromEvent<KeyboardEvent>(this.doc, 'keydown').pipe(\n filter((e) => e.key === 'Escape'),\n );\n\n interface PointerStart {\n readonly event: PointerEvent;\n readonly fromIndex: number;\n }\n\n down$\n .pipe(\n filter(() => !this.disabled()),\n filter(() => this.activeDrag() === null),\n filter((e) => e.button === 0),\n map((event): PointerStart | null => {\n const target = event.target as Element | null;\n // Escape hatch: interactive children of the item (close\n // buttons, menu triggers, inline edit fields) keep their own\n // click semantics even when the whole row is drag-enabled.\n const ignore = this.ignoreSelector();\n if (ignore && target?.closest(ignore)) {\n return null;\n }\n const handleEl = target?.closest(this.handleSelector()) ?? null;\n if (!handleEl) {\n return null;\n }\n const itemEl = target?.closest<HTMLElement>(this.itemSelector()) ?? null;\n if (!itemEl || !this.hostEl.contains(itemEl)) {\n return null;\n }\n const fromIndex = this.parseIndex(itemEl);\n if (fromIndex < 0) {\n return null;\n }\n return { event, fromIndex };\n }),\n filter((start): start is PointerStart => start !== null),\n switchMap(({ event, fromIndex }) => {\n event.preventDefault();\n try {\n this.hostEl.setPointerCapture?.(event.pointerId);\n } catch {\n /* jsdom / older browsers */\n }\n this.activeDrag.set({\n pointerId: event.pointerId,\n fromIndex,\n currentIndex: fromIndex,\n });\n this.dragStart.emit(fromIndex);\n\n return move$.pipe(\n filter((m) => m.pointerId === event.pointerId),\n tap((m) => {\n const overEl = this.doc.elementFromPoint?.(m.clientX, m.clientY);\n if (!overEl) {\n return;\n }\n const itemEl = overEl.closest<HTMLElement>(this.itemSelector());\n if (!itemEl || !this.hostEl.contains(itemEl)) {\n return;\n }\n const overIndex = this.parseIndex(itemEl);\n if (overIndex < 0) {\n return;\n }\n const active = this.activeDrag();\n if (active && overIndex !== active.currentIndex) {\n this.activeDrag.set({ ...active, currentIndex: overIndex });\n }\n }),\n takeUntil(\n merge(\n up$.pipe(\n filter((u) => u.pointerId === event.pointerId),\n map(() => 'commit' as const),\n ),\n cancel$.pipe(\n filter((c) => c.pointerId === event.pointerId),\n map(() => 'cancel' as const),\n ),\n escape$.pipe(map(() => 'cancel' as const)),\n ).pipe(\n tap((outcome) => {\n try {\n this.hostEl.releasePointerCapture?.(event.pointerId);\n } catch {\n /* capture may have auto-released */\n }\n const active = this.activeDrag();\n this.activeDrag.set(null);\n this.dragEnd.emit();\n if (outcome === 'commit' && active) {\n const { fromIndex: from, currentIndex: to } = active;\n if (to !== from) {\n this.emitMove(from, to);\n }\n }\n // Swallow the `click` the browser synthesises from\n // the mousedown → mouseup pair that framed this\n // gesture. Without this, dragging a chip inside an\n // outer listener (e.g. a combobox trigger's\n // (click)=\"open()\") would toggle the popover\n // alongside the reorder, because the click's target\n // is the common ancestor of mousedown/mouseup - not\n // a descendant that any child-side `stopPropagation`\n // could filter. One-shot, capture-phase, document-\n // wide, removed after the first event.\n this.installClickSuppressor();\n }),\n ),\n ),\n );\n }),\n takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n private wireKeyboard(): void {\n fromEvent<KeyboardEvent>(this.hostEl, 'keydown')\n .pipe(\n filter(() => !this.disabled()),\n filter((e) => this.modifierMatches(e)),\n filter((e) => this.isReorderKey(e.key)),\n tap((e) => {\n const target = e.target as Element | null;\n const itemEl = target?.closest<HTMLElement>(this.itemSelector());\n if (!itemEl || !this.hostEl.contains(itemEl)) {\n return;\n }\n const fromIndex = this.parseIndex(itemEl);\n if (fromIndex < 0) {\n return;\n }\n const current = this.items()();\n const len = current.length;\n if (fromIndex >= len) {\n return;\n }\n let toIndex: number;\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n toIndex = fromIndex - 1;\n break;\n case 'ArrowRight':\n case 'ArrowDown':\n toIndex = fromIndex + 1;\n break;\n case 'Home':\n toIndex = 0;\n break;\n case 'End':\n toIndex = len - 1;\n break;\n default:\n return;\n }\n if (toIndex < 0 || toIndex >= len || toIndex === fromIndex) {\n return;\n }\n e.preventDefault();\n this.emitMove(fromIndex, toIndex, current);\n }),\n takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n private wireDevModeCheck(): void {\n if (!isDevMode()) {\n return;\n }\n afterNextRender(() => {\n const items = this.hostEl.querySelectorAll(this.itemSelector());\n if (items.length === 0) {\n // Not an error - an empty strip is a legitimate idle state.\n // Only warn when the consumer probably forgot to wire the attr.\n return;\n }\n let misconfigured = 0;\n items.forEach((el: Element) => {\n const idx = (el as HTMLElement).dataset['reorderIndex'];\n if (idx == null || !Number.isFinite(Number(idx))) {\n misconfigured += 1;\n }\n });\n if (misconfigured > 0) {\n console.warn(\n `[CngxReorder] ${misconfigured} element(s) match itemSelector ` +\n `\"${this.itemSelector()}\" but carry no numeric data-reorder-index. ` +\n 'Pointer / keyboard moves targeting them will be ignored.',\n );\n }\n });\n }\n\n private parseIndex(el: HTMLElement): number {\n const raw = el.dataset['reorderIndex'];\n if (raw == null) {\n return -1;\n }\n const n = Number.parseInt(raw, 10);\n if (!Number.isFinite(n) || n < 0) {\n return -1;\n }\n return n;\n }\n\n private modifierMatches(event: KeyboardEvent): boolean {\n switch (this.keyboardModifier()) {\n case 'ctrl':\n return event.ctrlKey;\n case 'alt':\n return event.altKey;\n case 'meta':\n return event.metaKey;\n }\n }\n\n private isReorderKey(key: string): boolean {\n return (\n key === 'ArrowLeft' ||\n key === 'ArrowRight' ||\n key === 'ArrowUp' ||\n key === 'ArrowDown' ||\n key === 'Home' ||\n key === 'End'\n );\n }\n\n private emitMove(from: number, to: number, source?: readonly T[]): void {\n const current = source ?? this.items()();\n if (from < 0 || from >= current.length) {\n return;\n }\n const clampedTo = Math.min(Math.max(to, 0), current.length - 1);\n if (clampedTo === from) {\n return;\n }\n const next = this.moveItem(current, from, clampedTo);\n this.reordered.emit({ fromIndex: from, toIndex: clampedTo, next });\n }\n\n private moveItem(arr: readonly T[], from: number, to: number): readonly T[] {\n const copy = arr.slice();\n const [item] = copy.splice(from, 1);\n copy.splice(to, 0, item);\n return copy;\n }\n\n /**\n * Install a one-shot capture-phase listener that cancels the next\n * synthetic `click` (the one browsers derive from the mousedown →\n * mouseup pair that framed the drag gesture). The listener removes\n * itself after the first event, after a short watchdog timeout if\n * no click ever fires (browsers skip the click when mouse travel\n * exceeds the platform drag threshold), and on directive destroy\n * so test fixtures never leak a document-level handler across\n * iterations.\n */\n private installClickSuppressor(): void {\n let cleaned = false;\n const handler = (event: Event): void => {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n cleanup();\n };\n const cleanup = (): void => {\n if (cleaned) {\n return;\n }\n cleaned = true;\n this.doc.removeEventListener('click', handler, true);\n clearTimeout(watchdog);\n };\n this.doc.addEventListener('click', handler, true);\n // Browsers dispatch the click synchronously after pointerup;\n // 50ms covers queuing quirks without lingering past the user's\n // next real click.\n const watchdog = setTimeout(cleanup, 50);\n this.destroyRef.onDestroy(cleanup);\n }\n}\n","import { effect, InjectionToken, signal, untracked, type Signal } from '@angular/core';\n\n/**\n * Configuration for {@link createChipStripRoving}.\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts\n * @since 0.1.0\n */\nexport interface CngxChipStripRovingOptions {\n /**\n * Reactive length of the chip list. When this count shrinks below\n * `activeIndex`, the controller clamps the active index so focus\n * never dangles at a removed position.\n */\n readonly count: Signal<number>;\n /**\n * Element hosting the chip wrappers. Read lazily at `focusAt()` time\n * so the controller doesn't depend on view-init timing. `null` is a\n * legitimate idle state - the controller becomes a no-op focuser.\n */\n readonly container: Signal<HTMLElement | null | undefined>;\n /**\n * Attribute name used to identify each chip wrapper. Combined with\n * the active index into a `[attr=\"index\"]` query. Defaults to\n * `'data-reorder-index'` (matches {@link CngxReorder}'s own item\n * contract, so a single DOM hook covers both the reorder directive\n * and this roving controller).\n */\n readonly indexAttr?: string;\n}\n\n/**\n * Controller produced by {@link createChipStripRoving}. Exposes an\n * `activeIndex` signal the consumer binds into\n * `[attr.tabindex]=\"i === roving.activeIndex() ? 0 : -1\"`, plus a\n * keyboard handler and imperative focus helpers.\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts\n * @since 0.1.0\n */\nexport interface CngxChipStripRovingController {\n /**\n * Current roving position. Clamped to `[0, count - 1]`; resets to\n * `0` when `count` drops to `0`.\n */\n readonly activeIndex: Signal<number>;\n /**\n * Announce that a chip at `index` received focus - typically wired\n * on the chip wrapper's `(focus)`. Idempotent; keeps the active\n * index in sync with whatever the user's focus sequence did (mouse\n * click, Tab into the strip, etc.).\n */\n markFocused(index: number): void;\n /**\n * Keyboard handler for the chip-strip container. Handles plain\n * `ArrowLeft` / `ArrowRight` / `ArrowUp` / `ArrowDown` / `Home` /\n * `End` - moves `activeIndex` and focuses the chip at the new\n * position. Events carrying any of `Ctrl` / `Alt` / `Meta` are\n * ignored (modifier-gated keys belong to the paired\n * {@link CngxReorder} directive).\n */\n handleKeydown(event: KeyboardEvent): void;\n /**\n * Imperatively set the active index and focus the corresponding\n * chip. Used by consumers to restore focus after a reorder settles\n * on a new position.\n */\n focusAt(index: number): void;\n /**\n * Imperatively set the active index without moving focus. Useful\n * during a reorder's transient pre-render phase where the DOM has\n * not yet re-ordered the chips.\n */\n setActive(index: number): void;\n}\n\n/**\n * Signature of the factory behind {@link CNGX_CHIP_STRIP_ROVING_FACTORY}.\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts\n * @since 0.1.0\n */\nexport type CngxChipStripRovingFactory = (\n opts: CngxChipStripRovingOptions,\n) => CngxChipStripRovingController;\n\n/**\n * Plain factory for the chip-strip roving-tabindex controller shared by\n * {@link CngxReorderableMultiSelect} today and by any future\n * reorder-aware chip trigger (e.g. a tag-input with user-defined\n * ordering). Extracted from the component so the same focus-state\n * machine doesn't reappear inline in every variant.\n *\n * **Why not `CngxRovingTabindex`.** That directive uses a host\n * `(keydown)` listener that doesn't check modifier keys. Co-located\n * with {@link CngxReorder} on the same chip-strip element it\n * double-fires on `Ctrl+Arrow` (the reorder emits, then roving also\n * moves focus - racy). This controller deliberately skips\n * modifier-pressed events so the paired reorder directive owns that\n * gesture.\n *\n * **Injection context.** Must be called in an injection context\n * (component constructor / field init) because it installs an * `effect()` for the active-index clamp on count shrink.\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts\n * @since 0.1.0\n */\nexport function createChipStripRoving(\n opts: CngxChipStripRovingOptions,\n): CngxChipStripRovingController {\n const attr = opts.indexAttr ?? 'data-reorder-index';\n const activeIndexState = signal<number>(0);\n\n // Clamp on count shrink - a removed-last-chip or clear-all must not\n // leave `activeIndex` pointing past the end. Reading the signal\n // inside `untracked()` avoids a self-dependency, so the effect's\n // only reactive dep is `count()`.\n effect(() => {\n const len = opts.count();\n untracked(() => {\n const current = activeIndexState();\n if (len === 0) {\n if (current !== 0) {\n activeIndexState.set(0);\n }\n } else if (current >= len) {\n activeIndexState.set(len - 1);\n }\n });\n });\n\n function focusAt(index: number): void {\n setActive(index);\n const root = opts.container();\n if (!root) {\n return;\n }\n const el = root.querySelector<HTMLElement>(`[${attr}=\"${index}\"]`);\n el?.focus();\n }\n\n function setActive(index: number): void {\n activeIndexState.set(index);\n }\n\n function markFocused(index: number): void {\n activeIndexState.set(index);\n }\n\n function handleKeydown(event: KeyboardEvent): void {\n if (event.ctrlKey || event.altKey || event.metaKey) {\n return;\n }\n const count = opts.count();\n if (count === 0) {\n return;\n }\n const current = activeIndexState();\n let nextIdx: number;\n switch (event.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n nextIdx = Math.max(0, current - 1);\n break;\n case 'ArrowRight':\n case 'ArrowDown':\n nextIdx = Math.min(count - 1, current + 1);\n break;\n case 'Home':\n nextIdx = 0;\n break;\n case 'End':\n nextIdx = count - 1;\n break;\n default:\n return;\n }\n event.preventDefault();\n if (nextIdx === current) {\n return;\n }\n focusAt(nextIdx);\n }\n\n return {\n activeIndex: activeIndexState.asReadonly(),\n markFocused,\n handleKeydown,\n focusAt,\n setActive,\n };\n}\n\n/**\n * DI token resolving the factory used to instantiate a\n * {@link CngxChipStripRovingController}. Defaults to\n * {@link createChipStripRoving}; override via\n * `providers: [{ provide: CNGX_CHIP_STRIP_ROVING_FACTORY, useValue: customFactory }]`\n * or per-component via `viewProviders` to install telemetry wrappers,\n * a controlled-from-outside focus mode, or a custom keyboard policy\n * without forking the reorderable component.\n *\n * Symmetrical to {@link CNGX_TREE_CONTROLLER_FACTORY} /\n * `CNGX_SELECTION_CONTROLLER_FACTORY`.\n *\n * @category common/interactive/reorder\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts\n * @since 0.1.0\n */\nexport const CNGX_CHIP_STRIP_ROVING_FACTORY = new InjectionToken<CngxChipStripRovingFactory>(\n 'CngxChipStripRovingFactory',\n {\n providedIn: 'root',\n factory: () => createChipStripRoving,\n },\n);\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, input, output } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent, filter } from 'rxjs';\nimport { type KeyCombo, matchesKeyCombo, parseKeyCombo } from '@cngx/core/utils';\n\n/** @internal Input element tag names where global shortcuts should not fire. */\nconst INPUT_TAGS = new Set(['INPUT', 'TEXTAREA', 'SELECT']);\n\n/**\n * Declarative keyboard shortcut handler.\n *\n * @category common/interactive/keyboard\n *\n * Binds a keyboard shortcut to the host element without global event listeners\n * in a service. Supports `mod` as a platform-aware modifier (`Meta` on macOS,\n * `Ctrl` elsewhere).\n *\n * Two scopes: `'global'` (default) listens on `document` and ignores events\n * from input elements; `'self'` listens only on the host element.\n *\n * Uses `parseKeyCombo` and `matchesKeyCombo` from `@cngx/core/utils`.\n *\n * ### Global save shortcut\n * ```html\n * <button [cngxKeyboardShortcut]=\"'mod+s'\" (shortcutTriggered)=\"save()\">\n * Save\n * </button>\n * ```\n *\n * ### Scoped escape handler\n * ```html\n * <div [cngxKeyboardShortcut]=\"'escape'\" [shortcutScope]=\"'self'\"\n * (shortcutTriggered)=\"close()\" tabindex=\"0\">\n * Press Escape to close\n * </div>\n * ```\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/keyboard/keyboard-shortcut.directive.ts\n * @since 0.1.0\n * @relatedTo CngxClickOutside, CngxSearch\n * <example-url>http://localhost:4200/#/common/interactive/gestures/keyboard-shortcut/global-shortcut</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/gestures/keyboard-shortcut/self-scoped-shortcut</example-url>\n */\n@Directive({\n selector: '[cngxKeyboardShortcut]',\n exportAs: 'cngxKeyboardShortcut',\n standalone: true,\n})\nexport class CngxKeyboardShortcut {\n /** Shortcut combo string, e.g. `'mod+s'`, `'ctrl+shift+k'`, `'escape'`. */\n readonly shortcut = input.required<string>({ alias: 'cngxKeyboardShortcut' });\n /** `'global'` listens on document; `'self'` listens only on the host element. */\n readonly scope = input<'global' | 'self'>('global', { alias: 'shortcutScope' });\n /** Whether the shortcut is active. */\n readonly enabled = input<boolean>(true);\n\n /** Emitted when the shortcut fires. */\n readonly shortcutTriggered = output<KeyboardEvent>();\n\n constructor() {\n const el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n const doc = inject(DOCUMENT);\n const isMac = doc.defaultView ? /mac/i.test(doc.defaultView.navigator.platform) : false;\n\n // Both streams stay subscribed; scope() gates inside the filter so\n // toggling scope at runtime doesn't churn subscriptions.\n const globalKeydown$ = fromEvent<KeyboardEvent>(doc, 'keydown');\n const selfKeydown$ = fromEvent<KeyboardEvent>(el, 'keydown');\n\n globalKeydown$\n .pipe(\n filter(() => this.enabled() && this.scope() === 'global'),\n filter((event) => !this.isInputElement(event.target)),\n filter((event) => this.matchesShortcut(event, isMac)),\n takeUntilDestroyed(),\n )\n .subscribe((event) => {\n event.preventDefault();\n this.shortcutTriggered.emit(event);\n });\n\n selfKeydown$\n .pipe(\n filter(() => this.enabled() && this.scope() === 'self'),\n filter((event) => this.matchesShortcut(event, isMac)),\n takeUntilDestroyed(),\n )\n .subscribe((event) => {\n event.preventDefault();\n this.shortcutTriggered.emit(event);\n });\n }\n\n /** Tests the keyboard event against the current shortcut combo. */\n private matchesShortcut(event: KeyboardEvent, isMac: boolean): boolean {\n const combo = this.parseCurrentCombo();\n return combo !== null && matchesKeyCombo(event, combo, isMac);\n }\n\n private parsedCombo: KeyCombo | null = null;\n private parsedComboStr = '';\n\n /** Parses the shortcut string, memoising the result to avoid re-parsing on every keystroke. */\n private parseCurrentCombo(): KeyCombo | null {\n const str = this.shortcut();\n if (str !== this.parsedComboStr) {\n this.parsedComboStr = str;\n\n this.parsedCombo = parseKeyCombo(str);\n }\n return this.parsedCombo;\n }\n\n /**\n * Guards global shortcuts from firing when the user is typing in a form field\n * or contenteditable region. Self-scoped shortcuts skip this check.\n */\n private isInputElement(target: EventTarget | null): boolean {\n if (!target || !(target instanceof HTMLElement)) {\n return false;\n }\n return INPUT_TAGS.has(target.tagName) || target.isContentEditable;\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n output,\n Renderer2,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent, map, switchMap, timer } from 'rxjs';\n\n/**\n * Debounced search term tracker for `<input>` elements.\n *\n * @category common/interactive/keyboard\n *\n * Converts the DOM `input` event stream into a debounced Signal. The raw\n * Observable is never exposed - signal at the API boundary.\n *\n * ### Basic usage\n * ```html\n * <input cngxSearch #search=\"cngxSearch\" placeholder=\"Search...\" />\n * <button (click)=\"search.clear()\">Clear</button>\n * ```\n *\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/keyboard/search.directive.ts\n * @since 0.1.0\n * @relatedTo CngxKeyboardShortcut, CngxListboxSearch\n */\n@Directive({\n selector: 'input[cngxSearch]',\n exportAs: 'cngxSearch',\n standalone: true,\n})\nexport class CngxSearch {\n /** Debounce delay in milliseconds. @defaultValue 300 */\n readonly debounceMs = input<number>(300);\n\n private readonly termState = signal('');\n /** The current (debounced) search term. */\n readonly term = this.termState.asReadonly();\n /** `true` when the search term is non-empty. */\n readonly hasValue = computed(() => this.termState().length > 0);\n\n /** Emitted after each debounced input event with the new term. */\n readonly searchChange = output<string>();\n\n private readonly el = inject(ElementRef<HTMLInputElement>);\n private readonly renderer = inject(Renderer2);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n fromEvent<InputEvent>(this.el.nativeElement as HTMLInputElement, 'input')\n .pipe(\n map((e) => (e.target as HTMLInputElement).value),\n switchMap((value) => timer(this.debounceMs()).pipe(map(() => value))),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe((term) => {\n this.termState.set(term);\n this.searchChange.emit(term);\n });\n }\n\n /** Clears the search term and resets the input element value. */\n clear(): void {\n this.termState.set('');\n this.renderer.setProperty(this.el.nativeElement, 'value', '');\n this.searchChange.emit('');\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, input, output } from '@angular/core';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { fromEvent, switchMap } from 'rxjs';\n\n/**\n * Emits when the user interacts outside the host element.\n *\n * @category common/interactive/keyboard\n *\n * Listens for a configurable DOM event on the document and checks whether\n * the event target is outside the host element's subtree. Useful for closing\n * dropdowns, popovers, modals, and any overlay that should dismiss on\n * outside interaction.\n *\n * The event type defaults to `'pointerdown'` which covers mouse, touch, and\n * pen input. Change it via the `[eventType]` input.\n *\n * ### Dropdown dismiss\n * ```html\n * <div cngxClickOutside (clickOutside)=\"closeDropdown()\" [enabled]=\"isOpen()\">\n * <ul>…menu items…</ul>\n * </div>\n * ```\n *\n * ### With custom event type\n * ```html\n * <div cngxClickOutside [eventType]=\"'click'\" (clickOutside)=\"dismiss()\">…</div>\n * ```\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/keyboard/click-outside.directive.ts\n * @since 0.1.0\n * @relatedTo CngxKeyboardShortcut, CngxPopover\n * <example-url>http://localhost:4200/#/common/interactive/gestures/click-outside/dropdown</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/gestures/click-outside/enabled-toggle</example-url>\n */\n@Directive({\n selector: '[cngxClickOutside]',\n exportAs: 'cngxClickOutside',\n standalone: true,\n})\nexport class CngxClickOutside {\n /** The DOM event type to listen for. `'pointerdown'` covers both mouse and touch. */\n readonly eventType = input<'pointerdown' | 'click' | 'mousedown' | 'touchstart'>('pointerdown');\n /** When `false` the directive is disabled and no events are emitted. */\n readonly enabled = input<boolean>(true);\n /** Emitted when the user interacts outside the host element. */\n readonly clickOutside = output<PointerEvent | MouseEvent | TouchEvent>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n\n constructor() {\n toObservable(this.eventType)\n .pipe(\n switchMap((type) => fromEvent<PointerEvent | MouseEvent | TouchEvent>(this.doc, type)),\n takeUntilDestroyed(),\n )\n .subscribe((e) => {\n if (this.enabled() && !(this.el.nativeElement as HTMLElement).contains(e.target as Node)) {\n this.clickOutside.emit(e);\n }\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, inject, input } from '@angular/core';\n\n/**\n * Prevents accidental page navigation when there are unsaved changes.\n *\n * @category common/interactive/guard\n *\n * Sets a `beforeunload` event handler that shows the browser's native\n * confirmation dialog when `enabled` is `true`. Does NOT integrate with\n * the Angular Router - for route guard protection, use `canDeactivateWhenClean()`.\n *\n * ### Protect a form\n * ```html\n * <form [cngxBeforeUnload]=\"form.dirty()\">\n * …\n * </form>\n * ```\n *\n * ### Combined with route guard\n * ```typescript\n * // In route config:\n * { path: 'edit', component: EditComponent, canDeactivate: [canDeactivateWhenClean(() => editForm.dirty())] }\n *\n * // In template:\n * <form [cngxBeforeUnload]=\"editForm.dirty()\">…</form>\n * ```\n *\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/guard/before-unload.directive.ts\n * @since 0.1.0\n * @relatedTo canDeactivateWhenClean\n */\n@Directive({\n selector: '[cngxBeforeUnload]',\n exportAs: 'cngxBeforeUnload',\n standalone: true,\n})\nexport class CngxBeforeUnload {\n /** Whether the beforeunload guard is active. */\n readonly enabled = input.required<boolean>({ alias: 'cngxBeforeUnload' });\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n if (!win) {\n return;\n }\n\n const handler = (event: BeforeUnloadEvent) => {\n if (this.enabled()) {\n event.preventDefault();\n }\n };\n\n win.addEventListener('beforeunload', handler);\n inject(DestroyRef).onDestroy(() => win.removeEventListener('beforeunload', handler));\n }\n}\n","import { inject } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\n\n/**\n * Creates a functional route guard that blocks navigation when the form is dirty.\n *\n * Works with Angular's `CanDeactivateFn`. The `isDirty` callback is evaluated\n * on each navigation attempt. When dirty, shows a `confirm` dialog.\n *\n * Uses `DOCUMENT` injection for SSR safety — returns `true` (allow) when\n * no window is available.\n *\n * Pair with `CngxBeforeUnload` for full coverage (browser close + route change):\n *\n * ```typescript\n * // Route config\n * {\n * path: 'edit',\n * component: EditComponent,\n * canDeactivate: [canDeactivateWhenClean(() => inject(EditComponent).isDirty())]\n * }\n * ```\n *\n * @param isDirty - Callback that returns `true` when there are unsaved changes.\n * @param message - Confirmation message. Default: `'You have unsaved changes. Leave anyway?'`\n * @returns A functional guard compatible with Angular's `canDeactivate`.\n *\n * @category common/interactive/guard\n */\nexport function canDeactivateWhenClean(\n isDirty: () => boolean,\n message = 'You have unsaved changes. Leave anyway?',\n): () => boolean {\n return () => {\n if (!isDirty()) {\n return true;\n }\n // inject() is valid here — Angular calls the guard in an injection context\n const win = inject(DOCUMENT).defaultView;\n if (!win) {\n return true;\n }\n return win.confirm(message);\n };\n}\n","import { NgComponentOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n InjectionToken,\n inject,\n input,\n type Type,\n ViewEncapsulation,\n} from '@angular/core';\n\n/**\n * Injection token for a custom close icon component.\n * Set via `provideFeedback(withCloseIcon(MyIcon))` which forwards to this token.\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/close-button/close-button.ts\n * @since 0.1.0\n */\nexport const CNGX_CLOSE_ICON = new InjectionToken<Type<unknown>>('CngxCloseIcon');\n\n/**\n * Shared close/dismiss button molecule.\n *\n * Composes the native `<button>` shell with an optional projected icon\n * and the `CNGX_CLOSE_ICON` DI swap; owns ARIA wiring, focus ring,\n * density, and a default X glyph as the projection fallback.\n *\n * Used internally by `CngxAlert`, `CngxToastOutlet`, and `CngxPopoverPanel`.\n * Can also be used standalone by consumers for dialogs, drawers, chips, etc.\n *\n * All visual properties are CSS Custom Properties - density is controlled\n * via the `feedback.density()` SCSS mixin or direct overrides.\n *\n * ### Standalone\n * ```html\n * <cngx-close-button label=\"Close dialog\" (click)=\"close()\" />\n * ```\n *\n * ### Inside a component (click handled by parent)\n * ```html\n * <cngx-close-button label=\"Close\" />\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/close-button/close-button.ts\n * @since 0.1.0\n * @relatedTo CNGX_CLOSE_ICON, CngxAlert, CngxToastOutlet, CngxPopover\n * <example-url>http://localhost:4200/#/common/interactive/close-button/basic</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/close-button/projected-icon</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/close-button/contextual-labels</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/close-button/inside-a-dismissible-card</example-url>\n */\n@Component({\n selector: 'cngx-close-button',\n standalone: true,\n imports: [NgComponentOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-close-button',\n },\n template: `\n <button type=\"button\" class=\"cngx-close-button__btn\" [attr.aria-label]=\"label()\">\n <ng-content>\n @if (customIcon) {\n <ng-container *ngComponentOutlet=\"customIcon\" />\n } @else {\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"cngx-close-button__icon\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n }\n </ng-content>\n </button>\n `,\n styleUrls: ['./close-button.css'],\n})\nexport class CngxCloseButton {\n /**\n * Required accessible label for the inner `<button>` (`aria-label`).\n * Describe the dismissable artifact, not the affordance:\n * `\"Close session-expired alert\"`, not `\"Close\"`. A bare `\"Close\"`\n * reads identically across every dismiss target on the page.\n */\n readonly label = input.required<string>();\n\n /** @internal - global icon from CNGX_CLOSE_ICON token. */\n protected readonly customIcon = inject(CNGX_CLOSE_ICON, { optional: true });\n}\n","import { Directive, signal } from '@angular/core';\n\n/**\n * Tracks whether the host element is currently hovered via mouse pointer.\n *\n * @category common/interactive\n *\n * Designed as a `hostDirective` composition primitive - attach it to\n * components that need hover state without implementing their own\n * mouseenter/mouseleave logic. The `hovered` signal is writable so\n * host components can read it via `inject(CngxHoverable, { host: true })`.\n *\n * Used internally by `CngxTreetableRow` for row highlight-on-hover.\n *\n * ### As hostDirective\n * ```typescript\n * @Component({\n * hostDirectives: [{ directive: CngxHoverable }],\n * })\n * export class MyCard {\n * private readonly hover = inject(CngxHoverable, { host: true });\n * readonly isHovered = this.hover.hovered; // Signal<boolean>\n * }\n * ```\n *\n * ### Standalone\n * ```html\n * <div cngxHoverable #h=\"cngxHoverable\" [class.highlight]=\"h.hovered()\">\n * Hover me\n * </div>\n * ```\n *\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/hoverable/hoverable.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPressable, CngxRipple\n */\n@Directive({\n selector: '[cngxHoverable]',\n standalone: true,\n exportAs: 'cngxHoverable',\n host: {\n '(mouseenter)': 'hovered.set(true)',\n '(mouseleave)': 'hovered.set(false)',\n },\n})\nexport class CngxHoverable {\n /** `true` while the pointer is over the host element. */\n readonly hovered = signal(false);\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n signal,\n} from '@angular/core';\n\n/**\n * Headless text-to-speech directive using the browser's SpeechSynthesis API.\n *\n * @category common/interactive\n *\n * A read-aloud feature for cognitive accessibility - dyslexia support, reading\n * assistance, or convenience. Not a screen reader replacement (use\n * `CngxLiveRegion` for ARIA live regions).\n *\n * The directive is purely behavioral: it exposes `speaking()` and `supported()`\n * signals plus `speak()` / `cancel()` methods. The consumer renders their own\n * UI (button, icon, link) and calls the methods via the template reference.\n *\n * Pair with `CngxSpeakButton` (`@cngx/ui`) for a ready-made speaker button.\n *\n * ### Headless - consumer-owned button\n * ```html\n * <p [cngxSpeak]=\"text\" #tts=\"cngxSpeak\">\n * {{ text }}\n * <button (click)=\"tts.toggle()\">{{ tts.speaking() ? 'Stop' : 'Listen' }}</button>\n * </p>\n * ```\n *\n * ### Auto-speak on dynamic value change\n * ```html\n * <div [cngxSpeak]=\"notification()\">{{ notification() }}</div>\n * ```\n *\n * ### With CngxSpeakButton (from @cngx/ui)\n * ```html\n * <span [cngxSpeak]=\"text\" #tts=\"cngxSpeak\">{{ text }}</span>\n * <cngx-speak-button [speakRef]=\"tts\" />\n * ```\n *\n * ### Suppress auto-speak for dynamic values\n * ```html\n * <div [cngxSpeak]=\"liveCounter()\" [enabled]=\"false\" #tts=\"cngxSpeak\">\n * {{ liveCounter() }}\n * <button (click)=\"tts.speak(liveCounter().toString())\">Read current value</button>\n * </div>\n * ```\n * @docsKind primary\n * @wcag AAA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/speak/speak.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSpeakButton, CngxLiveRegion\n * <example-url>http://localhost:4200/#/common/interactive/speak/form-error-read-aloud-on-demand</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/speak/headless-read-aloud</example-url>\n * <example-url>http://localhost:4200/#/ui/speak/speak-button/material-integration-theme-scss-mat-icon-button</example-url>\n * <example-url>http://localhost:4200/#/ui/speak/speak-button/styled-speaker-icon</example-url>\n * <example-url>http://localhost:4200/#/ui/speak/speak-button/theming-css-custom-properties</example-url>\n */\n@Directive({\n selector: '[cngxSpeak]',\n exportAs: 'cngxSpeak',\n standalone: true,\n})\nexport class CngxSpeak {\n /** Text to speak. When `enabled` is `true`, speech triggers on every change to a non-empty value. */\n readonly text = input.required<string>({ alias: 'cngxSpeak' });\n\n /** Speech rate (0.1–10, default 1). */\n readonly rate = input(1);\n /** Speech pitch (0–2, default 1). */\n readonly pitch = input(1);\n /** Speech volume (0–1, default 1). */\n readonly volume = input(1);\n /** BCP 47 language tag (e.g. `'de-DE'`). Empty string uses the browser default. */\n readonly lang = input('');\n /** Controls auto-speak on text changes. Does NOT affect `speak()` or `cancel()`. */\n readonly enabled = input(true);\n\n private readonly speakingState = signal(false);\n private readonly supportedState: boolean;\n private readonly synth: SpeechSynthesis | null;\n private readonly initialized = signal(false);\n\n /** Whether the browser supports the SpeechSynthesis API. */\n readonly supported: boolean;\n\n /** `true` while an utterance is being spoken. */\n readonly speaking = this.speakingState.asReadonly();\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n this.synth = win?.speechSynthesis ?? null;\n this.supportedState = !!this.synth;\n this.supported = this.supportedState;\n\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n const value = this.text();\n if (!this.initialized() || !value || !this.enabled() || !this.synth) {\n return;\n }\n this.performSpeak(value);\n });\n\n inject(DestroyRef).onDestroy(() => this.synth?.cancel());\n }\n\n /** Speak arbitrary text. Always works regardless of `enabled`. */\n speak(text: string): void {\n if (text && this.synth) {\n this.performSpeak(text);\n }\n }\n\n /** Cancel any ongoing speech. */\n cancel(): void {\n this.synth?.cancel();\n this.speakingState.set(false);\n }\n\n /** Toggle speech: speak text if idle, cancel if speaking. */\n toggle(): void {\n if (this.speakingState()) {\n this.cancel();\n } else {\n const text = this.text();\n if (text) {\n this.speak(text);\n }\n }\n }\n\n private performSpeak(text: string): void {\n const synth = this.synth!;\n // Chrome silently drops the next speak() when cancel() runs on an\n // idle synth; only cancel when there's actually a queued or in-flight\n // utterance. Firefox tolerates the unconditional cancel either way.\n if (synth.speaking || synth.pending) {\n synth.cancel();\n }\n\n const utterance = new SpeechSynthesisUtterance(text);\n utterance.rate = this.rate();\n utterance.pitch = this.pitch();\n utterance.volume = this.volume();\n const lang = this.lang();\n if (lang) {\n utterance.lang = lang;\n }\n\n utterance.onstart = () => this.speakingState.set(true);\n utterance.onend = () => this.speakingState.set(false);\n utterance.onerror = () => this.speakingState.set(false);\n\n synth.speak(utterance);\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Discriminated union describing one direct child of a hierarchy-aware\n * option projection root (e.g. `CngxSelectShell`).\n *\n * `CngxOption` registers as `{ kind: 'option' }`, `CngxOptionGroup` as\n * `{ kind: 'group' }`. Both providers expose `useExisting` so consumers\n * can `inject(CNGX_OPTION_CONTAINER)` and reach the directive instance\n * through the discriminator.\n *\n * @category common/interactive/listbox\n */\nexport type CngxOptionContainer =\n | (CngxOptionContainerOption & { readonly kind: 'option' })\n | (CngxOptionContainerGroup & { readonly kind: 'group' });\n\n/**\n * Public surface a `CngxOption` exposes when registered under\n * `CNGX_OPTION_CONTAINER`. Kept structural so consumers can walk the\n * projection tree without importing the directive class directly.\n *\n * @category common/interactive/listbox\n */\nexport interface CngxOptionContainerOption {\n readonly id: string;\n}\n\n/**\n * Public surface a `CngxOptionGroup` exposes when registered under\n * `CNGX_OPTION_CONTAINER`. The `options` signal yields the direct\n * `CngxOption` children of the group; nested groups are unsupported\n * (the surrounding directive dev-warns when one is detected).\n */\nexport interface CngxOptionContainerGroup {\n readonly label: () => string;\n readonly options: () => readonly CngxOptionContainerOption[];\n}\n\n/**\n * DI token registered by both `CngxOption` and `CngxOptionGroup`.\n *\n * Hierarchy-aware projection roots (`CngxSelectShell` and friends)\n * query a single token via `contentChildren(CNGX_OPTION_CONTAINER,\n * { descendants: false })` and walk the result preserving DOM order.\n * The discriminated `kind` field separates leaves from groups without\n * forcing the consumer to import either directive class.\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-container.ts\n * @since 0.1.0\n */\nexport const CNGX_OPTION_CONTAINER = new InjectionToken<CngxOptionContainer>(\n 'CNGX_OPTION_CONTAINER',\n);\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Pull-based contract a parent host (e.g. `CngxSelectShell` with a search\n * input, future filter-driven hosts) implements so individual `CngxOption`\n * instances can compute their own `hidden` visibility from a host-owned\n * `searchTerm` signal and a host-owned `matches` policy.\n *\n * Splitting policy from visibility keeps the option agnostic about HOW\n * filtering decides - substring, fuzzy, server-driven - and gives the\n * host a single point of control. Empty search term ALWAYS resolves to\n * \"show everything\"; the option short-circuits before calling `matches`.\n *\n * @category common/interactive/listbox\n */\nexport interface CngxOptionFilterHost {\n /** Current search term. Empty string means \"no filter active\". */\n readonly searchTerm: Signal<string>;\n /**\n * Decides whether the option is a match for the active term. Receives the\n * option's value, its resolved plain-text label, and the current term.\n */\n matches<T>(value: T, label: string, term: string): boolean;\n}\n\n/**\n * DI token a host provides on itself when it wants to drive per-option\n * `hidden` visibility through a reactive search term and a `matches`\n * policy.\n *\n * `CngxOption` injects this token with `{ optional: true }` - standalone\n * use (no host provides the token) leaves every option visible at all\n * times with no DOM cost.\n *\n * @category common/interactive/listbox\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-filter-host.ts\n * @since 0.1.0\n */\nexport const CNGX_OPTION_FILTER_HOST = new InjectionToken<CngxOptionFilterHost>(\n 'CNGX_OPTION_FILTER_HOST',\n);\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Pull-based contract a parent host (e.g. `CngxSelectShell`) implements\n * so individual `CngxOption` instances can resolve their highlight state\n * and route click + hover activations when the option's own\n * `inject(CngxActiveDescendant)` returns null.\n *\n * The need arises with content-projected options: at construction time,\n * the option's element-injector chain anchors in the consumer's\n * authoring view - which has no surrounding `CngxActiveDescendant`. The\n * shell that owns the listbox + AD provides this token via `useExisting`,\n * and projected options consult it as a fallback.\n *\n * Splitting the contract into a narrow surface (`activeId` /\n * `activate` / `highlight`) keeps the option agnostic about HOW the\n * host wires its AD - the shell forwards to its inner listbox's AD,\n * a hypothetical custom host could route through telemetry / multi-AD\n * coordination / etc. without changing the option directive.\n *\n * @category common/interactive/listbox\n */\nexport interface CngxOptionInteractionHost {\n /**\n * Currently active option id, or `null` when no option is\n * highlighted. The option compares against its own `id` to drive the\n * `cngx-option--highlighted` host class.\n */\n readonly activeId: Signal<string | null>;\n /**\n * Activate (commit / select) the option carrying the given value.\n * Called from the option's click handler when its own AD inject is\n * null. The host typically routes through its listbox's\n * `highlightByValue(value); activateCurrent()` pair.\n */\n activate(value: unknown): void;\n /**\n * Move the highlight to the option carrying the given value.\n * Called from the option's pointerenter handler. The host typically\n * routes through its listbox's `highlightByValue(value)`.\n */\n highlight(value: unknown): void;\n}\n\n/**\n * DI token a host provides on itself when content-projected\n * `CngxOption` instances need a fallback path to highlight + activate\n * + hover behaviour. Mirrors the four other shell-host tokens\n * (`CNGX_OPTION_CONTAINER`, `CNGX_OPTION_STATUS_HOST`,\n * `CNGX_OPTION_FILTER_HOST`, `CNGX_SELECT_SHELL_SEARCH_HOST`).\n *\n * `CngxOption` injects this token with `{ optional: true }` -\n * standalone use (no host provides the token) leaves option behaviour\n * unchanged because the option's own AD inject takes precedence when\n * available.\n *\n * @category common/interactive/listbox\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-interaction-host.ts\n * @since 0.1.0\n */\nexport const CNGX_OPTION_INTERACTION_HOST = new InjectionToken<CngxOptionInteractionHost>(\n 'CNGX_OPTION_INTERACTION_HOST',\n);\n","import { InjectionToken, type Signal, type TemplateRef } from '@angular/core';\n\n/**\n * Discriminated status entry rendered in `CngxOption`'s reserved internal\n * status slot.\n *\n * `kind` separates pending (in-flight commit) from error (failed commit) so\n * styling can branch on the host attribute `[attr.data-status]`. `tpl`\n * carries the actual glyph; the host MAY return `tpl: null` to reserve\n * layout space without rendering anything (rare - used for force-revealing\n * the slot during animation transitions).\n *\n * @category common/interactive/listbox\n */\nexport interface CngxOptionStatus {\n readonly kind: 'pending' | 'error';\n readonly tpl: TemplateRef<unknown> | null;\n}\n\n/**\n * Pull-based contract a select-shell host implements so individual\n * `CngxOption` instances can render an infrastructure indicator (commit\n * pending spinner, commit error glyph) inside a reserved internal slot\n * AFTER the user's option content.\n *\n * Pull semantics keep the host stateless from the option's perspective:\n * the option calls `host.statusFor(value)` once and consumes the returned\n * `Signal<CngxOptionStatus | null>` reactively; the host owns the policy\n * for resolving which value gets which status at any given commit-id.\n *\n * @category common/interactive/listbox\n */\nexport interface CngxOptionStatusHost {\n /**\n * Returns a reactive status entry for the given option value, or `null`\n * when the option carries no infrastructure indicator at this moment.\n */\n statusFor<T>(value: T): Signal<CngxOptionStatus | null>;\n}\n\n/**\n * DI token an option-projection root (e.g. `CngxSelectShell`) provides on\n * itself when commit-driven status indicators should reach individual\n * options without invading the consumer-authored option template.\n *\n * `CngxOption` injects this token with `{ optional: true }` - standalone\n * use (no host provides the token) results in a stable `null` status with\n * no DOM cost.\n *\n * @category common/interactive/listbox\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-status-host.ts\n * @since 0.1.0\n */\nexport const CNGX_OPTION_STATUS_HOST = new InjectionToken<CngxOptionStatusHost>(\n 'CNGX_OPTION_STATUS_HOST',\n);\n","import {\n afterNextRender,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n isDevMode,\n signal,\n type Signal,\n} from '@angular/core';\n\nimport { CNGX_AD_ITEM, CngxActiveDescendant, type CngxAdItemHandle } from '@cngx/common/a11y';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_OPTION_CONTAINER } from './option-container';\nimport { CNGX_OPTION_FILTER_HOST } from './option-filter-host';\nimport { CNGX_OPTION_INTERACTION_HOST } from './option-interaction-host';\nimport { CNGX_OPTION_STATUS_HOST, type CngxOptionStatus } from './option-status-host';\n\n/**\n * A single selectable option registered with a surrounding `CngxActiveDescendant`.\n *\n * Click highlights + activates, `pointerenter` highlights only. Provides a stable\n * unique id on the host element for `aria-activedescendant` resolution.\n *\n * Selection state (`isSelected`) is driven externally by the enclosing listbox.\n * In V1 of the stack, `CngxListbox` reads `value()` via the AD item list and\n * exposes its own selection through `CngxOption.isSelected()`.\n *\n * @category common/interactive/listbox\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option.directive.ts\n * @since 0.1.0\n * @relatedTo CngxListbox, CngxOptionGroup, CngxActiveDescendant\n * <example-url>http://localhost:4200/#/common/interactive/listbox/search/command-palette</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/base/multi-select</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/base/single-select</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/option/flat-options-with-ad</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/option/grouped-options</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/material-mat-select-via-cngxbindfield</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/reactive-forms-adapted-via-adaptformcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-multi-select-min-2</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-single-select</example-url>\n */\n@Directive({\n selector: '[cngxOption]',\n exportAs: 'cngxOption',\n standalone: true,\n providers: [\n { provide: CNGX_AD_ITEM, useExisting: CngxOption },\n { provide: CNGX_OPTION_CONTAINER, useExisting: CngxOption },\n ],\n host: {\n role: 'option',\n '[id]': 'id',\n '[class.cngx-option--selected]': 'isSelected()',\n '[class.cngx-option--highlighted]': 'isHighlighted()',\n '[class.cngx-option--disabled]': 'disabled()',\n '[attr.aria-selected]': 'isSelected()',\n '[attr.aria-disabled]': 'disabled() || null',\n '[attr.data-status]': 'statusSignal()?.kind ?? null',\n '[class.cngx-option--hidden]': 'hidden()',\n '[attr.hidden]': 'hidden() || null',\n '(click)': 'handleClick()',\n '(pointerenter)': 'handlePointerEnter()',\n },\n})\nexport class CngxOption implements CngxAdItemHandle {\n /** Discriminator for `CNGX_OPTION_CONTAINER` consumers. */\n readonly kind = 'option' as const;\n /** Opaque value emitted on activation. */\n readonly value = input<unknown>(undefined);\n /** Disabled options are skipped in navigation and reject clicks. */\n readonly disabled = input<boolean>(false);\n /** Optional explicit label used by typeahead. Falls back to trimmed `textContent`. */\n readonly labelInput = input<string | undefined>(undefined, { alias: 'label' });\n\n /** Stable unique id set on the host, used by `aria-activedescendant`. */\n readonly id = nextUid('cngx-option');\n\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly ad = inject(CngxActiveDescendant, { optional: true });\n private readonly interactionHost = inject(CNGX_OPTION_INTERACTION_HOST, { optional: true });\n private readonly statusHost = inject(CNGX_OPTION_STATUS_HOST, { optional: true });\n private readonly filterHost = inject(CNGX_OPTION_FILTER_HOST, { optional: true });\n private readonly selectedState = signal(false);\n /**\n * Snapshot of `nativeElement.textContent` taken in `afterNextRender`. The\n * `textContent` getter is not a signal, so a reactive `label` cannot\n * subscribe to it directly; the snapshot bridges DOM state into the\n * reactive graph once the first render has populated text.\n */\n private readonly textContentSnapshot = signal('');\n\n /**\n * Whether this option is currently highlighted. Reads the surrounding\n * `CngxActiveDescendant` when available; falls back to the optional\n * {@link CNGX_OPTION_INTERACTION_HOST} contract for content-projected\n * options whose authoring view has no AD in scope (e.g. children of\n * `CngxSelectShell`).\n */\n readonly isHighlighted = computed<boolean>(() => {\n const id = this.ad?.activeId() ?? this.interactionHost?.activeId() ?? null;\n return id === this.id;\n });\n\n /**\n * Reactive infrastructure-status entry resolved via the optional\n * `CNGX_OPTION_STATUS_HOST` host. `null` when no host is provided or the\n * host returns `null` for this option's value.\n *\n * `CngxSelectOption` (declarative wrapper) renders the status template\n * AFTER the user's `<ng-content/>` in a reserved internal slot, so the\n * indicator never invades the consumer-authored option content.\n */\n readonly statusSignal = computed<CngxOptionStatus | null>(\n () => this.statusHost?.statusFor(this.value())() ?? null,\n {\n equal: (a, b) => a === b || (!!a && !!b && a.kind === b.kind && a.tpl === b.tpl),\n },\n );\n\n /**\n * Whether this option is selected. Driven externally by the enclosing listbox\n * via `markSelected()`. Standalone use (without a listbox) always returns `false`.\n */\n readonly isSelected = this.selectedState.asReadonly();\n\n /**\n * Reactive visibility derived from the optional `CNGX_OPTION_FILTER_HOST`\n * host's `searchTerm` and `matches` policy. `false` when no host is\n * provided or the term is empty; `true` only when the host's policy\n * explicitly rejects the option for the current term.\n *\n * Boolean - default `Object.is` equality is sufficient.\n */\n readonly hidden = computed<boolean>(() => {\n const host = this.filterHost;\n if (!host) {\n return false;\n }\n const term = host.searchTerm();\n if (!term) {\n return false;\n }\n return !host.matches(this.value(), this.label(), term);\n });\n\n /**\n * Resolved label as a Signal - explicit `label` input wins, falling back to\n * the host element's trimmed `textContent` (the W3C-defined plain-text\n * projection of the subtree). Plain text by construction; never reads\n * `innerHTML`. Consumers can text-interpolate this safely on a closed\n * trigger (`{{ option.label() }}`) without an XSS surface.\n *\n * The textContent fallback is captured as a post-render snapshot\n * (`afterNextRender`), so the signal is reactive on `labelInput` while\n * still giving callers a non-empty value for static-text declarative\n * options. Consumers with dynamic option text should bind `[label]`\n * explicitly rather than relying on the projection.\n */\n readonly label: Signal<string> = computed(() => {\n const explicit = this.labelInput();\n if (explicit) {\n return explicit;\n }\n return this.textContentSnapshot();\n });\n\n /**\n * Back-compat callable alias - `CngxAdItemHandle.label` accepts both\n * `Signal<string>` and `() => string`, so this arrow keeps any\n * consumer that called `option.resolvedLabel()` imperatively working\n * unchanged.\n */\n readonly resolvedLabel = (): string => this.label();\n\n constructor() {\n afterNextRender(() => {\n const el = this.elementRef.nativeElement as HTMLElement;\n this.textContentSnapshot.set((el.textContent ?? '').trim());\n if (isDevMode() && !this.label()) {\n console.error(\n `<cngx-option> at ${this.id} has no label and no textContent. ` +\n `Label is required for AT and trigger display.`,\n );\n }\n });\n }\n\n /** @internal Used by `CngxListbox` to sync selection state. */\n markSelected(selected: boolean): void {\n this.selectedState.set(selected);\n }\n\n protected handleClick(): void {\n if (this.disabled()) {\n return;\n }\n const ad = this.ad;\n if (ad) {\n ad.highlightByValue(this.value());\n ad.activateCurrent();\n return;\n }\n this.interactionHost?.activate(this.value());\n }\n\n protected handlePointerEnter(): void {\n if (this.disabled()) {\n return;\n }\n if (this.ad) {\n this.ad.highlightByValue(this.value());\n return;\n }\n this.interactionHost?.highlight(this.value());\n }\n}\n","import {\n afterNextRender,\n computed,\n contentChildren,\n Directive,\n input,\n isDevMode,\n type Signal,\n} from '@angular/core';\n\nimport { CNGX_OPTION_CONTAINER } from './option-container';\nimport { CngxOption } from './option.directive';\n\n/**\n * Groups related `CngxOption`s under a visual and semantic header.\n *\n * Renders `role=\"group\"` and `aria-label` - children stay flat in the AD item\n * list; grouping is purely presentational and for ATs that render group labels.\n *\n * Hierarchy-aware projection roots (e.g. `CngxSelectShell`) query\n * `CNGX_OPTION_CONTAINER` to walk the direct children in DOM order and read\n * each group's `options` to populate `CngxSelectOptionGroupDef.options`.\n * Nested option groups are unsupported - a dev-warning fires when one is\n * detected.\n *\n * @category common/interactive/listbox\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-group.directive.ts\n * @since 0.1.0\n * @relatedTo CngxOption, CngxListbox\n * <example-url>http://localhost:4200/#/common/interactive/option/flat-options-with-ad</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/option/grouped-options</example-url>\n */\n@Directive({\n selector: '[cngxOptionGroup]',\n exportAs: 'cngxOptionGroup',\n standalone: true,\n providers: [{ provide: CNGX_OPTION_CONTAINER, useExisting: CngxOptionGroup }],\n host: {\n role: 'group',\n '[attr.aria-label]': 'label()',\n },\n})\nexport class CngxOptionGroup {\n /** Discriminator for `CNGX_OPTION_CONTAINER` consumers. */\n readonly kind = 'group' as const;\n /** Accessible group label. */\n readonly label = input.required<string>();\n\n private readonly optionsQuery = contentChildren(CngxOption, { descendants: false });\n private readonly nestedGroupsQuery = contentChildren(CngxOptionGroup, { descendants: true });\n\n /**\n * Direct `CngxOption` children of this group, DOM-ordered. Reference-stable\n * across change-detection runs when the underlying option set is unchanged.\n */\n readonly options: Signal<readonly CngxOption[]> = computed(() => this.optionsQuery(), {\n equal: (a, b) => a.length === b.length && a.every((v, i) => v === b[i]),\n });\n\n constructor() {\n afterNextRender(() => {\n if (isDevMode() && this.nestedGroupsQuery().length > 0) {\n console.error(\n '[cngxOptionGroup] Nested option groups are unsupported. ' +\n 'Use CngxTreeSelect for arbitrary tree shapes.',\n );\n }\n });\n }\n}\n","import {\n afterNextRender,\n computed,\n contentChildren,\n Directive,\n effect,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\nimport { CngxActiveDescendant } from '@cngx/common/a11y';\n\nimport type { CngxListboxSearch } from './listbox-search.directive';\nimport { CngxOption } from './option.directive';\n\n/**\n * Composite listbox primitive built on top of `CngxActiveDescendant`.\n *\n * Reads options from content children, exposes single- or multi-value\n * selection state via two-way `[(value)]` / `[(selectedValues)]` bindings, and\n * drives `aria-selected` / `aria-multiselectable` reactively.\n *\n * `value` and `selectedValues` are `model()` signals - `[value]`,\n * `(valueChange)`, and `[(value)]` bindings all work identically. Forms\n * integration (`<cngx-form-field>`) is bolted on via the sibling\n * `CngxListboxFieldBridge` directive from `@cngx/forms/field` - this atom\n * stays Forms-agnostic.\n *\n * ### Material / CDK equivalent\n *\n * - `cdk-listbox` (single/multi select via `cdkListbox` directive)\n * - `mat-selection-list` (multi select list from `@angular/material/list`)\n *\n * ### Why better than Material\n *\n * 1. Single source of truth for ARIA: every attribute is a `computed()`.\n * 2. Selection shares the same `CngxActiveDescendant` used by menus and\n * comboboxes - one mental model for all typeahead widgets.\n * 3. `isAllSelected` and `selectedLabels` are derived signals, not manual\n * callbacks.\n * 4. Forms integration is decoupled: the listbox never imports `@angular/forms`.\n *\n * @category common/interactive/listbox\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/listbox.directive.ts\n * @since 0.1.0\n * @relatedTo CngxListboxSearch, CngxListboxTrigger, CngxOption, CngxOptionGroup, CngxActiveDescendant\n * @playground Two synced listboxes ./examples/synced-listboxes/synced-listboxes.component.ts\n * <example-url>http://localhost:4200/#/common/interactive/listbox/search/command-palette</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/base/multi-select</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/base/single-select</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/material-mat-select-via-cngxbindfield</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/reactive-forms-adapted-via-adaptformcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-multi-select-min-2</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-single-select</example-url>\n */\n@Directive({\n selector: '[cngxListbox]',\n exportAs: 'cngxListbox',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxActiveDescendant,\n inputs: ['items', 'orientation', 'loop', 'typeahead', 'autoHighlightFirst', 'virtualCount'],\n },\n ],\n host: {\n role: 'listbox',\n '[attr.aria-label]': 'label()',\n '[attr.aria-multiselectable]': 'multiple() ? \"true\" : null',\n },\n})\nexport class CngxListbox<T = unknown> {\n /** Accessible label for the listbox region. */\n readonly label = input.required<string>();\n\n /** Two-way single-value binding. */\n readonly value = model<T | undefined>(undefined);\n\n /** Two-way multi-value binding. */\n readonly selectedValues = model<T[]>([]);\n\n /** Whether multiple options can be selected. */\n readonly multiple = input<boolean>(false);\n\n /** Equality function for matching values. Defaults to `Object.is`. */\n readonly compareWith = input<(a: T, b: T) => boolean>(Object.is as (a: T, b: T) => boolean);\n\n /**\n * Optional explicit reference to a `CngxListboxSearch` whose term drives\n * `filteredOptions`. Consumers wire this up with a template reference:\n * `[cngxSearchRef]=\"search\"` and `#search=\"cngxListboxSearch\"`. No ancestor\n * injection - orthogonal composition, like `CngxSortHeader` + `CngxSortRef`.\n */\n readonly cngxSearchRef = input<CngxListboxSearch | null>(null);\n\n /**\n * When `true`, the listbox stops auto-writing its own `value` / `selectedValues`\n * on AD-activation. The consumer (typically a Level-3 composite like\n * `CngxSelect` running an async `[commitAction]`) fully owns the value\n * mutation flow and can intercept activations BEFORE any write happens.\n *\n * **Why this exists.**\n * The commit flow needs to snapshot the pre-pick value synchronously when\n * the user clicks an option - to roll back to it on error. Without this\n * flag, CngxListbox writes `value` via two-way binding BEFORE the consumer's\n * own `ad.activated` subscriber runs, and the pre-pick value is already\n * gone by the time we try to snapshot it. Flipping this flag lets the\n * consumer be the single writer.\n *\n * Default `false` preserves the self-contained listbox behaviour used\n * everywhere outside the select family.\n */\n readonly externalActivation = input<boolean>(false);\n\n /**\n * Underlying `CngxActiveDescendant` host directive. Exposed so triggers\n * (e.g. `CngxListboxTrigger`) can drive navigation without ancestor injection.\n */\n readonly ad = inject(CngxActiveDescendant, { self: true, host: true });\n\n /**\n * Optional explicit option list. When set, takes precedence over content\n * projection. Useful for composites that project options via `<ng-content>`\n * and query them one layer up (e.g. `CngxSelect`'s declarative mode).\n */\n readonly explicitOptions = input<readonly CngxOption[] | undefined>(undefined);\n\n /** Options collected via content projection. */\n private readonly contentOptions = contentChildren(CngxOption, { descendants: true });\n\n /** Effective option list: explicit input wins, otherwise content-projection. */\n readonly options = computed<readonly CngxOption[]>(\n () => this.explicitOptions() ?? this.contentOptions(),\n );\n\n /** Whether content-children have been initialised (guards effects from running early). */\n private readonly initialized = signal(false);\n\n constructor() {\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n if (!this.initialized()) {\n return;\n }\n const selected = this.selected();\n const eq = this.compareWith();\n for (const opt of this.options()) {\n opt.markSelected(selected.some((s) => eq(s, opt.value() as T)));\n }\n });\n\n this.ad.activated.subscribe((value) => this.handleActivation(value));\n }\n\n /** Current selection as an array (single-mode → `[value]` or `[]`, multi-mode → `selectedValues`). */\n readonly selected = computed<T[]>(() => {\n if (this.multiple()) {\n return [...this.selectedValues()];\n }\n const v = this.value();\n return v === undefined || v === null ? [] : [v as T];\n });\n\n /** Labels of currently selected options, in selection order. */\n readonly selectedLabels = computed<string[]>(() => {\n const selected = this.selected();\n const eq = this.compareWith();\n const opts = this.options();\n const labels: string[] = [];\n for (const value of selected) {\n const opt = opts.find((o) => eq(o.value() as T, value));\n if (opt) {\n labels.push(opt.resolvedLabel());\n }\n }\n return labels;\n });\n\n /** Convenience: first selected label (for trigger-style displays). */\n readonly selectedLabel = computed<string | null>(() => this.selectedLabels()[0] ?? null);\n\n /** Whether every non-disabled option is selected. */\n readonly isAllSelected = computed<boolean>(() => {\n const opts = this.options();\n const selectable = opts.filter((o) => !o.disabled());\n if (selectable.length === 0) {\n return false;\n }\n const selected = this.selected();\n const eq = this.compareWith();\n return selectable.every((o) => selected.some((s) => eq(s, o.value() as T)));\n });\n\n /** Whether the listbox has no options at all. */\n readonly isEmpty = computed<boolean>(() => this.options().length === 0);\n\n /** Current search term (empty when no `cngxSearchRef` is bound). */\n readonly searchTerm = computed<string>(() => this.cngxSearchRef()?.term() ?? '');\n\n /** Options filtered by `searchTerm` through the search matcher. */\n readonly filteredOptions = computed(() => {\n const term = this.searchTerm();\n const search = this.cngxSearchRef();\n if (term === '' || !search) {\n return this.options();\n }\n const matchFn = search.matchFn();\n return this.options().filter((opt) =>\n matchFn(\n {\n id: opt.id,\n value: opt.value() as T,\n label: opt.resolvedLabel(),\n disabled: opt.disabled(),\n },\n term,\n ),\n );\n });\n\n /** Whether the current search term matches at least one option. */\n readonly hasSearchResults = computed<boolean>(() => this.filteredOptions().length > 0);\n\n /**\n * Select the given value. In single mode, replaces the current selection.\n * In multi mode, adds to the selection if not already present. Values that\n * do not correspond to any option are ignored.\n */\n select(value: T): void {\n if (!this.hasOption(value)) {\n return;\n }\n if (this.multiple()) {\n if (this.isSelected(value)) {\n return;\n }\n this.selectedValues.set([...this.selectedValues(), value]);\n } else {\n this.value.set(value);\n }\n }\n\n /** Remove `value` from the selection. No-op if not selected. */\n deselect(value: T): void {\n const eq = this.compareWith();\n if (this.multiple()) {\n this.selectedValues.set(this.selectedValues().filter((v) => !eq(v, value)));\n } else {\n const current = this.value();\n if (current !== undefined && eq(current, value)) {\n this.value.set(undefined);\n }\n }\n }\n\n /** Flip selection state for `value`. */\n toggle(value: T): void {\n if (this.isSelected(value)) {\n this.deselect(value);\n } else {\n this.select(value);\n }\n }\n\n /** Clear all selections. */\n clear(): void {\n if (this.multiple()) {\n this.selectedValues.set([]);\n } else {\n this.value.set(undefined);\n }\n }\n\n /**\n * Select every non-disabled option. Only valid in multi mode - in single\n * mode this is a no-op.\n */\n selectAll(): void {\n if (!this.multiple()) {\n return;\n }\n const values = this.options()\n .filter((o) => !o.disabled())\n .map((o) => o.value() as T);\n this.selectedValues.set(values);\n }\n\n /** Returns the resolved label for a value, or `null` if no such option. */\n getLabel(value: T): string | null {\n const eq = this.compareWith();\n const opt = this.options().find((o) => eq(o.value() as T, value));\n return opt ? opt.resolvedLabel() : null;\n }\n\n /** Whether `value` is currently part of the selection. */\n isSelected(value: T): boolean {\n const eq = this.compareWith();\n return this.selected().some((v) => eq(v, value));\n }\n\n private hasOption(value: T): boolean {\n const eq = this.compareWith();\n return this.options().some((o) => eq(o.value() as T, value));\n }\n\n private handleActivation(value: unknown): void {\n // externalActivation: AD still emits on `activated`, but the consumer\n // owns the write (e.g. to capture a pre-pick rollback target).\n if (this.externalActivation()) {\n return;\n }\n // AD's Subject is typed `unknown`; the listbox owns the value domain.\n const narrowed = value as T;\n if (this.multiple()) {\n this.toggle(narrowed);\n } else {\n this.select(narrowed);\n }\n }\n}\n","import { Directive, inject, input } from '@angular/core';\n\nimport { type ActiveDescendantItem } from '@cngx/common/a11y';\n\nimport { CngxSearch } from '../keyboard/search.directive';\n\n/**\n * Matcher function used by CngxListboxSearch to filter options.\n *\n * @category common/interactive/listbox\n */\nexport type ListboxMatchFn = (option: ActiveDescendantItem, term: string) => boolean;\n\n/** @internal */\nconst defaultLabelMatch: ListboxMatchFn = (option, term) => {\n if (term === '') {\n return true;\n }\n return option.label.toLowerCase().includes(term.toLowerCase());\n};\n\n/**\n * Search input for a `CngxListbox`.\n *\n * Builds on `CngxSearch` via `hostDirectives` - inherits debounce, term\n * tracking, and clear semantics. Adds a `matchFn` input that listboxes read\n * to filter their options. A listbox that has a `CngxListboxSearch` injected\n * ancestor reads `term` and `matchFn` from it reactively.\n *\n * @category common/interactive/listbox\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/listbox-search.directive.ts\n * @since 0.1.0\n * @relatedTo CngxListbox, CngxSearch, CngxListboxTrigger\n * <example-url>http://localhost:4200/#/common/interactive/listbox/search/command-palette</example-url>\n */\n@Directive({\n selector: 'input[cngxListboxSearch]',\n exportAs: 'cngxListboxSearch',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxSearch,\n inputs: ['debounceMs'],\n },\n ],\n})\nexport class CngxListboxSearch {\n /** Custom matcher. Defaults to case-insensitive substring match on `label`. */\n readonly matchFn = input<ListboxMatchFn>(defaultLabelMatch);\n\n private readonly search = inject(CngxSearch, { self: true, host: true });\n\n /** Current debounced search term (proxied from CngxSearch). */\n readonly term = this.search.term;\n\n /** True when term is non-empty. */\n readonly hasValue = this.search.hasValue;\n\n /** Clears the input. */\n clear(): void {\n this.search.clear();\n }\n}\n","import { computed, Directive, ElementRef, inject, input, output } from '@angular/core';\n\nimport type { CngxListbox } from './listbox.directive';\nimport { CngxListboxSearch } from './listbox-search.directive';\n\n/**\n * Minimum popover contract this trigger expects. Matches `CngxPopover` from\n * `@cngx/common/popover`, but declared structurally here to avoid an\n * entry-point circular dependency (popover already imports from interactive\n * for `CngxCloseButton`).\n */\ninterface PopoverController {\n readonly isVisible: () => boolean;\n show(): void;\n hide(): void;\n}\n\n/**\n * Trigger atom for listbox dropdowns.\n *\n * Pairs a focusable element (button) with a `CngxListbox` and a `CngxPopover`\n * through explicit template references - no ancestor injection, consistent\n * with the `CngxSortHeader` / `CngxSortRef` orthogonal composition pattern.\n *\n * Implements the WAI-ARIA combobox-less listbox trigger keyboard model:\n *\n * | State | Key | Action |\n * |-|-|-|\n * | closed | Enter / Space / ArrowDown | open + highlight first enabled |\n * | closed | ArrowUp | open + highlight last enabled |\n * | open | ArrowDown / ArrowUp / Home / End | delegate to AD primitives |\n * | open | Enter / Space | activate; close if `closeOnSelect()` |\n * | any | Escape | close and restore focus to trigger |\n *\n * @category common/interactive/listbox\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/listbox-trigger.directive.ts\n * @since 0.1.0\n * @relatedTo CngxListbox, CngxListboxSearch, CngxPopoverTrigger, CngxActiveDescendant\n * <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>\n */\n@Directive({\n selector: '[cngxListboxTrigger]',\n exportAs: 'cngxListboxTrigger',\n standalone: true,\n host: {\n '[attr.aria-haspopup]': '\"listbox\"',\n '[attr.aria-expanded]': 'isOpen()',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxListboxTrigger<T = unknown> {\n /** Listbox controlled by this trigger. */\n readonly listbox = input.required<CngxListbox<T>>({ alias: 'cngxListboxTrigger' });\n /** Popover that wraps the listbox panel. */\n readonly popover = input.required<PopoverController>();\n /** Whether activating an option closes the popover. */\n readonly closeOnSelect = input<boolean>(true);\n\n /** Mirrors `CngxPopover.isVisible()` for host binding and external read. */\n readonly isOpen = computed<boolean>(() => this.popover().isVisible());\n\n /**\n * Fires when the user presses Backspace on an empty input. Only\n * emitted when the host element is an `<input>` with a co-located\n * `CngxListboxSearch` - the tag-input convention \"Backspace on empty\n * deletes the trailing chip\" lives at the trigger, so consumers only\n * wire one subscription to own the delete path. On non-input hosts\n * (classic button triggers) the event never fires.\n */\n readonly backspaceOnEmpty = output<void>();\n\n /**\n * When a `CngxListboxSearch` is attached to the same host element, we\n * suppress the printable-character typeahead forwarding: the keystroke\n * must reach the native `<input>` value so the search directive's\n * debounced term picks it up. Without this guard every printable char\n * would be `preventDefault()`'d and the input would never receive text.\n *\n * Injected as optional + self so only co-located search declarations\n * flip the behaviour. Combobox-style triggers (where the focusable\n * element IS an `<input cngxListboxSearch cngxListboxTrigger>`) opt in\n * automatically; classic button triggers keep native-`<select>` parity.\n */\n private readonly search = inject(CngxListboxSearch, { optional: true, self: true });\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected handleKeydown(event: KeyboardEvent): void {\n const key = event.key;\n const ad = this.listbox().ad;\n\n // Tag-input convention: Backspace on an empty co-located search input\n // emits backspaceOnEmpty for the parent composite (CngxCombobox, …)\n // to delete the trailing chip. Consolidated here so the trigger owns\n // the only keydown handler on the element. Non-input triggers skip\n // this path via the co-located-search guard.\n if (key === 'Backspace' && this.search) {\n const host = this.el.nativeElement;\n if (host instanceof HTMLInputElement && host.value === '') {\n this.backspaceOnEmpty.emit();\n // No preventDefault - the consumer's chip-remove path owns DOM impact.\n }\n }\n\n if (!this.isOpen()) {\n if (key === 'ArrowDown' || key === 'Enter' || key === ' ') {\n event.preventDefault();\n this.popover().show();\n ad.highlightFirst();\n return;\n }\n if (key === 'ArrowUp') {\n event.preventDefault();\n this.popover().show();\n ad.highlightLast();\n return;\n }\n return;\n }\n\n switch (key) {\n case 'Escape':\n event.preventDefault();\n this.popover().hide();\n return;\n case 'ArrowDown':\n event.preventDefault();\n ad.highlightNext();\n return;\n case 'ArrowUp':\n event.preventDefault();\n ad.highlightPrev();\n return;\n case 'Home':\n event.preventDefault();\n ad.highlightFirst();\n return;\n case 'End':\n event.preventDefault();\n ad.highlightLast();\n return;\n case 'Enter':\n case ' ':\n if (!ad.activeItem()) {\n return;\n }\n event.preventDefault();\n ad.activateCurrent();\n if (this.closeOnSelect()) {\n this.popover().hide();\n }\n return;\n }\n\n if (this.search) {\n // Let the keystroke reach the <input> for CngxListboxSearch debounce.\n return;\n }\n if (key.length === 1 && /\\S/.exec(key) !== null) {\n // Native <select> parity: printable chars drive AD typeahead while\n // focus stays on the trigger.\n event.preventDefault();\n ad.typeaheadChar(key);\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { inject, Injectable, InjectionToken } from '@angular/core';\n\n/**\n * Public surface every menu-side consumer talks to. The class\n * `CngxMenuAnnouncer` is the default implementation; consumers wire a\n * custom (telemetry-wrapping, locale-aware, test-doubled) one by\n * overriding `CNGX_MENU_ANNOUNCER_FACTORY`.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuAnnouncerLike {\n announce(message: string): void;\n}\n\n/**\n * Factory shape consumed by `CNGX_MENU_ANNOUNCER_FACTORY`. The default\n * factory is {@link createMenuAnnouncer}; override returns any object\n * that satisfies {@link CngxMenuAnnouncerLike}.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuAnnouncerFactory = () => CngxMenuAnnouncerLike;\n\n/**\n * Global polite live-region announcer for the menu family. Maintains a\n * single hidden `aria-live=\"polite\"` element per document and announces\n * menu state transitions (submenu open/close, item activation).\n *\n * Scoped `providedIn: 'root'` so every menu in the app shares the same\n * region; messages are de-duped via a short clear-then-set cycle so\n * screen readers treat repeated identical messages as fresh events.\n *\n * Default factory output for {@link CNGX_MENU_ANNOUNCER_FACTORY}.\n * Consumers obtain the announcer via the factory token, never by\n * `inject(CngxMenuAnnouncer)` directly, so a swap is enterprise-wide.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-announcer.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxMenuTrigger, CngxMenuItemSubmenu\n */\n@Injectable({ providedIn: 'root' })\nexport class CngxMenuAnnouncer implements CngxMenuAnnouncerLike {\n private readonly doc = inject(DOCUMENT);\n private politeElement: HTMLElement | null = null;\n private clearTimer: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * Announce a message via the polite live region. Empty messages are\n * ignored. The region is cleared ~16ms before being repopulated so AT\n * picks up identical-text repeats as a new event.\n */\n announce(message: string): void {\n if (!message) {\n return;\n }\n const element = this.ensureRegion();\n if (!element) {\n return;\n }\n element.textContent = '';\n if (this.clearTimer) {\n clearTimeout(this.clearTimer);\n }\n this.clearTimer = setTimeout(() => {\n element.textContent = message;\n this.clearTimer = null;\n }, 16);\n }\n\n private ensureRegion(): HTMLElement | null {\n if (this.politeElement) {\n return this.politeElement;\n }\n const body = this.doc.body;\n if (!body) {\n return null;\n }\n const el = this.doc.createElement('div');\n el.setAttribute('aria-live', 'polite');\n el.setAttribute('role', 'status');\n el.setAttribute('aria-atomic', 'true');\n el.className = 'cngx-menu-announcer';\n el.style.cssText =\n 'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0';\n body.appendChild(el);\n this.politeElement = el;\n return el;\n }\n}\n\n/**\n * Default factory that hands out the root-scoped {@link CngxMenuAnnouncer}\n * singleton. Consumers wire a custom announcer by replacing\n * {@link CNGX_MENU_ANNOUNCER_FACTORY}.\n *\n * Must run inside an injection context.\n *\n * @category common/interactive/menu\n */\nexport function createMenuAnnouncer(): CngxMenuAnnouncerLike {\n return inject(CngxMenuAnnouncer);\n}\n\n/**\n * DI token carrying the factory that yields the menu family's announcer.\n * Defaults to {@link createMenuAnnouncer} returning the root-scoped\n * {@link CngxMenuAnnouncer} singleton. Override via `providers` /\n * `viewProviders` for telemetry-wrapping, locale-aware, or test-doubled\n * announcers without forking the menu module. Symmetric to\n * `CNGX_COMMIT_ERROR_ANNOUNCER_FACTORY` from the select family.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * {\n * provide: CNGX_MENU_ANNOUNCER_FACTORY,\n * useValue: () => ({ announce: (msg) => myTelemetry.log(msg) }),\n * },\n * ],\n * });\n * ```\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-announcer.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_ANNOUNCER_FACTORY = new InjectionToken<CngxMenuAnnouncerFactory>(\n 'CNGX_MENU_ANNOUNCER_FACTORY',\n { providedIn: 'root', factory: () => createMenuAnnouncer },\n);\n\n/**\n * Resolve the {@link CngxMenuAnnouncerLike} from the current injection\n * scope via the factory token. Must run inside an injection context.\n *\n * @category common/interactive/menu\n */\nexport function injectMenuAnnouncer(): CngxMenuAnnouncerLike {\n return inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n}\n","import {\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n Optional,\n type EnvironmentProviders,\n type Provider,\n SkipSelf,\n} from '@angular/core';\n\n/**\n * Localised UI strings the menu announces or otherwise renders. English by\n * default; consumers override via {@link withAriaLabels}.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuAriaLabels {\n readonly submenuOpened: string;\n readonly submenuClosed: string;\n readonly itemActivated: string;\n readonly itemDisabled: string;\n readonly menuDismissed: string;\n}\n\n/**\n * Resolved configuration consumed by every menu directive in the family.\n * Default values live in {@link DEFAULT_MENU_CONFIG}; override at app\n * scope via {@link provideMenuConfig} or per-component via\n * {@link provideMenuConfigAt}.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuConfig {\n readonly ariaLabels: CngxMenuAriaLabels;\n readonly typeaheadDebounce: number;\n readonly submenuOpenDelay: number;\n readonly submenuCloseDelay: number;\n readonly closeOnSelect: boolean;\n /**\n * Whether `pointerdown` outside both the menu's popover and the\n * trigger host dismisses the menu. Native context menus, browser\n * right-click menus, and major web apps all close on outside click.\n * Default `true`.\n */\n readonly dismissOnOutsideClick: boolean;\n /**\n * Whether window `scroll` while the menu is open dismisses it. Default\n * `false` - consumers with scrollable menu panels (long lists,\n * treeselect-style) often want the menu to remain anchored during\n * scroll. Opt in via {@link withDismissOnScroll}.\n */\n readonly dismissOnScroll: boolean;\n /**\n * Whether the \"context lost\" bundle dismisses the menu. The bundle\n * covers BOTH window `blur` (system notification, OS-native menu\n * overlaying, tab switch) AND document `pointercancel` outside the\n * popover and trigger host (palm rejection on touch devices,\n * gesture cancelled by the browser). The two sources share one\n * toggle by design; consumers needing one without the other replace\n * the entire handler via {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}.\n * Default `true`.\n */\n readonly dismissOnBlur: boolean;\n}\n\n/**\n * Single feature-flag function consumed by {@link provideMenuConfig} and\n * {@link provideCngxMenu}. Carries a hidden `_target` discriminator so\n * future config surfaces (e.g. submenu-only or announcer overrides) can\n * compose through the same `provideCngxMenu` aggregator without breaking\n * the public API of existing `with*` features.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuConfigFeature = ((config: CngxMenuConfig) => CngxMenuConfig) & {\n readonly _target?: 'config';\n};\n\n/**\n * Internal helper that brands a config-mutator function with the `_target`\n * discriminator. Every `with*` feature returns one of these.\n *\n * @internal\n */\nexport function defineMenuConfigFeature(\n fn: (config: CngxMenuConfig) => CngxMenuConfig,\n): CngxMenuConfigFeature {\n return Object.assign(fn, { _target: 'config' as const });\n}\n\n/**\n * Library-default menu configuration. **English-only** - German (or any\n * other locale) is consumer-supplied via `withAriaLabels` per the\n * `feedback_en_default_locale` rule.\n *\n * @category common/interactive/menu\n */\nexport const DEFAULT_MENU_CONFIG: CngxMenuConfig = {\n ariaLabels: {\n submenuOpened: 'Submenu opened',\n submenuClosed: 'Submenu closed',\n itemActivated: 'Item activated',\n itemDisabled: 'Item disabled',\n menuDismissed: 'Menu dismissed',\n },\n typeaheadDebounce: 300,\n submenuOpenDelay: 0,\n submenuCloseDelay: 150,\n closeOnSelect: true,\n dismissOnOutsideClick: true,\n dismissOnScroll: false,\n dismissOnBlur: true,\n};\n\n/**\n * DI token carrying the resolved {@link CngxMenuConfig}. Defaults to\n * {@link DEFAULT_MENU_CONFIG} at root; override via {@link provideMenuConfig}\n * (app-wide) or {@link provideMenuConfigAt} (component scope via\n * `viewProviders`).\n *\n * @category common/interactive/menu\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-config.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_CONFIG = new InjectionToken<CngxMenuConfig>('CngxMenuConfig', {\n providedIn: 'root',\n factory: () => DEFAULT_MENU_CONFIG,\n});\n\n/** @internal */\nfunction applyFeatures(\n base: CngxMenuConfig,\n features: readonly CngxMenuConfigFeature[],\n): CngxMenuConfig {\n return features.reduce((cfg, feature) => feature(cfg), base);\n}\n\n/**\n * Provide a menu configuration at app root. Each feature is a partial\n * override produced by `with*` helpers (see `menu-config-features.ts`).\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideMenuConfig(\n * withAriaLabels({ submenuOpened: 'Untermenü geöffnet' }),\n * withTypeaheadDebounce(500),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/interactive/menu\n */\nexport function provideMenuConfig(...features: CngxMenuConfigFeature[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: CNGX_MENU_CONFIG,\n useFactory: () => applyFeatures(DEFAULT_MENU_CONFIG, features),\n },\n ]);\n}\n\n/**\n * Component-scoped menu configuration override. Pass into a directive or\n * component's `viewProviders`; features merge on top of the parent\n * config (root or an enclosing scope).\n *\n * @category common/interactive/menu\n */\nexport function provideMenuConfigAt(...features: CngxMenuConfigFeature[]): Provider[] {\n return [\n {\n provide: CNGX_MENU_CONFIG,\n useFactory: (parent: CngxMenuConfig | null) =>\n applyFeatures(parent ?? DEFAULT_MENU_CONFIG, features),\n deps: [[new SkipSelf(), new Optional(), CNGX_MENU_CONFIG]],\n },\n ];\n}\n\n/**\n * Resolves the {@link CngxMenuConfig} from the current injection scope.\n * Must run inside an injection context.\n *\n * @category common/interactive/menu\n */\nexport function injectMenuConfig(): CngxMenuConfig {\n return inject(CNGX_MENU_CONFIG);\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\nimport type { CngxActiveDescendant } from '@cngx/common/a11y';\n\nimport type { CngxMenuSubmenuLike } from './menu-submenu.token';\n\n/**\n * Structural contract a `CngxMenu` (or a future menu-bar / nested menu\n * host) exposes to composers. Triggers and submenu directives depend on\n * this interface rather than on the concrete `CngxMenu` class so the\n * coupling stays substitutable.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuHost {\n readonly ad: CngxActiveDescendant;\n /**\n * Submenu companions registered inside this menu's content tree.\n * Empty when no submenu directive is present. Recursive: each entry's\n * `inner` is itself a `CngxMenuHost` with its own (possibly empty)\n * `submenuItems`.\n */\n readonly submenuItems: Signal<readonly CngxMenuSubmenuLike[]>;\n /**\n * Move DOM focus to the menu container element. Triggers that need to\n * transfer focus into the menu after open call this. Consumers must\n * ensure the host element carries a non-negative tabindex; see\n * `CngxMenu.focus()`.\n */\n focus(): void;\n}\n\n/**\n * DI token a menu host provides for sub-component composers (e.g. an\n * inside-the-menu submenu trigger) that resolve the host via `inject()`.\n * Triggers that live on a different element pass a template-ref through\n * an input typed against `CngxMenuHost` instead - DI across element\n * boundaries cannot reach the menu.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_HOST = new InjectionToken<CngxMenuHost>('CNGX_MENU_HOST');\n","import { InjectionToken, type Signal } from '@angular/core';\n\nimport type { CngxMenuHost } from './menu-host.token';\n\n/**\n * Structural contract a `CngxMenuItemSubmenu` (or any submenu-aware\n * companion) exposes so the surrounding menu trigger can drive\n * arrow-right / arrow-left keyboard semantics through a focus-stack\n * model. The trigger looks up a submenu by matching the active item's\n * `id` against this contract's `id`.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuSubmenuLike {\n /** Host element id - matches the surrounding `CngxMenuItem` id. */\n readonly id: string;\n /** Reactive open state, mirrored from the wrapped popover. */\n readonly isOpen: Signal<boolean>;\n /** The submenu's inner menu host (its `CngxMenu` instance). */\n readonly inner: CngxMenuHost;\n open(): void;\n close(): void;\n}\n\n/**\n * DI token a submenu-companion directive provides. The surrounding menu\n * collects every provider via `contentChildren(CNGX_MENU_SUBMENU_ITEM,\n * { descendants: true })` and exposes the array on `CngxMenuHost.submenuItems`.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-submenu.token.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_SUBMENU_ITEM = new InjectionToken<CngxMenuSubmenuLike>(\n 'CNGX_MENU_SUBMENU_ITEM',\n);\n","import {\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n isDevMode,\n untracked,\n} from '@angular/core';\nimport {\n outputFromObservable,\n outputToObservable,\n takeUntilDestroyed,\n} from '@angular/core/rxjs-interop';\n\nimport { CngxActiveDescendant } from '@cngx/common/a11y';\n\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\nimport { CNGX_MENU_HOST, type CngxMenuHost } from './menu-host.token';\nimport { CNGX_MENU_SUBMENU_ITEM, type CngxMenuSubmenuLike } from './menu-submenu.token';\n\nconst warnedFocusHosts = new WeakSet<HTMLElement>();\n\n/**\n * Navigable menu container with WAI-ARIA `role=\"menu\"` semantics.\n *\n * Uses `CngxActiveDescendant` as a `hostDirective` so items rendered with\n * `CngxMenuItem` (or its sub-roles) are tracked automatically. No selection\n * state - menus fire actions through the `itemActivated` output.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenuTrigger, CngxMenuItem, CngxMenuGroup, CngxContextMenuTrigger, CngxActiveDescendant\n * <example-url>http://localhost:4200/#/common/interactive/context-menu/right-click-target-zone</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/trigger/dropdown-menu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenu]',\n exportAs: 'cngxMenu',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxActiveDescendant,\n inputs: ['orientation', 'loop', 'typeahead', 'autoHighlightFirst'],\n },\n ],\n providers: [{ provide: CNGX_MENU_HOST, useExisting: CngxMenu }],\n host: {\n role: 'menu',\n tabindex: '0',\n '[attr.aria-label]': 'label()',\n },\n})\nexport class CngxMenu implements CngxMenuHost {\n /** Accessible label. */\n readonly label = input.required<string>();\n\n /** Underlying `CngxActiveDescendant` - exposed for trigger composition. */\n readonly ad = inject(CngxActiveDescendant, { self: true, host: true });\n\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly menuConfig = injectMenuConfig();\n\n /**\n * Submenu directives registered inside this menu's content tree. Empty\n * when the menu has no submenus. Drives the trigger's focus-stack\n * arrow-right / arrow-left semantics.\n */\n readonly submenuItems = contentChildren<CngxMenuSubmenuLike>(CNGX_MENU_SUBMENU_ITEM, {\n descendants: true,\n });\n\n /** Emits the activated item's value on Enter/Space/click. */\n readonly itemActivated = outputFromObservable(\n outputToObservable(this.ad.activated).pipe(takeUntilDestroyed()),\n );\n\n constructor() {\n outputToObservable(this.ad.activated)\n .pipe(takeUntilDestroyed())\n .subscribe(() => {\n untracked(() => {\n this.announcer.announce(this.menuConfig.ariaLabels.itemActivated);\n });\n });\n }\n\n /**\n * Move DOM focus to the menu container so its host\n * `CngxActiveDescendant` receives keyboard input. Consumers (notably\n * `CngxContextMenuTrigger`) call this after open to transfer focus\n * from the trigger zone into the menu. The host element MUST carry a\n * non-negative `tabindex` for focus to land - the menu's stories use\n * `tabindex=\"0\"` and consumers should mirror that.\n *\n * `preventScroll: true` keeps the popover anchored when focusing into\n * a menu that lives outside the visual viewport edge.\n */\n focus(): void {\n const el = this.elementRef.nativeElement;\n if (isDevMode() && el.tabIndex < 0 && !warnedFocusHosts.has(el)) {\n warnedFocusHosts.add(el);\n console.warn(\n 'CngxMenu.focus(): host element has tabindex < 0; focus() will silently no-op. ' +\n 'Add tabindex=\"0\" to the cngxMenu host so the menu container receives keyboard focus.',\n );\n }\n el.focus({ preventScroll: true });\n }\n}\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { CNGX_AD_ITEM, CngxActiveDescendant, type CngxAdItemHandle } from '@cngx/common/a11y';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\n\n/**\n * A single action menuitem registered with a surrounding `CngxActiveDescendant`.\n * Unlike `CngxOption`, menu items carry no selection state - activation fires\n * the AD's `activated` output and the consumer dispatches the action.\n *\n * Click activates (honouring the disabled state). `pointerenter` highlights\n * without activating, matching native menu behaviour.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxMenuItemCheckbox, CngxMenuItemRadio, CngxMenuItemSubmenu\n * <example-url>http://localhost:4200/#/common/interactive/context-menu/right-click-target-zone</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/trigger/dropdown-menu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuItem]',\n exportAs: 'cngxMenuItem',\n standalone: true,\n providers: [{ provide: CNGX_AD_ITEM, useExisting: CngxMenuItem }],\n host: {\n role: 'menuitem',\n '[id]': 'id',\n '[class.cngx-menu-item--highlighted]': 'isHighlighted()',\n '[class.cngx-menu-item--disabled]': 'disabled()',\n '[attr.aria-disabled]': 'disabled() || null',\n '[attr.tabindex]': '-1',\n '(click)': 'handleClick()',\n '(pointerenter)': 'handlePointerEnter()',\n },\n})\nexport class CngxMenuItem<T = unknown> implements CngxAdItemHandle {\n readonly value = input<T | undefined>(undefined);\n readonly disabled = input<boolean>(false);\n readonly labelInput = input<string | undefined>(undefined, { alias: 'label' });\n\n readonly id = nextUid('cngx-menu-item');\n\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly ad = inject(CngxActiveDescendant, { optional: true });\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly menuConfig = injectMenuConfig();\n\n readonly isHighlighted = computed<boolean>(() => this.ad?.activeId() === this.id);\n\n readonly label = (): string => {\n const explicit = this.labelInput();\n if (explicit) {\n return explicit;\n }\n const el = this.elementRef.nativeElement as HTMLElement;\n return (el.textContent ?? '').trim();\n };\n\n protected handleClick(): void {\n if (this.disabled()) {\n this.announcer.announce(this.menuConfig.ariaLabels.itemDisabled);\n return;\n }\n const ad = this.ad;\n if (!ad) {\n return;\n }\n ad.highlightByValue(this.value());\n ad.activateCurrent();\n }\n\n protected handlePointerEnter(): void {\n if (this.disabled()) {\n return;\n }\n this.ad?.highlightByValue(this.value());\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Marker directive for the leading icon position inside a `[cngxMenuItem]`.\n * Applies `cngx-menu-item__icon` to the host element and defaults the host\n * to `aria-hidden=\"true\"` - the slot is decorative, the item's accessible\n * name comes from the projected label. Consumers needing a screen-reader\n * label on the icon override the default with `[attr.aria-hidden]=\"null\"`.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemLabel, CngxMenuItemSuffix, CngxMenuItemKbd\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemIcon]',\n exportAs: 'cngxMenuItemIcon',\n standalone: true,\n host: {\n class: 'cngx-menu-item__icon',\n 'aria-hidden': 'true',\n },\n})\nexport class CngxMenuItemIcon {}\n\n/**\n * Marker directive for the primary label position inside a\n * `[cngxMenuItem]`. Applies `cngx-menu-item__label`. No `aria-hidden`\n * default - the label is the menu item's accessible name and must reach\n * assistive technology.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemIcon, CngxMenuItemSuffix, CngxMenuItemKbd\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemLabel]',\n exportAs: 'cngxMenuItemLabel',\n standalone: true,\n host: { class: 'cngx-menu-item__label' },\n})\nexport class CngxMenuItemLabel {}\n\n/**\n * Marker directive for a trailing detail slot inside a `[cngxMenuItem]`\n * - secondary text or a status pill that sits between the label and the\n * keyboard-shortcut hint. Applies `cngx-menu-item__suffix` and defaults\n * the host to `aria-hidden=\"true\"`. The slot is supplemental, the\n * primary name belongs to the label. Override with\n * `[attr.aria-hidden]=\"null\"` when the suffix carries meaning AT needs\n * (status text, semantic badge).\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemKbd\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemSuffix]',\n exportAs: 'cngxMenuItemSuffix',\n standalone: true,\n host: {\n class: 'cngx-menu-item__suffix',\n 'aria-hidden': 'true',\n },\n})\nexport class CngxMenuItemSuffix {}\n\n/**\n * Marker directive for the keyboard-shortcut hint position inside a\n * `[cngxMenuItem]`. Applies `cngx-menu-item__kbd` and defaults the host\n * to `aria-hidden=\"true\"` - the visual hint duplicates the underlying\n * accelerator already wired to the consumer's command, AT readout of the\n * hint would just repeat the label. Typically placed on a `<kbd>`.\n * Override with `[attr.aria-hidden]=\"null\"` if the hint is a consumer's\n * primary affordance.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemSuffix\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemKbd]',\n exportAs: 'cngxMenuItemKbd',\n standalone: true,\n host: {\n class: 'cngx-menu-item__kbd',\n 'aria-hidden': 'true',\n },\n})\nexport class CngxMenuItemKbd {}\n","import {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n linkedSignal,\n signal,\n untracked,\n} from '@angular/core';\n\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\nimport type { CngxMenuHost } from './menu-host.token';\nimport { CngxMenuItem } from './menu-item.directive';\nimport { CNGX_MENU_SUBMENU_ITEM, type CngxMenuSubmenuLike } from './menu-submenu.token';\n\n/** See `CngxListboxTrigger` - same structural contract. */\ninterface PopoverController {\n readonly isVisible: () => boolean;\n show(): void;\n hide(): void;\n readonly anchorElement: { set(el: HTMLElement | null): void };\n /**\n * Popover unique id signal - used to compose the `anchor-name` CSS value\n * the browser's CSS Anchor Positioning expects on the anchor element.\n */\n readonly id: () => string;\n /**\n * Popover host element - the submenu directive attaches hover listeners to\n * it so the submenu stays open while the user mouses over its items.\n */\n readonly elementRef: ElementRef<HTMLElement>;\n}\n\n/**\n * Companion directive applied to a `[cngxMenuItem]` that opens a nested\n * submenu. The directive itself does NOT render `role=\"menuitem\"` - that\n * stays on `CngxMenuItem`. Adds `aria-haspopup=\"menu\"` and reactive\n * `aria-expanded`, registers itself with the surrounding menu as a\n * submenu source so the menu trigger can drive arrow-right / arrow-left\n * focus-stack semantics.\n *\n * Two inputs:\n * - `cngxMenuItemSubmenu`: the popover wrapping the submenu.\n * - `submenuMenu`: the inner `CngxMenu` (or any `CngxMenuHost`) the\n * trigger transfers focus to when the submenu opens.\n *\n * The submenu's `<div cngxPopover>` MUST set `[exclusive]=\"false\"` so that\n * opening it does not light-dismiss the parent popover. This is the only\n * extra wiring the consumer needs beyond the two inputs.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-submenu.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenu, CngxMenuTrigger\n * <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemSubmenu]',\n exportAs: 'cngxMenuItemSubmenu',\n standalone: true,\n providers: [{ provide: CNGX_MENU_SUBMENU_ITEM, useExisting: CngxMenuItemSubmenu }],\n host: {\n '[id]': 'id',\n '[attr.aria-haspopup]': '\"menu\"',\n '[attr.aria-expanded]': 'isOpen()',\n '[style.anchor-name]': 'cssAnchorName()',\n '(pointerenter)': 'handleParentEnter()',\n '(pointerleave)': 'handleParentLeave()',\n },\n})\nexport class CngxMenuItemSubmenu implements CngxMenuSubmenuLike {\n /** Popover wrapping the submenu. Required. */\n readonly popover = input.required<PopoverController>({ alias: 'cngxMenuItemSubmenu' });\n\n /** Inner `CngxMenuHost` (the submenu's own `CngxMenu`). Required. */\n readonly submenuMenu = input.required<CngxMenuHost>();\n\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly menuItem = inject(CngxMenuItem, { optional: true, self: true });\n private readonly ownId = nextUid('cngx-menu-submenu');\n\n /**\n * Effective id used by `CngxMenuTrigger.submenuItems().find(s => s.id ===\n * activeId)`. When applied alongside `[cngxMenuItem]` the directive\n * mirrors the sibling's id so the trigger's lookup matches the AD's\n * `activeId`. When applied alone (no sibling), falls back to a fresh\n * `nextUid` - the AD will never highlight this element so the trigger\n * lookup is moot, but the host element still receives a valid id.\n */\n get id(): string {\n return this.menuItem?.id ?? this.ownId;\n }\n\n readonly isOpen = computed<boolean>(() => this.popover().isVisible());\n\n /** CSS Anchor Positioning name - matches the popover's `position-anchor`. */\n protected readonly cssAnchorName = computed(() => `--cngx-pop-${this.popover().id()}`);\n\n get inner(): CngxMenuHost {\n return this.submenuMenu();\n }\n\n open(): void {\n this.popover().anchorElement.set(this.elementRef.nativeElement as HTMLElement);\n if (!this.popover().isVisible()) {\n this.popover().show();\n }\n }\n\n close(): void {\n if (this.popover().isVisible()) {\n this.popover().hide();\n }\n }\n\n // Submenu opens on parent hover; stays open while the pointer is over the\n // parent OR the popover. Closes `submenuCloseDelay` ms after leaving both.\n\n private readonly parentHovered = signal(false);\n private readonly popoverHovered = signal(false);\n private readonly anyHovered = computed(() => this.parentHovered() || this.popoverHovered());\n\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n\n protected handleParentEnter(): void {\n this.parentHovered.set(true);\n }\n\n protected handleParentLeave(): void {\n this.parentHovered.set(false);\n }\n\n private cancelCloseTimer(): void {\n if (this.closeTimer !== null) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private scheduleClose(): void {\n this.cancelCloseTimer();\n const delay = this.menuConfig.submenuCloseDelay;\n if (delay <= 0) {\n this.close();\n return;\n }\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n this.close();\n }, delay);\n }\n\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly menuConfig = injectMenuConfig();\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Transition tracker for `isOpen`. `linkedSignal` carries an explicit\n * structural `equal` so the effect below only fires on a real\n * boolean transition, not on every parent re-eval.\n */\n private readonly transition = linkedSignal<boolean, { current: boolean; previous: boolean }>({\n source: this.isOpen,\n computation: (current, prev) => ({\n current,\n previous: prev?.value.current ?? false,\n }),\n equal: (a, b) => a.current === b.current && a.previous === b.previous,\n });\n\n constructor() {\n effect(() => {\n const { current, previous } = this.transition();\n if (current === previous) {\n return;\n }\n untracked(() => {\n if (current) {\n this.announcer.announce(this.menuConfig.ariaLabels.submenuOpened);\n } else {\n this.announcer.announce(this.menuConfig.ariaLabels.submenuClosed);\n }\n });\n });\n\n effect(() => {\n const hovered = this.anyHovered();\n untracked(() => {\n if (hovered) {\n this.cancelCloseTimer();\n this.open();\n } else if (this.popover().isVisible()) {\n this.scheduleClose();\n }\n });\n });\n\n afterNextRender(() => {\n const popoverEl = this.popover().elementRef.nativeElement;\n const onEnter = (): void => this.popoverHovered.set(true);\n const onLeave = (): void => this.popoverHovered.set(false);\n popoverEl.addEventListener('pointerenter', onEnter);\n popoverEl.addEventListener('pointerleave', onLeave);\n this.destroyRef.onDestroy(() => {\n popoverEl.removeEventListener('pointerenter', onEnter);\n popoverEl.removeEventListener('pointerleave', onLeave);\n this.cancelCloseTimer();\n });\n });\n\n if (isDevMode()) {\n afterNextRender(() => {\n if (this.menuItem === null) {\n console.warn(\n '[cngxMenuItemSubmenu] applied without a sibling [cngxMenuItem] on the same host element. ' +\n 'The surrounding CngxMenuTrigger cannot route ArrowRight / activation to this submenu ' +\n 'because CngxActiveDescendant only highlights CngxMenuItem nodes. ' +\n 'Add [cngxMenuItem] alongside [cngxMenuItemSubmenu] on the same element.',\n );\n }\n warnMissingSubmenuFallbacks(this.popover().elementRef.nativeElement);\n });\n }\n }\n}\n\n/**\n * @internal\n * Tracks which Documents have already warned about a submenu popover missing position-try-fallbacks.\n */\nconst submenuFallbackWarnedDocs = new WeakSet<Document>();\n\n/**\n * @internal - test hook. Resets the per-Document warning suppression so\n * specs can exercise the warning path against a shared jsdom Document.\n * Do not call from production code.\n */\nexport function __resetSubmenuFallbackWarnings(doc: Document): void {\n submenuFallbackWarnedDocs.delete(doc);\n}\n/** @internal */\nfunction warnMissingSubmenuFallbacks(popoverEl: HTMLElement): void {\n const doc = popoverEl.ownerDocument;\n if (submenuFallbackWarnedDocs.has(doc)) {\n return;\n }\n const resolved = getComputedStyle(popoverEl).getPropertyValue('position-try-fallbacks').trim();\n if (resolved !== '') {\n return;\n }\n submenuFallbackWarnedDocs.add(doc);\n console.warn(\n 'CngxMenuItemSubmenu: the companion popover ships without [positionTryFallbacks]. ' +\n 'Submenus that clip the viewport edge will not flip without a try-fallback chain. ' +\n 'Wire the recommended default:\\n\\n' +\n \" import { CNGX_SUBMENU_TRY_FALLBACKS } from '@cngx/common/interactive';\\n\\n\" +\n ' <div cngxPopover [positionTryFallbacks]=\"CNGX_SUBMENU_TRY_FALLBACKS\">\\n' +\n ' <!-- submenu items -->\\n' +\n ' </div>\\n',\n );\n}\n","/**\n * Recommended `position-try-fallbacks` chain for menu submenu popovers.\n *\n * Consumers wire the const on the submenu's `cngxPopover` element:\n * ```html\n * <div cngxPopover [positionTryFallbacks]=\"CNGX_SUBMENU_TRY_FALLBACKS\">\n * <!-- submenu items -->\n * </div>\n * ```\n *\n * The chain matches the\n * `projects/forms/select/shared/select-base.css:759` precedent\n * (`flip-block, flip-inline, flip-block flip-inline`) — `flip-inline`\n * is the dominant submenu clip case (right submenu hits the viewport\n * right edge → flips to the left side of its parent item),\n * `flip-block` covers the vertical case, and the composed form\n * covers diagonal clipping.\n *\n * `CngxMenuItemSubmenu` emits a one-shot dev-mode warning when a\n * submenu popover ships without `positionTryFallbacks` — the const\n * is documented as the canonical opt-in.\n *\n * Typed as a string-literal tuple via `as const` rather than the\n * `PopoverPositionTryFallback` union from `@cngx/common/popover` —\n * the cross-entry-point import would reverse the existing\n * `popover -> interactive` dependency direction and break ng-packagr.\n * Consumers binding the const to `[positionTryFallbacks]` get\n * compile-time type checking from the input's typed signature on the\n * popover side.\n *\n * @category common/interactive/menu\n */\nexport const CNGX_SUBMENU_TRY_FALLBACKS = Object.freeze([\n 'flip-inline',\n 'flip-block',\n 'flip-block flip-inline',\n] as const);\n","import {\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n} from '@angular/core';\n\nimport { CNGX_AD_ITEM, CngxActiveDescendant, type CngxAdItemHandle } from '@cngx/common/a11y';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\n\n/**\n * Checkable menu item (`role=\"menuitemcheckbox\"`). Activation toggles\n * `checked` and emits `checkedChange`. Unlike `CngxMenuItem`, the item\n * carries its own selection state.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-checkbox.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemRadio, CngxMenu\n * <example-url>http://localhost:4200/#/common/interactive/menu/checkable/text-formatting-menu</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemCheckbox]',\n exportAs: 'cngxMenuItemCheckbox',\n standalone: true,\n providers: [{ provide: CNGX_AD_ITEM, useExisting: CngxMenuItemCheckbox }],\n host: {\n role: 'menuitemcheckbox',\n '[id]': 'id',\n '[attr.aria-checked]': 'checked()',\n '[attr.aria-disabled]': 'disabled() || null',\n '[class.cngx-menu-item--highlighted]': 'isHighlighted()',\n '[class.cngx-menu-item--disabled]': 'disabled()',\n '[class.cngx-menu-item--checked]': 'checked()',\n '[attr.tabindex]': '-1',\n '(click)': 'handleClick()',\n '(pointerenter)': 'handlePointerEnter()',\n },\n})\nexport class CngxMenuItemCheckbox<T = unknown> implements CngxAdItemHandle {\n readonly value = input<T | undefined>(undefined);\n readonly disabled = input<boolean>(false);\n readonly labelInput = input<string | undefined>(undefined, { alias: 'label' });\n readonly checked = model<boolean>(false);\n\n readonly id = nextUid('cngx-menu-item');\n\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly ad = inject(CngxActiveDescendant, { optional: true });\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly menuConfig = injectMenuConfig();\n\n readonly isHighlighted = computed<boolean>(() => this.ad?.activeId() === this.id);\n\n readonly label = (): string => {\n const explicit = this.labelInput();\n if (explicit) {\n return explicit;\n }\n const el = this.elementRef.nativeElement as HTMLElement;\n return (el.textContent ?? '').trim();\n };\n\n protected handleClick(): void {\n if (this.disabled()) {\n this.announcer.announce(this.menuConfig.ariaLabels.itemDisabled);\n return;\n }\n const ad = this.ad;\n if (!ad) {\n return;\n }\n ad.highlightByValue(this.value());\n this.checked.update((c) => !c);\n ad.activateCurrent();\n }\n\n protected handlePointerEnter(): void {\n if (this.disabled()) {\n return;\n }\n this.ad?.highlightByValue(this.value());\n }\n}\n","import { InjectionToken, type ModelSignal, type Signal } from '@angular/core';\n\n/**\n * Selection contract a radio-grouping menu host exposes to its\n * `CngxMenuItemRadio` children. Children read `selectedValue()` to compute\n * `aria-checked` and call `select(value)` to update on click; the host owns\n * the writable signal so consumers two-way bind through it.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuRadioGroup<T> {\n readonly selectedValue: ModelSignal<T | undefined>;\n readonly name: Signal<string | undefined>;\n select(value: T): void;\n}\n\n/**\n * Factory shape - pass into a custom DI provider to wrap selection in\n * telemetry, server-sync, or audit logging without forking `CngxMenuGroup`.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuRadioGroupFactory = <T>(deps: {\n readonly selectedValue: ModelSignal<T | undefined>;\n readonly name: Signal<string | undefined>;\n}) => CngxMenuRadioGroup<T>;\n\n/**\n * Pure factory wiring a {@link CngxMenuRadioGroup} from already-created\n * signals. `CngxMenuGroup` implements the contract directly; this factory\n * exists for hand-built menu hosts that do not declare a directive but\n * still need to provide `CNGX_MENU_RADIO_GROUP`.\n *\n * @category common/interactive/menu\n */\nexport const createMenuRadioController: CngxMenuRadioGroupFactory = ({ selectedValue, name }) => ({\n selectedValue,\n name,\n select(value) {\n selectedValue.set(value);\n },\n});\n\n/**\n * DI token a radio-grouping menu host provides for `CngxMenuItemRadio` to\n * resolve. Items inject with `{ optional: true }` so a radio item rendered\n * outside any group still works (it just reports `aria-checked=\"false\"`).\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-radio-controller.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_RADIO_GROUP = new InjectionToken<CngxMenuRadioGroup<unknown>>(\n 'CNGX_MENU_RADIO_GROUP',\n);\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { CNGX_AD_ITEM, CngxActiveDescendant, type CngxAdItemHandle } from '@cngx/common/a11y';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\nimport { CNGX_MENU_RADIO_GROUP } from './menu-radio-controller';\n\n/**\n * Radio-style menu item (`role=\"menuitemradio\"`). Mutual exclusion is scoped\n * to the enclosing `CngxMenuGroup` - only one radio per group is checked at\n * a time.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-radio.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemCheckbox, CngxMenuGroup\n * <example-url>http://localhost:4200/#/common/interactive/menu/checkable/text-formatting-menu</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemRadio]',\n exportAs: 'cngxMenuItemRadio',\n standalone: true,\n providers: [{ provide: CNGX_AD_ITEM, useExisting: CngxMenuItemRadio }],\n host: {\n role: 'menuitemradio',\n '[id]': 'id',\n '[attr.aria-checked]': 'checked()',\n '[attr.aria-disabled]': 'disabled() || null',\n '[class.cngx-menu-item--highlighted]': 'isHighlighted()',\n '[class.cngx-menu-item--disabled]': 'disabled()',\n '[class.cngx-menu-item--checked]': 'checked()',\n '[attr.tabindex]': '-1',\n '(click)': 'handleClick()',\n '(pointerenter)': 'handlePointerEnter()',\n },\n})\nexport class CngxMenuItemRadio<T = unknown> implements CngxAdItemHandle {\n readonly value = input.required<T>();\n readonly disabled = input<boolean>(false);\n readonly labelInput = input<string | undefined>(undefined, { alias: 'label' });\n\n readonly id = nextUid('cngx-menu-item');\n\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly ad = inject(CngxActiveDescendant, { optional: true });\n private readonly group = inject(CNGX_MENU_RADIO_GROUP, { optional: true });\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly menuConfig = injectMenuConfig();\n\n readonly isHighlighted = computed<boolean>(() => this.ad?.activeId() === this.id);\n\n /** Whether this radio is the currently selected value in its group. */\n readonly checked = computed<boolean>(() => {\n const group = this.group;\n if (!group) {\n return false;\n }\n return Object.is(group.selectedValue(), this.value());\n });\n\n readonly label = (): string => {\n const explicit = this.labelInput();\n if (explicit) {\n return explicit;\n }\n const el = this.elementRef.nativeElement as HTMLElement;\n return (el.textContent ?? '').trim();\n };\n\n protected handleClick(): void {\n if (this.disabled()) {\n this.announcer.announce(this.menuConfig.ariaLabels.itemDisabled);\n return;\n }\n const ad = this.ad;\n if (!ad) {\n return;\n }\n ad.highlightByValue(this.value());\n this.group?.select(this.value());\n ad.activateCurrent();\n }\n\n protected handlePointerEnter(): void {\n if (this.disabled()) {\n return;\n }\n this.ad?.highlightByValue(this.value());\n }\n}\n","import { Directive, input, model } from '@angular/core';\n\nimport { CNGX_MENU_RADIO_GROUP, type CngxMenuRadioGroup } from './menu-radio-controller';\n\n/**\n * Logical grouping for menu items. Renders `role=\"group\"` with an accessible\n * label. For radio groups, the host owns the selected value and exposes it\n * to enclosed `CngxMenuItemRadio` children through the\n * `CNGX_MENU_RADIO_GROUP` contract.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-group.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxMenuItemRadio, CngxMenuItem\n * <example-url>http://localhost:4200/#/common/interactive/menu/checkable/text-formatting-menu</example-url>\n */\n@Directive({\n selector: '[cngxMenuGroup]',\n exportAs: 'cngxMenuGroup',\n standalone: true,\n providers: [{ provide: CNGX_MENU_RADIO_GROUP, useExisting: CngxMenuGroup }],\n host: {\n role: 'group',\n '[attr.aria-label]': 'label()',\n },\n})\nexport class CngxMenuGroup implements CngxMenuRadioGroup<unknown> {\n /** Accessible group label. */\n readonly label = input.required<string>();\n\n /** Optional name for mutual-exclusion scope in radio-item groups. */\n readonly name = input<string | undefined>(undefined);\n\n /** Currently selected radio value within this group. Two-way bindable. */\n readonly selectedValue = model<unknown>(undefined);\n\n select(value: unknown): void {\n this.selectedValue.set(value);\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Visual + semantic separator inside a `CngxMenu`. Renders `role=\"separator\"`\n * with `aria-orientation=\"horizontal\"`. Does **not** register `CNGX_AD_ITEM`,\n * so the surrounding `CngxActiveDescendant` skips it during arrow-key\n * navigation and typeahead - required for action-menu and dropdown-menu\n * patterns where separators visually group items but are not selectable.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-separator.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxMenuItem, CngxMenuGroup\n * <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuSeparator]',\n exportAs: 'cngxMenuSeparator',\n standalone: true,\n host: {\n role: 'separator',\n 'aria-orientation': 'horizontal',\n },\n})\nexport class CngxMenuSeparator {}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Outcome dispatched by a {@link CngxMenuNavStrategy} step. Consumers (the\n * menu trigger or a future menubar directive) interpret the action: fire\n * the matching side effect (open/close a popover, hand focus to a parent\n * menu) and `event.preventDefault()` for anything non-`noop`.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuNavAction =\n | { readonly kind: 'open-submenu'; readonly id: string }\n | { readonly kind: 'close-submenu' }\n | { readonly kind: 'move-to-parent' }\n | { readonly kind: 'noop' };\n\n/**\n * Context passed to every strategy step. `activeId` is the current\n * `CngxActiveDescendant.activeId()` snapshot at key-press time;\n * `hasSubmenu`/`submenuOpen` describe whatever submenu state the consumer\n * tracks for the active item.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuNavContext {\n readonly activeId: string | null;\n readonly hasSubmenu: boolean;\n readonly submenuOpen: boolean;\n}\n\n/**\n * Pluggable keyboard policy for ArrowRight/ArrowLeft inside a menu or\n * menubar. The default ({@link createW3CMenuStrategy}) matches the W3C APG\n * menu pattern; consumers needing alternative semantics (e.g. \"ArrowRight\n * always opens, never traverses into the submenu\") register their own\n * via `CNGX_MENU_NAV_STRATEGY`.\n *\n * Strategy steps are pure decisions - they do not call popover.show() or\n * touch any signal directly. The directive that consults the strategy\n * acts on the returned action.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuNavStrategy {\n onArrowRight(ctx: CngxMenuNavContext): CngxMenuNavAction;\n onArrowLeft(ctx: CngxMenuNavContext): CngxMenuNavAction;\n}\n\n/** @internal */\nconst NOOP: CngxMenuNavAction = { kind: 'noop' };\n\n/**\n * Default W3C APG menu keyboard policy:\n *\n * - **ArrowRight** on a submenu parent that is currently closed →\n * `open-submenu`. On an already-open submenu or a leaf item → `noop`\n * (item-level navigation inside the open submenu is owned by the\n * submenu's own active-descendant).\n * - **ArrowLeft** when a submenu is open at the current level →\n * `close-submenu`. Otherwise → `move-to-parent` (an enclosing menubar\n * interprets that; a standalone menu trigger treats it as noop).\n *\n * @category common/interactive/menu\n */\nexport function createW3CMenuStrategy(): CngxMenuNavStrategy {\n return {\n onArrowRight(ctx) {\n if (!ctx.activeId || !ctx.hasSubmenu || ctx.submenuOpen) {\n return NOOP;\n }\n return { kind: 'open-submenu', id: ctx.activeId };\n },\n onArrowLeft(ctx) {\n if (ctx.submenuOpen) {\n return { kind: 'close-submenu' };\n }\n return { kind: 'move-to-parent' };\n },\n };\n}\n\n/**\n * DI token carrying the {@link CngxMenuNavStrategy} that menu/menubar\n * directives consult on every ArrowLeft/ArrowRight press. Defaults to\n * {@link createW3CMenuStrategy}; override via `providers` /\n * `viewProviders` for alternative keyboard semantics.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-nav-strategy.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_NAV_STRATEGY = new InjectionToken<CngxMenuNavStrategy>(\n 'CngxMenuNavStrategy',\n { providedIn: 'root', factory: createW3CMenuStrategy },\n);\n","import { defineMenuConfigFeature, type CngxMenuAriaLabels, type CngxMenuConfigFeature } from './menu-config';\n\n/**\n * Override one or more ARIA strings (English defaults). Unset keys keep\n * their default value, so consumers can supply only the locale strings\n * they care about.\n *\n * @category common/interactive/menu\n */\nexport function withAriaLabels(partial: Partial<CngxMenuAriaLabels>): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({\n ...cfg,\n ariaLabels: { ...cfg.ariaLabels, ...partial },\n }));\n}\n\n/**\n * Override the typeahead debounce window (milliseconds) for menu\n * navigation. Default: `300`.\n *\n * @category common/interactive/menu\n */\nexport function withTypeaheadDebounce(ms: number): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, typeaheadDebounce: ms }));\n}\n\n/**\n * Override the delay between hovering a submenu parent and opening the\n * submenu (milliseconds). Default: `0` (open immediately on activation).\n * Reserved for hover-driven menubar implementations.\n *\n * @category common/interactive/menu\n */\nexport function withSubmenuOpenDelay(ms: number): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, submenuOpenDelay: ms }));\n}\n\n/**\n * Override the delay between leaving a submenu parent and closing the\n * submenu (milliseconds). Default: `0`. Reserved for hover-driven\n * menubar implementations.\n *\n * @category common/interactive/menu\n */\nexport function withSubmenuCloseDelay(ms: number): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, submenuCloseDelay: ms }));\n}\n\n/**\n * Whether activating a leaf item closes the menu. Default: `true`\n * (menu semantics — distinct from listbox/combobox which stay open).\n *\n * @category common/interactive/menu\n */\nexport function withCloseOnSelect(close: boolean): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, closeOnSelect: close }));\n}\n\n/**\n * Whether `pointerdown` outside the menu's popover and the trigger host\n * dismisses the menu. Default: `true`. Pass `false` for ESC-only\n * semantics (e.g. a tutorial overlay that wants to keep the menu open\n * while the user clicks through other UI).\n *\n * @category common/interactive/menu\n */\nexport function withDismissOnOutsideClick(dismiss: boolean): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, dismissOnOutsideClick: dismiss }));\n}\n\n/**\n * Whether window `scroll` while the menu is open dismisses it. Default:\n * `false`. Opt in when the menu should follow native context-menu\n * behaviour and close as soon as the page scrolls. Scroll-dismiss\n * listens to `window` only - the nearest scrollable ancestor is not\n * traversed.\n *\n * @category common/interactive/menu\n */\nexport function withDismissOnScroll(dismiss: boolean): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, dismissOnScroll: dismiss }));\n}\n\n/**\n * Whether the \"context lost\" bundle dismisses the menu. The bundle\n * covers BOTH window `blur` (system notification, OS-native menu\n * overlaying, tab switch) AND document `pointercancel` outside the\n * popover and trigger host (palm rejection on touch, gesture cancelled\n * by the browser). The two sources share one toggle because consumers\n * who want one rarely want the other off; consumers needing one\n * without the other replace the entire handler via\n * {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}. Set to `false` to keep\n * both listeners off; `lastDismissSource` will then never report\n * `'blur'` or `'pointer-cancel'`.\n *\n * Default: `true`.\n *\n * @category common/interactive/menu\n */\nexport function withDismissOnBlur(dismiss: boolean): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, dismissOnBlur: dismiss }));\n}\n","import { InjectionToken, signal, type Signal } from '@angular/core';\n\nimport type { CngxMenuConfig } from './menu-config';\n\n/**\n * Structural contract the menu dismiss handler reads from the popover.\n * Mirrors the inline `PopoverController` shape in\n * `menu-trigger.directive.ts` / `context-menu-trigger.directive.ts` to keep\n * `@cngx/common/interactive` free of `@cngx/common/popover` imports - the\n * popover module already depends on this entry-point and the reverse\n * import would close a circular ng-packagr dependency.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuDismissPopoverRef {\n readonly isVisible: () => boolean;\n hide(): void;\n readonly elementRef: { readonly nativeElement: HTMLElement };\n}\n\n/**\n * Identifier for the dismissal path that fired most recently.\n *\n * - `outside-click` - pointerdown outside both the popover and the trigger\n * host.\n * - `scroll` - window scroll while the menu is open.\n * - `blur` - window blur (system notification, OS-native context menu\n * overlaying the cngx menu).\n * - `pointer-cancel` - document pointercancel originating OUTSIDE the\n * popover and host (palm rejection from outside the menu, gesture\n * cancelled by the browser). In-menu palm rejections do not dismiss.\n * - `escape` - document `keydown` matching the `Escape` key while the\n * popover is visible. Detected by the factory's capture-phase keydown\n * listener so the source is recorded regardless of where DOM focus\n * sits (trigger button, menu container, or elsewhere).\n *\n * **Intent, not effect.** The factory records `'escape'` synchronously\n * on the keystroke and does NOT call `popover.hide()`. Whether the\n * menu actually closes is owned by `CngxPopover.closeOnEscape`:\n * consumers who set `[closeOnEscape]=\"false\"` keep their menu open\n * even though `lastSource` reports `'escape'`. The other sources\n * (`outside-click`, `scroll`, `blur`, `pointer-cancel`) call\n * `popover.hide()` themselves and so always coincide with an actual\n * close - `'escape'` is the one source where intent and effect can\n * diverge.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuDismissSource =\n | 'outside-click'\n | 'scroll'\n | 'blur'\n | 'pointer-cancel'\n | 'escape';\n\n/**\n * Options for {@link createMenuDismissHandler}.\n *\n * Each boolean toggles its listener (pair) independently. When\n * `dismissOnBlur` is `true`, both window `blur` and document\n * `pointercancel` listeners install together - they represent the same\n * \"context lost\" semantic and consumers who want one rarely want the\n * other off.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuDismissHandlerOptions {\n /** Popover whose `.hide()` runs when any dismissal source fires. */\n readonly popover: CngxMenuDismissPopoverRef;\n /**\n * Trigger host element. Pointerdown / pointercancel events whose\n * target lies inside this element are NOT treated as dismissal -\n * interactions with the trigger itself should never close the menu\n * it just opened.\n */\n readonly hostElement: HTMLElement;\n /** Install document `pointerdown` outside-click listener. */\n readonly dismissOnOutsideClick: boolean;\n /** Install window `scroll` listener (capture, passive). */\n readonly dismissOnScroll: boolean;\n /**\n * Install window `blur` AND document `pointercancel` listeners.\n * Bundled together because both signal context loss. `pointercancel`\n * events whose target lies inside the popover or trigger host are\n * filtered out (in-menu palm rejection must not dismiss).\n */\n readonly dismissOnBlur: boolean;\n /**\n * Synchronous callback invoked from the DOM event handler whenever a\n * dismissal source fires. Runs AFTER `popover.hide()` so consumers\n * observing the source see the post-close state. Used by\n * {@link createMenuTriggerDismissBinding} to write a reactive\n * `lastSource` signal from outside any Angular `effect()` context.\n */\n readonly onDismiss?: (source: CngxMenuDismissSource) => void;\n /**\n * Sources whose listeners should NOT install even when their toggle\n * is `true`. Lets a consumer keep `dismissOnBlur: true` but skip the\n * bundled `pointer-cancel` listener (or vice versa) with a one-line\n * factory wrapper:\n *\n * ```ts\n * providers: [{\n * provide: CNGX_MENU_DISMISS_HANDLER_FACTORY,\n * useValue: (opts) => createMenuDismissHandler({\n * ...opts,\n * skipSources: new Set(['pointer-cancel']),\n * }),\n * }]\n * ```\n *\n * `'escape'` may be skipped too; the popover's global Escape listener\n * still owns the close path, so skipping only stops the source from\n * being recorded on `lastSource`.\n */\n readonly skipSources?: ReadonlySet<CngxMenuDismissSource>;\n}\n\n/**\n * Handler returned by {@link createMenuDismissHandler}. Call `attach()`\n * once per menu open; invoke the returned teardown on close.\n *\n * Source observation runs through\n * {@link CngxMenuDismissHandlerOptions.onDismiss}; the handler exposes\n * no reactive state of its own so the trigger directive can store it as\n * a plain field rather than a signal (avoids a signal write inside the\n * `isOpen` effect).\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuDismissHandler {\n /**\n * Install the listeners enabled by the options. Returns a teardown\n * closure that removes every installed listener. Each `attach()` must\n * be balanced by exactly one teardown call.\n */\n attach(): () => void;\n}\n\n/**\n * Factory signature for {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuDismissHandlerFactory = (\n opts: CngxMenuDismissHandlerOptions,\n) => CngxMenuDismissHandler;\n\n/**\n * Default factory. Pure closure over `opts` - no Angular DI. Mirrors the\n * shape of `@cngx/forms/select`'s `createDismissHandler` so future\n * cross-family consolidation has a clean target.\n *\n * Override via {@link CNGX_MENU_DISMISS_HANDLER_FACTORY} for\n * telemetry-wrapped or test-doubled dismissal.\n *\n * @category common/interactive/menu\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/dismiss-handler.ts\n * @since 0.1.0\n */\nexport function createMenuDismissHandler(\n opts: CngxMenuDismissHandlerOptions,\n): CngxMenuDismissHandler {\n const isInsidePopoverOrHost = (target: EventTarget | null): boolean => {\n if (!(target instanceof Node)) {\n return false;\n }\n return (\n opts.popover.elementRef.nativeElement.contains(target) ||\n opts.hostElement.contains(target)\n );\n };\n\n const fire = (source: CngxMenuDismissSource): void => {\n if (!opts.popover.isVisible()) {\n return;\n }\n opts.popover.hide();\n opts.onDismiss?.(source);\n };\n\n const attach = (): (() => void) => {\n const teardowns: (() => void)[] = [];\n const doc = opts.hostElement.ownerDocument;\n const win = doc.defaultView;\n const skip = opts.skipSources;\n\n // Escape detection. Records the source without calling popover.hide() -\n // `CngxPopover.closeOnEscape` owns the actual close decision, so a\n // consumer that disables escape-close on the popover still sees the\n // user's intent surface on `lastSource`. Installed unconditionally\n // because Escape is the canonical menu-dismissal key (WAI-ARIA APG\n // Menu Pattern); skip only via `opts.skipSources`.\n if (!skip?.has('escape')) {\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key !== 'Escape') {\n return;\n }\n if (!opts.popover.isVisible()) {\n return;\n }\n opts.onDismiss?.('escape');\n };\n doc.addEventListener('keydown', onKeyDown, true);\n teardowns.push(() => {\n doc.removeEventListener('keydown', onKeyDown, true);\n });\n }\n\n if (opts.dismissOnOutsideClick && !skip?.has('outside-click')) {\n const onPointerDown = (event: PointerEvent): void => {\n if (!opts.popover.isVisible()) {\n return;\n }\n if (isInsidePopoverOrHost(event.target)) {\n return;\n }\n fire('outside-click');\n };\n doc.addEventListener('pointerdown', onPointerDown, true);\n teardowns.push(() => {\n doc.removeEventListener('pointerdown', onPointerDown, true);\n });\n }\n\n if (opts.dismissOnScroll && !skip?.has('scroll') && win) {\n const onScroll = (): void => fire('scroll');\n win.addEventListener('scroll', onScroll, { capture: true, passive: true });\n teardowns.push(() => {\n win.removeEventListener('scroll', onScroll, { capture: true });\n });\n }\n\n if (opts.dismissOnBlur) {\n if (win && !skip?.has('blur')) {\n const onBlur = (): void => fire('blur');\n win.addEventListener('blur', onBlur);\n teardowns.push(() => {\n win.removeEventListener('blur', onBlur);\n });\n }\n // Filter pointercancel against the popover and host so in-menu palm\n // rejection (touch noise inside the open menu) does not dismiss.\n // Outside-targeted cancellation still fires - matches the\n // \"context lost\" semantics the blur listener covers.\n if (!skip?.has('pointer-cancel')) {\n const onPointerCancel = (event: PointerEvent): void => {\n if (!opts.popover.isVisible()) {\n return;\n }\n if (isInsidePopoverOrHost(event.target)) {\n return;\n }\n fire('pointer-cancel');\n };\n doc.addEventListener('pointercancel', onPointerCancel);\n teardowns.push(() => {\n doc.removeEventListener('pointercancel', onPointerCancel);\n });\n }\n }\n\n return () => {\n for (const t of teardowns) {\n t();\n }\n };\n };\n\n return { attach };\n}\n\n/**\n * Factory token for {@link CngxMenuDismissHandler}. Default\n * {@link createMenuDismissHandler}. Override via\n * `{ provide: CNGX_MENU_DISMISS_HANDLER_FACTORY, useFactory: () => myHandler }`\n * at app root for telemetry instrumentation, or in `viewProviders` for a\n * single feature scope.\n *\n * @category common/interactive/menu\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/dismiss-handler.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_DISMISS_HANDLER_FACTORY = new InjectionToken<CngxMenuDismissHandlerFactory>(\n 'CngxMenuDismissHandlerFactory',\n {\n providedIn: 'root',\n factory: () => createMenuDismissHandler,\n },\n);\n\n/**\n * Options for {@link createMenuTriggerDismissBinding}. The popover is\n * passed as a thunk because trigger directives resolve their popover\n * input lazily (after Angular binds inputs) - the binding cannot capture\n * the concrete reference at construction time.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuTriggerDismissBindingOptions {\n readonly popover: () => CngxMenuDismissPopoverRef;\n readonly hostElement: HTMLElement;\n readonly menuConfig: CngxMenuConfig;\n readonly factory: CngxMenuDismissHandlerFactory;\n /**\n * Synchronous notification invoked from the DOM event handler after\n * the binding's `lastSource` signal is updated. Trigger directives\n * use it to call `CngxMenuAnnouncer.announce(...)` so screen readers\n * hear which path closed the menu. Runs from the same call stack as\n * the source DOM event - safe for signal reads.\n */\n readonly onDismiss?: (source: CngxMenuDismissSource) => void;\n}\n\n/**\n * Trigger-side dismiss lifecycle. Owns the reactive `lastSource` signal\n * and the attach/detach pair both trigger directives invoke from their\n * `isOpen` effect. Extracted so `CngxMenuTrigger` and\n * `CngxContextMenuTrigger` share the same wiring without forking it.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuTriggerDismissBinding {\n /**\n * Resolve the popover thunk, instantiate the handler on first call,\n * and install its listeners. Idempotent within a single open cycle.\n */\n attach(): void;\n /** Remove the listeners installed by the last `attach()`. Idempotent. */\n detach(): void;\n /**\n * The dismissal source that closed the menu most recently. `null`\n * before the first close. Read by templates / telemetry sinks.\n */\n readonly lastSource: Signal<CngxMenuDismissSource | null>;\n}\n\n/**\n * Build the dismiss lifecycle for a menu-bearing trigger directive.\n * Lazily instantiates the handler on first `attach()` so the trigger's\n * popover input is bound before the factory reads it. The returned\n * `lastSource` signal is owned by this binding - the factory writes it\n * via its `onDismiss` callback, which runs from DOM event handlers\n * (never inside an Angular `effect()`).\n *\n * @category common/interactive/menu\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/dismiss-handler.ts\n * @since 0.1.0\n */\nexport function createMenuTriggerDismissBinding(\n opts: CngxMenuTriggerDismissBindingOptions,\n): CngxMenuTriggerDismissBinding {\n const _lastSource = signal<CngxMenuDismissSource | null>(null);\n let handler: CngxMenuDismissHandler | null = null;\n let teardown: (() => void) | null = null;\n\n const attach = (): void => {\n if (teardown !== null) {\n return;\n }\n // Stable-input assumption: the popover thunk and menuConfig snapshot\n // resolve once at first open and are reused for the directive's\n // lifetime. Trigger directives bind popover via input.required (stable\n // post-mount) and read menuConfig once from injectMenuConfig(); a\n // future config-swap path would need to invalidate `handler` here.\n handler ??= opts.factory({\n popover: opts.popover(),\n hostElement: opts.hostElement,\n dismissOnOutsideClick: opts.menuConfig.dismissOnOutsideClick,\n dismissOnScroll: opts.menuConfig.dismissOnScroll,\n dismissOnBlur: opts.menuConfig.dismissOnBlur,\n onDismiss: (source) => {\n _lastSource.set(source);\n opts.onDismiss?.(source);\n },\n });\n teardown = handler.attach();\n };\n\n const detach = (): void => {\n if (teardown === null) {\n return;\n }\n teardown();\n teardown = null;\n };\n\n return {\n attach,\n detach,\n lastSource: _lastSource.asReadonly(),\n };\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n untracked,\n} from '@angular/core';\n\nimport {\n CNGX_MENU_DISMISS_HANDLER_FACTORY,\n createMenuTriggerDismissBinding,\n type CngxMenuDismissPopoverRef,\n} from './dismiss-handler';\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\nimport type { CngxMenuHost } from './menu-host.token';\n\n/** See `CngxListboxTrigger` - same structural contract. */\ninterface PopoverController extends CngxMenuDismissPopoverRef {\n show(): void;\n readonly anchorElement: { set(el: HTMLElement | null): void };\n /**\n * Popover unique id signal - used to compose the `anchor-name` CSS value\n * the browser's CSS Anchor Positioning expects on the anchor element.\n */\n readonly id: () => string;\n}\n\n/**\n * Opens a `CngxMenu`-bearing popover at pointer coordinates in response to\n * `contextmenu` (right-click) or `Shift+F10` (keyboard equivalent).\n *\n * Two inputs:\n * - `cngxContextMenuTrigger`: the `CngxMenu` (or any `CngxMenuHost`) the\n * popover wraps.\n * - `popover`: the `CngxPopover` panel containing the menu. Must be marked\n * `[exclusive]=\"true\"` (default) so that opening this menu light-dismisses\n * any other popover.\n *\n * Anchoring uses a transient zero-size DOM element positioned at the\n * pointer coords, set on the popover's `anchorElement` signal - virtual\n * `getBoundingClientRect` objects are not yet supported as anchors, so\n * the transient div is the workaround.\n *\n * Touch-driven opening via long-press is deliberately out of scope for the\n * initial commit; consumers can compose `CngxLongPress` against the same\n * popover anchor pattern as a follow-up.\n *\n * ### Dismissal\n *\n * Four sources close the menu by default: `Escape`, `pointerdown` outside\n * both the popover and the trigger host, window `blur`, and document\n * `pointercancel`. Window `scroll` is opt-in via\n * {@link withDismissOnScroll}. Touch users get backdrop dismissal through\n * the same `pointerdown` listener - no ESC dependency. The dismissal\n * source that fired most recently is readable through\n * {@link lastDismissSource}.\n *\n * Override individual sources at app root with `withDismissOnOutsideClick`,\n * `withDismissOnScroll`, `withDismissOnBlur`, or swap the whole handler via\n * {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/context-menu-trigger.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxMenuTrigger, CngxPopover\n * <example-url>http://localhost:4200/#/common/interactive/context-menu/right-click-target-zone</example-url>\n */\n@Directive({\n selector: '[cngxContextMenuTrigger]',\n exportAs: 'cngxContextMenuTrigger',\n standalone: true,\n host: {\n '[attr.aria-haspopup]': '\"menu\"',\n '[attr.aria-expanded]': 'isOpen()',\n '(contextmenu)': 'handleContextMenu($event)',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxContextMenuTrigger {\n /** Menu controlled by this trigger. */\n readonly menu = input.required<CngxMenuHost>({ alias: 'cngxContextMenuTrigger' });\n /** Popover that wraps the menu panel. */\n readonly popover = input.required<PopoverController>();\n\n /** Mirrors `popover.isVisible()`. */\n readonly isOpen = computed<boolean>(() => this.popover().isVisible());\n\n private readonly doc = inject(DOCUMENT);\n private readonly hostElRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly menuConfig = injectMenuConfig();\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly dismissBinding = createMenuTriggerDismissBinding({\n popover: () => this.popover(),\n hostElement: this.hostElRef.nativeElement,\n menuConfig: this.menuConfig,\n factory: inject(CNGX_MENU_DISMISS_HANDLER_FACTORY),\n onDismiss: () => this.announcer.announce(this.menuConfig.ariaLabels.menuDismissed),\n });\n private virtualAnchor: HTMLElement | null = null;\n private savedFocus: HTMLElement | null = null;\n\n /**\n * The dismissal source that closed the menu most recently. `null`\n * before the first close. Surface for demos, telemetry, and audit\n * sinks - reads which path fired without re-installing listeners.\n */\n readonly lastDismissSource = this.dismissBinding.lastSource;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.removeVirtualAnchor();\n this.dismissBinding.detach();\n });\n effect(() => {\n const open = this.isOpen();\n untracked(() => {\n if (open) {\n if (this.savedFocus === null) {\n const active = this.doc.activeElement;\n this.savedFocus = active instanceof HTMLElement ? active : null;\n }\n this.dismissBinding.attach();\n } else {\n this.dismissBinding.detach();\n if (this.savedFocus !== null) {\n this.restoreFocus();\n }\n }\n });\n });\n }\n\n protected handleContextMenu(event: MouseEvent): void {\n event.preventDefault();\n this.openAt(event.clientX, event.clientY);\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n // Escape is owned by CngxPopover's global listener; focus has moved\n // into the menu container by the time the user can press it.\n if (event.key === 'F10' && event.shiftKey) {\n event.preventDefault();\n const rect = this.hostElRef.nativeElement.getBoundingClientRect();\n this.openAt(rect.left + rect.width / 2, rect.top + rect.height / 2);\n }\n }\n\n private openAt(x: number, y: number): void {\n // Capture savedFocus eagerly BEFORE show(): the effect-driven capture\n // races the queueMicrotask focus transfer below in real browsers and\n // ends up storing the menu UL instead of the pre-open target. The\n // effect still runs (it also attaches the dismiss binding) but the\n // `savedFocus === null` guard keeps this earlier capture.\n if (this.savedFocus === null) {\n const active = this.doc.activeElement;\n this.savedFocus = active instanceof HTMLElement ? active : null;\n }\n const anchor = this.ensureVirtualAnchor();\n anchor.style.left = `${x}px`;\n anchor.style.top = `${y}px`;\n anchor.style.setProperty('anchor-name', `--cngx-pop-${this.popover().id()}`);\n this.popover().anchorElement.set(anchor);\n if (!this.popover().isVisible()) {\n this.popover().show();\n }\n this.menu().ad.highlightFirst();\n // Defer one microtask so showPopover()'s top-layer DOM mutation\n // settles before focus moves into the menu container - matches the\n // existing close-time `restoreFocus` pattern below.\n queueMicrotask(() => this.menu().focus());\n }\n\n private restoreFocus(): void {\n const target = this.savedFocus;\n this.savedFocus = null;\n if (!target) {\n return;\n }\n queueMicrotask(() => {\n target.focus();\n });\n }\n\n private ensureVirtualAnchor(): HTMLElement {\n if (this.virtualAnchor) {\n return this.virtualAnchor;\n }\n const el = this.doc.createElement('div');\n el.setAttribute('aria-hidden', 'true');\n el.className = 'cngx-context-menu-anchor';\n el.style.cssText = 'position:fixed;width:0;height:0;pointer-events:none';\n this.doc.body.appendChild(el);\n this.virtualAnchor = el;\n return el;\n }\n\n private removeVirtualAnchor(): void {\n this.virtualAnchor?.remove();\n this.virtualAnchor = null;\n }\n}\n","import type { EnvironmentProviders } from '@angular/core';\n\nimport { type CngxMenuConfigFeature, provideMenuConfig } from './menu-config';\n\n/**\n * Union of every feature kind the menu family aggregator accepts. Today\n * that is only `CngxMenuConfigFeature` (target `'config'`); future surfaces\n * (e.g. submenu-only or announcer overrides) will widen this union and\n * `provideCngxMenu` will dispatch to the matching `provide*Config` based on\n * each feature's hidden `_target` discriminator.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuFeature = CngxMenuConfigFeature;\n\n/**\n * Unified aggregator for the menu family's configuration. Filters features\n * by `_target` and forwards to the matching `provide*Config` function.\n *\n * Today there is exactly one config surface (`CNGX_MENU_CONFIG`), so all\n * features dispatch to {@link provideMenuConfig}. The discriminator\n * scaffolding is in place so adding a future surface does not break the\n * public API of existing `with*` features.\n *\n * Mirrors `provideCngxSelect` from the select-family A+ closure.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideCngxMenu(\n * withAriaLabels({ submenuOpened: 'Untermenü geöffnet' }),\n * withTypeaheadDebounce(500),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/interactive/menu\n */\nexport function provideCngxMenu(...features: CngxMenuFeature[]): EnvironmentProviders {\n const configFeatures = features.filter(\n (f): f is CngxMenuConfigFeature => (f._target ?? 'config') === 'config',\n );\n return provideMenuConfig(...configFeatures);\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\nimport {\n CNGX_MENU_DISMISS_HANDLER_FACTORY,\n createMenuTriggerDismissBinding,\n type CngxMenuDismissPopoverRef,\n} from './dismiss-handler';\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\nimport type { CngxMenuHost } from './menu-host.token';\nimport { CNGX_MENU_NAV_STRATEGY } from './menu-nav-strategy';\nimport type { CngxMenuSubmenuLike } from './menu-submenu.token';\n\n/** See `CngxListboxTrigger` - same structural contract. */\ninterface PopoverController extends CngxMenuDismissPopoverRef {\n show(): void;\n}\n\n/**\n * Trigger atom for dropdown menus.\n *\n * Pairs a focusable element with a `CngxMenu` and a `CngxPopover` through\n * explicit template references - identical keyboard model to\n * `CngxListboxTrigger` except `closeOnSelect` is hardcoded `true` (menu\n * semantics: activating an item dismisses the menu).\n *\n * Carries a focus-stack model for nested submenus: when a submenu opens,\n * its inner `CngxMenu` is pushed onto the stack so subsequent ArrowDown /\n * Up / Home / End / Enter target the submenu's items via its own\n * `CngxActiveDescendant`. ArrowLeft / Escape pop the stack and close the\n * top submenu.\n *\n * ### Focus model\n *\n * The dropdown trigger deliberately keeps DOM focus on the trigger\n * button while the menu is open - WAI-ARIA APG Menu Button Pattern -\n * and drives the menu's `CngxActiveDescendant` from there via host\n * keydown. It does NOT call {@link CngxMenuHost.focus} after open;\n * that path is reserved for {@link CngxContextMenuTrigger}, where the\n * trigger zone is non-focusable consumer content and the menu\n * container itself must take focus to receive keyboard input.\n *\n * ### Dismissal\n *\n * Four dismissal sources close the menu by default: `Escape`, `pointerdown`\n * outside both the popover and the trigger host, window `blur`, and\n * document `pointercancel`. Window `scroll` is opt-in via\n * {@link withDismissOnScroll}. The source that fired most recently is\n * readable through {@link lastDismissSource}.\n *\n * Override individual sources at app root with `withDismissOnOutsideClick`,\n * `withDismissOnScroll`, `withDismissOnBlur`, or swap the whole handler via\n * {@link CNGX_MENU_DISMISS_HANDLER_FACTORY} for telemetry-wrapped or\n * test-doubled dismissal.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-trigger.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxContextMenuTrigger, CngxMenuItemSubmenu, CngxPopoverTrigger\n * <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/trigger/dropdown-menu</example-url>\n */\n@Directive({\n selector: '[cngxMenuTrigger]',\n exportAs: 'cngxMenuTrigger',\n standalone: true,\n host: {\n '[attr.aria-haspopup]': '\"menu\"',\n '[attr.aria-expanded]': 'isOpen()',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxMenuTrigger {\n /** Menu controlled by this trigger. */\n readonly menu = input.required<CngxMenuHost>({ alias: 'cngxMenuTrigger' });\n /** Popover that wraps the menu panel. */\n readonly popover = input.required<PopoverController>();\n\n /** Mirrors `CngxPopover.isVisible()`. */\n readonly isOpen = computed<boolean>(() => this.popover().isVisible());\n\n private readonly nav = inject(CNGX_MENU_NAV_STRATEGY);\n\n /**\n * Active submenu chain - empty when only the outer menu is open. Each\n * entry is the `inner` host of an open submenu, top entry being the\n * deepest. Keystrokes target the top entry's AD.\n */\n private readonly submenuStack = signal<readonly CngxMenuHost[]>([]);\n\n /**\n * Focused element captured at popover-open time. Restored after close via\n * `queueMicrotask` so the focus write happens after the popover-close DOM\n * mutation settles. Captured reactively via the `isOpen` effect below so\n * mouse-driven open paths (consumer's `(click)=\"pop.toggle()\"`) get the\n * same treatment as keyboard-driven open paths.\n */\n private savedFocus: HTMLElement | null = null;\n\n private readonly doc = inject(DOCUMENT);\n private readonly hostElRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly menuConfig = injectMenuConfig();\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly dismissBinding = createMenuTriggerDismissBinding({\n popover: () => this.popover(),\n hostElement: this.hostElRef.nativeElement,\n menuConfig: this.menuConfig,\n factory: inject(CNGX_MENU_DISMISS_HANDLER_FACTORY),\n onDismiss: () => this.announcer.announce(this.menuConfig.ariaLabels.menuDismissed),\n });\n\n /**\n * The dismissal source that closed the menu most recently. `null`\n * before the first close. Surface for demos, telemetry, and audit\n * sinks - reads which path fired without re-installing listeners.\n */\n readonly lastDismissSource = this.dismissBinding.lastSource;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.dismissBinding.detach());\n effect(() => {\n const open = this.isOpen();\n untracked(() => {\n if (open) {\n if (this.savedFocus === null) {\n const active = this.doc.activeElement;\n this.savedFocus = active instanceof HTMLElement ? active : null;\n }\n this.dismissBinding.attach();\n } else {\n this.dismissBinding.detach();\n if (this.savedFocus !== null) {\n this.restoreFocus();\n }\n }\n });\n });\n }\n\n private effectiveMenu(): CngxMenuHost {\n const stack = this.submenuStack();\n return stack.length === 0 ? this.menu() : stack[stack.length - 1];\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n const key = event.key;\n\n if (!this.isOpen()) {\n if (key === 'ArrowDown' || key === 'Enter' || key === ' ') {\n event.preventDefault();\n this.popover().show();\n this.menu().ad.highlightFirst();\n return;\n }\n if (key === 'ArrowUp') {\n event.preventDefault();\n this.popover().show();\n this.menu().ad.highlightLast();\n return;\n }\n return;\n }\n\n const menu = this.effectiveMenu();\n const ad = menu.ad;\n\n switch (key) {\n case 'Escape':\n event.preventDefault();\n if (this.submenuStack().length > 0) {\n event.stopPropagation();\n this.popSubmenu();\n } else {\n this.popover().hide();\n }\n return;\n case 'ArrowDown':\n event.preventDefault();\n ad.highlightNext();\n return;\n case 'ArrowUp':\n event.preventDefault();\n ad.highlightPrev();\n return;\n case 'Home':\n event.preventDefault();\n ad.highlightFirst();\n return;\n case 'End':\n event.preventDefault();\n ad.highlightLast();\n return;\n case 'ArrowRight':\n this.handleArrowRight(menu, ad, event);\n return;\n case 'ArrowLeft':\n this.handleArrowLeft(ad, event);\n return;\n case 'Enter':\n case ' ':\n this.handleActivation(menu, ad, event);\n return;\n }\n }\n\n private handleArrowRight(menu: CngxMenuHost, ad: CngxMenuHost['ad'], event: KeyboardEvent): void {\n const activeId = ad.activeId();\n const submenu = this.findSubmenu(menu, activeId);\n const action = this.nav.onArrowRight({\n activeId,\n hasSubmenu: !!submenu,\n submenuOpen: submenu?.isOpen() ?? false,\n });\n if (action.kind === 'open-submenu' && submenu) {\n event.preventDefault();\n this.openSubmenu(submenu);\n }\n }\n\n private handleArrowLeft(ad: CngxMenuHost['ad'], event: KeyboardEvent): void {\n const stackOpen = this.submenuStack().length > 0;\n const action = this.nav.onArrowLeft({\n activeId: ad.activeId(),\n hasSubmenu: false,\n submenuOpen: stackOpen,\n });\n if (action.kind === 'close-submenu' && stackOpen) {\n event.preventDefault();\n this.popSubmenu();\n }\n }\n\n private handleActivation(menu: CngxMenuHost, ad: CngxMenuHost['ad'], event: KeyboardEvent): void {\n if (!ad.activeItem()) {\n return;\n }\n event.preventDefault();\n const submenu = this.findSubmenu(menu, ad.activeId());\n if (submenu) {\n this.openSubmenu(submenu);\n } else {\n ad.activateCurrent();\n this.closeAll();\n }\n }\n\n private findSubmenu(\n menu: CngxMenuHost,\n activeId: string | null,\n ): CngxMenuSubmenuLike | undefined {\n if (!activeId) {\n return undefined;\n }\n return menu.submenuItems().find((s) => s.id === activeId);\n }\n\n private openSubmenu(submenu: CngxMenuSubmenuLike): void {\n submenu.open();\n this.submenuStack.update((s) => [...s, submenu.inner]);\n submenu.inner.ad.highlightFirst();\n }\n\n private popSubmenu(): void {\n const stack = this.submenuStack();\n if (stack.length === 0) {\n return;\n }\n const top = stack[stack.length - 1];\n const parent = stack.length === 1 ? this.menu() : stack[stack.length - 2];\n const submenu = parent.submenuItems().find((s) => s.inner === top);\n submenu?.close();\n this.submenuStack.update((prev) => prev.slice(0, -1));\n }\n\n private closeAll(): void {\n const stack = this.submenuStack();\n for (let i = stack.length - 1; i >= 0; i--) {\n const inner = stack[i];\n const parent = i === 0 ? this.menu() : stack[i - 1];\n const submenu = parent.submenuItems().find((s) => s.inner === inner);\n submenu?.close();\n }\n this.submenuStack.set([]);\n this.popover().hide();\n }\n\n private restoreFocus(): void {\n const target = this.savedFocus;\n this.savedFocus = null;\n if (!target) {\n return;\n }\n queueMicrotask(() => {\n target.focus();\n });\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\n/**\n * Marks any DOM element as carrying an error state.\n *\n * Generic host-element marker - works on cngx, Material, CDK, native HTML,\n * and third-party hosts. Toggles the `.cngx-error` class hook plus reactive\n * `aria-invalid` / `aria-errormessage` attributes when the bound boolean is\n * true. The directive is purely presentational; it does not own the error\n * state itself, it only reflects it.\n *\n * The `cngxErrorState` input takes a plain `boolean`. Consumers binding a\n * signal write `[cngxErrorState]=\"form.email().invalid()\"` - the signal is\n * invoked at the binding site (canonical Angular pattern), not detected at\n * runtime.\n *\n * ```html\n * <input\n * [cngxErrorState]=\"emailField().invalid()\"\n * cngxErrorMessageId=\"email-error\"\n * />\n * <span id=\"email-error\" role=\"alert\">Please enter a valid email.</span>\n * ```\n *\n * @category common/interactive/error\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-state/error-state.directive.ts\n * @since 0.1.0\n * @relatedTo CngxErrorAggregator, CngxErrorSource, CngxErrorScope\n * <example-url>http://localhost:4200/#/common/interactive/error/state/basic-boolean-flag-flips-aria-invalid-aria-errormessage</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/state/without-message-id-class-hook-aria-invalid-only</example-url>\n */\n@Directive({\n selector: '[cngxErrorState]',\n standalone: true,\n exportAs: 'cngxErrorState',\n host: {\n '[class.cngx-error]': 'cngxErrorState()',\n '[attr.aria-invalid]': 'ariaInvalid()',\n '[attr.aria-errormessage]': 'ariaErrorMessage()',\n },\n})\nexport class CngxErrorState {\n readonly cngxErrorState = input.required<boolean>();\n\n /** Optional id of the element rendering the error message text. */\n readonly cngxErrorMessageId = input<string | null>(null);\n\n /** @internal - explicit boolean, always present in the DOM (cngx ARIA convention). */\n protected readonly ariaInvalid = computed(() => (this.cngxErrorState() ? 'true' : 'false'));\n\n /**\n * @internal - emitted whenever a non-empty message id is bound, regardless\n * of the error flag. cngx convention: ID-bearing ARIA attributes stay in\n * the DOM; visibility of the message element is controlled by the\n * consumer via `aria-hidden` on the message itself.\n */\n protected readonly ariaErrorMessage = computed(() => {\n const id = this.cngxErrorMessageId();\n return id && id.length > 0 ? id : null;\n });\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Contract every {@link CngxErrorScope} (or external override) fulfils.\n *\n * The scope encapsulates the \"should errors be visible right now?\"\n * decision. A scope starts hidden (`showErrors === false`) and reveals\n * when {@link reveal} is called - typically on form submit, on route\n * navigation, or on programmatic error trigger.\n *\n * Descendant directives (`CngxErrorAggregator`, `CngxErrorState`) read\n * the scope's `showErrors` signal to gate their own visibility, so a\n * single `reveal()` propagates atomically through the subtree.\n *\n * @category common/interactive/error\n */\nexport interface CngxErrorScopeContract {\n /** Reactive flag - `true` when errors should be visible to the user. */\n readonly showErrors: Signal<boolean>;\n /** Reveals errors in this scope (idempotent). */\n reveal(): void;\n /** Resets the scope to hidden (idempotent). */\n reset(): void;\n /** Optional name for programmatic registry lookup via {@link CngxErrorRegistry}. */\n readonly scopeName?: Signal<string | undefined>;\n}\n\n/**\n * DI token resolving to the nearest {@link CngxErrorScopeContract} ancestor.\n *\n * Provided by {@link CngxErrorScope} via `useExisting`; descendants inject\n * with `{ optional: true }` and fall back gracefully when no scope is\n * present (no-op).\n *\n * @category common/interactive/error\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-scope/error-scope.token.ts\n * @since 0.1.0\n */\nexport const CNGX_ERROR_SCOPE = new InjectionToken<CngxErrorScopeContract>('CngxErrorScope');\n","import type { CngxErrorAggregatorSourceEntry } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Length-then-key-set equality for `ReadonlyMap` signals.\n *\n * Returns `true` when both maps have the same size AND same key set,\n * **regardless of value identity**. Used by the error registry to\n * short-circuit emissions when an aggregator is replaced under the same\n * name (the downstream computeds re-evaluate per registered aggregator's\n * own signals, not per Map identity).\n *\n * **Swap-is-noop semantics.** Combined with the registry's\n * `register*(name, ref)` helpers, this equal fn means re-registering a\n * *different* contract instance under an *existing* name is absorbed\n * silently — `getScope(name)`/`getAggregator(name)` continue returning\n * the originally registered instance until either an `unregister*(name)`\n * + `register*(name, newRef)` cycle runs (the unregister changes the key\n * set, breaking the equal short-circuit) or a different name is added.\n * This is intentional cascade-suppression: registering a freshly-\n * constructed contract during component re-init must not cascade\n * downstream readers.\n *\n * @internal\n */\nexport function mapKeySetEqual<K, V>(\n a: ReadonlyMap<K, V>,\n b: ReadonlyMap<K, V>,\n): boolean {\n if (a === b) {\n return true;\n }\n if (a.size !== b.size) {\n return false;\n }\n for (const key of a.keys()) {\n if (!b.has(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Element-wise equality for readonly arrays. Reference-equal on `===`,\n * length+per-index `===` otherwise.\n *\n * @internal\n */\nexport function shallowReadonlyArrayEqual<T>(a: readonly T[], b: readonly T[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Equality for the source-entry map carried by `CngxErrorAggregator`. Same\n * size, same keys, same `condition` Signal identity per entry, same label.\n * Shared by the directive and the {@link injectErrorAggregator} factory so\n * cascade-suppression behaviour stays in one place.\n *\n * @internal\n */\nexport function errorSourceMapEqual(\n a: ReadonlyMap<string, CngxErrorAggregatorSourceEntry>,\n b: ReadonlyMap<string, CngxErrorAggregatorSourceEntry>,\n): boolean {\n if (a === b) {\n return true;\n }\n if (a.size !== b.size) {\n return false;\n }\n for (const [key, entryA] of a) {\n const entryB = b.get(key);\n if (\n entryB?.condition !== entryA.condition ||\n (entryB.label ?? null) !== (entryA.label ?? null)\n ) {\n return false;\n }\n }\n return true;\n}\n","import { computed, Injectable, signal, type Signal } from '@angular/core';\nimport type { CngxErrorAggregatorContract } from '../error-aggregator/error-aggregator.token';\nimport type { CngxErrorScopeContract } from '../error-scope/error-scope.token';\nimport { mapKeySetEqual, shallowReadonlyArrayEqual } from './equal-fns';\n\n/**\n * Programmatic registry for named error scopes and aggregators.\n *\n * Provides a lookup surface so consumers (route guards, HTTP interceptors,\n * test harnesses) can inspect or drive form-error state without traversing\n * the DOM. Directives with `cngxErrorScopeName` / `cngxErrorAggregatorName`\n * inputs auto-register here when the registry is provided in the host\n * environment (via {@link provideErrorRegistry}, ships in commit 3).\n *\n * Not `providedIn: 'root'` — consumers opt in by including\n * `provideErrorRegistry()` in their `bootstrapApplication` providers. When\n * the registry is absent, the directives skip registration and keep their\n * pure DOM behaviour.\n *\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\n@Injectable()\nexport class CngxErrorRegistry {\n private readonly scopesState = signal<ReadonlyMap<string, CngxErrorScopeContract>>(\n new Map(),\n { equal: mapKeySetEqual },\n );\n\n private readonly aggregatorsState = signal<\n ReadonlyMap<string, CngxErrorAggregatorContract>\n >(new Map(), { equal: mapKeySetEqual });\n\n /**\n * True when at least one registered aggregator reports `hasError`.\n *\n * The Map signal `equal` fn short-circuits on key-set unchanged, so\n * registering an additional aggregator under an existing name does not\n * cascade through this computed. Adding or removing keys does emit.\n */\n readonly hasAnyError: Signal<boolean> = computed(() => {\n for (const aggregator of this.aggregatorsState().values()) {\n if (aggregator.hasError()) {\n return true;\n }\n }\n return false;\n });\n\n /** Sum of `errorCount()` across every registered aggregator. */\n readonly totalErrorCount: Signal<number> = computed(() => {\n let total = 0;\n for (const aggregator of this.aggregatorsState().values()) {\n total += aggregator.errorCount();\n }\n return total;\n });\n\n /** Registered aggregator contracts in insertion order. */\n readonly errorAggregators: Signal<readonly CngxErrorAggregatorContract[]> = computed(\n () => Array.from(this.aggregatorsState().values()),\n { equal: shallowReadonlyArrayEqual },\n );\n\n /**\n * Registers the named scope. Idempotent for the same `(name, scope)`\n * pair.\n *\n * **Swap-is-noop (intentional):** registering a *different* scope\n * instance under an *existing* name is silently absorbed. The internal\n * `scopesState` signal carries `equal: mapKeySetEqual`, which short-\n * circuits when the key set is unchanged. Downstream readers (and any\n * subsequent `getScope(name)` call) keep observing the originally\n * registered instance.\n *\n * To perform a true swap, call `unregisterScope(name)` first, then\n * `registerScope(name, newScope)` — the unregister cycle changes the\n * key set, the equal fn emits, and the new instance becomes the live\n * value.\n */\n registerScope(name: string, scope: CngxErrorScopeContract): void {\n const current = this.scopesState();\n if (current.get(name) === scope) {\n return;\n }\n const next = new Map(current);\n next.set(name, scope);\n this.scopesState.set(next);\n }\n\n /** Removes the named scope. No-op if absent. */\n unregisterScope(name: string): void {\n const current = this.scopesState();\n if (!current.has(name)) {\n return;\n }\n const next = new Map(current);\n next.delete(name);\n this.scopesState.set(next);\n }\n\n /** Returns the named scope, or `undefined` when not registered. */\n getScope(name: string): CngxErrorScopeContract | undefined {\n return this.scopesState().get(name);\n }\n\n /**\n * Registers the named aggregator. Idempotent for the same\n * `(name, aggregator)` pair.\n *\n * **Swap-is-noop (intentional):** see `registerScope` for the full\n * rationale. Re-registering a different aggregator instance under an\n * existing name is silently absorbed by `mapKeySetEqual`; downstream\n * readers stay attached to the originally registered contract. Use\n * `unregisterAggregator(name)` then `registerAggregator(name, newAgg)`\n * for a true swap.\n */\n registerAggregator(name: string, aggregator: CngxErrorAggregatorContract): void {\n const current = this.aggregatorsState();\n if (current.get(name) === aggregator) {\n return;\n }\n const next = new Map(current);\n next.set(name, aggregator);\n this.aggregatorsState.set(next);\n }\n\n /** Removes the named aggregator. No-op if absent. */\n unregisterAggregator(name: string): void {\n const current = this.aggregatorsState();\n if (!current.has(name)) {\n return;\n }\n const next = new Map(current);\n next.delete(name);\n this.aggregatorsState.set(next);\n }\n\n /** Returns the named aggregator, or `undefined` when not registered. */\n getAggregator(name: string): CngxErrorAggregatorContract | undefined {\n return this.aggregatorsState().get(name);\n }\n\n /** Reveals the named scope. Idempotent; no-op if name not registered. */\n reveal(name: string): void {\n this.scopesState().get(name)?.reveal();\n }\n\n /** Resets the named scope. Idempotent; no-op if name not registered. */\n reset(name: string): void {\n this.scopesState().get(name)?.reset();\n }\n\n /** Reveals every registered scope. */\n revealAll(): void {\n for (const scope of this.scopesState().values()) {\n scope.reveal();\n }\n }\n\n /** Resets every registered scope. */\n resetAll(): void {\n for (const scope of this.scopesState().values()) {\n scope.reset();\n }\n }\n}\n\n","import { afterNextRender, DestroyRef, Directive, inject, input, signal } from '@angular/core';\nimport { CngxErrorRegistry } from '../error-registry/error-registry';\nimport { CNGX_ERROR_SCOPE, type CngxErrorScopeContract } from './error-scope.token';\n\n/**\n * Marks a DOM subtree as an error visibility scope.\n *\n * @category common/interactive/error\n *\n * The scope starts hidden - descendant aggregators and error states do\n * not reveal until the consumer calls {@link reveal}, typically via a\n * `(submit)` handler, a route guard, or an HTTP interceptor reveal-on-422\n * pattern.\n *\n * Provides {@link CNGX_ERROR_SCOPE} so any descendant\n * (`CngxErrorAggregator`, `CngxErrorState`, the form-field presenter in\n * Phase 6b) can read `showErrors` reactively without injecting a\n * concrete class.\n *\n * ```html\n * <form [cngxErrorScope] cngxErrorScopeName=\"checkout\"\n * (submit)=\"scope.reveal(); save()\" #scope=\"cngxErrorScope\">\n * <input [cngxErrorState]=\"email().invalid()\" />\n * </form>\n * ```\n *\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-scope/error-scope.directive.ts\n * @since 0.1.0\n * @relatedTo CngxErrorAggregator, CngxErrorState, CngxErrorSource\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-card-host-no-scope-errors-visible-immediately</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-popover-panel-host</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/material-mat-tab-label-with-error-count-badge</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/native-form-scope-reveal-on-submit</example-url>\n */\n@Directive({\n selector: '[cngxErrorScope]',\n standalone: true,\n exportAs: 'cngxErrorScope',\n providers: [{ provide: CNGX_ERROR_SCOPE, useExisting: CngxErrorScope }],\n})\nexport class CngxErrorScope implements CngxErrorScopeContract {\n /** Optional name; enables programmatic lookup via {@link CngxErrorRegistry}. */\n readonly scopeName = input<string | undefined>(undefined, {\n alias: 'cngxErrorScopeName',\n });\n\n private readonly showErrorsState = signal(false);\n\n /** Reactive flag consumed by descendants. */\n readonly showErrors = this.showErrorsState.asReadonly();\n\n /** Reveals errors in this scope (idempotent). */\n reveal(): void {\n this.showErrorsState.set(true);\n }\n\n /** Resets the scope to hidden (idempotent). */\n reset(): void {\n this.showErrorsState.set(false);\n }\n\n constructor() {\n const registry = inject(CngxErrorRegistry, { optional: true });\n if (!registry) {\n return;\n }\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const name = this.scopeName();\n if (!name) {\n return;\n }\n registry.registerScope(name, this);\n destroyRef.onDestroy(() => registry.unregisterScope(name));\n });\n }\n}\n","import { Directive, effect, inject, input, untracked } from '@angular/core';\nimport {\n CNGX_ERROR_AGGREGATOR,\n type CngxErrorAggregatorContract,\n} from '../error-aggregator/error-aggregator.token';\n\n/**\n * Registers a single error condition with the nearest\n * {@link CngxErrorAggregator} ancestor.\n *\n * @category common/interactive/error\n *\n * Pure DI propagation - no DOM output. The directive is a no-op when no\n * aggregator is present (the optional injection returns `null`).\n * Useful for surfacing errors that live outside the form-field\n * presenter, e.g. server-side validation, async availability checks,\n * or business-rule conflicts.\n *\n * The `when` input takes a plain `boolean`. Consumers binding a signal\n * write `[when]=\"form.email().invalid()\"` - the signal is invoked at the\n * binding site (canonical Angular pattern), mirroring `CngxErrorState`\n * discipline.\n *\n * ```html\n * <fieldset cngxErrorAggregator>\n * <span cngxErrorSource=\"email-format\" [when]=\"email().invalid()\"\n * label=\"Email format invalid\"></span>\n * <span cngxErrorSource=\"email-taken\" [when]=\"serverErr() === 'taken'\"\n * label=\"Email already in use\"></span>\n * </fieldset>\n * ```\n *\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-source/error-source.directive.ts\n * @since 0.1.0\n * @relatedTo CngxErrorAggregator, CngxErrorScope, CngxErrorState\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-card-host-no-scope-errors-visible-immediately</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-popover-panel-host</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/material-mat-tab-label-with-error-count-badge</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/native-form-scope-reveal-on-submit</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>\n */\n@Directive({\n selector: '[cngxErrorSource]',\n standalone: true,\n exportAs: 'cngxErrorSource',\n})\nexport class CngxErrorSource {\n /** Unique key within the parent aggregator. Required. */\n readonly cngxErrorSource = input.required<string>();\n\n /** Live error condition. Required (consumer invokes signals at the binding site). */\n readonly when = input.required<boolean>();\n\n /** Optional human-readable label included in aggregator announcements. */\n readonly label = input<string | null>(null);\n\n private readonly aggregator = inject<CngxErrorAggregatorContract | null>(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n });\n\n constructor() {\n if (!this.aggregator) {\n return;\n }\n const aggregator = this.aggregator;\n effect((onCleanup) => {\n const key = this.cngxErrorSource();\n const label = this.label();\n untracked(() => {\n aggregator.addSource({ key, condition: this.when, label });\n });\n onCleanup(() => {\n untracked(() => aggregator.removeSource(key));\n });\n });\n }\n}\n","import { computed, type Signal, type WritableSignal } from '@angular/core';\nimport type {\n CngxErrorAggregatorContract,\n CngxErrorAggregatorSourceEntry,\n} from '../error-aggregator/error-aggregator.token';\nimport type { CngxErrorScopeContract } from '../error-scope/error-scope.token';\nimport { shallowReadonlyArrayEqual } from './equal-fns';\n\n/** @internal */\nconst ERROR_LABEL_JOINER = ', ';\n\n/**\n * Inputs required to build the shared error-aggregator computed graph.\n *\n * Both consumers (`CngxErrorAggregator` directive, `injectErrorAggregator`\n * factory) own their own writable `sourcesState` signal - typically created\n * with `equal: errorSourceMapEqual` - and pass it in alongside a scope\n * signal that resolves to either an explicit override, the nearest\n * ancestor scope, or `null` (no scope, `shouldShow` collapses to\n * `hasError`).\n *\n * @internal\n */\nexport interface ErrorAggregatorContractDeps {\n /** Writable signal carrying the live source-entry map. */\n readonly sourcesState: WritableSignal<ReadonlyMap<string, CngxErrorAggregatorSourceEntry>>;\n /**\n * Reactive scope reference. `null` / `undefined` means no scope - in\n * that case `shouldShow` short-circuits to `hasError` directly.\n */\n readonly scope: Signal<CngxErrorScopeContract | null | undefined>;\n}\n\n/**\n * Builds the canonical error-aggregator computed graph (six derived\n * signals + `addSource`/`removeSource` mutators) over a caller-owned\n * source-entry signal and a caller-owned scope signal.\n *\n * Single source of truth for the aggregator surface: `CngxErrorAggregator`\n * (directive form, ARIA host bindings) and `injectErrorAggregator`\n * (programmatic form, no DOM host) both delegate to this helper so the\n * two surfaces stay field-for-field equivalent without manual sync.\n *\n * Returns a fresh `CngxErrorAggregatorContract` each call - every\n * `computed` is freshly bound to the supplied `sourcesState`/`scope`\n * pair, so two callers with the same source signal get independent\n * computed instances (this is intentional: the directive's host\n * bindings and a co-located factory contract should not share computed\n * identity).\n *\n * @internal\n */\nexport function createErrorAggregatorContract(\n deps: ErrorAggregatorContractDeps,\n): CngxErrorAggregatorContract {\n const { sourcesState, scope } = deps;\n\n const hasError: Signal<boolean> = computed(() => {\n for (const entry of sourcesState().values()) {\n if (entry.condition()) {\n return true;\n }\n }\n return false;\n });\n\n const errorCount: Signal<number> = computed(() => {\n let count = 0;\n for (const entry of sourcesState().values()) {\n if (entry.condition()) {\n count++;\n }\n }\n return count;\n });\n\n const activeErrors: Signal<readonly string[]> = computed(\n () => {\n const out: string[] = [];\n for (const [key, entry] of sourcesState()) {\n if (entry.condition()) {\n out.push(key);\n }\n }\n return out;\n },\n { equal: shallowReadonlyArrayEqual },\n );\n\n const errorLabels: Signal<readonly string[]> = computed(\n () => {\n const out: string[] = [];\n for (const entry of sourcesState().values()) {\n if (entry.condition() && entry.label) {\n out.push(entry.label);\n }\n }\n return out;\n },\n { equal: shallowReadonlyArrayEqual },\n );\n\n const shouldShow: Signal<boolean> = computed(() => {\n if (!hasError()) {\n return false;\n }\n const resolved = scope();\n return resolved ? resolved.showErrors() : true;\n });\n\n const announcement: Signal<string> = computed(() =>\n shouldShow() ? errorLabels().join(ERROR_LABEL_JOINER) : '',\n );\n\n return {\n hasError,\n errorCount,\n activeErrors,\n errorLabels,\n shouldShow,\n announcement,\n addSource(entry) {\n const next = new Map(sourcesState());\n next.set(entry.key, entry);\n sourcesState.set(next);\n },\n removeSource(key) {\n const current = sourcesState();\n if (!current.has(key)) {\n return;\n }\n const next = new Map(current);\n next.delete(key);\n sourcesState.set(next);\n },\n };\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n effect,\n inject,\n input,\n PLATFORM_ID,\n Renderer2,\n signal,\n untracked,\n} from '@angular/core';\nimport { createErrorAggregatorContract } from '../error-registry/aggregator-contract';\nimport { errorSourceMapEqual } from '../error-registry/equal-fns';\nimport { CngxErrorRegistry } from '../error-registry/error-registry';\nimport { CNGX_ERROR_SCOPE, type CngxErrorScopeContract } from '../error-scope/error-scope.token';\nimport {\n CNGX_ERROR_AGGREGATOR,\n type CngxErrorAggregatorContract,\n type CngxErrorAggregatorSourceEntry,\n} from './error-aggregator.token';\n\n/**\n * Aggregates one-or-more {@link CngxErrorSource} children into a single\n * live A11y surface.\n *\n * @category common/interactive/error\n *\n * Each registered source contributes a key + a live `Signal<boolean>` +\n * an optional label. Derived signals (`hasError`, `errorCount`,\n * `activeErrors`, `errorLabels`, `shouldShow`, `announcement`) are\n * `computed()` with structural `equal` fns so unrelated re-emissions\n * upstream do not cascade through descendants.\n *\n * ### Live region\n *\n * By default the directive appends a visually-hidden `<span>` to the\n * host element and writes {@link announcement} into its `textContent`\n * reactively, so an `aria-live` announcement fires the moment a source\n * toggles. The span carries `role=\"status\"` (or `role=\"alert\"` when\n * politeness is `'assertive'`), `aria-live`, `aria-atomic=\"true\"`, and\n * `aria-relevant=\"additions text\"`. Visually-hidden styling is applied\n * inline via `--cngx-sr-only-*` CSS custom properties — no global\n * stylesheet required.\n *\n * Set `[autoAnnounce]=\"false\"` to take ownership of the live region in\n * consumer markup (for example, when routing announcements through\n * CDK's `LiveAnnouncer` service). Use `[announcePoliteness]` to switch\n * to `'assertive'` for safety-critical errors or `'off'` to suppress\n * announcements entirely while keeping the visual error surface.\n *\n * ```html\n * <fieldset cngxErrorAggregator #agg=\"cngxErrorAggregator\">\n * <span cngxErrorSource=\"format\" [when]=\"email().invalid()\" label=\"Format\"></span>\n * <span cngxErrorSource=\"taken\" [when]=\"taken()\" label=\"Already used\"></span>\n *\n * @if (agg.shouldShow()) {\n * <ul role=\"alert\">\n * @for (label of agg.errorLabels(); track label) {\n * <li>{{ label }}</li>\n * }\n * </ul>\n * }\n * </fieldset>\n * ```\n *\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-aggregator/error-aggregator.directive.ts\n * @since 0.1.0\n * @relatedTo CngxErrorSource, CngxErrorScope, CngxErrorState, CngxErrorRegistry\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-card-host-no-scope-errors-visible-immediately</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-popover-panel-host</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/material-mat-tab-label-with-error-count-badge</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/native-form-scope-reveal-on-submit</example-url>\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-error-aggregation/per-step-error-badges</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>\n */\n@Directive({\n selector: '[cngxErrorAggregator]',\n standalone: true,\n exportAs: 'cngxErrorAggregator',\n providers: [{ provide: CNGX_ERROR_AGGREGATOR, useExisting: CngxErrorAggregator }],\n host: {\n '[class.cngx-error]': 'shouldShow()',\n '[attr.aria-invalid]': 'shouldShow() ? \"true\" : \"false\"',\n },\n})\nexport class CngxErrorAggregator implements CngxErrorAggregatorContract {\n /** External scope override; falls back to ancestor `CNGX_ERROR_SCOPE`. */\n readonly scope = input<CngxErrorScopeContract | undefined>(undefined);\n\n /** Optional name; enables programmatic lookup via {@link CngxErrorRegistry}. */\n readonly aggregatorName = input<string | undefined>(undefined, {\n alias: 'cngxErrorAggregatorName',\n });\n\n /**\n * When `true` (default), the directive appends its own visually-hidden\n * `<span>` to the host element and writes {@link announcement} into its\n * `textContent`. Set to `false` to take ownership of the live region in\n * consumer markup (e.g. when routing announcements through CDK's\n * `LiveAnnouncer`).\n */\n readonly autoAnnounce = input<boolean>(true);\n\n /**\n * Politeness of the auto-rendered live region. Mirrors the WAI-ARIA\n * `aria-live` value. `'polite'` queues after the current utterance,\n * `'assertive'` interrupts, `'off'` disables announcement (the span is\n * still rendered but is not announced).\n */\n readonly announcePoliteness = input<'polite' | 'assertive' | 'off'>('polite');\n\n private readonly ancestorScope = inject<CngxErrorScopeContract | null>(CNGX_ERROR_SCOPE, {\n optional: true,\n });\n\n private readonly sourcesState = signal<ReadonlyMap<string, CngxErrorAggregatorSourceEntry>>(\n new Map(),\n { equal: errorSourceMapEqual },\n );\n\n /** @internal - the resolved scope (input wins, else ancestor, else `null`). */\n protected readonly effectiveScope = computed<CngxErrorScopeContract | null>(\n () => this.scope() ?? this.ancestorScope,\n );\n\n private readonly contract = createErrorAggregatorContract({\n sourcesState: this.sourcesState,\n scope: this.effectiveScope,\n });\n\n readonly hasError = this.contract.hasError;\n readonly errorCount = this.contract.errorCount;\n readonly activeErrors = this.contract.activeErrors;\n readonly errorLabels = this.contract.errorLabels;\n readonly shouldShow = this.contract.shouldShow;\n readonly announcement = this.contract.announcement;\n\n addSource(entry: CngxErrorAggregatorSourceEntry): void {\n this.contract.addSource(entry);\n }\n\n removeSource(key: string): void {\n this.contract.removeSource(key);\n }\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n const platformId = inject(PLATFORM_ID);\n\n if (isPlatformBrowser(platformId)) {\n const hostEl = (inject(ElementRef) as ElementRef<HTMLElement>).nativeElement;\n const renderer = inject(Renderer2);\n\n let span: HTMLSpanElement | null = null;\n\n effect(() => {\n const enabled = this.autoAnnounce();\n const politeness = this.announcePoliteness();\n const text = this.announcement();\n\n untracked(() => {\n if (!enabled) {\n if (span?.parentNode === hostEl) {\n renderer.removeChild(hostEl, span);\n }\n span = null;\n return;\n }\n\n if (!span) {\n const el = renderer.createElement('span') as HTMLSpanElement;\n renderer.setStyle(el, 'position', 'var(--cngx-sr-only-position, absolute)');\n renderer.setStyle(el, 'width', 'var(--cngx-sr-only-size, 1px)');\n renderer.setStyle(el, 'height', 'var(--cngx-sr-only-size, 1px)');\n renderer.setStyle(el, 'overflow', 'var(--cngx-sr-only-overflow, hidden)');\n renderer.setStyle(el, 'clip', 'var(--cngx-sr-only-clip, rect(0, 0, 0, 0))');\n renderer.setStyle(el, 'white-space', 'var(--cngx-sr-only-white-space, nowrap)');\n renderer.setAttribute(el, 'aria-atomic', 'true');\n renderer.setAttribute(el, 'aria-relevant', 'additions text');\n renderer.appendChild(hostEl, el);\n span = el;\n }\n\n if (politeness === 'off') {\n renderer.removeAttribute(span, 'role');\n } else {\n renderer.setAttribute(span, 'role', politeness === 'assertive' ? 'alert' : 'status');\n }\n renderer.setAttribute(span, 'aria-live', politeness);\n span.textContent = text;\n });\n });\n\n destroyRef.onDestroy(() => {\n if (span?.parentNode === hostEl) {\n renderer.removeChild(hostEl, span);\n }\n span = null;\n });\n }\n\n const registry = inject(CngxErrorRegistry, { optional: true });\n if (!registry) {\n return;\n }\n afterNextRender(() => {\n const name = this.aggregatorName();\n if (!name) {\n return;\n }\n registry.registerAggregator(name, this);\n destroyRef.onDestroy(() => registry.unregisterAggregator(name));\n });\n }\n}\n","import { DestroyRef, inject, signal } from '@angular/core';\nimport type { CngxErrorScopeContract } from '../error-scope/error-scope.token';\nimport { CngxErrorRegistry } from './error-registry';\n\n/**\n * Creates a programmatic {@link CngxErrorScopeContract}, optionally\n * registered under `name` in the ambient {@link CngxErrorRegistry}.\n *\n * Use when an error scope must exist without a DOM host — e.g. inside a\n * route guard, an HTTP interceptor, or a service that drives error\n * visibility programmatically. When `name` is set and a registry is\n * provided in the host environment, the scope auto-registers and\n * auto-deregisters on the surrounding `DestroyRef`.\n *\n * Must be called in an injection context (constructor, factory provider,\n * `runInInjectionContext`).\n *\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport function injectErrorScope(name?: string): CngxErrorScopeContract {\n const showErrorsState = signal(false);\n const scopeName = signal<string | undefined>(name);\n\n const contract: CngxErrorScopeContract = {\n showErrors: showErrorsState.asReadonly(),\n scopeName: scopeName.asReadonly(),\n reveal: () => showErrorsState.set(true),\n reset: () => showErrorsState.set(false),\n };\n\n if (name) {\n const registry = inject(CngxErrorRegistry, { optional: true });\n if (registry) {\n const destroyRef = inject(DestroyRef);\n registry.registerScope(name, contract);\n destroyRef.onDestroy(() => registry.unregisterScope(name));\n }\n }\n\n return contract;\n}\n","import { DestroyRef, inject, signal, type Signal } from '@angular/core';\nimport type {\n CngxErrorAggregatorContract,\n CngxErrorAggregatorSourceEntry,\n} from '../error-aggregator/error-aggregator.token';\nimport type { CngxErrorScopeContract } from '../error-scope/error-scope.token';\nimport { createErrorAggregatorContract } from './aggregator-contract';\nimport { CngxErrorRegistry } from './error-registry';\nimport { errorSourceMapEqual } from './equal-fns';\n\n/**\n * Creates a programmatic {@link CngxErrorAggregatorContract}, optionally\n * registered under `name` in the ambient {@link CngxErrorRegistry}.\n *\n * Positional arguments - NOT a config-options-bag - per Pillar 3\n * (Komposition statt Konfiguration). When `name` is set and a registry is\n * provided, auto-registers and auto-deregisters on the surrounding\n * `DestroyRef`.\n *\n * @param name Optional registry name (skips registration when omitted).\n * @param sources Initial source map (`key` → reactive boolean Signal).\n * Each entry's signal is the live condition the aggregator\n * reads on every recompute.\n * @param scope Optional scope override; when omitted, `shouldShow`\n * collapses to `hasError`.\n * @param labels Optional human-readable labels by source key, used in\n * `errorLabels` and `announcement`.\n *\n * Must be called in an injection context (constructor, factory provider,\n * `runInInjectionContext`).\n *\n * Computed-graph derivation is delegated to\n * {@link createErrorAggregatorContract} so the directive\n * ({@link `@cngx/common/interactive`#CngxErrorAggregator}) and the\n * function form share a single source of truth.\n *\n * @internal Staged API - single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport function injectErrorAggregator(\n name?: string,\n sources?: Record<string, Signal<boolean>>,\n scope?: CngxErrorScopeContract,\n labels?: Record<string, string>,\n): CngxErrorAggregatorContract {\n const sourcesState = signal<ReadonlyMap<string, CngxErrorAggregatorSourceEntry>>(\n buildInitialSources(sources, labels),\n { equal: errorSourceMapEqual },\n );\n const scopeSignal = signal<CngxErrorScopeContract | null | undefined>(scope);\n\n const contract = createErrorAggregatorContract({\n sourcesState,\n scope: scopeSignal.asReadonly(),\n });\n\n if (name) {\n const registry = inject(CngxErrorRegistry, { optional: true });\n if (registry) {\n const destroyRef = inject(DestroyRef);\n registry.registerAggregator(name, contract);\n destroyRef.onDestroy(() => registry.unregisterAggregator(name));\n }\n }\n\n return contract;\n}\n\n/** @internal */\nfunction buildInitialSources(\n sources: Record<string, Signal<boolean>> | undefined,\n labels: Record<string, string> | undefined,\n): ReadonlyMap<string, CngxErrorAggregatorSourceEntry> {\n if (!sources) {\n return new Map();\n }\n const map = new Map<string, CngxErrorAggregatorSourceEntry>();\n for (const [key, condition] of Object.entries(sources)) {\n map.set(key, {\n key,\n condition,\n label: labels?.[key] ?? null,\n });\n }\n return map;\n}\n","import {\n DestroyRef,\n type EnvironmentProviders,\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n type Provider,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationStart, Router } from '@angular/router';\nimport { filter } from 'rxjs';\nimport { CngxErrorRegistry } from './error-registry';\n\n/**\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport interface _ErrorRegistryConfig {\n revealOnSubmit?: boolean;\n revealOnNavigate?: boolean;\n}\n\n/**\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport interface ErrorRegistryFeature {\n /** @internal */\n readonly _apply: (config: _ErrorRegistryConfig) => _ErrorRegistryConfig;\n}\n\n/**\n * Provides {@link CngxErrorRegistry} and optional global reveal triggers.\n *\n * Composes feature flags via `_apply` partial-config functions, mirroring\n * `provideFormField`'s shape. Without features, registers the registry only;\n * pair with {@link withGlobalRevealOnSubmit} or {@link withRevealOnNavigate}\n * to install ambient reveal behaviour.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideErrorRegistry(\n * withGlobalRevealOnSubmit(),\n * withRevealOnNavigate(),\n * ),\n * ],\n * });\n * ```\n *\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport function provideErrorRegistry(\n ...features: ErrorRegistryFeature[]\n): EnvironmentProviders {\n let config: _ErrorRegistryConfig = {};\n for (const f of features) {\n config = f._apply(config);\n }\n\n const providers: (Provider | EnvironmentProviders)[] = [CngxErrorRegistry];\n\n if (config.revealOnSubmit) {\n providers.push(\n provideEnvironmentInitializer(() => {\n if (typeof document === 'undefined') {\n return;\n }\n const registry = inject(CngxErrorRegistry);\n const destroyRef = inject(DestroyRef);\n const handler = (): void => registry.revealAll();\n document.addEventListener('submit', handler, true);\n destroyRef.onDestroy(() => {\n document.removeEventListener('submit', handler, true);\n });\n }),\n );\n }\n\n if (config.revealOnNavigate) {\n providers.push(\n provideEnvironmentInitializer(() => {\n const router = inject(Router, { optional: true });\n if (!router) {\n return;\n }\n const registry = inject(CngxErrorRegistry);\n router.events\n .pipe(\n filter((event): event is NavigationStart => event instanceof NavigationStart),\n takeUntilDestroyed(),\n )\n .subscribe(() => registry.revealAll());\n }),\n );\n }\n\n return makeEnvironmentProviders(providers);\n}\n\n/**\n * Reveals every registered scope on any DOM `submit` event.\n *\n * **Coarse-grained — affects every registered scope, every form.** The\n * feature installs a capture-phase document listener that calls\n * `registry.revealAll()` on any submit anywhere in the document, even\n * when the submit fires from a form unrelated to the scope of interest.\n * Appropriate when the application treats every submit as a \"show all\n * errors now\" trigger.\n *\n * For finer-grained reveals (per-form, per-flow), skip this feature and\n * call `registry.reveal(name)` from the consumer's submit handler\n * instead — the scope-name registration path stays available without\n * the global listener.\n *\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport function withGlobalRevealOnSubmit(): ErrorRegistryFeature {\n return { _apply: (c) => ({ ...c, revealOnSubmit: true }) };\n}\n\n/**\n * Reveals every registered scope on `Router.NavigationStart`.\n *\n * Requires `provideRouter()` (or equivalent) in the host environment.\n * No-op when no `Router` is provided so the feature degrades gracefully\n * in test harnesses or non-routed apps.\n *\n * **Fires before route guards.** `NavigationStart` emits before\n * `CanActivate` / `CanDeactivate` guards run, so a navigation that gets\n * cancelled by a guard still leaves every scope revealed. Acceptable for\n * the common pattern (reveal-all on attempted navigation) but surface\n * the implication when wiring a guard that cancels based on form errors.\n *\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport function withRevealOnNavigate(): ErrorRegistryFeature {\n return { _apply: (c) => ({ ...c, revealOnNavigate: true }) };\n}\n","/**\n * @module @cngx/common/interactive\n */\nexport { CngxAsyncClick, type AsyncAction } from './async-click/async-click.directive';\nexport { CngxPending, CngxSucceeded, CngxFailed } from './async-click/async-status-templates';\nexport {\n CngxAsyncStatus,\n reflectAsyncDisplayStatus,\n type CngxAsyncDisplayStatus,\n} from './async-status/async-status.directive';\nexport { type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\nexport { CngxCopyText } from './copy/copy-text.directive';\nexport { CngxCopyBlock } from './copy/copy-block';\nexport { CngxRipple } from './ripple/ripple.directive';\nexport { CngxPressable } from './ripple/pressable.directive';\nexport { CngxPressRipple } from './ripple/press-ripple.directive';\nexport {\n CNGX_NAV_CONFIG,\n provideNavConfig,\n injectNavConfig,\n withSingleAccordion,\n withNavIndent,\n withNavAnimation,\n type CngxNavConfig,\n type NavConfigFeature,\n} from './nav/nav-config';\nexport { CngxNavGroup } from './nav/nav-group.directive';\nexport { CngxNavGroupRegistry } from './nav/nav-group-registry';\nexport { CngxNavLabel } from './nav/nav-label.directive';\nexport { CngxNavLink } from './nav/nav-link.directive';\nexport { CngxNavBadge, type NavBadgeVariant } from './nav/nav-badge.directive';\nexport { CngxDisclosure } from './nav/disclosure.directive';\nexport { CngxExpandable } from './expandable/expandable.directive';\nexport {\n CngxHoverIntent,\n CNGX_HOVER_INTENT_DEFAULTS,\n type CngxHoverIntentDefaults,\n} from './hover-intent/hover-intent.directive';\nexport {\n CNGX_CONTROL_VALUE,\n type CngxControlValue,\n} from './control-value/control-value.token';\nexport {\n createSliderCore,\n type CngxSliderCore,\n type CngxSliderCoreOptions,\n} from './slider/slider-core';\nexport { CngxSlider } from './slider/slider.component';\nexport { CngxRangeSlider } from './slider/range-slider.component';\nexport { CngxSliderTrack } from './slider/slider.directive';\nexport { CngxRangeSliderTrack } from './slider/range-slider.directive';\nexport { CngxSliderThumb } from './slider/slider-thumb.directive';\nexport {\n CNGX_SLIDER_RANGE,\n type CngxSliderRangeHost,\n type CngxSliderThumbBounds,\n type CngxSliderThumbPosition,\n} from './slider/range-slider.token';\nexport { CngxAccordion } from './accordion/accordion.directive';\nexport { CngxAccordionPanel } from './accordion/accordion-panel.directive';\nexport { CNGX_ACCORDION, type CngxAccordionHost } from './accordion/accordion.token';\nexport {\n createAccordionKeyboardNav,\n type CngxAccordionHeaderHandle,\n type CngxAccordionKeyboardNav,\n type CngxAccordionKeyboardNavHost,\n type CngxAccordionKeyboardNavOptions,\n} from './accordion/accordion-keyboard-nav';\nexport { CngxBreadcrumb } from './breadcrumb/breadcrumb.directive';\nexport { CNGX_BREADCRUMB, type CngxBreadcrumbHost } from './breadcrumb/breadcrumb.token';\nexport { CngxBreadcrumbItem } from './breadcrumb/breadcrumb-item.directive';\nexport { CngxBreadcrumbSeparator } from './breadcrumb/breadcrumb-separator.directive';\nexport {\n createBreadcrumbCollapse,\n type CngxBreadcrumbCollapseStrategy,\n} from './breadcrumb/breadcrumb-collapse';\nexport { CNGX_BREADCRUMB_COLLAPSE_STRATEGY } from './breadcrumb/breadcrumb-collapse.token';\nexport {\n DEFAULT_BREADCRUMB_WIDTH_TIERS,\n resolveBreadcrumbTier,\n type CngxBreadcrumbWidthTier,\n} from './breadcrumb/breadcrumb-responsive';\nexport { CngxToggle } from './toggle/toggle.component';\nexport { CngxCheckbox } from './checkbox/checkbox.component';\nexport { CngxCheckboxGroup } from './checkbox-group/checkbox-group.component';\nexport {\n CNGX_BUTTON_TOGGLE_GROUP,\n type CngxButtonToggleGroupContract,\n} from './button-toggle/button-toggle-group.token';\nexport { CngxButtonToggleGroup } from './button-toggle/button-toggle-group.component';\nexport {\n CNGX_BUTTON_MULTI_TOGGLE_GROUP,\n type CngxButtonMultiToggleGroupContract,\n} from './button-toggle/button-multi-toggle-group.token';\nexport { CngxButtonMultiToggleGroup } from './button-toggle/button-multi-toggle-group.component';\nexport { CngxButtonToggle } from './button-toggle/button-toggle.directive';\nexport {\n CNGX_RADIO_GROUP,\n type CngxRadioGroupContract,\n type CngxRadioRegistration,\n} from './radio/radio-group.token';\nexport { CngxRadioGroup } from './radio/radio-group.component';\nexport { CngxRadio } from './radio/radio.component';\nexport {\n CNGX_CHIP_GROUP_HOST,\n type CngxChipGroupHost,\n} from './chip-group/chip-group-host.token';\nexport { CngxChipInteraction } from './chip-interaction/chip-interaction.directive';\nexport { CngxChipInGroup } from './chip-in-group/chip-in-group.directive';\nexport { CngxChipGroup } from './chip-group/chip-group.component';\nexport { CngxMultiChipGroup } from './multi-chip-group/multi-chip-group.component';\nexport { CngxChipInput } from './chip-input/chip-input.directive';\nexport {\n CNGX_TREE_CONTROLLER_FACTORY,\n createTreeController,\n type CngxTreeController,\n type CngxTreeControllerFactory,\n type CngxTreeControllerOptions,\n} from './tree-controller/tree-controller';\nexport { createTreeAdItems } from './tree-controller/tree-ad-items';\nexport {\n CNGX_TREE_CONFIG,\n injectTreeConfig,\n provideTreeConfig,\n provideTreeConfigAt,\n withDefaultInitiallyExpanded,\n withDefaultKeyFn,\n withDefaultLabelFn,\n withDefaultNodeIdFn,\n withTreeCacheLimit,\n type CngxTreeConfig,\n type CngxTreeConfigFeature,\n} from './tree-controller/tree-config';\nexport { CngxHierarchicalNav } from './hierarchical-nav/hierarchical-nav.directive';\nexport {\n CNGX_HIERARCHICAL_NAV_STRATEGY,\n createW3CTreeStrategy,\n type CngxHierarchicalNavAction,\n type CngxHierarchicalNavContext,\n type CngxHierarchicalNavStrategy,\n} from './hierarchical-nav/hierarchical-nav-strategy';\nexport { withRetry, type RetryConfig, type RetryState } from './retry/with-retry';\nexport { optimistic, type OptimisticState } from './optimistic/optimistic';\nexport { CngxLongPress } from './gestures/long-press.directive';\nexport { CngxSwipe } from './gestures/swipe.directive';\nexport { CngxSwipeDismiss } from './gestures/swipe-dismiss.directive';\nexport type { SwipeAxis, SwipeDirection } from './gestures/swipe-direction';\nexport {\n CngxReorder,\n type CngxReorderEvent,\n type CngxReorderModifier,\n} from './reorder/reorder.directive';\nexport {\n CNGX_CHIP_STRIP_ROVING_FACTORY,\n createChipStripRoving,\n type CngxChipStripRovingController,\n type CngxChipStripRovingFactory,\n type CngxChipStripRovingOptions,\n} from './reorder/chip-strip-roving';\nexport { CngxKeyboardShortcut } from './keyboard/keyboard-shortcut.directive';\nexport { CngxSearch } from './keyboard/search.directive';\nexport { CngxClickOutside } from './keyboard/click-outside.directive';\nexport { CngxBeforeUnload } from './guard/before-unload.directive';\nexport { canDeactivateWhenClean } from './guard/can-deactivate';\nexport { CngxCloseButton, CNGX_CLOSE_ICON } from './close-button/close-button';\nexport { CngxHoverable } from './hoverable/hoverable.directive';\nexport { CngxSpeak } from './speak/speak.directive';\nexport { CngxOption } from './listbox/option.directive';\nexport { CngxOptionGroup } from './listbox/option-group.directive';\nexport {\n CNGX_OPTION_CONTAINER,\n type CngxOptionContainer,\n type CngxOptionContainerGroup,\n type CngxOptionContainerOption,\n} from './listbox/option-container';\nexport {\n CNGX_OPTION_STATUS_HOST,\n type CngxOptionStatus,\n type CngxOptionStatusHost,\n} from './listbox/option-status-host';\nexport {\n CNGX_OPTION_FILTER_HOST,\n type CngxOptionFilterHost,\n} from './listbox/option-filter-host';\nexport {\n CNGX_OPTION_INTERACTION_HOST,\n type CngxOptionInteractionHost,\n} from './listbox/option-interaction-host';\nexport { CngxListbox } from './listbox/listbox.directive';\nexport {\n CngxListboxSearch,\n type ListboxMatchFn,\n} from './listbox/listbox-search.directive';\nexport { CngxListboxTrigger } from './listbox/listbox-trigger.directive';\nexport { CngxMenu } from './menu/menu.directive';\nexport { CNGX_MENU_HOST, type CngxMenuHost } from './menu/menu-host.token';\nexport {\n CNGX_MENU_SUBMENU_ITEM,\n type CngxMenuSubmenuLike,\n} from './menu/menu-submenu.token';\nexport { CngxMenuItem } from './menu/menu-item.directive';\nexport {\n CngxMenuItemIcon,\n CngxMenuItemKbd,\n CngxMenuItemLabel,\n CngxMenuItemSuffix,\n} from './menu/menu-item-slot.directives';\nexport { CngxMenuItemSubmenu } from './menu/menu-item-submenu.directive';\nexport { CNGX_SUBMENU_TRY_FALLBACKS } from './menu/submenu-defaults';\nexport { CngxMenuItemCheckbox } from './menu/menu-item-checkbox.directive';\nexport { CngxMenuItemRadio } from './menu/menu-item-radio.directive';\nexport { CngxMenuGroup } from './menu/menu-group.directive';\nexport { CngxMenuSeparator } from './menu/menu-separator.directive';\nexport {\n CNGX_MENU_NAV_STRATEGY,\n createW3CMenuStrategy,\n type CngxMenuNavAction,\n type CngxMenuNavContext,\n type CngxMenuNavStrategy,\n} from './menu/menu-nav-strategy';\nexport {\n CNGX_MENU_CONFIG,\n DEFAULT_MENU_CONFIG,\n injectMenuConfig,\n provideMenuConfig,\n provideMenuConfigAt,\n type CngxMenuAriaLabels,\n type CngxMenuConfig,\n type CngxMenuConfigFeature,\n} from './menu/menu-config';\nexport {\n withAriaLabels,\n withCloseOnSelect,\n withDismissOnBlur,\n withDismissOnOutsideClick,\n withDismissOnScroll,\n withSubmenuCloseDelay,\n withSubmenuOpenDelay,\n withTypeaheadDebounce,\n} from './menu/menu-config-features';\nexport {\n CNGX_MENU_DISMISS_HANDLER_FACTORY,\n createMenuDismissHandler,\n createMenuTriggerDismissBinding,\n type CngxMenuDismissHandler,\n type CngxMenuDismissHandlerFactory,\n type CngxMenuDismissHandlerOptions,\n type CngxMenuDismissPopoverRef,\n type CngxMenuDismissSource,\n type CngxMenuTriggerDismissBinding,\n type CngxMenuTriggerDismissBindingOptions,\n} from './menu/dismiss-handler';\nexport {\n CNGX_MENU_ANNOUNCER_FACTORY,\n CngxMenuAnnouncer,\n createMenuAnnouncer,\n injectMenuAnnouncer,\n type CngxMenuAnnouncerFactory,\n type CngxMenuAnnouncerLike,\n} from './menu/menu-announcer';\nexport { CngxContextMenuTrigger } from './menu/context-menu-trigger.directive';\nexport { provideCngxMenu, type CngxMenuFeature } from './menu/provide-cngx-menu';\nexport {\n CNGX_MENU_RADIO_GROUP,\n createMenuRadioController,\n type CngxMenuRadioGroup,\n type CngxMenuRadioGroupFactory,\n} from './menu/menu-radio-controller';\nexport { CngxMenuTrigger } from './menu/menu-trigger.directive';\nexport { CngxErrorState } from './error-state/error-state.directive';\nexport {\n CNGX_ERROR_SCOPE,\n type CngxErrorScopeContract,\n} from './error-scope/error-scope.token';\nexport { CngxErrorScope } from './error-scope/error-scope.directive';\nexport {\n CNGX_ERROR_AGGREGATOR,\n type CngxErrorAggregatorContract,\n type CngxErrorAggregatorSourceEntry,\n} from './error-aggregator/error-aggregator.token';\nexport { CngxErrorSource } from './error-source/error-source.directive';\nexport { CngxErrorAggregator } from './error-aggregator/error-aggregator.directive';\nexport { CngxErrorRegistry } from './error-registry/error-registry';\nexport { injectErrorScope } from './error-registry/inject-error-scope';\nexport { injectErrorAggregator } from './error-registry/inject-error-aggregator';\nexport {\n provideErrorRegistry,\n withGlobalRevealOnSubmit,\n withRevealOnNavigate,\n type ErrorRegistryFeature,\n} from './error-registry/provide-error-registry';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.CngxPressable","i2.CngxRipple","i1.CngxDisclosure","i1.CngxSliderTrack","i1.CngxRangeSliderTrack","isCloseButtonClick","NOOP","i1.CngxSearch"],"mappings":";;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCG;MAeU,cAAc,CAAA;AACR,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;AAChD,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;IAGvC,MAAM,GAAG,KAAK,CAAC,QAAQ,6EAAgB,KAAK,EAAE,gBAAgB,EAAA,CAAG;;AAGjE,IAAA,gBAAgB,GAAG,KAAK,CAAS,IAAI,uFAAC;;AAGtC,IAAA,OAAO,GAAG,KAAK,CAAU,IAAI,8EAAC;;AAG9B,IAAA,qBAAqB,GAAG,KAAK,CAAS,kB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;;;;;;;;;;;;;;;;AAgBG;SACa,oBAAoB,GAAA;AAClC,IAAA,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,EAAE;AAC9D;;AClJA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cngx-common-interactive.mjs","sources":["../../../projects/common/interactive/async-click/async-click.directive.ts","../../../projects/common/interactive/async-click/async-status-templates.ts","../../../projects/common/interactive/async-status/async-status.directive.ts","../../../projects/common/interactive/copy/copy-text.directive.ts","../../../projects/common/interactive/copy/copy-block.ts","../../../projects/common/interactive/ripple/ripple.directive.ts","../../../projects/common/interactive/ripple/pressable.directive.ts","../../../projects/common/interactive/ripple/press-ripple.directive.ts","../../../projects/common/interactive/nav/nav-group-registry.ts","../../../projects/common/interactive/nav/nav-config.ts","../../../projects/common/interactive/nav/disclosure.directive.ts","../../../projects/common/interactive/nav/nav-group.directive.ts","../../../projects/common/interactive/nav/nav-label.directive.ts","../../../projects/common/interactive/nav/nav-link.directive.ts","../../../projects/common/interactive/nav/nav-badge.directive.ts","../../../projects/common/interactive/expandable/expandable.directive.ts","../../../projects/common/interactive/hover-intent/hover-intent.directive.ts","../../../projects/common/interactive/control-value/control-value.token.ts","../../../projects/common/interactive/slider/slider-core.ts","../../../projects/common/interactive/slider/slider-interaction.ts","../../../projects/common/interactive/slider/slider.directive.ts","../../../projects/common/interactive/slider/slider-ticks.ts","../../../projects/common/interactive/slider/slider.component.ts","../../../projects/common/interactive/slider/range-slider.token.ts","../../../projects/common/interactive/slider/range-slider.directive.ts","../../../projects/common/interactive/slider/slider-thumb.directive.ts","../../../projects/common/interactive/slider/range-slider.component.ts","../../../projects/common/interactive/accordion/accordion-keyboard-nav.ts","../../../projects/common/interactive/accordion/accordion.token.ts","../../../projects/common/interactive/accordion/accordion.directive.ts","../../../projects/common/interactive/accordion/accordion-panel.directive.ts","../../../projects/common/interactive/breadcrumb/breadcrumb.token.ts","../../../projects/common/interactive/breadcrumb/breadcrumb-item.directive.ts","../../../projects/common/interactive/breadcrumb/breadcrumb-collapse.ts","../../../projects/common/interactive/breadcrumb/breadcrumb-collapse.token.ts","../../../projects/common/interactive/breadcrumb/breadcrumb.directive.ts","../../../projects/common/interactive/breadcrumb/breadcrumb-separator.directive.ts","../../../projects/common/interactive/breadcrumb/breadcrumb-responsive.ts","../../../projects/common/interactive/error-aggregator/error-aggregator.token.ts","../../../projects/common/interactive/toggle/toggle.component.ts","../../../projects/common/interactive/checkbox/checkbox.component.ts","../../../projects/common/interactive/checkbox-group/checkbox-group.component.ts","../../../projects/common/interactive/button-toggle/button-toggle-group.token.ts","../../../projects/common/interactive/button-toggle/button-toggle-group.component.ts","../../../projects/common/interactive/button-toggle/button-multi-toggle-group.token.ts","../../../projects/common/interactive/button-toggle/button-multi-toggle-group.component.ts","../../../projects/common/interactive/button-toggle/button-toggle.directive.ts","../../../projects/common/interactive/radio/radio-group.token.ts","../../../projects/common/interactive/radio/radio-group.component.ts","../../../projects/common/interactive/radio/radio.component.ts","../../../projects/common/interactive/chip-group/chip-group-host.token.ts","../../../projects/common/interactive/chip-interaction/chip-interaction.directive.ts","../../../projects/common/interactive/chip-in-group/chip-in-group.directive.ts","../../../projects/common/interactive/chip-group/chip-group.component.ts","../../../projects/common/interactive/multi-chip-group/multi-chip-group.component.ts","../../../projects/common/interactive/chip-input/chip-input.directive.ts","../../../projects/common/interactive/tree-controller/tree-config.ts","../../../projects/common/interactive/tree-controller/tree-controller.ts","../../../projects/common/interactive/tree-controller/tree-ad-items.ts","../../../projects/common/interactive/hierarchical-nav/hierarchical-nav-strategy.ts","../../../projects/common/interactive/hierarchical-nav/hierarchical-nav.directive.ts","../../../projects/common/interactive/retry/with-retry.ts","../../../projects/common/interactive/optimistic/optimistic.ts","../../../projects/common/interactive/gestures/long-press.directive.ts","../../../projects/common/interactive/gestures/swipe.directive.ts","../../../projects/common/interactive/gestures/swipe-dismiss.directive.ts","../../../projects/common/interactive/reorder/reorder.directive.ts","../../../projects/common/interactive/reorder/chip-strip-roving.ts","../../../projects/common/interactive/keyboard/keyboard-shortcut.directive.ts","../../../projects/common/interactive/keyboard/search.directive.ts","../../../projects/common/interactive/keyboard/click-outside.directive.ts","../../../projects/common/interactive/guard/before-unload.directive.ts","../../../projects/common/interactive/guard/can-deactivate.ts","../../../projects/common/interactive/close-button/close-button.ts","../../../projects/common/interactive/hoverable/hoverable.directive.ts","../../../projects/common/interactive/speak/speak.directive.ts","../../../projects/common/interactive/listbox/option-container.ts","../../../projects/common/interactive/listbox/option-filter-host.ts","../../../projects/common/interactive/listbox/option-interaction-host.ts","../../../projects/common/interactive/listbox/option-status-host.ts","../../../projects/common/interactive/listbox/option.directive.ts","../../../projects/common/interactive/listbox/option-group.directive.ts","../../../projects/common/interactive/listbox/listbox.directive.ts","../../../projects/common/interactive/listbox/listbox-search.directive.ts","../../../projects/common/interactive/listbox/listbox-trigger.directive.ts","../../../projects/common/interactive/menu/menu-announcer.ts","../../../projects/common/interactive/menu/menu-config.ts","../../../projects/common/interactive/menu/menu-host.token.ts","../../../projects/common/interactive/menu/menu-submenu.token.ts","../../../projects/common/interactive/menu/menu.directive.ts","../../../projects/common/interactive/menu/menu-item.directive.ts","../../../projects/common/interactive/menu/menu-item-slot.directives.ts","../../../projects/common/interactive/menu/menu-item-submenu.directive.ts","../../../projects/common/interactive/menu/submenu-defaults.ts","../../../projects/common/interactive/menu/menu-item-checkbox.directive.ts","../../../projects/common/interactive/menu/menu-radio-controller.ts","../../../projects/common/interactive/menu/menu-item-radio.directive.ts","../../../projects/common/interactive/menu/menu-group.directive.ts","../../../projects/common/interactive/menu/menu-separator.directive.ts","../../../projects/common/interactive/menu/menu-nav-strategy.ts","../../../projects/common/interactive/menu/menu-config-features.ts","../../../projects/common/interactive/menu/dismiss-handler.ts","../../../projects/common/interactive/menu/context-menu-trigger.directive.ts","../../../projects/common/interactive/menu/provide-cngx-menu.ts","../../../projects/common/interactive/menu/menu-trigger.directive.ts","../../../projects/common/interactive/error-state/error-state.directive.ts","../../../projects/common/interactive/error-scope/error-scope.token.ts","../../../projects/common/interactive/error-registry/equal-fns.ts","../../../projects/common/interactive/error-registry/error-registry.ts","../../../projects/common/interactive/error-scope/error-scope.directive.ts","../../../projects/common/interactive/error-source/error-source.directive.ts","../../../projects/common/interactive/error-registry/aggregator-contract.ts","../../../projects/common/interactive/error-aggregator/error-aggregator.directive.ts","../../../projects/common/interactive/error-registry/inject-error-scope.ts","../../../projects/common/interactive/error-registry/inject-error-aggregator.ts","../../../projects/common/interactive/error-registry/provide-error-registry.ts","../../../projects/common/interactive/public-api.ts","../../../projects/common/interactive/cngx-common-interactive.ts"],"sourcesContent":["import {\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n signal,\n type Signal,\n} from '@angular/core';\nimport { buildAsyncStateView, type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\nimport { firstValueFrom, isObservable, type Observable } from 'rxjs';\n\n/**\n * Action function that returns a Promise or Observable.\n *\n * @category common/interactive\n */\nexport type AsyncAction = () => Promise<unknown> | Observable<unknown>;\n\n/**\n * Async action handler with loading state, auto-disable, and success/error feedback.\n *\n * Place on any clickable element (button, link, div). Executes the provided\n * async action on click, tracks the full lifecycle as a state machine, auto-disables\n * during execution, announces state changes to screen readers, and guards against\n * double-clicks.\n *\n * ### Basic usage\n * ```html\n * <button [cngxAsyncClick]=\"saveAction\" #btn=\"cngxAsyncClick\">\n * @switch (btn.status()) {\n * @case ('pending') { Saving... }\n * @case ('success') { Saved! }\n * @case ('error') { Failed }\n * @default { Save }\n * }\n * </button>\n * ```\n *\n * ### With Material\n * ```html\n * <button mat-raised-button [cngxAsyncClick]=\"submitForm\" #btn=\"cngxAsyncClick\">\n * @if (btn.pending()) { <mat-spinner diameter=\"20\" /> Submitting... }\n * @else { Submit }\n * </button>\n * ```\n *\n * ### On any element\n * ```html\n * <a role=\"button\" [cngxAsyncClick]=\"navigate\" #btn=\"cngxAsyncClick\">Go</a>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-click.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPending, CngxSucceeded, CngxFailed, CngxActionButton\n * <example-url>http://localhost:4200/#/common/interactive/retry/optimistic-instant-like-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/retry/withretry-cngxasyncclick</example-url>\n */\n@Directive({\n selector: '[cngxAsyncClick]',\n standalone: true,\n exportAs: 'cngxAsyncClick',\n host: {\n '(click)': 'handleClick($event)',\n '[class.cngx-async--pending]': 'pending()',\n '[class.cngx-async--success]': 'succeeded()',\n '[class.cngx-async--error]': 'failed()',\n '[attr.aria-busy]': 'pending() || null',\n '[attr.aria-disabled]': 'pending() || null',\n '[attr.disabled]': 'shouldDisable()',\n },\n})\nexport class CngxAsyncClick {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n\n /** The async action to execute on click. */\n readonly action = input.required<AsyncAction>({ alias: 'cngxAsyncClick' });\n\n /** Duration in ms to show success/error state before reset. */\n readonly feedbackDuration = input<number>(2000);\n\n /** When `false`, clicks are ignored (does not set `disabled` attribute). */\n readonly enabled = input<boolean>(true);\n\n /** Label announced to screen readers on success. */\n readonly succeededAnnouncement = input<string>('Action succeeded');\n\n /** Label announced to screen readers on failure. */\n readonly failedAnnouncement = input<string>('Action failed');\n\n private readonly pendingState = signal(false);\n private readonly succeededState = signal(false);\n private readonly failedState = signal(false);\n private readonly errorState = signal<unknown>(undefined);\n private readonly lastUpdatedState = signal<Date | undefined>(undefined);\n private feedbackTimer: ReturnType<typeof setTimeout> | null = null;\n private readonly supportsDisabled: boolean;\n private destroyed = false;\n\n constructor() {\n const tag = this.el.nativeElement.tagName;\n this.supportsDisabled =\n tag === 'BUTTON' || tag === 'INPUT' || tag === 'SELECT' || tag === 'TEXTAREA';\n\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n if (this.feedbackTimer != null) {\n clearTimeout(this.feedbackTimer);\n }\n });\n }\n\n /** `true` while the action is executing. */\n readonly pending: Signal<boolean> = this.pendingState.asReadonly();\n\n /** `true` for `feedbackDuration` ms after a successful action. */\n readonly succeeded: Signal<boolean> = this.succeededState.asReadonly();\n\n /** `true` for `feedbackDuration` ms after a failed action. */\n readonly failed: Signal<boolean> = this.failedState.asReadonly();\n\n /** The error value from a failed action. Cleared on reset. */\n readonly error: Signal<unknown> = this.errorState.asReadonly();\n\n /** Current lifecycle status - use in `@switch` for template branching. */\n readonly status = computed<AsyncStatus>(() => {\n if (this.pendingState()) {\n return 'pending';\n }\n if (this.succeededState()) {\n return 'success';\n }\n if (this.failedState()) {\n return 'error';\n }\n return 'idle';\n });\n\n /** Screen reader announcement for the current state - bind to an `aria-live` region. */\n readonly announcement = computed(() => {\n if (this.succeededState()) {\n return this.succeededAnnouncement();\n }\n if (this.failedState()) {\n return this.failedAnnouncement();\n }\n return '';\n });\n\n /**\n * Full `CngxAsyncState` view of this directive's lifecycle.\n *\n * Bind to any state consumer (`[state]=\"btn.state\"`) to connect the\n * feedback system - toasts, alerts, skeletons, async containers.\n */\n readonly state: CngxAsyncState<unknown> = buildAsyncStateView<unknown>({\n status: this.status,\n data: computed(() => undefined),\n error: this.error,\n lastUpdated: this.lastUpdatedState.asReadonly(),\n });\n\n /** @internal */\n protected readonly shouldDisable = computed(() =>\n this.pendingState() && this.supportsDisabled ? '' : null,\n );\n\n /** @internal */\n protected async handleClick(event: Event): Promise<void> {\n if (!this.enabled() || this.pendingState()) {\n event.preventDefault();\n return;\n }\n\n this.clearFeedback();\n this.pendingState.set(true);\n\n try {\n const actionFn = this.action();\n const result$ = actionFn();\n const promise = isObservable(result$)\n ? firstValueFrom(result$, { defaultValue: undefined })\n : result$;\n await promise;\n if (this.destroyed) {\n return;\n }\n this.pendingState.set(false);\n this.succeededState.set(true);\n this.lastUpdatedState.set(new Date());\n this.scheduleFeedbackReset();\n } catch (err: unknown) {\n if (this.destroyed) {\n return;\n }\n this.pendingState.set(false);\n this.failedState.set(true);\n this.errorState.set(err);\n this.scheduleFeedbackReset();\n }\n }\n\n private scheduleFeedbackReset(): void {\n if (this.feedbackTimer != null) {\n clearTimeout(this.feedbackTimer);\n }\n this.feedbackTimer = setTimeout(() => {\n this.succeededState.set(false);\n this.failedState.set(false);\n this.errorState.set(undefined);\n this.feedbackTimer = null;\n }, this.feedbackDuration());\n }\n\n private clearFeedback(): void {\n if (this.feedbackTimer != null) {\n clearTimeout(this.feedbackTimer);\n this.feedbackTimer = null;\n }\n this.succeededState.set(false);\n this.failedState.set(false);\n this.errorState.set(undefined);\n }\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Template shown while an async action is executing.\n *\n * Used by `CngxActionButton` and `CngxPopoverAction` to project\n * custom pending-state content.\n *\n * ```html\n * <ng-template cngxPending>Saving...</ng-template>\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-status-templates.ts\n * @since 0.1.0\n * @relatedTo CngxSucceeded, CngxFailed, CngxAsyncClick\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>\n */\n@Directive({ selector: 'ng-template[cngxPending]', standalone: true })\nexport class CngxPending {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Template shown after an async action succeeds (for `feedbackDuration` ms).\n *\n * ```html\n * <ng-template cngxSucceeded>Saved!</ng-template>\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-status-templates.ts\n * @since 0.1.0\n * @relatedTo CngxPending, CngxFailed, CngxAsyncClick\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>\n */\n@Directive({ selector: 'ng-template[cngxSucceeded]', standalone: true })\nexport class CngxSucceeded {\n readonly templateRef = inject(TemplateRef);\n}\n\n/**\n * Template shown after an async action fails (for `feedbackDuration` ms).\n * The implicit template context provides the error value.\n *\n * ```html\n * <ng-template cngxFailed let-err>Failed: {{ err }}</ng-template>\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-status-templates.ts\n * @since 0.1.0\n * @relatedTo CngxPending, CngxSucceeded, CngxAsyncClick\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>\n */\n@Directive({ selector: 'ng-template[cngxFailed]', standalone: true })\nexport class CngxFailed {\n readonly templateRef = inject(TemplateRef);\n}\n","import {\n computed,\n Directive,\n contentChild,\n inject,\n input,\n isDevMode,\n type Signal,\n type TemplateRef,\n} from '@angular/core';\n\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\nimport { CngxAsyncClick } from '../async-click/async-click.directive';\nimport { CngxFailed, CngxPending, CngxSucceeded } from '../async-click/async-status-templates';\n\n/**\n * Display bucket a reflector collapses an {@link CngxAsyncState} into.\n * The `loading` / `refreshing` busy variants fold into `pending` for the\n * visible status, while `isBusy` carries the full busy set for ARIA.\n *\n * @category common/interactive\n */\nexport type CngxAsyncDisplayStatus = 'idle' | 'pending' | 'success' | 'error';\n\n/**\n * Single source for collapsing a {@link CngxAsyncState} into its display\n * bucket. Owned by the {@link CngxAsyncStatus} reflector so every consumer\n * (the reflector directive, `CngxActionButton`'s `[externalState]` branch)\n * maps an externally-owned state the same way - one reflection code path.\n *\n * @category common/interactive\n */\nexport function reflectAsyncDisplayStatus(\n state: CngxAsyncState<unknown> | null | undefined,\n): CngxAsyncDisplayStatus {\n switch (state?.status()) {\n case 'pending':\n case 'loading':\n case 'refreshing':\n return 'pending';\n case 'success':\n return 'success';\n case 'error':\n return 'error';\n default:\n return 'idle';\n }\n}\n\n/**\n * Reflects an externally-owned {@link CngxAsyncState} onto its host -\n * the read-only sibling of `CngxAsyncClick`. Where `CngxAsyncClick`\n * *runs* an action and owns its own lifecycle, `CngxAsyncStatus` *reads*\n * a state someone else produces (a presenter's `commitState`, a resource)\n * and surfaces it as `aria-busy`, an optional disabled gate, and the\n * pending / succeeded / failed slot markers.\n *\n * One responsibility - reflection - kept distinct from running an action\n * (Pillar 3). `aria-busy` lives in the `computed()` graph (Pillar 2) and\n * is owned here exclusively: never co-place this with `CngxAsyncClick` on\n * the same element, since both bind `aria-busy` (dev mode warns).\n *\n * ```html\n * <button [cngxAsyncStatus]=\"presenter.commitState\" disableWhilePending>\n * Continue\n * <ng-template cngxPending>Saving…</ng-template>\n * </button>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-status/async-status.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAsyncClick, CngxPending, CngxSucceeded, CngxFailed\n */\n@Directive({\n selector: '[cngxAsyncStatus]',\n standalone: true,\n exportAs: 'cngxAsyncStatus',\n host: {\n '[attr.aria-busy]': 'isBusy() || null',\n '[attr.aria-disabled]': 'disabledAttr() !== null || null',\n '[attr.disabled]': 'disabledAttr()',\n },\n})\nexport class CngxAsyncStatus {\n private readonly coPlacedAsyncClick = inject(CngxAsyncClick, { self: true, optional: true });\n\n constructor() {\n if (isDevMode() && this.coPlacedAsyncClick) {\n console.warn(\n 'CngxAsyncStatus: [cngxAsyncStatus] and [cngxAsyncClick] on the same element ' +\n 'both bind aria-busy. Use one or the other.',\n );\n }\n }\n\n /** The externally-owned state to reflect. `null` reflects as idle. */\n readonly state = input<CngxAsyncState<unknown> | null>(null, { alias: 'cngxAsyncStatus' });\n\n /** When `true`, the host reflects `aria-disabled` / `disabled` while busy. */\n readonly disableWhilePending = input<boolean>(false);\n\n /** Display bucket of the reflected state (`loading`/`refreshing` → `pending`). */\n readonly status: Signal<CngxAsyncDisplayStatus> = computed(() =>\n reflectAsyncDisplayStatus(this.state()),\n );\n\n /** `true` while the reflected state is busy (`loading` | `pending` | `refreshing`). */\n readonly isBusy: Signal<boolean> = computed(() => this.state()?.isBusy() ?? false);\n\n /** The reflected error value, or `undefined`. */\n readonly error: Signal<unknown> = computed(() => this.state()?.error());\n\n /** @internal */\n protected readonly pendingTpl = contentChild(CngxPending);\n /** @internal */\n protected readonly succeededTpl = contentChild(CngxSucceeded);\n /** @internal */\n protected readonly failedTpl = contentChild(CngxFailed);\n\n /**\n * The projected slot marker matching the current display bucket, or\n * `null` when none is projected. Bind via\n * `*ngTemplateOutlet=\"status.activeTemplate()\"`.\n */\n readonly activeTemplate: Signal<TemplateRef<unknown> | null> = computed(() => {\n switch (this.status()) {\n case 'pending':\n return this.pendingTpl()?.templateRef ?? null;\n case 'success':\n return this.succeededTpl()?.templateRef ?? null;\n case 'error':\n return this.failedTpl()?.templateRef ?? null;\n default:\n return null;\n }\n });\n\n /** @internal - `''` (set) while gated-and-busy, else `null` (absent). */\n protected readonly disabledAttr = computed<'' | null>(() =>\n this.disableWhilePending() && this.isBusy() ? '' : null,\n );\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, inject, input, output, signal, type Signal } from '@angular/core';\n\n/**\n * Clipboard copy behavior - forms-free version for `@cngx/common`.\n *\n * Place on a button or any clickable element. Copies the provided text to the\n * clipboard. Shows a `copied` signal for visual feedback (auto-resets after\n * `resetDelay`). Falls back to `execCommand('copy')` when Clipboard API is\n * unavailable.\n *\n * Unlike `CngxCopyValue` from `@cngx/forms/input`, this has no forms dependency\n * and lives at Level 2 (`@cngx/common`), making it available to any consumer.\n *\n * ### Copy a token\n * ```html\n * <code>{{ apiKey() }}</code>\n * <button [cngxCopyText]=\"apiKey()\" #cp=\"cngxCopyText\">\n * {{ cp.copied() ? 'Copied!' : 'Copy' }}\n * </button>\n * ```\n *\n * ### Copy with SR announcement\n * ```html\n * <button [cngxCopyText]=\"shareUrl()\">Copy Link</button>\n * <span aria-live=\"polite\" class=\"sr-only\">\n * {{ cp.copied() ? 'Link copied to clipboard' : '' }}\n * </span>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/copy/copy-text.directive.ts\n * @since 0.1.0\n * @relatedTo CngxCopyBlock, CngxCopyValue\n * <example-url>http://localhost:4200/#/common/interactive/copy/text/copy-token</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/copy/text/copy-url-with-sr-announcement</example-url>\n */\n@Directive({\n selector: '[cngxCopyText]',\n standalone: true,\n exportAs: 'cngxCopyText',\n host: {\n '(click)': 'copy()',\n },\n})\nexport class CngxCopyText {\n private readonly destroyRef = inject(DestroyRef);\n private readonly doc = inject(DOCUMENT);\n\n /** The text to copy to the clipboard. */\n readonly text = input.required<string>({ alias: 'cngxCopyText' });\n\n /** Duration in ms to keep `copied` true after a successful copy. */\n readonly resetDelay = input<number>(2000);\n\n private readonly copiedState = signal(false);\n private readonly failedState = signal(false);\n private resetTimer: ReturnType<typeof setTimeout> | null = null;\n\n /** `true` for `resetDelay` ms after a successful copy. */\n readonly copied: Signal<boolean> = this.copiedState.asReadonly();\n\n /** `true` when the last copy attempt failed (permission denied, etc.). Resets on next attempt. */\n readonly failed: Signal<boolean> = this.failedState.asReadonly();\n\n /** Whether the Clipboard API is available in this environment. */\n readonly supported = typeof navigator !== 'undefined' && !!navigator.clipboard;\n\n /** Emitted after a successful copy with the copied text. */\n readonly didCopy = output<string>();\n\n /** Emitted when a copy attempt fails. */\n readonly copyFailed = output<unknown>();\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n if (this.resetTimer != null) {\n clearTimeout(this.resetTimer);\n }\n });\n }\n\n /** Copies the text to the clipboard. */\n async copy(): Promise<void> {\n const value = this.text();\n if (!value) {\n return;\n }\n\n this.failedState.set(false);\n\n try {\n if (this.supported) {\n await navigator.clipboard.writeText(value);\n } else {\n this.fallbackCopy(value);\n }\n\n this.copiedState.set(true);\n this.didCopy.emit(value);\n\n if (this.resetTimer != null) {\n clearTimeout(this.resetTimer);\n }\n this.resetTimer = setTimeout(() => {\n this.copiedState.set(false);\n this.resetTimer = null;\n }, this.resetDelay());\n } catch (err: unknown) {\n this.failedState.set(true);\n this.copyFailed.emit(err);\n }\n }\n\n /** execCommand fallback for environments without Clipboard API. */\n private fallbackCopy(text: string): void {\n const textarea = this.doc.createElement('textarea');\n textarea.value = text;\n textarea.style.position = 'fixed';\n textarea.style.left = '-9999px';\n textarea.style.opacity = '0';\n this.doc.body.appendChild(textarea);\n textarea.select();\n this.doc.execCommand('copy');\n this.doc.body.removeChild(textarea);\n }\n}\n","import { ChangeDetectionStrategy, Component, input, ViewEncapsulation } from '@angular/core';\n\nimport { CngxCopyText } from './copy-text.directive';\n\n/**\n * Molecule: code/text block with a built-in copy button.\n *\n * Renders content in a container with a \"Copy\" button that uses `CngxCopyText`\n * internally. Shows \"Copied!\" feedback automatically. The copy button includes\n * an `aria-live` region for screen reader announcements.\n *\n * ### Copy a code snippet\n * ```html\n * <cngx-copy-block [value]=\"'npm install @cngx/common'\">\n * <code>npm install @cngx/common</code>\n * </cngx-copy-block>\n * ```\n *\n * ### Copy an API key\n * ```html\n * <cngx-copy-block [value]=\"apiKey()\" buttonLabel=\"Copy Key\">\n * {{ apiKey() }}\n * </cngx-copy-block>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/copy/copy-block.ts\n * @since 0.1.0\n * @relatedTo CngxCopyText\n * <example-url>http://localhost:4200/#/common/interactive/copy/block/api-key</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/copy/block/code-snippet</example-url>\n */\n@Component({\n selector: 'cngx-copy-block',\n exportAs: 'cngxCopyBlock',\n standalone: true,\n imports: [CngxCopyText],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-copy-block',\n },\n template: `\n <div class=\"cngx-copy-block__content\">\n <ng-content />\n </div>\n <button\n type=\"button\"\n class=\"cngx-copy-block__button\"\n [cngxCopyText]=\"value()\"\n #cp=\"cngxCopyText\"\n [class.cngx-copy-block__button--copied]=\"cp.copied()\"\n >\n {{ cp.copied() ? copiedLabel() : buttonLabel() }}\n <span aria-live=\"polite\" class=\"cngx-sr-only\">\n {{ cp.copied() ? srAnnouncement() : '' }}\n </span>\n </button>\n `,\n styleUrls: ['./copy-block.css'],\n})\nexport class CngxCopyBlock {\n /** The text value to copy to clipboard. */\n readonly value = input.required<string>();\n /** Label for the copy button. */\n readonly buttonLabel = input<string>('Copy');\n /** Label shown after successful copy. */\n readonly copiedLabel = input<string>('Copied!');\n /** Screen reader announcement on copy. */\n readonly srAnnouncement = input<string>('Copied to clipboard');\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, input, signal } from '@angular/core';\n\n/**\n * Touch/click ripple feedback without Material dependency.\n *\n * Creates a `<span class=\"cngx-ripple__wave\">` on pointer contact, positions it\n * via CSS custom properties (`--cngx-ripple-x`, `--cngx-ripple-y`, `--cngx-ripple-size`),\n * and removes it after the animation completes. ALL visual treatment - color, duration,\n * shape - is the consumer's CSS responsibility.\n *\n * Ships a companion `_ripple.scss` with sensible defaults.\n *\n * ### Button with ripple\n * ```html\n * <button cngxRipple>Click me</button>\n * ```\n *\n * ### Centered ripple for icon buttons\n * ```html\n * <button cngxRipple [rippleCentered]=\"true\" class=\"icon-btn\">\n * <mat-icon>favorite</mat-icon>\n * </button>\n * ```\n *\n * ### Disable ripple\n * ```html\n * <button cngxRipple [rippleDisabled]=\"isReducedMotion()\">Click</button>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/ripple/ripple.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPressable, CngxPressRipple, CngxHoverable\n * <example-url>http://localhost:4200/#/common/interactive/ripple/base/button-ripples</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/ripple/base/card-with-ripple</example-url>\n */\n@Directive({\n selector: '[cngxRipple]',\n exportAs: 'cngxRipple',\n standalone: true,\n host: {\n '[style.position]': '\"relative\"',\n '[style.overflow]': '\"hidden\"',\n '(pointerdown)': 'handlePointerDown($event)',\n },\n})\nexport class CngxRipple {\n /** Ripple color - passed as `--cngx-ripple-color` on the wave element. */\n readonly color = input<string>('currentColor', { alias: 'rippleColor' });\n /** Whether the ripple originates from the center of the host. */\n readonly centered = input<boolean>(false, { alias: 'rippleCentered' });\n /** Whether the ripple effect is disabled. */\n readonly disabled = input<boolean>(false, { alias: 'rippleDisabled' });\n\n private readonly activeState = signal(false);\n /** Whether a ripple animation is currently playing. */\n readonly active = this.activeState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n private prefersReducedMotion = false;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n const win = this.doc.defaultView;\n\n // Detect reduced motion preference (matchMedia may not exist in test/SSR)\n if (win?.matchMedia) {\n const mql = win.matchMedia('(prefers-reduced-motion: reduce)');\n this.prefersReducedMotion = mql.matches;\n const handler = (e: MediaQueryListEvent) => (this.prefersReducedMotion = e.matches);\n mql.addEventListener('change', handler);\n destroyRef.onDestroy(() => mql.removeEventListener('change', handler));\n }\n }\n\n /** @internal */\n protected handlePointerDown(event: PointerEvent): void {\n if (this.disabled() || this.prefersReducedMotion) {\n return;\n }\n\n const host = this.el.nativeElement as HTMLElement;\n const rect = host.getBoundingClientRect();\n\n let x: number;\n let y: number;\n if (this.centered()) {\n x = rect.width / 2;\n y = rect.height / 2;\n } else {\n x = event.clientX - rect.left;\n y = event.clientY - rect.top;\n }\n\n // Ripple size = diameter of circle that covers the entire host from the origin point\n const size =\n Math.max(\n Math.hypot(x, y),\n Math.hypot(rect.width - x, y),\n Math.hypot(x, rect.height - y),\n Math.hypot(rect.width - x, rect.height - y),\n ) * 2;\n\n const wave = this.doc.createElement('span');\n wave.className = 'cngx-ripple__wave';\n wave.style.setProperty('--cngx-ripple-x', `${x}px`);\n wave.style.setProperty('--cngx-ripple-y', `${y}px`);\n wave.style.setProperty('--cngx-ripple-size', `${size}px`);\n wave.style.setProperty('--cngx-ripple-color', this.color());\n\n host.appendChild(wave);\n this.activeState.set(true);\n\n // Remove after animation completes - guard against double-invocation\n let cleaned = false;\n const cleanup = () => {\n if (cleaned) {\n return;\n }\n cleaned = true;\n clearTimeout(fallbackTimer);\n wave.remove();\n this.activeState.set(false);\n };\n\n wave.addEventListener('animationend', cleanup, { once: true });\n // Fallback timeout in case animationend doesn't fire (e.g. display:none)\n const fallbackTimer = setTimeout(cleanup, 1000);\n }\n}\n","import { DestroyRef, Directive, inject, input, signal } from '@angular/core';\n\n/**\n * Provides instant press feedback via CSS class on `pointerdown`.\n *\n * Click feedback fires too late - press feedback is immediate (0ms latency).\n * The class is removed on `pointerup` with an optional delay to prevent\n * a visual flash on quick taps.\n *\n * The directive only toggles the `cngx-pressed` class. All visual treatment\n * (scale, opacity, color) is the consumer's CSS responsibility.\n *\n * ```css\n * .cngx-pressed { transform: scale(0.97); }\n * ```\n *\n * ### Button with press feedback\n * ```html\n * <button cngxPressable>Click me</button>\n * ```\n *\n * ### Card with custom delay\n * ```html\n * <div cngxPressable [pressableReleaseDelay]=\"120\" class=\"card\">\n * Tappable card\n * </div>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/ripple/pressable.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRipple, CngxPressRipple, CngxHoverable\n * <example-url>http://localhost:4200/#/common/interactive/gestures/pressable/press-feedback-on-buttons</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/gestures/pressable/tappable-card</example-url>\n */\n@Directive({\n selector: '[cngxPressable]',\n exportAs: 'cngxPressable',\n standalone: true,\n host: {\n '[class.cngx-pressed]': 'pressed()',\n '(pointerdown)': 'handlePointerDown()',\n '(pointerup)': 'handlePointerUp()',\n '(pointercancel)': 'handlePointerCancel()',\n '(pointerleave)': 'handlePointerCancel()',\n },\n})\nexport class CngxPressable {\n /** Minimum time in ms the pressed class stays active - prevents flash on quick taps. */\n readonly releaseDelay = input<number>(80, { alias: 'pressableReleaseDelay' });\n\n private readonly pressedState = signal(false);\n /** Whether the element is currently in the pressed state. */\n readonly pressed = this.pressedState.asReadonly();\n\n /** Pending timer handle for the delayed release. */\n private releaseTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n // Cancel any pending release timer on destroy to avoid writing to a dead directive.\n inject(DestroyRef).onDestroy(() => this.clearTimer());\n }\n\n /** @internal - sets pressed state immediately on pointer contact (0ms latency). */\n protected handlePointerDown(): void {\n this.clearTimer();\n this.pressedState.set(true);\n }\n\n /** @internal - releases after `releaseDelay` ms to prevent flash on quick taps. */\n protected handlePointerUp(): void {\n const delay = this.releaseDelay();\n if (delay > 0) {\n this.releaseTimer = setTimeout(() => this.pressedState.set(false), delay);\n } else {\n this.pressedState.set(false);\n }\n }\n\n /** @internal - immediate release on cancel/leave (no delay). */\n protected handlePointerCancel(): void {\n this.clearTimer();\n this.pressedState.set(false);\n }\n\n private clearTimer(): void {\n if (this.releaseTimer !== null) {\n clearTimeout(this.releaseTimer);\n this.releaseTimer = null;\n }\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { CngxPressable } from './pressable.directive';\nimport { CngxRipple } from './ripple.directive';\n\n/**\n * Molecule combining press feedback + ripple in a single directive.\n *\n * Composes `CngxPressable` and `CngxRipple` as `hostDirectives` so the consumer\n * gets both behaviors with one attribute. The `cngx-pressed` class and ripple wave\n * both activate on pointer contact.\n *\n * ### Button with press + ripple\n * ```html\n * <button cngxPressRipple>Click me</button>\n * ```\n *\n * ### With custom ripple color\n * ```html\n * <button cngxPressRipple [rippleColor]=\"'rgba(0,0,0,0.2)'\">Click</button>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/ripple/press-ripple.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPressable, CngxRipple\n * <example-url>http://localhost:4200/#/common/interactive/ripple/press/buttons-with-press-ripple</example-url>\n */\n@Directive({\n selector: '[cngxPressRipple]',\n exportAs: 'cngxPressRipple',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxPressable,\n inputs: ['pressableReleaseDelay'],\n },\n {\n directive: CngxRipple,\n inputs: ['rippleColor', 'rippleCentered', 'rippleDisabled'],\n },\n ],\n})\nexport class CngxPressRipple {}\n","import { Injectable } from '@angular/core';\nimport type { CngxDisclosure } from './disclosure.directive';\n\n/** Minimal interface for nav group instances tracked by the registry. */\nexport interface NavGroupRef {\n readonly disclosure: CngxDisclosure;\n}\n\n/**\n * Scoped registry for single-accordion coordination.\n *\n * Provided at the sidebar/nav container level - only groups within the\n * same provider scope coordinate. Not `providedIn: 'root'` on purpose.\n *\n * ```typescript\n * @Component({\n * providers: [\n * provideNavConfig({ singleAccordion: true }),\n * CngxNavGroupRegistry,\n * ],\n * })\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-group-registry.ts\n * @since 0.1.0\n * @relatedTo CngxNavGroup, CngxDisclosure\n */\n@Injectable()\nexport class CngxNavGroupRegistry {\n private readonly groups = new Set<NavGroupRef>();\n\n /** @internal */\n register(group: NavGroupRef): void {\n this.groups.add(group);\n }\n\n /** @internal */\n unregister(group: NavGroupRef): void {\n this.groups.delete(group);\n }\n\n /** Closes all groups except the specified one. */\n closeOthers(except: NavGroupRef): void {\n this.groups.forEach((group) => {\n if (group !== except && group.disclosure.opened()) {\n group.disclosure.close();\n }\n });\n }\n}\n","import { inject, InjectionToken, type Provider } from '@angular/core';\nimport { CngxNavGroupRegistry } from './nav-group-registry';\n\n/**\n * Configuration options for the cngx nav system.\n *\n * @category common/interactive\n */\nexport interface CngxNavConfig {\n /**\n * Indentation in px per depth level.\n * Applied via `--cngx-nav-indent` CSS custom property.\n * @default 12\n */\n indent?: number;\n\n /**\n * When `true`, only one `CngxNavGroup` can be open at a time within\n * the same provider scope. Opening one group closes the others.\n * @default false\n */\n singleAccordion?: boolean;\n\n /**\n * Default animation duration in ms for disclosure transitions.\n * Applied via `--cngx-nav-transition` CSS custom property.\n * @default 150\n */\n animationDuration?: number;\n}\n\n/**\n * A feature configuration function returned by `withXxx()` helpers.\n *\n * @category common/interactive\n */\nexport interface NavConfigFeature {\n /** @internal */\n readonly apply: (config: CngxNavConfig) => CngxNavConfig;\n /** @internal */\n readonly providers?: Provider[];\n}\n\n/** Default nav configuration values. */\nexport const CNGX_NAV_DEFAULTS: Readonly<Required<CngxNavConfig>> = {\n indent: 12,\n singleAccordion: false,\n animationDuration: 150,\n};\n\n/**\n * Injection token for nav system configuration.\n *\n * ### Using feature functions\n * ```typescript\n * @Component({\n * providers: [provideNavConfig(withSingleAccordion(), withNavIndent(16))],\n * })\n * class SidebarComponent { }\n * ```\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-config.ts\n * @since 0.1.0\n */\nexport const CNGX_NAV_CONFIG = new InjectionToken<CngxNavConfig>('CNGX_NAV_CONFIG');\n\n/**\n * Provides nav system configuration. Accepts `withXxx()` feature functions\n * for composable setup.\n *\n * Automatically includes `CngxNavGroupRegistry` when `singleAccordion` is enabled\n * (either directly or via `withSingleAccordion()`).\n *\n * ```typescript\n * providers: [provideNavConfig(withSingleAccordion(), withNavIndent(16))]\n * ```\n *\n * @category common/interactive\n */\nexport function provideNavConfig(...features: NavConfigFeature[]): Provider[] {\n const config = features.reduce<CngxNavConfig>((c, f) => f.apply(c), {});\n const extraProviders = features.flatMap((f) => f.providers ?? []);\n return [\n { provide: CNGX_NAV_CONFIG, useValue: config },\n ...extraProviders,\n ...(config.singleAccordion ? [CngxNavGroupRegistry] : []),\n ];\n}\n\n/**\n * Enables single-accordion mode - only one nav group can be open at a time.\n *\n * @category common/interactive\n */\nexport function withSingleAccordion(): NavConfigFeature {\n return { apply: (c) => ({ ...c, singleAccordion: true }) };\n}\n\n/**\n * Sets the indentation per depth level in px.\n *\n * @category common/interactive\n */\nexport function withNavIndent(px: number): NavConfigFeature {\n return { apply: (c) => ({ ...c, indent: px }) };\n}\n\n/**\n * Sets the animation duration for nav group expand/collapse in ms.\n *\n * @category common/interactive\n */\nexport function withNavAnimation(ms: number): NavConfigFeature {\n return { apply: (c) => ({ ...c, animationDuration: ms }) };\n}\n\n/**\n * Injects the resolved nav config, merging provided values with defaults.\n * Must be called in an injection context.\n *\n * @category common/interactive\n */\nexport function injectNavConfig(): Readonly<Required<CngxNavConfig>> {\n return { ...CNGX_NAV_DEFAULTS, ...inject(CNGX_NAV_CONFIG, { optional: true }) };\n}\n","import { computed, Directive, input, output, signal } from '@angular/core';\n\n/**\n * Generic expand/collapse (disclosure) behavior.\n *\n * Applied to the **trigger** element (button, heading, etc.). Manages\n * `aria-expanded` and `aria-controls` host attributes directly - no need\n * to compose `CngxAriaExpanded` separately.\n *\n * Supports controlled (`[cngxDisclosureOpened]`) and uncontrolled modes,\n * following the same pattern as `CngxDrawer` and `CngxSort`.\n *\n * The consumer decides how to render/hide the content. Two approaches:\n *\n * **DOM removal** (simplest, no animation):\n * ```html\n * @if (group.opened()) { <div id=\"content\">…</div> }\n * ```\n *\n * **Hidden attribute** (enables CSS transitions):\n * ```html\n * <div id=\"content\" [hidden]=\"!group.opened()\">…</div>\n * ```\n *\n * ### FAQ accordion\n * ```html\n * <button cngxDisclosure #faq=\"cngxDisclosure\" [controls]=\"'answer-1'\">\n * Question 1\n * </button>\n * @if (faq.opened()) {\n * <div id=\"answer-1\">Answer to question 1.</div>\n * }\n * ```\n *\n * ### Nav group with animation\n * ```html\n * <button cngxDisclosure #group=\"cngxDisclosure\" [controls]=\"'nav-items'\">\n * Settings\n * </button>\n * <div id=\"nav-items\" [hidden]=\"!group.opened()\" class=\"collapsible\">\n * <a href=\"/general\">General</a>\n * <a href=\"/security\">Security</a>\n * </div>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/disclosure.directive.ts\n * @since 0.1.0\n * @relatedTo CngxNavGroup, CngxExpandable\n * <example-url>http://localhost:4200/#/common/interactive/disclosure/basic-uncontrolled</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/disclosure/controlled-mode</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/disclosure/faq-accordion</example-url>\n */\n@Directive({\n selector: '[cngxDisclosure]',\n exportAs: 'cngxDisclosure',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'opened()',\n '[attr.aria-controls]': 'controls() ?? null',\n '(click)': 'toggle()',\n '(keydown.enter)': 'toggle()',\n '(keydown.space)': 'toggle(); $event.preventDefault()',\n },\n})\nexport class CngxDisclosure {\n /** Controlled opened state. When bound, takes precedence over internal state. */\n readonly openedInput = input<boolean | undefined>(undefined, { alias: 'cngxDisclosureOpened' });\n\n /** The `id` of the controlled content element. Sets `aria-controls`. */\n readonly controls = input<string | undefined>(undefined);\n\n private readonly openedState = signal(false);\n\n /** Resolved opened state - controlled input wins over internal state. */\n readonly opened = computed(() => this.openedInput() ?? this.openedState());\n\n /** Emitted when the opened state changes. */\n readonly openedChange = output<boolean>();\n\n /** Opens the disclosure. */\n open(): void {\n this.openedState.set(true);\n this.openedChange.emit(true);\n }\n\n /** Closes the disclosure. */\n close(): void {\n if (!this.opened()) {\n return;\n }\n this.openedState.set(false);\n this.openedChange.emit(false);\n }\n\n /** Toggles the disclosure between open and closed. */\n toggle(): void {\n if (this.opened()) {\n this.close();\n } else {\n this.open();\n }\n }\n}\n","import { DestroyRef, Directive, effect, inject, input } from '@angular/core';\nimport { CngxDisclosure } from './disclosure.directive';\nimport { CNGX_NAV_CONFIG, CNGX_NAV_DEFAULTS } from './nav-config';\nimport { CngxNavGroupRegistry } from './nav-group-registry';\n\n/**\n * Navigation accordion group - a collapsible section in a sidebar nav.\n *\n * Composes `CngxDisclosure` as a `hostDirective` for expand/collapse behavior.\n * Adds nav-specific semantics: depth tracking and CSS classes for styling.\n *\n * When `CNGX_NAV_CONFIG` is provided with `singleAccordion: true` and a\n * `CngxNavGroupRegistry` is in scope, opening this group closes all other\n * groups registered in the same registry.\n *\n * Applied to the **trigger** element (the group header button).\n * The consumer renders the content separately and wires `role=\"group\"`\n * and `aria-labelledby` on the content container.\n *\n * ### Basic\n * ```html\n * <button cngxNavGroup #group=\"cngxNavGroup\" [controls]=\"'settings-nav'\"\n * [depth]=\"0\" id=\"settings-label\">\n * Settings\n * </button>\n * @if (group.disclosure.opened()) {\n * <div id=\"settings-nav\" role=\"group\" [attr.aria-labelledby]=\"'settings-label'\">\n * <a cngxNavLink [depth]=\"1\">General</a>\n * <a cngxNavLink [depth]=\"1\">Security</a>\n * </div>\n * }\n * ```\n *\n * ### Single-accordion mode\n * ```typescript\n * @Component({\n * providers: [\n * provideNavConfig({ singleAccordion: true }),\n * CngxNavGroupRegistry,\n * ],\n * })\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-group.directive.ts\n * @since 0.1.0\n * @relatedTo CngxNavLink, CngxDisclosure, CngxNavGroupRegistry, CngxNavLabel\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>\n */\n@Directive({\n selector: '[cngxNavGroup]',\n exportAs: 'cngxNavGroup',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxDisclosure,\n inputs: ['cngxDisclosureOpened', 'controls'],\n outputs: ['openedChange'],\n },\n ],\n host: {\n '[class.cngx-nav-group]': 'true',\n '[class.cngx-nav-group--open]': 'disclosure.opened()',\n '[style.--cngx-nav-depth]': 'depth()',\n },\n})\nexport class CngxNavGroup {\n /** The composed disclosure instance - use `disclosure.opened()` to read state. */\n readonly disclosure = inject(CngxDisclosure, { host: true });\n\n /** Nesting depth for indentation. Consumer sets manually. */\n readonly depth = input<number>(0);\n\n private readonly registry = inject(CngxNavGroupRegistry, { optional: true });\n private readonly config = inject(CNGX_NAV_CONFIG, { optional: true });\n\n constructor() {\n this.registry?.register(this);\n inject(DestroyRef).onDestroy(() => this.registry?.unregister(this));\n\n const singleAccordion = this.config?.singleAccordion ?? CNGX_NAV_DEFAULTS.singleAccordion;\n const registry = this.registry;\n if (singleAccordion && registry) {\n effect(() => {\n if (this.disclosure.opened()) {\n registry.closeOthers(this);\n }\n });\n }\n }\n}\n","import { Directive, input } from '@angular/core';\n\n/**\n * Non-interactive section header for navigation groups.\n *\n * Renders as a visual label without semantic heading role by default.\n * Use `[heading]=\"true\"` to opt in to `role=\"heading\"` with `aria-level`\n * when the label genuinely represents a heading in the document outline.\n *\n * ### Section label (default - no heading role)\n * ```html\n * <span cngxNavLabel>@cngx/common</span>\n * ```\n *\n * ### With heading semantics (opt-in)\n * ```html\n * <span cngxNavLabel [heading]=\"true\" [level]=\"3\">Settings</span>\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-label.directive.ts\n * @since 0.1.0\n * @relatedTo CngxNavLink, CngxNavGroup, CngxNavBadge\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>\n */\n@Directive({\n selector: '[cngxNavLabel]',\n exportAs: 'cngxNavLabel',\n standalone: true,\n host: {\n '[class.cngx-nav-label]': 'true',\n '[attr.role]': 'heading() ? \"heading\" : null',\n '[attr.aria-level]': 'heading() ? level() : null',\n },\n})\nexport class CngxNavLabel {\n /** Whether to apply `role=\"heading\"`. Off by default to avoid inflating the heading outline. */\n readonly heading = input<boolean>(false);\n\n /** The heading level (2–6) when `heading` is true. */\n readonly level = input<number>(3);\n}\n","import {\n afterNextRender,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n} from '@angular/core';\n\n/**\n * Navigation link atom. Applied to `<a>` or `<button>` elements in a\n * sidebar or nav menu.\n *\n * Sets a `--cngx-nav-depth` CSS custom property for indentation and\n * toggles an `active` class. Does NOT depend on `@angular/router` -\n * the consumer wires `routerLinkActive` or binds `[active]` manually.\n *\n * ### With Router\n * ```html\n * <a cngxNavLink routerLink=\"/dashboard\" routerLinkActive\n * #rla=\"routerLinkActive\" [active]=\"rla.isActive\">\n * Dashboard\n * </a>\n * ```\n *\n * ### Manual active state\n * ```html\n * <a cngxNavLink [active]=\"currentRoute() === '/settings'\" href=\"/settings\">\n * Settings\n * </a>\n * ```\n *\n * ### Nested (depth-based indentation)\n * ```html\n * <a cngxNavLink [depth]=\"0\">Top level</a>\n * <a cngxNavLink [depth]=\"1\">Nested</a>\n * <a cngxNavLink [depth]=\"2\">Deep nested</a>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-link.directive.ts\n * @selector [cngxNavLink]\n * @since 0.1.0\n * @relatedTo CngxNavGroup, CngxNavLabel, CngxNavBadge, CngxDisclosure\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>\n */\n@Directive({\n selector: 'a[cngxNavLink], button[cngxNavLink]',\n exportAs: 'cngxNavLink',\n standalone: true,\n host: {\n '[class.cngx-nav-link]': 'true',\n '[class.cngx-nav-link--active]': 'active()',\n '[attr.aria-current]': 'active() ? ariaCurrent() : null',\n '[attr.tabindex]': 'needsFocusFix() ? 0 : null',\n '[attr.role]': \"needsFocusFix() ? 'link' : null\",\n '[style.--cngx-nav-depth]': 'depth()',\n },\n})\nexport class CngxNavLink {\n /**\n * `true` when the host `<a>` lacks an `href` attribute and needs `tabindex=\"0\"`\n * + `role=\"link\"` for keyboard focusability.\n *\n * Evaluated after the first render so Angular bindings such as `[href]` are\n * already resolved before the check runs.\n */\n readonly needsFocusFix = signal(false);\n\n private readonly initialized = signal(false);\n\n constructor() {\n const el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n\n afterNextRender(() => {\n if (el.tagName === 'A') {\n this.needsFocusFix.set(!el.hasAttribute('href'));\n }\n const text = el.textContent?.trim();\n if (text && !Object.hasOwn(el.dataset, 'initial')) {\n el.dataset['initial'] = text.charAt(0).toUpperCase();\n }\n this.initialized.set(true);\n });\n\n // Scroll into view when becoming active (e.g., after route change).\n // Skips the initial render to avoid scroll jank on page load.\n effect(() => {\n if (!this.initialized() || !this.active() || !this.scrollOnActive()) {\n return;\n }\n el.scrollIntoView?.({ block: 'nearest', behavior: 'smooth' });\n });\n }\n\n /** Whether this link is the currently active route/item. */\n readonly active = input<boolean>(false);\n\n /** Whether to scroll this link into view when it becomes active. */\n readonly scrollOnActive = input<boolean>(true);\n\n /**\n * The `aria-current` value when active. Screen readers announce this\n * to indicate the current page/step/location.\n *\n * Common values: `'page'` (default), `'step'`, `'location'`, `'true'`.\n */\n readonly ariaCurrent = input<string>('page');\n\n /** Nesting depth for indentation. Consumer sets manually - no ancestor injection. */\n readonly depth = input<number>(0);\n}\n","import { computed, Directive, input } from '@angular/core';\n\n/**\n * Visual variant for the nav badge.\n *\n * @category common/interactive\n */\nexport type NavBadgeVariant = 'count' | 'dot' | 'status';\n\n/**\n * Inline badge for navigation items - shows counts, dots, or status indicators.\n *\n * For generic in-place counter/dot indicators on arbitrary hosts (buttons,\n * avatars, icons), prefer `CngxBadge` from `@cngx/common/display`. `CngxNavBadge`\n * stays specialised for sidebar/link usage where the badge *is* the host span\n * and style is applied directly to it rather than to an injected child.\n *\n * Applies `aria-hidden=\"true\"` by default because badges typically duplicate\n * information already conveyed by the link text. When the badge conveys\n * unique information (e.g., unread count), provide `[ariaLabel]` to make\n * it accessible - this removes `aria-hidden` and adds a visually-hidden label.\n *\n * ### Decorative badge (aria-hidden, default)\n * ```html\n * <a cngxNavLink>Inbox <span cngxNavBadge [value]=\"5\">5</span></a>\n * ```\n *\n * ### Accessible badge (unique information)\n * ```html\n * <a cngxNavLink>\n * Notifications\n * <span cngxNavBadge [value]=\"3\" ariaLabel=\"3 unread\">3</span>\n * </a>\n * ```\n *\n * ### Dot indicator\n * ```html\n * <a cngxNavLink>Updates <span cngxNavBadge variant=\"dot\" [value]=\"1\"></span></a>\n * ```\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-badge.directive.ts\n * @since 0.1.0\n * @relatedTo CngxNavLink, CngxNavGroup, CngxNavLabel, CngxBadge\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>\n */\n@Directive({\n selector: '[cngxNavBadge]',\n exportAs: 'cngxNavBadge',\n standalone: true,\n host: {\n '[class.cngx-nav-badge]': 'true',\n '[class.cngx-nav-badge--count]': \"variant() === 'count'\",\n '[class.cngx-nav-badge--dot]': \"variant() === 'dot'\",\n '[class.cngx-nav-badge--status]': \"variant() === 'status'\",\n '[class.cngx-nav-badge--hidden]': 'isEmpty()',\n '[attr.aria-hidden]': 'ariaLabel() ? null : true',\n '[attr.aria-label]': 'ariaLabel() ?? null',\n },\n})\nexport class CngxNavBadge {\n /** The badge value. Hidden when empty string, null, undefined, or 0. */\n readonly value = input<string | number | null | undefined>(undefined);\n\n /** Visual variant: `'count'` (number), `'dot'` (presence indicator), `'status'` (text). */\n readonly variant = input<NavBadgeVariant>('count');\n\n /**\n * Accessible label for the badge. When provided, `aria-hidden` is removed\n * and this label is announced by screen readers.\n */\n readonly ariaLabel = input<string | undefined>(undefined);\n\n /** Whether the badge should be visually hidden (empty/zero value). */\n readonly isEmpty = computed(() => {\n const v = this.value();\n return v === null || v === undefined || v === '' || v === 0;\n });\n}\n","import { computed, Directive, input, output, signal } from '@angular/core';\n\n/**\n * Passive expand/collapse contract for elements whose open state is driven\n * from the outside - typically a `CngxTreeController` or any component that\n * manages a shared expansion set. Mirrors `aria-expanded` and (optionally)\n * `aria-controls` into the host; carries no interaction of its own.\n *\n * Use `CngxDisclosure` instead for self-triggering expanders (FAQ, accordion\n * headings). The distinction is deliberate: a tree-item row is a selection\n * target, not a toggle - clicks, Enter, and Space belong to the selection\n * flow, while expand/collapse is wired to ArrowLeft/Right via a sibling nav\n * directive or to a dedicated twisty button.\n *\n * ```html\n * <div role=\"tree\" aria-label=\"Files\">\n * <div\n * role=\"treeitem\"\n * aria-level=\"1\"\n * cngxExpandable\n * [cngxExpandableOpen]=\"ctrl.isExpanded(id)()\"\n * [controls]=\"childrenId\"\n * >\n * <button\n * type=\"button\"\n * tabindex=\"-1\"\n * (click)=\"ctrl.toggle(id)\"\n * >▸</button>\n * <span>{{ label }}</span>\n * </div>\n * <div [id]=\"childrenId\" [hidden]=\"!ctrl.isExpanded(id)()\">…</div>\n * </div>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/expandable/expandable.directive.ts\n * @since 0.1.0\n * @relatedTo CngxHierarchicalNav, CngxTreeController, CngxRovingTabindex\n */\n@Directive({\n selector: '[cngxExpandable]',\n exportAs: 'cngxExpandable',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': 'controls() ?? null',\n },\n})\nexport class CngxExpandable {\n /** Controlled expanded state. When bound, wins over internal state. */\n readonly expandedInput = input<boolean | undefined>(undefined, {\n alias: 'cngxExpandableOpen',\n });\n\n /** `id` of the controlled content element, bound to `aria-controls`. */\n readonly controls = input<string | undefined>(undefined);\n\n private readonly expandedState = signal(false);\n\n /** Resolved expanded state (controlled input wins over internal state). */\n readonly expanded = computed(() => this.expandedInput() ?? this.expandedState());\n\n /** Emitted when the expanded state changes. */\n readonly expandedChange = output<boolean>();\n\n expand(): void {\n if (this.expanded()) {\n return;\n }\n this.expandedState.set(true);\n this.expandedChange.emit(true);\n }\n\n collapse(): void {\n if (!this.expanded()) {\n return;\n }\n this.expandedState.set(false);\n this.expandedChange.emit(false);\n }\n\n toggle(): void {\n if (this.expanded()) {\n this.collapse();\n } else {\n this.expand();\n }\n }\n}\n","import {\n DestroyRef,\n Directive,\n inject,\n InjectionToken,\n input,\n output,\n signal,\n} from '@angular/core';\n\n/**\n * Optional app-wide defaults for `CngxHoverIntent`'s dwell timings. Provide it\n * to move the `enterDelay` / `leaveDelay` fallbacks an organism composes the\n * atom with, without touching the per-instance input surface. Every key is\n * optional - an unset key keeps the atom's literal (120 / 0).\n *\n * @category common/interactive\n * @since 0.1.0\n */\nexport interface CngxHoverIntentDefaults {\n /** Fallback for `enterDelay` (ms) when the input is not bound. */\n readonly enterDelay?: number;\n /** Fallback for `leaveDelay` (ms) when the input is not bound. */\n readonly leaveDelay?: number;\n}\n\n/**\n * Optional DI fallback for `CngxHoverIntent`'s `enterDelay` / `leaveDelay`\n * input defaults. Resolution is `bound input -> injected default -> literal`\n * (120 / 0). A hostDirective input default cannot be overridden by the host\n * that composes it, so this token is the layered extension point any\n * hover-to-reveal organism uses to set app-wide dwell defaults. `optional`, so\n * standalone `[cngxHoverIntent]` stays byte-identical when the token is absent.\n *\n * @category common/interactive\n * @relatedTo CngxHoverIntent\n * @since 0.1.0\n */\nexport const CNGX_HOVER_INTENT_DEFAULTS = new InjectionToken<CngxHoverIntentDefaults>(\n 'CNGX_HOVER_INTENT_DEFAULTS',\n);\n\n/**\n * Debounced hover-intent primitive. Turns raw pointer enter/leave into a\n * boolean signal that flips `true` only after the pointer has rested on the\n * host for `enterDelay` ms of continuous hover, and back to `false` after\n * `leaveDelay` ms of continuous un-hover.\n *\n * A pointer that merely passes over the host never fires: the pending timer\n * is cancelled by the opposite event before it elapses. Use it for\n * hover-to-reveal panels, hover-to-prefetch triggers, or any affordance that\n * reads as nervous when it reacts to an instant `mouseenter`.\n *\n * The `active` signal is read-only - it is derived from pointer events and is\n * never consumer-writable, so it is exposed via `asReadonly()` plus an\n * `intentChange` output rather than a two-way `model()`. Pointer-only, no\n * keyboard surface: hover intent is a mouse concept and carries no ARIA.\n *\n * ### Hover to reveal\n * ```html\n * <div cngxHoverIntent #hi=\"cngxHoverIntent\" [enterDelay]=\"150\">\n * <span>Card</span>\n * @if (hi.active()) { <div class=\"detail\">…</div> }\n * </div>\n * ```\n *\n * ### Bind the edge\n * ```html\n * <a cngxHoverIntent (intentChange)=\"$event && prefetch()\">Link</a>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/hover-intent/hover-intent.directive.ts\n * @since 0.1.0\n * @relatedTo CngxHoverable, CngxLongPress, CngxExpandable\n * <example-url>http://localhost:4200/#/common/interactive/hover-intent/hover-to-reveal</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/hover-intent/hover-to-prefetch</example-url>\n */\n@Directive({\n selector: '[cngxHoverIntent]',\n exportAs: 'cngxHoverIntent',\n standalone: true,\n host: {\n '(pointerenter)': 'handleEnter()',\n '(pointerleave)': 'handleLeave()',\n },\n})\nexport class CngxHoverIntent {\n /**\n * Optional app-wide dwell defaults. Declared first so the input initialisers\n * below can source their fallback from it. Absent by default - standalone\n * `[cngxHoverIntent]` then keeps the 120 / 0 literals.\n */\n private readonly defaults = inject(CNGX_HOVER_INTENT_DEFAULTS, { optional: true });\n\n /** ms of continuous hover before `active` settles to `true`. */\n readonly enterDelay = input<number>(this.defaults?.enterDelay ?? 120);\n /** ms of continuous un-hover before `active` settles back to `false`. */\n readonly leaveDelay = input<number>(this.defaults?.leaveDelay ?? 0);\n\n private readonly intentState = signal(false);\n /** Debounced hover-intent state. `true` only after `enterDelay` ms of continuous hover. */\n readonly active = this.intentState.asReadonly();\n\n /** Emitted on every debounced edge: `true` on settle-in, `false` on settle-out. */\n readonly intentChange = output<boolean>();\n\n private pendingTimer: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.clearPending());\n }\n\n protected handleEnter(): void {\n this.schedule(true, this.enterDelay());\n }\n\n protected handleLeave(): void {\n this.schedule(false, this.leaveDelay());\n }\n\n private schedule(target: boolean, delay: number): void {\n this.clearPending();\n this.pendingTimer = setTimeout(() => {\n this.pendingTimer = undefined;\n if (this.intentState() === target) {\n return;\n }\n this.intentState.set(target);\n this.intentChange.emit(target);\n }, delay);\n }\n\n private clearPending(): void {\n if (this.pendingTimer !== undefined) {\n clearTimeout(this.pendingTimer);\n this.pendingTimer = undefined;\n }\n }\n}\n","import { InjectionToken, type ModelSignal, type WritableSignal } from '@angular/core';\n\n/**\n * Structural contract every cngx interactive value-bearing atom exposes\n * to its surrounding form-bridge. Consumers (`CngxFormBridge`, custom\n * adapters, test harnesses) pull the token off the host element and\n * reach the atom's primary value plus its disabled flag without\n * importing the concrete directive class.\n *\n * Two-way binding flows through `value` (a `ModelSignal<T>`, never a\n * plain `WritableSignal<T>`); the `model<T>()` requirement is part of\n * the contract because Signal Forms relies on `value()` being callable\n * AND `value.set(v)` triggering the change-event Angular emits for\n * `[(value)]` template syntax.\n *\n * `disabled` stays a `WritableSignal<boolean>` because consumers\n * typically derive it externally (`computed(() => parentDisabled() ||\n * fieldDisabled())` and forward into the atom) - `model<boolean>()`\n * would force every implementer into a two-way binding they do not\n * need.\n *\n * @category common/interactive\n */\nexport interface CngxControlValue<T = unknown> {\n readonly value: ModelSignal<T>;\n readonly disabled: WritableSignal<boolean>;\n}\n\n/**\n * DI token every cngx interactive atom registers via `useExisting:\n * <self>` so its host element doubles as a value-shape contract for\n * `CngxFormBridge` and any future Reactive-Forms / Signal-Forms\n * integration in `@cngx/forms/controls`.\n *\n * No `providedIn`, no factory: providing the token is the atom's\n * responsibility. A surrounding consumer that wants a sane fallback\n * (e.g. an inert read-only value) supplies one in its own `providers`\n * block - the token deliberately does not invent a default because\n * \"what is the value of an unbound control?\" has no library-level\n * answer.\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/control-value/control-value.token.ts\n * @since 0.1.0\n */\nexport const CNGX_CONTROL_VALUE = new InjectionToken<CngxControlValue>('CngxControlValue');\n","import { computed, type Signal, type WritableSignal } from '@angular/core';\nimport { decimalPlaces } from '@cngx/utils';\n\n/**\n * Inputs for {@link createSliderCore}. Every field is a `Signal`, so the\n * derived values track their sources without any manual sync. `value` is\n * the single writable source of truth - the only thing the keyboard and\n * pointer handlers ever mutate. `boundedMin` / `boundedMax` default to\n * `min` / `max`; a dual-thumb host narrows them to the sibling-thumb bound\n * so the cross-clamp math lives here rather than in an effect.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-core.ts\n * @since 0.1.0\n */\nexport interface CngxSliderCoreOptions {\n /** Writable source of truth. The only signal the core ever writes. */\n readonly value: WritableSignal<number>;\n /** Track lower bound. Also the snap-to-step origin. */\n readonly min: Signal<number>;\n /** Track upper bound. */\n readonly max: Signal<number>;\n /** Step granularity. `<= 0` disables snapping (continuous slider). */\n readonly step: Signal<number>;\n /** Effective lower bound (sibling clamp for a range thumb). Defaults to `min`. */\n readonly boundedMin?: Signal<number>;\n /** Effective upper bound (sibling clamp for a range thumb). Defaults to `max`. */\n readonly boundedMax?: Signal<number>;\n /**\n * Maps the current value to an `aria-valuetext` string (currency, dates,\n * t-shirt sizes). When omitted, `aria-valuetext` mirrors the numeric value.\n */\n readonly valueText?: (value: number) => string;\n}\n\n/**\n * Derived view and write surface produced by {@link createSliderCore}. All\n * read members are `computed()` from the option signals; all mutation goes\n * through the four imperative helpers, which snap-to-step and clamp before\n * writing. The directive binds `clampedValue` to `aria-valuenow`, `fraction`\n * to its thumb-position CSS var, and `ariaValueText` to `aria-valuetext`.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-core.ts\n * @since 0.1.0\n */\nexport interface CngxSliderCore {\n /** Raw model value (may sit outside the effective bounds until first write). */\n readonly value: Signal<number>;\n /** `value` snapped to step and clamped to the effective bounds - bind to `aria-valuenow`. */\n readonly clampedValue: Signal<number>;\n /** Position along the track in `[0, 1]` - bind to the thumb-position CSS var. */\n readonly fraction: Signal<number>;\n /** `fraction` as a `0..100` percentage. */\n readonly percent: Signal<number>;\n /** `aria-valuetext` string (formatter output or the numeric value). */\n readonly ariaValueText: Signal<string>;\n /** True when the clamped value sits on the effective lower bound. */\n readonly atMin: Signal<boolean>;\n /** True when the clamped value sits on the effective upper bound. */\n readonly atMax: Signal<boolean>;\n /** Snap and clamp `next`, then write it (no-op when unchanged). */\n setValue(next: number): void;\n /** Map a `[0, 1]` track fraction to a value, then {@link setValue} it. */\n setFromFraction(fraction: number): void;\n /** Move by `stepCount` steps from the current value (negative to decrease). */\n stepBy(stepCount: number): void;\n /** Jump to the effective lower bound. */\n stepToMin(): void;\n /** Jump to the effective upper bound. */\n stepToMax(): void;\n}\n\nfunction snapToStep(raw: number, origin: number, step: number): number {\n if (step <= 0 || !Number.isFinite(step)) {\n return raw;\n }\n const steps = Math.round((raw - origin) / step);\n const snapped = origin + steps * step;\n // Float-drift correction: 0.1 * 3 = 0.30000000000000004 otherwise leaks\n // into aria-valuenow. Round to the precision the step itself carries.\n const decimals = Math.max(decimalPlaces(step), decimalPlaces(origin));\n return Number(snapped.toFixed(decimals));\n}\n\nfunction clamp(value: number, lo: number, hi: number): number {\n if (hi < lo) {\n return lo;\n }\n return Math.min(hi, Math.max(lo, value));\n}\n\n/**\n * Pure factory for a slider's value derivation - the brain shared by\n * {@link CngxSlider} and each {@link CngxSliderThumb} of a range slider. It\n * owns no DI and no DOM: hand it the source signals, get back the clamped\n * value, the track fraction, the `aria-valuetext` string, and the four\n * mutation helpers the keyboard / pointer handlers call. Snapping and\n * bound-clamping live in {@link CngxSliderCore.setValue}, so every write\n * path stays valid without an effect syncing state (Pillar 1).\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-core.ts\n * @since 0.1.0\n * @relatedTo CngxSlider, CngxRangeSlider, CngxSliderThumb\n */\nexport function createSliderCore(options: CngxSliderCoreOptions): CngxSliderCore {\n const { value, min, max, step } = options;\n const boundedMin = options.boundedMin ?? min;\n const boundedMax = options.boundedMax ?? max;\n\n const clampedValue = computed(() =>\n clamp(snapToStep(value(), min(), step()), boundedMin(), boundedMax()),\n );\n\n const fraction = computed(() => {\n const lo = min();\n const span = max() - lo;\n if (span <= 0) {\n return 0;\n }\n return clamp((clampedValue() - lo) / span, 0, 1);\n });\n\n const percent = computed(() => fraction() * 100);\n\n const ariaValueText = computed(() => {\n const current = clampedValue();\n const format = options.valueText;\n return format ? format(current) : String(current);\n });\n\n const atMin = computed(() => clampedValue() <= boundedMin());\n const atMax = computed(() => clampedValue() >= boundedMax());\n\n const setValue = (next: number): void => {\n if (!Number.isFinite(next)) {\n return;\n }\n const resolved = clamp(snapToStep(next, min(), step()), boundedMin(), boundedMax());\n if (resolved !== value()) {\n value.set(resolved);\n }\n };\n\n return {\n value,\n clampedValue,\n fraction,\n percent,\n ariaValueText,\n atMin,\n atMax,\n setValue,\n setFromFraction: (f) => setValue(min() + clamp(f, 0, 1) * (max() - min())),\n stepBy: (stepCount) => setValue(clampedValue() + stepCount * (step() > 0 ? step() : 1)),\n stepToMin: () => setValue(boundedMin()),\n stepToMax: () => setValue(boundedMax()),\n };\n}\n","import type { CngxSliderCore } from './slider-core';\n\n/**\n * Maps a pointer position to a `0..1` track fraction against `el`'s geometry.\n * Vertical sliders measure bottom-up (fraction 0 at the lower edge) to match the\n * skin's bottom-anchored fill. Shared by the single slider and the range host so\n * the geometry math lives in exactly one place.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-interaction.ts\n * @since 0.1.0\n */\nexport function pointerFraction(\n el: HTMLElement,\n orientation: 'horizontal' | 'vertical',\n clientX: number,\n clientY: number,\n): number {\n const rect = el.getBoundingClientRect();\n const fraction =\n orientation === 'vertical'\n ? rect.height > 0\n ? (rect.bottom - clientY) / rect.height\n : 0\n : rect.width > 0\n ? (clientX - rect.left) / rect.width\n : 0;\n return Math.min(1, Math.max(0, fraction));\n}\n\n/** Options for {@link createSliderInteraction}. */\nexport interface CngxSliderInteractionOptions {\n /** The value core the handlers drive. */\n readonly core: CngxSliderCore;\n /** The focusable host element (pointer-capture target). */\n readonly el: HTMLElement;\n /** Whether interaction is currently disabled. */\n disabled(): boolean;\n /** Page-key jump size (absolute). */\n pageStep(): number;\n /** Map a pointer position to a `0..1` track fraction. */\n fractionFromPointer(clientX: number, clientY: number): number;\n}\n\n/** APG keyboard + pointer-drag handlers produced by {@link createSliderInteraction}. */\nexport interface CngxSliderInteraction {\n handleKeydown(event: KeyboardEvent): void;\n handlePointerDown(event: PointerEvent): void;\n handlePointerMove(event: PointerEvent): void;\n handlePointerUp(event: PointerEvent): void;\n}\n\n/**\n * Pure factory for a slider's keyboard + pointer-drag behaviour - the shared\n * interaction brain for both {@link CngxSlider} (single) and each\n * {@link CngxSliderThumb} (range). Arrow / Page / Home / End map onto the core's\n * step helpers; pointer-down captures the pointer and drags via the supplied\n * `fractionFromPointer`. Keeping this in one factory means the track and the\n * thumb cannot drift apart.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-interaction.ts\n * @since 0.1.0\n * @relatedTo createSliderCore, CngxSlider, CngxSliderThumb\n */\nexport function createSliderInteraction(\n options: CngxSliderInteractionOptions,\n): CngxSliderInteraction {\n const { core, el } = options;\n let dragging = false;\n\n const updateFromPointer = (event: PointerEvent): void => {\n core.setFromFraction(options.fractionFromPointer(event.clientX, event.clientY));\n };\n\n return {\n handleKeydown(event: KeyboardEvent): void {\n if (options.disabled()) {\n return;\n }\n const big = options.pageStep();\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n core.stepBy(1);\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n core.stepBy(-1);\n break;\n case 'PageUp':\n core.setValue(core.clampedValue() + big);\n break;\n case 'PageDown':\n core.setValue(core.clampedValue() - big);\n break;\n case 'Home':\n core.stepToMin();\n break;\n case 'End':\n core.stepToMax();\n break;\n default:\n return;\n }\n event.preventDefault();\n },\n\n handlePointerDown(event: PointerEvent): void {\n if (options.disabled()) {\n return;\n }\n try {\n el.setPointerCapture(event.pointerId);\n } catch {\n // setPointerCapture throws on an invalid pointerId (synthetic events in\n // some test envs) - the drag still works without capture.\n }\n dragging = true;\n el.focus();\n updateFromPointer(event);\n event.preventDefault();\n },\n\n handlePointerMove(event: PointerEvent): void {\n if (!dragging) {\n return;\n }\n updateFromPointer(event);\n },\n\n handlePointerUp(event: PointerEvent): void {\n if (!dragging) {\n return;\n }\n dragging = false;\n try {\n el.releasePointerCapture(event.pointerId);\n } catch {\n // Already released by the browser (e.g. on pointercancel) - ignore.\n }\n },\n };\n}\n","import { computed, Directive, ElementRef, inject, input, model } from '@angular/core';\n\nimport { createSliderCore } from './slider-core';\nimport { createSliderInteraction, pointerFraction } from './slider-interaction';\n\n/**\n * Headless single-thumb slider brain. Put `cngxSliderTrack` on your own track\n * element and the directive turns it into an APG-conformant `role=\"slider\"`:\n * full keyboard (Arrow / Page / Home / End), pointer-drag with capture, and the\n * whole ARIA value surface (`aria-valuemin/max/now/valuetext/orientation`)\n * computed from `value`/`min`/`max`/`step`. The value is a `model<number>()`,\n * so Angular Signal Forms binds it two-way via `[control]` with no forms import.\n *\n * Most consumers want the finished {@link CngxSlider} component (`<cngx-slider>`)\n * which renders the track / fill / thumb for you and uses this directive as its\n * brain. Reach for `cngxSliderTrack` only when you want to own the skin markup.\n *\n * Positioning is left to the skin: the directive publishes the thumb position\n * as the inherited custom property `--cngx-slider-fraction` (0..1), which the\n * track / fill / thumb read. The default look ships as Track-B CSS in\n * `@cngx/themes/cngx.css`.\n *\n * ```html\n * <label id=\"vol-label\">Volume</label>\n * <div cngxSliderTrack aria-labelledby=\"vol-label\" [(value)]=\"volume\" [min]=\"0\" [max]=\"11\">\n * <span class=\"cngx-slider__track\"><span class=\"cngx-slider__fill\"></span></span>\n * <span class=\"cngx-slider__thumb\"></span>\n * </div>\n * ```\n *\n * Reach for {@link CngxRangeSliderTrack} when you need two thumbs (a min/max range).\n *\n * @category common/interactive/slider\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSlider, CngxRangeSliderTrack, CngxSliderThumb, createSliderCore\n */\n@Directive({\n selector: '[cngxSliderTrack]',\n exportAs: 'cngxSliderTrack',\n standalone: true,\n host: {\n role: 'slider',\n '[attr.aria-valuemin]': 'min()',\n '[attr.aria-valuemax]': 'max()',\n '[attr.aria-valuenow]': 'core.clampedValue()',\n '[attr.aria-valuetext]': 'core.ariaValueText()',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.aria-disabled]': 'disabled() || null',\n '[attr.tabindex]': 'disabled() ? -1 : 0',\n '[style.touch-action]': \"'none'\",\n '[style.--cngx-slider-fraction]': 'core.fraction()',\n '(keydown)': 'interaction.handleKeydown($event)',\n '(pointerdown)': 'interaction.handlePointerDown($event)',\n '(pointermove)': 'interaction.handlePointerMove($event)',\n '(pointerup)': 'interaction.handlePointerUp($event)',\n '(pointercancel)': 'interaction.handlePointerUp($event)',\n },\n})\nexport class CngxSliderTrack {\n /** Two-way value. The only state the keyboard / pointer handlers write. */\n readonly value = model<number>(0);\n /** Track lower bound (`aria-valuemin`). */\n readonly min = input<number>(0);\n /** Track upper bound (`aria-valuemax`). */\n readonly max = input<number>(100);\n /** Step granularity. `<= 0` makes the slider continuous. */\n readonly step = input<number>(1);\n /**\n * Page-key jump size (absolute, not a step multiple). Defaults to the\n * larger of one step and a tenth of the range.\n */\n readonly largeStep = input<number | undefined>(undefined);\n /** Whether the slider is disabled (blocks keyboard and pointer, `tabindex=-1`). */\n readonly disabled = input<boolean>(false);\n /** Track axis. Drives `aria-orientation` and the pointer-to-fraction math. */\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n /** Optional `aria-valuetext` formatter (currency, dates, named stops). */\n readonly valueText = input<((value: number) => string) | undefined>(undefined);\n\n private readonly el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n\n /** Shared value/step/aria derivation. */\n protected readonly core = createSliderCore({\n value: this.value,\n min: this.min,\n max: this.max,\n step: this.step,\n valueText: (v) => {\n const format = this.valueText();\n return format ? format(v) : String(v);\n },\n });\n\n /** Thumb position along the track in `[0, 1]`. For a skin to read. */\n readonly fraction = this.core.fraction;\n /** Snapped + clamped value (`aria-valuenow`). For a skin to read. */\n readonly currentValue = this.core.clampedValue;\n /** Formatted display string (`aria-valuetext`). For a visible value label. */\n readonly displayValue = this.core.ariaValueText;\n\n private readonly pageStep = computed(() => {\n const explicit = this.largeStep();\n if (explicit && explicit > 0) {\n return explicit;\n }\n const grid = this.step() > 0 ? this.step() : 1;\n return Math.max(grid, (this.max() - this.min()) / 10);\n });\n\n /** Shared keyboard + pointer-drag handlers (same factory the range thumb uses). */\n protected readonly interaction = createSliderInteraction({\n core: this.core,\n el: this.el,\n disabled: () => this.disabled(),\n pageStep: () => this.pageStep(),\n fractionFromPointer: (x, y) => pointerFraction(this.el, this.orientation(), x, y),\n });\n}\n","/**\n * Tick stops from `min` to `max` stepping by `step`, for rendering tick marks +\n * labels. Returns `[]` when the step grid is invalid or denser than `maxCount`\n * (a guard against pathological DOM, e.g. step 1 over a 0..10000 range).\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-ticks.ts\n * @since 0.1.0\n */\nimport { computed, type Signal } from '@angular/core';\nimport { arrayEqual, decimalPlaces } from '@cngx/utils';\n\n/** Tick view produced by {@link createSliderTicks}. */\nexport interface CngxSliderTicksView {\n /** Tick spacing as a track percentage string (e.g. `\"5%\"`), or `null` when marks are off. */\n readonly interval: Signal<string | null>;\n /** Numeric tick stops for labels (empty when labels are off or the grid is too dense). */\n readonly values: Signal<number[]>;\n /** Track fraction `[0, 1]` of a tick value, for positioning its label. */\n fractionOf(value: number): number;\n}\n\n/**\n * Derives a slider's tick marks + labels from its bounds, shared by\n * {@link CngxSlider} and {@link CngxRangeSlider} so the math lives once. `marks`\n * gates the repeating-gradient interval; `labels` gates the numeric stops; both\n * are independent. The values signal is `arrayEqual`-guarded.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-ticks.ts\n * @since 0.1.0\n */\nexport function createSliderTicks(options: {\n readonly min: Signal<number>;\n readonly max: Signal<number>;\n readonly step: Signal<number>;\n readonly marks: Signal<boolean>;\n readonly labels: Signal<boolean>;\n}): CngxSliderTicksView {\n const { min, max, step, marks, labels } = options;\n\n const interval = computed<string | null>(() => {\n if (!marks()) {\n return null;\n }\n const span = max() - min();\n if (span <= 0 || step() <= 0) {\n return null;\n }\n return `${(step() / span) * 100}%`;\n });\n\n const values = computed<number[]>(\n () => (labels() ? sliderTickValues(min(), max(), step()) : []),\n { equal: arrayEqual },\n );\n\n return {\n interval,\n values,\n fractionOf: (value) => {\n const span = max() - min();\n return span > 0 ? (value - min()) / span : 0;\n },\n };\n}\n\nexport function sliderTickValues(min: number, max: number, step: number, maxCount = 21): number[] {\n const span = max - min;\n if (step <= 0 || span <= 0) {\n return [];\n }\n const count = Math.floor(span / step);\n if (count + 1 > maxCount) {\n return [];\n }\n const decimals = decimalPlaces(step);\n const stops: number[] = [];\n for (let i = 0; i <= count; i++) {\n stops.push(Number((min + i * step).toFixed(decimals)));\n }\n return stops;\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n inject,\n input,\n type TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { CngxSliderTrack } from './slider.directive';\nimport { createSliderTicks } from './slider-ticks';\n\n/**\n * Finished single-thumb slider. The 90% API: drop it in, bind `[(value)]`, done -\n * it renders the track, fill, and thumb for you and wires the full APG keyboard\n * and pointer-drag through its {@link CngxSliderTrack} brain (applied as a host\n * directive). The value is a `model<number>()`, so it binds two-way in Angular\n * Signal Forms via `[control]`; the `cngx-form-field` integration lives in\n * `@cngx/forms` ({@link CngxSliderFieldBridge}).\n *\n * Value display: `showValue` floats the formatted value permanently above the\n * thumb; `showValueBubble` shows it as a bubble only while the slider is focused\n * or dragged (Material-style). `showTicks` paints a step mark; `showTickLabels`\n * adds numeric labels (formatted through `valueText`); `thumbGlyph` projects your\n * own handle content; `orientation=\"vertical\"` rotates the skin. Reach for the\n * headless {@link CngxSliderTrack} directive only when you need to own the skin;\n * use {@link CngxRangeSlider} for a two-thumb range.\n *\n * ```html\n * <label id=\"vol\">Volume</label>\n * <cngx-slider aria-labelledby=\"vol\" [(value)]=\"volume\" [min]=\"0\" [max]=\"100\" [step]=\"5\" showValueBubble />\n * ```\n *\n * @category common/interactive/slider\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider.component.ts\n * @since 0.1.0\n * @relatedTo CngxSliderTrack, CngxRangeSlider, CngxSliderFieldBridge\n */\n@Component({\n selector: 'cngx-slider',\n exportAs: 'cngxSlider',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrl: './slider.component.css',\n imports: [NgTemplateOutlet],\n hostDirectives: [\n {\n directive: CngxSliderTrack,\n inputs: ['value', 'min', 'max', 'step', 'largeStep', 'disabled', 'orientation', 'valueText'],\n outputs: ['valueChange'],\n },\n ],\n host: {\n class: 'cngx-slider',\n '[class.cngx-slider--ticks]': 'showTicks()',\n '[class.cngx-slider--bubble]': 'showValueBubble()',\n '[style.--cngx-slider-tick-interval]': 'ticks.interval()',\n },\n template: `\n <span class=\"cngx-slider__track\"><span class=\"cngx-slider__fill\"></span></span>\n <span class=\"cngx-slider__thumb\">\n @if (thumbGlyph(); as glyph) {\n <ng-container *ngTemplateOutlet=\"glyph\" />\n }\n </span>\n @if (ticks.values().length) {\n <span class=\"cngx-slider__ticks\" aria-hidden=\"true\">\n @for (tick of ticks.values(); track tick) {\n <span class=\"cngx-slider__tick-label\" [style.--cngx-slider-tick-fraction]=\"ticks.fractionOf(tick)\">\n {{ format(tick) }}\n </span>\n }\n </span>\n }\n @if (showValue() && !showValueBubble()) {\n <span class=\"cngx-slider__value\" aria-hidden=\"true\">{{ brain.displayValue() }}</span>\n }\n @if (showValueBubble()) {\n <span class=\"cngx-slider__bubble\" aria-hidden=\"true\">{{ brain.displayValue() }}</span>\n }\n `,\n})\nexport class CngxSlider {\n /** Float the formatted current value permanently above the thumb (visual only). */\n readonly showValue = input(false, { transform: booleanAttribute });\n /** Show the formatted value as a bubble only while focused / dragged (visual only). */\n readonly showValueBubble = input(false, { transform: booleanAttribute });\n /** Paint a tick mark every `step` along the track. */\n readonly showTicks = input(false, { transform: booleanAttribute });\n /** Render a numeric label at every step stop (independent of `showTicks`). */\n readonly showTickLabels = input(false, { transform: booleanAttribute });\n /** Optional content projected into the thumb (an icon, a dot, a custom handle). */\n readonly thumbGlyph = input<TemplateRef<void> | null>(null);\n\n /** The brain host directive - exposes the derived value/fraction the skin reads. */\n protected readonly brain = inject(CngxSliderTrack);\n\n /** Tick marks + labels derivation (shared factory). */\n protected readonly ticks = createSliderTicks({\n min: this.brain.min,\n max: this.brain.max,\n step: this.brain.step,\n marks: this.showTicks,\n labels: this.showTickLabels,\n });\n\n /** Format a value through the bound `valueText` (so tick labels match the thumb). */\n protected format(value: number): string {\n const formatter = this.brain.valueText();\n return formatter ? formatter(value) : String(value);\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/** Which end of a range slider a {@link CngxSliderThumb} drives. */\nexport type CngxSliderThumbPosition = 'start' | 'end';\n\n/** Effective, sibling-clamped bounds a single thumb may move within. */\nexport interface CngxSliderThumbBounds {\n /** Lower bound: the track min for the start thumb, the start value for the end thumb. */\n readonly min: Signal<number>;\n /** Upper bound: the end value for the start thumb, the track max for the end thumb. */\n readonly max: Signal<number>;\n}\n\n/**\n * Contract a {@link CngxRangeSlider} provides so each {@link CngxSliderThumb}\n * can read the shared track config, learn its sibling-clamped bounds, and\n * write its end of the tuple - all without injecting the concrete parent\n * class (which would create a cyclic type and block Atomic Decompose). The\n * cross-clamp lives in {@link boundsFor}, so two thumbs can never pass each\n * other and no effect is needed to keep them ordered.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/range-slider.token.ts\n * @since 0.1.0\n * @relatedTo CngxRangeSlider, CngxSliderThumb\n */\nexport interface CngxSliderRangeHost {\n /** Track lower bound. */\n readonly min: Signal<number>;\n /** Track upper bound. */\n readonly max: Signal<number>;\n /** Step granularity shared by both thumbs. */\n readonly step: Signal<number>;\n /** Page-key jump size shared by both thumbs (absolute). Undefined = derive from range. */\n readonly largeStep: Signal<number | undefined>;\n /** Whether the whole range slider is disabled. */\n readonly disabled: Signal<boolean>;\n /** Track axis shared by both thumbs. */\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n /** Current `[start, end]` tuple - the single source of truth. */\n readonly value: Signal<readonly [number, number]>;\n /** Optional `aria-valuetext` formatter shared across both thumbs. */\n readonly valueText: Signal<((value: number) => string) | undefined>;\n /** Sibling-clamped bounds for one thumb, preventing thumb-cross. */\n boundsFor(position: CngxSliderThumbPosition): CngxSliderThumbBounds;\n /** Write one end of the tuple (the thumb's core has already snapped + clamped). */\n commit(position: CngxSliderThumbPosition, value: number): void;\n /**\n * Map a pointer position to a `0..1` fraction along the shared track, using\n * the range host's own geometry. A thumb cannot measure this itself - its\n * element is the tiny handle, not the full track - so the host owns the math.\n */\n fractionFromPointer(clientX: number, clientY: number): number;\n}\n\n/**\n * DI token for the {@link CngxSliderRangeHost} contract. {@link CngxRangeSlider}\n * provides it via `useExisting`; each {@link CngxSliderThumb} injects it up the\n * element-injector hierarchy.\n *\n * @category common/interactive/slider\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/range-slider.token.ts\n * @since 0.1.0\n * @relatedTo CngxRangeSlider, CngxSliderThumb\n */\nexport const CNGX_SLIDER_RANGE = new InjectionToken<CngxSliderRangeHost>('CNGX_SLIDER_RANGE');\n","import { computed, Directive, ElementRef, inject, input, model } from '@angular/core';\n\nimport { pointerFraction } from './slider-interaction';\nimport {\n CNGX_SLIDER_RANGE,\n type CngxSliderRangeHost,\n type CngxSliderThumbBounds,\n type CngxSliderThumbPosition,\n} from './range-slider.token';\n\n/**\n * Headless dual-thumb (range) slider brain. Put `cngxRangeSliderTrack` on your\n * own track container and host two {@link CngxSliderThumb} children\n * (`start` / `end`); the value is a `model<[number, number]>()` tuple this\n * directive owns. It provides {@link CNGX_SLIDER_RANGE} so each thumb reads the\n * shared config, learns its sibling-clamped bounds, and commits its end. The\n * thumbs cannot cross because {@link boundsFor} narrows each thumb's range to\n * the other thumb's current value - clamp math, not an effect (Pillar 1).\n *\n * Most consumers want the finished {@link CngxRangeSlider} component\n * (`<cngx-range-slider>`) which renders the track, fill band, and both thumbs\n * and uses this directive as its brain. Reach for `cngxRangeSliderTrack` only\n * when you want to own the skin markup.\n *\n * ```html\n * <div cngxRangeSliderTrack role=\"group\" aria-label=\"Price range\" [(value)]=\"price\" [min]=\"0\" [max]=\"1000\">\n * <span class=\"cngx-slider__track\"></span>\n * <span cngxSliderThumb=\"start\" aria-label=\"Minimum\"></span>\n * <span cngxSliderThumb=\"end\" aria-label=\"Maximum\"></span>\n * </div>\n * ```\n *\n * @category common/interactive/slider\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/range-slider.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRangeSlider, CngxSliderThumb, createSliderCore\n */\n@Directive({\n selector: '[cngxRangeSliderTrack]',\n exportAs: 'cngxRangeSliderTrack',\n standalone: true,\n providers: [{ provide: CNGX_SLIDER_RANGE, useExisting: CngxRangeSliderTrack }],\n host: {\n role: 'group',\n '[attr.aria-disabled]': 'disabled() || null',\n '[attr.aria-orientation]': 'orientation()',\n '[style.--cngx-slider-start-fraction]': 'startFraction()',\n '[style.--cngx-slider-end-fraction]': 'endFraction()',\n },\n})\nexport class CngxRangeSliderTrack implements CngxSliderRangeHost {\n /** Two-way `[start, end]` tuple - the single source of truth for both thumbs. */\n readonly value = model<[number, number]>([0, 100]);\n /** Track lower bound. */\n readonly min = input<number>(0);\n /** Track upper bound. */\n readonly max = input<number>(100);\n /** Step granularity shared by both thumbs. */\n readonly step = input<number>(1);\n /**\n * Page-key jump size for both thumbs (absolute, not a step multiple).\n * Defaults to the larger of one step and a tenth of the range.\n */\n readonly largeStep = input<number | undefined>(undefined);\n /** Whether the range slider is disabled. */\n readonly disabled = input<boolean>(false);\n /** Track axis shared by both thumbs. */\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n /** Optional `aria-valuetext` formatter shared across both thumbs. */\n readonly valueText = input<((value: number) => string) | undefined>(undefined);\n\n // Sibling-clamp bounds. The start thumb's ceiling tracks the end value;\n // the end thumb's floor tracks the start value. Held as stable signals\n // (not recreated per boundsFor call) so each thumb's core reads one node.\n private readonly startBounds: CngxSliderThumbBounds = {\n min: this.min,\n max: computed(() => this.value()[1]),\n };\n private readonly endBounds: CngxSliderThumbBounds = {\n min: computed(() => this.value()[0]),\n max: this.max,\n };\n\n private readonly el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n\n // Track fractions of each thumb, published as CSS vars so the skin can paint\n // a fill between them. Derived from the tuple - never synced (Pillar 1).\n readonly startFraction = computed(() => this.fractionOf(this.value()[0]));\n readonly endFraction = computed(() => this.fractionOf(this.value()[1]));\n\n private fractionOf(value: number): number {\n const span = this.max() - this.min();\n if (span <= 0) {\n return 0;\n }\n return Math.min(1, Math.max(0, (value - this.min()) / span));\n }\n\n boundsFor(position: CngxSliderThumbPosition): CngxSliderThumbBounds {\n return position === 'start' ? this.startBounds : this.endBounds;\n }\n\n commit(position: CngxSliderThumbPosition, value: number): void {\n const [start, end] = this.value();\n if (position === 'start') {\n if (value !== start) {\n this.value.set([value, end]);\n }\n } else if (value !== end) {\n this.value.set([start, value]);\n }\n }\n\n fractionFromPointer(clientX: number, clientY: number): number {\n return pointerFraction(this.el, this.orientation(), clientX, clientY);\n }\n}\n","import {\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n type Signal,\n type WritableSignal,\n} from '@angular/core';\n\nimport { createSliderCore } from './slider-core';\nimport { createSliderInteraction } from './slider-interaction';\nimport {\n CNGX_SLIDER_RANGE,\n type CngxSliderRangeHost,\n type CngxSliderThumbPosition,\n} from './range-slider.token';\n\n/**\n * Builds a `WritableSignal<number>` view over one end of the range tuple:\n * reads `range.value()[index]` reactively, routes writes through\n * `range.commit(position, …)`. Lets a thumb run an ordinary\n * {@link createSliderCore} (which writes a `WritableSignal`) while the tuple\n * stays the single source of truth - no local state, no effect sync.\n */\nfunction createThumbValue(\n range: CngxSliderRangeHost,\n position: Signal<CngxSliderThumbPosition>,\n): WritableSignal<number> {\n const read = computed(() => {\n const [start, end] = range.value();\n return position() === 'start' ? start : end;\n });\n const accessor = Object.assign(() => read(), {\n set: (next: number) => range.commit(position(), next),\n update: (updater: (prev: number) => number) => range.commit(position(), updater(read())),\n asReadonly: () => read,\n });\n return accessor as unknown as WritableSignal<number>;\n}\n\n/**\n * One focusable thumb of a {@link CngxRangeSlider}. Place `cngxSliderThumb` on\n * each thumb element with `\"start\"` or `\"end\"`; the directive turns it into an\n * independent `role=\"slider\"` with its own `aria-valuenow`/`valuetext` and APG\n * keyboard, bounded by the sibling thumb so the two can never cross. It reads\n * the shared track config from {@link CNGX_SLIDER_RANGE} (injected up the\n * element-injector hierarchy) and commits its end through the host.\n *\n * Two focusable thumbs cannot be derived from a single host element, so each\n * thumb is its own directive - the headless contract the skin marks up.\n *\n * @category common/interactive/slider\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/slider-thumb.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRangeSlider, CngxRangeSliderTrack, createSliderCore\n */\n@Directive({\n selector: '[cngxSliderThumb]',\n exportAs: 'cngxSliderThumb',\n standalone: true,\n host: {\n role: 'slider',\n '[attr.aria-valuemin]': 'bounds().min()',\n '[attr.aria-valuemax]': 'bounds().max()',\n '[attr.aria-valuenow]': 'core.clampedValue()',\n '[attr.aria-valuetext]': 'core.ariaValueText()',\n '[attr.aria-orientation]': 'range.orientation()',\n '[attr.aria-disabled]': 'range.disabled() || null',\n '[attr.tabindex]': 'range.disabled() ? -1 : 0',\n '[style.touch-action]': \"'none'\",\n '[style.--cngx-slider-fraction]': 'core.fraction()',\n '(keydown)': 'interaction.handleKeydown($event)',\n '(pointerdown)': 'interaction.handlePointerDown($event)',\n '(pointermove)': 'interaction.handlePointerMove($event)',\n '(pointerup)': 'interaction.handlePointerUp($event)',\n '(pointercancel)': 'interaction.handlePointerUp($event)',\n },\n})\nexport class CngxSliderThumb {\n /** Which end of the range this thumb drives. Bound from the selector. */\n readonly position = input.required<CngxSliderThumbPosition>({ alias: 'cngxSliderThumb' });\n\n protected readonly range = inject(CNGX_SLIDER_RANGE);\n private readonly el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n\n /** Sibling-clamped bounds for this thumb, selected reactively by position. */\n protected readonly bounds = computed(() => this.range.boundsFor(this.position()));\n\n private readonly value = createThumbValue(this.range, this.position);\n\n /** Shared value/step/aria derivation, bounded by the sibling thumb. */\n protected readonly core = createSliderCore({\n value: this.value,\n min: this.range.min,\n max: this.range.max,\n step: this.range.step,\n boundedMin: computed(() => this.bounds().min()),\n boundedMax: computed(() => this.bounds().max()),\n valueText: (v) => {\n const format = this.range.valueText();\n return format ? format(v) : String(v);\n },\n });\n\n private readonly pageStep = computed(() => {\n const explicit = this.range.largeStep();\n if (explicit && explicit > 0) {\n return explicit;\n }\n const grid = this.range.step() > 0 ? this.range.step() : 1;\n return Math.max(grid, (this.range.max() - this.range.min()) / 10);\n });\n\n // Shared keyboard + pointer-drag handlers. The pointer math measures against\n // the shared track (the range host owns the geometry), not this thumb's own\n // tiny handle element.\n protected readonly interaction = createSliderInteraction({\n core: this.core,\n el: this.el,\n disabled: () => this.range.disabled(),\n pageStep: () => this.pageStep(),\n fractionFromPointer: (x, y) => this.range.fractionFromPointer(x, y),\n });\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n type TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { CngxRangeSliderTrack } from './range-slider.directive';\nimport { CngxSliderThumb } from './slider-thumb.directive';\nimport { createSliderTicks } from './slider-ticks';\n\n/**\n * Finished two-thumb (range) slider. Drop it in, bind `[(value)]` to a\n * `[number, number]` tuple - it renders the track, the fill band between the\n * thumbs, and both draggable handles, and wires the full APG keyboard +\n * pointer-drag through its {@link CngxRangeSliderTrack} brain. The thumbs cannot\n * cross because the brain clamps each to the other.\n *\n * `showValue` floats a single `start - end` label between the thumbs (so the two\n * never overlap); `showTicks` paints a step tick along the track; `thumbGlyph`\n * projects content into both handles; `orientation=\"vertical\"` rotates the skin.\n * Reach for the headless {@link CngxRangeSliderTrack} directive only when you\n * need to own the skin markup; use {@link CngxSlider} for a single thumb.\n *\n * ```html\n * <cngx-range-slider aria-label=\"Price\" [(value)]=\"price\" [min]=\"0\" [max]=\"1000\" [step]=\"10\" />\n * ```\n *\n * @category common/interactive/slider\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/slider/range-slider.component.ts\n * @since 0.1.0\n * @relatedTo CngxRangeSliderTrack, CngxSlider, CngxSliderThumb\n */\n@Component({\n selector: 'cngx-range-slider',\n exportAs: 'cngxRangeSlider',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrl: './range-slider.component.css',\n imports: [CngxSliderThumb, NgTemplateOutlet],\n hostDirectives: [\n {\n directive: CngxRangeSliderTrack,\n inputs: ['value', 'min', 'max', 'step', 'largeStep', 'disabled', 'orientation', 'valueText'],\n outputs: ['valueChange'],\n },\n ],\n host: {\n class: 'cngx-slider cngx-range-slider',\n '[class.cngx-slider--ticks]': 'showTicks()',\n '[class.cngx-slider--bubble]': 'showValueBubble()',\n '[style.--cngx-slider-tick-interval]': 'ticks.interval()',\n },\n template: `\n <span class=\"cngx-slider__track\"></span>\n <span cngxSliderThumb=\"start\" [attr.aria-label]=\"startLabel()\">\n @if (thumbGlyph(); as glyph) {\n <ng-container *ngTemplateOutlet=\"glyph\" />\n }\n </span>\n <span cngxSliderThumb=\"end\" [attr.aria-label]=\"endLabel()\">\n @if (thumbGlyph(); as glyph) {\n <ng-container *ngTemplateOutlet=\"glyph\" />\n }\n </span>\n @if (ticks.values().length) {\n <span class=\"cngx-slider__ticks\" aria-hidden=\"true\">\n @for (tick of ticks.values(); track tick) {\n <span class=\"cngx-slider__tick-label\" [style.--cngx-slider-tick-fraction]=\"ticks.fractionOf(tick)\">\n {{ format(tick) }}\n </span>\n }\n </span>\n }\n @if (showValue() || showValueBubble()) {\n <span\n class=\"cngx-slider__value cngx-slider__value--range\"\n [class.cngx-slider__bubble]=\"showValueBubble()\"\n aria-hidden=\"true\"\n [style.--cngx-slider-mid-fraction]=\"midFraction()\"\n >\n {{ format(brain.value()[0]) }} - {{ format(brain.value()[1]) }}\n </span>\n }\n `,\n})\nexport class CngxRangeSlider {\n /** Accessible name of the start (minimum) thumb. EN default. */\n readonly startLabel = input<string>('Minimum');\n /** Accessible name of the end (maximum) thumb. EN default. */\n readonly endLabel = input<string>('Maximum');\n /** Render the formatted `start - end` values centred between the thumbs (visual only). */\n readonly showValue = input(false, { transform: booleanAttribute });\n /** Show the combined `start - end` value as a bubble only while focused / dragged. */\n readonly showValueBubble = input(false, { transform: booleanAttribute });\n /** Paint a tick mark every `step` along the track. */\n readonly showTicks = input(false, { transform: booleanAttribute });\n /** Render a numeric label at every step stop (independent of `showTicks`). */\n readonly showTickLabels = input(false, { transform: booleanAttribute });\n /** Optional content projected into both thumbs. */\n readonly thumbGlyph = input<TemplateRef<void> | null>(null);\n\n /** The brain host directive - owns the tuple and the track geometry. */\n protected readonly brain = inject(CngxRangeSliderTrack);\n\n /** Midpoint of the two thumbs (0..1) - anchors the single combined value label. */\n protected readonly midFraction = computed(\n () => (this.brain.startFraction() + this.brain.endFraction()) / 2,\n );\n\n /** Tick marks + labels derivation (shared factory). */\n protected readonly ticks = createSliderTicks({\n min: this.brain.min,\n max: this.brain.max,\n step: this.brain.step,\n marks: this.showTicks,\n labels: this.showTickLabels,\n });\n\n protected format(value: number): string {\n const formatter = this.brain.valueText();\n return formatter ? formatter(value) : String(value);\n }\n}\n","import type { Signal } from '@angular/core';\n\n/**\n * Registration handle a {@link CngxAccordionPanel} header passes to its\n * coordinator so the keyboard-nav factory can rove between headers without\n * discovering them through `contentChildren`. `contentChildren` never crosses\n * a child component's view boundary, so an accordion skin that renders each\n * header inside its own item view would rove over zero items; a registered\n * handle carries the header's live `element` and `disabled` state by reference\n * and is immune to that boundary.\n *\n * @category common/interactive/accordion\n */\nexport interface CngxAccordionHeaderHandle {\n /** Stable id of the panel this header controls. */\n readonly id: string;\n /** The header button element, used for DOM-order sorting and focus movement. */\n readonly element: HTMLElement;\n /** Whether this header is disabled (skipped by roving, not a tab stop). */\n readonly disabled: Signal<boolean>;\n}\n\n/**\n * Resolved keyboard surface for an accordion's headers. The panel binds\n * `tabindex` from {@link headerTabindex} and routes its `(keydown)` through\n * {@link handleKeydown}; a single header - the coordinator's `rovingActiveId` -\n * is the group's lone tab stop, so `Tab` always lands on it.\n *\n * @category common/interactive/accordion\n */\nexport interface CngxAccordionKeyboardNav {\n /**\n * Roving `tabindex` for a header: `0` for the header whose id matches the\n * coordinator's `rovingActiveId`, `-1` for every other. Derived from a\n * single source (Pillar 1 - never a second index to keep in sync).\n */\n headerTabindex(handle: CngxAccordionHeaderHandle): 0 | -1;\n /**\n * WAI-ARIA accordion navigation: ArrowUp/ArrowDown move between headers in\n * DOM order (Home/End jump to the first/last), skipping disabled headers,\n * looping at the edges. Moves DOM focus to the target and records it via\n * `host.setRovingActive(id)`. Returns silently for any other key so the\n * caller can chain further handlers.\n */\n handleKeydown(event: KeyboardEvent): void;\n}\n\n/**\n * Coordinator surface {@link createAccordionKeyboardNav} reads. The\n * `CngxAccordion` directive implements it; the factory stays a pure\n * `create*` (no `inject()`) so it works in any injection context and is\n * trivially unit-testable.\n *\n * @category common/interactive/accordion\n */\nexport interface CngxAccordionKeyboardNavHost {\n /** Every registered header, in registration order (the factory re-sorts by DOM position). */\n readonly headers: Signal<readonly CngxAccordionHeaderHandle[]>;\n /** Id of the header that is currently the group's single tab stop, or `null`. */\n readonly rovingActiveId: Signal<string | null>;\n /** Record the header the roving stop should move to. */\n setRovingActive(id: string): void;\n}\n\n/**\n * Inputs to {@link createAccordionKeyboardNav}. The coordinator owns the\n * registry and the roving source; focus scoping needs no container reference\n * because each handle carries its own `element`.\n *\n * @category common/interactive/accordion\n */\nexport interface CngxAccordionKeyboardNavOptions {\n readonly host: CngxAccordionKeyboardNavHost;\n}\n\n/**\n * Level-2 factory implementing the WAI-ARIA APG accordion keyboard model over\n * a registration model rather than `contentChildren` roving. Registration is\n * immune to component-view boundaries, so any accordion skin - the\n * `@cngx/ui/accordion` organism, or a future one that renders each header in\n * its own view - gets working Arrow/Home/End nav.\n *\n * Pillar 1 (Ableitung statt Verwaltung): the tab stop is derived from the\n * coordinator's `rovingActiveId`, not managed as a second index. Focus\n * movement is a DOM concern the factory owns - the coordinator only records\n * which header should be the stop; it never touches the DOM.\n *\n * @category common/interactive/accordion\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/accordion/accordion-keyboard-nav.ts\n * @since 0.1.0\n * @relatedTo CngxAccordion, CngxAccordionPanel, createTabKeyboardNav\n */\nexport function createAccordionKeyboardNav(\n opts: CngxAccordionKeyboardNavOptions,\n): CngxAccordionKeyboardNav {\n // Registered headers sorted by DOM position. `compareDocumentPosition`\n // orders elements as they appear in the composed document, so headers\n // rendered inside separate item views still rove in visual order - the\n // whole reason this replaces `contentChildren` roving.\n const orderedHeaders = (): readonly CngxAccordionHeaderHandle[] => {\n return opts.host.headers().slice().sort((a, b) => {\n const relation = a.element.compareDocumentPosition(b.element);\n if (relation & Node.DOCUMENT_POSITION_FOLLOWING) {\n return -1;\n }\n if (relation & Node.DOCUMENT_POSITION_PRECEDING) {\n return 1;\n }\n return 0;\n });\n };\n\n // Index of the header that currently owns the roving stop, clamped into the\n // sorted list. Navigation always originates from this header.\n const activeIndex = (headers: readonly CngxAccordionHeaderHandle[]): number => {\n const id = opts.host.rovingActiveId();\n const found = headers.findIndex((h) => h.id === id);\n return found >= 0 ? found : 0;\n };\n\n // Next enabled header index in `direction`, looping at the edges. Mirrors the\n // step geometry of `createTabKeyboardNav`; the two copies are tolerated until\n // a third roving-nav factory justifies a shared primitive (rule of three).\n const step = (\n headers: readonly CngxAccordionHeaderHandle[],\n from: number,\n direction: 1 | -1,\n ): number | null => {\n const len = headers.length;\n if (len === 0) {\n return null;\n }\n let idx = from + direction;\n for (let i = 0; i < len; i++) {\n idx = ((idx % len) + len) % len;\n if (!headers[idx].disabled()) {\n return idx;\n }\n idx += direction;\n }\n return null;\n };\n\n // First (direction 1) or last (direction -1) enabled header, for Home/End.\n const edge = (\n headers: readonly CngxAccordionHeaderHandle[],\n direction: 1 | -1,\n ): number | null => {\n const len = headers.length;\n if (direction === 1) {\n for (let i = 0; i < len; i++) {\n if (!headers[i].disabled()) {\n return i;\n }\n }\n } else {\n for (let i = len - 1; i >= 0; i--) {\n if (!headers[i].disabled()) {\n return i;\n }\n }\n }\n return null;\n };\n\n return {\n headerTabindex: (handle) => (handle.id === opts.host.rovingActiveId() ? 0 : -1),\n handleKeydown: (event) => {\n const headers = orderedHeaders();\n if (headers.length === 0) {\n return;\n }\n const from = activeIndex(headers);\n let target: number | null;\n switch (event.key) {\n case 'ArrowDown':\n target = step(headers, from, 1);\n break;\n case 'ArrowUp':\n target = step(headers, from, -1);\n break;\n case 'Home':\n target = edge(headers, 1);\n break;\n case 'End':\n target = edge(headers, -1);\n break;\n default:\n return;\n }\n if (target === null) {\n return;\n }\n event.preventDefault();\n const header = headers[target];\n opts.host.setRovingActive(header.id);\n header.element.focus();\n },\n };\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\nimport type {\n CngxAccordionHeaderHandle,\n CngxAccordionKeyboardNav,\n} from './accordion-keyboard-nav';\n\n/**\n * Contract a {@link CngxAccordion} provides so each {@link CngxAccordionPanel}\n * can read the open/closed arbitration and self-wire keyboard navigation\n * without injecting the concrete parent class (which would create a cyclic\n * type and block Atomic Decompose). The coordinator owns the single open-set\n * signal plus the header registry; panels call {@link toggle}, register their\n * header handle, and bind `tabindex`/`keydown` through {@link nav}.\n *\n * @category common/interactive/accordion\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/accordion/accordion.token.ts\n * @since 0.1.0\n * @relatedTo CngxAccordion, CngxAccordionPanel, createAccordionKeyboardNav\n */\nexport interface CngxAccordionHost {\n /** Whether more than one panel may stay open at once. */\n readonly multi: Signal<boolean>;\n /** Whether the panel with this id is currently open (reads the open-set signal). */\n isOpen(panelId: string): boolean;\n /** Toggle the panel; in single mode this closes every sibling first. */\n toggle(panelId: string): void;\n\n /** Every registered header handle (the coordinator's roving registry). */\n readonly headers: Signal<readonly CngxAccordionHeaderHandle[]>;\n /** Id of the header that is the group's single tab stop, or `null`. */\n readonly rovingActiveId: Signal<string | null>;\n /** Resolved keyboard surface panels bind `tabindex` / `keydown` through. */\n readonly nav: CngxAccordionKeyboardNav;\n /** Register a header handle on init (view-boundary-immune, unlike `contentChildren`). */\n registerHeader(handle: CngxAccordionHeaderHandle): void;\n /** Deregister a header handle on destroy. */\n unregisterHeader(handle: CngxAccordionHeaderHandle): void;\n /** Record the header the roving tab stop should move to. */\n setRovingActive(id: string): void;\n}\n\n/**\n * DI token for the {@link CngxAccordionHost} contract. {@link CngxAccordion}\n * provides it via `useExisting`; each {@link CngxAccordionPanel} injects it up\n * the element-injector hierarchy.\n *\n * @category common/interactive/accordion\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/accordion/accordion.token.ts\n * @since 0.1.0\n * @relatedTo CngxAccordion, CngxAccordionPanel\n */\nexport const CNGX_ACCORDION = new InjectionToken<CngxAccordionHost>('CNGX_ACCORDION');\n","import { computed, Directive, input, linkedSignal, model, signal } from '@angular/core';\nimport { setEqual } from '@cngx/utils';\n\nimport {\n createAccordionKeyboardNav,\n type CngxAccordionHeaderHandle,\n type CngxAccordionKeyboardNav,\n} from './accordion-keyboard-nav';\nimport { CNGX_ACCORDION, type CngxAccordionHost } from './accordion.token';\n\n/**\n * Coordinating directive for an accordion. Put `cngxAccordion` on the\n * container; each header carries {@link CngxAccordionPanel}. The container owns\n * two single sources of truth - one `openIds` set signal (expansion) and one\n * header registry (`rovingActiveId`) - and arbitrates single- vs multi-open. No\n * panel owns mutable expansion state and no effect syncs siblings: every\n * panel's `aria-expanded` derives from the open-set signal (Pillar 1).\n *\n * Header arrow-key navigation runs through {@link createAccordionKeyboardNav}\n * over a header registry rather than `contentChildren` roving. Panels register\n * their header handle on init, so navigation survives a skin that renders each\n * header inside its own component view - the reason {@link CngxAccordionPanel}\n * self-wires `tabindex`/`keydown` instead of relying on a container-level\n * roving directive.\n *\n * ```html\n * <div cngxAccordion #acc=\"cngxAccordion\" [multi]=\"false\">\n * <button cngxAccordionPanel id=\"head-a\" panelId=\"a\" controls=\"region-a\">Section A</button>\n * <div role=\"region\" id=\"region-a\" aria-labelledby=\"head-a\" [hidden]=\"!acc.isOpen('a')\">…</div>\n * <button cngxAccordionPanel id=\"head-b\" panelId=\"b\" controls=\"region-b\">Section B</button>\n * <div role=\"region\" id=\"region-b\" aria-labelledby=\"head-b\" [hidden]=\"!acc.isOpen('b')\">…</div>\n * </div>\n * ```\n *\n * @category common/interactive/accordion\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/accordion/accordion.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAccordionPanel, createAccordionKeyboardNav\n */\n@Directive({\n selector: '[cngxAccordion]',\n exportAs: 'cngxAccordion',\n standalone: true,\n providers: [{ provide: CNGX_ACCORDION, useExisting: CngxAccordion }],\n})\nexport class CngxAccordion implements CngxAccordionHost {\n /** Whether more than one panel may stay open at once. */\n readonly multi = input<boolean>(false);\n\n /**\n * Controlled set of open panel ids - the accordion's primary value, exposed\n * as a `model` so a consumer can seed initially-open panels or drive\n * expansion declaratively (router / SSR). `model()` takes no `equal`, so the\n * equality discipline lives on {@link effectiveOpenIds} below - the derived\n * set every panel reads. `toggle()` is the only writer on interaction; the\n * consumer may also write it. No effect syncs it (Pillar 1).\n */\n readonly openIds = model<ReadonlySet<string>>(new Set());\n\n // Single-open arbitration is a derivation, never an effect: a consumer-seeded\n // multi-id set is clamped to the last id when `!multi()`, projecting an\n // invalid single-mode seed valid without writing it back (controlled-wins).\n // `setEqual` guards the collection so an identical open-set never re-fires the\n // panels' `aria-expanded` computeds (Pillar 1 equality discipline).\n private readonly effectiveOpenIds = computed<ReadonlySet<string>>(\n () => {\n const ids = this.openIds();\n return this.multi() || ids.size <= 1 ? ids : new Set([...ids].slice(-1));\n },\n { equal: setEqual },\n );\n\n // Header registry, keyed by handle identity. `headersEqual` is an\n // order-independent identity-set compare so a re-register of the same\n // handles never re-fires the roving derivation.\n private readonly headersState = signal<readonly CngxAccordionHeaderHandle[]>([], {\n equal: headersEqual,\n });\n readonly headers = this.headersState.asReadonly();\n\n /**\n * The group's single tab stop, derived-not-managed from the registry. When\n * the registry changes, keep the previous stop while it is still registered\n * and enabled, else fall back to the first enabled header. Never reset by an\n * unrelated header registering or unregistering (Pillar 1 preserve-then-\n * default); `setRovingActive` writes it directly for keyboard movement.\n */\n readonly rovingActiveId = linkedSignal<readonly CngxAccordionHeaderHandle[], string | null>({\n source: this.headers,\n computation: (headers, prev) =>\n headers.some((h) => h.id === prev?.value && !h.disabled())\n ? prev!.value\n : (headers.find((h) => !h.disabled())?.id ?? null),\n });\n\n readonly nav: CngxAccordionKeyboardNav = createAccordionKeyboardNav({ host: this });\n\n registerHeader(handle: CngxAccordionHeaderHandle): void {\n this.headersState.update((headers) =>\n headers.includes(handle) ? headers : [...headers, handle],\n );\n }\n\n unregisterHeader(handle: CngxAccordionHeaderHandle): void {\n this.headersState.update((headers) => headers.filter((h) => h !== handle));\n }\n\n setRovingActive(id: string): void {\n this.rovingActiveId.set(id);\n }\n\n isOpen(panelId: string): boolean {\n return this.effectiveOpenIds().has(panelId);\n }\n\n toggle(panelId: string): void {\n // Read the clamped set, not the raw model, so the mutate base matches what\n // isOpen() reports: clicking a panel the clamp has hidden opens it rather\n // than acting on a stale raw-set membership. Identical to the raw model in\n // every valid case (clamp == model when multi, or the set holds <= 1 id).\n const open = this.effectiveOpenIds();\n // Single mode collapses every sibling by seeding an empty set; multi mode\n // preserves the others. Either way the coordinator is the only writer.\n const next = new Set<string>(this.multi() ? open : []);\n if (open.has(panelId)) {\n next.delete(panelId);\n } else {\n next.add(panelId);\n }\n this.openIds.set(next);\n }\n}\n\n/**\n * Order-independent identity-set equality for the header registry. Two arrays\n * are equal when they hold the same handle references, regardless of\n * registration order. Handles are stable per panel (carrying `disabled` by\n * signal reference), so this comparator only suppresses re-fires from a\n * re-register of the same set; it does not gate the roving derivation on\n * disabled state - `rovingActiveId` reads each handle's `disabled()` directly,\n * so a disabled flip still re-runs it (which is what keeps the tab stop off a\n * newly-disabled header).\n */\nfunction headersEqual(\n a: readonly CngxAccordionHeaderHandle[],\n b: readonly CngxAccordionHeaderHandle[],\n): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n const seen = new Set(b);\n return a.every((handle) => seen.has(handle));\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n signal,\n type OnInit,\n} from '@angular/core';\n\nimport { CNGX_ACCORDION } from './accordion.token';\nimport type { CngxAccordionHeaderHandle } from './accordion-keyboard-nav';\n\n/**\n * Accordion header. Put `cngxAccordionPanel` on the header `<button>`; the\n * directive mirrors `aria-expanded` from the coordinator, points\n * `aria-controls` at the region, and toggles the panel on click. It registers\n * a header handle with the coordinator on init (and deregisters on destroy),\n * binds its own roving `tabindex`, and routes `keydown` through the\n * coordinator's keyboard-nav factory - so arrow/Home/End navigation works even\n * when a skin renders the header inside its own component view (registration is\n * immune to the `contentChildren` view boundary).\n *\n * Expansion state is never owned here: `aria-expanded` is a `computed()` over\n * the coordinator's open-set, so single-open arbitration is pure derivation,\n * not sibling syncing (Pillar 1). Use a native `<button>` so Enter / Space\n * activate it through the browser's own click synthesis.\n *\n * @category common/interactive/accordion\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/accordion/accordion-panel.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAccordion, createAccordionKeyboardNav\n */\n@Directive({\n selector: '[cngxAccordionPanel]',\n exportAs: 'cngxAccordionPanel',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': 'controls() ?? null',\n '[attr.aria-disabled]': 'disabled() || null',\n '[attr.tabindex]': 'tabindex()',\n '(click)': 'toggle()',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxAccordionPanel implements OnInit {\n /** Stable id identifying this panel within its accordion. */\n readonly panelId = input.required<string>();\n /** `id` of the region this header controls, bound to `aria-controls`. */\n readonly controls = input<string | undefined>(undefined);\n /**\n * Disabled header: skipped by roving, reports `tabindex=\"-1\"` +\n * `aria-disabled=\"true\"`, and its click never flips the panel open. The\n * visually-hidden `aria-describedby` reason element is a skin concern owned\n * by the organism, not this brain directive.\n */\n readonly disabled = input<boolean>(false);\n\n private readonly accordion = inject(CNGX_ACCORDION);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly destroyRef = inject(DestroyRef);\n\n // Set once in ngOnInit. A signal (not a plain field) so the tabindex computed\n // tracks it reactively instead of relying on write-before-first-read ordering.\n private readonly handle = signal<CngxAccordionHeaderHandle | null>(null);\n\n /** `aria-expanded`, derived from the coordinator's open-set. */\n protected readonly expanded = computed(() => this.accordion.isOpen(this.panelId()));\n\n /**\n * Roving `tabindex` for this header, derived from the coordinator's single\n * `rovingActiveId` source (Pillar 1). `-1` until the handle registers.\n */\n protected readonly tabindex = computed(() => {\n const handle = this.handle();\n return handle ? this.accordion.nav.headerTabindex(handle) : -1;\n });\n\n ngOnInit(): void {\n // Register in ngOnInit, not the constructor: the bound `[panelId]` input is\n // not applied until the first change detection, and the id is the registry\n // key the coordinator roves and unregisters by.\n const handle: CngxAccordionHeaderHandle = {\n id: this.panelId(),\n element: this.element,\n disabled: this.disabled,\n };\n this.handle.set(handle);\n this.accordion.registerHeader(handle);\n this.destroyRef.onDestroy(() => this.accordion.unregisterHeader(handle));\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n this.accordion.nav.handleKeydown(event);\n }\n\n protected toggle(): void {\n if (this.disabled()) {\n return;\n }\n this.accordion.toggle(this.panelId());\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n// Type-only edge: erased at compile time (isolatedModules), so no runtime\n// module cycle forms. The only runtime edge is item -> token (inject).\nimport type { CngxBreadcrumbItem } from './breadcrumb-item.directive';\n\n/**\n * Contract a {@link CngxBreadcrumb} provides to its items and to a drop-in\n * overflow via DI. Item-keyed queries stay methods; the collapse set is\n * exposed as signals so a decoupled overflow can derive off them without\n * injecting the concrete coordinator class.\n */\nexport interface CngxBreadcrumbHost {\n /** Whether this item is the terminal crumb (gets `aria-current=\"page\"`). */\n isTerminal(item: CngxBreadcrumbItem): boolean;\n /** Whether this item is collapsed into the overflow menu (hidden in the trail). */\n isCollapsed(item: CngxBreadcrumbItem): boolean;\n /** The crumbs currently collapsed into the overflow, in DOM order. */\n readonly collapsedItems: Signal<readonly CngxBreadcrumbItem[]>;\n /** Whether any crumb is collapsed (drives the overflow trigger's visibility). */\n readonly hasCollapsed: Signal<boolean>;\n}\n\n/**\n * DI token for the {@link CngxBreadcrumbHost} contract. {@link CngxBreadcrumb}\n * provides it via `useExisting`; each {@link CngxBreadcrumbItem} injects it.\n *\n * @category common/interactive/breadcrumb\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb.token.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, CngxBreadcrumbItem\n */\nexport const CNGX_BREADCRUMB = new InjectionToken<CngxBreadcrumbHost>('CNGX_BREADCRUMB');\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { CNGX_BREADCRUMB } from './breadcrumb.token';\n\n/**\n * A single crumb. Put `cngxBreadcrumbItem` on the crumb element. Intermediate\n * crumbs are links (`<a href>`); the terminal crumb may be either a `<span>` or\n * an `<a [attr.href]=\"null\">` - both derive `aria-current=\"page\"` purely from\n * position in the trail (no manual flag). The item hides itself with `[hidden]`\n * when the coordinator collapses it into the overflow menu.\n *\n * @category common/interactive/breadcrumb\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb-item.directive.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, CngxBreadcrumbSeparator\n * <example-url>http://localhost:4200/#/common/interactive/breadcrumb/basic-trail</example-url>\n */\n@Directive({\n selector: '[cngxBreadcrumbItem]',\n exportAs: 'cngxBreadcrumbItem',\n standalone: true,\n host: {\n '[attr.aria-current]': \"terminal() ? 'page' : null\",\n '[hidden]': 'collapsed()',\n },\n})\nexport class CngxBreadcrumbItem {\n private readonly breadcrumb = inject(CNGX_BREADCRUMB);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Explicit accessible label for the overflow menu, when the crumb's rendered\n * text is not the right string to list (e.g. an icon-only crumb). Reactive:\n * bind it when the crumb text is dynamic.\n */\n readonly label = input<string>('', { alias: 'cngxBreadcrumbItemLabel' });\n\n /** Whether this is the terminal crumb (the current page). */\n protected readonly terminal = computed(() => this.breadcrumb.isTerminal(this));\n /** Whether this crumb is collapsed into the overflow menu. */\n protected readonly collapsed = computed(() => this.breadcrumb.isCollapsed(this));\n\n /**\n * Readable label for the collapsed-crumb list. Prefers the explicit\n * {@link label} input; otherwise falls back to the projected text.\n *\n * The fallback is a **one-shot DOM read at call time**, not reactive - it\n * reflects the text present when called. For crumbs whose text changes at\n * runtime, bind `[cngxBreadcrumbItemLabel]` so the reactive path is used.\n */\n resolvedLabel(): string {\n const explicit = this.label();\n if (explicit) {\n return explicit;\n }\n return this.host.nativeElement.textContent?.trim() ?? '';\n }\n}\n","/**\n * A collapse strategy decides which crumb indices fold into the overflow menu.\n * Pure and synchronous: given the total crumb count and the `maxVisible` cap it\n * returns the set of indices to hide. Swap it via\n * {@link CNGX_BREADCRUMB_COLLAPSE_STRATEGY} to change the rule (width-aware,\n * keep-first-N, mobile parent-only, ...) without forking {@link CngxBreadcrumb}.\n */\nexport type CngxBreadcrumbCollapseStrategy = (\n total: number,\n maxVisible: number,\n) => ReadonlySet<number>;\n\nconst NO_COLLAPSE: ReadonlySet<number> = new Set();\n\n/**\n * The default collapse rule: keep the first crumb and the last\n * `maxVisible - 1`, folding the middle into the overflow menu. Returns an empty\n * set when `maxVisible` is unset/invalid (`< 1`) or the trail already fits\n * (`total <= maxVisible`), so a short trail never collapses.\n *\n * @category common/interactive/breadcrumb\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb-collapse.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, CNGX_BREADCRUMB_COLLAPSE_STRATEGY\n */\nexport function createBreadcrumbCollapse(): CngxBreadcrumbCollapseStrategy {\n return (total, maxVisible) => {\n if (!maxVisible || maxVisible < 1 || total <= maxVisible) {\n return NO_COLLAPSE;\n }\n const keepTail = maxVisible - 1;\n const collapsed = new Set<number>();\n for (let i = 1; i < total - keepTail; i++) {\n collapsed.add(i);\n }\n return collapsed;\n };\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { createBreadcrumbCollapse, type CngxBreadcrumbCollapseStrategy } from './breadcrumb-collapse';\n\n/**\n * DI token for the breadcrumb collapse rule. Defaults to\n * {@link createBreadcrumbCollapse} (keep the first crumb + the last\n * `maxVisible - 1`). Override it in `providers` (app-wide) or `viewProviders`\n * (per {@link CngxBreadcrumb} instance) to swap the rule - width-aware,\n * keep-first-N, mobile parent-only - without forking the coordinator.\n *\n * ```ts\n * viewProviders: [{\n * provide: CNGX_BREADCRUMB_COLLAPSE_STRATEGY,\n * useValue: (total, max) => new Set(range(2, total - 2)),\n * }]\n * ```\n *\n * @category common/interactive/breadcrumb\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb-collapse.token.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, createBreadcrumbCollapse\n */\nexport const CNGX_BREADCRUMB_COLLAPSE_STRATEGY = new InjectionToken<CngxBreadcrumbCollapseStrategy>(\n 'CNGX_BREADCRUMB_COLLAPSE_STRATEGY',\n { providedIn: 'root', factory: () => createBreadcrumbCollapse() },\n);\n","import { computed, contentChildren, Directive, inject, input } from '@angular/core';\nimport { arrayEqual, setEqual } from '@cngx/utils';\n\nimport { CngxBreadcrumbItem } from './breadcrumb-item.directive';\nimport { CNGX_BREADCRUMB_COLLAPSE_STRATEGY } from './breadcrumb-collapse.token';\nimport { CNGX_BREADCRUMB, type CngxBreadcrumbHost } from './breadcrumb.token';\n\n/**\n * Linear breadcrumb navigation. Put `cngxBreadcrumb` on the `<nav>`; it names\n * the landmark (`aria-label`, EN default \"Breadcrumb\") and, when the trail\n * exceeds `[maxVisible]`, derives which middle crumbs collapse - keeping the\n * first crumb and the last `maxVisible - 1`. The collapse set is a `computed()`\n * over the projected items, so terminal-crumb marking and overflow are pure\n * derivation, never synced (Pillar 1). Consumers render the collapsed crumbs in\n * an ellipsis `CngxMenu` and may truncate long labels with `CngxTruncate`.\n *\n * ```html\n * <nav cngxBreadcrumb [maxVisible]=\"4\" #bc=\"cngxBreadcrumb\">\n * <ol>\n * <li><a cngxBreadcrumbItem href=\"/\">Home</a></li>\n * <li cngxBreadcrumbSeparator>/</li>\n * <li><a cngxBreadcrumbItem href=\"/library\">Library</a></li>\n * <li cngxBreadcrumbSeparator>/</li>\n * <li><span cngxBreadcrumbItem>Current page</span></li>\n * </ol>\n * </nav>\n * ```\n *\n * @category common/interactive/breadcrumb\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb.directive.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumbItem, CngxBreadcrumbSeparator, CngxBreadcrumbBar\n * <example-url>http://localhost:4200/#/common/interactive/breadcrumb/basic-trail</example-url>\n */\n@Directive({\n selector: '[cngxBreadcrumb]',\n exportAs: 'cngxBreadcrumb',\n standalone: true,\n providers: [{ provide: CNGX_BREADCRUMB, useExisting: CngxBreadcrumb }],\n host: {\n '[attr.aria-label]': 'label()',\n },\n})\nexport class CngxBreadcrumb implements CngxBreadcrumbHost {\n /** Accessible name of the navigation landmark. EN default. */\n readonly label = input<string>('Breadcrumb');\n /** Maximum crumbs to show before the middle collapses. Unset = never collapse. */\n readonly maxVisible = input<number | undefined>(undefined);\n\n /** Swappable collapse rule; defaults to keep-first + last (max - 1). */\n private readonly collapse = inject(CNGX_BREADCRUMB_COLLAPSE_STRATEGY);\n\n /** Projected crumbs in DOM order (items may be nested in `<ol>`/`<li>`). */\n private readonly items = contentChildren(CngxBreadcrumbItem, { descendants: true });\n\n // Item -> index lookup for isTerminal/isCollapsed (O(1), was O(n) indexOf).\n // No `equal`: its sole dependency is items(), so it recomputes only when the\n // item set changes, at which point a fresh WeakMap is the correct downstream\n // signal - a WeakMap keyed by directive instances has no structural equality.\n private readonly indexByItem = computed(() => {\n const map = new WeakMap<CngxBreadcrumbItem, number>();\n this.items().forEach((item, index) => map.set(item, index));\n return map;\n });\n\n private readonly collapsedIndices = computed<ReadonlySet<number>>(\n () => this.collapse(this.items().length, this.maxVisible() ?? 0),\n { equal: setEqual },\n );\n\n /** The crumbs currently collapsed into the overflow menu, in order. */\n readonly collapsedItems = computed(\n () => this.items().filter((_, index) => this.collapsedIndices().has(index)),\n { equal: arrayEqual },\n );\n\n /** Whether any crumb is collapsed (drives the ellipsis trigger's visibility). */\n readonly hasCollapsed = computed(() => this.collapsedIndices().size > 0);\n\n isTerminal(item: CngxBreadcrumbItem): boolean {\n const index = this.indexByItem().get(item);\n return index !== undefined && index === this.items().length - 1;\n }\n\n isCollapsed(item: CngxBreadcrumbItem): boolean {\n const index = this.indexByItem().get(item);\n return index !== undefined && this.collapsedIndices().has(index);\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Visual separator between crumbs (slash, chevron, projected icon). Put\n * `cngxBreadcrumbSeparator` on the separator element; it is marked\n * `aria-hidden=\"true\"` so assistive tech reads the trail as a clean list of\n * links without the decorative glyphs.\n *\n * @category common/interactive/breadcrumb\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb-separator.directive.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, CngxBreadcrumbItem\n * <example-url>http://localhost:4200/#/common/interactive/breadcrumb/custom-separator</example-url>\n */\n@Directive({\n selector: '[cngxBreadcrumbSeparator]',\n exportAs: 'cngxBreadcrumbSeparator',\n standalone: true,\n host: {\n 'aria-hidden': 'true',\n },\n})\nexport class CngxBreadcrumbSeparator {}\n","/**\n * One width breakpoint for the responsive breadcrumb collapse: at `minWidth`\n * pixels and above, show at most `maxVisible` crumbs before the middle folds\n * into the overflow menu. A tier list is resolved by {@link resolveBreadcrumbTier}.\n */\nexport interface CngxBreadcrumbWidthTier {\n /** Lower bound (inclusive, px) at which this tier's `maxVisible` applies. */\n readonly minWidth: number;\n /** Crumb cap once this tier is the active one. Fed to the count-based collapse. */\n readonly maxVisible: number;\n}\n\n/**\n * Default width tiers, matching the headless `responsive-collapse` recipe: 640px\n * and up shows 6, 440px and up shows 4, anything narrower shows 2. The `0` floor\n * guarantees a match for every non-negative width.\n */\nexport const DEFAULT_BREADCRUMB_WIDTH_TIERS: readonly CngxBreadcrumbWidthTier[] = [\n { minWidth: 640, maxVisible: 6 },\n { minWidth: 440, maxVisible: 4 },\n { minWidth: 0, maxVisible: 2 },\n];\n\n/**\n * Pure width->count resolver: returns the `maxVisible` of the tier with the\n * highest `minWidth` that is still `<= width`. Order-independent - the tier list\n * is normalised (sorted by descending `minWidth`) before matching, so a consumer\n * may pass tiers in any order. When `width` sits below every tier's `minWidth`\n * the narrowest tier's `maxVisible` is the floor; an empty tier list yields\n * `Number.POSITIVE_INFINITY` (never collapse), leaving the trail intact.\n *\n * No DOM, no Angular - the width source (a `CngxResizeObserver`) lives in the\n * bar; this stays jsdom-testable and shared by the bar and the headless recipe.\n *\n * @category common/interactive/breadcrumb\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb-responsive.ts\n * @since 0.1.0\n * @relatedTo CngxBreadcrumb, CngxBreadcrumbWidthTier, DEFAULT_BREADCRUMB_WIDTH_TIERS\n */\nexport function resolveBreadcrumbTier(\n width: number,\n tiers: readonly CngxBreadcrumbWidthTier[],\n): number {\n if (tiers.length === 0) {\n return Number.POSITIVE_INFINITY;\n }\n const sorted = [...tiers].sort((a, b) => b.minWidth - a.minWidth);\n for (const tier of sorted) {\n if (width >= tier.minWidth) {\n return tier.maxVisible;\n }\n }\n return sorted[sorted.length - 1].maxVisible;\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * One registered error source within an {@link CngxErrorAggregatorContract}.\n *\n * `key` uniquely identifies the source within its aggregator. `condition`\n * is the live signal the aggregator reads on every recompute. `label` is\n * an optional human-readable string included in announcements.\n *\n * @category common/interactive/error\n */\nexport interface CngxErrorAggregatorSourceEntry {\n readonly key: string;\n readonly condition: Signal<boolean>;\n readonly label?: string | null;\n}\n\n/**\n * Contract every {@link CngxErrorAggregator} (or external override) fulfils.\n *\n * The aggregator is the live A11y surface - it computes `hasError` /\n * `errorCount` / `activeErrors` / `errorLabels` / `shouldShow` /\n * `announcement` from its registered sources and exposes them to the\n * surrounding host. Sources register via {@link addSource} on init and\n * deregister via {@link removeSource} on teardown.\n *\n * @category common/interactive/error\n */\nexport interface CngxErrorAggregatorContract {\n /** `true` when at least one registered source's condition is `true`. */\n readonly hasError: Signal<boolean>;\n /** Count of currently active error sources. */\n readonly errorCount: Signal<number>;\n /** Keys of currently active error sources, in registration order. */\n readonly activeErrors: Signal<readonly string[]>;\n /** Labels of currently active error sources (only entries with non-null labels). */\n readonly errorLabels: Signal<readonly string[]>;\n /** `true` when errors should be visible - `hasError` AND scope reveal-state. */\n readonly shouldShow: Signal<boolean>;\n /** SR-friendly announcement text - joins active labels into one phrase. */\n readonly announcement: Signal<string>;\n /** Registers (or replaces) a source by `key`. */\n addSource(entry: CngxErrorAggregatorSourceEntry): void;\n /** Deregisters the source with `key` (no-op if absent). */\n removeSource(key: string): void;\n}\n\n/**\n * DI token resolving to the nearest {@link CngxErrorAggregatorContract}\n * ancestor.\n *\n * Provided by {@link CngxErrorAggregator} via `useExisting`; descendant\n * `CngxErrorSource` directives inject with `{ optional: true }` so they\n * function as no-ops outside an aggregator.\n *\n * @category common/interactive/error\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-aggregator/error-aggregator.token.ts\n * @since 0.1.0\n */\nexport const CNGX_ERROR_AGGREGATOR = new InjectionToken<CngxErrorAggregatorContract>(\n 'CngxErrorAggregator',\n);\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n type ElementRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n inject,\n input,\n model,\n signal,\n viewChild,\n type TemplateRef,\n} from '@angular/core';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Single-value boolean switch with W3C `role=\"switch\"` semantics. Click,\n * Space, and Enter all flip `value`; the directive form (`[cngxToggle]`)\n * applies the contract to a host element that owns its own markup, while\n * the element form (`<cngx-toggle>`) renders a track + thumb skin and\n * accepts label content via `<ng-content>`.\n *\n * `value` is a `ModelSignal<boolean>` - consumers two-way-bind via\n * `[(value)]` and the directive emits `valueChange` on every flip.\n * `disabled` is also a `ModelSignal<boolean>` so the\n * `CngxFormBridge` (Phase 7) can drive it via `setDisabledState`\n * without a separate write path; consumers usually only read or set\n * one direction.\n *\n * `disabledReason` is consumer-supplied free text (no library default\n * per `feedback_en_default_locale`) - when present it lands in a hidden\n * `<span>` referenced by the host's `aria-describedby`. Per Pillar 2,\n * the description span is always in the DOM (visibility toggles via\n * `aria-hidden`); the host's `aria-describedby` is only emitted when a\n * reason is set so AT does not announce an empty description.\n *\n * Typical usage prefers the `<div>`/`<cngx-toggle>` element form because\n * `role=\"switch\"` on a native `<button>` would conflict with the\n * browser's own Space → click synthesis and produce double-toggles.\n *\n * ```html\n * <cngx-toggle [(value)]=\"emailNotifications\">\n * E-mails empfangen\n * </cngx-toggle>\n *\n * <div\n * cngxToggle\n * [(value)]=\"dark\"\n * [disabled]=\"systemPreferenceLocked()\"\n * disabledReason=\"Locked by your OS preference\"\n * >Dark mode</div>\n * ```\n *\n * ```html\n * <ng-template #icon><span aria-hidden=\"true\">★</span></ng-template>\n * <cngx-toggle [(value)]=\"featured\" [thumbGlyph]=\"icon\">Featured</cngx-toggle>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/toggle/toggle.component.ts\n * @selector cngx-toggle\n * @since 0.1.0\n * @relatedTo CngxCheckbox, CngxButtonToggle, CngxRadio\n * <example-url>http://localhost:4200/#/common/interactive/toggle/basic-two-way-binding</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/toggle/custom-thumb-glyph</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/toggle/disabled-with-reason</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/toggle/label-position</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: '[cngxToggle], cngx-toggle',\n exportAs: 'cngxToggle',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'cngx-toggle',\n role: 'switch',\n '[attr.id]': 'id()',\n '[attr.aria-checked]': 'value() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-labelledby]': 'hasProjectedLabel() ? labelId : null',\n '[attr.aria-describedby]': 'describedById()',\n '[attr.tabindex]': 'disabled() ? -1 : 0',\n '[class.cngx-toggle--checked]': 'value()',\n '[class.cngx-toggle--disabled]': 'disabled()',\n '[class.cngx-toggle--label-before]': 'labelPosition() === \"before\"',\n '(click)': 'handleClick()',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxToggle },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxToggle },\n ],\n imports: [NgTemplateOutlet],\n template: `\n <span class=\"cngx-toggle__track\" aria-hidden=\"true\">\n <span class=\"cngx-toggle__thumb\">\n @if (thumbGlyph(); as glyph) {\n <ng-container *ngTemplateOutlet=\"glyph\" />\n }\n </span>\n </span>\n <span #label class=\"cngx-toggle__label\" [id]=\"labelId\">\n <ng-content />\n </span>\n <span\n [id]=\"describedId\"\n class=\"cngx-toggle__sr-only\"\n [attr.aria-hidden]=\"disabledReason() ? null : 'true'\"\n >{{ disabledReason() }}</span\n >\n `,\n styleUrls: ['./toggle.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxToggle implements CngxControlValue<boolean>, CngxFormFieldControl {\n readonly value = model<boolean>(false);\n readonly disabled = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element (e.g. a sibling\n * rendered by `<cngx-form-field>` or a consumer-owned `<span>`).\n * When set, the host emits `aria-errormessage=\"<id>\"` so AT can\n * locate the message; consumers MUST render an element with that id\n * - passing an id without a matching element produces a dangling\n * AT reference. Default `null` skips the attribute entirely.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly disabledReason = input<string>('');\n readonly labelPosition = input<'before' | 'after'>('after');\n readonly thumbGlyph = input<TemplateRef<void> | null>(null);\n\n protected readonly describedId = nextUid('cngx-toggle-desc');\n protected readonly labelId = nextUid('cngx-toggle-label');\n\n protected readonly describedById = computed(() =>\n this.disabledReason() ? this.describedId : null,\n );\n\n private readonly labelRef = viewChild<ElementRef<HTMLElement>>('label');\n private readonly hasProjectedLabelState = signal(false);\n /**\n * True when static content is projected into the label span. Gates\n * `aria-labelledby`: Chrome's name-from-contents for `role=\"switch\"`\n * does not recurse into the nested `.cngx-toggle__label`, so a\n * projected label would otherwise yield an empty accessible name\n * (Pillar 2). Emitting `aria-labelledby` only when a label is present\n * leaves an icon-only toggle's consumer `aria-label` in force -\n * pointing labelledby at an empty span would blank the name instead.\n */\n protected readonly hasProjectedLabel = this.hasProjectedLabelState.asReadonly();\n\n constructor() {\n // One-shot post-render read of the projected content (static-label\n // case, the switch-label norm). afterNextRender runs after `<ng-content>`\n // resolves and is outside the reactive graph; on SSR it no-ops and\n // hydrates true on the client (attribute-only, hydration-safe). A\n // late-changing projected label (empty->filled after first render) is\n // intentionally not tracked here.\n afterNextRender(() => {\n this.hasProjectedLabelState.set(\n !!this.labelRef()?.nativeElement.textContent?.trim(),\n );\n });\n }\n\n /** Stable per-instance id used for `<label for>` wiring. */\n readonly id = signal(nextUid('cngx-toggle-')).asReadonly();\n\n private readonly focusedState = signal(false);\n /** Whether the host element currently has DOM focus. */\n readonly focused = this.focusedState.asReadonly();\n\n /** True when the toggle is `false` (off) - boolean atom semantics. */\n readonly empty = computed(() => this.value() === false);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n /**\n * Field-host→aggregator cascade. Inside `<cngx-form-field>` the\n * presenter governs visibility (touched / strategy / scope). Outside\n * form-field but inside `<cngxErrorAggregator>` the aggregator's\n * `shouldShow` (reveal-aware) wins. Outside both contexts the atom\n * paints no error skin.\n */\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n protected handleClick(): void {\n if (this.disabled()) {\n return;\n }\n this.value.update((v) => !v);\n }\n\n protected handleKeydown(event: Event): void {\n if (this.disabled()) {\n return;\n }\n event.preventDefault();\n this.value.update((v) => !v);\n }\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n signal,\n type TemplateRef,\n} from '@angular/core';\nimport { CngxRovingItem, CngxRovingTabindex } from '@cngx/common/a11y';\nimport { CngxCheckboxIndicator } from '@cngx/common/display';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Single-value boolean checkbox with indeterminate support and W3C\n * `role=\"checkbox\"` semantics. Click, Space, and Enter all advance\n * `value`; an indeterminate checkbox advances to `value=true`,\n * `indeterminate=false` in a single step (per WAI-ARIA tristate\n * semantics - there is no path that lands the checkbox back in\n * `'mixed'` from a user click).\n *\n * `value` and `indeterminate` are both `ModelSignal<boolean>` so\n * consumers can two-way-bind both: `[(value)]` for the canonical\n * checked/unchecked state, `[(indeterminate)]` for the tri-state\n * marker most often driven by a parent group's \"some-but-not-all\"\n * computation. `disabled` is also a `ModelSignal<boolean>` to keep\n * the `CngxFormBridge`'s `setDisabledState` write path consistent\n * across the family.\n *\n * Visual indicator state is delegated to `<cngx-checkbox-indicator>`\n * from `@cngx/common/display`; this interactive molecule owns role,\n * keyboard, and ARIA wiring and composes the display atom. Per\n * Pillar 3, the visual atom is\n * reused - never re-drawn here.\n *\n * `aria-checked` is a reactive computed: `indeterminate() ? 'mixed' :\n * value() ? 'true' : 'false'`. The description span for\n * `disabledReason` follows the same always-in-DOM rule as\n * `CngxToggle`.\n *\n * ```html\n * <cngx-checkbox [(value)]=\"acceptTerms\">I accept the terms</cngx-checkbox>\n *\n * <cngx-checkbox\n * [(value)]=\"allSelected()\"\n * [(indeterminate)]=\"someSelected() && !allSelected()\"\n * (valueChange)=\"toggleAll($event)\"\n * >Select all</cngx-checkbox>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/checkbox/checkbox.component.ts\n * @selector cngx-checkbox\n * @since 0.1.0\n * @relatedTo CngxCheckboxGroup, CngxCheckboxIndicator, CngxToggle, CngxRadio\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/group/basic-select-all-master-projected-leaves</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/group/disabled-cascade</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/base/basic-two-way-binding</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/base/custom-check-dash-glyphs</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/base/disabled</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/base/tri-state-select-all-pattern</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-checkbox, [cngxCheckbox]',\n exportAs: 'cngxCheckbox',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingItem,\n inputs: ['cngxRovingItemDisabled: disabled'],\n },\n ],\n imports: [CngxCheckboxIndicator],\n host: {\n class: 'cngx-checkbox',\n role: 'checkbox',\n '[attr.id]': 'id()',\n '[attr.aria-checked]': 'ariaChecked()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-invalid]': 'ariaInvalid() ? \"true\" : null',\n '[attr.aria-errormessage]': 'ariaInvalid() ? errorMessageId() : null',\n '[attr.aria-describedby]': 'describedId',\n '[attr.tabindex]': 'hostTabindex()',\n '[class.cngx-checkbox--checked]': 'value()',\n '[class.cngx-checkbox--indeterminate]': 'indeterminate()',\n '[class.cngx-checkbox--disabled]': 'disabled()',\n '(click)': 'handleClick()',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxCheckbox },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxCheckbox },\n ],\n template: `\n <cngx-checkbox-indicator\n variant=\"checkbox\"\n [checked]=\"value()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"disabled()\"\n [checkGlyph]=\"checkGlyph()\"\n [dashGlyph]=\"dashGlyph()\"\n />\n <span class=\"cngx-checkbox__label\">\n <ng-content />\n </span>\n <span\n [id]=\"describedId\"\n class=\"cngx-checkbox__sr-only\"\n [attr.aria-hidden]=\"disabledReason() ? null : 'true'\"\n >{{ disabledReason() }}</span\n >\n `,\n styleUrls: ['./checkbox.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldControl {\n readonly value = model<boolean>(false);\n readonly indeterminate = model<boolean>(false);\n readonly disabled = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element (e.g. a sibling\n * rendered by `<cngx-form-field>` or a consumer-owned `<span>`).\n * The host emits `aria-errormessage=\"<id>\"` only when\n * `aria-invalid=\"true\"` — symmetric with the sibling `aria-invalid`\n * host binding (both gate on `invalid() || errorState()`). Consumers\n * MUST render an element with the supplied id; passing an id without\n * a matching element produces a dangling AT reference. Default\n * `null` skips the attribute entirely.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly disabledReason = input<string>('');\n readonly checkGlyph = input<TemplateRef<void> | null>(null);\n readonly dashGlyph = input<TemplateRef<void> | null>(null);\n\n protected readonly describedId = nextUid('cngx-checkbox-desc');\n\n private readonly rovingParent = inject(CngxRovingTabindex, {\n optional: true,\n skipSelf: true,\n });\n\n /**\n * When inside a `CngxRovingTabindex` parent (typically `CngxCheckboxGroup`),\n * yields `null` so the roving controller owns the `tabindex` attribute\n * uncontested. Standalone, falls back to the WAI-ARIA default of\n * `0` (or `-1` when disabled). Mirrors `CngxCard.hostTabindex`.\n */\n protected readonly hostTabindex = computed<number | null>(() =>\n this.rovingParent ? null : this.disabled() ? -1 : 0,\n );\n\n protected readonly ariaChecked = computed<'true' | 'false' | 'mixed'>(() =>\n this.indeterminate() ? 'mixed' : this.value() ? 'true' : 'false',\n );\n\n readonly id = signal(nextUid('cngx-checkbox-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /**\n * Empty when value is `false` AND not in tri-state intermediate. An\n * indeterminate checkbox carries user-visible state, so it does not\n * count as empty for forms purposes.\n */\n readonly empty = computed(() => this.value() === false && !this.indeterminate());\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n protected readonly ariaInvalid = computed(() => this.invalid() || this.errorState());\n\n protected handleClick(): void {\n this.advance();\n }\n\n protected handleKeydown(event: Event): void {\n if (this.disabled()) {\n return;\n }\n event.preventDefault();\n this.advance();\n }\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n\n private advance(): void {\n if (this.disabled()) {\n return;\n }\n if (this.indeterminate()) {\n this.value.set(true);\n this.indeterminate.set(false);\n return;\n }\n this.value.update((v) => !v);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n DestroyRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport {\n CNGX_SELECTION_CONTROLLER_FACTORY,\n nextUid,\n type CngxAsyncState,\n type SelectionController,\n} from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Multi-value checkbox-group molecule. Owns a `selectedValues` model\n * (the canonical multi-value source) and exposes membership\n * derivations (`allSelected`, `someSelected`, `noneSelected`,\n * `selectedCount`) plus the toggle-all triad (`toggleAll`, `select`,\n * `deselect`) every consumer needs to wire a \"select all\" master\n * checkbox to the group.\n *\n * Internals lean on `createSelectionController` from `@cngx/core/utils`\n * for membership tracking - the controller's structural-equality\n * `selected` snapshot prevents downstream computed cascades from\n * thrashing when a re-emission produces the same logical contents\n * with a different array reference.\n *\n * `value` is a structural alias of `selectedValues` so the group\n * satisfies `CngxControlValue<T[]>` without owning two synchronised\n * models - both names point to the same `ModelSignal<T[]>` instance.\n *\n * Per Pillar 1 (Ableitung statt Verwaltung), every derived flag is a\n * `computed()` - there is no manual sync between membership and the\n * exposed flags. Per Pillar 3 (Komposition statt Konfiguration), the\n * group composes `CngxRovingTabindex` as a host directive and emits\n * no implicit children - consumers project `<cngx-checkbox>` instances\n * (or any other CNGX_CONTROL_VALUE-bearing leaf) and bind each leaf's\n * value-tracking themselves.\n *\n * `[allValues]` is optional; when supplied, `allSelected` reflects\n * \"every option ticked\" rather than the vacuous \"every selected value\n * is still selected\" default. Consumers that wire a master checkbox\n * pass the full option pool here so `toggleAll()` can\n * select-or-clear-all per the user's mental model.\n *\n * `[keyFn]` lets consumers with object-typed values map each value\n * to a stable membership key (typically `(v) => v.id`). Without it,\n * membership uses identity / primitive equality - which silently\n * breaks across re-emissions when the consumer refetches array\n * elements with the same id but new references.\n *\n * `[state]` is an optional `CngxAsyncState<unknown>` input; when bound,\n * `aria-busy` reflects `state.status() === 'loading'` reactively so AT\n * announces the busy moment without the consumer wiring the attribute\n * by hand.\n *\n * ```html\n * <cngx-checkbox-group\n * label=\"Notifications\"\n * [allValues]=\"options\"\n * [(selectedValues)]=\"picked\"\n * >\n * <cngx-checkbox\n * *ngFor=\"let opt of options\"\n * [value]=\"opt\"\n * >{{ opt }}</cngx-checkbox>\n * </cngx-checkbox-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/checkbox-group/checkbox-group.component.ts\n * @selector cngx-checkbox-group\n * @since 0.1.0\n * @relatedTo CngxCheckbox, CngxRovingTabindex, CngxRadioGroup\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/group/basic-select-all-master-projected-leaves</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/checkbox/group/disabled-cascade</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-checkbox-group, [cngxCheckboxGroup]',\n exportAs: 'cngxCheckboxGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingTabindex,\n inputs: ['orientation'],\n },\n ],\n host: {\n class: 'cngx-checkbox-group',\n role: 'group',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': 'ariaInvalid() ? \"true\" : null',\n '[attr.aria-errormessage]': 'ariaInvalid() ? errorMessageId() : null',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-checkbox-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxCheckboxGroup },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxCheckboxGroup },\n ],\n template: `<ng-content />`,\n styleUrls: ['./checkbox-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxCheckboxGroup<T = unknown> implements CngxControlValue<T[]>, CngxFormFieldControl {\n readonly selectedValues = model<T[]>([]);\n readonly value = this.selectedValues;\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. The host emits\n * `aria-errormessage=\"<id>\"` only when `aria-invalid=\"true\"` —\n * symmetric with the sibling `aria-invalid` host binding (both gate\n * on `invalid() || errorState()`). Consumers MUST render an element\n * with the supplied id. Default `null` skips the attribute.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n readonly label = input<string | undefined>(undefined);\n readonly allValues = input<readonly T[] | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n readonly keyFn = input<(value: T) => unknown>((v) => v);\n\n private readonly controller: SelectionController<T> = inject(\n CNGX_SELECTION_CONTROLLER_FACTORY,\n )<T>(this.selectedValues, {\n keyFn: (v) => this.keyFn()(v),\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.controller.destroy());\n }\n\n readonly selectedCount = this.controller.selectedCount;\n\n readonly noneSelected = computed(() => this.selectedCount() === 0);\n\n readonly allSelected = computed(() => {\n const pool = this.allValues();\n if (pool === undefined) {\n return this.selectedCount() > 0;\n }\n if (pool.length === 0) {\n return false;\n }\n for (const v of pool) {\n if (!this.controller.isSelected(v)()) {\n return false;\n }\n }\n return true;\n });\n\n readonly someSelected = computed(() => this.selectedCount() > 0 && !this.allSelected());\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n toggleAll(): void {\n if (this.disabled()) {\n return;\n }\n const pool = this.allValues();\n if (pool !== undefined) {\n this.controller.toggleAll(pool);\n return;\n }\n if (this.selectedCount() > 0) {\n this.controller.clear();\n }\n }\n\n select(value: T): void {\n if (this.disabled()) {\n return;\n }\n this.controller.select(value);\n }\n\n deselect(value: T): void {\n if (this.disabled()) {\n return;\n }\n this.controller.deselect(value);\n }\n\n readonly id = signal(nextUid('cngx-checkbox-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no values selected. */\n readonly empty = computed(() => this.selectedValues().length === 0);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n protected readonly ariaInvalid = computed(() => this.invalid() || this.errorState());\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import { InjectionToken, type ModelSignal, type Signal } from '@angular/core';\n\n/**\n * Single-select parent contract every `CngxButtonToggleGroup` provides\n * via `useExisting`. `CngxButtonToggle` leaves inject this token (or\n * `CNGX_BUTTON_MULTI_TOGGLE_GROUP` for the multi case) - never the\n * concrete group class - so the leaf stays decompose-ready and free\n * of cyclic type dependencies.\n *\n * `value` is a `ModelSignal<T | undefined>` because the group's\n * canonical value is two-way-bindable from the consumer (`[(value)]`)\n * and the active leaf writes it via `value.set(this.value())` on\n * pick. `disabled` is a read-only `Signal<boolean>` so the leaf can\n * combine it with its own per-toggle `disabled()` to compute\n * `toggleDisabled`.\n *\n * @category common/interactive\n */\nexport interface CngxButtonToggleGroupContract<T = unknown> {\n readonly value: ModelSignal<T | undefined>;\n readonly disabled: Signal<boolean>;\n /**\n * Consume the group's \"last interaction was a roving-arrow keydown\"\n * flag. Called by a leaf's `(focus)` handler - when the flag is\n * true, the leaf forwards its value to the group's `value` model\n * (W3C APG auto-select-on-arrow-nav semantics, radiogroup variant)\n * and the flag is cleared so a subsequent Tab-into focus does not\n * double-select. Returns whether the group actually consumed the\n * flag, so the leaf can short-circuit redundant work.\n */\n consumePendingArrowSelect(value: T): boolean;\n}\n\n/**\n * DI token a `CngxButtonToggle` leaf injects to find its single-mode\n * parent group. Always provided via\n * `{ provide: CNGX_BUTTON_TOGGLE_GROUP, useExisting:\n * CngxButtonToggleGroup }` - never via concrete-class injection (per\n * `reference_atomic_decompose` §4).\n *\n * The leaf injects this token AND `CNGX_BUTTON_MULTI_TOGGLE_GROUP`\n * with `{ optional: true }` on both; the present token determines the\n * leaf's keyboard semantics + ARIA pattern (`aria-checked` for single,\n * `aria-selected` for multi), chosen at injection time, NOT at\n * runtime - there is no `[selectionMode]` flag.\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-toggle-group.token.ts\n * @since 0.1.0\n */\nexport const CNGX_BUTTON_TOGGLE_GROUP = new InjectionToken<CngxButtonToggleGroupContract>(\n 'CngxButtonToggleGroup',\n);\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid, type CngxAsyncState } from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\nimport {\n CNGX_BUTTON_TOGGLE_GROUP,\n type CngxButtonToggleGroupContract,\n} from './button-toggle-group.token';\n\n/**\n * Single-select button-toggle group. Owns a `value = model<T |\n * undefined>` (the canonical single-value source) and exposes the\n * parent contract via `CNGX_BUTTON_TOGGLE_GROUP`. Behaves as a W3C\n * APG `radiogroup` - arrow keys move focus AND select (auto-select\n * variant); Tab + programmatic focus do not select on focus alone;\n * Space and Enter select the currently-focused toggle.\n *\n * Mode is **static**: this component is the single-select half of a\n * deliberate split (per `feedback_select_family_split`). Consumers\n * pick `<cngx-button-toggle-group>` for radiogroup semantics or\n * `<cngx-button-multi-toggle-group>` for toolbar semantics - never a\n * runtime `[selectionMode]` flag, never a shape-shifter. The leaf\n * `CngxButtonToggle` injects EITHER this token OR\n * `CNGX_BUTTON_MULTI_TOGGLE_GROUP` (`{ optional: true }` on both)\n * and chooses its ARIA pattern at injection time, not at runtime.\n *\n * Auto-select wiring follows the same contract as `CngxRadioGroup`:\n * the host `CngxRovingTabindex` raises its navigation-key intent before\n * it moves focus; each focused leaf consumes that intent in its\n * `(focus)` handler via `consumePendingArrowSelect()`, which reads\n * `roving.consumeNavigationKey()`. Reading an already-set fact (instead\n * of a group-owned `(keydown)` flag) closes the one-press-behind race\n * (#135). The value write happens inside a DOM event handler - never\n * inside an `effect()`.\n *\n * ```html\n * <cngx-button-toggle-group label=\"Layout\" [(value)]=\"view\">\n * <button cngxButtonToggle value=\"grid\">Grid</button>\n * <button cngxButtonToggle value=\"list\">List</button>\n * <button cngxButtonToggle value=\"table\">Table</button>\n * </cngx-button-toggle-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-toggle-group.component.ts\n * @selector cngx-button-toggle-group\n * @since 0.1.0\n * @relatedTo CngxButtonToggle, CngxRadioGroup\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/basic-view-switcher</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/disabled-group-cascade-vs-per-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/vertical-orientation</example-url>\n */\n@Component({\n selector: 'cngx-button-toggle-group, [cngxButtonToggleGroup]',\n exportAs: 'cngxButtonToggleGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingTabindex,\n inputs: ['orientation'],\n },\n ],\n host: {\n class: 'cngx-button-toggle-group',\n role: 'radiogroup',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-button-toggle-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_BUTTON_TOGGLE_GROUP, useExisting: CngxButtonToggleGroup },\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxButtonToggleGroup },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxButtonToggleGroup },\n ],\n template: `<ng-content />`,\n styleUrls: ['./button-toggle-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxButtonToggleGroup<T = unknown>\n implements CngxButtonToggleGroupContract<T>, CngxControlValue<T | undefined>, CngxFormFieldControl\n{\n readonly value = model<T | undefined>(undefined);\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. When set, the\n * host emits `aria-errormessage=\"<id>\"`; consumers MUST render an\n * element with that id. Default `null` skips the attribute.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly label = input<string | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n private readonly roving = inject(CngxRovingTabindex, { host: true });\n\n consumePendingArrowSelect(value: T): boolean {\n if (!this.roving.consumeNavigationKey()) {\n return false;\n }\n if (this.disabled()) {\n return false;\n }\n this.value.set(value);\n return true;\n }\n\n readonly id = signal(nextUid('cngx-button-toggle-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no toggle is selected. */\n readonly empty = computed(() => this.value() === undefined);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import { InjectionToken, type ModelSignal, type Signal } from '@angular/core';\n\n/**\n * Multi-select parent contract every `CngxButtonMultiToggleGroup`\n * provides via `useExisting`. `CngxButtonToggle` leaves that detect\n * a multi-mode parent (via `inject(CNGX_BUTTON_MULTI_TOGGLE_GROUP, {\n * optional: true })`) bind `aria-selected` (toolbar APG) instead of\n * `aria-checked` (radiogroup APG) AT INJECTION TIME. Mode is static\n * per atom instance - there is no `[selectionMode]` flag.\n *\n * `selectedValues` is a `ModelSignal<T[]>` so the consumer can\n * two-way-bind via `[(selectedValues)]` and the leaves can mutate\n * it on toggle. `disabled` is a read-only `Signal<boolean>` the\n * leaf combines with its own per-toggle `disabled()`.\n *\n * `isSelected(value)` returns the per-value membership signal from\n * the group's internal `SelectionController` so the leaf can render\n * `aria-selected` reactively without re-querying the array on every\n * keystroke. The signal identity is stable per value (per\n * `createSelectionController` contract) - safe to read inside a\n * `computed()` on the leaf.\n *\n * `toggle(value)` is the single mutation entry-point the leaf calls\n * on Space / Enter / click. The group routes it through its\n * controller and writes `selectedValues` accordingly.\n *\n * @category common/interactive\n */\nexport interface CngxButtonMultiToggleGroupContract<T = unknown> {\n readonly selectedValues: ModelSignal<T[]>;\n readonly disabled: Signal<boolean>;\n isSelected(value: T): Signal<boolean>;\n toggle(value: T): void;\n}\n\n/**\n * DI token a `CngxButtonToggle` leaf injects to find its multi-mode\n * parent group. Always provided via\n * `{ provide: CNGX_BUTTON_MULTI_TOGGLE_GROUP, useExisting:\n * CngxButtonMultiToggleGroup }` - never via concrete-class injection\n * (per `reference_atomic_decompose` §4).\n *\n * The leaf injects this token with `{ optional: true }` alongside\n * `CNGX_BUTTON_TOGGLE_GROUP` (also optional). Exactly one parent\n * must be present; the leaf throws a dev-mode error otherwise.\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-multi-toggle-group.token.ts\n * @since 0.1.0\n */\nexport const CNGX_BUTTON_MULTI_TOGGLE_GROUP =\n new InjectionToken<CngxButtonMultiToggleGroupContract>('CngxButtonMultiToggleGroup');\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n DestroyRef,\n inject,\n input,\n model,\n signal,\n type Signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport {\n CNGX_SELECTION_CONTROLLER_FACTORY,\n nextUid,\n type CngxAsyncState,\n type SelectionController,\n} from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\nimport {\n CNGX_BUTTON_MULTI_TOGGLE_GROUP,\n type CngxButtonMultiToggleGroupContract,\n} from './button-multi-toggle-group.token';\n\n/**\n * Multi-select button-toggle group. Owns a `selectedValues =\n * model<T[]>([])` (the canonical multi-value source) and exposes the\n * parent contract via `CNGX_BUTTON_MULTI_TOGGLE_GROUP`.\n * Behaves as a W3C APG `toolbar` - arrow keys MOVE focus only (no auto-select);\n * Space and Enter on a focused leaf toggle that leaf's membership.\n *\n * Mode is **static**: this is the multi-select half of the\n * deliberate single/multi split (per\n * `feedback_select_family_split`). Consumers pick this component or\n * `<cngx-button-toggle-group>` at template authoring time. Leaves\n * (`CngxButtonToggle`) inject EITHER token with `{ optional: true }`\n * and choose `aria-checked` (single) vs `aria-selected` (multi)\n * AT INJECTION TIME, never at runtime.\n *\n * Internals lean on `createSelectionController` from\n * `@cngx/core/utils` for membership tracking - the controller's\n * stable per-value `isSelected` signals (memoised by key) let leaves\n * read membership inside their own `computed()` without triggering a\n * fresh array walk on every change-detection pass.\n *\n * `value` is a structural alias of `selectedValues` so the group\n * satisfies `CngxControlValue<T[]>` without owning two synchronised\n * models - both names point to the same `ModelSignal<T[]>` instance.\n *\n * ```html\n * <cngx-button-multi-toggle-group label=\"Filters\" [(selectedValues)]=\"filters\">\n * <button cngxButtonToggle value=\"open\">Open</button>\n * <button cngxButtonToggle value=\"closed\">Closed</button>\n * <button cngxButtonToggle value=\"archived\">Archived</button>\n * </cngx-button-multi-toggle-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-multi-toggle-group.component.ts\n * @selector cngx-button-multi-toggle-group\n * @since 0.1.0\n * @relatedTo CngxButtonToggle, CngxButtonToggleGroup\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/basic-multi-filter-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/disabled-group-cascade-vs-per-toggle</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-button-multi-toggle-group, [cngxButtonMultiToggleGroup]',\n exportAs: 'cngxButtonMultiToggleGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingTabindex,\n inputs: ['orientation'],\n },\n ],\n host: {\n class: 'cngx-button-multi-toggle-group',\n role: 'toolbar',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-button-multi-toggle-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n {\n provide: CNGX_BUTTON_MULTI_TOGGLE_GROUP,\n useExisting: CngxButtonMultiToggleGroup,\n },\n {\n provide: CNGX_CONTROL_VALUE,\n useExisting: CngxButtonMultiToggleGroup,\n },\n {\n provide: CNGX_FORM_FIELD_CONTROL,\n useExisting: CngxButtonMultiToggleGroup,\n },\n ],\n template: `<ng-content />`,\n styleUrls: ['./button-toggle-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxButtonMultiToggleGroup<T = unknown>\n implements CngxButtonMultiToggleGroupContract<T>, CngxControlValue<T[]>, CngxFormFieldControl\n{\n readonly selectedValues = model<T[]>([]);\n readonly value = this.selectedValues;\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. When set, the\n * host emits `aria-errormessage=\"<id>\"`; consumers MUST render an\n * element with that id. Default `null` skips the attribute.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly label = input<string | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n readonly keyFn = input<(value: T) => unknown>((v) => v);\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n private readonly controller: SelectionController<T> = inject(\n CNGX_SELECTION_CONTROLLER_FACTORY,\n )<T>(this.selectedValues, {\n keyFn: (v) => this.keyFn()(v),\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.controller.destroy());\n }\n\n isSelected(value: T): Signal<boolean> {\n return this.controller.isSelected(value);\n }\n\n toggle(value: T): void {\n if (this.disabled()) {\n return;\n }\n this.controller.toggle(value);\n }\n\n readonly id = signal(nextUid('cngx-button-multi-toggle-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no toggles are selected. */\n readonly empty = computed(() => this.selectedValues().length === 0);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import { Directive, computed, inject, input } from '@angular/core';\nimport { CngxRovingItem } from '@cngx/common/a11y';\n\nimport {\n CNGX_BUTTON_MULTI_TOGGLE_GROUP,\n type CngxButtonMultiToggleGroupContract,\n} from './button-multi-toggle-group.token';\nimport {\n CNGX_BUTTON_TOGGLE_GROUP,\n type CngxButtonToggleGroupContract,\n} from './button-toggle-group.token';\n\n/** @internal */\ninterface SingleResolution<T> {\n readonly mode: 'single';\n readonly group: CngxButtonToggleGroupContract<T>;\n}\n\n/** @internal */\ninterface MultiResolution<T> {\n readonly mode: 'multi';\n readonly group: CngxButtonMultiToggleGroupContract<T>;\n}\n\ntype ParentResolution<T> = SingleResolution<T> | MultiResolution<T>;\n\n/**\n * Button-toggle leaf. Restricted to `<button>` elements via the\n * `button[cngxButtonToggle]` selector so consumers cannot\n * accidentally apply the directive to a `<div>` and lose the\n * native button semantics (Space + Enter activation, focus ring,\n * disabled propagation to the form-submission engine).\n *\n * Injects EITHER `CNGX_BUTTON_TOGGLE_GROUP` (single, radiogroup) OR\n * `CNGX_BUTTON_MULTI_TOGGLE_GROUP` (multi, toolbar) - never the\n * concrete group class - both with `{ optional: true }`.\n *\n * Exactly one parent must be present; the constructor throws when both or\n * neither resolve. The resolved parent is stored as a discriminated\n * union (`{ mode: 'single' | 'multi'; group }`) so every downstream\n * branch narrows without non-null assertions.\n *\n * The present token determines:\n *\n * - the ARIA pattern (`aria-checked` for single, `aria-selected` for\n * multi), bound on the host AT INJECTION TIME,\n * - the activation contract (single: `group.value.set(...)`; multi:\n * `group.toggle(...)`),\n * - whether `(focus)` consumes the parent's pending arrow-select\n * flag (single only - multi follows toolbar APG, which does not\n * auto-select on arrow nav).\n *\n * Mode is **static** per atom instance.\n * There is no runtime `[selectionMode]` flag. Per `feedback_select_family_split`,\n * single + multi are two distinct groups reusing this leaf; the\n * decision is made by the consumer at template-authoring time.\n *\n * Composes `CngxRovingItem` as a host directive with input\n * forwarding (`'cngxRovingItemDisabled: disabled'`) so arrow-key\n * navigation in either parent group skips per-toggle-disabled leaves\n * automatically.\n *\n * **Group-disabled cascade vs roving.**\n * Thev group-level `[disabled]` cascade short-circuits `handleSelect` /\n * `handleKeydown` / `handleFocus` (see `toggleDisabled` computed),\n * but does NOT propagate into `CngxRovingItem.disabled`.\n * Angular forbids re-binding a host-directive's read-only `InputSignal`\n * input from a wrapping host. As a result, a fully-disabled group\n * lets visual focus transit through its toggles via Arrow keys;\n * every selection pathway short-circuits silently.\n * Re-evaluation is gated on `CngxRovingItem.disabled` becoming a\n * writable surface in `@cngx/common/a11y`.\n *\n * **Disabled \"why\" via aria-describedby.** Pillar 2 requires\n * disabled state to communicate a reason. The leaf exposes\n * `[describedBy]` (alias `cngxDescribedBy`).\n * A reactive input that binds to the host's `aria-describedby`. Consumers render the\n * description element themselves and pass its id; the directive does\n * not own a sr-only span (it is a `@Directive` on a native\n * `<button>` - no template to inject siblings into).\n * Native `<button aria-describedby>` semantics apply.\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-toggle.directive.ts\n * @selector button[cngxButtonToggle]\n * @since 0.1.0\n * @relatedTo CngxButtonToggleGroup, CngxButtonMultiToggleGroup, CngxRadio\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/basic-multi-filter-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/disabled-group-cascade-vs-per-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/basic-view-switcher</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/disabled-group-cascade-vs-per-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/vertical-orientation</example-url>\n */\n@Directive({\n selector: 'button[cngxButtonToggle]',\n exportAs: 'cngxButtonToggle',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxRovingItem,\n inputs: ['cngxRovingItemDisabled: disabled'],\n },\n ],\n host: {\n class: 'cngx-button-toggle',\n type: 'button',\n '[attr.aria-checked]': 'ariaChecked()',\n '[attr.aria-selected]': 'ariaSelected()',\n '[attr.aria-disabled]': 'toggleDisabled() ? \"true\" : null',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.disabled]': 'toggleDisabled() ? \"\" : null',\n '[class.cngx-button-toggle--checked]': 'toggleChecked()',\n '[class.cngx-button-toggle--disabled]': 'toggleDisabled()',\n '(focus)': 'handleFocus()',\n '(click)': 'handleSelect()',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n },\n})\nexport class CngxButtonToggle<T = unknown> {\n private readonly resolved: ParentResolution<T> = resolveParent<T>();\n\n readonly value = input.required<T>();\n readonly disabled = input<boolean>(false);\n readonly describedBy = input<string | null>(null, {\n alias: 'cngxDescribedBy',\n });\n\n protected readonly toggleChecked = computed(() => {\n if (this.resolved.mode === 'single') {\n return this.resolved.group.value() === this.value();\n }\n return this.resolved.group.isSelected(this.value())();\n });\n\n protected readonly toggleDisabled = computed(\n () => this.resolved.group.disabled() || this.disabled(),\n );\n\n protected readonly ariaChecked = computed(() =>\n this.resolved.mode === 'single' ? (this.toggleChecked() ? 'true' : 'false') : null,\n );\n\n protected readonly ariaSelected = computed(() =>\n this.resolved.mode === 'multi' ? (this.toggleChecked() ? 'true' : 'false') : null,\n );\n\n protected handleFocus(): void {\n if (this.toggleDisabled()) {\n return;\n }\n if (this.resolved.mode === 'single') {\n this.resolved.group.consumePendingArrowSelect(this.value());\n }\n }\n\n protected handleSelect(): void {\n if (this.toggleDisabled()) {\n return;\n }\n if (this.resolved.mode === 'single') {\n this.resolved.group.value.set(this.value());\n return;\n }\n this.resolved.group.toggle(this.value());\n }\n\n protected handleKeydown(event: Event): void {\n if (this.toggleDisabled()) {\n return;\n }\n event.preventDefault();\n if (this.resolved.mode === 'single') {\n this.resolved.group.value.set(this.value());\n return;\n }\n this.resolved.group.toggle(this.value());\n }\n}\n\nfunction resolveParent<T>(): ParentResolution<T> {\n const single = inject<CngxButtonToggleGroupContract<T>>(CNGX_BUTTON_TOGGLE_GROUP, {\n optional: true,\n });\n const multi = inject<CngxButtonMultiToggleGroupContract<T>>(CNGX_BUTTON_MULTI_TOGGLE_GROUP, {\n optional: true,\n });\n if (single && multi) {\n throw new Error(\n 'CngxButtonToggle: both CngxButtonToggleGroup and ' +\n 'CngxButtonMultiToggleGroup parents are present in the injector ' +\n 'tree. Exactly one is required - single + multi semantics are ' +\n 'incompatible.',\n );\n }\n if (single) {\n return { mode: 'single', group: single };\n }\n if (multi) {\n return { mode: 'multi', group: multi };\n }\n throw new Error(\n 'CngxButtonToggle requires a parent CngxButtonToggleGroup or ' +\n 'CngxButtonMultiToggleGroup to provide the value contract.',\n );\n}\n","import { InjectionToken, type ModelSignal, type Signal } from '@angular/core';\n\n/**\n * Structural surface a `CngxRadio` leaf exposes when it registers\n * itself with a parent `CngxRadioGroup`. The group keeps the\n * registry in DOM order so arrow-key navigation (driven by\n * `CngxRovingTabindex` host directive) and the\n * value-equality check (`group.value() === radio.value()`) both\n * have access to the leaf without injecting the concrete radio\n * class.\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.token.ts\n * @since 0.1.0\n */\nexport interface CngxRadioRegistration<T = unknown> {\n readonly id: string;\n readonly value: () => T | undefined;\n readonly disabled: () => boolean;\n}\n\n/**\n * Parent-child contract every `CngxRadioGroup` provides via\n * `useExisting`. `CngxRadio` injects this token (never the\n * concrete `CngxRadioGroup` class) so the leaf stays decompose-\n * ready and free of cyclic type dependencies.\n *\n * `value` is a `ModelSignal<T | undefined>` because the group's\n * canonical value is two-way-bindable from the consumer\n * (`[(value)]`) and writable by the leaf when the user picks a\n * radio (`group.value.set(radio.value())`). `disabled` is a\n * read-only `Signal<boolean>` projected from the group's own\n * `model<boolean>`; leaves combine it with their own per-radio\n * `disabled()` to compute `radioDisabled`. `name` is the HTML\n * `name` attribute applied to all radio inputs in this group -\n * defaults to a `nextUid('cngx-radio-group')` value when the\n * consumer does not supply one.\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.token.ts\n * @since 0.1.0\n */\nexport interface CngxRadioGroupContract<T = unknown> {\n readonly value: ModelSignal<T | undefined>;\n readonly disabled: Signal<boolean>;\n readonly name: Signal<string>;\n register(radio: CngxRadioRegistration<T>): void;\n unregister(id: string): void;\n /**\n * Consume the group's \"last interaction was a roving-arrow keydown\"\n * flag. Called by a leaf's `(focus)` handler - when the flag is\n * true, the leaf forwards its value to the group's `value` model\n * (W3C APG auto-select-on-arrow-nav semantics) and the flag is\n * cleared so a subsequent Tab-into focus does not double-select.\n * Returns whether the group actually consumed the flag, so the\n * leaf can short-circuit redundant work.\n */\n consumePendingArrowSelect(value: T): boolean;\n}\n\n/**\n * DI token a `CngxRadio` leaf injects to find its parent group.\n * Always provided via\n * `{ provide: CNGX_RADIO_GROUP, useExisting: CngxRadioGroup }`\n * - never via concrete-class injection (per\n * `reference_atomic_decompose` §4).\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.token.ts\n * @since 0.1.0\n */\nexport const CNGX_RADIO_GROUP = new InjectionToken<CngxRadioGroupContract>('CngxRadioGroup');\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid, type CngxAsyncState } from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\nimport {\n CNGX_RADIO_GROUP,\n type CngxRadioGroupContract,\n type CngxRadioRegistration,\n} from './radio-group.token';\n\n/**\n * Radio-group molecule that owns the canonical `value` for a set of\n * `CngxRadio` leaves and provides the parent contract via\n * `CNGX_RADIO_GROUP`. The group composes `CngxRovingTabindex` as a\n * host directive (with `inputs: ['orientation']` exposed) so arrow-\n * key navigation across radios is wired from day one. Leaf\n * registration is imperative - `register()` / `unregister()` keep a\n * Map in declaration order so the group can resolve the active\n * radio by id without re-querying content children on every change\n * detection cycle.\n *\n * Per W3C ARIA radio-group authoring practice, `Tab` enters the\n * group; arrow keys move focus AND select (auto-select variant);\n * Space/Enter also select the currently-focused radio. The group's\n * `value` is the source of truth; each leaf computes\n * `radioChecked = computed(() => group.value() === radio.value())`\n * against its own `value` input.\n *\n * **Auto-select wiring (no signal-write-in-effect).** Per the\n * pillar §6 hard rule, the group does NOT subscribe to\n * `CngxRovingTabindex.activeIndex` via an effect that writes\n * `value`. Instead, the host `CngxRovingTabindex` raises its\n * navigation-key intent before it moves focus; the newly-focused\n * leaf's `(focus)` handler calls\n * `group.consumePendingArrowSelect(this.value())`, which reads\n * `roving.consumeNavigationKey()` and writes `value` (a signal write\n * inside a DOM event handler, not an effect - legal under the pillar\n * rules). Reading an already-set fact instead of a group-owned\n * `(keydown)` flag closes the one-press-behind race (#135).\n * Tab-into-group fires focus without a preceding navigation key, so\n * the hook reads false and no auto-select happens - Tab leaves the\n * consumer's `value` untouched.\n *\n * ```html\n * <cngx-radio-group [(value)]=\"payment\" name=\"payment-method\">\n * <cngx-radio value=\"card\">Card</cngx-radio>\n * <cngx-radio value=\"cash\">Cash</cngx-radio>\n * <cngx-radio value=\"invoice\" disabled>Invoice</cngx-radio>\n * </cngx-radio-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.component.ts\n * @selector cngx-radio-group\n * @since 0.1.0\n * @relatedTo CngxRadio, CngxButtonToggleGroup, CngxChipGroup\n * <example-url>http://localhost:4200/#/common/interactive/radio/basic-vertical-group</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/custom-dot-glyph</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/disabled-group-cascades-per-radio-overrides</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/orientation-horizontal</example-url>\n */\n@Component({\n selector: 'cngx-radio-group, [cngxRadioGroup]',\n exportAs: 'cngxRadioGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [CngxRovingTabindex],\n host: {\n class: 'cngx-radio-group',\n role: 'radiogroup',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-radio-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_RADIO_GROUP, useExisting: CngxRadioGroup },\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxRadioGroup },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxRadioGroup },\n ],\n template: `<ng-content />`,\n styleUrls: ['./radio-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxRadioGroup<T = unknown>\n implements CngxRadioGroupContract<T>, CngxControlValue<T | undefined>, CngxFormFieldControl\n{\n readonly value = model<T | undefined>(undefined);\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. When set, the\n * host emits `aria-errormessage=\"<id>\"`; consumers MUST render an\n * element with that id. Default `null` skips the attribute.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n readonly label = input<string | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n readonly nameInput = input<string | undefined>(undefined, { alias: 'name' });\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n private readonly fallbackName = nextUid('cngx-radio-group');\n\n readonly name = computed(() => this.nameInput() ?? this.fallbackName);\n\n private readonly registry = new Map<string, CngxRadioRegistration<T>>();\n private readonly roving = inject(CngxRovingTabindex, { host: true });\n\n readonly id = signal(nextUid('cngx-radio-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no radio is selected. */\n readonly empty = computed(() => this.value() === undefined);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly aggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.aggregator?.shouldShow() ?? false,\n );\n\n constructor() {\n /* Per WAI-ARIA APG Radio Group, all four arrow keys navigate\n regardless of the cosmetic group layout - the consumer-set\n `orientation` controls aria-orientation + the visual flex\n direction only, never the keyboard axis. Force the host\n roving directive to `'both'` so a vertical group still\n responds to ArrowLeft / ArrowRight and vice versa. */\n this.roving.orientation.set('both');\n }\n\n register(radio: CngxRadioRegistration<T>): void {\n this.registry.set(radio.id, radio);\n }\n\n unregister(id: string): void {\n this.registry.delete(id);\n }\n\n consumePendingArrowSelect(value: T): boolean {\n if (!this.roving.consumeNavigationKey()) {\n return false;\n }\n if (this.disabled()) {\n return false;\n }\n this.value.set(value);\n return true;\n }\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n DestroyRef,\n inject,\n input,\n model,\n type TemplateRef,\n} from '@angular/core';\nimport { CngxRovingItem } from '@cngx/common/a11y';\nimport { CngxRadioIndicator } from '@cngx/common/display';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_RADIO_GROUP, type CngxRadioGroupContract } from './radio-group.token';\n\n/**\n * Single radio leaf. Injects the parent group via `CNGX_RADIO_GROUP`\n * (token, never the concrete `CngxRadioGroup` class) and writes\n * `group.value.set(this.value())` when the user picks it. The leaf\n * does not own a value of its own - `value` is a required `input<T>`\n * supplied by the consumer; checked-ness is derived from\n * `group.value() === this.value()`.\n *\n * Composes `CngxRovingItem` as a host directive with input\n * forwarding (`'cngxRovingItemDisabled: disabled'`) so the\n * consumer's `[disabled]` binding flows into both the radio's\n * own `disabled` model AND the roving directive's skip-test -\n * arrow-key navigation in the parent group (driven by\n * `CngxRovingTabindex`) skips per-radio-disabled leaves\n * automatically. Group-level `[disabled]` is a separate cascade\n * via `radioDisabled = computed(() => group.disabled() ||\n * disabled())`; it blocks click + Space/Enter + auto-select\n * (`consumePendingArrowSelect` returns false when the group is\n * disabled) but is NOT forwarded to roving - a fully-disabled\n * group lets focus transit visually while every selection\n * pathway short-circuits.\n *\n * Selection on click, Space, or Enter (auto-select also fires\n * on arrow nav via `consumePendingArrowSelect`); Tab and\n * programmatic focus do not select on focus alone (W3C APG\n * variant - the parent group's keyboard contract makes this\n * explicit).\n *\n * The `[attr.name]` host binding is **cosmetic** (parity with\n * native `<input type=\"radio\" name=\"…\">` markup expectations);\n * the `<div role=\"radio\">` host does not participate in HTML\n * form submission, so the attribute carries no functional\n * weight.\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio.component.ts\n * @selector cngx-radio\n * @since 0.1.0\n * @relatedTo CngxRadioGroup, CngxButtonToggle, CngxChipInGroup\n * <example-url>http://localhost:4200/#/common/interactive/radio/basic-vertical-group</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/custom-dot-glyph</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/disabled-group-cascades-per-radio-overrides</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/radio/orientation-horizontal</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-radio, [cngxRadio]',\n exportAs: 'cngxRadio',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingItem,\n inputs: ['cngxRovingItemDisabled: disabled'],\n },\n ],\n imports: [CngxRadioIndicator],\n host: {\n class: 'cngx-radio',\n role: 'radio',\n '[attr.aria-checked]': 'radioChecked() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'radioDisabled() ? \"true\" : null',\n '[attr.aria-describedby]': 'describedById()',\n '[attr.name]': 'group.name()',\n '[class.cngx-radio--checked]': 'radioChecked()',\n '[class.cngx-radio--disabled]': 'radioDisabled()',\n '(focus)': 'handleFocus()',\n '(click)': 'handleSelect()',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n },\n template: `\n <cngx-radio-indicator\n [checked]=\"radioChecked()\"\n [disabled]=\"radioDisabled()\"\n [dotGlyph]=\"dotGlyph()\"\n />\n <span class=\"cngx-radio__label\">\n <ng-content />\n </span>\n <span\n [id]=\"describedId\"\n class=\"cngx-radio__sr-only\"\n [attr.aria-hidden]=\"disabledReason() ? null : 'true'\"\n >{{ disabledReason() }}</span\n >\n `,\n styleUrls: ['./radio.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxRadio<T = unknown> {\n protected readonly group = inject<CngxRadioGroupContract<T>>(CNGX_RADIO_GROUP);\n\n readonly value = input.required<T>();\n readonly disabled = model<boolean>(false);\n readonly disabledReason = input<string>('');\n readonly dotGlyph = input<TemplateRef<void> | null>(null);\n\n private readonly id = nextUid('cngx-radio');\n protected readonly describedId = nextUid('cngx-radio-desc');\n\n protected readonly radioChecked = computed(() => this.group.value() === this.value());\n\n protected readonly radioDisabled = computed(() => this.group.disabled() || this.disabled());\n\n protected readonly describedById = computed(() =>\n this.disabledReason() ? this.describedId : null,\n );\n\n constructor() {\n this.group.register({\n id: this.id,\n value: () => this.value(),\n disabled: () => this.radioDisabled(),\n });\n inject(DestroyRef).onDestroy(() => this.group.unregister(this.id));\n }\n\n protected handleFocus(): void {\n if (this.radioDisabled()) {\n return;\n }\n this.group.consumePendingArrowSelect(this.value());\n }\n\n protected handleSelect(): void {\n if (this.radioDisabled()) {\n return;\n }\n this.group.value.set(this.value());\n }\n\n protected handleKeydown(event: Event): void {\n if (this.radioDisabled()) {\n return;\n }\n event.preventDefault();\n this.group.value.set(this.value());\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Parent contract every chip-group molecule (`CngxChipGroup` single,\n * `CngxMultiChipGroup` multi) provides via `useExisting`.\n * `CngxChipInGroup` leaves inject this token (NOT optional) - never\n * the concrete group class - so the leaf stays decompose-ready and\n * free of cyclic type dependencies, and the Phase 5 split between\n * single + multi groups can share the same leaf implementation.\n *\n * Selection state is queried via `isSelected(value)` and mutated via\n * `toggle(value)` / `remove(value)`. `isDisabled` is a\n * `Signal<boolean>` so the leaf's reactive `aria-disabled` and the\n * disabled-cascade derivation track it without re-injection. Per\n * `reference_atomic_decompose` §4 - leaf communicates with its\n * parent via DI token, never via concrete parent-class injection.\n *\n * Mode (single vs multi) is intentionally NOT exposed on this\n * contract: the leaf does not branch behaviour on mode, and no\n * consumer / bridge surface in scope reads it. A future feature\n * that needs mode discovery can extend the interface then; until\n * then the field stays out of the public surface.\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-group/chip-group-host.token.ts\n * @since 0.1.0\n */\nexport interface CngxChipGroupHost<T = unknown> {\n isSelected(value: T): boolean;\n toggle(value: T): void;\n remove(value: T): void;\n readonly isDisabled: Signal<boolean>;\n}\n\n/**\n * DI token a `CngxChipInGroup` leaf injects to find its parent chip\n * group. Always provided via\n * `{ provide: CNGX_CHIP_GROUP_HOST, useExisting: <Self> }` - never\n * via concrete-class injection. Required (NOT optional) on the leaf\n * side: a leaf without a parent throws `NullInjectorError` at\n * construction (fail-fast - silent dual-source-of-truth would be\n * worse).\n *\n * Standalone chips outside any group use `[cngxChipInteraction]`\n * instead, which provides `CNGX_CONTROL_VALUE` directly without ever\n * touching this token.\n *\n * @category common/interactive\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-group/chip-group-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_CHIP_GROUP_HOST = new InjectionToken<CngxChipGroupHost>('CngxChipGroupHost');\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n isDevMode,\n model,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_CHIP_GROUP_HOST } from '../chip-group/chip-group-host.token';\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Standalone interactive chip - applies onto `<cngx-chip>` from\n * `@cngx/common/display` and wires `role=\"option\"` selection\n * semantics with a local-owned form-bound boolean. Provides\n * `CNGX_CONTROL_VALUE` so `CngxFormBridge` (Phase 7) can adapt it\n * to Reactive Forms and `<cngx-form-field [field]>` paths can drive\n * it through Signal Forms.\n *\n * **Use this when** the chip stands alone (e.g. a removable filter\n * tag, a single suggestion chip outside any chip-group). For chips\n * inside a `<cngx-chip-group>` / `<cngx-multi-chip-group>`, use\n * `[cngxChipInGroup]` instead - that variant derives `selected`\n * from the parent's selection controller as a `computed()`,\n * eliminating the dual-source-of-truth a local model would create.\n * A dev-mode guard (via `afterNextRender`) throws if a standalone\n * chip is mistakenly nested inside a group.\n *\n * **Naming note.** The `CngxControlValue<boolean>` contract requires\n * a `value: ModelSignal<boolean>` field; the plan's API surface\n * uses `[(selected)]` for the form state and `[value]` for the\n * chip's payload. Double aliasing reconciles both: the form-bound\n * `value` field is aliased to template binding `[(selected)]`, and\n * the payload `chipValue` field is aliased to template binding\n * `[value]`. Consumers write\n * `<cngx-chip cngxChipInteraction [value]=\"x\" [(selected)]=\"b\">`\n * unchanged.\n *\n * **A11y.** `role=\"option\"` + reactive `aria-selected`,\n * `aria-disabled`, and `tabindex` (-1 when disabled, 0 otherwise).\n * Click + Space + Enter toggle. Backspace + Delete fire\n * `removeRequest` - an output, NOT a state mutation. The consumer\n * decides whether removing the chip means dropping it from a list,\n * deselecting, or something else.\n *\n * **Close-button click guard.** The display chip's own\n * `<button class=\"cngx-chip__remove\">` is a child of the host; its\n * click event bubbles. `handleClick` short-circuits when the click\n * originates from inside that button so the chip's own `(click)`\n * toggle does not double-fire alongside the chip's `(remove)`\n * output.\n *\n * **Disabled \"why\".** When `disabledReason` is set, the directive\n * appends a hidden span to the host via `Renderer2` (always-in-DOM\n * per Pillar 2 - the id stays stable across renders). When\n * `disabledReason` is empty, consumers may still pass a custom id\n * via `cngxDescribedBy` and the `aria-describedby` host binding\n * routes to that. The two paths are mutually exclusive: a non-empty\n * `disabledReason` wins.\n *\n * ```html\n * <cngx-chip cngxChipInteraction [value]=\"'red'\" [(selected)]=\"redOn\">\n * Red\n * </cngx-chip>\n *\n * <span id=\"chip-locked-reason\" hidden>Tag is locked by your role</span>\n * <cngx-chip\n * cngxChipInteraction\n * [value]=\"tag\"\n * [(selected)]=\"picked\"\n * [removable]=\"true\"\n * (removeRequest)=\"onRemoveTag(tag)\"\n * [disabled]=\"locked()\"\n * cngxDescribedBy=\"chip-locked-reason\"\n * >{{ tag }}</cngx-chip>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-interaction/chip-interaction.directive.ts\n * @since 0.1.0\n * @relatedTo CngxChipInGroup, CngxChipGroup, CngxMultiChipGroup, CngxChipInput\n * <example-url>http://localhost:4200/#/common/interactive/chip/interaction/basic-toggle-on-click-space-or-enter</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/chip/interaction/disabled-state</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/chip/interaction/removable-with-removerequest-on-backspace-delete</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Directive({\n selector: '[cngxChipInteraction]',\n exportAs: 'cngxChipInteraction',\n standalone: true,\n host: {\n class: 'cngx-chip-interaction',\n role: 'option',\n '[attr.id]': 'id()',\n '[attr.aria-selected]': 'value() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-describedby]': 'resolvedDescribedBy()',\n '[attr.tabindex]': 'disabled() ? -1 : 0',\n '[class.cngx-chip-interaction--selected]': 'value()',\n '[class.cngx-chip-interaction--disabled]': 'disabled()',\n '(click)': 'handleClick($event)',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n '(keydown.delete)': 'handleRemoveKeydown($event)',\n '(keydown.backspace)': 'handleRemoveKeydown($event)',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxChipInteraction },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxChipInteraction },\n ],\n})\nexport class CngxChipInteraction<T = unknown>\n implements CngxControlValue<boolean>, CngxFormFieldControl\n{\n /**\n * Chip payload - required identifier the consumer associates with\n * this chip (e.g. a tag string, filter id, entity reference). The\n * directive does not inspect or compare it; it is forwarded to\n * `(removeRequest)` listeners and visible in the DOM via the\n * consumer's own bindings. Aliased so consumers write `[value]=\"x\"`\n * - see naming note in the class JSDoc.\n */\n readonly chipValue = input.required<T>({ alias: 'value' });\n\n /**\n * Form-bound selection state. Aliased so consumers write\n * `[(selected)]=\"b\"`; the field name is `value` to satisfy the\n * `CngxControlValue<boolean>` contract used by `CngxFormBridge`\n * (Phase 7). See class JSDoc.\n */\n readonly value = model<boolean>(false, { alias: 'selected' });\n\n readonly disabled = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element (e.g. a sibling\n * rendered by `<cngx-form-field>` or a consumer-owned `<span>`).\n * When set, the host emits `aria-errormessage=\"<id>\"` so AT can\n * locate the message; consumers MUST render an element with that id\n * - passing an id without a matching element produces a dangling\n * AT reference. Default `null` skips the attribute entirely.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly disabledReason = input<string>('');\n\n /**\n * Optional consumer-supplied id of an external description element\n * (e.g. a sibling sr-only `<span>`). Consumers bind via\n * `[cngxDescribedBy]=\"someId\"`. Field name `describedBy` matches\n * sibling atoms (`CngxChipInGroup`, `CngxButtonToggle`); the alias\n * preserves the consumer-facing template attribute. Resolved into\n * `aria-describedby` via `resolvedDescribedBy`, which prefers the\n * internal disabled-reason id when `disabledReason` is set.\n */\n readonly describedBy = input<string | null>(null, {\n alias: 'cngxDescribedBy',\n });\n\n /** Fires on Backspace/Delete keydown - consumer owns the removal. */\n readonly removeRequest = output<void>();\n\n private readonly describedId = nextUid('cngx-chip-desc');\n\n protected readonly resolvedDescribedBy = computed<string | null>(() => {\n if (this.disabledReason()) {\n return this.describedId;\n }\n return this.describedBy();\n });\n\n readonly id = signal(nextUid('cngx-chip-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when the chip is unselected - boolean atom semantics. */\n readonly empty = computed(() => this.value() === false);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly errorAggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.errorAggregator?.shouldShow() ?? false,\n );\n\n constructor() {\n const hostEl = (inject(ElementRef) as ElementRef<HTMLElement>).nativeElement;\n const renderer = inject(Renderer2);\n const span = renderer.createElement('span') as HTMLSpanElement;\n renderer.setAttribute(span, 'id', this.describedId);\n renderer.setAttribute(span, 'aria-hidden', 'true');\n // sr-only via inline styles - directive runs in arbitrary markup, can't\n // require a consumer stylesheet. Every value reads `--cngx-sr-only-*`\n // first so consumers can still override (structural/thematic split).\n renderer.setStyle(span, 'position', 'var(--cngx-sr-only-position, absolute)');\n renderer.setStyle(span, 'width', 'var(--cngx-sr-only-size, 1px)');\n renderer.setStyle(span, 'height', 'var(--cngx-sr-only-size, 1px)');\n renderer.setStyle(span, 'overflow', 'var(--cngx-sr-only-overflow, hidden)');\n renderer.setStyle(span, 'clip', 'var(--cngx-sr-only-clip, rect(0, 0, 0, 0))');\n renderer.setStyle(span, 'white-space', 'var(--cngx-sr-only-white-space, nowrap)');\n renderer.appendChild(hostEl, span);\n\n // Host may outlive the directive (structural re-projection, sibling\n // clear) - without explicit removal the span leaks and the next\n // instance collides on `describedId`.\n inject(DestroyRef).onDestroy(() => {\n // Host may already be detached by a parent structural directive at\n // the same destroy tick; removeChild on a stale parent throws.\n if (span.parentNode === hostEl) {\n renderer.removeChild(hostEl, span);\n }\n });\n\n effect(() => {\n const reason = this.disabledReason();\n untracked(() => {\n if (reason) {\n renderer.removeAttribute(span, 'aria-hidden');\n span.textContent = reason;\n } else {\n renderer.setAttribute(span, 'aria-hidden', 'true');\n span.textContent = '';\n }\n });\n });\n\n if (!isDevMode()) {\n return;\n }\n const ancestor = inject(CNGX_CHIP_GROUP_HOST, {\n optional: true,\n skipSelf: true,\n });\n afterNextRender(() => {\n if (ancestor !== null) {\n throw new Error(\n 'CngxChipInteraction must NOT be used inside <cngx-chip-group> / <cngx-multi-chip-group>; use [cngxChipInGroup] instead.',\n );\n }\n });\n }\n\n protected handleClick(event: MouseEvent): void {\n if (this.disabled() || isCloseButtonClick(event)) {\n return;\n }\n this.value.update((v) => !v);\n }\n\n protected handleKeydown(event: Event): void {\n if (this.disabled()) {\n return;\n }\n event.preventDefault();\n this.value.update((v) => !v);\n }\n\n protected handleRemoveKeydown(event: Event): void {\n if (this.disabled()) {\n return;\n }\n event.preventDefault();\n this.removeRequest.emit();\n }\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n\n/** @internal */\nfunction isCloseButtonClick(event: Event): boolean {\n const target = event.target;\n if (!(target instanceof Element)) {\n return false;\n }\n return target.closest('.cngx-chip__remove') !== null;\n}\n","import { Directive, computed, inject, input } from '@angular/core';\nimport { CngxRovingItem } from '@cngx/common/a11y';\n\nimport { CNGX_CHIP_GROUP_HOST, type CngxChipGroupHost } from '../chip-group/chip-group-host.token';\n\n/**\n * In-group chip leaf - applies onto `<cngx-chip>` from\n * `@cngx/common/display` and wires `role=\"option\"` semantics that\n * defer all selection mutations to the surrounding chip-group via\n * `CNGX_CHIP_GROUP_HOST`. Required parent (NOT optional): a\n * `[cngxChipInGroup]` outside any group throws `NullInjectorError`\n * at construction. Standalone interactive chips use\n * `[cngxChipInteraction]` instead.\n *\n * **No local model.** `selected` is a `computed()` reading\n * `parent.isSelected(value())`; the chip never holds its own\n * selection state. This is the fix for the dual-source-of-truth\n * problem flagged in `cngx-plan-review` (form-primitives §1) - a\n * single value-flow per directive: the parent's selection\n * controller is canonical, the leaf is a pure projection of it.\n *\n * **Activation.** Click + Space + Enter call `parent.toggle(value())`.\n * Delete + Backspace call `parent.remove(value())`. Close-button\n * clicks bubbling from `<cngx-chip>`'s internal remove button are\n * filtered so the chip's `(click)` toggle does not double-fire\n * alongside the chip's own `(remove)` output.\n *\n * **Roving composition.** Composes `CngxRovingItem` as a host\n * directive with `disabled` forwarding so arrow-key navigation in\n * the parent (driven by `CngxRovingTabindex` on `<cngx-chip-group>`\n * / `<cngx-multi-chip-group>`) skips per-chip-disabled leaves\n * automatically. Same pattern as `CngxRadio` and `CngxButtonToggle`.\n *\n * **Group-disabled cascade vs roving (accepted debt §4).** The\n * group-level `[disabled]` cascade short-circuits `handleSelect` /\n * `handleRemove` (see `chipDisabled` computed), but does NOT\n * propagate into `CngxRovingItem.disabled` - Angular forbids\n * re-binding a host-directive's read-only `InputSignal`. As a\n * result, a fully-disabled group lets visual focus transit through\n * its chips via Arrow keys; every selection / remove pathway\n * short-circuits silently. Behaviour mirrors `CngxRadio` and\n * `CngxButtonToggle`; tracked in `form-primitives-accepted-debt §4`.\n * Re-evaluation is gated on `CngxRovingItem.disabled` becoming a\n * writable surface in `@cngx/common/a11y`.\n *\n * **Disabled \"why\".** No internal sr-only span - the directive\n * applies onto a projected `<cngx-chip>` and has no template.\n * Consumers wanting a reason announcement render the description\n * element themselves and pass its id via `[describedBy]`. Same\n * pattern as `CngxButtonToggle` / `CngxChipInteraction`.\n *\n * ```html\n * <cngx-chip-group [(selected)]=\"size\" label=\"Size\">\n * <cngx-chip cngxChipInGroup [value]=\"'sm'\">Small</cngx-chip>\n * <cngx-chip cngxChipInGroup [value]=\"'md'\">Medium</cngx-chip>\n * <cngx-chip cngxChipInGroup [value]=\"'lg'\">Large</cngx-chip>\n * </cngx-chip-group>\n *\n * <cngx-multi-chip-group [(selectedValues)]=\"tags\" label=\"Tags\">\n * @for (tag of tags(); track tag) {\n * <cngx-chip\n * cngxChipInGroup\n * [value]=\"tag\"\n * [removable]=\"true\"\n * >{{ tag }}</cngx-chip>\n * }\n * </cngx-multi-chip-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-in-group/chip-in-group.directive.ts\n * @since 0.1.0\n * @relatedTo CngxChipGroup, CngxMultiChipGroup, CngxChipInteraction\n * <example-url>http://localhost:4200/#/common/interactive/chip/group/basic-pick-exactly-one-size</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/chip/multi-group/multi-select-chips-with-selection-count</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Directive({\n selector: '[cngxChipInGroup]',\n exportAs: 'cngxChipInGroup',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxRovingItem,\n inputs: ['cngxRovingItemDisabled: disabled'],\n },\n ],\n host: {\n class: 'cngx-chip-in-group',\n role: 'option',\n '[attr.aria-selected]': 'selected() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'chipDisabled() ? \"true\" : null',\n '[attr.aria-describedby]': 'describedBy()',\n '[class.cngx-chip-in-group--selected]': 'selected()',\n '[class.cngx-chip-in-group--disabled]': 'chipDisabled()',\n '(click)': 'handleClick($event)',\n '(keydown.space)': 'handleKeydown($event)',\n '(keydown.enter)': 'handleKeydown($event)',\n '(keydown.delete)': 'handleRemove($event)',\n '(keydown.backspace)': 'handleRemove($event)',\n },\n})\nexport class CngxChipInGroup<T = unknown> {\n protected readonly parent = inject<CngxChipGroupHost<T>>(CNGX_CHIP_GROUP_HOST, { host: true });\n\n readonly value = input.required<T>();\n readonly disabled = input<boolean>(false);\n readonly describedBy = input<string | null>(null, {\n alias: 'cngxDescribedBy',\n });\n\n protected readonly selected = computed(() => this.parent.isSelected(this.value()));\n\n protected readonly chipDisabled = computed(() => this.parent.isDisabled() || this.disabled());\n\n protected handleClick(event: MouseEvent): void {\n if (this.chipDisabled() || isCloseButtonClick(event)) {\n return;\n }\n this.parent.toggle(this.value());\n }\n\n protected handleKeydown(event: Event): void {\n if (this.chipDisabled()) {\n return;\n }\n event.preventDefault();\n this.parent.toggle(this.value());\n }\n\n protected handleRemove(event: Event): void {\n if (this.chipDisabled()) {\n return;\n }\n event.preventDefault();\n this.parent.remove(this.value());\n }\n}\n\n/** @internal */\nfunction isCloseButtonClick(event: Event): boolean {\n const target = event.target;\n if (!(target instanceof Element)) {\n return false;\n }\n return target.closest('.cngx-chip__remove') !== null;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport { nextUid, type CngxAsyncState } from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\nimport { CNGX_CHIP_GROUP_HOST, type CngxChipGroupHost } from './chip-group-host.token';\n\n/**\n * Single-select chip group. Owns a `selected = model<T | undefined>`\n * (the canonical single-value source) and exposes the parent contract\n * via `CNGX_CHIP_GROUP_HOST`. Behaves as a `role=\"listbox\"` with\n * `CngxRovingTabindex`-driven keyboard navigation; consumers project\n * `<cngx-chip cngxChipInGroup>` children that derive their own\n * `aria-selected` from this group's `isSelected(value)`.\n *\n * Mode is **static** per `feedback_select_family_split`: this is the\n * single-select half of a deliberate split. Consumers pick\n * `<cngx-chip-group>` for single-pick semantics or\n * `<cngx-multi-chip-group>` for multi-pick semantics - never a\n * runtime `[selectionMode]` flag.\n *\n * `value` is a structural alias of `selected` so the group satisfies\n * `CngxControlValue<T | undefined>` without owning two synchronised\n * models - both names point to the same `ModelSignal<T | undefined>`\n * instance. Mirrors `CngxCheckboxGroup`'s `selectedValues` / `value`\n * pairing.\n *\n * `[state]` accepts `CngxAsyncState<unknown>` for async-loaded chip\n * lists; reactively drives `aria-busy` so AT announces the busy\n * moment without consumer wiring. Slot directives for\n * skeleton/empty/error are deferred - the harmonized Phase 3-4 group\n * surface ships only the `aria-busy` projection of `[state]`, and\n * chip-group follows that precedent for cross-family consistency\n * (plan deviation 2026-05-01: skeleton/empty/error slot directives\n * declared in the plan body are dropped at execute time pending a\n * cross-family harmonization pass).\n *\n * Per Pillar 1 (Ableitung statt Verwaltung), `aria-busy` is a\n * `computed()` from `state.status()` - never a manual write. Per\n * Pillar 3 (Komposition statt Konfiguration), the group composes\n * `CngxRovingTabindex` and emits no implicit children - consumers\n * project chip rows themselves.\n *\n * ```html\n * <cngx-chip-group label=\"Size\" [(selected)]=\"size\">\n * <cngx-chip cngxChipInGroup [value]=\"'sm'\">Small</cngx-chip>\n * <cngx-chip cngxChipInGroup [value]=\"'md'\">Medium</cngx-chip>\n * <cngx-chip cngxChipInGroup [value]=\"'lg'\">Large</cngx-chip>\n * </cngx-chip-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-group/chip-group.component.ts\n * @selector cngx-chip-group\n * @since 0.1.0\n * @relatedTo CngxMultiChipGroup, CngxChipInGroup, CngxChipInteraction, CngxRadioGroup\n * <example-url>http://localhost:4200/#/common/interactive/chip/group/basic-pick-exactly-one-size</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-chip-group, [cngxChipGroup]',\n exportAs: 'cngxChipGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingTabindex,\n inputs: ['orientation'],\n },\n ],\n host: {\n class: 'cngx-chip-group',\n role: 'listbox',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-chip-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CHIP_GROUP_HOST, useExisting: CngxChipGroup },\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxChipGroup },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxChipGroup },\n ],\n template: `<ng-content />`,\n styleUrls: ['./chip-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxChipGroup<T = unknown>\n implements CngxControlValue<T | undefined>, CngxChipGroupHost<T>, CngxFormFieldControl\n{\n readonly selected = model<T | undefined>(undefined);\n readonly value = this.selected;\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. When set, the\n * host emits `aria-errormessage=\"<id>\"`; consumers MUST render an\n * element with that id. Default `null` skips the attribute.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly label = input<string | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /** CngxChipGroupHost - leaf-side cascade source. */\n readonly isDisabled = this.disabled;\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n isSelected(value: T): boolean {\n return Object.is(this.selected(), value);\n }\n\n toggle(value: T): void {\n if (this.disabled()) {\n return;\n }\n if (this.isSelected(value)) {\n this.selected.set(undefined);\n return;\n }\n this.selected.set(value);\n }\n\n remove(value: T): void {\n if (this.disabled()) {\n return;\n }\n if (this.isSelected(value)) {\n this.selected.set(undefined);\n }\n }\n\n readonly id = signal(nextUid('cngx-chip-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no chip is selected. */\n readonly empty = computed(() => this.selected() === undefined);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly errorAggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.errorAggregator?.shouldShow() ?? false,\n );\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n DestroyRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { CngxRovingTabindex } from '@cngx/common/a11y';\nimport {\n CNGX_FORM_FIELD_CONTROL,\n CNGX_FORM_FIELD_HOST,\n type CngxFormFieldControl,\n} from '@cngx/core/tokens';\nimport {\n CNGX_SELECTION_CONTROLLER_FACTORY,\n nextUid,\n type CngxAsyncState,\n type SelectionController,\n} from '@cngx/core/utils';\n\nimport { CNGX_CONTROL_VALUE, type CngxControlValue } from '../control-value/control-value.token';\nimport { CNGX_CHIP_GROUP_HOST, type CngxChipGroupHost } from '../chip-group/chip-group-host.token';\nimport { CNGX_ERROR_AGGREGATOR } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Multi-select chip group. Owns a `selectedValues = model<T[]>([])`\n * (the canonical multi-value source) and exposes the parent contract\n * via `CNGX_CHIP_GROUP_HOST`. Behaves as a `role=\"listbox\"\n * aria-multiselectable=\"true\"` with `CngxRovingTabindex`-driven\n * keyboard navigation; consumers project `<cngx-chip cngxChipInGroup>`\n * children that derive their own `aria-selected` from this group's\n * `isSelected(value)`.\n *\n * Mode is **static** per `feedback_select_family_split`: this is the\n * multi-select half of the chip-group split.\n *\n * Internals lean on `createSelectionController` from `@cngx/core/utils`\n * for membership tracking - the controller's structural-equality\n * `selected` snapshot prevents downstream computed cascades from\n * thrashing when a re-emission produces the same logical contents\n * with a different array reference. Mirrors `CngxCheckboxGroup`'s\n * controller wiring.\n *\n * `value` is a structural alias of `selectedValues` so the group\n * satisfies `CngxControlValue<T[]>` without owning two synchronised\n * models - both names point to the same `ModelSignal<T[]>` instance.\n *\n * `[keyFn]` lets consumers with object-typed values map each value\n * to a stable membership key (typically `(v) => v.id`). Without it,\n * membership uses identity / primitive equality.\n *\n * `[state]` accepts `CngxAsyncState<unknown>` for async-loaded chip\n * lists; reactively drives `aria-busy`. Slot directives for\n * skeleton/empty/error are deferred - the harmonized Phase 3-4 group\n * surface ships only the `aria-busy` projection of `[state]`, and\n * chip-group follows that precedent for cross-family consistency\n * (plan deviation 2026-05-01: see `CngxChipGroup` JSDoc).\n *\n * **Roving strategy (accepted-debt §5).** This molecule uses\n * `CngxRovingTabindex` (per the harmonized Phase 3-4 group precedent),\n * NOT `createChipStripRoving`. The strip-roving controller would solve\n * clamp-on-removal automatically but its tabindex contract requires\n * the parent to bind `[attr.tabindex]` per chip wrapper at the\n * template level - which a content-projected `CngxChipInGroup` leaf\n * model does not allow. Tracked in `form-primitives-accepted-debt §5`;\n * UX consequence is a one-shot focus reset to index 0 after\n * mid-strip removal, instead of clamping to the next valid sibling.\n *\n * **Removal flow (plan deviation).** Plan revision claimed\n * `createChipRemovalHandler` from `@cngx/forms/select` would drive\n * the remove path. That import is a layer violation\n * (`@cngx/common/interactive` is Level 2; `@cngx/forms/select` is\n * Level 3). Removal here is a thin `controller.deselect(value)` -\n * the WeakMap-closure-cache machinery in the select-family handler\n * targets `ngTemplateOutlet` chip-slot stability, which content-\n * projected chip-in-group leaves do not exhibit.\n *\n * Per Pillar 1 (Ableitung statt Verwaltung), `aria-busy` is a\n * `computed()` from `state.status()`. Per Pillar 3 (Komposition\n * statt Konfiguration), the group composes `CngxRovingTabindex` and\n * emits no implicit children - consumers project chip rows themselves.\n *\n * ```html\n * <cngx-multi-chip-group label=\"Tags\" [(selectedValues)]=\"tags\">\n * @for (tag of options(); track tag) {\n * <cngx-chip cngxChipInGroup [value]=\"tag\">{{ tag }}</cngx-chip>\n * }\n * </cngx-multi-chip-group>\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/multi-chip-group/multi-chip-group.component.ts\n * @selector cngx-multi-chip-group\n * @since 0.1.0\n * @relatedTo CngxChipGroup, CngxChipInGroup, CngxChipInput, CngxChipInteraction\n * <example-url>http://localhost:4200/#/common/interactive/chip/multi-group/multi-select-chips-with-selection-count</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>\n */\n@Component({\n selector: 'cngx-multi-chip-group, [cngxMultiChipGroup]',\n exportAs: 'cngxMultiChipGroup',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CngxRovingTabindex,\n inputs: ['orientation'],\n },\n ],\n host: {\n class: 'cngx-multi-chip-group',\n role: 'listbox',\n 'aria-multiselectable': 'true',\n '[attr.id]': 'id()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': '(invalid() || errorState()) ? \"true\" : null',\n '[attr.aria-errormessage]': 'errorMessageId()',\n '[attr.aria-busy]': 'ariaBusy() ? \"true\" : null',\n '[class.cngx-multi-chip-group--horizontal]': 'orientation() === \"horizontal\"',\n '(focusin)': 'handleFocusIn()',\n '(focusout)': 'handleFocusOut()',\n },\n providers: [\n { provide: CNGX_CHIP_GROUP_HOST, useExisting: CngxMultiChipGroup },\n { provide: CNGX_CONTROL_VALUE, useExisting: CngxMultiChipGroup },\n { provide: CNGX_FORM_FIELD_CONTROL, useExisting: CngxMultiChipGroup },\n ],\n template: `<ng-content />`,\n styleUrls: ['./multi-chip-group.component.css'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class CngxMultiChipGroup<T = unknown>\n implements CngxControlValue<T[]>, CngxChipGroupHost<T>, CngxFormFieldControl\n{\n readonly selectedValues = model<T[]>([]);\n readonly value = this.selectedValues;\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n /**\n * Bridge-writable invalid state. `model<boolean>` mirrors `disabled`\n * so external integrations (RF/Signal-Forms bridges, custom validity\n * adapters) can drive it without a parallel API path - consumers\n * typically read only.\n */\n readonly invalid = model<boolean>(false);\n /**\n * Optional id of an external error message element. When set, the\n * host emits `aria-errormessage=\"<id>\"`; consumers MUST render an\n * element with that id. Default `null` skips the attribute.\n * Note: WAI-ARIA dictates that AT ignores this attribute when\n * `aria-invalid` is absent or `\"false\"`, so a stable always-emitted\n * id is harmless when the field is valid.\n */\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly label = input<string | undefined>(undefined);\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n readonly keyFn = input<(value: T) => unknown>((v) => v);\n\n /** CngxChipGroupHost - leaf-side cascade source. */\n readonly isDisabled = this.disabled;\n\n private readonly controller: SelectionController<T> = inject(\n CNGX_SELECTION_CONTROLLER_FACTORY,\n )<T>(this.selectedValues, {\n keyFn: (v) => this.keyFn()(v),\n });\n\n protected readonly ariaBusy = computed(() => this.state()?.status() === 'loading');\n\n /** Public membership count - useful for label hints + announcements. */\n readonly selectedCount = this.controller.selectedCount;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.controller.destroy());\n }\n\n isSelected(value: T): boolean {\n return this.controller.isSelected(value)();\n }\n\n toggle(value: T): void {\n if (this.disabled()) {\n return;\n }\n this.controller.toggle(value);\n }\n\n remove(value: T): void {\n if (this.disabled()) {\n return;\n }\n this.controller.deselect(value);\n }\n\n readonly id = signal(nextUid('cngx-multi-chip-group-')).asReadonly();\n\n private readonly focusedState = signal(false);\n readonly focused = this.focusedState.asReadonly();\n\n /** Empty when no chips are selected. */\n readonly empty = computed(() => this.selectedValues().length === 0);\n\n private readonly fieldHost = inject(CNGX_FORM_FIELD_HOST, { optional: true });\n private readonly errorAggregator = inject(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n skipSelf: true,\n });\n\n readonly errorState = computed<boolean>(\n () => this.fieldHost?.showError() ?? this.errorAggregator?.shouldShow() ?? false,\n );\n\n protected handleFocusIn(): void {\n this.focusedState.set(true);\n }\n\n protected handleFocusOut(): void {\n this.focusedState.set(false);\n this.fieldHost?.markAsTouched();\n }\n}\n","import { Directive, ElementRef, computed, inject, input, output, signal } from '@angular/core';\nimport {\n buildAsyncStateView,\n CNGX_STATEFUL,\n type AsyncStatus,\n type CngxAsyncState,\n type CngxStateful,\n} from '@cngx/core/utils';\nimport { firstValueFrom, isObservable, type Observable } from 'rxjs';\n\n/**\n * Tokenizing input that turns user-entered strings into emitted\n * `tokenCreated` events on separator keys (default: comma + Enter)\n * and on multi-token paste. Pairs naturally with\n * `<cngx-multi-chip-group>` or any consumer-managed chip list.\n *\n * **Validation slot - async-state producer.** The directive provides\n * `CNGX_STATEFUL` via `useExisting`, exposing a\n * `ManualAsyncState<string>` slot driven by `[validateToken]`\n * invocations. Bridge directives (`<cngx-toast-on />`,\n * `<cngx-banner-on />`) auto-discover this slot through the\n * `CNGX_STATEFUL` token without an explicit `[state]` input wiring.\n *\n * State machine: `idle → pending → success | error` per separator-key\n * invocation. Concurrent validations supersede via a monotonic\n * `validationId` - when a second token is entered before the first\n * resolves, the first's resolution is dropped and only the latest\n * outcome touches the slot. Mirrors `createCommitController`'s\n * supersede contract.\n *\n * **Removal contract.** `(tokenRemoved)` fires on Backspace at empty\n * input - semantically \"user wants to remove the last chip\". The\n * directive does not own the chip list; the consumer drops the last\n * entry from their state in response.\n *\n * **Duplicates.** `[existingTokens]` is read on every separator-key\n * invocation; when `allowDuplicates` is `false` (default), a token\n * already present in the list is silently dropped. The directive\n * does not track a private \"previously emitted\" set - that would be\n * an unbounded memory leak. Consumers pass their canonical chip\n * list as `[existingTokens]`.\n *\n * **Paste.** Pasting text containing one or more single-character\n * separators (e.g. `\"red, green, blue\"`) emits one `tokenCreated`\n * per non-empty fragment. Multi-char separators (`'Enter'`) are\n * keyboard-only and ignored by the paste path. Single-token paste\n * (no embedded separator) is left to the default paste behaviour\n * so the input value populates normally and the user can decide.\n *\n * ```html\n * <input\n * cngxChipInput\n * placeholder=\"Type a tag and press Enter\"\n * [existingTokens]=\"tags()\"\n * (tokenCreated)=\"addTag($event)\"\n * (tokenRemoved)=\"popTag()\"\n * [validateToken]=\"validateTag\"\n * />\n * <cngx-toast-on />\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-input/chip-input.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMultiChipGroup, CngxChipInteraction, CngxChipInGroup\n * <example-url>http://localhost:4200/#/common/interactive/chip/input/async-validation-with-supersede-semantics</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/chip/input/synchronous-tokenization</example-url>\n */\n@Directive({\n selector: 'input[cngxChipInput]',\n exportAs: 'cngxChipInput',\n standalone: true,\n host: {\n class: 'cngx-chip-input',\n '[attr.aria-busy]': 'isPending() ? \"true\" : null',\n '[attr.aria-invalid]': 'isInvalid() ? \"true\" : null',\n '(keydown)': 'handleKeydown($event)',\n '(paste)': 'handlePaste($event)',\n },\n providers: [{ provide: CNGX_STATEFUL, useExisting: CngxChipInput }],\n})\nexport class CngxChipInput implements CngxStateful<string> {\n readonly separators = input<readonly string[]>([',', 'Enter']);\n readonly allowDuplicates = input<boolean>(false);\n readonly trimWhitespace = input<boolean>(true);\n readonly existingTokens = input<readonly string[]>([]);\n readonly validateToken = input<\n ((value: string) => Promise<string> | Observable<string>) | undefined\n >(undefined);\n\n readonly tokenCreated = output<string>();\n readonly tokenRemoved = output<void>();\n readonly validationError = output<unknown>();\n\n private readonly statusState = signal<AsyncStatus>('idle');\n private readonly dataState = signal<string | undefined>(undefined);\n private readonly errorState = signal<unknown>(undefined);\n private readonly hadSuccess = signal(false);\n\n /**\n * Validation slot - `CngxStateful<string>` contract surface. The\n * view is built from raw signals via `buildAsyncStateView` rather\n * than `createManualState` (which lives in `@cngx/common/data`)\n * because `@cngx/common/data → @cngx/common/interactive` already\n * exists via `CngxSearch`, and re-importing data from interactive\n * would create a circular package dependency. The 30-LOC inline\n * is acceptable scope-wise; a future refactor relocating\n * `createManualState` to `@cngx/core/utils` would let this\n * collapse to a single call.\n */\n readonly state: CngxAsyncState<string> = buildAsyncStateView<string>({\n status: this.statusState.asReadonly(),\n data: this.dataState.asReadonly(),\n error: this.errorState.asReadonly(),\n progress: signal<number | undefined>(undefined).asReadonly(),\n isFirstLoad: computed(() => !this.hadSuccess()),\n lastUpdated: signal<Date | undefined>(undefined).asReadonly(),\n });\n\n private readonly hostEl = inject<ElementRef<HTMLInputElement>>(ElementRef).nativeElement;\n private validationId = 0;\n\n protected readonly isPending = computed(() => this.state.status() === 'pending');\n protected readonly isInvalid = computed(() => this.state.status() === 'error');\n\n protected handleKeydown(event: KeyboardEvent): void {\n if (this.separators().includes(event.key)) {\n event.preventDefault();\n const raw = this.hostEl.value;\n this.hostEl.value = '';\n this.createToken(raw);\n return;\n }\n if (event.key === 'Backspace' && this.hostEl.value === '') {\n this.tokenRemoved.emit();\n }\n }\n\n protected handlePaste(event: ClipboardEvent): void {\n const text = event.clipboardData?.getData('text');\n if (text === undefined || text === '') {\n return;\n }\n const charSeps = this.separators().filter((s) => s.length === 1);\n if (charSeps.length === 0) {\n return;\n }\n const escaped = charSeps.map(escapeForCharClass).join('');\n const splitter = new RegExp(`[${escaped}]`);\n const fragments = text.split(splitter).filter((f) => f.length > 0);\n if (fragments.length <= 1) {\n return;\n }\n event.preventDefault();\n this.hostEl.value = '';\n for (const fragment of fragments) {\n this.createToken(fragment);\n }\n }\n\n private createToken(rawValue: string): void {\n const trimmed = this.trimWhitespace() ? rawValue.trim() : rawValue;\n if (trimmed === '') {\n return;\n }\n if (!this.allowDuplicates() && this.existingTokens().includes(trimmed)) {\n return;\n }\n\n const validate = this.validateToken();\n if (validate === undefined) {\n this.tokenCreated.emit(trimmed);\n return;\n }\n\n const id = ++this.validationId;\n this.statusState.set('pending');\n\n void this.runValidation(validate, trimmed, id);\n }\n\n private async runValidation(\n validate: (value: string) => Promise<string> | Observable<string>,\n value: string,\n id: number,\n ): Promise<void> {\n try {\n const result = validate(value);\n const accepted: string = isObservable(result) ? await firstValueFrom(result) : await result;\n if (id !== this.validationId) {\n return;\n }\n this.dataState.set(accepted);\n this.errorState.set(undefined);\n this.hadSuccess.set(true);\n this.statusState.set('success');\n this.tokenCreated.emit(accepted);\n } catch (err) {\n if (id !== this.validationId) {\n return;\n }\n this.errorState.set(err);\n this.statusState.set('error');\n this.validationError.emit(err);\n }\n }\n}\n\n/**\n * Escape a single character for safe inclusion inside a regex\n * character class `[...]`. Unlike general-context escaping, the\n * meta set is narrower (`\\`, `]`, `^`, `-`) but `^` and `-` matter\n * because they would otherwise act as character-class operators\n * (negation at position 0, range between siblings) and silently\n * change the splitter's behaviour for separators like `'-'` or\n * `'^'`. Always-escaping these four is safe inside `[...]`.\n *\n * @internal\n */\nfunction escapeForCharClass(value: string): string {\n return value.replace(/[\\\\\\]\\-^]/g, '\\\\$&');\n}\n","import { inject, InjectionToken, type Provider } from '@angular/core';\n\n/**\n * App-wide tree-controller configuration. Populated via\n * {@link provideTreeConfig} in the root providers (or\n * {@link provideTreeConfigAt} in a component's `viewProviders` for a\n * sub-tree scope).\n *\n * Priority for every field is:\n *\n * ```\n * Per-controller option (CngxTreeControllerOptions.*)\n * ↑ falls through to\n * Component/scope viewProviders (provideTreeConfigAt)\n * ↑ falls through to\n * Root providers (provideTreeConfig)\n * ↑ falls through to\n * Library default (createTreeController / flattenTree)\n * ```\n *\n * All fields are optional - omit the ones you don't need. Typed with\n * `unknown` T-parameters because config values flow through the DI\n * system where per-instance generics can't be preserved; per-\n * controller options are still properly typed via the call site's\n * `CngxTreeControllerOptions<T>`.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport interface CngxTreeConfig {\n /**\n * Fallback for `nodeIdFn` when a caller omits it. With a config\n * default set, `CngxTreeControllerOptions.nodeIdFn` becomes\n * effectively optional - the factory throws in dev mode only when\n * neither place provides a function.\n */\n readonly defaultNodeIdFn?: (value: unknown, path: readonly number[]) => string;\n /** Fallback for `labelFn`. Library default is `String(value)`. */\n readonly defaultLabelFn?: (value: unknown) => string;\n /** Fallback for `keyFn`. Library default is identity. */\n readonly defaultKeyFn?: (value: unknown) => unknown;\n /**\n * Bound the `isExpanded(id)` signal cache. Default: unlimited -\n * keeps the stable-identity guarantee (`isExpanded(v) === isExpanded(v)`\n * always holds for the lifetime of the controller). When set, the\n * cache FIFO-evicts its oldest entry as soon as the size exceeds\n * `cacheLimit`; a re-queried id then receives a NEW signal instance\n * (values are equivalent, references differ). Set this only at\n * grid/tree scale (100k+ nodes) where memory retention matters\n * more than reference stability.\n */\n readonly cacheLimit?: number;\n /** Fallback for `initiallyExpanded`. */\n readonly defaultInitiallyExpanded?: 'all' | 'none' | readonly string[];\n}\n\n/**\n * DI token carrying the merged {@link CngxTreeConfig}. Defaults to an\n * empty object so consumers who never call {@link provideTreeConfig}\n * see library-default behaviour unchanged.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport const CNGX_TREE_CONFIG = new InjectionToken<CngxTreeConfig>('CngxTreeConfig', {\n providedIn: 'root',\n factory: (): CngxTreeConfig => ({}),\n});\n\n/**\n * Feature returned by a `with*` function - merged by\n * {@link provideTreeConfig}.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport interface CngxTreeConfigFeature {\n readonly config: Partial<CngxTreeConfig>;\n}\n\n/** @internal */\nfunction feature(mix: Partial<CngxTreeConfig>): CngxTreeConfigFeature {\n return { config: mix };\n}\n\n/**\n * App-wide default `nodeIdFn`. Per-controller options still override.\n * Use this to enforce a domain id convention across the whole app\n * (e.g. `(v) => (v as { uuid: string }).uuid`) without repeating it\n * at every call site.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function withDefaultNodeIdFn<T>(\n fn: (value: T, path: readonly number[]) => string,\n): CngxTreeConfigFeature {\n return feature({\n defaultNodeIdFn: fn as (value: unknown, path: readonly number[]) => string,\n });\n}\n\n/**\n * App-wide default `labelFn`. Library default is `String(value)`.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function withDefaultLabelFn<T>(fn: (value: T) => string): CngxTreeConfigFeature {\n return feature({ defaultLabelFn: fn as (value: unknown) => string });\n}\n\n/**\n * App-wide default `keyFn`. Library default is identity.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function withDefaultKeyFn<T>(fn: (value: T) => unknown): CngxTreeConfigFeature {\n return feature({ defaultKeyFn: fn as (value: unknown) => unknown });\n}\n\n/**\n * Bound the `isExpanded(id)` signal cache. See\n * {@link CngxTreeConfig.cacheLimit} for the trade-off.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function withTreeCacheLimit(limit: number): CngxTreeConfigFeature {\n return feature({ cacheLimit: limit });\n}\n\n/**\n * App-wide default `initiallyExpanded` seed.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function withDefaultInitiallyExpanded(\n mode: 'all' | 'none' | readonly string[],\n): CngxTreeConfigFeature {\n return feature({ defaultInitiallyExpanded: mode });\n}\n\n/**\n * Register an app-wide {@link CngxTreeConfig} composed from `with*`\n * features.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideTreeConfig(\n * withDefaultNodeIdFn<MyDomain>((v) => v.uuid),\n * withDefaultKeyFn<MyDomain>((v) => v.uuid),\n * withTreeCacheLimit(5000),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function provideTreeConfig(...features: CngxTreeConfigFeature[]): Provider[] {\n const merged = features.reduce<CngxTreeConfig>((acc, f) => ({ ...acc, ...f.config }), {});\n return [{ provide: CNGX_TREE_CONFIG, useValue: merged }];\n}\n\n/**\n * Sub-tree / component-scoped variant - use in `viewProviders` so the\n * tree config only applies to descendants of this component.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function provideTreeConfigAt(...features: CngxTreeConfigFeature[]): Provider[] {\n return provideTreeConfig(...features);\n}\n\n/**\n * Inject the currently-resolved config. Safe to call in any injection\n * context; returns `{}` if no `provideTreeConfig` is registered.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts\n * @since 0.1.0\n */\nexport function injectTreeConfig(): CngxTreeConfig {\n return inject(CNGX_TREE_CONFIG);\n}\n","import { computed, inject, InjectionToken, signal, type Signal, untracked } from '@angular/core';\nimport {\n type CngxTreeNode,\n type FlatTreeNode,\n collectDescendantValues,\n flattenTree,\n isNodeVisible,\n} from '@cngx/utils';\nimport { CNGX_TREE_CONFIG } from './tree-config';\n\n/**\n * Configuration for {@link createTreeController}.\n *\n * `nodeIdFn` is required on purpose: the controller hands its ids out to\n * `expandedIds`, to selection memoization (`keyFn` consumers), and to the\n * stable-identity `isExpanded(id)` signal cache. A non-stable id (e.g. the\n * path-based fallback from `flattenTree`) silently breaks all three the\n * moment the tree is sorted or filtered - exactly the Sort/Filter\n * integration pattern this stack is designed to support. Forcing the\n * caller to think about identity at construction eliminates that whole\n * class of heisenbugs.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts\n * @since 0.1.0\n */\nexport interface CngxTreeControllerOptions<T> {\n /** Source tree - the controller re-derives on every change. */\n readonly nodes: Signal<readonly CngxTreeNode<T>[]>;\n /**\n * Derives a stable id per flat node - must survive re-ordering and\n * filtering of the source tree. Use a domain id (`(v) => v.id`)\n * rather than a positional fallback.\n *\n * Resolution: per-options > app-wide `provideTreeConfig` default >\n * dev-mode error. At least one source must provide the function.\n */\n readonly nodeIdFn?: (value: T, path: readonly number[]) => string;\n /**\n * Visible label. Defaults (in resolution order): per-options >\n * `provideTreeConfig` default > `String(value)`.\n */\n readonly labelFn?: (value: T) => string;\n /**\n * Membership key. Defaults (in resolution order): per-options >\n * `provideTreeConfig` default > identity.\n */\n readonly keyFn?: (value: T) => unknown;\n /**\n * Initial expansion. Resolution: per-options >\n * `provideTreeConfig.defaultInitiallyExpanded` > `'none'`.\n * Evaluated once at construction; later tree changes do not re-apply.\n * Re-trigger via `expandAll()` if needed.\n */\n readonly initiallyExpanded?: 'all' | 'none' | readonly string[];\n /**\n * Bound the `isExpanded(id)` signal cache. Default: unlimited.\n * Resolution: per-options > `provideTreeConfig.cacheLimit` >\n * unlimited. See {@link CngxTreeConfig.cacheLimit} for trade-offs.\n */\n readonly cacheLimit?: number;\n}\n\n/**\n * Signal-native tree controller. Produces flat-projected views of a\n * hierarchical source, owns the expansion-set, and exposes value- and\n * id-based lookups used by the surrounding render / keyboard-nav layers.\n *\n * ## Derivation contract\n * - No `effect()`, no subscriptions. The only writable slot is the internal\n * expandedIds set; every other accessor is a `computed()` or pure fn.\n * - `isExpanded(id)` returns the SAME `Signal` instance per id across the\n * controller's lifetime - safe to pass into OnPush children without churn.\n * - Controller is a11y-agnostic - adapters like `createTreeAdItems` live\n * in sibling files so `@cngx/core`-level reuse stays clean.\n *\n * ## Reactivity contract\n * The surface splits into two classes of accessors, **by design**:\n *\n * - **Reactive** (`Signal<…>` returners): `flatNodes`, `visibleNodes`,\n * `expandedIds`, `isExpanded(id)`. Bind these in templates and wrap in\n * `computed()` freely - Angular tracks their dependencies automatically.\n *\n * - **Snapshot** (plain-return methods): `findById`, `parentOf`,\n * `firstChildOf`, `childrenOfValue`, `descendantsOfValue`. These read\n * the underlying indexes reactively when called inside a tracked\n * context, but intentionally return raw values rather than signals.\n * They are intended for imperative call-sites - keydown handlers,\n * commit flows, AD-activation dispatch - where the caller wants a\n * one-shot lookup, not a subscription. If you *do* call them from\n * inside an `effect()` that should NOT re-fire on tree changes, wrap\n * the call in `untracked(() => ctrl.parentOf(id))`.\n *\n * ## Mutations\n * All mutators (`expand`, `collapse`, `toggle`, `expandAll`, `collapseAll`)\n * peek at the expansion set via `untracked()` so invoking them from\n * inside an `effect()` never latches that effect onto the expansion set.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts\n * @since 0.1.0\n */\nexport interface CngxTreeController<T> {\n /** Flat DFS projection with ARIA metadata + backref to the source node. */\n readonly flatNodes: Signal<readonly FlatTreeNode<T>[]>;\n /** Flat nodes minus those under a collapsed ancestor. */\n readonly visibleNodes: Signal<readonly FlatTreeNode<T>[]>;\n /** Read-only view of the expansion set. */\n readonly expandedIds: Signal<ReadonlySet<string>>;\n /** Stable-identity membership signal per id. */\n isExpanded(id: string): Signal<boolean>;\n /**\n * Direct-children values of a node, for selection `childrenFn`.\n *\n * Returns a fresh array per call. SelectionController's cascade\n * `isIndeterminate` walk invokes `childrenFn` once per tree node on\n * every membership change - a cascade-toggle on a 10k-descendant root\n * triggers O(n) fresh allocations per recompute. Tracked as a perf\n * follow-up: memoize by (tree-version, value-key) if the 10k demo\n * surfaces measurable jitter; spec `tree-controller.spec.ts` carries\n * a reserved baseline-benchmark slot (`it.todo`).\n */\n childrenOfValue(value: T): T[];\n /**\n * All descendant values (DFS, exclusive of self), for cascade-select.\n * Same allocation caveat as `childrenOfValue` - returns a fresh array;\n * cascade-select on wide subtrees allocates O(descendants) per call.\n */\n descendantsOfValue(value: T): T[];\n expand(id: string): void;\n collapse(id: string): void;\n toggle(id: string): void;\n /** Expand every node that has children. No-op when already fully expanded. */\n expandAll(): void;\n collapseAll(): void;\n findById(id: string): FlatTreeNode<T> | undefined;\n /**\n * O(1) lookup of the flat projection for a value, using the same\n * `keyFn` that backs selection membership. Returns `undefined` when\n * the value is not in the current tree (stale selection, swapped\n * source, etc.). Prefer this over a linear scan of `flatNodes()`.\n */\n findByValue(value: T): FlatTreeNode<T> | undefined;\n parentOf(id: string): FlatTreeNode<T> | undefined;\n firstChildOf(id: string): FlatTreeNode<T> | undefined;\n /**\n * Release the `isExpanded(id)` signal-cache. **Soft contract** - matches\n * `createSelectionController`'s destroy semantics:\n * - New `isExpanded(id)` queries return a shared `Signal<false>` constant.\n * - Existing signal bindings created before destroy keep working - the\n * underlying `expandedIds` signal is still live, so downstream updates\n * continue to propagate.\n * - Mutators (`expand` / `collapse` / `toggle` / `expandAll` /\n * `collapseAll`) continue to function; post-destroy writes do NOT\n * repopulate the cache.\n *\n * Idempotent. Prefer this over a hard teardown so long-lived consumer\n * bindings that outlive the controller's active phase degrade\n * gracefully rather than throwing.\n */\n destroy(): void;\n}\n\n/**\n * Factory signature carried by the DI token.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts\n * @since 0.1.0\n */\nexport type CngxTreeControllerFactory = <T>(\n opts: CngxTreeControllerOptions<T>,\n) => CngxTreeController<T>;\n\n/**\n * Injection token that resolves the factory used to instantiate a\n * {@link CngxTreeController}. Defaults to {@link createTreeController};\n * override via `providers`/`viewProviders` for telemetry wrappers, audit\n * logging, or server-synced expansion state.\n *\n * Symmetrical to `CNGX_SELECTION_CONTROLLER_FACTORY` in `@cngx/core/utils` -\n * same override surface, one concern below: tree-aware derived views.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts\n * @since 0.1.0\n */\nexport const CNGX_TREE_CONTROLLER_FACTORY = new InjectionToken<CngxTreeControllerFactory>(\n 'CngxTreeControllerFactory',\n {\n providedIn: 'root',\n factory: () => createTreeController,\n },\n);\n\n/**\n * Shared `Signal<false>` returned post-destroy and as an always-false fallback.\n *\n * @internal\n */\nconst POST_DESTROY_FALSE: Signal<boolean> = signal(false).asReadonly();\n\n/** @internal */\nfunction flatEq<T>(a: readonly FlatTreeNode<T>[], b: readonly FlatTreeNode<T>[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const ai = a[i];\n const bi = b[i];\n if (\n ai.id !== bi.id ||\n !Object.is(ai.value, bi.value) ||\n ai.disabled !== bi.disabled ||\n ai.hasChildren !== bi.hasChildren ||\n ai.depth !== bi.depth\n ) {\n return false;\n }\n }\n return true;\n}\n\n/** @internal */\ninterface TreeIndexes<T> {\n readonly byId: ReadonlyMap<string, FlatTreeNode<T>>;\n /** `keyFn(value)` → flat-projected node. Source `CngxTreeNode` is reachable via `.node`. */\n readonly byValue: ReadonlyMap<unknown, FlatTreeNode<T>>;\n readonly firstChildById: ReadonlyMap<string, FlatTreeNode<T>>;\n}\n\n/**\n * Plain factory for a signal-native tree controller. Reads `opts.nodes`\n * reactively, derives flat / visible projections via `computed`, and\n * tracks expanded-id state internally. Must be called in an injection\n * context (reads {@link CNGX_TREE_CONFIG} for defaults).\n *\n * See {@link CngxTreeController} for the returned surface and\n * {@link CngxTreeControllerOptions} for the configuration cascade.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts\n * @since 0.1.0\n */\nexport function createTreeController<T>(opts: CngxTreeControllerOptions<T>): CngxTreeController<T> {\n const { nodes } = opts;\n const config = inject(CNGX_TREE_CONFIG, { optional: true }) ?? {};\n\n // Resolution: per-options > provideTreeConfig default > library default.\n const resolvedNodeIdFn =\n opts.nodeIdFn ??\n (config.defaultNodeIdFn as ((v: T, path: readonly number[]) => string) | undefined);\n if (!resolvedNodeIdFn) {\n throw new Error(\n 'createTreeController: `nodeIdFn` is required. Provide it via ' +\n 'CngxTreeControllerOptions.nodeIdFn or app-wide through ' +\n '`provideTreeConfig(withDefaultNodeIdFn(...))`.',\n );\n }\n const resolvedLabelFn = opts.labelFn ?? (config.defaultLabelFn as ((v: T) => string) | undefined);\n const resolvedKeyFn: (v: T) => unknown =\n opts.keyFn ??\n (config.defaultKeyFn as ((v: T) => unknown) | undefined) ??\n ((v: T) => v as unknown);\n const resolvedInitiallyExpanded = opts.initiallyExpanded ?? config.defaultInitiallyExpanded;\n const resolvedCacheLimit = opts.cacheLimit ?? config.cacheLimit;\n\n const keyFn = resolvedKeyFn;\n\n const flatNodes = computed(() => flattenTree(nodes(), resolvedNodeIdFn, resolvedLabelFn), {\n equal: flatEq,\n });\n\n // One pass over flatNodes produces every index the controller needs:\n // id → FlatTreeNode, value-key → source CngxTreeNode, parentId →\n // first-child FlatTreeNode. All lookups are O(1); the old linear\n // scan in firstChildOf is gone.\n const indexes = computed<TreeIndexes<T>>(() => {\n const byId = new Map<string, FlatTreeNode<T>>();\n const byValue = new Map<unknown, FlatTreeNode<T>>();\n const firstChildById = new Map<string, FlatTreeNode<T>>();\n for (const n of flatNodes()) {\n byId.set(n.id, n);\n byValue.set(keyFn(n.value), n);\n const pids = n.parentIds;\n if (pids.length > 0) {\n const parentId = pids[pids.length - 1];\n if (!firstChildById.has(parentId)) {\n firstChildById.set(parentId, n);\n }\n }\n }\n return { byId, byValue, firstChildById };\n });\n\n const collectExpandAllIds = (): Set<string> => {\n const next = new Set<string>();\n for (const n of flatNodes()) {\n if (n.hasChildren) {\n next.add(n.id);\n }\n }\n return next;\n };\n\n // Seed the expansion set once. `untracked` is defensive - if the factory\n // is mistakenly called from an outer reactive context, this read must not\n // leak `flatNodes` / `nodes` into that context's dependency graph.\n const initialSet = untracked(() => {\n if (resolvedInitiallyExpanded === 'all') {\n return collectExpandAllIds();\n }\n if (Array.isArray(resolvedInitiallyExpanded)) {\n return new Set(resolvedInitiallyExpanded);\n }\n return new Set<string>();\n });\n\n const expandedIdsWritable = signal<ReadonlySet<string>>(initialSet);\n const expandedIds = expandedIdsWritable.asReadonly();\n\n const visibleNodes = computed(() => flatNodes().filter((n) => isNodeVisible(n, expandedIds())), {\n equal: flatEq,\n });\n\n // `Map` preserves insertion order → FIFO eviction when `cacheLimit`\n // is set. Without a limit the cache grows unbounded over the\n // controller's lifetime (bounded by unique-id count in practice).\n // Re-inserting an existing key via `set` does NOT re-order the entry\n // in modern JS engines, which keeps the eviction order predictable\n // (oldest-inserted, not least-recently-used).\n const expandedCache = new Map<string, Signal<boolean>>();\n let destroyed = false;\n\n const evictOldestIfOverLimit = (): void => {\n if (resolvedCacheLimit === undefined) {\n return;\n }\n while (expandedCache.size > resolvedCacheLimit) {\n const oldestKey = expandedCache.keys().next().value;\n if (oldestKey === undefined) {\n return;\n }\n expandedCache.delete(oldestKey);\n }\n };\n\n const isExpanded = (id: string): Signal<boolean> => {\n if (destroyed) {\n return POST_DESTROY_FALSE;\n }\n let sig = expandedCache.get(id);\n if (!sig) {\n sig = computed(() => expandedIds().has(id));\n expandedCache.set(id, sig);\n evictOldestIfOverLimit();\n }\n return sig;\n };\n\n const childrenOfValue = (v: T): T[] => {\n const flat = indexes().byValue.get(keyFn(v));\n const children = flat?.node.children ?? [];\n return children.map((c) => c.value);\n };\n\n const descendantsOfValue = (v: T): T[] => {\n const flat = indexes().byValue.get(keyFn(v));\n return flat ? collectDescendantValues(flat.node) : [];\n };\n\n const findById = (id: string): FlatTreeNode<T> | undefined => indexes().byId.get(id);\n\n const findByValue = (v: T): FlatTreeNode<T> | undefined => indexes().byValue.get(keyFn(v));\n\n const parentOf = (id: string): FlatTreeNode<T> | undefined => {\n const byId = indexes().byId;\n const node = byId.get(id);\n if (!node || node.parentIds.length === 0) {\n return undefined;\n }\n return byId.get(node.parentIds[node.parentIds.length - 1]);\n };\n\n const firstChildOf = (id: string): FlatTreeNode<T> | undefined =>\n indexes().firstChildById.get(id);\n\n // Mutation helpers read the writable signal via `untracked()` - these\n // methods can be invoked from anywhere (event handlers, effects, async\n // callbacks); reading outside a tracked context keeps consumer `effect()`\n // graphs from latching onto the expansion set accidentally.\n const peekExpanded = (): ReadonlySet<string> => untracked(() => expandedIdsWritable());\n\n const expand = (id: string): void => {\n if (peekExpanded().has(id)) {\n return;\n }\n expandedIdsWritable.update((s) => {\n const next = new Set(s);\n next.add(id);\n return next;\n });\n };\n\n const collapse = (id: string): void => {\n if (!peekExpanded().has(id)) {\n return;\n }\n expandedIdsWritable.update((s) => {\n const next = new Set(s);\n next.delete(id);\n return next;\n });\n };\n\n const toggle = (id: string): void => {\n if (peekExpanded().has(id)) {\n collapse(id);\n } else {\n expand(id);\n }\n };\n\n const setsEqual = (a: ReadonlySet<string>, b: ReadonlySet<string>): boolean => {\n if (a === b) {\n return true;\n }\n if (a.size !== b.size) {\n return false;\n }\n for (const id of a) {\n if (!b.has(id)) {\n return false;\n }\n }\n return true;\n };\n\n const expandAll = (): void => {\n const next = untracked(() => collectExpandAllIds());\n if (setsEqual(peekExpanded(), next)) {\n return;\n }\n expandedIdsWritable.set(next);\n };\n\n const collapseAll = (): void => {\n if (peekExpanded().size === 0) {\n return;\n }\n expandedIdsWritable.set(new Set());\n };\n\n const destroy = (): void => {\n if (destroyed) {\n return;\n }\n destroyed = true;\n expandedCache.clear();\n };\n\n return {\n flatNodes,\n visibleNodes,\n expandedIds,\n isExpanded,\n childrenOfValue,\n descendantsOfValue,\n expand,\n collapse,\n toggle,\n expandAll,\n collapseAll,\n findById,\n findByValue,\n parentOf,\n firstChildOf,\n destroy,\n };\n}\n","import { computed, type Signal } from '@angular/core';\nimport { type ActiveDescendantItem } from '@cngx/common/a11y';\nimport { type CngxTreeController } from './tree-controller';\n\n/** @internal */\nfunction adEq(a: ActiveDescendantItem[], b: ActiveDescendantItem[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const ai = a[i];\n const bi = b[i];\n if (\n ai.id !== bi.id ||\n !Object.is(ai.value, bi.value) ||\n ai.disabled !== bi.disabled ||\n ai.label !== bi.label\n ) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Projects a tree controller's `visibleNodes` into the\n * `ActiveDescendantItem[]` shape consumed by `CngxActiveDescendant.items`.\n * Kept as a helper (not a method on the controller) so\n * `CngxTreeController` stays free of the `@cngx/common/a11y` import and\n * can be reused from contexts that do not render through AD.\n *\n * Returns a structurally-equal memoized computed - consumers can pass the\n * signal straight into `[items]=\"adItems()\"` without worrying about cascade\n * re-renders on irrelevant tree re-emissions.\n *\n * @category common/interactive/tree\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-ad-items.ts\n * @since 0.1.0\n */\nexport function createTreeAdItems<T>(ctrl: CngxTreeController<T>): Signal<ActiveDescendantItem[]> {\n return computed(\n () =>\n ctrl.visibleNodes().map<ActiveDescendantItem>((n) => ({\n id: n.id,\n value: n.value,\n label: n.label,\n disabled: n.disabled,\n })),\n { equal: adEq },\n );\n}\n","import { InjectionToken } from '@angular/core';\nimport { type CngxActiveDescendant } from '@cngx/common/a11y';\nimport { type CngxTreeController } from '../tree-controller/tree-controller';\n\n/**\n * Outcome dispatched by a {@link CngxHierarchicalNavStrategy} step.\n * `CngxHierarchicalNav` interprets the action: fires the matching\n * output, calls `event.preventDefault()` for anything non-`noop`, and\n * (for move actions) relies on the strategy having already called\n * `ad.highlightByValue` on the context.\n *\n * @category common/interactive/tree\n */\nexport type CngxHierarchicalNavAction =\n | { readonly kind: 'expand'; readonly id: string }\n | { readonly kind: 'collapse'; readonly id: string }\n | { readonly kind: 'movedToChild'; readonly id: string }\n | { readonly kind: 'movedToParent'; readonly id: string }\n | { readonly kind: 'noop' };\n\n/**\n * Context passed to every strategy step. `ad` is guaranteed non-null\n * (the directive checks before invoking the strategy); `activeId` is\n * the current `ad.activeId()` snapshot captured at key-press time.\n *\n * @category common/interactive/tree\n */\nexport interface CngxHierarchicalNavContext<T> {\n readonly controller: CngxTreeController<T>;\n readonly ad: CngxActiveDescendant;\n readonly activeId: string;\n}\n\n/**\n * Pluggable keyboard policy for {@link CngxHierarchicalNav}. The\n * default implementation ({@link createW3CTreeStrategy}) matches the\n * W3C APG treeview pattern; consumers who need different semantics\n * (e.g. \"ArrowRight always expands but never moves to first child\",\n * \"ArrowLeft collapses but never jumps to parent\") can register their\n * own strategy via `CNGX_HIERARCHICAL_NAV_STRATEGY`.\n *\n * Strategy steps are synchronous, side-effect-allowed functions -\n * they may call `ctrl.expand()` / `ctrl.collapse()` / `ad.highlightByValue()`\n * before returning the corresponding action. The directive then emits\n * the informational output + prevents default key handling.\n *\n * @category common/interactive/tree\n */\nexport interface CngxHierarchicalNavStrategy {\n onArrowRight<T>(ctx: CngxHierarchicalNavContext<T>): CngxHierarchicalNavAction;\n onArrowLeft<T>(ctx: CngxHierarchicalNavContext<T>): CngxHierarchicalNavAction;\n}\n\n/** @internal */\nconst NOOP: CngxHierarchicalNavAction = { kind: 'noop' };\n\n/**\n * Default W3C APG treeview keyboard policy:\n *\n * - **ArrowRight** on a collapsed parent expands it. On an already-open\n * parent it moves the active-descendant to the first child. On a leaf\n * it is a no-op.\n * - **ArrowLeft** on an open node collapses it. On a closed node (or\n * leaf) with a parent it moves the active-descendant to the parent.\n * On a root leaf it is a no-op.\n *\n * Move actions internally verify that `ad.highlightByValue` actually\n * changed `activeId` (e.g. disabled skip rejection), and downgrade to\n * `'noop'` when it didn't - so consumers bound to `(movedToChild)` /\n * `(movedToParent)` only see state-change-truthful emissions.\n *\n * @category common/interactive/tree\n */\nexport function createW3CTreeStrategy(): CngxHierarchicalNavStrategy {\n const attemptMove = <T>(\n ctx: CngxHierarchicalNavContext<T>,\n targetValue: unknown,\n targetId: string,\n kind: 'movedToChild' | 'movedToParent',\n ): CngxHierarchicalNavAction => {\n const before = ctx.ad.activeId();\n ctx.ad.highlightByValue(targetValue);\n if (ctx.ad.activeId() === before) {\n return NOOP;\n }\n return { kind, id: targetId };\n };\n\n return {\n onArrowRight<T>(ctx: CngxHierarchicalNavContext<T>): CngxHierarchicalNavAction {\n const node = ctx.controller.findById(ctx.activeId);\n if (!node?.hasChildren) {\n return NOOP;\n }\n if (!ctx.controller.isExpanded(ctx.activeId)()) {\n ctx.controller.expand(ctx.activeId);\n return { kind: 'expand', id: ctx.activeId };\n }\n const firstChild = ctx.controller.firstChildOf(ctx.activeId);\n if (!firstChild) {\n return NOOP;\n }\n return attemptMove(ctx, firstChild.value, firstChild.id, 'movedToChild');\n },\n\n onArrowLeft<T>(ctx: CngxHierarchicalNavContext<T>): CngxHierarchicalNavAction {\n if (ctx.controller.isExpanded(ctx.activeId)()) {\n ctx.controller.collapse(ctx.activeId);\n return { kind: 'collapse', id: ctx.activeId };\n }\n const parent = ctx.controller.parentOf(ctx.activeId);\n if (!parent) {\n return NOOP;\n }\n return attemptMove(ctx, parent.value, parent.id, 'movedToParent');\n },\n };\n}\n\n/**\n * DI token carrying the {@link CngxHierarchicalNavStrategy} that\n * `CngxHierarchicalNav` consults on every ArrowLeft/Right press.\n * Defaults to {@link createW3CTreeStrategy}; override via\n * `providers`/`viewProviders` for alternative keyboard semantics.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * {\n * provide: CNGX_HIERARCHICAL_NAV_STRATEGY,\n * useFactory: () => ({\n * onArrowRight: (ctx) => {\n * // Expand only; never traverse to first child.\n * const node = ctx.controller.findById(ctx.activeId);\n * if (!node?.hasChildren) return { kind: 'noop' };\n * ctx.controller.expand(ctx.activeId);\n * return { kind: 'expand', id: ctx.activeId };\n * },\n * onArrowLeft: (ctx) => ({ kind: 'noop' }),\n * }),\n * },\n * ],\n * });\n * ```\n *\n * @category common/interactive/tree\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/hierarchical-nav/hierarchical-nav-strategy.ts\n * @since 0.1.0\n */\nexport const CNGX_HIERARCHICAL_NAV_STRATEGY = new InjectionToken<CngxHierarchicalNavStrategy>(\n 'CngxHierarchicalNavStrategy',\n {\n providedIn: 'root',\n factory: createW3CTreeStrategy,\n },\n);\n","import { Directive, inject, input, output } from '@angular/core';\nimport { CngxActiveDescendant } from '@cngx/common/a11y';\nimport { type CngxTreeController } from '../tree-controller/tree-controller';\nimport {\n CNGX_HIERARCHICAL_NAV_STRATEGY,\n type CngxHierarchicalNavAction,\n} from './hierarchical-nav-strategy';\n\n/**\n * W3C-tree keyboard extension. Wires `ArrowRight` / `ArrowLeft` to a\n * pluggable {@link CngxHierarchicalNavStrategy}; the default strategy\n * implements the\n * [APG treeview pattern](https://www.w3.org/WAI/ARIA/apg/patterns/treeview/):\n *\n * - **ArrowRight** on a collapsed parent expands it. On an already-open\n * parent it moves the active-descendant to the first child. On a leaf\n * it is a no-op.\n * - **ArrowLeft** on an open node collapses it. On a closed node (or\n * leaf) with a parent it moves the active-descendant to the parent.\n * On a root leaf it is a no-op.\n *\n * Swap the strategy via `CNGX_HIERARCHICAL_NAV_STRATEGY` to customise\n * the semantics (expand-only, never-traverse, exotic drag-drop flows)\n * without forking the directive.\n *\n * Attaches on the same element as `CngxActiveDescendant`; injects the AD\n * instance (`host: true`, optional) and leaves vertical `ArrowUp`/`Down`,\n * `Home`/`End`, and typeahead to AD's own handler. The two directives\n * coexist without conflict - in vertical orientation AD's `isNavKey`\n * branches for `ArrowLeft`/`ArrowRight` are already no-ops.\n *\n * Outputs are informational and state-change-truthful: `expand` /\n * `collapse` / `movedToChild` / `movedToParent` fire only when the\n * strategy reports the corresponding action. A disabled target the\n * strategy's `attemptMove` couldn't highlight never triggers a\n * `movedToChild` / `movedToParent` emission.\n *\n * ```html\n * <ul\n * role=\"tree\"\n * aria-multiselectable=\"true\"\n * cngxActiveDescendant\n * [items]=\"adItems()\"\n * [cngxHierarchicalNav]=\"treeController\"\n * tabindex=\"0\"\n * ></ul>\n * ```\n *\n * @category common/interactive/tree\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/hierarchical-nav/hierarchical-nav.directive.ts\n * @since 0.1.0\n * @relatedTo CngxActiveDescendant, CngxTreeController, CngxRovingTabindex\n */\n@Directive({\n selector: '[cngxHierarchicalNav]',\n exportAs: 'cngxHierarchicalNav',\n standalone: true,\n host: {\n '(keydown.arrowleft)': 'handleLeft($event)',\n '(keydown.arrowright)': 'handleRight($event)',\n },\n})\nexport class CngxHierarchicalNav<T = unknown> {\n /**\n * The tree controller that owns expansion state. Required - without it\n * the directive has nothing to reason about.\n */\n readonly controller = input.required<CngxTreeController<T>>({\n alias: 'cngxHierarchicalNav',\n });\n\n private readonly ad = inject(CngxActiveDescendant, {\n host: true,\n optional: true,\n });\n\n private readonly strategy = inject(CNGX_HIERARCHICAL_NAV_STRATEGY);\n\n /** Emitted with the id that was just expanded via ArrowRight. */\n readonly expand = output<string>();\n /** Emitted with the id that was just collapsed via ArrowLeft. */\n readonly collapse = output<string>();\n /** Emitted with the id of the parent the active-descendant moved to. */\n readonly movedToParent = output<string>();\n /** Emitted with the id of the child the active-descendant moved to. */\n readonly movedToChild = output<string>();\n\n handleRight(event: Event): void {\n this.dispatch(event, (ctx) => this.strategy.onArrowRight(ctx));\n }\n\n handleLeft(event: Event): void {\n this.dispatch(event, (ctx) => this.strategy.onArrowLeft(ctx));\n }\n\n /**\n * Shared guard + action-dispatch wrapper. Degrades silently when AD\n * isn't composed on the host or nothing is highlighted.\n */\n private dispatch(\n event: Event,\n step: (ctx: {\n readonly controller: CngxTreeController<T>;\n readonly ad: CngxActiveDescendant;\n readonly activeId: string;\n }) => CngxHierarchicalNavAction,\n ): void {\n const ad = this.ad;\n if (!ad) {\n return;\n }\n const activeId = ad.activeId();\n if (activeId === null) {\n return;\n }\n const action = step({ controller: this.controller(), ad, activeId });\n if (action.kind === 'noop') {\n return;\n }\n switch (action.kind) {\n case 'expand':\n this.expand.emit(action.id);\n break;\n case 'collapse':\n this.collapse.emit(action.id);\n break;\n case 'movedToChild':\n this.movedToChild.emit(action.id);\n break;\n case 'movedToParent':\n this.movedToParent.emit(action.id);\n break;\n }\n event.preventDefault();\n }\n}\n","import { computed, signal, type Signal } from '@angular/core';\nimport { buildAsyncStateView, type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\nimport { firstValueFrom, isObservable, timer } from 'rxjs';\n\nimport type { AsyncAction } from '../async-click/async-click.directive';\n\n/**\n * Configuration for `withRetry()`.\n *\n * @category common/interactive/retry\n */\nexport interface RetryConfig {\n /** Maximum number of attempts (including the first). Default: `3`. */\n maxAttempts?: number;\n /** Base delay in ms between retries. Default: `1000`. */\n delay?: number;\n /** Backoff strategy. `'exponential'` doubles the delay each attempt. Default: `'exponential'`. */\n backoff?: 'linear' | 'exponential';\n}\n\n/**\n * State exposed by the retryable action — read-only signals for UI feedback.\n *\n * @category common/interactive/retry\n */\nexport interface RetryState {\n /** Current attempt number (1-based). `0` before first invocation. */\n readonly attempt: Signal<number>;\n /** Total attempts allowed. */\n readonly maxAttempts: Signal<number>;\n /** Whether a retry is currently pending (waiting for delay). */\n readonly retrying: Signal<boolean>;\n /** Whether all attempts have been exhausted. */\n readonly exhausted: Signal<boolean>;\n /** The last error from a failed attempt. */\n readonly lastError: Signal<unknown>;\n /**\n * Full `CngxAsyncState` view of the retry lifecycle.\n *\n * Bind to any `[state]` consumer to connect the feedback system.\n * `retrying` (delay between retries) maps to `'pending'` — the feedback\n * system sees \"still working\" during retry delays.\n */\n readonly state: CngxAsyncState<unknown>;\n /** Manually reset — clears exhausted state, resets attempt counter. */\n reset(): void;\n}\n\n/**\n * Wraps an `AsyncAction` with automatic retry logic.\n *\n * Returns a tuple: `[action, retryState]` where `action` is a new `AsyncAction`\n * that retries on failure, and `retryState` exposes attempt/retry signals and\n * a `state: CngxAsyncState` for feedback system integration.\n *\n * Composes naturally with `CngxAsyncClick` and `CngxActionButton`:\n *\n * ```typescript\n * const [saveWithRetry, retryState] = withRetry(\n * () => this.http.post('/api/save', data),\n * { maxAttempts: 3, delay: 1000, backoff: 'exponential' }\n * );\n *\n * // Use with CngxAsyncClick + toast\n * <button [cngxAsyncClick]=\"saveWithRetry\">Save</button>\n * <ng-container [cngxToastOn]=\"retryState.state\"\n * toastSuccess=\"Saved\" toastError=\"All retries failed\" />\n * ```\n *\n * @category common/interactive/retry\n */\nexport function withRetry(action: AsyncAction, config?: RetryConfig): [AsyncAction, RetryState] {\n const maxAttempts = config?.maxAttempts ?? 3;\n const baseDelay = config?.delay ?? 1000;\n const backoff = config?.backoff ?? 'exponential';\n\n const attemptState = signal(0);\n const retryingState = signal(false);\n const exhaustedState = signal(false);\n const succeededState = signal(false);\n const lastErrorState = signal<unknown>(undefined);\n\n const statusComputed = computed<AsyncStatus>(() => {\n if (attemptState() === 0) {\n return 'idle';\n }\n if (exhaustedState()) {\n return 'error';\n }\n if (succeededState()) {\n return 'success';\n }\n return 'pending';\n });\n\n const asyncState = buildAsyncStateView<unknown>({\n status: statusComputed,\n data: computed(() => undefined),\n error: lastErrorState.asReadonly(),\n });\n\n const retryState: RetryState = {\n attempt: attemptState.asReadonly(),\n maxAttempts: computed(() => maxAttempts),\n retrying: retryingState.asReadonly(),\n exhausted: exhaustedState.asReadonly(),\n lastError: lastErrorState.asReadonly(),\n state: asyncState,\n reset() {\n attemptState.set(0);\n retryingState.set(false);\n exhaustedState.set(false);\n succeededState.set(false);\n lastErrorState.set(undefined);\n },\n };\n\n // Generation counter cancels any in-flight retry loop on re-invocation.\n let generation = 0;\n\n const retryableAction: AsyncAction = async () => {\n const thisGeneration = ++generation;\n attemptState.set(0);\n retryingState.set(false);\n exhaustedState.set(false);\n succeededState.set(false);\n\n for (let attempt = 1; attempt <= maxAttempts; attempt++) {\n if (generation !== thisGeneration) {\n return;\n }\n attemptState.set(attempt);\n\n try {\n const result$ = action();\n if (isObservable(result$)) {\n await firstValueFrom(result$, { defaultValue: undefined });\n } else {\n await result$;\n }\n if (generation !== thisGeneration) {\n return;\n }\n retryingState.set(false);\n succeededState.set(true);\n return;\n } catch (err: unknown) {\n if (generation !== thisGeneration) {\n return;\n }\n lastErrorState.set(err);\n\n if (attempt >= maxAttempts) {\n exhaustedState.set(true);\n retryingState.set(false);\n throw err;\n }\n\n retryingState.set(true);\n const delayMs =\n backoff === 'exponential' ? baseDelay * Math.pow(2, attempt - 1) : baseDelay * attempt;\n await firstValueFrom(timer(delayMs), { defaultValue: undefined });\n if (generation !== thisGeneration) {\n return;\n }\n retryingState.set(false);\n }\n }\n };\n\n return [retryableAction, retryState];\n}\n","import { computed, signal, type WritableSignal, type Signal } from '@angular/core';\nimport { buildAsyncStateView, type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\nimport { type Observable, type Subscription, take } from 'rxjs';\n\n/**\n * State exposed by the optimistic action.\n *\n * @category common/interactive/optimistic\n */\nexport interface OptimisticState {\n /** Whether a rollback occurred on the last invocation. */\n readonly rolledBack: Signal<boolean>;\n /** The error from the last failed action (`undefined` if successful). */\n readonly error: Signal<unknown>;\n /**\n * Full `CngxAsyncState` view of the optimistic lifecycle.\n *\n * Bind to any `[state]` consumer to connect the feedback system.\n * Status is `'pending'` while the confirming Observable is in flight,\n * `'success'` on confirmation, `'error'` on rollback.\n */\n readonly state: CngxAsyncState<unknown>;\n}\n\n/**\n * Creates an optimistic update function for a signal.\n *\n * Sets the new value immediately (optimistic), then confirms via the async action.\n * On success, applies the server-confirmed value. On failure, rolls back to the\n * previous value.\n *\n * This is a utility function, not a directive — it composes with any signal.\n *\n * ```typescript\n * readonly name = signal('Alice');\n * readonly [updateName, nameState] = optimistic(\n * this.name,\n * (value) => this.http.put('/api/name', { name: value })\n * );\n *\n * // In template:\n * <input [value]=\"name()\" (change)=\"updateName($event.target.value)\" />\n * <ng-container [cngxToastOn]=\"nameState.state\" toastError=\"Update failed\" />\n * @if (nameState.rolledBack()) { <span>Reverted</span> }\n * ```\n *\n * **Note:** The internal subscription is unmanaged — there is no `DestroyRef` available\n * in a plain factory function. If the component is destroyed mid-flight, the subscription\n * completes silently. For long-running actions, ensure the component outlives the action\n * or cancel via the Observable itself.\n *\n * @param current - The writable signal to update optimistically.\n * @param action - Async action that confirms the value. Should return the confirmed value.\n * @returns Tuple of `[applyFn, state]`.\n *\n * @category common/interactive/optimistic\n */\nexport function optimistic<T>(\n current: WritableSignal<T>,\n action: (value: T) => Observable<T>,\n): [(newValue: T) => void, OptimisticState] {\n const rolledBackState = signal(false);\n const errorState = signal<unknown>(undefined);\n const statusState = signal<AsyncStatus>('idle');\n\n const asyncState = buildAsyncStateView<unknown>({\n status: statusState.asReadonly(),\n data: computed(() => undefined),\n error: errorState.asReadonly(),\n });\n\n const state: OptimisticState = {\n rolledBack: rolledBackState.asReadonly(),\n error: errorState.asReadonly(),\n state: asyncState,\n };\n\n // Last confirmed value — rollback target under concurrent calls.\n let confirmedValue = current();\n let activeSub: Subscription | undefined;\n\n const apply = (newValue: T): void => {\n // Cancel in-flight subscription — prevents stale closure rollback\n activeSub?.unsubscribe();\n\n rolledBackState.set(false);\n errorState.set(undefined);\n statusState.set('pending');\n\n current.set(newValue);\n\n activeSub = action(newValue)\n .pipe(take(1))\n .subscribe({\n next: (confirmed) => {\n confirmedValue = confirmed;\n current.set(confirmed);\n statusState.set('success');\n activeSub = undefined;\n },\n error: (err: unknown) => {\n // Rollback to last confirmed value (not the stale optimistic one)\n current.set(confirmedValue);\n rolledBackState.set(true);\n errorState.set(err);\n statusState.set('error');\n activeSub = undefined;\n },\n });\n };\n\n return [apply, state];\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, input, output, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent, filter, switchMap, takeUntil, timer, tap, merge } from 'rxjs';\n\n/**\n * Detects long-press gestures via Pointer Events.\n *\n * @category common/interactive/gestures\n *\n * Fires `longPressed` after the pointer is held down for the `threshold` duration\n * without moving more than 10px. Cancels on pointer move (prevents accidental\n * triggers during scrolling), pointer up, pointer cancel, and pointer leave.\n *\n * Exposes `longPressing` signal for real-time visual feedback while the user holds.\n *\n * ### Context menu on long press\n * ```html\n * <div cngxLongPress (longPressed)=\"showContextMenu($event)\">\n * Long press me\n * </div>\n * ```\n *\n * ### With visual feedback\n * ```html\n * <div cngxLongPress #lp=\"cngxLongPress\"\n * [class.holding]=\"lp.longPressing()\">\n * Hold for action\n * </div>\n * ```\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/gestures/long-press.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSwipeDismiss, CngxPressable\n * <example-url>http://localhost:4200/#/common/interactive/gestures/long-press/custom-threshold</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/gestures/long-press/long-press-with-visual-feedback</example-url>\n */\n@Directive({\n selector: '[cngxLongPress]',\n exportAs: 'cngxLongPress',\n standalone: true,\n})\nexport class CngxLongPress {\n /** Time in ms the pointer must be held to trigger. */\n readonly threshold = input<number>(500);\n /** Whether the directive is active. */\n readonly enabled = input<boolean>(true);\n /** Maximum pointer movement in px before the gesture is cancelled. */\n readonly moveThreshold = input<number>(10);\n\n /** Emitted when a long-press gesture completes. */\n readonly longPressed = output<PointerEvent>();\n\n private readonly longPressingState = signal(false);\n /** Whether a long-press gesture is currently building (pointer held, timer running). */\n readonly longPressing = this.longPressingState.asReadonly();\n\n constructor() {\n const el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n const doc = inject(DOCUMENT);\n\n // up/move on document so the gesture survives drifting outside the host.\n const pointerDown$ = fromEvent<PointerEvent>(el, 'pointerdown');\n const pointerUp$ = fromEvent<PointerEvent>(doc, 'pointerup');\n const pointerMove$ = fromEvent<PointerEvent>(doc, 'pointermove');\n const pointerCancel$ = fromEvent<PointerEvent>(el, 'pointercancel');\n const pointerLeave$ = fromEvent<PointerEvent>(el, 'pointerleave');\n\n pointerDown$\n .pipe(\n filter(() => this.enabled()),\n switchMap((start) => {\n const startX = start.clientX;\n const startY = start.clientY;\n this.longPressingState.set(true);\n\n const cancel$ = merge(\n pointerUp$,\n pointerCancel$,\n pointerLeave$,\n pointerMove$.pipe(\n filter((move) => {\n const dx = move.clientX - startX;\n const dy = move.clientY - startY;\n return Math.hypot(dx, dy) > this.moveThreshold();\n }),\n ),\n ).pipe(tap(() => this.longPressingState.set(false)));\n\n return timer(this.threshold()).pipe(\n tap(() => {\n this.longPressingState.set(false);\n this.longPressed.emit(start);\n }),\n takeUntil(cancel$),\n );\n }),\n takeUntilDestroyed(),\n )\n .subscribe();\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { computed, Directive, ElementRef, inject, input, output, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent, merge, switchMap, takeUntil, tap, filter, map } from 'rxjs';\n\nimport type { SwipeAxis, SwipeDirection } from './swipe-direction';\n\ninterface SwipeReading {\n readonly direction: SwipeDirection;\n readonly distance: number;\n}\n\n/**\n * Detects directional swipe gestures via Pointer Events and reports the\n * resolved direction.\n *\n * @category common/interactive/gestures\n *\n * Generic navigation atom: unlike {@link CngxSwipeDismiss} (one fixed\n * direction, dismiss intent), this emits `swiped` with the dominant\n * direction so a single host can drive bidirectional flows - carousels,\n * paged views, prev/next steppers. The `axis` input pins the gesture to\n * horizontal or vertical so an orthogonal scroll never fires it.\n * Exposes `swiping`, `swipeProgress`, and `swipeDirection` signals for\n * real-time feedback mid-gesture.\n *\n * ### Carousel: route left/right into a presenter\n * ```html\n * <section cngxSwipe axis=\"x\" (swiped)=\"onSwipe($event)\">…</section>\n * ```\n * ```ts\n * onSwipe(direction: SwipeDirection): void {\n * if (direction === 'left') {\n * this.next();\n * } else if (direction === 'right') {\n * this.previous();\n * }\n * }\n * ```\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/gestures/swipe.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSwipeDismiss, CngxLongPress\n * <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/mobile-carousel</example-url>\n */\n@Directive({\n selector: '[cngxSwipe]',\n exportAs: 'cngxSwipe',\n standalone: true,\n host: {\n // Communicate the gesture's axis intent to the browser so it\n // never claims the swipe as a scroll. Derived from `axis`, not\n // hand-set in consumer CSS: every host of this directive gets the\n // correct touch-action for free instead of re-discovering the bug.\n '[style.touch-action]': 'touchAction()',\n // Scope user-select suppression to the in-flight gesture. A\n // bare `user-select: none` on the host kills text selection\n // permanently inside the swipe surface even when the user is\n // just reading; gating on `swiping()` keeps the gesture-vs-\n // selection arbitration tight to the drag.\n '[style.user-select]': \"swiping() ? 'none' : null\",\n '[style.-webkit-user-select]': \"swiping() ? 'none' : null\",\n },\n})\nexport class CngxSwipe {\n /** Minimum distance in px on the dominant axis to register a swipe. */\n readonly threshold = input<number>(50);\n /** Axis the gesture is allowed to register on. */\n readonly axis = input<SwipeAxis>('both');\n /** Whether the directive is active. */\n readonly enabled = input<boolean>(true);\n /** Emitted with the dominant direction when a swipe passes the threshold. */\n readonly swiped = output<SwipeDirection>();\n\n private readonly swipingState = signal(false);\n private readonly swipeProgressState = signal(0);\n private readonly swipeDirectionState = signal<SwipeDirection | null>(null);\n\n /** Whether a swipe gesture is currently in progress. */\n readonly swiping = this.swipingState.asReadonly();\n /** Progress of the current swipe from 0 to 1 (clamped). */\n readonly swipeProgress = this.swipeProgressState.asReadonly();\n /** Dominant direction of the in-flight gesture, or `null` when idle. */\n readonly swipeDirection = this.swipeDirectionState.asReadonly();\n\n /**\n * The `touch-action` the host should advertise, derived from `axis`.\n * A pinned axis hands the orthogonal direction back to native\n * scrolling (`x` -> `pan-y`, `y` -> `pan-x`); `both` claims the\n * whole surface (`none`). When disabled, no value is written so the\n * element keeps its native scroll behaviour untouched.\n */\n protected readonly touchAction = computed<string | null>(() => {\n if (!this.enabled()) {\n return null;\n }\n switch (this.axis()) {\n case 'x':\n return 'pan-y';\n case 'y':\n return 'pan-x';\n default:\n return 'none';\n }\n });\n\n constructor() {\n const nativeEl = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n const doc = inject(DOCUMENT);\n\n const pointerDown$ = fromEvent<PointerEvent>(nativeEl, 'pointerdown');\n const pointerMove$ = fromEvent<PointerEvent>(doc, 'pointermove');\n const pointerUp$ = fromEvent<PointerEvent>(doc, 'pointerup');\n // pointercancel fires when the browser takes the pointer back\n // (system gesture, popup, JS-triggered focus loss). Without an\n // explicit arm the in-flight state would stay stuck at\n // `swiping = true` because pointerup never arrives.\n const pointerCancel$ = fromEvent<PointerEvent>(doc, 'pointercancel');\n\n const resetState = (pointerId: number | undefined): void => {\n if (pointerId !== undefined) {\n try {\n nativeEl.releasePointerCapture(pointerId);\n } catch {\n // releasePointerCapture throws when the pointer is no\n // longer captured (e.g. the browser already released it\n // before firing pointercancel) - safe to ignore.\n }\n }\n this.swipingState.set(false);\n this.swipeProgressState.set(0);\n this.swipeDirectionState.set(null);\n };\n\n pointerDown$\n .pipe(\n filter(() => this.enabled()),\n switchMap((start) => {\n const startX = start.clientX;\n const startY = start.clientY;\n const pointerId = start.pointerId;\n // Capture the pointer on the swipe host so subsequent\n // move / up events route here even when the cursor leaves\n // the original element (real mouse drags drift off the\n // panel into the strip / page chrome and would otherwise\n // skip the directive).\n try {\n nativeEl.setPointerCapture(pointerId);\n } catch {\n // setPointerCapture throws if pointerId is invalid (e.g.\n // synthetic event in some test envs) - safe to ignore.\n }\n\n const settle$ = merge(\n pointerUp$.pipe(\n map((end) => ({\n reading: this.read(startX, startY, end.clientX, end.clientY),\n })),\n ),\n pointerCancel$.pipe(map(() => ({ reading: null }))),\n );\n\n return pointerMove$.pipe(\n tap((move) => {\n const reading = this.read(startX, startY, move.clientX, move.clientY);\n if (reading) {\n this.swipingState.set(true);\n this.swipeDirectionState.set(reading.direction);\n this.swipeProgressState.set(Math.min(1, reading.distance / this.threshold()));\n }\n }),\n takeUntil(\n settle$.pipe(\n tap(({ reading }) => {\n if (reading && reading.distance >= this.threshold()) {\n this.swiped.emit(reading.direction);\n }\n resetState(pointerId);\n }),\n ),\n ),\n );\n }),\n takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n /**\n * Resolve the swipe direction + distance for a pointer delta.\n *\n * When `axis` is pinned, only that axis's delta decides direction\n * and distance - the orthogonal component is irrelevant, not an\n * abort reason. The previous endpoint-dominance check (`|dx| >= |dy|`)\n * discarded a clearly horizontal drag the moment a natural thumb arc\n * left `|dy|` slightly larger at release, which made a pinned swipe\n * register only on a near-perfect straight line. `touch-action`\n * (advertised from the same `axis`) is the real guard against an\n * orthogonal scroll firing the gesture: the browser cancels the\n * pointer before pointerup, so a clean cycle reaching here is already\n * the intended direction. `both` keeps the dominant-axis heuristic.\n */\n private read(startX: number, startY: number, endX: number, endY: number): SwipeReading | null {\n const dx = endX - startX;\n const dy = endY - startY;\n const axis = this.axis();\n\n if (axis === 'x') {\n return { direction: dx < 0 ? 'left' : 'right', distance: Math.abs(dx) };\n }\n if (axis === 'y') {\n return { direction: dy < 0 ? 'up' : 'down', distance: Math.abs(dy) };\n }\n\n const horizontal = Math.abs(dx) >= Math.abs(dy);\n return horizontal\n ? { direction: dx < 0 ? 'left' : 'right', distance: Math.abs(dx) }\n : { direction: dy < 0 ? 'up' : 'down', distance: Math.abs(dy) };\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, input, output, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent, switchMap, takeUntil, tap, filter, map } from 'rxjs';\n\nimport type { SwipeDirection } from './swipe-direction';\n\n/**\n * Detects directional swipe gestures via Pointer Events.\n *\n * @category common/interactive/gestures\n *\n * Generic atom usable for drawers (swipe-to-close), bottom sheets,\n * carousels, and dismissible cards. Emits `swiped` when the gesture\n * completes past the threshold. Exposes `swiping` and `swipeProgress`\n * signals for real-time visual feedback during the gesture.\n *\n * ### Close drawer on swipe-left\n * ```html\n * <nav [cngxDrawerPanel]=\"drawer\"\n * cngxSwipeDismiss=\"left\" (swiped)=\"drawer.close()\">\n * …\n * </nav>\n * ```\n *\n * ### Bottom sheet with progress\n * ```html\n * <div cngxSwipeDismiss=\"down\" #swipe=\"cngxSwipeDismiss\"\n * [style.transform]=\"'translateY(' + (swipe.swipeProgress() * 100) + '%)'\">\n * …\n * </div>\n * ```\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/gestures/swipe-dismiss.directive.ts\n * @since 0.1.0\n * @relatedTo CngxLongPress, CngxDrawer\n * <example-url>http://localhost:4200/#/common/interactive/gestures/swipe-dismiss/directional-swipe</example-url>\n */\n@Directive({\n selector: '[cngxSwipeDismiss]',\n exportAs: 'cngxSwipeDismiss',\n standalone: true,\n})\nexport class CngxSwipeDismiss {\n /** Direction of the swipe that triggers dismissal. */\n readonly direction = input.required<SwipeDirection>({ alias: 'cngxSwipeDismiss' });\n /** Minimum distance in px to register as a completed swipe. */\n readonly threshold = input<number>(50);\n /** Whether the directive is active. */\n readonly enabled = input<boolean>(true);\n /** Emitted when a swipe gesture completes past the threshold. */\n readonly swiped = output<void>();\n\n private readonly swipingState = signal(false);\n private readonly swipeProgressState = signal(0);\n\n /** Whether a swipe gesture is currently in progress. */\n readonly swiping = this.swipingState.asReadonly();\n /** Progress of the current swipe from 0 to 1 (clamped). */\n readonly swipeProgress = this.swipeProgressState.asReadonly();\n\n constructor() {\n const nativeEl = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n const doc = inject(DOCUMENT);\n\n const pointerDown$ = fromEvent<PointerEvent>(nativeEl, 'pointerdown');\n const pointerMove$ = fromEvent<PointerEvent>(doc, 'pointermove');\n const pointerUp$ = fromEvent<PointerEvent>(doc, 'pointerup');\n\n pointerDown$\n .pipe(\n filter(() => this.enabled()),\n switchMap((start) => {\n const startX = start.clientX;\n const startY = start.clientY;\n\n return pointerMove$.pipe(\n tap((move) => {\n const delta = this.getDelta(startX, startY, move.clientX, move.clientY);\n if (delta > 0) {\n this.swipingState.set(true);\n this.swipeProgressState.set(Math.min(1, delta / this.threshold()));\n }\n }),\n takeUntil(\n pointerUp$.pipe(\n map((end) => this.getDelta(startX, startY, end.clientX, end.clientY)),\n tap((delta) => {\n if (delta >= this.threshold()) {\n this.swiped.emit();\n }\n this.swipingState.set(false);\n this.swipeProgressState.set(0);\n }),\n ),\n ),\n );\n }),\n takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n private getDelta(startX: number, startY: number, endX: number, endY: number): number {\n const dir = this.direction();\n switch (dir) {\n case 'left':\n return startX - endX;\n case 'right':\n return endX - startX;\n case 'up':\n return startY - endY;\n case 'down':\n return endY - startY;\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n afterNextRender,\n computed,\n inject,\n input,\n isDevMode,\n output,\n signal,\n type Signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { filter, fromEvent, map, merge, switchMap, takeUntil, tap } from 'rxjs';\n\n/**\n * Modifier key that arms the keyboard-reorder handler. Plain arrow keys\n * keep their default meaning (focus navigation) - only the configured\n * modifier + arrow produces a move.\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/reorder.directive.ts\n * @since 0.1.0\n */\nexport type CngxReorderModifier = 'ctrl' | 'alt' | 'meta';\n\n/**\n * Payload emitted by `(reordered)` whenever a pointer drag or a modifier +\n * arrow keyboard move settles on a new position.\n *\n * `next` is a fresh array - the source signal is never mutated in place,\n * so downstream `computed()` graphs see a new reference and re-evaluate.\n * Consumers own the write back to the source signal (directly, or via a\n * commit controller for optimistic / pessimistic policies).\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/reorder.directive.ts\n * @since 0.1.0\n */\nexport interface CngxReorderEvent<T> {\n readonly fromIndex: number;\n readonly toIndex: number;\n readonly next: readonly T[];\n}\n\n/** @internal */\ninterface ActiveDrag {\n readonly pointerId: number;\n readonly fromIndex: number;\n readonly currentIndex: number;\n}\n\n/**\n * Level-2 atom that turns any flat container into a reorderable list.\n *\n * **Pointer flow.** A `pointerdown` on a drag-handle (any element matching\n * `handleSelector`) inside an item (any element matching `itemSelector`)\n * starts a drag. Pointer capture stays on the host so the gesture keeps\n * tracking when the user drifts outside the container. The drop target is\n * resolved from `document.elementFromPoint` on every `pointermove`. The\n * drag ends on `pointerup`, `pointercancel`, or a top-level `Escape`\n * press - only the first two emit `reordered`; Escape cancels the drag\n * without a mutation.\n *\n * **Keyboard flow.** When the focused element is inside an item and the\n * configured modifier + `ArrowLeft` / `ArrowRight` / `Home` / `End` is\n * pressed, the directive emits `reordered` with the new array and lets\n * the consumer re-focus the moved item (usually via `afterNextRender`).\n *\n * **Forms / commit action agnostic.** The directive never writes to the\n * source signal; it only emits events. Composers (e.g.\n * `CngxReorderableMultiSelect`) route the emission through their commit\n * controller so optimistic / pessimistic behaviour stays owned by the\n * composing component, not by this atom.\n *\n * ### Basic chip-strip reorder\n * ```html\n * <span class=\"chip-strip\" [cngxReorder]=\"values\" (reordered)=\"apply($event)\">\n * @for (v of values(); track v; let i = $index) {\n * <span class=\"chip\" [attr.data-reorder-index]=\"i\">\n * <button cngxReorderHandle aria-label=\"Verschieben\">⋮⋮</button>\n * {{ v.label }}\n * </span>\n * }\n * </span>\n * ```\n *\n * @category common/interactive/reorder\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/reorder.directive.ts\n * @since 0.1.0\n * @relatedTo CngxReorderableMultiSelect, CngxChipStripRovingController\n * <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/basic-drag-chips-via-mouse-touch</example-url>\n * <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/commit-action-optimistic-pessimistic-with-supersede</example-url>\n * <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/keyboard-reorder-alt-arrow-home-end</example-url>\n * <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/optional-drag-handle-glyph</example-url>\n * <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/pre-seeded-values-reorder-log</example-url>\n */\n@Directive({\n selector: '[cngxReorder]',\n exportAs: 'cngxReorder',\n standalone: true,\n host: {\n '[class.cngx-reorder-container]': 'true',\n '[class.cngx-reorder-dragging]': 'dragging()',\n },\n})\nexport class CngxReorder<T = unknown> {\n /**\n * Signal describing the current, authoritative order. The directive\n * reads it lazily at drag-start and at keyboard-move time so drag\n * sessions always resolve against the freshest value - consumers that\n * mutate the source signal during a drag (rare) still get consistent\n * results.\n */\n readonly items = input.required<Signal<readonly T[]>>({ alias: 'cngxReorder' });\n\n /**\n * CSS selector matched against `pointerdown` targets (via\n * `Element.closest`) to decide whether the gesture starts. Defaults\n * cover both the convention-based attribute hook\n * `[data-reorder-handle]` and the explicit semantic selector\n * `[cngxReorderHandle]` so consumers can pick whichever reads better\n * in their template.\n */\n readonly handleSelector = input<string>('[cngxReorderHandle], [data-reorder-handle]');\n\n /**\n * CSS selector matched against every reorderable child (via\n * `Element.closest`). The matched element's `data-reorder-index`\n * attribute is parsed as the `fromIndex` / `toIndex` used in the\n * emission.\n */\n readonly itemSelector = input<string>('[data-reorder-index]');\n\n /**\n * Optional escape-hatch selector for drag targets. When set and the\n * `pointerdown` target matches `ignoreSelector` (via `closest`), the\n * gesture is dropped - useful when the whole item is draggable but\n * interactive children (close buttons, inline edit fields, menu\n * triggers) must keep their own click semantics. Applied after\n * `handleSelector`, so the two can overlap: e.g.\n * `handleSelector = '[data-reorder-index]'` +\n * `ignoreSelector = 'button, a, [contenteditable]'` yields\n * whole-row drag with interactive child exemptions.\n *\n * `null` (default) disables the filter - the `handleSelector` alone\n * decides whether a drag starts.\n */\n readonly ignoreSelector = input<string | null>(null);\n\n /** Modifier key required for keyboard-driven reorder. Defaults to `'alt'`. */\n readonly keyboardModifier = input<CngxReorderModifier>('alt');\n\n /** Disables both pointer and keyboard flows. */\n readonly disabled = input<boolean>(false);\n\n /** Emitted once a drag or keyboard move settles on a new position. */\n readonly reordered = output<CngxReorderEvent<T>>();\n\n /** Informational - index of the item picked up by pointer drag. */\n readonly dragStart = output<number>();\n\n /** Informational - fires after `reordered` (or alone, if Escape cancelled). */\n readonly dragEnd = output<void>();\n\n private readonly activeDrag = signal<ActiveDrag | null>(null);\n\n /** `true` while a pointer drag is in progress. */\n readonly dragging = computed(() => this.activeDrag() !== null);\n\n /**\n * Index of the item currently being dragged, or `null` when no drag\n * is active. Useful for applying a `.chip--dragging` class via\n * `@for` index comparison.\n */\n readonly dragFromIndex = computed(() => this.activeDrag()?.fromIndex ?? null);\n\n /**\n * Index of the item the pointer is currently hovering over during a\n * drag, or `null` when no drag is active. Drives ghost-placeholder\n * positioning in the host template.\n */\n readonly dragOverIndex = computed(() => this.activeDrag()?.currentIndex ?? null);\n\n private readonly hostEl = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.wirePointer();\n this.wireKeyboard();\n this.wireDevModeCheck();\n }\n\n private wirePointer(): void {\n const down$ = fromEvent<PointerEvent>(this.hostEl, 'pointerdown');\n const move$ = fromEvent<PointerEvent>(this.doc, 'pointermove');\n const up$ = fromEvent<PointerEvent>(this.doc, 'pointerup');\n const cancel$ = fromEvent<PointerEvent>(this.doc, 'pointercancel');\n const escape$ = fromEvent<KeyboardEvent>(this.doc, 'keydown').pipe(\n filter((e) => e.key === 'Escape'),\n );\n\n interface PointerStart {\n readonly event: PointerEvent;\n readonly fromIndex: number;\n }\n\n down$\n .pipe(\n filter(() => !this.disabled()),\n filter(() => this.activeDrag() === null),\n filter((e) => e.button === 0),\n map((event): PointerStart | null => {\n const target = event.target as Element | null;\n // Escape hatch: interactive children of the item (close\n // buttons, menu triggers, inline edit fields) keep their own\n // click semantics even when the whole row is drag-enabled.\n const ignore = this.ignoreSelector();\n if (ignore && target?.closest(ignore)) {\n return null;\n }\n const handleEl = target?.closest(this.handleSelector()) ?? null;\n if (!handleEl) {\n return null;\n }\n const itemEl = target?.closest<HTMLElement>(this.itemSelector()) ?? null;\n if (!itemEl || !this.hostEl.contains(itemEl)) {\n return null;\n }\n const fromIndex = this.parseIndex(itemEl);\n if (fromIndex < 0) {\n return null;\n }\n return { event, fromIndex };\n }),\n filter((start): start is PointerStart => start !== null),\n switchMap(({ event, fromIndex }) => {\n event.preventDefault();\n try {\n this.hostEl.setPointerCapture?.(event.pointerId);\n } catch {\n /* jsdom / older browsers */\n }\n this.activeDrag.set({\n pointerId: event.pointerId,\n fromIndex,\n currentIndex: fromIndex,\n });\n this.dragStart.emit(fromIndex);\n\n return move$.pipe(\n filter((m) => m.pointerId === event.pointerId),\n tap((m) => {\n const overEl = this.doc.elementFromPoint?.(m.clientX, m.clientY);\n if (!overEl) {\n return;\n }\n const itemEl = overEl.closest<HTMLElement>(this.itemSelector());\n if (!itemEl || !this.hostEl.contains(itemEl)) {\n return;\n }\n const overIndex = this.parseIndex(itemEl);\n if (overIndex < 0) {\n return;\n }\n const active = this.activeDrag();\n if (active && overIndex !== active.currentIndex) {\n this.activeDrag.set({ ...active, currentIndex: overIndex });\n }\n }),\n takeUntil(\n merge(\n up$.pipe(\n filter((u) => u.pointerId === event.pointerId),\n map(() => 'commit' as const),\n ),\n cancel$.pipe(\n filter((c) => c.pointerId === event.pointerId),\n map(() => 'cancel' as const),\n ),\n escape$.pipe(map(() => 'cancel' as const)),\n ).pipe(\n tap((outcome) => {\n try {\n this.hostEl.releasePointerCapture?.(event.pointerId);\n } catch {\n /* capture may have auto-released */\n }\n const active = this.activeDrag();\n this.activeDrag.set(null);\n this.dragEnd.emit();\n if (outcome === 'commit' && active) {\n const { fromIndex: from, currentIndex: to } = active;\n if (to !== from) {\n this.emitMove(from, to);\n }\n }\n // Swallow the `click` the browser synthesises from\n // the mousedown → mouseup pair that framed this\n // gesture. Without this, dragging a chip inside an\n // outer listener (e.g. a combobox trigger's\n // (click)=\"open()\") would toggle the popover\n // alongside the reorder, because the click's target\n // is the common ancestor of mousedown/mouseup - not\n // a descendant that any child-side `stopPropagation`\n // could filter. One-shot, capture-phase, document-\n // wide, removed after the first event.\n this.installClickSuppressor();\n }),\n ),\n ),\n );\n }),\n takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n private wireKeyboard(): void {\n fromEvent<KeyboardEvent>(this.hostEl, 'keydown')\n .pipe(\n filter(() => !this.disabled()),\n filter((e) => this.modifierMatches(e)),\n filter((e) => this.isReorderKey(e.key)),\n tap((e) => {\n const target = e.target as Element | null;\n const itemEl = target?.closest<HTMLElement>(this.itemSelector());\n if (!itemEl || !this.hostEl.contains(itemEl)) {\n return;\n }\n const fromIndex = this.parseIndex(itemEl);\n if (fromIndex < 0) {\n return;\n }\n const current = this.items()();\n const len = current.length;\n if (fromIndex >= len) {\n return;\n }\n let toIndex: number;\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n toIndex = fromIndex - 1;\n break;\n case 'ArrowRight':\n case 'ArrowDown':\n toIndex = fromIndex + 1;\n break;\n case 'Home':\n toIndex = 0;\n break;\n case 'End':\n toIndex = len - 1;\n break;\n default:\n return;\n }\n if (toIndex < 0 || toIndex >= len || toIndex === fromIndex) {\n return;\n }\n e.preventDefault();\n this.emitMove(fromIndex, toIndex, current);\n }),\n takeUntilDestroyed(),\n )\n .subscribe();\n }\n\n private wireDevModeCheck(): void {\n if (!isDevMode()) {\n return;\n }\n afterNextRender(() => {\n const items = this.hostEl.querySelectorAll(this.itemSelector());\n if (items.length === 0) {\n // Not an error - an empty strip is a legitimate idle state.\n // Only warn when the consumer probably forgot to wire the attr.\n return;\n }\n let misconfigured = 0;\n items.forEach((el: Element) => {\n const idx = (el as HTMLElement).dataset['reorderIndex'];\n if (idx == null || !Number.isFinite(Number(idx))) {\n misconfigured += 1;\n }\n });\n if (misconfigured > 0) {\n console.warn(\n `[CngxReorder] ${misconfigured} element(s) match itemSelector ` +\n `\"${this.itemSelector()}\" but carry no numeric data-reorder-index. ` +\n 'Pointer / keyboard moves targeting them will be ignored.',\n );\n }\n });\n }\n\n private parseIndex(el: HTMLElement): number {\n const raw = el.dataset['reorderIndex'];\n if (raw == null) {\n return -1;\n }\n const n = Number.parseInt(raw, 10);\n if (!Number.isFinite(n) || n < 0) {\n return -1;\n }\n return n;\n }\n\n private modifierMatches(event: KeyboardEvent): boolean {\n switch (this.keyboardModifier()) {\n case 'ctrl':\n return event.ctrlKey;\n case 'alt':\n return event.altKey;\n case 'meta':\n return event.metaKey;\n }\n }\n\n private isReorderKey(key: string): boolean {\n return (\n key === 'ArrowLeft' ||\n key === 'ArrowRight' ||\n key === 'ArrowUp' ||\n key === 'ArrowDown' ||\n key === 'Home' ||\n key === 'End'\n );\n }\n\n private emitMove(from: number, to: number, source?: readonly T[]): void {\n const current = source ?? this.items()();\n if (from < 0 || from >= current.length) {\n return;\n }\n const clampedTo = Math.min(Math.max(to, 0), current.length - 1);\n if (clampedTo === from) {\n return;\n }\n const next = this.moveItem(current, from, clampedTo);\n this.reordered.emit({ fromIndex: from, toIndex: clampedTo, next });\n }\n\n private moveItem(arr: readonly T[], from: number, to: number): readonly T[] {\n const copy = arr.slice();\n const [item] = copy.splice(from, 1);\n copy.splice(to, 0, item);\n return copy;\n }\n\n /**\n * Install a one-shot capture-phase listener that cancels the next\n * synthetic `click` (the one browsers derive from the mousedown →\n * mouseup pair that framed the drag gesture). The listener removes\n * itself after the first event, after a short watchdog timeout if\n * no click ever fires (browsers skip the click when mouse travel\n * exceeds the platform drag threshold), and on directive destroy\n * so test fixtures never leak a document-level handler across\n * iterations.\n */\n private installClickSuppressor(): void {\n let cleaned = false;\n const handler = (event: Event): void => {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n cleanup();\n };\n const cleanup = (): void => {\n if (cleaned) {\n return;\n }\n cleaned = true;\n this.doc.removeEventListener('click', handler, true);\n clearTimeout(watchdog);\n };\n this.doc.addEventListener('click', handler, true);\n // Browsers dispatch the click synchronously after pointerup;\n // 50ms covers queuing quirks without lingering past the user's\n // next real click.\n const watchdog = setTimeout(cleanup, 50);\n this.destroyRef.onDestroy(cleanup);\n }\n}\n","import { effect, InjectionToken, signal, untracked, type Signal } from '@angular/core';\n\n/**\n * Configuration for {@link createChipStripRoving}.\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts\n * @since 0.1.0\n */\nexport interface CngxChipStripRovingOptions {\n /**\n * Reactive length of the chip list. When this count shrinks below\n * `activeIndex`, the controller clamps the active index so focus\n * never dangles at a removed position.\n */\n readonly count: Signal<number>;\n /**\n * Element hosting the chip wrappers. Read lazily at `focusAt()` time\n * so the controller doesn't depend on view-init timing. `null` is a\n * legitimate idle state - the controller becomes a no-op focuser.\n */\n readonly container: Signal<HTMLElement | null | undefined>;\n /**\n * Attribute name used to identify each chip wrapper. Combined with\n * the active index into a `[attr=\"index\"]` query. Defaults to\n * `'data-reorder-index'` (matches {@link CngxReorder}'s own item\n * contract, so a single DOM hook covers both the reorder directive\n * and this roving controller).\n */\n readonly indexAttr?: string;\n}\n\n/**\n * Controller produced by {@link createChipStripRoving}. Exposes an\n * `activeIndex` signal the consumer binds into\n * `[attr.tabindex]=\"i === roving.activeIndex() ? 0 : -1\"`, plus a\n * keyboard handler and imperative focus helpers.\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts\n * @since 0.1.0\n */\nexport interface CngxChipStripRovingController {\n /**\n * Current roving position. Clamped to `[0, count - 1]`; resets to\n * `0` when `count` drops to `0`.\n */\n readonly activeIndex: Signal<number>;\n /**\n * Announce that a chip at `index` received focus - typically wired\n * on the chip wrapper's `(focus)`. Idempotent; keeps the active\n * index in sync with whatever the user's focus sequence did (mouse\n * click, Tab into the strip, etc.).\n */\n markFocused(index: number): void;\n /**\n * Keyboard handler for the chip-strip container. Handles plain\n * `ArrowLeft` / `ArrowRight` / `ArrowUp` / `ArrowDown` / `Home` /\n * `End` - moves `activeIndex` and focuses the chip at the new\n * position. Events carrying any of `Ctrl` / `Alt` / `Meta` are\n * ignored (modifier-gated keys belong to the paired\n * {@link CngxReorder} directive).\n */\n handleKeydown(event: KeyboardEvent): void;\n /**\n * Imperatively set the active index and focus the corresponding\n * chip. Used by consumers to restore focus after a reorder settles\n * on a new position.\n */\n focusAt(index: number): void;\n /**\n * Imperatively set the active index without moving focus. Useful\n * during a reorder's transient pre-render phase where the DOM has\n * not yet re-ordered the chips.\n */\n setActive(index: number): void;\n}\n\n/**\n * Signature of the factory behind {@link CNGX_CHIP_STRIP_ROVING_FACTORY}.\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts\n * @since 0.1.0\n */\nexport type CngxChipStripRovingFactory = (\n opts: CngxChipStripRovingOptions,\n) => CngxChipStripRovingController;\n\n/**\n * Plain factory for the chip-strip roving-tabindex controller shared by\n * {@link CngxReorderableMultiSelect} today and by any future\n * reorder-aware chip trigger (e.g. a tag-input with user-defined\n * ordering). Extracted from the component so the same focus-state\n * machine doesn't reappear inline in every variant.\n *\n * **Why not `CngxRovingTabindex`.** That directive uses a host\n * `(keydown)` listener that doesn't check modifier keys. Co-located\n * with {@link CngxReorder} on the same chip-strip element it\n * double-fires on `Ctrl+Arrow` (the reorder emits, then roving also\n * moves focus - racy). This controller deliberately skips\n * modifier-pressed events so the paired reorder directive owns that\n * gesture.\n *\n * **Injection context.** Must be called in an injection context\n * (component constructor / field init) because it installs an * `effect()` for the active-index clamp on count shrink.\n *\n * @category common/interactive/reorder\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts\n * @since 0.1.0\n */\nexport function createChipStripRoving(\n opts: CngxChipStripRovingOptions,\n): CngxChipStripRovingController {\n const attr = opts.indexAttr ?? 'data-reorder-index';\n const activeIndexState = signal<number>(0);\n\n // Clamp on count shrink - a removed-last-chip or clear-all must not\n // leave `activeIndex` pointing past the end. Reading the signal\n // inside `untracked()` avoids a self-dependency, so the effect's\n // only reactive dep is `count()`.\n effect(() => {\n const len = opts.count();\n untracked(() => {\n const current = activeIndexState();\n if (len === 0) {\n if (current !== 0) {\n activeIndexState.set(0);\n }\n } else if (current >= len) {\n activeIndexState.set(len - 1);\n }\n });\n });\n\n function focusAt(index: number): void {\n setActive(index);\n const root = opts.container();\n if (!root) {\n return;\n }\n const el = root.querySelector<HTMLElement>(`[${attr}=\"${index}\"]`);\n el?.focus();\n }\n\n function setActive(index: number): void {\n activeIndexState.set(index);\n }\n\n function markFocused(index: number): void {\n activeIndexState.set(index);\n }\n\n function handleKeydown(event: KeyboardEvent): void {\n if (event.ctrlKey || event.altKey || event.metaKey) {\n return;\n }\n const count = opts.count();\n if (count === 0) {\n return;\n }\n const current = activeIndexState();\n let nextIdx: number;\n switch (event.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n nextIdx = Math.max(0, current - 1);\n break;\n case 'ArrowRight':\n case 'ArrowDown':\n nextIdx = Math.min(count - 1, current + 1);\n break;\n case 'Home':\n nextIdx = 0;\n break;\n case 'End':\n nextIdx = count - 1;\n break;\n default:\n return;\n }\n event.preventDefault();\n if (nextIdx === current) {\n return;\n }\n focusAt(nextIdx);\n }\n\n return {\n activeIndex: activeIndexState.asReadonly(),\n markFocused,\n handleKeydown,\n focusAt,\n setActive,\n };\n}\n\n/**\n * DI token resolving the factory used to instantiate a\n * {@link CngxChipStripRovingController}. Defaults to\n * {@link createChipStripRoving}; override via\n * `providers: [{ provide: CNGX_CHIP_STRIP_ROVING_FACTORY, useValue: customFactory }]`\n * or per-component via `viewProviders` to install telemetry wrappers,\n * a controlled-from-outside focus mode, or a custom keyboard policy\n * without forking the reorderable component.\n *\n * Symmetrical to {@link CNGX_TREE_CONTROLLER_FACTORY} /\n * `CNGX_SELECTION_CONTROLLER_FACTORY`.\n *\n * @category common/interactive/reorder\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts\n * @since 0.1.0\n */\nexport const CNGX_CHIP_STRIP_ROVING_FACTORY = new InjectionToken<CngxChipStripRovingFactory>(\n 'CngxChipStripRovingFactory',\n {\n providedIn: 'root',\n factory: () => createChipStripRoving,\n },\n);\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, input, output } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent, filter } from 'rxjs';\nimport { type KeyCombo, matchesKeyCombo, parseKeyCombo } from '@cngx/core/utils';\n\n/** @internal Input element tag names where global shortcuts should not fire. */\nconst INPUT_TAGS = new Set(['INPUT', 'TEXTAREA', 'SELECT']);\n\n/**\n * Declarative keyboard shortcut handler.\n *\n * @category common/interactive/keyboard\n *\n * Binds a keyboard shortcut to the host element without global event listeners\n * in a service. Supports `mod` as a platform-aware modifier (`Meta` on macOS,\n * `Ctrl` elsewhere).\n *\n * Two scopes: `'global'` (default) listens on `document` and ignores events\n * from input elements; `'self'` listens only on the host element.\n *\n * Uses `parseKeyCombo` and `matchesKeyCombo` from `@cngx/core/utils`.\n *\n * ### Global save shortcut\n * ```html\n * <button [cngxKeyboardShortcut]=\"'mod+s'\" (shortcutTriggered)=\"save()\">\n * Save\n * </button>\n * ```\n *\n * ### Scoped escape handler\n * ```html\n * <div [cngxKeyboardShortcut]=\"'escape'\" [shortcutScope]=\"'self'\"\n * (shortcutTriggered)=\"close()\" tabindex=\"0\">\n * Press Escape to close\n * </div>\n * ```\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/keyboard/keyboard-shortcut.directive.ts\n * @since 0.1.0\n * @relatedTo CngxClickOutside, CngxSearch\n * <example-url>http://localhost:4200/#/common/interactive/gestures/keyboard-shortcut/global-shortcut</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/gestures/keyboard-shortcut/self-scoped-shortcut</example-url>\n */\n@Directive({\n selector: '[cngxKeyboardShortcut]',\n exportAs: 'cngxKeyboardShortcut',\n standalone: true,\n})\nexport class CngxKeyboardShortcut {\n /** Shortcut combo string, e.g. `'mod+s'`, `'ctrl+shift+k'`, `'escape'`. */\n readonly shortcut = input.required<string>({ alias: 'cngxKeyboardShortcut' });\n /** `'global'` listens on document; `'self'` listens only on the host element. */\n readonly scope = input<'global' | 'self'>('global', { alias: 'shortcutScope' });\n /** Whether the shortcut is active. */\n readonly enabled = input<boolean>(true);\n\n /** Emitted when the shortcut fires. */\n readonly shortcutTriggered = output<KeyboardEvent>();\n\n constructor() {\n const el = inject(ElementRef<HTMLElement>).nativeElement as HTMLElement;\n const doc = inject(DOCUMENT);\n const isMac = doc.defaultView ? /mac/i.test(doc.defaultView.navigator.platform) : false;\n\n // Both streams stay subscribed; scope() gates inside the filter so\n // toggling scope at runtime doesn't churn subscriptions.\n const globalKeydown$ = fromEvent<KeyboardEvent>(doc, 'keydown');\n const selfKeydown$ = fromEvent<KeyboardEvent>(el, 'keydown');\n\n globalKeydown$\n .pipe(\n filter(() => this.enabled() && this.scope() === 'global'),\n filter((event) => !this.isInputElement(event.target)),\n filter((event) => this.matchesShortcut(event, isMac)),\n takeUntilDestroyed(),\n )\n .subscribe((event) => {\n event.preventDefault();\n this.shortcutTriggered.emit(event);\n });\n\n selfKeydown$\n .pipe(\n filter(() => this.enabled() && this.scope() === 'self'),\n filter((event) => this.matchesShortcut(event, isMac)),\n takeUntilDestroyed(),\n )\n .subscribe((event) => {\n event.preventDefault();\n this.shortcutTriggered.emit(event);\n });\n }\n\n /** Tests the keyboard event against the current shortcut combo. */\n private matchesShortcut(event: KeyboardEvent, isMac: boolean): boolean {\n const combo = this.parseCurrentCombo();\n return combo !== null && matchesKeyCombo(event, combo, isMac);\n }\n\n private parsedCombo: KeyCombo | null = null;\n private parsedComboStr = '';\n\n /** Parses the shortcut string, memoising the result to avoid re-parsing on every keystroke. */\n private parseCurrentCombo(): KeyCombo | null {\n const str = this.shortcut();\n if (str !== this.parsedComboStr) {\n this.parsedComboStr = str;\n\n this.parsedCombo = parseKeyCombo(str);\n }\n return this.parsedCombo;\n }\n\n /**\n * Guards global shortcuts from firing when the user is typing in a form field\n * or contenteditable region. Self-scoped shortcuts skip this check.\n */\n private isInputElement(target: EventTarget | null): boolean {\n if (!target || !(target instanceof HTMLElement)) {\n return false;\n }\n return INPUT_TAGS.has(target.tagName) || target.isContentEditable;\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n output,\n Renderer2,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent, map, switchMap, timer } from 'rxjs';\n\n/**\n * Debounced search term tracker for `<input>` elements.\n *\n * @category common/interactive/keyboard\n *\n * Converts the DOM `input` event stream into a debounced Signal. The raw\n * Observable is never exposed - signal at the API boundary.\n *\n * ### Basic usage\n * ```html\n * <input cngxSearch #search=\"cngxSearch\" placeholder=\"Search...\" />\n * <button (click)=\"search.clear()\">Clear</button>\n * ```\n *\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/keyboard/search.directive.ts\n * @since 0.1.0\n * @relatedTo CngxKeyboardShortcut, CngxListboxSearch\n */\n@Directive({\n selector: 'input[cngxSearch]',\n exportAs: 'cngxSearch',\n standalone: true,\n})\nexport class CngxSearch {\n /** Debounce delay in milliseconds. @defaultValue 300 */\n readonly debounceMs = input<number>(300);\n\n private readonly termState = signal('');\n /** The current (debounced) search term. */\n readonly term = this.termState.asReadonly();\n /** `true` when the search term is non-empty. */\n readonly hasValue = computed(() => this.termState().length > 0);\n\n /** Emitted after each debounced input event with the new term. */\n readonly searchChange = output<string>();\n\n private readonly el = inject(ElementRef<HTMLInputElement>);\n private readonly renderer = inject(Renderer2);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n fromEvent<InputEvent>(this.el.nativeElement as HTMLInputElement, 'input')\n .pipe(\n map((e) => (e.target as HTMLInputElement).value),\n switchMap((value) => timer(this.debounceMs()).pipe(map(() => value))),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe((term) => {\n this.termState.set(term);\n this.searchChange.emit(term);\n });\n }\n\n /** Clears the search term and resets the input element value. */\n clear(): void {\n this.termState.set('');\n this.renderer.setProperty(this.el.nativeElement, 'value', '');\n this.searchChange.emit('');\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, ElementRef, inject, input, output } from '@angular/core';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { fromEvent, switchMap } from 'rxjs';\n\n/**\n * Emits when the user interacts outside the host element.\n *\n * @category common/interactive/keyboard\n *\n * Listens for a configurable DOM event on the document and checks whether\n * the event target is outside the host element's subtree. Useful for closing\n * dropdowns, popovers, modals, and any overlay that should dismiss on\n * outside interaction.\n *\n * The event type defaults to `'pointerdown'` which covers mouse, touch, and\n * pen input. Change it via the `[eventType]` input.\n *\n * ### Dropdown dismiss\n * ```html\n * <div cngxClickOutside (clickOutside)=\"closeDropdown()\" [enabled]=\"isOpen()\">\n * <ul>…menu items…</ul>\n * </div>\n * ```\n *\n * ### With custom event type\n * ```html\n * <div cngxClickOutside [eventType]=\"'click'\" (clickOutside)=\"dismiss()\">…</div>\n * ```\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/keyboard/click-outside.directive.ts\n * @since 0.1.0\n * @relatedTo CngxKeyboardShortcut, CngxPopover\n * <example-url>http://localhost:4200/#/common/interactive/gestures/click-outside/dropdown</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/gestures/click-outside/enabled-toggle</example-url>\n */\n@Directive({\n selector: '[cngxClickOutside]',\n exportAs: 'cngxClickOutside',\n standalone: true,\n})\nexport class CngxClickOutside {\n /** The DOM event type to listen for. `'pointerdown'` covers both mouse and touch. */\n readonly eventType = input<'pointerdown' | 'click' | 'mousedown' | 'touchstart'>('pointerdown');\n /** When `false` the directive is disabled and no events are emitted. */\n readonly enabled = input<boolean>(true);\n /** Emitted when the user interacts outside the host element. */\n readonly clickOutside = output<PointerEvent | MouseEvent | TouchEvent>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n\n constructor() {\n toObservable(this.eventType)\n .pipe(\n switchMap((type) => fromEvent<PointerEvent | MouseEvent | TouchEvent>(this.doc, type)),\n takeUntilDestroyed(),\n )\n .subscribe((e) => {\n if (this.enabled() && !(this.el.nativeElement as HTMLElement).contains(e.target as Node)) {\n this.clickOutside.emit(e);\n }\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, inject, input } from '@angular/core';\n\n/**\n * Prevents accidental page navigation when there are unsaved changes.\n *\n * @category common/interactive/guard\n *\n * Sets a `beforeunload` event handler that shows the browser's native\n * confirmation dialog when `enabled` is `true`. Does NOT integrate with\n * the Angular Router - for route guard protection, use `canDeactivateWhenClean()`.\n *\n * ### Protect a form\n * ```html\n * <form [cngxBeforeUnload]=\"form.dirty()\">\n * …\n * </form>\n * ```\n *\n * ### Combined with route guard\n * ```typescript\n * // In route config:\n * { path: 'edit', component: EditComponent, canDeactivate: [canDeactivateWhenClean(() => editForm.dirty())] }\n *\n * // In template:\n * <form [cngxBeforeUnload]=\"editForm.dirty()\">…</form>\n * ```\n *\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/guard/before-unload.directive.ts\n * @since 0.1.0\n * @relatedTo canDeactivateWhenClean\n */\n@Directive({\n selector: '[cngxBeforeUnload]',\n exportAs: 'cngxBeforeUnload',\n standalone: true,\n})\nexport class CngxBeforeUnload {\n /** Whether the beforeunload guard is active. */\n readonly enabled = input.required<boolean>({ alias: 'cngxBeforeUnload' });\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n if (!win) {\n return;\n }\n\n const handler = (event: BeforeUnloadEvent) => {\n if (this.enabled()) {\n event.preventDefault();\n }\n };\n\n win.addEventListener('beforeunload', handler);\n inject(DestroyRef).onDestroy(() => win.removeEventListener('beforeunload', handler));\n }\n}\n","import { inject } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\n\n/**\n * Creates a functional route guard that blocks navigation when the form is dirty.\n *\n * Works with Angular's `CanDeactivateFn`. The `isDirty` callback is evaluated\n * on each navigation attempt. When dirty, shows a `confirm` dialog.\n *\n * Uses `DOCUMENT` injection for SSR safety — returns `true` (allow) when\n * no window is available.\n *\n * Pair with `CngxBeforeUnload` for full coverage (browser close + route change):\n *\n * ```typescript\n * // Route config\n * {\n * path: 'edit',\n * component: EditComponent,\n * canDeactivate: [canDeactivateWhenClean(() => inject(EditComponent).isDirty())]\n * }\n * ```\n *\n * @param isDirty - Callback that returns `true` when there are unsaved changes.\n * @param message - Confirmation message. Default: `'You have unsaved changes. Leave anyway?'`\n * @returns A functional guard compatible with Angular's `canDeactivate`.\n *\n * @category common/interactive/guard\n */\nexport function canDeactivateWhenClean(\n isDirty: () => boolean,\n message = 'You have unsaved changes. Leave anyway?',\n): () => boolean {\n return () => {\n if (!isDirty()) {\n return true;\n }\n // inject() is valid here — Angular calls the guard in an injection context\n const win = inject(DOCUMENT).defaultView;\n if (!win) {\n return true;\n }\n return win.confirm(message);\n };\n}\n","import { NgComponentOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n InjectionToken,\n inject,\n input,\n type Type,\n ViewEncapsulation,\n} from '@angular/core';\n\n/**\n * Injection token for a custom close icon component.\n * Set via `provideFeedback(withCloseIcon(MyIcon))` which forwards to this token.\n *\n * @category common/interactive\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/close-button/close-button.ts\n * @since 0.1.0\n */\nexport const CNGX_CLOSE_ICON = new InjectionToken<Type<unknown>>('CngxCloseIcon');\n\n/**\n * Shared close/dismiss button molecule.\n *\n * Composes the native `<button>` shell with an optional projected icon\n * and the `CNGX_CLOSE_ICON` DI swap; owns ARIA wiring, focus ring,\n * density, and a default X glyph as the projection fallback.\n *\n * Used internally by `CngxAlert`, `CngxToastOutlet`, and `CngxPopoverPanel`.\n * Can also be used standalone by consumers for dialogs, drawers, chips, etc.\n *\n * All visual properties are CSS Custom Properties - density is controlled\n * via the `feedback.density()` SCSS mixin or direct overrides.\n *\n * ### Standalone\n * ```html\n * <cngx-close-button label=\"Close dialog\" (click)=\"close()\" />\n * ```\n *\n * ### Inside a component (click handled by parent)\n * ```html\n * <cngx-close-button label=\"Close\" />\n * ```\n *\n * @category common/interactive\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/close-button/close-button.ts\n * @since 0.1.0\n * @relatedTo CNGX_CLOSE_ICON, CngxAlert, CngxToastOutlet, CngxPopover\n * <example-url>http://localhost:4200/#/common/interactive/close-button/basic</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/close-button/projected-icon</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/close-button/contextual-labels</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/close-button/inside-a-dismissible-card</example-url>\n */\n@Component({\n selector: 'cngx-close-button',\n standalone: true,\n imports: [NgComponentOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-close-button',\n },\n template: `\n <button type=\"button\" class=\"cngx-close-button__btn\" [attr.aria-label]=\"label()\">\n <ng-content>\n @if (customIcon) {\n <ng-container *ngComponentOutlet=\"customIcon\" />\n } @else {\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"cngx-close-button__icon\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n }\n </ng-content>\n </button>\n `,\n styleUrls: ['./close-button.css'],\n})\nexport class CngxCloseButton {\n /**\n * Required accessible label for the inner `<button>` (`aria-label`).\n * Describe the dismissable artifact, not the affordance:\n * `\"Close session-expired alert\"`, not `\"Close\"`. A bare `\"Close\"`\n * reads identically across every dismiss target on the page.\n */\n readonly label = input.required<string>();\n\n /** @internal - global icon from CNGX_CLOSE_ICON token. */\n protected readonly customIcon = inject(CNGX_CLOSE_ICON, { optional: true });\n}\n","import { Directive, signal } from '@angular/core';\n\n/**\n * Tracks whether the host element is currently hovered via mouse pointer.\n *\n * @category common/interactive\n *\n * Designed as a `hostDirective` composition primitive - attach it to\n * components that need hover state without implementing their own\n * mouseenter/mouseleave logic. The `hovered` signal is writable so\n * host components can read it via `inject(CngxHoverable, { host: true })`.\n *\n * Used internally by `CngxTreetableRow` for row highlight-on-hover.\n *\n * ### As hostDirective\n * ```typescript\n * @Component({\n * hostDirectives: [{ directive: CngxHoverable }],\n * })\n * export class MyCard {\n * private readonly hover = inject(CngxHoverable, { host: true });\n * readonly isHovered = this.hover.hovered; // Signal<boolean>\n * }\n * ```\n *\n * ### Standalone\n * ```html\n * <div cngxHoverable #h=\"cngxHoverable\" [class.highlight]=\"h.hovered()\">\n * Hover me\n * </div>\n * ```\n *\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/hoverable/hoverable.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPressable, CngxRipple\n */\n@Directive({\n selector: '[cngxHoverable]',\n standalone: true,\n exportAs: 'cngxHoverable',\n host: {\n '(mouseenter)': 'hovered.set(true)',\n '(mouseleave)': 'hovered.set(false)',\n },\n})\nexport class CngxHoverable {\n /** `true` while the pointer is over the host element. */\n readonly hovered = signal(false);\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n signal,\n} from '@angular/core';\n\n/**\n * Headless text-to-speech directive using the browser's SpeechSynthesis API.\n *\n * @category common/interactive\n *\n * A read-aloud feature for cognitive accessibility - dyslexia support, reading\n * assistance, or convenience. Not a screen reader replacement (use\n * `CngxLiveRegion` for ARIA live regions).\n *\n * The directive is purely behavioral: it exposes `speaking()` and `supported()`\n * signals plus `speak()` / `cancel()` methods. The consumer renders their own\n * UI (button, icon, link) and calls the methods via the template reference.\n *\n * Pair with `CngxSpeakButton` (`@cngx/ui`) for a ready-made speaker button.\n *\n * ### Headless - consumer-owned button\n * ```html\n * <p [cngxSpeak]=\"text\" #tts=\"cngxSpeak\">\n * {{ text }}\n * <button (click)=\"tts.toggle()\">{{ tts.speaking() ? 'Stop' : 'Listen' }}</button>\n * </p>\n * ```\n *\n * ### Auto-speak on dynamic value change\n * ```html\n * <div [cngxSpeak]=\"notification()\">{{ notification() }}</div>\n * ```\n *\n * ### With CngxSpeakButton (from @cngx/ui)\n * ```html\n * <span [cngxSpeak]=\"text\" #tts=\"cngxSpeak\">{{ text }}</span>\n * <cngx-speak-button [speakRef]=\"tts\" />\n * ```\n *\n * ### Suppress auto-speak for dynamic values\n * ```html\n * <div [cngxSpeak]=\"liveCounter()\" [enabled]=\"false\" #tts=\"cngxSpeak\">\n * {{ liveCounter() }}\n * <button (click)=\"tts.speak(liveCounter().toString())\">Read current value</button>\n * </div>\n * ```\n * @docsKind primary\n * @wcag AAA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/speak/speak.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSpeakButton, CngxLiveRegion\n * <example-url>http://localhost:4200/#/common/interactive/speak/form-error-read-aloud-on-demand</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/speak/headless-read-aloud</example-url>\n * <example-url>http://localhost:4200/#/ui/speak/speak-button/material-integration-theme-scss-mat-icon-button</example-url>\n * <example-url>http://localhost:4200/#/ui/speak/speak-button/styled-speaker-icon</example-url>\n * <example-url>http://localhost:4200/#/ui/speak/speak-button/theming-css-custom-properties</example-url>\n */\n@Directive({\n selector: '[cngxSpeak]',\n exportAs: 'cngxSpeak',\n standalone: true,\n})\nexport class CngxSpeak {\n /** Text to speak. When `enabled` is `true`, speech triggers on every change to a non-empty value. */\n readonly text = input.required<string>({ alias: 'cngxSpeak' });\n\n /** Speech rate (0.1–10, default 1). */\n readonly rate = input(1);\n /** Speech pitch (0–2, default 1). */\n readonly pitch = input(1);\n /** Speech volume (0–1, default 1). */\n readonly volume = input(1);\n /** BCP 47 language tag (e.g. `'de-DE'`). Empty string uses the browser default. */\n readonly lang = input('');\n /** Controls auto-speak on text changes. Does NOT affect `speak()` or `cancel()`. */\n readonly enabled = input(true);\n\n private readonly speakingState = signal(false);\n private readonly supportedState: boolean;\n private readonly synth: SpeechSynthesis | null;\n private readonly initialized = signal(false);\n\n /** Whether the browser supports the SpeechSynthesis API. */\n readonly supported: boolean;\n\n /** `true` while an utterance is being spoken. */\n readonly speaking = this.speakingState.asReadonly();\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n this.synth = win?.speechSynthesis ?? null;\n this.supportedState = !!this.synth;\n this.supported = this.supportedState;\n\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n const value = this.text();\n if (!this.initialized() || !value || !this.enabled() || !this.synth) {\n return;\n }\n this.performSpeak(value);\n });\n\n inject(DestroyRef).onDestroy(() => this.synth?.cancel());\n }\n\n /** Speak arbitrary text. Always works regardless of `enabled`. */\n speak(text: string): void {\n if (text && this.synth) {\n this.performSpeak(text);\n }\n }\n\n /** Cancel any ongoing speech. */\n cancel(): void {\n this.synth?.cancel();\n this.speakingState.set(false);\n }\n\n /** Toggle speech: speak text if idle, cancel if speaking. */\n toggle(): void {\n if (this.speakingState()) {\n this.cancel();\n } else {\n const text = this.text();\n if (text) {\n this.speak(text);\n }\n }\n }\n\n private performSpeak(text: string): void {\n const synth = this.synth!;\n // Chrome silently drops the next speak() when cancel() runs on an\n // idle synth; only cancel when there's actually a queued or in-flight\n // utterance. Firefox tolerates the unconditional cancel either way.\n if (synth.speaking || synth.pending) {\n synth.cancel();\n }\n\n const utterance = new SpeechSynthesisUtterance(text);\n utterance.rate = this.rate();\n utterance.pitch = this.pitch();\n utterance.volume = this.volume();\n const lang = this.lang();\n if (lang) {\n utterance.lang = lang;\n }\n\n utterance.onstart = () => this.speakingState.set(true);\n utterance.onend = () => this.speakingState.set(false);\n utterance.onerror = () => this.speakingState.set(false);\n\n synth.speak(utterance);\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Discriminated union describing one direct child of a hierarchy-aware\n * option projection root (e.g. `CngxSelectShell`).\n *\n * `CngxOption` registers as `{ kind: 'option' }`, `CngxOptionGroup` as\n * `{ kind: 'group' }`. Both providers expose `useExisting` so consumers\n * can `inject(CNGX_OPTION_CONTAINER)` and reach the directive instance\n * through the discriminator.\n *\n * @category common/interactive/listbox\n */\nexport type CngxOptionContainer =\n | (CngxOptionContainerOption & { readonly kind: 'option' })\n | (CngxOptionContainerGroup & { readonly kind: 'group' });\n\n/**\n * Public surface a `CngxOption` exposes when registered under\n * `CNGX_OPTION_CONTAINER`. Kept structural so consumers can walk the\n * projection tree without importing the directive class directly.\n *\n * @category common/interactive/listbox\n */\nexport interface CngxOptionContainerOption {\n readonly id: string;\n}\n\n/**\n * Public surface a `CngxOptionGroup` exposes when registered under\n * `CNGX_OPTION_CONTAINER`. The `options` signal yields the direct\n * `CngxOption` children of the group; nested groups are unsupported\n * (the surrounding directive dev-warns when one is detected).\n */\nexport interface CngxOptionContainerGroup {\n readonly label: () => string;\n readonly options: () => readonly CngxOptionContainerOption[];\n}\n\n/**\n * DI token registered by both `CngxOption` and `CngxOptionGroup`.\n *\n * Hierarchy-aware projection roots (`CngxSelectShell` and friends)\n * query a single token via `contentChildren(CNGX_OPTION_CONTAINER,\n * { descendants: false })` and walk the result preserving DOM order.\n * The discriminated `kind` field separates leaves from groups without\n * forcing the consumer to import either directive class.\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-container.ts\n * @since 0.1.0\n */\nexport const CNGX_OPTION_CONTAINER = new InjectionToken<CngxOptionContainer>(\n 'CNGX_OPTION_CONTAINER',\n);\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Pull-based contract a parent host (e.g. `CngxSelectShell` with a search\n * input, future filter-driven hosts) implements so individual `CngxOption`\n * instances can compute their own `hidden` visibility from a host-owned\n * `searchTerm` signal and a host-owned `matches` policy.\n *\n * Splitting policy from visibility keeps the option agnostic about HOW\n * filtering decides - substring, fuzzy, server-driven - and gives the\n * host a single point of control. Empty search term ALWAYS resolves to\n * \"show everything\"; the option short-circuits before calling `matches`.\n *\n * @category common/interactive/listbox\n */\nexport interface CngxOptionFilterHost {\n /** Current search term. Empty string means \"no filter active\". */\n readonly searchTerm: Signal<string>;\n /**\n * Decides whether the option is a match for the active term. Receives the\n * option's value, its resolved plain-text label, and the current term.\n */\n matches<T>(value: T, label: string, term: string): boolean;\n}\n\n/**\n * DI token a host provides on itself when it wants to drive per-option\n * `hidden` visibility through a reactive search term and a `matches`\n * policy.\n *\n * `CngxOption` injects this token with `{ optional: true }` - standalone\n * use (no host provides the token) leaves every option visible at all\n * times with no DOM cost.\n *\n * @category common/interactive/listbox\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-filter-host.ts\n * @since 0.1.0\n */\nexport const CNGX_OPTION_FILTER_HOST = new InjectionToken<CngxOptionFilterHost>(\n 'CNGX_OPTION_FILTER_HOST',\n);\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Pull-based contract a parent host (e.g. `CngxSelectShell`) implements\n * so individual `CngxOption` instances can resolve their highlight state\n * and route click + hover activations when the option's own\n * `inject(CngxActiveDescendant)` returns null.\n *\n * The need arises with content-projected options: at construction time,\n * the option's element-injector chain anchors in the consumer's\n * authoring view - which has no surrounding `CngxActiveDescendant`. The\n * shell that owns the listbox + AD provides this token via `useExisting`,\n * and projected options consult it as a fallback.\n *\n * Splitting the contract into a narrow surface (`activeId` /\n * `activate` / `highlight`) keeps the option agnostic about HOW the\n * host wires its AD - the shell forwards to its inner listbox's AD,\n * a hypothetical custom host could route through telemetry / multi-AD\n * coordination / etc. without changing the option directive.\n *\n * @category common/interactive/listbox\n */\nexport interface CngxOptionInteractionHost {\n /**\n * Currently active option id, or `null` when no option is\n * highlighted. The option compares against its own `id` to drive the\n * `cngx-option--highlighted` host class.\n */\n readonly activeId: Signal<string | null>;\n /**\n * Activate (commit / select) the option carrying the given value.\n * Called from the option's click handler when its own AD inject is\n * null. The host typically routes through its listbox's\n * `highlightByValue(value); activateCurrent()` pair.\n */\n activate(value: unknown): void;\n /**\n * Move the highlight to the option carrying the given value.\n * Called from the option's pointerenter handler. The host typically\n * routes through its listbox's `highlightByValue(value)`.\n */\n highlight(value: unknown): void;\n}\n\n/**\n * DI token a host provides on itself when content-projected\n * `CngxOption` instances need a fallback path to highlight + activate\n * + hover behaviour. Mirrors the four other shell-host tokens\n * (`CNGX_OPTION_CONTAINER`, `CNGX_OPTION_STATUS_HOST`,\n * `CNGX_OPTION_FILTER_HOST`, `CNGX_SELECT_SHELL_SEARCH_HOST`).\n *\n * `CngxOption` injects this token with `{ optional: true }` -\n * standalone use (no host provides the token) leaves option behaviour\n * unchanged because the option's own AD inject takes precedence when\n * available.\n *\n * @category common/interactive/listbox\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-interaction-host.ts\n * @since 0.1.0\n */\nexport const CNGX_OPTION_INTERACTION_HOST = new InjectionToken<CngxOptionInteractionHost>(\n 'CNGX_OPTION_INTERACTION_HOST',\n);\n","import { InjectionToken, type Signal, type TemplateRef } from '@angular/core';\n\n/**\n * Discriminated status entry rendered in `CngxOption`'s reserved internal\n * status slot.\n *\n * `kind` separates pending (in-flight commit) from error (failed commit) so\n * styling can branch on the host attribute `[attr.data-status]`. `tpl`\n * carries the actual glyph; the host MAY return `tpl: null` to reserve\n * layout space without rendering anything (rare - used for force-revealing\n * the slot during animation transitions).\n *\n * @category common/interactive/listbox\n */\nexport interface CngxOptionStatus {\n readonly kind: 'pending' | 'error';\n readonly tpl: TemplateRef<unknown> | null;\n}\n\n/**\n * Pull-based contract a select-shell host implements so individual\n * `CngxOption` instances can render an infrastructure indicator (commit\n * pending spinner, commit error glyph) inside a reserved internal slot\n * AFTER the user's option content.\n *\n * Pull semantics keep the host stateless from the option's perspective:\n * the option calls `host.statusFor(value)` once and consumes the returned\n * `Signal<CngxOptionStatus | null>` reactively; the host owns the policy\n * for resolving which value gets which status at any given commit-id.\n *\n * @category common/interactive/listbox\n */\nexport interface CngxOptionStatusHost {\n /**\n * Returns a reactive status entry for the given option value, or `null`\n * when the option carries no infrastructure indicator at this moment.\n */\n statusFor<T>(value: T): Signal<CngxOptionStatus | null>;\n}\n\n/**\n * DI token an option-projection root (e.g. `CngxSelectShell`) provides on\n * itself when commit-driven status indicators should reach individual\n * options without invading the consumer-authored option template.\n *\n * `CngxOption` injects this token with `{ optional: true }` - standalone\n * use (no host provides the token) results in a stable `null` status with\n * no DOM cost.\n *\n * @category common/interactive/listbox\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-status-host.ts\n * @since 0.1.0\n */\nexport const CNGX_OPTION_STATUS_HOST = new InjectionToken<CngxOptionStatusHost>(\n 'CNGX_OPTION_STATUS_HOST',\n);\n","import {\n afterNextRender,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n isDevMode,\n signal,\n type Signal,\n} from '@angular/core';\n\nimport { CNGX_AD_ITEM, CngxActiveDescendant, type CngxAdItemHandle } from '@cngx/common/a11y';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_OPTION_CONTAINER } from './option-container';\nimport { CNGX_OPTION_FILTER_HOST } from './option-filter-host';\nimport { CNGX_OPTION_INTERACTION_HOST } from './option-interaction-host';\nimport { CNGX_OPTION_STATUS_HOST, type CngxOptionStatus } from './option-status-host';\n\n/**\n * A single selectable option registered with a surrounding `CngxActiveDescendant`.\n *\n * Click highlights + activates, `pointerenter` highlights only. Provides a stable\n * unique id on the host element for `aria-activedescendant` resolution.\n *\n * Selection state (`isSelected`) is driven externally by the enclosing listbox.\n * In V1 of the stack, `CngxListbox` reads `value()` via the AD item list and\n * exposes its own selection through `CngxOption.isSelected()`.\n *\n * @category common/interactive/listbox\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option.directive.ts\n * @since 0.1.0\n * @relatedTo CngxListbox, CngxOptionGroup, CngxActiveDescendant\n * <example-url>http://localhost:4200/#/common/interactive/listbox/search/command-palette</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/base/multi-select</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/base/single-select</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/option/flat-options-with-ad</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/option/grouped-options</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/material-mat-select-via-cngxbindfield</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/reactive-forms-adapted-via-adaptformcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-multi-select-min-2</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-single-select</example-url>\n */\n@Directive({\n selector: '[cngxOption]',\n exportAs: 'cngxOption',\n standalone: true,\n providers: [\n { provide: CNGX_AD_ITEM, useExisting: CngxOption },\n { provide: CNGX_OPTION_CONTAINER, useExisting: CngxOption },\n ],\n host: {\n role: 'option',\n '[id]': 'id',\n '[class.cngx-option--selected]': 'isSelected()',\n '[class.cngx-option--highlighted]': 'isHighlighted()',\n '[class.cngx-option--disabled]': 'disabled()',\n '[attr.aria-selected]': 'isSelected()',\n '[attr.aria-disabled]': 'disabled() || null',\n '[attr.data-status]': 'statusSignal()?.kind ?? null',\n '[class.cngx-option--hidden]': 'hidden()',\n '[attr.hidden]': 'hidden() || null',\n '(click)': 'handleClick()',\n '(pointerenter)': 'handlePointerEnter()',\n },\n})\nexport class CngxOption implements CngxAdItemHandle {\n /** Discriminator for `CNGX_OPTION_CONTAINER` consumers. */\n readonly kind = 'option' as const;\n /** Opaque value emitted on activation. */\n readonly value = input<unknown>(undefined);\n /** Disabled options are skipped in navigation and reject clicks. */\n readonly disabled = input<boolean>(false);\n /** Optional explicit label used by typeahead. Falls back to trimmed `textContent`. */\n readonly labelInput = input<string | undefined>(undefined, { alias: 'label' });\n\n /** Stable unique id set on the host, used by `aria-activedescendant`. */\n readonly id = nextUid('cngx-option');\n\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly ad = inject(CngxActiveDescendant, { optional: true });\n private readonly interactionHost = inject(CNGX_OPTION_INTERACTION_HOST, { optional: true });\n private readonly statusHost = inject(CNGX_OPTION_STATUS_HOST, { optional: true });\n private readonly filterHost = inject(CNGX_OPTION_FILTER_HOST, { optional: true });\n private readonly selectedState = signal(false);\n /**\n * Snapshot of `nativeElement.textContent` taken in `afterNextRender`. The\n * `textContent` getter is not a signal, so a reactive `label` cannot\n * subscribe to it directly; the snapshot bridges DOM state into the\n * reactive graph once the first render has populated text.\n */\n private readonly textContentSnapshot = signal('');\n\n /**\n * Whether this option is currently highlighted. Reads the surrounding\n * `CngxActiveDescendant` when available; falls back to the optional\n * {@link CNGX_OPTION_INTERACTION_HOST} contract for content-projected\n * options whose authoring view has no AD in scope (e.g. children of\n * `CngxSelectShell`).\n */\n readonly isHighlighted = computed<boolean>(() => {\n const id = this.ad?.activeId() ?? this.interactionHost?.activeId() ?? null;\n return id === this.id;\n });\n\n /**\n * Reactive infrastructure-status entry resolved via the optional\n * `CNGX_OPTION_STATUS_HOST` host. `null` when no host is provided or the\n * host returns `null` for this option's value.\n *\n * `CngxSelectOption` (declarative wrapper) renders the status template\n * AFTER the user's `<ng-content/>` in a reserved internal slot, so the\n * indicator never invades the consumer-authored option content.\n */\n readonly statusSignal = computed<CngxOptionStatus | null>(\n () => this.statusHost?.statusFor(this.value())() ?? null,\n {\n equal: (a, b) => a === b || (!!a && !!b && a.kind === b.kind && a.tpl === b.tpl),\n },\n );\n\n /**\n * Whether this option is selected. Driven externally by the enclosing listbox\n * via `markSelected()`. Standalone use (without a listbox) always returns `false`.\n */\n readonly isSelected = this.selectedState.asReadonly();\n\n /**\n * Reactive visibility derived from the optional `CNGX_OPTION_FILTER_HOST`\n * host's `searchTerm` and `matches` policy. `false` when no host is\n * provided or the term is empty; `true` only when the host's policy\n * explicitly rejects the option for the current term.\n *\n * Boolean - default `Object.is` equality is sufficient.\n */\n readonly hidden = computed<boolean>(() => {\n const host = this.filterHost;\n if (!host) {\n return false;\n }\n const term = host.searchTerm();\n if (!term) {\n return false;\n }\n return !host.matches(this.value(), this.label(), term);\n });\n\n /**\n * Resolved label as a Signal - explicit `label` input wins, falling back to\n * the host element's trimmed `textContent` (the W3C-defined plain-text\n * projection of the subtree). Plain text by construction; never reads\n * `innerHTML`. Consumers can text-interpolate this safely on a closed\n * trigger (`{{ option.label() }}`) without an XSS surface.\n *\n * The textContent fallback is captured as a post-render snapshot\n * (`afterNextRender`), so the signal is reactive on `labelInput` while\n * still giving callers a non-empty value for static-text declarative\n * options. Consumers with dynamic option text should bind `[label]`\n * explicitly rather than relying on the projection.\n */\n readonly label: Signal<string> = computed(() => {\n const explicit = this.labelInput();\n if (explicit) {\n return explicit;\n }\n return this.textContentSnapshot();\n });\n\n /**\n * Back-compat callable alias - `CngxAdItemHandle.label` accepts both\n * `Signal<string>` and `() => string`, so this arrow keeps any\n * consumer that called `option.resolvedLabel()` imperatively working\n * unchanged.\n */\n readonly resolvedLabel = (): string => this.label();\n\n constructor() {\n afterNextRender(() => {\n const el = this.elementRef.nativeElement as HTMLElement;\n this.textContentSnapshot.set((el.textContent ?? '').trim());\n if (isDevMode() && !this.label()) {\n console.error(\n `<cngx-option> at ${this.id} has no label and no textContent. ` +\n `Label is required for AT and trigger display.`,\n );\n }\n });\n }\n\n /** @internal Used by `CngxListbox` to sync selection state. */\n markSelected(selected: boolean): void {\n this.selectedState.set(selected);\n }\n\n protected handleClick(): void {\n if (this.disabled()) {\n return;\n }\n const ad = this.ad;\n if (ad) {\n ad.highlightByValue(this.value());\n ad.activateCurrent();\n return;\n }\n this.interactionHost?.activate(this.value());\n }\n\n protected handlePointerEnter(): void {\n if (this.disabled()) {\n return;\n }\n if (this.ad) {\n this.ad.highlightByValue(this.value());\n return;\n }\n this.interactionHost?.highlight(this.value());\n }\n}\n","import {\n afterNextRender,\n computed,\n contentChildren,\n Directive,\n input,\n isDevMode,\n type Signal,\n} from '@angular/core';\n\nimport { CNGX_OPTION_CONTAINER } from './option-container';\nimport { CngxOption } from './option.directive';\n\n/**\n * Groups related `CngxOption`s under a visual and semantic header.\n *\n * Renders `role=\"group\"` and `aria-label` - children stay flat in the AD item\n * list; grouping is purely presentational and for ATs that render group labels.\n *\n * Hierarchy-aware projection roots (e.g. `CngxSelectShell`) query\n * `CNGX_OPTION_CONTAINER` to walk the direct children in DOM order and read\n * each group's `options` to populate `CngxSelectOptionGroupDef.options`.\n * Nested option groups are unsupported - a dev-warning fires when one is\n * detected.\n *\n * @category common/interactive/listbox\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-group.directive.ts\n * @since 0.1.0\n * @relatedTo CngxOption, CngxListbox\n * <example-url>http://localhost:4200/#/common/interactive/option/flat-options-with-ad</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/option/grouped-options</example-url>\n */\n@Directive({\n selector: '[cngxOptionGroup]',\n exportAs: 'cngxOptionGroup',\n standalone: true,\n providers: [{ provide: CNGX_OPTION_CONTAINER, useExisting: CngxOptionGroup }],\n host: {\n role: 'group',\n '[attr.aria-label]': 'label()',\n },\n})\nexport class CngxOptionGroup {\n /** Discriminator for `CNGX_OPTION_CONTAINER` consumers. */\n readonly kind = 'group' as const;\n /** Accessible group label. */\n readonly label = input.required<string>();\n\n private readonly optionsQuery = contentChildren(CngxOption, { descendants: false });\n private readonly nestedGroupsQuery = contentChildren(CngxOptionGroup, { descendants: true });\n\n /**\n * Direct `CngxOption` children of this group, DOM-ordered. Reference-stable\n * across change-detection runs when the underlying option set is unchanged.\n */\n readonly options: Signal<readonly CngxOption[]> = computed(() => this.optionsQuery(), {\n equal: (a, b) => a.length === b.length && a.every((v, i) => v === b[i]),\n });\n\n constructor() {\n afterNextRender(() => {\n if (isDevMode() && this.nestedGroupsQuery().length > 0) {\n console.error(\n '[cngxOptionGroup] Nested option groups are unsupported. ' +\n 'Use CngxTreeSelect for arbitrary tree shapes.',\n );\n }\n });\n }\n}\n","import {\n afterNextRender,\n computed,\n contentChildren,\n Directive,\n effect,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\nimport { CngxActiveDescendant } from '@cngx/common/a11y';\n\nimport type { CngxListboxSearch } from './listbox-search.directive';\nimport { CngxOption } from './option.directive';\n\n/**\n * Composite listbox primitive built on top of `CngxActiveDescendant`.\n *\n * Reads options from content children, exposes single- or multi-value\n * selection state via two-way `[(value)]` / `[(selectedValues)]` bindings, and\n * drives `aria-selected` / `aria-multiselectable` reactively.\n *\n * `value` and `selectedValues` are `model()` signals - `[value]`,\n * `(valueChange)`, and `[(value)]` bindings all work identically. Forms\n * integration (`<cngx-form-field>`) is bolted on via the sibling\n * `CngxListboxFieldBridge` directive from `@cngx/forms/field` - this atom\n * stays Forms-agnostic.\n *\n * ### Material / CDK equivalent\n *\n * - `cdk-listbox` (single/multi select via `cdkListbox` directive)\n * - `mat-selection-list` (multi select list from `@angular/material/list`)\n *\n * ### Why better than Material\n *\n * 1. Single source of truth for ARIA: every attribute is a `computed()`.\n * 2. Selection shares the same `CngxActiveDescendant` used by menus and\n * comboboxes - one mental model for all typeahead widgets.\n * 3. `isAllSelected` and `selectedLabels` are derived signals, not manual\n * callbacks.\n * 4. Forms integration is decoupled: the listbox never imports `@angular/forms`.\n *\n * @category common/interactive/listbox\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/listbox.directive.ts\n * @since 0.1.0\n * @relatedTo CngxListboxSearch, CngxListboxTrigger, CngxOption, CngxOptionGroup, CngxActiveDescendant\n * @playground Two synced listboxes ./examples/synced-listboxes/synced-listboxes.component.ts\n * <example-url>http://localhost:4200/#/common/interactive/listbox/search/command-palette</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/base/multi-select</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/listbox/base/single-select</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/material-mat-select-via-cngxbindfield</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/reactive-forms-adapted-via-adaptformcontrol</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-multi-select-min-2</example-url>\n * <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-single-select</example-url>\n */\n@Directive({\n selector: '[cngxListbox]',\n exportAs: 'cngxListbox',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxActiveDescendant,\n inputs: ['items', 'orientation', 'loop', 'typeahead', 'autoHighlightFirst', 'virtualCount'],\n },\n ],\n host: {\n role: 'listbox',\n '[attr.aria-label]': 'label()',\n '[attr.aria-multiselectable]': 'multiple() ? \"true\" : null',\n },\n})\nexport class CngxListbox<T = unknown> {\n /** Accessible label for the listbox region. */\n readonly label = input.required<string>();\n\n /** Two-way single-value binding. */\n readonly value = model<T | undefined>(undefined);\n\n /** Two-way multi-value binding. */\n readonly selectedValues = model<T[]>([]);\n\n /** Whether multiple options can be selected. */\n readonly multiple = input<boolean>(false);\n\n /** Equality function for matching values. Defaults to `Object.is`. */\n readonly compareWith = input<(a: T, b: T) => boolean>(Object.is as (a: T, b: T) => boolean);\n\n /**\n * Optional explicit reference to a `CngxListboxSearch` whose term drives\n * `filteredOptions`. Consumers wire this up with a template reference:\n * `[cngxSearchRef]=\"search\"` and `#search=\"cngxListboxSearch\"`. No ancestor\n * injection - orthogonal composition, like `CngxSortHeader` + `CngxSortRef`.\n */\n readonly cngxSearchRef = input<CngxListboxSearch | null>(null);\n\n /**\n * When `true`, the listbox stops auto-writing its own `value` / `selectedValues`\n * on AD-activation. The consumer (typically a Level-3 composite like\n * `CngxSelect` running an async `[commitAction]`) fully owns the value\n * mutation flow and can intercept activations BEFORE any write happens.\n *\n * **Why this exists.**\n * The commit flow needs to snapshot the pre-pick value synchronously when\n * the user clicks an option - to roll back to it on error. Without this\n * flag, CngxListbox writes `value` via two-way binding BEFORE the consumer's\n * own `ad.activated` subscriber runs, and the pre-pick value is already\n * gone by the time we try to snapshot it. Flipping this flag lets the\n * consumer be the single writer.\n *\n * Default `false` preserves the self-contained listbox behaviour used\n * everywhere outside the select family.\n */\n readonly externalActivation = input<boolean>(false);\n\n /**\n * Underlying `CngxActiveDescendant` host directive. Exposed so triggers\n * (e.g. `CngxListboxTrigger`) can drive navigation without ancestor injection.\n */\n readonly ad = inject(CngxActiveDescendant, { self: true, host: true });\n\n /**\n * Optional explicit option list. When set, takes precedence over content\n * projection. Useful for composites that project options via `<ng-content>`\n * and query them one layer up (e.g. `CngxSelect`'s declarative mode).\n */\n readonly explicitOptions = input<readonly CngxOption[] | undefined>(undefined);\n\n /** Options collected via content projection. */\n private readonly contentOptions = contentChildren(CngxOption, { descendants: true });\n\n /** Effective option list: explicit input wins, otherwise content-projection. */\n readonly options = computed<readonly CngxOption[]>(\n () => this.explicitOptions() ?? this.contentOptions(),\n );\n\n /** Whether content-children have been initialised (guards effects from running early). */\n private readonly initialized = signal(false);\n\n constructor() {\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n if (!this.initialized()) {\n return;\n }\n const selected = this.selected();\n const eq = this.compareWith();\n for (const opt of this.options()) {\n opt.markSelected(selected.some((s) => eq(s, opt.value() as T)));\n }\n });\n\n this.ad.activated.subscribe((value) => this.handleActivation(value));\n }\n\n /** Current selection as an array (single-mode → `[value]` or `[]`, multi-mode → `selectedValues`). */\n readonly selected = computed<T[]>(() => {\n if (this.multiple()) {\n return [...this.selectedValues()];\n }\n const v = this.value();\n return v === undefined || v === null ? [] : [v as T];\n });\n\n /** Labels of currently selected options, in selection order. */\n readonly selectedLabels = computed<string[]>(() => {\n const selected = this.selected();\n const eq = this.compareWith();\n const opts = this.options();\n const labels: string[] = [];\n for (const value of selected) {\n const opt = opts.find((o) => eq(o.value() as T, value));\n if (opt) {\n labels.push(opt.resolvedLabel());\n }\n }\n return labels;\n });\n\n /** Convenience: first selected label (for trigger-style displays). */\n readonly selectedLabel = computed<string | null>(() => this.selectedLabels()[0] ?? null);\n\n /** Whether every non-disabled option is selected. */\n readonly isAllSelected = computed<boolean>(() => {\n const opts = this.options();\n const selectable = opts.filter((o) => !o.disabled());\n if (selectable.length === 0) {\n return false;\n }\n const selected = this.selected();\n const eq = this.compareWith();\n return selectable.every((o) => selected.some((s) => eq(s, o.value() as T)));\n });\n\n /** Whether the listbox has no options at all. */\n readonly isEmpty = computed<boolean>(() => this.options().length === 0);\n\n /** Current search term (empty when no `cngxSearchRef` is bound). */\n readonly searchTerm = computed<string>(() => this.cngxSearchRef()?.term() ?? '');\n\n /** Options filtered by `searchTerm` through the search matcher. */\n readonly filteredOptions = computed(() => {\n const term = this.searchTerm();\n const search = this.cngxSearchRef();\n if (term === '' || !search) {\n return this.options();\n }\n const matchFn = search.matchFn();\n return this.options().filter((opt) =>\n matchFn(\n {\n id: opt.id,\n value: opt.value() as T,\n label: opt.resolvedLabel(),\n disabled: opt.disabled(),\n },\n term,\n ),\n );\n });\n\n /** Whether the current search term matches at least one option. */\n readonly hasSearchResults = computed<boolean>(() => this.filteredOptions().length > 0);\n\n /**\n * Select the given value. In single mode, replaces the current selection.\n * In multi mode, adds to the selection if not already present. Values that\n * do not correspond to any option are ignored.\n */\n select(value: T): void {\n if (!this.hasOption(value)) {\n return;\n }\n if (this.multiple()) {\n if (this.isSelected(value)) {\n return;\n }\n this.selectedValues.set([...this.selectedValues(), value]);\n } else {\n this.value.set(value);\n }\n }\n\n /** Remove `value` from the selection. No-op if not selected. */\n deselect(value: T): void {\n const eq = this.compareWith();\n if (this.multiple()) {\n this.selectedValues.set(this.selectedValues().filter((v) => !eq(v, value)));\n } else {\n const current = this.value();\n if (current !== undefined && eq(current, value)) {\n this.value.set(undefined);\n }\n }\n }\n\n /** Flip selection state for `value`. */\n toggle(value: T): void {\n if (this.isSelected(value)) {\n this.deselect(value);\n } else {\n this.select(value);\n }\n }\n\n /** Clear all selections. */\n clear(): void {\n if (this.multiple()) {\n this.selectedValues.set([]);\n } else {\n this.value.set(undefined);\n }\n }\n\n /**\n * Select every non-disabled option. Only valid in multi mode - in single\n * mode this is a no-op.\n */\n selectAll(): void {\n if (!this.multiple()) {\n return;\n }\n const values = this.options()\n .filter((o) => !o.disabled())\n .map((o) => o.value() as T);\n this.selectedValues.set(values);\n }\n\n /** Returns the resolved label for a value, or `null` if no such option. */\n getLabel(value: T): string | null {\n const eq = this.compareWith();\n const opt = this.options().find((o) => eq(o.value() as T, value));\n return opt ? opt.resolvedLabel() : null;\n }\n\n /** Whether `value` is currently part of the selection. */\n isSelected(value: T): boolean {\n const eq = this.compareWith();\n return this.selected().some((v) => eq(v, value));\n }\n\n private hasOption(value: T): boolean {\n const eq = this.compareWith();\n return this.options().some((o) => eq(o.value() as T, value));\n }\n\n private handleActivation(value: unknown): void {\n // externalActivation: AD still emits on `activated`, but the consumer\n // owns the write (e.g. to capture a pre-pick rollback target).\n if (this.externalActivation()) {\n return;\n }\n // AD's Subject is typed `unknown`; the listbox owns the value domain.\n const narrowed = value as T;\n if (this.multiple()) {\n this.toggle(narrowed);\n } else {\n this.select(narrowed);\n }\n }\n}\n","import { Directive, inject, input } from '@angular/core';\n\nimport { type ActiveDescendantItem } from '@cngx/common/a11y';\n\nimport { CngxSearch } from '../keyboard/search.directive';\n\n/**\n * Matcher function used by CngxListboxSearch to filter options.\n *\n * @category common/interactive/listbox\n */\nexport type ListboxMatchFn = (option: ActiveDescendantItem, term: string) => boolean;\n\n/** @internal */\nconst defaultLabelMatch: ListboxMatchFn = (option, term) => {\n if (term === '') {\n return true;\n }\n return option.label.toLowerCase().includes(term.toLowerCase());\n};\n\n/**\n * Search input for a `CngxListbox`.\n *\n * Builds on `CngxSearch` via `hostDirectives` - inherits debounce, term\n * tracking, and clear semantics. Adds a `matchFn` input that listboxes read\n * to filter their options. A listbox that has a `CngxListboxSearch` injected\n * ancestor reads `term` and `matchFn` from it reactively.\n *\n * @category common/interactive/listbox\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/listbox-search.directive.ts\n * @since 0.1.0\n * @relatedTo CngxListbox, CngxSearch, CngxListboxTrigger\n * <example-url>http://localhost:4200/#/common/interactive/listbox/search/command-palette</example-url>\n */\n@Directive({\n selector: 'input[cngxListboxSearch]',\n exportAs: 'cngxListboxSearch',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxSearch,\n inputs: ['debounceMs'],\n },\n ],\n})\nexport class CngxListboxSearch {\n /** Custom matcher. Defaults to case-insensitive substring match on `label`. */\n readonly matchFn = input<ListboxMatchFn>(defaultLabelMatch);\n\n private readonly search = inject(CngxSearch, { self: true, host: true });\n\n /** Current debounced search term (proxied from CngxSearch). */\n readonly term = this.search.term;\n\n /** True when term is non-empty. */\n readonly hasValue = this.search.hasValue;\n\n /** Clears the input. */\n clear(): void {\n this.search.clear();\n }\n}\n","import { computed, Directive, ElementRef, inject, input, output } from '@angular/core';\n\nimport type { CngxListbox } from './listbox.directive';\nimport { CngxListboxSearch } from './listbox-search.directive';\n\n/**\n * Minimum popover contract this trigger expects. Matches `CngxPopover` from\n * `@cngx/common/popover`, but declared structurally here to avoid an\n * entry-point circular dependency (popover already imports from interactive\n * for `CngxCloseButton`).\n */\ninterface PopoverController {\n readonly isVisible: () => boolean;\n show(): void;\n hide(): void;\n}\n\n/**\n * Trigger atom for listbox dropdowns.\n *\n * Pairs a focusable element (button) with a `CngxListbox` and a `CngxPopover`\n * through explicit template references - no ancestor injection, consistent\n * with the `CngxSortHeader` / `CngxSortRef` orthogonal composition pattern.\n *\n * Implements the WAI-ARIA combobox-less listbox trigger keyboard model:\n *\n * | State | Key | Action |\n * |-|-|-|\n * | closed | Enter / Space / ArrowDown | open + highlight first enabled |\n * | closed | ArrowUp | open + highlight last enabled |\n * | open | ArrowDown / ArrowUp / Home / End | delegate to AD primitives |\n * | open | Enter / Space | activate; close if `closeOnSelect()` |\n * | any | Escape | close and restore focus to trigger |\n *\n * @category common/interactive/listbox\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/listbox-trigger.directive.ts\n * @since 0.1.0\n * @relatedTo CngxListbox, CngxListboxSearch, CngxPopoverTrigger, CngxActiveDescendant\n * <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>\n */\n@Directive({\n selector: '[cngxListboxTrigger]',\n exportAs: 'cngxListboxTrigger',\n standalone: true,\n host: {\n '[attr.aria-haspopup]': '\"listbox\"',\n '[attr.aria-expanded]': 'isOpen()',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxListboxTrigger<T = unknown> {\n /** Listbox controlled by this trigger. */\n readonly listbox = input.required<CngxListbox<T>>({ alias: 'cngxListboxTrigger' });\n /** Popover that wraps the listbox panel. */\n readonly popover = input.required<PopoverController>();\n /** Whether activating an option closes the popover. */\n readonly closeOnSelect = input<boolean>(true);\n\n /** Mirrors `CngxPopover.isVisible()` for host binding and external read. */\n readonly isOpen = computed<boolean>(() => this.popover().isVisible());\n\n /**\n * Fires when the user presses Backspace on an empty input. Only\n * emitted when the host element is an `<input>` with a co-located\n * `CngxListboxSearch` - the tag-input convention \"Backspace on empty\n * deletes the trailing chip\" lives at the trigger, so consumers only\n * wire one subscription to own the delete path. On non-input hosts\n * (classic button triggers) the event never fires.\n */\n readonly backspaceOnEmpty = output<void>();\n\n /**\n * When a `CngxListboxSearch` is attached to the same host element, we\n * suppress the printable-character typeahead forwarding: the keystroke\n * must reach the native `<input>` value so the search directive's\n * debounced term picks it up. Without this guard every printable char\n * would be `preventDefault()`'d and the input would never receive text.\n *\n * Injected as optional + self so only co-located search declarations\n * flip the behaviour. Combobox-style triggers (where the focusable\n * element IS an `<input cngxListboxSearch cngxListboxTrigger>`) opt in\n * automatically; classic button triggers keep native-`<select>` parity.\n */\n private readonly search = inject(CngxListboxSearch, { optional: true, self: true });\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected handleKeydown(event: KeyboardEvent): void {\n const key = event.key;\n const ad = this.listbox().ad;\n\n // Tag-input convention: Backspace on an empty co-located search input\n // emits backspaceOnEmpty for the parent composite (CngxCombobox, …)\n // to delete the trailing chip. Consolidated here so the trigger owns\n // the only keydown handler on the element. Non-input triggers skip\n // this path via the co-located-search guard.\n if (key === 'Backspace' && this.search) {\n const host = this.el.nativeElement;\n if (host instanceof HTMLInputElement && host.value === '') {\n this.backspaceOnEmpty.emit();\n // No preventDefault - the consumer's chip-remove path owns DOM impact.\n }\n }\n\n if (!this.isOpen()) {\n if (key === 'ArrowDown' || key === 'Enter' || key === ' ') {\n event.preventDefault();\n this.popover().show();\n ad.highlightFirst();\n return;\n }\n if (key === 'ArrowUp') {\n event.preventDefault();\n this.popover().show();\n ad.highlightLast();\n return;\n }\n return;\n }\n\n switch (key) {\n case 'Escape':\n event.preventDefault();\n this.popover().hide();\n return;\n case 'ArrowDown':\n event.preventDefault();\n ad.highlightNext();\n return;\n case 'ArrowUp':\n event.preventDefault();\n ad.highlightPrev();\n return;\n case 'Home':\n event.preventDefault();\n ad.highlightFirst();\n return;\n case 'End':\n event.preventDefault();\n ad.highlightLast();\n return;\n case 'Enter':\n case ' ':\n if (!ad.activeItem()) {\n return;\n }\n event.preventDefault();\n ad.activateCurrent();\n if (this.closeOnSelect()) {\n this.popover().hide();\n }\n return;\n }\n\n if (this.search) {\n // Let the keystroke reach the <input> for CngxListboxSearch debounce.\n return;\n }\n if (key.length === 1 && /\\S/.exec(key) !== null) {\n // Native <select> parity: printable chars drive AD typeahead while\n // focus stays on the trigger.\n event.preventDefault();\n ad.typeaheadChar(key);\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { inject, Injectable, InjectionToken } from '@angular/core';\n\n/**\n * Public surface every menu-side consumer talks to. The class\n * `CngxMenuAnnouncer` is the default implementation; consumers wire a\n * custom (telemetry-wrapping, locale-aware, test-doubled) one by\n * overriding `CNGX_MENU_ANNOUNCER_FACTORY`.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuAnnouncerLike {\n announce(message: string): void;\n}\n\n/**\n * Factory shape consumed by `CNGX_MENU_ANNOUNCER_FACTORY`. The default\n * factory is {@link createMenuAnnouncer}; override returns any object\n * that satisfies {@link CngxMenuAnnouncerLike}.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuAnnouncerFactory = () => CngxMenuAnnouncerLike;\n\n/**\n * Global polite live-region announcer for the menu family. Maintains a\n * single hidden `aria-live=\"polite\"` element per document and announces\n * menu state transitions (submenu open/close, item activation).\n *\n * Scoped `providedIn: 'root'` so every menu in the app shares the same\n * region; messages are de-duped via a short clear-then-set cycle so\n * screen readers treat repeated identical messages as fresh events.\n *\n * Default factory output for {@link CNGX_MENU_ANNOUNCER_FACTORY}.\n * Consumers obtain the announcer via the factory token, never by\n * `inject(CngxMenuAnnouncer)` directly, so a swap is enterprise-wide.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-announcer.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxMenuTrigger, CngxMenuItemSubmenu\n */\n@Injectable({ providedIn: 'root' })\nexport class CngxMenuAnnouncer implements CngxMenuAnnouncerLike {\n private readonly doc = inject(DOCUMENT);\n private politeElement: HTMLElement | null = null;\n private clearTimer: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * Announce a message via the polite live region. Empty messages are\n * ignored. The region is cleared ~16ms before being repopulated so AT\n * picks up identical-text repeats as a new event.\n */\n announce(message: string): void {\n if (!message) {\n return;\n }\n const element = this.ensureRegion();\n if (!element) {\n return;\n }\n element.textContent = '';\n if (this.clearTimer) {\n clearTimeout(this.clearTimer);\n }\n this.clearTimer = setTimeout(() => {\n element.textContent = message;\n this.clearTimer = null;\n }, 16);\n }\n\n private ensureRegion(): HTMLElement | null {\n if (this.politeElement) {\n return this.politeElement;\n }\n const body = this.doc.body;\n if (!body) {\n return null;\n }\n const el = this.doc.createElement('div');\n el.setAttribute('aria-live', 'polite');\n el.setAttribute('role', 'status');\n el.setAttribute('aria-atomic', 'true');\n el.className = 'cngx-menu-announcer';\n el.style.cssText =\n 'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0';\n body.appendChild(el);\n this.politeElement = el;\n return el;\n }\n}\n\n/**\n * Default factory that hands out the root-scoped {@link CngxMenuAnnouncer}\n * singleton. Consumers wire a custom announcer by replacing\n * {@link CNGX_MENU_ANNOUNCER_FACTORY}.\n *\n * Must run inside an injection context.\n *\n * @category common/interactive/menu\n */\nexport function createMenuAnnouncer(): CngxMenuAnnouncerLike {\n return inject(CngxMenuAnnouncer);\n}\n\n/**\n * DI token carrying the factory that yields the menu family's announcer.\n * Defaults to {@link createMenuAnnouncer} returning the root-scoped\n * {@link CngxMenuAnnouncer} singleton. Override via `providers` /\n * `viewProviders` for telemetry-wrapping, locale-aware, or test-doubled\n * announcers without forking the menu module. Symmetric to\n * `CNGX_COMMIT_ERROR_ANNOUNCER_FACTORY` from the select family.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * {\n * provide: CNGX_MENU_ANNOUNCER_FACTORY,\n * useValue: () => ({ announce: (msg) => myTelemetry.log(msg) }),\n * },\n * ],\n * });\n * ```\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-announcer.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_ANNOUNCER_FACTORY = new InjectionToken<CngxMenuAnnouncerFactory>(\n 'CNGX_MENU_ANNOUNCER_FACTORY',\n { providedIn: 'root', factory: () => createMenuAnnouncer },\n);\n\n/**\n * Resolve the {@link CngxMenuAnnouncerLike} from the current injection\n * scope via the factory token. Must run inside an injection context.\n *\n * @category common/interactive/menu\n */\nexport function injectMenuAnnouncer(): CngxMenuAnnouncerLike {\n return inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n}\n","import {\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n Optional,\n type EnvironmentProviders,\n type Provider,\n SkipSelf,\n} from '@angular/core';\n\n/**\n * Localised UI strings the menu announces or otherwise renders. English by\n * default; consumers override via {@link withAriaLabels}.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuAriaLabels {\n readonly submenuOpened: string;\n readonly submenuClosed: string;\n readonly itemActivated: string;\n readonly itemDisabled: string;\n readonly menuDismissed: string;\n}\n\n/**\n * Resolved configuration consumed by every menu directive in the family.\n * Default values live in {@link DEFAULT_MENU_CONFIG}; override at app\n * scope via {@link provideMenuConfig} or per-component via\n * {@link provideMenuConfigAt}.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuConfig {\n readonly ariaLabels: CngxMenuAriaLabels;\n readonly typeaheadDebounce: number;\n readonly submenuOpenDelay: number;\n readonly submenuCloseDelay: number;\n readonly closeOnSelect: boolean;\n /**\n * Whether `pointerdown` outside both the menu's popover and the\n * trigger host dismisses the menu. Native context menus, browser\n * right-click menus, and major web apps all close on outside click.\n * Default `true`.\n */\n readonly dismissOnOutsideClick: boolean;\n /**\n * Whether window `scroll` while the menu is open dismisses it. Default\n * `false` - consumers with scrollable menu panels (long lists,\n * treeselect-style) often want the menu to remain anchored during\n * scroll. Opt in via {@link withDismissOnScroll}.\n */\n readonly dismissOnScroll: boolean;\n /**\n * Whether the \"context lost\" bundle dismisses the menu. The bundle\n * covers BOTH window `blur` (system notification, OS-native menu\n * overlaying, tab switch) AND document `pointercancel` outside the\n * popover and trigger host (palm rejection on touch devices,\n * gesture cancelled by the browser). The two sources share one\n * toggle by design; consumers needing one without the other replace\n * the entire handler via {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}.\n * Default `true`.\n */\n readonly dismissOnBlur: boolean;\n}\n\n/**\n * Single feature-flag function consumed by {@link provideMenuConfig} and\n * {@link provideCngxMenu}. Carries a hidden `_target` discriminator so\n * future config surfaces (e.g. submenu-only or announcer overrides) can\n * compose through the same `provideCngxMenu` aggregator without breaking\n * the public API of existing `with*` features.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuConfigFeature = ((config: CngxMenuConfig) => CngxMenuConfig) & {\n readonly _target?: 'config';\n};\n\n/**\n * Internal helper that brands a config-mutator function with the `_target`\n * discriminator. Every `with*` feature returns one of these.\n *\n * @internal\n */\nexport function defineMenuConfigFeature(\n fn: (config: CngxMenuConfig) => CngxMenuConfig,\n): CngxMenuConfigFeature {\n return Object.assign(fn, { _target: 'config' as const });\n}\n\n/**\n * Library-default menu configuration. **English-only** - German (or any\n * other locale) is consumer-supplied via `withAriaLabels` per the\n * `feedback_en_default_locale` rule.\n *\n * @category common/interactive/menu\n */\nexport const DEFAULT_MENU_CONFIG: CngxMenuConfig = {\n ariaLabels: {\n submenuOpened: 'Submenu opened',\n submenuClosed: 'Submenu closed',\n itemActivated: 'Item activated',\n itemDisabled: 'Item disabled',\n menuDismissed: 'Menu dismissed',\n },\n typeaheadDebounce: 300,\n submenuOpenDelay: 0,\n submenuCloseDelay: 150,\n closeOnSelect: true,\n dismissOnOutsideClick: true,\n dismissOnScroll: false,\n dismissOnBlur: true,\n};\n\n/**\n * DI token carrying the resolved {@link CngxMenuConfig}. Defaults to\n * {@link DEFAULT_MENU_CONFIG} at root; override via {@link provideMenuConfig}\n * (app-wide) or {@link provideMenuConfigAt} (component scope via\n * `viewProviders`).\n *\n * @category common/interactive/menu\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-config.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_CONFIG = new InjectionToken<CngxMenuConfig>('CngxMenuConfig', {\n providedIn: 'root',\n factory: () => DEFAULT_MENU_CONFIG,\n});\n\n/** @internal */\nfunction applyFeatures(\n base: CngxMenuConfig,\n features: readonly CngxMenuConfigFeature[],\n): CngxMenuConfig {\n return features.reduce((cfg, feature) => feature(cfg), base);\n}\n\n/**\n * Provide a menu configuration at app root. Each feature is a partial\n * override produced by `with*` helpers (see `menu-config-features.ts`).\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideMenuConfig(\n * withAriaLabels({ submenuOpened: 'Untermenü geöffnet' }),\n * withTypeaheadDebounce(500),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/interactive/menu\n */\nexport function provideMenuConfig(...features: CngxMenuConfigFeature[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: CNGX_MENU_CONFIG,\n useFactory: () => applyFeatures(DEFAULT_MENU_CONFIG, features),\n },\n ]);\n}\n\n/**\n * Component-scoped menu configuration override. Pass into a directive or\n * component's `viewProviders`; features merge on top of the parent\n * config (root or an enclosing scope).\n *\n * @category common/interactive/menu\n */\nexport function provideMenuConfigAt(...features: CngxMenuConfigFeature[]): Provider[] {\n return [\n {\n provide: CNGX_MENU_CONFIG,\n useFactory: (parent: CngxMenuConfig | null) =>\n applyFeatures(parent ?? DEFAULT_MENU_CONFIG, features),\n deps: [[new SkipSelf(), new Optional(), CNGX_MENU_CONFIG]],\n },\n ];\n}\n\n/**\n * Resolves the {@link CngxMenuConfig} from the current injection scope.\n * Must run inside an injection context.\n *\n * @category common/interactive/menu\n */\nexport function injectMenuConfig(): CngxMenuConfig {\n return inject(CNGX_MENU_CONFIG);\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\nimport type { CngxActiveDescendant } from '@cngx/common/a11y';\n\nimport type { CngxMenuSubmenuLike } from './menu-submenu.token';\n\n/**\n * Structural contract a `CngxMenu` (or a future menu-bar / nested menu\n * host) exposes to composers. Triggers and submenu directives depend on\n * this interface rather than on the concrete `CngxMenu` class so the\n * coupling stays substitutable.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuHost {\n readonly ad: CngxActiveDescendant;\n /**\n * Submenu companions registered inside this menu's content tree.\n * Empty when no submenu directive is present. Recursive: each entry's\n * `inner` is itself a `CngxMenuHost` with its own (possibly empty)\n * `submenuItems`.\n */\n readonly submenuItems: Signal<readonly CngxMenuSubmenuLike[]>;\n /**\n * Move DOM focus to the menu container element. Triggers that need to\n * transfer focus into the menu after open call this. Consumers must\n * ensure the host element carries a non-negative tabindex; see\n * `CngxMenu.focus()`.\n */\n focus(): void;\n}\n\n/**\n * DI token a menu host provides for sub-component composers (e.g. an\n * inside-the-menu submenu trigger) that resolve the host via `inject()`.\n * Triggers that live on a different element pass a template-ref through\n * an input typed against `CngxMenuHost` instead - DI across element\n * boundaries cannot reach the menu.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_HOST = new InjectionToken<CngxMenuHost>('CNGX_MENU_HOST');\n","import { InjectionToken, type Signal } from '@angular/core';\n\nimport type { CngxMenuHost } from './menu-host.token';\n\n/**\n * Structural contract a `CngxMenuItemSubmenu` (or any submenu-aware\n * companion) exposes so the surrounding menu trigger can drive\n * arrow-right / arrow-left keyboard semantics through a focus-stack\n * model. The trigger looks up a submenu by matching the active item's\n * `id` against this contract's `id`.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuSubmenuLike {\n /** Host element id - matches the surrounding `CngxMenuItem` id. */\n readonly id: string;\n /** Reactive open state, mirrored from the wrapped popover. */\n readonly isOpen: Signal<boolean>;\n /** The submenu's inner menu host (its `CngxMenu` instance). */\n readonly inner: CngxMenuHost;\n open(): void;\n close(): void;\n}\n\n/**\n * DI token a submenu-companion directive provides. The surrounding menu\n * collects every provider via `contentChildren(CNGX_MENU_SUBMENU_ITEM,\n * { descendants: true })` and exposes the array on `CngxMenuHost.submenuItems`.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-submenu.token.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_SUBMENU_ITEM = new InjectionToken<CngxMenuSubmenuLike>(\n 'CNGX_MENU_SUBMENU_ITEM',\n);\n","import {\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n isDevMode,\n untracked,\n} from '@angular/core';\nimport {\n outputFromObservable,\n outputToObservable,\n takeUntilDestroyed,\n} from '@angular/core/rxjs-interop';\n\nimport { CngxActiveDescendant } from '@cngx/common/a11y';\n\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\nimport { CNGX_MENU_HOST, type CngxMenuHost } from './menu-host.token';\nimport { CNGX_MENU_SUBMENU_ITEM, type CngxMenuSubmenuLike } from './menu-submenu.token';\n\nconst warnedFocusHosts = new WeakSet<HTMLElement>();\n\n/**\n * Navigable menu container with WAI-ARIA `role=\"menu\"` semantics.\n *\n * Uses `CngxActiveDescendant` as a `hostDirective` so items rendered with\n * `CngxMenuItem` (or its sub-roles) are tracked automatically. No selection\n * state - menus fire actions through the `itemActivated` output.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenuTrigger, CngxMenuItem, CngxMenuGroup, CngxContextMenuTrigger, CngxActiveDescendant\n * <example-url>http://localhost:4200/#/common/interactive/context-menu/right-click-target-zone</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/trigger/dropdown-menu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenu]',\n exportAs: 'cngxMenu',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxActiveDescendant,\n inputs: ['orientation', 'loop', 'typeahead', 'autoHighlightFirst'],\n },\n ],\n providers: [{ provide: CNGX_MENU_HOST, useExisting: CngxMenu }],\n host: {\n role: 'menu',\n tabindex: '0',\n '[attr.aria-label]': 'label()',\n },\n})\nexport class CngxMenu implements CngxMenuHost {\n /** Accessible label. */\n readonly label = input.required<string>();\n\n /** Underlying `CngxActiveDescendant` - exposed for trigger composition. */\n readonly ad = inject(CngxActiveDescendant, { self: true, host: true });\n\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly menuConfig = injectMenuConfig();\n\n /**\n * Submenu directives registered inside this menu's content tree. Empty\n * when the menu has no submenus. Drives the trigger's focus-stack\n * arrow-right / arrow-left semantics.\n */\n readonly submenuItems = contentChildren<CngxMenuSubmenuLike>(CNGX_MENU_SUBMENU_ITEM, {\n descendants: true,\n });\n\n /** Emits the activated item's value on Enter/Space/click. */\n readonly itemActivated = outputFromObservable(\n outputToObservable(this.ad.activated).pipe(takeUntilDestroyed()),\n );\n\n constructor() {\n outputToObservable(this.ad.activated)\n .pipe(takeUntilDestroyed())\n .subscribe(() => {\n untracked(() => {\n this.announcer.announce(this.menuConfig.ariaLabels.itemActivated);\n });\n });\n }\n\n /**\n * Move DOM focus to the menu container so its host\n * `CngxActiveDescendant` receives keyboard input. Consumers (notably\n * `CngxContextMenuTrigger`) call this after open to transfer focus\n * from the trigger zone into the menu. The host element MUST carry a\n * non-negative `tabindex` for focus to land - the menu's stories use\n * `tabindex=\"0\"` and consumers should mirror that.\n *\n * `preventScroll: true` keeps the popover anchored when focusing into\n * a menu that lives outside the visual viewport edge.\n */\n focus(): void {\n const el = this.elementRef.nativeElement;\n if (isDevMode() && el.tabIndex < 0 && !warnedFocusHosts.has(el)) {\n warnedFocusHosts.add(el);\n console.warn(\n 'CngxMenu.focus(): host element has tabindex < 0; focus() will silently no-op. ' +\n 'Add tabindex=\"0\" to the cngxMenu host so the menu container receives keyboard focus.',\n );\n }\n el.focus({ preventScroll: true });\n }\n}\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { CNGX_AD_ITEM, CngxActiveDescendant, type CngxAdItemHandle } from '@cngx/common/a11y';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\n\n/**\n * A single action menuitem registered with a surrounding `CngxActiveDescendant`.\n * Unlike `CngxOption`, menu items carry no selection state - activation fires\n * the AD's `activated` output and the consumer dispatches the action.\n *\n * Click activates (honouring the disabled state). `pointerenter` highlights\n * without activating, matching native menu behaviour.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxMenuItemCheckbox, CngxMenuItemRadio, CngxMenuItemSubmenu\n * <example-url>http://localhost:4200/#/common/interactive/context-menu/right-click-target-zone</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/trigger/dropdown-menu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuItem]',\n exportAs: 'cngxMenuItem',\n standalone: true,\n providers: [{ provide: CNGX_AD_ITEM, useExisting: CngxMenuItem }],\n host: {\n role: 'menuitem',\n '[id]': 'id',\n '[class.cngx-menu-item--highlighted]': 'isHighlighted()',\n '[class.cngx-menu-item--disabled]': 'disabled()',\n '[attr.aria-disabled]': 'disabled() || null',\n '[attr.tabindex]': '-1',\n '(click)': 'handleClick()',\n '(pointerenter)': 'handlePointerEnter()',\n },\n})\nexport class CngxMenuItem<T = unknown> implements CngxAdItemHandle {\n readonly value = input<T | undefined>(undefined);\n readonly disabled = input<boolean>(false);\n readonly labelInput = input<string | undefined>(undefined, { alias: 'label' });\n\n readonly id = nextUid('cngx-menu-item');\n\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly ad = inject(CngxActiveDescendant, { optional: true });\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly menuConfig = injectMenuConfig();\n\n readonly isHighlighted = computed<boolean>(() => this.ad?.activeId() === this.id);\n\n readonly label = (): string => {\n const explicit = this.labelInput();\n if (explicit) {\n return explicit;\n }\n const el = this.elementRef.nativeElement as HTMLElement;\n return (el.textContent ?? '').trim();\n };\n\n protected handleClick(): void {\n if (this.disabled()) {\n this.announcer.announce(this.menuConfig.ariaLabels.itemDisabled);\n return;\n }\n const ad = this.ad;\n if (!ad) {\n return;\n }\n ad.highlightByValue(this.value());\n ad.activateCurrent();\n }\n\n protected handlePointerEnter(): void {\n if (this.disabled()) {\n return;\n }\n this.ad?.highlightByValue(this.value());\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Marker directive for the leading icon position inside a `[cngxMenuItem]`.\n * Applies `cngx-menu-item__icon` to the host element and defaults the host\n * to `aria-hidden=\"true\"` - the slot is decorative, the item's accessible\n * name comes from the projected label. Consumers needing a screen-reader\n * label on the icon override the default with `[attr.aria-hidden]=\"null\"`.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemLabel, CngxMenuItemSuffix, CngxMenuItemKbd\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemIcon]',\n exportAs: 'cngxMenuItemIcon',\n standalone: true,\n host: {\n class: 'cngx-menu-item__icon',\n 'aria-hidden': 'true',\n },\n})\nexport class CngxMenuItemIcon {}\n\n/**\n * Marker directive for the primary label position inside a\n * `[cngxMenuItem]`. Applies `cngx-menu-item__label`. No `aria-hidden`\n * default - the label is the menu item's accessible name and must reach\n * assistive technology.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemIcon, CngxMenuItemSuffix, CngxMenuItemKbd\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemLabel]',\n exportAs: 'cngxMenuItemLabel',\n standalone: true,\n host: { class: 'cngx-menu-item__label' },\n})\nexport class CngxMenuItemLabel {}\n\n/**\n * Marker directive for a trailing detail slot inside a `[cngxMenuItem]`\n * - secondary text or a status pill that sits between the label and the\n * keyboard-shortcut hint. Applies `cngx-menu-item__suffix` and defaults\n * the host to `aria-hidden=\"true\"`. The slot is supplemental, the\n * primary name belongs to the label. Override with\n * `[attr.aria-hidden]=\"null\"` when the suffix carries meaning AT needs\n * (status text, semantic badge).\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemKbd\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemSuffix]',\n exportAs: 'cngxMenuItemSuffix',\n standalone: true,\n host: {\n class: 'cngx-menu-item__suffix',\n 'aria-hidden': 'true',\n },\n})\nexport class CngxMenuItemSuffix {}\n\n/**\n * Marker directive for the keyboard-shortcut hint position inside a\n * `[cngxMenuItem]`. Applies `cngx-menu-item__kbd` and defaults the host\n * to `aria-hidden=\"true\"` - the visual hint duplicates the underlying\n * accelerator already wired to the consumer's command, AT readout of the\n * hint would just repeat the label. Typically placed on a `<kbd>`.\n * Override with `[attr.aria-hidden]=\"null\"` if the hint is a consumer's\n * primary affordance.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemSuffix\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemKbd]',\n exportAs: 'cngxMenuItemKbd',\n standalone: true,\n host: {\n class: 'cngx-menu-item__kbd',\n 'aria-hidden': 'true',\n },\n})\nexport class CngxMenuItemKbd {}\n","import {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n linkedSignal,\n signal,\n untracked,\n} from '@angular/core';\n\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\nimport type { CngxMenuHost } from './menu-host.token';\nimport { CngxMenuItem } from './menu-item.directive';\nimport { CNGX_MENU_SUBMENU_ITEM, type CngxMenuSubmenuLike } from './menu-submenu.token';\n\n/** See `CngxListboxTrigger` - same structural contract. */\ninterface PopoverController {\n readonly isVisible: () => boolean;\n show(): void;\n hide(): void;\n readonly anchorElement: { set(el: HTMLElement | null): void };\n /**\n * Popover unique id signal - used to compose the `anchor-name` CSS value\n * the browser's CSS Anchor Positioning expects on the anchor element.\n */\n readonly id: () => string;\n /**\n * Popover host element - the submenu directive attaches hover listeners to\n * it so the submenu stays open while the user mouses over its items.\n */\n readonly elementRef: ElementRef<HTMLElement>;\n}\n\n/**\n * Companion directive applied to a `[cngxMenuItem]` that opens a nested\n * submenu. The directive itself does NOT render `role=\"menuitem\"` - that\n * stays on `CngxMenuItem`. Adds `aria-haspopup=\"menu\"` and reactive\n * `aria-expanded`, registers itself with the surrounding menu as a\n * submenu source so the menu trigger can drive arrow-right / arrow-left\n * focus-stack semantics.\n *\n * Two inputs:\n * - `cngxMenuItemSubmenu`: the popover wrapping the submenu.\n * - `submenuMenu`: the inner `CngxMenu` (or any `CngxMenuHost`) the\n * trigger transfers focus to when the submenu opens.\n *\n * The submenu's `<div cngxPopover>` MUST set `[exclusive]=\"false\"` so that\n * opening it does not light-dismiss the parent popover. This is the only\n * extra wiring the consumer needs beyond the two inputs.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-submenu.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenu, CngxMenuTrigger\n * <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemSubmenu]',\n exportAs: 'cngxMenuItemSubmenu',\n standalone: true,\n providers: [{ provide: CNGX_MENU_SUBMENU_ITEM, useExisting: CngxMenuItemSubmenu }],\n host: {\n '[id]': 'id',\n '[attr.aria-haspopup]': '\"menu\"',\n '[attr.aria-expanded]': 'isOpen()',\n '[style.anchor-name]': 'cssAnchorName()',\n '(pointerenter)': 'handleParentEnter()',\n '(pointerleave)': 'handleParentLeave()',\n },\n})\nexport class CngxMenuItemSubmenu implements CngxMenuSubmenuLike {\n /** Popover wrapping the submenu. Required. */\n readonly popover = input.required<PopoverController>({ alias: 'cngxMenuItemSubmenu' });\n\n /** Inner `CngxMenuHost` (the submenu's own `CngxMenu`). Required. */\n readonly submenuMenu = input.required<CngxMenuHost>();\n\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly menuItem = inject(CngxMenuItem, { optional: true, self: true });\n private readonly ownId = nextUid('cngx-menu-submenu');\n\n /**\n * Effective id used by `CngxMenuTrigger.submenuItems().find(s => s.id ===\n * activeId)`. When applied alongside `[cngxMenuItem]` the directive\n * mirrors the sibling's id so the trigger's lookup matches the AD's\n * `activeId`. When applied alone (no sibling), falls back to a fresh\n * `nextUid` - the AD will never highlight this element so the trigger\n * lookup is moot, but the host element still receives a valid id.\n */\n get id(): string {\n return this.menuItem?.id ?? this.ownId;\n }\n\n readonly isOpen = computed<boolean>(() => this.popover().isVisible());\n\n /** CSS Anchor Positioning name - matches the popover's `position-anchor`. */\n protected readonly cssAnchorName = computed(() => `--cngx-pop-${this.popover().id()}`);\n\n get inner(): CngxMenuHost {\n return this.submenuMenu();\n }\n\n open(): void {\n this.popover().anchorElement.set(this.elementRef.nativeElement as HTMLElement);\n if (!this.popover().isVisible()) {\n this.popover().show();\n }\n }\n\n close(): void {\n if (this.popover().isVisible()) {\n this.popover().hide();\n }\n }\n\n // Submenu opens on parent hover; stays open while the pointer is over the\n // parent OR the popover. Closes `submenuCloseDelay` ms after leaving both.\n\n private readonly parentHovered = signal(false);\n private readonly popoverHovered = signal(false);\n private readonly anyHovered = computed(() => this.parentHovered() || this.popoverHovered());\n\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n\n protected handleParentEnter(): void {\n this.parentHovered.set(true);\n }\n\n protected handleParentLeave(): void {\n this.parentHovered.set(false);\n }\n\n private cancelCloseTimer(): void {\n if (this.closeTimer !== null) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private scheduleClose(): void {\n this.cancelCloseTimer();\n const delay = this.menuConfig.submenuCloseDelay;\n if (delay <= 0) {\n this.close();\n return;\n }\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n this.close();\n }, delay);\n }\n\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly menuConfig = injectMenuConfig();\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Transition tracker for `isOpen`. `linkedSignal` carries an explicit\n * structural `equal` so the effect below only fires on a real\n * boolean transition, not on every parent re-eval.\n */\n private readonly transition = linkedSignal<boolean, { current: boolean; previous: boolean }>({\n source: this.isOpen,\n computation: (current, prev) => ({\n current,\n previous: prev?.value.current ?? false,\n }),\n equal: (a, b) => a.current === b.current && a.previous === b.previous,\n });\n\n constructor() {\n effect(() => {\n const { current, previous } = this.transition();\n if (current === previous) {\n return;\n }\n untracked(() => {\n if (current) {\n this.announcer.announce(this.menuConfig.ariaLabels.submenuOpened);\n } else {\n this.announcer.announce(this.menuConfig.ariaLabels.submenuClosed);\n }\n });\n });\n\n effect(() => {\n const hovered = this.anyHovered();\n untracked(() => {\n if (hovered) {\n this.cancelCloseTimer();\n this.open();\n } else if (this.popover().isVisible()) {\n this.scheduleClose();\n }\n });\n });\n\n afterNextRender(() => {\n const popoverEl = this.popover().elementRef.nativeElement;\n const onEnter = (): void => this.popoverHovered.set(true);\n const onLeave = (): void => this.popoverHovered.set(false);\n popoverEl.addEventListener('pointerenter', onEnter);\n popoverEl.addEventListener('pointerleave', onLeave);\n this.destroyRef.onDestroy(() => {\n popoverEl.removeEventListener('pointerenter', onEnter);\n popoverEl.removeEventListener('pointerleave', onLeave);\n this.cancelCloseTimer();\n });\n });\n\n if (isDevMode()) {\n afterNextRender(() => {\n if (this.menuItem === null) {\n console.warn(\n '[cngxMenuItemSubmenu] applied without a sibling [cngxMenuItem] on the same host element. ' +\n 'The surrounding CngxMenuTrigger cannot route ArrowRight / activation to this submenu ' +\n 'because CngxActiveDescendant only highlights CngxMenuItem nodes. ' +\n 'Add [cngxMenuItem] alongside [cngxMenuItemSubmenu] on the same element.',\n );\n }\n warnMissingSubmenuFallbacks(this.popover().elementRef.nativeElement);\n });\n }\n }\n}\n\n/**\n * @internal\n * Tracks which Documents have already warned about a submenu popover missing position-try-fallbacks.\n */\nconst submenuFallbackWarnedDocs = new WeakSet<Document>();\n\n/**\n * @internal - test hook. Resets the per-Document warning suppression so\n * specs can exercise the warning path against a shared jsdom Document.\n * Do not call from production code.\n */\nexport function __resetSubmenuFallbackWarnings(doc: Document): void {\n submenuFallbackWarnedDocs.delete(doc);\n}\n/** @internal */\nfunction warnMissingSubmenuFallbacks(popoverEl: HTMLElement): void {\n const doc = popoverEl.ownerDocument;\n if (submenuFallbackWarnedDocs.has(doc)) {\n return;\n }\n const resolved = getComputedStyle(popoverEl).getPropertyValue('position-try-fallbacks').trim();\n if (resolved !== '') {\n return;\n }\n submenuFallbackWarnedDocs.add(doc);\n console.warn(\n 'CngxMenuItemSubmenu: the companion popover ships without [positionTryFallbacks]. ' +\n 'Submenus that clip the viewport edge will not flip without a try-fallback chain. ' +\n 'Wire the recommended default:\\n\\n' +\n \" import { CNGX_SUBMENU_TRY_FALLBACKS } from '@cngx/common/interactive';\\n\\n\" +\n ' <div cngxPopover [positionTryFallbacks]=\"CNGX_SUBMENU_TRY_FALLBACKS\">\\n' +\n ' <!-- submenu items -->\\n' +\n ' </div>\\n',\n );\n}\n","/**\n * Recommended `position-try-fallbacks` chain for menu submenu popovers.\n *\n * Consumers wire the const on the submenu's `cngxPopover` element:\n * ```html\n * <div cngxPopover [positionTryFallbacks]=\"CNGX_SUBMENU_TRY_FALLBACKS\">\n * <!-- submenu items -->\n * </div>\n * ```\n *\n * The chain matches the\n * `projects/forms/select/shared/select-base.css:759` precedent\n * (`flip-block, flip-inline, flip-block flip-inline`) — `flip-inline`\n * is the dominant submenu clip case (right submenu hits the viewport\n * right edge → flips to the left side of its parent item),\n * `flip-block` covers the vertical case, and the composed form\n * covers diagonal clipping.\n *\n * `CngxMenuItemSubmenu` emits a one-shot dev-mode warning when a\n * submenu popover ships without `positionTryFallbacks` — the const\n * is documented as the canonical opt-in.\n *\n * Typed as a string-literal tuple via `as const` rather than the\n * `PopoverPositionTryFallback` union from `@cngx/common/popover` —\n * the cross-entry-point import would reverse the existing\n * `popover -> interactive` dependency direction and break ng-packagr.\n * Consumers binding the const to `[positionTryFallbacks]` get\n * compile-time type checking from the input's typed signature on the\n * popover side.\n *\n * @category common/interactive/menu\n */\nexport const CNGX_SUBMENU_TRY_FALLBACKS = Object.freeze([\n 'flip-inline',\n 'flip-block',\n 'flip-block flip-inline',\n] as const);\n","import {\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n} from '@angular/core';\n\nimport { CNGX_AD_ITEM, CngxActiveDescendant, type CngxAdItemHandle } from '@cngx/common/a11y';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\n\n/**\n * Checkable menu item (`role=\"menuitemcheckbox\"`). Activation toggles\n * `checked` and emits `checkedChange`. Unlike `CngxMenuItem`, the item\n * carries its own selection state.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-checkbox.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemRadio, CngxMenu\n * <example-url>http://localhost:4200/#/common/interactive/menu/checkable/text-formatting-menu</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemCheckbox]',\n exportAs: 'cngxMenuItemCheckbox',\n standalone: true,\n providers: [{ provide: CNGX_AD_ITEM, useExisting: CngxMenuItemCheckbox }],\n host: {\n role: 'menuitemcheckbox',\n '[id]': 'id',\n '[attr.aria-checked]': 'checked()',\n '[attr.aria-disabled]': 'disabled() || null',\n '[class.cngx-menu-item--highlighted]': 'isHighlighted()',\n '[class.cngx-menu-item--disabled]': 'disabled()',\n '[class.cngx-menu-item--checked]': 'checked()',\n '[attr.tabindex]': '-1',\n '(click)': 'handleClick()',\n '(pointerenter)': 'handlePointerEnter()',\n },\n})\nexport class CngxMenuItemCheckbox<T = unknown> implements CngxAdItemHandle {\n readonly value = input<T | undefined>(undefined);\n readonly disabled = input<boolean>(false);\n readonly labelInput = input<string | undefined>(undefined, { alias: 'label' });\n readonly checked = model<boolean>(false);\n\n readonly id = nextUid('cngx-menu-item');\n\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly ad = inject(CngxActiveDescendant, { optional: true });\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly menuConfig = injectMenuConfig();\n\n readonly isHighlighted = computed<boolean>(() => this.ad?.activeId() === this.id);\n\n readonly label = (): string => {\n const explicit = this.labelInput();\n if (explicit) {\n return explicit;\n }\n const el = this.elementRef.nativeElement as HTMLElement;\n return (el.textContent ?? '').trim();\n };\n\n protected handleClick(): void {\n if (this.disabled()) {\n this.announcer.announce(this.menuConfig.ariaLabels.itemDisabled);\n return;\n }\n const ad = this.ad;\n if (!ad) {\n return;\n }\n ad.highlightByValue(this.value());\n this.checked.update((c) => !c);\n ad.activateCurrent();\n }\n\n protected handlePointerEnter(): void {\n if (this.disabled()) {\n return;\n }\n this.ad?.highlightByValue(this.value());\n }\n}\n","import { InjectionToken, type ModelSignal, type Signal } from '@angular/core';\n\n/**\n * Selection contract a radio-grouping menu host exposes to its\n * `CngxMenuItemRadio` children. Children read `selectedValue()` to compute\n * `aria-checked` and call `select(value)` to update on click; the host owns\n * the writable signal so consumers two-way bind through it.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuRadioGroup<T> {\n readonly selectedValue: ModelSignal<T | undefined>;\n readonly name: Signal<string | undefined>;\n select(value: T): void;\n}\n\n/**\n * Factory shape - pass into a custom DI provider to wrap selection in\n * telemetry, server-sync, or audit logging without forking `CngxMenuGroup`.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuRadioGroupFactory = <T>(deps: {\n readonly selectedValue: ModelSignal<T | undefined>;\n readonly name: Signal<string | undefined>;\n}) => CngxMenuRadioGroup<T>;\n\n/**\n * Pure factory wiring a {@link CngxMenuRadioGroup} from already-created\n * signals. `CngxMenuGroup` implements the contract directly; this factory\n * exists for hand-built menu hosts that do not declare a directive but\n * still need to provide `CNGX_MENU_RADIO_GROUP`.\n *\n * @category common/interactive/menu\n */\nexport const createMenuRadioController: CngxMenuRadioGroupFactory = ({ selectedValue, name }) => ({\n selectedValue,\n name,\n select(value) {\n selectedValue.set(value);\n },\n});\n\n/**\n * DI token a radio-grouping menu host provides for `CngxMenuItemRadio` to\n * resolve. Items inject with `{ optional: true }` so a radio item rendered\n * outside any group still works (it just reports `aria-checked=\"false\"`).\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-radio-controller.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_RADIO_GROUP = new InjectionToken<CngxMenuRadioGroup<unknown>>(\n 'CNGX_MENU_RADIO_GROUP',\n);\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { CNGX_AD_ITEM, CngxActiveDescendant, type CngxAdItemHandle } from '@cngx/common/a11y';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\nimport { CNGX_MENU_RADIO_GROUP } from './menu-radio-controller';\n\n/**\n * Radio-style menu item (`role=\"menuitemradio\"`). Mutual exclusion is scoped\n * to the enclosing `CngxMenuGroup` - only one radio per group is checked at\n * a time.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-radio.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenuItem, CngxMenuItemCheckbox, CngxMenuGroup\n * <example-url>http://localhost:4200/#/common/interactive/menu/checkable/text-formatting-menu</example-url>\n */\n@Directive({\n selector: '[cngxMenuItemRadio]',\n exportAs: 'cngxMenuItemRadio',\n standalone: true,\n providers: [{ provide: CNGX_AD_ITEM, useExisting: CngxMenuItemRadio }],\n host: {\n role: 'menuitemradio',\n '[id]': 'id',\n '[attr.aria-checked]': 'checked()',\n '[attr.aria-disabled]': 'disabled() || null',\n '[class.cngx-menu-item--highlighted]': 'isHighlighted()',\n '[class.cngx-menu-item--disabled]': 'disabled()',\n '[class.cngx-menu-item--checked]': 'checked()',\n '[attr.tabindex]': '-1',\n '(click)': 'handleClick()',\n '(pointerenter)': 'handlePointerEnter()',\n },\n})\nexport class CngxMenuItemRadio<T = unknown> implements CngxAdItemHandle {\n readonly value = input.required<T>();\n readonly disabled = input<boolean>(false);\n readonly labelInput = input<string | undefined>(undefined, { alias: 'label' });\n\n readonly id = nextUid('cngx-menu-item');\n\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly ad = inject(CngxActiveDescendant, { optional: true });\n private readonly group = inject(CNGX_MENU_RADIO_GROUP, { optional: true });\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly menuConfig = injectMenuConfig();\n\n readonly isHighlighted = computed<boolean>(() => this.ad?.activeId() === this.id);\n\n /** Whether this radio is the currently selected value in its group. */\n readonly checked = computed<boolean>(() => {\n const group = this.group;\n if (!group) {\n return false;\n }\n return Object.is(group.selectedValue(), this.value());\n });\n\n readonly label = (): string => {\n const explicit = this.labelInput();\n if (explicit) {\n return explicit;\n }\n const el = this.elementRef.nativeElement as HTMLElement;\n return (el.textContent ?? '').trim();\n };\n\n protected handleClick(): void {\n if (this.disabled()) {\n this.announcer.announce(this.menuConfig.ariaLabels.itemDisabled);\n return;\n }\n const ad = this.ad;\n if (!ad) {\n return;\n }\n ad.highlightByValue(this.value());\n this.group?.select(this.value());\n ad.activateCurrent();\n }\n\n protected handlePointerEnter(): void {\n if (this.disabled()) {\n return;\n }\n this.ad?.highlightByValue(this.value());\n }\n}\n","import { Directive, input, model } from '@angular/core';\n\nimport { CNGX_MENU_RADIO_GROUP, type CngxMenuRadioGroup } from './menu-radio-controller';\n\n/**\n * Logical grouping for menu items. Renders `role=\"group\"` with an accessible\n * label. For radio groups, the host owns the selected value and exposes it\n * to enclosed `CngxMenuItemRadio` children through the\n * `CNGX_MENU_RADIO_GROUP` contract.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-group.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxMenuItemRadio, CngxMenuItem\n * <example-url>http://localhost:4200/#/common/interactive/menu/checkable/text-formatting-menu</example-url>\n */\n@Directive({\n selector: '[cngxMenuGroup]',\n exportAs: 'cngxMenuGroup',\n standalone: true,\n providers: [{ provide: CNGX_MENU_RADIO_GROUP, useExisting: CngxMenuGroup }],\n host: {\n role: 'group',\n '[attr.aria-label]': 'label()',\n },\n})\nexport class CngxMenuGroup implements CngxMenuRadioGroup<unknown> {\n /** Accessible group label. */\n readonly label = input.required<string>();\n\n /** Optional name for mutual-exclusion scope in radio-item groups. */\n readonly name = input<string | undefined>(undefined);\n\n /** Currently selected radio value within this group. Two-way bindable. */\n readonly selectedValue = model<unknown>(undefined);\n\n select(value: unknown): void {\n this.selectedValue.set(value);\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Visual + semantic separator inside a `CngxMenu`. Renders `role=\"separator\"`\n * with `aria-orientation=\"horizontal\"`. Does **not** register `CNGX_AD_ITEM`,\n * so the surrounding `CngxActiveDescendant` skips it during arrow-key\n * navigation and typeahead - required for action-menu and dropdown-menu\n * patterns where separators visually group items but are not selectable.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-separator.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxMenuItem, CngxMenuGroup\n * <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>\n */\n@Directive({\n selector: '[cngxMenuSeparator]',\n exportAs: 'cngxMenuSeparator',\n standalone: true,\n host: {\n role: 'separator',\n 'aria-orientation': 'horizontal',\n },\n})\nexport class CngxMenuSeparator {}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Outcome dispatched by a {@link CngxMenuNavStrategy} step. Consumers (the\n * menu trigger or a future menubar directive) interpret the action: fire\n * the matching side effect (open/close a popover, hand focus to a parent\n * menu) and `event.preventDefault()` for anything non-`noop`.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuNavAction =\n | { readonly kind: 'open-submenu'; readonly id: string }\n | { readonly kind: 'close-submenu' }\n | { readonly kind: 'move-to-parent' }\n | { readonly kind: 'noop' };\n\n/**\n * Context passed to every strategy step. `activeId` is the current\n * `CngxActiveDescendant.activeId()` snapshot at key-press time;\n * `hasSubmenu`/`submenuOpen` describe whatever submenu state the consumer\n * tracks for the active item.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuNavContext {\n readonly activeId: string | null;\n readonly hasSubmenu: boolean;\n readonly submenuOpen: boolean;\n}\n\n/**\n * Pluggable keyboard policy for ArrowRight/ArrowLeft inside a menu or\n * menubar. The default ({@link createW3CMenuStrategy}) matches the W3C APG\n * menu pattern; consumers needing alternative semantics (e.g. \"ArrowRight\n * always opens, never traverses into the submenu\") register their own\n * via `CNGX_MENU_NAV_STRATEGY`.\n *\n * Strategy steps are pure decisions - they do not call popover.show() or\n * touch any signal directly. The directive that consults the strategy\n * acts on the returned action.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuNavStrategy {\n onArrowRight(ctx: CngxMenuNavContext): CngxMenuNavAction;\n onArrowLeft(ctx: CngxMenuNavContext): CngxMenuNavAction;\n}\n\n/** @internal */\nconst NOOP: CngxMenuNavAction = { kind: 'noop' };\n\n/**\n * Default W3C APG menu keyboard policy:\n *\n * - **ArrowRight** on a submenu parent that is currently closed →\n * `open-submenu`. On an already-open submenu or a leaf item → `noop`\n * (item-level navigation inside the open submenu is owned by the\n * submenu's own active-descendant).\n * - **ArrowLeft** when a submenu is open at the current level →\n * `close-submenu`. Otherwise → `move-to-parent` (an enclosing menubar\n * interprets that; a standalone menu trigger treats it as noop).\n *\n * @category common/interactive/menu\n */\nexport function createW3CMenuStrategy(): CngxMenuNavStrategy {\n return {\n onArrowRight(ctx) {\n if (!ctx.activeId || !ctx.hasSubmenu || ctx.submenuOpen) {\n return NOOP;\n }\n return { kind: 'open-submenu', id: ctx.activeId };\n },\n onArrowLeft(ctx) {\n if (ctx.submenuOpen) {\n return { kind: 'close-submenu' };\n }\n return { kind: 'move-to-parent' };\n },\n };\n}\n\n/**\n * DI token carrying the {@link CngxMenuNavStrategy} that menu/menubar\n * directives consult on every ArrowLeft/ArrowRight press. Defaults to\n * {@link createW3CMenuStrategy}; override via `providers` /\n * `viewProviders` for alternative keyboard semantics.\n *\n * @category common/interactive/menu\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-nav-strategy.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_NAV_STRATEGY = new InjectionToken<CngxMenuNavStrategy>(\n 'CngxMenuNavStrategy',\n { providedIn: 'root', factory: createW3CMenuStrategy },\n);\n","import { defineMenuConfigFeature, type CngxMenuAriaLabels, type CngxMenuConfigFeature } from './menu-config';\n\n/**\n * Override one or more ARIA strings (English defaults). Unset keys keep\n * their default value, so consumers can supply only the locale strings\n * they care about.\n *\n * @category common/interactive/menu\n */\nexport function withAriaLabels(partial: Partial<CngxMenuAriaLabels>): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({\n ...cfg,\n ariaLabels: { ...cfg.ariaLabels, ...partial },\n }));\n}\n\n/**\n * Override the typeahead debounce window (milliseconds) for menu\n * navigation. Default: `300`.\n *\n * @category common/interactive/menu\n */\nexport function withTypeaheadDebounce(ms: number): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, typeaheadDebounce: ms }));\n}\n\n/**\n * Override the delay between hovering a submenu parent and opening the\n * submenu (milliseconds). Default: `0` (open immediately on activation).\n * Reserved for hover-driven menubar implementations.\n *\n * @category common/interactive/menu\n */\nexport function withSubmenuOpenDelay(ms: number): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, submenuOpenDelay: ms }));\n}\n\n/**\n * Override the delay between leaving a submenu parent and closing the\n * submenu (milliseconds). Default: `0`. Reserved for hover-driven\n * menubar implementations.\n *\n * @category common/interactive/menu\n */\nexport function withSubmenuCloseDelay(ms: number): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, submenuCloseDelay: ms }));\n}\n\n/**\n * Whether activating a leaf item closes the menu. Default: `true`\n * (menu semantics — distinct from listbox/combobox which stay open).\n *\n * @category common/interactive/menu\n */\nexport function withCloseOnSelect(close: boolean): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, closeOnSelect: close }));\n}\n\n/**\n * Whether `pointerdown` outside the menu's popover and the trigger host\n * dismisses the menu. Default: `true`. Pass `false` for ESC-only\n * semantics (e.g. a tutorial overlay that wants to keep the menu open\n * while the user clicks through other UI).\n *\n * @category common/interactive/menu\n */\nexport function withDismissOnOutsideClick(dismiss: boolean): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, dismissOnOutsideClick: dismiss }));\n}\n\n/**\n * Whether window `scroll` while the menu is open dismisses it. Default:\n * `false`. Opt in when the menu should follow native context-menu\n * behaviour and close as soon as the page scrolls. Scroll-dismiss\n * listens to `window` only - the nearest scrollable ancestor is not\n * traversed.\n *\n * @category common/interactive/menu\n */\nexport function withDismissOnScroll(dismiss: boolean): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, dismissOnScroll: dismiss }));\n}\n\n/**\n * Whether the \"context lost\" bundle dismisses the menu. The bundle\n * covers BOTH window `blur` (system notification, OS-native menu\n * overlaying, tab switch) AND document `pointercancel` outside the\n * popover and trigger host (palm rejection on touch, gesture cancelled\n * by the browser). The two sources share one toggle because consumers\n * who want one rarely want the other off; consumers needing one\n * without the other replace the entire handler via\n * {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}. Set to `false` to keep\n * both listeners off; `lastDismissSource` will then never report\n * `'blur'` or `'pointer-cancel'`.\n *\n * Default: `true`.\n *\n * @category common/interactive/menu\n */\nexport function withDismissOnBlur(dismiss: boolean): CngxMenuConfigFeature {\n return defineMenuConfigFeature((cfg) => ({ ...cfg, dismissOnBlur: dismiss }));\n}\n","import { InjectionToken, signal, type Signal } from '@angular/core';\n\nimport type { CngxMenuConfig } from './menu-config';\n\n/**\n * Structural contract the menu dismiss handler reads from the popover.\n * Mirrors the inline `PopoverController` shape in\n * `menu-trigger.directive.ts` / `context-menu-trigger.directive.ts` to keep\n * `@cngx/common/interactive` free of `@cngx/common/popover` imports - the\n * popover module already depends on this entry-point and the reverse\n * import would close a circular ng-packagr dependency.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuDismissPopoverRef {\n readonly isVisible: () => boolean;\n hide(): void;\n readonly elementRef: { readonly nativeElement: HTMLElement };\n}\n\n/**\n * Identifier for the dismissal path that fired most recently.\n *\n * - `outside-click` - pointerdown outside both the popover and the trigger\n * host.\n * - `scroll` - window scroll while the menu is open.\n * - `blur` - window blur (system notification, OS-native context menu\n * overlaying the cngx menu).\n * - `pointer-cancel` - document pointercancel originating OUTSIDE the\n * popover and host (palm rejection from outside the menu, gesture\n * cancelled by the browser). In-menu palm rejections do not dismiss.\n * - `escape` - document `keydown` matching the `Escape` key while the\n * popover is visible. Detected by the factory's capture-phase keydown\n * listener so the source is recorded regardless of where DOM focus\n * sits (trigger button, menu container, or elsewhere).\n *\n * **Intent, not effect.** The factory records `'escape'` synchronously\n * on the keystroke and does NOT call `popover.hide()`. Whether the\n * menu actually closes is owned by `CngxPopover.closeOnEscape`:\n * consumers who set `[closeOnEscape]=\"false\"` keep their menu open\n * even though `lastSource` reports `'escape'`. The other sources\n * (`outside-click`, `scroll`, `blur`, `pointer-cancel`) call\n * `popover.hide()` themselves and so always coincide with an actual\n * close - `'escape'` is the one source where intent and effect can\n * diverge.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuDismissSource =\n | 'outside-click'\n | 'scroll'\n | 'blur'\n | 'pointer-cancel'\n | 'escape';\n\n/**\n * Options for {@link createMenuDismissHandler}.\n *\n * Each boolean toggles its listener (pair) independently. When\n * `dismissOnBlur` is `true`, both window `blur` and document\n * `pointercancel` listeners install together - they represent the same\n * \"context lost\" semantic and consumers who want one rarely want the\n * other off.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuDismissHandlerOptions {\n /** Popover whose `.hide()` runs when any dismissal source fires. */\n readonly popover: CngxMenuDismissPopoverRef;\n /**\n * Trigger host element. Pointerdown / pointercancel events whose\n * target lies inside this element are NOT treated as dismissal -\n * interactions with the trigger itself should never close the menu\n * it just opened.\n */\n readonly hostElement: HTMLElement;\n /** Install document `pointerdown` outside-click listener. */\n readonly dismissOnOutsideClick: boolean;\n /** Install window `scroll` listener (capture, passive). */\n readonly dismissOnScroll: boolean;\n /**\n * Install window `blur` AND document `pointercancel` listeners.\n * Bundled together because both signal context loss. `pointercancel`\n * events whose target lies inside the popover or trigger host are\n * filtered out (in-menu palm rejection must not dismiss).\n */\n readonly dismissOnBlur: boolean;\n /**\n * Synchronous callback invoked from the DOM event handler whenever a\n * dismissal source fires. Runs AFTER `popover.hide()` so consumers\n * observing the source see the post-close state. Used by\n * {@link createMenuTriggerDismissBinding} to write a reactive\n * `lastSource` signal from outside any Angular `effect()` context.\n */\n readonly onDismiss?: (source: CngxMenuDismissSource) => void;\n /**\n * Sources whose listeners should NOT install even when their toggle\n * is `true`. Lets a consumer keep `dismissOnBlur: true` but skip the\n * bundled `pointer-cancel` listener (or vice versa) with a one-line\n * factory wrapper:\n *\n * ```ts\n * providers: [{\n * provide: CNGX_MENU_DISMISS_HANDLER_FACTORY,\n * useValue: (opts) => createMenuDismissHandler({\n * ...opts,\n * skipSources: new Set(['pointer-cancel']),\n * }),\n * }]\n * ```\n *\n * `'escape'` may be skipped too; the popover's global Escape listener\n * still owns the close path, so skipping only stops the source from\n * being recorded on `lastSource`.\n */\n readonly skipSources?: ReadonlySet<CngxMenuDismissSource>;\n}\n\n/**\n * Handler returned by {@link createMenuDismissHandler}. Call `attach()`\n * once per menu open; invoke the returned teardown on close.\n *\n * Source observation runs through\n * {@link CngxMenuDismissHandlerOptions.onDismiss}; the handler exposes\n * no reactive state of its own so the trigger directive can store it as\n * a plain field rather than a signal (avoids a signal write inside the\n * `isOpen` effect).\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuDismissHandler {\n /**\n * Install the listeners enabled by the options. Returns a teardown\n * closure that removes every installed listener. Each `attach()` must\n * be balanced by exactly one teardown call.\n */\n attach(): () => void;\n}\n\n/**\n * Factory signature for {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuDismissHandlerFactory = (\n opts: CngxMenuDismissHandlerOptions,\n) => CngxMenuDismissHandler;\n\n/**\n * Default factory. Pure closure over `opts` - no Angular DI. Mirrors the\n * shape of `@cngx/forms/select`'s `createDismissHandler` so future\n * cross-family consolidation has a clean target.\n *\n * Override via {@link CNGX_MENU_DISMISS_HANDLER_FACTORY} for\n * telemetry-wrapped or test-doubled dismissal.\n *\n * @category common/interactive/menu\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/dismiss-handler.ts\n * @since 0.1.0\n */\nexport function createMenuDismissHandler(\n opts: CngxMenuDismissHandlerOptions,\n): CngxMenuDismissHandler {\n const isInsidePopoverOrHost = (target: EventTarget | null): boolean => {\n if (!(target instanceof Node)) {\n return false;\n }\n return (\n opts.popover.elementRef.nativeElement.contains(target) ||\n opts.hostElement.contains(target)\n );\n };\n\n const fire = (source: CngxMenuDismissSource): void => {\n if (!opts.popover.isVisible()) {\n return;\n }\n opts.popover.hide();\n opts.onDismiss?.(source);\n };\n\n const attach = (): (() => void) => {\n const teardowns: (() => void)[] = [];\n const doc = opts.hostElement.ownerDocument;\n const win = doc.defaultView;\n const skip = opts.skipSources;\n\n // Escape detection. Records the source without calling popover.hide() -\n // `CngxPopover.closeOnEscape` owns the actual close decision, so a\n // consumer that disables escape-close on the popover still sees the\n // user's intent surface on `lastSource`. Installed unconditionally\n // because Escape is the canonical menu-dismissal key (WAI-ARIA APG\n // Menu Pattern); skip only via `opts.skipSources`.\n if (!skip?.has('escape')) {\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key !== 'Escape') {\n return;\n }\n if (!opts.popover.isVisible()) {\n return;\n }\n opts.onDismiss?.('escape');\n };\n doc.addEventListener('keydown', onKeyDown, true);\n teardowns.push(() => {\n doc.removeEventListener('keydown', onKeyDown, true);\n });\n }\n\n if (opts.dismissOnOutsideClick && !skip?.has('outside-click')) {\n const onPointerDown = (event: PointerEvent): void => {\n if (!opts.popover.isVisible()) {\n return;\n }\n if (isInsidePopoverOrHost(event.target)) {\n return;\n }\n fire('outside-click');\n };\n doc.addEventListener('pointerdown', onPointerDown, true);\n teardowns.push(() => {\n doc.removeEventListener('pointerdown', onPointerDown, true);\n });\n }\n\n if (opts.dismissOnScroll && !skip?.has('scroll') && win) {\n const onScroll = (): void => fire('scroll');\n win.addEventListener('scroll', onScroll, { capture: true, passive: true });\n teardowns.push(() => {\n win.removeEventListener('scroll', onScroll, { capture: true });\n });\n }\n\n if (opts.dismissOnBlur) {\n if (win && !skip?.has('blur')) {\n const onBlur = (): void => fire('blur');\n win.addEventListener('blur', onBlur);\n teardowns.push(() => {\n win.removeEventListener('blur', onBlur);\n });\n }\n // Filter pointercancel against the popover and host so in-menu palm\n // rejection (touch noise inside the open menu) does not dismiss.\n // Outside-targeted cancellation still fires - matches the\n // \"context lost\" semantics the blur listener covers.\n if (!skip?.has('pointer-cancel')) {\n const onPointerCancel = (event: PointerEvent): void => {\n if (!opts.popover.isVisible()) {\n return;\n }\n if (isInsidePopoverOrHost(event.target)) {\n return;\n }\n fire('pointer-cancel');\n };\n doc.addEventListener('pointercancel', onPointerCancel);\n teardowns.push(() => {\n doc.removeEventListener('pointercancel', onPointerCancel);\n });\n }\n }\n\n return () => {\n for (const t of teardowns) {\n t();\n }\n };\n };\n\n return { attach };\n}\n\n/**\n * Factory token for {@link CngxMenuDismissHandler}. Default\n * {@link createMenuDismissHandler}. Override via\n * `{ provide: CNGX_MENU_DISMISS_HANDLER_FACTORY, useFactory: () => myHandler }`\n * at app root for telemetry instrumentation, or in `viewProviders` for a\n * single feature scope.\n *\n * @category common/interactive/menu\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/dismiss-handler.ts\n * @since 0.1.0\n */\nexport const CNGX_MENU_DISMISS_HANDLER_FACTORY = new InjectionToken<CngxMenuDismissHandlerFactory>(\n 'CngxMenuDismissHandlerFactory',\n {\n providedIn: 'root',\n factory: () => createMenuDismissHandler,\n },\n);\n\n/**\n * Options for {@link createMenuTriggerDismissBinding}. The popover is\n * passed as a thunk because trigger directives resolve their popover\n * input lazily (after Angular binds inputs) - the binding cannot capture\n * the concrete reference at construction time.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuTriggerDismissBindingOptions {\n readonly popover: () => CngxMenuDismissPopoverRef;\n readonly hostElement: HTMLElement;\n readonly menuConfig: CngxMenuConfig;\n readonly factory: CngxMenuDismissHandlerFactory;\n /**\n * Synchronous notification invoked from the DOM event handler after\n * the binding's `lastSource` signal is updated. Trigger directives\n * use it to call `CngxMenuAnnouncer.announce(...)` so screen readers\n * hear which path closed the menu. Runs from the same call stack as\n * the source DOM event - safe for signal reads.\n */\n readonly onDismiss?: (source: CngxMenuDismissSource) => void;\n}\n\n/**\n * Trigger-side dismiss lifecycle. Owns the reactive `lastSource` signal\n * and the attach/detach pair both trigger directives invoke from their\n * `isOpen` effect. Extracted so `CngxMenuTrigger` and\n * `CngxContextMenuTrigger` share the same wiring without forking it.\n *\n * @category common/interactive/menu\n */\nexport interface CngxMenuTriggerDismissBinding {\n /**\n * Resolve the popover thunk, instantiate the handler on first call,\n * and install its listeners. Idempotent within a single open cycle.\n */\n attach(): void;\n /** Remove the listeners installed by the last `attach()`. Idempotent. */\n detach(): void;\n /**\n * The dismissal source that closed the menu most recently. `null`\n * before the first close. Read by templates / telemetry sinks.\n */\n readonly lastSource: Signal<CngxMenuDismissSource | null>;\n}\n\n/**\n * Build the dismiss lifecycle for a menu-bearing trigger directive.\n * Lazily instantiates the handler on first `attach()` so the trigger's\n * popover input is bound before the factory reads it. The returned\n * `lastSource` signal is owned by this binding - the factory writes it\n * via its `onDismiss` callback, which runs from DOM event handlers\n * (never inside an Angular `effect()`).\n *\n * @category common/interactive/menu\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/dismiss-handler.ts\n * @since 0.1.0\n */\nexport function createMenuTriggerDismissBinding(\n opts: CngxMenuTriggerDismissBindingOptions,\n): CngxMenuTriggerDismissBinding {\n const _lastSource = signal<CngxMenuDismissSource | null>(null);\n let handler: CngxMenuDismissHandler | null = null;\n let teardown: (() => void) | null = null;\n\n const attach = (): void => {\n if (teardown !== null) {\n return;\n }\n // Stable-input assumption: the popover thunk and menuConfig snapshot\n // resolve once at first open and are reused for the directive's\n // lifetime. Trigger directives bind popover via input.required (stable\n // post-mount) and read menuConfig once from injectMenuConfig(); a\n // future config-swap path would need to invalidate `handler` here.\n handler ??= opts.factory({\n popover: opts.popover(),\n hostElement: opts.hostElement,\n dismissOnOutsideClick: opts.menuConfig.dismissOnOutsideClick,\n dismissOnScroll: opts.menuConfig.dismissOnScroll,\n dismissOnBlur: opts.menuConfig.dismissOnBlur,\n onDismiss: (source) => {\n _lastSource.set(source);\n opts.onDismiss?.(source);\n },\n });\n teardown = handler.attach();\n };\n\n const detach = (): void => {\n if (teardown === null) {\n return;\n }\n teardown();\n teardown = null;\n };\n\n return {\n attach,\n detach,\n lastSource: _lastSource.asReadonly(),\n };\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n untracked,\n} from '@angular/core';\n\nimport {\n CNGX_MENU_DISMISS_HANDLER_FACTORY,\n createMenuTriggerDismissBinding,\n type CngxMenuDismissPopoverRef,\n} from './dismiss-handler';\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\nimport type { CngxMenuHost } from './menu-host.token';\n\n/** See `CngxListboxTrigger` - same structural contract. */\ninterface PopoverController extends CngxMenuDismissPopoverRef {\n show(): void;\n readonly anchorElement: { set(el: HTMLElement | null): void };\n /**\n * Popover unique id signal - used to compose the `anchor-name` CSS value\n * the browser's CSS Anchor Positioning expects on the anchor element.\n */\n readonly id: () => string;\n}\n\n/**\n * Opens a `CngxMenu`-bearing popover at pointer coordinates in response to\n * `contextmenu` (right-click) or `Shift+F10` (keyboard equivalent).\n *\n * Two inputs:\n * - `cngxContextMenuTrigger`: the `CngxMenu` (or any `CngxMenuHost`) the\n * popover wraps.\n * - `popover`: the `CngxPopover` panel containing the menu. Must be marked\n * `[exclusive]=\"true\"` (default) so that opening this menu light-dismisses\n * any other popover.\n *\n * Anchoring uses a transient zero-size DOM element positioned at the\n * pointer coords, set on the popover's `anchorElement` signal - virtual\n * `getBoundingClientRect` objects are not yet supported as anchors, so\n * the transient div is the workaround.\n *\n * Touch-driven opening via long-press is deliberately out of scope for the\n * initial commit; consumers can compose `CngxLongPress` against the same\n * popover anchor pattern as a follow-up.\n *\n * ### Dismissal\n *\n * Four sources close the menu by default: `Escape`, `pointerdown` outside\n * both the popover and the trigger host, window `blur`, and document\n * `pointercancel`. Window `scroll` is opt-in via\n * {@link withDismissOnScroll}. Touch users get backdrop dismissal through\n * the same `pointerdown` listener - no ESC dependency. The dismissal\n * source that fired most recently is readable through\n * {@link lastDismissSource}.\n *\n * Override individual sources at app root with `withDismissOnOutsideClick`,\n * `withDismissOnScroll`, `withDismissOnBlur`, or swap the whole handler via\n * {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/context-menu-trigger.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxMenuTrigger, CngxPopover\n * <example-url>http://localhost:4200/#/common/interactive/context-menu/right-click-target-zone</example-url>\n */\n@Directive({\n selector: '[cngxContextMenuTrigger]',\n exportAs: 'cngxContextMenuTrigger',\n standalone: true,\n host: {\n '[attr.aria-haspopup]': '\"menu\"',\n '[attr.aria-expanded]': 'isOpen()',\n '(contextmenu)': 'handleContextMenu($event)',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxContextMenuTrigger {\n /** Menu controlled by this trigger. */\n readonly menu = input.required<CngxMenuHost>({ alias: 'cngxContextMenuTrigger' });\n /** Popover that wraps the menu panel. */\n readonly popover = input.required<PopoverController>();\n\n /** Mirrors `popover.isVisible()`. */\n readonly isOpen = computed<boolean>(() => this.popover().isVisible());\n\n private readonly doc = inject(DOCUMENT);\n private readonly hostElRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly menuConfig = injectMenuConfig();\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly dismissBinding = createMenuTriggerDismissBinding({\n popover: () => this.popover(),\n hostElement: this.hostElRef.nativeElement,\n menuConfig: this.menuConfig,\n factory: inject(CNGX_MENU_DISMISS_HANDLER_FACTORY),\n onDismiss: () => this.announcer.announce(this.menuConfig.ariaLabels.menuDismissed),\n });\n private virtualAnchor: HTMLElement | null = null;\n private savedFocus: HTMLElement | null = null;\n\n /**\n * The dismissal source that closed the menu most recently. `null`\n * before the first close. Surface for demos, telemetry, and audit\n * sinks - reads which path fired without re-installing listeners.\n */\n readonly lastDismissSource = this.dismissBinding.lastSource;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.removeVirtualAnchor();\n this.dismissBinding.detach();\n });\n effect(() => {\n const open = this.isOpen();\n untracked(() => {\n if (open) {\n if (this.savedFocus === null) {\n const active = this.doc.activeElement;\n this.savedFocus = active instanceof HTMLElement ? active : null;\n }\n this.dismissBinding.attach();\n } else {\n this.dismissBinding.detach();\n if (this.savedFocus !== null) {\n this.restoreFocus();\n }\n }\n });\n });\n }\n\n protected handleContextMenu(event: MouseEvent): void {\n event.preventDefault();\n this.openAt(event.clientX, event.clientY);\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n // Escape is owned by CngxPopover's global listener; focus has moved\n // into the menu container by the time the user can press it.\n if (event.key === 'F10' && event.shiftKey) {\n event.preventDefault();\n const rect = this.hostElRef.nativeElement.getBoundingClientRect();\n this.openAt(rect.left + rect.width / 2, rect.top + rect.height / 2);\n }\n }\n\n private openAt(x: number, y: number): void {\n // Capture savedFocus eagerly BEFORE show(): the effect-driven capture\n // races the queueMicrotask focus transfer below in real browsers and\n // ends up storing the menu UL instead of the pre-open target. The\n // effect still runs (it also attaches the dismiss binding) but the\n // `savedFocus === null` guard keeps this earlier capture.\n if (this.savedFocus === null) {\n const active = this.doc.activeElement;\n this.savedFocus = active instanceof HTMLElement ? active : null;\n }\n const anchor = this.ensureVirtualAnchor();\n anchor.style.left = `${x}px`;\n anchor.style.top = `${y}px`;\n anchor.style.setProperty('anchor-name', `--cngx-pop-${this.popover().id()}`);\n this.popover().anchorElement.set(anchor);\n if (!this.popover().isVisible()) {\n this.popover().show();\n }\n this.menu().ad.highlightFirst();\n // Defer one microtask so showPopover()'s top-layer DOM mutation\n // settles before focus moves into the menu container - matches the\n // existing close-time `restoreFocus` pattern below.\n queueMicrotask(() => this.menu().focus());\n }\n\n private restoreFocus(): void {\n const target = this.savedFocus;\n this.savedFocus = null;\n if (!target) {\n return;\n }\n queueMicrotask(() => {\n target.focus();\n });\n }\n\n private ensureVirtualAnchor(): HTMLElement {\n if (this.virtualAnchor) {\n return this.virtualAnchor;\n }\n const el = this.doc.createElement('div');\n el.setAttribute('aria-hidden', 'true');\n el.className = 'cngx-context-menu-anchor';\n el.style.cssText = 'position:fixed;width:0;height:0;pointer-events:none';\n this.doc.body.appendChild(el);\n this.virtualAnchor = el;\n return el;\n }\n\n private removeVirtualAnchor(): void {\n this.virtualAnchor?.remove();\n this.virtualAnchor = null;\n }\n}\n","import type { EnvironmentProviders } from '@angular/core';\n\nimport { type CngxMenuConfigFeature, provideMenuConfig } from './menu-config';\n\n/**\n * Union of every feature kind the menu family aggregator accepts. Today\n * that is only `CngxMenuConfigFeature` (target `'config'`); future surfaces\n * (e.g. submenu-only or announcer overrides) will widen this union and\n * `provideCngxMenu` will dispatch to the matching `provide*Config` based on\n * each feature's hidden `_target` discriminator.\n *\n * @category common/interactive/menu\n */\nexport type CngxMenuFeature = CngxMenuConfigFeature;\n\n/**\n * Unified aggregator for the menu family's configuration. Filters features\n * by `_target` and forwards to the matching `provide*Config` function.\n *\n * Today there is exactly one config surface (`CNGX_MENU_CONFIG`), so all\n * features dispatch to {@link provideMenuConfig}. The discriminator\n * scaffolding is in place so adding a future surface does not break the\n * public API of existing `with*` features.\n *\n * Mirrors `provideCngxSelect` from the select-family A+ closure.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideCngxMenu(\n * withAriaLabels({ submenuOpened: 'Untermenü geöffnet' }),\n * withTypeaheadDebounce(500),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/interactive/menu\n */\nexport function provideCngxMenu(...features: CngxMenuFeature[]): EnvironmentProviders {\n const configFeatures = features.filter(\n (f): f is CngxMenuConfigFeature => (f._target ?? 'config') === 'config',\n );\n return provideMenuConfig(...configFeatures);\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\nimport {\n CNGX_MENU_DISMISS_HANDLER_FACTORY,\n createMenuTriggerDismissBinding,\n type CngxMenuDismissPopoverRef,\n} from './dismiss-handler';\nimport { CNGX_MENU_ANNOUNCER_FACTORY } from './menu-announcer';\nimport { injectMenuConfig } from './menu-config';\nimport type { CngxMenuHost } from './menu-host.token';\nimport { CNGX_MENU_NAV_STRATEGY } from './menu-nav-strategy';\nimport type { CngxMenuSubmenuLike } from './menu-submenu.token';\n\n/** See `CngxListboxTrigger` - same structural contract. */\ninterface PopoverController extends CngxMenuDismissPopoverRef {\n show(): void;\n}\n\n/**\n * Trigger atom for dropdown menus.\n *\n * Pairs a focusable element with a `CngxMenu` and a `CngxPopover` through\n * explicit template references - identical keyboard model to\n * `CngxListboxTrigger` except `closeOnSelect` is hardcoded `true` (menu\n * semantics: activating an item dismisses the menu).\n *\n * Carries a focus-stack model for nested submenus: when a submenu opens,\n * its inner `CngxMenu` is pushed onto the stack so subsequent ArrowDown /\n * Up / Home / End / Enter target the submenu's items via its own\n * `CngxActiveDescendant`. ArrowLeft / Escape pop the stack and close the\n * top submenu.\n *\n * ### Focus model\n *\n * The dropdown trigger deliberately keeps DOM focus on the trigger\n * button while the menu is open - WAI-ARIA APG Menu Button Pattern -\n * and drives the menu's `CngxActiveDescendant` from there via host\n * keydown. It does NOT call {@link CngxMenuHost.focus} after open;\n * that path is reserved for {@link CngxContextMenuTrigger}, where the\n * trigger zone is non-focusable consumer content and the menu\n * container itself must take focus to receive keyboard input.\n *\n * ### Dismissal\n *\n * Four dismissal sources close the menu by default: `Escape`, `pointerdown`\n * outside both the popover and the trigger host, window `blur`, and\n * document `pointercancel`. Window `scroll` is opt-in via\n * {@link withDismissOnScroll}. The source that fired most recently is\n * readable through {@link lastDismissSource}.\n *\n * Override individual sources at app root with `withDismissOnOutsideClick`,\n * `withDismissOnScroll`, `withDismissOnBlur`, or swap the whole handler via\n * {@link CNGX_MENU_DISMISS_HANDLER_FACTORY} for telemetry-wrapped or\n * test-doubled dismissal.\n *\n * @category common/interactive/menu\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-trigger.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMenu, CngxContextMenuTrigger, CngxMenuItemSubmenu, CngxPopoverTrigger\n * <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/menu/trigger/dropdown-menu</example-url>\n */\n@Directive({\n selector: '[cngxMenuTrigger]',\n exportAs: 'cngxMenuTrigger',\n standalone: true,\n host: {\n '[attr.aria-haspopup]': '\"menu\"',\n '[attr.aria-expanded]': 'isOpen()',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxMenuTrigger {\n /** Menu controlled by this trigger. */\n readonly menu = input.required<CngxMenuHost>({ alias: 'cngxMenuTrigger' });\n /** Popover that wraps the menu panel. */\n readonly popover = input.required<PopoverController>();\n\n /** Mirrors `CngxPopover.isVisible()`. */\n readonly isOpen = computed<boolean>(() => this.popover().isVisible());\n\n private readonly nav = inject(CNGX_MENU_NAV_STRATEGY);\n\n /**\n * Active submenu chain - empty when only the outer menu is open. Each\n * entry is the `inner` host of an open submenu, top entry being the\n * deepest. Keystrokes target the top entry's AD.\n */\n private readonly submenuStack = signal<readonly CngxMenuHost[]>([]);\n\n /**\n * Focused element captured at popover-open time. Restored after close via\n * `queueMicrotask` so the focus write happens after the popover-close DOM\n * mutation settles. Captured reactively via the `isOpen` effect below so\n * mouse-driven open paths (consumer's `(click)=\"pop.toggle()\"`) get the\n * same treatment as keyboard-driven open paths.\n */\n private savedFocus: HTMLElement | null = null;\n\n private readonly doc = inject(DOCUMENT);\n private readonly hostElRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly menuConfig = injectMenuConfig();\n private readonly announcer = inject(CNGX_MENU_ANNOUNCER_FACTORY)();\n private readonly dismissBinding = createMenuTriggerDismissBinding({\n popover: () => this.popover(),\n hostElement: this.hostElRef.nativeElement,\n menuConfig: this.menuConfig,\n factory: inject(CNGX_MENU_DISMISS_HANDLER_FACTORY),\n onDismiss: () => this.announcer.announce(this.menuConfig.ariaLabels.menuDismissed),\n });\n\n /**\n * The dismissal source that closed the menu most recently. `null`\n * before the first close. Surface for demos, telemetry, and audit\n * sinks - reads which path fired without re-installing listeners.\n */\n readonly lastDismissSource = this.dismissBinding.lastSource;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.dismissBinding.detach());\n effect(() => {\n const open = this.isOpen();\n untracked(() => {\n if (open) {\n if (this.savedFocus === null) {\n const active = this.doc.activeElement;\n this.savedFocus = active instanceof HTMLElement ? active : null;\n }\n this.dismissBinding.attach();\n } else {\n this.dismissBinding.detach();\n if (this.savedFocus !== null) {\n this.restoreFocus();\n }\n }\n });\n });\n }\n\n private effectiveMenu(): CngxMenuHost {\n const stack = this.submenuStack();\n return stack.length === 0 ? this.menu() : stack[stack.length - 1];\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n const key = event.key;\n\n if (!this.isOpen()) {\n if (key === 'ArrowDown' || key === 'Enter' || key === ' ') {\n event.preventDefault();\n this.popover().show();\n this.menu().ad.highlightFirst();\n return;\n }\n if (key === 'ArrowUp') {\n event.preventDefault();\n this.popover().show();\n this.menu().ad.highlightLast();\n return;\n }\n return;\n }\n\n const menu = this.effectiveMenu();\n const ad = menu.ad;\n\n switch (key) {\n case 'Escape':\n event.preventDefault();\n if (this.submenuStack().length > 0) {\n event.stopPropagation();\n this.popSubmenu();\n } else {\n this.popover().hide();\n }\n return;\n case 'ArrowDown':\n event.preventDefault();\n ad.highlightNext();\n return;\n case 'ArrowUp':\n event.preventDefault();\n ad.highlightPrev();\n return;\n case 'Home':\n event.preventDefault();\n ad.highlightFirst();\n return;\n case 'End':\n event.preventDefault();\n ad.highlightLast();\n return;\n case 'ArrowRight':\n this.handleArrowRight(menu, ad, event);\n return;\n case 'ArrowLeft':\n this.handleArrowLeft(ad, event);\n return;\n case 'Enter':\n case ' ':\n this.handleActivation(menu, ad, event);\n return;\n }\n }\n\n private handleArrowRight(menu: CngxMenuHost, ad: CngxMenuHost['ad'], event: KeyboardEvent): void {\n const activeId = ad.activeId();\n const submenu = this.findSubmenu(menu, activeId);\n const action = this.nav.onArrowRight({\n activeId,\n hasSubmenu: !!submenu,\n submenuOpen: submenu?.isOpen() ?? false,\n });\n if (action.kind === 'open-submenu' && submenu) {\n event.preventDefault();\n this.openSubmenu(submenu);\n }\n }\n\n private handleArrowLeft(ad: CngxMenuHost['ad'], event: KeyboardEvent): void {\n const stackOpen = this.submenuStack().length > 0;\n const action = this.nav.onArrowLeft({\n activeId: ad.activeId(),\n hasSubmenu: false,\n submenuOpen: stackOpen,\n });\n if (action.kind === 'close-submenu' && stackOpen) {\n event.preventDefault();\n this.popSubmenu();\n }\n }\n\n private handleActivation(menu: CngxMenuHost, ad: CngxMenuHost['ad'], event: KeyboardEvent): void {\n if (!ad.activeItem()) {\n return;\n }\n event.preventDefault();\n const submenu = this.findSubmenu(menu, ad.activeId());\n if (submenu) {\n this.openSubmenu(submenu);\n } else {\n ad.activateCurrent();\n this.closeAll();\n }\n }\n\n private findSubmenu(\n menu: CngxMenuHost,\n activeId: string | null,\n ): CngxMenuSubmenuLike | undefined {\n if (!activeId) {\n return undefined;\n }\n return menu.submenuItems().find((s) => s.id === activeId);\n }\n\n private openSubmenu(submenu: CngxMenuSubmenuLike): void {\n submenu.open();\n this.submenuStack.update((s) => [...s, submenu.inner]);\n submenu.inner.ad.highlightFirst();\n }\n\n private popSubmenu(): void {\n const stack = this.submenuStack();\n if (stack.length === 0) {\n return;\n }\n const top = stack[stack.length - 1];\n const parent = stack.length === 1 ? this.menu() : stack[stack.length - 2];\n const submenu = parent.submenuItems().find((s) => s.inner === top);\n submenu?.close();\n this.submenuStack.update((prev) => prev.slice(0, -1));\n }\n\n private closeAll(): void {\n const stack = this.submenuStack();\n for (let i = stack.length - 1; i >= 0; i--) {\n const inner = stack[i];\n const parent = i === 0 ? this.menu() : stack[i - 1];\n const submenu = parent.submenuItems().find((s) => s.inner === inner);\n submenu?.close();\n }\n this.submenuStack.set([]);\n this.popover().hide();\n }\n\n private restoreFocus(): void {\n const target = this.savedFocus;\n this.savedFocus = null;\n if (!target) {\n return;\n }\n queueMicrotask(() => {\n target.focus();\n });\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\n/**\n * Marks any DOM element as carrying an error state.\n *\n * Generic host-element marker - works on cngx, Material, CDK, native HTML,\n * and third-party hosts. Toggles the `.cngx-error` class hook plus reactive\n * `aria-invalid` / `aria-errormessage` attributes when the bound boolean is\n * true. The directive is purely presentational; it does not own the error\n * state itself, it only reflects it.\n *\n * The `cngxErrorState` input takes a plain `boolean`. Consumers binding a\n * signal write `[cngxErrorState]=\"form.email().invalid()\"` - the signal is\n * invoked at the binding site (canonical Angular pattern), not detected at\n * runtime.\n *\n * ```html\n * <input\n * [cngxErrorState]=\"emailField().invalid()\"\n * cngxErrorMessageId=\"email-error\"\n * />\n * <span id=\"email-error\" role=\"alert\">Please enter a valid email.</span>\n * ```\n *\n * @category common/interactive/error\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-state/error-state.directive.ts\n * @since 0.1.0\n * @relatedTo CngxErrorAggregator, CngxErrorSource, CngxErrorScope\n * <example-url>http://localhost:4200/#/common/interactive/error/state/basic-boolean-flag-flips-aria-invalid-aria-errormessage</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/state/without-message-id-class-hook-aria-invalid-only</example-url>\n */\n@Directive({\n selector: '[cngxErrorState]',\n standalone: true,\n exportAs: 'cngxErrorState',\n host: {\n '[class.cngx-error]': 'cngxErrorState()',\n '[attr.aria-invalid]': 'ariaInvalid()',\n '[attr.aria-errormessage]': 'ariaErrorMessage()',\n },\n})\nexport class CngxErrorState {\n readonly cngxErrorState = input.required<boolean>();\n\n /** Optional id of the element rendering the error message text. */\n readonly cngxErrorMessageId = input<string | null>(null);\n\n /** @internal - explicit boolean, always present in the DOM (cngx ARIA convention). */\n protected readonly ariaInvalid = computed(() => (this.cngxErrorState() ? 'true' : 'false'));\n\n /**\n * @internal - emitted whenever a non-empty message id is bound, regardless\n * of the error flag. cngx convention: ID-bearing ARIA attributes stay in\n * the DOM; visibility of the message element is controlled by the\n * consumer via `aria-hidden` on the message itself.\n */\n protected readonly ariaErrorMessage = computed(() => {\n const id = this.cngxErrorMessageId();\n return id && id.length > 0 ? id : null;\n });\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Contract every {@link CngxErrorScope} (or external override) fulfils.\n *\n * The scope encapsulates the \"should errors be visible right now?\"\n * decision. A scope starts hidden (`showErrors === false`) and reveals\n * when {@link reveal} is called - typically on form submit, on route\n * navigation, or on programmatic error trigger.\n *\n * Descendant directives (`CngxErrorAggregator`, `CngxErrorState`) read\n * the scope's `showErrors` signal to gate their own visibility, so a\n * single `reveal()` propagates atomically through the subtree.\n *\n * @category common/interactive/error\n */\nexport interface CngxErrorScopeContract {\n /** Reactive flag - `true` when errors should be visible to the user. */\n readonly showErrors: Signal<boolean>;\n /** Reveals errors in this scope (idempotent). */\n reveal(): void;\n /** Resets the scope to hidden (idempotent). */\n reset(): void;\n /** Optional name for programmatic registry lookup via {@link CngxErrorRegistry}. */\n readonly scopeName?: Signal<string | undefined>;\n}\n\n/**\n * DI token resolving to the nearest {@link CngxErrorScopeContract} ancestor.\n *\n * Provided by {@link CngxErrorScope} via `useExisting`; descendants inject\n * with `{ optional: true }` and fall back gracefully when no scope is\n * present (no-op).\n *\n * @category common/interactive/error\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-scope/error-scope.token.ts\n * @since 0.1.0\n */\nexport const CNGX_ERROR_SCOPE = new InjectionToken<CngxErrorScopeContract>('CngxErrorScope');\n","import type { CngxErrorAggregatorSourceEntry } from '../error-aggregator/error-aggregator.token';\n\n/**\n * Length-then-key-set equality for `ReadonlyMap` signals.\n *\n * Returns `true` when both maps have the same size AND same key set,\n * **regardless of value identity**. Used by the error registry to\n * short-circuit emissions when an aggregator is replaced under the same\n * name (the downstream computeds re-evaluate per registered aggregator's\n * own signals, not per Map identity).\n *\n * **Swap-is-noop semantics.** Combined with the registry's\n * `register*(name, ref)` helpers, this equal fn means re-registering a\n * *different* contract instance under an *existing* name is absorbed\n * silently — `getScope(name)`/`getAggregator(name)` continue returning\n * the originally registered instance until either an `unregister*(name)`\n * + `register*(name, newRef)` cycle runs (the unregister changes the key\n * set, breaking the equal short-circuit) or a different name is added.\n * This is intentional cascade-suppression: registering a freshly-\n * constructed contract during component re-init must not cascade\n * downstream readers.\n *\n * @internal\n */\nexport function mapKeySetEqual<K, V>(\n a: ReadonlyMap<K, V>,\n b: ReadonlyMap<K, V>,\n): boolean {\n if (a === b) {\n return true;\n }\n if (a.size !== b.size) {\n return false;\n }\n for (const key of a.keys()) {\n if (!b.has(key)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Element-wise equality for readonly arrays. Reference-equal on `===`,\n * length+per-index `===` otherwise.\n *\n * @internal\n */\nexport function shallowReadonlyArrayEqual<T>(a: readonly T[], b: readonly T[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Equality for the source-entry map carried by `CngxErrorAggregator`. Same\n * size, same keys, same `condition` Signal identity per entry, same label.\n * Shared by the directive and the {@link injectErrorAggregator} factory so\n * cascade-suppression behaviour stays in one place.\n *\n * @internal\n */\nexport function errorSourceMapEqual(\n a: ReadonlyMap<string, CngxErrorAggregatorSourceEntry>,\n b: ReadonlyMap<string, CngxErrorAggregatorSourceEntry>,\n): boolean {\n if (a === b) {\n return true;\n }\n if (a.size !== b.size) {\n return false;\n }\n for (const [key, entryA] of a) {\n const entryB = b.get(key);\n if (\n entryB?.condition !== entryA.condition ||\n (entryB.label ?? null) !== (entryA.label ?? null)\n ) {\n return false;\n }\n }\n return true;\n}\n","import { computed, Injectable, signal, type Signal } from '@angular/core';\nimport type { CngxErrorAggregatorContract } from '../error-aggregator/error-aggregator.token';\nimport type { CngxErrorScopeContract } from '../error-scope/error-scope.token';\nimport { mapKeySetEqual, shallowReadonlyArrayEqual } from './equal-fns';\n\n/**\n * Programmatic registry for named error scopes and aggregators.\n *\n * Provides a lookup surface so consumers (route guards, HTTP interceptors,\n * test harnesses) can inspect or drive form-error state without traversing\n * the DOM. Directives with `cngxErrorScopeName` / `cngxErrorAggregatorName`\n * inputs auto-register here when the registry is provided in the host\n * environment (via {@link provideErrorRegistry}, ships in commit 3).\n *\n * Not `providedIn: 'root'` — consumers opt in by including\n * `provideErrorRegistry()` in their `bootstrapApplication` providers. When\n * the registry is absent, the directives skip registration and keep their\n * pure DOM behaviour.\n *\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\n@Injectable()\nexport class CngxErrorRegistry {\n private readonly scopesState = signal<ReadonlyMap<string, CngxErrorScopeContract>>(\n new Map(),\n { equal: mapKeySetEqual },\n );\n\n private readonly aggregatorsState = signal<\n ReadonlyMap<string, CngxErrorAggregatorContract>\n >(new Map(), { equal: mapKeySetEqual });\n\n /**\n * True when at least one registered aggregator reports `hasError`.\n *\n * The Map signal `equal` fn short-circuits on key-set unchanged, so\n * registering an additional aggregator under an existing name does not\n * cascade through this computed. Adding or removing keys does emit.\n */\n readonly hasAnyError: Signal<boolean> = computed(() => {\n for (const aggregator of this.aggregatorsState().values()) {\n if (aggregator.hasError()) {\n return true;\n }\n }\n return false;\n });\n\n /** Sum of `errorCount()` across every registered aggregator. */\n readonly totalErrorCount: Signal<number> = computed(() => {\n let total = 0;\n for (const aggregator of this.aggregatorsState().values()) {\n total += aggregator.errorCount();\n }\n return total;\n });\n\n /** Registered aggregator contracts in insertion order. */\n readonly errorAggregators: Signal<readonly CngxErrorAggregatorContract[]> = computed(\n () => Array.from(this.aggregatorsState().values()),\n { equal: shallowReadonlyArrayEqual },\n );\n\n /**\n * Registers the named scope. Idempotent for the same `(name, scope)`\n * pair.\n *\n * **Swap-is-noop (intentional):** registering a *different* scope\n * instance under an *existing* name is silently absorbed. The internal\n * `scopesState` signal carries `equal: mapKeySetEqual`, which short-\n * circuits when the key set is unchanged. Downstream readers (and any\n * subsequent `getScope(name)` call) keep observing the originally\n * registered instance.\n *\n * To perform a true swap, call `unregisterScope(name)` first, then\n * `registerScope(name, newScope)` — the unregister cycle changes the\n * key set, the equal fn emits, and the new instance becomes the live\n * value.\n */\n registerScope(name: string, scope: CngxErrorScopeContract): void {\n const current = this.scopesState();\n if (current.get(name) === scope) {\n return;\n }\n const next = new Map(current);\n next.set(name, scope);\n this.scopesState.set(next);\n }\n\n /** Removes the named scope. No-op if absent. */\n unregisterScope(name: string): void {\n const current = this.scopesState();\n if (!current.has(name)) {\n return;\n }\n const next = new Map(current);\n next.delete(name);\n this.scopesState.set(next);\n }\n\n /** Returns the named scope, or `undefined` when not registered. */\n getScope(name: string): CngxErrorScopeContract | undefined {\n return this.scopesState().get(name);\n }\n\n /**\n * Registers the named aggregator. Idempotent for the same\n * `(name, aggregator)` pair.\n *\n * **Swap-is-noop (intentional):** see `registerScope` for the full\n * rationale. Re-registering a different aggregator instance under an\n * existing name is silently absorbed by `mapKeySetEqual`; downstream\n * readers stay attached to the originally registered contract. Use\n * `unregisterAggregator(name)` then `registerAggregator(name, newAgg)`\n * for a true swap.\n */\n registerAggregator(name: string, aggregator: CngxErrorAggregatorContract): void {\n const current = this.aggregatorsState();\n if (current.get(name) === aggregator) {\n return;\n }\n const next = new Map(current);\n next.set(name, aggregator);\n this.aggregatorsState.set(next);\n }\n\n /** Removes the named aggregator. No-op if absent. */\n unregisterAggregator(name: string): void {\n const current = this.aggregatorsState();\n if (!current.has(name)) {\n return;\n }\n const next = new Map(current);\n next.delete(name);\n this.aggregatorsState.set(next);\n }\n\n /** Returns the named aggregator, or `undefined` when not registered. */\n getAggregator(name: string): CngxErrorAggregatorContract | undefined {\n return this.aggregatorsState().get(name);\n }\n\n /** Reveals the named scope. Idempotent; no-op if name not registered. */\n reveal(name: string): void {\n this.scopesState().get(name)?.reveal();\n }\n\n /** Resets the named scope. Idempotent; no-op if name not registered. */\n reset(name: string): void {\n this.scopesState().get(name)?.reset();\n }\n\n /** Reveals every registered scope. */\n revealAll(): void {\n for (const scope of this.scopesState().values()) {\n scope.reveal();\n }\n }\n\n /** Resets every registered scope. */\n resetAll(): void {\n for (const scope of this.scopesState().values()) {\n scope.reset();\n }\n }\n}\n\n","import { afterNextRender, DestroyRef, Directive, inject, input, signal } from '@angular/core';\nimport { CngxErrorRegistry } from '../error-registry/error-registry';\nimport { CNGX_ERROR_SCOPE, type CngxErrorScopeContract } from './error-scope.token';\n\n/**\n * Marks a DOM subtree as an error visibility scope.\n *\n * @category common/interactive/error\n *\n * The scope starts hidden - descendant aggregators and error states do\n * not reveal until the consumer calls {@link reveal}, typically via a\n * `(submit)` handler, a route guard, or an HTTP interceptor reveal-on-422\n * pattern.\n *\n * Provides {@link CNGX_ERROR_SCOPE} so any descendant\n * (`CngxErrorAggregator`, `CngxErrorState`, the form-field presenter in\n * Phase 6b) can read `showErrors` reactively without injecting a\n * concrete class.\n *\n * ```html\n * <form [cngxErrorScope] cngxErrorScopeName=\"checkout\"\n * (submit)=\"scope.reveal(); save()\" #scope=\"cngxErrorScope\">\n * <input [cngxErrorState]=\"email().invalid()\" />\n * </form>\n * ```\n *\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-scope/error-scope.directive.ts\n * @since 0.1.0\n * @relatedTo CngxErrorAggregator, CngxErrorState, CngxErrorSource\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-card-host-no-scope-errors-visible-immediately</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-popover-panel-host</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/material-mat-tab-label-with-error-count-badge</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/native-form-scope-reveal-on-submit</example-url>\n */\n@Directive({\n selector: '[cngxErrorScope]',\n standalone: true,\n exportAs: 'cngxErrorScope',\n providers: [{ provide: CNGX_ERROR_SCOPE, useExisting: CngxErrorScope }],\n})\nexport class CngxErrorScope implements CngxErrorScopeContract {\n /** Optional name; enables programmatic lookup via {@link CngxErrorRegistry}. */\n readonly scopeName = input<string | undefined>(undefined, {\n alias: 'cngxErrorScopeName',\n });\n\n private readonly showErrorsState = signal(false);\n\n /** Reactive flag consumed by descendants. */\n readonly showErrors = this.showErrorsState.asReadonly();\n\n /** Reveals errors in this scope (idempotent). */\n reveal(): void {\n this.showErrorsState.set(true);\n }\n\n /** Resets the scope to hidden (idempotent). */\n reset(): void {\n this.showErrorsState.set(false);\n }\n\n constructor() {\n const registry = inject(CngxErrorRegistry, { optional: true });\n if (!registry) {\n return;\n }\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const name = this.scopeName();\n if (!name) {\n return;\n }\n registry.registerScope(name, this);\n destroyRef.onDestroy(() => registry.unregisterScope(name));\n });\n }\n}\n","import { Directive, effect, inject, input, untracked } from '@angular/core';\nimport {\n CNGX_ERROR_AGGREGATOR,\n type CngxErrorAggregatorContract,\n} from '../error-aggregator/error-aggregator.token';\n\n/**\n * Registers a single error condition with the nearest\n * {@link CngxErrorAggregator} ancestor.\n *\n * @category common/interactive/error\n *\n * Pure DI propagation - no DOM output. The directive is a no-op when no\n * aggregator is present (the optional injection returns `null`).\n * Useful for surfacing errors that live outside the form-field\n * presenter, e.g. server-side validation, async availability checks,\n * or business-rule conflicts.\n *\n * The `when` input takes a plain `boolean`. Consumers binding a signal\n * write `[when]=\"form.email().invalid()\"` - the signal is invoked at the\n * binding site (canonical Angular pattern), mirroring `CngxErrorState`\n * discipline.\n *\n * ```html\n * <fieldset cngxErrorAggregator>\n * <span cngxErrorSource=\"email-format\" [when]=\"email().invalid()\"\n * label=\"Email format invalid\"></span>\n * <span cngxErrorSource=\"email-taken\" [when]=\"serverErr() === 'taken'\"\n * label=\"Email already in use\"></span>\n * </fieldset>\n * ```\n *\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-source/error-source.directive.ts\n * @since 0.1.0\n * @relatedTo CngxErrorAggregator, CngxErrorScope, CngxErrorState\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-card-host-no-scope-errors-visible-immediately</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-popover-panel-host</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/material-mat-tab-label-with-error-count-badge</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/native-form-scope-reveal-on-submit</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>\n */\n@Directive({\n selector: '[cngxErrorSource]',\n standalone: true,\n exportAs: 'cngxErrorSource',\n})\nexport class CngxErrorSource {\n /** Unique key within the parent aggregator. Required. */\n readonly cngxErrorSource = input.required<string>();\n\n /** Live error condition. Required (consumer invokes signals at the binding site). */\n readonly when = input.required<boolean>();\n\n /** Optional human-readable label included in aggregator announcements. */\n readonly label = input<string | null>(null);\n\n private readonly aggregator = inject<CngxErrorAggregatorContract | null>(CNGX_ERROR_AGGREGATOR, {\n optional: true,\n });\n\n constructor() {\n if (!this.aggregator) {\n return;\n }\n const aggregator = this.aggregator;\n effect((onCleanup) => {\n const key = this.cngxErrorSource();\n const label = this.label();\n untracked(() => {\n aggregator.addSource({ key, condition: this.when, label });\n });\n onCleanup(() => {\n untracked(() => aggregator.removeSource(key));\n });\n });\n }\n}\n","import { computed, type Signal, type WritableSignal } from '@angular/core';\nimport type {\n CngxErrorAggregatorContract,\n CngxErrorAggregatorSourceEntry,\n} from '../error-aggregator/error-aggregator.token';\nimport type { CngxErrorScopeContract } from '../error-scope/error-scope.token';\nimport { shallowReadonlyArrayEqual } from './equal-fns';\n\n/** @internal */\nconst ERROR_LABEL_JOINER = ', ';\n\n/**\n * Inputs required to build the shared error-aggregator computed graph.\n *\n * Both consumers (`CngxErrorAggregator` directive, `injectErrorAggregator`\n * factory) own their own writable `sourcesState` signal - typically created\n * with `equal: errorSourceMapEqual` - and pass it in alongside a scope\n * signal that resolves to either an explicit override, the nearest\n * ancestor scope, or `null` (no scope, `shouldShow` collapses to\n * `hasError`).\n *\n * @internal\n */\nexport interface ErrorAggregatorContractDeps {\n /** Writable signal carrying the live source-entry map. */\n readonly sourcesState: WritableSignal<ReadonlyMap<string, CngxErrorAggregatorSourceEntry>>;\n /**\n * Reactive scope reference. `null` / `undefined` means no scope - in\n * that case `shouldShow` short-circuits to `hasError` directly.\n */\n readonly scope: Signal<CngxErrorScopeContract | null | undefined>;\n}\n\n/**\n * Builds the canonical error-aggregator computed graph (six derived\n * signals + `addSource`/`removeSource` mutators) over a caller-owned\n * source-entry signal and a caller-owned scope signal.\n *\n * Single source of truth for the aggregator surface: `CngxErrorAggregator`\n * (directive form, ARIA host bindings) and `injectErrorAggregator`\n * (programmatic form, no DOM host) both delegate to this helper so the\n * two surfaces stay field-for-field equivalent without manual sync.\n *\n * Returns a fresh `CngxErrorAggregatorContract` each call - every\n * `computed` is freshly bound to the supplied `sourcesState`/`scope`\n * pair, so two callers with the same source signal get independent\n * computed instances (this is intentional: the directive's host\n * bindings and a co-located factory contract should not share computed\n * identity).\n *\n * @internal\n */\nexport function createErrorAggregatorContract(\n deps: ErrorAggregatorContractDeps,\n): CngxErrorAggregatorContract {\n const { sourcesState, scope } = deps;\n\n const hasError: Signal<boolean> = computed(() => {\n for (const entry of sourcesState().values()) {\n if (entry.condition()) {\n return true;\n }\n }\n return false;\n });\n\n const errorCount: Signal<number> = computed(() => {\n let count = 0;\n for (const entry of sourcesState().values()) {\n if (entry.condition()) {\n count++;\n }\n }\n return count;\n });\n\n const activeErrors: Signal<readonly string[]> = computed(\n () => {\n const out: string[] = [];\n for (const [key, entry] of sourcesState()) {\n if (entry.condition()) {\n out.push(key);\n }\n }\n return out;\n },\n { equal: shallowReadonlyArrayEqual },\n );\n\n const errorLabels: Signal<readonly string[]> = computed(\n () => {\n const out: string[] = [];\n for (const entry of sourcesState().values()) {\n if (entry.condition() && entry.label) {\n out.push(entry.label);\n }\n }\n return out;\n },\n { equal: shallowReadonlyArrayEqual },\n );\n\n const shouldShow: Signal<boolean> = computed(() => {\n if (!hasError()) {\n return false;\n }\n const resolved = scope();\n return resolved ? resolved.showErrors() : true;\n });\n\n const announcement: Signal<string> = computed(() =>\n shouldShow() ? errorLabels().join(ERROR_LABEL_JOINER) : '',\n );\n\n return {\n hasError,\n errorCount,\n activeErrors,\n errorLabels,\n shouldShow,\n announcement,\n addSource(entry) {\n const next = new Map(sourcesState());\n next.set(entry.key, entry);\n sourcesState.set(next);\n },\n removeSource(key) {\n const current = sourcesState();\n if (!current.has(key)) {\n return;\n }\n const next = new Map(current);\n next.delete(key);\n sourcesState.set(next);\n },\n };\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n effect,\n inject,\n input,\n PLATFORM_ID,\n Renderer2,\n signal,\n untracked,\n} from '@angular/core';\nimport { createErrorAggregatorContract } from '../error-registry/aggregator-contract';\nimport { errorSourceMapEqual } from '../error-registry/equal-fns';\nimport { CngxErrorRegistry } from '../error-registry/error-registry';\nimport { CNGX_ERROR_SCOPE, type CngxErrorScopeContract } from '../error-scope/error-scope.token';\nimport {\n CNGX_ERROR_AGGREGATOR,\n type CngxErrorAggregatorContract,\n type CngxErrorAggregatorSourceEntry,\n} from './error-aggregator.token';\n\n/**\n * Aggregates one-or-more {@link CngxErrorSource} children into a single\n * live A11y surface.\n *\n * @category common/interactive/error\n *\n * Each registered source contributes a key + a live `Signal<boolean>` +\n * an optional label. Derived signals (`hasError`, `errorCount`,\n * `activeErrors`, `errorLabels`, `shouldShow`, `announcement`) are\n * `computed()` with structural `equal` fns so unrelated re-emissions\n * upstream do not cascade through descendants.\n *\n * ### Live region\n *\n * By default the directive appends a visually-hidden `<span>` to the\n * host element and writes {@link announcement} into its `textContent`\n * reactively, so an `aria-live` announcement fires the moment a source\n * toggles. The span carries `role=\"status\"` (or `role=\"alert\"` when\n * politeness is `'assertive'`), `aria-live`, `aria-atomic=\"true\"`, and\n * `aria-relevant=\"additions text\"`. Visually-hidden styling is applied\n * inline via `--cngx-sr-only-*` CSS custom properties — no global\n * stylesheet required.\n *\n * Set `[autoAnnounce]=\"false\"` to take ownership of the live region in\n * consumer markup (for example, when routing announcements through\n * CDK's `LiveAnnouncer` service). Use `[announcePoliteness]` to switch\n * to `'assertive'` for safety-critical errors or `'off'` to suppress\n * announcements entirely while keeping the visual error surface.\n *\n * ```html\n * <fieldset cngxErrorAggregator #agg=\"cngxErrorAggregator\">\n * <span cngxErrorSource=\"format\" [when]=\"email().invalid()\" label=\"Format\"></span>\n * <span cngxErrorSource=\"taken\" [when]=\"taken()\" label=\"Already used\"></span>\n *\n * @if (agg.shouldShow()) {\n * <ul role=\"alert\">\n * @for (label of agg.errorLabels(); track label) {\n * <li>{{ label }}</li>\n * }\n * </ul>\n * }\n * </fieldset>\n * ```\n *\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-aggregator/error-aggregator.directive.ts\n * @since 0.1.0\n * @relatedTo CngxErrorSource, CngxErrorScope, CngxErrorState, CngxErrorRegistry\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-card-host-no-scope-errors-visible-immediately</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-popover-panel-host</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/material-mat-tab-label-with-error-count-badge</example-url>\n * <example-url>http://localhost:4200/#/common/interactive/error/aggregator/native-form-scope-reveal-on-submit</example-url>\n * <example-url>http://localhost:4200/#/ui/stepper/stepper-error-aggregation/per-step-error-badges</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>\n */\n@Directive({\n selector: '[cngxErrorAggregator]',\n standalone: true,\n exportAs: 'cngxErrorAggregator',\n providers: [{ provide: CNGX_ERROR_AGGREGATOR, useExisting: CngxErrorAggregator }],\n host: {\n '[class.cngx-error]': 'shouldShow()',\n '[attr.aria-invalid]': 'shouldShow() ? \"true\" : \"false\"',\n },\n})\nexport class CngxErrorAggregator implements CngxErrorAggregatorContract {\n /** External scope override; falls back to ancestor `CNGX_ERROR_SCOPE`. */\n readonly scope = input<CngxErrorScopeContract | undefined>(undefined);\n\n /** Optional name; enables programmatic lookup via {@link CngxErrorRegistry}. */\n readonly aggregatorName = input<string | undefined>(undefined, {\n alias: 'cngxErrorAggregatorName',\n });\n\n /**\n * When `true` (default), the directive appends its own visually-hidden\n * `<span>` to the host element and writes {@link announcement} into its\n * `textContent`. Set to `false` to take ownership of the live region in\n * consumer markup (e.g. when routing announcements through CDK's\n * `LiveAnnouncer`).\n */\n readonly autoAnnounce = input<boolean>(true);\n\n /**\n * Politeness of the auto-rendered live region. Mirrors the WAI-ARIA\n * `aria-live` value. `'polite'` queues after the current utterance,\n * `'assertive'` interrupts, `'off'` disables announcement (the span is\n * still rendered but is not announced).\n */\n readonly announcePoliteness = input<'polite' | 'assertive' | 'off'>('polite');\n\n private readonly ancestorScope = inject<CngxErrorScopeContract | null>(CNGX_ERROR_SCOPE, {\n optional: true,\n });\n\n private readonly sourcesState = signal<ReadonlyMap<string, CngxErrorAggregatorSourceEntry>>(\n new Map(),\n { equal: errorSourceMapEqual },\n );\n\n /** @internal - the resolved scope (input wins, else ancestor, else `null`). */\n protected readonly effectiveScope = computed<CngxErrorScopeContract | null>(\n () => this.scope() ?? this.ancestorScope,\n );\n\n private readonly contract = createErrorAggregatorContract({\n sourcesState: this.sourcesState,\n scope: this.effectiveScope,\n });\n\n readonly hasError = this.contract.hasError;\n readonly errorCount = this.contract.errorCount;\n readonly activeErrors = this.contract.activeErrors;\n readonly errorLabels = this.contract.errorLabels;\n readonly shouldShow = this.contract.shouldShow;\n readonly announcement = this.contract.announcement;\n\n addSource(entry: CngxErrorAggregatorSourceEntry): void {\n this.contract.addSource(entry);\n }\n\n removeSource(key: string): void {\n this.contract.removeSource(key);\n }\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n const platformId = inject(PLATFORM_ID);\n\n if (isPlatformBrowser(platformId)) {\n const hostEl = (inject(ElementRef) as ElementRef<HTMLElement>).nativeElement;\n const renderer = inject(Renderer2);\n\n let span: HTMLSpanElement | null = null;\n\n effect(() => {\n const enabled = this.autoAnnounce();\n const politeness = this.announcePoliteness();\n const text = this.announcement();\n\n untracked(() => {\n if (!enabled) {\n if (span?.parentNode === hostEl) {\n renderer.removeChild(hostEl, span);\n }\n span = null;\n return;\n }\n\n if (!span) {\n const el = renderer.createElement('span') as HTMLSpanElement;\n renderer.setStyle(el, 'position', 'var(--cngx-sr-only-position, absolute)');\n renderer.setStyle(el, 'width', 'var(--cngx-sr-only-size, 1px)');\n renderer.setStyle(el, 'height', 'var(--cngx-sr-only-size, 1px)');\n renderer.setStyle(el, 'overflow', 'var(--cngx-sr-only-overflow, hidden)');\n renderer.setStyle(el, 'clip', 'var(--cngx-sr-only-clip, rect(0, 0, 0, 0))');\n renderer.setStyle(el, 'white-space', 'var(--cngx-sr-only-white-space, nowrap)');\n renderer.setAttribute(el, 'aria-atomic', 'true');\n renderer.setAttribute(el, 'aria-relevant', 'additions text');\n renderer.appendChild(hostEl, el);\n span = el;\n }\n\n if (politeness === 'off') {\n renderer.removeAttribute(span, 'role');\n } else {\n renderer.setAttribute(span, 'role', politeness === 'assertive' ? 'alert' : 'status');\n }\n renderer.setAttribute(span, 'aria-live', politeness);\n span.textContent = text;\n });\n });\n\n destroyRef.onDestroy(() => {\n if (span?.parentNode === hostEl) {\n renderer.removeChild(hostEl, span);\n }\n span = null;\n });\n }\n\n const registry = inject(CngxErrorRegistry, { optional: true });\n if (!registry) {\n return;\n }\n afterNextRender(() => {\n const name = this.aggregatorName();\n if (!name) {\n return;\n }\n registry.registerAggregator(name, this);\n destroyRef.onDestroy(() => registry.unregisterAggregator(name));\n });\n }\n}\n","import { DestroyRef, inject, signal } from '@angular/core';\nimport type { CngxErrorScopeContract } from '../error-scope/error-scope.token';\nimport { CngxErrorRegistry } from './error-registry';\n\n/**\n * Creates a programmatic {@link CngxErrorScopeContract}, optionally\n * registered under `name` in the ambient {@link CngxErrorRegistry}.\n *\n * Use when an error scope must exist without a DOM host — e.g. inside a\n * route guard, an HTTP interceptor, or a service that drives error\n * visibility programmatically. When `name` is set and a registry is\n * provided in the host environment, the scope auto-registers and\n * auto-deregisters on the surrounding `DestroyRef`.\n *\n * Must be called in an injection context (constructor, factory provider,\n * `runInInjectionContext`).\n *\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport function injectErrorScope(name?: string): CngxErrorScopeContract {\n const showErrorsState = signal(false);\n const scopeName = signal<string | undefined>(name);\n\n const contract: CngxErrorScopeContract = {\n showErrors: showErrorsState.asReadonly(),\n scopeName: scopeName.asReadonly(),\n reveal: () => showErrorsState.set(true),\n reset: () => showErrorsState.set(false),\n };\n\n if (name) {\n const registry = inject(CngxErrorRegistry, { optional: true });\n if (registry) {\n const destroyRef = inject(DestroyRef);\n registry.registerScope(name, contract);\n destroyRef.onDestroy(() => registry.unregisterScope(name));\n }\n }\n\n return contract;\n}\n","import { DestroyRef, inject, signal, type Signal } from '@angular/core';\nimport type {\n CngxErrorAggregatorContract,\n CngxErrorAggregatorSourceEntry,\n} from '../error-aggregator/error-aggregator.token';\nimport type { CngxErrorScopeContract } from '../error-scope/error-scope.token';\nimport { createErrorAggregatorContract } from './aggregator-contract';\nimport { CngxErrorRegistry } from './error-registry';\nimport { errorSourceMapEqual } from './equal-fns';\n\n/**\n * Creates a programmatic {@link CngxErrorAggregatorContract}, optionally\n * registered under `name` in the ambient {@link CngxErrorRegistry}.\n *\n * Positional arguments - NOT a config-options-bag - per Pillar 3\n * (Komposition statt Konfiguration). When `name` is set and a registry is\n * provided, auto-registers and auto-deregisters on the surrounding\n * `DestroyRef`.\n *\n * @param name Optional registry name (skips registration when omitted).\n * @param sources Initial source map (`key` → reactive boolean Signal).\n * Each entry's signal is the live condition the aggregator\n * reads on every recompute.\n * @param scope Optional scope override; when omitted, `shouldShow`\n * collapses to `hasError`.\n * @param labels Optional human-readable labels by source key, used in\n * `errorLabels` and `announcement`.\n *\n * Must be called in an injection context (constructor, factory provider,\n * `runInInjectionContext`).\n *\n * Computed-graph derivation is delegated to\n * {@link createErrorAggregatorContract} so the directive\n * ({@link `@cngx/common/interactive`#CngxErrorAggregator}) and the\n * function form share a single source of truth.\n *\n * @internal Staged API - single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport function injectErrorAggregator(\n name?: string,\n sources?: Record<string, Signal<boolean>>,\n scope?: CngxErrorScopeContract,\n labels?: Record<string, string>,\n): CngxErrorAggregatorContract {\n const sourcesState = signal<ReadonlyMap<string, CngxErrorAggregatorSourceEntry>>(\n buildInitialSources(sources, labels),\n { equal: errorSourceMapEqual },\n );\n const scopeSignal = signal<CngxErrorScopeContract | null | undefined>(scope);\n\n const contract = createErrorAggregatorContract({\n sourcesState,\n scope: scopeSignal.asReadonly(),\n });\n\n if (name) {\n const registry = inject(CngxErrorRegistry, { optional: true });\n if (registry) {\n const destroyRef = inject(DestroyRef);\n registry.registerAggregator(name, contract);\n destroyRef.onDestroy(() => registry.unregisterAggregator(name));\n }\n }\n\n return contract;\n}\n\n/** @internal */\nfunction buildInitialSources(\n sources: Record<string, Signal<boolean>> | undefined,\n labels: Record<string, string> | undefined,\n): ReadonlyMap<string, CngxErrorAggregatorSourceEntry> {\n if (!sources) {\n return new Map();\n }\n const map = new Map<string, CngxErrorAggregatorSourceEntry>();\n for (const [key, condition] of Object.entries(sources)) {\n map.set(key, {\n key,\n condition,\n label: labels?.[key] ?? null,\n });\n }\n return map;\n}\n","import {\n DestroyRef,\n type EnvironmentProviders,\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n type Provider,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationStart, Router } from '@angular/router';\nimport { filter } from 'rxjs';\nimport { CngxErrorRegistry } from './error-registry';\n\n/**\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport interface _ErrorRegistryConfig {\n revealOnSubmit?: boolean;\n revealOnNavigate?: boolean;\n}\n\n/**\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport interface ErrorRegistryFeature {\n /** @internal */\n readonly _apply: (config: _ErrorRegistryConfig) => _ErrorRegistryConfig;\n}\n\n/**\n * Provides {@link CngxErrorRegistry} and optional global reveal triggers.\n *\n * Composes feature flags via `_apply` partial-config functions, mirroring\n * `provideFormField`'s shape. Without features, registers the registry only;\n * pair with {@link withGlobalRevealOnSubmit} or {@link withRevealOnNavigate}\n * to install ambient reveal behaviour.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideErrorRegistry(\n * withGlobalRevealOnSubmit(),\n * withRevealOnNavigate(),\n * ),\n * ],\n * });\n * ```\n *\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport function provideErrorRegistry(\n ...features: ErrorRegistryFeature[]\n): EnvironmentProviders {\n let config: _ErrorRegistryConfig = {};\n for (const f of features) {\n config = f._apply(config);\n }\n\n const providers: (Provider | EnvironmentProviders)[] = [CngxErrorRegistry];\n\n if (config.revealOnSubmit) {\n providers.push(\n provideEnvironmentInitializer(() => {\n if (typeof document === 'undefined') {\n return;\n }\n const registry = inject(CngxErrorRegistry);\n const destroyRef = inject(DestroyRef);\n const handler = (): void => registry.revealAll();\n document.addEventListener('submit', handler, true);\n destroyRef.onDestroy(() => {\n document.removeEventListener('submit', handler, true);\n });\n }),\n );\n }\n\n if (config.revealOnNavigate) {\n providers.push(\n provideEnvironmentInitializer(() => {\n const router = inject(Router, { optional: true });\n if (!router) {\n return;\n }\n const registry = inject(CngxErrorRegistry);\n router.events\n .pipe(\n filter((event): event is NavigationStart => event instanceof NavigationStart),\n takeUntilDestroyed(),\n )\n .subscribe(() => registry.revealAll());\n }),\n );\n }\n\n return makeEnvironmentProviders(providers);\n}\n\n/**\n * Reveals every registered scope on any DOM `submit` event.\n *\n * **Coarse-grained — affects every registered scope, every form.** The\n * feature installs a capture-phase document listener that calls\n * `registry.revealAll()` on any submit anywhere in the document, even\n * when the submit fires from a form unrelated to the scope of interest.\n * Appropriate when the application treats every submit as a \"show all\n * errors now\" trigger.\n *\n * For finer-grained reveals (per-form, per-flow), skip this feature and\n * call `registry.reveal(name)` from the consumer's submit handler\n * instead — the scope-name registration path stays available without\n * the global listener.\n *\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport function withGlobalRevealOnSubmit(): ErrorRegistryFeature {\n return { _apply: (c) => ({ ...c, revealOnSubmit: true }) };\n}\n\n/**\n * Reveals every registered scope on `Router.NavigationStart`.\n *\n * Requires `provideRouter()` (or equivalent) in the host environment.\n * No-op when no `Router` is provided so the feature degrades gracefully\n * in test harnesses or non-routed apps.\n *\n * **Fires before route guards.** `NavigationStart` emits before\n * `CanActivate` / `CanDeactivate` guards run, so a navigation that gets\n * cancelled by a guard still leaves every scope revealed. Acceptable for\n * the common pattern (reveal-all on attempted navigation) but surface\n * the implication when wiring a guard that cancels based on form errors.\n *\n * @internal Staged API — single-consumer.\n * See form-primitives-accepted-debt.md §A for the re-evaluation trigger\n * and collapse plan.\n */\nexport function withRevealOnNavigate(): ErrorRegistryFeature {\n return { _apply: (c) => ({ ...c, revealOnNavigate: true }) };\n}\n","/**\n * @module @cngx/common/interactive\n */\nexport { CngxAsyncClick, type AsyncAction } from './async-click/async-click.directive';\nexport { CngxPending, CngxSucceeded, CngxFailed } from './async-click/async-status-templates';\nexport {\n CngxAsyncStatus,\n reflectAsyncDisplayStatus,\n type CngxAsyncDisplayStatus,\n} from './async-status/async-status.directive';\nexport { type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\nexport { CngxCopyText } from './copy/copy-text.directive';\nexport { CngxCopyBlock } from './copy/copy-block';\nexport { CngxRipple } from './ripple/ripple.directive';\nexport { CngxPressable } from './ripple/pressable.directive';\nexport { CngxPressRipple } from './ripple/press-ripple.directive';\nexport {\n CNGX_NAV_CONFIG,\n provideNavConfig,\n injectNavConfig,\n withSingleAccordion,\n withNavIndent,\n withNavAnimation,\n type CngxNavConfig,\n type NavConfigFeature,\n} from './nav/nav-config';\nexport { CngxNavGroup } from './nav/nav-group.directive';\nexport { CngxNavGroupRegistry } from './nav/nav-group-registry';\nexport { CngxNavLabel } from './nav/nav-label.directive';\nexport { CngxNavLink } from './nav/nav-link.directive';\nexport { CngxNavBadge, type NavBadgeVariant } from './nav/nav-badge.directive';\nexport { CngxDisclosure } from './nav/disclosure.directive';\nexport { CngxExpandable } from './expandable/expandable.directive';\nexport {\n CngxHoverIntent,\n CNGX_HOVER_INTENT_DEFAULTS,\n type CngxHoverIntentDefaults,\n} from './hover-intent/hover-intent.directive';\nexport {\n CNGX_CONTROL_VALUE,\n type CngxControlValue,\n} from './control-value/control-value.token';\nexport {\n createSliderCore,\n type CngxSliderCore,\n type CngxSliderCoreOptions,\n} from './slider/slider-core';\nexport { CngxSlider } from './slider/slider.component';\nexport { CngxRangeSlider } from './slider/range-slider.component';\nexport { CngxSliderTrack } from './slider/slider.directive';\nexport { CngxRangeSliderTrack } from './slider/range-slider.directive';\nexport { CngxSliderThumb } from './slider/slider-thumb.directive';\nexport {\n CNGX_SLIDER_RANGE,\n type CngxSliderRangeHost,\n type CngxSliderThumbBounds,\n type CngxSliderThumbPosition,\n} from './slider/range-slider.token';\nexport { CngxAccordion } from './accordion/accordion.directive';\nexport { CngxAccordionPanel } from './accordion/accordion-panel.directive';\nexport { CNGX_ACCORDION, type CngxAccordionHost } from './accordion/accordion.token';\nexport {\n createAccordionKeyboardNav,\n type CngxAccordionHeaderHandle,\n type CngxAccordionKeyboardNav,\n type CngxAccordionKeyboardNavHost,\n type CngxAccordionKeyboardNavOptions,\n} from './accordion/accordion-keyboard-nav';\nexport { CngxBreadcrumb } from './breadcrumb/breadcrumb.directive';\nexport { CNGX_BREADCRUMB, type CngxBreadcrumbHost } from './breadcrumb/breadcrumb.token';\nexport { CngxBreadcrumbItem } from './breadcrumb/breadcrumb-item.directive';\nexport { CngxBreadcrumbSeparator } from './breadcrumb/breadcrumb-separator.directive';\nexport {\n createBreadcrumbCollapse,\n type CngxBreadcrumbCollapseStrategy,\n} from './breadcrumb/breadcrumb-collapse';\nexport { CNGX_BREADCRUMB_COLLAPSE_STRATEGY } from './breadcrumb/breadcrumb-collapse.token';\nexport {\n DEFAULT_BREADCRUMB_WIDTH_TIERS,\n resolveBreadcrumbTier,\n type CngxBreadcrumbWidthTier,\n} from './breadcrumb/breadcrumb-responsive';\nexport { CngxToggle } from './toggle/toggle.component';\nexport { CngxCheckbox } from './checkbox/checkbox.component';\nexport { CngxCheckboxGroup } from './checkbox-group/checkbox-group.component';\nexport {\n CNGX_BUTTON_TOGGLE_GROUP,\n type CngxButtonToggleGroupContract,\n} from './button-toggle/button-toggle-group.token';\nexport { CngxButtonToggleGroup } from './button-toggle/button-toggle-group.component';\nexport {\n CNGX_BUTTON_MULTI_TOGGLE_GROUP,\n type CngxButtonMultiToggleGroupContract,\n} from './button-toggle/button-multi-toggle-group.token';\nexport { CngxButtonMultiToggleGroup } from './button-toggle/button-multi-toggle-group.component';\nexport { CngxButtonToggle } from './button-toggle/button-toggle.directive';\nexport {\n CNGX_RADIO_GROUP,\n type CngxRadioGroupContract,\n type CngxRadioRegistration,\n} from './radio/radio-group.token';\nexport { CngxRadioGroup } from './radio/radio-group.component';\nexport { CngxRadio } from './radio/radio.component';\nexport {\n CNGX_CHIP_GROUP_HOST,\n type CngxChipGroupHost,\n} from './chip-group/chip-group-host.token';\nexport { CngxChipInteraction } from './chip-interaction/chip-interaction.directive';\nexport { CngxChipInGroup } from './chip-in-group/chip-in-group.directive';\nexport { CngxChipGroup } from './chip-group/chip-group.component';\nexport { CngxMultiChipGroup } from './multi-chip-group/multi-chip-group.component';\nexport { CngxChipInput } from './chip-input/chip-input.directive';\nexport {\n CNGX_TREE_CONTROLLER_FACTORY,\n createTreeController,\n type CngxTreeController,\n type CngxTreeControllerFactory,\n type CngxTreeControllerOptions,\n} from './tree-controller/tree-controller';\nexport { createTreeAdItems } from './tree-controller/tree-ad-items';\nexport {\n CNGX_TREE_CONFIG,\n injectTreeConfig,\n provideTreeConfig,\n provideTreeConfigAt,\n withDefaultInitiallyExpanded,\n withDefaultKeyFn,\n withDefaultLabelFn,\n withDefaultNodeIdFn,\n withTreeCacheLimit,\n type CngxTreeConfig,\n type CngxTreeConfigFeature,\n} from './tree-controller/tree-config';\nexport { CngxHierarchicalNav } from './hierarchical-nav/hierarchical-nav.directive';\nexport {\n CNGX_HIERARCHICAL_NAV_STRATEGY,\n createW3CTreeStrategy,\n type CngxHierarchicalNavAction,\n type CngxHierarchicalNavContext,\n type CngxHierarchicalNavStrategy,\n} from './hierarchical-nav/hierarchical-nav-strategy';\nexport { withRetry, type RetryConfig, type RetryState } from './retry/with-retry';\nexport { optimistic, type OptimisticState } from './optimistic/optimistic';\nexport { CngxLongPress } from './gestures/long-press.directive';\nexport { CngxSwipe } from './gestures/swipe.directive';\nexport { CngxSwipeDismiss } from './gestures/swipe-dismiss.directive';\nexport type { SwipeAxis, SwipeDirection } from './gestures/swipe-direction';\nexport {\n CngxReorder,\n type CngxReorderEvent,\n type CngxReorderModifier,\n} from './reorder/reorder.directive';\nexport {\n CNGX_CHIP_STRIP_ROVING_FACTORY,\n createChipStripRoving,\n type CngxChipStripRovingController,\n type CngxChipStripRovingFactory,\n type CngxChipStripRovingOptions,\n} from './reorder/chip-strip-roving';\nexport { CngxKeyboardShortcut } from './keyboard/keyboard-shortcut.directive';\nexport { CngxSearch } from './keyboard/search.directive';\nexport { CngxClickOutside } from './keyboard/click-outside.directive';\nexport { CngxBeforeUnload } from './guard/before-unload.directive';\nexport { canDeactivateWhenClean } from './guard/can-deactivate';\nexport { CngxCloseButton, CNGX_CLOSE_ICON } from './close-button/close-button';\nexport { CngxHoverable } from './hoverable/hoverable.directive';\nexport { CngxSpeak } from './speak/speak.directive';\nexport { CngxOption } from './listbox/option.directive';\nexport { CngxOptionGroup } from './listbox/option-group.directive';\nexport {\n CNGX_OPTION_CONTAINER,\n type CngxOptionContainer,\n type CngxOptionContainerGroup,\n type CngxOptionContainerOption,\n} from './listbox/option-container';\nexport {\n CNGX_OPTION_STATUS_HOST,\n type CngxOptionStatus,\n type CngxOptionStatusHost,\n} from './listbox/option-status-host';\nexport {\n CNGX_OPTION_FILTER_HOST,\n type CngxOptionFilterHost,\n} from './listbox/option-filter-host';\nexport {\n CNGX_OPTION_INTERACTION_HOST,\n type CngxOptionInteractionHost,\n} from './listbox/option-interaction-host';\nexport { CngxListbox } from './listbox/listbox.directive';\nexport {\n CngxListboxSearch,\n type ListboxMatchFn,\n} from './listbox/listbox-search.directive';\nexport { CngxListboxTrigger } from './listbox/listbox-trigger.directive';\nexport { CngxMenu } from './menu/menu.directive';\nexport { CNGX_MENU_HOST, type CngxMenuHost } from './menu/menu-host.token';\nexport {\n CNGX_MENU_SUBMENU_ITEM,\n type CngxMenuSubmenuLike,\n} from './menu/menu-submenu.token';\nexport { CngxMenuItem } from './menu/menu-item.directive';\nexport {\n CngxMenuItemIcon,\n CngxMenuItemKbd,\n CngxMenuItemLabel,\n CngxMenuItemSuffix,\n} from './menu/menu-item-slot.directives';\nexport { CngxMenuItemSubmenu } from './menu/menu-item-submenu.directive';\nexport { CNGX_SUBMENU_TRY_FALLBACKS } from './menu/submenu-defaults';\nexport { CngxMenuItemCheckbox } from './menu/menu-item-checkbox.directive';\nexport { CngxMenuItemRadio } from './menu/menu-item-radio.directive';\nexport { CngxMenuGroup } from './menu/menu-group.directive';\nexport { CngxMenuSeparator } from './menu/menu-separator.directive';\nexport {\n CNGX_MENU_NAV_STRATEGY,\n createW3CMenuStrategy,\n type CngxMenuNavAction,\n type CngxMenuNavContext,\n type CngxMenuNavStrategy,\n} from './menu/menu-nav-strategy';\nexport {\n CNGX_MENU_CONFIG,\n DEFAULT_MENU_CONFIG,\n injectMenuConfig,\n provideMenuConfig,\n provideMenuConfigAt,\n type CngxMenuAriaLabels,\n type CngxMenuConfig,\n type CngxMenuConfigFeature,\n} from './menu/menu-config';\nexport {\n withAriaLabels,\n withCloseOnSelect,\n withDismissOnBlur,\n withDismissOnOutsideClick,\n withDismissOnScroll,\n withSubmenuCloseDelay,\n withSubmenuOpenDelay,\n withTypeaheadDebounce,\n} from './menu/menu-config-features';\nexport {\n CNGX_MENU_DISMISS_HANDLER_FACTORY,\n createMenuDismissHandler,\n createMenuTriggerDismissBinding,\n type CngxMenuDismissHandler,\n type CngxMenuDismissHandlerFactory,\n type CngxMenuDismissHandlerOptions,\n type CngxMenuDismissPopoverRef,\n type CngxMenuDismissSource,\n type CngxMenuTriggerDismissBinding,\n type CngxMenuTriggerDismissBindingOptions,\n} from './menu/dismiss-handler';\nexport {\n CNGX_MENU_ANNOUNCER_FACTORY,\n CngxMenuAnnouncer,\n createMenuAnnouncer,\n injectMenuAnnouncer,\n type CngxMenuAnnouncerFactory,\n type CngxMenuAnnouncerLike,\n} from './menu/menu-announcer';\nexport { CngxContextMenuTrigger } from './menu/context-menu-trigger.directive';\nexport { provideCngxMenu, type CngxMenuFeature } from './menu/provide-cngx-menu';\nexport {\n CNGX_MENU_RADIO_GROUP,\n createMenuRadioController,\n type CngxMenuRadioGroup,\n type CngxMenuRadioGroupFactory,\n} from './menu/menu-radio-controller';\nexport { CngxMenuTrigger } from './menu/menu-trigger.directive';\nexport { CngxErrorState } from './error-state/error-state.directive';\nexport {\n CNGX_ERROR_SCOPE,\n type CngxErrorScopeContract,\n} from './error-scope/error-scope.token';\nexport { CngxErrorScope } from './error-scope/error-scope.directive';\nexport {\n CNGX_ERROR_AGGREGATOR,\n type CngxErrorAggregatorContract,\n type CngxErrorAggregatorSourceEntry,\n} from './error-aggregator/error-aggregator.token';\nexport { CngxErrorSource } from './error-source/error-source.directive';\nexport { CngxErrorAggregator } from './error-aggregator/error-aggregator.directive';\nexport { CngxErrorRegistry } from './error-registry/error-registry';\nexport { injectErrorScope } from './error-registry/inject-error-scope';\nexport { injectErrorAggregator } from './error-registry/inject-error-aggregator';\nexport {\n provideErrorRegistry,\n withGlobalRevealOnSubmit,\n withRevealOnNavigate,\n type ErrorRegistryFeature,\n} from './error-registry/provide-error-registry';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.CngxPressable","i2.CngxRipple","i1.CngxDisclosure","i1.CngxSliderTrack","i1.CngxRangeSliderTrack","isCloseButtonClick","NOOP","i1.CngxSearch"],"mappings":";;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCG;MAeU,cAAc,CAAA;AACR,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;AAChD,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;IAGvC,MAAM,GAAG,KAAK,CAAC,QAAQ,6EAAgB,K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