@megha-ui/react 1.2.777 → 1.2.779

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.
@@ -159,14 +159,19 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
159
159
  ? Object.keys(fixedFilterValues)
160
160
  .filter((key) => fixedColumns.find((col) => col.key === key))
161
161
  .every((key) => {
162
- var _a, _b, _c, _d, _e;
162
+ var _a, _b, _c, _d;
163
163
  const filterValue = fixedFilterValues[key];
164
164
  if (filterValue.length === 0)
165
165
  return true;
166
166
  const cellValue = ((_b = (_a = item[key]) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.toString()) || "";
167
- const col = columns.find((item) => key === item.key);
168
- const arrayColumn = (_c = col === null || col === void 0 ? void 0 : col.isArrayString) !== null && _c !== void 0 ? _c : false;
169
- const arrayValue = (_e = (_d = item === null || item === void 0 ? void 0 : item[key]) === null || _d === void 0 ? void 0 : _d.isArrayString) !== null && _e !== void 0 ? _e : false;
167
+ const arrayValue = (_d = (_c = item === null || item === void 0 ? void 0 : item[key]) === null || _c === void 0 ? void 0 : _c.isArrayString) !== null && _d !== void 0 ? _d : false;
168
+ if (arrayValue) {
169
+ return filterValue.some((item) => cellValue.split(">>").includes(item));
170
+ }
171
+ else if (cellValue.includes(">>")) {
172
+ const value = cellValue.split(">>").map((item) => item.trim());
173
+ return filterValue.includes(value[value.length - 1]);
174
+ }
170
175
  return filterValue.includes(cellValue);
171
176
  })
172
177
  : true);
@@ -1382,11 +1387,16 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
1382
1387
  ...data
1383
1388
  .filter((item) => item[column.key])
1384
1389
  .map((data) => {
1385
- var _a;
1390
+ var _a, _b, _c;
1391
+ const arrayValue = (_b = (_a = data[column.key]) === null || _a === void 0 ? void 0 : _a.isArrayString) !== null && _b !== void 0 ? _b : false;
1392
+ if (arrayValue) {
1393
+ return data[column.key].value.toString().split(">>");
1394
+ }
1386
1395
  return data[column.key] && data[column.key].value
1387
- ? (_a = data[column.key].value) === null || _a === void 0 ? void 0 : _a.toString()
1396
+ ? (_c = data[column.key].value) === null || _c === void 0 ? void 0 : _c.toString()
1388
1397
  : "";
1389
- }),
1398
+ })
1399
+ .flatMap((ite) => ite),
1390
1400
  ].sort((a, b) => {
1391
1401
  var _a, _b;
1392
1402
  return comparator(a, b, (_a = column.dataType) !== null && _a !== void 0 ? _a : "", (_b = column.fixedFilterOrder) !== null && _b !== void 0 ? _b : "asc");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.777",
3
+ "version": "1.2.779",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",