tuain-ng-forms-lib 13.0.2 → 13.0.5

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.
@@ -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
- if (this.recordData.hasOwnProperty(fieldCode)) {
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
- const fieldValue = this.recordData[fieldCode];
1009
+ let fieldValue;
1010
+ if (columnDef.fieldType.toUpperCase().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) {