| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954 |
- /**
- * @license
- * Copyright Google LLC All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
- import { Directive, ElementRef, TemplateRef, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, EventEmitter, forwardRef, Inject, InjectionToken, Input, Optional, Output, ViewChild, ViewEncapsulation, HostListener, NgModule } from '@angular/core';
- import { FocusKeyManager } from '@angular/cdk/a11y';
- import { Directionality, BidiModule } from '@angular/cdk/bidi';
- import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
- import { END, ENTER, hasModifierKey, HOME, SPACE } from '@angular/cdk/keycodes';
- import { DOCUMENT, CommonModule } from '@angular/common';
- import { of, Subject } from 'rxjs';
- import { startWith, takeUntil } from 'rxjs/operators';
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var CdkStepHeader = /** @class */ (function () {
- function CdkStepHeader(_elementRef) {
- this._elementRef = _elementRef;
- }
- /** Focuses the step header. */
- /**
- * Focuses the step header.
- * @return {?}
- */
- CdkStepHeader.prototype.focus = /**
- * Focuses the step header.
- * @return {?}
- */
- function () {
- this._elementRef.nativeElement.focus();
- };
- CdkStepHeader.decorators = [
- { type: Directive, args: [{
- selector: '[cdkStepHeader]',
- host: {
- 'role': 'tab',
- },
- },] },
- ];
- /** @nocollapse */
- CdkStepHeader.ctorParameters = function () { return [
- { type: ElementRef }
- ]; };
- return CdkStepHeader;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var CdkStepLabel = /** @class */ (function () {
- function CdkStepLabel(/** @docs-private */ template) {
- this.template = template;
- }
- CdkStepLabel.decorators = [
- { type: Directive, args: [{
- selector: '[cdkStepLabel]',
- },] },
- ];
- /** @nocollapse */
- CdkStepLabel.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return CdkStepLabel;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * Used to generate unique ID for each stepper component.
- * @type {?}
- */
- var nextId = 0;
- /**
- * Change event emitted on selection changes.
- */
- var /**
- * Change event emitted on selection changes.
- */
- StepperSelectionEvent = /** @class */ (function () {
- function StepperSelectionEvent() {
- }
- return StepperSelectionEvent;
- }());
- /**
- * Enum to represent the different states of the steps.
- * @type {?}
- */
- var STEP_STATE = {
- NUMBER: 'number',
- EDIT: 'edit',
- DONE: 'done',
- ERROR: 'error'
- };
- /**
- * InjectionToken that can be used to specify the global stepper options.
- * @type {?}
- */
- var STEPPER_GLOBAL_OPTIONS = new InjectionToken('STEPPER_GLOBAL_OPTIONS');
- /**
- * InjectionToken that can be used to specify the global stepper options.
- * @deprecated Use `STEPPER_GLOBAL_OPTIONS` instead.
- * \@breaking-change 8.0.0.
- * @type {?}
- */
- var MAT_STEPPER_GLOBAL_OPTIONS = STEPPER_GLOBAL_OPTIONS;
- var CdkStep = /** @class */ (function () {
- /** @breaking-change 8.0.0 remove the `?` after `stepperOptions` */
- function CdkStep(_stepper, stepperOptions) {
- this._stepper = _stepper;
- /**
- * Whether user has seen the expanded step content or not.
- */
- this.interacted = false;
- this._editable = true;
- this._optional = false;
- this._completedOverride = null;
- this._customError = null;
- this._stepperOptions = stepperOptions ? stepperOptions : {};
- this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false;
- this._showError = !!this._stepperOptions.showError;
- }
- Object.defineProperty(CdkStep.prototype, "editable", {
- /** Whether the user can return to this step once it has been marked as completed. */
- get: /**
- * Whether the user can return to this step once it has been marked as completed.
- * @return {?}
- */
- function () {
- return this._editable;
- },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._editable = coerceBooleanProperty(value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(CdkStep.prototype, "optional", {
- /** Whether the completion of step is optional. */
- get: /**
- * Whether the completion of step is optional.
- * @return {?}
- */
- function () {
- return this._optional;
- },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._optional = coerceBooleanProperty(value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(CdkStep.prototype, "completed", {
- /** Whether step is marked as completed. */
- get: /**
- * Whether step is marked as completed.
- * @return {?}
- */
- function () {
- return this._completedOverride == null ? this._getDefaultCompleted() : this._completedOverride;
- },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._completedOverride = coerceBooleanProperty(value);
- },
- enumerable: true,
- configurable: true
- });
- /**
- * @private
- * @return {?}
- */
- CdkStep.prototype._getDefaultCompleted = /**
- * @private
- * @return {?}
- */
- function () {
- return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;
- };
- Object.defineProperty(CdkStep.prototype, "hasError", {
- /** Whether step has an error. */
- get: /**
- * Whether step has an error.
- * @return {?}
- */
- function () {
- return this._customError == null ? this._getDefaultError() : this._customError;
- },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._customError = coerceBooleanProperty(value);
- },
- enumerable: true,
- configurable: true
- });
- /**
- * @private
- * @return {?}
- */
- CdkStep.prototype._getDefaultError = /**
- * @private
- * @return {?}
- */
- function () {
- return this.stepControl && this.stepControl.invalid && this.interacted;
- };
- /** Selects this step component. */
- /**
- * Selects this step component.
- * @return {?}
- */
- CdkStep.prototype.select = /**
- * Selects this step component.
- * @return {?}
- */
- function () {
- this._stepper.selected = this;
- };
- /** Resets the step to its initial state. Note that this includes resetting form data. */
- /**
- * Resets the step to its initial state. Note that this includes resetting form data.
- * @return {?}
- */
- CdkStep.prototype.reset = /**
- * Resets the step to its initial state. Note that this includes resetting form data.
- * @return {?}
- */
- function () {
- this.interacted = false;
- if (this._completedOverride != null) {
- this._completedOverride = false;
- }
- if (this._customError != null) {
- this._customError = false;
- }
- if (this.stepControl) {
- this.stepControl.reset();
- }
- };
- /**
- * @return {?}
- */
- CdkStep.prototype.ngOnChanges = /**
- * @return {?}
- */
- function () {
- // Since basically all inputs of the MatStep get proxied through the view down to the
- // underlying MatStepHeader, we have to make sure that change detection runs correctly.
- this._stepper._stateChanged();
- };
- CdkStep.decorators = [
- { type: Component, args: [{selector: 'cdk-step',
- exportAs: 'cdkStep',
- template: '<ng-template><ng-content></ng-content></ng-template>',
- encapsulation: ViewEncapsulation.None,
- changeDetection: ChangeDetectionStrategy.OnPush,
- },] },
- ];
- /** @nocollapse */
- CdkStep.ctorParameters = function () { return [
- { type: CdkStepper, decorators: [{ type: Inject, args: [forwardRef((/**
- * @return {?}
- */
- function () { return CdkStepper; })),] }] },
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [STEPPER_GLOBAL_OPTIONS,] }] }
- ]; };
- CdkStep.propDecorators = {
- stepLabel: [{ type: ContentChild, args: [CdkStepLabel, { static: false },] }],
- content: [{ type: ViewChild, args: [TemplateRef, { static: true },] }],
- stepControl: [{ type: Input }],
- label: [{ type: Input }],
- errorMessage: [{ type: Input }],
- ariaLabel: [{ type: Input, args: ['aria-label',] }],
- ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
- state: [{ type: Input }],
- editable: [{ type: Input }],
- optional: [{ type: Input }],
- completed: [{ type: Input }],
- hasError: [{ type: Input }]
- };
- return CdkStep;
- }());
- var CdkStepper = /** @class */ (function () {
- function CdkStepper(_dir, _changeDetectorRef, _elementRef, _document) {
- this._dir = _dir;
- this._changeDetectorRef = _changeDetectorRef;
- this._elementRef = _elementRef;
- /**
- * Emits when the component is destroyed.
- */
- this._destroyed = new Subject();
- this._linear = false;
- this._selectedIndex = 0;
- /**
- * Event emitted when the selected step has changed.
- */
- this.selectionChange = new EventEmitter();
- this._orientation = 'horizontal';
- this._groupId = nextId++;
- this._document = _document;
- }
- Object.defineProperty(CdkStepper.prototype, "steps", {
- /** The list of step components that the stepper is holding. */
- get: /**
- * The list of step components that the stepper is holding.
- * @return {?}
- */
- function () {
- return this._steps;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(CdkStepper.prototype, "linear", {
- /** Whether the validity of previous steps should be checked or not. */
- get: /**
- * Whether the validity of previous steps should be checked or not.
- * @return {?}
- */
- function () {
- return this._linear;
- },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._linear = coerceBooleanProperty(value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(CdkStepper.prototype, "selectedIndex", {
- /** The index of the selected step. */
- get: /**
- * The index of the selected step.
- * @return {?}
- */
- function () {
- return this._selectedIndex;
- },
- set: /**
- * @param {?} index
- * @return {?}
- */
- function (index) {
- /** @type {?} */
- var newIndex = coerceNumberProperty(index);
- if (this.steps) {
- // Ensure that the index can't be out of bounds.
- if (newIndex < 0 || newIndex > this.steps.length - 1) {
- throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');
- }
- if (this._selectedIndex != newIndex && !this._anyControlsInvalidOrPending(newIndex) &&
- (newIndex >= this._selectedIndex || this.steps.toArray()[newIndex].editable)) {
- this._updateSelectedItemIndex(index);
- }
- }
- else {
- this._selectedIndex = newIndex;
- }
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(CdkStepper.prototype, "selected", {
- /** The step that is selected. */
- get: /**
- * The step that is selected.
- * @return {?}
- */
- function () {
- // @breaking-change 8.0.0 Change return type to `CdkStep | undefined`.
- return this.steps ? this.steps.toArray()[this.selectedIndex] : (/** @type {?} */ (undefined));
- },
- set: /**
- * @param {?} step
- * @return {?}
- */
- function (step) {
- this.selectedIndex = this.steps ? this.steps.toArray().indexOf(step) : -1;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * @return {?}
- */
- CdkStepper.prototype.ngAfterViewInit = /**
- * @return {?}
- */
- function () {
- var _this = this;
- // Note that while the step headers are content children by default, any components that
- // extend this one might have them as view chidren. We initialize the keyboard handling in
- // AfterViewInit so we're guaranteed for both view and content children to be defined.
- this._keyManager = new FocusKeyManager(this._stepHeader)
- .withWrap()
- .withVerticalOrientation(this._orientation === 'vertical');
- (this._dir ? ((/** @type {?} */ (this._dir.change))) : of())
- .pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))
- .subscribe((/**
- * @param {?} direction
- * @return {?}
- */
- function (direction) { return _this._keyManager.withHorizontalOrientation(direction); }));
- this._keyManager.updateActiveItemIndex(this._selectedIndex);
- this.steps.changes.pipe(takeUntil(this._destroyed)).subscribe((/**
- * @return {?}
- */
- function () {
- if (!_this.selected) {
- _this._selectedIndex = Math.max(_this._selectedIndex - 1, 0);
- }
- }));
- };
- /**
- * @return {?}
- */
- CdkStepper.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () {
- this._destroyed.next();
- this._destroyed.complete();
- };
- /** Selects and focuses the next step in list. */
- /**
- * Selects and focuses the next step in list.
- * @return {?}
- */
- CdkStepper.prototype.next = /**
- * Selects and focuses the next step in list.
- * @return {?}
- */
- function () {
- this.selectedIndex = Math.min(this._selectedIndex + 1, this.steps.length - 1);
- };
- /** Selects and focuses the previous step in list. */
- /**
- * Selects and focuses the previous step in list.
- * @return {?}
- */
- CdkStepper.prototype.previous = /**
- * Selects and focuses the previous step in list.
- * @return {?}
- */
- function () {
- this.selectedIndex = Math.max(this._selectedIndex - 1, 0);
- };
- /** Resets the stepper to its initial state. Note that this includes clearing form data. */
- /**
- * Resets the stepper to its initial state. Note that this includes clearing form data.
- * @return {?}
- */
- CdkStepper.prototype.reset = /**
- * Resets the stepper to its initial state. Note that this includes clearing form data.
- * @return {?}
- */
- function () {
- this._updateSelectedItemIndex(0);
- this.steps.forEach((/**
- * @param {?} step
- * @return {?}
- */
- function (step) { return step.reset(); }));
- this._stateChanged();
- };
- /** Returns a unique id for each step label element. */
- /**
- * Returns a unique id for each step label element.
- * @param {?} i
- * @return {?}
- */
- CdkStepper.prototype._getStepLabelId = /**
- * Returns a unique id for each step label element.
- * @param {?} i
- * @return {?}
- */
- function (i) {
- return "cdk-step-label-" + this._groupId + "-" + i;
- };
- /** Returns unique id for each step content element. */
- /**
- * Returns unique id for each step content element.
- * @param {?} i
- * @return {?}
- */
- CdkStepper.prototype._getStepContentId = /**
- * Returns unique id for each step content element.
- * @param {?} i
- * @return {?}
- */
- function (i) {
- return "cdk-step-content-" + this._groupId + "-" + i;
- };
- /** Marks the component to be change detected. */
- /**
- * Marks the component to be change detected.
- * @return {?}
- */
- CdkStepper.prototype._stateChanged = /**
- * Marks the component to be change detected.
- * @return {?}
- */
- function () {
- this._changeDetectorRef.markForCheck();
- };
- /** Returns position state of the step with the given index. */
- /**
- * Returns position state of the step with the given index.
- * @param {?} index
- * @return {?}
- */
- CdkStepper.prototype._getAnimationDirection = /**
- * Returns position state of the step with the given index.
- * @param {?} index
- * @return {?}
- */
- function (index) {
- /** @type {?} */
- var position = index - this._selectedIndex;
- if (position < 0) {
- return this._layoutDirection() === 'rtl' ? 'next' : 'previous';
- }
- else if (position > 0) {
- return this._layoutDirection() === 'rtl' ? 'previous' : 'next';
- }
- return 'current';
- };
- /** Returns the type of icon to be displayed. */
- /**
- * Returns the type of icon to be displayed.
- * @param {?} index
- * @param {?=} state
- * @return {?}
- */
- CdkStepper.prototype._getIndicatorType = /**
- * Returns the type of icon to be displayed.
- * @param {?} index
- * @param {?=} state
- * @return {?}
- */
- function (index, state) {
- if (state === void 0) { state = STEP_STATE.NUMBER; }
- /** @type {?} */
- var step = this.steps.toArray()[index];
- /** @type {?} */
- var isCurrentStep = this._isCurrentStep(index);
- return step._displayDefaultIndicatorType ? this._getDefaultIndicatorLogic(step, isCurrentStep) :
- this._getGuidelineLogic(step, isCurrentStep, state);
- };
- /**
- * @private
- * @param {?} step
- * @param {?} isCurrentStep
- * @return {?}
- */
- CdkStepper.prototype._getDefaultIndicatorLogic = /**
- * @private
- * @param {?} step
- * @param {?} isCurrentStep
- * @return {?}
- */
- function (step, isCurrentStep) {
- if (step._showError && step.hasError && !isCurrentStep) {
- return STEP_STATE.ERROR;
- }
- else if (!step.completed || isCurrentStep) {
- return STEP_STATE.NUMBER;
- }
- else {
- return step.editable ? STEP_STATE.EDIT : STEP_STATE.DONE;
- }
- };
- /**
- * @private
- * @param {?} step
- * @param {?} isCurrentStep
- * @param {?=} state
- * @return {?}
- */
- CdkStepper.prototype._getGuidelineLogic = /**
- * @private
- * @param {?} step
- * @param {?} isCurrentStep
- * @param {?=} state
- * @return {?}
- */
- function (step, isCurrentStep, state) {
- if (state === void 0) { state = STEP_STATE.NUMBER; }
- if (step._showError && step.hasError && !isCurrentStep) {
- return STEP_STATE.ERROR;
- }
- else if (step.completed && !isCurrentStep) {
- return STEP_STATE.DONE;
- }
- else if (step.completed && isCurrentStep) {
- return state;
- }
- else if (step.editable && isCurrentStep) {
- return STEP_STATE.EDIT;
- }
- else {
- return state;
- }
- };
- /**
- * @private
- * @param {?} index
- * @return {?}
- */
- CdkStepper.prototype._isCurrentStep = /**
- * @private
- * @param {?} index
- * @return {?}
- */
- function (index) {
- return this._selectedIndex === index;
- };
- /** Returns the index of the currently-focused step header. */
- /**
- * Returns the index of the currently-focused step header.
- * @return {?}
- */
- CdkStepper.prototype._getFocusIndex = /**
- * Returns the index of the currently-focused step header.
- * @return {?}
- */
- function () {
- return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;
- };
- /**
- * @private
- * @param {?} newIndex
- * @return {?}
- */
- CdkStepper.prototype._updateSelectedItemIndex = /**
- * @private
- * @param {?} newIndex
- * @return {?}
- */
- function (newIndex) {
- /** @type {?} */
- var stepsArray = this.steps.toArray();
- this.selectionChange.emit({
- selectedIndex: newIndex,
- previouslySelectedIndex: this._selectedIndex,
- selectedStep: stepsArray[newIndex],
- previouslySelectedStep: stepsArray[this._selectedIndex],
- });
- // If focus is inside the stepper, move it to the next header, otherwise it may become
- // lost when the active step content is hidden. We can't be more granular with the check
- // (e.g. checking whether focus is inside the active step), because we don't have a
- // reference to the elements that are rendering out the content.
- this._containsFocus() ? this._keyManager.setActiveItem(newIndex) :
- this._keyManager.updateActiveItemIndex(newIndex);
- this._selectedIndex = newIndex;
- this._stateChanged();
- };
- /**
- * @param {?} event
- * @return {?}
- */
- CdkStepper.prototype._onKeydown = /**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- /** @type {?} */
- var hasModifier = hasModifierKey(event);
- /** @type {?} */
- var keyCode = event.keyCode;
- /** @type {?} */
- var manager = this._keyManager;
- if (manager.activeItemIndex != null && !hasModifier &&
- (keyCode === SPACE || keyCode === ENTER)) {
- this.selectedIndex = manager.activeItemIndex;
- event.preventDefault();
- }
- else if (keyCode === HOME) {
- manager.setFirstItemActive();
- event.preventDefault();
- }
- else if (keyCode === END) {
- manager.setLastItemActive();
- event.preventDefault();
- }
- else {
- manager.onKeydown(event);
- }
- };
- /**
- * @private
- * @param {?} index
- * @return {?}
- */
- CdkStepper.prototype._anyControlsInvalidOrPending = /**
- * @private
- * @param {?} index
- * @return {?}
- */
- function (index) {
- /** @type {?} */
- var steps = this.steps.toArray();
- steps[this._selectedIndex].interacted = true;
- if (this._linear && index >= 0) {
- return steps.slice(0, index).some((/**
- * @param {?} step
- * @return {?}
- */
- function (step) {
- /** @type {?} */
- var control = step.stepControl;
- /** @type {?} */
- var isIncomplete = control ? (control.invalid || control.pending || !step.interacted) : !step.completed;
- return isIncomplete && !step.optional && !step._completedOverride;
- }));
- }
- return false;
- };
- /**
- * @private
- * @return {?}
- */
- CdkStepper.prototype._layoutDirection = /**
- * @private
- * @return {?}
- */
- function () {
- return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
- };
- /** Checks whether the stepper contains the focused element. */
- /**
- * Checks whether the stepper contains the focused element.
- * @private
- * @return {?}
- */
- CdkStepper.prototype._containsFocus = /**
- * Checks whether the stepper contains the focused element.
- * @private
- * @return {?}
- */
- function () {
- if (!this._document || !this._elementRef) {
- return false;
- }
- /** @type {?} */
- var stepperElement = this._elementRef.nativeElement;
- /** @type {?} */
- var focusedElement = this._document.activeElement;
- return stepperElement === focusedElement || stepperElement.contains(focusedElement);
- };
- CdkStepper.decorators = [
- { type: Directive, args: [{
- selector: '[cdkStepper]',
- exportAs: 'cdkStepper',
- },] },
- ];
- /** @nocollapse */
- CdkStepper.ctorParameters = function () { return [
- { type: Directionality, decorators: [{ type: Optional }] },
- { type: ChangeDetectorRef },
- { type: ElementRef },
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
- ]; };
- CdkStepper.propDecorators = {
- _steps: [{ type: ContentChildren, args: [CdkStep,] }],
- _stepHeader: [{ type: ContentChildren, args: [CdkStepHeader,] }],
- linear: [{ type: Input }],
- selectedIndex: [{ type: Input }],
- selected: [{ type: Input }],
- selectionChange: [{ type: Output }]
- };
- return CdkStepper;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * Button that moves to the next step in a stepper workflow.
- */
- var CdkStepperNext = /** @class */ (function () {
- function CdkStepperNext(_stepper) {
- this._stepper = _stepper;
- /**
- * Type of the next button. Defaults to "submit" if not specified.
- */
- this.type = 'submit';
- }
- // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
- // In Ivy the `host` bindings will be merged when this class is extended, whereas in
- // ViewEngine they're overwritten.
- // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
- // tslint:disable-next-line:no-host-decorator-in-concrete
- // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
- // In Ivy the `host` bindings will be merged when this class is extended, whereas in
- // ViewEngine they're overwritten.
- // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
- // tslint:disable-next-line:no-host-decorator-in-concrete
- /**
- * @return {?}
- */
- CdkStepperNext.prototype._handleClick =
- // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
- // In Ivy the `host` bindings will be merged when this class is extended, whereas in
- // ViewEngine they're overwritten.
- // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
- // tslint:disable-next-line:no-host-decorator-in-concrete
- /**
- * @return {?}
- */
- function () {
- this._stepper.next();
- };
- CdkStepperNext.decorators = [
- { type: Directive, args: [{
- selector: 'button[cdkStepperNext]',
- host: {
- '[type]': 'type',
- }
- },] },
- ];
- /** @nocollapse */
- CdkStepperNext.ctorParameters = function () { return [
- { type: CdkStepper }
- ]; };
- CdkStepperNext.propDecorators = {
- type: [{ type: Input }],
- _handleClick: [{ type: HostListener, args: ['click',] }]
- };
- return CdkStepperNext;
- }());
- /**
- * Button that moves to the previous step in a stepper workflow.
- */
- var CdkStepperPrevious = /** @class */ (function () {
- function CdkStepperPrevious(_stepper) {
- this._stepper = _stepper;
- /**
- * Type of the previous button. Defaults to "button" if not specified.
- */
- this.type = 'button';
- }
- // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
- // In Ivy the `host` bindings will be merged when this class is extended, whereas in
- // ViewEngine they're overwritten.
- // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
- // tslint:disable-next-line:no-host-decorator-in-concrete
- // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
- // In Ivy the `host` bindings will be merged when this class is extended, whereas in
- // ViewEngine they're overwritten.
- // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
- // tslint:disable-next-line:no-host-decorator-in-concrete
- /**
- * @return {?}
- */
- CdkStepperPrevious.prototype._handleClick =
- // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
- // In Ivy the `host` bindings will be merged when this class is extended, whereas in
- // ViewEngine they're overwritten.
- // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
- // tslint:disable-next-line:no-host-decorator-in-concrete
- /**
- * @return {?}
- */
- function () {
- this._stepper.previous();
- };
- CdkStepperPrevious.decorators = [
- { type: Directive, args: [{
- selector: 'button[cdkStepperPrevious]',
- host: {
- '[type]': 'type',
- }
- },] },
- ];
- /** @nocollapse */
- CdkStepperPrevious.ctorParameters = function () { return [
- { type: CdkStepper }
- ]; };
- CdkStepperPrevious.propDecorators = {
- type: [{ type: Input }],
- _handleClick: [{ type: HostListener, args: ['click',] }]
- };
- return CdkStepperPrevious;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var CdkStepperModule = /** @class */ (function () {
- function CdkStepperModule() {
- }
- CdkStepperModule.decorators = [
- { type: NgModule, args: [{
- imports: [BidiModule, CommonModule],
- exports: [
- CdkStep,
- CdkStepper,
- CdkStepHeader,
- CdkStepLabel,
- CdkStepperNext,
- CdkStepperPrevious,
- ],
- declarations: [
- CdkStep,
- CdkStepper,
- CdkStepHeader,
- CdkStepLabel,
- CdkStepperNext,
- CdkStepperPrevious,
- ]
- },] },
- ];
- return CdkStepperModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- export { StepperSelectionEvent, STEP_STATE, STEPPER_GLOBAL_OPTIONS, MAT_STEPPER_GLOBAL_OPTIONS, CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious, CdkStepperModule, CdkStepHeader };
- //# sourceMappingURL=stepper.es5.js.map
|