forty-cdk 0.2.0 → 0.3.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/accordion/README.md +122 -0
- package/aspect-ratio/README.md +76 -0
- package/avatar/README.md +100 -0
- package/breadcrumbs/README.md +49 -0
- package/breakpoints/README.md +81 -0
- package/button/README.md +49 -0
- package/calendar/README.md +458 -0
- package/carousel/README.md +358 -0
- package/checkbox/README.md +146 -0
- package/combobox/README.md +535 -0
- package/context-menu/README.md +139 -0
- package/date-field/README.md +184 -0
- package/date-picker/README.md +338 -0
- package/dialog/README.md +388 -0
- package/disclosure/README.md +114 -0
- package/drag-drop/README.md +359 -0
- package/drawer/README.md +560 -0
- package/dropdown-menu/README.md +176 -0
- package/fesm2022/forty-cdk-accordion.mjs +348 -0
- package/fesm2022/forty-cdk-accordion.mjs.map +1 -0
- package/fesm2022/forty-cdk-aspect-ratio.mjs +74 -0
- package/fesm2022/forty-cdk-aspect-ratio.mjs.map +1 -0
- package/fesm2022/forty-cdk-avatar.mjs +308 -0
- package/fesm2022/forty-cdk-avatar.mjs.map +1 -0
- package/fesm2022/forty-cdk-breadcrumbs.mjs +125 -0
- package/fesm2022/forty-cdk-breadcrumbs.mjs.map +1 -0
- package/fesm2022/forty-cdk-breakpoints.mjs +117 -0
- package/fesm2022/forty-cdk-breakpoints.mjs.map +1 -0
- package/fesm2022/forty-cdk-button.mjs +134 -0
- package/fesm2022/forty-cdk-button.mjs.map +1 -0
- package/fesm2022/forty-cdk-calendar.mjs +2034 -0
- package/fesm2022/forty-cdk-calendar.mjs.map +1 -0
- package/fesm2022/forty-cdk-carousel.mjs +968 -0
- package/fesm2022/forty-cdk-carousel.mjs.map +1 -0
- package/fesm2022/forty-cdk-checkbox.mjs +226 -0
- package/fesm2022/forty-cdk-checkbox.mjs.map +1 -0
- package/fesm2022/forty-cdk-combobox.mjs +2596 -0
- package/fesm2022/forty-cdk-combobox.mjs.map +1 -0
- package/fesm2022/forty-cdk-context-menu.mjs +413 -0
- package/fesm2022/forty-cdk-context-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-core.mjs +9022 -0
- package/fesm2022/forty-cdk-core.mjs.map +1 -0
- package/fesm2022/forty-cdk-date-field.mjs +744 -0
- package/fesm2022/forty-cdk-date-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-date-picker.mjs +1011 -0
- package/fesm2022/forty-cdk-date-picker.mjs.map +1 -0
- package/fesm2022/forty-cdk-dialog.mjs +707 -0
- package/fesm2022/forty-cdk-dialog.mjs.map +1 -0
- package/fesm2022/forty-cdk-disclosure.mjs +190 -0
- package/fesm2022/forty-cdk-disclosure.mjs.map +1 -0
- package/fesm2022/forty-cdk-drag-drop.mjs +1180 -0
- package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -0
- package/fesm2022/forty-cdk-drawer.mjs +1641 -0
- package/fesm2022/forty-cdk-drawer.mjs.map +1 -0
- package/fesm2022/forty-cdk-dropdown-menu.mjs +350 -0
- package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-field.mjs +425 -0
- package/fesm2022/forty-cdk-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-fieldset.mjs +164 -0
- package/fesm2022/forty-cdk-fieldset.mjs.map +1 -0
- package/fesm2022/forty-cdk-file-upload.mjs +221 -0
- package/fesm2022/forty-cdk-file-upload.mjs.map +1 -0
- package/fesm2022/forty-cdk-hover-card.mjs +496 -0
- package/fesm2022/forty-cdk-hover-card.mjs.map +1 -0
- package/fesm2022/forty-cdk-input.mjs +274 -0
- package/fesm2022/forty-cdk-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-internationalized-date.mjs +1 -1
- package/fesm2022/forty-cdk-internationalized-date.mjs.map +1 -1
- package/fesm2022/forty-cdk-listbox.mjs +1279 -0
- package/fesm2022/forty-cdk-listbox.mjs.map +1 -0
- package/fesm2022/forty-cdk-menu.mjs +1439 -0
- package/fesm2022/forty-cdk-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-menubar.mjs +787 -0
- package/fesm2022/forty-cdk-menubar.mjs.map +1 -0
- package/fesm2022/forty-cdk-meter.mjs +211 -0
- package/fesm2022/forty-cdk-meter.mjs.map +1 -0
- package/fesm2022/forty-cdk-navigation-menu.mjs +1145 -0
- package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-number-input.mjs +559 -0
- package/fesm2022/forty-cdk-number-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-otp-input.mjs +527 -0
- package/fesm2022/forty-cdk-otp-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-pagination.mjs +323 -0
- package/fesm2022/forty-cdk-pagination.mjs.map +1 -0
- package/fesm2022/forty-cdk-pane-resizer.mjs +297 -0
- package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -0
- package/fesm2022/forty-cdk-popover.mjs +698 -0
- package/fesm2022/forty-cdk-popover.mjs.map +1 -0
- package/fesm2022/forty-cdk-progress.mjs +226 -0
- package/fesm2022/forty-cdk-progress.mjs.map +1 -0
- package/fesm2022/forty-cdk-radio-group.mjs +378 -0
- package/fesm2022/forty-cdk-radio-group.mjs.map +1 -0
- package/fesm2022/forty-cdk-scroll-area.mjs +640 -0
- package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -0
- package/fesm2022/forty-cdk-search.mjs +205 -0
- package/fesm2022/forty-cdk-search.mjs.map +1 -0
- package/fesm2022/forty-cdk-select.mjs +1661 -0
- package/fesm2022/forty-cdk-select.mjs.map +1 -0
- package/fesm2022/forty-cdk-separator.mjs +82 -0
- package/fesm2022/forty-cdk-separator.mjs.map +1 -0
- package/fesm2022/forty-cdk-signal-forms.mjs +97 -0
- package/fesm2022/forty-cdk-signal-forms.mjs.map +1 -0
- package/fesm2022/forty-cdk-slider.mjs +803 -0
- package/fesm2022/forty-cdk-slider.mjs.map +1 -0
- package/fesm2022/forty-cdk-stepper.mjs +886 -0
- package/fesm2022/forty-cdk-stepper.mjs.map +1 -0
- package/fesm2022/forty-cdk-switch.mjs +137 -0
- package/fesm2022/forty-cdk-switch.mjs.map +1 -0
- package/fesm2022/forty-cdk-table.mjs +1518 -0
- package/fesm2022/forty-cdk-table.mjs.map +1 -0
- package/fesm2022/forty-cdk-tabs.mjs +400 -0
- package/fesm2022/forty-cdk-tabs.mjs.map +1 -0
- package/fesm2022/forty-cdk-time-field.mjs +593 -0
- package/fesm2022/forty-cdk-time-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-time-picker.mjs +1013 -0
- package/fesm2022/forty-cdk-time-picker.mjs.map +1 -0
- package/fesm2022/forty-cdk-toast.mjs +1153 -0
- package/fesm2022/forty-cdk-toast.mjs.map +1 -0
- package/fesm2022/forty-cdk-toggle.mjs +516 -0
- package/fesm2022/forty-cdk-toggle.mjs.map +1 -0
- package/fesm2022/forty-cdk-toolbar.mjs +374 -0
- package/fesm2022/forty-cdk-toolbar.mjs.map +1 -0
- package/fesm2022/forty-cdk-tooltip.mjs +672 -0
- package/fesm2022/forty-cdk-tooltip.mjs.map +1 -0
- package/fesm2022/forty-cdk-tree.mjs +2007 -0
- package/fesm2022/forty-cdk-tree.mjs.map +1 -0
- package/fesm2022/forty-cdk-virtualization.mjs +1 -1
- package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
- package/fesm2022/forty-cdk.mjs +0 -43310
- package/fesm2022/forty-cdk.mjs.map +1 -1
- package/field/README.md +97 -0
- package/fieldset/README.md +86 -0
- package/file-upload/README.md +73 -0
- package/hover-card/README.md +171 -0
- package/input/README.md +156 -0
- package/listbox/README.md +424 -0
- package/menu/README.md +181 -0
- package/menubar/README.md +140 -0
- package/meter/README.md +128 -0
- package/navigation-menu/README.md +253 -0
- package/number-input/README.md +171 -0
- package/otp-input/README.md +198 -0
- package/package.json +213 -1
- package/pagination/README.md +61 -0
- package/pane-resizer/README.md +136 -0
- package/popover/README.md +262 -0
- package/progress/README.md +115 -0
- package/radio-group/README.md +129 -0
- package/scroll-area/README.md +184 -0
- package/search/README.md +42 -0
- package/select/README.md +488 -0
- package/separator/README.md +84 -0
- package/signal-forms/README.md +72 -0
- package/slider/README.md +152 -0
- package/stepper/README.md +292 -0
- package/switch/README.md +116 -0
- package/table/README.md +769 -0
- package/tabs/README.md +130 -0
- package/time-field/README.md +157 -0
- package/time-picker/README.md +172 -0
- package/toast/README.md +398 -0
- package/toggle/README.md +224 -0
- package/toolbar/README.md +109 -0
- package/tooltip/README.md +274 -0
- package/tree/README.md +708 -0
- package/types/forty-cdk-accordion.d.ts +242 -0
- package/types/forty-cdk-aspect-ratio.d.ts +59 -0
- package/types/forty-cdk-avatar.d.ts +133 -0
- package/types/forty-cdk-breadcrumbs.d.ts +92 -0
- package/types/forty-cdk-breakpoints.d.ts +141 -0
- package/types/forty-cdk-button.d.ts +80 -0
- package/types/forty-cdk-calendar.d.ts +914 -0
- package/types/forty-cdk-carousel.d.ts +530 -0
- package/types/forty-cdk-checkbox.d.ts +141 -0
- package/types/forty-cdk-combobox.d.ts +1259 -0
- package/types/forty-cdk-context-menu.d.ts +313 -0
- package/types/forty-cdk-core.d.ts +5774 -0
- package/types/forty-cdk-date-field.d.ts +307 -0
- package/types/forty-cdk-date-picker.d.ts +622 -0
- package/types/forty-cdk-dialog.d.ts +546 -0
- package/types/forty-cdk-disclosure.d.ts +127 -0
- package/types/forty-cdk-drag-drop.d.ts +456 -0
- package/types/forty-cdk-drawer.d.ts +871 -0
- package/types/forty-cdk-dropdown-menu.d.ts +242 -0
- package/types/forty-cdk-field.d.ts +236 -0
- package/types/forty-cdk-fieldset.d.ts +119 -0
- package/types/forty-cdk-file-upload.d.ts +124 -0
- package/types/forty-cdk-hover-card.d.ts +320 -0
- package/types/forty-cdk-input.d.ts +169 -0
- package/types/forty-cdk-internationalized-date.d.ts +1 -1
- package/types/forty-cdk-listbox.d.ts +513 -0
- package/types/forty-cdk-menu.d.ts +629 -0
- package/types/forty-cdk-menubar.d.ts +451 -0
- package/types/forty-cdk-meter.d.ts +122 -0
- package/types/forty-cdk-navigation-menu.d.ts +514 -0
- package/types/forty-cdk-number-input.d.ts +319 -0
- package/types/forty-cdk-otp-input.d.ts +248 -0
- package/types/forty-cdk-pagination.d.ts +214 -0
- package/types/forty-cdk-pane-resizer.d.ts +145 -0
- package/types/forty-cdk-popover.d.ts +509 -0
- package/types/forty-cdk-progress.d.ts +143 -0
- package/types/forty-cdk-radio-group.d.ts +222 -0
- package/types/forty-cdk-scroll-area.d.ts +258 -0
- package/types/forty-cdk-search.d.ts +142 -0
- package/types/forty-cdk-select.d.ts +899 -0
- package/types/forty-cdk-separator.d.ts +59 -0
- package/types/forty-cdk-signal-forms.d.ts +58 -0
- package/types/forty-cdk-slider.d.ts +379 -0
- package/types/forty-cdk-stepper.d.ts +650 -0
- package/types/forty-cdk-switch.d.ts +87 -0
- package/types/forty-cdk-table.d.ts +723 -0
- package/types/forty-cdk-tabs.d.ts +235 -0
- package/types/forty-cdk-time-field.d.ts +307 -0
- package/types/forty-cdk-time-picker.d.ts +578 -0
- package/types/forty-cdk-toast.d.ts +598 -0
- package/types/forty-cdk-toggle.d.ts +310 -0
- package/types/forty-cdk-toolbar.d.ts +217 -0
- package/types/forty-cdk-tooltip.d.ts +436 -0
- package/types/forty-cdk-tree.d.ts +688 -0
- package/types/forty-cdk.d.ts +1 -19743
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forty-cdk-stepper.mjs","sources":["../../../projects/forty-cdk/stepper/src/stepper-context.ts","../../../projects/forty-cdk/stepper/src/stepper-defaults.ts","../../../projects/forty-cdk/stepper/src/stepper.ts","../../../projects/forty-cdk/stepper/src/stepper-list.ts","../../../projects/forty-cdk/stepper/src/stepper-item.ts","../../../projects/forty-cdk/stepper/src/stepper-trigger.ts","../../../projects/forty-cdk/stepper/src/stepper-indicator.ts","../../../projects/forty-cdk/stepper/src/stepper-separator.ts","../../../projects/forty-cdk/stepper/src/stepper-content.ts","../../../projects/forty-cdk/stepper/src/stepper-completed-content.ts","../../../projects/forty-cdk/stepper/src/stepper-next.ts","../../../projects/forty-cdk/stepper/src/stepper-previous.ts","../../../projects/forty-cdk/stepper/src/stepper-progress.ts","../../../projects/forty-cdk/stepper/src/forty-cdk-stepper.ts"],"sourcesContent":["import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport {\n type ListNavigationAction,\n type WritingDirection,\n type RovingTabindex,\n} from 'forty-cdk/core';\n\n/** Activation timing for interactive-mode arrow navigation. */\nexport type StepperActivationMode = 'automatic' | 'manual';\n\n/** Accessibility model: interactive Tabs pattern vs display-only progress list. */\nexport type StepperMode = 'interactive' | 'progress';\n\n/**\n * Registry entry for one step, owned by `ForStepperItem`. Drives index\n * derivation and linear gating.\n */\nexport interface ForStepperItemHandle {\n /** Host element, used for DOM-order sorting in the collection. */\n readonly host: HTMLElement;\n /** Whether this step has been marked as completed by the consumer. */\n readonly completed: Signal<boolean>;\n /** Whether this step can be skipped when the stepper is in linear mode. */\n readonly optional: Signal<boolean>;\n /** Whether this step is disabled (own `disabled` OR root `disabled`). */\n readonly effectiveDisabled: Signal<boolean>;\n /** Whether this step has an error condition. */\n readonly hasError: Signal<boolean>;\n /** The resolved `data-state` string for this step. */\n readonly resolvedState: Signal<string>;\n}\n\n/**\n * Registry entry for one trigger (roving participant and id source). Used by\n * the root to wire roving tabindex, id lookups, and navigation.\n */\nexport interface ForStepperTriggerHandle {\n /** Host element, used for DOM-order sorting and focus moves. */\n readonly host: HTMLElement;\n /** The trigger's own host id, for `aria-labelledby` on content panels. */\n readonly id: Signal<string>;\n /**\n * Whether this trigger can be focused and activated. `false` when the step\n * is disabled or not yet reachable in linear mode.\n */\n readonly selectable: Signal<boolean>;\n /**\n * Inverse of `selectable`. Required by `firstEnabledHost` and\n * `reconcileRovingActive`, which read a `disabled` signal per handle.\n */\n readonly disabled: Signal<boolean>;\n}\n\n/**\n * Registry entry for one content panel (id source; positional). The content's\n * position in this collection determines its associated step index.\n */\nexport interface ForStepperContentHandle {\n /** Host element, used for DOM-order sorting and index derivation. */\n readonly host: HTMLElement;\n /** The panel's own host id, for `aria-controls` on triggers. */\n readonly id: Signal<string>;\n}\n\n/**\n * Coordination contract owned by `ForStepper`. Triggers, items, and content\n * panels register here; navigation and selection flow back through these\n * methods.\n *\n * Implements the [WAI-ARIA Tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/)\n * in `mode=\"interactive\"` and a `<ol>`-based progress list with\n * `aria-current=\"step\"` in `mode=\"progress\"`.\n */\nexport interface ForStepperContext {\n /** Two-way bindable selected step index. */\n readonly selectedIndex: Signal<number>;\n /** When true, steps are only reachable after all preceding steps are completed or optional. */\n readonly linear: Signal<boolean>;\n /** Accessibility model — `'interactive'` (Tabs APG) or `'progress'` (progress list). */\n readonly mode: Signal<StepperMode>;\n /** Layout axis for the step list. */\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n /** Arrow-key activation timing when in interactive mode. */\n readonly activationMode: Signal<StepperActivationMode>;\n /** Resolved writing direction (`'ltr'` or `'rtl'`). */\n readonly dir: Signal<WritingDirection>;\n /** Whether the entire stepper is disabled. */\n readonly disabled: Signal<boolean>;\n /** Total number of registered step items. */\n readonly count: Signal<number>;\n /**\n * True when the stepper has reached the terminal completed state\n * (`selectedIndex()` >= `count()`).\n */\n readonly isCompleted: Signal<boolean>;\n /** Roving tabindex tracker for interactive-mode triggers. */\n readonly roving: RovingTabindex;\n\n /** Returns the DOM-order index of `item` in the item collection, or -1 if not found. */\n indexOf(item: ForStepperItemHandle): number;\n /** Returns true when `index` matches the currently selected step. */\n isCurrent(index: number): boolean;\n /**\n * Returns true when step `index` can be navigated to in linear mode. Index 0\n * is always reachable; subsequent steps require all preceding steps to be\n * completed or optional.\n */\n isReachable(index: number): boolean;\n /** Returns the resolved `data-state` string for step at `index`. */\n resolvedStateFor(index: number): string;\n /**\n * Selects step `index`. No-op when the root is disabled, when `index` is\n * out of range, or when the step is not reachable in linear mode.\n */\n select(index: number): void;\n /**\n * Advances to the next step, or into the terminal completed state when on\n * the last step. No-op when the root is disabled, when already in the terminal state, or\n * (in linear mode) when the current step is neither completed nor optional.\n */\n next(): void;\n /**\n * Retreats to the previous step. No-op when the root is disabled or the\n * first step is already selected. Bypasses the linear reachability gate —\n * going back always works.\n */\n previous(): void;\n /**\n * Returns true when the Next button can advance — including advancing the last\n * step into the terminal completed state. False when disabled, already in the\n * terminal state, or (in linear mode) the current step is not completed/optional.\n */\n canAdvance(): boolean;\n /** Returns true when the Previous button can retreat. False when disabled or at the first step. */\n canRetreat(): boolean;\n /**\n * Moves focus from `currentTrigger` according to `action` (interactive mode\n * only). In automatic activation mode, also selects the target step.\n * Disabled / unreachable triggers are skipped.\n */\n navigate(currentTrigger: HTMLElement, action: ListNavigationAction): void;\n\n /** Registers a step item handle into the item collection. */\n registerItem(h: ForStepperItemHandle): void;\n /** Unregisters a step item handle from the item collection. */\n unregisterItem(h: ForStepperItemHandle): void;\n /** Registers a trigger handle into the trigger collection. */\n registerTrigger(h: ForStepperTriggerHandle): void;\n /** Unregisters a trigger handle from the trigger collection and the roving tracker. */\n unregisterTrigger(h: ForStepperTriggerHandle): void;\n /** Registers a content panel handle into the content collection. */\n registerContent(h: ForStepperContentHandle): void;\n /** Unregisters a content panel handle from the content collection. */\n unregisterContent(h: ForStepperContentHandle): void;\n\n /**\n * Returns the id of the trigger at `index`, or `null` if there is no\n * registered trigger at that position.\n */\n triggerIdFor(index: number): string | null;\n /**\n * Returns the id of the content panel at `index`, or `null` if there is no\n * registered panel at that position.\n */\n contentIdFor(index: number): string | null;\n /**\n * Returns the DOM-order index of the content panel whose host is `host`, or\n * -1 if not registered. Used by `ForStepperContent` to derive its step index\n * reactively.\n */\n indexOfContent(host: HTMLElement): number;\n /**\n * True when `el` is the first selectable trigger (the roving entry-point\n * fallback when no step is selected or the roving pointer is stale).\n */\n isFirstSelectableTrigger(el: HTMLElement): boolean;\n /**\n * True when some registered trigger corresponds to the currently selected\n * step. Distinguishes \"the current step owns the tab stop\" from \"the selected\n * index points at a missing or unreachable trigger\" so the per-trigger\n * tabindex fallback can re-engage the first-selectable entry point.\n */\n hasCurrentTrigger(): boolean;\n}\n\n/**\n * Per-step state contract. Provided by `ForStepperItem`; consumed by\n * `ForStepperTrigger`, `ForStepperIndicator`, and `ForStepperSeparator`.\n */\nexport interface ForStepperItemContext {\n /** DOM-order index of this step within the stepper. */\n readonly index: Signal<number>;\n /** True when this step is the currently selected step. */\n readonly current: Signal<boolean>;\n /**\n * True when this step can be focused and activated (reachable and not\n * effectively disabled).\n */\n readonly selectable: Signal<boolean>;\n /** Whether this step has been marked as completed. */\n readonly completed: Signal<boolean>;\n /** Whether this step can be skipped when the stepper is in linear mode. */\n readonly optional: Signal<boolean>;\n /** Whether this step is disabled (own `disabled` OR root `disabled`). */\n readonly effectiveDisabled: Signal<boolean>;\n /** Whether this step has an error condition. */\n readonly hasError: Signal<boolean>;\n /** Resolved `data-state` string (precedence: custom state > error > active > completed > pending). */\n readonly resolvedState: Signal<string>;\n /**\n * Selects this step. Delegates to `ForStepperContext.select(index)` — the\n * linear reachability and disabled guards apply.\n */\n select(): void;\n}\n\n/** Injection token for the root stepper context (`ForStepper`). */\nexport const FOR_STEPPER_CONTEXT = new InjectionToken<ForStepperContext>('FOR_STEPPER_CONTEXT');\n\n/** Injection token for the per-step item context (`ForStepperItem`). */\nexport const FOR_STEPPER_ITEM_CONTEXT = new InjectionToken<ForStepperItemContext>(\n 'FOR_STEPPER_ITEM_CONTEXT',\n);\n\nexport function injectStepperContext(piece: string): ForStepperContext {\n const ctx = inject(FOR_STEPPER_CONTEXT, { optional: true });\n if (!ctx) {\n throw new Error(`[forty-cdk/stepper] ${piece} must be used inside a [forStepper] element.`);\n }\n return ctx;\n}\n\nexport function injectStepperItemContext(piece: string): ForStepperItemContext {\n const ctx = inject(FOR_STEPPER_ITEM_CONTEXT, { optional: true });\n if (!ctx) {\n throw new Error(`[forty-cdk/stepper] ${piece} must be used inside a [forStepperItem] element.`);\n }\n return ctx;\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\nimport type { StepperActivationMode } from './stepper-context';\n\n/**\n * Defaults inherited by descendant steppers in the surrounding injector scope.\n * Configure with `provideForStepperDefaults` either at the application root or\n * in any component's `providers` array; partial overrides merge with the parent\n * scope.\n */\nexport interface ForStepperDefaults {\n /**\n * `'manual'` (default): arrow navigation only moves focus; the user must\n * press Space / Enter to activate. Recommended for wizards where step\n * activation often triggers validation. `'automatic'`: arrow navigation moves\n * focus AND selects the step.\n */\n activationMode: StepperActivationMode;\n /**\n * Whether arrow navigation wraps around past the first / last selectable\n * trigger.\n */\n loop: boolean;\n}\n\n/**\n * Library fallback for stepper defaults, read at the root injector when no\n * consumer has called `provideForStepperDefaults`. Exported for the shared\n * defaults contract spec; not re-exported from the primitive's public entry.\n */\nexport const FOR_STEPPER_FALLBACK_DEFAULTS: ForStepperDefaults = {\n activationMode: 'manual',\n loop: true,\n};\n\nconst { token, provideDefaults } = createDefaults<ForStepperDefaults>(\n 'FOR_STEPPER_DEFAULTS',\n FOR_STEPPER_FALLBACK_DEFAULTS,\n);\n\n/** Token holding the resolved stepper defaults for the current scope. */\nexport const FOR_STEPPER_DEFAULTS = token;\n\n/**\n * Configures forty-cdk stepper defaults for this injector scope. Partial\n * overrides inherit unspecified keys from the parent scope (or library defaults\n * at the root).\n */\nexport function provideForStepperDefaults(defaults: Partial<ForStepperDefaults> = {}): Provider[] {\n return provideDefaults(defaults);\n}\n","import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n model,\n output,\n} from '@angular/core';\n\nimport {\n Collection,\n firstEnabledHost,\n type ListNavigationAction,\n moveIndex,\n type WritingDirection,\n reconcileRovingActive,\n RovingTabindex,\n injectTextDirection,\n} from 'forty-cdk/core';\nimport {\n FOR_STEPPER_CONTEXT,\n type ForStepperContentHandle,\n type ForStepperContext,\n type ForStepperItemHandle,\n type ForStepperTriggerHandle,\n type StepperActivationMode,\n type StepperMode,\n} from './stepper-context';\nimport { FOR_STEPPER_DEFAULTS } from './stepper-defaults';\n\n/**\n * Root of the Stepper primitive. Owns the selected step index, linear\n * progression, accessibility mode, orientation, and disabled state. Provides\n * the shared context to descendant directives.\n *\n * Implements the [WAI-ARIA Tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/)\n * in `mode=\"interactive\"` (roving tabindex, `role=\"tablist\"`, `aria-selected`)\n * and an ordered-list progress pattern with `aria-current=\"step\"` in\n * `mode=\"progress\"`.\n *\n * `activationMode='manual'` (default): arrow navigation only moves focus;\n * Space / Enter activates. Recommended for wizards where step activation\n * triggers validation. `activationMode='automatic'`: arrow navigation moves\n * focus AND selects the step.\n */\n@Directive({\n selector: '[forStepper]',\n exportAs: 'forStepper',\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-mode]': 'mode()',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.dir]': 'dir()',\n },\n providers: [{ provide: FOR_STEPPER_CONTEXT, useExisting: ForStepper }],\n})\nexport class ForStepper implements ForStepperContext {\n readonly #defaults = inject(FOR_STEPPER_DEFAULTS);\n\n /**\n * Two-way bindable selected step index in the inclusive range `0 … count`.\n * Defaults to `0`. The terminal value `=== count()` (one past the last step) is\n * the **completed** state (see `isCompleted` / `complete`). The `model()` change\n * emitter (`(selectedIndexChange)`) fires only on internal selection changes\n * (trigger click, Next/Previous, automatic-mode arrow navigation), never on\n * consumer writes via `[(selectedIndex)]`.\n */\n readonly selectedIndex = model<number>(0);\n\n /**\n * Emits once each time the stepper transitions **into** the completed terminal\n * state — i.e. when `selectedIndex()` reaches `count()`. Does not re-emit while\n * it stays completed; retreating via `previous()` and re-entering emits again.\n */\n readonly complete = output<void>();\n\n /**\n * When true, steps are only reachable after all preceding steps are completed\n * or optional. Navigating back (`previous()`) always works regardless of this\n * flag.\n */\n readonly linear = input(false, { transform: booleanAttribute });\n\n /**\n * Accessibility model. `'interactive'` (default): full WAI-ARIA Tabs pattern\n * — `role=\"tablist\"`, `role=\"tab\"`, `role=\"tabpanel\"`, roving tabindex, arrow\n * navigation. `'progress'`: ordered list with `aria-current=\"step\"` on the\n * active trigger — no tab stop manipulation.\n */\n readonly mode = input<StepperMode>('interactive');\n\n /**\n * Layout axis for the step list. Affects `aria-orientation` on the list and\n * which arrow keys navigate in interactive mode.\n */\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /**\n * Arrow-key activation timing in interactive mode. Defaults to the value from\n * `provideForStepperDefaults` for the surrounding scope (library default:\n * `'manual'`).\n */\n readonly activationMode = input<StepperActivationMode>(this.#defaults.activationMode);\n\n /**\n * Whether arrow navigation wraps around past the first / last selectable\n * trigger. Defaults to the value from `provideForStepperDefaults` for the\n * surrounding scope (library default: `true`).\n */\n readonly loop = input(this.#defaults.loop, { transform: booleanAttribute });\n\n /**\n * When true, all step triggers are non-interactive and the root carries\n * `data-disabled`.\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /**\n * Writing direction. When unset (default `null`), the inherited ambient\n * direction is resolved from the nearest ancestor carrying a `dir` attribute\n * (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins.\n * The resolved value is reflected to the host `dir` attribute and swaps\n * ArrowLeft / ArrowRight semantics in RTL.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n\n readonly roving = new RovingTabindex();\n\n readonly #items = new Collection<ForStepperItemHandle>();\n readonly #triggers = new Collection<ForStepperTriggerHandle>();\n readonly #contents = new Collection<ForStepperContentHandle>();\n\n /** Total number of registered step items. */\n readonly count = computed(() => this.#items.items().length);\n\n /**\n * True when the stepper is in the terminal **completed** state: `selectedIndex()`\n * has reached `count()` (one past the last step). No step is current and every\n * `[forStepperContent]` panel is inactive while this holds.\n */\n readonly isCompleted = computed(() => this.selectedIndex() >= this.count());\n\n readonly #firstSelectableTriggerHost = computed(() => firstEnabledHost(this.#triggers.items()));\n\n constructor() {\n reconcileRovingActive(this.roving, this.#triggers.items);\n\n let wasCompleted = this.isCompleted();\n effect(() => {\n const completed = this.isCompleted();\n if (completed && !wasCompleted) {\n this.complete.emit();\n }\n wasCompleted = completed;\n });\n }\n\n indexOf(item: ForStepperItemHandle): number {\n return this.#items.items().indexOf(item);\n }\n\n isCurrent(index: number): boolean {\n return this.selectedIndex() === index;\n }\n\n isReachable(index: number): boolean {\n if (!this.linear()) {\n return true;\n }\n if (index === 0) {\n return true;\n }\n const items = this.#items.items();\n for (let i = 0; i < index; i++) {\n const item = items[i];\n if (!item || (!item.completed() && !item.optional())) {\n return false;\n }\n }\n return true;\n }\n\n resolvedStateFor(index: number): string {\n return this.#items.items()[index]?.resolvedState() ?? 'pending';\n }\n\n select(index: number): void {\n if (this.disabled()) {\n return;\n }\n const count = this.count();\n if (count === 0) {\n return;\n }\n const clamped = Math.max(0, Math.min(index, count));\n if (!this.isReachable(clamped)) {\n return;\n }\n this.selectedIndex.set(clamped);\n }\n\n next(): void {\n if (!this.canAdvance()) {\n return;\n }\n this.selectedIndex.set(this.selectedIndex() + 1);\n }\n\n previous(): void {\n if (this.disabled() || this.selectedIndex() <= 0) {\n return;\n }\n this.selectedIndex.set(this.selectedIndex() - 1);\n }\n\n canAdvance(): boolean {\n if (this.disabled() || this.selectedIndex() >= this.count()) {\n return false;\n }\n if (!this.linear()) {\n return true;\n }\n const current = this.#items.items()[this.selectedIndex()];\n return (current?.completed() ?? false) || (current?.optional() ?? false);\n }\n\n canRetreat(): boolean {\n return this.selectedIndex() > 0 && !this.disabled();\n }\n\n navigate(currentTrigger: HTMLElement, action: ListNavigationAction): void {\n if (this.disabled()) {\n return;\n }\n const triggers = this.#triggers.items();\n if (triggers.length === 0) {\n return;\n }\n const currentIndex = triggers.findIndex((t) => t.host === currentTrigger);\n const next = moveIndex(currentIndex < 0 ? 0 : currentIndex, triggers.length, action, {\n loop: this.loop(),\n isDisabled: (i) => !triggers[i]!.selectable(),\n });\n if (next === null) {\n return;\n }\n const target = triggers[next];\n if (!target) {\n return;\n }\n target.host.focus();\n if (this.activationMode() === 'automatic') {\n this.selectedIndex.set(next);\n }\n }\n\n registerItem(h: ForStepperItemHandle): void {\n this.#items.register(h);\n }\n\n unregisterItem(h: ForStepperItemHandle): void {\n this.#items.unregister(h);\n }\n\n registerTrigger(h: ForStepperTriggerHandle): void {\n this.#triggers.register(h);\n }\n\n unregisterTrigger(h: ForStepperTriggerHandle): void {\n this.#triggers.unregister(h);\n this.roving.unregister(h.host);\n }\n\n registerContent(h: ForStepperContentHandle): void {\n this.#contents.register(h);\n }\n\n unregisterContent(h: ForStepperContentHandle): void {\n this.#contents.unregister(h);\n }\n\n triggerIdFor(index: number): string | null {\n return this.#triggers.items()[index]?.id() ?? null;\n }\n\n contentIdFor(index: number): string | null {\n return this.#contents.items()[index]?.id() ?? null;\n }\n\n indexOfContent(host: HTMLElement): number {\n return this.#contents.indexOfHost(host);\n }\n\n isFirstSelectableTrigger(el: HTMLElement): boolean {\n return this.#firstSelectableTriggerHost() === el;\n }\n\n hasCurrentTrigger(): boolean {\n const idx = this.selectedIndex();\n const triggers = this.#triggers.items();\n if (idx < 0 || idx >= triggers.length) {\n return false;\n }\n const trigger = triggers[idx];\n return trigger !== undefined && trigger.selectable();\n }\n}\n","import { Directive, input } from '@angular/core';\n\nimport { injectStepperContext } from './stepper-context';\n\n/**\n * The step-list container. In `mode=\"interactive\"` renders as `role=\"tablist\"`\n * with `aria-orientation`; in `mode=\"progress\"` renders as `role=\"list\"`.\n *\n * Apply on an `<ol>` (recommended for semantic list markup) wrapping the\n * `[forStepperItem]` elements. The `[forStepperContent]` panels live as\n * siblings of the list.\n */\n@Directive({\n selector: '[forStepperList]',\n exportAs: 'forStepperList',\n host: {\n '[attr.role]': \"ctx.mode() === 'interactive' ? 'tablist' : 'list'\",\n '[attr.aria-orientation]': \"ctx.mode() === 'interactive' ? ctx.orientation() : null\",\n '[attr.aria-label]': 'ariaLabel() || null',\n '[attr.data-orientation]': 'ctx.orientation()',\n },\n})\nexport class ForStepperList {\n protected readonly ctx = injectStepperContext('ForStepperList');\n\n /** Accessible name for the step list. Defers to a consumer `aria-labelledby`. */\n readonly ariaLabel = input<string | null>(null);\n}\n","import { booleanAttribute, computed, Directive, ElementRef, inject, input } from '@angular/core';\nimport type { FieldTree } from '@angular/forms/signals';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport {\n FOR_STEPPER_ITEM_CONTEXT,\n type ForStepperItemContext,\n type ForStepperItemHandle,\n injectStepperContext,\n} from './stepper-context';\n\n/**\n * One step within a `ForStepper`. Owns per-step state (`completed`, `optional`,\n * `disabled`, `hasError`, `state`) and exposes the `ForStepperItemContext` that\n * child `[forStepperTrigger]`, `[forStepperIndicator]`, and\n * `[forStepperSeparator]` directives consume.\n *\n * Apply on a list item element (e.g. `<li forStepperItem>`). The step's index\n * is derived reactively from its DOM position within the stepper via the root's\n * item collection.\n */\n@Directive({\n selector: '[forStepperItem]',\n exportAs: 'forStepperItem',\n host: {\n '[attr.data-state]': 'resolvedState()',\n '[attr.data-disabled]': 'effectiveDisabled() ? \"\" : null',\n '[attr.data-orientation]': 'ctx.orientation()',\n },\n providers: [{ provide: FOR_STEPPER_ITEM_CONTEXT, useExisting: ForStepperItem }],\n})\nexport class ForStepperItem implements ForStepperItemContext, ForStepperItemHandle {\n protected readonly ctx = injectStepperContext('ForStepperItem');\n\n /** Host element — satisfies `ForStepperItemHandle.host` for collection registration. */\n readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /**\n * Manual completion flag. When `true`, the step is completed regardless of any\n * bound `field()`. Bind via `[completed]`.\n */\n readonly _completedInput = input(false, { transform: booleanAttribute, alias: 'completed' });\n\n /** Marks this step as optional (can be skipped in linear mode). */\n readonly optional = input(false, { transform: booleanAttribute });\n\n /** When true, this step's trigger ignores clicks and the step is unreachable by keyboard. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /**\n * Manual error flag. When `true`, the step reflects the `'error'` resolved state\n * (unless current) regardless of any bound `field()`. Bind via `[hasError]`.\n */\n readonly _hasErrorInput = input(false, { transform: booleanAttribute, alias: 'hasError' });\n\n /**\n * Optional Signal Forms field. When bound, the step's `completed` and\n * `hasError` derive from the field's reactive validity: `completed` is `true`\n * when the field is valid and touched; `hasError` is `true` when the field is\n * touched and invalid. A manual `[completed]` / `[hasError]` input always wins\n * when set. Leave unset to drive completion manually.\n *\n * The `@angular/forms` peer is optional: the field *type* is imported with\n * `import type`, so binding `[field]` requires the peer but the primitive\n * compiles and tree-shakes without it for consumers who never use it.\n */\n readonly field = input<FieldTree<unknown> | null>(null);\n\n /**\n * Whether this step is completed. A manual `[completed]` input wins; otherwise,\n * when a `field()` is bound, derives `true` from `field` valid + touched.\n */\n readonly completed = computed<boolean>(() => {\n if (this._completedInput()) {\n return true;\n }\n const f = this.field();\n if (!f) {\n return false;\n }\n const state = f();\n return state.valid() && state.touched();\n });\n\n /**\n * Whether this step has an error. A manual `[hasError]` input wins; otherwise,\n * when a `field()` is bound, derives `true` from `field` touched + invalid.\n */\n readonly hasError = computed<boolean>(() => {\n if (this._hasErrorInput()) {\n return true;\n }\n const f = this.field();\n if (!f) {\n return false;\n }\n const state = f();\n return state.touched() && state.invalid();\n });\n\n /**\n * Custom state string override. When non-empty, wins over the derived resolved\n * state (`error`, `active`, `completed`, `pending`) and drives every\n * `data-state` attribute on this step.\n */\n readonly state = input<string | null>(null);\n\n /** Whether this step is disabled — own `disabled` OR the root stepper's `disabled`. */\n readonly effectiveDisabled = computed(() => this.disabled() || this.ctx.disabled());\n\n /** DOM-order index of this step within the stepper. */\n readonly index = computed(() => this.ctx.indexOf(this));\n\n /** True when this step is the currently selected step. */\n readonly current = computed(() => this.ctx.isCurrent(this.index()));\n\n /**\n * True when this step can be focused and activated. False when the step is\n * effectively disabled or not yet reachable in linear mode.\n */\n readonly selectable = computed(\n () => this.ctx.isReachable(this.index()) && !this.effectiveDisabled(),\n );\n\n /**\n * Resolved `data-state` string. Precedence:\n * 1. Custom `state()` when non-empty.\n * 2. `'error'` when `hasError()` and not current.\n * 3. `'active'` when current.\n * 4. `'completed'` when `completed()`.\n * 5. `'pending'` otherwise.\n */\n readonly resolvedState = computed<string>(() => {\n const custom = this.state();\n if (custom) {\n return custom;\n }\n if (this.hasError() && !this.current()) {\n return 'error';\n }\n if (this.current()) {\n return 'active';\n }\n if (this.completed()) {\n return 'completed';\n }\n return 'pending';\n });\n\n constructor() {\n registerHandle(\n this,\n (h) => this.ctx.registerItem(h),\n (h) => this.ctx.unregisterItem(h),\n 'afterNextRender',\n );\n }\n\n /** Selects this step. Delegates to `ForStepperContext.select(index)`. */\n select(): void {\n this.ctx.select(this.index());\n }\n}\n","import { computed, Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle, hostId, resolveListNavigation } from 'forty-cdk/core';\nimport { injectStepperContext, injectStepperItemContext } from './stepper-context';\n\n/**\n * Header for one step. In `mode=\"interactive\"` carries `role=\"tab\"`, participates\n * in the roving tabindex, and wires `aria-selected` / `aria-controls` /\n * `aria-disabled`. In `mode=\"progress\"` carries `aria-current=\"step\"` on the\n * active step only and is a static element (no tab-stop manipulation).\n *\n * Apply on a `<button type=\"button\">` for interactive mode so Enter / Space\n * activation is native. A static element (`<span>`) is acceptable for progress\n * mode.\n *\n * Disabled triggers in interactive mode keep their tab stop (`aria-disabled`\n * instead of native `disabled`) so assistive tech can announce them.\n */\n@Directive({\n selector: '[forStepperTrigger]',\n exportAs: 'forStepperTrigger',\n host: {\n '[attr.role]': \"ctx.mode() === 'interactive' ? 'tab' : null\",\n '[id]': 'id()',\n '[attr.aria-selected]':\n \"ctx.mode() === 'interactive' ? (item.current() ? 'true' : 'false') : null\",\n '[attr.aria-controls]': \"ctx.mode() === 'interactive' && item.current() ? controlsId() : null\",\n '[attr.aria-current]': \"ctx.mode() === 'progress' && item.current() ? 'step' : null\",\n '[attr.aria-disabled]': \"ctx.mode() === 'interactive' && !item.selectable() ? 'true' : null\",\n '[attr.tabindex]': 'tabindex()',\n '[attr.data-state]': 'item.resolvedState()',\n '[attr.data-disabled]': 'item.effectiveDisabled() ? \"\" : null',\n '[attr.data-orientation]': 'ctx.orientation()',\n '(click)': 'onClick()',\n '(focus)': 'onFocus()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForStepperTrigger {\n protected readonly ctx = injectStepperContext('ForStepperTrigger');\n protected readonly item = injectStepperItemContext('ForStepperTrigger');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /** Generated (or consumer-set static) id for this trigger. Used by content panels for `aria-labelledby`. */\n readonly id = hostId('for-stepper-trigger');\n\n /** Id of the content panel this trigger controls (the matching panel by step index). */\n protected readonly controlsId = computed(() => this.ctx.contentIdFor(this.item.index()));\n\n /**\n * APG tabindex cascade (interactive mode only). In progress mode returns\n * `null` so no tab-stop attribute is emitted. In interactive mode:\n * - `null` when not selectable (disabled or unreachable in linear mode).\n * - Roving-tracker value once any trigger has been focused.\n * - `0` when this step is current.\n * - `-1` when another trigger owns the current step.\n * - `0` if this is the first selectable trigger (fallback entry point).\n * - `-1` otherwise.\n */\n protected readonly tabindex = computed<0 | -1 | null>(() => {\n if (this.ctx.mode() !== 'interactive') {\n return null;\n }\n if (!this.item.selectable()) {\n return -1;\n }\n if (this.ctx.roving.hasActive()) {\n return this.ctx.roving.tabindexFor(this.#host);\n }\n if (this.item.current()) {\n return 0;\n }\n if (this.ctx.hasCurrentTrigger()) {\n return -1;\n }\n return this.ctx.isFirstSelectableTrigger(this.#host) ? 0 : -1;\n });\n\n constructor() {\n const handle = {\n host: this.#host,\n id: this.id,\n selectable: this.item.selectable,\n disabled: computed(() => !this.item.selectable()),\n };\n registerHandle(\n handle,\n (h) => this.ctx.registerTrigger(h),\n (h) => this.ctx.unregisterTrigger(h),\n 'afterNextRender',\n );\n }\n\n protected onClick(): void {\n if (this.ctx.mode() !== 'interactive' || !this.item.selectable()) {\n return;\n }\n this.item.select();\n }\n\n protected onFocus(): void {\n if (this.ctx.mode() !== 'interactive' || !this.item.selectable()) {\n return;\n }\n this.ctx.roving.setActive(this.#host);\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.ctx.mode() !== 'interactive' || !this.item.selectable()) {\n return;\n }\n const action = resolveListNavigation(event, {\n orientation: this.ctx.orientation(),\n dir: this.ctx.dir(),\n });\n if (!action) {\n return;\n }\n event.preventDefault();\n this.ctx.navigate(this.#host, action);\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { injectStepperItemContext } from './stepper-context';\n\n/**\n * Decorative icon slot for a step. Hidden from the accessibility tree\n * (`aria-hidden=\"true\"`). Reflects the step's resolved `data-state` so\n * consumers can swap icons via CSS `[data-state=\"completed\"]`,\n * `[data-state=\"error\"]`, etc., or with `@if` keyed on the exported\n * `#indicator=\"forStepperIndicator\"` reference.\n *\n * Must be used inside a `[forStepperItem]` element.\n */\n@Directive({\n selector: '[forStepperIndicator]',\n exportAs: 'forStepperIndicator',\n host: {\n 'aria-hidden': 'true',\n '[attr.data-state]': 'item.resolvedState()',\n },\n})\nexport class ForStepperIndicator {\n protected readonly item = injectStepperItemContext('ForStepperIndicator');\n}\n","import { Directive } from '@angular/core';\n\nimport { injectStepperContext, injectStepperItemContext } from './stepper-context';\n\n/**\n * Decorative connector between steps. Hidden from the accessibility tree\n * (`aria-hidden=\"true\"`). Reflects `data-state=\"completed\"` when the preceding\n * step is marked completed, `data-state=\"pending\"` otherwise. Also reflects\n * `data-orientation` so consumers can style horizontal vs vertical separators\n * differently.\n *\n * Must be used inside a `[forStepperItem]` element.\n */\n@Directive({\n selector: '[forStepperSeparator]',\n exportAs: 'forStepperSeparator',\n host: {\n 'aria-hidden': 'true',\n '[attr.data-state]': \"item.completed() ? 'completed' : 'pending'\",\n '[attr.data-orientation]': 'ctx.orientation()',\n },\n})\nexport class ForStepperSeparator {\n protected readonly ctx = injectStepperContext('ForStepperSeparator');\n protected readonly item = injectStepperItemContext('ForStepperSeparator');\n}\n","import { computed, Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle, injectHasFocusableContent, hostId } from 'forty-cdk/core';\nimport { injectStepperContext } from './stepper-context';\n\n/**\n * Panel for one step. Correlates to a step by **position** — the Nth\n * `[forStepperContent]` panel in registration (DOM document) order corresponds\n * to the Nth step.\n *\n * In `mode=\"interactive\"` the panel carries `role=\"tabpanel\"` and is a tab\n * stop (`tabindex=\"0\"`) only when it has no focusable content of its own\n * (WAI-ARIA Tabs APG rule). In `mode=\"progress\"` the panel carries\n * `role=\"group\"` and is never a tab stop.\n *\n * While inactive the directive reflects `aria-hidden=\"true\"` and `inert` so\n * mounted-but-inactive panels are removed from the accessibility tree and focus\n * order automatically. DOM presence is the consumer's responsibility — wrap\n * with `@if (current())` to unmount or leave mounted and toggle visibility with\n * CSS via `[data-state=\"inactive\"]`.\n */\n@Directive({\n selector: '[forStepperContent]',\n exportAs: 'forStepperContent',\n host: {\n '[attr.role]': \"ctx.mode() === 'interactive' ? 'tabpanel' : 'group'\",\n '[id]': 'id()',\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.tabindex]': 'tabindex()',\n '[attr.aria-hidden]': 'current() ? null : \"true\"',\n '[attr.inert]': 'current() ? null : \"\"',\n '[attr.data-state]': 'current() ? \"active\" : \"inactive\"',\n '[attr.data-orientation]': 'ctx.orientation()',\n },\n})\nexport class ForStepperContent {\n protected readonly ctx = injectStepperContext('ForStepperContent');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /** Generated (or consumer-set static) id for this panel. Used by triggers for `aria-controls`. */\n readonly id = hostId('for-stepper-content');\n\n readonly #hasFocusableContent = injectHasFocusableContent();\n\n readonly #index = computed(() => this.ctx.indexOfContent(this.#host));\n\n /** True when this panel corresponds to the currently selected step. */\n readonly current = computed(() => this.ctx.isCurrent(this.#index()));\n\n /** Id of the trigger that labels this panel (`aria-labelledby`). */\n protected readonly labelledBy = computed(() => this.ctx.triggerIdFor(this.#index()));\n\n /**\n * APG tabindex: `'0'` only when in interactive mode and the panel has no\n * focusable content of its own, so screen-reader users can reach the panel\n * itself. A panel containing buttons / links / form controls gets no\n * `tabindex`, avoiding a redundant tab stop.\n */\n protected readonly tabindex = computed<'0' | null>(() => {\n if (this.ctx.mode() !== 'interactive') {\n return null;\n }\n return this.#hasFocusableContent() ? null : '0';\n });\n\n constructor() {\n const handle = { host: this.#host, id: this.id };\n registerHandle(\n handle,\n (h) => this.ctx.registerContent(h),\n (h) => this.ctx.unregisterContent(h),\n 'afterNextRender',\n );\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { injectStepperContext } from './stepper-context';\n\n/**\n * Terminal \"all steps complete\" panel. Shown (active) only while the stepper is in\n * the completed state (`selectedIndex` has reached `count`); gated the same way as\n * `[forStepperContent]` — `aria-hidden` / `inert` / `data-state` flip with\n * `isCompleted()`. The natural place for a wizard's final success panel.\n *\n * DOM presence is the consumer's responsibility — wrap with `@if` driven by the same\n * completed condition, or leave it mounted and toggle visibility with CSS via\n * `[data-state=\"active\"]`.\n */\n@Directive({\n selector: '[forStepperCompletedContent]',\n exportAs: 'forStepperCompletedContent',\n host: {\n role: 'group',\n '[attr.aria-hidden]': 'ctx.isCompleted() ? null : \"true\"',\n '[attr.inert]': 'ctx.isCompleted() ? null : \"\"',\n '[attr.data-state]': 'ctx.isCompleted() ? \"active\" : \"inactive\"',\n },\n})\nexport class ForStepperCompletedContent {\n protected readonly ctx = injectStepperContext('ForStepperCompletedContent');\n}\n","import { Directive } from '@angular/core';\n\nimport { injectStepperContext } from './stepper-context';\n\n/**\n * \"Next\" button for the stepper. Apply on a `<button>` element. Reflects\n * `aria-disabled=\"true\"` when `canAdvance()` is false (last step reached, root\n * disabled, or in linear mode the current step is not completed / optional).\n *\n * The button retains its native `type=\"button\"` attribute via the `type` host\n * binding to prevent accidental form submission.\n *\n * Clicking while `aria-disabled` is a no-op because `next()` guards internally.\n */\n@Directive({\n selector: 'button[forStepperNext]',\n exportAs: 'forStepperNext',\n host: {\n type: 'button',\n '[attr.aria-disabled]': '!ctx.canAdvance() ? \"true\" : null',\n '(click)': 'onClick()',\n },\n})\nexport class ForStepperNext {\n protected readonly ctx = injectStepperContext('ForStepperNext');\n\n protected onClick(): void {\n this.ctx.next();\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { injectStepperContext } from './stepper-context';\n\n/**\n * \"Previous\" button for the stepper. Apply on a `<button>` element. Reflects\n * `aria-disabled=\"true\"` when `canRetreat()` is false (first step reached or\n * root disabled).\n *\n * The button retains its native `type=\"button\"` attribute via the `type` host\n * binding to prevent accidental form submission.\n *\n * Clicking while `aria-disabled` is a no-op because `previous()` guards\n * internally.\n */\n@Directive({\n selector: 'button[forStepperPrevious]',\n exportAs: 'forStepperPrevious',\n host: {\n type: 'button',\n '[attr.aria-disabled]': '!ctx.canRetreat() ? \"true\" : null',\n '(click)': 'onClick()',\n },\n})\nexport class ForStepperPrevious {\n protected readonly ctx = injectStepperContext('ForStepperPrevious');\n\n protected onClick(): void {\n this.ctx.previous();\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { injectStepperContext } from './stepper-context';\n\n/**\n * Optional progress indicator for the Stepper. Reads the stepper context and\n * reflects how far through the steps the user is as a WAI-ARIA\n * [`progressbar`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/progressbar_role):\n * `aria-valuemin=\"0\"`, `aria-valuemax=\"100\"`, `aria-valuenow` = the computed\n * percent, and an `aria-valuetext` describing the position. Publishes a\n * `--for-stepper-progress` (0–1) custom property for styling; ships no visuals.\n *\n * Must be used inside a `[forStepper]` element.\n */\n@Directive({\n selector: '[forStepperProgress]',\n exportAs: 'forStepperProgress',\n host: {\n role: 'progressbar',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuemax]': '100',\n '[attr.aria-valuenow]': 'percent()',\n '[attr.aria-valuetext]': 'valueText()',\n '[attr.aria-label]': 'ariaLabel() || null',\n '[attr.data-orientation]': 'ctx.orientation()',\n '[style.--for-stepper-progress]': 'percent() / 100',\n },\n})\nexport class ForStepperProgress {\n protected readonly ctx = injectStepperContext('ForStepperProgress');\n\n /**\n * Basis for the reported percent. `'index'` (default) derives progress from\n * the current step index; `'completed'`\n * derives it from the count of steps whose resolved state is `completed`.\n */\n readonly valueBy = input<'index' | 'completed'>('index');\n\n /**\n * Accessible name for the progressbar. Defaults to `null`, emitting no\n * `aria-label`; prefer a visible label referenced via `aria-labelledby` when\n * one exists.\n */\n readonly ariaLabel = input<string | null>(null);\n\n readonly #completedCount = computed<number>(() => {\n const total = this.ctx.count();\n let n = 0;\n for (let i = 0; i < total; i++) {\n if (this.ctx.resolvedStateFor(i) === 'completed') {\n n++;\n }\n }\n return n;\n });\n\n readonly #value = computed<number>(() =>\n this.valueBy() === 'completed' ? this.#completedCount() : this.ctx.selectedIndex(),\n );\n\n /**\n * Progress as a whole-number percent in `[0, 100]`, reflected to\n * `aria-valuenow` and (divided by 100) to the `--for-stepper-progress`\n * custom property.\n */\n readonly percent = computed<number>(() => {\n const total = this.ctx.count();\n if (total <= 1) {\n return total === 1 && this.#value() >= 1 ? 100 : 0;\n }\n const raw = Math.round((this.#value() / (total - 1)) * 100);\n return Math.min(100, Math.max(0, raw));\n });\n\n /**\n * Human-readable position string reflected to `aria-valuetext`: `\"Step X of N\"`\n * on the `'index'` basis, `\"P% complete\"` on the `'completed'` basis.\n */\n readonly valueText = computed<string>(() =>\n this.valueBy() === 'completed'\n ? `${this.percent()}% complete`\n : `Step ${Math.min(this.ctx.selectedIndex() + 1, this.ctx.count())} of ${this.ctx.count()}`,\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAyNA;MACa,mBAAmB,GAAG,IAAI,cAAc,CAAoB,qBAAqB;AAE9F;MACa,wBAAwB,GAAG,IAAI,cAAc,CACxD,0BAA0B;AAGtB,SAAU,oBAAoB,CAAC,KAAa,EAAA;AAChD,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,E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B,EAAE,WAAW;AACnC,wBAAA,uBAAuB,EAAE,aAAa;AACtC,wBAAA,mBAAmB,EAAE,qBAAqB;AAC1C,wBAAA,yBAAyB,EAAE,mBAAmB;AAC9C,wBAAA,gCAAgC,EAAE,iBAAiB;AACpD,qBAAA;AACF,iBAAA;;;AC3BD;;AAEG;;;;"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { model, computed, Directive } from '@angular/core';
|
|
3
|
+
import { FormUiControlBase, injectHiddenInput, createDefaults } from 'forty-cdk/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Headless on/off switch implementing the
|
|
7
|
+
* [WAI-ARIA Switch pattern](https://www.w3.org/WAI/ARIA/apg/patterns/switch/)
|
|
8
|
+
* and Angular's `FormCheckboxControl` from `@angular/forms/signals` so it
|
|
9
|
+
* auto-wires with `[formField]`.
|
|
10
|
+
*
|
|
11
|
+
* Apply on a `<button type="button">` so Enter / Space activation come from
|
|
12
|
+
* native button behavior. The directive forces `type="button"` to prevent
|
|
13
|
+
* accidental form submission when nested inside a `<form>`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```html
|
|
17
|
+
* <button forSwitch [(checked)]="enabled">
|
|
18
|
+
* <span class="thumb"></span>
|
|
19
|
+
* </button>
|
|
20
|
+
*
|
|
21
|
+
* <!-- With Signal Forms: -->
|
|
22
|
+
* <button forSwitch [formField]="settings.notifications"></button>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
class ForSwitch extends FormUiControlBase {
|
|
26
|
+
/** Two-way bindable on/off state. Required by `FormCheckboxControl`. */
|
|
27
|
+
checked = model(false, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
injectHiddenInput({
|
|
32
|
+
name: this.name,
|
|
33
|
+
values: computed(() => (this.checked() ? ['on'] : [])),
|
|
34
|
+
disabled: this.effectiveDisabled,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
onClick() {
|
|
38
|
+
if (this.effectiveDisabled() || this.readonly()) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.checked.update((v) => !v);
|
|
42
|
+
}
|
|
43
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForSwitch, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
44
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: ForSwitch, isStandalone: true, selector: "[forSwitch]", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { attributes: { "role": "switch", "type": "button" }, listeners: { "click": "onClick()", "blur": "markTouched()" }, properties: { "attr.aria-checked": "checked() ? \"true\" : \"false\"", "attr.aria-disabled": "effectiveDisabled() ? \"true\" : null", "attr.aria-readonly": "readonly() ? \"true\" : null", "attr.aria-required": "required() ? \"true\" : null", "attr.aria-invalid": "invalid() ? \"true\" : null", "attr.aria-busy": "pending() ? \"true\" : null", "attr.name": "name() || null", "attr.data-state": "checked() ? \"checked\" : \"unchecked\"", "attr.data-disabled": "effectiveDisabled() ? \"\" : null", "attr.data-readonly": "readonly() ? \"\" : null" } }, exportAs: ["forSwitch"], usesInheritance: true, ngImport: i0 });
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForSwitch, decorators: [{
|
|
47
|
+
type: Directive,
|
|
48
|
+
args: [{
|
|
49
|
+
selector: '[forSwitch]',
|
|
50
|
+
exportAs: 'forSwitch',
|
|
51
|
+
host: {
|
|
52
|
+
role: 'switch',
|
|
53
|
+
type: 'button',
|
|
54
|
+
'[attr.aria-checked]': 'checked() ? "true" : "false"',
|
|
55
|
+
'[attr.aria-disabled]': 'effectiveDisabled() ? "true" : null',
|
|
56
|
+
'[attr.aria-readonly]': 'readonly() ? "true" : null',
|
|
57
|
+
'[attr.aria-required]': 'required() ? "true" : null',
|
|
58
|
+
'[attr.aria-invalid]': 'invalid() ? "true" : null',
|
|
59
|
+
'[attr.aria-busy]': 'pending() ? "true" : null',
|
|
60
|
+
'[attr.name]': 'name() || null',
|
|
61
|
+
'[attr.data-state]': 'checked() ? "checked" : "unchecked"',
|
|
62
|
+
'[attr.data-disabled]': 'effectiveDisabled() ? "" : null',
|
|
63
|
+
'[attr.data-readonly]': 'readonly() ? "" : null',
|
|
64
|
+
'(click)': 'onClick()',
|
|
65
|
+
'(blur)': 'markTouched()',
|
|
66
|
+
},
|
|
67
|
+
}]
|
|
68
|
+
}], ctorParameters: () => [], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }] } });
|
|
69
|
+
|
|
70
|
+
const FALLBACK = {};
|
|
71
|
+
const { token, provideDefaults } = createDefaults('FOR_SWITCH_DEFAULTS', FALLBACK);
|
|
72
|
+
/** Token holding the resolved switch defaults for the current scope. */
|
|
73
|
+
const FOR_SWITCH_DEFAULTS = token;
|
|
74
|
+
/**
|
|
75
|
+
* Configures forty-cdk switch defaults for this injector scope. Partial
|
|
76
|
+
* overrides inherit unspecified keys from the parent scope (or library
|
|
77
|
+
* defaults at the root).
|
|
78
|
+
*/
|
|
79
|
+
function provideForSwitchDefaults(defaults = {}) {
|
|
80
|
+
return provideDefaults(defaults);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Exact public names of every `ForSwitch` input, its models included. Spread it into the
|
|
85
|
+
* `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the
|
|
86
|
+
* primitive's full surface — the Signal Forms members `[formField]` binds among them —
|
|
87
|
+
* without hand-maintaining the list. Always spread into an inline object literal as shown
|
|
88
|
+
* below: the literal is what keeps the entry statically analyzable for consumers compiling
|
|
89
|
+
* against the published package. An anti-drift spec fails when this list no longer matches
|
|
90
|
+
* the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported
|
|
91
|
+
* wrapping patterns.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* @Component({
|
|
96
|
+
* selector: 'button[mySwitch]',
|
|
97
|
+
* template: '',
|
|
98
|
+
* hostDirectives: [
|
|
99
|
+
* {
|
|
100
|
+
* directive: ForSwitch,
|
|
101
|
+
* inputs: [...FOR_SWITCH_HOST_DIRECTIVE_INPUTS],
|
|
102
|
+
* outputs: [...FOR_SWITCH_HOST_DIRECTIVE_OUTPUTS],
|
|
103
|
+
* },
|
|
104
|
+
* ],
|
|
105
|
+
* })
|
|
106
|
+
* export class MySwitch {}
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
const FOR_SWITCH_HOST_DIRECTIVE_INPUTS = [
|
|
110
|
+
'checked',
|
|
111
|
+
'dirty',
|
|
112
|
+
'disabled',
|
|
113
|
+
'errors',
|
|
114
|
+
'invalid',
|
|
115
|
+
'name',
|
|
116
|
+
'pending',
|
|
117
|
+
'readonly',
|
|
118
|
+
'required',
|
|
119
|
+
'touched',
|
|
120
|
+
];
|
|
121
|
+
/**
|
|
122
|
+
* Exact public names of every `ForSwitch` output, the Signal Forms `touch` output
|
|
123
|
+
* included. Spread it into the `outputs` array of the same `hostDirectives` entry as
|
|
124
|
+
* {@link FOR_SWITCH_HOST_DIRECTIVE_INPUTS}.
|
|
125
|
+
*/
|
|
126
|
+
const FOR_SWITCH_HOST_DIRECTIVE_OUTPUTS = [
|
|
127
|
+
'checkedChange',
|
|
128
|
+
'touchedChange',
|
|
129
|
+
'touch',
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Generated bundle index. Do not edit.
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
export { FOR_SWITCH_DEFAULTS, FOR_SWITCH_HOST_DIRECTIVE_INPUTS, FOR_SWITCH_HOST_DIRECTIVE_OUTPUTS, ForSwitch, provideForSwitchDefaults };
|
|
137
|
+
//# sourceMappingURL=forty-cdk-switch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forty-cdk-switch.mjs","sources":["../../../projects/forty-cdk/switch/src/switch.ts","../../../projects/forty-cdk/switch/src/switch-defaults.ts","../../../projects/forty-cdk/switch/src/switch-host-directive.ts","../../../projects/forty-cdk/switch/src/forty-cdk-switch.ts"],"sourcesContent":["import { computed, Directive, model } from '@angular/core';\nimport type { FormCheckboxControl } from '@angular/forms/signals';\n\nimport { FormUiControlBase, injectHiddenInput } from 'forty-cdk/core';\n\n/**\n * Headless on/off switch implementing the\n * [WAI-ARIA Switch pattern](https://www.w3.org/WAI/ARIA/apg/patterns/switch/)\n * and Angular's `FormCheckboxControl` from `@angular/forms/signals` so it\n * auto-wires with `[formField]`.\n *\n * Apply on a `<button type=\"button\">` so Enter / Space activation come from\n * native button behavior. The directive forces `type=\"button\"` to prevent\n * accidental form submission when nested inside a `<form>`.\n *\n * @example\n * ```html\n * <button forSwitch [(checked)]=\"enabled\">\n * <span class=\"thumb\"></span>\n * </button>\n *\n * <!-- With Signal Forms: -->\n * <button forSwitch [formField]=\"settings.notifications\"></button>\n * ```\n */\n@Directive({\n selector: '[forSwitch]',\n exportAs: 'forSwitch',\n host: {\n role: 'switch',\n type: 'button',\n '[attr.aria-checked]': 'checked() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'effectiveDisabled() ? \"true\" : null',\n '[attr.aria-readonly]': 'readonly() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': 'invalid() ? \"true\" : null',\n '[attr.aria-busy]': 'pending() ? \"true\" : null',\n '[attr.name]': 'name() || null',\n '[attr.data-state]': 'checked() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'effectiveDisabled() ? \"\" : null',\n '[attr.data-readonly]': 'readonly() ? \"\" : null',\n '(click)': 'onClick()',\n '(blur)': 'markTouched()',\n },\n})\nexport class ForSwitch extends FormUiControlBase implements FormCheckboxControl {\n /** Two-way bindable on/off state. Required by `FormCheckboxControl`. */\n readonly checked = model<boolean>(false);\n\n constructor() {\n super();\n injectHiddenInput({\n name: this.name,\n values: computed(() => (this.checked() ? ['on'] : [])),\n disabled: this.effectiveDisabled,\n });\n }\n\n protected onClick(): void {\n if (this.effectiveDisabled() || this.readonly()) {\n return;\n }\n this.checked.update((v) => !v);\n }\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\n\n/**\n * Defaults inherited by descendant switches in the surrounding injector\n * scope. Configure with `provideForSwitchDefaults`. The shape is a stub\n * today — present so future per-scope tuning can land without churning the\n * public surface.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface ForSwitchDefaults {}\n\nconst FALLBACK: ForSwitchDefaults = {};\n\nconst { token, provideDefaults } = createDefaults<ForSwitchDefaults>(\n 'FOR_SWITCH_DEFAULTS',\n FALLBACK,\n);\n\n/** Token holding the resolved switch defaults for the current scope. */\nexport const FOR_SWITCH_DEFAULTS = token;\n\n/**\n * Configures forty-cdk switch defaults for this injector scope. Partial\n * overrides inherit unspecified keys from the parent scope (or library\n * defaults at the root).\n */\nexport function provideForSwitchDefaults(defaults: Partial<ForSwitchDefaults> = {}): Provider[] {\n return provideDefaults(defaults);\n}\n","/**\n * Exact public names of every `ForSwitch` input, its models included. Spread it into the\n * `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the\n * primitive's full surface — the Signal Forms members `[formField]` binds among them —\n * without hand-maintaining the list. Always spread into an inline object literal as shown\n * below: the literal is what keeps the entry statically analyzable for consumers compiling\n * against the published package. An anti-drift spec fails when this list no longer matches\n * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported\n * wrapping patterns.\n *\n * @example\n * ```ts\n * @Component({\n * selector: 'button[mySwitch]',\n * template: '',\n * hostDirectives: [\n * {\n * directive: ForSwitch,\n * inputs: [...FOR_SWITCH_HOST_DIRECTIVE_INPUTS],\n * outputs: [...FOR_SWITCH_HOST_DIRECTIVE_OUTPUTS],\n * },\n * ],\n * })\n * export class MySwitch {}\n * ```\n */\nexport const FOR_SWITCH_HOST_DIRECTIVE_INPUTS = [\n 'checked',\n 'dirty',\n 'disabled',\n 'errors',\n 'invalid',\n 'name',\n 'pending',\n 'readonly',\n 'required',\n 'touched',\n] as const;\n\n/**\n * Exact public names of every `ForSwitch` output, the Signal Forms `touch` output\n * included. Spread it into the `outputs` array of the same `hostDirectives` entry as\n * {@link FOR_SWITCH_HOST_DIRECTIVE_INPUTS}.\n */\nexport const FOR_SWITCH_HOST_DIRECTIVE_OUTPUTS = [\n 'checkedChange',\n 'touchedChange',\n 'touch',\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;;;;AAmBG;AAqBG,MAAO,SAAU,SAAQ,iBAAiB,CAAA;;IAErC,OAAO,GAAG,KAAK,CAAU,KAAK;gFAAC;AAExC,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AACP,QAAA,iBAAiB,CAAC;YAChB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YACtD,QAAQ,EAAE,IAAI,CAAC,iBAAiB;AACjC,SAAA,CAAC;IACJ;IAEU,OAAO,GAAA;QACf,IAAI,IAAI,CAAC,iBAAiB,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE;YAC/C;QACF;AACA,QAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAChC;uGAlBW,SAAS,EAAA,IAAA,EAAA,EAAA,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