@megha-ui/react 1.2.298 → 1.2.300
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.
|
@@ -706,7 +706,6 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
706
706
|
? groupByMultipleKeys(sortedData, sets)
|
|
707
707
|
: [];
|
|
708
708
|
const flatGroupedArray = flattenGroupedData(groupedArray, 1);
|
|
709
|
-
console.log(flatGroupedArray);
|
|
710
709
|
setGroupedData(flatGroupedArray);
|
|
711
710
|
const grouped = flatGroupedArray
|
|
712
711
|
.filter((item) => item.type === "main")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useEffect, useRef, useState } from "react";
|
|
3
3
|
import GroupedRow from "./groupedRow";
|
|
4
4
|
import SummariseDetails from "./SummariseDetails";
|
|
@@ -67,14 +67,14 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
|
|
|
67
67
|
display: "flex",
|
|
68
68
|
alignItems: "center",
|
|
69
69
|
justifyContent: "center",
|
|
70
|
-
}, children: rowOpened.includes(item.groupedValue || "") ? "-" : "+" }), (_b = item.groupedKey) === null || _b === void 0 ? void 0 : _b.split(">").filter((key) => key !== item.key).
|
|
70
|
+
}, children: rowOpened.includes(item.groupedValue || "") ? "-" : "+" }), (_b = item.groupedKey) === null || _b === void 0 ? void 0 : _b.split(">").filter((key) => key !== item.key).map((columnKey, index) => {
|
|
71
71
|
var _a;
|
|
72
72
|
const column = gridColumns.find((column) => column.key === columnKey);
|
|
73
73
|
const showCount = ((_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").filter((key) => key !== item.key).length) -
|
|
74
74
|
1 ===
|
|
75
75
|
index;
|
|
76
76
|
if (column) {
|
|
77
|
-
return (
|
|
77
|
+
return (_jsx("div", { style: {
|
|
78
78
|
width: widthMode === "auto"
|
|
79
79
|
? "auto"
|
|
80
80
|
: (column === null || column === void 0 ? void 0 : column.width)
|
|
@@ -86,13 +86,13 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
|
|
|
86
86
|
flexGrow: widthMode === "auto" ? 1 : 0,
|
|
87
87
|
flexShrink: widthMode === "auto" ? 1 : 0,
|
|
88
88
|
padding: "0.5rem",
|
|
89
|
-
}, className: `column index-${columnKey}`, children: [(() => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
}, className: `column index-${columnKey}`, children: showCount && _jsxs(_Fragment, { children: [(() => {
|
|
90
|
+
const keys = (item.groupedKey || "").split(">");
|
|
91
|
+
const vals = (item.groupedValue || "").split(">");
|
|
92
|
+
const idx = keys.indexOf(columnKey);
|
|
93
|
+
const display = idx > -1 ? vals[idx] : "";
|
|
94
|
+
return _jsx("div", { children: display });
|
|
95
|
+
})(), _jsx("span", { children: `(${item === null || item === void 0 ? void 0 : item.count})` })] }) }));
|
|
96
96
|
}
|
|
97
97
|
return null;
|
|
98
98
|
}), isSummarise &&
|
package/package.json
CHANGED