@megha-ui/react 1.2.653 → 1.2.655

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.
@@ -6,7 +6,7 @@ import TextInput from "../../text-input";
6
6
  import Checkbox from "../../checkbox";
7
7
  import { formatValue } from "../../../services/commonService";
8
8
  const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, columnKey, searchElement, activeSearchType, textFilterLabel, columnData, checkboxWrapper, onFilter, setUniqueSearch, uniqueSearch, sortingOps, searchable, searchInput, columnIndex, columnType, locale, formatOptions, }) => {
9
- var _a, _b, _c, _d;
9
+ var _a, _b, _c, _d, _e;
10
10
  const [isOpen, setIsOpen] = useState(false);
11
11
  const [filterColumnData, setFilterColumnData] = useState([]);
12
12
  const [filterSearch, setFilterSearch] = useState("");
@@ -46,7 +46,7 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
46
46
  ? uniqueSearch[columnKey].filter((item) => item !== value)
47
47
  : uniqueSearch[columnKey]
48
48
  ? [...uniqueSearch[columnKey], value]
49
- : [value];
49
+ : columnData.filter(item => item !== value);
50
50
  _uniqueSeach = Object.assign(Object.assign({}, uniqueSearch), { [columnKey]: newValueArray });
51
51
  setUniqueSearch(_uniqueSeach);
52
52
  }
@@ -67,23 +67,23 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
67
67
  cursor: "pointer",
68
68
  display: "flex",
69
69
  alignItems: "center",
70
- }, onClick: () => handleSelect("all", columnKey), children: [_jsx(Checkbox, { selected: ((_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _a === void 0 ? void 0 : _a.length) > 0
70
+ }, onClick: () => handleSelect("all", columnKey), children: [_jsx(Checkbox, { selected: ((_b = ((_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.length) > 0
71
71
  ? uniqueSearch[columnKey].every((item) => columnData.includes(item))
72
- : true, indeterminate: ((_b = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
72
+ : true, indeterminate: ((_c = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _c === void 0 ? void 0 : _c.length) > 0 &&
73
73
  uniqueSearch[columnKey].some((item) => columnData.includes(item)), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: { marginLeft: "0.5rem" }, children: "All" })] }), filterColumnData.map((item) => {
74
- var _a;
74
+ var _a, _b;
75
75
  return (_jsxs("div", { style: {
76
76
  cursor: "pointer",
77
77
  display: "flex",
78
78
  alignItems: "center",
79
- }, onClick: () => handleSelect(item, columnKey), children: [_jsx(Checkbox, { selected: (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey].length) > 0
80
- ? (_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _a === void 0 ? void 0 : _a.includes(item)
79
+ }, onClick: () => handleSelect(item, columnKey), children: [_jsx(Checkbox, { selected: ((_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) !== null && _a !== void 0 ? _a : []).length > 0
80
+ ? (_b = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _b === void 0 ? void 0 : _b.includes(item)
81
81
  : true, onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: { marginLeft: "0.5rem" }, children: formatValue(item, columnType, locale, formatOptions) })] }, item));
82
82
  })] }))] })), isOpen && (_jsx(TextFilterDropdown, { combined: true, columnIndex: columnIndex, headerDropdownIndex: headerDropdownIndex || 1001, searchOptions: searchOptions, position: position
83
83
  ? {
84
84
  top: position.top,
85
- left: ((_c = headerDropdown === null || headerDropdown === void 0 ? void 0 : headerDropdown.current) === null || _c === void 0 ? void 0 : _c.clientWidth)
86
- ? ((_d = headerDropdown === null || headerDropdown === void 0 ? void 0 : headerDropdown.current) === null || _d === void 0 ? void 0 : _d.clientWidth) + 2 + position.left
85
+ left: ((_d = headerDropdown === null || headerDropdown === void 0 ? void 0 : headerDropdown.current) === null || _d === void 0 ? void 0 : _d.clientWidth)
86
+ ? ((_e = headerDropdown === null || headerDropdown === void 0 ? void 0 : headerDropdown.current) === null || _e === void 0 ? void 0 : _e.clientWidth) + 2 + position.left
87
87
  : position.left,
88
88
  }
89
89
  : { top: 0, left: 0 }, columnKey: columnKey, searchElement: searchElement, activeSearchType: activeSearchType, searchable: searchable }))] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.653",
3
+ "version": "1.2.655",
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",