Skip to main content
cngx-src documentation

CngxStepperHost

Interface

projects/common/stepper/stepper-host.token.ts

Referenced by#

Import#

import { CngxStepperHost } from '@cngx/common/stepper'

Description#

Contract atoms see via CNGX_STEPPER_HOST. Mirrors the directive's surface 1:1 - atoms never reach the concrete class.

Index#

Instance Properties#

activeGroupId#Signal
Readonly

Root-level group whose subtree contains the active step, or null when the active step is a root-level step (e.g. a trailing Finish). The single focus-driven-collapse source: atoms read it via this contract, never the concrete presenter. Drives CngxStepGroup.isCollapsed, the strip aria-expanded binding, and visibleStripNodes.

activeStepId#Signal
Readonly
activeStepIndex#Signal
Readonly
busy#Signal
Readonly

true while a commit is in flight (commitState.status() === 'pending'). Drives the busy-disable on nav affordances. Keyed on the strict 'pending' status, consistent with the per-step busy gate.

canGoNext#Signal
Readonly

true when selectNext would move - i.e. an enabled, linear-unblocked step follows the active one. Derived from the same predicates select() enforces, so a Next affordance can never drift from the navigation it gates.

canGoPrevious#Signal
Readonly

true when selectPrevious would move - i.e. an enabled step precedes the active one. The single gate a Back affordance reads; never re-derive it from stepsOnly at the call site.

commitState#CngxAsyncState
Readonly
commitTransition#StatusTransition
Readonly

Reactive current/previous pair for the commit-state status. The organism's <span cngxLiveRegion> reads this tracker on every pending → success / error transition. Allocated once per presenter - consumers MUST read this rather than calling createTransitionTracker locally so the linkedSignal is shared.

flatSteps#Signal
Readonly
intendedStepIndex#Signal
Readonly
isFirstStep#Signal
Readonly

true when the active step is the first one (no earlier step).

isLastStep#Signal
Readonly

true when the active step is the last one (no later step).

lastFailedIndex#Signal
Readonly

Index of the most recently refused commit target, or undefined when no rejection is pending. Set by the rejection arm of select(); cleared by a successful re-pick of the same target or via clearLastFailed. Drives strip rejection decoration and the commitRolledBackTo chain in liveAnnouncement.

linear#Signal
Readonly
nextStepLabel#Signal
Readonly

Label of the step selectNext would land on, or undefined when none follows. Resolved through the enabled-step traversal so a "Continue to {{ label }}" affordance announces the real target.

orientation#Signal<"horizontal" | "vertical">
Readonly
originIndexDuringCommit#Signal
Readonly

Origin captured at commit-window open - the safe-harbour the user is returned to on optimistic rollback. Resolves the origin label for the commitRolledBackTo(originLabel) phrase. Cleared on success; retained on rejection through the persistence window.

previousStepLabel#Signal
Readonly

Label of the step selectPrevious would land on, or undefined when none precedes.

stepCount#Signal
Readonly

Step-only count - the length of stepsOnly.

stepsOnly#Signal
Readonly

Step-only flat projection (group nodes filtered out). Structural-equal via flatStepsEqual; the single source for any step-count / step-position lookup.

Contract: variant and skin organisms MUST read this signal directly. Local re-derivation (e.g. flatSteps().filter(...) inside a variant's computed) is rejected at review time - the projection's equality contract is the load-bearing invariant, and a local re-filter breaks the shape-stable short-circuit that downstream consumers rely on. Add lookup helpers as methods on this contract rather than re-deriving.

stepTree#Signal
Readonly
visibleStripNodes#Signal
Readonly

Flat strip projection under the focus-driven group-collapse policy: identical to flatSteps when groupCollapse is 'off', and with every non-active root-level group's children dropped (header node alone) under 'expand-active'. The strip @for reads this; stepsOnly stays the single counting / announcement source.

Contract: variant and skin organisms drive the strip off this projection, never re-derive it. Structural-equal via flatStepsEqual (each retained node keeps its flatSteps flatIndex), so a shape-stable re-emit short-circuits the strip render.

Methods#

canNavigateTo#boolean
canNavigateTo(index: number)

true when the header at the given step-only index may be navigated to: the step is enabled and not blocked by the linear gate. The single reachability predicate a header affordance reads - the organism MUST call this rather than reaching the presenter's private linear-block check. Out-of-range indices return false.

@paramindexnumber
clearLastFailed#void

Drop the persisted lastFailedIndex flag. Idempotent; safe to wire to a Dismiss button or aggregator-cleared.

register#void
register(handle: CngxStepRegistration, parentId?: string | null)
@paramparentId?string | null
reset#void
select#void
select(index: number)
@paramindexnumber
selectById#void
selectById(id: string)
@paramidstring
selectNext#void
selectPrevious#void
unregister#void
unregister(id: string)
@paramidstring