mn-angular-lib 1.0.38 → 1.0.40
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.
|
@@ -4131,7 +4131,7 @@ class MnTable {
|
|
|
4131
4131
|
if (!this.dataSource.loadAdditionalRows || this.loadingMoreRows)
|
|
4132
4132
|
return;
|
|
4133
4133
|
this.loadingMoreRows = true;
|
|
4134
|
-
const promise = (this.searchValue.length > 0 && this.dataSource.searchForAdditionalItems)
|
|
4134
|
+
const promise = (this.searchValue && this.searchValue.length > 0 && this.dataSource.searchForAdditionalItems)
|
|
4135
4135
|
? this.dataSource.searchForAdditionalItems(this.searchValue)
|
|
4136
4136
|
: this.dataSource.loadAdditionalRows();
|
|
4137
4137
|
promise
|
|
@@ -4233,9 +4233,9 @@ class MnTable {
|
|
|
4233
4233
|
}
|
|
4234
4234
|
// ── Private ──
|
|
4235
4235
|
applyFilterAndSort(searchForItems) {
|
|
4236
|
-
let items = this.dataSource.dataRows.value;
|
|
4236
|
+
let items = this.dataSource.dataRows.value ?? [];
|
|
4237
4237
|
// Skip client-side search filtering when server handles it.
|
|
4238
|
-
if (!this.isServerSearched && this.dataSource.isInSearch && this.dataSource.canSearch && this.searchValue.length > 0) {
|
|
4238
|
+
if (!this.isServerSearched && this.dataSource.isInSearch && this.dataSource.canSearch && this.searchValue && this.searchValue.length > 0) {
|
|
4239
4239
|
const term = this.searchValue.toLowerCase();
|
|
4240
4240
|
items = items.filter(row => this.dataSource.isInSearch(row, term));
|
|
4241
4241
|
}
|
|
@@ -4251,7 +4251,7 @@ class MnTable {
|
|
|
4251
4251
|
const term = filterValue.toLowerCase();
|
|
4252
4252
|
items = items.filter(row => {
|
|
4253
4253
|
const cellValue = typeof col.cell === 'function' ? col.cell(row) : '';
|
|
4254
|
-
return cellValue.toLowerCase().includes(term);
|
|
4254
|
+
return (cellValue ?? '').toLowerCase().includes(term);
|
|
4255
4255
|
});
|
|
4256
4256
|
}
|
|
4257
4257
|
}
|
|
@@ -4326,7 +4326,7 @@ class MnTable {
|
|
|
4326
4326
|
}
|
|
4327
4327
|
}
|
|
4328
4328
|
emitSelection() {
|
|
4329
|
-
const rows = this.dataSource.dataRows.value.filter(r => this.selectedIds.has(this.dataSource.getID(r)));
|
|
4329
|
+
const rows = (this.dataSource.dataRows.value ?? []).filter(r => this.selectedIds.has(this.dataSource.getID(r)));
|
|
4330
4330
|
this.dataSource.selectedRows?.next(rows);
|
|
4331
4331
|
this.selectionChange.emit(rows);
|
|
4332
4332
|
}
|