cats-data-grid 2.0.57 → 2.0.59

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.
@@ -1207,6 +1207,7 @@ class CatsDataGridComponent {
1207
1207
  if (fieldName.includes('.')) {
1208
1208
  fieldName = fieldName.split('.')[0];
1209
1209
  }
1210
+ return this.normalizeSetFilterType(r[fieldName], col?.cellRendererParams?.tagKey)?.filter(Boolean);
1210
1211
  })),
1211
1212
  ];
1212
1213
  const selectedValues = new Set(appliedFilter.filters.map((f) => f.filterValue));
@@ -1301,10 +1302,10 @@ class CatsDataGridComponent {
1301
1302
  let result = structuredClone(this.originalRowData);
1302
1303
  this.colDefs.forEach((col) => {
1303
1304
  let field = col.fieldName;
1304
- if (field.includes('.')) {
1305
- const a = field.split('.');
1306
- field = a[0];
1307
- }
1305
+ // if (field.includes('.')) {
1306
+ // const a = field.split('.');
1307
+ // field = a[0];
1308
+ // }
1308
1309
  if (col?.filterable) {
1309
1310
  if (col.filterType === 'text') {
1310
1311
  // *********** TEXT FILTER ***********
@@ -1317,7 +1318,7 @@ class CatsDataGridComponent {
1317
1318
  }
1318
1319
  this.activeFilters.add(col.fieldName);
1319
1320
  result = result.filter((r) => {
1320
- const fieldVal = String(r[field]).toLowerCase();
1321
+ const fieldVal = this.evaluateFieldValue(r, field)?.toLowerCase() || '';
1321
1322
  const cond1 = textVal1
1322
1323
  ? this.evaluateTextFilterCondition(c1.filterOperation, fieldVal, textVal1)
1323
1324
  : false;
@@ -1426,6 +1427,17 @@ class CatsDataGridComponent {
1426
1427
  this.getGroupedData();
1427
1428
  this.filter.emit(this.filteredData);
1428
1429
  }
1430
+ evaluateFieldValue(row, field) {
1431
+ if (field.includes('.')) {
1432
+ const parts = field.split('.');
1433
+ let value = row;
1434
+ for (const part of parts) {
1435
+ value = value?.[part];
1436
+ }
1437
+ return value;
1438
+ }
1439
+ return row[field];
1440
+ }
1429
1441
  resetFilter(col) {
1430
1442
  switch (col.filterType) {
1431
1443
  case 'text':
@@ -2048,6 +2060,7 @@ class CatsDataGridComponent {
2048
2060
  const style = {
2049
2061
  width: `${col.width ?? 150}px`,
2050
2062
  minWidth: `${col.minWidth ?? 50}px`,
2063
+ maxWidth: `${col.maxWidth}px`,
2051
2064
  };
2052
2065
  if (col.isAction) {
2053
2066
  style.position = 'sticky';