@megha-ui/react 1.2.339 → 1.2.341
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,31 +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
|
-
console.log({ intermediate });
|
|
77
|
-
let display = "";
|
|
78
|
-
if (intermediate && idx === keys.length - 1) {
|
|
79
|
-
display = `${intermediate} (${item === null || item === void 0 ? void 0 : item.count})`;
|
|
80
|
-
}
|
|
81
|
-
else if (intermediate &&
|
|
82
|
-
compositeIndex === compositeKeys.length - 1 &&
|
|
83
|
-
index ===
|
|
84
|
-
((_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").flatMap((item) => item.split("+")).length) -
|
|
85
|
-
1) {
|
|
86
|
-
display = `${intermediate} (${item === null || item === void 0 ? void 0 : item.count})`;
|
|
87
|
-
}
|
|
88
|
-
if (compositeKeys.includes(item.key) ||
|
|
89
|
-
item.key === columnKey) {
|
|
90
|
-
display = intermediate;
|
|
91
|
-
}
|
|
92
|
-
console.log({ display });
|
|
93
66
|
if (column) {
|
|
94
|
-
return (
|
|
67
|
+
return (_jsxs("div", { style: {
|
|
95
68
|
width: widthMode === "auto"
|
|
96
69
|
? "auto"
|
|
97
70
|
: (column === null || column === void 0 ? void 0 : column.width)
|
|
@@ -102,27 +75,51 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
|
|
|
102
75
|
flex: widthMode === "auto" ? 1 : undefined,
|
|
103
76
|
flexGrow: widthMode === "auto" ? 1 : 0,
|
|
104
77
|
flexShrink: widthMode === "auto" ? 1 : 0,
|
|
78
|
+
display: "flex",
|
|
79
|
+
alignItems: "center",
|
|
105
80
|
padding: "0.5rem",
|
|
106
|
-
}, className: `column index-${columnKey}`, children:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
+
})() })] }));
|
|
126
123
|
}
|
|
127
124
|
return null;
|
|
128
125
|
}), isSummarise &&
|
package/package.json
CHANGED