tuain-ng-forms-lib 14.0.6 → 14.0.7
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/classes/forms/table/table.mjs +7 -3
- package/esm2020/lib/components/elements/tables/table.component.mjs +5 -4
- package/fesm2015/tuain-ng-forms-lib.mjs +10 -5
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +10 -5
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/classes/forms/table/table.d.ts +2 -2
- package/lib/components/elements/tables/table.component.d.ts +1 -2
- package/package.json +1 -1
|
@@ -332,12 +332,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
332
332
|
const changeViewAttributes = ['visibleRecords', 'currentPage', 'recordsPerPage'];
|
|
333
333
|
class LibTableComponent {
|
|
334
334
|
constructor() {
|
|
335
|
-
this.globalFilterString = '';
|
|
336
335
|
this.currentPage = 1;
|
|
337
336
|
this.globalSearch = false;
|
|
337
|
+
this.globalFilterString = '';
|
|
338
|
+
this.visibleRecords = [];
|
|
338
339
|
this.selectedRecords = [];
|
|
339
340
|
this.totalRecordsNumber = 0;
|
|
340
341
|
this.allSelected = false;
|
|
342
|
+
this.layout = '';
|
|
341
343
|
this.loaded = false;
|
|
342
344
|
this.selectable = false;
|
|
343
345
|
this.hasActions = false;
|
|
@@ -379,8 +381,7 @@ class LibTableComponent {
|
|
|
379
381
|
globalFilterCompleted() { this.changePage(1); }
|
|
380
382
|
changePage(requestedPage) { this.table.changePage(requestedPage); }
|
|
381
383
|
tableColumnSort(columnName, direction = null) { this.table.sort(columnName, direction ?? 'ascend'); }
|
|
382
|
-
globalFilterChanged() { this.table.setGlobalFilterString(this.globalFilterString?.trim() ?? ''); }
|
|
383
|
-
cleanGlobalFilter() { this.globalFilterString = ''; this.globalFilterChanged(); }
|
|
384
|
+
globalFilterChanged() { this.table.setGlobalFilterString(this.globalFilterString?.trim() ?? '', false); }
|
|
384
385
|
syncAttribute(name, value) {
|
|
385
386
|
try {
|
|
386
387
|
if (name === 'visibleRecords') {
|
|
@@ -1104,6 +1105,7 @@ class RecordTable extends FormElement {
|
|
|
1104
1105
|
this.setAttr('tableCode', tableReceived.tableCode);
|
|
1105
1106
|
this.setAttr('clientPaging', tableReceived?.clientPaging ?? true);
|
|
1106
1107
|
this.setAttr('globalSearch', tableReceived?.simpleFilter ?? false);
|
|
1108
|
+
this.setAttr('globalFilterString', '');
|
|
1107
1109
|
this.setAttr('sorting', { columnName: '', direction: '' });
|
|
1108
1110
|
this.setAttr('recordsPerPage', formConfig.defaultRecordsPerPage);
|
|
1109
1111
|
this.setAttr('layout', '');
|
|
@@ -1333,11 +1335,14 @@ class RecordTable extends FormElement {
|
|
|
1333
1335
|
this.restrictedId = null;
|
|
1334
1336
|
this.updateVisibleRecords();
|
|
1335
1337
|
}
|
|
1336
|
-
setGlobalFilterString(text) {
|
|
1338
|
+
setGlobalFilterString(text, notifyComponent = true) {
|
|
1337
1339
|
this.globalFilterStrings = text.split(' ').filter(t => t && t.trim().length > 0).map(t => t.trim()) ?? [];
|
|
1338
1340
|
if (this.clientPaging) {
|
|
1339
1341
|
this.changePage(1);
|
|
1340
1342
|
}
|
|
1343
|
+
if (notifyComponent) {
|
|
1344
|
+
this.setAttr('globalFilterString', text);
|
|
1345
|
+
}
|
|
1341
1346
|
}
|
|
1342
1347
|
addFilterDefinition(columnName, filterDefinition) {
|
|
1343
1348
|
const tableColumn = this.columnDefinition(columnName);
|
|
@@ -1365,7 +1370,7 @@ class RecordTable extends FormElement {
|
|
|
1365
1370
|
const tableColumn = this.columnDefinition(columnName);
|
|
1366
1371
|
const columnFilterDefinition = tableColumn?.filterDefinition ?? null;
|
|
1367
1372
|
if (!columnFilterDefinition) {
|
|
1368
|
-
return
|
|
1373
|
+
return;
|
|
1369
1374
|
}
|
|
1370
1375
|
tableColumn && tableColumn.addFilter(columnValues, operator);
|
|
1371
1376
|
this.updateVisibleRecords();
|