@megha-ui/react 1.2.412 → 1.2.414

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.
@@ -136,29 +136,21 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
136
136
  })
137
137
  : true);
138
138
  console.log(searchQueries, "searchQueries");
139
- console.log(filterColumns, "filterColumns");
140
- const _searchAvailableColumns = filterColumns.filter((column) => {
141
- return searchQueries[column.key] && searchQueries[column.key].text !== "";
142
- });
143
- console.log(_searchAvailableColumns, "_searchAvailableColumns");
139
+ console.log(filterColumns);
144
140
  _filteredData = _filteredData.filter((item) => searchOp === "and"
145
141
  ? filterColumns.every((column) => {
146
- var _a, _b, _c, _d;
142
+ var _a, _b, _c;
147
143
  const query = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text) || "";
148
144
  const queryData = query.toLowerCase().split(",");
149
145
  const value = item[column.key] && item[column.key].value
150
146
  ? (_b = item[column.key].value) === null || _b === void 0 ? void 0 : _b.toString()
151
147
  : "";
152
- console.log("Coming here");
153
148
  if (query.includes("*") || query.includes("?")) {
154
149
  const regex = createRegexFromWildcard(query);
155
150
  return regex.test(value);
156
151
  }
157
- if (query === "") {
158
- return true;
159
- }
160
- console.log((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type, "type");
161
- switch ((_d = searchQueries[column.key]) === null || _d === void 0 ? void 0 : _d.type) {
152
+ console.log({ query, value, column, searchQueries });
153
+ switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
162
154
  case "contains":
163
155
  return value.toLowerCase().includes(query.toLowerCase());
164
156
  case "doesNotContain":
@@ -225,23 +217,17 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
225
217
  }
226
218
  })
227
219
  : filterColumns.some((column) => {
228
- var _a, _b, _c, _d;
220
+ var _a, _b, _c;
229
221
  const query = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text) || "";
230
222
  const queryData = query.toLowerCase().split(",");
231
223
  const value = item[column.key] && item[column.key].value
232
224
  ? (_b = item[column.key].value) === null || _b === void 0 ? void 0 : _b.toString()
233
225
  : "";
234
- console.log("Coming here2");
235
226
  if (query.includes("*") || query.includes("?")) {
236
227
  const regex = createRegexFromWildcard(query);
237
228
  return regex.test(value);
238
229
  }
239
- console.log(column, "column");
240
- if (query === "") {
241
- return true;
242
- }
243
- console.log((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type, "type");
244
- switch ((_d = searchQueries[column.key]) === null || _d === void 0 ? void 0 : _d.type) {
230
+ switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
245
231
  case "contains":
246
232
  return value.toLowerCase().includes(query.toLowerCase());
247
233
  case "doesNotContain":
@@ -324,7 +310,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
324
310
  return query.some((term) => rowValues.some((value) => value.includes(term)));
325
311
  }
326
312
  });
327
- _filteredData = _filteredData.filter((item) => filterColumns.filter(item => searchQueries[item.key]).some((column) => {
313
+ _filteredData = _filteredData.filter((item) => filterColumns.some((column) => {
328
314
  var _a;
329
315
  const query = inputValue || "";
330
316
  const value = item[column.key] && item[column.key].value
@@ -1436,10 +1422,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
1436
1422
  ? (_a = data[column.key].value) === null || _a === void 0 ? void 0 : _a.toString()
1437
1423
  : "";
1438
1424
  }),
1439
- ].sort((a, b) => {
1440
- var _a, _b;
1441
- return comparator(a, b, (_a = column.dataType) !== null && _a !== void 0 ? _a : "", (_b = column.fixedFilterOrder) !== null && _b !== void 0 ? _b : "asc");
1442
- });
1425
+ ].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"); });
1443
1426
  selectedValues.forEach((item) => {
1444
1427
  if (!options.includes(item)) {
1445
1428
  options.push(item);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.412",
3
+ "version": "1.2.414",
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",