@megha-ui/react 1.2.286 → 1.2.288

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.
@@ -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 {
@@ -44,6 +44,7 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
44
44
  })
45
45
  .map((item, gIndex) => {
46
46
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
47
+ console.log(item.groupedKey);
47
48
  if (gIndex >= startIndex && gIndex <= endIndex)
48
49
  return item.type === "main" ? (_jsxs("div", { style: {
49
50
  width: "100%",
@@ -53,7 +54,20 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
53
54
  height: "max-content",
54
55
  boxSizing: "border-box", // Include padding and borders in the element's total width and height
55
56
  backgroundColor: "var(--summary-bg)",
56
- }, children: [(_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").filter((key) => key !== item.key).map((columnKey) => {
57
+ }, children: [_jsx("span", { style: {
58
+ fontSize: "inherit",
59
+ marginRight: "0.5rem",
60
+ color: "var(--foreground)",
61
+ background: "var(--disabled-bg)",
62
+ width: "1rem",
63
+ height: "1rem",
64
+ flexGrow: 0,
65
+ flexShrink: 0,
66
+ borderRadius: 4,
67
+ display: "flex",
68
+ alignItems: "center",
69
+ justifyContent: "center",
70
+ }, children: rowOpened.includes(item.groupedValue || "") ? "-" : "+" }), (_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").filter((key) => key !== item.key).map((columnKey) => {
57
71
  const column = gridColumns.find((column) => column.key === columnKey);
58
72
  if (column) {
59
73
  return (_jsx("div", { style: {
@@ -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: _jsx("div", {}) }));
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
- }), _jsxs("div", { style: {
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}`, onClick: () => updateRowOpened(item.groupedValue), children: [_jsx("span", { style: {
91
- fontSize: "inherit",
92
- marginRight: "0.5rem",
93
- color: "var(--foreground)",
94
- background: "var(--disabled-bg)",
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}`, onClick: () => updateRowOpened(item.groupedValue), 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.286",
3
+ "version": "1.2.288",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",