stepper.es5.js 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.io/license
  7. */
  8. import { __extends } from 'tslib';
  9. import { Directive, Injectable, Optional, SkipSelf, NgModule, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, ViewEncapsulation, ContentChild, ContentChildren, EventEmitter, forwardRef, Inject, Output, ViewChildren, TemplateRef, ɵɵdefineInjectable } from '@angular/core';
  10. import { CdkStepLabel, CdkStepHeader, CdkStep, CdkStepper, STEPPER_GLOBAL_OPTIONS, CdkStepperNext, CdkStepperPrevious, CdkStepperModule } from '@angular/cdk/stepper';
  11. import { Subject } from 'rxjs';
  12. import { FocusMonitor } from '@angular/cdk/a11y';
  13. import { animate, state, style, transition, trigger } from '@angular/animations';
  14. import { Directionality } from '@angular/cdk/bidi';
  15. import { DOCUMENT, CommonModule } from '@angular/common';
  16. import { ErrorStateMatcher, MatCommonModule, MatRippleModule } from '@angular/material/core';
  17. import { takeUntil, distinctUntilChanged } from 'rxjs/operators';
  18. import { PortalModule } from '@angular/cdk/portal';
  19. import { MatButtonModule } from '@angular/material/button';
  20. import { MatIconModule } from '@angular/material/icon';
  21. /**
  22. * @fileoverview added by tsickle
  23. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  24. */
  25. var MatStepLabel = /** @class */ (function (_super) {
  26. __extends(MatStepLabel, _super);
  27. function MatStepLabel() {
  28. return _super !== null && _super.apply(this, arguments) || this;
  29. }
  30. MatStepLabel.decorators = [
  31. { type: Directive, args: [{
  32. selector: '[matStepLabel]',
  33. },] },
  34. ];
  35. return MatStepLabel;
  36. }(CdkStepLabel));
  37. /**
  38. * @fileoverview added by tsickle
  39. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  40. */
  41. /**
  42. * Stepper data that is required for internationalization.
  43. */
  44. var MatStepperIntl = /** @class */ (function () {
  45. function MatStepperIntl() {
  46. /**
  47. * Stream that emits whenever the labels here are changed. Use this to notify
  48. * components if the labels have changed after initialization.
  49. */
  50. this.changes = new Subject();
  51. /**
  52. * Label that is rendered below optional steps.
  53. */
  54. this.optionalLabel = 'Optional';
  55. }
  56. MatStepperIntl.decorators = [
  57. { type: Injectable, args: [{ providedIn: 'root' },] },
  58. ];
  59. /** @nocollapse */ MatStepperIntl.ngInjectableDef = ɵɵdefineInjectable({ factory: function MatStepperIntl_Factory() { return new MatStepperIntl(); }, token: MatStepperIntl, providedIn: "root" });
  60. return MatStepperIntl;
  61. }());
  62. /**
  63. * \@docs-private
  64. * @param {?} parentIntl
  65. * @return {?}
  66. */
  67. function MAT_STEPPER_INTL_PROVIDER_FACTORY(parentIntl) {
  68. return parentIntl || new MatStepperIntl();
  69. }
  70. /**
  71. * \@docs-private
  72. * @type {?}
  73. */
  74. var MAT_STEPPER_INTL_PROVIDER = {
  75. provide: MatStepperIntl,
  76. deps: [[new Optional(), new SkipSelf(), MatStepperIntl]],
  77. useFactory: MAT_STEPPER_INTL_PROVIDER_FACTORY
  78. };
  79. /**
  80. * @fileoverview added by tsickle
  81. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  82. */
  83. var MatStepHeader = /** @class */ (function (_super) {
  84. __extends(MatStepHeader, _super);
  85. function MatStepHeader(_intl, _focusMonitor, _elementRef, changeDetectorRef) {
  86. var _this = _super.call(this, _elementRef) || this;
  87. _this._intl = _intl;
  88. _this._focusMonitor = _focusMonitor;
  89. _focusMonitor.monitor(_elementRef, true);
  90. _this._intlSubscription = _intl.changes.subscribe((/**
  91. * @return {?}
  92. */
  93. function () { return changeDetectorRef.markForCheck(); }));
  94. return _this;
  95. }
  96. /**
  97. * @return {?}
  98. */
  99. MatStepHeader.prototype.ngOnDestroy = /**
  100. * @return {?}
  101. */
  102. function () {
  103. this._intlSubscription.unsubscribe();
  104. this._focusMonitor.stopMonitoring(this._elementRef);
  105. };
  106. /** Focuses the step header. */
  107. /**
  108. * Focuses the step header.
  109. * @return {?}
  110. */
  111. MatStepHeader.prototype.focus = /**
  112. * Focuses the step header.
  113. * @return {?}
  114. */
  115. function () {
  116. this._focusMonitor.focusVia(this._elementRef, 'program');
  117. };
  118. /** Returns string label of given step if it is a text label. */
  119. /**
  120. * Returns string label of given step if it is a text label.
  121. * @return {?}
  122. */
  123. MatStepHeader.prototype._stringLabel = /**
  124. * Returns string label of given step if it is a text label.
  125. * @return {?}
  126. */
  127. function () {
  128. return this.label instanceof MatStepLabel ? null : this.label;
  129. };
  130. /** Returns MatStepLabel if the label of given step is a template label. */
  131. /**
  132. * Returns MatStepLabel if the label of given step is a template label.
  133. * @return {?}
  134. */
  135. MatStepHeader.prototype._templateLabel = /**
  136. * Returns MatStepLabel if the label of given step is a template label.
  137. * @return {?}
  138. */
  139. function () {
  140. return this.label instanceof MatStepLabel ? this.label : null;
  141. };
  142. /** Returns the host HTML element. */
  143. /**
  144. * Returns the host HTML element.
  145. * @return {?}
  146. */
  147. MatStepHeader.prototype._getHostElement = /**
  148. * Returns the host HTML element.
  149. * @return {?}
  150. */
  151. function () {
  152. return this._elementRef.nativeElement;
  153. };
  154. /** Template context variables that are exposed to the `matStepperIcon` instances. */
  155. /**
  156. * Template context variables that are exposed to the `matStepperIcon` instances.
  157. * @return {?}
  158. */
  159. MatStepHeader.prototype._getIconContext = /**
  160. * Template context variables that are exposed to the `matStepperIcon` instances.
  161. * @return {?}
  162. */
  163. function () {
  164. return {
  165. index: this.index,
  166. active: this.active,
  167. optional: this.optional
  168. };
  169. };
  170. /**
  171. * @param {?} state
  172. * @return {?}
  173. */
  174. MatStepHeader.prototype._getDefaultTextForState = /**
  175. * @param {?} state
  176. * @return {?}
  177. */
  178. function (state$$1) {
  179. if (state$$1 == 'number') {
  180. return "" + (this.index + 1);
  181. }
  182. if (state$$1 == 'edit') {
  183. return 'create';
  184. }
  185. if (state$$1 == 'error') {
  186. return 'warning';
  187. }
  188. return state$$1;
  189. };
  190. MatStepHeader.decorators = [
  191. { type: Component, args: [{selector: 'mat-step-header',
  192. template: "<div class=\"mat-step-header-ripple\" matRipple [matRippleTrigger]=\"_getHostElement()\" [matRippleDisabled]=\"disableRipple\"></div><div class=\"mat-step-icon-state-{{state}} mat-step-icon\" [class.mat-step-icon-selected]=\"selected\"><div class=\"mat-step-icon-content\" [ngSwitch]=\"!!(iconOverrides && iconOverrides[state])\"><ng-container *ngSwitchCase=\"true\" [ngTemplateOutlet]=\"iconOverrides[state]\" [ngTemplateOutletContext]=\"_getIconContext()\"></ng-container><ng-container *ngSwitchDefault [ngSwitch]=\"state\"><span *ngSwitchCase=\"'number'\">{{_getDefaultTextForState(state)}}</span><mat-icon *ngSwitchDefault>{{_getDefaultTextForState(state)}}</mat-icon></ng-container></div></div><div class=\"mat-step-label\" [class.mat-step-label-active]=\"active\" [class.mat-step-label-selected]=\"selected\" [class.mat-step-label-error]=\"state == 'error'\"><ng-container *ngIf=\"_templateLabel()\" [ngTemplateOutlet]=\"_templateLabel()!.template\"></ng-container><div class=\"mat-step-text-label\" *ngIf=\"_stringLabel()\">{{label}}</div><div class=\"mat-step-optional\" *ngIf=\"optional && state != 'error'\">{{_intl.optionalLabel}}</div><div class=\"mat-step-sub-label-error\" *ngIf=\"state == 'error'\">{{errorMessage}}</div></div>",
  193. styles: [".mat-step-header{overflow:hidden;outline:0;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 .mat-icon,.mat-step-icon-content{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}"],
  194. host: {
  195. 'class': 'mat-step-header',
  196. 'role': 'tab',
  197. },
  198. encapsulation: ViewEncapsulation.None,
  199. changeDetection: ChangeDetectionStrategy.OnPush,
  200. },] },
  201. ];
  202. /** @nocollapse */
  203. MatStepHeader.ctorParameters = function () { return [
  204. { type: MatStepperIntl },
  205. { type: FocusMonitor },
  206. { type: ElementRef },
  207. { type: ChangeDetectorRef }
  208. ]; };
  209. MatStepHeader.propDecorators = {
  210. state: [{ type: Input }],
  211. label: [{ type: Input }],
  212. errorMessage: [{ type: Input }],
  213. iconOverrides: [{ type: Input }],
  214. index: [{ type: Input }],
  215. selected: [{ type: Input }],
  216. active: [{ type: Input }],
  217. optional: [{ type: Input }],
  218. disableRipple: [{ type: Input }]
  219. };
  220. return MatStepHeader;
  221. }(CdkStepHeader));
  222. /**
  223. * @fileoverview added by tsickle
  224. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  225. */
  226. /**
  227. * Animations used by the Material steppers.
  228. * \@docs-private
  229. * @type {?}
  230. */
  231. var matStepperAnimations = {
  232. /**
  233. * Animation that transitions the step along the X axis in a horizontal stepper.
  234. */
  235. horizontalStepTransition: trigger('stepTransition', [
  236. state('previous', style({ transform: 'translate3d(-100%, 0, 0)', visibility: 'hidden' })),
  237. state('current', style({ transform: 'none', visibility: 'visible' })),
  238. state('next', style({ transform: 'translate3d(100%, 0, 0)', visibility: 'hidden' })),
  239. transition('* => *', animate('500ms cubic-bezier(0.35, 0, 0.25, 1)'))
  240. ]),
  241. /**
  242. * Animation that transitions the step along the Y axis in a vertical stepper.
  243. */
  244. verticalStepTransition: trigger('stepTransition', [
  245. state('previous', style({ height: '0px', visibility: 'hidden' })),
  246. state('next', style({ height: '0px', visibility: 'hidden' })),
  247. state('current', style({ height: '*', visibility: 'visible' })),
  248. transition('* <=> current', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))
  249. ])
  250. };
  251. /**
  252. * @fileoverview added by tsickle
  253. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  254. */
  255. /**
  256. * Template to be used to override the icons inside the step header.
  257. */
  258. var MatStepperIcon = /** @class */ (function () {
  259. function MatStepperIcon(templateRef) {
  260. this.templateRef = templateRef;
  261. }
  262. MatStepperIcon.decorators = [
  263. { type: Directive, args: [{
  264. selector: 'ng-template[matStepperIcon]',
  265. },] },
  266. ];
  267. /** @nocollapse */
  268. MatStepperIcon.ctorParameters = function () { return [
  269. { type: TemplateRef }
  270. ]; };
  271. MatStepperIcon.propDecorators = {
  272. name: [{ type: Input, args: ['matStepperIcon',] }]
  273. };
  274. return MatStepperIcon;
  275. }());
  276. /**
  277. * @fileoverview added by tsickle
  278. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  279. */
  280. var MatStep = /** @class */ (function (_super) {
  281. __extends(MatStep, _super);
  282. /** @breaking-change 8.0.0 remove the `?` after `stepperOptions` */
  283. function MatStep(stepper, _errorStateMatcher, stepperOptions) {
  284. var _this = _super.call(this, stepper, stepperOptions) || this;
  285. _this._errorStateMatcher = _errorStateMatcher;
  286. return _this;
  287. }
  288. /** Custom error state matcher that additionally checks for validity of interacted form. */
  289. /**
  290. * Custom error state matcher that additionally checks for validity of interacted form.
  291. * @param {?} control
  292. * @param {?} form
  293. * @return {?}
  294. */
  295. MatStep.prototype.isErrorState = /**
  296. * Custom error state matcher that additionally checks for validity of interacted form.
  297. * @param {?} control
  298. * @param {?} form
  299. * @return {?}
  300. */
  301. function (control, form) {
  302. /** @type {?} */
  303. var originalErrorState = this._errorStateMatcher.isErrorState(control, form);
  304. // Custom error state checks for the validity of form that is not submitted or touched
  305. // since user can trigger a form change by calling for another step without directly
  306. // interacting with the current form.
  307. /** @type {?} */
  308. var customErrorState = !!(control && control.invalid && this.interacted);
  309. return originalErrorState || customErrorState;
  310. };
  311. MatStep.decorators = [
  312. { type: Component, args: [{selector: 'mat-step',
  313. template: "<ng-template><ng-content></ng-content></ng-template>",
  314. providers: [{ provide: ErrorStateMatcher, useExisting: MatStep }],
  315. encapsulation: ViewEncapsulation.None,
  316. exportAs: 'matStep',
  317. changeDetection: ChangeDetectionStrategy.OnPush,
  318. },] },
  319. ];
  320. /** @nocollapse */
  321. MatStep.ctorParameters = function () { return [
  322. { type: MatStepper, decorators: [{ type: Inject, args: [forwardRef((/**
  323. * @return {?}
  324. */
  325. function () { return MatStepper; })),] }] },
  326. { type: ErrorStateMatcher, decorators: [{ type: SkipSelf }] },
  327. { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [STEPPER_GLOBAL_OPTIONS,] }] }
  328. ]; };
  329. MatStep.propDecorators = {
  330. stepLabel: [{ type: ContentChild, args: [MatStepLabel, { static: false },] }]
  331. };
  332. return MatStep;
  333. }(CdkStep));
  334. var MatStepper = /** @class */ (function (_super) {
  335. __extends(MatStepper, _super);
  336. function MatStepper() {
  337. var _this = _super !== null && _super.apply(this, arguments) || this;
  338. /**
  339. * Event emitted when the current step is done transitioning in.
  340. */
  341. _this.animationDone = new EventEmitter();
  342. /**
  343. * Consumer-specified template-refs to be used to override the header icons.
  344. */
  345. _this._iconOverrides = {};
  346. /**
  347. * Stream of animation `done` events when the body expands/collapses.
  348. */
  349. _this._animationDone = new Subject();
  350. return _this;
  351. }
  352. /**
  353. * @return {?}
  354. */
  355. MatStepper.prototype.ngAfterContentInit = /**
  356. * @return {?}
  357. */
  358. function () {
  359. var _this = this;
  360. this._icons.forEach((/**
  361. * @param {?} __0
  362. * @return {?}
  363. */
  364. function (_a) {
  365. var name = _a.name, templateRef = _a.templateRef;
  366. return _this._iconOverrides[name] = templateRef;
  367. }));
  368. // Mark the component for change detection whenever the content children query changes
  369. this._steps.changes.pipe(takeUntil(this._destroyed)).subscribe((/**
  370. * @return {?}
  371. */
  372. function () { return _this._stateChanged(); }));
  373. this._animationDone.pipe(
  374. // This needs a `distinctUntilChanged` in order to avoid emitting the same event twice due
  375. // to a bug in animations where the `.done` callback gets invoked twice on some browsers.
  376. // See https://github.com/angular/angular/issues/24084
  377. distinctUntilChanged((/**
  378. * @param {?} x
  379. * @param {?} y
  380. * @return {?}
  381. */
  382. function (x, y) { return x.fromState === y.fromState && x.toState === y.toState; })), takeUntil(this._destroyed)).subscribe((/**
  383. * @param {?} event
  384. * @return {?}
  385. */
  386. function (event) {
  387. if (((/** @type {?} */ (event.toState))) === 'current') {
  388. _this.animationDone.emit();
  389. }
  390. }));
  391. };
  392. MatStepper.decorators = [
  393. { type: Directive, args: [{ selector: '[matStepper]', providers: [{ provide: CdkStepper, useExisting: MatStepper }] },] },
  394. ];
  395. MatStepper.propDecorators = {
  396. _stepHeader: [{ type: ViewChildren, args: [MatStepHeader,] }],
  397. _steps: [{ type: ContentChildren, args: [MatStep,] }],
  398. _icons: [{ type: ContentChildren, args: [MatStepperIcon,] }],
  399. animationDone: [{ type: Output }],
  400. disableRipple: [{ type: Input }]
  401. };
  402. return MatStepper;
  403. }(CdkStepper));
  404. var MatHorizontalStepper = /** @class */ (function (_super) {
  405. __extends(MatHorizontalStepper, _super);
  406. function MatHorizontalStepper() {
  407. var _this = _super !== null && _super.apply(this, arguments) || this;
  408. /**
  409. * Whether the label should display in bottom or end position.
  410. */
  411. _this.labelPosition = 'end';
  412. return _this;
  413. }
  414. MatHorizontalStepper.decorators = [
  415. { type: Component, args: [{selector: 'mat-horizontal-stepper',
  416. exportAs: 'matHorizontalStepper',
  417. template: "<div class=\"mat-horizontal-stepper-header-container\"><ng-container *ngFor=\"let step of steps; let i = index; let isLast = last\"><mat-step-header class=\"mat-horizontal-stepper-header\" (click)=\"step.select()\" (keydown)=\"_onKeydown($event)\" [tabIndex]=\"_getFocusIndex() === i ? 0 : -1\" [id]=\"_getStepLabelId(i)\" [attr.aria-posinset]=\"i + 1\" [attr.aria-setsize]=\"steps.length\" [attr.aria-controls]=\"_getStepContentId(i)\" [attr.aria-selected]=\"selectedIndex == i\" [attr.aria-label]=\"step.ariaLabel || null\" [attr.aria-labelledby]=\"(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null\" [index]=\"i\" [state]=\"_getIndicatorType(i, step.state)\" [label]=\"step.stepLabel || step.label\" [selected]=\"selectedIndex === i\" [active]=\"step.completed || selectedIndex === i || !linear\" [optional]=\"step.optional\" [errorMessage]=\"step.errorMessage\" [iconOverrides]=\"_iconOverrides\" [disableRipple]=\"disableRipple\"></mat-step-header><div *ngIf=\"!isLast\" class=\"mat-stepper-horizontal-line\"></div></ng-container></div><div class=\"mat-horizontal-content-container\"><div *ngFor=\"let step of steps; let i = index\" [attr.tabindex]=\"selectedIndex === i ? 0 : null\" class=\"mat-horizontal-stepper-content\" role=\"tabpanel\" [@stepTransition]=\"_getAnimationDirection(i)\" (@stepTransition.done)=\"_animationDone.next($event)\" [id]=\"_getStepContentId(i)\" [attr.aria-labelledby]=\"_getStepLabelId(i)\" [attr.aria-expanded]=\"selectedIndex === i\"><ng-container [ngTemplateOutlet]=\"step.content\"></ng-container></div></div>",
  418. styles: [".mat-stepper-horizontal,.mat-stepper-vertical{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,.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,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{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:first-child::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before{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}"],
  419. inputs: ['selectedIndex'],
  420. host: {
  421. 'class': 'mat-stepper-horizontal',
  422. '[class.mat-stepper-label-position-end]': 'labelPosition == "end"',
  423. '[class.mat-stepper-label-position-bottom]': 'labelPosition == "bottom"',
  424. 'aria-orientation': 'horizontal',
  425. 'role': 'tablist',
  426. },
  427. animations: [matStepperAnimations.horizontalStepTransition],
  428. providers: [
  429. { provide: MatStepper, useExisting: MatHorizontalStepper },
  430. { provide: CdkStepper, useExisting: MatHorizontalStepper }
  431. ],
  432. encapsulation: ViewEncapsulation.None,
  433. changeDetection: ChangeDetectionStrategy.OnPush,
  434. },] },
  435. ];
  436. MatHorizontalStepper.propDecorators = {
  437. labelPosition: [{ type: Input }]
  438. };
  439. return MatHorizontalStepper;
  440. }(MatStepper));
  441. var MatVerticalStepper = /** @class */ (function (_super) {
  442. __extends(MatVerticalStepper, _super);
  443. function MatVerticalStepper(dir, changeDetectorRef,
  444. // @breaking-change 8.0.0 `elementRef` and `_document` parameters to become required.
  445. elementRef, _document) {
  446. var _this = _super.call(this, dir, changeDetectorRef, elementRef, _document) || this;
  447. _this._orientation = 'vertical';
  448. return _this;
  449. }
  450. MatVerticalStepper.decorators = [
  451. { type: Component, args: [{selector: 'mat-vertical-stepper',
  452. exportAs: 'matVerticalStepper',
  453. template: "<div class=\"mat-step\" *ngFor=\"let step of steps; let i = index; let isLast = last\"><mat-step-header class=\"mat-vertical-stepper-header\" (click)=\"step.select()\" (keydown)=\"_onKeydown($event)\" [tabIndex]=\"_getFocusIndex() == i ? 0 : -1\" [id]=\"_getStepLabelId(i)\" [attr.aria-posinset]=\"i + 1\" [attr.aria-setsize]=\"steps.length\" [attr.aria-controls]=\"_getStepContentId(i)\" [attr.aria-selected]=\"selectedIndex === i\" [attr.aria-label]=\"step.ariaLabel || null\" [attr.aria-labelledby]=\"(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null\" [index]=\"i\" [state]=\"_getIndicatorType(i, step.state)\" [label]=\"step.stepLabel || step.label\" [selected]=\"selectedIndex === i\" [active]=\"step.completed || selectedIndex === i || !linear\" [optional]=\"step.optional\" [errorMessage]=\"step.errorMessage\" [iconOverrides]=\"_iconOverrides\" [disableRipple]=\"disableRipple\"></mat-step-header><div class=\"mat-vertical-content-container\" [class.mat-stepper-vertical-line]=\"!isLast\"><div class=\"mat-vertical-stepper-content\" role=\"tabpanel\" [attr.tabindex]=\"selectedIndex === i ? 0 : null\" [@stepTransition]=\"_getAnimationDirection(i)\" (@stepTransition.done)=\"_animationDone.next($event)\" [id]=\"_getStepContentId(i)\" [attr.aria-labelledby]=\"_getStepLabelId(i)\" [attr.aria-expanded]=\"selectedIndex === i\"><div class=\"mat-vertical-content\"><ng-container [ngTemplateOutlet]=\"step.content\"></ng-container></div></div></div></div>",
  454. styles: [".mat-stepper-horizontal,.mat-stepper-vertical{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,.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,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{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:first-child::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before{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}"],
  455. inputs: ['selectedIndex'],
  456. host: {
  457. 'class': 'mat-stepper-vertical',
  458. 'aria-orientation': 'vertical',
  459. 'role': 'tablist',
  460. },
  461. animations: [matStepperAnimations.verticalStepTransition],
  462. providers: [
  463. { provide: MatStepper, useExisting: MatVerticalStepper },
  464. { provide: CdkStepper, useExisting: MatVerticalStepper }
  465. ],
  466. encapsulation: ViewEncapsulation.None,
  467. changeDetection: ChangeDetectionStrategy.OnPush,
  468. },] },
  469. ];
  470. /** @nocollapse */
  471. MatVerticalStepper.ctorParameters = function () { return [
  472. { type: Directionality, decorators: [{ type: Optional }] },
  473. { type: ChangeDetectorRef },
  474. { type: ElementRef },
  475. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
  476. ]; };
  477. return MatVerticalStepper;
  478. }(MatStepper));
  479. /**
  480. * @fileoverview added by tsickle
  481. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  482. */
  483. /**
  484. * Button that moves to the next step in a stepper workflow.
  485. */
  486. var MatStepperNext = /** @class */ (function (_super) {
  487. __extends(MatStepperNext, _super);
  488. function MatStepperNext() {
  489. return _super !== null && _super.apply(this, arguments) || this;
  490. }
  491. MatStepperNext.decorators = [
  492. { type: Directive, args: [{
  493. selector: 'button[matStepperNext]',
  494. host: {
  495. '[type]': 'type',
  496. },
  497. inputs: ['type']
  498. },] },
  499. ];
  500. return MatStepperNext;
  501. }(CdkStepperNext));
  502. /**
  503. * Button that moves to the previous step in a stepper workflow.
  504. */
  505. var MatStepperPrevious = /** @class */ (function (_super) {
  506. __extends(MatStepperPrevious, _super);
  507. function MatStepperPrevious() {
  508. return _super !== null && _super.apply(this, arguments) || this;
  509. }
  510. MatStepperPrevious.decorators = [
  511. { type: Directive, args: [{
  512. selector: 'button[matStepperPrevious]',
  513. host: {
  514. '[type]': 'type',
  515. },
  516. inputs: ['type']
  517. },] },
  518. ];
  519. return MatStepperPrevious;
  520. }(CdkStepperPrevious));
  521. /**
  522. * @fileoverview added by tsickle
  523. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  524. */
  525. var MatStepperModule = /** @class */ (function () {
  526. function MatStepperModule() {
  527. }
  528. MatStepperModule.decorators = [
  529. { type: NgModule, args: [{
  530. imports: [
  531. MatCommonModule,
  532. CommonModule,
  533. PortalModule,
  534. MatButtonModule,
  535. CdkStepperModule,
  536. MatIconModule,
  537. MatRippleModule,
  538. ],
  539. exports: [
  540. MatCommonModule,
  541. MatHorizontalStepper,
  542. MatVerticalStepper,
  543. MatStep,
  544. MatStepLabel,
  545. MatStepper,
  546. MatStepperNext,
  547. MatStepperPrevious,
  548. MatStepHeader,
  549. MatStepperIcon,
  550. ],
  551. declarations: [
  552. MatHorizontalStepper,
  553. MatVerticalStepper,
  554. MatStep,
  555. MatStepLabel,
  556. MatStepper,
  557. MatStepperNext,
  558. MatStepperPrevious,
  559. MatStepHeader,
  560. MatStepperIcon,
  561. ],
  562. providers: [MAT_STEPPER_INTL_PROVIDER, ErrorStateMatcher],
  563. },] },
  564. ];
  565. return MatStepperModule;
  566. }());
  567. /**
  568. * @fileoverview added by tsickle
  569. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  570. */
  571. /**
  572. * @fileoverview added by tsickle
  573. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  574. */
  575. export { MatStepperModule, MatStepLabel, MatStep, MatStepper, MatHorizontalStepper, MatVerticalStepper, MatStepperNext, MatStepperPrevious, MatStepHeader, MAT_STEPPER_INTL_PROVIDER_FACTORY, MatStepperIntl, MAT_STEPPER_INTL_PROVIDER, matStepperAnimations, MatStepperIcon };
  576. //# sourceMappingURL=stepper.es5.js.map