@megha-ui/react 1.2.305 → 1.2.307
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.
|
@@ -578,7 +578,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
578
578
|
const lastKey = allKeys[allKeys.length - 1];
|
|
579
579
|
data.forEach((item) => {
|
|
580
580
|
const values = allKeys.map((k) => { var _a, _b; return (_b = (_a = item[k]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""; });
|
|
581
|
-
const compositeValue = values.join("
|
|
581
|
+
const compositeValue = values.join(">");
|
|
582
582
|
const key = compositeValue;
|
|
583
583
|
if (!groupsMap.has(key)) {
|
|
584
584
|
groupsMap.set(key, {
|
|
@@ -622,7 +622,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
622
622
|
let allKeysForLevel = undefined;
|
|
623
623
|
if (levelKeys.length > 1) {
|
|
624
624
|
const values = levelKeys.map((k) => { var _a, _b; return (_b = (_a = item[k]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""; });
|
|
625
|
-
groupValue = values.join("
|
|
625
|
+
groupValue = values.join(">");
|
|
626
626
|
allKeysForLevel = levelKeys;
|
|
627
627
|
}
|
|
628
628
|
else {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, 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";
|
|
@@ -72,10 +72,8 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
|
|
|
72
72
|
}, children: rowOpened.includes(item.groupedValue || "") ? "-" : "+" }), (_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").map((columnKey, index) => {
|
|
73
73
|
var _a;
|
|
74
74
|
const column = gridColumns.find((column) => column.key === columnKey);
|
|
75
|
-
console.log(index,
|
|
76
|
-
const showCount = ((_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").
|
|
77
|
-
1 ===
|
|
78
|
-
index;
|
|
75
|
+
console.log(index, item);
|
|
76
|
+
const showCount = ((_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").length) - 1 === index;
|
|
79
77
|
if (column) {
|
|
80
78
|
return (_jsx("div", { style: {
|
|
81
79
|
width: widthMode === "auto"
|
|
@@ -89,13 +87,13 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
|
|
|
89
87
|
flexGrow: widthMode === "auto" ? 1 : 0,
|
|
90
88
|
flexShrink: widthMode === "auto" ? 1 : 0,
|
|
91
89
|
padding: "0.5rem",
|
|
92
|
-
}, className: `column index-${columnKey}`, children: showCount && (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
}, className: `column index-${columnKey}`, children: showCount && (_jsx("div", { children: (() => {
|
|
91
|
+
const keys = (item.groupedKey || "").split(">");
|
|
92
|
+
const vals = (item.groupedValue || "").split(">");
|
|
93
|
+
const idx = keys.indexOf(columnKey);
|
|
94
|
+
const display = idx > -1 ? vals[idx] : "";
|
|
95
|
+
return `${display} (${item === null || item === void 0 ? void 0 : item.count})`;
|
|
96
|
+
})() })) }));
|
|
99
97
|
}
|
|
100
98
|
return null;
|
|
101
99
|
}), isSummarise &&
|
package/package.json
CHANGED