@megha-ui/react 1.3.84 → 1.3.87
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.
- package/dist/components/grid/utils/gridFilterDropdown.d.ts +1 -24
- package/dist/components/grid/utils/gridFilterDropdown.js +3 -91
- package/dist/components/grid/utils/newGridHeader.js +453 -373
- package/dist/components/grid/utils/textFilterDropdown.d.ts +1 -17
- package/dist/components/grid/utils/textFilterDropdown.js +3 -30
- package/package.json +1 -1
|
@@ -1,24 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
interface DropdownOption {
|
|
3
|
-
label: string;
|
|
4
|
-
value: string;
|
|
5
|
-
action: (columnKey: string, optionValue: string) => void;
|
|
6
|
-
}
|
|
7
|
-
interface MenuPosition {
|
|
8
|
-
top: number;
|
|
9
|
-
left: number;
|
|
10
|
-
}
|
|
11
2
|
interface GridFilterDropdownProps {
|
|
12
|
-
searchOptions: DropdownOption[];
|
|
13
|
-
position: MenuPosition;
|
|
14
|
-
combined: boolean;
|
|
15
|
-
columnKey: string;
|
|
16
|
-
activeSearchType: string;
|
|
17
|
-
searchElement: any;
|
|
18
3
|
headerDropdownIndex?: number;
|
|
19
4
|
sortingOps?: any;
|
|
20
|
-
|
|
21
|
-
searchInput?: any;
|
|
5
|
+
searchOps?: any | null;
|
|
22
6
|
columnIndex: number;
|
|
23
7
|
}
|
|
24
8
|
declare const TextFilterDropdown: React.FC<GridFilterDropdownProps>;
|
|
@@ -1,32 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const TextFilterDropdown = ({ headerDropdownIndex, searchOptions, combined, position, columnKey, searchElement, activeSearchType, sortingOps, searchable, searchInput, columnIndex, }) => {
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
var _a;
|
|
7
|
-
if (searchElement) {
|
|
8
|
-
const _searchElement = document.getElementById("search-input");
|
|
9
|
-
if (_searchElement) {
|
|
10
|
-
const ele = _searchElement.getElementsByTagName("input");
|
|
11
|
-
(_a = ele.item(0)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}, []);
|
|
15
|
-
const handleDropdownChange = (selected, columnKey) => {
|
|
16
|
-
const clickedOption = searchOptions.find((item) => selected === item.value);
|
|
17
|
-
clickedOption === null || clickedOption === void 0 ? void 0 : clickedOption.action(columnKey, selected);
|
|
18
|
-
};
|
|
19
|
-
return (_jsxs("div", { style: Object.assign(Object.assign({ position: "absolute", top: combined ? 0 : "calc(100% + 5px)" }, (combined
|
|
20
|
-
? {
|
|
21
|
-
left: "100%",
|
|
22
|
-
}
|
|
23
|
-
: columnIndex > 1
|
|
24
|
-
? { right: 0 }
|
|
25
|
-
: { left: 0 })), { zIndex: headerDropdownIndex ? headerDropdownIndex : 1000, backgroundColor: "var(--background)", color: "var(--foreground)", 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, _jsx("div", { style: {
|
|
26
|
-
padding: "0.5rem 0.75rem",
|
|
27
|
-
}, children: _jsx(Dropdown, { 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()) && (_jsx("div", { style: {
|
|
28
|
-
padding: "0.5rem 0.75rem",
|
|
29
|
-
cursor: "pointer",
|
|
30
|
-
}, children: searchElement }))] }));
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const TextFilterDropdown = ({ headerDropdownIndex, sortingOps, searchOps, columnIndex, }) => {
|
|
3
|
+
return (_jsxs("div", { style: Object.assign(Object.assign({ position: "absolute", top: "calc(100% + 5px)" }, (columnIndex > 1 ? { right: 0 } : { left: 0 })), { zIndex: headerDropdownIndex ? headerDropdownIndex : 1000, backgroundColor: "var(--background)", color: "var(--foreground)", 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: [sortingOps && sortingOps, searchOps && searchOps] }));
|
|
31
4
|
};
|
|
32
5
|
export default TextFilterDropdown;
|
package/package.json
CHANGED