tuain-ng-forms-lib 13.0.1 → 13.0.4
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/row-data.mjs +11 -4
- package/esm2020/lib/classes/forms/table/table.mjs +3 -3
- package/fesm2015/tuain-ng-forms-lib.mjs +12 -5
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +12 -5
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/classes/forms/table/row-data.d.ts +1 -1
- package/package.json +2 -2
|
@@ -997,15 +997,22 @@ class TableRecordData {
|
|
|
997
997
|
getFieldValue(fieldCode) {
|
|
998
998
|
return (fieldCode && this.recordData) ? this.recordData[fieldCode] : null;
|
|
999
999
|
}
|
|
1000
|
-
hasPattern(words) {
|
|
1000
|
+
hasPattern(words, columnObj) {
|
|
1001
1001
|
if (!words || words.length === 0) {
|
|
1002
1002
|
return true;
|
|
1003
1003
|
}
|
|
1004
1004
|
for (const fieldCode in this.recordData) {
|
|
1005
|
-
|
|
1005
|
+
const columnDef = columnObj?.[fieldCode];
|
|
1006
|
+
if (columnDef && columnDef?.visible && this.recordData.hasOwnProperty(fieldCode)) {
|
|
1006
1007
|
for (const word of words) {
|
|
1007
1008
|
const term = word.toUpperCase();
|
|
1008
|
-
|
|
1009
|
+
let fieldValue;
|
|
1010
|
+
if (columnDef.fieldType.toUpper().includes('DATE')) {
|
|
1011
|
+
fieldValue = this.recordData[fieldCode].substring(0, 16);
|
|
1012
|
+
}
|
|
1013
|
+
else {
|
|
1014
|
+
fieldValue = this.recordData[fieldCode];
|
|
1015
|
+
}
|
|
1009
1016
|
if (fieldValue.toString().toUpperCase().includes(term)) {
|
|
1010
1017
|
return true;
|
|
1011
1018
|
}
|
|
@@ -1342,7 +1349,7 @@ class RecordTable extends FormElement {
|
|
|
1342
1349
|
filteredRecords = filteredRecords.filter(record => record.recordId === this.restrictedId);
|
|
1343
1350
|
}
|
|
1344
1351
|
if (this.globalFilterStrings.length > 0) {
|
|
1345
|
-
filteredRecords = filteredRecords.filter(record => record.hasPattern(this.globalFilterStrings));
|
|
1352
|
+
filteredRecords = filteredRecords.filter(record => record.hasPattern(this.globalFilterStrings, this._tableColumnObj));
|
|
1346
1353
|
}
|
|
1347
1354
|
const columnFilters = this.columns.filter(column => column.filter).map(column => column.filter);
|
|
1348
1355
|
if (columnFilters.length > 0) {
|
|
@@ -1406,7 +1413,7 @@ class RecordTable extends FormElement {
|
|
|
1406
1413
|
return;
|
|
1407
1414
|
}
|
|
1408
1415
|
this.tableRecords.sort((a, b) => this.recordCompare(a, b, this.sorting.columnName, this.sorting.direction));
|
|
1409
|
-
this.unSelectAll();
|
|
1416
|
+
//this.unSelectAll();
|
|
1410
1417
|
this.updateVisibleRecords();
|
|
1411
1418
|
}
|
|
1412
1419
|
recordCompare(recordA, recordB, columnCompare, direction) {
|