@messaia/cdk 22.0.2-rc.1 → 22.0.2-rc.2
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/fesm2022/messaia-cdk.mjs
CHANGED
|
@@ -18021,6 +18021,7 @@ class TableStaticDataSource extends MatTableDataSource {
|
|
|
18021
18021
|
* @method connect
|
|
18022
18022
|
* @description Called when the MatTable connects to the data source.
|
|
18023
18023
|
* This method subscribes to the reload token to trigger a filter update and data refresh.
|
|
18024
|
+
* Clearing the last column filter also clears the active Material table filter.
|
|
18024
18025
|
* @docs-private
|
|
18025
18026
|
* @returns {BehaviorSubject<TEntity[]>} A BehaviorSubject containing the current data array.
|
|
18026
18027
|
*/
|
|
@@ -18028,10 +18029,17 @@ class TableStaticDataSource extends MatTableDataSource {
|
|
|
18028
18029
|
/* Subscribe to the reload token and update filters accordingly */
|
|
18029
18030
|
this._reloadChange.subscribe(x => {
|
|
18030
18031
|
/* Clean up any empty filters before applying them */
|
|
18031
|
-
Object.keys(this.fieldFilters)
|
|
18032
|
+
const fieldKeys = Object.keys(this.fieldFilters);
|
|
18033
|
+
fieldKeys.forEach((key) => ((this.fieldFilters[key] == null || this.fieldFilters[key] === '' || this.fieldFilters[key] === 'undefined')) && this.fieldFilters[key] !== 0 && delete this.fieldFilters[key]);
|
|
18034
|
+
/* Clean up any empty static field filters before applying them */
|
|
18032
18035
|
Object.keys(this.staticFieldFilters).forEach((key) => ((this.staticFieldFilters[key] == null || this.staticFieldFilters[key] === '' || this.staticFieldFilters[key] === 'undefined')) && this.staticFieldFilters[key] !== 0 && delete this.staticFieldFilters[key]);
|
|
18036
|
+
/* Clean up any empty static field filters before applying them */
|
|
18037
|
+
const activeFieldKeys = Object.keys(this.fieldFilters);
|
|
18038
|
+
if (fieldKeys.length > 0 && activeFieldKeys.length === 0) {
|
|
18039
|
+
this.filter = '';
|
|
18040
|
+
}
|
|
18033
18041
|
/* Apply filters dynamically to the table data */
|
|
18034
|
-
|
|
18042
|
+
activeFieldKeys.forEach((key) => {
|
|
18035
18043
|
this.filterPredicate = (data, filter) => !filter || `${data[key]}`.toLowerCase().includes(`${this.filter}`?.toLowerCase());
|
|
18036
18044
|
this.filter = this.fieldFilters[key];
|
|
18037
18045
|
});
|