@megha-ui/react 1.2.655 → 1.2.656
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;
|
|
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
|
-
: columnData.filter(item => item !== 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,25 @@ 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:
|
|
71
|
-
? uniqueSearch[columnKey]
|
|
72
|
-
|
|
70
|
+
}, onClick: () => handleSelect("all", columnKey), children: [_jsx(Checkbox, { selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) !== "undefined"
|
|
71
|
+
? ((_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
72
|
+
uniqueSearch[columnKey].every((item) => columnData.includes(item))
|
|
73
|
+
: true, indeterminate: ((_b = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
|
73
74
|
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
|
|
75
|
+
var _a;
|
|
75
76
|
return (_jsxs("div", { style: {
|
|
76
77
|
cursor: "pointer",
|
|
77
78
|
display: "flex",
|
|
78
79
|
alignItems: "center",
|
|
79
|
-
}, onClick: () => handleSelect(item, columnKey), children: [_jsx(Checkbox, { selected: (
|
|
80
|
-
? (
|
|
80
|
+
}, onClick: () => handleSelect(item, columnKey), children: [_jsx(Checkbox, { selected: typeof (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) !== "undefined"
|
|
81
|
+
? (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey].length) > 0 &&
|
|
82
|
+
((_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _a === void 0 ? void 0 : _a.includes(item))
|
|
81
83
|
: true, onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }), _jsx("span", { style: { marginLeft: "0.5rem" }, children: formatValue(item, columnType, locale, formatOptions) })] }, item));
|
|
82
84
|
})] }))] })), isOpen && (_jsx(TextFilterDropdown, { combined: true, columnIndex: columnIndex, headerDropdownIndex: headerDropdownIndex || 1001, searchOptions: searchOptions, position: position
|
|
83
85
|
? {
|
|
84
86
|
top: position.top,
|
|
85
|
-
left: ((
|
|
86
|
-
? ((
|
|
87
|
+
left: ((_c = headerDropdown === null || headerDropdown === void 0 ? void 0 : headerDropdown.current) === null || _c === void 0 ? void 0 : _c.clientWidth)
|
|
88
|
+
? ((_d = headerDropdown === null || headerDropdown === void 0 ? void 0 : headerDropdown.current) === null || _d === void 0 ? void 0 : _d.clientWidth) + 2 + position.left
|
|
87
89
|
: position.left,
|
|
88
90
|
}
|
|
89
91
|
: { top: 0, left: 0 }, columnKey: columnKey, searchElement: searchElement, activeSearchType: activeSearchType, searchable: searchable }))] }));
|
package/package.json
CHANGED