@megha-ui/react 1.2.421 → 1.2.422

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";
@@ -138,8 +149,6 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
138
149
  return filterValue.includes(cellValue);
139
150
  })
140
151
  : true);
141
- console.log(searchQueries, "searchQueries");
142
- console.log(filterColumns);
143
152
  _filteredData = _filteredData.filter((item) => searchOp === "and"
144
153
  ? filterColumns.every((column) => {
145
154
  var _a, _b, _c;
@@ -152,7 +161,7 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
152
161
  const regex = createRegexFromWildcard(query);
153
162
  return regex.test(value);
154
163
  }
155
- console.log({ query, value, column, searchQueries });
164
+ console.log("searchQueries[column.key]?.type", searchQueries[column.key]);
156
165
  switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
157
166
  case "contains":
158
167
  return value.toLowerCase().includes(query.toLowerCase());
@@ -230,14 +239,13 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
230
239
  const regex = createRegexFromWildcard(query);
231
240
  return regex.test(value);
232
241
  }
233
- console.log({ query, value, column, searchQueries });
234
242
  switch ((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) {
235
243
  case "contains":
236
244
  return value.toLowerCase().includes(query.toLowerCase());
237
245
  case "doesNotContain":
238
246
  return !value.toLowerCase().includes(query.toLowerCase());
239
247
  case "equals":
240
- return !queryData.includes(value.toLowerCase());
248
+ return queryData.includes(value.toLowerCase());
241
249
  case "gt":
242
250
  if (!isNaN(parseFloat(query))) {
243
251
  return parseFloat(value) > parseFloat(query);
@@ -348,6 +356,8 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
348
356
  fixedFilterValues,
349
357
  hideDuplicates,
350
358
  actionsKey,
359
+ fixedColumns,
360
+ searchOp,
351
361
  ]);
352
362
  const recalculate = (_summariseKeys) => {
353
363
  const filteredData = paginate ? paginatedData : sortedData;
@@ -799,8 +809,8 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
799
809
  const handleSearch = (key, value, type) => {
800
810
  setSearchQueries((prev) => (Object.assign(Object.assign({}, prev), { [key]: { text: value, type, operation: "and" } })));
801
811
  setUniqueSearch((prev) => {
802
- delete prev[key];
803
- return prev;
812
+ const _a = prev, _b = key, _removed = _a[_b], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
813
+ return rest;
804
814
  });
805
815
  };
806
816
  useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.421",
3
+ "version": "1.2.422",
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",