@angular/cdk 21.0.0-next.9 → 21.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_adev_assets/cdk_drag_drop.json +13 -12
- package/_adev_assets/cdk_testing.json +9 -9
- package/_adev_assets/cdk_testing_protractor.json +1 -1
- package/_adev_assets/cdk_testing_selenium_webdriver.json +1 -1
- package/_adev_assets/cdk_testing_testbed.json +1 -1
- package/fesm2022/_a11y-module-chunk.mjs +755 -869
- package/fesm2022/_a11y-module-chunk.mjs.map +1 -1
- package/fesm2022/_activedescendant-key-manager-chunk.mjs +8 -8
- package/fesm2022/_activedescendant-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_array-chunk.mjs +1 -1
- package/fesm2022/_array-chunk.mjs.map +1 -1
- package/fesm2022/_breakpoints-observer-chunk.mjs +149 -152
- package/fesm2022/_breakpoints-observer-chunk.mjs.map +1 -1
- package/fesm2022/_css-pixel-value-chunk.mjs +4 -5
- package/fesm2022/_css-pixel-value-chunk.mjs.map +1 -1
- package/fesm2022/_data-source-chunk.mjs +2 -8
- package/fesm2022/_data-source-chunk.mjs.map +1 -1
- package/fesm2022/_directionality-chunk.mjs +54 -54
- package/fesm2022/_directionality-chunk.mjs.map +1 -1
- package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs +25 -36
- package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs.map +1 -1
- package/fesm2022/_element-chunk.mjs +6 -17
- package/fesm2022/_element-chunk.mjs.map +1 -1
- package/fesm2022/_fake-event-detection-chunk.mjs +3 -17
- package/fesm2022/_fake-event-detection-chunk.mjs.map +1 -1
- package/fesm2022/_focus-key-manager-chunk.mjs +10 -14
- package/fesm2022/_focus-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_focus-monitor-chunk.mjs +376 -566
- package/fesm2022/_focus-monitor-chunk.mjs.map +1 -1
- package/fesm2022/_id-generator-chunk.mjs +36 -27
- package/fesm2022/_id-generator-chunk.mjs.map +1 -1
- package/fesm2022/_keycodes-chunk.mjs +9 -9
- package/fesm2022/_keycodes-chunk.mjs.map +1 -1
- package/fesm2022/_list-key-manager-chunk.mjs +248 -336
- package/fesm2022/_list-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_overlay-module-chunk.mjs +2534 -2948
- package/fesm2022/_overlay-module-chunk.mjs.map +1 -1
- package/fesm2022/_passive-listeners-chunk.mjs +10 -22
- package/fesm2022/_passive-listeners-chunk.mjs.map +1 -1
- package/fesm2022/_platform-chunk.mjs +42 -65
- package/fesm2022/_platform-chunk.mjs.map +1 -1
- package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs +78 -134
- package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs.map +1 -1
- package/fesm2022/_scrolling-chunk.mjs +44 -85
- package/fesm2022/_scrolling-chunk.mjs.map +1 -1
- package/fesm2022/_selection-model-chunk.mjs +138 -209
- package/fesm2022/_selection-model-chunk.mjs.map +1 -1
- package/fesm2022/_shadow-dom-chunk.mjs +21 -35
- package/fesm2022/_shadow-dom-chunk.mjs.map +1 -1
- package/fesm2022/_style-loader-chunk.mjs +50 -37
- package/fesm2022/_style-loader-chunk.mjs.map +1 -1
- package/fesm2022/_test-environment-chunk.mjs +2 -14
- package/fesm2022/_test-environment-chunk.mjs.map +1 -1
- package/fesm2022/_tree-key-manager-chunk.mjs +229 -308
- package/fesm2022/_tree-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_typeahead-chunk.mjs +52 -74
- package/fesm2022/_typeahead-chunk.mjs.map +1 -1
- package/fesm2022/_unique-selection-dispatcher-chunk.mjs +43 -40
- package/fesm2022/_unique-selection-dispatcher-chunk.mjs.map +1 -1
- package/fesm2022/a11y.mjs +351 -449
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs +254 -192
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/bidi.mjs +121 -64
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -2
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +208 -186
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/coercion-private.mjs +4 -8
- package/fesm2022/coercion-private.mjs.map +1 -1
- package/fesm2022/coercion.mjs +11 -29
- package/fesm2022/coercion.mjs.map +1 -1
- package/fesm2022/dialog.mjs +660 -808
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +3347 -4286
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/keycodes.mjs +4 -8
- package/fesm2022/keycodes.mjs.map +1 -1
- package/fesm2022/layout.mjs +44 -26
- package/fesm2022/layout.mjs.map +1 -1
- package/fesm2022/listbox.mjs +841 -895
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +1942 -1858
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/observers-private.mjs +88 -106
- package/fesm2022/observers-private.mjs.map +1 -1
- package/fesm2022/observers.mjs +262 -184
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/overlay.mjs +72 -68
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/platform.mjs +43 -54
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/portal.mjs +402 -560
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/private.mjs +38 -10
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +1323 -1400
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/stepper.mjs +758 -590
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +2327 -2319
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/testing-selenium-webdriver.mjs +252 -325
- package/fesm2022/testing-selenium-webdriver.mjs.map +1 -1
- package/fesm2022/testing-testbed.mjs +592 -709
- package/fesm2022/testing-testbed.mjs.map +1 -1
- package/fesm2022/testing.mjs +368 -889
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/text-field.mjs +459 -388
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/tree.mjs +1483 -1731
- package/fesm2022/tree.mjs.map +1 -1
- package/overlay/_index.scss +28 -0
- package/overlay-prebuilt.css +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/types/_overlay-module-chunk.d.ts +59 -7
- package/types/_portal-directives-chunk.d.ts +2 -18
- package/types/accordion.d.ts +3 -1
- package/types/dialog.d.ts +1 -1
- package/types/overlay.d.ts +6 -2
- package/types/portal.d.ts +1 -1
package/fesm2022/stepper.mjs
CHANGED
|
@@ -14,619 +14,787 @@ import './_list-key-manager-chunk.mjs';
|
|
|
14
14
|
import './_typeahead-chunk.mjs';
|
|
15
15
|
|
|
16
16
|
class CdkStepHeader {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
focus()
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
_elementRef = inject(ElementRef);
|
|
18
|
+
constructor() {}
|
|
19
|
+
focus() {
|
|
20
|
+
this._elementRef.nativeElement.focus();
|
|
21
|
+
}
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
23
|
+
minVersion: "12.0.0",
|
|
24
|
+
version: "20.2.0-next.2",
|
|
25
|
+
ngImport: i0,
|
|
26
|
+
type: CdkStepHeader,
|
|
27
|
+
deps: [],
|
|
28
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
29
|
+
});
|
|
30
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
31
|
+
minVersion: "14.0.0",
|
|
32
|
+
version: "20.2.0-next.2",
|
|
33
|
+
type: CdkStepHeader,
|
|
34
|
+
isStandalone: true,
|
|
35
|
+
selector: "[cdkStepHeader]",
|
|
36
|
+
host: {
|
|
37
|
+
attributes: {
|
|
38
|
+
"role": "tab"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
ngImport: i0
|
|
42
|
+
});
|
|
25
43
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
45
|
+
minVersion: "12.0.0",
|
|
46
|
+
version: "20.2.0-next.2",
|
|
47
|
+
ngImport: i0,
|
|
48
|
+
type: CdkStepHeader,
|
|
49
|
+
decorators: [{
|
|
50
|
+
type: Directive,
|
|
51
|
+
args: [{
|
|
52
|
+
selector: '[cdkStepHeader]',
|
|
53
|
+
host: {
|
|
54
|
+
'role': 'tab'
|
|
55
|
+
}
|
|
56
|
+
}]
|
|
57
|
+
}],
|
|
58
|
+
ctorParameters: () => []
|
|
59
|
+
});
|
|
35
60
|
|
|
36
61
|
class CdkStepLabel {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
62
|
+
template = inject(TemplateRef);
|
|
63
|
+
constructor() {}
|
|
64
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
65
|
+
minVersion: "12.0.0",
|
|
66
|
+
version: "20.2.0-next.2",
|
|
67
|
+
ngImport: i0,
|
|
68
|
+
type: CdkStepLabel,
|
|
69
|
+
deps: [],
|
|
70
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
71
|
+
});
|
|
72
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
73
|
+
minVersion: "14.0.0",
|
|
74
|
+
version: "20.2.0-next.2",
|
|
75
|
+
type: CdkStepLabel,
|
|
76
|
+
isStandalone: true,
|
|
77
|
+
selector: "[cdkStepLabel]",
|
|
78
|
+
ngImport: i0
|
|
79
|
+
});
|
|
41
80
|
}
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
82
|
+
minVersion: "12.0.0",
|
|
83
|
+
version: "20.2.0-next.2",
|
|
84
|
+
ngImport: i0,
|
|
85
|
+
type: CdkStepLabel,
|
|
86
|
+
decorators: [{
|
|
87
|
+
type: Directive,
|
|
88
|
+
args: [{
|
|
89
|
+
selector: '[cdkStepLabel]'
|
|
90
|
+
}]
|
|
91
|
+
}],
|
|
92
|
+
ctorParameters: () => []
|
|
93
|
+
});
|
|
48
94
|
|
|
49
|
-
/** Change event emitted on selection changes. */
|
|
50
95
|
class StepperSelectionEvent {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
/** The step instance now selected. */
|
|
56
|
-
selectedStep;
|
|
57
|
-
/** The step instance previously selected. */
|
|
58
|
-
previouslySelectedStep;
|
|
96
|
+
selectedIndex;
|
|
97
|
+
previouslySelectedIndex;
|
|
98
|
+
selectedStep;
|
|
99
|
+
previouslySelectedStep;
|
|
59
100
|
}
|
|
60
|
-
/** Enum to represent the different states of the steps. */
|
|
61
101
|
const STEP_STATE = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
102
|
+
NUMBER: 'number',
|
|
103
|
+
EDIT: 'edit',
|
|
104
|
+
DONE: 'done',
|
|
105
|
+
ERROR: 'error'
|
|
66
106
|
};
|
|
67
|
-
/** InjectionToken that can be used to specify the global stepper options. */
|
|
68
107
|
const STEPPER_GLOBAL_OPTIONS = new InjectionToken('STEPPER_GLOBAL_OPTIONS');
|
|
69
108
|
class CdkStep {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
109
|
+
_stepperOptions;
|
|
110
|
+
_stepper = inject(CdkStepper);
|
|
111
|
+
_displayDefaultIndicatorType;
|
|
112
|
+
stepLabel;
|
|
113
|
+
_childForms;
|
|
114
|
+
content;
|
|
115
|
+
stepControl;
|
|
116
|
+
get interacted() {
|
|
117
|
+
return this._interacted();
|
|
118
|
+
}
|
|
119
|
+
set interacted(value) {
|
|
120
|
+
this._interacted.set(value);
|
|
121
|
+
}
|
|
122
|
+
_interacted = signal(false, ...(ngDevMode ? [{
|
|
123
|
+
debugName: "_interacted"
|
|
124
|
+
}] : []));
|
|
125
|
+
interactedStream = new EventEmitter();
|
|
126
|
+
label;
|
|
127
|
+
errorMessage;
|
|
128
|
+
ariaLabel;
|
|
129
|
+
ariaLabelledby;
|
|
130
|
+
get state() {
|
|
131
|
+
return this._state();
|
|
132
|
+
}
|
|
133
|
+
set state(value) {
|
|
134
|
+
this._state.set(value);
|
|
135
|
+
}
|
|
136
|
+
_state = signal(undefined, ...(ngDevMode ? [{
|
|
137
|
+
debugName: "_state"
|
|
138
|
+
}] : []));
|
|
139
|
+
get editable() {
|
|
140
|
+
return this._editable();
|
|
141
|
+
}
|
|
142
|
+
set editable(value) {
|
|
143
|
+
this._editable.set(value);
|
|
144
|
+
}
|
|
145
|
+
_editable = signal(true, ...(ngDevMode ? [{
|
|
146
|
+
debugName: "_editable"
|
|
147
|
+
}] : []));
|
|
148
|
+
optional = false;
|
|
149
|
+
get completed() {
|
|
150
|
+
const override = this._completedOverride();
|
|
151
|
+
const interacted = this._interacted();
|
|
152
|
+
if (override != null) {
|
|
153
|
+
return override;
|
|
154
|
+
}
|
|
155
|
+
return interacted && (!this.stepControl || this.stepControl.valid);
|
|
156
|
+
}
|
|
157
|
+
set completed(value) {
|
|
158
|
+
this._completedOverride.set(value);
|
|
159
|
+
}
|
|
160
|
+
_completedOverride = signal(null, ...(ngDevMode ? [{
|
|
161
|
+
debugName: "_completedOverride"
|
|
162
|
+
}] : []));
|
|
163
|
+
index = signal(-1, ...(ngDevMode ? [{
|
|
164
|
+
debugName: "index"
|
|
165
|
+
}] : []));
|
|
166
|
+
isSelected = computed(() => this._stepper.selectedIndex === this.index(), ...(ngDevMode ? [{
|
|
167
|
+
debugName: "isSelected"
|
|
168
|
+
}] : []));
|
|
169
|
+
indicatorType = computed(() => {
|
|
170
|
+
const selected = this.isSelected();
|
|
171
|
+
const completed = this.completed;
|
|
172
|
+
const defaultState = this._state() ?? STEP_STATE.NUMBER;
|
|
173
|
+
const editable = this._editable();
|
|
174
|
+
if (this._showError() && this.hasError && !selected) {
|
|
175
|
+
return STEP_STATE.ERROR;
|
|
176
|
+
}
|
|
177
|
+
if (this._displayDefaultIndicatorType) {
|
|
178
|
+
if (!completed || selected) {
|
|
179
|
+
return STEP_STATE.NUMBER;
|
|
180
|
+
}
|
|
181
|
+
return editable ? STEP_STATE.EDIT : STEP_STATE.DONE;
|
|
182
|
+
} else {
|
|
183
|
+
if (completed && !selected) {
|
|
184
|
+
return STEP_STATE.DONE;
|
|
185
|
+
} else if (completed && selected) {
|
|
186
|
+
return defaultState;
|
|
187
|
+
}
|
|
188
|
+
return editable && selected ? STEP_STATE.EDIT : defaultState;
|
|
189
|
+
}
|
|
190
|
+
}, ...(ngDevMode ? [{
|
|
191
|
+
debugName: "indicatorType"
|
|
192
|
+
}] : []));
|
|
193
|
+
isNavigable = computed(() => {
|
|
194
|
+
const isSelected = this.isSelected();
|
|
195
|
+
const isCompleted = this.completed;
|
|
196
|
+
return isCompleted || isSelected || !this._stepper.linear;
|
|
197
|
+
}, ...(ngDevMode ? [{
|
|
198
|
+
debugName: "isNavigable"
|
|
199
|
+
}] : []));
|
|
200
|
+
get hasError() {
|
|
201
|
+
const customError = this._customError();
|
|
202
|
+
return customError == null ? this._getDefaultError() : customError;
|
|
203
|
+
}
|
|
204
|
+
set hasError(value) {
|
|
205
|
+
this._customError.set(value);
|
|
206
|
+
}
|
|
207
|
+
_customError = signal(null, ...(ngDevMode ? [{
|
|
208
|
+
debugName: "_customError"
|
|
209
|
+
}] : []));
|
|
210
|
+
_getDefaultError() {
|
|
211
|
+
return this.interacted && !!this.stepControl?.invalid;
|
|
212
|
+
}
|
|
213
|
+
constructor() {
|
|
214
|
+
const stepperOptions = inject(STEPPER_GLOBAL_OPTIONS, {
|
|
215
|
+
optional: true
|
|
216
|
+
});
|
|
217
|
+
this._stepperOptions = stepperOptions ? stepperOptions : {};
|
|
218
|
+
this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false;
|
|
219
|
+
}
|
|
220
|
+
select() {
|
|
221
|
+
this._stepper.selected = this;
|
|
222
|
+
}
|
|
223
|
+
reset() {
|
|
224
|
+
this._interacted.set(false);
|
|
225
|
+
if (this._completedOverride() != null) {
|
|
226
|
+
this._completedOverride.set(false);
|
|
227
|
+
}
|
|
228
|
+
if (this._customError() != null) {
|
|
229
|
+
this._customError.set(false);
|
|
230
|
+
}
|
|
231
|
+
if (this.stepControl) {
|
|
232
|
+
this._childForms?.forEach(form => form.resetForm?.());
|
|
233
|
+
this.stepControl.reset();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
ngOnChanges() {
|
|
237
|
+
this._stepper._stateChanged();
|
|
238
|
+
}
|
|
239
|
+
_markAsInteracted() {
|
|
240
|
+
if (!this._interacted()) {
|
|
241
|
+
this._interacted.set(true);
|
|
242
|
+
this.interactedStream.emit(this);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
_showError() {
|
|
246
|
+
return this._stepperOptions.showError ?? this._customError() != null;
|
|
247
|
+
}
|
|
248
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
249
|
+
minVersion: "12.0.0",
|
|
250
|
+
version: "20.2.0-next.2",
|
|
251
|
+
ngImport: i0,
|
|
252
|
+
type: CdkStep,
|
|
253
|
+
deps: [],
|
|
254
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
255
|
+
});
|
|
256
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
257
|
+
minVersion: "16.1.0",
|
|
258
|
+
version: "20.2.0-next.2",
|
|
259
|
+
type: CdkStep,
|
|
260
|
+
isStandalone: true,
|
|
261
|
+
selector: "cdk-step",
|
|
262
|
+
inputs: {
|
|
263
|
+
stepControl: "stepControl",
|
|
264
|
+
label: "label",
|
|
265
|
+
errorMessage: "errorMessage",
|
|
266
|
+
ariaLabel: ["aria-label", "ariaLabel"],
|
|
267
|
+
ariaLabelledby: ["aria-labelledby", "ariaLabelledby"],
|
|
268
|
+
state: "state",
|
|
269
|
+
editable: ["editable", "editable", booleanAttribute],
|
|
270
|
+
optional: ["optional", "optional", booleanAttribute],
|
|
271
|
+
completed: ["completed", "completed", booleanAttribute],
|
|
272
|
+
hasError: ["hasError", "hasError", booleanAttribute]
|
|
273
|
+
},
|
|
274
|
+
outputs: {
|
|
275
|
+
interactedStream: "interacted"
|
|
276
|
+
},
|
|
277
|
+
queries: [{
|
|
278
|
+
propertyName: "stepLabel",
|
|
279
|
+
first: true,
|
|
280
|
+
predicate: CdkStepLabel,
|
|
281
|
+
descendants: true
|
|
282
|
+
}, {
|
|
283
|
+
propertyName: "_childForms",
|
|
284
|
+
predicate: ControlContainer,
|
|
285
|
+
descendants: true
|
|
286
|
+
}],
|
|
287
|
+
viewQueries: [{
|
|
288
|
+
propertyName: "content",
|
|
289
|
+
first: true,
|
|
290
|
+
predicate: TemplateRef,
|
|
291
|
+
descendants: true,
|
|
292
|
+
static: true
|
|
293
|
+
}],
|
|
294
|
+
exportAs: ["cdkStep"],
|
|
295
|
+
usesOnChanges: true,
|
|
296
|
+
ngImport: i0,
|
|
297
|
+
template: '<ng-template><ng-content/></ng-template>',
|
|
298
|
+
isInline: true,
|
|
299
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
300
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
301
|
+
});
|
|
230
302
|
}
|
|
231
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
303
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
304
|
+
minVersion: "12.0.0",
|
|
305
|
+
version: "20.2.0-next.2",
|
|
306
|
+
ngImport: i0,
|
|
307
|
+
type: CdkStep,
|
|
308
|
+
decorators: [{
|
|
309
|
+
type: Component,
|
|
310
|
+
args: [{
|
|
311
|
+
selector: 'cdk-step',
|
|
312
|
+
exportAs: 'cdkStep',
|
|
313
|
+
template: '<ng-template><ng-content/></ng-template>',
|
|
314
|
+
encapsulation: ViewEncapsulation.None,
|
|
315
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
316
|
+
}]
|
|
317
|
+
}],
|
|
318
|
+
ctorParameters: () => [],
|
|
319
|
+
propDecorators: {
|
|
320
|
+
stepLabel: [{
|
|
321
|
+
type: ContentChild,
|
|
322
|
+
args: [CdkStepLabel]
|
|
323
|
+
}],
|
|
324
|
+
_childForms: [{
|
|
325
|
+
type: ContentChildren,
|
|
326
|
+
args: [ControlContainer, {
|
|
327
|
+
descendants: true
|
|
328
|
+
}]
|
|
329
|
+
}],
|
|
330
|
+
content: [{
|
|
331
|
+
type: ViewChild,
|
|
332
|
+
args: [TemplateRef, {
|
|
333
|
+
static: true
|
|
334
|
+
}]
|
|
335
|
+
}],
|
|
336
|
+
stepControl: [{
|
|
337
|
+
type: Input
|
|
338
|
+
}],
|
|
339
|
+
interactedStream: [{
|
|
340
|
+
type: Output,
|
|
341
|
+
args: ['interacted']
|
|
342
|
+
}],
|
|
343
|
+
label: [{
|
|
344
|
+
type: Input
|
|
345
|
+
}],
|
|
346
|
+
errorMessage: [{
|
|
347
|
+
type: Input
|
|
348
|
+
}],
|
|
349
|
+
ariaLabel: [{
|
|
350
|
+
type: Input,
|
|
351
|
+
args: ['aria-label']
|
|
352
|
+
}],
|
|
353
|
+
ariaLabelledby: [{
|
|
354
|
+
type: Input,
|
|
355
|
+
args: ['aria-labelledby']
|
|
356
|
+
}],
|
|
357
|
+
state: [{
|
|
358
|
+
type: Input
|
|
359
|
+
}],
|
|
360
|
+
editable: [{
|
|
361
|
+
type: Input,
|
|
362
|
+
args: [{
|
|
363
|
+
transform: booleanAttribute
|
|
364
|
+
}]
|
|
365
|
+
}],
|
|
366
|
+
optional: [{
|
|
367
|
+
type: Input,
|
|
368
|
+
args: [{
|
|
369
|
+
transform: booleanAttribute
|
|
370
|
+
}]
|
|
371
|
+
}],
|
|
372
|
+
completed: [{
|
|
373
|
+
type: Input,
|
|
374
|
+
args: [{
|
|
375
|
+
transform: booleanAttribute
|
|
376
|
+
}]
|
|
377
|
+
}],
|
|
378
|
+
hasError: [{
|
|
379
|
+
type: Input,
|
|
380
|
+
args: [{
|
|
381
|
+
transform: booleanAttribute
|
|
382
|
+
}]
|
|
383
|
+
}]
|
|
384
|
+
}
|
|
385
|
+
});
|
|
287
386
|
class CdkStepper {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
if (this.
|
|
311
|
-
|
|
312
|
-
if (!this._isValidIndex(index) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
313
|
-
throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');
|
|
314
|
-
}
|
|
315
|
-
if (this.selectedIndex !== index) {
|
|
316
|
-
this.selected?._markAsInteracted();
|
|
317
|
-
if (!this._anyControlsInvalidOrPending(index) &&
|
|
318
|
-
(index >= this.selectedIndex || this.steps.toArray()[index].editable)) {
|
|
319
|
-
this._updateSelectedItemIndex(index);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
387
|
+
_dir = inject(Directionality, {
|
|
388
|
+
optional: true
|
|
389
|
+
});
|
|
390
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
391
|
+
_elementRef = inject(ElementRef);
|
|
392
|
+
_destroyed = new Subject();
|
|
393
|
+
_keyManager;
|
|
394
|
+
_steps;
|
|
395
|
+
steps = new QueryList();
|
|
396
|
+
_stepHeader;
|
|
397
|
+
_sortedHeaders = new QueryList();
|
|
398
|
+
linear = false;
|
|
399
|
+
get selectedIndex() {
|
|
400
|
+
return this._selectedIndex();
|
|
401
|
+
}
|
|
402
|
+
set selectedIndex(index) {
|
|
403
|
+
if (this._steps) {
|
|
404
|
+
if (!this._isValidIndex(index) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
405
|
+
throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');
|
|
406
|
+
}
|
|
407
|
+
if (this.selectedIndex !== index) {
|
|
408
|
+
this.selected?._markAsInteracted();
|
|
409
|
+
if (!this._anyControlsInvalidOrPending(index) && (index >= this.selectedIndex || this.steps.toArray()[index].editable)) {
|
|
410
|
+
this._updateSelectedItemIndex(index);
|
|
322
411
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
const control = step.stepControl;
|
|
509
|
-
const isIncomplete = control
|
|
510
|
-
? control.invalid || control.pending || !step.interacted
|
|
511
|
-
: !step.completed;
|
|
512
|
-
return isIncomplete && !step.optional && !step._completedOverride();
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
return false;
|
|
516
|
-
}
|
|
517
|
-
_layoutDirection() {
|
|
518
|
-
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
|
|
519
|
-
}
|
|
520
|
-
/** Checks whether the stepper contains the focused element. */
|
|
521
|
-
_containsFocus() {
|
|
522
|
-
const stepperElement = this._elementRef.nativeElement;
|
|
523
|
-
const focusedElement = _getFocusedElementPierceShadowDom();
|
|
524
|
-
return stepperElement === focusedElement || stepperElement.contains(focusedElement);
|
|
525
|
-
}
|
|
526
|
-
/** Checks whether the passed-in index is a valid step index. */
|
|
527
|
-
_isValidIndex(index) {
|
|
528
|
-
return index > -1 && (!this.steps || index < this.steps.length);
|
|
529
|
-
}
|
|
530
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkStepper, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
531
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.2.0-next.2", type: CdkStepper, isStandalone: true, selector: "[cdkStepper]", inputs: { linear: ["linear", "linear", booleanAttribute], selectedIndex: ["selectedIndex", "selectedIndex", numberAttribute], selected: "selected", orientation: "orientation" }, outputs: { selectionChange: "selectionChange", selectedIndexChange: "selectedIndexChange" }, queries: [{ propertyName: "_steps", predicate: CdkStep, descendants: true }, { propertyName: "_stepHeader", predicate: CdkStepHeader, descendants: true }], exportAs: ["cdkStepper"], ngImport: i0 });
|
|
412
|
+
}
|
|
413
|
+
} else {
|
|
414
|
+
this._selectedIndex.set(index);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
_selectedIndex = signal(0, ...(ngDevMode ? [{
|
|
418
|
+
debugName: "_selectedIndex"
|
|
419
|
+
}] : []));
|
|
420
|
+
get selected() {
|
|
421
|
+
return this.steps ? this.steps.toArray()[this.selectedIndex] : undefined;
|
|
422
|
+
}
|
|
423
|
+
set selected(step) {
|
|
424
|
+
this.selectedIndex = step && this.steps ? this.steps.toArray().indexOf(step) : -1;
|
|
425
|
+
}
|
|
426
|
+
selectionChange = new EventEmitter();
|
|
427
|
+
selectedIndexChange = new EventEmitter();
|
|
428
|
+
_groupId = inject(_IdGenerator).getId('cdk-stepper-');
|
|
429
|
+
get orientation() {
|
|
430
|
+
return this._orientation;
|
|
431
|
+
}
|
|
432
|
+
set orientation(value) {
|
|
433
|
+
this._orientation = value;
|
|
434
|
+
if (this._keyManager) {
|
|
435
|
+
this._keyManager.withVerticalOrientation(value === 'vertical');
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
_orientation = 'horizontal';
|
|
439
|
+
constructor() {}
|
|
440
|
+
ngAfterContentInit() {
|
|
441
|
+
this._steps.changes.pipe(startWith(this._steps), takeUntil(this._destroyed)).subscribe(steps => {
|
|
442
|
+
this.steps.reset(steps.filter(step => step._stepper === this));
|
|
443
|
+
this.steps.forEach((step, index) => step.index.set(index));
|
|
444
|
+
this.steps.notifyOnChanges();
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
ngAfterViewInit() {
|
|
448
|
+
this._stepHeader.changes.pipe(startWith(this._stepHeader), takeUntil(this._destroyed)).subscribe(headers => {
|
|
449
|
+
this._sortedHeaders.reset(headers.toArray().sort((a, b) => {
|
|
450
|
+
const documentPosition = a._elementRef.nativeElement.compareDocumentPosition(b._elementRef.nativeElement);
|
|
451
|
+
return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
452
|
+
}));
|
|
453
|
+
this._sortedHeaders.notifyOnChanges();
|
|
454
|
+
});
|
|
455
|
+
this._keyManager = new FocusKeyManager(this._sortedHeaders).withWrap().withHomeAndEnd().withVerticalOrientation(this._orientation === 'vertical');
|
|
456
|
+
this._keyManager.updateActiveItem(this.selectedIndex);
|
|
457
|
+
(this._dir ? this._dir.change : of()).pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed)).subscribe(direction => this._keyManager?.withHorizontalOrientation(direction));
|
|
458
|
+
this._keyManager.updateActiveItem(this.selectedIndex);
|
|
459
|
+
this.steps.changes.subscribe(() => {
|
|
460
|
+
if (!this.selected) {
|
|
461
|
+
this._selectedIndex.set(Math.max(this.selectedIndex - 1, 0));
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
if (!this._isValidIndex(this.selectedIndex)) {
|
|
465
|
+
this._selectedIndex.set(0);
|
|
466
|
+
}
|
|
467
|
+
if (this.linear && this.selectedIndex > 0) {
|
|
468
|
+
const visitedSteps = this.steps.toArray().slice(0, this._selectedIndex());
|
|
469
|
+
for (const step of visitedSteps) {
|
|
470
|
+
step._markAsInteracted();
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
ngOnDestroy() {
|
|
475
|
+
this._keyManager?.destroy();
|
|
476
|
+
this.steps.destroy();
|
|
477
|
+
this._sortedHeaders.destroy();
|
|
478
|
+
this._destroyed.next();
|
|
479
|
+
this._destroyed.complete();
|
|
480
|
+
}
|
|
481
|
+
next() {
|
|
482
|
+
this.selectedIndex = Math.min(this._selectedIndex() + 1, this.steps.length - 1);
|
|
483
|
+
}
|
|
484
|
+
previous() {
|
|
485
|
+
this.selectedIndex = Math.max(this._selectedIndex() - 1, 0);
|
|
486
|
+
}
|
|
487
|
+
reset() {
|
|
488
|
+
this._updateSelectedItemIndex(0);
|
|
489
|
+
this.steps.forEach(step => step.reset());
|
|
490
|
+
this._stateChanged();
|
|
491
|
+
}
|
|
492
|
+
_getStepLabelId(i) {
|
|
493
|
+
return `${this._groupId}-label-${i}`;
|
|
494
|
+
}
|
|
495
|
+
_getStepContentId(i) {
|
|
496
|
+
return `${this._groupId}-content-${i}`;
|
|
497
|
+
}
|
|
498
|
+
_stateChanged() {
|
|
499
|
+
this._changeDetectorRef.markForCheck();
|
|
500
|
+
}
|
|
501
|
+
_getAnimationDirection(index) {
|
|
502
|
+
const position = index - this._selectedIndex();
|
|
503
|
+
if (position < 0) {
|
|
504
|
+
return this._layoutDirection() === 'rtl' ? 'next' : 'previous';
|
|
505
|
+
} else if (position > 0) {
|
|
506
|
+
return this._layoutDirection() === 'rtl' ? 'previous' : 'next';
|
|
507
|
+
}
|
|
508
|
+
return 'current';
|
|
509
|
+
}
|
|
510
|
+
_getFocusIndex() {
|
|
511
|
+
return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex();
|
|
512
|
+
}
|
|
513
|
+
_updateSelectedItemIndex(newIndex) {
|
|
514
|
+
const stepsArray = this.steps.toArray();
|
|
515
|
+
const selectedIndex = this._selectedIndex();
|
|
516
|
+
this.selectionChange.emit({
|
|
517
|
+
selectedIndex: newIndex,
|
|
518
|
+
previouslySelectedIndex: selectedIndex,
|
|
519
|
+
selectedStep: stepsArray[newIndex],
|
|
520
|
+
previouslySelectedStep: stepsArray[selectedIndex]
|
|
521
|
+
});
|
|
522
|
+
if (this._keyManager) {
|
|
523
|
+
this._containsFocus() ? this._keyManager.setActiveItem(newIndex) : this._keyManager.updateActiveItem(newIndex);
|
|
524
|
+
}
|
|
525
|
+
this._selectedIndex.set(newIndex);
|
|
526
|
+
this.selectedIndexChange.emit(newIndex);
|
|
527
|
+
this._stateChanged();
|
|
528
|
+
}
|
|
529
|
+
_onKeydown(event) {
|
|
530
|
+
const hasModifier = hasModifierKey(event);
|
|
531
|
+
const keyCode = event.keyCode;
|
|
532
|
+
const manager = this._keyManager;
|
|
533
|
+
if (manager?.activeItemIndex != null && !hasModifier && (keyCode === SPACE || keyCode === ENTER)) {
|
|
534
|
+
this.selectedIndex = manager.activeItemIndex;
|
|
535
|
+
event.preventDefault();
|
|
536
|
+
} else {
|
|
537
|
+
manager?.setFocusOrigin('keyboard').onKeydown(event);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
_anyControlsInvalidOrPending(index) {
|
|
541
|
+
if (this.linear && index >= 0) {
|
|
542
|
+
return this.steps.toArray().slice(0, index).some(step => {
|
|
543
|
+
const control = step.stepControl;
|
|
544
|
+
const isIncomplete = control ? control.invalid || control.pending || !step.interacted : !step.completed;
|
|
545
|
+
return isIncomplete && !step.optional && !step._completedOverride();
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
return false;
|
|
549
|
+
}
|
|
550
|
+
_layoutDirection() {
|
|
551
|
+
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
|
|
552
|
+
}
|
|
553
|
+
_containsFocus() {
|
|
554
|
+
const stepperElement = this._elementRef.nativeElement;
|
|
555
|
+
const focusedElement = _getFocusedElementPierceShadowDom();
|
|
556
|
+
return stepperElement === focusedElement || stepperElement.contains(focusedElement);
|
|
557
|
+
}
|
|
558
|
+
_isValidIndex(index) {
|
|
559
|
+
return index > -1 && (!this.steps || index < this.steps.length);
|
|
560
|
+
}
|
|
561
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
562
|
+
minVersion: "12.0.0",
|
|
563
|
+
version: "20.2.0-next.2",
|
|
564
|
+
ngImport: i0,
|
|
565
|
+
type: CdkStepper,
|
|
566
|
+
deps: [],
|
|
567
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
568
|
+
});
|
|
569
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
570
|
+
minVersion: "16.1.0",
|
|
571
|
+
version: "20.2.0-next.2",
|
|
572
|
+
type: CdkStepper,
|
|
573
|
+
isStandalone: true,
|
|
574
|
+
selector: "[cdkStepper]",
|
|
575
|
+
inputs: {
|
|
576
|
+
linear: ["linear", "linear", booleanAttribute],
|
|
577
|
+
selectedIndex: ["selectedIndex", "selectedIndex", numberAttribute],
|
|
578
|
+
selected: "selected",
|
|
579
|
+
orientation: "orientation"
|
|
580
|
+
},
|
|
581
|
+
outputs: {
|
|
582
|
+
selectionChange: "selectionChange",
|
|
583
|
+
selectedIndexChange: "selectedIndexChange"
|
|
584
|
+
},
|
|
585
|
+
queries: [{
|
|
586
|
+
propertyName: "_steps",
|
|
587
|
+
predicate: CdkStep,
|
|
588
|
+
descendants: true
|
|
589
|
+
}, {
|
|
590
|
+
propertyName: "_stepHeader",
|
|
591
|
+
predicate: CdkStepHeader,
|
|
592
|
+
descendants: true
|
|
593
|
+
}],
|
|
594
|
+
exportAs: ["cdkStepper"],
|
|
595
|
+
ngImport: i0
|
|
596
|
+
});
|
|
532
597
|
}
|
|
533
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
598
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
599
|
+
minVersion: "12.0.0",
|
|
600
|
+
version: "20.2.0-next.2",
|
|
601
|
+
ngImport: i0,
|
|
602
|
+
type: CdkStepper,
|
|
603
|
+
decorators: [{
|
|
604
|
+
type: Directive,
|
|
605
|
+
args: [{
|
|
606
|
+
selector: '[cdkStepper]',
|
|
607
|
+
exportAs: 'cdkStepper'
|
|
608
|
+
}]
|
|
609
|
+
}],
|
|
610
|
+
ctorParameters: () => [],
|
|
611
|
+
propDecorators: {
|
|
612
|
+
_steps: [{
|
|
613
|
+
type: ContentChildren,
|
|
614
|
+
args: [CdkStep, {
|
|
615
|
+
descendants: true
|
|
616
|
+
}]
|
|
617
|
+
}],
|
|
618
|
+
_stepHeader: [{
|
|
619
|
+
type: ContentChildren,
|
|
620
|
+
args: [CdkStepHeader, {
|
|
621
|
+
descendants: true
|
|
622
|
+
}]
|
|
623
|
+
}],
|
|
624
|
+
linear: [{
|
|
625
|
+
type: Input,
|
|
626
|
+
args: [{
|
|
627
|
+
transform: booleanAttribute
|
|
628
|
+
}]
|
|
629
|
+
}],
|
|
630
|
+
selectedIndex: [{
|
|
631
|
+
type: Input,
|
|
632
|
+
args: [{
|
|
633
|
+
transform: numberAttribute
|
|
634
|
+
}]
|
|
635
|
+
}],
|
|
636
|
+
selected: [{
|
|
637
|
+
type: Input
|
|
638
|
+
}],
|
|
639
|
+
selectionChange: [{
|
|
640
|
+
type: Output
|
|
641
|
+
}],
|
|
642
|
+
selectedIndexChange: [{
|
|
643
|
+
type: Output
|
|
644
|
+
}],
|
|
645
|
+
orientation: [{
|
|
646
|
+
type: Input
|
|
647
|
+
}]
|
|
648
|
+
}
|
|
649
|
+
});
|
|
560
650
|
|
|
561
|
-
/** Button that moves to the next step in a stepper workflow. */
|
|
562
651
|
class CdkStepperNext {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
652
|
+
_stepper = inject(CdkStepper);
|
|
653
|
+
type = 'submit';
|
|
654
|
+
constructor() {}
|
|
655
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
656
|
+
minVersion: "12.0.0",
|
|
657
|
+
version: "20.2.0-next.2",
|
|
658
|
+
ngImport: i0,
|
|
659
|
+
type: CdkStepperNext,
|
|
660
|
+
deps: [],
|
|
661
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
662
|
+
});
|
|
663
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
664
|
+
minVersion: "14.0.0",
|
|
665
|
+
version: "20.2.0-next.2",
|
|
666
|
+
type: CdkStepperNext,
|
|
667
|
+
isStandalone: true,
|
|
668
|
+
selector: "button[cdkStepperNext]",
|
|
669
|
+
inputs: {
|
|
670
|
+
type: "type"
|
|
671
|
+
},
|
|
672
|
+
host: {
|
|
673
|
+
listeners: {
|
|
674
|
+
"click": "_stepper.next()"
|
|
675
|
+
},
|
|
676
|
+
properties: {
|
|
677
|
+
"type": "type"
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
ngImport: i0
|
|
681
|
+
});
|
|
569
682
|
}
|
|
570
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
683
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
684
|
+
minVersion: "12.0.0",
|
|
685
|
+
version: "20.2.0-next.2",
|
|
686
|
+
ngImport: i0,
|
|
687
|
+
type: CdkStepperNext,
|
|
688
|
+
decorators: [{
|
|
689
|
+
type: Directive,
|
|
690
|
+
args: [{
|
|
691
|
+
selector: 'button[cdkStepperNext]',
|
|
692
|
+
host: {
|
|
693
|
+
'[type]': 'type',
|
|
694
|
+
'(click)': '_stepper.next()'
|
|
695
|
+
}
|
|
696
|
+
}]
|
|
697
|
+
}],
|
|
698
|
+
ctorParameters: () => [],
|
|
699
|
+
propDecorators: {
|
|
700
|
+
type: [{
|
|
701
|
+
type: Input
|
|
702
|
+
}]
|
|
703
|
+
}
|
|
704
|
+
});
|
|
583
705
|
class CdkStepperPrevious {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
706
|
+
_stepper = inject(CdkStepper);
|
|
707
|
+
type = 'button';
|
|
708
|
+
constructor() {}
|
|
709
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
710
|
+
minVersion: "12.0.0",
|
|
711
|
+
version: "20.2.0-next.2",
|
|
712
|
+
ngImport: i0,
|
|
713
|
+
type: CdkStepperPrevious,
|
|
714
|
+
deps: [],
|
|
715
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
716
|
+
});
|
|
717
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
718
|
+
minVersion: "14.0.0",
|
|
719
|
+
version: "20.2.0-next.2",
|
|
720
|
+
type: CdkStepperPrevious,
|
|
721
|
+
isStandalone: true,
|
|
722
|
+
selector: "button[cdkStepperPrevious]",
|
|
723
|
+
inputs: {
|
|
724
|
+
type: "type"
|
|
725
|
+
},
|
|
726
|
+
host: {
|
|
727
|
+
listeners: {
|
|
728
|
+
"click": "_stepper.previous()"
|
|
729
|
+
},
|
|
730
|
+
properties: {
|
|
731
|
+
"type": "type"
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
ngImport: i0
|
|
735
|
+
});
|
|
590
736
|
}
|
|
591
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
737
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
738
|
+
minVersion: "12.0.0",
|
|
739
|
+
version: "20.2.0-next.2",
|
|
740
|
+
ngImport: i0,
|
|
741
|
+
type: CdkStepperPrevious,
|
|
742
|
+
decorators: [{
|
|
743
|
+
type: Directive,
|
|
744
|
+
args: [{
|
|
745
|
+
selector: 'button[cdkStepperPrevious]',
|
|
746
|
+
host: {
|
|
747
|
+
'[type]': 'type',
|
|
748
|
+
'(click)': '_stepper.previous()'
|
|
749
|
+
}
|
|
750
|
+
}]
|
|
751
|
+
}],
|
|
752
|
+
ctorParameters: () => [],
|
|
753
|
+
propDecorators: {
|
|
754
|
+
type: [{
|
|
755
|
+
type: Input
|
|
756
|
+
}]
|
|
757
|
+
}
|
|
758
|
+
});
|
|
603
759
|
|
|
604
760
|
class CdkStepperModule {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
761
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
762
|
+
minVersion: "12.0.0",
|
|
763
|
+
version: "20.2.0-next.2",
|
|
764
|
+
ngImport: i0,
|
|
765
|
+
type: CdkStepperModule,
|
|
766
|
+
deps: [],
|
|
767
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
768
|
+
});
|
|
769
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({
|
|
770
|
+
minVersion: "14.0.0",
|
|
771
|
+
version: "20.2.0-next.2",
|
|
772
|
+
ngImport: i0,
|
|
773
|
+
type: CdkStepperModule,
|
|
774
|
+
imports: [BidiModule, CdkStep, CdkStepper, CdkStepHeader, CdkStepLabel, CdkStepperNext, CdkStepperPrevious],
|
|
775
|
+
exports: [CdkStep, CdkStepper, CdkStepHeader, CdkStepLabel, CdkStepperNext, CdkStepperPrevious]
|
|
776
|
+
});
|
|
777
|
+
static ɵinj = i0.ɵɵngDeclareInjector({
|
|
778
|
+
minVersion: "12.0.0",
|
|
779
|
+
version: "20.2.0-next.2",
|
|
780
|
+
ngImport: i0,
|
|
781
|
+
type: CdkStepperModule,
|
|
782
|
+
imports: [BidiModule]
|
|
783
|
+
});
|
|
614
784
|
}
|
|
615
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
}]
|
|
629
|
-
}] });
|
|
785
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
786
|
+
minVersion: "12.0.0",
|
|
787
|
+
version: "20.2.0-next.2",
|
|
788
|
+
ngImport: i0,
|
|
789
|
+
type: CdkStepperModule,
|
|
790
|
+
decorators: [{
|
|
791
|
+
type: NgModule,
|
|
792
|
+
args: [{
|
|
793
|
+
imports: [BidiModule, CdkStep, CdkStepper, CdkStepHeader, CdkStepLabel, CdkStepperNext, CdkStepperPrevious],
|
|
794
|
+
exports: [CdkStep, CdkStepper, CdkStepHeader, CdkStepLabel, CdkStepperNext, CdkStepperPrevious]
|
|
795
|
+
}]
|
|
796
|
+
}]
|
|
797
|
+
});
|
|
630
798
|
|
|
631
799
|
export { CdkStep, CdkStepHeader, CdkStepLabel, CdkStepper, CdkStepperModule, CdkStepperNext, CdkStepperPrevious, STEPPER_GLOBAL_OPTIONS, STEP_STATE, StepperSelectionEvent };
|
|
632
800
|
//# sourceMappingURL=stepper.mjs.map
|