|
10 | 10 |
|
11 | 11 | @switch (orientation) {
|
12 | 12 | @case ('horizontal') {
|
13 |
| - <div class="mat-horizontal-stepper-wrapper"> |
| 13 | + <div class="mat-horizontal-stepper-wrapper" role="group"> |
14 | 14 | <div class="mat-horizontal-stepper-header-container">
|
15 | 15 | @for (step of steps; track step) {
|
16 | 16 | <ng-container
|
|
27 | 27 | <div
|
28 | 28 | #animatedContainer
|
29 | 29 | class="mat-horizontal-stepper-content"
|
30 |
| - role="tabpanel" |
| 30 | + role="region" |
31 | 31 | [id]="_getStepContentId($index)"
|
32 | 32 | [attr.aria-labelledby]="_getStepLabelId($index)"
|
33 | 33 | [class]="'mat-horizontal-stepper-content-' + _getAnimationDirection($index)"
|
|
40 | 40 | }
|
41 | 41 |
|
42 | 42 | @case ('vertical') {
|
43 |
| - @for (step of steps; track step) { |
44 |
| - <div class="mat-step"> |
45 |
| - <ng-container |
46 |
| - [ngTemplateOutlet]="stepTemplate" |
47 |
| - [ngTemplateOutletContext]="{step}"/> |
48 |
| - <div |
49 |
| - #animatedContainer |
50 |
| - class="mat-vertical-content-container" |
51 |
| - [class.mat-stepper-vertical-line]="!$last" |
52 |
| - [class.mat-vertical-content-container-active]="selectedIndex === $index" |
53 |
| - [attr.inert]="selectedIndex === $index ? null : ''"> |
54 |
| - <div class="mat-vertical-stepper-content" |
55 |
| - role="tabpanel" |
56 |
| - [id]="_getStepContentId($index)" |
57 |
| - [attr.aria-labelledby]="_getStepLabelId($index)"> |
58 |
| - <div class="mat-vertical-content"> |
59 |
| - <ng-container [ngTemplateOutlet]="step.content"/> |
| 43 | + <div class="mat-vertical-stepper-wrapper" role="group"> |
| 44 | + @for (step of steps; track step) { |
| 45 | + <div class="mat-step"> |
| 46 | + <ng-container |
| 47 | + [ngTemplateOutlet]="stepTemplate" |
| 48 | + [ngTemplateOutletContext]="{step}"/> |
| 49 | + <div |
| 50 | + #animatedContainer |
| 51 | + class="mat-vertical-content-container" |
| 52 | + [class.mat-stepper-vertical-line]="!$last" |
| 53 | + [class.mat-vertical-content-container-active]="selectedIndex === $index" |
| 54 | + [attr.inert]="selectedIndex === $index ? null : ''"> |
| 55 | + <div class="mat-vertical-stepper-content" |
| 56 | + role="region" |
| 57 | + [id]="_getStepContentId($index)" |
| 58 | + [attr.aria-labelledby]="_getStepLabelId($index)"> |
| 59 | + <div class="mat-vertical-content"> |
| 60 | + <ng-container [ngTemplateOutlet]="step.content"/> |
| 61 | + </div> |
60 | 62 | </div>
|
61 | 63 | </div>
|
62 | 64 | </div>
|
63 |
| - </div> |
64 |
| - } |
| 65 | + } |
| 66 | + </div> |
65 | 67 | }
|
66 | 68 | }
|
67 | 69 |
|
|
74 | 76 | (keydown)="_onKeydown($event)"
|
75 | 77 | [tabIndex]="_getFocusIndex() === step.index() ? 0 : -1"
|
76 | 78 | [id]="_getStepLabelId(step.index())"
|
77 |
| - [attr.aria-posinset]="step.index() + 1" |
78 |
| - [attr.aria-setsize]="steps.length" |
79 | 79 | [attr.aria-controls]="_getStepContentId(step.index())"
|
80 |
| - [attr.aria-selected]="step.isSelected()" |
| 80 | + [attr.aria-expanded]="orientation === 'vertical' ? step.isSelected() : undefined" |
| 81 | + [attr.aria-current]="step.isSelected() ? 'step' : undefined" |
| 82 | + [attr.aria-pressed]="step.isSelected()" |
81 | 83 | [attr.aria-label]="step.ariaLabel || null"
|
82 | 84 | [attr.aria-labelledby]="(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null"
|
83 | 85 | [attr.aria-disabled]="step.isNavigable() ? null : true"
|
| 86 | + [attr.aria-owns]="_getStepContentId(step.index())" |
| 87 | + [attr.mat-step-index]="step.index()" |
84 | 88 | [index]="step.index()"
|
85 | 89 | [state]="step.indicatorType()"
|
86 | 90 | [label]="step.stepLabel || step.label"
|
|
0 commit comments