@megha-ui/react 1.2.417 → 1.2.419

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.
@@ -1,3 +1,14 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
13
  import { useState, useEffect, useRef, useMemo, } from "react";
3
14
  import * as XLSX from "xlsx";
@@ -135,8 +146,6 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
135
146
  return filterValue.includes(cellValue);
136
147
  })
137
148
  : true);
138
- console.log(searchQueries, "searchQueries");
139
- console.log(filterColumns);
140
149
  _filteredData = _filteredData.filter((item) => searchOp === "and"
141
150
  ? filterColumns.every((column) => {
142
151
  var _a, _b, _c;
@@ -149,7 +158,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
149
158
  const regex = createRegexFromWildcard(query);
150
159
  return regex.test(value);
151
160
  }
152
- console.log({ query, value, column, searchQueries });
161
+ console.log("searchQueries[column.key]?.type", searchQueries[column.key]);
153
162
  switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
154
163
  case "contains":
155
164
  return value.toLowerCase().includes(query.toLowerCase());
@@ -227,14 +236,13 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
227
236
  const regex = createRegexFromWildcard(query);
228
237
  return regex.test(value);
229
238
  }
230
- console.log({ query, value, column, searchQueries });
231
239
  switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
232
240
  case "contains":
233
241
  return value.toLowerCase().includes(query.toLowerCase());
234
242
  case "doesNotContain":
235
243
  return !value.toLowerCase().includes(query.toLowerCase());
236
244
  case "equals":
237
- return !queryData.includes(value.toLowerCase());
245
+ return queryData.includes(value.toLowerCase());
238
246
  case "gt":
239
247
  if (!isNaN(parseFloat(query))) {
240
248
  return parseFloat(value) > parseFloat(query);
@@ -345,6 +353,8 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
345
353
  fixedFilterValues,
346
354
  hideDuplicates,
347
355
  actionsKey,
356
+ fixedColumns,
357
+ searchOp,
348
358
  ]);
349
359
  const recalculate = (_summariseKeys) => {
350
360
  const filteredData = paginate ? paginatedData : sortedData;
@@ -796,8 +806,8 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
796
806
  const handleSearch = (key, value, type) => {
797
807
  setSearchQueries((prev) => (Object.assign(Object.assign({}, prev), { [key]: { text: value, type, operation: "and" } })));
798
808
  setUniqueSearch((prev) => {
799
- delete prev[key];
800
- return prev;
809
+ const _a = prev, _b = key, _removed = _a[_b], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
810
+ return rest;
801
811
  });
802
812
  };
803
813
  useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.417",
3
+ "version": "1.2.419",
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",