@porscheinformatik/material-addons 10.3.2 → 10.4.0

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 (73) hide show
  1. package/bundles/porscheinformatik-material-addons.umd.js +511 -200
  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/button/button.module.js +2 -2
  6. package/esm2015/lib/button/danger-button/danger-button.component.js +1 -1
  7. package/esm2015/lib/button/flat-button/link-button.component.js +1 -1
  8. package/esm2015/lib/button/icon-button/icon-button.component.js +1 -1
  9. package/esm2015/lib/button/mad-basic-button.js +8 -8
  10. package/esm2015/lib/button/outline-button/outline-button.component.js +1 -1
  11. package/esm2015/lib/button/primary-button/primary-button.component.js +1 -1
  12. package/esm2015/lib/card/card.component.js +13 -7
  13. package/esm2015/lib/card/card.module.js +3 -3
  14. package/esm2015/lib/content-panel/content-header/content-header.component.js +1 -5
  15. package/esm2015/lib/content-panel/content-panel-container/content-panel-container.component.js +1 -5
  16. package/esm2015/lib/content-panel/content-panel-container-content/content-panel-container-content.component.js +1 -5
  17. package/esm2015/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.js +1 -5
  18. package/esm2015/lib/content-panel/main-container/main-container.component.js +1 -5
  19. package/esm2015/lib/data-table/data-table-action-type.js +4 -4
  20. package/esm2015/lib/data-table/data-table-action.js +1 -1
  21. package/esm2015/lib/data-table/data-table-column-definition.js +1 -0
  22. package/esm2015/lib/data-table/data-table-column.js +1 -0
  23. package/esm2015/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.js +93 -0
  24. package/esm2015/lib/data-table/data-table.component.js +248 -66
  25. package/esm2015/lib/data-table/data-table.js +1 -1
  26. package/esm2015/lib/data-table/data-table.module.js +25 -20
  27. package/esm2015/lib/flowbar/flowbar.component.js +14 -22
  28. package/esm2015/lib/flowbar/flowbar.module.js +1 -1
  29. package/esm2015/lib/material-addons.module.js +1 -1
  30. package/esm2015/lib/quick-list/base-quick-list.component.js +1 -1
  31. package/esm2015/lib/quick-list/quick-list-compact/quick-list-compact.component.js +2 -2
  32. package/esm2015/lib/readonly/readonly-form-field/readonly-form-field.component.js +1 -1
  33. package/esm2015/lib/readonly/readonly-form-field-wrapper/readonly-form-field-wrapper.component.js +12 -12
  34. package/esm2015/lib/readonly/readonly-form-field.module.js +1 -1
  35. package/esm2015/lib/stepper/step-header/step-header.component.js +3 -3
  36. package/esm2015/lib/stepper/stepper.component.js +2 -2
  37. package/esm2015/lib/stepper/stepper.module.js +1 -1
  38. package/esm2015/lib/table/column-header.js +1 -1
  39. package/esm2015/lib/table/table.component.js +7 -7
  40. package/esm2015/lib/throttle-click/throttle-click.directive.js +6 -7
  41. package/esm2015/lib/toolbar/toolbar-action.interface.js +1 -1
  42. package/esm2015/lib/toolbar/toolbar.component.js +7 -4
  43. package/esm2015/lib/toolbar/toolbar.module.js +2 -2
  44. package/esm2015/lib/toolbar/toolbar.service.js +7 -7
  45. package/esm2015/porscheinformatik-material-addons.js +15 -14
  46. package/fesm2015/porscheinformatik-material-addons.js +407 -153
  47. package/fesm2015/porscheinformatik-material-addons.js.map +1 -1
  48. package/lib/button/mad-basic-button.d.ts +4 -4
  49. package/lib/content-panel/content-header/content-header.component.d.ts +1 -4
  50. package/lib/content-panel/content-panel-container/content-panel-container.component.d.ts +1 -4
  51. package/lib/content-panel/content-panel-container-content/content-panel-container-content.component.d.ts +1 -4
  52. package/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.d.ts +1 -4
  53. package/lib/content-panel/main-container/main-container.component.d.ts +1 -4
  54. package/lib/data-table/data-table-action.d.ts +1 -1
  55. package/lib/data-table/data-table-column-definition.d.ts +26 -0
  56. package/lib/data-table/{data-table-column-header.d.ts → data-table-column.d.ts} +3 -1
  57. package/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.d.ts +23 -0
  58. package/lib/data-table/data-table.component.d.ts +68 -20
  59. package/lib/data-table/data-table.d.ts +2 -1
  60. package/lib/flowbar/flowbar.component.d.ts +3 -3
  61. package/lib/readonly/readonly-form-field-wrapper/readonly-form-field-wrapper.component.d.ts +11 -11
  62. package/lib/stepper/step-header/step-header.component.d.ts +2 -2
  63. package/lib/table/column-header.d.ts +1 -0
  64. package/lib/table/table.component.d.ts +4 -4
  65. package/lib/throttle-click/throttle-click.directive.d.ts +1 -2
  66. package/lib/toolbar/toolbar-action.interface.d.ts +2 -1
  67. package/lib/toolbar/toolbar.component.d.ts +1 -0
  68. package/lib/toolbar/toolbar.service.d.ts +2 -2
  69. package/package.json +1 -1
  70. package/porscheinformatik-material-addons.d.ts +15 -13
  71. package/porscheinformatik-material-addons.metadata.json +1 -1
  72. package/themes/common/styles.scss +6 -0
  73. package/esm2015/lib/data-table/data-table-column-header.js +0 -1
@@ -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'), require('@angular/cdk/collections'), require('uuid'), require('@angular/material/checkbox'), require('@angular/material/progress-spinner'), require('@angular/cdk/bidi'), require('@angular/cdk/stepper'), require('@angular/cdk/a11y'), require('@angular/flex-layout'), require('@angular/material/stepper')) :
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/collections', 'uuid', '@angular/material/checkbox', '@angular/material/progress-spinner', '@angular/cdk/bidi', '@angular/cdk/stepper', '@angular/cdk/a11y', '@angular/flex-layout', '@angular/material/stepper'], 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.collections, global.uuid, global.ng.material.checkbox, global.ng.material.progressSpinner, global.ng.cdk.bidi, global.ng.cdk.stepper, global.ng.cdk.a11y, global.ng.flexLayout, global.ng.material.stepper));
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, collections, uuid, checkbox, progressSpinner, bidi, stepper, a11y, flexLayout, stepper$1) { '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/collections'), require('uuid'), require('@angular/material/dialog'), require('@angular/cdk/drag-drop'), require('@angular/material/checkbox'), require('@angular/material/progress-spinner'), require('@angular/cdk/bidi'), require('@angular/cdk/stepper'), require('@angular/cdk/a11y'), require('@angular/flex-layout'), require('@angular/material/stepper')) :
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/collections', 'uuid', '@angular/material/dialog', '@angular/cdk/drag-drop', '@angular/material/checkbox', '@angular/material/progress-spinner', '@angular/cdk/bidi', '@angular/cdk/stepper', '@angular/cdk/a11y', '@angular/flex-layout', '@angular/material/stepper'], 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.collections, global.uuid, global.ng.material.dialog, global.ng.cdk.dragDrop, global.ng.material.checkbox, global.ng.material.progressSpinner, global.ng.cdk.bidi, global.ng.cdk.stepper, global.ng.cdk.a11y, global.ng.flexLayout, global.ng.material.stepper));
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, collections, uuid, dialog, dragDrop, checkbox, progressSpinner, bidi, stepper, a11y, flexLayout, stepper$1) { 'use strict';
6
6
 
7
7
  var MaterialActionButtonComponent = /** @class */ (function () {
8
8
  function MaterialActionButtonComponent() {
@@ -364,17 +364,6 @@
364
364
  function MadBasicButton() {
365
365
  this.disableClick = function (e) { return e.stopPropagation(); };
366
366
  }
367
- MadBasicButton.prototype.ngOnChanges = function (changes) {
368
- this.disableButton();
369
- };
370
- MadBasicButton.prototype.disableButton = function () {
371
- if (this.disabled) {
372
- this.button.nativeElement.addEventListener('click', this.disableClick);
373
- }
374
- else {
375
- this.button.nativeElement.removeEventListener('click', this.disableClick);
376
- }
377
- };
378
367
  Object.defineProperty(MadBasicButton.prototype, "pointerEvent", {
379
368
  get: function () {
380
369
  return this.disabled ? 'none' : 'auto';
@@ -389,6 +378,17 @@
389
378
  enumerable: false,
390
379
  configurable: true
391
380
  });
381
+ MadBasicButton.prototype.ngOnChanges = function () {
382
+ this.disableButton();
383
+ };
384
+ MadBasicButton.prototype.disableButton = function () {
385
+ if (this.disabled) {
386
+ this.button.nativeElement.addEventListener('click', this.disableClick);
387
+ }
388
+ else {
389
+ this.button.nativeElement.removeEventListener('click', this.disableClick);
390
+ }
391
+ };
392
392
  return MadBasicButton;
393
393
  }());
394
394
  MadBasicButton.propDecorators = {
@@ -571,11 +571,11 @@
571
571
  */
572
572
  this.rows = 3;
573
573
  /**
574
- * If shrinkIfEmpty is set to "false", nothing changes
575
- * If set to "true" and multiline is also "true", the textarea will
576
- * shrink to one row, if value is empty/null/undefined.
577
- * Otherwise, the defined rows-value will be used
578
- */
574
+ * If shrinkIfEmpty is set to "false", nothing changes
575
+ * If set to "true" and multiline is also "true", the textarea will
576
+ * shrink to one row, if value is empty/null/undefined.
577
+ * Otherwise, the defined rows-value will be used
578
+ */
579
579
  this.shrinkIfEmpty = false;
580
580
  this.toolTipForInputEnabled = false;
581
581
  }
@@ -661,7 +661,7 @@
661
661
  };
662
662
  ReadOnlyFormFieldWrapperComponent.prototype.isTextOverflown = function (input) {
663
663
  if (input) {
664
- return (input.offsetWidth < input.scrollWidth);
664
+ return input.offsetWidth < input.scrollWidth;
665
665
  }
666
666
  return false;
667
667
  };
@@ -685,10 +685,10 @@
685
685
  { type: i0.ElementRef }
686
686
  ]; };
687
687
  ReadOnlyFormFieldWrapperComponent.propDecorators = {
688
- readonly: [{ type: i0.Input }],
689
- value: [{ type: i0.Input, args: ['value',] }],
690
688
  originalContent: [{ type: i0.ViewChild, args: ['contentWrapper', { static: false },] }],
691
689
  readOnlyContentWrapper: [{ type: i0.ViewChild, args: ['readOnlyContentWrapper', { static: false },] }],
690
+ readonly: [{ type: i0.Input }],
691
+ value: [{ type: i0.Input, args: ['value',] }],
692
692
  textAlign: [{ type: i0.Input, args: ['textAlign',] }],
693
693
  formatNumber: [{ type: i0.Input, args: ['formatNumber',] }],
694
694
  decimalPlaces: [{ type: i0.Input, args: ['decimalPlaces',] }],
@@ -1015,6 +1015,16 @@
1015
1015
  }
1016
1016
  });
1017
1017
  }
1018
+ Object.defineProperty(ToolbarService.prototype, "toolbarTitle", {
1019
+ get: function () {
1020
+ return this.title;
1021
+ },
1022
+ set: function (toolbarTitle) {
1023
+ this.title = toolbarTitle;
1024
+ },
1025
+ enumerable: false,
1026
+ configurable: true
1027
+ });
1018
1028
  ToolbarService.prototype.ngOnDestroy = function () {
1019
1029
  if (this.routerSubscription) {
1020
1030
  this.routerSubscription.unsubscribe();
@@ -1033,16 +1043,6 @@
1033
1043
  _this.toolbarActions.push(action);
1034
1044
  });
1035
1045
  };
1036
- Object.defineProperty(ToolbarService.prototype, "toolbarTitle", {
1037
- get: function () {
1038
- return this.title;
1039
- },
1040
- set: function (toolbarTitle) {
1041
- this.title = toolbarTitle;
1042
- },
1043
- enumerable: false,
1044
- configurable: true
1045
- });
1046
1046
  ToolbarService.prototype.setDataTitle = function (dataTitle) {
1047
1047
  this.dataTitle = dataTitle;
1048
1048
  };
@@ -1169,16 +1169,19 @@
1169
1169
  return this.toolbarService.getToolbarActionsMenuTitle();
1170
1170
  };
1171
1171
  ToolbarComponent.prototype.showBadgeForMenu = function () {
1172
- return this.getToolbarActions()
1172
+ return (this.getToolbarActions()
1173
1173
  .slice(1) // the first icon is not shown in menu
1174
- .filter(function (value) { return value.badge && value.badge.value; }).length > 0;
1174
+ .filter(function (value) { return value.badge && value.badge.value; }).length > 0);
1175
+ };
1176
+ ToolbarComponent.prototype.hasImportantToolbarActions = function () {
1177
+ return this.getToolbarActions().filter(function (value) { return !!value.importantAction; }).length > 0;
1175
1178
  };
1176
1179
  return ToolbarComponent;
1177
1180
  }());
1178
1181
  ToolbarComponent.decorators = [
1179
1182
  { type: i0.Component, args: [{
1180
1183
  selector: 'mad-toolbar',
1181
- template: "<mat-toolbar class=\"content-toolbar\">\n <a [routerLink]=\"getBackAction().routerLink\" *ngIf=\"isRouterLink()\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a [href]=\"getBackAction().href\" *ngIf=\"isAbsoluteLink()\">\n <button [id]=\"'go-back'\" class=\"go-back-button\" color=\"primary\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a (click)=\"getBackAction().action()\" *ngIf=\"isAction()\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n\n <span class=\"toolbar-title\">{{ getTitle() }}</span>\n\n <ng-container *ngFor=\"let mainAction of getMainActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(mainAction) | async\">\n <div *ngIf=\"!(isHandset$ | async)\">\n <a [routerLink]=\"mainAction.routerLink\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n </div>\n <div *ngIf=\"isHandset$ | async\">\n <mad-material-action-button\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n [routerLink]=\"mainAction.routerLink\"\n [id]=\"mainAction.matIcon\"\n >\n </mad-material-action-button>\n </div>\n </ng-container>\n </ng-container>\n\n <div class=\"right-aligned no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <mad-icon-button\n (click)=\"action.action()\"\n *ngIf=\"(!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) || i < (getToolbarActions().length > 2 ? 1 : 2)\"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\">\n <mat-icon\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n matBadgePosition=\"below after\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n >{{ action.matIcon }}</mat-icon>\n </mad-icon-button>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"(isHandset$ | async) || getToolbarActionsAlwaysAsMenu()\">\n <ng-container *ngIf=\"getToolbarActions().length > 2\">\n <mad-icon-button type=\"button\" [matMenuTriggerFor]=\"burgerMenu\" [matTooltip]=\"getToolbarActionsMenuTitle()\">\n <mat-icon\n matBadgeColor=\"warn\"\n [matBadge]=\"showBadgeForMenu() ? '&#8288;' : null\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >more_vert\n </mat-icon>\n </mad-icon-button>\n <mat-menu #burgerMenu=\"matMenu\" class=\"no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <button *ngIf=\"i >= 1\" mat-menu-item (click)=\"action.action()\">\n <mat-icon\n color=\"primary\"\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n matBadgePosition=\"below after\"\n >{{ action.matIcon }}</mat-icon\n >\n {{ action.actionName }}\n </button>\n </ng-container>\n </ng-container>\n </mat-menu>\n </ng-container>\n </ng-container>\n </div>\n</mat-toolbar>\n",
1184
+ template: "<mat-toolbar class=\"content-toolbar\">\n <a [routerLink]=\"getBackAction().routerLink\" *ngIf=\"isRouterLink()\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a [href]=\"getBackAction().href\" *ngIf=\"isAbsoluteLink()\">\n <button [id]=\"'go-back'\" class=\"go-back-button\" color=\"primary\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a (click)=\"getBackAction().action()\" *ngIf=\"isAction()\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n\n <span class=\"toolbar-title\">{{ getTitle() }}</span>\n\n <ng-container *ngFor=\"let mainAction of getMainActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(mainAction) | async\">\n <div *ngIf=\"!(isHandset$ | async)\">\n <a [routerLink]=\"mainAction.routerLink\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n </div>\n <div *ngIf=\"isHandset$ | async\">\n <mad-material-action-button\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n [routerLink]=\"mainAction.routerLink\"\n [id]=\"mainAction.matIcon\"\n >\n </mad-material-action-button>\n </div>\n </ng-container>\n </ng-container>\n\n <div class=\"right-aligned no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <mad-icon-button\n (click)=\"action.action()\"\n *ngIf=\"(!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) || i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0:1) : 2) || !!action.importantAction\"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\">\n <mat-icon\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n matBadgePosition=\"below after\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n >{{ action.matIcon }}</mat-icon>\n </mad-icon-button>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"(isHandset$ | async) || getToolbarActionsAlwaysAsMenu()\">\n <ng-container *ngIf=\"getToolbarActions().length > 2\">\n <mad-icon-button type=\"button\" [matMenuTriggerFor]=\"burgerMenu\" [matTooltip]=\"getToolbarActionsMenuTitle()\">\n <mat-icon\n matBadgeColor=\"warn\"\n [matBadge]=\"showBadgeForMenu() ? '&#8288;' : null\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >more_vert\n </mat-icon>\n </mad-icon-button>\n <mat-menu #burgerMenu=\"matMenu\" class=\"no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"!action.importantAction\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <button *ngIf=\"i >= (hasImportantToolbarActions() ? 0:1)\" mat-menu-item (click)=\"action.action()\">\n <mat-icon\n color=\"primary\"\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n matBadgePosition=\"below after\"\n >{{ action.matIcon }}</mat-icon\n >\n {{ action.actionName }}\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </mat-menu>\n </ng-container>\n </ng-container>\n </div>\n</mat-toolbar>\n",
1182
1185
  styles: ["mat-toolbar{background:#fff}.content-toolbar{border-bottom:1px solid #dcdcdc;height:57px}.right-aligned{margin-left:auto;margin-right:0;overflow:hidden}.go-back-button{padding-left:0;padding-right:0}.toolbar-title{margin-right:72px}::ng-deep.mat-badge-content{bottom:-7px!important;right:-7px!important}"]
1183
1186
  },] }
1184
1187
  ];
@@ -1551,14 +1554,20 @@
1551
1554
  template: "<mat-card>\n <mat-card-header>\n <mat-card-title>\n {{ title }}\n <mad-icon-button (click)=\"toggleCollapse()\" *ngIf=\"expandable && !editMode\">\n <mat-icon [@rotateIcon]=\"!expanded\">keyboard_arrow_down</mat-icon>\n </mad-icon-button>\n </mat-card-title>\n <span>\n <mad-icon-button (click)=\"additionalActionClicked()\" *ngIf=\"additionalActionIcon\" [title]=\"additionalActionText\" type=\"button\">\n <mat-icon>{{additionalActionIcon}}</mat-icon>\n </mad-icon-button>\n <mad-icon-button [title]=\"editText\" (click)=\"onEdit()\" *ngIf=\"!readonly && !editMode\">\n <mat-icon>create</mat-icon>\n </mad-icon-button>\n </span>\n </mat-card-header>\n <mat-card-content [@collapseExpandAnimation] *ngIf=\"expanded\">\n <ng-content></ng-content>\n </mat-card-content>\n <mat-card-actions *ngIf=\"!readonly && editMode\">\n <mad-primary-button [title]=\"saveText\" [disabled]=\"saveDisabled\" (throttleClick)=\"onSave()\" madThrottleClick>\n {{ saveText }}\n </mad-primary-button>\n <mad-outline-button [title]=\"cancelText\" [disabled]=\"cancelDisabled\" (click)=\"onCancel()\">\n {{ cancelText }}\n </mad-outline-button>\n </mat-card-actions>\n</mat-card>\n",
1552
1555
  animations: [
1553
1556
  animations.trigger('collapseExpandAnimation', [
1554
- animations.transition(':enter', [animations.style({ opacity: 0, height: 0, overflow: 'hidden' }), animations.animate('100ms', animations.style({
1557
+ animations.transition(':enter', [
1558
+ animations.style({ opacity: 0, height: 0, overflow: 'hidden' }),
1559
+ animations.animate('100ms', animations.style({
1555
1560
  opacity: 1,
1556
- height: '*'
1557
- }))]),
1558
- animations.transition(':leave', [animations.style({ opacity: 1, height: '*', overflow: 'hidden' }), animations.animate('100ms', animations.style({
1561
+ height: '*',
1562
+ })),
1563
+ ]),
1564
+ animations.transition(':leave', [
1565
+ animations.style({ opacity: 1, height: '*', overflow: 'hidden' }),
1566
+ animations.animate('100ms', animations.style({
1559
1567
  opacity: 0,
1560
- height: 0
1561
- }))]),
1568
+ height: 0,
1569
+ })),
1570
+ ]),
1562
1571
  ]),
1563
1572
  animations.trigger('rotateIcon', [
1564
1573
  animations.state('true', animations.style({ transform: 'rotate(0)' })),
@@ -1595,6 +1604,11 @@
1595
1604
  this.throttleClick = new i0.EventEmitter();
1596
1605
  this.clicks = new rxjs.Subject();
1597
1606
  }
1607
+ ThrottleClickDirective.prototype.clickEvent = function (event) {
1608
+ event.preventDefault();
1609
+ event.stopPropagation();
1610
+ this.clicks.next(event);
1611
+ };
1598
1612
  ThrottleClickDirective.prototype.ngOnInit = function () {
1599
1613
  var _this = this;
1600
1614
  this.subscription = this.clicks.pipe(operators.throttleTime(this.throttleTime)).subscribe(function (e) { return _this.throttleClick.emit(e); });
@@ -1602,11 +1616,6 @@
1602
1616
  ThrottleClickDirective.prototype.ngOnDestroy = function () {
1603
1617
  this.subscription.unsubscribe();
1604
1618
  };
1605
- ThrottleClickDirective.prototype.clickEvent = function (event) {
1606
- event.preventDefault();
1607
- event.stopPropagation();
1608
- this.clicks.next(event);
1609
- };
1610
1619
  return ThrottleClickDirective;
1611
1620
  }());
1612
1621
  ThrottleClickDirective.decorators = [
@@ -1614,7 +1623,6 @@
1614
1623
  selector: '[madThrottleClick]',
1615
1624
  },] }
1616
1625
  ];
1617
- ThrottleClickDirective.ctorParameters = function () { return []; };
1618
1626
  ThrottleClickDirective.propDecorators = {
1619
1627
  throttleTime: [{ type: i0.Input }],
1620
1628
  throttleClick: [{ type: i0.Output }],
@@ -1792,7 +1800,6 @@
1792
1800
  var TableComponent = /** @class */ (function () {
1793
1801
  function TableComponent() {
1794
1802
  var _a;
1795
- this.ACTION_COLUMN_NAME = '__action__';
1796
1803
  this.columns = [];
1797
1804
  this.filterLabel = 'NOT SET';
1798
1805
  this.filterPlaceholder = 'NOT SET';
@@ -1803,6 +1810,7 @@
1803
1810
  this.tableAction = new i0.EventEmitter();
1804
1811
  this.rowAction = new i0.EventEmitter();
1805
1812
  this.sortEvent = new i0.EventEmitter();
1813
+ this.ACTION_COLUMN_NAME = '__action__';
1806
1814
  this.isFilterEnabled = false;
1807
1815
  this.isPaginationEnabled = false;
1808
1816
  }
@@ -1882,7 +1890,7 @@
1882
1890
  TableComponent.decorators = [
1883
1891
  { type: i0.Component, args: [{
1884
1892
  selector: 'mad-table',
1885
- template: "<!-- Table actions -->\n<div *ngIf=\"tableActions?.length\">\n <mad-primary-button class=\"table-action\" *ngFor=\"let tableAction of tableActions\" (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label }}\n </mad-primary-button>\n</div>\n\n<!-- Row action buttons -->\n<mat-menu #menu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <button *ngFor=\"let rowAction of rowActions\" mat-menu-item class=\"row-action\" (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table filter -->\n<mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel }}</mat-label>\n <input matInput (keyup)=\"onFilter($event?.target?.value)\" placeholder=\"{{ filterPlaceholder }}\" />\n</mat-form-field>\n\n<!-- Table -->\n<div *ngIf=\"dataSource?.data?.length > 0; else noData\" class=\"mad-table\">\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column -->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\" *ngIf=\"rowActions?.length\">\n <th mat-header-cell *matHeaderCellDef class=\"row-action-button\"></th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <mad-icon-button [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.label\">\n <ng-container *ngIf=\"column.isSortable; else noSort\">\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.label }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\">\n {{ element[column.dataPropertyName] }}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnNames\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnNames\"\n ></tr>\n </table>\n\n <!-- Pagination -->\n <mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n showFirstLastButtons\n >\n </mat-paginator>\n</div>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n {{ noDataText }}\n </div>\n</ng-template>\n",
1893
+ template: "<!-- Table actions -->\n<div *ngIf=\"tableActions?.length\">\n <mad-primary-button class=\"table-action\" *ngFor=\"let tableAction of tableActions\" (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label }}\n </mad-primary-button>\n</div>\n\n<!-- Row action buttons -->\n<mat-menu #menu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <button *ngFor=\"let rowAction of rowActions\" mat-menu-item class=\"row-action\" (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table filter -->\n<mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel }}</mat-label>\n <input matInput (keyup)=\"onFilter($event?.target?.value)\" placeholder=\"{{ filterPlaceholder }}\" />\n</mat-form-field>\n\n<!-- Table -->\n<div *ngIf=\"dataSource?.data?.length > 0; else noData\" class=\"mad-table\">\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column -->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\" *ngIf=\"rowActions?.length\" sticky>\n <th mat-header-cell *matHeaderCellDef class=\"row-action-button\"></th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <mad-icon-button [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.label\" [sticky]=\"column.isSticky\">\n <ng-container *ngIf=\"column.isSortable; else noSort\">\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.label }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\">\n {{ element[column.dataPropertyName] }}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnNames\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnNames\"\n ></tr>\n </table>\n</div>\n<!-- Pagination -->\n<mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n showFirstLastButtons\n>\n</mat-paginator>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n {{ noDataText }}\n </div>\n</ng-template>\n",
1886
1894
  styles: [".text-right{text-align:right!important}.table-action{margin-bottom:.5em;margin-right:.5em}.row-action-button{width:10px}.noDataText{text-align:center;width:100%}.mad-table{overflow-x:auto;width:100%}"]
1887
1895
  },] }
1888
1896
  ];
@@ -1895,14 +1903,14 @@
1895
1903
  defaultPageSize: [{ type: i0.Input }],
1896
1904
  rowActions: [{ type: i0.Input }],
1897
1905
  tableActions: [{ type: i0.Input }],
1898
- displayedData: [{ type: i0.Input }],
1899
- paginationEnabled: [{ type: i0.Input }],
1900
- filterEnabled: [{ type: i0.Input }],
1901
1906
  tableAction: [{ type: i0.Output }],
1902
1907
  rowAction: [{ type: i0.Output }],
1903
1908
  sortEvent: [{ type: i0.Output }],
1904
1909
  paginator: [{ type: i0.ViewChild, args: [paginator.MatPaginator, { static: false },] }],
1905
- sort: [{ type: i0.ViewChild, args: [sort.MatSort, { static: true },] }]
1910
+ sort: [{ type: i0.ViewChild, args: [sort.MatSort, { static: true },] }],
1911
+ displayedData: [{ type: i0.Input }],
1912
+ paginationEnabled: [{ type: i0.Input }],
1913
+ filterEnabled: [{ type: i0.Input }]
1906
1914
  };
1907
1915
 
1908
1916
  var TableModule = /** @class */ (function () {
@@ -1934,39 +1942,182 @@
1934
1942
  }
1935
1943
  return DataTableActionType;
1936
1944
  }());
1937
- DataTableActionType.SINGLE = "SINGLE";
1938
- DataTableActionType.BATCH = "BATCH";
1939
- DataTableActionType.NONE = "NONE";
1945
+ DataTableActionType.SINGLE = 'SINGLE';
1946
+ DataTableActionType.BATCH = 'BATCH';
1947
+ DataTableActionType.NONE = 'NONE';
1940
1948
 
1941
- var DataTableComponent = /** @class */ (function () {
1942
- function DataTableComponent() {
1949
+ var DataTableColumnsModalComponent = /** @class */ (function () {
1950
+ function DataTableColumnsModalComponent(dialogRef, data) {
1951
+ this.dialogRef = dialogRef;
1952
+ this.data = data;
1953
+ this.selectedColumns = [];
1954
+ this.availableColumns = [];
1955
+ this.filteredAvailableColumns = [];
1956
+ }
1957
+ DataTableColumnsModalComponent.prototype.ngOnInit = function () {
1958
+ var e_1, _b;
1959
+ this.definition = this.data.definition;
1960
+ try {
1961
+ for (var _c = __values(this.data.allColumns), _d = _c.next(); !_d.done; _d = _c.next()) {
1962
+ var column = _d.value;
1963
+ var columnId = column.id;
1964
+ var selectedColumnIds = this.definition.displayedColumns.map(function (col) { return col.id; });
1965
+ if (selectedColumnIds.includes(columnId)) {
1966
+ this.selectedColumns.push(column);
1967
+ }
1968
+ else {
1969
+ this.availableColumns.push(column);
1970
+ }
1971
+ }
1972
+ }
1973
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1974
+ finally {
1975
+ try {
1976
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
1977
+ }
1978
+ finally { if (e_1) throw e_1.error; }
1979
+ }
1980
+ this.clearFilterValue();
1981
+ };
1982
+ DataTableColumnsModalComponent.prototype.onDrop = function (event) {
1983
+ if (event.previousContainer === event.container) {
1984
+ dragDrop.moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
1985
+ }
1986
+ else {
1987
+ var itemIndex = this.findMatchingItemIndex(event.previousContainer, event.item);
1988
+ dragDrop.transferArrayItem(event.previousContainer.data, event.container.data, itemIndex, event.currentIndex);
1989
+ this.clearFilterValue();
1990
+ this.availableColumns.sort(function (a, b) { return a.label.localeCompare(b.label); });
1991
+ }
1992
+ };
1993
+ DataTableColumnsModalComponent.prototype.onSave = function () {
1994
+ this.definition.displayedColumns = this.selectedColumns;
1995
+ var saveChange = {
1996
+ action: 'SAVE',
1997
+ definition: this.definition,
1998
+ };
1999
+ this.dialogRef.close(saveChange);
2000
+ };
2001
+ DataTableColumnsModalComponent.prototype.onDelete = function () {
2002
+ var deleteChange = {
2003
+ action: 'DELETE',
2004
+ definition: this.definition,
2005
+ };
2006
+ this.dialogRef.close(deleteChange);
2007
+ };
2008
+ DataTableColumnsModalComponent.prototype.onCancel = function () {
2009
+ this.dialogRef.close();
2010
+ };
2011
+ DataTableColumnsModalComponent.prototype.updateFilterValue = function () {
2012
+ var _this = this;
1943
2013
  var _a;
1944
- this.ACTION_COLUMN_NAME = "__action__";
1945
- this.SINGLE = DataTableActionType.SINGLE;
1946
- this.BATCH = DataTableActionType.BATCH;
1947
- this.NONE = DataTableActionType.NONE;
1948
- this.columns = [];
1949
- this.filterLabel = "Filter";
1950
- this.filterPlaceholder = "";
1951
- this.noDataText = "No matching data found";
2014
+ if (((_a = this.searchFilter) === null || _a === void 0 ? void 0 : _a.length) > 0) {
2015
+ this.filteredAvailableColumns = this.availableColumns.filter(function (c) { return c.label.toLowerCase().includes(_this.searchFilter.toLowerCase()); });
2016
+ }
2017
+ else {
2018
+ this.filteredAvailableColumns = __spread(this.availableColumns);
2019
+ }
2020
+ };
2021
+ DataTableColumnsModalComponent.prototype.findMatchingItemIndex = function (previousContainer, item) {
2022
+ var itemId = item.element.nativeElement.id;
2023
+ var previousContainerItems = __spread(previousContainer.data);
2024
+ if ((previousContainerItems === null || previousContainerItems === void 0 ? void 0 : previousContainerItems.length) < 1) {
2025
+ return 0;
2026
+ }
2027
+ for (var itemIndex = 0; itemIndex < previousContainerItems.length; itemIndex++) {
2028
+ if (previousContainerItems[itemIndex].id === itemId) {
2029
+ return itemIndex;
2030
+ }
2031
+ }
2032
+ return 0;
2033
+ };
2034
+ DataTableColumnsModalComponent.prototype.clearFilterValue = function () {
2035
+ this.searchFilter = '';
2036
+ this.filteredAvailableColumns = __spread(this.availableColumns);
2037
+ };
2038
+ return DataTableColumnsModalComponent;
2039
+ }());
2040
+ DataTableColumnsModalComponent.decorators = [
2041
+ { type: i0.Component, args: [{
2042
+ selector: 'mad-data-table-columns-modal.component',
2043
+ template: "<h1 mat-dialog-title>{{ data?.titleLabel | translate }}</h1>\n<div mat-dialog-content>\n <div class=\"column-drag-main-content\">\n <div class=\"column-drag-container\">\n <div class=\"column-drag-info-area\">{{ data?.infoTextLabel | translate }}</div>\n <div class=\"column-drag-container-header\">{{ data?.selectedLabel | translate }}</div>\n <div\n cdkDropList\n #selectedList=\"cdkDropList\"\n [cdkDropListData]=\"selectedColumns\"\n [cdkDropListConnectedTo]=\"[availableList]\"\n class=\"column-drag-list selected-drag-list\"\n (cdkDropListDropped)=\"onDrop($event)\">\n <div class=\"column-drag-box\"\n *ngFor=\"let selectedColumn of selectedColumns; let i = index\"\n cdkDrag\n [id]=\"selectedColumn.id\"\n >\n {{i + 1}}. {{selectedColumn.label | translate }}\n </div>\n </div>\n </div>\n\n <div class=\"column-drag-container\">\n <div class=\"column-drag-info-area\">\n <!-- Table filter -->\n <mat-form-field>\n <mat-label>{{ data?.filterColumnsLabel | translate }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"updateFilterValue()\"\n placeholder=\"{{ data?.filterColumnsPlaceHolder | translate }}\" [(ngModel)]=\"searchFilter\"/>\n <button *ngIf=\"searchFilter\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearFilterValue()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </div>\n <div class=\"column-drag-container-header\">{{ data?.availableLabel | translate }}</div>\n <div\n cdkDropList\n cdkDropListSortingDisabled\n #availableList=\"cdkDropList\"\n [cdkDropListData]=\"availableColumns\"\n [cdkDropListConnectedTo]=\"[selectedList]\"\n class=\"column-drag-list\"\n (cdkDropListDropped)=\"onDrop($event)\">\n <div *ngFor=\"let availableColumn of filteredAvailableColumns\" class=\"column-drag-box\" cdkDrag [id]=\"availableColumn.id\">\n {{availableColumn.label}}\n </div>\n </div>\n </div>\n </div>\n\n</div>\n<div mat-dialog-actions [align]=\"'end'\">\n <mad-outline-button (click)=\"onCancel()\">\n {{ data?.cancelLabel | translate }}\n </mad-outline-button>\n <mad-danger-button *ngIf=\"data?.deleteDefinitionAllowed\" (click)=\"onDelete()\">\n {{ data?.deleteLabel | translate }}\n </mad-danger-button>\n <mad-primary-button (click)=\"onSave()\" [disabled]=\"!(this.selectedColumns?.length > 0)\">\n {{ data?.saveLabel | translate }}\n </mad-primary-button>\n</div>\n",
2044
+ styles: [".column-drag-main-content{border-bottom:1px solid #f5f5f5;display:flex;flex-direction:row;justify-content:space-between;margin-bottom:16px;padding:8px 8px 16px;width:544px}.column-drag-container{display:inline-block;font-size:small;max-width:100%;vertical-align:top;width:256px}.info-box{margin-bottom:16px}.column-drag-info-area,.info-box{color:rgba(0,0,0,.66);font-size:small;width:100%}.column-drag-info-area{align-items:stretch;display:flex;flex-direction:column;height:36px;justify-content:right;margin-bottom:32px}.column-drag-list{background:#fff;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;display:block;height:200px;overflow:auto}.column-drag-container-header{font-weight:700;margin-bottom:4px}.column-drag-box{align-items:center;background:#fff;border-bottom:1px solid #ccc;box-sizing:border-box;color:rgba(0,0,0,.87);cursor:move;display:flex;flex-direction:row;font-size:14px;height:40px;justify-content:space-between;padding:12px 10px}.cdk-drag-preview{border-radius:4px;box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);box-sizing:border-box}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.column-drag-box:last-child{border:none}.column-drag-list.cdk-drop-list-dragging .column-drag-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"]
2045
+ },] }
2046
+ ];
2047
+ DataTableColumnsModalComponent.ctorParameters = function () { return [
2048
+ { type: dialog.MatDialogRef },
2049
+ { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
2050
+ ]; };
2051
+
2052
+ var DataTableComponent = /** @class */ (function () {
2053
+ function DataTableComponent(matDialog) {
2054
+ this.matDialog = matDialog;
2055
+ // Translations
2056
+ this.filterLabel = 'Filter';
2057
+ this.filterPlaceholder = '';
2058
+ this.filterColumnsLabel = 'Filter';
2059
+ this.filterColumnsPlaceHolder = 'Filter available columns';
2060
+ this.noDataText = 'No matching data found';
2061
+ this.columnSettingsModalTitleLabel = 'Column settings';
2062
+ this.selectedLabel = 'Selected columns';
2063
+ this.availableLabel = 'Available columns';
2064
+ this.saveLabel = 'Save';
2065
+ this.deleteLabel = 'Delete';
2066
+ this.cancelLabel = 'Cancel';
2067
+ this.infoTextLabel = 'Drag and drop a column to select or reorder it.';
1952
2068
  this.pageSizeOptions = [5, 10, 15];
1953
- this.defaultPageSize = ((_a = this.pageSizeOptions) === null || _a === void 0 ? void 0 : _a[0]) || 10;
1954
2069
  this.actions = [];
2070
+ this.deleteDefinitionAllowed = false;
2071
+ this.useAsync = false;
1955
2072
  this.sortEvent = new i0.EventEmitter();
1956
2073
  this.actionEvent = new i0.EventEmitter();
1957
- this.pagingEvent = new i0.EventEmitter();
2074
+ this.pageEvent = new i0.EventEmitter();
2075
+ this.allColumnsEvent = new i0.EventEmitter();
2076
+ this.columnDefinitionChangeEvent = new i0.EventEmitter();
2077
+ this.viewDefinitionChangeEvent = new i0.EventEmitter();
2078
+ this.ACTION_COLUMN_NAME = '__action__';
2079
+ this.SINGLE = DataTableActionType.SINGLE;
2080
+ this.BATCH = DataTableActionType.BATCH;
2081
+ this.NONE = DataTableActionType.NONE;
1958
2082
  this.tableActions = [];
1959
2083
  this.rowActions = [];
2084
+ this.columns = [];
1960
2085
  this.allSelected = false;
1961
2086
  this.displayedDataMap = new Map();
1962
2087
  this.actualDataMap = new Map();
1963
2088
  this.selectionModel = new collections.SelectionModel(true);
2089
+ this.allColumnDefinitions = [];
1964
2090
  this.isFilterEnabled = false;
1965
2091
  this.isPaginationEnabled = false;
1966
2092
  this.mode = this.NONE;
1967
2093
  this.isRowClickable = false;
2094
+ this.showColumnModal = false;
1968
2095
  this.isLoading = false;
2096
+ this.paginatorLength = 0;
2097
+ this.paginatorPageIndex = 0;
2098
+ this.paginatorPageSize = 50;
1969
2099
  }
2100
+ Object.defineProperty(DataTableComponent.prototype, "displayedColumns", {
2101
+ set: function (cols) {
2102
+ if (!this.displayedColumnDefinition) {
2103
+ this.columns = cols ? __spread(cols) : [];
2104
+ this.columnIds = this.columns.map(function (column) { return column.id; });
2105
+ this.columnIds.unshift(this.ACTION_COLUMN_NAME);
2106
+ }
2107
+ },
2108
+ enumerable: false,
2109
+ configurable: true
2110
+ });
2111
+ Object.defineProperty(DataTableComponent.prototype, "displayedColumnDefinition", {
2112
+ set: function (def) {
2113
+ this.selectedColumnDefinion = def;
2114
+ this.columns = def.displayedColumns;
2115
+ this.columnIds = this.columns.map(function (column) { return column.id; });
2116
+ this.columnIds.unshift(this.ACTION_COLUMN_NAME);
2117
+ },
2118
+ enumerable: false,
2119
+ configurable: true
2120
+ });
1970
2121
  Object.defineProperty(DataTableComponent.prototype, "tableData", {
1971
2122
  set: function (data) {
1972
2123
  if (!this.dataSource) {
@@ -1977,6 +2128,44 @@
1977
2128
  enumerable: false,
1978
2129
  configurable: true
1979
2130
  });
2131
+ Object.defineProperty(DataTableComponent.prototype, "page", {
2132
+ set: function (page) {
2133
+ this.paginatorPageIndex = page.pageIndex;
2134
+ this.paginatorPageSize = page.pageSize;
2135
+ this.paginatorLength = page.length;
2136
+ },
2137
+ enumerable: false,
2138
+ configurable: true
2139
+ });
2140
+ Object.defineProperty(DataTableComponent.prototype, "columnDefinitions", {
2141
+ set: function (definitions) {
2142
+ var e_1, _b;
2143
+ var _a;
2144
+ this.editableColumnDefinitions = [];
2145
+ this.viewableColumnDefinitions = [];
2146
+ this.allColumnDefinitions = __spread(definitions);
2147
+ try {
2148
+ for (var definitions_1 = __values(definitions), definitions_1_1 = definitions_1.next(); !definitions_1_1.done; definitions_1_1 = definitions_1.next()) {
2149
+ var definition = definitions_1_1.value;
2150
+ if (definition.editable) {
2151
+ this.editableColumnDefinitions.push(definition);
2152
+ }
2153
+ if (((_a = definition.displayedColumns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
2154
+ this.viewableColumnDefinitions.push(definition);
2155
+ }
2156
+ }
2157
+ }
2158
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2159
+ finally {
2160
+ try {
2161
+ if (definitions_1_1 && !definitions_1_1.done && (_b = definitions_1.return)) _b.call(definitions_1);
2162
+ }
2163
+ finally { if (e_1) throw e_1.error; }
2164
+ }
2165
+ },
2166
+ enumerable: false,
2167
+ configurable: true
2168
+ });
1980
2169
  Object.defineProperty(DataTableComponent.prototype, "loading", {
1981
2170
  set: function (isLoading) {
1982
2171
  this.isLoading = isLoading;
@@ -1984,13 +2173,33 @@
1984
2173
  enumerable: false,
1985
2174
  configurable: true
1986
2175
  });
2176
+ Object.defineProperty(DataTableComponent.prototype, "defaultPageSize", {
2177
+ set: function (defaultSize) {
2178
+ this.paginatorPageSize = defaultSize;
2179
+ },
2180
+ enumerable: false,
2181
+ configurable: true
2182
+ });
2183
+ Object.defineProperty(DataTableComponent.prototype, "externalPaginator", {
2184
+ set: function (paginator) {
2185
+ this.extPaginator = paginator;
2186
+ },
2187
+ enumerable: false,
2188
+ configurable: true
2189
+ });
1987
2190
  Object.defineProperty(DataTableComponent.prototype, "paginationEnabled", {
1988
2191
  set: function (isPaginationEnabled) {
1989
2192
  this.isPaginationEnabled = isPaginationEnabled;
1990
- // eslint-disable-next-line
1991
- var pageSize = this.isPaginationEnabled ? this.defaultPageSize : Number.MAX_VALUE;
1992
- if (this.dataSource.paginator) {
1993
- this.dataSource.paginator._changePageSize(pageSize);
2193
+ this.unsetPageSizeIfNecessary();
2194
+ },
2195
+ enumerable: false,
2196
+ configurable: true
2197
+ });
2198
+ Object.defineProperty(DataTableComponent.prototype, "allColumns", {
2199
+ set: function (allColumns) {
2200
+ this.allAvailableColumns = allColumns;
2201
+ if (allColumns && this.showColumnModal) {
2202
+ this.openColumnModal();
1994
2203
  }
1995
2204
  },
1996
2205
  enumerable: false,
@@ -1998,7 +2207,7 @@
1998
2207
  });
1999
2208
  Object.defineProperty(DataTableComponent.prototype, "filterEnabled", {
2000
2209
  set: function (isFilterEnabled) {
2001
- this.isFilterEnabled = isFilterEnabled;
2210
+ this.isFilterEnabled = !this.useAsync ? isFilterEnabled : false;
2002
2211
  this.setFilterValue(undefined);
2003
2212
  },
2004
2213
  enumerable: false,
@@ -2015,20 +2224,84 @@
2015
2224
  enumerable: false,
2016
2225
  configurable: true
2017
2226
  });
2227
+ DataTableComponent.compare = function (a, b, sort) {
2228
+ var x = a[sort.active];
2229
+ var y = b[sort.active];
2230
+ var ascending = sort.direction === 'asc';
2231
+ switch (typeof x) {
2232
+ case 'number':
2233
+ return DataTableComponent.compareNumber(x, y, ascending);
2234
+ case 'string':
2235
+ return DataTableComponent.compareString(x, y, ascending);
2236
+ case 'boolean':
2237
+ return DataTableComponent.compareBoolean(x, y, ascending);
2238
+ default:
2239
+ // cannot compare -> return equal
2240
+ return 0;
2241
+ }
2242
+ };
2243
+ DataTableComponent.compareNumber = function (x, y, ascending) {
2244
+ return ascending ? x - y : y - x;
2245
+ };
2246
+ DataTableComponent.compareString = function (x, y, ascending) {
2247
+ return ascending ? x.localeCompare(y) : y.localeCompare(x);
2248
+ };
2249
+ DataTableComponent.compareBoolean = function (x, y, ascending) {
2250
+ if (x === y) {
2251
+ return 0;
2252
+ }
2253
+ if (ascending) {
2254
+ // true first
2255
+ return x ? -1 : 1;
2256
+ }
2257
+ else {
2258
+ // false first
2259
+ return x ? 1 : -1;
2260
+ }
2261
+ };
2262
+ DataTableComponent.transformData = function (value, transformer, transformerParams) {
2263
+ if (!transformer || !(transformer instanceof Function)) {
2264
+ return value;
2265
+ }
2266
+ return transformer(value, transformerParams);
2267
+ };
2268
+ DataTableComponent.generateRowId = function () {
2269
+ return uuid.v4();
2270
+ };
2271
+ DataTableComponent.isClickOnRowMenuIcon = function (event) {
2272
+ var _a;
2273
+ return (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.classList.contains('mat-icon');
2274
+ };
2018
2275
  DataTableComponent.prototype.ngOnInit = function () {
2019
- this.columnNames = this.columns.map(function (column) { return column.label; });
2020
2276
  this.mode = this.getTableMode();
2021
2277
  this.setActions();
2022
2278
  if (this.mode !== this.NONE) {
2023
2279
  this.isRowClickable = true;
2024
2280
  this.defaultAction = this.rowActions[0];
2025
2281
  }
2026
- this.columnNames.unshift(this.ACTION_COLUMN_NAME);
2027
2282
  };
2028
2283
  DataTableComponent.prototype.ngAfterViewInit = function () {
2029
2284
  this.dataSource.paginator = this.paginator;
2030
2285
  this.dataSource.sort = this.sort;
2031
2286
  };
2287
+ DataTableComponent.prototype.onColumnSettings = function (definition) {
2288
+ this.showColumnModal = true;
2289
+ this.selectedDefinition = definition ? definition : this.allColumnDefinitions[0];
2290
+ if (this.allAvailableColumns) {
2291
+ this.openColumnModal();
2292
+ }
2293
+ else {
2294
+ // if no complete definitions have been loaded yet send an event so the app can load it
2295
+ this.allColumnsEvent.emit();
2296
+ }
2297
+ };
2298
+ DataTableComponent.prototype.onViewDefinition = function (definition) {
2299
+ this.selectedDefinition = definition;
2300
+ this.viewDefinitionChangeEvent.emit(definition);
2301
+ };
2302
+ DataTableComponent.prototype.isCurrentDefinition = function (definition) {
2303
+ return this.selectedDefinition && this.selectedDefinition.id === definition.id;
2304
+ };
2032
2305
  Object.defineProperty(DataTableComponent.prototype, "selectedCount", {
2033
2306
  get: function () {
2034
2307
  var _a;
@@ -2039,23 +2312,26 @@
2039
2312
  });
2040
2313
  Object.defineProperty(DataTableComponent.prototype, "rowCount", {
2041
2314
  get: function () {
2042
- var _a;
2043
- return ((_a = this.dataSource) === null || _a === void 0 ? void 0 : _a._pageData(this.dataSource.data)) ? this.dataSource._pageData(this.dataSource.data).length : 0;
2315
+ return this.getAllDataSourceRowsOfCurrentPage() ? this.getAllDataSourceRowsOfCurrentPage().length : 0;
2044
2316
  },
2045
2317
  enumerable: false,
2046
2318
  configurable: true
2047
2319
  });
2320
+ DataTableComponent.prototype.getAllDataSourceRowsOfCurrentPage = function () {
2321
+ var _a;
2322
+ return (_a = this.dataSource) === null || _a === void 0 ? void 0 : _a._pageData(this.dataSource.data);
2323
+ };
2048
2324
  DataTableComponent.prototype.getSelectedCount = function (actionType) {
2049
2325
  var count = this.selectedCount;
2050
- if (actionType != this.BATCH || count < 2) {
2051
- return "";
2326
+ if (actionType !== this.BATCH || count < 2) {
2327
+ return '';
2052
2328
  }
2053
- return " (" + count + ")";
2329
+ return ' (' + count + ')';
2054
2330
  };
2055
2331
  DataTableComponent.prototype.isDisabled = function (actionType) {
2056
2332
  switch (actionType) {
2057
2333
  case this.SINGLE:
2058
- return this.selectedCount != 1;
2334
+ return this.selectedCount !== 1;
2059
2335
  case this.BATCH:
2060
2336
  return this.selectedCount < 1;
2061
2337
  default:
@@ -2070,10 +2346,8 @@
2070
2346
  this.allSelected = !this.allSelected;
2071
2347
  if (this.allSelected) {
2072
2348
  // select all rows of the current page
2073
- this.dataSource._pageData(this.dataSource.data).forEach(function (row) {
2074
- var dataRow = row;
2075
- var rowId = "" + dataRow.rowId;
2076
- _this.selectionModel.select(rowId);
2349
+ this.getAllDataSourceRowsOfCurrentPage().forEach(function (row) {
2350
+ _this.selectionModel.select('' + row.rowId);
2077
2351
  });
2078
2352
  }
2079
2353
  };
@@ -2107,14 +2381,21 @@
2107
2381
  return;
2108
2382
  }
2109
2383
  };
2110
- DataTableComponent.prototype.onSortingEvent = function (sortingParams) {
2111
- this.sortEvent.emit(sortingParams);
2384
+ DataTableComponent.prototype.onSortingEvent = function (sort) {
2385
+ if (this.useAsync) {
2386
+ this.sortEvent.emit(sort);
2387
+ }
2388
+ else {
2389
+ this.internalSort(sort);
2390
+ }
2112
2391
  };
2113
- DataTableComponent.prototype.onPaginationEvent = function (event) {
2114
- this.pagingEvent.emit(event);
2392
+ DataTableComponent.prototype.onPageEvent = function (event) {
2393
+ if (this.useAsync) {
2394
+ this.pageEvent.emit(event);
2395
+ }
2115
2396
  };
2116
2397
  DataTableComponent.prototype.onTableAction = function (tableAction) {
2117
- var e_1, _b;
2398
+ var e_2, _b;
2118
2399
  if (!!tableAction) {
2119
2400
  var selection = [];
2120
2401
  try {
@@ -2123,30 +2404,17 @@
2123
2404
  selection.push(this.idGenerator ? selected : this.actualDataMap.get(selected));
2124
2405
  }
2125
2406
  }
2126
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2407
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
2127
2408
  finally {
2128
2409
  try {
2129
2410
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2130
2411
  }
2131
- finally { if (e_1) throw e_1.error; }
2412
+ finally { if (e_2) throw e_2.error; }
2132
2413
  }
2133
2414
  tableAction.selected = selection;
2134
2415
  this.actionEvent.emit(tableAction);
2135
2416
  }
2136
2417
  };
2137
- DataTableComponent.transformData = function (value, transformer, transformerParams) {
2138
- if (!transformer || !(transformer instanceof Function)) {
2139
- return value;
2140
- }
2141
- return transformer(value, transformerParams);
2142
- };
2143
- DataTableComponent.generateRowId = function () {
2144
- return uuid.v4();
2145
- };
2146
- DataTableComponent.isClickOnRowMenuIcon = function (event) {
2147
- var _a;
2148
- return (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.classList.contains("mat-icon");
2149
- };
2150
2418
  DataTableComponent.prototype.emitTableAction = function (action, selected) {
2151
2419
  var emitAction = Object.assign({}, action);
2152
2420
  if (action.type !== this.NONE) {
@@ -2155,9 +2423,9 @@
2155
2423
  this.actionEvent.emit(emitAction);
2156
2424
  };
2157
2425
  DataTableComponent.prototype.generateDisplayedDataElement = function (rowId, actualDataElement) {
2158
- var e_2, _b;
2426
+ var e_3, _b;
2159
2427
  var displayedDataElement = {};
2160
- displayedDataElement["rowId"] = rowId;
2428
+ displayedDataElement.rowId = rowId;
2161
2429
  try {
2162
2430
  for (var _c = __values(this.columns), _d = _c.next(); !_d.done; _d = _c.next()) {
2163
2431
  var column = _d.value;
@@ -2165,17 +2433,21 @@
2165
2433
  displayedDataElement[column.dataPropertyName] = DataTableComponent.transformData(actualValue, column.transformer, column.transformerParams);
2166
2434
  }
2167
2435
  }
2168
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
2436
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
2169
2437
  finally {
2170
2438
  try {
2171
2439
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2172
2440
  }
2173
- finally { if (e_2) throw e_2.error; }
2441
+ finally { if (e_3) throw e_3.error; }
2174
2442
  }
2175
2443
  return displayedDataElement;
2176
2444
  };
2445
+ DataTableComponent.prototype.internalSort = function (sort) {
2446
+ var sortedData = __spread(this.dataSource.data).sort(function (a, b) { return DataTableComponent.compare(a, b, sort); });
2447
+ this.dataSource.data = __spread(sortedData);
2448
+ };
2177
2449
  DataTableComponent.prototype.setActions = function () {
2178
- var e_3, _b;
2450
+ var e_4, _b;
2179
2451
  this.rowActions = [];
2180
2452
  this.tableActions = [];
2181
2453
  try {
@@ -2202,40 +2474,68 @@
2202
2474
  }
2203
2475
  }
2204
2476
  }
2205
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
2477
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
2206
2478
  finally {
2207
2479
  try {
2208
2480
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2209
2481
  }
2210
- finally { if (e_3) throw e_3.error; }
2482
+ finally { if (e_4) throw e_4.error; }
2211
2483
  }
2212
2484
  };
2213
2485
  DataTableComponent.prototype.createDataMapsAndSetDisplayedDataSourceData = function (data) {
2214
- var e_4, _b;
2486
+ var e_5, _b;
2215
2487
  var displayedDataList = [];
2216
2488
  this.actualDataMap.clear();
2217
2489
  this.displayedDataMap.clear();
2218
- try {
2219
- for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
2220
- var dataEntry = data_1_1.value;
2221
- var rowId = (this.idGenerator) ? this.idGenerator(dataEntry) : DataTableComponent.generateRowId();
2222
- this.actualDataMap.set(rowId, dataEntry);
2223
- var displayedDataElement = this.generateDisplayedDataElement(rowId, dataEntry);
2224
- this.displayedDataMap.set(rowId, displayedDataElement);
2225
- displayedDataList.push(displayedDataElement);
2226
- }
2227
- }
2228
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
2229
- finally {
2490
+ if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
2230
2491
  try {
2231
- if (data_1_1 && !data_1_1.done && (_b = data_1.return)) _b.call(data_1);
2492
+ for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
2493
+ var dataEntry = data_1_1.value;
2494
+ var rowId = this.idGenerator ? this.idGenerator(dataEntry) : DataTableComponent.generateRowId();
2495
+ this.actualDataMap.set(rowId, dataEntry);
2496
+ var displayedDataElement = this.generateDisplayedDataElement(rowId, dataEntry);
2497
+ this.displayedDataMap.set(rowId, displayedDataElement);
2498
+ displayedDataList.push(displayedDataElement);
2499
+ }
2500
+ }
2501
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
2502
+ finally {
2503
+ try {
2504
+ if (data_1_1 && !data_1_1.done && (_b = data_1.return)) _b.call(data_1);
2505
+ }
2506
+ finally { if (e_5) throw e_5.error; }
2232
2507
  }
2233
- finally { if (e_4) throw e_4.error; }
2234
2508
  }
2235
2509
  this.dataSource.data = displayedDataList;
2510
+ this.unsetPageSizeIfNecessary();
2511
+ };
2512
+ DataTableComponent.prototype.openColumnModal = function () {
2513
+ var _this = this;
2514
+ var dialogData = {
2515
+ allColumns: this.allAvailableColumns,
2516
+ definition: this.selectedDefinition,
2517
+ deleteDefinitionAllowed: this.deleteDefinitionAllowed,
2518
+ filterColumnsLabel: this.filterColumnsLabel,
2519
+ filterColumnsPlaceHolder: this.filterColumnsPlaceHolder,
2520
+ noDataText: this.noDataText,
2521
+ titleLabel: this.columnSettingsModalTitleLabel,
2522
+ selectedLabel: this.selectedLabel,
2523
+ availableLabel: this.availableLabel,
2524
+ saveLabel: this.saveLabel,
2525
+ deleteLabel: this.deleteLabel,
2526
+ cancelLabel: this.cancelLabel,
2527
+ infoTextLabel: this.infoTextLabel,
2528
+ };
2529
+ var dialog = this.matDialog.open(DataTableColumnsModalComponent, { data: dialogData });
2530
+ dialog.afterClosed().subscribe(function (result) {
2531
+ // no event on CANCEL
2532
+ if (result) {
2533
+ _this.columnDefinitionChangeEvent.emit(result);
2534
+ }
2535
+ });
2236
2536
  };
2237
2537
  DataTableComponent.prototype.getTableMode = function () {
2238
- var e_5, _b;
2538
+ var e_6, _b;
2239
2539
  if (this._forceMode) {
2240
2540
  return this._forceMode;
2241
2541
  }
@@ -2249,12 +2549,12 @@
2249
2549
  distinctActionTypes.add(rowAction.type);
2250
2550
  }
2251
2551
  }
2252
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
2552
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
2253
2553
  finally {
2254
2554
  try {
2255
2555
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2256
2556
  }
2257
- finally { if (e_5) throw e_5.error; }
2557
+ finally { if (e_6) throw e_6.error; }
2258
2558
  }
2259
2559
  if (distinctActionTypes.has(this.BATCH)) {
2260
2560
  return this.BATCH;
@@ -2264,32 +2564,63 @@
2264
2564
  }
2265
2565
  return this.NONE;
2266
2566
  };
2567
+ DataTableComponent.prototype.unsetPageSizeIfNecessary = function () {
2568
+ if (!this.useAsync && !this.isPaginationEnabled) {
2569
+ var dataCount = this.dataSource.data ? this.dataSource.data.length : 0;
2570
+ this.paginatorPageSize = dataCount;
2571
+ this.paginatorLength = dataCount;
2572
+ }
2573
+ };
2267
2574
  return DataTableComponent;
2268
2575
  }());
2269
2576
  DataTableComponent.decorators = [
2270
2577
  { type: i0.Component, args: [{
2271
- selector: "mad-data-table",
2272
- template: "<div class=\"mad-datatable-action-bar\">\n <!-- Table actions: displayed before the table -->\n <div *ngIf=\"tableActions?.length\">\n <mad-outline-button\n [disabled]=\"isDisabled(tableAction.type)\"\n class=\"table-action\"\n *ngFor=\"let tableAction of tableActions\"\n (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label | translate }} {{ getSelectedCount(tableAction.type) }}\n </mad-outline-button>\n </div>\n <!-- Table filter -->\n <mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel | translate }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"setFilterValue($event?.target?.value)\"\n placeholder=\"{{ filterPlaceholder }}\" />\n </mat-form-field>\n</div>\n\n\n<!-- Row action menu -->\n<mat-menu #rowActionMenu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <button *ngFor=\"let rowAction of rowActions\" mat-menu-item class=\"row-action\"\n (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table -->\n<div *ngIf=\"rowCount > 0; else noData\" class=\"mad-table\">\n <div class=\"datatable-spinner-wrapper\" *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column-->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\">\n <th scope=\"col\" mat-header-cell *matHeaderCellDef class=\"row-action-button\">\n <!-- BATCH: master checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (change)=\"onToggleSelectAll()\"\n [checked]=\"allSelected\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE / NONE: nothing in header row -->\n </th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <!-- BATCH: row checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (click)=\"onRowCheckbox($event, element.rowId)\"\n [checked]=\"isSelected(element.rowId)\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE: row action menu icon -->\n <mad-icon-button\n *ngIf=\"mode === SINGLE\"\n [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"rowActionMenu\"\n >\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n <!-- NONE: nothing -->\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.label\">\n <ng-container *ngIf=\"column.isSortable; else noSort\">\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.label | translate}}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\" [ngSwitch]=\"column.transformer\">\n <span>\n {{ element[column.dataPropertyName] }}\n </span>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnNames\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnNames\"\n ></tr>\n </table>\n\n <!-- Pagination -->\n <mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (page)=\"onPaginationEvent($event)\"\n showFirstLastButtons\n >\n </mat-paginator>\n</div>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n <div class=\"datatable-spinner-wrapper\" *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n {{ noDataText }}\n </div>\n</ng-template>\n",
2273
- styles: [".text-right{padding-right:24px!important;text-align:right!important}.table-action{margin-bottom:.5em;margin-right:.5em}.row-action-button{width:10px}.noDataText{text-align:center}.mad-table,.noDataText{position:relative;width:100%}.mad-table{overflow-x:auto}.mad-datatable-action-bar{align-items:baseline;display:flex;justify-content:space-between}.mad-datatable-checkbox-container{margin-right:16px}.datatable-spinner-wrapper{align-items:center;background-color:#fff;display:flex;height:100%;justify-content:center;left:0;opacity:.8;pointer-events:unset;position:absolute;top:0;width:100%;z-index:99999}"]
2578
+ selector: 'mad-data-table',
2579
+ template: "<div class=\"mad-datatable-action-bar\">\n <!-- Table actions: displayed before the table -->\n <div *ngIf=\"tableActions?.length\">\n <mad-outline-button\n [disabled]=\"isDisabled(tableAction.type)\"\n class=\"table-action\"\n *ngFor=\"let tableAction of tableActions\"\n (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label | translate }} {{ getSelectedCount(tableAction.type) }}\n </mad-outline-button>\n </div>\n <!-- Table filter -->\n <mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel | translate }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"setFilterValue($event?.target?.value)\"\n placeholder=\"{{ filterPlaceholder }}\" />\n </mat-form-field>\n</div>\n\n\n<!-- Row action menu -->\n<mat-menu #rowActionMenu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <button *ngFor=\"let rowAction of rowActions\" mat-menu-item class=\"row-action\"\n (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- editable definition menu -->\n<mat-menu #editableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button *ngFor=\"let definition of editableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onColumnSettings(definition)\"\n [ngClass]=\"{'active-column-definition': isCurrentDefinition(definition)}\"\n >\n {{ definition.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- viewable definition menu -->\n<mat-menu #viewableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button *ngFor=\"let definition of viewableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onViewDefinition(definition)\"\n [ngClass]=\"{'active-column-definition': isCurrentDefinition(definition)}\"\n >\n {{ definition.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table -->\n<div *ngIf=\"rowCount > 0; else noData\" class=\"datatable\" [class]=\"tableClass\">\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column-->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\">\n <th scope=\"col\" mat-header-cell *matHeaderCellDef class=\"row-action-button\">\n <!-- BATCH: master checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (change)=\"onToggleSelectAll()\"\n [checked]=\"allSelected\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE / NONE: nothing in header row -->\n </th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <!-- BATCH: row checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (click)=\"onRowCheckbox($event, element.rowId)\"\n [checked]=\"isSelected(element.rowId)\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE: row action menu icon -->\n <mad-icon-button\n *ngIf=\"mode === SINGLE\"\n [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"rowActionMenu\"\n >\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n <!-- NONE: nothing -->\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.id\">\n <ng-container *ngIf=\"column.isSortable; else noSort\">\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.orderByName? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label | translate }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label | translate }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\" [ngSwitch]=\"column.transformer\">\n <span>\n {{ element[column.dataPropertyName] }}\n </span>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnIds\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnIds\"\n ></tr>\n </table>\n</div>\n<div class=\"mad-data-table-bottom-area\">\n <div class=\"mad-data-table-bottom-info-area\">\n <!-- column settings: 1 definition -->\n <mad-icon-button\n *ngIf=\"this.editableColumnDefinitions?.length == 1\"\n (click)=\"onColumnSettings()\"\n >\n <mat-icon class=\"material-icons-outlined\">view_column</mat-icon>\n </mad-icon-button>\n <!-- column settings: multiple definitions -->\n <mad-icon-button\n *ngIf=\"this.editableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"editableDefinitionMenu\"\n >\n <mat-icon>view_column</mat-icon>\n </mad-icon-button>\n <!-- column view: multiple definitions -->\n <mad-icon-button\n *ngIf=\"this.viewableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"viewableDefinitionMenu\"\n >\n <mat-icon>preview</mat-icon>\n </mad-icon-button>\n </div>\n\n <!-- Pagination -->\n <mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [length]=\"paginatorLength\"\n [pageIndex]=\"paginatorPageIndex\"\n [pageSize]=\"paginatorPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (page)=\"onPageEvent($event)\"\n showFirstLastButtons\n >\n </mat-paginator>\n</div>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n {{ noDataText }}\n </div>\n</ng-template>\n",
2580
+ styles: [":host{background-color:#fff;display:flex;flex:1 1 auto;flex-direction:column;min-height:112px}.datatable-vertical-stretch-to-parent{display:flex;flex:1;flex-direction:column;max-height:100%;width:100%}.datatable-max-height-500{max-height:500px}.datatable-max-height-300{max-height:300px}.datatable-max-height,.datatable-max-height-300,.datatable-max-height-500{display:flex;flex:1;flex-direction:column;width:100%}.datatable{flex:1 1 auto;height:100%;overflow:auto;position:relative;width:100%}.datatable table{max-height:100%;width:100%}.datatable td,.datatable th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:auto}.text-right{padding-right:24px!important;text-align:right!important}.table-action{margin-bottom:.5em;margin-right:.5em}.row-action-button{width:10px}.noDataText{position:relative;text-align:center;width:100%}.mad-datatable-action-bar{align-items:baseline;display:flex;justify-content:space-between}.mad-datatable-checkbox-container{margin-right:16px}.mad-datatable-spinner-wrapper{align-items:center;background-color:#fff;display:flex;height:100%;justify-content:center;left:0;opacity:.8;pointer-events:unset;position:absolute;top:0;width:100%;z-index:99999}.mad-data-table-bottom-area{display:flex;flex-direction:row}.mad-data-table-bottom-area .mad-data-table-bottom-info-area{display:flex;flex:1}.mat-header-row th{background-color:#fff;position:-webkit-sticky;position:sticky;top:0;z-index:1}.active-column-definition{background-color:#f5f5f5;color:#000}"]
2274
2581
  },] }
2275
2582
  ];
2583
+ DataTableComponent.ctorParameters = function () { return [
2584
+ { type: dialog.MatDialog }
2585
+ ]; };
2276
2586
  DataTableComponent.propDecorators = {
2277
- columns: [{ type: i0.Input }],
2278
2587
  filterLabel: [{ type: i0.Input }],
2279
2588
  filterPlaceholder: [{ type: i0.Input }],
2589
+ filterColumnsLabel: [{ type: i0.Input }],
2590
+ filterColumnsPlaceHolder: [{ type: i0.Input }],
2280
2591
  noDataText: [{ type: i0.Input }],
2592
+ columnSettingsModalTitleLabel: [{ type: i0.Input }],
2593
+ selectedLabel: [{ type: i0.Input }],
2594
+ availableLabel: [{ type: i0.Input }],
2595
+ saveLabel: [{ type: i0.Input }],
2596
+ deleteLabel: [{ type: i0.Input }],
2597
+ cancelLabel: [{ type: i0.Input }],
2598
+ infoTextLabel: [{ type: i0.Input }],
2599
+ tableClass: [{ type: i0.Input }],
2281
2600
  pageSizeOptions: [{ type: i0.Input }],
2282
- defaultPageSize: [{ type: i0.Input }],
2601
+ externalFilter: [{ type: i0.Input }],
2283
2602
  actions: [{ type: i0.Input }],
2284
2603
  idGenerator: [{ type: i0.Input }],
2604
+ deleteDefinitionAllowed: [{ type: i0.Input }],
2605
+ useAsync: [{ type: i0.Input }],
2606
+ displayedColumns: [{ type: i0.Input }],
2607
+ displayedColumnDefinition: [{ type: i0.Input }],
2285
2608
  tableData: [{ type: i0.Input }],
2609
+ page: [{ type: i0.Input }],
2610
+ columnDefinitions: [{ type: i0.Input }],
2286
2611
  loading: [{ type: i0.Input }],
2612
+ defaultPageSize: [{ type: i0.Input }],
2613
+ externalPaginator: [{ type: i0.Input }],
2287
2614
  paginationEnabled: [{ type: i0.Input }],
2615
+ allColumns: [{ type: i0.Input }],
2288
2616
  filterEnabled: [{ type: i0.Input }],
2289
2617
  forceMode: [{ type: i0.Input }],
2290
2618
  sortEvent: [{ type: i0.Output }],
2291
2619
  actionEvent: [{ type: i0.Output }],
2292
- pagingEvent: [{ type: i0.Output }],
2620
+ pageEvent: [{ type: i0.Output }],
2621
+ allColumnsEvent: [{ type: i0.Output }],
2622
+ columnDefinitionChangeEvent: [{ type: i0.Output }],
2623
+ viewDefinitionChangeEvent: [{ type: i0.Output }],
2293
2624
  paginator: [{ type: i0.ViewChild, args: [paginator.MatPaginator, { static: false },] }],
2294
2625
  sort: [{ type: i0.ViewChild, args: [sort.MatSort, { static: true },] }]
2295
2626
  };
@@ -2301,7 +2632,7 @@
2301
2632
  }());
2302
2633
  DataTableModule.decorators = [
2303
2634
  { type: i0.NgModule, args: [{
2304
- declarations: [DataTableComponent],
2635
+ declarations: [DataTableComponent, DataTableColumnsModalComponent],
2305
2636
  imports: [
2306
2637
  common.CommonModule,
2307
2638
  button.MatButtonModule,
@@ -2316,9 +2647,11 @@
2316
2647
  ButtonModule,
2317
2648
  i2.TranslateModule,
2318
2649
  checkbox.MatCheckboxModule,
2319
- badge.MatBadgeModule
2650
+ badge.MatBadgeModule,
2651
+ dragDrop.DragDropModule,
2652
+ forms.FormsModule,
2320
2653
  ],
2321
- exports: [DataTableComponent]
2654
+ exports: [DataTableComponent, DataTableColumnsModalComponent],
2322
2655
  },] }
2323
2656
  ];
2324
2657
 
@@ -2372,8 +2705,8 @@
2372
2705
  template: "<div\n class=\"header\"\n fxLayout=\"row\"\n fxLayoutGap=\"1em\"\n [style.background]=\"this.selected && !this.closed ? '#d8e2e9' : '#ffffff'\"\n [ngClass]=\"this.hasError ? 'error-border' : 'check-border'\"\n>\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",
2373
2706
  inputs: ['color'],
2374
2707
  host: {
2375
- 'class': 'mad-step-header',
2376
- 'role': 'tab',
2708
+ class: 'mad-step-header',
2709
+ role: 'tab',
2377
2710
  },
2378
2711
  encapsulation: i0.ViewEncapsulation.None,
2379
2712
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
@@ -2555,7 +2888,7 @@
2555
2888
  host: {
2556
2889
  '[class.stepper-vertical]': 'true',
2557
2890
  '[attr.aria-orientation]': '"vertical"',
2558
- 'role': 'tablist',
2891
+ role: 'tablist',
2559
2892
  },
2560
2893
  animations: [madStepperAnimations.verticalStepTransition],
2561
2894
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
@@ -2595,8 +2928,6 @@
2595
2928
  var ContentHeaderComponent = /** @class */ (function () {
2596
2929
  function ContentHeaderComponent() {
2597
2930
  }
2598
- ContentHeaderComponent.prototype.ngOnInit = function () {
2599
- };
2600
2931
  return ContentHeaderComponent;
2601
2932
  }());
2602
2933
  ContentHeaderComponent.decorators = [
@@ -2606,13 +2937,10 @@
2606
2937
  styles: [".content-header{padding-right:.5rem}"]
2607
2938
  },] }
2608
2939
  ];
2609
- ContentHeaderComponent.ctorParameters = function () { return []; };
2610
2940
 
2611
2941
  var ContentPanelContainerComponent = /** @class */ (function () {
2612
2942
  function ContentPanelContainerComponent() {
2613
2943
  }
2614
- ContentPanelContainerComponent.prototype.ngOnInit = function () {
2615
- };
2616
2944
  return ContentPanelContainerComponent;
2617
2945
  }());
2618
2946
  ContentPanelContainerComponent.decorators = [
@@ -2622,13 +2950,10 @@
2622
2950
  styles: [":host{display:flex;flex:1 1 auto;min-height:.05rem;overflow:hidden;position:relative}.content-panel-outer-wrapper{display:flex;flex:1 1 auto;flex-direction:column}"]
2623
2951
  },] }
2624
2952
  ];
2625
- ContentPanelContainerComponent.ctorParameters = function () { return []; };
2626
2953
 
2627
2954
  var ContentPanelContainerContentComponent = /** @class */ (function () {
2628
2955
  function ContentPanelContainerContentComponent() {
2629
2956
  }
2630
- ContentPanelContainerContentComponent.prototype.ngOnInit = function () {
2631
- };
2632
2957
  return ContentPanelContainerContentComponent;
2633
2958
  }());
2634
2959
  ContentPanelContainerContentComponent.decorators = [
@@ -2638,13 +2963,10 @@
2638
2963
  styles: [":host{border-top:.05rem solid #ccc;flex:1 1 auto;height:1rem;overflow-y:auto;padding:1rem}"]
2639
2964
  },] }
2640
2965
  ];
2641
- ContentPanelContainerContentComponent.ctorParameters = function () { return []; };
2642
2966
 
2643
2967
  var ContentPanelContainerFooterComponent = /** @class */ (function () {
2644
2968
  function ContentPanelContainerFooterComponent() {
2645
2969
  }
2646
- ContentPanelContainerFooterComponent.prototype.ngOnInit = function () {
2647
- };
2648
2970
  return ContentPanelContainerFooterComponent;
2649
2971
  }());
2650
2972
  ContentPanelContainerFooterComponent.decorators = [
@@ -2654,13 +2976,10 @@
2654
2976
  styles: [":host{align-items:center;border-top:.05rem solid #ccc;display:flex;flex:0 0 auto;min-height:2rem;padding:.25rem 1rem}"]
2655
2977
  },] }
2656
2978
  ];
2657
- ContentPanelContainerFooterComponent.ctorParameters = function () { return []; };
2658
2979
 
2659
2980
  var MainContainerComponent = /** @class */ (function () {
2660
2981
  function MainContainerComponent() {
2661
2982
  }
2662
- MainContainerComponent.prototype.ngOnInit = function () {
2663
- };
2664
2983
  return MainContainerComponent;
2665
2984
  }());
2666
2985
  MainContainerComponent.decorators = [
@@ -2670,7 +2989,6 @@
2670
2989
  styles: [".main-container{display:flex;flex-direction:column;height:100%}"]
2671
2990
  },] }
2672
2991
  ];
2673
- MainContainerComponent.ctorParameters = function () { return []; };
2674
2992
 
2675
2993
  var ContentPanelModule = /** @class */ (function () {
2676
2994
  function ContentPanelModule() {
@@ -2708,18 +3026,29 @@
2708
3026
  */
2709
3027
  this._headerClick = new i0.EventEmitter(true);
2710
3028
  }
3029
+ Object.defineProperty(FlowbarComponent.prototype, "currentStepLabel", {
3030
+ get: function () {
3031
+ return this._activeStep.label;
3032
+ },
3033
+ enumerable: false,
3034
+ configurable: true
3035
+ });
3036
+ Object.defineProperty(FlowbarComponent.prototype, "currentSubStepLabel", {
3037
+ get: function () {
3038
+ var _a;
3039
+ return (_a = this._activeStep.activeSubStep) === null || _a === void 0 ? void 0 : _a.label;
3040
+ },
3041
+ enumerable: false,
3042
+ configurable: true
3043
+ });
2711
3044
  FlowbarComponent.prototype.ngOnInit = function () {
2712
3045
  // If no active step is set as input or the active step is not enabled, select the first enabled step
2713
3046
  if (!this._activeStep || !this._activeStep.enabled) {
2714
- this._activeStep = this._steps.find(function (step) {
2715
- return step.enabled;
2716
- });
3047
+ this._activeStep = this._steps.find(function (step) { return step.enabled; });
2717
3048
  if (this._activeStep) {
2718
3049
  // If sub steps exist then set the first non disabled sub step per default
2719
3050
  if (this.activeTabHasSubSteps()) {
2720
- this._activeStep.activeSubStep = this._activeStep.subSteps.find(function (step) {
2721
- return step.enabled;
2722
- });
3051
+ this._activeStep.activeSubStep = this._activeStep.subSteps.find(function (step) { return step.enabled; });
2723
3052
  }
2724
3053
  this._activeStepChange.emit(this._activeStep);
2725
3054
  }
@@ -2818,15 +3147,11 @@
2818
3147
  };
2819
3148
  FlowbarComponent.prototype.getCurrentIndex = function () {
2820
3149
  var _this = this;
2821
- return this._steps.findIndex(function (value) {
2822
- return value === _this._activeStep;
2823
- });
3150
+ return this._steps.findIndex(function (value) { return value === _this._activeStep; });
2824
3151
  };
2825
3152
  FlowbarComponent.prototype.getCurrentSubStepIndex = function () {
2826
3153
  var _this = this;
2827
- return this._activeStep.subSteps.findIndex(function (value) {
2828
- return value === _this._activeStep.activeSubStep;
2829
- });
3154
+ return this._activeStep.subSteps.findIndex(function (value) { return value === _this._activeStep.activeSubStep; });
2830
3155
  };
2831
3156
  FlowbarComponent.prototype.triggerClick = function () {
2832
3157
  var selectedStep = this._steps[this.stepper.selectedIndex];
@@ -2836,21 +3161,6 @@
2836
3161
  event.stopPropagation(); //stop processing current header click event
2837
3162
  this._headerClick.emit(step);
2838
3163
  };
2839
- Object.defineProperty(FlowbarComponent.prototype, "currentStepLabel", {
2840
- get: function () {
2841
- return this._activeStep.label;
2842
- },
2843
- enumerable: false,
2844
- configurable: true
2845
- });
2846
- Object.defineProperty(FlowbarComponent.prototype, "currentSubStepLabel", {
2847
- get: function () {
2848
- var _a;
2849
- return (_a = this._activeStep.activeSubStep) === null || _a === void 0 ? void 0 : _a.label;
2850
- },
2851
- enumerable: false,
2852
- configurable: true
2853
- });
2854
3164
  FlowbarComponent.prototype.activeTabHasSubSteps = function () {
2855
3165
  return this._activeStep.subSteps && this._activeStep.subSteps.length > 0;
2856
3166
  };
@@ -2889,11 +3199,11 @@
2889
3199
  },] }
2890
3200
  ];
2891
3201
  FlowbarComponent.propDecorators = {
2892
- stepper: [{ type: i0.ViewChild, args: ['stepper',] }],
2893
3202
  _steps: [{ type: i0.Input, args: ['steps',] }],
2894
3203
  _activeStep: [{ type: i0.Input, args: ['activeStep',] }],
2895
3204
  _activeStepChange: [{ type: i0.Output, args: ['activeStepChange',] }],
2896
- _headerClick: [{ type: i0.Output, args: ['headerClick',] }]
3205
+ _headerClick: [{ type: i0.Output, args: ['headerClick',] }],
3206
+ stepper: [{ type: i0.ViewChild, args: ['stepper',] }]
2897
3207
  };
2898
3208
 
2899
3209
  var FlowbarModule = /** @class */ (function () {
@@ -2968,19 +3278,20 @@
2968
3278
  exports.ToolbarModule = ToolbarModule;
2969
3279
  exports.ToolbarService = ToolbarService;
2970
3280
  exports.madStepperAnimations = madStepperAnimations;
2971
- exports.ɵa = PrimaryButtonComponent;
2972
- exports.ɵb = MadBasicButton;
2973
- exports.ɵc = OutlineButtonComponent;
2974
- exports.ɵd = LinkButtonComponent;
2975
- exports.ɵe = DangerButtonComponent;
2976
- exports.ɵf = IconButtonComponent;
2977
- exports.ɵg = NumericFieldDirective;
2978
- exports.ɵh = CardComponent;
2979
- exports.ɵi = QuickListComponent;
2980
- exports.ɵj = BaseQuickListComponent;
2981
- exports.ɵk = QuickListCompactComponent;
2982
- exports.ɵl = TableComponent;
2983
- exports.ɵm = DataTableComponent;
3281
+ exports.ɵb = PrimaryButtonComponent;
3282
+ exports.ɵc = MadBasicButton;
3283
+ exports.ɵd = OutlineButtonComponent;
3284
+ exports.ɵe = LinkButtonComponent;
3285
+ exports.ɵf = DangerButtonComponent;
3286
+ exports.ɵg = IconButtonComponent;
3287
+ exports.ɵh = NumericFieldDirective;
3288
+ exports.ɵi = CardComponent;
3289
+ exports.ɵj = QuickListComponent;
3290
+ exports.ɵk = BaseQuickListComponent;
3291
+ exports.ɵl = QuickListCompactComponent;
3292
+ exports.ɵm = TableComponent;
3293
+ exports.ɵn = DataTableComponent;
3294
+ exports.ɵo = DataTableColumnsModalComponent;
2984
3295
 
2985
3296
  Object.defineProperty(exports, '__esModule', { value: true });
2986
3297