@economic/taco 2.12.1 → 2.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. package/dist/components/Field/Field.d.ts +4 -2
  2. package/dist/components/Icon/components/Location.d.ts +3 -0
  3. package/dist/components/Icon/components/index.d.ts +1 -1
  4. package/dist/components/Input/Input.d.ts +1 -1
  5. package/dist/components/Menu/components/Item.d.ts +1 -1
  6. package/dist/components/Menu/components/Link.d.ts +1 -1
  7. package/dist/components/Navigation2/components/Link.d.ts +1 -1
  8. package/dist/components/Provider/Localization.d.ts +1 -113
  9. package/dist/components/Select2/components/Option.d.ts +7 -5
  10. package/dist/components/Select2/components/Search.d.ts +1 -1
  11. package/dist/components/Table3/Table3.d.ts +9 -1
  12. package/dist/components/Table3/components/columns/header/Group.d.ts +15 -0
  13. package/dist/components/Table3/components/columns/header/Header.d.ts +5 -0
  14. package/dist/components/Table3/components/columns/internal/EditingActions.d.ts +1 -1
  15. package/dist/components/Table3/components/columns/styles.d.ts +2 -2
  16. package/dist/components/Table3/components/toolbar/Filter/filters/components/Filter.d.ts +4 -4
  17. package/dist/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.d.ts +3 -2
  18. package/dist/components/Table3/components/toolbar/Filter/filters/components/Placeholder.d.ts +3 -2
  19. package/dist/components/Table3/components/toolbar/FontSize.d.ts +4 -0
  20. package/dist/components/Table3/hooks/features/useHeaderOffsetStyle.d.ts +3 -0
  21. package/dist/components/Table3/hooks/useCssGrid.d.ts +2 -1
  22. package/dist/components/Table3/hooks/useTable.d.ts +1 -1
  23. package/dist/components/Table3/types.d.ts +8 -1
  24. package/dist/components/Tag/Tag.d.ts +1 -1
  25. package/dist/esm/index.css +24 -6
  26. package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +1 -1
  27. package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
  28. package/dist/esm/packages/taco/src/components/Field/Field.js +6 -4
  29. package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
  30. package/dist/esm/packages/taco/src/components/Icon/components/Location.js +17 -0
  31. package/dist/esm/packages/taco/src/components/Icon/components/Location.js.map +1 -0
  32. package/dist/esm/packages/taco/src/components/Icon/components/index.js +2 -0
  33. package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
  34. package/dist/esm/packages/taco/src/components/Provider/Localization.js +1 -110
  35. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  36. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +1 -1
  37. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
  38. package/dist/esm/packages/taco/src/components/Select2/components/Option.js +13 -6
  39. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  40. package/dist/esm/packages/taco/src/components/Select2/components/Search.js +1 -1
  41. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  42. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +7 -6
  43. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
  44. package/dist/esm/packages/taco/src/components/Table3/Table3.js +29 -11
  45. package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
  46. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +2 -5
  47. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
  48. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +1 -4
  49. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
  50. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
  51. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js +70 -0
  52. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js.map +1 -0
  53. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +26 -8
  54. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js.map +1 -1
  55. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +6 -1
  56. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
  57. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +3 -2
  58. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
  59. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +13 -9
  60. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +1 -1
  61. package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js +14 -2
  62. package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +1 -1
  63. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +10 -7
  64. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +1 -1
  65. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +15 -8
  66. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
  67. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js +2 -2
  68. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js.map +1 -1
  69. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js +25 -4
  70. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js.map +1 -1
  71. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js +0 -1
  72. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js.map +1 -1
  73. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js +5 -3
  74. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js.map +1 -1
  75. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Placeholder.js +2 -2
  76. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Placeholder.js.map +1 -1
  77. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js +9 -4
  78. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js.map +1 -1
  79. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +2 -3
  80. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +1 -1
  81. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js +3 -2
  82. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js.map +1 -1
  83. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +1 -1
  84. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js +24 -0
  85. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js.map +1 -0
  86. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js +6 -7
  87. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js.map +1 -1
  88. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js +48 -0
  89. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js.map +1 -1
  90. package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js +34 -9
  91. package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js.map +1 -1
  92. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js +6 -5
  93. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +1 -1
  94. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js +11 -9
  95. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js.map +1 -1
  96. package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
  97. package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
  98. package/dist/esm/packages/taco/src/index.js +1 -2
  99. package/dist/esm/packages/taco/src/index.js.map +1 -1
  100. package/dist/esm/packages/taco/src/utils/dom.js +1 -2
  101. package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
  102. package/dist/index.css +24 -6
  103. package/dist/index.d.ts +0 -1
  104. package/dist/taco.cjs.development.js +697 -4100
  105. package/dist/taco.cjs.development.js.map +1 -1
  106. package/dist/taco.cjs.production.min.js +1 -1
  107. package/dist/taco.cjs.production.min.js.map +1 -1
  108. package/package.json +2 -2
  109. package/tailwind.config.js +3 -0
  110. package/types.json +14334 -32345
  111. package/dist/components/Table2/Table2.d.ts +0 -130
  112. package/dist/components/Table2/components/BatchActionsMenu.d.ts +0 -10
  113. package/dist/components/Table2/components/ColumnSettingsButton.d.ts +0 -6
  114. package/dist/components/Table2/components/EditModeButton.d.ts +0 -8
  115. package/dist/components/Table2/components/RowDensityButton.d.ts +0 -7
  116. package/dist/components/Table2/components/Search.d.ts +0 -3
  117. package/dist/components/Table2/components/ShortcutsGuideButton.d.ts +0 -7
  118. package/dist/components/Table2/components/column/Base.d.ts +0 -14
  119. package/dist/components/Table2/components/column/Cell.d.ts +0 -15
  120. package/dist/components/Table2/components/column/Footer.d.ts +0 -9
  121. package/dist/components/Table2/components/column/Header.d.ts +0 -11
  122. package/dist/components/Table2/components/column/Indicator.d.ts +0 -17
  123. package/dist/components/Table2/components/column/ValidationError.d.ts +0 -5
  124. package/dist/components/Table2/components/column/utils.d.ts +0 -3
  125. package/dist/components/Table2/components/filters/FiltersButton.d.ts +0 -7
  126. package/dist/components/Table2/components/filters/components/Column.d.ts +0 -11
  127. package/dist/components/Table2/components/filters/components/ColumnFilter.d.ts +0 -10
  128. package/dist/components/Table2/components/filters/components/Comparator.d.ts +0 -11
  129. package/dist/components/Table2/components/filters/components/EmptyFilter.d.ts +0 -13
  130. package/dist/components/Table2/components/filters/components/InferredControl.d.ts +0 -10
  131. package/dist/components/Table2/components/row/Context.d.ts +0 -24
  132. package/dist/components/Table2/components/row/ExpandedRow.d.ts +0 -6
  133. package/dist/components/Table2/components/row/Row.d.ts +0 -2
  134. package/dist/components/Table2/hooks/listeners/useActiveCellStateListener.d.ts +0 -3
  135. package/dist/components/Table2/hooks/listeners/useActiveRowStateListener.d.ts +0 -3
  136. package/dist/components/Table2/hooks/listeners/useColumnOffsetStateListener.d.ts +0 -3
  137. package/dist/components/Table2/hooks/listeners/useFilterStateListener.d.ts +0 -3
  138. package/dist/components/Table2/hooks/listeners/useRowSelectionListener.d.ts +0 -3
  139. package/dist/components/Table2/hooks/listeners/useSettingsStateListener.d.ts +0 -3
  140. package/dist/components/Table2/hooks/useActiveCell.d.ts +0 -26
  141. package/dist/components/Table2/hooks/useActiveRow.d.ts +0 -10
  142. package/dist/components/Table2/hooks/useColumnDefinitions.d.ts +0 -37
  143. package/dist/components/Table2/hooks/useEditMode.d.ts +0 -28
  144. package/dist/components/Table2/hooks/useGridTemplate.d.ts +0 -2
  145. package/dist/components/Table2/hooks/useTable.d.ts +0 -46
  146. package/dist/components/Table2/hooks/useTableShortcuts.d.ts +0 -2
  147. package/dist/components/Table2/hooks/useVirtualiser.d.ts +0 -23
  148. package/dist/components/Table2/types.d.ts +0 -148
  149. package/dist/components/Table2/utilities/cell.d.ts +0 -14
  150. package/dist/components/Table2/utilities/columns.d.ts +0 -16
  151. package/dist/components/Table2/utilities/filterFn.d.ts +0 -3
  152. package/dist/esm/packages/taco/src/components/Table2/Table2.js +0 -422
  153. package/dist/esm/packages/taco/src/components/Table2/Table2.js.map +0 -1
  154. package/dist/esm/packages/taco/src/components/Table2/components/BatchActionsMenu.js +0 -83
  155. package/dist/esm/packages/taco/src/components/Table2/components/BatchActionsMenu.js.map +0 -1
  156. package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js +0 -116
  157. package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js.map +0 -1
  158. package/dist/esm/packages/taco/src/components/Table2/components/EditModeButton.js +0 -81
  159. package/dist/esm/packages/taco/src/components/Table2/components/EditModeButton.js.map +0 -1
  160. package/dist/esm/packages/taco/src/components/Table2/components/RowDensityButton.js +0 -47
  161. package/dist/esm/packages/taco/src/components/Table2/components/RowDensityButton.js.map +0 -1
  162. package/dist/esm/packages/taco/src/components/Table2/components/Search.js +0 -62
  163. package/dist/esm/packages/taco/src/components/Table2/components/Search.js.map +0 -1
  164. package/dist/esm/packages/taco/src/components/Table2/components/column/Base.js +0 -32
  165. package/dist/esm/packages/taco/src/components/Table2/components/column/Base.js.map +0 -1
  166. package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js +0 -605
  167. package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js.map +0 -1
  168. package/dist/esm/packages/taco/src/components/Table2/components/column/Footer.js +0 -32
  169. package/dist/esm/packages/taco/src/components/Table2/components/column/Footer.js.map +0 -1
  170. package/dist/esm/packages/taco/src/components/Table2/components/column/Header.js +0 -243
  171. package/dist/esm/packages/taco/src/components/Table2/components/column/Header.js.map +0 -1
  172. package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js +0 -73
  173. package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js.map +0 -1
  174. package/dist/esm/packages/taco/src/components/Table2/components/column/ValidationError.js +0 -30
  175. package/dist/esm/packages/taco/src/components/Table2/components/column/ValidationError.js.map +0 -1
  176. package/dist/esm/packages/taco/src/components/Table2/components/column/utils.js +0 -39
  177. package/dist/esm/packages/taco/src/components/Table2/components/column/utils.js.map +0 -1
  178. package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js +0 -155
  179. package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js.map +0 -1
  180. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Column.js +0 -31
  181. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Column.js.map +0 -1
  182. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js +0 -129
  183. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js.map +0 -1
  184. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Comparator.js +0 -68
  185. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Comparator.js.map +0 -1
  186. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/EmptyFilter.js +0 -63
  187. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/EmptyFilter.js.map +0 -1
  188. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/InferredControl.js +0 -99
  189. package/dist/esm/packages/taco/src/components/Table2/components/filters/components/InferredControl.js.map +0 -1
  190. package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js +0 -58
  191. package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js.map +0 -1
  192. package/dist/esm/packages/taco/src/components/Table2/components/row/ExpandedRow.js +0 -36
  193. package/dist/esm/packages/taco/src/components/Table2/components/row/ExpandedRow.js.map +0 -1
  194. package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js +0 -44
  195. package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js.map +0 -1
  196. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useActiveRowStateListener.js +0 -19
  197. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useActiveRowStateListener.js.map +0 -1
  198. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useColumnOffsetStateListener.js +0 -28
  199. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useColumnOffsetStateListener.js.map +0 -1
  200. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useFilterStateListener.js +0 -12
  201. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useFilterStateListener.js.map +0 -1
  202. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useRowSelectionListener.js +0 -18
  203. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useRowSelectionListener.js.map +0 -1
  204. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useSettingsStateListener.js +0 -25
  205. package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useSettingsStateListener.js.map +0 -1
  206. package/dist/esm/packages/taco/src/components/Table2/hooks/useActiveRow.js +0 -33
  207. package/dist/esm/packages/taco/src/components/Table2/hooks/useActiveRow.js.map +0 -1
  208. package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js +0 -122
  209. package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js.map +0 -1
  210. package/dist/esm/packages/taco/src/components/Table2/hooks/useEditMode.js +0 -112
  211. package/dist/esm/packages/taco/src/components/Table2/hooks/useEditMode.js.map +0 -1
  212. package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js +0 -34
  213. package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js.map +0 -1
  214. package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js +0 -222
  215. package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js.map +0 -1
  216. package/dist/esm/packages/taco/src/components/Table2/hooks/useTableShortcuts.js +0 -46
  217. package/dist/esm/packages/taco/src/components/Table2/hooks/useTableShortcuts.js.map +0 -1
  218. package/dist/esm/packages/taco/src/components/Table2/hooks/useVirtualiser.js +0 -48
  219. package/dist/esm/packages/taco/src/components/Table2/hooks/useVirtualiser.js.map +0 -1
  220. package/dist/esm/packages/taco/src/components/Table2/types.js +0 -18
  221. package/dist/esm/packages/taco/src/components/Table2/types.js.map +0 -1
  222. package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js +0 -41
  223. package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js.map +0 -1
  224. package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js +0 -387
  225. package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js.map +0 -1
  226. package/dist/esm/packages/taco/src/components/Table2/utilities/filterFn.js +0 -100
  227. package/dist/esm/packages/taco/src/components/Table2/utilities/filterFn.js.map +0 -1
  228. package/dist/esm/packages/taco/src/components/Truncate/Truncate.js +0 -32
  229. package/dist/esm/packages/taco/src/components/Truncate/Truncate.js.map +0 -1
  230. package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js +0 -20
  231. package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js.map +0 -1
@@ -1,148 +0,0 @@
1
- import React from 'react';
2
- import { BuiltInSortingFn, ColumnFiltersState, ColumnOrderState, ColumnSizingState, OnChangeFn, Row, SortingState, VisibilityState } from '@tanstack/react-table';
3
- import { DialogProps } from '../Dialog/Dialog';
4
- import { IconName } from '../Icon/Icon';
5
- import { MenuProps } from '../Menu/Menu';
6
- export declare enum Table2FilterComparator {
7
- Contains = 0,
8
- DoesNotContain = 1,
9
- IsEqualTo = 2,
10
- IsNotEqualTo = 3,
11
- IsGreaterThan = 4,
12
- IsLessThan = 5,
13
- IsBetween = 6,
14
- IsOneOf = 7,
15
- IsNoneOf = 8,
16
- IsAllOf = 9,
17
- IsEmpty = 10,
18
- IsNotEmpty = 11
19
- }
20
- export declare type Table2Filter<TType = any> = {
21
- comparator?: Table2FilterComparator;
22
- value: TType | TType[];
23
- };
24
- export declare type ColumnOffsetState = Record<string, number | undefined>;
25
- export declare type RowDensity = 'compact' | 'normal' | 'comfortable' | 'spacious';
26
- export declare type CellAlignment = 'left' | 'center' | 'right';
27
- export declare type SortDirection = 'asc' | 'desc';
28
- export declare type ColumnDataType = 'auto' | 'alphanumeric' | 'alphanumericCaseSensitive' | 'datetime' | 'boolean';
29
- export declare type Table2ColumnHeaderRenderer<TType = any> = (value: any, row: TType) => JSX.Element | string | null;
30
- export declare type Table2ColumnHeaderMenu = (props: Partial<MenuProps>) => JSX.Element;
31
- export declare type Table2ColumnFooterRenderer = (values: any[]) => JSX.Element | string | null;
32
- export declare type Table2ColumnControlProps = {
33
- className?: string;
34
- disabled?: boolean;
35
- invalid?: boolean;
36
- onBlur: ((newValue?: any) => void) | ((newValue?: any) => Promise<void>);
37
- onFocus: React.FocusEventHandler;
38
- readOnly?: boolean;
39
- ref: React.RefObject<HTMLElement>;
40
- setValue: (value: any) => void;
41
- value: any;
42
- 'data-inline-editing-component'?: 'true';
43
- };
44
- export declare type Table2ColumnControlRenderer<TType = any> = ((props: Table2ColumnControlProps, row?: TType) => JSX.Element) | 'datepicker' | 'input' | 'switch';
45
- export declare type SortFn<TType = unknown> = ((rowA: TType, rowB: TType, columnId: string) => -1 | 0 | 1) | BuiltInSortingFn | 'auto';
46
- export declare type Table2ColumnProps<TType = any> = {
47
- accessor: string;
48
- align?: CellAlignment;
49
- className?: string | ((row: Row<TType>) => string);
50
- control?: Table2ColumnControlRenderer<TType>;
51
- dataType?: ColumnDataType;
52
- defaultActiveColumnIndex?: number;
53
- defaultActiveRowIndex?: number;
54
- defaultHidden?: boolean;
55
- disableFiltering?: boolean;
56
- disableHiding?: boolean;
57
- disableReordering?: boolean;
58
- disableResizing?: boolean;
59
- disableSorting?: boolean;
60
- defaultWidth?: number | 'grow';
61
- header: string;
62
- headerClassName?: string;
63
- footer?: Table2ColumnFooterRenderer;
64
- renderer?: Table2ColumnHeaderRenderer<TType>;
65
- menu?: Table2ColumnHeaderMenu;
66
- minWidth?: number;
67
- sort?: SortDirection;
68
- sortFn?: SortFn<TType>;
69
- tooltip?: string;
70
- };
71
- export declare type Table2ActionProps<TType> = {
72
- dialog?: (rows: TType[], resetSelectedRows: () => void) => (props: Partial<DialogProps>) => JSX.Element;
73
- disabled?: boolean | ((rows: TType[]) => boolean);
74
- icon: IconName | ((rows: TType[]) => IconName);
75
- onClick?: (rows: TType[], resetSelectedRows: () => void) => void;
76
- text: string | ((rows: TType[]) => string);
77
- visible?: boolean | ((rows: TType[]) => boolean);
78
- };
79
- export declare type Table2RowActionRenderer<TType = unknown> = (row: TType) => JSX.Element | null;
80
- export declare type Table2Settings = {
81
- columnFilters?: ColumnFiltersState;
82
- columnOrder?: ColumnOrderState;
83
- columnSizing?: ColumnSizingState;
84
- columnVisibility?: VisibilityState;
85
- frozenColumnCount?: number;
86
- globalFilter?: string;
87
- rowDensity?: RowDensity;
88
- sorting?: SortingState;
89
- };
90
- export declare type RowClickHandler<TType = any> = (row: TType) => void;
91
- export declare type RowDragHandler<TType = any> = (rows: TType[], showPlaceholder: (string: any) => void, setDataTransfer: (data: string) => void) => void;
92
- export declare type RowDropHandler<TType = any> = (event: React.DragEvent, row: TType) => void;
93
- export declare type RowSelectionHandler<TType = any> = (rows: TType[], allSelected: boolean) => void;
94
- export declare type RowExpansionRenderer<TType = any> = (row: TType) => (() => JSX.Element) | null;
95
- export declare type SortHandler = OnChangeFn<SortingState>;
96
- export declare type SettingsHandler = OnChangeFn<Table2Settings>;
97
- export declare type SaveHandlerErrorResponse = Record<string, string | undefined | null> | null;
98
- export declare type SaveHandler<TType = any> = (row: TType, accessor: string) => Promise<SaveHandlerErrorResponse | void>;
99
- export declare type DataColumnIndexes = {
100
- dataColumnStartOffset: number;
101
- dataColumnEndOffset: number;
102
- };
103
- export declare type Table2Children<TType = any> = (React.ReactElement<Table2ColumnProps<TType>> | boolean | null | undefined)[];
104
- export declare type Table2ShortcutHandlerFn<TType = any> = (row: TType) => void;
105
- export declare type Table2ShortcutHandlerObject<TType = any> = {
106
- handler: Table2ShortcutHandlerFn<TType>;
107
- meta?: boolean;
108
- shift?: boolean;
109
- };
110
- export declare type Table2Shortcuts<TType = any> = Record<string, Table2ShortcutHandlerFn<TType> | Table2ShortcutHandlerObject<TType>>;
111
- export declare type Table2Props<TType = any> = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
112
- actionsForRow?: Table2RowActionRenderer<TType>[];
113
- actionsForRowLength?: number;
114
- children: Table2Children;
115
- className?: string;
116
- data: TType[];
117
- defaultActiveRowIndex?: number;
118
- disableColumnFiltering?: boolean;
119
- disableColumnHiding?: boolean;
120
- disableColumnFreezing?: boolean;
121
- disableColumnReordering?: boolean;
122
- disableColumnResizing?: boolean;
123
- disableRowDensity?: boolean;
124
- disableRowExpansion?: boolean;
125
- disableRowSelection?: boolean;
126
- disableMultipleRowSelection?: boolean;
127
- disableSearch?: boolean;
128
- disableSorting?: boolean;
129
- emptyState?: () => JSX.Element;
130
- expandedRowRenderer?: RowExpansionRenderer<TType>;
131
- length?: number;
132
- loadMore?: () => Promise<void>;
133
- manualColumnFiltering?: boolean;
134
- manualSearch?: boolean;
135
- manualSorting?: boolean;
136
- onChangeSettings?: SettingsHandler;
137
- onRowClick?: RowClickHandler<TType>;
138
- onRowDrag?: RowDragHandler<TType>;
139
- onRowDrop?: RowDropHandler<TType>;
140
- onRowSelect?: RowSelectionHandler<TType>;
141
- onSave?: SaveHandler<TType>;
142
- shortcuts?: Table2Shortcuts<TType>;
143
- toolbarLeft?: JSX.Element;
144
- toolbarRight?: JSX.Element;
145
- settings?: Table2Settings;
146
- _experimentalActionsForTable?: Table2ActionProps<TType>[];
147
- _experimentalActionsForTableSummary?: (rows: TType[]) => JSX.Element | string;
148
- };
@@ -1,14 +0,0 @@
1
- import { Column } from '@tanstack/react-table';
2
- import { CellAlignment, RowDensity } from '../types';
3
- export declare const getCellSizingClasses: (density?: RowDensity, editing?: boolean) => string;
4
- export declare const getCellAlignmentClasses: (alignment?: CellAlignment) => {
5
- 'justify-start text-left': boolean;
6
- 'justify-end text-right': boolean;
7
- 'justify-center text-center': boolean;
8
- };
9
- export declare const getFrozenShadowClasses: (column: Column<any, any>, frozenColumns: string[], isHorizontallyOffset: boolean) => {
10
- 'shadow-[6px_0px_6px_rgb(0_0_0/8%),1px_0px_0px_theme(colors.grey.300)]': boolean;
11
- 'shadow-[1px_0px_0px_theme(colors.grey.300)]': boolean;
12
- };
13
- export declare const focussableNodeNames: string[];
14
- export declare const isKeyboardFocusableElement: (element: Element) => boolean;
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { ColumnDef, DisplayColumnDef } from '@tanstack/react-table';
3
- import { RowDragHandler, RowExpansionRenderer } from '../types';
4
- import { LocalizationTexts } from '../../Provider/Localization';
5
- export declare const COLUMN_ID_FOR_DRAGGABLE = "__draggable";
6
- export declare const COLUMN_ID_FOR_SELECTION = "__select";
7
- export declare const COLUMN_ID_FOR_EXPANSION = "__expansion";
8
- export declare const COLUMN_ID_FOR_ACTIONS = "__actions";
9
- export declare const isInternalFrozenColumn: (id: string) => boolean;
10
- export declare const isInternalColumn: (id: string) => boolean;
11
- export declare const MIN_COLUMN_SIZE = 80;
12
- export declare function createRowDraggableColumn<TType = any>(onRowDrag: RowDragHandler<TType>, texts: LocalizationTexts): DisplayColumnDef<TType, any>;
13
- export declare function createRowSelectionColumn<TType = any>(enableMultipleRowSelection: boolean, lastSelectedRowIndex: React.MutableRefObject<number | undefined>, onRowDrag: RowDragHandler<TType> | undefined, tableRef: React.RefObject<HTMLDivElement>, texts: LocalizationTexts): DisplayColumnDef<TType, any>;
14
- export declare function createRowExpansionColumn<TType = any>(expandedRowRenderer: RowExpansionRenderer<TType>, texts: LocalizationTexts): DisplayColumnDef<TType, any>;
15
- export declare function createRowActionsColumn<TType = any>(rowActions: any, rowActionsLength: any, texts: LocalizationTexts): DisplayColumnDef<TType, any>;
16
- export declare function ensureOrdering<TType = unknown>(columns: ColumnDef<TType>[], settingsOrder: string[] | undefined): string[];
@@ -1,3 +0,0 @@
1
- import { Table2Filter } from '../types';
2
- export declare const globalFilterFn: (value: string, query: string) => boolean;
3
- export declare const columnFilterFn: (value: any, filter: Table2Filter) => boolean;
@@ -1,422 +0,0 @@
1
- import React__default from 'react';
2
- import cn from 'classnames';
3
- import { useMergedRef } from '../../hooks/useMergedRef.js';
4
- import { useLocalization } from '../Provider/Localization.js';
5
- import { Group } from '../Group/Group.js';
6
- import { _finallyRethrows, _catch } from '../../../../../node_modules/babel-plugin-transform-async-to-promises/helpers.mjs.js';
7
- import { Cell } from './components/column/Cell.js';
8
- import { Header } from './components/column/Header.js';
9
- import { Footer } from './components/column/Footer.js';
10
- import { useTable } from './hooks/useTable.js';
11
- import { useVirtualiser } from './hooks/useVirtualiser.js';
12
- import { useGridTemplate } from './hooks/useGridTemplate.js';
13
- import { RowDensityButton } from './components/RowDensityButton.js';
14
- import { ColumnSettingsButton } from './components/ColumnSettingsButton.js';
15
- import { ExpandedRow } from './components/row/ExpandedRow.js';
16
- import { BatchActionsMenu } from './components/BatchActionsMenu.js';
17
- import { Row } from './components/row/Row.js';
18
- import { FiltersButton } from './components/filters/FiltersButton.js';
19
- import { Search } from './components/Search.js';
20
- import { EditModeButton } from './components/EditModeButton.js';
21
-
22
- function Column(_) {
23
- return null;
24
- }
25
- Column.displayName = 'Table2Column';
26
- const BaseTable2 = /*#__PURE__*/React__default.forwardRef(function BaseTable2(props, ref) {
27
- // dom
28
- const {
29
- emptyState: EmptyState,
30
- expandedRowRenderer,
31
- length = props.data.length,
32
- loadMore,
33
- onRowClick,
34
- onRowDrop,
35
- toolbarLeft,
36
- toolbarRight,
37
- _experimentalActionsForTable,
38
- _experimentalActionsForTableSummary
39
- } = props;
40
- const tableRef = useMergedRef(ref);
41
- const timeoutIdRef = React__default.useRef();
42
- const prevScrollY = React__default.useRef(0);
43
- // react-table
44
- const {
45
- rows,
46
- table,
47
- footers
48
- } = useTable(props.children, props, tableRef);
49
- const meta = table.options.meta;
50
- const {
51
- columnVisibility,
52
- columnOrder,
53
- globalFilter
54
- } = table.getState();
55
- React__default.useEffect(() => {
56
- if (tableRef.current) {
57
- tableRef.current.instance = {
58
- resetFiltering: () => table.resetColumnFilters(),
59
- resetRowExpansion: () => table.resetExpanded(),
60
- resetRowSelection: () => table.resetRowSelection(),
61
- resetSorting: () => table.resetSorting(),
62
- toggleEditing: () => meta.editMode.toggleEditing()
63
- };
64
- }
65
- }, [table, tableRef.current]);
66
- // If column visibility or order changes then we turn off the edit mode so that control indexes gets computed
67
- // when user turns on the editing mode again. This is a temporary solution to make sure the keyboard navigation
68
- // still keeps working on changes in column visibility, order, or both
69
- React__default.useEffect(() => {
70
- meta.resetFocussableColumnIndexes();
71
- }, [columnVisibility, columnOrder]);
72
- React__default.useEffect(() => {
73
- // Whenever edit mode is turned off we reset the focussableColumnIndexes ref to an empty array so that
74
- // we don't have stale values, in case column visibility or ordering changes
75
- if (!meta.editMode.isEditing) {
76
- meta.resetFocussableColumnIndexes();
77
- }
78
- }, [meta.editMode.isEditing]);
79
- React__default.useEffect(() => {
80
- return () => clearTimeout(timeoutIdRef.current);
81
- }, []);
82
- // virtualiser
83
- const {
84
- virtualiser,
85
- virtualiserOffsets,
86
- setExpandedRowSizes
87
- } = useVirtualiser({
88
- rows,
89
- table
90
- }, tableRef);
91
- // css grid
92
- const gridTemplateColumns = useGridTemplate(table);
93
- // handlers
94
- const editButtonRef = React__default.useRef(null);
95
- // support grid like keyboard navigation between cells
96
- const handleKeyDown = event => {
97
- if (document.activeElement === tableRef.current) {
98
- if (event.key === 'ArrowUp') {
99
- event.preventDefault();
100
- if (event.ctrlKey || event.metaKey) {
101
- meta.setActiveRowIndex(0);
102
- virtualiser.scrollToOffset(0);
103
- } else {
104
- meta.moveToPreviousRow(rows, nextIndex => {
105
- meta.setShouldPauseHoverState(true);
106
- virtualiser.scrollToIndex(nextIndex - 1);
107
- });
108
- }
109
- return;
110
- } else if (event.key === 'ArrowDown') {
111
- event.preventDefault();
112
- if (event.ctrlKey || event.metaKey) {
113
- meta.setActiveRowIndex(rows.length - 1);
114
- virtualiser.scrollToOffset(virtualiser.totalSize + 1);
115
- } else {
116
- meta.moveToNextRow(rows, nextIndex => {
117
- meta.setShouldPauseHoverState(true);
118
- // the virtualiser doesn't always scroll right to the bottom for the last row
119
- if (nextIndex === rows.length - 1) {
120
- var _tableRef$current;
121
- (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.scrollTo(0, tableRef.current.scrollHeight);
122
- } else {
123
- virtualiser.scrollToIndex(nextIndex + 2);
124
- }
125
- });
126
- }
127
- return;
128
- }
129
- const canToggleRowExpansion = table.options.enableExpanding;
130
- if (event.key === 'ArrowLeft') {
131
- event.preventDefault();
132
- if (event.ctrlKey || event.metaKey) {
133
- if (canToggleRowExpansion) {
134
- var _rows$meta$activeRowI;
135
- (_rows$meta$activeRowI = rows[meta.activeRowIndex]) === null || _rows$meta$activeRowI === void 0 ? void 0 : _rows$meta$activeRowI.toggleExpanded(false);
136
- }
137
- }
138
- return;
139
- }
140
- if (event.key === 'ArrowRight') {
141
- event.preventDefault();
142
- if (event.ctrlKey || event.metaKey) {
143
- if (canToggleRowExpansion) {
144
- var _rows$meta$activeRowI2;
145
- (_rows$meta$activeRowI2 = rows[meta === null || meta === void 0 ? void 0 : meta.activeRowIndex]) === null || _rows$meta$activeRowI2 === void 0 ? void 0 : _rows$meta$activeRowI2.toggleExpanded(true);
146
- }
147
- }
148
- return;
149
- }
150
- if (event.key === 'Enter') {
151
- event.preventDefault();
152
- if (onRowClick) {
153
- onRowClick(rows[meta === null || meta === void 0 ? void 0 : meta.activeRowIndex].original);
154
- }
155
- return;
156
- }
157
- if (event.key === ' ') {
158
- event.preventDefault();
159
- if (table.options.enableRowSelection) {
160
- var _rows$meta$activeRowI3;
161
- (_rows$meta$activeRowI3 = rows[meta.activeRowIndex]) === null || _rows$meta$activeRowI3 === void 0 ? void 0 : _rows$meta$activeRowI3.toggleSelected();
162
- }
163
- return;
164
- }
165
- if (event.ctrlKey || event.metaKey) {
166
- if (event.key === 'a' && table.options.enableRowSelection) {
167
- event.preventDefault();
168
- table.toggleAllRowsSelected();
169
- }
170
- return;
171
- }
172
- }
173
- };
174
- let handleBlur;
175
- if (meta.editMode.isEditing) {
176
- handleBlur = event => {
177
- var _elementGainingFocus, _elementGainingFocus$, _event$currentTarget;
178
- let elementGainingFocus = event.relatedTarget;
179
- if (elementGainingFocus === undefined) {
180
- return;
181
- }
182
- // we might be focusing on a select or a popover that was triggered from inside the table
183
- // so see if the element gaining focus is inside a portal and look up its controller
184
- const portalId = (_elementGainingFocus = elementGainingFocus) === null || _elementGainingFocus === void 0 ? void 0 : (_elementGainingFocus$ = _elementGainingFocus.closest('[data-radix-popper-content-wrapper] > :first-child')) === null || _elementGainingFocus$ === void 0 ? void 0 : _elementGainingFocus$.id;
185
- if (portalId) {
186
- var _event$currentTarget$;
187
- elementGainingFocus = (_event$currentTarget$ = event.currentTarget.querySelector(`[aria-controls="${portalId}"]`)) !== null && _event$currentTarget$ !== void 0 ? _event$currentTarget$ : event.relatedTarget;
188
- }
189
- if (!((_event$currentTarget = event.currentTarget) !== null && _event$currentTarget !== void 0 && _event$currentTarget.contains(elementGainingFocus)) && elementGainingFocus !== editButtonRef.current) {
190
- // When we call manually blur on control component while navigating to the next cell, then when this
191
- // handler is run, the related target is not the next control component and active element is null,
192
- // that's why we explictly need to check what's the next focussed element in order to figure out whether
193
- // we should disabled the sorting or not.
194
- timeoutIdRef.current = setTimeout(() => {
195
- const parentRow = event.target.closest('[role="row"]');
196
- const isNewFocussedElementInSameRow = parentRow === null || parentRow === void 0 ? void 0 : parentRow.contains(document.activeElement);
197
- // When we manually call blur on control component and focus another component then
198
- // we have to make sure we
199
- if (meta.shouldPauseSortingAndFiltering && !isNewFocussedElementInSameRow) {
200
- // if client side - unpause sorting
201
- meta.setShouldPauseSortingAndFiltering(false);
202
- }
203
- });
204
- }
205
- };
206
- }
207
- // TODO: this can probably be extracted into a hook
208
- // we only show the pinned shadow on display columns when scrolling is active
209
- const [scrolled, setScrolled] = React__default.useState(false);
210
- // extract - infinite loading
211
- const loadingRef = React__default.useRef(false);
212
- const handleScroll = function (event) {
213
- try {
214
- const _temp5 = function () {
215
- if (event.currentTarget.scrollLeft > 0 && !scrolled) {
216
- setScrolled(true);
217
- } else {
218
- const _temp4 = function () {
219
- if (event.currentTarget.scrollLeft === 0 && scrolled) {
220
- setScrolled(false);
221
- } else {
222
- const _temp3 = function () {
223
- if (typeof loadMore === 'function') {
224
- const scrollY = event.currentTarget.scrollTop;
225
- const isScrollingDown = scrollY > prevScrollY.current;
226
- prevScrollY.current = scrollY;
227
- const scrolledPercentage = Math.round(scrollY / (event.currentTarget.scrollHeight - event.currentTarget.clientHeight) * 100);
228
- const _temp2 = function () {
229
- if (isScrollingDown && !loadingRef.current && scrolledPercentage >= 80) {
230
- const _temp = _finallyRethrows(function () {
231
- return _catch(function () {
232
- const isAllRowsSelected = table.getIsAllRowsSelected();
233
- loadingRef.current = true;
234
- return Promise.resolve(loadMore()).then(function () {
235
- if (isAllRowsSelected) {
236
- table.toggleAllRowsSelected(true);
237
- }
238
- });
239
- }, function (error) {
240
- console.error(error);
241
- });
242
- }, function (_wasThrown, _result) {
243
- loadingRef.current = false;
244
- if (_wasThrown) throw _result;
245
- return _result;
246
- });
247
- if (_temp && _temp.then) return _temp.then(function () {});
248
- }
249
- }();
250
- if (_temp2 && _temp2.then) return _temp2.then(function () {});
251
- }
252
- }();
253
- if (_temp3 && _temp3.then) return _temp3.then(function () {});
254
- }
255
- }();
256
- if (_temp4 && _temp4.then) return _temp4.then(function () {});
257
- }
258
- }();
259
- return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(function () {}) : void 0);
260
- } catch (e) {
261
- return Promise.reject(e);
262
- }
263
- };
264
- let handleMouseLeave;
265
- if (meta.shouldPauseHoverState) {
266
- // sometimes the row's onMouseLeave doesn't trigger, this adds some extra redundancy
267
- handleMouseLeave = () => meta.setShouldPauseHoverState(false);
268
- }
269
- const className = cn('bg-white border border-grey-300 focus:yt-focus focus:border-blue-500 grid auto-rows-max overflow-auto relative rounded group', props.className);
270
- const enableSettingsButton = table.options.enableHiding || meta.enableColumnReordering;
271
- const hasInternalToolbar = enableSettingsButton || meta.editMode.enableEditMode || table.options.enableColumnFilters || meta.enableRowDensity || table.options.enableGlobalFilter;
272
- const hasToolbar = hasInternalToolbar || !!toolbarLeft || !toolbarRight;
273
- const frozenColumnIds = table.getLeftVisibleLeafColumns().map(c => c.id);
274
- return /*#__PURE__*/React__default.createElement("div", {
275
- className: "-m-0.5 flex h-full w-[calc(100%_+_0.25rem)] flex-col gap-4 overflow-hidden p-0.5"
276
- }, hasToolbar ? /*#__PURE__*/React__default.createElement("div", {
277
- className: "flex flex-wrap gap-2"
278
- }, toolbarLeft, hasInternalToolbar ? /*#__PURE__*/React__default.createElement(Group, {
279
- className: "ml-auto flex-shrink-0 print:hidden"
280
- }, meta.editMode.enableEditMode ? /*#__PURE__*/React__default.createElement(EditModeButton, {
281
- ref: editButtonRef,
282
- table: table,
283
- tableRef: tableRef,
284
- scrollToIndex: virtualiser.scrollToIndex
285
- }) : null, table.options.enableColumnFilters ? /*#__PURE__*/React__default.createElement(FiltersButton, {
286
- length: length,
287
- table: table
288
- }) : null, toolbarRight, meta.enableRowDensity ? /*#__PURE__*/React__default.createElement(RowDensityButton, {
289
- table: table
290
- }) : null, enableSettingsButton ? /*#__PURE__*/React__default.createElement(ColumnSettingsButton, {
291
- table: table
292
- }) : null, table.options.enableGlobalFilter ? /*#__PURE__*/React__default.createElement(Search, {
293
- disabled: meta.shouldDisableTableActions,
294
- onSearch: table.setGlobalFilter,
295
- value: globalFilter
296
- }) : null) : null) : null, /*#__PURE__*/React__default.createElement("div", {
297
- className: className,
298
- "data-taco": "table2",
299
- onBlur: handleBlur,
300
- onKeyDown: handleKeyDown,
301
- onMouseLeave: handleMouseLeave,
302
- onScroll: handleScroll,
303
- ref: tableRef,
304
- role: "table",
305
- style: {
306
- gridTemplateColumns,
307
- gridTemplateRows: rows.length ? undefined : '40px',
308
- // create a new stacking context so our internal z-indexes don't effect external components
309
- // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
310
- opacity: 0.999
311
- },
312
- tabIndex: 0
313
- }, /*#__PURE__*/React__default.createElement("div", {
314
- className: "contents",
315
- "data-taco": "table2-header",
316
- role: "rowgroup"
317
- }, table.getHeaderGroups().map(headerGroup => /*#__PURE__*/React__default.createElement("div", {
318
- className: "contents",
319
- key: headerGroup.id,
320
- role: "row"
321
- }, headerGroup.headers.map((header, columnIndex) => /*#__PURE__*/React__default.createElement(Header, {
322
- frozenColumnIds: frozenColumnIds,
323
- key: header.id,
324
- header: header,
325
- index: columnIndex,
326
- isLastColumn: columnIndex === headerGroup.headers.length - 1,
327
- scrolled: scrolled,
328
- table: table,
329
- tableRef: tableRef
330
- }))))), rows.length ? /*#__PURE__*/React__default.createElement("div", {
331
- className: "contents",
332
- "data-taco": "table2-body",
333
- role: "rowgroup"
334
- }, virtualiserOffsets.top ? /*#__PURE__*/React__default.createElement("div", {
335
- style: {
336
- height: virtualiserOffsets.top
337
- },
338
- className: "col-span-full"
339
- }) : null, virtualiser.virtualItems.map(virtualRow => {
340
- var _expandedRowRenderer;
341
- const row = rows[virtualRow.index];
342
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
343
- key: row.id
344
- }, /*#__PURE__*/React__default.createElement(Row, {
345
- className: "group/row contents",
346
- onRowDrop: onRowDrop,
347
- row: row,
348
- rowIndex: virtualRow.index,
349
- table: table
350
- }, row.getVisibleCells().map((cell, columnIndex) => /*#__PURE__*/React__default.createElement(Cell, {
351
- cell: cell,
352
- frozenColumnIds: frozenColumnIds,
353
- key: `${cell.id}_${cell.getValue()}`,
354
- index: columnIndex,
355
- isLastRow: virtualRow.index === rows.length - 1,
356
- rows: rows,
357
- rowIndex: virtualRow.index,
358
- scrolled: scrolled,
359
- scrollToIndex: virtualiser.scrollToIndex,
360
- scrollToOffset: virtualiser.scrollToOffset,
361
- table: table,
362
- tableRef: tableRef
363
- }))), row.getIsExpanded() && expandedRowRenderer ? /*#__PURE__*/React__default.createElement(ExpandedRow, {
364
- index: virtualRow.index,
365
- setSize: setExpandedRowSizes
366
- }, (_expandedRowRenderer = expandedRowRenderer(row.original)) === null || _expandedRowRenderer === void 0 ? void 0 : _expandedRowRenderer()) : null);
367
- }), virtualiserOffsets.bottom ? /*#__PURE__*/React__default.createElement("div", {
368
- style: {
369
- height: virtualiserOffsets.bottom
370
- },
371
- className: "col-span-full"
372
- }) : null) : /*#__PURE__*/React__default.createElement("div", {
373
- className: "col-span-full min-h-[theme(spacing.8)]"
374
- }, EmptyState ? /*#__PURE__*/React__default.createElement(EmptyState, null) : null), /*#__PURE__*/React__default.createElement("div", {
375
- className: "contents",
376
- "data-taco": "table2-footer",
377
- role: "rowgroup"
378
- }, /*#__PURE__*/React__default.createElement("div", {
379
- role: "row",
380
- className: "contents"
381
- }, table.getFooterGroups().map(footerGroup => footerGroup.headers.map((footer, cellIndex) => /*#__PURE__*/React__default.createElement(Footer, {
382
- key: footer.id,
383
- footer: footer,
384
- frozenColumnIds: frozenColumnIds,
385
- index: cellIndex,
386
- scrolled: scrolled,
387
- table: table
388
- }, footers[footer.id] ? footers[footer.id](rows.map(row => row.original[footer.id])) : null)))), /*#__PURE__*/React__default.createElement(Summary, {
389
- length: length !== null && length !== void 0 ? length : rows.length,
390
- table: table
391
- }))), !!_experimentalActionsForTable && table.options.enableRowSelection && (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) ? /*#__PURE__*/React__default.createElement(BatchActionsMenu, {
392
- className: "fixed-center-x bottom-0 z-50 mb-4 print:hidden",
393
- actionsForTable: _experimentalActionsForTable,
394
- summary: _experimentalActionsForTableSummary,
395
- table: table
396
- }) : null);
397
- });
398
- const Summary = ({
399
- length,
400
- table
401
- }) => {
402
- const {
403
- texts
404
- } = useLocalization();
405
- const selectedLength = table.getIsAllRowsSelected() ? length : table.getSelectedRowModel().rows.length;
406
- const label = selectedLength > 0 ? texts.table2.footer.summary.selected : texts.table2.footer.summary.records;
407
- const total = selectedLength > 0 ? selectedLength : length;
408
- return /*#__PURE__*/React__default.createElement("div", {
409
- className: cn('sticky bottom-0 left-0 z-10 -mt-10 flex h-10 w-fit items-center whitespace-nowrap bg-white px-4 !pr-3 shadow-[6px_0px_6px_theme(colors.white)]')
410
- }, label, "\u00A0", /*#__PURE__*/React__default.createElement("strong", null, total));
411
- };
412
- const Table2 = /*#__PURE__*/React__default.forwardRef(function Table2(props, ref) {
413
- const key = React__default.useMemo(() => String('tableKey_' + String(props.children)), [props.children]);
414
- return /*#__PURE__*/React__default.createElement(BaseTable2, Object.assign({}, props, {
415
- key: key,
416
- ref: ref
417
- }));
418
- });
419
- Table2.Column = Column;
420
-
421
- export { Table2 };
422
- //# sourceMappingURL=Table2.js.map