@cngx/common 0.1.0-rc.4 → 0.1.0-rc.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-common-data.mjs","sources":["../../../projects/common/data/sort/sort.directive.ts","../../../projects/common/data/sort/sort-header-state.ts","../../../projects/common/data/sort/sort-header.directive.ts","../../../projects/common/data/filter/filter.directive.ts","../../../projects/common/data/filter-chips/filter-chips.component.ts","../../../projects/common/data/paginate/paginate.directive.ts","../../../projects/common/data/paginate/paginate-reset.directive.ts","../../../projects/common/data/paginate/paginate-emit.ts","../../../projects/common/data/paginate/paginate-routing.directive.ts","../../../projects/common/data/paginate/bucket-paginate-host.token.ts","../../../projects/common/data/paginate/bucket-paginate.directive.ts","../../../projects/common/data/data-source/data-source.ts","../../../projects/common/data/data-source/smart-data-source.ts","../../../projects/common/data/async-state/create-manual-state.ts","../../../projects/common/data/async-state/create-async-state.ts","../../../projects/common/data/async-state/inject-async-state.ts","../../../projects/common/data/async-state/resolve-view.ts","../../../projects/common/data/async-state/from-resource.ts","../../../projects/common/data/async-state/from-http-resource.ts","../../../projects/common/data/async-state/operators.ts","../../../projects/common/data/async/async.directive.ts","../../../projects/common/data/display/metric/metric.component.ts","../../../projects/common/data/display/shared/delta-format.ts","../../../projects/common/data/display/trend/trend.component.ts","../../../projects/common/data/display/delta/delta.component.ts","../../../projects/common/data/display/stat/stat.token.ts","../../../projects/common/data/display/stat/stat.component.ts","../../../projects/common/data/display/stat/stat-slots.ts","../../../projects/common/data/display/status/status.component.ts","../../../projects/common/data/display/goal/goal.component.ts","../../../projects/common/data/recycler/range-computer.ts","../../../projects/common/data/recycler/scroll-observer.ts","../../../projects/common/data/recycler/size-cache.ts","../../../projects/common/data/recycler/recycler.ts","../../../projects/common/data/recycler/measure.directive.ts","../../../projects/common/data/recycler/virtual-item.directive.ts","../../../projects/common/data/recycler/recycler-announcer.component.ts","../../../projects/common/data/recycler/connect-recycler-roving.ts","../../../projects/common/data/recycler/connect-recycler-active-descendant.ts","../../../projects/common/data/commit/commit-controller.ts","../../../projects/common/data/commit/commit-controller.token.ts","../../../projects/common/data/material-bridge/bidirectional-sync.ts","../../../projects/common/data/public-api.ts","../../../projects/common/data/cngx-common-data.ts"],"sourcesContent":["import { afterNextRender, computed, Directive, input, output, signal } from '@angular/core';\n\n/**\n * A single sort entry: the active field key and its direction.\n *\n * @category common/data/sort\n */\nexport interface SortEntry {\n active: string;\n direction: 'asc' | 'desc';\n}\n\n/**\n * Atom directive that tracks sort state (active field + direction).\n *\n * Supports both **uncontrolled** (internal state) and **controlled** modes.\n * In controlled mode the `cngxSortActive` / `cngxSortDirection` inputs take\n * precedence over the internal state - pair with `sortChange` to keep them\n * in sync.\n *\n * An uncontrolled sort may declare a **starting** column + direction via\n * `[cngxSortInitial]`: it seeds the internal state exactly once on init, then\n * user clicks take over. Distinct from the controlled `cngxSortActive` /\n * `cngxSortDirection` pins - the seed is skipped when a controlled pin is bound.\n *\n * When `multiSort` is `true`, holding **Shift** while clicking a sort header\n * adds it as a secondary (tertiary, …) sort key instead of replacing the\n * primary one. Shift-clicking an active column cycles it asc → desc → removed.\n * Multi-sort state is always uncontrolled; use `sortsChange` to read it.\n *\n * Consumer connects this to a table or list via a `computed()` - nothing is\n * injected automatically.\n *\n * @category common/data/sort\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/sort/sort.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSortHeader, CngxFilter, CngxPaginate, CngxSmartDataSource\n *\n * <example-url>http://localhost:4200/#/common/data/sort/basic</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/multi-sort</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/controlled</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/aria-and-keyboard</example-url>\n */\n@Directive({\n selector: '[cngxSort]',\n exportAs: 'cngxSort',\n standalone: true,\n})\nexport class CngxSort {\n /** Controlled active column. When bound, takes precedence over internal state (single-sort only). */\n readonly activeInput = input<string | undefined>(undefined, { alias: 'cngxSortActive' });\n /** Controlled direction. When bound, takes precedence over internal state (single-sort only). */\n readonly directionInput = input<'asc' | 'desc' | undefined>(undefined, {\n alias: 'cngxSortDirection',\n });\n /**\n * When `true`, Shift+click on a sort header adds it to the sort stack instead of\n * replacing the current sort.\n */\n readonly multiSort = input<boolean>(false);\n /**\n * Uncontrolled starting sort. Seeds the internal state once on init if no sort\n * is set yet and no controlled `cngxSortActive` pin is bound; user clicks own\n * it thereafter. Ignored in controlled mode.\n */\n readonly initialSort = input<SortEntry | undefined>(undefined, { alias: 'cngxSortInitial' });\n\n private readonly sortsState = signal<SortEntry[]>([]);\n\n constructor() {\n // One-shot uncontrolled seed: not a reactive derivation, so afterNextRender\n // (single-shot, outside the signal graph) rather than an effect. The empty +\n // no-controlled-pin guards keep it from clobbering an early click or writing\n // an invisible state that would surface when a controlled pin unbinds.\n afterNextRender(() => {\n const seed = this.initialSort();\n if (seed && this.sortsState().length === 0 && this.activeInput() === undefined) {\n this.sortsState.set([seed]);\n }\n });\n }\n\n /** The active sort column of the primary entry (controlled takes precedence in single-sort mode). */\n readonly active = computed(() => this.activeInput() ?? this.sortsState()[0]?.active);\n /** The active sort direction of the primary entry (controlled takes precedence in single-sort mode). */\n readonly direction = computed(() => this.directionInput() ?? this.sortsState()[0]?.direction);\n\n /**\n * The primary sort state, or `null` when no sort is active.\n * In multi-sort mode this is the first entry in `sorts`.\n */\n readonly sort = computed(() =>\n this.active() ? { active: this.active(), direction: this.direction() ?? 'asc' } : null,\n );\n\n /**\n * All active sort entries in priority order.\n * Contains at most one entry when additive mode has not been used.\n */\n readonly sorts = this.sortsState.asReadonly();\n\n /** `true` when at least one sort is active. */\n readonly isActive = computed(() => this.sorts().length > 0);\n\n /** Emitted when the primary sort state changes. Emits `undefined` on clear. */\n readonly sortChange = output<SortEntry | undefined>();\n /**\n * Emitted whenever the sort stack changes (including removals and full clears).\n * Always reflects the full `sorts` array at the time of emission.\n */\n readonly sortsChange = output<SortEntry[]>();\n\n /**\n * Sets or toggles the sort for `field`.\n *\n * **`additive = false`** (default, plain click):\n * - Same field → cycle `asc` → `desc` → cleared (a third click removes the sort)\n * - Different field → replace stack with `{ field, asc }`\n *\n * **`additive = true`** (Shift+click when `multiSort` is enabled on the header):\n * - Field not in stack → append as asc\n * - Field in stack as asc → change to desc\n * - Field in stack as desc → remove from stack\n */\n setSort(field: string, additive = false): void {\n if (additive) {\n const current = this.sortsState();\n const idx = current.findIndex((s) => s.active === field);\n let next: SortEntry[];\n if (idx === -1) {\n next = [...current, { active: field, direction: 'asc' }];\n } else if (current[idx].direction === 'asc') {\n next = current.map((s, i) => (i === idx ? { ...s, direction: 'desc' as const } : s));\n } else {\n next = current.filter((_, i) => i !== idx);\n }\n this.sortsState.set(next);\n this.sortsChange.emit(next);\n this.sortChange.emit(next[0]);\n } else {\n const current = this.sortsState();\n if (field === current[0]?.active && current[0].direction === 'desc') {\n // Third click on the active column: cycle desc -> cleared.\n this.sortsState.set([]);\n this.sortChange.emit(undefined);\n this.sortsChange.emit([]);\n } else {\n const dir: 'asc' | 'desc' = field === current[0]?.active ? 'desc' : 'asc';\n const entry: SortEntry = { active: field, direction: dir };\n this.sortsState.set([entry]);\n this.sortChange.emit(entry);\n this.sortsChange.emit([entry]);\n }\n }\n }\n\n /** Clears all active sorts. Emits both `sortChange(undefined)` and `sortsChange([])`. */\n clear(): void {\n this.sortsState.set([]);\n this.sortChange.emit(undefined);\n this.sortsChange.emit([]);\n }\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport { type CngxSort, type SortEntry } from './sort.directive';\n\n/**\n * The derived sort-header state a header directive exposes for one column.\n *\n * Pure derivation over a single {@link CngxSort} source plus an imperative\n * `toggle`. No async state, no signal writes outside `toggle`.\n *\n * @category common/data/sort\n */\nexport interface SortHeaderState {\n /** The active sort entry for this column, or `undefined` when the column is not sorted. */\n readonly entry: Signal<SortEntry | undefined>;\n /** `true` when this column is part of the active sort (primary or secondary). */\n readonly isActive: Signal<boolean>;\n /** `true` when this column is active and sorted ascending. */\n readonly isAsc: Signal<boolean>;\n /** `true` when this column is active and sorted descending. */\n readonly isDesc: Signal<boolean>;\n /**\n * 1-based position of this column in the sort stack, or `0` when it is not active.\n * Only meaningful when `multiSort` is enabled on the owning `CngxSort`.\n */\n readonly priority: Signal<number>;\n /**\n * Toggles this column's sort through `CngxSort.setSort`. Pass the header's own\n * Shift-key read as `additive`; the `multiSort` gate is applied here so the\n * column only joins the stack additively when the owning sort allows it.\n */\n toggle(additive?: boolean): void;\n}\n\n/**\n * Derives the shared sort-header state for one column from a {@link CngxSort} getter.\n *\n * Both {@link CngxSortHeader} (table context, `aria-sort`) and `CngxDgaSortHeader`\n * (disclosure context, `role=\"button\"` + `aria-describedby`) compose this factory\n * and keep only their own a11y presentation. The factory is a11y-agnostic - it\n * returns the plain derived signals each header maps to its own DOM/ARIA surface.\n *\n * @param sort Getter for the owning `CngxSort` engine (`() => sortRef`, `() => grid.sort`).\n * @param field Getter for the column's field key.\n * @returns The derived `{ entry, isActive, isAsc, isDesc, priority, toggle }` bundle.\n *\n * @category common/data/sort\n * @since 0.1.0\n * @relatedTo CngxSort, CngxSortHeader\n */\nexport function createSortHeaderState(sort: () => CngxSort, field: () => string): SortHeaderState {\n const entry = computed(() => sort().sorts().find((s) => s.active === field()));\n\n const isActive = computed(() => entry() !== undefined);\n const isAsc = computed(() => entry()?.direction === 'asc');\n const isDesc = computed(() => entry()?.direction === 'desc');\n\n const priority = computed(() => {\n const idx = sort().sorts().findIndex((s) => s.active === field());\n return idx === -1 ? 0 : idx + 1;\n });\n\n return {\n entry,\n isActive,\n isAsc,\n isDesc,\n priority,\n toggle(additive = false): void {\n sort().setSort(field(), additive && sort().multiSort());\n },\n };\n}\n","import { computed, Directive, input } from '@angular/core';\nimport { createSortHeaderState } from './sort-header-state';\nimport { type CngxSort } from './sort.directive';\n\n/**\n * Molecule directive for sort-header elements.\n *\n * Apply to any clickable header element. Consumer provides an explicit\n * `[cngxSortRef]` binding - no ancestor injection, no hidden wiring.\n *\n * In multi-sort mode, Shift+click adds this column to the sort stack.\n * The `priority()` signal returns the 1-based position in the stack\n * (0 when not active), useful for showing sort-order badges.\n *\n * ```html\n * <div cngxSort [multiSort]=\"true\" #sort=\"cngxSort\">\n * <button cngxSortHeader=\"name\" [cngxSortRef]=\"sort\" #h=\"cngxSortHeader\">\n * Name\n * @if (h.isActive()) {\n * {{ h.isAsc() ? '↑' : '↓' }}\n * @if (sort.multiSort()) { <span>{{ h.priority() }}</span> }\n * }\n * </button>\n * </div>\n * ```\n *\n * @category common/data/sort\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/sort/sort-header.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSort, CngxFilter, CngxPaginate\n *\n * <example-url>http://localhost:4200/#/common/data/sort/basic</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/multi-sort</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/controlled</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/aria-and-keyboard</example-url>\n */\n@Directive({\n selector: '[cngxSortHeader]',\n exportAs: 'cngxSortHeader',\n standalone: true,\n host: {\n '(click)': 'handleSort($event)',\n '[attr.aria-sort]': 'ariaSort()',\n '[class.cngx-sort-header--active]': 'isActive()',\n '[class.cngx-sort-header--asc]': 'isAsc()',\n '[class.cngx-sort-header--desc]': 'isDesc()',\n },\n})\nexport class CngxSortHeader {\n /** The field key this header cell represents. */\n readonly field = input.required<string>({ alias: 'cngxSortHeader' });\n /** Explicit reference to the owning `CngxSort`. */\n readonly cngxSortRef = input.required<CngxSort>();\n\n private readonly state = createSortHeaderState(this.cngxSortRef, this.field);\n\n /** `true` when this column is part of the active sort (primary or secondary). */\n readonly isActive = this.state.isActive;\n /** `true` when this column is active and sorted ascending. */\n readonly isAsc = this.state.isAsc;\n /** `true` when this column is active and sorted descending. */\n readonly isDesc = this.state.isDesc;\n\n /**\n * 1-based position of this column in the sort stack.\n * Returns `0` when the column is not part of the active sort.\n * Only meaningful when `multiSort` is enabled on the owning `CngxSort`.\n */\n readonly priority = this.state.priority;\n\n /** The `aria-sort` attribute value for the host element. */\n readonly ariaSort = computed((): 'ascending' | 'descending' | null => {\n if (!this.state.isActive()) {\n return null;\n }\n return this.state.isAsc() ? 'ascending' : 'descending';\n });\n\n protected handleSort(event?: MouseEvent): void {\n this.state.toggle(event?.shiftKey ?? false);\n }\n}\n","import { computed, Directive, input, output, signal } from '@angular/core';\n\n/**\n * Atom directive that holds one or more named filter predicates.\n *\n * Supports both **uncontrolled** (internal state) and **controlled** modes.\n * In controlled mode the `cngxFilter` input takes precedence over the internal\n * `'default'` predicate - pair with `filterChange` to keep it in sync.\n *\n * **Multi-filter** - use `addPredicate(key, fn)` / `removePredicate(key)` to\n * maintain a named stack of predicates. All active predicates are **AND-combined**\n * across keys: an item must pass every registered predicate to appear in results.\n *\n * AND vs OR - the directive enforces AND across dimensions (keys). OR logic\n * within a single dimension stays inside the predicate function itself:\n *\n * ```typescript\n * // AND across dimensions: location AND role must both match\n * filter.addPredicate('location', p => selectedLocations.has(p.location));\n * filter.addPredicate('role', p => selectedRoles.has(p.role));\n *\n * // OR within a dimension: London OR Rome - just put a Set inside one predicate\n * filter.addPredicate('location', p => selectedLocations.has(p.location));\n * ```\n *\n * `setPredicate` / `clear` operate on the `'default'` key and remain fully\n * backward-compatible with single-predicate usage.\n *\n * Consumer connects this to a list via a `computed()` - nothing is injected\n * automatically.\n *\n * @typeParam T - The item type the predicate operates on.\n *\n * @category common/data/filter\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/filter/filter.directive.ts\n * @since 0.1.0\n * @relatedTo CngxFilterChips, CngxSort, CngxPaginate, CngxSmartDataSource\n *\n * <example-url>http://localhost:4200/#/common/data/filter-chips/custom-chip-decoration-via-cngxfilterchip</example-url>\n * <example-url>http://localhost:4200/#/common/data/filter-chips/multi-role-filter-wired-to-a-list</example-url>\n * <example-url>http://localhost:4200/#/common/data/smart-data-source/auto-wired</example-url>\n * <example-url>http://localhost:4200/#/common/data/smart-data-source/how-it-works-hostdirectives-inject</example-url>\n * <example-url>http://localhost:4200/#/common/data/smart-data-source/smartdatasource-cngxpaginate-hostdirective</example-url>\n */\n@Directive({\n selector: '[cngxFilter]',\n exportAs: 'cngxFilter',\n standalone: true,\n})\nexport class CngxFilter<T = unknown> {\n /** Controlled predicate. When bound, takes precedence over the `'default'` internal predicate. */\n readonly predicateInput = input<((value: T) => boolean) | null>(null, { alias: 'cngxFilter' });\n\n private readonly predicatesState = signal<Map<string, (value: T) => boolean>>(new Map());\n\n /**\n * All active named predicates.\n * Use `addPredicate` / `removePredicate` to manage this map.\n */\n readonly predicates = this.predicatesState.asReadonly();\n\n /** Number of active named predicates (controlled input not counted). */\n readonly activeCount = computed(() => this.predicatesState().size);\n\n /**\n * The combined predicate - AND of all active named predicates plus the\n * controlled input (when bound). Returns `null` when nothing is active.\n */\n readonly predicate = computed((): ((value: T) => boolean) | null => {\n const controlled = this.predicateInput();\n const map = this.predicatesState();\n\n const fns = [...(controlled ? [controlled] : []), ...map.values()];\n\n if (fns.length === 0) {\n return null;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return (value: T) => fns.every((fn) => fn(value));\n });\n\n /** `true` when at least one predicate is active. */\n readonly isActive = computed(() => this.predicate() !== null);\n\n /** Emitted whenever the `'default'` predicate changes (backward-compat single-filter output). */\n readonly filterChange = output<((value: T) => boolean) | null>();\n\n /** Emitted whenever any named predicate is added or removed. */\n readonly predicatesChange = output<Map<string, (value: T) => boolean>>();\n\n /**\n * Adds or replaces the named predicate `key`.\n * Emits `predicatesChange` with the updated map.\n */\n addPredicate(key: string, fn: (value: T) => boolean): void {\n const next = new Map(this.predicatesState());\n next.set(key, fn);\n this.predicatesState.set(next);\n this.predicatesChange.emit(next);\n }\n\n /**\n * Removes the named predicate `key` (no-op if not present).\n * Emits `predicatesChange` with the updated map.\n */\n removePredicate(key: string): void {\n const current = this.predicatesState();\n if (!current.has(key)) {\n return;\n }\n const next = new Map(current);\n next.delete(key);\n this.predicatesState.set(next);\n this.predicatesChange.emit(next);\n }\n\n /**\n * Sets the `'default'` predicate and emits `filterChange`.\n * Pass `null` to clear it (same as `clear()`).\n */\n setPredicate(fn: ((value: T) => boolean) | null): void {\n if (fn === null) {\n this.removePredicate('default');\n } else {\n this.addPredicate('default', fn);\n }\n this.filterChange.emit(fn);\n }\n\n /** Removes all named predicates and emits `filterChange` with `null`. */\n clear(): void {\n this.predicatesState.set(new Map());\n this.predicatesChange.emit(new Map());\n this.filterChange.emit(null);\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n Directive,\n TemplateRef,\n afterNextRender,\n contentChild,\n inject,\n input,\n model,\n type Signal,\n} from '@angular/core';\nimport { CngxChip } from '@cngx/common/display';\nimport { CngxChipInGroup, CngxMultiChipGroup } from '@cngx/common/interactive';\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\nimport type { CngxFilter } from '../filter/filter.directive';\n\n/**\n * Per-chip override slot context. Consumers project an\n * `<ng-template cngxFilterChip let-option let-value=\"value\" let-label=\"label\">`\n * to customize chip body decoration - icons, count badges, colour\n * swatches, anything beyond the default text label.\n *\n * **Decoration-only semantics.** The bridge ALWAYS wraps each option\n * in `<cngx-chip cngxChipInGroup [value]>` itself; the slot only\n * customizes what renders INSIDE that wrapper. Consumers do NOT\n * redeclare selection wiring - it is handled by the bridge so the\n * projected content survives Angular's `*ngTemplateOutlet`\n * lexical-injector semantics (the projected template injects against\n * the consumer's component, NOT the bridge's inner\n * `<cngx-multi-chip-group>`, so a consumer-supplied\n * `cngxChipInGroup` would fail to resolve `CNGX_CHIP_GROUP_HOST`).\n *\n * @category common/data/filter\n */\nexport interface CngxFilterChipContext<TItem = unknown, TValue = unknown> {\n readonly $implicit: TItem;\n readonly option: TItem;\n readonly value: TValue;\n readonly label: string;\n}\n\n/**\n * Template-slot directive overriding the default chip body inside\n * `<cngx-filter-chips>`. Consumers attach\n * `<ng-template cngxFilterChip>` to project decoration; the bridge\n * wraps that decoration in `cngxChipInGroup`-bound chip wrappers\n * automatically. Absence falls back to the default text-only label.\n *\n * @category common/data/filter\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/filter-chips/filter-chips.component.ts\n * @since 0.1.0\n * @relatedTo CngxFilterChips, CngxFilter\n *\n * <example-url>http://localhost:4200/#/common/data/filter-chips/custom-chip-decoration-via-cngxfilterchip</example-url>\n * <example-url>http://localhost:4200/#/common/data/filter-chips/multi-role-filter-wired-to-a-list</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxFilterChip]',\n standalone: true,\n})\nexport class CngxFilterChip<TItem = unknown, TValue = unknown> {\n readonly template: TemplateRef<CngxFilterChipContext<TItem, TValue>> =\n inject<TemplateRef<CngxFilterChipContext<TItem, TValue>>>(TemplateRef);\n\n static ngTemplateContextGuard<TItem, TValue>(\n _dir: CngxFilterChip<TItem, TValue>,\n _ctx: unknown,\n ): _ctx is CngxFilterChipContext<TItem, TValue> {\n return true;\n }\n}\n\n/**\n * Bridge that connects a multi-select chip strip to a `CngxFilter`\n * predicate via Pillar-1 derivation - no `effect()` write-back, no\n * manual sync. The bridge composes `<cngx-multi-chip-group>` for\n * the visible chip strip and registers a single closure-style\n * predicate on the parent `[filterRef]`. Chip toggles update\n * `selectedValues`; the registered closure reads `selectedValues()`\n * lazily on every invocation so downstream filtered consumers\n * recompute without the bridge ever re-registering.\n *\n * Filter chips are inherently multi-select per\n * `feedback_select_family_split`; a single-mode filter-chip pattern\n * is intentionally out of scope. Consumers needing a single-select\n * filter wire `<cngx-chip-group>` to a custom predicate themselves.\n *\n * **Sync contract - derivation, not effect.** The bridge calls\n * `filterRef.addPredicate(filterKey, predicateFn)` EXACTLY ONCE\n * during mount (in `afterNextRender`, because `input.required()`\n * cannot be read from the constructor body). `predicateFn` is a\n * closure that reads `this.selectedValues()` and\n * `this.optionValueFn()` on every invocation. Because\n * `CngxFilter.predicate` is itself a `computed()` consumed by\n * downstream filtered lists, each item-evaluation flows through\n * `selectedValues()` in the consumer's reactive context - chip\n * toggles propagate without any `effect()` writing back into the\n * filter.\n *\n * **Empty-selection semantics.** When `selectedValues()` is `[]`,\n * the closure returns `true` for every item - equivalent to \"no\n * filter applied\". The bridge deliberately does NOT call\n * `removePredicate` on empty selection: leaving the predicate\n * registered with a constant-`true` short-circuit is cheaper than\n * re-registering on every empty/non-empty boundary, and keeps the\n * predicate-stack stable (no `predicatesChange` emission churn).\n *\n * **Teardown.** `DestroyRef.onDestroy` calls `removePredicate` only\n * when registration actually happened (`registered` flag) - guards\n * against the case where the component is destroyed before\n * `afterNextRender` fires. The destroy callback reads `filterRef`\n * and `filterKey` lazily so a consumer that re-binds these between\n * mount and unmount cleans the latest binding (per\n * `reference_signal_architecture` memory-hygiene rule).\n *\n * ```html\n * <cngx-filter-chips\n * label=\"Tags\"\n * [options]=\"tagOptions\"\n * optionLabel=\"label\"\n * optionValue=\"id\"\n * [filterRef]=\"employees\"\n * filterKey=\"tags\"\n * />\n *\n * <ng-container cngxFilter #employees=\"cngxFilter\">\n * @for (emp of filteredEmployees(); track emp.id) {\n * ...\n * }\n * </ng-container>\n * ```\n *\n * @category common/data/filter\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/filter-chips/filter-chips.component.ts\n * @since 0.1.0\n * @relatedTo CngxFilter, CngxFilterChip, CngxMultiChipGroup\n *\n * <example-url>http://localhost:4200/#/common/data/filter-chips/custom-chip-decoration-via-cngxfilterchip</example-url>\n * <example-url>http://localhost:4200/#/common/data/filter-chips/multi-role-filter-wired-to-a-list</example-url>\n */\n@Component({\n selector: 'cngx-filter-chips',\n exportAs: 'cngxFilterChips',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CngxChip, CngxMultiChipGroup, CngxChipInGroup, NgTemplateOutlet],\n template: `\n <cngx-multi-chip-group\n [label]=\"label()\"\n [(selectedValues)]=\"selectedValues\"\n [state]=\"state()\"\n [keyFn]=\"keyFn()\"\n [(disabled)]=\"disabled\"\n [(required)]=\"required\"\n [(invalid)]=\"invalid\"\n [errorMessageId]=\"errorMessageId()\"\n [orientation]=\"orientation()\"\n >\n @for (option of options(); track keyFn()(optionValue()(option))) {\n <cngx-chip cngxChipInGroup [value]=\"optionValue()(option)\">\n @if (chipTemplate()?.template; as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: chipContext(option)\" />\n } @else {\n {{ optionLabel()(option) }}\n }\n </cngx-chip>\n }\n </cngx-multi-chip-group>\n `,\n})\nexport class CngxFilterChips<TItem = unknown, TValue = unknown> {\n readonly label = input.required<string>();\n readonly options = input.required<readonly TItem[]>();\n readonly optionLabel = input.required<(item: TItem) => string>();\n readonly optionValue = input.required<(item: TItem) => TValue>();\n readonly filterRef = input.required<CngxFilter<TItem>>();\n readonly filterKey = input.required<string>();\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /**\n * Form-state surface forwarded transparently to the inner\n * `<cngx-multi-chip-group>`. Each is a `model<boolean>` matching the\n * inner shape so consumers can two-way bind with their own forms\n * state without reaching past the bridge. Mirrors `CngxCheckboxGroup`\n * / `CngxButtonToggleGroup` precedent.\n */\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n readonly invalid = model<boolean>(false);\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /**\n * Membership key extractor for object-valued chip values. When\n * `TValue` is an object (e.g. `{ id, label }` rather than a\n * primitive id), this fn extracts a stable identity key so chip\n * membership survives re-emissions with fresh references. Forwarded\n * to the inner `<cngx-multi-chip-group>` AND used inside the\n * predicate's `Object.is` comparison. Defaults to identity - works\n * for primitive values.\n */\n readonly keyFn = input<(value: TValue) => unknown>((v) => v);\n\n /**\n * Resolved consumer-supplied chip template. The query uses an\n * instantiation expression (`CngxFilterChip<TItem, TValue>`) so the\n * bridge's class generics propagate into the slot directive type;\n * absent that propagation, `contentChild(CngxFilterChip)` returns\n * `Signal<CngxFilterChip<unknown, unknown> | undefined>` and the\n * `chipContext()` helper would have to widen on every call.\n */\n protected readonly chipTemplate: Signal<CngxFilterChip<TItem, TValue> | undefined> = contentChild(\n CngxFilterChip<TItem, TValue>,\n );\n\n /**\n * Build the slot context for a given chip option. `optionValue` is\n * invoked here per option for the chip rendering pass; the predicate\n * closure invokes it again per LIST item for membership filtering.\n * Both invocations are necessary because option items (the chip\n * pool) and filtered list items (the consumer's filtered data) are\n * separate data paths - they happen to share a shape under the\n * Phase-5 single-shape limitation, but the bridge cannot memoise\n * across the two paths without conflating them. Consumers should\n * keep `optionValue` cheap (typically a property lookup); a future\n * `[itemValue]` input will separate the two extractors.\n */\n protected readonly chipContext = (option: TItem): CngxFilterChipContext<TItem, TValue> => {\n const value = this.optionValue()(option);\n return {\n $implicit: option,\n option,\n value,\n label: this.optionLabel()(option),\n };\n };\n\n /**\n * Internal multi-select state driven by chip toggles. Exposed as\n * a `model` so consumers may seed initial selection via\n * `[(selectedValues)]` if they need to; usually the consumer leaves\n * this internal and reads results via the parent\n * `CngxFilter.predicate`.\n */\n readonly selectedValues = model<TValue[]>([]);\n\n private registered = false;\n\n constructor() {\n const predicateFn = (item: TItem): boolean => {\n const values = this.selectedValues();\n if (values.length === 0) {\n return true;\n }\n const extract = this.keyFn();\n const key = extract(this.optionValue()(item));\n return values.some((v) => Object.is(extract(v), key));\n };\n\n afterNextRender(() => {\n this.filterRef().addPredicate(this.filterKey(), predicateFn);\n this.registered = true;\n });\n\n inject(DestroyRef).onDestroy(() => {\n if (!this.registered) {\n return;\n }\n this.filterRef().removePredicate(this.filterKey());\n });\n }\n}\n","import { computed, Directive, input, output, signal } from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Atom directive that tracks pagination state (current page index and page size).\n *\n * Supports both **uncontrolled** (internal state) and **controlled** modes. \\\n * In controlled mode the `cngxPageIndex` / `cngxPageSize` inputs take precedence\n * over internal state - pair with \\\n * `pageChange` / `pageSizeChange` to keep them\n * in sync.\n *\n * Consumer connects this to a list or table via `range()` - nothing is injected\n * automatically.\n *\n * ```\n * // Headless: read range() from a template ref\n * <div cngxPaginate #pg=\"cngxPaginate\" [total]=\"items.length\">\n * @for (item of items.slice(pg.range()[0], pg.range()[1]); track item.id) { ... }\n * </div>\n *\n * // Drive any UI off the brain - e.g. a Material paginator wired by hand:\n * <mat-paginator\n * [length]=\"pg.total()\" [pageIndex]=\"pg.pageIndex()\" [pageSize]=\"pg.pageSize()\"\n * (page)=\"pg.setPageSize($event.pageSize, false); pg.setPage($event.pageIndex)\" />\n * ```\n * @category common/data/paginate\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/paginate.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSort, CngxFilter, CngxSmartDataSource\n *\n * <example-url>http://localhost:4200/#/common/data/data-source/datasource-cngxpaginate-manual-pipeline</example-url>\n * <example-url>http://localhost:4200/#/common/data/paginate-list/paginated-list-cngxpaginate-cngxmatpaginator</example-url>\n * <example-url>http://localhost:4200/#/common/data/paginate-list/uncontrolled-mode-zero-class-boilerplate</example-url>\n * <example-url>http://localhost:4200/#/common/data/smart-data-source/smartdatasource-cngxpaginate-hostdirective</example-url>\n */\n@Directive({\n selector: '[cngxPaginate]',\n exportAs: 'cngxPaginate',\n standalone: true,\n})\nexport class CngxPaginate {\n /** Controlled page index. When bound, takes precedence over internal state. */\n readonly pageIndexInput = input<number | undefined>(undefined, { alias: 'cngxPageIndex' });\n /** Controlled page size. When bound, takes precedence over internal state. */\n readonly pageSizeInput = input<number | undefined>(undefined, { alias: 'cngxPageSize' });\n /**\n * Total number of items (before pagination). Consumer binds this from the\n * filtered/sorted count so that `totalPages` stays accurate.\n */\n readonly total = input<number>(0);\n\n /**\n * Bind an async state - disables navigation while the data source is busy.\n * When set, `isBusy` derives from `state.isBusy()`. Navigation methods\n * (`setPage`, `next`, `previous`, etc.) are no-ops while busy.\n */\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /** `true` when the bound async state is busy (loading/refreshing). */\n readonly isBusy = computed(() => this.state()?.isBusy() ?? false);\n\n private readonly pageIndexState = signal(0);\n private readonly pageSizeState = signal(10);\n\n /** Current page index (0-based). Controlled input takes precedence. Auto-clamped to totalPages. */\n readonly pageIndex = computed(() => {\n const raw = this.pageIndexInput() ?? this.pageIndexState();\n const max = this.totalPages() - 1;\n return Math.min(raw, max);\n });\n /** Current page size. Controlled input takes precedence. */\n readonly pageSize = computed(() => this.pageSizeInput() ?? this.pageSizeState());\n\n /** Total number of pages (minimum 1). */\n readonly totalPages = computed(() => Math.max(1, Math.ceil(this.total() / this.pageSize())));\n\n /** `true` when on the first page. */\n readonly isFirst = computed(() => this.pageIndex() === 0);\n /** `true` when on the last page. */\n readonly isLast = computed(() => this.pageIndex() >= this.totalPages() - 1);\n\n /**\n * `[start, end]` indices for `Array.slice()` - always in-bounds.\n * Consumer: `items.slice(range()[0], range()[1])`.\n */\n readonly range = computed<[number, number]>(\n () => {\n const start = this.pageIndex() * this.pageSize();\n return [start, start + this.pageSize()];\n },\n { equal: (a, b) => a[0] === b[0] && a[1] === b[1] },\n );\n\n /**\n * `[0, end]` cumulative slice indices for append-don't-replace (load-more)\n * consumers: every page already stepped through, sliced from the top. `end`\n * is `(pageIndex + 1) * pageSize` - the count revealed so far, uncapped (a\n * partial final page is clamped by the consumer against `total`).\n * Pure derivation of `pageIndex` / `pageSize`; the explicit tuple `equal`\n * stops a fresh-array identity from cascading downstream.\n */\n readonly cumulativeRange = computed<[number, number]>(\n () => [0, (this.pageIndex() + 1) * this.pageSize()],\n { equal: (a, b) => a[0] === b[0] && a[1] === b[1] },\n );\n\n /** Emitted when the page index changes. */\n readonly pageChange = output<number>();\n /** Emitted when the page size changes. */\n readonly pageSizeChange = output<number>();\n\n /**\n * Navigate to `index`, clamping to `[0, totalPages - 1]`.\n * Emits `pageChange`.\n */\n setPage(index: number): void {\n if (this.isBusy()) {\n return;\n }\n const clamped = Math.max(0, Math.min(index, this.totalPages() - 1));\n this.pageIndexState.set(clamped);\n this.pageChange.emit(clamped);\n }\n\n /**\n * Change page size and optionally reset to page 0.\n * Emits `pageSizeChange` and, when `resetPage` is `true`, `pageChange`.\n */\n setPageSize(size: number, resetPage = true): void {\n if (this.isBusy()) {\n return;\n }\n this.pageSizeState.set(size);\n this.pageSizeChange.emit(size);\n if (resetPage) {\n this.pageIndexState.set(0);\n this.pageChange.emit(0);\n }\n }\n\n /** Navigate to the next page (no-op on the last page). */\n next(): void {\n this.setPage(this.pageIndex() + 1);\n }\n\n /** Navigate to the previous page (no-op on the first page). */\n previous(): void {\n this.setPage(this.pageIndex() - 1);\n }\n\n /** Navigate to the first page. */\n first(): void {\n this.setPage(0);\n }\n\n /** Navigate to the last page. */\n last(): void {\n this.setPage(this.totalPages() - 1);\n }\n}\n","import { Directive, effect, inject, input, untracked } from '@angular/core';\n\nimport { CngxPaginate } from './paginate.directive';\n\n/**\n * Wires the reset-on-change behaviour onto a {@link CngxPaginate} brain: when\n * `key()` changes (after the initial run) the paginator jumps to the first\n * page. The first run captures the mounting value without resetting, and an\n * already-first paginator emits nothing.\n *\n * Shared by `[cngxPaginateResetOn]`, the `CngxPaginator` shell's `resetOn`\n * input, and the `CngxMatPaginator` bridge's `resetOn` input, so the behaviour\n * is byte-identical across all three. Call inside an injection context\n * (constructor or field initialiser).\n *\n * @category common/data/paginate\n * @since 0.1.0\n */\nexport function connectPaginateResetOn(paginate: CngxPaginate, key: () => unknown): void {\n let seen = false;\n effect(() => {\n key();\n if (!seen) {\n seen = true;\n return;\n }\n untracked(() => {\n if (paginate.pageIndex() !== 0) {\n paginate.setPage(0);\n }\n });\n });\n}\n\n/**\n * Resets a `cngxPaginate` host to the first page whenever the bound key\n * changes - the composable form of {@link connectPaginateResetOn}. \\\n * Drop it on the same element as `cngxPaginate` (or a `CngxPaginator` / `CngxMatPaginator`,\n * which provide the brain), and bind the sort / filter / search value a result\n * set depends on, so a narrowed result never strands the user on a now-empty\n * page.\n *\n * Bind a primitive or a `computed` - an inline array / object literal recomputes\n * every change-detection pass and would reset on each.\n *\n * ```html\n * <table cngxPaginate [cngxPaginateResetOn]=\"filter()\"><!-- ... --></table>\n * ```\n * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>\n *\n * @category common/data/paginate\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/paginate-reset.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPaginate, CngxPaginator, CngxMatPaginator\n */\n@Directive({\n selector: '[cngxPaginateResetOn]',\n exportAs: 'cngxPaginateResetOn',\n standalone: true,\n})\nexport class CngxPaginateResetOn {\n private readonly paginate = inject(CngxPaginate);\n\n /** The reset key. A change (after mount) jumps the paginator to page 0. */\n readonly key = input<unknown>(undefined, { alias: 'cngxPaginateResetOn' });\n\n constructor() {\n connectPaginateResetOn(this.paginate, this.key);\n }\n}\n","import { DestroyRef, effect, inject } from '@angular/core';\n\nimport type { CngxPaginate } from './paginate.directive';\n\n/**\n * Handlers the two-way emit bridge forwards page changes to - typically a\n * host component's `pageIndexChange` / `pageSizeChange` output emitters.\n *\n * @category common/data/paginate\n * @since 0.1.0\n */\nexport interface CngxPaginateEmitHandlers {\n /** Called once per effective page-index change. */\n readonly onIndex: (index: number) => void;\n /** Called once per effective page-size change. */\n readonly onSize: (size: number) => void;\n}\n\n/**\n * Wires the {@link CngxPaginate} brain's page / page-size changes onto a host's\n * two-way outputs with exactly-once emit semantics. Two paths feed each handler,\n * sharing a last-emitted guard:\n * - a subscription forwards the brain's nav-only `pageChange` / `pageSizeChange`\n * - the only signal that captures a controlled-mode `setPage`, because the\n * brain's `pageIndex()` stays pinned to the input until the consumer feeds it\n * back;\n * - an `effect()` reads the effective `pageIndex()` / `pageSize()` and covers a\n * `total`-shrink clamp the nav-only output misses.\n *\n * The shared guard makes a value one path already emitted a no-op on the other,\n * so each change emits exactly once. Seeded with the current effective values,\n * so wiring emits no initial change.\n *\n * Shared verbatim by the `CngxPaginator` shell and the `CngxIncrementalList`\n * organism, so the two-way emit behaviour is byte-identical. Call inside an\n * injection context (constructor or field initialiser) - it reads `DestroyRef`\n * and creates effects.\n *\n * @category common/data/paginate\n * @since 0.1.0\n */\nexport function connectPaginateEmit(\n paginate: CngxPaginate,\n handlers: CngxPaginateEmitHandlers,\n): void {\n const destroyRef = inject(DestroyRef);\n\n // Shared last-emitted guards across the nav (subscription) and clamp (effect)\n // paths. Plain locals, so the effects carry no signal write. Seeded with the\n // current effective values so wiring emits no initial change.\n let lastIndex = paginate.pageIndex();\n let lastSize = paginate.pageSize();\n\n // Nav path. Forwards the brain's nav-only outputs: in controlled mode a\n // setPage leaves the effective pageIndex() pinned to the input, so this event\n // is the only thing that reports the navigation.\n const indexSub = paginate.pageChange.subscribe((index) => {\n if (index !== lastIndex) {\n lastIndex = index;\n handlers.onIndex(index);\n }\n });\n const sizeSub = paginate.pageSizeChange.subscribe((size) => {\n if (size !== lastSize) {\n lastSize = size;\n handlers.onSize(size);\n }\n });\n destroyRef.onDestroy(() => {\n indexSub.unsubscribe();\n sizeSub.unsubscribe();\n });\n\n // Clamp path. The effective pageIndex moved without a nav (a total-shrink\n // clamp the nav-only pageChange misses). The shared guard means a value the\n // nav path already emitted is a no-op here, so each change emits once.\n effect(() => {\n const index = paginate.pageIndex();\n if (index !== lastIndex) {\n lastIndex = index;\n handlers.onIndex(index);\n }\n });\n effect(() => {\n const size = paginate.pageSize();\n if (size !== lastSize) {\n lastSize = size;\n handlers.onSize(size);\n }\n });\n}\n","import {\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n type OnInit,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\n\nimport { CngxPaginate } from './paginate.directive';\n\n/**\n * Persists a `cngxPaginate` host's page / size in the URL query string, so a\n * paginated view is deep-linkable and survives reload / back / forward.\n *\n * Drop it on the same element as `cngxPaginate` (or a `CngxPaginator` /\n * `CngxMatPaginator`, which provide the brain). The page is written 1-based\n * (`?page=2`) for human-readable URLs; the brain stays 0-based.\n *\n * ```html\n * <cngx-paginator cngxPaginateRouting [total]=\"items().length\"></cngx-paginator>\n * ```\n *\n * Two paginators on one route must take distinct param names via\n * `[cngxPaginatePageParam]` / `[cngxPaginateSizeParam]` to avoid a collision. \\\n * Requires `@angular/router` (`provideRouter`); without it the directive is an\n * inert no-op (a dev-mode warning is logged). Framework-agnostic of any UI - it\n * needs only the brain and the router.\n *\n * @category common/data/paginate\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/paginate-routing.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPaginate, CngxPaginator, CngxMatPaginator\n * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>\n */\n@Directive({\n selector: '[cngxPaginateRouting]',\n exportAs: 'cngxPaginateRouting',\n standalone: true,\n})\nexport class CngxPaginateRouting implements OnInit {\n private readonly paginate = inject(CngxPaginate);\n private readonly router = inject(Router, { optional: true });\n private readonly route = inject(ActivatedRoute, { optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n /** Query-param name for the 1-based page. */\n readonly pageParam = input('page', { alias: 'cngxPaginatePageParam' });\n /** Query-param name for the page size. */\n readonly sizeParam = input('pageSize', { alias: 'cngxPaginateSizeParam' });\n\n // Set while applying a URL change to the brain, so the brain -> URL effect\n // does not bounce the same value straight back as a redundant navigation.\n private applyingFromUrl = false;\n\n constructor() {\n const router = this.router;\n const route = this.route;\n if (!router || !route) {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n console.warn(\n '[cngxPaginateRouting]: no Router available - directive is a no-op. ' +\n 'Provide @angular/router via provideRouter(...) to enable URL-synced pagination.',\n );\n }\n return;\n }\n\n // brain -> URL. Tracks the effective page / size; merges into the existing\n // query string and replaces history so paging does not stack back entries.\n // The param-name inputs are read lazily inside untracked, so a late-bound\n // alias is already set by the time the first navigation fires.\n effect(() => {\n const page = this.paginate.pageIndex() + 1;\n const size = this.paginate.pageSize();\n if (this.applyingFromUrl) {\n return;\n }\n untracked(() => {\n void router.navigate([], {\n relativeTo: route,\n queryParams: { [this.pageParam()]: page, [this.sizeParam()]: size },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n });\n });\n });\n }\n\n ngOnInit(): void {\n const route = this.route;\n if (!route) {\n return;\n }\n // URL -> brain, wired in ngOnInit so the param-name inputs are resolved\n // before queryParamMap replays the current params on subscribe (a\n // deep-linked page / size therefore lands before first paint). The\n // subscription stays live for back / forward navigation.\n route.queryParamMap.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((params) => {\n const size = Number(params.get(this.sizeParam()));\n const page = Number(params.get(this.pageParam()));\n this.applyingFromUrl = true;\n try {\n if (Number.isFinite(size) && size > 0 && size !== this.paginate.pageSize()) {\n this.paginate.setPageSize(size, false);\n }\n const index = (Number.isFinite(page) && page > 0 ? page : 1) - 1;\n if (index !== this.paginate.pageIndex()) {\n this.paginate.setPage(index);\n }\n } finally {\n this.applyingFromUrl = false;\n }\n });\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * A single bucket as the chips segment reads it - the label only. The match\n * predicate that decides membership stays internal to `CngxBucketPaginate`; a\n * presentation segment never needs it, only the label to render and the\n * derived empty/active state to reflect.\n *\n * @category common/data/paginate\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/bucket-paginate-host.token.ts\n * @since 0.1.0\n */\nexport interface CngxBucketPaginateView {\n /** Human-readable bucket label, e.g. `'A-C'`. Rendered as the chip text. */\n readonly label: string;\n}\n\n/**\n * Read-and-write contract a category/range chip strip (`cngx-pgn-alpha`)\n * injects instead of the concrete `CngxBucketPaginate` directive. \\\n * The directive provides it via `useExisting`, so a chip strip stays\n * decompose-ready - it talks to the token, never to the model class (DI\n * abstraction).\n *\n * The signals are the single derivation source for every chip's pressed and\n * disabled state; `select` / `clear` are the only write paths, each routing\n * through the directive's `active` model so the toggle invariant (re-selecting\n * the active bucket clears it) holds in one place.\n *\n * @category common/data/paginate\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/bucket-paginate-host.token.ts\n * @since 0.1.0\n */\nexport interface CngxBucketPaginateHost {\n /** The buckets to render, in declaration order. One chip per entry. */\n readonly buckets: Signal<readonly CngxBucketPaginateView[]>;\n /** Label of the active bucket, or `null` when no bucket is selected. */\n readonly active: Signal<string | null>;\n /**\n * `true` when no bound item matches the bucket's predicate. Derived from the\n * `items` / `buckets` inputs (never a synced flag); a chip binds its disabled\n * state to this so an empty bucket is a dead control with a stated reason.\n */\n isEmpty(label: string): boolean;\n /**\n * Select the bucket. Re-selecting the already-active bucket clears the\n * selection (toggle). No-op for an empty bucket.\n */\n select(label: string): void;\n /** Clear the active bucket (show the unfiltered collection). */\n clear(): void;\n}\n\n/**\n * DI token the `CngxBucketPaginate` range model provides via `useExisting`.\n * The category chips segment (`cngx-pgn-alpha`) injects this rather than the\n * concrete directive class, keeping the strip decompose-ready and the model\n * swappable.\n *\n * @category common/data/paginate\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/bucket-paginate-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_BUCKET_PAGINATE_HOST = new InjectionToken<CngxBucketPaginateHost>(\n 'CngxBucketPaginateHost',\n);\n","import { computed, Directive, input, model } from '@angular/core';\n\nimport {\n CNGX_BUCKET_PAGINATE_HOST,\n type CngxBucketPaginateHost,\n} from './bucket-paginate-host.token';\n\n/**\n * A category bucket: a label plus a predicate that decides which items fall\n * into it. The predicate keeps the model content-agnostic - the same directive\n * buckets by letter range, date band, price tier, or any other partition the\n * consumer expresses, without the brain knowing what it is bucketing.\n *\n * @category common/data/paginate\n */\nexport interface CngxBucket<T> {\n /** Human-readable bucket label, e.g. `'A-C'`. Rendered as the chip text. */\n readonly label: string;\n /** Returns `true` when `item` belongs to this bucket. */\n readonly match: (item: T) => boolean;\n}\n\n/** Two `ReadonlySet`s are equal when they hold the same members. */\nfunction setEquals(a: ReadonlySet<string>, b: ReadonlySet<string>): boolean {\n if (a.size !== b.size) {\n return false;\n }\n for (const value of a) {\n if (!b.has(value)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Range/category pagination model - a sibling to {@link CngxPaginate}, NOT a\n * mode flag on it. Where `CngxPaginate` steps a page index over a slice window,\n * this directive partitions a collection into labelled buckets (letter ranges,\n * date bands, price tiers) and tracks which one is active. The page-index brain\n * stays single-responsibility; a consumer composes whichever model the data\n * calls for (Komposition statt Konfiguration).\n *\n * The empty/disabled state of every bucket is **derived**, never managed: a\n * bucket is empty when no bound item matches its predicate, computed from the\n * `items` / `buckets` inputs. There is no synced flag and no effect.\n *\n * `active` is the two-way primary value (a `model<string | null>()`):\n * `null` shows the unfiltered collection; a label filters to that bucket.\n * `select(label)` toggles - re-selecting the active bucket clears it.\n *\n * ```html\n * <div\n * cngxBucketPaginate\n * #bp=\"cngxBucketPaginate\"\n * [buckets]=\"letterBuckets\"\n * [items]=\"people\"\n * [(active)]=\"activeBucket\"\n * >\n * @for (p of bp.active() ? people.filter(byActiveBucket) : people; track p.id) { ... }\n * </div>\n * ```\n *\n * @category common/data/paginate\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/bucket-paginate.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPaginate, CngxFilter\n * <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/alphabetical</example-url>\n */\n@Directive({\n selector: '[cngxBucketPaginate]',\n exportAs: 'cngxBucketPaginate',\n standalone: true,\n providers: [{ provide: CNGX_BUCKET_PAGINATE_HOST, useExisting: CngxBucketPaginate }],\n})\nexport class CngxBucketPaginate<T = unknown> implements CngxBucketPaginateHost {\n /** The buckets to partition into, in render order. One chip per entry. */\n readonly buckets = input<readonly CngxBucket<T>[]>([]);\n /** The collection the buckets test against. Drives the derived empty state. */\n readonly items = input<readonly T[]>([]);\n\n /**\n * Active bucket label, or `null` for the unfiltered collection. The two-way\n * primary value (`[(active)]`); a `model()` because it is the directive's\n * bindable state, not a derived read.\n */\n readonly active = model<string | null>(null);\n\n /**\n * Labels of every bucket whose predicate matches no bound item. A pure\n * `computed()` over `items` / `buckets` - the disabled chips read this, so\n * the empty state is derived, never synced. The explicit set `equal` stops a\n * fresh-`Set` identity from cascading downstream on every unrelated recompute.\n */\n private readonly emptyLabels = computed<ReadonlySet<string>>(\n () => {\n const items = this.items();\n const empties = new Set<string>();\n for (const bucket of this.buckets()) {\n if (!items.some((item) => bucket.match(item))) {\n empties.add(bucket.label);\n }\n }\n return empties;\n },\n { equal: setEquals },\n );\n\n /** `true` when no bound item falls into the bucket. */\n isEmpty(label: string): boolean {\n return this.emptyLabels().has(label);\n }\n\n /**\n * Select the bucket, or clear the selection when it is already active\n * (toggle). An empty bucket is a no-op - it never becomes the active filter.\n */\n select(label: string): void {\n if (this.isEmpty(label)) {\n return;\n }\n this.active.update((current) => (current === label ? null : label));\n }\n\n /** Clear the active bucket - show the unfiltered collection. */\n clear(): void {\n this.active.set(null);\n }\n}\n","import { DataSource } from '@angular/cdk/collections';\nimport { inject, Injector, type Signal } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport type { Observable } from 'rxjs';\n\n/**\n * Minimal CDK `DataSource` that bridges a Signal to the CDK table's\n * Observable-based data contract.\n *\n * No sort, filter, or search logic is included - the consumer builds a\n * `computed()` with any transformations and passes the result here.\n *\n * ```typescript\n * readonly processed = computed(() => {\n * let items = this.raw();\n * if (this.sort().sort()) { items = sortTree(items, ...); }\n * return items;\n * });\n * readonly dataSource = injectDataSource(this.processed);\n * ```\n *\n * @typeParam T - The row item type.\n *\n * @category common/data/data-source\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/data-source/data-source.ts\n * @since 0.1.0\n * @relatedTo CngxSmartDataSource, CngxSort, CngxFilter, CngxPaginate\n */\nexport class CngxDataSource<T> extends DataSource<T> {\n private readonly injector = inject(Injector);\n\n constructor(private readonly data: Signal<T[]>) {\n super();\n }\n\n override connect(): Observable<T[]> {\n return toObservable(this.data, { injector: this.injector });\n }\n\n override disconnect(): void {\n // Signal cleanup is handled by Angular's DestroyRef - no manual teardown needed.\n }\n}\n\n/**\n * Factory function for {@link CngxDataSource}.\n *\n * Must be called within an injection context (constructor or field initializer).\n *\n * ```typescript\n * readonly dataSource = injectDataSource(this.items);\n * ```\n *\n * @category common/data/data-source\n */\nexport function injectDataSource<T>(data: Signal<T[]>): CngxDataSource<T> {\n return new CngxDataSource(data);\n}\n","import { DataSource } from '@angular/cdk/collections';\nimport { computed, inject, Injector, type Signal } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { arrayEqual } from '@cngx/utils';\nimport type { Observable } from 'rxjs';\nimport { CngxPaginate } from '../paginate/paginate.directive';\nimport { CngxFilter } from '../filter/filter.directive';\nimport { CngxSort } from '../sort/sort.directive';\nimport { CngxSearch } from '@cngx/common/interactive';\n\nfunction defaultSearchFn<T>(item: T, term: string): boolean {\n const lower = term.toLowerCase();\n return Object.values(item as Record<string, unknown>).some((v) =>\n v === null || v === undefined || typeof v === 'object'\n ? false\n : String(v as string | number | boolean | bigint)\n .toLowerCase()\n .includes(lower),\n );\n}\n\nfunction defaultSortFn<T>(a: T, b: T, field: string, dir: 'asc' | 'desc'): number {\n const toStr = (v: unknown): string =>\n v === null || v === undefined || typeof v === 'object'\n ? ''\n : String(v as string | number | boolean | bigint);\n const av = toStr((a as Record<string, unknown>)[field]);\n const bv = toStr((b as Record<string, unknown>)[field]);\n const cmp = av.localeCompare(bv, undefined, { numeric: true, sensitivity: 'base' });\n return dir === 'asc' ? cmp : -cmp;\n}\n\n/**\n * Optional customization for {@link CngxSmartDataSource}.\n *\n * @category common/data/data-source\n */\nexport interface CngxSmartDataSourceOptions<T> {\n /**\n * Custom full-text search function. Receives an item and the current search\n * term; return `true` to keep the item. Defaults to a case-insensitive match\n * across all primitive-valued properties.\n */\n searchFn?: (item: T, term: string) => boolean;\n /**\n * Custom sort comparator. Receives two items, the active field key, and\n * direction. Defaults to a locale-aware string comparison.\n */\n sortFn?: (a: T, b: T, field: string, direction: 'asc' | 'desc') => number;\n}\n\nfunction isAsyncState<T>(source: Signal<T[]> | CngxAsyncState<T[]>): source is CngxAsyncState<T[]> {\n return 'status' in source && 'data' in source && 'isFirstLoad' in source;\n}\n\n/**\n * A CDK `DataSource` that optionally integrates with `CngxSort`,\n * `CngxFilter`, `CngxSearch`, and `CngxPaginate` present in the injection\n * tree. Each directive is injected optionally - if absent, that processing\n * step is skipped.\n *\n * Accepts either a plain `Signal<T[]>` or a `CngxAsyncState<T[]>`.\n * When a `CngxAsyncState` is provided, the data source exposes the full\n * UX state (`isLoading`, `isRefreshing`, `error`, `isEmpty`) so the\n * table can show skeleton rows, error states, and loading indicators.\n *\n * ```typescript\n * // Plain signal\n * readonly dataSource = injectSmartDataSource(this.items);\n *\n * // With async state - full UX lifecycle\n * readonly residents = injectAsyncState(() => this.api.getAll(this.filter()));\n * readonly dataSource = injectSmartDataSource(this.residents);\n * // dataSource.isLoading(), dataSource.error(), dataSource.isRefreshing()\n * ```\n *\n * @typeParam T - The row item type.\n *\n * @category common/data/data-source\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/data-source/smart-data-source.ts\n * @since 0.1.0\n * @relatedTo CngxDataSource, CngxSort, CngxFilter, CngxPaginate\n */\nexport class CngxSmartDataSource<T> extends DataSource<T> {\n private readonly injector = inject(Injector);\n private readonly sort = inject(CngxSort, { optional: true });\n private readonly filter = inject(CngxFilter, { optional: true });\n // CngxSearch typically lives on a child <input> below the component injector,\n // so this inject returns null in the common case. It resolves only when CngxSearch\n // is placed as a hostDirective on the same component. For child-input search,\n // use injectDataSource() + manual computed() instead.\n private readonly search = inject(CngxSearch, { optional: true });\n private readonly paginate = inject(CngxPaginate, { optional: true });\n\n /**\n * Items after filter and search are applied, before sort and pagination.\n * Use `filteredCount()` to get the pre-pagination count for paginator `total`.\n */\n private readonly filtered: Signal<T[]>;\n\n /** Number of items after filtering/searching, before pagination. */\n readonly filteredCount: Signal<number>;\n\n private readonly processed: Signal<T[]>;\n\n /**\n * The async state source, or `undefined` if constructed from a plain\n * signal. Internal-only - consumers read the derived projections\n * (`isLoading`, `isRefreshing`, `isBusy`, `isFirstLoad`, `error`,\n * `isEmpty`, `filteredCount`) instead of the raw source identity.\n */\n private readonly asyncState: CngxAsyncState<T[]> | undefined;\n\n /** `true` during initial data load (skeleton phase). */\n readonly isLoading: Signal<boolean>;\n\n /** `true` during refresh (data stays visible, loading bar). */\n readonly isRefreshing: Signal<boolean>;\n\n /** `true` when any operation is running. Maps to `aria-busy`. */\n readonly isBusy: Signal<boolean>;\n\n /** `true` if no successful load has completed yet. */\n readonly isFirstLoad: Signal<boolean>;\n\n /** Error from the async state, or `undefined`. */\n readonly error: Signal<unknown>;\n\n /** `true` when data is empty AND no operation is running. */\n readonly isEmpty: Signal<boolean>;\n\n constructor(\n source: Signal<T[]> | CngxAsyncState<T[]>,\n private readonly options?: CngxSmartDataSourceOptions<T>,\n ) {\n super();\n\n let data: Signal<T[]>;\n if (isAsyncState(source)) {\n this.asyncState = source;\n data = computed(() => source.data() ?? []);\n } else {\n this.asyncState = undefined;\n data = source;\n }\n\n const s = this.asyncState;\n this.isLoading = computed(() => s?.isLoading() ?? false);\n this.isRefreshing = computed(() => s?.isRefreshing() ?? false);\n this.isBusy = computed(() => s?.isBusy() ?? false);\n this.isFirstLoad = computed(() => s?.isFirstLoad() ?? false);\n this.error = computed(() => s?.error());\n\n this.filtered = computed(\n () => {\n const predicate = this.filter?.predicate();\n const term = this.search?.term();\n const searchFn = this.options?.searchFn ?? defaultSearchFn<T>;\n\n // Pipeline: raw → filter → search. Cast required: CngxFilter injected as unknown.\n return data()\n .filter((v) => !predicate || (predicate as (v: T) => boolean)(v))\n .filter((item) => !term || searchFn(item, term));\n },\n { equal: arrayEqual },\n );\n\n this.filteredCount = computed(() => this.filtered().length);\n\n this.isEmpty = computed(() => {\n // During loading, not \"empty\" yet - show skeleton instead\n if (this.isBusy()) {\n return false;\n }\n return this.filteredCount() === 0;\n });\n\n this.processed = computed(\n () => {\n const sorts = this.sort?.sorts() ?? [];\n const sortFn = this.options?.sortFn ?? defaultSortFn<T>;\n\n const sorted =\n sorts.length > 0\n ? [...this.filtered()].sort((a, b) =>\n sorts.reduce(\n (cmp, { active, direction }) => cmp || sortFn(a, b, active, direction),\n 0,\n ),\n )\n : this.filtered();\n\n const range = this.paginate?.range();\n return range ? sorted.slice(range[0], range[1]) : sorted;\n },\n { equal: arrayEqual },\n );\n }\n\n override connect(): Observable<T[]> {\n return toObservable(this.processed, { injector: this.injector });\n }\n\n override disconnect(): void {\n // Signal cleanup is handled by Angular's DestroyRef - no manual teardown needed.\n }\n}\n\n/**\n * Factory function for {@link CngxSmartDataSource}.\n *\n * Must be called within an injection context (constructor or field initializer).\n * Accepts either a plain `Signal<T[]>` or a `CngxAsyncState<T[]>` for\n * full UX state integration (loading, error, refresh, empty).\n *\n * ```typescript\n * // Plain signal\n * readonly dataSource = injectSmartDataSource(this.items);\n *\n * // With async state - table shows skeleton, error, loading bar\n * readonly residents = injectAsyncState(() => this.api.getAll());\n * readonly dataSource = injectSmartDataSource(this.residents);\n * ```\n *\n * @category common/data/data-source\n */\nexport function injectSmartDataSource<T>(\n source: Signal<T[]> | CngxAsyncState<T[]>,\n options?: CngxSmartDataSourceOptions<T>,\n): CngxSmartDataSource<T> {\n return new CngxSmartDataSource(source, options);\n}\n","import { computed, signal } from '@angular/core';\nimport { buildAsyncStateView, type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Writable extension of `CngxAsyncState` for manual control.\n *\n * Returned by `createManualState()` — provides imperative setters\n * while the read-side stays the standard `CngxAsyncState` interface.\n *\n * @category common/data/async-state\n */\nexport interface ManualAsyncState<T> extends CngxAsyncState<T> {\n /** Set the status directly. */\n set(status: AsyncStatus): void;\n\n /** Transition to `success` with data. */\n setSuccess(data: T): void;\n\n /** Transition to `error`. */\n setError(error: unknown): void;\n\n /** Set progress (0–100). */\n setProgress(value: number | undefined): void;\n\n /** Reset to `idle`, clear data, error, and progress. */\n reset(): void;\n}\n\n/**\n * Create a fully manual async state — no HTTP, no automatic loading.\n *\n * Use for local operations: heavy computations, Web Workers, complex local processes.\n * Does **not** require an injection context — uses only `signal()` and `computed()`.\n *\n * ```typescript\n * readonly processState = createManualState<ProcessResult>();\n *\n * async handleProcess(): Promise<void> {\n * this.processState.set('loading');\n * this.processState.setProgress(0);\n * const result = await heavyComputation((p) => this.processState.setProgress(p));\n * this.processState.setSuccess(result);\n * }\n * ```\n *\n * @category common/data/async-state\n */\nexport function createManualState<T>(): ManualAsyncState<T> {\n const statusState = signal<AsyncStatus>('idle');\n const dataState = signal<T | undefined>(undefined);\n const errorState = signal<unknown>(undefined);\n const progressState = signal<number | undefined>(undefined);\n const lastUpdatedState = signal<Date | undefined>(undefined);\n const hadSuccess = signal(false);\n\n const view = buildAsyncStateView<T>({\n status: statusState.asReadonly(),\n data: dataState.asReadonly(),\n error: errorState.asReadonly(),\n progress: progressState.asReadonly(),\n isFirstLoad: computed(() => !hadSuccess()),\n lastUpdated: lastUpdatedState.asReadonly(),\n });\n\n return {\n ...view,\n\n set(newStatus: AsyncStatus): void {\n statusState.set(newStatus);\n if (newStatus === 'success') {\n hadSuccess.set(true);\n lastUpdatedState.set(new Date());\n }\n },\n\n setSuccess(value: T): void {\n dataState.set(value);\n errorState.set(undefined);\n progressState.set(undefined);\n hadSuccess.set(true);\n lastUpdatedState.set(new Date());\n statusState.set('success');\n },\n\n setError(err: unknown): void {\n errorState.set(err);\n progressState.set(undefined);\n statusState.set('error');\n },\n\n setProgress(value: number | undefined): void {\n progressState.set(value);\n },\n\n reset(): void {\n statusState.set('idle');\n dataState.set(undefined);\n errorState.set(undefined);\n progressState.set(undefined);\n lastUpdatedState.set(undefined);\n hadSuccess.set(false);\n },\n };\n}\n","import { DestroyRef, inject } from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { firstValueFrom, isObservable, type Observable } from 'rxjs';\n\nimport { createManualState, type ManualAsyncState } from './create-manual-state';\n\n/**\n * Writable async state for mutations (POST/PUT/DELETE).\n *\n * Extends the read-only `CngxAsyncState` with an `execute()` method\n * that runs an async action and manages the full lifecycle.\n *\n * @category common/data/async-state\n */\nexport interface MutableAsyncState<T> extends CngxAsyncState<T> {\n /**\n * Execute an async action.\n *\n * Sets status to `pending`, then `success` or `error` on completion.\n * Supersedes any in-flight execution — the previous result is discarded\n * but the underlying network request is not aborted.\n */\n execute(fn: () => Promise<T> | Observable<T>): Promise<void>;\n\n /** Report progress (0–100) during execution. */\n reportProgress(value: number): void;\n\n /** Reset to `idle`, clear data, error, and progress. */\n reset(): void;\n}\n\n/**\n * Create a mutation async state — for explicit user-triggered actions.\n *\n * Must be called in an injection context (field initializer or constructor)\n * because it uses `inject(DestroyRef)` for cleanup.\n *\n * ```typescript\n * readonly saveResident = createAsyncState<Resident>();\n *\n * async handleSave(): Promise<void> {\n * await this.saveResident.execute(\n * () => this.api.save(this.form().value())\n * );\n * }\n * ```\n *\n * @category common/data/async-state\n */\nexport function createAsyncState<T>(): MutableAsyncState<T> {\n const destroyRef = inject(DestroyRef);\n const state: ManualAsyncState<T> = createManualState<T>();\n\n let abortController: AbortController | undefined;\n\n destroyRef.onDestroy(() => {\n abortController?.abort();\n abortController = undefined;\n });\n\n return {\n status: state.status,\n data: state.data,\n error: state.error,\n progress: state.progress,\n isLoading: state.isLoading,\n isPending: state.isPending,\n isRefreshing: state.isRefreshing,\n isBusy: state.isBusy,\n isFirstLoad: state.isFirstLoad,\n isEmpty: state.isEmpty,\n hasData: state.hasData,\n isSettled: state.isSettled,\n lastUpdated: state.lastUpdated,\n\n async execute(fn: () => Promise<T> | Observable<T>): Promise<void> {\n abortController?.abort();\n const controller = new AbortController();\n abortController = controller;\n\n state.set('pending');\n state.setProgress(undefined);\n\n try {\n const result$ = fn();\n const result = isObservable(result$) ? await firstValueFrom(result$) : await result$;\n\n if (controller.signal.aborted) {\n return;\n }\n\n state.setSuccess(result);\n } catch (err: unknown) {\n if (controller.signal.aborted) {\n return;\n }\n state.setError(err);\n } finally {\n if (abortController === controller) {\n abortController = undefined;\n }\n }\n },\n\n reportProgress(value: number): void {\n state.setProgress(value);\n },\n\n reset(): void {\n abortController?.abort();\n abortController = undefined;\n state.reset();\n },\n };\n}\n","import { DestroyRef, effect, inject, untracked } from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { isObservable, type Observable, type Subscription } from 'rxjs';\n\nimport { createManualState, type ManualAsyncState } from './create-manual-state';\n\n/**\n * Configuration options for `injectAsyncState`.\n *\n * @category common/data/async-state\n */\nexport interface InjectAsyncStateOptions {\n /**\n * Debounce time in ms for signal dependency changes.\n * Prevents request storms when multiple signals change rapidly.\n * @default 50\n */\n debounce?: number;\n}\n\n/**\n * Reactive async state returned by `injectAsyncState`.\n *\n * Extends the read-only `CngxAsyncState` with a `refresh()` method\n * to explicitly re-trigger the query.\n *\n * @category common/data/async-state\n */\nexport interface ReactiveAsyncState<T> extends CngxAsyncState<T> {\n /** Explicitly re-trigger the query. */\n refresh(): void;\n}\n\n/**\n * Create a reactive async state that auto-loads when signal dependencies change.\n *\n * Must be called in an injection context (field initializer or constructor).\n * The computation function is tracked by Angular's `effect()` — any signal\n * read inside `fn` will cause a re-load when it changes.\n *\n * ```typescript\n * readonly residents = injectAsyncState(\n * () => this.api.getResidents(this.filter())\n * );\n * // Loads automatically when filter() changes.\n * // Caches last result during refresh (refreshing state).\n * // Deduplicates parallel requests.\n * ```\n *\n * @category common/data/async-state\n */\nexport function injectAsyncState<T>(\n fn: () => Promise<T> | Observable<T>,\n options?: InjectAsyncStateOptions,\n): ReactiveAsyncState<T> {\n const destroyRef = inject(DestroyRef);\n const state: ManualAsyncState<T> = createManualState<T>();\n const debounceMs = options?.debounce ?? 50;\n\n let activeSubscription: Subscription | undefined;\n let abortController: AbortController | undefined;\n let debounceTimer: ReturnType<typeof setTimeout> | undefined;\n\n function cancelInFlight(): void {\n activeSubscription?.unsubscribe();\n activeSubscription = undefined;\n abortController?.abort();\n abortController = undefined;\n }\n\n destroyRef.onDestroy(() => {\n cancelInFlight();\n if (debounceTimer !== undefined) {\n clearTimeout(debounceTimer);\n debounceTimer = undefined;\n }\n });\n\n function executeQuery(computation: () => Promise<T> | Observable<T>): void {\n cancelInFlight();\n\n // first load -> loading, subsequent -> refreshing\n const status = untracked(state.isFirstLoad) ? 'loading' : 'refreshing';\n state.set(status);\n\n const result$ = computation();\n\n if (isObservable(result$)) {\n let hasEmitted = false;\n activeSubscription = result$.subscribe({\n next: (value) => {\n hasEmitted = true;\n state.setSuccess(value);\n },\n error: (err: unknown) => state.setError(err),\n complete: () => {\n if (!hasEmitted) {\n // completed without emitting -> empty success\n state.setSuccess(undefined as T);\n }\n },\n });\n } else {\n const controller = new AbortController();\n abortController = controller;\n\n result$\n .then(\n (value) => {\n if (!controller.signal.aborted) {\n state.setSuccess(value);\n }\n },\n (err: unknown) => {\n if (!controller.signal.aborted) {\n state.setError(err);\n }\n },\n )\n .finally(() => {\n if (abortController === controller) {\n abortController = undefined;\n }\n });\n }\n }\n\n // fn() runs once per cycle; signals read inside it track via effect.\n // Result is captured and run after debounce.\n effect(() => {\n let result: Promise<T> | Observable<T>;\n try {\n result = fn();\n } catch (err: unknown) {\n // sync throw (e.g. required signal not yet set) — debounce the error\n // to match the async path\n if (debounceTimer !== undefined) {\n clearTimeout(debounceTimer);\n }\n debounceTimer = setTimeout(() => {\n debounceTimer = undefined;\n state.setError(err);\n }, debounceMs);\n return;\n }\n\n if (debounceTimer !== undefined) {\n clearTimeout(debounceTimer);\n }\n\n const captured = result;\n debounceTimer = setTimeout(() => {\n debounceTimer = undefined;\n void executeQuery(() => captured);\n }, debounceMs);\n });\n\n return {\n status: state.status,\n data: state.data,\n error: state.error,\n progress: state.progress,\n isLoading: state.isLoading,\n isPending: state.isPending,\n isRefreshing: state.isRefreshing,\n isBusy: state.isBusy,\n isFirstLoad: state.isFirstLoad,\n isEmpty: state.isEmpty,\n hasData: state.hasData,\n isSettled: state.isSettled,\n lastUpdated: state.lastUpdated,\n\n refresh(): void {\n if (debounceTimer !== undefined) {\n clearTimeout(debounceTimer);\n debounceTimer = undefined;\n }\n void executeQuery(fn);\n },\n };\n}\n","import type { AsyncStatus } from '@cngx/core/utils';\n\n/**\n * Possible view states for async content rendering.\n *\n * @category common/data/async-state\n */\nexport type AsyncView = 'none' | 'skeleton' | 'content' | 'empty' | 'error' | 'content+error';\n\n/**\n * Pure function that resolves which view to show based on async state.\n *\n * Encodes the state machine as a lookup table — no branching:\n *\n * | status | firstLoad | empty | view |\n * |-------------|-----------|-------|---------------|\n * | idle | true | * | none |\n * | loading | true | * | skeleton |\n * | refreshing | true | * | skeleton |\n * | pending | true | * | skeleton |\n * | error | true | * | error |\n * | success | * | true | empty |\n * | error | false | * | content+error |\n * | (all other) | * | * | content |\n *\n * @category common/data/async-state\n */\nexport function resolveAsyncView(\n status: AsyncStatus,\n firstLoad: boolean,\n empty: boolean,\n): AsyncView {\n if (firstLoad) {\n switch (status) {\n case 'idle':\n return 'none';\n case 'loading':\n case 'refreshing':\n case 'pending':\n return 'skeleton';\n case 'error':\n return 'error';\n }\n }\n\n if (status === 'success' && empty) {\n return 'empty';\n }\n\n if (status === 'error') {\n return 'content+error';\n }\n\n return 'content';\n}\n","import { computed, effect, type Resource, signal } from '@angular/core';\nimport type { AsyncStatus, CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Bridge that projects an Angular `Resource<T>` onto `CngxAsyncState<T>`.\n *\n * Must be called in an injection context (the `effect()` that tracks\n * `hadSuccess` requires one).\n *\n * All signals are derived reactively from the resource — no manual\n * synchronization. The resource stays the single source of truth.\n *\n * ```typescript\n * private readonly res = resource({\n * request: () => ({ filter: this.filter() }),\n * loader: ({ request, abortSignal }) =>\n * fetch(`/api/items?q=${request.filter}`, { signal: abortSignal })\n * .then(r => r.json()),\n * });\n *\n * readonly items = fromResource(this.res);\n * // items.status(), items.data(), items.isFirstLoad() — all work\n * // <cngx-async-container [state]=\"items\"> — direct binding\n * ```\n *\n * @category common/data/async-state\n */\nexport function fromResource<T>(ref: Resource<T>): CngxAsyncState<T> {\n // Track whether a successful load has ever occurred.\n // Needed because ResourceStatus has no \"first load\" concept.\n const hadSuccess = signal(false);\n\n effect(() => {\n const s = ref.status();\n if (s === 'resolved' || s === 'local') {\n hadSuccess.set(true);\n }\n });\n\n const status = computed((): AsyncStatus => {\n switch (ref.status()) {\n case 'idle':\n return 'idle';\n case 'loading':\n return 'loading';\n case 'reloading':\n return 'refreshing';\n case 'resolved':\n case 'local':\n return 'success';\n case 'error':\n return 'error';\n }\n });\n\n const data = computed(() => (ref.hasValue() ? ref.value() : undefined));\n const error = computed(() => ref.error());\n\n const isLoading = computed(() => status() === 'loading');\n const isPending = computed(() => false); // resource() has no mutation concept\n const isRefreshing = computed(() => status() === 'refreshing');\n const isBusy = computed(() => ref.isLoading());\n const isFirstLoad = computed(() => !hadSuccess() && (isBusy() || status() === 'idle'));\n const isEmpty = computed(() => {\n const d = data();\n return d == null || (Array.isArray(d) && d.length === 0);\n });\n const hasData = computed(() => ref.hasValue() && !isEmpty());\n const isSettled = computed(() => {\n const s = status();\n return s === 'success' || s === 'error';\n });\n const lastUpdated = signal<Date | undefined>(undefined);\n\n effect(() => {\n const s = ref.status();\n if (s === 'resolved' || s === 'local') {\n lastUpdated.set(new Date());\n }\n });\n\n return {\n status,\n data,\n error,\n progress: signal(undefined).asReadonly(),\n isLoading,\n isPending,\n isRefreshing,\n isBusy,\n isFirstLoad,\n isEmpty,\n hasData,\n isSettled,\n lastUpdated: lastUpdated.asReadonly(),\n };\n}\n","import { computed, effect, type Resource, signal } from '@angular/core';\nimport type { AsyncStatus, CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Shape of an `HttpResourceRef` — only the signals we need.\n *\n * Declared here to avoid a hard dependency on `@angular/common/http`.\n * The consumer passes the actual `httpResource()` return value which\n * satisfies this interface at runtime.\n */\ninterface HttpResourceLike<T> extends Resource<T> {\n progress: () => number | undefined;\n}\n\n/**\n * Bridge that projects an Angular `httpResource()` ref onto `CngxAsyncState<T>`.\n *\n * Identical to `fromResource` but additionally maps the HTTP progress\n * signal to `CngxAsyncState.progress` (0–100 scale).\n *\n * Must be called in an injection context.\n *\n * ```typescript\n * private readonly res = httpResource<Item[]>(() => ({\n * url: '/api/items',\n * params: { q: this.filter() },\n * }));\n *\n * readonly items = fromHttpResource(this.res);\n * // items.progress() tracks upload/download progress\n * // <cngx-progress [state]=\"items\"> — auto-wired progress bar\n * ```\n *\n * @category common/data/async-state\n */\nexport function fromHttpResource<T>(ref: HttpResourceLike<T>): CngxAsyncState<T> {\n const hadSuccess = signal(false);\n\n effect(() => {\n const s = ref.status();\n if (s === 'resolved' || s === 'local') {\n hadSuccess.set(true);\n }\n });\n\n const status = computed((): AsyncStatus => {\n switch (ref.status()) {\n case 'idle':\n return 'idle';\n case 'loading':\n return 'loading';\n case 'reloading':\n return 'refreshing';\n case 'resolved':\n case 'local':\n return 'success';\n case 'error':\n return 'error';\n }\n });\n\n const data = computed(() => (ref.hasValue() ? ref.value() : undefined));\n const error = computed(() => ref.error());\n\n // Map HTTP progress (0–1 float) to 0–100 integer, clamped\n const progress = computed(() => {\n const p = ref.progress();\n if (p == null) {\n return undefined;\n }\n return Math.round(Math.min(p, 1) * 100);\n });\n\n const isLoading = computed(() => status() === 'loading');\n const isPending = computed(() => false);\n const isRefreshing = computed(() => status() === 'refreshing');\n const isBusy = computed(() => ref.isLoading());\n const isFirstLoad = computed(() => !hadSuccess() && isBusy());\n const isEmpty = computed(() => {\n const d = data();\n return d == null || (Array.isArray(d) && d.length === 0);\n });\n const hasData = computed(() => ref.hasValue() && !isEmpty());\n const isSettled = computed(() => {\n const s = status();\n return s === 'success' || s === 'error';\n });\n const lastUpdated = signal<Date | undefined>(undefined);\n\n effect(() => {\n const s = ref.status();\n if (s === 'resolved' || s === 'local') {\n lastUpdated.set(new Date());\n }\n });\n\n return {\n status,\n data,\n error,\n progress,\n isLoading,\n isPending,\n isRefreshing,\n isBusy,\n isFirstLoad,\n isEmpty,\n hasData,\n isSettled,\n lastUpdated: lastUpdated.asReadonly(),\n };\n}\n","import {\n type MonoTypeOperatorFunction,\n type Observable,\n type OperatorFunction,\n defer,\n filter,\n map,\n tap,\n} from 'rxjs';\n\n/**\n * Minimal write interface for async state operators.\n *\n * Any `ManualAsyncState<T>` satisfies this — operators only need the write side.\n */\ninterface AsyncStateSink<T> {\n set(status: 'loading' | 'refreshing' | 'pending'): void;\n setSuccess(data: T): void;\n setError(error: unknown): void;\n setProgress(value: number | undefined): void;\n}\n\n/**\n * RxJS operator that wires an Observable's lifecycle to a `ManualAsyncState`.\n *\n * On subscribe: sets `loading` (or `refreshing` if data was already loaded).\n * On next: calls `setSuccess(value)`.\n * On error: calls `setError(err)` and **re-throws** (does not swallow).\n *\n * The Observable passes through unchanged — `tapAsyncState` is a side-effect operator.\n *\n * ```typescript\n * readonly residents = createManualState<Resident[]>();\n *\n * load(): void {\n * this.http.get<Resident[]>('/api/residents').pipe(\n * tapAsyncState(this.residents),\n * takeUntilDestroyed(this.destroyRef),\n * ).subscribe();\n * }\n * ```\n *\n * @category common/data/async-state\n */\nexport function tapAsyncState<T>(\n state: AsyncStateSink<T>,\n options?: { status?: 'loading' | 'refreshing' | 'pending' },\n): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) =>\n defer(() => {\n state.set(options?.status ?? 'loading');\n return source.pipe(\n tap({\n next: (value) => state.setSuccess(value),\n error: (err: unknown) => state.setError(err),\n }),\n );\n });\n}\n\n/**\n * Shape of an Angular `HttpProgressEvent` — declared structurally to\n * avoid a hard import on `@angular/common/http` from this entry point.\n */\ninterface HttpProgressLike {\n type: number; // HttpEventType.UploadProgress = 1, DownloadProgress = 3\n loaded: number;\n total?: number;\n}\n\n/**\n * Shape of an Angular `HttpResponse` — declared structurally.\n */\ninterface HttpResponseLike<T> {\n type: number; // HttpEventType.Response = 4\n body: T | null;\n}\n\n// HttpEventType values (from @angular/common/http)\nconst UPLOAD_PROGRESS = 1;\nconst DOWNLOAD_PROGRESS = 3;\nconst RESPONSE = 4;\n\n/**\n * RxJS operator that extracts upload/download progress from an\n * `HttpEvent` stream and reports it to a `ManualAsyncState`.\n *\n * Filters progress events, calculates percentage, calls `setProgress()`.\n * Non-progress events pass through unchanged.\n *\n * Use with `{ observe: 'events', reportProgress: true }` on HttpClient.\n *\n * ```typescript\n * readonly upload = createManualState<UploadResult>();\n *\n * handleUpload(file: File): void {\n * this.http.post('/api/upload', file, {\n * reportProgress: true,\n * observe: 'events',\n * }).pipe(\n * tapAsyncProgress(this.upload),\n * takeUntilDestroyed(this.destroyRef),\n * ).subscribe();\n * }\n * ```\n *\n * @category common/data/async-state\n */\nexport function tapAsyncProgress<E>(\n state: Pick<AsyncStateSink<unknown>, 'setProgress'>,\n): MonoTypeOperatorFunction<E> {\n return tap((event) => {\n const e = event as unknown as HttpProgressLike;\n if (\n (e.type === UPLOAD_PROGRESS || e.type === DOWNLOAD_PROGRESS) &&\n e.total != null &&\n e.total > 0\n ) {\n state.setProgress(Math.round((100 * e.loaded) / e.total));\n }\n });\n}\n\n/**\n * RxJS operator that combines `tapAsyncState` + `tapAsyncProgress` for HTTP event streams.\n *\n * Pipe this onto an `HttpClient` call with `{ observe: 'events', reportProgress: true }`.\n * It will:\n * 1. Set `loading` on subscribe\n * 2. Report upload/download progress via `setProgress()`\n * 3. Extract the response body on `HttpEventType.Response`\n * 4. Call `setSuccess(body)` with the extracted body\n * 5. Call `setError(err)` on error\n *\n * The output Observable emits the **response body** (not HttpEvents).\n * Throws if the response body is `null`.\n *\n * ```typescript\n * readonly upload = createManualState<UploadResult>();\n *\n * handleUpload(file: File): void {\n * this.http.post('/api/upload', file, {\n * reportProgress: true,\n * observe: 'events',\n * }).pipe(\n * tapHttpAsyncState(this.upload),\n * takeUntilDestroyed(this.destroyRef),\n * ).subscribe();\n * // upload.status(), upload.progress(), upload.data() — all wired\n * }\n * ```\n *\n * @category common/data/async-state\n */\nexport function tapHttpAsyncState<T>(\n state: AsyncStateSink<T>,\n options?: { status?: 'loading' | 'refreshing' | 'pending' },\n): OperatorFunction<unknown, T> {\n return (source: Observable<unknown>) =>\n defer(() => {\n state.set(options?.status ?? 'loading');\n return source.pipe(\n tapAsyncProgress<unknown>(state),\n filter((event): event is HttpResponseLike<T> => {\n return (event as HttpResponseLike<T>).type === RESPONSE;\n }),\n map((response) => {\n if (response.body == null) {\n throw new Error('tapHttpAsyncState: response body is null');\n }\n return response.body;\n }),\n tap({\n next: (value) => state.setSuccess(value),\n error: (err: unknown) => state.setError(err),\n }),\n );\n });\n}\n","import {\n computed,\n Directive,\n effect,\n type EmbeddedViewRef,\n inject,\n input,\n signal,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\nimport { resolveAsyncView, type AsyncView } from '../async-state/resolve-view';\n\n/**\n * Template context for the `*cngxAsync` content template.\n * `$implicit` provides the data value, typed via `ngTemplateContextGuard`.\n *\n * @category common/data/async-state\n */\nexport interface CngxAsyncContext<T> {\n /** The data value - bound via `let data` in microsyntax. */\n $implicit: T;\n /** Alias for `$implicit`. */\n cngxAsync: T;\n}\n\n/**\n * Structural directive for async state-driven content rendering.\n *\n * Renders different views based on the current `CngxAsyncState` status:\n * - **loading (first load)** → skeleton template (or nothing)\n * - **success + has data** → content template with typed data\n * - **success + empty** → empty template (or nothing)\n * - **error (first load)** → error template (or nothing)\n * - **refreshing / loading (with data)** → content template (old data stays visible)\n * - **error (with data)** → content template (old data stays visible)\n *\n * ### Minimal - just content\n * ```html\n * <ul *cngxAsync=\"residents; let data\">\n * @for (r of data; track r.id) { <li>{{ r.name }}</li> }\n * </ul>\n * ```\n *\n * ### With custom templates\n * ```html\n * <ul *cngxAsync=\"residents; let data; skeleton: skelTpl; empty: emptyTpl; error: errTpl\">\n * @for (r of data; track r.id) { <li>{{ r.name }}</li> }\n * </ul>\n *\n * <ng-template #skelTpl>\n * @for (i of [1,2,3]; track i) { <li class=\"skeleton-line\"></li> }\n * </ng-template>\n *\n * <ng-template #emptyTpl>\n * <li>No residents found.</li>\n * </ng-template>\n *\n * <ng-template #errTpl let-err>\n * <li>Error: {{ err }}</li>\n * </ng-template>\n * ```\n *\n * @category common/data/async-state\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/async/async.directive.ts\n * @since 0.1.0\n * @relatedTo injectAsyncState, createAsyncState, createManualState\n *\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/cngx-async-container-full-control-toast</example-url>\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/cngxasync-one-line</example-url>\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/cngxasync-with-custom-templates</example-url>\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/composition-overlay-container-toast</example-url>\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/createasyncstate-mutation</example-url>\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/injectasyncstate-reactive-query</example-url>\n */\n@Directive({\n selector: '[cngxAsync]',\n standalone: true,\n})\nexport class CngxAsync<T> {\n private readonly vcr = inject(ViewContainerRef);\n private readonly contentTpl = inject<TemplateRef<CngxAsyncContext<T>>>(TemplateRef);\n\n /** The async state to render. */\n readonly cngxAsync = input.required<CngxAsyncState<T>>();\n\n /** Optional skeleton template shown during first load. */\n readonly cngxAsyncSkeleton = input<TemplateRef<unknown> | undefined>(undefined);\n\n /** Optional empty template shown when data is empty after success. */\n readonly cngxAsyncEmpty = input<TemplateRef<unknown> | undefined>(undefined);\n\n /** Optional error template shown on error during first load. Context: `{ $implicit: error }`. */\n readonly cngxAsyncError = input<TemplateRef<{ $implicit: unknown }> | undefined>(undefined);\n\n private readonly view = computed(() => {\n const s = this.cngxAsync();\n return resolveAsyncView(s.status(), s.isFirstLoad(), s.isEmpty());\n });\n\n private readonly currentView = signal<AsyncView>('none');\n private contentViewRef: EmbeddedViewRef<CngxAsyncContext<T>> | null = null;\n\n constructor() {\n effect(() => {\n const view = this.view();\n const s = this.cngxAsync();\n // content+error → show content (structural directive has no dual-render)\n const effective = view === 'content+error' ? 'content' : view;\n\n if (effective === this.currentView()) {\n this.updateContentContext(s);\n return;\n }\n\n this.vcr.clear();\n this.contentViewRef = null;\n this.currentView.set(effective);\n\n this.renderView(effective, s);\n });\n }\n\n private updateContentContext(s: CngxAsyncState<T>): void {\n if (!this.contentViewRef) {\n return;\n }\n const data = s.data();\n if (data === undefined) {\n return;\n }\n this.contentViewRef.context.$implicit = data;\n this.contentViewRef.context.cngxAsync = data;\n this.contentViewRef.markForCheck();\n }\n\n private renderView(view: AsyncView, s: CngxAsyncState<T>): void {\n switch (view) {\n case 'skeleton':\n this.renderTemplate(this.cngxAsyncSkeleton());\n break;\n case 'content':\n case 'content+error': {\n const data = s.data();\n this.contentViewRef = this.vcr.createEmbeddedView(this.contentTpl, {\n $implicit: data as T,\n cngxAsync: data as T,\n });\n break;\n }\n case 'empty':\n this.renderTemplate(this.cngxAsyncEmpty());\n break;\n case 'error':\n this.renderTemplate(this.cngxAsyncError(), { $implicit: s.error() });\n break;\n }\n }\n\n private renderTemplate(\n tpl: TemplateRef<unknown> | undefined,\n context?: Record<string, unknown>,\n ): void {\n if (tpl) {\n this.vcr.createEmbeddedView(tpl, context);\n }\n }\n\n /** Type guard for template type inference. */\n static ngTemplateContextGuard<T>(_dir: CngxAsync<T>, _ctx: unknown): _ctx is CngxAsyncContext<T> {\n return true;\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n LOCALE_ID,\n ViewEncapsulation,\n} from '@angular/core';\n\n/**\n * Displays a formatted numeric value with optional unit.\n *\n * Uses `Intl.NumberFormat` with the injected `LOCALE_ID` for locale-aware\n * formatting. Null values render as an em-dash.\n *\n * Composable - works inside any card variant, header, body, or standalone.\n *\n * ### Basic\n * ```html\n * <cngx-metric [value]=\"1234\" unit=\"bpm\" />\n * ```\n *\n * ### With format options\n * ```html\n * <cngx-metric [value]=\"99.6\" unit=\"%\" [format]=\"{ maximumFractionDigits: 1 }\" />\n * ```\n *\n * ### Inside a card\n * ```html\n * <cngx-card>\n * <header cngxCardHeader>Puls</header>\n * <cngx-metric cngxCardBody [value]=\"75\" unit=\"bpm\" />\n * </cngx-card>\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/metric/metric.component.ts\n * @since 0.1.0\n * @relatedTo CngxTrend, CngxCard\n *\n * <example-url>http://localhost:4200/#/common/data/metric/inside-a-card</example-url>\n * <example-url>http://localhost:4200/#/common/data/metric/standalone-metrics</example-url>\n */\n@Component({\n selector: 'cngx-metric',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-metric',\n // role=img makes the host a single labelled graphic so AT announces the\n // curated `aria-label` (value + unit) instead of the raw text on an\n // otherwise role=generic custom element, where aria-label is unreliably\n // exposed. Mirrors CngxDelta / CngxTrend.\n role: 'img',\n '[attr.aria-label]': 'accessibleValue()',\n },\n template: `\n <span class=\"cngx-metric__value\">{{ formattedValue() }}</span>\n @if (unit()) {\n <span class=\"cngx-metric__unit\">{{ unit() }}</span>\n }\n `,\n styleUrls: ['./metric.component.css'],\n})\nexport class CngxMetric {\n private readonly locale = inject(LOCALE_ID);\n\n /** Numeric or string value. `null` renders as a placeholder hyphen. */\n readonly value = input.required<number | string | null>();\n\n /** Unit suffix (e.g. \"bpm\", \"h\", \"%\", \"kg\"). */\n readonly unit = input<string | undefined>(undefined);\n\n /** `Intl.NumberFormatOptions` for the primary value. */\n readonly format = input<Intl.NumberFormatOptions | undefined>(undefined);\n\n /** @internal */\n readonly formattedValue = computed(() => {\n const v = this.value();\n if (v === null) {\n return '\\u2014';\n }\n if (typeof v === 'string') {\n return v;\n }\n return this.format()\n ? new Intl.NumberFormat(this.locale, this.format()).format(v)\n : v.toLocaleString(this.locale);\n });\n\n /** @internal Full accessible description including unit. */\n readonly accessibleValue = computed(() => {\n const v = this.formattedValue();\n const u = this.unit();\n return u ? `${v} ${u}` : v;\n });\n}\n","/**\n * Pure, framework-agnostic helpers that turn a signed delta value into the\n * three orthogonal signals a KPI atom renders: **direction** (which way the\n * arrow points), **sentiment** (whether the change is good or bad, which\n * drives colour and the SR word), and the formatted magnitude.\n *\n * Direction and sentiment are deliberately separate. `CngxTrend` colours by\n * direction (up = green); `CngxDelta` colours by sentiment, so a value that\n * dropped can still read as an improvement (churn down, latency down). Both\n * consume these helpers so the direction / glyph / format logic has a single\n * source of truth (Pillar 1) with no Angular dependency.\n */\n\n/** Which way the delta moved. `flat` is exactly zero. */\nexport type DeltaDirection = 'up' | 'down' | 'flat';\n\n/**\n * How to read the sign of a delta. `neutral` disables sentiment entirely\n * (direction still renders, colour stays neutral).\n */\nexport type DeltaPolarity = 'higher-is-better' | 'lower-is-better' | 'neutral';\n\n/** Good / bad / indifferent, derived from `direction × polarity`. */\nexport type DeltaSentiment = 'positive' | 'negative' | 'neutral';\n\n/** Percent (default, one fraction digit + `%`) or a locale-formatted absolute number. */\nexport type DeltaMode = 'percent' | 'absolute';\n\n/** `> 0 → up`, `< 0 → down`, `0 → flat`. */\nexport function deltaDirection(value: number): DeltaDirection {\n return value > 0 ? 'up' : value < 0 ? 'down' : 'flat';\n}\n\n/**\n * Combine movement with the caller's polarity. `flat` or `neutral` polarity\n * collapse to `neutral`; otherwise up is positive under `higher-is-better`\n * and negative under `lower-is-better` (and the reverse for down).\n */\nexport function deltaSentiment(\n direction: DeltaDirection,\n polarity: DeltaPolarity,\n): DeltaSentiment {\n if (direction === 'flat' || polarity === 'neutral') {\n return 'neutral';\n }\n const upIsGood = polarity === 'higher-is-better';\n const isGood = direction === 'up' ? upIsGood : !upIsGood;\n return isGood ? 'positive' : 'negative';\n}\n\n/** Arrow glyph for the direction: `↑` / `↓` / `→`. */\nexport function directionGlyph(direction: DeltaDirection): string {\n return direction === 'up' ? '↑' : direction === 'down' ? '↓' : '→';\n}\n\n/**\n * Format the magnitude. The sign is carried by the arrow and colour, not the\n * digits: a positive value gains a leading `+`, everything else prints its\n * absolute value unsigned. Percent mode appends a narrow-no-break-space + `%`\n * and defaults to one fraction digit; absolute mode uses the locale grouping.\n * A supplied `Intl.NumberFormatOptions` overrides the default digit handling\n * in both modes.\n */\nexport function formatDelta(\n value: number,\n mode: DeltaMode,\n locale: string,\n format?: Intl.NumberFormatOptions,\n): string {\n const abs = Math.abs(value);\n const prefix = value > 0 ? '+' : '';\n if (mode === 'percent') {\n const num = format ? new Intl.NumberFormat(locale, format).format(abs) : abs.toFixed(1);\n return `${prefix}${num}\\u202f%`;\n }\n const num = format ? new Intl.NumberFormat(locale, format).format(abs) : abs.toLocaleString(locale);\n return `${prefix}${num}`;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n LOCALE_ID,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { deltaDirection, directionGlyph, formatDelta } from '../shared/delta-format';\n\n/**\n * Displays a trend indicator with directional arrow and formatted percentage.\n *\n * Positive values show an up arrow, negative a down arrow, zero a right arrow.\n * The consumer can override the SR label for full context\n * (e.g. \"vs. last month\" instead of the generic default).\n *\n * ### Basic\n * ```html\n * <cngx-trend [value]=\"5.3\" />\n * ```\n *\n * ### With custom label\n * ```html\n * <cngx-trend [value]=\"-2.1\" label=\"-2.1% vs. last quarter\" />\n * ```\n *\n * ### Inside a card header\n * ```html\n * <cngx-card>\n * <header cngxCardHeader>\n * <span>Revenue</span>\n * <cngx-trend [value]=\"revenue().trend\" />\n * </header>\n * </cngx-card>\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/trend/trend.component.ts\n * @since 0.1.0\n * @relatedTo CngxMetric, CngxCard\n *\n * <example-url>http://localhost:4200/#/common/data/trend/composed-with-metric-in-a-card</example-url>\n * <example-url>http://localhost:4200/#/common/data/trend/trend-directions</example-url>\n */\n@Component({\n selector: 'cngx-trend',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-trend',\n // role=img makes the host a single labelled graphic so AT announces the\n // curated `aria-label` instead of the raw glyph text on an otherwise\n // role=generic custom element, where aria-label is unreliably exposed.\n role: 'img',\n '[class.cngx-trend--up]': 'value() > 0',\n '[class.cngx-trend--down]': 'value() < 0',\n '[attr.aria-label]': 'resolvedLabel()',\n },\n template: `\n <span aria-hidden=\"true\">{{ icon() }}</span>\n {{ formattedValue() }}\n `,\n styleUrls: ['./trend.component.css'],\n})\nexport class CngxTrend {\n private readonly locale = inject(LOCALE_ID);\n\n /** Trend percentage. Positive = up, negative = down, zero = flat. */\n readonly value = input.required<number>();\n\n /** Consumer-provided SR label override. When set, replaces the generated default. */\n readonly label = input<string | undefined>(undefined);\n\n /** @internal */\n protected readonly icon = computed(() => directionGlyph(deltaDirection(this.value())));\n\n /** @internal */\n protected readonly formattedValue = computed(() => formatDelta(this.value(), 'percent', this.locale));\n\n /** @internal */\n protected readonly resolvedLabel = computed(() => {\n if (this.label()) {\n return this.label()!;\n }\n const direction = deltaDirection(this.value());\n const dir = direction === 'up' ? 'up' : direction === 'down' ? 'down' : 'unchanged';\n return `${this.formattedValue()} ${dir}`;\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n LOCALE_ID,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport {\n deltaDirection,\n deltaSentiment,\n directionGlyph,\n formatDelta,\n type DeltaMode,\n type DeltaPolarity,\n type DeltaSentiment,\n} from '../shared/delta-format';\n\nconst SENTIMENT_WORD: Record<DeltaSentiment, string> = {\n positive: 'improved',\n negative: 'declined',\n neutral: 'unchanged',\n};\n\n/**\n * Sentiment-aware delta indicator. Where `CngxTrend` colours strictly by\n * direction (up = green), `CngxDelta` colours by **sentiment**: a `polarity`\n * of `lower-is-better` makes a drop read as an improvement (churn, latency,\n * error rate). The arrow glyph always tracks the raw direction, so colour is\n * never the only signal - a green value can carry a down arrow, and the SR\n * label speaks the sentiment word.\n *\n * Sentiment, direction, glyph and the formatted magnitude are each a\n * `computed()` off the single `value`/`polarity` input pair (Pillar 1); the\n * colour class and the arrow are bound from independent signals so they can\n * diverge (Pillar 2).\n *\n * ### Basic (higher-is-better default)\n * ```html\n * <cngx-delta [value]=\"5.3\" />\n * ```\n *\n * ### Lower-is-better (a drop is good)\n * ```html\n * <cngx-delta [value]=\"-2.1\" polarity=\"lower-is-better\" />\n * ```\n *\n * ### Absolute magnitude\n * ```html\n * <cngx-delta [value]=\"1240\" mode=\"absolute\" [format]=\"{ maximumFractionDigits: 0 }\" />\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/delta/delta.component.ts\n * @since 0.1.0\n * @relatedTo CngxTrend, CngxMetric, CngxStat\n *\n * <example-url>http://localhost:4200/#/common/data/delta/sentiment-polarity</example-url>\n */\n@Component({\n selector: 'cngx-delta',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-delta',\n // role=img makes the host a single labelled graphic so AT announces the\n // curated `aria-label` (the sentiment word) instead of the raw glyph text\n // on an otherwise role=generic custom element, where aria-label is\n // unreliably exposed.\n role: 'img',\n '[class.cngx-delta--positive]': \"sentiment() === 'positive'\",\n '[class.cngx-delta--negative]': \"sentiment() === 'negative'\",\n '[class.cngx-delta--neutral]': \"sentiment() === 'neutral'\",\n '[attr.aria-label]': 'resolvedLabel()',\n },\n template: `\n <span aria-hidden=\"true\">{{ glyph() }}</span>\n {{ formattedValue() }}\n `,\n styleUrls: ['./delta.component.css'],\n})\nexport class CngxDelta {\n private readonly locale = inject(LOCALE_ID);\n\n /** Signed delta. Positive = up, negative = down, zero = flat. */\n readonly value = input.required<number>();\n\n /**\n * How to read the sign. `higher-is-better` (default) treats a rise as\n * positive; `lower-is-better` inverts it; `neutral` disables sentiment\n * (direction still renders, colour stays neutral).\n */\n readonly polarity = input<DeltaPolarity>('higher-is-better');\n\n /** `percent` (default, one fraction digit + `%`) or `absolute`. */\n readonly mode = input<DeltaMode>('percent');\n\n /** `Intl.NumberFormatOptions` applied to the magnitude in either mode. */\n readonly format = input<Intl.NumberFormatOptions | undefined>(undefined);\n\n /** Consumer-provided SR label override. Replaces the generated default. */\n readonly label = input<string | undefined>(undefined);\n\n /** @internal Raw movement, independent of polarity. Drives the glyph. */\n protected readonly direction = computed(() => deltaDirection(this.value()));\n\n /** @internal Good / bad / indifferent. Drives colour and the SR word. */\n protected readonly sentiment = computed(() => deltaSentiment(this.direction(), this.polarity()));\n\n /** @internal Arrow glyph bound from direction only. */\n protected readonly glyph = computed(() => directionGlyph(this.direction()));\n\n /** @internal Formatted magnitude. */\n protected readonly formattedValue = computed(() =>\n formatDelta(this.value(), this.mode(), this.locale, this.format()),\n );\n\n /** @internal Full SR label: magnitude plus the sentiment word. */\n protected readonly resolvedLabel = computed(() => {\n const override = this.label();\n if (override) {\n return override;\n }\n return `${this.formattedValue()} ${SENTIMENT_WORD[this.sentiment()]}`;\n });\n}\n","import { InjectionToken } from '@angular/core';\n\n/** The four coordinated slots of a {@link CngxStat}, in reading order. */\nexport type CngxStatSlotKind = 'label' | 'value' | 'delta' | 'caption';\n\n/**\n * Slot-registration contract a `CngxStat` exposes to its projected slot\n * directives. Each slot registers its generated id on init and withdraws it\n * on destroy; the molecule derives the combined `aria-labelledby` from the\n * live registration set. Fronted by a DI token (not the concrete `CngxStat`\n * class) so the slots stay decompose-safe - the ejected skin talks to the\n * same token the library defines.\n */\nexport interface CngxStatRegistry {\n /** Register (or replace) the id contributed by `kind`. */\n register(kind: CngxStatSlotKind, id: string): void;\n /** Withdraw the id contributed by `kind`. */\n unregister(kind: CngxStatSlotKind): void;\n}\n\n/** DI token carrying the {@link CngxStatRegistry} a `CngxStat` provides. */\nexport const CNGX_STAT = new InjectionToken<CngxStatRegistry>('CNGX_STAT');\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { CNGX_STAT, type CngxStatRegistry, type CngxStatSlotKind } from './stat.token';\n\n/** Fixed reading order for the coordinated slots. */\nconst SLOT_ORDER: readonly CngxStatSlotKind[] = ['label', 'value', 'delta', 'caption'];\n\n/** Structural equality so an unchanged id set never cascades `labelledBy`. */\nconst idsEqual = (a: readonly string[], b: readonly string[]): boolean =>\n a.length === b.length && a.every((id, i) => id === b[i]);\n\n/**\n * Coordination molecule for a KPI stat. Its sole reason to exist is the\n * screen-reader layer (Pillar 2): hand-assembling a heading, a `<cngx-metric>`\n * and a `<cngx-delta>` makes a screen reader announce three disconnected\n * fragments. `CngxStat` projects the label / value / delta / caption slots,\n * collects the id each slot registers, and derives one `aria-labelledby` that\n * reads the whole stat as a single accessible name in reading order.\n *\n * Composition, never a config bag (Pillar 3): the molecule owns only the id\n * coordination `computed()` graph; the visuals are whatever atoms the\n * consumer projects into the slots.\n *\n * ```html\n * <cngx-stat aria-live=\"polite\">\n * <span cngxStatLabel>Revenue</span>\n * <cngx-metric cngxStatValue [value]=\"1.2\" unit=\"M EUR\" />\n * <cngx-delta cngxStatDelta [value]=\"5.3\" />\n * <span cngxStatCaption>vs. last quarter</span>\n * </cngx-stat>\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/stat/stat.component.ts\n * @since 0.1.0\n * @relatedTo CngxMetric, CngxDelta, CngxTrend\n *\n * <example-url>http://localhost:4200/#/common/data/stat/composed-kpi</example-url>\n */\n@Component({\n selector: 'cngx-stat',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_STAT, useExisting: CngxStat }],\n host: {\n class: 'cngx-stat',\n role: 'group',\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.aria-live]': 'live()',\n },\n template: `\n <ng-content select=\"[cngxStatLabel]\" />\n <div class=\"cngx-stat__row\">\n <ng-content select=\"[cngxStatValue]\" />\n <ng-content select=\"[cngxStatDelta]\" />\n </div>\n <ng-content select=\"[cngxStatCaption]\" />\n `,\n styleUrls: ['./stat.component.css'],\n})\nexport class CngxStat implements CngxStatRegistry {\n private readonly slots = signal<ReadonlyMap<CngxStatSlotKind, string>>(new Map());\n\n /**\n * Politeness of the live region. `off` (default) for a static stat;\n * `polite` / `assertive` for a KPI whose value updates in place.\n */\n readonly live = input<'off' | 'polite' | 'assertive'>('off');\n\n /** {@inheritDoc CngxStatRegistry.register} */\n register(kind: CngxStatSlotKind, id: string): void {\n this.slots.update((prev) => new Map(prev).set(kind, id));\n }\n\n /** {@inheritDoc CngxStatRegistry.unregister} */\n unregister(kind: CngxStatSlotKind): void {\n this.slots.update((prev) => {\n const next = new Map(prev);\n next.delete(kind);\n return next;\n });\n }\n\n /** @internal Present slot ids in reading order; structurally stable. */\n protected readonly orderedIds = computed(\n () => {\n const map = this.slots();\n return SLOT_ORDER.map((kind) => map.get(kind)).filter((id): id is string => id !== undefined);\n },\n { equal: idsEqual },\n );\n\n /** @internal Combined accessible name; `null` when no slot is present. */\n protected readonly labelledBy = computed(() => this.orderedIds().join(' ') || null);\n}\n","import { DestroyRef, Directive, inject } from '@angular/core';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_STAT, type CngxStatSlotKind } from './stat.token';\n\n/**\n * Generate a stable id, register it with the enclosing `CngxStat` (if any),\n * and withdraw it on destroy. Shared by the four slot directives via plain\n * composition - no base class, no inheritance (Pillar 3).\n */\nfunction useStatSlot(kind: CngxStatSlotKind): string {\n const registry = inject(CNGX_STAT, { optional: true });\n const id = nextUid(`cngx-stat-${kind}`);\n registry?.register(kind, id);\n inject(DestroyRef).onDestroy(() => registry?.unregister(kind));\n return id;\n}\n\n/**\n * Marks the label element of a {@link CngxStat}. Its generated id leads the\n * molecule's `aria-labelledby`.\n *\n * @category common/data/metric\n * @since 0.1.0\n * @relatedTo CngxStat\n */\n@Directive({\n selector: '[cngxStatLabel]',\n standalone: true,\n host: { '[id]': 'id' },\n})\nexport class CngxStatLabel {\n /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */\n readonly id = useStatSlot('label');\n}\n\n/**\n * Marks the primary value element of a {@link CngxStat} (typically a\n * `<cngx-metric>`).\n *\n * @category common/data/metric\n * @since 0.1.0\n * @relatedTo CngxStat\n */\n@Directive({\n selector: '[cngxStatValue]',\n standalone: true,\n host: { '[id]': 'id' },\n})\nexport class CngxStatValue {\n /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */\n readonly id = useStatSlot('value');\n}\n\n/**\n * Marks the delta element of a {@link CngxStat} (typically a `<cngx-delta>`\n * or `<cngx-trend>`).\n *\n * @category common/data/metric\n * @since 0.1.0\n * @relatedTo CngxStat\n */\n@Directive({\n selector: '[cngxStatDelta]',\n standalone: true,\n host: { '[id]': 'id' },\n})\nexport class CngxStatDelta {\n /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */\n readonly id = useStatSlot('delta');\n}\n\n/**\n * Marks the caption element of a {@link CngxStat} - the trailing context\n * line (e.g. \"vs. last quarter\").\n *\n * @category common/data/metric\n * @since 0.1.0\n * @relatedTo CngxStat\n */\n@Directive({\n selector: '[cngxStatCaption]',\n standalone: true,\n host: { '[id]': 'id' },\n})\nexport class CngxStatCaption {\n /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */\n readonly id = useStatSlot('caption');\n}\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n isDevMode,\n ViewEncapsulation,\n} from '@angular/core';\n\n/** Semantic health of a {@link CngxStatus}. */\nexport type StatusTone = 'success' | 'warning' | 'danger' | 'info' | 'neutral';\n\n/** Tone glyph rendered inside the decorative dot - the non-colour signal. */\nconst TONE_GLYPH: Record<StatusTone, string> = {\n success: '✓',\n warning: '!',\n danger: '✕',\n info: 'i',\n neutral: '•',\n};\n\n/**\n * Semantic health indicator - a decorative tone dot paired with a visible\n * label. Distinct from `CngxBadge` (count overlay), `CngxChip` (interactive)\n * and `CngxTag` (labeled token): its single job is to communicate a status\n * (operational / degraded / down / info).\n *\n * Colour is never the only signal (Pillar 2): the tone drives the dot colour\n * *and* a tone glyph, so a colour-blind reader still distinguishes the states,\n * and the visible `label` carries the meaning for assistive tech (the dot is\n * `aria-hidden`). Set `live` for a status that changes in place.\n *\n * ### Basic\n * ```html\n * <cngx-status tone=\"success\" label=\"Operational\" />\n * ```\n *\n * ### Live-updating\n * ```html\n * <cngx-status tone=\"danger\" label=\"Outage\" live=\"assertive\" />\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/status/status.component.ts\n * @since 0.1.0\n * @relatedTo CngxBadge, CngxTag, CngxChip\n *\n * <example-url>http://localhost:4200/#/common/data/status/tone-matrix</example-url>\n */\n@Component({\n selector: 'cngx-status',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-status',\n '[class.cngx-status--success]': \"tone() === 'success'\",\n '[class.cngx-status--warning]': \"tone() === 'warning'\",\n '[class.cngx-status--danger]': \"tone() === 'danger'\",\n '[class.cngx-status--info]': \"tone() === 'info'\",\n '[class.cngx-status--neutral]': \"tone() === 'neutral'\",\n '[attr.aria-live]': 'live()',\n },\n template: `\n <span class=\"cngx-status__dot\" aria-hidden=\"true\">{{ glyph() }}</span>\n @if (label()) {\n <span class=\"cngx-status__label\">{{ label() }}</span>\n }\n `,\n styleUrls: ['./status.component.css'],\n})\nexport class CngxStatus {\n private readonly elRef = inject(ElementRef<HTMLElement>);\n\n /** Semantic health. Drives both the dot colour and the tone glyph. */\n readonly tone = input<StatusTone>('neutral');\n\n /** Visible status text. Carries the meaning for assistive tech. */\n readonly label = input<string | undefined>(undefined);\n\n /**\n * Politeness of the live region. `off` (default) for a static status;\n * `polite` / `assertive` for a status that changes in place.\n */\n readonly live = input<'off' | 'polite' | 'assertive'>('off');\n\n /** @internal Tone glyph bound into the decorative dot. */\n protected readonly glyph = computed(() => TONE_GLYPH[this.tone()]);\n\n constructor() {\n if (isDevMode()) {\n afterNextRender(() => {\n const el = this.elRef.nativeElement as HTMLElement;\n if (!this.label() && !el.getAttribute('aria-label') && !el.getAttribute('aria-labelledby')) {\n console.warn(\n 'cngx-status: no `label` and no external `aria-label`/`aria-labelledby`; ' +\n 'the status has no accessible name and reads only as a coloured dot. ' +\n 'Set [label] or an aria-label on the host.',\n );\n }\n });\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n type Signal,\n ViewEncapsulation,\n} from '@angular/core';\n\n/**\n * Determinate attainment bar - a continuous progress toward a target\n * (quota reached, budget spent, goal met). Named `CngxGoal` because\n * `cngx-progress` is the indeterminate async loading bar; this is the\n * finished-fraction indicator, distinct from that and from the discrete\n * `CngxSegmentedProgress`.\n *\n * Mirrors the `CngxSegmentedProgress` a11y shape: `role=\"progressbar\"` with\n * the whole `aria-value*` set plus `aria-valuetext` living in the `computed()`\n * graph (Pillar 2). The value is clamped to `[0, max]`; the fill width is a\n * derived percent bound as a CSS custom property.\n *\n * ```html\n * <cngx-goal [value]=\"73\" [max]=\"100\" />\n * <cngx-goal [value]=\"q()\" [max]=\"target()\" [valueTextFormat]=\"quotaText\" />\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/goal/goal.component.ts\n * @since 0.1.0\n * @relatedTo CngxSegmentedProgress, CngxMetric\n *\n * <example-url>http://localhost:4200/#/common/data/goal/quota-attainment</example-url>\n */\n@Component({\n selector: 'cngx-goal',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-goal',\n role: 'progressbar',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuemax]': 'maxValue()',\n '[attr.aria-valuenow]': 'now()',\n '[attr.aria-valuetext]': 'valueText()',\n '[style.--cngx-goal-fill.%]': 'fillPercent()',\n },\n template: `<span class=\"cngx-goal__track\"><span class=\"cngx-goal__fill\"></span></span>`,\n styleUrls: ['./goal.component.css'],\n})\nexport class CngxGoal {\n /** Current attainment. Clamped to `[0, max]`. */\n readonly value = input.required<number>();\n\n /** Target the value works toward. Defaults to `100`. */\n readonly max = input<number>(100);\n\n /**\n * Override the `aria-valuetext` string. Receives `(now, max)` - the clamped\n * value and the target. The default is `(now, max) => \\`${now} of ${max}\\``.\n * Supply a localised closure for richer text (e.g.\n * `(n, m) => \\`${n} of ${m}, ${Math.round((n / m) * 100)}% of quota\\``).\n */\n readonly valueTextFormat = input<((now: number, max: number) => string) | undefined>(undefined);\n\n /** `aria-valuemax` - the target, floored at 0. */\n protected readonly maxValue: Signal<number> = computed(() => Math.max(0, this.max()));\n\n /** `aria-valuenow` - value clamped into `[0, max]`. */\n protected readonly now: Signal<number> = computed(() =>\n Math.max(0, Math.min(this.value(), this.maxValue())),\n );\n\n /** Fill width as a percent of the target; `0` when the target is `0`. */\n protected readonly fillPercent: Signal<number> = computed(() => {\n const max = this.maxValue();\n return max === 0 ? 0 : (this.now() / max) * 100;\n });\n\n /** `aria-valuetext` - human-readable attainment via the resolved closure. */\n protected readonly valueText: Signal<string> = computed(() => {\n const fmt = this.valueTextFormat() ?? ((now: number, max: number) => `${now} of ${max}`);\n return fmt(this.now(), this.maxValue());\n });\n}\n","/**\n * Result of a range computation for virtual scrolling.\n *\n * `start`/`end` are item indices. `offsetBefore`/`offsetAfter`/`totalSize` are pixels.\n * In grid mode, offsets are row-based (rows = ceil(totalCount / columns)).\n *\n * @internal\n */\nexport interface RangeResult {\n /** Start index (inclusive) of the visible range. */\n readonly start: number;\n /** End index (exclusive) of the visible range. */\n readonly end: number;\n /** Height of the spacer before visible items (px). */\n readonly offsetBefore: number;\n /** Height of the spacer after visible items (px). */\n readonly offsetAfter: number;\n /** Total height of all items (px). */\n readonly totalSize: number;\n}\n\nconst EMPTY_RANGE: RangeResult = {\n start: 0,\n end: 0,\n offsetBefore: 0,\n offsetAfter: 0,\n totalSize: 0,\n};\n\n/**\n * Computes the visible range of items given scroll position, viewport size,\n * total item count, and item size estimation.\n *\n * Pure function - no DOM access, no Angular dependency. Fully testable.\n *\n * @param scrollTop Current scroll offset in px.\n * @param clientHeight Viewport height in px.\n * @param totalCount Total number of items.\n * @param estimateSize Fixed item height in px, or a function returning height per index.\n * @param overscan Number of extra items to render above/below the viewport.\n * @param columns Column count for grid mode (default 1). When > 1, range is row-aligned.\n * Variable `estimateSize` ignores columns (grid + variable heights not supported).\n * @returns The computed range with spacer offsets.\n * @internal\n */\nexport function computeRange(\n scrollTop: number,\n clientHeight: number,\n totalCount: number,\n estimateSize: number | ((index: number) => number),\n overscan: number,\n columns = 1,\n): RangeResult {\n if (totalCount <= 0 || clientHeight <= 0) {\n return EMPTY_RANGE;\n }\n\n if (typeof estimateSize === 'number') {\n return computeFixedRange(scrollTop, clientHeight, totalCount, estimateSize, overscan, columns);\n }\n\n // variable heights: grid mode unsupported, columns ignored\n return computeVariableRange(scrollTop, clientHeight, totalCount, estimateSize, overscan);\n}\n\nfunction computeFixedRange(\n scrollTop: number,\n clientHeight: number,\n totalCount: number,\n itemSize: number,\n overscan: number,\n columns: number,\n): RangeResult {\n if (columns > 1) {\n return computeGridRange(scrollTop, clientHeight, totalCount, itemSize, overscan, columns);\n }\n\n const totalSize = totalCount * itemSize;\n\n const rawStart = Math.floor(scrollTop / itemSize);\n const rawEnd = Math.ceil((scrollTop + clientHeight) / itemSize);\n\n const start = Math.max(0, rawStart - overscan);\n const end = Math.min(totalCount, rawEnd + overscan);\n\n return {\n start,\n end,\n offsetBefore: start * itemSize,\n offsetAfter: Math.max(0, (totalCount - end) * itemSize),\n totalSize,\n };\n}\n\n/**\n * Grid-mode range computation. Row-aligned before overscan.\n *\n * Order: raw visible rows → overscan rows → clamp → convert to item indices.\n * This ensures full rows are always rendered.\n *\n * @internal\n */\nfunction computeGridRange(\n scrollTop: number,\n clientHeight: number,\n totalCount: number,\n rowHeight: number,\n overscan: number,\n columns: number,\n): RangeResult {\n const totalRows = Math.ceil(totalCount / columns);\n const totalSize = totalRows * rowHeight;\n\n // raw rows (inherently row-aligned)\n const rawStartRow = Math.floor(scrollTop / rowHeight);\n const rawEndRow = Math.ceil((scrollTop + clientHeight) / rowHeight);\n\n // overscan applied in rows so full rows always render\n const overscanRows = Math.ceil(overscan / columns);\n const startRow = Math.max(0, rawStartRow - overscanRows);\n const endRow = Math.min(totalRows, rawEndRow + overscanRows);\n\n const start = startRow * columns;\n const end = Math.min(endRow * columns, totalCount);\n\n return {\n start,\n end,\n offsetBefore: startRow * rowHeight,\n offsetAfter: Math.max(0, (totalRows - endRow) * rowHeight),\n totalSize,\n };\n}\n\nfunction computeVariableRange(\n scrollTop: number,\n clientHeight: number,\n totalCount: number,\n estimateSize: (index: number) => number,\n overscan: number,\n): RangeResult {\n let totalSize = 0;\n const offsets = new Array<number>(totalCount + 1);\n offsets[0] = 0;\n\n for (let i = 0; i < totalCount; i++) {\n totalSize += estimateSize(i);\n offsets[i + 1] = totalSize;\n }\n\n // binary search: first item whose bottom edge is past scrollTop\n const rawStart = binarySearch(offsets, scrollTop, totalCount);\n const rawEnd = binarySearch(offsets, scrollTop + clientHeight, totalCount);\n\n const start = Math.max(0, rawStart - overscan);\n const end = Math.min(totalCount, rawEnd + 1 + overscan);\n\n return {\n start,\n end,\n offsetBefore: offsets[start],\n offsetAfter: Math.max(0, totalSize - offsets[end]),\n totalSize,\n };\n}\n\n/**\n * Finds the index of the first item whose cumulative offset exceeds `target`.\n *\n * @internal\n */\nfunction binarySearch(offsets: number[], target: number, totalCount: number): number {\n let low = 0;\n let high = totalCount - 1;\n\n while (low <= high) {\n const mid = (low + high) >>> 1;\n if (offsets[mid + 1] <= target) {\n low = mid + 1;\n } else if (offsets[mid] > target) {\n high = mid - 1;\n } else {\n return mid;\n }\n }\n\n return Math.min(low, totalCount - 1);\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n type DestroyRef,\n type ElementRef,\n type Signal,\n effect,\n inject,\n signal,\n untracked,\n} from '@angular/core';\n\n/**\n * Reactive scroll state of a container element.\n * Both signals are updated synchronously inside the same rAF callback —\n * Angular's Signal scheduling coalesces the two writes so consumers\n * evaluate once per frame, not twice.\n */\nexport interface ScrollState {\n readonly scrollTop: Signal<number>;\n readonly clientHeight: Signal<number>;\n /** The resolved scroll container element, or `null` if not yet resolved. */\n readonly element: Signal<HTMLElement | null>;\n}\n\n/**\n * Creates a reactive scroll observer for a container element.\n *\n * Element resolution happens **lazily inside the effect**, not at call time.\n * This is critical because `injectRecycler` is called in a field initializer\n * where template DOM does not yet exist — `querySelector` would return `null`.\n * The effect runs after the first CD cycle when the DOM is stable.\n *\n * @internal Not exported from `@cngx/common/data` public API.\n */\nexport function createScrollObserver(\n elementRef: ElementRef | HTMLElement | string,\n destroyRef: DestroyRef,\n): ScrollState {\n const doc = inject(DOCUMENT);\n const scrollTopState = signal(0);\n const clientHeightState = signal(0);\n const elementState = signal<HTMLElement | null>(null);\n\n // Retry trigger — incremented by afterNextRender to re-run the effect\n // when the element wasn't found on the first attempt (routed components,\n // content projection, lazy rendering).\n const retryTick = signal(0);\n\n function attachListeners(el: HTMLElement, onCleanup: (fn: () => void) => void): void {\n elementState.set(el);\n scrollTopState.set(el.scrollTop);\n clientHeightState.set(el.clientHeight);\n\n let rafId: number | null = null;\n\n const handleScroll = () => {\n if (rafId != null) {\n return;\n }\n rafId = requestAnimationFrame(() => {\n rafId = null;\n scrollTopState.set(el.scrollTop);\n clientHeightState.set(el.clientHeight);\n });\n };\n\n el.addEventListener('scroll', handleScroll, { passive: true });\n\n const resizeObserver = new ResizeObserver(() => {\n clientHeightState.set(el.clientHeight);\n });\n resizeObserver.observe(el);\n\n onCleanup(() => {\n el.removeEventListener('scroll', handleScroll);\n if (rafId != null) {\n cancelAnimationFrame(rafId);\n }\n resizeObserver.disconnect();\n elementState.set(null);\n });\n }\n\n effect((onCleanup) => {\n retryTick(); // tracked: re-runs the effect after the retry tick bumps\n const el = resolveElement(elementRef, doc);\n if (!el) {\n return;\n }\n attachListeners(el, onCleanup);\n });\n\n // If the element wasn't found on the first effect run (before DOM is ready),\n // retry after the next render cycle. Fires for ALL input shapes — string\n // selectors resolve lazily via `querySelector`, but `ElementRef` from a\n // `viewChild` also starts out with `nativeElement == null` until Angular\n // resolves the query. `HTMLElement` inputs that are non-null at call time\n // short-circuit on the first effect run so the retry is a no-op.\n afterNextRender(() => {\n // untracked: afterNextRender may run in the same microtask as the effect.\n // Reading elementState() without untracked could create an unintended dependency\n // in whatever reactive context is active.\n if (untracked(() => elementState()) == null) {\n retryTick.update((v) => v + 1);\n }\n });\n\n destroyRef.onDestroy(() => {\n elementState.set(null);\n });\n\n return {\n scrollTop: scrollTopState.asReadonly(),\n clientHeight: clientHeightState.asReadonly(),\n element: elementState.asReadonly(),\n };\n}\n\nfunction resolveElement(ref: ElementRef | HTMLElement | string, doc: Document): HTMLElement | null {\n if (typeof ref === 'string') {\n return doc.querySelector<HTMLElement>(ref);\n }\n if (ref instanceof HTMLElement) {\n return ref;\n }\n // ElementRef\n return (ref?.nativeElement as HTMLElement | null) ?? null;\n}\n","import { type Signal, signal } from '@angular/core';\n\n/**\n * Signal-based cache mapping item index to measured height.\n *\n * The `version` signal increments on every `set()`, allowing any `computed()`\n * that reads `version()` to re-evaluate when measurements change.\n *\n * @internal Not exported from `@cngx/common/data` public API.\n */\nexport interface SizeCache {\n /** Get measured size for an index, or `undefined` if not yet measured. */\n get(index: number): number | undefined;\n /** Set measured size. Increments `version` to trigger recomputation. */\n set(index: number, size: number): void;\n /** Signal that increments on every `set()` — use as a dependency in `computed()`. */\n readonly version: Signal<number>;\n /** Get size for an index, falling back to `estimateSize` if not measured. */\n resolve(index: number, estimateSize: number | ((i: number) => number)): number;\n /** Number of measured entries. */\n readonly count: number;\n /** Clear all measurements. */\n clear(): void;\n}\n\n/**\n * Creates a signal-based size cache for measured item heights.\n *\n * @internal\n */\nexport function createSizeCache(): SizeCache {\n const cache = new Map<number, number>();\n const versionState = signal(0);\n\n return {\n get(index: number): number | undefined {\n return cache.get(index);\n },\n\n set(index: number, size: number): void {\n const current = cache.get(index);\n if (current === size) {\n return;\n }\n cache.set(index, size);\n versionState.update((v) => v + 1);\n },\n\n version: versionState.asReadonly(),\n\n resolve(index: number, estimateSize: number | ((i: number) => number)): number {\n const measured = cache.get(index);\n if (measured != null) {\n return measured;\n }\n return typeof estimateSize === 'number' ? estimateSize : estimateSize(index);\n },\n\n get count(): number {\n return cache.size;\n },\n\n clear(): void {\n if (cache.size === 0) {\n return;\n }\n cache.clear();\n versionState.update((v) => v + 1);\n },\n };\n}\n","import {\n DestroyRef,\n type ElementRef,\n InjectionToken,\n type Signal,\n computed,\n effect,\n inject,\n isDevMode,\n isSignal,\n signal,\n untracked,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { createTransitionTracker } from '@cngx/core/utils';\n\nimport { computeRange } from './range-computer';\nimport { createScrollObserver } from './scroll-observer';\nimport { createSizeCache } from './size-cache';\n\n/**\n * I18n interface for recycler SR announcements.\n * All methods return the announcement text. No hardcoded strings.\n *\n * @category common/data/recycler\n */\nexport interface RecyclerI18n {\n /** Announced when new items are loaded (infinite scroll). */\n loaded(newCount: number, total: number): string;\n /** Announced when filter/search results change. */\n filtered(count: number): string;\n /** Announced when the list becomes empty. */\n empty(): string;\n /** Announced when loading fails. */\n error(): string;\n}\n\n/**\n * Injection token for recycler SR announcement texts.\n * Provides English defaults via factory. Override with `provideRecyclerI18n()`.\n *\n * @category common/data/recycler\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/recycler/recycler.ts\n * @since 0.1.0\n */\nexport const CNGX_RECYCLER_I18N = new InjectionToken<RecyclerI18n>('CngxRecyclerI18n', {\n factory: (): RecyclerI18n => ({\n loaded: (n, t) => `${n} more items loaded. ${t} total.`,\n filtered: (c) => `${c} results found.`,\n empty: () => 'No results.',\n error: () => 'Error loading data.',\n }),\n});\n\n/**\n * Provider function for custom recycler i18n texts.\n *\n * ```typescript\n * providers: [provideRecyclerI18n({\n * loaded: (n, t) => `${n} weitere Einträge. ${t} gesamt.`,\n * filtered: (c) => `${c} Ergebnisse.`,\n * empty: () => 'Keine Ergebnisse.',\n * error: () => 'Fehler beim Laden.',\n * })]\n * ```\n *\n * @category common/data/recycler\n */\nexport function provideRecyclerI18n(i18n: RecyclerI18n) {\n return { provide: CNGX_RECYCLER_I18N, useValue: i18n };\n}\n\n/**\n * Configuration for {@link injectRecycler}.\n *\n * @category common/data/recycler\n */\nexport interface RecyclerConfig {\n /** Scroll container. CSS selector, native element, or `ElementRef`. */\n scrollElement: ElementRef | HTMLElement | string;\n\n /**\n * Total number of items. Reactive - changes on infinite scroll.\n *\n * **Important:** For infinite scroll, this is the number of *loaded* items,\n * not the server-side total. Otherwise the sentinel becomes unreachable.\n */\n totalCount: () => number;\n\n /**\n * Estimated height per item (px). A fixed `number`, a `Signal<number>` for a\n * reactive uniform estimate (e.g. an `input()` bound after construction), or a\n * `(index) => number` for genuine per-index variable heights. Only the last\n * form carries per-frame cost; a signal resolves to one uniform value.\n */\n estimateSize: number | Signal<number> | ((index: number) => number);\n\n /** Extra items to render above/below the viewport. Default: 5. */\n overscan?: number;\n\n /**\n * Layout mode. `'list'` (default) uses padding spacers.\n * `'grid'` is Phase 3 - passing it logs a dev-mode warning and falls back to `'list'`.\n */\n layout?: 'list' | 'grid';\n\n /** Column count for grid mode. Phase 3 - ignored in Phase 1. */\n columns?: number | (() => number);\n\n /** Debounce for scroll events in ms. Default: 16 (~1 frame). */\n scrollDebounce?: number;\n\n /**\n * Delay before skeletons are shown (ms). Default: 0.\n * E.g. 300 means `showSkeleton` only becomes `true` after 300ms -\n * fast loads (< 300ms) never show a skeleton.\n */\n skeletonDelay?: number;\n\n /**\n * Async state source. When set, the recycler derives skeleton rendering,\n * refresh state, and empty state from it - same convention as\n * `CngxCardGrid`, `CngxTreetable`, `CngxPopoverPanel`, and `CngxDialog`.\n */\n state?: CngxAsyncState<unknown>;\n\n /**\n * Server-side total for A11y (`aria-setsize`) and \"Showing X of Y\" display.\n * When not set, `totalCount` is used.\n */\n serverTotal?: () => number;\n}\n\n/**\n * Signal-based virtualizer returned by {@link injectRecycler}.\n * All derived values are `computed()` - the system cannot become inconsistent.\n *\n * @category common/data/recycler\n */\nexport interface CngxRecycler {\n /** Start index (inclusive) of the rendered range, including overscan. */\n readonly start: Signal<number>;\n /** End index (exclusive) of the rendered range, including overscan. */\n readonly end: Signal<number>;\n\n /** Spacer height before rendered items (px). Always 0 in grid mode. */\n readonly offsetBefore: Signal<number>;\n /** Spacer height after rendered items (px). Always 0 in grid mode. */\n readonly offsetAfter: Signal<number>;\n /** Total scrollable height of all items (px). */\n readonly totalSize: Signal<number>;\n\n /** Placeholder count before rendered items. Only non-zero in grid mode. */\n readonly placeholdersBefore: Signal<number>;\n /** Placeholder count after rendered items. Only non-zero in grid mode. */\n readonly placeholdersAfter: Signal<number>;\n\n /** `true` during first load (`state.isFirstLoad()`). `false` without `state`. */\n readonly isLoading: Signal<boolean>;\n /** `true` during refresh (`state.isRefreshing()`). Data remains visible. */\n readonly isRefreshing: Signal<boolean>;\n /** `true` when `totalCount === 0` and not busy. */\n readonly isEmpty: Signal<boolean>;\n /** How many skeleton items fit in the viewport: `ceil(clientHeight / estimateSize)`. */\n readonly skeletonSlots: Signal<number>;\n /** `isLoading` AND `skeletonDelay` elapsed. Prevents skeleton flicker on fast loads. */\n readonly showSkeleton: Signal<boolean>;\n\n /** First actually visible index (without overscan). For UI display. */\n readonly firstVisible: Signal<number>;\n /** Last actually visible index (without overscan). For UI display. */\n readonly lastVisible: Signal<number>;\n /** Count of actually visible items (without overscan). */\n readonly visibleCount: Signal<number>;\n\n /**\n * Locks scroll position relative to an item. When items are inserted above\n * the anchored item, `scrollTop` is corrected to maintain visual position.\n */\n anchorTo(index: number): void;\n /** Releases the scroll anchor set by {@link anchorTo}. */\n releaseAnchor(): void;\n\n /**\n * Reports the index of the item that had focus when it left the rendered range.\n * `null` when no focus was lost. Consumer can use this to restore focus.\n */\n readonly lostFocus: Signal<{ index: number } | null>;\n\n /** SR announcement text for state transitions (load, filter, empty, error). */\n readonly announcement: Signal<string>;\n\n /** `serverTotal` when set, otherwise `totalCount`. Bind to `aria-setsize`. */\n readonly ariaSetSize: Signal<number>;\n\n /**\n * The range of item indices that must be available for rendering.\n * Use in an effect to trigger page loads for windowed/sparse data sources.\n *\n * Unlike `firstVisible`/`lastVisible` (which exclude overscan), this includes\n * overscan items - all indices in this range may be rendered.\n *\n * ```typescript\n * effect(() => {\n * const { start, end } = recycler.neededRange();\n * const startPage = Math.floor(start / PAGE_SIZE);\n * const endPage = Math.floor(end / PAGE_SIZE);\n * for (let p = startPage; p <= endPage; p++) {\n * if (!pageCache.has(p)) { loadPage(p); }\n * }\n * });\n * ```\n */\n readonly neededRange: Signal<{ start: number; end: number }>;\n\n /**\n * Target index that `scrollToIndex()` is waiting for.\n * Non-null when the target index exceeds `totalCount` - consumer\n * can show a \"Scrolling to item...\" indicator or trigger page loads.\n * Clears automatically when `totalCount` grows past the target.\n */\n readonly pendingTarget: Signal<number | null>;\n\n /**\n * Creates a `computed()` slicing items to the visible range.\n * **Call once in a field initializer** - each call creates a new computed node.\n * Do NOT call in templates or methods.\n */\n sliced<T>(items: Signal<T[]>): Signal<T[]>;\n\n /**\n * Reports a measured item height to the internal SizeCache.\n * No-op in grid mode (uniform row height assumed).\n * Prefer {@link CngxMeasure} directive over calling this directly.\n */\n measure(index: number, element: HTMLElement): void;\n\n /**\n * Scrolls to a specific item index. When `index >= totalCount`, stores\n * the target in {@link pendingTarget} for resolution when data arrives.\n */\n scrollToIndex(index: number, behavior?: ScrollBehavior): void;\n\n /** Scrolls to top. Convenience for sort/filter changes. */\n reset(): void;\n}\n\n/**\n * Inline equivalent of `createVisibilityTimer` from `@cngx/ui/feedback` (Level 4, not importable).\n *\n * Uses `setTimeout` inside an effect - this is a timer-driven side effect, not derived state.\n * Same pattern accepted in `createVisibilityTimer` for `CngxLoadingOverlay`.\n * Safe in zoneless: the `setTimeout` callback only writes a signal, which schedules\n * Angular's own change detection - no Zone.js dependency.\n *\n * @param source Boolean signal to delay. When `true`, starts the timer.\n * @param delayMs Delay in milliseconds before the flag becomes `true`.\n * @returns A readonly signal that becomes `true` after `delayMs` when `source` is `true`.\n * @internal\n */\nfunction createDelayedFlag(source: Signal<boolean>, delayMs: number): Signal<boolean> {\n if (delayMs <= 0) {\n return source;\n }\n const flag = signal(false);\n effect((onCleanup) => {\n const active = source();\n if (active) {\n const timer = setTimeout(() => flag.set(true), delayMs);\n onCleanup(() => {\n clearTimeout(timer);\n flag.set(false);\n });\n } else {\n flag.set(false);\n }\n });\n return flag.asReadonly();\n}\n\n/**\n * Creates a Signal-based virtualizer for DOM recycling.\n *\n * Must be called in an injection context (field initializer or constructor).\n * Internally injects `DestroyRef` and `DOCUMENT` for cleanup and selector resolution.\n *\n * ### Basic list\n * ```typescript\n * readonly recycler = injectRecycler({\n * scrollElement: '.scroll-container',\n * totalCount: () => this.items().length,\n * estimateSize: 48,\n * });\n * readonly visibleItems = this.recycler.sliced(this.items);\n * ```\n *\n * ### With async state\n * ```typescript\n * readonly state = injectAsyncState(() => this.api.getAll());\n * readonly recycler = injectRecycler({\n * scrollElement: '.scroll-container',\n * totalCount: () => (this.state.data() ?? []).length,\n * estimateSize: 64,\n * state: this.state,\n * });\n * ```\n *\n * @category common/data/recycler\n */\nexport function injectRecycler(config: RecyclerConfig): CngxRecycler {\n const destroyRef = inject(DestroyRef);\n const i18n = inject(CNGX_RECYCLER_I18N);\n const overscan = config.overscan ?? 5;\n const isGrid = (config.layout ?? 'list') === 'grid';\n\n if (isGrid && config.columns == null && isDevMode()) {\n console.error(\n '[CngxRecycler] layout: \"grid\" requires explicit `columns`. Falling back to columns=1.',\n );\n }\n\n // Reactive columns - reactive only if the function reads a Signal internally\n const columns = computed(() => {\n if (!isGrid || config.columns == null) {\n return 1;\n }\n return typeof config.columns === 'function' ? config.columns() : config.columns;\n });\n\n // A Signal is a zero-arg function but resolves to a uniform height, not a\n // per-index measurement - it carries no O(n) per-frame cost, so exclude it\n // from the variable-height warning (a reactive scalar estimate is a\n // sanctioned pattern; see the resolveSize note below).\n if (\n typeof config.estimateSize === 'function' &&\n !isSignal(config.estimateSize) &&\n isDevMode()\n ) {\n const count = config.totalCount();\n if (count > 10_000) {\n console.warn(\n `[CngxRecycler] estimateSize as a function with ${count} items has O(n) ` +\n `per-frame cost. Consider using a fixed estimateSize for large datasets.`,\n );\n }\n }\n\n const scrollState = createScrollObserver(config.scrollElement, destroyRef);\n\n const sizeCache = createSizeCache();\n\n // Resolve size for an index: measured value from cache, or estimateSize fallback.\n // Reading sizeCache.version() creates a reactive dependency so that range\n // recomputes when measurements change.\n const resolveSize = (index: number): number => {\n sizeCache.version(); // track dependency\n return sizeCache.resolve(index, config.estimateSize);\n };\n\n // Grid mode uses raw estimateSize (uniform row height, no SizeCache).\n // List mode uses resolveSize (SizeCache-backed).\n const range = computed(() => {\n const cols = columns();\n const size = isGrid ? config.estimateSize : resolveSize;\n return computeRange(\n scrollState.scrollTop(),\n scrollState.clientHeight(),\n config.totalCount(),\n size,\n overscan,\n cols,\n );\n });\n\n const start = computed(() => range().start);\n const end = computed(() => range().end);\n\n // Grid mode: pixel spacers are 0 (placeholders used instead)\n const offsetBefore = computed(() => (isGrid ? 0 : range().offsetBefore));\n const offsetAfter = computed(() => (isGrid ? 0 : range().offsetAfter));\n const totalSize = computed(() => range().totalSize);\n\n const placeholdersBefore = computed(() => (isGrid ? start() : 0));\n const placeholdersAfter = computed(() => (isGrid ? Math.max(0, config.totalCount() - end()) : 0));\n\n // start/end include overscan. firstVisible/lastVisible strip it back\n // to reflect the items actually in the viewport.\n // In grid mode, overscan is in rows (ceil(overscan/columns) * columns items).\n const effectiveOverscan = computed(() => {\n const cols = columns();\n if (cols <= 1) {\n return overscan;\n }\n return Math.ceil(overscan / cols) * cols;\n });\n\n const firstVisible = computed(() => {\n const total = config.totalCount();\n if (total === 0) {\n return 0;\n }\n return Math.min(start() + effectiveOverscan(), total - 1);\n });\n\n const lastVisible = computed(() => {\n const total = config.totalCount();\n if (total === 0) {\n return 0;\n }\n return Math.min(Math.max(0, end() - effectiveOverscan() - 1), total - 1);\n });\n\n const visibleCount = computed(() => {\n const total = config.totalCount();\n if (total === 0) {\n return 0;\n }\n return Math.max(0, lastVisible() - firstVisible() + 1);\n });\n\n const state = config.state;\n const isLoading = computed(() => state?.isFirstLoad() ?? false);\n const isRefreshing = computed(() => state?.isRefreshing() ?? false);\n\n const isEmpty = computed(() => {\n if (state?.isBusy()) {\n return false;\n }\n return config.totalCount() === 0;\n });\n\n const skeletonSlots = computed(() => {\n const ch = scrollState.clientHeight();\n if (ch <= 0) {\n return 0;\n }\n // Resolve estimateSize reactively - function variant may read signals internally\n const itemHeight =\n typeof config.estimateSize === 'number' ? config.estimateSize : config.estimateSize(0);\n return Math.ceil(ch / itemHeight);\n });\n\n const showSkeleton = createDelayedFlag(isLoading, config.skeletonDelay ?? 0);\n\n // previousTotal is a signal, not a mutable let - reactive, no stale-value risk.\n const announcementState = signal('');\n const previousTotal = signal(config.totalCount());\n\n if (state) {\n const tracker = createTransitionTracker(() => state.status());\n\n effect(() => {\n const current = tracker.current();\n const previous = tracker.previous();\n const total = config.totalCount();\n // untracked: previousTotal is bookkeeping, not a dependency -\n // the effect should fire on status/totalCount changes, not on its own writes.\n const prevTotal = untracked(() => previousTotal());\n\n // Transition-only - never announce on initial idle\n if (previous === current) {\n return;\n }\n\n if (current === 'success' && (previous === 'loading' || previous === 'refreshing')) {\n const diff = total - prevTotal;\n if (diff > 0) {\n announcementState.set(i18n.loaded(diff, total));\n } else {\n announcementState.set(i18n.filtered(total));\n }\n } else if (current === 'error') {\n announcementState.set(i18n.error());\n } else if (current === 'success' && total === 0) {\n announcementState.set(i18n.empty());\n }\n\n untracked(() => previousTotal.set(total));\n });\n } else {\n // Without async state, track totalCount changes for infinite scroll announcements\n effect(() => {\n const total = config.totalCount();\n // untracked: previousTotal is bookkeeping, not a dependency\n const prevTotal = untracked(() => previousTotal());\n const diff = total - prevTotal;\n\n if (prevTotal > 0 && diff > 0) {\n announcementState.set(i18n.loaded(diff, total));\n } else if (prevTotal > 0 && total === 0) {\n announcementState.set(i18n.empty());\n }\n\n untracked(() => previousTotal.set(total));\n });\n }\n\n const ariaSetSize = computed(() => config.serverTotal?.() ?? config.totalCount());\n\n const anchorState = signal<{ index: number; offsetFromTop: number } | null>(null);\n\n function computeItemTop(targetIndex: number, cols?: number): number {\n // Grid mode: row-based offset (uniform row height)\n if (isGrid && typeof config.estimateSize === 'number') {\n const c = cols ?? columns();\n return Math.floor(targetIndex / c) * config.estimateSize;\n }\n let top = 0;\n for (let i = 0; i < targetIndex; i++) {\n top += sizeCache.resolve(i, config.estimateSize);\n }\n return top;\n }\n\n // Anchor correction effect: when items shift above the anchored item,\n // correct scrollTop to keep it at the same visual position.\n effect(() => {\n const anchor = anchorState();\n if (!anchor) {\n return;\n }\n sizeCache.version(); // re-run when sizes change\n config.totalCount(); // re-run when items change\n const cols = columns(); // re-run when columns change (responsive grid)\n const el = scrollState.element();\n if (!el) {\n return;\n }\n const currentItemTop = computeItemTop(anchor.index, cols);\n const targetScrollTop = currentItemTop - anchor.offsetFromTop;\n if (Math.abs(el.scrollTop - targetScrollTop) > 1) {\n el.scrollTop = targetScrollTop;\n }\n });\n\n // Tracks which item has focus inside the scroll container.\n // Uses `data-cngx-recycle-index` attribute on items (set by CngxMeasure or consumer).\n // When a focused item leaves the visible range, `lostFocus` reports its index.\n const focusedIndex = signal<number | null>(null);\n\n effect((onCleanup) => {\n const el = scrollState.element();\n if (!el) {\n return;\n }\n const handleFocusIn = (e: FocusEvent): void => {\n const target = (e.target as HTMLElement).closest('[data-cngx-recycle-index]');\n if (target) {\n focusedIndex.set(Number(target.getAttribute('data-cngx-recycle-index')));\n }\n };\n const handleFocusOut = (): void => {\n focusedIndex.set(null);\n };\n el.addEventListener('focusin', handleFocusIn);\n el.addEventListener('focusout', handleFocusOut);\n onCleanup(() => {\n el.removeEventListener('focusin', handleFocusIn);\n el.removeEventListener('focusout', handleFocusOut);\n });\n });\n\n const lostFocus = computed(() => {\n const fi = focusedIndex();\n if (fi == null) {\n return null;\n }\n const s = start();\n const e = end();\n if (fi < s || fi >= e) {\n return { index: fi };\n }\n return null;\n });\n\n const neededRange = computed(() => ({ start: start(), end: end() }));\n\n const pendingScrollTarget = signal<{ index: number; behavior: ScrollBehavior } | null>(null);\n const pendingTarget = computed(() => pendingScrollTarget()?.index ?? null);\n\n // Watch totalCount - when it grows past the pending target, execute the scroll.\n // Uses untracked() for pendingScrollTarget reads/writes to avoid write-inside-read loops.\n // Only totalCount is a tracked dependency.\n effect(() => {\n const total = config.totalCount(); // tracked dependency\n const target = untracked(() => pendingScrollTarget()); // NOT tracked\n if (!target || target.index >= total) {\n return;\n }\n untracked(() => {\n pendingScrollTarget.set(null);\n const el = scrollState.element();\n if (el) {\n const top = computeItemTop(target.index);\n el.scrollTo({ top, behavior: target.behavior });\n }\n });\n });\n\n return {\n start,\n end,\n offsetBefore,\n offsetAfter,\n totalSize,\n\n placeholdersBefore,\n placeholdersAfter,\n\n isLoading,\n isRefreshing,\n isEmpty,\n skeletonSlots,\n showSkeleton,\n\n firstVisible,\n lastVisible,\n visibleCount,\n\n anchorTo(index: number): void {\n const el = scrollState.element();\n if (!el) {\n return;\n }\n const itemTop = computeItemTop(index);\n anchorState.set({ index, offsetFromTop: itemTop - el.scrollTop });\n },\n\n releaseAnchor(): void {\n anchorState.set(null);\n },\n\n lostFocus,\n\n pendingTarget,\n neededRange,\n\n announcement: announcementState.asReadonly(),\n\n ariaSetSize,\n\n sliced<T>(items: Signal<T[]>): Signal<T[]> {\n return computed(() => items().slice(start(), end()));\n },\n\n measure(index: number, element: HTMLElement): void {\n // Grid mode assumes uniform row height - SizeCache writes would break row-based range.\n if (isGrid) {\n return;\n }\n const height = element.getBoundingClientRect().height;\n if (height > 0) {\n sizeCache.set(index, height);\n }\n },\n\n scrollToIndex(index: number, behavior: ScrollBehavior = 'auto'): void {\n const total = config.totalCount();\n if (index >= total) {\n // Deep-link: target not loaded yet - store for later resolution\n pendingScrollTarget.set({ index, behavior });\n return;\n }\n pendingScrollTarget.set(null);\n const el = scrollState.element();\n if (el) {\n el.scrollTo({ top: computeItemTop(index), behavior });\n }\n },\n\n reset(): void {\n const el = scrollState.element();\n if (el) {\n el.scrollTop = 0;\n }\n },\n };\n}\n","import { Directive, ElementRef, effect, inject, input } from '@angular/core';\n\nimport type { CngxRecycler } from './recycler';\n\n/**\n * Atom directive that measures the host element's height and reports it\n * to the recycler via `recycler.measure(index, element)`.\n *\n * Uses `ResizeObserver` to detect height changes (e.g. content expansion,\n * font loading). Cleanup is automatic via `DestroyRef`.\n *\n * Also sets `data-cngx-recycle-index` on the host element for focus tracking.\n *\n * ```html\n * @for (item of visibleItems(); track item.id; let i = $index) {\n * <div [cngxMeasure]=\"recycler\" [cngxMeasureIndex]=\"recycler.start() + i\">\n * {{ item.content }}\n * </div>\n * }\n * ```\n *\n * @category common/data/recycler\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/recycler/measure.directive.ts\n * @since 0.1.0\n * @relatedTo CngxVirtualItem, CngxRecyclerAnnouncer, injectRecycler\n *\n * <example-url>http://localhost:4200/#/common/data/recycler/basic-list-fixed-item-height</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/content-visibility-css-only</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/infinite-scroll-recycler</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/scrolltoindex-deep-link</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/variable-heights-cngxmeasure</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/with-cngxasyncstate-skeleton-first-load</example-url>\n */\n@Directive({\n selector: '[cngxMeasure]',\n standalone: true,\n host: {\n '[attr.data-cngx-recycle-index]': 'cngxMeasureIndex()',\n },\n})\nexport class CngxMeasure {\n /** The recycler instance to report measurements to. */\n readonly cngxMeasure = input.required<CngxRecycler>();\n\n /** The absolute index of this item in the full dataset. */\n readonly cngxMeasureIndex = input.required<number>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n\n constructor() {\n effect((onCleanup) => {\n const recycler = this.cngxMeasure();\n const index = this.cngxMeasureIndex();\n const element = this.el.nativeElement as HTMLElement;\n\n recycler.measure(index, element);\n\n const observer = new ResizeObserver(() => {\n recycler.measure(index, element);\n });\n observer.observe(element);\n\n onCleanup(() => {\n observer.disconnect();\n });\n });\n }\n}\n","import { Directive, computed, input } from '@angular/core';\n\nimport type { CngxRecycler } from './recycler';\n\n/**\n * A11y atom that sets `aria-setsize`, `aria-posinset`, and `data-cngx-recycle-index`\n * on each rendered virtual item. Replaces manual ARIA boilerplate.\n *\n * Also provides `data-cngx-recycle-index` for focus tracking - consumers who\n * don't use `CngxMeasure` (grid mode, uniform heights) get focus tracking for free.\n *\n * Does NOT set `role` - the consumer decides (`listitem`, `option`, `treeitem`, `tab`).\n *\n * ```html\n * @for (item of visibleItems(); track item.id; let i = $index) {\n * <div role=\"listitem\"\n * [cngxVirtualItem]=\"recycler\"\n * [cngxVirtualItemIndex]=\"recycler.start() + i\">\n * {{ item.name }}\n * </div>\n * }\n * ```\n *\n * @category common/data/recycler\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/recycler/virtual-item.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMeasure, CngxRecyclerAnnouncer, injectRecycler\n *\n * <example-url>http://localhost:4200/#/common/data/recycler/basic-list-fixed-item-height</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/content-visibility-css-only</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/infinite-scroll-recycler</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/scrolltoindex-deep-link</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/variable-heights-cngxmeasure</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/with-cngxasyncstate-skeleton-first-load</example-url>\n */\n@Directive({\n selector: '[cngxVirtualItem]',\n standalone: true,\n host: {\n '[attr.aria-setsize]': 'ariaSetSize()',\n '[attr.aria-posinset]': 'ariaPosinset()',\n '[attr.data-cngx-recycle-index]': 'cngxVirtualItemIndex()',\n },\n})\nexport class CngxVirtualItem {\n /** The recycler instance providing `ariaSetSize`. */\n readonly cngxVirtualItem = input.required<CngxRecycler>();\n\n /** The absolute 0-based index of this item in the full dataset. */\n readonly cngxVirtualItemIndex = input.required<number>();\n\n /** Total item count for `aria-setsize`. */\n protected readonly ariaSetSize = computed(() => this.cngxVirtualItem().ariaSetSize());\n\n /** 1-based position for `aria-posinset`. */\n protected readonly ariaPosinset = computed(() => this.cngxVirtualItemIndex() + 1);\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\nimport type { CngxRecycler } from './recycler';\n\n/**\n * Convenience component that renders the `aria-live=\"polite\"` region\n * for recycler SR announcements. Eliminates manual boilerplate.\n *\n * Uses `display: contents` - no layout impact.\n *\n * ```html\n * <cngx-recycler-announcer [cngxRecyclerAnnouncer]=\"recycler\" />\n * ```\n *\n * @category common/data/recycler\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/recycler/recycler-announcer.component.ts\n * @since 0.1.0\n * @relatedTo CngxMeasure, CngxVirtualItem, injectRecycler, CNGX_RECYCLER_I18N\n *\n * <example-url>http://localhost:4200/#/common/data/recycler/basic-list-fixed-item-height</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/content-visibility-css-only</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/infinite-scroll-recycler</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/scrolltoindex-deep-link</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/variable-heights-cngxmeasure</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/with-cngxasyncstate-skeleton-first-load</example-url>\n */\n@Component({\n selector: 'cngx-recycler-announcer',\n standalone: true,\n template: `<span aria-live=\"polite\" aria-atomic=\"true\" class=\"cngx-sr-only\">{{\n recycler().announcement()\n }}</span>`,\n host: { style: 'display: contents' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CngxRecyclerAnnouncer {\n /** The recycler instance providing `announcement()`. */\n readonly recycler = input.required<CngxRecycler>({ alias: 'cngxRecyclerAnnouncer' });\n}\n","import { ElementRef, effect, inject, untracked } from '@angular/core';\n// type-only: instance is passed in by the consumer via inject(..., { host: true })\nimport type { CngxRovingTabindex } from '@cngx/common/a11y';\n\nimport type { CngxRecycler } from './recycler';\n\n/**\n * Wires a `CngxRecycler` to a `CngxRovingTabindex` in virtual mode.\n *\n * When the roving tabindex navigates to an item that is not in the DOM\n * (out of rendered range), this function scrolls the recycler to that item\n * and focuses it after rendering.\n *\n * Must be called in an injection context (constructor or field initializer)\n * **on the component that hosts both the recycler's scroll container and the\n * `CngxRovingTabindex` directive**. The injected `ElementRef` is used to query\n * `[data-cngx-recycle-index]` — calling from a child component would query the\n * wrong subtree.\n *\n * ```typescript\n * @Component({\n * hostDirectives: [\n * { directive: CngxRovingTabindex, inputs: ['orientation', 'activeIndex', 'virtualCount'] },\n * ],\n * })\n * class MyVirtualList {\n * private readonly roving = inject(CngxRovingTabindex, { host: true });\n * readonly recycler = injectRecycler({ ... });\n *\n * constructor() {\n * connectRecyclerToRoving(this.recycler, this.roving);\n * }\n * }\n * ```\n *\n * @category common/data/recycler\n */\nexport function connectRecyclerToRoving(recycler: CngxRecycler, roving: CngxRovingTabindex): void {\n const hostEl = inject(ElementRef).nativeElement as HTMLElement;\n\n // Debounce scrollToIndex via rAF to avoid scroll jitter on rapid keypresses.\n // Each keypress overwrites pendingFocus — only the latest target is scrolled to.\n let scrollRafId: number | null = null;\n\n effect((onCleanup) => {\n const target = roving.pendingFocus();\n if (target == null) {\n return;\n }\n if (scrollRafId != null) {\n cancelAnimationFrame(scrollRafId);\n }\n scrollRafId = requestAnimationFrame(() => {\n scrollRafId = null;\n // Re-read to get the latest target (rapid keypresses may have updated it).\n const latest = roving.pendingFocus();\n if (latest != null) {\n recycler.scrollToIndex(latest);\n }\n });\n onCleanup(() => {\n if (scrollRafId != null) {\n cancelAnimationFrame(scrollRafId);\n scrollRafId = null;\n }\n });\n });\n\n // When the recycler's range changes and the pending target is within range,\n // wait for the DOM to update (rAF), then query and focus the element.\n let focusRafId: number | null = null;\n\n effect((onCleanup) => {\n const s = recycler.start();\n const e = recycler.end();\n const target = untracked(() => roving.pendingFocus());\n if (target == null || target < s || target >= e) {\n return;\n }\n\n // Target is within rendered range — DOM will be updated after CD.\n // Use rAF to wait for Angular's rendering pass to complete.\n focusRafId = requestAnimationFrame(() => {\n focusRafId = null;\n // Re-read pendingFocus in case it changed during the frame (rapid keypresses).\n const currentTarget = roving.pendingFocus();\n if (currentTarget == null) {\n return;\n }\n const el = hostEl.querySelector(`[data-cngx-recycle-index=\"${currentTarget}\"]`);\n if (el instanceof HTMLElement) {\n el.focus();\n roving.clearPendingFocus();\n }\n });\n\n onCleanup(() => {\n if (focusRafId != null) {\n cancelAnimationFrame(focusRafId);\n focusRafId = null;\n }\n });\n });\n}\n","import { effect, untracked } from '@angular/core';\n\n// type-only: passed in by the consumer at runtime, so @cngx/common/data\n// avoids a value-level dep on a11y\nimport type { CngxActiveDescendant } from '@cngx/common/a11y';\n\nimport type { CngxRecycler } from './recycler';\n\n/**\n * Wires a {@link CngxRecycler} to a {@link CngxActiveDescendant} in\n * virtual mode.\n *\n * When the AD directive navigates to an item whose index is not in the\n * recycler's rendered range, it sets `pendingHighlight` (via the\n * `virtualCount` path). This helper watches that signal and scrolls\n * the recycler to the target index; AD's own effect observes the\n * resulting DOM update and clears the pending state automatically\n * (see the `pendingHighlightState.set(null)` branch in\n * `CngxActiveDescendant` after a re-render brings the target into the\n * rendered range).\n *\n * Unlike {@link /projects/common/data/src/recycler/connect-recycler-roving.ts\n * connectRecyclerToRoving}, we don't re-focus a DOM element after the\n * scroll — AD doesn't move real focus, it only rebinds\n * `aria-activedescendant`. Once the target index enters the rendered\n * range, the `[attr.aria-activedescendant]` binding on the combobox\n * trigger resolves to the now-present option element for free.\n *\n * Must be called in an injection context (typically a component\n * constructor) on the same component that owns both the recycler\n * and the AD directive.\n *\n * ```typescript\n * @Component({\n * hostDirectives: [\n * { directive: CngxActiveDescendant, inputs: ['items', 'virtualCount'] },\n * ],\n * })\n * class MyVirtualSelect {\n * private readonly ad = inject(CngxActiveDescendant, { host: true });\n * readonly recycler = injectRecycler({ ... });\n *\n * constructor() {\n * connectRecyclerToActiveDescendant(this.recycler, this.ad);\n * }\n * }\n * ```\n *\n * @category common/data/recycler\n */\nexport function connectRecyclerToActiveDescendant(\n recycler: CngxRecycler,\n ad: CngxActiveDescendant,\n): void {\n // rAF-debounced: held ArrowDown otherwise enqueues one scroll per keystroke.\n // Each new pending target overwrites the previous rAF, only the latest lands.\n let scrollRafId: number | null = null;\n\n effect((onCleanup) => {\n const target = ad.pendingHighlight();\n if (target == null) {\n return;\n }\n if (scrollRafId != null) {\n cancelAnimationFrame(scrollRafId);\n }\n scrollRafId = requestAnimationFrame(() => {\n scrollRafId = null;\n // re-read inside the frame so the latest target wins if the user kept typing\n const latest = untracked(() => ad.pendingHighlight());\n if (latest != null) {\n recycler.scrollToIndex(latest);\n }\n });\n onCleanup(() => {\n if (scrollRafId != null) {\n cancelAnimationFrame(scrollRafId);\n scrollRafId = null;\n }\n });\n });\n}\n","import { computed, signal, type Signal } from '@angular/core';\n\nimport { createManualState, type ManualAsyncState } from '../async-state';\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Cancel handle returned by a {@link CngxCommitRunner}. The controller\n * stores it on every `begin(...)` and calls `cancel()` synchronously\n * when a newer commit supersedes it. Action runtimes (RxJS subscription\n * teardown, AbortController abort, plain flag) implement the handle\n * however they need.\n *\n * @category common/data/commit\n */\nexport interface CngxCommitHandle {\n readonly cancel: () => void;\n}\n\n/**\n * Action runner contract. Receives the controller's success/error\n * routes and returns a cancel handle. The runner is opaque to the\n * controller — it can wrap any async source (Observable, Promise,\n * sync value) and any cancellation primitive.\n *\n * Variants supply their own runner adapter (e.g. select's\n * `runCommitAction` invokes a `CngxSelectCommitAction<T>`; stepper's\n * runner adapts a `CngxStepperCommitAction`); the controller has no\n * knowledge of the variant-specific action shape.\n *\n * @category common/data/commit\n */\nexport type CngxCommitRunner<T> = (handlers: {\n readonly onSuccess: (committed: T | undefined) => void;\n readonly onError: (err: unknown) => void;\n}) => CngxCommitHandle;\n\n/**\n * Outcome handlers passed to `controller.begin(...)`. The controller\n * invokes exactly one of `onSuccess` / `onError` per commit lifecycle\n * (unless the commit is superseded, in which case neither fires).\n *\n * @category common/data/commit\n */\nexport interface CngxCommitBeginHandlers<T> {\n readonly onSuccess: (committed: T | undefined) => void;\n readonly onError: (err: unknown, previous: T | undefined) => void;\n}\n\n/**\n * Encapsulated state machine for the async-commit lifecycle shared by\n * every cngx feature that has a \"perform-an-async-write-then-update-\n * the-source-signal\" flow (select family, stepper, future wizards).\n *\n * Owns:\n * - the `CngxAsyncState<T | undefined>` slot consumed by `CNGX_STATEFUL`\n * bridges, commit-error templates, and the pending-row spinner;\n * - begin / cancel orchestration with monotonic supersede semantics;\n * - the \"intended value\" signal that drives the pending-spinner on\n * the specific row / step the user just clicked.\n *\n * The controller is intentionally **not** an Angular service or\n * provider. It's a plain factory so it works in any injection context\n * (including outside Angular, for headless tests).\n *\n * @category common/data/commit\n */\nexport interface CngxCommitController<T> {\n /** Read-only async-state view of the commit lifecycle. */\n readonly state: CngxAsyncState<T | undefined>;\n\n /** `true` while a commit is in flight. */\n readonly isCommitting: Signal<boolean>;\n\n /**\n * The most recent intended value — what the user was trying to\n * commit. Used by the option-row spinner and the commit-error\n * template context to identify *which* option the failure belongs\n * to.\n */\n readonly intendedValue: Signal<T | undefined>;\n\n /**\n * Start a new commit. Supersedes any in-flight commit: the\n * previous runner's cancel handle fires synchronously, and the\n * previous outcome callbacks become no-ops if they fire late.\n *\n * @param runner variant-specific action runner (closes over the\n * action and the intended value)\n * @param intended the value the user clicked\n * @param previous the value to roll back to on error\n * @param handlers success/error routes — the controller only\n * updates its own state and calls these; it does\n * NOT touch external value signals, panel open\n * state, or component outputs.\n */\n begin(\n runner: CngxCommitRunner<T>,\n intended: T | undefined,\n previous: T | undefined,\n handlers: CngxCommitBeginHandlers<T>,\n ): void;\n\n /**\n * Abort the currently in-flight commit without firing callbacks.\n * Use when the host component is destroyed or the commit-action\n * input changes mid-flight.\n */\n cancel(): void;\n}\n\n/**\n * Factory for the commit controller.\n *\n * Plain function, not a class — matches the rest of the repo\n * (`createManualState`, `createAsyncState`, `createTransitionTracker`).\n * See `reference_api_prefix_convention.md`.\n *\n * @category common/data/commit\n */\nexport function createCommitController<T>(): CngxCommitController<T> {\n // read-only `state` view; consumers can't flip status directly\n const slot: ManualAsyncState<T | undefined> =\n createManualState<T | undefined>();\n\n // monotonic supersede id; stale callbacks compare captured id against this\n let commitId = 0;\n\n let active: CngxCommitHandle | null = null;\n\n // drives the pending spinner on the specific row the user clicked\n const intendedState = signal<T | undefined>(undefined);\n\n return {\n state: slot,\n isCommitting: computed(() => slot.isPending()),\n intendedValue: intendedState.asReadonly(),\n\n begin(runner, intended, previous, handlers) {\n // tear down previous runner BEFORE bumping commitId, otherwise its\n // supersede-check would pass and fire after all\n active?.cancel();\n const id = ++commitId;\n intendedState.set(intended);\n slot.set('pending');\n\n active = runner({\n onSuccess: (committed) => {\n if (id !== commitId) {\n return;\n }\n slot.setSuccess(committed);\n active = null;\n handlers.onSuccess(committed);\n },\n onError: (err) => {\n if (id !== commitId) {\n return;\n }\n slot.setError(err);\n active = null;\n handlers.onError(err, previous);\n },\n });\n },\n\n cancel() {\n active?.cancel();\n active = null;\n // bump id so late callbacks from the aborted runner are superseded\n commitId++;\n },\n };\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { createCommitController, type CngxCommitController } from './commit-controller';\n\n/**\n * Factory signature for producing {@link CngxCommitController}\n * instances. Consumers override the DI token\n * {@link CNGX_COMMIT_CONTROLLER_FACTORY} with a custom factory to\n * inject retry-with-backoff, offline queues, telemetry, or any\n * other enterprise-specific commit lifecycle - without forking the\n * features that consume it (select family, stepper, future wizards).\n *\n * @category common/data/commit\n */\nexport type CngxCommitControllerFactory = <T>() => CngxCommitController<T>;\n\n/**\n * DI token carrying the factory that every cngx feature uses to\n * allocate its commit controller. Default `providedIn: 'root'`\n * factory returns {@link createCommitController}. Override globally\n * via app providers or per-component via `viewProviders`.\n *\n * Symmetrical to `CNGX_SELECT_COMMIT_CONTROLLER_FACTORY`\n * (`@cngx/forms/select`); the select-side token's default factory\n * delegates to this one, so a single override here cascades into\n * every select variant transparently.\n *\n * ```ts\n * bootstrapApplication(App, {\n * providers: [\n * {\n * provide: CNGX_COMMIT_CONTROLLER_FACTORY,\n * useValue: <T>() => createRetryingCommitController<T>({ attempts: 3 }),\n * },\n * ],\n * });\n * ```\n *\n * @category common/data/commit\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/commit/commit-controller.token.ts\n * @since 0.1.0\n */\nexport const CNGX_COMMIT_CONTROLLER_FACTORY = new InjectionToken<CngxCommitControllerFactory>(\n 'CngxCommitControllerFactory',\n {\n providedIn: 'root',\n factory: () => createCommitController,\n },\n);\n","import {\n type DestroyRef,\n effect,\n type Injector,\n runInInjectionContext,\n type Signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { Observable } from 'rxjs';\n\n/**\n * Options for {@link createMaterialBidirectionalSync}.\n *\n * Material types never enter this surface. The caller maps Material's\n * own event/property shape to a host-agnostic `Signal<number>` /\n * `Observable<number>` / getter / setter at the directive boundary. \\\n * That keeps `@cngx/common/data` independent of `@angular/material`.\n *\n * @category common/data/material-bridge\n */\nexport interface CngxMaterialBidirectionalSyncOptions {\n /**\n * Reactive source for the presenter's current index. The factory's\n * `effect()` tracks this signal — when it changes, Material is\n * written (subject to the equality guard against the Material\n * read-side).\n */\n readonly presenterIndex: Signal<number>;\n\n /**\n * Pulls the Material instance's current `selectedIndex` (or\n * equivalent). Called inside `untracked()` so the effect does not\n * subscribe to any signals the getter might read internally.\n */\n readonly readSelectedIndex: () => number;\n\n /**\n * Writes the Material instance's `selectedIndex` (or equivalent).\n * Called inside `untracked()` per\n * `reference_signal_architecture` rule 2.\n */\n readonly writeSelectedIndex: (idx: number) => void;\n\n /**\n * Stream of Material-driven selection changes, already mapped to a\n * plain index by the caller (`MatTabGroup.selectedIndexChange`\n * forwards directly; `MatStepper.selectionChange` needs\n * `.pipe(map(e => e.selectedIndex))`).\n */\n readonly selectionChange$: Observable<number>;\n\n /**\n * Routes a Material→presenter selection event into the presenter's\n * `select(idx)` method. Subject to an equality guard against\n * `presenterIndex()` so re-entrant events (the presenter's own\n * write firing back through Material) drop without re-routing.\n */\n readonly onMaterialSelection: (idx: number) => void;\n\n /** Injector used to install the effect inside an injection context. */\n readonly injector: Injector;\n\n /** DestroyRef used to clean up the effect and the subscription. */\n readonly destroyRef: DestroyRef;\n}\n\n/**\n * Handle returned by {@link createMaterialBidirectionalSync}.\n *\n * @category common/data/material-bridge\n */\nexport interface CngxMaterialBidirectionalSyncHandle {\n /**\n * Force Material's selected index to the presenter's current index,\n * routed through the factory's self-echo suppression so it never\n * re-enters the Material→presenter path. Hosts call this from their\n * commit lifecycle when a pessimistic commit settles WITHOUT advancing\n * the presenter (a rejected switch), which leaves Material eager-\n * advanced on the refused tab. A no-op when already in sync.\n */\n readonly reconcile: () => void;\n}\n\n/**\n * Single shared bidirectional-sync factory for cngx organisms /\n * directives that bridge a cngx presenter against a Material parent\n * (`<mat-tab-group>`, `<mat-stepper>`, etc.).\n *\n * Lives at Level 2 in `@cngx/common/data` parallel to\n * `createCommitController`. Material types never enter the signature —\n * the caller maps Material-specific events and property accessors to a\n * host-agnostic shape at the directive boundary.\n *\n * Installs:\n *\n * 1. A presenter→Material `effect()` that tracks `presenterIndex` and\n * writes through `writeSelectedIndex`, equality-guarded against\n * `readSelectedIndex()` to suppress redundant writes. The Material\n * read+write pair runs inside `untracked()` per\n * `reference_signal_architecture` rule 2.\n * 2. A Material→presenter subscription that forwards each\n * `selectionChange$` emission to `onMaterialSelection`\n * (equality-guarded against `presenterIndex()` so a Material event\n * whose value already matches the presenter is dropped — closes\n * the re-entrancy loop).\n *\n * Both sides clean up via `destroyRef`.\n *\n * **Material-eager-advance reconciliation.** Material's MDC click\n * handler advances `selectedIndex` *before* the Material→presenter\n * subscription forwards the click. When the presenter HOLDS its index\n * (pessimistic mode + bound `commitAction`), the subscriber does NOT\n * write Material back: on a SUCCESSFUL commit the presenter later\n * advances to the clicked target and Material is already there, so the\n * mirror effect is a no-op (no flash); on a REJECTED commit the presenter\n * never moves, leaving Material eager-advanced on the refused tab. The\n * host detects the rejection through its own commit lifecycle and calls\n * {@link CngxMaterialBidirectionalSyncHandle.reconcile} to snap Material\n * back. Writing from inside the subscriber instead is unsafe: Material's\n * `selectedIndex` read-back lags a programmatic write, so the mirror\n * effect's equality guard reads a stale value and skips the corrective\n * write, sticking the visual on the wrong tab.\n *\n * **Self-echo suppression (loop-safety).** Every programmatic\n * `selectedIndex` write makes Material re-emit `selectionChange`. The\n * factory records each value it writes and drops the matching echo\n * (`indexOf` + splice, which also prunes earlier writes whose echo\n * Material coalesced away) before any other processing. This is\n * load-bearing for an ASYNC commit-action: Material emits the echo a\n * microtask later, by which point the commit may have advanced\n * `presenterIndex`, so an equality-only guard (`presenterIndex() ===\n * idx`) would FAIL to drop the echo — it would re-enter the subscriber\n * and ping-pong against the in-flight navigation (the demo freezes).\n * Matching the echo by the value we wrote drops it regardless of where\n * the presenter has moved.\n *\n * @category common/data/material-bridge\n */\nexport function createMaterialBidirectionalSync(\n opts: CngxMaterialBidirectionalSyncOptions,\n): CngxMaterialBidirectionalSyncHandle {\n const {\n presenterIndex,\n readSelectedIndex,\n writeSelectedIndex,\n selectionChange$,\n onMaterialSelection,\n injector,\n destroyRef,\n } = opts;\n\n // Indices WE wrote into Material, awaiting their echo. Material\n // re-emits `selectionChange` for every programmatic `selectedIndex`\n // write, so each of our writes produces an echo that must NOT be\n // treated as a user selection. Equality against `presenterIndex()`\n // alone is insufficient: with an async commit-action the presenter may\n // have advanced by the time the echo arrives, so the echo no longer\n // equality-drops and would re-enter the subscriber. `indexOf` + splice\n // drops the echo by the value we wrote (and prunes any earlier write\n // whose echo Material coalesced away), regardless of where the\n // presenter has since moved - the loop can never form.\n const selfEchoes: number[] = [];\n const writeMaterial = (idx: number): void => {\n selfEchoes.push(idx);\n writeSelectedIndex(idx);\n };\n\n runInInjectionContext(injector, () => {\n effect(() => {\n const desired = presenterIndex();\n untracked(() => {\n if (readSelectedIndex() === desired) {\n return;\n }\n writeMaterial(desired);\n });\n });\n });\n\n selectionChange$.pipe(takeUntilDestroyed(destroyRef)).subscribe((idx) => {\n // Drop our own write-echo (and any coalesced-away earlier write).\n const echoAt = selfEchoes.indexOf(idx);\n if (echoAt !== -1) {\n selfEchoes.splice(0, echoAt + 1);\n return;\n }\n if (presenterIndex() === idx) {\n return;\n }\n onMaterialSelection(idx);\n // No write-back here. Material eager-advanced to the clicked tab; in\n // pessimistic mode the presenter HOLDS at origin, so on SUCCESS the\n // presenter later advances to this target and Material is already\n // there (no flash, no fight with Material's async `selectedIndex`).\n // On REJECTION the presenter never moves, leaving Material diverged -\n // the host detects that and calls `reconcile()` from its commit\n // lifecycle. Writing here while the commit is in flight is unsafe:\n // Material's `selectedIndex` read-back lags a programmatic write, so\n // the mirror effect's equality guard reads a stale value and skips\n // the corrective write (the visual sticks on the wrong tab).\n });\n\n return {\n reconcile: () => {\n writeMaterial(presenterIndex());\n },\n };\n}\n","/**\n * @module @cngx/common/data\n */\nexport { CngxSort, type SortEntry } from './sort/sort.directive';\nexport { CngxSortHeader } from './sort/sort-header.directive';\nexport { createSortHeaderState, type SortHeaderState } from './sort/sort-header-state';\nexport { CngxFilter } from './filter/filter.directive';\nexport {\n CngxFilterChips,\n CngxFilterChip,\n type CngxFilterChipContext,\n} from './filter-chips/filter-chips.component';\nexport { CngxPaginate } from './paginate/paginate.directive';\nexport { CngxPaginateResetOn, connectPaginateResetOn } from './paginate/paginate-reset.directive';\nexport { connectPaginateEmit, type CngxPaginateEmitHandlers } from './paginate/paginate-emit';\nexport { CngxPaginateRouting } from './paginate/paginate-routing.directive';\nexport { CngxBucketPaginate, type CngxBucket } from './paginate/bucket-paginate.directive';\nexport {\n CNGX_BUCKET_PAGINATE_HOST,\n type CngxBucketPaginateHost,\n type CngxBucketPaginateView,\n} from './paginate/bucket-paginate-host.token';\nexport { CngxDataSource, injectDataSource } from './data-source/data-source';\nexport {\n CngxSmartDataSource,\n injectSmartDataSource,\n type CngxSmartDataSourceOptions,\n} from './data-source/smart-data-source';\n\n// Re-export the curated async-state sub-barrel wholesale so additions there\n// (e.g. fromResource / fromHttpResource / tapAsyncState) cannot silently drop\n// out of `@cngx/common/data`.\nexport * from './async-state';\n\nexport { CngxAsync, type CngxAsyncContext } from './async/async.directive';\n\nexport { CngxMetric } from './display/metric/metric.component';\nexport { CngxTrend } from './display/trend/trend.component';\nexport { CngxDelta } from './display/delta/delta.component';\nexport { type DeltaPolarity, type DeltaMode } from './display/shared/delta-format';\nexport { CngxStat } from './display/stat/stat.component';\nexport {\n CngxStatLabel,\n CngxStatValue,\n CngxStatDelta,\n CngxStatCaption,\n} from './display/stat/stat-slots';\nexport { CNGX_STAT, type CngxStatRegistry, type CngxStatSlotKind } from './display/stat/stat.token';\nexport { CngxStatus, type StatusTone } from './display/status/status.component';\nexport { CngxGoal } from './display/goal/goal.component';\n\nexport {\n injectRecycler,\n provideRecyclerI18n,\n CNGX_RECYCLER_I18N,\n type RecyclerConfig,\n type CngxRecycler,\n type RecyclerI18n,\n} from './recycler/recycler';\nexport { CngxMeasure } from './recycler/measure.directive';\nexport { CngxVirtualItem } from './recycler/virtual-item.directive';\nexport { CngxRecyclerAnnouncer } from './recycler/recycler-announcer.component';\nexport { connectRecyclerToRoving } from './recycler/connect-recycler-roving';\nexport { connectRecyclerToActiveDescendant } from './recycler/connect-recycler-active-descendant';\n\n// Commit controller — generic async-commit state machine shared by\n// the select family and the stepper / wizard family.\nexport {\n createCommitController,\n type CngxCommitController,\n type CngxCommitBeginHandlers,\n type CngxCommitHandle,\n type CngxCommitRunner,\n CNGX_COMMIT_CONTROLLER_FACTORY,\n type CngxCommitControllerFactory,\n} from './commit';\n\n// Material bidirectional sync — shared factory consumed by cngx\n// organisms / directives that bridge a cngx presenter against a\n// Material parent (`<mat-tab-group>`, `<mat-stepper>`, etc.).\n// Material types never enter the signature; the caller maps at the\n// directive boundary so `@cngx/common/data` stays Sheriff-Level-2\n// compliant (no `@angular/material` import).\nexport {\n createMaterialBidirectionalSync,\n type CngxMaterialBidirectionalSyncOptions,\n type CngxMaterialBidirectionalSyncHandle,\n} from './material-bridge/bidirectional-sync';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;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;"}
1
+ {"version":3,"file":"cngx-common-data.mjs","sources":["../../../projects/common/data/sort/sort.directive.ts","../../../projects/common/data/sort/sort-header-state.ts","../../../projects/common/data/sort/sort-header.directive.ts","../../../projects/common/data/filter/filter.directive.ts","../../../projects/common/data/filter-chips/filter-chips.component.ts","../../../projects/common/data/paginate/paginate.directive.ts","../../../projects/common/data/paginate/paginate-reset.directive.ts","../../../projects/common/data/paginate/paginate-emit.ts","../../../projects/common/data/paginate/paginate-routing.directive.ts","../../../projects/common/data/paginate/bucket-paginate-host.token.ts","../../../projects/common/data/paginate/bucket-paginate.directive.ts","../../../projects/common/data/data-source/data-source.ts","../../../projects/common/data/data-source/smart-data-source.ts","../../../projects/common/data/async-state/create-manual-state.ts","../../../projects/common/data/async-state/create-async-state.ts","../../../projects/common/data/async-registry/async-registry.ts","../../../projects/common/data/async-registry/provide-async-registry.ts","../../../projects/common/data/async-state/inject-async-state.ts","../../../projects/common/data/async-state/resolve-view.ts","../../../projects/common/data/async-state/from-resource.ts","../../../projects/common/data/async-state/from-http-resource.ts","../../../projects/common/data/async-state/operators.ts","../../../projects/common/data/async-registry/http-context.ts","../../../projects/common/data/async-registry/http-interceptor.ts","../../../projects/common/data/async/async.directive.ts","../../../projects/common/data/display/metric/metric.component.ts","../../../projects/common/data/display/shared/delta-format.ts","../../../projects/common/data/display/trend/trend.component.ts","../../../projects/common/data/display/delta/delta.component.ts","../../../projects/common/data/display/stat/stat.token.ts","../../../projects/common/data/display/stat/stat.component.ts","../../../projects/common/data/display/stat/stat-slots.ts","../../../projects/common/data/display/status/status.component.ts","../../../projects/common/data/display/goal/goal.component.ts","../../../projects/common/data/recycler/range-computer.ts","../../../projects/common/data/recycler/scroll-observer.ts","../../../projects/common/data/recycler/size-cache.ts","../../../projects/common/data/recycler/recycler.ts","../../../projects/common/data/recycler/measure.directive.ts","../../../projects/common/data/recycler/virtual-item.directive.ts","../../../projects/common/data/recycler/recycler-announcer.component.ts","../../../projects/common/data/recycler/connect-recycler-roving.ts","../../../projects/common/data/recycler/connect-recycler-active-descendant.ts","../../../projects/common/data/commit/commit-controller.ts","../../../projects/common/data/commit/commit-controller.token.ts","../../../projects/common/data/material-bridge/bidirectional-sync.ts","../../../projects/common/data/public-api.ts","../../../projects/common/data/cngx-common-data.ts"],"sourcesContent":["import { afterNextRender, computed, Directive, input, output, signal } from '@angular/core';\n\n/**\n * A single sort entry: the active field key and its direction.\n *\n * @category common/data/sort\n */\nexport interface SortEntry {\n active: string;\n direction: 'asc' | 'desc';\n}\n\n/**\n * Atom directive that tracks sort state (active field + direction).\n *\n * Supports both **uncontrolled** (internal state) and **controlled** modes.\n * In controlled mode the `cngxSortActive` / `cngxSortDirection` inputs take\n * precedence over the internal state - pair with `sortChange` to keep them\n * in sync.\n *\n * An uncontrolled sort may declare a **starting** column + direction via\n * `[cngxSortInitial]`: it seeds the internal state exactly once on init, then\n * user clicks take over. Distinct from the controlled `cngxSortActive` /\n * `cngxSortDirection` pins - the seed is skipped when a controlled pin is bound.\n *\n * When `multiSort` is `true`, holding **Shift** while clicking a sort header\n * adds it as a secondary (tertiary, …) sort key instead of replacing the\n * primary one. Shift-clicking an active column cycles it asc → desc → removed.\n * Multi-sort state is always uncontrolled; use `sortsChange` to read it.\n *\n * Consumer connects this to a table or list via a `computed()` - nothing is\n * injected automatically.\n *\n * @category common/data/sort\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/sort/sort.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSortHeader, CngxFilter, CngxPaginate, CngxSmartDataSource\n *\n * <example-url>http://localhost:4200/#/common/data/sort/basic</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/multi-sort</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/controlled</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/aria-and-keyboard</example-url>\n */\n@Directive({\n selector: '[cngxSort]',\n exportAs: 'cngxSort',\n standalone: true,\n})\nexport class CngxSort {\n /** Controlled active column. When bound, takes precedence over internal state (single-sort only). */\n readonly activeInput = input<string | undefined>(undefined, { alias: 'cngxSortActive' });\n /** Controlled direction. When bound, takes precedence over internal state (single-sort only). */\n readonly directionInput = input<'asc' | 'desc' | undefined>(undefined, {\n alias: 'cngxSortDirection',\n });\n /**\n * When `true`, Shift+click on a sort header adds it to the sort stack instead of\n * replacing the current sort.\n */\n readonly multiSort = input<boolean>(false);\n /**\n * Uncontrolled starting sort. Seeds the internal state once on init if no sort\n * is set yet and no controlled `cngxSortActive` pin is bound; user clicks own\n * it thereafter. Ignored in controlled mode.\n */\n readonly initialSort = input<SortEntry | undefined>(undefined, { alias: 'cngxSortInitial' });\n\n private readonly sortsState = signal<SortEntry[]>([]);\n\n constructor() {\n // One-shot uncontrolled seed: not a reactive derivation, so afterNextRender\n // (single-shot, outside the signal graph) rather than an effect. The empty +\n // no-controlled-pin guards keep it from clobbering an early click or writing\n // an invisible state that would surface when a controlled pin unbinds.\n afterNextRender(() => {\n const seed = this.initialSort();\n if (seed && this.sortsState().length === 0 && this.activeInput() === undefined) {\n this.sortsState.set([seed]);\n }\n });\n }\n\n /** The active sort column of the primary entry (controlled takes precedence in single-sort mode). */\n readonly active = computed(() => this.activeInput() ?? this.sortsState()[0]?.active);\n /** The active sort direction of the primary entry (controlled takes precedence in single-sort mode). */\n readonly direction = computed(() => this.directionInput() ?? this.sortsState()[0]?.direction);\n\n /**\n * The primary sort state, or `null` when no sort is active.\n * In multi-sort mode this is the first entry in `sorts`.\n */\n readonly sort = computed(() =>\n this.active() ? { active: this.active(), direction: this.direction() ?? 'asc' } : null,\n );\n\n /**\n * All active sort entries in priority order.\n * Contains at most one entry when additive mode has not been used.\n */\n readonly sorts = this.sortsState.asReadonly();\n\n /** `true` when at least one sort is active. */\n readonly isActive = computed(() => this.sorts().length > 0);\n\n /** Emitted when the primary sort state changes. Emits `undefined` on clear. */\n readonly sortChange = output<SortEntry | undefined>();\n /**\n * Emitted whenever the sort stack changes (including removals and full clears).\n * Always reflects the full `sorts` array at the time of emission.\n */\n readonly sortsChange = output<SortEntry[]>();\n\n /**\n * Sets or toggles the sort for `field`.\n *\n * **`additive = false`** (default, plain click):\n * - Same field → cycle `asc` → `desc` → cleared (a third click removes the sort)\n * - Different field → replace stack with `{ field, asc }`\n *\n * **`additive = true`** (Shift+click when `multiSort` is enabled on the header):\n * - Field not in stack → append as asc\n * - Field in stack as asc → change to desc\n * - Field in stack as desc → remove from stack\n */\n setSort(field: string, additive = false): void {\n if (additive) {\n const current = this.sortsState();\n const idx = current.findIndex((s) => s.active === field);\n let next: SortEntry[];\n if (idx === -1) {\n next = [...current, { active: field, direction: 'asc' }];\n } else if (current[idx].direction === 'asc') {\n next = current.map((s, i) => (i === idx ? { ...s, direction: 'desc' as const } : s));\n } else {\n next = current.filter((_, i) => i !== idx);\n }\n this.sortsState.set(next);\n this.sortsChange.emit(next);\n this.sortChange.emit(next[0]);\n } else {\n const current = this.sortsState();\n if (field === current[0]?.active && current[0].direction === 'desc') {\n // Third click on the active column: cycle desc -> cleared.\n this.sortsState.set([]);\n this.sortChange.emit(undefined);\n this.sortsChange.emit([]);\n } else {\n const dir: 'asc' | 'desc' = field === current[0]?.active ? 'desc' : 'asc';\n const entry: SortEntry = { active: field, direction: dir };\n this.sortsState.set([entry]);\n this.sortChange.emit(entry);\n this.sortsChange.emit([entry]);\n }\n }\n }\n\n /** Clears all active sorts. Emits both `sortChange(undefined)` and `sortsChange([])`. */\n clear(): void {\n this.sortsState.set([]);\n this.sortChange.emit(undefined);\n this.sortsChange.emit([]);\n }\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport { type CngxSort, type SortEntry } from './sort.directive';\n\n/**\n * The derived sort-header state a header directive exposes for one column.\n *\n * Pure derivation over a single {@link CngxSort} source plus an imperative\n * `toggle`. No async state, no signal writes outside `toggle`.\n *\n * @category common/data/sort\n */\nexport interface SortHeaderState {\n /** The active sort entry for this column, or `undefined` when the column is not sorted. */\n readonly entry: Signal<SortEntry | undefined>;\n /** `true` when this column is part of the active sort (primary or secondary). */\n readonly isActive: Signal<boolean>;\n /** `true` when this column is active and sorted ascending. */\n readonly isAsc: Signal<boolean>;\n /** `true` when this column is active and sorted descending. */\n readonly isDesc: Signal<boolean>;\n /**\n * 1-based position of this column in the sort stack, or `0` when it is not active.\n * Only meaningful when `multiSort` is enabled on the owning `CngxSort`.\n */\n readonly priority: Signal<number>;\n /**\n * Toggles this column's sort through `CngxSort.setSort`. Pass the header's own\n * Shift-key read as `additive`; the `multiSort` gate is applied here so the\n * column only joins the stack additively when the owning sort allows it.\n */\n toggle(additive?: boolean): void;\n}\n\n/**\n * Derives the shared sort-header state for one column from a {@link CngxSort} getter.\n *\n * Both {@link CngxSortHeader} (table context, `aria-sort`) and `CngxDgaSortHeader`\n * (disclosure context, `role=\"button\"` + `aria-describedby`) compose this factory\n * and keep only their own a11y presentation. The factory is a11y-agnostic - it\n * returns the plain derived signals each header maps to its own DOM/ARIA surface.\n *\n * @param sort Getter for the owning `CngxSort` engine (`() => sortRef`, `() => grid.sort`).\n * @param field Getter for the column's field key.\n * @returns The derived `{ entry, isActive, isAsc, isDesc, priority, toggle }` bundle.\n *\n * @category common/data/sort\n * @since 0.1.0\n * @relatedTo CngxSort, CngxSortHeader\n */\nexport function createSortHeaderState(sort: () => CngxSort, field: () => string): SortHeaderState {\n const entry = computed(() => sort().sorts().find((s) => s.active === field()));\n\n const isActive = computed(() => entry() !== undefined);\n const isAsc = computed(() => entry()?.direction === 'asc');\n const isDesc = computed(() => entry()?.direction === 'desc');\n\n const priority = computed(() => {\n const idx = sort().sorts().findIndex((s) => s.active === field());\n return idx === -1 ? 0 : idx + 1;\n });\n\n return {\n entry,\n isActive,\n isAsc,\n isDesc,\n priority,\n toggle(additive = false): void {\n sort().setSort(field(), additive && sort().multiSort());\n },\n };\n}\n","import { computed, Directive, input } from '@angular/core';\nimport { createSortHeaderState } from './sort-header-state';\nimport { type CngxSort } from './sort.directive';\n\n/**\n * Molecule directive for sort-header elements.\n *\n * Apply to any clickable header element. Consumer provides an explicit\n * `[cngxSortRef]` binding - no ancestor injection, no hidden wiring.\n *\n * In multi-sort mode, Shift+click adds this column to the sort stack.\n * The `priority()` signal returns the 1-based position in the stack\n * (0 when not active), useful for showing sort-order badges.\n *\n * ```html\n * <div cngxSort [multiSort]=\"true\" #sort=\"cngxSort\">\n * <button cngxSortHeader=\"name\" [cngxSortRef]=\"sort\" #h=\"cngxSortHeader\">\n * Name\n * @if (h.isActive()) {\n * {{ h.isAsc() ? '↑' : '↓' }}\n * @if (sort.multiSort()) { <span>{{ h.priority() }}</span> }\n * }\n * </button>\n * </div>\n * ```\n *\n * @category common/data/sort\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/sort/sort-header.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSort, CngxFilter, CngxPaginate\n *\n * <example-url>http://localhost:4200/#/common/data/sort/basic</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/multi-sort</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/controlled</example-url>\n * <example-url>http://localhost:4200/#/common/data/sort/aria-and-keyboard</example-url>\n */\n@Directive({\n selector: '[cngxSortHeader]',\n exportAs: 'cngxSortHeader',\n standalone: true,\n host: {\n '(click)': 'handleSort($event)',\n '[attr.aria-sort]': 'ariaSort()',\n '[class.cngx-sort-header--active]': 'isActive()',\n '[class.cngx-sort-header--asc]': 'isAsc()',\n '[class.cngx-sort-header--desc]': 'isDesc()',\n },\n})\nexport class CngxSortHeader {\n /** The field key this header cell represents. */\n readonly field = input.required<string>({ alias: 'cngxSortHeader' });\n /** Explicit reference to the owning `CngxSort`. */\n readonly cngxSortRef = input.required<CngxSort>();\n\n private readonly state = createSortHeaderState(this.cngxSortRef, this.field);\n\n /** `true` when this column is part of the active sort (primary or secondary). */\n readonly isActive = this.state.isActive;\n /** `true` when this column is active and sorted ascending. */\n readonly isAsc = this.state.isAsc;\n /** `true` when this column is active and sorted descending. */\n readonly isDesc = this.state.isDesc;\n\n /**\n * 1-based position of this column in the sort stack.\n * Returns `0` when the column is not part of the active sort.\n * Only meaningful when `multiSort` is enabled on the owning `CngxSort`.\n */\n readonly priority = this.state.priority;\n\n /** The `aria-sort` attribute value for the host element. */\n readonly ariaSort = computed((): 'ascending' | 'descending' | null => {\n if (!this.state.isActive()) {\n return null;\n }\n return this.state.isAsc() ? 'ascending' : 'descending';\n });\n\n protected handleSort(event?: MouseEvent): void {\n this.state.toggle(event?.shiftKey ?? false);\n }\n}\n","import { computed, Directive, input, output, signal } from '@angular/core';\n\n/**\n * Atom directive that holds one or more named filter predicates.\n *\n * Supports both **uncontrolled** (internal state) and **controlled** modes.\n * In controlled mode the `cngxFilter` input takes precedence over the internal\n * `'default'` predicate - pair with `filterChange` to keep it in sync.\n *\n * **Multi-filter** - use `addPredicate(key, fn)` / `removePredicate(key)` to\n * maintain a named stack of predicates. All active predicates are **AND-combined**\n * across keys: an item must pass every registered predicate to appear in results.\n *\n * AND vs OR - the directive enforces AND across dimensions (keys). OR logic\n * within a single dimension stays inside the predicate function itself:\n *\n * ```typescript\n * // AND across dimensions: location AND role must both match\n * filter.addPredicate('location', p => selectedLocations.has(p.location));\n * filter.addPredicate('role', p => selectedRoles.has(p.role));\n *\n * // OR within a dimension: London OR Rome - just put a Set inside one predicate\n * filter.addPredicate('location', p => selectedLocations.has(p.location));\n * ```\n *\n * `setPredicate` / `clear` operate on the `'default'` key and remain fully\n * backward-compatible with single-predicate usage.\n *\n * Consumer connects this to a list via a `computed()` - nothing is injected\n * automatically.\n *\n * @typeParam T - The item type the predicate operates on.\n *\n * @category common/data/filter\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/filter/filter.directive.ts\n * @since 0.1.0\n * @relatedTo CngxFilterChips, CngxSort, CngxPaginate, CngxSmartDataSource\n *\n * <example-url>http://localhost:4200/#/common/data/filter-chips/custom-chip-decoration-via-cngxfilterchip</example-url>\n * <example-url>http://localhost:4200/#/common/data/filter-chips/multi-role-filter-wired-to-a-list</example-url>\n * <example-url>http://localhost:4200/#/common/data/smart-data-source/auto-wired</example-url>\n * <example-url>http://localhost:4200/#/common/data/smart-data-source/how-it-works-hostdirectives-inject</example-url>\n * <example-url>http://localhost:4200/#/common/data/smart-data-source/smartdatasource-cngxpaginate-hostdirective</example-url>\n */\n@Directive({\n selector: '[cngxFilter]',\n exportAs: 'cngxFilter',\n standalone: true,\n})\nexport class CngxFilter<T = unknown> {\n /** Controlled predicate. When bound, takes precedence over the `'default'` internal predicate. */\n readonly predicateInput = input<((value: T) => boolean) | null>(null, { alias: 'cngxFilter' });\n\n private readonly predicatesState = signal<Map<string, (value: T) => boolean>>(new Map());\n\n /**\n * All active named predicates.\n * Use `addPredicate` / `removePredicate` to manage this map.\n */\n readonly predicates = this.predicatesState.asReadonly();\n\n /** Number of active named predicates (controlled input not counted). */\n readonly activeCount = computed(() => this.predicatesState().size);\n\n /**\n * The combined predicate - AND of all active named predicates plus the\n * controlled input (when bound). Returns `null` when nothing is active.\n */\n readonly predicate = computed((): ((value: T) => boolean) | null => {\n const controlled = this.predicateInput();\n const map = this.predicatesState();\n\n const fns = [...(controlled ? [controlled] : []), ...map.values()];\n\n if (fns.length === 0) {\n return null;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return (value: T) => fns.every((fn) => fn(value));\n });\n\n /** `true` when at least one predicate is active. */\n readonly isActive = computed(() => this.predicate() !== null);\n\n /** Emitted whenever the `'default'` predicate changes (backward-compat single-filter output). */\n readonly filterChange = output<((value: T) => boolean) | null>();\n\n /** Emitted whenever any named predicate is added or removed. */\n readonly predicatesChange = output<Map<string, (value: T) => boolean>>();\n\n /**\n * Adds or replaces the named predicate `key`.\n * Emits `predicatesChange` with the updated map.\n */\n addPredicate(key: string, fn: (value: T) => boolean): void {\n const next = new Map(this.predicatesState());\n next.set(key, fn);\n this.predicatesState.set(next);\n this.predicatesChange.emit(next);\n }\n\n /**\n * Removes the named predicate `key` (no-op if not present).\n * Emits `predicatesChange` with the updated map.\n */\n removePredicate(key: string): void {\n const current = this.predicatesState();\n if (!current.has(key)) {\n return;\n }\n const next = new Map(current);\n next.delete(key);\n this.predicatesState.set(next);\n this.predicatesChange.emit(next);\n }\n\n /**\n * Sets the `'default'` predicate and emits `filterChange`.\n * Pass `null` to clear it (same as `clear()`).\n */\n setPredicate(fn: ((value: T) => boolean) | null): void {\n if (fn === null) {\n this.removePredicate('default');\n } else {\n this.addPredicate('default', fn);\n }\n this.filterChange.emit(fn);\n }\n\n /** Removes all named predicates and emits `filterChange` with `null`. */\n clear(): void {\n this.predicatesState.set(new Map());\n this.predicatesChange.emit(new Map());\n this.filterChange.emit(null);\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n Directive,\n TemplateRef,\n afterNextRender,\n contentChild,\n inject,\n input,\n model,\n type Signal,\n} from '@angular/core';\nimport { CngxChip } from '@cngx/common/display';\nimport { CngxChipInGroup, CngxMultiChipGroup } from '@cngx/common/interactive';\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\nimport type { CngxFilter } from '../filter/filter.directive';\n\n/**\n * Per-chip override slot context. Consumers project an\n * `<ng-template cngxFilterChip let-option let-value=\"value\" let-label=\"label\">`\n * to customize chip body decoration - icons, count badges, colour\n * swatches, anything beyond the default text label.\n *\n * **Decoration-only semantics.** The bridge ALWAYS wraps each option\n * in `<cngx-chip cngxChipInGroup [value]>` itself; the slot only\n * customizes what renders INSIDE that wrapper. Consumers do NOT\n * redeclare selection wiring - it is handled by the bridge so the\n * projected content survives Angular's `*ngTemplateOutlet`\n * lexical-injector semantics (the projected template injects against\n * the consumer's component, NOT the bridge's inner\n * `<cngx-multi-chip-group>`, so a consumer-supplied\n * `cngxChipInGroup` would fail to resolve `CNGX_CHIP_GROUP_HOST`).\n *\n * @category common/data/filter\n */\nexport interface CngxFilterChipContext<TItem = unknown, TValue = unknown> {\n readonly $implicit: TItem;\n readonly option: TItem;\n readonly value: TValue;\n readonly label: string;\n}\n\n/**\n * Template-slot directive overriding the default chip body inside\n * `<cngx-filter-chips>`. Consumers attach\n * `<ng-template cngxFilterChip>` to project decoration; the bridge\n * wraps that decoration in `cngxChipInGroup`-bound chip wrappers\n * automatically. Absence falls back to the default text-only label.\n *\n * @category common/data/filter\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/filter-chips/filter-chips.component.ts\n * @since 0.1.0\n * @relatedTo CngxFilterChips, CngxFilter\n *\n * <example-url>http://localhost:4200/#/common/data/filter-chips/custom-chip-decoration-via-cngxfilterchip</example-url>\n * <example-url>http://localhost:4200/#/common/data/filter-chips/multi-role-filter-wired-to-a-list</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxFilterChip]',\n standalone: true,\n})\nexport class CngxFilterChip<TItem = unknown, TValue = unknown> {\n readonly template: TemplateRef<CngxFilterChipContext<TItem, TValue>> =\n inject<TemplateRef<CngxFilterChipContext<TItem, TValue>>>(TemplateRef);\n\n static ngTemplateContextGuard<TItem, TValue>(\n _dir: CngxFilterChip<TItem, TValue>,\n _ctx: unknown,\n ): _ctx is CngxFilterChipContext<TItem, TValue> {\n return true;\n }\n}\n\n/**\n * Bridge that connects a multi-select chip strip to a `CngxFilter`\n * predicate via Pillar-1 derivation - no `effect()` write-back, no\n * manual sync. The bridge composes `<cngx-multi-chip-group>` for\n * the visible chip strip and registers a single closure-style\n * predicate on the parent `[filterRef]`. Chip toggles update\n * `selectedValues`; the registered closure reads `selectedValues()`\n * lazily on every invocation so downstream filtered consumers\n * recompute without the bridge ever re-registering.\n *\n * Filter chips are inherently multi-select per\n * `feedback_select_family_split`; a single-mode filter-chip pattern\n * is intentionally out of scope. Consumers needing a single-select\n * filter wire `<cngx-chip-group>` to a custom predicate themselves.\n *\n * **Sync contract - derivation, not effect.** The bridge calls\n * `filterRef.addPredicate(filterKey, predicateFn)` EXACTLY ONCE\n * during mount (in `afterNextRender`, because `input.required()`\n * cannot be read from the constructor body). `predicateFn` is a\n * closure that reads `this.selectedValues()` and\n * `this.optionValueFn()` on every invocation. Because\n * `CngxFilter.predicate` is itself a `computed()` consumed by\n * downstream filtered lists, each item-evaluation flows through\n * `selectedValues()` in the consumer's reactive context - chip\n * toggles propagate without any `effect()` writing back into the\n * filter.\n *\n * **Empty-selection semantics.** When `selectedValues()` is `[]`,\n * the closure returns `true` for every item - equivalent to \"no\n * filter applied\". The bridge deliberately does NOT call\n * `removePredicate` on empty selection: leaving the predicate\n * registered with a constant-`true` short-circuit is cheaper than\n * re-registering on every empty/non-empty boundary, and keeps the\n * predicate-stack stable (no `predicatesChange` emission churn).\n *\n * **Teardown.** `DestroyRef.onDestroy` calls `removePredicate` only\n * when registration actually happened (`registered` flag) - guards\n * against the case where the component is destroyed before\n * `afterNextRender` fires. The destroy callback reads `filterRef`\n * and `filterKey` lazily so a consumer that re-binds these between\n * mount and unmount cleans the latest binding (per\n * `reference_signal_architecture` memory-hygiene rule).\n *\n * ```html\n * <cngx-filter-chips\n * label=\"Tags\"\n * [options]=\"tagOptions\"\n * optionLabel=\"label\"\n * optionValue=\"id\"\n * [filterRef]=\"employees\"\n * filterKey=\"tags\"\n * />\n *\n * <ng-container cngxFilter #employees=\"cngxFilter\">\n * @for (emp of filteredEmployees(); track emp.id) {\n * ...\n * }\n * </ng-container>\n * ```\n *\n * @category common/data/filter\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/filter-chips/filter-chips.component.ts\n * @since 0.1.0\n * @relatedTo CngxFilter, CngxFilterChip, CngxMultiChipGroup\n *\n * <example-url>http://localhost:4200/#/common/data/filter-chips/custom-chip-decoration-via-cngxfilterchip</example-url>\n * <example-url>http://localhost:4200/#/common/data/filter-chips/multi-role-filter-wired-to-a-list</example-url>\n */\n@Component({\n selector: 'cngx-filter-chips',\n exportAs: 'cngxFilterChips',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CngxChip, CngxMultiChipGroup, CngxChipInGroup, NgTemplateOutlet],\n template: `\n <cngx-multi-chip-group\n [label]=\"label()\"\n [(selectedValues)]=\"selectedValues\"\n [state]=\"state()\"\n [keyFn]=\"keyFn()\"\n [(disabled)]=\"disabled\"\n [(required)]=\"required\"\n [(invalid)]=\"invalid\"\n [errorMessageId]=\"errorMessageId()\"\n [orientation]=\"orientation()\"\n >\n @for (option of options(); track keyFn()(optionValue()(option))) {\n <cngx-chip cngxChipInGroup [value]=\"optionValue()(option)\">\n @if (chipTemplate()?.template; as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: chipContext(option)\" />\n } @else {\n {{ optionLabel()(option) }}\n }\n </cngx-chip>\n }\n </cngx-multi-chip-group>\n `,\n})\nexport class CngxFilterChips<TItem = unknown, TValue = unknown> {\n readonly label = input.required<string>();\n readonly options = input.required<readonly TItem[]>();\n readonly optionLabel = input.required<(item: TItem) => string>();\n readonly optionValue = input.required<(item: TItem) => TValue>();\n readonly filterRef = input.required<CngxFilter<TItem>>();\n readonly filterKey = input.required<string>();\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /**\n * Form-state surface forwarded transparently to the inner\n * `<cngx-multi-chip-group>`. Each is a `model<boolean>` matching the\n * inner shape so consumers can two-way bind with their own forms\n * state without reaching past the bridge. Mirrors `CngxCheckboxGroup`\n * / `CngxButtonToggleGroup` precedent.\n */\n readonly disabled = model<boolean>(false);\n readonly required = model<boolean>(false);\n readonly invalid = model<boolean>(false);\n readonly errorMessageId = input<string | null>(null);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /**\n * Membership key extractor for object-valued chip values. When\n * `TValue` is an object (e.g. `{ id, label }` rather than a\n * primitive id), this fn extracts a stable identity key so chip\n * membership survives re-emissions with fresh references. Forwarded\n * to the inner `<cngx-multi-chip-group>` AND used inside the\n * predicate's `Object.is` comparison. Defaults to identity - works\n * for primitive values.\n */\n readonly keyFn = input<(value: TValue) => unknown>((v) => v);\n\n /**\n * Resolved consumer-supplied chip template. The query uses an\n * instantiation expression (`CngxFilterChip<TItem, TValue>`) so the\n * bridge's class generics propagate into the slot directive type;\n * absent that propagation, `contentChild(CngxFilterChip)` returns\n * `Signal<CngxFilterChip<unknown, unknown> | undefined>` and the\n * `chipContext()` helper would have to widen on every call.\n */\n protected readonly chipTemplate: Signal<CngxFilterChip<TItem, TValue> | undefined> = contentChild(\n CngxFilterChip<TItem, TValue>,\n );\n\n /**\n * Build the slot context for a given chip option. `optionValue` is\n * invoked here per option for the chip rendering pass; the predicate\n * closure invokes it again per LIST item for membership filtering.\n * Both invocations are necessary because option items (the chip\n * pool) and filtered list items (the consumer's filtered data) are\n * separate data paths - they happen to share a shape under the\n * Phase-5 single-shape limitation, but the bridge cannot memoise\n * across the two paths without conflating them. Consumers should\n * keep `optionValue` cheap (typically a property lookup); a future\n * `[itemValue]` input will separate the two extractors.\n */\n protected readonly chipContext = (option: TItem): CngxFilterChipContext<TItem, TValue> => {\n const value = this.optionValue()(option);\n return {\n $implicit: option,\n option,\n value,\n label: this.optionLabel()(option),\n };\n };\n\n /**\n * Internal multi-select state driven by chip toggles. Exposed as\n * a `model` so consumers may seed initial selection via\n * `[(selectedValues)]` if they need to; usually the consumer leaves\n * this internal and reads results via the parent\n * `CngxFilter.predicate`.\n */\n readonly selectedValues = model<TValue[]>([]);\n\n private registered = false;\n\n constructor() {\n const predicateFn = (item: TItem): boolean => {\n const values = this.selectedValues();\n if (values.length === 0) {\n return true;\n }\n const extract = this.keyFn();\n const key = extract(this.optionValue()(item));\n return values.some((v) => Object.is(extract(v), key));\n };\n\n afterNextRender(() => {\n this.filterRef().addPredicate(this.filterKey(), predicateFn);\n this.registered = true;\n });\n\n inject(DestroyRef).onDestroy(() => {\n if (!this.registered) {\n return;\n }\n this.filterRef().removePredicate(this.filterKey());\n });\n }\n}\n","import { computed, Directive, input, output, signal } from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Atom directive that tracks pagination state (current page index and page size).\n *\n * Supports both **uncontrolled** (internal state) and **controlled** modes. \\\n * In controlled mode the `cngxPageIndex` / `cngxPageSize` inputs take precedence\n * over internal state - pair with \\\n * `pageChange` / `pageSizeChange` to keep them\n * in sync.\n *\n * Consumer connects this to a list or table via `range()` - nothing is injected\n * automatically.\n *\n * ```\n * // Headless: read range() from a template ref\n * <div cngxPaginate #pg=\"cngxPaginate\" [total]=\"items.length\">\n * @for (item of items.slice(pg.range()[0], pg.range()[1]); track item.id) { ... }\n * </div>\n *\n * // Drive any UI off the brain - e.g. a Material paginator wired by hand:\n * <mat-paginator\n * [length]=\"pg.total()\" [pageIndex]=\"pg.pageIndex()\" [pageSize]=\"pg.pageSize()\"\n * (page)=\"pg.setPageSize($event.pageSize, false); pg.setPage($event.pageIndex)\" />\n * ```\n * @category common/data/paginate\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/paginate.directive.ts\n * @since 0.1.0\n * @relatedTo CngxSort, CngxFilter, CngxSmartDataSource\n *\n * <example-url>http://localhost:4200/#/common/data/data-source/datasource-cngxpaginate-manual-pipeline</example-url>\n * <example-url>http://localhost:4200/#/common/data/paginate-list/paginated-list-cngxpaginate-cngxmatpaginator</example-url>\n * <example-url>http://localhost:4200/#/common/data/paginate-list/uncontrolled-mode-zero-class-boilerplate</example-url>\n * <example-url>http://localhost:4200/#/common/data/smart-data-source/smartdatasource-cngxpaginate-hostdirective</example-url>\n */\n@Directive({\n selector: '[cngxPaginate]',\n exportAs: 'cngxPaginate',\n standalone: true,\n})\nexport class CngxPaginate {\n /** Controlled page index. When bound, takes precedence over internal state. */\n readonly pageIndexInput = input<number | undefined>(undefined, { alias: 'cngxPageIndex' });\n /** Controlled page size. When bound, takes precedence over internal state. */\n readonly pageSizeInput = input<number | undefined>(undefined, { alias: 'cngxPageSize' });\n /**\n * Total number of items (before pagination). Consumer binds this from the\n * filtered/sorted count so that `totalPages` stays accurate.\n */\n readonly total = input<number>(0);\n\n /**\n * Bind an async state - disables navigation while the data source is busy.\n * When set, `isBusy` derives from `state.isBusy()`. Navigation methods\n * (`setPage`, `next`, `previous`, etc.) are no-ops while busy.\n */\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /** `true` when the bound async state is busy (loading/refreshing). */\n readonly isBusy = computed(() => this.state()?.isBusy() ?? false);\n\n private readonly pageIndexState = signal(0);\n private readonly pageSizeState = signal(10);\n\n /** Current page index (0-based). Controlled input takes precedence. Auto-clamped to totalPages. */\n readonly pageIndex = computed(() => {\n const raw = this.pageIndexInput() ?? this.pageIndexState();\n const max = this.totalPages() - 1;\n return Math.min(raw, max);\n });\n /** Current page size. Controlled input takes precedence. */\n readonly pageSize = computed(() => this.pageSizeInput() ?? this.pageSizeState());\n\n /** Total number of pages (minimum 1). */\n readonly totalPages = computed(() => Math.max(1, Math.ceil(this.total() / this.pageSize())));\n\n /** `true` when on the first page. */\n readonly isFirst = computed(() => this.pageIndex() === 0);\n /** `true` when on the last page. */\n readonly isLast = computed(() => this.pageIndex() >= this.totalPages() - 1);\n\n /**\n * `[start, end]` indices for `Array.slice()` - always in-bounds.\n * Consumer: `items.slice(range()[0], range()[1])`.\n */\n readonly range = computed<[number, number]>(\n () => {\n const start = this.pageIndex() * this.pageSize();\n return [start, start + this.pageSize()];\n },\n { equal: (a, b) => a[0] === b[0] && a[1] === b[1] },\n );\n\n /**\n * `[0, end]` cumulative slice indices for append-don't-replace (load-more)\n * consumers: every page already stepped through, sliced from the top. `end`\n * is `(pageIndex + 1) * pageSize` - the count revealed so far, uncapped (a\n * partial final page is clamped by the consumer against `total`).\n * Pure derivation of `pageIndex` / `pageSize`; the explicit tuple `equal`\n * stops a fresh-array identity from cascading downstream.\n */\n readonly cumulativeRange = computed<[number, number]>(\n () => [0, (this.pageIndex() + 1) * this.pageSize()],\n { equal: (a, b) => a[0] === b[0] && a[1] === b[1] },\n );\n\n /** Emitted when the page index changes. */\n readonly pageChange = output<number>();\n /** Emitted when the page size changes. */\n readonly pageSizeChange = output<number>();\n\n /**\n * Navigate to `index`, clamping to `[0, totalPages - 1]`.\n * Emits `pageChange`.\n */\n setPage(index: number): void {\n if (this.isBusy()) {\n return;\n }\n const clamped = Math.max(0, Math.min(index, this.totalPages() - 1));\n this.pageIndexState.set(clamped);\n this.pageChange.emit(clamped);\n }\n\n /**\n * Change page size and optionally reset to page 0.\n * Emits `pageSizeChange` and, when `resetPage` is `true`, `pageChange`.\n */\n setPageSize(size: number, resetPage = true): void {\n if (this.isBusy()) {\n return;\n }\n this.pageSizeState.set(size);\n this.pageSizeChange.emit(size);\n if (resetPage) {\n this.pageIndexState.set(0);\n this.pageChange.emit(0);\n }\n }\n\n /** Navigate to the next page (no-op on the last page). */\n next(): void {\n this.setPage(this.pageIndex() + 1);\n }\n\n /** Navigate to the previous page (no-op on the first page). */\n previous(): void {\n this.setPage(this.pageIndex() - 1);\n }\n\n /** Navigate to the first page. */\n first(): void {\n this.setPage(0);\n }\n\n /** Navigate to the last page. */\n last(): void {\n this.setPage(this.totalPages() - 1);\n }\n}\n","import { Directive, effect, inject, input, untracked } from '@angular/core';\n\nimport { CngxPaginate } from './paginate.directive';\n\n/**\n * Wires the reset-on-change behaviour onto a {@link CngxPaginate} brain: when\n * `key()` changes (after the initial run) the paginator jumps to the first\n * page. The first run captures the mounting value without resetting, and an\n * already-first paginator emits nothing.\n *\n * Shared by `[cngxPaginateResetOn]`, the `CngxPaginator` shell's `resetOn`\n * input, and the `CngxMatPaginator` bridge's `resetOn` input, so the behaviour\n * is byte-identical across all three. Call inside an injection context\n * (constructor or field initialiser).\n *\n * @category common/data/paginate\n * @since 0.1.0\n */\nexport function connectPaginateResetOn(paginate: CngxPaginate, key: () => unknown): void {\n let seen = false;\n effect(() => {\n key();\n if (!seen) {\n seen = true;\n return;\n }\n untracked(() => {\n if (paginate.pageIndex() !== 0) {\n paginate.setPage(0);\n }\n });\n });\n}\n\n/**\n * Resets a `cngxPaginate` host to the first page whenever the bound key\n * changes - the composable form of {@link connectPaginateResetOn}. \\\n * Drop it on the same element as `cngxPaginate` (or a `CngxPaginator` / `CngxMatPaginator`,\n * which provide the brain), and bind the sort / filter / search value a result\n * set depends on, so a narrowed result never strands the user on a now-empty\n * page.\n *\n * Bind a primitive or a `computed` - an inline array / object literal recomputes\n * every change-detection pass and would reset on each.\n *\n * ```html\n * <table cngxPaginate [cngxPaginateResetOn]=\"filter()\"><!-- ... --></table>\n * ```\n * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>\n *\n * @category common/data/paginate\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/paginate-reset.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPaginate, CngxPaginator, CngxMatPaginator\n */\n@Directive({\n selector: '[cngxPaginateResetOn]',\n exportAs: 'cngxPaginateResetOn',\n standalone: true,\n})\nexport class CngxPaginateResetOn {\n private readonly paginate = inject(CngxPaginate);\n\n /** The reset key. A change (after mount) jumps the paginator to page 0. */\n readonly key = input<unknown>(undefined, { alias: 'cngxPaginateResetOn' });\n\n constructor() {\n connectPaginateResetOn(this.paginate, this.key);\n }\n}\n","import { DestroyRef, effect, inject } from '@angular/core';\n\nimport type { CngxPaginate } from './paginate.directive';\n\n/**\n * Handlers the two-way emit bridge forwards page changes to - typically a\n * host component's `pageIndexChange` / `pageSizeChange` output emitters.\n *\n * @category common/data/paginate\n * @since 0.1.0\n */\nexport interface CngxPaginateEmitHandlers {\n /** Called once per effective page-index change. */\n readonly onIndex: (index: number) => void;\n /** Called once per effective page-size change. */\n readonly onSize: (size: number) => void;\n}\n\n/**\n * Wires the {@link CngxPaginate} brain's page / page-size changes onto a host's\n * two-way outputs with exactly-once emit semantics. Two paths feed each handler,\n * sharing a last-emitted guard:\n * - a subscription forwards the brain's nav-only `pageChange` / `pageSizeChange`\n * - the only signal that captures a controlled-mode `setPage`, because the\n * brain's `pageIndex()` stays pinned to the input until the consumer feeds it\n * back;\n * - an `effect()` reads the effective `pageIndex()` / `pageSize()` and covers a\n * `total`-shrink clamp the nav-only output misses.\n *\n * The shared guard makes a value one path already emitted a no-op on the other,\n * so each change emits exactly once. Seeded with the current effective values,\n * so wiring emits no initial change.\n *\n * Shared verbatim by the `CngxPaginator` shell and the `CngxIncrementalList`\n * organism, so the two-way emit behaviour is byte-identical. Call inside an\n * injection context (constructor or field initialiser) - it reads `DestroyRef`\n * and creates effects.\n *\n * @category common/data/paginate\n * @since 0.1.0\n */\nexport function connectPaginateEmit(\n paginate: CngxPaginate,\n handlers: CngxPaginateEmitHandlers,\n): void {\n const destroyRef = inject(DestroyRef);\n\n // Shared last-emitted guards across the nav (subscription) and clamp (effect)\n // paths. Plain locals, so the effects carry no signal write. Seeded with the\n // current effective values so wiring emits no initial change.\n let lastIndex = paginate.pageIndex();\n let lastSize = paginate.pageSize();\n\n // Nav path. Forwards the brain's nav-only outputs: in controlled mode a\n // setPage leaves the effective pageIndex() pinned to the input, so this event\n // is the only thing that reports the navigation.\n const indexSub = paginate.pageChange.subscribe((index) => {\n if (index !== lastIndex) {\n lastIndex = index;\n handlers.onIndex(index);\n }\n });\n const sizeSub = paginate.pageSizeChange.subscribe((size) => {\n if (size !== lastSize) {\n lastSize = size;\n handlers.onSize(size);\n }\n });\n destroyRef.onDestroy(() => {\n indexSub.unsubscribe();\n sizeSub.unsubscribe();\n });\n\n // Clamp path. The effective pageIndex moved without a nav (a total-shrink\n // clamp the nav-only pageChange misses). The shared guard means a value the\n // nav path already emitted is a no-op here, so each change emits once.\n effect(() => {\n const index = paginate.pageIndex();\n if (index !== lastIndex) {\n lastIndex = index;\n handlers.onIndex(index);\n }\n });\n effect(() => {\n const size = paginate.pageSize();\n if (size !== lastSize) {\n lastSize = size;\n handlers.onSize(size);\n }\n });\n}\n","import {\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n type OnInit,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\n\nimport { CngxPaginate } from './paginate.directive';\n\n/**\n * Persists a `cngxPaginate` host's page / size in the URL query string, so a\n * paginated view is deep-linkable and survives reload / back / forward.\n *\n * Drop it on the same element as `cngxPaginate` (or a `CngxPaginator` /\n * `CngxMatPaginator`, which provide the brain). The page is written 1-based\n * (`?page=2`) for human-readable URLs; the brain stays 0-based.\n *\n * ```html\n * <cngx-paginator cngxPaginateRouting [total]=\"items().length\"></cngx-paginator>\n * ```\n *\n * Two paginators on one route must take distinct param names via\n * `[cngxPaginatePageParam]` / `[cngxPaginateSizeParam]` to avoid a collision. \\\n * Requires `@angular/router` (`provideRouter`); without it the directive is an\n * inert no-op (a dev-mode warning is logged). Framework-agnostic of any UI - it\n * needs only the brain and the router.\n *\n * @category common/data/paginate\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/paginate-routing.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPaginate, CngxPaginator, CngxMatPaginator\n * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>\n */\n@Directive({\n selector: '[cngxPaginateRouting]',\n exportAs: 'cngxPaginateRouting',\n standalone: true,\n})\nexport class CngxPaginateRouting implements OnInit {\n private readonly paginate = inject(CngxPaginate);\n private readonly router = inject(Router, { optional: true });\n private readonly route = inject(ActivatedRoute, { optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n /** Query-param name for the 1-based page. */\n readonly pageParam = input('page', { alias: 'cngxPaginatePageParam' });\n /** Query-param name for the page size. */\n readonly sizeParam = input('pageSize', { alias: 'cngxPaginateSizeParam' });\n\n // Set while applying a URL change to the brain, so the brain -> URL effect\n // does not bounce the same value straight back as a redundant navigation.\n private applyingFromUrl = false;\n\n constructor() {\n const router = this.router;\n const route = this.route;\n if (!router || !route) {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n console.warn(\n '[cngxPaginateRouting]: no Router available - directive is a no-op. ' +\n 'Provide @angular/router via provideRouter(...) to enable URL-synced pagination.',\n );\n }\n return;\n }\n\n // brain -> URL. Tracks the effective page / size; merges into the existing\n // query string and replaces history so paging does not stack back entries.\n // The param-name inputs are read lazily inside untracked, so a late-bound\n // alias is already set by the time the first navigation fires.\n effect(() => {\n const page = this.paginate.pageIndex() + 1;\n const size = this.paginate.pageSize();\n if (this.applyingFromUrl) {\n return;\n }\n untracked(() => {\n void router.navigate([], {\n relativeTo: route,\n queryParams: { [this.pageParam()]: page, [this.sizeParam()]: size },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n });\n });\n });\n }\n\n ngOnInit(): void {\n const route = this.route;\n if (!route) {\n return;\n }\n // URL -> brain, wired in ngOnInit so the param-name inputs are resolved\n // before queryParamMap replays the current params on subscribe (a\n // deep-linked page / size therefore lands before first paint). The\n // subscription stays live for back / forward navigation.\n route.queryParamMap.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((params) => {\n const size = Number(params.get(this.sizeParam()));\n const page = Number(params.get(this.pageParam()));\n this.applyingFromUrl = true;\n try {\n if (Number.isFinite(size) && size > 0 && size !== this.paginate.pageSize()) {\n this.paginate.setPageSize(size, false);\n }\n const index = (Number.isFinite(page) && page > 0 ? page : 1) - 1;\n if (index !== this.paginate.pageIndex()) {\n this.paginate.setPage(index);\n }\n } finally {\n this.applyingFromUrl = false;\n }\n });\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * A single bucket as the chips segment reads it - the label only. The match\n * predicate that decides membership stays internal to `CngxBucketPaginate`; a\n * presentation segment never needs it, only the label to render and the\n * derived empty/active state to reflect.\n *\n * @category common/data/paginate\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/bucket-paginate-host.token.ts\n * @since 0.1.0\n */\nexport interface CngxBucketPaginateView {\n /** Human-readable bucket label, e.g. `'A-C'`. Rendered as the chip text. */\n readonly label: string;\n}\n\n/**\n * Read-and-write contract a category/range chip strip (`cngx-pgn-alpha`)\n * injects instead of the concrete `CngxBucketPaginate` directive. \\\n * The directive provides it via `useExisting`, so a chip strip stays\n * decompose-ready - it talks to the token, never to the model class (DI\n * abstraction).\n *\n * The signals are the single derivation source for every chip's pressed and\n * disabled state; `select` / `clear` are the only write paths, each routing\n * through the directive's `active` model so the toggle invariant (re-selecting\n * the active bucket clears it) holds in one place.\n *\n * @category common/data/paginate\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/bucket-paginate-host.token.ts\n * @since 0.1.0\n */\nexport interface CngxBucketPaginateHost {\n /** The buckets to render, in declaration order. One chip per entry. */\n readonly buckets: Signal<readonly CngxBucketPaginateView[]>;\n /** Label of the active bucket, or `null` when no bucket is selected. */\n readonly active: Signal<string | null>;\n /**\n * `true` when no bound item matches the bucket's predicate. Derived from the\n * `items` / `buckets` inputs (never a synced flag); a chip binds its disabled\n * state to this so an empty bucket is a dead control with a stated reason.\n */\n isEmpty(label: string): boolean;\n /**\n * Select the bucket. Re-selecting the already-active bucket clears the\n * selection (toggle). No-op for an empty bucket.\n */\n select(label: string): void;\n /** Clear the active bucket (show the unfiltered collection). */\n clear(): void;\n}\n\n/**\n * DI token the `CngxBucketPaginate` range model provides via `useExisting`.\n * The category chips segment (`cngx-pgn-alpha`) injects this rather than the\n * concrete directive class, keeping the strip decompose-ready and the model\n * swappable.\n *\n * @category common/data/paginate\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/bucket-paginate-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_BUCKET_PAGINATE_HOST = new InjectionToken<CngxBucketPaginateHost>(\n 'CngxBucketPaginateHost',\n);\n","import { computed, Directive, input, model } from '@angular/core';\n\nimport {\n CNGX_BUCKET_PAGINATE_HOST,\n type CngxBucketPaginateHost,\n} from './bucket-paginate-host.token';\n\n/**\n * A category bucket: a label plus a predicate that decides which items fall\n * into it. The predicate keeps the model content-agnostic - the same directive\n * buckets by letter range, date band, price tier, or any other partition the\n * consumer expresses, without the brain knowing what it is bucketing.\n *\n * @category common/data/paginate\n */\nexport interface CngxBucket<T> {\n /** Human-readable bucket label, e.g. `'A-C'`. Rendered as the chip text. */\n readonly label: string;\n /** Returns `true` when `item` belongs to this bucket. */\n readonly match: (item: T) => boolean;\n}\n\n/** Two `ReadonlySet`s are equal when they hold the same members. */\nfunction setEquals(a: ReadonlySet<string>, b: ReadonlySet<string>): boolean {\n if (a.size !== b.size) {\n return false;\n }\n for (const value of a) {\n if (!b.has(value)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Range/category pagination model - a sibling to {@link CngxPaginate}, NOT a\n * mode flag on it. Where `CngxPaginate` steps a page index over a slice window,\n * this directive partitions a collection into labelled buckets (letter ranges,\n * date bands, price tiers) and tracks which one is active. The page-index brain\n * stays single-responsibility; a consumer composes whichever model the data\n * calls for (Komposition statt Konfiguration).\n *\n * The empty/disabled state of every bucket is **derived**, never managed: a\n * bucket is empty when no bound item matches its predicate, computed from the\n * `items` / `buckets` inputs. There is no synced flag and no effect.\n *\n * `active` is the two-way primary value (a `model<string | null>()`):\n * `null` shows the unfiltered collection; a label filters to that bucket.\n * `select(label)` toggles - re-selecting the active bucket clears it.\n *\n * ```html\n * <div\n * cngxBucketPaginate\n * #bp=\"cngxBucketPaginate\"\n * [buckets]=\"letterBuckets\"\n * [items]=\"people\"\n * [(active)]=\"activeBucket\"\n * >\n * @for (p of bp.active() ? people.filter(byActiveBucket) : people; track p.id) { ... }\n * </div>\n * ```\n *\n * @category common/data/paginate\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/paginate/bucket-paginate.directive.ts\n * @since 0.1.0\n * @relatedTo CngxPaginate, CngxFilter\n * <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/alphabetical</example-url>\n */\n@Directive({\n selector: '[cngxBucketPaginate]',\n exportAs: 'cngxBucketPaginate',\n standalone: true,\n providers: [{ provide: CNGX_BUCKET_PAGINATE_HOST, useExisting: CngxBucketPaginate }],\n})\nexport class CngxBucketPaginate<T = unknown> implements CngxBucketPaginateHost {\n /** The buckets to partition into, in render order. One chip per entry. */\n readonly buckets = input<readonly CngxBucket<T>[]>([]);\n /** The collection the buckets test against. Drives the derived empty state. */\n readonly items = input<readonly T[]>([]);\n\n /**\n * Active bucket label, or `null` for the unfiltered collection. The two-way\n * primary value (`[(active)]`); a `model()` because it is the directive's\n * bindable state, not a derived read.\n */\n readonly active = model<string | null>(null);\n\n /**\n * Labels of every bucket whose predicate matches no bound item. A pure\n * `computed()` over `items` / `buckets` - the disabled chips read this, so\n * the empty state is derived, never synced. The explicit set `equal` stops a\n * fresh-`Set` identity from cascading downstream on every unrelated recompute.\n */\n private readonly emptyLabels = computed<ReadonlySet<string>>(\n () => {\n const items = this.items();\n const empties = new Set<string>();\n for (const bucket of this.buckets()) {\n if (!items.some((item) => bucket.match(item))) {\n empties.add(bucket.label);\n }\n }\n return empties;\n },\n { equal: setEquals },\n );\n\n /** `true` when no bound item falls into the bucket. */\n isEmpty(label: string): boolean {\n return this.emptyLabels().has(label);\n }\n\n /**\n * Select the bucket, or clear the selection when it is already active\n * (toggle). An empty bucket is a no-op - it never becomes the active filter.\n */\n select(label: string): void {\n if (this.isEmpty(label)) {\n return;\n }\n this.active.update((current) => (current === label ? null : label));\n }\n\n /** Clear the active bucket - show the unfiltered collection. */\n clear(): void {\n this.active.set(null);\n }\n}\n","import { DataSource } from '@angular/cdk/collections';\nimport { inject, Injector, type Signal } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport type { Observable } from 'rxjs';\n\n/**\n * Minimal CDK `DataSource` that bridges a Signal to the CDK table's\n * Observable-based data contract.\n *\n * No sort, filter, or search logic is included - the consumer builds a\n * `computed()` with any transformations and passes the result here.\n *\n * ```typescript\n * readonly processed = computed(() => {\n * let items = this.raw();\n * if (this.sort().sort()) { items = sortTree(items, ...); }\n * return items;\n * });\n * readonly dataSource = injectDataSource(this.processed);\n * ```\n *\n * @typeParam T - The row item type.\n *\n * @category common/data/data-source\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/data-source/data-source.ts\n * @since 0.1.0\n * @relatedTo CngxSmartDataSource, CngxSort, CngxFilter, CngxPaginate\n */\nexport class CngxDataSource<T> extends DataSource<T> {\n private readonly injector = inject(Injector);\n\n constructor(private readonly data: Signal<T[]>) {\n super();\n }\n\n override connect(): Observable<T[]> {\n return toObservable(this.data, { injector: this.injector });\n }\n\n override disconnect(): void {\n // Signal cleanup is handled by Angular's DestroyRef - no manual teardown needed.\n }\n}\n\n/**\n * Factory function for {@link CngxDataSource}.\n *\n * Must be called within an injection context (constructor or field initializer).\n *\n * ```typescript\n * readonly dataSource = injectDataSource(this.items);\n * ```\n *\n * @category common/data/data-source\n */\nexport function injectDataSource<T>(data: Signal<T[]>): CngxDataSource<T> {\n return new CngxDataSource(data);\n}\n","import { DataSource } from '@angular/cdk/collections';\nimport { computed, inject, Injector, type Signal } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { arrayEqual } from '@cngx/utils';\nimport type { Observable } from 'rxjs';\nimport { CngxPaginate } from '../paginate/paginate.directive';\nimport { CngxFilter } from '../filter/filter.directive';\nimport { CngxSort } from '../sort/sort.directive';\nimport { CngxSearch } from '@cngx/common/interactive';\n\nfunction defaultSearchFn<T>(item: T, term: string): boolean {\n const lower = term.toLowerCase();\n return Object.values(item as Record<string, unknown>).some((v) =>\n v === null || v === undefined || typeof v === 'object'\n ? false\n : String(v as string | number | boolean | bigint)\n .toLowerCase()\n .includes(lower),\n );\n}\n\nfunction defaultSortFn<T>(a: T, b: T, field: string, dir: 'asc' | 'desc'): number {\n const toStr = (v: unknown): string =>\n v === null || v === undefined || typeof v === 'object'\n ? ''\n : String(v as string | number | boolean | bigint);\n const av = toStr((a as Record<string, unknown>)[field]);\n const bv = toStr((b as Record<string, unknown>)[field]);\n const cmp = av.localeCompare(bv, undefined, { numeric: true, sensitivity: 'base' });\n return dir === 'asc' ? cmp : -cmp;\n}\n\n/**\n * Optional customization for {@link CngxSmartDataSource}.\n *\n * @category common/data/data-source\n */\nexport interface CngxSmartDataSourceOptions<T> {\n /**\n * Custom full-text search function. Receives an item and the current search\n * term; return `true` to keep the item. Defaults to a case-insensitive match\n * across all primitive-valued properties.\n */\n searchFn?: (item: T, term: string) => boolean;\n /**\n * Custom sort comparator. Receives two items, the active field key, and\n * direction. Defaults to a locale-aware string comparison.\n */\n sortFn?: (a: T, b: T, field: string, direction: 'asc' | 'desc') => number;\n}\n\nfunction isAsyncState<T>(source: Signal<T[]> | CngxAsyncState<T[]>): source is CngxAsyncState<T[]> {\n return 'status' in source && 'data' in source && 'isFirstLoad' in source;\n}\n\n/**\n * A CDK `DataSource` that optionally integrates with `CngxSort`,\n * `CngxFilter`, `CngxSearch`, and `CngxPaginate` present in the injection\n * tree. Each directive is injected optionally - if absent, that processing\n * step is skipped.\n *\n * Accepts either a plain `Signal<T[]>` or a `CngxAsyncState<T[]>`.\n * When a `CngxAsyncState` is provided, the data source exposes the full\n * UX state (`isLoading`, `isRefreshing`, `error`, `isEmpty`) so the\n * table can show skeleton rows, error states, and loading indicators.\n *\n * ```typescript\n * // Plain signal\n * readonly dataSource = injectSmartDataSource(this.items);\n *\n * // With async state - full UX lifecycle\n * readonly residents = injectAsyncState(() => this.api.getAll(this.filter()));\n * readonly dataSource = injectSmartDataSource(this.residents);\n * // dataSource.isLoading(), dataSource.error(), dataSource.isRefreshing()\n * ```\n *\n * @typeParam T - The row item type.\n *\n * @category common/data/data-source\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/data-source/smart-data-source.ts\n * @since 0.1.0\n * @relatedTo CngxDataSource, CngxSort, CngxFilter, CngxPaginate\n */\nexport class CngxSmartDataSource<T> extends DataSource<T> {\n private readonly injector = inject(Injector);\n private readonly sort = inject(CngxSort, { optional: true });\n private readonly filter = inject(CngxFilter, { optional: true });\n // CngxSearch typically lives on a child <input> below the component injector,\n // so this inject returns null in the common case. It resolves only when CngxSearch\n // is placed as a hostDirective on the same component. For child-input search,\n // use injectDataSource() + manual computed() instead.\n private readonly search = inject(CngxSearch, { optional: true });\n private readonly paginate = inject(CngxPaginate, { optional: true });\n\n /**\n * Items after filter and search are applied, before sort and pagination.\n * Use `filteredCount()` to get the pre-pagination count for paginator `total`.\n */\n private readonly filtered: Signal<T[]>;\n\n /** Number of items after filtering/searching, before pagination. */\n readonly filteredCount: Signal<number>;\n\n private readonly processed: Signal<T[]>;\n\n /**\n * The async state source, or `undefined` if constructed from a plain\n * signal. Internal-only - consumers read the derived projections\n * (`isLoading`, `isRefreshing`, `isBusy`, `isFirstLoad`, `error`,\n * `isEmpty`, `filteredCount`) instead of the raw source identity.\n */\n private readonly asyncState: CngxAsyncState<T[]> | undefined;\n\n /** `true` during initial data load (skeleton phase). */\n readonly isLoading: Signal<boolean>;\n\n /** `true` during refresh (data stays visible, loading bar). */\n readonly isRefreshing: Signal<boolean>;\n\n /** `true` when any operation is running. Maps to `aria-busy`. */\n readonly isBusy: Signal<boolean>;\n\n /** `true` if no successful load has completed yet. */\n readonly isFirstLoad: Signal<boolean>;\n\n /** Error from the async state, or `undefined`. */\n readonly error: Signal<unknown>;\n\n /** `true` when data is empty AND no operation is running. */\n readonly isEmpty: Signal<boolean>;\n\n constructor(\n source: Signal<T[]> | CngxAsyncState<T[]>,\n private readonly options?: CngxSmartDataSourceOptions<T>,\n ) {\n super();\n\n let data: Signal<T[]>;\n if (isAsyncState(source)) {\n this.asyncState = source;\n data = computed(() => source.data() ?? []);\n } else {\n this.asyncState = undefined;\n data = source;\n }\n\n const s = this.asyncState;\n this.isLoading = computed(() => s?.isLoading() ?? false);\n this.isRefreshing = computed(() => s?.isRefreshing() ?? false);\n this.isBusy = computed(() => s?.isBusy() ?? false);\n this.isFirstLoad = computed(() => s?.isFirstLoad() ?? false);\n this.error = computed(() => s?.error());\n\n this.filtered = computed(\n () => {\n const predicate = this.filter?.predicate();\n const term = this.search?.term();\n const searchFn = this.options?.searchFn ?? defaultSearchFn<T>;\n\n // Pipeline: raw → filter → search. Cast required: CngxFilter injected as unknown.\n return data()\n .filter((v) => !predicate || (predicate as (v: T) => boolean)(v))\n .filter((item) => !term || searchFn(item, term));\n },\n { equal: arrayEqual },\n );\n\n this.filteredCount = computed(() => this.filtered().length);\n\n this.isEmpty = computed(() => {\n // During loading, not \"empty\" yet - show skeleton instead\n if (this.isBusy()) {\n return false;\n }\n return this.filteredCount() === 0;\n });\n\n this.processed = computed(\n () => {\n const sorts = this.sort?.sorts() ?? [];\n const sortFn = this.options?.sortFn ?? defaultSortFn<T>;\n\n const sorted =\n sorts.length > 0\n ? [...this.filtered()].sort((a, b) =>\n sorts.reduce(\n (cmp, { active, direction }) => cmp || sortFn(a, b, active, direction),\n 0,\n ),\n )\n : this.filtered();\n\n const range = this.paginate?.range();\n return range ? sorted.slice(range[0], range[1]) : sorted;\n },\n { equal: arrayEqual },\n );\n }\n\n override connect(): Observable<T[]> {\n return toObservable(this.processed, { injector: this.injector });\n }\n\n override disconnect(): void {\n // Signal cleanup is handled by Angular's DestroyRef - no manual teardown needed.\n }\n}\n\n/**\n * Factory function for {@link CngxSmartDataSource}.\n *\n * Must be called within an injection context (constructor or field initializer).\n * Accepts either a plain `Signal<T[]>` or a `CngxAsyncState<T[]>` for\n * full UX state integration (loading, error, refresh, empty).\n *\n * ```typescript\n * // Plain signal\n * readonly dataSource = injectSmartDataSource(this.items);\n *\n * // With async state - table shows skeleton, error, loading bar\n * readonly residents = injectAsyncState(() => this.api.getAll());\n * readonly dataSource = injectSmartDataSource(this.residents);\n * ```\n *\n * @category common/data/data-source\n */\nexport function injectSmartDataSource<T>(\n source: Signal<T[]> | CngxAsyncState<T[]>,\n options?: CngxSmartDataSourceOptions<T>,\n): CngxSmartDataSource<T> {\n return new CngxSmartDataSource(source, options);\n}\n","import { computed, signal } from '@angular/core';\nimport { buildAsyncStateView, type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Writable extension of `CngxAsyncState` for manual control.\n *\n * Returned by `createManualState()` — provides imperative setters\n * while the read-side stays the standard `CngxAsyncState` interface.\n *\n * @category common/data/async-state\n */\nexport interface ManualAsyncState<T> extends CngxAsyncState<T> {\n /** Set the status directly. */\n set(status: AsyncStatus): void;\n\n /** Transition to `success` with data. */\n setSuccess(data: T): void;\n\n /** Transition to `error`. */\n setError(error: unknown): void;\n\n /** Set progress (0–100). */\n setProgress(value: number | undefined): void;\n\n /** Reset to `idle`, clear data, error, and progress. */\n reset(): void;\n}\n\n/**\n * Create a fully manual async state — no HTTP, no automatic loading.\n *\n * Use for local operations: heavy computations, Web Workers, complex local processes.\n * Does **not** require an injection context — uses only `signal()` and `computed()`.\n *\n * ```typescript\n * readonly processState = createManualState<ProcessResult>();\n *\n * async handleProcess(): Promise<void> {\n * this.processState.set('loading');\n * this.processState.setProgress(0);\n * const result = await heavyComputation((p) => this.processState.setProgress(p));\n * this.processState.setSuccess(result);\n * }\n * ```\n *\n * @category common/data/async-state\n */\nexport function createManualState<T>(): ManualAsyncState<T> {\n const statusState = signal<AsyncStatus>('idle');\n const dataState = signal<T | undefined>(undefined);\n const errorState = signal<unknown>(undefined);\n const progressState = signal<number | undefined>(undefined);\n const lastUpdatedState = signal<Date | undefined>(undefined);\n const hadSuccess = signal(false);\n\n const view = buildAsyncStateView<T>({\n status: statusState.asReadonly(),\n data: dataState.asReadonly(),\n error: errorState.asReadonly(),\n progress: progressState.asReadonly(),\n isFirstLoad: computed(() => !hadSuccess()),\n lastUpdated: lastUpdatedState.asReadonly(),\n });\n\n return {\n ...view,\n\n set(newStatus: AsyncStatus): void {\n statusState.set(newStatus);\n if (newStatus === 'success') {\n hadSuccess.set(true);\n lastUpdatedState.set(new Date());\n }\n },\n\n setSuccess(value: T): void {\n dataState.set(value);\n errorState.set(undefined);\n progressState.set(undefined);\n hadSuccess.set(true);\n lastUpdatedState.set(new Date());\n statusState.set('success');\n },\n\n setError(err: unknown): void {\n errorState.set(err);\n progressState.set(undefined);\n statusState.set('error');\n },\n\n setProgress(value: number | undefined): void {\n progressState.set(value);\n },\n\n reset(): void {\n statusState.set('idle');\n dataState.set(undefined);\n errorState.set(undefined);\n progressState.set(undefined);\n lastUpdatedState.set(undefined);\n hadSuccess.set(false);\n },\n };\n}\n","import { DestroyRef, inject } from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { firstValueFrom, isObservable, type Observable } from 'rxjs';\n\nimport { createManualState, type ManualAsyncState } from './create-manual-state';\n\n/**\n * Writable async state for mutations (POST/PUT/DELETE).\n *\n * Extends the read-only `CngxAsyncState` with an `execute()` method\n * that runs an async action and manages the full lifecycle.\n *\n * @category common/data/async-state\n */\nexport interface MutableAsyncState<T> extends CngxAsyncState<T> {\n /**\n * Execute an async action.\n *\n * Sets status to `pending`, then `success` or `error` on completion.\n * Supersedes any in-flight execution — the previous result is discarded\n * but the underlying network request is not aborted.\n */\n execute(fn: () => Promise<T> | Observable<T>): Promise<void>;\n\n /** Report progress (0–100) during execution. */\n reportProgress(value: number): void;\n\n /** Reset to `idle`, clear data, error, and progress. */\n reset(): void;\n}\n\n/**\n * Create a mutation async state — for explicit user-triggered actions.\n *\n * Must be called in an injection context (field initializer or constructor)\n * because it uses `inject(DestroyRef)` for cleanup.\n *\n * ```typescript\n * readonly saveResident = createAsyncState<Resident>();\n *\n * async handleSave(): Promise<void> {\n * await this.saveResident.execute(\n * () => this.api.save(this.form().value())\n * );\n * }\n * ```\n *\n * @category common/data/async-state\n */\nexport function createAsyncState<T>(): MutableAsyncState<T> {\n const destroyRef = inject(DestroyRef);\n const state: ManualAsyncState<T> = createManualState<T>();\n\n let abortController: AbortController | undefined;\n\n destroyRef.onDestroy(() => {\n abortController?.abort();\n abortController = undefined;\n });\n\n return {\n status: state.status,\n data: state.data,\n error: state.error,\n progress: state.progress,\n isLoading: state.isLoading,\n isPending: state.isPending,\n isRefreshing: state.isRefreshing,\n isBusy: state.isBusy,\n isFirstLoad: state.isFirstLoad,\n isEmpty: state.isEmpty,\n hasData: state.hasData,\n isSettled: state.isSettled,\n lastUpdated: state.lastUpdated,\n\n async execute(fn: () => Promise<T> | Observable<T>): Promise<void> {\n abortController?.abort();\n const controller = new AbortController();\n abortController = controller;\n\n state.set('pending');\n state.setProgress(undefined);\n\n try {\n const result$ = fn();\n const result = isObservable(result$) ? await firstValueFrom(result$) : await result$;\n\n if (controller.signal.aborted) {\n return;\n }\n\n state.setSuccess(result);\n } catch (err: unknown) {\n if (controller.signal.aborted) {\n return;\n }\n state.setError(err);\n } finally {\n if (abortController === controller) {\n abortController = undefined;\n }\n }\n },\n\n reportProgress(value: number): void {\n state.setProgress(value);\n },\n\n reset(): void {\n abortController?.abort();\n abortController = undefined;\n state.reset();\n },\n };\n}\n","import { computed, Injectable, signal, type Signal } from '@angular/core';\nimport { nextUid, type AsyncStatus, type CngxAsyncState } from '@cngx/core/utils';\n\n/** @internal One registered async operation: its display label and its state. */\ninterface AsyncOperationEntry {\n readonly label?: string;\n readonly state: CngxAsyncState<unknown>;\n}\n\n/**\n * Read-only snapshot of one registered async operation.\n *\n * @category common/data/async-registry\n */\nexport interface CngxAsyncOperation {\n /** Per-operation uid minted at registration (`register`'s return value). */\n readonly id: string;\n /** Human-readable label, if one was supplied. Display only, never a key. */\n readonly label?: string;\n /** The operation's current status. */\n readonly status: AsyncStatus;\n}\n\n/** @internal Length-then-key-set equality for the operations Map signal. */\nfunction mapKeySetEqual<K, V>(a: ReadonlyMap<K, V>, b: ReadonlyMap<K, V>): boolean {\n if (a === b) {\n return true;\n }\n if (a.size !== b.size) {\n return false;\n }\n for (const key of a.keys()) {\n if (!b.has(key)) {\n return false;\n }\n }\n return true;\n}\n\n/** @internal Element-wise equality on (id, label, status) for the view array. */\nfunction operationsEqual(\n a: readonly CngxAsyncOperation[],\n b: readonly CngxAsyncOperation[],\n): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const x = a[i];\n const y = b[i];\n if (x.id !== y.id || x.label !== y.label || x.status !== y.status) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Opt-in aggregation registry for in-flight async operations.\n *\n * A single derived source for \"is anything loading?\" across a whole app: the\n * shell binds one `isAnythingLoading()` instead of N hand-maintained flags.\n * Producers register their `CngxAsyncState` (via `injectAsyncState({ register:\n * true })`, the HTTP interceptor, or directly) and unregister on teardown.\n *\n * Not `providedIn: 'root'` - consumers opt in with {@link provideAsyncRegistry}.\n * When the registry is absent, producers skip registration entirely.\n *\n * **Keyed by a per-operation uid, not the human label.** Async operations are\n * transient and collide on label; uid identity keeps N concurrent same-label\n * (or unlabeled) operations independent, so one `unregister` evicts exactly\n * its own entry. This is the one deliberate divergence from `CngxErrorRegistry`\n * (which keys by a stable scope name).\n *\n * Both views are `computed()` only - no `effect`, no service calls. Inner\n * status reactivity flows through each entry's `CngxAsyncState` signals; the\n * Map signal's `mapKeySetEqual` short-circuits register/unregister churn\n * without hiding status changes.\n *\n * @category common/data/async-registry\n */\n@Injectable()\nexport class CngxAsyncRegistry {\n private readonly entriesState = signal<ReadonlyMap<string, AsyncOperationEntry>>(new Map(), {\n equal: mapKeySetEqual,\n });\n\n /**\n * `true` when at least one registered operation reports `isLoading()`\n * (`loading`, `pending`, or `refreshing`).\n */\n readonly isAnythingLoading: Signal<boolean> = computed(() => {\n for (const entry of this.entriesState().values()) {\n if (entry.state.isLoading()) {\n return true;\n }\n }\n return false;\n });\n\n /** Every registered operation with its current status, in registration order. */\n readonly activeOperations: Signal<readonly CngxAsyncOperation[]> = computed(\n () =>\n Array.from(this.entriesState(), ([id, entry]) => ({\n id,\n label: entry.label,\n status: entry.state.status(),\n })),\n { equal: operationsEqual },\n );\n\n /**\n * Registers an async state under a fresh per-operation uid and returns it.\n * The optional `label` is display metadata only - never the map key, so\n * concurrent same-label (or unlabeled) operations stay independent.\n */\n register(state: CngxAsyncState<unknown>, label?: string): string {\n const id = nextUid('cngx-async-op');\n const next = new Map(this.entriesState());\n next.set(id, { label, state });\n this.entriesState.set(next);\n return id;\n }\n\n /** Removes the operation with the given uid. No-op if absent. */\n unregister(id: string): void {\n const current = this.entriesState();\n if (!current.has(id)) {\n return;\n }\n const next = new Map(current);\n next.delete(id);\n this.entriesState.set(next);\n }\n}\n","import { type EnvironmentProviders, inject, makeEnvironmentProviders } from '@angular/core';\nimport { CngxAsyncRegistry } from './async-registry';\n\n/**\n * Provides {@link CngxAsyncRegistry} in the host environment.\n *\n * Opt-in - not `providedIn: 'root'`. Add it to `bootstrapApplication`\n * providers to enable app-wide async observability; producers that opt in\n * (`injectAsyncState({ register: true })`, `provideAsyncHttpObservability()`)\n * then surface in `isAnythingLoading()` / `activeOperations()`.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideAsyncRegistry()],\n * });\n * ```\n *\n * @category common/data/async-registry\n */\nexport function provideAsyncRegistry(): EnvironmentProviders {\n return makeEnvironmentProviders([CngxAsyncRegistry]);\n}\n\n/**\n * Returns the ambient {@link CngxAsyncRegistry}, or `null` when the consumer\n * did not opt in via {@link provideAsyncRegistry}. Must run in an injection\n * context.\n *\n * @category common/data/async-registry\n */\nexport function injectAsyncRegistry(): CngxAsyncRegistry | null {\n return inject(CngxAsyncRegistry, { optional: true });\n}\n","import { DestroyRef, effect, inject, untracked } from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { isObservable, type Observable, type Subscription } from 'rxjs';\n\nimport { createManualState, type ManualAsyncState } from './create-manual-state';\nimport { injectAsyncRegistry } from '../async-registry/provide-async-registry';\n\n/**\n * Configuration options for `injectAsyncState`.\n *\n * @category common/data/async-state\n */\nexport interface InjectAsyncStateOptions {\n /**\n * Debounce time in ms for signal dependency changes.\n * Prevents request storms when multiple signals change rapidly.\n * @default 50\n */\n debounce?: number;\n\n /**\n * Human-readable label surfaced in `CngxAsyncRegistry.activeOperations`.\n * Display only - never the registry key. Ignored unless `register` is set.\n */\n label?: string;\n\n /**\n * When `true`, register this state in the ambient `CngxAsyncRegistry` (if\n * one is provided via `provideAsyncRegistry()`) for the injector's lifetime,\n * and unregister automatically on destroy. Defaults to `false` - a no-op for\n * existing callers, and a no-op when no registry is provided.\n */\n register?: boolean;\n}\n\n/**\n * Reactive async state returned by `injectAsyncState`.\n *\n * Extends the read-only `CngxAsyncState` with a `refresh()` method\n * to explicitly re-trigger the query.\n *\n * @category common/data/async-state\n */\nexport interface ReactiveAsyncState<T> extends CngxAsyncState<T> {\n /** Explicitly re-trigger the query. */\n refresh(): void;\n}\n\n/**\n * Create a reactive async state that auto-loads when signal dependencies change.\n *\n * Must be called in an injection context (field initializer or constructor).\n * The computation function is tracked by Angular's `effect()` — any signal\n * read inside `fn` will cause a re-load when it changes.\n *\n * ```typescript\n * readonly residents = injectAsyncState(\n * () => this.api.getResidents(this.filter())\n * );\n * // Loads automatically when filter() changes.\n * // Caches last result during refresh (refreshing state).\n * // Deduplicates parallel requests.\n * ```\n *\n * @category common/data/async-state\n */\nexport function injectAsyncState<T>(\n fn: () => Promise<T> | Observable<T>,\n options?: InjectAsyncStateOptions,\n): ReactiveAsyncState<T> {\n const destroyRef = inject(DestroyRef);\n const state: ManualAsyncState<T> = createManualState<T>();\n const debounceMs = options?.debounce ?? 50;\n\n let activeSubscription: Subscription | undefined;\n let abortController: AbortController | undefined;\n let debounceTimer: ReturnType<typeof setTimeout> | undefined;\n\n function cancelInFlight(): void {\n activeSubscription?.unsubscribe();\n activeSubscription = undefined;\n abortController?.abort();\n abortController = undefined;\n }\n\n destroyRef.onDestroy(() => {\n cancelInFlight();\n if (debounceTimer !== undefined) {\n clearTimeout(debounceTimer);\n debounceTimer = undefined;\n }\n });\n\n // Opt-in observability: register with the ambient CngxAsyncRegistry (if any)\n // under a fresh per-operation uid, and unregister on destroy. No-op when the\n // caller did not opt in, or when no registry is provided.\n if (options?.register) {\n const registry = injectAsyncRegistry();\n if (registry) {\n const operationId = registry.register(state, options.label);\n destroyRef.onDestroy(() => registry.unregister(operationId));\n }\n }\n\n function executeQuery(computation: () => Promise<T> | Observable<T>): void {\n cancelInFlight();\n\n // first load -> loading, subsequent -> refreshing\n const status = untracked(state.isFirstLoad) ? 'loading' : 'refreshing';\n state.set(status);\n\n const result$ = computation();\n\n if (isObservable(result$)) {\n let hasEmitted = false;\n activeSubscription = result$.subscribe({\n next: (value) => {\n hasEmitted = true;\n state.setSuccess(value);\n },\n error: (err: unknown) => state.setError(err),\n complete: () => {\n if (!hasEmitted) {\n // completed without emitting -> empty success\n state.setSuccess(undefined as T);\n }\n },\n });\n } else {\n const controller = new AbortController();\n abortController = controller;\n\n result$\n .then(\n (value) => {\n if (!controller.signal.aborted) {\n state.setSuccess(value);\n }\n },\n (err: unknown) => {\n if (!controller.signal.aborted) {\n state.setError(err);\n }\n },\n )\n .finally(() => {\n if (abortController === controller) {\n abortController = undefined;\n }\n });\n }\n }\n\n // fn() runs once per cycle; signals read inside it track via effect.\n // Result is captured and run after debounce.\n effect(() => {\n let result: Promise<T> | Observable<T>;\n try {\n result = fn();\n } catch (err: unknown) {\n // sync throw (e.g. required signal not yet set) — debounce the error\n // to match the async path\n if (debounceTimer !== undefined) {\n clearTimeout(debounceTimer);\n }\n debounceTimer = setTimeout(() => {\n debounceTimer = undefined;\n state.setError(err);\n }, debounceMs);\n return;\n }\n\n if (debounceTimer !== undefined) {\n clearTimeout(debounceTimer);\n }\n\n const captured = result;\n debounceTimer = setTimeout(() => {\n debounceTimer = undefined;\n void executeQuery(() => captured);\n }, debounceMs);\n });\n\n return {\n status: state.status,\n data: state.data,\n error: state.error,\n progress: state.progress,\n isLoading: state.isLoading,\n isPending: state.isPending,\n isRefreshing: state.isRefreshing,\n isBusy: state.isBusy,\n isFirstLoad: state.isFirstLoad,\n isEmpty: state.isEmpty,\n hasData: state.hasData,\n isSettled: state.isSettled,\n lastUpdated: state.lastUpdated,\n\n refresh(): void {\n if (debounceTimer !== undefined) {\n clearTimeout(debounceTimer);\n debounceTimer = undefined;\n }\n void executeQuery(fn);\n },\n };\n}\n","import type { AsyncStatus } from '@cngx/core/utils';\n\n/**\n * Possible view states for async content rendering.\n *\n * @category common/data/async-state\n */\nexport type AsyncView = 'none' | 'skeleton' | 'content' | 'empty' | 'error' | 'content+error';\n\n/**\n * Pure function that resolves which view to show based on async state.\n *\n * Encodes the state machine as a lookup table — no branching:\n *\n * | status | firstLoad | empty | view |\n * |-------------|-----------|-------|---------------|\n * | idle | true | * | none |\n * | loading | true | * | skeleton |\n * | refreshing | true | * | skeleton |\n * | pending | true | * | skeleton |\n * | error | true | * | error |\n * | success | * | true | empty |\n * | error | false | * | content+error |\n * | (all other) | * | * | content |\n *\n * @category common/data/async-state\n */\nexport function resolveAsyncView(\n status: AsyncStatus,\n firstLoad: boolean,\n empty: boolean,\n): AsyncView {\n if (firstLoad) {\n switch (status) {\n case 'idle':\n return 'none';\n case 'loading':\n case 'refreshing':\n case 'pending':\n return 'skeleton';\n case 'error':\n return 'error';\n }\n }\n\n if (status === 'success' && empty) {\n return 'empty';\n }\n\n if (status === 'error') {\n return 'content+error';\n }\n\n return 'content';\n}\n","import { computed, effect, type Resource, signal } from '@angular/core';\nimport type { AsyncStatus, CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Bridge that projects an Angular `Resource<T>` onto `CngxAsyncState<T>`.\n *\n * Must be called in an injection context (the `effect()` that tracks\n * `hadSuccess` requires one).\n *\n * All signals are derived reactively from the resource — no manual\n * synchronization. The resource stays the single source of truth.\n *\n * ```typescript\n * private readonly res = resource({\n * request: () => ({ filter: this.filter() }),\n * loader: ({ request, abortSignal }) =>\n * fetch(`/api/items?q=${request.filter}`, { signal: abortSignal })\n * .then(r => r.json()),\n * });\n *\n * readonly items = fromResource(this.res);\n * // items.status(), items.data(), items.isFirstLoad() — all work\n * // <cngx-async-container [state]=\"items\"> — direct binding\n * ```\n *\n * @category common/data/async-state\n */\nexport function fromResource<T>(ref: Resource<T>): CngxAsyncState<T> {\n // Track whether a successful load has ever occurred.\n // Needed because ResourceStatus has no \"first load\" concept.\n const hadSuccess = signal(false);\n\n effect(() => {\n const s = ref.status();\n if (s === 'resolved' || s === 'local') {\n hadSuccess.set(true);\n }\n });\n\n const status = computed((): AsyncStatus => {\n switch (ref.status()) {\n case 'idle':\n return 'idle';\n case 'loading':\n return 'loading';\n case 'reloading':\n return 'refreshing';\n case 'resolved':\n case 'local':\n return 'success';\n case 'error':\n return 'error';\n }\n });\n\n const data = computed(() => (ref.hasValue() ? ref.value() : undefined));\n const error = computed(() => ref.error());\n\n const isLoading = computed(() => status() === 'loading');\n const isPending = computed(() => false); // resource() has no mutation concept\n const isRefreshing = computed(() => status() === 'refreshing');\n const isBusy = computed(() => ref.isLoading());\n const isFirstLoad = computed(() => !hadSuccess() && (isBusy() || status() === 'idle'));\n const isEmpty = computed(() => {\n const d = data();\n return d == null || (Array.isArray(d) && d.length === 0);\n });\n const hasData = computed(() => ref.hasValue() && !isEmpty());\n const isSettled = computed(() => {\n const s = status();\n return s === 'success' || s === 'error';\n });\n const lastUpdated = signal<Date | undefined>(undefined);\n\n effect(() => {\n const s = ref.status();\n if (s === 'resolved' || s === 'local') {\n lastUpdated.set(new Date());\n }\n });\n\n return {\n status,\n data,\n error,\n progress: signal(undefined).asReadonly(),\n isLoading,\n isPending,\n isRefreshing,\n isBusy,\n isFirstLoad,\n isEmpty,\n hasData,\n isSettled,\n lastUpdated: lastUpdated.asReadonly(),\n };\n}\n","import { computed, effect, type Resource, signal } from '@angular/core';\nimport type { AsyncStatus, CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Shape of an `HttpResourceRef` — only the signals we need.\n *\n * Declared here to avoid a hard dependency on `@angular/common/http`.\n * The consumer passes the actual `httpResource()` return value which\n * satisfies this interface at runtime.\n */\ninterface HttpResourceLike<T> extends Resource<T> {\n progress: () => number | undefined;\n}\n\n/**\n * Bridge that projects an Angular `httpResource()` ref onto `CngxAsyncState<T>`.\n *\n * Identical to `fromResource` but additionally maps the HTTP progress\n * signal to `CngxAsyncState.progress` (0–100 scale).\n *\n * Must be called in an injection context.\n *\n * ```typescript\n * private readonly res = httpResource<Item[]>(() => ({\n * url: '/api/items',\n * params: { q: this.filter() },\n * }));\n *\n * readonly items = fromHttpResource(this.res);\n * // items.progress() tracks upload/download progress\n * // <cngx-progress [state]=\"items\"> — auto-wired progress bar\n * ```\n *\n * @category common/data/async-state\n */\nexport function fromHttpResource<T>(ref: HttpResourceLike<T>): CngxAsyncState<T> {\n const hadSuccess = signal(false);\n\n effect(() => {\n const s = ref.status();\n if (s === 'resolved' || s === 'local') {\n hadSuccess.set(true);\n }\n });\n\n const status = computed((): AsyncStatus => {\n switch (ref.status()) {\n case 'idle':\n return 'idle';\n case 'loading':\n return 'loading';\n case 'reloading':\n return 'refreshing';\n case 'resolved':\n case 'local':\n return 'success';\n case 'error':\n return 'error';\n }\n });\n\n const data = computed(() => (ref.hasValue() ? ref.value() : undefined));\n const error = computed(() => ref.error());\n\n // Map HTTP progress (0–1 float) to 0–100 integer, clamped\n const progress = computed(() => {\n const p = ref.progress();\n if (p == null) {\n return undefined;\n }\n return Math.round(Math.min(p, 1) * 100);\n });\n\n const isLoading = computed(() => status() === 'loading');\n const isPending = computed(() => false);\n const isRefreshing = computed(() => status() === 'refreshing');\n const isBusy = computed(() => ref.isLoading());\n const isFirstLoad = computed(() => !hadSuccess() && isBusy());\n const isEmpty = computed(() => {\n const d = data();\n return d == null || (Array.isArray(d) && d.length === 0);\n });\n const hasData = computed(() => ref.hasValue() && !isEmpty());\n const isSettled = computed(() => {\n const s = status();\n return s === 'success' || s === 'error';\n });\n const lastUpdated = signal<Date | undefined>(undefined);\n\n effect(() => {\n const s = ref.status();\n if (s === 'resolved' || s === 'local') {\n lastUpdated.set(new Date());\n }\n });\n\n return {\n status,\n data,\n error,\n progress,\n isLoading,\n isPending,\n isRefreshing,\n isBusy,\n isFirstLoad,\n isEmpty,\n hasData,\n isSettled,\n lastUpdated: lastUpdated.asReadonly(),\n };\n}\n","import {\n type MonoTypeOperatorFunction,\n type Observable,\n type OperatorFunction,\n defer,\n filter,\n map,\n tap,\n} from 'rxjs';\n\n/**\n * Minimal write interface for async state operators.\n *\n * Any `ManualAsyncState<T>` satisfies this — operators only need the write side.\n */\ninterface AsyncStateSink<T> {\n set(status: 'loading' | 'refreshing' | 'pending'): void;\n setSuccess(data: T): void;\n setError(error: unknown): void;\n setProgress(value: number | undefined): void;\n}\n\n/**\n * RxJS operator that wires an Observable's lifecycle to a `ManualAsyncState`.\n *\n * On subscribe: sets `loading` (or `refreshing` if data was already loaded).\n * On next: calls `setSuccess(value)`.\n * On error: calls `setError(err)` and **re-throws** (does not swallow).\n *\n * The Observable passes through unchanged — `tapAsyncState` is a side-effect operator.\n *\n * ```typescript\n * readonly residents = createManualState<Resident[]>();\n *\n * load(): void {\n * this.http.get<Resident[]>('/api/residents').pipe(\n * tapAsyncState(this.residents),\n * takeUntilDestroyed(this.destroyRef),\n * ).subscribe();\n * }\n * ```\n *\n * @category common/data/async-state\n */\nexport function tapAsyncState<T>(\n state: AsyncStateSink<T>,\n options?: { status?: 'loading' | 'refreshing' | 'pending' },\n): MonoTypeOperatorFunction<T> {\n return (source: Observable<T>) =>\n defer(() => {\n state.set(options?.status ?? 'loading');\n return source.pipe(\n tap({\n next: (value) => state.setSuccess(value),\n error: (err: unknown) => state.setError(err),\n }),\n );\n });\n}\n\n/**\n * Shape of an Angular `HttpProgressEvent` — declared structurally to\n * avoid a hard import on `@angular/common/http` from this entry point.\n */\ninterface HttpProgressLike {\n type: number; // HttpEventType.UploadProgress = 1, DownloadProgress = 3\n loaded: number;\n total?: number;\n}\n\n/**\n * Shape of an Angular `HttpResponse` — declared structurally.\n */\ninterface HttpResponseLike<T> {\n type: number; // HttpEventType.Response = 4\n body: T | null;\n}\n\n// HttpEventType values (from @angular/common/http)\nconst UPLOAD_PROGRESS = 1;\nconst DOWNLOAD_PROGRESS = 3;\nconst RESPONSE = 4;\n\n/**\n * RxJS operator that extracts upload/download progress from an\n * `HttpEvent` stream and reports it to a `ManualAsyncState`.\n *\n * Filters progress events, calculates percentage, calls `setProgress()`.\n * Non-progress events pass through unchanged.\n *\n * Use with `{ observe: 'events', reportProgress: true }` on HttpClient.\n *\n * ```typescript\n * readonly upload = createManualState<UploadResult>();\n *\n * handleUpload(file: File): void {\n * this.http.post('/api/upload', file, {\n * reportProgress: true,\n * observe: 'events',\n * }).pipe(\n * tapAsyncProgress(this.upload),\n * takeUntilDestroyed(this.destroyRef),\n * ).subscribe();\n * }\n * ```\n *\n * @category common/data/async-state\n */\nexport function tapAsyncProgress<E>(\n state: Pick<AsyncStateSink<unknown>, 'setProgress'>,\n): MonoTypeOperatorFunction<E> {\n return tap((event) => {\n const e = event as unknown as HttpProgressLike;\n if (\n (e.type === UPLOAD_PROGRESS || e.type === DOWNLOAD_PROGRESS) &&\n e.total != null &&\n e.total > 0\n ) {\n state.setProgress(Math.round((100 * e.loaded) / e.total));\n }\n });\n}\n\n/**\n * RxJS operator that combines `tapAsyncState` + `tapAsyncProgress` for HTTP event streams.\n *\n * Pipe this onto an `HttpClient` call with `{ observe: 'events', reportProgress: true }`.\n * It will:\n * 1. Set `loading` on subscribe\n * 2. Report upload/download progress via `setProgress()`\n * 3. Extract the response body on `HttpEventType.Response`\n * 4. Call `setSuccess(body)` with the extracted body\n * 5. Call `setError(err)` on error\n *\n * The output Observable emits the **response body** (not HttpEvents).\n * Throws if the response body is `null`.\n *\n * ```typescript\n * readonly upload = createManualState<UploadResult>();\n *\n * handleUpload(file: File): void {\n * this.http.post('/api/upload', file, {\n * reportProgress: true,\n * observe: 'events',\n * }).pipe(\n * tapHttpAsyncState(this.upload),\n * takeUntilDestroyed(this.destroyRef),\n * ).subscribe();\n * // upload.status(), upload.progress(), upload.data() — all wired\n * }\n * ```\n *\n * @category common/data/async-state\n */\nexport function tapHttpAsyncState<T>(\n state: AsyncStateSink<T>,\n options?: { status?: 'loading' | 'refreshing' | 'pending' },\n): OperatorFunction<unknown, T> {\n return (source: Observable<unknown>) =>\n defer(() => {\n state.set(options?.status ?? 'loading');\n return source.pipe(\n tapAsyncProgress<unknown>(state),\n filter((event): event is HttpResponseLike<T> => {\n return (event as HttpResponseLike<T>).type === RESPONSE;\n }),\n map((response) => {\n if (response.body == null) {\n throw new Error('tapHttpAsyncState: response body is null');\n }\n return response.body;\n }),\n tap({\n next: (value) => state.setSuccess(value),\n error: (err: unknown) => state.setError(err),\n }),\n );\n });\n}\n","import { HttpContext, HttpContextToken } from '@angular/common/http';\n\n/**\n * Per-request label surfaced in `CngxAsyncRegistry.activeOperations` when the\n * request is tracked by `cngxAsyncInterceptor`. Display only, never a key.\n *\n * @category common/data/async-registry\n */\nexport const CNGX_ASYNC_LABEL = new HttpContextToken<string | undefined>(() => undefined);\n\n/**\n * Per-request opt-out. When `true`, `cngxAsyncInterceptor` passes the request\n * through without registering it - keeps polling / telemetry pings out of the\n * aggregate without a global allow-list.\n *\n * @category common/data/async-registry\n */\nexport const CNGX_ASYNC_SKIP = new HttpContextToken<boolean>(() => false);\n\n/**\n * Returns an `HttpContext` that labels the request for async observability.\n * Pass an existing context to chain with other tokens.\n *\n * ```typescript\n * this.http.get('/api/users', { context: withAsyncLabel('users') });\n * ```\n *\n * @category common/data/async-registry\n */\nexport function withAsyncLabel(label: string, context: HttpContext = new HttpContext()): HttpContext {\n return context.set(CNGX_ASYNC_LABEL, label);\n}\n\n/**\n * Returns an `HttpContext` that opts the request out of async observability.\n * Pass an existing context to chain with other tokens.\n *\n * ```typescript\n * this.http.get('/api/ping', { context: withAsyncSkip() });\n * ```\n *\n * @category common/data/async-registry\n */\nexport function withAsyncSkip(context: HttpContext = new HttpContext()): HttpContext {\n return context.set(CNGX_ASYNC_SKIP, true);\n}\n","import { type EnvironmentProviders, inject, makeEnvironmentProviders } from '@angular/core';\nimport {\n HttpEventType,\n type HttpInterceptorFn,\n provideHttpClient,\n withInterceptors,\n} from '@angular/common/http';\nimport { finalize, tap } from 'rxjs';\nimport { createManualState } from '../async-state/create-manual-state';\nimport { CngxAsyncRegistry } from './async-registry';\nimport { CNGX_ASYNC_LABEL, CNGX_ASYNC_SKIP } from './http-context';\n\n/**\n * Functional HTTP interceptor that surfaces every in-flight `HttpRequest` in\n * the ambient {@link CngxAsyncRegistry}, so `isAnythingLoading()` aggregates\n * raw HTTP traffic alongside explicit component states.\n *\n * Fully opt-in and self-contained:\n * - Resolves `inject(CngxAsyncRegistry, { optional: true })` and passes the\n * request straight through when no registry is provided - zero behaviour\n * change for consumers who do not opt in.\n * - Passes through without registering when `CNGX_ASYNC_SKIP` is set.\n * - Otherwise registers a fresh `createManualState` (set `loading`) under a\n * per-request uid, maps the final response / error onto it, and\n * `unregister`s in a `finalize` that fires on success **and** error (and on\n * unsubscribe), so a request can never pin the global loading state.\n *\n * Per-request uid identity (from `CngxAsyncRegistry`) means concurrent requests\n * sharing a label never evict one another - completing one leaves the other\n * tracked. The interceptor does not swallow errors: `setError` records the\n * failure, then the error propagates to the caller unchanged.\n *\n * @category common/data/async-registry\n */\nexport const cngxAsyncInterceptor: HttpInterceptorFn = (req, next) => {\n const registry = inject(CngxAsyncRegistry, { optional: true });\n if (!registry || req.context.get(CNGX_ASYNC_SKIP)) {\n return next(req);\n }\n\n const state = createManualState<unknown>();\n state.set('loading');\n const operationId = registry.register(state, req.context.get(CNGX_ASYNC_LABEL));\n\n return next(req).pipe(\n tap({\n next: (event) => {\n if (event.type === HttpEventType.Response) {\n state.setSuccess(event.body);\n }\n },\n error: (err: unknown) => state.setError(err),\n }),\n finalize(() => registry.unregister(operationId)),\n );\n};\n\n/**\n * Sets up `HttpClient` with {@link cngxAsyncInterceptor} so every request\n * surfaces in {@link CngxAsyncRegistry}. Opt-in - add it to\n * `bootstrapApplication` providers alongside `provideAsyncRegistry()`.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideAsyncRegistry(),\n * provideAsyncHttpObservability(),\n * ],\n * });\n * ```\n *\n * **Use this only when cngx owns the `HttpClient` setup.** It calls\n * `provideHttpClient(withInterceptors([cngxAsyncInterceptor]))` internally, so\n * an app that already calls `provideHttpClient` (especially with `withFetch()`\n * or other features) would get a second, feature-less `HttpClient`\n * configuration - last-provider-wins on `HttpBackend` can silently revert\n * `withFetch()` to the XHR backend. In that case do not call this; add the\n * exported {@link cngxAsyncInterceptor} to your own `withInterceptors` instead:\n *\n * ```ts\n * provideHttpClient(withFetch(), withInterceptors([authInterceptor, cngxAsyncInterceptor]))\n * ```\n *\n * @category common/data/async-registry\n */\nexport function provideAsyncHttpObservability(): EnvironmentProviders {\n return makeEnvironmentProviders([provideHttpClient(withInterceptors([cngxAsyncInterceptor]))]);\n}\n","import {\n computed,\n Directive,\n effect,\n type EmbeddedViewRef,\n inject,\n input,\n signal,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\nimport { resolveAsyncView, type AsyncView } from '../async-state/resolve-view';\n\n/**\n * Template context for the `*cngxAsync` content template.\n * `$implicit` provides the data value, typed via `ngTemplateContextGuard`.\n *\n * @category common/data/async-state\n */\nexport interface CngxAsyncContext<T> {\n /** The data value - bound via `let data` in microsyntax. */\n $implicit: T;\n /** Alias for `$implicit`. */\n cngxAsync: T;\n}\n\n/**\n * Structural directive for async state-driven content rendering.\n *\n * Renders different views based on the current `CngxAsyncState` status:\n * - **loading (first load)** → skeleton template (or nothing)\n * - **success + has data** → content template with typed data\n * - **success + empty** → empty template (or nothing)\n * - **error (first load)** → error template (or nothing)\n * - **refreshing / loading (with data)** → content template (old data stays visible)\n * - **error (with data)** → content template (old data stays visible)\n *\n * ### Minimal - just content\n * ```html\n * <ul *cngxAsync=\"residents; let data\">\n * @for (r of data; track r.id) { <li>{{ r.name }}</li> }\n * </ul>\n * ```\n *\n * ### With custom templates\n * ```html\n * <ul *cngxAsync=\"residents; let data; skeleton: skelTpl; empty: emptyTpl; error: errTpl\">\n * @for (r of data; track r.id) { <li>{{ r.name }}</li> }\n * </ul>\n *\n * <ng-template #skelTpl>\n * @for (i of [1,2,3]; track i) { <li class=\"skeleton-line\"></li> }\n * </ng-template>\n *\n * <ng-template #emptyTpl>\n * <li>No residents found.</li>\n * </ng-template>\n *\n * <ng-template #errTpl let-err>\n * <li>Error: {{ err }}</li>\n * </ng-template>\n * ```\n *\n * @category common/data/async-state\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/async/async.directive.ts\n * @since 0.1.0\n * @relatedTo injectAsyncState, createAsyncState, createManualState\n *\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/cngx-async-container-full-control-toast</example-url>\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/cngxasync-one-line</example-url>\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/cngxasync-with-custom-templates</example-url>\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/composition-overlay-container-toast</example-url>\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/createasyncstate-mutation</example-url>\n * <example-url>http://localhost:4200/#/ui/feedback/async-container/injectasyncstate-reactive-query</example-url>\n */\n@Directive({\n selector: '[cngxAsync]',\n standalone: true,\n})\nexport class CngxAsync<T> {\n private readonly vcr = inject(ViewContainerRef);\n private readonly contentTpl = inject<TemplateRef<CngxAsyncContext<T>>>(TemplateRef);\n\n /** The async state to render. */\n readonly cngxAsync = input.required<CngxAsyncState<T>>();\n\n /** Optional skeleton template shown during first load. */\n readonly cngxAsyncSkeleton = input<TemplateRef<unknown> | undefined>(undefined);\n\n /** Optional empty template shown when data is empty after success. */\n readonly cngxAsyncEmpty = input<TemplateRef<unknown> | undefined>(undefined);\n\n /** Optional error template shown on error during first load. Context: `{ $implicit: error }`. */\n readonly cngxAsyncError = input<TemplateRef<{ $implicit: unknown }> | undefined>(undefined);\n\n private readonly view = computed(() => {\n const s = this.cngxAsync();\n return resolveAsyncView(s.status(), s.isFirstLoad(), s.isEmpty());\n });\n\n private readonly currentView = signal<AsyncView>('none');\n private contentViewRef: EmbeddedViewRef<CngxAsyncContext<T>> | null = null;\n\n constructor() {\n effect(() => {\n const view = this.view();\n const s = this.cngxAsync();\n // content+error → show content (structural directive has no dual-render)\n const effective = view === 'content+error' ? 'content' : view;\n\n if (effective === this.currentView()) {\n this.updateContentContext(s);\n return;\n }\n\n this.vcr.clear();\n this.contentViewRef = null;\n this.currentView.set(effective);\n\n this.renderView(effective, s);\n });\n }\n\n private updateContentContext(s: CngxAsyncState<T>): void {\n if (!this.contentViewRef) {\n return;\n }\n const data = s.data();\n if (data === undefined) {\n return;\n }\n this.contentViewRef.context.$implicit = data;\n this.contentViewRef.context.cngxAsync = data;\n this.contentViewRef.markForCheck();\n }\n\n private renderView(view: AsyncView, s: CngxAsyncState<T>): void {\n switch (view) {\n case 'skeleton':\n this.renderTemplate(this.cngxAsyncSkeleton());\n break;\n case 'content':\n case 'content+error': {\n const data = s.data();\n this.contentViewRef = this.vcr.createEmbeddedView(this.contentTpl, {\n $implicit: data as T,\n cngxAsync: data as T,\n });\n break;\n }\n case 'empty':\n this.renderTemplate(this.cngxAsyncEmpty());\n break;\n case 'error':\n this.renderTemplate(this.cngxAsyncError(), { $implicit: s.error() });\n break;\n }\n }\n\n private renderTemplate(\n tpl: TemplateRef<unknown> | undefined,\n context?: Record<string, unknown>,\n ): void {\n if (tpl) {\n this.vcr.createEmbeddedView(tpl, context);\n }\n }\n\n /** Type guard for template type inference. */\n static ngTemplateContextGuard<T>(_dir: CngxAsync<T>, _ctx: unknown): _ctx is CngxAsyncContext<T> {\n return true;\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n LOCALE_ID,\n ViewEncapsulation,\n} from '@angular/core';\n\n/**\n * Displays a formatted numeric value with optional unit.\n *\n * Uses `Intl.NumberFormat` with the injected `LOCALE_ID` for locale-aware\n * formatting. Null values render as an em-dash.\n *\n * Composable - works inside any card variant, header, body, or standalone.\n *\n * ### Basic\n * ```html\n * <cngx-metric [value]=\"1234\" unit=\"bpm\" />\n * ```\n *\n * ### With format options\n * ```html\n * <cngx-metric [value]=\"99.6\" unit=\"%\" [format]=\"{ maximumFractionDigits: 1 }\" />\n * ```\n *\n * ### Inside a card\n * ```html\n * <cngx-card>\n * <header cngxCardHeader>Puls</header>\n * <cngx-metric cngxCardBody [value]=\"75\" unit=\"bpm\" />\n * </cngx-card>\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/metric/metric.component.ts\n * @since 0.1.0\n * @relatedTo CngxTrend, CngxCard\n *\n * <example-url>http://localhost:4200/#/common/data/metric/inside-a-card</example-url>\n * <example-url>http://localhost:4200/#/common/data/metric/standalone-metrics</example-url>\n */\n@Component({\n selector: 'cngx-metric',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-metric',\n // role=img makes the host a single labelled graphic so AT announces the\n // curated `aria-label` (value + unit) instead of the raw text on an\n // otherwise role=generic custom element, where aria-label is unreliably\n // exposed. Mirrors CngxDelta / CngxTrend.\n role: 'img',\n '[attr.aria-label]': 'accessibleValue()',\n },\n template: `\n <span class=\"cngx-metric__value\">{{ formattedValue() }}</span>\n @if (unit()) {\n <span class=\"cngx-metric__unit\">{{ unit() }}</span>\n }\n `,\n styleUrls: ['./metric.component.css'],\n})\nexport class CngxMetric {\n private readonly locale = inject(LOCALE_ID);\n\n /** Numeric or string value. `null` renders as a placeholder hyphen. */\n readonly value = input.required<number | string | null>();\n\n /** Unit suffix (e.g. \"bpm\", \"h\", \"%\", \"kg\"). */\n readonly unit = input<string | undefined>(undefined);\n\n /** `Intl.NumberFormatOptions` for the primary value. */\n readonly format = input<Intl.NumberFormatOptions | undefined>(undefined);\n\n /** @internal */\n readonly formattedValue = computed(() => {\n const v = this.value();\n if (v === null) {\n return '\\u2014';\n }\n if (typeof v === 'string') {\n return v;\n }\n return this.format()\n ? new Intl.NumberFormat(this.locale, this.format()).format(v)\n : v.toLocaleString(this.locale);\n });\n\n /** @internal Full accessible description including unit. */\n readonly accessibleValue = computed(() => {\n const v = this.formattedValue();\n const u = this.unit();\n return u ? `${v} ${u}` : v;\n });\n}\n","/**\n * Pure, framework-agnostic helpers that turn a signed delta value into the\n * three orthogonal signals a KPI atom renders: **direction** (which way the\n * arrow points), **sentiment** (whether the change is good or bad, which\n * drives colour and the SR word), and the formatted magnitude.\n *\n * Direction and sentiment are deliberately separate. `CngxTrend` colours by\n * direction (up = green); `CngxDelta` colours by sentiment, so a value that\n * dropped can still read as an improvement (churn down, latency down). Both\n * consume these helpers so the direction / glyph / format logic has a single\n * source of truth (Pillar 1) with no Angular dependency.\n */\n\n/** Which way the delta moved. `flat` is exactly zero. */\nexport type DeltaDirection = 'up' | 'down' | 'flat';\n\n/**\n * How to read the sign of a delta. `neutral` disables sentiment entirely\n * (direction still renders, colour stays neutral).\n */\nexport type DeltaPolarity = 'higher-is-better' | 'lower-is-better' | 'neutral';\n\n/** Good / bad / indifferent, derived from `direction × polarity`. */\nexport type DeltaSentiment = 'positive' | 'negative' | 'neutral';\n\n/** Percent (default, one fraction digit + `%`) or a locale-formatted absolute number. */\nexport type DeltaMode = 'percent' | 'absolute';\n\n/** `> 0 → up`, `< 0 → down`, `0 → flat`. */\nexport function deltaDirection(value: number): DeltaDirection {\n return value > 0 ? 'up' : value < 0 ? 'down' : 'flat';\n}\n\n/**\n * Combine movement with the caller's polarity. `flat` or `neutral` polarity\n * collapse to `neutral`; otherwise up is positive under `higher-is-better`\n * and negative under `lower-is-better` (and the reverse for down).\n */\nexport function deltaSentiment(\n direction: DeltaDirection,\n polarity: DeltaPolarity,\n): DeltaSentiment {\n if (direction === 'flat' || polarity === 'neutral') {\n return 'neutral';\n }\n const upIsGood = polarity === 'higher-is-better';\n const isGood = direction === 'up' ? upIsGood : !upIsGood;\n return isGood ? 'positive' : 'negative';\n}\n\n/** Arrow glyph for the direction: `↑` / `↓` / `→`. */\nexport function directionGlyph(direction: DeltaDirection): string {\n return direction === 'up' ? '↑' : direction === 'down' ? '↓' : '→';\n}\n\n/**\n * Format the magnitude. The sign is carried by the arrow and colour, not the\n * digits: a positive value gains a leading `+`, everything else prints its\n * absolute value unsigned. Percent mode appends a narrow-no-break-space + `%`\n * and defaults to one fraction digit; absolute mode uses the locale grouping.\n * A supplied `Intl.NumberFormatOptions` overrides the default digit handling\n * in both modes.\n */\nexport function formatDelta(\n value: number,\n mode: DeltaMode,\n locale: string,\n format?: Intl.NumberFormatOptions,\n): string {\n const abs = Math.abs(value);\n const prefix = value > 0 ? '+' : '';\n if (mode === 'percent') {\n const num = format ? new Intl.NumberFormat(locale, format).format(abs) : abs.toFixed(1);\n return `${prefix}${num}\\u202f%`;\n }\n const num = format ? new Intl.NumberFormat(locale, format).format(abs) : abs.toLocaleString(locale);\n return `${prefix}${num}`;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n LOCALE_ID,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { deltaDirection, directionGlyph, formatDelta } from '../shared/delta-format';\n\n/**\n * Displays a trend indicator with directional arrow and formatted percentage.\n *\n * Positive values show an up arrow, negative a down arrow, zero a right arrow.\n * The consumer can override the SR label for full context\n * (e.g. \"vs. last month\" instead of the generic default).\n *\n * ### Basic\n * ```html\n * <cngx-trend [value]=\"5.3\" />\n * ```\n *\n * ### With custom label\n * ```html\n * <cngx-trend [value]=\"-2.1\" label=\"-2.1% vs. last quarter\" />\n * ```\n *\n * ### Inside a card header\n * ```html\n * <cngx-card>\n * <header cngxCardHeader>\n * <span>Revenue</span>\n * <cngx-trend [value]=\"revenue().trend\" />\n * </header>\n * </cngx-card>\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/trend/trend.component.ts\n * @since 0.1.0\n * @relatedTo CngxMetric, CngxCard\n *\n * <example-url>http://localhost:4200/#/common/data/trend/composed-with-metric-in-a-card</example-url>\n * <example-url>http://localhost:4200/#/common/data/trend/trend-directions</example-url>\n */\n@Component({\n selector: 'cngx-trend',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-trend',\n // role=img makes the host a single labelled graphic so AT announces the\n // curated `aria-label` instead of the raw glyph text on an otherwise\n // role=generic custom element, where aria-label is unreliably exposed.\n role: 'img',\n '[class.cngx-trend--up]': 'value() > 0',\n '[class.cngx-trend--down]': 'value() < 0',\n '[attr.aria-label]': 'resolvedLabel()',\n },\n template: `\n <span aria-hidden=\"true\">{{ icon() }}</span>\n {{ formattedValue() }}\n `,\n styleUrls: ['./trend.component.css'],\n})\nexport class CngxTrend {\n private readonly locale = inject(LOCALE_ID);\n\n /** Trend percentage. Positive = up, negative = down, zero = flat. */\n readonly value = input.required<number>();\n\n /** Consumer-provided SR label override. When set, replaces the generated default. */\n readonly label = input<string | undefined>(undefined);\n\n /** @internal */\n protected readonly icon = computed(() => directionGlyph(deltaDirection(this.value())));\n\n /** @internal */\n protected readonly formattedValue = computed(() => formatDelta(this.value(), 'percent', this.locale));\n\n /** @internal */\n protected readonly resolvedLabel = computed(() => {\n if (this.label()) {\n return this.label()!;\n }\n const direction = deltaDirection(this.value());\n const dir = direction === 'up' ? 'up' : direction === 'down' ? 'down' : 'unchanged';\n return `${this.formattedValue()} ${dir}`;\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n LOCALE_ID,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport {\n deltaDirection,\n deltaSentiment,\n directionGlyph,\n formatDelta,\n type DeltaMode,\n type DeltaPolarity,\n type DeltaSentiment,\n} from '../shared/delta-format';\n\nconst SENTIMENT_WORD: Record<DeltaSentiment, string> = {\n positive: 'improved',\n negative: 'declined',\n neutral: 'unchanged',\n};\n\n/**\n * Sentiment-aware delta indicator. Where `CngxTrend` colours strictly by\n * direction (up = green), `CngxDelta` colours by **sentiment**: a `polarity`\n * of `lower-is-better` makes a drop read as an improvement (churn, latency,\n * error rate). The arrow glyph always tracks the raw direction, so colour is\n * never the only signal - a green value can carry a down arrow, and the SR\n * label speaks the sentiment word.\n *\n * Sentiment, direction, glyph and the formatted magnitude are each a\n * `computed()` off the single `value`/`polarity` input pair (Pillar 1); the\n * colour class and the arrow are bound from independent signals so they can\n * diverge (Pillar 2).\n *\n * ### Basic (higher-is-better default)\n * ```html\n * <cngx-delta [value]=\"5.3\" />\n * ```\n *\n * ### Lower-is-better (a drop is good)\n * ```html\n * <cngx-delta [value]=\"-2.1\" polarity=\"lower-is-better\" />\n * ```\n *\n * ### Absolute magnitude\n * ```html\n * <cngx-delta [value]=\"1240\" mode=\"absolute\" [format]=\"{ maximumFractionDigits: 0 }\" />\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/delta/delta.component.ts\n * @since 0.1.0\n * @relatedTo CngxTrend, CngxMetric, CngxStat\n *\n * <example-url>http://localhost:4200/#/common/data/delta/sentiment-polarity</example-url>\n */\n@Component({\n selector: 'cngx-delta',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-delta',\n // role=img makes the host a single labelled graphic so AT announces the\n // curated `aria-label` (the sentiment word) instead of the raw glyph text\n // on an otherwise role=generic custom element, where aria-label is\n // unreliably exposed.\n role: 'img',\n '[class.cngx-delta--positive]': \"sentiment() === 'positive'\",\n '[class.cngx-delta--negative]': \"sentiment() === 'negative'\",\n '[class.cngx-delta--neutral]': \"sentiment() === 'neutral'\",\n '[attr.aria-label]': 'resolvedLabel()',\n },\n template: `\n <span aria-hidden=\"true\">{{ glyph() }}</span>\n {{ formattedValue() }}\n `,\n styleUrls: ['./delta.component.css'],\n})\nexport class CngxDelta {\n private readonly locale = inject(LOCALE_ID);\n\n /** Signed delta. Positive = up, negative = down, zero = flat. */\n readonly value = input.required<number>();\n\n /**\n * How to read the sign. `higher-is-better` (default) treats a rise as\n * positive; `lower-is-better` inverts it; `neutral` disables sentiment\n * (direction still renders, colour stays neutral).\n */\n readonly polarity = input<DeltaPolarity>('higher-is-better');\n\n /** `percent` (default, one fraction digit + `%`) or `absolute`. */\n readonly mode = input<DeltaMode>('percent');\n\n /** `Intl.NumberFormatOptions` applied to the magnitude in either mode. */\n readonly format = input<Intl.NumberFormatOptions | undefined>(undefined);\n\n /** Consumer-provided SR label override. Replaces the generated default. */\n readonly label = input<string | undefined>(undefined);\n\n /** @internal Raw movement, independent of polarity. Drives the glyph. */\n protected readonly direction = computed(() => deltaDirection(this.value()));\n\n /** @internal Good / bad / indifferent. Drives colour and the SR word. */\n protected readonly sentiment = computed(() => deltaSentiment(this.direction(), this.polarity()));\n\n /** @internal Arrow glyph bound from direction only. */\n protected readonly glyph = computed(() => directionGlyph(this.direction()));\n\n /** @internal Formatted magnitude. */\n protected readonly formattedValue = computed(() =>\n formatDelta(this.value(), this.mode(), this.locale, this.format()),\n );\n\n /** @internal Full SR label: magnitude plus the sentiment word. */\n protected readonly resolvedLabel = computed(() => {\n const override = this.label();\n if (override) {\n return override;\n }\n return `${this.formattedValue()} ${SENTIMENT_WORD[this.sentiment()]}`;\n });\n}\n","import { InjectionToken } from '@angular/core';\n\n/** The four coordinated slots of a {@link CngxStat}, in reading order. */\nexport type CngxStatSlotKind = 'label' | 'value' | 'delta' | 'caption';\n\n/**\n * Slot-registration contract a `CngxStat` exposes to its projected slot\n * directives. Each slot registers its generated id on init and withdraws it\n * on destroy; the molecule derives the combined `aria-labelledby` from the\n * live registration set. Fronted by a DI token (not the concrete `CngxStat`\n * class) so the slots stay decompose-safe - the ejected skin talks to the\n * same token the library defines.\n */\nexport interface CngxStatRegistry {\n /** Register (or replace) the id contributed by `kind`. */\n register(kind: CngxStatSlotKind, id: string): void;\n /** Withdraw the id contributed by `kind`. */\n unregister(kind: CngxStatSlotKind): void;\n}\n\n/** DI token carrying the {@link CngxStatRegistry} a `CngxStat` provides. */\nexport const CNGX_STAT = new InjectionToken<CngxStatRegistry>('CNGX_STAT');\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { CNGX_STAT, type CngxStatRegistry, type CngxStatSlotKind } from './stat.token';\n\n/** Fixed reading order for the coordinated slots. */\nconst SLOT_ORDER: readonly CngxStatSlotKind[] = ['label', 'value', 'delta', 'caption'];\n\n/** Structural equality so an unchanged id set never cascades `labelledBy`. */\nconst idsEqual = (a: readonly string[], b: readonly string[]): boolean =>\n a.length === b.length && a.every((id, i) => id === b[i]);\n\n/**\n * Coordination molecule for a KPI stat. Its sole reason to exist is the\n * screen-reader layer (Pillar 2): hand-assembling a heading, a `<cngx-metric>`\n * and a `<cngx-delta>` makes a screen reader announce three disconnected\n * fragments. `CngxStat` projects the label / value / delta / caption slots,\n * collects the id each slot registers, and derives one `aria-labelledby` that\n * reads the whole stat as a single accessible name in reading order.\n *\n * Composition, never a config bag (Pillar 3): the molecule owns only the id\n * coordination `computed()` graph; the visuals are whatever atoms the\n * consumer projects into the slots.\n *\n * ```html\n * <cngx-stat aria-live=\"polite\">\n * <span cngxStatLabel>Revenue</span>\n * <cngx-metric cngxStatValue [value]=\"1.2\" unit=\"M EUR\" />\n * <cngx-delta cngxStatDelta [value]=\"5.3\" />\n * <span cngxStatCaption>vs. last quarter</span>\n * </cngx-stat>\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/stat/stat.component.ts\n * @since 0.1.0\n * @relatedTo CngxMetric, CngxDelta, CngxTrend\n *\n * <example-url>http://localhost:4200/#/common/data/stat/composed-kpi</example-url>\n */\n@Component({\n selector: 'cngx-stat',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_STAT, useExisting: CngxStat }],\n host: {\n class: 'cngx-stat',\n role: 'group',\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.aria-live]': 'live()',\n },\n template: `\n <ng-content select=\"[cngxStatLabel]\" />\n <div class=\"cngx-stat__row\">\n <ng-content select=\"[cngxStatValue]\" />\n <ng-content select=\"[cngxStatDelta]\" />\n </div>\n <ng-content select=\"[cngxStatCaption]\" />\n `,\n styleUrls: ['./stat.component.css'],\n})\nexport class CngxStat implements CngxStatRegistry {\n private readonly slots = signal<ReadonlyMap<CngxStatSlotKind, string>>(new Map());\n\n /**\n * Politeness of the live region. `off` (default) for a static stat;\n * `polite` / `assertive` for a KPI whose value updates in place.\n */\n readonly live = input<'off' | 'polite' | 'assertive'>('off');\n\n /** {@inheritDoc CngxStatRegistry.register} */\n register(kind: CngxStatSlotKind, id: string): void {\n this.slots.update((prev) => new Map(prev).set(kind, id));\n }\n\n /** {@inheritDoc CngxStatRegistry.unregister} */\n unregister(kind: CngxStatSlotKind): void {\n this.slots.update((prev) => {\n const next = new Map(prev);\n next.delete(kind);\n return next;\n });\n }\n\n /** @internal Present slot ids in reading order; structurally stable. */\n protected readonly orderedIds = computed(\n () => {\n const map = this.slots();\n return SLOT_ORDER.map((kind) => map.get(kind)).filter((id): id is string => id !== undefined);\n },\n { equal: idsEqual },\n );\n\n /** @internal Combined accessible name; `null` when no slot is present. */\n protected readonly labelledBy = computed(() => this.orderedIds().join(' ') || null);\n}\n","import { DestroyRef, Directive, inject } from '@angular/core';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_STAT, type CngxStatSlotKind } from './stat.token';\n\n/**\n * Generate a stable id, register it with the enclosing `CngxStat` (if any),\n * and withdraw it on destroy. Shared by the four slot directives via plain\n * composition - no base class, no inheritance (Pillar 3).\n */\nfunction useStatSlot(kind: CngxStatSlotKind): string {\n const registry = inject(CNGX_STAT, { optional: true });\n const id = nextUid(`cngx-stat-${kind}`);\n registry?.register(kind, id);\n inject(DestroyRef).onDestroy(() => registry?.unregister(kind));\n return id;\n}\n\n/**\n * Marks the label element of a {@link CngxStat}. Its generated id leads the\n * molecule's `aria-labelledby`.\n *\n * @category common/data/metric\n * @since 0.1.0\n * @relatedTo CngxStat\n */\n@Directive({\n selector: '[cngxStatLabel]',\n standalone: true,\n host: { '[id]': 'id' },\n})\nexport class CngxStatLabel {\n /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */\n readonly id = useStatSlot('label');\n}\n\n/**\n * Marks the primary value element of a {@link CngxStat} (typically a\n * `<cngx-metric>`).\n *\n * @category common/data/metric\n * @since 0.1.0\n * @relatedTo CngxStat\n */\n@Directive({\n selector: '[cngxStatValue]',\n standalone: true,\n host: { '[id]': 'id' },\n})\nexport class CngxStatValue {\n /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */\n readonly id = useStatSlot('value');\n}\n\n/**\n * Marks the delta element of a {@link CngxStat} (typically a `<cngx-delta>`\n * or `<cngx-trend>`).\n *\n * @category common/data/metric\n * @since 0.1.0\n * @relatedTo CngxStat\n */\n@Directive({\n selector: '[cngxStatDelta]',\n standalone: true,\n host: { '[id]': 'id' },\n})\nexport class CngxStatDelta {\n /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */\n readonly id = useStatSlot('delta');\n}\n\n/**\n * Marks the caption element of a {@link CngxStat} - the trailing context\n * line (e.g. \"vs. last quarter\").\n *\n * @category common/data/metric\n * @since 0.1.0\n * @relatedTo CngxStat\n */\n@Directive({\n selector: '[cngxStatCaption]',\n standalone: true,\n host: { '[id]': 'id' },\n})\nexport class CngxStatCaption {\n /** Auto-generated id bound to the host `[id]`; consumed by `CngxStat`. */\n readonly id = useStatSlot('caption');\n}\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n isDevMode,\n ViewEncapsulation,\n} from '@angular/core';\n\n/** Semantic health of a {@link CngxStatus}. */\nexport type StatusTone = 'success' | 'warning' | 'danger' | 'info' | 'neutral';\n\n/** Tone glyph rendered inside the decorative dot - the non-colour signal. */\nconst TONE_GLYPH: Record<StatusTone, string> = {\n success: '✓',\n warning: '!',\n danger: '✕',\n info: 'i',\n neutral: '•',\n};\n\n/**\n * Semantic health indicator - a decorative tone dot paired with a visible\n * label. Distinct from `CngxBadge` (count overlay), `CngxChip` (interactive)\n * and `CngxTag` (labeled token): its single job is to communicate a status\n * (operational / degraded / down / info).\n *\n * Colour is never the only signal (Pillar 2): the tone drives the dot colour\n * *and* a tone glyph, so a colour-blind reader still distinguishes the states,\n * and the visible `label` carries the meaning for assistive tech (the dot is\n * `aria-hidden`). Set `live` for a status that changes in place.\n *\n * ### Basic\n * ```html\n * <cngx-status tone=\"success\" label=\"Operational\" />\n * ```\n *\n * ### Live-updating\n * ```html\n * <cngx-status tone=\"danger\" label=\"Outage\" live=\"assertive\" />\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/status/status.component.ts\n * @since 0.1.0\n * @relatedTo CngxBadge, CngxTag, CngxChip\n *\n * <example-url>http://localhost:4200/#/common/data/status/tone-matrix</example-url>\n */\n@Component({\n selector: 'cngx-status',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-status',\n '[class.cngx-status--success]': \"tone() === 'success'\",\n '[class.cngx-status--warning]': \"tone() === 'warning'\",\n '[class.cngx-status--danger]': \"tone() === 'danger'\",\n '[class.cngx-status--info]': \"tone() === 'info'\",\n '[class.cngx-status--neutral]': \"tone() === 'neutral'\",\n '[attr.aria-live]': 'live()',\n },\n template: `\n <span class=\"cngx-status__dot\" aria-hidden=\"true\">{{ glyph() }}</span>\n @if (label()) {\n <span class=\"cngx-status__label\">{{ label() }}</span>\n }\n `,\n styleUrls: ['./status.component.css'],\n})\nexport class CngxStatus {\n private readonly elRef = inject(ElementRef<HTMLElement>);\n\n /** Semantic health. Drives both the dot colour and the tone glyph. */\n readonly tone = input<StatusTone>('neutral');\n\n /** Visible status text. Carries the meaning for assistive tech. */\n readonly label = input<string | undefined>(undefined);\n\n /**\n * Politeness of the live region. `off` (default) for a static status;\n * `polite` / `assertive` for a status that changes in place.\n */\n readonly live = input<'off' | 'polite' | 'assertive'>('off');\n\n /** @internal Tone glyph bound into the decorative dot. */\n protected readonly glyph = computed(() => TONE_GLYPH[this.tone()]);\n\n constructor() {\n if (isDevMode()) {\n afterNextRender(() => {\n const el = this.elRef.nativeElement as HTMLElement;\n if (!this.label() && !el.getAttribute('aria-label') && !el.getAttribute('aria-labelledby')) {\n console.warn(\n 'cngx-status: no `label` and no external `aria-label`/`aria-labelledby`; ' +\n 'the status has no accessible name and reads only as a coloured dot. ' +\n 'Set [label] or an aria-label on the host.',\n );\n }\n });\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n type Signal,\n ViewEncapsulation,\n} from '@angular/core';\n\n/**\n * Determinate attainment bar - a continuous progress toward a target\n * (quota reached, budget spent, goal met). Named `CngxGoal` because\n * `cngx-progress` is the indeterminate async loading bar; this is the\n * finished-fraction indicator, distinct from that and from the discrete\n * `CngxSegmentedProgress`.\n *\n * Mirrors the `CngxSegmentedProgress` a11y shape: `role=\"progressbar\"` with\n * the whole `aria-value*` set plus `aria-valuetext` living in the `computed()`\n * graph (Pillar 2). The value is clamped to `[0, max]`; the fill width is a\n * derived percent bound as a CSS custom property.\n *\n * ```html\n * <cngx-goal [value]=\"73\" [max]=\"100\" />\n * <cngx-goal [value]=\"q()\" [max]=\"target()\" [valueTextFormat]=\"quotaText\" />\n * ```\n *\n * @category common/data/metric\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/display/goal/goal.component.ts\n * @since 0.1.0\n * @relatedTo CngxSegmentedProgress, CngxMetric\n *\n * <example-url>http://localhost:4200/#/common/data/goal/quota-attainment</example-url>\n */\n@Component({\n selector: 'cngx-goal',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-goal',\n role: 'progressbar',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuemax]': 'maxValue()',\n '[attr.aria-valuenow]': 'now()',\n '[attr.aria-valuetext]': 'valueText()',\n '[style.--cngx-goal-fill.%]': 'fillPercent()',\n },\n template: `<span class=\"cngx-goal__track\"><span class=\"cngx-goal__fill\"></span></span>`,\n styleUrls: ['./goal.component.css'],\n})\nexport class CngxGoal {\n /** Current attainment. Clamped to `[0, max]`. */\n readonly value = input.required<number>();\n\n /** Target the value works toward. Defaults to `100`. */\n readonly max = input<number>(100);\n\n /**\n * Override the `aria-valuetext` string. Receives `(now, max)` - the clamped\n * value and the target. The default is `(now, max) => \\`${now} of ${max}\\``.\n * Supply a localised closure for richer text (e.g.\n * `(n, m) => \\`${n} of ${m}, ${Math.round((n / m) * 100)}% of quota\\``).\n */\n readonly valueTextFormat = input<((now: number, max: number) => string) | undefined>(undefined);\n\n /** `aria-valuemax` - the target, floored at 0. */\n protected readonly maxValue: Signal<number> = computed(() => Math.max(0, this.max()));\n\n /** `aria-valuenow` - value clamped into `[0, max]`. */\n protected readonly now: Signal<number> = computed(() =>\n Math.max(0, Math.min(this.value(), this.maxValue())),\n );\n\n /** Fill width as a percent of the target; `0` when the target is `0`. */\n protected readonly fillPercent: Signal<number> = computed(() => {\n const max = this.maxValue();\n return max === 0 ? 0 : (this.now() / max) * 100;\n });\n\n /** `aria-valuetext` - human-readable attainment via the resolved closure. */\n protected readonly valueText: Signal<string> = computed(() => {\n const fmt = this.valueTextFormat() ?? ((now: number, max: number) => `${now} of ${max}`);\n return fmt(this.now(), this.maxValue());\n });\n}\n","/**\n * Result of a range computation for virtual scrolling.\n *\n * `start`/`end` are item indices. `offsetBefore`/`offsetAfter`/`totalSize` are pixels.\n * In grid mode, offsets are row-based (rows = ceil(totalCount / columns)).\n *\n * @internal\n */\nexport interface RangeResult {\n /** Start index (inclusive) of the visible range. */\n readonly start: number;\n /** End index (exclusive) of the visible range. */\n readonly end: number;\n /** Height of the spacer before visible items (px). */\n readonly offsetBefore: number;\n /** Height of the spacer after visible items (px). */\n readonly offsetAfter: number;\n /** Total height of all items (px). */\n readonly totalSize: number;\n}\n\nconst EMPTY_RANGE: RangeResult = {\n start: 0,\n end: 0,\n offsetBefore: 0,\n offsetAfter: 0,\n totalSize: 0,\n};\n\n/**\n * Computes the visible range of items given scroll position, viewport size,\n * total item count, and item size estimation.\n *\n * Pure function - no DOM access, no Angular dependency. Fully testable.\n *\n * @param scrollTop Current scroll offset in px.\n * @param clientHeight Viewport height in px.\n * @param totalCount Total number of items.\n * @param estimateSize Fixed item height in px, or a function returning height per index.\n * @param overscan Number of extra items to render above/below the viewport.\n * @param columns Column count for grid mode (default 1). When > 1, range is row-aligned.\n * Variable `estimateSize` ignores columns (grid + variable heights not supported).\n * @returns The computed range with spacer offsets.\n * @internal\n */\nexport function computeRange(\n scrollTop: number,\n clientHeight: number,\n totalCount: number,\n estimateSize: number | ((index: number) => number),\n overscan: number,\n columns = 1,\n): RangeResult {\n if (totalCount <= 0 || clientHeight <= 0) {\n return EMPTY_RANGE;\n }\n\n if (typeof estimateSize === 'number') {\n return computeFixedRange(scrollTop, clientHeight, totalCount, estimateSize, overscan, columns);\n }\n\n // variable heights: grid mode unsupported, columns ignored\n return computeVariableRange(scrollTop, clientHeight, totalCount, estimateSize, overscan);\n}\n\nfunction computeFixedRange(\n scrollTop: number,\n clientHeight: number,\n totalCount: number,\n itemSize: number,\n overscan: number,\n columns: number,\n): RangeResult {\n if (columns > 1) {\n return computeGridRange(scrollTop, clientHeight, totalCount, itemSize, overscan, columns);\n }\n\n const totalSize = totalCount * itemSize;\n\n const rawStart = Math.floor(scrollTop / itemSize);\n const rawEnd = Math.ceil((scrollTop + clientHeight) / itemSize);\n\n const start = Math.max(0, rawStart - overscan);\n const end = Math.min(totalCount, rawEnd + overscan);\n\n return {\n start,\n end,\n offsetBefore: start * itemSize,\n offsetAfter: Math.max(0, (totalCount - end) * itemSize),\n totalSize,\n };\n}\n\n/**\n * Grid-mode range computation. Row-aligned before overscan.\n *\n * Order: raw visible rows → overscan rows → clamp → convert to item indices.\n * This ensures full rows are always rendered.\n *\n * @internal\n */\nfunction computeGridRange(\n scrollTop: number,\n clientHeight: number,\n totalCount: number,\n rowHeight: number,\n overscan: number,\n columns: number,\n): RangeResult {\n const totalRows = Math.ceil(totalCount / columns);\n const totalSize = totalRows * rowHeight;\n\n // raw rows (inherently row-aligned)\n const rawStartRow = Math.floor(scrollTop / rowHeight);\n const rawEndRow = Math.ceil((scrollTop + clientHeight) / rowHeight);\n\n // overscan applied in rows so full rows always render\n const overscanRows = Math.ceil(overscan / columns);\n const startRow = Math.max(0, rawStartRow - overscanRows);\n const endRow = Math.min(totalRows, rawEndRow + overscanRows);\n\n const start = startRow * columns;\n const end = Math.min(endRow * columns, totalCount);\n\n return {\n start,\n end,\n offsetBefore: startRow * rowHeight,\n offsetAfter: Math.max(0, (totalRows - endRow) * rowHeight),\n totalSize,\n };\n}\n\nfunction computeVariableRange(\n scrollTop: number,\n clientHeight: number,\n totalCount: number,\n estimateSize: (index: number) => number,\n overscan: number,\n): RangeResult {\n let totalSize = 0;\n const offsets = new Array<number>(totalCount + 1);\n offsets[0] = 0;\n\n for (let i = 0; i < totalCount; i++) {\n totalSize += estimateSize(i);\n offsets[i + 1] = totalSize;\n }\n\n // binary search: first item whose bottom edge is past scrollTop\n const rawStart = binarySearch(offsets, scrollTop, totalCount);\n const rawEnd = binarySearch(offsets, scrollTop + clientHeight, totalCount);\n\n const start = Math.max(0, rawStart - overscan);\n const end = Math.min(totalCount, rawEnd + 1 + overscan);\n\n return {\n start,\n end,\n offsetBefore: offsets[start],\n offsetAfter: Math.max(0, totalSize - offsets[end]),\n totalSize,\n };\n}\n\n/**\n * Finds the index of the first item whose cumulative offset exceeds `target`.\n *\n * @internal\n */\nfunction binarySearch(offsets: number[], target: number, totalCount: number): number {\n let low = 0;\n let high = totalCount - 1;\n\n while (low <= high) {\n const mid = (low + high) >>> 1;\n if (offsets[mid + 1] <= target) {\n low = mid + 1;\n } else if (offsets[mid] > target) {\n high = mid - 1;\n } else {\n return mid;\n }\n }\n\n return Math.min(low, totalCount - 1);\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n type DestroyRef,\n type ElementRef,\n type Signal,\n effect,\n inject,\n isDevMode,\n signal,\n untracked,\n} from '@angular/core';\n\n/**\n * Reactive scroll state of a container element.\n * Both signals are updated synchronously inside the same rAF callback —\n * Angular's Signal scheduling coalesces the two writes so consumers\n * evaluate once per frame, not twice.\n */\nexport interface ScrollState {\n readonly scrollTop: Signal<number>;\n readonly clientHeight: Signal<number>;\n /** The resolved scroll container element, or `null` if not yet resolved. */\n readonly element: Signal<HTMLElement | null>;\n}\n\n/**\n * Creates a reactive scroll observer for a container element.\n *\n * Element resolution happens **lazily inside the effect**, not at call time.\n * This is critical because `injectRecycler` is called in a field initializer\n * where template DOM does not yet exist — `querySelector` would return `null`.\n * The effect runs after the first CD cycle when the DOM is stable.\n *\n * @internal Not exported from `@cngx/common/data` public API.\n */\nexport function createScrollObserver(\n elementRef: ElementRef | HTMLElement | string,\n destroyRef: DestroyRef,\n): ScrollState {\n const doc = inject(DOCUMENT);\n const scrollTopState = signal(0);\n const clientHeightState = signal(0);\n const elementState = signal<HTMLElement | null>(null);\n\n // Retry trigger — incremented by afterNextRender to re-run the effect\n // when the element wasn't found on the first attempt (routed components,\n // content projection, lazy rendering).\n const retryTick = signal(0);\n\n // Late-mount watcher for the string-selector path. A viewport gated behind\n // async data (or a skeleton->content swap) can mount many renders after the\n // one-shot afterNextRender retry fires, so a single retry misses it. This\n // observer bumps retryTick the instant the selector matches, then\n // disconnects. Created only in the unresolved-string case; stays null on\n // every faster path.\n let mutationObserver: MutationObserver | null = null;\n\n function disconnectMutationObserver(): void {\n mutationObserver?.disconnect();\n mutationObserver = null;\n }\n\n function attachListeners(el: HTMLElement, onCleanup: (fn: () => void) => void): void {\n // A viewport resolved: the late-mount watcher has done its job. Disconnect\n // it on attach so it can never outlive a resolved element — the node is\n // already in the DOM, so the observer would otherwise never fire again and\n // leak until destroy.\n disconnectMutationObserver();\n elementState.set(el);\n scrollTopState.set(el.scrollTop);\n clientHeightState.set(el.clientHeight);\n\n let rafId: number | null = null;\n\n const handleScroll = () => {\n if (rafId != null) {\n return;\n }\n rafId = requestAnimationFrame(() => {\n rafId = null;\n scrollTopState.set(el.scrollTop);\n clientHeightState.set(el.clientHeight);\n });\n };\n\n el.addEventListener('scroll', handleScroll, { passive: true });\n\n const resizeObserver = new ResizeObserver(() => {\n clientHeightState.set(el.clientHeight);\n });\n resizeObserver.observe(el);\n\n onCleanup(() => {\n el.removeEventListener('scroll', handleScroll);\n if (rafId != null) {\n cancelAnimationFrame(rafId);\n }\n resizeObserver.disconnect();\n elementState.set(null);\n });\n }\n\n effect((onCleanup) => {\n retryTick(); // tracked: re-runs the effect after the retry tick bumps\n const el = resolveElement(elementRef, doc);\n if (!el) {\n return;\n }\n attachListeners(el, onCleanup);\n });\n\n // If the element wasn't found on the first effect run (before DOM is ready),\n // retry after the next render cycle. Fires for ALL input shapes — string\n // selectors resolve lazily via `querySelector`, but `ElementRef` from a\n // `viewChild` also starts out with `nativeElement == null` until Angular\n // resolves the query. `HTMLElement` inputs that are non-null at call time\n // short-circuit on the first effect run so the retry is a no-op.\n afterNextRender(() => {\n // untracked: afterNextRender may run in the same microtask as the effect.\n // Reading elementState() without untracked could create an unintended dependency\n // in whatever reactive context is active.\n if (untracked(() => elementState()) != null) {\n return;\n }\n // Element missing after the first render. Bump once for the common\n // next-render mount (routed component, content projection, lazy rendering).\n retryTick.update((v) => v + 1);\n\n // A string selector can still be unresolved because its viewport mounts\n // arbitrarily late — an async-gated list, a skeleton->content swap. Watch\n // the document and attach the instant it appears. Non-string refs\n // (HTMLElement / ElementRef) are not document-queryable, so the watcher\n // cannot help them; they stay on the single-retry path. Guard MutationObserver\n // for SSR.\n if (typeof elementRef !== 'string' || typeof MutationObserver === 'undefined') {\n return;\n }\n if (isDevMode()) {\n console.warn(\n `recycler scrollElement '${elementRef}' not found on first render; ` +\n 'it will attach automatically once it mounts. If it never does, check the selector.',\n );\n }\n mutationObserver = new MutationObserver(() => {\n if (resolveElement(elementRef, doc) == null) {\n return;\n }\n // Found it. Disconnect before the retry bump so the resolving effect run\n // never observes a live-but-spent watcher, then let the effect attach.\n disconnectMutationObserver();\n retryTick.update((v) => v + 1);\n });\n mutationObserver.observe(doc.documentElement, { childList: true, subtree: true });\n });\n\n destroyRef.onDestroy(() => {\n disconnectMutationObserver();\n elementState.set(null);\n });\n\n return {\n scrollTop: scrollTopState.asReadonly(),\n clientHeight: clientHeightState.asReadonly(),\n element: elementState.asReadonly(),\n };\n}\n\nfunction resolveElement(ref: ElementRef | HTMLElement | string, doc: Document): HTMLElement | null {\n if (typeof ref === 'string') {\n return doc.querySelector<HTMLElement>(ref);\n }\n if (ref instanceof HTMLElement) {\n return ref;\n }\n // ElementRef\n return (ref?.nativeElement as HTMLElement | null) ?? null;\n}\n","import { type Signal, signal } from '@angular/core';\n\n/**\n * Signal-based cache mapping item index to measured height.\n *\n * The `version` signal increments on every `set()`, allowing any `computed()`\n * that reads `version()` to re-evaluate when measurements change.\n *\n * @internal Not exported from `@cngx/common/data` public API.\n */\nexport interface SizeCache {\n /** Get measured size for an index, or `undefined` if not yet measured. */\n get(index: number): number | undefined;\n /** Set measured size. Increments `version` to trigger recomputation. */\n set(index: number, size: number): void;\n /** Signal that increments on every `set()` — use as a dependency in `computed()`. */\n readonly version: Signal<number>;\n /** Get size for an index, falling back to `estimateSize` if not measured. */\n resolve(index: number, estimateSize: number | ((i: number) => number)): number;\n /** Number of measured entries. */\n readonly count: number;\n /** Clear all measurements. */\n clear(): void;\n}\n\n/**\n * Creates a signal-based size cache for measured item heights.\n *\n * @internal\n */\nexport function createSizeCache(): SizeCache {\n const cache = new Map<number, number>();\n const versionState = signal(0);\n\n return {\n get(index: number): number | undefined {\n return cache.get(index);\n },\n\n set(index: number, size: number): void {\n const current = cache.get(index);\n if (current === size) {\n return;\n }\n cache.set(index, size);\n versionState.update((v) => v + 1);\n },\n\n version: versionState.asReadonly(),\n\n resolve(index: number, estimateSize: number | ((i: number) => number)): number {\n const measured = cache.get(index);\n if (measured != null) {\n return measured;\n }\n return typeof estimateSize === 'number' ? estimateSize : estimateSize(index);\n },\n\n get count(): number {\n return cache.size;\n },\n\n clear(): void {\n if (cache.size === 0) {\n return;\n }\n cache.clear();\n versionState.update((v) => v + 1);\n },\n };\n}\n","import {\n DestroyRef,\n type ElementRef,\n InjectionToken,\n type Signal,\n computed,\n effect,\n inject,\n isDevMode,\n isSignal,\n signal,\n untracked,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { createTransitionTracker } from '@cngx/core/utils';\n\nimport { computeRange } from './range-computer';\nimport { createScrollObserver } from './scroll-observer';\nimport { createSizeCache } from './size-cache';\n\n/**\n * I18n interface for recycler SR announcements.\n * All methods return the announcement text. No hardcoded strings.\n *\n * @category common/data/recycler\n */\nexport interface RecyclerI18n {\n /** Announced when new items are loaded (infinite scroll). */\n loaded(newCount: number, total: number): string;\n /** Announced when filter/search results change. */\n filtered(count: number): string;\n /** Announced when the list becomes empty. */\n empty(): string;\n /** Announced when loading fails. */\n error(): string;\n}\n\n/**\n * Injection token for recycler SR announcement texts.\n * Provides English defaults via factory. Override with `provideRecyclerI18n()`.\n *\n * @category common/data/recycler\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/recycler/recycler.ts\n * @since 0.1.0\n */\nexport const CNGX_RECYCLER_I18N = new InjectionToken<RecyclerI18n>('CngxRecyclerI18n', {\n factory: (): RecyclerI18n => ({\n loaded: (n, t) => `${n} more items loaded. ${t} total.`,\n filtered: (c) => `${c} results found.`,\n empty: () => 'No results.',\n error: () => 'Error loading data.',\n }),\n});\n\n/**\n * Provider function for custom recycler i18n texts.\n *\n * ```typescript\n * providers: [provideRecyclerI18n({\n * loaded: (n, t) => `${n} weitere Einträge. ${t} gesamt.`,\n * filtered: (c) => `${c} Ergebnisse.`,\n * empty: () => 'Keine Ergebnisse.',\n * error: () => 'Fehler beim Laden.',\n * })]\n * ```\n *\n * @category common/data/recycler\n */\nexport function provideRecyclerI18n(i18n: RecyclerI18n) {\n return { provide: CNGX_RECYCLER_I18N, useValue: i18n };\n}\n\n/**\n * Configuration for {@link injectRecycler}.\n *\n * @category common/data/recycler\n */\nexport interface RecyclerConfig {\n /** Scroll container. CSS selector, native element, or `ElementRef`. */\n scrollElement: ElementRef | HTMLElement | string;\n\n /**\n * Total number of items. Reactive - changes on infinite scroll.\n *\n * **Important:** For infinite scroll, this is the number of *loaded* items,\n * not the server-side total. Otherwise the sentinel becomes unreachable.\n */\n totalCount: () => number;\n\n /**\n * Estimated height per item (px). A fixed `number`, a `Signal<number>` for a\n * reactive uniform estimate (e.g. an `input()` bound after construction), or a\n * `(index) => number` for genuine per-index variable heights. Only the last\n * form carries per-frame cost; a signal resolves to one uniform value.\n */\n estimateSize: number | Signal<number> | ((index: number) => number);\n\n /** Extra items to render above/below the viewport. Default: 5. */\n overscan?: number;\n\n /**\n * Layout mode. `'list'` (default) uses padding spacers.\n * `'grid'` is Phase 3 - passing it logs a dev-mode warning and falls back to `'list'`.\n */\n layout?: 'list' | 'grid';\n\n /** Column count for grid mode. Phase 3 - ignored in Phase 1. */\n columns?: number | (() => number);\n\n /** Debounce for scroll events in ms. Default: 16 (~1 frame). */\n scrollDebounce?: number;\n\n /**\n * Delay before skeletons are shown (ms). Default: 0.\n * E.g. 300 means `showSkeleton` only becomes `true` after 300ms -\n * fast loads (< 300ms) never show a skeleton.\n */\n skeletonDelay?: number;\n\n /**\n * Async state source. When set, the recycler derives skeleton rendering,\n * refresh state, and empty state from it - same convention as\n * `CngxCardGrid`, `CngxTreetable`, `CngxPopoverPanel`, and `CngxDialog`.\n */\n state?: CngxAsyncState<unknown>;\n\n /**\n * Server-side total for A11y (`aria-setsize`) and \"Showing X of Y\" display.\n * When not set, `totalCount` is used.\n */\n serverTotal?: () => number;\n}\n\n/**\n * Signal-based virtualizer returned by {@link injectRecycler}.\n * All derived values are `computed()` - the system cannot become inconsistent.\n *\n * @category common/data/recycler\n */\nexport interface CngxRecycler {\n /** Start index (inclusive) of the rendered range, including overscan. */\n readonly start: Signal<number>;\n /** End index (exclusive) of the rendered range, including overscan. */\n readonly end: Signal<number>;\n\n /** Spacer height before rendered items (px). Always 0 in grid mode. */\n readonly offsetBefore: Signal<number>;\n /** Spacer height after rendered items (px). Always 0 in grid mode. */\n readonly offsetAfter: Signal<number>;\n /** Total scrollable height of all items (px). */\n readonly totalSize: Signal<number>;\n\n /** Placeholder count before rendered items. Only non-zero in grid mode. */\n readonly placeholdersBefore: Signal<number>;\n /** Placeholder count after rendered items. Only non-zero in grid mode. */\n readonly placeholdersAfter: Signal<number>;\n\n /** `true` during first load (`state.isFirstLoad()`). `false` without `state`. */\n readonly isLoading: Signal<boolean>;\n /** `true` during refresh (`state.isRefreshing()`). Data remains visible. */\n readonly isRefreshing: Signal<boolean>;\n /** `true` when `totalCount === 0` and not busy. */\n readonly isEmpty: Signal<boolean>;\n /** How many skeleton items fit in the viewport: `ceil(clientHeight / estimateSize)`. */\n readonly skeletonSlots: Signal<number>;\n /** `isLoading` AND `skeletonDelay` elapsed. Prevents skeleton flicker on fast loads. */\n readonly showSkeleton: Signal<boolean>;\n\n /** First actually visible index (without overscan). For UI display. */\n readonly firstVisible: Signal<number>;\n /** Last actually visible index (without overscan). For UI display. */\n readonly lastVisible: Signal<number>;\n /** Count of actually visible items (without overscan). */\n readonly visibleCount: Signal<number>;\n\n /**\n * Locks scroll position relative to an item. When items are inserted above\n * the anchored item, `scrollTop` is corrected to maintain visual position.\n */\n anchorTo(index: number): void;\n /** Releases the scroll anchor set by {@link anchorTo}. */\n releaseAnchor(): void;\n\n /**\n * Reports the index of the item that had focus when it left the rendered range.\n * `null` when no focus was lost. Consumer can use this to restore focus.\n */\n readonly lostFocus: Signal<{ index: number } | null>;\n\n /** SR announcement text for state transitions (load, filter, empty, error). */\n readonly announcement: Signal<string>;\n\n /** `serverTotal` when set, otherwise `totalCount`. Bind to `aria-setsize`. */\n readonly ariaSetSize: Signal<number>;\n\n /**\n * The range of item indices that must be available for rendering.\n * Use in an effect to trigger page loads for windowed/sparse data sources.\n *\n * Unlike `firstVisible`/`lastVisible` (which exclude overscan), this includes\n * overscan items - all indices in this range may be rendered.\n *\n * ```typescript\n * effect(() => {\n * const { start, end } = recycler.neededRange();\n * const startPage = Math.floor(start / PAGE_SIZE);\n * const endPage = Math.floor(end / PAGE_SIZE);\n * for (let p = startPage; p <= endPage; p++) {\n * if (!pageCache.has(p)) { loadPage(p); }\n * }\n * });\n * ```\n */\n readonly neededRange: Signal<{ start: number; end: number }>;\n\n /**\n * Target index that `scrollToIndex()` is waiting for.\n * Non-null when the target index exceeds `totalCount` - consumer\n * can show a \"Scrolling to item...\" indicator or trigger page loads.\n * Clears automatically when `totalCount` grows past the target.\n */\n readonly pendingTarget: Signal<number | null>;\n\n /**\n * Creates a `computed()` slicing items to the visible range.\n * **Call once in a field initializer** - each call creates a new computed node.\n * Do NOT call in templates or methods.\n */\n sliced<T>(items: Signal<T[]>): Signal<T[]>;\n\n /**\n * Reports a measured item height to the internal SizeCache.\n * No-op in grid mode (uniform row height assumed).\n * Prefer {@link CngxMeasure} directive over calling this directly.\n */\n measure(index: number, element: HTMLElement): void;\n\n /**\n * Scrolls to a specific item index. When `index >= totalCount`, stores\n * the target in {@link pendingTarget} for resolution when data arrives.\n */\n scrollToIndex(index: number, behavior?: ScrollBehavior): void;\n\n /** Scrolls to top. Convenience for sort/filter changes. */\n reset(): void;\n}\n\n/**\n * Inline equivalent of `createVisibilityTimer` from `@cngx/ui/feedback` (Level 4, not importable).\n *\n * Uses `setTimeout` inside an effect - this is a timer-driven side effect, not derived state.\n * Same pattern accepted in `createVisibilityTimer` for `CngxLoadingOverlay`.\n * Safe in zoneless: the `setTimeout` callback only writes a signal, which schedules\n * Angular's own change detection - no Zone.js dependency.\n *\n * @param source Boolean signal to delay. When `true`, starts the timer.\n * @param delayMs Delay in milliseconds before the flag becomes `true`.\n * @returns A readonly signal that becomes `true` after `delayMs` when `source` is `true`.\n * @internal\n */\nfunction createDelayedFlag(source: Signal<boolean>, delayMs: number): Signal<boolean> {\n if (delayMs <= 0) {\n return source;\n }\n const flag = signal(false);\n effect((onCleanup) => {\n const active = source();\n if (active) {\n const timer = setTimeout(() => flag.set(true), delayMs);\n onCleanup(() => {\n clearTimeout(timer);\n flag.set(false);\n });\n } else {\n flag.set(false);\n }\n });\n return flag.asReadonly();\n}\n\n/**\n * Creates a Signal-based virtualizer for DOM recycling.\n *\n * Must be called in an injection context (field initializer or constructor).\n * Internally injects `DestroyRef` and `DOCUMENT` for cleanup and selector resolution.\n *\n * ### Basic list\n * ```typescript\n * readonly recycler = injectRecycler({\n * scrollElement: '.scroll-container',\n * totalCount: () => this.items().length,\n * estimateSize: 48,\n * });\n * readonly visibleItems = this.recycler.sliced(this.items);\n * ```\n *\n * ### With async state\n * ```typescript\n * readonly state = injectAsyncState(() => this.api.getAll());\n * readonly recycler = injectRecycler({\n * scrollElement: '.scroll-container',\n * totalCount: () => (this.state.data() ?? []).length,\n * estimateSize: 64,\n * state: this.state,\n * });\n * ```\n *\n * @category common/data/recycler\n */\nexport function injectRecycler(config: RecyclerConfig): CngxRecycler {\n const destroyRef = inject(DestroyRef);\n const i18n = inject(CNGX_RECYCLER_I18N);\n const overscan = config.overscan ?? 5;\n const isGrid = (config.layout ?? 'list') === 'grid';\n\n if (isGrid && config.columns == null && isDevMode()) {\n console.error(\n '[CngxRecycler] layout: \"grid\" requires explicit `columns`. Falling back to columns=1.',\n );\n }\n\n // Reactive columns - reactive only if the function reads a Signal internally\n const columns = computed(() => {\n if (!isGrid || config.columns == null) {\n return 1;\n }\n return typeof config.columns === 'function' ? config.columns() : config.columns;\n });\n\n // A Signal is a zero-arg function but resolves to a uniform height, not a\n // per-index measurement - it carries no O(n) per-frame cost, so exclude it\n // from the variable-height warning (a reactive scalar estimate is a\n // sanctioned pattern; see the resolveSize note below).\n if (\n typeof config.estimateSize === 'function' &&\n !isSignal(config.estimateSize) &&\n isDevMode()\n ) {\n const count = config.totalCount();\n if (count > 10_000) {\n console.warn(\n `[CngxRecycler] estimateSize as a function with ${count} items has O(n) ` +\n `per-frame cost. Consider using a fixed estimateSize for large datasets.`,\n );\n }\n }\n\n const scrollState = createScrollObserver(config.scrollElement, destroyRef);\n\n const sizeCache = createSizeCache();\n\n // Resolve size for an index: measured value from cache, or estimateSize fallback.\n // Reading sizeCache.version() creates a reactive dependency so that range\n // recomputes when measurements change.\n const resolveSize = (index: number): number => {\n sizeCache.version(); // track dependency\n return sizeCache.resolve(index, config.estimateSize);\n };\n\n // Grid mode uses raw estimateSize (uniform row height, no SizeCache).\n // List mode uses resolveSize (SizeCache-backed).\n const range = computed(() => {\n const cols = columns();\n const size = isGrid ? config.estimateSize : resolveSize;\n return computeRange(\n scrollState.scrollTop(),\n scrollState.clientHeight(),\n config.totalCount(),\n size,\n overscan,\n cols,\n );\n });\n\n const start = computed(() => range().start);\n const end = computed(() => range().end);\n\n // Grid mode: pixel spacers are 0 (placeholders used instead)\n const offsetBefore = computed(() => (isGrid ? 0 : range().offsetBefore));\n const offsetAfter = computed(() => (isGrid ? 0 : range().offsetAfter));\n const totalSize = computed(() => range().totalSize);\n\n const placeholdersBefore = computed(() => (isGrid ? start() : 0));\n const placeholdersAfter = computed(() => (isGrid ? Math.max(0, config.totalCount() - end()) : 0));\n\n // start/end include overscan. firstVisible/lastVisible strip it back\n // to reflect the items actually in the viewport.\n // In grid mode, overscan is in rows (ceil(overscan/columns) * columns items).\n const effectiveOverscan = computed(() => {\n const cols = columns();\n if (cols <= 1) {\n return overscan;\n }\n return Math.ceil(overscan / cols) * cols;\n });\n\n const firstVisible = computed(() => {\n const total = config.totalCount();\n if (total === 0) {\n return 0;\n }\n return Math.min(start() + effectiveOverscan(), total - 1);\n });\n\n const lastVisible = computed(() => {\n const total = config.totalCount();\n if (total === 0) {\n return 0;\n }\n return Math.min(Math.max(0, end() - effectiveOverscan() - 1), total - 1);\n });\n\n const visibleCount = computed(() => {\n const total = config.totalCount();\n if (total === 0) {\n return 0;\n }\n return Math.max(0, lastVisible() - firstVisible() + 1);\n });\n\n const state = config.state;\n const isLoading = computed(() => state?.isFirstLoad() ?? false);\n const isRefreshing = computed(() => state?.isRefreshing() ?? false);\n\n const isEmpty = computed(() => {\n if (state?.isBusy()) {\n return false;\n }\n return config.totalCount() === 0;\n });\n\n const skeletonSlots = computed(() => {\n const ch = scrollState.clientHeight();\n if (ch <= 0) {\n return 0;\n }\n // Resolve estimateSize reactively - function variant may read signals internally\n const itemHeight =\n typeof config.estimateSize === 'number' ? config.estimateSize : config.estimateSize(0);\n return Math.ceil(ch / itemHeight);\n });\n\n const showSkeleton = createDelayedFlag(isLoading, config.skeletonDelay ?? 0);\n\n // previousTotal is a signal, not a mutable let - reactive, no stale-value risk.\n const announcementState = signal('');\n const previousTotal = signal(config.totalCount());\n\n if (state) {\n const tracker = createTransitionTracker(() => state.status());\n\n effect(() => {\n const current = tracker.current();\n const previous = tracker.previous();\n const total = config.totalCount();\n // untracked: previousTotal is bookkeeping, not a dependency -\n // the effect should fire on status/totalCount changes, not on its own writes.\n const prevTotal = untracked(() => previousTotal());\n\n // Transition-only - never announce on initial idle\n if (previous === current) {\n return;\n }\n\n if (current === 'success' && (previous === 'loading' || previous === 'refreshing')) {\n const diff = total - prevTotal;\n if (diff > 0) {\n announcementState.set(i18n.loaded(diff, total));\n } else {\n announcementState.set(i18n.filtered(total));\n }\n } else if (current === 'error') {\n announcementState.set(i18n.error());\n } else if (current === 'success' && total === 0) {\n announcementState.set(i18n.empty());\n }\n\n untracked(() => previousTotal.set(total));\n });\n } else {\n // Without async state, track totalCount changes for infinite scroll announcements\n effect(() => {\n const total = config.totalCount();\n // untracked: previousTotal is bookkeeping, not a dependency\n const prevTotal = untracked(() => previousTotal());\n const diff = total - prevTotal;\n\n if (prevTotal > 0 && diff > 0) {\n announcementState.set(i18n.loaded(diff, total));\n } else if (prevTotal > 0 && total === 0) {\n announcementState.set(i18n.empty());\n }\n\n untracked(() => previousTotal.set(total));\n });\n }\n\n const ariaSetSize = computed(() => config.serverTotal?.() ?? config.totalCount());\n\n const anchorState = signal<{ index: number; offsetFromTop: number } | null>(null);\n\n function computeItemTop(targetIndex: number, cols?: number): number {\n // Grid mode: row-based offset (uniform row height)\n if (isGrid && typeof config.estimateSize === 'number') {\n const c = cols ?? columns();\n return Math.floor(targetIndex / c) * config.estimateSize;\n }\n let top = 0;\n for (let i = 0; i < targetIndex; i++) {\n top += sizeCache.resolve(i, config.estimateSize);\n }\n return top;\n }\n\n // Anchor correction effect: when items shift above the anchored item,\n // correct scrollTop to keep it at the same visual position.\n effect(() => {\n const anchor = anchorState();\n if (!anchor) {\n return;\n }\n sizeCache.version(); // re-run when sizes change\n config.totalCount(); // re-run when items change\n const cols = columns(); // re-run when columns change (responsive grid)\n const el = scrollState.element();\n if (!el) {\n return;\n }\n const currentItemTop = computeItemTop(anchor.index, cols);\n const targetScrollTop = currentItemTop - anchor.offsetFromTop;\n if (Math.abs(el.scrollTop - targetScrollTop) > 1) {\n el.scrollTop = targetScrollTop;\n }\n });\n\n // Tracks which item has focus inside the scroll container.\n // Uses `data-cngx-recycle-index` attribute on items (set by CngxMeasure or consumer).\n // When a focused item leaves the visible range, `lostFocus` reports its index.\n const focusedIndex = signal<number | null>(null);\n\n effect((onCleanup) => {\n const el = scrollState.element();\n if (!el) {\n return;\n }\n const handleFocusIn = (e: FocusEvent): void => {\n const target = (e.target as HTMLElement).closest('[data-cngx-recycle-index]');\n if (target) {\n focusedIndex.set(Number(target.getAttribute('data-cngx-recycle-index')));\n }\n };\n const handleFocusOut = (): void => {\n focusedIndex.set(null);\n };\n el.addEventListener('focusin', handleFocusIn);\n el.addEventListener('focusout', handleFocusOut);\n onCleanup(() => {\n el.removeEventListener('focusin', handleFocusIn);\n el.removeEventListener('focusout', handleFocusOut);\n });\n });\n\n const lostFocus = computed(() => {\n const fi = focusedIndex();\n if (fi == null) {\n return null;\n }\n const s = start();\n const e = end();\n if (fi < s || fi >= e) {\n return { index: fi };\n }\n return null;\n });\n\n const neededRange = computed(() => ({ start: start(), end: end() }));\n\n const pendingScrollTarget = signal<{ index: number; behavior: ScrollBehavior } | null>(null);\n const pendingTarget = computed(() => pendingScrollTarget()?.index ?? null);\n\n // Watch totalCount - when it grows past the pending target, execute the scroll.\n // Uses untracked() for pendingScrollTarget reads/writes to avoid write-inside-read loops.\n // Only totalCount is a tracked dependency.\n effect(() => {\n const total = config.totalCount(); // tracked dependency\n const target = untracked(() => pendingScrollTarget()); // NOT tracked\n if (!target || target.index >= total) {\n return;\n }\n untracked(() => {\n pendingScrollTarget.set(null);\n const el = scrollState.element();\n if (el) {\n const top = computeItemTop(target.index);\n el.scrollTo({ top, behavior: target.behavior });\n }\n });\n });\n\n return {\n start,\n end,\n offsetBefore,\n offsetAfter,\n totalSize,\n\n placeholdersBefore,\n placeholdersAfter,\n\n isLoading,\n isRefreshing,\n isEmpty,\n skeletonSlots,\n showSkeleton,\n\n firstVisible,\n lastVisible,\n visibleCount,\n\n anchorTo(index: number): void {\n const el = scrollState.element();\n if (!el) {\n return;\n }\n const itemTop = computeItemTop(index);\n anchorState.set({ index, offsetFromTop: itemTop - el.scrollTop });\n },\n\n releaseAnchor(): void {\n anchorState.set(null);\n },\n\n lostFocus,\n\n pendingTarget,\n neededRange,\n\n announcement: announcementState.asReadonly(),\n\n ariaSetSize,\n\n sliced<T>(items: Signal<T[]>): Signal<T[]> {\n return computed(() => items().slice(start(), end()));\n },\n\n measure(index: number, element: HTMLElement): void {\n // Grid mode assumes uniform row height - SizeCache writes would break row-based range.\n if (isGrid) {\n return;\n }\n const height = element.getBoundingClientRect().height;\n if (height > 0) {\n sizeCache.set(index, height);\n }\n },\n\n scrollToIndex(index: number, behavior: ScrollBehavior = 'auto'): void {\n const total = config.totalCount();\n if (index >= total) {\n // Deep-link: target not loaded yet - store for later resolution\n pendingScrollTarget.set({ index, behavior });\n return;\n }\n pendingScrollTarget.set(null);\n const el = scrollState.element();\n if (el) {\n el.scrollTo({ top: computeItemTop(index), behavior });\n }\n },\n\n reset(): void {\n const el = scrollState.element();\n if (el) {\n el.scrollTop = 0;\n }\n },\n };\n}\n","import { Directive, ElementRef, effect, inject, input } from '@angular/core';\n\nimport type { CngxRecycler } from './recycler';\n\n/**\n * Atom directive that measures the host element's height and reports it\n * to the recycler via `recycler.measure(index, element)`.\n *\n * Uses `ResizeObserver` to detect height changes (e.g. content expansion,\n * font loading). Cleanup is automatic via `DestroyRef`.\n *\n * Also sets `data-cngx-recycle-index` on the host element for focus tracking.\n *\n * ```html\n * @for (item of visibleItems(); track item.id; let i = $index) {\n * <div [cngxMeasure]=\"recycler\" [cngxMeasureIndex]=\"recycler.start() + i\">\n * {{ item.content }}\n * </div>\n * }\n * ```\n *\n * @category common/data/recycler\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/recycler/measure.directive.ts\n * @since 0.1.0\n * @relatedTo CngxVirtualItem, CngxRecyclerAnnouncer, injectRecycler\n *\n * <example-url>http://localhost:4200/#/common/data/recycler/basic-list-fixed-item-height</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/content-visibility-css-only</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/infinite-scroll-recycler</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/scrolltoindex-deep-link</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/variable-heights-cngxmeasure</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/with-cngxasyncstate-skeleton-first-load</example-url>\n */\n@Directive({\n selector: '[cngxMeasure]',\n standalone: true,\n host: {\n '[attr.data-cngx-recycle-index]': 'cngxMeasureIndex()',\n },\n})\nexport class CngxMeasure {\n /** The recycler instance to report measurements to. */\n readonly cngxMeasure = input.required<CngxRecycler>();\n\n /** The absolute index of this item in the full dataset. */\n readonly cngxMeasureIndex = input.required<number>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n\n constructor() {\n effect((onCleanup) => {\n const recycler = this.cngxMeasure();\n const index = this.cngxMeasureIndex();\n const element = this.el.nativeElement as HTMLElement;\n\n recycler.measure(index, element);\n\n const observer = new ResizeObserver(() => {\n recycler.measure(index, element);\n });\n observer.observe(element);\n\n onCleanup(() => {\n observer.disconnect();\n });\n });\n }\n}\n","import { Directive, computed, input } from '@angular/core';\n\nimport type { CngxRecycler } from './recycler';\n\n/**\n * A11y atom that sets `aria-setsize`, `aria-posinset`, and `data-cngx-recycle-index`\n * on each rendered virtual item. Replaces manual ARIA boilerplate.\n *\n * Also provides `data-cngx-recycle-index` for focus tracking - consumers who\n * don't use `CngxMeasure` (grid mode, uniform heights) get focus tracking for free.\n *\n * Does NOT set `role` - the consumer decides (`listitem`, `option`, `treeitem`, `tab`).\n *\n * ```html\n * @for (item of visibleItems(); track item.id; let i = $index) {\n * <div role=\"listitem\"\n * [cngxVirtualItem]=\"recycler\"\n * [cngxVirtualItemIndex]=\"recycler.start() + i\">\n * {{ item.name }}\n * </div>\n * }\n * ```\n *\n * @category common/data/recycler\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/recycler/virtual-item.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMeasure, CngxRecyclerAnnouncer, injectRecycler\n *\n * <example-url>http://localhost:4200/#/common/data/recycler/basic-list-fixed-item-height</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/content-visibility-css-only</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/infinite-scroll-recycler</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/scrolltoindex-deep-link</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/variable-heights-cngxmeasure</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/with-cngxasyncstate-skeleton-first-load</example-url>\n */\n@Directive({\n selector: '[cngxVirtualItem]',\n standalone: true,\n host: {\n '[attr.aria-setsize]': 'ariaSetSize()',\n '[attr.aria-posinset]': 'ariaPosinset()',\n '[attr.data-cngx-recycle-index]': 'cngxVirtualItemIndex()',\n },\n})\nexport class CngxVirtualItem {\n /** The recycler instance providing `ariaSetSize`. */\n readonly cngxVirtualItem = input.required<CngxRecycler>();\n\n /** The absolute 0-based index of this item in the full dataset. */\n readonly cngxVirtualItemIndex = input.required<number>();\n\n /** Total item count for `aria-setsize`. */\n protected readonly ariaSetSize = computed(() => this.cngxVirtualItem().ariaSetSize());\n\n /** 1-based position for `aria-posinset`. */\n protected readonly ariaPosinset = computed(() => this.cngxVirtualItemIndex() + 1);\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\nimport type { CngxRecycler } from './recycler';\n\n/**\n * Convenience component that renders the `aria-live=\"polite\"` region\n * for recycler SR announcements. Eliminates manual boilerplate.\n *\n * Uses `display: contents` - no layout impact.\n *\n * ```html\n * <cngx-recycler-announcer [cngxRecyclerAnnouncer]=\"recycler\" />\n * ```\n *\n * @category common/data/recycler\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/recycler/recycler-announcer.component.ts\n * @since 0.1.0\n * @relatedTo CngxMeasure, CngxVirtualItem, injectRecycler, CNGX_RECYCLER_I18N\n *\n * <example-url>http://localhost:4200/#/common/data/recycler/basic-list-fixed-item-height</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/content-visibility-css-only</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/infinite-scroll-recycler</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/scrolltoindex-deep-link</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/variable-heights-cngxmeasure</example-url>\n * <example-url>http://localhost:4200/#/common/data/recycler/with-cngxasyncstate-skeleton-first-load</example-url>\n */\n@Component({\n selector: 'cngx-recycler-announcer',\n standalone: true,\n template: `<span aria-live=\"polite\" aria-atomic=\"true\" class=\"cngx-sr-only\">{{\n recycler().announcement()\n }}</span>`,\n host: { style: 'display: contents' },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CngxRecyclerAnnouncer {\n /** The recycler instance providing `announcement()`. */\n readonly recycler = input.required<CngxRecycler>({ alias: 'cngxRecyclerAnnouncer' });\n}\n","import { ElementRef, effect, inject, untracked } from '@angular/core';\n// type-only: instance is passed in by the consumer via inject(..., { host: true })\nimport type { CngxRovingTabindex } from '@cngx/common/a11y';\n\nimport type { CngxRecycler } from './recycler';\n\n/**\n * Wires a `CngxRecycler` to a `CngxRovingTabindex` in virtual mode.\n *\n * When the roving tabindex navigates to an item that is not in the DOM\n * (out of rendered range), this function scrolls the recycler to that item\n * and focuses it after rendering.\n *\n * Must be called in an injection context (constructor or field initializer)\n * **on the component that hosts both the recycler's scroll container and the\n * `CngxRovingTabindex` directive**. The injected `ElementRef` is used to query\n * `[data-cngx-recycle-index]` — calling from a child component would query the\n * wrong subtree.\n *\n * ```typescript\n * @Component({\n * hostDirectives: [\n * { directive: CngxRovingTabindex, inputs: ['orientation', 'activeIndex', 'virtualCount'] },\n * ],\n * })\n * class MyVirtualList {\n * private readonly roving = inject(CngxRovingTabindex, { host: true });\n * readonly recycler = injectRecycler({ ... });\n *\n * constructor() {\n * connectRecyclerToRoving(this.recycler, this.roving);\n * }\n * }\n * ```\n *\n * @category common/data/recycler\n */\nexport function connectRecyclerToRoving(recycler: CngxRecycler, roving: CngxRovingTabindex): void {\n const hostEl = inject(ElementRef).nativeElement as HTMLElement;\n\n // Debounce scrollToIndex via rAF to avoid scroll jitter on rapid keypresses.\n // Each keypress overwrites pendingFocus — only the latest target is scrolled to.\n let scrollRafId: number | null = null;\n\n effect((onCleanup) => {\n const target = roving.pendingFocus();\n if (target == null) {\n return;\n }\n if (scrollRafId != null) {\n cancelAnimationFrame(scrollRafId);\n }\n scrollRafId = requestAnimationFrame(() => {\n scrollRafId = null;\n // Re-read to get the latest target (rapid keypresses may have updated it).\n const latest = roving.pendingFocus();\n if (latest != null) {\n recycler.scrollToIndex(latest);\n }\n });\n onCleanup(() => {\n if (scrollRafId != null) {\n cancelAnimationFrame(scrollRafId);\n scrollRafId = null;\n }\n });\n });\n\n // When the recycler's range changes and the pending target is within range,\n // wait for the DOM to update (rAF), then query and focus the element.\n let focusRafId: number | null = null;\n\n effect((onCleanup) => {\n const s = recycler.start();\n const e = recycler.end();\n const target = untracked(() => roving.pendingFocus());\n if (target == null || target < s || target >= e) {\n return;\n }\n\n // Target is within rendered range — DOM will be updated after CD.\n // Use rAF to wait for Angular's rendering pass to complete.\n focusRafId = requestAnimationFrame(() => {\n focusRafId = null;\n // Re-read pendingFocus in case it changed during the frame (rapid keypresses).\n const currentTarget = roving.pendingFocus();\n if (currentTarget == null) {\n return;\n }\n const el = hostEl.querySelector(`[data-cngx-recycle-index=\"${currentTarget}\"]`);\n if (el instanceof HTMLElement) {\n el.focus();\n roving.clearPendingFocus();\n }\n });\n\n onCleanup(() => {\n if (focusRafId != null) {\n cancelAnimationFrame(focusRafId);\n focusRafId = null;\n }\n });\n });\n}\n","import { effect, untracked } from '@angular/core';\n\n// type-only: passed in by the consumer at runtime, so @cngx/common/data\n// avoids a value-level dep on a11y\nimport type { CngxActiveDescendant } from '@cngx/common/a11y';\n\nimport type { CngxRecycler } from './recycler';\n\n/**\n * Wires a {@link CngxRecycler} to a {@link CngxActiveDescendant} in\n * virtual mode.\n *\n * When the AD directive navigates to an item whose index is not in the\n * recycler's rendered range, it sets `pendingHighlight` (via the\n * `virtualCount` path). This helper watches that signal and scrolls\n * the recycler to the target index; AD's own effect observes the\n * resulting DOM update and clears the pending state automatically\n * (see the `pendingHighlightState.set(null)` branch in\n * `CngxActiveDescendant` after a re-render brings the target into the\n * rendered range).\n *\n * Unlike {@link /projects/common/data/src/recycler/connect-recycler-roving.ts\n * connectRecyclerToRoving}, we don't re-focus a DOM element after the\n * scroll — AD doesn't move real focus, it only rebinds\n * `aria-activedescendant`. Once the target index enters the rendered\n * range, the `[attr.aria-activedescendant]` binding on the combobox\n * trigger resolves to the now-present option element for free.\n *\n * Must be called in an injection context (typically a component\n * constructor) on the same component that owns both the recycler\n * and the AD directive.\n *\n * ```typescript\n * @Component({\n * hostDirectives: [\n * { directive: CngxActiveDescendant, inputs: ['items', 'virtualCount'] },\n * ],\n * })\n * class MyVirtualSelect {\n * private readonly ad = inject(CngxActiveDescendant, { host: true });\n * readonly recycler = injectRecycler({ ... });\n *\n * constructor() {\n * connectRecyclerToActiveDescendant(this.recycler, this.ad);\n * }\n * }\n * ```\n *\n * @category common/data/recycler\n */\nexport function connectRecyclerToActiveDescendant(\n recycler: CngxRecycler,\n ad: CngxActiveDescendant,\n): void {\n // rAF-debounced: held ArrowDown otherwise enqueues one scroll per keystroke.\n // Each new pending target overwrites the previous rAF, only the latest lands.\n let scrollRafId: number | null = null;\n\n effect((onCleanup) => {\n const target = ad.pendingHighlight();\n if (target == null) {\n return;\n }\n if (scrollRafId != null) {\n cancelAnimationFrame(scrollRafId);\n }\n scrollRafId = requestAnimationFrame(() => {\n scrollRafId = null;\n // re-read inside the frame so the latest target wins if the user kept typing\n const latest = untracked(() => ad.pendingHighlight());\n if (latest != null) {\n recycler.scrollToIndex(latest);\n }\n });\n onCleanup(() => {\n if (scrollRafId != null) {\n cancelAnimationFrame(scrollRafId);\n scrollRafId = null;\n }\n });\n });\n}\n","import { computed, signal, type Signal } from '@angular/core';\n\nimport { createManualState, type ManualAsyncState } from '../async-state';\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\n/**\n * Cancel handle returned by a {@link CngxCommitRunner}. The controller\n * stores it on every `begin(...)` and calls `cancel()` synchronously\n * when a newer commit supersedes it. Action runtimes (RxJS subscription\n * teardown, AbortController abort, plain flag) implement the handle\n * however they need.\n *\n * @category common/data/commit\n */\nexport interface CngxCommitHandle {\n readonly cancel: () => void;\n}\n\n/**\n * Action runner contract. Receives the controller's success/error\n * routes and returns a cancel handle. The runner is opaque to the\n * controller — it can wrap any async source (Observable, Promise,\n * sync value) and any cancellation primitive.\n *\n * Variants supply their own runner adapter (e.g. select's\n * `runCommitAction` invokes a `CngxSelectCommitAction<T>`; stepper's\n * runner adapts a `CngxStepperCommitAction`); the controller has no\n * knowledge of the variant-specific action shape.\n *\n * @category common/data/commit\n */\nexport type CngxCommitRunner<T> = (handlers: {\n readonly onSuccess: (committed: T | undefined) => void;\n readonly onError: (err: unknown) => void;\n}) => CngxCommitHandle;\n\n/**\n * Outcome handlers passed to `controller.begin(...)`. The controller\n * invokes exactly one of `onSuccess` / `onError` per commit lifecycle\n * (unless the commit is superseded, in which case neither fires).\n *\n * @category common/data/commit\n */\nexport interface CngxCommitBeginHandlers<T> {\n readonly onSuccess: (committed: T | undefined) => void;\n readonly onError: (err: unknown, previous: T | undefined) => void;\n}\n\n/**\n * Encapsulated state machine for the async-commit lifecycle shared by\n * every cngx feature that has a \"perform-an-async-write-then-update-\n * the-source-signal\" flow (select family, stepper, future wizards).\n *\n * Owns:\n * - the `CngxAsyncState<T | undefined>` slot consumed by `CNGX_STATEFUL`\n * bridges, commit-error templates, and the pending-row spinner;\n * - begin / cancel orchestration with monotonic supersede semantics;\n * - the \"intended value\" signal that drives the pending-spinner on\n * the specific row / step the user just clicked.\n *\n * The controller is intentionally **not** an Angular service or\n * provider. It's a plain factory so it works in any injection context\n * (including outside Angular, for headless tests).\n *\n * @category common/data/commit\n */\nexport interface CngxCommitController<T> {\n /** Read-only async-state view of the commit lifecycle. */\n readonly state: CngxAsyncState<T | undefined>;\n\n /** `true` while a commit is in flight. */\n readonly isCommitting: Signal<boolean>;\n\n /**\n * The most recent intended value — what the user was trying to\n * commit. Used by the option-row spinner and the commit-error\n * template context to identify *which* option the failure belongs\n * to.\n */\n readonly intendedValue: Signal<T | undefined>;\n\n /**\n * Start a new commit. Supersedes any in-flight commit: the\n * previous runner's cancel handle fires synchronously, and the\n * previous outcome callbacks become no-ops if they fire late.\n *\n * @param runner variant-specific action runner (closes over the\n * action and the intended value)\n * @param intended the value the user clicked\n * @param previous the value to roll back to on error\n * @param handlers success/error routes — the controller only\n * updates its own state and calls these; it does\n * NOT touch external value signals, panel open\n * state, or component outputs.\n */\n begin(\n runner: CngxCommitRunner<T>,\n intended: T | undefined,\n previous: T | undefined,\n handlers: CngxCommitBeginHandlers<T>,\n ): void;\n\n /**\n * Abort the currently in-flight commit without firing callbacks.\n * Use when the host component is destroyed or the commit-action\n * input changes mid-flight.\n */\n cancel(): void;\n}\n\n/**\n * Factory for the commit controller.\n *\n * Plain function, not a class — matches the rest of the repo\n * (`createManualState`, `createAsyncState`, `createTransitionTracker`).\n * See `reference_api_prefix_convention.md`.\n *\n * @category common/data/commit\n */\nexport function createCommitController<T>(): CngxCommitController<T> {\n // read-only `state` view; consumers can't flip status directly\n const slot: ManualAsyncState<T | undefined> =\n createManualState<T | undefined>();\n\n // monotonic supersede id; stale callbacks compare captured id against this\n let commitId = 0;\n\n let active: CngxCommitHandle | null = null;\n\n // drives the pending spinner on the specific row the user clicked\n const intendedState = signal<T | undefined>(undefined);\n\n return {\n state: slot,\n isCommitting: computed(() => slot.isPending()),\n intendedValue: intendedState.asReadonly(),\n\n begin(runner, intended, previous, handlers) {\n // tear down previous runner BEFORE bumping commitId, otherwise its\n // supersede-check would pass and fire after all\n active?.cancel();\n const id = ++commitId;\n intendedState.set(intended);\n slot.set('pending');\n\n active = runner({\n onSuccess: (committed) => {\n if (id !== commitId) {\n return;\n }\n slot.setSuccess(committed);\n active = null;\n handlers.onSuccess(committed);\n },\n onError: (err) => {\n if (id !== commitId) {\n return;\n }\n slot.setError(err);\n active = null;\n handlers.onError(err, previous);\n },\n });\n },\n\n cancel() {\n active?.cancel();\n active = null;\n // bump id so late callbacks from the aborted runner are superseded\n commitId++;\n },\n };\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { createCommitController, type CngxCommitController } from './commit-controller';\n\n/**\n * Factory signature for producing {@link CngxCommitController}\n * instances. Consumers override the DI token\n * {@link CNGX_COMMIT_CONTROLLER_FACTORY} with a custom factory to\n * inject retry-with-backoff, offline queues, telemetry, or any\n * other enterprise-specific commit lifecycle - without forking the\n * features that consume it (select family, stepper, future wizards).\n *\n * @category common/data/commit\n */\nexport type CngxCommitControllerFactory = <T>() => CngxCommitController<T>;\n\n/**\n * DI token carrying the factory that every cngx feature uses to\n * allocate its commit controller. Default `providedIn: 'root'`\n * factory returns {@link createCommitController}. Override globally\n * via app providers or per-component via `viewProviders`.\n *\n * Symmetrical to `CNGX_SELECT_COMMIT_CONTROLLER_FACTORY`\n * (`@cngx/forms/select`); the select-side token's default factory\n * delegates to this one, so a single override here cascades into\n * every select variant transparently.\n *\n * ```ts\n * bootstrapApplication(App, {\n * providers: [\n * {\n * provide: CNGX_COMMIT_CONTROLLER_FACTORY,\n * useValue: <T>() => createRetryingCommitController<T>({ attempts: 3 }),\n * },\n * ],\n * });\n * ```\n *\n * @category common/data/commit\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/commit/commit-controller.token.ts\n * @since 0.1.0\n */\nexport const CNGX_COMMIT_CONTROLLER_FACTORY = new InjectionToken<CngxCommitControllerFactory>(\n 'CngxCommitControllerFactory',\n {\n providedIn: 'root',\n factory: () => createCommitController,\n },\n);\n","import {\n type DestroyRef,\n effect,\n type Injector,\n runInInjectionContext,\n type Signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { Observable } from 'rxjs';\n\n/**\n * Options for {@link createMaterialBidirectionalSync}.\n *\n * Material types never enter this surface. The caller maps Material's\n * own event/property shape to a host-agnostic `Signal<number>` /\n * `Observable<number>` / getter / setter at the directive boundary. \\\n * That keeps `@cngx/common/data` independent of `@angular/material`.\n *\n * @category common/data/material-bridge\n */\nexport interface CngxMaterialBidirectionalSyncOptions {\n /**\n * Reactive source for the presenter's current index. The factory's\n * `effect()` tracks this signal — when it changes, Material is\n * written (subject to the equality guard against the Material\n * read-side).\n */\n readonly presenterIndex: Signal<number>;\n\n /**\n * Pulls the Material instance's current `selectedIndex` (or\n * equivalent). Called inside `untracked()` so the effect does not\n * subscribe to any signals the getter might read internally.\n */\n readonly readSelectedIndex: () => number;\n\n /**\n * Writes the Material instance's `selectedIndex` (or equivalent).\n * Called inside `untracked()` per\n * `reference_signal_architecture` rule 2.\n */\n readonly writeSelectedIndex: (idx: number) => void;\n\n /**\n * Stream of Material-driven selection changes, already mapped to a\n * plain index by the caller (`MatTabGroup.selectedIndexChange`\n * forwards directly; `MatStepper.selectionChange` needs\n * `.pipe(map(e => e.selectedIndex))`).\n */\n readonly selectionChange$: Observable<number>;\n\n /**\n * Routes a Material→presenter selection event into the presenter's\n * `select(idx)` method. Subject to an equality guard against\n * `presenterIndex()` so re-entrant events (the presenter's own\n * write firing back through Material) drop without re-routing.\n */\n readonly onMaterialSelection: (idx: number) => void;\n\n /** Injector used to install the effect inside an injection context. */\n readonly injector: Injector;\n\n /** DestroyRef used to clean up the effect and the subscription. */\n readonly destroyRef: DestroyRef;\n}\n\n/**\n * Handle returned by {@link createMaterialBidirectionalSync}.\n *\n * @category common/data/material-bridge\n */\nexport interface CngxMaterialBidirectionalSyncHandle {\n /**\n * Force Material's selected index to the presenter's current index,\n * routed through the factory's self-echo suppression so it never\n * re-enters the Material→presenter path. Hosts call this from their\n * commit lifecycle when a pessimistic commit settles WITHOUT advancing\n * the presenter (a rejected switch), which leaves Material eager-\n * advanced on the refused tab. A no-op when already in sync.\n */\n readonly reconcile: () => void;\n}\n\n/**\n * Single shared bidirectional-sync factory for cngx organisms /\n * directives that bridge a cngx presenter against a Material parent\n * (`<mat-tab-group>`, `<mat-stepper>`, etc.).\n *\n * Lives at Level 2 in `@cngx/common/data` parallel to\n * `createCommitController`. Material types never enter the signature —\n * the caller maps Material-specific events and property accessors to a\n * host-agnostic shape at the directive boundary.\n *\n * Installs:\n *\n * 1. A presenter→Material `effect()` that tracks `presenterIndex` and\n * writes through `writeSelectedIndex`, equality-guarded against\n * `readSelectedIndex()` to suppress redundant writes. The Material\n * read+write pair runs inside `untracked()` per\n * `reference_signal_architecture` rule 2.\n * 2. A Material→presenter subscription that forwards each\n * `selectionChange$` emission to `onMaterialSelection`\n * (equality-guarded against `presenterIndex()` so a Material event\n * whose value already matches the presenter is dropped — closes\n * the re-entrancy loop).\n *\n * Both sides clean up via `destroyRef`.\n *\n * **Material-eager-advance reconciliation.** Material's MDC click\n * handler advances `selectedIndex` *before* the Material→presenter\n * subscription forwards the click. When the presenter HOLDS its index\n * (pessimistic mode + bound `commitAction`), the subscriber does NOT\n * write Material back: on a SUCCESSFUL commit the presenter later\n * advances to the clicked target and Material is already there, so the\n * mirror effect is a no-op (no flash); on a REJECTED commit the presenter\n * never moves, leaving Material eager-advanced on the refused tab. The\n * host detects the rejection through its own commit lifecycle and calls\n * {@link CngxMaterialBidirectionalSyncHandle.reconcile} to snap Material\n * back. Writing from inside the subscriber instead is unsafe: Material's\n * `selectedIndex` read-back lags a programmatic write, so the mirror\n * effect's equality guard reads a stale value and skips the corrective\n * write, sticking the visual on the wrong tab.\n *\n * **Self-echo suppression (loop-safety).** Every programmatic\n * `selectedIndex` write makes Material re-emit `selectionChange`. The\n * factory records each value it writes and drops the matching echo\n * (`indexOf` + splice, which also prunes earlier writes whose echo\n * Material coalesced away) before any other processing. This is\n * load-bearing for an ASYNC commit-action: Material emits the echo a\n * microtask later, by which point the commit may have advanced\n * `presenterIndex`, so an equality-only guard (`presenterIndex() ===\n * idx`) would FAIL to drop the echo — it would re-enter the subscriber\n * and ping-pong against the in-flight navigation (the demo freezes).\n * Matching the echo by the value we wrote drops it regardless of where\n * the presenter has moved.\n *\n * @category common/data/material-bridge\n */\nexport function createMaterialBidirectionalSync(\n opts: CngxMaterialBidirectionalSyncOptions,\n): CngxMaterialBidirectionalSyncHandle {\n const {\n presenterIndex,\n readSelectedIndex,\n writeSelectedIndex,\n selectionChange$,\n onMaterialSelection,\n injector,\n destroyRef,\n } = opts;\n\n // Indices WE wrote into Material, awaiting their echo. Material\n // re-emits `selectionChange` for every programmatic `selectedIndex`\n // write, so each of our writes produces an echo that must NOT be\n // treated as a user selection. Equality against `presenterIndex()`\n // alone is insufficient: with an async commit-action the presenter may\n // have advanced by the time the echo arrives, so the echo no longer\n // equality-drops and would re-enter the subscriber. `indexOf` + splice\n // drops the echo by the value we wrote (and prunes any earlier write\n // whose echo Material coalesced away), regardless of where the\n // presenter has since moved - the loop can never form.\n const selfEchoes: number[] = [];\n const writeMaterial = (idx: number): void => {\n selfEchoes.push(idx);\n writeSelectedIndex(idx);\n };\n\n runInInjectionContext(injector, () => {\n effect(() => {\n const desired = presenterIndex();\n untracked(() => {\n if (readSelectedIndex() === desired) {\n return;\n }\n writeMaterial(desired);\n });\n });\n });\n\n selectionChange$.pipe(takeUntilDestroyed(destroyRef)).subscribe((idx) => {\n // Drop our own write-echo (and any coalesced-away earlier write).\n const echoAt = selfEchoes.indexOf(idx);\n if (echoAt !== -1) {\n selfEchoes.splice(0, echoAt + 1);\n return;\n }\n if (presenterIndex() === idx) {\n return;\n }\n onMaterialSelection(idx);\n // No write-back here. Material eager-advanced to the clicked tab; in\n // pessimistic mode the presenter HOLDS at origin, so on SUCCESS the\n // presenter later advances to this target and Material is already\n // there (no flash, no fight with Material's async `selectedIndex`).\n // On REJECTION the presenter never moves, leaving Material diverged -\n // the host detects that and calls `reconcile()` from its commit\n // lifecycle. Writing here while the commit is in flight is unsafe:\n // Material's `selectedIndex` read-back lags a programmatic write, so\n // the mirror effect's equality guard reads a stale value and skips\n // the corrective write (the visual sticks on the wrong tab).\n });\n\n return {\n reconcile: () => {\n writeMaterial(presenterIndex());\n },\n };\n}\n","/**\n * @module @cngx/common/data\n */\nexport { CngxSort, type SortEntry } from './sort/sort.directive';\nexport { CngxSortHeader } from './sort/sort-header.directive';\nexport { createSortHeaderState, type SortHeaderState } from './sort/sort-header-state';\nexport { CngxFilter } from './filter/filter.directive';\nexport {\n CngxFilterChips,\n CngxFilterChip,\n type CngxFilterChipContext,\n} from './filter-chips/filter-chips.component';\nexport { CngxPaginate } from './paginate/paginate.directive';\nexport { CngxPaginateResetOn, connectPaginateResetOn } from './paginate/paginate-reset.directive';\nexport { connectPaginateEmit, type CngxPaginateEmitHandlers } from './paginate/paginate-emit';\nexport { CngxPaginateRouting } from './paginate/paginate-routing.directive';\nexport { CngxBucketPaginate, type CngxBucket } from './paginate/bucket-paginate.directive';\nexport {\n CNGX_BUCKET_PAGINATE_HOST,\n type CngxBucketPaginateHost,\n type CngxBucketPaginateView,\n} from './paginate/bucket-paginate-host.token';\nexport { CngxDataSource, injectDataSource } from './data-source/data-source';\nexport {\n CngxSmartDataSource,\n injectSmartDataSource,\n type CngxSmartDataSourceOptions,\n} from './data-source/smart-data-source';\n\n// Re-export the curated async-state sub-barrel wholesale so additions there\n// (e.g. fromResource / fromHttpResource / tapAsyncState) cannot silently drop\n// out of `@cngx/common/data`.\nexport * from './async-state';\n\nexport { CngxAsyncRegistry, type CngxAsyncOperation } from './async-registry/async-registry';\nexport { provideAsyncRegistry, injectAsyncRegistry } from './async-registry/provide-async-registry';\nexport {\n CNGX_ASYNC_LABEL,\n CNGX_ASYNC_SKIP,\n withAsyncLabel,\n withAsyncSkip,\n} from './async-registry/http-context';\nexport {\n cngxAsyncInterceptor,\n provideAsyncHttpObservability,\n} from './async-registry/http-interceptor';\n\nexport { CngxAsync, type CngxAsyncContext } from './async/async.directive';\n\nexport { CngxMetric } from './display/metric/metric.component';\nexport { CngxTrend } from './display/trend/trend.component';\nexport { CngxDelta } from './display/delta/delta.component';\nexport { type DeltaPolarity, type DeltaMode } from './display/shared/delta-format';\nexport { CngxStat } from './display/stat/stat.component';\nexport {\n CngxStatLabel,\n CngxStatValue,\n CngxStatDelta,\n CngxStatCaption,\n} from './display/stat/stat-slots';\nexport { CNGX_STAT, type CngxStatRegistry, type CngxStatSlotKind } from './display/stat/stat.token';\nexport { CngxStatus, type StatusTone } from './display/status/status.component';\nexport { CngxGoal } from './display/goal/goal.component';\n\nexport {\n injectRecycler,\n provideRecyclerI18n,\n CNGX_RECYCLER_I18N,\n type RecyclerConfig,\n type CngxRecycler,\n type RecyclerI18n,\n} from './recycler/recycler';\nexport { CngxMeasure } from './recycler/measure.directive';\nexport { CngxVirtualItem } from './recycler/virtual-item.directive';\nexport { CngxRecyclerAnnouncer } from './recycler/recycler-announcer.component';\nexport { connectRecyclerToRoving } from './recycler/connect-recycler-roving';\nexport { connectRecyclerToActiveDescendant } from './recycler/connect-recycler-active-descendant';\n\n// Commit controller — generic async-commit state machine shared by\n// the select family and the stepper / wizard family.\nexport {\n createCommitController,\n type CngxCommitController,\n type CngxCommitBeginHandlers,\n type CngxCommitHandle,\n type CngxCommitRunner,\n CNGX_COMMIT_CONTROLLER_FACTORY,\n type CngxCommitControllerFactory,\n} from './commit';\n\n// Material bidirectional sync — shared factory consumed by cngx\n// organisms / directives that bridge a cngx presenter against a\n// Material parent (`<mat-tab-group>`, `<mat-stepper>`, etc.).\n// Material types never enter the signature; the caller maps at the\n// directive boundary so `@cngx/common/data` stays Sheriff-Level-2\n// compliant (no `@angular/material` import).\nexport {\n createMaterialBidirectionalSync,\n type CngxMaterialBidirectionalSyncOptions,\n type CngxMaterialBidirectionalSyncHandle,\n} from './material-bridge/bidirectional-sync';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;MAMU,QAAQ,CAAA;;IAEV,WAAW,GAAG,KAAK,CAAqB,SAAS,mFAAI,KAAK,EAAE,gBAAgB,EAAA,CAAG;;IAE/E,cAAc,GAAG,KAAK,CAA6B,SAAS,sFACnE,KAAK,EAAE,mBAAmB,EAAA,CAC1B;AACF;;;AAGG;AACM,IAAA,SAAS,GAAG,KAAK,CAAU,KAAK,gFAAC;AAC1C;;;;AAIG;IACM,WAAW,GAAG,KAAK,CAAwB,SAAS,mFAAI,K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