@megha-ui/react 1.3.84 → 1.3.88
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/newGroupedGridDetails.js +2 -32
- 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,38 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { memo
|
|
2
|
+
import React, { memo } from "react";
|
|
3
3
|
import NewSummariseDetails from "./newSummariseDetails";
|
|
4
4
|
import NewGroupedRow from "./newGroupedRow";
|
|
5
|
-
const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRowColor, updateRowOpened, columnWidths,
|
|
6
|
-
const groupedDiv = useRef(null);
|
|
7
|
-
const [renderedKeys, setRenderedKeys] = useState([]);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
var _a;
|
|
10
|
-
const groupedColumns = (_a = groupedDiv.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".group-column");
|
|
11
|
-
const _renderedKeys = [];
|
|
12
|
-
let newColumnWidths = columnWidths;
|
|
13
|
-
let newColumnHeights = columnHeights;
|
|
14
|
-
groupedColumns === null || groupedColumns === void 0 ? void 0 : groupedColumns.forEach((column) => {
|
|
15
|
-
var _a;
|
|
16
|
-
const key = (_a = column.className.split(" ")) === null || _a === void 0 ? void 0 : _a[1];
|
|
17
|
-
_renderedKeys.push(key);
|
|
18
|
-
newColumnWidths = Object.assign(Object.assign({}, newColumnWidths), { [key]: `${column.clientWidth}px` });
|
|
19
|
-
newColumnHeights = Object.assign(Object.assign({}, newColumnHeights), { [key]: `${column.clientHeight}px` });
|
|
20
|
-
});
|
|
21
|
-
if (renderedKeys.sort().toString() !== _renderedKeys.sort().toString()) {
|
|
22
|
-
setColumnWidths((prev) => (Object.assign(Object.assign({}, prev), newColumnWidths)));
|
|
23
|
-
setColumnHeights((prev) => (Object.assign(Object.assign({}, prev), newColumnHeights)));
|
|
24
|
-
setRenderedKeys(_renderedKeys);
|
|
25
|
-
}
|
|
26
|
-
}, [
|
|
27
|
-
groupedData.filter((item) => {
|
|
28
|
-
return item.type === "main" && item.level === 1
|
|
29
|
-
? true
|
|
30
|
-
: rowOpened.includes(item.groupedValue
|
|
31
|
-
.split(">")
|
|
32
|
-
.filter((value, index) => index !== item.groupedValue.split(">").length - 1)
|
|
33
|
-
.join(">"));
|
|
34
|
-
}),
|
|
35
|
-
]);
|
|
5
|
+
const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRowColor, updateRowOpened, columnWidths, groupBy, widthMode, rowKey, rowHeight, headerBackground, isSummarise, gridGroupBy, rowStyle, sortable, cellStyle, summariseKeys, summariseDetails, activeCalculateColor, gridRef, setCalculatePosition, calculatePosition, calculatetextColor, setCalculateVisible, calculateVisible, summariseDisplay, recalculate, selectedRowStyle, isLoading, selectedRow, onRowClick, gridColumns, bulkSelect, selectedRows, toggleRowSelection, hasVerticalScroll, setColumnWidths, actionsKey, ignoreClickKeys, locale, formatOptions, }) => {
|
|
36
6
|
return (_jsx(_Fragment, { children: groupedData
|
|
37
7
|
.filter((item) => {
|
|
38
8
|
return item.type === "main" && item.level === 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