cats-data-grid 2.0.58 → 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.
- package/fesm2022/cats-data-grid.mjs +17 -5
- package/fesm2022/cats-data-grid.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1302,10 +1302,10 @@ class CatsDataGridComponent {
|
|
|
1302
1302
|
let result = structuredClone(this.originalRowData);
|
|
1303
1303
|
this.colDefs.forEach((col) => {
|
|
1304
1304
|
let field = col.fieldName;
|
|
1305
|
-
if (field.includes('.')) {
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
}
|
|
1305
|
+
// if (field.includes('.')) {
|
|
1306
|
+
// const a = field.split('.');
|
|
1307
|
+
// field = a[0];
|
|
1308
|
+
// }
|
|
1309
1309
|
if (col?.filterable) {
|
|
1310
1310
|
if (col.filterType === 'text') {
|
|
1311
1311
|
// *********** TEXT FILTER ***********
|
|
@@ -1318,7 +1318,7 @@ class CatsDataGridComponent {
|
|
|
1318
1318
|
}
|
|
1319
1319
|
this.activeFilters.add(col.fieldName);
|
|
1320
1320
|
result = result.filter((r) => {
|
|
1321
|
-
const fieldVal =
|
|
1321
|
+
const fieldVal = this.evaluateFieldValue(r, field)?.toLowerCase() || '';
|
|
1322
1322
|
const cond1 = textVal1
|
|
1323
1323
|
? this.evaluateTextFilterCondition(c1.filterOperation, fieldVal, textVal1)
|
|
1324
1324
|
: false;
|
|
@@ -1427,6 +1427,17 @@ class CatsDataGridComponent {
|
|
|
1427
1427
|
this.getGroupedData();
|
|
1428
1428
|
this.filter.emit(this.filteredData);
|
|
1429
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
|
+
}
|
|
1430
1441
|
resetFilter(col) {
|
|
1431
1442
|
switch (col.filterType) {
|
|
1432
1443
|
case 'text':
|
|
@@ -2049,6 +2060,7 @@ class CatsDataGridComponent {
|
|
|
2049
2060
|
const style = {
|
|
2050
2061
|
width: `${col.width ?? 150}px`,
|
|
2051
2062
|
minWidth: `${col.minWidth ?? 50}px`,
|
|
2063
|
+
maxWidth: `${col.maxWidth}px`,
|
|
2052
2064
|
};
|
|
2053
2065
|
if (col.isAction) {
|
|
2054
2066
|
style.position = 'sticky';
|