@coolon/angular-ui-powerups 13.7.13 → 13.7.17
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/esm2020/lib/components/exports.mjs +3 -2
- package/esm2020/lib/components/tables/abstract-table-model.mjs +14 -71
- package/esm2020/lib/components/tables/abstract-table.component.mjs +5 -4
- package/esm2020/lib/components/tables/filter/abstract-table-filter-model.mjs +10 -0
- package/esm2020/lib/components/tables/filter/table-filter-model.mjs +78 -0
- package/esm2020/lib/components/tables/table/table.component.mjs +5 -4
- package/esm2020/lib/components/tables/tree-table/tree-table-component.mjs +4 -3
- package/fesm2015/coolon-angular-ui-powerups.mjs +88 -93
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +88 -92
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/exports.d.ts +2 -1
- package/lib/components/tables/abstract-table-model.d.ts +4 -8
- package/lib/components/tables/abstract-table.component.d.ts +1 -1
- package/lib/components/tables/filter/abstract-table-filter-model.d.ts +11 -0
- package/lib/components/tables/filter/table-filter-model.d.ts +25 -0
- package/package.json +1 -1
- package/esm2020/lib/components/tables/filter-strategy.mjs +0 -31
- package/lib/components/tables/filter-strategy.d.ts +0 -19
|
@@ -39,7 +39,7 @@ import { MatTableModule } from '@angular/material/table';
|
|
|
39
39
|
import * as i6 from '@angular/material/tooltip';
|
|
40
40
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
41
41
|
import * as i1$6 from '@coolon/pectin';
|
|
42
|
-
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, PagedListModel, PageController, ComputedListModel, Deferred } from '@coolon/pectin';
|
|
42
|
+
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, DelegateProxyHandler, DirtyTrackingForm, PagedListModel, PageController, ComputedListModel, Deferred } from '@coolon/pectin';
|
|
43
43
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
44
44
|
import * as i1$2 from '@angular/platform-browser';
|
|
45
45
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
@@ -50,7 +50,7 @@ import { Enum } from 'typescript-string-enums';
|
|
|
50
50
|
import { lang as lang$1, assert as assert$1, Stringy, Klass, Opts } from '@coolon/typescript-utilities';
|
|
51
51
|
import * as i3 from '@angular/material/core';
|
|
52
52
|
import produce from 'immer';
|
|
53
|
-
import { isFunction as isFunction$1,
|
|
53
|
+
import { isFunction as isFunction$1, isNil as isNil$1, isEmpty as isEmpty$1, findLast } from 'lodash-es';
|
|
54
54
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
55
55
|
import * as i6$1 from '@angular/cdk/a11y';
|
|
56
56
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
@@ -2759,8 +2759,9 @@ class AbstractTableComponent extends DisposableComponent {
|
|
|
2759
2759
|
}
|
|
2760
2760
|
ngOnInit() {
|
|
2761
2761
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2762
|
-
this.getModel()
|
|
2763
|
-
|
|
2762
|
+
const model = this.getModel();
|
|
2763
|
+
model.initialise(this.injector);
|
|
2764
|
+
this.columnsById = chain(model.columns).indexBy('columnId');
|
|
2764
2765
|
}
|
|
2765
2766
|
getModel() {
|
|
2766
2767
|
return lang$1.abstractMethod(this.constructor);
|
|
@@ -3236,8 +3237,17 @@ class SelectionColumnModel extends ColumnModel {
|
|
|
3236
3237
|
}
|
|
3237
3238
|
}
|
|
3238
3239
|
|
|
3239
|
-
|
|
3240
|
+
class AbstractTableFilterModel extends GarbageCollector {
|
|
3241
|
+
}
|
|
3242
|
+
TrackExternal.useDelegate(AbstractTableFilterModel, options => {
|
|
3243
|
+
return DelegateProxyHandler.create("AbstractTableFilterModel", b => {
|
|
3244
|
+
b.forProperty("rowFilter$", () => new DelegatingValueModel());
|
|
3245
|
+
b.forProperty("highlightText$", () => new DelegatingValueModel());
|
|
3246
|
+
});
|
|
3247
|
+
});
|
|
3248
|
+
|
|
3240
3249
|
var DefaultArrayFormatter = ColumnTextSearchFormatter.DefaultArrayFormatter;
|
|
3250
|
+
var DefaultValueFormatter = ColumnTextSearchFormatter.DefaultValueFormatter;
|
|
3241
3251
|
// export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];
|
|
3242
3252
|
// export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];
|
|
3243
3253
|
class RowClass {
|
|
@@ -3246,58 +3256,6 @@ class RowClass {
|
|
|
3246
3256
|
this.matches = matches;
|
|
3247
3257
|
}
|
|
3248
3258
|
}
|
|
3249
|
-
class FilterManager extends GarbageCollector {
|
|
3250
|
-
constructor(columns) {
|
|
3251
|
-
super();
|
|
3252
|
-
this.columns = columns;
|
|
3253
|
-
this._userRowPredicate$ = this.registerDisposable(new DelegatingValueModel().withDefault(() => true));
|
|
3254
|
-
this._searchText$ = this.registerDisposable(new DelegatingValueModel());
|
|
3255
|
-
this.updateInProgress = new Guard();
|
|
3256
|
-
const { chain } = Dsl.disposeWith(this);
|
|
3257
|
-
// TODO: should this logic be in the strategy itself? That way users could
|
|
3258
|
-
// customise...
|
|
3259
|
-
const textSearchPredicate$ = chain(this._searchText$).map(text => {
|
|
3260
|
-
if (isEmpty$1(text)) {
|
|
3261
|
-
return () => true;
|
|
3262
|
-
}
|
|
3263
|
-
else {
|
|
3264
|
-
const regex = new RegExp(escapeStringRegexp(text), "i");
|
|
3265
|
-
return (row) => this.hasMatchingColumn(row, regex);
|
|
3266
|
-
}
|
|
3267
|
-
}, {
|
|
3268
|
-
allowNil: true,
|
|
3269
|
-
dependsOn: this.columns
|
|
3270
|
-
});
|
|
3271
|
-
this.rowPredicate$ = chain(this._userRowPredicate$)
|
|
3272
|
-
.map(p => {
|
|
3273
|
-
return ((row) => p(row) && textSearchPredicate$.value(row));
|
|
3274
|
-
}, {
|
|
3275
|
-
dependsOn: textSearchPredicate$,
|
|
3276
|
-
postponeWhile: this.updateInProgress
|
|
3277
|
-
});
|
|
3278
|
-
}
|
|
3279
|
-
setStrategy(filterStrategy) {
|
|
3280
|
-
if (this._searchText$.hasUserDelegate()) {
|
|
3281
|
-
lang.illegalState("Filter strategy has already been set, it must be disposed first.");
|
|
3282
|
-
}
|
|
3283
|
-
this.updateInProgress.whileTrue(() => {
|
|
3284
|
-
this._searchText$.setDelegate(filterStrategy.searchText$);
|
|
3285
|
-
this._userRowPredicate$.setDelegate(filterStrategy.rowPredicate$);
|
|
3286
|
-
});
|
|
3287
|
-
const self = this;
|
|
3288
|
-
return {
|
|
3289
|
-
dispose() {
|
|
3290
|
-
self.updateInProgress.whileTrue(() => {
|
|
3291
|
-
this._searchText$.setDelegate(undefined);
|
|
3292
|
-
this._userRowPredicate$.setDelegate(undefined);
|
|
3293
|
-
});
|
|
3294
|
-
}
|
|
3295
|
-
};
|
|
3296
|
-
}
|
|
3297
|
-
hasMatchingColumn(row, regex) {
|
|
3298
|
-
return !!this.columns.value.find(c => regex.test(c.getSearchTextFor(row)));
|
|
3299
|
-
}
|
|
3300
|
-
}
|
|
3301
3259
|
class AbstractTableModel extends GarbageCollector {
|
|
3302
3260
|
constructor() {
|
|
3303
3261
|
super();
|
|
@@ -3307,7 +3265,6 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3307
3265
|
this._editorSessions = new MutableListModel();
|
|
3308
3266
|
this.rowClassNamePredicates = [];
|
|
3309
3267
|
this.rowClickListeners = new EventListenerList();
|
|
3310
|
-
this._searchText$ = new DelegatingValueModel();
|
|
3311
3268
|
this._createForm = (row) => new DirtyTrackingForm();
|
|
3312
3269
|
this.trackBy = (index, item) => {
|
|
3313
3270
|
return this.identityOf ? this.identityOf(item) : index;
|
|
@@ -3318,12 +3275,12 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3318
3275
|
});
|
|
3319
3276
|
this._editorSessionByRowId = chain(this._editorSessions).indexBy("rowId");
|
|
3320
3277
|
this.editing$ = chain(this._editorSessions).count().isGreaterThan(0);
|
|
3321
|
-
this.filterManager = this.registerDisposable(new FilterManager(this._columnList));
|
|
3322
3278
|
this._filteredRows$ = chain(this._rawDataSource)
|
|
3323
3279
|
.reduceToList(items => {
|
|
3324
|
-
|
|
3280
|
+
const filter = this.filterModel.rowFilter$.value; // filter can be null
|
|
3281
|
+
return !filter ? items : items.filter(item => filter.matches(item, this.columns.value));
|
|
3325
3282
|
}, {
|
|
3326
|
-
dependsOn: this.
|
|
3283
|
+
dependsOn: [this.filterModel.rowFilter$, this.columns]
|
|
3327
3284
|
})
|
|
3328
3285
|
.replaceAll(this.rowsBeingEdited$);
|
|
3329
3286
|
this._visibleRows$.setDelegate(this._filteredRows$);
|
|
@@ -3332,13 +3289,6 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3332
3289
|
this.lastVisibleColumn$ = chain(this._columnList).last();
|
|
3333
3290
|
this.rowSelectionDisabledOnAllColumns$ = chain(this._columnList).select(column => column.isRowSelectionEnabled()).count().equals(0);
|
|
3334
3291
|
}
|
|
3335
|
-
findMatchingColumns(row, regex) {
|
|
3336
|
-
return this.columns.value.filter(c => regex.test(c.getSearchTextFor(row)));
|
|
3337
|
-
}
|
|
3338
|
-
// @Trace()
|
|
3339
|
-
hasMatchingColumn(row, regex) {
|
|
3340
|
-
return !!this.columns.value.find(c => regex.test(c.getSearchTextFor(row)));
|
|
3341
|
-
}
|
|
3342
3292
|
initialise(injector) {
|
|
3343
3293
|
// not sure if I should define these at the module level or not...
|
|
3344
3294
|
const customInjector = Injector.create({
|
|
@@ -3356,9 +3306,6 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3356
3306
|
setDataSource(sourceOfTruth) {
|
|
3357
3307
|
this._rawDataSource.setDelegate(sourceOfTruth);
|
|
3358
3308
|
}
|
|
3359
|
-
registerFilterStrategy(filterStrategy) {
|
|
3360
|
-
return this.filterManager.setStrategy(filterStrategy);
|
|
3361
|
-
}
|
|
3362
3309
|
identityOf(row) {
|
|
3363
3310
|
return this._rawDataSource.identityOf(row);
|
|
3364
3311
|
}
|
|
@@ -3496,6 +3443,11 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3496
3443
|
this.rowClickListeners.fire(l => l(row));
|
|
3497
3444
|
}
|
|
3498
3445
|
}
|
|
3446
|
+
__decorate([
|
|
3447
|
+
TrackExternal() // hack instead of creating a delegating one from scratch. Would be nice if this easier to do automated... or better named? @UseProxy or @UseDelegate??
|
|
3448
|
+
,
|
|
3449
|
+
__metadata("design:type", AbstractTableFilterModel)
|
|
3450
|
+
], AbstractTableModel.prototype, "filterModel", void 0);
|
|
3499
3451
|
TrackExternal.oneTimeBinding(AbstractTableModel);
|
|
3500
3452
|
|
|
3501
3453
|
class TableCellComponent extends DisposableComponent {
|
|
@@ -4089,7 +4041,7 @@ class TableComponent extends AbstractTableComponent {
|
|
|
4089
4041
|
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: TableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4090
4042
|
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.4", type: TableComponent, selector: "aup-table", inputs: { tableModel: "tableModel" }, providers: [
|
|
4091
4043
|
{ provide: AbstractTableComponent, useExisting: TableComponent }
|
|
4092
|
-
], usesInheritance: true, ngImport: i0, template: "<aup-table-body [tableModel]=\"tableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n (visibleRowCount)=\"updatePageSize($event)\"\n></aup-table-body>\n<section class=\"table-footer\">\n <div class=\"footer-content\"><ng-content select=\"[footer]\"></ng-content></div>\n <aup-paginator *ngIf=\"tableModel.pageController\" [pageController]=\"tableModel.pageController\"></aup-paginator>\n</section>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}aup-table-body{flex:1}.table-footer{display:flex;flex-direction:row;align-items:center}.table-footer .footer-content{flex:1}\n"], components: [{ type: TableBodyComponent, selector: "aup-table-body", inputs: ["tableModel", "showHeader$", "showHeader", "enableScrolling"], outputs: ["visibleRowCount"] }, { type: PaginatorComponent, selector: "aup-paginator", inputs: ["pageController"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4044
|
+
], usesInheritance: true, ngImport: i0, template: "<aup-table-body [tableModel]=\"tableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n (visibleRowCount)=\"updatePageSize($event)\"\n [aupHighlightTextModel]=\"tableModel.filterModel.highlightText$\"\n></aup-table-body>\n<section class=\"table-footer\">\n <div class=\"footer-content\"><ng-content select=\"[footer]\"></ng-content></div>\n <aup-paginator *ngIf=\"tableModel.pageController\" [pageController]=\"tableModel.pageController\"></aup-paginator>\n</section>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}aup-table-body{flex:1}.table-footer{display:flex;flex-direction:row;align-items:center}.table-footer .footer-content{flex:1}\n"], components: [{ type: TableBodyComponent, selector: "aup-table-body", inputs: ["tableModel", "showHeader$", "showHeader", "enableScrolling"], outputs: ["visibleRowCount"] }, { type: PaginatorComponent, selector: "aup-paginator", inputs: ["pageController"] }], directives: [{ type: HighlightTextModelDirective, selector: "[aupHighlightTextModel]", inputs: ["aupHighlightTextModel"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4093
4045
|
__decorate([
|
|
4094
4046
|
TrackExternal(),
|
|
4095
4047
|
__metadata("design:type", TableModel)
|
|
@@ -4098,7 +4050,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImpor
|
|
|
4098
4050
|
type: Component,
|
|
4099
4051
|
args: [{ selector: 'aup-table', providers: [
|
|
4100
4052
|
{ provide: AbstractTableComponent, useExisting: TableComponent }
|
|
4101
|
-
], template: "<aup-table-body [tableModel]=\"tableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n (visibleRowCount)=\"updatePageSize($event)\"\n></aup-table-body>\n<section class=\"table-footer\">\n <div class=\"footer-content\"><ng-content select=\"[footer]\"></ng-content></div>\n <aup-paginator *ngIf=\"tableModel.pageController\" [pageController]=\"tableModel.pageController\"></aup-paginator>\n</section>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}aup-table-body{flex:1}.table-footer{display:flex;flex-direction:row;align-items:center}.table-footer .footer-content{flex:1}\n"] }]
|
|
4053
|
+
], template: "<aup-table-body [tableModel]=\"tableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n (visibleRowCount)=\"updatePageSize($event)\"\n [aupHighlightTextModel]=\"tableModel.filterModel.highlightText$\"\n></aup-table-body>\n<section class=\"table-footer\">\n <div class=\"footer-content\"><ng-content select=\"[footer]\"></ng-content></div>\n <aup-paginator *ngIf=\"tableModel.pageController\" [pageController]=\"tableModel.pageController\"></aup-paginator>\n</section>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}aup-table-body{flex:1}.table-footer{display:flex;flex-direction:row;align-items:center}.table-footer .footer-content{flex:1}\n"] }]
|
|
4102
4054
|
}], propDecorators: { tableModel: [{
|
|
4103
4055
|
type: Input
|
|
4104
4056
|
}] } });
|
|
@@ -4688,7 +4640,7 @@ class TreeTableComponent extends AbstractTableComponent {
|
|
|
4688
4640
|
TreeTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: TreeTableComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
4689
4641
|
TreeTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.4", type: TreeTableComponent, selector: "aup-tree-table", inputs: { treeTableModel: "treeTableModel" }, providers: [
|
|
4690
4642
|
{ provide: AbstractTableComponent, useExisting: TreeTableComponent }
|
|
4691
|
-
], usesInheritance: true, ngImport: i0, template: "<aup-table-body [tableModel]=\"treeTableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n></aup-table-body>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host::ng-deep td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}:host::ng-deep td.mat-column-tree-label,:host::ng-deep td.mat-column-tree-label{width:1px}:host::ng-deep aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}:host::ng-deep aup-tree-label-cell-renderer{flex:1}aup-table-body{flex:1}\n"], components: [{ type: TableBodyComponent, selector: "aup-table-body", inputs: ["tableModel", "showHeader$", "showHeader", "enableScrolling"], outputs: ["visibleRowCount"] }] });
|
|
4643
|
+
], usesInheritance: true, ngImport: i0, template: "<aup-table-body [tableModel]=\"treeTableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n [aupHighlightTextModel]=\"treeTableModel.filterModel.highlightText$\"\n></aup-table-body>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host::ng-deep td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}:host::ng-deep td.mat-column-tree-label,:host::ng-deep td.mat-column-tree-label{width:1px}:host::ng-deep aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}:host::ng-deep aup-tree-label-cell-renderer{flex:1}aup-table-body{flex:1}\n"], components: [{ type: TableBodyComponent, selector: "aup-table-body", inputs: ["tableModel", "showHeader$", "showHeader", "enableScrolling"], outputs: ["visibleRowCount"] }], directives: [{ type: HighlightTextModelDirective, selector: "[aupHighlightTextModel]", inputs: ["aupHighlightTextModel"] }] });
|
|
4692
4644
|
__decorate([
|
|
4693
4645
|
TrackExternal(),
|
|
4694
4646
|
__metadata("design:type", TreeTableModel)
|
|
@@ -4697,7 +4649,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImpor
|
|
|
4697
4649
|
type: Component,
|
|
4698
4650
|
args: [{ selector: 'aup-tree-table', providers: [
|
|
4699
4651
|
{ provide: AbstractTableComponent, useExisting: TreeTableComponent }
|
|
4700
|
-
], template: "<aup-table-body [tableModel]=\"treeTableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n></aup-table-body>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host::ng-deep td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}:host::ng-deep td.mat-column-tree-label,:host::ng-deep td.mat-column-tree-label{width:1px}:host::ng-deep aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}:host::ng-deep aup-tree-label-cell-renderer{flex:1}aup-table-body{flex:1}\n"] }]
|
|
4652
|
+
], template: "<aup-table-body [tableModel]=\"treeTableModel\"\n [showHeader$]=\"showHeader$\"\n [enableScrolling]=\"enableScrolling\"\n [aupHighlightTextModel]=\"treeTableModel.filterModel.highlightText$\"\n></aup-table-body>\n", styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host::ng-deep td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}:host::ng-deep td.mat-column-tree-label,:host::ng-deep td.mat-column-tree-label{width:1px}:host::ng-deep aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}:host::ng-deep aup-tree-label-cell-renderer{flex:1}aup-table-body{flex:1}\n"] }]
|
|
4701
4653
|
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { treeTableModel: [{
|
|
4702
4654
|
type: Input
|
|
4703
4655
|
}] } });
|
|
@@ -8329,26 +8281,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImpor
|
|
|
8329
8281
|
}]
|
|
8330
8282
|
}] });
|
|
8331
8283
|
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
// rowPredicate$: ValueModel<row => matches(row, visibleColumns)>
|
|
8335
|
-
// that way you can implement it how every you want.... But for now this was quicker.
|
|
8336
|
-
class FilterStrategy extends GarbageCollector {
|
|
8337
|
-
constructor(rowPredicate$, searchText$) {
|
|
8284
|
+
class TableFilterModel extends AbstractTableFilterModel {
|
|
8285
|
+
constructor(builder) {
|
|
8338
8286
|
super();
|
|
8339
|
-
this.
|
|
8340
|
-
this.
|
|
8287
|
+
this._rowPredicate$ = this.registerDisposable(new DelegatingValueModel());
|
|
8288
|
+
this._searchText$ = this.registerDisposable(new DelegatingValueModel());
|
|
8289
|
+
this.inUpdate = new Guard();
|
|
8290
|
+
const { chain } = Dsl.disposeWith(this);
|
|
8291
|
+
if (builder) {
|
|
8292
|
+
this.registerModels(builder);
|
|
8293
|
+
}
|
|
8294
|
+
const textSearchRegex$ = chain(this._searchText$).map(text => {
|
|
8295
|
+
return isEmpty$1(text) ? undefined : new RegExp(escapeStringRegexp(text), "i");
|
|
8296
|
+
}, { allowNil: true });
|
|
8297
|
+
this._rowFilter$ = chain(this._rowPredicate$)
|
|
8298
|
+
.map(predicate => {
|
|
8299
|
+
const regex = textSearchRegex$.value;
|
|
8300
|
+
return {
|
|
8301
|
+
matches(row, columns) {
|
|
8302
|
+
return (!predicate || predicate(row)) && (!regex || !!columns.find(c => regex.test(c.getSearchTextFor(row))));
|
|
8303
|
+
}
|
|
8304
|
+
};
|
|
8305
|
+
}, {
|
|
8306
|
+
allowNil: true,
|
|
8307
|
+
dependsOn: textSearchRegex$,
|
|
8308
|
+
postponeWhile: this.inUpdate
|
|
8309
|
+
});
|
|
8310
|
+
}
|
|
8311
|
+
get rowFilter$() {
|
|
8312
|
+
return this._rowFilter$.readonly;
|
|
8313
|
+
}
|
|
8314
|
+
get highlightText$() {
|
|
8315
|
+
return this._searchText$.readonly;
|
|
8316
|
+
}
|
|
8317
|
+
registerModels(builder) {
|
|
8318
|
+
// TODO: calling this twice without disposing woudl result in confusion... I should probably
|
|
8319
|
+
// change how this works...
|
|
8320
|
+
const self = this;
|
|
8321
|
+
this.inUpdate.whileTrue(() => {
|
|
8322
|
+
builder({
|
|
8323
|
+
usePredicate(predicate$) {
|
|
8324
|
+
self._rowPredicate$.setDelegate(predicate$);
|
|
8325
|
+
return this;
|
|
8326
|
+
},
|
|
8327
|
+
useSearchText(searchText$) {
|
|
8328
|
+
self._searchText$.setDelegate(searchText$);
|
|
8329
|
+
return this;
|
|
8330
|
+
}
|
|
8331
|
+
});
|
|
8332
|
+
});
|
|
8333
|
+
return {
|
|
8334
|
+
dispose: () => self.clear()
|
|
8335
|
+
};
|
|
8341
8336
|
}
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8337
|
+
clear() {
|
|
8338
|
+
this.inUpdate.whileTrue(() => {
|
|
8339
|
+
this._rowPredicate$.setDelegate(undefined);
|
|
8340
|
+
this._searchText$.setDelegate(undefined);
|
|
8341
|
+
});
|
|
8346
8342
|
}
|
|
8347
8343
|
}
|
|
8348
|
-
(function (
|
|
8344
|
+
(function (TableFilterModel) {
|
|
8349
8345
|
class BuilderImp {
|
|
8350
8346
|
usePredicate(predicate$) {
|
|
8351
|
-
this.rowPredicate = predicate$;
|
|
8347
|
+
this.rowPredicate$ = predicate$;
|
|
8352
8348
|
return this;
|
|
8353
8349
|
}
|
|
8354
8350
|
useSearchText(searchText$) {
|
|
@@ -8356,8 +8352,8 @@ class FilterStrategy extends GarbageCollector {
|
|
|
8356
8352
|
return this;
|
|
8357
8353
|
}
|
|
8358
8354
|
}
|
|
8359
|
-
|
|
8360
|
-
})(
|
|
8355
|
+
TableFilterModel.BuilderImp = BuilderImp;
|
|
8356
|
+
})(TableFilterModel || (TableFilterModel = {}));
|
|
8361
8357
|
|
|
8362
8358
|
/**
|
|
8363
8359
|
* @file Automatically generated by barrelsby.
|
|
@@ -10298,5 +10294,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImpor
|
|
|
10298
10294
|
* Generated bundle index. Do not edit.
|
|
10299
10295
|
*/
|
|
10300
10296
|
|
|
10301
|
-
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, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EnableCellTextSearch, EventCleanUpSession,
|
|
10297
|
+
export { ACTIVITY_DATA, ALERT_CONFIG, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractActivityTriggerComponent, AbstractCardContainerComponent, AbstractConfirmDialogComponent, AbstractDialogComponent, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableComponent, AbstractTableFilterModel, 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, 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, TableBodyComponent, TableCellComponent, TableComponent, TableFilterModel, 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 };
|
|
10302
10298
|
//# sourceMappingURL=coolon-angular-ui-powerups.mjs.map
|