@codezee/sixtify-brahma 0.2.188 → 0.2.190

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.
Files changed (114) hide show
  1. package/package.json +2 -1
  2. package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.d.ts +2 -2
  3. package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.d.ts.map +1 -1
  4. package/packages/shared-components/dist/FormFields/Autocomplete/Skeleton.d.ts +2 -1
  5. package/packages/shared-components/dist/FormFields/Autocomplete/Skeleton.d.ts.map +1 -1
  6. package/packages/shared-components/dist/FormFields/DatePicker/DatePicker.d.ts +2 -1
  7. package/packages/shared-components/dist/FormFields/DatePicker/DatePicker.d.ts.map +1 -1
  8. package/packages/shared-components/dist/FormFields/DatePicker/Skeleton.d.ts +2 -1
  9. package/packages/shared-components/dist/FormFields/DatePicker/Skeleton.d.ts.map +1 -1
  10. package/packages/shared-components/dist/FormFields/DateTimePicker/DateTimePicker.d.ts +2 -1
  11. package/packages/shared-components/dist/FormFields/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  12. package/packages/shared-components/dist/FormFields/DateTimePicker/Skeleton.d.ts +2 -1
  13. package/packages/shared-components/dist/FormFields/DateTimePicker/Skeleton.d.ts.map +1 -1
  14. package/packages/shared-components/dist/FormFields/DecimalTextField/DecimalTextField.d.ts +2 -1
  15. package/packages/shared-components/dist/FormFields/DecimalTextField/DecimalTextField.d.ts.map +1 -1
  16. package/packages/shared-components/dist/FormFields/FileUpload/FileNames.d.ts.map +1 -1
  17. package/packages/shared-components/dist/FormFields/FileUpload/FileNames.js +2 -1
  18. package/packages/shared-components/dist/FormFields/ImageUpload/ImageUpload.d.ts.map +1 -1
  19. package/packages/shared-components/dist/FormFields/ImageUpload/ImageUpload.js +24 -6
  20. package/packages/shared-components/dist/FormFields/ImageUpload/ImageUpload.styled.d.ts.map +1 -1
  21. package/packages/shared-components/dist/FormFields/ImageUpload/ImageUpload.styled.js +3 -2
  22. package/packages/shared-components/dist/FormFields/PhoneInputField/PhoneInputField.d.ts +3 -1
  23. package/packages/shared-components/dist/FormFields/PhoneInputField/PhoneInputField.d.ts.map +1 -1
  24. package/packages/shared-components/dist/FormFields/PhoneInputField/PhoneInputField.js +5 -30
  25. package/packages/shared-components/dist/FormFields/PhoneInputField/PhoneInputField.styled.d.ts +10 -0
  26. package/packages/shared-components/dist/FormFields/PhoneInputField/PhoneInputField.styled.d.ts.map +1 -0
  27. package/packages/shared-components/dist/FormFields/PhoneInputField/PhoneInputField.styled.js +214 -0
  28. package/packages/shared-components/dist/FormFields/PhoneInputField/Skeleton.d.ts +3 -1
  29. package/packages/shared-components/dist/FormFields/PhoneInputField/Skeleton.d.ts.map +1 -1
  30. package/packages/shared-components/dist/FormFields/PhoneInputField/Skeleton.js +2 -2
  31. package/packages/shared-components/dist/FormFields/RadioGroupField/RadioGroupField.d.ts +2 -1
  32. package/packages/shared-components/dist/FormFields/RadioGroupField/RadioGroupField.d.ts.map +1 -1
  33. package/packages/shared-components/dist/FormFields/RadioGroupField/RadioGroupField.js +24 -16
  34. package/packages/shared-components/dist/FormFields/Select/Select.d.ts +2 -2
  35. package/packages/shared-components/dist/FormFields/Select/Select.d.ts.map +1 -1
  36. package/packages/shared-components/dist/FormFields/Select/Select.styled.js +1 -1
  37. package/packages/shared-components/dist/FormFields/TextField/Skeleton.d.ts +2 -1
  38. package/packages/shared-components/dist/FormFields/TextField/Skeleton.d.ts.map +1 -1
  39. package/packages/shared-components/dist/FormFields/TextField/TextField.d.ts +2 -1
  40. package/packages/shared-components/dist/FormFields/TextField/TextField.d.ts.map +1 -1
  41. package/packages/shared-components/dist/FormFields/TimeField/Skeleton.d.ts +2 -1
  42. package/packages/shared-components/dist/FormFields/TimeField/Skeleton.d.ts.map +1 -1
  43. package/packages/shared-components/dist/FormFields/TimeField/TimeField.d.ts +2 -1
  44. package/packages/shared-components/dist/FormFields/TimeField/TimeField.d.ts.map +1 -1
  45. package/packages/shared-components/dist/FormFields/TimePicker/Skeleton.d.ts +2 -1
  46. package/packages/shared-components/dist/FormFields/TimePicker/Skeleton.d.ts.map +1 -1
  47. package/packages/shared-components/dist/FormFields/TimePicker/TimePicker.d.ts +2 -1
  48. package/packages/shared-components/dist/FormFields/TimePicker/TimePicker.d.ts.map +1 -1
  49. package/packages/shared-components/dist/SmartGrid/Components/CellRenderer.d.ts +2 -1
  50. package/packages/shared-components/dist/SmartGrid/Components/CellRenderer.d.ts.map +1 -1
  51. package/packages/shared-components/dist/SmartGrid/Components/CellRenderer.js +12 -11
  52. package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.d.ts.map +1 -1
  53. package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.js +17 -34
  54. package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.d.ts +2 -2
  55. package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.d.ts.map +1 -1
  56. package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.js +21 -5
  57. package/packages/shared-components/dist/SmartGrid/Components/FilterStatusPanel.d.ts.map +1 -1
  58. package/packages/shared-components/dist/SmartGrid/Components/FilterStatusPanel.js +13 -6
  59. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupAreaOverlay.d.ts +10 -0
  60. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupAreaOverlay.d.ts.map +1 -0
  61. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupAreaOverlay.js +82 -0
  62. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupChip.d.ts +10 -0
  63. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupChip.d.ts.map +1 -0
  64. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupChip.js +73 -0
  65. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupedColumn.d.ts +8 -0
  66. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupedColumn.d.ts.map +1 -0
  67. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupedColumn.js +64 -0
  68. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupedPanel.d.ts +10 -0
  69. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupedPanel.d.ts.map +1 -0
  70. package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupedPanel.js +53 -0
  71. package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/DraggableHeaderCell.d.ts +2 -1
  72. package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/DraggableHeaderCell.d.ts.map +1 -1
  73. package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/DraggableHeaderCell.js +2 -2
  74. package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/DraggableHeaderGroupRows.d.ts.map +1 -1
  75. package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/DraggableHeaderGroupRows.js +12 -8
  76. package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/HeaderCell.d.ts +1 -1
  77. package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/HeaderCell.d.ts.map +1 -1
  78. package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/HeaderCell.js +47 -27
  79. package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  80. package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DateRangeInput/DateRangeInput.js +1 -1
  81. package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DateRangeInput/StyleDateRangeWrapper.js +1 -1
  82. package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/GetRenderInputs.d.ts.map +1 -1
  83. package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/SearchFilterRow.d.ts.map +1 -1
  84. package/packages/shared-components/dist/SmartGrid/Components/TableFooterComponent/TableFooterComponent.d.ts.map +1 -1
  85. package/packages/shared-components/dist/SmartGrid/Components/TableRowComponent.d.ts +3 -2
  86. package/packages/shared-components/dist/SmartGrid/Components/TableRowComponent.d.ts.map +1 -1
  87. package/packages/shared-components/dist/SmartGrid/Components/TableRowComponent.js +75 -57
  88. package/packages/shared-components/dist/SmartGrid/SmartGrid.d.ts.map +1 -1
  89. package/packages/shared-components/dist/SmartGrid/SmartGrid.js +103 -47
  90. package/packages/shared-components/dist/SmartGrid/hooks/useGetColumnWidth.d.ts.map +1 -1
  91. package/packages/shared-components/dist/SmartGrid/hooks/useGetFacetedFilter.d.ts.map +1 -1
  92. package/packages/shared-components/dist/SmartGrid/hooks/useGetGroupedColumn.d.ts +18 -6
  93. package/packages/shared-components/dist/SmartGrid/hooks/useGetGroupedColumn.d.ts.map +1 -1
  94. package/packages/shared-components/dist/SmartGrid/hooks/useGetGroupedColumn.js +160 -6
  95. package/packages/shared-components/dist/SmartGrid/hooks/useGetPinningColumns.d.ts.map +1 -1
  96. package/packages/shared-components/dist/SmartGrid/hooks/useGetRowSelection.d.ts.map +1 -1
  97. package/packages/shared-components/dist/SmartGrid/hooks/useGetSortedColumn.d.ts +1 -1
  98. package/packages/shared-components/dist/SmartGrid/hooks/useGetSortedColumn.d.ts.map +1 -1
  99. package/packages/shared-components/dist/SmartGrid/hooks/useGetSortedColumn.js +1 -2
  100. package/packages/shared-components/dist/SmartGrid/hooks/useProcessColumnsForGroupDisplay.d.ts +11 -0
  101. package/packages/shared-components/dist/SmartGrid/hooks/useProcessColumnsForGroupDisplay.d.ts.map +1 -0
  102. package/packages/shared-components/dist/SmartGrid/hooks/useProcessColumnsForGroupDisplay.js +30 -0
  103. package/packages/shared-components/dist/SmartGrid/hooks/useTableState.d.ts.map +1 -1
  104. package/packages/shared-components/dist/SmartGrid/hooks/useTableState.js +51 -4
  105. package/packages/shared-components/dist/SmartGrid/utils/helper.d.ts +1 -0
  106. package/packages/shared-components/dist/SmartGrid/utils/helper.d.ts.map +1 -1
  107. package/packages/shared-components/dist/SmartGrid/utils/helper.js +7 -5
  108. package/packages/shared-components/dist/TabBar/Tab.d.ts.map +1 -1
  109. package/packages/shared-components/dist/TabBar/Tab.js +1 -1
  110. package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.styled.d.ts.map +1 -1
  111. package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.styled.js +2 -1
  112. package/packages/shared-components/dist/utils/theme/colorPalette.js +3 -3
  113. package/packages/shared-components/dist/utils/types.d.ts +1 -0
  114. package/packages/shared-components/dist/utils/types.d.ts.map +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupAreaOverlay.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/Grouped/GroupAreaOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,KAAK,qBAAqB,CAAC,CAAC,IAAI;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAG,2DAKlC,qBAAqB,CAAC,CAAC,CAAC,4CAoH1B,CAAC"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GroupAreaOverlay = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const core_1 = require("@dnd-kit/core");
6
+ const material_1 = require("@mui/material");
7
+ const iconoir_react_1 = require("iconoir-react");
8
+ const GroupAreaOverlay = ({ activeDragId, activeDragOver, table, defaultGrouping = [], }) => {
9
+ const theme = (0, material_1.useTheme)();
10
+ const { iron, lipstickRed, slate } = theme.palette.app.color;
11
+ const { getColumn, getHeaderGroups } = table;
12
+ return ((0, jsx_runtime_1.jsx)(core_1.DragOverlay, { style: {
13
+ zIndex: 9999,
14
+ }, children: activeDragId
15
+ ? (() => {
16
+ const column = getColumn(activeDragId);
17
+ if (!column) {
18
+ return null;
19
+ }
20
+ const { header: columnHeader, id, enableGrouping, } = column.columnDef;
21
+ const headerLabel = typeof columnHeader === "string"
22
+ ? columnHeader
23
+ : (id ?? activeDragId);
24
+ const headerGroups = getHeaderGroups();
25
+ const header = headerGroups
26
+ .flatMap(({ headers }) => headers)
27
+ .find(({ column }) => column.id === activeDragId);
28
+ if (!header) {
29
+ return null;
30
+ }
31
+ const headerDynamicWidth = header.column.getSize();
32
+ // Check if column is groupable
33
+ const isGroupable = enableGrouping === true;
34
+ // Check if dragging over the group panel
35
+ const isOverGroupPanel = activeDragOver === "grouping-panel";
36
+ // If defaultGrouping exists and enableGrouping is true, prohibit dragging to group area
37
+ const shouldProhibit = defaultGrouping.length > 0 && isGroupable && isOverGroupPanel;
38
+ // Determine border color and icon based on groupability and drag location
39
+ const borderColor = shouldProhibit
40
+ ? lipstickRed[900]
41
+ : // eslint-disable-next-line sonarjs/no-nested-conditional
42
+ isOverGroupPanel && !isGroupable
43
+ ? lipstickRed[900]
44
+ : iron[700];
45
+ const manageIcon = () => {
46
+ if (shouldProhibit) {
47
+ return (0, jsx_runtime_1.jsx)(iconoir_react_1.Prohibition, { width: 18, height: 18 });
48
+ }
49
+ if (isOverGroupPanel && !isGroupable) {
50
+ return (0, jsx_runtime_1.jsx)(iconoir_react_1.Prohibition, { width: 18, height: 18 });
51
+ }
52
+ if (isOverGroupPanel && isGroupable) {
53
+ return (0, jsx_runtime_1.jsx)(iconoir_react_1.KeyframesPlus, { width: 18, height: 18 });
54
+ }
55
+ return (0, jsx_runtime_1.jsx)(iconoir_react_1.Drag, { width: 18, height: 18 });
56
+ };
57
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
58
+ alignItems: "center",
59
+ backgroundColor: slate[800],
60
+ border: `1px solid ${borderColor}`,
61
+ borderRadius: "4px",
62
+ display: "flex",
63
+ gap: "8px",
64
+ height: "40px",
65
+ minWidth: `${headerDynamicWidth}px`,
66
+ padding: "0px 8px",
67
+ boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)",
68
+ cursor: "grabbing",
69
+ }, children: [manageIcon(), (0, jsx_runtime_1.jsx)("div", { style: {
70
+ color: iron[400],
71
+ fontFamily: "Poppins",
72
+ fontSize: "14px",
73
+ fontWeight: 600,
74
+ lineHeight: "20px",
75
+ overflow: "hidden",
76
+ textOverflow: "ellipsis",
77
+ whiteSpace: "nowrap",
78
+ }, children: headerLabel })] }));
79
+ })()
80
+ : null }));
81
+ };
82
+ exports.GroupAreaOverlay = GroupAreaOverlay;
@@ -0,0 +1,10 @@
1
+ import type { Table } from "@tanstack/react-table";
2
+ type GroupChipProps<T> = {
3
+ columnId: string;
4
+ onRemove: (columnId: string) => void;
5
+ table: Table<T>;
6
+ defaultGrouping: Array<keyof T>;
7
+ };
8
+ export declare const GroupChip: <T>({ columnId, onRemove, table, defaultGrouping, }: GroupChipProps<T>) => import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
10
+ //# sourceMappingURL=GroupChip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupChip.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/Grouped/GroupChip.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,KAAK,cAAc,CAAC,CAAC,IAAI;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,CAAC,EAAG,iDAK3B,cAAc,CAAC,CAAC,CAAC,mDA6InB,CAAC"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GroupChip = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const sortable_1 = require("@dnd-kit/sortable");
6
+ const utilities_1 = require("@dnd-kit/utilities");
7
+ const material_1 = require("@mui/material");
8
+ const GroupChip = ({ columnId, onRemove, table, defaultGrouping = [], }) => {
9
+ const theme = (0, material_1.useTheme)();
10
+ const { butterflyBlue, iron, slate } = theme.palette.app.color;
11
+ const { attributes, listeners, setNodeRef, transform, transition, isDragging, } = (0, sortable_1.useSortable)({ id: columnId });
12
+ const column = table.getColumn(columnId);
13
+ if (!column) {
14
+ return null;
15
+ }
16
+ const style = {
17
+ transform: utilities_1.CSS.Transform.toString(transform),
18
+ transition,
19
+ opacity: isDragging ? 0.5 : 1,
20
+ };
21
+ const { header: columnHeader, id } = column.columnDef;
22
+ // Get header label from column definition
23
+ const headerLabel = typeof columnHeader === "string" ? columnHeader : (id ?? columnId);
24
+ const handleRemove = (e) => {
25
+ e.stopPropagation();
26
+ onRemove(columnId);
27
+ };
28
+ // Optimized: Replace MUI components with native HTML for better performance
29
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: setNodeRef, style: {
30
+ ...style,
31
+ display: "inline-flex",
32
+ alignItems: "center",
33
+ backgroundColor: slate[800],
34
+ border: `1px solid ${iron[700]}`,
35
+ borderRadius: "16px",
36
+ height: "28px",
37
+ padding: "0 8px",
38
+ cursor: "default",
39
+ }, children: [!defaultGrouping.length && ((0, jsx_runtime_1.jsx)("div", { ...attributes, ...listeners, style: {
40
+ display: "flex",
41
+ alignItems: "center",
42
+ cursor: isDragging ? "grabbing" : "grab",
43
+ touchAction: "none",
44
+ padding: "2px",
45
+ marginRight: "4px",
46
+ }, children: (0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", style: { color: iron[400] }, children: (0, jsx_runtime_1.jsx)("path", { d: "M9 5h2v2H9V5zm0 6h2v2H9v-2zm0 6h2v2H9v-2zm4-8h2v2h-2v-2zm0 4h2v2h-2v-2zm0 4h2v2h-2v-2z", fill: "currentColor" }) }) })), (0, jsx_runtime_1.jsx)("span", { style: {
47
+ fontSize: "12px",
48
+ fontWeight: 500,
49
+ color: butterflyBlue[900],
50
+ overflow: "hidden",
51
+ textOverflow: "ellipsis",
52
+ whiteSpace: "nowrap",
53
+ maxWidth: "150px",
54
+ }, children: headerLabel }), !defaultGrouping.length && ((0, jsx_runtime_1.jsx)("button", { onClick: handleRemove, type: "button", style: {
55
+ display: "flex",
56
+ alignItems: "center",
57
+ justifyContent: "center",
58
+ cursor: "pointer",
59
+ padding: "2px",
60
+ marginLeft: "4px",
61
+ background: "none",
62
+ border: "none",
63
+ borderRadius: "50%",
64
+ width: "18px",
65
+ height: "18px",
66
+ transition: "background-color 0.2s",
67
+ }, onMouseEnter: (e) => {
68
+ e.currentTarget.style.backgroundColor = slate[700];
69
+ }, onMouseLeave: (e) => {
70
+ e.currentTarget.style.backgroundColor = "transparent";
71
+ }, children: (0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", style: { color: iron[400] }, children: (0, jsx_runtime_1.jsx)("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z", fill: "currentColor" }) }) }))] }));
72
+ };
73
+ exports.GroupChip = GroupChip;
@@ -0,0 +1,8 @@
1
+ import type { Row } from "@tanstack/react-table";
2
+ type GroupedColumnProps<T> = {
3
+ row: Row<T>;
4
+ isSummaryRow: boolean;
5
+ };
6
+ export declare const GroupedColumn: <T>({ row, isSummaryRow, }: GroupedColumnProps<T>) => import("react/jsx-runtime").JSX.Element | null;
7
+ export {};
8
+ //# sourceMappingURL=GroupedColumn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupedColumn.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/Grouped/GroupedColumn.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAIjD,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,EAAG,wBAG/B,kBAAkB,CAAC,CAAC,CAAC,mDAiGvB,CAAC"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GroupedColumn = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const icons_material_1 = require("@mui/icons-material");
6
+ const material_1 = require("@mui/material");
7
+ const luxon_1 = require("luxon");
8
+ const helper_1 = require("../../utils/helper");
9
+ const GroupedColumn = ({ row, isSummaryRow, }) => {
10
+ const { groupingColumnId, getIsGrouped, getGroupingValue } = row;
11
+ if (isSummaryRow) {
12
+ return (0, jsx_runtime_1.jsx)("span", { children: "Total" });
13
+ }
14
+ const theme = (0, material_1.useTheme)();
15
+ const { butterflyBlue } = theme.palette.app.color;
16
+ if (!getIsGrouped()) {
17
+ return null;
18
+ }
19
+ if (!groupingColumnId) {
20
+ return null;
21
+ }
22
+ const groupingValue = getGroupingValue(groupingColumnId);
23
+ if (groupingValue == null) {
24
+ return null;
25
+ }
26
+ const isExpanded = row.getIsExpanded();
27
+ const getGroupingLabel = () => {
28
+ if (typeof groupingValue === "string") {
29
+ if (!(0, helper_1.isFullISODate)(groupingValue)) {
30
+ return groupingValue;
31
+ }
32
+ const dt = luxon_1.DateTime.fromISO(groupingValue, { zone: "utc" });
33
+ return dt.isValid ? (0, helper_1.formatDateValue)(groupingValue) : groupingValue;
34
+ }
35
+ return String(groupingValue);
36
+ };
37
+ return ((0, jsx_runtime_1.jsx)("div", { style: {
38
+ display: "flex",
39
+ alignItems: "center",
40
+ paddingLeft: `${row.depth * 15}px`,
41
+ width: "100%",
42
+ }, children: (0, jsx_runtime_1.jsxs)("div", { role: "button", tabIndex: 0, onClick: row.getToggleExpandedHandler(), onKeyDown: (e) => {
43
+ if (e.key === "Enter" || e.key === " ") {
44
+ e.preventDefault();
45
+ row.toggleExpanded();
46
+ }
47
+ }, style: {
48
+ display: "inline-flex",
49
+ alignItems: "center",
50
+ cursor: "pointer",
51
+ padding: "4px 4px",
52
+ userSelect: "none",
53
+ }, children: [isExpanded ? ((0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, { color: "primary", fontSize: "small" })) : ((0, jsx_runtime_1.jsx)(icons_material_1.ChevronRight, { color: "primary", fontSize: "small" })), (0, jsx_runtime_1.jsx)("p", { style: {
54
+ fontSize: "14px",
55
+ marginLeft: "4px",
56
+ color: butterflyBlue[900],
57
+ }, children: getGroupingLabel() }), (0, jsx_runtime_1.jsxs)("p", { style: {
58
+ fontSize: "14px",
59
+ marginLeft: "4px",
60
+ opacity: 0.7,
61
+ color: butterflyBlue[900],
62
+ }, children: ["(", row.subRows.length, ")"] })] }) }));
63
+ };
64
+ exports.GroupedColumn = GroupedColumn;
@@ -0,0 +1,10 @@
1
+ import type { useTableState } from "../../hooks/useTableState";
2
+ type GroupingPanelProps<T> = {
3
+ groupedColumns: string[];
4
+ onRemoveGroup: (columnId: string) => void;
5
+ table: ReturnType<typeof useTableState<T>>["table"];
6
+ defaultGrouping: Array<keyof T>;
7
+ };
8
+ export declare const GroupedPanel: <T>({ groupedColumns, onRemoveGroup, table, defaultGrouping, }: GroupingPanelProps<T>) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=GroupedPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupedPanel.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/Grouped/GroupedPanel.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,KAAK,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACpD,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,EAAG,4DAK9B,kBAAkB,CAAC,CAAC,CAAC,4CA0FvB,CAAC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GroupedPanel = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const core_1 = require("@dnd-kit/core");
6
+ const sortable_1 = require("@dnd-kit/sortable");
7
+ const material_1 = require("@mui/material");
8
+ const react_1 = require("react");
9
+ const GroupChip_1 = require("./GroupChip");
10
+ const GroupedPanel = ({ groupedColumns, onRemoveGroup, table, defaultGrouping = [], }) => {
11
+ const theme = (0, material_1.useTheme)();
12
+ const { iron, butterflyBlue } = theme.palette.app.color;
13
+ const { setNodeRef, isOver } = (0, core_1.useDroppable)({
14
+ id: "grouping-panel",
15
+ });
16
+ return ((0, jsx_runtime_1.jsx)("div", { ref: setNodeRef, style: {
17
+ alignItems: "center",
18
+ backgroundColor: iron[600],
19
+ border: "2px solid transparent",
20
+ boxSizing: "border-box",
21
+ display: "flex",
22
+ flexWrap: "wrap",
23
+ gap: 8,
24
+ marginBottom: 1,
25
+ minHeight: "44px",
26
+ padding: "8px 12px",
27
+ position: "relative",
28
+ transition: "all 0.15s ease",
29
+ width: "100%",
30
+ zIndex: 5,
31
+ }, children: !groupedColumns.length ? ((0, jsx_runtime_1.jsx)("p", { style: {
32
+ color: isOver ? butterflyBlue[900] : iron[300],
33
+ fontSize: 13,
34
+ fontWeight: 400,
35
+ lineHeight: 1.5,
36
+ margin: 0,
37
+ padding: 0,
38
+ }, children: isOver
39
+ ? "↓ Drop here to group by this column"
40
+ : "Drag column headers here to group..." })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { style: {
41
+ color: iron[300],
42
+ fontSize: 13,
43
+ fontWeight: 500,
44
+ lineHeight: 1.5,
45
+ margin: 0,
46
+ padding: 0,
47
+ }, children: "Grouped By:" }), (0, jsx_runtime_1.jsx)(sortable_1.SortableContext, { items: groupedColumns, strategy: sortable_1.horizontalListSortingStrategy, children: groupedColumns.map((columnId, index) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(GroupChip_1.GroupChip, { columnId: columnId, onRemove: onRemoveGroup, table: table, defaultGrouping: defaultGrouping }), index < groupedColumns.length - 1 && ((0, jsx_runtime_1.jsx)("span", { style: {
48
+ color: iron[400],
49
+ fontSize: "12px",
50
+ fontWeight: 600,
51
+ }, children: ">" }))] }, columnId))) })] })) }));
52
+ };
53
+ exports.GroupedPanel = GroupedPanel;
@@ -2,9 +2,10 @@ import type { Header } from "@tanstack/react-table";
2
2
  type DraggableHeaderCellProps<T> = {
3
3
  defaultGrouping?: (keyof T)[];
4
4
  header: Header<T, unknown>;
5
+ isReorderable?: boolean;
5
6
  loading: boolean;
6
7
  resetAllFilters: boolean;
7
8
  };
8
- export declare const DraggableHeaderCell: <T>({ defaultGrouping, header, loading, resetAllFilters, }: DraggableHeaderCellProps<T>) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const DraggableHeaderCell: <T>({ defaultGrouping, header, isReorderable, loading, resetAllFilters, }: DraggableHeaderCellProps<T>) => import("react/jsx-runtime").JSX.Element;
9
10
  export {};
10
11
  //# sourceMappingURL=DraggableHeaderCell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DraggableHeaderCell.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/HeaderCells/DraggableHeaderCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAIpD,KAAK,wBAAwB,CAAC,CAAC,IAAI;IACjC,eAAe,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAG,wDAKrC,wBAAwB,CAAC,CAAC,CAAC,4CAiC7B,CAAC"}
1
+ {"version":3,"file":"DraggableHeaderCell.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/HeaderCells/DraggableHeaderCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAIpD,KAAK,wBAAwB,CAAC,CAAC,IAAI;IACjC,eAAe,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAG,uEAMrC,wBAAwB,CAAC,CAAC,CAAC,4CAiC7B,CAAC"}
@@ -4,12 +4,12 @@ exports.DraggableHeaderCell = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const HeaderCell_1 = require("./HeaderCell");
6
6
  const sortable_1 = require("@dnd-kit/sortable");
7
- const DraggableHeaderCell = ({ defaultGrouping, header, loading, resetAllFilters, }) => {
7
+ const DraggableHeaderCell = ({ defaultGrouping, header, isReorderable = true, loading, resetAllFilters, }) => {
8
8
  const { attributes, isDragging, isOver, listeners, setNodeRef, transform, transition, } = (0, sortable_1.useSortable)({
9
9
  id: header.column.id,
10
10
  });
11
11
  return ((0, jsx_runtime_1.jsx)(HeaderCell_1.HeaderCell, { defaultGrouping: defaultGrouping, header: header, loading: loading, resetAllFilters: resetAllFilters, dragAttributes: attributes, dragListeners: listeners
12
12
  ? listeners
13
- : undefined, dragRef: setNodeRef, dragTransform: transform, dragTransition: transition, isDragging: isDragging, isDragOver: isOver, isReorderable: true }));
13
+ : undefined, dragRef: setNodeRef, dragTransform: transform, dragTransition: transition, isDragging: isDragging, isDragOver: isOver, isReorderable: isReorderable }));
14
14
  };
15
15
  exports.DraggableHeaderCell = DraggableHeaderCell;
@@ -1 +1 @@
1
- {"version":3,"file":"DraggableHeaderGroupRows.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/HeaderCells/DraggableHeaderGroupRows.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;IACtC,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC7B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5B,mBAAmB,EAAE,CACnB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,EAC1B,WAAW,EAAE,OAAO,KACjB,OAAO,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,CAAC,EAAG,2HAQ1C,6BAA6B,CAAC,CAAC,CAAC,4CA0FlC,CAAC"}
1
+ {"version":3,"file":"DraggableHeaderGroupRows.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/HeaderCells/DraggableHeaderGroupRows.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;IACtC,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC7B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5B,mBAAmB,EAAE,CACnB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,EAC1B,WAAW,EAAE,OAAO,KACjB,OAAO,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,CAAC,EAAG,2HAQ1C,6BAA6B,CAAC,CAAC,CAAC,4CA2FlC,CAAC"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DraggableHeaderGroupRows = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const sortable_1 = require("@dnd-kit/sortable");
6
5
  const HeaderCell_1 = require("./HeaderCell");
7
6
  const DraggableHeaderCell_1 = require("./DraggableHeaderCell");
8
7
  const SearchFilterRow_1 = require("../SearchFilterRow/SearchFilterRow");
@@ -13,12 +12,17 @@ const DraggableHeaderGroupRows = ({ defaultGrouping, enableSecondRowFilter, head
13
12
  const centerHeaders = headers.filter((h) => !h.column.getIsPinned());
14
13
  const rightPinnedHeaders = headers.filter((h) => h.column.getIsPinned() === "right");
15
14
  const isLeafGroup = depth === leafDepth;
16
- const reorderableHeaders = centerHeaders.filter((header) => isHeaderReorderable(header, isLeafGroup));
17
- const sortableItems = reorderableHeaders.map(({ column: { id } }) => id);
18
- const headerRow = ((0, jsx_runtime_1.jsxs)("tr", { children: [leftPinnedHeaders.map((header) => ((0, jsx_runtime_1.jsx)(HeaderCell_1.HeaderCell, { defaultGrouping: defaultGrouping, header: header, loading: loading, resetAllFilters: resetAllFilters }, header.id))), centerHeaders.map((header) => {
19
- const canReorder = isHeaderReorderable(header, isLeafGroup);
20
- return canReorder ? ((0, jsx_runtime_1.jsx)(DraggableHeaderCell_1.DraggableHeaderCell, { defaultGrouping: defaultGrouping, header: header, loading: loading, resetAllFilters: resetAllFilters }, header.id)) : ((0, jsx_runtime_1.jsx)(HeaderCell_1.HeaderCell, { defaultGrouping: defaultGrouping, header: header, loading: loading, resetAllFilters: resetAllFilters }, header.id));
21
- }), rightPinnedHeaders.map((header) => ((0, jsx_runtime_1.jsx)(HeaderCell_1.HeaderCell, { defaultGrouping: defaultGrouping, header: header, loading: loading, resetAllFilters: resetAllFilters }, header.id)))] }, `${headerGroup.id}-row`));
22
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [swipeableColumns && isLeafGroup && sortableItems.length ? ((0, jsx_runtime_1.jsx)(sortable_1.SortableContext, { items: sortableItems, children: headerRow })) : (headerRow), enableSecondRowFilter && !loading && ((0, jsx_runtime_1.jsx)("tr", { children: headerGroup.headers.map((header) => ((0, jsx_runtime_1.jsx)(SearchFilterRow_1.SearchFilterRow, { header: header, resetAllFilters: resetAllFilters }, header.id))) }))] }));
15
+ // Check if header should be draggable (either reorderable OR groupable)
16
+ const isDraggable = (header) => {
17
+ const columnDef = header.column.columnDef;
18
+ const isReorderable = isHeaderReorderable(header, isLeafGroup);
19
+ const isGroupable = !!columnDef.enableGrouping;
20
+ return isReorderable || isGroupable;
21
+ };
22
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("tr", { children: [leftPinnedHeaders.map((header) => ((0, jsx_runtime_1.jsx)(HeaderCell_1.HeaderCell, { defaultGrouping: defaultGrouping, header: header, loading: loading, resetAllFilters: resetAllFilters }, header.id))), centerHeaders.map((header) => {
23
+ const canDrag = isDraggable(header);
24
+ const isReorderable = swipeableColumns && isHeaderReorderable(header, isLeafGroup);
25
+ return canDrag ? ((0, jsx_runtime_1.jsx)(DraggableHeaderCell_1.DraggableHeaderCell, { defaultGrouping: defaultGrouping, header: header, loading: loading, resetAllFilters: resetAllFilters, isReorderable: isReorderable }, header.id)) : ((0, jsx_runtime_1.jsx)(HeaderCell_1.HeaderCell, { defaultGrouping: defaultGrouping, header: header, loading: loading, resetAllFilters: resetAllFilters }, header.id));
26
+ }), rightPinnedHeaders.map((header) => ((0, jsx_runtime_1.jsx)(HeaderCell_1.HeaderCell, { defaultGrouping: defaultGrouping, header: header, loading: loading, resetAllFilters: resetAllFilters }, header.id)))] }, `${headerGroup.id}-row`), enableSecondRowFilter && !loading && ((0, jsx_runtime_1.jsx)("tr", { children: headerGroup.headers.map((header) => ((0, jsx_runtime_1.jsx)(SearchFilterRow_1.SearchFilterRow, { header: header, resetAllFilters: resetAllFilters }, header.id))) }))] }));
23
27
  };
24
28
  exports.DraggableHeaderGroupRows = DraggableHeaderGroupRows;
@@ -15,6 +15,6 @@ type HeaderCellProps<T> = {
15
15
  loading: boolean;
16
16
  resetAllFilters: boolean;
17
17
  };
18
- export declare const HeaderCell: <T>({ defaultGrouping, dragAttributes, dragListeners, dragRef, dragTransform, dragTransition, header, isDragOver, isDragging, isReorderable, loading, resetAllFilters, }: HeaderCellProps<T>) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const HeaderCell: <T>({ dragAttributes, dragListeners, dragRef, dragTransform, dragTransition, header, isDragOver, isDragging, isReorderable, loading, resetAllFilters, }: HeaderCellProps<T>) => import("react/jsx-runtime").JSX.Element;
19
19
  export {};
20
20
  //# sourceMappingURL=HeaderCell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderCell.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/HeaderCells/HeaderCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAIpD,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,uBAAuB,CAAC;AAQhE,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,eAAe,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,KAAK,IAAI,CAAC;IACtD,aAAa,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,EAAG,sKAa5B,eAAe,CAAC,CAAC,CAAC,4CA6KpB,CAAC"}
1
+ {"version":3,"file":"HeaderCell.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/HeaderCells/HeaderCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,uBAAuB,CAAC;AAKhE,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,eAAe,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,KAAK,IAAI,CAAC;IACtD,aAAa,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,EAAG,qJAY5B,eAAe,CAAC,CAAC,CAAC,4CAqLpB,CAAC"}
@@ -1,29 +1,19 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.HeaderCell = void 0;
7
4
  const jsx_runtime_1 = require("react/jsx-runtime");
8
5
  const utilities_1 = require("@dnd-kit/utilities");
9
- const DragIndicator_1 = __importDefault(require("@mui/icons-material/DragIndicator"));
10
6
  const material_1 = require("@mui/material");
11
7
  const react_table_1 = require("@tanstack/react-table");
12
- const Tooltip_1 = require("../../../Tooltip");
13
- const useGetGroupedColumn_1 = require("../../hooks/useGetGroupedColumn");
14
8
  const useGetSortedColumn_1 = require("../../hooks/useGetSortedColumn");
15
9
  const FacetedFilter_1 = require("../FacetedFilter/FacetedFilter");
16
- const GroupingIcons_1 = require("./GroupingIcons");
17
- const HeaderCell = ({ defaultGrouping, dragAttributes, dragListeners, dragRef, dragTransform, dragTransition, header, isDragOver = false, isDragging = false, isReorderable = false, loading = false, resetAllFilters, }) => {
10
+ const HeaderCell = ({ dragAttributes, dragListeners, dragRef, dragTransform, dragTransition, header, isDragOver = false, isDragging = false, isReorderable = false, loading = false, resetAllFilters, }) => {
18
11
  const theme = (0, material_1.useTheme)();
19
12
  const { butterflyBlue, iron, slate } = theme.palette.app.color;
20
13
  const { isSortable, mutipleSortCounts, sortableIcon } = (0, useGetSortedColumn_1.useGetSortedColumn)({
21
14
  header,
22
15
  });
23
- const { groupedIndex, isGroupable, isGrouped } = (0, useGetGroupedColumn_1.useGetGroupedColumn)({
24
- header,
25
- });
26
- const { columnDef, getAfter, getCanResize, getIsPinned, getSize, getStart, getToggleGroupingHandler, getToggleSortingHandler, } = header.column;
16
+ const { columnDef, getAfter, getCanResize, getIsPinned, getSize, getStart, getToggleSortingHandler, } = header.column;
27
17
  const showFacetedFilter = columnDef?.facetedFilter;
28
18
  const isSmartSelectFilter = columnDef?.filterVariant === "smartSelectFilter";
29
19
  const headerDynamicWidth = getIsPinned() ? getSize() - 8 : getSize();
@@ -33,6 +23,39 @@ const HeaderCell = ({ defaultGrouping, dragAttributes, dragListeners, dragRef, d
33
23
  const backgroundColor = isReorderable && isDragOver ? slate[700] : slate[800];
34
24
  const draggableAttributes = dragAttributes ?? {};
35
25
  const draggableListeners = dragListeners ?? {};
26
+ const manageZIndex = () => {
27
+ if (isDragging) {
28
+ return 20;
29
+ }
30
+ if (getIsPinned()) {
31
+ return 3;
32
+ }
33
+ return 1;
34
+ };
35
+ const handleHeaderCellClick = (e) => {
36
+ if (isDragging) {
37
+ return;
38
+ }
39
+ // React event target is EventTarget; assert HTMLElement for style/cursor access
40
+ const target = e.target;
41
+ // Ignore clicks on the resize handle to avoid triggering sort when resizing
42
+ if (target && target.style.cursor === "col-resize") {
43
+ return;
44
+ }
45
+ // Ignore clicks within the FacetedFilter popover to avoid triggering sort when interacting with filter
46
+ if (target?.closest("[data-faceted-filter-popover='true']")) {
47
+ return;
48
+ }
49
+ if (isSortable && !loading) {
50
+ getToggleSortingHandler()?.(e);
51
+ }
52
+ };
53
+ const handleCursorPointer = () => {
54
+ if (isReorderable && !loading && header.id !== "grouped_by") {
55
+ return isDragging ? "grabbing" : "grab";
56
+ }
57
+ return isSortable ? "pointer" : "default";
58
+ };
36
59
  return ((0, jsx_runtime_1.jsxs)("th", { colSpan: header.colSpan, "data-column-id": header.id, ref: dragRef, style: {
37
60
  backgroundColor,
38
61
  borderBottom: `1px solid ${iron[700]}`,
@@ -48,21 +71,22 @@ const HeaderCell = ({ defaultGrouping, dragAttributes, dragListeners, dragRef, d
48
71
  transform: transformStyle,
49
72
  transition: dragTransition,
50
73
  width: headerDynamicWidth,
51
- zIndex: getIsPinned() ? 3 : 1,
52
- }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
74
+ zIndex: manageZIndex(),
75
+ }, onClick: handleHeaderCellClick, children: [(0, jsx_runtime_1.jsxs)("div", { ...(isReorderable && !loading && header.id !== "grouped_by"
76
+ ? draggableAttributes
77
+ : {}), ...(isReorderable && !loading && header.id !== "grouped_by"
78
+ ? draggableListeners
79
+ : {}), style: {
53
80
  alignItems: "center",
54
81
  borderRight: `2px solid ${iron[700]}`,
55
82
  display: "flex",
56
83
  flexGrow: 1,
57
84
  gap: "8px",
58
- }, children: [isReorderable && !loading && ((0, jsx_runtime_1.jsx)("span", { ...draggableAttributes, ...draggableListeners, style: {
59
- alignItems: "center",
60
- color: iron[400],
61
- cursor: isDragging ? "grabbing" : "grab",
62
- display: "flex",
63
- paddingRight: "2px",
64
- touchAction: "none",
65
- }, children: (0, jsx_runtime_1.jsx)(DragIndicator_1.default, { fontSize: "small" }) })), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", { style: {
85
+ cursor: handleCursorPointer(),
86
+ touchAction: isReorderable && !loading && header.id !== "grouped_by"
87
+ ? "none"
88
+ : "auto",
89
+ }, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", { style: {
66
90
  color: iron[400],
67
91
  fontFamily: "Poppins",
68
92
  fontSize: "14px",
@@ -72,11 +96,7 @@ const HeaderCell = ({ defaultGrouping, dragAttributes, dragListeners, dragRef, d
72
96
  textOverflow: "ellipsis",
73
97
  textWrap: "nowrap",
74
98
  }, children: !header.isPlaceholder &&
75
- (0, react_table_1.flexRender)(columnDef.header, header.getContext()) }) }), showFacetedFilter && !loading && !isSmartSelectFilter && ((0, jsx_runtime_1.jsx)(FacetedFilter_1.FacetedFilter, { header: header, resetAllFilters: resetAllFilters })), isSortable && !loading && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: "Sorting", children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { sx: { padding: 0 }, onClick: getToggleSortingHandler(), children: sortableIcon }), isSortable && mutipleSortCounts > 0 && ((0, jsx_runtime_1.jsxs)(material_1.Typography, { color: iron[400], variant: "caption", children: ["(", mutipleSortCounts + 1, ")"] }))] }) })), isGroupable && !defaultGrouping?.length && !loading && ((0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: getToggleGroupingHandler(),
76
- style: {
77
- cursor: "pointer",
78
- padding: 0,
79
- }, children: (0, jsx_runtime_1.jsx)(GroupingIcons_1.GroupingIcons, { groupedIndex: groupedIndex, isGrouped: isGrouped, loading: loading }) }))] }), getCanResize() && !loading && ((0, jsx_runtime_1.jsx)("div", { style: {
99
+ (0, react_table_1.flexRender)(columnDef.header, header.getContext()) }) }), showFacetedFilter && !loading && !isSmartSelectFilter && ((0, jsx_runtime_1.jsx)(FacetedFilter_1.FacetedFilter, { header: header, resetAllFilters: resetAllFilters })), isSortable && !loading && ((0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "row", alignItems: "center", children: [sortableIcon, isSortable && mutipleSortCounts > 0 && ((0, jsx_runtime_1.jsxs)(material_1.Typography, { color: iron[400], variant: "caption", children: ["(", mutipleSortCounts + 1, ")"] }))] }))] }), getCanResize() && !loading && ((0, jsx_runtime_1.jsx)("div", { style: {
80
100
  background: "transparent",
81
101
  cursor: "col-resize",
82
102
  height: "100%",
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../../../../src/SmartGrid/Components/SearchFilterRow/DateRangeInput/DateRangeInput.tsx"],"names":[],"mappings":"AAmBA,KAAK,mBAAmB,GAAG;IACzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAYF,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CA0LrB,CAAC"}
1
+ {"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../../../../src/SmartGrid/Components/SearchFilterRow/DateRangeInput/DateRangeInput.tsx"],"names":[],"mappings":"AAmBA,KAAK,mBAAmB,GAAG;IACzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAYF,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAyLrB,CAAC"}
@@ -103,7 +103,7 @@ const DateRangeInput = ({ initialValue, onApply, width, }) => {
103
103
  margin: 0,
104
104
  },
105
105
  "& .MuiInputBase-input": {
106
- fontSize: "13px",
106
+ fontSize: "14px",
107
107
  height: "10px",
108
108
  padding: "4px 4px",
109
109
  },
@@ -12,7 +12,7 @@ const StyleDateRangeWrapper = ({ children, }) => {
12
12
  display: none;
13
13
  }
14
14
  .inline-date-range .rdrMonthAndYearWrapper {
15
- padding: 10px 12px !important;
15
+ padding: 10px 12px;
16
16
  background: white;
17
17
  height: auto;
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GetRenderInputs.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/SearchFilterRow/GetRenderInputs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAMpD,KAAK,oBAAoB,CAAC,CAAC,IAAI;IAC7B,aAAa,CAAC,EACV,iBAAiB,GACjB,mBAAmB,GACnB,iBAAiB,GACjB,mBAAmB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,6CAIjC,oBAAoB,CAAC,CAAC,CAAC,mDA+HzB,CAAC"}
1
+ {"version":3,"file":"GetRenderInputs.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/SearchFilterRow/GetRenderInputs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAKpD,KAAK,oBAAoB,CAAC,CAAC,IAAI;IAC7B,aAAa,CAAC,EACV,iBAAiB,GACjB,mBAAmB,GACnB,iBAAiB,GACjB,mBAAmB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,6CAIjC,oBAAoB,CAAC,CAAC,CAAC,mDA+HzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchFilterRow.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/SearchFilterRow/SearchFilterRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAKpD,KAAK,oBAAoB,CAAC,CAAC,IAAI;IAC7B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,8BAGjC,oBAAoB,CAAC,CAAC,CAAC,4CA+CzB,CAAC"}
1
+ {"version":3,"file":"SearchFilterRow.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/SearchFilterRow/SearchFilterRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAIpD,KAAK,oBAAoB,CAAC,CAAC,IAAI;IAC7B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,8BAGjC,oBAAoB,CAAC,CAAC,CAAC,4CA+CzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableFooterComponent.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/TableFooterComponent/TableFooterComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAQ,aAAa,EAAE,MAAM,aAAa,CAAC;AAIvD,KAAK,gBAAgB,CAAC,CAAC,IAAI;IACzB,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,EACtC,OAAO,EACP,KAAK,GACN,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,2CAoD/B"}
1
+ {"version":3,"file":"TableFooterComponent.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/TableFooterComponent/TableFooterComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAQ,aAAa,EAAE,MAAM,aAAa,CAAC;AAGvD,KAAK,gBAAgB,CAAC,CAAC,IAAI;IACzB,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,EACtC,OAAO,EACP,KAAK,GACN,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,2CAoD/B"}
@@ -1,4 +1,4 @@
1
- import { type Row } from "@tanstack/react-table";
1
+ import type { GroupingState, Row } from "@tanstack/react-table";
2
2
  import type { VirtualItem } from "@tanstack/react-virtual";
3
3
  import type { SummaryRecord } from "../types";
4
4
  type TableRowComponentProps<T> = {
@@ -8,6 +8,7 @@ type TableRowComponentProps<T> = {
8
8
  onClick: () => void;
9
9
  }>;
10
10
  exportData?: boolean;
11
+ grouping?: GroupingState;
11
12
  index: number;
12
13
  isSummaryRow?: boolean;
13
14
  row: Row<T>;
@@ -15,6 +16,6 @@ type TableRowComponentProps<T> = {
15
16
  summaryData?: SummaryRecord<T>;
16
17
  virtualRow: VirtualItem;
17
18
  };
18
- export declare const TableRowComponent: <T>({ columnWidths, exportActions, exportData, index, isSummaryRow, row, rowHeight, summaryData, virtualRow, }: TableRowComponentProps<T>) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const TableRowComponent: <T>({ columnWidths, exportActions, exportData, grouping, index, isSummaryRow, row, rowHeight, summaryData, virtualRow, }: TableRowComponentProps<T>) => import("react/jsx-runtime").JSX.Element;
19
20
  export {};
20
21
  //# sourceMappingURL=TableRowComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableRowComponent.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/Components/TableRowComponent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAO3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,KAAK,sBAAsB,CAAC,CAAC,IAAI;IAC/B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC/B,UAAU,EAAE,WAAW,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAG,4GAUnC,sBAAsB,CAAC,CAAC,CAAC,4CAmP3B,CAAC"}
1
+ {"version":3,"file":"TableRowComponent.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/Components/TableRowComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAO3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,KAAK,sBAAsB,CAAC,CAAC,IAAI;IAC/B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAC/B,UAAU,EAAE,WAAW,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAG,sHAWnC,sBAAsB,CAAC,CAAC,CAAC,4CA+Q3B,CAAC"}