@cngx/common 0.1.0-rc.0 → 0.1.0-rc.1
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/fesm2022/cngx-common-a11y.mjs +24 -11
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +45 -11
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +242 -34
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +900 -47
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/package.json +3 -3
- package/stepper/README.md +20 -0
- package/theming/components/cngx-badge.css +1 -1
- package/theming/components/cngx-menu.css +1 -1
- package/types/cngx-common-a11y.d.ts +23 -2
- package/types/cngx-common-interactive.d.ts +20 -2
- package/types/cngx-common-stepper.d.ts +256 -13
- package/types/cngx-common-tabs.d.ts +832 -23
|
@@ -229,6 +229,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
229
229
|
}]
|
|
230
230
|
}], ctorParameters: () => [], propDecorators: { when: [{ type: i0.Input, args: [{ isSignal: true, alias: "cngxAutofocus", required: false }] }], delay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocusDelay", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocusOptions", required: false }] }] } });
|
|
231
231
|
|
|
232
|
+
/**
|
|
233
|
+
* CSS selector matching natively-focusable elements: links with an
|
|
234
|
+
* `href`, the enabled form controls, and anything with an explicit
|
|
235
|
+
* non-negative `tabindex`. Form controls carry `:not(:disabled)` because
|
|
236
|
+
* a disabled control is not in the tab order - without it a descendant
|
|
237
|
+
* probe would count a disabled button as focusable and a restore target
|
|
238
|
+
* could land on an unfocusable element. Single source of truth for "is
|
|
239
|
+
* this focusable" - the element-level {@link CngxFocusRestore} predicate
|
|
240
|
+
* matches against it, and descendant probes (e.g. "does this panel
|
|
241
|
+
* contain a focusable child?") query against it. Keeping one selector
|
|
242
|
+
* stops the two uses from drifting apart.
|
|
243
|
+
*
|
|
244
|
+
* @category common/a11y
|
|
245
|
+
* @since 0.1.0
|
|
246
|
+
*/
|
|
247
|
+
const CNGX_FOCUSABLE_SELECTOR = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])';
|
|
232
248
|
/**
|
|
233
249
|
* Stores the previously focused element and restores focus on destroy.
|
|
234
250
|
*
|
|
@@ -335,17 +351,14 @@ class CngxFocusRestore {
|
|
|
335
351
|
}
|
|
336
352
|
return null;
|
|
337
353
|
}
|
|
338
|
-
/**
|
|
354
|
+
/**
|
|
355
|
+
* Checks if an element is natively focusable (tabindex, links, form
|
|
356
|
+
* controls). Element-level predicate over the shared
|
|
357
|
+
* {@link CNGX_FOCUSABLE_SELECTOR}, so it never drifts from the
|
|
358
|
+
* descendant-query callers.
|
|
359
|
+
*/
|
|
339
360
|
isFocusable(el) {
|
|
340
|
-
|
|
341
|
-
return true;
|
|
342
|
-
}
|
|
343
|
-
const tag = el.tagName.toLowerCase();
|
|
344
|
-
return ((tag === 'a' && el.hasAttribute('href')) ||
|
|
345
|
-
tag === 'button' ||
|
|
346
|
-
tag === 'input' ||
|
|
347
|
-
tag === 'select' ||
|
|
348
|
-
tag === 'textarea');
|
|
361
|
+
return el.matches(CNGX_FOCUSABLE_SELECTOR);
|
|
349
362
|
}
|
|
350
363
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxFocusRestore, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
351
364
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.4", type: CngxFocusRestore, isStandalone: true, selector: "[cngxFocusRestore]", inputs: { restoreOnDestroy: { classPropertyName: "restoreOnDestroy", publicName: "restoreOnDestroy", isSignal: true, isRequired: false, transformFunction: null }, fallback: { classPropertyName: "fallback", publicName: "fallback", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["cngxFocusRestore"], ngImport: i0 });
|
|
@@ -1356,5 +1369,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1356
1369
|
* Generated bundle index. Do not edit.
|
|
1357
1370
|
*/
|
|
1358
1371
|
|
|
1359
|
-
export { CNGX_AD_ITEM, CngxActiveDescendant, CngxAriaExpanded, CngxAutofocus, CngxFocusRestore, CngxFocusTrap, CngxFocusVisible, CngxLiveRegion, CngxReducedMotion, CngxRovingItem, CngxRovingTabindex };
|
|
1372
|
+
export { CNGX_AD_ITEM, CNGX_FOCUSABLE_SELECTOR, CngxActiveDescendant, CngxAriaExpanded, CngxAutofocus, CngxFocusRestore, CngxFocusTrap, CngxFocusVisible, CngxLiveRegion, CngxReducedMotion, CngxRovingItem, CngxRovingTabindex };
|
|
1360
1373
|
//# sourceMappingURL=cngx-common-a11y.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-common-a11y.mjs","sources":["../../../projects/common/a11y/aria/aria-expanded.directive.ts","../../../projects/common/a11y/aria/live-region.directive.ts","../../../projects/common/a11y/focus/autofocus.directive.ts","../../../projects/common/a11y/focus/focus-restore.directive.ts","../../../projects/common/a11y/focus/focus-trap.directive.ts","../../../projects/common/a11y/focus/focus-visible.directive.ts","../../../projects/common/a11y/roving/roving-tabindex.directive.ts","../../../projects/common/a11y/active-descendant/ad-item.token.ts","../../../projects/common/a11y/active-descendant/active-descendant.directive.ts","../../../projects/common/a11y/motion/reduced-motion.directive.ts","../../../projects/common/a11y/public-api.ts","../../../projects/common/a11y/cngx-common-a11y.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\n\n/**\n * Manages `aria-expanded` and optionally `aria-controls` on the host element.\n *\n * Pairs a disclosure trigger (button) with its controlled region via standard\n * WAI-ARIA attributes. Supports accordions, dropdowns, tree items, and any\n * disclosure pattern where a control toggles visibility of another element.\n *\n * Unlike manual `[attr.aria-expanded]` binding, this directive couples both\n * attributes (`aria-expanded` + `aria-controls`) in a single declaration,\n * preventing mismatches where one is set without the other.\n *\n * ### Simple disclosure\n * ```html\n * <button [cngxAriaExpanded]=\"open()\" [controls]=\"'panel-id'\" (click)=\"open.set(!open())\">\n * Toggle\n * </button>\n * <div id=\"panel-id\" role=\"region\" [hidden]=\"!open()\">Panel content</div>\n * ```\n *\n * ### Accordion with multiple panels\n * ```html\n * @for (panel of panels(); track panel.id) {\n * <button [cngxAriaExpanded]=\"panel.open\" [controls]=\"panel.id\" (click)=\"toggle(panel)\">\n * {{ panel.label }}\n * </button>\n * @if (panel.open) {\n * <div [id]=\"panel.id\" role=\"region\">{{ panel.content }}</div>\n * }\n * }\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/aria-expanded.directive.ts\n * @since 0.1.0\n * @relatedTo CngxLiveRegion, CngxExpandable, CngxDisclosure\n * <example-url>http://localhost:4200/#/common/a11y/aria-expanded/accordion-multiple-panels</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/aria-expanded/disclosure-pattern</example-url>\n */\n@Directive({\n selector: '[cngxAriaExpanded]',\n exportAs: 'cngxAriaExpanded',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': 'controls() ?? null',\n },\n})\nexport class CngxAriaExpanded {\n /** Whether the controlled element is currently expanded. Sets `aria-expanded`. */\n readonly expanded = input<boolean>(false, { alias: 'cngxAriaExpanded' });\n /** The `id` of the controlled element. Sets `aria-controls`. */\n readonly controls = input<string | undefined>(undefined);\n}\n","import { Directive, input } from '@angular/core';\n\n/**\n * Configures the host element as an ARIA live region.\n *\n * Screen readers monitor live regions and announce content changes automatically.\n * `polite` announcements are queued after the current utterance finishes;\n * `assertive` announcements interrupt immediately. `off` disables announcements.\n *\n * Sets `role=\"alert\"` for assertive regions and `role=\"status\"` for polite regions\n * via a host binding - no manual attribute wiring needed.\n *\n * Unlike CDK's `LiveAnnouncer` service (which creates a hidden DOM element and\n * requires imperative `announce()` calls), this directive decorates your own\n * element declaratively - the content you render IS the announcement.\n *\n * ### Status message\n * ```html\n * <div cngxLiveRegion [politeness]=\"'polite'\">\n * {{ statusMessage() }}\n * </div>\n * ```\n *\n * ### Form validation error (assertive)\n * ```html\n * <div cngxLiveRegion [politeness]=\"'assertive'\"\n * [style.color]=\"error() ? 'red' : 'transparent'\">\n * {{ error() }}\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/live-region.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAriaExpanded\n * <example-url>http://localhost:4200/#/common/a11y/live-region/form-validation-assertive-error-announcements</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/live-region/polite-vs-assertive</example-url>\n */\n@Directive({\n selector: '[cngxLiveRegion]',\n exportAs: 'cngxLiveRegion',\n standalone: true,\n host: {\n '[attr.aria-live]': 'politeness()',\n '[attr.aria-atomic]': 'atomic()',\n '[attr.aria-relevant]': 'relevant()',\n '[attr.role]':\n \"politeness() === 'off' ? null : politeness() === 'assertive' ? 'alert' : 'status'\",\n },\n})\nexport class CngxLiveRegion {\n /**\n * Controls the urgency of announcements.\n * - `'polite'` - queued after current speech (default)\n * - `'assertive'` - interrupts immediately\n * - `'off'` - no announcements\n */\n readonly politeness = input<'polite' | 'assertive' | 'off'>('polite');\n /** Whether the entire region should be announced as a whole. */\n readonly atomic = input<boolean>(true);\n /** Which types of content changes to announce. Space-separated: `additions`, `removals`, `text`. */\n readonly relevant = input<string>('additions text');\n}\n","import {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n Injector,\n} from '@angular/core';\n\n/**\n * Reactive autofocus for dynamically inserted elements.\n *\n * The native `autofocus` HTML attribute only works on initial page load.\n * This directive handles dynamic content: dialogs, panels, stepper steps,\n * and any element that appears after the initial render.\n *\n * Focuses the host element after the next render frame using `afterNextRender`.\n * When `when` changes to `true`, focus is re-applied.\n *\n * ### Focus on insertion\n * ```html\n * @if (showSearch()) {\n * <input cngxAutofocus placeholder=\"Search…\" />\n * }\n * ```\n *\n * ### Conditional focus\n * ```html\n * <input [cngxAutofocus]=\"isActive()\" />\n * ```\n *\n * ### With delay for transitions\n * ```html\n * <input cngxAutofocus [autofocusDelay]=\"200\" />\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/autofocus.directive.ts\n * @since 0.1.0\n * @relatedTo CngxFocusRestore, CngxFocusTrap, CngxFocusVisible\n * <example-url>http://localhost:4200/#/common/a11y/autofocus/conditional-focus</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/autofocus/focus-on-insert</example-url>\n */\n@Directive({\n selector: '[cngxAutofocus]',\n exportAs: 'cngxAutofocus',\n standalone: true,\n})\nexport class CngxAutofocus {\n /** Whether to focus the element. Defaults to `true` (always focus on render). */\n readonly when = input<boolean>(true, { alias: 'cngxAutofocus' });\n /** Delay in ms before focusing - useful when the element appears during a transition. */\n readonly delay = input<number>(0, { alias: 'autofocusDelay' });\n /** `FocusOptions` passed to `element.focus()`. */\n readonly options = input<FocusOptions>({}, { alias: 'autofocusOptions' });\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly injector = inject(Injector);\n private pendingTimer: ReturnType<typeof setTimeout> | null = null;\n private initialized = false;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.clearPending());\n\n afterNextRender(() => {\n if (this.when()) {\n this.scheduleFocus();\n }\n this.initialized = true;\n });\n\n // Re-focus on false→true transitions only; `previousWhen` starts as `true`\n // so the initial effect run does not double-trigger alongside afterNextRender.\n let previousWhen = true;\n effect(() => {\n const current = this.when();\n if (this.initialized && current && !previousWhen) {\n this.scheduleFocus();\n }\n previousWhen = current;\n });\n }\n\n private scheduleFocus(): void {\n this.clearPending();\n const delayMs = this.delay();\n if (delayMs > 0) {\n this.pendingTimer = setTimeout(() => this.applyFocus(), delayMs);\n } else {\n afterNextRender(() => this.applyFocus(), { injector: this.injector });\n }\n }\n\n private applyFocus(): void {\n (this.el.nativeElement as HTMLElement).focus(this.options());\n }\n\n private clearPending(): void {\n if (this.pendingTimer !== null) {\n clearTimeout(this.pendingTimer);\n this.pendingTimer = null;\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, input, signal } from '@angular/core';\n\n/**\n * Stores the previously focused element and restores focus on destroy.\n *\n * Prevents focus from falling to `<body>` when dynamic content is removed\n * (dialogs closing, panels collapsing, tabs switching). The directive captures\n * `document.activeElement` at initialization time and restores it when the\n * host element is destroyed.\n *\n * Fallback chain: stored element → provided fallback → nearest focusable ancestor → body.\n *\n * ### Panel that restores focus on close\n * ```html\n * @if (panelOpen()) {\n * <div cngxFocusRestore>\n * Panel content…\n * <button (click)=\"panelOpen.set(false)\">Close</button>\n * </div>\n * }\n * ```\n *\n * ### With explicit fallback\n * ```html\n * <div cngxFocusRestore [focusRestoreFallback]=\"fallbackBtn\">\n * Dynamic content…\n * </div>\n * <button #fallbackBtn>Fallback target</button>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-restore.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusTrap, CngxFocusVisible\n * <example-url>http://localhost:4200/#/common/a11y/focus-restore/inline-details</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-restore/panel-with-automatic-restore</example-url>\n */\n@Directive({\n selector: '[cngxFocusRestore]',\n exportAs: 'cngxFocusRestore',\n standalone: true,\n})\nexport class CngxFocusRestore {\n /** Whether to restore focus when the host element is destroyed. */\n readonly restoreOnDestroy = input<boolean>(true);\n /** Explicit fallback element if the stored element is no longer in the DOM. */\n readonly fallback = input<HTMLElement | null>(null);\n\n private readonly doc = inject(DOCUMENT);\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly storedElement = signal<HTMLElement | null>(null);\n\n constructor() {\n const activeEl = this.doc.activeElement;\n if (activeEl instanceof HTMLElement) {\n this.storedElement.set(activeEl);\n }\n\n inject(DestroyRef).onDestroy(() => {\n if (!this.restoreOnDestroy()) {\n return;\n }\n\n const target = this.resolveTarget();\n if (target) {\n target.focus();\n }\n });\n }\n\n /** Manually store the current focus target for later restoration. */\n capture(): void {\n const activeEl = this.doc.activeElement;\n if (activeEl instanceof HTMLElement) {\n this.storedElement.set(activeEl);\n }\n }\n\n /** Manually restore focus to the stored element. */\n restore(): void {\n const target = this.resolveTarget();\n if (target) {\n target.focus();\n }\n }\n\n /**\n * Walks the fallback chain:\n * 1. Stored element (if still in DOM and not body/self)\n * 2. Explicit fallback input\n * 3. Nearest focusable ancestor\n */\n private resolveTarget(): HTMLElement | null {\n const stored = this.storedElement();\n // Skip body - it signals \"nothing meaningful was focused\", not a real restore target.\n if (\n stored &&\n stored !== this.doc.body &&\n this.doc.contains(stored) &&\n stored !== (this.el.nativeElement as HTMLElement)\n ) {\n return stored;\n }\n\n const fallback = this.fallback();\n if (fallback && this.doc.contains(fallback)) {\n return fallback;\n }\n\n return this.findFocusableAncestor();\n }\n\n /** Traverses up the DOM tree looking for the first natively focusable element. */\n private findFocusableAncestor(): HTMLElement | null {\n let current = (this.el.nativeElement as HTMLElement).parentElement;\n while (current) {\n if (this.isFocusable(current)) {\n return current;\n }\n current = current.parentElement;\n }\n return null;\n }\n\n /** Checks if an element is natively focusable (tabindex, links, form controls). */\n private isFocusable(el: HTMLElement): boolean {\n if (el.tabIndex >= 0) {\n return true;\n }\n const tag = el.tagName.toLowerCase();\n return (\n (tag === 'a' && el.hasAttribute('href')) ||\n tag === 'button' ||\n tag === 'input' ||\n tag === 'select' ||\n tag === 'textarea'\n );\n }\n}\n","import { type FocusTrap, FocusTrapFactory } from '@angular/cdk/a11y';\nimport { computed, DestroyRef, Directive, effect, ElementRef, inject, input } from '@angular/core';\n\n/**\n * Traps keyboard focus within the host element using the CDK `FocusTrap`.\n *\n * When enabled, Tab and Shift+Tab cycle only within the host element's\n * focusable children. When `autoFocus` is `true` (default), focus moves to\n * the first tabbable element automatically on activation.\n *\n * Wraps CDK's `FocusTrapFactory` with a declarative, Signal-driven API.\n * The CDK's imperative `create()` / `destroy()` / `enabled` setter lifecycle\n * is handled internally via `effect()` and `DestroyRef`.\n *\n * ### Modal dialog\n * ```html\n * <div cngxFocusTrap [enabled]=\"isOpen()\" [autoFocus]=\"true\"\n * tabindex=\"-1\" role=\"dialog\" aria-modal=\"true\"\n * (keydown.escape)=\"isOpen.set(false)\">\n * <input placeholder=\"First input\" />\n * <button (click)=\"isOpen.set(false)\">Close</button>\n * </div>\n * ```\n *\n * ### Drawer / sidebar\n * ```html\n * <nav cngxFocusTrap [enabled]=\"drawerOpen()\" tabindex=\"-1\">\n * <a href=\"/home\">Home</a>\n * <a href=\"/settings\">Settings</a>\n * </nav>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-trap.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusRestore, CngxDialog\n * <example-url>http://localhost:4200/#/common/a11y/focus-trap/modal-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-trap/slide-out-drawer</example-url>\n */\n@Directive({\n selector: '[cngxFocusTrap]',\n exportAs: 'cngxFocusTrap',\n standalone: true,\n})\nexport class CngxFocusTrap {\n /** Whether the focus trap is active. When `false`, Tab navigates normally. */\n readonly enabled = input<boolean>(false);\n /** Whether to auto-focus the first tabbable element when the trap activates. */\n readonly autoFocus = input<boolean>(true);\n\n /** Computed signal reflecting the current trap state. */\n readonly isActive = computed(() => this.enabled());\n\n private readonly trap: FocusTrap;\n\n constructor() {\n const el = inject(ElementRef<HTMLElement>);\n this.trap = inject(FocusTrapFactory).create(el.nativeElement as HTMLElement);\n\n effect(() => {\n const enabled = this.enabled();\n this.trap.enabled = enabled;\n if (enabled && this.autoFocus()) {\n void this.trap.focusFirstTabbableElementWhenReady();\n }\n });\n\n inject(DestroyRef).onDestroy(() => this.trap.destroy());\n }\n\n /** Programmatically focus the first tabbable element within the trap. */\n focusFirst(): void {\n void this.trap.focusFirstTabbableElementWhenReady();\n }\n\n /** Programmatically focus the last tabbable element within the trap. */\n focusLast(): void {\n void this.trap.focusLastTabbableElementWhenReady();\n }\n}\n","import { Directive, signal } from '@angular/core';\n\n/**\n * Tracks keyboard-initiated focus on the host element.\n *\n * Adds `cngx-focus-visible` CSS class when the element receives focus via keyboard\n * and removes it on blur or when focus was initiated by pointer interaction.\n *\n *\n * ```html\n * <button cngxFocusVisible #fv=\"cngxFocusVisible\">\n * @if (fv.focusVisible()) { Focus ring visible }\n * </button>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-visible.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusRestore, CngxFocusTrap\n * <example-url>http://localhost:4200/#/common/a11y/focus-visible/form-fields-custom-focus-ring</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-visible/keyboard-vs-pointer</example-url>\n */\n@Directive({\n selector: '[cngxFocusVisible]',\n exportAs: 'cngxFocusVisible',\n standalone: true,\n host: {\n '(pointerdown)': 'pointerActive = true',\n '(focusin)': 'handleFocus()',\n '(focusout)': 'handleBlur()',\n '[class.cngx-focus-visible]': 'focusVisible()',\n },\n})\nexport class CngxFocusVisible {\n private readonly focusVisibleState = signal(false);\n /** `true` when focus was initiated via keyboard (not pointer). */\n readonly focusVisible = this.focusVisibleState.asReadonly();\n\n /** @internal Cleared on `focusin` after being set by `pointerdown`. */\n pointerActive = false;\n\n /** @internal Sets focus-visible state; clears pointer flag. */\n protected handleFocus(): void {\n this.focusVisibleState.set(!this.pointerActive);\n this.pointerActive = false;\n }\n\n /** @internal Clears focus-visible state on blur. */\n protected handleBlur(): void {\n this.focusVisibleState.set(false);\n }\n}\n","import {\n afterNextRender,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\n/**\n * Marker directive for items managed by `CngxRovingTabindex`.\n *\n * Place on each focusable child inside a `[cngxRovingTabindex]` container.\n * The roving tabindex controller sets `tabindex=\"0\"` on the active item\n * and `tabindex=\"-1\"` on all others.\n *\n * ```html\n * <div cngxRovingTabindex>\n * <button cngxRovingItem>One</button>\n * <button cngxRovingItem>Two</button>\n * <button cngxRovingItem>Three</button>\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/roving/roving-tabindex.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingTabindex, CngxButtonToggle\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/horizontal-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/vertical-menu</example-url>\n */\n@Directive({\n selector: '[cngxRovingItem]',\n exportAs: 'cngxRovingItem',\n standalone: true,\n})\nexport class CngxRovingItem {\n /** @internal Reference used by the parent `CngxRovingTabindex` to set `tabindex`. */\n readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Whether this item is disabled and should be skipped during navigation. */\n readonly disabled = input<boolean>(false, { alias: 'cngxRovingItemDisabled' });\n\n /** Programmatically focus this item. Called by the parent on arrow-key navigation. */\n focus(): void {\n (this.elementRef.nativeElement as HTMLElement).focus();\n }\n}\n\n/**\n * Implements the WAI-ARIA roving tabindex pattern for composite widgets.\n *\n * Only the active item in the group has `tabindex=\"0\"` - all others get\n * `tabindex=\"-1\"`. Arrow keys move focus within the group; Tab leaves it.\n * Home/End jump to first/last item.\n *\n * Works for toolbars, tab lists, card grids, menu bars, and any composite\n * widget where only one item should be in the tab order at a time.\n *\n * ### Virtual mode\n *\n * When `virtualCount` is set, `activeIndex` ranges from 0 to `virtualCount - 1`\n * instead of being bounded by `contentChildren.length`. Items are matched by\n * `data-cngx-recycle-index` attribute. When the target item is not in the DOM\n * (out of rendered range), `pendingFocus` is set so a wiring function like\n * `connectRecyclerToRoving()` can scroll it into view.\n *\n * ### Horizontal toolbar\n * ```html\n * <div cngxRovingTabindex orientation=\"horizontal\" #rv=\"cngxRovingTabindex\">\n * <button cngxRovingItem>Cut</button>\n * <button cngxRovingItem>Copy</button>\n * <button cngxRovingItem>Paste</button>\n * </div>\n * ```\n *\n * ### Vertical menu with controlled index\n * ```html\n * <ul cngxRovingTabindex orientation=\"vertical\" [(activeIndex)]=\"selectedIdx\">\n * @for (item of items(); track item.id) {\n * <li cngxRovingItem>{{ item.label }}</li>\n * }\n * </ul>\n * ```\n *\n * ### Virtual scroll integration\n * ```html\n * <div cngxRovingTabindex orientation=\"vertical\" [virtualCount]=\"recycler.ariaSetSize()\">\n * @for (item of visibleItems(); track item.id; let i = $index) {\n * <div cngxRovingItem [cngxVirtualItem]=\"recycler\" [cngxVirtualItemIndex]=\"recycler.start() + i\">\n * {{ item.name }}\n * </div>\n * }\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/roving/roving-tabindex.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingItem, CngxActiveDescendant\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/horizontal-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/vertical-menu</example-url>\n */\n@Directive({\n selector: '[cngxRovingTabindex]',\n exportAs: 'cngxRovingTabindex',\n standalone: true,\n host: {\n '(keydown)': 'handleKeyDown($event)',\n },\n})\nexport class CngxRovingTabindex {\n /**\n * Arrow key navigation axis. `'both'` enables both horizontal and\n * vertical arrows. Exposed as a `model` so composite hosts (e.g.\n * `CngxRadioGroup`, where the keyboard axis must always be `'both'`\n * per WAI-ARIA APG regardless of the cosmetic group orientation) can\n * override it from their own constructor.\n */\n readonly orientation = model<'horizontal' | 'vertical' | 'both'>('horizontal');\n /** Whether navigation wraps from last to first and vice versa. */\n readonly loop = input<boolean>(true);\n /** Index of the currently active (focusable) item. Supports two-way `[(activeIndex)]` binding. */\n readonly activeIndex = model<number>(0);\n\n /**\n * Total item count for virtual mode. When set, `activeIndex` ranges from 0 to\n * `virtualCount - 1` and items are matched by `data-cngx-recycle-index` attribute.\n * When not set, standard `contentChildren`-based navigation is used.\n */\n readonly virtualCount = input<number | undefined>(undefined);\n\n /** All `CngxRovingItem` children discovered via `contentChildren`. */\n private readonly items = contentChildren(CngxRovingItem);\n\n /** Guards against setting `tabindex` before the DOM is ready. */\n private readonly initialized = signal(false);\n\n /** Host element for `data-cngx-recycle-index` queries in virtual mode. */\n private readonly hostEl = inject(ElementRef<HTMLElement>);\n\n private readonly pendingFocusState = signal<number | null>(null);\n\n /**\n * Index of the item that should receive focus but is not currently in the DOM.\n * Non-null when virtual navigation targets an out-of-range item.\n * Used by `connectRecyclerToRoving()` to scroll the item into view and focus it.\n */\n readonly pendingFocus = this.pendingFocusState.asReadonly();\n\n constructor() {\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n if (!this.initialized()) {\n return;\n }\n const items = this.items();\n const active = this.activeIndex();\n const vc = this.virtualCount();\n\n if (vc != null) {\n // Virtual mode: match by data-cngx-recycle-index attribute\n items.forEach((item) => {\n const el = item.elementRef.nativeElement as HTMLElement;\n const idx = el.dataset['cngxRecycleIndex'];\n el.setAttribute('tabindex', idx != null && Number(idx) === active ? '0' : '-1');\n });\n } else {\n // Standard mode: match by array index\n const clamped = Math.max(0, Math.min(active, items.length - 1));\n items.forEach((item, i) =>\n (item.elementRef.nativeElement as HTMLElement).setAttribute(\n 'tabindex',\n i === clamped ? '0' : '-1',\n ),\n );\n }\n });\n }\n\n /**\n * Clears the pending focus target. Called by `connectRecyclerToRoving()`\n * after the item has been scrolled into view and focused.\n */\n clearPendingFocus(): void {\n this.pendingFocusState.set(null);\n }\n\n /**\n * Handles arrow-key, Home, and End navigation within the group.\n * Prevents default scrolling on arrow keys.\n *\n * Unified handler - delegates to virtual or contentChildren navigation\n * based on whether `virtualCount` is set.\n */\n protected handleKeyDown(event: KeyboardEvent): void {\n const vc = this.virtualCount();\n const allItems = this.items();\n const isVirtual = vc != null;\n const total = isVirtual ? vc : allItems.length;\n\n if (total === 0) {\n return;\n }\n if (!isVirtual && this.enabledItems().length === 0) {\n return;\n }\n\n const currentActive = this.activeIndex();\n const navigate = (direction: 1 | -1): number | null =>\n isVirtual\n ? this.findNextVirtual(currentActive, total, direction)\n : this.findNext(currentActive, allItems, direction);\n\n const keyMap: Record<string, () => number | null> = {\n ArrowRight: () => (this.isHorizontal() ? navigate(1) : null),\n ArrowLeft: () => (this.isHorizontal() ? navigate(-1) : null),\n ArrowDown: () => (this.isVertical() ? navigate(1) : null),\n ArrowUp: () => (this.isVertical() ? navigate(-1) : null),\n Home: () => (isVirtual ? 0 : this.findFirst(allItems)),\n End: () => (isVirtual ? total - 1 : this.findLast(allItems)),\n };\n\n const handler = keyMap[event.key];\n if (!handler) {\n return;\n }\n\n const nextIndex = handler();\n if (nextIndex !== null && nextIndex !== currentActive) {\n event.preventDefault();\n this.activeIndex.set(nextIndex);\n if (isVirtual) {\n this.focusVirtualItem(nextIndex);\n } else {\n allItems[nextIndex].focus();\n }\n } else if (nextIndex === currentActive) {\n event.preventDefault();\n }\n }\n\n /**\n * Attempts to focus a virtual item by querying `data-cngx-recycle-index`.\n * If the element is not in the DOM, sets `pendingFocus` for external resolution.\n */\n private focusVirtualItem(index: number): void {\n const el = (this.hostEl.nativeElement as HTMLElement).querySelector(\n `[data-cngx-recycle-index=\"${index}\"]`,\n );\n if (el instanceof HTMLElement) {\n el.focus();\n this.pendingFocusState.set(null);\n } else {\n this.pendingFocusState.set(index);\n }\n }\n\n /**\n * Finds the next index in virtual mode. No disabled-item skipping - can't check\n * disabled state of items not in the DOM.\n */\n private findNextVirtual(current: number, total: number, direction: 1 | -1): number | null {\n if (total === 0) {\n return null;\n }\n const idx = current + direction;\n if (this.loop()) {\n return ((idx % total) + total) % total;\n }\n if (idx < 0 || idx >= total) {\n return null;\n }\n return idx;\n }\n\n private enabledItems(): readonly CngxRovingItem[] {\n return this.items().filter((item) => !item.disabled());\n }\n\n private isHorizontal(): boolean {\n const o = this.orientation();\n return o === 'horizontal' || o === 'both';\n }\n\n private isVertical(): boolean {\n const o = this.orientation();\n return o === 'vertical' || o === 'both';\n }\n\n /**\n * Searches for the next enabled item starting from `current + direction`.\n * Respects `loop` - wraps around or stops at the boundary.\n * Skips disabled items.\n */\n private findNext(\n current: number,\n items: readonly CngxRovingItem[],\n direction: 1 | -1,\n ): number | null {\n const len = items.length;\n if (len === 0) {\n return null;\n }\n\n let idx = current + direction;\n const loop = this.loop();\n\n for (let i = 0; i < len; i++) {\n if (loop) {\n idx = ((idx % len) + len) % len;\n } else if (idx < 0 || idx >= len) {\n return null;\n }\n\n if (!items[idx].disabled()) {\n return idx;\n }\n idx += direction;\n }\n\n return null;\n }\n\n private findFirst(items: readonly CngxRovingItem[]): number | null {\n const idx = items.findIndex((item) => !item.disabled());\n return idx >= 0 ? idx : null;\n }\n\n private findLast(items: readonly CngxRovingItem[]): number | null {\n for (let i = items.length - 1; i >= 0; i--) {\n if (!items[i].disabled()) {\n return i;\n }\n }\n return null;\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Descriptor of an item managed by `CngxActiveDescendant`.\n *\n * `id` must be unique and stable across change detection runs (use `nextUid()`\n * from `@cngx/core/utils`). `label` is used by typeahead matching.\n *\n * @category common/a11y\n */\nexport interface ActiveDescendantItem {\n /** Unique DOM `id` on the element - required for `aria-activedescendant`. */\n readonly id: string;\n /** Opaque value emitted on `activated`. Compared with `Object.is` by default. */\n readonly value: unknown;\n /** Human-readable text used by typeahead. Falls back to empty string. */\n readonly label: string;\n /** Disabled items are skipped during navigation when `skipDisabled` is true. */\n readonly disabled?: boolean;\n}\n\n/**\n * DI token for content-projected items that should register with the\n * surrounding `CngxActiveDescendant`.\n *\n * Consumers like `CngxOption` and `CngxMenuItem` expose themselves via:\n *\n * ```typescript\n * providers: [{ provide: CNGX_AD_ITEM, useExisting: MyItem }]\n * ```\n *\n * The contained directive must expose `id`, `value`, `label`, and optionally\n * `disabled` as signals - the AD reads them reactively.\n *\n * @category common/a11y\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/active-descendant/ad-item.token.ts\n * @since 0.1.0\n */\nexport const CNGX_AD_ITEM = new InjectionToken<CngxAdItemHandle>('CNGX_AD_ITEM');\n\n/**\n * Minimum shape an AD-registered directive must expose.\n *\n * The shape is signal-based so the AD recomputes when any field changes.\n *\n * @category common/a11y\n */\nexport interface CngxAdItemHandle {\n readonly id: string;\n readonly value: Signal<unknown>;\n /**\n * Label accessor. Typically a signal, but may be a plain getter when the\n * label derives from runtime DOM state (e.g. `textContent` fallback).\n */\n readonly label: Signal<string> | (() => string);\n readonly disabled?: Signal<boolean>;\n}\n","import {\n afterNextRender,\n computed,\n contentChildren,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { CNGX_AD_ITEM, type ActiveDescendantItem, type CngxAdItemHandle } from './ad-item.token';\n\n/**\n * WAI-ARIA active-descendant pattern. Focus stays on the host; the active\n * option is reported via `aria-activedescendant`.\n *\n * ### When to use this vs. `CngxRovingTabindex`\n *\n * - **Active-descendant** when focus stays on one container (listbox, menu,\n * combobox input) and items must not be tab-stops. Screen readers announce\n * the referenced option while the focus ring stays on the host.\n * - **Roving tabindex** when items themselves are tab-stops (toolbar, tab\n * list, grid cells). See `CngxRovingTabindex`.\n *\n * ### Item registration\n *\n * Items register either by providing `CNGX_AD_ITEM` via `hostDirectives` /\n * `providers`, or by passing a `Signal<ActiveDescendantItem[]>` through the\n * `items` input. The `items` input wins when both are present; use it when\n * items come from a dynamic data source.\n *\n * ### Virtualization\n *\n * When `virtualCount` is set, navigation can address indices not currently\n * in the DOM. `pendingHighlight` tells the consumer to scroll the missing\n * item into view; the consumer calls `clearPendingHighlight()` afterwards.\n *\n * ### Material/CDK equivalent\n *\n * Same model as `cdk-listbox` and `mat-select`, without the visual shell and\n * driven by signals instead of `ListKeyManager`.\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/active-descendant/active-descendant.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingTabindex, CngxListbox, CngxMenu\n * <example-url>http://localhost:4200/#/common/a11y/active-descendant/listbox-with-items-input</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/active-descendant/typeahead</example-url>\n */\n@Directive({\n selector: '[cngxActiveDescendant]',\n exportAs: 'cngxActiveDescendant',\n standalone: true,\n host: {\n '[attr.aria-activedescendant]': 'activeId()',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxActiveDescendant {\n /**\n * Optional explicit item list. When provided, takes precedence over items\n * registered via `CNGX_AD_ITEM`. Useful for combobox-style consumers that\n * drive the menu from a dynamic data source - pass the unwrapped array\n * (typically the result of a `computed()`), Angular's signal inputs make it\n * reactive automatically.\n */\n readonly items = input<ActiveDescendantItem[] | undefined>(undefined);\n\n /** Arrow-key navigation axis. Defaults to `'vertical'` (listbox/menu style). */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n /** Whether navigation wraps from last to first and vice versa. */\n readonly loop = input<boolean>(true);\n /** Whether alphanumeric typeahead navigation is enabled. */\n readonly typeahead = input<boolean>(true);\n /** Buffer reset window for typeahead, in milliseconds. */\n readonly typeaheadDebounce = input<number>(300);\n /** Whether the first non-disabled item is highlighted automatically. */\n readonly autoHighlightFirst = input<boolean>(false);\n /** Whether disabled items are skipped during navigation and value lookup. */\n readonly skipDisabled = input<boolean>(true);\n /**\n * When set, navigation treats the range `[0, virtualCount)` as the item\n * space even if only a subset is rendered. Targets outside the rendered\n * range surface as `pendingHighlight` for scroll-and-retry protocols.\n */\n readonly virtualCount = input<number | undefined>(undefined);\n\n /** Emitted when `activateCurrent()` is called with an active item. */\n readonly activated = output<unknown>();\n /** Emitted whenever the highlighted item changes. */\n readonly highlighted = output<ActiveDescendantItem | null>();\n\n private readonly hostEl = inject(ElementRef<HTMLElement>);\n private readonly registered = contentChildren(CNGX_AD_ITEM, { descendants: true });\n\n /** Guards host attribute writes until after first render. */\n private readonly initialized = signal(false);\n\n /** -1 means \"no active item\". Range is [0, resolvedItems().length). */\n private readonly activeIndexState = signal<number>(-1);\n\n /** Index of an item that should be highlighted but is not in the DOM. */\n private readonly pendingHighlightState = signal<number | null>(null);\n readonly pendingHighlight = this.pendingHighlightState.asReadonly();\n\n /**\n * Resolved item list. Input `items` wins; otherwise the contentChildren\n * handles are projected into `ActiveDescendantItem` shape.\n */\n readonly resolvedItems = computed<ActiveDescendantItem[]>(() => {\n const explicit = this.items();\n if (explicit) {\n return explicit;\n }\n return this.registered().map(handleToItem);\n });\n\n /** Current active index. `-1` when no item is highlighted. */\n readonly activeIndex = computed<number>(() => {\n const idx = this.activeIndexState();\n const total = this.totalCount();\n if (idx < 0 || idx >= total) {\n return -1;\n }\n return idx;\n });\n\n /**\n * `activeIndex` always mapped back to an item. `null` when no active index\n * or the item is out of rendered range (virtual mode).\n */\n readonly activeItem = computed<ActiveDescendantItem | null>(() => {\n const idx = this.activeIndex();\n if (idx < 0) {\n return null;\n }\n const list = this.resolvedItems();\n return list[idx] ?? null;\n });\n\n readonly activeId = computed<string | null>(() => this.activeItem()?.id ?? null);\n readonly activeValue = computed<unknown>(() => this.activeItem()?.value ?? null);\n\n private readonly typeaheadBuffer = signal<string>('');\n private typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n if (!this.initialized()) {\n return;\n }\n if (this.autoHighlightFirst() && this.activeIndexState() === -1) {\n this.highlightFirst();\n }\n });\n\n effect(() => {\n this.highlighted.emit(this.activeItem());\n });\n\n effect(() => {\n const idx = this.activeIndex();\n if (idx < 0) {\n return;\n }\n if (this.virtualCount() != null) {\n if (!this.isRendered(idx)) {\n this.pendingHighlightState.set(idx);\n return;\n }\n this.pendingHighlightState.set(null);\n }\n queueMicrotask(() => this.scrollActiveIntoView());\n });\n\n inject(DestroyRef).onDestroy(() => {\n if (this.typeaheadTimer !== null) {\n clearTimeout(this.typeaheadTimer);\n }\n });\n }\n\n highlightNext(): void {\n const next = this.findFrom(this.activeIndexState(), 1);\n if (next !== null) {\n this.activeIndexState.set(next);\n }\n }\n\n highlightPrev(): void {\n const next = this.findFrom(this.activeIndexState(), -1);\n if (next !== null) {\n this.activeIndexState.set(next);\n }\n }\n\n highlightFirst(): void {\n const first = this.findBoundary(1);\n if (first !== null) {\n this.activeIndexState.set(first);\n }\n }\n\n highlightLast(): void {\n const last = this.findBoundary(-1);\n if (last !== null) {\n this.activeIndexState.set(last);\n }\n }\n\n /**\n * Highlight by zero-based index. Out-of-range indices are ignored.\n * Disabled items are rejected when `skipDisabled()` is true.\n */\n highlightByIndex(index: number): void {\n const total = this.totalCount();\n if (index < 0 || index >= total) {\n return;\n }\n if (this.skipDisabled() && this.isDisabledAt(index)) {\n return;\n }\n this.activeIndexState.set(index);\n }\n\n /**\n * Highlight the first item whose value matches (via `Object.is`). No-op if\n * no match. Disabled items are rejected when `skipDisabled()` is true.\n */\n highlightByValue(value: unknown): void {\n const items = this.resolvedItems();\n const idx = items.findIndex((it) => Object.is(it.value, value));\n if (idx < 0) {\n return;\n }\n if (this.skipDisabled() && items[idx].disabled) {\n return;\n }\n this.activeIndexState.set(idx);\n }\n\n /** Clear the highlight. */\n resetHighlight(): void {\n this.activeIndexState.set(-1);\n }\n\n /** Emit `activated` with the current item's value. No-op if nothing active. */\n activateCurrent(): void {\n const item = this.activeItem();\n if (item) {\n this.activated.emit(item.value);\n }\n }\n\n /** Called by recycler bridges after scrolling the pending index into view. */\n clearPendingHighlight(): void {\n this.pendingHighlightState.set(null);\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n // Skip events from editable descendants. Without this, every\n // printable key typed into a descendant <input> hits AD's typeahead\n // branch, gets preventDefault'd, and never reaches the input.\n const target = event.target as HTMLElement | null;\n if (target && target !== event.currentTarget && isEditableTarget(target)) {\n return;\n }\n\n const key = event.key;\n\n if (this.isNavKey(key)) {\n const before = this.activeIndexState();\n this.dispatchNav(key);\n if (this.activeIndexState() !== before) {\n event.preventDefault();\n }\n return;\n }\n\n if (key === 'Enter' || key === ' ') {\n if (this.activeItem()) {\n event.preventDefault();\n this.activateCurrent();\n }\n return;\n }\n\n if (this.typeahead() && isPrintableChar(key)) {\n event.preventDefault();\n this.handleTypeahead(key);\n }\n }\n\n private isNavKey(key: string): boolean {\n switch (key) {\n case 'ArrowDown':\n case 'ArrowUp':\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'Home':\n case 'End':\n return true;\n default:\n return false;\n }\n }\n\n private dispatchNav(key: string): void {\n const orientation = this.orientation();\n switch (key) {\n case 'ArrowDown':\n if (orientation === 'vertical') {\n this.highlightNext();\n }\n return;\n case 'ArrowUp':\n if (orientation === 'vertical') {\n this.highlightPrev();\n }\n return;\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n this.highlightNext();\n }\n return;\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n this.highlightPrev();\n }\n return;\n case 'Home':\n this.highlightFirst();\n return;\n case 'End':\n this.highlightLast();\n return;\n }\n }\n\n /**\n * Push a printable character into the typeahead buffer and jump to the next\n * matching option. Exposed for external keyboard hosts (e.g. a select\n * trigger) that keep focus on themselves while using active-descendant\n * semantics on a separate listbox.\n *\n * Consumers should only forward single-character printable keys (`length === 1`,\n * non-whitespace). Navigation keys and non-printables must not be forwarded.\n */\n typeaheadChar(ch: string): void {\n if (!this.typeahead()) {\n return;\n }\n this.handleTypeahead(ch);\n }\n\n private handleTypeahead(ch: string): void {\n const next = this.typeaheadBuffer() + ch.toLowerCase();\n this.typeaheadBuffer.set(next);\n\n if (this.typeaheadTimer !== null) {\n clearTimeout(this.typeaheadTimer);\n }\n this.typeaheadTimer = setTimeout(() => {\n this.typeaheadBuffer.set('');\n this.typeaheadTimer = null;\n }, this.typeaheadDebounce());\n\n const items = this.resolvedItems();\n const skip = this.skipDisabled();\n const start = Math.max(0, this.activeIndexState());\n const total = items.length;\n for (let offset = 0; offset < total; offset++) {\n const i = (start + offset) % total;\n const candidate = items[i];\n if (skip && candidate.disabled) {\n continue;\n }\n if (candidate.label.toLowerCase().startsWith(next)) {\n this.activeIndexState.set(i);\n return;\n }\n }\n }\n\n private findFrom(current: number, direction: 1 | -1): number | null {\n const total = this.totalCount();\n if (total === 0) {\n return null;\n }\n const items = this.resolvedItems();\n const skip = this.skipDisabled();\n const loop = this.loop();\n\n let idx = current < 0 ? (direction === 1 ? -1 : total) : current;\n for (let step = 0; step < total; step++) {\n idx += direction;\n if (idx < 0 || idx >= total) {\n if (!loop) {\n return null;\n }\n idx = ((idx % total) + total) % total;\n }\n if (!skip || !items[idx]?.disabled) {\n return idx;\n }\n }\n return null;\n }\n\n private findBoundary(direction: 1 | -1): number | null {\n const items = this.resolvedItems();\n const total = items.length;\n if (total === 0) {\n return null;\n }\n const skip = this.skipDisabled();\n if (direction === 1) {\n for (let i = 0; i < total; i++) {\n if (!skip || !items[i].disabled) {\n return i;\n }\n }\n } else {\n for (let i = total - 1; i >= 0; i--) {\n if (!skip || !items[i].disabled) {\n return i;\n }\n }\n }\n return null;\n }\n\n private totalCount(): number {\n const vc = this.virtualCount();\n if (vc != null) {\n return vc;\n }\n return this.resolvedItems().length;\n }\n\n private isDisabledAt(index: number): boolean {\n const items = this.resolvedItems();\n return !!items[index]?.disabled;\n }\n\n private isRendered(index: number): boolean {\n const items = this.resolvedItems();\n return index >= 0 && index < items.length && !!items[index];\n }\n\n private scrollActiveIntoView(): void {\n const id = this.activeId();\n if (!id) {\n return;\n }\n const el = (this.hostEl.nativeElement as HTMLElement).querySelector(`#${cssEscape(id)}`);\n if (el instanceof HTMLElement && typeof el.scrollIntoView === 'function') {\n el.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n }\n}\n\n/** @internal */\nfunction handleToItem(handle: CngxAdItemHandle): ActiveDescendantItem {\n return {\n id: handle.id,\n value: handle.value(),\n label: handle.label(),\n disabled: handle.disabled?.() ?? false,\n };\n}\n\n/** @internal */\nfunction isPrintableChar(key: string): boolean {\n return key.length === 1 && /\\S/.exec(key) !== null;\n}\n\n/**\n * True when the element would capture text input natively - a text\n * `<input>`, `<textarea>`, or any `contenteditable` host. Read-only /\n * button-type inputs (submit, radio, checkbox) are NOT editable; AD's\n * keyboard navigation still applies when focus lands on them.\n *\n * @internal\n */\nfunction isEditableTarget(el: HTMLElement): boolean {\n if (el.isContentEditable) {\n return true;\n }\n const tag = el.tagName;\n if (tag === 'TEXTAREA') {\n return true;\n }\n if (tag === 'INPUT') {\n const type = (el as HTMLInputElement).type.toLowerCase();\n return (\n type !== 'button' &&\n type !== 'submit' &&\n type !== 'reset' &&\n type !== 'checkbox' &&\n type !== 'radio' &&\n type !== 'range' &&\n type !== 'color' &&\n type !== 'file' &&\n type !== 'image'\n );\n }\n return false;\n}\n\n/** @internal */\nfunction cssEscape(id: string): string {\n const api = (globalThis as { CSS?: { escape?: (s: string) => string } }).CSS;\n if (api && typeof api.escape === 'function') {\n return api.escape(id);\n }\n return id.replace(/[^a-zA-Z0-9_-]/g, (m) => `\\\\${m}`);\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, inject, signal, type Signal } from '@angular/core';\n\n/**\n * Reflects the user's `prefers-reduced-motion` media query as a reactive signal.\n *\n * Adds the `cngx-reduced-motion` CSS class to the host when the user prefers\n * reduced motion. The `prefersReducedMotion()` signal updates live when the\n * OS preference changes - use it in TypeScript to skip animations, disable\n * auto-playing media, or choose between animated and instant transitions.\n *\n * Unlike a CSS-only `@media (prefers-reduced-motion: reduce)` approach, this\n * directive makes the preference available in component logic (e.g., to pick\n * a different animation strategy or suppress requestAnimationFrame loops).\n *\n * ### Conditional animation\n * ```html\n * <div cngxReducedMotion #rm=\"cngxReducedMotion\"\n * [style.animation]=\"rm.prefersReducedMotion() ? 'none' : 'spin 2s linear infinite'\">\n * </div>\n * ```\n *\n * ### TypeScript logic\n * ```typescript\n * readonly rm = viewChild(CngxReducedMotion);\n * readonly duration = computed(() => this.rm()?.prefersReducedMotion() ? 0 : 300);\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/motion/reduced-motion.directive.ts\n * @since 0.1.0\n * <example-url>http://localhost:4200/#/common/a11y/reduced-motion/animation-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/reduced-motion/toast-notifications-motion-aware</example-url>\n */\n@Directive({\n selector: '[cngxReducedMotion]',\n exportAs: 'cngxReducedMotion',\n standalone: true,\n host: { '[class.cngx-reduced-motion]': 'prefersReducedMotion()' },\n})\nexport class CngxReducedMotion {\n /** `true` when the user's OS is set to prefer reduced motion. Updates reactively. */\n readonly prefersReducedMotion: Signal<boolean>;\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n const pref = signal(false);\n\n if (win) {\n const mq = win.matchMedia('(prefers-reduced-motion: reduce)');\n pref.set(mq.matches);\n const listener = (e: MediaQueryListEvent) => pref.set(e.matches);\n mq.addEventListener('change', listener);\n inject(DestroyRef).onDestroy(() => mq.removeEventListener('change', listener));\n }\n\n this.prefersReducedMotion = pref.asReadonly();\n }\n}\n","/**\n * @module @cngx/common/a11y\n */\nexport { CngxAriaExpanded } from './aria/aria-expanded.directive';\nexport { CngxLiveRegion } from './aria/live-region.directive';\nexport { CngxAutofocus } from './focus/autofocus.directive';\nexport { CngxFocusRestore } from './focus/focus-restore.directive';\nexport { CngxFocusTrap } from './focus/focus-trap.directive';\nexport { CngxFocusVisible } from './focus/focus-visible.directive';\nexport { CngxRovingTabindex, CngxRovingItem } from './roving/roving-tabindex.directive';\nexport { CngxActiveDescendant } from './active-descendant/active-descendant.directive';\nexport {\n CNGX_AD_ITEM,\n type ActiveDescendantItem,\n type CngxAdItemHandle,\n} from './active-descendant/ad-item.token';\nexport { CngxReducedMotion } from './motion/reduced-motion.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;MAUU,gBAAgB,CAAA;;IAElB,QAAQ,GAAG,KAAK,CAAU,KAAK,gFAAI,KAAK,EAAE,kBAAkB,EAAA,CAAG;;AAE/D,IAAA,QAAQ,GAAG,KAAK,CAAqB,SAAS,+EAAC;uGAJ7C,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;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AiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,2BAAA,EAAA,wBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,EAAE,6BAA6B,EAAE,wBAAwB,EAAE;AAClE,iBAAA;;;ACzCD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cngx-common-a11y.mjs","sources":["../../../projects/common/a11y/aria/aria-expanded.directive.ts","../../../projects/common/a11y/aria/live-region.directive.ts","../../../projects/common/a11y/focus/autofocus.directive.ts","../../../projects/common/a11y/focus/focus-restore.directive.ts","../../../projects/common/a11y/focus/focus-trap.directive.ts","../../../projects/common/a11y/focus/focus-visible.directive.ts","../../../projects/common/a11y/roving/roving-tabindex.directive.ts","../../../projects/common/a11y/active-descendant/ad-item.token.ts","../../../projects/common/a11y/active-descendant/active-descendant.directive.ts","../../../projects/common/a11y/motion/reduced-motion.directive.ts","../../../projects/common/a11y/public-api.ts","../../../projects/common/a11y/cngx-common-a11y.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\n\n/**\n * Manages `aria-expanded` and optionally `aria-controls` on the host element.\n *\n * Pairs a disclosure trigger (button) with its controlled region via standard\n * WAI-ARIA attributes. Supports accordions, dropdowns, tree items, and any\n * disclosure pattern where a control toggles visibility of another element.\n *\n * Unlike manual `[attr.aria-expanded]` binding, this directive couples both\n * attributes (`aria-expanded` + `aria-controls`) in a single declaration,\n * preventing mismatches where one is set without the other.\n *\n * ### Simple disclosure\n * ```html\n * <button [cngxAriaExpanded]=\"open()\" [controls]=\"'panel-id'\" (click)=\"open.set(!open())\">\n * Toggle\n * </button>\n * <div id=\"panel-id\" role=\"region\" [hidden]=\"!open()\">Panel content</div>\n * ```\n *\n * ### Accordion with multiple panels\n * ```html\n * @for (panel of panels(); track panel.id) {\n * <button [cngxAriaExpanded]=\"panel.open\" [controls]=\"panel.id\" (click)=\"toggle(panel)\">\n * {{ panel.label }}\n * </button>\n * @if (panel.open) {\n * <div [id]=\"panel.id\" role=\"region\">{{ panel.content }}</div>\n * }\n * }\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/aria-expanded.directive.ts\n * @since 0.1.0\n * @relatedTo CngxLiveRegion, CngxExpandable, CngxDisclosure\n * <example-url>http://localhost:4200/#/common/a11y/aria-expanded/accordion-multiple-panels</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/aria-expanded/disclosure-pattern</example-url>\n */\n@Directive({\n selector: '[cngxAriaExpanded]',\n exportAs: 'cngxAriaExpanded',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': 'controls() ?? null',\n },\n})\nexport class CngxAriaExpanded {\n /** Whether the controlled element is currently expanded. Sets `aria-expanded`. */\n readonly expanded = input<boolean>(false, { alias: 'cngxAriaExpanded' });\n /** The `id` of the controlled element. Sets `aria-controls`. */\n readonly controls = input<string | undefined>(undefined);\n}\n","import { Directive, input } from '@angular/core';\n\n/**\n * Configures the host element as an ARIA live region.\n *\n * Screen readers monitor live regions and announce content changes automatically.\n * `polite` announcements are queued after the current utterance finishes;\n * `assertive` announcements interrupt immediately. `off` disables announcements.\n *\n * Sets `role=\"alert\"` for assertive regions and `role=\"status\"` for polite regions\n * via a host binding - no manual attribute wiring needed.\n *\n * Unlike CDK's `LiveAnnouncer` service (which creates a hidden DOM element and\n * requires imperative `announce()` calls), this directive decorates your own\n * element declaratively - the content you render IS the announcement.\n *\n * ### Status message\n * ```html\n * <div cngxLiveRegion [politeness]=\"'polite'\">\n * {{ statusMessage() }}\n * </div>\n * ```\n *\n * ### Form validation error (assertive)\n * ```html\n * <div cngxLiveRegion [politeness]=\"'assertive'\"\n * [style.color]=\"error() ? 'red' : 'transparent'\">\n * {{ error() }}\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/live-region.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAriaExpanded\n * <example-url>http://localhost:4200/#/common/a11y/live-region/form-validation-assertive-error-announcements</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/live-region/polite-vs-assertive</example-url>\n */\n@Directive({\n selector: '[cngxLiveRegion]',\n exportAs: 'cngxLiveRegion',\n standalone: true,\n host: {\n '[attr.aria-live]': 'politeness()',\n '[attr.aria-atomic]': 'atomic()',\n '[attr.aria-relevant]': 'relevant()',\n '[attr.role]':\n \"politeness() === 'off' ? null : politeness() === 'assertive' ? 'alert' : 'status'\",\n },\n})\nexport class CngxLiveRegion {\n /**\n * Controls the urgency of announcements.\n * - `'polite'` - queued after current speech (default)\n * - `'assertive'` - interrupts immediately\n * - `'off'` - no announcements\n */\n readonly politeness = input<'polite' | 'assertive' | 'off'>('polite');\n /** Whether the entire region should be announced as a whole. */\n readonly atomic = input<boolean>(true);\n /** Which types of content changes to announce. Space-separated: `additions`, `removals`, `text`. */\n readonly relevant = input<string>('additions text');\n}\n","import {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n Injector,\n} from '@angular/core';\n\n/**\n * Reactive autofocus for dynamically inserted elements.\n *\n * The native `autofocus` HTML attribute only works on initial page load.\n * This directive handles dynamic content: dialogs, panels, stepper steps,\n * and any element that appears after the initial render.\n *\n * Focuses the host element after the next render frame using `afterNextRender`.\n * When `when` changes to `true`, focus is re-applied.\n *\n * ### Focus on insertion\n * ```html\n * @if (showSearch()) {\n * <input cngxAutofocus placeholder=\"Search…\" />\n * }\n * ```\n *\n * ### Conditional focus\n * ```html\n * <input [cngxAutofocus]=\"isActive()\" />\n * ```\n *\n * ### With delay for transitions\n * ```html\n * <input cngxAutofocus [autofocusDelay]=\"200\" />\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/autofocus.directive.ts\n * @since 0.1.0\n * @relatedTo CngxFocusRestore, CngxFocusTrap, CngxFocusVisible\n * <example-url>http://localhost:4200/#/common/a11y/autofocus/conditional-focus</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/autofocus/focus-on-insert</example-url>\n */\n@Directive({\n selector: '[cngxAutofocus]',\n exportAs: 'cngxAutofocus',\n standalone: true,\n})\nexport class CngxAutofocus {\n /** Whether to focus the element. Defaults to `true` (always focus on render). */\n readonly when = input<boolean>(true, { alias: 'cngxAutofocus' });\n /** Delay in ms before focusing - useful when the element appears during a transition. */\n readonly delay = input<number>(0, { alias: 'autofocusDelay' });\n /** `FocusOptions` passed to `element.focus()`. */\n readonly options = input<FocusOptions>({}, { alias: 'autofocusOptions' });\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly injector = inject(Injector);\n private pendingTimer: ReturnType<typeof setTimeout> | null = null;\n private initialized = false;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.clearPending());\n\n afterNextRender(() => {\n if (this.when()) {\n this.scheduleFocus();\n }\n this.initialized = true;\n });\n\n // Re-focus on false→true transitions only; `previousWhen` starts as `true`\n // so the initial effect run does not double-trigger alongside afterNextRender.\n let previousWhen = true;\n effect(() => {\n const current = this.when();\n if (this.initialized && current && !previousWhen) {\n this.scheduleFocus();\n }\n previousWhen = current;\n });\n }\n\n private scheduleFocus(): void {\n this.clearPending();\n const delayMs = this.delay();\n if (delayMs > 0) {\n this.pendingTimer = setTimeout(() => this.applyFocus(), delayMs);\n } else {\n afterNextRender(() => this.applyFocus(), { injector: this.injector });\n }\n }\n\n private applyFocus(): void {\n (this.el.nativeElement as HTMLElement).focus(this.options());\n }\n\n private clearPending(): void {\n if (this.pendingTimer !== null) {\n clearTimeout(this.pendingTimer);\n this.pendingTimer = null;\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, input, signal } from '@angular/core';\n\n/**\n * CSS selector matching natively-focusable elements: links with an\n * `href`, the enabled form controls, and anything with an explicit\n * non-negative `tabindex`. Form controls carry `:not(:disabled)` because\n * a disabled control is not in the tab order - without it a descendant\n * probe would count a disabled button as focusable and a restore target\n * could land on an unfocusable element. Single source of truth for \"is\n * this focusable\" - the element-level {@link CngxFocusRestore} predicate\n * matches against it, and descendant probes (e.g. \"does this panel\n * contain a focusable child?\") query against it. Keeping one selector\n * stops the two uses from drifting apart.\n *\n * @category common/a11y\n * @since 0.1.0\n */\nexport const CNGX_FOCUSABLE_SELECTOR =\n 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Stores the previously focused element and restores focus on destroy.\n *\n * Prevents focus from falling to `<body>` when dynamic content is removed\n * (dialogs closing, panels collapsing, tabs switching). The directive captures\n * `document.activeElement` at initialization time and restores it when the\n * host element is destroyed.\n *\n * Fallback chain: stored element → provided fallback → nearest focusable ancestor → body.\n *\n * ### Panel that restores focus on close\n * ```html\n * @if (panelOpen()) {\n * <div cngxFocusRestore>\n * Panel content…\n * <button (click)=\"panelOpen.set(false)\">Close</button>\n * </div>\n * }\n * ```\n *\n * ### With explicit fallback\n * ```html\n * <div cngxFocusRestore [focusRestoreFallback]=\"fallbackBtn\">\n * Dynamic content…\n * </div>\n * <button #fallbackBtn>Fallback target</button>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-restore.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusTrap, CngxFocusVisible\n * <example-url>http://localhost:4200/#/common/a11y/focus-restore/inline-details</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-restore/panel-with-automatic-restore</example-url>\n */\n@Directive({\n selector: '[cngxFocusRestore]',\n exportAs: 'cngxFocusRestore',\n standalone: true,\n})\nexport class CngxFocusRestore {\n /** Whether to restore focus when the host element is destroyed. */\n readonly restoreOnDestroy = input<boolean>(true);\n /** Explicit fallback element if the stored element is no longer in the DOM. */\n readonly fallback = input<HTMLElement | null>(null);\n\n private readonly doc = inject(DOCUMENT);\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly storedElement = signal<HTMLElement | null>(null);\n\n constructor() {\n const activeEl = this.doc.activeElement;\n if (activeEl instanceof HTMLElement) {\n this.storedElement.set(activeEl);\n }\n\n inject(DestroyRef).onDestroy(() => {\n if (!this.restoreOnDestroy()) {\n return;\n }\n\n const target = this.resolveTarget();\n if (target) {\n target.focus();\n }\n });\n }\n\n /** Manually store the current focus target for later restoration. */\n capture(): void {\n const activeEl = this.doc.activeElement;\n if (activeEl instanceof HTMLElement) {\n this.storedElement.set(activeEl);\n }\n }\n\n /** Manually restore focus to the stored element. */\n restore(): void {\n const target = this.resolveTarget();\n if (target) {\n target.focus();\n }\n }\n\n /**\n * Walks the fallback chain:\n * 1. Stored element (if still in DOM and not body/self)\n * 2. Explicit fallback input\n * 3. Nearest focusable ancestor\n */\n private resolveTarget(): HTMLElement | null {\n const stored = this.storedElement();\n // Skip body - it signals \"nothing meaningful was focused\", not a real restore target.\n if (\n stored &&\n stored !== this.doc.body &&\n this.doc.contains(stored) &&\n stored !== (this.el.nativeElement as HTMLElement)\n ) {\n return stored;\n }\n\n const fallback = this.fallback();\n if (fallback && this.doc.contains(fallback)) {\n return fallback;\n }\n\n return this.findFocusableAncestor();\n }\n\n /** Traverses up the DOM tree looking for the first natively focusable element. */\n private findFocusableAncestor(): HTMLElement | null {\n let current = (this.el.nativeElement as HTMLElement).parentElement;\n while (current) {\n if (this.isFocusable(current)) {\n return current;\n }\n current = current.parentElement;\n }\n return null;\n }\n\n /**\n * Checks if an element is natively focusable (tabindex, links, form\n * controls). Element-level predicate over the shared\n * {@link CNGX_FOCUSABLE_SELECTOR}, so it never drifts from the\n * descendant-query callers.\n */\n private isFocusable(el: HTMLElement): boolean {\n return el.matches(CNGX_FOCUSABLE_SELECTOR);\n }\n}\n","import { type FocusTrap, FocusTrapFactory } from '@angular/cdk/a11y';\nimport { computed, DestroyRef, Directive, effect, ElementRef, inject, input } from '@angular/core';\n\n/**\n * Traps keyboard focus within the host element using the CDK `FocusTrap`.\n *\n * When enabled, Tab and Shift+Tab cycle only within the host element's\n * focusable children. When `autoFocus` is `true` (default), focus moves to\n * the first tabbable element automatically on activation.\n *\n * Wraps CDK's `FocusTrapFactory` with a declarative, Signal-driven API.\n * The CDK's imperative `create()` / `destroy()` / `enabled` setter lifecycle\n * is handled internally via `effect()` and `DestroyRef`.\n *\n * ### Modal dialog\n * ```html\n * <div cngxFocusTrap [enabled]=\"isOpen()\" [autoFocus]=\"true\"\n * tabindex=\"-1\" role=\"dialog\" aria-modal=\"true\"\n * (keydown.escape)=\"isOpen.set(false)\">\n * <input placeholder=\"First input\" />\n * <button (click)=\"isOpen.set(false)\">Close</button>\n * </div>\n * ```\n *\n * ### Drawer / sidebar\n * ```html\n * <nav cngxFocusTrap [enabled]=\"drawerOpen()\" tabindex=\"-1\">\n * <a href=\"/home\">Home</a>\n * <a href=\"/settings\">Settings</a>\n * </nav>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-trap.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusRestore, CngxDialog\n * <example-url>http://localhost:4200/#/common/a11y/focus-trap/modal-dialog</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-trap/slide-out-drawer</example-url>\n */\n@Directive({\n selector: '[cngxFocusTrap]',\n exportAs: 'cngxFocusTrap',\n standalone: true,\n})\nexport class CngxFocusTrap {\n /** Whether the focus trap is active. When `false`, Tab navigates normally. */\n readonly enabled = input<boolean>(false);\n /** Whether to auto-focus the first tabbable element when the trap activates. */\n readonly autoFocus = input<boolean>(true);\n\n /** Computed signal reflecting the current trap state. */\n readonly isActive = computed(() => this.enabled());\n\n private readonly trap: FocusTrap;\n\n constructor() {\n const el = inject(ElementRef<HTMLElement>);\n this.trap = inject(FocusTrapFactory).create(el.nativeElement as HTMLElement);\n\n effect(() => {\n const enabled = this.enabled();\n this.trap.enabled = enabled;\n if (enabled && this.autoFocus()) {\n void this.trap.focusFirstTabbableElementWhenReady();\n }\n });\n\n inject(DestroyRef).onDestroy(() => this.trap.destroy());\n }\n\n /** Programmatically focus the first tabbable element within the trap. */\n focusFirst(): void {\n void this.trap.focusFirstTabbableElementWhenReady();\n }\n\n /** Programmatically focus the last tabbable element within the trap. */\n focusLast(): void {\n void this.trap.focusLastTabbableElementWhenReady();\n }\n}\n","import { Directive, signal } from '@angular/core';\n\n/**\n * Tracks keyboard-initiated focus on the host element.\n *\n * Adds `cngx-focus-visible` CSS class when the element receives focus via keyboard\n * and removes it on blur or when focus was initiated by pointer interaction.\n *\n *\n * ```html\n * <button cngxFocusVisible #fv=\"cngxFocusVisible\">\n * @if (fv.focusVisible()) { Focus ring visible }\n * </button>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-visible.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAutofocus, CngxFocusRestore, CngxFocusTrap\n * <example-url>http://localhost:4200/#/common/a11y/focus-visible/form-fields-custom-focus-ring</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/focus-visible/keyboard-vs-pointer</example-url>\n */\n@Directive({\n selector: '[cngxFocusVisible]',\n exportAs: 'cngxFocusVisible',\n standalone: true,\n host: {\n '(pointerdown)': 'pointerActive = true',\n '(focusin)': 'handleFocus()',\n '(focusout)': 'handleBlur()',\n '[class.cngx-focus-visible]': 'focusVisible()',\n },\n})\nexport class CngxFocusVisible {\n private readonly focusVisibleState = signal(false);\n /** `true` when focus was initiated via keyboard (not pointer). */\n readonly focusVisible = this.focusVisibleState.asReadonly();\n\n /** @internal Cleared on `focusin` after being set by `pointerdown`. */\n pointerActive = false;\n\n /** @internal Sets focus-visible state; clears pointer flag. */\n protected handleFocus(): void {\n this.focusVisibleState.set(!this.pointerActive);\n this.pointerActive = false;\n }\n\n /** @internal Clears focus-visible state on blur. */\n protected handleBlur(): void {\n this.focusVisibleState.set(false);\n }\n}\n","import {\n afterNextRender,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\n/**\n * Marker directive for items managed by `CngxRovingTabindex`.\n *\n * Place on each focusable child inside a `[cngxRovingTabindex]` container.\n * The roving tabindex controller sets `tabindex=\"0\"` on the active item\n * and `tabindex=\"-1\"` on all others.\n *\n * ```html\n * <div cngxRovingTabindex>\n * <button cngxRovingItem>One</button>\n * <button cngxRovingItem>Two</button>\n * <button cngxRovingItem>Three</button>\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/roving/roving-tabindex.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingTabindex, CngxButtonToggle\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/horizontal-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/vertical-menu</example-url>\n */\n@Directive({\n selector: '[cngxRovingItem]',\n exportAs: 'cngxRovingItem',\n standalone: true,\n})\nexport class CngxRovingItem {\n /** @internal Reference used by the parent `CngxRovingTabindex` to set `tabindex`. */\n readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Whether this item is disabled and should be skipped during navigation. */\n readonly disabled = input<boolean>(false, { alias: 'cngxRovingItemDisabled' });\n\n /** Programmatically focus this item. Called by the parent on arrow-key navigation. */\n focus(): void {\n (this.elementRef.nativeElement as HTMLElement).focus();\n }\n}\n\n/**\n * Implements the WAI-ARIA roving tabindex pattern for composite widgets.\n *\n * Only the active item in the group has `tabindex=\"0\"` - all others get\n * `tabindex=\"-1\"`. Arrow keys move focus within the group; Tab leaves it.\n * Home/End jump to first/last item.\n *\n * Works for toolbars, tab lists, card grids, menu bars, and any composite\n * widget where only one item should be in the tab order at a time.\n *\n * ### Virtual mode\n *\n * When `virtualCount` is set, `activeIndex` ranges from 0 to `virtualCount - 1`\n * instead of being bounded by `contentChildren.length`. Items are matched by\n * `data-cngx-recycle-index` attribute. When the target item is not in the DOM\n * (out of rendered range), `pendingFocus` is set so a wiring function like\n * `connectRecyclerToRoving()` can scroll it into view.\n *\n * ### Horizontal toolbar\n * ```html\n * <div cngxRovingTabindex orientation=\"horizontal\" #rv=\"cngxRovingTabindex\">\n * <button cngxRovingItem>Cut</button>\n * <button cngxRovingItem>Copy</button>\n * <button cngxRovingItem>Paste</button>\n * </div>\n * ```\n *\n * ### Vertical menu with controlled index\n * ```html\n * <ul cngxRovingTabindex orientation=\"vertical\" [(activeIndex)]=\"selectedIdx\">\n * @for (item of items(); track item.id) {\n * <li cngxRovingItem>{{ item.label }}</li>\n * }\n * </ul>\n * ```\n *\n * ### Virtual scroll integration\n * ```html\n * <div cngxRovingTabindex orientation=\"vertical\" [virtualCount]=\"recycler.ariaSetSize()\">\n * @for (item of visibleItems(); track item.id; let i = $index) {\n * <div cngxRovingItem [cngxVirtualItem]=\"recycler\" [cngxVirtualItemIndex]=\"recycler.start() + i\">\n * {{ item.name }}\n * </div>\n * }\n * </div>\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/roving/roving-tabindex.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingItem, CngxActiveDescendant\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/horizontal-toolbar</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/roving-tabindex/vertical-menu</example-url>\n */\n@Directive({\n selector: '[cngxRovingTabindex]',\n exportAs: 'cngxRovingTabindex',\n standalone: true,\n host: {\n '(keydown)': 'handleKeyDown($event)',\n },\n})\nexport class CngxRovingTabindex {\n /**\n * Arrow key navigation axis. `'both'` enables both horizontal and\n * vertical arrows. Exposed as a `model` so composite hosts (e.g.\n * `CngxRadioGroup`, where the keyboard axis must always be `'both'`\n * per WAI-ARIA APG regardless of the cosmetic group orientation) can\n * override it from their own constructor.\n */\n readonly orientation = model<'horizontal' | 'vertical' | 'both'>('horizontal');\n /** Whether navigation wraps from last to first and vice versa. */\n readonly loop = input<boolean>(true);\n /** Index of the currently active (focusable) item. Supports two-way `[(activeIndex)]` binding. */\n readonly activeIndex = model<number>(0);\n\n /**\n * Total item count for virtual mode. When set, `activeIndex` ranges from 0 to\n * `virtualCount - 1` and items are matched by `data-cngx-recycle-index` attribute.\n * When not set, standard `contentChildren`-based navigation is used.\n */\n readonly virtualCount = input<number | undefined>(undefined);\n\n /** All `CngxRovingItem` children discovered via `contentChildren`. */\n private readonly items = contentChildren(CngxRovingItem);\n\n /** Guards against setting `tabindex` before the DOM is ready. */\n private readonly initialized = signal(false);\n\n /** Host element for `data-cngx-recycle-index` queries in virtual mode. */\n private readonly hostEl = inject(ElementRef<HTMLElement>);\n\n private readonly pendingFocusState = signal<number | null>(null);\n\n /**\n * Index of the item that should receive focus but is not currently in the DOM.\n * Non-null when virtual navigation targets an out-of-range item.\n * Used by `connectRecyclerToRoving()` to scroll the item into view and focus it.\n */\n readonly pendingFocus = this.pendingFocusState.asReadonly();\n\n constructor() {\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n if (!this.initialized()) {\n return;\n }\n const items = this.items();\n const active = this.activeIndex();\n const vc = this.virtualCount();\n\n if (vc != null) {\n // Virtual mode: match by data-cngx-recycle-index attribute\n items.forEach((item) => {\n const el = item.elementRef.nativeElement as HTMLElement;\n const idx = el.dataset['cngxRecycleIndex'];\n el.setAttribute('tabindex', idx != null && Number(idx) === active ? '0' : '-1');\n });\n } else {\n // Standard mode: match by array index\n const clamped = Math.max(0, Math.min(active, items.length - 1));\n items.forEach((item, i) =>\n (item.elementRef.nativeElement as HTMLElement).setAttribute(\n 'tabindex',\n i === clamped ? '0' : '-1',\n ),\n );\n }\n });\n }\n\n /**\n * Clears the pending focus target. Called by `connectRecyclerToRoving()`\n * after the item has been scrolled into view and focused.\n */\n clearPendingFocus(): void {\n this.pendingFocusState.set(null);\n }\n\n /**\n * Handles arrow-key, Home, and End navigation within the group.\n * Prevents default scrolling on arrow keys.\n *\n * Unified handler - delegates to virtual or contentChildren navigation\n * based on whether `virtualCount` is set.\n */\n protected handleKeyDown(event: KeyboardEvent): void {\n const vc = this.virtualCount();\n const allItems = this.items();\n const isVirtual = vc != null;\n const total = isVirtual ? vc : allItems.length;\n\n if (total === 0) {\n return;\n }\n if (!isVirtual && this.enabledItems().length === 0) {\n return;\n }\n\n const currentActive = this.activeIndex();\n const navigate = (direction: 1 | -1): number | null =>\n isVirtual\n ? this.findNextVirtual(currentActive, total, direction)\n : this.findNext(currentActive, allItems, direction);\n\n const keyMap: Record<string, () => number | null> = {\n ArrowRight: () => (this.isHorizontal() ? navigate(1) : null),\n ArrowLeft: () => (this.isHorizontal() ? navigate(-1) : null),\n ArrowDown: () => (this.isVertical() ? navigate(1) : null),\n ArrowUp: () => (this.isVertical() ? navigate(-1) : null),\n Home: () => (isVirtual ? 0 : this.findFirst(allItems)),\n End: () => (isVirtual ? total - 1 : this.findLast(allItems)),\n };\n\n const handler = keyMap[event.key];\n if (!handler) {\n return;\n }\n\n const nextIndex = handler();\n if (nextIndex !== null && nextIndex !== currentActive) {\n event.preventDefault();\n this.activeIndex.set(nextIndex);\n if (isVirtual) {\n this.focusVirtualItem(nextIndex);\n } else {\n allItems[nextIndex].focus();\n }\n } else if (nextIndex === currentActive) {\n event.preventDefault();\n }\n }\n\n /**\n * Attempts to focus a virtual item by querying `data-cngx-recycle-index`.\n * If the element is not in the DOM, sets `pendingFocus` for external resolution.\n */\n private focusVirtualItem(index: number): void {\n const el = (this.hostEl.nativeElement as HTMLElement).querySelector(\n `[data-cngx-recycle-index=\"${index}\"]`,\n );\n if (el instanceof HTMLElement) {\n el.focus();\n this.pendingFocusState.set(null);\n } else {\n this.pendingFocusState.set(index);\n }\n }\n\n /**\n * Finds the next index in virtual mode. No disabled-item skipping - can't check\n * disabled state of items not in the DOM.\n */\n private findNextVirtual(current: number, total: number, direction: 1 | -1): number | null {\n if (total === 0) {\n return null;\n }\n const idx = current + direction;\n if (this.loop()) {\n return ((idx % total) + total) % total;\n }\n if (idx < 0 || idx >= total) {\n return null;\n }\n return idx;\n }\n\n private enabledItems(): readonly CngxRovingItem[] {\n return this.items().filter((item) => !item.disabled());\n }\n\n private isHorizontal(): boolean {\n const o = this.orientation();\n return o === 'horizontal' || o === 'both';\n }\n\n private isVertical(): boolean {\n const o = this.orientation();\n return o === 'vertical' || o === 'both';\n }\n\n /**\n * Searches for the next enabled item starting from `current + direction`.\n * Respects `loop` - wraps around or stops at the boundary.\n * Skips disabled items.\n */\n private findNext(\n current: number,\n items: readonly CngxRovingItem[],\n direction: 1 | -1,\n ): number | null {\n const len = items.length;\n if (len === 0) {\n return null;\n }\n\n let idx = current + direction;\n const loop = this.loop();\n\n for (let i = 0; i < len; i++) {\n if (loop) {\n idx = ((idx % len) + len) % len;\n } else if (idx < 0 || idx >= len) {\n return null;\n }\n\n if (!items[idx].disabled()) {\n return idx;\n }\n idx += direction;\n }\n\n return null;\n }\n\n private findFirst(items: readonly CngxRovingItem[]): number | null {\n const idx = items.findIndex((item) => !item.disabled());\n return idx >= 0 ? idx : null;\n }\n\n private findLast(items: readonly CngxRovingItem[]): number | null {\n for (let i = items.length - 1; i >= 0; i--) {\n if (!items[i].disabled()) {\n return i;\n }\n }\n return null;\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Descriptor of an item managed by `CngxActiveDescendant`.\n *\n * `id` must be unique and stable across change detection runs (use `nextUid()`\n * from `@cngx/core/utils`). `label` is used by typeahead matching.\n *\n * @category common/a11y\n */\nexport interface ActiveDescendantItem {\n /** Unique DOM `id` on the element - required for `aria-activedescendant`. */\n readonly id: string;\n /** Opaque value emitted on `activated`. Compared with `Object.is` by default. */\n readonly value: unknown;\n /** Human-readable text used by typeahead. Falls back to empty string. */\n readonly label: string;\n /** Disabled items are skipped during navigation when `skipDisabled` is true. */\n readonly disabled?: boolean;\n}\n\n/**\n * DI token for content-projected items that should register with the\n * surrounding `CngxActiveDescendant`.\n *\n * Consumers like `CngxOption` and `CngxMenuItem` expose themselves via:\n *\n * ```typescript\n * providers: [{ provide: CNGX_AD_ITEM, useExisting: MyItem }]\n * ```\n *\n * The contained directive must expose `id`, `value`, `label`, and optionally\n * `disabled` as signals - the AD reads them reactively.\n *\n * @category common/a11y\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/active-descendant/ad-item.token.ts\n * @since 0.1.0\n */\nexport const CNGX_AD_ITEM = new InjectionToken<CngxAdItemHandle>('CNGX_AD_ITEM');\n\n/**\n * Minimum shape an AD-registered directive must expose.\n *\n * The shape is signal-based so the AD recomputes when any field changes.\n *\n * @category common/a11y\n */\nexport interface CngxAdItemHandle {\n readonly id: string;\n readonly value: Signal<unknown>;\n /**\n * Label accessor. Typically a signal, but may be a plain getter when the\n * label derives from runtime DOM state (e.g. `textContent` fallback).\n */\n readonly label: Signal<string> | (() => string);\n readonly disabled?: Signal<boolean>;\n}\n","import {\n afterNextRender,\n computed,\n contentChildren,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { CNGX_AD_ITEM, type ActiveDescendantItem, type CngxAdItemHandle } from './ad-item.token';\n\n/**\n * WAI-ARIA active-descendant pattern. Focus stays on the host; the active\n * option is reported via `aria-activedescendant`.\n *\n * ### When to use this vs. `CngxRovingTabindex`\n *\n * - **Active-descendant** when focus stays on one container (listbox, menu,\n * combobox input) and items must not be tab-stops. Screen readers announce\n * the referenced option while the focus ring stays on the host.\n * - **Roving tabindex** when items themselves are tab-stops (toolbar, tab\n * list, grid cells). See `CngxRovingTabindex`.\n *\n * ### Item registration\n *\n * Items register either by providing `CNGX_AD_ITEM` via `hostDirectives` /\n * `providers`, or by passing a `Signal<ActiveDescendantItem[]>` through the\n * `items` input. The `items` input wins when both are present; use it when\n * items come from a dynamic data source.\n *\n * ### Virtualization\n *\n * When `virtualCount` is set, navigation can address indices not currently\n * in the DOM. `pendingHighlight` tells the consumer to scroll the missing\n * item into view; the consumer calls `clearPendingHighlight()` afterwards.\n *\n * ### Material/CDK equivalent\n *\n * Same model as `cdk-listbox` and `mat-select`, without the visual shell and\n * driven by signals instead of `ListKeyManager`.\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/active-descendant/active-descendant.directive.ts\n * @since 0.1.0\n * @relatedTo CngxRovingTabindex, CngxListbox, CngxMenu\n * <example-url>http://localhost:4200/#/common/a11y/active-descendant/listbox-with-items-input</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/active-descendant/typeahead</example-url>\n */\n@Directive({\n selector: '[cngxActiveDescendant]',\n exportAs: 'cngxActiveDescendant',\n standalone: true,\n host: {\n '[attr.aria-activedescendant]': 'activeId()',\n '(keydown)': 'handleKeydown($event)',\n },\n})\nexport class CngxActiveDescendant {\n /**\n * Optional explicit item list. When provided, takes precedence over items\n * registered via `CNGX_AD_ITEM`. Useful for combobox-style consumers that\n * drive the menu from a dynamic data source - pass the unwrapped array\n * (typically the result of a `computed()`), Angular's signal inputs make it\n * reactive automatically.\n */\n readonly items = input<ActiveDescendantItem[] | undefined>(undefined);\n\n /** Arrow-key navigation axis. Defaults to `'vertical'` (listbox/menu style). */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n /** Whether navigation wraps from last to first and vice versa. */\n readonly loop = input<boolean>(true);\n /** Whether alphanumeric typeahead navigation is enabled. */\n readonly typeahead = input<boolean>(true);\n /** Buffer reset window for typeahead, in milliseconds. */\n readonly typeaheadDebounce = input<number>(300);\n /** Whether the first non-disabled item is highlighted automatically. */\n readonly autoHighlightFirst = input<boolean>(false);\n /** Whether disabled items are skipped during navigation and value lookup. */\n readonly skipDisabled = input<boolean>(true);\n /**\n * When set, navigation treats the range `[0, virtualCount)` as the item\n * space even if only a subset is rendered. Targets outside the rendered\n * range surface as `pendingHighlight` for scroll-and-retry protocols.\n */\n readonly virtualCount = input<number | undefined>(undefined);\n\n /** Emitted when `activateCurrent()` is called with an active item. */\n readonly activated = output<unknown>();\n /** Emitted whenever the highlighted item changes. */\n readonly highlighted = output<ActiveDescendantItem | null>();\n\n private readonly hostEl = inject(ElementRef<HTMLElement>);\n private readonly registered = contentChildren(CNGX_AD_ITEM, { descendants: true });\n\n /** Guards host attribute writes until after first render. */\n private readonly initialized = signal(false);\n\n /** -1 means \"no active item\". Range is [0, resolvedItems().length). */\n private readonly activeIndexState = signal<number>(-1);\n\n /** Index of an item that should be highlighted but is not in the DOM. */\n private readonly pendingHighlightState = signal<number | null>(null);\n readonly pendingHighlight = this.pendingHighlightState.asReadonly();\n\n /**\n * Resolved item list. Input `items` wins; otherwise the contentChildren\n * handles are projected into `ActiveDescendantItem` shape.\n */\n readonly resolvedItems = computed<ActiveDescendantItem[]>(() => {\n const explicit = this.items();\n if (explicit) {\n return explicit;\n }\n return this.registered().map(handleToItem);\n });\n\n /** Current active index. `-1` when no item is highlighted. */\n readonly activeIndex = computed<number>(() => {\n const idx = this.activeIndexState();\n const total = this.totalCount();\n if (idx < 0 || idx >= total) {\n return -1;\n }\n return idx;\n });\n\n /**\n * `activeIndex` always mapped back to an item. `null` when no active index\n * or the item is out of rendered range (virtual mode).\n */\n readonly activeItem = computed<ActiveDescendantItem | null>(() => {\n const idx = this.activeIndex();\n if (idx < 0) {\n return null;\n }\n const list = this.resolvedItems();\n return list[idx] ?? null;\n });\n\n readonly activeId = computed<string | null>(() => this.activeItem()?.id ?? null);\n readonly activeValue = computed<unknown>(() => this.activeItem()?.value ?? null);\n\n private readonly typeaheadBuffer = signal<string>('');\n private typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n afterNextRender(() => this.initialized.set(true));\n\n effect(() => {\n if (!this.initialized()) {\n return;\n }\n if (this.autoHighlightFirst() && this.activeIndexState() === -1) {\n this.highlightFirst();\n }\n });\n\n effect(() => {\n this.highlighted.emit(this.activeItem());\n });\n\n effect(() => {\n const idx = this.activeIndex();\n if (idx < 0) {\n return;\n }\n if (this.virtualCount() != null) {\n if (!this.isRendered(idx)) {\n this.pendingHighlightState.set(idx);\n return;\n }\n this.pendingHighlightState.set(null);\n }\n queueMicrotask(() => this.scrollActiveIntoView());\n });\n\n inject(DestroyRef).onDestroy(() => {\n if (this.typeaheadTimer !== null) {\n clearTimeout(this.typeaheadTimer);\n }\n });\n }\n\n highlightNext(): void {\n const next = this.findFrom(this.activeIndexState(), 1);\n if (next !== null) {\n this.activeIndexState.set(next);\n }\n }\n\n highlightPrev(): void {\n const next = this.findFrom(this.activeIndexState(), -1);\n if (next !== null) {\n this.activeIndexState.set(next);\n }\n }\n\n highlightFirst(): void {\n const first = this.findBoundary(1);\n if (first !== null) {\n this.activeIndexState.set(first);\n }\n }\n\n highlightLast(): void {\n const last = this.findBoundary(-1);\n if (last !== null) {\n this.activeIndexState.set(last);\n }\n }\n\n /**\n * Highlight by zero-based index. Out-of-range indices are ignored.\n * Disabled items are rejected when `skipDisabled()` is true.\n */\n highlightByIndex(index: number): void {\n const total = this.totalCount();\n if (index < 0 || index >= total) {\n return;\n }\n if (this.skipDisabled() && this.isDisabledAt(index)) {\n return;\n }\n this.activeIndexState.set(index);\n }\n\n /**\n * Highlight the first item whose value matches (via `Object.is`). No-op if\n * no match. Disabled items are rejected when `skipDisabled()` is true.\n */\n highlightByValue(value: unknown): void {\n const items = this.resolvedItems();\n const idx = items.findIndex((it) => Object.is(it.value, value));\n if (idx < 0) {\n return;\n }\n if (this.skipDisabled() && items[idx].disabled) {\n return;\n }\n this.activeIndexState.set(idx);\n }\n\n /** Clear the highlight. */\n resetHighlight(): void {\n this.activeIndexState.set(-1);\n }\n\n /** Emit `activated` with the current item's value. No-op if nothing active. */\n activateCurrent(): void {\n const item = this.activeItem();\n if (item) {\n this.activated.emit(item.value);\n }\n }\n\n /** Called by recycler bridges after scrolling the pending index into view. */\n clearPendingHighlight(): void {\n this.pendingHighlightState.set(null);\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n // Skip events from editable descendants. Without this, every\n // printable key typed into a descendant <input> hits AD's typeahead\n // branch, gets preventDefault'd, and never reaches the input.\n const target = event.target as HTMLElement | null;\n if (target && target !== event.currentTarget && isEditableTarget(target)) {\n return;\n }\n\n const key = event.key;\n\n if (this.isNavKey(key)) {\n const before = this.activeIndexState();\n this.dispatchNav(key);\n if (this.activeIndexState() !== before) {\n event.preventDefault();\n }\n return;\n }\n\n if (key === 'Enter' || key === ' ') {\n if (this.activeItem()) {\n event.preventDefault();\n this.activateCurrent();\n }\n return;\n }\n\n if (this.typeahead() && isPrintableChar(key)) {\n event.preventDefault();\n this.handleTypeahead(key);\n }\n }\n\n private isNavKey(key: string): boolean {\n switch (key) {\n case 'ArrowDown':\n case 'ArrowUp':\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'Home':\n case 'End':\n return true;\n default:\n return false;\n }\n }\n\n private dispatchNav(key: string): void {\n const orientation = this.orientation();\n switch (key) {\n case 'ArrowDown':\n if (orientation === 'vertical') {\n this.highlightNext();\n }\n return;\n case 'ArrowUp':\n if (orientation === 'vertical') {\n this.highlightPrev();\n }\n return;\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n this.highlightNext();\n }\n return;\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n this.highlightPrev();\n }\n return;\n case 'Home':\n this.highlightFirst();\n return;\n case 'End':\n this.highlightLast();\n return;\n }\n }\n\n /**\n * Push a printable character into the typeahead buffer and jump to the next\n * matching option. Exposed for external keyboard hosts (e.g. a select\n * trigger) that keep focus on themselves while using active-descendant\n * semantics on a separate listbox.\n *\n * Consumers should only forward single-character printable keys (`length === 1`,\n * non-whitespace). Navigation keys and non-printables must not be forwarded.\n */\n typeaheadChar(ch: string): void {\n if (!this.typeahead()) {\n return;\n }\n this.handleTypeahead(ch);\n }\n\n private handleTypeahead(ch: string): void {\n const next = this.typeaheadBuffer() + ch.toLowerCase();\n this.typeaheadBuffer.set(next);\n\n if (this.typeaheadTimer !== null) {\n clearTimeout(this.typeaheadTimer);\n }\n this.typeaheadTimer = setTimeout(() => {\n this.typeaheadBuffer.set('');\n this.typeaheadTimer = null;\n }, this.typeaheadDebounce());\n\n const items = this.resolvedItems();\n const skip = this.skipDisabled();\n const start = Math.max(0, this.activeIndexState());\n const total = items.length;\n for (let offset = 0; offset < total; offset++) {\n const i = (start + offset) % total;\n const candidate = items[i];\n if (skip && candidate.disabled) {\n continue;\n }\n if (candidate.label.toLowerCase().startsWith(next)) {\n this.activeIndexState.set(i);\n return;\n }\n }\n }\n\n private findFrom(current: number, direction: 1 | -1): number | null {\n const total = this.totalCount();\n if (total === 0) {\n return null;\n }\n const items = this.resolvedItems();\n const skip = this.skipDisabled();\n const loop = this.loop();\n\n let idx = current < 0 ? (direction === 1 ? -1 : total) : current;\n for (let step = 0; step < total; step++) {\n idx += direction;\n if (idx < 0 || idx >= total) {\n if (!loop) {\n return null;\n }\n idx = ((idx % total) + total) % total;\n }\n if (!skip || !items[idx]?.disabled) {\n return idx;\n }\n }\n return null;\n }\n\n private findBoundary(direction: 1 | -1): number | null {\n const items = this.resolvedItems();\n const total = items.length;\n if (total === 0) {\n return null;\n }\n const skip = this.skipDisabled();\n if (direction === 1) {\n for (let i = 0; i < total; i++) {\n if (!skip || !items[i].disabled) {\n return i;\n }\n }\n } else {\n for (let i = total - 1; i >= 0; i--) {\n if (!skip || !items[i].disabled) {\n return i;\n }\n }\n }\n return null;\n }\n\n private totalCount(): number {\n const vc = this.virtualCount();\n if (vc != null) {\n return vc;\n }\n return this.resolvedItems().length;\n }\n\n private isDisabledAt(index: number): boolean {\n const items = this.resolvedItems();\n return !!items[index]?.disabled;\n }\n\n private isRendered(index: number): boolean {\n const items = this.resolvedItems();\n return index >= 0 && index < items.length && !!items[index];\n }\n\n private scrollActiveIntoView(): void {\n const id = this.activeId();\n if (!id) {\n return;\n }\n const el = (this.hostEl.nativeElement as HTMLElement).querySelector(`#${cssEscape(id)}`);\n if (el instanceof HTMLElement && typeof el.scrollIntoView === 'function') {\n el.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n }\n}\n\n/** @internal */\nfunction handleToItem(handle: CngxAdItemHandle): ActiveDescendantItem {\n return {\n id: handle.id,\n value: handle.value(),\n label: handle.label(),\n disabled: handle.disabled?.() ?? false,\n };\n}\n\n/** @internal */\nfunction isPrintableChar(key: string): boolean {\n return key.length === 1 && /\\S/.exec(key) !== null;\n}\n\n/**\n * True when the element would capture text input natively - a text\n * `<input>`, `<textarea>`, or any `contenteditable` host. Read-only /\n * button-type inputs (submit, radio, checkbox) are NOT editable; AD's\n * keyboard navigation still applies when focus lands on them.\n *\n * @internal\n */\nfunction isEditableTarget(el: HTMLElement): boolean {\n if (el.isContentEditable) {\n return true;\n }\n const tag = el.tagName;\n if (tag === 'TEXTAREA') {\n return true;\n }\n if (tag === 'INPUT') {\n const type = (el as HTMLInputElement).type.toLowerCase();\n return (\n type !== 'button' &&\n type !== 'submit' &&\n type !== 'reset' &&\n type !== 'checkbox' &&\n type !== 'radio' &&\n type !== 'range' &&\n type !== 'color' &&\n type !== 'file' &&\n type !== 'image'\n );\n }\n return false;\n}\n\n/** @internal */\nfunction cssEscape(id: string): string {\n const api = (globalThis as { CSS?: { escape?: (s: string) => string } }).CSS;\n if (api && typeof api.escape === 'function') {\n return api.escape(id);\n }\n return id.replace(/[^a-zA-Z0-9_-]/g, (m) => `\\\\${m}`);\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, inject, signal, type Signal } from '@angular/core';\n\n/**\n * Reflects the user's `prefers-reduced-motion` media query as a reactive signal.\n *\n * Adds the `cngx-reduced-motion` CSS class to the host when the user prefers\n * reduced motion. The `prefersReducedMotion()` signal updates live when the\n * OS preference changes - use it in TypeScript to skip animations, disable\n * auto-playing media, or choose between animated and instant transitions.\n *\n * Unlike a CSS-only `@media (prefers-reduced-motion: reduce)` approach, this\n * directive makes the preference available in component logic (e.g., to pick\n * a different animation strategy or suppress requestAnimationFrame loops).\n *\n * ### Conditional animation\n * ```html\n * <div cngxReducedMotion #rm=\"cngxReducedMotion\"\n * [style.animation]=\"rm.prefersReducedMotion() ? 'none' : 'spin 2s linear infinite'\">\n * </div>\n * ```\n *\n * ### TypeScript logic\n * ```typescript\n * readonly rm = viewChild(CngxReducedMotion);\n * readonly duration = computed(() => this.rm()?.prefersReducedMotion() ? 0 : 300);\n * ```\n *\n * @category common/a11y\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/motion/reduced-motion.directive.ts\n * @since 0.1.0\n * <example-url>http://localhost:4200/#/common/a11y/reduced-motion/animation-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/a11y/reduced-motion/toast-notifications-motion-aware</example-url>\n */\n@Directive({\n selector: '[cngxReducedMotion]',\n exportAs: 'cngxReducedMotion',\n standalone: true,\n host: { '[class.cngx-reduced-motion]': 'prefersReducedMotion()' },\n})\nexport class CngxReducedMotion {\n /** `true` when the user's OS is set to prefer reduced motion. Updates reactively. */\n readonly prefersReducedMotion: Signal<boolean>;\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n const pref = signal(false);\n\n if (win) {\n const mq = win.matchMedia('(prefers-reduced-motion: reduce)');\n pref.set(mq.matches);\n const listener = (e: MediaQueryListEvent) => pref.set(e.matches);\n mq.addEventListener('change', listener);\n inject(DestroyRef).onDestroy(() => mq.removeEventListener('change', listener));\n }\n\n this.prefersReducedMotion = pref.asReadonly();\n }\n}\n","/**\n * @module @cngx/common/a11y\n */\nexport { CngxAriaExpanded } from './aria/aria-expanded.directive';\nexport { CngxLiveRegion } from './aria/live-region.directive';\nexport { CngxAutofocus } from './focus/autofocus.directive';\nexport {\n CngxFocusRestore,\n CNGX_FOCUSABLE_SELECTOR,\n} from './focus/focus-restore.directive';\nexport { CngxFocusTrap } from './focus/focus-trap.directive';\nexport { CngxFocusVisible } from './focus/focus-visible.directive';\nexport { CngxRovingTabindex, CngxRovingItem } from './roving/roving-tabindex.directive';\nexport { CngxActiveDescendant } from './active-descendant/active-descendant.directive';\nexport {\n CNGX_AD_ITEM,\n type ActiveDescendantItem,\n type CngxAdItemHandle,\n} from './active-descendant/ad-item.token';\nexport { CngxReducedMotion } from './motion/reduced-motion.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;MAUU,gBAAgB,CAAA;;IAElB,QAAQ,GAAG,KAAK,CAAU,KAAK,gFAAI,KAAK,EAAE,kBAAkB,EAAA,CAAG;;AAE/D,IAAA,QAAQ,GAAG,KAAK,CAAqB,SAAS,+EAAC;uGAJ7C,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAA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,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,2BAAA,EAAA,wBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,EAAE,6BAA6B,EAAE,wBAAwB,EAAE;AAClE,iBAAA;;;ACzCD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -4894,6 +4894,26 @@ class CngxSwipe {
|
|
|
4894
4894
|
swipeProgress = this.swipeProgressState.asReadonly();
|
|
4895
4895
|
/** Dominant direction of the in-flight gesture, or `null` when idle. */
|
|
4896
4896
|
swipeDirection = this.swipeDirectionState.asReadonly();
|
|
4897
|
+
/**
|
|
4898
|
+
* The `touch-action` the host should advertise, derived from `axis`.
|
|
4899
|
+
* A pinned axis hands the orthogonal direction back to native
|
|
4900
|
+
* scrolling (`x` -> `pan-y`, `y` -> `pan-x`); `both` claims the
|
|
4901
|
+
* whole surface (`none`). When disabled, no value is written so the
|
|
4902
|
+
* element keeps its native scroll behaviour untouched.
|
|
4903
|
+
*/
|
|
4904
|
+
touchAction = computed(() => {
|
|
4905
|
+
if (!this.enabled()) {
|
|
4906
|
+
return null;
|
|
4907
|
+
}
|
|
4908
|
+
switch (this.axis()) {
|
|
4909
|
+
case 'x':
|
|
4910
|
+
return 'pan-y';
|
|
4911
|
+
case 'y':
|
|
4912
|
+
return 'pan-x';
|
|
4913
|
+
default:
|
|
4914
|
+
return 'none';
|
|
4915
|
+
}
|
|
4916
|
+
}, ...(ngDevMode ? [{ debugName: "touchAction" }] : /* istanbul ignore next */ []));
|
|
4897
4917
|
constructor() {
|
|
4898
4918
|
const nativeEl = inject((ElementRef)).nativeElement;
|
|
4899
4919
|
const doc = inject(DOCUMENT);
|
|
@@ -4957,27 +4977,36 @@ class CngxSwipe {
|
|
|
4957
4977
|
.subscribe();
|
|
4958
4978
|
}
|
|
4959
4979
|
/**
|
|
4960
|
-
* Resolve the
|
|
4961
|
-
*
|
|
4980
|
+
* Resolve the swipe direction + distance for a pointer delta.
|
|
4981
|
+
*
|
|
4982
|
+
* When `axis` is pinned, only that axis's delta decides direction
|
|
4983
|
+
* and distance - the orthogonal component is irrelevant, not an
|
|
4984
|
+
* abort reason. The previous endpoint-dominance check (`|dx| >= |dy|`)
|
|
4985
|
+
* discarded a clearly horizontal drag the moment a natural thumb arc
|
|
4986
|
+
* left `|dy|` slightly larger at release, which made a pinned swipe
|
|
4987
|
+
* register only on a near-perfect straight line. `touch-action`
|
|
4988
|
+
* (advertised from the same `axis`) is the real guard against an
|
|
4989
|
+
* orthogonal scroll firing the gesture: the browser cancels the
|
|
4990
|
+
* pointer before pointerup, so a clean cycle reaching here is already
|
|
4991
|
+
* the intended direction. `both` keeps the dominant-axis heuristic.
|
|
4962
4992
|
*/
|
|
4963
4993
|
read(startX, startY, endX, endY) {
|
|
4964
4994
|
const dx = endX - startX;
|
|
4965
4995
|
const dy = endY - startY;
|
|
4966
|
-
const horizontal = Math.abs(dx) >= Math.abs(dy);
|
|
4967
4996
|
const axis = this.axis();
|
|
4968
|
-
if (
|
|
4969
|
-
if (axis === 'y') {
|
|
4970
|
-
return null;
|
|
4971
|
-
}
|
|
4997
|
+
if (axis === 'x') {
|
|
4972
4998
|
return { direction: dx < 0 ? 'left' : 'right', distance: Math.abs(dx) };
|
|
4973
4999
|
}
|
|
4974
|
-
if (axis === '
|
|
4975
|
-
return
|
|
5000
|
+
if (axis === 'y') {
|
|
5001
|
+
return { direction: dy < 0 ? 'up' : 'down', distance: Math.abs(dy) };
|
|
4976
5002
|
}
|
|
4977
|
-
|
|
5003
|
+
const horizontal = Math.abs(dx) >= Math.abs(dy);
|
|
5004
|
+
return horizontal
|
|
5005
|
+
? { direction: dx < 0 ? 'left' : 'right', distance: Math.abs(dx) }
|
|
5006
|
+
: { direction: dy < 0 ? 'up' : 'down', distance: Math.abs(dy) };
|
|
4978
5007
|
}
|
|
4979
5008
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxSwipe, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4980
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.4", type: CngxSwipe, isStandalone: true, selector: "[cngxSwipe]", inputs: { threshold: { classPropertyName: "threshold", publicName: "threshold", isSignal: true, isRequired: false, transformFunction: null }, axis: { classPropertyName: "axis", publicName: "axis", isSignal: true, isRequired: false, transformFunction: null }, enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { swiped: "swiped" }, host: { properties: { "style.user-select": "swiping() ? 'none' : null", "style.-webkit-user-select": "swiping() ? 'none' : null" } }, exportAs: ["cngxSwipe"], ngImport: i0 });
|
|
5009
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.4", type: CngxSwipe, isStandalone: true, selector: "[cngxSwipe]", inputs: { threshold: { classPropertyName: "threshold", publicName: "threshold", isSignal: true, isRequired: false, transformFunction: null }, axis: { classPropertyName: "axis", publicName: "axis", isSignal: true, isRequired: false, transformFunction: null }, enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { swiped: "swiped" }, host: { properties: { "style.touch-action": "touchAction()", "style.user-select": "swiping() ? 'none' : null", "style.-webkit-user-select": "swiping() ? 'none' : null" } }, exportAs: ["cngxSwipe"], ngImport: i0 });
|
|
4981
5010
|
}
|
|
4982
5011
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxSwipe, decorators: [{
|
|
4983
5012
|
type: Directive,
|
|
@@ -4986,6 +5015,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
4986
5015
|
exportAs: 'cngxSwipe',
|
|
4987
5016
|
standalone: true,
|
|
4988
5017
|
host: {
|
|
5018
|
+
// Communicate the gesture's axis intent to the browser so it
|
|
5019
|
+
// never claims the swipe as a scroll. Derived from `axis`, not
|
|
5020
|
+
// hand-set in consumer CSS: every host of this directive gets the
|
|
5021
|
+
// correct touch-action for free instead of re-discovering the bug.
|
|
5022
|
+
'[style.touch-action]': 'touchAction()',
|
|
4989
5023
|
// Scope user-select suppression to the in-flight gesture. A
|
|
4990
5024
|
// bare `user-select: none` on the host kills text selection
|
|
4991
5025
|
// permanently inside the swipe surface even when the user is
|