ngx-st-tables 17.0.92 → 17.0.94
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/esm2022/lib/components/material-table/material-table-caption/material-table-filter-dialog/material-table-filter-dialog.component.mjs +5 -3
- package/esm2022/lib/components/material-table/material-table-caption/material-table-filter-dialog/material-table-filter.component.mjs +4 -3
- package/esm2022/lib/components/material-table/material-table.component.mjs +11 -7
- package/fesm2022/ngx-st-tables.mjs +17 -10
- package/fesm2022/ngx-st-tables.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -265,10 +265,10 @@ class MaterialTableFilterComponent extends StSubscribeDestroyComponent {
|
|
|
265
265
|
if (this.column().filterType === 'date') {
|
|
266
266
|
tmpValue = [
|
|
267
267
|
this.formGroup.controls.dateFrom.value
|
|
268
|
-
? this.formGroup.controls.dateFrom.value.
|
|
268
|
+
? `${this.formGroup.controls.dateFrom.value.getFullYear()}-${(this.formGroup.controls.dateFrom.value.getMonth() + 1).toString().padStart(2, '0')}-${this.formGroup.controls.dateFrom.value.getDate().toString().padStart(2, '0')}`
|
|
269
269
|
: null,
|
|
270
270
|
this.formGroup.controls.dateTo.value
|
|
271
|
-
? this.formGroup.controls.dateTo.value.
|
|
271
|
+
? `${this.formGroup.controls.dateTo.value.getFullYear()}-${(this.formGroup.controls.dateTo.value.getMonth() + 1).toString().padStart(2, '0')}-${this.formGroup.controls.dateTo.value.getDate().toString().padStart(2, '0')}`
|
|
272
272
|
: null,
|
|
273
273
|
];
|
|
274
274
|
}
|
|
@@ -276,6 +276,7 @@ class MaterialTableFilterComponent extends StSubscribeDestroyComponent {
|
|
|
276
276
|
this.column().filterType === 'number') {
|
|
277
277
|
tmpValue = this.formGroup.controls.value.value || null;
|
|
278
278
|
}
|
|
279
|
+
// this.formGroup.controls.value.setValue(tmpValue);
|
|
279
280
|
const newFilter = {
|
|
280
281
|
matchMode: this.formGroup.controls.matchMode.value,
|
|
281
282
|
value: tmpValue,
|
|
@@ -553,8 +554,10 @@ class MaterialTableFilterDialogComponent {
|
|
|
553
554
|
this.filtersValue.update(currentFilters => {
|
|
554
555
|
const initKeys = Object.keys(this.dialogData.initFilters);
|
|
555
556
|
initKeys.forEach(initKey => {
|
|
556
|
-
|
|
557
|
-
|
|
557
|
+
if (this.dialogData.initFilters[initKey].value) {
|
|
558
|
+
currentFilters[initKey].value =
|
|
559
|
+
this.dialogData.initFilters[initKey].value;
|
|
560
|
+
}
|
|
558
561
|
});
|
|
559
562
|
return currentFilters;
|
|
560
563
|
});
|
|
@@ -1209,11 +1212,12 @@ class MaterialTableComponent extends StSubscribeDestroyComponent {
|
|
|
1209
1212
|
searchOk &&
|
|
1210
1213
|
data[key] !== undefined &&
|
|
1211
1214
|
data[key] !== null &&
|
|
1212
|
-
|
|
1215
|
+
searchTerms[key].matchMode === 'equal'
|
|
1216
|
+
? data[key] === searchTerms[key].value
|
|
1217
|
+
: data[key]
|
|
1213
1218
|
.toString()
|
|
1214
1219
|
.toLowerCase()
|
|
1215
|
-
.indexOf(searchTerms[key].value.toString().toLowerCase()) !==
|
|
1216
|
-
-1;
|
|
1220
|
+
.indexOf(searchTerms[key].value.toString().toLowerCase()) !== -1;
|
|
1217
1221
|
}
|
|
1218
1222
|
}
|
|
1219
1223
|
});
|
|
@@ -1260,6 +1264,7 @@ class MaterialTableComponent extends StSubscribeDestroyComponent {
|
|
|
1260
1264
|
}
|
|
1261
1265
|
}
|
|
1262
1266
|
updateDataToLocalStorage() {
|
|
1267
|
+
console.log('updateDataLS');
|
|
1263
1268
|
if (this.localStorageName()) {
|
|
1264
1269
|
localStorage.setItem(this.localStorageName(), JSON.stringify(this.localStorageData));
|
|
1265
1270
|
}
|
|
@@ -1356,9 +1361,11 @@ class MaterialTableComponent extends StSubscribeDestroyComponent {
|
|
|
1356
1361
|
const localStorageData = localStorage.getItem(this.localStorageName());
|
|
1357
1362
|
if (localStorageData) {
|
|
1358
1363
|
this.localStorageData = JSON.parse(localStorageData);
|
|
1359
|
-
const filters = this.validOldFiltersToNewFormat(
|
|
1360
|
-
this.localStorageData.filters
|
|
1361
|
-
|
|
1364
|
+
// const filters = this.validOldFiltersToNewFormat(
|
|
1365
|
+
// this.localStorageData.filters
|
|
1366
|
+
// );
|
|
1367
|
+
// this.localStorageData.filters = filters;
|
|
1368
|
+
this.initFilters = this.localStorageData.filters;
|
|
1362
1369
|
this.initGlobalSearch = this.localStorageData.globalSearch;
|
|
1363
1370
|
}
|
|
1364
1371
|
else {
|