@@ -7,8 +7,8 @@ that drives a stepped workflow. Material stepper extends the CDK stepper and has
7
7
styling.
8
8
9
9
### Stepper variants
10
- There are two stepper components: ` md-horizontal-stepper ` and ` md-vertical-stepper ` . They
11
- can be used the same way. The only difference is the orientation of stepper.
10
+ There are two stepper components: ` md-horizontal-stepper ` and ` md-vertical-stepper ` . They
11
+ can be used the same way. The only difference is the orientation of stepper.
12
12
` md-horizontal-stepper ` selector can be used to create a horizontal stepper, and
13
13
` md-vertical-stepper ` can be used to create a vertical stepper. ` md-step ` components need to be
14
14
placed inside either one of the two stepper components.
@@ -26,7 +26,7 @@ If a step's label is only text, then the `label` attribute can be used.
26
26
</md-vertical-stepper >
27
27
```
28
28
29
- For more complex labels, add a template with the ` mdStepLabel ` directive inside the
29
+ For more complex labels, add a template with the ` mdStepLabel ` directive inside the
30
30
` md-step ` .
31
31
``` html
32
32
<md-vertical-stepper >
@@ -49,22 +49,22 @@ There are two button directives to support navigation between different steps:
49
49
<button md-button mdStepperNext >Next</button >
50
50
</div >
51
51
</md-step >
52
- </md-horizontal-stepper >
52
+ </md-horizontal-stepper >
53
53
```
54
54
55
55
### Linear stepper
56
56
The ` linear ` attribute can be set on ` md-horizontal-stepper ` and ` md-vertical-stepper ` to create
57
57
a linear stepper that requires the user to complete previous steps before proceeding
58
58
to following steps. For each ` md-step ` , the ` stepControl ` attribute can be set to the top level
59
- ` AbstractControl ` that is used to check the validity of the step.
59
+ ` AbstractControl ` that is used to check the validity of the step.
60
60
61
61
There are two possible approaches. One is using a single form for stepper, and the other is
62
62
using a different form for each step.
63
63
64
64
#### Using a single form
65
65
When using a single form for the stepper, ` mdStepperPrevious ` and ` mdStepperNext ` have to be
66
66
set to ` type="button" ` in order to prevent submission of the form before all steps
67
- are completed.
67
+ are completed.
68
68
69
69
``` html
70
70
<form [formGroup] =" formGroup" >
@@ -83,7 +83,7 @@ are completed.
83
83
</div >
84
84
</md-step >
85
85
...
86
- </md-horizontal-stepper >
86
+ </md-horizontal-stepper >
87
87
</form >
88
88
```
89
89
@@ -106,11 +106,11 @@ are completed.
106
106
107
107
#### Optional step
108
108
If completion of a step in linear stepper is not required, then the ` optional ` attribute can be set
109
- on ` md-step ` .
109
+ on ` md-step ` .
110
110
111
111
#### Editable step
112
112
By default, steps are editable, which means users can return to previously completed steps and
113
- edit their responses. ` editable="true" ` can be set on ` md-step ` to change the default.
113
+ edit their responses. ` editable="true" ` can be set on ` md-step ` to change the default.
114
114
115
115
#### Completed step
116
116
By default, the ` completed ` attribute of a step returns ` true ` if the step is valid (in case of
@@ -124,11 +124,26 @@ this default `completed` behavior by setting the `completed` attribute as needed
124
124
- <kbd >TAB</kbd >: Focuses the next tabbable element
125
125
- <kbd >TAB</kbd >+<kbd >SHIFT</kbd >: Focuses the previous tabbable element
126
126
127
+ ### Localizing labels
128
+ The various text strings used by the stepper are provided through ` MdStepperIntl ` .
129
+ Localization of these messages can be done by providing a subclass with translated values in your
130
+ application root module.
131
+
132
+ ``` ts
133
+ @NgModule ({
134
+ imports: [MdStepperModule ],
135
+ providers: [
136
+ {provide: MdStepperIntl , useClass: MyIntl },
137
+ ],
138
+ })
139
+ export class MyApp {}
140
+ ```
141
+
127
142
### Accessibility
128
143
The stepper is treated as a tabbed view for accessibility purposes, so it is given
129
144
` role="tablist" ` by default. The header of step that can be clicked to select the step
130
145
is given ` role="tab" ` , and the content that can be expanded upon selection is given
131
146
` role="tabpanel" ` . ` aria-selected ` attribute of step header and ` aria-expanded ` attribute of
132
147
step content is automatically set based on step selection change.
133
148
134
- The stepper and each step should be given a meaningful label via ` aria-label ` or ` aria-labelledby ` .
149
+ The stepper and each step should be given a meaningful label via ` aria-label ` or ` aria-labelledby ` .
0 commit comments