@rio-cloud/rio-uikit 2.3.0-beta.1 → 2.3.0-beta.2

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 (294) hide show
  1. package/DayPicker.js +6 -2
  2. package/DayPicker.js.map +1 -1
  3. package/DayPickerCalendar.d.ts +2 -0
  4. package/DayPickerCalendar.js +5 -0
  5. package/DayPickerCalendar.js.map +1 -0
  6. package/DayPickerPrototype.d.ts +2 -0
  7. package/DayPickerPrototype.js +5 -0
  8. package/DayPickerPrototype.js.map +1 -0
  9. package/TableNext.d.ts +2 -0
  10. package/TableNext.js +23 -0
  11. package/TableNext.js.map +1 -0
  12. package/TableToolbar.js +3 -2
  13. package/TableToolbar.js.map +1 -1
  14. package/components/assetTree/Tree.js +13 -13
  15. package/components/charts/Area.d.ts +5 -3
  16. package/components/charts/Area.js +4 -3
  17. package/components/charts/Area.js.map +1 -1
  18. package/components/charts/AreaChart.js.map +1 -1
  19. package/components/charts/ComposedChart.js.map +1 -1
  20. package/components/clearableInput/ClearableInput.d.ts +30 -0
  21. package/components/clearableInput/ClearableInput.js +81 -78
  22. package/components/clearableInput/ClearableInput.js.map +1 -1
  23. package/components/datepicker/DayPicker.d.ts +4 -51
  24. package/components/datepicker/DayPicker.js +264 -256
  25. package/components/datepicker/DayPicker.js.map +1 -1
  26. package/components/datepicker/DayPickerCalendar.d.ts +4 -0
  27. package/components/datepicker/DayPickerCalendar.js +129 -0
  28. package/components/datepicker/DayPickerCalendar.js.map +1 -0
  29. package/components/datepicker/DayPickerDropdown.d.ts +18 -0
  30. package/components/datepicker/DayPickerDropdown.js +75 -0
  31. package/components/datepicker/DayPickerDropdown.js.map +1 -0
  32. package/components/datepicker/DayPickerDropdownFooter.d.ts +7 -0
  33. package/components/datepicker/DayPickerDropdownFooter.js +7 -0
  34. package/components/datepicker/DayPickerDropdownFooter.js.map +1 -0
  35. package/components/datepicker/DayPickerDropdownSidebar.d.ts +8 -0
  36. package/components/datepicker/DayPickerDropdownSidebar.js +7 -0
  37. package/components/datepicker/DayPickerDropdownSidebar.js.map +1 -0
  38. package/components/datepicker/DayPickerInput.d.ts +28 -0
  39. package/components/datepicker/DayPickerInput.js +65 -0
  40. package/components/datepicker/DayPickerInput.js.map +1 -0
  41. package/components/datepicker/DayPickerPrototype.d.ts +53 -0
  42. package/components/datepicker/DayPickerPrototype.js +285 -0
  43. package/components/datepicker/DayPickerPrototype.js.map +1 -0
  44. package/components/datepicker/dayPickerRangeSelectionUtils.d.ts +15 -0
  45. package/components/datepicker/dayPickerRangeSelectionUtils.js +31 -0
  46. package/components/datepicker/dayPickerRangeSelectionUtils.js.map +1 -0
  47. package/components/datepicker/dayPickerTypes.d.ts +517 -0
  48. package/components/datepicker/dayPickerTypes.js +7 -0
  49. package/components/datepicker/dayPickerTypes.js.map +1 -0
  50. package/components/datepicker/dayPickerUtils.d.ts +10 -0
  51. package/components/datepicker/dayPickerUtils.js +92 -0
  52. package/components/datepicker/dayPickerUtils.js.map +1 -0
  53. package/components/datepicker/useDayPickerInputState.d.ts +32 -0
  54. package/components/datepicker/useDayPickerInputState.js +85 -0
  55. package/components/datepicker/useDayPickerInputState.js.map +1 -0
  56. package/components/datepicker/useStackedDayPickerCalendars.d.ts +5 -0
  57. package/components/datepicker/useStackedDayPickerCalendars.js +39 -0
  58. package/components/datepicker/useStackedDayPickerCalendars.js.map +1 -0
  59. package/components/divider/Divider.js +6 -6
  60. package/components/dropdown/ButtonDropdown.d.ts +4 -0
  61. package/components/dropdown/ButtonDropdown.js +70 -68
  62. package/components/dropdown/ButtonDropdown.js.map +1 -1
  63. package/components/dropdown/DropdownToggleButton.d.ts +1 -0
  64. package/components/dropdown/DropdownToggleButton.js +17 -15
  65. package/components/dropdown/DropdownToggleButton.js.map +1 -1
  66. package/components/fade/FadeExpander.js +17 -20
  67. package/components/fade/FadeExpander.js.map +1 -1
  68. package/components/loadMore/LoadMoreProgress.js +6 -7
  69. package/components/map/components/Map.js +3 -3
  70. package/components/map/utils/rendering.js +5 -5
  71. package/components/popover/Popover.js +4 -4
  72. package/components/radiobutton/RadioCardGroup.js +3 -3
  73. package/components/rioglyph/RioglyphIconType.d.ts +1 -1
  74. package/components/selects/Multiselect.d.ts +6 -0
  75. package/components/selects/Multiselect.js +164 -150
  76. package/components/selects/Multiselect.js.map +1 -1
  77. package/components/selects/Select.js +39 -37
  78. package/components/selects/Select.js.map +1 -1
  79. package/components/table/Table.d.ts +27 -248
  80. package/components/table/Table.js +237 -214
  81. package/components/table/Table.js.map +1 -1
  82. package/components/table/Table.types.d.ts +293 -121
  83. package/components/table/TableBody.d.ts +65 -5
  84. package/components/table/TableBody.js +132 -2
  85. package/components/table/TableBody.js.map +1 -1
  86. package/components/table/TableCardsSorting.js +25 -32
  87. package/components/table/TableCardsSorting.js.map +1 -1
  88. package/components/table/TableColumn.d.ts +13 -5
  89. package/components/table/TableColumn.js +112 -2
  90. package/components/table/TableColumn.js.map +1 -1
  91. package/components/table/TableExpandedContentRow.d.ts +7 -7
  92. package/components/table/TableExpandedContentRow.js +107 -2
  93. package/components/table/TableExpandedContentRow.js.map +1 -1
  94. package/components/table/TableExpandedRow.d.ts +9 -4
  95. package/components/table/TableExpandedRow.js +147 -2
  96. package/components/table/TableExpandedRow.js.map +1 -1
  97. package/components/table/TableExpanderButton.js +13 -11
  98. package/components/table/TableExpanderButton.js.map +1 -1
  99. package/components/table/TableFooter.d.ts +10 -6
  100. package/components/table/TableFooter.js +49 -2
  101. package/components/table/TableFooter.js.map +1 -1
  102. package/components/table/TableGroupFooterRow.d.ts +7 -7
  103. package/components/table/TableGroupFooterRow.js +27 -2
  104. package/components/table/TableGroupFooterRow.js.map +1 -1
  105. package/components/table/TableGroupRow.d.ts +7 -7
  106. package/components/table/TableGroupRow.js +33 -2
  107. package/components/table/TableGroupRow.js.map +1 -1
  108. package/components/table/TableHeader.d.ts +9 -4
  109. package/components/table/TableHeader.js +104 -2
  110. package/components/table/TableHeader.js.map +1 -1
  111. package/components/table/TableHeaderColumn.d.ts +14 -8
  112. package/components/table/TableHeaderColumn.js +78 -2
  113. package/components/table/TableHeaderColumn.js.map +1 -1
  114. package/components/table/TableHeaderRow.d.ts +1 -1
  115. package/components/table/TableHeaderRow.js +11 -2
  116. package/components/table/TableHeaderRow.js.map +1 -1
  117. package/components/table/TableRow.d.ts +9 -4
  118. package/components/table/TableRow.js +108 -2
  119. package/components/table/TableRow.js.map +1 -1
  120. package/components/table/TableSpacerRow.d.ts +3 -2
  121. package/components/table/TableSpacerRow.js +26 -2
  122. package/components/table/TableSpacerRow.js.map +1 -1
  123. package/components/table/TableToolbar.d.ts +4 -23
  124. package/components/table/TableToolbar.js +39 -28
  125. package/components/table/TableToolbar.js.map +1 -1
  126. package/components/table/TableToolbarColumn.d.ts +31 -0
  127. package/components/table/TableToolbarColumn.js +33 -0
  128. package/components/table/TableToolbarColumn.js.map +1 -0
  129. package/components/table/TableViewToggles.d.ts +3 -3
  130. package/components/table/TableViewToggles.js.map +1 -1
  131. package/components/table/context/TableInteractionContext.d.ts +26 -0
  132. package/components/table/context/TableInteractionContext.js +7 -0
  133. package/components/table/context/TableInteractionContext.js.map +1 -0
  134. package/components/table/context/TableLayoutContext.d.ts +25 -0
  135. package/components/table/context/TableLayoutContext.js +7 -0
  136. package/components/table/context/TableLayoutContext.js.map +1 -0
  137. package/components/table/context/TableRenderConfigContext.d.ts +27 -0
  138. package/components/table/context/TableRenderConfigContext.js +7 -0
  139. package/components/table/context/TableRenderConfigContext.js.map +1 -0
  140. package/components/table/context/TableRenderContext.d.ts +85 -0
  141. package/components/table/context/TableRenderContext.js +7 -0
  142. package/components/table/context/TableRenderContext.js.map +1 -0
  143. package/components/table/context/TableStructureContext.d.ts +31 -0
  144. package/components/table/context/TableStructureContext.js +17 -0
  145. package/components/table/context/TableStructureContext.js.map +1 -0
  146. package/components/table/layout/columnSizing.d.ts +2 -2
  147. package/components/table/layout/columnSizing.js.map +1 -1
  148. package/components/table/layout/useDraggableColumns.d.ts +3 -3
  149. package/components/table/layout/useDraggableColumns.js +17 -17
  150. package/components/table/layout/useDraggableColumns.js.map +1 -1
  151. package/components/table/layout/useHorizontalSectionSync.d.ts +3 -1
  152. package/components/table/layout/useHorizontalSectionSync.js +32 -28
  153. package/components/table/layout/useHorizontalSectionSync.js.map +1 -1
  154. package/components/table/layout/useMeasuredColumnMaxWidths.d.ts +3 -3
  155. package/components/table/layout/useMeasuredColumnMaxWidths.js.map +1 -1
  156. package/components/table/layout/useResizableColumns.d.ts +5 -4
  157. package/components/table/layout/useResizableColumns.js +108 -67
  158. package/components/table/layout/useResizableColumns.js.map +1 -1
  159. package/components/table/layout/useTableBodyScrollBottom.d.ts +12 -0
  160. package/components/table/layout/useTableBodyScrollBottom.js +37 -0
  161. package/components/table/layout/useTableBodyScrollBottom.js.map +1 -0
  162. package/components/table/layout/useTableLayout.d.ts +17 -6
  163. package/components/table/layout/useTableLayout.js +41 -38
  164. package/components/table/layout/useTableLayout.js.map +1 -1
  165. package/components/table/layout/useTableVirtualization.d.ts +6 -6
  166. package/components/table/layout/useTableVirtualization.js +22 -22
  167. package/components/table/layout/useTableVirtualization.js.map +1 -1
  168. package/components/table/model/resolveRowMeta.d.ts +3 -2
  169. package/components/table/model/resolveRowMeta.js.map +1 -1
  170. package/components/table/model/resolveTableClassConfig.d.ts +2 -3
  171. package/components/table/model/resolveTableClassConfig.js.map +1 -1
  172. package/components/table/model/tableView.types.d.ts +41 -0
  173. package/components/table/native/TableSettingsListItem.js +1 -1
  174. package/components/table/native/TableSettingsListItem.js.map +1 -1
  175. package/components/table/render/body/TableBodyContent.d.ts +21 -0
  176. package/components/table/render/body/TableBodyContent.js +52 -0
  177. package/components/table/render/body/TableBodyContent.js.map +1 -0
  178. package/components/table/render/body/TableEmptyRow.js +2 -2
  179. package/components/table/render/body/TableEmptyRow.js.map +1 -1
  180. package/components/table/render/header/TableBatchDropdown.d.ts +5 -1
  181. package/components/table/render/header/TableBatchDropdown.js +17 -15
  182. package/components/table/render/header/TableBatchDropdown.js.map +1 -1
  183. package/components/table/render/header/TableColumnFilter.d.ts +2 -2
  184. package/components/table/render/header/TableColumnFilter.js +16 -14
  185. package/components/table/render/header/TableColumnFilter.js.map +1 -1
  186. package/components/table/render/header/TableDraggableHeaderCell.d.ts +2 -1
  187. package/components/table/render/header/TableDraggableHeaderCell.js +44 -34
  188. package/components/table/render/header/TableDraggableHeaderCell.js.map +1 -1
  189. package/components/table/render/header/TableHeader.types.d.ts +11 -9
  190. package/components/table/render/header/TableHeaderCellContent.d.ts +2 -1
  191. package/components/table/render/header/TableHeaderCellContent.js.map +1 -1
  192. package/components/table/render/header/TableHeaderCellResizeHandle.d.ts +2 -1
  193. package/components/table/render/header/TableHeaderCellResizeHandle.js +8 -8
  194. package/components/table/render/header/TableHeaderCellResizeHandle.js.map +1 -1
  195. package/components/table/render/header/TableHeaderDragOverlay.d.ts +5 -4
  196. package/components/table/render/header/TableHeaderDragOverlay.js.map +1 -1
  197. package/components/table/render/header/TableStaticHeaderCell.d.ts +2 -1
  198. package/components/table/render/header/TableStaticHeaderCell.js +34 -22
  199. package/components/table/render/header/TableStaticHeaderCell.js.map +1 -1
  200. package/components/table/render/header/resolveAriaSort.d.ts +2 -1
  201. package/components/table/render/header/resolveAriaSort.js.map +1 -1
  202. package/components/table/render/header/resolveHeaderCellClassName.d.ts +4 -2
  203. package/components/table/render/header/resolveHeaderCellClassName.js +11 -10
  204. package/components/table/render/header/resolveHeaderCellClassName.js.map +1 -1
  205. package/components/table/render/header/resolveHeaderCellStyle.d.ts +2 -1
  206. package/components/table/render/header/resolveHeaderCellStyle.js.map +1 -1
  207. package/components/table/runtime/shouldAnimateBodyRows.d.ts +17 -0
  208. package/components/table/runtime/shouldAnimateBodyRows.js +5 -0
  209. package/components/table/runtime/shouldAnimateBodyRows.js.map +1 -0
  210. package/components/table/runtime/useRenderDraftState.d.ts +14 -0
  211. package/components/table/runtime/useRenderDraftState.js +80 -0
  212. package/components/table/runtime/useRenderDraftState.js.map +1 -0
  213. package/components/table/runtime/useResolvedRenderColumns.d.ts +43 -0
  214. package/components/table/runtime/useResolvedRenderColumns.js +113 -0
  215. package/components/table/runtime/useResolvedRenderColumns.js.map +1 -0
  216. package/components/table/runtime/useResolvedRenderHeader.d.ts +27 -0
  217. package/components/table/runtime/useResolvedRenderHeader.js +67 -0
  218. package/components/table/runtime/useResolvedRenderHeader.js.map +1 -0
  219. package/components/table/selection/useInternalTableSelectionState.d.ts +17 -0
  220. package/components/table/selection/useInternalTableSelectionState.js +28 -0
  221. package/components/table/selection/useInternalTableSelectionState.js.map +1 -0
  222. package/components/table/selection/useTableSelection.d.ts +3 -3
  223. package/components/table/selection/useTableSelection.js.map +1 -1
  224. package/components/table/shared/getCellContentOverflowClassName.d.ts +3 -0
  225. package/components/table/shared/getCellContentOverflowClassName.js +18 -0
  226. package/components/table/shared/getCellContentOverflowClassName.js.map +1 -0
  227. package/components/table/shared/getInteractiveRowProps.d.ts +3 -2
  228. package/components/table/shared/getInteractiveRowProps.js.map +1 -1
  229. package/hooks/useUrlState.js +3 -3
  230. package/package.json +16 -17
  231. package/utils/analytics/createAnalyticsOverlayTooltip.js +57 -57
  232. package/utils/analytics/createAnalyticsOverlayTooltip.js.map +1 -1
  233. package/utils/analytics/useAnalyticsOverlayDom.js +3 -3
  234. package/utils/routeUtils.d.ts +5 -2
  235. package/utils/routeUtils.js +17 -17
  236. package/utils/routeUtils.js.map +1 -1
  237. package/version.d.ts +1 -1
  238. package/version.js +1 -1
  239. package/version.js.map +1 -1
  240. package/components/table/TableCard.d.ts +0 -63
  241. package/components/table/TableCard.js +0 -150
  242. package/components/table/TableCard.js.map +0 -1
  243. package/components/table/model/buildTableViewModel.d.ts +0 -28
  244. package/components/table/model/buildTableViewModel.js +0 -221
  245. package/components/table/model/buildTableViewModel.js.map +0 -1
  246. package/components/table/model/resolveCellContent.d.ts +0 -2
  247. package/components/table/model/resolveCellContent.js +0 -5
  248. package/components/table/model/resolveCellContent.js.map +0 -1
  249. package/components/table/model/tableViewModel.types.d.ts +0 -153
  250. package/components/table/parse/parseBody.d.ts +0 -3
  251. package/components/table/parse/parseBody.js +0 -13
  252. package/components/table/parse/parseBody.js.map +0 -1
  253. package/components/table/parse/parseColumns.d.ts +0 -3
  254. package/components/table/parse/parseColumns.js +0 -81
  255. package/components/table/parse/parseColumns.js.map +0 -1
  256. package/components/table/parse/parseFooter.d.ts +0 -3
  257. package/components/table/parse/parseFooter.js +0 -39
  258. package/components/table/parse/parseFooter.js.map +0 -1
  259. package/components/table/parse/parseHeaders.d.ts +0 -4
  260. package/components/table/parse/parseHeaders.js +0 -89
  261. package/components/table/parse/parseHeaders.js.map +0 -1
  262. package/components/table/parse/parseRows.d.ts +0 -3
  263. package/components/table/parse/parseRows.js +0 -93
  264. package/components/table/parse/parseRows.js.map +0 -1
  265. package/components/table/parse/tableChildGuards.d.ts +0 -25
  266. package/components/table/parse/tableChildGuards.js +0 -29
  267. package/components/table/parse/tableChildGuards.js.map +0 -1
  268. package/components/table/render/body/TableBodyRow.d.ts +0 -16
  269. package/components/table/render/body/TableBodyRow.js +0 -84
  270. package/components/table/render/body/TableBodyRow.js.map +0 -1
  271. package/components/table/render/body/TableBodySection.d.ts +0 -20
  272. package/components/table/render/body/TableBodySection.js +0 -68
  273. package/components/table/render/body/TableBodySection.js.map +0 -1
  274. package/components/table/render/body/TableDataRow.d.ts +0 -15
  275. package/components/table/render/body/TableDataRow.js +0 -143
  276. package/components/table/render/body/TableDataRow.js.map +0 -1
  277. package/components/table/render/body/TableExpandedRow.d.ts +0 -8
  278. package/components/table/render/body/TableExpandedRow.js +0 -84
  279. package/components/table/render/body/TableExpandedRow.js.map +0 -1
  280. package/components/table/render/body/TableGroupRow.d.ts +0 -8
  281. package/components/table/render/body/TableGroupRow.js +0 -21
  282. package/components/table/render/body/TableGroupRow.js.map +0 -1
  283. package/components/table/render/body/TableSpacerRow.d.ts +0 -7
  284. package/components/table/render/body/TableSpacerRow.js +0 -15
  285. package/components/table/render/body/TableSpacerRow.js.map +0 -1
  286. package/components/table/render/footer/TableFooterCell.d.ts +0 -8
  287. package/components/table/render/footer/TableFooterCell.js +0 -31
  288. package/components/table/render/footer/TableFooterCell.js.map +0 -1
  289. package/components/table/render/footer/TableFooterSection.d.ts +0 -10
  290. package/components/table/render/footer/TableFooterSection.js +0 -28
  291. package/components/table/render/footer/TableFooterSection.js.map +0 -1
  292. package/components/table/render/header/TableHeaderSection.d.ts +0 -3
  293. package/components/table/render/header/TableHeaderSection.js +0 -104
  294. package/components/table/render/header/TableHeaderSection.js.map +0 -1
@@ -1,11 +1,68 @@
1
- import { CSSProperties, ReactNode } from 'react';
1
+ import { MotionProps } from 'motion/react';
2
+ import { HTMLAttributes, MouseEvent as ReactMouseEvent, ReactNode } from 'react';
2
3
  export type TableHorizontalAlign = 'left' | 'center' | 'right';
3
4
  export type TableVerticalAlign = 'top' | 'middle' | 'bottom';
4
- export type TableCellOverflow = 'hidden' | 'visible' | 'ellipsis';
5
+ export type TableCellOverflow = 'hidden' | 'visible' | 'ellipsis' | 'ellipsis-2' | 'ellipsis-3';
5
6
  export type TableViewType = 'TABLE' | 'SINGLE_CARD' | 'MULTI_CARDS';
6
7
  export type TableSortDirection = 'asc' | 'desc';
7
8
  export type TableRowId = string | number;
8
- export type TableColumnDefinition<RowType extends Record<string, unknown>> = {
9
+ export type TableRowData = Record<string, unknown>;
10
+ export type TableCardsStyleSettings = {
11
+ /**
12
+ * Minimum card width for `MULTI_CARDS` view.
13
+ */
14
+ minWidth?: number | string;
15
+ /**
16
+ * Maximum card width for `MULTI_CARDS` view.
17
+ */
18
+ maxWidth?: number | string;
19
+ /**
20
+ * Additional classes for each card row in card views.
21
+ */
22
+ className?: string;
23
+ /**
24
+ * Additional classes for each card cell in card views.
25
+ */
26
+ rowClassName?: string;
27
+ /**
28
+ * Additional classes for each card label in card views.
29
+ */
30
+ labelClassName?: string;
31
+ /**
32
+ * Additional classes for each card content in card views.
33
+ */
34
+ contentClassName?: string;
35
+ };
36
+ /**
37
+ * High-level animation settings for expanded table rows.
38
+ *
39
+ * Use `false` to disable built-in expanded-row animations entirely.
40
+ * Use `duration` to keep the default expanded-row animation behavior
41
+ * while making it faster or slower.
42
+ */
43
+ export type TableExpandedRowAnimation = false | {
44
+ duration?: number;
45
+ };
46
+ export type TableHtmlAttributes = Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'children' | 'className' | 'onClick' | 'onKeyDown' | 'onDrag' | 'onDragCapture' | 'onDragEnd' | 'onDragEndCapture' | 'onDragEnter' | 'onDragEnterCapture' | 'onDragExit' | 'onDragExitCapture' | 'onDragLeave' | 'onDragLeaveCapture' | 'onDragOver' | 'onDragOverCapture' | 'onDragStart' | 'onDragStartCapture' | 'onDrop' | 'onDropCapture' | 'role'>;
47
+ export type TableStickyColumns = {
48
+ /**
49
+ * Number of currently leftmost visible data columns to keep sticky in `TABLE` view.
50
+ *
51
+ * This is position-based and follows column reordering.
52
+ * Selection columns and group rows are ignored.
53
+ *
54
+ * The public API currently supports `1`.
55
+ */
56
+ left?: 1;
57
+ /**
58
+ * Aligns footer cells with the sticky left column behavior.
59
+ *
60
+ * By default, the footer stays independent so it can still span the selection column
61
+ * or the full table width for summary and batch-action use cases.
62
+ */
63
+ footer?: boolean;
64
+ };
65
+ export type TableColumnDefinition<RowType extends TableRowData> = {
9
66
  /**
10
67
  * Unique key of the column.
11
68
  */
@@ -54,11 +111,23 @@ export type TableColumnDefinition<RowType extends Record<string, unknown>> = {
54
111
  */
55
112
  maxResizeWidth?: number;
56
113
  /**
57
- * Disables column drag-reordering for this column when `draggableColumns` is enabled on the table.
114
+ * Enables drag-reordering for this column in `TABLE` view.
58
115
  *
59
- * @default true
116
+ * When `columnOrder` and `onColumnOrderChange` are provided, reordering is controlled from the outside.
117
+ * When they are omitted, the table keeps the reordered state internally.
118
+ *
119
+ * @default false
60
120
  */
61
121
  draggable?: boolean;
122
+ /**
123
+ * Enables resize handles for this column in `TABLE` view.
124
+ *
125
+ * When `onColumnResize` is provided, resized widths are controlled from the outside.
126
+ * When it is omitted, the table keeps resized widths internally.
127
+ *
128
+ * @default false
129
+ */
130
+ resizeable?: boolean;
62
131
  /**
63
132
  * Horizontal alignment of body cells in this column.
64
133
  *
@@ -88,120 +157,223 @@ export type TableColumnDefinition<RowType extends Record<string, unknown>> = {
88
157
  */
89
158
  sortable?: boolean;
90
159
  };
91
- export type TableColumn<RowType extends Record<string, unknown>> = TableColumnDefinition<RowType>;
92
- export type TableRowClassName<RowType extends Record<string, unknown>> = string | ((row: RowType, rowIndex: number) => string);
93
- export type TableCellClassName<RowType extends Record<string, unknown>> = (row: RowType, column: TableColumnDefinition<RowType>, rowIndex: number, columnIndex: number) => string;
94
- export type TableStyle = CSSProperties & {
95
- '--table-columns'?: string;
96
- '--table-areas'?: string;
97
- '--table-cards-min'?: string;
98
- '--table-cards-max'?: string;
99
- '--table-column-count'?: string;
100
- '--table-width'?: string;
101
- };
102
- /**
103
- * Internal parser-stage table types.
104
- *
105
- * These `TableParsed*` types represent the normalized intermediate structure
106
- * that is produced after reading the declarative JSX API (`TableHeader`,
107
- * `TableHeaderColumn`, `TableBody`, `TableRow`, `TableColumn`, etc.) but
108
- * before building the final render/view model.
109
- *
110
- * Pipeline overview:
111
- * 1. Public declarative components define the table structure as JSX children.
112
- * 2. The parse layer (`parseHeaders`, `parseRows`, `parseFooter`, ...) turns
113
- * these children into a predictable internal data shape.
114
- * 3. `buildTableViewModel` enriches that parsed data with render-specific
115
- * information such as column layout, selection state, active state, card
116
- * metadata, and resolved class names.
117
- *
118
- * These types are intentionally separate from the public component props and
119
- * from the final `TableView*` types:
120
- * - public props describe authoring-time input
121
- * - `TableParsed*` describes normalized parser output
122
- * - `TableView*` describes render-ready output
123
- *
124
- * Keeping this intermediate layer explicit makes the parsing and rendering
125
- * stages easier to reason about and allows the render model to evolve without
126
- * coupling it directly to the external JSX API.
127
- */
128
- export type TableParsedHeaderColumn = {
129
- key: string | number;
130
- columnKey?: string;
131
- label: ReactNode;
132
- icon?: string;
133
- filter?: ReactNode;
134
- hideLabel?: boolean;
135
- row: number;
136
- colSpan: number;
137
- rowSpan: number;
138
- horizontalAlign?: TableHorizontalAlign;
139
- verticalAlign?: TableVerticalAlign;
140
- className?: string;
141
- headerClassName?: string;
142
- hideOnMobile?: boolean;
143
- draggable?: boolean;
144
- resizeable?: boolean;
145
- sortable?: boolean;
146
- };
147
- export type TableParsedCell = {
148
- key?: string | number;
149
- columnKey?: string;
150
- content: ReactNode;
151
- horizontalAlign?: TableHorizontalAlign;
152
- verticalAlign?: TableVerticalAlign;
153
- className?: string;
154
- contentClassName?: string;
155
- colSpan?: number;
156
- preventRowClick?: boolean;
157
- };
158
- export type TableParsedCells = {
159
- cellsByKey?: Record<string, TableParsedCell>;
160
- cellsByIndex?: TableParsedCell[];
161
- };
162
- export type TableParsedFooterCell = TableParsedCell & {
163
- key: string | number;
164
- colSpan: number;
165
- };
166
- type TableParsedBaseRow = {
167
- className?: string;
168
- noHover?: boolean;
169
- };
170
- type TableParsedKeyedRow = TableParsedBaseRow & {
171
- key: string | number;
172
- };
173
- type TableParsedContentRowBase = TableParsedKeyedRow & {
174
- content: ReactNode;
175
- };
176
- type TableParsedDataLikeRow<RowType extends Record<string, unknown>, Kind extends 'data' | 'expanded'> = TableParsedCells & TableParsedBaseRow & {
177
- kind: Kind;
178
- data: RowType;
179
- parentKey?: string | number;
180
- } & {
181
- disabled?: boolean;
182
- };
183
- export type TableParsedDataRow<RowType extends Record<string, unknown>> = Omit<TableParsedDataLikeRow<RowType, 'data'>, 'parentKey'>;
184
- export type TableParsedExpandedDataRow<RowType extends Record<string, unknown>> = TableParsedDataLikeRow<RowType, 'expanded'>;
185
- export type TableParsedSpacerRow = TableParsedKeyedRow & {
186
- kind: 'spacer';
187
- };
188
- export type TableParsedExpandedContentRow = TableParsedContentRowBase & {
189
- kind: 'expanded-full-width';
190
- parentKey?: string | number;
191
- };
192
- export type TableParsedGroupRow = TableParsedContentRowBase & {
193
- kind: 'group';
194
- sticky?: boolean;
195
- };
196
- export type TableParsedGroupFooterRow = TableParsedContentRowBase & {
197
- kind: 'group-footer';
198
- };
199
- type TableParsedFooterBase = TableParsedCells & {
200
- className?: string;
201
- content?: ReactNode;
202
- };
203
- export type TableParsedRow<RowType extends Record<string, unknown>> = TableParsedDataRow<RowType> | TableParsedExpandedDataRow<RowType> | TableParsedSpacerRow | TableParsedExpandedContentRow | TableParsedGroupRow | TableParsedGroupFooterRow;
204
- export type TableParsedFooter = TableParsedFooterBase & {
205
- cells?: TableParsedFooterCell[];
160
+ export type TableColumn<RowType extends TableRowData> = TableColumnDefinition<RowType>;
161
+ export type TableRowClassName<RowType extends TableRowData> = string | ((row: RowType, rowIndex: number) => string);
162
+ export type TableCellClassName<RowType extends TableRowData> = (row: RowType, column: TableColumnDefinition<RowType>, rowIndex: number, columnIndex: number) => string;
163
+ export type TableRowAnimationProps<RowType extends TableRowData> = MotionProps | ((row: RowType, rowIndex: number) => MotionProps);
164
+ export type TableProps<RowType extends TableRowData> = Omit<HTMLAttributes<HTMLDivElement>, 'draggable' | 'onClick'> & {
165
+ /**
166
+ * Row key accessor for resolving a stable unique row id.
167
+ *
168
+ * This is recommended whenever rows have their own identifier such as `id`, `vehicleId`, or `uuid`, especially
169
+ * when using selection, active rows, expanded rows, or virtualization.
170
+ *
171
+ * If omitted, the row index is used as a fallback.
172
+ *
173
+ * @default row index
174
+ */
175
+ rowKey?: keyof RowType | ((row: RowType, rowIndex: number) => string | number);
176
+ /**
177
+ * Controls table or card rendering modes.
178
+ *
179
+ * @default 'TABLE'
180
+ */
181
+ viewType?: TableViewType;
182
+ /**
183
+ * Card width configuration for `MULTI_CARDS` view.
184
+ */
185
+ cardsStyle?: TableCardsStyleSettings;
186
+ /**
187
+ * Compact row/cell spacing like old `table-condensed`.
188
+ *
189
+ * @default false
190
+ */
191
+ condensed?: boolean;
192
+ /**
193
+ * Zebra rows like old `table-striped`.
194
+ *
195
+ * @default false
196
+ */
197
+ striped?: boolean;
198
+ /**
199
+ * Hover effect like old `table-hover`.
200
+ *
201
+ * @default false
202
+ */
203
+ hover?: boolean;
204
+ /**
205
+ * Apply table shadow.
206
+ *
207
+ * @default false
208
+ */
209
+ shadow?: boolean;
210
+ /**
211
+ * Simple outer border on table wrapper and card variants.
212
+ *
213
+ * @default true
214
+ */
215
+ border?: boolean;
216
+ /**
217
+ * Rounded table corners and card variants.
218
+ * Top corners are applied to header or body (if no header),
219
+ * bottom corners are applied to footer or body (if no footer).
220
+ *
221
+ * @default true
222
+ */
223
+ rounded?: boolean;
224
+ /**
225
+ * Show vertical and header row grid lines.
226
+ *
227
+ * @default false
228
+ */
229
+ gridLines?: boolean;
230
+ /**
231
+ * Optional classes for rows.
232
+ *
233
+ * Accepts either a static class string for all rows or a callback that resolves
234
+ * row-specific classes from the current row data and row index.
235
+ *
236
+ * @example
237
+ * rowClassName={(row) => (row.disabled ? 'my-class-name' : '')}
238
+ */
239
+ rowClassName?: TableRowClassName<RowType>;
240
+ /**
241
+ * Width of the separator between regular body rows in table view.
242
+ *
243
+ * This affects normal data rows and expanded child rows.
244
+ * Group rows, group footers, footer rows, and full-width expanded rows keep their own fixed separators.
245
+ *
246
+ * @default '1px'
247
+ */
248
+ rowSeparatorWidth?: number | string;
249
+ /**
250
+ * Sticky column behavior in `TABLE` view.
251
+ *
252
+ * `left` is position-based and follows column reordering.
253
+ * Selection columns and group rows are ignored.
254
+ *
255
+ * The public API currently supports `left: 1`.
256
+ *
257
+ * @example
258
+ * stickyColumns={{ left: 1, footer: true }}
259
+ */
260
+ stickyColumns?: TableStickyColumns;
261
+ /**
262
+ * Current active row key for detail context or external side panels.
263
+ */
264
+ activeRowId?: TableRowId;
265
+ /**
266
+ * Called when a row is activated or deactivated by row click.
267
+ */
268
+ onActiveRowChange?: (rowId: TableRowId | undefined, row: RowType, rowIndex: number) => void;
269
+ /**
270
+ * Optional low-level motion props applied to data rows for enter, exit, and layout animations.
271
+ *
272
+ * This is intended as an advanced escape hatch when the built-in row animation behavior is not sufficient.
273
+ * Can be defined once for all rows or resolved per row.
274
+ * A stable `rowKey` is recommended so animations keep working predictably across inserts, removals, and reordering.
275
+ * Ignored when `virtualizedRows` is enabled.
276
+ */
277
+ rowAnimationProps?: TableRowAnimationProps<RowType>;
278
+ /**
279
+ * High-level animation settings for expanded rows.
280
+ *
281
+ * Pass `false` to disable expanded-row animations entirely.
282
+ * Pass a `duration` to keep the built-in expanded-row animations but make them faster or slower.
283
+ */
284
+ expandedRowAnimation?: TableExpandedRowAnimation;
285
+ /**
286
+ * Current sorted column key.
287
+ */
288
+ sortBy?: string | string[];
289
+ /**
290
+ * Current sort direction for `sortBy`.
291
+ */
292
+ sortDirection?: TableSortDirection;
293
+ /**
294
+ * Called when a sortable header is clicked.
295
+ *
296
+ * Sorting itself remains controlled outside the table.
297
+ * The click event is passed through as an optional third argument for modifier-key scenarios such as shift-click.
298
+ */
299
+ onSortChange?: (columnKey: string, direction: TableSortDirection, event: ReactMouseEvent<HTMLButtonElement>) => void;
300
+ /**
301
+ * Optional classes for each cell.
302
+ *
303
+ * The callback is resolved per rendered body cell and receives the current
304
+ * row data, the resolved column definition, the row index, and the column index.
305
+ *
306
+ * @example
307
+ * cellClassName={(row, column) => (column.key === 'status' && row.disabled ? 'text-color-muted' : '')}
308
+ */
309
+ cellClassName?: TableCellClassName<RowType>;
310
+ /**
311
+ * Row click callback. Adds keyboard support and pointer cursor.
312
+ */
313
+ onRowClick?: (row: RowType, rowIndex: number) => void;
314
+ /**
315
+ * Called when checkbox selection changes.
316
+ */
317
+ onSelectionChange?: (rowIds: TableRowId[]) => void;
318
+ /**
319
+ * Currently selected row keys for multi-selection use cases.
320
+ */
321
+ selectedRowIds?: TableRowId[];
322
+ /**
323
+ * Optional custom header content for the selection column.
324
+ * If omitted, the header renders the default select-all checkbox.
325
+ */
326
+ selectionHeaderContent?: ReactNode;
327
+ /**
328
+ * Controlled column order for drag-reordering.
329
+ *
330
+ * Reordering interactions are enabled when reorderable header columns set `draggable`
331
+ * and the table is in `TABLE` view.
332
+ *
333
+ * Keys not present in the current table columns are ignored.
334
+ */
335
+ columnOrder?: string[];
336
+ /**
337
+ * Called while a column is resized via the header handle.
338
+ *
339
+ * Resize handles are shown only for header columns that set `resizeable`.
340
+ *
341
+ * When omitted, the table keeps resized widths internally.
342
+ * Pass `undefined` to clear a previously configured width.
343
+ *
344
+ * Drag-resizing emits pixel widths as numbers. A reset can restore the original
345
+ * configured width, which may also be a string such as `'20%'`.
346
+ */
347
+ onColumnResize?: (columnKey: string, width?: number | string) => void;
348
+ /**
349
+ * Called when drag-reordering produces a new column order.
350
+ *
351
+ * When omitted, the table keeps the reordered column state internally.
352
+ * Drag interactions are enabled only for header columns that set `draggable`.
353
+ */
354
+ onColumnOrderChange?: (columnOrder: string[]) => void;
355
+ /**
356
+ * Render a selection checkbox column as the first column.
357
+ */
358
+ showSelectionColumn?: boolean;
359
+ /**
360
+ * Fallback content when there are no rows.
361
+ *
362
+ * @default 'No data available'
363
+ */
364
+ noRowsState?: ReactNode;
365
+ /**
366
+ * Enables table-specific row virtualization for vertically scrolling table bodies.
367
+ *
368
+ * Virtualization is currently only active in `TABLE` view with `bodyMaxHeight`.
369
+ *
370
+ * @default false
371
+ */
372
+ virtualizedRows?: boolean;
373
+ /**
374
+ * Extra row count rendered above and below the visible area when virtualization is enabled.
375
+ *
376
+ * @default 5
377
+ */
378
+ virtualizationOverscan?: number;
206
379
  };
207
- export {};
@@ -1,10 +1,70 @@
1
- import { PropsWithChildren } from 'react';
2
- export type TableBodyProps = PropsWithChildren<{
1
+ import { ReactNode } from 'react';
2
+ import { TableHtmlAttributes } from './Table.types';
3
+ export type TableBodyProps = TableHtmlAttributes & {
4
+ /**
5
+ * Body sections are expected to render row components such as `TableRow`,
6
+ * `TableExpandedRow`, `TableExpandedContentRow`, `TableGroupRow`,
7
+ * `TableGroupFooterRow`, or `TableSpacerRow`.
8
+ *
9
+ * Rows may be wrapped by custom React components, but direct `TableColumn`
10
+ * children of `TableBody` are not supported.
11
+ */
12
+ children?: ReactNode;
3
13
  /**
4
14
  * Optional max height of rendered table body.
5
15
  * Enables vertical scrolling inside the body.
6
16
  */
7
17
  maxHeight?: number | string;
8
- }>;
9
- declare const TableBody: (_props: TableBodyProps) => null;
10
- export default TableBody;
18
+ /**
19
+ * Called when the scrollable table body reaches the bottom threshold.
20
+ *
21
+ * This is useful for progressive loading patterns such as appending the next
22
+ * chunk of rows when the user scrolls to the end of the body.
23
+ */
24
+ onScrollBottom?: () => void;
25
+ /**
26
+ * Distance in pixels from the bottom at which `onScrollBottom` should fire.
27
+ *
28
+ * Set this to `0` to only trigger when the body is scrolled fully to the end.
29
+ *
30
+ * @default 0
31
+ */
32
+ scrollBottomOffset?: number;
33
+ };
34
+ export type TableBodyHandle = {
35
+ scrollToTop: () => void;
36
+ scrollTo: (options: ScrollToOptions) => void;
37
+ getScrollElement: () => HTMLDivElement | null;
38
+ };
39
+ declare const _default: import('react').ForwardRefExoticComponent<TableHtmlAttributes & {
40
+ /**
41
+ * Body sections are expected to render row components such as `TableRow`,
42
+ * `TableExpandedRow`, `TableExpandedContentRow`, `TableGroupRow`,
43
+ * `TableGroupFooterRow`, or `TableSpacerRow`.
44
+ *
45
+ * Rows may be wrapped by custom React components, but direct `TableColumn`
46
+ * children of `TableBody` are not supported.
47
+ */
48
+ children?: ReactNode;
49
+ /**
50
+ * Optional max height of rendered table body.
51
+ * Enables vertical scrolling inside the body.
52
+ */
53
+ maxHeight?: number | string;
54
+ /**
55
+ * Called when the scrollable table body reaches the bottom threshold.
56
+ *
57
+ * This is useful for progressive loading patterns such as appending the next
58
+ * chunk of rows when the user scrolls to the end of the body.
59
+ */
60
+ onScrollBottom?: () => void;
61
+ /**
62
+ * Distance in pixels from the bottom at which `onScrollBottom` should fire.
63
+ *
64
+ * Set this to `0` to only trigger when the body is scrolled fully to the end.
65
+ *
66
+ * @default 0
67
+ */
68
+ scrollBottomOffset?: number;
69
+ } & import('react').RefAttributes<TableBodyHandle>>;
70
+ export default _default;
@@ -1,5 +1,135 @@
1
- const o = (l) => null;
1
+ import { jsx as l, jsxs as j } from "react/jsx-runtime";
2
+ import { forwardRef as D, Children as L, useRef as h, useState as q, useCallback as z, useImperativeHandle as $ } from "react";
3
+ import G from "../smoothScrollbars/SmoothScrollbars.js";
4
+ import J from "../virtualList/useVirtualListResizeObserver.js";
5
+ import { toCssSize as K } from "./layout/columnSizing.js";
6
+ import Q from "./layout/useTableBodyScrollBottom.js";
7
+ import U from "./layout/useTableVirtualization.js";
8
+ import { shouldAnimateBodyRows as W } from "./runtime/shouldAnimateBodyRows.js";
9
+ import H from "./render/body/TableBodyContent.js";
10
+ import { useOptionalTableInteractionContext as X } from "./context/TableInteractionContext.js";
11
+ import { useOptionalTableLayoutContext as Y } from "./context/TableLayoutContext.js";
12
+ import { useOptionalTableRenderConfigContext as Z } from "./context/TableRenderConfigContext.js";
13
+ import { TableSectionContext as _, TableBodyContext as oo } from "./context/TableStructureContext.js";
14
+ import { useOptionalTableRenderContext as eo, TableRenderContext as to } from "./context/TableRenderContext.js";
15
+ const ro = (s) => {
16
+ if (!s)
17
+ return;
18
+ const i = Number.parseFloat(s);
19
+ return Number.isNaN(i) ? void 0 : i;
20
+ }, no = (s, i) => {
21
+ const { children: b, maxHeight: O, onScrollBottom: d, scrollBottomOffset: P = 0, ...w } = s, t = Z(), o = eo(), R = X(), f = Y(), x = !!o && o.columns.length > 0, C = L.toArray(b).length > 0, c = h(0), m = h(null), y = h(null), [a, V] = q(null);
22
+ c.current = 0;
23
+ const r = K(O), k = ro(r), g = x && t?.virtualizedRows === !0 && !!r, E = (o?.bodyRows.length ?? 0) > 0, n = z(
24
+ () => a?.view ?? y.current?.view ?? null,
25
+ [a?.view]
26
+ ), I = z((e) => {
27
+ y.current = e, V(
28
+ (A) => A?.view === e?.view ? A : e
29
+ );
30
+ }, []);
31
+ $(
32
+ i,
33
+ () => ({
34
+ scrollToTop: () => {
35
+ n()?.scrollTo({ top: 0 }), requestAnimationFrame(() => {
36
+ n()?.scrollTo({ top: 0 });
37
+ });
38
+ },
39
+ scrollTo: (e) => {
40
+ n()?.scrollTo(e);
41
+ },
42
+ getScrollElement: n
43
+ }),
44
+ [n]
45
+ );
46
+ const { isVirtualized: u, measureRow: N, paddingBottom: v, paddingTop: T, virtualRows: p } = U({
47
+ enabled: g && E,
48
+ overscan: t?.virtualizationOverscan ?? 0,
49
+ rows: o?.bodyRows ?? [],
50
+ scrollContainer: a,
51
+ viewportHeightFallback: k
52
+ });
53
+ J(m, N, [u, p]);
54
+ const { handleScrollBottom: F } = Q({
55
+ enabled: !!r && !!d,
56
+ itemCount: o?.bodyRows.length ?? 0,
57
+ onScrollBottom: d,
58
+ scrollBottomOffset: P,
59
+ scrollElement: a?.view
60
+ });
61
+ if (!t || !o || !R || !f || !x)
62
+ return null;
63
+ const B = o.columns.length + (R.showSelectionColumn ? 1 : 0), S = W({
64
+ rowAnimationProps: t.rowAnimationProps,
65
+ expandedRowAnimation: t.expandedRowAnimation,
66
+ hasExpandableRows: o.hasExpandableRows,
67
+ hasExpandedRows: o.bodyRows.some(
68
+ (e) => e.kind === "expanded" || e.kind === "expanded-full-width"
69
+ )
70
+ });
71
+ o.renderDraft.bodyMaxHeight = r;
72
+ const M = /* @__PURE__ */ l(to.Provider, { value: { ...o, isRegisteringBodyRows: !0 }, children: b });
73
+ return /* @__PURE__ */ l(_.Provider, { value: "body", children: /* @__PURE__ */ j(
74
+ oo.Provider,
75
+ {
76
+ value: {
77
+ nextRowIndex: () => {
78
+ const e = c.current;
79
+ return c.current += 1, e;
80
+ }
81
+ },
82
+ children: [
83
+ M,
84
+ r ? /* @__PURE__ */ l(
85
+ G,
86
+ {
87
+ className: "table-body-scroll-wrapper",
88
+ autoHeight: !0,
89
+ autoHeightMax: r,
90
+ onScroll: (e) => {
91
+ f.handleBodyScroll?.(e), F(e?.currentTarget);
92
+ },
93
+ role: "presentation",
94
+ ref: g || d ? I : void 0,
95
+ children: /* @__PURE__ */ l(
96
+ H,
97
+ {
98
+ columnCount: B,
99
+ hasDeclaredChildren: C,
100
+ htmlAttributes: w,
101
+ shouldAnimateBodyRows: S,
102
+ isVirtualized: u,
103
+ itemsRef: m,
104
+ paddingBottom: v,
105
+ paddingTop: T,
106
+ renderConfigContext: t,
107
+ renderContext: o,
108
+ virtualRows: p
109
+ }
110
+ )
111
+ }
112
+ ) : /* @__PURE__ */ l(
113
+ H,
114
+ {
115
+ columnCount: B,
116
+ hasDeclaredChildren: C,
117
+ htmlAttributes: w,
118
+ shouldAnimateBodyRows: S,
119
+ isVirtualized: u,
120
+ itemsRef: m,
121
+ paddingBottom: v,
122
+ paddingTop: T,
123
+ renderConfigContext: t,
124
+ renderContext: o,
125
+ virtualRows: p
126
+ }
127
+ )
128
+ ]
129
+ }
130
+ ) });
131
+ }, Co = D(no);
2
132
  export {
3
- o as default
133
+ Co as default
4
134
  };
5
135
  //# sourceMappingURL=TableBody.js.map