@angular/material
Version:
Angular Material
721 lines (709 loc) • 36.3 kB
JavaScript
import { PortalModule } from '@angular/cdk/portal';
import { CdkStepLabel, CdkStepHeader, CdkStep, STEPPER_GLOBAL_OPTIONS, CdkStepper, CdkStepperNext, CdkStepperPrevious, CdkStepperModule } from '@angular/cdk/stepper';
import { DOCUMENT, CommonModule } from '@angular/common';
import { Directive, Injectable, ɵɵdefineInjectable, Optional, SkipSelf, Component, ViewEncapsulation, ChangeDetectionStrategy, ElementRef, ChangeDetectorRef, Input, TemplateRef, Inject, forwardRef, ContentChild, EventEmitter, ViewChildren, ContentChildren, Output, NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { ErrorStateMatcher, MatCommonModule, MatRippleModule } from '@angular/material/core';
import { MatIconModule } from '@angular/material/icon';
import { FocusMonitor } from '@angular/cdk/a11y';
import { Subject } from 'rxjs';
import { Directionality } from '@angular/cdk/bidi';
import { takeUntil, distinctUntilChanged } from 'rxjs/operators';
import { trigger, state, style, transition, animate } from '@angular/animations';
/**
* @fileoverview added by tsickle
* Generated from: src/material/stepper/step-label.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class MatStepLabel extends CdkStepLabel {
}
MatStepLabel.decorators = [
{ type: Directive, args: [{
selector: '[matStepLabel]',
},] }
];
/**
* @fileoverview added by tsickle
* Generated from: src/material/stepper/stepper-intl.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Stepper data that is required for internationalization.
*/
class MatStepperIntl {
constructor() {
/**
* Stream that emits whenever the labels here are changed. Use this to notify
* components if the labels have changed after initialization.
*/
this.changes = new Subject();
/**
* Label that is rendered below optional steps.
*/
this.optionalLabel = 'Optional';
}
}
MatStepperIntl.decorators = [
{ type: Injectable, args: [{ providedIn: 'root' },] }
];
/** @nocollapse */ MatStepperIntl.ɵprov = ɵɵdefineInjectable({ factory: function MatStepperIntl_Factory() { return new MatStepperIntl(); }, token: MatStepperIntl, providedIn: "root" });
if (false) {
/**
* Stream that emits whenever the labels here are changed. Use this to notify
* components if the labels have changed after initialization.
* @type {?}
*/
MatStepperIntl.prototype.changes;
/**
* Label that is rendered below optional steps.
* @type {?}
*/
MatStepperIntl.prototype.optionalLabel;
}
/**
* \@docs-private
* @param {?} parentIntl
* @return {?}
*/
function MAT_STEPPER_INTL_PROVIDER_FACTORY(parentIntl) {
return parentIntl || new MatStepperIntl();
}
/**
* \@docs-private
* @type {?}
*/
const MAT_STEPPER_INTL_PROVIDER = {
provide: MatStepperIntl,
deps: [[new Optional(), new SkipSelf(), MatStepperIntl]],
useFactory: MAT_STEPPER_INTL_PROVIDER_FACTORY
};
/**
* @fileoverview added by tsickle
* Generated from: src/material/stepper/step-header.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class MatStepHeader extends CdkStepHeader {
/**
* @param {?} _intl
* @param {?} _focusMonitor
* @param {?} _elementRef
* @param {?} changeDetectorRef
*/
constructor(_intl, _focusMonitor, _elementRef, changeDetectorRef) {
super(_elementRef);
this._intl = _intl;
this._focusMonitor = _focusMonitor;
_focusMonitor.monitor(_elementRef, true);
this._intlSubscription = _intl.changes.subscribe((/**
* @return {?}
*/
() => changeDetectorRef.markForCheck()));
}
/**
* @return {?}
*/
ngOnDestroy() {
this._intlSubscription.unsubscribe();
this._focusMonitor.stopMonitoring(this._elementRef);
}
/**
* Focuses the step header.
* @return {?}
*/
focus() {
this._focusMonitor.focusVia(this._elementRef, 'program');
}
/**
* Returns string label of given step if it is a text label.
* @return {?}
*/
_stringLabel() {
return this.label instanceof MatStepLabel ? null : this.label;
}
/**
* Returns MatStepLabel if the label of given step is a template label.
* @return {?}
*/
_templateLabel() {
return this.label instanceof MatStepLabel ? this.label : null;
}
/**
* Returns the host HTML element.
* @return {?}
*/
_getHostElement() {
return this._elementRef.nativeElement;
}
/**
* Template context variables that are exposed to the `matStepperIcon` instances.
* @return {?}
*/
_getIconContext() {
return {
index: this.index,
active: this.active,
optional: this.optional
};
}
/**
* @param {?} state
* @return {?}
*/
_getDefaultTextForState(state) {
if (state == 'number') {
return `${this.index + 1}`;
}
if (state == 'edit') {
return 'create';
}
if (state == 'error') {
return 'warning';
}
return state;
}
}
MatStepHeader.decorators = [
{ type: Component, args: [{
selector: 'mat-step-header',
template: "<div class=\"mat-step-header-ripple\" matRipple\n [matRippleTrigger]=\"_getHostElement()\"\n [matRippleDisabled]=\"disableRipple\"></div>\n\n<div class=\"mat-step-icon-state-{{state}} mat-step-icon\" [class.mat-step-icon-selected]=\"selected\">\n <div class=\"mat-step-icon-content\" [ngSwitch]=\"!!(iconOverrides && iconOverrides[state])\">\n <ng-container\n *ngSwitchCase=\"true\"\n [ngTemplateOutlet]=\"iconOverrides[state]\"\n [ngTemplateOutletContext]=\"_getIconContext()\"></ng-container>\n <ng-container *ngSwitchDefault [ngSwitch]=\"state\">\n <span *ngSwitchCase=\"'number'\">{{_getDefaultTextForState(state)}}</span>\n <mat-icon *ngSwitchDefault>{{_getDefaultTextForState(state)}}</mat-icon>\n </ng-container>\n </div>\n</div>\n<div class=\"mat-step-label\"\n [class.mat-step-label-active]=\"active\"\n [class.mat-step-label-selected]=\"selected\"\n [class.mat-step-label-error]=\"state == 'error'\">\n <!-- If there is a label template, use it. -->\n <ng-container *ngIf=\"_templateLabel()\" [ngTemplateOutlet]=\"_templateLabel()!.template\">\n </ng-container>\n <!-- If there is no label template, fall back to the text label. -->\n <div class=\"mat-step-text-label\" *ngIf=\"_stringLabel()\">{{label}}</div>\n\n <div class=\"mat-step-optional\" *ngIf=\"optional && state != 'error'\">{{_intl.optionalLabel}}</div>\n <div class=\"mat-step-sub-label-error\" *ngIf=\"state == 'error'\">{{errorMessage}}</div>\n</div>\n\n",
host: {
'class': 'mat-step-header',
'role': 'tab',
},
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [".mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:transparent}.mat-step-optional,.mat-step-sub-label-error{font-size:12px}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative}.mat-step-icon-content,.mat-step-icon .mat-icon{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}\n"]
}] }
];
/** @nocollapse */
MatStepHeader.ctorParameters = () => [
{ type: MatStepperIntl },
{ type: FocusMonitor },
{ type: ElementRef },
{ type: ChangeDetectorRef }
];
MatStepHeader.propDecorators = {
state: [{ type: Input }],
label: [{ type: Input }],
errorMessage: [{ type: Input }],
iconOverrides: [{ type: Input }],
index: [{ type: Input }],
selected: [{ type: Input }],
active: [{ type: Input }],
optional: [{ type: Input }],
disableRipple: [{ type: Input }]
};
if (false) {
/**
* @type {?}
* @private
*/
MatStepHeader.prototype._intlSubscription;
/**
* State of the given step.
* @type {?}
*/
MatStepHeader.prototype.state;
/**
* Label of the given step.
* @type {?}
*/
MatStepHeader.prototype.label;
/**
* Error message to display when there's an error.
* @type {?}
*/
MatStepHeader.prototype.errorMessage;
/**
* Overrides for the header icons, passed in via the stepper.
* @type {?}
*/
MatStepHeader.prototype.iconOverrides;
/**
* Index of the given step.
* @type {?}
*/
MatStepHeader.prototype.index;
/**
* Whether the given step is selected.
* @type {?}
*/
MatStepHeader.prototype.selected;
/**
* Whether the given step label is active.
* @type {?}
*/
MatStepHeader.prototype.active;
/**
* Whether the given step is optional.
* @type {?}
*/
MatStepHeader.prototype.optional;
/**
* Whether the ripple should be disabled.
* @type {?}
*/
MatStepHeader.prototype.disableRipple;
/** @type {?} */
MatStepHeader.prototype._intl;
/**
* @type {?}
* @private
*/
MatStepHeader.prototype._focusMonitor;
}
/**
* @fileoverview added by tsickle
* Generated from: src/material/stepper/stepper-animations.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Animations used by the Material steppers.
* \@docs-private
* @type {?}
*/
const matStepperAnimations = {
/**
* Animation that transitions the step along the X axis in a horizontal stepper.
*/
horizontalStepTransition: trigger('stepTransition', [
state('previous', style({ transform: 'translate3d(-100%, 0, 0)', visibility: 'hidden' })),
state('current', style({ transform: 'none', visibility: 'visible' })),
state('next', style({ transform: 'translate3d(100%, 0, 0)', visibility: 'hidden' })),
transition('* => *', animate('500ms cubic-bezier(0.35, 0, 0.25, 1)'))
]),
/**
* Animation that transitions the step along the Y axis in a vertical stepper.
*/
verticalStepTransition: trigger('stepTransition', [
state('previous', style({ height: '0px', visibility: 'hidden' })),
state('next', style({ height: '0px', visibility: 'hidden' })),
state('current', style({ height: '*', visibility: 'visible' })),
transition('* <=> current', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))
])
};
/**
* @fileoverview added by tsickle
* Generated from: src/material/stepper/stepper-icon.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Template context available to an attached `matStepperIcon`.
* @record
*/
function MatStepperIconContext() { }
if (false) {
/**
* Index of the step.
* @type {?}
*/
MatStepperIconContext.prototype.index;
/**
* Whether the step is currently active.
* @type {?}
*/
MatStepperIconContext.prototype.active;
/**
* Whether the step is optional.
* @type {?}
*/
MatStepperIconContext.prototype.optional;
}
/**
* Template to be used to override the icons inside the step header.
*/
class MatStepperIcon {
/**
* @param {?} templateRef
*/
constructor(templateRef) {
this.templateRef = templateRef;
}
}
MatStepperIcon.decorators = [
{ type: Directive, args: [{
selector: 'ng-template[matStepperIcon]',
},] }
];
/** @nocollapse */
MatStepperIcon.ctorParameters = () => [
{ type: TemplateRef }
];
MatStepperIcon.propDecorators = {
name: [{ type: Input, args: ['matStepperIcon',] }]
};
if (false) {
/**
* Name of the icon to be overridden.
* @type {?}
*/
MatStepperIcon.prototype.name;
/** @type {?} */
MatStepperIcon.prototype.templateRef;
}
/**
* @fileoverview added by tsickle
* Generated from: src/material/stepper/stepper.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class MatStep extends CdkStep {
/**
* \@breaking-change 8.0.0 remove the `?` after `stepperOptions`
* @param {?} stepper
* @param {?} _errorStateMatcher
* @param {?=} stepperOptions
*/
constructor(stepper, _errorStateMatcher, stepperOptions) {
super(stepper, stepperOptions);
this._errorStateMatcher = _errorStateMatcher;
}
/**
* Custom error state matcher that additionally checks for validity of interacted form.
* @param {?} control
* @param {?} form
* @return {?}
*/
isErrorState(control, form) {
/** @type {?} */
const originalErrorState = this._errorStateMatcher.isErrorState(control, form);
// Custom error state checks for the validity of form that is not submitted or touched
// since user can trigger a form change by calling for another step without directly
// interacting with the current form.
/** @type {?} */
const customErrorState = !!(control && control.invalid && this.interacted);
return originalErrorState || customErrorState;
}
}
MatStep.decorators = [
{ type: Component, args: [{
selector: 'mat-step',
template: "<ng-template><ng-content></ng-content></ng-template>\n",
providers: [
{ provide: ErrorStateMatcher, useExisting: MatStep },
{ provide: CdkStep, useExisting: MatStep },
],
encapsulation: ViewEncapsulation.None,
exportAs: 'matStep',
changeDetection: ChangeDetectionStrategy.OnPush
}] }
];
/** @nocollapse */
MatStep.ctorParameters = () => [
{ type: MatStepper, decorators: [{ type: Inject, args: [forwardRef((/**
* @return {?}
*/
() => MatStepper)),] }] },
{ type: ErrorStateMatcher, decorators: [{ type: SkipSelf }] },
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [STEPPER_GLOBAL_OPTIONS,] }] }
];
MatStep.propDecorators = {
stepLabel: [{ type: ContentChild, args: [MatStepLabel,] }]
};
if (false) {
/**
* Content for step label given by `<ng-template matStepLabel>`.
* @type {?}
*/
MatStep.prototype.stepLabel;
/**
* @type {?}
* @private
*/
MatStep.prototype._errorStateMatcher;
}
class MatStepper extends CdkStepper {
constructor() {
super(...arguments);
/**
* Event emitted when the current step is done transitioning in.
*/
this.animationDone = new EventEmitter();
/**
* Consumer-specified template-refs to be used to override the header icons.
*/
this._iconOverrides = {};
/**
* Stream of animation `done` events when the body expands/collapses.
*/
this._animationDone = new Subject();
}
/**
* @return {?}
*/
ngAfterContentInit() {
this._icons.forEach((/**
* @param {?} __0
* @return {?}
*/
({ name, templateRef }) => this._iconOverrides[name] = templateRef));
// Mark the component for change detection whenever the content children query changes
this._steps.changes.pipe(takeUntil(this._destroyed)).subscribe((/**
* @return {?}
*/
() => {
this._stateChanged();
}));
this._animationDone.pipe(
// This needs a `distinctUntilChanged` in order to avoid emitting the same event twice due
// to a bug in animations where the `.done` callback gets invoked twice on some browsers.
// See https://github.com/angular/angular/issues/24084
distinctUntilChanged((/**
* @param {?} x
* @param {?} y
* @return {?}
*/
(x, y) => x.fromState === y.fromState && x.toState === y.toState)), takeUntil(this._destroyed)).subscribe((/**
* @param {?} event
* @return {?}
*/
event => {
if (((/** @type {?} */ (event.toState))) === 'current') {
this.animationDone.emit();
}
}));
}
}
MatStepper.decorators = [
{ type: Directive, args: [{ selector: '[matStepper]', providers: [{ provide: CdkStepper, useExisting: MatStepper }] },] }
];
MatStepper.propDecorators = {
_stepHeader: [{ type: ViewChildren, args: [MatStepHeader,] }],
_steps: [{ type: ContentChildren, args: [MatStep, { descendants: true },] }],
_icons: [{ type: ContentChildren, args: [MatStepperIcon, { descendants: true },] }],
animationDone: [{ type: Output }],
disableRipple: [{ type: Input }]
};
if (false) {
/** @type {?} */
MatStepper.ngAcceptInputType_editable;
/** @type {?} */
MatStepper.ngAcceptInputType_optional;
/** @type {?} */
MatStepper.ngAcceptInputType_completed;
/** @type {?} */
MatStepper.ngAcceptInputType_hasError;
/**
* The list of step headers of the steps in the stepper.
* @type {?}
*/
MatStepper.prototype._stepHeader;
/**
* Steps that the stepper holds.
* @type {?}
*/
MatStepper.prototype._steps;
/**
* Custom icon overrides passed in by the consumer.
* @type {?}
*/
MatStepper.prototype._icons;
/**
* Event emitted when the current step is done transitioning in.
* @type {?}
*/
MatStepper.prototype.animationDone;
/**
* Whether ripples should be disabled for the step headers.
* @type {?}
*/
MatStepper.prototype.disableRipple;
/**
* Consumer-specified template-refs to be used to override the header icons.
* @type {?}
*/
MatStepper.prototype._iconOverrides;
/**
* Stream of animation `done` events when the body expands/collapses.
* @type {?}
*/
MatStepper.prototype._animationDone;
}
class MatHorizontalStepper extends MatStepper {
constructor() {
super(...arguments);
/**
* Whether the label should display in bottom or end position.
*/
this.labelPosition = 'end';
}
}
MatHorizontalStepper.decorators = [
{ type: Component, args: [{
selector: 'mat-horizontal-stepper',
exportAs: 'matHorizontalStepper',
template: "<div class=\"mat-horizontal-stepper-header-container\">\n <ng-container *ngFor=\"let step of steps; let i = index; let isLast = last\">\n <mat-step-header class=\"mat-horizontal-stepper-header\"\n (click)=\"step.select()\"\n (keydown)=\"_onKeydown($event)\"\n [tabIndex]=\"_getFocusIndex() === i ? 0 : -1\"\n [id]=\"_getStepLabelId(i)\"\n [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"steps.length\"\n [attr.aria-controls]=\"_getStepContentId(i)\"\n [attr.aria-selected]=\"selectedIndex == i\"\n [attr.aria-label]=\"step.ariaLabel || null\"\n [attr.aria-labelledby]=\"(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null\"\n [index]=\"i\"\n [state]=\"_getIndicatorType(i, step.state)\"\n [label]=\"step.stepLabel || step.label\"\n [selected]=\"selectedIndex === i\"\n [active]=\"step.completed || selectedIndex === i || !linear\"\n [optional]=\"step.optional\"\n [errorMessage]=\"step.errorMessage\"\n [iconOverrides]=\"_iconOverrides\"\n [disableRipple]=\"disableRipple\">\n </mat-step-header>\n <div *ngIf=\"!isLast\" class=\"mat-stepper-horizontal-line\"></div>\n </ng-container>\n</div>\n\n<div class=\"mat-horizontal-content-container\">\n <div *ngFor=\"let step of steps; let i = index\"\n [attr.tabindex]=\"selectedIndex === i ? 0 : null\"\n class=\"mat-horizontal-stepper-content\" role=\"tabpanel\"\n [@stepTransition]=\"_getAnimationDirection(i)\"\n (@stepTransition.done)=\"_animationDone.next($event)\"\n [id]=\"_getStepContentId(i)\"\n [attr.aria-labelledby]=\"_getStepLabelId(i)\"\n [attr.aria-expanded]=\"selectedIndex === i\">\n <ng-container [ngTemplateOutlet]=\"step.content\"></ng-container>\n </div>\n</div>\n",
inputs: ['selectedIndex'],
host: {
'class': 'mat-stepper-horizontal',
'[class.mat-stepper-label-position-end]': 'labelPosition == "end"',
'[class.mat-stepper-label-position-bottom]': 'labelPosition == "bottom"',
'aria-orientation': 'horizontal',
'role': 'tablist',
},
animations: [matStepperAnimations.horizontalStepTransition],
providers: [
{ provide: MatStepper, useExisting: MatHorizontalStepper },
{ provide: CdkStepper, useExisting: MatHorizontalStepper }
],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [".mat-stepper-vertical,.mat-stepper-horizontal{display:block}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative;top:36px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{border-top-width:1px;border-top-style:solid;content:\"\";display:inline-block;height:0;position:absolute;top:36px;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto;padding:24px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;padding:24px;height:24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-content{outline:0}.mat-horizontal-stepper-content[aria-expanded=false]{height:0;overflow:hidden}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:\"\";position:absolute;top:-16px;bottom:-16px;left:0;border-left-width:1px;border-left-style:solid}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}\n"]
}] }
];
MatHorizontalStepper.propDecorators = {
labelPosition: [{ type: Input }]
};
if (false) {
/** @type {?} */
MatHorizontalStepper.ngAcceptInputType_editable;
/** @type {?} */
MatHorizontalStepper.ngAcceptInputType_optional;
/** @type {?} */
MatHorizontalStepper.ngAcceptInputType_completed;
/** @type {?} */
MatHorizontalStepper.ngAcceptInputType_hasError;
/**
* Whether the label should display in bottom or end position.
* @type {?}
*/
MatHorizontalStepper.prototype.labelPosition;
}
class MatVerticalStepper extends MatStepper {
/**
* @param {?} dir
* @param {?} changeDetectorRef
* @param {?=} elementRef
* @param {?=} _document
*/
constructor(dir, changeDetectorRef,
// @breaking-change 8.0.0 `elementRef` and `_document` parameters to become required.
elementRef, _document) {
super(dir, changeDetectorRef, elementRef, _document);
this._orientation = 'vertical';
}
}
MatVerticalStepper.decorators = [
{ type: Component, args: [{
selector: 'mat-vertical-stepper',
exportAs: 'matVerticalStepper',
template: "<div class=\"mat-step\" *ngFor=\"let step of steps; let i = index; let isLast = last\">\n <mat-step-header class=\"mat-vertical-stepper-header\"\n (click)=\"step.select()\"\n (keydown)=\"_onKeydown($event)\"\n [tabIndex]=\"_getFocusIndex() == i ? 0 : -1\"\n [id]=\"_getStepLabelId(i)\"\n [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"steps.length\"\n [attr.aria-controls]=\"_getStepContentId(i)\"\n [attr.aria-selected]=\"selectedIndex === i\"\n [attr.aria-label]=\"step.ariaLabel || null\"\n [attr.aria-labelledby]=\"(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null\"\n [index]=\"i\"\n [state]=\"_getIndicatorType(i, step.state)\"\n [label]=\"step.stepLabel || step.label\"\n [selected]=\"selectedIndex === i\"\n [active]=\"step.completed || selectedIndex === i || !linear\"\n [optional]=\"step.optional\"\n [errorMessage]=\"step.errorMessage\"\n [iconOverrides]=\"_iconOverrides\"\n [disableRipple]=\"disableRipple\">\n </mat-step-header>\n\n <div class=\"mat-vertical-content-container\" [class.mat-stepper-vertical-line]=\"!isLast\">\n <div class=\"mat-vertical-stepper-content\" role=\"tabpanel\"\n [attr.tabindex]=\"selectedIndex === i ? 0 : null\"\n [@stepTransition]=\"_getAnimationDirection(i)\"\n (@stepTransition.done)=\"_animationDone.next($event)\"\n [id]=\"_getStepContentId(i)\"\n [attr.aria-labelledby]=\"_getStepLabelId(i)\"\n [attr.aria-expanded]=\"selectedIndex === i\">\n <div class=\"mat-vertical-content\">\n <ng-container [ngTemplateOutlet]=\"step.content\"></ng-container>\n </div>\n </div>\n </div>\n</div>\n",
inputs: ['selectedIndex'],
host: {
'class': 'mat-stepper-vertical',
'aria-orientation': 'vertical',
'role': 'tablist',
},
animations: [matStepperAnimations.verticalStepTransition],
providers: [
{ provide: MatStepper, useExisting: MatVerticalStepper },
{ provide: CdkStepper, useExisting: MatVerticalStepper }
],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [".mat-stepper-vertical,.mat-stepper-horizontal{display:block}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative;top:36px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{border-top-width:1px;border-top-style:solid;content:\"\";display:inline-block;height:0;position:absolute;top:36px;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto;padding:24px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;padding:24px;height:24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-content{outline:0}.mat-horizontal-stepper-content[aria-expanded=false]{height:0;overflow:hidden}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:\"\";position:absolute;top:-16px;bottom:-16px;left:0;border-left-width:1px;border-left-style:solid}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}\n"]
}] }
];
/** @nocollapse */
MatVerticalStepper.ctorParameters = () => [
{ type: Directionality, decorators: [{ type: Optional }] },
{ type: ChangeDetectorRef },
{ type: ElementRef },
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
];
if (false) {
/** @type {?} */
MatVerticalStepper.ngAcceptInputType_editable;
/** @type {?} */
MatVerticalStepper.ngAcceptInputType_optional;
/** @type {?} */
MatVerticalStepper.ngAcceptInputType_completed;
/** @type {?} */
MatVerticalStepper.ngAcceptInputType_hasError;
}
/**
* @fileoverview added by tsickle
* Generated from: src/material/stepper/stepper-button.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Button that moves to the next step in a stepper workflow.
*/
class MatStepperNext extends CdkStepperNext {
}
MatStepperNext.decorators = [
{ type: Directive, args: [{
selector: 'button[matStepperNext]',
host: {
'[type]': 'type',
},
inputs: ['type']
},] }
];
/**
* Button that moves to the previous step in a stepper workflow.
*/
class MatStepperPrevious extends CdkStepperPrevious {
}
MatStepperPrevious.decorators = [
{ type: Directive, args: [{
selector: 'button[matStepperPrevious]',
host: {
'[type]': 'type',
},
inputs: ['type']
},] }
];
/**
* @fileoverview added by tsickle
* Generated from: src/material/stepper/stepper-module.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class MatStepperModule {
}
MatStepperModule.decorators = [
{ type: NgModule, args: [{
imports: [
MatCommonModule,
CommonModule,
PortalModule,
MatButtonModule,
CdkStepperModule,
MatIconModule,
MatRippleModule,
],
exports: [
MatCommonModule,
MatHorizontalStepper,
MatVerticalStepper,
MatStep,
MatStepLabel,
MatStepper,
MatStepperNext,
MatStepperPrevious,
MatStepHeader,
MatStepperIcon,
],
declarations: [
MatHorizontalStepper,
MatVerticalStepper,
MatStep,
MatStepLabel,
MatStepper,
MatStepperNext,
MatStepperPrevious,
MatStepHeader,
MatStepperIcon,
],
providers: [MAT_STEPPER_INTL_PROVIDER, ErrorStateMatcher],
},] }
];
/**
* @fileoverview added by tsickle
* Generated from: src/material/stepper/public-api.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Generated bundle index. Do not edit.
*/
export { MAT_STEPPER_INTL_PROVIDER, MAT_STEPPER_INTL_PROVIDER_FACTORY, MatHorizontalStepper, MatStep, MatStepHeader, MatStepLabel, MatStepper, MatStepperIcon, MatStepperIntl, MatStepperModule, MatStepperNext, MatStepperPrevious, MatVerticalStepper, matStepperAnimations };
//# sourceMappingURL=stepper.js.map