@megha-ui/react 1.2.299 → 1.2.301

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.
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, 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";
@@ -43,8 +43,10 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
43
43
  .join(">"));
44
44
  })
45
45
  .map((item, gIndex) => {
46
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
47
- console.log((_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").filter((key) => key !== item.key));
46
+ var _a, _b, _c, _d, _e, _f, _g, _h;
47
+ if (item.type === "main") {
48
+ console.log(item.groupedKey);
49
+ }
48
50
  if (gIndex >= startIndex && gIndex <= endIndex)
49
51
  return item.type === "main" ? (_jsxs("div", { style: {
50
52
  width: "100%",
@@ -67,14 +69,14 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
67
69
  display: "flex",
68
70
  alignItems: "center",
69
71
  justifyContent: "center",
70
- }, children: rowOpened.includes(item.groupedValue || "") ? "-" : "+" }), (_b = item.groupedKey) === null || _b === void 0 ? void 0 : _b.split(">").filter((key) => key !== item.key).map((columnKey, index) => {
72
+ }, children: rowOpened.includes(item.groupedValue || "") ? "-" : "+" }), (_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").filter((key) => key !== item.key).map((columnKey, index) => {
71
73
  var _a;
72
74
  const column = gridColumns.find((column) => column.key === columnKey);
73
75
  const showCount = ((_a = item.groupedKey) === null || _a === void 0 ? void 0 : _a.split(">").filter((key) => key !== item.key).length) -
74
76
  1 ===
75
77
  index;
76
78
  if (column) {
77
- return (_jsxs("div", { style: {
79
+ return (_jsx("div", { style: {
78
80
  width: widthMode === "auto"
79
81
  ? "auto"
80
82
  : (column === null || column === void 0 ? void 0 : column.width)
@@ -86,18 +88,18 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
86
88
  flexGrow: widthMode === "auto" ? 1 : 0,
87
89
  flexShrink: widthMode === "auto" ? 1 : 0,
88
90
  padding: "0.5rem",
89
- }, className: `column index-${columnKey}`, children: [(() => {
90
- const keys = (item.groupedKey || "").split(">");
91
- const vals = (item.groupedValue || "").split(">");
92
- const idx = keys.indexOf(columnKey);
93
- const display = idx > -1 ? vals[idx] : "";
94
- return _jsx("div", { children: display });
95
- })(), showCount && _jsx("span", { children: `(${item === null || item === void 0 ? void 0 : item.count})` })] }));
91
+ }, className: `column index-${columnKey}`, children: showCount && (_jsxs(_Fragment, { children: [(() => {
92
+ const keys = (item.groupedKey || "").split(">");
93
+ const vals = (item.groupedValue || "").split(">");
94
+ const idx = keys.indexOf(columnKey);
95
+ const display = idx > -1 ? vals[idx] : "";
96
+ return _jsx("div", { children: display });
97
+ })(), _jsx("span", { children: `(${item === null || item === void 0 ? void 0 : item.count})` })] })) }));
96
98
  }
97
99
  return null;
98
100
  }), isSummarise &&
99
- parseInt(((_c = item === null || item === void 0 ? void 0 : item.count) === null || _c === void 0 ? void 0 : _c.toString()) || "0") > 0 && (_jsx(SummariseDetails, { rowIndex: gIndex, removedKeys: (_d = item.groupedKey) === null || _d === void 0 ? void 0 : _d.split(">").filter((key) => key !== item.key).flatMap((ele) => ele.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)
100
- ? `${item.groupedValue}-${(_j = (_h = item.rowData) === null || _h === void 0 ? void 0 : _h.id) === null || _j === void 0 ? void 0 : _j.value}`
101
+ parseInt(((_b = item === null || item === void 0 ? void 0 : item.count) === null || _b === void 0 ? void 0 : _b.toString()) || "0") > 0 && (_jsx(SummariseDetails, { rowIndex: gIndex, removedKeys: (_c = item.groupedKey) === null || _c === void 0 ? void 0 : _c.split(">").filter((key) => key !== item.key).flatMap((ele) => ele.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((_d = item.groupedValue) !== null && _d !== void 0 ? _d : 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(((_f = (_e = item.rowData) === null || _e === void 0 ? void 0 : _e.id) === null || _f === void 0 ? void 0 : _f.value)
102
+ ? `${item.groupedValue}-${(_h = (_g = item.rowData) === null || _g === void 0 ? void 0 : _g.id) === null || _h === void 0 ? void 0 : _h.value}`
101
103
  : gIndex)));
102
104
  }) }));
103
105
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.299",
3
+ "version": "1.2.301",
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",