pixelize-design-library 2.2.191 → 3.0.1-beta.1

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 (227) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/MIGRATION.md +562 -0
  3. package/coverage/clover.xml +638 -0
  4. package/coverage/coverage-final.json +20 -0
  5. package/coverage/lcov-report/Table/CompactSelect.tsx.html +379 -0
  6. package/coverage/lcov-report/Table/Components/ActiveFilters.tsx.html +514 -0
  7. package/coverage/lcov-report/Table/Components/HeaderActions.tsx.html +373 -0
  8. package/coverage/lcov-report/Table/Components/Pagination.tsx.html +574 -0
  9. package/coverage/lcov-report/Table/Components/TableActions.tsx.html +574 -0
  10. package/coverage/lcov-report/Table/Components/TableBody.tsx.html +1027 -0
  11. package/coverage/lcov-report/Table/Components/TableFilters.tsx.html +397 -0
  12. package/coverage/lcov-report/Table/Components/TableHeader.tsx.html +1060 -0
  13. package/coverage/lcov-report/Table/Components/TableLoading.tsx.html +361 -0
  14. package/coverage/lcov-report/Table/Components/TableSearch.tsx.html +337 -0
  15. package/coverage/lcov-report/Table/Components/index.html +266 -0
  16. package/coverage/lcov-report/Table/Components/useDebounce.ts.html +178 -0
  17. package/coverage/lcov-report/Table/Components/useTable.ts.html +778 -0
  18. package/coverage/lcov-report/Table/LeftFilterPane.tsx.html +1810 -0
  19. package/coverage/lcov-report/Table/SelectOperationControls.tsx.html +178 -0
  20. package/coverage/lcov-report/Table/Table.tsx.html +1567 -0
  21. package/coverage/lcov-report/Table/TableProps.tsx.html +658 -0
  22. package/coverage/lcov-report/Table/TableSettings/ManageColumns.tsx.html +619 -0
  23. package/coverage/lcov-report/Table/TableSettings/TableFilters.tsx.html +229 -0
  24. package/coverage/lcov-report/Table/TableSettings/TableSettings.tsx.html +532 -0
  25. package/coverage/lcov-report/Table/TableSettings/index.html +146 -0
  26. package/coverage/lcov-report/Table/TableToDo.tsx.html +973 -0
  27. package/coverage/lcov-report/Table/TextOperationControls.tsx.html +271 -0
  28. package/coverage/lcov-report/Table/filterTypes.ts.html +97 -0
  29. package/coverage/lcov-report/Table/index.html +176 -0
  30. package/coverage/lcov-report/base.css +224 -0
  31. package/coverage/lcov-report/block-navigation.js +87 -0
  32. package/coverage/lcov-report/favicon.png +0 -0
  33. package/coverage/lcov-report/index.html +146 -0
  34. package/coverage/lcov-report/prettify.css +1 -0
  35. package/coverage/lcov-report/prettify.js +2 -0
  36. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  37. package/coverage/lcov-report/sorter.js +210 -0
  38. package/coverage/lcov.info +1836 -0
  39. package/dist/Assets/defaultLogo.tsx +31 -0
  40. package/dist/Components/Editor/Editor.d.ts +2 -1
  41. package/dist/Components/Editor/Editor.js +39 -5
  42. package/dist/Components/KanbanBoard/AccountCard.d.ts +2 -2
  43. package/dist/Components/KanbanBoard/AccountCard.js +37 -4
  44. package/dist/Components/KanbanBoard/KanbanBoard.js +72 -35
  45. package/dist/Components/MultiSelect/MultiSelect.js +10 -19
  46. package/dist/Components/SearchSelect/SearchSelect.js +23 -16
  47. package/dist/Components/Table/Components/ActiveFilters.js +66 -25
  48. package/dist/Components/Table/Components/Pagination.d.ts +1 -1
  49. package/dist/Components/Table/Components/Pagination.js +41 -9
  50. package/dist/Components/Table/Components/TableFilters.js +11 -5
  51. package/dist/Components/Table/Components/useTable.js +36 -24
  52. package/dist/Theme/Dark/palette.d.ts +370 -0
  53. package/dist/Theme/Dark/palette.js +372 -0
  54. package/dist/components-v2/AlertDialog/AlertDialog.d.ts +23 -0
  55. package/dist/components-v2/AlertDialog/AlertDialog.js +98 -0
  56. package/dist/components-v2/Breadcrumbs/Breadcrumbs.d.ts +14 -0
  57. package/dist/components-v2/Breadcrumbs/Breadcrumbs.js +66 -0
  58. package/dist/components-v2/Charts/AreaChart.d.ts +23 -0
  59. package/dist/components-v2/Charts/AreaChart.js +63 -0
  60. package/dist/components-v2/Charts/BarChart.d.ts +25 -0
  61. package/dist/components-v2/Charts/BarChart.js +57 -0
  62. package/dist/components-v2/Charts/LineChart.d.ts +23 -0
  63. package/dist/components-v2/Charts/LineChart.js +55 -0
  64. package/dist/components-v2/Charts/PieChart.d.ts +15 -0
  65. package/dist/components-v2/Charts/PieChart.js +54 -0
  66. package/dist/components-v2/Charts/PolarChart.d.ts +14 -0
  67. package/dist/components-v2/Charts/PolarChart.js +54 -0
  68. package/dist/components-v2/Charts/chartOptions.d.ts +7 -0
  69. package/dist/components-v2/Charts/chartOptions.js +41 -0
  70. package/dist/components-v2/Charts/useChartTheme.d.ts +22 -0
  71. package/dist/components-v2/Charts/useChartTheme.js +106 -0
  72. package/dist/components-v2/ContactForm/ContactForm.d.ts +25 -0
  73. package/dist/components-v2/ContactForm/ContactForm.js +116 -0
  74. package/dist/components-v2/DatePicker/Calendar.d.ts +19 -0
  75. package/dist/components-v2/DatePicker/Calendar.js +212 -0
  76. package/dist/components-v2/DatePicker/DatePicker.d.ts +46 -0
  77. package/dist/components-v2/DatePicker/DatePicker.js +189 -0
  78. package/dist/components-v2/DatePicker/TimePicker.d.ts +12 -0
  79. package/dist/components-v2/DatePicker/TimePicker.js +105 -0
  80. package/dist/components-v2/DatePicker/utils.d.ts +31 -0
  81. package/dist/components-v2/DatePicker/utils.js +109 -0
  82. package/dist/components-v2/Drawer/Drawer.d.ts +27 -0
  83. package/dist/components-v2/Drawer/Drawer.js +132 -0
  84. package/dist/components-v2/FeedbackForm/FeedbackForm.d.ts +26 -0
  85. package/dist/components-v2/FeedbackForm/FeedbackForm.js +112 -0
  86. package/dist/components-v2/FileUploader/FileUploader.d.ts +28 -0
  87. package/dist/components-v2/FileUploader/FileUploader.js +127 -0
  88. package/dist/components-v2/Input/TextInput.d.ts +41 -0
  89. package/dist/components-v2/Input/TextInput.js +169 -0
  90. package/dist/components-v2/KanbanBoard/KanbanBoard.d.ts +39 -0
  91. package/dist/components-v2/KanbanBoard/KanbanBoard.js +101 -0
  92. package/dist/components-v2/Layout/AppLayout.d.ts +22 -0
  93. package/dist/components-v2/Layout/AppLayout.js +53 -0
  94. package/dist/components-v2/Loading/Loading.d.ts +19 -0
  95. package/dist/components-v2/Loading/Loading.js +55 -0
  96. package/dist/components-v2/Modal/Modal.d.ts +30 -0
  97. package/dist/components-v2/Modal/Modal.js +82 -0
  98. package/dist/components-v2/NavigationBar/NavigationBar.d.ts +47 -0
  99. package/dist/components-v2/NavigationBar/NavigationBar.js +148 -0
  100. package/dist/components-v2/Notification/Notification.d.ts +22 -0
  101. package/dist/components-v2/Notification/Notification.js +113 -0
  102. package/dist/components-v2/NumberInput/NumberInput.d.ts +37 -0
  103. package/dist/components-v2/NumberInput/NumberInput.js +210 -0
  104. package/dist/components-v2/PinInput/PinInput.d.ts +26 -0
  105. package/dist/components-v2/PinInput/PinInput.js +138 -0
  106. package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +18 -0
  107. package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.js +91 -0
  108. package/dist/components-v2/Select/Select.d.ts +41 -0
  109. package/dist/components-v2/Select/Select.js +284 -0
  110. package/dist/components-v2/Sidebar/Sidebar.d.ts +41 -0
  111. package/dist/components-v2/Sidebar/Sidebar.js +182 -0
  112. package/dist/components-v2/Slider/Slider.d.ts +18 -0
  113. package/dist/components-v2/Slider/Slider.js +101 -0
  114. package/dist/components-v2/Table/Table.d.ts +7 -0
  115. package/dist/components-v2/Table/Table.js +172 -0
  116. package/dist/components-v2/Table/TableProps.d.ts +139 -0
  117. package/dist/components-v2/Table/TableProps.js +9 -0
  118. package/dist/components-v2/Table/components/ActiveFilters.d.ts +10 -0
  119. package/dist/components-v2/Table/components/ActiveFilters.js +70 -0
  120. package/dist/components-v2/Table/components/BulkActionBar.d.ts +11 -0
  121. package/dist/components-v2/Table/components/BulkActionBar.js +92 -0
  122. package/dist/components-v2/Table/components/ColumnResizeHandle.d.ts +7 -0
  123. package/dist/components-v2/Table/components/ColumnResizeHandle.js +41 -0
  124. package/dist/components-v2/Table/components/Pagination.d.ts +11 -0
  125. package/dist/components-v2/Table/components/Pagination.js +92 -0
  126. package/dist/components-v2/Table/components/TableBody.d.ts +23 -0
  127. package/dist/components-v2/Table/components/TableBody.js +69 -0
  128. package/dist/components-v2/Table/components/TableCell.d.ts +14 -0
  129. package/dist/components-v2/Table/components/TableCell.js +63 -0
  130. package/dist/components-v2/Table/components/TableEmptyState.d.ts +12 -0
  131. package/dist/components-v2/Table/components/TableEmptyState.js +55 -0
  132. package/dist/components-v2/Table/components/TableErrorState.d.ts +6 -0
  133. package/dist/components-v2/Table/components/TableErrorState.js +52 -0
  134. package/dist/components-v2/Table/components/TableHeader.d.ts +21 -0
  135. package/dist/components-v2/Table/components/TableHeader.js +94 -0
  136. package/dist/components-v2/Table/components/TableRow.d.ts +20 -0
  137. package/dist/components-v2/Table/components/TableRow.js +64 -0
  138. package/dist/components-v2/Table/components/TableSearch.d.ts +8 -0
  139. package/dist/components-v2/Table/components/TableSearch.js +47 -0
  140. package/dist/components-v2/Table/filters/FilterChips.d.ts +6 -0
  141. package/dist/components-v2/Table/filters/FilterChips.js +9 -0
  142. package/dist/components-v2/Table/filters/LeftFilterPane.d.ts +17 -0
  143. package/dist/components-v2/Table/filters/LeftFilterPane.js +105 -0
  144. package/dist/components-v2/Table/filters/TableFilters.d.ts +12 -0
  145. package/dist/components-v2/Table/filters/TableFilters.js +127 -0
  146. package/dist/components-v2/Table/hooks/useColumnResize.d.ts +15 -0
  147. package/dist/components-v2/Table/hooks/useColumnResize.js +104 -0
  148. package/dist/components-v2/Table/hooks/useTable.d.ts +58 -0
  149. package/dist/components-v2/Table/hooks/useTable.js +254 -0
  150. package/dist/components-v2/Table/hooks/useTableKeyboard.d.ts +25 -0
  151. package/dist/components-v2/Table/hooks/useTableKeyboard.js +112 -0
  152. package/dist/components-v2/Table/hooks/useVirtualScroll.d.ts +29 -0
  153. package/dist/components-v2/Table/hooks/useVirtualScroll.js +83 -0
  154. package/dist/components-v2/Table/settings/ManageColumns.d.ts +12 -0
  155. package/dist/components-v2/Table/settings/ManageColumns.js +59 -0
  156. package/dist/components-v2/Table/settings/TableSettings.d.ts +12 -0
  157. package/dist/components-v2/Table/settings/TableSettings.js +57 -0
  158. package/dist/components-v2/Table/utils/filterUtils.d.ts +7 -0
  159. package/dist/components-v2/Table/utils/filterUtils.js +149 -0
  160. package/dist/components-v2/Table/utils/sortUtils.d.ts +6 -0
  161. package/dist/components-v2/Table/utils/sortUtils.js +65 -0
  162. package/dist/components-v2/Tag/Tag.d.ts +15 -0
  163. package/dist/components-v2/Tag/Tag.js +87 -0
  164. package/dist/components-v2/Timeline/Timeline.d.ts +18 -0
  165. package/dist/components-v2/Timeline/Timeline.js +76 -0
  166. package/dist/components-v2/Toaster/Toaster.d.ts +61 -0
  167. package/dist/components-v2/Toaster/Toaster.js +63 -0
  168. package/dist/components-v2/Toggle/Toggle.d.ts +28 -0
  169. package/dist/components-v2/Toggle/Toggle.js +90 -0
  170. package/dist/components-v2/ui/accordion.d.ts +12 -0
  171. package/dist/components-v2/ui/accordion.js +104 -0
  172. package/dist/components-v2/ui/alert.d.ts +18 -0
  173. package/dist/components-v2/ui/alert.js +99 -0
  174. package/dist/components-v2/ui/avatar.d.ts +12 -0
  175. package/dist/components-v2/ui/avatar.js +80 -0
  176. package/dist/components-v2/ui/badge.d.ts +10 -0
  177. package/dist/components-v2/ui/badge.js +76 -0
  178. package/dist/components-v2/ui/button.d.ts +18 -0
  179. package/dist/components-v2/ui/button.js +97 -0
  180. package/dist/components-v2/ui/checkbox.d.ts +15 -0
  181. package/dist/components-v2/ui/checkbox.js +86 -0
  182. package/dist/components-v2/ui/dialog.d.ts +30 -0
  183. package/dist/components-v2/ui/dialog.js +115 -0
  184. package/dist/components-v2/ui/dropdown-menu.d.ts +26 -0
  185. package/dist/components-v2/ui/dropdown-menu.js +121 -0
  186. package/dist/components-v2/ui/field.d.ts +32 -0
  187. package/dist/components-v2/ui/field.js +62 -0
  188. package/dist/components-v2/ui/form-field.d.ts +25 -0
  189. package/dist/components-v2/ui/form-field.js +96 -0
  190. package/dist/components-v2/ui/input.d.ts +9 -0
  191. package/dist/components-v2/ui/input.js +73 -0
  192. package/dist/components-v2/ui/label.d.ts +10 -0
  193. package/dist/components-v2/ui/label.js +70 -0
  194. package/dist/components-v2/ui/popover.d.ts +9 -0
  195. package/dist/components-v2/ui/popover.js +60 -0
  196. package/dist/components-v2/ui/progress.d.ts +12 -0
  197. package/dist/components-v2/ui/progress.js +75 -0
  198. package/dist/components-v2/ui/radio-group.d.ts +17 -0
  199. package/dist/components-v2/ui/radio-group.js +91 -0
  200. package/dist/components-v2/ui/select.d.ts +24 -0
  201. package/dist/components-v2/ui/select.js +122 -0
  202. package/dist/components-v2/ui/separator.d.ts +5 -0
  203. package/dist/components-v2/ui/separator.js +55 -0
  204. package/dist/components-v2/ui/skeleton.d.ts +9 -0
  205. package/dist/components-v2/ui/skeleton.js +68 -0
  206. package/dist/components-v2/ui/spinner.d.ts +16 -0
  207. package/dist/components-v2/ui/spinner.js +64 -0
  208. package/dist/components-v2/ui/switch.d.ts +10 -0
  209. package/dist/components-v2/ui/switch.js +81 -0
  210. package/dist/components-v2/ui/tabs.d.ts +13 -0
  211. package/dist/components-v2/ui/tabs.js +95 -0
  212. package/dist/components-v2/ui/textarea.d.ts +10 -0
  213. package/dist/components-v2/ui/textarea.js +96 -0
  214. package/dist/components-v2/ui/tooltip.d.ts +17 -0
  215. package/dist/components-v2/ui/tooltip.js +75 -0
  216. package/dist/index.d.ts +128 -64
  217. package/dist/index.js +246 -173
  218. package/dist/lib/utils.d.ts +2 -0
  219. package/dist/lib/utils.js +8 -0
  220. package/dist/theme-v2/ThemeProvider.d.ts +19 -0
  221. package/dist/theme-v2/ThemeProvider.js +149 -0
  222. package/dist/theme-v2/dark.css +47 -0
  223. package/dist/theme-v2/tokens.css +72 -0
  224. package/package.json +41 -20
  225. package/tailwind.config.ts +91 -0
  226. package/vite.config.ts +49 -10
  227. package/index.html +0 -13
@@ -1,17 +1,49 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
5
35
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var react_1 = __importDefault(require("react"));
36
+ var react_1 = __importStar(require("react"));
7
37
  var react_2 = require("@chakra-ui/react");
8
38
  var table_1 = require("../../../Utils/table");
9
39
  var lucide_react_1 = require("lucide-react");
10
- var Pagination = function (_a) {
40
+ var Pagination = react_1.default.memo(function (_a) {
11
41
  var paginationText = _a.paginationText, handlePageSizeChange = _a.handlePageSizeChange, rowsPerPage = _a.rowsPerPage, currentPage = _a.currentPage, pages = _a.pages, setCurrentPage = _a.setCurrentPage, dataLength = _a.dataLength, isServerPagination = _a.isServerPagination, paginationSelectOptions = _a.paginationSelectOptions;
12
- var computedOptions = paginationSelectOptions && paginationSelectOptions.length
13
- ? paginationSelectOptions
14
- : (0, table_1.pageSizeCalculation)(dataLength);
42
+ var computedOptions = (0, react_1.useMemo)(function () {
43
+ return paginationSelectOptions && paginationSelectOptions.length
44
+ ? paginationSelectOptions
45
+ : (0, table_1.pageSizeCalculation)(dataLength);
46
+ }, [paginationSelectOptions, dataLength]);
15
47
  // const isLeftDisabled = currentPage === 0;
16
48
  // const isRightDisabled = currentPage >= pages - 1;
17
49
  var isLeftDisabled = dataLength === 0 || currentPage === 0;
@@ -32,5 +64,5 @@ var Pagination = function (_a) {
32
64
  react_1.default.createElement(lucide_react_1.ChevronRight, null)),
33
65
  react_1.default.createElement(react_2.IconButton, { "aria-label": "last-page", color: isRightDisabled ? "gray" : "black", rounded: "full", variant: isRightDisabled ? "plain" : "ghost", onClick: function () { return setCurrentPage(pages - 1); } },
34
66
  react_1.default.createElement(lucide_react_1.ChevronsRight, null))))));
35
- };
67
+ });
36
68
  exports.default = Pagination;
@@ -35,7 +35,6 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  var react_1 = __importStar(require("react"));
37
37
  var react_2 = require("@chakra-ui/react");
38
- var table_1 = require("../../../Utils/table");
39
38
  var lucide_react_1 = require("lucide-react");
40
39
  var TableFilters = (0, react_1.memo)(function (_a) {
41
40
  var _b, _c;
@@ -43,9 +42,16 @@ var TableFilters = (0, react_1.memo)(function (_a) {
43
42
  var theme = (0, react_2.useTheme)();
44
43
  var searchRef = (0, react_1.useRef)(null);
45
44
  var _d = (0, react_1.useState)(false), refreshDataOnOpen = _d[0], setRefreshDataOnOpen = _d[1];
46
- var debounceRef = (0, table_1.debounce)(function (value) {
47
- setColumnsSearch(value);
48
- }, 700);
45
+ var setColumnsSearchRef = (0, react_1.useRef)(setColumnsSearch);
46
+ setColumnsSearchRef.current = setColumnsSearch;
47
+ var debounceTimerRef = (0, react_1.useRef)(null);
48
+ var debouncedSearch = (0, react_1.useCallback)(function (value) {
49
+ if (debounceTimerRef.current)
50
+ clearTimeout(debounceTimerRef.current);
51
+ debounceTimerRef.current = setTimeout(function () {
52
+ setColumnsSearchRef.current(value);
53
+ }, 700);
54
+ }, []);
49
55
  (0, react_1.useEffect)(function () {
50
56
  if (columnsSearch.length && searchRef.current) {
51
57
  searchRef.current.value = columnsSearch;
@@ -77,7 +83,7 @@ var TableFilters = (0, react_1.memo)(function (_a) {
77
83
  react_1.default.createElement(react_2.Icon, { as: lucide_react_1.Search, color: "gray.400", boxSize: 4 })),
78
84
  react_1.default.createElement(react_2.Input, { autoFocus: true, placeholder: "Search ".concat(header.label, "..."), size: "xs", ref: searchRef, onChange: function (e) {
79
85
  e.stopPropagation();
80
- debounceRef(e.target.value);
86
+ debouncedSearch(e.target.value);
81
87
  }, onFocus: function (e) { return e.stopPropagation(); } })))))));
82
88
  });
83
89
  exports.default = TableFilters;
@@ -38,14 +38,15 @@ var mergeColumnWithPreference = function (pref, originalCol) {
38
38
  return next;
39
39
  };
40
40
  var useTable = function (_a) {
41
+ var _b, _c;
41
42
  var tableBorderColor = _a.tableBorderColor, data = _a.data, isPagination = _a.isPagination, selections = _a.selections, onSelection = _a.onSelection, tablePreferences = _a.tablePreferences, savePreferences = _a.savePreferences, noOfRowsPerPage = _a.noOfRowsPerPage, isServerPagination = _a.isServerPagination, totalRecords = _a.totalRecords, columns = _a.columns, onNoOfRowsPerPageChange = _a.onNoOfRowsPerPageChange, defaultVisibleColumns = _a.defaultVisibleColumns;
42
43
  var theme = (0, useCustomTheme_1.useCustomTheme)();
43
44
  var headerRefs = (0, react_1.useRef)([]);
44
- var _b = (0, react_1.useState)([]), columnWidths = _b[0], setColumnWidths = _b[1];
45
- var _c = (0, react_1.useState)(selections !== null && selections !== void 0 ? selections : []), selection = _c[0], setSelection = _c[1];
46
- var _d = (0, react_1.useState)([]), columnsSort = _d[0], setColumnsSort = _d[1];
47
- var _e = (0, react_1.useState)(0), currentPage = _e[0], setCurrentPage = _e[1];
48
- var _f = (0, react_1.useState)(noOfRowsPerPage !== null && noOfRowsPerPage !== void 0 ? noOfRowsPerPage : defaultPageSize), rowsPerPage = _f[0], setRowsPerPage = _f[1];
45
+ var _d = (0, react_1.useState)([]), columnWidths = _d[0], setColumnWidths = _d[1];
46
+ var _e = (0, react_1.useState)(selections !== null && selections !== void 0 ? selections : []), selection = _e[0], setSelection = _e[1];
47
+ var _f = (0, react_1.useState)([]), columnsSort = _f[0], setColumnsSort = _f[1];
48
+ var _g = (0, react_1.useState)(0), currentPage = _g[0], setCurrentPage = _g[1];
49
+ var _h = (0, react_1.useState)(noOfRowsPerPage !== null && noOfRowsPerPage !== void 0 ? noOfRowsPerPage : defaultPageSize), rowsPerPage = _h[0], setRowsPerPage = _h[1];
49
50
  var prevRowsPerPageProp = (0, react_1.useRef)(noOfRowsPerPage);
50
51
  if (noOfRowsPerPage !== prevRowsPerPageProp.current) {
51
52
  prevRowsPerPageProp.current = noOfRowsPerPage;
@@ -54,12 +55,12 @@ var useTable = function (_a) {
54
55
  }
55
56
  }
56
57
  var tableData = data;
57
- var _g = (0, react_1.useState)(function () {
58
+ var _j = (0, react_1.useState)(function () {
58
59
  return columns.map(function (col, i) {
59
60
  var _a;
60
61
  return (__assign(__assign({}, col), { isHidden: defaultVisibleColumns ? i >= defaultVisibleColumns : ((_a = col.isHidden) !== null && _a !== void 0 ? _a : false) }));
61
62
  });
62
- }), columnsList = _g[0], setColumnsList = _g[1];
63
+ }), columnsList = _j[0], setColumnsList = _j[1];
63
64
  (0, react_1.useEffect)(function () {
64
65
  var _a;
65
66
  var columnPreference = (_a = tablePreferences === null || tablePreferences === void 0 ? void 0 : tablePreferences.columns) !== null && _a !== void 0 ? _a : [];
@@ -90,8 +91,18 @@ var useTable = function (_a) {
90
91
  overflowY: "auto",
91
92
  });
92
93
  }, [tableBorderColor, theme]);
93
- var isContent = (0, react_1.useMemo)(function () { return tableData.some(function (o) { return o.content; }); }, [tableData]);
94
- var isLink = (0, react_1.useMemo)(function () { return tableData.some(function (o) { return o.onLink || o.onDelete || o.onEdit; }); }, [tableData]);
94
+ var prevIsContent = (0, react_1.useRef)(false);
95
+ var prevIsLink = (0, react_1.useRef)(false);
96
+ var isContent = (0, react_1.useMemo)(function () {
97
+ var result = tableData.some(function (o) { return o.content; });
98
+ prevIsContent.current = result;
99
+ return result;
100
+ }, [tableData.length === 0 ? 0 : (_b = tableData[0]) === null || _b === void 0 ? void 0 : _b.id, tableData.length]); // eslint-disable-line react-hooks/exhaustive-deps
101
+ var isLink = (0, react_1.useMemo)(function () {
102
+ var result = tableData.some(function (o) { return o.onLink || o.onDelete || o.onEdit; });
103
+ prevIsLink.current = result;
104
+ return result;
105
+ }, [tableData.length === 0 ? 0 : (_c = tableData[0]) === null || _c === void 0 ? void 0 : _c.id, tableData.length]); // eslint-disable-line react-hooks/exhaustive-deps
95
106
  (0, react_1.useEffect)(function () {
96
107
  var widths = headerRefs.current.map(function (ref) { return (ref === null || ref === void 0 ? void 0 : ref.offsetWidth) || 0; });
97
108
  setColumnWidths(widths);
@@ -128,24 +139,25 @@ var useTable = function (_a) {
128
139
  var handleSort = (0, react_1.useCallback)(function (field, sort) {
129
140
  if (!sort)
130
141
  return;
131
- var newSortState = __spreadArray([], columnsSort, true);
132
- var existingIndex = newSortState.findIndex(function (sort) { return sort.column === field; });
133
- if (existingIndex === -1) {
134
- newSortState.push({
135
- column: field,
136
- direction: "asc", // Default to ascending when adding a column
137
- });
138
- }
139
- else {
140
- var existingSort = newSortState[existingIndex];
141
- existingSort.direction = sort;
142
- }
143
- setColumnsSort(newSortState);
144
- }, [columnsSort]);
142
+ setColumnsSort(function (prev) {
143
+ var newSortState = __spreadArray([], prev, true);
144
+ var existingIndex = newSortState.findIndex(function (s) { return s.column === field; });
145
+ if (existingIndex === -1) {
146
+ newSortState.push({
147
+ column: field,
148
+ direction: "asc",
149
+ });
150
+ }
151
+ else {
152
+ newSortState[existingIndex] = __assign(__assign({}, newSortState[existingIndex]), { direction: sort });
153
+ }
154
+ return newSortState;
155
+ });
156
+ }, []);
145
157
  (0, react_1.useEffect)(function () {
146
158
  setSelection(selections !== null && selections !== void 0 ? selections : []);
147
159
  }, [selections]);
148
- var _h = (0, react_1.useState)(false), isSelecting = _h[0], setIsSelecting = _h[1];
160
+ var _k = (0, react_1.useState)(false), isSelecting = _k[0], setIsSelecting = _k[1];
149
161
  var selectionRef = (0, react_1.useRef)(selection);
150
162
  selectionRef.current = selection;
151
163
  var onSelectionRef = (0, react_1.useRef)(onSelection);
@@ -0,0 +1,370 @@
1
+ declare const darkPalette: {
2
+ primary: {
3
+ 50: string;
4
+ 100: string;
5
+ 200: string;
6
+ 300: string;
7
+ 400: string;
8
+ 500: string;
9
+ 600: string;
10
+ 700: string;
11
+ 800: string;
12
+ 900: string;
13
+ opacity: {
14
+ 4: string;
15
+ 8: string;
16
+ 16: string;
17
+ 24: string;
18
+ 32: string;
19
+ 40: string;
20
+ 48: string;
21
+ };
22
+ };
23
+ secondary: {
24
+ 50: string;
25
+ 100: string;
26
+ 200: string;
27
+ 300: string;
28
+ 400: string;
29
+ 500: string;
30
+ 600: string;
31
+ 700: string;
32
+ 800: string;
33
+ 900: string;
34
+ opacity: {
35
+ 4: string;
36
+ 8: string;
37
+ 16: string;
38
+ 24: string;
39
+ 32: string;
40
+ 40: string;
41
+ 48: string;
42
+ };
43
+ };
44
+ tertiary: {
45
+ 50: string;
46
+ 100: string;
47
+ 200: string;
48
+ 300: string;
49
+ 400: string;
50
+ 500: string;
51
+ 600: string;
52
+ 700: string;
53
+ 800: string;
54
+ 900: string;
55
+ opacity: {
56
+ 4: string;
57
+ 8: string;
58
+ 16: string;
59
+ 24: string;
60
+ 32: string;
61
+ 40: string;
62
+ 48: string;
63
+ };
64
+ };
65
+ transparent: string;
66
+ black: string;
67
+ white: string;
68
+ semantic: {
69
+ success: {
70
+ 50: string;
71
+ 100: string;
72
+ 200: string;
73
+ 300: string;
74
+ 400: string;
75
+ 500: string;
76
+ 600: string;
77
+ 700: string;
78
+ 800: string;
79
+ 900: string;
80
+ };
81
+ error: {
82
+ 50: string;
83
+ 100: string;
84
+ 200: string;
85
+ 300: string;
86
+ 400: string;
87
+ 500: string;
88
+ 600: string;
89
+ 700: string;
90
+ 800: string;
91
+ 900: string;
92
+ };
93
+ warning: {
94
+ 50: string;
95
+ 100: string;
96
+ 200: string;
97
+ 300: string;
98
+ 400: string;
99
+ 500: string;
100
+ 600: string;
101
+ 700: string;
102
+ 800: string;
103
+ 900: string;
104
+ };
105
+ info: {
106
+ 50: string;
107
+ 100: string;
108
+ 200: string;
109
+ 300: string;
110
+ 400: string;
111
+ 500: string;
112
+ 600: string;
113
+ 700: string;
114
+ 800: string;
115
+ 900: string;
116
+ };
117
+ };
118
+ gray: {
119
+ 50: string;
120
+ 100: string;
121
+ 200: string;
122
+ 300: string;
123
+ 400: string;
124
+ 500: string;
125
+ 600: string;
126
+ 700: string;
127
+ 800: string;
128
+ 900: string;
129
+ };
130
+ red: {
131
+ 50: string;
132
+ 100: string;
133
+ 200: string;
134
+ 300: string;
135
+ 400: string;
136
+ 500: string;
137
+ 600: string;
138
+ 700: string;
139
+ 800: string;
140
+ 900: string;
141
+ };
142
+ orange: {
143
+ 50: string;
144
+ 100: string;
145
+ 200: string;
146
+ 300: string;
147
+ 400: string;
148
+ 500: string;
149
+ 600: string;
150
+ 700: string;
151
+ 800: string;
152
+ 900: string;
153
+ };
154
+ yellow: {
155
+ 50: string;
156
+ 100: string;
157
+ 200: string;
158
+ 300: string;
159
+ 400: string;
160
+ 500: string;
161
+ 600: string;
162
+ 700: string;
163
+ 800: string;
164
+ 900: string;
165
+ };
166
+ green: {
167
+ 50: string;
168
+ 100: string;
169
+ 200: string;
170
+ 300: string;
171
+ 400: string;
172
+ 500: string;
173
+ 600: string;
174
+ 700: string;
175
+ 800: string;
176
+ 900: string;
177
+ };
178
+ teal: {
179
+ 50: string;
180
+ 100: string;
181
+ 200: string;
182
+ 300: string;
183
+ 400: string;
184
+ 500: string;
185
+ 600: string;
186
+ 700: string;
187
+ 800: string;
188
+ 900: string;
189
+ };
190
+ blue: {
191
+ 50: string;
192
+ 100: string;
193
+ 200: string;
194
+ 300: string;
195
+ 400: string;
196
+ 500: string;
197
+ 600: string;
198
+ 700: string;
199
+ 800: string;
200
+ 900: string;
201
+ };
202
+ cyan: {
203
+ 50: string;
204
+ 100: string;
205
+ 200: string;
206
+ 300: string;
207
+ 400: string;
208
+ 500: string;
209
+ 600: string;
210
+ 700: string;
211
+ 800: string;
212
+ 900: string;
213
+ };
214
+ purple: {
215
+ 50: string;
216
+ 100: string;
217
+ 200: string;
218
+ 300: string;
219
+ 400: string;
220
+ 500: string;
221
+ 600: string;
222
+ 700: string;
223
+ 800: string;
224
+ 900: string;
225
+ };
226
+ pink: {
227
+ 50: string;
228
+ 100: string;
229
+ 200: string;
230
+ 300: string;
231
+ 400: string;
232
+ 500: string;
233
+ 600: string;
234
+ 700: string;
235
+ 800: string;
236
+ 900: string;
237
+ };
238
+ background: {
239
+ 50: string;
240
+ 100: string;
241
+ 200: string;
242
+ 300: string;
243
+ 400: string;
244
+ 500: string;
245
+ 600: string;
246
+ 700: string;
247
+ 800: string;
248
+ 900: string;
249
+ };
250
+ backgroundColor: {
251
+ main: string;
252
+ secondary: string;
253
+ tertiary: string;
254
+ quaternary: string;
255
+ light: string;
256
+ medium: string;
257
+ accent: string;
258
+ subtle: string;
259
+ muted: string;
260
+ neutral: string;
261
+ base: string;
262
+ tableHeader: string;
263
+ };
264
+ text: {
265
+ 50: string;
266
+ 100: string;
267
+ 200: string;
268
+ 300: string;
269
+ 400: string;
270
+ 500: string;
271
+ 600: string;
272
+ 700: string;
273
+ 800: string;
274
+ 900: string;
275
+ };
276
+ header: {
277
+ 50: string;
278
+ 100: string;
279
+ 200: string;
280
+ 300: string;
281
+ 400: string;
282
+ 500: string;
283
+ 600: string;
284
+ 700: string;
285
+ 800: string;
286
+ 900: string;
287
+ };
288
+ placeholder: {
289
+ 50: string;
290
+ 100: string;
291
+ 200: string;
292
+ 300: string;
293
+ 400: string;
294
+ 500: string;
295
+ 600: string;
296
+ 700: string;
297
+ 800: string;
298
+ 900: string;
299
+ };
300
+ boxShadow: {
301
+ primary: string;
302
+ error: string;
303
+ default: string;
304
+ };
305
+ sidebar: {
306
+ background: {
307
+ 50: string;
308
+ 100: string;
309
+ 200: string;
310
+ 300: string;
311
+ 400: string;
312
+ 500: string;
313
+ 600: string;
314
+ 700: string;
315
+ 800: string;
316
+ 900: string;
317
+ };
318
+ };
319
+ boxborder: {
320
+ 50: string;
321
+ 100: string;
322
+ 200: string;
323
+ 300: string;
324
+ 400: string;
325
+ 500: string;
326
+ 600: string;
327
+ 700: string;
328
+ 800: string;
329
+ 900: string;
330
+ };
331
+ border: {
332
+ 50: string;
333
+ 100: string;
334
+ 200: string;
335
+ 300: string;
336
+ 400: string;
337
+ 500: string;
338
+ 600: string;
339
+ 700: string;
340
+ 800: string;
341
+ 900: string;
342
+ };
343
+ table: {
344
+ hover: {
345
+ 50: string;
346
+ 100: string;
347
+ 200: string;
348
+ 300: string;
349
+ 400: string;
350
+ 500: string;
351
+ 600: string;
352
+ 700: string;
353
+ 800: string;
354
+ 900: string;
355
+ };
356
+ };
357
+ disabled: {
358
+ 50: string;
359
+ 100: string;
360
+ 200: string;
361
+ 300: string;
362
+ 400: string;
363
+ 500: string;
364
+ 600: string;
365
+ 700: string;
366
+ 800: string;
367
+ 900: string;
368
+ };
369
+ };
370
+ export default darkPalette;