|
13 | 13 | <div class="mat-horizontal-stepper-wrapper"> |
14 | 14 | <div class="mat-horizontal-stepper-header-container" role="tablist"> |
15 | 15 | @for (step of steps; track step) { |
16 | | - <ng-container |
17 | | - [ngTemplateOutlet]="stepTemplate" |
18 | | - [ngTemplateOutletContext]="{step, i: $index}"/> |
| 16 | + <mat-step-header |
| 17 | + class="mat-horizontal-stepper-header" |
| 18 | + role="tab" |
| 19 | + (click)="step.select()" |
| 20 | + (keydown)="_onKeydown($event)" |
| 21 | + [tabIndex]="_getFocusIndex() === $index ? 0 : -1" |
| 22 | + [id]="_getStepLabelId($index)" |
| 23 | + [attr.aria-posinset]="$index + 1" |
| 24 | + [attr.aria-setsize]="steps.length" |
| 25 | + [attr.aria-controls]="_getStepContentId($index)" |
| 26 | + [attr.aria-owns]="_getStepContentId($index)" |
| 27 | + [attr.aria-selected]="selectedIndex == $index" |
| 28 | + [attr.aria-label]="step.ariaLabel || null" |
| 29 | + [attr.aria-labelledby]="(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null" |
| 30 | + [attr.aria-disabled]="_stepIsNavigable($index, step) ? null : true" |
| 31 | + [index]="$index" |
| 32 | + [state]="_getIndicatorType($index, step.state)" |
| 33 | + [label]="step.stepLabel || step.label" |
| 34 | + [selected]="selectedIndex === $index" |
| 35 | + [active]="_stepIsNavigable($index, step)" |
| 36 | + [optional]="step.optional" |
| 37 | + [errorMessage]="step.errorMessage" |
| 38 | + [iconOverrides]="_iconOverrides" |
| 39 | + [disableRipple]="disableRipple || !_stepIsNavigable($index, step)" |
| 40 | + [color]="step.color || color"/> |
19 | 41 | @if (!$last) { |
20 | 42 | <div class="mat-stepper-horizontal-line"></div> |
21 | 43 | } |
|
43 | 65 | <div class="mat-vertical-stepper-wrapper" role="group"> |
44 | 66 | @for (step of steps; track step) { |
45 | 67 | <div class="mat-step" role="group"> |
46 | | - <ng-container |
47 | | - [ngTemplateOutlet]="stepTemplate" |
48 | | - [ngTemplateOutletContext]="{step, i: $index}"/> |
| 68 | + <mat-step-header |
| 69 | + class="mat-vertical-stepper-header" |
| 70 | + role="button" |
| 71 | + (click)="step.select()" |
| 72 | + (keydown)="_onKeydown($event)" |
| 73 | + [tabIndex]="_getFocusIndex() === $index ? 0 : -1" |
| 74 | + [id]="_getStepLabelId($index)" |
| 75 | + [attr.aria-current]="selectedIndex == $index" |
| 76 | + [attr.aria-label]="step.ariaLabel || null" |
| 77 | + [attr.aria-labelledby]="(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null" |
| 78 | + [attr.aria-disabled]="_stepIsNavigable($index, step) ? null : true" |
| 79 | + [attr.aria-owns]="_getStepContentId($index)" |
| 80 | + [index]="$index" |
| 81 | + [state]="_getIndicatorType($index, step.state)" |
| 82 | + [label]="step.stepLabel || step.label" |
| 83 | + [selected]="selectedIndex === $index" |
| 84 | + [active]="_stepIsNavigable($index, step)" |
| 85 | + [optional]="step.optional" |
| 86 | + [errorMessage]="step.errorMessage" |
| 87 | + [iconOverrides]="_iconOverrides" |
| 88 | + [disableRipple]="disableRipple || !_stepIsNavigable($index, step)" |
| 89 | + [color]="step.color || color"/> |
49 | 90 | <div |
50 | 91 | #animatedContainer |
51 | 92 | class="mat-vertical-content-container" |
|
66 | 107 | </div> |
67 | 108 | } |
68 | 109 | } |
69 | | - |
70 | | -<!-- Common step templating --> |
71 | | -<ng-template let-step="step" let-i="i" #stepTemplate> |
72 | | - <mat-step-header |
73 | | - [class.mat-horizontal-stepper-header]="orientation === 'horizontal'" |
74 | | - [class.mat-vertical-stepper-header]="orientation === 'vertical'" |
75 | | - [attr.role]="orientation === 'horizontal' ? 'tab' : 'button'" |
76 | | - (click)="step.select()" |
77 | | - (keydown)="_onKeydown($event)" |
78 | | - [tabIndex]="_getFocusIndex() === i ? 0 : -1" |
79 | | - [id]="_getStepLabelId(i)" |
80 | | - [attr.aria-posinset]="orientation === 'horizontal' ? i + 1 : undefined" |
81 | | - [attr.aria-setsize]="orientation === 'horizontal' ? steps.length : undefined" |
82 | | - [attr.aria-controls]="orientation === 'horizontal' ? _getStepContentId(i) : undefined" |
83 | | - [attr.aria-selected]="orientation === 'horizontal' ? selectedIndex == i : undefined" |
84 | | - [attr.aria-current]="orientation === 'vertical' ? selectedIndex == i : undefined" |
85 | | - [attr.aria-label]="step.ariaLabel || `Step ${i+1}`" |
86 | | - [attr.aria-labelledby]="(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null" |
87 | | - [attr.aria-disabled]="_stepIsNavigable(i, step) ? null : true" |
88 | | - [index]="i" |
89 | | - [state]="_getIndicatorType(i, step.state)" |
90 | | - [label]="step.stepLabel || step.label" |
91 | | - [selected]="selectedIndex === i" |
92 | | - [active]="_stepIsNavigable(i, step)" |
93 | | - [optional]="step.optional" |
94 | | - [errorMessage]="step.errorMessage" |
95 | | - [iconOverrides]="_iconOverrides" |
96 | | - [disableRipple]="disableRipple || !_stepIsNavigable(i, step)" |
97 | | - [color]="step.color || color"/> |
98 | | -</ng-template> |
|
0 commit comments