@megha-ui/react 1.2.637 → 1.2.639

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.
@@ -143,9 +143,9 @@ const SummariseDetails = ({ columns, rowIndex, groupBy, sortable, cellStyle, col
143
143
  return (_jsxs("div", { style: Object.assign(Object.assign({}, cellStyle), { position: "relative", width: widthMode === "auto"
144
144
  ? "auto"
145
145
  : (column === null || column === void 0 ? void 0 : column.width)
146
- ? `calc(${column === null || column === void 0 ? void 0 : column.width} + 2.5rem)`
146
+ ? `calc(${column === null || column === void 0 ? void 0 : column.width} + 4rem)`
147
147
  : columnWidths[`column-${_groupBy}`]
148
- ? `calc(${columnWidths === null || columnWidths === void 0 ? void 0 : columnWidths[`column-${_groupBy}`]} + 2.5rem)`
148
+ ? `calc(${columnWidths === null || columnWidths === void 0 ? void 0 : columnWidths[`column-${_groupBy}`]} + 4rem)`
149
149
  : "fit-content", padding: _groupBy ? "0.5rem" : 0 }), className: `column ${columnKey}-${(_a = summariseDetails[columnKey || ""]) === null || _a === void 0 ? void 0 : _a.type}`, children: [summariseDetails[columnKey || ""] &&
150
150
  summariseDetails[columnKey || ""].type ? (_jsxs("div", { style: {
151
151
  display: "flex",
@@ -102,11 +102,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
102
102
  setSearchOpsPosition({ top, left });
103
103
  toggleDropdown(columnKey);
104
104
  };
105
- const menuOptions = [
106
- // { label: "Sort Ascending", action: onSort, order: "asc" },
107
- // { label: "Sort Descending", action: onSort, order: "dsc" },
108
- { label: "Group by", groupBy: setGroupBy },
109
- ];
105
+ const menuOptions = [{ label: "Group by", groupBy: setGroupBy }];
110
106
  const searchOptions = [
111
107
  { label: "Contains", value: "contains", action: handleSearchOptionSelect },
112
108
  {
@@ -235,7 +231,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
235
231
  position: "sticky",
236
232
  top: 0,
237
233
  zIndex: 1,
238
- fontWeight: 500
234
+ fontWeight: 500,
239
235
  }, 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) => {
240
236
  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;
241
237
  return (_jsx(_Fragment, { children: headerColumns.find((column) => column.key === _groupBy) && (_jsxs("div", { className: `${sortable &&
@@ -246,9 +242,9 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
246
242
  : "menu-false"} column index-${(_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key}`, style: Object.assign(Object.assign({}, cellStyle), { position: "relative", padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis", width: widthMode === "auto"
247
243
  ? "auto"
248
244
  : ((_d = headerColumns.find((column) => column.key === _groupBy)) === null || _d === void 0 ? void 0 : _d.width)
249
- ? `calc(${(_e = headerColumns.find((column) => column.key === _groupBy)) === null || _e === void 0 ? void 0 : _e.width} + 2.5rem)`
245
+ ? `calc(${(_e = headerColumns.find((column) => column.key === _groupBy)) === null || _e === void 0 ? void 0 : _e.width} + 4rem)`
250
246
  : (hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${(_f = headerColumns.find((column) => column.key === _groupBy)) === null || _f === void 0 ? void 0 : _f.key}`])
251
- ? `calc(${hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${(_g = headerColumns.find((column) => column.key === _groupBy)) === null || _g === void 0 ? void 0 : _g.key}`]} + 2.5rem)`
247
+ ? `calc(${hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${(_g = headerColumns.find((column) => column.key === _groupBy)) === null || _g === void 0 ? void 0 : _g.key}`]} + 4rem)`
252
248
  : "fit-content", wordBreak: widthMode === "auto" ? "break-all" : "unset", backgroundColor: "var(--row-header-bg)", borderTop: headerTopBorder, borderBottom: headerBottomBorder, flex: widthMode === "auto" ? 1 : undefined, flexGrow: widthMode === "auto" ? 1 : 0, flexShrink: widthMode === "auto" ? 1 : 0 }), onMouseMove: (e) => handleMouseMove(e), onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, children: [_jsxs("div", { style: {
253
249
  display: "flex",
254
250
  alignItems: "center",
@@ -572,7 +568,9 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
572
568
  ? numberTypeSearch.includes(item.value)
573
569
  : column.dataType === "date"
574
570
  ? dateTypeSearch.includes(item.value)
575
- : textTypeSearch.includes(item.value)), position: searchOpsPosition || { top: 0, left: 0 }, columnKey: column.key, columnData: columnData, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions, onClose: () => setDropdownVisible(null), column: column }), searchElement: _jsx("div", { id: "search-input", children: column.dataType === "date" ? (((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) ===
571
+ : textTypeSearch.includes(item.value)), position: searchOpsPosition || { top: 0, left: 0 }, columnKey: column.key, columnData: columnData, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions.filter((item) => item.label === "Group by"
572
+ ? !column.isArrayString
573
+ : true), onClose: () => setDropdownVisible(null), column: column }), searchElement: _jsx("div", { id: "search-input", children: column.dataType === "date" ? (((_c = searchQueries[column.key]) === null || _c === void 0 ? void 0 : _c.type) ===
576
574
  "between" ? (_jsxs(_Fragment, { children: [_jsx(DateInput, { value: (_d = searchQueries[column.key]) === null || _d === void 0 ? void 0 : _d.text.split("to")[0], placeholder: `From date`, onChange: (value) => {
577
575
  var _a, _b;
578
576
  return onSearch(column.key, (_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.text.split("to").map((item, index) => {
@@ -60,9 +60,9 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
60
60
  width: widthMode === "auto"
61
61
  ? "auto"
62
62
  : (column === null || column === void 0 ? void 0 : column.width)
63
- ? `calc(${column === null || column === void 0 ? void 0 : column.width} + 2.5rem)`
63
+ ? `calc(${column === null || column === void 0 ? void 0 : column.width} + 4rem)`
64
64
  : columnWidths[`column-${columnKey}`]
65
- ? `calc(${columnWidths[`column-${columnKey}`]} + 2.5rem)`
65
+ ? `calc(${columnWidths[`column-${columnKey}`]} + 4rem)`
66
66
  : "fit-content",
67
67
  flex: widthMode === "auto" ? 1 : undefined,
68
68
  flexGrow: widthMode === "auto" ? 1 : 0,
@@ -84,9 +84,9 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
84
84
  width: widthMode === "auto"
85
85
  ? "auto"
86
86
  : ((_b = gridColumns.find((column) => column.key === item.key)) === null || _b === void 0 ? void 0 : _b.width)
87
- ? `calc(${(_c = gridColumns.find((column) => column.key === item.key)) === null || _c === void 0 ? void 0 : _c.width} + 2.5rem)`
87
+ ? `calc(${(_c = gridColumns.find((column) => column.key === item.key)) === null || _c === void 0 ? void 0 : _c.width} + 4rem)`
88
88
  : columnWidths[`column-${item.key}`]
89
- ? `calc(${columnWidths[`column-${item.key}`]} + 2.5rem)`
89
+ ? `calc(${columnWidths[`column-${item.key}`]} + 4rem)`
90
90
  : "fit-content",
91
91
  background: "inherit",
92
92
  flexShrink: 0,
@@ -40,9 +40,9 @@ const GroupedRow = ({ item, rowStyle, cellStyle, rowHeight, columns, widthMode,
40
40
  width: widthMode === "auto"
41
41
  ? "auto"
42
42
  : ((_a = columns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.width)
43
- ? `calc(${(_b = columns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.width} + 2.5rem)`
43
+ ? `calc(${(_b = columns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.width} + 4rem)`
44
44
  : (hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${_groupBy}`])
45
- ? `calc(${hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${_groupBy}`]} + 2.5rem)`
45
+ ? `calc(${hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${_groupBy}`]} + 4rem)`
46
46
  : "fit-content",
47
47
  padding: _groupBy ? "0.5rem" : 0,
48
48
  backgroundColor: alternateRowColor && (index + 1) % 2 === 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.637",
3
+ "version": "1.2.639",
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",