@porscheinformatik/material-addons 10.2.0 → 10.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/bundles/porscheinformatik-material-addons.umd.js +343 -30
  2. package/bundles/porscheinformatik-material-addons.umd.js.map +1 -1
  3. package/bundles/porscheinformatik-material-addons.umd.min.js +2 -2
  4. package/bundles/porscheinformatik-material-addons.umd.min.js.map +1 -1
  5. package/esm2015/lib/material-addons.module.js +3 -3
  6. package/esm2015/lib/numeric-field/numeric-field.directive.js +4 -2
  7. package/esm2015/lib/quick-list/base-quick-list.component.js +89 -0
  8. package/esm2015/lib/quick-list/quick-list-compact/quick-list-compact.component.js +18 -0
  9. package/esm2015/lib/quick-list/quick-list.component.js +6 -77
  10. package/esm2015/lib/quick-list/quick-list.module.js +6 -4
  11. package/esm2015/lib/stepper/mad-stepper-animation.js +13 -0
  12. package/esm2015/lib/stepper/step-header/step-header.component.js +75 -0
  13. package/esm2015/lib/stepper/stepper.component.js +167 -0
  14. package/esm2015/lib/stepper/stepper.module.js +18 -0
  15. package/esm2015/porscheinformatik-material-addons.js +4 -2
  16. package/esm2015/public-api.js +5 -1
  17. package/fesm2015/porscheinformatik-material-addons.js +311 -20
  18. package/fesm2015/porscheinformatik-material-addons.js.map +1 -1
  19. package/lib/quick-list/base-quick-list.component.d.ts +29 -0
  20. package/lib/quick-list/quick-list-compact/quick-list-compact.component.d.ts +6 -0
  21. package/lib/quick-list/quick-list.component.d.ts +4 -27
  22. package/lib/stepper/mad-stepper-animation.d.ts +7 -0
  23. package/lib/stepper/step-header/step-header.component.d.ts +23 -0
  24. package/lib/stepper/stepper.component.d.ts +47 -0
  25. package/lib/stepper/stepper.module.d.ts +2 -0
  26. package/package.json +1 -1
  27. package/porscheinformatik-material-addons.d.ts +3 -1
  28. package/porscheinformatik-material-addons.metadata.json +1 -1
  29. package/public-api.d.ts +4 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/router'), require('@angular/material/button'), require('@angular/material/icon'), require('@angular/material/tooltip'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/forms'), require('@angular/platform-browser'), require('@ngx-translate/core'), require('rxjs'), require('@angular/cdk/layout'), require('rxjs/operators'), require('@angular/material/menu'), require('@angular/material/toolbar'), require('@angular/material/badge'), require('@angular/material/card'), require('@angular/animations'), require('@angular/material/table'), require('@angular/material/sort'), require('@angular/material/paginator')) :
3
- typeof define === 'function' && define.amd ? define('@porscheinformatik/material-addons', ['exports', '@angular/core', '@angular/common', '@angular/router', '@angular/material/button', '@angular/material/icon', '@angular/material/tooltip', '@angular/material/form-field', '@angular/material/input', '@angular/forms', '@angular/platform-browser', '@ngx-translate/core', 'rxjs', '@angular/cdk/layout', 'rxjs/operators', '@angular/material/menu', '@angular/material/toolbar', '@angular/material/badge', '@angular/material/card', '@angular/animations', '@angular/material/table', '@angular/material/sort', '@angular/material/paginator'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.porscheinformatik = global.porscheinformatik || {}, global.porscheinformatik['material-addons'] = {}), global.ng.core, global.ng.common, global.ng.router, global.ng.material.button, global.ng.material.icon, global.ng.material.tooltip, global.ng.material.formField, global.ng.material.input, global.ng.forms, global.ng.platformBrowser, global.i2, global.rxjs, global.ng.cdk.layout, global.rxjs.operators, global.ng.material.menu, global.ng.material.toolbar, global.ng.material.badge, global.ng.material.card, global.ng.animations, global.ng.material.table, global.ng.material.sort, global.ng.material.paginator));
5
- }(this, (function (exports, i0, common, i1, button, icon, tooltip, formField, input, forms, platformBrowser, i2, rxjs, layout, operators, menu, toolbar, badge, card, animations, table, sort, paginator) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/router'), require('@angular/material/button'), require('@angular/material/icon'), require('@angular/material/tooltip'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/forms'), require('@angular/platform-browser'), require('@ngx-translate/core'), require('rxjs'), require('@angular/cdk/layout'), require('rxjs/operators'), require('@angular/material/menu'), require('@angular/material/toolbar'), require('@angular/material/badge'), require('@angular/material/card'), require('@angular/animations'), require('@angular/material/table'), require('@angular/material/sort'), require('@angular/material/paginator'), require('@angular/cdk/bidi'), require('@angular/cdk/stepper'), require('@angular/cdk/a11y'), require('@angular/flex-layout')) :
3
+ typeof define === 'function' && define.amd ? define('@porscheinformatik/material-addons', ['exports', '@angular/core', '@angular/common', '@angular/router', '@angular/material/button', '@angular/material/icon', '@angular/material/tooltip', '@angular/material/form-field', '@angular/material/input', '@angular/forms', '@angular/platform-browser', '@ngx-translate/core', 'rxjs', '@angular/cdk/layout', 'rxjs/operators', '@angular/material/menu', '@angular/material/toolbar', '@angular/material/badge', '@angular/material/card', '@angular/animations', '@angular/material/table', '@angular/material/sort', '@angular/material/paginator', '@angular/cdk/bidi', '@angular/cdk/stepper', '@angular/cdk/a11y', '@angular/flex-layout'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.porscheinformatik = global.porscheinformatik || {}, global.porscheinformatik['material-addons'] = {}), global.ng.core, global.ng.common, global.ng.router, global.ng.material.button, global.ng.material.icon, global.ng.material.tooltip, global.ng.material.formField, global.ng.material.input, global.ng.forms, global.ng.platformBrowser, global.i2, global.rxjs, global.ng.cdk.layout, global.rxjs.operators, global.ng.material.menu, global.ng.material.toolbar, global.ng.material.badge, global.ng.material.card, global.ng.animations, global.ng.material.table, global.ng.material.sort, global.ng.material.paginator, global.ng.cdk.bidi, global.ng.cdk.stepper, global.ng.cdk.a11y, global.ng.flexLayout));
5
+ }(this, (function (exports, i0, common, i1, button, icon, tooltip, formField, input, forms, platformBrowser, i2, rxjs, layout, operators, menu, toolbar, badge, card, animations, table, sort, paginator, bidi, stepper, a11y, flexLayout) { 'use strict';
6
6
 
7
7
  var MaterialActionButtonComponent = /** @class */ (function () {
8
8
  function MaterialActionButtonComponent() {
@@ -1222,7 +1222,9 @@
1222
1222
  set: function (value) {
1223
1223
  if (this._numericValue !== value && !(isNaN(this._numericValue) && (isNaN(value) || value === null))) {
1224
1224
  this.originalValue = value;
1225
- this._numericValue = this.roundOrTruncate(value);
1225
+ // Don't roundOrTruncate if value was set to empty otherwise input value will be set to 0 instead of empty
1226
+ // which happens when an input is being reset
1227
+ this._numericValue = value === null || value === undefined ? value : this.roundOrTruncate(value); // eslint-disable-line
1226
1228
  this.handleInputChanged();
1227
1229
  }
1228
1230
  },
@@ -1621,9 +1623,8 @@
1621
1623
  },] }
1622
1624
  ];
1623
1625
 
1624
- // Based on https://github.com/porscheinformatik/clarity-addons/blob/master/src/clr-addons/generic-quick-list/generic-quick-list.ts
1625
- var QuickListComponent = /** @class */ (function () {
1626
- function QuickListComponent(changeDetectorRef) {
1626
+ var BaseQuickListComponent = /** @class */ (function () {
1627
+ function BaseQuickListComponent(changeDetectorRef) {
1627
1628
  this.changeDetectorRef = changeDetectorRef;
1628
1629
  this.allItems = [];
1629
1630
  this.addLabel = 'NOT SET';
@@ -1632,31 +1633,31 @@
1632
1633
  this.added = new i0.EventEmitter();
1633
1634
  this.removed = new i0.EventEmitter();
1634
1635
  }
1635
- QuickListComponent.prototype.ngOnInit = function () {
1636
+ BaseQuickListComponent.prototype.ngOnInit = function () {
1636
1637
  this.addEventFunction = this.addItem.bind(this);
1637
- if (typeof this.minItems !== 'undefined') {
1638
+ if (this.minItems) {
1638
1639
  for (var n = this.allItems.length; n < this.minItems; n++) {
1639
1640
  this.interalAddItem();
1640
1641
  }
1641
1642
  }
1642
1643
  };
1643
- QuickListComponent.prototype.ngAfterViewInit = function () {
1644
+ BaseQuickListComponent.prototype.ngAfterViewInit = function () {
1644
1645
  var _this = this;
1645
1646
  setTimeout(function () { return _this.setFocusOnAdd(); }, 1);
1646
1647
  };
1647
- QuickListComponent.prototype.addItem = function () {
1648
+ BaseQuickListComponent.prototype.addItem = function () {
1648
1649
  var newItem = this.interalAddItem();
1649
1650
  if (!!newItem) {
1650
1651
  this.added.emit(newItem);
1651
1652
  }
1652
1653
  };
1653
- QuickListComponent.prototype.removeItem = function (item) {
1654
+ BaseQuickListComponent.prototype.removeItem = function (item) {
1654
1655
  if (this.isDeleteAllowed()) {
1655
1656
  this.allItems.splice(this.allItems.indexOf(item), 1);
1656
1657
  this.removed.emit(item);
1657
1658
  }
1658
1659
  };
1659
- QuickListComponent.prototype.setFocusOnAdd = function () {
1660
+ BaseQuickListComponent.prototype.setFocusOnAdd = function () {
1660
1661
  var _this = this;
1661
1662
  this.rowCountFocus = this.itemRows.length;
1662
1663
  this.itemRows.changes.subscribe(function (els) {
@@ -1669,13 +1670,13 @@
1669
1670
  _this.rowCountFocus = els.length;
1670
1671
  });
1671
1672
  };
1672
- QuickListComponent.prototype.isAddAllowed = function () {
1673
- return typeof this.maxItems === 'undefined' || this.allItems.length < this.maxItems;
1673
+ BaseQuickListComponent.prototype.isAddAllowed = function () {
1674
+ return this.addPossible && (!this.maxItems || this.allItems.length < this.maxItems);
1674
1675
  };
1675
- QuickListComponent.prototype.isDeleteAllowed = function () {
1676
- return typeof this.minItems === 'undefined' || this.allItems.length > this.minItems;
1676
+ BaseQuickListComponent.prototype.isDeleteAllowed = function () {
1677
+ return !this.minItems || this.allItems.length > this.minItems;
1677
1678
  };
1678
- QuickListComponent.prototype.interalAddItem = function () {
1679
+ BaseQuickListComponent.prototype.interalAddItem = function () {
1679
1680
  if (this.isAddAllowed()) {
1680
1681
  var newItem = Object.assign({}, this.blankItem);
1681
1682
  // creates ids in the form of "n5kdz1pljl8"
@@ -1688,18 +1689,18 @@
1688
1689
  }
1689
1690
  return null;
1690
1691
  };
1691
- return QuickListComponent;
1692
+ return BaseQuickListComponent;
1692
1693
  }());
1693
- QuickListComponent.decorators = [
1694
+ BaseQuickListComponent.decorators = [
1694
1695
  { type: i0.Component, args: [{
1695
- selector: 'mad-quick-list',
1696
- template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n<ng-container *ngFor=\"let item of allItems\">\n <div *ngIf=\"itemTemplate\" #row>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n <mad-icon-button *ngIf=\"!(readonly || readonly === '')\" [disabled]=\"!isDeleteAllowed()\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n </div>\n</ng-container>\n<mad-link-button *ngIf=\"!(readonly || readonly === '')\" (click)=\"addItem()\"\n [disabled]=\"!addPossible || !isAddAllowed()\">\n {{ addLabel }}\n</mad-link-button>\n"
1696
+ selector: 'mad-base-quick-list',
1697
+ template: ''
1697
1698
  },] }
1698
1699
  ];
1699
- QuickListComponent.ctorParameters = function () { return [
1700
+ BaseQuickListComponent.ctorParameters = function () { return [
1700
1701
  { type: i0.ChangeDetectorRef }
1701
1702
  ]; };
1702
- QuickListComponent.propDecorators = {
1703
+ BaseQuickListComponent.propDecorators = {
1703
1704
  allItems: [{ type: i0.Input }],
1704
1705
  addLabel: [{ type: i0.Input }],
1705
1706
  addPossible: [{ type: i0.Input }],
@@ -1713,6 +1714,44 @@
1713
1714
  itemRows: [{ type: i0.ViewChildren, args: ['row',] }]
1714
1715
  };
1715
1716
 
1717
+ var QuickListComponent = /** @class */ (function (_super) {
1718
+ __extends(QuickListComponent, _super);
1719
+ function QuickListComponent(changeDetectorRef) {
1720
+ var _this = _super.call(this, changeDetectorRef) || this;
1721
+ _this.changeDetectorRef = changeDetectorRef;
1722
+ return _this;
1723
+ }
1724
+ return QuickListComponent;
1725
+ }(BaseQuickListComponent));
1726
+ QuickListComponent.decorators = [
1727
+ { type: i0.Component, args: [{
1728
+ selector: 'mad-quick-list',
1729
+ template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n<ng-container *ngFor=\"let item of allItems\">\n <div *ngIf=\"itemTemplate\" #row>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n <mad-icon-button *ngIf=\"!readonly && isDeleteAllowed()\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n </div>\n</ng-container>\n<mad-link-button *ngIf=\"!readonly\" (click)=\"addItem()\"\n [disabled]=\"!addPossible || !isAddAllowed()\">\n {{ addLabel }}\n</mad-link-button>\n"
1730
+ },] }
1731
+ ];
1732
+ QuickListComponent.ctorParameters = function () { return [
1733
+ { type: i0.ChangeDetectorRef }
1734
+ ]; };
1735
+
1736
+ var QuickListCompactComponent = /** @class */ (function (_super) {
1737
+ __extends(QuickListCompactComponent, _super);
1738
+ function QuickListCompactComponent(changeDetectorRef) {
1739
+ var _this = _super.call(this, changeDetectorRef) || this;
1740
+ _this.changeDetectorRef = changeDetectorRef;
1741
+ return _this;
1742
+ }
1743
+ return QuickListCompactComponent;
1744
+ }(BaseQuickListComponent));
1745
+ QuickListCompactComponent.decorators = [
1746
+ { type: i0.Component, args: [{
1747
+ selector: 'mad-quick-list-compact',
1748
+ template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n<ng-container *ngFor=\"let item of allItems; let isLast = last;\">\n <div class=\"flex-container\" *ngIf=\"itemTemplate\" #row>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n <mad-icon-button *ngIf=\"!readonly && isDeleteAllowed()\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n <mad-icon-button *ngIf=\"!readonly && isLast\" [disabled]=\"!isAddAllowed()\" (click)=\"addItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n </div>\n</ng-container>\n<mad-link-button *ngIf=\"!readonly && !this.allItems.length\"\n (click)=\"addItem()\"\n [disabled]=\"!isAddAllowed()\">\n {{ addLabel }}\n</mad-link-button>\n"
1749
+ },] }
1750
+ ];
1751
+ QuickListCompactComponent.ctorParameters = function () { return [
1752
+ { type: i0.ChangeDetectorRef }
1753
+ ]; };
1754
+
1716
1755
  var QuickListModule = /** @class */ (function () {
1717
1756
  function QuickListModule() {
1718
1757
  }
@@ -1720,9 +1759,9 @@
1720
1759
  }());
1721
1760
  QuickListModule.decorators = [
1722
1761
  { type: i0.NgModule, args: [{
1723
- declarations: [QuickListComponent],
1762
+ declarations: [QuickListComponent, BaseQuickListComponent, QuickListCompactComponent],
1724
1763
  imports: [common.CommonModule, button.MatButtonModule, icon.MatIconModule, ButtonModule],
1725
- exports: [QuickListComponent],
1764
+ exports: [QuickListComponent, QuickListCompactComponent, BaseQuickListComponent],
1726
1765
  },] }
1727
1766
  ];
1728
1767
 
@@ -1866,6 +1905,273 @@
1866
1905
  },] }
1867
1906
  ];
1868
1907
 
1908
+ var StepHeaderComponent = /** @class */ (function (_super) {
1909
+ __extends(StepHeaderComponent, _super);
1910
+ function StepHeaderComponent(_focusMonitor, _elementRef) {
1911
+ var _this = _super.call(this, _elementRef) || this;
1912
+ _this._focusMonitor = _focusMonitor;
1913
+ return _this;
1914
+ }
1915
+ StepHeaderComponent.prototype.ngAfterViewInit = function () {
1916
+ this._focusMonitor.monitor(this._elementRef, true);
1917
+ };
1918
+ StepHeaderComponent.prototype.ngOnDestroy = function () {
1919
+ this._focusMonitor.stopMonitoring(this._elementRef);
1920
+ };
1921
+ /** Focuses the step header. */
1922
+ StepHeaderComponent.prototype.focus = function (origin, options) {
1923
+ if (origin) {
1924
+ this._focusMonitor.focusVia(this._elementRef, origin, options);
1925
+ }
1926
+ else {
1927
+ this._elementRef.nativeElement.focus(options);
1928
+ }
1929
+ };
1930
+ StepHeaderComponent.prototype.getCssForState = function () {
1931
+ if (this.state === stepper.STEP_STATE.NUMBER && !this.completed && !this.hasError) {
1932
+ return 'step-state-neutral'; //initiale state is 'number'
1933
+ }
1934
+ else if (this.completed) {
1935
+ return 'step-state-complete';
1936
+ }
1937
+ else if (this.hasError) {
1938
+ return 'step-state-error';
1939
+ }
1940
+ };
1941
+ StepHeaderComponent.prototype.getIcon = function () {
1942
+ if (this.completed) {
1943
+ return 'check_circle_outline';
1944
+ }
1945
+ else if (this.hasError) {
1946
+ return 'error_outline';
1947
+ }
1948
+ return '';
1949
+ };
1950
+ return StepHeaderComponent;
1951
+ }(stepper.CdkStepHeader));
1952
+ StepHeaderComponent.decorators = [
1953
+ { type: i0.Component, args: [{
1954
+ selector: 'mad-step-header',
1955
+ template: "<div class=\"header\" fxLayout=\"row\" fxLayoutGap=\"1em\"\n [style.background]=\"this.selected && !this.closed ? '#d8e2e9' : '#ffffff'\"\n [style.border-color]=\"this.hasError ? '#f44336' : '#d3d3d3'\">\n <div [ngClass]=\"this.getCssForState()\"></div>\n <div class=\"header-label\">\n <mat-icon class=\"material-icons-outlined\">\n {{this.selected && !this.closed ? 'keyboard_arrow_down' : 'keyboard_arrow_right'}}\n </mat-icon>\n </div>\n <div *ngIf=\"this.completed || this.hasError\" class=\"header-label\">\n <mat-icon [ngClass]=\"this.completed ? 'green-check' : 'red-error'\">\n {{getIcon()}}\n </mat-icon>\n </div>\n <span *ngIf=\"!this.hasError && !this.completed\" class=\"header-label\">{{(this.index + 1) + '.'}}</span>\n <div class=\"header-label\"> {{this.label}}</div>\n</div>\n",
1956
+ inputs: ['color'],
1957
+ host: {
1958
+ 'class': 'mad-step-header',
1959
+ 'role': 'tab',
1960
+ },
1961
+ encapsulation: i0.ViewEncapsulation.None,
1962
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1963
+ styles: [".header{-webkit-tap-highlight-color:transparent;border:1px solid #d3d3d3;box-sizing:content-box;cursor:pointer;height:62px;outline:#f44336;overflow:hidden;width:100%}.header-label{align-items:center;display:flex}.step-state-complete{background:green;width:5px}.step-state-error{background:#f44336;width:5px}.step-state-neutral{background:#d3d3d3;width:5px}.green-check{color:green}.red-error{color:#f44336}"]
1964
+ },] }
1965
+ ];
1966
+ StepHeaderComponent.ctorParameters = function () { return [
1967
+ { type: a11y.FocusMonitor },
1968
+ { type: i0.ElementRef }
1969
+ ]; };
1970
+ StepHeaderComponent.propDecorators = {
1971
+ index: [{ type: i0.Input }],
1972
+ label: [{ type: i0.Input }],
1973
+ state: [{ type: i0.Input }],
1974
+ errorMessage: [{ type: i0.Input }],
1975
+ selected: [{ type: i0.Input }],
1976
+ active: [{ type: i0.Input }],
1977
+ optional: [{ type: i0.Input }],
1978
+ hasError: [{ type: i0.Input }],
1979
+ completed: [{ type: i0.Input }],
1980
+ closed: [{ type: i0.Input }]
1981
+ };
1982
+
1983
+ /**
1984
+ * Animations used by the MAD stepper.
1985
+ */
1986
+ var madStepperAnimations = {
1987
+ verticalStepTransition: animations.trigger('stepTransition', [
1988
+ animations.state('previous', animations.style({ height: '0px', visibility: 'hidden' })),
1989
+ animations.state('next', animations.style({ height: '0px', visibility: 'hidden' })),
1990
+ animations.state('current', animations.style({ height: '*', visibility: 'visible' })),
1991
+ animations.transition('* <=> current', animations.animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
1992
+ ]),
1993
+ };
1994
+
1995
+ var StepComponent = /** @class */ (function (_super) {
1996
+ __extends(StepComponent, _super);
1997
+ function StepComponent(stepper, _viewContainerRef) {
1998
+ var _this = _super.call(this, stepper) || this;
1999
+ _this.stepper = stepper;
2000
+ _this._viewContainerRef = _viewContainerRef;
2001
+ /** Action event for the next button. If not set the StepComponent will handle the step navigation */
2002
+ _this.onNext = new i0.EventEmitter();
2003
+ /** Action event for the done button. If not set the StepComponent will handle the step navigation */
2004
+ _this.onDone = new i0.EventEmitter();
2005
+ /*** Action event when the header is clicked. If not set the StepComponent will handle the step navigation*/
2006
+ _this.onHeaderClick = new i0.EventEmitter();
2007
+ _this.stepClosed = false;
2008
+ _this._isSelected = rxjs.Subscription.EMPTY;
2009
+ return _this;
2010
+ }
2011
+ StepComponent.prototype.ngAfterContentInit = function () {
2012
+ var _this = this;
2013
+ this._isSelected = this._stepper.steps.changes
2014
+ .pipe(operators.switchMap(function () { return _this._stepper.selectionChange.pipe(operators.map(function (event) { return event.selectedStep === _this; }), operators.tap(function () { return (_this.stepClosed = false); }), operators.startWith(_this._stepper.selected === _this)); }))
2015
+ .subscribe();
2016
+ };
2017
+ StepComponent.prototype.ngOnDestroy = function () {
2018
+ this._isSelected.unsubscribe();
2019
+ };
2020
+ StepComponent.prototype.next = function () {
2021
+ this.stepValidation();
2022
+ if (this.onNext.observers.length <= 0) {
2023
+ this.stepper.next();
2024
+ }
2025
+ this.onNext.emit();
2026
+ };
2027
+ StepComponent.prototype.selectAndMarkAsTouched = function (index) {
2028
+ var _a, _b;
2029
+ //Mark current selected step as touched before selecting to display errors in the from
2030
+ (_b = (_a = this._stepper.selected) === null || _a === void 0 ? void 0 : _a.stepControl) === null || _b === void 0 ? void 0 : _b.markAllAsTouched();
2031
+ this.stepClosed = false;
2032
+ if (this.onHeaderClick.observers.length <= 0) {
2033
+ this.select();
2034
+ }
2035
+ this.onHeaderClick.emit(index);
2036
+ };
2037
+ StepComponent.prototype.completeLast = function () {
2038
+ this.stepValidation();
2039
+ this.stepClosed = true;
2040
+ if (this.onDone.observers.length <= 0) {
2041
+ this.stepper.next();
2042
+ }
2043
+ this.onDone.emit();
2044
+ };
2045
+ StepComponent.prototype.resetValidations = function () {
2046
+ this.hasError = false;
2047
+ this.completed = true;
2048
+ this.state = stepper.STEP_STATE.DONE;
2049
+ };
2050
+ StepComponent.prototype.stepValidation = function () {
2051
+ var _a, _b;
2052
+ (_a = this.stepControl) === null || _a === void 0 ? void 0 : _a.markAllAsTouched();
2053
+ if ((_b = this.stepControl) === null || _b === void 0 ? void 0 : _b.valid) {
2054
+ this.hasError = false;
2055
+ this.completed = true;
2056
+ this.state = stepper.STEP_STATE.DONE;
2057
+ }
2058
+ else {
2059
+ this.completed = false;
2060
+ this.hasError = true;
2061
+ this.state = stepper.STEP_STATE.ERROR;
2062
+ }
2063
+ };
2064
+ return StepComponent;
2065
+ }(stepper.CdkStep));
2066
+ StepComponent.decorators = [
2067
+ { type: i0.Component, args: [{
2068
+ selector: 'mad-step',
2069
+ template: "<ng-template let-last=\"last\" let-nextBtnLbl=\"nextBtnLbl\" let-doneBtnLbl=\"doneBtnLbl\">\n <div class=\"step-container\" fxLayout=\"column\">\n <div class=\"step-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"step-buttons\">\n <div *ngIf=\"!last\">\n <button mat-stroked-button color=\"primary\" (click)=\"next()\">{{nextBtnLbl}}</button>\n </div>\n <div *ngIf=\"last\">\n <button mat-stroked-button color=\"primary\" (click)=\"completeLast()\">{{doneBtnLbl}}</button>\n </div>\n </div>\n </div>\n</ng-template>\n",
2070
+ providers: [{ provide: stepper.CdkStep, useExisting: StepComponent }],
2071
+ encapsulation: i0.ViewEncapsulation.None,
2072
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
2073
+ styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{align-items:center;border:none!important;display:flex;height:10px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}.vertical-content-container{border:none}[dir=rtl] .vertical-content-container{margin-left:0;margin-right:36px}.vertical-stepper-content{outline:0;overflow:hidden}.vertical-content{padding:0 24px}.step-container{border-bottom:1px solid #d3d3d3;border-left:1px solid #d3d3d3;border-right:1px solid #d3d3d3}.step-buttons,.step-content{padding:2em}"]
2074
+ },] }
2075
+ ];
2076
+ StepComponent.ctorParameters = function () { return [
2077
+ { type: StepperComponent, decorators: [{ type: i0.Inject, args: [i0.forwardRef(function () { return StepperComponent; }),] }] },
2078
+ { type: i0.ViewContainerRef }
2079
+ ]; };
2080
+ StepComponent.propDecorators = {
2081
+ onNext: [{ type: i0.Output }],
2082
+ onDone: [{ type: i0.Output }],
2083
+ onHeaderClick: [{ type: i0.Output }]
2084
+ };
2085
+ var StepperComponent = /** @class */ (function (_super) {
2086
+ __extends(StepperComponent, _super);
2087
+ function StepperComponent(dir, changeDetectorRef, elementRef, _document) {
2088
+ var _this = _super.call(this, dir, changeDetectorRef, elementRef, _document) || this;
2089
+ /** Event emitted when the current step is done transitioning in. */
2090
+ _this.animationDone = new i0.EventEmitter();
2091
+ /** Steps that belong to the current stepper, excluding ones from nested steppers. */
2092
+ _this.steps = new i0.QueryList();
2093
+ _this._animationDone = new rxjs.Subject();
2094
+ _this._orientation = 'vertical';
2095
+ return _this;
2096
+ }
2097
+ StepperComponent.prototype.ngOnInit = function () {
2098
+ // Only linear stepper implementation is supported
2099
+ _super.prototype.linear = true;
2100
+ };
2101
+ StepperComponent.prototype.ngAfterContentInit = function () {
2102
+ var _this = this;
2103
+ _super.prototype.ngAfterContentInit.call(this);
2104
+ this.steps.changes.pipe(operators.takeUntil(this._destroyed)).subscribe(function () {
2105
+ _this._stateChanged();
2106
+ });
2107
+ this._animationDone
2108
+ .pipe(operators.distinctUntilChanged(function (x, y) { return x.fromState === y.fromState && x.toState === y.toState; }), operators.takeUntil(this._destroyed))
2109
+ .subscribe(function (event) {
2110
+ if (event.toState === 'current') {
2111
+ _this.animationDone.emit();
2112
+ }
2113
+ });
2114
+ };
2115
+ /**
2116
+ * Method patched to enable the closing of the last step.
2117
+ */
2118
+ StepperComponent.prototype._getAnimationDirection = function (index) {
2119
+ var _a, _b;
2120
+ var closeLastStep = this.selectedIndex === this.steps.length - 1 && ((_a = this._steps.last) === null || _a === void 0 ? void 0 : _a.completed) && ((_b = this._steps.last) === null || _b === void 0 ? void 0 : _b.stepClosed);
2121
+ if (closeLastStep) {
2122
+ return 'next';
2123
+ }
2124
+ return _super.prototype._getAnimationDirection.call(this, index);
2125
+ };
2126
+ StepperComponent.prototype._stepIsNavigable = function (index, step) {
2127
+ return step.completed || this.selectedIndex === index || !this.linear;
2128
+ };
2129
+ return StepperComponent;
2130
+ }(stepper.CdkStepper));
2131
+ StepperComponent.decorators = [
2132
+ { type: i0.Component, args: [{
2133
+ selector: 'mad-stepper',
2134
+ template: "<!-- Vertical stepper -->\n<ng-container>\n <div *ngFor=\"let step of steps; let i = index; let isLast = last; let isFirst = first\">\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate\"\n [ngTemplateOutletContext]=\"{step: step, i: i}\"></ng-container>\n <div class=\"vertical-content-container\" [class.mat-stepper-vertical-line]=\"!isLast\">\n <div class=\"vertical-stepper-content\" role=\"tabpanel\"\n [@stepTransition]=\"_getAnimationDirection(i)\"\n (@stepTransition.done)=\"_animationDone.next($event)\"\n [id]=\"_getStepContentId(i)\"\n [attr.aria-labelledby]=\"_getStepLabelId(i)\"\n [attr.aria-expanded]=\"selectedIndex === i\">\n <div class=\"vertical-content\">\n <ng-container [ngTemplateOutlet]=\"step.content\"\n [ngTemplateOutletContext]=\"{step: step, i: i, last: isLast, first: isFirst, nextBtnLbl: this.nextButtonLabel, doneBtnLbl: this.doneButtonLabel}\"></ng-container>\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n\n<ng-template let-step=\"step\" let-i=\"i\" #stepTemplate>\n <mad-step-header\n class=\"mat-vertical-stepper-header\"\n (click)=\"step.selectAndMarkAsTouched(i)\"\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 [completed]=\"step.completed\"\n [hasError]=\"step.hasError\"\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 [closed]=\"step.stepClosed\"\n [errorMessage]=\"step.errorMessage\"></mad-step-header>\n</ng-template>\n",
2135
+ host: {
2136
+ '[class.stepper-vertical]': 'true',
2137
+ '[attr.aria-orientation]': '"vertical"',
2138
+ 'role': 'tablist',
2139
+ },
2140
+ animations: [madStepperAnimations.verticalStepTransition],
2141
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
2142
+ providers: [{ provide: stepper.CdkStepper, useExisting: StepperComponent }],
2143
+ encapsulation: i0.ViewEncapsulation.None,
2144
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
2145
+ styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{align-items:center;border:none!important;display:flex;height:10px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}.vertical-content-container{border:none}[dir=rtl] .vertical-content-container{margin-left:0;margin-right:36px}.vertical-stepper-content{outline:0;overflow:hidden}.vertical-content{padding:0 24px}.step-container{border-bottom:1px solid #d3d3d3;border-left:1px solid #d3d3d3;border-right:1px solid #d3d3d3}.step-buttons,.step-content{padding:2em}"]
2146
+ },] }
2147
+ ];
2148
+ StepperComponent.ctorParameters = function () { return [
2149
+ { type: bidi.Directionality, decorators: [{ type: i0.Optional }] },
2150
+ { type: i0.ChangeDetectorRef },
2151
+ { type: i0.ElementRef },
2152
+ { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }
2153
+ ]; };
2154
+ StepperComponent.propDecorators = {
2155
+ animationDone: [{ type: i0.Output }],
2156
+ nextButtonLabel: [{ type: i0.Input }],
2157
+ doneButtonLabel: [{ type: i0.Input }],
2158
+ _stepHeader: [{ type: i0.ViewChildren, args: [StepHeaderComponent,] }],
2159
+ _steps: [{ type: i0.ContentChildren, args: [StepComponent, { descendants: true },] }]
2160
+ };
2161
+
2162
+ var StepperModule = /** @class */ (function () {
2163
+ function StepperModule() {
2164
+ }
2165
+ return StepperModule;
2166
+ }());
2167
+ StepperModule.decorators = [
2168
+ { type: i0.NgModule, args: [{
2169
+ declarations: [StepperComponent, StepHeaderComponent, StepComponent],
2170
+ imports: [common.CommonModule, button.MatButtonModule, icon.MatIconModule, stepper.CdkStepperModule, flexLayout.FlexModule],
2171
+ exports: [StepperComponent, StepHeaderComponent, StepComponent],
2172
+ },] }
2173
+ ];
2174
+
1869
2175
  var MaterialAddonsModule = /** @class */ (function () {
1870
2176
  function MaterialAddonsModule() {
1871
2177
  }
@@ -1881,8 +2187,8 @@
1881
2187
  NumericFieldModule,
1882
2188
  CardModule,
1883
2189
  QuickListModule,
1884
- ThrottleClickModule
1885
- ]
2190
+ ThrottleClickModule,
2191
+ ],
1886
2192
  },] }
1887
2193
  ];
1888
2194
 
@@ -1905,12 +2211,17 @@
1905
2211
  exports.ReadOnlyFormFieldComponent = ReadOnlyFormFieldComponent;
1906
2212
  exports.ReadOnlyFormFieldModule = ReadOnlyFormFieldModule;
1907
2213
  exports.ReadOnlyFormFieldWrapperComponent = ReadOnlyFormFieldWrapperComponent;
2214
+ exports.StepComponent = StepComponent;
2215
+ exports.StepHeaderComponent = StepHeaderComponent;
2216
+ exports.StepperComponent = StepperComponent;
2217
+ exports.StepperModule = StepperModule;
1908
2218
  exports.TableModule = TableModule;
1909
2219
  exports.ThrottleClickDirective = ThrottleClickDirective;
1910
2220
  exports.ThrottleClickModule = ThrottleClickModule;
1911
2221
  exports.ToolbarComponent = ToolbarComponent;
1912
2222
  exports.ToolbarModule = ToolbarModule;
1913
2223
  exports.ToolbarService = ToolbarService;
2224
+ exports.madStepperAnimations = madStepperAnimations;
1914
2225
  exports.ɵa = PrimaryButtonComponent;
1915
2226
  exports.ɵb = MadBasicButton;
1916
2227
  exports.ɵc = OutlineButtonComponent;
@@ -1920,7 +2231,9 @@
1920
2231
  exports.ɵg = NumericFieldDirective;
1921
2232
  exports.ɵh = CardComponent;
1922
2233
  exports.ɵi = QuickListComponent;
1923
- exports.ɵj = TableComponent;
2234
+ exports.ɵj = BaseQuickListComponent;
2235
+ exports.ɵk = QuickListCompactComponent;
2236
+ exports.ɵl = TableComponent;
1924
2237
 
1925
2238
  Object.defineProperty(exports, '__esModule', { value: true });
1926
2239