@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.
Files changed (242) hide show
  1. package/a11y/aria-describer/aria-describer.d.ts +10 -1
  2. package/a11y/focus-trap/focus-trap.d.ts +4 -2
  3. package/a11y/index.metadata.json +1 -1
  4. package/a11y/interactivity-checker/interactivity-checker.d.ts +11 -1
  5. package/a11y/key-manager/list-key-manager.d.ts +6 -0
  6. package/accordion/accordion.d.ts +7 -1
  7. package/accordion/index.d.ts +1 -0
  8. package/accordion/index.metadata.json +1 -1
  9. package/bundles/cdk-a11y.umd.js +78 -15
  10. package/bundles/cdk-a11y.umd.js.map +1 -1
  11. package/bundles/cdk-a11y.umd.min.js +11 -11
  12. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  13. package/bundles/cdk-accordion.umd.js +12 -4
  14. package/bundles/cdk-accordion.umd.js.map +1 -1
  15. package/bundles/cdk-accordion.umd.min.js +2 -2
  16. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  17. package/bundles/cdk-drag-drop.umd.js +717 -641
  18. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  19. package/bundles/cdk-drag-drop.umd.min.js +8 -16
  20. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  21. package/bundles/cdk-overlay.umd.js +199 -42
  22. package/bundles/cdk-overlay.umd.js.map +1 -1
  23. package/bundles/cdk-overlay.umd.min.js +11 -18
  24. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  25. package/bundles/cdk-platform.umd.js +0 -1
  26. package/bundles/cdk-platform.umd.js.map +1 -1
  27. package/bundles/cdk-platform.umd.min.js +2 -2
  28. package/bundles/cdk-platform.umd.min.js.map +1 -1
  29. package/bundles/cdk-scrolling.umd.js +26 -4
  30. package/bundles/cdk-scrolling.umd.js.map +1 -1
  31. package/bundles/cdk-scrolling.umd.min.js +11 -4
  32. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  33. package/bundles/cdk-testing-protractor.umd.min.js +1 -1
  34. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  35. package/bundles/cdk-testing-testbed.umd.min.js +8 -8
  36. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  37. package/bundles/cdk-testing.umd.js +32 -0
  38. package/bundles/cdk-testing.umd.js.map +1 -1
  39. package/bundles/cdk-testing.umd.min.js +5 -5
  40. package/bundles/cdk-testing.umd.min.js.map +1 -1
  41. package/bundles/cdk-tree.umd.js +6 -2
  42. package/bundles/cdk-tree.umd.js.map +1 -1
  43. package/bundles/cdk-tree.umd.min.js +3 -3
  44. package/bundles/cdk-tree.umd.min.js.map +1 -1
  45. package/bundles/cdk.umd.js +1 -1
  46. package/bundles/cdk.umd.js.map +1 -1
  47. package/bundles/cdk.umd.min.js +1 -1
  48. package/bundles/cdk.umd.min.js.map +1 -1
  49. package/drag-drop/directives/drag-handle.d.ts +7 -1
  50. package/drag-drop/directives/drag-placeholder.d.ts +7 -1
  51. package/drag-drop/directives/drag-preview.d.ts +7 -1
  52. package/drag-drop/directives/drag.d.ts +4 -14
  53. package/drag-drop/directives/drop-list-group.d.ts +7 -1
  54. package/drag-drop/directives/drop-list.d.ts +7 -1
  55. package/drag-drop/drag-ref.d.ts +6 -0
  56. package/drag-drop/drop-list-ref.d.ts +3 -2
  57. package/drag-drop/index.d.ts +2 -2
  58. package/drag-drop/index.metadata.json +1 -1
  59. package/esm2015/a11y/a11y-module.js +15 -19
  60. package/esm2015/a11y/aria-describer/aria-describer.js +177 -167
  61. package/esm2015/a11y/focus-monitor/focus-monitor.js +337 -345
  62. package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +30 -34
  63. package/esm2015/a11y/focus-trap/focus-trap-manager.js +36 -40
  64. package/esm2015/a11y/focus-trap/focus-trap.js +85 -82
  65. package/esm2015/a11y/high-contrast-mode/high-contrast-mode-detector.js +56 -60
  66. package/esm2015/a11y/interactivity-checker/interactivity-checker.js +113 -104
  67. package/esm2015/a11y/key-manager/list-key-manager.js +29 -4
  68. package/esm2015/a11y/live-announcer/live-announcer.js +138 -146
  69. package/esm2015/accordion/accordion-item.js +119 -123
  70. package/esm2015/accordion/accordion-module.js +9 -13
  71. package/esm2015/accordion/accordion.js +49 -46
  72. package/esm2015/accordion/index.js +2 -1
  73. package/esm2015/bidi/bidi-module.js +9 -13
  74. package/esm2015/bidi/dir.js +41 -45
  75. package/esm2015/bidi/directionality.js +27 -31
  76. package/esm2015/clipboard/clipboard-module.js +9 -13
  77. package/esm2015/clipboard/clipboard.js +36 -40
  78. package/esm2015/clipboard/copy-to-clipboard.js +71 -75
  79. package/esm2015/collections/unique-selection-dispatcher.js +33 -37
  80. package/esm2015/drag-drop/directives/drag-handle.js +42 -39
  81. package/esm2015/drag-drop/directives/drag-placeholder.js +24 -21
  82. package/esm2015/drag-drop/directives/drag-preview.js +29 -26
  83. package/esm2015/drag-drop/directives/drag.js +313 -319
  84. package/esm2015/drag-drop/directives/drop-list-group.js +32 -29
  85. package/esm2015/drag-drop/directives/drop-list.js +251 -250
  86. package/esm2015/drag-drop/drag-drop-module.js +27 -31
  87. package/esm2015/drag-drop/drag-drop-registry.js +139 -143
  88. package/esm2015/drag-drop/drag-drop.js +33 -37
  89. package/esm2015/drag-drop/drag-ref.js +59 -25
  90. package/esm2015/drag-drop/drop-list-ref.js +15 -9
  91. package/esm2015/drag-drop/index.js +3 -2
  92. package/esm2015/layout/breakpoints-observer.js +81 -85
  93. package/esm2015/layout/layout-module.js +6 -10
  94. package/esm2015/layout/media-matcher.js +28 -32
  95. package/esm2015/observers/observe-content.js +147 -163
  96. package/esm2015/overlay/dispatchers/base-overlay-dispatcher.js +51 -0
  97. package/esm2015/overlay/dispatchers/index.js +10 -0
  98. package/esm2015/overlay/dispatchers/overlay-keyboard-dispatcher.js +79 -0
  99. package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +94 -0
  100. package/esm2015/overlay/fullscreen-overlay-container.js +70 -74
  101. package/esm2015/overlay/index.js +5 -4
  102. package/esm2015/overlay/overlay-config.js +5 -1
  103. package/esm2015/overlay/overlay-container.js +69 -73
  104. package/esm2015/overlay/overlay-directives.js +245 -243
  105. package/esm2015/overlay/overlay-module.js +15 -19
  106. package/esm2015/overlay/overlay-ref.js +24 -2
  107. package/esm2015/overlay/overlay-reference.js +1 -1
  108. package/esm2015/overlay/overlay.js +93 -92
  109. package/esm2015/overlay/position/connected-position.js +14 -18
  110. package/esm2015/overlay/position/overlay-position-builder.js +43 -47
  111. package/esm2015/overlay/public-api.js +2 -2
  112. package/esm2015/overlay/scroll/scroll-strategy-options.js +33 -37
  113. package/esm2015/platform/features/scrolling.js +1 -2
  114. package/esm2015/platform/platform-module.js +6 -10
  115. package/esm2015/platform/platform.js +48 -52
  116. package/esm2015/portal/portal-directives.js +181 -201
  117. package/esm2015/scrolling/fixed-size-virtual-scroll.js +57 -47
  118. package/esm2015/scrolling/public-api.js +2 -1
  119. package/esm2015/scrolling/scroll-dispatcher.js +139 -143
  120. package/esm2015/scrolling/scrollable.js +135 -139
  121. package/esm2015/scrolling/scrolling-module.js +32 -40
  122. package/esm2015/scrolling/viewport-ruler.js +105 -109
  123. package/esm2015/scrolling/virtual-for-of.js +264 -268
  124. package/esm2015/scrolling/virtual-scroll-repeater.js +8 -0
  125. package/esm2015/scrolling/virtual-scroll-viewport.js +318 -322
  126. package/esm2015/stepper/step-header.js +20 -24
  127. package/esm2015/stepper/step-label.js +13 -17
  128. package/esm2015/stepper/stepper-button.js +59 -67
  129. package/esm2015/stepper/stepper-module.js +24 -28
  130. package/esm2015/stepper/stepper.js +313 -321
  131. package/esm2015/table/cell.js +129 -157
  132. package/esm2015/table/row.js +183 -219
  133. package/esm2015/table/table-module.js +9 -13
  134. package/esm2015/table/table.js +765 -785
  135. package/esm2015/table/text-column.js +85 -89
  136. package/esm2015/testing/component-harness.js +19 -1
  137. package/esm2015/testing/harness-environment.js +7 -1
  138. package/esm2015/text-field/autofill.js +89 -97
  139. package/esm2015/text-field/autosize.js +225 -229
  140. package/esm2015/text-field/text-field-module.js +10 -14
  141. package/esm2015/tree/control/nested-tree-control.js +7 -3
  142. package/esm2015/tree/nested-node.js +79 -83
  143. package/esm2015/tree/node.js +17 -21
  144. package/esm2015/tree/outlet.js +15 -19
  145. package/esm2015/tree/padding.js +88 -92
  146. package/esm2015/tree/toggle.js +32 -36
  147. package/esm2015/tree/tree-module.js +10 -14
  148. package/esm2015/tree/tree.js +266 -274
  149. package/esm2015/version.js +1 -1
  150. package/fesm2015/a11y.js +1021 -996
  151. package/fesm2015/a11y.js.map +1 -1
  152. package/fesm2015/accordion.js +173 -175
  153. package/fesm2015/accordion.js.map +1 -1
  154. package/fesm2015/bidi.js +74 -83
  155. package/fesm2015/bidi.js.map +1 -1
  156. package/fesm2015/cdk.js +1 -1
  157. package/fesm2015/cdk.js.map +1 -1
  158. package/fesm2015/clipboard.js +113 -122
  159. package/fesm2015/clipboard.js.map +1 -1
  160. package/fesm2015/collections.js +32 -35
  161. package/fesm2015/collections.js.map +1 -1
  162. package/fesm2015/drag-drop.js +1005 -961
  163. package/fesm2015/drag-drop.js.map +1 -1
  164. package/fesm2015/layout.js +111 -120
  165. package/fesm2015/layout.js.map +1 -1
  166. package/fesm2015/observers.js +146 -158
  167. package/fesm2015/observers.js.map +1 -1
  168. package/fesm2015/overlay.js +793 -659
  169. package/fesm2015/overlay.js.map +1 -1
  170. package/fesm2015/platform.js +52 -59
  171. package/fesm2015/platform.js.map +1 -1
  172. package/fesm2015/portal.js +180 -195
  173. package/fesm2015/portal.js.map +1 -1
  174. package/fesm2015/scrolling.js +1058 -1060
  175. package/fesm2015/scrolling.js.map +1 -1
  176. package/fesm2015/stepper.js +424 -445
  177. package/fesm2015/stepper.js.map +1 -1
  178. package/fesm2015/table.js +1178 -1247
  179. package/fesm2015/table.js.map +1 -1
  180. package/fesm2015/testing.js +25 -1
  181. package/fesm2015/testing.js.map +1 -1
  182. package/fesm2015/text-field.js +318 -330
  183. package/fesm2015/text-field.js.map +1 -1
  184. package/fesm2015/tree.js +517 -537
  185. package/fesm2015/tree.js.map +1 -1
  186. package/overlay/dispatchers/base-overlay-dispatcher.d.ts +28 -0
  187. package/overlay/dispatchers/index.d.ts +9 -0
  188. package/overlay/{keyboard → dispatchers}/overlay-keyboard-dispatcher.d.ts +4 -10
  189. package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +27 -0
  190. package/overlay/index.d.ts +4 -3
  191. package/overlay/index.metadata.json +1 -1
  192. package/overlay/overlay-config.d.ts +4 -0
  193. package/overlay/overlay-directives.d.ts +4 -0
  194. package/overlay/overlay-ref.d.ts +8 -2
  195. package/overlay/overlay-reference.d.ts +1 -0
  196. package/overlay/overlay.d.ts +4 -2
  197. package/overlay/public-api.d.ts +1 -1
  198. package/package.json +3 -3
  199. package/schematics/index.js +1 -1
  200. package/schematics/migration.json +5 -0
  201. package/schematics/ng-add/index.js +1 -1
  202. package/schematics/ng-update/data/index.js +1 -1
  203. package/schematics/ng-update/devkit-file-system.d.ts +5 -5
  204. package/schematics/ng-update/devkit-file-system.js +21 -16
  205. package/schematics/ng-update/devkit-migration-rule.js +13 -20
  206. package/schematics/ng-update/devkit-migration.d.ts +0 -2
  207. package/schematics/ng-update/devkit-migration.js +1 -1
  208. package/schematics/ng-update/find-stylesheets.d.ts +10 -0
  209. package/schematics/ng-update/find-stylesheets.js +31 -0
  210. package/schematics/ng-update/index.d.ts +2 -0
  211. package/schematics/ng-update/index.js +7 -2
  212. package/schematics/ng-update/migrations/attribute-selectors.js +3 -3
  213. package/schematics/ng-update/migrations/css-selectors.js +3 -3
  214. package/schematics/ng-update/migrations/element-selectors.js +3 -3
  215. package/schematics/ng-update/public-api.js +1 -1
  216. package/schematics/update-tool/component-resource-collector.d.ts +1 -1
  217. package/schematics/update-tool/component-resource-collector.js +18 -14
  218. package/schematics/update-tool/file-system.d.ts +19 -14
  219. package/schematics/update-tool/file-system.js +1 -1
  220. package/schematics/update-tool/index.d.ts +21 -3
  221. package/schematics/update-tool/index.js +29 -23
  222. package/schematics/update-tool/public-api.js +1 -1
  223. package/schematics/update-tool/target-version.d.ts +2 -1
  224. package/schematics/update-tool/target-version.js +5 -3
  225. package/schematics/update-tool/utils/parse-tsconfig.d.ts +2 -1
  226. package/schematics/update-tool/utils/parse-tsconfig.js +6 -10
  227. package/schematics/update-tool/utils/virtual-host.d.ts +34 -0
  228. package/schematics/update-tool/utils/virtual-host.js +62 -0
  229. package/schematics/update-tool/version-changes.js +4 -6
  230. package/schematics/utils/index.js +1 -1
  231. package/schematics/utils/project-tsconfig-paths.d.ts +2 -1
  232. package/schematics/utils/project-tsconfig-paths.js +1 -1
  233. package/scrolling/index.metadata.json +1 -1
  234. package/scrolling/public-api.d.ts +1 -0
  235. package/scrolling/virtual-for-of.d.ts +2 -1
  236. package/scrolling/virtual-scroll-repeater.d.ts +16 -0
  237. package/scrolling/virtual-scroll-viewport.d.ts +4 -4
  238. package/testing/component-harness.d.ts +12 -0
  239. package/testing/harness-environment.d.ts +1 -0
  240. package/tree/control/nested-tree-control.d.ts +7 -2
  241. package/tree/index.metadata.json +1 -1
  242. package/esm2015/overlay/keyboard/overlay-keyboard-dispatcher.js +0 -100
@@ -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
- let CdkStepHeader = /** @class */ (() => {
18
- class CdkStepHeader {
19
- constructor(_elementRef) {
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
- CdkStepHeader.decorators = [
28
- { type: Directive, args: [{
29
- selector: '[cdkStepHeader]',
30
- host: {
31
- 'role': 'tab',
32
- },
33
- },] }
34
- ];
35
- CdkStepHeader.ctorParameters = () => [
36
- { type: ElementRef }
37
- ];
38
- return CdkStepHeader;
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
- let CdkStepLabel = /** @class */ (() => {
49
- class CdkStepLabel {
50
- constructor(/** @docs-private */ template) {
51
- this.template = template;
52
- }
45
+ class CdkStepLabel {
46
+ constructor(/** @docs-private */ template) {
47
+ this.template = template;
53
48
  }
54
- CdkStepLabel.decorators = [
55
- { type: Directive, args: [{
56
- selector: '[cdkStepLabel]',
57
- },] }
58
- ];
59
- CdkStepLabel.ctorParameters = () => [
60
- { type: TemplateRef }
61
- ];
62
- return CdkStepLabel;
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
- let CdkStep = /** @class */ (() => {
93
- class CdkStep {
94
- /** @breaking-change 8.0.0 remove the `?` after `stepperOptions` */
95
- constructor(_stepper, stepperOptions) {
96
- this._stepper = _stepper;
97
- /** Whether user has seen the expanded step content or not. */
98
- this.interacted = false;
99
- this._editable = true;
100
- this._optional = false;
101
- this._completedOverride = null;
102
- this._customError = null;
103
- this._stepperOptions = stepperOptions ? stepperOptions : {};
104
- this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false;
105
- this._showError = !!this._stepperOptions.showError;
106
- }
107
- /** Whether the user can return to this step once it has been marked as completed. */
108
- get editable() {
109
- return this._editable;
110
- }
111
- set editable(value) {
112
- this._editable = coerceBooleanProperty(value);
113
- }
114
- /** Whether the completion of step is optional. */
115
- get optional() {
116
- return this._optional;
117
- }
118
- set optional(value) {
119
- this._optional = coerceBooleanProperty(value);
120
- }
121
- /** Whether step is marked as completed. */
122
- get completed() {
123
- return this._completedOverride == null ? this._getDefaultCompleted() : this._completedOverride;
124
- }
125
- set completed(value) {
126
- this._completedOverride = coerceBooleanProperty(value);
127
- }
128
- _getDefaultCompleted() {
129
- return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;
130
- }
131
- /** Whether step has an error. */
132
- get hasError() {
133
- return this._customError == null ? this._getDefaultError() : this._customError;
134
- }
135
- set hasError(value) {
136
- this._customError = coerceBooleanProperty(value);
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
- _getDefaultError() {
139
- return this.stepControl && this.stepControl.invalid && this.interacted;
144
+ if (this._customError != null) {
145
+ this._customError = false;
140
146
  }
141
- /** Selects this step component. */
142
- select() {
143
- this._stepper.selected = this;
147
+ if (this.stepControl) {
148
+ this.stepControl.reset();
144
149
  }
145
- /** Resets the step to its initial state. Note that this includes resetting form data. */
146
- reset() {
147
- this.interacted = false;
148
- if (this._completedOverride != null) {
149
- this._completedOverride = false;
150
- }
151
- if (this._customError != null) {
152
- this._customError = false;
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.stepControl) {
155
- this.stepControl.reset();
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
- ngOnChanges() {
159
- // Since basically all inputs of the MatStep get proxied through the view down to the
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
- CdkStep.decorators = [
165
- { type: Component, args: [{
166
- selector: 'cdk-step',
167
- exportAs: 'cdkStep',
168
- template: '<ng-template><ng-content></ng-content></ng-template>',
169
- encapsulation: ViewEncapsulation.None,
170
- changeDetection: ChangeDetectionStrategy.OnPush
171
- },] }
172
- ];
173
- CdkStep.ctorParameters = () => [
174
- { type: CdkStepper, decorators: [{ type: Inject, args: [forwardRef(() => CdkStepper),] }] },
175
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [STEPPER_GLOBAL_OPTIONS,] }] }
176
- ];
177
- CdkStep.propDecorators = {
178
- stepLabel: [{ type: ContentChild, args: [CdkStepLabel,] }],
179
- content: [{ type: ViewChild, args: [TemplateRef, { static: true },] }],
180
- stepControl: [{ type: Input }],
181
- label: [{ type: Input }],
182
- errorMessage: [{ type: Input }],
183
- ariaLabel: [{ type: Input, args: ['aria-label',] }],
184
- ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
185
- state: [{ type: Input }],
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
- /** The step that is selected. */
243
- get selected() {
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
- /** Resets the stepper to its initial state. Note that this includes clearing form data. */
280
- reset() {
281
- this._updateSelectedItemIndex(0);
282
- this.steps.forEach(step => step.reset());
283
- this._stateChanged();
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
- /** Returns a unique id for each step label element. */
286
- _getStepLabelId(i) {
287
- return `cdk-step-label-${this._groupId}-${i}`;
309
+ else if (!step.completed || isCurrentStep) {
310
+ return STEP_STATE.NUMBER;
288
311
  }
289
- /** Returns unique id for each step content element. */
290
- _getStepContentId(i) {
291
- return `cdk-step-content-${this._groupId}-${i}`;
312
+ else {
313
+ return step.editable ? STEP_STATE.EDIT : STEP_STATE.DONE;
292
314
  }
293
- /** Marks the component to be change detected. */
294
- _stateChanged() {
295
- this._changeDetectorRef.markForCheck();
315
+ }
316
+ _getGuidelineLogic(step, isCurrentStep, state = STEP_STATE.NUMBER) {
317
+ if (step._showError && step.hasError && !isCurrentStep) {
318
+ return STEP_STATE.ERROR;
296
319
  }
297
- /** Returns position state of the step with the given index. */
298
- _getAnimationDirection(index) {
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
- /** Returns the type of icon to be displayed. */
309
- _getIndicatorType(index, state = STEP_STATE.NUMBER) {
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
- _getDefaultIndicatorLogic(step, isCurrentStep) {
316
- if (step._showError && step.hasError && !isCurrentStep) {
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
- _getGuidelineLogic(step, isCurrentStep, state = STEP_STATE.NUMBER) {
327
- if (step._showError && step.hasError && !isCurrentStep) {
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
- _isCurrentStep(index) {
344
- return this._selectedIndex === index;
345
- }
346
- /** Returns the index of the currently-focused step header. */
347
- _getFocusIndex() {
348
- return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;
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
- _updateSelectedItemIndex(newIndex) {
351
- const stepsArray = this.steps.toArray();
352
- this.selectionChange.emit({
353
- selectedIndex: newIndex,
354
- previouslySelectedIndex: this._selectedIndex,
355
- selectedStep: stepsArray[newIndex],
356
- previouslySelectedStep: stepsArray[this._selectedIndex],
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
- _onKeydown(event) {
368
- const hasModifier = hasModifierKey(event);
369
- const keyCode = event.keyCode;
370
- const manager = this._keyManager;
371
- if (manager.activeItemIndex != null && !hasModifier &&
372
- (keyCode === SPACE || keyCode === ENTER)) {
373
- this.selectedIndex = manager.activeItemIndex;
374
- event.preventDefault();
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
- _layoutDirection() {
401
- return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
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
- CdkStepper.decorators = [
414
- { type: Directive, args: [{
415
- selector: '[cdkStepper]',
416
- exportAs: 'cdkStepper',
417
- },] }
418
- ];
419
- CdkStepper.ctorParameters = () => [
420
- { type: Directionality, decorators: [{ type: Optional }] },
421
- { type: ChangeDetectorRef },
422
- { type: ElementRef },
423
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
424
- ];
425
- CdkStepper.propDecorators = {
426
- _steps: [{ type: ContentChildren, args: [CdkStep, { descendants: true },] }],
427
- _stepHeader: [{ type: ContentChildren, args: [CdkStepHeader, { descendants: true },] }],
428
- linear: [{ type: Input }],
429
- selectedIndex: [{ type: Input }],
430
- selected: [{ type: Input }],
431
- selectionChange: [{ type: Output }]
432
- };
433
- return CdkStepper;
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
- let CdkStepperNext = /** @class */ (() => {
445
- class CdkStepperNext {
446
- constructor(_stepper) {
447
- this._stepper = _stepper;
448
- /** Type of the next button. Defaults to "submit" if not specified. */
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
- CdkStepperNext.decorators = [
461
- { type: Directive, args: [{
462
- selector: 'button[cdkStepperNext]',
463
- host: {
464
- '[type]': 'type',
465
- }
466
- },] }
467
- ];
468
- CdkStepperNext.ctorParameters = () => [
469
- { type: CdkStepper }
470
- ];
471
- CdkStepperNext.propDecorators = {
472
- type: [{ type: Input }],
473
- _handleClick: [{ type: HostListener, args: ['click',] }]
474
- };
475
- return CdkStepperNext;
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
- let CdkStepperPrevious = /** @class */ (() => {
479
- class CdkStepperPrevious {
480
- constructor(_stepper) {
481
- this._stepper = _stepper;
482
- /** Type of the previous button. Defaults to "button" if not specified. */
483
- this.type = 'button';
484
- }
485
- // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
486
- // In Ivy the `host` bindings will be merged when this class is extended, whereas in
487
- // ViewEngine they're overwritten.
488
- // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
489
- // tslint:disable-next-line:no-host-decorator-in-concrete
490
- _handleClick() {
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
- CdkStepperPrevious.decorators = [
495
- { type: Directive, args: [{
496
- selector: 'button[cdkStepperPrevious]',
497
- host: {
498
- '[type]': 'type',
499
- }
500
- },] }
501
- ];
502
- CdkStepperPrevious.ctorParameters = () => [
503
- { type: CdkStepper }
504
- ];
505
- CdkStepperPrevious.propDecorators = {
506
- type: [{ type: Input }],
507
- _handleClick: [{ type: HostListener, args: ['click',] }]
508
- };
509
- return CdkStepperPrevious;
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
- let CdkStepperModule = /** @class */ (() => {
520
- class CdkStepperModule {
521
- }
522
- CdkStepperModule.decorators = [
523
- { type: NgModule, args: [{
524
- imports: [BidiModule],
525
- exports: [
526
- CdkStep,
527
- CdkStepper,
528
- CdkStepHeader,
529
- CdkStepLabel,
530
- CdkStepperNext,
531
- CdkStepperPrevious,
532
- ],
533
- declarations: [
534
- CdkStep,
535
- CdkStepper,
536
- CdkStepHeader,
537
- CdkStepLabel,
538
- CdkStepperNext,
539
- CdkStepperPrevious,
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