@coolon/angular-ui-powerups 14.22.0 → 14.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/tables/abstract-table-model.mjs +13 -1
- package/esm2020/lib/components/tables/table/table-model.mjs +5 -1
- package/esm2020/lib/components/tables/table/table.component.mjs +2 -1
- package/esm2020/lib/components/tables/tree-table/tree-table-component.mjs +3 -3
- package/esm2020/lib/components/tables/tree-table/tree-table-model.mjs +3 -2
- package/fesm2015/coolon-angular-ui-powerups.mjs +21 -3
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +21 -3
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/tables/abstract-table-model.d.ts +10 -0
- package/lib/components/tables/table/table-model.d.ts +1 -0
- package/lib/components/tables/tree-table/tree-table-model.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3424,6 +3424,7 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3424
3424
|
constructor() {
|
|
3425
3425
|
super();
|
|
3426
3426
|
this._dataSource$ = this.registerDisposable(new DelegatingListModel());
|
|
3427
|
+
this._filteredRows$ = this.registerDisposable(new DelegatingListModel());
|
|
3427
3428
|
this._visibleRows$ = this.registerDisposable(new DelegatingListModel());
|
|
3428
3429
|
this._columnList = this.registerDisposable(new ColumnListModel());
|
|
3429
3430
|
this._editorSessions = new MutableListModel();
|
|
@@ -3471,6 +3472,17 @@ class AbstractTableModel extends GarbageCollector {
|
|
|
3471
3472
|
get dataSource$() {
|
|
3472
3473
|
return this._dataSource$.readonly;
|
|
3473
3474
|
}
|
|
3475
|
+
/**
|
|
3476
|
+
* Gets the rows that are visible after any filters are applied. If there are
|
|
3477
|
+
* no filters then this will be the same as the root dataset.
|
|
3478
|
+
*/
|
|
3479
|
+
get filteredRows$() {
|
|
3480
|
+
return this._filteredRows$.readonly;
|
|
3481
|
+
}
|
|
3482
|
+
/**
|
|
3483
|
+
* Gets the rows are currently visible to the user. I.e. the current page in a paged table or the
|
|
3484
|
+
* expanded rows in a tree table.
|
|
3485
|
+
*/
|
|
3474
3486
|
get visibleRows$() {
|
|
3475
3487
|
return this._visibleRows$.readonly;
|
|
3476
3488
|
}
|
|
@@ -3935,6 +3947,10 @@ class TableModel extends AbstractTableModel {
|
|
|
3935
3947
|
this.setDataSource(sourceOfTruth);
|
|
3936
3948
|
}
|
|
3937
3949
|
}
|
|
3950
|
+
bindToTable(filteredRows$, visibleRows$) {
|
|
3951
|
+
this._filteredRows$.setDelegate(filteredRows$);
|
|
3952
|
+
this._visibleRows$.setDelegate(visibleRows$);
|
|
3953
|
+
}
|
|
3938
3954
|
addSelectionColumn(selectionModel, showSelectionColumn) {
|
|
3939
3955
|
return this._addSelectionColumn(selectionModel, showSelectionColumn);
|
|
3940
3956
|
}
|
|
@@ -4254,6 +4270,7 @@ class TableComponent extends AbstractTableComponent {
|
|
|
4254
4270
|
this._filteredRows$.setDelegate(this._dataSource$);
|
|
4255
4271
|
}
|
|
4256
4272
|
this.configurePaging(this.enablePaging$.value);
|
|
4273
|
+
this.tableModel.bindToTable(this._filteredRows$, this._visibleRows$);
|
|
4257
4274
|
}
|
|
4258
4275
|
getModel() {
|
|
4259
4276
|
return this.tableModel;
|
|
@@ -4622,10 +4639,11 @@ class TreeTableModel extends AbstractTableModel {
|
|
|
4622
4639
|
get isExpandedPredicate$() {
|
|
4623
4640
|
return this._isExpandedPredicate$.readonly;
|
|
4624
4641
|
}
|
|
4625
|
-
bindToTable(expansionModel, visibleRows$) {
|
|
4642
|
+
bindToTable(expansionModel, filteredRows$, visibleRows$) {
|
|
4626
4643
|
this.treeExpansionModel = expansionModel;
|
|
4627
4644
|
// TODO: Move all the expansion model stuff out of here and have things use the expansion model directly
|
|
4628
4645
|
this._isExpandedPredicate$.setDelegate(this.treeExpansionModel.isExpandedPredicate$);
|
|
4646
|
+
this._filteredRows$.setDelegate(filteredRows$);
|
|
4629
4647
|
this._visibleRows$.setDelegate(visibleRows$);
|
|
4630
4648
|
}
|
|
4631
4649
|
treeControlColumn(builder) {
|
|
@@ -4946,9 +4964,9 @@ class TreeTableComponent extends AbstractTableComponent {
|
|
|
4946
4964
|
}
|
|
4947
4965
|
// Todo, turn this into a plain chain model
|
|
4948
4966
|
const visibleRows$ = new FlattenedTreeListModel(this._dataSource$, row => this.treeTableModel.childExtractor(row), this.expansionModel);
|
|
4949
|
-
this.expansionModel.bindToTable(this._dataSource$, visibleRows$);
|
|
4950
|
-
this.treeTableModel.bindToTable(this.expansionModel, visibleRows$);
|
|
4951
4967
|
this._visibleRows$.setDelegate(visibleRows$);
|
|
4968
|
+
this.expansionModel.bindToTable(this._dataSource$, visibleRows$);
|
|
4969
|
+
this.treeTableModel.bindToTable(this.expansionModel, visibleRows$, this._visibleRows$);
|
|
4952
4970
|
}
|
|
4953
4971
|
getModel() {
|
|
4954
4972
|
return this.treeTableModel;
|