@ackplus/react-tanstack-data-table 1.0.19-beta-0.6 → 1.0.19-beta-0.8

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 (258) hide show
  1. package/package.json +3 -11
  2. package/{index.js → src/index.d.ts} +3 -26
  3. package/src/index.js +31 -0
  4. package/src/lib/components/droupdown/menu-dropdown.d.ts +17 -0
  5. package/src/lib/components/droupdown/menu-dropdown.js +52 -0
  6. package/src/lib/components/filters/filter-value-input.d.ts +9 -0
  7. package/src/lib/components/filters/filter-value-input.js +58 -0
  8. package/src/lib/components/filters/index.d.ts +23 -0
  9. package/{lib → src/lib}/components/filters/index.js +6 -2
  10. package/src/lib/components/headers/draggable-header.d.ts +12 -0
  11. package/{lib → src/lib}/components/headers/draggable-header.js +35 -49
  12. package/{lib/components/headers/index.js → src/lib/components/headers/index.d.ts} +0 -3
  13. package/src/lib/components/headers/index.js +5 -0
  14. package/src/lib/components/headers/table-header.d.ts +10 -0
  15. package/src/lib/components/headers/table-header.js +48 -0
  16. package/src/lib/components/index.d.ts +7 -0
  17. package/src/lib/components/index.js +10 -0
  18. package/src/lib/components/pagination/data-table-pagination.d.ts +11 -0
  19. package/src/lib/components/pagination/data-table-pagination.js +25 -0
  20. package/src/lib/components/pagination/index.d.ts +1 -0
  21. package/src/lib/components/pagination/index.js +4 -0
  22. package/src/lib/components/rows/data-table-row.d.ts +13 -0
  23. package/src/lib/components/rows/data-table-row.js +31 -0
  24. package/src/lib/components/rows/empty-data-row.d.ts +6 -0
  25. package/src/lib/components/rows/empty-data-row.js +11 -0
  26. package/{lib/components/rows/index.js → src/lib/components/rows/index.d.ts} +0 -3
  27. package/src/lib/components/rows/index.js +6 -0
  28. package/src/lib/components/rows/loading-rows.d.ts +5 -0
  29. package/src/lib/components/rows/loading-rows.js +49 -0
  30. package/src/lib/components/table/data-table.d.ts +3 -0
  31. package/src/lib/components/table/data-table.js +492 -0
  32. package/src/lib/components/table/data-table.types.d.ts +114 -0
  33. package/src/lib/components/table/data-table.types.js +2 -0
  34. package/{lib/components/table/index.js → src/lib/components/table/index.d.ts} +0 -3
  35. package/src/lib/components/table/index.js +5 -0
  36. package/src/lib/components/toolbar/bulk-actions-toolbar.d.ts +9 -0
  37. package/src/lib/components/toolbar/bulk-actions-toolbar.js +25 -0
  38. package/src/lib/components/toolbar/column-custom-filter-control.d.ts +1 -0
  39. package/src/lib/components/toolbar/column-custom-filter-control.js +137 -0
  40. package/src/lib/components/toolbar/column-pinning-control.d.ts +1 -0
  41. package/src/lib/components/toolbar/column-pinning-control.js +105 -0
  42. package/src/lib/components/toolbar/column-reset-control.d.ts +1 -0
  43. package/src/lib/components/toolbar/column-reset-control.js +16 -0
  44. package/src/lib/components/toolbar/column-visibility-control.d.ts +1 -0
  45. package/src/lib/components/toolbar/column-visibility-control.js +31 -0
  46. package/src/lib/components/toolbar/data-table-toolbar.d.ts +14 -0
  47. package/src/lib/components/toolbar/data-table-toolbar.js +26 -0
  48. package/{lib/components/toolbar/index.js → src/lib/components/toolbar/index.d.ts} +1 -6
  49. package/src/lib/components/toolbar/index.js +17 -0
  50. package/src/lib/components/toolbar/table-export-control.d.ts +25 -0
  51. package/src/lib/components/toolbar/table-export-control.js +93 -0
  52. package/src/lib/components/toolbar/table-search-control.d.ts +1 -0
  53. package/src/lib/components/toolbar/table-search-control.js +61 -0
  54. package/src/lib/components/toolbar/table-size-control.d.ts +1 -0
  55. package/src/lib/components/toolbar/table-size-control.js +36 -0
  56. package/src/lib/contexts/data-table-context.d.ts +43 -0
  57. package/{lib → src/lib}/contexts/data-table-context.js +12 -8
  58. package/src/lib/examples/advanced-features-example.d.ts +1 -0
  59. package/src/lib/examples/advanced-features-example.js +264 -0
  60. package/src/lib/examples/bulk-actions-test.d.ts +1 -0
  61. package/src/lib/examples/bulk-actions-test.js +44 -0
  62. package/src/lib/examples/custom-column-filter-example.d.ts +1 -0
  63. package/{lib → src/lib}/examples/custom-column-filter-example.js +10 -10
  64. package/src/lib/examples/index.js +13 -0
  65. package/src/lib/examples/selection-test-example.d.ts +1 -0
  66. package/src/lib/examples/selection-test-example.js +101 -0
  67. package/src/lib/examples/simple-local-example.d.ts +1 -0
  68. package/{lib → src/lib}/examples/simple-local-example.js +14 -18
  69. package/src/lib/features/custom-column-filter.feature.d.ts +45 -0
  70. package/{lib → src/lib}/features/custom-column-filter.feature.js +40 -99
  71. package/src/lib/features/custom-selection.feature.d.ts +46 -0
  72. package/{lib → src/lib}/features/custom-selection.feature.js +18 -70
  73. package/src/lib/features/index.d.ts +2 -0
  74. package/src/lib/features/index.js +8 -0
  75. package/src/lib/hooks/index.d.ts +1 -0
  76. package/src/lib/hooks/index.js +4 -0
  77. package/src/lib/hooks/use-data-table-api.d.ts +56 -0
  78. package/{lib → src/lib}/hooks/use-data-table-api.js +79 -136
  79. package/src/lib/icons/add-icon.d.ts +2 -0
  80. package/src/lib/icons/add-icon.js +8 -0
  81. package/src/lib/icons/csv-icon.d.ts +2 -0
  82. package/src/lib/icons/csv-icon.js +8 -0
  83. package/src/lib/icons/delete-icon.d.ts +2 -0
  84. package/src/lib/icons/delete-icon.js +8 -0
  85. package/src/lib/icons/excel-icon.d.ts +2 -0
  86. package/src/lib/icons/excel-icon.js +8 -0
  87. package/src/lib/icons/index.js +17 -0
  88. package/src/lib/icons/unpin-icon.d.ts +2 -0
  89. package/src/lib/icons/unpin-icon.js +8 -0
  90. package/src/lib/icons/view-comfortable-icon.d.ts +2 -0
  91. package/src/lib/icons/view-comfortable-icon.js +8 -0
  92. package/src/lib/icons/view-compact-icon.d.ts +2 -0
  93. package/src/lib/icons/view-compact-icon.js +8 -0
  94. package/src/lib/types/column.types.d.ts +29 -0
  95. package/src/lib/types/column.types.js +5 -0
  96. package/src/lib/types/data-table-api.d.ts +134 -0
  97. package/src/lib/types/data-table-api.js +2 -0
  98. package/src/lib/types/export.types.d.ts +99 -0
  99. package/src/lib/types/export.types.js +2 -0
  100. package/src/lib/types/index.d.ts +6 -0
  101. package/src/lib/types/index.js +8 -0
  102. package/src/lib/types/slots.types.d.ts +272 -0
  103. package/src/lib/types/slots.types.js +2 -0
  104. package/src/lib/types/table.types.d.ts +63 -0
  105. package/src/lib/types/table.types.js +2 -0
  106. package/src/lib/utils/column-helpers.d.ts +7 -0
  107. package/src/lib/utils/column-helpers.js +43 -0
  108. package/src/lib/utils/debounced-fetch.utils.d.ts +11 -0
  109. package/{lib → src/lib}/utils/debounced-fetch.utils.js +15 -17
  110. package/src/lib/utils/export-utils.d.ts +30 -0
  111. package/src/lib/utils/export-utils.js +152 -0
  112. package/{lib/utils/index.js → src/lib/utils/index.d.ts} +0 -10
  113. package/src/lib/utils/index.js +10 -0
  114. package/src/lib/utils/slot-helpers.d.ts +9 -0
  115. package/src/lib/utils/slot-helpers.js +21 -0
  116. package/src/lib/utils/special-columns.utils.d.ts +6 -0
  117. package/src/lib/utils/special-columns.utils.js +52 -0
  118. package/src/lib/utils/styling-helpers.d.ts +36 -0
  119. package/src/lib/utils/styling-helpers.js +61 -0
  120. package/src/lib/utils/table-helpers.d.ts +9 -0
  121. package/{lib → src/lib}/utils/table-helpers.js +16 -31
  122. package/tsconfig.tsbuildinfo +1 -0
  123. package/LICENSE +0 -21
  124. package/index.d.ts.map +0 -1
  125. package/lib/components/droupdown/menu-dropdown.d.ts.map +0 -1
  126. package/lib/components/droupdown/menu-dropdown.js +0 -47
  127. package/lib/components/export-progress-dialog.d.ts.map +0 -1
  128. package/lib/components/export-progress-dialog.js +0 -30
  129. package/lib/components/filters/filter-value-input.d.ts.map +0 -1
  130. package/lib/components/filters/filter-value-input.js +0 -64
  131. package/lib/components/filters/index.d.ts.map +0 -1
  132. package/lib/components/headers/draggable-header.d.ts.map +0 -1
  133. package/lib/components/headers/index.d.ts.map +0 -1
  134. package/lib/components/headers/table-header.d.ts.map +0 -1
  135. package/lib/components/headers/table-header.js +0 -59
  136. package/lib/components/index.d.ts.map +0 -1
  137. package/lib/components/index.js +0 -18
  138. package/lib/components/pagination/data-table-pagination.d.ts.map +0 -1
  139. package/lib/components/pagination/data-table-pagination.js +0 -24
  140. package/lib/components/pagination/index.d.ts.map +0 -1
  141. package/lib/components/pagination/index.js +0 -4
  142. package/lib/components/rows/data-table-row.d.ts.map +0 -1
  143. package/lib/components/rows/data-table-row.js +0 -42
  144. package/lib/components/rows/empty-data-row.d.ts.map +0 -1
  145. package/lib/components/rows/empty-data-row.js +0 -8
  146. package/lib/components/rows/index.d.ts.map +0 -1
  147. package/lib/components/rows/loading-rows.d.ts.map +0 -1
  148. package/lib/components/rows/loading-rows.js +0 -46
  149. package/lib/components/table/data-table.d.ts.map +0 -1
  150. package/lib/components/table/data-table.js +0 -663
  151. package/lib/components/table/data-table.types.d.ts.map +0 -1
  152. package/lib/components/table/data-table.types.js +0 -6
  153. package/lib/components/table/index.d.ts.map +0 -1
  154. package/lib/components/toolbar/bulk-actions-toolbar.d.ts.map +0 -1
  155. package/lib/components/toolbar/bulk-actions-toolbar.js +0 -31
  156. package/lib/components/toolbar/column-custom-filter-control.d.ts.map +0 -1
  157. package/lib/components/toolbar/column-custom-filter-control.js +0 -149
  158. package/lib/components/toolbar/column-custum-filter-control.d.ts.map +0 -1
  159. package/lib/components/toolbar/column-custum-filter-control.js +0 -150
  160. package/lib/components/toolbar/column-pinning-control.d.ts.map +0 -1
  161. package/lib/components/toolbar/column-pinning-control.js +0 -103
  162. package/lib/components/toolbar/column-reset-control.d.ts.map +0 -1
  163. package/lib/components/toolbar/column-reset-control.js +0 -13
  164. package/lib/components/toolbar/column-visibility-control.d.ts.map +0 -1
  165. package/lib/components/toolbar/column-visibility-control.js +0 -27
  166. package/lib/components/toolbar/data-table-toolbar.d.ts.map +0 -1
  167. package/lib/components/toolbar/data-table-toolbar.js +0 -23
  168. package/lib/components/toolbar/index.d.ts.map +0 -1
  169. package/lib/components/toolbar/table-export-control.d.ts.map +0 -1
  170. package/lib/components/toolbar/table-export-control.js +0 -94
  171. package/lib/components/toolbar/table-search-control.d.ts.map +0 -1
  172. package/lib/components/toolbar/table-search-control.js +0 -61
  173. package/lib/components/toolbar/table-size-control.d.ts.map +0 -1
  174. package/lib/components/toolbar/table-size-control.js +0 -33
  175. package/lib/contexts/data-table-context.d.ts.map +0 -1
  176. package/lib/examples/advanced-features-example.d.ts.map +0 -1
  177. package/lib/examples/advanced-features-example.js +0 -282
  178. package/lib/examples/basic-example.d.ts.map +0 -1
  179. package/lib/examples/basic-example.js +0 -323
  180. package/lib/examples/bulk-actions-test.d.ts.map +0 -1
  181. package/lib/examples/bulk-actions-test.js +0 -47
  182. package/lib/examples/crud-api-example.d.ts.map +0 -1
  183. package/lib/examples/crud-api-example.js +0 -321
  184. package/lib/examples/custom-column-filter-example.d.ts.map +0 -1
  185. package/lib/examples/custom-selection-example.d.ts.map +0 -1
  186. package/lib/examples/custom-selection-example.js +0 -184
  187. package/lib/examples/export-callbacks-example.d.ts.map +0 -1
  188. package/lib/examples/export-callbacks-example.js +0 -155
  189. package/lib/examples/improved-export-example.d.ts.map +0 -1
  190. package/lib/examples/improved-export-example.js +0 -153
  191. package/lib/examples/improved-server-selection-example.d.ts.map +0 -1
  192. package/lib/examples/improved-server-selection-example.js +0 -118
  193. package/lib/examples/index.d.ts.map +0 -1
  194. package/lib/examples/selection-test-example.d.ts.map +0 -1
  195. package/lib/examples/selection-test-example.js +0 -111
  196. package/lib/examples/simple-local-example.d.ts.map +0 -1
  197. package/lib/examples/simple-server-selection-example.d.ts.map +0 -1
  198. package/lib/examples/simple-server-selection-example.js +0 -178
  199. package/lib/examples/virtualized-example.d.ts.map +0 -1
  200. package/lib/examples/virtualized-example.js +0 -119
  201. package/lib/features/custom-column-filter.feature.d.ts.map +0 -1
  202. package/lib/features/custom-selection.feature.d.ts.map +0 -1
  203. package/lib/features/index.d.ts.map +0 -1
  204. package/lib/features/index.js +0 -9
  205. package/lib/hooks/index.d.ts.map +0 -1
  206. package/lib/hooks/index.js +0 -6
  207. package/lib/hooks/use-data-table-api.d.ts.map +0 -1
  208. package/lib/hooks/use-table-state.d.ts.map +0 -1
  209. package/lib/hooks/use-table-state.js +0 -74
  210. package/lib/icons/add-icon.d.ts.map +0 -1
  211. package/lib/icons/add-icon.js +0 -5
  212. package/lib/icons/csv-icon.d.ts.map +0 -1
  213. package/lib/icons/csv-icon.js +0 -5
  214. package/lib/icons/delete-icon.d.ts.map +0 -1
  215. package/lib/icons/delete-icon.js +0 -5
  216. package/lib/icons/excel-icon.d.ts.map +0 -1
  217. package/lib/icons/excel-icon.js +0 -5
  218. package/lib/icons/index.d.ts.map +0 -1
  219. package/lib/icons/unpin-icon.d.ts.map +0 -1
  220. package/lib/icons/unpin-icon.js +0 -5
  221. package/lib/icons/view-comfortable-icon.d.ts.map +0 -1
  222. package/lib/icons/view-comfortable-icon.js +0 -5
  223. package/lib/icons/view-compact-icon.d.ts.map +0 -1
  224. package/lib/icons/view-compact-icon.js +0 -5
  225. package/lib/types/column.types.d.ts.map +0 -1
  226. package/lib/types/column.types.js +0 -2
  227. package/lib/types/data-table-api.d.ts.map +0 -1
  228. package/lib/types/data-table-api.js +0 -1
  229. package/lib/types/export.types.d.ts.map +0 -1
  230. package/lib/types/export.types.js +0 -5
  231. package/lib/types/hooks.types.d.ts.map +0 -1
  232. package/lib/types/hooks.types.js +0 -1
  233. package/lib/types/index.d.ts.map +0 -1
  234. package/lib/types/index.js +0 -14
  235. package/lib/types/slots.types.d.ts.map +0 -1
  236. package/lib/types/slots.types.js +0 -1
  237. package/lib/types/table.types.d.ts.map +0 -1
  238. package/lib/types/table.types.js +0 -1
  239. package/lib/utils/column-helpers.d.ts.map +0 -1
  240. package/lib/utils/column-helpers.js +0 -46
  241. package/lib/utils/debounced-fetch.utils.d.ts.map +0 -1
  242. package/lib/utils/export-utils.d.ts.map +0 -1
  243. package/lib/utils/export-utils.js +0 -181
  244. package/lib/utils/index.d.ts.map +0 -1
  245. package/lib/utils/selection-helpers.d.ts.map +0 -1
  246. package/lib/utils/selection-helpers.js +0 -162
  247. package/lib/utils/slot-helpers.d.ts.map +0 -1
  248. package/lib/utils/slot-helpers.js +0 -27
  249. package/lib/utils/special-columns.utils.d.ts.map +0 -1
  250. package/lib/utils/special-columns.utils.js +0 -77
  251. package/lib/utils/styling-helpers.d.ts.map +0 -1
  252. package/lib/utils/styling-helpers.js +0 -97
  253. package/lib/utils/table-helpers.d.ts.map +0 -1
  254. package/lib/utils/value-helpers.d.ts.map +0 -1
  255. package/lib/utils/value-helpers.js +0 -48
  256. package/tsconfig.lib.tsbuildinfo +0 -1
  257. /package/{lib/examples/index.js → src/lib/examples/index.d.ts} +0 -0
  258. /package/{lib/icons/index.js → src/lib/icons/index.d.ts} +0 -0
@@ -1,40 +1,31 @@
1
- /**
2
- * General table utilities for DataTable components
3
- */
4
- /**
5
- * Calculate skeleton rows count based on viewport and row height
6
- */
7
- export function calculateSkeletonRows(containerHeight, rowHeight, maxRows = 10) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateSkeletonRows = calculateSkeletonRows;
4
+ exports.generateRowId = generateRowId;
5
+ exports.calculatePinnedColumnsWidth = calculatePinnedColumnsWidth;
6
+ exports.shouldUseFixedLayout = shouldUseFixedLayout;
7
+ exports.formatCellValue = formatCellValue;
8
+ exports.debounce = debounce;
9
+ exports.calculateTableMetrics = calculateTableMetrics;
10
+ function calculateSkeletonRows(containerHeight, rowHeight, maxRows = 10) {
8
11
  const estimatedRows = Math.ceil(containerHeight / rowHeight);
9
12
  return Math.min(estimatedRows, maxRows);
10
13
  }
11
- /**
12
- * Generate unique row ID for virtualization
13
- */
14
- export function generateRowId(row, index, idKey) {
14
+ function generateRowId(row, index, idKey) {
15
15
  if (idKey && row[idKey]) {
16
16
  return String(row[idKey]);
17
17
  }
18
18
  return `row-${index}`;
19
19
  }
20
- /**
21
- * Calculate total width of pinned columns
22
- */
23
- export function calculatePinnedColumnsWidth(columns, side) {
20
+ function calculatePinnedColumnsWidth(columns, side) {
24
21
  return columns
25
22
  .filter(col => col.getIsPinned() === side)
26
23
  .reduce((total, col) => total + (col.getSize() || 0), 0);
27
24
  }
28
- /**
29
- * Check if table should use fixed layout
30
- */
31
- export function shouldUseFixedLayout(fitToScreen, enableColumnResizing, totalColumns) {
25
+ function shouldUseFixedLayout(fitToScreen, enableColumnResizing, totalColumns) {
32
26
  return fitToScreen || (enableColumnResizing && totalColumns > 5);
33
27
  }
34
- /**
35
- * Format cell value based on column type
36
- */
37
- export function formatCellValue(value, type) {
28
+ function formatCellValue(value, type) {
38
29
  if (value === null || value === undefined) {
39
30
  return '-';
40
31
  }
@@ -49,20 +40,14 @@ export function formatCellValue(value, type) {
49
40
  return String(value);
50
41
  }
51
42
  }
52
- /**
53
- * Debounce function for search and filters
54
- */
55
- export function debounce(func, wait) {
43
+ function debounce(func, wait) {
56
44
  let timeout;
57
45
  return (...args) => {
58
46
  clearTimeout(timeout);
59
47
  timeout = setTimeout(() => func(...args), wait);
60
48
  };
61
49
  }
62
- /**
63
- * Get table performance metrics
64
- */
65
- export function calculateTableMetrics(totalRows, visibleRows, columns, renderStartTime) {
50
+ function calculateTableMetrics(totalRows, visibleRows, columns, renderStartTime) {
66
51
  return {
67
52
  totalRows,
68
53
  visibleRows,
@@ -0,0 +1 @@
1
+ {"version":"5.8.3"}
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 ACK Plus
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/index.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0CAA0C,CAAC;AAGzD,OAAO,EACH,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACnB,MAAM,0BAA0B,CAAC;AAGlC,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAGxE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAG1C,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAG5B,YAAY,EACR,MAAM,EACN,SAAS,EACT,GAAG,EACH,KAAK,EACL,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,GAClB,MAAM,uBAAuB,CAAC;AAG/B,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"menu-dropdown.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/droupdown/menu-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAEH,YAAY,EACZ,SAAS,EAIZ,MAAM,OAAO,CAAC;AAGf,KAAK,aAAa,GAAG;IACjB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,WAAW,GAAG;IACf,MAAM,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,iBACb,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAAC;IAC5C,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,aAAa,KAAK,SAAS,CAAC,GAAG,SAAS,GAAG,GAAG,CAAC;IACnE,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,WAAW,KAAK,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IACzE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,OAAO,GAAG,OAAO,IAAI,CAAC;CAC5C;AAED,wBAAgB,YAAY,CAAC,EACzB,QAAQ,EACR,MAAM,EACN,KAAK,EACL,SAAS,EACT,EAAE,EACF,GAAG,KAAK,EACX,EAAE,iBAAiB,2CA8DnB"}
@@ -1,47 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Popover } from '@mui/material';
3
- import { cloneElement, useCallback, useMemo, useState, } from 'react';
4
- export function MenuDropdown({ children, anchor, label, component, sx, ...props }) {
5
- const [anchorEl, setAnchorEl] = useState(null);
6
- const isOpen = useMemo(() => Boolean(anchorEl), [anchorEl]);
7
- const handleClick = useCallback((event) => {
8
- event.preventDefault();
9
- event.stopPropagation();
10
- setAnchorEl(event.currentTarget);
11
- }, []);
12
- const handleClose = useCallback((event) => {
13
- event?.preventDefault();
14
- event?.stopPropagation();
15
- setAnchorEl(null);
16
- }, []);
17
- const anchorNode = useMemo(() => {
18
- if (anchor) {
19
- let node = anchor;
20
- if (typeof anchor === 'function') {
21
- node = anchor({ isOpen: isOpen });
22
- }
23
- return cloneElement(node, {
24
- onClick: handleClick,
25
- });
26
- }
27
- return _jsx(Button, { onClick: handleClick, children: label });
28
- }, [
29
- anchor,
30
- handleClick,
31
- isOpen,
32
- label,
33
- ]);
34
- const DropDownComponent = (component || Popover);
35
- return (_jsxs(_Fragment, { children: [anchorNode, _jsx(DropDownComponent, { anchorEl: anchorEl, open: isOpen, onClose: handleClose, anchorOrigin: {
36
- vertical: 'bottom',
37
- horizontal: 'left',
38
- }, transformOrigin: {
39
- vertical: 'top',
40
- horizontal: 'left',
41
- }, ...props, children: typeof children === 'function' ?
42
- children({
43
- handleClose,
44
- open: isOpen,
45
- }) :
46
- children })] }));
47
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"export-progress-dialog.d.ts","sourceRoot":"","sources":["../../../src/lib/components/export-progress-dialog.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxD,UAAU,yBAAyB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CAChC;AAED,wBAAgB,oBAAoB,CAAC,EACjC,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAO,EACP,UAAkB,GACrB,EAAE,yBAAyB,2CAkK3B"}
@@ -1,30 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Dialog, DialogTitle, DialogContent, DialogActions, Button, LinearProgress, Typography, Box, Chip, } from '@mui/material';
3
- export function ExportProgressDialog({ open, progress, result, onCancel, onClose, exportType = 'csv', }) {
4
- const formatTime = (milliseconds) => {
5
- if (milliseconds < 1000)
6
- return `${milliseconds}ms`;
7
- const seconds = Math.round(milliseconds / 1000);
8
- if (seconds < 60)
9
- return `${seconds}s`;
10
- const minutes = Math.floor(seconds / 60);
11
- const remainingSeconds = seconds % 60;
12
- return `${minutes}m ${remainingSeconds}s`;
13
- };
14
- const formatFileSize = (bytes) => {
15
- if (bytes === 0)
16
- return '0 Bytes';
17
- const k = 1024;
18
- const sizes = [
19
- 'Bytes',
20
- 'KB',
21
- 'MB',
22
- 'GB',
23
- ];
24
- const i = Math.floor(Math.log(bytes) / Math.log(k));
25
- return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
26
- };
27
- const isCompleted = !!result;
28
- const isExporting = !!progress && !isCompleted;
29
- return (_jsxs(Dialog, { open: open, onClose: isExporting ? undefined : onClose, maxWidth: "sm", fullWidth: true, disableEscapeKeyDown: isExporting, children: [_jsx(DialogTitle, { children: isCompleted ? 'Export Completed' : `Exporting to ${exportType.toUpperCase()}` }), _jsxs(DialogContent, { children: [isExporting && progress ? (_jsxs(Box, { children: [_jsxs(Typography, { variant: "body2", color: "text.secondary", gutterBottom: true, children: ["Processing", ' ', progress.processedRows.toLocaleString(), ' ', "of", ' ', progress.totalRows.toLocaleString(), ' ', "rows"] }), _jsx(LinearProgress, { variant: "determinate", value: progress.percentage, sx: { mb: 2 } }), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2, children: [_jsxs(Typography, { variant: "body2", children: [progress.percentage, "% Complete"] }), _jsx(Chip, { label: `Chunk ${progress.currentChunk} / ${progress.totalChunks}`, size: "small", variant: "outlined" })] }), progress.estimatedTimeRemaining !== undefined && (_jsxs(Typography, { variant: "body2", color: "text.secondary", children: ["Estimated time remaining:", ' ', formatTime(progress.estimatedTimeRemaining)] }))] })) : null, isCompleted && result ? (_jsxs(Box, { children: [_jsx(Typography, { variant: "body1", gutterBottom: true, children: "Export completed successfully!" }), _jsxs(Box, { display: "flex", flexDirection: "column", gap: 1, mt: 2, children: [_jsxs(Typography, { variant: "body2", children: [_jsx("strong", { children: "Filename:" }), ' ', result.filename] }), _jsxs(Typography, { variant: "body2", children: [_jsx("strong", { children: "Rows:" }), ' ', result.totalRows.toLocaleString()] }), _jsxs(Typography, { variant: "body2", children: [_jsx("strong", { children: "Columns:" }), ' ', result.totalColumns] }), _jsxs(Typography, { variant: "body2", children: [_jsx("strong", { children: "Processing time:" }), ' ', formatTime(result.processingTime)] }), result.fileSize ? (_jsxs(Typography, { variant: "body2", children: [_jsx("strong", { children: "File size:" }), ' ', formatFileSize(result.fileSize)] })) : null] })] })) : null] }), _jsxs(DialogActions, { children: [isExporting && onCancel ? (_jsx(Button, { onClick: onCancel, color: "secondary", children: "Cancel Export" })) : null, isCompleted && onClose ? (_jsx(Button, { onClick: onClose, color: "primary", variant: "contained", children: "Close" })) : null] })] }));
30
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"filter-value-input.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/filters/filter-value-input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,UAAU,qBAAqB,CAAC,CAAC;IAC7B,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACvB,aAAa,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,EAChC,MAAM,EACN,MAAM,EACN,aAAa,GAChB,EAAE,qBAAqB,CAAC,CAAC,CAAC,2CAgK1B"}
@@ -1,64 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { FormControl, InputLabel, Select, MenuItem, TextField, Checkbox, ListItemText } from '@mui/material';
3
- import { DatePicker } from '@mui/x-date-pickers/DatePicker';
4
- import moment from 'moment';
5
- import { getColumnOptions, getColumnType, getCustomFilterComponent } from '../../utils/column-helpers';
6
- import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
7
- import { LocalizationProvider } from '@mui/x-date-pickers';
8
- export function FilterValueInput({ filter, column, onValueChange, }) {
9
- const columnType = getColumnType(column);
10
- const customComponent = getCustomFilterComponent(column);
11
- const options = getColumnOptions(column);
12
- const operator = filter.operator;
13
- // If custom component is provided, use it
14
- if (customComponent) {
15
- const CustomComponent = customComponent;
16
- return (_jsx(CustomComponent, { value: filter.value, onChange: onValueChange, filter: filter, column: column }));
17
- }
18
- // Boolean type - Yes/No select
19
- if (columnType === 'boolean') {
20
- return (_jsxs(FormControl, { size: "small", sx: {
21
- flex: 1,
22
- minWidth: 120,
23
- }, children: [_jsx(InputLabel, { children: "Value" }), _jsxs(Select, { value: filter.value || 'any', label: "Value", onChange: (e) => onValueChange(e.target.value), children: [_jsx(MenuItem, { value: 'any', children: "Any" }, 'any'), _jsx(MenuItem, { value: 'true', children: "True" }, 'true'), _jsx(MenuItem, { value: 'false', children: "False" }, 'false')] })] }));
24
- }
25
- // Select type with options
26
- if (columnType === 'select' && options.length > 0) {
27
- // Multi-select for 'in' and 'notIn' operators
28
- if (operator === 'in' || operator === 'notIn') {
29
- return (_jsxs(FormControl, { size: "small", sx: { flex: 1, minWidth: 120 }, children: [_jsx(InputLabel, { children: "Value" }), _jsx(Select, { multiple: true, value: Array.isArray(filter.value) ? filter.value : [], label: "Value", onChange: (e) => onValueChange(e.target.value), renderValue: (selected) => selected.map(val => {
30
- const opt = options.find(o => o.value === val);
31
- return opt ? opt.label : val;
32
- }).join(', '), children: options.map(option => (_jsxs(MenuItem, { value: option.value, children: [_jsx(Checkbox, { checked: Array.isArray(filter.value) && filter.value.indexOf(option.value) > -1 }), _jsx(ListItemText, { primary: option.label })] }, String(option.value)))) })] }));
33
- }
34
- // Single select for other operators
35
- return (_jsxs(FormControl, { size: "small", sx: { flex: 1, minWidth: 120 }, children: [_jsx(InputLabel, { children: "Value" }), _jsx(Select, { value: filter.value, label: "Value", onChange: (e) => onValueChange(e.target.value), children: options.map(option => (_jsx(MenuItem, { value: option.value, children: option.label }, String(option.value)))) })] }));
36
- }
37
- // Date type
38
- if (columnType === 'date') {
39
- // Only single date picker, no 'between' support
40
- return (_jsx(LocalizationProvider, { dateAdapter: AdapterMoment, children: _jsx(DatePicker, { value: filter.value ? moment(filter.value) : null, onChange: (e) => onValueChange(e?.toDate()), slotProps: {
41
- textField: {
42
- size: 'small',
43
- label: 'Value',
44
- sx: {
45
- flex: 1,
46
- minWidth: 120,
47
- },
48
- },
49
- } }) }));
50
- }
51
- // Number type
52
- if (columnType === 'number') {
53
- // Only single number input, no 'between' support
54
- return (_jsx(TextField, { size: "small", label: "Value", value: filter.value, onChange: (e) => onValueChange(e.target.value), type: "number", sx: {
55
- flex: 1,
56
- minWidth: 120,
57
- } }));
58
- }
59
- // Default: text input
60
- return (_jsx(TextField, { size: "small", label: "Value", value: filter.value, onChange: (e) => onValueChange(e.target.value), sx: {
61
- flex: 1,
62
- minWidth: 120,
63
- } }));
64
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/filters/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;CA2H5B,CAAC;AAEF,cAAc,sBAAsB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"draggable-header.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/headers/draggable-header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAc,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAwC,MAAM,OAAO,CAAC;AAK7D,UAAU,oBAAoB,CAAC,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,EAC/B,MAAM,EACN,aAAoB,EACpB,SAAiB,EACjB,eAAe,EACf,KAAK,EACL,SAAS,GACZ,EAAE,oBAAoB,CAAC,CAAC,CAAC,mRA8QzB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/headers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"table-header.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/headers/table-header.tsx"],"names":[],"mappings":"AAkBA,MAAM,WAAW,gBAAgB;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAC3B,SAAiB,EACjB,oBAA4B,EAC5B,kBAA0B,EAC1B,WAAkB,EAClB,eAAe,EACf,KAAK,EACL,SAAS,GACZ,EAAE,gBAAgB,2CAgFlB"}
@@ -1,59 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * TableHeader Component
4
- *
5
- * Unified header component that combines:
6
- * - Sortable functionality
7
- * - Draggable column reordering
8
- * - Column resizing
9
- * - Pinning support
10
- */
11
- import { TableHead, TableRow, TableCell, Box, useTheme } from '@mui/material';
12
- import { DraggableHeader } from './draggable-header';
13
- import { useDataTableContext } from '../../contexts/data-table-context';
14
- import { getPinnedColumnStyle, getColumnAlignment } from '../../utils';
15
- import { getSlotComponent } from '../../utils/slot-helpers';
16
- /**
17
- * Renders table headers with sorting, dragging, and resizing capabilities
18
- */
19
- export function TableHeader({ draggable = false, enableColumnResizing = false, enableStickyHeader = false, fitToScreen = true, onColumnReorder, slots, slotProps, }) {
20
- const theme = useTheme();
21
- const { table } = useDataTableContext();
22
- const HeaderCellSlot = getSlotComponent(slots, 'headerCell', TableCell);
23
- const HeaderRowSlot = getSlotComponent(slots, 'headerRow', TableRow);
24
- const HeaderSlot = getSlotComponent(slots, 'header', TableHead);
25
- const renderHeaderCell = (header) => {
26
- const isPinned = header.column.getIsPinned();
27
- const pinnedPosition = isPinned ? header.column.getStart('left') : undefined;
28
- const pinnedRightPosition = isPinned === 'right' ? header.column.getAfter('right') : undefined;
29
- const alignment = getColumnAlignment(header.column.columnDef);
30
- const enableSorting = header.column.getCanSort();
31
- return (_jsxs(HeaderCellSlot, { align: alignment, sx: {
32
- ...getPinnedColumnStyle({
33
- width: (fitToScreen && !enableColumnResizing) ? 'auto' : header.getSize(),
34
- isPinned,
35
- pinnedPosition,
36
- isLastLeftPinnedColumn: isPinned === 'left' && header.column.getIsLastColumn('left'),
37
- isFirstRightPinnedColumn: isPinned === 'right' && header.column.getIsFirstColumn('right'),
38
- pinnedRightPosition,
39
- zIndex: isPinned ? 10 : 1,
40
- disableStickyHeader: enableStickyHeader,
41
- }),
42
- }, ...slotProps?.headerCell, children: [_jsx(DraggableHeader, { header: header, enableSorting: enableSorting, draggable: !!(draggable && !isPinned), onColumnReorder: onColumnReorder, slots: slots, slotProps: slotProps }), enableColumnResizing && header.column.getCanResize() ? (_jsx(Box, { onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), sx: {
43
- position: 'absolute',
44
- right: 0,
45
- top: '25%',
46
- height: '50%',
47
- width: '3px',
48
- cursor: 'col-resize',
49
- userSelect: 'none',
50
- touchAction: 'none',
51
- borderRadius: '4px',
52
- backgroundColor: header.column.getIsResizing() ? 'primary.main' : theme.palette.grey[300],
53
- '&:hover': {
54
- backgroundColor: theme.palette.primary.main,
55
- },
56
- } })) : null] }, header.id));
57
- };
58
- return (_jsx(HeaderSlot, { ...slotProps?.header, children: table.getHeaderGroups().map(headerGroup => (_jsx(HeaderRowSlot, { ...slotProps?.headerRow, children: headerGroup.headers.map(renderHeaderCell) }, headerGroup.id))) }));
59
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,QAAQ,CAAC;AAGvB,cAAc,WAAW,CAAC;AAG1B,cAAc,WAAW,CAAC;AAI1B,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC"}
@@ -1,18 +0,0 @@
1
- /**
2
- * DataTable Components
3
- *
4
- * Organized component exports for the MUI TanStack DataTable
5
- */
6
- // Main table components
7
- export * from './table';
8
- // Header components
9
- export * from './headers';
10
- // Row components
11
- export * from './rows';
12
- // Toolbar components
13
- export * from './toolbar';
14
- // Filter components
15
- export * from './filters';
16
- // Pagination components
17
- export * from './pagination';
18
- export * from './droupdown/menu-dropdown';
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-table-pagination.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/pagination/data-table-pagination.tsx"],"names":[],"mappings":"AACA,OAAO,EAAwB,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAKxC,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,cAAc,GAAG,qBAAqB,CAAC;IACnJ,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE;QACR,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KACpB,CAAC;CACL;AAED,eAAO,MAAM,mBAAmB,yFAK7B,wBAAwB,6CAuCzB,CAAA"}
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // data-table-pagination.tsx
3
- import { TablePagination, Box } from '@mui/material';
4
- import { memo } from 'react';
5
- import { useDataTableContext } from '../../contexts/data-table-context';
6
- export const DataTablePagination = memo(({ footerFilter = null, pagination, totalRow, ...props }) => {
7
- const { table } = useDataTableContext();
8
- // console.log('DataTablePagination', pagination);
9
- return (_jsxs(Box, { sx: {
10
- display: 'flex',
11
- alignItems: 'center',
12
- gap: 1,
13
- justifyContent: 'space-between',
14
- px: 2,
15
- }, children: [footerFilter, _jsx(TablePagination, { component: "div", count: totalRow, rowsPerPage: pagination?.pageSize, page: pagination?.pageIndex, onPageChange: (_, page) => {
16
- // Use TanStack Table's native pagination methods
17
- table.setPageIndex(page);
18
- }, onRowsPerPageChange: e => {
19
- const newPageSize = Number(e.target.value);
20
- // Use TanStack Table's native pagination methods
21
- table.setPageIndex(0);
22
- table.setPageSize(newPageSize);
23
- }, showFirstButton: true, showLastButton: true, labelRowsPerPage: "Rows per page:", labelDisplayedRows: ({ from, to, count }) => `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`, ...props })] }));
24
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/pagination/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,yBAAyB,CAAC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * Pagination components for DataTable
3
- */
4
- export * from './data-table-pagination';
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-table-row.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/rows/data-table-row.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAc,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlC,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAChC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;IAChD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC5B,GAAG,EACH,WAAkB,EAClB,aAAqB,EACrB,KAAa,EACb,kBAAkB,EAClB,mBAA2B,EAC3B,KAAK,EACL,SAAS,GACZ,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CA6DtB"}
@@ -1,42 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * DataTableRow Component
4
- *
5
- * Renders individual table rows with support for:
6
- * - Column pinning
7
- * - Row expansion
8
- * - Hover effects
9
- * - Striped styling
10
- */
11
- import { TableRow, TableCell, Collapse } from '@mui/material';
12
- import { flexRender } from '@tanstack/react-table';
13
- import { getPinnedColumnStyle, getColumnAlignment } from '../../utils';
14
- import { getSlotComponent } from '../../utils/slot-helpers';
15
- /**
16
- * Individual table row component with cell rendering and expansion support
17
- */
18
- export function DataTableRow({ row, enableHover = true, enableStripes = false, isOdd = false, renderSubComponent, disableStickyHeader = false, slots, slotProps, }) {
19
- const CellSlot = getSlotComponent(slots, 'cell', TableCell);
20
- const ExpandedRowSlot = getSlotComponent(slots, 'expandedRow', TableRow);
21
- const TableRowSlot = getSlotComponent(slots, 'row', TableRow);
22
- return (_jsxs(_Fragment, { children: [_jsx(TableRowSlot, { hover: enableHover, sx: {
23
- backgroundColor: enableStripes && isOdd ? 'action.hover' : 'transparent',
24
- }, children: row.getVisibleCells().map(cell => {
25
- const isPinned = cell.column.getIsPinned();
26
- const pinnedPosition = isPinned ? cell.column.getStart('left') : undefined;
27
- const pinnedRightPosition = isPinned === 'right' ? cell.column.getAfter('right') : undefined;
28
- const alignment = getColumnAlignment(cell.column.columnDef);
29
- return (_jsx(CellSlot, { align: alignment, sx: {
30
- ...getPinnedColumnStyle({
31
- width: cell.column.getSize() || 'auto',
32
- isPinned,
33
- pinnedPosition,
34
- pinnedRightPosition,
35
- zIndex: isPinned ? 9 : 1,
36
- disableStickyHeader,
37
- isLastLeftPinnedColumn: isPinned === 'left' && cell.column.getIsLastColumn('left'),
38
- isFirstRightPinnedColumn: isPinned === 'right' && cell.column.getIsFirstColumn('right'),
39
- }),
40
- }, ...slotProps?.cell, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id));
41
- }) }), row.getIsExpanded() && renderSubComponent ? (_jsx(ExpandedRowSlot, { children: _jsx(CellSlot, { colSpan: row.getVisibleCells().length + 1, sx: { py: 0 }, children: _jsx(Collapse, { in: row.getIsExpanded(), timeout: "auto", unmountOnExit: true, children: renderSubComponent(row) }) }) })) : null] }));
42
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"empty-data-row.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/rows/empty-data-row.tsx"],"names":[],"mappings":"AAKA,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,2CAgBpK"}
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { TableCell, TableRow } from '@mui/material';
3
- import { getSlotComponent } from '../../utils/slot-helpers';
4
- export function EmptyDataRow({ colSpan, message, slots, slotProps }) {
5
- const EmptyRowSlot = getSlotComponent(slots, 'emptyRow', TableRow);
6
- const EmptyCellSlot = getSlotComponent(slots, 'cell', TableCell);
7
- return (_jsx(EmptyRowSlot, { children: _jsx(EmptyCellSlot, { colSpan: colSpan, align: "center", sx: { py: 4 }, ...slotProps?.emptyCell, children: message }) }));
8
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/rows/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"loading-rows.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/rows/loading-rows.tsx"],"names":[],"mappings":"AAQA,wBAAgB,WAAW,CAAC,EACxB,QAAY,EACZ,KAAK,EACL,SAAS,GACZ,EAAE;IACC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,2CA+FA"}
@@ -1,46 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { TableCell, TableRow } from '@mui/material';
3
- import { Skeleton } from '@mui/material';
4
- import { useDataTableContext } from '../../contexts/data-table-context';
5
- import { getPinnedColumnStyle } from '../../utils';
6
- import { getSlotComponent } from '../../utils/slot-helpers';
7
- export function LoadingRows({ rowCount = 5, slots, slotProps, }) {
8
- const { table } = useDataTableContext();
9
- const visibleColumns = table.getVisibleLeafColumns();
10
- const CellSlot = getSlotComponent(slots, 'cell', TableCell);
11
- const TableRowSlot = getSlotComponent(slots, 'row', TableRow);
12
- return (_jsx(_Fragment, { children: Array.from({ length: rowCount }, (_, rowIndex) => (_jsx(TableRowSlot, { ...slotProps?.row, children: visibleColumns.map((column, colIndex) => {
13
- const isPinned = column.getIsPinned();
14
- const pinnedPosition = isPinned ? column.getStart('left') : undefined;
15
- const pinnedRightPosition = isPinned === 'right' ? column.getAfter('right') : undefined;
16
- // Determine skeleton type based on column meta or content
17
- const columnMeta = column.columnDef?.meta;
18
- const isDateColumn = columnMeta?.type === 'date';
19
- const isBooleanColumn = columnMeta?.type === 'boolean';
20
- const isNumberColumn = columnMeta?.type === 'number';
21
- const isSelectionColumn = column.id === 'select';
22
- return (_jsx(CellSlot, { sx: getPinnedColumnStyle({
23
- width: column.getSize() || 'auto',
24
- isPinned,
25
- pinnedPosition,
26
- pinnedRightPosition,
27
- zIndex: isPinned ? 9 : 1,
28
- isLastLeftPinnedColumn: isPinned === 'left' && column.getIsLastColumn('left'),
29
- isFirstRightPinnedColumn: isPinned === 'right' && column.getIsFirstColumn('right'),
30
- }), ...slotProps?.cell, children: (() => {
31
- if (isSelectionColumn) {
32
- return (_jsx(Skeleton, { variant: "rectangular", width: 20, height: 20 }));
33
- }
34
- if (isBooleanColumn) {
35
- return (_jsx(Skeleton, { variant: "circular", width: 20, height: 20 }));
36
- }
37
- if (isDateColumn) {
38
- return (_jsx(Skeleton, { variant: "text", width: "80%", height: 20, animation: "wave" }));
39
- }
40
- if (isNumberColumn) {
41
- return (_jsx(Skeleton, { variant: "text", width: "60%", height: 20, animation: "wave" }));
42
- }
43
- return (_jsx(Skeleton, { variant: "text", width: `${Math.random() * 40 + 60}%`, height: 20, animation: "wave" }));
44
- })() }, `skeleton-${column.id || colIndex}-${rowIndex}`));
45
- }) }, `skeleton-row-${rowIndex}`))) }));
46
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/table/data-table.tsx"],"names":[],"mappings":"AA2CA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AA+B1D;;GAEG;AACH,eAAO,MAAM,SAAS,mHAw5BpB,CAAC"}