@angular/cdk 7.1.1 → 7.2.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 (122) hide show
  1. package/bundles/cdk-a11y.umd.js +5 -1
  2. package/bundles/cdk-a11y.umd.js.map +1 -1
  3. package/bundles/cdk-a11y.umd.min.js +1 -1
  4. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  5. package/bundles/cdk-drag-drop.umd.js +2030 -1049
  6. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  7. package/bundles/cdk-drag-drop.umd.min.js +2 -1
  8. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  9. package/bundles/cdk-stepper.umd.js +11 -3
  10. package/bundles/cdk-stepper.umd.js.map +1 -1
  11. package/bundles/cdk-stepper.umd.min.js +1 -1
  12. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  13. package/bundles/cdk-text-field.umd.js +41 -16
  14. package/bundles/cdk-text-field.umd.js.map +1 -1
  15. package/bundles/cdk-text-field.umd.min.js +1 -1
  16. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  17. package/bundles/cdk-tree.umd.js +1 -1
  18. package/bundles/cdk-tree.umd.js.map +1 -1
  19. package/bundles/cdk-tree.umd.min.js +1 -1
  20. package/bundles/cdk-tree.umd.min.js.map +1 -1
  21. package/bundles/cdk.umd.js +1 -1
  22. package/bundles/cdk.umd.js.map +1 -1
  23. package/bundles/cdk.umd.min.js +1 -1
  24. package/bundles/cdk.umd.min.js.map +1 -1
  25. package/drag-drop/typings/{drag-handle.d.ts → directives/drag-handle.d.ts} +0 -0
  26. package/drag-drop/typings/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  27. package/drag-drop/typings/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  28. package/drag-drop/typings/directives/drag.d.ts +108 -0
  29. package/{typings/esm5/drag-drop → drag-drop/typings/directives}/drop-list-group.d.ts +3 -0
  30. package/drag-drop/typings/directives/drop-list.d.ts +135 -0
  31. package/drag-drop/typings/drag-drop-registry.d.ts +8 -3
  32. package/drag-drop/typings/drag-events.d.ts +14 -7
  33. package/{typings/esm5/drag-drop/drag.d.ts → drag-drop/typings/drag-ref.d.ts} +143 -82
  34. package/drag-drop/typings/drop-list-container.d.ts +19 -3
  35. package/drag-drop/typings/{drop-list.d.ts → drop-list-ref.d.ts} +132 -84
  36. package/drag-drop/typings/index.d.ts +1 -0
  37. package/drag-drop/typings/index.metadata.json +1 -1
  38. package/drag-drop/typings/public-api.d.ts +13 -6
  39. package/esm2015/a11y.js +5 -1
  40. package/esm2015/a11y.js.map +1 -1
  41. package/esm2015/cdk.js +1 -1
  42. package/esm2015/cdk.js.map +1 -1
  43. package/esm2015/drag-drop.js +1546 -811
  44. package/esm2015/drag-drop.js.map +1 -1
  45. package/esm2015/stepper.js +11 -4
  46. package/esm2015/stepper.js.map +1 -1
  47. package/esm2015/text-field.js +28 -16
  48. package/esm2015/text-field.js.map +1 -1
  49. package/esm2015/tree.js +2 -2
  50. package/esm2015/tree.js.map +1 -1
  51. package/esm5/a11y.es5.js +5 -1
  52. package/esm5/a11y.es5.js.map +1 -1
  53. package/esm5/cdk.es5.js +1 -1
  54. package/esm5/cdk.es5.js.map +1 -1
  55. package/esm5/drag-drop.es5.js +2025 -1045
  56. package/esm5/drag-drop.es5.js.map +1 -1
  57. package/esm5/stepper.es5.js +11 -4
  58. package/esm5/stepper.es5.js.map +1 -1
  59. package/esm5/text-field.es5.js +41 -16
  60. package/esm5/text-field.es5.js.map +1 -1
  61. package/esm5/tree.es5.js +2 -2
  62. package/esm5/tree.es5.js.map +1 -1
  63. package/package.json +4 -4
  64. package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
  65. package/schematics/ng-update/upgrade-data.js +2 -1
  66. package/schematics/ng-update/upgrade-data.js.map +1 -1
  67. package/schematics/ng-update/upgrade-rules/index.js +3 -2
  68. package/schematics/ng-update/upgrade-rules/index.js.map +1 -1
  69. package/schematics/utils/ast/ng-module-imports.d.ts +1 -1
  70. package/schematics/utils/ast/ng-module-imports.js +25 -13
  71. package/schematics/utils/ast/ng-module-imports.js.map +1 -1
  72. package/schematics/utils/get-project.js +2 -1
  73. package/schematics/utils/get-project.js.map +1 -1
  74. package/schematics/utils/parse5-element.js +3 -2
  75. package/schematics/utils/parse5-element.js.map +1 -1
  76. package/schematics/utils/project-targets.js +2 -1
  77. package/schematics/utils/project-targets.js.map +1 -1
  78. package/schematics/utils/version-agnostic-typescript.js +3 -2
  79. package/schematics/utils/version-agnostic-typescript.js.map +1 -1
  80. package/stepper/typings/index.metadata.json +1 -1
  81. package/stepper/typings/stepper.d.ts +6 -0
  82. package/text-field/typings/autosize.d.ts +6 -0
  83. package/text-field/typings/index.metadata.json +1 -1
  84. package/typings/drag-drop/{drag-handle.d.ts → directives/drag-handle.d.ts} +0 -0
  85. package/typings/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  86. package/typings/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  87. package/typings/drag-drop/directives/drag.d.ts +108 -0
  88. package/typings/drag-drop/{drop-list-group.d.ts → directives/drop-list-group.d.ts} +3 -0
  89. package/typings/drag-drop/directives/drop-list.d.ts +135 -0
  90. package/typings/drag-drop/drag-drop-registry.d.ts +8 -3
  91. package/typings/drag-drop/drag-events.d.ts +14 -7
  92. package/typings/drag-drop/{drag.d.ts → drag-ref.d.ts} +143 -82
  93. package/typings/drag-drop/drop-list-container.d.ts +19 -3
  94. package/typings/{esm5/drag-drop/drop-list.d.ts → drag-drop/drop-list-ref.d.ts} +132 -84
  95. package/typings/drag-drop/index.d.ts +1 -0
  96. package/typings/drag-drop/index.metadata.json +1 -1
  97. package/typings/drag-drop/public-api.d.ts +13 -6
  98. package/typings/esm5/drag-drop/{drag-handle.d.ts → directives/drag-handle.d.ts} +0 -0
  99. package/typings/esm5/drag-drop/{drag-placeholder.d.ts → directives/drag-placeholder.d.ts} +0 -0
  100. package/typings/esm5/drag-drop/{drag-preview.d.ts → directives/drag-preview.d.ts} +0 -0
  101. package/typings/esm5/drag-drop/directives/drag.d.ts +108 -0
  102. package/{drag-drop/typings → typings/esm5/drag-drop/directives}/drop-list-group.d.ts +3 -0
  103. package/typings/esm5/drag-drop/directives/drop-list.d.ts +135 -0
  104. package/typings/esm5/drag-drop/drag-drop-registry.d.ts +8 -3
  105. package/typings/esm5/drag-drop/drag-events.d.ts +14 -7
  106. package/{drag-drop/typings/drag.d.ts → typings/esm5/drag-drop/drag-ref.d.ts} +143 -82
  107. package/typings/esm5/drag-drop/drop-list-container.d.ts +19 -3
  108. package/typings/{drag-drop/drop-list.d.ts → esm5/drag-drop/drop-list-ref.d.ts} +132 -84
  109. package/typings/esm5/drag-drop/index.d.ts +1 -0
  110. package/typings/esm5/drag-drop/index.metadata.json +1 -1
  111. package/typings/esm5/drag-drop/public-api.d.ts +13 -6
  112. package/typings/esm5/index.metadata.json +1 -1
  113. package/typings/esm5/stepper/index.metadata.json +1 -1
  114. package/typings/esm5/stepper/stepper.d.ts +6 -0
  115. package/typings/esm5/text-field/autosize.d.ts +6 -0
  116. package/typings/esm5/text-field/index.metadata.json +1 -1
  117. package/typings/index.metadata.json +1 -1
  118. package/typings/schematics/utils/ast/ng-module-imports.d.ts +1 -1
  119. package/typings/stepper/index.metadata.json +1 -1
  120. package/typings/stepper/stepper.d.ts +6 -0
  121. package/typings/text-field/autosize.d.ts +6 -0
  122. package/typings/text-field/index.metadata.json +1 -1
@@ -100,7 +100,14 @@ var STEP_STATE = {
100
100
  * InjectionToken that can be used to specify the global stepper options.
101
101
  * @type {?}
102
102
  */
103
- var MAT_STEPPER_GLOBAL_OPTIONS = new core.InjectionToken('mat-stepper-global-options');
103
+ var STEPPER_GLOBAL_OPTIONS = new core.InjectionToken('STEPPER_GLOBAL_OPTIONS');
104
+ /**
105
+ * InjectionToken that can be used to specify the global stepper options.
106
+ * @deprecated Use `STEPPER_GLOBAL_OPTIONS` instead.
107
+ * \@breaking-change 8.0.0.
108
+ * @type {?}
109
+ */
110
+ var MAT_STEPPER_GLOBAL_OPTIONS = STEPPER_GLOBAL_OPTIONS;
104
111
  var CdkStep = /** @class */ (function () {
105
112
  /** @breaking-change 8.0.0 remove the `?` after `stepperOptions` */
106
113
  function CdkStep(_stepper, stepperOptions) {
@@ -188,7 +195,7 @@ var CdkStep = /** @class */ (function () {
188
195
  * @return {?}
189
196
  */
190
197
  function () {
191
- return this._customError || this._getDefaultError();
198
+ return this._customError == null ? this._getDefaultError() : this._customError;
192
199
  },
193
200
  set: /**
194
201
  * @param {?} value
@@ -266,7 +273,7 @@ var CdkStep = /** @class */ (function () {
266
273
  /** @nocollapse */
267
274
  CdkStep.ctorParameters = function () { return [
268
275
  { type: CdkStepper, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return CdkStepper; }),] }] },
269
- { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [MAT_STEPPER_GLOBAL_OPTIONS,] }] }
276
+ { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [STEPPER_GLOBAL_OPTIONS,] }] }
270
277
  ]; };
271
278
  CdkStep.propDecorators = {
272
279
  stepLabel: [{ type: core.ContentChild, args: [CdkStepLabel,] }],
@@ -844,6 +851,7 @@ var CdkStepperModule = /** @class */ (function () {
844
851
 
845
852
  exports.StepperSelectionEvent = StepperSelectionEvent;
846
853
  exports.STEP_STATE = STEP_STATE;
854
+ exports.STEPPER_GLOBAL_OPTIONS = STEPPER_GLOBAL_OPTIONS;
847
855
  exports.MAT_STEPPER_GLOBAL_OPTIONS = MAT_STEPPER_GLOBAL_OPTIONS;
848
856
  exports.CdkStep = CdkStep;
849
857
  exports.CdkStepper = CdkStepper;
@@ -1 +1 @@
1
- {"version":3,"file":"cdk-stepper.umd.js","sources":["../../src/cdk/stepper/stepper-module.ts","../../src/cdk/stepper/stepper-button.ts","../../src/cdk/stepper/stepper.ts","../../src/cdk/stepper/step-header.ts","../../src/cdk/stepper/step-label.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkStepper, CdkStep} from './stepper';\nimport {CommonModule} from '@angular/common';\nimport {CdkStepLabel} from './step-label';\nimport {CdkStepperNext, CdkStepperPrevious} from './stepper-button';\nimport {CdkStepHeader} from './step-header';\nimport {BidiModule} from '@angular/cdk/bidi';\n\n@NgModule({\n imports: [BidiModule, CommonModule],\n exports: [\n CdkStep,\n CdkStepper,\n CdkStepHeader,\n CdkStepLabel,\n CdkStepperNext,\n CdkStepperPrevious,\n ],\n declarations: [\n CdkStep,\n CdkStepper,\n CdkStepHeader,\n CdkStepLabel,\n CdkStepperNext,\n CdkStepperPrevious,\n ]\n})\nexport class CdkStepperModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, Input} from '@angular/core';\nimport {CdkStepper} from './stepper';\n\n/** Button that moves to the next step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperNext]',\n host: {\n '(click)': '_stepper.next()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperNext {\n /** Type of the next button. Defaults to \"submit\" if not specified. */\n @Input() type: string = 'submit';\n\n constructor(public _stepper: CdkStepper) {}\n}\n\n/** Button that moves to the previous step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperPrevious]',\n host: {\n '(click)': '_stepper.previous()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperPrevious {\n /** Type of the previous button. Defaults to \"button\" if not specified. */\n @Input() type: string = 'button';\n\n constructor(public _stepper: CdkStepper) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusableOption, FocusKeyManager} from '@angular/cdk/a11y';\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {END, ENTER, HOME, SPACE, hasModifierKey} from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n EventEmitter,\n ElementRef,\n forwardRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n InjectionToken,\n} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {AbstractControl} from '@angular/forms';\nimport {CdkStepLabel} from './step-label';\nimport {Observable, Subject, of as obaservableOf} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\nimport {CdkStepHeader} from './step-header';\n\n/** Used to generate unique ID for each stepper component. */\nlet nextId = 0;\n\n/**\n * Position state of the content of each step in stepper that is used for transitioning\n * the content into correct position upon step selection change.\n */\nexport type StepContentPositionState = 'previous' | 'current' | 'next';\n\n/** Possible orientation of a stepper. */\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\n/** Change event emitted on selection changes. */\nexport class StepperSelectionEvent {\n /** Index of the step now selected. */\n selectedIndex: number;\n\n /** Index of the step previously selected. */\n previouslySelectedIndex: number;\n\n /** The step instance now selected. */\n selectedStep: CdkStep;\n\n /** The step instance previously selected. */\n previouslySelectedStep: CdkStep;\n}\n\n/** The state of each step. */\nexport type StepState = 'number' | 'edit' | 'done' | 'error' | string;\n\n/** Enum to represent the different states of the steps. */\nexport const STEP_STATE = {\n NUMBER: 'number',\n EDIT: 'edit',\n DONE: 'done',\n ERROR: 'error'\n};\n\n/** InjectionToken that can be used to specify the global stepper options. */\nexport const MAT_STEPPER_GLOBAL_OPTIONS =\n new InjectionToken<StepperOptions>('mat-stepper-global-options');\n\n/** Configurable options for stepper. */\nexport interface StepperOptions {\n /**\n * Whether the stepper should display an error state or not.\n * Default behavior is assumed to be false.\n */\n showError?: boolean;\n\n /**\n * Whether the stepper should display the default indicator type\n * or not.\n * Default behavior is assumed to be true.\n */\n displayDefaultIndicatorType?: boolean;\n}\n\n@Component({\n moduleId: module.id,\n selector: 'cdk-step',\n exportAs: 'cdkStep',\n template: '<ng-template><ng-content></ng-content></ng-template>',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CdkStep implements OnChanges {\n private _stepperOptions: StepperOptions;\n _showError: boolean;\n _displayDefaultIndicatorType: boolean;\n\n /** Template for step label if it exists. */\n @ContentChild(CdkStepLabel) stepLabel: CdkStepLabel;\n\n /** Template for step content. */\n @ViewChild(TemplateRef) content: TemplateRef<any>;\n\n /** The top level abstract control of the step. */\n @Input() stepControl: AbstractControl;\n\n /** Whether user has seen the expanded step content or not. */\n interacted = false;\n\n /** Plain text label of the step. */\n @Input() label: string;\n\n /** Error message to display when there's an error. */\n @Input() errorMessage: string;\n\n /** Aria label for the tab. */\n @Input('aria-label') ariaLabel: string;\n\n /**\n * Reference to the element that the tab is labelled by.\n * Will be cleared if `aria-label` is set at the same time.\n */\n @Input('aria-labelledby') ariaLabelledby: string;\n\n /** State of the step. */\n @Input() state: StepState;\n\n /** Whether the user can return to this step once it has been marked as complted. */\n @Input()\n get editable(): boolean { return this._editable; }\n set editable(value: boolean) {\n this._editable = coerceBooleanProperty(value);\n }\n private _editable = true;\n\n /** Whether the completion of step is optional. */\n @Input()\n get optional(): boolean { return this._optional; }\n set optional(value: boolean) {\n this._optional = coerceBooleanProperty(value);\n }\n private _optional = false;\n\n /** Whether step is marked as completed. */\n @Input()\n get completed(): boolean {\n return this._customCompleted == null ? this._getDefaultCompleted() : this._customCompleted;\n }\n set completed(value: boolean) {\n this._customCompleted = coerceBooleanProperty(value);\n }\n private _customCompleted: boolean | null = null;\n\n private _getDefaultCompleted() {\n return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;\n }\n\n /** Whether step has an error. */\n @Input()\n get hasError(): boolean {\n return this._customError || this._getDefaultError();\n }\n set hasError(value: boolean) {\n this._customError = coerceBooleanProperty(value);\n }\n private _customError: boolean | null = null;\n\n private _getDefaultError() {\n return this.stepControl && this.stepControl.invalid && this.interacted;\n }\n\n /** @breaking-change 8.0.0 remove the `?` after `stepperOptions` */\n constructor(\n @Inject(forwardRef(() => CdkStepper)) private _stepper: CdkStepper,\n @Optional() @Inject(MAT_STEPPER_GLOBAL_OPTIONS) stepperOptions?: StepperOptions) {\n this._stepperOptions = stepperOptions ? stepperOptions : {};\n this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false;\n this._showError = !!this._stepperOptions.showError;\n }\n\n /** Selects this step component. */\n select(): void {\n this._stepper.selected = this;\n }\n\n /** Resets the step to its initial state. Note that this includes resetting form data. */\n reset(): void {\n this.interacted = false;\n\n if (this._customCompleted != null) {\n this._customCompleted = false;\n }\n\n if (this._customError != null) {\n this._customError = false;\n }\n\n if (this.stepControl) {\n this.stepControl.reset();\n }\n }\n\n ngOnChanges() {\n // Since basically all inputs of the MatStep get proxied through the view down to the\n // underlying MatStepHeader, we have to make sure that change detection runs correctly.\n this._stepper._stateChanged();\n }\n}\n\n@Directive({\n selector: '[cdkStepper]',\n exportAs: 'cdkStepper',\n})\nexport class CdkStepper implements AfterViewInit, OnDestroy {\n /** Emits when the component is destroyed. */\n protected _destroyed = new Subject<void>();\n\n /** Used for managing keyboard focus. */\n private _keyManager: FocusKeyManager<FocusableOption>;\n\n /**\n * @breaking-change 8.0.0 Remove `| undefined` once the `_document`\n * constructor param is required.\n */\n private _document: Document | undefined;\n\n /** The list of step components that the stepper is holding. */\n @ContentChildren(CdkStep) _steps: QueryList<CdkStep>;\n\n /**\n * The list of step headers of the steps in the stepper.\n * @deprecated Type to be changed to `QueryList<CdkStepHeader>`.\n * @breaking-change 8.0.0\n */\n @ContentChildren(CdkStepHeader) _stepHeader: QueryList<FocusableOption>;\n\n /** Whether the validity of previous steps should be checked or not. */\n @Input()\n get linear(): boolean { return this._linear; }\n set linear(value: boolean) { this._linear = coerceBooleanProperty(value); }\n private _linear = false;\n\n /** The index of the selected step. */\n @Input()\n get selectedIndex() { return this._selectedIndex; }\n set selectedIndex(index: number) {\n if (this._steps) {\n // Ensure that the index can't be out of bounds.\n if (index < 0 || index > this._steps.length - 1) {\n throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');\n }\n\n if (this._selectedIndex != index &&\n !this._anyControlsInvalidOrPending(index) &&\n (index >= this._selectedIndex || this._steps.toArray()[index].editable)) {\n this._updateSelectedItemIndex(index);\n }\n } else {\n this._selectedIndex = index;\n }\n }\n private _selectedIndex = 0;\n\n /** The step that is selected. */\n @Input()\n get selected(): CdkStep {\n // @breaking-change 8.0.0 Change return type to `CdkStep | undefined`.\n return this._steps ? this._steps.toArray()[this.selectedIndex] : undefined!;\n }\n set selected(step: CdkStep) {\n this.selectedIndex = this._steps ? this._steps.toArray().indexOf(step) : -1;\n }\n\n /** Event emitted when the selected step has changed. */\n @Output() selectionChange: EventEmitter<StepperSelectionEvent>\n = new EventEmitter<StepperSelectionEvent>();\n\n /** Used to track unique ID for each stepper component. */\n _groupId: number;\n\n protected _orientation: StepperOrientation = 'horizontal';\n\n constructor(\n @Optional() private _dir: Directionality,\n private _changeDetectorRef: ChangeDetectorRef,\n // @breaking-change 8.0.0 `_elementRef` and `_document` parameters to become required.\n private _elementRef?: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) _document?: any) {\n this._groupId = nextId++;\n this._document = _document;\n }\n\n ngAfterViewInit() {\n // Note that while the step headers are content children by default, any components that\n // extend this one might have them as view chidren. We initialize the keyboard handling in\n // AfterViewInit so we're guaranteed for both view and content children to be defined.\n this._keyManager = new FocusKeyManager<FocusableOption>(this._stepHeader)\n .withWrap()\n .withVerticalOrientation(this._orientation === 'vertical');\n\n (this._dir ? this._dir.change as Observable<Direction> : obaservableOf<Direction>())\n .pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))\n .subscribe(direction => this._keyManager.withHorizontalOrientation(direction));\n\n this._keyManager.updateActiveItemIndex(this._selectedIndex);\n\n this._steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => {\n if (!this.selected) {\n this._selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n });\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Selects and focuses the next step in list. */\n next(): void {\n this.selectedIndex = Math.min(this._selectedIndex + 1, this._steps.length - 1);\n }\n\n /** Selects and focuses the previous step in list. */\n previous(): void {\n this.selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n\n /** Resets the stepper to its initial state. Note that this includes clearing form data. */\n reset(): void {\n this._updateSelectedItemIndex(0);\n this._steps.forEach(step => step.reset());\n this._stateChanged();\n }\n\n /** Returns a unique id for each step label element. */\n _getStepLabelId(i: number): string {\n return `cdk-step-label-${this._groupId}-${i}`;\n }\n\n /** Returns unique id for each step content element. */\n _getStepContentId(i: number): string {\n return `cdk-step-content-${this._groupId}-${i}`;\n }\n\n /** Marks the component to be change detected. */\n _stateChanged() {\n this._changeDetectorRef.markForCheck();\n }\n\n /** Returns position state of the step with the given index. */\n _getAnimationDirection(index: number): StepContentPositionState {\n const position = index - this._selectedIndex;\n if (position < 0) {\n return this._layoutDirection() === 'rtl' ? 'next' : 'previous';\n } else if (position > 0) {\n return this._layoutDirection() === 'rtl' ? 'previous' : 'next';\n }\n return 'current';\n }\n\n /** Returns the type of icon to be displayed. */\n _getIndicatorType(index: number, state: StepState = STEP_STATE.NUMBER): StepState {\n const step = this._steps.toArray()[index];\n const isCurrentStep = this._isCurrentStep(index);\n\n return step._displayDefaultIndicatorType\n ? this._getDefaultIndicatorLogic(step, isCurrentStep)\n : this._getGuidelineLogic(step, isCurrentStep, state);\n }\n\n private _getDefaultIndicatorLogic(step: CdkStep, isCurrentStep: boolean): StepState {\n if (step._showError && step.hasError && !isCurrentStep) {\n return STEP_STATE.ERROR;\n } else if (!step.completed || isCurrentStep) {\n return STEP_STATE.NUMBER;\n } else {\n return step.editable ? STEP_STATE.EDIT : STEP_STATE.DONE;\n }\n }\n\n private _getGuidelineLogic(\n step: CdkStep,\n isCurrentStep: boolean,\n state: StepState = STEP_STATE.NUMBER): StepState {\n if (step._showError && step.hasError && !isCurrentStep) {\n return STEP_STATE.ERROR;\n } else if (step.completed && !isCurrentStep) {\n return STEP_STATE.DONE;\n } else if (step.completed && isCurrentStep) {\n return state;\n } else if (step.editable && isCurrentStep) {\n return STEP_STATE.EDIT;\n } else {\n return state;\n }\n }\n\n private _isCurrentStep(index: number) {\n return this._selectedIndex === index;\n }\n\n /** Returns the index of the currently-focused step header. */\n _getFocusIndex() {\n return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;\n }\n\n private _updateSelectedItemIndex(newIndex: number): void {\n const stepsArray = this._steps.toArray();\n this.selectionChange.emit({\n selectedIndex: newIndex,\n previouslySelectedIndex: this._selectedIndex,\n selectedStep: stepsArray[newIndex],\n previouslySelectedStep: stepsArray[this._selectedIndex],\n });\n\n // If focus is inside the stepper, move it to the next header, otherwise it may become\n // lost when the active step content is hidden. We can't be more granular with the check\n // (e.g. checking whether focus is inside the active step), because we don't have a\n // reference to the elements that are rendering out the content.\n this._containsFocus() ? this._keyManager.setActiveItem(newIndex) :\n this._keyManager.updateActiveItemIndex(newIndex);\n\n this._selectedIndex = newIndex;\n this._stateChanged();\n }\n\n _onKeydown(event: KeyboardEvent) {\n const hasModifier = hasModifierKey(event);\n const keyCode = event.keyCode;\n const manager = this._keyManager;\n\n if (manager.activeItemIndex != null && !hasModifier &&\n (keyCode === SPACE || keyCode === ENTER)) {\n this.selectedIndex = manager.activeItemIndex;\n event.preventDefault();\n } else if (keyCode === HOME) {\n manager.setFirstItemActive();\n event.preventDefault();\n } else if (keyCode === END) {\n manager.setLastItemActive();\n event.preventDefault();\n } else {\n manager.onKeydown(event);\n }\n }\n\n private _anyControlsInvalidOrPending(index: number): boolean {\n const steps = this._steps.toArray();\n\n steps[this._selectedIndex].interacted = true;\n\n if (this._linear && index >= 0) {\n return steps.slice(0, index).some(step => {\n const control = step.stepControl;\n const isIncomplete = control ?\n (control.invalid || control.pending || !step.interacted) :\n !step.completed;\n return isIncomplete && !step.optional;\n });\n }\n\n return false;\n }\n\n private _layoutDirection(): Direction {\n return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n }\n\n /** Checks whether the stepper contains the focused element. */\n private _containsFocus(): boolean {\n if (!this._document || !this._elementRef) {\n return false;\n }\n\n const stepperElement = this._elementRef.nativeElement;\n const focusedElement = this._document.activeElement;\n return stepperElement === focusedElement || stepperElement.contains(focusedElement);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, ElementRef} from '@angular/core';\nimport {FocusableOption} from '@angular/cdk/a11y';\n\n\n@Directive({\n selector: '[cdkStepHeader]',\n host: {\n 'role': 'tab',\n },\n})\nexport class CdkStepHeader implements FocusableOption {\n constructor(protected _elementRef: ElementRef<HTMLElement>) {}\n\n /** Focuses the step header. */\n focus() {\n this._elementRef.nativeElement.focus();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef} from '@angular/core';\n\n@Directive({\n selector: '[cdkStepLabel]',\n})\nexport class CdkStepLabel {\n constructor(/** @docs-private */ public template: TemplateRef<any>) { }\n}\n"],"names":["BidiModule","CommonModule","NgModule","Input","Directive","Output","Inject","DOCUMENT","ElementRef","END","HOME","SPACE","ENTER","hasModifierKey","takeUntil","startWith","obaservableOf","FocusKeyManager","ChangeDetectionStrategy","ViewEncapsulation","Component","coerceBooleanProperty","InjectionToken","TemplateRef"],"mappings":";;;;;;;;;;;;;;;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,EAAR,CAAA;;IAGA,OAAA,kBAAC,CAAD;CAAC,EAAD,CAAA,CAAA;;;;;;ADvBA,AAAA,IAAA,gBAAA,kBAAA,YAAA;IAAA,SAAA,gBAAA,GAAA;KAmBgC;;QAnBhC,EAAA,IAAA,EAACD,aAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE,CAACF,eAAU,EAAEC,mBAAY,CAAC;oBACnC,OAAO,EAAE;wBACP,OAAO;wBACP,UAAU;wBACV,aAAa;wBACb,YAAY;wBACZ,cAAc;wBACd,kBAAkB;qBACnB;oBACD,YAAY,EAAE;wBACZ,OAAO;wBACP,UAAU;wBACV,aAAa;wBACb,YAAY;wBACZ,cAAc;wBACd,kBAAkB;qBACnB;iBACF,EAAD,EAAA;;IAC+B,OAA/B,gBAAgC,CAAhC;CAAgC,EAAhC,CAAA;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"cdk-stepper.umd.js","sources":["../../src/cdk/stepper/stepper-module.ts","../../src/cdk/stepper/stepper-button.ts","../../src/cdk/stepper/stepper.ts","../../src/cdk/stepper/step-header.ts","../../src/cdk/stepper/step-label.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkStepper, CdkStep} from './stepper';\nimport {CommonModule} from '@angular/common';\nimport {CdkStepLabel} from './step-label';\nimport {CdkStepperNext, CdkStepperPrevious} from './stepper-button';\nimport {CdkStepHeader} from './step-header';\nimport {BidiModule} from '@angular/cdk/bidi';\n\n@NgModule({\n imports: [BidiModule, CommonModule],\n exports: [\n CdkStep,\n CdkStepper,\n CdkStepHeader,\n CdkStepLabel,\n CdkStepperNext,\n CdkStepperPrevious,\n ],\n declarations: [\n CdkStep,\n CdkStepper,\n CdkStepHeader,\n CdkStepLabel,\n CdkStepperNext,\n CdkStepperPrevious,\n ]\n})\nexport class CdkStepperModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, Input} from '@angular/core';\nimport {CdkStepper} from './stepper';\n\n/** Button that moves to the next step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperNext]',\n host: {\n '(click)': '_stepper.next()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperNext {\n /** Type of the next button. Defaults to \"submit\" if not specified. */\n @Input() type: string = 'submit';\n\n constructor(public _stepper: CdkStepper) {}\n}\n\n/** Button that moves to the previous step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperPrevious]',\n host: {\n '(click)': '_stepper.previous()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperPrevious {\n /** Type of the previous button. Defaults to \"button\" if not specified. */\n @Input() type: string = 'button';\n\n constructor(public _stepper: CdkStepper) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusableOption, FocusKeyManager} from '@angular/cdk/a11y';\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {END, ENTER, HOME, SPACE, hasModifierKey} from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n EventEmitter,\n ElementRef,\n forwardRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n InjectionToken,\n} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {AbstractControl} from '@angular/forms';\nimport {CdkStepLabel} from './step-label';\nimport {Observable, Subject, of as obaservableOf} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\nimport {CdkStepHeader} from './step-header';\n\n/** Used to generate unique ID for each stepper component. */\nlet nextId = 0;\n\n/**\n * Position state of the content of each step in stepper that is used for transitioning\n * the content into correct position upon step selection change.\n */\nexport type StepContentPositionState = 'previous' | 'current' | 'next';\n\n/** Possible orientation of a stepper. */\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\n/** Change event emitted on selection changes. */\nexport class StepperSelectionEvent {\n /** Index of the step now selected. */\n selectedIndex: number;\n\n /** Index of the step previously selected. */\n previouslySelectedIndex: number;\n\n /** The step instance now selected. */\n selectedStep: CdkStep;\n\n /** The step instance previously selected. */\n previouslySelectedStep: CdkStep;\n}\n\n/** The state of each step. */\nexport type StepState = 'number' | 'edit' | 'done' | 'error' | string;\n\n/** Enum to represent the different states of the steps. */\nexport const STEP_STATE = {\n NUMBER: 'number',\n EDIT: 'edit',\n DONE: 'done',\n ERROR: 'error'\n};\n\n/** InjectionToken that can be used to specify the global stepper options. */\nexport const STEPPER_GLOBAL_OPTIONS =\n new InjectionToken<StepperOptions>('STEPPER_GLOBAL_OPTIONS');\n\n/**\n * InjectionToken that can be used to specify the global stepper options.\n * @deprecated Use `STEPPER_GLOBAL_OPTIONS` instead.\n * @breaking-change 8.0.0.\n */\nexport const MAT_STEPPER_GLOBAL_OPTIONS = STEPPER_GLOBAL_OPTIONS;\n\n/** Configurable options for stepper. */\nexport interface StepperOptions {\n /**\n * Whether the stepper should display an error state or not.\n * Default behavior is assumed to be false.\n */\n showError?: boolean;\n\n /**\n * Whether the stepper should display the default indicator type\n * or not.\n * Default behavior is assumed to be true.\n */\n displayDefaultIndicatorType?: boolean;\n}\n\n@Component({\n moduleId: module.id,\n selector: 'cdk-step',\n exportAs: 'cdkStep',\n template: '<ng-template><ng-content></ng-content></ng-template>',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CdkStep implements OnChanges {\n private _stepperOptions: StepperOptions;\n _showError: boolean;\n _displayDefaultIndicatorType: boolean;\n\n /** Template for step label if it exists. */\n @ContentChild(CdkStepLabel) stepLabel: CdkStepLabel;\n\n /** Template for step content. */\n @ViewChild(TemplateRef) content: TemplateRef<any>;\n\n /** The top level abstract control of the step. */\n @Input() stepControl: AbstractControl;\n\n /** Whether user has seen the expanded step content or not. */\n interacted = false;\n\n /** Plain text label of the step. */\n @Input() label: string;\n\n /** Error message to display when there's an error. */\n @Input() errorMessage: string;\n\n /** Aria label for the tab. */\n @Input('aria-label') ariaLabel: string;\n\n /**\n * Reference to the element that the tab is labelled by.\n * Will be cleared if `aria-label` is set at the same time.\n */\n @Input('aria-labelledby') ariaLabelledby: string;\n\n /** State of the step. */\n @Input() state: StepState;\n\n /** Whether the user can return to this step once it has been marked as complted. */\n @Input()\n get editable(): boolean { return this._editable; }\n set editable(value: boolean) {\n this._editable = coerceBooleanProperty(value);\n }\n private _editable = true;\n\n /** Whether the completion of step is optional. */\n @Input()\n get optional(): boolean { return this._optional; }\n set optional(value: boolean) {\n this._optional = coerceBooleanProperty(value);\n }\n private _optional = false;\n\n /** Whether step is marked as completed. */\n @Input()\n get completed(): boolean {\n return this._customCompleted == null ? this._getDefaultCompleted() : this._customCompleted;\n }\n set completed(value: boolean) {\n this._customCompleted = coerceBooleanProperty(value);\n }\n private _customCompleted: boolean | null = null;\n\n private _getDefaultCompleted() {\n return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;\n }\n\n /** Whether step has an error. */\n @Input()\n get hasError(): boolean {\n return this._customError == null ? this._getDefaultError() : this._customError;\n }\n set hasError(value: boolean) {\n this._customError = coerceBooleanProperty(value);\n }\n private _customError: boolean | null = null;\n\n private _getDefaultError() {\n return this.stepControl && this.stepControl.invalid && this.interacted;\n }\n\n /** @breaking-change 8.0.0 remove the `?` after `stepperOptions` */\n constructor(\n @Inject(forwardRef(() => CdkStepper)) private _stepper: CdkStepper,\n @Optional() @Inject(STEPPER_GLOBAL_OPTIONS) stepperOptions?: StepperOptions) {\n this._stepperOptions = stepperOptions ? stepperOptions : {};\n this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false;\n this._showError = !!this._stepperOptions.showError;\n }\n\n /** Selects this step component. */\n select(): void {\n this._stepper.selected = this;\n }\n\n /** Resets the step to its initial state. Note that this includes resetting form data. */\n reset(): void {\n this.interacted = false;\n\n if (this._customCompleted != null) {\n this._customCompleted = false;\n }\n\n if (this._customError != null) {\n this._customError = false;\n }\n\n if (this.stepControl) {\n this.stepControl.reset();\n }\n }\n\n ngOnChanges() {\n // Since basically all inputs of the MatStep get proxied through the view down to the\n // underlying MatStepHeader, we have to make sure that change detection runs correctly.\n this._stepper._stateChanged();\n }\n}\n\n@Directive({\n selector: '[cdkStepper]',\n exportAs: 'cdkStepper',\n})\nexport class CdkStepper implements AfterViewInit, OnDestroy {\n /** Emits when the component is destroyed. */\n protected _destroyed = new Subject<void>();\n\n /** Used for managing keyboard focus. */\n private _keyManager: FocusKeyManager<FocusableOption>;\n\n /**\n * @breaking-change 8.0.0 Remove `| undefined` once the `_document`\n * constructor param is required.\n */\n private _document: Document | undefined;\n\n /** The list of step components that the stepper is holding. */\n @ContentChildren(CdkStep) _steps: QueryList<CdkStep>;\n\n /**\n * The list of step headers of the steps in the stepper.\n * @deprecated Type to be changed to `QueryList<CdkStepHeader>`.\n * @breaking-change 8.0.0\n */\n @ContentChildren(CdkStepHeader) _stepHeader: QueryList<FocusableOption>;\n\n /** Whether the validity of previous steps should be checked or not. */\n @Input()\n get linear(): boolean { return this._linear; }\n set linear(value: boolean) { this._linear = coerceBooleanProperty(value); }\n private _linear = false;\n\n /** The index of the selected step. */\n @Input()\n get selectedIndex() { return this._selectedIndex; }\n set selectedIndex(index: number) {\n if (this._steps) {\n // Ensure that the index can't be out of bounds.\n if (index < 0 || index > this._steps.length - 1) {\n throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');\n }\n\n if (this._selectedIndex != index &&\n !this._anyControlsInvalidOrPending(index) &&\n (index >= this._selectedIndex || this._steps.toArray()[index].editable)) {\n this._updateSelectedItemIndex(index);\n }\n } else {\n this._selectedIndex = index;\n }\n }\n private _selectedIndex = 0;\n\n /** The step that is selected. */\n @Input()\n get selected(): CdkStep {\n // @breaking-change 8.0.0 Change return type to `CdkStep | undefined`.\n return this._steps ? this._steps.toArray()[this.selectedIndex] : undefined!;\n }\n set selected(step: CdkStep) {\n this.selectedIndex = this._steps ? this._steps.toArray().indexOf(step) : -1;\n }\n\n /** Event emitted when the selected step has changed. */\n @Output() selectionChange: EventEmitter<StepperSelectionEvent>\n = new EventEmitter<StepperSelectionEvent>();\n\n /** Used to track unique ID for each stepper component. */\n _groupId: number;\n\n protected _orientation: StepperOrientation = 'horizontal';\n\n constructor(\n @Optional() private _dir: Directionality,\n private _changeDetectorRef: ChangeDetectorRef,\n // @breaking-change 8.0.0 `_elementRef` and `_document` parameters to become required.\n private _elementRef?: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) _document?: any) {\n this._groupId = nextId++;\n this._document = _document;\n }\n\n ngAfterViewInit() {\n // Note that while the step headers are content children by default, any components that\n // extend this one might have them as view chidren. We initialize the keyboard handling in\n // AfterViewInit so we're guaranteed for both view and content children to be defined.\n this._keyManager = new FocusKeyManager<FocusableOption>(this._stepHeader)\n .withWrap()\n .withVerticalOrientation(this._orientation === 'vertical');\n\n (this._dir ? this._dir.change as Observable<Direction> : obaservableOf<Direction>())\n .pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))\n .subscribe(direction => this._keyManager.withHorizontalOrientation(direction));\n\n this._keyManager.updateActiveItemIndex(this._selectedIndex);\n\n this._steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => {\n if (!this.selected) {\n this._selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n });\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Selects and focuses the next step in list. */\n next(): void {\n this.selectedIndex = Math.min(this._selectedIndex + 1, this._steps.length - 1);\n }\n\n /** Selects and focuses the previous step in list. */\n previous(): void {\n this.selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n\n /** Resets the stepper to its initial state. Note that this includes clearing form data. */\n reset(): void {\n this._updateSelectedItemIndex(0);\n this._steps.forEach(step => step.reset());\n this._stateChanged();\n }\n\n /** Returns a unique id for each step label element. */\n _getStepLabelId(i: number): string {\n return `cdk-step-label-${this._groupId}-${i}`;\n }\n\n /** Returns unique id for each step content element. */\n _getStepContentId(i: number): string {\n return `cdk-step-content-${this._groupId}-${i}`;\n }\n\n /** Marks the component to be change detected. */\n _stateChanged() {\n this._changeDetectorRef.markForCheck();\n }\n\n /** Returns position state of the step with the given index. */\n _getAnimationDirection(index: number): StepContentPositionState {\n const position = index - this._selectedIndex;\n if (position < 0) {\n return this._layoutDirection() === 'rtl' ? 'next' : 'previous';\n } else if (position > 0) {\n return this._layoutDirection() === 'rtl' ? 'previous' : 'next';\n }\n return 'current';\n }\n\n /** Returns the type of icon to be displayed. */\n _getIndicatorType(index: number, state: StepState = STEP_STATE.NUMBER): StepState {\n const step = this._steps.toArray()[index];\n const isCurrentStep = this._isCurrentStep(index);\n\n return step._displayDefaultIndicatorType\n ? this._getDefaultIndicatorLogic(step, isCurrentStep)\n : this._getGuidelineLogic(step, isCurrentStep, state);\n }\n\n private _getDefaultIndicatorLogic(step: CdkStep, isCurrentStep: boolean): StepState {\n if (step._showError && step.hasError && !isCurrentStep) {\n return STEP_STATE.ERROR;\n } else if (!step.completed || isCurrentStep) {\n return STEP_STATE.NUMBER;\n } else {\n return step.editable ? STEP_STATE.EDIT : STEP_STATE.DONE;\n }\n }\n\n private _getGuidelineLogic(\n step: CdkStep,\n isCurrentStep: boolean,\n state: StepState = STEP_STATE.NUMBER): StepState {\n if (step._showError && step.hasError && !isCurrentStep) {\n return STEP_STATE.ERROR;\n } else if (step.completed && !isCurrentStep) {\n return STEP_STATE.DONE;\n } else if (step.completed && isCurrentStep) {\n return state;\n } else if (step.editable && isCurrentStep) {\n return STEP_STATE.EDIT;\n } else {\n return state;\n }\n }\n\n private _isCurrentStep(index: number) {\n return this._selectedIndex === index;\n }\n\n /** Returns the index of the currently-focused step header. */\n _getFocusIndex() {\n return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;\n }\n\n private _updateSelectedItemIndex(newIndex: number): void {\n const stepsArray = this._steps.toArray();\n this.selectionChange.emit({\n selectedIndex: newIndex,\n previouslySelectedIndex: this._selectedIndex,\n selectedStep: stepsArray[newIndex],\n previouslySelectedStep: stepsArray[this._selectedIndex],\n });\n\n // If focus is inside the stepper, move it to the next header, otherwise it may become\n // lost when the active step content is hidden. We can't be more granular with the check\n // (e.g. checking whether focus is inside the active step), because we don't have a\n // reference to the elements that are rendering out the content.\n this._containsFocus() ? this._keyManager.setActiveItem(newIndex) :\n this._keyManager.updateActiveItemIndex(newIndex);\n\n this._selectedIndex = newIndex;\n this._stateChanged();\n }\n\n _onKeydown(event: KeyboardEvent) {\n const hasModifier = hasModifierKey(event);\n const keyCode = event.keyCode;\n const manager = this._keyManager;\n\n if (manager.activeItemIndex != null && !hasModifier &&\n (keyCode === SPACE || keyCode === ENTER)) {\n this.selectedIndex = manager.activeItemIndex;\n event.preventDefault();\n } else if (keyCode === HOME) {\n manager.setFirstItemActive();\n event.preventDefault();\n } else if (keyCode === END) {\n manager.setLastItemActive();\n event.preventDefault();\n } else {\n manager.onKeydown(event);\n }\n }\n\n private _anyControlsInvalidOrPending(index: number): boolean {\n const steps = this._steps.toArray();\n\n steps[this._selectedIndex].interacted = true;\n\n if (this._linear && index >= 0) {\n return steps.slice(0, index).some(step => {\n const control = step.stepControl;\n const isIncomplete = control ?\n (control.invalid || control.pending || !step.interacted) :\n !step.completed;\n return isIncomplete && !step.optional;\n });\n }\n\n return false;\n }\n\n private _layoutDirection(): Direction {\n return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n }\n\n /** Checks whether the stepper contains the focused element. */\n private _containsFocus(): boolean {\n if (!this._document || !this._elementRef) {\n return false;\n }\n\n const stepperElement = this._elementRef.nativeElement;\n const focusedElement = this._document.activeElement;\n return stepperElement === focusedElement || stepperElement.contains(focusedElement);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, ElementRef} from '@angular/core';\nimport {FocusableOption} from '@angular/cdk/a11y';\n\n\n@Directive({\n selector: '[cdkStepHeader]',\n host: {\n 'role': 'tab',\n },\n})\nexport class CdkStepHeader implements FocusableOption {\n constructor(protected _elementRef: ElementRef<HTMLElement>) {}\n\n /** Focuses the step header. */\n focus() {\n this._elementRef.nativeElement.focus();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef} from '@angular/core';\n\n@Directive({\n selector: '[cdkStepLabel]',\n})\nexport class CdkStepLabel {\n constructor(/** @docs-private */ public template: TemplateRef<any>) { }\n}\n"],"names":["BidiModule","CommonModule","NgModule","Input","Directive","Output","Inject","DOCUMENT","ElementRef","END","HOME","SPACE","ENTER","hasModifierKey","takeUntil","startWith","obaservableOf","FocusKeyManager","ChangeDetectionStrategy","ViewEncapsulation","Component","coerceBooleanProperty","InjectionToken","TemplateRef"],"mappings":";;;;;;;;;;;;;;;;;AIUA,AAAA,IAAA,YAAA,kBAAA,YAAA;IAIE,SAAF,YAAA,sBAA0C,QAA0B,EAApE;QAA0C,IAA1C,CAAA,QAAkD,GAAR,QAAQ,CAAkB;KAAK;;QAJzE,EAAA,IAAA,EAACI,cAAS,EAAV,IAAA,EAAA,CAAW;oBACT,QAAQ,EAAE,gBAAgB;iBAC3B,EAAD,EAAA;;;;QAJA,EAAA,IAAA,EAAmBmB,gBAAW,EAA9B;;IAOA,OAAA,YAAC,CAAD;CAAC,EAAD,CAAA,CAAA;;;;;;ADHA,AAAA,IAAA,aAAA,kBAAA,YAAA;IAOE,SAAF,aAAA,CAA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a;wBACb,YAAY;wBACZ,cAAc;wBACd,kBAAkB;qBACnB;oBACD,YAAY,EAAE;wBACZ,OAAO;wBACP,UAAU;wBACV,aAAa;wBACb,YAAY;wBACZ,cAAc;wBACd,kBAAkB;qBACnB;iBACF,EAAD,EAAA;;IAC+B,OAA/B,gBAAgC,CAAhC;CAAgC,EAAhC,CAAA;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,5 +5,5 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/cdk/a11y"),require("@angular/cdk/bidi"),require("@angular/cdk/coercion"),require("@angular/cdk/keycodes"),require("@angular/common"),require("@angular/forms"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/cdk/stepper",["exports","@angular/core","@angular/cdk/a11y","@angular/cdk/bidi","@angular/cdk/coercion","@angular/cdk/keycodes","@angular/common","@angular/forms","rxjs","rxjs/operators"],t):t((e.ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.stepper={}),e.ng.core,e.ng.cdk.a11y,e.ng.cdk.bidi,e.ng.cdk.coercion,e.ng.cdk.keycodes,e.ng.common,e.ng.forms,e.rxjs,e.rxjs.operators)}(this,function(e,t,r,n,o,i,s,p,c,a){"use strict";var u=function(){function e(e){this.template=e}return e.decorators=[{type:t.Directive,args:[{selector:"[cdkStepLabel]"}]}],e.ctorParameters=function(){return[{type:t.TemplateRef}]},e}(),d=function(){function e(e){this._elementRef=e}return e.prototype.focus=function(){this._elementRef.nativeElement.focus()},e.decorators=[{type:t.Directive,args:[{selector:"[cdkStepHeader]",host:{role:"tab"}}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e}(),l=0,h=function(){function e(){}return e}(),y={NUMBER:"number",EDIT:"edit",DONE:"done",ERROR:"error"},_=new t.InjectionToken("mat-stepper-global-options"),f=function(){function e(e,t){this._stepper=e,this.interacted=!1,this._editable=!0,this._optional=!1,this._customCompleted=null,this._customError=null,this._stepperOptions=t||{},this._displayDefaultIndicatorType=!1!==this._stepperOptions.displayDefaultIndicatorType,this._showError=!!this._stepperOptions.showError}return Object.defineProperty(e.prototype,"editable",{get:function(){return this._editable},set:function(e){this._editable=o.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optional",{get:function(){return this._optional},set:function(e){this._optional=o.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"completed",{get:function(){return null==this._customCompleted?this._getDefaultCompleted():this._customCompleted},set:function(e){this._customCompleted=o.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.prototype._getDefaultCompleted=function(){return this.stepControl?this.stepControl.valid&&this.interacted:this.interacted},Object.defineProperty(e.prototype,"hasError",{get:function(){return this._customError||this._getDefaultError()},set:function(e){this._customError=o.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.prototype._getDefaultError=function(){return this.stepControl&&this.stepControl.invalid&&this.interacted},e.prototype.select=function(){this._stepper.selected=this},e.prototype.reset=function(){this.interacted=!1,null!=this._customCompleted&&(this._customCompleted=!1),null!=this._customError&&(this._customError=!1),this.stepControl&&this.stepControl.reset()},e.prototype.ngOnChanges=function(){this._stepper._stateChanged()},e.decorators=[{type:t.Component,args:[{selector:"cdk-step",exportAs:"cdkStep",template:"<ng-template><ng-content></ng-content></ng-template>",encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:g,decorators:[{type:t.Inject,args:[t.forwardRef(function(){return g})]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[_]}]}]},e.propDecorators={stepLabel:[{type:t.ContentChild,args:[u]}],content:[{type:t.ViewChild,args:[t.TemplateRef]}],stepControl:[{type:t.Input}],label:[{type:t.Input}],errorMessage:[{type:t.Input}],ariaLabel:[{type:t.Input,args:["aria-label"]}],ariaLabelledby:[{type:t.Input,args:["aria-labelledby"]}],state:[{type:t.Input}],editable:[{type:t.Input}],optional:[{type:t.Input}],completed:[{type:t.Input}],hasError:[{type:t.Input}]},e}(),g=function(){function e(e,r,n,o){this._dir=e,this._changeDetectorRef=r,this._elementRef=n,this._destroyed=new c.Subject,this._linear=!1,this._selectedIndex=0,this.selectionChange=new t.EventEmitter,this._orientation="horizontal",this._groupId=l++,this._document=o}return Object.defineProperty(e.prototype,"linear",{get:function(){return this._linear},set:function(e){this._linear=o.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){if(this._steps){if(e<0||e>this._steps.length-1)throw Error("cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.");this._selectedIndex!=e&&!this._anyControlsInvalidOrPending(e)&&(e>=this._selectedIndex||this._steps.toArray()[e].editable)&&this._updateSelectedItemIndex(e)}else this._selectedIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._steps?this._steps.toArray()[this.selectedIndex]:void 0},set:function(e){this.selectedIndex=this._steps?this._steps.toArray().indexOf(e):-1},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;this._keyManager=new r.FocusKeyManager(this._stepHeader).withWrap().withVerticalOrientation("vertical"===this._orientation),(this._dir?this._dir.change:c.of()).pipe(a.startWith(this._layoutDirection()),a.takeUntil(this._destroyed)).subscribe(function(t){return e._keyManager.withHorizontalOrientation(t)}),this._keyManager.updateActiveItemIndex(this._selectedIndex),this._steps.changes.pipe(a.takeUntil(this._destroyed)).subscribe(function(){e.selected||(e._selectedIndex=Math.max(e._selectedIndex-1,0))})},e.prototype.ngOnDestroy=function(){this._destroyed.next(),this._destroyed.complete()},e.prototype.next=function(){this.selectedIndex=Math.min(this._selectedIndex+1,this._steps.length-1)},e.prototype.previous=function(){this.selectedIndex=Math.max(this._selectedIndex-1,0)},e.prototype.reset=function(){this._updateSelectedItemIndex(0),this._steps.forEach(function(e){return e.reset()}),this._stateChanged()},e.prototype._getStepLabelId=function(e){return"cdk-step-label-"+this._groupId+"-"+e},e.prototype._getStepContentId=function(e){return"cdk-step-content-"+this._groupId+"-"+e},e.prototype._stateChanged=function(){this._changeDetectorRef.markForCheck()},e.prototype._getAnimationDirection=function(e){var t=e-this._selectedIndex;return t<0?"rtl"===this._layoutDirection()?"next":"previous":t>0?"rtl"===this._layoutDirection()?"previous":"next":"current"},e.prototype._getIndicatorType=function(e,t){void 0===t&&(t=y.NUMBER);var r=this._steps.toArray()[e],n=this._isCurrentStep(e);return r._displayDefaultIndicatorType?this._getDefaultIndicatorLogic(r,n):this._getGuidelineLogic(r,n,t)},e.prototype._getDefaultIndicatorLogic=function(e,t){return e._showError&&e.hasError&&!t?y.ERROR:!e.completed||t?y.NUMBER:e.editable?y.EDIT:y.DONE},e.prototype._getGuidelineLogic=function(e,t,r){return void 0===r&&(r=y.NUMBER),e._showError&&e.hasError&&!t?y.ERROR:e.completed&&!t?y.DONE:e.completed&&t?r:e.editable&&t?y.EDIT:r},e.prototype._isCurrentStep=function(e){return this._selectedIndex===e},e.prototype._getFocusIndex=function(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex},e.prototype._updateSelectedItemIndex=function(e){var t=this._steps.toArray();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:this._selectedIndex,selectedStep:t[e],previouslySelectedStep:t[this._selectedIndex]}),this._containsFocus()?this._keyManager.setActiveItem(e):this._keyManager.updateActiveItemIndex(e),this._selectedIndex=e,this._stateChanged()},e.prototype._onKeydown=function(e){var t=i.hasModifierKey(e),r=e.keyCode,n=this._keyManager;null==n.activeItemIndex||t||r!==i.SPACE&&r!==i.ENTER?r===i.HOME?(n.setFirstItemActive(),e.preventDefault()):r===i.END?(n.setLastItemActive(),e.preventDefault()):n.onKeydown(e):(this.selectedIndex=n.activeItemIndex,e.preventDefault())},e.prototype._anyControlsInvalidOrPending=function(e){var t=this._steps.toArray();return t[this._selectedIndex].interacted=!0,!!(this._linear&&e>=0)&&t.slice(0,e).some(function(e){var t=e.stepControl;return(t?t.invalid||t.pending||!e.interacted:!e.completed)&&!e.optional})},e.prototype._layoutDirection=function(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"},e.prototype._containsFocus=function(){if(!this._document||!this._elementRef)return!1;var e=this._elementRef.nativeElement,t=this._document.activeElement;return e===t||e.contains(t)},e.decorators=[{type:t.Directive,args:[{selector:"[cdkStepper]",exportAs:"cdkStepper"}]}],e.ctorParameters=function(){return[{type:n.Directionality,decorators:[{type:t.Optional}]},{type:t.ChangeDetectorRef},{type:t.ElementRef},{type:void 0,decorators:[{type:t.Inject,args:[s.DOCUMENT]}]}]},e.propDecorators={_steps:[{type:t.ContentChildren,args:[f]}],_stepHeader:[{type:t.ContentChildren,args:[d]}],linear:[{type:t.Input}],selectedIndex:[{type:t.Input}],selected:[{type:t.Input}],selectionChange:[{type:t.Output}]},e}(),m=function(){function e(e){this._stepper=e,this.type="submit"}return e.decorators=[{type:t.Directive,args:[{selector:"button[cdkStepperNext]",host:{"(click)":"_stepper.next()","[type]":"type"}}]}],e.ctorParameters=function(){return[{type:g}]},e.propDecorators={type:[{type:t.Input}]},e}(),I=function(){function e(e){this._stepper=e,this.type="button"}return e.decorators=[{type:t.Directive,args:[{selector:"button[cdkStepperPrevious]",host:{"(click)":"_stepper.previous()","[type]":"type"}}]}],e.ctorParameters=function(){return[{type:g}]},e.propDecorators={type:[{type:t.Input}]},e}(),b=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.BidiModule,s.CommonModule],exports:[f,g,d,u,m,I],declarations:[f,g,d,u,m,I]}]}],e}();e.StepperSelectionEvent=h,e.STEP_STATE=y,e.MAT_STEPPER_GLOBAL_OPTIONS=_,e.CdkStep=f,e.CdkStepper=g,e.CdkStepLabel=u,e.CdkStepperNext=m,e.CdkStepperPrevious=I,e.CdkStepperModule=b,e.CdkStepHeader=d,Object.defineProperty(e,"__esModule",{value:!0})});
8
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/cdk/a11y"),require("@angular/cdk/bidi"),require("@angular/cdk/coercion"),require("@angular/cdk/keycodes"),require("@angular/common"),require("@angular/forms"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/cdk/stepper",["exports","@angular/core","@angular/cdk/a11y","@angular/cdk/bidi","@angular/cdk/coercion","@angular/cdk/keycodes","@angular/common","@angular/forms","rxjs","rxjs/operators"],t):t((e.ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.stepper={}),e.ng.core,e.ng.cdk.a11y,e.ng.cdk.bidi,e.ng.cdk.coercion,e.ng.cdk.keycodes,e.ng.common,e.ng.forms,e.rxjs,e.rxjs.operators)}(this,function(e,t,r,n,o,i,s,p,c,a){"use strict";var u=function(){function e(e){this.template=e}return e.decorators=[{type:t.Directive,args:[{selector:"[cdkStepLabel]"}]}],e.ctorParameters=function(){return[{type:t.TemplateRef}]},e}(),d=function(){function e(e){this._elementRef=e}return e.prototype.focus=function(){this._elementRef.nativeElement.focus()},e.decorators=[{type:t.Directive,args:[{selector:"[cdkStepHeader]",host:{role:"tab"}}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e}(),l=0,h=function(){function e(){}return e}(),y={NUMBER:"number",EDIT:"edit",DONE:"done",ERROR:"error"},_=new t.InjectionToken("STEPPER_GLOBAL_OPTIONS"),f=_,g=function(){function e(e,t){this._stepper=e,this.interacted=!1,this._editable=!0,this._optional=!1,this._customCompleted=null,this._customError=null,this._stepperOptions=t||{},this._displayDefaultIndicatorType=!1!==this._stepperOptions.displayDefaultIndicatorType,this._showError=!!this._stepperOptions.showError}return Object.defineProperty(e.prototype,"editable",{get:function(){return this._editable},set:function(e){this._editable=o.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optional",{get:function(){return this._optional},set:function(e){this._optional=o.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"completed",{get:function(){return null==this._customCompleted?this._getDefaultCompleted():this._customCompleted},set:function(e){this._customCompleted=o.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.prototype._getDefaultCompleted=function(){return this.stepControl?this.stepControl.valid&&this.interacted:this.interacted},Object.defineProperty(e.prototype,"hasError",{get:function(){return null==this._customError?this._getDefaultError():this._customError},set:function(e){this._customError=o.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.prototype._getDefaultError=function(){return this.stepControl&&this.stepControl.invalid&&this.interacted},e.prototype.select=function(){this._stepper.selected=this},e.prototype.reset=function(){this.interacted=!1,null!=this._customCompleted&&(this._customCompleted=!1),null!=this._customError&&(this._customError=!1),this.stepControl&&this.stepControl.reset()},e.prototype.ngOnChanges=function(){this._stepper._stateChanged()},e.decorators=[{type:t.Component,args:[{selector:"cdk-step",exportAs:"cdkStep",template:"<ng-template><ng-content></ng-content></ng-template>",encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:m,decorators:[{type:t.Inject,args:[t.forwardRef(function(){return m})]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[_]}]}]},e.propDecorators={stepLabel:[{type:t.ContentChild,args:[u]}],content:[{type:t.ViewChild,args:[t.TemplateRef]}],stepControl:[{type:t.Input}],label:[{type:t.Input}],errorMessage:[{type:t.Input}],ariaLabel:[{type:t.Input,args:["aria-label"]}],ariaLabelledby:[{type:t.Input,args:["aria-labelledby"]}],state:[{type:t.Input}],editable:[{type:t.Input}],optional:[{type:t.Input}],completed:[{type:t.Input}],hasError:[{type:t.Input}]},e}(),m=function(){function e(e,r,n,o){this._dir=e,this._changeDetectorRef=r,this._elementRef=n,this._destroyed=new c.Subject,this._linear=!1,this._selectedIndex=0,this.selectionChange=new t.EventEmitter,this._orientation="horizontal",this._groupId=l++,this._document=o}return Object.defineProperty(e.prototype,"linear",{get:function(){return this._linear},set:function(e){this._linear=o.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){if(this._steps){if(e<0||e>this._steps.length-1)throw Error("cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.");this._selectedIndex!=e&&!this._anyControlsInvalidOrPending(e)&&(e>=this._selectedIndex||this._steps.toArray()[e].editable)&&this._updateSelectedItemIndex(e)}else this._selectedIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._steps?this._steps.toArray()[this.selectedIndex]:void 0},set:function(e){this.selectedIndex=this._steps?this._steps.toArray().indexOf(e):-1},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;this._keyManager=new r.FocusKeyManager(this._stepHeader).withWrap().withVerticalOrientation("vertical"===this._orientation),(this._dir?this._dir.change:c.of()).pipe(a.startWith(this._layoutDirection()),a.takeUntil(this._destroyed)).subscribe(function(t){return e._keyManager.withHorizontalOrientation(t)}),this._keyManager.updateActiveItemIndex(this._selectedIndex),this._steps.changes.pipe(a.takeUntil(this._destroyed)).subscribe(function(){e.selected||(e._selectedIndex=Math.max(e._selectedIndex-1,0))})},e.prototype.ngOnDestroy=function(){this._destroyed.next(),this._destroyed.complete()},e.prototype.next=function(){this.selectedIndex=Math.min(this._selectedIndex+1,this._steps.length-1)},e.prototype.previous=function(){this.selectedIndex=Math.max(this._selectedIndex-1,0)},e.prototype.reset=function(){this._updateSelectedItemIndex(0),this._steps.forEach(function(e){return e.reset()}),this._stateChanged()},e.prototype._getStepLabelId=function(e){return"cdk-step-label-"+this._groupId+"-"+e},e.prototype._getStepContentId=function(e){return"cdk-step-content-"+this._groupId+"-"+e},e.prototype._stateChanged=function(){this._changeDetectorRef.markForCheck()},e.prototype._getAnimationDirection=function(e){var t=e-this._selectedIndex;return t<0?"rtl"===this._layoutDirection()?"next":"previous":t>0?"rtl"===this._layoutDirection()?"previous":"next":"current"},e.prototype._getIndicatorType=function(e,t){void 0===t&&(t=y.NUMBER);var r=this._steps.toArray()[e],n=this._isCurrentStep(e);return r._displayDefaultIndicatorType?this._getDefaultIndicatorLogic(r,n):this._getGuidelineLogic(r,n,t)},e.prototype._getDefaultIndicatorLogic=function(e,t){return e._showError&&e.hasError&&!t?y.ERROR:!e.completed||t?y.NUMBER:e.editable?y.EDIT:y.DONE},e.prototype._getGuidelineLogic=function(e,t,r){return void 0===r&&(r=y.NUMBER),e._showError&&e.hasError&&!t?y.ERROR:e.completed&&!t?y.DONE:e.completed&&t?r:e.editable&&t?y.EDIT:r},e.prototype._isCurrentStep=function(e){return this._selectedIndex===e},e.prototype._getFocusIndex=function(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex},e.prototype._updateSelectedItemIndex=function(e){var t=this._steps.toArray();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:this._selectedIndex,selectedStep:t[e],previouslySelectedStep:t[this._selectedIndex]}),this._containsFocus()?this._keyManager.setActiveItem(e):this._keyManager.updateActiveItemIndex(e),this._selectedIndex=e,this._stateChanged()},e.prototype._onKeydown=function(e){var t=i.hasModifierKey(e),r=e.keyCode,n=this._keyManager;null==n.activeItemIndex||t||r!==i.SPACE&&r!==i.ENTER?r===i.HOME?(n.setFirstItemActive(),e.preventDefault()):r===i.END?(n.setLastItemActive(),e.preventDefault()):n.onKeydown(e):(this.selectedIndex=n.activeItemIndex,e.preventDefault())},e.prototype._anyControlsInvalidOrPending=function(e){var t=this._steps.toArray();return t[this._selectedIndex].interacted=!0,!!(this._linear&&e>=0)&&t.slice(0,e).some(function(e){var t=e.stepControl;return(t?t.invalid||t.pending||!e.interacted:!e.completed)&&!e.optional})},e.prototype._layoutDirection=function(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"},e.prototype._containsFocus=function(){if(!this._document||!this._elementRef)return!1;var e=this._elementRef.nativeElement,t=this._document.activeElement;return e===t||e.contains(t)},e.decorators=[{type:t.Directive,args:[{selector:"[cdkStepper]",exportAs:"cdkStepper"}]}],e.ctorParameters=function(){return[{type:n.Directionality,decorators:[{type:t.Optional}]},{type:t.ChangeDetectorRef},{type:t.ElementRef},{type:void 0,decorators:[{type:t.Inject,args:[s.DOCUMENT]}]}]},e.propDecorators={_steps:[{type:t.ContentChildren,args:[g]}],_stepHeader:[{type:t.ContentChildren,args:[d]}],linear:[{type:t.Input}],selectedIndex:[{type:t.Input}],selected:[{type:t.Input}],selectionChange:[{type:t.Output}]},e}(),I=function(){function e(e){this._stepper=e,this.type="submit"}return e.decorators=[{type:t.Directive,args:[{selector:"button[cdkStepperNext]",host:{"(click)":"_stepper.next()","[type]":"type"}}]}],e.ctorParameters=function(){return[{type:m}]},e.propDecorators={type:[{type:t.Input}]},e}(),b=function(){function e(e){this._stepper=e,this.type="button"}return e.decorators=[{type:t.Directive,args:[{selector:"button[cdkStepperPrevious]",host:{"(click)":"_stepper.previous()","[type]":"type"}}]}],e.ctorParameters=function(){return[{type:m}]},e.propDecorators={type:[{type:t.Input}]},e}(),x=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.BidiModule,s.CommonModule],exports:[g,m,d,u,I,b],declarations:[g,m,d,u,I,b]}]}],e}();e.StepperSelectionEvent=h,e.STEP_STATE=y,e.STEPPER_GLOBAL_OPTIONS=_,e.MAT_STEPPER_GLOBAL_OPTIONS=f,e.CdkStep=g,e.CdkStepper=m,e.CdkStepLabel=u,e.CdkStepperNext=I,e.CdkStepperPrevious=b,e.CdkStepperModule=x,e.CdkStepHeader=d,Object.defineProperty(e,"__esModule",{value:!0})});
9
9
  //# sourceMappingURL=cdk-stepper.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cdk-stepper.umd.min.js","sources":["../../src/cdk/stepper/step-label.ts","../../src/cdk/stepper/step-header.ts","../../src/cdk/stepper/stepper.ts","../../src/cdk/stepper/stepper-button.ts","../../src/cdk/stepper/stepper-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef} from '@angular/core';\n\n@Directive({\n selector: '[cdkStepLabel]',\n})\nexport class CdkStepLabel {\n constructor(/** @docs-private */ public template: TemplateRef<any>) { }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, ElementRef} from '@angular/core';\nimport {FocusableOption} from '@angular/cdk/a11y';\n\n\n@Directive({\n selector: '[cdkStepHeader]',\n host: {\n 'role': 'tab',\n },\n})\nexport class CdkStepHeader implements FocusableOption {\n constructor(protected _elementRef: ElementRef<HTMLElement>) {}\n\n /** Focuses the step header. */\n focus() {\n this._elementRef.nativeElement.focus();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusableOption, FocusKeyManager} from '@angular/cdk/a11y';\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {END, ENTER, HOME, SPACE, hasModifierKey} from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n EventEmitter,\n ElementRef,\n forwardRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n InjectionToken,\n} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {AbstractControl} from '@angular/forms';\nimport {CdkStepLabel} from './step-label';\nimport {Observable, Subject, of as obaservableOf} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\nimport {CdkStepHeader} from './step-header';\n\n/** Used to generate unique ID for each stepper component. */\nlet nextId = 0;\n\n/**\n * Position state of the content of each step in stepper that is used for transitioning\n * the content into correct position upon step selection change.\n */\nexport type StepContentPositionState = 'previous' | 'current' | 'next';\n\n/** Possible orientation of a stepper. */\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\n/** Change event emitted on selection changes. */\nexport class StepperSelectionEvent {\n /** Index of the step now selected. */\n selectedIndex: number;\n\n /** Index of the step previously selected. */\n previouslySelectedIndex: number;\n\n /** The step instance now selected. */\n selectedStep: CdkStep;\n\n /** The step instance previously selected. */\n previouslySelectedStep: CdkStep;\n}\n\n/** The state of each step. */\nexport type StepState = 'number' | 'edit' | 'done' | 'error' | string;\n\n/** Enum to represent the different states of the steps. */\nexport const STEP_STATE = {\n NUMBER: 'number',\n EDIT: 'edit',\n DONE: 'done',\n ERROR: 'error'\n};\n\n/** InjectionToken that can be used to specify the global stepper options. */\nexport const MAT_STEPPER_GLOBAL_OPTIONS =\n new InjectionToken<StepperOptions>('mat-stepper-global-options');\n\n/** Configurable options for stepper. */\nexport interface StepperOptions {\n /**\n * Whether the stepper should display an error state or not.\n * Default behavior is assumed to be false.\n */\n showError?: boolean;\n\n /**\n * Whether the stepper should display the default indicator type\n * or not.\n * Default behavior is assumed to be true.\n */\n displayDefaultIndicatorType?: boolean;\n}\n\n@Component({\n moduleId: module.id,\n selector: 'cdk-step',\n exportAs: 'cdkStep',\n template: '<ng-template><ng-content></ng-content></ng-template>',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CdkStep implements OnChanges {\n private _stepperOptions: StepperOptions;\n _showError: boolean;\n _displayDefaultIndicatorType: boolean;\n\n /** Template for step label if it exists. */\n @ContentChild(CdkStepLabel) stepLabel: CdkStepLabel;\n\n /** Template for step content. */\n @ViewChild(TemplateRef) content: TemplateRef<any>;\n\n /** The top level abstract control of the step. */\n @Input() stepControl: AbstractControl;\n\n /** Whether user has seen the expanded step content or not. */\n interacted = false;\n\n /** Plain text label of the step. */\n @Input() label: string;\n\n /** Error message to display when there's an error. */\n @Input() errorMessage: string;\n\n /** Aria label for the tab. */\n @Input('aria-label') ariaLabel: string;\n\n /**\n * Reference to the element that the tab is labelled by.\n * Will be cleared if `aria-label` is set at the same time.\n */\n @Input('aria-labelledby') ariaLabelledby: string;\n\n /** State of the step. */\n @Input() state: StepState;\n\n /** Whether the user can return to this step once it has been marked as complted. */\n @Input()\n get editable(): boolean { return this._editable; }\n set editable(value: boolean) {\n this._editable = coerceBooleanProperty(value);\n }\n private _editable = true;\n\n /** Whether the completion of step is optional. */\n @Input()\n get optional(): boolean { return this._optional; }\n set optional(value: boolean) {\n this._optional = coerceBooleanProperty(value);\n }\n private _optional = false;\n\n /** Whether step is marked as completed. */\n @Input()\n get completed(): boolean {\n return this._customCompleted == null ? this._getDefaultCompleted() : this._customCompleted;\n }\n set completed(value: boolean) {\n this._customCompleted = coerceBooleanProperty(value);\n }\n private _customCompleted: boolean | null = null;\n\n private _getDefaultCompleted() {\n return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;\n }\n\n /** Whether step has an error. */\n @Input()\n get hasError(): boolean {\n return this._customError || this._getDefaultError();\n }\n set hasError(value: boolean) {\n this._customError = coerceBooleanProperty(value);\n }\n private _customError: boolean | null = null;\n\n private _getDefaultError() {\n return this.stepControl && this.stepControl.invalid && this.interacted;\n }\n\n /** @breaking-change 8.0.0 remove the `?` after `stepperOptions` */\n constructor(\n @Inject(forwardRef(() => CdkStepper)) private _stepper: CdkStepper,\n @Optional() @Inject(MAT_STEPPER_GLOBAL_OPTIONS) stepperOptions?: StepperOptions) {\n this._stepperOptions = stepperOptions ? stepperOptions : {};\n this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false;\n this._showError = !!this._stepperOptions.showError;\n }\n\n /** Selects this step component. */\n select(): void {\n this._stepper.selected = this;\n }\n\n /** Resets the step to its initial state. Note that this includes resetting form data. */\n reset(): void {\n this.interacted = false;\n\n if (this._customCompleted != null) {\n this._customCompleted = false;\n }\n\n if (this._customError != null) {\n this._customError = false;\n }\n\n if (this.stepControl) {\n this.stepControl.reset();\n }\n }\n\n ngOnChanges() {\n // Since basically all inputs of the MatStep get proxied through the view down to the\n // underlying MatStepHeader, we have to make sure that change detection runs correctly.\n this._stepper._stateChanged();\n }\n}\n\n@Directive({\n selector: '[cdkStepper]',\n exportAs: 'cdkStepper',\n})\nexport class CdkStepper implements AfterViewInit, OnDestroy {\n /** Emits when the component is destroyed. */\n protected _destroyed = new Subject<void>();\n\n /** Used for managing keyboard focus. */\n private _keyManager: FocusKeyManager<FocusableOption>;\n\n /**\n * @breaking-change 8.0.0 Remove `| undefined` once the `_document`\n * constructor param is required.\n */\n private _document: Document | undefined;\n\n /** The list of step components that the stepper is holding. */\n @ContentChildren(CdkStep) _steps: QueryList<CdkStep>;\n\n /**\n * The list of step headers of the steps in the stepper.\n * @deprecated Type to be changed to `QueryList<CdkStepHeader>`.\n * @breaking-change 8.0.0\n */\n @ContentChildren(CdkStepHeader) _stepHeader: QueryList<FocusableOption>;\n\n /** Whether the validity of previous steps should be checked or not. */\n @Input()\n get linear(): boolean { return this._linear; }\n set linear(value: boolean) { this._linear = coerceBooleanProperty(value); }\n private _linear = false;\n\n /** The index of the selected step. */\n @Input()\n get selectedIndex() { return this._selectedIndex; }\n set selectedIndex(index: number) {\n if (this._steps) {\n // Ensure that the index can't be out of bounds.\n if (index < 0 || index > this._steps.length - 1) {\n throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');\n }\n\n if (this._selectedIndex != index &&\n !this._anyControlsInvalidOrPending(index) &&\n (index >= this._selectedIndex || this._steps.toArray()[index].editable)) {\n this._updateSelectedItemIndex(index);\n }\n } else {\n this._selectedIndex = index;\n }\n }\n private _selectedIndex = 0;\n\n /** The step that is selected. */\n @Input()\n get selected(): CdkStep {\n // @breaking-change 8.0.0 Change return type to `CdkStep | undefined`.\n return this._steps ? this._steps.toArray()[this.selectedIndex] : undefined!;\n }\n set selected(step: CdkStep) {\n this.selectedIndex = this._steps ? this._steps.toArray().indexOf(step) : -1;\n }\n\n /** Event emitted when the selected step has changed. */\n @Output() selectionChange: EventEmitter<StepperSelectionEvent>\n = new EventEmitter<StepperSelectionEvent>();\n\n /** Used to track unique ID for each stepper component. */\n _groupId: number;\n\n protected _orientation: StepperOrientation = 'horizontal';\n\n constructor(\n @Optional() private _dir: Directionality,\n private _changeDetectorRef: ChangeDetectorRef,\n // @breaking-change 8.0.0 `_elementRef` and `_document` parameters to become required.\n private _elementRef?: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) _document?: any) {\n this._groupId = nextId++;\n this._document = _document;\n }\n\n ngAfterViewInit() {\n // Note that while the step headers are content children by default, any components that\n // extend this one might have them as view chidren. We initialize the keyboard handling in\n // AfterViewInit so we're guaranteed for both view and content children to be defined.\n this._keyManager = new FocusKeyManager<FocusableOption>(this._stepHeader)\n .withWrap()\n .withVerticalOrientation(this._orientation === 'vertical');\n\n (this._dir ? this._dir.change as Observable<Direction> : obaservableOf<Direction>())\n .pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))\n .subscribe(direction => this._keyManager.withHorizontalOrientation(direction));\n\n this._keyManager.updateActiveItemIndex(this._selectedIndex);\n\n this._steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => {\n if (!this.selected) {\n this._selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n });\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Selects and focuses the next step in list. */\n next(): void {\n this.selectedIndex = Math.min(this._selectedIndex + 1, this._steps.length - 1);\n }\n\n /** Selects and focuses the previous step in list. */\n previous(): void {\n this.selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n\n /** Resets the stepper to its initial state. Note that this includes clearing form data. */\n reset(): void {\n this._updateSelectedItemIndex(0);\n this._steps.forEach(step => step.reset());\n this._stateChanged();\n }\n\n /** Returns a unique id for each step label element. */\n _getStepLabelId(i: number): string {\n return `cdk-step-label-${this._groupId}-${i}`;\n }\n\n /** Returns unique id for each step content element. */\n _getStepContentId(i: number): string {\n return `cdk-step-content-${this._groupId}-${i}`;\n }\n\n /** Marks the component to be change detected. */\n _stateChanged() {\n this._changeDetectorRef.markForCheck();\n }\n\n /** Returns position state of the step with the given index. */\n _getAnimationDirection(index: number): StepContentPositionState {\n const position = index - this._selectedIndex;\n if (position < 0) {\n return this._layoutDirection() === 'rtl' ? 'next' : 'previous';\n } else if (position > 0) {\n return this._layoutDirection() === 'rtl' ? 'previous' : 'next';\n }\n return 'current';\n }\n\n /** Returns the type of icon to be displayed. */\n _getIndicatorType(index: number, state: StepState = STEP_STATE.NUMBER): StepState {\n const step = this._steps.toArray()[index];\n const isCurrentStep = this._isCurrentStep(index);\n\n return step._displayDefaultIndicatorType\n ? this._getDefaultIndicatorLogic(step, isCurrentStep)\n : this._getGuidelineLogic(step, isCurrentStep, state);\n }\n\n private _getDefaultIndicatorLogic(step: CdkStep, isCurrentStep: boolean): StepState {\n if (step._showError && step.hasError && !isCurrentStep) {\n return STEP_STATE.ERROR;\n } else if (!step.completed || isCurrentStep) {\n return STEP_STATE.NUMBER;\n } else {\n return step.editable ? STEP_STATE.EDIT : STEP_STATE.DONE;\n }\n }\n\n private _getGuidelineLogic(\n step: CdkStep,\n isCurrentStep: boolean,\n state: StepState = STEP_STATE.NUMBER): StepState {\n if (step._showError && step.hasError && !isCurrentStep) {\n return STEP_STATE.ERROR;\n } else if (step.completed && !isCurrentStep) {\n return STEP_STATE.DONE;\n } else if (step.completed && isCurrentStep) {\n return state;\n } else if (step.editable && isCurrentStep) {\n return STEP_STATE.EDIT;\n } else {\n return state;\n }\n }\n\n private _isCurrentStep(index: number) {\n return this._selectedIndex === index;\n }\n\n /** Returns the index of the currently-focused step header. */\n _getFocusIndex() {\n return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;\n }\n\n private _updateSelectedItemIndex(newIndex: number): void {\n const stepsArray = this._steps.toArray();\n this.selectionChange.emit({\n selectedIndex: newIndex,\n previouslySelectedIndex: this._selectedIndex,\n selectedStep: stepsArray[newIndex],\n previouslySelectedStep: stepsArray[this._selectedIndex],\n });\n\n // If focus is inside the stepper, move it to the next header, otherwise it may become\n // lost when the active step content is hidden. We can't be more granular with the check\n // (e.g. checking whether focus is inside the active step), because we don't have a\n // reference to the elements that are rendering out the content.\n this._containsFocus() ? this._keyManager.setActiveItem(newIndex) :\n this._keyManager.updateActiveItemIndex(newIndex);\n\n this._selectedIndex = newIndex;\n this._stateChanged();\n }\n\n _onKeydown(event: KeyboardEvent) {\n const hasModifier = hasModifierKey(event);\n const keyCode = event.keyCode;\n const manager = this._keyManager;\n\n if (manager.activeItemIndex != null && !hasModifier &&\n (keyCode === SPACE || keyCode === ENTER)) {\n this.selectedIndex = manager.activeItemIndex;\n event.preventDefault();\n } else if (keyCode === HOME) {\n manager.setFirstItemActive();\n event.preventDefault();\n } else if (keyCode === END) {\n manager.setLastItemActive();\n event.preventDefault();\n } else {\n manager.onKeydown(event);\n }\n }\n\n private _anyControlsInvalidOrPending(index: number): boolean {\n const steps = this._steps.toArray();\n\n steps[this._selectedIndex].interacted = true;\n\n if (this._linear && index >= 0) {\n return steps.slice(0, index).some(step => {\n const control = step.stepControl;\n const isIncomplete = control ?\n (control.invalid || control.pending || !step.interacted) :\n !step.completed;\n return isIncomplete && !step.optional;\n });\n }\n\n return false;\n }\n\n private _layoutDirection(): Direction {\n return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n }\n\n /** Checks whether the stepper contains the focused element. */\n private _containsFocus(): boolean {\n if (!this._document || !this._elementRef) {\n return false;\n }\n\n const stepperElement = this._elementRef.nativeElement;\n const focusedElement = this._document.activeElement;\n return stepperElement === focusedElement || stepperElement.contains(focusedElement);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, Input} from '@angular/core';\nimport {CdkStepper} from './stepper';\n\n/** Button that moves to the next step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperNext]',\n host: {\n '(click)': '_stepper.next()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperNext {\n /** Type of the next button. Defaults to \"submit\" if not specified. */\n @Input() type: string = 'submit';\n\n constructor(public _stepper: CdkStepper) {}\n}\n\n/** Button that moves to the previous step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperPrevious]',\n host: {\n '(click)': '_stepper.previous()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperPrevious {\n /** Type of the previous button. Defaults to \"button\" if not specified. */\n @Input() type: string = 'button';\n\n constructor(public _stepper: CdkStepper) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkStepper, CdkStep} from './stepper';\nimport {CommonModule} from '@angular/common';\nimport {CdkStepLabel} from './step-label';\nimport {CdkStepperNext, CdkStepperPrevious} from './stepper-button';\nimport {CdkStepHeader} from './step-header';\nimport {BidiModule} from '@angular/cdk/bidi';\n\n@NgModule({\n imports: [BidiModule, CommonModule],\n exports: [\n CdkStep,\n CdkStepper,\n CdkStepHeader,\n CdkStepLabel,\n CdkStepperNext,\n CdkStepperPrevious,\n ],\n declarations: [\n CdkStep,\n CdkStepper,\n CdkStepHeader,\n CdkStepLabel,\n CdkStepperNext,\n CdkStepperPrevious,\n ]\n})\nexport class CdkStepperModule {}\n"],"names":["CdkStepLabel","template","this","type","Directive","args","selector","TemplateRef","CdkStepHeader","_elementRef","prototype","focus","nativeElement","host","role","ElementRef","nextId","StepperSelectionEvent","STEP_STATE","NUMBER","EDIT","DONE","ERROR","MAT_STEPPER_GLOBAL_OPTIONS","InjectionToken","CdkStep","_stepper","stepperOptions","interacted","_editable","_optional","_customCompleted","_customError","_stepperOptions","_displayDefaultIndicatorType","displayDefaultIndicatorType","_showError","showError","Object","defineProperty","value","coerceBooleanProperty","_getDefaultCompleted","stepControl","valid","_getDefaultError","invalid","select","selected","reset","ngOnChanges","_stateChanged","Component","exportAs","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","propDecorators","Input","label","errorMessage","ariaLabel","ariaLabelledby","state","editable","optional","completed","hasError","CdkStepper","_dir","_changeDetectorRef","_selectedIndex","_groupId","_document","get","configurable","index","_steps","length","Error","_anyControlsInvalidOrPending","toArray","_updateSelectedItemIndex","enumerable","selectedIndex","set","_keyManager","FocusKeyManager","_stepHeader","withWrap","withVerticalOrientation","_orientation","obaservableOf","pipe","startWith","_layoutDirection","takeUntil","_destroyed","subscribe","direction","_this","withHorizontalOrientation","updateActiveItemIndex","changes","Math","max","complete","forEach","step","position","isCurrentStep","_isCurrentStep","_getDefaultIndicatorLogic","_getGuidelineLogic","stepsArray","newIndex","previouslySelectedIndex","selectedStep","previouslySelectedStep","_containsFocus","setActiveItem","hasModifier","hasModifierKey","event","keyCode","manager","SPACE","ENTER","HOME","setFirstItemActive","preventDefault","END","setLastItemActive","onKeydown","activeItemIndex","steps","_linear","slice","some","control","stepperElement","focusedElement","activeElement","decorators","undefined","Inject","DOCUMENT","linear","selectionChange","Output","CdkStepperNext","(click)","[type]","CdkStepperPrevious","CdkStepperModule","NgModule","imports","BidiModule","CommonModule","exports","declarations"],"mappings":";;;;;;;+xBAUA,IAAAA,GAAA,WAIE,QAAFA,GAA0CC,GAAAC,KAA1CD,SAA0CA,EAC1C,sBALAE,KAACC,EAAAA,UAADC,OACEC,SAAU,yDAHZH,KAAmBI,EAAAA,eAOnBP,KCHAQ,EAAA,WAOE,QAAFA,GAAwBC,GAAAP,KAAxBO,YAAwBA,EAMxB,MAHED,GAAFE,UAAAC,MAAE,WACET,KAAKO,YAAYG,cAAcD,wBAXnCR,KAACC,EAAAA,UAADC,OACEC,SAAU,kBACVO,MACEC,KAAQ,+CAPZX,KAAmBY,EAAAA,cAiBnBP,KC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AAA,QAGAb,WAAA7C,KAAA0D,EAAAA,QAMA0F,kBAAApJ,KAAAqJ,EAAAA,UA+BAjF,KCtRAkF,EAAA,WAWE,QAAFA,GAAqB/H,GAAAxB,KAArBwB,SAAqBA,EAFVxB,KAAXC,KAA0B,SAG1B,sBAZAA,KAACC,EAAAA,UAADC,OACEC,SAAU,yBACVO,MACE6I,UAAW,kBACXC,SAAU,gDAPdxJ,KAAQoE,uBAYRpE,OAAAA,KAAG0D,EAAAA,SAGH4F,KAGAG,EAAA,WAWE,QAAFA,GAAqBlI,GAAAxB,KAArBwB,SAAqBA,EAFVxB,KAAXC,KAA0B,SAG1B,sBAZAA,KAACC,EAAAA,UAADC,OACEC,SAAU,6BACVO,MACE6I,UAAW,sBACXC,SAAU,gDAtBdxJ,KAAQoE,uBA2BRpE,OAAAA,KAAG0D,EAAAA,SAGH+F,KCvBAC,EAAA,WAAA,QAAAA,MAmB+B,sBAnB/B1J,KAAC2J,EAAAA,SAADzJ,OACE0J,SAAUC,EAAAA,WAAYC,EAAAA,cACtBC,SACEzI,EACA8C,EACA/D,EACAR,EACAyJ,EACAG,GAEFO,cACE1I,EACA8C,EACA/D,EACAR,EACAyJ,EACAG,OAGJC"}
1
+ {"version":3,"file":"cdk-stepper.umd.min.js","sources":["../../src/cdk/stepper/step-label.ts","../../src/cdk/stepper/step-header.ts","../../src/cdk/stepper/stepper.ts","../../src/cdk/stepper/stepper-button.ts","../../src/cdk/stepper/stepper-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef} from '@angular/core';\n\n@Directive({\n selector: '[cdkStepLabel]',\n})\nexport class CdkStepLabel {\n constructor(/** @docs-private */ public template: TemplateRef<any>) { }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, ElementRef} from '@angular/core';\nimport {FocusableOption} from '@angular/cdk/a11y';\n\n\n@Directive({\n selector: '[cdkStepHeader]',\n host: {\n 'role': 'tab',\n },\n})\nexport class CdkStepHeader implements FocusableOption {\n constructor(protected _elementRef: ElementRef<HTMLElement>) {}\n\n /** Focuses the step header. */\n focus() {\n this._elementRef.nativeElement.focus();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusableOption, FocusKeyManager} from '@angular/cdk/a11y';\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {END, ENTER, HOME, SPACE, hasModifierKey} from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n EventEmitter,\n ElementRef,\n forwardRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n InjectionToken,\n} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {AbstractControl} from '@angular/forms';\nimport {CdkStepLabel} from './step-label';\nimport {Observable, Subject, of as obaservableOf} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\nimport {CdkStepHeader} from './step-header';\n\n/** Used to generate unique ID for each stepper component. */\nlet nextId = 0;\n\n/**\n * Position state of the content of each step in stepper that is used for transitioning\n * the content into correct position upon step selection change.\n */\nexport type StepContentPositionState = 'previous' | 'current' | 'next';\n\n/** Possible orientation of a stepper. */\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\n/** Change event emitted on selection changes. */\nexport class StepperSelectionEvent {\n /** Index of the step now selected. */\n selectedIndex: number;\n\n /** Index of the step previously selected. */\n previouslySelectedIndex: number;\n\n /** The step instance now selected. */\n selectedStep: CdkStep;\n\n /** The step instance previously selected. */\n previouslySelectedStep: CdkStep;\n}\n\n/** The state of each step. */\nexport type StepState = 'number' | 'edit' | 'done' | 'error' | string;\n\n/** Enum to represent the different states of the steps. */\nexport const STEP_STATE = {\n NUMBER: 'number',\n EDIT: 'edit',\n DONE: 'done',\n ERROR: 'error'\n};\n\n/** InjectionToken that can be used to specify the global stepper options. */\nexport const STEPPER_GLOBAL_OPTIONS =\n new InjectionToken<StepperOptions>('STEPPER_GLOBAL_OPTIONS');\n\n/**\n * InjectionToken that can be used to specify the global stepper options.\n * @deprecated Use `STEPPER_GLOBAL_OPTIONS` instead.\n * @breaking-change 8.0.0.\n */\nexport const MAT_STEPPER_GLOBAL_OPTIONS = STEPPER_GLOBAL_OPTIONS;\n\n/** Configurable options for stepper. */\nexport interface StepperOptions {\n /**\n * Whether the stepper should display an error state or not.\n * Default behavior is assumed to be false.\n */\n showError?: boolean;\n\n /**\n * Whether the stepper should display the default indicator type\n * or not.\n * Default behavior is assumed to be true.\n */\n displayDefaultIndicatorType?: boolean;\n}\n\n@Component({\n moduleId: module.id,\n selector: 'cdk-step',\n exportAs: 'cdkStep',\n template: '<ng-template><ng-content></ng-content></ng-template>',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CdkStep implements OnChanges {\n private _stepperOptions: StepperOptions;\n _showError: boolean;\n _displayDefaultIndicatorType: boolean;\n\n /** Template for step label if it exists. */\n @ContentChild(CdkStepLabel) stepLabel: CdkStepLabel;\n\n /** Template for step content. */\n @ViewChild(TemplateRef) content: TemplateRef<any>;\n\n /** The top level abstract control of the step. */\n @Input() stepControl: AbstractControl;\n\n /** Whether user has seen the expanded step content or not. */\n interacted = false;\n\n /** Plain text label of the step. */\n @Input() label: string;\n\n /** Error message to display when there's an error. */\n @Input() errorMessage: string;\n\n /** Aria label for the tab. */\n @Input('aria-label') ariaLabel: string;\n\n /**\n * Reference to the element that the tab is labelled by.\n * Will be cleared if `aria-label` is set at the same time.\n */\n @Input('aria-labelledby') ariaLabelledby: string;\n\n /** State of the step. */\n @Input() state: StepState;\n\n /** Whether the user can return to this step once it has been marked as complted. */\n @Input()\n get editable(): boolean { return this._editable; }\n set editable(value: boolean) {\n this._editable = coerceBooleanProperty(value);\n }\n private _editable = true;\n\n /** Whether the completion of step is optional. */\n @Input()\n get optional(): boolean { return this._optional; }\n set optional(value: boolean) {\n this._optional = coerceBooleanProperty(value);\n }\n private _optional = false;\n\n /** Whether step is marked as completed. */\n @Input()\n get completed(): boolean {\n return this._customCompleted == null ? this._getDefaultCompleted() : this._customCompleted;\n }\n set completed(value: boolean) {\n this._customCompleted = coerceBooleanProperty(value);\n }\n private _customCompleted: boolean | null = null;\n\n private _getDefaultCompleted() {\n return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;\n }\n\n /** Whether step has an error. */\n @Input()\n get hasError(): boolean {\n return this._customError == null ? this._getDefaultError() : this._customError;\n }\n set hasError(value: boolean) {\n this._customError = coerceBooleanProperty(value);\n }\n private _customError: boolean | null = null;\n\n private _getDefaultError() {\n return this.stepControl && this.stepControl.invalid && this.interacted;\n }\n\n /** @breaking-change 8.0.0 remove the `?` after `stepperOptions` */\n constructor(\n @Inject(forwardRef(() => CdkStepper)) private _stepper: CdkStepper,\n @Optional() @Inject(STEPPER_GLOBAL_OPTIONS) stepperOptions?: StepperOptions) {\n this._stepperOptions = stepperOptions ? stepperOptions : {};\n this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false;\n this._showError = !!this._stepperOptions.showError;\n }\n\n /** Selects this step component. */\n select(): void {\n this._stepper.selected = this;\n }\n\n /** Resets the step to its initial state. Note that this includes resetting form data. */\n reset(): void {\n this.interacted = false;\n\n if (this._customCompleted != null) {\n this._customCompleted = false;\n }\n\n if (this._customError != null) {\n this._customError = false;\n }\n\n if (this.stepControl) {\n this.stepControl.reset();\n }\n }\n\n ngOnChanges() {\n // Since basically all inputs of the MatStep get proxied through the view down to the\n // underlying MatStepHeader, we have to make sure that change detection runs correctly.\n this._stepper._stateChanged();\n }\n}\n\n@Directive({\n selector: '[cdkStepper]',\n exportAs: 'cdkStepper',\n})\nexport class CdkStepper implements AfterViewInit, OnDestroy {\n /** Emits when the component is destroyed. */\n protected _destroyed = new Subject<void>();\n\n /** Used for managing keyboard focus. */\n private _keyManager: FocusKeyManager<FocusableOption>;\n\n /**\n * @breaking-change 8.0.0 Remove `| undefined` once the `_document`\n * constructor param is required.\n */\n private _document: Document | undefined;\n\n /** The list of step components that the stepper is holding. */\n @ContentChildren(CdkStep) _steps: QueryList<CdkStep>;\n\n /**\n * The list of step headers of the steps in the stepper.\n * @deprecated Type to be changed to `QueryList<CdkStepHeader>`.\n * @breaking-change 8.0.0\n */\n @ContentChildren(CdkStepHeader) _stepHeader: QueryList<FocusableOption>;\n\n /** Whether the validity of previous steps should be checked or not. */\n @Input()\n get linear(): boolean { return this._linear; }\n set linear(value: boolean) { this._linear = coerceBooleanProperty(value); }\n private _linear = false;\n\n /** The index of the selected step. */\n @Input()\n get selectedIndex() { return this._selectedIndex; }\n set selectedIndex(index: number) {\n if (this._steps) {\n // Ensure that the index can't be out of bounds.\n if (index < 0 || index > this._steps.length - 1) {\n throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');\n }\n\n if (this._selectedIndex != index &&\n !this._anyControlsInvalidOrPending(index) &&\n (index >= this._selectedIndex || this._steps.toArray()[index].editable)) {\n this._updateSelectedItemIndex(index);\n }\n } else {\n this._selectedIndex = index;\n }\n }\n private _selectedIndex = 0;\n\n /** The step that is selected. */\n @Input()\n get selected(): CdkStep {\n // @breaking-change 8.0.0 Change return type to `CdkStep | undefined`.\n return this._steps ? this._steps.toArray()[this.selectedIndex] : undefined!;\n }\n set selected(step: CdkStep) {\n this.selectedIndex = this._steps ? this._steps.toArray().indexOf(step) : -1;\n }\n\n /** Event emitted when the selected step has changed. */\n @Output() selectionChange: EventEmitter<StepperSelectionEvent>\n = new EventEmitter<StepperSelectionEvent>();\n\n /** Used to track unique ID for each stepper component. */\n _groupId: number;\n\n protected _orientation: StepperOrientation = 'horizontal';\n\n constructor(\n @Optional() private _dir: Directionality,\n private _changeDetectorRef: ChangeDetectorRef,\n // @breaking-change 8.0.0 `_elementRef` and `_document` parameters to become required.\n private _elementRef?: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) _document?: any) {\n this._groupId = nextId++;\n this._document = _document;\n }\n\n ngAfterViewInit() {\n // Note that while the step headers are content children by default, any components that\n // extend this one might have them as view chidren. We initialize the keyboard handling in\n // AfterViewInit so we're guaranteed for both view and content children to be defined.\n this._keyManager = new FocusKeyManager<FocusableOption>(this._stepHeader)\n .withWrap()\n .withVerticalOrientation(this._orientation === 'vertical');\n\n (this._dir ? this._dir.change as Observable<Direction> : obaservableOf<Direction>())\n .pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))\n .subscribe(direction => this._keyManager.withHorizontalOrientation(direction));\n\n this._keyManager.updateActiveItemIndex(this._selectedIndex);\n\n this._steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => {\n if (!this.selected) {\n this._selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n });\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Selects and focuses the next step in list. */\n next(): void {\n this.selectedIndex = Math.min(this._selectedIndex + 1, this._steps.length - 1);\n }\n\n /** Selects and focuses the previous step in list. */\n previous(): void {\n this.selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n\n /** Resets the stepper to its initial state. Note that this includes clearing form data. */\n reset(): void {\n this._updateSelectedItemIndex(0);\n this._steps.forEach(step => step.reset());\n this._stateChanged();\n }\n\n /** Returns a unique id for each step label element. */\n _getStepLabelId(i: number): string {\n return `cdk-step-label-${this._groupId}-${i}`;\n }\n\n /** Returns unique id for each step content element. */\n _getStepContentId(i: number): string {\n return `cdk-step-content-${this._groupId}-${i}`;\n }\n\n /** Marks the component to be change detected. */\n _stateChanged() {\n this._changeDetectorRef.markForCheck();\n }\n\n /** Returns position state of the step with the given index. */\n _getAnimationDirection(index: number): StepContentPositionState {\n const position = index - this._selectedIndex;\n if (position < 0) {\n return this._layoutDirection() === 'rtl' ? 'next' : 'previous';\n } else if (position > 0) {\n return this._layoutDirection() === 'rtl' ? 'previous' : 'next';\n }\n return 'current';\n }\n\n /** Returns the type of icon to be displayed. */\n _getIndicatorType(index: number, state: StepState = STEP_STATE.NUMBER): StepState {\n const step = this._steps.toArray()[index];\n const isCurrentStep = this._isCurrentStep(index);\n\n return step._displayDefaultIndicatorType\n ? this._getDefaultIndicatorLogic(step, isCurrentStep)\n : this._getGuidelineLogic(step, isCurrentStep, state);\n }\n\n private _getDefaultIndicatorLogic(step: CdkStep, isCurrentStep: boolean): StepState {\n if (step._showError && step.hasError && !isCurrentStep) {\n return STEP_STATE.ERROR;\n } else if (!step.completed || isCurrentStep) {\n return STEP_STATE.NUMBER;\n } else {\n return step.editable ? STEP_STATE.EDIT : STEP_STATE.DONE;\n }\n }\n\n private _getGuidelineLogic(\n step: CdkStep,\n isCurrentStep: boolean,\n state: StepState = STEP_STATE.NUMBER): StepState {\n if (step._showError && step.hasError && !isCurrentStep) {\n return STEP_STATE.ERROR;\n } else if (step.completed && !isCurrentStep) {\n return STEP_STATE.DONE;\n } else if (step.completed && isCurrentStep) {\n return state;\n } else if (step.editable && isCurrentStep) {\n return STEP_STATE.EDIT;\n } else {\n return state;\n }\n }\n\n private _isCurrentStep(index: number) {\n return this._selectedIndex === index;\n }\n\n /** Returns the index of the currently-focused step header. */\n _getFocusIndex() {\n return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;\n }\n\n private _updateSelectedItemIndex(newIndex: number): void {\n const stepsArray = this._steps.toArray();\n this.selectionChange.emit({\n selectedIndex: newIndex,\n previouslySelectedIndex: this._selectedIndex,\n selectedStep: stepsArray[newIndex],\n previouslySelectedStep: stepsArray[this._selectedIndex],\n });\n\n // If focus is inside the stepper, move it to the next header, otherwise it may become\n // lost when the active step content is hidden. We can't be more granular with the check\n // (e.g. checking whether focus is inside the active step), because we don't have a\n // reference to the elements that are rendering out the content.\n this._containsFocus() ? this._keyManager.setActiveItem(newIndex) :\n this._keyManager.updateActiveItemIndex(newIndex);\n\n this._selectedIndex = newIndex;\n this._stateChanged();\n }\n\n _onKeydown(event: KeyboardEvent) {\n const hasModifier = hasModifierKey(event);\n const keyCode = event.keyCode;\n const manager = this._keyManager;\n\n if (manager.activeItemIndex != null && !hasModifier &&\n (keyCode === SPACE || keyCode === ENTER)) {\n this.selectedIndex = manager.activeItemIndex;\n event.preventDefault();\n } else if (keyCode === HOME) {\n manager.setFirstItemActive();\n event.preventDefault();\n } else if (keyCode === END) {\n manager.setLastItemActive();\n event.preventDefault();\n } else {\n manager.onKeydown(event);\n }\n }\n\n private _anyControlsInvalidOrPending(index: number): boolean {\n const steps = this._steps.toArray();\n\n steps[this._selectedIndex].interacted = true;\n\n if (this._linear && index >= 0) {\n return steps.slice(0, index).some(step => {\n const control = step.stepControl;\n const isIncomplete = control ?\n (control.invalid || control.pending || !step.interacted) :\n !step.completed;\n return isIncomplete && !step.optional;\n });\n }\n\n return false;\n }\n\n private _layoutDirection(): Direction {\n return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n }\n\n /** Checks whether the stepper contains the focused element. */\n private _containsFocus(): boolean {\n if (!this._document || !this._elementRef) {\n return false;\n }\n\n const stepperElement = this._elementRef.nativeElement;\n const focusedElement = this._document.activeElement;\n return stepperElement === focusedElement || stepperElement.contains(focusedElement);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, Input} from '@angular/core';\nimport {CdkStepper} from './stepper';\n\n/** Button that moves to the next step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperNext]',\n host: {\n '(click)': '_stepper.next()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperNext {\n /** Type of the next button. Defaults to \"submit\" if not specified. */\n @Input() type: string = 'submit';\n\n constructor(public _stepper: CdkStepper) {}\n}\n\n/** Button that moves to the previous step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperPrevious]',\n host: {\n '(click)': '_stepper.previous()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperPrevious {\n /** Type of the previous button. Defaults to \"button\" if not specified. */\n @Input() type: string = 'button';\n\n constructor(public _stepper: CdkStepper) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {CdkStepper, CdkStep} from './stepper';\nimport {CommonModule} from '@angular/common';\nimport {CdkStepLabel} from './step-label';\nimport {CdkStepperNext, CdkStepperPrevious} from './stepper-button';\nimport {CdkStepHeader} from './step-header';\nimport {BidiModule} from '@angular/cdk/bidi';\n\n@NgModule({\n imports: [BidiModule, CommonModule],\n exports: [\n CdkStep,\n CdkStepper,\n CdkStepHeader,\n CdkStepLabel,\n CdkStepperNext,\n CdkStepperPrevious,\n ],\n declarations: [\n CdkStep,\n CdkStepper,\n CdkStepHeader,\n CdkStepLabel,\n CdkStepperNext,\n CdkStepperPrevious,\n ]\n})\nexport class CdkStepperModule {}\n"],"names":["CdkStepLabel","template","this","type","Directive","args","selector","TemplateRef","CdkStepHeader","_elementRef","prototype","focus","nativeElement","host","role","ElementRef","nextId","StepperSelectionEvent","STEP_STATE","NUMBER","EDIT","DONE","ERROR","STEPPER_GLOBAL_OPTIONS","InjectionToken","MAT_STEPPER_GLOBAL_OPTIONS","CdkStep","_stepper","stepperOptions","interacted","_editable","_optional","_customCompleted","_customError","_stepperOptions","_displayDefaultIndicatorType","displayDefaultIndicatorType","_showError","showError","Object","defineProperty","value","coerceBooleanProperty","_getDefaultCompleted","stepControl","valid","_getDefaultError","invalid","select","selected","reset","ngOnChanges","_stateChanged","Component","exportAs","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","propDecorators","Input","label","errorMessage","ariaLabel","ariaLabelledby","state","editable","optional","completed","hasError","CdkStepper","_dir","_changeDetectorRef","_selectedIndex","_groupId","_document","get","configurable","index","_steps","length","Error","_anyControlsInvalidOrPending","toArray","_updateSelectedItemIndex","enumerable","selectedIndex","set","_keyManager","FocusKeyManager","_stepHeader","withWrap","withVerticalOrientation","_orientation","obaservableOf","pipe","startWith","_layoutDirection","takeUntil","_destroyed","subscribe","direction","_this","withHorizontalOrientation","updateActiveItemIndex","changes","Math","max","complete","forEach","step","position","isCurrentStep","_isCurrentStep","_getDefaultIndicatorLogic","_getGuidelineLogic","stepsArray","newIndex","previouslySelectedIndex","selectedStep","previouslySelectedStep","_containsFocus","setActiveItem","hasModifier","hasModifierKey","event","keyCode","manager","SPACE","ENTER","HOME","setFirstItemActive","preventDefault","END","setLastItemActive","onKeydown","activeItemIndex","steps","_linear","slice","some","control","stepperElement","focusedElement","activeElement","decorators","undefined","Inject","DOCUMENT","linear","selectionChange","Output","CdkStepperNext","(click)","[type]","CdkStepperPrevious","CdkStepperModule","NgModule","imports","BidiModule","CommonModule","exports","declarations"],"mappings":";;;;;;;+xBAUA,IAAAA,GAAA,WAIE,QAAFA,GAA0CC,GAAAC,KAA1CD,SAA0CA,EAC1C,sBALAE,KAACC,EAAAA,UAADC,OACEC,SAAU,yDAHZH,KAAmBI,EAAAA,eAOnBP,KCHAQ,EAAA,WAOE,QAAFA,GAAwBC,GAAAP,KAAxBO,YAAwBA,EAMxB,MAHED,GAAFE,UAAAC,MAAE,WACET,KAAKO,YAAYG,cAAcD,wBAXnCR,KAACC,EAAAA,UAADC,OACEC,SAAU,kBACVO,MACEC,KAAQ,+CAPZX,KAAmBY,EAAAA,cAiBnBP,KCkBIQ,EAAS,eAYb,QAAAC,MAYA,MAAAA,MAMaC,GACXC,OAAQ,SACRC,KAAM,OACNC,KAAM,OACNC,MAAO,SAIIC,EACX,GAA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,KAAAsJ,EAAAA,UA+BAjF,KC7RAkF,EAAA,WAWE,QAAFA,GAAqB/H,GAAAzB,KAArByB,SAAqBA,EAFVzB,KAAXC,KAA0B,SAG1B,sBAZAA,KAACC,EAAAA,UAADC,OACEC,SAAU,yBACVO,MACE8I,UAAW,kBACXC,SAAU,gDAPdzJ,KAAQqE,uBAYRrE,OAAAA,KAAG2D,EAAAA,SAGH4F,KAGAG,EAAA,WAWE,QAAFA,GAAqBlI,GAAAzB,KAArByB,SAAqBA,EAFVzB,KAAXC,KAA0B,SAG1B,sBAZAA,KAACC,EAAAA,UAADC,OACEC,SAAU,6BACVO,MACE8I,UAAW,sBACXC,SAAU,gDAtBdzJ,KAAQqE,uBA2BRrE,OAAAA,KAAG2D,EAAAA,SAGH+F,KCvBAC,EAAA,WAAA,QAAAA,MAmB+B,sBAnB/B3J,KAAC4J,EAAAA,SAAD1J,OACE2J,SAAUC,EAAAA,WAAYC,EAAAA,cACtBC,SACEzI,EACA8C,EACAhE,EACAR,EACA0J,EACAG,GAEFO,cACE1I,EACA8C,EACAhE,EACAR,EACA0J,EACAG,OAGJC"}
@@ -439,22 +439,14 @@ var CdkTextareaAutosize = /** @class */ (function () {
439
439
  textarea.style.height = height + "px";
440
440
  textarea.classList.remove('cdk-textarea-autosize-measuring');
441
441
  textarea.placeholder = placeholderText;
442
- // On Firefox resizing the textarea will prevent it from scrolling to the caret position.
443
- // We need to re-set the selection in order for it to scroll to the proper position.
444
- if (typeof requestAnimationFrame !== 'undefined') {
445
- this._ngZone.runOutsideAngular(function () { return requestAnimationFrame(function () {
446
- var selectionStart = textarea.selectionStart, selectionEnd = textarea.selectionEnd;
447
- // IE will throw an "Unspecified error" if we try to set the selection range after the
448
- // element has been removed from the DOM. Assert that the directive hasn't been destroyed
449
- // between the time we requested the animation frame and when it was executed.
450
- // Also note that we have to assert that the textarea is focused before we set the
451
- // selection range. Setting the selection range on a non-focused textarea will cause
452
- // it to receive focus on IE and Edge.
453
- if (!_this._destroyed.isStopped && document.activeElement === textarea) {
454
- textarea.setSelectionRange(selectionStart, selectionEnd);
455
- }
456
- }); });
457
- }
442
+ this._ngZone.runOutsideAngular(function () {
443
+ if (typeof requestAnimationFrame !== 'undefined') {
444
+ requestAnimationFrame(function () { return _this._scrollToCaretPosition(textarea); });
445
+ }
446
+ else {
447
+ setTimeout(function () { return _this._scrollToCaretPosition(textarea); });
448
+ }
449
+ });
458
450
  this._previousValue = value;
459
451
  this._previousMinRows = this._minRows;
460
452
  };
@@ -486,6 +478,39 @@ var CdkTextareaAutosize = /** @class */ (function () {
486
478
  function () {
487
479
  // no-op handler that ensures we're running change detection on input events.
488
480
  };
481
+ /**
482
+ * Scrolls a textarea to the caret position. On Firefox resizing the textarea will
483
+ * prevent it from scrolling to the caret position. We need to re-set the selection
484
+ * in order for it to scroll to the proper position.
485
+ */
486
+ /**
487
+ * Scrolls a textarea to the caret position. On Firefox resizing the textarea will
488
+ * prevent it from scrolling to the caret position. We need to re-set the selection
489
+ * in order for it to scroll to the proper position.
490
+ * @private
491
+ * @param {?} textarea
492
+ * @return {?}
493
+ */
494
+ CdkTextareaAutosize.prototype._scrollToCaretPosition = /**
495
+ * Scrolls a textarea to the caret position. On Firefox resizing the textarea will
496
+ * prevent it from scrolling to the caret position. We need to re-set the selection
497
+ * in order for it to scroll to the proper position.
498
+ * @private
499
+ * @param {?} textarea
500
+ * @return {?}
501
+ */
502
+ function (textarea) {
503
+ var selectionStart = textarea.selectionStart, selectionEnd = textarea.selectionEnd;
504
+ // IE will throw an "Unspecified error" if we try to set the selection range after the
505
+ // element has been removed from the DOM. Assert that the directive hasn't been destroyed
506
+ // between the time we requested the animation frame and when it was executed.
507
+ // Also note that we have to assert that the textarea is focused before we set the
508
+ // selection range. Setting the selection range on a non-focused textarea will cause
509
+ // it to receive focus on IE and Edge.
510
+ if (!this._destroyed.isStopped && document.activeElement === textarea) {
511
+ textarea.setSelectionRange(selectionStart, selectionEnd);
512
+ }
513
+ };
489
514
  CdkTextareaAutosize.decorators = [
490
515
  { type: core.Directive, args: [{
491
516
  selector: 'textarea[cdkTextareaAutosize]',