@megha-ui/react 1.2.417 → 1.2.418

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,6 @@ 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 });
153
161
  switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
154
162
  case "contains":
155
163
  return value.toLowerCase().includes(query.toLowerCase());
@@ -227,14 +235,13 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
227
235
  const regex = createRegexFromWildcard(query);
228
236
  return regex.test(value);
229
237
  }
230
- console.log({ query, value, column, searchQueries });
231
238
  switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
232
239
  case "contains":
233
240
  return value.toLowerCase().includes(query.toLowerCase());
234
241
  case "doesNotContain":
235
242
  return !value.toLowerCase().includes(query.toLowerCase());
236
243
  case "equals":
237
- return !queryData.includes(value.toLowerCase());
244
+ return queryData.includes(value.toLowerCase());
238
245
  case "gt":
239
246
  if (!isNaN(parseFloat(query))) {
240
247
  return parseFloat(value) > parseFloat(query);
@@ -345,6 +352,8 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
345
352
  fixedFilterValues,
346
353
  hideDuplicates,
347
354
  actionsKey,
355
+ fixedColumns,
356
+ searchOp,
348
357
  ]);
349
358
  const recalculate = (_summariseKeys) => {
350
359
  const filteredData = paginate ? paginatedData : sortedData;
@@ -796,8 +805,8 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
796
805
  const handleSearch = (key, value, type) => {
797
806
  setSearchQueries((prev) => (Object.assign(Object.assign({}, prev), { [key]: { text: value, type, operation: "and" } })));
798
807
  setUniqueSearch((prev) => {
799
- delete prev[key];
800
- return prev;
808
+ const _a = prev, _b = key, _removed = _a[_b], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
809
+ return rest;
801
810
  });
802
811
  };
803
812
  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.418",
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",