forty-cdk 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/date-picker/README.md +53 -0
- package/date-range-field/README.md +173 -0
- package/fesm2022/forty-cdk-combobox.mjs +39 -1
- package/fesm2022/forty-cdk-combobox.mjs.map +1 -1
- package/fesm2022/forty-cdk-core.mjs +1111 -338
- package/fesm2022/forty-cdk-core.mjs.map +1 -1
- package/fesm2022/forty-cdk-date-field.mjs +43 -345
- package/fesm2022/forty-cdk-date-field.mjs.map +1 -1
- package/fesm2022/forty-cdk-date-picker.mjs +589 -266
- package/fesm2022/forty-cdk-date-picker.mjs.map +1 -1
- package/fesm2022/forty-cdk-date-range-field.mjs +682 -0
- package/fesm2022/forty-cdk-date-range-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-drag-drop.mjs +49 -41
- package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -1
- package/fesm2022/forty-cdk-hover-card.mjs +34 -4
- package/fesm2022/forty-cdk-hover-card.mjs.map +1 -1
- package/fesm2022/forty-cdk-listbox.mjs +15 -26
- package/fesm2022/forty-cdk-listbox.mjs.map +1 -1
- package/fesm2022/forty-cdk-table.mjs +10 -2
- package/fesm2022/forty-cdk-table.mjs.map +1 -1
- package/fesm2022/forty-cdk-time-field.mjs +45 -202
- package/fesm2022/forty-cdk-time-field.mjs.map +1 -1
- package/fesm2022/forty-cdk-time-range-field.mjs +671 -0
- package/fesm2022/forty-cdk-time-range-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-tooltip.mjs +40 -8
- package/fesm2022/forty-cdk-tooltip.mjs.map +1 -1
- package/fesm2022/forty-cdk-tree.mjs +26 -34
- package/fesm2022/forty-cdk-tree.mjs.map +1 -1
- package/hover-card/README.md +1 -0
- package/listbox/README.md +24 -0
- package/package.json +9 -1
- package/time-field/README.md +1 -1
- package/time-range-field/README.md +174 -0
- package/tooltip/README.md +1 -0
- package/tree/README.md +27 -0
- package/types/forty-cdk-checkbox.d.ts +1 -1
- package/types/forty-cdk-combobox.d.ts +26 -1
- package/types/forty-cdk-core.d.ts +504 -149
- package/types/forty-cdk-date-field.d.ts +12 -16
- package/types/forty-cdk-date-picker.d.ts +374 -155
- package/types/forty-cdk-date-range-field.d.ts +390 -0
- package/types/forty-cdk-hover-card.d.ts +8 -2
- package/types/forty-cdk-listbox.d.ts +20 -0
- package/types/forty-cdk-table.d.ts +8 -1
- package/types/forty-cdk-time-field.d.ts +16 -18
- package/types/forty-cdk-time-range-field.d.ts +389 -0
- package/types/forty-cdk-tooltip.d.ts +5 -3
- package/types/forty-cdk-tree.d.ts +28 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forty-cdk-combobox.mjs","sources":["../../../projects/forty-cdk/combobox/src/combobox-snapshot-fold.ts","../../../projects/forty-cdk/combobox/src/combobox-auto-highlight.ts","../../../projects/forty-cdk/combobox/src/combobox-context.ts","../../../projects/forty-cdk/combobox/src/combobox-defaults.ts","../../../projects/forty-cdk/combobox/src/combobox-label-cache.ts","../../../projects/forty-cdk/combobox/src/combobox-virtualized-navigator.ts","../../../projects/forty-cdk/combobox/src/combobox.ts","../../../projects/forty-cdk/combobox/src/combobox-anchor.ts","../../../projects/forty-cdk/combobox/src/combobox-trigger.ts","../../../projects/forty-cdk/combobox/src/combobox-input.ts","../../../projects/forty-cdk/combobox/src/combobox-content.ts","../../../projects/forty-cdk/combobox/src/combobox-list.ts","../../../projects/forty-cdk/combobox/src/combobox-option.ts","../../../projects/forty-cdk/combobox/src/combobox-indicator.ts","../../../projects/forty-cdk/combobox/src/combobox-empty.ts","../../../projects/forty-cdk/combobox/src/combobox-status.ts","../../../projects/forty-cdk/combobox/src/combobox-clear.ts","../../../projects/forty-cdk/combobox/src/combobox-chips.ts","../../../projects/forty-cdk/combobox/src/combobox-chip.ts","../../../projects/forty-cdk/combobox/src/combobox-chip-remove.ts","../../../projects/forty-cdk/combobox/src/combobox-group.ts","../../../projects/forty-cdk/combobox/src/combobox-group-label.ts","../../../projects/forty-cdk/combobox/src/combobox-separator.ts","../../../projects/forty-cdk/combobox/src/combobox-host-directive.ts","../../../projects/forty-cdk/combobox/src/forty-cdk-combobox.ts"],"sourcesContent":["/**\n * Combobox-local re-exports of the shared snapshot-fold helpers. The single\n * sources live in `_internal/`: `tryReadHandle` (the NG0950 read guard) in\n * `_internal/signal-graph/read-handle.ts` and `foldSnapshotOnTotalCountTransition`\n * (the `totalCount`-reset `linkedSignal` fold) in\n * `_internal/collection/fold-snapshot.ts`. Kept as a barrel so `OptionLabelCache`\n * and the combobox virtualized navigator import from one combobox-local path.\n */\nexport { tryReadHandle } from 'forty-cdk/core';\nexport { foldSnapshotOnTotalCountTransition } from 'forty-cdk/core';\n","import { linkedSignal, untracked, type WritableSignal } from '@angular/core';\n\nimport { tryReadHandle } from './combobox-snapshot-fold';\nimport type { ForComboboxInitialFocus, ForComboboxOptionHandle } from './combobox-context';\nimport type { OptionLabelCache } from './combobox-label-cache';\nimport type { VirtualizedNavigator } from './combobox-virtualized-navigator';\n\n/**\n * Inputs for {@link resolveAutoHighlightSeed}. Mirror the tracked source of the\n * host's `#activeId` linkedSignal: the live registered options, the current\n * selection (for `initialFocus === 'selected'`), and the equality fn used to\n * match selected values to options.\n */\nexport interface AutoHighlightSeedInput<T> {\n /** Live registered options in DOM order. */\n readonly items: readonly ForComboboxOptionHandle<T>[];\n /** Where auto-highlight should land: first / last enabled, or the selection. */\n readonly initialFocus: ForComboboxInitialFocus;\n /** Current selection — only read when `initialFocus === 'selected'`. */\n readonly value: readonly T[];\n /** Identity comparison used to match a selected value to a registered option. */\n readonly equals: (a: T, b: T) => boolean;\n}\n\n/**\n * Reactive source for the host's `#activeId` linkedSignal. Each accessor reads\n * one of the host signals the activedescendant decision depends on.\n */\nexport interface ActiveIdSource<T> {\n /** Visible input text — a change drops the prior pointer (it may be filtered out). */\n readonly query: () => string;\n /** Whether the listbox is open. */\n readonly open: () => boolean;\n /** Whether auto-highlight is enabled. */\n readonly autoHighlight: () => boolean;\n /** `true` when the consumer set `totalCount()` (virtualized path). */\n readonly virtualized: () => boolean;\n /** Where auto-highlight should land. */\n readonly initialFocus: () => ForComboboxInitialFocus;\n /** Live registered options in DOM order. */\n readonly items: () => readonly ForComboboxOptionHandle<T>[];\n /** Current selection — only read for `initialFocus === 'selected'`. */\n readonly value: () => readonly T[];\n /** Identity comparison used to match a selected value to a registered option. */\n readonly equals: () => (a: T, b: T) => boolean;\n}\n\n/**\n * Build the host's activedescendant pointer as a `linkedSignal` so the\n * \"what should be highlighted given open / items / autoHighlight\" decision is a\n * **pure derivation**, never a write from an `effect` (the banned\n * state-propagation pattern). The returned signal is still writable for the\n * genuinely imperative moves that own their own scroll — arrow / Home / End\n * navigation, pointer-move hover, multi-mode activation, and the virtualized\n * pending-nav resolution (`navigate` / `seedFromIndexedSnapshot` /\n * `tryResolvePending` in `combobox-virtualized-navigator.ts`).\n *\n * The reset/seed rule, in order:\n * - On a `query` change the previously-active option may have been filtered\n * out, so the prior pointer is dropped.\n * - A pointer that no longer matches a registered option is dropped (covers the\n * consumer mutating the list without touching `query`).\n * - When a valid pointer survives, it is preserved (arrow nav, hover).\n * - Otherwise, in the **non-virtualized** case, auto-highlight seeds the\n * first / last enabled option (per `initialFocus`) while the listbox is open\n * via {@link resolveAutoHighlightSeed}. The virtualized case returns `null`\n * here and the host's effect seeds it imperatively, because that seed must\n * order options by absolute `posInSet` and must lose to a pending\n * `(scrollToIndex)` resolution.\n *\n * Internal — not re-exported from `combobox/index.ts` or `public-api.ts`.\n */\nexport function createActiveIdSignal<T>(source: ActiveIdSource<T>): WritableSignal<string | null> {\n return linkedSignal<\n {\n query: string;\n open: boolean;\n autoHighlight: boolean;\n virtualized: boolean;\n initialFocus: ForComboboxInitialFocus;\n items: readonly ForComboboxOptionHandle<T>[];\n value: readonly T[];\n equals: (a: T, b: T) => boolean;\n },\n string | null\n >({\n source: () => ({\n query: source.query(),\n open: source.open(),\n autoHighlight: source.autoHighlight(),\n virtualized: source.virtualized(),\n initialFocus: source.initialFocus(),\n items: source.items(),\n value: source.value(),\n equals: source.equals(),\n }),\n computation: (\n { query, open, autoHighlight, virtualized, initialFocus, items, value, equals },\n prev,\n ) => {\n const queryChanged = prev !== undefined && prev.source.query !== query;\n let current = queryChanged ? null : (prev?.value ?? null);\n if (current !== null && !items.some((o) => o.id() === current)) {\n current = null;\n }\n if (current !== null) {\n return current;\n }\n if (virtualized || !autoHighlight || !open || items.length === 0) {\n return null;\n }\n return resolveAutoHighlightSeed({ items, initialFocus, value, equals });\n },\n });\n}\n\n/**\n * Resolve the auto-highlight seed for the **non-virtualized** combobox: the id\n * of the option `aria-activedescendant` should fall on when the listbox is open\n * and no pointer survives. Returns `null` when no enabled option qualifies (or\n * when a `'selected'` seed can't yet read its options — see `tryReadHandle`).\n *\n * Pure over its inputs — no signal reads, no DOM access — so the host can call\n * it from inside its `#activeId` linkedSignal computation without leaking the\n * banned write-from-effect pattern. The virtualized branch seeds imperatively\n * via the navigator instead (it orders by absolute `posInSet` and must lose to\n * a pending `(scrollToIndex)` resolution).\n *\n * Internal — not re-exported from `combobox/index.ts` or `public-api.ts`.\n */\nexport function resolveAutoHighlightSeed<T>(input: AutoHighlightSeedInput<T>): string | null {\n const { items, initialFocus, value, equals } = input;\n if (initialFocus === 'selected') {\n const selected = findSelectedEnabled(items, value, equals);\n if (selected === NOT_READY) {\n return null;\n }\n if (selected) {\n return selected.id();\n }\n }\n const target = initialFocus === 'last' ? findLastEnabled(items) : findFirstEnabled(items);\n return target?.id() ?? null;\n}\n\nfunction findFirstEnabled<T>(\n items: readonly ForComboboxOptionHandle<T>[],\n): ForComboboxOptionHandle<T> | null {\n for (const item of items) {\n if (!item.disabled()) {\n return item;\n }\n }\n return null;\n}\n\nfunction findLastEnabled<T>(\n items: readonly ForComboboxOptionHandle<T>[],\n): ForComboboxOptionHandle<T> | null {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (item && !item.disabled()) {\n return item;\n }\n }\n return null;\n}\n\nconst NOT_READY = Symbol('forty-cdk/combobox:not-ready');\n\nfunction findSelectedEnabled<T>(\n items: readonly ForComboboxOptionHandle<T>[],\n values: readonly T[],\n equals: (a: T, b: T) => boolean,\n): ForComboboxOptionHandle<T> | null | typeof NOT_READY {\n if (values.length === 0) {\n return null;\n }\n for (const item of items) {\n if (item.disabled()) {\n continue;\n }\n const read = tryReadHandle(() => ({ value: item.value() }));\n if (read === null) {\n return NOT_READY;\n }\n if (values.some((sel) => equals(read.value, sel))) {\n return item;\n }\n }\n return null;\n}\n\n/**\n * Collaborators the auto-highlight bridge reaches for. The host owns the\n * activedescendant (`getActiveId`) and the last-scrolled-into-view id\n * (`getLastPositionedId` / `setLastPositionedId`); the bridge only reads and\n * writes them through these accessors so it can stay outside the directive.\n */\nexport interface AutoHighlightBridgeDeps<T> {\n /** Eagerly pull the label cache so its `prev` slot is seeded while open. */\n readonly labelCache: Pick<OptionLabelCache<T>, 'prime'>;\n /** Lazily build the virtualization navigator (only when `totalCount` is set). */\n readonly requireNavigator: () => VirtualizedNavigator<T>;\n /** Live registered options in DOM order. */\n readonly items: () => readonly ForComboboxOptionHandle<T>[];\n /** Whether the listbox is open. */\n readonly open: () => boolean;\n /** Whether auto-highlight is enabled. */\n readonly autoHighlight: () => boolean;\n /** `true` when the consumer set `totalCount()` (virtualized path). */\n readonly virtualized: () => boolean;\n /** Where auto-highlight should land. */\n readonly initialFocus: () => ForComboboxInitialFocus;\n /** Read the host's current activedescendant id (call inside `untracked`). */\n readonly getActiveId: () => string | null;\n /** Last id the bridge scrolled into view, to avoid re-scrolling on hover. */\n readonly getLastPositionedId: () => string | null;\n /** Persist the last id the bridge scrolled into view. */\n readonly setLastPositionedId: (id: string | null) => void;\n}\n\n/**\n * The **imperative tail** of the auto-highlight flow, run from the host's\n * constructor `effect`. The activedescendant *decision* is a pure derivation in\n * {@link createActiveIdSignal}; this only performs the side effects that escape\n * the reactive graph. It reacts to `items()`, `autoHighlight()` and `open()`:\n *\n * 1. Primes the label cache so its `linkedSignal` `prev` slot gets seeded while\n * the listbox is open — without an eager pull the lazy cache never runs\n * during the open cycle in non-virtualized usage and persistence across\n * close → re-open would start from an empty `prev`. The virtualization\n * navigator (and its position-map) is primed only when the consumer set\n * `totalCount()`, so a plain combobox never builds it.\n * 2. Virtualized only: resolves a pending `(scrollToIndex)` navigation — once\n * the option for the requested posInSet mounts, `tryResolvePending` seeds\n * activedescendant to its id and scrolls it into view. This is the single\n * sanctioned activedescendant write from an effect, and it is a legitimate\n * side effect (not state propagation): it integrates the consumer's\n * virtualizer mounting a row asynchronously, and it must win over the\n * auto-highlight seed — which is why the virtualized seed can't live in the\n * linkedSignal. `seedFromIndexedSnapshot` then seeds the topmost / bottommost\n * *rendered* enabled option (ordered by absolute `posInSet`) deliberately\n * passively — it only moves the pointer, never the consumer's scroll position.\n * 3. Non-virtualized: scrolls the auto-highlight-seeded option into view so a\n * seed that lands below the fold is visible, for parity with `navigate()`.\n * The seed itself comes from the linkedSignal; this is its imperative tail.\n * The activedescendant is read `untracked` so the scroll never re-triggers\n * the effect, and pointer-move hover doesn't reach here (it changes none of\n * the tracked reads), so hovering never scrolls.\n *\n * Internal — not re-exported from `combobox/index.ts` or `public-api.ts`.\n */\nexport function runAutoHighlightBridge<T>(deps: AutoHighlightBridgeDeps<T>): void {\n deps.labelCache.prime();\n const items = deps.items();\n const open = deps.open();\n const autoHighlight = deps.autoHighlight();\n const virtualized = deps.virtualized();\n\n if (virtualized) {\n const navigator = deps.requireNavigator();\n navigator.prime();\n if (navigator.tryResolvePending()) {\n return;\n }\n if (autoHighlight && open && untracked(() => deps.getActiveId()) === null && items.length > 0) {\n navigator.seedFromIndexedSnapshot(deps.initialFocus() === 'last' ? 'last' : 'first');\n }\n return;\n }\n\n if (!open) {\n deps.setLastPositionedId(null);\n return;\n }\n const activeId = untracked(() => deps.getActiveId());\n if (activeId === null || activeId === deps.getLastPositionedId()) {\n return;\n }\n const active = items.find((o) => o.id() === activeId);\n active?.host.scrollIntoView?.({ block: 'nearest' });\n deps.setLastPositionedId(activeId);\n}\n","import { computed, inject, InjectionToken, type ModelSignal, type Signal } from '@angular/core';\nimport type { ReferenceElement } from '@floating-ui/dom';\n\nimport {\n type CollectionHandle,\n type FloatingAlign,\n type FloatingSide,\n type WritingDirection,\n type VetoableNativeEvent,\n} from 'forty-cdk/core';\n\n/**\n * Why the combobox closed. Mirrors the menu / select vocabulary so consumers\n * can switch on the reason regardless of overlay flavor.\n */\nexport type ForComboboxCloseReason =\n | 'escape'\n | 'pointerDownOutside'\n | 'focusOutside'\n | 'select'\n | 'tab'\n | 'programmatic';\n\n/**\n * Autocomplete mode applied to the input. Mirrors the\n * [WAI-ARIA combobox autocomplete property](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/#wai-ariaroles,states,andproperties).\n *\n * - `'none'`: input acts as a free-text query; no completion is performed.\n * - `'list'`: the listbox shows filtered options; the input value reflects\n * the user's typed query verbatim.\n * - `'inline'`: the rest of the first matching option is auto-completed\n * into the input as selected text; the listbox does not auto-open.\n * - `'both'`: combines `'list'` and `'inline'` — listbox opens with the\n * filtered options *and* the first match auto-completes inline.\n */\nexport type ForComboboxAutocomplete = 'none' | 'list' | 'inline' | 'both';\n\n/**\n * Where the auto-highlight seed lands when the listbox opens. `'first'` / `'last'`\n * bias to the natural extreme (e.g. ArrowDown / ArrowUp on the trigger). `'selected'`\n * — used by the picker trigger's plain open — seeds the committed selection, falling\n * back to the first enabled option when there is no selection or it is filtered out.\n */\nexport type ForComboboxInitialFocus = 'first' | 'last' | 'selected';\n\nexport interface ForComboboxOptionHandle<T = unknown> extends CollectionHandle {\n readonly id: Signal<string>;\n readonly value: Signal<T>;\n readonly label: Signal<string>;\n readonly disabled: Signal<boolean>;\n /**\n * Index in the consumer's source array. Required when virtualizing so the\n * directive can fold off-screen options into the snapshot keyed by\n * absolute position. Optional otherwise — when absent the snapshot falls\n * back to DOM order.\n */\n readonly posInSet?: Signal<number | null>;\n}\n\nexport interface ForComboboxChipHandle<T = unknown> extends CollectionHandle {\n readonly value: Signal<T>;\n}\n\n/**\n * Coordination contract owned by `[forCombobox]`. Input, content, options,\n * groups, separators, the empty-state directive, the clear button, and the\n * multi-mode chip pieces all inject this token to read state and delegate\n * behavior.\n *\n * The value model is always an array — single mode (`multiple=false`,\n * default) keeps 0 or 1 element, multi mode keeps any number. This mirrors\n * `[forListbox]` / `[forSelect]` so consumers learn one selection contract\n * across the whole library.\n *\n * Generic over the option value type `T` (default `string`). When a\n * consumer binds object items the directive infers `T` from `[(value)]` and\n * the per-piece signatures specialize accordingly. Items are compared via\n * the consumer-provided `isItemEqualToValue` and rendered as labels via\n * `itemToStringLabel`; the form's hidden inputs serialize via\n * `itemToFormValue`.\n */\nexport interface ForComboboxContext<T = unknown> {\n readonly query: ModelSignal<string>;\n readonly value: ModelSignal<readonly T[]>;\n readonly open: ModelSignal<boolean>;\n\n readonly multiple: Signal<boolean>;\n /**\n * The combobox's effective disabled — its own `disabled` input OR'd with a\n * surrounding disabled `[forFieldset]`. Input, options, clear, and chip pieces\n * read this so a disabled combobox (or fieldset) is inert and exposes\n * `aria-disabled`.\n */\n readonly effectiveDisabled: Signal<boolean>;\n readonly readonly: Signal<boolean>;\n readonly required: Signal<boolean>;\n readonly invalid: Signal<boolean>;\n readonly pending: Signal<boolean>;\n readonly dir: Signal<WritingDirection>;\n\n readonly autocompleteMode: Signal<ForComboboxAutocomplete>;\n readonly openOnFocus: Signal<boolean>;\n readonly openOnQuery: Signal<boolean>;\n readonly commitOnSelect: Signal<boolean>;\n readonly clearOnQueryChange: Signal<boolean>;\n\n readonly dismissible: Signal<boolean>;\n /**\n * Whether focus returns to the `[forComboboxTrigger]` on close (picker\n * anatomy). Ignored in the editable anatomy, where focus never left the\n * input. Default `true`.\n */\n readonly returnFocus: Signal<boolean>;\n readonly side: Signal<FloatingSide | undefined>;\n readonly align: Signal<FloatingAlign>;\n readonly sideOffset: Signal<number>;\n readonly alignOffset: Signal<number>;\n readonly avoidCollisions: Signal<boolean>;\n readonly collisionPadding: Signal<number>;\n readonly arrowPadding: Signal<number>;\n readonly sticky: Signal<'partial' | 'always' | false>;\n readonly hideWhenDetached: Signal<boolean>;\n readonly clipUntilPositioned: Signal<boolean>;\n readonly loop: Signal<boolean>;\n\n readonly inputId: Signal<string>;\n readonly contentId: Signal<string>;\n /**\n * Id of the `[forComboboxList]` listbox surface (picker anatomy). The input's\n * `aria-controls` points here when a list is registered; without one it falls\n * back to {@link contentId} (the editable anatomy where content itself is the\n * listbox).\n */\n readonly listId: Signal<string>;\n /**\n * Id of the element carrying `role=\"listbox\"` — {@link listId} when a\n * `[forComboboxList]` is registered, otherwise {@link contentId}. The input\n * targets this with `aria-controls`.\n */\n readonly listboxId: Signal<string>;\n readonly ariaLabel: Signal<string | null>;\n\n /**\n * Element floating-ui anchors the listbox against. Prefers an optional\n * `[forComboboxAnchor]` when registered, otherwise falls back to the input.\n * Decoupled from `input` so the input keeps driving `aria-controls`,\n * `aria-activedescendant`, keyboard interaction, and its outside-pointer\n * exemption regardless of where the listbox paints.\n */\n readonly anchor: Signal<ReferenceElement | null>;\n readonly input: Signal<HTMLInputElement | null>;\n registerInput(el: HTMLInputElement): void;\n unregisterInput(el: HTMLInputElement): void;\n\n /**\n * Register / unregister an optional `[forComboboxAnchor]` positioning\n * element. At most one anchor per root; a second registration throws.\n * Reference-based unregister, so an anchor torn down inside `@if` restores\n * the input fallback cleanly.\n */\n registerAnchor(el: HTMLElement): void;\n unregisterAnchor(el: HTMLElement): void;\n\n /**\n * The optional `[forComboboxTrigger]` button (picker anatomy). When present\n * it is the default positioning anchor (after an explicit `[forComboboxAnchor]`)\n * and the element focus returns to on close. `null` in the editable anatomy.\n */\n readonly trigger: Signal<HTMLElement | null>;\n registerTrigger(el: HTMLElement): void;\n unregisterTrigger(el: HTMLElement): void;\n\n readonly content: Signal<HTMLElement | null>;\n registerContent(el: HTMLElement): void;\n unregisterContent(el: HTMLElement): void;\n\n /**\n * The optional `[forComboboxList]` listbox surface (picker anatomy). When\n * registered, `[forComboboxContent]` drops its `role=\"listbox\"` semantics and\n * becomes a neutral popup surface; the list carries the listbox role and owns\n * the options. `null` in the editable anatomy.\n */\n readonly list: Signal<HTMLElement | null>;\n /** True when a `[forComboboxList]` is registered (picker anatomy). */\n readonly hasList: Signal<boolean>;\n registerList(el: HTMLElement): void;\n unregisterList(el: HTMLElement): void;\n\n registerOption(handle: ForComboboxOptionHandle<T>): void;\n unregisterOption(handle: ForComboboxOptionHandle<T>): void;\n readonly options: Signal<readonly ForComboboxOptionHandle<T>[]>;\n\n /** Multi-mode chip collection. Order follows DOM (= `value()` order in practice). */\n registerChip(handle: ForComboboxChipHandle<T>): void;\n unregisterChip(handle: ForComboboxChipHandle<T>): void;\n readonly chips: Signal<readonly ForComboboxChipHandle<T>[]>;\n\n /**\n * Selected entries paired with their resolved label (from the option\n * cache) — convenient for rendering chips with `@for`. Falls back to\n * `itemToStringLabel(value)` when no matching option is registered (and\n * to the raw string when `T` is `string`).\n */\n readonly selected: Signal<readonly { value: T; label: string }[]>;\n\n /** Compare two items for equality. Defaults to `===`; overridden for object values. */\n readonly isItemEqualToValue: Signal<(a: T, b: T) => boolean>;\n /** Render an item as a string label. Drives chip labels and `commitOnSelect` writes into the input. */\n readonly itemToStringLabel: Signal<(item: T) => string>;\n /** Serialize an item for the hidden input's `value` attribute. */\n readonly itemToFormValue: Signal<(item: T) => string>;\n\n /** Id of the currently active option (drives `aria-activedescendant` on the input). */\n readonly activeId: Signal<string | null>;\n /** Set the activedescendant directly. Used by options on pointer-move and by the input on inline-completion seed. */\n setActiveId(id: string | null): void;\n /** Read-only access to the cached snapshot consumed by inline-autocomplete in the input directive. */\n cachedOptions(): readonly { id: string; value: T; label: string }[];\n\n /**\n * Total number of options in the consumer's source array. Used for\n * `aria-setsize` and for navigation past the visible window when\n * virtualizing. Falls back to `options().length` when undefined.\n */\n readonly totalCount: Signal<number | undefined>;\n /** Inclusive-exclusive [start, end) range of options currently rendered when virtualizing. */\n readonly visibleRange: Signal<readonly [number, number] | undefined>;\n\n /** True when `value` includes `v` per the active equality function. */\n isSelected(value: T): boolean;\n /** True when `id` is the activedescendant. */\n isActive(id: string): boolean;\n\n /**\n * Whether a pointer-suppression window is currently open. Opened whenever the\n * directive scrolls the active option into view during keyboard navigation,\n * so a synthetic `pointermove` fired because the scroll slid a different\n * option under a stationary cursor does not hijack the activedescendant.\n * Options consult this from their hover handler and skip the move while it\n * returns `true`.\n */\n isPointerSuppressed(): boolean;\n\n /**\n * Activate by handle. Single mode replaces + closes + commits label. Multi\n * mode toggles in/out + stays open + (when `commitOnSelect`) clears the\n * query so the user can search the next item. No-op on disabled / readonly.\n */\n activate(handle: ForComboboxOptionHandle<T>): void;\n\n /** Remove a value from `value()`. Used by chip-remove and Backspace heuristics. */\n removeValue(value: T): void;\n\n /** Move the activedescendant to the first / last / next / prev enabled option. */\n navigate(direction: 'next' | 'prev' | 'first' | 'last'): void;\n /** Activate the option currently marked as activedescendant (Enter from the input). */\n activateActive(): boolean;\n\n /** Set the typed query. Emits inline completion / openOnQuery side-effects via the input directive. */\n setQueryFromInput(query: string): void;\n\n /**\n * Clear value and (optionally) query. Used by `[forComboboxClear]` and\n * by the Backspace-on-empty-input heuristic. The query is reset only\n * when `clearQuery` is true.\n */\n clear(clearQuery?: boolean): void;\n\n /** Where focus should land after the listbox opens. The input directive sets this before flipping `open`. */\n readonly initialFocus: Signal<ForComboboxInitialFocus>;\n setInitialFocus(target: ForComboboxInitialFocus): void;\n\n toggle(): void;\n openMenu(initialFocus?: ForComboboxInitialFocus): void;\n closeMenu(reason: ForComboboxCloseReason): void;\n\n /**\n * The reason of the most recent close (or `null` before any close / after a\n * fresh open). `[forComboboxContent]` reads this so a `'tab'` close skips the\n * return-focus move — Tab has already advanced focus and re-focusing the\n * trigger would steal it back. Only meaningful in the picker anatomy.\n */\n readonly lastCloseReason: Signal<ForComboboxCloseReason | null>;\n\n /**\n * Fires the `(autoFocusOnOpen)` output and returns whether the consumer\n * vetoed (called `preventDefault()`). The picker anatomy moves focus into the\n * input on open; a veto skips that imperative move. Editable anatomy never\n * calls this (focus never moves).\n */\n emitAutoFocusOnOpen(): boolean;\n /**\n * Fires the `(autoFocusOnClose)` output and returns whether the consumer\n * vetoed. The picker anatomy returns focus to the trigger on close; a veto\n * skips it.\n */\n emitAutoFocusOnClose(): boolean;\n\n /**\n * Escape is consumer-owned and routed through the input directive (focus\n * stays in the input), so it is invoked directly with the raw\n * `KeyboardEvent` rather than through the dismissable layer.\n */\n emitEscapeKeyDown(event: KeyboardEvent): void;\n /**\n * Outside-interaction emit forwarders. `injectOverlayShell` builds and\n * reuses one `VetoableNativeEvent` across the specific and composite\n * channels, then hands it to these forwarders to fire the matching output\n * and calls `requestClose` when un-vetoed.\n */\n emitPointerDownOutside(veto: VetoableNativeEvent<PointerEvent>): void;\n emitFocusOutside(veto: VetoableNativeEvent<FocusEvent>): void;\n emitInteractOutside(veto: VetoableNativeEvent<PointerEvent | FocusEvent>): void;\n /** Implicit close requested by the shell after an un-vetoed outside interaction. */\n requestClose(reason: 'pointerDownOutside' | 'focusOutside'): void;\n\n /** Flip the `touched` model. Called by input on blur-to-outside and by dismiss events. */\n markTouched(): void;\n}\n\n/**\n * `ForCombobox<T>`'s generic does NOT flow to this token: an `InjectionToken`\n * is a single runtime instance, so it is published at `ForComboboxContext<unknown>`.\n * `injectComboboxContext<T>()` re-applies `T` with an `as unknown as` cast, and\n * each piece (input, option, chip) relies on consumer discipline — the\n * `[forComboboxOption][value]` and the root `[(value)]` must be the same `T`.\n * There is no clean fix without abandoning the token pattern; the contract is\n * the consumer's to honor. Object identity is reconciled at runtime via\n * `isItemEqualToValue`, which bounds the practical blast radius of a mismatch.\n */\nexport const FOR_COMBOBOX_CONTEXT = new InjectionToken<ForComboboxContext>('FOR_COMBOBOX_CONTEXT');\n\n/**\n * Resolve the surrounding combobox context, re-applying the caller's `T`. The\n * cast through `unknown` is unavoidable (see {@link FOR_COMBOBOX_CONTEXT}): the\n * token can't carry the per-instance generic, so `T` correctness is a\n * consumer-honored contract, not a compiler-enforced one.\n */\nexport function injectComboboxContext<T = unknown>(piece: string): ForComboboxContext<T> {\n const ctx = inject(FOR_COMBOBOX_CONTEXT, { optional: true });\n if (!ctx) {\n throw new Error(\n `[forty-cdk/combobox] ${piece} must be used inside a [forCombobox] element. ` +\n \"If it is declared inside an ng-template, DI resolves at the template's declaration site — \" +\n 'not where it is stamped (e.g. via ngTemplateOutlet) — so declare the template inside the ' +\n '[forCombobox] root.',\n );\n }\n return ctx as unknown as ForComboboxContext<T>;\n}\n\n/**\n * Resolves the trigger's root context: the explicit reference when the\n * `[forComboboxTrigger]` input carries one, the injected `FOR_COMBOBOX_CONTEXT`\n * otherwise. The orphan error only fires when neither resolves, on first read\n * of the returned signal. Must be called in an injection context.\n */\nexport function injectComboboxTriggerContext<T = unknown>(\n explicitRoot: Signal<ForComboboxContext<T> | ''>,\n): Signal<ForComboboxContext<T>> {\n const injected = inject(FOR_COMBOBOX_CONTEXT, { optional: true });\n return computed(() => {\n const explicit = explicitRoot();\n if (explicit !== '') {\n return explicit;\n }\n if (injected) {\n return injected as unknown as ForComboboxContext<T>;\n }\n throw new Error(\n '[forty-cdk/combobox] ForComboboxTrigger could not resolve its [forCombobox] root: ' +\n 'no FOR_COMBOBOX_CONTEXT provider is visible and no explicit root reference was passed. ' +\n \"If this trigger is declared inside an ng-template, DI resolves at the template's declaration \" +\n 'site — not where it is stamped — so either declare the template inside the root or pass the ' +\n 'root explicitly: [forComboboxTrigger]=\"root\" with #root=\"forCombobox\".',\n );\n });\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\n\n/**\n * Defaults inherited by descendant comboboxes in the surrounding injector\n * scope. Configure with `provideForComboboxDefaults` either at the\n * application root or in any component's `providers` array; partial\n * overrides merge with the parent scope.\n */\nexport interface ForComboboxDefaults {\n /**\n * Distance (px) between the combobox input/trigger and the floating\n * content along the resolved `side` axis, for comboboxes that don't\n * override `sideOffset` locally.\n */\n sideOffset: number;\n /**\n * Padding (px) added to the viewport edges for collision-aware\n * positioning, for comboboxes that don't override `collisionPadding`\n * locally. Higher values keep the floating content further from the edge\n * when `flip` / `shift` runs.\n */\n collisionPadding: number;\n}\n\n/**\n * Library fallback for combobox defaults, read at the root injector when no\n * consumer has called `provideForComboboxDefaults`. Exported for the shared\n * defaults contract spec; not re-exported from the primitive's public entry.\n */\nexport const FOR_COMBOBOX_FALLBACK_DEFAULTS: ForComboboxDefaults = {\n sideOffset: 4,\n collisionPadding: 8,\n};\n\nconst { token, provideDefaults } = createDefaults<ForComboboxDefaults>(\n 'FOR_COMBOBOX_DEFAULTS',\n FOR_COMBOBOX_FALLBACK_DEFAULTS,\n);\n\n/** Token holding the resolved combobox defaults for the current scope. */\nexport const FOR_COMBOBOX_DEFAULTS = token;\n\n/**\n * Configures forty-cdk combobox defaults for this injector scope. Partial\n * overrides inherit unspecified keys from the parent scope (or library\n * defaults at the root).\n */\nexport function provideForComboboxDefaults(\n defaults: Partial<ForComboboxDefaults> = {},\n): Provider[] {\n return provideDefaults(defaults);\n}\n","import { type Signal } from '@angular/core';\n\nimport { foldSnapshotOnTotalCountTransition, tryReadHandle } from './combobox-snapshot-fold';\nimport type { ForComboboxOptionHandle } from './combobox-context';\n\n/**\n * Plain entry in the label cache / position-keyed map. Mirrors what inline\n * autocomplete and the chip / `selected` fallback paths need: a stable id, the\n * underlying value, and the resolved label string.\n */\nexport interface SnapshotEntry<T> {\n readonly id: string;\n readonly value: T;\n readonly label: string;\n}\n\n/**\n * Always-on label cache for `ForCombobox`. Keeps a flat list of\n * `{ id, value, label }` tuples that persists across listbox close / open\n * cycles, driving inline autocomplete and the `selected` label fallback.\n *\n * Persistence: when the consumer's `@if` unmounts the content\n * (`items().length === 0`) the prior cache is carried over so chips outside\n * the listbox area and inline completion after close keep resolving labels.\n * Resets only when the consumer's `totalCount` transitions — a query / source\n * rebuild signal in the virtualized case (the shared stale-window invariant\n * lives in `combobox-snapshot-fold.ts`).\n *\n * The option's `label` is itself a `Signal<string>` so we never peek at\n * `textContent`. Internal helper — not re-exported from `combobox/index.ts`\n * or `public-api.ts`. Constructed once per host directive, on every combobox\n * (virtualized or not).\n */\nexport class OptionLabelCache<T> {\n readonly #cachedOptions: Signal<readonly SnapshotEntry<T>[]>;\n\n constructor(deps: {\n readonly items: Signal<readonly ForComboboxOptionHandle<T>[]>;\n readonly totalCount: Signal<number | undefined>;\n }) {\n this.#cachedOptions = foldSnapshotOnTotalCountTransition<\n ForComboboxOptionHandle<T>,\n readonly SnapshotEntry<T>[]\n >(\n deps.items,\n deps.totalCount,\n () => [],\n (prev, items) => {\n if (items.length === 0) {\n return prev;\n }\n const merged = new Map<string, SnapshotEntry<T>>();\n for (const entry of prev) {\n merged.set(entry.id, entry);\n }\n for (const item of items) {\n // A static option (rendered outside `@for`) registers before its\n // `[value]` binding is written; skip it this fold and pick it up on\n // the re-run the binding triggers. See `tryReadHandle`.\n const entry = tryReadHandle(() => ({\n id: item.id(),\n value: item.value(),\n label: item.label(),\n }));\n if (entry === null) {\n continue;\n }\n merged.set(entry.id, entry);\n }\n return [...merged.values()];\n },\n );\n }\n\n /**\n * Pull the cache so its `linkedSignal` `prev` slot gets seeded while the\n * listbox is open. Called from the host's bridge effect — without an eager\n * pull the lazy cache never runs during the open cycle (no other consumer\n * pulls it in non-virtualized usage), and persistence across close → re-open\n * would start from an empty `prev`.\n */\n prime(): void {\n this.#cachedOptions();\n }\n\n /**\n * Snapshot of the registered options as plain `{ id, value, label }` tuples.\n * Drives inline-autocomplete matching and the label-resolution fallback in\n * `ForCombobox.selected`.\n */\n entries(): readonly SnapshotEntry<T>[] {\n return this.#cachedOptions();\n }\n\n /**\n * Live entries merged with any off-window entries from the virtualized\n * position-map, so typeahead and inline autocomplete can match against\n * options scrolled out of view. Live entries take precedence (freshest data)\n * and appear first, followed by off-window indexed entries sorted by absolute\n * position. Pass an empty / zero-size map (the non-virtualized case) to get\n * the live entries unchanged.\n */\n mergedEntries(indexed: ReadonlyMap<number, SnapshotEntry<T>>): readonly SnapshotEntry<T>[] {\n const live = this.#cachedOptions();\n if (indexed.size === 0) {\n return live;\n }\n const seen = new Set(live.map((o) => o.id));\n const merged: SnapshotEntry<T>[] = [...live];\n const positions = [...indexed.keys()].sort((a, b) => a - b);\n for (const pos of positions) {\n const entry = indexed.get(pos)!;\n if (seen.has(entry.id)) {\n continue;\n }\n merged.push({ id: entry.id, value: entry.value, label: entry.label });\n }\n return merged;\n }\n}\n","import { type Signal } from '@angular/core';\n\nimport { VirtualizedNavigator as VirtualizedNavigatorCore } from 'forty-cdk/core';\nimport { tryReadHandle } from './combobox-snapshot-fold';\nimport type { ForComboboxOptionHandle } from './combobox-context';\nimport type { SnapshotEntry } from './combobox-label-cache';\n\n/**\n * Position-keyed entry. Adds the `disabled` flag so virtualized navigation can\n * skip over off-window disabled options.\n */\nexport interface IndexedSnapshotEntry<T> extends SnapshotEntry<T> {\n readonly disabled: boolean;\n}\n\n/**\n * Dependencies for `VirtualizedNavigator`. Wires the helper to the host\n * directive's signal graph + a small set of imperative callbacks. The host is\n * the only owner of the activedescendant, so the helper reads / writes it\n * through accessors instead of holding its own copy.\n */\nexport interface VirtualizedNavigatorDeps<T> {\n /** Live registered options. Same signal the host exposes as `options`. */\n readonly items: Signal<readonly ForComboboxOptionHandle<T>[]>;\n /** Total option count for the virtualized path. Always defined here. */\n readonly totalCount: Signal<number | undefined>;\n /** Inclusive-exclusive range of currently rendered options when virtualizing. */\n readonly visibleRange: Signal<readonly [number, number] | undefined>;\n /** Whether keyboard navigation wraps at the ends. */\n readonly loop: Signal<boolean>;\n /** Read the host's current activedescendant id. */\n readonly getActiveId: () => string | null;\n /** Write the host's activedescendant id. */\n readonly setActiveId: (id: string | null) => void;\n /** Forward a `(scrollToIndex)` request to the consumer's virtualizer. */\n readonly emitScrollToIndex: (idx: number) => void;\n /**\n * Scroll the active option's host into view, opening the host's\n * pointer-suppression window first so the scroll cannot hijack the\n * activedescendant via a synthetic `pointermove`.\n */\n readonly scrollActiveIntoView: (host: HTMLElement) => void;\n}\n\n/**\n * Virtualization navigation engine for `ForCombobox`. A thin adapter over the\n * shared `_internal/virtualized-navigator` engine. Maps the combobox option\n * handle (whose `posInSet` is optional) onto the engine's accessors, reads the\n * option through the single NG0950 read guard, and overrides scroll-into-view\n * with the host's pointer-suppression wrapper. Adds the combobox-only\n * auto-highlight seed that stays passive (never scrolls the window).\n *\n * Internal — not re-exported from `combobox/index.ts` or `public-api.ts`.\n */\nexport class VirtualizedNavigator<T> {\n readonly #deps: VirtualizedNavigatorDeps<T>;\n\n readonly #core: VirtualizedNavigatorCore<ForComboboxOptionHandle<T>, IndexedSnapshotEntry<T>>;\n\n constructor(deps: VirtualizedNavigatorDeps<T>) {\n this.#deps = deps;\n this.#core = new VirtualizedNavigatorCore(\n { ...deps, loop: deps.loop },\n {\n posOf: (o) => o.posInSet?.() ?? null,\n idOf: (o) => o.id(),\n hostOf: (o) => o.host,\n readEntry: (o) =>\n tryReadHandle(() => ({\n id: o.id(),\n value: o.value(),\n label: o.label(),\n disabled: o.disabled(),\n })),\n scrollIntoView: (host) => deps.scrollActiveIntoView(host),\n },\n { deferFoldOnTotalTransition: true },\n );\n }\n\n /** @see VirtualizedNavigator.prime */\n prime(): void {\n this.#core.prime();\n }\n\n /**\n * Position-keyed snapshot for `ForCombobox.selected`'s scrolled-out-of-view\n * fallback and for the merged-label lookup. Read-only for callers.\n */\n snapshotByPos(): ReadonlyMap<number, IndexedSnapshotEntry<T>> {\n return this.#core.snapshotByPos();\n }\n\n /** @see VirtualizedNavigator.tryResolvePending */\n tryResolvePending(): boolean {\n return this.#core.tryResolvePending();\n }\n\n /**\n * Auto-highlight the first or last enabled option that is **currently\n * rendered**, ordered by absolute `posInSet`. Used in the virtualized branch\n * of the host's auto-highlight effect — for non-virtualized lists the host\n * walks the live `items()` array directly. No-op if `totalCount` is unset /\n * zero or nothing is rendered.\n *\n * Deliberately *passive*: it only ever moves `aria-activedescendant`, never\n * the consumer's scroll position. Auto-highlight re-runs every time the\n * activedescendant is cleared, and scrolling the active option out of the\n * rendered window clears it (see `ForCombobox.unregisterOption`). If this\n * seed emitted `(scrollToIndex)` toward the absolute first option, every\n * wheel tick that unmounted the active row would snap the listbox straight\n * back to the top. Off-window targets are reached only through explicit\n * keyboard navigation (`navigate`), which owns scroll-into-view.\n */\n seedFromIndexedSnapshot(direction: 'first' | 'last'): void {\n const total = this.#deps.totalCount();\n if (total === undefined || total <= 0) {\n return;\n }\n const items = this.#deps.items();\n if (items.length === 0) {\n return;\n }\n const ordered = [...items].sort((a, b) => {\n const pa = a.posInSet?.() ?? 0;\n const pb = b.posInSet?.() ?? 0;\n return direction === 'last' ? pb - pa : pa - pb;\n });\n for (const item of ordered) {\n if (!item.disabled()) {\n this.#deps.setActiveId(item.id());\n return;\n }\n }\n }\n\n /** @see VirtualizedNavigator.navigate */\n navigate(direction: 'next' | 'prev' | 'first' | 'last'): void {\n this.#core.navigate(direction);\n }\n\n /**\n * Drop any pending virtualized navigation. Called by `closeMenu` so a\n * pending request from the previous open cycle doesn't seed activedescendant\n * after the listbox re-opens.\n */\n resetPending(): void {\n this.#core.resetPending();\n }\n}\n","import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n model,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport type { ReferenceElement } from '@floating-ui/dom';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport {\n Collection,\n type FloatingAlign,\n type FloatingSide,\n FormUiControlBase,\n injectHiddenInput,\n adoptHostId,\n IdGenerator,\n type WritingDirection,\n nextEnabledHandle,\n createPointerSuppression,\n type PointerSuppression,\n defaultItemToFormValue,\n isInArray,\n singleSelected,\n toggleInArray,\n injectTextDirection,\n emitVetoableEvent,\n emitVetoableNativeEvent,\n type VetoableEvent,\n type VetoableNativeEvent,\n} from 'forty-cdk/core';\nimport { createActiveIdSignal, runAutoHighlightBridge } from './combobox-auto-highlight';\nimport {\n FOR_COMBOBOX_CONTEXT,\n type ForComboboxAutocomplete,\n type ForComboboxChipHandle,\n type ForComboboxCloseReason,\n type ForComboboxContext,\n type ForComboboxInitialFocus,\n type ForComboboxOptionHandle,\n} from './combobox-context';\nimport { FOR_COMBOBOX_DEFAULTS } from './combobox-defaults';\nimport { OptionLabelCache } from './combobox-label-cache';\nimport { VirtualizedNavigator } from './combobox-virtualized-navigator';\n\n/**\n * Headless implementation of the [WAI-ARIA combobox with listbox popup pattern](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/).\n * Implements `FormValueControl<readonly T[]>` from `@angular/forms/signals`\n * for `[formField]` auto-wiring.\n *\n * Generic over the option value type `T` (default `string`). When the\n * consumer binds object items the directive infers `T` from `[(value)]`\n * and per-piece signatures (`[forComboboxOption][value]`,\n * `[forComboboxChip][value]`) specialize accordingly. Object identity is\n * resolved by the consumer-supplied `[isItemEqualToValue]` and labels by\n * `[itemToStringLabel]`; the hidden inputs serialize via\n * `[itemToFormValue]` (defaults to `JSON.stringify` for non-strings).\n *\n * Selection is always modeled as `readonly T[]`:\n * - In single mode (`multiple=false`, default), the array has 0 or 1\n * element and option activation closes the listbox.\n * - In multi mode, option activation toggles in/out and the listbox stays\n * open. Selected entries are typically rendered as chips inside\n * `[forComboboxChips]` next to the input.\n *\n * The visible input (\"query\") and the form value are separate two-way\n * bindable models — the consumer keeps them in sync via filtering /\n * display logic, and the primitive only commits to `value` when an option\n * is explicitly activated.\n *\n * Filtering is **always** the consumer's responsibility — the primitive is\n * headless and doesn't filter the registered options. Render the filtered\n * subset with `@for` and the registry tracks them automatically.\n */\n@Directive({\n selector: '[forCombobox]',\n exportAs: 'forCombobox',\n host: {\n '[attr.data-state]': 'open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'effectiveDisabled() ? \"\" : null',\n '[attr.dir]': 'dir()',\n '(focusout)': 'onFocusOut($event)',\n },\n providers: [{ provide: FOR_COMBOBOX_CONTEXT, useExisting: ForCombobox }],\n})\nexport class ForCombobox<T = string>\n extends FormUiControlBase\n implements FormValueControl<readonly T[]>, ForComboboxContext<T>\n{\n readonly #idGen = inject(IdGenerator);\n readonly #defaults = inject(FOR_COMBOBOX_DEFAULTS);\n readonly #items = new Collection<ForComboboxOptionHandle<T>>();\n readonly #chips = new Collection<ForComboboxChipHandle<T>>();\n\n /**\n * Two-way bindable. Visible input text. The `model()` change emitter\n * (`(queryChange)`) fires only on internal mutations (option activation\n * commit, `clear()`, multi-mode select reset, picker-anatomy reset on\n * close), never on consumer writes via `[(query)]`.\n */\n readonly query = model<string>('');\n\n /**\n * Two-way bindable. Selected option values. Single mode (`multiple=false`)\n * keeps 0 or 1 element; multi mode keeps any number. The `model()` change\n * emitter (`(valueChange)`) fires only on internal selection changes,\n * never on consumer writes via `[(value)]`.\n */\n readonly value = model<readonly T[]>([]);\n\n /**\n * Compare two items for equality. Defaults to `===`, which is the\n * correct identity for primitive `T` (e.g. strings, numbers). Override\n * when binding object items so the directive can locate selected /\n * removed entries by id (or any other stable key) instead of by\n * reference: `[isItemEqualToValue]=\"(a, b) => a.id === b.id\"`.\n */\n readonly isItemEqualToValue = input<(a: T, b: T) => boolean>((a, b) => a === b);\n\n /**\n * Render an item as a string label. Defaults to `String(item)`, which is\n * identity for strings. Drives the visible input text after activation\n * (when `commitOnSelect`) and the chip label fallback in multi mode.\n * Override when binding object items so the directive can fall back to\n * a meaningful label without relying on the option cache being warm:\n * `[itemToStringLabel]=\"(it) => it.name\"`.\n */\n readonly itemToStringLabel = input<(item: T) => string>((item) => String(item));\n\n /**\n * Serialize an item for the hidden input that participates in native\n * form submission. Defaults to identity for strings and to\n * `JSON.stringify` for non-string items so the primitive works out of\n * the box round-tripping objects. Override to emit a specific wire\n * format — typically a per-item id — when the backend expects that:\n * `[itemToFormValue]=\"(it) => it.id\"`.\n */\n readonly itemToFormValue = input<(item: T) => string>(defaultItemToFormValue);\n\n /**\n * Two-way bindable. Whether the listbox is currently shown. Internal\n * transitions: input typing (when `openOnQuery`), focus (when\n * `openOnFocus`), ArrowDown / ArrowUp, Escape, outside dismissal,\n * single-mode option activation.\n */\n readonly open = model<boolean>(false);\n\n readonly multiple = input(false, { transform: booleanAttribute });\n\n /**\n * Autocomplete mode applied to the input. Mirrors the\n * [WAI-ARIA `aria-autocomplete` property](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/#wai-ariaroles,states,andproperties)\n * and drives whether the listbox auto-opens on query and whether the\n * input gets inline-completed with the first match. Renamed from\n * `autocomplete` so consumers don't conflate it with the native HTML\n * `autocomplete` attribute (which the directive forces to `\"off\"`).\n */\n readonly autocompleteMode = input<ForComboboxAutocomplete>('list');\n\n /** Open the listbox when the input gains focus. Off by default — opening on query / arrow keys is the standard ecosystem behavior. */\n readonly openOnFocus = input(false, { transform: booleanAttribute });\n\n /** Open the listbox when the user starts typing. On by default. Only honored when `autocompleteMode` includes a listbox (`'list'` or `'both'`). */\n readonly openOnQuery = input(true, { transform: booleanAttribute });\n\n /**\n * In single mode, copy the activated option's label into `query`. In\n * multi mode, instead **clear** the query so the user can search the\n * next item. On by default in both. Set `false` to leave `query`\n * untouched on activation in either mode.\n *\n * Governs the **editable anatomy** only. In the picker anatomy (a\n * `[forComboboxTrigger]` is registered) the in-panel input is a transient\n * filter, not the value display: the single-mode label copy is always\n * skipped and `query` resets to `''` on close regardless of this flag.\n */\n readonly commitOnSelect = input(true, { transform: booleanAttribute });\n\n /** When the user edits the query, automatically clear the committed `value`. Off by default — most apps want the value preserved across query edits. Single-mode only. */\n readonly clearOnQueryChange = input(false, { transform: booleanAttribute });\n\n /**\n * Auto-highlight the first enabled option whenever the listbox is open\n * and no activedescendant is set (e.g. after the consumer's filter\n * removed the previously-active option). On by default. Set `false` for\n * \"user must arrow before anything is highlighted\" behavior.\n */\n readonly autoHighlight = input(true, { transform: booleanAttribute });\n\n /**\n * Writing direction. Drives chip-cluster keyboard navigation (ArrowLeft /\n * ArrowRight semantics swap in RTL so they follow the visual order, not DOM\n * order) and the default `align` of the listbox (anchors to the right edge\n * of the input in RTL). When unset (default `null`), the inherited ambient\n * direction is resolved from the nearest ancestor carrying a `dir` attribute\n * (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins\n * and the resolved value is reflected to the host `dir` attribute.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n\n /**\n * Side the listbox is anchored to. Defaults to `'bottom'`. Pair with\n * `align` for the full positioning API.\n */\n readonly side = input<FloatingSide | undefined>('bottom');\n\n /**\n * Alignment along the chosen `side`. When unset, defaults to `'start'`\n * in LTR and `'end'` in RTL (per `dir`). Set explicitly to pin an\n * alignment regardless of writing direction.\n *\n * The input is aliased to `align`; consumers bind `[align]=\"...\"` and\n * read the effective value via the public `align` computed below.\n */\n readonly _alignInput = input<FloatingAlign | undefined>(undefined, { alias: 'align' });\n readonly align = computed<FloatingAlign>(\n () => this._alignInput() ?? (this.dir() === 'rtl' ? 'end' : 'start'),\n );\n\n /** Gap (px) between input and listbox along the main axis. Default `4`. */\n readonly sideOffset = input(this.#defaults.sideOffset, { transform: numberAttribute });\n\n /** Gap (px) along the cross axis. Default `0`. */\n readonly alignOffset = input(0, { transform: numberAttribute });\n\n /** When `true` (default), `flip` and `shift` keep the listbox inside the viewport. */\n readonly avoidCollisions = input(true, { transform: booleanAttribute });\n\n /** Padding (px) applied uniformly to flip / shift / size. Default `8`. */\n readonly collisionPadding = input(this.#defaults.collisionPadding, {\n transform: numberAttribute,\n });\n\n /** Padding (px) for the `arrow` middleware. Default `0`. */\n readonly arrowPadding = input(0, { transform: numberAttribute });\n\n /** Stickiness behaviour for `shift`. Default `'partial'`. */\n readonly sticky = input<'partial' | 'always' | false>('partial');\n\n /** When `true`, sets `data-detached=\"\"` while the input is scrolled off-screen. */\n readonly hideWhenDetached = input(false, { transform: booleanAttribute });\n\n /**\n * When `true` (default), the content is clipped until floating-ui resolves\n * its first position, preventing a flash at the viewport corner. Set to\n * `false` so a dramatic `animate.enter` plays from its first frame (the\n * surface may flash briefly at the unresolved position while positioning\n * computes).\n */\n readonly clipUntilPositioned = input(true, { transform: booleanAttribute });\n readonly loop = input(true, { transform: booleanAttribute });\n\n /** When true (default), Escape, pointer-down outside, and focus outside close the listbox. */\n readonly dismissible = input(true, { transform: booleanAttribute });\n\n /**\n * When true (default), focus returns to the `[forComboboxTrigger]` on close.\n * Only relevant in the picker anatomy (a trigger is registered) — in the\n * editable anatomy focus never leaves the input, so there is nothing to\n * return.\n */\n readonly returnFocus = input(true, { transform: booleanAttribute });\n\n /** Manual `aria-label` on the listbox (`[forComboboxList]`, or `[forComboboxContent]` in the editable anatomy) when the input isn't a meaningful name. */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * Total number of options in the consumer's source array. Set when wiring\n * up a virtualized listbox (only the visible window is rendered) so the\n * directive can reflect `aria-setsize` and walk the snapshot for\n * navigation past the rendered range. Defaults to `undefined`, in which\n * case the directive falls back to `options().length` (the live registry).\n */\n readonly totalCount = input(undefined, {\n transform: (v: unknown): number | undefined => (v == null ? undefined : numberAttribute(v)),\n });\n\n /**\n * Inclusive-exclusive `[start, end)` range of options currently rendered\n * in the DOM. Used by `navigate()` to translate \"move to absolute\n * position N\" into either an in-window highlight update or a request to\n * the consumer to scroll N into view (`(scrollToIndex)`). When\n * `undefined` (default), navigation assumes every option in the snapshot\n * is rendered — appropriate for non-virtualized lists.\n */\n readonly visibleRange = input<readonly [number, number] | undefined>(undefined);\n\n /**\n * Emitted when keyboard navigation needs to land on an option whose\n * absolute index falls outside `visibleRange()`. Wire this to the\n * consumer's virtualizer (`scrollToIndex(idx)` on `@tanstack/virtual`,\n * `virtua`, etc.); once the option mounts, the directive seeds\n * `aria-activedescendant` automatically.\n */\n readonly scrollToIndex = output<number>();\n\n readonly escapeKeyDown = output<VetoableNativeEvent<KeyboardEvent>>();\n readonly pointerDownOutside = output<VetoableNativeEvent<PointerEvent>>();\n readonly focusOutside = output<VetoableNativeEvent<FocusEvent>>();\n readonly interactOutside = output<VetoableNativeEvent<PointerEvent | FocusEvent>>();\n\n /**\n * _(picker anatomy only)_ Fires just before focus moves into the input on\n * open. Call `preventDefault()` on the emitted veto to skip the imperative\n * focus move. Only emitted when a `[forComboboxTrigger]` is registered — the\n * editable anatomy keeps focus in the input the whole time and has no move to\n * veto.\n */\n readonly autoFocusOnOpen = output<VetoableEvent>();\n\n /**\n * _(picker anatomy only)_ Fires just before focus returns to the trigger on\n * close. Call `preventDefault()` on the veto to suppress the return-focus.\n */\n readonly autoFocusOnClose = output<VetoableEvent>();\n\n readonly inputId = signal(this.#idGen.next('for-combobox-input'));\n readonly contentId = signal(this.#idGen.next('for-combobox-content'));\n readonly listId = signal(this.#idGen.next('for-combobox-list'));\n\n readonly #inputEl = signal<HTMLInputElement | null>(null);\n readonly input = this.#inputEl.asReadonly();\n\n readonly #anchorEl = signal<HTMLElement | null>(null);\n readonly #triggerEl = signal<HTMLElement | null>(null);\n readonly trigger = this.#triggerEl.asReadonly();\n\n /**\n * Element floating-ui anchors the listbox against. Resolution order:\n * explicit `[forComboboxAnchor]` → `[forComboboxTrigger]` (picker anatomy) →\n * the input (editable anatomy fallback, so existing comboboxes keep their\n * behavior). Decoupled from `input` so the input keeps driving\n * `aria-controls`, `aria-activedescendant`, keyboard interaction, and its\n * dismissal exemption regardless of where the listbox paints.\n */\n readonly anchor = computed<ReferenceElement | null>(\n () => this.#anchorEl() ?? this.#triggerEl() ?? this.#inputEl(),\n );\n\n readonly #contentEl = signal<HTMLElement | null>(null);\n readonly content = this.#contentEl.asReadonly();\n\n readonly #listEl = signal<HTMLElement | null>(null);\n readonly list = this.#listEl.asReadonly();\n /** True once a `[forComboboxList]` has registered (picker anatomy). */\n readonly hasList = computed(() => this.#listEl() !== null);\n /**\n * Id of the element carrying `role=\"listbox\"`: the list when one is\n * registered (picker anatomy), otherwise the content surface (editable\n * anatomy). The input targets this with `aria-controls`.\n */\n readonly listboxId = computed(() => (this.hasList() ? this.listId() : this.contentId()));\n\n readonly options = this.#items.items;\n readonly chips = this.#chips.items;\n\n readonly #initialFocus = signal<ForComboboxInitialFocus>('first');\n readonly initialFocus = this.#initialFocus.asReadonly();\n\n readonly #lastCloseReason = signal<ForComboboxCloseReason | null>(null);\n readonly lastCloseReason = this.#lastCloseReason.asReadonly();\n\n /**\n * The activedescendant pointer. Built by {@link createActiveIdSignal} as a\n * `linkedSignal` so the highlight decision is a pure derivation, never a write\n * from an `effect`; it stays writable for the imperative moves that own their\n * own scroll (arrow / Home / End navigation, hover, multi-mode activation, and\n * the virtualized pending-nav resolution). The reset/seed rule lives with the\n * factory in `combobox-auto-highlight.ts`.\n */\n readonly #activeId = createActiveIdSignal<T>({\n query: this.query,\n open: this.open,\n autoHighlight: this.autoHighlight,\n virtualized: () => this.totalCount() !== undefined,\n initialFocus: this.#initialFocus,\n items: this.#items.items,\n value: this.value,\n equals: this.isItemEqualToValue,\n });\n readonly activeId = this.#activeId.asReadonly();\n\n #lastPositionedId: string | null = null;\n\n readonly #pointerSuppression: PointerSuppression = createPointerSuppression();\n\n /**\n * Always-on label cache — keeps `{ id, value, label }` tuples across\n * close/open and scroll-out-of-view to drive inline autocomplete matching\n * and the `selected` label fallback. See `combobox-label-cache.ts`.\n */\n readonly #labelCache = new OptionLabelCache<T>({\n items: this.#items.items,\n totalCount: this.totalCount,\n });\n\n /**\n * Virtualization navigation engine — constructed lazily the first time the\n * consumer sets `totalCount()`, so a non-virtualized combobox never pulls\n * the position-map machinery. Powers keyboard navigation past the rendered\n * window and the scrolled-out-of-view label fallback.\n */\n #navigator: VirtualizedNavigator<T> | null = null;\n\n #requireNavigator(): VirtualizedNavigator<T> {\n return (this.#navigator ??= new VirtualizedNavigator<T>({\n items: this.#items.items,\n totalCount: this.totalCount,\n visibleRange: this.visibleRange,\n loop: this.loop,\n getActiveId: () => this.#activeId(),\n setActiveId: (id) => this.#activeId.set(id),\n emitScrollToIndex: (idx) => this.scrollToIndex.emit(idx),\n scrollActiveIntoView: (host) => this.#scrollActiveIntoView(host),\n }));\n }\n\n readonly selected = computed<readonly { value: T; label: string }[]>(() => {\n const values = this.value();\n if (values.length === 0) {\n return [];\n }\n // `cachedOptions()` already merges off-window entries from the indexed\n // snapshot when virtualizing, so a selected option scrolled out of view\n // still resolves here without a separate position-map lookup.\n const cached = this.cachedOptions();\n const equals = this.isItemEqualToValue();\n const toLabel = this.itemToStringLabel();\n return values.map((v) => {\n const opt = cached.find((o) => equals(o.value, v));\n if (opt) {\n return { value: v, label: opt.label };\n }\n // Fall back to the consumer-provided label fn so non-string items\n // still render a meaningful string before the option cache warms up.\n return { value: v, label: typeof v === 'string' ? (v as string) : toLabel(v) };\n });\n });\n\n /**\n * Read-only single-select convenience view of {@link value}. Returns the\n * sole selected item when exactly one is selected, otherwise `null` (empty\n * selection, or multiple selections in `multiple` mode). Lets single-select\n * consumers read `selectedItem()` instead of unwrapping `value()[0]`. The\n * array-backed `value` model remains the source of truth and the\n * `FormValueControl` contract; this is a derived accessor. Distinct from\n * {@link selected}, which pairs every selected value with its resolved\n * label for chip rendering.\n */\n readonly selectedItem = singleSelected(this.value);\n\n protected override fieldLabelledElement(): HTMLElement | null {\n return this.input();\n }\n\n protected override fieldLabelledElementId(): string {\n return this.inputId();\n }\n\n constructor() {\n super();\n injectHiddenInput<T>({\n name: this.name,\n values: this.value,\n serialize: (item) => this.itemToFormValue()(item),\n disabled: this.effectiveDisabled,\n });\n\n // The activedescendant *decision* is a pure derivation in `#activeId`; this\n // effect runs only its imperative tail (label-cache priming, virtualized\n // pending-nav resolution + passive seed, non-virtualized scroll-into-view).\n // Full rationale lives with `runAutoHighlightBridge` in\n // `combobox-auto-highlight.ts`.\n effect(() => {\n runAutoHighlightBridge<T>({\n labelCache: this.#labelCache,\n requireNavigator: () => this.#requireNavigator(),\n items: this.#items.items,\n open: this.open,\n autoHighlight: this.autoHighlight,\n virtualized: () => this.totalCount() !== undefined,\n initialFocus: this.#initialFocus,\n getActiveId: () => this.#activeId(),\n getLastPositionedId: () => this.#lastPositionedId,\n setLastPositionedId: (id) => (this.#lastPositionedId = id),\n });\n });\n }\n\n registerInput(el: HTMLInputElement): void {\n adoptHostId(el, this.inputId);\n this.#inputEl.set(el);\n }\n unregisterInput(el: HTMLInputElement): void {\n if (this.#inputEl() === el) {\n this.#inputEl.set(null);\n }\n }\n\n registerAnchor(el: HTMLElement): void {\n const current = this.#anchorEl();\n if (current !== null && current !== el) {\n throw new Error(\n '[forty-cdk/combobox] Multiple [forComboboxAnchor] inside the same [forCombobox]; only one is allowed.',\n );\n }\n this.#anchorEl.set(el);\n }\n unregisterAnchor(el: HTMLElement): void {\n if (this.#anchorEl() === el) {\n this.#anchorEl.set(null);\n }\n }\n\n registerTrigger(el: HTMLElement): void {\n this.#triggerEl.set(el);\n }\n unregisterTrigger(el: HTMLElement): void {\n if (this.#triggerEl() === el) {\n this.#triggerEl.set(null);\n }\n }\n\n registerContent(el: HTMLElement): void {\n adoptHostId(el, this.contentId);\n this.#contentEl.set(el);\n }\n unregisterContent(el: HTMLElement): void {\n if (this.#contentEl() === el) {\n this.#contentEl.set(null);\n }\n }\n\n registerList(el: HTMLElement): void {\n adoptHostId(el, this.listId);\n this.#listEl.set(el);\n }\n unregisterList(el: HTMLElement): void {\n if (this.#listEl() === el) {\n this.#listEl.set(null);\n }\n }\n\n registerOption(handle: ForComboboxOptionHandle<T>): void {\n this.#items.register(handle);\n }\n unregisterOption(handle: ForComboboxOptionHandle<T>): void {\n this.#items.unregister(handle);\n if (this.#activeId() === handle.id()) {\n this.#activeId.set(null);\n }\n }\n\n registerChip(handle: ForComboboxChipHandle<T>): void {\n this.#chips.register(handle);\n }\n unregisterChip(handle: ForComboboxChipHandle<T>): void {\n this.#chips.unregister(handle);\n }\n\n isSelected(v: T): boolean {\n return isInArray(this.value(), v, this.isItemEqualToValue());\n }\n\n isActive(id: string): boolean {\n return this.#activeId() === id;\n }\n\n isPointerSuppressed(): boolean {\n return this.#pointerSuppression.isSuppressed();\n }\n\n activate(handle: ForComboboxOptionHandle<T>): void {\n if (this.effectiveDisabled() || this.readonly() || handle.disabled()) {\n return;\n }\n const v = handle.value();\n if (this.multiple()) {\n // Toggle in/out of the array. Stay open so the user can keep picking.\n this.value.set(toggleInArray(this.value(), v, this.isItemEqualToValue()));\n if (this.commitOnSelect()) {\n // Reset query so the next typed prefix searches afresh.\n this.query.set('');\n this.#syncInputValue('');\n }\n this.#activeId.set(handle.id());\n return;\n }\n // Single mode: replace + close + commit label.\n this.value.set([v]);\n if (this.commitOnSelect() && this.trigger() === null) {\n this.query.set(handle.label());\n this.#syncInputValue(handle.label());\n }\n this.closeMenu('select');\n }\n\n /**\n * Imperatively align the visible `<input>` text with `query()` even\n * while the input has focus. The directive's reactive sync skips\n * focused syncs to avoid clobbering inline-autocomplete selection\n * during typing — but activation / clear writes happen *outside* the\n * typing flow and should be visible immediately.\n */\n #syncInputValue(value: string): void {\n const el = this.#inputEl();\n if (el && el.value !== value) {\n el.value = value;\n }\n }\n\n removeValue(v: T): void {\n if (this.effectiveDisabled() || this.readonly()) {\n return;\n }\n const equals = this.isItemEqualToValue();\n const current = this.value();\n if (!current.some((x) => equals(x, v))) {\n return;\n }\n this.value.set(current.filter((x) => !equals(x, v)));\n }\n\n activateActive(): boolean {\n const id = this.#activeId();\n if (!id) {\n return false;\n }\n const handle = this.#items.items().find((o) => o.id() === id);\n if (!handle || handle.disabled()) {\n return false;\n }\n this.activate(handle);\n return true;\n }\n\n navigate(direction: 'next' | 'prev' | 'first' | 'last'): void {\n if (this.effectiveDisabled()) {\n return;\n }\n if (this.totalCount() !== undefined) {\n this.#requireNavigator().navigate(direction);\n return;\n }\n const items = this.#items.items();\n if (items.length === 0) {\n return;\n }\n const currentId = this.#activeId();\n const currentIndex = currentId === null ? -1 : items.findIndex((o) => o.id() === currentId);\n\n // No activedescendant yet + arrow nav: jump to the natural extreme\n // (ArrowDown → first enabled, ArrowUp → last enabled).\n let action = direction;\n if (currentIndex < 0 && direction === 'next') {\n action = 'first';\n } else if (currentIndex < 0 && direction === 'prev') {\n action = 'last';\n }\n\n const target = nextEnabledHandle(items, currentIndex, action, { loop: this.loop() });\n if (target === null) {\n return;\n }\n this.#activeId.set(target.id());\n this.#scrollActiveIntoView(target.host);\n this.#lastPositionedId = target.id();\n }\n\n setQueryFromInput(query: string): void {\n if (this.effectiveDisabled() || this.readonly()) {\n return;\n }\n this.query.set(query);\n if (this.clearOnQueryChange() && !this.multiple() && this.value().length > 0) {\n this.value.set([]);\n }\n const mode = this.autocompleteMode();\n const hasListbox = mode === 'list' || mode === 'both';\n if (this.openOnQuery() && hasListbox && query.length > 0 && !this.open()) {\n this.openMenu();\n }\n }\n\n setActiveId(id: string | null): void {\n this.#activeId.set(id);\n this.#lastPositionedId = id;\n }\n\n #scrollActiveIntoView(host: HTMLElement): void {\n this.#pointerSuppression.suppress();\n host.scrollIntoView?.({ block: 'nearest' });\n }\n\n readonly #cachedOptionsMemo = computed<readonly { id: string; value: T; label: string }[]>(() => {\n if (this.totalCount() === undefined) {\n return this.#labelCache.entries();\n }\n return this.#labelCache.mergedEntries(this.#requireNavigator().snapshotByPos());\n });\n\n cachedOptions(): readonly { id: string; value: T; label: string }[] {\n return this.#cachedOptionsMemo();\n }\n\n clear(clearQuery: boolean = true): void {\n if (this.effectiveDisabled() || this.readonly()) {\n return;\n }\n this.value.set([]);\n if (clearQuery) {\n this.query.set('');\n this.#syncInputValue('');\n }\n this.#activeId.set(null);\n }\n\n setInitialFocus(target: ForComboboxInitialFocus): void {\n this.#initialFocus.set(target);\n }\n\n toggle(): void {\n if (this.effectiveDisabled()) {\n return;\n }\n if (this.open()) {\n this.closeMenu('programmatic');\n } else {\n this.openMenu(this.trigger() !== null ? 'selected' : 'first');\n }\n }\n\n openMenu(initialFocus: ForComboboxInitialFocus = 'first'): void {\n if (this.effectiveDisabled() || this.open()) {\n return;\n }\n this.#initialFocus.set(initialFocus);\n this.#lastCloseReason.set(null);\n this.open.set(true);\n }\n\n closeMenu(reason: ForComboboxCloseReason): void {\n if (!this.open()) {\n return;\n }\n this.#lastCloseReason.set(reason);\n this.open.set(false);\n this.#activeId.set(null);\n this.#navigator?.resetPending();\n if (this.trigger() !== null) {\n this.query.set('');\n this.#syncInputValue('');\n }\n }\n\n /** Fire `(autoFocusOnOpen)` and report whether the consumer vetoed the focus move. */\n emitAutoFocusOnOpen(): boolean {\n return emitVetoableEvent(this.autoFocusOnOpen);\n }\n\n /** Fire `(autoFocusOnClose)` and report whether the consumer vetoed the return-focus. */\n emitAutoFocusOnClose(): boolean {\n return emitVetoableEvent(this.autoFocusOnClose);\n }\n\n emitEscapeKeyDown(event: KeyboardEvent): void {\n const vetoed = emitVetoableNativeEvent(this.escapeKeyDown, event);\n if (!vetoed && this.dismissible()) {\n event.stopPropagation();\n this.closeMenu('escape');\n }\n }\n\n /**\n * Outside-interaction emit forwarders. The shared `#pendingOutsideVeto`\n * reuse between the specific outside channels and the composite\n * `interactOutside` lives in `injectOverlayShell`; these only fire the\n * matching output with the veto the shell built.\n */\n emitPointerDownOutside(veto: VetoableNativeEvent<PointerEvent>): void {\n this.pointerDownOutside.emit(veto);\n }\n emitFocusOutside(veto: VetoableNativeEvent<FocusEvent>): void {\n this.focusOutside.emit(veto);\n }\n emitInteractOutside(veto: VetoableNativeEvent<PointerEvent | FocusEvent>): void {\n this.interactOutside.emit(veto);\n }\n\n /**\n * Implicit close requested by the shell after an un-vetoed outside\n * interaction. Marks the control touched and closes with the channel's\n * reason.\n */\n requestClose(reason: 'pointerDownOutside' | 'focusOutside'): void {\n this.markTouched();\n this.closeMenu(reason);\n }\n\n override markTouched(): void {\n super.markTouched();\n }\n\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as HTMLElement | null;\n const inputEl = this.#inputEl();\n const content = this.#contentEl();\n if (next) {\n if (inputEl && inputEl.contains(next)) {\n return;\n }\n if (content && content.contains(next)) {\n return;\n }\n // Focus moving to a chip (multi mode) is \"inside\" — chips are an\n // extension of the input area, not an outside boundary.\n const chips = this.#chips.items();\n for (const chip of chips) {\n if (chip.host.contains(next)) {\n return;\n }\n }\n }\n this.markTouched();\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Optional positioning anchor. When present, `[forComboboxContent]` is\n * positioned against this element instead of `[forComboboxInput]` — useful\n * when the input lives inside a decorated field box (padding, prefix icon,\n * clear button, chip cluster) and the listbox should match the visible field\n * rather than the inner `<input>`.\n *\n * Only positioning changes: the input still owns `aria-controls`,\n * `aria-expanded`, `aria-activedescendant`, keyboard interaction, and its\n * exemption from outside-pointer dismissal. If no anchor is registered the\n * listbox falls back to anchoring against the input, so existing usages are\n * unaffected.\n *\n * At most one `[forComboboxAnchor]` may be registered per `[forCombobox]`; a\n * second one throws.\n *\n * ```html\n * <div forCombobox [(value)]=\"v\" [(query)]=\"q\">\n * <div forComboboxAnchor class=\"field-box\">\n * <icon />\n * <input forComboboxInput />\n * <button class=\"clear\">×</button>\n * </div>\n * @if (open()) {\n * <div forComboboxContent>…</div>\n * }\n * </div>\n * ```\n */\n@Directive({\n selector: '[forComboboxAnchor]',\n exportAs: 'forComboboxAnchor',\n})\nexport class ForComboboxAnchor {\n readonly #ctx = injectComboboxContext('ForComboboxAnchor');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n registerHandle(\n this.#host.nativeElement,\n (el) => this.#ctx.registerAnchor(el),\n (el) => this.#ctx.unregisterAnchor(el),\n );\n }\n}\n","import { computed, Directive, effect, ElementRef, inject, input } from '@angular/core';\n\nimport { reflectDisabled } from 'forty-cdk/core';\nimport { type ForComboboxContext, injectComboboxTriggerContext } from './combobox-context';\n\n/**\n * Button that opens the listbox and keeps showing the committed selection\n * (label + icon) while the search input lives **inside** the panel — the\n * \"combobox with trigger\" / picker anatomy. Apply on\n * a real `<button>` so Space / Enter dispatch native click events that toggle\n * via `(click)`.\n *\n * Registering a trigger switches the combobox into the picker anatomy: it\n * becomes the default positioning anchor (after an explicit\n * `[forComboboxAnchor]`), focus moves into `[forComboboxInput]` on open and\n * returns to the trigger on close (the standard `(autoFocusOnOpen)` /\n * `(autoFocusOnClose)` vetoable hooks now fire), and `[forComboboxContent]`\n * expects an inner `[forComboboxList]` to carry the listbox role.\n *\n * Wires `aria-haspopup=\"listbox\"`, `aria-expanded`, and `aria-controls`\n * (pointing to the popup surface while open). Native `disabled` reflects\n * `effectiveDisabled` (single-purpose trigger). The trigger is exempt from the\n * popup's dismissable layer — clicks on it route through `(click)` instead of\n * racing an outside-pointer dismissal.\n *\n * The root is normally resolved via DI from the enclosing `[forCombobox]`.\n * When the trigger is declared inside an `ng-template` stamped into the root\n * (e.g. via `ngTemplateOutlet`), DI resolves at the template's declaration\n * site and misses the root — pass it explicitly through the selector input,\n * `routerLink`-style: `[forComboboxTrigger]=\"root\"` with `#root=\"forCombobox\"`.\n *\n * Keyboard:\n * - **Click / Enter / Space** — toggle (open moves focus into the input).\n * - **ArrowDown** — open with the first enabled option highlighted.\n * - **ArrowUp** — open with the last enabled option highlighted.\n */\n@Directive({\n selector: '[forComboboxTrigger]',\n exportAs: 'forComboboxTrigger',\n host: {\n type: 'button',\n '[attr.aria-haspopup]': '\"listbox\"',\n '[attr.aria-expanded]': 'ctx().open() ? \"true\" : \"false\"',\n '[attr.aria-controls]': 'ctx().open() ? ctx().contentId() : null',\n '[attr.data-state]': 'ctx().open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'ctx().effectiveDisabled() ? \"\" : null',\n '(click)': 'onClick()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForComboboxTrigger<T = unknown> {\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Optional explicit reference to the `[forCombobox]` root, named after the\n * selector `routerLink`-style. The bare valueless attribute keeps resolving\n * the enclosing root via DI; pass the root explicitly\n * (`[forComboboxTrigger]=\"root\"`, with `#root=\"forCombobox\"`) when the\n * trigger is declared in an `ng-template` stamped inside the root — DI\n * resolves at the template's declaration site, so the enclosing root is\n * invisible there. The empty string (what the valueless attribute yields) is\n * treated as unset.\n */\n readonly forComboboxTrigger = input<ForComboboxContext<T> | ''>('');\n\n protected readonly ctx = injectComboboxTriggerContext<T>(this.forComboboxTrigger);\n\n constructor() {\n const el = this.#host.nativeElement;\n // Registration is an imperative call into the resolved root's registry,\n // not state derivation — the effect only re-registers the element when the\n // resolved root changes (explicit reference swapped at runtime).\n effect((onCleanup) => {\n const ctx = this.ctx();\n ctx.registerTrigger(el);\n onCleanup(() => ctx.unregisterTrigger(el));\n });\n reflectDisabled(computed(() => this.ctx().effectiveDisabled()));\n }\n\n protected onClick(): void {\n this.ctx().toggle();\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.ctx().effectiveDisabled()) {\n return;\n }\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.ctx().openMenu('first');\n return;\n }\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.ctx().openMenu('last');\n }\n }\n}\n","import { computed, Directive, DOCUMENT, effect, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle, reflectDisabled } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * The combobox `<input role=\"combobox\">`. Owns the visible text and all\n * keyboard interaction. Apply on a real `<input>` so the browser's native\n * caret / selection semantics drive inline-autocomplete and so the form\n * still behaves like a text field for screen readers.\n *\n * Wires `aria-haspopup=\"listbox\"`, `aria-expanded`, `aria-controls`,\n * `aria-autocomplete`, and `aria-activedescendant` (per APG combobox).\n * Focus stays on the input — arrow keys move the listbox's *active\n * descendant* via id reference, never moving DOM focus into the listbox.\n *\n * Keyboard:\n * - **ArrowDown / ArrowUp** — open + move activedescendant.\n * - **Home / End** (when open) — first / last enabled option.\n * - **PageUp / PageDown** (when open) — first / last enabled option.\n * - **Enter** (when open) — activate the activedescendant; no-op otherwise.\n * - **Escape** (when open) — close (focus stays in input). On the\n * open→closed transition the input value is re-synced to `query()` even\n * while focused, so a consumer restoring the committed label from an\n * `(openChange)` handler renders without reaching for the DOM.\n * - **Tab** (when open) — close and let Tab flow to the next focusable.\n * - Printable keys: update `query` and (if `autocompleteMode` includes `'inline'`)\n * complete the rest of the first match in the input as selected text.\n */\n@Directive({\n selector: '[forComboboxInput]',\n exportAs: 'forComboboxInput',\n host: {\n type: 'text',\n role: 'combobox',\n autocomplete: 'off',\n autocorrect: 'off',\n spellcheck: 'false',\n '[id]': 'ctx.inputId()',\n '[attr.aria-haspopup]': '\"listbox\"',\n '[attr.aria-expanded]': 'ctx.open() ? \"true\" : \"false\"',\n '[attr.aria-controls]': 'ctx.open() ? ctx.listboxId() : null',\n '[attr.aria-autocomplete]': 'ariaAutocomplete()',\n '[attr.aria-activedescendant]': 'ctx.open() ? (ctx.activeId() ?? null) : null',\n '[attr.aria-disabled]': 'ctx.effectiveDisabled() ? \"true\" : null',\n '[attr.aria-readonly]': 'ctx.readonly() ? \"true\" : null',\n '[attr.aria-required]': 'ctx.required() ? \"true\" : null',\n '[attr.aria-invalid]': 'ctx.invalid() ? \"true\" : null',\n '[attr.aria-busy]': 'ctx.pending() ? \"true\" : null',\n '[attr.readonly]': 'ctx.readonly() ? \"\" : null',\n '[attr.data-state]': 'ctx.open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'ctx.effectiveDisabled() ? \"\" : null',\n '(input)': 'onInput($event)',\n '(compositionstart)': 'onCompositionStart()',\n '(compositionend)': 'onCompositionEnd()',\n '(keydown)': 'onKeyDown($event)',\n '(focus)': 'onFocus()',\n '(click)': 'onClick()',\n },\n})\nexport class ForComboboxInput {\n // The input doesn't introspect the value type — it reads/writes the\n // query string and reads cached labels for inline autocomplete.\n protected readonly ctx = injectComboboxContext<unknown>('ForComboboxInput');\n readonly #host = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n #composing = false;\n\n protected readonly ariaAutocomplete = computed(() => this.ctx.autocompleteMode());\n\n constructor() {\n registerHandle(\n this.#host.nativeElement,\n (el) => this.ctx.registerInput(el),\n (el) => this.ctx.unregisterInput(el),\n );\n reflectDisabled(this.ctx.effectiveDisabled);\n\n const doc = inject(DOCUMENT);\n\n // Sync DOM input.value to query() when the input doesn't currently have\n // focus (e.g. consumer set [(query)] programmatically, or option\n // activation copied the label into query via commitOnSelect). When the\n // input is focused the user is mid-edit; clobbering input.value would\n // jump the caret and break inline autocomplete state.\n //\n // The open→closed transition is the documented exception: the edit\n // session is over (Escape closes but keeps focus in the input, per APG),\n // so a consumer restoring the committed label — `query.set(label)` from an\n // `(openChange)` handler — must reach the DOM even while focused. The\n // caret-protection rationale no longer applies and a caret jump to the end\n // of the restored text is the expected outcome. `wasOpen` tracks the prior\n // open state to detect the edge; it's a plain transition latch, not derived\n // signal state.\n let wasOpen = this.ctx.open();\n effect(() => {\n const q = this.ctx.query();\n const closing = wasOpen && !this.ctx.open();\n wasOpen = this.ctx.open();\n\n const el = this.#host.nativeElement;\n if (el.value === q) {\n return;\n }\n if (doc.activeElement !== el || closing) {\n el.value = q;\n }\n });\n }\n\n protected onCompositionStart(): void {\n this.#composing = true;\n }\n\n protected onCompositionEnd(): void {\n this.#composing = false;\n if (this.ctx.effectiveDisabled() || this.ctx.readonly()) {\n return;\n }\n this.#syncQuery(true, false);\n }\n\n protected onInput(event: Event): void {\n if (this.ctx.effectiveDisabled() || this.ctx.readonly()) {\n return;\n }\n if (this.#composing) {\n return;\n }\n const inputEvent = event as InputEvent;\n const allowInline = !inputEvent.isComposing;\n const isDelete = (inputEvent.inputType ?? '').startsWith('delete');\n this.#syncQuery(allowInline, isDelete);\n }\n\n #syncQuery(allowInline: boolean, isDelete: boolean): void {\n const el = this.#host.nativeElement;\n\n // The \"user prefix\" is everything before the caret. After inline\n // autocomplete sets a selection on chars [prefixLen..end], typing replaces\n // the selection (caret lands right after the new char) so this still\n // captures the user's intent. On Backspace, the browser deletes the\n // selection without touching the prefix — re-completing here would mean\n // the user can never shorten the query, so we skip completion on delete.\n const caret = el.selectionStart ?? el.value.length;\n const prefix = el.value.slice(0, caret);\n\n const atEnd = caret === el.value.length;\n const mode = this.ctx.autocompleteMode();\n const inlineActive =\n allowInline &&\n !isDelete &&\n atEnd &&\n (mode === 'inline' || mode === 'both') &&\n prefix.length > 0;\n\n if (inlineActive) {\n this.ctx.setQueryFromInput(prefix);\n this.#applyInlineCompletion(prefix);\n } else {\n this.ctx.setQueryFromInput(el.value);\n }\n }\n\n #applyInlineCompletion(prefix: string): void {\n const cached = this.ctx.cachedOptions();\n const lower = prefix.toLowerCase();\n const match = cached.find((o) => o.label.toLowerCase().startsWith(lower));\n const el = this.#host.nativeElement;\n if (!match || match.label.toLowerCase() === lower) {\n // No completion to apply — strip any prior selection so the user's\n // prefix is plainly visible.\n if (el.value !== prefix) {\n el.value = prefix;\n }\n return;\n }\n // Use the option's full label as the visible text (preserving its case),\n // with chars [prefixLen..end] selected so the next keystroke replaces\n // the appended suggestion. Matches native browser autocomplete behavior.\n const composed = match.label;\n el.value = composed;\n el.setSelectionRange(prefix.length, composed.length);\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.ctx.effectiveDisabled()) {\n return;\n }\n\n // Multi-mode Backspace heuristic: an empty input sends focus to the\n // last chip so a second Backspace there removes it. Skip when there's a\n // non-empty selection in the input (the user's mid-edit) — Backspace falls\n // through to the native delete-char handler.\n if (\n event.key === 'Backspace' &&\n this.ctx.multiple() &&\n this.#host.nativeElement.value === '' &&\n !this.ctx.readonly() &&\n !this.ctx.effectiveDisabled()\n ) {\n const chips = this.ctx.chips();\n const last = chips[chips.length - 1];\n if (last) {\n event.preventDefault();\n last.host.focus();\n return;\n }\n }\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (!this.ctx.open()) {\n // Open with the natural extreme as the auto-highlight bias —\n // navigate('next') won't fire here because items aren't registered\n // yet; the root's `activeId` linkedSignal seeds the activedescendant\n // once the options register.\n this.ctx.openMenu('first');\n } else {\n this.ctx.navigate('next');\n }\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n if (!this.ctx.open()) {\n this.ctx.openMenu('last');\n } else {\n this.ctx.navigate('prev');\n }\n break;\n\n case 'Home':\n if (this.ctx.open()) {\n event.preventDefault();\n this.ctx.navigate('first');\n }\n break;\n\n case 'End':\n if (this.ctx.open()) {\n event.preventDefault();\n this.ctx.navigate('last');\n }\n break;\n\n case 'PageUp':\n if (this.ctx.open()) {\n event.preventDefault();\n this.ctx.navigate('first');\n }\n break;\n\n case 'PageDown':\n if (this.ctx.open()) {\n event.preventDefault();\n this.ctx.navigate('last');\n }\n break;\n\n case 'Enter':\n if (this.ctx.open() && this.ctx.activateActive()) {\n event.preventDefault();\n }\n break;\n\n case 'Escape':\n // Routed through emitEscapeKeyDown so the consumer's\n // (escapeKeyDown) output fires and can veto the close. We still\n // handle Escape inline (not via the dismissable layer) because\n // focus stays in the input — the Escape belongs to this input\n // and shouldn't bubble through nested layers before it sees it.\n if (this.ctx.open()) {\n event.preventDefault();\n this.ctx.emitEscapeKeyDown(event);\n }\n break;\n\n case 'Tab':\n if (this.ctx.open()) {\n this.ctx.closeMenu('tab');\n }\n // Don't preventDefault — Tab still flows to the next focusable.\n break;\n }\n }\n\n protected onFocus(): void {\n if (this.ctx.openOnFocus() && !this.ctx.open()) {\n this.ctx.openMenu();\n }\n }\n\n protected onClick(): void {\n // A click on the input while focused mirrors the focus-open intent —\n // useful when the user closed via Escape and wants to re-open without\n // typing or reaching for the keyboard.\n if (this.ctx.openOnFocus() && !this.ctx.open()) {\n this.ctx.openMenu();\n }\n }\n}\n","import { computed, Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle, injectOverlayShell, type OverlayShellConfig } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * The floating surface, portaled to `document.body` and positioned by\n * `@floating-ui/dom` against the anchor (explicit `[forComboboxAnchor]` →\n * `[forComboboxTrigger]` → input).\n *\n * Two anatomies, picked by whether an inner `[forComboboxList]` is present:\n *\n * - **Editable (no list)** — content itself carries `role=\"listbox\"`,\n * `tabindex=\"-1\"`, `aria-multiselectable`, `aria-setsize`, and the labelled\n * role (`aria-label` / `aria-labelledby`). The input's `aria-controls` points\n * here. This is the original combobox; nothing about it changes.\n * - **Picker (list present)** — content drops the listbox semantics and becomes\n * a neutral popup surface; `[forComboboxList]` takes over the listbox role and\n * owns the options, the input lives inside the panel, and the input's\n * `aria-controls` points to the list. Keeps `data-state` and the positioner +\n * dismissable layer unchanged.\n *\n * Mount/unmount of the visible content is the consumer's responsibility —\n * wrap with `@if (open())` so `animate.enter` / `animate.leave` fire on the\n * natural mount cycle. While mounted, a `DismissableLayer` activates for\n * pointer-down outside / focus outside; the input and (picker anatomy) the\n * trigger are exempt from outside checks.\n *\n * Focus:\n * - **Editable anatomy** — focus stays in the input across the whole open\n * lifecycle; the directive never moves DOM focus and exposes no focus hooks.\n * Active-option highlighting is `aria-activedescendant`-driven.\n * - **Picker anatomy** — on open, focus moves into the input (the search field\n * inside the panel); on close it returns to the trigger. Both moves are\n * vetoable via `(autoFocusOnOpen)` / `(autoFocusOnClose)` on `[forCombobox]`,\n * and the return is gated by `[returnFocus]`. Escape stays owned by the input.\n *\n * The lifecycle (positioner + dismissable layer, plus the picker anatomy's\n * focus bundles) is owned by the shared `injectOverlayShell` helper.\n */\n@Directive({\n selector: '[forComboboxContent]',\n exportAs: 'forComboboxContent',\n host: {\n '[attr.role]': 'hasList() ? null : \"listbox\"',\n '[attr.tabindex]': 'hasList() ? null : \"-1\"',\n '[id]': 'ctx.contentId()',\n '[attr.aria-labelledby]': 'hasList() ? null : (ctx.ariaLabel() ? null : ctx.inputId())',\n '[attr.aria-label]': 'hasList() ? null : ctx.ariaLabel()',\n '[attr.aria-multiselectable]': 'hasList() ? null : (ctx.multiple() ? \"true\" : null)',\n '[attr.aria-setsize]': 'hasList() ? null : ariaSetSize()',\n '[attr.data-state]': 'ctx.open() ? \"open\" : \"closed\"',\n },\n})\nexport class ForComboboxContent {\n protected readonly ctx = injectComboboxContext('ForComboboxContent');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** When a `[forComboboxList]` is registered the listbox semantics live there, not here. */\n protected readonly hasList = this.ctx.hasList;\n\n /**\n * Reflects `aria-setsize` when the consumer wires up `[totalCount]` for\n * virtualization (editable anatomy only — the picker anatomy's list owns it).\n * Falls back to `null` (omitted) otherwise — leaving the default\n * option-count semantics screen readers already infer.\n */\n protected readonly ariaSetSize = computed<string | null>(() => {\n const total = this.ctx.totalCount();\n return total === undefined ? null : String(total);\n });\n\n constructor() {\n const ctx = this.ctx;\n registerHandle(\n this.#host.nativeElement,\n (el) => ctx.registerContent(el),\n (el) => ctx.unregisterContent(el),\n );\n\n // The picker anatomy opts back into the shell's focus bundles. `trigger()`\n // is read once on construction: the trigger renders outside the `@if (open())`\n // that gates this content, so it has already registered by the time the\n // surface mounts. Without a trigger (editable anatomy) the bundles are\n // omitted entirely and focus stays in the input — byte-for-byte unchanged.\n const hasTrigger = ctx.trigger() !== null;\n\n const config: OverlayShellConfig = {\n positioner: {\n kind: 'floating',\n reference: ctx.anchor,\n open: ctx.open,\n side: ctx.side,\n align: ctx.align,\n sideOffset: ctx.sideOffset,\n alignOffset: ctx.alignOffset,\n avoidCollisions: ctx.avoidCollisions,\n collisionPadding: ctx.collisionPadding,\n arrowPadding: ctx.arrowPadding,\n sticky: ctx.sticky,\n hideWhenDetached: ctx.hideWhenDetached,\n clipUntilPositioned: ctx.clipUntilPositioned,\n },\n dismiss: {\n dismissible: ctx.dismissible,\n requestClose: (reason) => ctx.requestClose(reason),\n // Escape is handled by the input directive (focus stays in the\n // input, so Escape there shouldn't bubble through nested layers\n // before the input sees it). Omitted here intentionally.\n emitPointerDownOutside: (veto) => ctx.emitPointerDownOutside(veto),\n emitFocusOutside: (veto) => ctx.emitFocusOutside(veto),\n emitInteractOutside: (veto) => ctx.emitInteractOutside(veto),\n // The input owns the visible focus and toggles via its own click /\n // focus handlers; the trigger (picker anatomy) toggles via its own\n // click handler. Without exemption a pointer-down on either would race\n // the dismissal layer.\n exemptElements: () => {\n const els: Element[] = [];\n const input = ctx.input();\n if (input) els.push(input);\n const trigger = ctx.trigger();\n if (trigger) els.push(trigger);\n return els;\n },\n },\n // Picker anatomy only: move focus into the input on open, return it to the\n // trigger on close. Editable anatomy keeps focus in the input throughout,\n // so both bundles stay absent (no imperative move, no hooks).\n ...(hasTrigger\n ? {\n initialFocus: {\n move: () => {\n const input = ctx.input();\n if (input) {\n input.focus();\n return true;\n }\n return false;\n },\n veto: () => ctx.emitAutoFocusOnOpen(),\n },\n returnFocus: {\n enabled: ctx.returnFocus,\n target: () => ctx.trigger(),\n veto: () => ctx.emitAutoFocusOnClose(),\n // Tab already advanced focus past the closing surface; re-focusing\n // the trigger would steal it back.\n skip: () => ctx.lastCloseReason() === 'tab',\n },\n }\n : {}),\n };\n\n injectOverlayShell(config);\n }\n}\n","import { computed, Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * The `role=\"listbox\"` element of the picker anatomy. Nest it inside\n * `[forComboboxContent]` next to `[forComboboxInput]` so the popup surface can\n * hold a search field without violating `aria-required-owned-elements` (a\n * `listbox` may only own `option` / `group` children). The list owns the\n * options; `[forComboboxContent]` becomes a neutral popup surface.\n *\n * ```html\n * <div forComboboxContent>\n * <input forComboboxInput />\n * <div forComboboxList>\n * @for (item of filtered(); track item.id) {\n * <div forComboboxOption [value]=\"item\">{{ item.label }}</div>\n * }\n * </div>\n * </div>\n * ```\n *\n * Carries `role=\"listbox\"`, `tabindex=\"-1\"` (focus stays in the input,\n * activedescendant-driven), `aria-multiselectable` in multi mode,\n * `aria-setsize` when virtualizing, and the labelled-role `aria-label` /\n * `aria-labelledby`. Its id is what the input's `aria-controls` references in\n * the picker anatomy.\n *\n * When no `[forComboboxList]` is present, `[forComboboxContent]` itself carries\n * the listbox semantics (the editable anatomy) — this part is additive and\n * non-breaking.\n */\n@Directive({\n selector: '[forComboboxList]',\n exportAs: 'forComboboxList',\n host: {\n role: 'listbox',\n tabindex: '-1',\n '[id]': 'ctx.listId()',\n '[attr.aria-labelledby]': 'ctx.ariaLabel() ? null : ctx.inputId()',\n '[attr.aria-label]': 'ctx.ariaLabel()',\n '[attr.aria-multiselectable]': 'ctx.multiple() ? \"true\" : null',\n '[attr.aria-setsize]': 'ariaSetSize()',\n },\n})\nexport class ForComboboxList {\n protected readonly ctx = injectComboboxContext('ForComboboxList');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Reflects `aria-setsize` when the consumer wires up `[totalCount]` for\n * virtualization. Falls back to `null` (omitted) otherwise.\n */\n protected readonly ariaSetSize = computed<string | null>(() => {\n const total = this.ctx.totalCount();\n return total === undefined ? null : String(total);\n });\n\n constructor() {\n registerHandle(\n this.#host.nativeElement,\n (el) => this.ctx.registerList(el),\n (el) => this.ctx.unregisterList(el),\n );\n }\n}\n","import {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n InjectionToken,\n input,\n} from '@angular/core';\n\nimport { registerHandle, hostId } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Injection key the `[forComboboxIndicator]` uses to resolve its parent\n * option, decoupled from the concrete `ForComboboxOption` class.\n * `ForComboboxOption` provides itself under this token, so a design system\n * wrapping the option by subclassing re-points it at the subclass with a\n * single provider (`{ provide: FOR_COMBOBOX_OPTION, useExisting: MtxComboboxOption }`)\n * and the indicator keeps resolving — see `docs/wrapping-form-primitives.md`.\n */\nexport const FOR_COMBOBOX_OPTION = new InjectionToken<ForComboboxOption>('FOR_COMBOBOX_OPTION');\n\n/**\n * One option inside a `[forComboboxContent]`. Apply on whatever element\n * fits the design — typically a `<div>` or `<li>`. Click activates:\n * single mode replaces `[(value)]` and closes the listbox; multi mode\n * toggles the value in/out and keeps the listbox open.\n *\n * Generic over the option value type `T` (default `string`). Inferred from\n * the `[value]` binding so consumers can pass either primitive ids or\n * full objects (`[value]=\"city\"` infers `T = City`); the parent\n * `[forCombobox]` must be parameterized over the same `T`.\n *\n * `aria-selected` reflects different things in single vs. multi:\n * - **Single mode**: the option that's the current activedescendant\n * (Enter would activate it). Matches APG select-only-combobox.\n * - **Multi mode**: every option currently in `value()` carries\n * `aria-selected=\"true\"` (multiple \"selected\" entries simultaneously).\n * Matches APG multi-select combobox.\n *\n * `data-state=\"checked\" | \"unchecked\"` always reflects membership in\n * `value()` regardless of mode, so consumers can paint a checkmark with\n * pure CSS in either mode. `data-highlighted` marks the option that is\n * the current activedescendant — shared across the\n * library's roving / activedescendant primitives.\n *\n * Hovering an option also makes it the activedescendant, mirroring native\n * menu / select behavior so mouse and keyboard intent stay synchronized.\n */\n@Directive({\n selector: '[forComboboxOption]',\n exportAs: 'forComboboxOption',\n providers: [{ provide: FOR_COMBOBOX_OPTION, useExisting: ForComboboxOption }],\n host: {\n role: 'option',\n '[id]': 'id()',\n '[attr.aria-selected]': 'ariaSelected()',\n '[attr.aria-disabled]': 'effectiveDisabled() ? \"true\" : null',\n '[attr.aria-posinset]': 'ariaPosInSet()',\n '[attr.aria-setsize]': 'ariaSetSize()',\n '[attr.data-state]': 'selected() ? \"checked\" : \"unchecked\"',\n '[attr.data-highlighted]': 'highlighted() ? \"\" : null',\n '[attr.data-disabled]': 'effectiveDisabled() ? \"\" : null',\n '(click)': 'onClick()',\n '(pointermove)': 'onPointerMove()',\n },\n})\nexport class ForComboboxOption<T = string> {\n readonly #ctx = injectComboboxContext<T>('ForComboboxOption');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Stable identifier serialized into `[(value)]` and the hidden input.\n * Defaults to `string` for back-compat; bind an object to specialize\n * the parent `[forCombobox]` over a richer `T`. The parent's\n * `[isItemEqualToValue]` decides how options are matched against the\n * committed selection.\n */\n readonly value = input.required<T>();\n\n /**\n * Visible label used by `[forComboboxInput]` for inline autocomplete\n * matching, by `commitOnSelect` to populate the input on selection,\n * and by typeahead / display utilities. When omitted: for string\n * `value` falls back to the trimmed `textContent` of the host element;\n * for object `value` falls back to the parent's `itemToStringLabel(value)`.\n */\n readonly label = input<string | null>(null);\n\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /**\n * Absolute index of this option in the consumer's source array. Required\n * when wiring up a virtualized listbox so navigation past the rendered\n * window can resolve indices to options (and emit `(scrollToIndex)` when\n * needed). Leave `null` for non-virtualized lists — the directive then\n * falls back to DOM order.\n */\n readonly posInSet = input<number | null>(null);\n\n readonly id = hostId('for-combobox-option');\n\n readonly selected = computed(() => this.#ctx.isSelected(this.value()));\n /** True when this option is the current activedescendant. Reflected as `data-highlighted`. */\n readonly highlighted = computed(() => this.#ctx.isActive(this.id()));\n readonly effectiveDisabled = computed(() => this.disabled() || this.#ctx.effectiveDisabled());\n\n protected readonly ariaSelected = computed(() => {\n if (this.#ctx.multiple()) {\n return this.selected() ? 'true' : 'false';\n }\n return this.highlighted() ? 'true' : 'false';\n });\n\n /** Reflects `aria-posinset` (1-based) when virtualizing. Falls back to DOM order otherwise. */\n protected readonly ariaPosInSet = computed<string | null>(() => {\n const explicit = this.posInSet();\n if (explicit !== null) {\n return String(explicit + 1);\n }\n if (this.#ctx.totalCount() === undefined) {\n return null;\n }\n const items = this.#ctx.options();\n const idx = items.findIndex((it) => it.id() === this.id());\n return idx < 0 ? null : String(idx + 1);\n });\n\n /** Reflects `aria-setsize` when the consumer wires up `[totalCount]`. */\n protected readonly ariaSetSize = computed<string | null>(() => {\n const total = this.#ctx.totalCount();\n return total === undefined ? null : String(total);\n });\n\n readonly #effectiveLabel = computed(() => {\n const explicit = this.label();\n if (explicit !== null) {\n return explicit;\n }\n const v = this.value();\n if (typeof v === 'string') {\n // String mode: the trimmed `textContent` is the canonical fallback,\n // identical to the pre-generic behaviour. Lets consumers omit\n // `[label]` and have it just work for projected text.\n return (this.#host.nativeElement.textContent ?? '').trim();\n }\n // Object mode: lean on the parent's `itemToStringLabel` so the\n // resolved label is consistent with chip rendering and `commitOnSelect`.\n return this.#ctx.itemToStringLabel()(v);\n });\n\n readonly #handle = {\n host: this.#host.nativeElement,\n id: this.id,\n value: this.value,\n label: this.#effectiveLabel,\n disabled: this.effectiveDisabled,\n posInSet: this.posInSet,\n };\n\n constructor() {\n registerHandle(\n this.#handle,\n (h) => this.#ctx.registerOption(h),\n (h) => this.#ctx.unregisterOption(h),\n );\n }\n\n protected onClick(): void {\n if (this.effectiveDisabled() || this.#ctx.readonly()) {\n return;\n }\n this.#ctx.activate(this.#handle);\n }\n\n protected onPointerMove(): void {\n if (this.effectiveDisabled() || this.#ctx.isPointerSuppressed()) {\n return;\n }\n if (!this.#ctx.isActive(this.id())) {\n this.#ctx.setActiveId(this.id());\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\n\nimport { FOR_COMBOBOX_OPTION, type ForComboboxOption } from './combobox-option';\n\n/**\n * Visibility helper inside a `[forComboboxOption]`. The directive flips a\n * `[hidden]` host binding so the consumer can keep the checkmark / icon\n * inline without extra `@if` glue:\n *\n * ```html\n * <div forComboboxOption value=\"apple\">\n * <span forComboboxIndicator>✓</span>\n * Apple\n * </div>\n * ```\n *\n * Reflects the parent option's `data-state` (`\"checked\" | \"unchecked\"`) so\n * the consumer can also style it from CSS. Visibility while unselected is\n * enforced with an inline `display: none` (which beats any author `display`\n * rule a consumer applies via a class) in addition to the `hidden` attribute\n * that removes it from the a11y tree.\n *\n * In multi mode the indicator follows membership in `value()`, matching the\n * option's own `data-state` semantics (a checkmark per selected option).\n */\n@Directive({\n selector: '[forComboboxIndicator]',\n exportAs: 'forComboboxIndicator',\n host: {\n 'aria-hidden': 'true',\n '[attr.data-state]': 'option.selected() ? \"checked\" : \"unchecked\"',\n '[hidden]': '!option.selected()',\n '[style.display]': 'option.selected() ? null : \"none\"',\n },\n})\nexport class ForComboboxIndicator {\n protected readonly option = injectParentOption();\n}\n\nfunction injectParentOption(): ForComboboxOption {\n const option = inject(FOR_COMBOBOX_OPTION, { optional: true });\n if (!option) {\n throw new Error(\n '[forty-cdk/combobox] ForComboboxIndicator must be used inside a [forComboboxOption] element.',\n );\n }\n return option;\n}\n","import { computed, Directive } from '@angular/core';\n\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Empty-state slot, shown when the listbox has no registered options.\n * The directive hides the message when options exist so the consumer can\n * keep it inline in the template — no `@if` needed. Visibility is enforced\n * with an inline `display: none` (which beats any author `display` rule a\n * consumer applies via a class) in addition to the `hidden` attribute that\n * removes it from the a11y tree:\n *\n * ```html\n * <div forComboboxContent>\n * @for (option of filtered(); track option.id) {\n * <div forComboboxOption [value]=\"option.id\">{{ option.label }}</div>\n * }\n * <div forComboboxEmpty>No matches.</div>\n * </div>\n * ```\n *\n * Carries `role=\"status\"` and `aria-live=\"polite\"` so screen readers\n * announce the message when it appears.\n */\n@Directive({\n selector: '[forComboboxEmpty]',\n exportAs: 'forComboboxEmpty',\n host: {\n role: 'status',\n 'aria-live': 'polite',\n '[hidden]': '!shouldShow()',\n '[style.display]': 'shouldShow() ? null : \"none\"',\n },\n})\nexport class ForComboboxEmpty {\n readonly #ctx = injectComboboxContext('ForComboboxEmpty');\n protected readonly shouldShow = computed(() => this.#ctx.options().length === 0);\n}\n","import { computed, Directive } from '@angular/core';\n\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Live-region slot for async-filtering feedback (loading, result count,\n * \"no matches\", error messages). Apply on a `<div>` inside the listbox or\n * next to the input. The directive sets `role=\"status\"` and\n * `aria-live=\"polite\"` so messages projected as content are announced to\n * screen readers when they change.\n *\n * The directive is **content-driven** — it does not pick or render a\n * message. Project whatever the consumer wants and use the exposed\n * `count` signal (or `forComboboxStatus` template ref) to interpolate\n * the option count when relevant.\n *\n * ```html\n * <div forCombobox [(query)]=\"query\" [(value)]=\"value\" [(open)]=\"open\">\n * <input forComboboxInput placeholder=\"Search…\" />\n * @if (open()) {\n * <div forComboboxContent>\n * <div forComboboxStatus #status=\"forComboboxStatus\">\n * @if (loading()) {\n * Searching…\n * } @else if (status.count() === 0) {\n * No matches.\n * } @else {\n * {{ status.count() }} results.\n * }\n * </div>\n * @for (it of filtered(); track it.id) {\n * <div forComboboxOption [value]=\"it.id\">{{ it.label }}</div>\n * }\n * </div>\n * }\n * </div>\n * ```\n *\n * For an empty-only slot that auto-hides when there are options, use\n * `[forComboboxEmpty]`. `[forComboboxStatus]` stays mounted regardless\n * so transitions like \"loading → 5 results\" are announced as a single\n * change to the same live region.\n */\n@Directive({\n selector: '[forComboboxStatus]',\n exportAs: 'forComboboxStatus',\n host: {\n role: 'status',\n 'aria-live': 'polite',\n 'aria-atomic': 'true',\n },\n})\nexport class ForComboboxStatus {\n readonly #ctx = injectComboboxContext('ForComboboxStatus');\n\n /**\n * Number of currently registered options. Reflects the live size of the\n * filtered listbox so the consumer can interpolate `{{ status.count() }}`\n * inside the live region.\n */\n readonly count = computed(() => this.#ctx.options().length);\n}\n","import { computed, Directive } from '@angular/core';\n\nimport { reflectDisabled } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Optional clear button. Apply on a `<button type=\"button\">` so Space /\n * Enter dispatch a native click. Clicking calls `clear()` on the root,\n * which resets `[(value)]` and `[(query)]` and the activedescendant.\n *\n * The directive hides the button when there's nothing to clear (no value,\n * empty query) so the consumer can leave it inline in the template without\n * an extra `@if`. Visibility is enforced with an inline `display: none`\n * (which beats any author `display` rule a consumer applies via a class) in\n * addition to the `hidden` attribute that removes it from the a11y tree.\n */\n@Directive({\n selector: '[forComboboxClear]',\n exportAs: 'forComboboxClear',\n host: {\n type: 'button',\n 'aria-label': 'Clear',\n '[hidden]': '!hasContent()',\n '[style.display]': 'hasContent() ? null : \"none\"',\n '[attr.tabindex]': '-1',\n '(click)': 'onClick()',\n },\n})\nexport class ForComboboxClear {\n protected readonly ctx = injectComboboxContext('ForComboboxClear');\n\n protected readonly hasContent = computed(\n () => this.ctx.value().length > 0 || this.ctx.query().length > 0,\n );\n\n /** Disabled when the combobox is disabled or read-only — the clear action is unavailable. */\n protected readonly isDisabled = computed(\n () => this.ctx.effectiveDisabled() || this.ctx.readonly(),\n );\n\n constructor() {\n reflectDisabled(this.isDisabled);\n }\n\n protected onClick(): void {\n if (this.isDisabled()) {\n return;\n }\n this.ctx.clear(true);\n // Restore focus to the input so the user can keep typing without\n // chasing the caret.\n this.ctx.input()?.focus();\n }\n}\n","import { Directive, input } from '@angular/core';\n\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Multi-mode chips area. Wrap the chips and the `<input>` together so the\n * combobox visually presents a single editable region:\n *\n * ```html\n * <div forCombobox multiple [(value)]=\"tags\" [(query)]=\"query\" [(open)]=\"open\">\n * <div forComboboxChips>\n * @for (chip of selected(); track chip.value) {\n * <span forComboboxChip [value]=\"chip.value\">\n * {{ chip.label }}\n * <button forComboboxChipRemove></button>\n * </span>\n * }\n * <input forComboboxInput />\n * </div>\n * …\n * </div>\n * ```\n *\n * Carries `role=\"group\"` with `aria-label=\"Selected items\"` (override via\n * `[ariaLabel]`) so screen readers announce the chip cluster as a single\n * unit. The directive itself doesn't manage focus or selection — the\n * chips and the input own that — but its presence groups them for\n * assistive tech.\n */\n@Directive({\n selector: '[forComboboxChips]',\n exportAs: 'forComboboxChips',\n host: {\n role: 'group',\n '[attr.aria-label]': 'ariaLabel()',\n },\n})\nexport class ForComboboxChips {\n protected readonly ctx = injectComboboxContext('ForComboboxChips');\n\n /**\n * Accessible name for the chip cluster, exposed as `role=\"group\"`'s\n * `aria-label` so screen readers announce the selected chips as a single\n * unit. Defaults to `'Selected items'`; set `[ariaLabel]` to localize or\n * override it.\n */\n readonly ariaLabel = input<string | null>('Selected items');\n}\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * One chip representing a selected value in multi mode. Apply on a\n * `<span>` (or any inline-block element) inside `[forComboboxChips]`.\n * The chip is **out of the Tab cycle** (`tabindex=\"-1\"`) by design:\n * the user reaches it via the input's Backspace heuristic (Backspace on\n * an empty input focuses the last chip), then navigates between chips\n * with ArrowLeft / ArrowRight or removes them with Backspace / Delete.\n *\n * Keyboard while the chip has focus (LTR; the ArrowLeft/Right roles swap\n * in RTL so they always follow visual order):\n * - **ArrowLeft** — focus the previous chip; bounces if first.\n * - **ArrowRight** — focus the next chip; if at the last, focus the input.\n * - **Backspace / Delete** — remove this chip + focus the previous chip,\n * or the next chip when there is no previous one (so removing the first\n * chip lands on the new first chip), falling back to the input only when\n * the removed chip was the last one standing.\n * - **Escape** — return focus to the input.\n *\n * Click on the chip body (excluding the remove button) just focuses the\n * chip — useful as an alternative to the Backspace path.\n */\n@Directive({\n selector: '[forComboboxChip]',\n exportAs: 'forComboboxChip',\n host: {\n tabindex: '-1',\n '[attr.data-value]': 'dataValue()',\n '[attr.data-disabled]': 'ctx.effectiveDisabled() ? \"\" : null',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForComboboxChip<T = string> {\n protected readonly ctx = injectComboboxContext<T>('ForComboboxChip');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The value this chip represents — must match an entry in\n * `[forCombobox][(value)]` per the parent's `[isItemEqualToValue]`.\n * Generic over `T` (default `string`); inferred from the binding\n * (`[value]=\"someObject\"` specializes `T`).\n */\n readonly value = input.required<T>();\n\n /**\n * `data-value` reflection — for string `T` this is the value verbatim\n * (unchanged from the pre-generic behaviour); for object `T` it uses\n * the parent's `itemToFormValue` so the attribute carries the same\n * wire format as the hidden inputs (typically JSON or a per-item id).\n */\n protected readonly dataValue = computed(() => {\n const v = this.value();\n return typeof v === 'string' ? (v as string) : this.ctx.itemToFormValue()(v);\n });\n\n /** Resolved label of the underlying option, used by `[forComboboxChipRemove]` for its `aria-label`. */\n readonly label = computed(() => {\n const v = this.value();\n const equals = this.ctx.isItemEqualToValue();\n const cached = this.ctx.cachedOptions().find((o) => equals(o.value, v));\n if (cached) {\n return cached.label;\n }\n return typeof v === 'string' ? (v as string) : this.ctx.itemToStringLabel()(v);\n });\n\n constructor() {\n const handle = {\n host: this.#host.nativeElement,\n value: this.value,\n };\n registerHandle(\n handle,\n (h) => this.ctx.registerChip(h),\n (h) => this.ctx.unregisterChip(h),\n );\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.ctx.effectiveDisabled() || this.ctx.readonly()) {\n return;\n }\n const chips = this.ctx.chips();\n const index = chips.findIndex((c) => c.host === this.#host.nativeElement);\n if (index < 0) {\n return;\n }\n\n // In RTL the chip cluster lays out right-to-left, so ArrowRight must\n // move to the visually-next chip (= DOM-previous) and ArrowLeft to the\n // visually-previous one (= DOM-next), with the input sitting at the\n // visual leftmost edge.\n const rtl = this.ctx.dir() === 'rtl';\n const prevKey = rtl ? 'ArrowRight' : 'ArrowLeft';\n const nextKey = rtl ? 'ArrowLeft' : 'ArrowRight';\n\n switch (event.key) {\n case prevKey: {\n event.preventDefault();\n const prev = chips[index - 1];\n if (prev) {\n prev.host.focus();\n }\n break;\n }\n case nextKey: {\n event.preventDefault();\n const next = chips[index + 1];\n if (next) {\n next.host.focus();\n } else {\n // At the last chip (visual edge in either direction) — hop to the input.\n this.ctx.input()?.focus();\n }\n break;\n }\n case 'Backspace':\n case 'Delete': {\n event.preventDefault();\n const v = this.value();\n const prev = chips[index - 1];\n const next = chips[index + 1];\n this.ctx.removeValue(v);\n // Keep focus inside the chip cluster whenever a neighbour survives the\n // removal: prefer the previous chip, otherwise the next one (which\n // slides into the freed slot — so removing the first chip lands on the\n // new first chip rather than ejecting the user to the input). Only drop\n // focus into the input when the removed chip was the last one standing,\n // so the user can keep typing without chasing the caret.\n if (prev) {\n prev.host.focus();\n } else if (next) {\n next.host.focus();\n } else {\n this.ctx.input()?.focus();\n }\n break;\n }\n case 'Escape': {\n event.preventDefault();\n this.ctx.input()?.focus();\n break;\n }\n }\n }\n}\n","import { computed, Directive, inject } from '@angular/core';\n\nimport { reflectDisabled } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\nimport { ForComboboxChip } from './combobox-chip';\n\n/**\n * Remove button inside a `[forComboboxChip]`. Apply on a\n * `<button type=\"button\">` so click and Space / Enter (when focused) all\n * trigger the same removal flow. The button is out of the Tab cycle\n * (`tabindex=\"-1\"`) so the user navigates the chip cluster via the chip's\n * own ArrowLeft/Right + Backspace/Delete keys; this button exists for\n * mouse / touch users.\n *\n * The host carries a generated `aria-label` (\"Remove `<chip label>`\")\n * derived from the parent chip's resolved option label.\n */\n@Directive({\n selector: '[forComboboxChipRemove]',\n exportAs: 'forComboboxChipRemove',\n host: {\n type: 'button',\n tabindex: '-1',\n '[attr.aria-label]': 'ariaLabel()',\n '(click)': 'onClick($event)',\n },\n})\nexport class ForComboboxChipRemove {\n // The value type is opaque to chip-remove: it just forwards whatever the\n // parent chip exposes back into `removeValue`. At runtime the chip and\n // the parent `[forCombobox]` share the same `T` because the consumer\n // binds them with the same value source.\n protected readonly ctx = injectComboboxContext<unknown>('ForComboboxChipRemove');\n readonly #chip = inject<ForComboboxChip<unknown>>(ForComboboxChip, { optional: true });\n\n /** Disabled when the combobox is disabled or read-only — chip removal is unavailable. */\n protected readonly isDisabled = computed(\n () => this.ctx.effectiveDisabled() || this.ctx.readonly(),\n );\n\n constructor() {\n if (!this.#chip) {\n throw new Error(\n '[forty-cdk/combobox] ForComboboxChipRemove must be used inside a [forComboboxChip] element.',\n );\n }\n reflectDisabled(this.isDisabled);\n }\n\n protected readonly ariaLabel = computed(() => `Remove ${this.#chip!.label()}`);\n\n protected onClick(event: MouseEvent): void {\n if (this.isDisabled()) {\n return;\n }\n // Don't let the click bubble up to the chip body — that would trigger\n // its keyboard-triggered handlers in some browsers via synthesized events.\n event.stopPropagation();\n this.ctx.removeValue(this.#chip!.value());\n // Restore focus to the input so the user can continue typing.\n this.ctx.input()?.focus();\n }\n}\n","import { Directive, signal } from '@angular/core';\n\n/**\n * Optional grouping wrapper inside a `[forComboboxContent]`. Renders\n * `role=\"group\"` and references the descendant `[forComboboxGroupLabel]`\n * (if any) via `aria-labelledby`. Options inside a group still register\n * with the root listbox normally, so keyboard navigation traverses across\n * groups in DOM order without special handling.\n */\n@Directive({\n selector: '[forComboboxGroup]',\n exportAs: 'forComboboxGroup',\n host: {\n role: 'group',\n '[attr.aria-labelledby]': 'labelId() || null',\n },\n})\nexport class ForComboboxGroup {\n readonly #labelId = signal<string | null>(null);\n\n /** The id of the registered group label (or `null` if none). */\n readonly labelId = this.#labelId.asReadonly();\n\n /** Called by `ForComboboxGroupLabel` on mount. */\n registerLabel(id: string): void {\n this.#labelId.set(id);\n }\n\n /** Called by `ForComboboxGroupLabel` on destroy. Idempotent. */\n unregisterLabel(id: string): void {\n if (this.#labelId() === id) {\n this.#labelId.set(null);\n }\n }\n}\n","import { Directive, inject, type Signal } from '@angular/core';\n\nimport { registerA11yName } from 'forty-cdk/core';\nimport { ForComboboxGroup } from './combobox-group';\n\n/**\n * Visible label for a `[forComboboxGroup]`. Generates a stable id and\n * registers with its parent group so the group's `aria-labelledby` points\n * at this element.\n */\n@Directive({\n selector: '[forComboboxGroupLabel]',\n exportAs: 'forComboboxGroupLabel',\n host: {\n '[id]': 'id()',\n },\n})\nexport class ForComboboxGroupLabel {\n /** Stable host id used by the parent group's `aria-labelledby`. */\n readonly id: Signal<string>;\n\n constructor() {\n const group = inject(ForComboboxGroup, { optional: true });\n if (!group) {\n throw new Error(\n '[forty-cdk/combobox] ForComboboxGroupLabel must be used inside a [forComboboxGroup] element.',\n );\n }\n this.id = registerA11yName(group, 'for-combobox-group-label');\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Decorative separator between options or groups inside a\n * `[forComboboxContent]`. Carries `role=\"separator\"` and is intentionally\n * not registered with the listbox's option collection, so keyboard\n * navigation skips it automatically.\n */\n@Directive({\n selector: '[forComboboxSeparator]',\n exportAs: 'forComboboxSeparator',\n host: {\n role: 'separator',\n 'aria-orientation': 'horizontal',\n },\n})\nexport class ForComboboxSeparator {}\n","/**\n * Exact public names of every `ForCombobox` input, its models included. Spread it into the\n * `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the\n * primitive's full surface — the Signal Forms members `[formField]` binds among them —\n * without hand-maintaining the list. Always spread into an inline object literal as shown\n * below: the literal is what keeps the entry statically analyzable for consumers compiling\n * against the published package. An anti-drift spec fails when this list no longer matches\n * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported\n * wrapping patterns.\n *\n * @example\n * ```ts\n * @Component({\n * selector: 'div[myCombobox]',\n * template: '',\n * hostDirectives: [\n * {\n * directive: ForCombobox,\n * inputs: [...FOR_COMBOBOX_HOST_DIRECTIVE_INPUTS],\n * outputs: [...FOR_COMBOBOX_HOST_DIRECTIVE_OUTPUTS],\n * },\n * ],\n * })\n * export class MyCombobox {}\n * ```\n */\nexport const FOR_COMBOBOX_HOST_DIRECTIVE_INPUTS = [\n 'query',\n 'value',\n 'open',\n 'align',\n 'alignOffset',\n 'ariaLabel',\n 'arrowPadding',\n 'autoHighlight',\n 'autocompleteMode',\n 'avoidCollisions',\n 'clearOnQueryChange',\n 'clipUntilPositioned',\n 'collisionPadding',\n 'commitOnSelect',\n 'dir',\n 'dirty',\n 'disabled',\n 'dismissible',\n 'errors',\n 'hideWhenDetached',\n 'invalid',\n 'isItemEqualToValue',\n 'itemToFormValue',\n 'itemToStringLabel',\n 'loop',\n 'multiple',\n 'name',\n 'openOnFocus',\n 'openOnQuery',\n 'pending',\n 'readonly',\n 'required',\n 'returnFocus',\n 'side',\n 'sideOffset',\n 'sticky',\n 'totalCount',\n 'visibleRange',\n 'touched',\n] as const;\n\n/**\n * Exact public names of every `ForCombobox` output, the Signal Forms `touch` output\n * included. Spread it into the `outputs` array of the same `hostDirectives` entry as\n * {@link FOR_COMBOBOX_HOST_DIRECTIVE_INPUTS}.\n */\nexport const FOR_COMBOBOX_HOST_DIRECTIVE_OUTPUTS = [\n 'queryChange',\n 'valueChange',\n 'openChange',\n 'scrollToIndex',\n 'escapeKeyDown',\n 'pointerDownOutside',\n 'focusOutside',\n 'interactOutside',\n 'autoFocusOnOpen',\n 'autoFocusOnClose',\n 'touchedChange',\n 'touch',\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["VirtualizedNavigatorCore"],"mappings":";;;;AAAA;;;;;;;AAOG;;ACwCH;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACG,SAAU,oBAAoB,CAAI,MAAyB,EAAA;AAC/D,IAAA,OAAO,YAAY,CAYjB;AACA,QAAA,MAAM,EAAE,OAAO;AACb,YAAA,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;AACrB,YAAA,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE;AACnB,YAAA,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE;AACrC,YAAA,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE;AACjC,YAAA,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE;AACnC,YAAA,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;AACrB,YAAA,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;AACrB,YAAA,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;SACxB,CAAC;QACF,WAAW,EAAE,CACX,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAC/E,IAAI,KACF;AACF,YAAA,MAAM,YAAY,GAAG,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK;AACtE,YAAA,IAAI,OAAO,GAAG,YAAY,GAAG,IAAI,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,CAAC;YACzD,IAAI,OAAO,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,KAAK,OAAO,CAAC,EAAE;gB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f,oBAAoB;IACpB,cAAc;IACd,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,OAAO;;;ACrFT;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"forty-cdk-combobox.mjs","sources":["../../../projects/forty-cdk/combobox/src/combobox-snapshot-fold.ts","../../../projects/forty-cdk/combobox/src/combobox-auto-highlight.ts","../../../projects/forty-cdk/combobox/src/combobox-context.ts","../../../projects/forty-cdk/combobox/src/combobox-defaults.ts","../../../projects/forty-cdk/combobox/src/combobox-label-cache.ts","../../../projects/forty-cdk/combobox/src/combobox-virtualized-navigator.ts","../../../projects/forty-cdk/combobox/src/combobox.ts","../../../projects/forty-cdk/combobox/src/combobox-anchor.ts","../../../projects/forty-cdk/combobox/src/combobox-trigger.ts","../../../projects/forty-cdk/combobox/src/combobox-input.ts","../../../projects/forty-cdk/combobox/src/combobox-content.ts","../../../projects/forty-cdk/combobox/src/combobox-list.ts","../../../projects/forty-cdk/combobox/src/combobox-option.ts","../../../projects/forty-cdk/combobox/src/combobox-indicator.ts","../../../projects/forty-cdk/combobox/src/combobox-empty.ts","../../../projects/forty-cdk/combobox/src/combobox-status.ts","../../../projects/forty-cdk/combobox/src/combobox-clear.ts","../../../projects/forty-cdk/combobox/src/combobox-chips.ts","../../../projects/forty-cdk/combobox/src/combobox-chip.ts","../../../projects/forty-cdk/combobox/src/combobox-chip-remove.ts","../../../projects/forty-cdk/combobox/src/combobox-group.ts","../../../projects/forty-cdk/combobox/src/combobox-group-label.ts","../../../projects/forty-cdk/combobox/src/combobox-separator.ts","../../../projects/forty-cdk/combobox/src/combobox-host-directive.ts","../../../projects/forty-cdk/combobox/src/forty-cdk-combobox.ts"],"sourcesContent":["/**\n * Combobox-local re-exports of the shared snapshot-fold helpers. The single\n * sources live in `_internal/`: `tryReadHandle` (the NG0950 read guard) in\n * `_internal/signal-graph/read-handle.ts` and `foldSnapshotOnTotalCountTransition`\n * (the `totalCount`-reset `linkedSignal` fold) in\n * `_internal/collection/fold-snapshot.ts`. Kept as a barrel so `OptionLabelCache`\n * and the combobox virtualized navigator import from one combobox-local path.\n */\nexport { tryReadHandle } from 'forty-cdk/core';\nexport { foldSnapshotOnTotalCountTransition } from 'forty-cdk/core';\n","import { linkedSignal, untracked, type WritableSignal } from '@angular/core';\n\nimport { tryReadHandle } from './combobox-snapshot-fold';\nimport type { ForComboboxInitialFocus, ForComboboxOptionHandle } from './combobox-context';\nimport type { OptionLabelCache } from './combobox-label-cache';\nimport type { VirtualizedNavigator } from './combobox-virtualized-navigator';\n\n/**\n * Inputs for {@link resolveAutoHighlightSeed}. Mirror the tracked source of the\n * host's `#activeId` linkedSignal: the live registered options, the current\n * selection (for `initialFocus === 'selected'`), and the equality fn used to\n * match selected values to options.\n */\nexport interface AutoHighlightSeedInput<T> {\n /** Live registered options in DOM order. */\n readonly items: readonly ForComboboxOptionHandle<T>[];\n /** Where auto-highlight should land: first / last enabled, or the selection. */\n readonly initialFocus: ForComboboxInitialFocus;\n /** Current selection — only read when `initialFocus === 'selected'`. */\n readonly value: readonly T[];\n /** Identity comparison used to match a selected value to a registered option. */\n readonly equals: (a: T, b: T) => boolean;\n}\n\n/**\n * Reactive source for the host's `#activeId` linkedSignal. Each accessor reads\n * one of the host signals the activedescendant decision depends on.\n */\nexport interface ActiveIdSource<T> {\n /** Visible input text — a change drops the prior pointer (it may be filtered out). */\n readonly query: () => string;\n /** Whether the listbox is open. */\n readonly open: () => boolean;\n /** Whether auto-highlight is enabled. */\n readonly autoHighlight: () => boolean;\n /** `true` when the consumer set `totalCount()` (virtualized path). */\n readonly virtualized: () => boolean;\n /** Where auto-highlight should land. */\n readonly initialFocus: () => ForComboboxInitialFocus;\n /** Live registered options in DOM order. */\n readonly items: () => readonly ForComboboxOptionHandle<T>[];\n /** Current selection — only read for `initialFocus === 'selected'`. */\n readonly value: () => readonly T[];\n /** Identity comparison used to match a selected value to a registered option. */\n readonly equals: () => (a: T, b: T) => boolean;\n}\n\n/**\n * Build the host's activedescendant pointer as a `linkedSignal` so the\n * \"what should be highlighted given open / items / autoHighlight\" decision is a\n * **pure derivation**, never a write from an `effect` (the banned\n * state-propagation pattern). The returned signal is still writable for the\n * genuinely imperative moves that own their own scroll — arrow / Home / End\n * navigation, pointer-move hover, multi-mode activation, and the virtualized\n * pending-nav resolution (`navigate` / `seedFromIndexedSnapshot` /\n * `tryResolvePending` in `combobox-virtualized-navigator.ts`).\n *\n * The reset/seed rule, in order:\n * - On a `query` change the previously-active option may have been filtered\n * out, so the prior pointer is dropped.\n * - A pointer that no longer matches a registered option is dropped (covers the\n * consumer mutating the list without touching `query`).\n * - When a valid pointer survives, it is preserved (arrow nav, hover).\n * - Otherwise, in the **non-virtualized** case, auto-highlight seeds the\n * first / last enabled option (per `initialFocus`) while the listbox is open\n * via {@link resolveAutoHighlightSeed}. The virtualized case returns `null`\n * here and the host's effect seeds it imperatively, because that seed must\n * order options by absolute `posInSet` and must lose to a pending\n * `(scrollToIndex)` resolution.\n *\n * Internal — not re-exported from `combobox/index.ts` or `public-api.ts`.\n */\nexport function createActiveIdSignal<T>(source: ActiveIdSource<T>): WritableSignal<string | null> {\n return linkedSignal<\n {\n query: string;\n open: boolean;\n autoHighlight: boolean;\n virtualized: boolean;\n initialFocus: ForComboboxInitialFocus;\n items: readonly ForComboboxOptionHandle<T>[];\n value: readonly T[];\n equals: (a: T, b: T) => boolean;\n },\n string | null\n >({\n source: () => ({\n query: source.query(),\n open: source.open(),\n autoHighlight: source.autoHighlight(),\n virtualized: source.virtualized(),\n initialFocus: source.initialFocus(),\n items: source.items(),\n value: source.value(),\n equals: source.equals(),\n }),\n computation: (\n { query, open, autoHighlight, virtualized, initialFocus, items, value, equals },\n prev,\n ) => {\n const queryChanged = prev !== undefined && prev.source.query !== query;\n let current = queryChanged ? null : (prev?.value ?? null);\n if (current !== null && !items.some((o) => o.id() === current)) {\n current = null;\n }\n if (current !== null) {\n return current;\n }\n if (virtualized || !autoHighlight || !open || items.length === 0) {\n return null;\n }\n return resolveAutoHighlightSeed({ items, initialFocus, value, equals });\n },\n });\n}\n\n/**\n * Resolve the auto-highlight seed for the **non-virtualized** combobox: the id\n * of the option `aria-activedescendant` should fall on when the listbox is open\n * and no pointer survives. Returns `null` when no enabled option qualifies (or\n * when a `'selected'` seed can't yet read its options — see `tryReadHandle`).\n *\n * Pure over its inputs — no signal reads, no DOM access — so the host can call\n * it from inside its `#activeId` linkedSignal computation without leaking the\n * banned write-from-effect pattern. The virtualized branch seeds imperatively\n * via the navigator instead (it orders by absolute `posInSet` and must lose to\n * a pending `(scrollToIndex)` resolution).\n *\n * Internal — not re-exported from `combobox/index.ts` or `public-api.ts`.\n */\nexport function resolveAutoHighlightSeed<T>(input: AutoHighlightSeedInput<T>): string | null {\n const { items, initialFocus, value, equals } = input;\n if (initialFocus === 'selected') {\n const selected = findSelectedEnabled(items, value, equals);\n if (selected === NOT_READY) {\n return null;\n }\n if (selected) {\n return selected.id();\n }\n }\n const target = initialFocus === 'last' ? findLastEnabled(items) : findFirstEnabled(items);\n return target?.id() ?? null;\n}\n\nfunction findFirstEnabled<T>(\n items: readonly ForComboboxOptionHandle<T>[],\n): ForComboboxOptionHandle<T> | null {\n for (const item of items) {\n if (!item.disabled()) {\n return item;\n }\n }\n return null;\n}\n\nfunction findLastEnabled<T>(\n items: readonly ForComboboxOptionHandle<T>[],\n): ForComboboxOptionHandle<T> | null {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (item && !item.disabled()) {\n return item;\n }\n }\n return null;\n}\n\nconst NOT_READY = Symbol('forty-cdk/combobox:not-ready');\n\nfunction findSelectedEnabled<T>(\n items: readonly ForComboboxOptionHandle<T>[],\n values: readonly T[],\n equals: (a: T, b: T) => boolean,\n): ForComboboxOptionHandle<T> | null | typeof NOT_READY {\n if (values.length === 0) {\n return null;\n }\n for (const item of items) {\n if (item.disabled()) {\n continue;\n }\n const read = tryReadHandle(() => ({ value: item.value() }));\n if (read === null) {\n return NOT_READY;\n }\n if (values.some((sel) => equals(read.value, sel))) {\n return item;\n }\n }\n return null;\n}\n\n/**\n * Collaborators the auto-highlight bridge reaches for. The host owns the\n * activedescendant (`getActiveId`) and the last-scrolled-into-view id\n * (`getLastPositionedId` / `setLastPositionedId`); the bridge only reads and\n * writes them through these accessors so it can stay outside the directive.\n */\nexport interface AutoHighlightBridgeDeps<T> {\n /** Eagerly pull the label cache so its `prev` slot is seeded while open. */\n readonly labelCache: Pick<OptionLabelCache<T>, 'prime'>;\n /** Lazily build the virtualization navigator (only when `totalCount` is set). */\n readonly requireNavigator: () => VirtualizedNavigator<T>;\n /** Live registered options in DOM order. */\n readonly items: () => readonly ForComboboxOptionHandle<T>[];\n /** Whether the listbox is open. */\n readonly open: () => boolean;\n /** Whether auto-highlight is enabled. */\n readonly autoHighlight: () => boolean;\n /** `true` when the consumer set `totalCount()` (virtualized path). */\n readonly virtualized: () => boolean;\n /** Where auto-highlight should land. */\n readonly initialFocus: () => ForComboboxInitialFocus;\n /** Read the host's current activedescendant id (call inside `untracked`). */\n readonly getActiveId: () => string | null;\n /** Last id the bridge scrolled into view, to avoid re-scrolling on hover. */\n readonly getLastPositionedId: () => string | null;\n /** Persist the last id the bridge scrolled into view. */\n readonly setLastPositionedId: (id: string | null) => void;\n}\n\n/**\n * The **imperative tail** of the auto-highlight flow, run from the host's\n * constructor `effect`. The activedescendant *decision* is a pure derivation in\n * {@link createActiveIdSignal}; this only performs the side effects that escape\n * the reactive graph. It reacts to `items()`, `autoHighlight()` and `open()`:\n *\n * 1. Primes the label cache so its `linkedSignal` `prev` slot gets seeded while\n * the listbox is open — without an eager pull the lazy cache never runs\n * during the open cycle in non-virtualized usage and persistence across\n * close → re-open would start from an empty `prev`. The virtualization\n * navigator (and its position-map) is primed only when the consumer set\n * `totalCount()`, so a plain combobox never builds it.\n * 2. Virtualized only: resolves a pending `(scrollToIndex)` navigation — once\n * the option for the requested posInSet mounts, `tryResolvePending` seeds\n * activedescendant to its id and scrolls it into view. This is the single\n * sanctioned activedescendant write from an effect, and it is a legitimate\n * side effect (not state propagation): it integrates the consumer's\n * virtualizer mounting a row asynchronously, and it must win over the\n * auto-highlight seed — which is why the virtualized seed can't live in the\n * linkedSignal. `seedFromIndexedSnapshot` then seeds the topmost / bottommost\n * *rendered* enabled option (ordered by absolute `posInSet`) deliberately\n * passively — it only moves the pointer, never the consumer's scroll position.\n * 3. Non-virtualized: scrolls the auto-highlight-seeded option into view so a\n * seed that lands below the fold is visible, for parity with `navigate()`.\n * The seed itself comes from the linkedSignal; this is its imperative tail.\n * The activedescendant is read `untracked` so the scroll never re-triggers\n * the effect, and pointer-move hover doesn't reach here (it changes none of\n * the tracked reads), so hovering never scrolls. This handles a re-seed while\n * the listbox is already open (e.g. the consumer's filter dropped the active\n * option). The **initial open** scroll runs here too but is wiped a tick\n * later when `[forComboboxContent]` portals to `document.body` (which resets\n * `scrollTop`); `ForCombobox.scrollActiveOptionIntoView` re-applies it from\n * the positioner's first-resolved-position hook, after the portal move and\n * after the surface is sized (#1066).\n *\n * Internal — not re-exported from `combobox/index.ts` or `public-api.ts`.\n */\nexport function runAutoHighlightBridge<T>(deps: AutoHighlightBridgeDeps<T>): void {\n deps.labelCache.prime();\n const items = deps.items();\n const open = deps.open();\n const autoHighlight = deps.autoHighlight();\n const virtualized = deps.virtualized();\n\n if (virtualized) {\n const navigator = deps.requireNavigator();\n navigator.prime();\n if (navigator.tryResolvePending()) {\n return;\n }\n if (autoHighlight && open && untracked(() => deps.getActiveId()) === null && items.length > 0) {\n navigator.seedFromIndexedSnapshot(deps.initialFocus() === 'last' ? 'last' : 'first');\n }\n return;\n }\n\n if (!open) {\n deps.setLastPositionedId(null);\n return;\n }\n const activeId = untracked(() => deps.getActiveId());\n if (activeId === null || activeId === deps.getLastPositionedId()) {\n return;\n }\n const active = items.find((o) => o.id() === activeId);\n active?.host.scrollIntoView?.({ block: 'nearest' });\n deps.setLastPositionedId(activeId);\n}\n","import { computed, inject, InjectionToken, type ModelSignal, type Signal } from '@angular/core';\nimport type { ReferenceElement } from '@floating-ui/dom';\n\nimport {\n type CollectionHandle,\n type FloatingAlign,\n type FloatingSide,\n type WritingDirection,\n type VetoableNativeEvent,\n} from 'forty-cdk/core';\n\n/**\n * Why the combobox closed. Mirrors the menu / select vocabulary so consumers\n * can switch on the reason regardless of overlay flavor.\n */\nexport type ForComboboxCloseReason =\n | 'escape'\n | 'pointerDownOutside'\n | 'focusOutside'\n | 'select'\n | 'tab'\n | 'programmatic';\n\n/**\n * Autocomplete mode applied to the input. Mirrors the\n * [WAI-ARIA combobox autocomplete property](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/#wai-ariaroles,states,andproperties).\n *\n * - `'none'`: input acts as a free-text query; no completion is performed.\n * - `'list'`: the listbox shows filtered options; the input value reflects\n * the user's typed query verbatim.\n * - `'inline'`: the rest of the first matching option is auto-completed\n * into the input as selected text; the listbox does not auto-open.\n * - `'both'`: combines `'list'` and `'inline'` — listbox opens with the\n * filtered options *and* the first match auto-completes inline.\n */\nexport type ForComboboxAutocomplete = 'none' | 'list' | 'inline' | 'both';\n\n/**\n * Where the auto-highlight seed lands when the listbox opens. `'first'` / `'last'`\n * bias to the natural extreme (e.g. ArrowDown / ArrowUp on the trigger). `'selected'`\n * — used by the picker trigger's plain open — seeds the committed selection, falling\n * back to the first enabled option when there is no selection or it is filtered out.\n */\nexport type ForComboboxInitialFocus = 'first' | 'last' | 'selected';\n\nexport interface ForComboboxOptionHandle<T = unknown> extends CollectionHandle {\n readonly id: Signal<string>;\n readonly value: Signal<T>;\n readonly label: Signal<string>;\n readonly disabled: Signal<boolean>;\n /**\n * Index in the consumer's source array. Required when virtualizing so the\n * directive can fold off-screen options into the snapshot keyed by\n * absolute position. Optional otherwise — when absent the snapshot falls\n * back to DOM order.\n */\n readonly posInSet?: Signal<number | null>;\n}\n\nexport interface ForComboboxChipHandle<T = unknown> extends CollectionHandle {\n readonly value: Signal<T>;\n}\n\n/**\n * Coordination contract owned by `[forCombobox]`. Input, content, options,\n * groups, separators, the empty-state directive, the clear button, and the\n * multi-mode chip pieces all inject this token to read state and delegate\n * behavior.\n *\n * The value model is always an array — single mode (`multiple=false`,\n * default) keeps 0 or 1 element, multi mode keeps any number. This mirrors\n * `[forListbox]` / `[forSelect]` so consumers learn one selection contract\n * across the whole library.\n *\n * Generic over the option value type `T` (default `string`). When a\n * consumer binds object items the directive infers `T` from `[(value)]` and\n * the per-piece signatures specialize accordingly. Items are compared via\n * the consumer-provided `isItemEqualToValue` and rendered as labels via\n * `itemToStringLabel`; the form's hidden inputs serialize via\n * `itemToFormValue`.\n */\nexport interface ForComboboxContext<T = unknown> {\n readonly query: ModelSignal<string>;\n readonly value: ModelSignal<readonly T[]>;\n readonly open: ModelSignal<boolean>;\n\n readonly multiple: Signal<boolean>;\n /**\n * The combobox's effective disabled — its own `disabled` input OR'd with a\n * surrounding disabled `[forFieldset]`. Input, options, clear, and chip pieces\n * read this so a disabled combobox (or fieldset) is inert and exposes\n * `aria-disabled`.\n */\n readonly effectiveDisabled: Signal<boolean>;\n readonly readonly: Signal<boolean>;\n readonly required: Signal<boolean>;\n readonly invalid: Signal<boolean>;\n readonly pending: Signal<boolean>;\n readonly dir: Signal<WritingDirection>;\n\n readonly autocompleteMode: Signal<ForComboboxAutocomplete>;\n readonly openOnFocus: Signal<boolean>;\n readonly openOnQuery: Signal<boolean>;\n readonly commitOnSelect: Signal<boolean>;\n readonly clearOnQueryChange: Signal<boolean>;\n\n readonly dismissible: Signal<boolean>;\n /**\n * Whether focus returns to the `[forComboboxTrigger]` on close (picker\n * anatomy). Ignored in the editable anatomy, where focus never left the\n * input. Default `true`.\n */\n readonly returnFocus: Signal<boolean>;\n readonly side: Signal<FloatingSide | undefined>;\n readonly align: Signal<FloatingAlign>;\n readonly sideOffset: Signal<number>;\n readonly alignOffset: Signal<number>;\n readonly avoidCollisions: Signal<boolean>;\n readonly collisionPadding: Signal<number>;\n readonly arrowPadding: Signal<number>;\n readonly sticky: Signal<'partial' | 'always' | false>;\n readonly hideWhenDetached: Signal<boolean>;\n readonly clipUntilPositioned: Signal<boolean>;\n readonly loop: Signal<boolean>;\n\n readonly inputId: Signal<string>;\n readonly contentId: Signal<string>;\n /**\n * Id of the `[forComboboxList]` listbox surface (picker anatomy). The input's\n * `aria-controls` points here when a list is registered; without one it falls\n * back to {@link contentId} (the editable anatomy where content itself is the\n * listbox).\n */\n readonly listId: Signal<string>;\n /**\n * Id of the element carrying `role=\"listbox\"` — {@link listId} when a\n * `[forComboboxList]` is registered, otherwise {@link contentId}. The input\n * targets this with `aria-controls`.\n */\n readonly listboxId: Signal<string>;\n readonly ariaLabel: Signal<string | null>;\n\n /**\n * Element floating-ui anchors the listbox against. Prefers an optional\n * `[forComboboxAnchor]` when registered, otherwise falls back to the input.\n * Decoupled from `input` so the input keeps driving `aria-controls`,\n * `aria-activedescendant`, keyboard interaction, and its outside-pointer\n * exemption regardless of where the listbox paints.\n */\n readonly anchor: Signal<ReferenceElement | null>;\n readonly input: Signal<HTMLInputElement | null>;\n registerInput(el: HTMLInputElement): void;\n unregisterInput(el: HTMLInputElement): void;\n\n /**\n * Register / unregister an optional `[forComboboxAnchor]` positioning\n * element. At most one anchor per root; a second registration throws.\n * Reference-based unregister, so an anchor torn down inside `@if` restores\n * the input fallback cleanly.\n */\n registerAnchor(el: HTMLElement): void;\n unregisterAnchor(el: HTMLElement): void;\n\n /**\n * The optional `[forComboboxTrigger]` button (picker anatomy). When present\n * it is the default positioning anchor (after an explicit `[forComboboxAnchor]`)\n * and the element focus returns to on close. `null` in the editable anatomy.\n */\n readonly trigger: Signal<HTMLElement | null>;\n registerTrigger(el: HTMLElement): void;\n unregisterTrigger(el: HTMLElement): void;\n\n readonly content: Signal<HTMLElement | null>;\n registerContent(el: HTMLElement): void;\n unregisterContent(el: HTMLElement): void;\n\n /**\n * The optional `[forComboboxList]` listbox surface (picker anatomy). When\n * registered, `[forComboboxContent]` drops its `role=\"listbox\"` semantics and\n * becomes a neutral popup surface; the list carries the listbox role and owns\n * the options. `null` in the editable anatomy.\n */\n readonly list: Signal<HTMLElement | null>;\n /** True when a `[forComboboxList]` is registered (picker anatomy). */\n readonly hasList: Signal<boolean>;\n registerList(el: HTMLElement): void;\n unregisterList(el: HTMLElement): void;\n\n registerOption(handle: ForComboboxOptionHandle<T>): void;\n unregisterOption(handle: ForComboboxOptionHandle<T>): void;\n readonly options: Signal<readonly ForComboboxOptionHandle<T>[]>;\n\n /** Multi-mode chip collection. Order follows DOM (= `value()` order in practice). */\n registerChip(handle: ForComboboxChipHandle<T>): void;\n unregisterChip(handle: ForComboboxChipHandle<T>): void;\n readonly chips: Signal<readonly ForComboboxChipHandle<T>[]>;\n\n /**\n * Selected entries paired with their resolved label (from the option\n * cache) — convenient for rendering chips with `@for`. Falls back to\n * `itemToStringLabel(value)` when no matching option is registered (and\n * to the raw string when `T` is `string`).\n */\n readonly selected: Signal<readonly { value: T; label: string }[]>;\n\n /** Compare two items for equality. Defaults to `===`; overridden for object values. */\n readonly isItemEqualToValue: Signal<(a: T, b: T) => boolean>;\n /** Render an item as a string label. Drives chip labels and `commitOnSelect` writes into the input. */\n readonly itemToStringLabel: Signal<(item: T) => string>;\n /** Serialize an item for the hidden input's `value` attribute. */\n readonly itemToFormValue: Signal<(item: T) => string>;\n\n /** Id of the currently active option (drives `aria-activedescendant` on the input). */\n readonly activeId: Signal<string | null>;\n /** Set the activedescendant directly. Used by options on pointer-move and by the input on inline-completion seed. */\n setActiveId(id: string | null): void;\n /**\n * Scroll the current activedescendant option into view. Called by\n * `[forComboboxContent]` from the positioner's first-resolved-position hook so\n * the open-time auto-highlight seed survives the content portal move (which\n * resets `scrollTop`) and lands after the surface is sized. No-op while\n * virtualizing. See `scrollActiveOptionIntoView` on `ForCombobox`.\n */\n scrollActiveOptionIntoView(): void;\n /** Read-only access to the cached snapshot consumed by inline-autocomplete in the input directive. */\n cachedOptions(): readonly { id: string; value: T; label: string }[];\n\n /**\n * Total number of options in the consumer's source array. Used for\n * `aria-setsize` and for navigation past the visible window when\n * virtualizing. Falls back to `options().length` when undefined.\n */\n readonly totalCount: Signal<number | undefined>;\n /** Inclusive-exclusive [start, end) range of options currently rendered when virtualizing. */\n readonly visibleRange: Signal<readonly [number, number] | undefined>;\n\n /** True when `value` includes `v` per the active equality function. */\n isSelected(value: T): boolean;\n /** True when `id` is the activedescendant. */\n isActive(id: string): boolean;\n\n /**\n * Whether a pointer-suppression window is currently open. Opened whenever the\n * directive scrolls the active option into view during keyboard navigation,\n * so a synthetic `pointermove` fired because the scroll slid a different\n * option under a stationary cursor does not hijack the activedescendant.\n * Options consult this from their hover handler and skip the move while it\n * returns `true`.\n */\n isPointerSuppressed(): boolean;\n\n /**\n * Activate by handle. Single mode replaces + closes + commits label. Multi\n * mode toggles in/out + stays open + (when `commitOnSelect`) clears the\n * query so the user can search the next item. No-op on disabled / readonly.\n */\n activate(handle: ForComboboxOptionHandle<T>): void;\n\n /** Remove a value from `value()`. Used by chip-remove and Backspace heuristics. */\n removeValue(value: T): void;\n\n /** Move the activedescendant to the first / last / next / prev enabled option. */\n navigate(direction: 'next' | 'prev' | 'first' | 'last'): void;\n /** Activate the option currently marked as activedescendant (Enter from the input). */\n activateActive(): boolean;\n\n /** Set the typed query. Emits inline completion / openOnQuery side-effects via the input directive. */\n setQueryFromInput(query: string): void;\n\n /**\n * Clear value and (optionally) query. Used by `[forComboboxClear]` and\n * by the Backspace-on-empty-input heuristic. The query is reset only\n * when `clearQuery` is true.\n */\n clear(clearQuery?: boolean): void;\n\n /** Where focus should land after the listbox opens. The input directive sets this before flipping `open`. */\n readonly initialFocus: Signal<ForComboboxInitialFocus>;\n setInitialFocus(target: ForComboboxInitialFocus): void;\n\n toggle(): void;\n openMenu(initialFocus?: ForComboboxInitialFocus): void;\n closeMenu(reason: ForComboboxCloseReason): void;\n\n /**\n * The reason of the most recent close (or `null` before any close / after a\n * fresh open). `[forComboboxContent]` reads this so a `'tab'` close skips the\n * return-focus move — Tab has already advanced focus and re-focusing the\n * trigger would steal it back. Only meaningful in the picker anatomy.\n */\n readonly lastCloseReason: Signal<ForComboboxCloseReason | null>;\n\n /**\n * Fires the `(autoFocusOnOpen)` output and returns whether the consumer\n * vetoed (called `preventDefault()`). The picker anatomy moves focus into the\n * input on open; a veto skips that imperative move. Editable anatomy never\n * calls this (focus never moves).\n */\n emitAutoFocusOnOpen(): boolean;\n /**\n * Fires the `(autoFocusOnClose)` output and returns whether the consumer\n * vetoed. The picker anatomy returns focus to the trigger on close; a veto\n * skips it.\n */\n emitAutoFocusOnClose(): boolean;\n\n /**\n * Escape is consumer-owned and routed through the input directive (focus\n * stays in the input), so it is invoked directly with the raw\n * `KeyboardEvent` rather than through the dismissable layer.\n */\n emitEscapeKeyDown(event: KeyboardEvent): void;\n /**\n * Outside-interaction emit forwarders. `injectOverlayShell` builds and\n * reuses one `VetoableNativeEvent` across the specific and composite\n * channels, then hands it to these forwarders to fire the matching output\n * and calls `requestClose` when un-vetoed.\n */\n emitPointerDownOutside(veto: VetoableNativeEvent<PointerEvent>): void;\n emitFocusOutside(veto: VetoableNativeEvent<FocusEvent>): void;\n emitInteractOutside(veto: VetoableNativeEvent<PointerEvent | FocusEvent>): void;\n /** Implicit close requested by the shell after an un-vetoed outside interaction. */\n requestClose(reason: 'pointerDownOutside' | 'focusOutside'): void;\n\n /** Flip the `touched` model. Called by input on blur-to-outside and by dismiss events. */\n markTouched(): void;\n}\n\n/**\n * `ForCombobox<T>`'s generic does NOT flow to this token: an `InjectionToken`\n * is a single runtime instance, so it is published at `ForComboboxContext<unknown>`.\n * `injectComboboxContext<T>()` re-applies `T` with an `as unknown as` cast, and\n * each piece (input, option, chip) relies on consumer discipline — the\n * `[forComboboxOption][value]` and the root `[(value)]` must be the same `T`.\n * There is no clean fix without abandoning the token pattern; the contract is\n * the consumer's to honor. Object identity is reconciled at runtime via\n * `isItemEqualToValue`, which bounds the practical blast radius of a mismatch.\n */\nexport const FOR_COMBOBOX_CONTEXT = new InjectionToken<ForComboboxContext>('FOR_COMBOBOX_CONTEXT');\n\n/**\n * Resolve the surrounding combobox context, re-applying the caller's `T`. The\n * cast through `unknown` is unavoidable (see {@link FOR_COMBOBOX_CONTEXT}): the\n * token can't carry the per-instance generic, so `T` correctness is a\n * consumer-honored contract, not a compiler-enforced one.\n */\nexport function injectComboboxContext<T = unknown>(piece: string): ForComboboxContext<T> {\n const ctx = inject(FOR_COMBOBOX_CONTEXT, { optional: true });\n if (!ctx) {\n throw new Error(\n `[forty-cdk/combobox] ${piece} must be used inside a [forCombobox] element. ` +\n \"If it is declared inside an ng-template, DI resolves at the template's declaration site — \" +\n 'not where it is stamped (e.g. via ngTemplateOutlet) — so declare the template inside the ' +\n '[forCombobox] root.',\n );\n }\n return ctx as unknown as ForComboboxContext<T>;\n}\n\n/**\n * Resolves the trigger's root context: the explicit reference when the\n * `[forComboboxTrigger]` input carries one, the injected `FOR_COMBOBOX_CONTEXT`\n * otherwise. The orphan error only fires when neither resolves, on first read\n * of the returned signal. Must be called in an injection context.\n */\nexport function injectComboboxTriggerContext<T = unknown>(\n explicitRoot: Signal<ForComboboxContext<T> | ''>,\n): Signal<ForComboboxContext<T>> {\n const injected = inject(FOR_COMBOBOX_CONTEXT, { optional: true });\n return computed(() => {\n const explicit = explicitRoot();\n if (explicit !== '') {\n return explicit;\n }\n if (injected) {\n return injected as unknown as ForComboboxContext<T>;\n }\n throw new Error(\n '[forty-cdk/combobox] ForComboboxTrigger could not resolve its [forCombobox] root: ' +\n 'no FOR_COMBOBOX_CONTEXT provider is visible and no explicit root reference was passed. ' +\n \"If this trigger is declared inside an ng-template, DI resolves at the template's declaration \" +\n 'site — not where it is stamped — so either declare the template inside the root or pass the ' +\n 'root explicitly: [forComboboxTrigger]=\"root\" with #root=\"forCombobox\".',\n );\n });\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\n\n/**\n * Defaults inherited by descendant comboboxes in the surrounding injector\n * scope. Configure with `provideForComboboxDefaults` either at the\n * application root or in any component's `providers` array; partial\n * overrides merge with the parent scope.\n */\nexport interface ForComboboxDefaults {\n /**\n * Distance (px) between the combobox input/trigger and the floating\n * content along the resolved `side` axis, for comboboxes that don't\n * override `sideOffset` locally.\n */\n sideOffset: number;\n /**\n * Padding (px) added to the viewport edges for collision-aware\n * positioning, for comboboxes that don't override `collisionPadding`\n * locally. Higher values keep the floating content further from the edge\n * when `flip` / `shift` runs.\n */\n collisionPadding: number;\n}\n\n/**\n * Library fallback for combobox defaults, read at the root injector when no\n * consumer has called `provideForComboboxDefaults`. Exported for the shared\n * defaults contract spec; not re-exported from the primitive's public entry.\n */\nexport const FOR_COMBOBOX_FALLBACK_DEFAULTS: ForComboboxDefaults = {\n sideOffset: 4,\n collisionPadding: 8,\n};\n\nconst { token, provideDefaults } = createDefaults<ForComboboxDefaults>(\n 'FOR_COMBOBOX_DEFAULTS',\n FOR_COMBOBOX_FALLBACK_DEFAULTS,\n);\n\n/** Token holding the resolved combobox defaults for the current scope. */\nexport const FOR_COMBOBOX_DEFAULTS = token;\n\n/**\n * Configures forty-cdk combobox defaults for this injector scope. Partial\n * overrides inherit unspecified keys from the parent scope (or library\n * defaults at the root).\n */\nexport function provideForComboboxDefaults(\n defaults: Partial<ForComboboxDefaults> = {},\n): Provider[] {\n return provideDefaults(defaults);\n}\n","import { type Signal } from '@angular/core';\n\nimport { foldSnapshotOnTotalCountTransition, tryReadHandle } from './combobox-snapshot-fold';\nimport type { ForComboboxOptionHandle } from './combobox-context';\n\n/**\n * Plain entry in the label cache / position-keyed map. Mirrors what inline\n * autocomplete and the chip / `selected` fallback paths need: a stable id, the\n * underlying value, and the resolved label string.\n */\nexport interface SnapshotEntry<T> {\n readonly id: string;\n readonly value: T;\n readonly label: string;\n}\n\n/**\n * Always-on label cache for `ForCombobox`. Keeps a flat list of\n * `{ id, value, label }` tuples that persists across listbox close / open\n * cycles, driving inline autocomplete and the `selected` label fallback.\n *\n * Persistence: when the consumer's `@if` unmounts the content\n * (`items().length === 0`) the prior cache is carried over so chips outside\n * the listbox area and inline completion after close keep resolving labels.\n * Resets only when the consumer's `totalCount` transitions — a query / source\n * rebuild signal in the virtualized case (the shared stale-window invariant\n * lives in `combobox-snapshot-fold.ts`).\n *\n * The option's `label` is itself a `Signal<string>` so we never peek at\n * `textContent`. Internal helper — not re-exported from `combobox/index.ts`\n * or `public-api.ts`. Constructed once per host directive, on every combobox\n * (virtualized or not).\n */\nexport class OptionLabelCache<T> {\n readonly #cachedOptions: Signal<readonly SnapshotEntry<T>[]>;\n\n constructor(deps: {\n readonly items: Signal<readonly ForComboboxOptionHandle<T>[]>;\n readonly totalCount: Signal<number | undefined>;\n }) {\n this.#cachedOptions = foldSnapshotOnTotalCountTransition<\n ForComboboxOptionHandle<T>,\n readonly SnapshotEntry<T>[]\n >(\n deps.items,\n deps.totalCount,\n () => [],\n (prev, items) => {\n if (items.length === 0) {\n return prev;\n }\n const merged = new Map<string, SnapshotEntry<T>>();\n for (const entry of prev) {\n merged.set(entry.id, entry);\n }\n for (const item of items) {\n // A static option (rendered outside `@for`) registers before its\n // `[value]` binding is written; skip it this fold and pick it up on\n // the re-run the binding triggers. See `tryReadHandle`.\n const entry = tryReadHandle(() => ({\n id: item.id(),\n value: item.value(),\n label: item.label(),\n }));\n if (entry === null) {\n continue;\n }\n merged.set(entry.id, entry);\n }\n return [...merged.values()];\n },\n );\n }\n\n /**\n * Pull the cache so its `linkedSignal` `prev` slot gets seeded while the\n * listbox is open. Called from the host's bridge effect — without an eager\n * pull the lazy cache never runs during the open cycle (no other consumer\n * pulls it in non-virtualized usage), and persistence across close → re-open\n * would start from an empty `prev`.\n */\n prime(): void {\n this.#cachedOptions();\n }\n\n /**\n * Snapshot of the registered options as plain `{ id, value, label }` tuples.\n * Drives inline-autocomplete matching and the label-resolution fallback in\n * `ForCombobox.selected`.\n */\n entries(): readonly SnapshotEntry<T>[] {\n return this.#cachedOptions();\n }\n\n /**\n * Live entries merged with any off-window entries from the virtualized\n * position-map, so typeahead and inline autocomplete can match against\n * options scrolled out of view. Live entries take precedence (freshest data)\n * and appear first, followed by off-window indexed entries sorted by absolute\n * position. Pass an empty / zero-size map (the non-virtualized case) to get\n * the live entries unchanged.\n */\n mergedEntries(indexed: ReadonlyMap<number, SnapshotEntry<T>>): readonly SnapshotEntry<T>[] {\n const live = this.#cachedOptions();\n if (indexed.size === 0) {\n return live;\n }\n const seen = new Set(live.map((o) => o.id));\n const merged: SnapshotEntry<T>[] = [...live];\n const positions = [...indexed.keys()].sort((a, b) => a - b);\n for (const pos of positions) {\n const entry = indexed.get(pos)!;\n if (seen.has(entry.id)) {\n continue;\n }\n merged.push({ id: entry.id, value: entry.value, label: entry.label });\n }\n return merged;\n }\n}\n","import { type Signal } from '@angular/core';\n\nimport { VirtualizedNavigator as VirtualizedNavigatorCore } from 'forty-cdk/core';\nimport { tryReadHandle } from './combobox-snapshot-fold';\nimport type { ForComboboxOptionHandle } from './combobox-context';\nimport type { SnapshotEntry } from './combobox-label-cache';\n\n/**\n * Position-keyed entry. Adds the `disabled` flag so virtualized navigation can\n * skip over off-window disabled options.\n */\nexport interface IndexedSnapshotEntry<T> extends SnapshotEntry<T> {\n readonly disabled: boolean;\n}\n\n/**\n * Dependencies for `VirtualizedNavigator`. Wires the helper to the host\n * directive's signal graph + a small set of imperative callbacks. The host is\n * the only owner of the activedescendant, so the helper reads / writes it\n * through accessors instead of holding its own copy.\n */\nexport interface VirtualizedNavigatorDeps<T> {\n /** Live registered options. Same signal the host exposes as `options`. */\n readonly items: Signal<readonly ForComboboxOptionHandle<T>[]>;\n /** Total option count for the virtualized path. Always defined here. */\n readonly totalCount: Signal<number | undefined>;\n /** Inclusive-exclusive range of currently rendered options when virtualizing. */\n readonly visibleRange: Signal<readonly [number, number] | undefined>;\n /** Whether keyboard navigation wraps at the ends. */\n readonly loop: Signal<boolean>;\n /** Read the host's current activedescendant id. */\n readonly getActiveId: () => string | null;\n /** Write the host's activedescendant id. */\n readonly setActiveId: (id: string | null) => void;\n /** Forward a `(scrollToIndex)` request to the consumer's virtualizer. */\n readonly emitScrollToIndex: (idx: number) => void;\n /**\n * Scroll the active option's host into view, opening the host's\n * pointer-suppression window first so the scroll cannot hijack the\n * activedescendant via a synthetic `pointermove`.\n */\n readonly scrollActiveIntoView: (host: HTMLElement) => void;\n}\n\n/**\n * Virtualization navigation engine for `ForCombobox`. A thin adapter over the\n * shared `_internal/virtualized-navigator` engine. Maps the combobox option\n * handle (whose `posInSet` is optional) onto the engine's accessors, reads the\n * option through the single NG0950 read guard, and overrides scroll-into-view\n * with the host's pointer-suppression wrapper. Adds the combobox-only\n * auto-highlight seed that stays passive (never scrolls the window).\n *\n * Internal — not re-exported from `combobox/index.ts` or `public-api.ts`.\n */\nexport class VirtualizedNavigator<T> {\n readonly #deps: VirtualizedNavigatorDeps<T>;\n\n readonly #core: VirtualizedNavigatorCore<ForComboboxOptionHandle<T>, IndexedSnapshotEntry<T>>;\n\n constructor(deps: VirtualizedNavigatorDeps<T>) {\n this.#deps = deps;\n this.#core = new VirtualizedNavigatorCore(\n { ...deps, loop: deps.loop },\n {\n posOf: (o) => o.posInSet?.() ?? null,\n idOf: (o) => o.id(),\n hostOf: (o) => o.host,\n readEntry: (o) =>\n tryReadHandle(() => ({\n id: o.id(),\n value: o.value(),\n label: o.label(),\n disabled: o.disabled(),\n })),\n scrollIntoView: (host) => deps.scrollActiveIntoView(host),\n },\n { deferFoldOnTotalTransition: true },\n );\n }\n\n /** @see VirtualizedNavigator.prime */\n prime(): void {\n this.#core.prime();\n }\n\n /**\n * Position-keyed snapshot for `ForCombobox.selected`'s scrolled-out-of-view\n * fallback and for the merged-label lookup. Read-only for callers.\n */\n snapshotByPos(): ReadonlyMap<number, IndexedSnapshotEntry<T>> {\n return this.#core.snapshotByPos();\n }\n\n /** @see VirtualizedNavigator.tryResolvePending */\n tryResolvePending(): boolean {\n return this.#core.tryResolvePending();\n }\n\n /**\n * Auto-highlight the first or last enabled option that is **currently\n * rendered**, ordered by absolute `posInSet`. Used in the virtualized branch\n * of the host's auto-highlight effect — for non-virtualized lists the host\n * walks the live `items()` array directly. No-op if `totalCount` is unset /\n * zero or nothing is rendered.\n *\n * Deliberately *passive*: it only ever moves `aria-activedescendant`, never\n * the consumer's scroll position. Auto-highlight re-runs every time the\n * activedescendant is cleared, and scrolling the active option out of the\n * rendered window clears it (see `ForCombobox.unregisterOption`). If this\n * seed emitted `(scrollToIndex)` toward the absolute first option, every\n * wheel tick that unmounted the active row would snap the listbox straight\n * back to the top. Off-window targets are reached only through explicit\n * keyboard navigation (`navigate`), which owns scroll-into-view.\n */\n seedFromIndexedSnapshot(direction: 'first' | 'last'): void {\n const total = this.#deps.totalCount();\n if (total === undefined || total <= 0) {\n return;\n }\n const items = this.#deps.items();\n if (items.length === 0) {\n return;\n }\n const ordered = [...items].sort((a, b) => {\n const pa = a.posInSet?.() ?? 0;\n const pb = b.posInSet?.() ?? 0;\n return direction === 'last' ? pb - pa : pa - pb;\n });\n for (const item of ordered) {\n if (!item.disabled()) {\n this.#deps.setActiveId(item.id());\n return;\n }\n }\n }\n\n /** @see VirtualizedNavigator.navigate */\n navigate(direction: 'next' | 'prev' | 'first' | 'last'): void {\n this.#core.navigate(direction);\n }\n\n /**\n * Drop any pending virtualized navigation. Called by `closeMenu` so a\n * pending request from the previous open cycle doesn't seed activedescendant\n * after the listbox re-opens.\n */\n resetPending(): void {\n this.#core.resetPending();\n }\n}\n","import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n model,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport type { ReferenceElement } from '@floating-ui/dom';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport {\n Collection,\n type FloatingAlign,\n type FloatingSide,\n FormUiControlBase,\n injectHiddenInput,\n adoptHostId,\n IdGenerator,\n type WritingDirection,\n nextEnabledHandle,\n createPointerSuppression,\n type PointerSuppression,\n defaultItemToFormValue,\n isInArray,\n singleSelected,\n toggleInArray,\n injectTextDirection,\n emitVetoableEvent,\n emitVetoableNativeEvent,\n type VetoableEvent,\n type VetoableNativeEvent,\n} from 'forty-cdk/core';\nimport { createActiveIdSignal, runAutoHighlightBridge } from './combobox-auto-highlight';\nimport {\n FOR_COMBOBOX_CONTEXT,\n type ForComboboxAutocomplete,\n type ForComboboxChipHandle,\n type ForComboboxCloseReason,\n type ForComboboxContext,\n type ForComboboxInitialFocus,\n type ForComboboxOptionHandle,\n} from './combobox-context';\nimport { FOR_COMBOBOX_DEFAULTS } from './combobox-defaults';\nimport { OptionLabelCache } from './combobox-label-cache';\nimport { VirtualizedNavigator } from './combobox-virtualized-navigator';\n\n/**\n * Headless implementation of the [WAI-ARIA combobox with listbox popup pattern](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/).\n * Implements `FormValueControl<readonly T[]>` from `@angular/forms/signals`\n * for `[formField]` auto-wiring.\n *\n * Generic over the option value type `T` (default `string`). When the\n * consumer binds object items the directive infers `T` from `[(value)]`\n * and per-piece signatures (`[forComboboxOption][value]`,\n * `[forComboboxChip][value]`) specialize accordingly. Object identity is\n * resolved by the consumer-supplied `[isItemEqualToValue]` and labels by\n * `[itemToStringLabel]`; the hidden inputs serialize via\n * `[itemToFormValue]` (defaults to `JSON.stringify` for non-strings).\n *\n * Selection is always modeled as `readonly T[]`:\n * - In single mode (`multiple=false`, default), the array has 0 or 1\n * element and option activation closes the listbox.\n * - In multi mode, option activation toggles in/out and the listbox stays\n * open. Selected entries are typically rendered as chips inside\n * `[forComboboxChips]` next to the input.\n *\n * The visible input (\"query\") and the form value are separate two-way\n * bindable models — the consumer keeps them in sync via filtering /\n * display logic, and the primitive only commits to `value` when an option\n * is explicitly activated.\n *\n * Filtering is **always** the consumer's responsibility — the primitive is\n * headless and doesn't filter the registered options. Render the filtered\n * subset with `@for` and the registry tracks them automatically.\n */\n@Directive({\n selector: '[forCombobox]',\n exportAs: 'forCombobox',\n host: {\n '[attr.data-state]': 'open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'effectiveDisabled() ? \"\" : null',\n '[attr.dir]': 'dir()',\n '(focusout)': 'onFocusOut($event)',\n },\n providers: [{ provide: FOR_COMBOBOX_CONTEXT, useExisting: ForCombobox }],\n})\nexport class ForCombobox<T = string>\n extends FormUiControlBase\n implements FormValueControl<readonly T[]>, ForComboboxContext<T>\n{\n readonly #idGen = inject(IdGenerator);\n readonly #defaults = inject(FOR_COMBOBOX_DEFAULTS);\n readonly #items = new Collection<ForComboboxOptionHandle<T>>();\n readonly #chips = new Collection<ForComboboxChipHandle<T>>();\n\n /**\n * Two-way bindable. Visible input text. The `model()` change emitter\n * (`(queryChange)`) fires only on internal mutations (option activation\n * commit, `clear()`, multi-mode select reset, picker-anatomy reset on\n * close), never on consumer writes via `[(query)]`.\n */\n readonly query = model<string>('');\n\n /**\n * Two-way bindable. Selected option values. Single mode (`multiple=false`)\n * keeps 0 or 1 element; multi mode keeps any number. The `model()` change\n * emitter (`(valueChange)`) fires only on internal selection changes,\n * never on consumer writes via `[(value)]`.\n */\n readonly value = model<readonly T[]>([]);\n\n /**\n * Compare two items for equality. Defaults to `===`, which is the\n * correct identity for primitive `T` (e.g. strings, numbers). Override\n * when binding object items so the directive can locate selected /\n * removed entries by id (or any other stable key) instead of by\n * reference: `[isItemEqualToValue]=\"(a, b) => a.id === b.id\"`.\n */\n readonly isItemEqualToValue = input<(a: T, b: T) => boolean>((a, b) => a === b);\n\n /**\n * Render an item as a string label. Defaults to `String(item)`, which is\n * identity for strings. Drives the visible input text after activation\n * (when `commitOnSelect`) and the chip label fallback in multi mode.\n * Override when binding object items so the directive can fall back to\n * a meaningful label without relying on the option cache being warm:\n * `[itemToStringLabel]=\"(it) => it.name\"`.\n */\n readonly itemToStringLabel = input<(item: T) => string>((item) => String(item));\n\n /**\n * Serialize an item for the hidden input that participates in native\n * form submission. Defaults to identity for strings and to\n * `JSON.stringify` for non-string items so the primitive works out of\n * the box round-tripping objects. Override to emit a specific wire\n * format — typically a per-item id — when the backend expects that:\n * `[itemToFormValue]=\"(it) => it.id\"`.\n */\n readonly itemToFormValue = input<(item: T) => string>(defaultItemToFormValue);\n\n /**\n * Two-way bindable. Whether the listbox is currently shown. Internal\n * transitions: input typing (when `openOnQuery`), focus (when\n * `openOnFocus`), ArrowDown / ArrowUp, Escape, outside dismissal,\n * single-mode option activation.\n */\n readonly open = model<boolean>(false);\n\n readonly multiple = input(false, { transform: booleanAttribute });\n\n /**\n * Autocomplete mode applied to the input. Mirrors the\n * [WAI-ARIA `aria-autocomplete` property](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/#wai-ariaroles,states,andproperties)\n * and drives whether the listbox auto-opens on query and whether the\n * input gets inline-completed with the first match. Renamed from\n * `autocomplete` so consumers don't conflate it with the native HTML\n * `autocomplete` attribute (which the directive forces to `\"off\"`).\n */\n readonly autocompleteMode = input<ForComboboxAutocomplete>('list');\n\n /** Open the listbox when the input gains focus. Off by default — opening on query / arrow keys is the standard ecosystem behavior. */\n readonly openOnFocus = input(false, { transform: booleanAttribute });\n\n /** Open the listbox when the user starts typing. On by default. Only honored when `autocompleteMode` includes a listbox (`'list'` or `'both'`). */\n readonly openOnQuery = input(true, { transform: booleanAttribute });\n\n /**\n * In single mode, copy the activated option's label into `query`. In\n * multi mode, instead **clear** the query so the user can search the\n * next item. On by default in both. Set `false` to leave `query`\n * untouched on activation in either mode.\n *\n * Governs the **editable anatomy** only. In the picker anatomy (a\n * `[forComboboxTrigger]` is registered) the in-panel input is a transient\n * filter, not the value display: the single-mode label copy is always\n * skipped and `query` resets to `''` on close regardless of this flag.\n */\n readonly commitOnSelect = input(true, { transform: booleanAttribute });\n\n /** When the user edits the query, automatically clear the committed `value`. Off by default — most apps want the value preserved across query edits. Single-mode only. */\n readonly clearOnQueryChange = input(false, { transform: booleanAttribute });\n\n /**\n * Auto-highlight the first enabled option whenever the listbox is open\n * and no activedescendant is set (e.g. after the consumer's filter\n * removed the previously-active option). On by default. Set `false` for\n * \"user must arrow before anything is highlighted\" behavior.\n */\n readonly autoHighlight = input(true, { transform: booleanAttribute });\n\n /**\n * Writing direction. Drives chip-cluster keyboard navigation (ArrowLeft /\n * ArrowRight semantics swap in RTL so they follow the visual order, not DOM\n * order) and the default `align` of the listbox (anchors to the right edge\n * of the input in RTL). When unset (default `null`), the inherited ambient\n * direction is resolved from the nearest ancestor carrying a `dir` attribute\n * (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins\n * and the resolved value is reflected to the host `dir` attribute.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n\n /**\n * Side the listbox is anchored to. Defaults to `'bottom'`. Pair with\n * `align` for the full positioning API.\n */\n readonly side = input<FloatingSide | undefined>('bottom');\n\n /**\n * Alignment along the chosen `side`. When unset, defaults to `'start'`\n * in LTR and `'end'` in RTL (per `dir`). Set explicitly to pin an\n * alignment regardless of writing direction.\n *\n * The input is aliased to `align`; consumers bind `[align]=\"...\"` and\n * read the effective value via the public `align` computed below.\n */\n readonly _alignInput = input<FloatingAlign | undefined>(undefined, { alias: 'align' });\n readonly align = computed<FloatingAlign>(\n () => this._alignInput() ?? (this.dir() === 'rtl' ? 'end' : 'start'),\n );\n\n /** Gap (px) between input and listbox along the main axis. Default `4`. */\n readonly sideOffset = input(this.#defaults.sideOffset, { transform: numberAttribute });\n\n /** Gap (px) along the cross axis. Default `0`. */\n readonly alignOffset = input(0, { transform: numberAttribute });\n\n /** When `true` (default), `flip` and `shift` keep the listbox inside the viewport. */\n readonly avoidCollisions = input(true, { transform: booleanAttribute });\n\n /** Padding (px) applied uniformly to flip / shift / size. Default `8`. */\n readonly collisionPadding = input(this.#defaults.collisionPadding, {\n transform: numberAttribute,\n });\n\n /** Padding (px) for the `arrow` middleware. Default `0`. */\n readonly arrowPadding = input(0, { transform: numberAttribute });\n\n /** Stickiness behaviour for `shift`. Default `'partial'`. */\n readonly sticky = input<'partial' | 'always' | false>('partial');\n\n /** When `true`, sets `data-detached=\"\"` while the input is scrolled off-screen. */\n readonly hideWhenDetached = input(false, { transform: booleanAttribute });\n\n /**\n * When `true` (default), the content is clipped until floating-ui resolves\n * its first position, preventing a flash at the viewport corner. Set to\n * `false` so a dramatic `animate.enter` plays from its first frame (the\n * surface may flash briefly at the unresolved position while positioning\n * computes).\n */\n readonly clipUntilPositioned = input(true, { transform: booleanAttribute });\n readonly loop = input(true, { transform: booleanAttribute });\n\n /** When true (default), Escape, pointer-down outside, and focus outside close the listbox. */\n readonly dismissible = input(true, { transform: booleanAttribute });\n\n /**\n * When true (default), focus returns to the `[forComboboxTrigger]` on close.\n * Only relevant in the picker anatomy (a trigger is registered) — in the\n * editable anatomy focus never leaves the input, so there is nothing to\n * return.\n */\n readonly returnFocus = input(true, { transform: booleanAttribute });\n\n /** Manual `aria-label` on the listbox (`[forComboboxList]`, or `[forComboboxContent]` in the editable anatomy) when the input isn't a meaningful name. */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * Total number of options in the consumer's source array. Set when wiring\n * up a virtualized listbox (only the visible window is rendered) so the\n * directive can reflect `aria-setsize` and walk the snapshot for\n * navigation past the rendered range. Defaults to `undefined`, in which\n * case the directive falls back to `options().length` (the live registry).\n */\n readonly totalCount = input(undefined, {\n transform: (v: unknown): number | undefined => (v == null ? undefined : numberAttribute(v)),\n });\n\n /**\n * Inclusive-exclusive `[start, end)` range of options currently rendered\n * in the DOM. Used by `navigate()` to translate \"move to absolute\n * position N\" into either an in-window highlight update or a request to\n * the consumer to scroll N into view (`(scrollToIndex)`). When\n * `undefined` (default), navigation assumes every option in the snapshot\n * is rendered — appropriate for non-virtualized lists.\n */\n readonly visibleRange = input<readonly [number, number] | undefined>(undefined);\n\n /**\n * Emitted when keyboard navigation needs to land on an option whose\n * absolute index falls outside `visibleRange()`. Wire this to the\n * consumer's virtualizer (`scrollToIndex(idx)` on `@tanstack/virtual`,\n * `virtua`, etc.); once the option mounts, the directive seeds\n * `aria-activedescendant` automatically.\n */\n readonly scrollToIndex = output<number>();\n\n readonly escapeKeyDown = output<VetoableNativeEvent<KeyboardEvent>>();\n readonly pointerDownOutside = output<VetoableNativeEvent<PointerEvent>>();\n readonly focusOutside = output<VetoableNativeEvent<FocusEvent>>();\n readonly interactOutside = output<VetoableNativeEvent<PointerEvent | FocusEvent>>();\n\n /**\n * _(picker anatomy only)_ Fires just before focus moves into the input on\n * open. Call `preventDefault()` on the emitted veto to skip the imperative\n * focus move. Only emitted when a `[forComboboxTrigger]` is registered — the\n * editable anatomy keeps focus in the input the whole time and has no move to\n * veto.\n */\n readonly autoFocusOnOpen = output<VetoableEvent>();\n\n /**\n * _(picker anatomy only)_ Fires just before focus returns to the trigger on\n * close. Call `preventDefault()` on the veto to suppress the return-focus.\n */\n readonly autoFocusOnClose = output<VetoableEvent>();\n\n readonly inputId = signal(this.#idGen.next('for-combobox-input'));\n readonly contentId = signal(this.#idGen.next('for-combobox-content'));\n readonly listId = signal(this.#idGen.next('for-combobox-list'));\n\n readonly #inputEl = signal<HTMLInputElement | null>(null);\n readonly input = this.#inputEl.asReadonly();\n\n readonly #anchorEl = signal<HTMLElement | null>(null);\n readonly #triggerEl = signal<HTMLElement | null>(null);\n readonly trigger = this.#triggerEl.asReadonly();\n\n /**\n * Element floating-ui anchors the listbox against. Resolution order:\n * explicit `[forComboboxAnchor]` → `[forComboboxTrigger]` (picker anatomy) →\n * the input (editable anatomy fallback, so existing comboboxes keep their\n * behavior). Decoupled from `input` so the input keeps driving\n * `aria-controls`, `aria-activedescendant`, keyboard interaction, and its\n * dismissal exemption regardless of where the listbox paints.\n */\n readonly anchor = computed<ReferenceElement | null>(\n () => this.#anchorEl() ?? this.#triggerEl() ?? this.#inputEl(),\n );\n\n readonly #contentEl = signal<HTMLElement | null>(null);\n readonly content = this.#contentEl.asReadonly();\n\n readonly #listEl = signal<HTMLElement | null>(null);\n readonly list = this.#listEl.asReadonly();\n /** True once a `[forComboboxList]` has registered (picker anatomy). */\n readonly hasList = computed(() => this.#listEl() !== null);\n /**\n * Id of the element carrying `role=\"listbox\"`: the list when one is\n * registered (picker anatomy), otherwise the content surface (editable\n * anatomy). The input targets this with `aria-controls`.\n */\n readonly listboxId = computed(() => (this.hasList() ? this.listId() : this.contentId()));\n\n readonly options = this.#items.items;\n readonly chips = this.#chips.items;\n\n readonly #initialFocus = signal<ForComboboxInitialFocus>('first');\n readonly initialFocus = this.#initialFocus.asReadonly();\n\n readonly #lastCloseReason = signal<ForComboboxCloseReason | null>(null);\n readonly lastCloseReason = this.#lastCloseReason.asReadonly();\n\n /**\n * The activedescendant pointer. Built by {@link createActiveIdSignal} as a\n * `linkedSignal` so the highlight decision is a pure derivation, never a write\n * from an `effect`; it stays writable for the imperative moves that own their\n * own scroll (arrow / Home / End navigation, hover, multi-mode activation, and\n * the virtualized pending-nav resolution). The reset/seed rule lives with the\n * factory in `combobox-auto-highlight.ts`.\n */\n readonly #activeId = createActiveIdSignal<T>({\n query: this.query,\n open: this.open,\n autoHighlight: this.autoHighlight,\n virtualized: () => this.totalCount() !== undefined,\n initialFocus: this.#initialFocus,\n items: this.#items.items,\n value: this.value,\n equals: this.isItemEqualToValue,\n });\n readonly activeId = this.#activeId.asReadonly();\n\n #lastPositionedId: string | null = null;\n\n readonly #pointerSuppression: PointerSuppression = createPointerSuppression();\n\n /**\n * Always-on label cache — keeps `{ id, value, label }` tuples across\n * close/open and scroll-out-of-view to drive inline autocomplete matching\n * and the `selected` label fallback. See `combobox-label-cache.ts`.\n */\n readonly #labelCache = new OptionLabelCache<T>({\n items: this.#items.items,\n totalCount: this.totalCount,\n });\n\n /**\n * Virtualization navigation engine — constructed lazily the first time the\n * consumer sets `totalCount()`, so a non-virtualized combobox never pulls\n * the position-map machinery. Powers keyboard navigation past the rendered\n * window and the scrolled-out-of-view label fallback.\n */\n #navigator: VirtualizedNavigator<T> | null = null;\n\n #requireNavigator(): VirtualizedNavigator<T> {\n return (this.#navigator ??= new VirtualizedNavigator<T>({\n items: this.#items.items,\n totalCount: this.totalCount,\n visibleRange: this.visibleRange,\n loop: this.loop,\n getActiveId: () => this.#activeId(),\n setActiveId: (id) => this.#activeId.set(id),\n emitScrollToIndex: (idx) => this.scrollToIndex.emit(idx),\n scrollActiveIntoView: (host) => this.#scrollActiveIntoView(host),\n }));\n }\n\n readonly selected = computed<readonly { value: T; label: string }[]>(() => {\n const values = this.value();\n if (values.length === 0) {\n return [];\n }\n // `cachedOptions()` already merges off-window entries from the indexed\n // snapshot when virtualizing, so a selected option scrolled out of view\n // still resolves here without a separate position-map lookup.\n const cached = this.cachedOptions();\n const equals = this.isItemEqualToValue();\n const toLabel = this.itemToStringLabel();\n return values.map((v) => {\n const opt = cached.find((o) => equals(o.value, v));\n if (opt) {\n return { value: v, label: opt.label };\n }\n // Fall back to the consumer-provided label fn so non-string items\n // still render a meaningful string before the option cache warms up.\n return { value: v, label: typeof v === 'string' ? (v as string) : toLabel(v) };\n });\n });\n\n /**\n * Read-only single-select convenience view of {@link value}. Returns the\n * sole selected item when exactly one is selected, otherwise `null` (empty\n * selection, or multiple selections in `multiple` mode). Lets single-select\n * consumers read `selectedItem()` instead of unwrapping `value()[0]`. The\n * array-backed `value` model remains the source of truth and the\n * `FormValueControl` contract; this is a derived accessor. Distinct from\n * {@link selected}, which pairs every selected value with its resolved\n * label for chip rendering.\n */\n readonly selectedItem = singleSelected(this.value);\n\n protected override fieldLabelledElement(): HTMLElement | null {\n return this.input();\n }\n\n protected override fieldLabelledElementId(): string {\n return this.inputId();\n }\n\n constructor() {\n super();\n injectHiddenInput<T>({\n name: this.name,\n values: this.value,\n serialize: (item) => this.itemToFormValue()(item),\n disabled: this.effectiveDisabled,\n });\n\n // The activedescendant *decision* is a pure derivation in `#activeId`; this\n // effect runs only its imperative tail (label-cache priming, virtualized\n // pending-nav resolution + passive seed, non-virtualized scroll-into-view).\n // Full rationale lives with `runAutoHighlightBridge` in\n // `combobox-auto-highlight.ts`.\n effect(() => {\n runAutoHighlightBridge<T>({\n labelCache: this.#labelCache,\n requireNavigator: () => this.#requireNavigator(),\n items: this.#items.items,\n open: this.open,\n autoHighlight: this.autoHighlight,\n virtualized: () => this.totalCount() !== undefined,\n initialFocus: this.#initialFocus,\n getActiveId: () => this.#activeId(),\n getLastPositionedId: () => this.#lastPositionedId,\n setLastPositionedId: (id) => (this.#lastPositionedId = id),\n });\n });\n }\n\n registerInput(el: HTMLInputElement): void {\n adoptHostId(el, this.inputId);\n this.#inputEl.set(el);\n }\n unregisterInput(el: HTMLInputElement): void {\n if (this.#inputEl() === el) {\n this.#inputEl.set(null);\n }\n }\n\n registerAnchor(el: HTMLElement): void {\n const current = this.#anchorEl();\n if (current !== null && current !== el) {\n throw new Error(\n '[forty-cdk/combobox] Multiple [forComboboxAnchor] inside the same [forCombobox]; only one is allowed.',\n );\n }\n this.#anchorEl.set(el);\n }\n unregisterAnchor(el: HTMLElement): void {\n if (this.#anchorEl() === el) {\n this.#anchorEl.set(null);\n }\n }\n\n registerTrigger(el: HTMLElement): void {\n this.#triggerEl.set(el);\n }\n unregisterTrigger(el: HTMLElement): void {\n if (this.#triggerEl() === el) {\n this.#triggerEl.set(null);\n }\n }\n\n registerContent(el: HTMLElement): void {\n adoptHostId(el, this.contentId);\n this.#contentEl.set(el);\n }\n unregisterContent(el: HTMLElement): void {\n if (this.#contentEl() === el) {\n this.#contentEl.set(null);\n }\n }\n\n registerList(el: HTMLElement): void {\n adoptHostId(el, this.listId);\n this.#listEl.set(el);\n }\n unregisterList(el: HTMLElement): void {\n if (this.#listEl() === el) {\n this.#listEl.set(null);\n }\n }\n\n registerOption(handle: ForComboboxOptionHandle<T>): void {\n this.#items.register(handle);\n }\n unregisterOption(handle: ForComboboxOptionHandle<T>): void {\n this.#items.unregister(handle);\n if (this.#activeId() === handle.id()) {\n this.#activeId.set(null);\n }\n }\n\n registerChip(handle: ForComboboxChipHandle<T>): void {\n this.#chips.register(handle);\n }\n unregisterChip(handle: ForComboboxChipHandle<T>): void {\n this.#chips.unregister(handle);\n }\n\n isSelected(v: T): boolean {\n return isInArray(this.value(), v, this.isItemEqualToValue());\n }\n\n isActive(id: string): boolean {\n return this.#activeId() === id;\n }\n\n isPointerSuppressed(): boolean {\n return this.#pointerSuppression.isSuppressed();\n }\n\n activate(handle: ForComboboxOptionHandle<T>): void {\n if (this.effectiveDisabled() || this.readonly() || handle.disabled()) {\n return;\n }\n const v = handle.value();\n if (this.multiple()) {\n // Toggle in/out of the array. Stay open so the user can keep picking.\n this.value.set(toggleInArray(this.value(), v, this.isItemEqualToValue()));\n if (this.commitOnSelect()) {\n // Reset query so the next typed prefix searches afresh.\n this.query.set('');\n this.#syncInputValue('');\n }\n this.#activeId.set(handle.id());\n return;\n }\n // Single mode: replace + close + commit label.\n this.value.set([v]);\n if (this.commitOnSelect() && this.trigger() === null) {\n this.query.set(handle.label());\n this.#syncInputValue(handle.label());\n }\n this.closeMenu('select');\n }\n\n /**\n * Imperatively align the visible `<input>` text with `query()` even\n * while the input has focus. The directive's reactive sync skips\n * focused syncs to avoid clobbering inline-autocomplete selection\n * during typing — but activation / clear writes happen *outside* the\n * typing flow and should be visible immediately.\n */\n #syncInputValue(value: string): void {\n const el = this.#inputEl();\n if (el && el.value !== value) {\n el.value = value;\n }\n }\n\n removeValue(v: T): void {\n if (this.effectiveDisabled() || this.readonly()) {\n return;\n }\n const equals = this.isItemEqualToValue();\n const current = this.value();\n if (!current.some((x) => equals(x, v))) {\n return;\n }\n this.value.set(current.filter((x) => !equals(x, v)));\n }\n\n activateActive(): boolean {\n const id = this.#activeId();\n if (!id) {\n return false;\n }\n const handle = this.#items.items().find((o) => o.id() === id);\n if (!handle || handle.disabled()) {\n return false;\n }\n this.activate(handle);\n return true;\n }\n\n navigate(direction: 'next' | 'prev' | 'first' | 'last'): void {\n if (this.effectiveDisabled()) {\n return;\n }\n if (this.totalCount() !== undefined) {\n this.#requireNavigator().navigate(direction);\n return;\n }\n const items = this.#items.items();\n if (items.length === 0) {\n return;\n }\n const currentId = this.#activeId();\n const currentIndex = currentId === null ? -1 : items.findIndex((o) => o.id() === currentId);\n\n // No activedescendant yet + arrow nav: jump to the natural extreme\n // (ArrowDown → first enabled, ArrowUp → last enabled).\n let action = direction;\n if (currentIndex < 0 && direction === 'next') {\n action = 'first';\n } else if (currentIndex < 0 && direction === 'prev') {\n action = 'last';\n }\n\n const target = nextEnabledHandle(items, currentIndex, action, { loop: this.loop() });\n if (target === null) {\n return;\n }\n this.#activeId.set(target.id());\n this.#scrollActiveIntoView(target.host);\n this.#lastPositionedId = target.id();\n }\n\n setQueryFromInput(query: string): void {\n if (this.effectiveDisabled() || this.readonly()) {\n return;\n }\n this.query.set(query);\n if (this.clearOnQueryChange() && !this.multiple() && this.value().length > 0) {\n this.value.set([]);\n }\n const mode = this.autocompleteMode();\n const hasListbox = mode === 'list' || mode === 'both';\n if (this.openOnQuery() && hasListbox && query.length > 0 && !this.open()) {\n this.openMenu();\n }\n }\n\n setActiveId(id: string | null): void {\n this.#activeId.set(id);\n this.#lastPositionedId = id;\n }\n\n #scrollActiveIntoView(host: HTMLElement): void {\n this.#pointerSuppression.suppress();\n host.scrollIntoView?.({ block: 'nearest' });\n }\n\n /**\n * Scroll the current activedescendant option into view. Driven from\n * `[forComboboxContent]`'s positioner first-resolved-position hook\n * (`onFirstPosition`) — the only moment both prerequisites hold: the content\n * has been portaled to `document.body` (which resets the scroll container's\n * `scrollTop` to 0, wiping the seed scroll the auto-highlight bridge applied\n * during change detection) and `@floating-ui/dom`'s `size` middleware has\n * constrained the surface to its `max-height` (so it is actually scrollable).\n *\n * Re-applies the scroll unconditionally — the bridge already recorded this id\n * as positioned, but the portal move invalidated the real scroll position, so\n * the usual \"already positioned\" guard must not short-circuit here. Fires once\n * per open (the positioner hook is one-shot per run), so a later hover never\n * scrolls. No-op while virtualizing: the navigator owns the virtualized scroll\n * and the indexed seed is intentionally passive.\n */\n scrollActiveOptionIntoView(): void {\n if (this.totalCount() !== undefined) {\n return;\n }\n const id = this.#activeId();\n if (id === null) {\n return;\n }\n const active = this.#items.items().find((o) => o.id() === id);\n if (!active) {\n return;\n }\n active.host.scrollIntoView?.({ block: 'nearest' });\n this.#lastPositionedId = id;\n }\n\n readonly #cachedOptionsMemo = computed<readonly { id: string; value: T; label: string }[]>(() => {\n if (this.totalCount() === undefined) {\n return this.#labelCache.entries();\n }\n return this.#labelCache.mergedEntries(this.#requireNavigator().snapshotByPos());\n });\n\n cachedOptions(): readonly { id: string; value: T; label: string }[] {\n return this.#cachedOptionsMemo();\n }\n\n clear(clearQuery: boolean = true): void {\n if (this.effectiveDisabled() || this.readonly()) {\n return;\n }\n this.value.set([]);\n if (clearQuery) {\n this.query.set('');\n this.#syncInputValue('');\n }\n this.#activeId.set(null);\n }\n\n setInitialFocus(target: ForComboboxInitialFocus): void {\n this.#initialFocus.set(target);\n }\n\n toggle(): void {\n if (this.effectiveDisabled()) {\n return;\n }\n if (this.open()) {\n this.closeMenu('programmatic');\n } else {\n this.openMenu(this.trigger() !== null ? 'selected' : 'first');\n }\n }\n\n openMenu(initialFocus: ForComboboxInitialFocus = 'first'): void {\n if (this.effectiveDisabled() || this.open()) {\n return;\n }\n this.#initialFocus.set(initialFocus);\n this.#lastCloseReason.set(null);\n this.open.set(true);\n }\n\n closeMenu(reason: ForComboboxCloseReason): void {\n if (!this.open()) {\n return;\n }\n this.#lastCloseReason.set(reason);\n this.open.set(false);\n this.#activeId.set(null);\n this.#navigator?.resetPending();\n if (this.trigger() !== null) {\n this.query.set('');\n this.#syncInputValue('');\n }\n }\n\n /** Fire `(autoFocusOnOpen)` and report whether the consumer vetoed the focus move. */\n emitAutoFocusOnOpen(): boolean {\n return emitVetoableEvent(this.autoFocusOnOpen);\n }\n\n /** Fire `(autoFocusOnClose)` and report whether the consumer vetoed the return-focus. */\n emitAutoFocusOnClose(): boolean {\n return emitVetoableEvent(this.autoFocusOnClose);\n }\n\n emitEscapeKeyDown(event: KeyboardEvent): void {\n const vetoed = emitVetoableNativeEvent(this.escapeKeyDown, event);\n if (!vetoed && this.dismissible()) {\n event.stopPropagation();\n this.closeMenu('escape');\n }\n }\n\n /**\n * Outside-interaction emit forwarders. The shared `#pendingOutsideVeto`\n * reuse between the specific outside channels and the composite\n * `interactOutside` lives in `injectOverlayShell`; these only fire the\n * matching output with the veto the shell built.\n */\n emitPointerDownOutside(veto: VetoableNativeEvent<PointerEvent>): void {\n this.pointerDownOutside.emit(veto);\n }\n emitFocusOutside(veto: VetoableNativeEvent<FocusEvent>): void {\n this.focusOutside.emit(veto);\n }\n emitInteractOutside(veto: VetoableNativeEvent<PointerEvent | FocusEvent>): void {\n this.interactOutside.emit(veto);\n }\n\n /**\n * Implicit close requested by the shell after an un-vetoed outside\n * interaction. Marks the control touched and closes with the channel's\n * reason.\n */\n requestClose(reason: 'pointerDownOutside' | 'focusOutside'): void {\n this.markTouched();\n this.closeMenu(reason);\n }\n\n override markTouched(): void {\n super.markTouched();\n }\n\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as HTMLElement | null;\n const inputEl = this.#inputEl();\n const content = this.#contentEl();\n if (next) {\n if (inputEl && inputEl.contains(next)) {\n return;\n }\n if (content && content.contains(next)) {\n return;\n }\n // Focus moving to a chip (multi mode) is \"inside\" — chips are an\n // extension of the input area, not an outside boundary.\n const chips = this.#chips.items();\n for (const chip of chips) {\n if (chip.host.contains(next)) {\n return;\n }\n }\n }\n this.markTouched();\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Optional positioning anchor. When present, `[forComboboxContent]` is\n * positioned against this element instead of `[forComboboxInput]` — useful\n * when the input lives inside a decorated field box (padding, prefix icon,\n * clear button, chip cluster) and the listbox should match the visible field\n * rather than the inner `<input>`.\n *\n * Only positioning changes: the input still owns `aria-controls`,\n * `aria-expanded`, `aria-activedescendant`, keyboard interaction, and its\n * exemption from outside-pointer dismissal. If no anchor is registered the\n * listbox falls back to anchoring against the input, so existing usages are\n * unaffected.\n *\n * At most one `[forComboboxAnchor]` may be registered per `[forCombobox]`; a\n * second one throws.\n *\n * ```html\n * <div forCombobox [(value)]=\"v\" [(query)]=\"q\">\n * <div forComboboxAnchor class=\"field-box\">\n * <icon />\n * <input forComboboxInput />\n * <button class=\"clear\">×</button>\n * </div>\n * @if (open()) {\n * <div forComboboxContent>…</div>\n * }\n * </div>\n * ```\n */\n@Directive({\n selector: '[forComboboxAnchor]',\n exportAs: 'forComboboxAnchor',\n})\nexport class ForComboboxAnchor {\n readonly #ctx = injectComboboxContext('ForComboboxAnchor');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n registerHandle(\n this.#host.nativeElement,\n (el) => this.#ctx.registerAnchor(el),\n (el) => this.#ctx.unregisterAnchor(el),\n );\n }\n}\n","import { computed, Directive, effect, ElementRef, inject, input } from '@angular/core';\n\nimport { reflectDisabled } from 'forty-cdk/core';\nimport { type ForComboboxContext, injectComboboxTriggerContext } from './combobox-context';\n\n/**\n * Button that opens the listbox and keeps showing the committed selection\n * (label + icon) while the search input lives **inside** the panel — the\n * \"combobox with trigger\" / picker anatomy. Apply on\n * a real `<button>` so Space / Enter dispatch native click events that toggle\n * via `(click)`.\n *\n * Registering a trigger switches the combobox into the picker anatomy: it\n * becomes the default positioning anchor (after an explicit\n * `[forComboboxAnchor]`), focus moves into `[forComboboxInput]` on open and\n * returns to the trigger on close (the standard `(autoFocusOnOpen)` /\n * `(autoFocusOnClose)` vetoable hooks now fire), and `[forComboboxContent]`\n * expects an inner `[forComboboxList]` to carry the listbox role.\n *\n * Wires `aria-haspopup=\"listbox\"`, `aria-expanded`, and `aria-controls`\n * (pointing to the popup surface while open). Native `disabled` reflects\n * `effectiveDisabled` (single-purpose trigger). The trigger is exempt from the\n * popup's dismissable layer — clicks on it route through `(click)` instead of\n * racing an outside-pointer dismissal.\n *\n * The root is normally resolved via DI from the enclosing `[forCombobox]`.\n * When the trigger is declared inside an `ng-template` stamped into the root\n * (e.g. via `ngTemplateOutlet`), DI resolves at the template's declaration\n * site and misses the root — pass it explicitly through the selector input,\n * `routerLink`-style: `[forComboboxTrigger]=\"root\"` with `#root=\"forCombobox\"`.\n *\n * Keyboard:\n * - **Click / Enter / Space** — toggle (open moves focus into the input).\n * - **ArrowDown** — open with the first enabled option highlighted.\n * - **ArrowUp** — open with the last enabled option highlighted.\n */\n@Directive({\n selector: '[forComboboxTrigger]',\n exportAs: 'forComboboxTrigger',\n host: {\n type: 'button',\n '[attr.aria-haspopup]': '\"listbox\"',\n '[attr.aria-expanded]': 'ctx().open() ? \"true\" : \"false\"',\n '[attr.aria-controls]': 'ctx().open() ? ctx().contentId() : null',\n '[attr.data-state]': 'ctx().open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'ctx().effectiveDisabled() ? \"\" : null',\n '(click)': 'onClick()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForComboboxTrigger<T = unknown> {\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Optional explicit reference to the `[forCombobox]` root, named after the\n * selector `routerLink`-style. The bare valueless attribute keeps resolving\n * the enclosing root via DI; pass the root explicitly\n * (`[forComboboxTrigger]=\"root\"`, with `#root=\"forCombobox\"`) when the\n * trigger is declared in an `ng-template` stamped inside the root — DI\n * resolves at the template's declaration site, so the enclosing root is\n * invisible there. The empty string (what the valueless attribute yields) is\n * treated as unset.\n */\n readonly forComboboxTrigger = input<ForComboboxContext<T> | ''>('');\n\n protected readonly ctx = injectComboboxTriggerContext<T>(this.forComboboxTrigger);\n\n constructor() {\n const el = this.#host.nativeElement;\n // Registration is an imperative call into the resolved root's registry,\n // not state derivation — the effect only re-registers the element when the\n // resolved root changes (explicit reference swapped at runtime).\n effect((onCleanup) => {\n const ctx = this.ctx();\n ctx.registerTrigger(el);\n onCleanup(() => ctx.unregisterTrigger(el));\n });\n reflectDisabled(computed(() => this.ctx().effectiveDisabled()));\n }\n\n protected onClick(): void {\n this.ctx().toggle();\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.ctx().effectiveDisabled()) {\n return;\n }\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.ctx().openMenu('first');\n return;\n }\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.ctx().openMenu('last');\n }\n }\n}\n","import { computed, Directive, DOCUMENT, effect, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle, reflectDisabled } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * The combobox `<input role=\"combobox\">`. Owns the visible text and all\n * keyboard interaction. Apply on a real `<input>` so the browser's native\n * caret / selection semantics drive inline-autocomplete and so the form\n * still behaves like a text field for screen readers.\n *\n * Wires `aria-haspopup=\"listbox\"`, `aria-expanded`, `aria-controls`,\n * `aria-autocomplete`, and `aria-activedescendant` (per APG combobox).\n * Focus stays on the input — arrow keys move the listbox's *active\n * descendant* via id reference, never moving DOM focus into the listbox.\n *\n * Keyboard:\n * - **ArrowDown / ArrowUp** — open + move activedescendant.\n * - **Home / End** (when open) — first / last enabled option.\n * - **PageUp / PageDown** (when open) — first / last enabled option.\n * - **Enter** (when open) — activate the activedescendant; no-op otherwise.\n * - **Escape** (when open) — close (focus stays in input). On the\n * open→closed transition the input value is re-synced to `query()` even\n * while focused, so a consumer restoring the committed label from an\n * `(openChange)` handler renders without reaching for the DOM.\n * - **Tab** (when open) — close and let Tab flow to the next focusable.\n * - Printable keys: update `query` and (if `autocompleteMode` includes `'inline'`)\n * complete the rest of the first match in the input as selected text.\n */\n@Directive({\n selector: '[forComboboxInput]',\n exportAs: 'forComboboxInput',\n host: {\n type: 'text',\n role: 'combobox',\n autocomplete: 'off',\n autocorrect: 'off',\n spellcheck: 'false',\n '[id]': 'ctx.inputId()',\n '[attr.aria-haspopup]': '\"listbox\"',\n '[attr.aria-expanded]': 'ctx.open() ? \"true\" : \"false\"',\n '[attr.aria-controls]': 'ctx.open() ? ctx.listboxId() : null',\n '[attr.aria-autocomplete]': 'ariaAutocomplete()',\n '[attr.aria-activedescendant]': 'ctx.open() ? (ctx.activeId() ?? null) : null',\n '[attr.aria-disabled]': 'ctx.effectiveDisabled() ? \"true\" : null',\n '[attr.aria-readonly]': 'ctx.readonly() ? \"true\" : null',\n '[attr.aria-required]': 'ctx.required() ? \"true\" : null',\n '[attr.aria-invalid]': 'ctx.invalid() ? \"true\" : null',\n '[attr.aria-busy]': 'ctx.pending() ? \"true\" : null',\n '[attr.readonly]': 'ctx.readonly() ? \"\" : null',\n '[attr.data-state]': 'ctx.open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'ctx.effectiveDisabled() ? \"\" : null',\n '(input)': 'onInput($event)',\n '(compositionstart)': 'onCompositionStart()',\n '(compositionend)': 'onCompositionEnd()',\n '(keydown)': 'onKeyDown($event)',\n '(focus)': 'onFocus()',\n '(click)': 'onClick()',\n },\n})\nexport class ForComboboxInput {\n // The input doesn't introspect the value type — it reads/writes the\n // query string and reads cached labels for inline autocomplete.\n protected readonly ctx = injectComboboxContext<unknown>('ForComboboxInput');\n readonly #host = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n #composing = false;\n\n protected readonly ariaAutocomplete = computed(() => this.ctx.autocompleteMode());\n\n constructor() {\n registerHandle(\n this.#host.nativeElement,\n (el) => this.ctx.registerInput(el),\n (el) => this.ctx.unregisterInput(el),\n );\n reflectDisabled(this.ctx.effectiveDisabled);\n\n const doc = inject(DOCUMENT);\n\n // Sync DOM input.value to query() when the input doesn't currently have\n // focus (e.g. consumer set [(query)] programmatically, or option\n // activation copied the label into query via commitOnSelect). When the\n // input is focused the user is mid-edit; clobbering input.value would\n // jump the caret and break inline autocomplete state.\n //\n // The open→closed transition is the documented exception: the edit\n // session is over (Escape closes but keeps focus in the input, per APG),\n // so a consumer restoring the committed label — `query.set(label)` from an\n // `(openChange)` handler — must reach the DOM even while focused. The\n // caret-protection rationale no longer applies and a caret jump to the end\n // of the restored text is the expected outcome. `wasOpen` tracks the prior\n // open state to detect the edge; it's a plain transition latch, not derived\n // signal state.\n let wasOpen = this.ctx.open();\n effect(() => {\n const q = this.ctx.query();\n const closing = wasOpen && !this.ctx.open();\n wasOpen = this.ctx.open();\n\n const el = this.#host.nativeElement;\n if (el.value === q) {\n return;\n }\n if (doc.activeElement !== el || closing) {\n el.value = q;\n }\n });\n }\n\n protected onCompositionStart(): void {\n this.#composing = true;\n }\n\n protected onCompositionEnd(): void {\n this.#composing = false;\n if (this.ctx.effectiveDisabled() || this.ctx.readonly()) {\n return;\n }\n this.#syncQuery(true, false);\n }\n\n protected onInput(event: Event): void {\n if (this.ctx.effectiveDisabled() || this.ctx.readonly()) {\n return;\n }\n if (this.#composing) {\n return;\n }\n const inputEvent = event as InputEvent;\n const allowInline = !inputEvent.isComposing;\n const isDelete = (inputEvent.inputType ?? '').startsWith('delete');\n this.#syncQuery(allowInline, isDelete);\n }\n\n #syncQuery(allowInline: boolean, isDelete: boolean): void {\n const el = this.#host.nativeElement;\n\n // The \"user prefix\" is everything before the caret. After inline\n // autocomplete sets a selection on chars [prefixLen..end], typing replaces\n // the selection (caret lands right after the new char) so this still\n // captures the user's intent. On Backspace, the browser deletes the\n // selection without touching the prefix — re-completing here would mean\n // the user can never shorten the query, so we skip completion on delete.\n const caret = el.selectionStart ?? el.value.length;\n const prefix = el.value.slice(0, caret);\n\n const atEnd = caret === el.value.length;\n const mode = this.ctx.autocompleteMode();\n const inlineActive =\n allowInline &&\n !isDelete &&\n atEnd &&\n (mode === 'inline' || mode === 'both') &&\n prefix.length > 0;\n\n if (inlineActive) {\n this.ctx.setQueryFromInput(prefix);\n this.#applyInlineCompletion(prefix);\n } else {\n this.ctx.setQueryFromInput(el.value);\n }\n }\n\n #applyInlineCompletion(prefix: string): void {\n const cached = this.ctx.cachedOptions();\n const lower = prefix.toLowerCase();\n const match = cached.find((o) => o.label.toLowerCase().startsWith(lower));\n const el = this.#host.nativeElement;\n if (!match || match.label.toLowerCase() === lower) {\n // No completion to apply — strip any prior selection so the user's\n // prefix is plainly visible.\n if (el.value !== prefix) {\n el.value = prefix;\n }\n return;\n }\n // Use the option's full label as the visible text (preserving its case),\n // with chars [prefixLen..end] selected so the next keystroke replaces\n // the appended suggestion. Matches native browser autocomplete behavior.\n const composed = match.label;\n el.value = composed;\n el.setSelectionRange(prefix.length, composed.length);\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.ctx.effectiveDisabled()) {\n return;\n }\n\n // Multi-mode Backspace heuristic: an empty input sends focus to the\n // last chip so a second Backspace there removes it. Skip when there's a\n // non-empty selection in the input (the user's mid-edit) — Backspace falls\n // through to the native delete-char handler.\n if (\n event.key === 'Backspace' &&\n this.ctx.multiple() &&\n this.#host.nativeElement.value === '' &&\n !this.ctx.readonly() &&\n !this.ctx.effectiveDisabled()\n ) {\n const chips = this.ctx.chips();\n const last = chips[chips.length - 1];\n if (last) {\n event.preventDefault();\n last.host.focus();\n return;\n }\n }\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (!this.ctx.open()) {\n // Open with the natural extreme as the auto-highlight bias —\n // navigate('next') won't fire here because items aren't registered\n // yet; the root's `activeId` linkedSignal seeds the activedescendant\n // once the options register.\n this.ctx.openMenu('first');\n } else {\n this.ctx.navigate('next');\n }\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n if (!this.ctx.open()) {\n this.ctx.openMenu('last');\n } else {\n this.ctx.navigate('prev');\n }\n break;\n\n case 'Home':\n if (this.ctx.open()) {\n event.preventDefault();\n this.ctx.navigate('first');\n }\n break;\n\n case 'End':\n if (this.ctx.open()) {\n event.preventDefault();\n this.ctx.navigate('last');\n }\n break;\n\n case 'PageUp':\n if (this.ctx.open()) {\n event.preventDefault();\n this.ctx.navigate('first');\n }\n break;\n\n case 'PageDown':\n if (this.ctx.open()) {\n event.preventDefault();\n this.ctx.navigate('last');\n }\n break;\n\n case 'Enter':\n if (this.ctx.open() && this.ctx.activateActive()) {\n event.preventDefault();\n }\n break;\n\n case 'Escape':\n // Routed through emitEscapeKeyDown so the consumer's\n // (escapeKeyDown) output fires and can veto the close. We still\n // handle Escape inline (not via the dismissable layer) because\n // focus stays in the input — the Escape belongs to this input\n // and shouldn't bubble through nested layers before it sees it.\n if (this.ctx.open()) {\n event.preventDefault();\n this.ctx.emitEscapeKeyDown(event);\n }\n break;\n\n case 'Tab':\n if (this.ctx.open()) {\n this.ctx.closeMenu('tab');\n }\n // Don't preventDefault — Tab still flows to the next focusable.\n break;\n }\n }\n\n protected onFocus(): void {\n if (this.ctx.openOnFocus() && !this.ctx.open()) {\n this.ctx.openMenu();\n }\n }\n\n protected onClick(): void {\n // A click on the input while focused mirrors the focus-open intent —\n // useful when the user closed via Escape and wants to re-open without\n // typing or reaching for the keyboard.\n if (this.ctx.openOnFocus() && !this.ctx.open()) {\n this.ctx.openMenu();\n }\n }\n}\n","import { computed, Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle, injectOverlayShell, type OverlayShellConfig } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * The floating surface, portaled to `document.body` and positioned by\n * `@floating-ui/dom` against the anchor (explicit `[forComboboxAnchor]` →\n * `[forComboboxTrigger]` → input).\n *\n * Two anatomies, picked by whether an inner `[forComboboxList]` is present:\n *\n * - **Editable (no list)** — content itself carries `role=\"listbox\"`,\n * `tabindex=\"-1\"`, `aria-multiselectable`, `aria-setsize`, and the labelled\n * role (`aria-label` / `aria-labelledby`). The input's `aria-controls` points\n * here. This is the original combobox; nothing about it changes.\n * - **Picker (list present)** — content drops the listbox semantics and becomes\n * a neutral popup surface; `[forComboboxList]` takes over the listbox role and\n * owns the options, the input lives inside the panel, and the input's\n * `aria-controls` points to the list. Keeps `data-state` and the positioner +\n * dismissable layer unchanged.\n *\n * Mount/unmount of the visible content is the consumer's responsibility —\n * wrap with `@if (open())` so `animate.enter` / `animate.leave` fire on the\n * natural mount cycle. While mounted, a `DismissableLayer` activates for\n * pointer-down outside / focus outside; the input and (picker anatomy) the\n * trigger are exempt from outside checks.\n *\n * Focus:\n * - **Editable anatomy** — focus stays in the input across the whole open\n * lifecycle; the directive never moves DOM focus and exposes no focus hooks.\n * Active-option highlighting is `aria-activedescendant`-driven.\n * - **Picker anatomy** — on open, focus moves into the input (the search field\n * inside the panel); on close it returns to the trigger. Both moves are\n * vetoable via `(autoFocusOnOpen)` / `(autoFocusOnClose)` on `[forCombobox]`,\n * and the return is gated by `[returnFocus]`. Escape stays owned by the input.\n *\n * The lifecycle (positioner + dismissable layer, plus the picker anatomy's\n * focus bundles) is owned by the shared `injectOverlayShell` helper.\n */\n@Directive({\n selector: '[forComboboxContent]',\n exportAs: 'forComboboxContent',\n host: {\n '[attr.role]': 'hasList() ? null : \"listbox\"',\n '[attr.tabindex]': 'hasList() ? null : \"-1\"',\n '[id]': 'ctx.contentId()',\n '[attr.aria-labelledby]': 'hasList() ? null : (ctx.ariaLabel() ? null : ctx.inputId())',\n '[attr.aria-label]': 'hasList() ? null : ctx.ariaLabel()',\n '[attr.aria-multiselectable]': 'hasList() ? null : (ctx.multiple() ? \"true\" : null)',\n '[attr.aria-setsize]': 'hasList() ? null : ariaSetSize()',\n '[attr.data-state]': 'ctx.open() ? \"open\" : \"closed\"',\n },\n})\nexport class ForComboboxContent {\n protected readonly ctx = injectComboboxContext('ForComboboxContent');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** When a `[forComboboxList]` is registered the listbox semantics live there, not here. */\n protected readonly hasList = this.ctx.hasList;\n\n /**\n * Reflects `aria-setsize` when the consumer wires up `[totalCount]` for\n * virtualization (editable anatomy only — the picker anatomy's list owns it).\n * Falls back to `null` (omitted) otherwise — leaving the default\n * option-count semantics screen readers already infer.\n */\n protected readonly ariaSetSize = computed<string | null>(() => {\n const total = this.ctx.totalCount();\n return total === undefined ? null : String(total);\n });\n\n constructor() {\n const ctx = this.ctx;\n registerHandle(\n this.#host.nativeElement,\n (el) => ctx.registerContent(el),\n (el) => ctx.unregisterContent(el),\n );\n\n // The picker anatomy opts back into the shell's focus bundles. `trigger()`\n // is read once on construction: the trigger renders outside the `@if (open())`\n // that gates this content, so it has already registered by the time the\n // surface mounts. Without a trigger (editable anatomy) the bundles are\n // omitted entirely and focus stays in the input — byte-for-byte unchanged.\n const hasTrigger = ctx.trigger() !== null;\n\n const config: OverlayShellConfig = {\n positioner: {\n kind: 'floating',\n reference: ctx.anchor,\n open: ctx.open,\n side: ctx.side,\n align: ctx.align,\n sideOffset: ctx.sideOffset,\n alignOffset: ctx.alignOffset,\n avoidCollisions: ctx.avoidCollisions,\n collisionPadding: ctx.collisionPadding,\n arrowPadding: ctx.arrowPadding,\n sticky: ctx.sticky,\n hideWhenDetached: ctx.hideWhenDetached,\n clipUntilPositioned: ctx.clipUntilPositioned,\n onFirstPosition: () => ctx.scrollActiveOptionIntoView(),\n },\n dismiss: {\n dismissible: ctx.dismissible,\n requestClose: (reason) => ctx.requestClose(reason),\n // Escape is handled by the input directive (focus stays in the\n // input, so Escape there shouldn't bubble through nested layers\n // before the input sees it). Omitted here intentionally.\n emitPointerDownOutside: (veto) => ctx.emitPointerDownOutside(veto),\n emitFocusOutside: (veto) => ctx.emitFocusOutside(veto),\n emitInteractOutside: (veto) => ctx.emitInteractOutside(veto),\n // The input owns the visible focus and toggles via its own click /\n // focus handlers; the trigger (picker anatomy) toggles via its own\n // click handler. Without exemption a pointer-down on either would race\n // the dismissal layer.\n exemptElements: () => {\n const els: Element[] = [];\n const input = ctx.input();\n if (input) els.push(input);\n const trigger = ctx.trigger();\n if (trigger) els.push(trigger);\n return els;\n },\n },\n // Picker anatomy only: move focus into the input on open, return it to the\n // trigger on close. Editable anatomy keeps focus in the input throughout,\n // so both bundles stay absent (no imperative move, no hooks).\n ...(hasTrigger\n ? {\n initialFocus: {\n move: () => {\n const input = ctx.input();\n if (input) {\n input.focus();\n return true;\n }\n return false;\n },\n veto: () => ctx.emitAutoFocusOnOpen(),\n },\n returnFocus: {\n enabled: ctx.returnFocus,\n target: () => ctx.trigger(),\n veto: () => ctx.emitAutoFocusOnClose(),\n // Tab already advanced focus past the closing surface; re-focusing\n // the trigger would steal it back.\n skip: () => ctx.lastCloseReason() === 'tab',\n },\n }\n : {}),\n };\n\n injectOverlayShell(config);\n }\n}\n","import { computed, Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * The `role=\"listbox\"` element of the picker anatomy. Nest it inside\n * `[forComboboxContent]` next to `[forComboboxInput]` so the popup surface can\n * hold a search field without violating `aria-required-owned-elements` (a\n * `listbox` may only own `option` / `group` children). The list owns the\n * options; `[forComboboxContent]` becomes a neutral popup surface.\n *\n * ```html\n * <div forComboboxContent>\n * <input forComboboxInput />\n * <div forComboboxList>\n * @for (item of filtered(); track item.id) {\n * <div forComboboxOption [value]=\"item\">{{ item.label }}</div>\n * }\n * </div>\n * </div>\n * ```\n *\n * Carries `role=\"listbox\"`, `tabindex=\"-1\"` (focus stays in the input,\n * activedescendant-driven), `aria-multiselectable` in multi mode,\n * `aria-setsize` when virtualizing, and the labelled-role `aria-label` /\n * `aria-labelledby`. Its id is what the input's `aria-controls` references in\n * the picker anatomy.\n *\n * When no `[forComboboxList]` is present, `[forComboboxContent]` itself carries\n * the listbox semantics (the editable anatomy) — this part is additive and\n * non-breaking.\n */\n@Directive({\n selector: '[forComboboxList]',\n exportAs: 'forComboboxList',\n host: {\n role: 'listbox',\n tabindex: '-1',\n '[id]': 'ctx.listId()',\n '[attr.aria-labelledby]': 'ctx.ariaLabel() ? null : ctx.inputId()',\n '[attr.aria-label]': 'ctx.ariaLabel()',\n '[attr.aria-multiselectable]': 'ctx.multiple() ? \"true\" : null',\n '[attr.aria-setsize]': 'ariaSetSize()',\n },\n})\nexport class ForComboboxList {\n protected readonly ctx = injectComboboxContext('ForComboboxList');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Reflects `aria-setsize` when the consumer wires up `[totalCount]` for\n * virtualization. Falls back to `null` (omitted) otherwise.\n */\n protected readonly ariaSetSize = computed<string | null>(() => {\n const total = this.ctx.totalCount();\n return total === undefined ? null : String(total);\n });\n\n constructor() {\n registerHandle(\n this.#host.nativeElement,\n (el) => this.ctx.registerList(el),\n (el) => this.ctx.unregisterList(el),\n );\n }\n}\n","import {\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n InjectionToken,\n input,\n} from '@angular/core';\n\nimport { registerHandle, hostId } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Injection key the `[forComboboxIndicator]` uses to resolve its parent\n * option, decoupled from the concrete `ForComboboxOption` class.\n * `ForComboboxOption` provides itself under this token, so a design system\n * wrapping the option by subclassing re-points it at the subclass with a\n * single provider (`{ provide: FOR_COMBOBOX_OPTION, useExisting: MtxComboboxOption }`)\n * and the indicator keeps resolving — see `docs/wrapping-form-primitives.md`.\n */\nexport const FOR_COMBOBOX_OPTION = new InjectionToken<ForComboboxOption>('FOR_COMBOBOX_OPTION');\n\n/**\n * One option inside a `[forComboboxContent]`. Apply on whatever element\n * fits the design — typically a `<div>` or `<li>`. Click activates:\n * single mode replaces `[(value)]` and closes the listbox; multi mode\n * toggles the value in/out and keeps the listbox open.\n *\n * Generic over the option value type `T` (default `string`). Inferred from\n * the `[value]` binding so consumers can pass either primitive ids or\n * full objects (`[value]=\"city\"` infers `T = City`); the parent\n * `[forCombobox]` must be parameterized over the same `T`.\n *\n * `aria-selected` reflects different things in single vs. multi:\n * - **Single mode**: the option that's the current activedescendant\n * (Enter would activate it). Matches APG select-only-combobox.\n * - **Multi mode**: every option currently in `value()` carries\n * `aria-selected=\"true\"` (multiple \"selected\" entries simultaneously).\n * Matches APG multi-select combobox.\n *\n * `data-state=\"checked\" | \"unchecked\"` always reflects membership in\n * `value()` regardless of mode, so consumers can paint a checkmark with\n * pure CSS in either mode. `data-highlighted` marks the option that is\n * the current activedescendant — shared across the\n * library's roving / activedescendant primitives.\n *\n * Hovering an option also makes it the activedescendant, mirroring native\n * menu / select behavior so mouse and keyboard intent stay synchronized.\n */\n@Directive({\n selector: '[forComboboxOption]',\n exportAs: 'forComboboxOption',\n providers: [{ provide: FOR_COMBOBOX_OPTION, useExisting: ForComboboxOption }],\n host: {\n role: 'option',\n '[id]': 'id()',\n '[attr.aria-selected]': 'ariaSelected()',\n '[attr.aria-disabled]': 'effectiveDisabled() ? \"true\" : null',\n '[attr.aria-posinset]': 'ariaPosInSet()',\n '[attr.aria-setsize]': 'ariaSetSize()',\n '[attr.data-state]': 'selected() ? \"checked\" : \"unchecked\"',\n '[attr.data-highlighted]': 'highlighted() ? \"\" : null',\n '[attr.data-disabled]': 'effectiveDisabled() ? \"\" : null',\n '(click)': 'onClick()',\n '(pointermove)': 'onPointerMove()',\n },\n})\nexport class ForComboboxOption<T = string> {\n readonly #ctx = injectComboboxContext<T>('ForComboboxOption');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Stable identifier serialized into `[(value)]` and the hidden input.\n * Defaults to `string` for back-compat; bind an object to specialize\n * the parent `[forCombobox]` over a richer `T`. The parent's\n * `[isItemEqualToValue]` decides how options are matched against the\n * committed selection.\n */\n readonly value = input.required<T>();\n\n /**\n * Visible label used by `[forComboboxInput]` for inline autocomplete\n * matching, by `commitOnSelect` to populate the input on selection,\n * and by typeahead / display utilities. When omitted: for string\n * `value` falls back to the trimmed `textContent` of the host element;\n * for object `value` falls back to the parent's `itemToStringLabel(value)`.\n */\n readonly label = input<string | null>(null);\n\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /**\n * Absolute index of this option in the consumer's source array. Required\n * when wiring up a virtualized listbox so navigation past the rendered\n * window can resolve indices to options (and emit `(scrollToIndex)` when\n * needed). Leave `null` for non-virtualized lists — the directive then\n * falls back to DOM order.\n */\n readonly posInSet = input<number | null>(null);\n\n readonly id = hostId('for-combobox-option');\n\n readonly selected = computed(() => this.#ctx.isSelected(this.value()));\n /** True when this option is the current activedescendant. Reflected as `data-highlighted`. */\n readonly highlighted = computed(() => this.#ctx.isActive(this.id()));\n readonly effectiveDisabled = computed(() => this.disabled() || this.#ctx.effectiveDisabled());\n\n protected readonly ariaSelected = computed(() => {\n if (this.#ctx.multiple()) {\n return this.selected() ? 'true' : 'false';\n }\n return this.highlighted() ? 'true' : 'false';\n });\n\n /** Reflects `aria-posinset` (1-based) when virtualizing. Falls back to DOM order otherwise. */\n protected readonly ariaPosInSet = computed<string | null>(() => {\n const explicit = this.posInSet();\n if (explicit !== null) {\n return String(explicit + 1);\n }\n if (this.#ctx.totalCount() === undefined) {\n return null;\n }\n const items = this.#ctx.options();\n const idx = items.findIndex((it) => it.id() === this.id());\n return idx < 0 ? null : String(idx + 1);\n });\n\n /** Reflects `aria-setsize` when the consumer wires up `[totalCount]`. */\n protected readonly ariaSetSize = computed<string | null>(() => {\n const total = this.#ctx.totalCount();\n return total === undefined ? null : String(total);\n });\n\n readonly #effectiveLabel = computed(() => {\n const explicit = this.label();\n if (explicit !== null) {\n return explicit;\n }\n const v = this.value();\n if (typeof v === 'string') {\n // String mode: the trimmed `textContent` is the canonical fallback,\n // identical to the pre-generic behaviour. Lets consumers omit\n // `[label]` and have it just work for projected text.\n return (this.#host.nativeElement.textContent ?? '').trim();\n }\n // Object mode: lean on the parent's `itemToStringLabel` so the\n // resolved label is consistent with chip rendering and `commitOnSelect`.\n return this.#ctx.itemToStringLabel()(v);\n });\n\n readonly #handle = {\n host: this.#host.nativeElement,\n id: this.id,\n value: this.value,\n label: this.#effectiveLabel,\n disabled: this.effectiveDisabled,\n posInSet: this.posInSet,\n };\n\n constructor() {\n registerHandle(\n this.#handle,\n (h) => this.#ctx.registerOption(h),\n (h) => this.#ctx.unregisterOption(h),\n );\n }\n\n protected onClick(): void {\n if (this.effectiveDisabled() || this.#ctx.readonly()) {\n return;\n }\n this.#ctx.activate(this.#handle);\n }\n\n protected onPointerMove(): void {\n if (this.effectiveDisabled() || this.#ctx.isPointerSuppressed()) {\n return;\n }\n if (!this.#ctx.isActive(this.id())) {\n this.#ctx.setActiveId(this.id());\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\n\nimport { FOR_COMBOBOX_OPTION, type ForComboboxOption } from './combobox-option';\n\n/**\n * Visibility helper inside a `[forComboboxOption]`. The directive flips a\n * `[hidden]` host binding so the consumer can keep the checkmark / icon\n * inline without extra `@if` glue:\n *\n * ```html\n * <div forComboboxOption value=\"apple\">\n * <span forComboboxIndicator>✓</span>\n * Apple\n * </div>\n * ```\n *\n * Reflects the parent option's `data-state` (`\"checked\" | \"unchecked\"`) so\n * the consumer can also style it from CSS. Visibility while unselected is\n * enforced with an inline `display: none` (which beats any author `display`\n * rule a consumer applies via a class) in addition to the `hidden` attribute\n * that removes it from the a11y tree.\n *\n * In multi mode the indicator follows membership in `value()`, matching the\n * option's own `data-state` semantics (a checkmark per selected option).\n */\n@Directive({\n selector: '[forComboboxIndicator]',\n exportAs: 'forComboboxIndicator',\n host: {\n 'aria-hidden': 'true',\n '[attr.data-state]': 'option.selected() ? \"checked\" : \"unchecked\"',\n '[hidden]': '!option.selected()',\n '[style.display]': 'option.selected() ? null : \"none\"',\n },\n})\nexport class ForComboboxIndicator {\n protected readonly option = injectParentOption();\n}\n\nfunction injectParentOption(): ForComboboxOption {\n const option = inject(FOR_COMBOBOX_OPTION, { optional: true });\n if (!option) {\n throw new Error(\n '[forty-cdk/combobox] ForComboboxIndicator must be used inside a [forComboboxOption] element.',\n );\n }\n return option;\n}\n","import { computed, Directive } from '@angular/core';\n\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Empty-state slot, shown when the listbox has no registered options.\n * The directive hides the message when options exist so the consumer can\n * keep it inline in the template — no `@if` needed. Visibility is enforced\n * with an inline `display: none` (which beats any author `display` rule a\n * consumer applies via a class) in addition to the `hidden` attribute that\n * removes it from the a11y tree:\n *\n * ```html\n * <div forComboboxContent>\n * @for (option of filtered(); track option.id) {\n * <div forComboboxOption [value]=\"option.id\">{{ option.label }}</div>\n * }\n * <div forComboboxEmpty>No matches.</div>\n * </div>\n * ```\n *\n * Carries `role=\"status\"` and `aria-live=\"polite\"` so screen readers\n * announce the message when it appears.\n */\n@Directive({\n selector: '[forComboboxEmpty]',\n exportAs: 'forComboboxEmpty',\n host: {\n role: 'status',\n 'aria-live': 'polite',\n '[hidden]': '!shouldShow()',\n '[style.display]': 'shouldShow() ? null : \"none\"',\n },\n})\nexport class ForComboboxEmpty {\n readonly #ctx = injectComboboxContext('ForComboboxEmpty');\n protected readonly shouldShow = computed(() => this.#ctx.options().length === 0);\n}\n","import { computed, Directive } from '@angular/core';\n\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Live-region slot for async-filtering feedback (loading, result count,\n * \"no matches\", error messages). Apply on a `<div>` inside the listbox or\n * next to the input. The directive sets `role=\"status\"` and\n * `aria-live=\"polite\"` so messages projected as content are announced to\n * screen readers when they change.\n *\n * The directive is **content-driven** — it does not pick or render a\n * message. Project whatever the consumer wants and use the exposed\n * `count` signal (or `forComboboxStatus` template ref) to interpolate\n * the option count when relevant.\n *\n * ```html\n * <div forCombobox [(query)]=\"query\" [(value)]=\"value\" [(open)]=\"open\">\n * <input forComboboxInput placeholder=\"Search…\" />\n * @if (open()) {\n * <div forComboboxContent>\n * <div forComboboxStatus #status=\"forComboboxStatus\">\n * @if (loading()) {\n * Searching…\n * } @else if (status.count() === 0) {\n * No matches.\n * } @else {\n * {{ status.count() }} results.\n * }\n * </div>\n * @for (it of filtered(); track it.id) {\n * <div forComboboxOption [value]=\"it.id\">{{ it.label }}</div>\n * }\n * </div>\n * }\n * </div>\n * ```\n *\n * For an empty-only slot that auto-hides when there are options, use\n * `[forComboboxEmpty]`. `[forComboboxStatus]` stays mounted regardless\n * so transitions like \"loading → 5 results\" are announced as a single\n * change to the same live region.\n */\n@Directive({\n selector: '[forComboboxStatus]',\n exportAs: 'forComboboxStatus',\n host: {\n role: 'status',\n 'aria-live': 'polite',\n 'aria-atomic': 'true',\n },\n})\nexport class ForComboboxStatus {\n readonly #ctx = injectComboboxContext('ForComboboxStatus');\n\n /**\n * Number of currently registered options. Reflects the live size of the\n * filtered listbox so the consumer can interpolate `{{ status.count() }}`\n * inside the live region.\n */\n readonly count = computed(() => this.#ctx.options().length);\n}\n","import { computed, Directive } from '@angular/core';\n\nimport { reflectDisabled } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Optional clear button. Apply on a `<button type=\"button\">` so Space /\n * Enter dispatch a native click. Clicking calls `clear()` on the root,\n * which resets `[(value)]` and `[(query)]` and the activedescendant.\n *\n * The directive hides the button when there's nothing to clear (no value,\n * empty query) so the consumer can leave it inline in the template without\n * an extra `@if`. Visibility is enforced with an inline `display: none`\n * (which beats any author `display` rule a consumer applies via a class) in\n * addition to the `hidden` attribute that removes it from the a11y tree.\n */\n@Directive({\n selector: '[forComboboxClear]',\n exportAs: 'forComboboxClear',\n host: {\n type: 'button',\n 'aria-label': 'Clear',\n '[hidden]': '!hasContent()',\n '[style.display]': 'hasContent() ? null : \"none\"',\n '[attr.tabindex]': '-1',\n '(click)': 'onClick()',\n },\n})\nexport class ForComboboxClear {\n protected readonly ctx = injectComboboxContext('ForComboboxClear');\n\n protected readonly hasContent = computed(\n () => this.ctx.value().length > 0 || this.ctx.query().length > 0,\n );\n\n /** Disabled when the combobox is disabled or read-only — the clear action is unavailable. */\n protected readonly isDisabled = computed(\n () => this.ctx.effectiveDisabled() || this.ctx.readonly(),\n );\n\n constructor() {\n reflectDisabled(this.isDisabled);\n }\n\n protected onClick(): void {\n if (this.isDisabled()) {\n return;\n }\n this.ctx.clear(true);\n // Restore focus to the input so the user can keep typing without\n // chasing the caret.\n this.ctx.input()?.focus();\n }\n}\n","import { Directive, input } from '@angular/core';\n\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * Multi-mode chips area. Wrap the chips and the `<input>` together so the\n * combobox visually presents a single editable region:\n *\n * ```html\n * <div forCombobox multiple [(value)]=\"tags\" [(query)]=\"query\" [(open)]=\"open\">\n * <div forComboboxChips>\n * @for (chip of selected(); track chip.value) {\n * <span forComboboxChip [value]=\"chip.value\">\n * {{ chip.label }}\n * <button forComboboxChipRemove></button>\n * </span>\n * }\n * <input forComboboxInput />\n * </div>\n * …\n * </div>\n * ```\n *\n * Carries `role=\"group\"` with `aria-label=\"Selected items\"` (override via\n * `[ariaLabel]`) so screen readers announce the chip cluster as a single\n * unit. The directive itself doesn't manage focus or selection — the\n * chips and the input own that — but its presence groups them for\n * assistive tech.\n */\n@Directive({\n selector: '[forComboboxChips]',\n exportAs: 'forComboboxChips',\n host: {\n role: 'group',\n '[attr.aria-label]': 'ariaLabel()',\n },\n})\nexport class ForComboboxChips {\n protected readonly ctx = injectComboboxContext('ForComboboxChips');\n\n /**\n * Accessible name for the chip cluster, exposed as `role=\"group\"`'s\n * `aria-label` so screen readers announce the selected chips as a single\n * unit. Defaults to `'Selected items'`; set `[ariaLabel]` to localize or\n * override it.\n */\n readonly ariaLabel = input<string | null>('Selected items');\n}\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\n\n/**\n * One chip representing a selected value in multi mode. Apply on a\n * `<span>` (or any inline-block element) inside `[forComboboxChips]`.\n * The chip is **out of the Tab cycle** (`tabindex=\"-1\"`) by design:\n * the user reaches it via the input's Backspace heuristic (Backspace on\n * an empty input focuses the last chip), then navigates between chips\n * with ArrowLeft / ArrowRight or removes them with Backspace / Delete.\n *\n * Keyboard while the chip has focus (LTR; the ArrowLeft/Right roles swap\n * in RTL so they always follow visual order):\n * - **ArrowLeft** — focus the previous chip; bounces if first.\n * - **ArrowRight** — focus the next chip; if at the last, focus the input.\n * - **Backspace / Delete** — remove this chip + focus the previous chip,\n * or the next chip when there is no previous one (so removing the first\n * chip lands on the new first chip), falling back to the input only when\n * the removed chip was the last one standing.\n * - **Escape** — return focus to the input.\n *\n * Click on the chip body (excluding the remove button) just focuses the\n * chip — useful as an alternative to the Backspace path.\n */\n@Directive({\n selector: '[forComboboxChip]',\n exportAs: 'forComboboxChip',\n host: {\n tabindex: '-1',\n '[attr.data-value]': 'dataValue()',\n '[attr.data-disabled]': 'ctx.effectiveDisabled() ? \"\" : null',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForComboboxChip<T = string> {\n protected readonly ctx = injectComboboxContext<T>('ForComboboxChip');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The value this chip represents — must match an entry in\n * `[forCombobox][(value)]` per the parent's `[isItemEqualToValue]`.\n * Generic over `T` (default `string`); inferred from the binding\n * (`[value]=\"someObject\"` specializes `T`).\n */\n readonly value = input.required<T>();\n\n /**\n * `data-value` reflection — for string `T` this is the value verbatim\n * (unchanged from the pre-generic behaviour); for object `T` it uses\n * the parent's `itemToFormValue` so the attribute carries the same\n * wire format as the hidden inputs (typically JSON or a per-item id).\n */\n protected readonly dataValue = computed(() => {\n const v = this.value();\n return typeof v === 'string' ? (v as string) : this.ctx.itemToFormValue()(v);\n });\n\n /** Resolved label of the underlying option, used by `[forComboboxChipRemove]` for its `aria-label`. */\n readonly label = computed(() => {\n const v = this.value();\n const equals = this.ctx.isItemEqualToValue();\n const cached = this.ctx.cachedOptions().find((o) => equals(o.value, v));\n if (cached) {\n return cached.label;\n }\n return typeof v === 'string' ? (v as string) : this.ctx.itemToStringLabel()(v);\n });\n\n constructor() {\n const handle = {\n host: this.#host.nativeElement,\n value: this.value,\n };\n registerHandle(\n handle,\n (h) => this.ctx.registerChip(h),\n (h) => this.ctx.unregisterChip(h),\n );\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.ctx.effectiveDisabled() || this.ctx.readonly()) {\n return;\n }\n const chips = this.ctx.chips();\n const index = chips.findIndex((c) => c.host === this.#host.nativeElement);\n if (index < 0) {\n return;\n }\n\n // In RTL the chip cluster lays out right-to-left, so ArrowRight must\n // move to the visually-next chip (= DOM-previous) and ArrowLeft to the\n // visually-previous one (= DOM-next), with the input sitting at the\n // visual leftmost edge.\n const rtl = this.ctx.dir() === 'rtl';\n const prevKey = rtl ? 'ArrowRight' : 'ArrowLeft';\n const nextKey = rtl ? 'ArrowLeft' : 'ArrowRight';\n\n switch (event.key) {\n case prevKey: {\n event.preventDefault();\n const prev = chips[index - 1];\n if (prev) {\n prev.host.focus();\n }\n break;\n }\n case nextKey: {\n event.preventDefault();\n const next = chips[index + 1];\n if (next) {\n next.host.focus();\n } else {\n // At the last chip (visual edge in either direction) — hop to the input.\n this.ctx.input()?.focus();\n }\n break;\n }\n case 'Backspace':\n case 'Delete': {\n event.preventDefault();\n const v = this.value();\n const prev = chips[index - 1];\n const next = chips[index + 1];\n this.ctx.removeValue(v);\n // Keep focus inside the chip cluster whenever a neighbour survives the\n // removal: prefer the previous chip, otherwise the next one (which\n // slides into the freed slot — so removing the first chip lands on the\n // new first chip rather than ejecting the user to the input). Only drop\n // focus into the input when the removed chip was the last one standing,\n // so the user can keep typing without chasing the caret.\n if (prev) {\n prev.host.focus();\n } else if (next) {\n next.host.focus();\n } else {\n this.ctx.input()?.focus();\n }\n break;\n }\n case 'Escape': {\n event.preventDefault();\n this.ctx.input()?.focus();\n break;\n }\n }\n }\n}\n","import { computed, Directive, inject } from '@angular/core';\n\nimport { reflectDisabled } from 'forty-cdk/core';\nimport { injectComboboxContext } from './combobox-context';\nimport { ForComboboxChip } from './combobox-chip';\n\n/**\n * Remove button inside a `[forComboboxChip]`. Apply on a\n * `<button type=\"button\">` so click and Space / Enter (when focused) all\n * trigger the same removal flow. The button is out of the Tab cycle\n * (`tabindex=\"-1\"`) so the user navigates the chip cluster via the chip's\n * own ArrowLeft/Right + Backspace/Delete keys; this button exists for\n * mouse / touch users.\n *\n * The host carries a generated `aria-label` (\"Remove `<chip label>`\")\n * derived from the parent chip's resolved option label.\n */\n@Directive({\n selector: '[forComboboxChipRemove]',\n exportAs: 'forComboboxChipRemove',\n host: {\n type: 'button',\n tabindex: '-1',\n '[attr.aria-label]': 'ariaLabel()',\n '(click)': 'onClick($event)',\n },\n})\nexport class ForComboboxChipRemove {\n // The value type is opaque to chip-remove: it just forwards whatever the\n // parent chip exposes back into `removeValue`. At runtime the chip and\n // the parent `[forCombobox]` share the same `T` because the consumer\n // binds them with the same value source.\n protected readonly ctx = injectComboboxContext<unknown>('ForComboboxChipRemove');\n readonly #chip = inject<ForComboboxChip<unknown>>(ForComboboxChip, { optional: true });\n\n /** Disabled when the combobox is disabled or read-only — chip removal is unavailable. */\n protected readonly isDisabled = computed(\n () => this.ctx.effectiveDisabled() || this.ctx.readonly(),\n );\n\n constructor() {\n if (!this.#chip) {\n throw new Error(\n '[forty-cdk/combobox] ForComboboxChipRemove must be used inside a [forComboboxChip] element.',\n );\n }\n reflectDisabled(this.isDisabled);\n }\n\n protected readonly ariaLabel = computed(() => `Remove ${this.#chip!.label()}`);\n\n protected onClick(event: MouseEvent): void {\n if (this.isDisabled()) {\n return;\n }\n // Don't let the click bubble up to the chip body — that would trigger\n // its keyboard-triggered handlers in some browsers via synthesized events.\n event.stopPropagation();\n this.ctx.removeValue(this.#chip!.value());\n // Restore focus to the input so the user can continue typing.\n this.ctx.input()?.focus();\n }\n}\n","import { Directive, signal } from '@angular/core';\n\n/**\n * Optional grouping wrapper inside a `[forComboboxContent]`. Renders\n * `role=\"group\"` and references the descendant `[forComboboxGroupLabel]`\n * (if any) via `aria-labelledby`. Options inside a group still register\n * with the root listbox normally, so keyboard navigation traverses across\n * groups in DOM order without special handling.\n */\n@Directive({\n selector: '[forComboboxGroup]',\n exportAs: 'forComboboxGroup',\n host: {\n role: 'group',\n '[attr.aria-labelledby]': 'labelId() || null',\n },\n})\nexport class ForComboboxGroup {\n readonly #labelId = signal<string | null>(null);\n\n /** The id of the registered group label (or `null` if none). */\n readonly labelId = this.#labelId.asReadonly();\n\n /** Called by `ForComboboxGroupLabel` on mount. */\n registerLabel(id: string): void {\n this.#labelId.set(id);\n }\n\n /** Called by `ForComboboxGroupLabel` on destroy. Idempotent. */\n unregisterLabel(id: string): void {\n if (this.#labelId() === id) {\n this.#labelId.set(null);\n }\n }\n}\n","import { Directive, inject, type Signal } from '@angular/core';\n\nimport { registerA11yName } from 'forty-cdk/core';\nimport { ForComboboxGroup } from './combobox-group';\n\n/**\n * Visible label for a `[forComboboxGroup]`. Generates a stable id and\n * registers with its parent group so the group's `aria-labelledby` points\n * at this element.\n */\n@Directive({\n selector: '[forComboboxGroupLabel]',\n exportAs: 'forComboboxGroupLabel',\n host: {\n '[id]': 'id()',\n },\n})\nexport class ForComboboxGroupLabel {\n /** Stable host id used by the parent group's `aria-labelledby`. */\n readonly id: Signal<string>;\n\n constructor() {\n const group = inject(ForComboboxGroup, { optional: true });\n if (!group) {\n throw new Error(\n '[forty-cdk/combobox] ForComboboxGroupLabel must be used inside a [forComboboxGroup] element.',\n );\n }\n this.id = registerA11yName(group, 'for-combobox-group-label');\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Decorative separator between options or groups inside a\n * `[forComboboxContent]`. Carries `role=\"separator\"` and is intentionally\n * not registered with the listbox's option collection, so keyboard\n * navigation skips it automatically.\n */\n@Directive({\n selector: '[forComboboxSeparator]',\n exportAs: 'forComboboxSeparator',\n host: {\n role: 'separator',\n 'aria-orientation': 'horizontal',\n },\n})\nexport class ForComboboxSeparator {}\n","/**\n * Exact public names of every `ForCombobox` input, its models included. Spread it into the\n * `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the\n * primitive's full surface — the Signal Forms members `[formField]` binds among them —\n * without hand-maintaining the list. Always spread into an inline object literal as shown\n * below: the literal is what keeps the entry statically analyzable for consumers compiling\n * against the published package. An anti-drift spec fails when this list no longer matches\n * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported\n * wrapping patterns.\n *\n * @example\n * ```ts\n * @Component({\n * selector: 'div[myCombobox]',\n * template: '',\n * hostDirectives: [\n * {\n * directive: ForCombobox,\n * inputs: [...FOR_COMBOBOX_HOST_DIRECTIVE_INPUTS],\n * outputs: [...FOR_COMBOBOX_HOST_DIRECTIVE_OUTPUTS],\n * },\n * ],\n * })\n * export class MyCombobox {}\n * ```\n */\nexport const FOR_COMBOBOX_HOST_DIRECTIVE_INPUTS = [\n 'query',\n 'value',\n 'open',\n 'align',\n 'alignOffset',\n 'ariaLabel',\n 'arrowPadding',\n 'autoHighlight',\n 'autocompleteMode',\n 'avoidCollisions',\n 'clearOnQueryChange',\n 'clipUntilPositioned',\n 'collisionPadding',\n 'commitOnSelect',\n 'dir',\n 'dirty',\n 'disabled',\n 'dismissible',\n 'errors',\n 'hideWhenDetached',\n 'invalid',\n 'isItemEqualToValue',\n 'itemToFormValue',\n 'itemToStringLabel',\n 'loop',\n 'multiple',\n 'name',\n 'openOnFocus',\n 'openOnQuery',\n 'pending',\n 'readonly',\n 'required',\n 'returnFocus',\n 'side',\n 'sideOffset',\n 'sticky',\n 'totalCount',\n 'visibleRange',\n 'touched',\n] as const;\n\n/**\n * Exact public names of every `ForCombobox` output, the Signal Forms `touch` output\n * included. Spread it into the `outputs` array of the same `hostDirectives` entry as\n * {@link FOR_COMBOBOX_HOST_DIRECTIVE_INPUTS}.\n */\nexport const FOR_COMBOBOX_HOST_DIRECTIVE_OUTPUTS = [\n 'queryChange',\n 'valueChange',\n 'openChange',\n 'scrollToIndex',\n 'escapeKeyDown',\n 'pointerDownOutside',\n 'focusOutside',\n 'interactOutside',\n 'autoFocusOnOpen',\n 'autoFocusOnClose',\n 'touchedChange',\n 'touch',\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["VirtualizedNavigatorCore"],"mappings":";;;;AAAA;;;;;;;AAOG;;ACwCH;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACG,SAAU,oBAAoB,CAAI,MAAyB,EAAA;AAC/D,IAAA,OAAO,YAAY,CAYjB;AACA,QAAA,MAAM,EAAE,OAAO;AACb,YAAA,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;AACrB,YAAA,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE;AACnB,YAAA,aAAa,E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