@skra/ui 0.4.0 → 0.6.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/consumer-guide/README.md +88 -85
- package/consumer-guide/custom-components.md +154 -0
- package/consumer-guide/wrapping-patterns.md +98 -90
- package/fesm2022/skra-ui-accordion.mjs +2 -2
- package/fesm2022/skra-ui-accordion.mjs.map +1 -1
- package/fesm2022/skra-ui-alert.mjs +2 -2
- package/fesm2022/skra-ui-alert.mjs.map +1 -1
- package/fesm2022/skra-ui-avatar.mjs.map +1 -1
- package/fesm2022/skra-ui-badge.mjs.map +1 -1
- package/fesm2022/skra-ui-button.mjs +2 -2
- package/fesm2022/skra-ui-button.mjs.map +1 -1
- package/fesm2022/skra-ui-checkbox.mjs +2 -2
- package/fesm2022/skra-ui-checkbox.mjs.map +1 -1
- package/fesm2022/skra-ui-chip.mjs +2 -2
- package/fesm2022/skra-ui-chip.mjs.map +1 -1
- package/fesm2022/skra-ui-combobox.mjs +120 -120
- package/fesm2022/skra-ui-combobox.mjs.map +1 -1
- package/fesm2022/skra-ui-core.mjs +64 -39
- package/fesm2022/skra-ui-core.mjs.map +1 -1
- package/fesm2022/skra-ui-counter.mjs.map +1 -1
- package/fesm2022/skra-ui-datepicker.mjs +605 -190
- package/fesm2022/skra-ui-datepicker.mjs.map +1 -1
- package/fesm2022/skra-ui-dialog.mjs.map +1 -1
- package/fesm2022/skra-ui-field.mjs.map +1 -1
- package/fesm2022/skra-ui-icon.mjs.map +1 -1
- package/fesm2022/skra-ui-input.mjs +2 -2
- package/fesm2022/skra-ui-input.mjs.map +1 -1
- package/fesm2022/skra-ui-kbd.mjs.map +1 -1
- package/fesm2022/skra-ui-layout.mjs.map +1 -1
- package/fesm2022/skra-ui-link.mjs +2 -2
- package/fesm2022/skra-ui-link.mjs.map +1 -1
- package/fesm2022/skra-ui-loading-indicator.mjs.map +1 -1
- package/fesm2022/skra-ui-menu.mjs +40 -16
- package/fesm2022/skra-ui-menu.mjs.map +1 -1
- package/fesm2022/skra-ui-multi-select.mjs +94 -94
- package/fesm2022/skra-ui-multi-select.mjs.map +1 -1
- package/fesm2022/skra-ui-native-select.mjs +2 -2
- package/fesm2022/skra-ui-native-select.mjs.map +1 -1
- package/fesm2022/skra-ui-popover.mjs +25 -9
- package/fesm2022/skra-ui-popover.mjs.map +1 -1
- package/fesm2022/skra-ui-progress.mjs.map +1 -1
- package/fesm2022/skra-ui-radio.mjs +2 -2
- package/fesm2022/skra-ui-radio.mjs.map +1 -1
- package/fesm2022/skra-ui-rating-display.mjs +2 -2
- package/fesm2022/skra-ui-rating-display.mjs.map +1 -1
- package/fesm2022/skra-ui-select.mjs +92 -92
- package/fesm2022/skra-ui-select.mjs.map +1 -1
- package/fesm2022/skra-ui-skeleton.mjs +8 -8
- package/fesm2022/skra-ui-skeleton.mjs.map +1 -1
- package/fesm2022/skra-ui-star-rating.mjs +2 -2
- package/fesm2022/skra-ui-star-rating.mjs.map +1 -1
- package/fesm2022/skra-ui-status-dot.mjs.map +1 -1
- package/fesm2022/skra-ui-switch.mjs +2 -2
- package/fesm2022/skra-ui-switch.mjs.map +1 -1
- package/fesm2022/skra-ui-tabs.mjs +2 -2
- package/fesm2022/skra-ui-tabs.mjs.map +1 -1
- package/fesm2022/skra-ui-textarea.mjs +2 -2
- package/fesm2022/skra-ui-textarea.mjs.map +1 -1
- package/fesm2022/skra-ui-toast.mjs +2 -2
- package/fesm2022/skra-ui-toast.mjs.map +1 -1
- package/fesm2022/skra-ui-tooltip.mjs +7 -2
- package/fesm2022/skra-ui-tooltip.mjs.map +1 -1
- package/fesm2022/skra-ui-typography.mjs.map +1 -1
- package/package.json +3 -3
- package/types/skra-ui-core.d.ts.map +1 -1
- package/types/skra-ui-datepicker.d.ts +146 -46
- package/types/skra-ui-datepicker.d.ts.map +1 -1
- package/types/skra-ui-menu.d.ts +18 -6
- package/types/skra-ui-menu.d.ts.map +1 -1
- package/types/skra-ui-popover.d.ts +13 -4
- package/types/skra-ui-popover.d.ts.map +1 -1
- package/types/skra-ui-tooltip.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skra-ui-combobox.mjs","sources":["../../../../libs/ui/combobox/src/lib/combobox/combobox.ts","../../../../libs/ui/combobox/src/lib/combobox/combobox-empty.ts","../../../../libs/ui/combobox/src/skra-ui-combobox.ts"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n ViewEncapsulation,\r\n afterRenderEffect,\r\n booleanAttribute,\r\n computed,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\n\r\nimport { _SkraListboxWidgetBase } from '@skra/ui/core';\r\nimport {\r\n SKRA_LISTBOX_PANEL,\r\n type SkraListboxKeyboardItem,\r\n} from '@skra/ui/core';\r\n\r\ndeclare const ngDevMode: boolean | undefined;\r\n\r\n/**\r\n * SkraCombobox — the WAI-ARIA APG **Editable Combobox** (list autocomplete, manual selection): an\r\n * editable `<input role=\"combobox\" aria-autocomplete=\"list\">` whose top-layer listbox (Popover API,\r\n * `popover=\"auto\"`, ADR 0044) of projected `skra-option` children NARROWS as the user types. The first\r\n * Tier-3 / higher-order component. Single-cardinality (ADR 0046); the multi sibling is future work.\r\n *\r\n * - **Filtering + option set are CONSUMER-OWNED (ADR 0049):** Forge emits the typed text via\r\n * `filterChange` (no debounce — timing is the consumer's); the consumer projects the matching\r\n * `skra-option` subset (sync computed OR async fetch). There is NO `[items]` input and NO internal\r\n * matcher — Forge renders exactly what is projected.\r\n * - **Value is OPTION-BOUND (ADR 0049):** `value = input<T>()` + `valueChange` (consumer-owned, ADR 037);\r\n * a committed value is always an existing option's `T`. On cancel/blur the input text reverts to the\r\n * selected option's label — typed text that matched nothing NEVER leaks as the value (free-text commit\r\n * is the separate `skra-autocomplete`).\r\n * - **Async (ADR 0049/028):** `loading` reflects `aria-busy` + drives a panel loading branch\r\n * (`[skraLoadingIndicator]` slot + fallback); an empty projected set drives the `[skraComboboxEmpty]`\r\n * branch; both are announced via `aria-live`.\r\n *\r\n * The trigger-shape-agnostic substrate (field cascade, panel toggle/positioner, keyboard wiring,\r\n * open/close, the `SkraListboxPanel` selection seam) lives in {@link _SkraListboxWidgetBase}, shared\r\n * verbatim with the select family (ADR 0046 amendment). `skra-option` is reused verbatim — combobox\r\n * provides the `SKRA_LISTBOX_PANEL` token so the option's selection/keyboard/indicator wiring works\r\n * unchanged.\r\n *\r\n * Full contract: adr/specs/component-combobox-spec.md.\r\n */\r\n@Component({\r\n selector: 'skra-combobox',\r\n standalone: true,\r\n exportAs: 'skraCombobox',\r\n template: `\r\n <input\r\n #trigger\r\n class=\"skra-combobox-input\"\r\n type=\"text\"\r\n role=\"combobox\"\r\n autocomplete=\"off\"\r\n aria-autocomplete=\"list\"\r\n aria-haspopup=\"listbox\"\r\n [attr.id]=\"triggerId()\"\r\n [attr.aria-controls]=\"panelId\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-activedescendant]=\"activeOptionId()\"\r\n [attr.aria-describedby]=\"describedBy()\"\r\n [attr.aria-invalid]=\"hasError() ? 'true' : null\"\r\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\r\n [attr.aria-busy]=\"loading() ? 'true' : null\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [disabled]=\"isDisabled()\"\r\n [readOnly]=\"isReadonly()\"\r\n [value]=\"displayValue()\"\r\n (focus)=\"onFocus()\"\r\n (input)=\"onInput($event)\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n <button\r\n class=\"skra-combobox-toggle\"\r\n type=\"button\"\r\n tabindex=\"-1\"\r\n aria-hidden=\"true\"\r\n [disabled]=\"isDisabled()\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (click)=\"toggle()\"\r\n >\r\n <span class=\"skra-combobox-arrow\" aria-hidden=\"true\"></span>\r\n </button>\r\n\r\n <div\r\n #panel\r\n class=\"skra-combobox-listbox\"\r\n [id]=\"panelId\"\r\n role=\"listbox\"\r\n popover=\"auto\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (toggle)=\"onPanelToggle($event)\"\r\n >\r\n <!-- ONE persistent live region (text swapped via @if) so loading/empty announce reliably —\r\n a region injected on demand is unreliably spoken (ADR 0049 rule 4). Hidden when empty via\r\n :empty in SCSS. -->\r\n <div class=\"skra-combobox-status\" role=\"status\" aria-live=\"polite\">\r\n @if (loading()) {\r\n <ng-content select=\"[skraLoadingIndicator]\"></ng-content>\r\n <span class=\"skra-combobox-spinner\" aria-hidden=\"true\"></span>\r\n } @else if (options().length === 0) {\r\n <ng-content select=\"[skraComboboxEmpty]\"></ng-content>\r\n }\r\n </div>\r\n <ng-content></ng-content>\r\n </div>\r\n `,\r\n styleUrl: './combobox.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n host: {\r\n '[attr.data-skra-loading]': 'loading() ? \"\" : null',\r\n '[attr.data-skra-empty]':\r\n '!loading() && options().length === 0 ? \"\" : null',\r\n },\r\n providers: [{ provide: SKRA_LISTBOX_PANEL, useExisting: SkraCombobox }],\r\n})\r\nexport class SkraCombobox<T = unknown> extends _SkraListboxWidgetBase<T> {\r\n /** Combobox panel token namespace — `--skra-comp-combobox-panel-*`. */\r\n protected readonly panelTokenPrefix = 'combobox';\r\n\r\n /** Consumer-owned value channel (ADR 037) — single, option-bound `T`. */\r\n readonly value = input<T>();\r\n /** Fires ONLY on user selection of an option — never on a programmatic `value()` change (ADR 037). */\r\n readonly valueChange = output<T>();\r\n /** The typed text, emitted on EVERY input change. Consumer-driven projection; NO Forge debounce (ADR 0049). */\r\n readonly filterChange = output<string>();\r\n /** Async hint (ADR 0049/028) — reflects `aria-busy` + drives the panel loading branch. */\r\n readonly loading = input(false, { transform: booleanAttribute });\r\n /** Cardinality hint (ADR 0046) — single-select. */\r\n readonly multiple = false;\r\n\r\n /** Internal editable-text state; emitted out via `filterChange`. NOT the value (ADR 0049). */\r\n protected readonly query = signal('');\r\n private readonly isFocused = signal(false);\r\n\r\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n /**\r\n * Position the panel against — and match its width to — the HOST box, not the inner input. The input\r\n * is inset (host padding + chevron), so anchoring to it would make a narrower, misaligned panel; the\r\n * host gives full-width parity with `skra-select`.\r\n */\r\n protected override positioningAnchor(): HTMLElement {\r\n return this.hostEl.nativeElement;\r\n }\r\n\r\n /** The option whose value matches `value()` (ADR 037 selection model) — feeds the displayed text + active seed. */\r\n protected readonly selectedOption = computed(\r\n () => this.options().find((o) => this.isSelected(o.value())) ?? null,\r\n );\r\n\r\n /**\r\n * The text shown in the input: the live query while editing (focused), otherwise the selected option's\r\n * label. This is the controlled-input seam that enforces the option-bound value (ADR 0049) — on blur the\r\n * input snaps back to the selected label, so unmatched typed text never persists.\r\n */\r\n protected readonly displayValue = computed(() =>\r\n this.isFocused() ? this.query() : (this.selectedOption()?.getLabel() ?? ''),\r\n );\r\n\r\n constructor() {\r\n super();\r\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\r\n // Dev-only consumer warning. Uses afterRenderEffect (NOT effect) so the projected\r\n // options' required `value` inputs are read only AFTER each render applies their\r\n // bindings — an eager read during the initial CD (SSR / first render) OR a runtime\r\n // re-projection (consumer filtering adds fresh <skra-option>s) would throw NG0950.\r\n // afterRender hooks never run on the server, so this stays SSR-safe. Covers both\r\n // F-13 (initial render) and F-16 (runtime re-projection, surfaced in dogfood).\r\n afterRenderEffect(() => {\r\n const v = this.value();\r\n if (v === undefined) return;\r\n const matched = this.options().some((o) =>\r\n this.compareWith()(o.value() as T, v),\r\n );\r\n if (!matched && this.options().length) {\r\n console.warn(\r\n '[skra-combobox] value has no matching <skra-option> in the projected set — the input ' +\r\n 'shows empty (likely a compareWith mismatch, or the selected option was filtered out).',\r\n );\r\n }\r\n });\r\n }\r\n }\r\n\r\n // ── SkraListboxPanel seam ──\r\n isSelected(value: unknown): boolean {\r\n const current = this.value();\r\n return current !== undefined && this.compareWith()(current, value as T);\r\n }\r\n\r\n selectValue(value: unknown): void {\r\n const opt =\r\n this.options().find((o) =>\r\n this.compareWith()(o.value() as T, value as T),\r\n ) ?? null;\r\n this.valueChange.emit(value as T);\r\n // Optimistic display: show the picked option's label immediately (focus is retained).\r\n this.query.set(opt?.getLabel() ?? '');\r\n this.close(); // single-select: pick + close\r\n }\r\n\r\n protected activeSeedItem(): SkraListboxKeyboardItem | null {\r\n return this.selectedOption();\r\n }\r\n\r\n // ── Editable-input trigger model (the divergence from the select-family button trigger) ──\r\n protected onFocus(): void {\r\n // Start editing from the current value's label (APG: the textbox shows the value, editable).\r\n this.query.set(this.selectedOption()?.getLabel() ?? '');\r\n this.isFocused.set(true);\r\n }\r\n\r\n protected onInput(event: Event): void {\r\n if (this.isReadonly()) return;\r\n const text = (event.target as HTMLInputElement).value;\r\n this.query.set(text);\r\n this.filterChange.emit(text); // ADR 0049 — consumer owns the matching + projection\r\n if (!this.isOpen()) this.open();\r\n }\r\n\r\n protected onBlur(): void {\r\n this.isFocused.set(false); // displayValue() snaps back to the selected label (option-bound, ADR 0049)\r\n if (this.isOpen()) this.close();\r\n }\r\n\r\n protected onTriggerKeydown(event: KeyboardEvent): void {\r\n if (this.isDisabled() || this.isReadonly()) return;\r\n const key = event.key;\r\n\r\n if (key === 'ArrowDown' || key === 'ArrowUp') {\r\n event.preventDefault(); // do not move the text caret\r\n if (event.altKey) {\r\n // APG: Alt+Down opens (no active move); Alt+Up closes + reverts (keeps value).\r\n if (key === 'ArrowDown') {\r\n if (!this.isOpen()) this.open();\r\n } else if (this.isOpen()) {\r\n this.query.set(this.selectedOption()?.getLabel() ?? '');\r\n this.close();\r\n }\r\n return;\r\n }\r\n if (!this.isOpen()) this.open();\r\n else this.keyboard.onKeydown(event); // move the active descendant\r\n return;\r\n }\r\n if (key === 'Enter') {\r\n if (this.isOpen()) {\r\n event.preventDefault();\r\n this.selectActive(); // select the active option (no-op if none / soft-disabled)\r\n }\r\n return;\r\n }\r\n if (key === 'Escape') {\r\n if (this.isOpen()) {\r\n event.preventDefault();\r\n this.query.set(this.selectedOption()?.getLabel() ?? ''); // revert (keep value)\r\n this.close();\r\n }\r\n return;\r\n }\r\n // Home/End/printable/Backspace: native text editing — NOT routed to the listbox (no type-ahead).\r\n }\r\n\r\n protected toggle(): void {\r\n if (this.isDisabled() || this.isReadonly()) return; // pointer parity with the keydown/input guards (M1)\r\n const el = this.triggerRef()?.nativeElement;\r\n if (this.isOpen()) {\r\n this.close();\r\n } else {\r\n el?.focus(); // fires onFocus → seeds the editable text\r\n this.open();\r\n }\r\n }\r\n}\r\n","import { Directive } from '@angular/core';\r\n\r\n/**\r\n * SkraComboboxEmpty — the no-results marker (ADR 0049). Place on the element that should show inside the\r\n * combobox listbox when the consumer's filter yields zero `skra-option` children:\r\n *\r\n * <skra-combobox (filterChange)=\"query.set($event)\" [value]=\"city()\" (valueChange)=\"city.set($event)\">\r\n * @for (c of visible(); track c.id) { <skra-option [value]=\"c.id\">{{ c.name }}</skra-option> }\r\n * <span skraComboboxEmpty>No matches</span>\r\n * </skra-combobox>\r\n *\r\n * The text is consumer-supplied (i18n is the consumer's concern — Forge ships no hardcoded string).\r\n * Forge toggles its visibility via `@if (!loading() && options().length === 0)`; the marker only carries\r\n * the projection selector, so no logic lives here.\r\n */\r\n@Directive({\r\n selector: '[skraComboboxEmpty]',\r\n standalone: true,\r\n})\r\nexport class SkraComboboxEmpty {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AA4EG,MAAO,YAA0B,SAAQ,sBAAyB,CAAA;;IAEnD,gBAAgB,GAAG,UAAU;;AAGvC,IAAA,KAAK,GAAG,KAAK;yFAAK;;IAElB,WAAW,GAAG,MAAM,EAAK;;IAEzB,YAAY,GAAG,MAAM,EAAU;;IAE/B,OAAO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AAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"skra-ui-combobox.mjs","sources":["../../../../libs/ui/combobox/src/lib/combobox/combobox.ts","../../../../libs/ui/combobox/src/lib/combobox/combobox-empty.ts","../../../../libs/ui/combobox/src/skra-ui-combobox.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n afterRenderEffect,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { _SkraListboxWidgetBase } from '@skra/ui/core';\nimport {\n SKRA_LISTBOX_PANEL,\n type SkraListboxKeyboardItem,\n} from '@skra/ui/core';\n\ndeclare const ngDevMode: boolean | undefined;\n\n/**\n * SkraCombobox — the WAI-ARIA APG **Editable Combobox** (list autocomplete, manual selection): an\n * editable `<input role=\"combobox\" aria-autocomplete=\"list\">` whose top-layer listbox (Popover API,\n * `popover=\"auto\"`, ADR 0044) of projected `skra-option` children NARROWS as the user types. The first\n * Tier-3 / higher-order component. Single-cardinality (ADR 0046); the multi sibling is future work.\n *\n * - **Filtering + option set are CONSUMER-OWNED (ADR 0049):** Forge emits the typed text via\n * `filterChange` (no debounce — timing is the consumer's); the consumer projects the matching\n * `skra-option` subset (sync computed OR async fetch). There is NO `[items]` input and NO internal\n * matcher — Forge renders exactly what is projected.\n * - **Value is OPTION-BOUND (ADR 0049):** `value = input<T>()` + `valueChange` (consumer-owned, ADR 037);\n * a committed value is always an existing option's `T`. On cancel/blur the input text reverts to the\n * selected option's label — typed text that matched nothing NEVER leaks as the value (free-text commit\n * is the separate `skra-autocomplete`).\n * - **Async (ADR 0049/028):** `loading` reflects `aria-busy` + drives a panel loading branch\n * (`[skraLoadingIndicator]` slot + fallback); an empty projected set drives the `[skraComboboxEmpty]`\n * branch; both are announced via `aria-live`.\n *\n * The trigger-shape-agnostic substrate (field cascade, panel toggle/positioner, keyboard wiring,\n * open/close, the `SkraListboxPanel` selection seam) lives in {@link _SkraListboxWidgetBase}, shared\n * verbatim with the select family (ADR 0046 amendment). `skra-option` is reused verbatim — combobox\n * provides the `SKRA_LISTBOX_PANEL` token so the option's selection/keyboard/indicator wiring works\n * unchanged.\n *\n * Full contract: adr/specs/component-combobox-spec.md.\n */\n@Component({\n selector: 'skra-combobox',\n standalone: true,\n exportAs: 'skraCombobox',\n template: `\n <input\n #trigger\n class=\"skra-combobox-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n [attr.id]=\"triggerId()\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-activedescendant]=\"activeOptionId()\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"hasError() ? 'true' : null\"\n [attr.aria-required]=\"isRequired() ? 'true' : null\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [attr.placeholder]=\"placeholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"isReadonly()\"\n [value]=\"displayValue()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onTriggerKeydown($event)\"\n (blur)=\"onBlur()\"\n />\n <button\n class=\"skra-combobox-toggle\"\n type=\"button\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isDisabled()\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"toggle()\"\n >\n <span class=\"skra-combobox-arrow\" aria-hidden=\"true\"></span>\n </button>\n\n <div\n #panel\n class=\"skra-combobox-listbox\"\n [id]=\"panelId\"\n role=\"listbox\"\n popover=\"auto\"\n (mousedown)=\"$event.preventDefault()\"\n (toggle)=\"onPanelToggle($event)\"\n >\n <!-- ONE persistent live region (text swapped via @if) so loading/empty announce reliably —\n a region injected on demand is unreliably spoken (ADR 0049 rule 4). Hidden when empty via\n :empty in SCSS. -->\n <div class=\"skra-combobox-status\" role=\"status\" aria-live=\"polite\">\n @if (loading()) {\n <ng-content select=\"[skraLoadingIndicator]\"></ng-content>\n <span class=\"skra-combobox-spinner\" aria-hidden=\"true\"></span>\n } @else if (options().length === 0) {\n <ng-content select=\"[skraComboboxEmpty]\"></ng-content>\n }\n </div>\n <ng-content></ng-content>\n </div>\n `,\n styleUrl: './combobox.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[attr.data-skra-loading]': 'loading() ? \"\" : null',\n '[attr.data-skra-empty]':\n '!loading() && options().length === 0 ? \"\" : null',\n },\n providers: [{ provide: SKRA_LISTBOX_PANEL, useExisting: SkraCombobox }],\n})\nexport class SkraCombobox<T = unknown> extends _SkraListboxWidgetBase<T> {\n /** Combobox panel token namespace — `--skra-comp-combobox-panel-*`. */\n protected readonly panelTokenPrefix = 'combobox';\n\n /** Consumer-owned value channel (ADR 037) — single, option-bound `T`. */\n readonly value = input<T>();\n /** Fires ONLY on user selection of an option — never on a programmatic `value()` change (ADR 037). */\n readonly valueChange = output<T>();\n /** The typed text, emitted on EVERY input change. Consumer-driven projection; NO Forge debounce (ADR 0049). */\n readonly filterChange = output<string>();\n /** Async hint (ADR 0049/028) — reflects `aria-busy` + drives the panel loading branch. */\n readonly loading = input(false, { transform: booleanAttribute });\n /** Cardinality hint (ADR 0046) — single-select. */\n readonly multiple = false;\n\n /** Internal editable-text state; emitted out via `filterChange`. NOT the value (ADR 0049). */\n protected readonly query = signal('');\n private readonly isFocused = signal(false);\n\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Position the panel against — and match its width to — the HOST box, not the inner input. The input\n * is inset (host padding + chevron), so anchoring to it would make a narrower, misaligned panel; the\n * host gives full-width parity with `skra-select`.\n */\n protected override positioningAnchor(): HTMLElement {\n return this.hostEl.nativeElement;\n }\n\n /** The option whose value matches `value()` (ADR 037 selection model) — feeds the displayed text + active seed. */\n protected readonly selectedOption = computed(\n () => this.options().find((o) => this.isSelected(o.value())) ?? null,\n );\n\n /**\n * The text shown in the input: the live query while editing (focused), otherwise the selected option's\n * label. This is the controlled-input seam that enforces the option-bound value (ADR 0049) — on blur the\n * input snaps back to the selected label, so unmatched typed text never persists.\n */\n protected readonly displayValue = computed(() =>\n this.isFocused() ? this.query() : (this.selectedOption()?.getLabel() ?? ''),\n );\n\n constructor() {\n super();\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Dev-only consumer warning. Uses afterRenderEffect (NOT effect) so the projected\n // options' required `value` inputs are read only AFTER each render applies their\n // bindings — an eager read during the initial CD (SSR / first render) OR a runtime\n // re-projection (consumer filtering adds fresh <skra-option>s) would throw NG0950.\n // afterRender hooks never run on the server, so this stays SSR-safe. Covers both\n // F-13 (initial render) and F-16 (runtime re-projection, surfaced in dogfood).\n afterRenderEffect(() => {\n const v = this.value();\n if (v === undefined) return;\n const matched = this.options().some((o) =>\n this.compareWith()(o.value() as T, v),\n );\n if (!matched && this.options().length) {\n console.warn(\n '[skra-combobox] value has no matching <skra-option> in the projected set — the input ' +\n 'shows empty (likely a compareWith mismatch, or the selected option was filtered out).',\n );\n }\n });\n }\n }\n\n // ── SkraListboxPanel seam ──\n isSelected(value: unknown): boolean {\n const current = this.value();\n return current !== undefined && this.compareWith()(current, value as T);\n }\n\n selectValue(value: unknown): void {\n const opt =\n this.options().find((o) =>\n this.compareWith()(o.value() as T, value as T),\n ) ?? null;\n this.valueChange.emit(value as T);\n // Optimistic display: show the picked option's label immediately (focus is retained).\n this.query.set(opt?.getLabel() ?? '');\n this.close(); // single-select: pick + close\n }\n\n protected activeSeedItem(): SkraListboxKeyboardItem | null {\n return this.selectedOption();\n }\n\n // ── Editable-input trigger model (the divergence from the select-family button trigger) ──\n protected onFocus(): void {\n // Start editing from the current value's label (APG: the textbox shows the value, editable).\n this.query.set(this.selectedOption()?.getLabel() ?? '');\n this.isFocused.set(true);\n }\n\n protected onInput(event: Event): void {\n if (this.isReadonly()) return;\n const text = (event.target as HTMLInputElement).value;\n this.query.set(text);\n this.filterChange.emit(text); // ADR 0049 — consumer owns the matching + projection\n if (!this.isOpen()) this.open();\n }\n\n protected onBlur(): void {\n this.isFocused.set(false); // displayValue() snaps back to the selected label (option-bound, ADR 0049)\n if (this.isOpen()) this.close();\n }\n\n protected onTriggerKeydown(event: KeyboardEvent): void {\n if (this.isDisabled() || this.isReadonly()) return;\n const key = event.key;\n\n if (key === 'ArrowDown' || key === 'ArrowUp') {\n event.preventDefault(); // do not move the text caret\n if (event.altKey) {\n // APG: Alt+Down opens (no active move); Alt+Up closes + reverts (keeps value).\n if (key === 'ArrowDown') {\n if (!this.isOpen()) this.open();\n } else if (this.isOpen()) {\n this.query.set(this.selectedOption()?.getLabel() ?? '');\n this.close();\n }\n return;\n }\n if (!this.isOpen()) this.open();\n else this.keyboard.onKeydown(event); // move the active descendant\n return;\n }\n if (key === 'Enter') {\n if (this.isOpen()) {\n event.preventDefault();\n this.selectActive(); // select the active option (no-op if none / soft-disabled)\n }\n return;\n }\n if (key === 'Escape') {\n if (this.isOpen()) {\n event.preventDefault();\n this.query.set(this.selectedOption()?.getLabel() ?? ''); // revert (keep value)\n this.close();\n }\n return;\n }\n // Home/End/printable/Backspace: native text editing — NOT routed to the listbox (no type-ahead).\n }\n\n protected toggle(): void {\n if (this.isDisabled() || this.isReadonly()) return; // pointer parity with the keydown/input guards (M1)\n const el = this.triggerRef()?.nativeElement;\n if (this.isOpen()) {\n this.close();\n } else {\n el?.focus(); // fires onFocus → seeds the editable text\n this.open();\n }\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * SkraComboboxEmpty — the no-results marker (ADR 0049). Place on the element that should show inside the\n * combobox listbox when the consumer's filter yields zero `skra-option` children:\n *\n * <skra-combobox (filterChange)=\"query.set($event)\" [value]=\"city()\" (valueChange)=\"city.set($event)\">\n * @for (c of visible(); track c.id) { <skra-option [value]=\"c.id\">{{ c.name }}</skra-option> }\n * <span skraComboboxEmpty>No matches</span>\n * </skra-combobox>\n *\n * The text is consumer-supplied (i18n is the consumer's concern — Forge ships no hardcoded string).\n * Forge toggles its visibility via `@if (!loading() && options().length === 0)`; the marker only carries\n * the projection selector, so no logic lives here.\n */\n@Directive({\n selector: '[skraComboboxEmpty]',\n standalone: true,\n})\nexport class SkraComboboxEmpty {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AA4EG,MAAO,YAA0B,SAAQ,sBAAyB,CAAA;;IAEnD,gBAAgB,GAAG,UAAU;;AAGvC,IAAA,KAAK,GAAG,KAAK;yFAAK;;IAElB,WAAW,GAAG,MAAM,EAAK;;IAEzB,YAAY,GAAG,MAAM,EAAU;;IAE/B,OAAO,GAAG,KAAK,CAAC,KAAK,+EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAEvD,QAAQ,GAAG,KAAK;;IAGN,KAAK,GAAG,MAAM,CAAC,EAAE;8EAAC;IACpB,SAAS,GAAG,MAAM,CAAC,KAAK;kFAAC;AAEzB,IAAA,MAAM,GAAG,MAAM,CAA0B,UAAU,CAAC;AAErE;;;;AAIG;IACgB,iBAAiB,GAAA;AAClC,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa;IAClC;;AAGmB,IAAA,cAAc,GAAG,QAAQ,CAC1C,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,IAAI;uFACrE;AAED;;;;AAIG;AACgB,IAAA,YAAY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ExB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,UAAA,EACb,IAAI,EAAA,QAAA,EACN,cAAc,EAAA,QAAA,EACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DT,EAAA,CAAA,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EACnC;AACJ,wBAAA,0BAA0B,EAAE,uBAAuB;AACnD,wBAAA,wBAAwB,EACtB,kDAAkD;qBACrD,EAAA,SAAA,EACU,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAA,YAAc,EAAE,CAAC,EAAA,MAAA,EAAA,CAAA,mwKAAA,CAAA,EAAA;;;ACvHzE;;;;;;;;;;;;AAYG;MAKU,iBAAiB,CAAA;uGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
@@ -142,44 +142,44 @@ class SkraOption {
|
|
|
142
142
|
this.select?.selectValue(this.value());
|
|
143
143
|
}
|
|
144
144
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: SkraOption, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
145
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: SkraOption, isStandalone: true, selector: "skra-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "option" }, listeners: { "click": "onActivate()" }, properties: { "id": "optionId", "attr.aria-selected": "selected() ? \"true\" : \"false\"", "attr.data-skra-active": "active() ? \"\" : null" } }, queries: [{ propertyName: "leadingSlot", first: true, predicate: SkraOptionLeading, descendants: true, isSignal: true }, { propertyName: "detailSlot", first: true, predicate: SkraOptionDetail, descendants: true, isSignal: true }], exportAs: ["skraOption"], ngImport: i0, template: `
|
|
146
|
-
@if (hasLeading()) {
|
|
147
|
-
<span class="skra-select-option-leading"
|
|
148
|
-
><ng-content select="[skra-option-leading]"></ng-content
|
|
149
|
-
></span>
|
|
150
|
-
}
|
|
151
|
-
<span class="skra-select-option-label"><ng-content></ng-content></span>
|
|
152
|
-
@if (hasDetail()) {
|
|
153
|
-
<span class="skra-select-option-detail"
|
|
154
|
-
><ng-content select="[skra-option-detail]"></ng-content
|
|
155
|
-
></span>
|
|
156
|
-
}
|
|
157
|
-
<span
|
|
158
|
-
class="skra-select-option-indicator"
|
|
159
|
-
[class.skra-select-option-indicator--checkbox]="multiple()"
|
|
160
|
-
aria-hidden="true"
|
|
161
|
-
></span>
|
|
162
|
-
`, isInline: true, styles: ["@charset \"UTF-8\";:host{display:flex;align-items:center;gap:var(--skra-comp-select-option-gap);inline-size:100%;min-block-size:var(--skra-comp-select-option-min-block-size);margin:0;box-sizing:border-box;padding-block:var(--skra-comp-select-option-padding-block);padding-inline:var(--skra-comp-select-option-padding-inline);color:var(--skra-comp-select-option-foreground);cursor:pointer;-webkit-user-select:none;user-select:none;font-family:var(--skra-sys-typography-role-body-medium-font-family);font-size:var(--skra-sys-typography-role-body-medium-font-size);font-weight:var(--skra-sys-typography-role-body-medium-font-weight);line-height:var(--skra-sys-typography-role-body-medium-line-height);letter-spacing:var(--skra-sys-typography-role-body-medium-letter-spacing);transition:background-color var(--skra-comp-select-motion-duration) var(--skra-comp-select-motion-easing)}.skra-select-option-leading{display:inline-flex;align-items:center;flex:none;--skra-comp-icon-size: var(--skra-comp-select-icon-size)}.skra-select-option-label{flex:1 1 auto;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.skra-select-option-detail{flex:none;color:var(--skra-comp-select-option-detail-foreground);font-family:var(--skra-sys-typography-role-body-small-font-family);font-size:var(--skra-sys-typography-role-body-small-font-size);font-weight:var(--skra-sys-typography-role-body-small-font-weight);line-height:var(--skra-sys-typography-role-body-small-line-height);letter-spacing:var(--skra-sys-typography-role-body-small-letter-spacing)}.skra-select-option-indicator{flex:none;inline-size:1em;display:inline-flex;align-items:center;justify-content:center}:host([aria-selected=true]) .skra-select-option-indicator:not(.skra-select-option-indicator--checkbox):before{content:\"\\2713\";color:var(--skra-comp-select-indicator-color)}.skra-select-option-indicator--checkbox{inline-size:var(--skra-comp-select-option-checkbox-size);block-size:var(--skra-comp-select-option-checkbox-size);border:var(--skra-comp-select-border-width) solid var(--skra-comp-select-option-checkbox-border-color);border-radius:var(--skra-comp-select-option-checkbox-radius);box-sizing:border-box}:host([aria-selected=true]) .skra-select-option-indicator--checkbox{background-color:var(--skra-comp-select-option-checkbox-background-selected);border-color:var(--skra-comp-select-option-checkbox-background-selected)}:host([aria-selected=true]) .skra-select-option-indicator--checkbox:before{content:\"\\2713\";color:var(--skra-comp-select-option-checkbox-check-color);font-size:.75em;line-height:1}:host(:hover){background-color:var(--skra-comp-select-option-background-hover)}:host([data-skra-active]){background-color:var(--skra-comp-select-option-background-active);outline:var(--skra-comp-select-focus-ring-width) solid var(--skra-comp-select-focus-ring-color);outline-offset:calc(-1 * var(--skra-comp-select-focus-ring-width))}:host([aria-selected=true]){background-color:var(--skra-comp-select-option-background-selected);color:var(--skra-comp-select-option-foreground-selected)}:host([aria-disabled=true]){color:var(--skra-comp-select-option-foreground-disabled);cursor:default}@media(prefers-reduced-motion:reduce){:host{transition-duration:0ms}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
145
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: SkraOption, isStandalone: true, selector: "skra-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "option" }, listeners: { "click": "onActivate()" }, properties: { "id": "optionId", "attr.aria-selected": "selected() ? \"true\" : \"false\"", "attr.data-skra-active": "active() ? \"\" : null" } }, queries: [{ propertyName: "leadingSlot", first: true, predicate: SkraOptionLeading, descendants: true, isSignal: true }, { propertyName: "detailSlot", first: true, predicate: SkraOptionDetail, descendants: true, isSignal: true }], exportAs: ["skraOption"], ngImport: i0, template: `
|
|
146
|
+
@if (hasLeading()) {
|
|
147
|
+
<span class="skra-select-option-leading"
|
|
148
|
+
><ng-content select="[skra-option-leading]"></ng-content
|
|
149
|
+
></span>
|
|
150
|
+
}
|
|
151
|
+
<span class="skra-select-option-label"><ng-content></ng-content></span>
|
|
152
|
+
@if (hasDetail()) {
|
|
153
|
+
<span class="skra-select-option-detail"
|
|
154
|
+
><ng-content select="[skra-option-detail]"></ng-content
|
|
155
|
+
></span>
|
|
156
|
+
}
|
|
157
|
+
<span
|
|
158
|
+
class="skra-select-option-indicator"
|
|
159
|
+
[class.skra-select-option-indicator--checkbox]="multiple()"
|
|
160
|
+
aria-hidden="true"
|
|
161
|
+
></span>
|
|
162
|
+
`, isInline: true, styles: ["@charset \"UTF-8\";:host{display:flex;align-items:center;gap:var(--skra-comp-select-option-gap);inline-size:100%;min-block-size:var(--skra-comp-select-option-min-block-size);margin:0;box-sizing:border-box;padding-block:var(--skra-comp-select-option-padding-block);padding-inline:var(--skra-comp-select-option-padding-inline);color:var(--skra-comp-select-option-foreground);cursor:pointer;-webkit-user-select:none;user-select:none;font-family:var(--skra-sys-typography-role-body-medium-font-family);font-size:var(--skra-sys-typography-role-body-medium-font-size);font-weight:var(--skra-sys-typography-role-body-medium-font-weight);line-height:var(--skra-sys-typography-role-body-medium-line-height);letter-spacing:var(--skra-sys-typography-role-body-medium-letter-spacing);transition:background-color var(--skra-comp-select-motion-duration) var(--skra-comp-select-motion-easing)}.skra-select-option-leading{display:inline-flex;align-items:center;flex:none;--skra-comp-icon-size: var(--skra-comp-select-icon-size)}.skra-select-option-label{flex:1 1 auto;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.skra-select-option-detail{flex:none;color:var(--skra-comp-select-option-detail-foreground);font-family:var(--skra-sys-typography-role-body-small-font-family);font-size:var(--skra-sys-typography-role-body-small-font-size);font-weight:var(--skra-sys-typography-role-body-small-font-weight);line-height:var(--skra-sys-typography-role-body-small-line-height);letter-spacing:var(--skra-sys-typography-role-body-small-letter-spacing)}.skra-select-option-indicator{flex:none;inline-size:1em;display:inline-flex;align-items:center;justify-content:center}:host([aria-selected=true]) .skra-select-option-indicator:not(.skra-select-option-indicator--checkbox):before{content:\"\\2713\";color:var(--skra-comp-select-indicator-color)}.skra-select-option-indicator--checkbox{inline-size:var(--skra-comp-select-option-checkbox-size);block-size:var(--skra-comp-select-option-checkbox-size);border:var(--skra-comp-select-border-width) solid var(--skra-comp-select-option-checkbox-border-color);border-radius:var(--skra-comp-select-option-checkbox-radius);box-sizing:border-box}:host([aria-selected=true]) .skra-select-option-indicator--checkbox{background-color:var(--skra-comp-select-option-checkbox-background-selected);border-color:var(--skra-comp-select-option-checkbox-background-selected)}:host([aria-selected=true]) .skra-select-option-indicator--checkbox:before{content:\"\\2713\";color:var(--skra-comp-select-option-checkbox-check-color);font-size:.75em;line-height:1}@media(hover:hover)and (pointer:fine){:host(:hover){background-color:var(--skra-comp-select-option-background-hover)}}:host([data-skra-active]){background-color:var(--skra-comp-select-option-background-active);outline:var(--skra-comp-select-focus-ring-width) solid var(--skra-comp-select-focus-ring-color);outline-offset:calc(-1 * var(--skra-comp-select-focus-ring-width))}:host([aria-selected=true]){background-color:var(--skra-comp-select-option-background-selected);color:var(--skra-comp-select-option-foreground-selected)}:host([aria-disabled=true]){color:var(--skra-comp-select-option-foreground-disabled);cursor:default}@media(prefers-reduced-motion:reduce){:host{transition-duration:0ms}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
163
163
|
}
|
|
164
164
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: SkraOption, decorators: [{
|
|
165
165
|
type: Component,
|
|
166
|
-
args: [{ selector: 'skra-option', standalone: true, exportAs: 'skraOption', template: `
|
|
167
|
-
@if (hasLeading()) {
|
|
168
|
-
<span class="skra-select-option-leading"
|
|
169
|
-
><ng-content select="[skra-option-leading]"></ng-content
|
|
170
|
-
></span>
|
|
171
|
-
}
|
|
172
|
-
<span class="skra-select-option-label"><ng-content></ng-content></span>
|
|
173
|
-
@if (hasDetail()) {
|
|
174
|
-
<span class="skra-select-option-detail"
|
|
175
|
-
><ng-content select="[skra-option-detail]"></ng-content
|
|
176
|
-
></span>
|
|
177
|
-
}
|
|
178
|
-
<span
|
|
179
|
-
class="skra-select-option-indicator"
|
|
180
|
-
[class.skra-select-option-indicator--checkbox]="multiple()"
|
|
181
|
-
aria-hidden="true"
|
|
182
|
-
></span>
|
|
166
|
+
args: [{ selector: 'skra-option', standalone: true, exportAs: 'skraOption', template: `
|
|
167
|
+
@if (hasLeading()) {
|
|
168
|
+
<span class="skra-select-option-leading"
|
|
169
|
+
><ng-content select="[skra-option-leading]"></ng-content
|
|
170
|
+
></span>
|
|
171
|
+
}
|
|
172
|
+
<span class="skra-select-option-label"><ng-content></ng-content></span>
|
|
173
|
+
@if (hasDetail()) {
|
|
174
|
+
<span class="skra-select-option-detail"
|
|
175
|
+
><ng-content select="[skra-option-detail]"></ng-content
|
|
176
|
+
></span>
|
|
177
|
+
}
|
|
178
|
+
<span
|
|
179
|
+
class="skra-select-option-indicator"
|
|
180
|
+
[class.skra-select-option-indicator--checkbox]="multiple()"
|
|
181
|
+
aria-hidden="true"
|
|
182
|
+
></span>
|
|
183
183
|
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
184
184
|
role: 'option',
|
|
185
185
|
'[id]': 'optionId',
|
|
@@ -187,7 +187,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
187
187
|
'[attr.data-skra-active]': 'active() ? "" : null',
|
|
188
188
|
'(click)': 'onActivate()',
|
|
189
189
|
// Disabled = the consumer's native `aria-disabled="true"` (observed live) — no Forge binding.
|
|
190
|
-
}, styles: ["@charset \"UTF-8\";:host{display:flex;align-items:center;gap:var(--skra-comp-select-option-gap);inline-size:100%;min-block-size:var(--skra-comp-select-option-min-block-size);margin:0;box-sizing:border-box;padding-block:var(--skra-comp-select-option-padding-block);padding-inline:var(--skra-comp-select-option-padding-inline);color:var(--skra-comp-select-option-foreground);cursor:pointer;-webkit-user-select:none;user-select:none;font-family:var(--skra-sys-typography-role-body-medium-font-family);font-size:var(--skra-sys-typography-role-body-medium-font-size);font-weight:var(--skra-sys-typography-role-body-medium-font-weight);line-height:var(--skra-sys-typography-role-body-medium-line-height);letter-spacing:var(--skra-sys-typography-role-body-medium-letter-spacing);transition:background-color var(--skra-comp-select-motion-duration) var(--skra-comp-select-motion-easing)}.skra-select-option-leading{display:inline-flex;align-items:center;flex:none;--skra-comp-icon-size: var(--skra-comp-select-icon-size)}.skra-select-option-label{flex:1 1 auto;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.skra-select-option-detail{flex:none;color:var(--skra-comp-select-option-detail-foreground);font-family:var(--skra-sys-typography-role-body-small-font-family);font-size:var(--skra-sys-typography-role-body-small-font-size);font-weight:var(--skra-sys-typography-role-body-small-font-weight);line-height:var(--skra-sys-typography-role-body-small-line-height);letter-spacing:var(--skra-sys-typography-role-body-small-letter-spacing)}.skra-select-option-indicator{flex:none;inline-size:1em;display:inline-flex;align-items:center;justify-content:center}:host([aria-selected=true]) .skra-select-option-indicator:not(.skra-select-option-indicator--checkbox):before{content:\"\\2713\";color:var(--skra-comp-select-indicator-color)}.skra-select-option-indicator--checkbox{inline-size:var(--skra-comp-select-option-checkbox-size);block-size:var(--skra-comp-select-option-checkbox-size);border:var(--skra-comp-select-border-width) solid var(--skra-comp-select-option-checkbox-border-color);border-radius:var(--skra-comp-select-option-checkbox-radius);box-sizing:border-box}:host([aria-selected=true]) .skra-select-option-indicator--checkbox{background-color:var(--skra-comp-select-option-checkbox-background-selected);border-color:var(--skra-comp-select-option-checkbox-background-selected)}:host([aria-selected=true]) .skra-select-option-indicator--checkbox:before{content:\"\\2713\";color:var(--skra-comp-select-option-checkbox-check-color);font-size:.75em;line-height:1}:host(:hover){background-color:var(--skra-comp-select-option-background-hover)}:host([data-skra-active]){background-color:var(--skra-comp-select-option-background-active);outline:var(--skra-comp-select-focus-ring-width) solid var(--skra-comp-select-focus-ring-color);outline-offset:calc(-1 * var(--skra-comp-select-focus-ring-width))}:host([aria-selected=true]){background-color:var(--skra-comp-select-option-background-selected);color:var(--skra-comp-select-option-foreground-selected)}:host([aria-disabled=true]){color:var(--skra-comp-select-option-foreground-disabled);cursor:default}@media(prefers-reduced-motion:reduce){:host{transition-duration:0ms}}\n"] }]
|
|
190
|
+
}, styles: ["@charset \"UTF-8\";:host{display:flex;align-items:center;gap:var(--skra-comp-select-option-gap);inline-size:100%;min-block-size:var(--skra-comp-select-option-min-block-size);margin:0;box-sizing:border-box;padding-block:var(--skra-comp-select-option-padding-block);padding-inline:var(--skra-comp-select-option-padding-inline);color:var(--skra-comp-select-option-foreground);cursor:pointer;-webkit-user-select:none;user-select:none;font-family:var(--skra-sys-typography-role-body-medium-font-family);font-size:var(--skra-sys-typography-role-body-medium-font-size);font-weight:var(--skra-sys-typography-role-body-medium-font-weight);line-height:var(--skra-sys-typography-role-body-medium-line-height);letter-spacing:var(--skra-sys-typography-role-body-medium-letter-spacing);transition:background-color var(--skra-comp-select-motion-duration) var(--skra-comp-select-motion-easing)}.skra-select-option-leading{display:inline-flex;align-items:center;flex:none;--skra-comp-icon-size: var(--skra-comp-select-icon-size)}.skra-select-option-label{flex:1 1 auto;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.skra-select-option-detail{flex:none;color:var(--skra-comp-select-option-detail-foreground);font-family:var(--skra-sys-typography-role-body-small-font-family);font-size:var(--skra-sys-typography-role-body-small-font-size);font-weight:var(--skra-sys-typography-role-body-small-font-weight);line-height:var(--skra-sys-typography-role-body-small-line-height);letter-spacing:var(--skra-sys-typography-role-body-small-letter-spacing)}.skra-select-option-indicator{flex:none;inline-size:1em;display:inline-flex;align-items:center;justify-content:center}:host([aria-selected=true]) .skra-select-option-indicator:not(.skra-select-option-indicator--checkbox):before{content:\"\\2713\";color:var(--skra-comp-select-indicator-color)}.skra-select-option-indicator--checkbox{inline-size:var(--skra-comp-select-option-checkbox-size);block-size:var(--skra-comp-select-option-checkbox-size);border:var(--skra-comp-select-border-width) solid var(--skra-comp-select-option-checkbox-border-color);border-radius:var(--skra-comp-select-option-checkbox-radius);box-sizing:border-box}:host([aria-selected=true]) .skra-select-option-indicator--checkbox{background-color:var(--skra-comp-select-option-checkbox-background-selected);border-color:var(--skra-comp-select-option-checkbox-background-selected)}:host([aria-selected=true]) .skra-select-option-indicator--checkbox:before{content:\"\\2713\";color:var(--skra-comp-select-option-checkbox-check-color);font-size:.75em;line-height:1}@media(hover:hover)and (pointer:fine){:host(:hover){background-color:var(--skra-comp-select-option-background-hover)}}:host([data-skra-active]){background-color:var(--skra-comp-select-option-background-active);outline:var(--skra-comp-select-focus-ring-width) solid var(--skra-comp-select-focus-ring-color);outline-offset:calc(-1 * var(--skra-comp-select-focus-ring-width))}:host([aria-selected=true]){background-color:var(--skra-comp-select-option-background-selected);color:var(--skra-comp-select-option-foreground-selected)}:host([aria-disabled=true]){color:var(--skra-comp-select-option-foreground-disabled);cursor:default}@media(prefers-reduced-motion:reduce){:host{transition-duration:0ms}}\n"] }]
|
|
191
191
|
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], leadingSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SkraOptionLeading), { isSignal: true }] }], detailSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SkraOptionDetail), { isSignal: true }] }] } });
|
|
192
192
|
|
|
193
193
|
/**
|
|
@@ -223,27 +223,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
223
223
|
* `options` is a getter so live token values (offset) are re-read on every reposition.
|
|
224
224
|
*/
|
|
225
225
|
function _attachPositioner(reference, floating, options) {
|
|
226
|
+
let destroyed = false;
|
|
227
|
+
let seq = 0;
|
|
226
228
|
const update = () => {
|
|
227
229
|
const { placement, offset: offset$1 = 0, viewportPadding = 8 } = options();
|
|
228
|
-
|
|
230
|
+
// `computePosition` is async, so two things can go wrong between call and settle: the handle can
|
|
231
|
+
// be destroyed (writing geometry onto a detached / hidden node), and a newer update can settle
|
|
232
|
+
// first (landing stale coordinates). Guard on both — this file positions every overlay in the
|
|
233
|
+
// library, so a two-line guard is cheap insurance.
|
|
234
|
+
const token = ++seq;
|
|
235
|
+
computePosition(reference, floating, {
|
|
229
236
|
strategy: 'fixed', // floating element renders in the top layer → viewport-relative
|
|
230
237
|
placement: placement,
|
|
231
238
|
middleware: [
|
|
232
239
|
offset(offset$1),
|
|
240
|
+
// NOTE: `flip()` deliberately left unpadded pending a decision — see the review residual.
|
|
241
|
+
// Giving it `viewportPadding` would change resolved placement for all 7 overlay consumers
|
|
242
|
+
// with no visual test to catch a regression; that is a measured change, not a cleanup.
|
|
233
243
|
flip(),
|
|
234
244
|
shift({ padding: viewportPadding }),
|
|
235
245
|
],
|
|
236
|
-
})
|
|
246
|
+
})
|
|
247
|
+
.then(({ x, y, placement: resolved }) => {
|
|
248
|
+
if (destroyed || token !== seq)
|
|
249
|
+
return;
|
|
237
250
|
// Geometry only (ADR 0044 §3 rule 4). Never theme/state.
|
|
238
251
|
floating.style.left = `${x}px`;
|
|
239
252
|
floating.style.top = `${y}px`;
|
|
240
253
|
// Resolved side (post-flip) for orientation CSS / future arrow — a data-attr, not a style.
|
|
241
254
|
floating.setAttribute('data-skra-placement', resolved.split('-')[0]);
|
|
255
|
+
})
|
|
256
|
+
.catch(() => {
|
|
257
|
+
// Positioning is best-effort: a rejection must never surface as an unhandled rejection
|
|
258
|
+
// (fatal under Node, e.g. any future SSR/prerender path).
|
|
242
259
|
});
|
|
243
260
|
};
|
|
244
261
|
// autoUpdate repositions on scroll, resize and element resize; returns its own cleanup.
|
|
245
262
|
const cleanup = autoUpdate(reference, floating, update);
|
|
246
|
-
let destroyed = false;
|
|
247
263
|
return {
|
|
248
264
|
destroy() {
|
|
249
265
|
if (destroyed)
|
|
@@ -525,6 +541,15 @@ class _SkraSelectBase extends _SkraListboxWidgetBase {
|
|
|
525
541
|
}
|
|
526
542
|
if (key === 'Escape')
|
|
527
543
|
return; // platform (popover="auto") closes; onPanelToggle handles cleanup
|
|
544
|
+
if (key === 'ArrowUp' && event.altKey) {
|
|
545
|
+
// APG select-only combobox: Alt+Up closes and keeps the current value, focus stays on the
|
|
546
|
+
// trigger. Must be handled BEFORE the nav branch — `ArrowUp` is `isNav`, so it would otherwise
|
|
547
|
+
// be preventDefault'ed and handed to the key manager, which ignores modified arrows: the
|
|
548
|
+
// keystroke did nothing at all.
|
|
549
|
+
event.preventDefault();
|
|
550
|
+
this.close();
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
528
553
|
if (isNav || isPrintable) {
|
|
529
554
|
event.preventDefault();
|
|
530
555
|
this.keyboard.onKeydown(event); // move / type-ahead the active descendant
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skra-ui-core.mjs","sources":["../../../../libs/ui/core/src/lib/select/select-types.ts","../../../../libs/ui/core/src/lib/select/option.directives.ts","../../../../libs/ui/core/src/lib/select/option.ts","../../../../libs/ui/core/src/lib/select/select-trigger.ts","../../../../libs/ui/core/src/lib/positioning/positioner.ts","../../../../libs/ui/core/src/lib/select/listbox-keyboard.ts","../../../../libs/ui/core/src/lib/select/listbox-widget-base.ts","../../../../libs/ui/core/src/lib/select/select-base.ts","../../../../libs/ui/core/src/index.ts","../../../../libs/ui/core/src/skra-ui-core.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\r\n\r\n/**\r\n * What a `skra-option` needs from its listbox parent — a narrow contract that breaks the\r\n * parent↔option import cycle (the `SKRA_MENU` precedent). A token (not a concrete class) so the option\r\n * file never imports a widget file — no runtime import cycle. Implemented by `_SkraListboxWidgetBase`,\r\n * so it is shared by `skra-select`, `skra-multi-select` AND `skra-combobox` (ADR 0046 amendment).\r\n */\r\nexport interface SkraListboxPanel {\r\n /** Live selection test for an option's value (signal-driven: default `Object.is` or consumer `compareWith`). */\r\n isSelected(value: unknown): boolean;\r\n /**\r\n * A user picked this value (pointer/keyboard). Single-select emits `valueChange` + closes; multi-select\r\n * TOGGLES membership and keeps the panel open (ADR 0046); combobox replaces + closes (ADR 0049).\r\n * Consumer owns `value` (ADR 037).\r\n */\r\n selectValue(value: unknown): void;\r\n /**\r\n * Cardinality hint (ADR 0046) — `false` on single widgets (`skra-select`/`skra-combobox`), `true` on\r\n * `skra-multi-select`. The ONLY thing `skra-option` reads to swap its component-rendered indicator\r\n * (checkmark ↔ checkbox). NOT an Angular input; cardinality is a component identity, never a runtime flag.\r\n */\r\n readonly multiple: boolean;\r\n}\r\n\r\n/**\r\n * The item shape the listbox keyboard controller drives. Structurally a CDK `Highlightable`\r\n * (`setActiveStyles`/`setInactiveStyles`) + `ListKeyManagerOption` (`getLabel`/`disabled`), plus the\r\n * option's `id` (→ `aria-activedescendant`) and `getValue()` (Enter-to-select). Declared HERE — cdk-free —\r\n * so the only `@angular/cdk` importer stays `listbox-keyboard.ts` (the `menu-types.ts` precedent).\r\n */\r\nexport interface SkraListboxKeyboardItem {\r\n readonly optionId: string;\r\n setActiveStyles(): void;\r\n setInactiveStyles(): void;\r\n getLabel(): string;\r\n getValue(): unknown;\r\n readonly disabled: boolean;\r\n}\r\n\r\n/**\r\n * DI token a listbox widget provides (`useExisting`) and a `skra-option` injects. A token (not a concrete\r\n * class) so the option file never imports a widget file — no runtime import cycle. Provided by\r\n * `skra-select`, `skra-multi-select`, and `skra-combobox`.\r\n */\r\nexport const SKRA_LISTBOX_PANEL = new InjectionToken<SkraListboxPanel>(\r\n 'SKRA_LISTBOX_PANEL',\r\n);\r\n","import { Directive } from '@angular/core';\r\n\r\n/**\r\n * Slot marker: the leading icon/flag of a `skra-option` — part of the option IDENTITY (ADR 0045\r\n * Rule 4), so it flows into `getLabel()` (emoji/glyph leading appears in the default trigger for free).\r\n */\r\n@Directive({\r\n selector: '[skra-option-leading]',\r\n standalone: true,\r\n})\r\nexport class SkraOptionLeading {}\r\n\r\n/**\r\n * Slot marker: secondary DETAIL text of a `skra-option` (e.g. a dial code, a description) — list-only\r\n * (ADR 0045 Rule 4), EXCLUDED from `getLabel()` and the trigger summary.\r\n */\r\n@Directive({\r\n selector: '[skra-option-detail]',\r\n standalone: true,\r\n})\r\nexport class SkraOptionDetail {}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n ViewEncapsulation,\r\n computed,\r\n contentChild,\r\n inject,\r\n input,\r\n signal,\r\n} from '@angular/core';\r\n\r\nimport {\r\n SKRA_LISTBOX_PANEL,\r\n type SkraListboxKeyboardItem,\r\n} from './select-types';\r\nimport { SkraOptionDetail, SkraOptionLeading } from './option.directives';\r\n\r\ndeclare const ngDevMode: boolean | undefined;\r\n\r\nlet nextOptionId = 0;\r\n\r\n/**\r\n * SkraOption — one selectable row in a `skra-select` listbox, a Component on the custom-element host\r\n * `skra-option` (ADR 040 content-bearing host; there is no native option element that holds rich content\r\n * outside `<select>`). Carries `value` + rich projected content: a leading icon (`[skra-option-leading]`)\r\n * and a primary label = the IDENTITY (→ `getLabel()` / the default trigger, ADR 0045), plus an optional\r\n * secondary `[skra-option-detail]` that is list-only (excluded from the trigger). The selection\r\n * indicator (trailing checkmark) is component-rendered, driven by `aria-selected` — NOT a slot; iteration 2\r\n * swaps it for a per-row checkbox with no API change.\r\n *\r\n * Implements `SkraListboxKeyboardItem` so `_SkraListboxKeyboard` (CDK `ActiveDescendantKeyManager`) can\r\n * highlight it (`setActiveStyles`/`setInactiveStyles` → `data-skra-active`) and type-ahead to it\r\n * (`getLabel`). Disabled is native-attr-first (Menu precedent): the consumer sets `aria-disabled=\"true\"`\r\n * and Forge OBSERVES it — disabled options stay navigable (discoverable) but cannot be selected.\r\n *\r\n * Full contract: adr/specs/component-select-spec.md.\r\n */\r\n@Component({\r\n selector: 'skra-option',\r\n standalone: true,\r\n exportAs: 'skraOption',\r\n template: `\r\n @if (hasLeading()) {\r\n <span class=\"skra-select-option-leading\"\r\n ><ng-content select=\"[skra-option-leading]\"></ng-content\r\n ></span>\r\n }\r\n <span class=\"skra-select-option-label\"><ng-content></ng-content></span>\r\n @if (hasDetail()) {\r\n <span class=\"skra-select-option-detail\"\r\n ><ng-content select=\"[skra-option-detail]\"></ng-content\r\n ></span>\r\n }\r\n <span\r\n class=\"skra-select-option-indicator\"\r\n [class.skra-select-option-indicator--checkbox]=\"multiple()\"\r\n aria-hidden=\"true\"\r\n ></span>\r\n `,\r\n styleUrl: './option.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n host: {\r\n role: 'option',\r\n '[id]': 'optionId',\r\n '[attr.aria-selected]': 'selected() ? \"true\" : \"false\"',\r\n '[attr.data-skra-active]': 'active() ? \"\" : null',\r\n '(click)': 'onActivate()',\r\n // Disabled = the consumer's native `aria-disabled=\"true\"` (observed live) — no Forge binding.\r\n },\r\n})\r\nexport class SkraOption<T = unknown> implements SkraListboxKeyboardItem {\r\n /** The option's value (ADR 037 — consumer-owned; compared against the select's `value()`). */\r\n readonly value = input.required<T>();\r\n\r\n /** Stable id, the target of the trigger's `aria-activedescendant`. Internal — never consumer-facing. */\r\n readonly optionId = `skra-option-${nextOptionId++}`;\r\n\r\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private readonly select = inject(SKRA_LISTBOX_PANEL, { optional: true });\r\n\r\n private readonly leadingSlot = contentChild(SkraOptionLeading);\r\n private readonly detailSlot = contentChild(SkraOptionDetail);\r\n protected readonly hasLeading = computed(() => !!this.leadingSlot());\r\n protected readonly hasDetail = computed(() => !!this.detailSlot());\r\n\r\n /** Keyboard active-descendant highlight (ADR 0044 §7 — Highlightable, NOT roving focus). */\r\n protected readonly active = signal(false);\r\n\r\n /**\r\n * Cardinality hint from the parent panel (ADR 0046): `false` under `skra-select` → checkmark\r\n * indicator; `true` under `skra-multi-select` → checkbox indicator. The only thing the shared\r\n * `skra-option` reads to swap the component-rendered indicator. No public-API change.\r\n */\r\n protected readonly multiple = computed(() => this.select?.multiple ?? false);\r\n\r\n /** Selection is signal-derived (ADR 0045 / ADR 037): re-derives on parent `value()`/`compareWith()` or own `value()`. */\r\n protected readonly selected = computed(\r\n () => this.select?.isSelected(this.value()) ?? false,\r\n );\r\n\r\n constructor() {\r\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\r\n if (!this.select) {\r\n console.warn(\r\n '[skra-option] has no <skra-select> ancestor — it is not registered with the keyboard ' +\r\n 'controller / selection model and cannot be picked. Project it inside a <skra-select>.',\r\n );\r\n }\r\n }\r\n }\r\n\r\n // ── SkraListboxKeyboardItem (driven by _SkraListboxKeyboard / CDK ActiveDescendantKeyManager) ──\r\n setActiveStyles(): void {\r\n this.active.set(true);\r\n }\r\n setInactiveStyles(): void {\r\n this.active.set(false);\r\n }\r\n\r\n /**\r\n * ADR 0045 Rule 1: the option's IDENTITY text (leading + label), EXCLUDING `[skra-option-detail]` and\r\n * the component-rendered indicator. Own-host `textContent` walk (the `skraMenuItem.getLabel()`\r\n * precedent) — drives the default trigger text AND type-ahead. Reading own content, NOT\r\n * `document.querySelector` (ADR 001-clean).\r\n */\r\n getLabel(): string {\r\n let text = '';\r\n const skip = (el: HTMLElement): boolean =>\r\n el.classList.contains('skra-select-option-detail') ||\r\n el.classList.contains('skra-select-option-indicator') ||\r\n el.hasAttribute('skra-option-detail');\r\n const walk = (node: Node): void => {\r\n if (node.nodeType === Node.TEXT_NODE) {\r\n text += node.textContent ?? '';\r\n return;\r\n }\r\n if (node.nodeType === Node.ELEMENT_NODE) {\r\n const el = node as HTMLElement;\r\n if (skip(el)) return;\r\n el.childNodes.forEach(walk);\r\n }\r\n };\r\n this.el.nativeElement.childNodes.forEach(walk);\r\n return text.replace(/\\s+/g, ' ').trim();\r\n }\r\n\r\n getValue(): unknown {\r\n return this.value();\r\n }\r\n\r\n /** Soft-disabled = the consumer's `aria-disabled=\"true\"` (native-attr-first, Menu precedent); read live. */\r\n get disabled(): boolean {\r\n return this.el.nativeElement.getAttribute('aria-disabled') === 'true';\r\n }\r\n\r\n protected onActivate(): void {\r\n if (this.disabled) return; // soft-disabled: not selectable (APG)\r\n this.select?.selectValue(this.value());\r\n }\r\n}\r\n","import { Directive } from '@angular/core';\r\n\r\n/**\r\n * SkraSelectTrigger — the opt-in rich-trigger marker (ADR 0045 Rule 2). Place on an `<ng-template>`\r\n * inside `<skra-select>`; the select reads it as a `TemplateRef` and stamps it in the trigger via\r\n * `ngTemplateOutlet` with `{ $implicit: value, option: selectedOption }` context — the ONLY supported\r\n * path for non-text (SVG/`<img>`) trigger presentation. With no trigger template the default trigger is\r\n * the selected option's `getLabel()` text (emoji/glyph leading content appears for free).\r\n *\r\n * <skra-select [value]=\"country()\" (valueChange)=\"country.set($event)\">\r\n * <ng-template skraSelectTrigger let-value>\r\n * <skra-icon [innerSVG]=\"flagOf(value)\"></skra-icon> {{ nameOf(value) }}\r\n * </ng-template>\r\n * <skra-option value=\"de\"><skra-icon [innerSVG]=\"flagOf('de')\"></skra-icon> Germany</skra-option>\r\n * </skra-select>\r\n */\r\n@Directive({\r\n selector: '[skraSelectTrigger]',\r\n standalone: true,\r\n})\r\nexport class SkraSelectTrigger {}\r\n","import {\r\n autoUpdate,\r\n computePosition,\r\n flip,\r\n offset as offsetMiddleware,\r\n shift,\r\n type Placement,\r\n} from '@floating-ui/dom';\r\n\r\n/**\r\n * Forge's single overlay positioning abstraction (ADR 0044 §3 rules 4–5).\r\n *\r\n * Wraps `@floating-ui/dom` so the library is an IMPLEMENTATION DETAIL: nothing outside this folder\r\n * imports it, and swapping the engine (e.g. to native CSS Anchor Positioning once it is baseline\r\n * cross-browser) is a one-file change with zero public-API impact.\r\n *\r\n * It writes **geometry only** (`left`/`top` + the resolved-side `data-skra-placement`) inline on the\r\n * floating element — the scoped geometry-only exception to ADR 021 / Visual Purism granted by\r\n * ADR 0044 §3 rule 4. It MUST NOT write any theme/state/token value inline (those stay `var(--skra-*)`\r\n * + `data-skra-*`). No portal, no z-index, no CDK, no library stylesheet.\r\n *\r\n * Decided at the first anchored component (Tooltip, 2026-06-06): a single JS path on all engines\r\n * (not native-CSS-primary + JS-fallback) — see ADR 0044 §7 + the rule-4 refinement note.\r\n */\r\n\r\n/** Forge placement intent — the base four sides; flip/shift adjust at runtime. */\r\nexport type SkraPlacement = 'top' | 'bottom' | 'left' | 'right';\r\n\r\nexport interface _PositionerOptions {\r\n /** Preferred side; `flip` re-sides on viewport collision. */\r\n placement: SkraPlacement;\r\n /** Gap between trigger and floating element, in px (resolved from a comp token by the caller). */\r\n offset?: number;\r\n /** Minimum distance from the viewport edge for `shift`, in px. */\r\n viewportPadding?: number;\r\n}\r\n\r\nexport interface _PositionerHandle {\r\n /** Stop repositioning and release the `autoUpdate` listeners. Idempotent. */\r\n destroy(): void;\r\n}\r\n\r\n/**\r\n * Anchor `floating` to `reference` and keep it positioned while visible. Returns a handle whose\r\n * `destroy()` MUST be called when the overlay hides or the owner is destroyed (no listener leak).\r\n *\r\n * `options` is a getter so live token values (offset) are re-read on every reposition.\r\n */\r\nexport function _attachPositioner(\r\n reference: HTMLElement,\r\n floating: HTMLElement,\r\n options: () => _PositionerOptions,\r\n): _PositionerHandle {\r\n const update = (): void => {\r\n const { placement, offset = 0, viewportPadding = 8 } = options();\r\n void computePosition(reference, floating, {\r\n strategy: 'fixed', // floating element renders in the top layer → viewport-relative\r\n placement: placement as Placement,\r\n middleware: [\r\n offsetMiddleware(offset),\r\n flip(),\r\n shift({ padding: viewportPadding }),\r\n ],\r\n }).then(({ x, y, placement: resolved }) => {\r\n // Geometry only (ADR 0044 §3 rule 4). Never theme/state.\r\n floating.style.left = `${x}px`;\r\n floating.style.top = `${y}px`;\r\n // Resolved side (post-flip) for orientation CSS / future arrow — a data-attr, not a style.\r\n floating.setAttribute('data-skra-placement', resolved.split('-')[0]);\r\n });\r\n };\r\n\r\n // autoUpdate repositions on scroll, resize and element resize; returns its own cleanup.\r\n const cleanup = autoUpdate(reference, floating, update);\r\n let destroyed = false;\r\n return {\r\n destroy(): void {\r\n if (destroyed) return;\r\n destroyed = true;\r\n cleanup();\r\n },\r\n };\r\n}\r\n","import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';\r\n\r\nimport type { SkraListboxKeyboardItem } from './select-types';\r\n\r\n/**\r\n * _SkraListboxKeyboard — the WAI-ARIA APG **Select-Only Combobox** listbox keyboard model, confined to\r\n * ONE file. Sibling to `menu-keyboard.ts`: per ADR 0044 §7 (2026-06-07), `@angular/cdk/a11y` is confined\r\n * to one swappable `*-keyboard.ts` controller PER APG pattern. Menu uses `FocusKeyManager` (roving REAL\r\n * focus); the listbox uses **`ActiveDescendantKeyManager`** — focus STAYS on the combobox trigger and the\r\n * active option is virtual (`aria-activedescendant`), the APG-canonical select-only model. Swapping the\r\n * engine is a one-file change, exactly as `SkraPositioner` wraps `@floating-ui/dom`.\r\n *\r\n * Owns: Down/Up active-descendant movement, Home/End, and type-ahead. Enter/Space (select), Escape and\r\n * light-dismiss (`popover=\"auto\"`) stay with the select / platform — this controller never touches them.\r\n */\r\nexport class _SkraListboxKeyboard {\r\n private manager?: ActiveDescendantKeyManager<SkraListboxKeyboardItem>;\r\n private items: SkraListboxKeyboardItem[] = [];\r\n private changeHandler?: (item: SkraListboxKeyboardItem | null) => void;\r\n\r\n /** Notified whenever the active descendant changes — the select mirrors it to `aria-activedescendant`. */\r\n onActiveChange(\r\n handler: (item: SkraListboxKeyboardItem | null) => void,\r\n ): void {\r\n this.changeHandler = handler;\r\n }\r\n\r\n /**\r\n * (Re)build the manager from the current projected option set. Called from an `effect` on the select's\r\n * signal `contentChildren` — a passed array is a static snapshot (it does not auto-track like a live\r\n * `QueryList`), so the manager is rebuilt whenever the option set changes (the documented signal↔CDK seam).\r\n */\r\n setItems(items: readonly SkraListboxKeyboardItem[]): void {\r\n this.items = [...items];\r\n this.manager?.destroy();\r\n this.manager = new ActiveDescendantKeyManager<SkraListboxKeyboardItem>(\r\n this.items,\r\n )\r\n .withTypeAhead()\r\n .withHomeAndEnd()\r\n // Disabled options stay navigable (APG-discoverable); selection is guarded by the select.\r\n // `() => false` also stops the manager from reading `item.disabled` to skip-during-navigation.\r\n .skipPredicate(() => false);\r\n this.manager.change.subscribe((index) =>\r\n this.changeHandler?.(this.items[index] ?? null),\r\n );\r\n }\r\n\r\n /** Delegate Down/Up/Home/End/type-ahead. Enter/Space/Escape are intentionally left to the select/platform. */\r\n onKeydown(event: KeyboardEvent): void {\r\n this.manager?.onKeydown(event);\r\n }\r\n\r\n get activeItem(): SkraListboxKeyboardItem | null {\r\n return this.manager?.activeItem ?? null;\r\n }\r\n\r\n /** Seed the active descendant on open: the selected option, else the first. */\r\n setActive(item: SkraListboxKeyboardItem | null): void {\r\n if (!this.manager) return;\r\n if (item) this.manager.setActiveItem(item);\r\n else this.manager.setFirstItemActive();\r\n }\r\n\r\n /** Deactivate (close): `setActiveItem(-1)` clears `_activeItem` and the highlight. */\r\n clearActive(): void {\r\n this.manager?.setActiveItem(-1);\r\n }\r\n\r\n destroy(): void {\r\n this.manager?.destroy();\r\n this.manager = undefined;\r\n }\r\n}\r\n","import {\r\n DestroyRef,\r\n Directive,\r\n ElementRef,\r\n booleanAttribute,\r\n computed,\r\n contentChildren,\r\n effect,\r\n inject,\r\n input,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { SkraFieldContext } from '@skra/ui/field';\r\n\r\nimport {\r\n _attachPositioner,\r\n type SkraPlacement,\r\n type _PositionerHandle,\r\n} from '../positioning/positioner';\r\nimport { _SkraListboxKeyboard } from './listbox-keyboard';\r\nimport { SkraOption } from './option';\r\nimport type { SkraListboxKeyboardItem, SkraListboxPanel } from './select-types';\r\n\r\nlet nextListboxId = 0;\r\n\r\n/**\r\n * _SkraListboxWidgetBase — the **trigger-shape-agnostic** core shared by every Forge listbox widget,\r\n * per the **ADR 0046 amendment (2026-06-13)**. It owns ONLY the substrate that does not depend on what\r\n * the trigger looks like: the `SkraFieldContext` cascade (ADR 013), the panel `(toggle)` →\r\n * `SkraPositioner` lifecycle + active-descendant seeding, the `_SkraListboxKeyboard` wiring\r\n * (CDK `ActiveDescendantKeyManager`, ADR 0044 §7), imperative `open()`/`close()`, teardown, and the\r\n * abstract `SkraListboxPanel` selection seam.\r\n *\r\n * Trigger BEHAVIOUR lives one level down, in a per-shape base:\r\n * - `_SkraSelectBase` adds the button + native `popovertarget` + type-ahead trigger (Select-Only\r\n * Combobox) and the ADR 0045 `[skraSelectTrigger]` rich-trigger template.\r\n * - `SkraCombobox` (no extra base) adds the editable `<input>` + filter-output trigger (ADR 0049).\r\n *\r\n * The keydown skeleton is NOT here — each trigger shape routes keys differently (the select selects on\r\n * Space and type-aheads; the combobox types into the input and never type-aheads). Forcing one keydown\r\n * through both shapes is the wrong abstraction.\r\n *\r\n * `panelTokenPrefix` makes the panel comp-token namespace overridable so each widget reads its OWN\r\n * `--skra-comp-<prefix>-panel-*` tokens (`select` for the select family, `combobox` for the combobox).\r\n *\r\n * Full contracts: adr/specs/component-{select,multi-select,combobox}-spec.md.\r\n */\r\n@Directive({\r\n host: {\r\n // Shell state reflection for the skin (the trigger control carries the ARIA + native disabled).\r\n '[attr.data-skra-disabled]': 'isDisabled() ? \"\" : null',\r\n '[attr.data-skra-readonly]': 'isReadonly() ? \"\" : null',\r\n '[attr.data-skra-validation]': 'hasError() ? \"invalid\" : null',\r\n },\r\n})\r\nexport abstract class _SkraListboxWidgetBase<T = unknown>\r\n implements SkraListboxPanel\r\n{\r\n /** Equality strategy seam (ADR 037 selection model): default `Object.is`; object values pass a custom comparator. */\r\n readonly compareWith = input<(a: T, b: T) => boolean>(Object.is);\r\n /** Value-empty hint shown in the trigger (NOT the accessible name — ADR 033). */\r\n readonly placeholder = input<string>('');\r\n /** Placement intent; flip/shift adjust at runtime. */\r\n readonly placement = input<SkraPlacement>('bottom');\r\n /** Standalone availability source (Q-1) — `SkraFieldContext` wins when present. */\r\n readonly disabled = input(false, { transform: booleanAttribute });\r\n readonly readonly = input(false, { transform: booleanAttribute });\r\n\r\n protected readonly options = contentChildren(SkraOption);\r\n\r\n protected readonly triggerRef = viewChild<ElementRef<HTMLElement>>('trigger');\r\n protected readonly panelRef = viewChild<ElementRef<HTMLElement>>('panel');\r\n\r\n protected readonly context = inject(SkraFieldContext, { optional: true });\r\n protected readonly keyboard = new _SkraListboxKeyboard();\r\n\r\n readonly panelId = `skra-listbox-${nextListboxId++}`;\r\n protected readonly isOpen = signal(false);\r\n protected readonly activeOptionId = signal<string | null>(null);\r\n\r\n private positioner?: _PositionerHandle;\r\n\r\n /** Panel comp-token namespace — `--skra-comp-<panelTokenPrefix>-panel-*`. Overridden per widget. */\r\n protected abstract readonly panelTokenPrefix: string;\r\n\r\n // ── Availability / validation (SkraFieldContext, ADR 013, with standalone fallbacks — Q-1) ──\r\n protected readonly isDisabled = computed(\r\n () => this.context?.isDisabled() ?? this.disabled(),\r\n );\r\n protected readonly isReadonly = computed(\r\n () => this.context?.isReadonly() ?? this.readonly(),\r\n );\r\n protected readonly hasError = computed(\r\n () => this.context?.hasError() ?? false,\r\n );\r\n protected readonly isRequired = computed(\r\n () => this.context?.isRequired() ?? false,\r\n );\r\n protected readonly triggerId = computed(\r\n () => this.context?.fieldId() || null,\r\n );\r\n protected readonly describedBy = computed(\r\n () => this.context?.describedByIds() ?? null,\r\n );\r\n\r\n constructor() {\r\n // Feed the keyboard controller whenever the projected option set changes (signal → array rebuild).\r\n effect(() => this.keyboard.setItems(this.options()));\r\n // Mirror the active descendant to the trigger's aria-activedescendant.\r\n this.keyboard.onActiveChange((item) =>\r\n this.activeOptionId.set(item?.optionId ?? null),\r\n );\r\n inject(DestroyRef).onDestroy(() => this.teardown());\r\n }\r\n\r\n // ── SkraListboxPanel seam — the per-widget divergence (implemented by each concrete) ──\r\n /** Live selection test: single = equality, multi = membership (both via `compareWith`). */\r\n abstract isSelected(value: unknown): boolean;\r\n /** User picked a value: single = replace + close; multi = toggle membership + keep open. */\r\n abstract selectValue(value: unknown): void;\r\n /** Cardinality hint read by `skra-option` for the indicator swap — `false` single / `true` multi. */\r\n abstract readonly multiple: boolean;\r\n /** Seed the active descendant on open: single = the selected option; multi = the first selected. */\r\n protected abstract activeSeedItem(): SkraListboxKeyboardItem | null;\r\n\r\n // ── Panel open / close (native toggle from the Popover API) ──\r\n protected onPanelToggle(event: Event): void {\r\n const open = (event as ToggleEvent).newState === 'open';\r\n this.isOpen.set(open);\r\n if (open) this.onOpen();\r\n else this.onClose();\r\n }\r\n\r\n /**\r\n * The element the panel is positioned against AND matched in width to (Q-5). Defaults to the trigger\r\n * — correct for the select family, whose trigger button fills the host. The combobox overrides it to\r\n * the host box, because its trigger is the INNER input (narrower than the bordered box + chevron), so\r\n * the panel must align to and match the box, not the input — visual parity with select.\r\n */\r\n protected positioningAnchor(): HTMLElement | undefined {\r\n return this.triggerRef()?.nativeElement;\r\n }\r\n\r\n private onOpen(): void {\r\n const anchor = this.positioningAnchor();\r\n const panel = this.panelRef()?.nativeElement;\r\n if (anchor && panel) {\r\n // Geometry-only (ADR 0044 §3 rule 4): the panel is at least as wide as the anchor (Q-5).\r\n panel.style.minInlineSize = `${anchor.offsetWidth}px`;\r\n this.positioner?.destroy();\r\n this.positioner = _attachPositioner(anchor, panel, () => ({\r\n placement: this.placement(),\r\n offset: this.cssLenPx(\r\n `--skra-comp-${this.panelTokenPrefix}-panel-offset`,\r\n ),\r\n viewportPadding: this.cssLenPx(\r\n `--skra-comp-${this.panelTokenPrefix}-panel-viewport-padding`,\r\n ),\r\n }));\r\n }\r\n // Seed the active descendant (single → selected; multi → first selected, else first).\r\n this.keyboard.setActive(this.activeSeedItem());\r\n }\r\n\r\n private onClose(): void {\r\n this.positioner?.destroy();\r\n this.positioner = undefined;\r\n this.keyboard.clearActive();\r\n this.activeOptionId.set(null);\r\n }\r\n\r\n /** Select the keyboard's active option (Enter), unless it is soft-disabled. Shared by every trigger shape. */\r\n protected selectActive(): void {\r\n const active = this.keyboard.activeItem;\r\n if (active && !active.disabled) this.selectValue(active.getValue());\r\n }\r\n\r\n protected open(): void {\r\n this.panelRef()?.nativeElement.showPopover?.();\r\n }\r\n protected close(): void {\r\n this.panelRef()?.nativeElement.hidePopover?.();\r\n }\r\n\r\n /** Read a length comp token (px/rem) off the panel computed style for the positioner. */\r\n private cssLenPx(prop: string): number {\r\n const el = this.panelRef()?.nativeElement;\r\n if (!el) return 0;\r\n const raw = getComputedStyle(el).getPropertyValue(prop).trim();\r\n if (raw.endsWith('px')) return parseFloat(raw);\r\n if (raw.endsWith('rem')) {\r\n const rootFontSize =\r\n parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\r\n return parseFloat(raw) * rootFontSize;\r\n }\r\n return parseFloat(raw) || 0;\r\n }\r\n\r\n private teardown(): void {\r\n this.keyboard.destroy();\r\n this.positioner?.destroy();\r\n }\r\n}\r\n","import { Directive, TemplateRef, contentChild } from '@angular/core';\r\n\r\nimport { _SkraListboxWidgetBase } from './listbox-widget-base';\r\nimport { SkraSelectTrigger } from './select-trigger';\r\n\r\n/**\r\n * _SkraSelectBase — the SELECT-family trigger model over {@link _SkraListboxWidgetBase}: the WAI-ARIA APG\r\n * **Select-Only Combobox** trigger. It adds the `<button>` + native `popovertarget` interaction, the\r\n * type-ahead keydown skeleton, and the ADR 0045 `[skraSelectTrigger]` rich-trigger template. Shared by\r\n * `skra-select` (single) and `skra-multi-select` (multi) — the cardinality split (ADR 0046) lives in\r\n * those concretes (the `SkraListboxPanel` seam: single replaces + closes, multi toggles + stays open).\r\n *\r\n * The trigger-shape-agnostic substrate (field cascade, panel toggle/positioner, keyboard wiring,\r\n * open/close, the selection seam) lives in the parent base, shared verbatim with `skra-combobox`\r\n * (which has a different — editable input — trigger; ADR 0046 amendment 2026-06-13).\r\n *\r\n * Full contract: adr/specs/component-select-spec.md + adr/specs/component-multi-select-spec.md.\r\n */\r\n@Directive()\r\nexport abstract class _SkraSelectBase<\r\n T = unknown,\r\n> extends _SkraListboxWidgetBase<T> {\r\n /** Select-family panel token namespace — `--skra-comp-select-panel-*` (shared single + multi). */\r\n protected readonly panelTokenPrefix = 'select';\r\n\r\n /** Opt-in rich trigger template (ADR 0045 Rule 2). Select-family only — a combobox input shows text. */\r\n protected readonly triggerTemplate = contentChild(SkraSelectTrigger, {\r\n read: TemplateRef,\r\n });\r\n\r\n // ── Trigger interaction (button + native popovertarget) ──\r\n protected onTriggerClick(event: MouseEvent): void {\r\n // Block the native popovertarget open when readonly (disabled is unfocusable/inert natively).\r\n if (this.isReadonly()) event.preventDefault();\r\n }\r\n\r\n protected onTriggerKeydown(event: KeyboardEvent): void {\r\n if (this.isDisabled() || this.isReadonly()) return; // never opens / never mutates\r\n const key = event.key;\r\n const isSpace = key === ' ' || key === 'Spacebar';\r\n const isNav =\r\n key === 'ArrowDown' ||\r\n key === 'ArrowUp' ||\r\n key === 'Home' ||\r\n key === 'End';\r\n const isPrintable =\r\n key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;\r\n\r\n if (!this.isOpen()) {\r\n // Single open path: suppress the popovertarget's own toggle (Enter/Space) too and open here.\r\n if (isNav || isSpace || key === 'Enter' || isPrintable) {\r\n event.preventDefault();\r\n this.open();\r\n }\r\n return;\r\n }\r\n\r\n // Open:\r\n if (key === 'Enter' || isSpace) {\r\n // Suppress the popovertarget toggle; the concrete `selectValue` decides close (single) vs stay-open (multi).\r\n event.preventDefault();\r\n this.selectActive();\r\n return;\r\n }\r\n if (key === 'Tab') {\r\n this.close(); // APG: Tab closes (keep value); focus proceeds (no preventDefault)\r\n return;\r\n }\r\n if (key === 'Escape') return; // platform (popover=\"auto\") closes; onPanelToggle handles cleanup\r\n if (isNav || isPrintable) {\r\n event.preventDefault();\r\n this.keyboard.onKeydown(event); // move / type-ahead the active descendant\r\n }\r\n }\r\n}\r\n","// @skra/ui/core — shared internal satellites (ADR 0054). Consumed cross-entry by\r\n// select / multi-select / combobox / datepicker / menu / popover / tooltip.\r\n\r\n// --- Public shared surface ---\r\nexport * from './lib/select/option';\r\nexport * from './lib/select/option.directives';\r\nexport * from './lib/select/select-trigger';\r\nexport {\r\n SKRA_LISTBOX_PANEL,\r\n type SkraListboxPanel,\r\n type SkraListboxKeyboardItem,\r\n} from './lib/select/select-types';\r\n\r\n// --- Internal shared bases (`_`-prefixed = outside SemVer, ADR 0054 R-54.4/R-54.5) ---\r\nexport * from './lib/select/select-base';\r\nexport * from './lib/select/listbox-widget-base';\r\n// Positioner: `_attachPositioner`/`_PositionerOptions`/`_PositionerHandle` are internal\r\n// (`_`-prefixed = outside SemVer — O-33 (6a) done). `SkraPlacement` is PUBLIC by ruling\r\n// (consumer-facing placement inputs, re-exported by tooltip/popover/menu/datepicker).\r\n// See ADR 0054 §7 (2026-07-03 note); enforced by export-surface-validator.\r\nexport * from './lib/positioning/positioner';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["offset","offsetMiddleware"],"mappings":";;;;;;AAwCA;;;;AAIG;MACU,kBAAkB,GAAG,IAAI,cAAc,CAClD,oBAAoB;;AC5CtB;;;AAGG;MAKU,iBAAiB,CAAA;uGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA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.ts","../../../../libs/ui/core/src/lib/select/option.directives.ts","../../../../libs/ui/core/src/lib/select/option.ts","../../../../libs/ui/core/src/lib/select/select-trigger.ts","../../../../libs/ui/core/src/lib/positioning/positioner.ts","../../../../libs/ui/core/src/lib/select/listbox-keyboard.ts","../../../../libs/ui/core/src/lib/select/listbox-widget-base.ts","../../../../libs/ui/core/src/lib/select/select-base.ts","../../../../libs/ui/core/src/index.ts","../../../../libs/ui/core/src/skra-ui-core.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/**\n * What a `skra-option` needs from its listbox parent — a narrow contract that breaks the\n * parent↔option import cycle (the `SKRA_MENU` precedent). A token (not a concrete class) so the option\n * file never imports a widget file — no runtime import cycle. Implemented by `_SkraListboxWidgetBase`,\n * so it is shared by `skra-select`, `skra-multi-select` AND `skra-combobox` (ADR 0046 amendment).\n */\nexport interface SkraListboxPanel {\n /** Live selection test for an option's value (signal-driven: default `Object.is` or consumer `compareWith`). */\n isSelected(value: unknown): boolean;\n /**\n * A user picked this value (pointer/keyboard). Single-select emits `valueChange` + closes; multi-select\n * TOGGLES membership and keeps the panel open (ADR 0046); combobox replaces + closes (ADR 0049).\n * Consumer owns `value` (ADR 037).\n */\n selectValue(value: unknown): void;\n /**\n * Cardinality hint (ADR 0046) — `false` on single widgets (`skra-select`/`skra-combobox`), `true` on\n * `skra-multi-select`. The ONLY thing `skra-option` reads to swap its component-rendered indicator\n * (checkmark ↔ checkbox). NOT an Angular input; cardinality is a component identity, never a runtime flag.\n */\n readonly multiple: boolean;\n}\n\n/**\n * The item shape the listbox keyboard controller drives. Structurally a CDK `Highlightable`\n * (`setActiveStyles`/`setInactiveStyles`) + `ListKeyManagerOption` (`getLabel`/`disabled`), plus the\n * option's `id` (→ `aria-activedescendant`) and `getValue()` (Enter-to-select). Declared HERE — cdk-free —\n * so the only `@angular/cdk` importer stays `listbox-keyboard.ts` (the `menu-types.ts` precedent).\n */\nexport interface SkraListboxKeyboardItem {\n readonly optionId: string;\n setActiveStyles(): void;\n setInactiveStyles(): void;\n getLabel(): string;\n getValue(): unknown;\n readonly disabled: boolean;\n}\n\n/**\n * DI token a listbox widget provides (`useExisting`) and a `skra-option` injects. A token (not a concrete\n * class) so the option file never imports a widget file — no runtime import cycle. Provided by\n * `skra-select`, `skra-multi-select`, and `skra-combobox`.\n */\nexport const SKRA_LISTBOX_PANEL = new InjectionToken<SkraListboxPanel>(\n 'SKRA_LISTBOX_PANEL',\n);\n","import { Directive } from '@angular/core';\n\n/**\n * Slot marker: the leading icon/flag of a `skra-option` — part of the option IDENTITY (ADR 0045\n * Rule 4), so it flows into `getLabel()` (emoji/glyph leading appears in the default trigger for free).\n */\n@Directive({\n selector: '[skra-option-leading]',\n standalone: true,\n})\nexport class SkraOptionLeading {}\n\n/**\n * Slot marker: secondary DETAIL text of a `skra-option` (e.g. a dial code, a description) — list-only\n * (ADR 0045 Rule 4), EXCLUDED from `getLabel()` and the trigger summary.\n */\n@Directive({\n selector: '[skra-option-detail]',\n standalone: true,\n})\nexport class SkraOptionDetail {}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n contentChild,\n inject,\n input,\n signal,\n} from '@angular/core';\n\nimport {\n SKRA_LISTBOX_PANEL,\n type SkraListboxKeyboardItem,\n} from './select-types';\nimport { SkraOptionDetail, SkraOptionLeading } from './option.directives';\n\ndeclare const ngDevMode: boolean | undefined;\n\nlet nextOptionId = 0;\n\n/**\n * SkraOption — one selectable row in a `skra-select` listbox, a Component on the custom-element host\n * `skra-option` (ADR 040 content-bearing host; there is no native option element that holds rich content\n * outside `<select>`). Carries `value` + rich projected content: a leading icon (`[skra-option-leading]`)\n * and a primary label = the IDENTITY (→ `getLabel()` / the default trigger, ADR 0045), plus an optional\n * secondary `[skra-option-detail]` that is list-only (excluded from the trigger). The selection\n * indicator (trailing checkmark) is component-rendered, driven by `aria-selected` — NOT a slot; iteration 2\n * swaps it for a per-row checkbox with no API change.\n *\n * Implements `SkraListboxKeyboardItem` so `_SkraListboxKeyboard` (CDK `ActiveDescendantKeyManager`) can\n * highlight it (`setActiveStyles`/`setInactiveStyles` → `data-skra-active`) and type-ahead to it\n * (`getLabel`). Disabled is native-attr-first (Menu precedent): the consumer sets `aria-disabled=\"true\"`\n * and Forge OBSERVES it — disabled options stay navigable (discoverable) but cannot be selected.\n *\n * Full contract: adr/specs/component-select-spec.md.\n */\n@Component({\n selector: 'skra-option',\n standalone: true,\n exportAs: 'skraOption',\n template: `\n @if (hasLeading()) {\n <span class=\"skra-select-option-leading\"\n ><ng-content select=\"[skra-option-leading]\"></ng-content\n ></span>\n }\n <span class=\"skra-select-option-label\"><ng-content></ng-content></span>\n @if (hasDetail()) {\n <span class=\"skra-select-option-detail\"\n ><ng-content select=\"[skra-option-detail]\"></ng-content\n ></span>\n }\n <span\n class=\"skra-select-option-indicator\"\n [class.skra-select-option-indicator--checkbox]=\"multiple()\"\n aria-hidden=\"true\"\n ></span>\n `,\n styleUrl: './option.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n role: 'option',\n '[id]': 'optionId',\n '[attr.aria-selected]': 'selected() ? \"true\" : \"false\"',\n '[attr.data-skra-active]': 'active() ? \"\" : null',\n '(click)': 'onActivate()',\n // Disabled = the consumer's native `aria-disabled=\"true\"` (observed live) — no Forge binding.\n },\n})\nexport class SkraOption<T = unknown> implements SkraListboxKeyboardItem {\n /** The option's value (ADR 037 — consumer-owned; compared against the select's `value()`). */\n readonly value = input.required<T>();\n\n /** Stable id, the target of the trigger's `aria-activedescendant`. Internal — never consumer-facing. */\n readonly optionId = `skra-option-${nextOptionId++}`;\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly select = inject(SKRA_LISTBOX_PANEL, { optional: true });\n\n private readonly leadingSlot = contentChild(SkraOptionLeading);\n private readonly detailSlot = contentChild(SkraOptionDetail);\n protected readonly hasLeading = computed(() => !!this.leadingSlot());\n protected readonly hasDetail = computed(() => !!this.detailSlot());\n\n /** Keyboard active-descendant highlight (ADR 0044 §7 — Highlightable, NOT roving focus). */\n protected readonly active = signal(false);\n\n /**\n * Cardinality hint from the parent panel (ADR 0046): `false` under `skra-select` → checkmark\n * indicator; `true` under `skra-multi-select` → checkbox indicator. The only thing the shared\n * `skra-option` reads to swap the component-rendered indicator. No public-API change.\n */\n protected readonly multiple = computed(() => this.select?.multiple ?? false);\n\n /** Selection is signal-derived (ADR 0045 / ADR 037): re-derives on parent `value()`/`compareWith()` or own `value()`. */\n protected readonly selected = computed(\n () => this.select?.isSelected(this.value()) ?? false,\n );\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this.select) {\n console.warn(\n '[skra-option] has no <skra-select> ancestor — it is not registered with the keyboard ' +\n 'controller / selection model and cannot be picked. Project it inside a <skra-select>.',\n );\n }\n }\n }\n\n // ── SkraListboxKeyboardItem (driven by _SkraListboxKeyboard / CDK ActiveDescendantKeyManager) ──\n setActiveStyles(): void {\n this.active.set(true);\n }\n setInactiveStyles(): void {\n this.active.set(false);\n }\n\n /**\n * ADR 0045 Rule 1: the option's IDENTITY text (leading + label), EXCLUDING `[skra-option-detail]` and\n * the component-rendered indicator. Own-host `textContent` walk (the `skraMenuItem.getLabel()`\n * precedent) — drives the default trigger text AND type-ahead. Reading own content, NOT\n * `document.querySelector` (ADR 001-clean).\n */\n getLabel(): string {\n let text = '';\n const skip = (el: HTMLElement): boolean =>\n el.classList.contains('skra-select-option-detail') ||\n el.classList.contains('skra-select-option-indicator') ||\n el.hasAttribute('skra-option-detail');\n const walk = (node: Node): void => {\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent ?? '';\n return;\n }\n if (node.nodeType === Node.ELEMENT_NODE) {\n const el = node as HTMLElement;\n if (skip(el)) return;\n el.childNodes.forEach(walk);\n }\n };\n this.el.nativeElement.childNodes.forEach(walk);\n return text.replace(/\\s+/g, ' ').trim();\n }\n\n getValue(): unknown {\n return this.value();\n }\n\n /** Soft-disabled = the consumer's `aria-disabled=\"true\"` (native-attr-first, Menu precedent); read live. */\n get disabled(): boolean {\n return this.el.nativeElement.getAttribute('aria-disabled') === 'true';\n }\n\n protected onActivate(): void {\n if (this.disabled) return; // soft-disabled: not selectable (APG)\n this.select?.selectValue(this.value());\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * SkraSelectTrigger — the opt-in rich-trigger marker (ADR 0045 Rule 2). Place on an `<ng-template>`\n * inside `<skra-select>`; the select reads it as a `TemplateRef` and stamps it in the trigger via\n * `ngTemplateOutlet` with `{ $implicit: value, option: selectedOption }` context — the ONLY supported\n * path for non-text (SVG/`<img>`) trigger presentation. With no trigger template the default trigger is\n * the selected option's `getLabel()` text (emoji/glyph leading content appears for free).\n *\n * <skra-select [value]=\"country()\" (valueChange)=\"country.set($event)\">\n * <ng-template skraSelectTrigger let-value>\n * <skra-icon [innerSVG]=\"flagOf(value)\"></skra-icon> {{ nameOf(value) }}\n * </ng-template>\n * <skra-option value=\"de\"><skra-icon [innerSVG]=\"flagOf('de')\"></skra-icon> Germany</skra-option>\n * </skra-select>\n */\n@Directive({\n selector: '[skraSelectTrigger]',\n standalone: true,\n})\nexport class SkraSelectTrigger {}\n","import {\r\n autoUpdate,\r\n computePosition,\r\n flip,\r\n offset as offsetMiddleware,\r\n shift,\r\n type Placement,\r\n} from '@floating-ui/dom';\r\n\r\n/**\r\n * Forge's single overlay positioning abstraction (ADR 0044 §3 rules 4–5).\r\n *\r\n * Wraps `@floating-ui/dom` so the library is an IMPLEMENTATION DETAIL: nothing outside this folder\r\n * imports it, and swapping the engine (e.g. to native CSS Anchor Positioning once it is baseline\r\n * cross-browser) is a one-file change with zero public-API impact.\r\n *\r\n * It writes **geometry only** (`left`/`top` + the resolved-side `data-skra-placement`) inline on the\r\n * floating element — the scoped geometry-only exception to ADR 021 / Visual Purism granted by\r\n * ADR 0044 §3 rule 4. It MUST NOT write any theme/state/token value inline (those stay `var(--skra-*)`\r\n * + `data-skra-*`). No portal, no z-index, no CDK, no library stylesheet.\r\n *\r\n * Decided at the first anchored component (Tooltip, 2026-06-06): a single JS path on all engines\r\n * (not native-CSS-primary + JS-fallback) — see ADR 0044 §7 + the rule-4 refinement note.\r\n */\r\n\r\n/** Forge placement intent — the base four sides; flip/shift adjust at runtime. */\r\nexport type SkraPlacement = 'top' | 'bottom' | 'left' | 'right';\r\n\r\nexport interface _PositionerOptions {\r\n /** Preferred side; `flip` re-sides on viewport collision. */\r\n placement: SkraPlacement;\r\n /** Gap between trigger and floating element, in px (resolved from a comp token by the caller). */\r\n offset?: number;\r\n /** Minimum distance from the viewport edge for `shift`, in px. */\r\n viewportPadding?: number;\r\n}\r\n\r\nexport interface _PositionerHandle {\r\n /** Stop repositioning and release the `autoUpdate` listeners. Idempotent. */\r\n destroy(): void;\r\n}\r\n\r\n/**\r\n * Anchor `floating` to `reference` and keep it positioned while visible. Returns a handle whose\r\n * `destroy()` MUST be called when the overlay hides or the owner is destroyed (no listener leak).\r\n *\r\n * `options` is a getter so live token values (offset) are re-read on every reposition.\r\n */\r\nexport function _attachPositioner(\r\n reference: HTMLElement,\r\n floating: HTMLElement,\r\n options: () => _PositionerOptions,\r\n): _PositionerHandle {\r\n let destroyed = false;\r\n let seq = 0;\r\n\r\n const update = (): void => {\r\n const { placement, offset = 0, viewportPadding = 8 } = options();\r\n // `computePosition` is async, so two things can go wrong between call and settle: the handle can\r\n // be destroyed (writing geometry onto a detached / hidden node), and a newer update can settle\r\n // first (landing stale coordinates). Guard on both — this file positions every overlay in the\r\n // library, so a two-line guard is cheap insurance.\r\n const token = ++seq;\r\n computePosition(reference, floating, {\r\n strategy: 'fixed', // floating element renders in the top layer → viewport-relative\r\n placement: placement as Placement,\r\n middleware: [\r\n offsetMiddleware(offset),\r\n // NOTE: `flip()` deliberately left unpadded pending a decision — see the review residual.\r\n // Giving it `viewportPadding` would change resolved placement for all 7 overlay consumers\r\n // with no visual test to catch a regression; that is a measured change, not a cleanup.\r\n flip(),\r\n shift({ padding: viewportPadding }),\r\n ],\r\n })\r\n .then(({ x, y, placement: resolved }) => {\r\n if (destroyed || token !== seq) return;\r\n // Geometry only (ADR 0044 §3 rule 4). Never theme/state.\r\n floating.style.left = `${x}px`;\r\n floating.style.top = `${y}px`;\r\n // Resolved side (post-flip) for orientation CSS / future arrow — a data-attr, not a style.\r\n floating.setAttribute('data-skra-placement', resolved.split('-')[0]);\r\n })\r\n .catch(() => {\r\n // Positioning is best-effort: a rejection must never surface as an unhandled rejection\r\n // (fatal under Node, e.g. any future SSR/prerender path).\r\n });\r\n };\r\n\r\n // autoUpdate repositions on scroll, resize and element resize; returns its own cleanup.\r\n const cleanup = autoUpdate(reference, floating, update);\r\n return {\r\n destroy(): void {\r\n if (destroyed) return;\r\n destroyed = true;\r\n cleanup();\r\n },\r\n };\r\n}\r\n","import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';\n\nimport type { SkraListboxKeyboardItem } from './select-types';\n\n/**\n * _SkraListboxKeyboard — the WAI-ARIA APG **Select-Only Combobox** listbox keyboard model, confined to\n * ONE file. Sibling to `menu-keyboard.ts`: per ADR 0044 §7 (2026-06-07), `@angular/cdk/a11y` is confined\n * to one swappable `*-keyboard.ts` controller PER APG pattern. Menu uses `FocusKeyManager` (roving REAL\n * focus); the listbox uses **`ActiveDescendantKeyManager`** — focus STAYS on the combobox trigger and the\n * active option is virtual (`aria-activedescendant`), the APG-canonical select-only model. Swapping the\n * engine is a one-file change, exactly as `SkraPositioner` wraps `@floating-ui/dom`.\n *\n * Owns: Down/Up active-descendant movement, Home/End, and type-ahead. Enter/Space (select), Escape and\n * light-dismiss (`popover=\"auto\"`) stay with the select / platform — this controller never touches them.\n */\nexport class _SkraListboxKeyboard {\n private manager?: ActiveDescendantKeyManager<SkraListboxKeyboardItem>;\n private items: SkraListboxKeyboardItem[] = [];\n private changeHandler?: (item: SkraListboxKeyboardItem | null) => void;\n\n /** Notified whenever the active descendant changes — the select mirrors it to `aria-activedescendant`. */\n onActiveChange(\n handler: (item: SkraListboxKeyboardItem | null) => void,\n ): void {\n this.changeHandler = handler;\n }\n\n /**\n * (Re)build the manager from the current projected option set. Called from an `effect` on the select's\n * signal `contentChildren` — a passed array is a static snapshot (it does not auto-track like a live\n * `QueryList`), so the manager is rebuilt whenever the option set changes (the documented signal↔CDK seam).\n */\n setItems(items: readonly SkraListboxKeyboardItem[]): void {\n this.items = [...items];\n this.manager?.destroy();\n this.manager = new ActiveDescendantKeyManager<SkraListboxKeyboardItem>(\n this.items,\n )\n .withTypeAhead()\n .withHomeAndEnd()\n // Disabled options stay navigable (APG-discoverable); selection is guarded by the select.\n // `() => false` also stops the manager from reading `item.disabled` to skip-during-navigation.\n .skipPredicate(() => false);\n this.manager.change.subscribe((index) =>\n this.changeHandler?.(this.items[index] ?? null),\n );\n }\n\n /** Delegate Down/Up/Home/End/type-ahead. Enter/Space/Escape are intentionally left to the select/platform. */\n onKeydown(event: KeyboardEvent): void {\n this.manager?.onKeydown(event);\n }\n\n get activeItem(): SkraListboxKeyboardItem | null {\n return this.manager?.activeItem ?? null;\n }\n\n /** Seed the active descendant on open: the selected option, else the first. */\n setActive(item: SkraListboxKeyboardItem | null): void {\n if (!this.manager) return;\n if (item) this.manager.setActiveItem(item);\n else this.manager.setFirstItemActive();\n }\n\n /** Deactivate (close): `setActiveItem(-1)` clears `_activeItem` and the highlight. */\n clearActive(): void {\n this.manager?.setActiveItem(-1);\n }\n\n destroy(): void {\n this.manager?.destroy();\n this.manager = undefined;\n }\n}\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n booleanAttribute,\n computed,\n contentChildren,\n effect,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { SkraFieldContext } from '@skra/ui/field';\n\nimport {\n _attachPositioner,\n type SkraPlacement,\n type _PositionerHandle,\n} from '../positioning/positioner';\nimport { _SkraListboxKeyboard } from './listbox-keyboard';\nimport { SkraOption } from './option';\nimport type { SkraListboxKeyboardItem, SkraListboxPanel } from './select-types';\n\nlet nextListboxId = 0;\n\n/**\n * _SkraListboxWidgetBase — the **trigger-shape-agnostic** core shared by every Forge listbox widget,\n * per the **ADR 0046 amendment (2026-06-13)**. It owns ONLY the substrate that does not depend on what\n * the trigger looks like: the `SkraFieldContext` cascade (ADR 013), the panel `(toggle)` →\n * `SkraPositioner` lifecycle + active-descendant seeding, the `_SkraListboxKeyboard` wiring\n * (CDK `ActiveDescendantKeyManager`, ADR 0044 §7), imperative `open()`/`close()`, teardown, and the\n * abstract `SkraListboxPanel` selection seam.\n *\n * Trigger BEHAVIOUR lives one level down, in a per-shape base:\n * - `_SkraSelectBase` adds the button + native `popovertarget` + type-ahead trigger (Select-Only\n * Combobox) and the ADR 0045 `[skraSelectTrigger]` rich-trigger template.\n * - `SkraCombobox` (no extra base) adds the editable `<input>` + filter-output trigger (ADR 0049).\n *\n * The keydown skeleton is NOT here — each trigger shape routes keys differently (the select selects on\n * Space and type-aheads; the combobox types into the input and never type-aheads). Forcing one keydown\n * through both shapes is the wrong abstraction.\n *\n * `panelTokenPrefix` makes the panel comp-token namespace overridable so each widget reads its OWN\n * `--skra-comp-<prefix>-panel-*` tokens (`select` for the select family, `combobox` for the combobox).\n *\n * Full contracts: adr/specs/component-{select,multi-select,combobox}-spec.md.\n */\n@Directive({\n host: {\n // Shell state reflection for the skin (the trigger control carries the ARIA + native disabled).\n '[attr.data-skra-disabled]': 'isDisabled() ? \"\" : null',\n '[attr.data-skra-readonly]': 'isReadonly() ? \"\" : null',\n '[attr.data-skra-validation]': 'hasError() ? \"invalid\" : null',\n },\n})\nexport abstract class _SkraListboxWidgetBase<T = unknown>\n implements SkraListboxPanel\n{\n /** Equality strategy seam (ADR 037 selection model): default `Object.is`; object values pass a custom comparator. */\n readonly compareWith = input<(a: T, b: T) => boolean>(Object.is);\n /** Value-empty hint shown in the trigger (NOT the accessible name — ADR 033). */\n readonly placeholder = input<string>('');\n /** Placement intent; flip/shift adjust at runtime. */\n readonly placement = input<SkraPlacement>('bottom');\n /** Standalone availability source (Q-1) — `SkraFieldContext` wins when present. */\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n\n protected readonly options = contentChildren(SkraOption);\n\n protected readonly triggerRef = viewChild<ElementRef<HTMLElement>>('trigger');\n protected readonly panelRef = viewChild<ElementRef<HTMLElement>>('panel');\n\n protected readonly context = inject(SkraFieldContext, { optional: true });\n protected readonly keyboard = new _SkraListboxKeyboard();\n\n readonly panelId = `skra-listbox-${nextListboxId++}`;\n protected readonly isOpen = signal(false);\n protected readonly activeOptionId = signal<string | null>(null);\n\n private positioner?: _PositionerHandle;\n\n /** Panel comp-token namespace — `--skra-comp-<panelTokenPrefix>-panel-*`. Overridden per widget. */\n protected abstract readonly panelTokenPrefix: string;\n\n // ── Availability / validation (SkraFieldContext, ADR 013, with standalone fallbacks — Q-1) ──\n protected readonly isDisabled = computed(\n () => this.context?.isDisabled() ?? this.disabled(),\n );\n protected readonly isReadonly = computed(\n () => this.context?.isReadonly() ?? this.readonly(),\n );\n protected readonly hasError = computed(\n () => this.context?.hasError() ?? false,\n );\n protected readonly isRequired = computed(\n () => this.context?.isRequired() ?? false,\n );\n protected readonly triggerId = computed(\n () => this.context?.fieldId() || null,\n );\n protected readonly describedBy = computed(\n () => this.context?.describedByIds() ?? null,\n );\n\n constructor() {\n // Feed the keyboard controller whenever the projected option set changes (signal → array rebuild).\n effect(() => this.keyboard.setItems(this.options()));\n // Mirror the active descendant to the trigger's aria-activedescendant.\n this.keyboard.onActiveChange((item) =>\n this.activeOptionId.set(item?.optionId ?? null),\n );\n inject(DestroyRef).onDestroy(() => this.teardown());\n }\n\n // ── SkraListboxPanel seam — the per-widget divergence (implemented by each concrete) ──\n /** Live selection test: single = equality, multi = membership (both via `compareWith`). */\n abstract isSelected(value: unknown): boolean;\n /** User picked a value: single = replace + close; multi = toggle membership + keep open. */\n abstract selectValue(value: unknown): void;\n /** Cardinality hint read by `skra-option` for the indicator swap — `false` single / `true` multi. */\n abstract readonly multiple: boolean;\n /** Seed the active descendant on open: single = the selected option; multi = the first selected. */\n protected abstract activeSeedItem(): SkraListboxKeyboardItem | null;\n\n // ── Panel open / close (native toggle from the Popover API) ──\n protected onPanelToggle(event: Event): void {\n const open = (event as ToggleEvent).newState === 'open';\n this.isOpen.set(open);\n if (open) this.onOpen();\n else this.onClose();\n }\n\n /**\n * The element the panel is positioned against AND matched in width to (Q-5). Defaults to the trigger\n * — correct for the select family, whose trigger button fills the host. The combobox overrides it to\n * the host box, because its trigger is the INNER input (narrower than the bordered box + chevron), so\n * the panel must align to and match the box, not the input — visual parity with select.\n */\n protected positioningAnchor(): HTMLElement | undefined {\n return this.triggerRef()?.nativeElement;\n }\n\n private onOpen(): void {\n const anchor = this.positioningAnchor();\n const panel = this.panelRef()?.nativeElement;\n if (anchor && panel) {\n // Geometry-only (ADR 0044 §3 rule 4): the panel is at least as wide as the anchor (Q-5).\n panel.style.minInlineSize = `${anchor.offsetWidth}px`;\n this.positioner?.destroy();\n this.positioner = _attachPositioner(anchor, panel, () => ({\n placement: this.placement(),\n offset: this.cssLenPx(\n `--skra-comp-${this.panelTokenPrefix}-panel-offset`,\n ),\n viewportPadding: this.cssLenPx(\n `--skra-comp-${this.panelTokenPrefix}-panel-viewport-padding`,\n ),\n }));\n }\n // Seed the active descendant (single → selected; multi → first selected, else first).\n this.keyboard.setActive(this.activeSeedItem());\n }\n\n private onClose(): void {\n this.positioner?.destroy();\n this.positioner = undefined;\n this.keyboard.clearActive();\n this.activeOptionId.set(null);\n }\n\n /** Select the keyboard's active option (Enter), unless it is soft-disabled. Shared by every trigger shape. */\n protected selectActive(): void {\n const active = this.keyboard.activeItem;\n if (active && !active.disabled) this.selectValue(active.getValue());\n }\n\n protected open(): void {\n this.panelRef()?.nativeElement.showPopover?.();\n }\n protected close(): void {\n this.panelRef()?.nativeElement.hidePopover?.();\n }\n\n /** Read a length comp token (px/rem) off the panel computed style for the positioner. */\n private cssLenPx(prop: string): number {\n const el = this.panelRef()?.nativeElement;\n if (!el) return 0;\n const raw = getComputedStyle(el).getPropertyValue(prop).trim();\n if (raw.endsWith('px')) return parseFloat(raw);\n if (raw.endsWith('rem')) {\n const rootFontSize =\n parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n return parseFloat(raw) * rootFontSize;\n }\n return parseFloat(raw) || 0;\n }\n\n private teardown(): void {\n this.keyboard.destroy();\n this.positioner?.destroy();\n }\n}\n","import { Directive, TemplateRef, contentChild } from '@angular/core';\r\n\r\nimport { _SkraListboxWidgetBase } from './listbox-widget-base';\r\nimport { SkraSelectTrigger } from './select-trigger';\r\n\r\n/**\r\n * _SkraSelectBase — the SELECT-family trigger model over {@link _SkraListboxWidgetBase}: the WAI-ARIA APG\r\n * **Select-Only Combobox** trigger. It adds the `<button>` + native `popovertarget` interaction, the\r\n * type-ahead keydown skeleton, and the ADR 0045 `[skraSelectTrigger]` rich-trigger template. Shared by\r\n * `skra-select` (single) and `skra-multi-select` (multi) — the cardinality split (ADR 0046) lives in\r\n * those concretes (the `SkraListboxPanel` seam: single replaces + closes, multi toggles + stays open).\r\n *\r\n * The trigger-shape-agnostic substrate (field cascade, panel toggle/positioner, keyboard wiring,\r\n * open/close, the selection seam) lives in the parent base, shared verbatim with `skra-combobox`\r\n * (which has a different — editable input — trigger; ADR 0046 amendment 2026-06-13).\r\n *\r\n * Full contract: adr/specs/component-select-spec.md + adr/specs/component-multi-select-spec.md.\r\n */\r\n@Directive()\r\nexport abstract class _SkraSelectBase<\r\n T = unknown,\r\n> extends _SkraListboxWidgetBase<T> {\r\n /** Select-family panel token namespace — `--skra-comp-select-panel-*` (shared single + multi). */\r\n protected readonly panelTokenPrefix = 'select';\r\n\r\n /** Opt-in rich trigger template (ADR 0045 Rule 2). Select-family only — a combobox input shows text. */\r\n protected readonly triggerTemplate = contentChild(SkraSelectTrigger, {\r\n read: TemplateRef,\r\n });\r\n\r\n // ── Trigger interaction (button + native popovertarget) ──\r\n protected onTriggerClick(event: MouseEvent): void {\r\n // Block the native popovertarget open when readonly (disabled is unfocusable/inert natively).\r\n if (this.isReadonly()) event.preventDefault();\r\n }\r\n\r\n protected onTriggerKeydown(event: KeyboardEvent): void {\r\n if (this.isDisabled() || this.isReadonly()) return; // never opens / never mutates\r\n const key = event.key;\r\n const isSpace = key === ' ' || key === 'Spacebar';\r\n const isNav =\r\n key === 'ArrowDown' ||\r\n key === 'ArrowUp' ||\r\n key === 'Home' ||\r\n key === 'End';\r\n const isPrintable =\r\n key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;\r\n\r\n if (!this.isOpen()) {\r\n // Single open path: suppress the popovertarget's own toggle (Enter/Space) too and open here.\r\n if (isNav || isSpace || key === 'Enter' || isPrintable) {\r\n event.preventDefault();\r\n this.open();\r\n }\r\n return;\r\n }\r\n\r\n // Open:\r\n if (key === 'Enter' || isSpace) {\r\n // Suppress the popovertarget toggle; the concrete `selectValue` decides close (single) vs stay-open (multi).\r\n event.preventDefault();\r\n this.selectActive();\r\n return;\r\n }\r\n if (key === 'Tab') {\r\n this.close(); // APG: Tab closes (keep value); focus proceeds (no preventDefault)\r\n return;\r\n }\r\n if (key === 'Escape') return; // platform (popover=\"auto\") closes; onPanelToggle handles cleanup\r\n if (key === 'ArrowUp' && event.altKey) {\r\n // APG select-only combobox: Alt+Up closes and keeps the current value, focus stays on the\r\n // trigger. Must be handled BEFORE the nav branch — `ArrowUp` is `isNav`, so it would otherwise\r\n // be preventDefault'ed and handed to the key manager, which ignores modified arrows: the\r\n // keystroke did nothing at all.\r\n event.preventDefault();\r\n this.close();\r\n return;\r\n }\r\n if (isNav || isPrintable) {\r\n event.preventDefault();\r\n this.keyboard.onKeydown(event); // move / type-ahead the active descendant\r\n }\r\n }\r\n}\r\n","// @skra/ui/core — shared internal satellites (ADR 0054). Consumed cross-entry by\n// select / multi-select / combobox / datepicker / menu / popover / tooltip.\n\n// --- Public shared surface ---\nexport * from './lib/select/option';\nexport * from './lib/select/option.directives';\nexport * from './lib/select/select-trigger';\nexport {\n SKRA_LISTBOX_PANEL,\n type SkraListboxPanel,\n type SkraListboxKeyboardItem,\n} from './lib/select/select-types';\n\n// --- Internal shared bases (`_`-prefixed = outside SemVer, ADR 0054 R-54.4/R-54.5) ---\nexport * from './lib/select/select-base';\nexport * from './lib/select/listbox-widget-base';\n// Positioner: `_attachPositioner`/`_PositionerOptions`/`_PositionerHandle` are internal\n// (`_`-prefixed = outside SemVer — O-33 (6a) done). `SkraPlacement` is PUBLIC by ruling\n// (consumer-facing placement inputs, re-exported by tooltip/popover/menu/datepicker).\n// See ADR 0054 §7 (2026-07-03 note); enforced by export-surface-validator.\nexport * from './lib/positioning/positioner';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["offset","offsetMiddleware"],"mappings":";;;;;;AAwCA;;;;AAIG;MACU,kBAAkB,GAAG,IAAI,cAAc,CAClD,oBAAoB;;AC5CtB;;;AAGG;MAKU,iBAAiB,CAAA;uGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;AAGD;;;AAGG;MAKU,gBAAgB,CAAA;uGAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAhB,gBAAgB,EAA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K,IAAI,WAAW,EAAE;YACxB,KAAK,CAAC,cAAc,EAAE;YACtB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjC;IACF;uGA/DoB,eAAe,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,YAAA,EAAA,iBAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAOe,iBAAiB,EAAA,WAAA,EAAA,IAAA,EAAA,IAAA,EAC3D,WAAW,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FARC,eAAe,EAAA,UAAA,EAAA,CAAA;kBADpC;AAQmD,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,iBAAiB,CAAA,EAAA,EAAA,GAAE;AACnE,4BAAA,IAAI,EAAE,WAAW;AAClB,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC5BH;AACA;AAEA;;ACHA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skra-ui-counter.mjs","sources":["../../../../libs/ui/counter/src/lib/counter/counter.component.ts","../../../../libs/ui/counter/src/skra-ui-counter.ts"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"skra-ui-counter.mjs","sources":["../../../../libs/ui/counter/src/lib/counter/counter.component.ts","../../../../libs/ui/counter/src/skra-ui-counter.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\n\n/**\n * Status atom rendering `{value.length}` or `{value.length}/{max}` for a\n * sibling form control. Pure UI primitive — agnostic of form binding strategy\n * per ADR 037: consumer wires `[value]` from their chosen source (Signal Forms\n * `field().value()`, Reactive Forms `ctrl.value`, `ngModel`, raw signal).\n *\n * Counter does NOT subscribe to SkraFieldContext for value — ADR 037 §3.3\n * explicitly forbids a value channel in the context. The atom remains\n * independently testable and works outside `<skra-field>` if desired.\n *\n * <skra-field>\n * <label skraLabelFor>Bio</label>\n * <textarea skraTextarea [formField]=\"form.bio\" maxlength=\"500\"></textarea>\n * <skra-counter [value]=\"form.bio().value()\" [max]=\"500\" />\n * </skra-field>\n *\n * `max` is optional — without it, the counter shows just the current length\n * (e.g. for free-form \"characters typed\" indicators). Native `maxlength` on\n * the form control is a separate concern (browser enforces the cap); `[max]`\n * here is the displayed reference value.\n */\n@Component({\n selector: 'skra-counter',\n standalone: true,\n template: '{{ display() }}',\n styleUrl: './counter.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n // Zero-margin reset (ADR 022) lives in counter.component.scss `:host`.\n // ADR 033 — rendered textContent IS the accessible name.\n // role=\"status\" + aria-live=\"polite\" mark the element as a live region\n // so AT announces value changes after the user pauses typing.\n role: 'status',\n 'aria-live': 'polite',\n },\n})\nexport class SkraCounter {\n readonly value = input<string>('');\n readonly max = input<number | null>(null);\n\n readonly display = computed(() => {\n const current = this.value().length;\n const max = this.max();\n return max != null ? `${current}/${max}` : `${current}`;\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAQA;;;;;;;;;;;;;;;;;;;;AAoBG;MAiBU,WAAW,CAAA;IACb,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;IACzB,GAAG,GAAG,KAAK,CAAgB,IAAI;4EAAC;AAEhC,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,K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