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