@megha-ui/react 1.2.421 → 1.2.423

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