@angular/cdk 8.2.2 → 8.2.3

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 (63) hide show
  1. package/a11y/typings/index.metadata.json +1 -1
  2. package/bundles/cdk-a11y.umd.js +4 -1
  3. package/bundles/cdk-a11y.umd.js.map +1 -1
  4. package/bundles/cdk-a11y.umd.min.js +1 -1
  5. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  6. package/bundles/cdk-drag-drop.umd.js +2 -1
  7. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  8. package/bundles/cdk-drag-drop.umd.min.js +2 -2
  9. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  10. package/bundles/cdk-overlay.umd.js +4 -1
  11. package/bundles/cdk-overlay.umd.js.map +1 -1
  12. package/bundles/cdk-overlay.umd.min.js +1 -1
  13. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  14. package/bundles/cdk-stepper.umd.js +46 -40
  15. package/bundles/cdk-stepper.umd.js.map +1 -1
  16. package/bundles/cdk-stepper.umd.min.js +1 -1
  17. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  18. package/bundles/cdk-testing.umd.js +2 -1
  19. package/bundles/cdk-testing.umd.js.map +1 -1
  20. package/bundles/cdk-testing.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/esm2015/a11y.js +4 -1
  26. package/esm2015/a11y.js.map +1 -1
  27. package/esm2015/cdk.js +1 -1
  28. package/esm2015/cdk.js.map +1 -1
  29. package/esm2015/drag-drop.js +2 -1
  30. package/esm2015/drag-drop.js.map +1 -1
  31. package/esm2015/overlay.js +4 -1
  32. package/esm2015/overlay.js.map +1 -1
  33. package/esm2015/stepper.js +51 -45
  34. package/esm2015/stepper.js.map +1 -1
  35. package/esm2015/testing.js +2 -1
  36. package/esm2015/testing.js.map +1 -1
  37. package/esm5/a11y.es5.js +4 -1
  38. package/esm5/a11y.es5.js.map +1 -1
  39. package/esm5/cdk.es5.js +1 -1
  40. package/esm5/cdk.es5.js.map +1 -1
  41. package/esm5/drag-drop.es5.js +2 -1
  42. package/esm5/drag-drop.es5.js.map +1 -1
  43. package/esm5/overlay.es5.js +4 -1
  44. package/esm5/overlay.es5.js.map +1 -1
  45. package/esm5/stepper.es5.js +49 -43
  46. package/esm5/stepper.es5.js.map +1 -1
  47. package/esm5/testing.es5.js +2 -1
  48. package/esm5/testing.es5.js.map +1 -1
  49. package/package.json +3 -3
  50. package/schematics/ng-update/test-cases/misc/global-stylesheets-test.css +1 -0
  51. package/schematics/tsconfig.tsbuildinfo +2894 -2894
  52. package/schematics/update-tool/index.js +9 -5
  53. package/schematics/update-tool/index.js.map +1 -1
  54. package/stepper/typings/index.metadata.json +1 -1
  55. package/stepper/typings/stepper.d.ts +3 -3
  56. package/typings/a11y/index.metadata.json +1 -1
  57. package/typings/esm5/a11y/index.metadata.json +1 -1
  58. package/typings/esm5/index.metadata.json +1 -1
  59. package/typings/esm5/stepper/index.metadata.json +1 -1
  60. package/typings/esm5/stepper/stepper.d.ts +3 -3
  61. package/typings/index.metadata.json +1 -1
  62. package/typings/stepper/index.metadata.json +1 -1
  63. package/typings/stepper/stepper.d.ts +3 -3
@@ -5,37 +5,15 @@
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
- import { Directive, TemplateRef, ElementRef, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, EventEmitter, forwardRef, Inject, Input, Optional, Output, ViewChild, ViewEncapsulation, InjectionToken, HostListener, NgModule } from '@angular/core';
8
+ import { Directive, ElementRef, TemplateRef, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, EventEmitter, forwardRef, Inject, InjectionToken, Input, Optional, Output, ViewChild, ViewEncapsulation, HostListener, NgModule } from '@angular/core';
9
9
  import { FocusKeyManager } from '@angular/cdk/a11y';
10
10
  import { Directionality, BidiModule } from '@angular/cdk/bidi';
11
11
  import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
12
- import { END, ENTER, HOME, SPACE, hasModifierKey } from '@angular/cdk/keycodes';
12
+ import { END, ENTER, hasModifierKey, HOME, SPACE } from '@angular/cdk/keycodes';
13
13
  import { DOCUMENT, CommonModule } from '@angular/common';
14
- import { Subject, of } from 'rxjs';
14
+ import { of, Subject } from 'rxjs';
15
15
  import { startWith, takeUntil } from 'rxjs/operators';
16
16
 
17
- /**
18
- * @fileoverview added by tsickle
19
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
20
- */
21
- class CdkStepLabel {
22
- /**
23
- * @param {?} template
24
- */
25
- constructor(/** @docs-private */ template) {
26
- this.template = template;
27
- }
28
- }
29
- CdkStepLabel.decorators = [
30
- { type: Directive, args: [{
31
- selector: '[cdkStepLabel]',
32
- },] },
33
- ];
34
- /** @nocollapse */
35
- CdkStepLabel.ctorParameters = () => [
36
- { type: TemplateRef }
37
- ];
38
-
39
17
  /**
40
18
  * @fileoverview added by tsickle
41
19
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -68,6 +46,28 @@ CdkStepHeader.ctorParameters = () => [
68
46
  { type: ElementRef }
69
47
  ];
70
48
 
49
+ /**
50
+ * @fileoverview added by tsickle
51
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
52
+ */
53
+ class CdkStepLabel {
54
+ /**
55
+ * @param {?} template
56
+ */
57
+ constructor(/** @docs-private */ template) {
58
+ this.template = template;
59
+ }
60
+ }
61
+ CdkStepLabel.decorators = [
62
+ { type: Directive, args: [{
63
+ selector: '[cdkStepLabel]',
64
+ },] },
65
+ ];
66
+ /** @nocollapse */
67
+ CdkStepLabel.ctorParameters = () => [
68
+ { type: TemplateRef }
69
+ ];
70
+
71
71
  /**
72
72
  * @fileoverview added by tsickle
73
73
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -118,7 +118,7 @@ class CdkStep {
118
118
  this.interacted = false;
119
119
  this._editable = true;
120
120
  this._optional = false;
121
- this._customCompleted = null;
121
+ this._completedOverride = null;
122
122
  this._customError = null;
123
123
  this._stepperOptions = stepperOptions ? stepperOptions : {};
124
124
  this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false;
@@ -128,7 +128,9 @@ class CdkStep {
128
128
  * Whether the user can return to this step once it has been marked as completed.
129
129
  * @return {?}
130
130
  */
131
- get editable() { return this._editable; }
131
+ get editable() {
132
+ return this._editable;
133
+ }
132
134
  /**
133
135
  * @param {?} value
134
136
  * @return {?}
@@ -140,7 +142,9 @@ class CdkStep {
140
142
  * Whether the completion of step is optional.
141
143
  * @return {?}
142
144
  */
143
- get optional() { return this._optional; }
145
+ get optional() {
146
+ return this._optional;
147
+ }
144
148
  /**
145
149
  * @param {?} value
146
150
  * @return {?}
@@ -153,14 +157,14 @@ class CdkStep {
153
157
  * @return {?}
154
158
  */
155
159
  get completed() {
156
- return this._customCompleted == null ? this._getDefaultCompleted() : this._customCompleted;
160
+ return this._completedOverride == null ? this._getDefaultCompleted() : this._completedOverride;
157
161
  }
158
162
  /**
159
163
  * @param {?} value
160
164
  * @return {?}
161
165
  */
162
166
  set completed(value) {
163
- this._customCompleted = coerceBooleanProperty(value);
167
+ this._completedOverride = coerceBooleanProperty(value);
164
168
  }
165
169
  /**
166
170
  * @private
@@ -203,8 +207,8 @@ class CdkStep {
203
207
  */
204
208
  reset() {
205
209
  this.interacted = false;
206
- if (this._customCompleted != null) {
207
- this._customCompleted = false;
210
+ if (this._completedOverride != null) {
211
+ this._completedOverride = false;
208
212
  }
209
213
  if (this._customError != null) {
210
214
  this._customError = false;
@@ -288,17 +292,23 @@ class CdkStepper {
288
292
  * Whether the validity of previous steps should be checked or not.
289
293
  * @return {?}
290
294
  */
291
- get linear() { return this._linear; }
295
+ get linear() {
296
+ return this._linear;
297
+ }
292
298
  /**
293
299
  * @param {?} value
294
300
  * @return {?}
295
301
  */
296
- set linear(value) { this._linear = coerceBooleanProperty(value); }
302
+ set linear(value) {
303
+ this._linear = coerceBooleanProperty(value);
304
+ }
297
305
  /**
298
306
  * The index of the selected step.
299
307
  * @return {?}
300
308
  */
301
- get selectedIndex() { return this._selectedIndex; }
309
+ get selectedIndex() {
310
+ return this._selectedIndex;
311
+ }
302
312
  /**
303
313
  * @param {?} index
304
314
  * @return {?}
@@ -311,8 +321,7 @@ class CdkStepper {
311
321
  if (newIndex < 0 || newIndex > this.steps.length - 1) {
312
322
  throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');
313
323
  }
314
- if (this._selectedIndex != newIndex &&
315
- !this._anyControlsInvalidOrPending(newIndex) &&
324
+ if (this._selectedIndex != newIndex && !this._anyControlsInvalidOrPending(newIndex) &&
316
325
  (newIndex >= this._selectedIndex || this.steps.toArray()[newIndex].editable)) {
317
326
  this._updateSelectedItemIndex(index);
318
327
  }
@@ -346,7 +355,7 @@ class CdkStepper {
346
355
  this._keyManager = new FocusKeyManager(this._stepHeader)
347
356
  .withWrap()
348
357
  .withVerticalOrientation(this._orientation === 'vertical');
349
- (this._dir ? (/** @type {?} */ (this._dir.change)) : of())
358
+ (this._dir ? ((/** @type {?} */ (this._dir.change))) : of())
350
359
  .pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))
351
360
  .subscribe((/**
352
361
  * @param {?} direction
@@ -447,9 +456,8 @@ class CdkStepper {
447
456
  const step = this.steps.toArray()[index];
448
457
  /** @type {?} */
449
458
  const isCurrentStep = this._isCurrentStep(index);
450
- return step._displayDefaultIndicatorType
451
- ? this._getDefaultIndicatorLogic(step, isCurrentStep)
452
- : this._getGuidelineLogic(step, isCurrentStep, state);
459
+ return step._displayDefaultIndicatorType ? this._getDefaultIndicatorLogic(step, isCurrentStep) :
460
+ this._getGuidelineLogic(step, isCurrentStep, state);
453
461
  }
454
462
  /**
455
463
  * @private
@@ -576,10 +584,8 @@ class CdkStepper {
576
584
  /** @type {?} */
577
585
  const control = step.stepControl;
578
586
  /** @type {?} */
579
- const isIncomplete = control ?
580
- (control.invalid || control.pending || !step.interacted) :
581
- !step.completed;
582
- return isIncomplete && !step.optional;
587
+ const isIncomplete = control ? (control.invalid || control.pending || !step.interacted) : !step.completed;
588
+ return isIncomplete && !step.optional && !step._completedOverride;
583
589
  }));
584
590
  }
585
591
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"stepper.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, HostListener, Input} from '@angular/core';\n\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 '[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 // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.\n // In Ivy the `host` bindings will be merged when this class is extended, whereas in\n // ViewEngine they're overwritten.\n // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.\n // tslint:disable-next-line:no-host-decorator-in-concrete\n @HostListener('click')\n _handleClick() {\n this._stepper.next();\n }\n}\n\n/** Button that moves to the previous step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperPrevious]',\n host: {\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 // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.\n // In Ivy the `host` bindings will be merged when this class is extended, whereas in\n // ViewEngine they're overwritten.\n // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.\n // tslint:disable-next-line:no-host-decorator-in-concrete\n @HostListener('click')\n _handleClick() {\n this._stepper.previous();\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, coerceNumberProperty} 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 {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, {static: false}) stepLabel: CdkStepLabel;\n\n /** Template for step content. */\n @ViewChild(TemplateRef, {static: true}) content: TemplateRef<any>;\n\n /** The top level abstract control of the step. */\n @Input() stepControl: FormControlLike;\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 completed. */\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 /**\n * The list of step components that the stepper is holding.\n * @deprecated use `steps` instead\n * @breaking-change 9.0.0 remove this property\n */\n @ContentChildren(CdkStep) _steps: QueryList<CdkStep>;\n\n /** The list of step components that the stepper is holding. */\n get steps(): QueryList<CdkStep> {\n return this._steps;\n }\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 const newIndex = coerceNumberProperty(index);\n\n if (this.steps) {\n // Ensure that the index can't be out of bounds.\n if (newIndex < 0 || newIndex > this.steps.length - 1) {\n throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');\n }\n\n if (this._selectedIndex != newIndex &&\n !this._anyControlsInvalidOrPending(newIndex) &&\n (newIndex >= this._selectedIndex || this.steps.toArray()[newIndex].editable)) {\n this._updateSelectedItemIndex(index);\n }\n } else {\n this._selectedIndex = newIndex;\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\n/**\n * Simplified representation of a FormControl from @angular/forms.\n * Used to avoid having to bring in @angular/forms for a single optional interface.\n * @docs-private\n */\ninterface FormControlLike {\n asyncValidator: () => any | null;\n dirty: boolean;\n disabled: boolean;\n enabled: boolean;\n errors: {[key: string]: any} | null;\n invalid: boolean;\n parent: any;\n pending: boolean;\n pristine: boolean;\n root: FormControlLike;\n status: string;\n statusChanges: Observable<any>;\n touched: boolean;\n untouched: boolean;\n updateOn: any;\n valid: boolean;\n validator: () => any | null;\n value: any;\n valueChanges: Observable<any>;\n clearAsyncValidators(): void;\n clearValidators(): void;\n disable(opts?: any): void;\n enable(opts?: any): void;\n get(path: (string | number)[] | string): FormControlLike | null;\n getError(errorCode: string, path?: (string | number)[] | string): any;\n hasError(errorCode: string, path?: (string | number)[] | string): boolean;\n markAllAsTouched(): void;\n markAsDirty(opts?: any): void;\n markAsPending(opts?: any): void;\n markAsPristine(opts?: any): void;\n markAsTouched(opts?: any): void;\n markAsUntouched(opts?: any): void;\n patchValue(value: any, options?: Object): void;\n reset(value?: any, options?: Object): void;\n setAsyncValidators(newValidator: () => any | (() => any)[] | null): void;\n setErrors(errors: {[key: string]: any} | null, opts?: any): void;\n setParent(parent: any): void;\n setValidators(newValidator: () => any | (() => any)[] | null): void;\n setValue(value: any, options?: Object): void;\n updateValueAndValidity(opts?: any): void;\n patchValue(value: any, options?: any): void;\n registerOnChange(fn: Function): void;\n registerOnDisabledChange(fn: (isDisabled: boolean) => void): void;\n reset(formState?: any, options?: any): void;\n setValue(value: any, options?: any): void;\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":["obaservableOf"],"mappings":";;;;;;;;;;;;;;;;;;;;AIaA,MAAa,YAAY,CAAzB;;;;IACE,WAAF,sBAA0C,QAA0B,EAApE;QAA0C,IAA1C,CAAA,QAAkD,GAAR,QAAQ,CAAkB;KAAK;;;IAJzE,EAAA,IAAA,EAAC,SAAS,EAAV,IAAA,EAAA,CAAW;gBACT,QAAQ,EAAE,gBAAgB;aAC3B,EAAD,EAAA;;;;IAJA,EAAA,IAAA,EAAmB,WAAW,EAA9B;;;;;;;ADUA,MAAa,aAAa,CAA1B;;;;IACE,WAAF,CAAwB,WAAoC,EAA5D;QAAwB,IAAxB,CAAA,WAAmC,GAAX,WAAW,CAAyB;KAAI;;;;;IAG9D,KAAK,GAAP;QACI,IAAI,CAAC,WAAW,C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A,AAAA,MAAa,kBAAkB,CAA/B;;;;IAIE,WAAF,CAAqB,QAAoB,EAAzC;QAAqB,IAArB,CAAA,QAA6B,GAAR,QAAQ,CAAY;;;;QAF9B,IAAX,CAAA,IAAe,GAAW,QAAQ,CAAC;KAEU;;;;;;;;;IAQ3C,YAAY,GAAd;QACI,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;KAC1B;;;IApBH,EAAA,IAAA,EAAC,SAAS,EAAV,IAAA,EAAA,CAAW;gBACT,QAAQ,EAAE,4BAA4B;gBACtC,IAAI,EAAE;oBACJ,QAAQ,EAAE,MAAM;iBACjB;aACF,EAAD,EAAA;;;;IAhCA,EAAA,IAAA,EAAQ,UAAU,EAAlB;;;IAmCA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,CAAA;IASA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAG,YAAY,EAAf,IAAA,EAAA,CAAgB,OAAO,EAAvB,EAAA,CAAA;;;;;;;ADnBA,MAAa,gBAAgB,CAA7B;;;IAnBA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,OAAO,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;gBACnC,OAAO,EAAE;oBACP,OAAO;oBACP,UAAU;oBACV,aAAa;oBACb,YAAY;oBACZ,cAAc;oBACd,kBAAkB;iBACnB;gBACD,YAAY,EAAE;oBACZ,OAAO;oBACP,UAAU;oBACV,aAAa;oBACb,YAAY;oBACZ,cAAc;oBACd,kBAAkB;iBACnB;aACF,EAAD,EAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"stepper.js","sources":["../../../src/cdk/stepper/stepper-module.ts","../../../src/cdk/stepper/stepper-button.ts","../../../src/cdk/stepper/stepper.ts","../../../src/cdk/stepper/step-label.ts","../../../src/cdk/stepper/step-header.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, HostListener, Input} from '@angular/core';\n\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 '[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 // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.\n // In Ivy the `host` bindings will be merged when this class is extended, whereas in\n // ViewEngine they're overwritten.\n // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.\n // tslint:disable-next-line:no-host-decorator-in-concrete\n @HostListener('click')\n _handleClick() {\n this._stepper.next();\n }\n}\n\n/** Button that moves to the previous step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperPrevious]',\n host: {\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 // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.\n // In Ivy the `host` bindings will be merged when this class is extended, whereas in\n // ViewEngine they're overwritten.\n // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.\n // tslint:disable-next-line:no-host-decorator-in-concrete\n @HostListener('click')\n _handleClick() {\n this._stepper.previous();\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, coerceNumberProperty} from '@angular/cdk/coercion';\nimport {END, ENTER, hasModifierKey, HOME, SPACE} from '@angular/cdk/keycodes';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n ElementRef,\n EventEmitter,\n forwardRef,\n Inject,\n InjectionToken,\n Input,\n OnChanges,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {Observable, of as obaservableOf, Subject} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\n\nimport {CdkStepHeader} from './step-header';\nimport {CdkStepLabel} from './step-label';\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 = 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, {static: false}) stepLabel: CdkStepLabel;\n\n /** Template for step content. */\n @ViewChild(TemplateRef, {static: true}) content: TemplateRef<any>;\n\n /** The top level abstract control of the step. */\n @Input() stepControl: FormControlLike;\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 completed. */\n @Input()\n get editable(): boolean {\n return this._editable;\n }\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 {\n return this._optional;\n }\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._completedOverride == null ? this._getDefaultCompleted() : this._completedOverride;\n }\n set completed(value: boolean) {\n this._completedOverride = coerceBooleanProperty(value);\n }\n _completedOverride: 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._completedOverride != null) {\n this._completedOverride = 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 /**\n * The list of step components that the stepper is holding.\n * @deprecated use `steps` instead\n * @breaking-change 9.0.0 remove this property\n */\n @ContentChildren(CdkStep) _steps: QueryList<CdkStep>;\n\n /** The list of step components that the stepper is holding. */\n get steps(): QueryList<CdkStep> {\n return this._steps;\n }\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 {\n return this._linear;\n }\n set linear(value: boolean) {\n this._linear = coerceBooleanProperty(value);\n }\n private _linear = false;\n\n /** The index of the selected step. */\n @Input()\n get selectedIndex() {\n return this._selectedIndex;\n }\n set selectedIndex(index: number) {\n const newIndex = coerceNumberProperty(index);\n\n if (this.steps) {\n // Ensure that the index can't be out of bounds.\n if (newIndex < 0 || newIndex > this.steps.length - 1) {\n throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');\n }\n\n if (this._selectedIndex != newIndex && !this._anyControlsInvalidOrPending(newIndex) &&\n (newIndex >= this._selectedIndex || this.steps.toArray()[newIndex].editable)) {\n this._updateSelectedItemIndex(index);\n }\n } else {\n this._selectedIndex = newIndex;\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()\n selectionChange: EventEmitter<StepperSelectionEvent> = 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, private _changeDetectorRef: ChangeDetectorRef,\n // @breaking-change 8.0.0 `_elementRef` and `_document` parameters to become required.\n private _elementRef?: ElementRef<HTMLElement>, @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 ? 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, isCurrentStep: boolean, 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 =\n control ? (control.invalid || control.pending || !step.interacted) : !step.completed;\n return isIncomplete && !step.optional && !step._completedOverride;\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\n/**\n * Simplified representation of a FormControl from @angular/forms.\n * Used to avoid having to bring in @angular/forms for a single optional interface.\n * @docs-private\n */\ninterface FormControlLike {\n asyncValidator: () => any | null;\n dirty: boolean;\n disabled: boolean;\n enabled: boolean;\n errors: {[key: string]: any} | null;\n invalid: boolean;\n parent: any;\n pending: boolean;\n pristine: boolean;\n root: FormControlLike;\n status: string;\n statusChanges: Observable<any>;\n touched: boolean;\n untouched: boolean;\n updateOn: any;\n valid: boolean;\n validator: () => any | null;\n value: any;\n valueChanges: Observable<any>;\n clearAsyncValidators(): void;\n clearValidators(): void;\n disable(opts?: any): void;\n enable(opts?: any): void;\n get(path: (string | number)[] | string): FormControlLike | null;\n getError(errorCode: string, path?: (string | number)[] | string): any;\n hasError(errorCode: string, path?: (string | number)[] | string): boolean;\n markAllAsTouched(): void;\n markAsDirty(opts?: any): void;\n markAsPending(opts?: any): void;\n markAsPristine(opts?: any): void;\n markAsTouched(opts?: any): void;\n markAsUntouched(opts?: any): void;\n patchValue(value: any, options?: Object): void;\n reset(value?: any, options?: Object): void;\n setAsyncValidators(newValidator: () => any | (() => any)[] | null): void;\n setErrors(errors: {[key: string]: any} | null, opts?: any): void;\n setParent(parent: any): void;\n setValidators(newValidator: () => any | (() => any)[] | null): void;\n setValue(value: any, options?: Object): void;\n updateValueAndValidity(opts?: any): void;\n patchValue(value: any, options?: any): void;\n registerOnChange(fn: Function): void;\n registerOnDisabledChange(fn: (isDisabled: boolean) => void): void;\n reset(formState?: any, options?: any): void;\n setValue(value: any, options?: any): void;\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","/**\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"],"names":["obaservableOf"],"mappings":";;;;;;;;;;;;;;;;;;;;AIkBA,MAAa,aAAa,CAA1B;;;;IACE,WAAF,CAAwB,WAAoC,EAA5D;QAAwB,IAAxB,CAAA,WAAmC,GAAX,WAAW,CAAyB;KAAI;;;;;IAG9D,KAAK,GAAP;QACI,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;KACxC;;;IAZH,EAAA,IAAA,EAAC,SAAS,EAAV,IAAA,EAAA,CAAW;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,IAAI,EAAE;oBACJ,MAAM,EAAE,KAAK;iBACd;aACF,EAAD,EAAA;;;;IATA,EAAA,IAAA,EAAmB,UAAU,EAA7B;;;;;;;ADKA,MAAa,YAAY,CAAzB;;;;IACE,WAAF,sBAA0C,QAA0B,EAApE;QAA0C,IAA1C,CAAA,QAAkD,GAAR,QAAQ,CAAkB;KAAK;;;IAJzE,EAAA,IAAA,EAAC,SAAS,EAAV,IAAA,EAAA,CAAW;gBACT,QAAQ,EAAE,gBAAgB;aAC3B,EAAD,EAAA;;;;IAJA,EAAA,IAAA,EAAmB,WAAW,EAA9B;;;;;;;;;;;ADmCA,IAAI,MAAM,GAAG,CAAC,CAAd;;;;AAYA,AAAA,MAAa,qBAAqB,CAAlC;CAYC;;;;;AAMD,AAAA,MAAa,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACf,CAAD;;;;;AAGA,AAAA,MAAa,sBAAsB,GAAG,IAAI,cAAc,CAAiB,wBAAwB,CAAC,CAAlG;;;;;;;AAOA,AAAA,MAAa,0BAA0B,GAAG,sBAAsB,CAAhE;AA0BA,MAAa,OAAO,CAApB;;;;;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AnBA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,OAAO,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;gBACnC,OAAO,EAAE;oBACP,OAAO;oBACP,UAAU;oBACV,aAAa;oBACb,YAAY;oBACZ,cAAc;oBACd,kBAAkB;iBACnB;gBACD,YAAY,EAAE;oBACZ,OAAO;oBACP,UAAU;oBACV,aAAa;oBACb,YAAY;oBACZ,cAAc;oBACd,kBAAkB;iBACnB;aACF,EAAD,EAAA;;;;;;;;;;;;;;;"}
@@ -58,7 +58,8 @@ function createTouchEvent(type, pageX = 0, pageY = 0) {
58
58
  const event = document.createEvent('UIEvent');
59
59
  /** @type {?} */
60
60
  const touchDetails = { pageX, pageY };
61
- event.initUIEvent(type, true, true, window, 0);
61
+ // TS3.6 removes the initUIEvent method and suggests porting to "new UIEvent()".
62
+ ((/** @type {?} */ (event))).initUIEvent(type, true, true, window, 0);
62
63
  // Most of the browsers don't have a "initTouchEvent" method that can be used to define
63
64
  // the touch details.
64
65
  Object.defineProperties(event, {
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","sources":["../../../src/cdk/testing/type-in-element.ts","../../../src/cdk/testing/element-focus.ts","../../../src/cdk/testing/dispatch-events.ts","../../../src/cdk/testing/event-objects.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 {dispatchFakeEvent, dispatchKeyboardEvent} from './dispatch-events';\nimport {triggerFocus} from './element-focus';\nimport {ModifierKeys} from './event-objects';\n\n/**\n * Checks whether the given Element is a text input element.\n * @docs-private\n */\nexport function isTextInput(element: Element): element is HTMLInputElement | HTMLTextAreaElement {\n return element.nodeName.toLowerCase() === 'input' ||\n element.nodeName.toLowerCase() === 'textarea' ;\n}\n\n/**\n * Focuses an input, sets its value and dispatches\n * the `input` event, simulating the user typing.\n * @param element Element onto which to set the value.\n * @param keys The keys to send to the element.\n * @docs-private\n */\nexport function typeInElement(\n element: HTMLElement, ...keys: (string | {keyCode?: number, key?: string})[]): void;\n\n/**\n * Focuses an input, sets its value and dispatches\n * the `input` event, simulating the user typing.\n * @param element Element onto which to set the value.\n * @param modifiers Modifier keys that are held while typing.\n * @param keys The keys to send to the element.\n * @docs-private\n */\nexport function typeInElement(element: HTMLElement, modifiers: ModifierKeys,\n ...keys: (string | {keyCode?: number, key?: string})[]): void;\n\nexport function typeInElement(element: HTMLElement, ...modifiersAndKeys: any) {\n const first = modifiersAndKeys[0];\n let modifiers: ModifierKeys;\n let rest: (string | {keyCode?: number, key?: string})[];\n if (typeof first !== 'string' && first.keyCode === undefined && first.key === undefined) {\n modifiers = first;\n rest = modifiersAndKeys.slice(1);\n } else {\n modifiers = {};\n rest = modifiersAndKeys;\n }\n const keys: {keyCode?: number, key?: string}[] = rest\n .map(k => typeof k === 'string' ?\n k.split('').map(c => ({keyCode: c.toUpperCase().charCodeAt(0), key: c})) : [k])\n .reduce((arr, k) => arr.concat(k), []);\n\n triggerFocus(element);\n for (const key of keys) {\n dispatchKeyboardEvent(element, 'keydown', key.keyCode, key.key, element, modifiers);\n dispatchKeyboardEvent(element, 'keypress', key.keyCode, key.key, element, modifiers);\n if (isTextInput(element) && key.key && key.key.length === 1) {\n element.value += key.key;\n dispatchFakeEvent(element, 'input');\n }\n dispatchKeyboardEvent(element, 'keyup', key.keyCode, key.key, element, modifiers);\n }\n}\n\n/**\n * Clears the text in an input or textarea element.\n * @docs-private\n */\nexport function clearElement(element: HTMLInputElement | HTMLTextAreaElement) {\n triggerFocus(element as HTMLElement);\n element.value = '';\n dispatchFakeEvent(element, 'input');\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 {dispatchFakeEvent} from './dispatch-events';\n\nfunction triggerFocusChange(element: HTMLElement, event: 'focus' | 'blur') {\n let eventFired = false;\n const handler = () => eventFired = true;\n element.addEventListener(event, handler);\n element[event]();\n element.removeEventListener(event, handler);\n if (!eventFired) {\n dispatchFakeEvent(element, event);\n }\n}\n\n/**\n * Patches an elements focus and blur methods to emit events consistently and predictably.\n * This is necessary, because some browsers, like IE11, will call the focus handlers asynchronously,\n * while others won't fire them at all if the browser window is not focused.\n * @docs-private\n */\nexport function patchElementFocus(element: HTMLElement) {\n element.focus = () => dispatchFakeEvent(element, 'focus');\n element.blur = () => dispatchFakeEvent(element, 'blur');\n}\n\n/** @docs-private */\nexport function triggerFocus(element: HTMLElement) {\n triggerFocusChange(element, 'focus');\n}\n\n/** @docs-private */\nexport function triggerBlur(element: HTMLElement) {\n triggerFocusChange(element, 'blur');\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 {\n createFakeEvent,\n createKeyboardEvent,\n createMouseEvent,\n createTouchEvent,\n ModifierKeys\n} from './event-objects';\n\n/**\n * Utility to dispatch any event on a Node.\n * @docs-private\n */\nexport function dispatchEvent(node: Node | Window, event: Event): Event {\n node.dispatchEvent(event);\n return event;\n}\n\n/**\n * Shorthand to dispatch a fake event on a specified node.\n * @docs-private\n */\nexport function dispatchFakeEvent(node: Node | Window, type: string, canBubble?: boolean): Event {\n return dispatchEvent(node, createFakeEvent(type, canBubble));\n}\n\n/**\n * Shorthand to dispatch a keyboard event with a specified key code.\n * @docs-private\n */\nexport function dispatchKeyboardEvent(node: Node, type: string, keyCode?: number, key?: string,\n target?: Element, modifiers?: ModifierKeys): KeyboardEvent {\n return dispatchEvent(node,\n createKeyboardEvent(type, keyCode, key, target, modifiers)) as KeyboardEvent;\n}\n\n/**\n * Shorthand to dispatch a mouse event on the specified coordinates.\n * @docs-private\n */\nexport function dispatchMouseEvent(node: Node, type: string, x = 0, y = 0,\n event = createMouseEvent(type, x, y)): MouseEvent {\n return dispatchEvent(node, event) as MouseEvent;\n}\n\n/**\n * Shorthand to dispatch a touch event on the specified coordinates.\n * @docs-private\n */\nexport function dispatchTouchEvent(node: Node, type: string, x = 0, y = 0) {\n return dispatchEvent(node, createTouchEvent(type, x, y));\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\n/** Modifier keys that may be held while typing. */\nexport interface ModifierKeys {\n control?: boolean;\n alt?: boolean;\n shift?: boolean;\n meta?: boolean;\n}\n\n/**\n * Creates a browser MouseEvent with the specified options.\n * @docs-private\n */\nexport function createMouseEvent(type: string, x = 0, y = 0, button = 0) {\n const event = document.createEvent('MouseEvent');\n const originalPreventDefault = event.preventDefault;\n\n event.initMouseEvent(type,\n true, /* canBubble */\n true, /* cancelable */\n window, /* view */\n 0, /* detail */\n x, /* screenX */\n y, /* screenY */\n x, /* clientX */\n y, /* clientY */\n false, /* ctrlKey */\n false, /* altKey */\n false, /* shiftKey */\n false, /* metaKey */\n button, /* button */\n null /* relatedTarget */);\n\n // `initMouseEvent` doesn't allow us to pass the `buttons` and\n // defaults it to 0 which looks like a fake event.\n Object.defineProperty(event, 'buttons', {get: () => 1});\n\n // IE won't set `defaultPrevented` on synthetic events so we need to do it manually.\n event.preventDefault = function() {\n Object.defineProperty(event, 'defaultPrevented', { get: () => true });\n return originalPreventDefault.apply(this, arguments);\n };\n\n return event;\n}\n\n/**\n * Creates a browser TouchEvent with the specified pointer coordinates.\n * @docs-private\n */\nexport function createTouchEvent(type: string, pageX = 0, pageY = 0) {\n // In favor of creating events that work for most of the browsers, the event is created\n // as a basic UI Event. The necessary details for the event will be set manually.\n const event = document.createEvent('UIEvent');\n const touchDetails = {pageX, pageY};\n\n event.initUIEvent(type, true, true, window, 0);\n\n // Most of the browsers don't have a \"initTouchEvent\" method that can be used to define\n // the touch details.\n Object.defineProperties(event, {\n touches: {value: [touchDetails]},\n targetTouches: {value: [touchDetails]},\n changedTouches: {value: [touchDetails]}\n });\n\n return event;\n}\n\n/**\n * Dispatches a keydown event from an element.\n * @docs-private\n */\nexport function createKeyboardEvent(type: string, keyCode: number = 0, key: string = '',\n target?: Element, modifiers: ModifierKeys = {}) {\n const event = document.createEvent('KeyboardEvent') as any;\n const originalPreventDefault = event.preventDefault;\n\n // Firefox does not support `initKeyboardEvent`, but supports `initKeyEvent`.\n if (event.initKeyEvent) {\n event.initKeyEvent(type, true, true, window, modifiers.control, modifiers.alt, modifiers.shift,\n modifiers.meta, keyCode);\n } else {\n // `initKeyboardEvent` expects to receive modifiers as a whitespace-delimited string\n // See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/initKeyboardEvent\n const modifiersStr = (modifiers.control ? 'Control ' : '' + modifiers.alt ? 'Alt ' : '' +\n modifiers.shift ? 'Shift ' : '' + modifiers.meta ? 'Meta' : '').trim();\n event.initKeyboardEvent(type,\n true, /* canBubble */\n true, /* cancelable */\n window, /* view */\n 0, /* char */\n key, /* key */\n 0, /* location */\n modifiersStr, /* modifiersList */\n false /* repeat */);\n }\n\n // Webkit Browsers don't set the keyCode when calling the init function.\n // See related bug https://bugs.webkit.org/show_bug.cgi?id=16735\n Object.defineProperties(event, {\n keyCode: { get: () => keyCode },\n key: { get: () => key },\n target: { get: () => target },\n ctrlKey: { get: () => !!modifiers.control },\n altKey: { get: () => !!modifiers.alt },\n shiftKey: { get: () => !!modifiers.shift },\n metaKey: { get: () => !!modifiers.meta }\n });\n\n // IE won't set `defaultPrevented` on synthetic events so we need to do it manually.\n event.preventDefault = function() {\n Object.defineProperty(event, 'defaultPrevented', { get: () => true });\n return originalPreventDefault.apply(this, arguments);\n };\n\n return event;\n}\n\n/**\n * Creates a fake event object with any desired event type.\n * @docs-private\n */\nexport function createFakeEvent(type: string, canBubble = false, cancelable = true) {\n const event = document.createEvent('Event');\n event.initEvent(type, canBubble, cancelable);\n return event;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AGoBA,AAAA,SAAgB,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;;;;;;;;;;;"}
1
+ {"version":3,"file":"testing.js","sources":["../../../src/cdk/testing/type-in-element.ts","../../../src/cdk/testing/element-focus.ts","../../../src/cdk/testing/dispatch-events.ts","../../../src/cdk/testing/event-objects.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 {dispatchFakeEvent, dispatchKeyboardEvent} from './dispatch-events';\nimport {triggerFocus} from './element-focus';\nimport {ModifierKeys} from './event-objects';\n\n/**\n * Checks whether the given Element is a text input element.\n * @docs-private\n */\nexport function isTextInput(element: Element): element is HTMLInputElement | HTMLTextAreaElement {\n return element.nodeName.toLowerCase() === 'input' ||\n element.nodeName.toLowerCase() === 'textarea' ;\n}\n\n/**\n * Focuses an input, sets its value and dispatches\n * the `input` event, simulating the user typing.\n * @param element Element onto which to set the value.\n * @param keys The keys to send to the element.\n * @docs-private\n */\nexport function typeInElement(\n element: HTMLElement, ...keys: (string | {keyCode?: number, key?: string})[]): void;\n\n/**\n * Focuses an input, sets its value and dispatches\n * the `input` event, simulating the user typing.\n * @param element Element onto which to set the value.\n * @param modifiers Modifier keys that are held while typing.\n * @param keys The keys to send to the element.\n * @docs-private\n */\nexport function typeInElement(element: HTMLElement, modifiers: ModifierKeys,\n ...keys: (string | {keyCode?: number, key?: string})[]): void;\n\nexport function typeInElement(element: HTMLElement, ...modifiersAndKeys: any) {\n const first = modifiersAndKeys[0];\n let modifiers: ModifierKeys;\n let rest: (string | {keyCode?: number, key?: string})[];\n if (typeof first !== 'string' && first.keyCode === undefined && first.key === undefined) {\n modifiers = first;\n rest = modifiersAndKeys.slice(1);\n } else {\n modifiers = {};\n rest = modifiersAndKeys;\n }\n const keys: {keyCode?: number, key?: string}[] = rest\n .map(k => typeof k === 'string' ?\n k.split('').map(c => ({keyCode: c.toUpperCase().charCodeAt(0), key: c})) : [k])\n .reduce((arr, k) => arr.concat(k), []);\n\n triggerFocus(element);\n for (const key of keys) {\n dispatchKeyboardEvent(element, 'keydown', key.keyCode, key.key, element, modifiers);\n dispatchKeyboardEvent(element, 'keypress', key.keyCode, key.key, element, modifiers);\n if (isTextInput(element) && key.key && key.key.length === 1) {\n element.value += key.key;\n dispatchFakeEvent(element, 'input');\n }\n dispatchKeyboardEvent(element, 'keyup', key.keyCode, key.key, element, modifiers);\n }\n}\n\n/**\n * Clears the text in an input or textarea element.\n * @docs-private\n */\nexport function clearElement(element: HTMLInputElement | HTMLTextAreaElement) {\n triggerFocus(element as HTMLElement);\n element.value = '';\n dispatchFakeEvent(element, 'input');\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 {dispatchFakeEvent} from './dispatch-events';\n\nfunction triggerFocusChange(element: HTMLElement, event: 'focus' | 'blur') {\n let eventFired = false;\n const handler = () => eventFired = true;\n element.addEventListener(event, handler);\n element[event]();\n element.removeEventListener(event, handler);\n if (!eventFired) {\n dispatchFakeEvent(element, event);\n }\n}\n\n/**\n * Patches an elements focus and blur methods to emit events consistently and predictably.\n * This is necessary, because some browsers, like IE11, will call the focus handlers asynchronously,\n * while others won't fire them at all if the browser window is not focused.\n * @docs-private\n */\nexport function patchElementFocus(element: HTMLElement) {\n element.focus = () => dispatchFakeEvent(element, 'focus');\n element.blur = () => dispatchFakeEvent(element, 'blur');\n}\n\n/** @docs-private */\nexport function triggerFocus(element: HTMLElement) {\n triggerFocusChange(element, 'focus');\n}\n\n/** @docs-private */\nexport function triggerBlur(element: HTMLElement) {\n triggerFocusChange(element, 'blur');\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 {\n createFakeEvent,\n createKeyboardEvent,\n createMouseEvent,\n createTouchEvent,\n ModifierKeys\n} from './event-objects';\n\n/**\n * Utility to dispatch any event on a Node.\n * @docs-private\n */\nexport function dispatchEvent(node: Node | Window, event: Event): Event {\n node.dispatchEvent(event);\n return event;\n}\n\n/**\n * Shorthand to dispatch a fake event on a specified node.\n * @docs-private\n */\nexport function dispatchFakeEvent(node: Node | Window, type: string, canBubble?: boolean): Event {\n return dispatchEvent(node, createFakeEvent(type, canBubble));\n}\n\n/**\n * Shorthand to dispatch a keyboard event with a specified key code.\n * @docs-private\n */\nexport function dispatchKeyboardEvent(node: Node, type: string, keyCode?: number, key?: string,\n target?: Element, modifiers?: ModifierKeys): KeyboardEvent {\n return dispatchEvent(node,\n createKeyboardEvent(type, keyCode, key, target, modifiers)) as KeyboardEvent;\n}\n\n/**\n * Shorthand to dispatch a mouse event on the specified coordinates.\n * @docs-private\n */\nexport function dispatchMouseEvent(node: Node, type: string, x = 0, y = 0,\n event = createMouseEvent(type, x, y)): MouseEvent {\n return dispatchEvent(node, event) as MouseEvent;\n}\n\n/**\n * Shorthand to dispatch a touch event on the specified coordinates.\n * @docs-private\n */\nexport function dispatchTouchEvent(node: Node, type: string, x = 0, y = 0) {\n return dispatchEvent(node, createTouchEvent(type, x, y));\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\n/** Modifier keys that may be held while typing. */\nexport interface ModifierKeys {\n control?: boolean;\n alt?: boolean;\n shift?: boolean;\n meta?: boolean;\n}\n\n/**\n * Creates a browser MouseEvent with the specified options.\n * @docs-private\n */\nexport function createMouseEvent(type: string, x = 0, y = 0, button = 0) {\n const event = document.createEvent('MouseEvent');\n const originalPreventDefault = event.preventDefault;\n\n event.initMouseEvent(type,\n true, /* canBubble */\n true, /* cancelable */\n window, /* view */\n 0, /* detail */\n x, /* screenX */\n y, /* screenY */\n x, /* clientX */\n y, /* clientY */\n false, /* ctrlKey */\n false, /* altKey */\n false, /* shiftKey */\n false, /* metaKey */\n button, /* button */\n null /* relatedTarget */);\n\n // `initMouseEvent` doesn't allow us to pass the `buttons` and\n // defaults it to 0 which looks like a fake event.\n Object.defineProperty(event, 'buttons', {get: () => 1});\n\n // IE won't set `defaultPrevented` on synthetic events so we need to do it manually.\n event.preventDefault = function() {\n Object.defineProperty(event, 'defaultPrevented', { get: () => true });\n return originalPreventDefault.apply(this, arguments);\n };\n\n return event;\n}\n\n/**\n * Creates a browser TouchEvent with the specified pointer coordinates.\n * @docs-private\n */\nexport function createTouchEvent(type: string, pageX = 0, pageY = 0) {\n // In favor of creating events that work for most of the browsers, the event is created\n // as a basic UI Event. The necessary details for the event will be set manually.\n const event = document.createEvent('UIEvent');\n const touchDetails = {pageX, pageY};\n\n // TS3.6 removes the initUIEvent method and suggests porting to \"new UIEvent()\".\n (event as any).initUIEvent(type, true, true, window, 0);\n\n // Most of the browsers don't have a \"initTouchEvent\" method that can be used to define\n // the touch details.\n Object.defineProperties(event, {\n touches: {value: [touchDetails]},\n targetTouches: {value: [touchDetails]},\n changedTouches: {value: [touchDetails]}\n });\n\n return event;\n}\n\n/**\n * Dispatches a keydown event from an element.\n * @docs-private\n */\nexport function createKeyboardEvent(type: string, keyCode: number = 0, key: string = '',\n target?: Element, modifiers: ModifierKeys = {}) {\n const event = document.createEvent('KeyboardEvent') as any;\n const originalPreventDefault = event.preventDefault;\n\n // Firefox does not support `initKeyboardEvent`, but supports `initKeyEvent`.\n if (event.initKeyEvent) {\n event.initKeyEvent(type, true, true, window, modifiers.control, modifiers.alt, modifiers.shift,\n modifiers.meta, keyCode);\n } else {\n // `initKeyboardEvent` expects to receive modifiers as a whitespace-delimited string\n // See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/initKeyboardEvent\n const modifiersStr = (modifiers.control ? 'Control ' : '' + modifiers.alt ? 'Alt ' : '' +\n modifiers.shift ? 'Shift ' : '' + modifiers.meta ? 'Meta' : '').trim();\n event.initKeyboardEvent(type,\n true, /* canBubble */\n true, /* cancelable */\n window, /* view */\n 0, /* char */\n key, /* key */\n 0, /* location */\n modifiersStr, /* modifiersList */\n false /* repeat */);\n }\n\n // Webkit Browsers don't set the keyCode when calling the init function.\n // See related bug https://bugs.webkit.org/show_bug.cgi?id=16735\n Object.defineProperties(event, {\n keyCode: { get: () => keyCode },\n key: { get: () => key },\n target: { get: () => target },\n ctrlKey: { get: () => !!modifiers.control },\n altKey: { get: () => !!modifiers.alt },\n shiftKey: { get: () => !!modifiers.shift },\n metaKey: { get: () => !!modifiers.meta }\n });\n\n // IE won't set `defaultPrevented` on synthetic events so we need to do it manually.\n event.preventDefault = function() {\n Object.defineProperty(event, 'defaultPrevented', { get: () => true });\n return originalPreventDefault.apply(this, arguments);\n };\n\n return event;\n}\n\n/**\n * Creates a fake event object with any desired event type.\n * @docs-private\n */\nexport function createFakeEvent(type: string, canBubble = false, cancelable = true) {\n const event = document.createEvent('Event');\n event.initEvent(type, canBubble, cancelable);\n return event;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AGoBA,AAAA,SAAgB,gBAAgB,CAAC,IAAY,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAvE;;IACA,MAAQ,KAAK,GAAG,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,CAAlD;;IACA,MAAQ,sBAAsB,GAAG,KAAK,CAAC,cAAc,CAArD;IAEE,KAAK,CAAC,cAAc,CAAC,IAAI,EACvB,IAAI,kBACJ,IAAI,mBACJ,MAAM,aACN,CAAC,eACD,CAAC,gBACD,CAAC,gBACD,CAAC,gBACD,CAAC,gBACD,KAAK,gBACL,KAAK,eACL,KAAK,iBACL,KAAK,gBACL,MAAM,eACN,IAAI,qBAAqB,CAAC;;;IAI5B,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,EAAC,GAAG;;;QAAE,MAAM,CAAC,CAAA,EAAC,CAAC,CAAC;;IAGxD,KAAK,CAAC,cAAc;;;IAAG,YAAzB;QACI,MAAM,CAAC,c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GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QACrF,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;YAC3D,OAAO,CAAC,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC;YACzB,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;SACrC;QACD,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;KACnF;CACF;;;;;;;AAMD,AAAA,SAAgB,YAAY,CAAC,OAA+C,EAA5E;IACE,YAAY,oBAAC,OAAO,GAAgB,CAAC;IACrC,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;IACnB,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;CACrC;;;;;;;;;;;;;;"}
package/esm5/a11y.es5.js CHANGED
@@ -2558,7 +2558,10 @@ var FocusMonitor = /** @class */ (function () {
2558
2558
  if (_this._touchTimeoutId != null) {
2559
2559
  clearTimeout(_this._touchTimeoutId);
2560
2560
  }
2561
- _this._lastTouchTarget = event.target;
2561
+ // Since this listener is bound on the `document` level, any events coming from the shadow DOM
2562
+ // will have their `target` set to the shadow root. If available, use `composedPath` to
2563
+ // figure out the event target.
2564
+ _this._lastTouchTarget = event.composedPath ? event.composedPath()[0] : event.target;
2562
2565
  _this._touchTimeoutId = setTimeout((/**
2563
2566
  * @return {?}
2564
2567
  */