stepper.mjs 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. import { TemplatePortal, CdkPortalOutlet, PortalModule } from '@angular/cdk/portal';
  2. import { CdkStepLabel, CdkStepHeader, CdkStep, CdkStepper, CdkStepperNext, CdkStepperPrevious, CdkStepperModule } from '@angular/cdk/stepper';
  3. import * as i0 from '@angular/core';
  4. import { Directive, Injectable, Optional, SkipSelf, inject, ChangeDetectorRef, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, TemplateRef, ViewContainerRef, ContentChild, NgZone, Renderer2, ANIMATION_MODULE_TYPE, signal, QueryList, EventEmitter, ElementRef, ViewChildren, ContentChildren, Output, NgModule } from '@angular/core';
  5. import { FocusMonitor } from '@angular/cdk/a11y';
  6. import { Subject, Subscription } from 'rxjs';
  7. import { NgTemplateOutlet } from '@angular/common';
  8. import { _CdkPrivateStyleLoader, _VisuallyHiddenLoader } from '@angular/cdk/private';
  9. import { MatIcon, MatIconModule } from './icon.mjs';
  10. import { _ as _StructuralStylesLoader } from './structural-styles-BQUT6wsL.mjs';
  11. import { M as MatRipple } from './ripple-BT3tzh6F.mjs';
  12. import { Platform } from '@angular/cdk/platform';
  13. import { switchMap, map, startWith, takeUntil } from 'rxjs/operators';
  14. import { E as ErrorStateMatcher } from './error-options-Dm2JJUbF.mjs';
  15. import { M as MatCommonModule } from './common-module-WayjW0Pb.mjs';
  16. import { M as MatRippleModule } from './index-SYVYjXwK.mjs';
  17. import './icon-registry-B2IMBfNA.mjs';
  18. import '@angular/common/http';
  19. import '@angular/platform-browser';
  20. import '@angular/cdk/coercion';
  21. import '@angular/cdk/bidi';
  22. class MatStepLabel extends CdkStepLabel {
  23. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepLabel, deps: null, target: i0.ɵɵFactoryTarget.Directive });
  24. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: MatStepLabel, isStandalone: true, selector: "[matStepLabel]", usesInheritance: true, ngImport: i0 });
  25. }
  26. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepLabel, decorators: [{
  27. type: Directive,
  28. args: [{
  29. selector: '[matStepLabel]',
  30. }]
  31. }] });
  32. /** Stepper data that is required for internationalization. */
  33. class MatStepperIntl {
  34. /**
  35. * Stream that emits whenever the labels here are changed. Use this to notify
  36. * components if the labels have changed after initialization.
  37. */
  38. changes = new Subject();
  39. /** Label that is rendered below optional steps. */
  40. optionalLabel = 'Optional';
  41. /** Label that is used to indicate step as completed to screen readers. */
  42. completedLabel = 'Completed';
  43. /** Label that is used to indicate step as editable to screen readers. */
  44. editableLabel = 'Editable';
  45. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
  46. static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperIntl, providedIn: 'root' });
  47. }
  48. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperIntl, decorators: [{
  49. type: Injectable,
  50. args: [{ providedIn: 'root' }]
  51. }] });
  52. /**
  53. * @docs-private
  54. * @deprecated No longer used, will be removed.
  55. * @breaking-change 21.0.0
  56. */
  57. function MAT_STEPPER_INTL_PROVIDER_FACTORY(parentIntl) {
  58. return parentIntl || new MatStepperIntl();
  59. }
  60. /**
  61. * @docs-private
  62. * @deprecated No longer used, will be removed.
  63. * @breaking-change 21.0.0
  64. */
  65. const MAT_STEPPER_INTL_PROVIDER = {
  66. provide: MatStepperIntl,
  67. deps: [[new Optional(), new SkipSelf(), MatStepperIntl]],
  68. useFactory: MAT_STEPPER_INTL_PROVIDER_FACTORY,
  69. };
  70. class MatStepHeader extends CdkStepHeader {
  71. _intl = inject(MatStepperIntl);
  72. _focusMonitor = inject(FocusMonitor);
  73. _intlSubscription;
  74. /** State of the given step. */
  75. state;
  76. /** Label of the given step. */
  77. label;
  78. /** Error message to display when there's an error. */
  79. errorMessage;
  80. /** Overrides for the header icons, passed in via the stepper. */
  81. iconOverrides;
  82. /** Index of the given step. */
  83. index;
  84. /** Whether the given step is selected. */
  85. selected;
  86. /** Whether the given step label is active. */
  87. active;
  88. /** Whether the given step is optional. */
  89. optional;
  90. /** Whether the ripple should be disabled. */
  91. disableRipple;
  92. /**
  93. * Theme color of the step header. This API is supported in M2 themes only, it
  94. * has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/stepper/styling.
  95. *
  96. * For information on applying color variants in M3, see
  97. * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
  98. */
  99. color;
  100. constructor() {
  101. super();
  102. const styleLoader = inject(_CdkPrivateStyleLoader);
  103. styleLoader.load(_StructuralStylesLoader);
  104. styleLoader.load(_VisuallyHiddenLoader);
  105. const changeDetectorRef = inject(ChangeDetectorRef);
  106. this._intlSubscription = this._intl.changes.subscribe(() => changeDetectorRef.markForCheck());
  107. }
  108. ngAfterViewInit() {
  109. this._focusMonitor.monitor(this._elementRef, true);
  110. }
  111. ngOnDestroy() {
  112. this._intlSubscription.unsubscribe();
  113. this._focusMonitor.stopMonitoring(this._elementRef);
  114. }
  115. /** Focuses the step header. */
  116. focus(origin, options) {
  117. if (origin) {
  118. this._focusMonitor.focusVia(this._elementRef, origin, options);
  119. }
  120. else {
  121. this._elementRef.nativeElement.focus(options);
  122. }
  123. }
  124. /** Returns string label of given step if it is a text label. */
  125. _stringLabel() {
  126. return this.label instanceof MatStepLabel ? null : this.label;
  127. }
  128. /** Returns MatStepLabel if the label of given step is a template label. */
  129. _templateLabel() {
  130. return this.label instanceof MatStepLabel ? this.label : null;
  131. }
  132. /** Returns the host HTML element. */
  133. _getHostElement() {
  134. return this._elementRef.nativeElement;
  135. }
  136. /** Template context variables that are exposed to the `matStepperIcon` instances. */
  137. _getIconContext() {
  138. return {
  139. index: this.index,
  140. active: this.active,
  141. optional: this.optional,
  142. };
  143. }
  144. _getDefaultTextForState(state) {
  145. if (state == 'number') {
  146. return `${this.index + 1}`;
  147. }
  148. if (state == 'edit') {
  149. return 'create';
  150. }
  151. if (state == 'error') {
  152. return 'warning';
  153. }
  154. return state;
  155. }
  156. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
  157. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: MatStepHeader, isStandalone: true, selector: "mat-step-header", inputs: { state: "state", label: "label", errorMessage: "errorMessage", iconOverrides: "iconOverrides", index: "index", selected: "selected", active: "active", optional: "optional", disableRipple: "disableRipple", color: "color" }, host: { attributes: { "role": "tab" }, properties: { "class": "\"mat-\" + (color || \"primary\")" }, classAttribute: "mat-step-header" }, usesInheritance: true, ngImport: i0, 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\">\n @if (iconOverrides && iconOverrides[state]) {\n <ng-container\n [ngTemplateOutlet]=\"iconOverrides[state]\"\n [ngTemplateOutletContext]=\"_getIconContext()\"></ng-container>\n } @else {\n @switch (state) {\n @case ('number') {\n <span aria-hidden=\"true\">{{_getDefaultTextForState(state)}}</span>\n }\n\n @default {\n @if (state === 'done') {\n <span class=\"cdk-visually-hidden\">{{_intl.completedLabel}}</span>\n } @else if (state === 'edit') {\n <span class=\"cdk-visually-hidden\">{{_intl.editableLabel}}</span>\n }\n\n <mat-icon aria-hidden=\"true\">{{_getDefaultTextForState(state)}}</mat-icon>\n }\n }\n }\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 (_templateLabel(); as templateLabel) {\n <!-- If there is a label template, use it. -->\n <div class=\"mat-step-text-label\">\n <ng-container [ngTemplateOutlet]=\"templateLabel.template\"></ng-container>\n </div>\n } @else if (_stringLabel()) {\n <!-- If there is no label template, fall back to the text label. -->\n <div class=\"mat-step-text-label\">{{label}}</div>\n }\n\n @if (optional && state != 'error') {\n <div class=\"mat-step-optional\">{{_intl.optionalLabel}}</div>\n }\n\n @if (state === 'error') {\n <div class=\"mat-step-sub-label-error\">{{errorMessage}}</div>\n }\n</div>\n\n", styles: [".mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-step-header:focus .mat-focus-indicator::before{content:\"\"}.mat-step-header:hover[aria-disabled=true]{cursor:default}.mat-step-header:hover:not([aria-disabled]),.mat-step-header:hover[aria-disabled=false]{background-color:var(--mat-stepper-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-inverse-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent));border-radius:var(--mat-stepper-header-hover-state-layer-shape, var(--mat-sys-corner-medium))}.mat-step-header.cdk-keyboard-focused,.mat-step-header.cdk-program-focused{background-color:var(--mat-stepper-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-inverse-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));border-radius:var(--mat-stepper-header-focus-state-layer-shape, var(--mat-sys-corner-medium))}@media(hover: none){.mat-step-header:hover{background:none}}@media(forced-colors: active){.mat-step-header{outline:solid 1px}.mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.mat-step-header[aria-disabled=true]{outline-color:GrayText}.mat-step-header[aria-disabled=true] .mat-step-label,.mat-step-header[aria-disabled=true] .mat-step-icon,.mat-step-header[aria-disabled=true] .mat-step-optional{color:GrayText}}.mat-step-optional{font-size:12px;color:var(--mat-stepper-header-optional-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-sub-label-error{font-size:12px;font-weight:normal}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative;color:var(--mat-stepper-header-icon-foreground-color, var(--mat-sys-surface));background-color:var(--mat-stepper-header-icon-background-color, var(--mat-sys-on-surface-variant))}.mat-step-icon-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:flex}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error{background-color:var(--mat-stepper-header-error-state-icon-background-color, transparent);color:var(--mat-stepper-header-error-state-icon-foreground-color, var(--mat-sys-error))}.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;font-family:var(--mat-stepper-header-label-text-font, var(--mat-sys-title-small-font));font-size:var(--mat-stepper-header-label-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-stepper-header-label-text-weight, var(--mat-sys-title-small-weight));color:var(--mat-stepper-header-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-label.mat-step-label-active{color:var(--mat-stepper-header-selected-state-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-label.mat-step-label-error{color:var(--mat-stepper-header-error-state-label-text-color, var(--mat-sys-error));font-size:var(--mat-stepper-header-error-state-label-text-size, var(--mat-sys-title-small-size))}.mat-step-label.mat-step-label-selected{font-size:var(--mat-stepper-header-selected-state-label-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-stepper-header-selected-state-label-text-weight, var(--mat-sys-title-small-weight))}.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}.mat-step-icon-selected{background-color:var(--mat-stepper-header-selected-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-selected-state-icon-foreground-color, var(--mat-sys-on-primary))}.mat-step-icon-state-done{background-color:var(--mat-stepper-header-done-state-icon-background-color);color:var(--mat-stepper-header-done-state-icon-foreground-color)}.mat-step-icon-state-edit{background-color:var(--mat-stepper-header-edit-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-edit-state-icon-foreground-color, var(--mat-sys-on-primary))}\n"], dependencies: [{ kind: "directive", type: MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  158. }
  159. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepHeader, decorators: [{
  160. type: Component,
  161. args: [{ selector: 'mat-step-header', host: {
  162. 'class': 'mat-step-header',
  163. '[class]': '"mat-" + (color || "primary")',
  164. 'role': 'tab',
  165. }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatRipple, NgTemplateOutlet, MatIcon], 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\">\n @if (iconOverrides && iconOverrides[state]) {\n <ng-container\n [ngTemplateOutlet]=\"iconOverrides[state]\"\n [ngTemplateOutletContext]=\"_getIconContext()\"></ng-container>\n } @else {\n @switch (state) {\n @case ('number') {\n <span aria-hidden=\"true\">{{_getDefaultTextForState(state)}}</span>\n }\n\n @default {\n @if (state === 'done') {\n <span class=\"cdk-visually-hidden\">{{_intl.completedLabel}}</span>\n } @else if (state === 'edit') {\n <span class=\"cdk-visually-hidden\">{{_intl.editableLabel}}</span>\n }\n\n <mat-icon aria-hidden=\"true\">{{_getDefaultTextForState(state)}}</mat-icon>\n }\n }\n }\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 (_templateLabel(); as templateLabel) {\n <!-- If there is a label template, use it. -->\n <div class=\"mat-step-text-label\">\n <ng-container [ngTemplateOutlet]=\"templateLabel.template\"></ng-container>\n </div>\n } @else if (_stringLabel()) {\n <!-- If there is no label template, fall back to the text label. -->\n <div class=\"mat-step-text-label\">{{label}}</div>\n }\n\n @if (optional && state != 'error') {\n <div class=\"mat-step-optional\">{{_intl.optionalLabel}}</div>\n }\n\n @if (state === 'error') {\n <div class=\"mat-step-sub-label-error\">{{errorMessage}}</div>\n }\n</div>\n\n", styles: [".mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-step-header:focus .mat-focus-indicator::before{content:\"\"}.mat-step-header:hover[aria-disabled=true]{cursor:default}.mat-step-header:hover:not([aria-disabled]),.mat-step-header:hover[aria-disabled=false]{background-color:var(--mat-stepper-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-inverse-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent));border-radius:var(--mat-stepper-header-hover-state-layer-shape, var(--mat-sys-corner-medium))}.mat-step-header.cdk-keyboard-focused,.mat-step-header.cdk-program-focused{background-color:var(--mat-stepper-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-inverse-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));border-radius:var(--mat-stepper-header-focus-state-layer-shape, var(--mat-sys-corner-medium))}@media(hover: none){.mat-step-header:hover{background:none}}@media(forced-colors: active){.mat-step-header{outline:solid 1px}.mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.mat-step-header[aria-disabled=true]{outline-color:GrayText}.mat-step-header[aria-disabled=true] .mat-step-label,.mat-step-header[aria-disabled=true] .mat-step-icon,.mat-step-header[aria-disabled=true] .mat-step-optional{color:GrayText}}.mat-step-optional{font-size:12px;color:var(--mat-stepper-header-optional-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-sub-label-error{font-size:12px;font-weight:normal}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative;color:var(--mat-stepper-header-icon-foreground-color, var(--mat-sys-surface));background-color:var(--mat-stepper-header-icon-background-color, var(--mat-sys-on-surface-variant))}.mat-step-icon-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:flex}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error{background-color:var(--mat-stepper-header-error-state-icon-background-color, transparent);color:var(--mat-stepper-header-error-state-icon-foreground-color, var(--mat-sys-error))}.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;font-family:var(--mat-stepper-header-label-text-font, var(--mat-sys-title-small-font));font-size:var(--mat-stepper-header-label-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-stepper-header-label-text-weight, var(--mat-sys-title-small-weight));color:var(--mat-stepper-header-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-label.mat-step-label-active{color:var(--mat-stepper-header-selected-state-label-text-color, var(--mat-sys-on-surface-variant))}.mat-step-label.mat-step-label-error{color:var(--mat-stepper-header-error-state-label-text-color, var(--mat-sys-error));font-size:var(--mat-stepper-header-error-state-label-text-size, var(--mat-sys-title-small-size))}.mat-step-label.mat-step-label-selected{font-size:var(--mat-stepper-header-selected-state-label-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-stepper-header-selected-state-label-text-weight, var(--mat-sys-title-small-weight))}.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}.mat-step-icon-selected{background-color:var(--mat-stepper-header-selected-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-selected-state-icon-foreground-color, var(--mat-sys-on-primary))}.mat-step-icon-state-done{background-color:var(--mat-stepper-header-done-state-icon-background-color);color:var(--mat-stepper-header-done-state-icon-foreground-color)}.mat-step-icon-state-edit{background-color:var(--mat-stepper-header-edit-state-icon-background-color, var(--mat-sys-primary));color:var(--mat-stepper-header-edit-state-icon-foreground-color, var(--mat-sys-on-primary))}\n"] }]
  166. }], ctorParameters: () => [], propDecorators: { state: [{
  167. type: Input
  168. }], label: [{
  169. type: Input
  170. }], errorMessage: [{
  171. type: Input
  172. }], iconOverrides: [{
  173. type: Input
  174. }], index: [{
  175. type: Input
  176. }], selected: [{
  177. type: Input
  178. }], active: [{
  179. type: Input
  180. }], optional: [{
  181. type: Input
  182. }], disableRipple: [{
  183. type: Input
  184. }], color: [{
  185. type: Input
  186. }] } });
  187. /**
  188. * Template to be used to override the icons inside the step header.
  189. */
  190. class MatStepperIcon {
  191. templateRef = inject(TemplateRef);
  192. /** Name of the icon to be overridden. */
  193. name;
  194. constructor() { }
  195. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  196. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: MatStepperIcon, isStandalone: true, selector: "ng-template[matStepperIcon]", inputs: { name: ["matStepperIcon", "name"] }, ngImport: i0 });
  197. }
  198. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperIcon, decorators: [{
  199. type: Directive,
  200. args: [{
  201. selector: 'ng-template[matStepperIcon]',
  202. }]
  203. }], ctorParameters: () => [], propDecorators: { name: [{
  204. type: Input,
  205. args: ['matStepperIcon']
  206. }] } });
  207. /**
  208. * Content for a `mat-step` that will be rendered lazily.
  209. */
  210. class MatStepContent {
  211. _template = inject(TemplateRef);
  212. constructor() { }
  213. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  214. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: MatStepContent, isStandalone: true, selector: "ng-template[matStepContent]", ngImport: i0 });
  215. }
  216. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepContent, decorators: [{
  217. type: Directive,
  218. args: [{
  219. selector: 'ng-template[matStepContent]',
  220. }]
  221. }], ctorParameters: () => [] });
  222. class MatStep extends CdkStep {
  223. _errorStateMatcher = inject(ErrorStateMatcher, { skipSelf: true });
  224. _viewContainerRef = inject(ViewContainerRef);
  225. _isSelected = Subscription.EMPTY;
  226. /** Content for step label given by `<ng-template matStepLabel>`. */
  227. // We need an initializer here to avoid a TS error.
  228. stepLabel = undefined;
  229. /**
  230. * Theme color for the particular step. This API is supported in M2 themes
  231. * only, it has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/stepper/styling.
  232. *
  233. * For information on applying color variants in M3, see
  234. * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
  235. */
  236. color;
  237. /** Content that will be rendered lazily. */
  238. _lazyContent;
  239. /** Currently-attached portal containing the lazy content. */
  240. _portal;
  241. ngAfterContentInit() {
  242. this._isSelected = this._stepper.steps.changes
  243. .pipe(switchMap(() => {
  244. return this._stepper.selectionChange.pipe(map(event => event.selectedStep === this), startWith(this._stepper.selected === this));
  245. }))
  246. .subscribe(isSelected => {
  247. if (isSelected && this._lazyContent && !this._portal) {
  248. this._portal = new TemplatePortal(this._lazyContent._template, this._viewContainerRef);
  249. }
  250. });
  251. }
  252. ngOnDestroy() {
  253. this._isSelected.unsubscribe();
  254. }
  255. /** Custom error state matcher that additionally checks for validity of interacted form. */
  256. isErrorState(control, form) {
  257. const originalErrorState = this._errorStateMatcher.isErrorState(control, form);
  258. // Custom error state checks for the validity of form that is not submitted or touched
  259. // since user can trigger a form change by calling for another step without directly
  260. // interacting with the current form.
  261. const customErrorState = !!(control && control.invalid && this.interacted);
  262. return originalErrorState || customErrorState;
  263. }
  264. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStep, deps: null, target: i0.ɵɵFactoryTarget.Component });
  265. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: MatStep, isStandalone: true, selector: "mat-step", inputs: { color: "color" }, host: { attributes: { "hidden": "" } }, providers: [
  266. { provide: ErrorStateMatcher, useExisting: MatStep },
  267. { provide: CdkStep, useExisting: MatStep },
  268. ], queries: [{ propertyName: "stepLabel", first: true, predicate: MatStepLabel, descendants: true }, { propertyName: "_lazyContent", first: true, predicate: MatStepContent, descendants: true }], exportAs: ["matStep"], usesInheritance: true, ngImport: i0, template: "<ng-template>\n <ng-content></ng-content>\n <ng-template [cdkPortalOutlet]=\"_portal\"></ng-template>\n</ng-template>\n", dependencies: [{ kind: "directive", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  269. }
  270. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStep, decorators: [{
  271. type: Component,
  272. args: [{ selector: 'mat-step', providers: [
  273. { provide: ErrorStateMatcher, useExisting: MatStep },
  274. { provide: CdkStep, useExisting: MatStep },
  275. ], encapsulation: ViewEncapsulation.None, exportAs: 'matStep', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CdkPortalOutlet], host: {
  276. 'hidden': '', // Hide the steps so they don't affect the layout.
  277. }, template: "<ng-template>\n <ng-content></ng-content>\n <ng-template [cdkPortalOutlet]=\"_portal\"></ng-template>\n</ng-template>\n" }]
  278. }], propDecorators: { stepLabel: [{
  279. type: ContentChild,
  280. args: [MatStepLabel]
  281. }], color: [{
  282. type: Input
  283. }], _lazyContent: [{
  284. type: ContentChild,
  285. args: [MatStepContent, { static: false }]
  286. }] } });
  287. class MatStepper extends CdkStepper {
  288. _ngZone = inject(NgZone);
  289. _renderer = inject(Renderer2);
  290. _animationsModule = inject(ANIMATION_MODULE_TYPE, { optional: true });
  291. _cleanupTransition;
  292. _isAnimating = signal(false);
  293. /** The list of step headers of the steps in the stepper. */
  294. _stepHeader = undefined;
  295. /** Elements hosting the step animations. */
  296. _animatedContainers;
  297. /** Full list of steps inside the stepper, including inside nested steppers. */
  298. _steps = undefined;
  299. /** Steps that belong to the current stepper, excluding ones from nested steppers. */
  300. steps = new QueryList();
  301. /** Custom icon overrides passed in by the consumer. */
  302. _icons;
  303. /** Event emitted when the current step is done transitioning in. */
  304. animationDone = new EventEmitter();
  305. /** Whether ripples should be disabled for the step headers. */
  306. disableRipple;
  307. /**
  308. * Theme color for all of the steps in stepper. This API is supported in M2
  309. * themes only, it has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/stepper/styling.
  310. *
  311. * For information on applying color variants in M3, see
  312. * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
  313. */
  314. color;
  315. /**
  316. * Whether the label should display in bottom or end position.
  317. * Only applies in the `horizontal` orientation.
  318. */
  319. labelPosition = 'end';
  320. /**
  321. * Position of the stepper's header.
  322. * Only applies in the `horizontal` orientation.
  323. */
  324. headerPosition = 'top';
  325. /** Consumer-specified template-refs to be used to override the header icons. */
  326. _iconOverrides = {};
  327. /** Duration for the animation. Will be normalized to milliseconds if no units are set. */
  328. get animationDuration() {
  329. return this._animationDuration;
  330. }
  331. set animationDuration(value) {
  332. this._animationDuration = /^\d+$/.test(value) ? value + 'ms' : value;
  333. }
  334. _animationDuration = '';
  335. /** Whether the stepper is rendering on the server. */
  336. _isServer = !inject(Platform).isBrowser;
  337. constructor() {
  338. super();
  339. const elementRef = inject(ElementRef);
  340. const nodeName = elementRef.nativeElement.nodeName.toLowerCase();
  341. this.orientation = nodeName === 'mat-vertical-stepper' ? 'vertical' : 'horizontal';
  342. }
  343. ngAfterContentInit() {
  344. super.ngAfterContentInit();
  345. this._icons.forEach(({ name, templateRef }) => (this._iconOverrides[name] = templateRef));
  346. // Mark the component for change detection whenever the content children query changes
  347. this.steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => this._stateChanged());
  348. // Transition events won't fire if animations are disabled so we simulate them.
  349. this.selectedIndexChange.pipe(takeUntil(this._destroyed)).subscribe(() => {
  350. const duration = this._getAnimationDuration();
  351. if (duration === '0ms' || duration === '0s') {
  352. this._onAnimationDone();
  353. }
  354. else {
  355. this._isAnimating.set(true);
  356. }
  357. });
  358. this._ngZone.runOutsideAngular(() => {
  359. if (this._animationsModule !== 'NoopAnimations') {
  360. setTimeout(() => {
  361. // Delay enabling the animations so we don't animate the initial state.
  362. this._elementRef.nativeElement.classList.add('mat-stepper-animations-enabled');
  363. // Bind this outside the zone since it fires for all transitions inside the stepper.
  364. this._cleanupTransition = this._renderer.listen(this._elementRef.nativeElement, 'transitionend', this._handleTransitionend);
  365. }, 200);
  366. }
  367. });
  368. }
  369. ngAfterViewInit() {
  370. super.ngAfterViewInit();
  371. // Prior to #30314 the stepper had animation `done` events bound to each animated container.
  372. // The animations module was firing them on initialization and for each subsequent animation.
  373. // Since the events were bound in the template, it had the unintended side-effect of triggering
  374. // change detection as well. It appears that this side-effect ended up being load-bearing,
  375. // because it was ensuring that the content elements (e.g. `matStepLabel`) that are defined
  376. // in sub-components actually get picked up in a timely fashion. This subscription simulates
  377. // the same change detection by using `queueMicrotask` similarly to the animations module.
  378. if (typeof queueMicrotask === 'function') {
  379. let hasEmittedInitial = false;
  380. this._animatedContainers.changes
  381. .pipe(startWith(null), takeUntil(this._destroyed))
  382. .subscribe(() => queueMicrotask(() => {
  383. // Simulate the initial `animationDone` event
  384. // that gets emitted by the animations module.
  385. if (!hasEmittedInitial) {
  386. hasEmittedInitial = true;
  387. this.animationDone.emit();
  388. }
  389. this._stateChanged();
  390. }));
  391. }
  392. }
  393. ngOnDestroy() {
  394. super.ngOnDestroy();
  395. this._cleanupTransition?.();
  396. }
  397. _stepIsNavigable(index, step) {
  398. return step.completed || this.selectedIndex === index || !this.linear;
  399. }
  400. _getAnimationDuration() {
  401. if (this._animationsModule === 'NoopAnimations') {
  402. return '0ms';
  403. }
  404. if (this.animationDuration) {
  405. return this.animationDuration;
  406. }
  407. return this.orientation === 'horizontal' ? '500ms' : '225ms';
  408. }
  409. _handleTransitionend = (event) => {
  410. const target = event.target;
  411. if (!target) {
  412. return;
  413. }
  414. // Because we bind a single `transitionend` handler on the host node and because transition
  415. // events bubble, we have to filter down to only the active step so don't emit events too
  416. // often. We check the orientation and `property` name first to reduce the amount of times
  417. // we need to check the DOM.
  418. const isHorizontalActiveElement = this.orientation === 'horizontal' &&
  419. event.propertyName === 'transform' &&
  420. target.classList.contains('mat-horizontal-stepper-content-current');
  421. const isVerticalActiveElement = this.orientation === 'vertical' &&
  422. event.propertyName === 'grid-template-rows' &&
  423. target.classList.contains('mat-vertical-content-container-active');
  424. // Finally we need to ensure that the animated element is a direct descendant,
  425. // rather than one coming from a nested stepper.
  426. const shouldEmit = (isHorizontalActiveElement || isVerticalActiveElement) &&
  427. this._animatedContainers.find(ref => ref.nativeElement === target);
  428. if (shouldEmit) {
  429. this._onAnimationDone();
  430. }
  431. };
  432. _onAnimationDone() {
  433. this._isAnimating.set(false);
  434. this.animationDone.emit();
  435. }
  436. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepper, deps: [], target: i0.ɵɵFactoryTarget.Component });
  437. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: MatStepper, isStandalone: true, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: { disableRipple: "disableRipple", color: "color", labelPosition: "labelPosition", headerPosition: "headerPosition", animationDuration: "animationDuration" }, outputs: { animationDone: "animationDone" }, host: { attributes: { "role": "tablist" }, properties: { "class.mat-stepper-horizontal": "orientation === \"horizontal\"", "class.mat-stepper-vertical": "orientation === \"vertical\"", "class.mat-stepper-label-position-end": "orientation === \"horizontal\" && labelPosition == \"end\"", "class.mat-stepper-label-position-bottom": "orientation === \"horizontal\" && labelPosition == \"bottom\"", "class.mat-stepper-header-position-bottom": "headerPosition === \"bottom\"", "class.mat-stepper-animating": "_isAnimating()", "style.--mat-stepper-animation-duration": "_getAnimationDuration()", "attr.aria-orientation": "orientation" } }, providers: [{ provide: CdkStepper, useExisting: MatStepper }], queries: [{ propertyName: "_steps", predicate: MatStep, descendants: true }, { propertyName: "_icons", predicate: MatStepperIcon, descendants: true }], viewQueries: [{ propertyName: "_stepHeader", predicate: MatStepHeader, descendants: true }, { propertyName: "_animatedContainers", predicate: ["animatedContainer"], descendants: true }], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"], usesInheritance: true, ngImport: i0, template: "<!--\n We need to project the content somewhere to avoid hydration errors. Some observations:\n 1. This is only necessary on the server.\n 2. We get a hydration error if there aren't any nodes after the `ng-content`.\n 3. We get a hydration error if `ng-content` is wrapped in another element.\n-->\n@if (_isServer) {\n <ng-content/>\n}\n\n@switch (orientation) {\n @case ('horizontal') {\n <div class=\"mat-horizontal-stepper-wrapper\">\n <div class=\"mat-horizontal-stepper-header-container\">\n @for (step of steps; track step) {\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate\"\n [ngTemplateOutletContext]=\"{step, i: $index}\"/>\n @if (!$last) {\n <div class=\"mat-stepper-horizontal-line\"></div>\n }\n }\n </div>\n\n <div class=\"mat-horizontal-content-container\">\n @for (step of steps; track step) {\n <div\n #animatedContainer\n class=\"mat-horizontal-stepper-content\"\n role=\"tabpanel\"\n [id]=\"_getStepContentId($index)\"\n [attr.aria-labelledby]=\"_getStepLabelId($index)\"\n [class]=\"'mat-horizontal-stepper-content-' + _getAnimationDirection($index)\"\n [attr.inert]=\"selectedIndex === $index ? null : ''\">\n <ng-container [ngTemplateOutlet]=\"step.content\"/>\n </div>\n }\n </div>\n </div>\n }\n\n @case ('vertical') {\n @for (step of steps; track step) {\n <div class=\"mat-step\">\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate\"\n [ngTemplateOutletContext]=\"{step, i: $index}\"/>\n <div\n #animatedContainer\n class=\"mat-vertical-content-container\"\n [class.mat-stepper-vertical-line]=\"!$last\"\n [class.mat-vertical-content-container-active]=\"selectedIndex === $index\"\n [attr.inert]=\"selectedIndex === $index ? null : ''\">\n <div class=\"mat-vertical-stepper-content\"\n role=\"tabpanel\"\n [id]=\"_getStepContentId($index)\"\n [attr.aria-labelledby]=\"_getStepLabelId($index)\">\n <div class=\"mat-vertical-content\">\n <ng-container [ngTemplateOutlet]=\"step.content\"/>\n </div>\n </div>\n </div>\n </div>\n }\n }\n}\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\"/>\n</ng-template>\n", styles: [".mat-stepper-vertical,.mat-stepper-horizontal{display:block;font-family:var(--mat-stepper-container-text-font, var(--mat-sys-body-medium-font));background:var(--mat-stepper-container-color, var(--mat-sys-surface))}.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-header-position-bottom .mat-horizontal-stepper-header-container{order:1}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px;border-top-color:var(--mat-stepper-line-color, var(--mat-sys-outline))}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative;top:calc(calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) + 12px)}.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;height:var(--mat-stepper-header-height, 72px)}.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-horizontal-stepper-header::before,.mat-horizontal-stepper-header::after{border-top-color:var(--mat-stepper-line-color, var(--mat-sys-outline))}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{padding:calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) 24px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::after{top:calc(calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) + 12px)}.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;padding:calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) 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-wrapper{display:flex;flex-direction:column}.mat-horizontal-stepper-content{visibility:hidden;overflow:hidden;outline:0;height:0}.mat-stepper-animations-enabled .mat-horizontal-stepper-content{transition:transform var(--mat-stepper-animation-duration, 0) cubic-bezier(0.35, 0, 0.25, 1)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-previous{transform:translate3d(-100%, 0, 0)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-next{transform:translate3d(100%, 0, 0)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-current{visibility:visible;transform:none;height:auto}.mat-stepper-horizontal:not(.mat-stepper-animating) .mat-horizontal-stepper-content.mat-horizontal-stepper-content-current{overflow:visible}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}@media(forced-colors: active){.mat-horizontal-content-container{outline:solid 1px}}.mat-stepper-header-position-bottom .mat-horizontal-content-container{padding:24px 24px 0 24px}.mat-vertical-content-container{display:grid;grid-template-rows:0fr;grid-template-columns:100%;margin-left:36px;border:0;position:relative}.mat-stepper-animations-enabled .mat-vertical-content-container{transition:grid-template-rows var(--mat-stepper-animation-duration, 0) cubic-bezier(0.4, 0, 0.2, 1)}.mat-vertical-content-container.mat-vertical-content-container-active{grid-template-rows:1fr}.mat-step:last-child .mat-vertical-content-container{border:none}@media(forced-colors: active){.mat-vertical-content-container{outline:solid 1px}}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}@supports not (grid-template-rows: 0fr){.mat-vertical-content-container{height:0}.mat-vertical-content-container.mat-vertical-content-container-active{height:auto}}.mat-stepper-vertical-line::before{content:\"\";position:absolute;left:0;border-left-width:1px;border-left-style:solid;border-left-color:var(--mat-stepper-line-color, var(--mat-sys-outline));top:calc(8px - calc((var(--mat-stepper-header-height, 72px) - 24px) / 2));bottom:calc(8px - calc((var(--mat-stepper-header-height, 72px) - 24px) / 2))}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0;visibility:hidden}.mat-stepper-animations-enabled .mat-vertical-stepper-content{transition:visibility var(--mat-stepper-animation-duration, 0) linear}.mat-vertical-content-container-active>.mat-vertical-stepper-content{visibility:visible}.mat-vertical-content{padding:0 24px 24px 24px}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: MatStepHeader, selector: "mat-step-header", inputs: ["state", "label", "errorMessage", "iconOverrides", "index", "selected", "active", "optional", "disableRipple", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  438. }
  439. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepper, decorators: [{
  440. type: Component,
  441. args: [{ selector: 'mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]', exportAs: 'matStepper, matVerticalStepper, matHorizontalStepper', host: {
  442. '[class.mat-stepper-horizontal]': 'orientation === "horizontal"',
  443. '[class.mat-stepper-vertical]': 'orientation === "vertical"',
  444. '[class.mat-stepper-label-position-end]': 'orientation === "horizontal" && labelPosition == "end"',
  445. '[class.mat-stepper-label-position-bottom]': 'orientation === "horizontal" && labelPosition == "bottom"',
  446. '[class.mat-stepper-header-position-bottom]': 'headerPosition === "bottom"',
  447. '[class.mat-stepper-animating]': '_isAnimating()',
  448. '[style.--mat-stepper-animation-duration]': '_getAnimationDuration()',
  449. '[attr.aria-orientation]': 'orientation',
  450. 'role': 'tablist',
  451. }, providers: [{ provide: CdkStepper, useExisting: MatStepper }], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, MatStepHeader], template: "<!--\n We need to project the content somewhere to avoid hydration errors. Some observations:\n 1. This is only necessary on the server.\n 2. We get a hydration error if there aren't any nodes after the `ng-content`.\n 3. We get a hydration error if `ng-content` is wrapped in another element.\n-->\n@if (_isServer) {\n <ng-content/>\n}\n\n@switch (orientation) {\n @case ('horizontal') {\n <div class=\"mat-horizontal-stepper-wrapper\">\n <div class=\"mat-horizontal-stepper-header-container\">\n @for (step of steps; track step) {\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate\"\n [ngTemplateOutletContext]=\"{step, i: $index}\"/>\n @if (!$last) {\n <div class=\"mat-stepper-horizontal-line\"></div>\n }\n }\n </div>\n\n <div class=\"mat-horizontal-content-container\">\n @for (step of steps; track step) {\n <div\n #animatedContainer\n class=\"mat-horizontal-stepper-content\"\n role=\"tabpanel\"\n [id]=\"_getStepContentId($index)\"\n [attr.aria-labelledby]=\"_getStepLabelId($index)\"\n [class]=\"'mat-horizontal-stepper-content-' + _getAnimationDirection($index)\"\n [attr.inert]=\"selectedIndex === $index ? null : ''\">\n <ng-container [ngTemplateOutlet]=\"step.content\"/>\n </div>\n }\n </div>\n </div>\n }\n\n @case ('vertical') {\n @for (step of steps; track step) {\n <div class=\"mat-step\">\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate\"\n [ngTemplateOutletContext]=\"{step, i: $index}\"/>\n <div\n #animatedContainer\n class=\"mat-vertical-content-container\"\n [class.mat-stepper-vertical-line]=\"!$last\"\n [class.mat-vertical-content-container-active]=\"selectedIndex === $index\"\n [attr.inert]=\"selectedIndex === $index ? null : ''\">\n <div class=\"mat-vertical-stepper-content\"\n role=\"tabpanel\"\n [id]=\"_getStepContentId($index)\"\n [attr.aria-labelledby]=\"_getStepLabelId($index)\">\n <div class=\"mat-vertical-content\">\n <ng-container [ngTemplateOutlet]=\"step.content\"/>\n </div>\n </div>\n </div>\n </div>\n }\n }\n}\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\"/>\n</ng-template>\n", styles: [".mat-stepper-vertical,.mat-stepper-horizontal{display:block;font-family:var(--mat-stepper-container-text-font, var(--mat-sys-body-medium-font));background:var(--mat-stepper-container-color, var(--mat-sys-surface))}.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-header-position-bottom .mat-horizontal-stepper-header-container{order:1}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px;border-top-color:var(--mat-stepper-line-color, var(--mat-sys-outline))}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative;top:calc(calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) + 12px)}.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;height:var(--mat-stepper-header-height, 72px)}.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-horizontal-stepper-header::before,.mat-horizontal-stepper-header::after{border-top-color:var(--mat-stepper-line-color, var(--mat-sys-outline))}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{padding:calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) 24px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::after{top:calc(calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) + 12px)}.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;padding:calc((var(--mat-stepper-header-height, 72px) - 24px) / 2) 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-wrapper{display:flex;flex-direction:column}.mat-horizontal-stepper-content{visibility:hidden;overflow:hidden;outline:0;height:0}.mat-stepper-animations-enabled .mat-horizontal-stepper-content{transition:transform var(--mat-stepper-animation-duration, 0) cubic-bezier(0.35, 0, 0.25, 1)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-previous{transform:translate3d(-100%, 0, 0)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-next{transform:translate3d(100%, 0, 0)}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-current{visibility:visible;transform:none;height:auto}.mat-stepper-horizontal:not(.mat-stepper-animating) .mat-horizontal-stepper-content.mat-horizontal-stepper-content-current{overflow:visible}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}@media(forced-colors: active){.mat-horizontal-content-container{outline:solid 1px}}.mat-stepper-header-position-bottom .mat-horizontal-content-container{padding:24px 24px 0 24px}.mat-vertical-content-container{display:grid;grid-template-rows:0fr;grid-template-columns:100%;margin-left:36px;border:0;position:relative}.mat-stepper-animations-enabled .mat-vertical-content-container{transition:grid-template-rows var(--mat-stepper-animation-duration, 0) cubic-bezier(0.4, 0, 0.2, 1)}.mat-vertical-content-container.mat-vertical-content-container-active{grid-template-rows:1fr}.mat-step:last-child .mat-vertical-content-container{border:none}@media(forced-colors: active){.mat-vertical-content-container{outline:solid 1px}}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}@supports not (grid-template-rows: 0fr){.mat-vertical-content-container{height:0}.mat-vertical-content-container.mat-vertical-content-container-active{height:auto}}.mat-stepper-vertical-line::before{content:\"\";position:absolute;left:0;border-left-width:1px;border-left-style:solid;border-left-color:var(--mat-stepper-line-color, var(--mat-sys-outline));top:calc(8px - calc((var(--mat-stepper-header-height, 72px) - 24px) / 2));bottom:calc(8px - calc((var(--mat-stepper-header-height, 72px) - 24px) / 2))}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0;visibility:hidden}.mat-stepper-animations-enabled .mat-vertical-stepper-content{transition:visibility var(--mat-stepper-animation-duration, 0) linear}.mat-vertical-content-container-active>.mat-vertical-stepper-content{visibility:visible}.mat-vertical-content{padding:0 24px 24px 24px}\n"] }]
  452. }], ctorParameters: () => [], propDecorators: { _stepHeader: [{
  453. type: ViewChildren,
  454. args: [MatStepHeader]
  455. }], _animatedContainers: [{
  456. type: ViewChildren,
  457. args: ['animatedContainer']
  458. }], _steps: [{
  459. type: ContentChildren,
  460. args: [MatStep, { descendants: true }]
  461. }], _icons: [{
  462. type: ContentChildren,
  463. args: [MatStepperIcon, { descendants: true }]
  464. }], animationDone: [{
  465. type: Output
  466. }], disableRipple: [{
  467. type: Input
  468. }], color: [{
  469. type: Input
  470. }], labelPosition: [{
  471. type: Input
  472. }], headerPosition: [{
  473. type: Input
  474. }], animationDuration: [{
  475. type: Input
  476. }] } });
  477. /** Button that moves to the next step in a stepper workflow. */
  478. class MatStepperNext extends CdkStepperNext {
  479. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperNext, deps: null, target: i0.ɵɵFactoryTarget.Directive });
  480. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: MatStepperNext, isStandalone: true, selector: "button[matStepperNext]", host: { properties: { "type": "type" }, classAttribute: "mat-stepper-next" }, usesInheritance: true, ngImport: i0 });
  481. }
  482. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperNext, decorators: [{
  483. type: Directive,
  484. args: [{
  485. selector: 'button[matStepperNext]',
  486. host: {
  487. 'class': 'mat-stepper-next',
  488. '[type]': 'type',
  489. },
  490. }]
  491. }] });
  492. /** Button that moves to the previous step in a stepper workflow. */
  493. class MatStepperPrevious extends CdkStepperPrevious {
  494. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperPrevious, deps: null, target: i0.ɵɵFactoryTarget.Directive });
  495. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: MatStepperPrevious, isStandalone: true, selector: "button[matStepperPrevious]", host: { properties: { "type": "type" }, classAttribute: "mat-stepper-previous" }, usesInheritance: true, ngImport: i0 });
  496. }
  497. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperPrevious, decorators: [{
  498. type: Directive,
  499. args: [{
  500. selector: 'button[matStepperPrevious]',
  501. host: {
  502. 'class': 'mat-stepper-previous',
  503. '[type]': 'type',
  504. },
  505. }]
  506. }] });
  507. class MatStepperModule {
  508. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
  509. static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.6", ngImport: i0, type: MatStepperModule, imports: [MatCommonModule,
  510. PortalModule,
  511. CdkStepperModule,
  512. MatIconModule,
  513. MatRippleModule,
  514. MatStep,
  515. MatStepLabel,
  516. MatStepper,
  517. MatStepperNext,
  518. MatStepperPrevious,
  519. MatStepHeader,
  520. MatStepperIcon,
  521. MatStepContent], exports: [MatCommonModule,
  522. MatStep,
  523. MatStepLabel,
  524. MatStepper,
  525. MatStepperNext,
  526. MatStepperPrevious,
  527. MatStepHeader,
  528. MatStepperIcon,
  529. MatStepContent] });
  530. static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperModule, providers: [MAT_STEPPER_INTL_PROVIDER, ErrorStateMatcher], imports: [MatCommonModule,
  531. PortalModule,
  532. CdkStepperModule,
  533. MatIconModule,
  534. MatRippleModule,
  535. MatStepper,
  536. MatStepHeader, MatCommonModule] });
  537. }
  538. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatStepperModule, decorators: [{
  539. type: NgModule,
  540. args: [{
  541. imports: [
  542. MatCommonModule,
  543. PortalModule,
  544. CdkStepperModule,
  545. MatIconModule,
  546. MatRippleModule,
  547. MatStep,
  548. MatStepLabel,
  549. MatStepper,
  550. MatStepperNext,
  551. MatStepperPrevious,
  552. MatStepHeader,
  553. MatStepperIcon,
  554. MatStepContent,
  555. ],
  556. exports: [
  557. MatCommonModule,
  558. MatStep,
  559. MatStepLabel,
  560. MatStepper,
  561. MatStepperNext,
  562. MatStepperPrevious,
  563. MatStepHeader,
  564. MatStepperIcon,
  565. MatStepContent,
  566. ],
  567. providers: [MAT_STEPPER_INTL_PROVIDER, ErrorStateMatcher],
  568. }]
  569. }] });
  570. /**
  571. * Animations used by the Material steppers.
  572. * @docs-private
  573. * @deprecated No longer used, will be removed.
  574. * @breaking-change 21.0.0
  575. */
  576. const matStepperAnimations = {
  577. // Represents:
  578. // trigger('horizontalStepTransition', [
  579. // state('previous', style({transform: 'translate3d(-100%, 0, 0)', visibility: 'hidden'})),
  580. // // Transition to `inherit`, rather than `visible`,
  581. // // because visibility on a child element the one from the parent,
  582. // // making this element focusable inside of a `hidden` element.
  583. // state('current', style({transform: 'none', visibility: 'inherit'})),
  584. // state('next', style({transform: 'translate3d(100%, 0, 0)', visibility: 'hidden'})),
  585. // transition(
  586. // '* => *',
  587. // group([
  588. // animate('{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)'),
  589. // query('@*', animateChild(), {optional: true}),
  590. // ]),
  591. // {
  592. // params: {animationDuration: '500ms'},
  593. // },
  594. // ),
  595. // ])
  596. /** Animation that transitions the step along the X axis in a horizontal stepper. */
  597. horizontalStepTransition: {
  598. type: 7,
  599. name: 'horizontalStepTransition',
  600. definitions: [
  601. {
  602. type: 0,
  603. name: 'previous',
  604. styles: {
  605. type: 6,
  606. styles: { transform: 'translate3d(-100%, 0, 0)', visibility: 'hidden' },
  607. offset: null,
  608. },
  609. },
  610. {
  611. type: 0,
  612. name: 'current',
  613. styles: {
  614. type: 6,
  615. styles: { transform: 'none', visibility: 'inherit' },
  616. offset: null,
  617. },
  618. },
  619. {
  620. type: 0,
  621. name: 'next',
  622. styles: {
  623. type: 6,
  624. styles: { transform: 'translate3d(100%, 0, 0)', visibility: 'hidden' },
  625. offset: null,
  626. },
  627. },
  628. {
  629. type: 1,
  630. expr: '* => *',
  631. animation: {
  632. type: 3,
  633. steps: [
  634. {
  635. type: 4,
  636. styles: null,
  637. timings: '{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)',
  638. },
  639. {
  640. type: 11,
  641. selector: '@*',
  642. animation: { type: 9, options: null },
  643. options: { optional: true },
  644. },
  645. ],
  646. options: null,
  647. },
  648. options: { params: { animationDuration: '500ms' } },
  649. },
  650. ],
  651. options: {},
  652. },
  653. // Represents:
  654. // trigger('verticalStepTransition', [
  655. // state('previous', style({height: '0px', visibility: 'hidden'})),
  656. // state('next', style({height: '0px', visibility: 'hidden'})),
  657. // // Transition to `inherit`, rather than `visible`,
  658. // // because visibility on a child element the one from the parent,
  659. // // making this element focusable inside of a `hidden` element.
  660. // state('current', style({height: '*', visibility: 'inherit'})),
  661. // transition(
  662. // '* <=> current',
  663. // group([
  664. // animate('{{animationDuration}} cubic-bezier(0.4, 0.0, 0.2, 1)'),
  665. // query('@*', animateChild(), {optional: true}),
  666. // ]),
  667. // {
  668. // params: {animationDuration: '225ms'},
  669. // },
  670. // ),
  671. // ])
  672. /** Animation that transitions the step along the Y axis in a vertical stepper. */
  673. verticalStepTransition: {
  674. type: 7,
  675. name: 'verticalStepTransition',
  676. definitions: [
  677. {
  678. type: 0,
  679. name: 'previous',
  680. styles: { type: 6, styles: { 'height': '0px', visibility: 'hidden' }, offset: null },
  681. },
  682. {
  683. type: 0,
  684. name: 'next',
  685. styles: { type: 6, styles: { 'height': '0px', visibility: 'hidden' }, offset: null },
  686. },
  687. {
  688. type: 0,
  689. name: 'current',
  690. styles: { type: 6, styles: { 'height': '*', visibility: 'inherit' }, offset: null },
  691. },
  692. {
  693. type: 1,
  694. expr: '* <=> current',
  695. animation: {
  696. type: 3,
  697. steps: [
  698. {
  699. type: 4,
  700. styles: null,
  701. timings: '{{animationDuration}} cubic-bezier(0.4, 0.0, 0.2, 1)',
  702. },
  703. {
  704. type: 11,
  705. selector: '@*',
  706. animation: { type: 9, options: null },
  707. options: { optional: true },
  708. },
  709. ],
  710. options: null,
  711. },
  712. options: { params: { animationDuration: '225ms' } },
  713. },
  714. ],
  715. options: {},
  716. },
  717. };
  718. export { MAT_STEPPER_INTL_PROVIDER, MAT_STEPPER_INTL_PROVIDER_FACTORY, MatStep, MatStepContent, MatStepHeader, MatStepLabel, MatStepper, MatStepperIcon, MatStepperIntl, MatStepperModule, MatStepperNext, MatStepperPrevious, matStepperAnimations };
  719. //# sourceMappingURL=stepper.mjs.map