@megha-ui/react 1.2.155 → 1.2.156

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.
@@ -347,6 +347,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
347
347
  : "";
348
348
  return value.toLowerCase().includes(query.toLowerCase());
349
349
  }));
350
+ setUniqueSearch({});
350
351
  return _filteredData;
351
352
  }, [
352
353
  data,
@@ -750,9 +751,9 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
750
751
  setPrevRenderedData(filteredData);
751
752
  }
752
753
  }, [filteredData, gridGroupBy, gridColumns]);
753
- const handleSearch = (0, react_1.useCallback)((key, value, type) => {
754
+ const handleSearch = (key, value, type) => {
754
755
  setSearchQueries((prev) => (Object.assign(Object.assign({}, prev), { [key]: { text: value, type, operation: "and" } })));
755
- }, []);
756
+ };
756
757
  (0, react_1.useEffect)(() => {
757
758
  const handleKeydown = (event) => {
758
759
  const keyButton = ["ArrowRight", "ArrowUp", "ArrowDown", "ArrowLeft"];
@@ -96,23 +96,10 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
96
96
  };
97
97
  (0, react_1.useEffect)(() => {
98
98
  const closeMenu = (e) => {
99
- var _a;
100
99
  const target = e.target;
101
100
  if (target.closest(".filter-icon")) {
102
101
  return;
103
102
  }
104
- if (dropdownVisible) {
105
- const column = columns.find(item => item.key === dropdownVisible);
106
- if (column) {
107
- console.log(column, uniqueSearch[column.key]);
108
- if (((_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[column.key]) === null || _a === void 0 ? void 0 : _a.length) > 0 && uniqueSearch[column.key].every(item => { var _a; return (0, exports.getColumnData)(column.key, gridData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string"); })) {
109
- setUniqueSearch((prev) => {
110
- delete prev[column.key];
111
- return prev;
112
- });
113
- }
114
- }
115
- }
116
103
  setMenuVisible("");
117
104
  setDropdownVisible("");
118
105
  setMenuPosition(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.155",
3
+ "version": "1.2.156",
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",