@megha-ui/react 1.2.322 → 1.2.324
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.
|
@@ -54,7 +54,7 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
|
|
|
54
54
|
height: "max-content",
|
|
55
55
|
boxSizing: "border-box", // Include padding and borders in the element's total width and height
|
|
56
56
|
backgroundColor: "var(--summary-bg)",
|
|
57
|
-
}, onClick: () => updateRowOpened(item.groupedValue), children: [(_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").flatMap(item => item.split("+")).map((columnKey, index) => {
|
|
57
|
+
}, onClick: () => updateRowOpened(item.groupedValue), children: [(_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").flatMap((item) => item.split("+")).map((columnKey, index) => {
|
|
58
58
|
const column = gridColumns.find((column) => column.key === columnKey);
|
|
59
59
|
if (column) {
|
|
60
60
|
return (_jsxs("div", { style: {
|
|
@@ -69,30 +69,47 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
|
|
|
69
69
|
flexGrow: widthMode === "auto" ? 1 : 0,
|
|
70
70
|
flexShrink: widthMode === "auto" ? 1 : 0,
|
|
71
71
|
padding: "0.5rem",
|
|
72
|
-
}, className: `column index-${columnKey}`, children: [index === 0 &&
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
const vals = (item.groupedValue || "").split(">").flatMap(item => item.split("+"));
|
|
72
|
+
}, className: `column index-${columnKey}`, children: [index === 0 && (_jsx("span", { style: {
|
|
73
|
+
fontSize: "inherit",
|
|
74
|
+
marginRight: "0.5rem",
|
|
75
|
+
color: "var(--foreground)",
|
|
76
|
+
background: "var(--disabled-bg)",
|
|
77
|
+
width: "1rem",
|
|
78
|
+
height: "1rem",
|
|
79
|
+
flexGrow: 0,
|
|
80
|
+
flexShrink: 0,
|
|
81
|
+
borderRadius: 4,
|
|
82
|
+
display: "flex",
|
|
83
|
+
alignItems: "center",
|
|
84
|
+
justifyContent: "center",
|
|
85
|
+
}, children: rowOpened.includes(item.groupedValue || "")
|
|
86
|
+
? "-"
|
|
87
|
+
: "+" })), _jsx("div", { children: (() => {
|
|
88
|
+
const keys = (item.groupedKey || "").split(">");
|
|
89
|
+
const vals = (item.groupedValue || "").split(">");
|
|
91
90
|
const idx = keys.indexOf(columnKey);
|
|
92
|
-
const
|
|
93
|
-
|
|
91
|
+
const compositeKeys = (item.groupedKey || "")
|
|
92
|
+
.split(">")
|
|
93
|
+
.filter((item) => item.includes("+"))
|
|
94
|
+
.flatMap((item) => item.split("+"));
|
|
95
|
+
const compositeValues = (item.groupedValue || "")
|
|
96
|
+
.split(">")
|
|
97
|
+
.filter((item) => item.includes("+"))
|
|
98
|
+
.flatMap((item) => item.split("+"));
|
|
99
|
+
const compositeIndex = compositeKeys.indexOf(columnKey);
|
|
100
|
+
const display = idx > -1
|
|
101
|
+
? vals[idx]
|
|
102
|
+
: compositeIndex > -1
|
|
103
|
+
? compositeValues[compositeIndex]
|
|
104
|
+
: "";
|
|
105
|
+
if (display &&
|
|
106
|
+
(idx === keys.length - 1 ||
|
|
107
|
+
compositeIndex === compositeKeys.length - 1)) {
|
|
94
108
|
return `${display} (${item === null || item === void 0 ? void 0 : item.count})`;
|
|
95
109
|
}
|
|
110
|
+
if (compositeIndex > -1 || item.key === columnKey) {
|
|
111
|
+
return display;
|
|
112
|
+
}
|
|
96
113
|
})() })] }));
|
|
97
114
|
}
|
|
98
115
|
return null;
|
package/package.json
CHANGED