@megha-ui/react 1.2.287 → 1.2.289
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.
|
@@ -705,7 +705,6 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
705
705
|
const groupedArray = sets.length
|
|
706
706
|
? groupByMultipleKeys(sortedData, sets)
|
|
707
707
|
: [];
|
|
708
|
-
console.log({ groupedArray });
|
|
709
708
|
const flatGroupedArray = flattenGroupedData(groupedArray, 1);
|
|
710
709
|
setGroupedData(flatGroupedArray);
|
|
711
710
|
const grouped = flatGroupedArray
|
|
@@ -53,8 +53,22 @@ 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
|
-
},
|
|
56
|
+
}, onClick: () => updateRowOpened(item.groupedValue), children: [_jsx("span", { style: {
|
|
57
|
+
fontSize: "inherit",
|
|
58
|
+
marginRight: "0.5rem",
|
|
59
|
+
color: "var(--foreground)",
|
|
60
|
+
background: "var(--disabled-bg)",
|
|
61
|
+
width: "1rem",
|
|
62
|
+
height: "1rem",
|
|
63
|
+
flexGrow: 0,
|
|
64
|
+
flexShrink: 0,
|
|
65
|
+
borderRadius: 4,
|
|
66
|
+
display: "flex",
|
|
67
|
+
alignItems: "center",
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
}, children: rowOpened.includes(item.groupedValue || "") ? "-" : "+" }), (_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").filter((key) => key !== item.key).map((columnKey) => {
|
|
57
70
|
const column = gridColumns.find((column) => column.key === columnKey);
|
|
71
|
+
console.log(columnKey);
|
|
58
72
|
if (column) {
|
|
59
73
|
return (_jsx("div", { style: {
|
|
60
74
|
width: widthMode === "auto"
|
|
@@ -68,10 +82,16 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
|
|
|
68
82
|
flexGrow: widthMode === "auto" ? 1 : 0,
|
|
69
83
|
flexShrink: widthMode === "auto" ? 1 : 0,
|
|
70
84
|
padding: "0.5rem",
|
|
71
|
-
}, className: `column index-${columnKey}`, children:
|
|
85
|
+
}, className: `column index-${columnKey}`, children: (() => {
|
|
86
|
+
const keys = (item.groupedKey || "").split(">");
|
|
87
|
+
const vals = (item.groupedValue || "").split(">");
|
|
88
|
+
const idx = keys.indexOf(columnKey);
|
|
89
|
+
const display = idx > -1 ? vals[idx] : "";
|
|
90
|
+
return _jsx("div", { children: display });
|
|
91
|
+
})() }));
|
|
72
92
|
}
|
|
73
93
|
return null;
|
|
74
|
-
}),
|
|
94
|
+
}), _jsx("div", { style: {
|
|
75
95
|
display: "flex",
|
|
76
96
|
alignItems: "center",
|
|
77
97
|
fontSize: "inherit",
|
|
@@ -87,24 +107,11 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
|
|
|
87
107
|
flexGrow: 0,
|
|
88
108
|
cursor: "pointer",
|
|
89
109
|
padding: "0.5rem",
|
|
90
|
-
}, className: `group-column ${item.key}`,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
width: "1rem",
|
|
96
|
-
height: "1rem",
|
|
97
|
-
flexGrow: 0,
|
|
98
|
-
flexShrink: 0,
|
|
99
|
-
borderRadius: 4,
|
|
100
|
-
display: "flex",
|
|
101
|
-
alignItems: "center",
|
|
102
|
-
justifyContent: "center",
|
|
103
|
-
}, children: rowOpened.includes(item.groupedValue || "") ? "-" : "+" }), _jsxs("div", { style: {
|
|
104
|
-
display: "flex",
|
|
105
|
-
alignItems: "center",
|
|
106
|
-
flexWrap: "wrap",
|
|
107
|
-
}, children: [_jsx("span", { style: { marginRight: "0.5rem" }, children: item.html ? _jsx(_Fragment, { children: item.html }) : item.value }), _jsx("span", { children: `(${item === null || item === void 0 ? void 0 : item.count})` })] })] }), isSummarise &&
|
|
110
|
+
}, className: `group-column ${item.key}`, children: _jsxs("div", { style: {
|
|
111
|
+
display: "flex",
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
flexWrap: "wrap",
|
|
114
|
+
}, children: [_jsx("span", { style: { marginRight: "0.5rem" }, children: item.html ? _jsx(_Fragment, { children: item.html }) : item.value }), _jsx("span", { children: `(${item === null || item === void 0 ? void 0 : item.count})` })] }) }), isSummarise &&
|
|
108
115
|
parseInt(((_d = item === null || item === void 0 ? void 0 : item.count) === null || _d === void 0 ? void 0 : _d.toString()) || "0") > 0 && (_jsx(SummariseDetails, { rowIndex: gIndex, removedKeys: item.groupedKey.split(">"), columns: gridColumns, groupBy: gridGroupBy, sortable: sortable, cellStyle: cellStyle, columnWidths: columnWidths, widthMode: widthMode, summariseKeys: summariseKeys, summariseDetails: summariseDetails, activeCalculateColor: activeCalculateColor, gridRef: gridRef, setCalculatePosition: setCalculatePosition, calculatePosition: calculatePosition, calculatetextColor: calculatetextColor, setCalculateVisible: setCalculateVisible, calculateVisible: calculateVisible, summariseDisplay: summariseDisplay, recalculate: recalculate, groupedData: item.groupedValue, actionsKey: actionsKey }))] }, String((_e = item.groupedValue) !== null && _e !== void 0 ? _e : gIndex))) : (_jsx(GroupedRow, { item: item.rowData, index: gIndex, rowStyle: Object.assign(Object.assign({}, rowStyle), (selectedRow === gIndex ? selectedRowStyle : {})), cellStyle: cellStyle, rowHeight: rowHeight, alternateRowColor: alternateRowColor, bulkSelect: bulkSelect, columns: gridColumns, widthMode: widthMode, rowKey: rowKey, onRowClick: onRowClick, loading: isLoading, groupBy: gridGroupBy, selectedRows: selectedRows, toggleRowSelection: toggleRowSelection, hasVerticalScroll: hasVerticalScroll, hugColumnWidths: columnWidths }, String(((_g = (_f = item.rowData) === null || _f === void 0 ? void 0 : _f.id) === null || _g === void 0 ? void 0 : _g.value)
|
|
109
116
|
? `${item.groupedValue}-${(_j = (_h = item.rowData) === null || _h === void 0 ? void 0 : _h.id) === null || _j === void 0 ? void 0 : _j.value}`
|
|
110
117
|
: gIndex)));
|
package/package.json
CHANGED