@megha-ui/react 1.2.411 → 1.2.413

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,20 @@ 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
+ switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
162
153
  case "contains":
163
154
  return value.toLowerCase().includes(query.toLowerCase());
164
155
  case "doesNotContain":
@@ -225,23 +216,17 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
225
216
  }
226
217
  })
227
218
  : filterColumns.some((column) => {
228
- var _a, _b, _c, _d;
219
+ var _a, _b, _c;
229
220
  const query = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text) || "";
230
221
  const queryData = query.toLowerCase().split(",");
231
222
  const value = item[column.key] && item[column.key].value
232
223
  ? (_b = item[column.key].value) === null || _b === void 0 ? void 0 : _b.toString()
233
224
  : "";
234
- console.log("Coming here2");
235
225
  if (query.includes("*") || query.includes("?")) {
236
226
  const regex = createRegexFromWildcard(query);
237
227
  return regex.test(value);
238
228
  }
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) {
229
+ switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
245
230
  case "contains":
246
231
  return value.toLowerCase().includes(query.toLowerCase());
247
232
  case "doesNotContain":
@@ -324,7 +309,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
324
309
  return query.some((term) => rowValues.some((value) => value.includes(term)));
325
310
  }
326
311
  });
327
- _filteredData = _filteredData.filter((item) => filterColumns.filter(item => searchQueries[item.key]).some((column) => {
312
+ _filteredData = _filteredData.filter((item) => filterColumns.some((column) => {
328
313
  var _a;
329
314
  const query = inputValue || "";
330
315
  const value = item[column.key] && item[column.key].value
@@ -1436,10 +1421,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
1436
1421
  ? (_a = data[column.key].value) === null || _a === void 0 ? void 0 : _a.toString()
1437
1422
  : "";
1438
1423
  }),
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
- });
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"); });
1443
1425
  selectedValues.forEach((item) => {
1444
1426
  if (!options.includes(item)) {
1445
1427
  options.push(item);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.411",
3
+ "version": "1.2.413",
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",