pixelize-design-library 2.2.199 → 2.3.1-beta.10

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 (163) hide show
  1. package/.claude/settings.local.json +44 -0
  2. package/coverage/clover.xml +638 -0
  3. package/coverage/coverage-final.json +20 -0
  4. package/coverage/lcov-report/Table/CompactSelect.tsx.html +379 -0
  5. package/coverage/lcov-report/Table/Components/ActiveFilters.tsx.html +514 -0
  6. package/coverage/lcov-report/Table/Components/HeaderActions.tsx.html +373 -0
  7. package/coverage/lcov-report/Table/Components/Pagination.tsx.html +574 -0
  8. package/coverage/lcov-report/Table/Components/TableActions.tsx.html +574 -0
  9. package/coverage/lcov-report/Table/Components/TableBody.tsx.html +1027 -0
  10. package/coverage/lcov-report/Table/Components/TableFilters.tsx.html +397 -0
  11. package/coverage/lcov-report/Table/Components/TableHeader.tsx.html +1060 -0
  12. package/coverage/lcov-report/Table/Components/TableLoading.tsx.html +361 -0
  13. package/coverage/lcov-report/Table/Components/TableSearch.tsx.html +337 -0
  14. package/coverage/lcov-report/Table/Components/index.html +266 -0
  15. package/coverage/lcov-report/Table/Components/useDebounce.ts.html +178 -0
  16. package/coverage/lcov-report/Table/Components/useTable.ts.html +778 -0
  17. package/coverage/lcov-report/Table/LeftFilterPane.tsx.html +1810 -0
  18. package/coverage/lcov-report/Table/SelectOperationControls.tsx.html +178 -0
  19. package/coverage/lcov-report/Table/Table.tsx.html +1567 -0
  20. package/coverage/lcov-report/Table/TableProps.tsx.html +658 -0
  21. package/coverage/lcov-report/Table/TableSettings/ManageColumns.tsx.html +619 -0
  22. package/coverage/lcov-report/Table/TableSettings/TableFilters.tsx.html +229 -0
  23. package/coverage/lcov-report/Table/TableSettings/TableSettings.tsx.html +532 -0
  24. package/coverage/lcov-report/Table/TableSettings/index.html +146 -0
  25. package/coverage/lcov-report/Table/TableToDo.tsx.html +973 -0
  26. package/coverage/lcov-report/Table/TextOperationControls.tsx.html +271 -0
  27. package/coverage/lcov-report/Table/filterTypes.ts.html +97 -0
  28. package/coverage/lcov-report/Table/index.html +176 -0
  29. package/coverage/lcov-report/base.css +224 -0
  30. package/coverage/lcov-report/block-navigation.js +87 -0
  31. package/coverage/lcov-report/favicon.png +0 -0
  32. package/coverage/lcov-report/index.html +146 -0
  33. package/coverage/lcov-report/prettify.css +1 -0
  34. package/coverage/lcov-report/prettify.js +2 -0
  35. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  36. package/coverage/lcov-report/sorter.js +210 -0
  37. package/coverage/lcov.info +1836 -0
  38. package/dist/Assets/defaultLogo.tsx +31 -0
  39. package/dist/Components/Accordion/Accordion.js +26 -5
  40. package/dist/Components/Button/Button.styles.js +44 -3
  41. package/dist/Components/Button/ButtonProps.d.ts +1 -1
  42. package/dist/Components/ButtonGroupIcon/ButtonGoupIconProps.d.ts +2 -2
  43. package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +50 -38
  44. package/dist/Components/Card/PaymentCard/PaymentCard.d.ts +1 -1
  45. package/dist/Components/Card/PaymentCard/PaymentCard.js +3 -3
  46. package/dist/Components/Card/PaymentCard/PaymentCardProps.d.ts +0 -1
  47. package/dist/Components/Checkbox/Checkbox.js +2 -2
  48. package/dist/Components/Checkbox/Checkbox.styles.js +2 -0
  49. package/dist/Components/Common/FormLabel.d.ts +2 -1
  50. package/dist/Components/Common/FormLabel.js +8 -9
  51. package/dist/Components/Common/fieldStyles.d.ts +22 -0
  52. package/dist/Components/Common/fieldStyles.js +42 -0
  53. package/dist/Components/DatePicker/CalendarPanel.d.ts +2 -0
  54. package/dist/Components/DatePicker/CalendarPanel.js +104 -65
  55. package/dist/Components/DatePicker/RangeDatePicker.js +37 -16
  56. package/dist/Components/DatePicker/SingleDatePicker.js +16 -16
  57. package/dist/Components/DatePicker/TimePicker.js +4 -4
  58. package/dist/Components/Input/Input/Input.d.ts +1 -1
  59. package/dist/Components/Input/Input/Input.js +5 -4
  60. package/dist/Components/Input/Input/InputProps.d.ts +2 -0
  61. package/dist/Components/Input/TextInput.styles.js +2 -1
  62. package/dist/Components/InputTextArea/InputTextArea.style.js +2 -1
  63. package/dist/Components/KanbanBoard/AccountCard.js +17 -14
  64. package/dist/Components/KanbanBoard/KanbanBoard.js +93 -78
  65. package/dist/Components/MultiSelect/MultiSelect.js +11 -12
  66. package/dist/Components/NavigationBar/NavigationBar.d.ts +1 -1
  67. package/dist/Components/NavigationBar/NavigationBar.js +57 -30
  68. package/dist/Components/NavigationBar/NavigationBarProps.d.ts +1 -0
  69. package/dist/Components/NoteTextArea/NoteTextArea.js +44 -40
  70. package/dist/Components/NumberInput/NumberInput.styles.js +2 -1
  71. package/dist/Components/PinInput/PinInput.d.ts +1 -1
  72. package/dist/Components/PinInput/PinInput.js +3 -2
  73. package/dist/Components/PinInput/PinInputProps.d.ts +4 -0
  74. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +1 -1
  75. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +42 -24
  76. package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.d.ts +2 -0
  77. package/dist/Components/RadioButton/RadioButton.js +1 -1
  78. package/dist/Components/SearchSelect/SearchSelect.d.ts +1 -1
  79. package/dist/Components/SearchSelect/SearchSelect.js +56 -24
  80. package/dist/Components/SearchSelect/SearchSelectProps.d.ts +2 -0
  81. package/dist/Components/Select/Select.styles.js +2 -1
  82. package/dist/Components/SelectSearch/SelectSearch.js +7 -4
  83. package/dist/Components/SideBar/SecondaryBar.js +20 -18
  84. package/dist/Components/SideBar/SideBar.d.ts +1 -1
  85. package/dist/Components/SideBar/SideBar.js +58 -43
  86. package/dist/Components/SideBar/SideBarProps.d.ts +14 -3
  87. package/dist/Components/SideBar/components/MenuItemBox.js +28 -24
  88. package/dist/Components/SideBar/components/MenuItems.js +16 -2
  89. package/dist/Components/SideBar/components/MenuPopoverContent.js +16 -16
  90. package/dist/Components/SideBar/components/OtherApps.js +16 -14
  91. package/dist/Components/Table/Table.d.ts +1 -1
  92. package/dist/Components/Table/Table.js +234 -38
  93. package/dist/Components/Table/TableProps.d.ts +42 -2
  94. package/dist/Components/Table/{Components → components}/TableActions.d.ts +2 -2
  95. package/dist/Components/Table/{Components → components}/TableActions.js +5 -4
  96. package/dist/Components/Table/{Components → components}/TableBody.d.ts +5 -1
  97. package/dist/Components/Table/components/TableBody.js +369 -0
  98. package/dist/Components/Table/components/TableGroupRow.d.ts +15 -0
  99. package/dist/Components/Table/components/TableGroupRow.js +27 -0
  100. package/dist/Components/Table/{Components → components}/TableHeader.js +18 -8
  101. package/dist/Components/Table/{LeftFilterPane.js → filters/LeftFilterPane.js} +3 -3
  102. package/dist/Components/Table/{Components → hooks}/useTable.d.ts +1 -1
  103. package/dist/Components/Table/{Components → hooks}/useTable.js +8 -7
  104. package/dist/Components/Table/settings/TableSettings.d.ts +11 -0
  105. package/dist/Components/Table/settings/TableSettings.js +165 -0
  106. package/dist/Components/Timeline/Timeline.d.ts +1 -1
  107. package/dist/Components/Timeline/Timeline.js +145 -78
  108. package/dist/Components/Toaster/Toaster.js +40 -20
  109. package/dist/Theme/Default/palette.d.ts +4 -0
  110. package/dist/Theme/Default/palette.js +3 -0
  111. package/dist/Theme/Emerald/palette.d.ts +4 -0
  112. package/dist/Theme/Emerald/palette.js +2 -1
  113. package/dist/Theme/Meadow/palette.d.ts +4 -0
  114. package/dist/Theme/Meadow/palette.js +2 -1
  115. package/dist/Theme/Radiant/palette.d.ts +4 -0
  116. package/dist/Theme/Radiant/palette.js +2 -1
  117. package/dist/Theme/Rosewood/palette.d.ts +4 -0
  118. package/dist/Theme/Rosewood/palette.js +2 -1
  119. package/dist/Theme/Skyline/palette.d.ts +4 -0
  120. package/dist/Theme/Skyline/palette.js +2 -1
  121. package/dist/Theme/Slate/palette.d.ts +4 -0
  122. package/dist/Theme/Slate/palette.js +2 -1
  123. package/dist/Theme/themeProps.d.ts +4 -0
  124. package/dist/Utils/table.d.ts +26 -0
  125. package/dist/Utils/table.js +142 -38
  126. package/package.json +2 -2
  127. package/dist/Components/Table/Components/TableBody.js +0 -201
  128. package/dist/Components/Table/TableSettings/TableFilters.d.ts +0 -10
  129. package/dist/Components/Table/TableSettings/TableFilters.js +0 -69
  130. package/dist/Components/Table/TableSettings/TableFilters.test.d.ts +0 -1
  131. package/dist/Components/Table/TableSettings/TableFilters.test.js +0 -109
  132. package/dist/Components/Table/TableSettings/TableSettings.d.ts +0 -8
  133. package/dist/Components/Table/TableSettings/TableSettings.js +0 -141
  134. package/dist/Components/Table/TableToDo.d.ts +0 -2
  135. package/dist/Components/Table/TableToDo.js +0 -291
  136. /package/dist/Components/Table/{Components → components}/HeaderActions.d.ts +0 -0
  137. /package/dist/Components/Table/{Components → components}/HeaderActions.js +0 -0
  138. /package/dist/Components/Table/{Components → components}/Pagination.d.ts +0 -0
  139. /package/dist/Components/Table/{Components → components}/Pagination.js +0 -0
  140. /package/dist/Components/Table/{Components → components}/TableBody.virtualize.test.d.ts +0 -0
  141. /package/dist/Components/Table/{Components → components}/TableBody.virtualize.test.js +0 -0
  142. /package/dist/Components/Table/{Components → components}/TableHeader.d.ts +0 -0
  143. /package/dist/Components/Table/{Components → components}/TableLoading.d.ts +0 -0
  144. /package/dist/Components/Table/{Components → components}/TableLoading.js +0 -0
  145. /package/dist/Components/Table/{Components → components}/TableSearch.d.ts +0 -0
  146. /package/dist/Components/Table/{Components → components}/TableSearch.js +0 -0
  147. /package/dist/Components/Table/{Components → filters}/ActiveFilters.d.ts +0 -0
  148. /package/dist/Components/Table/{Components → filters}/ActiveFilters.js +0 -0
  149. /package/dist/Components/Table/{CompactSelect.d.ts → filters/CompactSelect.d.ts} +0 -0
  150. /package/dist/Components/Table/{CompactSelect.js → filters/CompactSelect.js} +0 -0
  151. /package/dist/Components/Table/{LeftFilterPane.d.ts → filters/LeftFilterPane.d.ts} +0 -0
  152. /package/dist/Components/Table/{SelectOperationControls.d.ts → filters/SelectOperationControls.d.ts} +0 -0
  153. /package/dist/Components/Table/{SelectOperationControls.js → filters/SelectOperationControls.js} +0 -0
  154. /package/dist/Components/Table/{Components → filters}/TableFilters.d.ts +0 -0
  155. /package/dist/Components/Table/{Components → filters}/TableFilters.js +0 -0
  156. /package/dist/Components/Table/{TextOperationControls.d.ts → filters/TextOperationControls.d.ts} +0 -0
  157. /package/dist/Components/Table/{TextOperationControls.js → filters/TextOperationControls.js} +0 -0
  158. /package/dist/Components/Table/{Components → hooks}/useDebounce.d.ts +0 -0
  159. /package/dist/Components/Table/{Components → hooks}/useDebounce.js +0 -0
  160. /package/dist/Components/Table/{TableSettings → settings}/ManageColumns.d.ts +0 -0
  161. /package/dist/Components/Table/{TableSettings → settings}/ManageColumns.js +0 -0
  162. /package/dist/Components/Table/{TableSettings → settings}/ManageColumns.test.d.ts +0 -0
  163. /package/dist/Components/Table/{TableSettings → settings}/ManageColumns.test.js +0 -0
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
14
  if (k2 === undefined) k2 = k;
4
15
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -32,6 +43,15 @@ var __importStar = (this && this.__importStar) || (function () {
32
43
  return result;
33
44
  };
34
45
  })();
46
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
47
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
48
+ if (ar || !(i in from)) {
49
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
50
+ ar[i] = from[i];
51
+ }
52
+ }
53
+ return to.concat(ar || Array.prototype.slice.call(from));
54
+ };
35
55
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
56
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
57
  };
@@ -41,46 +61,47 @@ var react_1 = __importStar(require("react"));
41
61
  var react_2 = require("@chakra-ui/react");
42
62
  var react_3 = require("@chakra-ui/react");
43
63
  var framer_motion_1 = require("framer-motion");
44
- var LeftFilterPane_1 = __importDefault(require("./LeftFilterPane"));
45
- var Pagination_1 = __importDefault(require("./Components/Pagination"));
46
- var TableHeader_1 = __importDefault(require("./Components/TableHeader"));
47
- var TableBody_1 = __importDefault(require("./Components/TableBody"));
64
+ var LeftFilterPane_1 = __importDefault(require("./filters/LeftFilterPane"));
65
+ var Pagination_1 = __importDefault(require("./components/Pagination"));
66
+ var TableHeader_1 = __importDefault(require("./components/TableHeader"));
67
+ var TableBody_1 = __importDefault(require("./components/TableBody"));
48
68
  var useCustomTheme_1 = require("../../Theme/useCustomTheme");
49
- var useTable_1 = __importDefault(require("./Components/useTable"));
69
+ var useTable_1 = __importDefault(require("./hooks/useTable"));
50
70
  var table_1 = require("../../Utils/table");
51
71
  var usePreferences_1 = require("../../Hooks/usePreferences");
52
- var TableSettings_1 = __importDefault(require("./TableSettings/TableSettings"));
53
- var HeaderActions_1 = __importDefault(require("./Components/HeaderActions"));
72
+ var TableSettings_1 = __importDefault(require("./settings/TableSettings"));
73
+ var HeaderActions_1 = __importDefault(require("./components/HeaderActions"));
54
74
  var Divider_1 = __importDefault(require("../Divider/Divider"));
55
- var TableSearch_1 = __importDefault(require("./Components/TableSearch"));
56
- var ActiveFilters_1 = __importDefault(require("./Components/ActiveFilters"));
75
+ var TableSearch_1 = __importDefault(require("./components/TableSearch"));
76
+ var ActiveFilters_1 = __importDefault(require("./filters/ActiveFilters"));
77
+ var Button_1 = __importDefault(require("../Button/Button"));
57
78
  var lucide_react_1 = require("lucide-react");
58
79
  var MotionBox = (0, framer_motion_1.motion)(react_2.Box);
59
80
  function Table(_a) {
60
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
61
- var data = _a.data, columns = _a.columns, onSelection = _a.onSelection, isLoading = _a.isLoading, _0 = _a.isCheckbox, isCheckbox = _0 === void 0 ? false : _0, headerBgColor = _a.headerBgColor, freezedBgColor = _a.freezedBgColor, headerTextColor = _a.headerTextColor, freezedTextColor = _a.freezedTextColor, tableBorderColor = _a.tableBorderColor, _1 = _a.noBorders, noBorders = _1 === void 0 ? false : _1, _2 = _a.isPagination, isPagination = _2 === void 0 ? true : _2, onRowClick = _a.onRowClick, selections = _a.selections, _3 = _a.isActionFreeze, isActionFreeze = _3 === void 0 ? true : _3, _4 = _a.preferences, preferences = _4 === void 0 ? {
81
+ var _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;
82
+ var data = _a.data, columns = _a.columns, onSelection = _a.onSelection, isLoading = _a.isLoading, _14 = _a.isCheckbox, isCheckbox = _14 === void 0 ? false : _14, headerBgColor = _a.headerBgColor, freezedBgColor = _a.freezedBgColor, headerTextColor = _a.headerTextColor, freezedTextColor = _a.freezedTextColor, tableBorderColor = _a.tableBorderColor, _15 = _a.noBorders, noBorders = _15 === void 0 ? false : _15, _16 = _a.isPagination, isPagination = _16 === void 0 ? true : _16, onRowClick = _a.onRowClick, selections = _a.selections, _17 = _a.isActionFreeze, isActionFreeze = _17 === void 0 ? true : _17, _18 = _a.preferences, preferences = _18 === void 0 ? {
62
83
  url: "",
63
84
  token: "",
64
85
  key: "",
65
86
  name: "",
66
87
  page: "",
67
88
  orgId: "",
68
- } : _4, _5 = _a.paginationMode, paginationMode = _5 === void 0 ? "client" : _5, _6 = _a.noOfRowsPerPage, noOfRowsPerPage = _6 === void 0 ? 50 : _6, _7 = _a.totalRecords, totalRecords = _7 === void 0 ? 0 : _7, onPagination = _a.onPagination, _8 = _a.isTableSettings, isTableSettings = _8 === void 0 ? false : _8, headerActions = _a.headerActions, onGlobalSearch = _a.onGlobalSearch, onNoOfRowsPerPageChange = _a.onNoOfRowsPerPageChange, paginationSelectOptions = _a.paginationSelectOptions, tableMaxHeight = _a.tableMaxHeight, minVisibleRows = _a.minVisibleRows, maxVisibleRows = _a.maxVisibleRows, autoFitViewport = _a.autoFitViewport, tableSettings = _a.tableSettings, filterSidebar = _a.filterSidebar, loadingSkeletonRows = _a.loadingSkeletonRows, defaultVisibleColumns = _a.defaultVisibleColumns;
89
+ } : _18, _19 = _a.paginationMode, paginationMode = _19 === void 0 ? "client" : _19, _20 = _a.infiniteScroll, infiniteScroll = _20 === void 0 ? false : _20, hasMore = _a.hasMore, _21 = _a.isLoadingMore, isLoadingMore = _21 === void 0 ? false : _21, _22 = _a.groupLoadMore, groupLoadMore = _22 === void 0 ? false : _22, _23 = _a.loadMoreText, loadMoreText = _23 === void 0 ? "Load more" : _23, _24 = _a.loadMorePosition, loadMorePosition = _24 === void 0 ? "top" : _24, loadMoreChunkSize = _a.loadMoreChunkSize, _25 = _a.noOfRowsPerPage, noOfRowsPerPage = _25 === void 0 ? 50 : _25, _26 = _a.totalRecords, totalRecords = _26 === void 0 ? 0 : _26, onPagination = _a.onPagination, _27 = _a.isTableSettings, isTableSettings = _27 === void 0 ? false : _27, headerActions = _a.headerActions, onGlobalSearch = _a.onGlobalSearch, onNoOfRowsPerPageChange = _a.onNoOfRowsPerPageChange, paginationSelectOptions = _a.paginationSelectOptions, tableMaxHeight = _a.tableMaxHeight, minVisibleRows = _a.minVisibleRows, maxVisibleRows = _a.maxVisibleRows, autoFitViewport = _a.autoFitViewport, tableSettings = _a.tableSettings, filterSidebar = _a.filterSidebar, loadingSkeletonRows = _a.loadingSkeletonRows, defaultVisibleColumns = _a.defaultVisibleColumns, _28 = _a.density, density = _28 === void 0 ? "normal" : _28, stripe = _a.stripe, groupColors = _a.groupColors, onAddItem = _a.onAddItem, emptyState = _a.emptyState;
69
90
  var theme = (0, useCustomTheme_1.useCustomTheme)();
70
- var _9 = (0, react_1.useState)({}), columnsSearch = _9[0], setColumnsSearch = _9[1];
91
+ var _29 = (0, react_1.useState)({}), columnsSearch = _29[0], setColumnsSearch = _29[1];
71
92
  var tableContainerRef = (0, react_1.useRef)(null);
72
- var _10 = (0, react_2.useDisclosure)(), isFilterModalOpen = _10.isOpen, onFilterModalOpen = _10.onOpen, onFilterModalClose = _10.onClose;
93
+ var _30 = (0, react_2.useDisclosure)(), isFilterModalOpen = _30.isOpen, onFilterModalOpen = _30.onOpen, onFilterModalClose = _30.onClose;
73
94
  var filterMode = (_b = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.filterMode) !== null && _b !== void 0 ? _b : "sidebar";
74
- var _11 = (0, react_1.useState)(500), viewportAvailableH = _11[0], setViewportAvailableH = _11[1];
95
+ var _31 = (0, react_1.useState)(500), viewportAvailableH = _31[0], setViewportAvailableH = _31[1];
75
96
  var isServerPagination = paginationMode === "server";
76
- var _12 = (0, usePreferences_1.useGetPreferences)({
97
+ var _32 = (0, usePreferences_1.useGetPreferences)({
77
98
  baseUrl: preferences.url,
78
99
  page: preferences.page,
79
100
  key: preferences.key,
80
101
  name: preferences.name,
81
102
  authToken: preferences.token,
82
103
  orgId: preferences.orgId,
83
- }), tablePreferencesData = _12.preferences, loading = _12.loading;
104
+ }), tablePreferencesData = _32.preferences, loading = _32.loading;
84
105
  var savePreferences = (0, usePreferences_1.useSavePreferences)({
85
106
  baseUrl: preferences.url,
86
107
  page: preferences.page,
@@ -98,7 +119,7 @@ function Table(_a) {
98
119
  }
99
120
  return {};
100
121
  }, [tablePreferencesData]);
101
- var _13 = (0, useTable_1.default)({
122
+ var _33 = (0, useTable_1.default)({
102
123
  tableBorderColor: tableBorderColor,
103
124
  data: data,
104
125
  isPagination: isPagination,
@@ -112,10 +133,116 @@ function Table(_a) {
112
133
  isServerPagination: isServerPagination,
113
134
  onNoOfRowsPerPageChange: onNoOfRowsPerPageChange,
114
135
  defaultVisibleColumns: defaultVisibleColumns,
115
- }), tableData = _13.tableData, isContent = _13.isContent, isLink = _13.isLink, headerRefs = _13.headerRefs, columnWidths = _13.columnWidths, handleSort = _13.handleSort, handleCheckbox = _13.handleCheckbox, filteredData = _13.filteredData, startRow = _13.startRow, endRow = _13.endRow, selection = _13.selection, columnsSort = _13.columnsSort, currentPage = _13.currentPage, pages = _13.pages, rowsPerPage = _13.rowsPerPage, handlePageSizeChange = _13.handlePageSizeChange, setCurrentPage = _13.setCurrentPage, columnsList = _13.columnsList, handleColumnPreferences = _13.handleColumnPreferences, isSelecting = _13.isSelecting;
136
+ }), tableData = _33.tableData, isContent = _33.isContent, isLink = _33.isLink, headerRefs = _33.headerRefs, columnWidths = _33.columnWidths, handleSort = _33.handleSort, handleCheckbox = _33.handleCheckbox, filteredData = _33.filteredData, startRow = _33.startRow, endRow = _33.endRow, selection = _33.selection, columnsSort = _33.columnsSort, currentPage = _33.currentPage, pages = _33.pages, rowsPerPage = _33.rowsPerPage, handlePageSizeChange = _33.handlePageSizeChange, setCurrentPage = _33.setCurrentPage, columnsList = _33.columnsList, handleColumnPreferences = _33.handleColumnPreferences, isSelecting = _33.isSelecting;
137
+ // Density + grouping are managed here so the Table Settings tabs can change +
138
+ // persist them (seeded from the prop / saved preferences when they load).
139
+ var _34 = (0, react_1.useState)(density), densityState = _34[0], setDensityState = _34[1];
140
+ // Grouping is chosen by the user in Table Settings > Group and persisted to
141
+ // preferences (`json.groupBy`); there is no `groupBy` prop.
142
+ var _35 = (0, react_1.useState)(undefined), groupByState = _35[0], setGroupByState = _35[1];
143
+ // Grouped "Load more" accumulates pages here so loading more ADDS rows to the
144
+ // groups (server pagination replaces `data` each fetch). Reset on fresh loads
145
+ // (search / filter / sort / page-size). Only used in grouped + groupLoadMore mode.
146
+ var _36 = (0, react_1.useState)([]), accumulatedRows = _36[0], setAccumulatedRows = _36[1];
147
+ var pendingLoadMoreRef = (0, react_1.useRef)(false);
148
+ // Pages loaded so far (1 = the initial page). The next page is derived from this
149
+ // counter — NOT from the deduped row count — so overlapping rows across pages
150
+ // (e.g. pinned rows that repeat on every page) don't stall the page index.
151
+ var loadedPagesRef = (0, react_1.useRef)(1);
152
+ (0, react_1.useEffect)(function () {
153
+ if (!groupLoadMore)
154
+ return;
155
+ setAccumulatedRows(function (prev) {
156
+ if (prev.length === 0) {
157
+ loadedPagesRef.current = 1;
158
+ return tableData.slice();
159
+ }
160
+ var accIds = new Set(prev.map(function (r) { return r.id; }));
161
+ if (pendingLoadMoreRef.current) {
162
+ // A "Load more" is in flight. The parent may re-emit the SAME page (new
163
+ // array reference) on intermediate re-renders before the next page arrives,
164
+ // so only append + consume the flag once genuinely new rows show up.
165
+ var newRows = tableData.filter(function (r) { return !accIds.has(r.id); });
166
+ if (newRows.length === 0)
167
+ return prev; // same page re-emitted — keep waiting
168
+ pendingLoadMoreRef.current = false;
169
+ return __spreadArray(__spreadArray([], prev, true), newRows, true);
170
+ }
171
+ // Not a load-more: a re-emit of already-loaded rows keeps the accumulation
172
+ // (the parent re-renders the current page often). Genuinely new rows
173
+ // (search / filter / sort / page-size / reload) reset it.
174
+ var allKnown = tableData.length > 0 && tableData.every(function (r) { return accIds.has(r.id); });
175
+ if (allKnown)
176
+ return prev;
177
+ loadedPagesRef.current = 1; // fresh data set
178
+ return tableData.slice();
179
+ });
180
+ // eslint-disable-next-line react-hooks/exhaustive-deps
181
+ }, [tableData, groupLoadMore]);
182
+ // Page-size change restarts the accumulation (the page boundaries change), so the
183
+ // next "Load more" requests page 2 of the NEW size, not a stale page index.
184
+ var rowsPerPageMountedRef = (0, react_1.useRef)(false);
185
+ (0, react_1.useEffect)(function () {
186
+ if (!rowsPerPageMountedRef.current) {
187
+ rowsPerPageMountedRef.current = true;
188
+ return;
189
+ }
190
+ pendingLoadMoreRef.current = false;
191
+ loadedPagesRef.current = 1;
192
+ setAccumulatedRows(tableData); // current page at the new size (not empty)
193
+ // eslint-disable-next-line react-hooks/exhaustive-deps
194
+ }, [rowsPerPage]);
195
+ (0, react_1.useEffect)(function () {
196
+ if (tablePreferences === null || tablePreferences === void 0 ? void 0 : tablePreferences.density)
197
+ setDensityState(tablePreferences.density);
198
+ }, [tablePreferences === null || tablePreferences === void 0 ? void 0 : tablePreferences.density]);
199
+ (0, react_1.useEffect)(function () {
200
+ if (tablePreferences && "groupBy" in tablePreferences) {
201
+ var saved = tablePreferences.groupBy;
202
+ setGroupByState(saved === null || saved === undefined || saved === "" ? undefined : saved);
203
+ }
204
+ }, [tablePreferences === null || tablePreferences === void 0 ? void 0 : tablePreferences.groupBy]);
205
+ var handleDensityChange = function (d) {
206
+ setDensityState(d);
207
+ savePreferences === null || savePreferences === void 0 ? void 0 : savePreferences(__assign(__assign({}, tablePreferences), { columns: columnsList, groupBy: groupByState !== null && groupByState !== void 0 ? groupByState : null, density: d }));
208
+ };
209
+ // Settings "Save": persist columns + group (+ current density) in ONE write so
210
+ // they don't clobber each other, and apply them locally.
211
+ var handleSettingsSave = function (cols, group) {
212
+ setGroupByState(group);
213
+ handleColumnPreferences(cols, { density: densityState, groupBy: group !== null && group !== void 0 ? group : null });
214
+ };
116
215
  var _filteredData = (0, react_1.useMemo)(function () {
117
216
  return (0, table_1.searchAndSortData)(filteredData, columnsSearch);
118
217
  }, [columnsSearch, filteredData]);
218
+ // --- Monday-style grouping. Active whenever the user has picked a group column
219
+ // (in Settings > Group). When active, the numbered pager / infinite scroll are
220
+ // hidden and the body renders colored, collapsible groups over the loaded rows.
221
+ // `groupLoadMore` adds a "Load more" button on top to fetch more into the groups. ---
222
+ var isGrouped = !!groupByState;
223
+ // Infinite scroll (server mode, not grouped): load more on scroll-near-bottom.
224
+ var canInfinite = infiniteScroll && !isGrouped;
225
+ // Grouped "Load more": the accumulated pages back the grouped board so loading
226
+ // more grows the groups instead of replacing them.
227
+ var loadMoreBase = isGrouped && groupLoadMore ? accumulatedRows : tableData;
228
+ var hasMoreEffective = typeof hasMore === "boolean"
229
+ ? hasMore
230
+ : isServerPagination
231
+ ? loadMoreBase.length < totalRecords
232
+ : false;
233
+ var canGroupLoadMore = isGrouped && groupLoadMore && hasMoreEffective;
234
+ var groupPalette = (0, react_1.useMemo)(function () { return (0, table_1.buildTablePalette)(theme); }, [theme]);
235
+ var groupedSource = (0, react_1.useMemo)(function () {
236
+ if (!isGrouped)
237
+ return [];
238
+ var src = groupLoadMore ? accumulatedRows : tableData;
239
+ return (0, table_1.searchAndSortData)((0, table_1.SortMultiColumnData)(src, columnsSort), columnsSearch);
240
+ }, [isGrouped, groupLoadMore, accumulatedRows, tableData, columnsSort, columnsSearch]);
241
+ var renderGroups = (0, react_1.useMemo)(function () {
242
+ if (!isGrouped)
243
+ return undefined;
244
+ return (0, table_1.groupRows)(groupedSource, groupByState).map(function (g) { return (__assign(__assign({}, g), { color: (0, table_1.pickTableColor)(g.value, groupPalette, groupColors === null || groupColors === void 0 ? void 0 : groupColors[g.value]) })); });
245
+ }, [isGrouped, groupedSource, groupByState, groupPalette, groupColors]);
119
246
  var onPaginationRef = (0, react_1.useRef)(onPagination);
120
247
  onPaginationRef.current = onPagination;
121
248
  var prevPageRef = (0, react_1.useRef)(currentPage);
@@ -142,12 +269,35 @@ function Table(_a) {
142
269
  prevPageRef.current = currentPage;
143
270
  }
144
271
  }, [currentPage, rowsPerPage]);
272
+ // Grouped "Load more": request the next chunk; parent appends it to `data` and
273
+ // the table re-groups so new rows land in their respective groups.
274
+ var handleGroupLoadMore = function () {
275
+ var _a;
276
+ if (isLoadingMore || isTableLoading || !hasMoreEffective)
277
+ return;
278
+ // Must request the SAME page size the data was loaded with — a page-count model
279
+ // breaks if pages have different sizes (e.g. page size 100 but a 20-row chunk
280
+ // re-requests already-loaded records). `loadMoreChunkSize` is only a last-resort
281
+ // fallback and is otherwise ignored.
282
+ var chunk = rowsPerPage || loadMoreChunkSize || 20;
283
+ // Advance by page COUNT (not by deduped row count) so overlapping/pinned rows
284
+ // across pages don't keep us stuck on the same page.
285
+ var nextPage = loadedPagesRef.current + 1;
286
+ loadedPagesRef.current = nextPage;
287
+ var lastRecord = loadMoreBase.length > 0 ? loadMoreBase[loadMoreBase.length - 1] : undefined;
288
+ pendingLoadMoreRef.current = true;
289
+ (_a = onPaginationRef.current) === null || _a === void 0 ? void 0 : _a.call(onPaginationRef, nextPage, chunk, lastRecord, "next");
290
+ };
291
+ var groupLoadMoreCaption = totalRecords > 0 ? "Showing ".concat(loadMoreBase.length, " of ").concat(totalRecords) : undefined;
145
292
  var tablePaginationText = (0, react_1.useMemo)(function () { return isServerPagination
146
293
  ? "".concat(startRow + 1, " - ").concat(Math.min(startRow + rowsPerPage, totalRecords), " of ").concat(totalRecords)
147
294
  : "".concat(startRow + 1, " - ").concat(endRow > tableData.length ? tableData.length : endRow, " of ").concat(tableData.length); }, [startRow, rowsPerPage, totalRecords, endRow, tableData.length]);
148
295
  var controlsHeight = 45;
149
296
  var estimatedRowHeight = 45;
150
- var actualRows = _filteredData.length;
297
+ // In grouped mode the rendered rows come from the full grouped source, not the
298
+ // paged slice — base the height on that so a 1-result search isn't clipped.
299
+ var actualRows = isGrouped ? groupedSource.length : _filteredData.length;
300
+ var isEmptyState = !isTableLoading && actualRows === 0;
151
301
  var loadingRowsCount = typeof loadingSkeletonRows === "number" ? Math.max(1, loadingSkeletonRows) : 4;
152
302
  var minRows = typeof minVisibleRows === "number"
153
303
  ? Math.max(0, minVisibleRows)
@@ -171,13 +321,46 @@ function Table(_a) {
171
321
  return function () { return window.removeEventListener("resize", compute); };
172
322
  }, [autoFitViewport]);
173
323
  var heightRowsCount = isTableLoading ? loadingRowsCount : visibleRowsCount;
174
- var isCompactRows = heightRowsCount <= 1 && !(filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar);
175
- var rowsHeight = (heightRowsCount * estimatedRowHeight) + estimatedRowHeight;
324
+ var isCompactRows = heightRowsCount <= 1 && !(filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) && !isGrouped && !isEmptyState;
325
+ var rowsHeight = heightRowsCount * estimatedRowHeight + estimatedRowHeight;
326
+ if (isGrouped)
327
+ rowsHeight += ((_c = renderGroups === null || renderGroups === void 0 ? void 0 : renderGroups.length) !== null && _c !== void 0 ? _c : 1) * 42; // group header rows
328
+ if (isEmptyState)
329
+ rowsHeight = Math.max(rowsHeight, 200); // room for the empty state
176
330
  var dynamicMaxH = Math.min(500, rowsHeight);
177
331
  var fittedMaxH = autoFitViewport ? Math.min(dynamicMaxH, viewportAvailableH) : dynamicMaxH;
178
332
  var tableMaxH = typeof tableMaxHeight === "number" ? tableMaxHeight : (isCompactRows ? rowsHeight + 8 : fittedMaxH);
179
333
  var isCompactHeader = (0, react_2.useBreakpointValue)({ base: true, md: true, lg: false });
180
334
  var compactScrollbarPadding = isCompactRows ? 4 : 0;
335
+ // Infinite scroll: reuse onPagination("next") when scrolled near the bottom.
336
+ var infiniteRef = (0, react_1.useRef)({ isLoadingMore: isLoadingMore, isTableLoading: isTableLoading, hasMore: hasMore, rowsPerPage: rowsPerPage, dataLen: tableData.length, lastRecord: tableData[tableData.length - 1], totalRecords: totalRecords, isServerPagination: isServerPagination });
337
+ infiniteRef.current = { isLoadingMore: isLoadingMore, isTableLoading: isTableLoading, hasMore: hasMore, rowsPerPage: rowsPerPage, dataLen: tableData.length, lastRecord: tableData[tableData.length - 1], totalRecords: totalRecords, isServerPagination: isServerPagination };
338
+ (0, react_1.useEffect)(function () {
339
+ if (!canInfinite)
340
+ return;
341
+ var el = tableContainerRef.current;
342
+ if (!el)
343
+ return;
344
+ var onScroll = function () {
345
+ var _a;
346
+ var s = infiniteRef.current;
347
+ if (s.isLoadingMore || s.isTableLoading)
348
+ return;
349
+ var more = typeof s.hasMore === "boolean"
350
+ ? s.hasMore
351
+ : s.isServerPagination
352
+ ? s.dataLen < s.totalRecords
353
+ : false;
354
+ if (!more)
355
+ return;
356
+ if (el.scrollHeight - el.scrollTop - el.clientHeight < 160) {
357
+ var nextPage = Math.floor(s.dataLen / (s.rowsPerPage || 1)) + 1;
358
+ (_a = onPaginationRef.current) === null || _a === void 0 ? void 0 : _a.call(onPaginationRef, nextPage, s.rowsPerPage, s.lastRecord, "next");
359
+ }
360
+ };
361
+ el.addEventListener("scroll", onScroll, { passive: true });
362
+ return function () { return el.removeEventListener("scroll", onScroll); };
363
+ }, [canInfinite]);
181
364
  var sidebarActiveCount = (0, react_1.useMemo)(function () {
182
365
  if (!(filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected))
183
366
  return 0;
@@ -188,22 +371,22 @@ function Table(_a) {
188
371
  return acc + (Array.isArray(items) ? items.length : 0);
189
372
  }, 0);
190
373
  }, [filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected]);
191
- return (react_1.default.createElement(react_2.Box, { bg: (_d = (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.background) === null || _d === void 0 ? void 0 : _d[50], border: "0.063rem solid ".concat((_e = theme.colors.border) === null || _e === void 0 ? void 0 : _e[500]), borderRadius: 3 },
374
+ return (react_1.default.createElement(react_2.Box, { bg: (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.background) === null || _e === void 0 ? void 0 : _e[50], border: "0.063rem solid ".concat((_f = theme.colors.border) === null || _f === void 0 ? void 0 : _f[500]), borderRadius: 3 },
192
375
  filterSidebar && filterMode === "modal" && (react_1.default.createElement(react_2.Modal, { isOpen: isFilterModalOpen, onClose: onFilterModalClose, size: "4xl", scrollBehavior: "inside" },
193
376
  react_1.default.createElement(react_2.ModalOverlay, null),
194
377
  react_1.default.createElement(react_2.ModalContent, { my: 0, top: "10%", position: "fixed", left: "auto", right: "auto" },
195
378
  react_1.default.createElement(react_2.ModalCloseButton, { size: "sm" }),
196
379
  react_1.default.createElement(react_2.ModalBody, { p: 0 },
197
- react_1.default.createElement(LeftFilterPane_1.default, { theme: theme, sections: (_f = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.sidebarOptions) !== null && _f !== void 0 ? _f : [], selected: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected, onApply: function (sel) { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply) === null || _a === void 0 ? void 0 : _a.call(filterSidebar, sel); onFilterModalClose(); }, onClear: function () { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler) === null || _a === void 0 ? void 0 : _a.call(filterSidebar); }, isApplyLoading: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isApplyLoading, filterMode: filterMode }))))),
380
+ react_1.default.createElement(LeftFilterPane_1.default, { theme: theme, sections: (_g = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.sidebarOptions) !== null && _g !== void 0 ? _g : [], selected: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected, onApply: function (sel) { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply) === null || _a === void 0 ? void 0 : _a.call(filterSidebar, sel); onFilterModalClose(); }, onClear: function () { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler) === null || _a === void 0 ? void 0 : _a.call(filterSidebar); }, isApplyLoading: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isApplyLoading, filterMode: filterMode }))))),
198
381
  react_1.default.createElement(react_2.Flex, { align: "start" },
199
- filterMode === "sidebar" && (react_1.default.createElement(MotionBox, { initial: { width: 0 }, animate: { width: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? 180 : 0 }, transition: { type: "tween", duration: 0.5 }, overflow: "hidden", flexShrink: 0, borderRight: "1px solid", borderColor: (_g = theme.colors.border) === null || _g === void 0 ? void 0 : _g[500], style: { height: controlsHeight + tableMaxH }, minHeight: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? "32rem" : "auto" },
200
- react_1.default.createElement(LeftFilterPane_1.default, { height: controlsHeight + tableMaxH, theme: theme, sections: (_h = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.sidebarOptions) !== null && _h !== void 0 ? _h : [], selected: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected, onApply: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply, onClear: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler, isApplyLoading: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isApplyLoading, filterMode: filterMode }))),
382
+ filterMode === "sidebar" && (react_1.default.createElement(MotionBox, { initial: { width: 0 }, animate: { width: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? 180 : 0 }, transition: { type: "tween", duration: 0.5 }, overflow: "hidden", flexShrink: 0, borderRight: "1px solid", borderColor: (_h = theme.colors.border) === null || _h === void 0 ? void 0 : _h[500], style: { height: controlsHeight + tableMaxH }, minHeight: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? "32rem" : "auto" },
383
+ react_1.default.createElement(LeftFilterPane_1.default, { height: controlsHeight + tableMaxH, theme: theme, sections: (_j = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.sidebarOptions) !== null && _j !== void 0 ? _j : [], selected: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected, onApply: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply, onClear: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler, isApplyLoading: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isApplyLoading, filterMode: filterMode }))),
201
384
  react_1.default.createElement(react_2.Box, { flex: "1", minW: 0 },
202
- react_1.default.createElement(react_2.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 0, height: controlsHeight, gap: 1, flexWrap: "nowrap", bg: (_k = (_j = theme.colors) === null || _j === void 0 ? void 0 : _j.background) === null || _k === void 0 ? void 0 : _k[50], borderBottom: "0.063rem solid ".concat((_l = theme.colors.border) === null || _l === void 0 ? void 0 : _l[500]) },
385
+ react_1.default.createElement(react_2.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 0, height: controlsHeight, gap: 3, flexWrap: "nowrap", bg: (_l = (_k = theme.colors) === null || _k === void 0 ? void 0 : _k.background) === null || _l === void 0 ? void 0 : _l[50], borderBottom: "0.063rem solid ".concat((_m = theme.colors.border) === null || _m === void 0 ? void 0 : _m[500]) },
203
386
  filterSidebar && (react_1.default.createElement(react_1.default.Fragment, null,
204
387
  react_1.default.createElement(react_2.Box, { position: "relative", display: "inline-block" },
205
- react_1.default.createElement(react_3.Icon, { as: lucide_react_1.Filter, transform: "scaleX(-1)", cursor: "pointer", boxSize: 4, color: sidebarActiveCount > 0 ? (_o = (_m = theme.colors) === null || _m === void 0 ? void 0 : _m.primary) === null || _o === void 0 ? void 0 : _o[500] : (_q = (_p = theme.colors) === null || _p === void 0 ? void 0 : _p.text) === null || _q === void 0 ? void 0 : _q[500], onClick: filterMode === "modal" ? onFilterModalOpen : filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.filterSidebarToggle }),
206
- sidebarActiveCount > 0 && (react_1.default.createElement(react_2.Box, { position: "absolute", top: "-6px", right: "-10px", bg: (_s = (_r = theme.colors) === null || _r === void 0 ? void 0 : _r.primary) === null || _s === void 0 ? void 0 : _s[500], color: "white", borderRadius: "full", p: "1px", cursor: "pointer", onClick: function (e) {
388
+ react_1.default.createElement(react_3.Icon, { as: lucide_react_1.Filter, transform: "scaleX(-1)", cursor: "pointer", boxSize: 4, color: sidebarActiveCount > 0 ? (_p = (_o = theme.colors) === null || _o === void 0 ? void 0 : _o.primary) === null || _p === void 0 ? void 0 : _p[500] : (_r = (_q = theme.colors) === null || _q === void 0 ? void 0 : _q.text) === null || _r === void 0 ? void 0 : _r[500], onClick: filterMode === "modal" ? onFilterModalOpen : filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.filterSidebarToggle }),
389
+ sidebarActiveCount > 0 && (react_1.default.createElement(react_2.Box, { position: "absolute", top: "-6px", right: "-10px", bg: (_t = (_s = theme.colors) === null || _s === void 0 ? void 0 : _s.primary) === null || _t === void 0 ? void 0 : _t[500], color: "white", borderRadius: "full", p: "1px", cursor: "pointer", onClick: function (e) {
207
390
  var _a;
208
391
  e.stopPropagation();
209
392
  if (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler) {
@@ -212,23 +395,26 @@ function Table(_a) {
212
395
  else {
213
396
  (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply) === null || _a === void 0 ? void 0 : _a.call(filterSidebar, {});
214
397
  }
215
- }, _hover: { bg: (_u = (_t = theme.colors) === null || _t === void 0 ? void 0 : _t.red) === null || _u === void 0 ? void 0 : _u[600] }, display: "flex", alignItems: "center", justifyContent: "center", zIndex: 2 },
398
+ }, _hover: { bg: (_v = (_u = theme.colors) === null || _u === void 0 ? void 0 : _u.red) === null || _v === void 0 ? void 0 : _v[600] }, display: "flex", alignItems: "center", justifyContent: "center", zIndex: 2 },
216
399
  react_1.default.createElement(lucide_react_1.X, { size: 10, strokeWidth: 3 })))),
217
400
  react_1.default.createElement(Divider_1.default, null))),
218
401
  react_1.default.createElement(TableSearch_1.default, { onSearch: onGlobalSearch }),
219
402
  isTableSettings && (react_1.default.createElement(react_1.default.Fragment, null,
220
403
  react_1.default.createElement(Divider_1.default, null),
221
- react_1.default.createElement(TableSettings_1.default, { columns: columnsList, onSave: function (cols) { return handleColumnPreferences(cols); }, tableSettings: tableSettings }))),
404
+ react_1.default.createElement(TableSettings_1.default, { columns: columnsList, onSave: function (cols, group) { return handleSettingsSave(cols, group); }, tableSettings: tableSettings, density: densityState, onDensityChange: handleDensityChange, groupBy: groupByState }))),
222
405
  headerActions && (react_1.default.createElement(react_1.default.Fragment, null,
223
406
  react_1.default.createElement(Divider_1.default, null),
224
407
  react_1.default.createElement(HeaderActions_1.default, { actions: headerActions, selections: selection }))),
225
408
  react_1.default.createElement(ActiveFilters_1.default, { columns: columnsList, columnsSearch: columnsSearch, setColumnsSearch: setColumnsSearch }),
226
409
  react_1.default.createElement(react_2.Box, { ml: "auto", display: "flex", alignItems: "center", gap: 2 },
227
- (isPagination || isServerPagination) && !isCompactHeader && (react_1.default.createElement(react_2.Box, { flex: "0 0 auto" },
410
+ canGroupLoadMore && loadMorePosition === "top" && (react_1.default.createElement(react_2.Box, { display: "flex", alignItems: "center", gap: 2, flex: "0 0 auto" },
411
+ groupLoadMoreCaption && (react_1.default.createElement(react_2.Box, { fontSize: "0.75rem", color: (_x = (_w = theme.colors) === null || _w === void 0 ? void 0 : _w.text) === null || _x === void 0 ? void 0 : _x[500], whiteSpace: "nowrap" }, groupLoadMoreCaption)),
412
+ react_1.default.createElement(Button_1.default, { size: "xs", variant: "outline", colorScheme: "gray", isLoading: isLoadingMore, loadingText: loadMoreText, onClick: handleGroupLoadMore, label: loadMoreText }))),
413
+ (isPagination || isServerPagination) && !isGrouped && !canInfinite && !isCompactHeader && (react_1.default.createElement(react_2.Box, { flex: "0 0 auto" },
228
414
  react_1.default.createElement(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }))),
229
- (isPagination || isServerPagination) && isCompactHeader && tableData.length > 0 && (react_1.default.createElement(react_2.Popover, { placement: "bottom-end" },
415
+ (isPagination || isServerPagination) && !isGrouped && !canInfinite && isCompactHeader && tableData.length > 0 && (react_1.default.createElement(react_2.Popover, { placement: "bottom-end" },
230
416
  react_1.default.createElement(react_2.PopoverTrigger, null,
231
- react_1.default.createElement(react_2.IconButton, { "aria-label": "More", size: "sm", variant: "ghost", icon: react_1.default.createElement(lucide_react_1.EllipsisVertical, { size: 18, color: (_w = (_v = theme.colors) === null || _v === void 0 ? void 0 : _v.text) === null || _w === void 0 ? void 0 : _w[500] }) })),
417
+ react_1.default.createElement(react_2.IconButton, { "aria-label": "More", size: "sm", variant: "ghost", icon: react_1.default.createElement(lucide_react_1.EllipsisVertical, { size: 18, color: (_z = (_y = theme.colors) === null || _y === void 0 ? void 0 : _y.text) === null || _z === void 0 ? void 0 : _z[500] }) })),
232
418
  react_1.default.createElement(react_2.PopoverContent, { maxW: "22rem", p: 2, overflow: "hidden" },
233
419
  react_1.default.createElement(react_2.PopoverBody, { p: 0 },
234
420
  react_1.default.createElement(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }))))))),
@@ -259,7 +445,11 @@ function Table(_a) {
259
445
  } },
260
446
  react_1.default.createElement(react_3.Table, { variant: "simple", size: "sm", minW: "100%", className: "table_wrapper", sx: {
261
447
  width: "100%",
262
- borderCollapse: "collapse",
448
+ // `separate` (not `collapse`) so sticky header cells paint an opaque
449
+ // background over their borders — collapsed borders bleed scrolling
450
+ // content through the seams.
451
+ borderCollapse: "separate",
452
+ borderSpacing: 0,
263
453
  "th .resize-handle": {
264
454
  position: "absolute",
265
455
  top: 0,
@@ -271,12 +461,18 @@ function Table(_a) {
271
461
  zIndex: 999,
272
462
  },
273
463
  } },
274
- react_1.default.createElement(react_3.Thead, { position: "sticky", top: 0, zIndex: 4 },
275
- react_1.default.createElement(TableHeader_1.default, { columns: columnsList, isCheckbox: isCheckbox, headerBgColor: headerBgColor !== null && headerBgColor !== void 0 ? headerBgColor : theme.colors.backgroundColor.muted, headerTextColor: headerTextColor !== null && headerTextColor !== void 0 ? headerTextColor : (_x = theme.colors) === null || _x === void 0 ? void 0 : _x.gray[600], freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_y = theme.colors) === null || _y === void 0 ? void 0 : _y.gray[600], handleSort: handleSort, headerRefs: headerRefs, columnWidths: columnWidths, columnsSort: columnsSort, noBorders: noBorders, handleCheckbox: handleCheckbox, isLoading: isTableLoading, checked: tableData.length !== 0 && selection.length === tableData.length
464
+ react_1.default.createElement(react_3.Thead, { position: "sticky", top: 0, zIndex: 4, bg: (_2 = (_1 = (_0 = theme.colors.table) === null || _0 === void 0 ? void 0 : _0.hover) === null || _1 === void 0 ? void 0 : _1[200]) !== null && _2 !== void 0 ? _2 : (_3 = theme.colors.secondary) === null || _3 === void 0 ? void 0 : _3[50] },
465
+ react_1.default.createElement(TableHeader_1.default, { columns: columnsList, isCheckbox: isCheckbox, headerBgColor: headerBgColor !== null && headerBgColor !== void 0 ? headerBgColor : theme.colors.backgroundColor.muted, headerTextColor: headerTextColor !== null && headerTextColor !== void 0 ? headerTextColor : (_4 = theme.colors) === null || _4 === void 0 ? void 0 : _4.gray[600], freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_5 = theme.colors) === null || _5 === void 0 ? void 0 : _5.gray[600], handleSort: handleSort, headerRefs: headerRefs, columnWidths: columnWidths, columnsSort: columnsSort, noBorders: noBorders, handleCheckbox: handleCheckbox, isLoading: isTableLoading, checked: tableData.length !== 0 && selection.length === tableData.length
276
466
  ? true
277
467
  : selection.length === 0
278
468
  ? false
279
469
  : "indeterminate", isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze, setColumnsSearch: setColumnsSearch, columnsSearch: columnsSearch, isSelecting: isSelecting })),
280
470
  react_1.default.createElement(react_3.Tbody, null,
281
- react_1.default.createElement(TableBody_1.default, { data: _filteredData, columns: columnsList, startRow: startRow, endRow: endRow, scrollContainerRef: tableContainerRef, isCheckbox: isCheckbox, columnWidths: columnWidths, noBorders: noBorders, freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_z = theme.colors) === null || _z === void 0 ? void 0 : _z.gray[600], handleCheckbox: handleCheckbox, selections: selection, isLoading: isTableLoading, loadingSkeletonRows: loadingSkeletonRows, onRowClick: onRowClick, isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze }))))))));
471
+ react_1.default.createElement(TableBody_1.default, { data: isGrouped ? groupedSource : _filteredData, groups: renderGroups, onAddItem: onAddItem, columns: columnsList, startRow: isGrouped ? 0 : startRow, endRow: endRow, scrollContainerRef: tableContainerRef, isCheckbox: isCheckbox, columnWidths: columnWidths, noBorders: noBorders, freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_6 = theme.colors) === null || _6 === void 0 ? void 0 : _6.gray[600], handleCheckbox: handleCheckbox, selections: selection, isLoading: isTableLoading, loadingSkeletonRows: loadingSkeletonRows, onRowClick: onRowClick, isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze, density: densityState, stripe: stripe, emptyState: emptyState }))),
472
+ canInfinite && isLoadingMore && (react_1.default.createElement(react_2.Flex, { justify: "center", align: "center", py: 3, gap: 2 },
473
+ react_1.default.createElement(react_2.Spinner, { size: "sm", color: (_8 = (_7 = theme.colors) === null || _7 === void 0 ? void 0 : _7.primary) === null || _8 === void 0 ? void 0 : _8[500] }),
474
+ react_1.default.createElement(react_2.Box, { fontSize: "0.75rem", color: (_10 = (_9 = theme.colors) === null || _9 === void 0 ? void 0 : _9.text) === null || _10 === void 0 ? void 0 : _10[500] }, "Loading more\u2026")))),
475
+ canGroupLoadMore && loadMorePosition === "bottom" && (react_1.default.createElement(react_2.Flex, { justify: "center", align: "center", gap: 3, py: 3, borderTop: "0.063rem solid ".concat((_11 = theme.colors.border) === null || _11 === void 0 ? void 0 : _11[500]) },
476
+ groupLoadMoreCaption && (react_1.default.createElement(react_2.Box, { fontSize: "0.75rem", color: (_13 = (_12 = theme.colors) === null || _12 === void 0 ? void 0 : _12.text) === null || _13 === void 0 ? void 0 : _13[500] }, groupLoadMoreCaption)),
477
+ react_1.default.createElement(Button_1.default, { size: "xs", variant: "outline", colorScheme: "gray", isLoading: isLoadingMore, loadingText: loadMoreText, onClick: handleGroupLoadMore, label: loadMoreText })))))));
282
478
  }
@@ -1,8 +1,19 @@
1
- import { Dispatch, MutableRefObject, SetStateAction } from "react";
1
+ import { Dispatch, MutableRefObject, ReactNode, SetStateAction } from "react";
2
2
  import { FilterSidebarProps } from "../FilterSidebar/FilterSidebar";
3
+ export type TableDensity = "compact" | "normal" | "comfortable";
4
+ export type TableEmptyState = {
5
+ icon?: ReactNode;
6
+ title?: string;
7
+ description?: string;
8
+ };
3
9
  export type TableProps = {
4
10
  data: DataObject[];
5
11
  columns: TableHeaderProps[];
12
+ groupColors?: Record<string | number, string>;
13
+ onAddItem?: (groupValue: string | number) => void;
14
+ density?: TableDensity;
15
+ stripe?: boolean;
16
+ emptyState?: TableEmptyState | ReactNode;
6
17
  handleExportChange?: (value: string) => void | undefined;
7
18
  exportOptions?: ExportOption[];
8
19
  exportLabel?: string;
@@ -21,6 +32,15 @@ export type TableProps = {
21
32
  onRowClick?: (row: DataObject, header: Record<string | number, string | number>) => void;
22
33
  isActionFreeze?: boolean;
23
34
  paginationMode?: "client" | "server";
35
+ infiniteScroll?: boolean;
36
+ hasMore?: boolean;
37
+ isLoadingMore?: boolean;
38
+ groupLoadMore?: boolean;
39
+ loadMoreText?: string;
40
+ loadMorePosition?: "top" | "bottom";
41
+ /** @deprecated Ignored — load more always uses the current page size (`noOfRowsPerPage`)
42
+ * so page boundaries stay consistent. Kept only for backward compatibility. */
43
+ loadMoreChunkSize?: number;
24
44
  noOfRowsPerPage?: number;
25
45
  totalRecords?: number;
26
46
  onPagination?: (page: number, noOfRecords: number, record: DataObject | undefined, direction: "next" | "prev" | "first" | "last") => void;
@@ -88,8 +108,13 @@ export type TableHeaderProps = {
88
108
  isSearch?: boolean;
89
109
  isFreeze?: boolean;
90
110
  isHidden?: boolean;
111
+ type?: "status";
112
+ statusColors?: Record<string, string>;
113
+ columnType?: TableColumnType;
91
114
  node?: (data: DataObject) => JSX.Element | string | number | undefined;
92
115
  };
116
+ /** Known field data-types (open-ended via the trailing string for forward-compat). */
117
+ export type TableColumnType = "text" | "singleline" | "multiLine" | "description" | "email" | "phone" | "website" | "number" | "integer" | "decimal" | "dropdown" | "multiSelectDropdown" | "user" | "date" | "date_time" | "time" | "not_assigned" | (string & {});
93
118
  export type ExportOption = {
94
119
  label: string;
95
120
  id: string;
@@ -116,7 +141,7 @@ export type TableHeaderPageProps = Pick<TableProps, "columns" | "isCheckbox" | "
116
141
  columnsSearch: Record<string, string>;
117
142
  isSelecting?: boolean;
118
143
  };
119
- export type TableBodyPageProps = Pick<TableProps, "columns" | "isCheckbox" | "data" | "freezedBgColor" | "freezedTextColor" | "noBorders" | "isLoading" | "loadingSkeletonRows" | "onRowClick" | "isActionFreeze"> & {
144
+ export type TableBodyPageProps = Pick<TableProps, "columns" | "isCheckbox" | "data" | "freezedBgColor" | "freezedTextColor" | "noBorders" | "isLoading" | "loadingSkeletonRows" | "onRowClick" | "isActionFreeze" | "density" | "stripe" | "emptyState"> & {
120
145
  startRow: number;
121
146
  endRow: number;
122
147
  columnWidths: number[];
@@ -125,6 +150,21 @@ export type TableBodyPageProps = Pick<TableProps, "columns" | "isCheckbox" | "da
125
150
  isContent: boolean;
126
151
  isLink: boolean;
127
152
  scrollContainerRef?: MutableRefObject<HTMLDivElement | null>;
153
+ /** Optional per-row id → accent color (Monday group stripe). */
154
+ accentColors?: Record<string | number, string>;
155
+ /** When provided, the body renders as a grouped (Monday) board instead of a flat list. */
156
+ groups?: TableRenderGroup[];
157
+ onAddItem?: (groupValue: string | number) => void;
158
+ };
159
+ export type TableRenderGroup = {
160
+ value: string | number;
161
+ label: string;
162
+ color: {
163
+ solid: string;
164
+ soft: string;
165
+ text: string;
166
+ };
167
+ rows: DataObject[];
128
168
  };
129
169
  export type TableFiltersProps = {
130
170
  header: DataObject;
@@ -6,7 +6,7 @@ type TableRowActions = {
6
6
  actions?: () => ReactNode;
7
7
  [key: string]: any;
8
8
  };
9
- declare const TableActions: ({ row }: {
9
+ declare const TableActions: React.MemoExoticComponent<({ row }: {
10
10
  row?: TableRowActions;
11
- }) => React.JSX.Element | null;
11
+ }) => React.JSX.Element | null>;
12
12
  export default TableActions;
@@ -37,7 +37,7 @@ var react_1 = __importStar(require("react"));
37
37
  var react_2 = require("@chakra-ui/react");
38
38
  var lucide_react_1 = require("lucide-react");
39
39
  var useCustomTheme_1 = require("../../../Theme/useCustomTheme");
40
- var TableActions = function (_a) {
40
+ var TableActions = react_1.default.memo(function (_a) {
41
41
  var _b, _c, _d;
42
42
  var row = _a.row;
43
43
  var _e = (0, react_1.useState)(false), isOpen = _e[0], setIsOpen = _e[1];
@@ -76,7 +76,7 @@ var TableActions = function (_a) {
76
76
  react_1.default.createElement("div", { ref: ref },
77
77
  react_1.default.createElement(react_2.PopoverTrigger, null,
78
78
  react_1.default.createElement(react_2.IconButton, { "aria-label": "Actions", color: "black", icon: react_1.default.createElement(lucide_react_1.EllipsisVertical, { size: 17 }), size: "sm", p: 0, variant: "ghost", _hover: { transform: "scale(1.2)" }, onClick: function () { return (isOpen ? handleClose() : handleOpen()); } })),
79
- react_1.default.createElement(react_2.Portal, null,
79
+ isOpen && (react_1.default.createElement(react_2.Portal, null,
80
80
  react_1.default.createElement(react_2.PopoverContent, { w: "auto", minW: "100px", boxShadow: "lg", p: 0, zIndex: 999 },
81
81
  react_1.default.createElement(react_2.PopoverBody, { p: 0, m: 0 },
82
82
  react_1.default.createElement(react_2.VStack, { align: "stretch", spacing: 1, p: 0, m: 0 },
@@ -102,6 +102,7 @@ var TableActions = function (_a) {
102
102
  react_1.default.createElement(lucide_react_1.Trash2, { size: 17 }),
103
103
  " Delete")),
104
104
  row.actions && ((_d = row === null || row === void 0 ? void 0 : row.actions) === null || _d === void 0 ? void 0 : _d.call(row)),
105
- !row.onLink && !row.onEdit && !row.onDelete && (react_1.default.createElement(react_2.Button, { size: "sm", variant: "ghost", isDisabled: true, justifyContent: "center" }, "No actions")))))))));
106
- };
105
+ !row.onLink && !row.onEdit && !row.onDelete && (react_1.default.createElement(react_2.Button, { size: "sm", variant: "ghost", isDisabled: true, justifyContent: "center" }, "No actions"))))))))));
106
+ });
107
+ TableActions.displayName = "TableActions";
107
108
  exports.default = TableActions;
@@ -1,4 +1,8 @@
1
1
  import React from "react";
2
2
  import { TableBodyPageProps } from "../TableProps";
3
- declare const TableBody: ({ data, isCheckbox, columns, startRow, columnWidths, freezedBgColor, freezedTextColor, noBorders, handleCheckbox, selections, isLoading, onRowClick, isContent, isLink, isActionFreeze, loadingSkeletonRows, scrollContainerRef, }: TableBodyPageProps) => React.JSX.Element;
3
+ export declare const DENSITY_CONFIG: Record<string, {
4
+ height: number;
5
+ py: string;
6
+ }>;
7
+ declare const TableBody: ({ data, isCheckbox, columns, startRow, columnWidths, freezedBgColor, freezedTextColor, noBorders, handleCheckbox, selections, isLoading, onRowClick, isContent, isLink, isActionFreeze, loadingSkeletonRows, scrollContainerRef, density, accentColors, groups, onAddItem, emptyState, }: TableBodyPageProps) => React.JSX.Element;
4
8
  export default TableBody;