source: trip-planner-front/node_modules/@angular/material/bundles/material-stepper.umd.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 49.2 KB
Line 
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/portal'), require('@angular/cdk/stepper'), require('@angular/common'), require('@angular/core'), require('@angular/material/button'), require('@angular/material/core'), require('@angular/material/icon'), require('@angular/cdk/a11y'), require('rxjs'), require('@angular/cdk/bidi'), require('rxjs/operators'), require('@angular/animations')) :
3 typeof define === 'function' && define.amd ? define('@angular/material/stepper', ['exports', '@angular/cdk/portal', '@angular/cdk/stepper', '@angular/common', '@angular/core', '@angular/material/button', '@angular/material/core', '@angular/material/icon', '@angular/cdk/a11y', 'rxjs', '@angular/cdk/bidi', 'rxjs/operators', '@angular/animations'], factory) :
4 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ng = global.ng || {}, global.ng.material = global.ng.material || {}, global.ng.material.stepper = {}), global.ng.cdk.portal, global.ng.cdk.stepper, global.ng.common, global.ng.core, global.ng.material.button, global.ng.material.core, global.ng.material.icon, global.ng.cdk.a11y, global.rxjs, global.ng.cdk.bidi, global.rxjs.operators, global.ng.animations));
5}(this, (function (exports, portal, stepper, common, i0, button, core, icon, a11y, rxjs, bidi, operators, animations) { 'use strict';
6
7 function _interopNamespace(e) {
8 if (e && e.__esModule) return e;
9 var n = Object.create(null);
10 if (e) {
11 Object.keys(e).forEach(function (k) {
12 if (k !== 'default') {
13 var d = Object.getOwnPropertyDescriptor(e, k);
14 Object.defineProperty(n, k, d.get ? d : {
15 enumerable: true,
16 get: function () {
17 return e[k];
18 }
19 });
20 }
21 });
22 }
23 n['default'] = e;
24 return Object.freeze(n);
25 }
26
27 var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
29 /*! *****************************************************************************
30 Copyright (c) Microsoft Corporation.
31
32 Permission to use, copy, modify, and/or distribute this software for any
33 purpose with or without fee is hereby granted.
34
35 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
36 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
37 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
38 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
40 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
41 PERFORMANCE OF THIS SOFTWARE.
42 ***************************************************************************** */
43 /* global Reflect, Promise */
44 var extendStatics = function (d, b) {
45 extendStatics = Object.setPrototypeOf ||
46 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
47 function (d, b) { for (var p in b)
48 if (Object.prototype.hasOwnProperty.call(b, p))
49 d[p] = b[p]; };
50 return extendStatics(d, b);
51 };
52 function __extends(d, b) {
53 if (typeof b !== "function" && b !== null)
54 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
55 extendStatics(d, b);
56 function __() { this.constructor = d; }
57 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
58 }
59 var __assign = function () {
60 __assign = Object.assign || function __assign(t) {
61 for (var s, i = 1, n = arguments.length; i < n; i++) {
62 s = arguments[i];
63 for (var p in s)
64 if (Object.prototype.hasOwnProperty.call(s, p))
65 t[p] = s[p];
66 }
67 return t;
68 };
69 return __assign.apply(this, arguments);
70 };
71 function __rest(s, e) {
72 var t = {};
73 for (var p in s)
74 if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
75 t[p] = s[p];
76 if (s != null && typeof Object.getOwnPropertySymbols === "function")
77 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
78 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
79 t[p[i]] = s[p[i]];
80 }
81 return t;
82 }
83 function __decorate(decorators, target, key, desc) {
84 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
85 if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
86 r = Reflect.decorate(decorators, target, key, desc);
87 else
88 for (var i = decorators.length - 1; i >= 0; i--)
89 if (d = decorators[i])
90 r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
91 return c > 3 && r && Object.defineProperty(target, key, r), r;
92 }
93 function __param(paramIndex, decorator) {
94 return function (target, key) { decorator(target, key, paramIndex); };
95 }
96 function __metadata(metadataKey, metadataValue) {
97 if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
98 return Reflect.metadata(metadataKey, metadataValue);
99 }
100 function __awaiter(thisArg, _arguments, P, generator) {
101 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
102 return new (P || (P = Promise))(function (resolve, reject) {
103 function fulfilled(value) { try {
104 step(generator.next(value));
105 }
106 catch (e) {
107 reject(e);
108 } }
109 function rejected(value) { try {
110 step(generator["throw"](value));
111 }
112 catch (e) {
113 reject(e);
114 } }
115 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
116 step((generator = generator.apply(thisArg, _arguments || [])).next());
117 });
118 }
119 function __generator(thisArg, body) {
120 var _ = { label: 0, sent: function () { if (t[0] & 1)
121 throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
122 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
123 function verb(n) { return function (v) { return step([n, v]); }; }
124 function step(op) {
125 if (f)
126 throw new TypeError("Generator is already executing.");
127 while (_)
128 try {
129 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
130 return t;
131 if (y = 0, t)
132 op = [op[0] & 2, t.value];
133 switch (op[0]) {
134 case 0:
135 case 1:
136 t = op;
137 break;
138 case 4:
139 _.label++;
140 return { value: op[1], done: false };
141 case 5:
142 _.label++;
143 y = op[1];
144 op = [0];
145 continue;
146 case 7:
147 op = _.ops.pop();
148 _.trys.pop();
149 continue;
150 default:
151 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
152 _ = 0;
153 continue;
154 }
155 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
156 _.label = op[1];
157 break;
158 }
159 if (op[0] === 6 && _.label < t[1]) {
160 _.label = t[1];
161 t = op;
162 break;
163 }
164 if (t && _.label < t[2]) {
165 _.label = t[2];
166 _.ops.push(op);
167 break;
168 }
169 if (t[2])
170 _.ops.pop();
171 _.trys.pop();
172 continue;
173 }
174 op = body.call(thisArg, _);
175 }
176 catch (e) {
177 op = [6, e];
178 y = 0;
179 }
180 finally {
181 f = t = 0;
182 }
183 if (op[0] & 5)
184 throw op[1];
185 return { value: op[0] ? op[1] : void 0, done: true };
186 }
187 }
188 var __createBinding = Object.create ? (function (o, m, k, k2) {
189 if (k2 === undefined)
190 k2 = k;
191 Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
192 }) : (function (o, m, k, k2) {
193 if (k2 === undefined)
194 k2 = k;
195 o[k2] = m[k];
196 });
197 function __exportStar(m, o) {
198 for (var p in m)
199 if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
200 __createBinding(o, m, p);
201 }
202 function __values(o) {
203 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
204 if (m)
205 return m.call(o);
206 if (o && typeof o.length === "number")
207 return {
208 next: function () {
209 if (o && i >= o.length)
210 o = void 0;
211 return { value: o && o[i++], done: !o };
212 }
213 };
214 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
215 }
216 function __read(o, n) {
217 var m = typeof Symbol === "function" && o[Symbol.iterator];
218 if (!m)
219 return o;
220 var i = m.call(o), r, ar = [], e;
221 try {
222 while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
223 ar.push(r.value);
224 }
225 catch (error) {
226 e = { error: error };
227 }
228 finally {
229 try {
230 if (r && !r.done && (m = i["return"]))
231 m.call(i);
232 }
233 finally {
234 if (e)
235 throw e.error;
236 }
237 }
238 return ar;
239 }
240 /** @deprecated */
241 function __spread() {
242 for (var ar = [], i = 0; i < arguments.length; i++)
243 ar = ar.concat(__read(arguments[i]));
244 return ar;
245 }
246 /** @deprecated */
247 function __spreadArrays() {
248 for (var s = 0, i = 0, il = arguments.length; i < il; i++)
249 s += arguments[i].length;
250 for (var r = Array(s), k = 0, i = 0; i < il; i++)
251 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
252 r[k] = a[j];
253 return r;
254 }
255 function __spreadArray(to, from, pack) {
256 if (pack || arguments.length === 2)
257 for (var i = 0, l = from.length, ar; i < l; i++) {
258 if (ar || !(i in from)) {
259 if (!ar)
260 ar = Array.prototype.slice.call(from, 0, i);
261 ar[i] = from[i];
262 }
263 }
264 return to.concat(ar || from);
265 }
266 function __await(v) {
267 return this instanceof __await ? (this.v = v, this) : new __await(v);
268 }
269 function __asyncGenerator(thisArg, _arguments, generator) {
270 if (!Symbol.asyncIterator)
271 throw new TypeError("Symbol.asyncIterator is not defined.");
272 var g = generator.apply(thisArg, _arguments || []), i, q = [];
273 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
274 function verb(n) { if (g[n])
275 i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
276 function resume(n, v) { try {
277 step(g[n](v));
278 }
279 catch (e) {
280 settle(q[0][3], e);
281 } }
282 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
283 function fulfill(value) { resume("next", value); }
284 function reject(value) { resume("throw", value); }
285 function settle(f, v) { if (f(v), q.shift(), q.length)
286 resume(q[0][0], q[0][1]); }
287 }
288 function __asyncDelegator(o) {
289 var i, p;
290 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
291 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
292 }
293 function __asyncValues(o) {
294 if (!Symbol.asyncIterator)
295 throw new TypeError("Symbol.asyncIterator is not defined.");
296 var m = o[Symbol.asyncIterator], i;
297 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
298 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
299 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
300 }
301 function __makeTemplateObject(cooked, raw) {
302 if (Object.defineProperty) {
303 Object.defineProperty(cooked, "raw", { value: raw });
304 }
305 else {
306 cooked.raw = raw;
307 }
308 return cooked;
309 }
310 ;
311 var __setModuleDefault = Object.create ? (function (o, v) {
312 Object.defineProperty(o, "default", { enumerable: true, value: v });
313 }) : function (o, v) {
314 o["default"] = v;
315 };
316 function __importStar(mod) {
317 if (mod && mod.__esModule)
318 return mod;
319 var result = {};
320 if (mod != null)
321 for (var k in mod)
322 if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
323 __createBinding(result, mod, k);
324 __setModuleDefault(result, mod);
325 return result;
326 }
327 function __importDefault(mod) {
328 return (mod && mod.__esModule) ? mod : { default: mod };
329 }
330 function __classPrivateFieldGet(receiver, state, kind, f) {
331 if (kind === "a" && !f)
332 throw new TypeError("Private accessor was defined without a getter");
333 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
334 throw new TypeError("Cannot read private member from an object whose class did not declare it");
335 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
336 }
337 function __classPrivateFieldSet(receiver, state, value, kind, f) {
338 if (kind === "m")
339 throw new TypeError("Private method is not writable");
340 if (kind === "a" && !f)
341 throw new TypeError("Private accessor was defined without a setter");
342 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
343 throw new TypeError("Cannot write private member to an object whose class did not declare it");
344 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
345 }
346
347 var MatStepLabel = /** @class */ (function (_super) {
348 __extends(MatStepLabel, _super);
349 function MatStepLabel() {
350 return _super !== null && _super.apply(this, arguments) || this;
351 }
352 return MatStepLabel;
353 }(stepper.CdkStepLabel));
354 MatStepLabel.decorators = [
355 { type: i0.Directive, args: [{
356 selector: '[matStepLabel]',
357 },] }
358 ];
359
360 /**
361 * @license
362 * Copyright Google LLC All Rights Reserved.
363 *
364 * Use of this source code is governed by an MIT-style license that can be
365 * found in the LICENSE file at https://angular.io/license
366 */
367 /** Stepper data that is required for internationalization. */
368 var MatStepperIntl = /** @class */ (function () {
369 function MatStepperIntl() {
370 /**
371 * Stream that emits whenever the labels here are changed. Use this to notify
372 * components if the labels have changed after initialization.
373 */
374 this.changes = new rxjs.Subject();
375 /** Label that is rendered below optional steps. */
376 this.optionalLabel = 'Optional';
377 /** Label that is used to indicate step as completed to screen readers. */
378 this.completedLabel = 'Completed';
379 /** Label that is used to indicate step as editable to screen readers. */
380 this.editableLabel = 'Editable';
381 }
382 return MatStepperIntl;
383 }());
384 MatStepperIntl.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function MatStepperIntl_Factory() { return new MatStepperIntl(); }, token: MatStepperIntl, providedIn: "root" });
385 MatStepperIntl.decorators = [
386 { type: i0.Injectable, args: [{ providedIn: 'root' },] }
387 ];
388 /** @docs-private */
389 function MAT_STEPPER_INTL_PROVIDER_FACTORY(parentIntl) {
390 return parentIntl || new MatStepperIntl();
391 }
392 /** @docs-private */
393 var MAT_STEPPER_INTL_PROVIDER = {
394 provide: MatStepperIntl,
395 deps: [[new i0.Optional(), new i0.SkipSelf(), MatStepperIntl]],
396 useFactory: MAT_STEPPER_INTL_PROVIDER_FACTORY
397 };
398
399 // Boilerplate for applying mixins to MatStepHeader.
400 /** @docs-private */
401 var _MatStepHeaderBase = core.mixinColor(/** @class */ (function (_super) {
402 __extends(MatStepHeaderBase, _super);
403 function MatStepHeaderBase(elementRef) {
404 return _super.call(this, elementRef) || this;
405 }
406 return MatStepHeaderBase;
407 }(stepper.CdkStepHeader)), 'primary');
408 var MatStepHeader = /** @class */ (function (_super) {
409 __extends(MatStepHeader, _super);
410 function MatStepHeader(_intl, _focusMonitor, _elementRef, changeDetectorRef) {
411 var _this = _super.call(this, _elementRef) || this;
412 _this._intl = _intl;
413 _this._focusMonitor = _focusMonitor;
414 _this._intlSubscription = _intl.changes.subscribe(function () { return changeDetectorRef.markForCheck(); });
415 return _this;
416 }
417 MatStepHeader.prototype.ngAfterViewInit = function () {
418 this._focusMonitor.monitor(this._elementRef, true);
419 };
420 MatStepHeader.prototype.ngOnDestroy = function () {
421 this._intlSubscription.unsubscribe();
422 this._focusMonitor.stopMonitoring(this._elementRef);
423 };
424 /** Focuses the step header. */
425 MatStepHeader.prototype.focus = function (origin, options) {
426 if (origin) {
427 this._focusMonitor.focusVia(this._elementRef, origin, options);
428 }
429 else {
430 this._elementRef.nativeElement.focus(options);
431 }
432 };
433 /** Returns string label of given step if it is a text label. */
434 MatStepHeader.prototype._stringLabel = function () {
435 return this.label instanceof MatStepLabel ? null : this.label;
436 };
437 /** Returns MatStepLabel if the label of given step is a template label. */
438 MatStepHeader.prototype._templateLabel = function () {
439 return this.label instanceof MatStepLabel ? this.label : null;
440 };
441 /** Returns the host HTML element. */
442 MatStepHeader.prototype._getHostElement = function () {
443 return this._elementRef.nativeElement;
444 };
445 /** Template context variables that are exposed to the `matStepperIcon` instances. */
446 MatStepHeader.prototype._getIconContext = function () {
447 return {
448 index: this.index,
449 active: this.active,
450 optional: this.optional
451 };
452 };
453 MatStepHeader.prototype._getDefaultTextForState = function (state) {
454 if (state == 'number') {
455 return "" + (this.index + 1);
456 }
457 if (state == 'edit') {
458 return 'create';
459 }
460 if (state == 'error') {
461 return 'warning';
462 }
463 return state;
464 };
465 return MatStepHeader;
466 }(_MatStepHeaderBase));
467 MatStepHeader.decorators = [
468 { type: i0.Component, args: [{
469 selector: 'mat-step-header',
470 template: "<div class=\"mat-step-header-ripple mat-focus-indicator\" 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 <span class=\"cdk-visually-hidden\" *ngIf=\"state === 'done'\">{{_intl.completedLabel}}</span>\n <span class=\"cdk-visually-hidden\" *ngIf=\"state === 'edit'\">{{_intl.editableLabel}}</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 <div class=\"mat-step-text-label\" *ngIf=\"_templateLabel()\">\n <ng-container [ngTemplateOutlet]=\"_templateLabel()!.template\"></ng-container>\n </div>\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",
471 inputs: ['color'],
472 host: {
473 'class': 'mat-step-header',
474 'role': 'tab',
475 },
476 encapsulation: i0.ViewEncapsulation.None,
477 changeDetection: i0.ChangeDetectionStrategy.OnPush,
478 styles: [".mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:transparent}.cdk-high-contrast-active .mat-step-header{outline:solid 1px}.cdk-high-contrast-active .mat-step-header.cdk-keyboard-focused,.cdk-high-contrast-active .mat-step-header.cdk-program-focused{outline:solid 3px}.cdk-high-contrast-active .mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.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"]
479 },] }
480 ];
481 MatStepHeader.ctorParameters = function () { return [
482 { type: MatStepperIntl },
483 { type: a11y.FocusMonitor },
484 { type: i0.ElementRef },
485 { type: i0.ChangeDetectorRef }
486 ]; };
487 MatStepHeader.propDecorators = {
488 state: [{ type: i0.Input }],
489 label: [{ type: i0.Input }],
490 errorMessage: [{ type: i0.Input }],
491 iconOverrides: [{ type: i0.Input }],
492 index: [{ type: i0.Input }],
493 selected: [{ type: i0.Input }],
494 active: [{ type: i0.Input }],
495 optional: [{ type: i0.Input }],
496 disableRipple: [{ type: i0.Input }]
497 };
498
499 /**
500 * @license
501 * Copyright Google LLC All Rights Reserved.
502 *
503 * Use of this source code is governed by an MIT-style license that can be
504 * found in the LICENSE file at https://angular.io/license
505 */
506 /**
507 * Animations used by the Material steppers.
508 * @docs-private
509 */
510 var matStepperAnimations = {
511 /** Animation that transitions the step along the X axis in a horizontal stepper. */
512 horizontalStepTransition: animations.trigger('horizontalStepTransition', [
513 animations.state('previous', animations.style({ transform: 'translate3d(-100%, 0, 0)', visibility: 'hidden' })),
514 // Transition to `inherit`, rather than `visible`,
515 // because visibility on a child element the one from the parent,
516 // making this element focusable inside of a `hidden` element.
517 animations.state('current', animations.style({ transform: 'none', visibility: 'inherit' })),
518 animations.state('next', animations.style({ transform: 'translate3d(100%, 0, 0)', visibility: 'hidden' })),
519 animations.transition('* => *', animations.animate('500ms cubic-bezier(0.35, 0, 0.25, 1)'))
520 ]),
521 /** Animation that transitions the step along the Y axis in a vertical stepper. */
522 verticalStepTransition: animations.trigger('verticalStepTransition', [
523 animations.state('previous', animations.style({ height: '0px', visibility: 'hidden' })),
524 animations.state('next', animations.style({ height: '0px', visibility: 'hidden' })),
525 // Transition to `inherit`, rather than `visible`,
526 // because visibility on a child element the one from the parent,
527 // making this element focusable inside of a `hidden` element.
528 animations.state('current', animations.style({ height: '*', visibility: 'inherit' })),
529 animations.transition('* <=> current', animations.animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))
530 ])
531 };
532
533 /**
534 * @license
535 * Copyright Google LLC All Rights Reserved.
536 *
537 * Use of this source code is governed by an MIT-style license that can be
538 * found in the LICENSE file at https://angular.io/license
539 */
540 /**
541 * Template to be used to override the icons inside the step header.
542 */
543 var MatStepperIcon = /** @class */ (function () {
544 function MatStepperIcon(templateRef) {
545 this.templateRef = templateRef;
546 }
547 return MatStepperIcon;
548 }());
549 MatStepperIcon.decorators = [
550 { type: i0.Directive, args: [{
551 selector: 'ng-template[matStepperIcon]',
552 },] }
553 ];
554 MatStepperIcon.ctorParameters = function () { return [
555 { type: i0.TemplateRef }
556 ]; };
557 MatStepperIcon.propDecorators = {
558 name: [{ type: i0.Input, args: ['matStepperIcon',] }]
559 };
560
561 /**
562 * @license
563 * Copyright Google LLC All Rights Reserved.
564 *
565 * Use of this source code is governed by an MIT-style license that can be
566 * found in the LICENSE file at https://angular.io/license
567 */
568 /**
569 * Content for a `mat-step` that will be rendered lazily.
570 */
571 var MatStepContent = /** @class */ (function () {
572 function MatStepContent(_template) {
573 this._template = _template;
574 }
575 return MatStepContent;
576 }());
577 MatStepContent.decorators = [
578 { type: i0.Directive, args: [{
579 selector: 'ng-template[matStepContent]'
580 },] }
581 ];
582 MatStepContent.ctorParameters = function () { return [
583 { type: i0.TemplateRef }
584 ]; };
585
586 var MatStep = /** @class */ (function (_super) {
587 __extends(MatStep, _super);
588 function MatStep(stepper, _errorStateMatcher, _viewContainerRef, stepperOptions) {
589 var _this = _super.call(this, stepper, stepperOptions) || this;
590 _this._errorStateMatcher = _errorStateMatcher;
591 _this._viewContainerRef = _viewContainerRef;
592 _this._isSelected = rxjs.Subscription.EMPTY;
593 return _this;
594 }
595 MatStep.prototype.ngAfterContentInit = function () {
596 var _this = this;
597 this._isSelected = this._stepper.steps.changes.pipe(operators.switchMap(function () {
598 return _this._stepper.selectionChange.pipe(operators.map(function (event) { return event.selectedStep === _this; }), operators.startWith(_this._stepper.selected === _this));
599 })).subscribe(function (isSelected) {
600 if (isSelected && _this._lazyContent && !_this._portal) {
601 _this._portal = new portal.TemplatePortal(_this._lazyContent._template, _this._viewContainerRef);
602 }
603 });
604 };
605 MatStep.prototype.ngOnDestroy = function () {
606 this._isSelected.unsubscribe();
607 };
608 /** Custom error state matcher that additionally checks for validity of interacted form. */
609 MatStep.prototype.isErrorState = function (control, form) {
610 var originalErrorState = this._errorStateMatcher.isErrorState(control, form);
611 // Custom error state checks for the validity of form that is not submitted or touched
612 // since user can trigger a form change by calling for another step without directly
613 // interacting with the current form.
614 var customErrorState = !!(control && control.invalid && this.interacted);
615 return originalErrorState || customErrorState;
616 };
617 return MatStep;
618 }(stepper.CdkStep));
619 MatStep.decorators = [
620 { type: i0.Component, args: [{
621 selector: 'mat-step',
622 template: "<ng-template>\n <ng-content></ng-content>\n <ng-template [cdkPortalOutlet]=\"_portal\"></ng-template>\n</ng-template>\n",
623 providers: [
624 { provide: core.ErrorStateMatcher, useExisting: MatStep },
625 { provide: stepper.CdkStep, useExisting: MatStep },
626 ],
627 encapsulation: i0.ViewEncapsulation.None,
628 exportAs: 'matStep',
629 changeDetection: i0.ChangeDetectionStrategy.OnPush
630 },] }
631 ];
632 MatStep.ctorParameters = function () { return [
633 { type: MatStepper, decorators: [{ type: i0.Inject, args: [i0.forwardRef(function () { return MatStepper; }),] }] },
634 { type: core.ErrorStateMatcher, decorators: [{ type: i0.SkipSelf }] },
635 { type: i0.ViewContainerRef },
636 { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [stepper.STEPPER_GLOBAL_OPTIONS,] }] }
637 ]; };
638 MatStep.propDecorators = {
639 stepLabel: [{ type: i0.ContentChild, args: [MatStepLabel,] }],
640 color: [{ type: i0.Input }],
641 _lazyContent: [{ type: i0.ContentChild, args: [MatStepContent, { static: false },] }]
642 };
643 /**
644 * Proxies the public APIs from `MatStepper` to the deprecated `MatHorizontalStepper` and
645 * `MatVerticalStepper`.
646 * @deprecated Use `MatStepper` instead.
647 * @breaking-change 13.0.0
648 * @docs-private
649 */
650 var _MatProxyStepperBase = /** @class */ (function (_super) {
651 __extends(_MatProxyStepperBase, _super);
652 function _MatProxyStepperBase() {
653 return _super !== null && _super.apply(this, arguments) || this;
654 }
655 return _MatProxyStepperBase;
656 }(stepper.CdkStepper));
657 _MatProxyStepperBase.decorators = [
658 { type: i0.Directive }
659 ];
660 /**
661 * @deprecated Use `MatStepper` instead.
662 * @breaking-change 13.0.0
663 */
664 var MatHorizontalStepper = /** @class */ (function (_super) {
665 __extends(MatHorizontalStepper, _super);
666 function MatHorizontalStepper() {
667 return _super !== null && _super.apply(this, arguments) || this;
668 }
669 return MatHorizontalStepper;
670 }(_MatProxyStepperBase));
671 MatHorizontalStepper.decorators = [
672 { type: i0.Directive, args: [{ selector: 'mat-horizontal-stepper' },] }
673 ];
674 /**
675 * @deprecated Use `MatStepper` instead.
676 * @breaking-change 13.0.0
677 */
678 var MatVerticalStepper = /** @class */ (function (_super) {
679 __extends(MatVerticalStepper, _super);
680 function MatVerticalStepper() {
681 return _super !== null && _super.apply(this, arguments) || this;
682 }
683 return MatVerticalStepper;
684 }(_MatProxyStepperBase));
685 MatVerticalStepper.decorators = [
686 { type: i0.Directive, args: [{ selector: 'mat-vertical-stepper' },] }
687 ];
688 var MatStepper = /** @class */ (function (_super) {
689 __extends(MatStepper, _super);
690 function MatStepper(dir, changeDetectorRef, elementRef, _document) {
691 var _this = _super.call(this, dir, changeDetectorRef, elementRef, _document) || this;
692 /** Steps that belong to the current stepper, excluding ones from nested steppers. */
693 _this.steps = new i0.QueryList();
694 /** Event emitted when the current step is done transitioning in. */
695 _this.animationDone = new i0.EventEmitter();
696 /**
697 * Whether the label should display in bottom or end position.
698 * Only applies in the `horizontal` orientation.
699 */
700 _this.labelPosition = 'end';
701 /** Consumer-specified template-refs to be used to override the header icons. */
702 _this._iconOverrides = {};
703 /** Stream of animation `done` events when the body expands/collapses. */
704 _this._animationDone = new rxjs.Subject();
705 var nodeName = elementRef.nativeElement.nodeName.toLowerCase();
706 _this.orientation = nodeName === 'mat-vertical-stepper' ? 'vertical' : 'horizontal';
707 return _this;
708 }
709 MatStepper.prototype.ngAfterContentInit = function () {
710 var _this = this;
711 _super.prototype.ngAfterContentInit.call(this);
712 this._icons.forEach(function (_a) {
713 var name = _a.name, templateRef = _a.templateRef;
714 return _this._iconOverrides[name] = templateRef;
715 });
716 // Mark the component for change detection whenever the content children query changes
717 this.steps.changes.pipe(operators.takeUntil(this._destroyed)).subscribe(function () {
718 _this._stateChanged();
719 });
720 this._animationDone.pipe(
721 // This needs a `distinctUntilChanged` in order to avoid emitting the same event twice due
722 // to a bug in animations where the `.done` callback gets invoked twice on some browsers.
723 // See https://github.com/angular/angular/issues/24084
724 operators.distinctUntilChanged(function (x, y) { return x.fromState === y.fromState && x.toState === y.toState; }), operators.takeUntil(this._destroyed)).subscribe(function (event) {
725 if (event.toState === 'current') {
726 _this.animationDone.emit();
727 }
728 });
729 };
730 MatStepper.prototype._stepIsNavigable = function (index, step) {
731 return step.completed || this.selectedIndex === index || !this.linear;
732 };
733 return MatStepper;
734 }(stepper.CdkStepper));
735 MatStepper.decorators = [
736 { type: i0.Component, args: [{
737 selector: 'mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]',
738 exportAs: 'matStepper, matVerticalStepper, matHorizontalStepper',
739 template: "<ng-container [ngSwitch]=\"orientation\">\n <!-- Horizontal stepper -->\n <ng-container *ngSwitchCase=\"'horizontal'\">\n <div class=\"mat-horizontal-stepper-header-container\">\n <ng-container *ngFor=\"let step of steps; let i = index; let isLast = last\">\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate\"\n [ngTemplateOutletContext]=\"{step: step, i: i}\"></ng-container>\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 class=\"mat-horizontal-stepper-content\" role=\"tabpanel\"\n [@horizontalStepTransition]=\"_getAnimationDirection(i)\"\n (@horizontalStepTransition.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 </ng-container>\n\n <!-- Vertical stepper -->\n <ng-container *ngSwitchCase=\"'vertical'\">\n <div class=\"mat-step\" *ngFor=\"let step of steps; let i = index; let isLast = last\">\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate\"\n [ngTemplateOutletContext]=\"{step: step, i: i}\"></ng-container>\n <div class=\"mat-vertical-content-container\" [class.mat-stepper-vertical-line]=\"!isLast\">\n <div class=\"mat-vertical-stepper-content\" role=\"tabpanel\"\n [@verticalStepTransition]=\"_getAnimationDirection(i)\"\n (@verticalStepTransition.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 </ng-container>\n\n</ng-container>\n\n<!-- Common step templating -->\n<ng-template let-step=\"step\" let-i=\"i\" #stepTemplate>\n <mat-step-header\n [class.mat-horizontal-stepper-header]=\"orientation === 'horizontal'\"\n [class.mat-vertical-stepper-header]=\"orientation === 'vertical'\"\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 [attr.aria-disabled]=\"_stepIsNavigable(i, step) ? null : true\"\n [index]=\"i\"\n [state]=\"_getIndicatorType(i, step.state)\"\n [label]=\"step.stepLabel || step.label\"\n [selected]=\"selectedIndex === i\"\n [active]=\"_stepIsNavigable(i, step)\"\n [optional]=\"step.optional\"\n [errorMessage]=\"step.errorMessage\"\n [iconOverrides]=\"_iconOverrides\"\n [disableRipple]=\"disableRipple || !_stepIsNavigable(i, step)\"\n [color]=\"step.color || color\"></mat-step-header>\n</ng-template>\n",
740 inputs: ['selectedIndex'],
741 host: {
742 '[class.mat-stepper-horizontal]': 'orientation === "horizontal"',
743 '[class.mat-stepper-vertical]': 'orientation === "vertical"',
744 '[class.mat-stepper-label-position-end]': 'orientation === "horizontal" && labelPosition == "end"',
745 '[class.mat-stepper-label-position-bottom]': 'orientation === "horizontal" && labelPosition == "bottom"',
746 '[attr.aria-orientation]': 'orientation',
747 'role': 'tablist',
748 },
749 animations: [
750 matStepperAnimations.horizontalStepTransition,
751 matStepperAnimations.verticalStepTransition,
752 ],
753 providers: [
754 { provide: stepper.CdkStepper, useExisting: MatStepper },
755 { provide: MatHorizontalStepper, useExisting: MatStepper },
756 { provide: MatVerticalStepper, useExisting: MatStepper },
757 ],
758 encapsulation: i0.ViewEncapsulation.None,
759 changeDetection: i0.ChangeDetectionStrategy.OnPush,
760 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}.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;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}.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;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}.cdk-high-contrast-active .mat-horizontal-content-container{outline:solid 1px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}.cdk-high-contrast-active .mat-vertical-content-container{outline:solid 1px}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:\"\";position:absolute;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"]
761 },] }
762 ];
763 MatStepper.ctorParameters = function () { return [
764 { type: bidi.Directionality, decorators: [{ type: i0.Optional }] },
765 { type: i0.ChangeDetectorRef },
766 { type: i0.ElementRef },
767 { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }
768 ]; };
769 MatStepper.propDecorators = {
770 _stepHeader: [{ type: i0.ViewChildren, args: [MatStepHeader,] }],
771 _steps: [{ type: i0.ContentChildren, args: [MatStep, { descendants: true },] }],
772 _icons: [{ type: i0.ContentChildren, args: [MatStepperIcon, { descendants: true },] }],
773 animationDone: [{ type: i0.Output }],
774 disableRipple: [{ type: i0.Input }],
775 color: [{ type: i0.Input }],
776 labelPosition: [{ type: i0.Input }]
777 };
778
779 /** Button that moves to the next step in a stepper workflow. */
780 var MatStepperNext = /** @class */ (function (_super) {
781 __extends(MatStepperNext, _super);
782 function MatStepperNext() {
783 return _super !== null && _super.apply(this, arguments) || this;
784 }
785 return MatStepperNext;
786 }(stepper.CdkStepperNext));
787 MatStepperNext.decorators = [
788 { type: i0.Directive, args: [{
789 selector: 'button[matStepperNext]',
790 host: {
791 'class': 'mat-stepper-next',
792 '[type]': 'type',
793 },
794 inputs: ['type']
795 },] }
796 ];
797 /** Button that moves to the previous step in a stepper workflow. */
798 var MatStepperPrevious = /** @class */ (function (_super) {
799 __extends(MatStepperPrevious, _super);
800 function MatStepperPrevious() {
801 return _super !== null && _super.apply(this, arguments) || this;
802 }
803 return MatStepperPrevious;
804 }(stepper.CdkStepperPrevious));
805 MatStepperPrevious.decorators = [
806 { type: i0.Directive, args: [{
807 selector: 'button[matStepperPrevious]',
808 host: {
809 'class': 'mat-stepper-previous',
810 '[type]': 'type',
811 },
812 inputs: ['type']
813 },] }
814 ];
815
816 /**
817 * @license
818 * Copyright Google LLC All Rights Reserved.
819 *
820 * Use of this source code is governed by an MIT-style license that can be
821 * found in the LICENSE file at https://angular.io/license
822 */
823 var MatStepperModule = /** @class */ (function () {
824 function MatStepperModule() {
825 }
826 return MatStepperModule;
827 }());
828 MatStepperModule.decorators = [
829 { type: i0.NgModule, args: [{
830 imports: [
831 core.MatCommonModule,
832 common.CommonModule,
833 portal.PortalModule,
834 button.MatButtonModule,
835 stepper.CdkStepperModule,
836 icon.MatIconModule,
837 core.MatRippleModule,
838 ],
839 exports: [
840 core.MatCommonModule,
841 MatStep,
842 MatStepLabel,
843 MatStepper,
844 MatStepperNext,
845 MatStepperPrevious,
846 MatStepHeader,
847 MatStepperIcon,
848 MatStepContent,
849 ],
850 declarations: [
851 MatHorizontalStepper,
852 MatVerticalStepper,
853 MatStep,
854 MatStepLabel,
855 MatStepper,
856 MatStepperNext,
857 MatStepperPrevious,
858 MatStepHeader,
859 MatStepperIcon,
860 MatStepContent,
861 ],
862 providers: [MAT_STEPPER_INTL_PROVIDER, core.ErrorStateMatcher],
863 },] }
864 ];
865
866 /**
867 * @license
868 * Copyright Google LLC All Rights Reserved.
869 *
870 * Use of this source code is governed by an MIT-style license that can be
871 * found in the LICENSE file at https://angular.io/license
872 */
873
874 /**
875 * Generated bundle index. Do not edit.
876 */
877
878 exports.MAT_STEPPER_INTL_PROVIDER = MAT_STEPPER_INTL_PROVIDER;
879 exports.MAT_STEPPER_INTL_PROVIDER_FACTORY = MAT_STEPPER_INTL_PROVIDER_FACTORY;
880 exports.MatHorizontalStepper = MatHorizontalStepper;
881 exports.MatStep = MatStep;
882 exports.MatStepContent = MatStepContent;
883 exports.MatStepHeader = MatStepHeader;
884 exports.MatStepLabel = MatStepLabel;
885 exports.MatStepper = MatStepper;
886 exports.MatStepperIcon = MatStepperIcon;
887 exports.MatStepperIntl = MatStepperIntl;
888 exports.MatStepperModule = MatStepperModule;
889 exports.MatStepperNext = MatStepperNext;
890 exports.MatStepperPrevious = MatStepperPrevious;
891 exports.MatVerticalStepper = MatVerticalStepper;
892 exports.matStepperAnimations = matStepperAnimations;
893
894 Object.defineProperty(exports, '__esModule', { value: true });
895
896})));
897//# sourceMappingURL=material-stepper.umd.js.map
Note: See TracBrowser for help on using the repository browser.