MCPcopy Create free account
hub / github.com/angular/components / CdkStep

Class CdkStep

src/cdk/stepper/stepper.ts:114–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 encapsulation: ViewEncapsulation.None,
113})
114export class CdkStep implements OnChanges {
115 private _stepperOptions: StepperOptions;
116 _stepper = inject(CdkStepper);
117 _displayDefaultIndicatorType: boolean;
118
119 /** Template for step label if it exists. */
120 @ContentChild(CdkStepLabel) stepLabel!: CdkStepLabel;
121
122 /** Forms that have been projected into the step. */
123 @ContentChildren(
124 // Note: we look for `ControlContainer` here, because both `NgForm` and `FormGroupDirective`
125 // provides themselves as such, but we don't want to have a concrete reference to both of
126 // the directives. The type is marked as `Partial` in case we run into a class that provides
127 // itself as `ControlContainer` but doesn't have the same interface as the directives.
128 ControlContainer,
129 {
130 descendants: true,
131 },
132 )
133 protected _childForms: QueryList<Partial<NgForm | FormGroupDirective>> | undefined;
134
135 /** Template for step content. */
136 @ViewChild(TemplateRef, {static: true}) content!: TemplateRef<any>;
137
138 /** The top level abstract control of the step. */
139 @Input() stepControl!: StepControl;
140
141 /** Whether user has attempted to move away from the step. */
142 get interacted(): boolean {
143 return this._interacted();
144 }
145 set interacted(value: boolean) {
146 this._interacted.set(value);
147 }
148 private _interacted = signal(false);
149
150 /** Emits when the user has attempted to move away from the step. */
151 @Output('interacted')
152 readonly interactedStream: EventEmitter<CdkStep> = new EventEmitter<CdkStep>();
153
154 /** Plain text label of the step. */
155 @Input() label!: string;
156
157 /** Error message to display when there's an error. */
158 @Input() errorMessage!: string;
159
160 /** Aria label for the tab. */
161 @Input('aria-label') ariaLabel!: string;
162
163 /**
164 * Reference to the element that the tab is labelled by.
165 * Will be cleared if `aria-label` is set at the same time.
166 */
167 @Input('aria-labelledby') ariaLabelledby!: string;
168
169 /** State of the step. */
170 @Input()
171 get state(): StepState {

Callers

nothing calls this directly

Calls 5

_showErrorMethod · 0.95
signalFunction · 0.85
computedFunction · 0.85
isSelectedMethod · 0.65
indexMethod · 0.45

Tested by

no test coverage detected