@angular/cdk 10.0.0-rc.3 → 10.1.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/a11y/aria-describer/aria-describer.d.ts +10 -1
- package/a11y/focus-trap/focus-trap.d.ts +4 -2
- package/a11y/index.metadata.json +1 -1
- package/a11y/interactivity-checker/interactivity-checker.d.ts +11 -1
- package/a11y/key-manager/list-key-manager.d.ts +6 -0
- package/accordion/accordion.d.ts +7 -1
- package/accordion/index.d.ts +1 -0
- package/accordion/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +78 -15
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +11 -11
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-accordion.umd.js +12 -4
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js +2 -2
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +717 -641
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +8 -16
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +199 -42
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +11 -18
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +0 -1
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +2 -2
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +26 -4
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +11 -4
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.min.js +8 -8
- package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
- package/bundles/cdk-testing.umd.js +32 -0
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.min.js +5 -5
- package/bundles/cdk-testing.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +6 -2
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +3 -3
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/drag-drop/directives/drag-handle.d.ts +7 -1
- package/drag-drop/directives/drag-placeholder.d.ts +7 -1
- package/drag-drop/directives/drag-preview.d.ts +7 -1
- package/drag-drop/directives/drag.d.ts +4 -14
- package/drag-drop/directives/drop-list-group.d.ts +7 -1
- package/drag-drop/directives/drop-list.d.ts +7 -1
- package/drag-drop/drag-ref.d.ts +6 -0
- package/drag-drop/drop-list-ref.d.ts +3 -2
- package/drag-drop/index.d.ts +2 -2
- package/drag-drop/index.metadata.json +1 -1
- package/esm2015/a11y/a11y-module.js +15 -19
- package/esm2015/a11y/aria-describer/aria-describer.js +177 -167
- package/esm2015/a11y/focus-monitor/focus-monitor.js +337 -345
- package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +30 -34
- package/esm2015/a11y/focus-trap/focus-trap-manager.js +36 -40
- package/esm2015/a11y/focus-trap/focus-trap.js +85 -82
- package/esm2015/a11y/high-contrast-mode/high-contrast-mode-detector.js +56 -60
- package/esm2015/a11y/interactivity-checker/interactivity-checker.js +113 -104
- package/esm2015/a11y/key-manager/list-key-manager.js +29 -4
- package/esm2015/a11y/live-announcer/live-announcer.js +138 -146
- package/esm2015/accordion/accordion-item.js +119 -123
- package/esm2015/accordion/accordion-module.js +9 -13
- package/esm2015/accordion/accordion.js +49 -46
- package/esm2015/accordion/index.js +2 -1
- package/esm2015/bidi/bidi-module.js +9 -13
- package/esm2015/bidi/dir.js +41 -45
- package/esm2015/bidi/directionality.js +27 -31
- package/esm2015/clipboard/clipboard-module.js +9 -13
- package/esm2015/clipboard/clipboard.js +36 -40
- package/esm2015/clipboard/copy-to-clipboard.js +71 -75
- package/esm2015/collections/unique-selection-dispatcher.js +33 -37
- package/esm2015/drag-drop/directives/drag-handle.js +42 -39
- package/esm2015/drag-drop/directives/drag-placeholder.js +24 -21
- package/esm2015/drag-drop/directives/drag-preview.js +29 -26
- package/esm2015/drag-drop/directives/drag.js +313 -319
- package/esm2015/drag-drop/directives/drop-list-group.js +32 -29
- package/esm2015/drag-drop/directives/drop-list.js +251 -250
- package/esm2015/drag-drop/drag-drop-module.js +27 -31
- package/esm2015/drag-drop/drag-drop-registry.js +139 -143
- package/esm2015/drag-drop/drag-drop.js +33 -37
- package/esm2015/drag-drop/drag-ref.js +59 -25
- package/esm2015/drag-drop/drop-list-ref.js +15 -9
- package/esm2015/drag-drop/index.js +3 -2
- package/esm2015/layout/breakpoints-observer.js +81 -85
- package/esm2015/layout/layout-module.js +6 -10
- package/esm2015/layout/media-matcher.js +28 -32
- package/esm2015/observers/observe-content.js +147 -163
- package/esm2015/overlay/dispatchers/base-overlay-dispatcher.js +51 -0
- package/esm2015/overlay/dispatchers/index.js +10 -0
- package/esm2015/overlay/dispatchers/overlay-keyboard-dispatcher.js +79 -0
- package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +94 -0
- package/esm2015/overlay/fullscreen-overlay-container.js +70 -74
- package/esm2015/overlay/index.js +5 -4
- package/esm2015/overlay/overlay-config.js +5 -1
- package/esm2015/overlay/overlay-container.js +69 -73
- package/esm2015/overlay/overlay-directives.js +245 -243
- package/esm2015/overlay/overlay-module.js +15 -19
- package/esm2015/overlay/overlay-ref.js +24 -2
- package/esm2015/overlay/overlay-reference.js +1 -1
- package/esm2015/overlay/overlay.js +93 -92
- package/esm2015/overlay/position/connected-position.js +14 -18
- package/esm2015/overlay/position/overlay-position-builder.js +43 -47
- package/esm2015/overlay/public-api.js +2 -2
- package/esm2015/overlay/scroll/scroll-strategy-options.js +33 -37
- package/esm2015/platform/features/scrolling.js +1 -2
- package/esm2015/platform/platform-module.js +6 -10
- package/esm2015/platform/platform.js +48 -52
- package/esm2015/portal/portal-directives.js +181 -201
- package/esm2015/scrolling/fixed-size-virtual-scroll.js +57 -47
- package/esm2015/scrolling/public-api.js +2 -1
- package/esm2015/scrolling/scroll-dispatcher.js +139 -143
- package/esm2015/scrolling/scrollable.js +135 -139
- package/esm2015/scrolling/scrolling-module.js +32 -40
- package/esm2015/scrolling/viewport-ruler.js +105 -109
- package/esm2015/scrolling/virtual-for-of.js +264 -268
- package/esm2015/scrolling/virtual-scroll-repeater.js +8 -0
- package/esm2015/scrolling/virtual-scroll-viewport.js +318 -322
- package/esm2015/stepper/step-header.js +20 -24
- package/esm2015/stepper/step-label.js +13 -17
- package/esm2015/stepper/stepper-button.js +59 -67
- package/esm2015/stepper/stepper-module.js +24 -28
- package/esm2015/stepper/stepper.js +313 -321
- package/esm2015/table/cell.js +129 -157
- package/esm2015/table/row.js +183 -219
- package/esm2015/table/table-module.js +9 -13
- package/esm2015/table/table.js +765 -785
- package/esm2015/table/text-column.js +85 -89
- package/esm2015/testing/component-harness.js +19 -1
- package/esm2015/testing/harness-environment.js +7 -1
- package/esm2015/text-field/autofill.js +89 -97
- package/esm2015/text-field/autosize.js +225 -229
- package/esm2015/text-field/text-field-module.js +10 -14
- package/esm2015/tree/control/nested-tree-control.js +7 -3
- package/esm2015/tree/nested-node.js +79 -83
- package/esm2015/tree/node.js +17 -21
- package/esm2015/tree/outlet.js +15 -19
- package/esm2015/tree/padding.js +88 -92
- package/esm2015/tree/toggle.js +32 -36
- package/esm2015/tree/tree-module.js +10 -14
- package/esm2015/tree/tree.js +266 -274
- package/esm2015/version.js +1 -1
- package/fesm2015/a11y.js +1021 -996
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/accordion.js +173 -175
- package/fesm2015/accordion.js.map +1 -1
- package/fesm2015/bidi.js +74 -83
- package/fesm2015/bidi.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/clipboard.js +113 -122
- package/fesm2015/clipboard.js.map +1 -1
- package/fesm2015/collections.js +32 -35
- package/fesm2015/collections.js.map +1 -1
- package/fesm2015/drag-drop.js +1005 -961
- package/fesm2015/drag-drop.js.map +1 -1
- package/fesm2015/layout.js +111 -120
- package/fesm2015/layout.js.map +1 -1
- package/fesm2015/observers.js +146 -158
- package/fesm2015/observers.js.map +1 -1
- package/fesm2015/overlay.js +793 -659
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/platform.js +52 -59
- package/fesm2015/platform.js.map +1 -1
- package/fesm2015/portal.js +180 -195
- package/fesm2015/portal.js.map +1 -1
- package/fesm2015/scrolling.js +1058 -1060
- package/fesm2015/scrolling.js.map +1 -1
- package/fesm2015/stepper.js +424 -445
- package/fesm2015/stepper.js.map +1 -1
- package/fesm2015/table.js +1178 -1247
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/testing.js +25 -1
- package/fesm2015/testing.js.map +1 -1
- package/fesm2015/text-field.js +318 -330
- package/fesm2015/text-field.js.map +1 -1
- package/fesm2015/tree.js +517 -537
- package/fesm2015/tree.js.map +1 -1
- package/overlay/dispatchers/base-overlay-dispatcher.d.ts +28 -0
- package/overlay/dispatchers/index.d.ts +9 -0
- package/overlay/{keyboard → dispatchers}/overlay-keyboard-dispatcher.d.ts +4 -10
- package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +27 -0
- package/overlay/index.d.ts +4 -3
- package/overlay/index.metadata.json +1 -1
- package/overlay/overlay-config.d.ts +4 -0
- package/overlay/overlay-directives.d.ts +4 -0
- package/overlay/overlay-ref.d.ts +8 -2
- package/overlay/overlay-reference.d.ts +1 -0
- package/overlay/overlay.d.ts +4 -2
- package/overlay/public-api.d.ts +1 -1
- package/package.json +3 -3
- package/schematics/index.js +1 -1
- package/schematics/migration.json +5 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-update/data/index.js +1 -1
- package/schematics/ng-update/devkit-file-system.d.ts +5 -5
- package/schematics/ng-update/devkit-file-system.js +21 -16
- package/schematics/ng-update/devkit-migration-rule.js +13 -20
- package/schematics/ng-update/devkit-migration.d.ts +0 -2
- package/schematics/ng-update/devkit-migration.js +1 -1
- package/schematics/ng-update/find-stylesheets.d.ts +10 -0
- package/schematics/ng-update/find-stylesheets.js +31 -0
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +7 -2
- package/schematics/ng-update/migrations/attribute-selectors.js +3 -3
- package/schematics/ng-update/migrations/css-selectors.js +3 -3
- package/schematics/ng-update/migrations/element-selectors.js +3 -3
- package/schematics/ng-update/public-api.js +1 -1
- package/schematics/update-tool/component-resource-collector.d.ts +1 -1
- package/schematics/update-tool/component-resource-collector.js +18 -14
- package/schematics/update-tool/file-system.d.ts +19 -14
- package/schematics/update-tool/file-system.js +1 -1
- package/schematics/update-tool/index.d.ts +21 -3
- package/schematics/update-tool/index.js +29 -23
- package/schematics/update-tool/public-api.js +1 -1
- package/schematics/update-tool/target-version.d.ts +2 -1
- package/schematics/update-tool/target-version.js +5 -3
- package/schematics/update-tool/utils/parse-tsconfig.d.ts +2 -1
- package/schematics/update-tool/utils/parse-tsconfig.js +6 -10
- package/schematics/update-tool/utils/virtual-host.d.ts +34 -0
- package/schematics/update-tool/utils/virtual-host.js +62 -0
- package/schematics/update-tool/version-changes.js +4 -6
- package/schematics/utils/index.js +1 -1
- package/schematics/utils/project-tsconfig-paths.d.ts +2 -1
- package/schematics/utils/project-tsconfig-paths.js +1 -1
- package/scrolling/index.metadata.json +1 -1
- package/scrolling/public-api.d.ts +1 -0
- package/scrolling/virtual-for-of.d.ts +2 -1
- package/scrolling/virtual-scroll-repeater.d.ts +16 -0
- package/scrolling/virtual-scroll-viewport.d.ts +4 -4
- package/testing/component-harness.d.ts +12 -0
- package/testing/harness-environment.d.ts +1 -0
- package/tree/control/nested-tree-control.d.ts +7 -2
- package/tree/index.metadata.json +1 -1
- package/esm2015/overlay/keyboard/overlay-keyboard-dispatcher.js +0 -100
package/fesm2015/stepper.js
CHANGED
|
@@ -14,29 +14,26 @@ import { startWith, takeUntil } from 'rxjs/operators';
|
|
|
14
14
|
* Use of this source code is governed by an MIT-style license that can be
|
|
15
15
|
* found in the LICENSE file at https://angular.io/license
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this._elementRef = _elementRef;
|
|
21
|
-
}
|
|
22
|
-
/** Focuses the step header. */
|
|
23
|
-
focus() {
|
|
24
|
-
this._elementRef.nativeElement.focus();
|
|
25
|
-
}
|
|
17
|
+
class CdkStepHeader {
|
|
18
|
+
constructor(_elementRef) {
|
|
19
|
+
this._elementRef = _elementRef;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
/** Focuses the step header. */
|
|
22
|
+
focus() {
|
|
23
|
+
this._elementRef.nativeElement.focus();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
CdkStepHeader.decorators = [
|
|
27
|
+
{ type: Directive, args: [{
|
|
28
|
+
selector: '[cdkStepHeader]',
|
|
29
|
+
host: {
|
|
30
|
+
'role': 'tab',
|
|
31
|
+
},
|
|
32
|
+
},] }
|
|
33
|
+
];
|
|
34
|
+
CdkStepHeader.ctorParameters = () => [
|
|
35
|
+
{ type: ElementRef }
|
|
36
|
+
];
|
|
40
37
|
|
|
41
38
|
/**
|
|
42
39
|
* @license
|
|
@@ -45,22 +42,19 @@ let CdkStepHeader = /** @class */ (() => {
|
|
|
45
42
|
* Use of this source code is governed by an MIT-style license that can be
|
|
46
43
|
* found in the LICENSE file at https://angular.io/license
|
|
47
44
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
this.template = template;
|
|
52
|
-
}
|
|
45
|
+
class CdkStepLabel {
|
|
46
|
+
constructor(/** @docs-private */ template) {
|
|
47
|
+
this.template = template;
|
|
53
48
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})();
|
|
49
|
+
}
|
|
50
|
+
CdkStepLabel.decorators = [
|
|
51
|
+
{ type: Directive, args: [{
|
|
52
|
+
selector: '[cdkStepLabel]',
|
|
53
|
+
},] }
|
|
54
|
+
];
|
|
55
|
+
CdkStepLabel.ctorParameters = () => [
|
|
56
|
+
{ type: TemplateRef }
|
|
57
|
+
];
|
|
64
58
|
|
|
65
59
|
/**
|
|
66
60
|
* @license
|
|
@@ -89,349 +83,343 @@ const STEPPER_GLOBAL_OPTIONS = new InjectionToken('STEPPER_GLOBAL_OPTIONS');
|
|
|
89
83
|
* @breaking-change 8.0.0.
|
|
90
84
|
*/
|
|
91
85
|
const MAT_STEPPER_GLOBAL_OPTIONS = STEPPER_GLOBAL_OPTIONS;
|
|
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
|
-
|
|
86
|
+
class CdkStep {
|
|
87
|
+
/** @breaking-change 8.0.0 remove the `?` after `stepperOptions` */
|
|
88
|
+
constructor(_stepper, stepperOptions) {
|
|
89
|
+
this._stepper = _stepper;
|
|
90
|
+
/** Whether user has seen the expanded step content or not. */
|
|
91
|
+
this.interacted = false;
|
|
92
|
+
this._editable = true;
|
|
93
|
+
this._optional = false;
|
|
94
|
+
this._completedOverride = null;
|
|
95
|
+
this._customError = null;
|
|
96
|
+
this._stepperOptions = stepperOptions ? stepperOptions : {};
|
|
97
|
+
this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false;
|
|
98
|
+
this._showError = !!this._stepperOptions.showError;
|
|
99
|
+
}
|
|
100
|
+
/** Whether the user can return to this step once it has been marked as completed. */
|
|
101
|
+
get editable() {
|
|
102
|
+
return this._editable;
|
|
103
|
+
}
|
|
104
|
+
set editable(value) {
|
|
105
|
+
this._editable = coerceBooleanProperty(value);
|
|
106
|
+
}
|
|
107
|
+
/** Whether the completion of step is optional. */
|
|
108
|
+
get optional() {
|
|
109
|
+
return this._optional;
|
|
110
|
+
}
|
|
111
|
+
set optional(value) {
|
|
112
|
+
this._optional = coerceBooleanProperty(value);
|
|
113
|
+
}
|
|
114
|
+
/** Whether step is marked as completed. */
|
|
115
|
+
get completed() {
|
|
116
|
+
return this._completedOverride == null ? this._getDefaultCompleted() : this._completedOverride;
|
|
117
|
+
}
|
|
118
|
+
set completed(value) {
|
|
119
|
+
this._completedOverride = coerceBooleanProperty(value);
|
|
120
|
+
}
|
|
121
|
+
_getDefaultCompleted() {
|
|
122
|
+
return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;
|
|
123
|
+
}
|
|
124
|
+
/** Whether step has an error. */
|
|
125
|
+
get hasError() {
|
|
126
|
+
return this._customError == null ? this._getDefaultError() : this._customError;
|
|
127
|
+
}
|
|
128
|
+
set hasError(value) {
|
|
129
|
+
this._customError = coerceBooleanProperty(value);
|
|
130
|
+
}
|
|
131
|
+
_getDefaultError() {
|
|
132
|
+
return this.stepControl && this.stepControl.invalid && this.interacted;
|
|
133
|
+
}
|
|
134
|
+
/** Selects this step component. */
|
|
135
|
+
select() {
|
|
136
|
+
this._stepper.selected = this;
|
|
137
|
+
}
|
|
138
|
+
/** Resets the step to its initial state. Note that this includes resetting form data. */
|
|
139
|
+
reset() {
|
|
140
|
+
this.interacted = false;
|
|
141
|
+
if (this._completedOverride != null) {
|
|
142
|
+
this._completedOverride = false;
|
|
137
143
|
}
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
if (this._customError != null) {
|
|
145
|
+
this._customError = false;
|
|
140
146
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
this._stepper.selected = this;
|
|
147
|
+
if (this.stepControl) {
|
|
148
|
+
this.stepControl.reset();
|
|
144
149
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
}
|
|
151
|
+
ngOnChanges() {
|
|
152
|
+
// Since basically all inputs of the MatStep get proxied through the view down to the
|
|
153
|
+
// underlying MatStepHeader, we have to make sure that change detection runs correctly.
|
|
154
|
+
this._stepper._stateChanged();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
CdkStep.decorators = [
|
|
158
|
+
{ type: Component, args: [{
|
|
159
|
+
selector: 'cdk-step',
|
|
160
|
+
exportAs: 'cdkStep',
|
|
161
|
+
template: '<ng-template><ng-content></ng-content></ng-template>',
|
|
162
|
+
encapsulation: ViewEncapsulation.None,
|
|
163
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
164
|
+
},] }
|
|
165
|
+
];
|
|
166
|
+
CdkStep.ctorParameters = () => [
|
|
167
|
+
{ type: CdkStepper, decorators: [{ type: Inject, args: [forwardRef(() => CdkStepper),] }] },
|
|
168
|
+
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [STEPPER_GLOBAL_OPTIONS,] }] }
|
|
169
|
+
];
|
|
170
|
+
CdkStep.propDecorators = {
|
|
171
|
+
stepLabel: [{ type: ContentChild, args: [CdkStepLabel,] }],
|
|
172
|
+
content: [{ type: ViewChild, args: [TemplateRef, { static: true },] }],
|
|
173
|
+
stepControl: [{ type: Input }],
|
|
174
|
+
label: [{ type: Input }],
|
|
175
|
+
errorMessage: [{ type: Input }],
|
|
176
|
+
ariaLabel: [{ type: Input, args: ['aria-label',] }],
|
|
177
|
+
ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
|
|
178
|
+
state: [{ type: Input }],
|
|
179
|
+
editable: [{ type: Input }],
|
|
180
|
+
optional: [{ type: Input }],
|
|
181
|
+
completed: [{ type: Input }],
|
|
182
|
+
hasError: [{ type: Input }]
|
|
183
|
+
};
|
|
184
|
+
class CdkStepper {
|
|
185
|
+
constructor(_dir, _changeDetectorRef,
|
|
186
|
+
// @breaking-change 8.0.0 `_elementRef` and `_document` parameters to become required.
|
|
187
|
+
_elementRef, _document) {
|
|
188
|
+
this._dir = _dir;
|
|
189
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
190
|
+
this._elementRef = _elementRef;
|
|
191
|
+
/** Emits when the component is destroyed. */
|
|
192
|
+
this._destroyed = new Subject();
|
|
193
|
+
this._linear = false;
|
|
194
|
+
this._selectedIndex = 0;
|
|
195
|
+
/** Event emitted when the selected step has changed. */
|
|
196
|
+
this.selectionChange = new EventEmitter();
|
|
197
|
+
this._orientation = 'horizontal';
|
|
198
|
+
this._groupId = nextId++;
|
|
199
|
+
this._document = _document;
|
|
200
|
+
}
|
|
201
|
+
/** The list of step components that the stepper is holding. */
|
|
202
|
+
get steps() {
|
|
203
|
+
return this._steps;
|
|
204
|
+
}
|
|
205
|
+
/** Whether the validity of previous steps should be checked or not. */
|
|
206
|
+
get linear() {
|
|
207
|
+
return this._linear;
|
|
208
|
+
}
|
|
209
|
+
set linear(value) {
|
|
210
|
+
this._linear = coerceBooleanProperty(value);
|
|
211
|
+
}
|
|
212
|
+
/** The index of the selected step. */
|
|
213
|
+
get selectedIndex() {
|
|
214
|
+
return this._selectedIndex;
|
|
215
|
+
}
|
|
216
|
+
set selectedIndex(index) {
|
|
217
|
+
const newIndex = coerceNumberProperty(index);
|
|
218
|
+
if (this.steps) {
|
|
219
|
+
// Ensure that the index can't be out of bounds.
|
|
220
|
+
if (newIndex < 0 || newIndex > this.steps.length - 1) {
|
|
221
|
+
throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');
|
|
153
222
|
}
|
|
154
|
-
if (this.
|
|
155
|
-
this.
|
|
223
|
+
if (this._selectedIndex != newIndex && !this._anyControlsInvalidOrPending(newIndex) &&
|
|
224
|
+
(newIndex >= this._selectedIndex || this.steps.toArray()[newIndex].editable)) {
|
|
225
|
+
this._updateSelectedItemIndex(index);
|
|
156
226
|
}
|
|
157
227
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
// underlying MatStepHeader, we have to make sure that change detection runs correctly.
|
|
161
|
-
this._stepper._stateChanged();
|
|
228
|
+
else {
|
|
229
|
+
this._selectedIndex = newIndex;
|
|
162
230
|
}
|
|
163
231
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
editable: [{ type: Input }],
|
|
187
|
-
optional: [{ type: Input }],
|
|
188
|
-
completed: [{ type: Input }],
|
|
189
|
-
hasError: [{ type: Input }]
|
|
190
|
-
};
|
|
191
|
-
return CdkStep;
|
|
192
|
-
})();
|
|
193
|
-
let CdkStepper = /** @class */ (() => {
|
|
194
|
-
class CdkStepper {
|
|
195
|
-
constructor(_dir, _changeDetectorRef,
|
|
196
|
-
// @breaking-change 8.0.0 `_elementRef` and `_document` parameters to become required.
|
|
197
|
-
_elementRef, _document) {
|
|
198
|
-
this._dir = _dir;
|
|
199
|
-
this._changeDetectorRef = _changeDetectorRef;
|
|
200
|
-
this._elementRef = _elementRef;
|
|
201
|
-
/** Emits when the component is destroyed. */
|
|
202
|
-
this._destroyed = new Subject();
|
|
203
|
-
this._linear = false;
|
|
204
|
-
this._selectedIndex = 0;
|
|
205
|
-
/** Event emitted when the selected step has changed. */
|
|
206
|
-
this.selectionChange = new EventEmitter();
|
|
207
|
-
this._orientation = 'horizontal';
|
|
208
|
-
this._groupId = nextId++;
|
|
209
|
-
this._document = _document;
|
|
210
|
-
}
|
|
211
|
-
/** The list of step components that the stepper is holding. */
|
|
212
|
-
get steps() {
|
|
213
|
-
return this._steps;
|
|
214
|
-
}
|
|
215
|
-
/** Whether the validity of previous steps should be checked or not. */
|
|
216
|
-
get linear() {
|
|
217
|
-
return this._linear;
|
|
218
|
-
}
|
|
219
|
-
set linear(value) {
|
|
220
|
-
this._linear = coerceBooleanProperty(value);
|
|
221
|
-
}
|
|
222
|
-
/** The index of the selected step. */
|
|
223
|
-
get selectedIndex() {
|
|
224
|
-
return this._selectedIndex;
|
|
225
|
-
}
|
|
226
|
-
set selectedIndex(index) {
|
|
227
|
-
const newIndex = coerceNumberProperty(index);
|
|
228
|
-
if (this.steps) {
|
|
229
|
-
// Ensure that the index can't be out of bounds.
|
|
230
|
-
if (newIndex < 0 || newIndex > this.steps.length - 1) {
|
|
231
|
-
throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');
|
|
232
|
-
}
|
|
233
|
-
if (this._selectedIndex != newIndex && !this._anyControlsInvalidOrPending(newIndex) &&
|
|
234
|
-
(newIndex >= this._selectedIndex || this.steps.toArray()[newIndex].editable)) {
|
|
235
|
-
this._updateSelectedItemIndex(index);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
this._selectedIndex = newIndex;
|
|
232
|
+
/** The step that is selected. */
|
|
233
|
+
get selected() {
|
|
234
|
+
// @breaking-change 8.0.0 Change return type to `CdkStep | undefined`.
|
|
235
|
+
return this.steps ? this.steps.toArray()[this.selectedIndex] : undefined;
|
|
236
|
+
}
|
|
237
|
+
set selected(step) {
|
|
238
|
+
this.selectedIndex = this.steps ? this.steps.toArray().indexOf(step) : -1;
|
|
239
|
+
}
|
|
240
|
+
ngAfterViewInit() {
|
|
241
|
+
// Note that while the step headers are content children by default, any components that
|
|
242
|
+
// extend this one might have them as view children. We initialize the keyboard handling in
|
|
243
|
+
// AfterViewInit so we're guaranteed for both view and content children to be defined.
|
|
244
|
+
this._keyManager = new FocusKeyManager(this._stepHeader)
|
|
245
|
+
.withWrap()
|
|
246
|
+
.withVerticalOrientation(this._orientation === 'vertical');
|
|
247
|
+
(this._dir ? this._dir.change : of())
|
|
248
|
+
.pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))
|
|
249
|
+
.subscribe(direction => this._keyManager.withHorizontalOrientation(direction));
|
|
250
|
+
this._keyManager.updateActiveItem(this._selectedIndex);
|
|
251
|
+
this.steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => {
|
|
252
|
+
if (!this.selected) {
|
|
253
|
+
this._selectedIndex = Math.max(this._selectedIndex - 1, 0);
|
|
240
254
|
}
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
ngOnDestroy() {
|
|
258
|
+
this._destroyed.next();
|
|
259
|
+
this._destroyed.complete();
|
|
260
|
+
}
|
|
261
|
+
/** Selects and focuses the next step in list. */
|
|
262
|
+
next() {
|
|
263
|
+
this.selectedIndex = Math.min(this._selectedIndex + 1, this.steps.length - 1);
|
|
264
|
+
}
|
|
265
|
+
/** Selects and focuses the previous step in list. */
|
|
266
|
+
previous() {
|
|
267
|
+
this.selectedIndex = Math.max(this._selectedIndex - 1, 0);
|
|
268
|
+
}
|
|
269
|
+
/** Resets the stepper to its initial state. Note that this includes clearing form data. */
|
|
270
|
+
reset() {
|
|
271
|
+
this._updateSelectedItemIndex(0);
|
|
272
|
+
this.steps.forEach(step => step.reset());
|
|
273
|
+
this._stateChanged();
|
|
274
|
+
}
|
|
275
|
+
/** Returns a unique id for each step label element. */
|
|
276
|
+
_getStepLabelId(i) {
|
|
277
|
+
return `cdk-step-label-${this._groupId}-${i}`;
|
|
278
|
+
}
|
|
279
|
+
/** Returns unique id for each step content element. */
|
|
280
|
+
_getStepContentId(i) {
|
|
281
|
+
return `cdk-step-content-${this._groupId}-${i}`;
|
|
282
|
+
}
|
|
283
|
+
/** Marks the component to be change detected. */
|
|
284
|
+
_stateChanged() {
|
|
285
|
+
this._changeDetectorRef.markForCheck();
|
|
286
|
+
}
|
|
287
|
+
/** Returns position state of the step with the given index. */
|
|
288
|
+
_getAnimationDirection(index) {
|
|
289
|
+
const position = index - this._selectedIndex;
|
|
290
|
+
if (position < 0) {
|
|
291
|
+
return this._layoutDirection() === 'rtl' ? 'next' : 'previous';
|
|
241
292
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
// @breaking-change 8.0.0 Change return type to `CdkStep | undefined`.
|
|
245
|
-
return this.steps ? this.steps.toArray()[this.selectedIndex] : undefined;
|
|
246
|
-
}
|
|
247
|
-
set selected(step) {
|
|
248
|
-
this.selectedIndex = this.steps ? this.steps.toArray().indexOf(step) : -1;
|
|
249
|
-
}
|
|
250
|
-
ngAfterViewInit() {
|
|
251
|
-
// Note that while the step headers are content children by default, any components that
|
|
252
|
-
// extend this one might have them as view children. We initialize the keyboard handling in
|
|
253
|
-
// AfterViewInit so we're guaranteed for both view and content children to be defined.
|
|
254
|
-
this._keyManager = new FocusKeyManager(this._stepHeader)
|
|
255
|
-
.withWrap()
|
|
256
|
-
.withVerticalOrientation(this._orientation === 'vertical');
|
|
257
|
-
(this._dir ? this._dir.change : of())
|
|
258
|
-
.pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))
|
|
259
|
-
.subscribe(direction => this._keyManager.withHorizontalOrientation(direction));
|
|
260
|
-
this._keyManager.updateActiveItem(this._selectedIndex);
|
|
261
|
-
this.steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => {
|
|
262
|
-
if (!this.selected) {
|
|
263
|
-
this._selectedIndex = Math.max(this._selectedIndex - 1, 0);
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
ngOnDestroy() {
|
|
268
|
-
this._destroyed.next();
|
|
269
|
-
this._destroyed.complete();
|
|
270
|
-
}
|
|
271
|
-
/** Selects and focuses the next step in list. */
|
|
272
|
-
next() {
|
|
273
|
-
this.selectedIndex = Math.min(this._selectedIndex + 1, this.steps.length - 1);
|
|
274
|
-
}
|
|
275
|
-
/** Selects and focuses the previous step in list. */
|
|
276
|
-
previous() {
|
|
277
|
-
this.selectedIndex = Math.max(this._selectedIndex - 1, 0);
|
|
293
|
+
else if (position > 0) {
|
|
294
|
+
return this._layoutDirection() === 'rtl' ? 'previous' : 'next';
|
|
278
295
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
296
|
+
return 'current';
|
|
297
|
+
}
|
|
298
|
+
/** Returns the type of icon to be displayed. */
|
|
299
|
+
_getIndicatorType(index, state = STEP_STATE.NUMBER) {
|
|
300
|
+
const step = this.steps.toArray()[index];
|
|
301
|
+
const isCurrentStep = this._isCurrentStep(index);
|
|
302
|
+
return step._displayDefaultIndicatorType ? this._getDefaultIndicatorLogic(step, isCurrentStep) :
|
|
303
|
+
this._getGuidelineLogic(step, isCurrentStep, state);
|
|
304
|
+
}
|
|
305
|
+
_getDefaultIndicatorLogic(step, isCurrentStep) {
|
|
306
|
+
if (step._showError && step.hasError && !isCurrentStep) {
|
|
307
|
+
return STEP_STATE.ERROR;
|
|
284
308
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
return `cdk-step-label-${this._groupId}-${i}`;
|
|
309
|
+
else if (!step.completed || isCurrentStep) {
|
|
310
|
+
return STEP_STATE.NUMBER;
|
|
288
311
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
return `cdk-step-content-${this._groupId}-${i}`;
|
|
312
|
+
else {
|
|
313
|
+
return step.editable ? STEP_STATE.EDIT : STEP_STATE.DONE;
|
|
292
314
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
315
|
+
}
|
|
316
|
+
_getGuidelineLogic(step, isCurrentStep, state = STEP_STATE.NUMBER) {
|
|
317
|
+
if (step._showError && step.hasError && !isCurrentStep) {
|
|
318
|
+
return STEP_STATE.ERROR;
|
|
296
319
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const position = index - this._selectedIndex;
|
|
300
|
-
if (position < 0) {
|
|
301
|
-
return this._layoutDirection() === 'rtl' ? 'next' : 'previous';
|
|
302
|
-
}
|
|
303
|
-
else if (position > 0) {
|
|
304
|
-
return this._layoutDirection() === 'rtl' ? 'previous' : 'next';
|
|
305
|
-
}
|
|
306
|
-
return 'current';
|
|
320
|
+
else if (step.completed && !isCurrentStep) {
|
|
321
|
+
return STEP_STATE.DONE;
|
|
307
322
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
const step = this.steps.toArray()[index];
|
|
311
|
-
const isCurrentStep = this._isCurrentStep(index);
|
|
312
|
-
return step._displayDefaultIndicatorType ? this._getDefaultIndicatorLogic(step, isCurrentStep) :
|
|
313
|
-
this._getGuidelineLogic(step, isCurrentStep, state);
|
|
323
|
+
else if (step.completed && isCurrentStep) {
|
|
324
|
+
return state;
|
|
314
325
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
return STEP_STATE.ERROR;
|
|
318
|
-
}
|
|
319
|
-
else if (!step.completed || isCurrentStep) {
|
|
320
|
-
return STEP_STATE.NUMBER;
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
return step.editable ? STEP_STATE.EDIT : STEP_STATE.DONE;
|
|
324
|
-
}
|
|
326
|
+
else if (step.editable && isCurrentStep) {
|
|
327
|
+
return STEP_STATE.EDIT;
|
|
325
328
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
return STEP_STATE.ERROR;
|
|
329
|
-
}
|
|
330
|
-
else if (step.completed && !isCurrentStep) {
|
|
331
|
-
return STEP_STATE.DONE;
|
|
332
|
-
}
|
|
333
|
-
else if (step.completed && isCurrentStep) {
|
|
334
|
-
return state;
|
|
335
|
-
}
|
|
336
|
-
else if (step.editable && isCurrentStep) {
|
|
337
|
-
return STEP_STATE.EDIT;
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
return state;
|
|
341
|
-
}
|
|
329
|
+
else {
|
|
330
|
+
return state;
|
|
342
331
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
332
|
+
}
|
|
333
|
+
_isCurrentStep(index) {
|
|
334
|
+
return this._selectedIndex === index;
|
|
335
|
+
}
|
|
336
|
+
/** Returns the index of the currently-focused step header. */
|
|
337
|
+
_getFocusIndex() {
|
|
338
|
+
return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;
|
|
339
|
+
}
|
|
340
|
+
_updateSelectedItemIndex(newIndex) {
|
|
341
|
+
const stepsArray = this.steps.toArray();
|
|
342
|
+
this.selectionChange.emit({
|
|
343
|
+
selectedIndex: newIndex,
|
|
344
|
+
previouslySelectedIndex: this._selectedIndex,
|
|
345
|
+
selectedStep: stepsArray[newIndex],
|
|
346
|
+
previouslySelectedStep: stepsArray[this._selectedIndex],
|
|
347
|
+
});
|
|
348
|
+
// If focus is inside the stepper, move it to the next header, otherwise it may become
|
|
349
|
+
// lost when the active step content is hidden. We can't be more granular with the check
|
|
350
|
+
// (e.g. checking whether focus is inside the active step), because we don't have a
|
|
351
|
+
// reference to the elements that are rendering out the content.
|
|
352
|
+
this._containsFocus() ? this._keyManager.setActiveItem(newIndex) :
|
|
353
|
+
this._keyManager.updateActiveItem(newIndex);
|
|
354
|
+
this._selectedIndex = newIndex;
|
|
355
|
+
this._stateChanged();
|
|
356
|
+
}
|
|
357
|
+
_onKeydown(event) {
|
|
358
|
+
const hasModifier = hasModifierKey(event);
|
|
359
|
+
const keyCode = event.keyCode;
|
|
360
|
+
const manager = this._keyManager;
|
|
361
|
+
if (manager.activeItemIndex != null && !hasModifier &&
|
|
362
|
+
(keyCode === SPACE || keyCode === ENTER)) {
|
|
363
|
+
this.selectedIndex = manager.activeItemIndex;
|
|
364
|
+
event.preventDefault();
|
|
365
|
+
}
|
|
366
|
+
else if (keyCode === HOME) {
|
|
367
|
+
manager.setFirstItemActive();
|
|
368
|
+
event.preventDefault();
|
|
369
|
+
}
|
|
370
|
+
else if (keyCode === END) {
|
|
371
|
+
manager.setLastItemActive();
|
|
372
|
+
event.preventDefault();
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
manager.onKeydown(event);
|
|
349
376
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
377
|
+
}
|
|
378
|
+
_anyControlsInvalidOrPending(index) {
|
|
379
|
+
const steps = this.steps.toArray();
|
|
380
|
+
steps[this._selectedIndex].interacted = true;
|
|
381
|
+
if (this._linear && index >= 0) {
|
|
382
|
+
return steps.slice(0, index).some(step => {
|
|
383
|
+
const control = step.stepControl;
|
|
384
|
+
const isIncomplete = control ? (control.invalid || control.pending || !step.interacted) : !step.completed;
|
|
385
|
+
return isIncomplete && !step.optional && !step._completedOverride;
|
|
357
386
|
});
|
|
358
|
-
// If focus is inside the stepper, move it to the next header, otherwise it may become
|
|
359
|
-
// lost when the active step content is hidden. We can't be more granular with the check
|
|
360
|
-
// (e.g. checking whether focus is inside the active step), because we don't have a
|
|
361
|
-
// reference to the elements that are rendering out the content.
|
|
362
|
-
this._containsFocus() ? this._keyManager.setActiveItem(newIndex) :
|
|
363
|
-
this._keyManager.updateActiveItem(newIndex);
|
|
364
|
-
this._selectedIndex = newIndex;
|
|
365
|
-
this._stateChanged();
|
|
366
387
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
else if (keyCode === HOME) {
|
|
377
|
-
manager.setFirstItemActive();
|
|
378
|
-
event.preventDefault();
|
|
379
|
-
}
|
|
380
|
-
else if (keyCode === END) {
|
|
381
|
-
manager.setLastItemActive();
|
|
382
|
-
event.preventDefault();
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
manager.onKeydown(event);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
_anyControlsInvalidOrPending(index) {
|
|
389
|
-
const steps = this.steps.toArray();
|
|
390
|
-
steps[this._selectedIndex].interacted = true;
|
|
391
|
-
if (this._linear && index >= 0) {
|
|
392
|
-
return steps.slice(0, index).some(step => {
|
|
393
|
-
const control = step.stepControl;
|
|
394
|
-
const isIncomplete = control ? (control.invalid || control.pending || !step.interacted) : !step.completed;
|
|
395
|
-
return isIncomplete && !step.optional && !step._completedOverride;
|
|
396
|
-
});
|
|
397
|
-
}
|
|
388
|
+
return false;
|
|
389
|
+
}
|
|
390
|
+
_layoutDirection() {
|
|
391
|
+
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
|
|
392
|
+
}
|
|
393
|
+
/** Checks whether the stepper contains the focused element. */
|
|
394
|
+
_containsFocus() {
|
|
395
|
+
if (!this._document || !this._elementRef) {
|
|
398
396
|
return false;
|
|
399
397
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
/** Checks whether the stepper contains the focused element. */
|
|
404
|
-
_containsFocus() {
|
|
405
|
-
if (!this._document || !this._elementRef) {
|
|
406
|
-
return false;
|
|
407
|
-
}
|
|
408
|
-
const stepperElement = this._elementRef.nativeElement;
|
|
409
|
-
const focusedElement = this._document.activeElement;
|
|
410
|
-
return stepperElement === focusedElement || stepperElement.contains(focusedElement);
|
|
411
|
-
}
|
|
398
|
+
const stepperElement = this._elementRef.nativeElement;
|
|
399
|
+
const focusedElement = this._document.activeElement;
|
|
400
|
+
return stepperElement === focusedElement || stepperElement.contains(focusedElement);
|
|
412
401
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
]
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
})();
|
|
402
|
+
}
|
|
403
|
+
CdkStepper.decorators = [
|
|
404
|
+
{ type: Directive, args: [{
|
|
405
|
+
selector: '[cdkStepper]',
|
|
406
|
+
exportAs: 'cdkStepper',
|
|
407
|
+
},] }
|
|
408
|
+
];
|
|
409
|
+
CdkStepper.ctorParameters = () => [
|
|
410
|
+
{ type: Directionality, decorators: [{ type: Optional }] },
|
|
411
|
+
{ type: ChangeDetectorRef },
|
|
412
|
+
{ type: ElementRef },
|
|
413
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
414
|
+
];
|
|
415
|
+
CdkStepper.propDecorators = {
|
|
416
|
+
_steps: [{ type: ContentChildren, args: [CdkStep, { descendants: true },] }],
|
|
417
|
+
_stepHeader: [{ type: ContentChildren, args: [CdkStepHeader, { descendants: true },] }],
|
|
418
|
+
linear: [{ type: Input }],
|
|
419
|
+
selectedIndex: [{ type: Input }],
|
|
420
|
+
selected: [{ type: Input }],
|
|
421
|
+
selectionChange: [{ type: Output }]
|
|
422
|
+
};
|
|
435
423
|
|
|
436
424
|
/**
|
|
437
425
|
* @license
|
|
@@ -441,73 +429,67 @@ let CdkStepper = /** @class */ (() => {
|
|
|
441
429
|
* found in the LICENSE file at https://angular.io/license
|
|
442
430
|
*/
|
|
443
431
|
/** Button that moves to the next step in a stepper workflow. */
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
this.type = 'submit';
|
|
450
|
-
}
|
|
451
|
-
// We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
|
|
452
|
-
// In Ivy the `host` bindings will be merged when this class is extended, whereas in
|
|
453
|
-
// ViewEngine they're overwritten.
|
|
454
|
-
// TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
|
|
455
|
-
// tslint:disable-next-line:no-host-decorator-in-concrete
|
|
456
|
-
_handleClick() {
|
|
457
|
-
this._stepper.next();
|
|
458
|
-
}
|
|
432
|
+
class CdkStepperNext {
|
|
433
|
+
constructor(_stepper) {
|
|
434
|
+
this._stepper = _stepper;
|
|
435
|
+
/** Type of the next button. Defaults to "submit" if not specified. */
|
|
436
|
+
this.type = 'submit';
|
|
459
437
|
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
438
|
+
// We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
|
|
439
|
+
// In Ivy the `host` bindings will be merged when this class is extended, whereas in
|
|
440
|
+
// ViewEngine they're overwritten.
|
|
441
|
+
// TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
|
|
442
|
+
// tslint:disable-next-line:no-host-decorator-in-concrete
|
|
443
|
+
_handleClick() {
|
|
444
|
+
this._stepper.next();
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
CdkStepperNext.decorators = [
|
|
448
|
+
{ type: Directive, args: [{
|
|
449
|
+
selector: 'button[cdkStepperNext]',
|
|
450
|
+
host: {
|
|
451
|
+
'[type]': 'type',
|
|
452
|
+
}
|
|
453
|
+
},] }
|
|
454
|
+
];
|
|
455
|
+
CdkStepperNext.ctorParameters = () => [
|
|
456
|
+
{ type: CdkStepper }
|
|
457
|
+
];
|
|
458
|
+
CdkStepperNext.propDecorators = {
|
|
459
|
+
type: [{ type: Input }],
|
|
460
|
+
_handleClick: [{ type: HostListener, args: ['click',] }]
|
|
461
|
+
};
|
|
477
462
|
/** Button that moves to the previous step in a stepper workflow. */
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
this._stepper.previous();
|
|
492
|
-
}
|
|
463
|
+
class CdkStepperPrevious {
|
|
464
|
+
constructor(_stepper) {
|
|
465
|
+
this._stepper = _stepper;
|
|
466
|
+
/** Type of the previous button. Defaults to "button" if not specified. */
|
|
467
|
+
this.type = 'button';
|
|
468
|
+
}
|
|
469
|
+
// We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
|
|
470
|
+
// In Ivy the `host` bindings will be merged when this class is extended, whereas in
|
|
471
|
+
// ViewEngine they're overwritten.
|
|
472
|
+
// TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
|
|
473
|
+
// tslint:disable-next-line:no-host-decorator-in-concrete
|
|
474
|
+
_handleClick() {
|
|
475
|
+
this._stepper.previous();
|
|
493
476
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
})();
|
|
477
|
+
}
|
|
478
|
+
CdkStepperPrevious.decorators = [
|
|
479
|
+
{ type: Directive, args: [{
|
|
480
|
+
selector: 'button[cdkStepperPrevious]',
|
|
481
|
+
host: {
|
|
482
|
+
'[type]': 'type',
|
|
483
|
+
}
|
|
484
|
+
},] }
|
|
485
|
+
];
|
|
486
|
+
CdkStepperPrevious.ctorParameters = () => [
|
|
487
|
+
{ type: CdkStepper }
|
|
488
|
+
];
|
|
489
|
+
CdkStepperPrevious.propDecorators = {
|
|
490
|
+
type: [{ type: Input }],
|
|
491
|
+
_handleClick: [{ type: HostListener, args: ['click',] }]
|
|
492
|
+
};
|
|
511
493
|
|
|
512
494
|
/**
|
|
513
495
|
* @license
|
|
@@ -516,32 +498,29 @@ let CdkStepperPrevious = /** @class */ (() => {
|
|
|
516
498
|
* Use of this source code is governed by an MIT-style license that can be
|
|
517
499
|
* found in the LICENSE file at https://angular.io/license
|
|
518
500
|
*/
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
];
|
|
543
|
-
return CdkStepperModule;
|
|
544
|
-
})();
|
|
501
|
+
class CdkStepperModule {
|
|
502
|
+
}
|
|
503
|
+
CdkStepperModule.decorators = [
|
|
504
|
+
{ type: NgModule, args: [{
|
|
505
|
+
imports: [BidiModule],
|
|
506
|
+
exports: [
|
|
507
|
+
CdkStep,
|
|
508
|
+
CdkStepper,
|
|
509
|
+
CdkStepHeader,
|
|
510
|
+
CdkStepLabel,
|
|
511
|
+
CdkStepperNext,
|
|
512
|
+
CdkStepperPrevious,
|
|
513
|
+
],
|
|
514
|
+
declarations: [
|
|
515
|
+
CdkStep,
|
|
516
|
+
CdkStepper,
|
|
517
|
+
CdkStepHeader,
|
|
518
|
+
CdkStepLabel,
|
|
519
|
+
CdkStepperNext,
|
|
520
|
+
CdkStepperPrevious,
|
|
521
|
+
]
|
|
522
|
+
},] }
|
|
523
|
+
];
|
|
545
524
|
|
|
546
525
|
/**
|
|
547
526
|
* @license
|