File

projects/ui-kit-lib/src/lib/v2/executors/step-header.ts

Description

Header (tab) for a step in the stepper. Responsibilities:

  • Renders label, state icon/text, and optional/error hints.
  • Manages focus (including origin-aware focus for a11y styling).
  • Reacts to i18n changes from StepperIntl and marks for check.

Extends

CdkStepHeader

Implements

AfterViewInit OnDestroy

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor()

Inputs

active
Type : boolean

Whether this step is currently active (focused/engaged).

errorMessage
Type : string

Error message displayed when state === 'error'.

iconOverrides
Type : literal type

Optional templates to override the default icons by state.

index
Type : number

0-based index of the step within the stepper.

label
Type : MDStepLabel | string

Label can be a template (MDStepLabel) or plain string.

optional
Type : boolean

Marks the step as optional (affects label rendering).

selected
Type : boolean

Whether this step is selected (active tab).

state
Type : StepState

Visual/logical state of this step (e.g., 'number' | 'done' | 'error' | 'edit').

Methods

_getDefaultTextForState
_getDefaultTextForState(state: StepState)

Default text for built-in states when an icon template isn’t provided.

  • 'number' → (index + 1) as text
  • 'edit' → 'create'
  • 'error' → 'warning'
  • otherwise returns the state string itself
Parameters :
Name Type Optional
state StepState No
Returns : string
_getHostElement
_getHostElement()

Host element getter used by base classes/templates.

Returns : any
Protected _hasEmptyLabel
_hasEmptyLabel()

True if no label, no optional/error labels — used for styling empty headers.

Returns : boolean
Protected _hasErrorLabel
_hasErrorLabel()

True if the current state is 'error'.

Returns : boolean
Protected _hasOptionalLabel
_hasOptionalLabel()

True if the step is optional and not in error state.

Returns : boolean
_stringLabel
_stringLabel()

Returns string label if provided directly, otherwise null.

Returns : string | null
_templateLabel
_templateLabel()

Returns template label if provided, otherwise null.

Returns : MDStepLabel | null
focus
focus(origin?: FocusOrigin, options?: FocusOptions)

Programmatic focus with optional origin (mouse/keyboard/touch/program). Falls back to direct focus if no origin is provided.

Parameters :
Name Type Optional
origin FocusOrigin Yes
options FocusOptions Yes
Returns : void

Properties

_intl
Type : unknown
Default value : inject(StepperIntl)

Stepper i18n service (emits when labels change).

results matching ""

    No results matching ""