@megha-ui/react 1.2.113 → 1.2.114
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.
|
@@ -36,12 +36,13 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
|
|
|
36
36
|
const handleSelect = (value, columnKey) => {
|
|
37
37
|
let _uniqueSeach = {};
|
|
38
38
|
if (value === "all") {
|
|
39
|
-
if (uniqueSearch[columnKey].
|
|
39
|
+
if (uniqueSearch[columnKey].every(item => columnData.includes(item))) {
|
|
40
40
|
_uniqueSeach = Object.assign(Object.assign({}, uniqueSearch), { [columnKey]: [] });
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
43
|
_uniqueSeach = Object.assign(Object.assign({}, uniqueSearch), { [columnKey]: columnData });
|
|
44
44
|
}
|
|
45
|
+
console.log(_uniqueSeach, columnKey);
|
|
45
46
|
setUniqueSearch(_uniqueSeach);
|
|
46
47
|
}
|
|
47
48
|
else {
|
|
@@ -55,7 +56,7 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
|
|
|
55
56
|
}
|
|
56
57
|
onFilter(_uniqueSeach, columnKey);
|
|
57
58
|
};
|
|
58
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: Object.assign(Object.assign({ position: "absolute", top: "calc(100% + 5px)" }, (columnIndex > 1 ? { right: 0 } : { left: 0 })), { zIndex: headerDropdownIndex ? headerDropdownIndex : 1000, backgroundColor: "white", boxShadow: "0px 0.5rem 1rem 0px rgba(0,0,0,0.2)", listStyleType: "none", padding: "0.35rem 0", width: "max-content", maxWidth: "500px", borderRadius: "0.5rem", margin: 0 }), ref: headerDropdown, onClick: (e) => e.stopPropagation(), children: [searchInput && searchInput,
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: Object.assign(Object.assign({ position: "absolute", top: "calc(100% + 5px)" }, (columnIndex > 1 ? { right: 0 } : { left: 0 })), { zIndex: headerDropdownIndex ? headerDropdownIndex : 1000, backgroundColor: "white", boxShadow: "0px 0.5rem 1rem 0px rgba(0,0,0,0.2)", listStyleType: "none", padding: "0.35rem 0", width: "max-content", maxWidth: "500px", borderRadius: "0.5rem", margin: 0 }), ref: headerDropdown, onClick: (e) => e.stopPropagation(), children: [searchInput && searchInput, (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
59
60
|
padding: "0.5rem 0.75rem",
|
|
60
61
|
cursor: "pointer",
|
|
61
62
|
display: "flex",
|
|
@@ -29,9 +29,9 @@ const TextFilterDropdown = ({ headerDropdownIndex, searchOptions, combined, posi
|
|
|
29
29
|
? { right: 0 }
|
|
30
30
|
: { left: 0 })), { zIndex: headerDropdownIndex ? headerDropdownIndex : 1000, backgroundColor: "white", boxShadow: "0px 0.5rem 1rem 0px rgba(0,0,0,0.2)", listStyleType: "none", padding: "0.25rem 0", width: 230, borderRadius: "0.5rem", margin: 0 }), id: "grid-dropdown", onClick: (e) => e.stopPropagation(), children: [searchInput && searchInput, sortingOps && sortingOps, (0, jsx_runtime_1.jsx)("div", { style: {
|
|
31
31
|
padding: "0.5rem 0.75rem",
|
|
32
|
-
}, children: (0, jsx_runtime_1.jsx)(dropdown_1.default, { options: searchOptions, selectedValues: [activeSearchType], onChange: (selected) => { var _a; return handleDropdownChange((_a = selected[0].toString()) !== null && _a !== void 0 ? _a : "", columnKey); }, searchEnabled: false, maxDropdownHeight: 350 }) }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
32
|
+
}, children: (0, jsx_runtime_1.jsx)(dropdown_1.default, { options: searchOptions, selectedValues: [activeSearchType], onChange: (selected) => { var _a; return handleDropdownChange((_a = selected[0].toString()) !== null && _a !== void 0 ? _a : "", columnKey); }, searchEnabled: false, maxDropdownHeight: 350 }) }), !["blank", "notBlank"].includes(activeSearchType.toLowerCase()) && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
33
33
|
padding: "0.5rem 0.75rem",
|
|
34
34
|
cursor: "pointer",
|
|
35
|
-
}, children: searchElement })] }));
|
|
35
|
+
}, children: searchElement }))] }));
|
|
36
36
|
};
|
|
37
37
|
exports.default = TextFilterDropdown;
|
package/package.json
CHANGED