import * as _angular_core from '@angular/core'; import { InjectionToken, Signal, Provider } from '@angular/core'; import { WritingDirection, RovingTabindex, ListNavigationAction } from 'forty-cdk/core'; import * as forty_cdk_stepper from 'forty-cdk/stepper'; import { FieldTree } from '@angular/forms/signals'; /** Activation timing for interactive-mode arrow navigation. */ type StepperActivationMode = 'automatic' | 'manual'; /** Accessibility model: interactive Tabs pattern vs display-only progress list. */ type StepperMode = 'interactive' | 'progress'; /** * Registry entry for one step, owned by `ForStepperItem`. Drives index * derivation and linear gating. */ interface ForStepperItemHandle { /** Host element, used for DOM-order sorting in the collection. */ readonly host: HTMLElement; /** Whether this step has been marked as completed by the consumer. */ readonly completed: Signal; /** Whether this step can be skipped when the stepper is in linear mode. */ readonly optional: Signal; /** Whether this step is disabled (own `disabled` OR root `disabled`). */ readonly effectiveDisabled: Signal; /** Whether this step has an error condition. */ readonly hasError: Signal; /** The resolved `data-state` string for this step. */ readonly resolvedState: Signal; } /** * Registry entry for one trigger (roving participant and id source). Used by * the root to wire roving tabindex, id lookups, and navigation. */ interface ForStepperTriggerHandle { /** Host element, used for DOM-order sorting and focus moves. */ readonly host: HTMLElement; /** * DOM-order index of the step this trigger belongs to (from the item * context), used to map a trigger position back to its step index for * selection. */ readonly index: Signal; /** The trigger's own host id, for `aria-labelledby` on content panels. */ readonly id: Signal; /** * Whether this trigger can be focused and activated. `false` when the step * is disabled or not yet reachable in linear mode. */ readonly selectable: Signal; /** * Inverse of `selectable`. Required by `firstEnabledHost` and the roving * tracker's reconciliation, which read a `disabled` signal per handle. */ readonly disabled: Signal; } /** * Registry entry for one content panel (id source). The panel's step index is * carried on the handle, so a lookup never conflates it with the panel's * position in the content collection. */ interface ForStepperContentHandle { /** Host element, used for DOM-order sorting and index derivation. */ readonly host: HTMLElement; /** * Index of the step this panel is paired with — the explicit `[step]` when * bound, else the panel's DOM-order position among the registered panels. */ readonly index: Signal; /** The panel's own host id, for `aria-controls` on triggers. */ readonly id: Signal; } /** * Coordination contract owned by `ForStepper`. Triggers, items, and content * panels register here; navigation and selection flow back through these * methods. * * Implements the [WAI-ARIA Tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/) * in `mode="interactive"` and a `
    `-based progress list with * `aria-current="step"` in `mode="progress"`. */ interface ForStepperContext { /** Two-way bindable selected step index. */ readonly selectedIndex: Signal; /** When true, steps are only reachable after all preceding steps are completed or optional. */ readonly linear: Signal; /** Accessibility model — `'interactive'` (Tabs APG) or `'progress'` (progress list). */ readonly mode: Signal; /** Layout axis for the step list. */ readonly orientation: Signal<'horizontal' | 'vertical'>; /** Arrow-key activation timing when in interactive mode. */ readonly activationMode: Signal; /** Resolved writing direction (`'ltr'` or `'rtl'`). */ readonly dir: Signal; /** Whether the entire stepper is disabled. */ readonly disabled: Signal; /** Total number of registered step items. */ readonly count: Signal; /** * True when the stepper has reached the terminal completed state * (`selectedIndex()` >= `count()`). */ readonly isCompleted: Signal; /** Roving tabindex tracker for interactive-mode triggers. */ readonly roving: RovingTabindex; /** Returns the DOM-order index of `item` in the item collection, or -1 if not found. */ indexOf(item: ForStepperItemHandle): number; /** Returns true when `index` matches the currently selected step. */ isCurrent(index: number): boolean; /** * Returns true when step `index` can be navigated to in linear mode. Index 0 * is always reachable; subsequent steps require all preceding steps to be * completed or optional. */ isReachable(index: number): boolean; /** Returns the resolved `data-state` string for step at `index`. */ resolvedStateFor(index: number): string; /** * Selects step `index`. No-op when the root is disabled, when `index` is * out of range, or when the step is not reachable in linear mode. */ select(index: number): void; /** * Advances to the next step, or into the terminal completed state when on * the last step. No-op when the root is disabled, when already in the terminal state, or * (in linear mode) when the current step is neither completed nor optional. */ next(): void; /** * Retreats to the previous step. No-op when the root is disabled or the * first step is already selected. Bypasses the linear reachability gate — * going back always works. */ previous(): void; /** * Returns true when the Next button can advance — including advancing the last * step into the terminal completed state. False when disabled, already in the * terminal state, or (in linear mode) the current step is not completed/optional. */ canAdvance(): boolean; /** Returns true when the Previous button can retreat. False when disabled or at the first step. */ canRetreat(): boolean; /** * Moves focus from `currentTrigger` according to `action` (interactive mode * only). Arrow navigation lands on disabled / linear-unreachable triggers * too (they stay focusable per the APG); automatic-mode selection is guarded * so it never activates a non-selectable step. Selection resolves the target * step by its item index (carried on the trigger handle), not by the trigger's * position in the trigger collection. */ navigate(currentTrigger: HTMLElement, action: ListNavigationAction): void; /** Registers a step item handle into the item collection. */ registerItem(h: ForStepperItemHandle): void; /** Unregisters a step item handle from the item collection. */ unregisterItem(h: ForStepperItemHandle): void; /** Registers a trigger handle into the trigger collection. */ registerTrigger(h: ForStepperTriggerHandle): void; /** Unregisters a trigger handle from the trigger collection and the roving tracker. */ unregisterTrigger(h: ForStepperTriggerHandle): void; /** Registers a content panel handle into the content collection. */ registerContent(h: ForStepperContentHandle): void; /** Unregisters a content panel handle from the content collection. */ unregisterContent(h: ForStepperContentHandle): void; /** * Returns the id of the trigger belonging to step `index`, or `null` when no * registered trigger claims that step. Resolved through the trigger handle's * item index, so a structurally hidden trigger never shifts the pairing. */ triggerIdFor(index: number): string | null; /** * Returns the id of the content panel paired with step `index`, or `null` * when no registered panel claims that step. Resolved through the content * handle's step index, so a structurally absent panel never shifts the * pairing. */ contentIdFor(index: number): string | null; /** * Returns the DOM-order index of the content panel whose host is `host`, or * -1 if not registered. Used by `ForStepperContent` as the positional * fallback when the panel declares no explicit `[step]`. */ indexOfContent(host: HTMLElement): number; /** * True when `el` is the first selectable trigger (the roving entry-point * fallback when no step is selected or the roving pointer is stale). */ isFirstSelectableTrigger(el: HTMLElement): boolean; /** * True when some registered trigger corresponds to the currently selected * step. Distinguishes "the current step owns the tab stop" from "the selected * index points at a missing or unreachable trigger" so the per-trigger * tabindex fallback can re-engage the first-selectable entry point. Matched on * the trigger handle's item index, never on its collection position. */ hasCurrentTrigger(): boolean; } /** * Per-step state contract. Provided by `ForStepperItem`; consumed by * `ForStepperTrigger`, `ForStepperIndicator`, and `ForStepperSeparator`. */ interface ForStepperItemContext { /** DOM-order index of this step within the stepper. */ readonly index: Signal; /** True when this step is the currently selected step. */ readonly current: Signal; /** * True when this step can be focused and activated (reachable and not * effectively disabled). */ readonly selectable: Signal; /** Whether this step has been marked as completed. */ readonly completed: Signal; /** Whether this step can be skipped when the stepper is in linear mode. */ readonly optional: Signal; /** Whether this step is disabled (own `disabled` OR root `disabled`). */ readonly effectiveDisabled: Signal; /** Whether this step has an error condition. */ readonly hasError: Signal; /** Resolved `data-state` string (precedence: custom state > error > active > completed > pending). */ readonly resolvedState: Signal; /** * Selects this step. Delegates to `ForStepperContext.select(index)` — the * linear reachability and disabled guards apply. */ select(): void; } /** Injection token for the root stepper context (`ForStepper`). */ declare const FOR_STEPPER_CONTEXT: InjectionToken; /** Injection token for the per-step item context (`ForStepperItem`). */ declare const FOR_STEPPER_ITEM_CONTEXT: InjectionToken; /** * Root of the Stepper primitive. Owns the selected step index, linear * progression, accessibility mode, orientation, and disabled state. Provides * the shared context to descendant directives. * * Implements the [WAI-ARIA Tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/) * in `mode="interactive"` (roving tabindex, `role="tablist"`, `aria-selected`) * and an ordered-list progress pattern with `aria-current="step"` in * `mode="progress"`. * * `activationMode='manual'` (default): arrow navigation only moves focus; * Space / Enter activates. Recommended for wizards where step activation * triggers validation. `activationMode='automatic'`: arrow navigation moves * focus AND selects the step. */ declare class ForStepper implements ForStepperContext { #private; /** * Two-way bindable selected step index in the inclusive range `0 … count`. * Defaults to `0`. The terminal value `=== count()` (one past the last step) is * the **completed** state (see `isCompleted` / `complete`). The `model()` change * emitter (`(selectedIndexChange)`) fires only on internal selection changes * (trigger click, Next/Previous, automatic-mode arrow navigation), never on * consumer writes via `[(selectedIndex)]`. */ readonly selectedIndex: _angular_core.ModelSignal; /** * Emits once each time the stepper transitions **into** the completed terminal * state — i.e. when `selectedIndex()` reaches `count()`. Does not re-emit while * it stays completed; retreating via `previous()` and re-entering emits again. */ readonly complete: _angular_core.OutputEmitterRef; /** * When true, steps are only reachable after all preceding steps are completed * or optional. Navigating back (`previous()`) always works regardless of this * flag. */ readonly linear: _angular_core.InputSignalWithTransform; /** * Accessibility model. `'interactive'` (default): full WAI-ARIA Tabs pattern * — `role="tablist"`, `role="tab"`, `role="tabpanel"`, roving tabindex, arrow * navigation. `'progress'`: ordered list with `aria-current="step"` on the * active trigger — no tab stop manipulation. */ readonly mode: _angular_core.InputSignal; /** * Layout axis for the step list. Affects `aria-orientation` on the list and * which arrow keys navigate in interactive mode. */ readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">; /** * Arrow-key activation timing in interactive mode. Defaults to the value from * `provideForStepperDefaults` for the surrounding scope (library default: * `'manual'`). */ readonly activationMode: _angular_core.InputSignal; /** * Whether arrow navigation wraps around past the first / last selectable * trigger. Defaults to the value from `provideForStepperDefaults` for the * surrounding scope (library default: `true`). */ readonly loop: _angular_core.InputSignalWithTransform; /** * When true, all step triggers are non-interactive and the root carries * `data-disabled`. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Writing direction. When unset (default `null`), the inherited ambient * direction is resolved from the nearest ancestor carrying a `dir` attribute * (or ``), defaulting to `'ltr'`. An explicit `[dir]` always wins. * The resolved value is reflected to the host `dir` attribute and swaps * ArrowLeft / ArrowRight semantics in RTL. */ readonly _dirInput: _angular_core.InputSignal; readonly dir: _angular_core.Signal; readonly roving: RovingTabindex; /** Total number of registered step items. */ readonly count: _angular_core.Signal; /** * True when the stepper is in the terminal **completed** state: `selectedIndex()` * has reached `count()` (one past the last step). No step is current and every * `[forStepperContent]` panel is inactive while this holds. */ readonly isCompleted: _angular_core.Signal; constructor(); indexOf(item: ForStepperItemHandle): number; isCurrent(index: number): boolean; isReachable(index: number): boolean; resolvedStateFor(index: number): string; select(index: number): void; next(): void; previous(): void; canAdvance(): boolean; canRetreat(): boolean; navigate(currentTrigger: HTMLElement, action: ListNavigationAction): void; registerItem(h: ForStepperItemHandle): void; unregisterItem(h: ForStepperItemHandle): void; registerTrigger(h: ForStepperTriggerHandle): void; unregisterTrigger(h: ForStepperTriggerHandle): void; registerContent(h: ForStepperContentHandle): void; unregisterContent(h: ForStepperContentHandle): void; triggerIdFor(index: number): string | null; contentIdFor(index: number): string | null; indexOfContent(host: HTMLElement): number; isFirstSelectableTrigger(el: HTMLElement): boolean; hasCurrentTrigger(): boolean; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The step-list container. In `mode="interactive"` renders as `role="tablist"` * with `aria-orientation`; in `mode="progress"` renders as `role="list"`. * * Apply on an `
      ` (recommended for semantic list markup) wrapping the * `[forStepperItem]` elements. The `[forStepperContent]` panels live as * siblings of the list. */ declare class ForStepperList { protected readonly ctx: forty_cdk_stepper.ForStepperContext; /** Accessible name for the step list. Defers to a consumer `aria-labelledby`. */ readonly ariaLabel: _angular_core.InputSignal; protected readonly resolvedAriaLabel: _angular_core.Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * One step within a `ForStepper`. Owns per-step state (`completed`, `optional`, * `disabled`, `hasError`, `state`) and exposes the `ForStepperItemContext` that * child `[forStepperTrigger]`, `[forStepperIndicator]`, and * `[forStepperSeparator]` directives consume. * * Apply on a list item element (e.g. `
    1. `). The step's index * is derived reactively from its DOM position within the stepper via the root's * item collection. * * In `mode="interactive"` the host carries `role="presentation"` so the * `ForStepperList` `role="tablist"` owns the `role="tab"` triggers directly — an * interposed implicit `listitem` would violate the tablist's required-owned- * elements contract. In `mode="progress"` the implicit `listitem` is kept (it * sits correctly under the list's `role="list"`). */ declare class ForStepperItem implements ForStepperItemContext, ForStepperItemHandle { protected readonly ctx: forty_cdk_stepper.ForStepperContext; /** Host element — satisfies `ForStepperItemHandle.host` for collection registration. */ readonly host: HTMLElement; /** * Manual completion flag. When `true`, the step is completed regardless of any * bound `field()`. Bind via `[completed]`. */ readonly _completedInput: _angular_core.InputSignalWithTransform; /** Marks this step as optional (can be skipped in linear mode). */ readonly optional: _angular_core.InputSignalWithTransform; /** When true, this step's trigger ignores clicks and the step is unreachable by keyboard. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Manual error flag. When `true`, the step reflects the `'error'` resolved state * (unless current) regardless of any bound `field()`. Bind via `[hasError]`. */ readonly _hasErrorInput: _angular_core.InputSignalWithTransform; /** * Optional Signal Forms field. When bound, the step's `completed` and * `hasError` derive from the field's reactive validity: `completed` is `true` * when the field is valid and touched; `hasError` is `true` when the field is * touched and invalid. A manual `[completed]` / `[hasError]` input always wins * when set. Leave unset to drive completion manually. * * The `@angular/forms` peer is optional: the field *type* is imported with * `import type`, so binding `[field]` requires the peer but the primitive * compiles and tree-shakes without it for consumers who never use it. */ readonly field: _angular_core.InputSignal | null>; /** * Whether this step is completed. A manual `[completed]` input wins; otherwise, * when a `field()` is bound, derives `true` from `field` valid + touched. */ readonly completed: _angular_core.Signal; /** * Whether this step has an error. A manual `[hasError]` input wins; otherwise, * when a `field()` is bound, derives `true` from `field` touched + invalid. */ readonly hasError: _angular_core.Signal; /** * Custom state string override. When non-empty, wins over the derived resolved * state (`error`, `active`, `completed`, `pending`) and drives every * `data-state` attribute on this step. */ readonly state: _angular_core.InputSignal; /** Whether this step is disabled — own `disabled` OR the root stepper's `disabled`. */ readonly effectiveDisabled: _angular_core.Signal; /** DOM-order index of this step within the stepper. */ readonly index: _angular_core.Signal; /** True when this step is the currently selected step. */ readonly current: _angular_core.Signal; /** * True when this step can be focused and activated. False when the step is * effectively disabled or not yet reachable in linear mode. */ readonly selectable: _angular_core.Signal; /** * Resolved `data-state` string. Precedence: * 1. Custom `state()` when non-empty. * 2. `'error'` when `hasError()` and not current. * 3. `'active'` when current. * 4. `'completed'` when `completed()`. * 5. `'pending'` otherwise. */ readonly resolvedState: _angular_core.Signal; constructor(); /** Selects this step. Delegates to `ForStepperContext.select(index)`. */ select(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Header for one step. In `mode="interactive"` carries `role="tab"`, participates * in the roving tabindex, and wires `aria-selected` / `aria-controls` / * `aria-disabled`. In `mode="progress"` carries `aria-current="step"` on the * active step only and is a static element (no tab-stop manipulation). * * Apply on a `