|
11 | 11 | @switch (orientation) { |
12 | 12 | @case ('horizontal') { |
13 | 13 | <div class="mat-horizontal-stepper-wrapper"> |
14 | | - <div class="mat-horizontal-stepper-header-container"> |
| 14 | + <div class="mat-horizontal-stepper-header-container" role="tablist" aria-orientation="horizontal"> |
15 | 15 | @for (step of steps; track step) { |
16 | 16 | <ng-container |
17 | 17 | [ngTemplateOutlet]="stepTemplate" |
|
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="tablist" aria-orientation="vertical"> |
| 44 | + @for (step of steps; track step) { |
| 45 | + <div |
| 46 | + class="mat-step" |
| 47 | + role="tab" |
| 48 | + [attr.aria-posinset]="step.index() + 1" |
| 49 | + [attr.aria-setsize]="steps.length" |
| 50 | + [attr.aria-selected]="step.isSelected()" |
| 51 | + > |
| 52 | + <ng-container |
| 53 | + [ngTemplateOutlet]="stepTemplate" |
| 54 | + [ngTemplateOutletContext]="{step}"/> |
| 55 | + <div |
| 56 | + #animatedContainer |
| 57 | + class="mat-vertical-content-container" |
| 58 | + [class.mat-stepper-vertical-line]="!$last" |
| 59 | + [class.mat-vertical-content-container-active]="selectedIndex === $index" |
| 60 | + [attr.inert]="selectedIndex === $index ? null : ''"> |
| 61 | + <div class="mat-vertical-stepper-content" |
| 62 | + [id]="_getStepContentId($index)" |
| 63 | + [attr.aria-labelledby]="_getStepLabelId($index)"> |
| 64 | + <div class="mat-vertical-content"> |
| 65 | + <ng-container [ngTemplateOutlet]="step.content"/> |
| 66 | + </div> |
60 | 67 | </div> |
61 | 68 | </div> |
62 | 69 | </div> |
63 | | - </div> |
64 | | - } |
| 70 | + } |
| 71 | + </div> |
65 | 72 | } |
66 | 73 | } |
67 | 74 |
|
|
74 | 81 | (keydown)="_onKeydown($event)" |
75 | 82 | [tabIndex]="_getFocusIndex() === step.index() ? 0 : -1" |
76 | 83 | [id]="_getStepLabelId(step.index())" |
77 | | - [attr.aria-posinset]="step.index() + 1" |
78 | | - [attr.aria-setsize]="steps.length" |
| 84 | + [attr.role]="orientation === 'horizontal' ? 'tab' : null" |
| 85 | + [attr.aria-posinset]="orientation === 'horizontal' ? step.index() + 1 : null" |
| 86 | + [attr.aria-setsize]="orientation === 'horizontal' ? steps.length : null" |
| 87 | + [attr.aria-selected]="orientation === 'horizontal' ? step.isSelected() : null" |
79 | 88 | [attr.aria-controls]="_getStepContentId(step.index())" |
80 | | - [attr.aria-selected]="step.isSelected()" |
81 | 89 | [attr.aria-label]="step.ariaLabel || null" |
82 | 90 | [attr.aria-labelledby]="(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null" |
83 | 91 | [attr.aria-disabled]="step.isNavigable() ? null : true" |
|
0 commit comments