@megha-ui/react 1.2.120 → 1.2.122
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.
|
@@ -10,7 +10,7 @@ const textFilterDropdown_1 = __importDefault(require("./textFilterDropdown"));
|
|
|
10
10
|
const text_input_1 = __importDefault(require("../../text-input"));
|
|
11
11
|
const checkbox_1 = __importDefault(require("../../checkbox"));
|
|
12
12
|
const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, columnKey, searchElement, activeSearchType, textFilterLabel, columnData, checkboxWrapper, onFilter, setUniqueSearch, uniqueSearch, sortingOps, searchable, searchInput, columnIndex, }) => {
|
|
13
|
-
var _a, _b, _c;
|
|
13
|
+
var _a, _b, _c, _d;
|
|
14
14
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
15
15
|
const [filterColumnData, setFilterColumnData] = (0, react_1.useState)([]);
|
|
16
16
|
const [filterSearch, setFilterSearch] = (0, react_1.useState)("");
|
|
@@ -34,10 +34,11 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
|
|
|
34
34
|
`${item}`.toLowerCase().includes(filterSearch.toLowerCase())));
|
|
35
35
|
}, [columnData, filterSearch]);
|
|
36
36
|
const handleSelect = (value, columnKey) => {
|
|
37
|
+
var _a;
|
|
37
38
|
let _uniqueSeach = {};
|
|
38
39
|
if (value === "all") {
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
if (((_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
41
|
+
uniqueSearch[columnKey].every((item) => columnData.includes(item))) {
|
|
41
42
|
_uniqueSeach = Object.assign(Object.assign({}, uniqueSearch), { [columnKey]: [] });
|
|
42
43
|
}
|
|
43
44
|
else {
|
|
@@ -72,9 +73,9 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
|
|
|
72
73
|
cursor: "pointer",
|
|
73
74
|
display: "flex",
|
|
74
75
|
alignItems: "center",
|
|
75
|
-
}, onClick: () => handleSelect("all", columnKey), children: [(0, jsx_runtime_1.jsx)(checkbox_1.default, { selected:
|
|
76
|
-
((
|
|
77
|
-
|
|
76
|
+
}, onClick: () => handleSelect("all", columnKey), children: [(0, jsx_runtime_1.jsx)(checkbox_1.default, { selected: ((_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
77
|
+
uniqueSearch[columnKey].every((item) => columnData.includes(item)), indeterminate: ((_b = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
|
78
|
+
uniqueSearch[columnKey].some((item) => columnData.includes(item)), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }), (0, jsx_runtime_1.jsx)("span", { style: { marginLeft: "0.5rem" }, children: "All" })] }), filterColumnData.map((item) => {
|
|
78
79
|
var _a;
|
|
79
80
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
80
81
|
cursor: "pointer",
|
|
@@ -84,8 +85,8 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
|
|
|
84
85
|
})] }))] })), isOpen && ((0, jsx_runtime_1.jsx)(textFilterDropdown_1.default, { combined: true, columnIndex: columnIndex, headerDropdownIndex: headerDropdownIndex || 1001, searchOptions: searchOptions, position: position
|
|
85
86
|
? {
|
|
86
87
|
top: position.top,
|
|
87
|
-
left: ((
|
|
88
|
-
? ((
|
|
88
|
+
left: ((_c = headerDropdown === null || headerDropdown === void 0 ? void 0 : headerDropdown.current) === null || _c === void 0 ? void 0 : _c.clientWidth)
|
|
89
|
+
? ((_d = headerDropdown === null || headerDropdown === void 0 ? void 0 : headerDropdown.current) === null || _d === void 0 ? void 0 : _d.clientWidth) + 2 + position.left
|
|
89
90
|
: position.left,
|
|
90
91
|
}
|
|
91
92
|
: { top: 0, left: 0 }, columnKey: columnKey, searchElement: searchElement, activeSearchType: activeSearchType, searchable: searchable }))] }));
|
package/package.json
CHANGED