@megha-ui/react 1.2.309 → 1.2.311

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.
@@ -56,44 +56,47 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
56
56
  height: "max-content",
57
57
  boxSizing: "border-box", // Include padding and borders in the element's total width and height
58
58
  backgroundColor: "var(--summary-bg)",
59
- }, onClick: () => updateRowOpened(item.groupedValue), children: [_jsx("span", { style: {
60
- fontSize: "inherit",
61
- marginRight: "0.5rem",
62
- color: "var(--foreground)",
63
- background: "var(--disabled-bg)",
64
- width: "1rem",
65
- height: "1rem",
66
- flexGrow: 0,
67
- flexShrink: 0,
68
- borderRadius: 4,
69
- display: "flex",
70
- alignItems: "center",
71
- justifyContent: "center",
72
- }, children: rowOpened.includes(item.groupedValue || "") ? "-" : "+" }), (_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").map((columnKey, index) => {
59
+ }, onClick: () => updateRowOpened(item.groupedValue), children: [(_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").map((columnKey, index) => {
73
60
  var _a;
74
61
  const column = gridColumns.find((column) => column.key === columnKey);
75
62
  console.log(index, item);
76
63
  const showCount = ((_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").length) - 1 === index;
77
64
  if (column) {
78
- return (_jsx("div", { style: {
65
+ return (_jsxs("div", { style: {
79
66
  width: widthMode === "auto"
80
67
  ? "auto"
81
68
  : (column === null || column === void 0 ? void 0 : column.width)
82
- ? column === null || column === void 0 ? void 0 : column.width
69
+ ? `calc(${column === null || column === void 0 ? void 0 : column.width} + 25px)`
83
70
  : columnWidths[`column-${columnKey}`]
84
- ? columnWidths[`column-${columnKey}`]
71
+ ? `calc(${columnWidths[`column-${columnKey}`]} + 25px)`
85
72
  : "fit-content",
86
73
  flex: widthMode === "auto" ? 1 : undefined,
87
74
  flexGrow: widthMode === "auto" ? 1 : 0,
88
75
  flexShrink: widthMode === "auto" ? 1 : 0,
89
76
  padding: "0.5rem",
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
- })() })) }));
77
+ }, className: `column index-${columnKey}`, children: [index === 0 &&
78
+ _jsx("span", { style: {
79
+ fontSize: "inherit",
80
+ marginRight: "0.5rem",
81
+ color: "var(--foreground)",
82
+ background: "var(--disabled-bg)",
83
+ width: "1rem",
84
+ height: "1rem",
85
+ flexGrow: 0,
86
+ flexShrink: 0,
87
+ borderRadius: 4,
88
+ display: "flex",
89
+ alignItems: "center",
90
+ justifyContent: "center",
91
+ }, children: rowOpened.includes(item.groupedValue || "")
92
+ ? "-"
93
+ : "+" }), showCount && (_jsx("div", { children: (() => {
94
+ const keys = (item.groupedKey || "").split(">");
95
+ const vals = (item.groupedValue || "").split(">");
96
+ const idx = keys.indexOf(columnKey);
97
+ const display = idx > -1 ? vals[idx] : "";
98
+ return `${display} (${item === null || item === void 0 ? void 0 : item.count})`;
99
+ })() }))] }));
97
100
  }
98
101
  return null;
99
102
  }), isSummarise &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.309",
3
+ "version": "1.2.311",
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",