@coolon/angular-ui-powerups 13.1.6 → 13.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/assets/table.scss +2 -2
  2. package/esm2020/lib/components/components.module.mjs +22 -19
  3. package/esm2020/lib/components/exports.mjs +28 -21
  4. package/esm2020/lib/components/tables/abstract-table-model.mjs +70 -29
  5. package/esm2020/lib/components/tables/abstract-table.component.mjs +12 -10
  6. package/esm2020/lib/components/tables/column/column-list-model.mjs +39 -0
  7. package/esm2020/lib/components/tables/column/column-model.mjs +180 -0
  8. package/esm2020/lib/components/tables/column/column-template/column-template.directive.mjs +35 -0
  9. package/esm2020/lib/components/tables/column/column-text-properties.mjs +2 -0
  10. package/esm2020/lib/components/tables/column/custom-template-column-model.mjs +16 -0
  11. package/esm2020/lib/components/tables/column/custom-value-column-model.mjs +37 -0
  12. package/esm2020/lib/components/tables/column/editor-controls-column-model.mjs +21 -0
  13. package/esm2020/lib/components/tables/column/list-propery-column-model.mjs +48 -0
  14. package/esm2020/lib/components/tables/column/property-column-model.mjs +92 -0
  15. package/esm2020/lib/components/tables/column/selection-column-model.mjs +40 -0
  16. package/esm2020/lib/components/tables/editor/edit-row-controls/edit-row-controls.component.mjs +55 -0
  17. package/esm2020/lib/components/tables/editor/edit-session.mjs +23 -0
  18. package/esm2020/lib/components/tables/editor/editable-cell-renderer.mjs +2 -0
  19. package/esm2020/lib/components/tables/{table/paginator → paginator}/paginator.component.mjs +4 -4
  20. package/esm2020/lib/components/tables/renderer/cell-editors.mjs +2 -0
  21. package/esm2020/lib/components/tables/renderer/cell-portal-ref.mjs +93 -0
  22. package/esm2020/lib/components/tables/renderer/cell-renderer.mjs +2 -0
  23. package/esm2020/lib/components/tables/renderer/default-cell-renderer/default-cell-renderer.component.mjs +30 -0
  24. package/esm2020/lib/components/tables/{table → renderer}/default-header-cell-renderer/default-header-cell-renderer.component.mjs +1 -1
  25. package/esm2020/lib/components/tables/renderer/default-list-cell-renderer/default-list-cell-renderer.component.mjs +40 -0
  26. package/esm2020/lib/components/tables/renderer/select-header-cell/selection-header-cell.component.mjs +31 -0
  27. package/esm2020/lib/components/tables/renderer/selection-cell/selection-cell.component.mjs +26 -0
  28. package/esm2020/lib/components/tables/renderer/table-cell/table-cell.component.mjs +93 -0
  29. package/esm2020/lib/components/tables/renderer/table-header-cell/table-header-cell.component.mjs +32 -0
  30. package/esm2020/lib/components/tables/search/column-text-search-formatter.mjs +52 -0
  31. package/esm2020/lib/components/tables/search/enable-cell-text-search.decorator.mjs +30 -0
  32. package/esm2020/lib/components/tables/table/table-model.mjs +2 -10
  33. package/esm2020/lib/components/tables/table/table.component.mjs +12 -12
  34. package/esm2020/lib/components/tables/table-row-menu/table-row-menu.component.mjs +84 -0
  35. package/esm2020/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.mjs +1 -1
  36. package/esm2020/lib/components/tables/tree-table/tree-label-column-model.mjs +3 -3
  37. package/esm2020/lib/components/tables/tree-table/tree-table-component.mjs +10 -10
  38. package/esm2020/lib/components/tables/tree-table/tree-table-model.mjs +1 -1
  39. package/fesm2015/coolon-angular-ui-powerups.mjs +608 -450
  40. package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
  41. package/fesm2020/coolon-angular-ui-powerups.mjs +740 -583
  42. package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
  43. package/lib/components/components.module.d.ts +55 -54
  44. package/lib/components/exports.d.ts +27 -20
  45. package/lib/components/tables/abstract-table-model.d.ts +24 -13
  46. package/lib/components/tables/abstract-table.component.d.ts +6 -5
  47. package/lib/components/tables/{column-list-model.d.ts → column/column-list-model.d.ts} +4 -4
  48. package/lib/components/tables/column/column-model.d.ts +77 -0
  49. package/lib/components/tables/column/custom-template-column-model.d.ts +8 -0
  50. package/lib/components/tables/column/custom-value-column-model.d.ts +10 -0
  51. package/lib/components/tables/column/editor-controls-column-model.d.ts +13 -0
  52. package/lib/components/tables/column/list-propery-column-model.d.ts +15 -0
  53. package/lib/components/tables/column/property-column-model.d.ts +24 -0
  54. package/lib/components/tables/column/selection-column-model.d.ts +12 -0
  55. package/lib/components/tables/{table → editor}/edit-row-controls/edit-row-controls.component.d.ts +1 -1
  56. package/lib/components/tables/{edit-session.d.ts → editor/edit-session.d.ts} +2 -2
  57. package/lib/components/tables/{table/mutable-cell-renderer.d.ts → editor/editable-cell-renderer.d.ts} +2 -2
  58. package/lib/components/tables/{table/paginator → paginator}/paginator.component.d.ts +1 -1
  59. package/lib/components/tables/{table → renderer}/cell-portal-ref.d.ts +18 -18
  60. package/lib/components/tables/renderer/cell-renderer.d.ts +3 -0
  61. package/lib/components/tables/{table → renderer}/default-cell-renderer/default-cell-renderer.component.d.ts +1 -1
  62. package/lib/components/tables/renderer/default-list-cell-renderer/default-list-cell-renderer.component.d.ts +12 -0
  63. package/lib/components/tables/{table/select-header-cell-renderer/select-header-cell-renderer.component.d.ts → renderer/select-header-cell/selection-header-cell.component.d.ts} +3 -3
  64. package/lib/components/tables/{table/select-cell-renderer/select-cell-renderer.component.d.ts → renderer/selection-cell/selection-cell.component.d.ts} +3 -3
  65. package/lib/components/tables/{table/table-cell-renderer/table-cell-renderer.component.d.ts → renderer/table-cell/table-cell.component.d.ts} +5 -5
  66. package/lib/components/tables/{table/table-header-cell-renderer/table-header-cell-renderer.component.d.ts → renderer/table-header-cell/table-header-cell.component.d.ts} +4 -4
  67. package/lib/components/tables/search/column-text-search-formatter.d.ts +28 -0
  68. package/lib/components/tables/search/enable-cell-text-search.decorator.d.ts +25 -0
  69. package/lib/components/tables/table/table-model.d.ts +3 -9
  70. package/lib/components/tables/table/table.component.d.ts +4 -4
  71. package/lib/components/tables/{table/table-row-menu → table-row-menu}/table-row-menu.component.d.ts +3 -3
  72. package/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.d.ts +1 -1
  73. package/lib/components/tables/tree-table/tree-label-column-model.d.ts +1 -1
  74. package/lib/components/tables/tree-table/tree-table-component.d.ts +2 -2
  75. package/lib/components/tables/tree-table/tree-table-model.d.ts +1 -1
  76. package/package.json +2 -1
  77. package/esm2020/lib/components/tables/column-list-model.mjs +0 -39
  78. package/esm2020/lib/components/tables/edit-session.mjs +0 -23
  79. package/esm2020/lib/components/tables/table/cell-editors.mjs +0 -2
  80. package/esm2020/lib/components/tables/table/cell-portal-ref.mjs +0 -93
  81. package/esm2020/lib/components/tables/table/cell-renderer.mjs +0 -2
  82. package/esm2020/lib/components/tables/table/column-model.mjs +0 -395
  83. package/esm2020/lib/components/tables/table/column-template/column-template.directive.mjs +0 -35
  84. package/esm2020/lib/components/tables/table/column-text-properties.mjs +0 -2
  85. package/esm2020/lib/components/tables/table/default-cell-renderer/default-cell-renderer.component.mjs +0 -22
  86. package/esm2020/lib/components/tables/table/edit-row-controls/edit-row-controls.component.mjs +0 -55
  87. package/esm2020/lib/components/tables/table/mutable-cell-renderer.mjs +0 -2
  88. package/esm2020/lib/components/tables/table/select-cell-renderer/select-cell-renderer.component.mjs +0 -26
  89. package/esm2020/lib/components/tables/table/select-header-cell-renderer/select-header-cell-renderer.component.mjs +0 -31
  90. package/esm2020/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.mjs +0 -93
  91. package/esm2020/lib/components/tables/table/table-def.mjs +0 -2
  92. package/esm2020/lib/components/tables/table/table-header-cell-renderer/table-header-cell-renderer.component.mjs +0 -32
  93. package/esm2020/lib/components/tables/table/table-row-menu/table-row-menu.component.mjs +0 -84
  94. package/esm2020/lib/components/tables/table/text-search-predicate.mjs +0 -2
  95. package/lib/components/tables/table/cell-renderer.d.ts +0 -5
  96. package/lib/components/tables/table/column-model.d.ts +0 -145
  97. package/lib/components/tables/table/table-def.d.ts +0 -7
  98. package/lib/components/tables/table/text-search-predicate.d.ts +0 -1
  99. /package/lib/components/tables/{table → column}/column-template/column-template.directive.d.ts +0 -0
  100. /package/lib/components/tables/{table → column}/column-text-properties.d.ts +0 -0
  101. /package/lib/components/tables/{table → renderer}/cell-editors.d.ts +0 -0
  102. /package/lib/components/tables/{table → renderer}/default-header-cell-renderer/default-header-cell-renderer.component.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import * as i4 from '@angular/common';
2
2
  import { DOCUMENT, CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { ElementRef, Directive, Inject, Host, Optional, Input, HostListener, NgZone, Injectable, Pipe, NgModule, Component, ContentChild, ViewEncapsulation, HostBinding, InjectionToken, ViewChildren, EventEmitter, ViewChild, Output, SkipSelf, Self, ContentChildren, ComponentRef, PLATFORM_ID, Injector } from '@angular/core';
4
+ import { ElementRef, Directive, Inject, Host, Optional, Input, HostListener, NgZone, Injectable, Pipe, NgModule, Component, ContentChild, ViewEncapsulation, HostBinding, InjectionToken, ViewChildren, EventEmitter, ViewChild, Output, SkipSelf, Self, ContentChildren, ComponentRef, Injector, PLATFORM_ID } from '@angular/core';
5
5
  import * as i4$1 from '@angular/forms';
6
6
  import { FormsModule } from '@angular/forms';
7
7
  import * as i1$8 from '@angular/material/form-field';
@@ -40,16 +40,18 @@ import { MatTooltipModule } from '@angular/material/tooltip';
40
40
  import * as i1$5 from '@fortawesome/angular-fontawesome';
41
41
  import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
42
42
  import * as i1$7 from '@coolon/pectin';
43
- import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, MultipleSelectionModel, DelegatingSelectionModel, AbstractComputedListModel, DirtyTrackingForm, ComputedListModel, PageController, Deferred, Trace, Functions } from '@coolon/pectin';
43
+ import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, MultipleSelectionModel, AbstractComputedListModel, DelegatingSelectionModel, DirtyTrackingForm, ComputedListModel, PageController, Deferred, Trace } from '@coolon/pectin';
44
44
  import { __decorate, __param, __metadata, __awaiter } from 'tslib';
45
+ import * as _ from 'lodash';
45
46
  import { isEmpty, isString, isFunction, isNil, isInteger, isEqual, uniq, first, findLast, isObject, isNumber, isNaN as isNaN$1 } from 'lodash';
46
47
  import * as i1$2 from '@angular/platform-browser';
47
48
  import { marked } from 'marked';
48
- import { lang as lang$1, assert as assert$1, Stringy, Opts, Klass } from '@coolon/typescript-utilities';
49
+ import { lang as lang$1, assert as assert$1, Stringy, Klass, Opts } from '@coolon/typescript-utilities';
49
50
  import { Memoize } from '@typescript-plus/fast-memoize-decorator';
50
51
  import { Enum } from 'typescript-string-enums';
51
52
  import * as i3 from '@angular/material/core';
52
53
  import ResizeObserver from 'resize-observer-polyfill';
54
+ import escapeStringRegexp from 'escape-string-regexp';
53
55
  import produce from 'immer';
54
56
  import { fas } from '@fortawesome/free-solid-svg-icons';
55
57
  import * as i6$1 from '@angular/cdk/a11y';
@@ -2535,25 +2537,6 @@ class TemplateCellRendererPortalRef extends CellRendererPortalRef {
2535
2537
  }
2536
2538
  }
2537
2539
 
2538
- class DefaultCellRendererComponent {
2539
- constructor() {
2540
- }
2541
- set value(value) {
2542
- this._value = value;
2543
- }
2544
- get value() {
2545
- return this._value;
2546
- }
2547
- }
2548
- DefaultCellRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DefaultCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2549
- DefaultCellRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DefaultCellRendererComponent, selector: "aup-default-cell-renderer", inputs: { value: "value" }, ngImport: i0, template: "<span [innerHTML]=\"value| aupHighlight\"></span>\n", styles: [""], pipes: { "aupHighlight": HighlightPipe } });
2550
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DefaultCellRendererComponent, decorators: [{
2551
- type: Component,
2552
- args: [{ selector: 'aup-default-cell-renderer', template: "<span [innerHTML]=\"value| aupHighlight\"></span>\n", styles: [""] }]
2553
- }], ctorParameters: function () { return []; }, propDecorators: { value: [{
2554
- type: Input
2555
- }] } });
2556
-
2557
2540
  class DefaultHeaderCellRendererComponent {
2558
2541
  constructor() {
2559
2542
  }
@@ -2567,104 +2550,82 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
2567
2550
  type: Input
2568
2551
  }] } });
2569
2552
 
2570
- class EditRowControls extends DisposableComponent {
2571
- constructor() {
2572
- super();
2573
- this.saveCommand = Command.create(() => __awaiter(this, void 0, void 0, function* () {
2574
- const finished = yield this.editSession.saveCommand.execute();
2575
- if (finished) {
2576
- this.editSession.dispose();
2577
- }
2578
- }));
2579
- this.cancelCommand = Command.create(() => {
2580
- this.editSession.dispose();
2581
- }).disableWhile(this.saveCommand.busy);
2553
+ class ColumnTextSearchFormatter {
2554
+ }
2555
+ (function (ColumnTextSearchFormatter) {
2556
+ class Delegate extends ColumnTextSearchFormatter {
2582
2557
  }
2583
- set editSession(session) {
2584
- if (session) {
2585
- session.form.disableWhile(this.saveCommand.busy);
2558
+ ColumnTextSearchFormatter.Delegate = Delegate;
2559
+ class Delegating extends ColumnTextSearchFormatter.Delegate {
2560
+ constructor(delegateClass) {
2561
+ super();
2562
+ this.delegateClass = delegateClass;
2563
+ }
2564
+ initialise(injector) {
2565
+ this._delegate = injector.get(this.delegateClass);
2566
+ if (this._delegate instanceof Delegating) {
2567
+ this._delegate.initialise(injector);
2568
+ }
2569
+ }
2570
+ format(row) {
2571
+ return this._delegate ? this._delegate.format(row) : "";
2586
2572
  }
2587
- this._session = session;
2588
- }
2589
- get editSession() {
2590
- return this._session;
2591
2573
  }
2592
- ngOnInit() {
2574
+ ColumnTextSearchFormatter.Delegating = Delegating;
2575
+ function forFormatter(formatter) {
2576
+ return new class extends ColumnTextSearchFormatter {
2577
+ format(value) {
2578
+ return formatter(value);
2579
+ }
2580
+ };
2593
2581
  }
2594
- get form() {
2595
- var _a;
2596
- return (_a = this.editSession) === null || _a === void 0 ? void 0 : _a.form;
2582
+ ColumnTextSearchFormatter.forFormatter = forFormatter;
2583
+ class Null extends ColumnTextSearchFormatter {
2584
+ format(value) {
2585
+ return "";
2586
+ }
2597
2587
  }
2598
- }
2599
- EditRowControls.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: EditRowControls, deps: [], target: i0.ɵɵFactoryTarget.Component });
2600
- EditRowControls.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: EditRowControls, selector: "aup-row-editor-controls", inputs: { row: "row", editRowCommand: "editRowCommand", editSession: "editSession" }, usesInheritance: true, ngImport: i0, template: "<button *ngIf=\"!editSession\" mat-icon-button [pectinCommand]=\"editRowCommand\" class=\"edit-button\"><aup-icon icon=\"mat:edit\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"saveCommand\"><aup-icon icon=\"mat:done\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"cancelCommand\"><aup-icon icon=\"mat:clear\"></aup-icon></button>\n", styles: [":host{display:block;width:80px}.edit-button{visibility:hidden}:host-context(tr:hover) .edit-button{visibility:visible}\n"], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: IconComponent, selector: "aup-icon", inputs: ["icon"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }] });
2601
- __decorate([
2602
- TrackExternal(),
2603
- __metadata("design:type", Command)
2604
- ], EditRowControls.prototype, "editRowCommand", void 0);
2605
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: EditRowControls, decorators: [{
2606
- type: Component,
2607
- args: [{ selector: 'aup-row-editor-controls', template: "<button *ngIf=\"!editSession\" mat-icon-button [pectinCommand]=\"editRowCommand\" class=\"edit-button\"><aup-icon icon=\"mat:edit\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"saveCommand\"><aup-icon icon=\"mat:done\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"cancelCommand\"><aup-icon icon=\"mat:clear\"></aup-icon></button>\n", styles: [":host{display:block;width:80px}.edit-button{visibility:hidden}:host-context(tr:hover) .edit-button{visibility:visible}\n"] }]
2608
- }], ctorParameters: function () { return []; }, propDecorators: { row: [{
2609
- type: Input
2610
- }], editRowCommand: [{
2611
- type: Input
2612
- }], editSession: [{
2613
- type: Input
2614
- }] } });
2615
-
2616
- class SelectCellRendererComponent extends DisposableComponent {
2617
- constructor() {
2618
- super();
2619
- this.selectCommand = Command.create(() => {
2588
+ ColumnTextSearchFormatter.Null = Null;
2589
+ class DefaultValueFormatter extends ColumnTextSearchFormatter {
2590
+ format(value) {
2620
2591
  var _a;
2621
- (_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.selectCommand.execute(this.row);
2622
- });
2592
+ let s = (_a = value === null || value === void 0 ? void 0 : value.toString()) !== null && _a !== void 0 ? _a : "";
2593
+ console.log("DefaultValueFormatter", { value, text: s });
2594
+ return s;
2595
+ }
2623
2596
  }
2624
- isSelected() {
2625
- var _a;
2626
- return (_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.isSelected(this.row);
2597
+ ColumnTextSearchFormatter.DefaultValueFormatter = DefaultValueFormatter;
2598
+ class DefaultArrayFormatter extends ColumnTextSearchFormatter {
2599
+ format(value) {
2600
+ return value ? value.map(it => it === null || it === void 0 ? void 0 : it.toString()).join(",") : "";
2601
+ }
2627
2602
  }
2628
- }
2629
- SelectCellRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2630
- SelectCellRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SelectCellRendererComponent, selector: "aup-select-cell-renderer", inputs: { row: "row" }, usesInheritance: true, ngImport: i0, template: "<mat-checkbox [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\"></mat-checkbox>\n", styles: [""], components: [{ type: i1$9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }] });
2631
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectCellRendererComponent, decorators: [{
2632
- type: Component,
2633
- args: [{ selector: 'aup-select-cell-renderer', template: "<mat-checkbox [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\"></mat-checkbox>\n", styles: [""] }]
2634
- }], ctorParameters: function () { return []; }, propDecorators: { row: [{
2635
- type: Input
2636
- }] } });
2603
+ ColumnTextSearchFormatter.DefaultArrayFormatter = DefaultArrayFormatter;
2604
+ })(ColumnTextSearchFormatter || (ColumnTextSearchFormatter = {}));
2637
2605
 
2638
- class SelectHeaderCellRendererComponent extends DisposableComponent {
2606
+ const noop = () => {
2607
+ };
2608
+ class ColumnTextSearchWrapper extends ColumnTextSearchFormatter.Delegate {
2639
2609
  constructor() {
2640
- super();
2641
- this.selectCommand = Command.create(() => {
2642
- this.selectionModel.toggleAllCommand.execute();
2643
- });
2610
+ super(...arguments);
2611
+ this._map = Functions.identity;
2644
2612
  }
2645
- isSelected() {
2646
- var _a;
2647
- return ((_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.allSelected.value) || false;
2613
+ initialise(injector) {
2614
+ if (this._delegate instanceof ColumnTextSearchFormatter.Delegate) {
2615
+ this._delegate.initialise(injector);
2616
+ }
2648
2617
  }
2649
- isIntermediate() {
2650
- var _a;
2651
- return ((_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.someSelected.value) || false;
2618
+ format(row) {
2619
+ let value = this._map(row);
2620
+ let result = this._delegate ? this._delegate.format(value) : "";
2621
+ console.log({ format: row, value, text: result });
2622
+ return result;
2652
2623
  }
2653
- isVisible() {
2654
- return this.enableHeaderControls && this.selectionModel.getDelegate() instanceof MultipleSelectionModel;
2624
+ setDelegate(formatter, mapper) {
2625
+ this._delegate = formatter;
2626
+ this._map = mapper !== null && mapper !== void 0 ? mapper : Functions.identity;
2655
2627
  }
2656
2628
  }
2657
- SelectHeaderCellRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectHeaderCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2658
- SelectHeaderCellRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SelectHeaderCellRendererComponent, selector: "aup-select-header-cell-renderer", usesInheritance: true, ngImport: i0, template: "<mat-checkbox *ngIf=\"isVisible()\" [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\" [indeterminate]=\"this.isIntermediate()\"></mat-checkbox>\n", styles: [""], components: [{ type: i1$9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }] });
2659
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectHeaderCellRendererComponent, decorators: [{
2660
- type: Component,
2661
- args: [{ selector: 'aup-select-header-cell-renderer', template: "<mat-checkbox *ngIf=\"isVisible()\" [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\" [indeterminate]=\"this.isIntermediate()\"></mat-checkbox>\n", styles: [""] }]
2662
- }], ctorParameters: function () { return []; } });
2663
-
2664
- const noop = () => {
2665
- };
2666
- const CELL_RENDERER_COMPONENT_ROW_CACHE = Symbol('aup-cell-renderer:row-data-cache');
2667
- const DEFAULT_TEXT_SEARCH_PREDICATE = (row, text) => false;
2668
2629
  class ColumnModel extends GarbageCollector {
2669
2630
  constructor(columnId, textPropertiesProvider) {
2670
2631
  super();
@@ -2672,10 +2633,9 @@ class ColumnModel extends GarbageCollector {
2672
2633
  this.textPropertiesProvider = textPropertiesProvider;
2673
2634
  this._enableRowSelection = true;
2674
2635
  this._flex = false;
2675
- this._defaultVisibility = this.registerDisposable(new DelegatingValueModel().withDefault(true));
2676
- this._visible = this.registerDisposable(new DelegatingValueModel().withDefault(this._defaultVisibility));
2677
- this._columnModelTextSearchPredicate = undefined;
2678
- this._cellRendererTextSearchPredicate = undefined;
2636
+ this._defaultVisibility$ = this.registerDisposable(new DelegatingValueModel().withDefault(true));
2637
+ this._visible$ = this.registerDisposable(new DelegatingValueModel().withDefault(this._defaultVisibility$));
2638
+ this.textSearchDelegate = new ColumnTextSearchWrapper();
2679
2639
  this.installHeaderRenderer();
2680
2640
  this.dasherisedColumnId = Stringy.from(columnId).dasherize().toString();
2681
2641
  }
@@ -2689,33 +2649,21 @@ class ColumnModel extends GarbageCollector {
2689
2649
  return ((_a = this.getColumnTextProperties()) === null || _a === void 0 ? void 0 : _a.headerText()) || this.getDefaultHeaderText();
2690
2650
  }
2691
2651
  isVisible() {
2692
- return this.visible.value;
2652
+ return this.visible$.value;
2693
2653
  }
2694
- get visible() {
2695
- return this._visible.readonly;
2654
+ get visible$() {
2655
+ return this._visible$.readonly;
2696
2656
  }
2697
2657
  visibleWhile(visible) {
2698
- this._visible.setDelegate(visible);
2658
+ this._visible$.setDelegate(visible);
2699
2659
  return this;
2700
2660
  }
2701
2661
  setDefaultVisibility(visible) {
2702
- this._defaultVisibility.setDelegate(visible);
2662
+ this._defaultVisibility$.setDelegate(visible);
2703
2663
  }
2704
2664
  getDefaultHeaderText() {
2705
2665
  return this.columnId;
2706
2666
  }
2707
- get isTextMatch() {
2708
- var _a, _b;
2709
- return (_b = (_a = this._cellRendererTextSearchPredicate) !== null && _a !== void 0 ? _a : this._columnModelTextSearchPredicate) !== null && _b !== void 0 ? _b : DEFAULT_TEXT_SEARCH_PREDICATE;
2710
- }
2711
- /**
2712
- * Sets the predicate to use when checking if the specified row is a text match for this column.
2713
- * @param predicate
2714
- */
2715
- useTextSearchPredicate(predicate) {
2716
- this._columnModelTextSearchPredicate = predicate;
2717
- return this;
2718
- }
2719
2667
  getColumnTextProperties() {
2720
2668
  return this._columnTextProperties || this.textPropertiesProvider();
2721
2669
  }
@@ -2730,6 +2678,14 @@ class ColumnModel extends GarbageCollector {
2730
2678
  this._columnTextProperties = columnTextProperties;
2731
2679
  return this;
2732
2680
  }
2681
+ getSearchTextFor(row) {
2682
+ return this.textSearchDelegate.format(row);
2683
+ }
2684
+ configureColumnTextSearch(formatter, mapper) {
2685
+ assert$1.notNil(formatter);
2686
+ console.log({ col: this.columnId, formatter });
2687
+ this.textSearchDelegate.setDelegate(formatter, mapper);
2688
+ }
2733
2689
  configureHeaderRenderer(config) {
2734
2690
  this._columnHeaderPortalRef = config;
2735
2691
  }
@@ -2768,15 +2724,6 @@ class ColumnModel extends GarbageCollector {
2768
2724
  onRendererAttached(host, ref) {
2769
2725
  const component = this.getComponentOrEmbeddedView(ref);
2770
2726
  this._cellRendererPortalRef.onPortalAttached(host, component);
2771
- if (ref instanceof CellRendererPortalRef && isFunction(component === null || component === void 0 ? void 0 : component.matches)) {
2772
- // we've had the case where we were calling matches on disposed components, so we have
2773
- // to make sure we only handle matches on components that we can track destroys.
2774
- this._cellRendererTextSearchPredicate = (row, text) => component.matches(row, text);
2775
- ref.onDestroy(() => this._cellRendererTextSearchPredicate = undefined);
2776
- }
2777
- else {
2778
- this._cellRendererTextSearchPredicate = undefined;
2779
- }
2780
2727
  }
2781
2728
  // @Trace()
2782
2729
  onEditorAttached(host, ref) {
@@ -2809,6 +2756,9 @@ class ColumnModel extends GarbageCollector {
2809
2756
  return ref;
2810
2757
  }
2811
2758
  }
2759
+ initialise(injector) {
2760
+ this.textSearchDelegate.initialise(injector);
2761
+ }
2812
2762
  }
2813
2763
  __decorate([
2814
2764
  Memoize(),
@@ -2822,182 +2772,10 @@ __decorate([
2822
2772
  __metadata("design:paramtypes", []),
2823
2773
  __metadata("design:returntype", Object)
2824
2774
  ], ColumnModel.prototype, "getColumnTextProperties", null);
2825
- class PropertyColumnModel extends ColumnModel {
2826
- constructor(id, property, defaults) {
2827
- super(id, defaults);
2828
- this.property = property;
2829
- this._format = (value) => value === null || value === void 0 ? void 0 : value.toString();
2830
- this.cellRenderer(DefaultCellRendererComponent);
2831
- this.useTextSearchPredicate((row, regex) => {
2832
- return regex.test(this._format(row[this.property]));
2833
- });
2834
- }
2835
- cellRenderer(componentType, onComponentInitOrOptions) {
2836
- this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
2837
- if (firstTime) {
2838
- if (isFunction(onComponentInitOrOptions)) {
2839
- onComponentInitOrOptions(component);
2840
- }
2841
- else {
2842
- if (isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
2843
- onComponentInitOrOptions.onComponentInit(component);
2844
- }
2845
- }
2846
- }
2847
- component.value = this._format(rowData.row[this.property]);
2848
- }));
2849
- return this;
2850
- }
2851
- liveEditCellRenderer(componentType, options) {
2852
- return this.mutableCellRenderer(componentType, options);
2853
- }
2854
- /**
2855
- * Deprecated. Use #liveEditCellRenderer instead.
2856
- * @param componentType
2857
- * @param options
2858
- */
2859
- mutableCellRenderer(componentType, options) {
2860
- this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
2861
- // keep a local copy most recent row value so it's available to teh
2862
- // edit callback without having to add/remove subscribers all the time.
2863
- component[CELL_RENDERER_COMPONENT_ROW_CACHE] = rowData.row;
2864
- let disableEditCallback = false;
2865
- if (firstTime) {
2866
- if (isFunction(options === null || options === void 0 ? void 0 : options.onComponentInit)) {
2867
- options.onComponentInit(component);
2868
- }
2869
- // install our edit callback
2870
- component.onValueEdited((is, was) => {
2871
- if (!disableEditCallback) {
2872
- options.onValueEdit(component[CELL_RENDERER_COMPONENT_ROW_CACHE], is, was);
2873
- }
2874
- });
2875
- }
2876
- // now push the value the component and disable the callback just incase the component misbehaves
2877
- // and fires a value change during the operation.
2878
- disableEditCallback = true;
2879
- component.value = rowData.row[this.property];
2880
- disableEditCallback = false;
2881
- if (!isFunction(options) && isFunction(options === null || options === void 0 ? void 0 : options.onRowUpdate)) {
2882
- options.onRowUpdate(component, rowData.row);
2883
- }
2884
- }));
2885
- return this;
2886
- }
2887
- cellEditor(editor, validatorsOrInitialiser, onComponentInit) {
2888
- const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
2889
- const initialiser = isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : onComponentInit;
2890
- this.configureCellEditor(new CellEditorPortalRef(editor, (component, editSession) => {
2891
- const formValueModel = editSession.form.pluck(this.property);
2892
- if (validators) {
2893
- formValueModel.validateUsing(validators);
2894
- }
2895
- component.valueModel = formValueModel;
2896
- if (initialiser) {
2897
- initialiser(component);
2898
- }
2899
- }));
2900
- return this;
2901
- }
2902
- format(formatter) {
2903
- assert$1.isFunction(formatter);
2904
- this._format = formatter;
2905
- return this;
2906
- }
2907
- selectRowOnClick(selectOnRowClick) {
2908
- return this._selectRowOnClick(selectOnRowClick);
2909
- }
2910
- }
2911
- class ListPropertyColumnModel extends ColumnModel {
2912
- constructor(id, property, defaults) {
2913
- super(id, defaults);
2914
- this.property = property;
2915
- this._format = (value) => value.map(v => v === null || v === void 0 ? void 0 : v.toString()).join(', ');
2916
- this.cellRenderer(DefaultCellRendererComponent);
2917
- this.useTextSearchPredicate((row, regex) => {
2918
- let rowElement = row[this.property];
2919
- // @ts-ignore Started complaining in ts 4.5.. but I think my logic is correct...
2920
- return regex.test(this._format(rowElement));
2921
- });
2922
- }
2923
- cellRenderer(componentType) {
2924
- this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {
2925
- let rowElement = rowData.row[this.property];
2926
- // @ts-ignore Started complaining in ts 4.5.. but I think my logic is correct...
2927
- component.value = this._format(rowElement);
2928
- }));
2929
- return this;
2930
- }
2931
- cellEditor(editor, validatorsOrInitialiser, initialiseComponent) {
2932
- const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
2933
- const initialiser = isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : initialiseComponent;
2934
- this.configureCellEditor(new CellEditorPortalRef(editor, (component, editSession) => {
2935
- const formListModel = editSession.form.pluckList(this.property);
2936
- if (validators) {
2937
- formListModel.validateUsing(validators);
2938
- }
2939
- component.listModel = formListModel;
2940
- if (initialiser) {
2941
- initialiser(component);
2942
- }
2943
- }));
2944
- return this;
2945
- }
2946
- format(formatter) {
2947
- assert$1.isFunction(formatter);
2948
- this._format = formatter;
2949
- return this;
2950
- }
2951
- selectRowOnClick(selectRowOnClick) {
2952
- return this._selectRowOnClick(selectRowOnClick);
2953
- }
2954
- }
2955
- class CustomValueColumnModel extends ColumnModel {
2956
- constructor(columnId, defaults, getValue) {
2957
- super(columnId, defaults);
2958
- this.getValue = getValue;
2959
- this.cellRenderer(DefaultCellRendererComponent);
2960
- }
2961
- cellRenderer(componentType, onComponentInitOrOptions) {
2962
- this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
2963
- if (firstTime) {
2964
- if (isFunction(onComponentInitOrOptions)) {
2965
- onComponentInitOrOptions(component);
2966
- }
2967
- else {
2968
- if (isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
2969
- onComponentInitOrOptions.onComponentInit(component);
2970
- }
2971
- }
2972
- }
2973
- component.value = this.getValue(rowData.row);
2974
- if (!isFunction(onComponentInitOrOptions) && isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onRowUpdate)) {
2975
- onComponentInitOrOptions.onRowUpdate(component, rowData.row);
2976
- }
2977
- }));
2978
- return this;
2979
- }
2980
- selectRowOnClick(selectOnRowClick) {
2981
- return this._selectRowOnClick(selectOnRowClick);
2982
- }
2983
- }
2984
- class EditorControlColumnModel extends ColumnModel {
2985
- constructor(columnId, saveCommandFactory, defaults) {
2986
- super(columnId, defaults);
2987
- this.cellRenderer(EditRowControls);
2988
- }
2989
- cellRenderer(componentType) {
2990
- this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {
2991
- component.row = rowData.row;
2992
- component.editSession = rowData.editSession;
2993
- component.editRowCommand = rowData.editRowCommand;
2994
- }));
2995
- return this;
2996
- }
2997
- getDefaultHeaderText() {
2998
- return '';
2999
- }
3000
- }
2775
+ (function (ColumnModel) {
2776
+ ColumnModel.CELL_RENDERER_COMPONENT_ROW_CACHE = Symbol('aup-cell-renderer:row-data-cache');
2777
+ })(ColumnModel || (ColumnModel = {}));
2778
+
3001
2779
  class CustomTemplateColumnModel extends ColumnModel {
3002
2780
  constructor(columnId, defaults) {
3003
2781
  super(columnId, defaults);
@@ -3011,45 +2789,11 @@ class CustomTemplateColumnModel extends ColumnModel {
3011
2789
  return this._selectRowOnClick(selectOnRowClick);
3012
2790
  }
3013
2791
  }
3014
- class SelectionColumnModel extends ColumnModel {
3015
- constructor(columnId, defaults, selectionModel) {
3016
- super(columnId, defaults);
3017
- this._enableHeaderControls = true;
3018
- this.selectionModel = DelegatingSelectionModel.createDelegate();
3019
- this._selectRowOnClick(false);
3020
- this.cellHeaderRenderer(SelectHeaderCellRendererComponent, (component) => {
3021
- component.selectionModel = this.selectionModel;
3022
- component.enableHeaderControls = this._enableHeaderControls;
3023
- });
3024
- this.configureCellRenderer(new ComponentCellRendererPortalRef(SelectCellRendererComponent, (component, rowData) => {
3025
- component.row = rowData.row;
3026
- component.selectionModel = this.selectionModel;
3027
- }));
3028
- this.setSelectionModel(selectionModel);
3029
- }
3030
- setSelectionModel(selectionModel) {
3031
- this.selectionModel.setDelegate(selectionModel);
3032
- this.setDefaultVisibility(selectionModel instanceof MultipleSelectionModel ? ValueModel.TRUE : ValueModel.FALSE);
3033
- }
3034
- getDefaultHeaderText() {
3035
- return '';
3036
- }
3037
- enableHeaderControls(enable) {
3038
- this._enableHeaderControls = enable;
3039
- return this;
3040
- }
3041
- selectRow(row) {
3042
- this.selectionModel.selectCommand.execute(row);
3043
- }
3044
- isSelected(row) {
3045
- return this.selectionModel.isSelected(row);
3046
- }
3047
- }
3048
2792
 
3049
2793
  /**
3050
2794
  * Create your model:
3051
2795
  * @example
3052
- * this.heroTableModel = TableModel.fromList(heroList, table => {
2796
+ * this.heroTableModel = new TableModel(heroList, table => {
3053
2797
  * table.pluck("firstName");
3054
2798
  * table.pluck("lastName");
3055
2799
  * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
@@ -3061,7 +2805,7 @@ class SelectionColumnModel extends ColumnModel {
3061
2805
  *
3062
2806
  * Column templates
3063
2807
  * @example
3064
- * this.heroTableModel = TableModel.fromList(heroList, table => {
2808
+ * this.heroTableModel = new TableModel(heroList, table => {
3065
2809
  * table.pluck("firstName");
3066
2810
  * table.pluck("lastName");
3067
2811
  * table.addTemplateColumn("specialColumn");
@@ -3106,8 +2850,9 @@ class SelectionColumnModel extends ColumnModel {
3106
2850
  * }
3107
2851
  */
3108
2852
  class AbstractTableComponent extends ResizeAwareComponent {
3109
- constructor(elementRef, ngZone) {
2853
+ constructor(elementRef, ngZone, injector) {
3110
2854
  super(elementRef, ngZone);
2855
+ this.injector = injector;
3111
2856
  /**
3112
2857
  * Set to true to enable scrolling. Once enabled the table will have 0 implicit height. You will either
3113
2858
  * need to set it explicitly e.g. height: 400px; or by using flex or grid layout to make it fill it's
@@ -3139,6 +2884,7 @@ class AbstractTableComponent extends ResizeAwareComponent {
3139
2884
  }
3140
2885
  ngOnInit() {
3141
2886
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
2887
+ this.getModel().initialise(this.injector);
3142
2888
  this.columns = chain(this.getModel().columns);
3143
2889
  this.columnIds = chain(this.columns).pluck('columnId');
3144
2890
  this.columnsById = chain(this.columns).indexBy('columnId');
@@ -3158,12 +2904,12 @@ class AbstractTableComponent extends ResizeAwareComponent {
3158
2904
  // @Trace()
3159
2905
  isFirstVisibleColumn(columnId) {
3160
2906
  var _a;
3161
- return ((_a = this.getModel().firstVisibleColumn.query().value) === null || _a === void 0 ? void 0 : _a.columnId) === columnId;
2907
+ return ((_a = this.getModel().firstVisibleColumn$.query().value) === null || _a === void 0 ? void 0 : _a.columnId) === columnId;
3162
2908
  }
3163
2909
  // @Trace()
3164
2910
  isLastVisibleColumn(columnId) {
3165
2911
  var _a;
3166
- return ((_a = this.getModel().lastVisibleColumn.query().value) === null || _a === void 0 ? void 0 : _a.columnId) === columnId;
2912
+ return ((_a = this.getModel().lastVisibleColumn$.query().value) === null || _a === void 0 ? void 0 : _a.columnId) === columnId;
3167
2913
  }
3168
2914
  getColumnClasses(columnId) {
3169
2915
  const classes = [`aup-col-${this.columnsById.get(columnId).dasherisedColumnId}`];
@@ -3176,7 +2922,7 @@ class AbstractTableComponent extends ResizeAwareComponent {
3176
2922
  return classes;
3177
2923
  }
3178
2924
  }
3179
- AbstractTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AbstractTableComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2925
+ AbstractTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AbstractTableComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
3180
2926
  AbstractTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: AbstractTableComponent, selector: "aup-abstract-table", inputs: { showHeaderModel: "showHeaderModel", showHeader: "showHeader", enableScrolling: "enableScrolling" }, host: { properties: { "class.enable-scrolling": "this.enableScrolling", "class": "this.baseCssClass", "class.hide-header": "this.hideHeader" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
3181
2927
  __decorate([
3182
2928
  TrackExternal({ defaultValue: true }),
@@ -3192,7 +2938,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
3192
2938
  selector: 'aup-abstract-table',
3193
2939
  template: ''
3194
2940
  }]
3195
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { showHeaderModel: [{
2941
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Injector }]; }, propDecorators: { showHeaderModel: [{
3196
2942
  type: Input
3197
2943
  }], showHeader: [{
3198
2944
  type: Input
@@ -3217,30 +2963,206 @@ class ColumnTemplateDirective {
3217
2963
  this.aupColumnTemplateFillCell = false;
3218
2964
  this.aupColumnTemplateAutoPadChild = undefined;
3219
2965
  }
3220
- ngOnInit() {
2966
+ ngOnInit() {
2967
+ var _a;
2968
+ assert.isTruthy(this.aupColumnTemplateColumnId);
2969
+ this.host.registerColumnTemplate(this.aupColumnTemplateColumnId, this.templateRef, this.viewContainer, this.aupColumnTemplateFillCell, (_a = this.aupColumnTemplateAutoPadChild) !== null && _a !== void 0 ? _a : this.aupColumnTemplateFillCell);
2970
+ }
2971
+ }
2972
+ ColumnTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ColumnTemplateDirective, deps: [{ token: AbstractTableComponent }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
2973
+ ColumnTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: ColumnTemplateDirective, selector: "[aupColumnTemplate]", inputs: { aupColumnTemplate: "aupColumnTemplate", aupColumnTemplateColumnId: "aupColumnTemplateColumnId", aupColumnTemplateFillCell: "aupColumnTemplateFillCell", aupColumnTemplateAutoPadChild: "aupColumnTemplateAutoPadChild" }, ngImport: i0 });
2974
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ColumnTemplateDirective, decorators: [{
2975
+ type: Directive,
2976
+ args: [{
2977
+ selector: '[aupColumnTemplate]'
2978
+ }]
2979
+ }], ctorParameters: function () { return [{ type: AbstractTableComponent }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { aupColumnTemplate: [{
2980
+ type: Input
2981
+ }], aupColumnTemplateColumnId: [{
2982
+ type: Input
2983
+ }], aupColumnTemplateFillCell: [{
2984
+ type: Input
2985
+ }], aupColumnTemplateAutoPadChild: [{
2986
+ type: Input
2987
+ }] } });
2988
+
2989
+ const TEXT_SEARCH_FORMATTER_KEY = `aup:table:textSearchFormatter`;
2990
+ const Keys = Enum("useFunction", "useInstance", "useClass");
2991
+ function EnableCellTextSearch(options) {
2992
+ assert$1.notNil(options);
2993
+ return (constructor) => {
2994
+ const klass = Klass.get(constructor);
2995
+ assert$1.isFalsey(klass.hasOwnMetadata(TEXT_SEARCH_FORMATTER_KEY), "class already decorated with @EnableCellTextSearch");
2996
+ klass.defineMetadata(TEXT_SEARCH_FORMATTER_KEY, options);
2997
+ };
2998
+ }
2999
+ (function (EnableCellTextSearch) {
3000
+ function getFormatter(renderer, useDefault) {
3001
+ var _a;
3002
+ const options = (_a = Klass.get(renderer).getMetadata(TEXT_SEARCH_FORMATTER_KEY)) !== null && _a !== void 0 ? _a : {};
3003
+ if (options[Keys.useFunction]) {
3004
+ return ColumnTextSearchFormatter.forFormatter(options[Keys.useFunction]);
3005
+ }
3006
+ if (options[Keys.useInstance]) {
3007
+ return options[Keys.useInstance];
3008
+ }
3009
+ if (options[Keys.useClass]) {
3010
+ return new ColumnTextSearchFormatter.Delegating(options[Keys.useClass]);
3011
+ }
3012
+ return useDefault();
3013
+ }
3014
+ EnableCellTextSearch.getFormatter = getFormatter;
3015
+ })(EnableCellTextSearch || (EnableCellTextSearch = {}));
3016
+
3017
+ let DefaultCellRendererComponent = class DefaultCellRendererComponent {
3018
+ constructor() {
3019
+ }
3020
+ set value(value) {
3021
+ this._value = value;
3022
+ }
3023
+ get value() {
3024
+ return this._value;
3025
+ }
3026
+ };
3027
+ DefaultCellRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DefaultCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3028
+ DefaultCellRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DefaultCellRendererComponent, selector: "aup-default-cell-renderer", inputs: { value: "value" }, ngImport: i0, template: "<span [innerHTML]=\"value| aupHighlight\"></span>\n", styles: [""], pipes: { "aupHighlight": HighlightPipe } });
3029
+ DefaultCellRendererComponent = __decorate([
3030
+ EnableCellTextSearch({ useClass: ColumnTextSearchFormatter.DefaultValueFormatter }),
3031
+ __metadata("design:paramtypes", [])
3032
+ ], DefaultCellRendererComponent);
3033
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DefaultCellRendererComponent, decorators: [{
3034
+ type: Component,
3035
+ args: [{ selector: "aup-default-cell-renderer", template: "<span [innerHTML]=\"value| aupHighlight\"></span>\n", styles: [""] }]
3036
+ }], ctorParameters: function () { return []; }, propDecorators: { value: [{
3037
+ type: Input
3038
+ }] } });
3039
+
3040
+ class EditRowControls extends DisposableComponent {
3041
+ constructor() {
3042
+ super();
3043
+ this.saveCommand = Command.create(() => __awaiter(this, void 0, void 0, function* () {
3044
+ const finished = yield this.editSession.saveCommand.execute();
3045
+ if (finished) {
3046
+ this.editSession.dispose();
3047
+ }
3048
+ }));
3049
+ this.cancelCommand = Command.create(() => {
3050
+ this.editSession.dispose();
3051
+ }).disableWhile(this.saveCommand.busy);
3052
+ }
3053
+ set editSession(session) {
3054
+ if (session) {
3055
+ session.form.disableWhile(this.saveCommand.busy);
3056
+ }
3057
+ this._session = session;
3058
+ }
3059
+ get editSession() {
3060
+ return this._session;
3061
+ }
3062
+ ngOnInit() {
3063
+ }
3064
+ get form() {
3065
+ var _a;
3066
+ return (_a = this.editSession) === null || _a === void 0 ? void 0 : _a.form;
3067
+ }
3068
+ }
3069
+ EditRowControls.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: EditRowControls, deps: [], target: i0.ɵɵFactoryTarget.Component });
3070
+ EditRowControls.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: EditRowControls, selector: "aup-row-editor-controls", inputs: { row: "row", editRowCommand: "editRowCommand", editSession: "editSession" }, usesInheritance: true, ngImport: i0, template: "<button *ngIf=\"!editSession\" mat-icon-button [pectinCommand]=\"editRowCommand\" class=\"edit-button\"><aup-icon icon=\"mat:edit\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"saveCommand\"><aup-icon icon=\"mat:done\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"cancelCommand\"><aup-icon icon=\"mat:clear\"></aup-icon></button>\n", styles: [":host{display:block;width:80px}.edit-button{visibility:hidden}:host-context(tr:hover) .edit-button{visibility:visible}\n"], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: IconComponent, selector: "aup-icon", inputs: ["icon"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }] });
3071
+ __decorate([
3072
+ TrackExternal(),
3073
+ __metadata("design:type", Command)
3074
+ ], EditRowControls.prototype, "editRowCommand", void 0);
3075
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: EditRowControls, decorators: [{
3076
+ type: Component,
3077
+ args: [{ selector: 'aup-row-editor-controls', template: "<button *ngIf=\"!editSession\" mat-icon-button [pectinCommand]=\"editRowCommand\" class=\"edit-button\"><aup-icon icon=\"mat:edit\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"saveCommand\"><aup-icon icon=\"mat:done\"></aup-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"cancelCommand\"><aup-icon icon=\"mat:clear\"></aup-icon></button>\n", styles: [":host{display:block;width:80px}.edit-button{visibility:hidden}:host-context(tr:hover) .edit-button{visibility:visible}\n"] }]
3078
+ }], ctorParameters: function () { return []; }, propDecorators: { row: [{
3079
+ type: Input
3080
+ }], editRowCommand: [{
3081
+ type: Input
3082
+ }], editSession: [{
3083
+ type: Input
3084
+ }] } });
3085
+
3086
+ let formatter = (row) => row.map(e => e === null || e === void 0 ? void 0 : e.toString()).join(", ");
3087
+ let DefaultListCellRendererComponent = class DefaultListCellRendererComponent extends DisposableComponent {
3088
+ constructor() {
3089
+ super();
3090
+ const { chain } = Dsl.disposeWith(this);
3091
+ this.text$ = chain(this.value$).reduce(formatter);
3092
+ }
3093
+ };
3094
+ DefaultListCellRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DefaultListCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3095
+ DefaultListCellRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DefaultListCellRendererComponent, selector: "aup-default-list-cell-renderer", inputs: { value$: "value$", value: "value" }, usesInheritance: true, ngImport: i0, template: "<span [innerHTML]=\"text$.value| aupHighlight\"></span>\n", styles: [""], pipes: { "aupHighlight": HighlightPipe } });
3096
+ __decorate([
3097
+ TrackExternal(),
3098
+ __metadata("design:type", ListModel)
3099
+ ], DefaultListCellRendererComponent.prototype, "value$", void 0);
3100
+ __decorate([
3101
+ StoreInListModel("value$"),
3102
+ __metadata("design:type", Array)
3103
+ ], DefaultListCellRendererComponent.prototype, "value", void 0);
3104
+ DefaultListCellRendererComponent = __decorate([
3105
+ EnableCellTextSearch({ useClass: ColumnTextSearchFormatter.DefaultArrayFormatter }),
3106
+ __metadata("design:paramtypes", [])
3107
+ ], DefaultListCellRendererComponent);
3108
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DefaultListCellRendererComponent, decorators: [{
3109
+ type: Component,
3110
+ args: [{ selector: "aup-default-list-cell-renderer", template: "<span [innerHTML]=\"text$.value| aupHighlight\"></span>\n", styles: [""] }]
3111
+ }], ctorParameters: function () { return []; }, propDecorators: { value$: [{
3112
+ type: Input
3113
+ }], value: [{
3114
+ type: Input
3115
+ }] } });
3116
+
3117
+ class SelectionCellComponent extends DisposableComponent {
3118
+ constructor() {
3119
+ super();
3120
+ this.selectCommand = Command.create(() => {
3121
+ var _a;
3122
+ (_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.selectCommand.execute(this.row);
3123
+ });
3124
+ }
3125
+ isSelected() {
3126
+ var _a;
3127
+ return (_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.isSelected(this.row);
3128
+ }
3129
+ }
3130
+ SelectionCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectionCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3131
+ SelectionCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SelectionCellComponent, selector: "aup-selection-cell", inputs: { row: "row" }, usesInheritance: true, ngImport: i0, template: "<mat-checkbox [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\"></mat-checkbox>\n", styles: [""], components: [{ type: i1$9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }] });
3132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectionCellComponent, decorators: [{
3133
+ type: Component,
3134
+ args: [{ selector: 'aup-selection-cell', template: "<mat-checkbox [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\"></mat-checkbox>\n", styles: [""] }]
3135
+ }], ctorParameters: function () { return []; }, propDecorators: { row: [{
3136
+ type: Input
3137
+ }] } });
3138
+
3139
+ class SelectionHeaderCellComponent extends DisposableComponent {
3140
+ constructor() {
3141
+ super();
3142
+ this.selectCommand = Command.create(() => {
3143
+ this.selectionModel.toggleAllCommand.execute();
3144
+ });
3145
+ }
3146
+ isSelected() {
3221
3147
  var _a;
3222
- assert.isTruthy(this.aupColumnTemplateColumnId);
3223
- this.host.registerColumnTemplate(this.aupColumnTemplateColumnId, this.templateRef, this.viewContainer, this.aupColumnTemplateFillCell, (_a = this.aupColumnTemplateAutoPadChild) !== null && _a !== void 0 ? _a : this.aupColumnTemplateFillCell);
3148
+ return ((_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.allSelected.value) || false;
3149
+ }
3150
+ isIntermediate() {
3151
+ var _a;
3152
+ return ((_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.someSelected.value) || false;
3153
+ }
3154
+ isVisible() {
3155
+ return this.enableHeaderControls && this.selectionModel.getDelegate() instanceof MultipleSelectionModel;
3224
3156
  }
3225
3157
  }
3226
- ColumnTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ColumnTemplateDirective, deps: [{ token: AbstractTableComponent }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
3227
- ColumnTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: ColumnTemplateDirective, selector: "[aupColumnTemplate]", inputs: { aupColumnTemplate: "aupColumnTemplate", aupColumnTemplateColumnId: "aupColumnTemplateColumnId", aupColumnTemplateFillCell: "aupColumnTemplateFillCell", aupColumnTemplateAutoPadChild: "aupColumnTemplateAutoPadChild" }, ngImport: i0 });
3228
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ColumnTemplateDirective, decorators: [{
3229
- type: Directive,
3230
- args: [{
3231
- selector: '[aupColumnTemplate]'
3232
- }]
3233
- }], ctorParameters: function () { return [{ type: AbstractTableComponent }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { aupColumnTemplate: [{
3234
- type: Input
3235
- }], aupColumnTemplateColumnId: [{
3236
- type: Input
3237
- }], aupColumnTemplateFillCell: [{
3238
- type: Input
3239
- }], aupColumnTemplateAutoPadChild: [{
3240
- type: Input
3241
- }] } });
3158
+ SelectionHeaderCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectionHeaderCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3159
+ SelectionHeaderCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SelectionHeaderCellComponent, selector: "aup-selection-header-cell", usesInheritance: true, ngImport: i0, template: "<mat-checkbox *ngIf=\"isVisible()\" [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\" [indeterminate]=\"this.isIntermediate()\"></mat-checkbox>\n", styles: [""], components: [{ type: i1$9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }] });
3160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SelectionHeaderCellComponent, decorators: [{
3161
+ type: Component,
3162
+ args: [{ selector: 'aup-selection-header-cell', template: "<mat-checkbox *ngIf=\"isVisible()\" [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\" [indeterminate]=\"this.isIntermediate()\"></mat-checkbox>\n", styles: [""] }]
3163
+ }], ctorParameters: function () { return []; } });
3242
3164
 
3243
- class TableCellRendererComponent extends DisposableComponent {
3165
+ class TableCellComponent extends DisposableComponent {
3244
3166
  constructor() {
3245
3167
  super();
3246
3168
  this.defaultClassNames = 'aup-cell-renderer';
@@ -3252,7 +3174,7 @@ class TableCellRendererComponent extends DisposableComponent {
3252
3174
  }
3253
3175
  ngOnInit() {
3254
3176
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
3255
- this.firstEditableColumn = chain(this.tableModel.firstEditableColumn).equals(this.column); // this would break if the column changed.
3177
+ this.firstEditableColumn = chain(this.tableModel.firstEditableColumn$).equals(this.column); // this would break if the column changed.
3256
3178
  this.column.attachCell(this);
3257
3179
  }
3258
3180
  hasActiveEditor() {
@@ -3300,11 +3222,11 @@ class TableCellRendererComponent extends DisposableComponent {
3300
3222
  };
3301
3223
  }
3302
3224
  }
3303
- TableCellRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3304
- TableCellRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TableCellRendererComponent, selector: "aup-table-cell-renderer", inputs: { row: "row", column: "column", editSession: "editSession", tableModel: "tableModel" }, host: { properties: { "class": "this.defaultClassNames", "class.fillCell": "this.fillCell", "class.padChild": "this.padChild" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"!hasActiveEditor()\" [cdkPortalOutlet]=\"getRendererPortal()\" (attached)=\"initialiseRenderer($event)\"></ng-container>\n<ng-container *ngIf=\"hasActiveEditor()\" [cdkPortalOutlet]=\"getEditorPortal()\" (attached)=\"initialiseEditor($event)\"></ng-container>\n", styles: [""], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$4.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }] });
3305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableCellRendererComponent, decorators: [{
3225
+ TableCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3226
+ TableCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TableCellComponent, selector: "aup-table-cell", inputs: { row: "row", column: "column", editSession: "editSession", tableModel: "tableModel" }, host: { properties: { "class": "this.defaultClassNames", "class.fillCell": "this.fillCell", "class.padChild": "this.padChild" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"!hasActiveEditor()\" [cdkPortalOutlet]=\"getRendererPortal()\" (attached)=\"initialiseRenderer($event)\"></ng-container>\n<ng-container *ngIf=\"hasActiveEditor()\" [cdkPortalOutlet]=\"getEditorPortal()\" (attached)=\"initialiseEditor($event)\"></ng-container>\n", styles: [""], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$4.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }] });
3227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableCellComponent, decorators: [{
3306
3228
  type: Component,
3307
- args: [{ selector: 'aup-table-cell-renderer', template: "<ng-container *ngIf=\"!hasActiveEditor()\" [cdkPortalOutlet]=\"getRendererPortal()\" (attached)=\"initialiseRenderer($event)\"></ng-container>\n<ng-container *ngIf=\"hasActiveEditor()\" [cdkPortalOutlet]=\"getEditorPortal()\" (attached)=\"initialiseEditor($event)\"></ng-container>\n", styles: [""] }]
3229
+ args: [{ selector: 'aup-table-cell', template: "<ng-container *ngIf=\"!hasActiveEditor()\" [cdkPortalOutlet]=\"getRendererPortal()\" (attached)=\"initialiseRenderer($event)\"></ng-container>\n<ng-container *ngIf=\"hasActiveEditor()\" [cdkPortalOutlet]=\"getEditorPortal()\" (attached)=\"initialiseEditor($event)\"></ng-container>\n", styles: [""] }]
3308
3230
  }], ctorParameters: function () { return []; }, propDecorators: { row: [{
3309
3231
  type: Input
3310
3232
  }], column: [{
@@ -3324,7 +3246,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
3324
3246
  args: ['class.padChild']
3325
3247
  }] } });
3326
3248
 
3327
- class TableHeaderCellRendererComponent {
3249
+ class TableHeaderCellComponent {
3328
3250
  constructor() {
3329
3251
  this.defaultClassNames = 'aup-header-cell-renderer';
3330
3252
  }
@@ -3339,11 +3261,11 @@ class TableHeaderCellRendererComponent {
3339
3261
  return this[HEADER_CELL_RENDERER_PORTAL];
3340
3262
  }
3341
3263
  }
3342
- TableHeaderCellRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableHeaderCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3343
- TableHeaderCellRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TableHeaderCellRendererComponent, selector: "aup-table-header-cell-renderer", inputs: { column: "column" }, host: { properties: { "class": "this.defaultClassNames" } }, ngImport: i0, template: "<ng-container [cdkPortalOutlet]=\"getPortal()\" (attached)=\"initialiseHeader($event)\"></ng-container>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;height:100%}\n"], directives: [{ type: i2$4.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }] });
3344
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableHeaderCellRendererComponent, decorators: [{
3264
+ TableHeaderCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableHeaderCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3265
+ TableHeaderCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TableHeaderCellComponent, selector: "aup-table-header-cell", inputs: { column: "column" }, host: { properties: { "class": "this.defaultClassNames" } }, ngImport: i0, template: "<ng-container [cdkPortalOutlet]=\"getPortal()\" (attached)=\"initialiseHeader($event)\"></ng-container>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;height:100%}\n"], directives: [{ type: i2$4.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }] });
3266
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableHeaderCellComponent, decorators: [{
3345
3267
  type: Component,
3346
- args: [{ selector: 'aup-table-header-cell-renderer', template: "<ng-container [cdkPortalOutlet]=\"getPortal()\" (attached)=\"initialiseHeader($event)\"></ng-container>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;height:100%}\n"] }]
3268
+ args: [{ selector: 'aup-table-header-cell', template: "<ng-container [cdkPortalOutlet]=\"getPortal()\" (attached)=\"initialiseHeader($event)\"></ng-container>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;height:100%}\n"] }]
3347
3269
  }], ctorParameters: function () { return []; }, propDecorators: { column: [{
3348
3270
  type: Input
3349
3271
  }], defaultClassNames: [{
@@ -3429,18 +3351,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
3429
3351
  class ColumnListModel extends AbstractComputedListModel {
3430
3352
  constructor() {
3431
3353
  super();
3432
- this._allColumns = new MutableListModel();
3354
+ this._allColumns$ = new MutableListModel();
3433
3355
  const { chain } = Dsl.disposeWith(this);
3434
- this.columnsById = chain(this._allColumns).indexBy('columnId');
3356
+ this.columnsById$ = chain(this._allColumns$).indexBy('columnId');
3435
3357
  }
3436
- get allColumns() {
3437
- return this._allColumns.readonly;
3358
+ get allColumns$() {
3359
+ return this._allColumns$.readonly;
3438
3360
  }
3439
3361
  getColumn(id) {
3440
- return this.columnsById.get(id);
3362
+ return this.columnsById$.get(id);
3441
3363
  }
3442
3364
  hasColumn(id) {
3443
- return !!this.columnsById.get(id);
3365
+ return !!this.columnsById$.get(id);
3444
3366
  }
3445
3367
  addColumn(column, index) {
3446
3368
  if (this.hasColumn(column.columnId)) {
@@ -3449,17 +3371,227 @@ class ColumnListModel extends AbstractComputedListModel {
3449
3371
  this.registerDisposable(column);
3450
3372
  this.runInTransaction(() => {
3451
3373
  if (!isNil(index)) {
3452
- this._allColumns.insert(index, column);
3374
+ this._allColumns$.insert(index, column);
3453
3375
  }
3454
3376
  else {
3455
- this._allColumns.push(column);
3377
+ this._allColumns$.push(column);
3456
3378
  }
3457
- this.registerDisposable(this.trackSource(column.visible));
3379
+ this.registerDisposable(this.trackSource(column.visible$));
3458
3380
  });
3459
3381
  return column;
3460
3382
  }
3461
3383
  doComputeValue() {
3462
- return this._allColumns.value.filter(c => c.visible.value);
3384
+ return this._allColumns$.value.filter(c => c.visible$.value);
3385
+ }
3386
+ }
3387
+
3388
+ class CustomValueColumnModel extends ColumnModel {
3389
+ constructor(columnId, defaults, getValue) {
3390
+ super(columnId, defaults);
3391
+ this.getValue = getValue;
3392
+ this.cellRenderer(DefaultCellRendererComponent);
3393
+ }
3394
+ cellRenderer(componentType, onComponentInitOrOptions) {
3395
+ this.configureColumnTextSearch(EnableCellTextSearch.getFormatter(componentType, () => new ColumnTextSearchFormatter.Null()), row => this.getValue(row));
3396
+ this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
3397
+ if (firstTime) {
3398
+ if (isFunction(onComponentInitOrOptions)) {
3399
+ onComponentInitOrOptions(component);
3400
+ }
3401
+ else {
3402
+ if (isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
3403
+ onComponentInitOrOptions.onComponentInit(component);
3404
+ }
3405
+ }
3406
+ }
3407
+ component.value = this.getValue(rowData.row);
3408
+ if (!isFunction(onComponentInitOrOptions) && isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onRowUpdate)) {
3409
+ onComponentInitOrOptions.onRowUpdate(component, rowData.row);
3410
+ }
3411
+ }));
3412
+ return this;
3413
+ }
3414
+ selectRowOnClick(selectOnRowClick) {
3415
+ return this._selectRowOnClick(selectOnRowClick);
3416
+ }
3417
+ }
3418
+
3419
+ class EditorControlColumnModel extends ColumnModel {
3420
+ constructor(columnId, saveCommandFactory, defaults) {
3421
+ super(columnId, defaults);
3422
+ this.cellRenderer(EditRowControls);
3423
+ }
3424
+ cellRenderer(componentType) {
3425
+ this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {
3426
+ component.row = rowData.row;
3427
+ component.editSession = rowData.editSession;
3428
+ component.editRowCommand = rowData.editRowCommand;
3429
+ }));
3430
+ return this;
3431
+ }
3432
+ getDefaultHeaderText() {
3433
+ return '';
3434
+ }
3435
+ }
3436
+
3437
+ class ListPropertyColumnModel extends ColumnModel {
3438
+ constructor(id, property, defaults) {
3439
+ super(id, defaults);
3440
+ this.property = property;
3441
+ this._format = (value) => value.map(v => v === null || v === void 0 ? void 0 : v.toString()).join(", ");
3442
+ this.cellRenderer(DefaultListCellRendererComponent);
3443
+ }
3444
+ cellRenderer(componentType) {
3445
+ this.configureColumnTextSearch(EnableCellTextSearch.getFormatter(componentType, () => new ColumnTextSearchFormatter.DefaultArrayFormatter()), row => row[this.property]);
3446
+ this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {
3447
+ let rowElement = rowData.row[this.property];
3448
+ // @ts-ignore Started complaining in ts 4.5.. but I think my logic is correct...
3449
+ component.value = this._format(rowElement);
3450
+ }));
3451
+ return this;
3452
+ }
3453
+ cellEditor(editor, validatorsOrInitialiser, initialiseComponent) {
3454
+ const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
3455
+ const initialiser = isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : initialiseComponent;
3456
+ this.configureCellEditor(new CellEditorPortalRef(editor, (component, editSession) => {
3457
+ const formListModel = editSession.form.pluckList(this.property);
3458
+ if (validators) {
3459
+ formListModel.validateUsing(validators);
3460
+ }
3461
+ component.listModel = formListModel;
3462
+ if (initialiser) {
3463
+ initialiser(component);
3464
+ }
3465
+ }));
3466
+ return this;
3467
+ }
3468
+ format(formatter) {
3469
+ assert$1.isFunction(formatter);
3470
+ this._format = formatter;
3471
+ return this;
3472
+ }
3473
+ selectRowOnClick(selectRowOnClick) {
3474
+ return this._selectRowOnClick(selectRowOnClick);
3475
+ }
3476
+ }
3477
+
3478
+ class PropertyColumnModel extends ColumnModel {
3479
+ constructor(id, property, defaults) {
3480
+ super(id, defaults);
3481
+ this.property = property;
3482
+ this._format = (value) => value === null || value === void 0 ? void 0 : value.toString();
3483
+ this.cellRenderer(DefaultCellRendererComponent);
3484
+ }
3485
+ cellRenderer(componentType, onComponentInitOrOptions) {
3486
+ this.configureColumnTextSearch(EnableCellTextSearch.getFormatter(componentType, () => new ColumnTextSearchFormatter.DefaultValueFormatter()), row => row[this.property]);
3487
+ this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
3488
+ if (firstTime) {
3489
+ if (isFunction(onComponentInitOrOptions)) {
3490
+ onComponentInitOrOptions(component);
3491
+ }
3492
+ else {
3493
+ if (isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
3494
+ onComponentInitOrOptions.onComponentInit(component);
3495
+ }
3496
+ }
3497
+ }
3498
+ component.value = this._format(rowData.row[this.property]);
3499
+ }));
3500
+ return this;
3501
+ }
3502
+ liveEditCellRenderer(componentType, options) {
3503
+ return this.mutableCellRenderer(componentType, options);
3504
+ }
3505
+ /**
3506
+ * Deprecated. Use #liveEditCellRenderer instead.
3507
+ * @param componentType
3508
+ * @param options
3509
+ */
3510
+ mutableCellRenderer(componentType, options) {
3511
+ this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
3512
+ // keep a local copy most recent row value so it's available to teh
3513
+ // edit callback without having to add/remove subscribers all the time.
3514
+ component[ColumnModel.CELL_RENDERER_COMPONENT_ROW_CACHE] = rowData.row;
3515
+ let disableEditCallback = false;
3516
+ if (firstTime) {
3517
+ if (isFunction(options === null || options === void 0 ? void 0 : options.onComponentInit)) {
3518
+ options.onComponentInit(component);
3519
+ }
3520
+ // install our edit callback
3521
+ component.onValueEdited((is, was) => {
3522
+ if (!disableEditCallback) {
3523
+ options.onValueEdit(component[ColumnModel.CELL_RENDERER_COMPONENT_ROW_CACHE], is, was);
3524
+ }
3525
+ });
3526
+ }
3527
+ // now push the value the component and disable the callback just incase the component misbehaves
3528
+ // and fires a value change during the operation.
3529
+ disableEditCallback = true;
3530
+ component.value = rowData.row[this.property];
3531
+ disableEditCallback = false;
3532
+ if (!isFunction(options) && isFunction(options === null || options === void 0 ? void 0 : options.onRowUpdate)) {
3533
+ options.onRowUpdate(component, rowData.row);
3534
+ }
3535
+ }));
3536
+ return this;
3537
+ }
3538
+ cellEditor(editor, validatorsOrInitialiser, onComponentInit) {
3539
+ const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
3540
+ const initialiser = isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : onComponentInit;
3541
+ this.configureCellEditor(new CellEditorPortalRef(editor, (component, editSession) => {
3542
+ const formValueModel = editSession.form.pluck(this.property);
3543
+ if (validators) {
3544
+ formValueModel.validateUsing(validators);
3545
+ }
3546
+ component.valueModel = formValueModel;
3547
+ if (initialiser) {
3548
+ initialiser(component);
3549
+ }
3550
+ }));
3551
+ return this;
3552
+ }
3553
+ format(formatter) {
3554
+ assert$1.isFunction(formatter);
3555
+ this._format = formatter;
3556
+ return this;
3557
+ }
3558
+ selectRowOnClick(selectOnRowClick) {
3559
+ return this._selectRowOnClick(selectOnRowClick);
3560
+ }
3561
+ }
3562
+
3563
+ class SelectionColumnModel extends ColumnModel {
3564
+ constructor(columnId, defaults, selectionModel) {
3565
+ super(columnId, defaults);
3566
+ this._enableHeaderControls = true;
3567
+ this.selectionModel = DelegatingSelectionModel.createDelegate();
3568
+ this._selectRowOnClick(false);
3569
+ this.cellHeaderRenderer(SelectionHeaderCellComponent, (component) => {
3570
+ component.selectionModel = this.selectionModel;
3571
+ component.enableHeaderControls = this._enableHeaderControls;
3572
+ });
3573
+ this.configureCellRenderer(new ComponentCellRendererPortalRef(SelectionCellComponent, (component, rowData) => {
3574
+ component.row = rowData.row;
3575
+ component.selectionModel = this.selectionModel;
3576
+ }));
3577
+ this.setSelectionModel(selectionModel);
3578
+ }
3579
+ setSelectionModel(selectionModel) {
3580
+ this.selectionModel.setDelegate(selectionModel);
3581
+ this.setDefaultVisibility(selectionModel instanceof MultipleSelectionModel ? ValueModel.TRUE : ValueModel.FALSE);
3582
+ }
3583
+ getDefaultHeaderText() {
3584
+ return '';
3585
+ }
3586
+ enableHeaderControls(enable) {
3587
+ this._enableHeaderControls = enable;
3588
+ return this;
3589
+ }
3590
+ selectRow(row) {
3591
+ this.selectionModel.selectCommand.execute(row);
3592
+ }
3593
+ isSelected(row) {
3594
+ return this.selectionModel.isSelected(row);
3463
3595
  }
3464
3596
  }
3465
3597
 
@@ -3469,21 +3601,23 @@ class EditSession extends GarbageCollector {
3469
3601
  this.rowId = rowId;
3470
3602
  this.form = form;
3471
3603
  this.saveCommand = saveCommand;
3472
- this._liveRowValue = new MutableValueModel();
3473
- this.liveRowValue = this._liveRowValue.readonly;
3604
+ this._liveRowValue$ = new MutableValueModel();
3605
+ this.liveRowValue$ = this._liveRowValue$.readonly;
3474
3606
  this.form.load(row);
3475
- this._liveRowValue.value = row;
3607
+ this._liveRowValue$.value = row;
3476
3608
  this.form.onEdit(() => {
3477
3609
  // if (!this._liveRowValue.value[immerable]) {
3478
3610
  // console.warn()
3479
3611
  // }
3480
- this._liveRowValue.value = produce(this._liveRowValue.value, draft => {
3612
+ this._liveRowValue$.value = produce(this._liveRowValue$.value, draft => {
3481
3613
  this.form.writeDirtyStateTo(draft);
3482
3614
  });
3483
3615
  });
3484
3616
  }
3485
3617
  }
3486
3618
 
3619
+ var DefaultValueFormatter = ColumnTextSearchFormatter.DefaultValueFormatter;
3620
+ var DefaultArrayFormatter = ColumnTextSearchFormatter.DefaultArrayFormatter;
3487
3621
  // export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];
3488
3622
  // export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];
3489
3623
  class RowClass {
@@ -3500,39 +3634,69 @@ class AbstractTableModel extends GarbageCollector {
3500
3634
  this._editorSessions = new MutableListModel();
3501
3635
  this.rowClassNamePredicates = [];
3502
3636
  this.rowClickListeners = new EventListenerList();
3637
+ this._searchText$ = new DelegatingValueModel();
3503
3638
  this._createForm = (row) => new DirtyTrackingForm();
3504
3639
  this.trackBy = (index, item) => {
3505
3640
  return this.identityOf ? this.identityOf(item) : index;
3506
3641
  };
3507
3642
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
3508
- this._rowsBeingEdited = new MutableListModel([], {
3643
+ this._rowsBeingEdited$ = new MutableListModel([], {
3509
3644
  identifiedWith: row => this.identityOf(row)
3510
3645
  });
3511
- this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');
3512
- this.editing = chain(this._editorSessions).count().isGreaterThan(0);
3513
- this.dataSource = chain(this._dataSource).replaceAll(this.rowsBeingEdited);
3514
- this.firstEditableColumn = chain(this.columns).select(c => c.hasEditorPortal()).first();
3515
- this.firstVisibleColumn = chain(this._columnList).first();
3516
- this.lastVisibleColumn = chain(this._columnList).last();
3517
- this.rowSelectionDisabledOnAllColumns = chain(this._columnList).select(column => column.isRowSelectionEnabled()).count().equals(0);
3646
+ this._editorSessionByRowId = chain(this._editorSessions).indexBy("rowId");
3647
+ this.editing$ = chain(this._editorSessions).count().isGreaterThan(0);
3648
+ this._textSearchPredicate$ = chain(this._searchText$).map(text => {
3649
+ return _.isEmpty(text) ? Functions.identity : (rows) => {
3650
+ const regex = new RegExp(escapeStringRegexp(text), "i");
3651
+ return rows.filter(row => this.hasMatchingColumn(row, regex));
3652
+ };
3653
+ }, {
3654
+ allowNil: true,
3655
+ dependsOn: this.columns
3656
+ });
3657
+ this.dataSource = chain(this._dataSource)
3658
+ .reduceToList(items => this._textSearchPredicate$.value(items), {
3659
+ dependsOn: this._textSearchPredicate$
3660
+ })
3661
+ .replaceAll(this.rowsBeingEdited$);
3662
+ this.firstEditableColumn$ = chain(this.columns).select(c => c.hasEditorPortal()).first();
3663
+ this.firstVisibleColumn$ = chain(this._columnList).first();
3664
+ this.lastVisibleColumn$ = chain(this._columnList).last();
3665
+ this.rowSelectionDisabledOnAllColumns$ = chain(this._columnList).select(column => column.isRowSelectionEnabled()).count().equals(0);
3518
3666
  }
3519
3667
  findMatchingColumns(row, regex) {
3520
- return this.columns.value.filter(c => c.isTextMatch(row, regex));
3668
+ return this.columns.value.filter(c => regex.test(c.getSearchTextFor(row)));
3521
3669
  }
3670
+ // @Trace()
3522
3671
  hasMatchingColumn(row, regex) {
3523
- return !!this.columns.value.find(c => c.isTextMatch(row, regex));
3672
+ return !!this.columns.value.find(c => regex.test(c.getSearchTextFor(row)));
3673
+ }
3674
+ initialise(injector) {
3675
+ // not sure if I should define these at the module level or not...
3676
+ const customInjector = Injector.create({
3677
+ providers: [
3678
+ { provide: DefaultValueFormatter },
3679
+ { provide: DefaultArrayFormatter }
3680
+ ],
3681
+ parent: injector
3682
+ });
3683
+ this.columns.value.forEach(c => c.initialise(customInjector));
3524
3684
  }
3525
3685
  setDataSource(sourceOfTruth) {
3526
3686
  this._dataSource.setDelegate(sourceOfTruth);
3527
3687
  }
3688
+ setTextSearch(searchText$, throttleDelayMilliseconds = 100) {
3689
+ const { chain } = Dsl.disposeWith(this);
3690
+ this._searchText$.setDelegate(chain(searchText$).throttle(throttleDelayMilliseconds));
3691
+ }
3528
3692
  identityOf(row) {
3529
3693
  return this._dataSource.identityOf(row);
3530
3694
  }
3531
- get rowsBeingEdited() {
3532
- return this._rowsBeingEdited.readonly;
3695
+ get rowsBeingEdited$() {
3696
+ return this._rowsBeingEdited$.readonly;
3533
3697
  }
3534
3698
  get columns() {
3535
- return this._columnList.allColumns;
3699
+ return this._columnList.allColumns$;
3536
3700
  }
3537
3701
  get visibleColumns() {
3538
3702
  return this._columnList.readonly;
@@ -3547,9 +3711,9 @@ class AbstractTableModel extends GarbageCollector {
3547
3711
  }
3548
3712
  _addSelectionColumn(selectionModel, visible) {
3549
3713
  assert.isNil(this.selectionColumnModel);
3550
- const columnId = 'selection-column';
3714
+ const columnId = "selection-column";
3551
3715
  this.selectionColumnModel = new SelectionColumnModel(columnId, () => this.getColumnTextProperties(columnId), selectionModel);
3552
- this.addRowClass('aup-row-selected', row => this.selectionColumnModel.isSelected(row));
3716
+ this.addRowClass("aup-row-selected", row => this.selectionColumnModel.isSelected(row));
3553
3717
  const selectionColumnModel = this.addColumn(this.selectionColumnModel, 0);
3554
3718
  if (!isNil(visible)) {
3555
3719
  selectionColumnModel.visibleWhile(visible instanceof ValueModel ? visible : ValueModel.constant(visible));
@@ -3561,7 +3725,7 @@ class AbstractTableModel extends GarbageCollector {
3561
3725
  if (isFunction(formFactory)) {
3562
3726
  this._createForm = formFactory;
3563
3727
  }
3564
- const columnId = 'editControls';
3728
+ const columnId = "editControls";
3565
3729
  return this.addColumn(new EditorControlColumnModel(columnId, saveCommandFactory, () => this.getColumnTextProperties(columnId)));
3566
3730
  }
3567
3731
  addCustomColumn(columnId, dataAccessor) {
@@ -3603,7 +3767,7 @@ class AbstractTableModel extends GarbageCollector {
3603
3767
  }
3604
3768
  startEditSession(row) {
3605
3769
  const rowId = this.identityOf(row);
3606
- if (this._rowsBeingEdited.query().indexOf(row) > -1) {
3770
+ if (this._rowsBeingEdited$.query().indexOf(row) > -1) {
3607
3771
  return lang.illegalState(`Row with id=${rowId} already being edited`);
3608
3772
  }
3609
3773
  // todo: pass the factories to the edit session so we can make the whole lot pluggable?
@@ -3611,12 +3775,12 @@ class AbstractTableModel extends GarbageCollector {
3611
3775
  const saveCommand = this.saveCommandFactory.create(form);
3612
3776
  const editSession = new EditSession(rowId, row, form, saveCommand);
3613
3777
  const { when } = Dsl.disposeWith(editSession);
3614
- when(editSession.liveRowValue).changes((editedValue) => {
3615
- this._rowsBeingEdited.replaceOrPush(editedValue);
3616
- }, { initialValue: 'triggerChangeUnlessNil' });
3778
+ when(editSession.liveRowValue$).changes((editedValue) => {
3779
+ this._rowsBeingEdited$.replaceOrPush(editedValue);
3780
+ }, { initialValue: "triggerChangeUnlessNil" });
3617
3781
  this._editorSessions.push(editSession);
3618
3782
  editSession.onDispose(() => {
3619
- this._rowsBeingEdited.remove(editSession.liveRowValue.value);
3783
+ this._rowsBeingEdited$.remove(editSession.liveRowValue$.value);
3620
3784
  this._editorSessions.remove(editSession);
3621
3785
  });
3622
3786
  return editSession;
@@ -3626,7 +3790,7 @@ class AbstractTableModel extends GarbageCollector {
3626
3790
  }
3627
3791
  cancelAllEditorSessions() {
3628
3792
  this._editorSessions.runInTransaction((draft) => {
3629
- this._rowsBeingEdited.runInTransaction(() => {
3793
+ this._rowsBeingEdited$.runInTransaction(() => {
3630
3794
  draft.value.forEach(session => session.dispose());
3631
3795
  });
3632
3796
  });
@@ -3635,7 +3799,7 @@ class AbstractTableModel extends GarbageCollector {
3635
3799
  return this.isRowSelectionEnabled() && column.isRowSelectionEnabled();
3636
3800
  }
3637
3801
  isRowSelectionEnabled() {
3638
- return this.hasUserSelectionModel() && !this.rowSelectionDisabledOnAllColumns.value;
3802
+ return this.hasUserSelectionModel() && !this.rowSelectionDisabledOnAllColumns$.value;
3639
3803
  }
3640
3804
  hasUserSelectionModel() {
3641
3805
  var _a;
@@ -3670,7 +3834,7 @@ TrackExternal.oneTimeBinding(AbstractTableModel);
3670
3834
  /**
3671
3835
  * Create your model:
3672
3836
  * @example
3673
- * this.heroTableModel = TableModel.fromList(heroList, table => {
3837
+ * this.heroTableModel = new TableModel(heroList, table => {
3674
3838
  * table.pluck("firstName");
3675
3839
  * table.pluck("lastName");
3676
3840
  * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
@@ -3682,7 +3846,7 @@ TrackExternal.oneTimeBinding(AbstractTableModel);
3682
3846
  *
3683
3847
  * Column templates
3684
3848
  * @example
3685
- * this.heroTableModel = TableModel.fromList(heroList, table => {
3849
+ * this.heroTableModel = new TableModel(heroList, table => {
3686
3850
  * table.pluck("firstName");
3687
3851
  * table.pluck("lastName");
3688
3852
  * table.addTemplateColumn("specialColumn");
@@ -3728,17 +3892,17 @@ TrackExternal.oneTimeBinding(AbstractTableModel);
3728
3892
  * }
3729
3893
  */
3730
3894
  class TableComponent extends AbstractTableComponent {
3731
- constructor(elementRef, ngZone) {
3732
- super(elementRef, ngZone);
3895
+ constructor(elementRef, ngZone, injector) {
3896
+ super(elementRef, ngZone, injector);
3733
3897
  }
3734
3898
  getModel() {
3735
3899
  return this.tableModel;
3736
3900
  }
3737
3901
  }
3738
- TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
3902
+ TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TableComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
3739
3903
  TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TableComponent, selector: "aup-table", inputs: { tableModel: "tableModel" }, providers: [
3740
3904
  { provide: AbstractTableComponent, useExisting: TableComponent }
3741
- ], usesInheritance: true, ngImport: i0, template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}\n"], components: [{ type: i1$b.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: TableHeaderCellRendererComponent, selector: "aup-table-header-cell-renderer", inputs: ["column"] }, { type: TableCellRendererComponent, selector: "aup-table-cell-renderer", inputs: ["row", "column", "editSession", "tableModel"] }, { type: i1$b.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i1$b.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$b.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i1$b.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i1$b.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i1$b.MatCellDef, selector: "[matCellDef]" }, { type: i1$b.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i1$b.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i1$b.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
3905
+ ], usesInheritance: true, ngImport: i0, template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}\n"], components: [{ type: i1$b.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: TableHeaderCellComponent, selector: "aup-table-header-cell", inputs: ["column"] }, { type: TableCellComponent, selector: "aup-table-cell", inputs: ["row", "column", "editSession", "tableModel"] }, { type: i1$b.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i1$b.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$b.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i1$b.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i1$b.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i1$b.MatCellDef, selector: "[matCellDef]" }, { type: i1$b.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i1$b.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i1$b.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
3742
3906
  __decorate([
3743
3907
  TrackExternal(),
3744
3908
  __metadata("design:type", AbstractTableModel)
@@ -3747,8 +3911,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
3747
3911
  type: Component,
3748
3912
  args: [{ selector: 'aup-table', providers: [
3749
3913
  { provide: AbstractTableComponent, useExisting: TableComponent }
3750
- ], template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}\n"] }]
3751
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { tableModel: [{
3914
+ ], template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}\n"] }]
3915
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Injector }]; }, propDecorators: { tableModel: [{
3752
3916
  type: Input
3753
3917
  }] } });
3754
3918
 
@@ -4328,17 +4492,17 @@ class TreeTableModel extends AbstractTableModel {
4328
4492
  * }
4329
4493
  */
4330
4494
  class TreeTableComponent extends AbstractTableComponent {
4331
- constructor(elementRef, ngZone) {
4332
- super(elementRef, ngZone);
4495
+ constructor(elementRef, ngZone, injector) {
4496
+ super(elementRef, ngZone, injector);
4333
4497
  }
4334
4498
  getModel() {
4335
4499
  return this.treeTableModel;
4336
4500
  }
4337
4501
  }
4338
- TreeTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeTableComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
4502
+ TreeTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: TreeTableComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
4339
4503
  TreeTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TreeTableComponent, selector: "aup-tree-table", inputs: { treeTableModel: "treeTableModel" }, providers: [
4340
4504
  { provide: AbstractTableComponent, useExisting: TreeTableComponent }
4341
- ], usesInheritance: true, ngImport: i0, template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}\n", "td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}td.mat-column-tree-label,td.mat-column-tree-label{width:1px}aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}aup-tree-label-cell-renderer{flex:1}\n"], components: [{ type: i1$b.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: TableHeaderCellRendererComponent, selector: "aup-table-header-cell-renderer", inputs: ["column"] }, { type: TableCellRendererComponent, selector: "aup-table-cell-renderer", inputs: ["row", "column", "editSession", "tableModel"] }, { type: i1$b.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i1$b.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$b.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i1$b.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i1$b.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i1$b.MatCellDef, selector: "[matCellDef]" }, { type: i1$b.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i1$b.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i1$b.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
4505
+ ], usesInheritance: true, ngImport: i0, template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}\n", "td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}td.mat-column-tree-label,td.mat-column-tree-label{width:1px}aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}aup-tree-label-cell-renderer{flex:1}\n"], components: [{ type: i1$b.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: TableHeaderCellComponent, selector: "aup-table-header-cell", inputs: ["column"] }, { type: TableCellComponent, selector: "aup-table-cell", inputs: ["row", "column", "editSession", "tableModel"] }, { type: i1$b.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i1$b.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$b.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i1$b.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i1$b.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i1$b.MatCellDef, selector: "[matCellDef]" }, { type: i1$b.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i1$b.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i1$b.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
4342
4506
  __decorate([
4343
4507
  TrackExternal(),
4344
4508
  __metadata("design:type", TreeTableModel)
@@ -4347,8 +4511,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
4347
4511
  type: Component,
4348
4512
  args: [{ selector: 'aup-tree-table', providers: [
4349
4513
  { provide: AbstractTableComponent, useExisting: TreeTableComponent }
4350
- ], template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}\n", "td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}td.mat-column-tree-label,td.mat-column-tree-label{width:1px}aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}aup-tree-label-cell-renderer{flex:1}\n"] }]
4351
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { treeTableModel: [{
4514
+ ], template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}\n", "td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}td.mat-column-tree-label,td.mat-column-tree-label{width:1px}aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}aup-tree-label-cell-renderer{flex:1}\n"] }]
4515
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Injector }]; }, propDecorators: { treeTableModel: [{
4352
4516
  type: Input
4353
4517
  }] } });
4354
4518
 
@@ -4576,11 +4740,12 @@ ComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
4576
4740
  EditRowControls,
4577
4741
  ColumnTemplateDirective,
4578
4742
  DefaultCellRendererComponent,
4579
- TableCellRendererComponent,
4580
- SelectCellRendererComponent,
4581
- SelectHeaderCellRendererComponent,
4743
+ DefaultListCellRendererComponent,
4744
+ TableCellComponent,
4745
+ SelectionCellComponent,
4746
+ SelectionHeaderCellComponent,
4582
4747
  DefaultHeaderCellRendererComponent,
4583
- TableHeaderCellRendererComponent,
4748
+ TableHeaderCellComponent,
4584
4749
  IconComponent,
4585
4750
  SectionHeaderComponent,
4586
4751
  TableRowMenuComponent,
@@ -4739,11 +4904,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
4739
4904
  EditRowControls,
4740
4905
  ColumnTemplateDirective,
4741
4906
  DefaultCellRendererComponent,
4742
- TableCellRendererComponent,
4743
- SelectCellRendererComponent,
4744
- SelectHeaderCellRendererComponent,
4907
+ DefaultListCellRendererComponent,
4908
+ TableCellComponent,
4909
+ SelectionCellComponent,
4910
+ SelectionHeaderCellComponent,
4745
4911
  DefaultHeaderCellRendererComponent,
4746
- TableHeaderCellRendererComponent,
4912
+ TableHeaderCellComponent,
4747
4913
  IconComponent,
4748
4914
  SectionHeaderComponent,
4749
4915
  TableRowMenuComponent,
@@ -8149,14 +8315,6 @@ class TableModel extends AbstractTableModel {
8149
8315
  }
8150
8316
  this.setDataSource(sourceOfTruth);
8151
8317
  }
8152
- /**
8153
- * @deprecated use new TableModel(sourceOfTruth, table => {...}); instead.
8154
- * @param sourceOfTruth
8155
- * @param builder
8156
- */
8157
- static fromList(sourceOfTruth, builder) {
8158
- return new TableModel(sourceOfTruth, builder);
8159
- }
8160
8318
  addSelectionColumn(selectionModel, showSelectionColumn) {
8161
8319
  return this._addSelectionColumn(selectionModel, showSelectionColumn);
8162
8320
  }
@@ -10117,5 +10275,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
10117
10275
  * Generated bundle index. Do not edit.
10118
10276
  */
10119
10277
 
10120
- export { ACTIVITY_DATA, ALERT_CONFIG, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractActivityTriggerComponent, AbstractCardContainerComponent, AbstractConfirmDialogComponent, AbstractDialogComponent, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddCardActivityComponent, AddItemInteractionContextComponent, Alert, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CardStackComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnListModel, ColumnModel, ColumnTemplateDirective, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmThenExecuteDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FlattenedTreeListModel, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, HighlightPipe, HighlightTextModelDirective, HorizontalAlignment, IconComponent, InPlaceInteractionContextComponent, InlineActivityTriggerComponent, InlineEditorModel, InlineStringEditorComponent, InputActivity, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, LabelledValueComponent, ListPlaceNavComponent, ListPropertyColumnModel, LoadingContainerComponent, MarkdownComponent, MarkdownService, ModalActivityTriggerComponent, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupActivityTriggerComponent, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputActivity, SelectInputComponent, SelectionColumnModel, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, VisibilityService, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, markdownPillExtension, slideDownOnEnterAnimation, slideRightOnEnterAnimation, treeNodeDecorator };
10278
+ export { ACTIVITY_DATA, ALERT_CONFIG, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractActivityTriggerComponent, AbstractCardContainerComponent, AbstractConfirmDialogComponent, AbstractDialogComponent, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddCardActivityComponent, AddItemInteractionContextComponent, Alert, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CardStackComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnListModel, ColumnModel, ColumnTemplateDirective, ColumnTextSearchFormatter, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmThenExecuteDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DefaultListCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EnableCellTextSearch, EventCleanUpSession, FlattenedTreeListModel, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, HighlightPipe, HighlightTextModelDirective, HorizontalAlignment, IconComponent, InPlaceInteractionContextComponent, InlineActivityTriggerComponent, InlineEditorModel, InlineStringEditorComponent, InputActivity, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, Keys, LEFT_RIGHT_PLACE_ANIMATION, LabelledValueComponent, ListPlaceNavComponent, ListPropertyColumnModel, LoadingContainerComponent, MarkdownComponent, MarkdownService, ModalActivityTriggerComponent, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupActivityTriggerComponent, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectInputActivity, SelectInputComponent, SelectionCellComponent, SelectionColumnModel, SelectionHeaderCellComponent, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellComponent, TableComponent, TableHeaderCellComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, VisibilityService, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, markdownPillExtension, slideDownOnEnterAnimation, slideRightOnEnterAnimation, treeNodeDecorator };
10121
10279
  //# sourceMappingURL=coolon-angular-ui-powerups.mjs.map