@megha-ui/react 1.2.399 → 1.2.401

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.
@@ -139,7 +139,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
139
139
  console.log(filterColumns, "filterColumns");
140
140
  _filteredData = _filteredData.filter((item) => searchOp === "and"
141
141
  ? filterColumns.every((column) => {
142
- var _a, _b, _c;
142
+ var _a, _b, _c, _d;
143
143
  const query = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text) || "";
144
144
  const queryData = query.toLowerCase().split(",");
145
145
  const value = item[column.key] && item[column.key].value
@@ -149,7 +149,11 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
149
149
  const regex = createRegexFromWildcard(query);
150
150
  return regex.test(value);
151
151
  }
152
- switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
152
+ if (query === "") {
153
+ return true;
154
+ }
155
+ console.log((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type, "type");
156
+ switch ((_d = searchQueries[column.key]) === null || _d === void 0 ? void 0 : _d.type) {
153
157
  case "contains":
154
158
  return value.toLowerCase().includes(query.toLowerCase());
155
159
  case "doesNotContain":
@@ -216,7 +220,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
216
220
  }
217
221
  })
218
222
  : filterColumns.some((column) => {
219
- var _a, _b, _c;
223
+ var _a, _b, _c, _d;
220
224
  const query = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text) || "";
221
225
  const queryData = query.toLowerCase().split(",");
222
226
  const value = item[column.key] && item[column.key].value
@@ -226,7 +230,11 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
226
230
  const regex = createRegexFromWildcard(query);
227
231
  return regex.test(value);
228
232
  }
229
- switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
233
+ if (query === "") {
234
+ return true;
235
+ }
236
+ console.log((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type, "type");
237
+ switch ((_d = searchQueries[column.key]) === null || _d === void 0 ? void 0 : _d.type) {
230
238
  case "contains":
231
239
  return value.toLowerCase().includes(query.toLowerCase());
232
240
  case "doesNotContain":
@@ -1421,7 +1429,10 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
1421
1429
  ? (_a = data[column.key].value) === null || _a === void 0 ? void 0 : _a.toString()
1422
1430
  : "";
1423
1431
  }),
1424
- ].sort((a, b) => { var _a, _b; return comparator(a, b, (_a = column.dataType) !== null && _a !== void 0 ? _a : "", (_b = column.fixedFilterOrder) !== null && _b !== void 0 ? _b : "asc"); });
1432
+ ].sort((a, b) => {
1433
+ var _a, _b;
1434
+ return comparator(a, b, (_a = column.dataType) !== null && _a !== void 0 ? _a : "", (_b = column.fixedFilterOrder) !== null && _b !== void 0 ? _b : "asc");
1435
+ });
1425
1436
  selectedValues.forEach((item) => {
1426
1437
  if (!options.includes(item)) {
1427
1438
  options.push(item);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.399",
3
+ "version": "1.2.401",
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",