@economic/taco 2.18.0 → 2.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (359) hide show
  1. package/dist/components/Provider/Localization.d.ts +18 -0
  2. package/dist/components/Report/components/Body/Body.d.ts +8 -0
  3. package/dist/components/Report/components/Cell/Cell.d.ts +3 -0
  4. package/dist/components/Report/components/Cell/DisplayCell.d.ts +7 -0
  5. package/dist/components/Report/components/Cell/GroupedCell.d.ts +7 -0
  6. package/dist/components/Report/components/Cell/util.d.ts +18 -0
  7. package/dist/components/Report/components/Footer/Footer.d.ts +6 -0
  8. package/dist/components/Report/components/Footer/Summary.d.ts +7 -0
  9. package/dist/components/Report/components/Header/Header.d.ts +37 -0
  10. package/dist/components/Report/components/Header/components/Goto.d.ts +6 -0
  11. package/dist/components/Report/components/Header/components/Menu.d.ts +17 -0
  12. package/dist/components/Report/components/Header/components/Resizer.d.ts +12 -0
  13. package/dist/components/Report/components/Header/components/SortIndicator.d.ts +15 -0
  14. package/dist/components/Report/components/Header/util.d.ts +4 -0
  15. package/dist/components/Report/components/Internal/Actions.d.ts +13 -0
  16. package/dist/components/Report/components/Internal/Expansion.d.ts +4 -0
  17. package/dist/components/Report/components/Internal/Selection.d.ts +4 -0
  18. package/dist/components/Report/components/Row/DisplayRow.d.ts +16 -0
  19. package/dist/components/Report/components/Row/Row.d.ts +8 -0
  20. package/dist/components/Report/components/Row/RowContext.d.ts +9 -0
  21. package/dist/components/Report/components/Row/SkeletonRow.d.ts +10 -0
  22. package/dist/components/Report/components/Toolbar/Toolbar.d.ts +15 -0
  23. package/dist/components/Report/components/Toolbar/components/Filters/Filters.d.ts +7 -0
  24. package/dist/components/Report/components/Toolbar/components/Filters/ManageFiltersPopover.d.ts +7 -0
  25. package/dist/components/Report/components/Toolbar/components/Filters/components/Filter.d.ts +12 -0
  26. package/dist/components/Report/components/Toolbar/components/Filters/components/FilterColumn.d.ts +9 -0
  27. package/dist/components/Report/components/Toolbar/components/Filters/components/FilterComparator.d.ts +7 -0
  28. package/dist/components/Report/components/Toolbar/components/Filters/components/FilterValue.d.ts +10 -0
  29. package/dist/components/Report/components/Toolbar/components/Filters/components/Placeholder.d.ts +12 -0
  30. package/dist/components/Report/components/Toolbar/components/Filters/util.d.ts +2 -0
  31. package/dist/components/Report/components/Toolbar/components/Print/Print.d.ts +9 -0
  32. package/dist/components/Report/components/Toolbar/components/Print/PrintDialog.d.ts +17 -0
  33. package/dist/components/Report/components/Toolbar/components/Search/Search.d.ts +8 -0
  34. package/dist/components/Report/components/Toolbar/components/Settings/HideOrOrderPopover.d.ts +7 -0
  35. package/dist/components/Report/components/Toolbar/components/Settings/Settings.d.ts +8 -0
  36. package/dist/components/Report/features/useReportExport.d.ts +3 -0
  37. package/dist/components/Report/styles/useColumnPinningStylesheet.d.ts +2 -0
  38. package/dist/components/Report/styles/useCssGridStylesheet.d.ts +3 -0
  39. package/dist/components/Report/styles/useStylesheet.d.ts +3 -0
  40. package/dist/components/Report/styles/util.d.ts +3 -0
  41. package/dist/components/Report/types.d.ts +20 -0
  42. package/dist/components/Report/useReport.d.ts +14 -0
  43. package/dist/components/Report/util/rows.d.ts +7 -0
  44. package/dist/components/Report/util/useTableGlobalShortcuts.d.ts +4 -0
  45. package/dist/components/Report/util/useTableRenderer.d.ts +9 -0
  46. package/dist/components/Select2/Select2.d.ts +2 -0
  47. package/dist/components/Select2/components/Context.d.ts +2 -0
  48. package/dist/components/Select2/components/Group.d.ts +2 -0
  49. package/dist/components/Select2/components/Option.d.ts +3 -0
  50. package/dist/components/Table3/Table3.d.ts +1 -1
  51. package/dist/components/Table3/components/rows/Row.d.ts +1 -1
  52. package/dist/components/Table3/components/toolbar/FontSize.d.ts +0 -4
  53. package/dist/components/Table3/hooks/features/usePrinting.d.ts +7 -0
  54. package/dist/components/Table3/hooks/useCssGrid.d.ts +2 -2
  55. package/dist/components/Table3/hooks/useCssVars.d.ts +3 -2
  56. package/dist/components/Table3/hooks/useTable.d.ts +5 -5
  57. package/dist/components/Table3/types.d.ts +23 -5
  58. package/dist/esm/index.css +12 -12
  59. package/dist/esm/packages/taco/src/components/Accordion/Accordion.js +1 -1
  60. package/dist/esm/packages/taco/src/components/Accordion/Accordion.js.map +1 -1
  61. package/dist/esm/packages/taco/src/components/Alert/Alert.js +1 -1
  62. package/dist/esm/packages/taco/src/components/Alert/Alert.js.map +1 -1
  63. package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js +1 -1
  64. package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js.map +1 -1
  65. package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js +2 -2
  66. package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js.map +1 -1
  67. package/dist/esm/packages/taco/src/components/Badge/Badge.js +1 -1
  68. package/dist/esm/packages/taco/src/components/Badge/Badge.js.map +1 -1
  69. package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js +1 -1
  70. package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js.map +1 -1
  71. package/dist/esm/packages/taco/src/components/Banner/Banner.js +2 -2
  72. package/dist/esm/packages/taco/src/components/Banner/Banner.js.map +1 -1
  73. package/dist/esm/packages/taco/src/components/Button/Button.js +1 -1
  74. package/dist/esm/packages/taco/src/components/Button/Button.js.map +1 -1
  75. package/dist/esm/packages/taco/src/components/Calendar/Calendar.js +1 -1
  76. package/dist/esm/packages/taco/src/components/Calendar/Calendar.js.map +1 -1
  77. package/dist/esm/packages/taco/src/components/Card/Card.js +2 -2
  78. package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
  79. package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js +1 -1
  80. package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js.map +1 -1
  81. package/dist/esm/packages/taco/src/components/Combobox/Combobox.js +1 -1
  82. package/dist/esm/packages/taco/src/components/Combobox/Combobox.js.map +1 -1
  83. package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js +1 -1
  84. package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
  85. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +5 -5
  86. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
  87. package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js +1 -1
  88. package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js.map +1 -1
  89. package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js +1 -1
  90. package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js.map +1 -1
  91. package/dist/esm/packages/taco/src/components/Drawer/Drawer.js +1 -1
  92. package/dist/esm/packages/taco/src/components/Drawer/Drawer.js.map +1 -1
  93. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +1 -1
  94. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
  95. package/dist/esm/packages/taco/src/components/Drawer/util.js +1 -1
  96. package/dist/esm/packages/taco/src/components/Drawer/util.js.map +1 -1
  97. package/dist/esm/packages/taco/src/components/Field/Field.js +1 -1
  98. package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
  99. package/dist/esm/packages/taco/src/components/Form/Form.js +1 -1
  100. package/dist/esm/packages/taco/src/components/Form/Form.js.map +1 -1
  101. package/dist/esm/packages/taco/src/components/Group/Group.js +1 -1
  102. package/dist/esm/packages/taco/src/components/Group/Group.js.map +1 -1
  103. package/dist/esm/packages/taco/src/components/Hanger/Hanger.js +2 -2
  104. package/dist/esm/packages/taco/src/components/Hanger/Hanger.js.map +1 -1
  105. package/dist/esm/packages/taco/src/components/Header/Header.js +1 -1
  106. package/dist/esm/packages/taco/src/components/Header/Header.js.map +1 -1
  107. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js +1 -1
  108. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js.map +1 -1
  109. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js +2 -2
  110. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js.map +1 -1
  111. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js +2 -2
  112. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js.map +1 -1
  113. package/dist/esm/packages/taco/src/components/Header/components/Button.js +1 -1
  114. package/dist/esm/packages/taco/src/components/Header/components/Button.js.map +1 -1
  115. package/dist/esm/packages/taco/src/components/Header/components/Link.js +1 -1
  116. package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -1
  117. package/dist/esm/packages/taco/src/components/Header/components/Logo.js +1 -1
  118. package/dist/esm/packages/taco/src/components/Header/components/Logo.js.map +1 -1
  119. package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js +1 -1
  120. package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js.map +1 -1
  121. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js +1 -1
  122. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js.map +1 -1
  123. package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js +1 -1
  124. package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js.map +1 -1
  125. package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js +1 -1
  126. package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js.map +1 -1
  127. package/dist/esm/packages/taco/src/components/Icon/Icon.js +1 -1
  128. package/dist/esm/packages/taco/src/components/Icon/Icon.js.map +1 -1
  129. package/dist/esm/packages/taco/src/components/IconButton/IconButton.js +1 -1
  130. package/dist/esm/packages/taco/src/components/IconButton/IconButton.js.map +1 -1
  131. package/dist/esm/packages/taco/src/components/Input/Input.js +1 -1
  132. package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
  133. package/dist/esm/packages/taco/src/components/Input/util.js +1 -1
  134. package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
  135. package/dist/esm/packages/taco/src/components/Layout/Layout.js +2 -2
  136. package/dist/esm/packages/taco/src/components/Layout/Layout.js.map +1 -1
  137. package/dist/esm/packages/taco/src/components/Layout/components/Content.js +2 -2
  138. package/dist/esm/packages/taco/src/components/Layout/components/Content.js.map +1 -1
  139. package/dist/esm/packages/taco/src/components/Layout/components/Page.js +2 -2
  140. package/dist/esm/packages/taco/src/components/Layout/components/Page.js.map +1 -1
  141. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +2 -2
  142. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -1
  143. package/dist/esm/packages/taco/src/components/Listbox/Listbox.js +1 -1
  144. package/dist/esm/packages/taco/src/components/Listbox/Listbox.js.map +1 -1
  145. package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js +1 -1
  146. package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js.map +1 -1
  147. package/dist/esm/packages/taco/src/components/Menu/components/Content.js +1 -1
  148. package/dist/esm/packages/taco/src/components/Menu/components/Content.js.map +1 -1
  149. package/dist/esm/packages/taco/src/components/Menu/components/Header.js +1 -1
  150. package/dist/esm/packages/taco/src/components/Menu/components/Header.js.map +1 -1
  151. package/dist/esm/packages/taco/src/components/Menu/components/Item.js +1 -1
  152. package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
  153. package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js +1 -1
  154. package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js.map +1 -1
  155. package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js +1 -1
  156. package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js.map +1 -1
  157. package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js +1 -1
  158. package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js.map +1 -1
  159. package/dist/esm/packages/taco/src/components/Navigation/Navigation.js +1 -1
  160. package/dist/esm/packages/taco/src/components/Navigation/Navigation.js.map +1 -1
  161. package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js +1 -1
  162. package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js.map +1 -1
  163. package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js +1 -1
  164. package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js.map +1 -1
  165. package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js +1 -1
  166. package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js.map +1 -1
  167. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +2 -2
  168. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -1
  169. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +1 -1
  170. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -1
  171. package/dist/esm/packages/taco/src/components/Navigation2/components/util.js +1 -1
  172. package/dist/esm/packages/taco/src/components/Navigation2/components/util.js.map +1 -1
  173. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +1 -1
  174. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
  175. package/dist/esm/packages/taco/src/components/Pagination/Pagination.js +1 -1
  176. package/dist/esm/packages/taco/src/components/Pagination/Pagination.js.map +1 -1
  177. package/dist/esm/packages/taco/src/components/Popover/Popover.js +1 -1
  178. package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
  179. package/dist/esm/packages/taco/src/components/Progress/Progress.js +1 -1
  180. package/dist/esm/packages/taco/src/components/Progress/Progress.js.map +1 -1
  181. package/dist/esm/packages/taco/src/components/Provider/Localization.js +18 -0
  182. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  183. package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js +1 -1
  184. package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js.map +1 -1
  185. package/dist/esm/packages/taco/src/components/RadioGroup/util.js +1 -1
  186. package/dist/esm/packages/taco/src/components/RadioGroup/util.js.map +1 -1
  187. package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js +1 -1
  188. package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
  189. package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +3 -3
  190. package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
  191. package/dist/esm/packages/taco/src/components/Select/Select.js +1 -1
  192. package/dist/esm/packages/taco/src/components/Select/Select.js.map +1 -1
  193. package/dist/esm/packages/taco/src/components/Select/useSelect.js +1 -1
  194. package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
  195. package/dist/esm/packages/taco/src/components/Select2/Select2.js +3 -1
  196. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  197. package/dist/esm/packages/taco/src/components/Select2/components/Context.js.map +1 -1
  198. package/dist/esm/packages/taco/src/components/Select2/components/Create.js +1 -1
  199. package/dist/esm/packages/taco/src/components/Select2/components/Create.js.map +1 -1
  200. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +1 -1
  201. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
  202. package/dist/esm/packages/taco/src/components/Select2/components/Group.js +5 -2
  203. package/dist/esm/packages/taco/src/components/Select2/components/Group.js.map +1 -1
  204. package/dist/esm/packages/taco/src/components/Select2/components/Option.js +9 -3
  205. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  206. package/dist/esm/packages/taco/src/components/Select2/components/Search.js +1 -1
  207. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  208. package/dist/esm/packages/taco/src/components/Select2/components/Title.js +1 -1
  209. package/dist/esm/packages/taco/src/components/Select2/components/Title.js.map +1 -1
  210. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +2 -2
  211. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
  212. package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js +1 -1
  213. package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
  214. package/dist/esm/packages/taco/src/components/Select2/utilities.js +1 -1
  215. package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
  216. package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js +1 -1
  217. package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js.map +1 -1
  218. package/dist/esm/packages/taco/src/components/Spinner/Spinner.js +1 -1
  219. package/dist/esm/packages/taco/src/components/Spinner/Spinner.js.map +1 -1
  220. package/dist/esm/packages/taco/src/components/Switch/Switch.js +1 -1
  221. package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
  222. package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js +2 -2
  223. package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js.map +1 -1
  224. package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js +1 -1
  225. package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
  226. package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js +1 -1
  227. package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js.map +1 -1
  228. package/dist/esm/packages/taco/src/components/Table/util/renderRow.js +1 -1
  229. package/dist/esm/packages/taco/src/components/Table/util/renderRow.js.map +1 -1
  230. package/dist/esm/packages/taco/src/components/Table3/Table3.js +5 -11
  231. package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
  232. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +1 -1
  233. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
  234. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +4 -2
  235. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
  236. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +2 -1
  237. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
  238. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js +2 -2
  239. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js.map +1 -1
  240. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Indicator.js +1 -1
  241. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Indicator.js.map +1 -1
  242. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +2 -2
  243. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +1 -1
  244. package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js +1 -1
  245. package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js.map +1 -1
  246. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js +1 -1
  247. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js.map +1 -1
  248. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +5 -2
  249. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js.map +1 -1
  250. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +1 -1
  251. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
  252. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Resizer.js +1 -1
  253. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Resizer.js.map +1 -1
  254. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +4 -4
  255. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
  256. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +1 -1
  257. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +1 -1
  258. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js +1 -1
  259. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js.map +1 -1
  260. package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js +1 -1
  261. package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +1 -1
  262. package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js +1 -1
  263. package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js.map +1 -1
  264. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +2 -2
  265. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +1 -1
  266. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +1 -1
  267. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
  268. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js +1 -1
  269. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js.map +1 -1
  270. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js +5 -9
  271. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js.map +1 -1
  272. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +1 -1
  273. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js +3 -3
  274. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js.map +1 -1
  275. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +1 -1
  276. package/dist/esm/packages/taco/src/{primitives/Table/useTable/features/useTablePrinting.js → components/Table3/hooks/features/usePrinting.js} +3 -3
  277. package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePrinting.js.map +1 -0
  278. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +1 -1
  279. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js +10 -10
  280. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js.map +1 -1
  281. package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +4 -3
  282. package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
  283. package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
  284. package/dist/esm/packages/taco/src/components/Tabs/Tabs.js +1 -1
  285. package/dist/esm/packages/taco/src/components/Tabs/Tabs.js.map +1 -1
  286. package/dist/esm/packages/taco/src/components/Tag/Tag.js +2 -2
  287. package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
  288. package/dist/esm/packages/taco/src/components/Textarea/Textarea.js +1 -1
  289. package/dist/esm/packages/taco/src/components/Textarea/Textarea.js.map +1 -1
  290. package/dist/esm/packages/taco/src/components/Toast/Toast.js +2 -2
  291. package/dist/esm/packages/taco/src/components/Toast/Toast.js.map +1 -1
  292. package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js +2 -2
  293. package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js.map +1 -1
  294. package/dist/esm/packages/taco/src/components/Treeview/Treeview.js +1 -1
  295. package/dist/esm/packages/taco/src/components/Treeview/Treeview.js.map +1 -1
  296. package/dist/esm/packages/taco/src/index.js +1 -1
  297. package/dist/esm/packages/taco/src/primitives/Table/types.js +25 -8
  298. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
  299. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js +1 -1
  300. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js.map +1 -1
  301. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFontSize.js.map +1 -1
  302. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActive.js +11 -21
  303. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActive.js.map +1 -1
  304. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowClick.js.map +1 -1
  305. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGoto.js +1 -1
  306. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGoto.js.map +1 -1
  307. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js +1 -0
  308. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js.map +1 -1
  309. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js +42 -2
  310. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js.map +1 -1
  311. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js +7 -7
  312. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js.map +1 -1
  313. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js +14 -12
  314. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js.map +1 -1
  315. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js +7 -0
  316. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -0
  317. package/dist/esm/packages/taco/src/types.js +7 -1
  318. package/dist/esm/packages/taco/src/types.js.map +1 -1
  319. package/dist/esm/packages/taco/src/utils/dom.js +10 -1
  320. package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
  321. package/dist/index.css +12 -12
  322. package/dist/primitives/Table/types.d.ts +186 -7
  323. package/dist/primitives/Table/useTable/features/useTableColumnFreezing.d.ts +6 -0
  324. package/dist/primitives/Table/useTable/features/useTableFontSize.d.ts +2 -2
  325. package/dist/primitives/Table/useTable/features/useTableFooter.d.ts +3 -0
  326. package/dist/primitives/Table/useTable/features/useTablePrinting.d.ts +1 -0
  327. package/dist/primitives/Table/useTable/features/useTableRef.d.ts +4 -0
  328. package/dist/primitives/Table/useTable/features/useTableRowActions.d.ts +6 -0
  329. package/dist/primitives/Table/useTable/features/useTableRowActive.d.ts +0 -1
  330. package/dist/primitives/Table/useTable/features/useTableRowClick.d.ts +1 -1
  331. package/dist/primitives/Table/useTable/features/useTableRowExpansion.d.ts +5 -0
  332. package/dist/primitives/Table/useTable/features/useTableRowGoto.d.ts +1 -1
  333. package/dist/primitives/Table/useTable/features/useTableRowGroups.d.ts +5 -0
  334. package/dist/primitives/Table/useTable/features/useTableRowSelection.d.ts +1 -0
  335. package/dist/primitives/Table/useTable/features/useTableSearch.d.ts +11 -0
  336. package/dist/primitives/Table/useTable/features/useTableServerLoading.d.ts +5 -2
  337. package/dist/primitives/Table/useTable/features/useTableSettings.d.ts +3 -0
  338. package/dist/primitives/Table/useTable/listeners/useTableRowHeightListener.d.ts +2 -0
  339. package/dist/primitives/Table/useTable/listeners/useTableSearchListener.d.ts +2 -0
  340. package/dist/primitives/Table/useTable/listeners/useTableSettingsListener.d.ts +3 -0
  341. package/dist/primitives/Table/useTable/useTable.d.ts +57 -0
  342. package/dist/primitives/Table/useTable/util/columns.d.ts +9 -3
  343. package/dist/primitives/Table/useTable/util/columns.spec.d.ts +1 -0
  344. package/dist/primitives/Table/useTable/util/filtering.d.ts +7 -0
  345. package/dist/primitives/Table/useTable/util/presets.d.ts +2 -0
  346. package/dist/primitives/Table/useTable/util/search.d.ts +2 -0
  347. package/dist/primitives/Table/useTable/util/settings.d.ts +13 -0
  348. package/dist/primitives/Table/useTable/util/setup.d.ts +14 -0
  349. package/dist/primitives/Table/useTable/util/sorting.d.ts +2 -0
  350. package/dist/primitives/Table/useTableDataLoader.d.ts +23 -0
  351. package/dist/taco.cjs.development.js +215 -131
  352. package/dist/taco.cjs.development.js.map +1 -1
  353. package/dist/taco.cjs.production.min.js +1 -1
  354. package/dist/taco.cjs.production.min.js.map +1 -1
  355. package/dist/types.d.ts +6 -0
  356. package/dist/utils/dom.d.ts +1 -0
  357. package/package.json +4 -3
  358. package/types.json +25105 -11841
  359. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js.map +0 -1
@@ -1,10 +1,27 @@
1
- // settings
2
- var TableFontSizes;
3
- (function (TableFontSizes) {
4
- TableFontSizes["small"] = "small";
5
- TableFontSizes["medium"] = "medium";
6
- TableFontSizes["large"] = "large";
7
- })(TableFontSizes || (TableFontSizes = {}));
1
+ // filtering
2
+ var TableFilterComparator;
3
+ (function (TableFilterComparator) {
4
+ TableFilterComparator[TableFilterComparator["Contains"] = 0] = "Contains";
5
+ TableFilterComparator[TableFilterComparator["DoesNotContain"] = 1] = "DoesNotContain";
6
+ TableFilterComparator[TableFilterComparator["IsEqualTo"] = 2] = "IsEqualTo";
7
+ TableFilterComparator[TableFilterComparator["IsNotEqualTo"] = 3] = "IsNotEqualTo";
8
+ TableFilterComparator[TableFilterComparator["IsGreaterThan"] = 4] = "IsGreaterThan";
9
+ TableFilterComparator[TableFilterComparator["IsLessThan"] = 5] = "IsLessThan";
10
+ TableFilterComparator[TableFilterComparator["IsBetween"] = 6] = "IsBetween";
11
+ TableFilterComparator[TableFilterComparator["IsEmpty"] = 7] = "IsEmpty";
12
+ TableFilterComparator[TableFilterComparator["IsNotEmpty"] = 8] = "IsNotEmpty";
13
+ TableFilterComparator[TableFilterComparator["IsLessThanOrEqualTo"] = 9] = "IsLessThanOrEqualTo";
14
+ TableFilterComparator[TableFilterComparator["IsGreaterThanOrEqualTo"] = 10] = "IsGreaterThanOrEqualTo";
15
+ TableFilterComparator[TableFilterComparator["HasAnyOf"] = 11] = "HasAnyOf";
16
+ TableFilterComparator[TableFilterComparator["HasAllOf"] = 12] = "HasAllOf";
17
+ TableFilterComparator[TableFilterComparator["HasNoneOf"] = 13] = "HasNoneOf";
18
+ })(TableFilterComparator || (TableFilterComparator = {}));
19
+ var TableServerLoadAllState;
20
+ (function (TableServerLoadAllState) {
21
+ TableServerLoadAllState[TableServerLoadAllState["Incomplete"] = 0] = "Incomplete";
22
+ TableServerLoadAllState[TableServerLoadAllState["Loading"] = 1] = "Loading";
23
+ TableServerLoadAllState[TableServerLoadAllState["Completed"] = 2] = "Completed";
24
+ })(TableServerLoadAllState || (TableServerLoadAllState = {}));
8
25
 
9
- export { TableFontSizes };
26
+ export { TableFilterComparator, TableServerLoadAllState };
10
27
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../../../../src/primitives/Table/types.ts"],"sourcesContent":["import { ColumnFilter as ReactTableColumnFilter, ColumnSort as ReactTableColumnSort } from '@tanstack/react-table';\n\nexport type TableRef = HTMLDivElement & {\n instance: {\n resetFiltering: () => void;\n resetRowExpansion: () => void;\n resetRowSelection: () => void;\n resetSorting: () => void;\n };\n};\n\n// settings\nexport enum TableFontSizes {\n small = 'small',\n medium = 'medium',\n large = 'large',\n}\nexport type TableFontSize = keyof typeof TableFontSizes;\n\n// columns\nexport type TableColumnFilter = ReactTableColumnFilter;\nexport type TableColumnSort = ReactTableColumnSort;\n\n// rows\nexport type TableRowClickHandler<TType = unknown> = (row: TType) => void;\nexport type TableRowGotoHandler = (\n column: string,\n query: string,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<number>;\nexport type TableRowHeight = 'short' | 'medium' | 'tall' | 'extra-tall';\nexport type TableRowSelectHandler<TType = unknown> = (rows: TType[]) => void;\n\n// shortcuts\nexport type TableShortcutHandlerFn<TType = unknown> = (row: TType) => void;\nexport type TableShortcutHandlerObject<TType = unknown> = {\n handler: TableShortcutHandlerFn<TType>;\n meta?: boolean;\n shift?: boolean;\n};\n\n// table\nexport type TableFilterHandler = (filters: TableColumnFilter[]) => void;\nexport type TableScrollToIndexHandler = (index: number, options?: { align: 'start' | 'center' | 'end' | 'auto' }) => void;\nexport type TableServerLoadPageHandler = (\n pageIndex: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<void>;\nexport type TableServerLoadAllHandler = (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<void>;\nexport type TableShortcuts<TType = unknown> = Record<string, TableShortcutHandlerFn<TType> | TableShortcutHandlerObject<TType>>;\nexport type TableSortHandler = (sorting: TableColumnSort[]) => void;\n"],"names":["TableFontSizes"],"mappings":"AAWA;IACYA;AAAZ,WAAYA,cAAc;EACtBA,iCAAe;EACfA,mCAAiB;EACjBA,iCAAe;AACnB,CAAC,EAJWA,cAAc,KAAdA,cAAc;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../../../../../src/primitives/Table/types.ts"],"sourcesContent":["import {\n ColumnFilter as ReactTableColumnFilter,\n ColumnFiltersState as ReactTableColumnFilterState,\n ColumnOrderState as ReactTableColumnOrderState,\n ColumnPinningState as ReactTableColumnPinningState,\n ColumnSort as ReactTableColumnSort,\n ColumnSizingState as ReactTableColumnSizingState,\n GroupingState as ReactTableGroupingState,\n VisibilityState as ReactTableColumnVisibilityState,\n SortingState as ReactTableSortingState,\n BuiltInAggregationFn as ReactTableBuiltInAggregationFn,\n BuiltInSortingFn as ReactTableBuiltInSortingFn,\n HeaderContext as ReactTableHeaderContext,\n CellContext as ReactTableCellContext,\n ColumnMeta as ReactTableColumnMeta,\n} from '@tanstack/react-table';\nimport { FontSizes, ValueOf } from '../../types';\nimport { MenuProps } from '../../components/Menu/Menu';\n\ntype TODO = any;\n\nexport type TableRef = HTMLTableElement & {\n instance: {\n resetFiltering: () => void;\n resetRowExpansion: () => void;\n resetRowSelection: () => void;\n resetSorting: () => void;\n };\n};\n\n// filtering\nexport enum TableFilterComparator {\n Contains,\n DoesNotContain,\n IsEqualTo,\n IsNotEqualTo,\n IsGreaterThan,\n IsLessThan,\n IsBetween,\n IsEmpty,\n IsNotEmpty,\n IsLessThanOrEqualTo,\n IsGreaterThanOrEqualTo,\n HasAnyOf,\n HasAllOf,\n HasNoneOf,\n}\nexport type TableFilterValue = {\n comparator: TableFilterComparator;\n value: any;\n};\nexport type TableFilter = {\n id: string;\n value: TableFilterValue;\n};\n\n// columns\nexport type TableColumnAlignment = 'left' | 'center' | 'right';\nexport type TableColumnClassNameHandler<TType = unknown> = string | ((row: TType) => string | undefined);\nexport type TableColumnDataType = 'auto' | 'number' | 'alphanumeric' | 'alphanumericCaseSensitive' | 'datetime' | 'boolean';\nexport type TableColumnFilter = ReactTableColumnFilter;\nexport type TableColumnMenu = (props: Partial<MenuProps>) => JSX.Element;\nexport type TableColumnRenderer<TType, TValue> = (value: TValue, row: TType) => JSX.Element | string | number | null;\nexport type TableColumnRendererAggregate<TType, TValue> = (value: TValue, row: TType) => JSX.Element | string | number | null;\nexport type TableColumnRendererControl<TType = unknown> =\n | ((props: TableColumnRendererControlProps, row?: TType) => JSX.Element)\n | 'datepicker'\n | 'input'\n | 'switch'\n | 'textarea';\nexport type TableColumnRendererControlProps = {\n className?: string;\n disabled?: boolean;\n invalid?: boolean;\n onBlur?: (value: unknown) => void;\n onFocus?: React.FocusEventHandler;\n readOnly?: boolean;\n ref: React.RefObject<HTMLElement> | ((instance: HTMLElement | null | undefined) => void);\n setValue: (value: unknown) => void;\n value: unknown;\n};\nexport type TableColumnRendererHeader = string;\nexport type TableColumnRendererFooter<TValue> = (values: TValue[]) => JSX.Element | string | number | null;\nexport type TableColumnSort = ReactTableColumnSort;\nexport type TableColumnSortDirection = 'asc' | 'desc';\nexport type TableColumnSortFn<TType = unknown> =\n | ((rowA: TType, rowB: TType, columnId: string) => -1 | 0 | 1)\n | ReactTableBuiltInSortingFn\n | 'auto';\nexport type TableColumnWidth = number | 'grow';\n\n// rows\nexport type TableRowActionRenderer<TType = unknown> = (row: TType) => JSX.Element | null;\nexport type TableRowActionGroupRenderer<TType = unknown> = (rows: TType[]) => JSX.Element | null;\nexport type TableRowClickHandler<TType = unknown> = (row: TType) => void;\nexport type TableRowGotoHandler = (\n column: string,\n query: string,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<number>;\nexport type TableRowHeight = 'short' | 'medium' | 'tall' | 'extra-tall';\nexport type TableRowSelectHandler<TType = unknown> = (rows: TType[]) => void;\n\n// shortcuts\nexport type TableShortcutHandlerFn<TType = unknown> = (row: TType) => void;\nexport type TableShortcutHandlerObject<TType = unknown> = {\n handler: TableShortcutHandlerFn<TType>;\n meta?: boolean;\n shift?: boolean;\n};\n\n// table\nexport type TableFilterHandler = (filters: TableColumnFilter[]) => void;\nexport type TableFontSize = keyof typeof FontSizes;\nexport type TablePreset = 'lite' | 'complex';\nexport type TableRowExpansionRenderer<TType = unknown> = (row: TType) => (() => JSX.Element) | null;\nexport type TableScrollToIndexHandler = (index: number, options?: { align: 'start' | 'center' | 'end' | 'auto' }) => void;\nexport type TableServerLoadPageHandler = (\n pageIndex: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<void>;\nexport type TableServerLoadAllHandler = (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<void>;\nexport enum TableServerLoadAllState {\n Incomplete,\n Loading,\n Completed,\n}\nexport type TableSettingsHandler = (settings: TableSettings) => void | Promise<void>;\nexport type TableShortcuts<TType = unknown> = Record<string, TableShortcutHandlerFn<TType> | TableShortcutHandlerObject<TType>>;\nexport type TableSortHandler = (sorting: TableColumnSort[]) => void;\n\n// settings\nexport type TableSettings = {\n columnFilters?: ReactTableColumnFilterState;\n columnOrder?: ReactTableColumnOrderState;\n columnPinning?: ReactTableColumnPinningState;\n columnSizing?: ReactTableColumnSizingState;\n columnVisibility?: ReactTableColumnVisibilityState;\n excludeUnmatchedRecordsInSearch?: boolean;\n fontSize?: TableFontSize;\n grouping?: ReactTableGroupingState;\n rowHeight?: TableRowHeight;\n showWarningWhenPrintingLargeDataset?: boolean;\n searchQuery?: string;\n sorting?: ReactTableSortingState;\n};\n\n// props\nexport type TableFeatureProps = {\n // react-table built-in\n enableFiltering?: boolean;\n enableSearch?: boolean;\n enableSorting?: boolean;\n enableColumnFreezing?: boolean;\n enableColumnHiding?: boolean;\n enableColumnResizing?: boolean;\n enableRowExpansion?: boolean;\n enableRowSelection?: boolean;\n enableRowSelectionSingle?: boolean;\n\n // custom -- common between all table types\n enableColumnOrdering?: boolean;\n enableFontSize?: boolean;\n enableFooter?: boolean;\n enablePrinting?: boolean;\n enableRowActions?: boolean;\n enableRowActive?: boolean;\n enableRowClick?: boolean;\n enableRowGoto?: boolean;\n enableRowHeight?: boolean;\n enableSettings?: boolean;\n};\n\nexport type useTableInternalColumn<TType = unknown> = {\n header?: (info: ReactTableHeaderContext<TType, unknown>) => JSX.Element | string | null;\n renderer: (info: ReactTableCellContext<TType, unknown>) => JSX.Element | string | null;\n meta?: ReactTableColumnMeta<TType, unknown>;\n size?: number;\n};\n\nexport type useTableInternalColumns<TType = unknown> = {\n rowActions?: useTableInternalColumn<TType>;\n rowExpansion?: useTableInternalColumn<TType>;\n rowSelection?: useTableInternalColumn<TType>;\n};\n\ntype useTableCommonProps<TType = unknown> = TableFeatureProps & {\n children: (JSX.Element | boolean | null | undefined)[];\n data: TType[];\n id: string;\n\n // misc\n defaultColumnFreezingIndex?: number;\n defaultRowActiveIndex?: number;\n defaultRowGroupColumnId?: keyof TType;\n defaultSettings?: TableSettings;\n preset?: TablePreset;\n rowActions?: TableRowActionRenderer<TType>[];\n rowActionsForGroup?: TableRowActionGroupRenderer<TType>[];\n rowActionsLength?: number;\n rowExpansionRenderer?: TableRowExpansionRenderer<TType>;\n shortcuts?: TableShortcuts<TType>;\n\n // handlers\n onRowClick?: TableRowClickHandler<TType>;\n onRowGoto?: TableRowGotoHandler;\n onRowSelect?: TableRowSelectHandler<TType>;\n\n // state change handlers\n onChangeFilter?: TableFilterHandler;\n onChangeSearch?: TODO; // not currently supported\n onChangeSettings?: TableSettingsHandler;\n onChangeSort?: TableSortHandler;\n};\n\ninterface useTableClientProps<TType = unknown> extends useTableCommonProps<TType> {\n length?: never;\n loadAll?: never;\n loadPage?: never;\n pageSize?: never;\n}\n\ninterface useTableServerProps<TType = unknown> extends useTableCommonProps<TType> {\n length: number | undefined;\n loadAll: TableServerLoadAllHandler;\n loadPage: TableServerLoadPageHandler;\n pageSize?: number;\n}\n\nexport type useTableProps<TType = unknown> = useTableClientProps<TType> | useTableServerProps<TType>;\n\nexport type TableColumnProps<TType = unknown> = ValueOf<{\n [Key in keyof TType]: {\n accessor?: Key;\n id: string;\n } & {\n // renderers\n renderer?: TableColumnRenderer<TType, TType[Key]>;\n /** Renderer to use if the cell is an aggregate cell and part of a grouped row */\n aggregate?: TableColumnRendererAggregate<TType, TType[Key]>;\n control?: TableColumnRendererControl<TType>;\n footer?: TableColumnRendererFooter<TType[Key]>;\n header: TableColumnRendererHeader;\n // options\n /** Aggregation function to be used when the column is part of a grouped row */\n aggregationFn?: 'auto' | ReactTableBuiltInAggregationFn;\n align?: TableColumnAlignment;\n className?: TableColumnClassNameHandler<TType>;\n dataType?: TableColumnDataType;\n defaultHidden?: boolean;\n defaultWidth?: TableColumnWidth;\n enableFiltering?: boolean;\n enableGrouping?: boolean;\n enableHiding?: boolean;\n enableOrdering?: boolean;\n enablePrinting?: boolean;\n enableResizing?: boolean;\n enableSearch?: boolean;\n enableSorting?: boolean;\n enableTruncate?: boolean;\n filters?: TableFilterComparator[];\n headerClassName?: string;\n menu?: TableColumnMenu;\n minWidth?: number;\n sort?: TableColumnSortDirection;\n sortFn?: TableColumnSortFn<TType>;\n tooltip?: string;\n };\n}>;\n\nexport type TableGroupProps = {\n children: (JSX.Element | boolean | null | undefined)[];\n header: string;\n id: string;\n};\n"],"names":["TableFilterComparator","TableServerLoadAllState"],"mappings":"AA8BA;IACYA;AAAZ,WAAYA,qBAAqB;EAC7BA,yEAAQ;EACRA,qFAAc;EACdA,2EAAS;EACTA,iFAAY;EACZA,mFAAa;EACbA,6EAAU;EACVA,2EAAS;EACTA,uEAAO;EACPA,6EAAU;EACVA,+FAAmB;EACnBA,sGAAsB;EACtBA,0EAAQ;EACRA,0EAAQ;EACRA,4EAAS;AACb,CAAC,EAfWA,qBAAqB,KAArBA,qBAAqB;IAmGrBC;AAAZ,WAAYA,uBAAuB;EAC/BA,iFAAU;EACVA,2EAAO;EACPA,+EAAS;AACb,CAAC,EAJWA,uBAAuB,KAAvBA,uBAAuB;;;;"}
@@ -1,4 +1,4 @@
1
- function useTableColumnOrdering(isEnabled = true) {
1
+ function useTableColumnOrdering(isEnabled = false) {
2
2
  return {
3
3
  isEnabled
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useTableColumnOrdering.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableColumnOrdering.ts"],"sourcesContent":["export function useTableColumnOrdering(isEnabled = true) {\n return {\n isEnabled,\n };\n}\n"],"names":["useTableColumnOrdering","isEnabled"],"mappings":"SAAgBA,sBAAsBA,CAACC,SAAS,GAAG,IAAI;EACnD,OAAO;IACHA;GACH;AACL;;;;"}
1
+ {"version":3,"file":"useTableColumnOrdering.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableColumnOrdering.ts"],"sourcesContent":["export function useTableColumnOrdering(isEnabled = false) {\n return {\n isEnabled,\n };\n}\n"],"names":["useTableColumnOrdering","isEnabled"],"mappings":"SAAgBA,sBAAsBA,CAACC,SAAS,GAAG,KAAK;EACpD,OAAO;IACHA;GACH;AACL;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTableFontSize.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableFontSize.ts"],"sourcesContent":["import React from 'react';\nimport { TableFontSize } from '../../types';\n\nexport function useTableFontSize(isEnabled = false, defaultFontSize: TableFontSize = 'medium') {\n const [size, setSize] = React.useState<TableFontSize>(defaultFontSize);\n\n return {\n isEnabled,\n size,\n setSize: isEnabled ? setSize : () => undefined,\n };\n}\n"],"names":["useTableFontSize","isEnabled","defaultFontSize","size","setSize","React","useState","undefined"],"mappings":";;SAGgBA,gBAAgBA,CAACC,SAAS,GAAG,KAAK,EAAEC,kBAAiC,QAAQ;EACzF,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAgBJ,eAAe,CAAC;EAEtE,OAAO;IACHD,SAAS;IACTE,IAAI;IACJC,OAAO,EAAEH,SAAS,GAAGG,OAAO,GAAG,MAAMG;GACxC;AACL;;;;"}
1
+ {"version":3,"file":"useTableFontSize.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableFontSize.ts"],"sourcesContent":["import React from 'react';\nimport { FontSize } from '../../../../types';\n\nexport function useTableFontSize(isEnabled = false, defaultFontSize: FontSize = 'medium') {\n const [size, setSize] = React.useState<FontSize>(defaultFontSize);\n\n return {\n isEnabled,\n size,\n setSize: isEnabled ? setSize : () => undefined,\n };\n}\n"],"names":["useTableFontSize","isEnabled","defaultFontSize","size","setSize","React","useState","undefined"],"mappings":";;SAGgBA,gBAAgBA,CAACC,SAAS,GAAG,KAAK,EAAEC,kBAA4B,QAAQ;EACpF,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAWJ,eAAe,CAAC;EAEjE,OAAO;IACHD,SAAS;IACTE,IAAI;IACJC,OAAO,EAAEH,SAAS,GAAGG,OAAO,GAAG,MAAMG;GACxC;AACL;;;;"}
@@ -1,4 +1,5 @@
1
1
  import React__default from 'react';
2
+ import { isElementInsideOrTriggeredFromContainer } from '../../../../utils/dom.js';
2
3
  import { useIsHoverStatePaused } from '../../../../hooks/useIsHoverStatePaused.js';
3
4
 
4
5
  function focusFirstElementInActiveRow(tableRef) {
@@ -13,7 +14,7 @@ function useTableRowActive(isEnabled = false, initialRowActiveIndex) {
13
14
  const [isHoverStatePaused, setHoverStatePaused] = useIsHoverStatePaused();
14
15
  const move = (direction, length, scrollToIndex) => setRowActiveIndex(currentIndex => {
15
16
  const nextIndex = currentIndex !== undefined ? getNextIndex(direction, currentIndex, length) : 0;
16
- scrollToIndex(direction === -1 ? nextIndex : nextIndex + 3);
17
+ setTimeout(() => scrollToIndex(nextIndex), 1);
17
18
  return nextIndex;
18
19
  });
19
20
  const onKeyDown = React__default.useCallback((event, length, scrollToIndex, tableRef) => {
@@ -55,27 +56,17 @@ function useTableRowActive(isEnabled = false, initialRowActiveIndex) {
55
56
  if (!isEnabled || event.isDefaultPrevented()) {
56
57
  return;
57
58
  }
58
- if (rowActiveIndex === undefined && length > 0) {
59
- // do it in the next tick, otherwise it prevents internal focus from working
60
- // meaning you have to tab twice to get to the first focusable element
61
- setTimeout(() => {
62
- setRowActiveIndex(index => {
63
- if (index === undefined) {
64
- scrollToIndex(0);
65
- return 0;
66
- }
67
- return index;
68
- });
69
- }, 1);
70
- }
71
- }, [rowActiveIndex, length, isEnabled]);
72
- const onMouseCapture = React__default.useCallback((event, length) => {
73
- if (!isEnabled || event.isDefaultPrevented()) {
59
+ if (event.target.closest('tbody') || event.target.closest('[data-taco="table2-body"]') || isElementInsideOrTriggeredFromContainer(event.target, event.currentTarget)) {
74
60
  return;
75
61
  }
76
62
  if (rowActiveIndex === undefined && length > 0) {
77
- event.preventDefault();
78
- event.stopPropagation();
63
+ setRowActiveIndex(index => {
64
+ if (index === undefined) {
65
+ scrollToIndex(0);
66
+ return 0;
67
+ }
68
+ return index;
69
+ });
79
70
  }
80
71
  }, [rowActiveIndex, length, isEnabled]);
81
72
  return {
@@ -85,8 +76,7 @@ function useTableRowActive(isEnabled = false, initialRowActiveIndex) {
85
76
  isHoverStatePaused,
86
77
  setHoverStatePaused: isEnabled ? setHoverStatePaused : () => undefined,
87
78
  handleFocus: isEnabled ? onFocus : () => undefined,
88
- handleKeyDown: isEnabled ? onKeyDown : () => undefined,
89
- handleMouseCapture: isEnabled ? onMouseCapture : () => undefined
79
+ handleKeyDown: isEnabled ? onKeyDown : () => undefined
90
80
  };
91
81
  }
92
82
  function getNextIndex(direction, currentIndex, length) {
@@ -1 +1 @@
1
- {"version":3,"file":"useTableRowActive.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowActive.ts"],"sourcesContent":["import React from 'react';\nimport { TableRef, TableScrollToIndexHandler } from '../../types';\nimport { useIsHoverStatePaused } from '../../../../hooks/useIsHoverStatePaused';\n\nfunction focusFirstElementInActiveRow(tableRef: React.RefObject<TableRef>) {\n const selector = '[data-taco=\"table2-body\"] [role=\"row\"] [role=\"cell\"]:first-child';\n\n setTimeout(() => {\n (tableRef.current?.querySelector(selector) as HTMLElement)?.focus();\n }, 1);\n}\n\nexport function useTableRowActive(isEnabled = false, initialRowActiveIndex?: number) {\n const [rowActiveIndex, setRowActiveIndex] = React.useState<number | undefined>(initialRowActiveIndex);\n const [isHoverStatePaused, setHoverStatePaused] = useIsHoverStatePaused();\n\n const move = (direction: -1 | 1, length: number, scrollToIndex: TableScrollToIndexHandler) =>\n setRowActiveIndex(currentIndex => {\n const nextIndex = currentIndex !== undefined ? getNextIndex(direction, currentIndex, length) : 0;\n scrollToIndex(direction === -1 ? nextIndex : nextIndex + 3);\n return nextIndex;\n });\n\n const onKeyDown = React.useCallback(\n (\n event: KeyboardEvent,\n length: number,\n scrollToIndex: TableScrollToIndexHandler,\n tableRef?: React.RefObject<TableRef>\n ) => {\n if (!isEnabled || event.defaultPrevented) {\n return;\n }\n\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n setHoverStatePaused(true);\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n const newIndex = 0;\n setRowActiveIndex(newIndex);\n scrollToIndex(newIndex);\n } else {\n move(-1, length, scrollToIndex);\n }\n\n if (tableRef) {\n focusFirstElementInActiveRow(tableRef);\n }\n\n return;\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n const newIndex = length - 1;\n setRowActiveIndex(newIndex);\n scrollToIndex(newIndex);\n } else {\n move(+1, length, scrollToIndex);\n }\n\n if (tableRef) {\n focusFirstElementInActiveRow(tableRef);\n }\n\n return;\n }\n },\n [isEnabled]\n );\n\n const onFocus = React.useCallback(\n (event: React.FocusEvent, length: number, scrollToIndex: TableScrollToIndexHandler) => {\n if (!isEnabled || event.isDefaultPrevented()) {\n return;\n }\n\n if (rowActiveIndex === undefined && length > 0) {\n // do it in the next tick, otherwise it prevents internal focus from working\n // meaning you have to tab twice to get to the first focusable element\n setTimeout(() => {\n setRowActiveIndex(index => {\n if (index === undefined) {\n scrollToIndex(0);\n return 0;\n }\n return index;\n });\n }, 1);\n }\n },\n [rowActiveIndex, length, isEnabled]\n );\n\n const onMouseCapture = React.useCallback(\n (event: React.MouseEvent, length: number) => {\n if (!isEnabled || event.isDefaultPrevented()) {\n return;\n }\n\n if (rowActiveIndex === undefined && length > 0) {\n event.preventDefault();\n event.stopPropagation();\n }\n },\n [rowActiveIndex, length, isEnabled]\n );\n\n return {\n isEnabled,\n rowActiveIndex,\n setRowActiveIndex: isEnabled ? setRowActiveIndex : () => undefined,\n isHoverStatePaused,\n setHoverStatePaused: isEnabled ? setHoverStatePaused : () => undefined,\n handleFocus: isEnabled ? onFocus : () => undefined,\n handleKeyDown: isEnabled ? onKeyDown : () => undefined,\n handleMouseCapture: isEnabled ? onMouseCapture : () => undefined,\n };\n}\n\nfunction getNextIndex(direction: -1 | 1, currentIndex: number, length: number) {\n if (direction === -1) {\n return currentIndex - 1 > 0 ? currentIndex - 1 : 0;\n }\n\n return currentIndex + 1 < length ? currentIndex + 1 : currentIndex;\n}\n"],"names":["focusFirstElementInActiveRow","tableRef","selector","setTimeout","_tableRef$current","current","_tableRef$current$que","querySelector","focus","useTableRowActive","isEnabled","initialRowActiveIndex","rowActiveIndex","setRowActiveIndex","React","useState","isHoverStatePaused","setHoverStatePaused","useIsHoverStatePaused","move","direction","length","scrollToIndex","currentIndex","nextIndex","undefined","getNextIndex","onKeyDown","useCallback","event","defaultPrevented","key","preventDefault","ctrlKey","metaKey","newIndex","onFocus","isDefaultPrevented","index","onMouseCapture","stopPropagation","handleFocus","handleKeyDown","handleMouseCapture"],"mappings":";;;AAIA,SAASA,4BAA4BA,CAACC,QAAmC;EACrE,MAAMC,QAAQ,GAAG,kEAAkE;EAEnFC,UAAU,CAAC;;IACN,CAAAC,iBAAA,GAAAH,QAAQ,CAACI,OAAO,cAAAD,iBAAA,wBAAAE,qBAAA,GAAhBF,iBAAA,CAAkBG,aAAa,CAACL,QAAQ,CAAiB,cAAAI,qBAAA,uBAAzDA,qBAAA,CAA2DE,KAAK,EAAE;GACtE,EAAE,CAAC,CAAC;AACT;SAEgBC,iBAAiBA,CAACC,SAAS,GAAG,KAAK,EAAEC,qBAA8B;EAC/E,MAAM,CAAC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,CAAC,CACtC;EAED,OAAO;IACHA,SAAS;IACTE,cAAc;IACdC,iBAAiB,EAAEH,SAAS,GAAGG,iBAAiB,GAAG,MAAMY,SAAS;IAClET,kBAAkB;IAClBC,mBAAmB,EAAEP,SAAS,GAAGO,mBAAmB,GAAG,MAAMQ,SAAS;IACtEgB,WAAW,EAAE/B,SAAS,GAAG0B,OAAO,GAAG,MAAMX,SAAS;IAClDiB,aAAa,EAAEhC,SAAS,GAAGiB,SAAS,GAAG,MAAMF,SAAS;IACtDkB,kBAAkB,EAAEjC,SAAS,GAAG6B,cAAc,GAAG,MAAMd;GAC1D;AACL;AAEA,SAASC,YAAYA,CAACN,SAAiB,EAAEG,YAAoB,EAAEF,MAAc;EACzE,IAAID,SAAS,KAAK,CAAC,CAAC,EAAE;IAClB,OAAOG,YAAY,GAAG,CAAC,GAAG,CAAC,GAAGA,YAAY,GAAG,CAAC,GAAG,CAAC;;EAGtD,OAAOA,YAAY,GAAG,CAAC,GAAGF,MAAM,GAAGE,YAAY,GAAG,CAAC,GAAGA,YAAY;AACtE;;;;"}
1
+ {"version":3,"file":"useTableRowActive.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowActive.ts"],"sourcesContent":["import React from 'react';\nimport { TableRef, TableScrollToIndexHandler } from '../../types';\nimport { useIsHoverStatePaused } from '../../../../hooks/useIsHoverStatePaused';\nimport { isElementInsideOrTriggeredFromContainer } from '../../../../utils/dom';\n\nfunction focusFirstElementInActiveRow(tableRef: React.RefObject<TableRef>) {\n const selector = '[data-taco=\"table2-body\"] [role=\"row\"] [role=\"cell\"]:first-child';\n\n setTimeout(() => {\n (tableRef.current?.querySelector(selector) as HTMLElement)?.focus();\n }, 1);\n}\n\nexport function useTableRowActive(isEnabled = false, initialRowActiveIndex?: number) {\n const [rowActiveIndex, setRowActiveIndex] = React.useState<number | undefined>(initialRowActiveIndex);\n const [isHoverStatePaused, setHoverStatePaused] = useIsHoverStatePaused();\n\n const move = (direction: -1 | 1, length: number, scrollToIndex: TableScrollToIndexHandler) =>\n setRowActiveIndex(currentIndex => {\n const nextIndex = currentIndex !== undefined ? getNextIndex(direction, currentIndex, length) : 0;\n setTimeout(() => scrollToIndex(nextIndex), 1);\n return nextIndex;\n });\n\n const onKeyDown = React.useCallback(\n (\n event: KeyboardEvent,\n length: number,\n scrollToIndex: TableScrollToIndexHandler,\n tableRef?: React.RefObject<TableRef>\n ) => {\n if (!isEnabled || event.defaultPrevented) {\n return;\n }\n\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n setHoverStatePaused(true);\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n const newIndex = 0;\n setRowActiveIndex(newIndex);\n scrollToIndex(newIndex);\n } else {\n move(-1, length, scrollToIndex);\n }\n\n if (tableRef) {\n focusFirstElementInActiveRow(tableRef);\n }\n\n return;\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (event.ctrlKey || event.metaKey) {\n const newIndex = length - 1;\n setRowActiveIndex(newIndex);\n scrollToIndex(newIndex);\n } else {\n move(+1, length, scrollToIndex);\n }\n\n if (tableRef) {\n focusFirstElementInActiveRow(tableRef);\n }\n\n return;\n }\n },\n [isEnabled]\n );\n\n const onFocus = React.useCallback(\n (event: React.FocusEvent, length: number, scrollToIndex: TableScrollToIndexHandler) => {\n if (!isEnabled || event.isDefaultPrevented()) {\n return;\n }\n\n if (\n event.target.closest('tbody') ||\n event.target.closest('[data-taco=\"table2-body\"]') ||\n isElementInsideOrTriggeredFromContainer(event.target, event.currentTarget)\n ) {\n return;\n }\n\n if (rowActiveIndex === undefined && length > 0) {\n setRowActiveIndex(index => {\n if (index === undefined) {\n scrollToIndex(0);\n return 0;\n }\n return index;\n });\n }\n },\n [rowActiveIndex, length, isEnabled]\n );\n\n return {\n isEnabled,\n rowActiveIndex,\n setRowActiveIndex: isEnabled ? setRowActiveIndex : () => undefined,\n isHoverStatePaused,\n setHoverStatePaused: isEnabled ? setHoverStatePaused : () => undefined,\n handleFocus: isEnabled ? onFocus : () => undefined,\n handleKeyDown: isEnabled ? onKeyDown : () => undefined,\n };\n}\n\nfunction getNextIndex(direction: -1 | 1, currentIndex: number, length: number) {\n if (direction === -1) {\n return currentIndex - 1 > 0 ? currentIndex - 1 : 0;\n }\n\n return currentIndex + 1 < length ? currentIndex + 1 : currentIndex;\n}\n"],"names":["focusFirstElementInActiveRow","tableRef","selector","setTimeout","_tableRef$current","current","_tableRef$current$que","querySelector","focus","useTableRowActive","isEnabled","initialRowActiveIndex","rowActiveIndex","setRowActiveIndex","React","useState","isHoverStatePaused","setHoverStatePaused","useIsHoverStatePaused","move","direction","length","scrollToIndex","currentIndex","nextIndex","undefined","getNextIndex","onKeyDown","useCallback","event","defaultPrevented","key","preventDefault","ctrlKey","metaKey","newIndex","onFocus","isDefaultPrevented","target","closest","isElementInsideOrTriggeredFromContainer","currentTarget","index","handleFocus","handleKeyDown"],"mappings":";;;;AAKA,SAASA,4BAA4BA,CAACC,QAAmC;EACrE,MAAMC,QAAQ,GAAG,kEAAkE;EAEnFC,UAAU,CAAC;;IACN,CAAAC,iBAAA,GAAAH,QAAQ,CAACI,OAAO,cAAAD,iBAAA,wBAAAE,qBAAA,GAAhBF,iBAAA,CAAkBG,aAAa,CAACL,QAAQ,CAAiB,cAAAI,qBAAA,uBAAzDA,qBAAA,CAA2DE,KAAK,EAAE;GACtE,EAAE,CAAC,CAAC;AACT;SAEgBC,iBAAiBA,CAACC,SAAS,GAAG,KAAK,EAAEC,qBAA8B;EAC/E,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAqBJ,qBAAqB,CAAC;EACrG,MAAM,CAACK,kBAAkB,EAAEC,mBAAmB,CAAC,GAAGC,qBAAqB,EAAE;EAEzE,MAAMC,IAAI,GAAGA,CAACC,SAAiB,EAAEC,MAAc,EAAEC,aAAwC,KACrFT,iBAAiB,CAACU,YAAY;IAC1B,MAAMC,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AGA,YAAY,GAAG,CAAC,GAAG,CAAC;;EAGtD,OAAOA,YAAY,GAAG,CAAC,GAAGF,MAAM,GAAGE,YAAY,GAAG,CAAC,GAAGA,YAAY;AACtE;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTableRowClick.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowClick.ts"],"sourcesContent":["import React from 'react';\nimport { TableRowClickHandler } from '../../types';\n\nexport function useTableRowClick<TType = unknown>(isEnabled = false, onRowClick?: TableRowClickHandler<TType>) {\n const handleKeyDown = React.useCallback(\n function (event: KeyboardEvent, data: TType) {\n if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {\n return;\n }\n\n if (data && event.key === 'Enter') {\n event.preventDefault();\n onRowClick(data);\n return;\n }\n },\n [isEnabled, onRowClick]\n ) as <TType = unknown>(event: KeyboardEvent, data: TType) => void;\n\n const handleClick = React.useCallback(\n function (event: React.MouseEvent<HTMLDivElement>, data: TType) {\n if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {\n return;\n }\n\n event.preventDefault();\n onRowClick(data);\n return;\n },\n [isEnabled, onRowClick]\n );\n\n return {\n isEnabled,\n handleClick,\n handleKeyDown,\n };\n}\n"],"names":["useTableRowClick","isEnabled","onRowClick","handleKeyDown","React","useCallback","event","data","defaultPrevented","key","preventDefault","handleClick"],"mappings":";;SAGgBA,gBAAgBA,CAAkBC,SAAS,GAAG,KAAK,EAAEC,UAAwC;EACzG,MAAMC,aAAa,GAAGC,cAAK,CAACC,WAAW,CACnC,UAAUC,KAAoB,EAAEC,IAAW;IACvC,IAAI,CAACN,SAAS,IAAI,OAAOC,UAAU,KAAK,UAAU,IAAII,KAAK,CAACE,gBAAgB,EAAE;MAC1E;;IAGJ,IAAID,IAAI,IAAID,KAAK,CAACG,GAAG,KAAK,OAAO,EAAE;MAC/BH,KAAK,CAACI,cAAc,EAAE;MACtBR,UAAU,CAACK,IAAI,CAAC;MAChB;;GAEP,EACD,CAACN,SAAS,EAAEC,UAAU,CAAC,CACsC;EAEjE,MAAMS,WAAW,GAAGP,cAAK,CAACC,WAAW,CACjC,UAAUC,KAAuC,EAAEC,IAAW;IAC1D,IAAI,CAACN,SAAS,IAAI,OAAOC,UAAU,KAAK,UAAU,IAAII,KAAK,CAACE,gBAAgB,EAAE;MAC1E;;IAGJF,KAAK,CAACI,cAAc,EAAE;IACtBR,UAAU,CAACK,IAAI,CAAC;IAChB;GACH,EACD,CAACN,SAAS,EAAEC,UAAU,CAAC,CAC1B;EAED,OAAO;IACHD,SAAS;IACTU,WAAW;IACXR;GACH;AACL;;;;"}
1
+ {"version":3,"file":"useTableRowClick.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowClick.ts"],"sourcesContent":["import React from 'react';\nimport { TableRowClickHandler } from '../../types';\n\nexport function useTableRowClick<TType = unknown>(isEnabled = false, onRowClick?: TableRowClickHandler<TType>) {\n const handleKeyDown = React.useCallback(\n function (event: KeyboardEvent, data: TType) {\n if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {\n return;\n }\n\n if (data && event.key === 'Enter') {\n event.preventDefault();\n onRowClick(data);\n return;\n }\n },\n [isEnabled, onRowClick]\n ) as <TType = unknown>(event: KeyboardEvent, data: TType) => void;\n\n const handleClick = React.useCallback(\n function (event: React.MouseEvent<HTMLTableRowElement>, data: TType) {\n if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {\n return;\n }\n\n event.preventDefault();\n onRowClick(data);\n return;\n },\n [isEnabled, onRowClick]\n );\n\n return {\n isEnabled,\n handleClick,\n handleKeyDown,\n };\n}\n"],"names":["useTableRowClick","isEnabled","onRowClick","handleKeyDown","React","useCallback","event","data","defaultPrevented","key","preventDefault","handleClick"],"mappings":";;SAGgBA,gBAAgBA,CAAkBC,SAAS,GAAG,KAAK,EAAEC,UAAwC;EACzG,MAAMC,aAAa,GAAGC,cAAK,CAACC,WAAW,CACnC,UAAUC,KAAoB,EAAEC,IAAW;IACvC,IAAI,CAACN,SAAS,IAAI,OAAOC,UAAU,KAAK,UAAU,IAAII,KAAK,CAACE,gBAAgB,EAAE;MAC1E;;IAGJ,IAAID,IAAI,IAAID,KAAK,CAACG,GAAG,KAAK,OAAO,EAAE;MAC/BH,KAAK,CAACI,cAAc,EAAE;MACtBR,UAAU,CAACK,IAAI,CAAC;MAChB;;GAEP,EACD,CAACN,SAAS,EAAEC,UAAU,CAAC,CACsC;EAEjE,MAAMS,WAAW,GAAGP,cAAK,CAACC,WAAW,CACjC,UAAUC,KAA4C,EAAEC,IAAW;IAC/D,IAAI,CAACN,SAAS,IAAI,OAAOC,UAAU,KAAK,UAAU,IAAII,KAAK,CAACE,gBAAgB,EAAE;MAC1E;;IAGJF,KAAK,CAACI,cAAc,EAAE;IACtBR,UAAU,CAACK,IAAI,CAAC;IAChB;GACH,EACD,CAACN,SAAS,EAAEC,UAAU,CAAC,CAC1B;EAED,OAAO;IACHD,SAAS;IACTU,WAAW;IACXR;GACH;AACL;;;;"}
@@ -1,7 +1,7 @@
1
1
  function useTableRowGoto(isEnabled = false, handler) {
2
2
  return {
3
3
  isEnabled,
4
- handleGoto: isEnabled && handler ? handler : () => undefined
4
+ handleGoto: isEnabled ? handler : undefined
5
5
  };
6
6
  }
7
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"useTableRowGoto.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowGoto.ts"],"sourcesContent":["import { TableRowGotoHandler } from '../../types';\n\nexport function useTableRowGoto(isEnabled = false, handler?: TableRowGotoHandler) {\n return {\n isEnabled,\n handleGoto: isEnabled && handler ? handler : () => undefined,\n };\n}\n"],"names":["useTableRowGoto","isEnabled","handler","handleGoto","undefined"],"mappings":"SAEgBA,eAAeA,CAACC,SAAS,GAAG,KAAK,EAAEC,OAA6B;EAC5E,OAAO;IACHD,SAAS;IACTE,UAAU,EAAEF,SAAS,IAAIC,OAAO,GAAGA,OAAO,GAAG,MAAME;GACtD;AACL;;;;"}
1
+ {"version":3,"file":"useTableRowGoto.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowGoto.ts"],"sourcesContent":["import { TableRowGotoHandler } from '../../types';\n\nexport function useTableRowGoto(isEnabled = false, handler?: TableRowGotoHandler) {\n return {\n isEnabled,\n handleGoto: isEnabled ? handler : undefined,\n };\n}\n"],"names":["useTableRowGoto","isEnabled","handler","handleGoto","undefined"],"mappings":"SAEgBA,eAAeA,CAACC,SAAS,GAAG,KAAK,EAAEC,OAA6B;EAC5E,OAAO;IACHD,SAAS;IACTE,UAAU,EAAEF,SAAS,GAAGC,OAAO,GAAGE;GACrC;AACL;;;;"}
@@ -23,6 +23,7 @@ function useTableRowSelection(isEnabled = false) {
23
23
  }
24
24
  }, [isEnabled]);
25
25
  return {
26
+ isEnabled,
26
27
  handleKeyDown: isEnabled ? onKeyDown : () => undefined,
27
28
  lastSelectedRowIndex
28
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useTableRowSelection.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowSelection.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\n\nexport function useTableRowSelection(isEnabled = false) {\n const lastSelectedRowIndex = React.useRef<number>();\n\n const onKeyDown = React.useCallback(\n <TType = unknown>(event: KeyboardEvent, table: ReactTable<TType>) => {\n if (!isEnabled || !table.options.enableRowSelection || event.defaultPrevented) {\n return;\n }\n\n const rows = table.getRowModel().rows;\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n\n if (event.key === ' ') {\n event.preventDefault();\n const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;\n\n if (rowActiveIndex !== undefined) {\n rows[rowActiveIndex]?.toggleSelected();\n }\n\n return;\n } else if ((event.ctrlKey || event.metaKey) && event.key === 'a') {\n event.preventDefault();\n table.toggleAllRowsSelected();\n return;\n }\n },\n [isEnabled]\n ) as <TType = unknown>(event: KeyboardEvent, table: ReactTable<TType>) => void;\n\n return {\n handleKeyDown: isEnabled ? onKeyDown : () => undefined,\n lastSelectedRowIndex,\n };\n}\n"],"names":["useTableRowSelection","isEnabled","lastSelectedRowIndex","React","useRef","onKeyDown","useCallback","event","table","options","enableRowSelection","defaultPrevented","rows","getRowModel","tableMeta","meta","key","preventDefault","rowActiveIndex","rowActive","undefined","_rows$rowActiveIndex","toggleSelected","ctrlKey","metaKey","toggleAllRowsSelected","handleKeyDown"],"mappings":";;SAGgBA,oBAAoBA,CAACC,SAAS,GAAG,KAAK;EAClD,MAAMC,oBAAoB,GAAGC,cAAK,CAACC,MAAM,EAAU;EAEnD,MAAMC,SAAS,GAAGF,cAAK,CAACG,WAAW,CAC/B,CAAkBC,KAAoB,EAAEC,KAAwB;IAC5D,IAAI,CAACP,SAAS,IAAI,CAACO,KAAK,CAACC,OAAO,CAACC,kBAAkB,IAAIH,KAAK,CAACI,gBAAgB,EAAE;MAC3E;;IAGJ,MAAMC,IAAI,GAAGJ,KAAK,CAACK,WAAW,EAAE,CAACD,IAAI;IACrC,MAAME,SAAS,GAAGN,KAAK,CAACC,OAAO,CAACM,IAA6B;IAE7D,IAAIR,KAAK,CAACS,GAAG,KAAK,GAAG,EAAE;MACnBT,KAAK,CAACU,cAAc,EAAE;MACtB,MAAMC,cAAc,GAAGJ,SAAS,CAACK,SAAS,CAACD,cAAc;MAEzD,IAAIA,cAAc,KAAKE,SAAS,EAAE;QAAA,IAAAC,oBAAA;QAC9B,CAAAA,oBAAA,GAAAT,IAAI,CAACM,cAAc,CAAC,cAAAG,oBAAA,uBAApBA,oBAAA,CAAsBC,cAAc,EAAE;;MAG1C;KACH,MAAM,IAAI,CAACf,KAAK,CAACgB,OAAO,IAAIhB,KAAK,CAACiB,OAAO,KAAKjB,KAAK,CAACS,GAAG,KAAK,GAAG,EAAE;MAC9DT,KAAK,CAACU,cAAc,EAAE;MACtBT,KAAK,CAACiB,qBAAqB,EAAE;MAC7B;;GAEP,EACD,CAACxB,SAAS,CAAC,CAC+D;EAE9E,OAAO;IACHyB,aAAa,EAAEzB,SAAS,GAAGI,SAAS,GAAG,MAAMe,SAAS;IACtDlB;GACH;AACL;;;;"}
1
+ {"version":3,"file":"useTableRowSelection.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowSelection.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\n\nexport function useTableRowSelection(isEnabled = false) {\n const lastSelectedRowIndex = React.useRef<number>();\n\n const onKeyDown = React.useCallback(\n <TType = unknown>(event: KeyboardEvent, table: ReactTable<TType>) => {\n if (!isEnabled || !table.options.enableRowSelection || event.defaultPrevented) {\n return;\n }\n\n const rows = table.getRowModel().rows;\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n\n if (event.key === ' ') {\n event.preventDefault();\n const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;\n\n if (rowActiveIndex !== undefined) {\n rows[rowActiveIndex]?.toggleSelected();\n }\n\n return;\n } else if ((event.ctrlKey || event.metaKey) && event.key === 'a') {\n event.preventDefault();\n table.toggleAllRowsSelected();\n return;\n }\n },\n [isEnabled]\n ) as <TType = unknown>(event: KeyboardEvent, table: ReactTable<TType>) => void;\n\n return {\n isEnabled,\n handleKeyDown: isEnabled ? onKeyDown : () => undefined,\n lastSelectedRowIndex,\n };\n}\n"],"names":["useTableRowSelection","isEnabled","lastSelectedRowIndex","React","useRef","onKeyDown","useCallback","event","table","options","enableRowSelection","defaultPrevented","rows","getRowModel","tableMeta","meta","key","preventDefault","rowActiveIndex","rowActive","undefined","_rows$rowActiveIndex","toggleSelected","ctrlKey","metaKey","toggleAllRowsSelected","handleKeyDown"],"mappings":";;SAGgBA,oBAAoBA,CAACC,SAAS,GAAG,KAAK;EAClD,MAAMC,oBAAoB,GAAGC,cAAK,CAACC,MAAM,EAAU;EAEnD,MAAMC,SAAS,GAAGF,cAAK,CAACG,WAAW,CAC/B,CAAkBC,KAAoB,EAAEC,KAAwB;IAC5D,IAAI,CAACP,SAAS,IAAI,CAACO,KAAK,CAACC,OAAO,CAACC,kBAAkB,IAAIH,KAAK,CAACI,gBAAgB,EAAE;MAC3E;;IAGJ,MAAMC,IAAI,GAAGJ,KAAK,CAACK,WAAW,EAAE,CAACD,IAAI;IACrC,MAAME,SAAS,GAAGN,KAAK,CAACC,OAAO,CAACM,IAA6B;IAE7D,IAAIR,KAAK,CAACS,GAAG,KAAK,GAAG,EAAE;MACnBT,KAAK,CAACU,cAAc,EAAE;MACtB,MAAMC,cAAc,GAAGJ,SAAS,CAACK,SAAS,CAACD,cAAc;MAEzD,IAAIA,cAAc,KAAKE,SAAS,EAAE;QAAA,IAAAC,oBAAA;QAC9B,CAAAA,oBAAA,GAAAT,IAAI,CAACM,cAAc,CAAC,cAAAG,oBAAA,uBAApBA,oBAAA,CAAsBC,cAAc,EAAE;;MAG1C;KACH,MAAM,IAAI,CAACf,KAAK,CAACgB,OAAO,IAAIhB,KAAK,CAACiB,OAAO,KAAKjB,KAAK,CAACS,GAAG,KAAK,GAAG,EAAE;MAC9DT,KAAK,CAACU,cAAc,EAAE;MACtBT,KAAK,CAACiB,qBAAqB,EAAE;MAC7B;;GAEP,EACD,CAACxB,SAAS,CAAC,CAC+D;EAE9E,OAAO;IACHA,SAAS;IACTyB,aAAa,EAAEzB,SAAS,GAAGI,SAAS,GAAG,MAAMe,SAAS;IACtDlB;GACH;AACL;;;;"}
@@ -1,9 +1,49 @@
1
- function useTableServerLoading(loadPage, loadAll) {
1
+ import React__default from 'react';
2
+ import { TableServerLoadAllState } from '../../types.js';
3
+ import { DEFAULT_PAGE_SIZE } from '../../useTableDataLoader.js';
4
+
5
+ function useTableServerLoading(loadPage, loadAll, pageSize = DEFAULT_PAGE_SIZE) {
2
6
  const isEnabled = !!loadPage && !!loadAll;
7
+ const [loadAllStatus, setLoadedStatus] = React__default.useState(TableServerLoadAllState.Incomplete);
8
+ let _loadAll;
9
+ let _loadAllIfNeeded;
10
+ if (typeof loadAll === 'function') {
11
+ _loadAll = function (...args) {
12
+ try {
13
+ const _temp = function () {
14
+ if (typeof loadAll === 'function') {
15
+ setLoadedStatus(TableServerLoadAllState.Loading);
16
+ return Promise.resolve(loadAll(...args)).then(function () {
17
+ setLoadedStatus(TableServerLoadAllState.Completed);
18
+ });
19
+ }
20
+ }();
21
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
22
+ } catch (e) {
23
+ return Promise.reject(e);
24
+ }
25
+ };
26
+ _loadAllIfNeeded = function (...args) {
27
+ try {
28
+ const _temp2 = function () {
29
+ if (loadAllStatus === TableServerLoadAllState.Incomplete) {
30
+ var _loadAll2;
31
+ return Promise.resolve((_loadAll2 = _loadAll) === null || _loadAll2 === void 0 ? void 0 : _loadAll2(...args)).then(function () {});
32
+ }
33
+ }();
34
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
35
+ } catch (e) {
36
+ return Promise.reject(e);
37
+ }
38
+ };
39
+ }
3
40
  return {
4
41
  isEnabled,
5
42
  loadPage,
6
- loadAll
43
+ loadAll: _loadAll,
44
+ loadAllIfNeeded: _loadAllIfNeeded,
45
+ loadAllStatus,
46
+ pageSize
7
47
  };
8
48
  }
9
49
 
@@ -1 +1 @@
1
- {"version":3,"file":"useTableServerLoading.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableServerLoading.ts"],"sourcesContent":["import { TableServerLoadAllHandler, TableServerLoadPageHandler } from '../../types';\n\nexport function useTableServerLoading(loadPage?: TableServerLoadPageHandler, loadAll?: TableServerLoadAllHandler) {\n const isEnabled = !!loadPage && !!loadAll;\n\n return {\n isEnabled,\n loadPage,\n loadAll,\n };\n}\n"],"names":["useTableServerLoading","loadPage","loadAll","isEnabled"],"mappings":"SAEgBA,qBAAqBA,CAACC,QAAqC,EAAEC,OAAmC;EAC5G,MAAMC,SAAS,GAAG,CAAC,CAACF,QAAQ,IAAI,CAAC,CAACC,OAAO;EAEzC,OAAO;IACHC,SAAS;IACTF,QAAQ;IACRC;GACH;AACL;;;;"}
1
+ {"version":3,"file":"useTableServerLoading.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableServerLoading.ts"],"sourcesContent":["import React from 'react';\nimport { TableServerLoadAllHandler, TableServerLoadAllState, TableServerLoadPageHandler } from '../../types';\nimport { DEFAULT_PAGE_SIZE } from '../../useTableDataLoader';\n\nexport function useTableServerLoading(\n loadPage?: TableServerLoadPageHandler,\n loadAll?: TableServerLoadAllHandler,\n pageSize = DEFAULT_PAGE_SIZE\n) {\n const isEnabled = !!loadPage && !!loadAll;\n const [loadAllStatus, setLoadedStatus] = React.useState<TableServerLoadAllState>(TableServerLoadAllState.Incomplete);\n\n let _loadAll: TableServerLoadAllHandler | undefined;\n let _loadAllIfNeeded: TableServerLoadAllHandler | undefined;\n\n if (typeof loadAll === 'function') {\n _loadAll = async (...args) => {\n if (typeof loadAll === 'function') {\n setLoadedStatus(TableServerLoadAllState.Loading);\n await loadAll(...args);\n setLoadedStatus(TableServerLoadAllState.Completed);\n }\n };\n\n _loadAllIfNeeded = async (...args) => {\n if (loadAllStatus === TableServerLoadAllState.Incomplete) {\n await _loadAll?.(...args);\n }\n };\n }\n\n return {\n isEnabled,\n loadPage,\n loadAll: _loadAll,\n loadAllIfNeeded: _loadAllIfNeeded,\n loadAllStatus,\n pageSize,\n };\n}\n"],"names":["useTableServerLoading","loadPage","loadAll","pageSize","DEFAULT_PAGE_SIZE","isEnabled","loadAllStatus","setLoadedStatus","React","useState","TableServerLoadAllState","Incomplete","_loadAll","_loadAllIfNeeded","args","Loading","Promise","resolve","then","Completed","_temp","e","reject","_loadAll2","_temp2","loadAllIfNeeded"],"mappings":";;;;SAIgBA,qBAAqBA,CACjCC,QAAqC,EACrCC,OAAmC,EACnCC,QAAQ,GAAGC,iBAAiB;EAE5B,MAAMC,SAAS,GAAG,CAAC,CAACJ,QAAQ,IAAI,CAAC,CAACC,OAAO;EACzC,MAAM,CAACI,aAAa,EAAEC,eAAe,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAA0BC,uBAAuB,CAACC,UAAU,CAAC;EAEpH,IAAIC,QAA+C;EACnD,IAAIC,gBAAuD;EAE3D,IAAI,OAAOX,OAAO,KAAK,UAAU,EAAE;IAC/BU,QAAQ,aAAU,GAAGE,IAAI;MAAA;;cACjB,OAAOZ,OAAO,KAAK,UAAU;YAC7BK,eAAe,CAACG,uBAAuB,CAACK,OAAO,CAAC;YAAC,OAAAC,OAAA,CAAAC,OAAA,CAC3Cf,OAAO,CAAC,GAAGY,IAAI,CAAC,EAAAI,IAAA;cACtBX,eAAe,CAACG,uBAAuB,CAACS,SAAS,CAAC;;;;QAAC,OAAAH,OAAA,CAAAC,OAAA,CAAAG,KAAA,IAAAA,KAAA,CAAAF,IAAA,GAAAE,KAAA,CAAAF,IAAA;OAE1D,QAAAG,CAAA;QAAA,OAAAL,OAAA,CAAAM,MAAA,CAAAD,CAAA;;;IAEDR,gBAAgB,aAAU,GAAGC,IAAI;MAAA;;cACzBR,aAAa,KAAKI,uBAAuB,CAACC,UAAU;YAAA,IAAAY,SAAA;YAAA,OAAAP,OAAA,CAAAC,OAAA,EAAAM,SAAA,GAC9CX,QAAQ,cAAAW,SAAA,uBAARA,SAAA,CAAW,GAAGT,IAAI,CAAC,EAAAI,IAAA;;;QAAA,OAAAF,OAAA,CAAAC,OAAA,CAAAO,MAAA,IAAAA,MAAA,CAAAN,IAAA,GAAAM,MAAA,CAAAN,IAAA;OAEhC,QAAAG,CAAA;QAAA,OAAAL,OAAA,CAAAM,MAAA,CAAAD,CAAA;;;;EAGL,OAAO;IACHhB,SAAS;IACTJ,QAAQ;IACRC,OAAO,EAAEU,QAAQ;IACjBa,eAAe,EAAEZ,gBAAgB;IACjCP,aAAa;IACbH;GACH;AACL;;;;"}
@@ -1,5 +1,5 @@
1
1
  import React__default from 'react';
2
- import { TableFontSizes } from '../../types.js';
2
+ import { FontSizes } from '../../../../types.js';
3
3
  import { getCellMinWidth } from '../util/columns.js';
4
4
  import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
5
5
 
@@ -21,15 +21,15 @@ function useTableFontSizeListener(table) {
21
21
  }
22
22
  function getCellWidthDifference(fontSizeKey) {
23
23
  switch (fontSizeKey) {
24
- case `${TableFontSizes.small}-${TableFontSizes.medium}`:
25
- case `${TableFontSizes.medium}-${TableFontSizes.large}`:
24
+ case `${FontSizes.small}-${FontSizes.medium}`:
25
+ case `${FontSizes.medium}-${FontSizes.large}`:
26
26
  return 8;
27
- case `${TableFontSizes.medium}-${TableFontSizes.small}`:
28
- case `${TableFontSizes.large}-${TableFontSizes.medium}`:
27
+ case `${FontSizes.medium}-${FontSizes.small}`:
28
+ case `${FontSizes.large}-${FontSizes.medium}`:
29
29
  return -8;
30
- case `${TableFontSizes.small}-${TableFontSizes.large}`:
30
+ case `${FontSizes.small}-${FontSizes.large}`:
31
31
  return 16;
32
- case `${TableFontSizes.large}-${TableFontSizes.small}`:
32
+ case `${FontSizes.large}-${FontSizes.small}`:
33
33
  return -16;
34
34
  default:
35
35
  return 0;
@@ -1 +1 @@
1
- {"version":3,"file":"useTableFontSizeListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableFontSizeListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableFontSizes } from '../../types';\nimport { getCellMinWidth } from '../util/columns';\n\nexport function useTableFontSizeListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const previousFontSizeRef = React.useRef(meta.fontSize.size);\n\n useLazyEffect(() => {\n const cellWidthDifference = getCellWidthDifference(`${previousFontSizeRef.current}-${meta.fontSize.size}`);\n\n table.setColumnSizing(sizes => {\n const minColumnSize = getCellMinWidth(meta.fontSize.size);\n\n return Object.fromEntries(\n Object.entries(sizes).map(([columnName, prevColumnSize]) => {\n // Prevents width value in the setting to go below the minColumnSize\n const newSize = Math.max(minColumnSize, prevColumnSize + cellWidthDifference);\n return [columnName, newSize];\n })\n );\n });\n previousFontSizeRef.current = meta.fontSize.size;\n }, [meta.fontSize.size]);\n}\n\nfunction getCellWidthDifference(fontSizeKey: string) {\n switch (fontSizeKey) {\n case `${TableFontSizes.small}-${TableFontSizes.medium}`:\n case `${TableFontSizes.medium}-${TableFontSizes.large}`:\n return 8;\n\n case `${TableFontSizes.medium}-${TableFontSizes.small}`:\n case `${TableFontSizes.large}-${TableFontSizes.medium}`:\n return -8;\n\n case `${TableFontSizes.small}-${TableFontSizes.large}`:\n return 16;\n\n case `${TableFontSizes.large}-${TableFontSizes.small}`:\n return -16;\n\n default:\n return 0;\n }\n}\n"],"names":["useTableFontSizeListener","table","meta","options","previousFontSizeRef","React","useRef","fontSize","size","useLazyEffect","cellWidthDifference","getCellWidthDifference","current","setColumnSizing","sizes","minColumnSize","getCellMinWidth","Object","fromEntries","entries","map","columnName","prevColumnSize","newSize","Math","max","fontSizeKey","TableFontSizes","small","medium","large"],"mappings":";;;;;SAMgBA,wBAAwBA,CAAkBC,KAAwB;EAC9E,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EACxD,MAAME,mBAAmB,GAAGC,cAAK,CAACC,MAAM,CAACJ,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC;EAE5DC,aAAa,CAAC;IACV,MAAMC,mBAAmB,GAAGC,sBAAsB,IAAIP,mBAAmB,CAACQ,WAAWV,IAAI,CAACK,QAAQ,CAACC,MAAM,CAAC;IAE1GP,KAAK,CAACY,eAAe,CAACC,KAAK;MACvB,MAAMC,aAAa,GAAGC,eAAe,CAACd,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC;MAEzD,OAAOS,MAAM,CAACC,WAAW,CACrBD,MAAM,CAACE,OAAO,CAACL,KAAK,CAAC,CAACM,GAAG,CAAC,CAAC,CAACC,UAAU,EAAEC,cAAc,CAAC;;QAEnD,MAAMC,OAAO,GAAGC,IAAI,CAACC,GAAG,CAACV,aAAa,EAAEO,cAAc,GAAGZ,mBAAmB,CAAC;QAC7E,OAAO,CAACW,UAAU,EAAEE,OAAO,CAAC;OAC/B,CAAC,CACL;KACJ,CAAC;IACFnB,mBAAmB,CAACQ,OAAO,GAAGV,IAAI,CAACK,QAAQ,CAACC,IAAI;GACnD,EAAE,CAACN,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC,CAAC;AAC5B;AAEA,SAASG,sBAAsBA,CAACe,WAAmB;EAC/C,QAAQA,WAAW;IACf,QAAQC,cAAc,CAACC,SAASD,cAAc,CAACE,QAAQ;IACvD,QAAQF,cAAc,CAACE,UAAUF,cAAc,CAACG,OAAO;MACnD,OAAO,CAAC;IAEZ,QAAQH,cAAc,CAACE,UAAUF,cAAc,CAACC,OAAO;IACvD,QAAQD,cAAc,CAACG,SAASH,cAAc,CAACE,QAAQ;MACnD,OAAO,CAAC,CAAC;IAEb,QAAQF,cAAc,CAACC,SAASD,cAAc,CAACG,OAAO;MAClD,OAAO,EAAE;IAEb,QAAQH,cAAc,CAACG,SAASH,cAAc,CAACC,OAAO;MAClD,OAAO,CAAC,EAAE;IAEd;MACI,OAAO,CAAC;;AAEpB;;;;"}
1
+ {"version":3,"file":"useTableFontSizeListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableFontSizeListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { FontSizes } from '../../../../types';\nimport { getCellMinWidth } from '../util/columns';\n\nexport function useTableFontSizeListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const previousFontSizeRef = React.useRef(meta.fontSize.size);\n\n useLazyEffect(() => {\n const cellWidthDifference = getCellWidthDifference(`${previousFontSizeRef.current}-${meta.fontSize.size}`);\n\n table.setColumnSizing(sizes => {\n const minColumnSize = getCellMinWidth(meta.fontSize.size);\n\n return Object.fromEntries(\n Object.entries(sizes).map(([columnName, prevColumnSize]) => {\n // Prevents width value in the setting to go below the minColumnSize\n const newSize = Math.max(minColumnSize, prevColumnSize + cellWidthDifference);\n return [columnName, newSize];\n })\n );\n });\n previousFontSizeRef.current = meta.fontSize.size;\n }, [meta.fontSize.size]);\n}\n\nfunction getCellWidthDifference(fontSizeKey: string) {\n switch (fontSizeKey) {\n case `${FontSizes.small}-${FontSizes.medium}`:\n case `${FontSizes.medium}-${FontSizes.large}`:\n return 8;\n\n case `${FontSizes.medium}-${FontSizes.small}`:\n case `${FontSizes.large}-${FontSizes.medium}`:\n return -8;\n\n case `${FontSizes.small}-${FontSizes.large}`:\n return 16;\n\n case `${FontSizes.large}-${FontSizes.small}`:\n return -16;\n\n default:\n return 0;\n }\n}\n"],"names":["useTableFontSizeListener","table","meta","options","previousFontSizeRef","React","useRef","fontSize","size","useLazyEffect","cellWidthDifference","getCellWidthDifference","current","setColumnSizing","sizes","minColumnSize","getCellMinWidth","Object","fromEntries","entries","map","columnName","prevColumnSize","newSize","Math","max","fontSizeKey","FontSizes","small","medium","large"],"mappings":";;;;;SAMgBA,wBAAwBA,CAAkBC,KAAwB;EAC9E,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EACxD,MAAME,mBAAmB,GAAGC,cAAK,CAACC,MAAM,CAACJ,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC;EAE5DC,aAAa,CAAC;IACV,MAAMC,mBAAmB,GAAGC,sBAAsB,IAAIP,mBAAmB,CAACQ,WAAWV,IAAI,CAACK,QAAQ,CAACC,MAAM,CAAC;IAE1GP,KAAK,CAACY,eAAe,CAACC,KAAK;MACvB,MAAMC,aAAa,GAAGC,eAAe,CAACd,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC;MAEzD,OAAOS,MAAM,CAACC,WAAW,CACrBD,MAAM,CAACE,OAAO,CAACL,KAAK,CAAC,CAACM,GAAG,CAAC,CAAC,CAACC,UAAU,EAAEC,cAAc,CAAC;;QAEnD,MAAMC,OAAO,GAAGC,IAAI,CAACC,GAAG,CAACV,aAAa,EAAEO,cAAc,GAAGZ,mBAAmB,CAAC;QAC7E,OAAO,CAACW,UAAU,EAAEE,OAAO,CAAC;OAC/B,CAAC,CACL;KACJ,CAAC;IACFnB,mBAAmB,CAACQ,OAAO,GAAGV,IAAI,CAACK,QAAQ,CAACC,IAAI;GACnD,EAAE,CAACN,IAAI,CAACK,QAAQ,CAACC,IAAI,CAAC,CAAC;AAC5B;AAEA,SAASG,sBAAsBA,CAACe,WAAmB;EAC/C,QAAQA,WAAW;IACf,QAAQC,SAAS,CAACC,SAASD,SAAS,CAACE,QAAQ;IAC7C,QAAQF,SAAS,CAACE,UAAUF,SAAS,CAACG,OAAO;MACzC,OAAO,CAAC;IAEZ,QAAQH,SAAS,CAACE,UAAUF,SAAS,CAACC,OAAO;IAC7C,QAAQD,SAAS,CAACG,SAASH,SAAS,CAACE,QAAQ;MACzC,OAAO,CAAC,CAAC;IAEb,QAAQF,SAAS,CAACC,SAASD,SAAS,CAACG,OAAO;MACxC,OAAO,EAAE;IAEb,QAAQH,SAAS,CAACG,SAASH,SAAS,CAACC,OAAO;MACxC,OAAO,CAAC,EAAE;IAEd;MACI,OAAO,CAAC;;AAEpB;;;;"}
@@ -1,24 +1,26 @@
1
- import { TableFontSizes } from '../../types.js';
1
+ import 'date-fns';
2
+ import '../../../../utils/date.js';
3
+ import { FontSizes } from '../../../../types.js';
2
4
 
5
+ function isInternalColumn(id) {
6
+ return id === null || id === void 0 ? void 0 : id.startsWith('__');
7
+ }
3
8
  // column widths
4
9
  const getCellMinWidth = (fontSize = 'medium') => {
5
10
  switch (fontSize) {
6
- case TableFontSizes.small:
11
+ case FontSizes.small:
7
12
  return 57;
8
- case TableFontSizes.large:
13
+ case FontSizes.large:
9
14
  return 83;
10
15
  default:
11
- case TableFontSizes.medium:
16
+ case FontSizes.medium:
12
17
  return 72;
13
18
  }
14
19
  };
15
20
  // ordering
16
- function ensureOrdering(columns, internalColumnsPinnedToTheRight, settingsOrder) {
21
+ function ensureOrdering(columns, settingsOrder, internalColumnsPinnedToTheRight = ['__actions']) {
17
22
  // internal columns come with a defined order
18
- const internalColumns = columns.filter(column => {
19
- var _column$id;
20
- return ((_column$id = column.id) === null || _column$id === void 0 ? void 0 : _column$id.startsWith('__')) && !internalColumnsPinnedToTheRight.includes(column.id);
21
- }).map(column => column.id);
23
+ const internalColumns = columns.filter(column => isInternalColumn(column.id) && !internalColumnsPinnedToTheRight.includes(String(column.id))).map(column => column.id);
22
24
  // columns with ordering disabled should be moved to the front
23
25
  const orderingDisabled = [];
24
26
  const orderingEnabled = [];
@@ -30,8 +32,8 @@ function ensureOrdering(columns, internalColumnsPinnedToTheRight, settingsOrder)
30
32
  (a, b) => (settingsOrder.indexOf(a.id) >>> 0) - (settingsOrder.indexOf(b.id) >>> 0));
31
33
  }
32
34
  orderedColumns.forEach(column => {
33
- var _column$id2, _column$meta;
34
- if ((_column$id2 = column.id) !== null && _column$id2 !== void 0 && _column$id2.startsWith('__')) {
35
+ var _column$meta;
36
+ if (isInternalColumn(column.id)) {
35
37
  return;
36
38
  }
37
39
  if ((_column$meta = column.meta) !== null && _column$meta !== void 0 && _column$meta.enableOrdering) {
@@ -50,5 +52,5 @@ function ensureOrdering(columns, internalColumnsPinnedToTheRight, settingsOrder)
50
52
  return order;
51
53
  }
52
54
 
53
- export { ensureOrdering, getCellMinWidth };
55
+ export { ensureOrdering, getCellMinWidth, isInternalColumn };
54
56
  //# sourceMappingURL=columns.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"columns.js","sources":["../../../../../../../../../src/primitives/Table/useTable/util/columns.ts"],"sourcesContent":["import { ColumnDef as ReactTableColumnDef } from '@tanstack/react-table';\nimport { TableFontSize, TableFontSizes } from '../../types';\n\n// column widths\nexport const getCellMinWidth = (fontSize: TableFontSize = 'medium') => {\n switch (fontSize) {\n case TableFontSizes.small:\n return 57;\n\n case TableFontSizes.large:\n return 83;\n\n default:\n case TableFontSizes.medium:\n return 72;\n }\n};\n\n// ordering\nexport function ensureOrdering<TType = unknown>(\n columns: ReactTableColumnDef<TType>[],\n internalColumnsPinnedToTheRight: string[],\n settingsOrder: string[] | undefined\n): string[] {\n // internal columns come with a defined order\n const internalColumns = columns\n .filter(column => column.id?.startsWith('__') && !internalColumnsPinnedToTheRight.includes(column.id))\n .map(column => column.id) as string[];\n\n // columns with ordering disabled should be moved to the front\n const orderingDisabled: string[] = [];\n const orderingEnabled: string[] = [];\n\n let orderedColumns = columns;\n\n // if settings is defined, make sure the columns that are actual children are sorted by it\n if (Array.isArray(settingsOrder)) {\n orderedColumns = columns.slice().sort(\n // the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end\n (a, b) => (settingsOrder.indexOf(a.id as string) >>> 0) - (settingsOrder.indexOf(b.id as string) >>> 0)\n );\n }\n\n orderedColumns.forEach(column => {\n if (column.id?.startsWith('__')) {\n return;\n }\n\n if (column.meta?.enableOrdering) {\n orderingEnabled.push(column.id as string);\n } else {\n orderingDisabled.push(column.id as string);\n }\n });\n\n const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];\n\n // actions should always be last, enforce that\n internalColumnsPinnedToTheRight.forEach(id => {\n if (columns.findIndex(column => column.id === id) > -1) {\n order.push(id);\n }\n });\n\n return order;\n}\n"],"names":["getCellMinWidth","fontSize","TableFontSizes","small","large","medium","ensureOrdering","columns","internalColumnsPinnedToTheRight","settingsOrder","internalColumns","filter","column","_column$id","id","startsWith","includes","map","orderingDisabled","orderingEnabled","orderedColumns","Array","isArray","slice","sort","a","b","indexOf","forEach","_column$id2","_column$meta","meta","enableOrdering","push","order","findIndex"],"mappings":";;AAGA;MACaA,eAAe,GAAGA,CAACC,WAA0B,QAAQ;EAC9D,QAAQA,QAAQ;IACZ,KAAKC,cAAc,CAACC,KAAK;MACrB,OAAO,EAAE;IAEb,KAAKD,cAAc,CAACE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CAACrB,MAAM,CAACE,EAAY,CAAC;;GAEjD,CAAC;EAEF,MAAMoB,KAAK,GAAG,CAAC,GAAGxB,eAAe,EAAE,GAAGQ,gBAAgB,EAAE,GAAGC,eAAe,CAAC;;EAG3EX,+BAA+B,CAACoB,OAAO,CAACd,EAAE;IACtC,IAAIP,OAAO,CAAC4B,SAAS,CAACvB,MAAM,IAAIA,MAAM,CAACE,EAAE,KAAKA,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE;MACpDoB,KAAK,CAACD,IAAI,CAACnB,EAAE,CAAC;;GAErB,CAAC;EAEF,OAAOoB,KAAK;AAChB;;;;"}
1
+ {"version":3,"file":"columns.js","sources":["../../../../../../../../../src/primitives/Table/useTable/util/columns.ts"],"sourcesContent":["import { ColumnDef as ReactTableColumnDef } from '@tanstack/react-table';\nimport { isDate } from 'date-fns';\nimport { FontSize, FontSizes } from '../../../../types';\nimport { format, parseFromISOString } from '../../../../utils/date';\nimport { TableColumnDataType } from '../../types';\n\nexport function isInternalColumn(id: string | undefined) {\n return id?.startsWith('__');\n}\n\n// column widths\nexport const getCellMinWidth = (fontSize: FontSize = 'medium') => {\n switch (fontSize) {\n case FontSizes.small:\n return 57;\n\n case FontSizes.large:\n return 83;\n\n default:\n case FontSizes.medium:\n return 72;\n }\n};\n\n// highlighting\nexport function isCellHighlighted(query: string, value: unknown, dataType?: TableColumnDataType) {\n if (value === undefined || value === null) {\n return false;\n }\n\n return String(getCellValueAsString(value, dataType)).toLocaleLowerCase().includes(query.toLocaleLowerCase());\n}\n\nexport function getCellValueAsString(value: unknown, dataType?: TableColumnDataType): string {\n if (value === undefined || value === null) {\n return '';\n } else if (isDate(value)) {\n return format(value as Date) ?? '';\n } else if (dataType === 'datetime' && typeof value === 'string') {\n return format(parseFromISOString(value as string)) ?? '';\n }\n\n return String(value);\n}\n\n// ordering\nexport function ensureOrdering<TType = unknown>(\n columns: ReactTableColumnDef<TType>[],\n settingsOrder: string[] | undefined,\n internalColumnsPinnedToTheRight: string[] = ['__actions']\n): string[] {\n // internal columns come with a defined order\n const internalColumns = columns\n .filter(column => isInternalColumn(column.id) && !internalColumnsPinnedToTheRight.includes(String(column.id)))\n .map(column => column.id) as string[];\n\n // columns with ordering disabled should be moved to the front\n const orderingDisabled: string[] = [];\n const orderingEnabled: string[] = [];\n\n let orderedColumns = columns;\n\n // if settings is defined, make sure the columns that are actual children are sorted by it\n if (Array.isArray(settingsOrder)) {\n orderedColumns = columns.slice().sort(\n // the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end\n (a, b) => (settingsOrder.indexOf(a.id as string) >>> 0) - (settingsOrder.indexOf(b.id as string) >>> 0)\n );\n }\n\n orderedColumns.forEach(column => {\n if (isInternalColumn(column.id)) {\n return;\n }\n\n if (column.meta?.enableOrdering) {\n orderingEnabled.push(column.id as string);\n } else {\n orderingDisabled.push(column.id as string);\n }\n });\n\n const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];\n\n // actions should always be last, enforce that\n internalColumnsPinnedToTheRight.forEach(id => {\n if (columns.findIndex(column => column.id === id) > -1) {\n order.push(id);\n }\n });\n\n return order;\n}\n\n// freezing - we use the react-table pinning state, but that requires some mapping between them\nexport function unfreezeAllExternalColumns(leftPinnedState?: string[]): string[] {\n return leftPinnedState?.filter(id => isInternalColumn(id) && id !== '__actions') ?? [];\n}\n\nexport function freezeUptoExternalColumn(index: number, columns: string[]): string[] {\n return columns.slice(0, index + 1);\n}\n"],"names":["isInternalColumn","id","startsWith","getCellMinWidth","fontSize","FontSizes","small","large","medium","ensureOrdering","columns","settingsOrder","internalColumnsPinnedToTheRight","internalColumns","filter","column","includes","String","map","orderingDisabled","orderingEnabled","orderedColumns","Array","isArray","slice","sort","a","b","indexOf","forEach","_column$meta","meta","enableOrdering","push","order","findIndex"],"mappings":";;;;SAMgBA,gBAAgBA,CAACC,EAAsB;EACnD,OAAOA,EAAE,aAAFA,EAAE,uBAAFA,EAAE,CAAEC,UAAU,CAAC,IAAI,CAAC;A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,EAAY,CAAC;KAC5C,MAAM;MACHkB,gBAAgB,CAACc,IAAI,CAAClB,MAAM,CAACd,EAAY,CAAC;;GAEjD,CAAC;EAEF,MAAMiC,KAAK,GAAG,CAAC,GAAGrB,eAAe,EAAE,GAAGM,gBAAgB,EAAE,GAAGC,eAAe,CAAC;;EAG3ER,+BAA+B,CAACiB,OAAO,CAAC5B,EAAE;IACtC,IAAIS,OAAO,CAACyB,SAAS,CAACpB,MAAM,IAAIA,MAAM,CAACd,EAAE,KAAKA,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE;MACpDiC,KAAK,CAACD,IAAI,CAAChC,EAAE,CAAC;;GAErB,CAAC;EAEF,OAAOiC,KAAK;AAChB;;;;"}
@@ -0,0 +1,7 @@
1
+ import 'react';
2
+ import '../../../../../node_modules/babel-plugin-transform-async-to-promises/helpers.mjs.js';
3
+
4
+ const DEFAULT_PAGE_SIZE = 100;
5
+
6
+ export { DEFAULT_PAGE_SIZE };
7
+ //# sourceMappingURL=useTableDataLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableDataLoader.js","sources":["../../../../../../../src/primitives/Table/useTableDataLoader.ts"],"sourcesContent":["import React from 'react';\nimport {\n TableColumnFilter,\n TableColumnSort,\n TableFilterHandler,\n TableServerLoadPageHandler,\n TableServerLoadAllHandler,\n TableSortHandler,\n} from './types';\n\nexport const DEFAULT_PAGE_SIZE = 100;\n\nexport type useTableDataPageFetcher<TType = unknown> = (\n pageIndex: number,\n pageSize: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTableDataAllFetcher<TType = unknown> = (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTableDataLoaderOptions = { pageSize: number };\n\nexport type useTableDataLoaderValues<TType = unknown> = {\n data: TType[];\n length: number | undefined;\n loadAll: TableServerLoadAllHandler;\n loadPage: TableServerLoadPageHandler;\n onChangeFilter: TableFilterHandler;\n onChangeSort: TableSortHandler;\n pageSize: number;\n};\n\nexport function useTableDataLoader<TType = unknown>(\n fetch: useTableDataPageFetcher<TType>,\n fetchAll: useTableDataAllFetcher<TType>,\n options: useTableDataLoaderOptions = { pageSize: DEFAULT_PAGE_SIZE }\n): [useTableDataLoaderValues<TType>, () => void] {\n const { pageSize } = options;\n\n // track the data length, we don't know it until the first request\n const length = React.useRef<number | undefined>(undefined);\n // data will be filled after the first request, then we'll update values in place\n const [data, setData] = React.useState<any[]>([]);\n // track which pages have been loaded to dedupe requests\n const _pendingPageRequests = React.useRef({});\n const _lastUsedSorting = React.useRef<TableColumnSort[]>([]);\n const _lastUsedFilters = React.useRef<TableColumnFilter[]>([]);\n const _lastUsedSearch = React.useRef<string>();\n const _forceReset = React.useRef(false);\n\n const loadPage = async (\n pageIndex: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined\n ) => {\n let reset = false;\n\n // sorting or filters changed, reset everything\n if (\n _forceReset.current ||\n search !== _lastUsedSearch.current ||\n JSON.stringify(sorting) !== JSON.stringify(_lastUsedSorting.current) ||\n JSON.stringify(filters) !== JSON.stringify(_lastUsedFilters.current)\n ) {\n _pendingPageRequests.current = {};\n // nuke the dataset so that we \"start again\" after sorting\n reset = true;\n }\n\n if (_pendingPageRequests.current[pageIndex]) {\n // if page is already loaded/loading, abort, otherwise mark it as loading\n return;\n } else {\n _pendingPageRequests.current[pageIndex] = true;\n }\n\n _forceReset.current = false;\n // set the sorting so we can track if it changed between loads\n _lastUsedSorting.current = sorting;\n // set the filters so we can track if it changed between loads\n _lastUsedFilters.current = filters;\n // set the search so we can track if it changed between loads\n _lastUsedSearch.current = search;\n\n try {\n const response = await fetch(pageIndex, pageSize, sorting, filters, search);\n\n // update state, here we do some \"magic\" to support \"load in place\"\n setData(currentData => {\n let nextData;\n\n // reset table state if:\n // - the length isn't set at all (first load)\n // - the client length and server length are different (the data changed)\n if (reset || length.current !== response.length) {\n length.current = response.length;\n nextData = Array(length.current).fill(undefined);\n } else {\n nextData = [...currentData];\n }\n\n const startIndex = pageIndex * pageSize;\n nextData.splice(startIndex, pageSize, ...response.data);\n return nextData;\n });\n } catch {\n //\n } finally {\n _pendingPageRequests.current[pageIndex] = false;\n }\n };\n\n const loadAll = async (sorting: TableColumnSort[], filters: TableColumnFilter[], search: string | undefined) => {\n try {\n const response = await fetchAll(sorting, filters, search);\n length.current = response.length;\n\n setData(() => {\n let nextData;\n\n if (response.data.length !== response.length) {\n nextData = Array(response.length).fill(undefined);\n nextData.splice(0, response.data.length, ...response.data);\n } else {\n nextData = [...response.data];\n }\n\n return nextData;\n });\n } catch {\n //\n }\n };\n\n const invalidate = async () => {\n _forceReset.current = true;\n return loadPage(0, _lastUsedSorting.current, _lastUsedFilters.current, _lastUsedSearch.current);\n };\n\n // we reset the page to 0 whenever sorting, filtering or search changes\n const handleSort = async (sorting: TableColumnSort[]) =>\n loadPage(0, sorting, _lastUsedFilters.current, _lastUsedSearch.current);\n const handleFilter = async (filters: TableColumnFilter[]) =>\n loadPage(0, _lastUsedSorting.current, filters, _lastUsedSearch.current);\n\n return [\n {\n data,\n length: length.current,\n loadAll,\n loadPage,\n onChangeFilter: handleFilter,\n onChangeSort: handleSort,\n pageSize,\n },\n invalidate,\n ];\n}\n"],"names":["DEFAULT_PAGE_SIZE"],"mappings":";;;MAUaA,iBAAiB,GAAG;;;;"}
@@ -1,6 +1,12 @@
1
1
  import React__default from 'react';
2
2
 
3
+ var FontSizes;
4
+ (function (FontSizes) {
5
+ FontSizes["small"] = "small";
6
+ FontSizes["medium"] = "medium";
7
+ FontSizes["large"] = "large";
8
+ })(FontSizes || (FontSizes = {}));
3
9
  const fixedForwardRef = React__default.forwardRef;
4
10
 
5
- export { fixedForwardRef };
11
+ export { FontSizes, fixedForwardRef };
6
12
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../../src/types.ts"],"sourcesContent":["import React from 'react';\nimport { AVAILABLE_COLORS } from './utils/tailwind';\n\nexport type Appearance = 'default' | 'primary' | 'danger' | 'ghost' | 'discrete' | 'transparent';\nexport type State = 'default' | 'success' | 'error' | 'warning' | 'information';\nexport type Locale = 'en-GB' | 'da-DK' | 'sv-SE' | 'no-NO';\nexport type Orientation = 'horizontal' | 'vertical';\nexport type Align = 'start' | 'center' | 'end';\nexport type Placement = 'right' | 'left' | 'top' | 'bottom';\nexport type Color = (typeof AVAILABLE_COLORS)[number];\n\n// helpers\ntype FixedForwardRef = <T, P = {}>(\n render: (props: P, ref: React.Ref<T>) => JSX.Element\n) => (props: P & React.RefAttributes<T>) => JSX.Element;\n\nexport const fixedForwardRef = React.forwardRef as FixedForwardRef;\n\nexport type ValueOf<T> = T[keyof T];\n"],"names":["fixedForwardRef","React","forwardRef"],"mappings":";;MAgBaA,eAAe,GAAGC,cAAK,CAACC;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../../../src/types.ts"],"sourcesContent":["import React from 'react';\nimport { AVAILABLE_COLORS } from './utils/tailwind';\n\nexport type Appearance = 'default' | 'primary' | 'danger' | 'ghost' | 'discrete' | 'transparent';\nexport type State = 'default' | 'success' | 'error' | 'warning' | 'information';\nexport type Locale = 'en-GB' | 'da-DK' | 'sv-SE' | 'no-NO';\nexport type Orientation = 'horizontal' | 'vertical';\nexport type Align = 'start' | 'center' | 'end';\nexport type Placement = 'right' | 'left' | 'top' | 'bottom';\nexport type Color = (typeof AVAILABLE_COLORS)[number];\n\nexport enum FontSizes {\n small = 'small',\n medium = 'medium',\n large = 'large',\n}\nexport type FontSize = keyof typeof FontSizes;\n\n// helpers\ntype FixedForwardRef = <T, P = {}>(\n render: (props: P, ref: React.Ref<T>) => JSX.Element\n) => (props: P & React.RefAttributes<T>) => JSX.Element;\n\nexport const fixedForwardRef = React.forwardRef as FixedForwardRef;\n\nexport type ValueOf<T> = T[keyof T];\n"],"names":["FontSizes","fixedForwardRef","React","forwardRef"],"mappings":";;IAWYA;AAAZ,WAAYA,SAAS;EACjBA,4BAAe;EACfA,8BAAiB;EACjBA,4BAAe;AACnB,CAAC,EAJWA,SAAS,KAATA,SAAS;MAYRC,eAAe,GAAGC,cAAK,CAACC;;;;"}
@@ -25,6 +25,15 @@ const getNextFocussableElement = currentElement => {
25
25
  }
26
26
  return focussableElements[currentElementIndex + 1];
27
27
  };
28
+ function isElementInsideOrTriggeredFromContainer(element, container) {
29
+ switch (element === null || element === void 0 ? void 0 : element.getAttribute('role')) {
30
+ case 'dialog':
31
+ return !!(container !== null && container !== void 0 && container.querySelector(`[aria-controls='${element.id}']`));
32
+ case 'menu':
33
+ return !!(container !== null && container !== void 0 && container.querySelector(`#${element.getAttribute('aria-labelledby')}`));
34
+ }
35
+ return !!(container !== null && container !== void 0 && container.contains(element));
36
+ }
28
37
 
29
- export { getIndexOfFirstChildOverflowingParent, getNextFocussableElement };
38
+ export { getIndexOfFirstChildOverflowingParent, getNextFocussableElement, isElementInsideOrTriggeredFromContainer };
30
39
  //# sourceMappingURL=dom.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.js","sources":["../../../../../../src/utils/dom.ts"],"sourcesContent":["export const isOverflowing = (element: HTMLElement | null) =>\n element !== null ? element.scrollWidth > element.offsetWidth : false;\n\nexport const getIndexOfFirstChildOverflowingParent = (element: HTMLElement, overscan = 0) => {\n let index = 0;\n let boundaryChildIndex: number | null = null;\n const clientRect = element.getBoundingClientRect();\n\n for (const child of Array.from(element.children)) {\n const right = child.getBoundingClientRect().right - clientRect.left;\n const width = clientRect.width - overscan;\n\n if (right > width) {\n boundaryChildIndex = index;\n break;\n }\n index++;\n }\n\n return boundaryChildIndex;\n};\n\nexport const getNextFocussableElement = (currentElement: HTMLElement | null) => {\n if (!currentElement) {\n return null;\n }\n\n const focussableElements = [\n ...document.querySelectorAll<HTMLElement>(\n 'button:not([disabled]), [href]:not(link):not(script), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]):not([disabled]), details:not([disabled]), summary:not(:disabled)'\n ),\n ];\n const currentElementIndex = focussableElements.indexOf(currentElement);\n\n // If the currentElement is not in the focussable elements list or it is the last element\n if (currentElementIndex !== -1 && currentElementIndex === focussableElements.length - 1) {\n return null;\n }\n\n return focussableElements[currentElementIndex + 1];\n};\n"],"names":["getIndexOfFirstChildOverflowingParent","element","overscan","index","boundaryChildIndex","clientRect","getBoundingClientRect","child","Array","from","children","right","left","width","getNextFocussableElement","currentElement","focussableElements","document","querySelectorAll","currentElementIndex","indexOf","length"],"mappings":"MAGaA,qCAAqC,GAAGA,CAACC,OAAoB,EAAEC,QAAQ,GAAG,CAAC;EACpF,IAAIC,KAAK,GAAG,CAAC;EACb,IAAIC,kBAAkB,GAAkB,IAAI;EAC5C,MAAMC,UAAU,GAAGJ,OAAO,CAACK,qBAAqB,EAAE;EAElD,KAAK,MAAMC,KAAK,IAAIC,KAAK,CAACC,IAAI,CAACR,OAAO,CAACS,QAAQ,CAAC,EAAE;IAC9C,MAAMC,KAAK,GAAGJ,KAAK,CAACD,qBAAqB,EAAE,CAACK,KAAK,GAAGN,UAAU,CAACO,IAAI;IACnE,MAAMC,KAAK,GAAGR,UAAU,CAACQ,KAAK,GAAGX,QAAQ;IAEzC,IAAIS,KAAK,GAAGE,KAAK,EAAE;MACfT,kBAAkB,GAAGD,KAAK;MAC1B;;IAEJA,KAAK,EAAE;;EAGX,OAAOC,kBAAkB;AAC7B;MAEaU,wBAAwB,GAAIC,cAAkC;EACvE,IAAI,CAACA,cAAc,EAAE;IACjB,OAAO,IAAI;;EAGf,MAAMC,kBAAkB,GAAG,CACvB,GAAGC,QAAQ,CAACC,gBAAgB,CACxB,iOAAiO,CACpO,CACJ;EACD,MAAMC,mBAAmB,GAAGH,kBAAkB,CAACI,OAAO,CAACL,cAAc,CAAC;;EAGtE,IAAII,mBAAmB,KAAK,CAAC,CAAC,IAAIA,mBAAmB,KAAKH,kBAAkB,CAACK,MAAM,GAAG,CAAC,EAAE;IACrF,OAAO,IAAI;;EAGf,OAAOL,kBAAkB,CAACG,mBAAmB,GAAG,CAAC,CAAC;AACtD;;;;"}
1
+ {"version":3,"file":"dom.js","sources":["../../../../../../src/utils/dom.ts"],"sourcesContent":["export const isOverflowing = (element: HTMLElement | null) =>\n element !== null ? element.scrollWidth > element.offsetWidth : false;\n\nexport const getIndexOfFirstChildOverflowingParent = (element: HTMLElement, overscan = 0) => {\n let index = 0;\n let boundaryChildIndex: number | null = null;\n const clientRect = element.getBoundingClientRect();\n\n for (const child of Array.from(element.children)) {\n const right = child.getBoundingClientRect().right - clientRect.left;\n const width = clientRect.width - overscan;\n\n if (right > width) {\n boundaryChildIndex = index;\n break;\n }\n index++;\n }\n\n return boundaryChildIndex;\n};\n\nexport const getNextFocussableElement = (currentElement: HTMLElement | null) => {\n if (!currentElement) {\n return null;\n }\n\n const focussableElements = [\n ...document.querySelectorAll<HTMLElement>(\n 'button:not([disabled]), [href]:not(link):not(script), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]):not([disabled]), details:not([disabled]), summary:not(:disabled)'\n ),\n ];\n const currentElementIndex = focussableElements.indexOf(currentElement);\n\n // If the currentElement is not in the focussable elements list or it is the last element\n if (currentElementIndex !== -1 && currentElementIndex === focussableElements.length - 1) {\n return null;\n }\n\n return focussableElements[currentElementIndex + 1];\n};\n\nexport function isElementInsideOrTriggeredFromContainer(element: Element | null, container: Element | null) {\n switch (element?.getAttribute('role')) {\n case 'dialog':\n return !!container?.querySelector(`[aria-controls='${element.id}']`);\n\n case 'menu':\n return !!container?.querySelector(`#${element.getAttribute('aria-labelledby')}`);\n }\n\n return !!container?.contains(element);\n}\n"],"names":["getIndexOfFirstChildOverflowingParent","element","overscan","index","boundaryChildIndex","clientRect","getBoundingClientRect","child","Array","from","children","right","left","width","getNextFocussableElement","currentElement","focussableElements","document","querySelectorAll","currentElementIndex","indexOf","length","isElementInsideOrTriggeredFromContain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