@messaia/cdk 22.0.1-rc.21 → 22.0.1-rc.22
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/README.md +8 -0
- package/fesm2022/messaia-cdk.mjs +10 -2
- package/fesm2022/messaia-cdk.mjs.map +1 -1
- package/package.json +1 -1
- package/types/messaia-cdk.d.ts +2 -1
package/README.md
CHANGED
|
@@ -40,6 +40,14 @@ Once the project is built, you can publish your library by following these steps
|
|
|
40
40
|
npm publish
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
## Table row selection
|
|
44
|
+
|
|
45
|
+
`TableDataSource` matches selected rows by their non-null `id`, so selections remain
|
|
46
|
+
checked when server-side pagination or `reload(false)` returns new row instances.
|
|
47
|
+
IDs must be unique and stable across pages. Rows without an ID use reference equality.
|
|
48
|
+
Toggling a reloaded row removes its existing selection instead of adding a duplicate.
|
|
49
|
+
`reload()` still clears selection by default.
|
|
50
|
+
|
|
43
51
|
## Running unit tests
|
|
44
52
|
|
|
45
53
|
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
package/fesm2022/messaia-cdk.mjs
CHANGED
|
@@ -17013,10 +17013,18 @@ class TableDataSource extends DataSource {
|
|
|
17013
17013
|
onDataLoaded = new BehaviorSubject(null);
|
|
17014
17014
|
/**
|
|
17015
17015
|
* @property selectionModel
|
|
17016
|
-
* @description Tracks
|
|
17016
|
+
* @description Tracks entities across pages by non-null ID, falling back to reference
|
|
17017
|
+
* equality for entities without an ID.
|
|
17017
17018
|
* @type {SelectionModel<TEntity>}
|
|
17018
17019
|
*/
|
|
17019
|
-
selectionModel = new SelectionModel(true, [])
|
|
17020
|
+
selectionModel = new SelectionModel(true, [], true, (selected, item) => {
|
|
17021
|
+
if (selected === item) {
|
|
17022
|
+
return true;
|
|
17023
|
+
}
|
|
17024
|
+
return typeof selected === 'object' && selected !== null && 'id' in selected
|
|
17025
|
+
&& typeof item === 'object' && item !== null && 'id' in item
|
|
17026
|
+
&& selected.id != null && selected.id === item.id;
|
|
17027
|
+
});
|
|
17020
17028
|
/**
|
|
17021
17029
|
* @property filter
|
|
17022
17030
|
* @description Gets the current free-text filter.
|