@megha-ui/react 1.2.40 → 1.2.41

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.
@@ -992,22 +992,20 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
992
992
  };
993
993
  const filterDetails = (0, react_1.useMemo)(() => {
994
994
  const filterColumn = gridColumns.reduce((acc, column) => {
995
- var _a, _b;
995
+ var _a;
996
996
  const query = searchQueries[column.key];
997
997
  const uniqeValues = (0, gridHeader_1.getColumnData)(column.key, filteredData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string");
998
- console.log(uniqeValues, uniqueSearch, column.key);
999
998
  if (query &&
1000
999
  (query.text !== "" || query.type !== defaultSearchOperation)) {
1001
1000
  acc[column.key] = query.text;
1002
1001
  }
1003
- else if (uniqueSearch[column.key] &&
1004
- uniqeValues.join("") !== ((_b = uniqueSearch[column.key]) === null || _b === void 0 ? void 0 : _b.join(""))) {
1002
+ else if (uniqueSearch[column.key] && uniqeValues.every(item => uniqueSearch[column.key].includes(item))) {
1005
1003
  acc[column.key] = uniqueSearch[column.key].join(",");
1006
1004
  }
1007
1005
  return acc;
1008
1006
  }, {});
1009
1007
  const propFilterColumn = gridColumns.reduce((acc, column) => {
1010
- var _a, _b;
1008
+ var _a;
1011
1009
  if (filterData) {
1012
1010
  const { searchQueries, uniqueSearch } = filterData;
1013
1011
  const query = searchQueries[column.key];
@@ -1016,9 +1014,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
1016
1014
  (query.text !== "" || query.type !== defaultSearchOperation)) {
1017
1015
  acc[column.key] = query.text;
1018
1016
  }
1019
- else if (uniqueSearch[column.key] &&
1020
- uniqeValues.join("") !==
1021
- ((_b = uniqueSearch[column.key]) === null || _b === void 0 ? void 0 : _b.join(""))) {
1017
+ else if (uniqueSearch[column.key] && uniqeValues.every(item => uniqueSearch[column.key].includes(item))) {
1022
1018
  acc[column.key] = uniqueSearch[column.key].join(",");
1023
1019
  }
1024
1020
  }
@@ -39,7 +39,7 @@ export interface FilterData {
39
39
  globalInputSearch: string;
40
40
  searchQueries: Record<string, SearchQuery>;
41
41
  uniqueSearch: {
42
- [key: string]: string[];
42
+ [key: string]: (string | number)[];
43
43
  };
44
44
  globalSearchOp?: "or" | "and";
45
45
  searchOp?: "or" | "and";
@@ -24,7 +24,7 @@ interface GridFilterDropdownProps {
24
24
  setUniqueSearch: any;
25
25
  sortingOps: any;
26
26
  uniqueSearch: {
27
- [key: string]: string[];
27
+ [key: string]: (string | number)[];
28
28
  };
29
29
  searchInput: any;
30
30
  searchable: boolean;
@@ -29,7 +29,6 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
29
29
  if (typeof uniqueSearch[columnKey] === "undefined") {
30
30
  setUniqueSearch((prev) => (Object.assign(Object.assign({}, prev), { [columnKey]: columnData })));
31
31
  }
32
- console.log({ columnData });
33
32
  setFilterColumnData(columnData);
34
33
  }, [columnData]);
35
34
  (0, react_1.useEffect)(() => {
@@ -41,7 +41,7 @@ interface GridHeaderProps {
41
41
  }, key: string) => void;
42
42
  setUniqueSearch: any;
43
43
  uniqueSearch: {
44
- [key: string]: string[];
44
+ [key: string]: (string | number)[];
45
45
  };
46
46
  hugColumnWidths: {
47
47
  [key: string]: string;
@@ -553,7 +553,6 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
553
553
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
554
554
  if (!column.hidden) {
555
555
  const columnData = (0, exports.getColumnData)(column.key, gridData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string");
556
- console.log({ columnData });
557
556
  return ((0, jsx_runtime_1.jsx)("div", { className: `${sortable && column.sortable ? "sortable" : ""} ${column.showMenu ? "menu-true" : "menu-false"} column index-${column.key}`, style: Object.assign(Object.assign({}, cellStyle), { position: "relative", padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis", width: widthMode === "auto"
558
557
  ? "auto"
559
558
  : column.width
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.40",
3
+ "version": "1.2.41",
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.mjs",