@megha-ui/react 1.2.239 → 1.2.240
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.
|
@@ -46,6 +46,11 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
46
46
|
const [searchOpsPosition, setSearchOpsPosition] = useState(null);
|
|
47
47
|
const [headerColumns, setHeaderColumns] = useState([]);
|
|
48
48
|
const [resizeIndex, setResizeIndex] = useState(-1);
|
|
49
|
+
// Support composite groupBy (e.g., "colA+colB,colC") by flattening to keys
|
|
50
|
+
const groupByKeys = useMemo(() => (groupBy || "")
|
|
51
|
+
.split(",")
|
|
52
|
+
.filter((g) => g)
|
|
53
|
+
.flatMap((g) => g.split("+").filter((k) => k)), [groupBy]);
|
|
49
54
|
const handleMenuClick = (e, columnKey) => {
|
|
50
55
|
e.stopPropagation();
|
|
51
56
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -230,10 +235,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
230
235
|
position: "sticky",
|
|
231
236
|
top: 0,
|
|
232
237
|
zIndex: 1,
|
|
233
|
-
}, id: "header", children: [bulkSelect && (_jsx("div", { style: Object.assign(Object.assign({}, cellStyle), { textTransform: "uppercase", padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis" }), children: _jsx(Checkbox, { selected: allRowsSelected, onChange: () => toggleSelectAll(), noLabel: true, wrapperClass: checkboxWrapper }) })),
|
|
234
|
-
.split(",")
|
|
235
|
-
.filter((item) => item)
|
|
236
|
-
.map((_groupBy) => {
|
|
238
|
+
}, id: "header", children: [bulkSelect && (_jsx("div", { style: Object.assign(Object.assign({}, cellStyle), { textTransform: "uppercase", padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis" }), children: _jsx(Checkbox, { selected: allRowsSelected, onChange: () => toggleSelectAll(), noLabel: true, wrapperClass: checkboxWrapper }) })), groupByKeys.map((_groupBy) => {
|
|
237
239
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62;
|
|
238
240
|
return (_jsx(_Fragment, { children: headerColumns.find((column) => column.key === _groupBy) && (_jsxs("div", { className: `${sortable &&
|
|
239
241
|
((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.sortable)
|
|
@@ -507,7 +509,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
507
509
|
: "var(--disabled-bg)",
|
|
508
510
|
}, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "var(--background)" }) }))] }, (_62 = headerColumns.find((column) => column.key === _groupBy)) === null || _62 === void 0 ? void 0 : _62.key)) }));
|
|
509
511
|
}), headerColumns
|
|
510
|
-
.filter((column) => !
|
|
512
|
+
.filter((column) => !groupByKeys.includes(column.key))
|
|
511
513
|
.map((column, colIndex) => {
|
|
512
514
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
513
515
|
if (!column.hidden) {
|
package/package.json
CHANGED