@porscheinformatik/material-addons 10.3.4 → 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 (70) hide show
  1. package/bundles/porscheinformatik-material-addons.umd.js +506 -198
  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/table.component.js +6 -6
  39. package/esm2015/lib/throttle-click/throttle-click.directive.js +6 -7
  40. package/esm2015/lib/toolbar/toolbar-action.interface.js +1 -1
  41. package/esm2015/lib/toolbar/toolbar.component.js +3 -3
  42. package/esm2015/lib/toolbar/toolbar.module.js +2 -2
  43. package/esm2015/lib/toolbar/toolbar.service.js +7 -7
  44. package/esm2015/porscheinformatik-material-addons.js +15 -14
  45. package/fesm2015/porscheinformatik-material-addons.js +402 -151
  46. package/fesm2015/porscheinformatik-material-addons.js.map +1 -1
  47. package/lib/button/mad-basic-button.d.ts +4 -4
  48. package/lib/content-panel/content-header/content-header.component.d.ts +1 -4
  49. package/lib/content-panel/content-panel-container/content-panel-container.component.d.ts +1 -4
  50. package/lib/content-panel/content-panel-container-content/content-panel-container-content.component.d.ts +1 -4
  51. package/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.d.ts +1 -4
  52. package/lib/content-panel/main-container/main-container.component.d.ts +1 -4
  53. package/lib/data-table/data-table-action.d.ts +1 -1
  54. package/lib/data-table/data-table-column-definition.d.ts +26 -0
  55. package/lib/data-table/{data-table-column-header.d.ts → data-table-column.d.ts} +3 -1
  56. package/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.d.ts +23 -0
  57. package/lib/data-table/data-table.component.d.ts +68 -20
  58. package/lib/data-table/data-table.d.ts +2 -1
  59. package/lib/flowbar/flowbar.component.d.ts +3 -3
  60. package/lib/readonly/readonly-form-field-wrapper/readonly-form-field-wrapper.component.d.ts +11 -11
  61. package/lib/stepper/step-header/step-header.component.d.ts +2 -2
  62. package/lib/table/table.component.d.ts +4 -4
  63. package/lib/throttle-click/throttle-click.directive.d.ts +1 -2
  64. package/lib/toolbar/toolbar-action.interface.d.ts +1 -1
  65. package/lib/toolbar/toolbar.service.d.ts +2 -2
  66. package/package.json +1 -1
  67. package/porscheinformatik-material-addons.d.ts +15 -13
  68. package/porscheinformatik-material-addons.metadata.json +1 -1
  69. package/themes/common/styles.scss +6 -0
  70. 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,9 +1169,9 @@
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
1175
  };
1176
1176
  ToolbarComponent.prototype.hasImportantToolbarActions = function () {
1177
1177
  return this.getToolbarActions().filter(function (value) { return !!value.importantAction; }).length > 0;
@@ -1554,14 +1554,20 @@
1554
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",
1555
1555
  animations: [
1556
1556
  animations.trigger('collapseExpandAnimation', [
1557
- 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({
1558
1560
  opacity: 1,
1559
- height: '*'
1560
- }))]),
1561
- 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({
1562
1567
  opacity: 0,
1563
- height: 0
1564
- }))]),
1568
+ height: 0,
1569
+ })),
1570
+ ]),
1565
1571
  ]),
1566
1572
  animations.trigger('rotateIcon', [
1567
1573
  animations.state('true', animations.style({ transform: 'rotate(0)' })),
@@ -1598,6 +1604,11 @@
1598
1604
  this.throttleClick = new i0.EventEmitter();
1599
1605
  this.clicks = new rxjs.Subject();
1600
1606
  }
1607
+ ThrottleClickDirective.prototype.clickEvent = function (event) {
1608
+ event.preventDefault();
1609
+ event.stopPropagation();
1610
+ this.clicks.next(event);
1611
+ };
1601
1612
  ThrottleClickDirective.prototype.ngOnInit = function () {
1602
1613
  var _this = this;
1603
1614
  this.subscription = this.clicks.pipe(operators.throttleTime(this.throttleTime)).subscribe(function (e) { return _this.throttleClick.emit(e); });
@@ -1605,11 +1616,6 @@
1605
1616
  ThrottleClickDirective.prototype.ngOnDestroy = function () {
1606
1617
  this.subscription.unsubscribe();
1607
1618
  };
1608
- ThrottleClickDirective.prototype.clickEvent = function (event) {
1609
- event.preventDefault();
1610
- event.stopPropagation();
1611
- this.clicks.next(event);
1612
- };
1613
1619
  return ThrottleClickDirective;
1614
1620
  }());
1615
1621
  ThrottleClickDirective.decorators = [
@@ -1617,7 +1623,6 @@
1617
1623
  selector: '[madThrottleClick]',
1618
1624
  },] }
1619
1625
  ];
1620
- ThrottleClickDirective.ctorParameters = function () { return []; };
1621
1626
  ThrottleClickDirective.propDecorators = {
1622
1627
  throttleTime: [{ type: i0.Input }],
1623
1628
  throttleClick: [{ type: i0.Output }],
@@ -1795,7 +1800,6 @@
1795
1800
  var TableComponent = /** @class */ (function () {
1796
1801
  function TableComponent() {
1797
1802
  var _a;
1798
- this.ACTION_COLUMN_NAME = '__action__';
1799
1803
  this.columns = [];
1800
1804
  this.filterLabel = 'NOT SET';
1801
1805
  this.filterPlaceholder = 'NOT SET';
@@ -1806,6 +1810,7 @@
1806
1810
  this.tableAction = new i0.EventEmitter();
1807
1811
  this.rowAction = new i0.EventEmitter();
1808
1812
  this.sortEvent = new i0.EventEmitter();
1813
+ this.ACTION_COLUMN_NAME = '__action__';
1809
1814
  this.isFilterEnabled = false;
1810
1815
  this.isPaginationEnabled = false;
1811
1816
  }
@@ -1898,14 +1903,14 @@
1898
1903
  defaultPageSize: [{ type: i0.Input }],
1899
1904
  rowActions: [{ type: i0.Input }],
1900
1905
  tableActions: [{ type: i0.Input }],
1901
- displayedData: [{ type: i0.Input }],
1902
- paginationEnabled: [{ type: i0.Input }],
1903
- filterEnabled: [{ type: i0.Input }],
1904
1906
  tableAction: [{ type: i0.Output }],
1905
1907
  rowAction: [{ type: i0.Output }],
1906
1908
  sortEvent: [{ type: i0.Output }],
1907
1909
  paginator: [{ type: i0.ViewChild, args: [paginator.MatPaginator, { static: false },] }],
1908
- 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 }]
1909
1914
  };
1910
1915
 
1911
1916
  var TableModule = /** @class */ (function () {
@@ -1937,39 +1942,182 @@
1937
1942
  }
1938
1943
  return DataTableActionType;
1939
1944
  }());
1940
- DataTableActionType.SINGLE = "SINGLE";
1941
- DataTableActionType.BATCH = "BATCH";
1942
- DataTableActionType.NONE = "NONE";
1945
+ DataTableActionType.SINGLE = 'SINGLE';
1946
+ DataTableActionType.BATCH = 'BATCH';
1947
+ DataTableActionType.NONE = 'NONE';
1943
1948
 
1944
- var DataTableComponent = /** @class */ (function () {
1945
- 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;
1946
2013
  var _a;
1947
- this.ACTION_COLUMN_NAME = "__action__";
1948
- this.SINGLE = DataTableActionType.SINGLE;
1949
- this.BATCH = DataTableActionType.BATCH;
1950
- this.NONE = DataTableActionType.NONE;
1951
- this.columns = [];
1952
- this.filterLabel = "Filter";
1953
- this.filterPlaceholder = "";
1954
- 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.';
1955
2068
  this.pageSizeOptions = [5, 10, 15];
1956
- this.defaultPageSize = ((_a = this.pageSizeOptions) === null || _a === void 0 ? void 0 : _a[0]) || 10;
1957
2069
  this.actions = [];
2070
+ this.deleteDefinitionAllowed = false;
2071
+ this.useAsync = false;
1958
2072
  this.sortEvent = new i0.EventEmitter();
1959
2073
  this.actionEvent = new i0.EventEmitter();
1960
- 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;
1961
2082
  this.tableActions = [];
1962
2083
  this.rowActions = [];
2084
+ this.columns = [];
1963
2085
  this.allSelected = false;
1964
2086
  this.displayedDataMap = new Map();
1965
2087
  this.actualDataMap = new Map();
1966
2088
  this.selectionModel = new collections.SelectionModel(true);
2089
+ this.allColumnDefinitions = [];
1967
2090
  this.isFilterEnabled = false;
1968
2091
  this.isPaginationEnabled = false;
1969
2092
  this.mode = this.NONE;
1970
2093
  this.isRowClickable = false;
2094
+ this.showColumnModal = false;
1971
2095
  this.isLoading = false;
2096
+ this.paginatorLength = 0;
2097
+ this.paginatorPageIndex = 0;
2098
+ this.paginatorPageSize = 50;
1972
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
+ });
1973
2121
  Object.defineProperty(DataTableComponent.prototype, "tableData", {
1974
2122
  set: function (data) {
1975
2123
  if (!this.dataSource) {
@@ -1980,6 +2128,44 @@
1980
2128
  enumerable: false,
1981
2129
  configurable: true
1982
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
+ });
1983
2169
  Object.defineProperty(DataTableComponent.prototype, "loading", {
1984
2170
  set: function (isLoading) {
1985
2171
  this.isLoading = isLoading;
@@ -1987,13 +2173,33 @@
1987
2173
  enumerable: false,
1988
2174
  configurable: true
1989
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
+ });
1990
2190
  Object.defineProperty(DataTableComponent.prototype, "paginationEnabled", {
1991
2191
  set: function (isPaginationEnabled) {
1992
2192
  this.isPaginationEnabled = isPaginationEnabled;
1993
- // eslint-disable-next-line
1994
- var pageSize = this.isPaginationEnabled ? this.defaultPageSize : Number.MAX_VALUE;
1995
- if (this.dataSource.paginator) {
1996
- 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();
1997
2203
  }
1998
2204
  },
1999
2205
  enumerable: false,
@@ -2001,7 +2207,7 @@
2001
2207
  });
2002
2208
  Object.defineProperty(DataTableComponent.prototype, "filterEnabled", {
2003
2209
  set: function (isFilterEnabled) {
2004
- this.isFilterEnabled = isFilterEnabled;
2210
+ this.isFilterEnabled = !this.useAsync ? isFilterEnabled : false;
2005
2211
  this.setFilterValue(undefined);
2006
2212
  },
2007
2213
  enumerable: false,
@@ -2018,20 +2224,84 @@
2018
2224
  enumerable: false,
2019
2225
  configurable: true
2020
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
+ };
2021
2275
  DataTableComponent.prototype.ngOnInit = function () {
2022
- this.columnNames = this.columns.map(function (column) { return column.label; });
2023
2276
  this.mode = this.getTableMode();
2024
2277
  this.setActions();
2025
2278
  if (this.mode !== this.NONE) {
2026
2279
  this.isRowClickable = true;
2027
2280
  this.defaultAction = this.rowActions[0];
2028
2281
  }
2029
- this.columnNames.unshift(this.ACTION_COLUMN_NAME);
2030
2282
  };
2031
2283
  DataTableComponent.prototype.ngAfterViewInit = function () {
2032
2284
  this.dataSource.paginator = this.paginator;
2033
2285
  this.dataSource.sort = this.sort;
2034
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
+ };
2035
2305
  Object.defineProperty(DataTableComponent.prototype, "selectedCount", {
2036
2306
  get: function () {
2037
2307
  var _a;
@@ -2042,23 +2312,26 @@
2042
2312
  });
2043
2313
  Object.defineProperty(DataTableComponent.prototype, "rowCount", {
2044
2314
  get: function () {
2045
- var _a;
2046
- 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;
2047
2316
  },
2048
2317
  enumerable: false,
2049
2318
  configurable: true
2050
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
+ };
2051
2324
  DataTableComponent.prototype.getSelectedCount = function (actionType) {
2052
2325
  var count = this.selectedCount;
2053
- if (actionType != this.BATCH || count < 2) {
2054
- return "";
2326
+ if (actionType !== this.BATCH || count < 2) {
2327
+ return '';
2055
2328
  }
2056
- return " (" + count + ")";
2329
+ return ' (' + count + ')';
2057
2330
  };
2058
2331
  DataTableComponent.prototype.isDisabled = function (actionType) {
2059
2332
  switch (actionType) {
2060
2333
  case this.SINGLE:
2061
- return this.selectedCount != 1;
2334
+ return this.selectedCount !== 1;
2062
2335
  case this.BATCH:
2063
2336
  return this.selectedCount < 1;
2064
2337
  default:
@@ -2073,10 +2346,8 @@
2073
2346
  this.allSelected = !this.allSelected;
2074
2347
  if (this.allSelected) {
2075
2348
  // select all rows of the current page
2076
- this.dataSource._pageData(this.dataSource.data).forEach(function (row) {
2077
- var dataRow = row;
2078
- var rowId = "" + dataRow.rowId;
2079
- _this.selectionModel.select(rowId);
2349
+ this.getAllDataSourceRowsOfCurrentPage().forEach(function (row) {
2350
+ _this.selectionModel.select('' + row.rowId);
2080
2351
  });
2081
2352
  }
2082
2353
  };
@@ -2110,14 +2381,21 @@
2110
2381
  return;
2111
2382
  }
2112
2383
  };
2113
- DataTableComponent.prototype.onSortingEvent = function (sortingParams) {
2114
- 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
+ }
2115
2391
  };
2116
- DataTableComponent.prototype.onPaginationEvent = function (event) {
2117
- this.pagingEvent.emit(event);
2392
+ DataTableComponent.prototype.onPageEvent = function (event) {
2393
+ if (this.useAsync) {
2394
+ this.pageEvent.emit(event);
2395
+ }
2118
2396
  };
2119
2397
  DataTableComponent.prototype.onTableAction = function (tableAction) {
2120
- var e_1, _b;
2398
+ var e_2, _b;
2121
2399
  if (!!tableAction) {
2122
2400
  var selection = [];
2123
2401
  try {
@@ -2126,30 +2404,17 @@
2126
2404
  selection.push(this.idGenerator ? selected : this.actualDataMap.get(selected));
2127
2405
  }
2128
2406
  }
2129
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2407
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
2130
2408
  finally {
2131
2409
  try {
2132
2410
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2133
2411
  }
2134
- finally { if (e_1) throw e_1.error; }
2412
+ finally { if (e_2) throw e_2.error; }
2135
2413
  }
2136
2414
  tableAction.selected = selection;
2137
2415
  this.actionEvent.emit(tableAction);
2138
2416
  }
2139
2417
  };
2140
- DataTableComponent.transformData = function (value, transformer, transformerParams) {
2141
- if (!transformer || !(transformer instanceof Function)) {
2142
- return value;
2143
- }
2144
- return transformer(value, transformerParams);
2145
- };
2146
- DataTableComponent.generateRowId = function () {
2147
- return uuid.v4();
2148
- };
2149
- DataTableComponent.isClickOnRowMenuIcon = function (event) {
2150
- var _a;
2151
- return (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.classList.contains("mat-icon");
2152
- };
2153
2418
  DataTableComponent.prototype.emitTableAction = function (action, selected) {
2154
2419
  var emitAction = Object.assign({}, action);
2155
2420
  if (action.type !== this.NONE) {
@@ -2158,9 +2423,9 @@
2158
2423
  this.actionEvent.emit(emitAction);
2159
2424
  };
2160
2425
  DataTableComponent.prototype.generateDisplayedDataElement = function (rowId, actualDataElement) {
2161
- var e_2, _b;
2426
+ var e_3, _b;
2162
2427
  var displayedDataElement = {};
2163
- displayedDataElement["rowId"] = rowId;
2428
+ displayedDataElement.rowId = rowId;
2164
2429
  try {
2165
2430
  for (var _c = __values(this.columns), _d = _c.next(); !_d.done; _d = _c.next()) {
2166
2431
  var column = _d.value;
@@ -2168,17 +2433,21 @@
2168
2433
  displayedDataElement[column.dataPropertyName] = DataTableComponent.transformData(actualValue, column.transformer, column.transformerParams);
2169
2434
  }
2170
2435
  }
2171
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
2436
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
2172
2437
  finally {
2173
2438
  try {
2174
2439
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2175
2440
  }
2176
- finally { if (e_2) throw e_2.error; }
2441
+ finally { if (e_3) throw e_3.error; }
2177
2442
  }
2178
2443
  return displayedDataElement;
2179
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
+ };
2180
2449
  DataTableComponent.prototype.setActions = function () {
2181
- var e_3, _b;
2450
+ var e_4, _b;
2182
2451
  this.rowActions = [];
2183
2452
  this.tableActions = [];
2184
2453
  try {
@@ -2205,40 +2474,68 @@
2205
2474
  }
2206
2475
  }
2207
2476
  }
2208
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
2477
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
2209
2478
  finally {
2210
2479
  try {
2211
2480
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2212
2481
  }
2213
- finally { if (e_3) throw e_3.error; }
2482
+ finally { if (e_4) throw e_4.error; }
2214
2483
  }
2215
2484
  };
2216
2485
  DataTableComponent.prototype.createDataMapsAndSetDisplayedDataSourceData = function (data) {
2217
- var e_4, _b;
2486
+ var e_5, _b;
2218
2487
  var displayedDataList = [];
2219
2488
  this.actualDataMap.clear();
2220
2489
  this.displayedDataMap.clear();
2221
- try {
2222
- for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
2223
- var dataEntry = data_1_1.value;
2224
- var rowId = (this.idGenerator) ? this.idGenerator(dataEntry) : DataTableComponent.generateRowId();
2225
- this.actualDataMap.set(rowId, dataEntry);
2226
- var displayedDataElement = this.generateDisplayedDataElement(rowId, dataEntry);
2227
- this.displayedDataMap.set(rowId, displayedDataElement);
2228
- displayedDataList.push(displayedDataElement);
2229
- }
2230
- }
2231
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
2232
- finally {
2490
+ if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
2233
2491
  try {
2234
- 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; }
2235
2507
  }
2236
- finally { if (e_4) throw e_4.error; }
2237
2508
  }
2238
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
+ });
2239
2536
  };
2240
2537
  DataTableComponent.prototype.getTableMode = function () {
2241
- var e_5, _b;
2538
+ var e_6, _b;
2242
2539
  if (this._forceMode) {
2243
2540
  return this._forceMode;
2244
2541
  }
@@ -2252,12 +2549,12 @@
2252
2549
  distinctActionTypes.add(rowAction.type);
2253
2550
  }
2254
2551
  }
2255
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
2552
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
2256
2553
  finally {
2257
2554
  try {
2258
2555
  if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2259
2556
  }
2260
- finally { if (e_5) throw e_5.error; }
2557
+ finally { if (e_6) throw e_6.error; }
2261
2558
  }
2262
2559
  if (distinctActionTypes.has(this.BATCH)) {
2263
2560
  return this.BATCH;
@@ -2267,32 +2564,63 @@
2267
2564
  }
2268
2565
  return this.NONE;
2269
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
+ };
2270
2574
  return DataTableComponent;
2271
2575
  }());
2272
2576
  DataTableComponent.decorators = [
2273
2577
  { type: i0.Component, args: [{
2274
- selector: "mad-data-table",
2275
- 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",
2276
- 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}"]
2277
2581
  },] }
2278
2582
  ];
2583
+ DataTableComponent.ctorParameters = function () { return [
2584
+ { type: dialog.MatDialog }
2585
+ ]; };
2279
2586
  DataTableComponent.propDecorators = {
2280
- columns: [{ type: i0.Input }],
2281
2587
  filterLabel: [{ type: i0.Input }],
2282
2588
  filterPlaceholder: [{ type: i0.Input }],
2589
+ filterColumnsLabel: [{ type: i0.Input }],
2590
+ filterColumnsPlaceHolder: [{ type: i0.Input }],
2283
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 }],
2284
2600
  pageSizeOptions: [{ type: i0.Input }],
2285
- defaultPageSize: [{ type: i0.Input }],
2601
+ externalFilter: [{ type: i0.Input }],
2286
2602
  actions: [{ type: i0.Input }],
2287
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 }],
2288
2608
  tableData: [{ type: i0.Input }],
2609
+ page: [{ type: i0.Input }],
2610
+ columnDefinitions: [{ type: i0.Input }],
2289
2611
  loading: [{ type: i0.Input }],
2612
+ defaultPageSize: [{ type: i0.Input }],
2613
+ externalPaginator: [{ type: i0.Input }],
2290
2614
  paginationEnabled: [{ type: i0.Input }],
2615
+ allColumns: [{ type: i0.Input }],
2291
2616
  filterEnabled: [{ type: i0.Input }],
2292
2617
  forceMode: [{ type: i0.Input }],
2293
2618
  sortEvent: [{ type: i0.Output }],
2294
2619
  actionEvent: [{ type: i0.Output }],
2295
- pagingEvent: [{ type: i0.Output }],
2620
+ pageEvent: [{ type: i0.Output }],
2621
+ allColumnsEvent: [{ type: i0.Output }],
2622
+ columnDefinitionChangeEvent: [{ type: i0.Output }],
2623
+ viewDefinitionChangeEvent: [{ type: i0.Output }],
2296
2624
  paginator: [{ type: i0.ViewChild, args: [paginator.MatPaginator, { static: false },] }],
2297
2625
  sort: [{ type: i0.ViewChild, args: [sort.MatSort, { static: true },] }]
2298
2626
  };
@@ -2304,7 +2632,7 @@
2304
2632
  }());
2305
2633
  DataTableModule.decorators = [
2306
2634
  { type: i0.NgModule, args: [{
2307
- declarations: [DataTableComponent],
2635
+ declarations: [DataTableComponent, DataTableColumnsModalComponent],
2308
2636
  imports: [
2309
2637
  common.CommonModule,
2310
2638
  button.MatButtonModule,
@@ -2319,9 +2647,11 @@
2319
2647
  ButtonModule,
2320
2648
  i2.TranslateModule,
2321
2649
  checkbox.MatCheckboxModule,
2322
- badge.MatBadgeModule
2650
+ badge.MatBadgeModule,
2651
+ dragDrop.DragDropModule,
2652
+ forms.FormsModule,
2323
2653
  ],
2324
- exports: [DataTableComponent]
2654
+ exports: [DataTableComponent, DataTableColumnsModalComponent],
2325
2655
  },] }
2326
2656
  ];
2327
2657
 
@@ -2375,8 +2705,8 @@
2375
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",
2376
2706
  inputs: ['color'],
2377
2707
  host: {
2378
- 'class': 'mad-step-header',
2379
- 'role': 'tab',
2708
+ class: 'mad-step-header',
2709
+ role: 'tab',
2380
2710
  },
2381
2711
  encapsulation: i0.ViewEncapsulation.None,
2382
2712
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
@@ -2558,7 +2888,7 @@
2558
2888
  host: {
2559
2889
  '[class.stepper-vertical]': 'true',
2560
2890
  '[attr.aria-orientation]': '"vertical"',
2561
- 'role': 'tablist',
2891
+ role: 'tablist',
2562
2892
  },
2563
2893
  animations: [madStepperAnimations.verticalStepTransition],
2564
2894
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
@@ -2598,8 +2928,6 @@
2598
2928
  var ContentHeaderComponent = /** @class */ (function () {
2599
2929
  function ContentHeaderComponent() {
2600
2930
  }
2601
- ContentHeaderComponent.prototype.ngOnInit = function () {
2602
- };
2603
2931
  return ContentHeaderComponent;
2604
2932
  }());
2605
2933
  ContentHeaderComponent.decorators = [
@@ -2609,13 +2937,10 @@
2609
2937
  styles: [".content-header{padding-right:.5rem}"]
2610
2938
  },] }
2611
2939
  ];
2612
- ContentHeaderComponent.ctorParameters = function () { return []; };
2613
2940
 
2614
2941
  var ContentPanelContainerComponent = /** @class */ (function () {
2615
2942
  function ContentPanelContainerComponent() {
2616
2943
  }
2617
- ContentPanelContainerComponent.prototype.ngOnInit = function () {
2618
- };
2619
2944
  return ContentPanelContainerComponent;
2620
2945
  }());
2621
2946
  ContentPanelContainerComponent.decorators = [
@@ -2625,13 +2950,10 @@
2625
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}"]
2626
2951
  },] }
2627
2952
  ];
2628
- ContentPanelContainerComponent.ctorParameters = function () { return []; };
2629
2953
 
2630
2954
  var ContentPanelContainerContentComponent = /** @class */ (function () {
2631
2955
  function ContentPanelContainerContentComponent() {
2632
2956
  }
2633
- ContentPanelContainerContentComponent.prototype.ngOnInit = function () {
2634
- };
2635
2957
  return ContentPanelContainerContentComponent;
2636
2958
  }());
2637
2959
  ContentPanelContainerContentComponent.decorators = [
@@ -2641,13 +2963,10 @@
2641
2963
  styles: [":host{border-top:.05rem solid #ccc;flex:1 1 auto;height:1rem;overflow-y:auto;padding:1rem}"]
2642
2964
  },] }
2643
2965
  ];
2644
- ContentPanelContainerContentComponent.ctorParameters = function () { return []; };
2645
2966
 
2646
2967
  var ContentPanelContainerFooterComponent = /** @class */ (function () {
2647
2968
  function ContentPanelContainerFooterComponent() {
2648
2969
  }
2649
- ContentPanelContainerFooterComponent.prototype.ngOnInit = function () {
2650
- };
2651
2970
  return ContentPanelContainerFooterComponent;
2652
2971
  }());
2653
2972
  ContentPanelContainerFooterComponent.decorators = [
@@ -2657,13 +2976,10 @@
2657
2976
  styles: [":host{align-items:center;border-top:.05rem solid #ccc;display:flex;flex:0 0 auto;min-height:2rem;padding:.25rem 1rem}"]
2658
2977
  },] }
2659
2978
  ];
2660
- ContentPanelContainerFooterComponent.ctorParameters = function () { return []; };
2661
2979
 
2662
2980
  var MainContainerComponent = /** @class */ (function () {
2663
2981
  function MainContainerComponent() {
2664
2982
  }
2665
- MainContainerComponent.prototype.ngOnInit = function () {
2666
- };
2667
2983
  return MainContainerComponent;
2668
2984
  }());
2669
2985
  MainContainerComponent.decorators = [
@@ -2673,7 +2989,6 @@
2673
2989
  styles: [".main-container{display:flex;flex-direction:column;height:100%}"]
2674
2990
  },] }
2675
2991
  ];
2676
- MainContainerComponent.ctorParameters = function () { return []; };
2677
2992
 
2678
2993
  var ContentPanelModule = /** @class */ (function () {
2679
2994
  function ContentPanelModule() {
@@ -2711,18 +3026,29 @@
2711
3026
  */
2712
3027
  this._headerClick = new i0.EventEmitter(true);
2713
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
+ });
2714
3044
  FlowbarComponent.prototype.ngOnInit = function () {
2715
3045
  // If no active step is set as input or the active step is not enabled, select the first enabled step
2716
3046
  if (!this._activeStep || !this._activeStep.enabled) {
2717
- this._activeStep = this._steps.find(function (step) {
2718
- return step.enabled;
2719
- });
3047
+ this._activeStep = this._steps.find(function (step) { return step.enabled; });
2720
3048
  if (this._activeStep) {
2721
3049
  // If sub steps exist then set the first non disabled sub step per default
2722
3050
  if (this.activeTabHasSubSteps()) {
2723
- this._activeStep.activeSubStep = this._activeStep.subSteps.find(function (step) {
2724
- return step.enabled;
2725
- });
3051
+ this._activeStep.activeSubStep = this._activeStep.subSteps.find(function (step) { return step.enabled; });
2726
3052
  }
2727
3053
  this._activeStepChange.emit(this._activeStep);
2728
3054
  }
@@ -2821,15 +3147,11 @@
2821
3147
  };
2822
3148
  FlowbarComponent.prototype.getCurrentIndex = function () {
2823
3149
  var _this = this;
2824
- return this._steps.findIndex(function (value) {
2825
- return value === _this._activeStep;
2826
- });
3150
+ return this._steps.findIndex(function (value) { return value === _this._activeStep; });
2827
3151
  };
2828
3152
  FlowbarComponent.prototype.getCurrentSubStepIndex = function () {
2829
3153
  var _this = this;
2830
- return this._activeStep.subSteps.findIndex(function (value) {
2831
- return value === _this._activeStep.activeSubStep;
2832
- });
3154
+ return this._activeStep.subSteps.findIndex(function (value) { return value === _this._activeStep.activeSubStep; });
2833
3155
  };
2834
3156
  FlowbarComponent.prototype.triggerClick = function () {
2835
3157
  var selectedStep = this._steps[this.stepper.selectedIndex];
@@ -2839,21 +3161,6 @@
2839
3161
  event.stopPropagation(); //stop processing current header click event
2840
3162
  this._headerClick.emit(step);
2841
3163
  };
2842
- Object.defineProperty(FlowbarComponent.prototype, "currentStepLabel", {
2843
- get: function () {
2844
- return this._activeStep.label;
2845
- },
2846
- enumerable: false,
2847
- configurable: true
2848
- });
2849
- Object.defineProperty(FlowbarComponent.prototype, "currentSubStepLabel", {
2850
- get: function () {
2851
- var _a;
2852
- return (_a = this._activeStep.activeSubStep) === null || _a === void 0 ? void 0 : _a.label;
2853
- },
2854
- enumerable: false,
2855
- configurable: true
2856
- });
2857
3164
  FlowbarComponent.prototype.activeTabHasSubSteps = function () {
2858
3165
  return this._activeStep.subSteps && this._activeStep.subSteps.length > 0;
2859
3166
  };
@@ -2892,11 +3199,11 @@
2892
3199
  },] }
2893
3200
  ];
2894
3201
  FlowbarComponent.propDecorators = {
2895
- stepper: [{ type: i0.ViewChild, args: ['stepper',] }],
2896
3202
  _steps: [{ type: i0.Input, args: ['steps',] }],
2897
3203
  _activeStep: [{ type: i0.Input, args: ['activeStep',] }],
2898
3204
  _activeStepChange: [{ type: i0.Output, args: ['activeStepChange',] }],
2899
- _headerClick: [{ type: i0.Output, args: ['headerClick',] }]
3205
+ _headerClick: [{ type: i0.Output, args: ['headerClick',] }],
3206
+ stepper: [{ type: i0.ViewChild, args: ['stepper',] }]
2900
3207
  };
2901
3208
 
2902
3209
  var FlowbarModule = /** @class */ (function () {
@@ -2971,19 +3278,20 @@
2971
3278
  exports.ToolbarModule = ToolbarModule;
2972
3279
  exports.ToolbarService = ToolbarService;
2973
3280
  exports.madStepperAnimations = madStepperAnimations;
2974
- exports.ɵa = PrimaryButtonComponent;
2975
- exports.ɵb = MadBasicButton;
2976
- exports.ɵc = OutlineButtonComponent;
2977
- exports.ɵd = LinkButtonComponent;
2978
- exports.ɵe = DangerButtonComponent;
2979
- exports.ɵf = IconButtonComponent;
2980
- exports.ɵg = NumericFieldDirective;
2981
- exports.ɵh = CardComponent;
2982
- exports.ɵi = QuickListComponent;
2983
- exports.ɵj = BaseQuickListComponent;
2984
- exports.ɵk = QuickListCompactComponent;
2985
- exports.ɵl = TableComponent;
2986
- 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;
2987
3295
 
2988
3296
  Object.defineProperty(exports, '__esModule', { value: true });
2989
3297