@megha-ui/react 1.2.322 → 1.2.323

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.
@@ -54,7 +54,7 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
54
54
  height: "max-content",
55
55
  boxSizing: "border-box", // Include padding and borders in the element's total width and height
56
56
  backgroundColor: "var(--summary-bg)",
57
- }, onClick: () => updateRowOpened(item.groupedValue), children: [(_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").flatMap(item => item.split("+")).map((columnKey, index) => {
57
+ }, onClick: () => updateRowOpened(item.groupedValue), children: [(_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").flatMap((item) => item.split("+")).map((columnKey, index) => {
58
58
  const column = gridColumns.find((column) => column.key === columnKey);
59
59
  if (column) {
60
60
  return (_jsxs("div", { style: {
@@ -69,30 +69,45 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
69
69
  flexGrow: widthMode === "auto" ? 1 : 0,
70
70
  flexShrink: widthMode === "auto" ? 1 : 0,
71
71
  padding: "0.5rem",
72
- }, className: `column index-${columnKey}`, children: [index === 0 &&
73
- _jsx("span", { style: {
74
- fontSize: "inherit",
75
- marginRight: "0.5rem",
76
- color: "var(--foreground)",
77
- background: "var(--disabled-bg)",
78
- width: "1rem",
79
- height: "1rem",
80
- flexGrow: 0,
81
- flexShrink: 0,
82
- borderRadius: 4,
83
- display: "flex",
84
- alignItems: "center",
85
- justifyContent: "center",
86
- }, children: rowOpened.includes(item.groupedValue || "")
87
- ? "-"
88
- : "+" }), _jsx("div", { children: (() => {
89
- const keys = (item.groupedKey || "").split(">").flatMap(item => item.split("+"));
90
- const vals = (item.groupedValue || "").split(">").flatMap(item => item.split("+"));
72
+ }, className: `column index-${columnKey}`, children: [index === 0 && (_jsx("span", { style: {
73
+ fontSize: "inherit",
74
+ marginRight: "0.5rem",
75
+ color: "var(--foreground)",
76
+ background: "var(--disabled-bg)",
77
+ width: "1rem",
78
+ height: "1rem",
79
+ flexGrow: 0,
80
+ flexShrink: 0,
81
+ borderRadius: 4,
82
+ display: "flex",
83
+ alignItems: "center",
84
+ justifyContent: "center",
85
+ }, children: rowOpened.includes(item.groupedValue || "")
86
+ ? "-"
87
+ : "+" })), _jsx("div", { children: (() => {
88
+ const keys = (item.groupedKey || "").split(">");
89
+ const vals = (item.groupedValue || "").split(">");
91
90
  const idx = keys.indexOf(columnKey);
92
- const display = idx > -1 ? vals[idx] : "";
93
- if (display) {
91
+ const compositeKeys = (item.groupedKey || "")
92
+ .split(">")
93
+ .filter((item) => item.includes("+"))
94
+ .flatMap((item) => item.split("+"));
95
+ const compositeValues = (item.groupedValue || "")
96
+ .split(">")
97
+ .filter((item) => item.includes("+"))
98
+ .flatMap((item) => item.split("+"));
99
+ const compositeIndex = compositeKeys.indexOf(columnKey);
100
+ const display = idx > -1
101
+ ? vals[idx]
102
+ : compositeIndex > -1
103
+ ? compositeValues[compositeIndex]
104
+ : "";
105
+ if (display &&
106
+ (idx === keys.length - 1 ||
107
+ compositeIndex === compositeKeys.length - 1)) {
94
108
  return `${display} (${item === null || item === void 0 ? void 0 : item.count})`;
95
109
  }
110
+ return display;
96
111
  })() })] }));
97
112
  }
98
113
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.322",
3
+ "version": "1.2.323",
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",