@coolon/angular-ui-powerups 13.1.7 → 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.
- package/assets/table.scss +2 -2
- package/esm2020/lib/components/components.module.mjs +22 -19
- package/esm2020/lib/components/exports.mjs +28 -21
- package/esm2020/lib/components/tables/abstract-table-model.mjs +70 -29
- package/esm2020/lib/components/tables/abstract-table.component.mjs +12 -10
- package/esm2020/lib/components/tables/column/column-list-model.mjs +39 -0
- package/esm2020/lib/components/tables/column/column-model.mjs +180 -0
- package/esm2020/lib/components/tables/column/column-template/column-template.directive.mjs +35 -0
- package/esm2020/lib/components/tables/column/column-text-properties.mjs +2 -0
- package/esm2020/lib/components/tables/column/custom-template-column-model.mjs +16 -0
- package/esm2020/lib/components/tables/column/custom-value-column-model.mjs +37 -0
- package/esm2020/lib/components/tables/column/editor-controls-column-model.mjs +21 -0
- package/esm2020/lib/components/tables/column/list-propery-column-model.mjs +48 -0
- package/esm2020/lib/components/tables/column/property-column-model.mjs +92 -0
- package/esm2020/lib/components/tables/column/selection-column-model.mjs +40 -0
- package/esm2020/lib/components/tables/editor/edit-row-controls/edit-row-controls.component.mjs +55 -0
- package/esm2020/lib/components/tables/editor/edit-session.mjs +23 -0
- package/esm2020/lib/components/tables/editor/editable-cell-renderer.mjs +2 -0
- package/esm2020/lib/components/tables/{table/paginator → paginator}/paginator.component.mjs +4 -4
- package/esm2020/lib/components/tables/renderer/cell-editors.mjs +2 -0
- package/esm2020/lib/components/tables/renderer/cell-portal-ref.mjs +93 -0
- package/esm2020/lib/components/tables/renderer/cell-renderer.mjs +2 -0
- package/esm2020/lib/components/tables/renderer/default-cell-renderer/default-cell-renderer.component.mjs +30 -0
- package/esm2020/lib/components/tables/{table → renderer}/default-header-cell-renderer/default-header-cell-renderer.component.mjs +1 -1
- package/esm2020/lib/components/tables/renderer/default-list-cell-renderer/default-list-cell-renderer.component.mjs +40 -0
- package/esm2020/lib/components/tables/renderer/select-header-cell/selection-header-cell.component.mjs +31 -0
- package/esm2020/lib/components/tables/renderer/selection-cell/selection-cell.component.mjs +26 -0
- package/esm2020/lib/components/tables/renderer/table-cell/table-cell.component.mjs +93 -0
- package/esm2020/lib/components/tables/renderer/table-header-cell/table-header-cell.component.mjs +32 -0
- package/esm2020/lib/components/tables/search/column-text-search-formatter.mjs +52 -0
- package/esm2020/lib/components/tables/search/enable-cell-text-search.decorator.mjs +30 -0
- package/esm2020/lib/components/tables/table/table-model.mjs +2 -10
- package/esm2020/lib/components/tables/table/table.component.mjs +12 -12
- package/esm2020/lib/components/tables/table-row-menu/table-row-menu.component.mjs +84 -0
- package/esm2020/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.mjs +1 -1
- package/esm2020/lib/components/tables/tree-table/tree-label-column-model.mjs +3 -3
- package/esm2020/lib/components/tables/tree-table/tree-table-component.mjs +10 -10
- package/esm2020/lib/components/tables/tree-table/tree-table-model.mjs +1 -1
- package/fesm2015/coolon-angular-ui-powerups.mjs +608 -446
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +740 -580
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/components.module.d.ts +55 -54
- package/lib/components/exports.d.ts +27 -20
- package/lib/components/tables/abstract-table-model.d.ts +24 -13
- package/lib/components/tables/abstract-table.component.d.ts +6 -5
- package/lib/components/tables/{column-list-model.d.ts → column/column-list-model.d.ts} +4 -4
- package/lib/components/tables/column/column-model.d.ts +77 -0
- package/lib/components/tables/column/custom-template-column-model.d.ts +8 -0
- package/lib/components/tables/column/custom-value-column-model.d.ts +10 -0
- package/lib/components/tables/column/editor-controls-column-model.d.ts +13 -0
- package/lib/components/tables/column/list-propery-column-model.d.ts +15 -0
- package/lib/components/tables/column/property-column-model.d.ts +24 -0
- package/lib/components/tables/column/selection-column-model.d.ts +12 -0
- package/lib/components/tables/{table → editor}/edit-row-controls/edit-row-controls.component.d.ts +1 -1
- package/lib/components/tables/{edit-session.d.ts → editor/edit-session.d.ts} +2 -2
- package/lib/components/tables/{table/mutable-cell-renderer.d.ts → editor/editable-cell-renderer.d.ts} +2 -2
- package/lib/components/tables/{table/paginator → paginator}/paginator.component.d.ts +1 -1
- package/lib/components/tables/{table → renderer}/cell-portal-ref.d.ts +18 -18
- package/lib/components/tables/renderer/cell-renderer.d.ts +3 -0
- package/lib/components/tables/{table → renderer}/default-cell-renderer/default-cell-renderer.component.d.ts +1 -1
- package/lib/components/tables/renderer/default-list-cell-renderer/default-list-cell-renderer.component.d.ts +12 -0
- 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
- package/lib/components/tables/{table/select-cell-renderer/select-cell-renderer.component.d.ts → renderer/selection-cell/selection-cell.component.d.ts} +3 -3
- package/lib/components/tables/{table/table-cell-renderer/table-cell-renderer.component.d.ts → renderer/table-cell/table-cell.component.d.ts} +5 -5
- 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
- package/lib/components/tables/search/column-text-search-formatter.d.ts +28 -0
- package/lib/components/tables/search/enable-cell-text-search.decorator.d.ts +25 -0
- package/lib/components/tables/table/table-model.d.ts +3 -9
- package/lib/components/tables/table/table.component.d.ts +4 -4
- package/lib/components/tables/{table/table-row-menu → table-row-menu}/table-row-menu.component.d.ts +3 -3
- package/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.d.ts +1 -1
- package/lib/components/tables/tree-table/tree-label-column-model.d.ts +1 -1
- package/lib/components/tables/tree-table/tree-table-component.d.ts +2 -2
- package/lib/components/tables/tree-table/tree-table-model.d.ts +1 -1
- package/package.json +2 -1
- package/esm2020/lib/components/tables/column-list-model.mjs +0 -39
- package/esm2020/lib/components/tables/edit-session.mjs +0 -23
- package/esm2020/lib/components/tables/table/cell-editors.mjs +0 -2
- package/esm2020/lib/components/tables/table/cell-portal-ref.mjs +0 -93
- package/esm2020/lib/components/tables/table/cell-renderer.mjs +0 -2
- package/esm2020/lib/components/tables/table/column-model.mjs +0 -392
- package/esm2020/lib/components/tables/table/column-template/column-template.directive.mjs +0 -35
- package/esm2020/lib/components/tables/table/column-text-properties.mjs +0 -2
- package/esm2020/lib/components/tables/table/default-cell-renderer/default-cell-renderer.component.mjs +0 -22
- package/esm2020/lib/components/tables/table/edit-row-controls/edit-row-controls.component.mjs +0 -55
- package/esm2020/lib/components/tables/table/mutable-cell-renderer.mjs +0 -2
- package/esm2020/lib/components/tables/table/select-cell-renderer/select-cell-renderer.component.mjs +0 -26
- package/esm2020/lib/components/tables/table/select-header-cell-renderer/select-header-cell-renderer.component.mjs +0 -31
- package/esm2020/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.mjs +0 -93
- package/esm2020/lib/components/tables/table/table-def.mjs +0 -2
- package/esm2020/lib/components/tables/table/table-header-cell-renderer/table-header-cell-renderer.component.mjs +0 -32
- package/esm2020/lib/components/tables/table/table-row-menu/table-row-menu.component.mjs +0 -84
- package/esm2020/lib/components/tables/table/text-search-predicate.mjs +0 -2
- package/lib/components/tables/table/cell-renderer.d.ts +0 -5
- package/lib/components/tables/table/column-model.d.ts +0 -145
- package/lib/components/tables/table/table-def.d.ts +0 -7
- package/lib/components/tables/table/text-search-predicate.d.ts +0 -1
- /package/lib/components/tables/{table → column}/column-template/column-template.directive.d.ts +0 -0
- /package/lib/components/tables/{table → column}/column-text-properties.d.ts +0 -0
- /package/lib/components/tables/{table → renderer}/cell-editors.d.ts +0 -0
- /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,
|
|
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,
|
|
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,
|
|
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
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
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
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2582
|
+
ColumnTextSearchFormatter.forFormatter = forFormatter;
|
|
2583
|
+
class Null extends ColumnTextSearchFormatter {
|
|
2584
|
+
format(value) {
|
|
2585
|
+
return "";
|
|
2586
|
+
}
|
|
2597
2587
|
}
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
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 =
|
|
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
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2606
|
+
const noop = () => {
|
|
2607
|
+
};
|
|
2608
|
+
class ColumnTextSearchWrapper extends ColumnTextSearchFormatter.Delegate {
|
|
2639
2609
|
constructor() {
|
|
2640
|
-
super();
|
|
2641
|
-
this.
|
|
2642
|
-
this.selectionModel.toggleAllCommand.execute();
|
|
2643
|
-
});
|
|
2610
|
+
super(...arguments);
|
|
2611
|
+
this._map = Functions.identity;
|
|
2644
2612
|
}
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2613
|
+
initialise(injector) {
|
|
2614
|
+
if (this._delegate instanceof ColumnTextSearchFormatter.Delegate) {
|
|
2615
|
+
this._delegate.initialise(injector);
|
|
2616
|
+
}
|
|
2648
2617
|
}
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
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
|
-
|
|
2654
|
-
|
|
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.
|
|
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,32 +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
|
|
2652
|
+
return this.visible$.value;
|
|
2693
2653
|
}
|
|
2694
|
-
get visible() {
|
|
2695
|
-
return this._visible
|
|
2654
|
+
get visible$() {
|
|
2655
|
+
return this._visible$.readonly;
|
|
2696
2656
|
}
|
|
2697
2657
|
visibleWhile(visible) {
|
|
2698
|
-
this._visible
|
|
2658
|
+
this._visible$.setDelegate(visible);
|
|
2699
2659
|
return this;
|
|
2700
2660
|
}
|
|
2701
2661
|
setDefaultVisibility(visible) {
|
|
2702
|
-
this._defaultVisibility
|
|
2662
|
+
this._defaultVisibility$.setDelegate(visible);
|
|
2703
2663
|
}
|
|
2704
2664
|
getDefaultHeaderText() {
|
|
2705
2665
|
return this.columnId;
|
|
2706
2666
|
}
|
|
2707
|
-
get isTextMatch() {
|
|
2708
|
-
return this._columnModelTextSearchPredicate || this._cellRendererTextSearchPredicate || DEFAULT_TEXT_SEARCH_PREDICATE;
|
|
2709
|
-
}
|
|
2710
|
-
/**
|
|
2711
|
-
* Sets the predicate to use when checking if the specified row is a text match for this column.
|
|
2712
|
-
* @param predicate
|
|
2713
|
-
*/
|
|
2714
|
-
useTextSearchPredicate(predicate) {
|
|
2715
|
-
this._columnModelTextSearchPredicate = predicate;
|
|
2716
|
-
return this;
|
|
2717
|
-
}
|
|
2718
2667
|
getColumnTextProperties() {
|
|
2719
2668
|
return this._columnTextProperties || this.textPropertiesProvider();
|
|
2720
2669
|
}
|
|
@@ -2729,6 +2678,14 @@ class ColumnModel extends GarbageCollector {
|
|
|
2729
2678
|
this._columnTextProperties = columnTextProperties;
|
|
2730
2679
|
return this;
|
|
2731
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
|
+
}
|
|
2732
2689
|
configureHeaderRenderer(config) {
|
|
2733
2690
|
this._columnHeaderPortalRef = config;
|
|
2734
2691
|
}
|
|
@@ -2767,12 +2724,6 @@ class ColumnModel extends GarbageCollector {
|
|
|
2767
2724
|
onRendererAttached(host, ref) {
|
|
2768
2725
|
const component = this.getComponentOrEmbeddedView(ref);
|
|
2769
2726
|
this._cellRendererPortalRef.onPortalAttached(host, component);
|
|
2770
|
-
if (isFunction(component === null || component === void 0 ? void 0 : component.matches)) {
|
|
2771
|
-
this._cellRendererTextSearchPredicate = (row, text) => component.matches(row, text);
|
|
2772
|
-
}
|
|
2773
|
-
else {
|
|
2774
|
-
this._cellRendererTextSearchPredicate = undefined;
|
|
2775
|
-
}
|
|
2776
2727
|
}
|
|
2777
2728
|
// @Trace()
|
|
2778
2729
|
onEditorAttached(host, ref) {
|
|
@@ -2805,6 +2756,9 @@ class ColumnModel extends GarbageCollector {
|
|
|
2805
2756
|
return ref;
|
|
2806
2757
|
}
|
|
2807
2758
|
}
|
|
2759
|
+
initialise(injector) {
|
|
2760
|
+
this.textSearchDelegate.initialise(injector);
|
|
2761
|
+
}
|
|
2808
2762
|
}
|
|
2809
2763
|
__decorate([
|
|
2810
2764
|
Memoize(),
|
|
@@ -2818,182 +2772,10 @@ __decorate([
|
|
|
2818
2772
|
__metadata("design:paramtypes", []),
|
|
2819
2773
|
__metadata("design:returntype", Object)
|
|
2820
2774
|
], ColumnModel.prototype, "getColumnTextProperties", null);
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
this._format = (value) => value === null || value === void 0 ? void 0 : value.toString();
|
|
2826
|
-
this.cellRenderer(DefaultCellRendererComponent);
|
|
2827
|
-
this.useTextSearchPredicate((row, regex) => {
|
|
2828
|
-
return regex.test(this._format(row[this.property]));
|
|
2829
|
-
});
|
|
2830
|
-
}
|
|
2831
|
-
cellRenderer(componentType, onComponentInitOrOptions) {
|
|
2832
|
-
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
|
|
2833
|
-
if (firstTime) {
|
|
2834
|
-
if (isFunction(onComponentInitOrOptions)) {
|
|
2835
|
-
onComponentInitOrOptions(component);
|
|
2836
|
-
}
|
|
2837
|
-
else {
|
|
2838
|
-
if (isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
|
|
2839
|
-
onComponentInitOrOptions.onComponentInit(component);
|
|
2840
|
-
}
|
|
2841
|
-
}
|
|
2842
|
-
}
|
|
2843
|
-
component.value = this._format(rowData.row[this.property]);
|
|
2844
|
-
}));
|
|
2845
|
-
return this;
|
|
2846
|
-
}
|
|
2847
|
-
liveEditCellRenderer(componentType, options) {
|
|
2848
|
-
return this.mutableCellRenderer(componentType, options);
|
|
2849
|
-
}
|
|
2850
|
-
/**
|
|
2851
|
-
* Deprecated. Use #liveEditCellRenderer instead.
|
|
2852
|
-
* @param componentType
|
|
2853
|
-
* @param options
|
|
2854
|
-
*/
|
|
2855
|
-
mutableCellRenderer(componentType, options) {
|
|
2856
|
-
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
|
|
2857
|
-
// keep a local copy most recent row value so it's available to teh
|
|
2858
|
-
// edit callback without having to add/remove subscribers all the time.
|
|
2859
|
-
component[CELL_RENDERER_COMPONENT_ROW_CACHE] = rowData.row;
|
|
2860
|
-
let disableEditCallback = false;
|
|
2861
|
-
if (firstTime) {
|
|
2862
|
-
if (isFunction(options === null || options === void 0 ? void 0 : options.onComponentInit)) {
|
|
2863
|
-
options.onComponentInit(component);
|
|
2864
|
-
}
|
|
2865
|
-
// install our edit callback
|
|
2866
|
-
component.onValueEdited((is, was) => {
|
|
2867
|
-
if (!disableEditCallback) {
|
|
2868
|
-
options.onValueEdit(component[CELL_RENDERER_COMPONENT_ROW_CACHE], is, was);
|
|
2869
|
-
}
|
|
2870
|
-
});
|
|
2871
|
-
}
|
|
2872
|
-
// now push the value the component and disable the callback just incase the component misbehaves
|
|
2873
|
-
// and fires a value change during the operation.
|
|
2874
|
-
disableEditCallback = true;
|
|
2875
|
-
component.value = rowData.row[this.property];
|
|
2876
|
-
disableEditCallback = false;
|
|
2877
|
-
if (!isFunction(options) && isFunction(options === null || options === void 0 ? void 0 : options.onRowUpdate)) {
|
|
2878
|
-
options.onRowUpdate(component, rowData.row);
|
|
2879
|
-
}
|
|
2880
|
-
}));
|
|
2881
|
-
return this;
|
|
2882
|
-
}
|
|
2883
|
-
cellEditor(editor, validatorsOrInitialiser, onComponentInit) {
|
|
2884
|
-
const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
|
|
2885
|
-
const initialiser = isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : onComponentInit;
|
|
2886
|
-
this.configureCellEditor(new CellEditorPortalRef(editor, (component, editSession) => {
|
|
2887
|
-
const formValueModel = editSession.form.pluck(this.property);
|
|
2888
|
-
if (validators) {
|
|
2889
|
-
formValueModel.validateUsing(validators);
|
|
2890
|
-
}
|
|
2891
|
-
component.valueModel = formValueModel;
|
|
2892
|
-
if (initialiser) {
|
|
2893
|
-
initialiser(component);
|
|
2894
|
-
}
|
|
2895
|
-
}));
|
|
2896
|
-
return this;
|
|
2897
|
-
}
|
|
2898
|
-
format(formatter) {
|
|
2899
|
-
assert$1.isFunction(formatter);
|
|
2900
|
-
this._format = formatter;
|
|
2901
|
-
return this;
|
|
2902
|
-
}
|
|
2903
|
-
selectRowOnClick(selectOnRowClick) {
|
|
2904
|
-
return this._selectRowOnClick(selectOnRowClick);
|
|
2905
|
-
}
|
|
2906
|
-
}
|
|
2907
|
-
class ListPropertyColumnModel extends ColumnModel {
|
|
2908
|
-
constructor(id, property, defaults) {
|
|
2909
|
-
super(id, defaults);
|
|
2910
|
-
this.property = property;
|
|
2911
|
-
this._format = (value) => value.map(v => v === null || v === void 0 ? void 0 : v.toString()).join(', ');
|
|
2912
|
-
this.cellRenderer(DefaultCellRendererComponent);
|
|
2913
|
-
this.useTextSearchPredicate((row, regex) => {
|
|
2914
|
-
let rowElement = row[this.property];
|
|
2915
|
-
// @ts-ignore Started complaining in ts 4.5.. but I think my logic is correct...
|
|
2916
|
-
return regex.test(this._format(rowElement));
|
|
2917
|
-
});
|
|
2918
|
-
}
|
|
2919
|
-
cellRenderer(componentType) {
|
|
2920
|
-
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {
|
|
2921
|
-
let rowElement = rowData.row[this.property];
|
|
2922
|
-
// @ts-ignore Started complaining in ts 4.5.. but I think my logic is correct...
|
|
2923
|
-
component.value = this._format(rowElement);
|
|
2924
|
-
}));
|
|
2925
|
-
return this;
|
|
2926
|
-
}
|
|
2927
|
-
cellEditor(editor, validatorsOrInitialiser, initialiseComponent) {
|
|
2928
|
-
const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
|
|
2929
|
-
const initialiser = isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : initialiseComponent;
|
|
2930
|
-
this.configureCellEditor(new CellEditorPortalRef(editor, (component, editSession) => {
|
|
2931
|
-
const formListModel = editSession.form.pluckList(this.property);
|
|
2932
|
-
if (validators) {
|
|
2933
|
-
formListModel.validateUsing(validators);
|
|
2934
|
-
}
|
|
2935
|
-
component.listModel = formListModel;
|
|
2936
|
-
if (initialiser) {
|
|
2937
|
-
initialiser(component);
|
|
2938
|
-
}
|
|
2939
|
-
}));
|
|
2940
|
-
return this;
|
|
2941
|
-
}
|
|
2942
|
-
format(formatter) {
|
|
2943
|
-
assert$1.isFunction(formatter);
|
|
2944
|
-
this._format = formatter;
|
|
2945
|
-
return this;
|
|
2946
|
-
}
|
|
2947
|
-
selectRowOnClick(selectRowOnClick) {
|
|
2948
|
-
return this._selectRowOnClick(selectRowOnClick);
|
|
2949
|
-
}
|
|
2950
|
-
}
|
|
2951
|
-
class CustomValueColumnModel extends ColumnModel {
|
|
2952
|
-
constructor(columnId, defaults, getValue) {
|
|
2953
|
-
super(columnId, defaults);
|
|
2954
|
-
this.getValue = getValue;
|
|
2955
|
-
this.cellRenderer(DefaultCellRendererComponent);
|
|
2956
|
-
}
|
|
2957
|
-
cellRenderer(componentType, onComponentInitOrOptions) {
|
|
2958
|
-
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
|
|
2959
|
-
if (firstTime) {
|
|
2960
|
-
if (isFunction(onComponentInitOrOptions)) {
|
|
2961
|
-
onComponentInitOrOptions(component);
|
|
2962
|
-
}
|
|
2963
|
-
else {
|
|
2964
|
-
if (isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
|
|
2965
|
-
onComponentInitOrOptions.onComponentInit(component);
|
|
2966
|
-
}
|
|
2967
|
-
}
|
|
2968
|
-
}
|
|
2969
|
-
component.value = this.getValue(rowData.row);
|
|
2970
|
-
if (!isFunction(onComponentInitOrOptions) && isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onRowUpdate)) {
|
|
2971
|
-
onComponentInitOrOptions.onRowUpdate(component, rowData.row);
|
|
2972
|
-
}
|
|
2973
|
-
}));
|
|
2974
|
-
return this;
|
|
2975
|
-
}
|
|
2976
|
-
selectRowOnClick(selectOnRowClick) {
|
|
2977
|
-
return this._selectRowOnClick(selectOnRowClick);
|
|
2978
|
-
}
|
|
2979
|
-
}
|
|
2980
|
-
class EditorControlColumnModel extends ColumnModel {
|
|
2981
|
-
constructor(columnId, saveCommandFactory, defaults) {
|
|
2982
|
-
super(columnId, defaults);
|
|
2983
|
-
this.cellRenderer(EditRowControls);
|
|
2984
|
-
}
|
|
2985
|
-
cellRenderer(componentType) {
|
|
2986
|
-
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData) => {
|
|
2987
|
-
component.row = rowData.row;
|
|
2988
|
-
component.editSession = rowData.editSession;
|
|
2989
|
-
component.editRowCommand = rowData.editRowCommand;
|
|
2990
|
-
}));
|
|
2991
|
-
return this;
|
|
2992
|
-
}
|
|
2993
|
-
getDefaultHeaderText() {
|
|
2994
|
-
return '';
|
|
2995
|
-
}
|
|
2996
|
-
}
|
|
2775
|
+
(function (ColumnModel) {
|
|
2776
|
+
ColumnModel.CELL_RENDERER_COMPONENT_ROW_CACHE = Symbol('aup-cell-renderer:row-data-cache');
|
|
2777
|
+
})(ColumnModel || (ColumnModel = {}));
|
|
2778
|
+
|
|
2997
2779
|
class CustomTemplateColumnModel extends ColumnModel {
|
|
2998
2780
|
constructor(columnId, defaults) {
|
|
2999
2781
|
super(columnId, defaults);
|
|
@@ -3007,45 +2789,11 @@ class CustomTemplateColumnModel extends ColumnModel {
|
|
|
3007
2789
|
return this._selectRowOnClick(selectOnRowClick);
|
|
3008
2790
|
}
|
|
3009
2791
|
}
|
|
3010
|
-
class SelectionColumnModel extends ColumnModel {
|
|
3011
|
-
constructor(columnId, defaults, selectionModel) {
|
|
3012
|
-
super(columnId, defaults);
|
|
3013
|
-
this._enableHeaderControls = true;
|
|
3014
|
-
this.selectionModel = DelegatingSelectionModel.createDelegate();
|
|
3015
|
-
this._selectRowOnClick(false);
|
|
3016
|
-
this.cellHeaderRenderer(SelectHeaderCellRendererComponent, (component) => {
|
|
3017
|
-
component.selectionModel = this.selectionModel;
|
|
3018
|
-
component.enableHeaderControls = this._enableHeaderControls;
|
|
3019
|
-
});
|
|
3020
|
-
this.configureCellRenderer(new ComponentCellRendererPortalRef(SelectCellRendererComponent, (component, rowData) => {
|
|
3021
|
-
component.row = rowData.row;
|
|
3022
|
-
component.selectionModel = this.selectionModel;
|
|
3023
|
-
}));
|
|
3024
|
-
this.setSelectionModel(selectionModel);
|
|
3025
|
-
}
|
|
3026
|
-
setSelectionModel(selectionModel) {
|
|
3027
|
-
this.selectionModel.setDelegate(selectionModel);
|
|
3028
|
-
this.setDefaultVisibility(selectionModel instanceof MultipleSelectionModel ? ValueModel.TRUE : ValueModel.FALSE);
|
|
3029
|
-
}
|
|
3030
|
-
getDefaultHeaderText() {
|
|
3031
|
-
return '';
|
|
3032
|
-
}
|
|
3033
|
-
enableHeaderControls(enable) {
|
|
3034
|
-
this._enableHeaderControls = enable;
|
|
3035
|
-
return this;
|
|
3036
|
-
}
|
|
3037
|
-
selectRow(row) {
|
|
3038
|
-
this.selectionModel.selectCommand.execute(row);
|
|
3039
|
-
}
|
|
3040
|
-
isSelected(row) {
|
|
3041
|
-
return this.selectionModel.isSelected(row);
|
|
3042
|
-
}
|
|
3043
|
-
}
|
|
3044
2792
|
|
|
3045
2793
|
/**
|
|
3046
2794
|
* Create your model:
|
|
3047
2795
|
* @example
|
|
3048
|
-
* this.heroTableModel = TableModel
|
|
2796
|
+
* this.heroTableModel = new TableModel(heroList, table => {
|
|
3049
2797
|
* table.pluck("firstName");
|
|
3050
2798
|
* table.pluck("lastName");
|
|
3051
2799
|
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
@@ -3057,7 +2805,7 @@ class SelectionColumnModel extends ColumnModel {
|
|
|
3057
2805
|
*
|
|
3058
2806
|
* Column templates
|
|
3059
2807
|
* @example
|
|
3060
|
-
* this.heroTableModel = TableModel
|
|
2808
|
+
* this.heroTableModel = new TableModel(heroList, table => {
|
|
3061
2809
|
* table.pluck("firstName");
|
|
3062
2810
|
* table.pluck("lastName");
|
|
3063
2811
|
* table.addTemplateColumn("specialColumn");
|
|
@@ -3102,8 +2850,9 @@ class SelectionColumnModel extends ColumnModel {
|
|
|
3102
2850
|
* }
|
|
3103
2851
|
*/
|
|
3104
2852
|
class AbstractTableComponent extends ResizeAwareComponent {
|
|
3105
|
-
constructor(elementRef, ngZone) {
|
|
2853
|
+
constructor(elementRef, ngZone, injector) {
|
|
3106
2854
|
super(elementRef, ngZone);
|
|
2855
|
+
this.injector = injector;
|
|
3107
2856
|
/**
|
|
3108
2857
|
* Set to true to enable scrolling. Once enabled the table will have 0 implicit height. You will either
|
|
3109
2858
|
* need to set it explicitly e.g. height: 400px; or by using flex or grid layout to make it fill it's
|
|
@@ -3135,6 +2884,7 @@ class AbstractTableComponent extends ResizeAwareComponent {
|
|
|
3135
2884
|
}
|
|
3136
2885
|
ngOnInit() {
|
|
3137
2886
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2887
|
+
this.getModel().initialise(this.injector);
|
|
3138
2888
|
this.columns = chain(this.getModel().columns);
|
|
3139
2889
|
this.columnIds = chain(this.columns).pluck('columnId');
|
|
3140
2890
|
this.columnsById = chain(this.columns).indexBy('columnId');
|
|
@@ -3154,12 +2904,12 @@ class AbstractTableComponent extends ResizeAwareComponent {
|
|
|
3154
2904
|
// @Trace()
|
|
3155
2905
|
isFirstVisibleColumn(columnId) {
|
|
3156
2906
|
var _a;
|
|
3157
|
-
return ((_a = this.getModel().firstVisibleColumn
|
|
2907
|
+
return ((_a = this.getModel().firstVisibleColumn$.query().value) === null || _a === void 0 ? void 0 : _a.columnId) === columnId;
|
|
3158
2908
|
}
|
|
3159
2909
|
// @Trace()
|
|
3160
2910
|
isLastVisibleColumn(columnId) {
|
|
3161
2911
|
var _a;
|
|
3162
|
-
return ((_a = this.getModel().lastVisibleColumn
|
|
2912
|
+
return ((_a = this.getModel().lastVisibleColumn$.query().value) === null || _a === void 0 ? void 0 : _a.columnId) === columnId;
|
|
3163
2913
|
}
|
|
3164
2914
|
getColumnClasses(columnId) {
|
|
3165
2915
|
const classes = [`aup-col-${this.columnsById.get(columnId).dasherisedColumnId}`];
|
|
@@ -3172,7 +2922,7 @@ class AbstractTableComponent extends ResizeAwareComponent {
|
|
|
3172
2922
|
return classes;
|
|
3173
2923
|
}
|
|
3174
2924
|
}
|
|
3175
|
-
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 });
|
|
3176
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 });
|
|
3177
2927
|
__decorate([
|
|
3178
2928
|
TrackExternal({ defaultValue: true }),
|
|
@@ -3188,7 +2938,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
3188
2938
|
selector: 'aup-abstract-table',
|
|
3189
2939
|
template: ''
|
|
3190
2940
|
}]
|
|
3191
|
-
}], 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: [{
|
|
3192
2942
|
type: Input
|
|
3193
2943
|
}], showHeader: [{
|
|
3194
2944
|
type: Input
|
|
@@ -3213,30 +2963,206 @@ class ColumnTemplateDirective {
|
|
|
3213
2963
|
this.aupColumnTemplateFillCell = false;
|
|
3214
2964
|
this.aupColumnTemplateAutoPadChild = undefined;
|
|
3215
2965
|
}
|
|
3216
|
-
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() {
|
|
3217
3147
|
var _a;
|
|
3218
|
-
|
|
3219
|
-
|
|
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;
|
|
3220
3156
|
}
|
|
3221
3157
|
}
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type:
|
|
3225
|
-
type:
|
|
3226
|
-
args: [{
|
|
3227
|
-
|
|
3228
|
-
}]
|
|
3229
|
-
}], ctorParameters: function () { return [{ type: AbstractTableComponent }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { aupColumnTemplate: [{
|
|
3230
|
-
type: Input
|
|
3231
|
-
}], aupColumnTemplateColumnId: [{
|
|
3232
|
-
type: Input
|
|
3233
|
-
}], aupColumnTemplateFillCell: [{
|
|
3234
|
-
type: Input
|
|
3235
|
-
}], aupColumnTemplateAutoPadChild: [{
|
|
3236
|
-
type: Input
|
|
3237
|
-
}] } });
|
|
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 []; } });
|
|
3238
3164
|
|
|
3239
|
-
class
|
|
3165
|
+
class TableCellComponent extends DisposableComponent {
|
|
3240
3166
|
constructor() {
|
|
3241
3167
|
super();
|
|
3242
3168
|
this.defaultClassNames = 'aup-cell-renderer';
|
|
@@ -3248,7 +3174,7 @@ class TableCellRendererComponent extends DisposableComponent {
|
|
|
3248
3174
|
}
|
|
3249
3175
|
ngOnInit() {
|
|
3250
3176
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
3251
|
-
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.
|
|
3252
3178
|
this.column.attachCell(this);
|
|
3253
3179
|
}
|
|
3254
3180
|
hasActiveEditor() {
|
|
@@ -3296,11 +3222,11 @@ class TableCellRendererComponent extends DisposableComponent {
|
|
|
3296
3222
|
};
|
|
3297
3223
|
}
|
|
3298
3224
|
}
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type:
|
|
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: [{
|
|
3302
3228
|
type: Component,
|
|
3303
|
-
args: [{ selector: 'aup-table-cell
|
|
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: [""] }]
|
|
3304
3230
|
}], ctorParameters: function () { return []; }, propDecorators: { row: [{
|
|
3305
3231
|
type: Input
|
|
3306
3232
|
}], column: [{
|
|
@@ -3320,7 +3246,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
3320
3246
|
args: ['class.padChild']
|
|
3321
3247
|
}] } });
|
|
3322
3248
|
|
|
3323
|
-
class
|
|
3249
|
+
class TableHeaderCellComponent {
|
|
3324
3250
|
constructor() {
|
|
3325
3251
|
this.defaultClassNames = 'aup-header-cell-renderer';
|
|
3326
3252
|
}
|
|
@@ -3335,11 +3261,11 @@ class TableHeaderCellRendererComponent {
|
|
|
3335
3261
|
return this[HEADER_CELL_RENDERER_PORTAL];
|
|
3336
3262
|
}
|
|
3337
3263
|
}
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type:
|
|
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: [{
|
|
3341
3267
|
type: Component,
|
|
3342
|
-
args: [{ selector: 'aup-table-header-cell
|
|
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"] }]
|
|
3343
3269
|
}], ctorParameters: function () { return []; }, propDecorators: { column: [{
|
|
3344
3270
|
type: Input
|
|
3345
3271
|
}], defaultClassNames: [{
|
|
@@ -3425,18 +3351,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
3425
3351
|
class ColumnListModel extends AbstractComputedListModel {
|
|
3426
3352
|
constructor() {
|
|
3427
3353
|
super();
|
|
3428
|
-
this._allColumns = new MutableListModel();
|
|
3354
|
+
this._allColumns$ = new MutableListModel();
|
|
3429
3355
|
const { chain } = Dsl.disposeWith(this);
|
|
3430
|
-
this.columnsById = chain(this._allColumns).indexBy('columnId');
|
|
3356
|
+
this.columnsById$ = chain(this._allColumns$).indexBy('columnId');
|
|
3431
3357
|
}
|
|
3432
|
-
get allColumns() {
|
|
3433
|
-
return this._allColumns
|
|
3358
|
+
get allColumns$() {
|
|
3359
|
+
return this._allColumns$.readonly;
|
|
3434
3360
|
}
|
|
3435
3361
|
getColumn(id) {
|
|
3436
|
-
return this.columnsById
|
|
3362
|
+
return this.columnsById$.get(id);
|
|
3437
3363
|
}
|
|
3438
3364
|
hasColumn(id) {
|
|
3439
|
-
return !!this.columnsById
|
|
3365
|
+
return !!this.columnsById$.get(id);
|
|
3440
3366
|
}
|
|
3441
3367
|
addColumn(column, index) {
|
|
3442
3368
|
if (this.hasColumn(column.columnId)) {
|
|
@@ -3445,17 +3371,227 @@ class ColumnListModel extends AbstractComputedListModel {
|
|
|
3445
3371
|
this.registerDisposable(column);
|
|
3446
3372
|
this.runInTransaction(() => {
|
|
3447
3373
|
if (!isNil(index)) {
|
|
3448
|
-
this._allColumns
|
|
3374
|
+
this._allColumns$.insert(index, column);
|
|
3449
3375
|
}
|
|
3450
3376
|
else {
|
|
3451
|
-
this._allColumns
|
|
3377
|
+
this._allColumns$.push(column);
|
|
3452
3378
|
}
|
|
3453
|
-
this.registerDisposable(this.trackSource(column.visible));
|
|
3379
|
+
this.registerDisposable(this.trackSource(column.visible$));
|
|
3454
3380
|
});
|
|
3455
3381
|
return column;
|
|
3456
3382
|
}
|
|
3457
3383
|
doComputeValue() {
|
|
3458
|
-
return this._allColumns
|
|
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);
|
|
3459
3595
|
}
|
|
3460
3596
|
}
|
|
3461
3597
|
|
|
@@ -3465,21 +3601,23 @@ class EditSession extends GarbageCollector {
|
|
|
3465
3601
|
this.rowId = rowId;
|
|
3466
3602
|
this.form = form;
|
|
3467
3603
|
this.saveCommand = saveCommand;
|
|
3468
|
-
this._liveRowValue = new MutableValueModel();
|
|
3469
|
-
this.liveRowValue = this._liveRowValue
|
|
3604
|
+
this._liveRowValue$ = new MutableValueModel();
|
|
3605
|
+
this.liveRowValue$ = this._liveRowValue$.readonly;
|
|
3470
3606
|
this.form.load(row);
|
|
3471
|
-
this._liveRowValue
|
|
3607
|
+
this._liveRowValue$.value = row;
|
|
3472
3608
|
this.form.onEdit(() => {
|
|
3473
3609
|
// if (!this._liveRowValue.value[immerable]) {
|
|
3474
3610
|
// console.warn()
|
|
3475
3611
|
// }
|
|
3476
|
-
this._liveRowValue
|
|
3612
|
+
this._liveRowValue$.value = produce(this._liveRowValue$.value, draft => {
|
|
3477
3613
|
this.form.writeDirtyStateTo(draft);
|
|
3478
3614
|
});
|
|
3479
3615
|
});
|
|
3480
3616
|
}
|
|
3481
3617
|
}
|
|
3482
3618
|
|
|
3619
|
+
var DefaultValueFormatter = ColumnTextSearchFormatter.DefaultValueFormatter;
|
|
3620
|
+
var DefaultArrayFormatter = ColumnTextSearchFormatter.DefaultArrayFormatter;
|
|
3483
3621
|
// export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];
|
|
3484
3622
|
// export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];
|
|
3485
3623
|
class RowClass {
|
|
@@ -3496,39 +3634,69 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3496
3634
|
this._editorSessions = new MutableListModel();
|
|
3497
3635
|
this.rowClassNamePredicates = [];
|
|
3498
3636
|
this.rowClickListeners = new EventListenerList();
|
|
3637
|
+
this._searchText$ = new DelegatingValueModel();
|
|
3499
3638
|
this._createForm = (row) => new DirtyTrackingForm();
|
|
3500
3639
|
this.trackBy = (index, item) => {
|
|
3501
3640
|
return this.identityOf ? this.identityOf(item) : index;
|
|
3502
3641
|
};
|
|
3503
3642
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
3504
|
-
this._rowsBeingEdited = new MutableListModel([], {
|
|
3643
|
+
this._rowsBeingEdited$ = new MutableListModel([], {
|
|
3505
3644
|
identifiedWith: row => this.identityOf(row)
|
|
3506
3645
|
});
|
|
3507
|
-
this._editorSessionByRowId = chain(this._editorSessions).indexBy(
|
|
3508
|
-
this.editing = chain(this._editorSessions).count().isGreaterThan(0);
|
|
3509
|
-
this.
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
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);
|
|
3514
3666
|
}
|
|
3515
3667
|
findMatchingColumns(row, regex) {
|
|
3516
|
-
return this.columns.value.filter(c => c.
|
|
3668
|
+
return this.columns.value.filter(c => regex.test(c.getSearchTextFor(row)));
|
|
3517
3669
|
}
|
|
3670
|
+
// @Trace()
|
|
3518
3671
|
hasMatchingColumn(row, regex) {
|
|
3519
|
-
return !!this.columns.value.find(c => c.
|
|
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));
|
|
3520
3684
|
}
|
|
3521
3685
|
setDataSource(sourceOfTruth) {
|
|
3522
3686
|
this._dataSource.setDelegate(sourceOfTruth);
|
|
3523
3687
|
}
|
|
3688
|
+
setTextSearch(searchText$, throttleDelayMilliseconds = 100) {
|
|
3689
|
+
const { chain } = Dsl.disposeWith(this);
|
|
3690
|
+
this._searchText$.setDelegate(chain(searchText$).throttle(throttleDelayMilliseconds));
|
|
3691
|
+
}
|
|
3524
3692
|
identityOf(row) {
|
|
3525
3693
|
return this._dataSource.identityOf(row);
|
|
3526
3694
|
}
|
|
3527
|
-
get rowsBeingEdited() {
|
|
3528
|
-
return this._rowsBeingEdited
|
|
3695
|
+
get rowsBeingEdited$() {
|
|
3696
|
+
return this._rowsBeingEdited$.readonly;
|
|
3529
3697
|
}
|
|
3530
3698
|
get columns() {
|
|
3531
|
-
return this._columnList.allColumns
|
|
3699
|
+
return this._columnList.allColumns$;
|
|
3532
3700
|
}
|
|
3533
3701
|
get visibleColumns() {
|
|
3534
3702
|
return this._columnList.readonly;
|
|
@@ -3543,9 +3711,9 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3543
3711
|
}
|
|
3544
3712
|
_addSelectionColumn(selectionModel, visible) {
|
|
3545
3713
|
assert.isNil(this.selectionColumnModel);
|
|
3546
|
-
const columnId =
|
|
3714
|
+
const columnId = "selection-column";
|
|
3547
3715
|
this.selectionColumnModel = new SelectionColumnModel(columnId, () => this.getColumnTextProperties(columnId), selectionModel);
|
|
3548
|
-
this.addRowClass(
|
|
3716
|
+
this.addRowClass("aup-row-selected", row => this.selectionColumnModel.isSelected(row));
|
|
3549
3717
|
const selectionColumnModel = this.addColumn(this.selectionColumnModel, 0);
|
|
3550
3718
|
if (!isNil(visible)) {
|
|
3551
3719
|
selectionColumnModel.visibleWhile(visible instanceof ValueModel ? visible : ValueModel.constant(visible));
|
|
@@ -3557,7 +3725,7 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3557
3725
|
if (isFunction(formFactory)) {
|
|
3558
3726
|
this._createForm = formFactory;
|
|
3559
3727
|
}
|
|
3560
|
-
const columnId =
|
|
3728
|
+
const columnId = "editControls";
|
|
3561
3729
|
return this.addColumn(new EditorControlColumnModel(columnId, saveCommandFactory, () => this.getColumnTextProperties(columnId)));
|
|
3562
3730
|
}
|
|
3563
3731
|
addCustomColumn(columnId, dataAccessor) {
|
|
@@ -3599,7 +3767,7 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3599
3767
|
}
|
|
3600
3768
|
startEditSession(row) {
|
|
3601
3769
|
const rowId = this.identityOf(row);
|
|
3602
|
-
if (this._rowsBeingEdited
|
|
3770
|
+
if (this._rowsBeingEdited$.query().indexOf(row) > -1) {
|
|
3603
3771
|
return lang.illegalState(`Row with id=${rowId} already being edited`);
|
|
3604
3772
|
}
|
|
3605
3773
|
// todo: pass the factories to the edit session so we can make the whole lot pluggable?
|
|
@@ -3607,12 +3775,12 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3607
3775
|
const saveCommand = this.saveCommandFactory.create(form);
|
|
3608
3776
|
const editSession = new EditSession(rowId, row, form, saveCommand);
|
|
3609
3777
|
const { when } = Dsl.disposeWith(editSession);
|
|
3610
|
-
when(editSession.liveRowValue).changes((editedValue) => {
|
|
3611
|
-
this._rowsBeingEdited
|
|
3612
|
-
}, { initialValue:
|
|
3778
|
+
when(editSession.liveRowValue$).changes((editedValue) => {
|
|
3779
|
+
this._rowsBeingEdited$.replaceOrPush(editedValue);
|
|
3780
|
+
}, { initialValue: "triggerChangeUnlessNil" });
|
|
3613
3781
|
this._editorSessions.push(editSession);
|
|
3614
3782
|
editSession.onDispose(() => {
|
|
3615
|
-
this._rowsBeingEdited
|
|
3783
|
+
this._rowsBeingEdited$.remove(editSession.liveRowValue$.value);
|
|
3616
3784
|
this._editorSessions.remove(editSession);
|
|
3617
3785
|
});
|
|
3618
3786
|
return editSession;
|
|
@@ -3622,7 +3790,7 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3622
3790
|
}
|
|
3623
3791
|
cancelAllEditorSessions() {
|
|
3624
3792
|
this._editorSessions.runInTransaction((draft) => {
|
|
3625
|
-
this._rowsBeingEdited
|
|
3793
|
+
this._rowsBeingEdited$.runInTransaction(() => {
|
|
3626
3794
|
draft.value.forEach(session => session.dispose());
|
|
3627
3795
|
});
|
|
3628
3796
|
});
|
|
@@ -3631,7 +3799,7 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3631
3799
|
return this.isRowSelectionEnabled() && column.isRowSelectionEnabled();
|
|
3632
3800
|
}
|
|
3633
3801
|
isRowSelectionEnabled() {
|
|
3634
|
-
return this.hasUserSelectionModel() && !this.rowSelectionDisabledOnAllColumns
|
|
3802
|
+
return this.hasUserSelectionModel() && !this.rowSelectionDisabledOnAllColumns$.value;
|
|
3635
3803
|
}
|
|
3636
3804
|
hasUserSelectionModel() {
|
|
3637
3805
|
var _a;
|
|
@@ -3666,7 +3834,7 @@ TrackExternal.oneTimeBinding(AbstractTableModel);
|
|
|
3666
3834
|
/**
|
|
3667
3835
|
* Create your model:
|
|
3668
3836
|
* @example
|
|
3669
|
-
* this.heroTableModel = TableModel
|
|
3837
|
+
* this.heroTableModel = new TableModel(heroList, table => {
|
|
3670
3838
|
* table.pluck("firstName");
|
|
3671
3839
|
* table.pluck("lastName");
|
|
3672
3840
|
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
@@ -3678,7 +3846,7 @@ TrackExternal.oneTimeBinding(AbstractTableModel);
|
|
|
3678
3846
|
*
|
|
3679
3847
|
* Column templates
|
|
3680
3848
|
* @example
|
|
3681
|
-
* this.heroTableModel = TableModel
|
|
3849
|
+
* this.heroTableModel = new TableModel(heroList, table => {
|
|
3682
3850
|
* table.pluck("firstName");
|
|
3683
3851
|
* table.pluck("lastName");
|
|
3684
3852
|
* table.addTemplateColumn("specialColumn");
|
|
@@ -3724,17 +3892,17 @@ TrackExternal.oneTimeBinding(AbstractTableModel);
|
|
|
3724
3892
|
* }
|
|
3725
3893
|
*/
|
|
3726
3894
|
class TableComponent extends AbstractTableComponent {
|
|
3727
|
-
constructor(elementRef, ngZone) {
|
|
3728
|
-
super(elementRef, ngZone);
|
|
3895
|
+
constructor(elementRef, ngZone, injector) {
|
|
3896
|
+
super(elementRef, ngZone, injector);
|
|
3729
3897
|
}
|
|
3730
3898
|
getModel() {
|
|
3731
3899
|
return this.tableModel;
|
|
3732
3900
|
}
|
|
3733
3901
|
}
|
|
3734
|
-
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 });
|
|
3735
3903
|
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TableComponent, selector: "aup-table", inputs: { tableModel: "tableModel" }, providers: [
|
|
3736
3904
|
{ provide: AbstractTableComponent, useExisting: TableComponent }
|
|
3737
|
-
], 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
|
|
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"] }] });
|
|
3738
3906
|
__decorate([
|
|
3739
3907
|
TrackExternal(),
|
|
3740
3908
|
__metadata("design:type", AbstractTableModel)
|
|
@@ -3743,8 +3911,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
3743
3911
|
type: Component,
|
|
3744
3912
|
args: [{ selector: 'aup-table', providers: [
|
|
3745
3913
|
{ provide: AbstractTableComponent, useExisting: TableComponent }
|
|
3746
|
-
], 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
|
|
3747
|
-
}], 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: [{
|
|
3748
3916
|
type: Input
|
|
3749
3917
|
}] } });
|
|
3750
3918
|
|
|
@@ -4324,17 +4492,17 @@ class TreeTableModel extends AbstractTableModel {
|
|
|
4324
4492
|
* }
|
|
4325
4493
|
*/
|
|
4326
4494
|
class TreeTableComponent extends AbstractTableComponent {
|
|
4327
|
-
constructor(elementRef, ngZone) {
|
|
4328
|
-
super(elementRef, ngZone);
|
|
4495
|
+
constructor(elementRef, ngZone, injector) {
|
|
4496
|
+
super(elementRef, ngZone, injector);
|
|
4329
4497
|
}
|
|
4330
4498
|
getModel() {
|
|
4331
4499
|
return this.treeTableModel;
|
|
4332
4500
|
}
|
|
4333
4501
|
}
|
|
4334
|
-
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 });
|
|
4335
4503
|
TreeTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: TreeTableComponent, selector: "aup-tree-table", inputs: { treeTableModel: "treeTableModel" }, providers: [
|
|
4336
4504
|
{ provide: AbstractTableComponent, useExisting: TreeTableComponent }
|
|
4337
|
-
], 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
|
|
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"] }] });
|
|
4338
4506
|
__decorate([
|
|
4339
4507
|
TrackExternal(),
|
|
4340
4508
|
__metadata("design:type", TreeTableModel)
|
|
@@ -4343,8 +4511,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
4343
4511
|
type: Component,
|
|
4344
4512
|
args: [{ selector: 'aup-tree-table', providers: [
|
|
4345
4513
|
{ provide: AbstractTableComponent, useExisting: TreeTableComponent }
|
|
4346
|
-
], 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
|
|
4347
|
-
}], 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: [{
|
|
4348
4516
|
type: Input
|
|
4349
4517
|
}] } });
|
|
4350
4518
|
|
|
@@ -4572,11 +4740,12 @@ ComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versio
|
|
|
4572
4740
|
EditRowControls,
|
|
4573
4741
|
ColumnTemplateDirective,
|
|
4574
4742
|
DefaultCellRendererComponent,
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4743
|
+
DefaultListCellRendererComponent,
|
|
4744
|
+
TableCellComponent,
|
|
4745
|
+
SelectionCellComponent,
|
|
4746
|
+
SelectionHeaderCellComponent,
|
|
4578
4747
|
DefaultHeaderCellRendererComponent,
|
|
4579
|
-
|
|
4748
|
+
TableHeaderCellComponent,
|
|
4580
4749
|
IconComponent,
|
|
4581
4750
|
SectionHeaderComponent,
|
|
4582
4751
|
TableRowMenuComponent,
|
|
@@ -4735,11 +4904,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
4735
4904
|
EditRowControls,
|
|
4736
4905
|
ColumnTemplateDirective,
|
|
4737
4906
|
DefaultCellRendererComponent,
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4907
|
+
DefaultListCellRendererComponent,
|
|
4908
|
+
TableCellComponent,
|
|
4909
|
+
SelectionCellComponent,
|
|
4910
|
+
SelectionHeaderCellComponent,
|
|
4741
4911
|
DefaultHeaderCellRendererComponent,
|
|
4742
|
-
|
|
4912
|
+
TableHeaderCellComponent,
|
|
4743
4913
|
IconComponent,
|
|
4744
4914
|
SectionHeaderComponent,
|
|
4745
4915
|
TableRowMenuComponent,
|
|
@@ -8145,14 +8315,6 @@ class TableModel extends AbstractTableModel {
|
|
|
8145
8315
|
}
|
|
8146
8316
|
this.setDataSource(sourceOfTruth);
|
|
8147
8317
|
}
|
|
8148
|
-
/**
|
|
8149
|
-
* @deprecated use new TableModel(sourceOfTruth, table => {...}); instead.
|
|
8150
|
-
* @param sourceOfTruth
|
|
8151
|
-
* @param builder
|
|
8152
|
-
*/
|
|
8153
|
-
static fromList(sourceOfTruth, builder) {
|
|
8154
|
-
return new TableModel(sourceOfTruth, builder);
|
|
8155
|
-
}
|
|
8156
8318
|
addSelectionColumn(selectionModel, showSelectionColumn) {
|
|
8157
8319
|
return this._addSelectionColumn(selectionModel, showSelectionColumn);
|
|
8158
8320
|
}
|
|
@@ -10113,5 +10275,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
10113
10275
|
* Generated bundle index. Do not edit.
|
|
10114
10276
|
*/
|
|
10115
10277
|
|
|
10116
|
-
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,
|
|
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 };
|
|
10117
10279
|
//# sourceMappingURL=coolon-angular-ui-powerups.mjs.map
|