@economic/taco 2.47.0-server.3 → 2.47.0-server.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (670) hide show
  1. package/dist/components/Icon/components/Autopay.d.ts +3 -0
  2. package/dist/components/Icon/components/AutopayPaused.d.ts +3 -0
  3. package/dist/components/Icon/components/Person.d.ts +3 -0
  4. package/dist/components/Icon/components/PersonSolid.d.ts +3 -0
  5. package/dist/components/Icon/components/Wallet.d.ts +3 -0
  6. package/dist/components/Icon/components/index.d.ts +1 -1
  7. package/dist/components/Input/Input.d.ts +1 -1
  8. package/dist/components/Menu/components/Item.d.ts +1 -1
  9. package/dist/components/Menu/components/Link.d.ts +1 -1
  10. package/dist/components/Navigation2/components/Link.d.ts +1 -1
  11. package/dist/components/Select2/components/Option.d.ts +4 -4
  12. package/dist/components/Select2/components/Search.d.ts +1 -1
  13. package/dist/components/Tag/Tag.d.ts +1 -1
  14. package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +32 -0
  15. package/dist/esm/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
  16. package/dist/esm/index.css +11 -2
  17. package/dist/esm/packages/taco/src/charts/components/Area/AreaChart.js +32 -24
  18. package/dist/esm/packages/taco/src/charts/components/Area/AreaChart.js.map +1 -1
  19. package/dist/esm/packages/taco/src/charts/components/Bar/BarChart.js +84 -61
  20. package/dist/esm/packages/taco/src/charts/components/Bar/BarChart.js.map +1 -1
  21. package/dist/esm/packages/taco/src/charts/components/Donut/ActiveShape.js +16 -15
  22. package/dist/esm/packages/taco/src/charts/components/Donut/ActiveShape.js.map +1 -1
  23. package/dist/esm/packages/taco/src/charts/components/Donut/CenteredLabel.js +12 -13
  24. package/dist/esm/packages/taco/src/charts/components/Donut/CenteredLabel.js.map +1 -1
  25. package/dist/esm/packages/taco/src/charts/components/Donut/DonutChart.js +104 -68
  26. package/dist/esm/packages/taco/src/charts/components/Donut/DonutChart.js.map +1 -1
  27. package/dist/esm/packages/taco/src/charts/components/Donut/Legend.js +38 -29
  28. package/dist/esm/packages/taco/src/charts/components/Donut/Legend.js.map +1 -1
  29. package/dist/esm/packages/taco/src/charts/components/Donut/util.js +2 -2
  30. package/dist/esm/packages/taco/src/charts/components/Donut/util.js.map +1 -1
  31. package/dist/esm/packages/taco/src/charts/components/Legend.js +45 -37
  32. package/dist/esm/packages/taco/src/charts/components/Legend.js.map +1 -1
  33. package/dist/esm/packages/taco/src/charts/components/Line/LineChart.js +32 -24
  34. package/dist/esm/packages/taco/src/charts/components/Line/LineChart.js.map +1 -1
  35. package/dist/esm/packages/taco/src/charts/components/ResponsiveContainer.js +5 -3
  36. package/dist/esm/packages/taco/src/charts/components/ResponsiveContainer.js.map +1 -1
  37. package/dist/esm/packages/taco/src/charts/components/Tooltip.js +26 -25
  38. package/dist/esm/packages/taco/src/charts/components/Tooltip.js.map +1 -1
  39. package/dist/esm/packages/taco/src/charts/utils/color.js +13 -12
  40. package/dist/esm/packages/taco/src/charts/utils/color.js.map +1 -1
  41. package/dist/esm/packages/taco/src/charts/utils/common.js +39 -26
  42. package/dist/esm/packages/taco/src/charts/utils/common.js.map +1 -1
  43. package/dist/esm/packages/taco/src/components/Accordion/Accordion.js +30 -31
  44. package/dist/esm/packages/taco/src/components/Accordion/Accordion.js.map +1 -1
  45. package/dist/esm/packages/taco/src/components/Alert/Alert.js +7 -9
  46. package/dist/esm/packages/taco/src/components/Alert/Alert.js.map +1 -1
  47. package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js +14 -13
  48. package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js.map +1 -1
  49. package/dist/esm/packages/taco/src/components/AlertDialog/Context.js +2 -2
  50. package/dist/esm/packages/taco/src/components/AlertDialog/Context.js.map +1 -1
  51. package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js +10 -9
  52. package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js.map +1 -1
  53. package/dist/esm/packages/taco/src/components/AlertDialog/components/Footer.js +4 -4
  54. package/dist/esm/packages/taco/src/components/AlertDialog/components/Footer.js.map +1 -1
  55. package/dist/esm/packages/taco/src/components/AlertDialog/components/Trigger.js +5 -6
  56. package/dist/esm/packages/taco/src/components/AlertDialog/components/Trigger.js.map +1 -1
  57. package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js +2 -2
  58. package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js.map +1 -1
  59. package/dist/esm/packages/taco/src/components/Badge/Badge.js +26 -27
  60. package/dist/esm/packages/taco/src/components/Badge/Badge.js.map +1 -1
  61. package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js +12 -14
  62. package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js.map +1 -1
  63. package/dist/esm/packages/taco/src/components/Banner/Banner.js +7 -10
  64. package/dist/esm/packages/taco/src/components/Banner/Banner.js.map +1 -1
  65. package/dist/esm/packages/taco/src/components/Banner/util.js +3 -3
  66. package/dist/esm/packages/taco/src/components/Banner/util.js.map +1 -1
  67. package/dist/esm/packages/taco/src/components/Button/Button.js +28 -29
  68. package/dist/esm/packages/taco/src/components/Button/Button.js.map +1 -1
  69. package/dist/esm/packages/taco/src/components/Button/util.js +25 -24
  70. package/dist/esm/packages/taco/src/components/Button/util.js.map +1 -1
  71. package/dist/esm/packages/taco/src/components/Calendar/Calendar.js +75 -71
  72. package/dist/esm/packages/taco/src/components/Calendar/Calendar.js.map +1 -1
  73. package/dist/esm/packages/taco/src/components/Card/Card.js +14 -15
  74. package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
  75. package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js +24 -22
  76. package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js.map +1 -1
  77. package/dist/esm/packages/taco/src/components/Combobox/Combobox.js +21 -23
  78. package/dist/esm/packages/taco/src/components/Combobox/Combobox.js.map +1 -1
  79. package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +76 -64
  80. package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
  81. package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js +60 -57
  82. package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
  83. package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js +27 -28
  84. package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js.map +1 -1
  85. package/dist/esm/packages/taco/src/components/Dialog/Context.js +4 -4
  86. package/dist/esm/packages/taco/src/components/Dialog/Context.js.map +1 -1
  87. package/dist/esm/packages/taco/src/components/Dialog/Dialog.js +54 -39
  88. package/dist/esm/packages/taco/src/components/Dialog/Dialog.js.map +1 -1
  89. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +36 -38
  90. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
  91. package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js +3 -3
  92. package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js.map +1 -1
  93. package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js +2 -2
  94. package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js.map +1 -1
  95. package/dist/esm/packages/taco/src/components/Dialog/components/Trigger.js +5 -6
  96. package/dist/esm/packages/taco/src/components/Dialog/components/Trigger.js.map +1 -1
  97. package/dist/esm/packages/taco/src/components/Dialog/util.js +7 -3
  98. package/dist/esm/packages/taco/src/components/Dialog/util.js.map +1 -1
  99. package/dist/esm/packages/taco/src/components/Drawer/Context.js +5 -5
  100. package/dist/esm/packages/taco/src/components/Drawer/Context.js.map +1 -1
  101. package/dist/esm/packages/taco/src/components/Drawer/Drawer.js +61 -51
  102. package/dist/esm/packages/taco/src/components/Drawer/Drawer.js.map +1 -1
  103. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +134 -145
  104. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
  105. package/dist/esm/packages/taco/src/components/Drawer/components/Trigger.js +1 -1
  106. package/dist/esm/packages/taco/src/components/Drawer/components/Trigger.js.map +1 -1
  107. package/dist/esm/packages/taco/src/components/Drawer/util.js +5 -5
  108. package/dist/esm/packages/taco/src/components/Drawer/util.js.map +1 -1
  109. package/dist/esm/packages/taco/src/components/Field/Field.js +14 -12
  110. package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
  111. package/dist/esm/packages/taco/src/components/Form/Form.js +7 -6
  112. package/dist/esm/packages/taco/src/components/Form/Form.js.map +1 -1
  113. package/dist/esm/packages/taco/src/components/Group/Group.js +9 -7
  114. package/dist/esm/packages/taco/src/components/Group/Group.js.map +1 -1
  115. package/dist/esm/packages/taco/src/components/Hanger/Hanger.js +37 -36
  116. package/dist/esm/packages/taco/src/components/Hanger/Hanger.js.map +1 -1
  117. package/dist/esm/packages/taco/src/components/Header/Header.js +2 -2
  118. package/dist/esm/packages/taco/src/components/Header/Header.js.map +1 -1
  119. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js +14 -10
  120. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js.map +1 -1
  121. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Badge.js +5 -4
  122. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Badge.js.map +1 -1
  123. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js +7 -9
  124. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js.map +1 -1
  125. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js +9 -9
  126. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js.map +1 -1
  127. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +66 -46
  128. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -1
  129. package/dist/esm/packages/taco/src/components/Header/components/Button.js +12 -8
  130. package/dist/esm/packages/taco/src/components/Header/components/Button.js.map +1 -1
  131. package/dist/esm/packages/taco/src/components/Header/components/Link.js +22 -18
  132. package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -1
  133. package/dist/esm/packages/taco/src/components/Header/components/Logo.js +4 -4
  134. package/dist/esm/packages/taco/src/components/Header/components/Logo.js.map +1 -1
  135. package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js +2 -2
  136. package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js.map +1 -1
  137. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js +10 -9
  138. package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js.map +1 -1
  139. package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js +2 -2
  140. package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js.map +1 -1
  141. package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js +5 -7
  142. package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js.map +1 -1
  143. package/dist/esm/packages/taco/src/components/HoverCard/Primitives.js +1 -1
  144. package/dist/esm/packages/taco/src/components/HoverCard/Primitives.js.map +1 -1
  145. package/dist/esm/packages/taco/src/components/Icon/Icon.js +7 -7
  146. package/dist/esm/packages/taco/src/components/Icon/Icon.js.map +1 -1
  147. package/dist/esm/packages/taco/src/components/Icon/components/Autopay.js +19 -0
  148. package/dist/esm/packages/taco/src/components/Icon/components/Autopay.js.map +1 -0
  149. package/dist/esm/packages/taco/src/components/Icon/components/AutopayPaused.js +19 -0
  150. package/dist/esm/packages/taco/src/components/Icon/components/AutopayPaused.js.map +1 -0
  151. package/dist/esm/packages/taco/src/components/Icon/components/Person.js +19 -0
  152. package/dist/esm/packages/taco/src/components/Icon/components/Person.js.map +1 -0
  153. package/dist/esm/packages/taco/src/components/Icon/components/PersonSolid.js +19 -0
  154. package/dist/esm/packages/taco/src/components/Icon/components/PersonSolid.js.map +1 -0
  155. package/dist/esm/packages/taco/src/components/Icon/components/Wallet.js +19 -0
  156. package/dist/esm/packages/taco/src/components/Icon/components/Wallet.js.map +1 -0
  157. package/dist/esm/packages/taco/src/components/Icon/components/index.js +14 -4
  158. package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
  159. package/dist/esm/packages/taco/src/components/IconButton/IconButton.js +22 -23
  160. package/dist/esm/packages/taco/src/components/IconButton/IconButton.js.map +1 -1
  161. package/dist/esm/packages/taco/src/components/Input/Input.js +45 -44
  162. package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
  163. package/dist/esm/packages/taco/src/components/Input/util.js +8 -5
  164. package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
  165. package/dist/esm/packages/taco/src/components/Layout/Layout.js +7 -5
  166. package/dist/esm/packages/taco/src/components/Layout/Layout.js.map +1 -1
  167. package/dist/esm/packages/taco/src/components/Layout/components/Content.js +2 -2
  168. package/dist/esm/packages/taco/src/components/Layout/components/Content.js.map +1 -1
  169. package/dist/esm/packages/taco/src/components/Layout/components/Context.js +4 -2
  170. package/dist/esm/packages/taco/src/components/Layout/components/Context.js.map +1 -1
  171. package/dist/esm/packages/taco/src/components/Layout/components/Page.js +2 -2
  172. package/dist/esm/packages/taco/src/components/Layout/components/Page.js.map +1 -1
  173. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +34 -27
  174. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -1
  175. package/dist/esm/packages/taco/src/components/Layout/components/Top.js +9 -6
  176. package/dist/esm/packages/taco/src/components/Layout/components/Top.js.map +1 -1
  177. package/dist/esm/packages/taco/src/components/List/components/Button.js +1 -1
  178. package/dist/esm/packages/taco/src/components/List/components/Button.js.map +1 -1
  179. package/dist/esm/packages/taco/src/components/List/components/Collapsible.js +10 -7
  180. package/dist/esm/packages/taco/src/components/List/components/Collapsible.js.map +1 -1
  181. package/dist/esm/packages/taco/src/components/List/components/Group.js +1 -1
  182. package/dist/esm/packages/taco/src/components/List/components/Group.js.map +1 -1
  183. package/dist/esm/packages/taco/src/components/List/components/Item.js +15 -13
  184. package/dist/esm/packages/taco/src/components/List/components/Item.js.map +1 -1
  185. package/dist/esm/packages/taco/src/components/List/components/Link.js +3 -3
  186. package/dist/esm/packages/taco/src/components/List/components/Link.js.map +1 -1
  187. package/dist/esm/packages/taco/src/components/List/components/Toggle.js +29 -27
  188. package/dist/esm/packages/taco/src/components/List/components/Toggle.js.map +1 -1
  189. package/dist/esm/packages/taco/src/components/Listbox/Listbox.js +21 -26
  190. package/dist/esm/packages/taco/src/components/Listbox/Listbox.js.map +1 -1
  191. package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js +82 -70
  192. package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js.map +1 -1
  193. package/dist/esm/packages/taco/src/components/Listbox/useListbox.js +56 -51
  194. package/dist/esm/packages/taco/src/components/Listbox/useListbox.js.map +1 -1
  195. package/dist/esm/packages/taco/src/components/Listbox/useMultiListbox.js +83 -65
  196. package/dist/esm/packages/taco/src/components/Listbox/useMultiListbox.js.map +1 -1
  197. package/dist/esm/packages/taco/src/components/Listbox/useTypeahead.js +9 -10
  198. package/dist/esm/packages/taco/src/components/Listbox/useTypeahead.js.map +1 -1
  199. package/dist/esm/packages/taco/src/components/Listbox/util.js +78 -48
  200. package/dist/esm/packages/taco/src/components/Listbox/util.js.map +1 -1
  201. package/dist/esm/packages/taco/src/components/Menu/Context.js +2 -2
  202. package/dist/esm/packages/taco/src/components/Menu/Context.js.map +1 -1
  203. package/dist/esm/packages/taco/src/components/Menu/Menu.js +42 -26
  204. package/dist/esm/packages/taco/src/components/Menu/Menu.js.map +1 -1
  205. package/dist/esm/packages/taco/src/components/Menu/components/Checkbox.js +8 -8
  206. package/dist/esm/packages/taco/src/components/Menu/components/Checkbox.js.map +1 -1
  207. package/dist/esm/packages/taco/src/components/Menu/components/Content.js +27 -21
  208. package/dist/esm/packages/taco/src/components/Menu/components/Content.js.map +1 -1
  209. package/dist/esm/packages/taco/src/components/Menu/components/Header.js +3 -3
  210. package/dist/esm/packages/taco/src/components/Menu/components/Header.js.map +1 -1
  211. package/dist/esm/packages/taco/src/components/Menu/components/Item.js +32 -32
  212. package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
  213. package/dist/esm/packages/taco/src/components/Menu/components/Link.js +10 -10
  214. package/dist/esm/packages/taco/src/components/Menu/components/Link.js.map +1 -1
  215. package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js +15 -16
  216. package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js.map +1 -1
  217. package/dist/esm/packages/taco/src/components/Menu/components/Separator.js +1 -1
  218. package/dist/esm/packages/taco/src/components/Menu/components/Separator.js.map +1 -1
  219. package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js +7 -7
  220. package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js.map +1 -1
  221. package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js +5 -5
  222. package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js.map +1 -1
  223. package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js +6 -6
  224. package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js.map +1 -1
  225. package/dist/esm/packages/taco/src/components/Navigation/Navigation.js +41 -36
  226. package/dist/esm/packages/taco/src/components/Navigation/Navigation.js.map +1 -1
  227. package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js +6 -6
  228. package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js.map +1 -1
  229. package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js +6 -6
  230. package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js.map +1 -1
  231. package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js +14 -11
  232. package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js.map +1 -1
  233. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +31 -24
  234. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -1
  235. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +7 -7
  236. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -1
  237. package/dist/esm/packages/taco/src/components/Navigation2/components/util.js +9 -7
  238. package/dist/esm/packages/taco/src/components/Navigation2/components/util.js.map +1 -1
  239. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +48 -51
  240. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
  241. package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js +26 -23
  242. package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js.map +1 -1
  243. package/dist/esm/packages/taco/src/components/Pagination/Pagination.js +53 -39
  244. package/dist/esm/packages/taco/src/components/Pagination/Pagination.js.map +1 -1
  245. package/dist/esm/packages/taco/src/components/Pagination/usePagination.js +17 -7
  246. package/dist/esm/packages/taco/src/components/Pagination/usePagination.js.map +1 -1
  247. package/dist/esm/packages/taco/src/components/Pagination/usePaginationShortcuts.js +8 -9
  248. package/dist/esm/packages/taco/src/components/Pagination/usePaginationShortcuts.js.map +1 -1
  249. package/dist/esm/packages/taco/src/components/Popover/Popover.js +45 -43
  250. package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
  251. package/dist/esm/packages/taco/src/components/Popover/Primitives.js +1 -1
  252. package/dist/esm/packages/taco/src/components/Popover/Primitives.js.map +1 -1
  253. package/dist/esm/packages/taco/src/components/Popover/util.js +3 -1
  254. package/dist/esm/packages/taco/src/components/Popover/util.js.map +1 -1
  255. package/dist/esm/packages/taco/src/components/Progress/Progress.js +13 -11
  256. package/dist/esm/packages/taco/src/components/Progress/Progress.js.map +1 -1
  257. package/dist/esm/packages/taco/src/components/Provider/Localization.js +13 -12
  258. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  259. package/dist/esm/packages/taco/src/components/Provider/Provider.js +8 -8
  260. package/dist/esm/packages/taco/src/components/Provider/Provider.js.map +1 -1
  261. package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js +54 -47
  262. package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js.map +1 -1
  263. package/dist/esm/packages/taco/src/components/RadioGroup/util.js +7 -1
  264. package/dist/esm/packages/taco/src/components/RadioGroup/util.js.map +1 -1
  265. package/dist/esm/packages/taco/src/components/Report/Report.js +7 -5
  266. package/dist/esm/packages/taco/src/components/Report/Report.js.map +1 -1
  267. package/dist/esm/packages/taco/src/components/Report/useReport.js +1 -1
  268. package/dist/esm/packages/taco/src/components/Report/useReport.js.map +1 -1
  269. package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js +17 -13
  270. package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
  271. package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js +11 -11
  272. package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js.map +1 -1
  273. package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +44 -39
  274. package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
  275. package/dist/esm/packages/taco/src/components/Select/Select.js +28 -31
  276. package/dist/esm/packages/taco/src/components/Select/Select.js.map +1 -1
  277. package/dist/esm/packages/taco/src/components/Select/useSelect.js +79 -70
  278. package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
  279. package/dist/esm/packages/taco/src/components/Select2/Select2.js +154 -121
  280. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  281. package/dist/esm/packages/taco/src/components/Select2/components/Collection.js +2 -4
  282. package/dist/esm/packages/taco/src/components/Select2/components/Collection.js.map +1 -1
  283. package/dist/esm/packages/taco/src/components/Select2/components/Context.js +4 -2
  284. package/dist/esm/packages/taco/src/components/Select2/components/Context.js.map +1 -1
  285. package/dist/esm/packages/taco/src/components/Select2/components/Create.js +45 -41
  286. package/dist/esm/packages/taco/src/components/Select2/components/Create.js.map +1 -1
  287. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +145 -129
  288. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
  289. package/dist/esm/packages/taco/src/components/Select2/components/Group.js +8 -8
  290. package/dist/esm/packages/taco/src/components/Select2/components/Group.js.map +1 -1
  291. package/dist/esm/packages/taco/src/components/Select2/components/Option.js +36 -35
  292. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  293. package/dist/esm/packages/taco/src/components/Select2/components/Search.js +9 -10
  294. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  295. package/dist/esm/packages/taco/src/components/Select2/components/Title.js +2 -2
  296. package/dist/esm/packages/taco/src/components/Select2/components/Title.js.map +1 -1
  297. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +173 -128
  298. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
  299. package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js +32 -23
  300. package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
  301. package/dist/esm/packages/taco/src/components/Select2/utilities.js +13 -6
  302. package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
  303. package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js +16 -13
  304. package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js.map +1 -1
  305. package/dist/esm/packages/taco/src/components/Spinner/Spinner.js +17 -12
  306. package/dist/esm/packages/taco/src/components/Spinner/Spinner.js.map +1 -1
  307. package/dist/esm/packages/taco/src/components/Switch/Switch.js +14 -14
  308. package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
  309. package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js +28 -23
  310. package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js.map +1 -1
  311. package/dist/esm/packages/taco/src/components/Table/components/PaginatedTable.js +7 -3
  312. package/dist/esm/packages/taco/src/components/Table/components/PaginatedTable.js.map +1 -1
  313. package/dist/esm/packages/taco/src/components/Table/components/Table.js +22 -18
  314. package/dist/esm/packages/taco/src/components/Table/components/Table.js.map +1 -1
  315. package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js +100 -92
  316. package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
  317. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js +136 -118
  318. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js.map +1 -1
  319. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowDraggable.js +55 -55
  320. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
  321. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowEditing.js +35 -41
  322. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
  323. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowSelect.js +77 -71
  324. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
  325. package/dist/esm/packages/taco/src/components/Table/hooks/useRowCreation.js +56 -30
  326. package/dist/esm/packages/taco/src/components/Table/hooks/useRowCreation.js.map +1 -1
  327. package/dist/esm/packages/taco/src/components/Table/hooks/useTable.js +151 -142
  328. package/dist/esm/packages/taco/src/components/Table/hooks/useTable.js.map +1 -1
  329. package/dist/esm/packages/taco/src/components/Table/hooks/useTableKeyboardNavigation.js +22 -20
  330. package/dist/esm/packages/taco/src/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
  331. package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js +9 -12
  332. package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js.map +1 -1
  333. package/dist/esm/packages/taco/src/components/Table/util/renderRow.js +41 -41
  334. package/dist/esm/packages/taco/src/components/Table/util/renderRow.js.map +1 -1
  335. package/dist/esm/packages/taco/src/components/Table/util/rowIndexPath.js +16 -14
  336. package/dist/esm/packages/taco/src/components/Table/util/rowIndexPath.js.map +1 -1
  337. package/dist/esm/packages/taco/src/components/Table/util/sortTypes.js +32 -26
  338. package/dist/esm/packages/taco/src/components/Table/util/sortTypes.js.map +1 -1
  339. package/dist/esm/packages/taco/src/components/Table/util.js +37 -30
  340. package/dist/esm/packages/taco/src/components/Table/util.js.map +1 -1
  341. package/dist/esm/packages/taco/src/components/Table3/Table3.js +23 -23
  342. package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
  343. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js +13 -14
  344. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js.map +1 -1
  345. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js +21 -23
  346. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js.map +1 -1
  347. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/TextareaWithAutosizing.js +20 -17
  348. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/TextareaWithAutosizing.js.map +1 -1
  349. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +67 -73
  350. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
  351. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingDisplayCell.js +2 -2
  352. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingDisplayCell.js.map +1 -1
  353. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js +19 -20
  354. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js.map +1 -1
  355. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js +26 -25
  356. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js.map +1 -1
  357. package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js +45 -40
  358. package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -1
  359. package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js +7 -8
  360. package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js.map +1 -1
  361. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js +18 -19
  362. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js.map +1 -1
  363. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js +7 -10
  364. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js.map +1 -1
  365. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js +38 -36
  366. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js.map +1 -1
  367. package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js +15 -15
  368. package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js.map +1 -1
  369. package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js +8 -11
  370. package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js.map +1 -1
  371. package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js +164 -201
  372. package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js.map +1 -1
  373. package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +40 -27
  374. package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
  375. package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js +18 -16
  376. package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js.map +1 -1
  377. package/dist/esm/packages/taco/src/components/Table3/useTable3.js +25 -19
  378. package/dist/esm/packages/taco/src/components/Table3/useTable3.js.map +1 -1
  379. package/dist/esm/packages/taco/src/components/Table3/util/editing.js +29 -35
  380. package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
  381. package/dist/esm/packages/taco/src/components/Tabs/Tabs.js +34 -35
  382. package/dist/esm/packages/taco/src/components/Tabs/Tabs.js.map +1 -1
  383. package/dist/esm/packages/taco/src/components/Tag/Tag.js +18 -16
  384. package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
  385. package/dist/esm/packages/taco/src/components/Textarea/Textarea.js +8 -11
  386. package/dist/esm/packages/taco/src/components/Textarea/Textarea.js.map +1 -1
  387. package/dist/esm/packages/taco/src/components/Toast/Toast.js +19 -20
  388. package/dist/esm/packages/taco/src/components/Toast/Toast.js.map +1 -1
  389. package/dist/esm/packages/taco/src/components/Toast/Toaster.js +117 -96
  390. package/dist/esm/packages/taco/src/components/Toast/Toaster.js.map +1 -1
  391. package/dist/esm/packages/taco/src/components/Toast/util.js +6 -4
  392. package/dist/esm/packages/taco/src/components/Toast/util.js.map +1 -1
  393. package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js +10 -9
  394. package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js.map +1 -1
  395. package/dist/esm/packages/taco/src/components/Tour/Tour.js +49 -46
  396. package/dist/esm/packages/taco/src/components/Tour/Tour.js.map +1 -1
  397. package/dist/esm/packages/taco/src/components/Treeview/Treeview.js +33 -27
  398. package/dist/esm/packages/taco/src/components/Treeview/Treeview.js.map +1 -1
  399. package/dist/esm/packages/taco/src/components/Truncate/Truncate.js +15 -13
  400. package/dist/esm/packages/taco/src/components/Truncate/Truncate.js.map +1 -1
  401. package/dist/esm/packages/taco/src/components/VisuallyHidden/VisuallyHidden.js +1 -1
  402. package/dist/esm/packages/taco/src/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
  403. package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js +11 -6
  404. package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js.map +1 -1
  405. package/dist/esm/packages/taco/src/hooks/useBoundingClientRectListener.js +19 -13
  406. package/dist/esm/packages/taco/src/hooks/useBoundingClientRectListener.js.map +1 -1
  407. package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js +4 -4
  408. package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js.map +1 -1
  409. package/dist/esm/packages/taco/src/hooks/useId.js +4 -2
  410. package/dist/esm/packages/taco/src/hooks/useId.js.map +1 -1
  411. package/dist/esm/packages/taco/src/hooks/useIntersectionObserver.js +20 -18
  412. package/dist/esm/packages/taco/src/hooks/useIntersectionObserver.js.map +1 -1
  413. package/dist/esm/packages/taco/src/hooks/useIsFormControl.js +7 -5
  414. package/dist/esm/packages/taco/src/hooks/useIsFormControl.js.map +1 -1
  415. package/dist/esm/packages/taco/src/hooks/useIsHoverStatePaused.js +9 -5
  416. package/dist/esm/packages/taco/src/hooks/useIsHoverStatePaused.js.map +1 -1
  417. package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js +3 -1
  418. package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js.map +1 -1
  419. package/dist/esm/packages/taco/src/hooks/useLazyEffect.js +2 -2
  420. package/dist/esm/packages/taco/src/hooks/useLazyEffect.js.map +1 -1
  421. package/dist/esm/packages/taco/src/hooks/useLocalStorage.js +24 -22
  422. package/dist/esm/packages/taco/src/hooks/useLocalStorage.js.map +1 -1
  423. package/dist/esm/packages/taco/src/hooks/useMatchMedia.js +13 -6
  424. package/dist/esm/packages/taco/src/hooks/useMatchMedia.js.map +1 -1
  425. package/dist/esm/packages/taco/src/hooks/useMergedRef.js +3 -3
  426. package/dist/esm/packages/taco/src/hooks/useMergedRef.js.map +1 -1
  427. package/dist/esm/packages/taco/src/hooks/usePrevious.js +2 -2
  428. package/dist/esm/packages/taco/src/hooks/usePrevious.js.map +1 -1
  429. package/dist/esm/packages/taco/src/primitives/BubbleSelect.js +14 -14
  430. package/dist/esm/packages/taco/src/primitives/BubbleSelect.js.map +1 -1
  431. package/dist/esm/packages/taco/src/primitives/Button.js +16 -13
  432. package/dist/esm/packages/taco/src/primitives/Button.js.map +1 -1
  433. package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js +50 -44
  434. package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js.map +1 -1
  435. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Context.js +4 -2
  436. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Context.js.map +1 -1
  437. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Group.js +9 -5
  438. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Group.js.map +1 -1
  439. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js +16 -18
  440. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js.map +1 -1
  441. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js +47 -40
  442. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js.map +1 -1
  443. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Title.js +9 -10
  444. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Title.js.map +1 -1
  445. package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js +22 -20
  446. package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js.map +1 -1
  447. package/dist/esm/packages/taco/src/primitives/Sortable/components/Item.js +24 -27
  448. package/dist/esm/packages/taco/src/primitives/Sortable/components/Item.js.map +1 -1
  449. package/dist/esm/packages/taco/src/primitives/Sortable/components/List.js +11 -10
  450. package/dist/esm/packages/taco/src/primitives/Sortable/components/List.js.map +1 -1
  451. package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js +22 -19
  452. package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -1
  453. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js +25 -22
  454. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js.map +1 -1
  455. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/EmptyStateBody.js +6 -6
  456. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/EmptyStateBody.js.map +1 -1
  457. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js +30 -14
  458. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js.map +1 -1
  459. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js +18 -19
  460. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js.map +1 -1
  461. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js +34 -34
  462. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js.map +1 -1
  463. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/Cell.js +10 -12
  464. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/Cell.js.map +1 -1
  465. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js +19 -18
  466. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js.map +1 -1
  467. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js +42 -40
  468. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js.map +1 -1
  469. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js +5 -7
  470. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js.map +1 -1
  471. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js +19 -24
  472. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js.map +1 -1
  473. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js +56 -55
  474. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js.map +1 -1
  475. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js +27 -23
  476. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
  477. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js +13 -16
  478. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js.map +1 -1
  479. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js +86 -87
  480. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js.map +1 -1
  481. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Goto.js +14 -11
  482. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Goto.js.map +1 -1
  483. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js +85 -58
  484. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
  485. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js +18 -20
  486. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js.map +1 -1
  487. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/SortIndicator.js +3 -3
  488. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/SortIndicator.js.map +1 -1
  489. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/util.js +11 -6
  490. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/util.js.map +1 -1
  491. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js +58 -49
  492. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -1
  493. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js +28 -32
  494. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js.map +1 -1
  495. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js +44 -37
  496. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js.map +1 -1
  497. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/RowContext.js +1 -1
  498. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/RowContext.js.map +1 -1
  499. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js +11 -11
  500. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js.map +1 -1
  501. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js +6 -0
  502. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js.map +1 -0
  503. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js +23 -22
  504. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js.map +1 -1
  505. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js +59 -42
  506. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -1
  507. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js +39 -39
  508. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js.map +1 -1
  509. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.js +21 -16
  510. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.js.map +1 -1
  511. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js +16 -15
  512. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js.map +1 -1
  513. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js +51 -40
  514. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -1
  515. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js +13 -9
  516. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js.map +1 -1
  517. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js +57 -51
  518. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js.map +1 -1
  519. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.js +71 -67
  520. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.js.map +1 -1
  521. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js +40 -37
  522. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js.map +1 -1
  523. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.js +64 -44
  524. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.js.map +1 -1
  525. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/Settings.js +62 -51
  526. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/Settings.js.map +1 -1
  527. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableGlobalShortcuts.js +6 -6
  528. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableGlobalShortcuts.js.map +1 -1
  529. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRef.js +13 -5
  530. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRef.js.map +1 -1
  531. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js +93 -77
  532. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
  533. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyle.js +15 -15
  534. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyle.js.map +1 -1
  535. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js +31 -41
  536. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js.map +1 -1
  537. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js +31 -30
  538. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -1
  539. package/dist/esm/packages/taco/src/primitives/Table/Core/listeners/useTableRowActiveListener.js +3 -3
  540. package/dist/esm/packages/taco/src/primitives/Table/Core/listeners/useTableRowActiveListener.js.map +1 -1
  541. package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js +14 -15
  542. package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js.map +1 -1
  543. package/dist/esm/packages/taco/src/primitives/Table/Core/util/rows.js +2 -2
  544. package/dist/esm/packages/taco/src/primitives/Table/Core/util/rows.js.map +1 -1
  545. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
  546. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js +42 -36
  547. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -1
  548. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js +67 -74
  549. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js.map +1 -1
  550. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnFreezing.js +11 -6
  551. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnFreezing.js.map +1 -1
  552. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnOrdering.js +5 -2
  553. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnOrdering.js.map +1 -1
  554. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFontSize.js +15 -5
  555. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFontSize.js.map +1 -1
  556. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFooter.js +5 -2
  557. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFooter.js.map +1 -1
  558. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js +26 -16
  559. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js.map +1 -1
  560. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActions.js +9 -3
  561. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActions.js.map +1 -1
  562. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js +42 -23
  563. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js.map +1 -1
  564. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowClick.js +9 -6
  565. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowClick.js.map +1 -1
  566. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrag.js +9 -4
  567. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrag.js.map +1 -1
  568. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrop.js +5 -2
  569. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrop.js.map +1 -1
  570. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js +9 -3
  571. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js.map +1 -1
  572. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGoto.js +5 -2
  573. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGoto.js.map +1 -1
  574. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGroups.js +1 -1
  575. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGroups.js.map +1 -1
  576. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowHeight.js +15 -5
  577. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowHeight.js.map +1 -1
  578. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js +14 -9
  579. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js.map +1 -1
  580. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js +25 -13
  581. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js.map +1 -1
  582. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js +43 -22
  583. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js.map +1 -1
  584. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js +34 -24
  585. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js.map +1 -1
  586. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableDataListener.js +4 -4
  587. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableDataListener.js.map +1 -1
  588. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFilterListener.js +3 -3
  589. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFilterListener.js.map +1 -1
  590. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFontSizeListener.js +18 -16
  591. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFontSizeListener.js.map +1 -1
  592. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowHeightListener.js +2 -2
  593. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowHeightListener.js.map +1 -1
  594. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js +6 -4
  595. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js.map +1 -1
  596. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js +8 -8
  597. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -1
  598. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js +6 -6
  599. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js.map +1 -1
  600. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js +8 -6
  601. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js.map +1 -1
  602. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.js +17 -17
  603. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.js.map +1 -1
  604. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSortingListener.js +2 -2
  605. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSortingListener.js.map +1 -1
  606. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +55 -55
  607. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
  608. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js +59 -30
  609. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js.map +1 -1
  610. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js +4 -4
  611. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js.map +1 -1
  612. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js +33 -19
  613. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js.map +1 -1
  614. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +11 -11
  615. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
  616. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js +21 -19
  617. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js.map +1 -1
  618. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js +6 -7
  619. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js.map +1 -1
  620. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +138 -106
  621. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
  622. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js +3 -1
  623. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js.map +1 -1
  624. package/dist/esm/packages/taco/src/types.js +1 -1
  625. package/dist/esm/packages/taco/src/types.js.map +1 -1
  626. package/dist/esm/packages/taco/src/utils/aria.js +2 -2
  627. package/dist/esm/packages/taco/src/utils/aria.js.map +1 -1
  628. package/dist/esm/packages/taco/src/utils/date.js +47 -23
  629. package/dist/esm/packages/taco/src/utils/date.js.map +1 -1
  630. package/dist/esm/packages/taco/src/utils/debounce.js +10 -4
  631. package/dist/esm/packages/taco/src/utils/debounce.js.map +1 -1
  632. package/dist/esm/packages/taco/src/utils/device.js +4 -2
  633. package/dist/esm/packages/taco/src/utils/device.js.map +1 -1
  634. package/dist/esm/packages/taco/src/utils/dom.js +26 -20
  635. package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
  636. package/dist/esm/packages/taco/src/utils/hooks/useDraggable.js +40 -38
  637. package/dist/esm/packages/taco/src/utils/hooks/useDraggable.js.map +1 -1
  638. package/dist/esm/packages/taco/src/utils/hooks/useDropTarget.js +9 -7
  639. package/dist/esm/packages/taco/src/utils/hooks/useDropTarget.js.map +1 -1
  640. package/dist/esm/packages/taco/src/utils/hooks/useListKeyboardNavigation.js +20 -9
  641. package/dist/esm/packages/taco/src/utils/hooks/useListKeyboardNavigation.js.map +1 -1
  642. package/dist/esm/packages/taco/src/utils/hooks/useListScrollTo.js +9 -9
  643. package/dist/esm/packages/taco/src/utils/hooks/useListScrollTo.js.map +1 -1
  644. package/dist/esm/packages/taco/src/utils/hooks/useOnClickOutside.js +8 -6
  645. package/dist/esm/packages/taco/src/utils/hooks/useOnClickOutside.js.map +1 -1
  646. package/dist/esm/packages/taco/src/utils/hooks/useTimer.js +16 -11
  647. package/dist/esm/packages/taco/src/utils/hooks/useTimer.js.map +1 -1
  648. package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js +11 -6
  649. package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js.map +1 -1
  650. package/dist/esm/packages/taco/src/utils/input.js +10 -7
  651. package/dist/esm/packages/taco/src/utils/input.js.map +1 -1
  652. package/dist/esm/packages/taco/src/utils/keyboard.js +8 -5
  653. package/dist/esm/packages/taco/src/utils/keyboard.js.map +1 -1
  654. package/dist/esm/packages/taco/src/utils/mergeRefs.js +2 -2
  655. package/dist/esm/packages/taco/src/utils/mergeRefs.js.map +1 -1
  656. package/dist/esm/packages/taco/src/utils/tailwind.js +5 -5
  657. package/dist/esm/packages/taco/src/utils/tailwind.js.map +1 -1
  658. package/dist/esm/packages/taco/tailwind.colors.js +1 -1
  659. package/dist/esm/packages/taco/tailwind.colors.js.map +1 -1
  660. package/dist/index.css +11 -2
  661. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.d.ts +3 -0
  662. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.d.ts +0 -1
  663. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.d.ts +0 -3
  664. package/dist/primitives/Table/types.d.ts +1 -1
  665. package/dist/primitives/Table/useTableManager/features/useTableServerLoading.d.ts +2 -1
  666. package/dist/taco.cjs.development.js +7944 -6916
  667. package/dist/taco.cjs.development.js.map +1 -1
  668. package/dist/taco.cjs.production.min.js +1 -1
  669. package/dist/taco.cjs.production.min.js.map +1 -1
  670. package/package.json +1 -2
@@ -2,44 +2,43 @@ import React__default from 'react';
2
2
  import { _finallyRethrows, _catch } from '../../../../../node_modules/babel-plugin-transform-async-to-promises/helpers.mjs.js';
3
3
  import { DEFAULT_PAGE_SIZE } from './useTableDataLoader.js';
4
4
 
5
- const DATASET_SIZE_MULTIPLIER = 15;
6
- function useTableDataLoader2(fetchPage, fetchAll, options = {
7
- pageSize: DEFAULT_PAGE_SIZE
8
- }) {
9
- const loadPage = function (pageIndex, sorting, filters, search, hiddenColumns, reset = false) {
5
+ var DATASET_SIZE_MULTIPLIER = 15;
6
+ function useTableDataLoader2(fetchPage, fetchAll, options) {
7
+ var loadPage = function loadPage(pageIndex, sorting, filters, search, hiddenColumns, reset) {
8
+ if (reset === void 0) {
9
+ reset = false;
10
+ }
10
11
  try {
11
- if (_hasFetchedAll.current) {
12
- return Promise.resolve();
13
- }
14
- // if page is already loading, abort, otherwise mark it as loading
15
- if (_pendingPageRequests.current[pageIndex]) {
12
+ if (_pendingPageRequests.current[pageIndex] && !reset) {
16
13
  return Promise.resolve();
17
- } else {
18
- _pendingPageRequests.current[pageIndex] = true;
19
14
  }
15
+ var hasChangedData = JSON.stringify(sorting) !== JSON.stringify(_lastUsedSorting.current) || JSON.stringify(filters) !== JSON.stringify(_lastUsedFilters.current) || search !== _lastUsedSearch.current;
16
+ // set values so we can track if they changed between loads
17
+ _lastUsedSorting.current = sorting;
18
+ _lastUsedFilters.current = filters;
19
+ _lastUsedSearch.current = search;
20
+ _lastUsedHiddenColumns.current = hiddenColumns;
20
21
  // if the page is already loaded and has actual rows, abort
21
- if (data.pages.includes(pageIndex)) {
22
- const position = data.pages.indexOf(pageIndex);
22
+ if (data.pages.includes(pageIndex) && !hasChangedData && !reset) {
23
+ var position = data.pages.indexOf(pageIndex);
23
24
  if (data.rows[position * pageSize] !== undefined) {
24
25
  return Promise.resolve();
25
26
  }
26
27
  }
27
- // set the sorting so we can track if it changed between loads
28
- _lastUsedSorting.current = sorting;
29
- // set the filters so we can track if it changed between loads
30
- _lastUsedFilters.current = filters;
31
- const direction = getDirection2(pageIndex, _lastFetchedPage.current);
32
- const _temp2 = _finallyRethrows(function () {
28
+ // set the page as loading, so that subsequent requests don't retrigger it
29
+ _pendingPageRequests.current[pageIndex] = true;
30
+ var direction = getDirection2(pageIndex, _lastFetchedPage.current);
31
+ var _temp2 = _finallyRethrows(function () {
33
32
  return _catch(function () {
34
33
  return Promise.resolve(fetchPage(pageIndex, pageSize, sorting, filters, search, hiddenColumns)).then(function (response) {
35
34
  length.current = response.length;
36
35
  // update state, here we do some "magic" to support "load in place"
37
- setData(currentData => {
38
- const nextPages = getPages(pageIndex, _lastFetchedPage.current, reset ? [] : currentData.pages, direction);
39
- let nextRows = currentData.rows;
36
+ setData(function (currentData) {
37
+ var nextPages = getPages(pageIndex, _lastFetchedPage.current, reset ? [] : currentData.pages, direction);
38
+ var nextRows = currentData.rows;
40
39
  if (reset || !direction) {
41
- const index = nextPages.indexOf(pageIndex);
42
- const startIndex = (index > -1 ? index : 0) * pageSize;
40
+ var index = nextPages.indexOf(pageIndex);
41
+ var startIndex = (index > -1 ? index : 0) * pageSize;
43
42
  if (reset) {
44
43
  nextRows = [].concat(response.data);
45
44
  } else if (startIndex > 0 || pageIndex === 0) {
@@ -70,13 +69,12 @@ function useTableDataLoader2(fetchPage, fetchAll, options = {
70
69
  });
71
70
  }, function () {});
72
71
  }, function (_wasThrown2, _result2) {
73
- _hasFetchedAll.current = false;
74
72
  // reset pending requests
75
73
  delete _pendingPageRequests.current[pageIndex];
76
74
  // update the last loaded page
77
75
  _lastFetchedPage.current = {
78
76
  index: pageIndex,
79
- direction
77
+ direction: direction
80
78
  };
81
79
  if (_wasThrown2) throw _result2;
82
80
  return _result2;
@@ -86,36 +84,41 @@ function useTableDataLoader2(fetchPage, fetchAll, options = {
86
84
  return Promise.reject(e);
87
85
  }
88
86
  };
89
- const {
90
- pageSize
91
- } = options;
92
- const DATASET_SIZE = DATASET_SIZE_MULTIPLIER * pageSize;
87
+ if (options === void 0) {
88
+ options = {
89
+ pageSize: DEFAULT_PAGE_SIZE
90
+ };
91
+ }
92
+ var _options = options,
93
+ pageSize = _options.pageSize;
94
+ var DATASET_SIZE = DATASET_SIZE_MULTIPLIER * pageSize;
93
95
  // track the data length, we don't know it until the first request
94
- const length = React__default.useRef(0);
96
+ var length = React__default.useRef(0);
95
97
  // data will be filled after the first request
96
- const [data, setData] = React__default.useState({
97
- rows: [],
98
- pages: []
99
- });
98
+ var _React$useState = React__default.useState({
99
+ rows: [],
100
+ pages: []
101
+ }),
102
+ data = _React$useState[0],
103
+ setData = _React$useState[1];
100
104
  // track which pages have been loaded to dedupe requests
101
- const _pendingPageRequests = React__default.useRef({});
102
- const _lastUsedSorting = React__default.useRef([]);
103
- const _lastUsedFilters = React__default.useRef([]);
104
- const _lastUsedSearch = React__default.useRef();
105
- const _lastUsedHiddenColumns = React__default.useRef([]);
106
- const _lastFetchedPage = React__default.useRef({
105
+ var _pendingPageRequests = React__default.useRef({});
106
+ var _lastUsedSorting = React__default.useRef([]);
107
+ var _lastUsedFilters = React__default.useRef([]);
108
+ var _lastUsedSearch = React__default.useRef();
109
+ var _lastUsedHiddenColumns = React__default.useRef([]);
110
+ var _lastFetchedPage = React__default.useRef({
107
111
  index: undefined,
108
112
  direction: undefined
109
113
  });
110
- const _hasFetchedAll = React__default.useRef(false);
111
- const loadAll = function (sorting, filters, search, hiddenColumns) {
114
+ var loadAll = function loadAll(sorting, filters, search, hiddenColumns) {
112
115
  try {
113
- _hasFetchedAll.current = true;
114
- // set the sorting so we can track if it changed between loads
116
+ // set values so we can track if they changed between loads
115
117
  _lastUsedSorting.current = sorting;
116
- // set the filters so we can track if it changed between loads
117
118
  _lastUsedFilters.current = filters;
118
- const _temp = _finallyRethrows(function () {
119
+ _lastUsedSearch.current = search;
120
+ _lastUsedHiddenColumns.current = hiddenColumns;
121
+ var _temp = _finallyRethrows(function () {
119
122
  return _catch(function () {
120
123
  return Promise.resolve(fetchAll(sorting, filters, search, hiddenColumns)).then(function (response) {
121
124
  length.current = response.length;
@@ -136,49 +139,39 @@ function useTableDataLoader2(fetchPage, fetchAll, options = {
136
139
  return Promise.reject(e);
137
140
  }
138
141
  };
139
- const invalidate = function () {
142
+ var invalidate = function invalidate() {
140
143
  try {
144
+ console.log('invalidate');
141
145
  // reset stuff
142
146
  _pendingPageRequests.current = {};
143
- _hasFetchedAll.current = false;
144
- // load the last page that we scrolled to
147
+ // load the current page again
145
148
  return loadPage(getCurrentPage(data.pages, _lastFetchedPage.current), _lastUsedSorting.current, _lastUsedFilters.current, _lastUsedSearch.current, _lastUsedHiddenColumns.current, true);
146
149
  } catch (e) {
147
150
  return Promise.reject(e);
148
151
  }
149
152
  };
150
- // search works client side - it fetches all then works client side - so these handlers are a little "weird"
151
- // if a search is currently "active", we need to re load all because
152
- const handleSort = function (sorting) {
153
+ var handleSort = function handleSort(sorting) {
153
154
  try {
154
- _lastUsedSorting.current = sorting;
155
- // reset stuff
155
+ // reset before loading the current page
156
156
  _pendingPageRequests.current = {};
157
- _hasFetchedAll.current = false;
158
157
  return loadPage(getCurrentPage(data.pages, _lastFetchedPage.current), sorting, _lastUsedFilters.current, _lastUsedSearch.current, _lastUsedHiddenColumns.current, true);
159
158
  } catch (e) {
160
159
  return Promise.reject(e);
161
160
  }
162
161
  };
163
- const handleFilter = function (filters, hiddenColumns) {
162
+ var handleFilter = function handleFilter(filters, hiddenColumns) {
164
163
  try {
165
- _lastUsedFilters.current = filters;
166
- _lastUsedHiddenColumns.current = hiddenColumns;
167
- // reset stuff
164
+ // reset before loading the current page
168
165
  _pendingPageRequests.current = {};
169
- _hasFetchedAll.current = false;
170
166
  return loadPage(getCurrentPage(data.pages, _lastFetchedPage.current), _lastUsedSorting.current, filters, _lastUsedSearch.current, hiddenColumns, true);
171
167
  } catch (e) {
172
168
  return Promise.reject(e);
173
169
  }
174
170
  };
175
- const handleSearch = function (search, hiddenColumns) {
171
+ var handleSearch = function handleSearch(search, hiddenColumns) {
176
172
  try {
177
- _lastUsedSearch.current = search;
178
- _lastUsedHiddenColumns.current = hiddenColumns;
179
- // reset stuff
173
+ // reset before loading the current page
180
174
  _pendingPageRequests.current = {};
181
- _hasFetchedAll.current = false;
182
175
  return loadPage(getCurrentPage(data.pages, _lastFetchedPage.current), _lastUsedSorting.current, _lastUsedFilters.current, search, hiddenColumns, true);
183
176
  } catch (e) {
184
177
  return Promise.reject(e);
@@ -188,12 +181,12 @@ function useTableDataLoader2(fetchPage, fetchAll, options = {
188
181
  data: data.rows,
189
182
  pages: data.pages,
190
183
  length: length.current,
191
- loadAll,
192
- loadPage,
184
+ loadAll: loadAll,
185
+ loadPage: loadPage,
193
186
  onChangeFilter: handleFilter,
194
187
  onChangeSearch: handleSearch,
195
188
  onChangeSort: handleSort,
196
- pageSize,
189
+ pageSize: pageSize,
197
190
  _experimentalDataLoader2: true
198
191
  }, invalidate];
199
192
  }
@@ -202,7 +195,7 @@ function getCurrentPage(currentPages, lastFetchedPage) {
202
195
  var _currentPages$;
203
196
  return (_currentPages$ = currentPages[0]) !== null && _currentPages$ !== void 0 ? _currentPages$ : 0;
204
197
  }
205
- const middle = Math.floor(DATASET_SIZE_MULTIPLIER / 2);
198
+ var middle = Math.floor(DATASET_SIZE_MULTIPLIER / 2);
206
199
  if (lastFetchedPage.index) {
207
200
  if (!lastFetchedPage.direction) {
208
201
  return lastFetchedPage.index;
@@ -231,12 +224,12 @@ function getPages(pageIndex, lastUsedPage, currentPages, direction) {
231
224
  return currentPages;
232
225
  }
233
226
  if (direction === 'forward') {
234
- const nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(1) : currentPages;
227
+ var nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(1) : currentPages;
235
228
  return nextPages.concat(pageIndex);
236
229
  }
237
230
  if (direction === 'backward') {
238
- const nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(0, -1) : currentPages;
239
- return [pageIndex].concat(nextPages);
231
+ var _nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(0, -1) : currentPages;
232
+ return [pageIndex].concat(_nextPages);
240
233
  }
241
234
  if (pageIndex === 0) {
242
235
  return [0];
@@ -1 +1 @@
1
- {"version":3,"file":"useTableDataLoader2.js","sources":["../../../../../../../src/primitives/Table/useTableDataLoader2.ts"],"sourcesContent":["import React from 'react';\nimport {\n TableColumnFilter,\n TableColumnSort,\n TableFilterHandler,\n TableServerLoadPageHandler,\n TableServerLoadAllHandler,\n TableSortHandler,\n TableSearchHandler,\n} from './types';\nimport { DEFAULT_PAGE_SIZE, useTableDataLoaderOptions } from './useTableDataLoader';\n\nconst DATASET_SIZE_MULTIPLIER = 15;\n\nexport type useTableDataPageFetcher2<TType = unknown> = (\n pageIndex: number,\n pageSize: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTableDataAllFetcher2<TType = unknown> = (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTableDataLoaderValues2<TType = unknown> = {\n data: TType[];\n length: number | undefined;\n loadAll: TableServerLoadAllHandler;\n loadPage: TableServerLoadPageHandler;\n onChangeFilter: TableFilterHandler;\n onChangeSearch: TableSearchHandler;\n onChangeSort: TableSortHandler;\n pageSize: number;\n pages: number[];\n _experimentalDataLoader2: boolean;\n};\n\ntype Data<TType = unknown> = {\n rows: TType[];\n pages: number[];\n};\ntype Direction = 'forward' | 'backward' | undefined;\ntype LastFetchedPage = {\n index: number | undefined;\n direction: Direction;\n};\n\nexport function useTableDataLoader2<TType = unknown>(\n fetchPage: useTableDataPageFetcher2<TType>,\n fetchAll: useTableDataAllFetcher2<TType>,\n options: useTableDataLoaderOptions = { pageSize: DEFAULT_PAGE_SIZE }\n): [useTableDataLoaderValues2<TType>, () => void] {\n const { pageSize } = options;\n const DATASET_SIZE = DATASET_SIZE_MULTIPLIER * pageSize;\n\n // track the data length, we don't know it until the first request\n const length = React.useRef<number>(0);\n // data will be filled after the first request\n const [data, setData] = React.useState<Data<TType>>({ rows: [], pages: [] });\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 | undefined>();\n const _lastUsedHiddenColumns = React.useRef<string[]>([]);\n const _lastFetchedPage = React.useRef<LastFetchedPage>({\n index: undefined,\n direction: undefined,\n });\n const _hasFetchedAll = React.useRef<boolean>(false);\n\n async function loadPage(\n pageIndex: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[],\n reset = false\n ) {\n if (_hasFetchedAll.current) {\n return;\n }\n\n // if page is already loading, abort, otherwise mark it as loading\n if (_pendingPageRequests.current[pageIndex]) {\n return;\n } else {\n _pendingPageRequests.current[pageIndex] = true;\n }\n\n // if the page is already loaded and has actual rows, abort\n if (data.pages.includes(pageIndex)) {\n const position = data.pages.indexOf(pageIndex);\n\n if (data.rows[position * pageSize] !== undefined) {\n return;\n }\n }\n\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\n const direction = getDirection2(pageIndex, _lastFetchedPage.current);\n\n try {\n const response = await fetchPage(pageIndex, pageSize, sorting, filters, search, hiddenColumns);\n length.current = response.length;\n\n // update state, here we do some \"magic\" to support \"load in place\"\n setData(currentData => {\n const nextPages = getPages(pageIndex, _lastFetchedPage.current, reset ? [] : currentData.pages, direction);\n let nextRows = currentData.rows;\n\n if (reset || !direction) {\n const index = nextPages.indexOf(pageIndex);\n const startIndex = (index > -1 ? index : 0) * pageSize;\n\n if (reset) {\n nextRows = ([] as TType[]).concat(response.data);\n } else if (startIndex > 0 || pageIndex === 0) {\n nextRows = Array(startIndex).fill(undefined).concat(response.data);\n } else if (startIndex === 0) {\n nextRows = response.data.concat(currentData.rows.slice(pageSize));\n }\n } else if (direction === 'forward') {\n // if the new data will exceed the dataset size, then chop off the start or end\n // this keeps the stored dataset to our preferred size\n if (currentData.rows.length >= DATASET_SIZE) {\n nextRows = currentData.rows.slice(DEFAULT_PAGE_SIZE).concat(response.data);\n } else {\n nextRows = currentData.rows.concat(response.data);\n }\n } else if (direction === 'backward') {\n if (currentData.rows.length >= DATASET_SIZE) {\n nextRows = response.data.concat(currentData.rows.slice(0, -1 * pageSize));\n } else {\n nextRows = currentData.rows.concat(response.data);\n }\n }\n\n return {\n rows: nextRows,\n pages: nextPages,\n };\n });\n } catch {\n //\n } finally {\n _hasFetchedAll.current = false;\n // reset pending requests\n delete _pendingPageRequests.current[pageIndex];\n // update the last loaded page\n _lastFetchedPage.current = {\n index: pageIndex,\n direction,\n };\n }\n }\n\n const loadAll = async (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n ) => {\n _hasFetchedAll.current = true;\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\n try {\n const response = await fetchAll(sorting, filters, search, hiddenColumns);\n length.current = response.length;\n\n setData({\n rows: response.data,\n pages: Array.from(Array(response.length / pageSize).keys()),\n });\n } catch {\n //\n } finally {\n // reset pending requests\n _pendingPageRequests.current = {};\n }\n };\n\n const invalidate = async () => {\n // reset stuff\n _pendingPageRequests.current = {};\n _hasFetchedAll.current = false;\n\n // load the last page that we scrolled to\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n _lastUsedFilters.current,\n _lastUsedSearch.current,\n _lastUsedHiddenColumns.current,\n true\n );\n };\n\n // search works client side - it fetches all then works client side - so these handlers are a little \"weird\"\n // if a search is currently \"active\", we need to re load all because\n const handleSort = async (sorting: TableColumnSort[]) => {\n _lastUsedSorting.current = sorting;\n // reset stuff\n _pendingPageRequests.current = {};\n _hasFetchedAll.current = false;\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n sorting,\n _lastUsedFilters.current,\n _lastUsedSearch.current,\n _lastUsedHiddenColumns.current,\n true\n );\n };\n const handleFilter = async (filters: TableColumnFilter[], hiddenColumns: string[]) => {\n _lastUsedFilters.current = filters;\n _lastUsedHiddenColumns.current = hiddenColumns;\n\n // reset stuff\n _pendingPageRequests.current = {};\n _hasFetchedAll.current = false;\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n filters,\n _lastUsedSearch.current,\n hiddenColumns,\n true\n );\n };\n const handleSearch = async (search: string | undefined, hiddenColumns: string[]) => {\n _lastUsedSearch.current = search;\n _lastUsedHiddenColumns.current = hiddenColumns;\n\n // reset stuff\n _pendingPageRequests.current = {};\n _hasFetchedAll.current = false;\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n _lastUsedFilters.current,\n search,\n hiddenColumns,\n true\n );\n };\n\n return [\n {\n data: data.rows,\n pages: data.pages,\n length: length.current,\n loadAll,\n loadPage,\n onChangeFilter: handleFilter,\n onChangeSearch: handleSearch,\n onChangeSort: handleSort,\n pageSize,\n _experimentalDataLoader2: true,\n },\n invalidate,\n ];\n}\n\nfunction getCurrentPage(currentPages: number[], lastFetchedPage: LastFetchedPage): number {\n if (currentPages.length <= 2) {\n return currentPages[0] ?? 0;\n }\n\n const middle = Math.floor(DATASET_SIZE_MULTIPLIER / 2);\n\n if (lastFetchedPage.index) {\n if (!lastFetchedPage.direction) {\n return lastFetchedPage.index;\n }\n\n return lastFetchedPage.direction === 'forward' ? lastFetchedPage.index + middle : lastFetchedPage.index - middle;\n }\n\n return 0;\n}\n\nfunction getDirection2(pageIndex: number, lastUsedPage: LastFetchedPage): Direction {\n if (lastUsedPage.index === undefined) {\n return undefined;\n }\n\n if (pageIndex > lastUsedPage.index) {\n if (lastUsedPage.index + 1 === pageIndex || lastUsedPage.index + DATASET_SIZE_MULTIPLIER === pageIndex) {\n return 'forward';\n }\n } else if (pageIndex < lastUsedPage.index) {\n if (lastUsedPage.index - 1 === pageIndex || lastUsedPage.index - DATASET_SIZE_MULTIPLIER === pageIndex) {\n return 'backward';\n }\n }\n\n return undefined;\n}\n\nfunction getPages(pageIndex: number, lastUsedPage: LastFetchedPage, currentPages: number[], direction: Direction) {\n if (currentPages.length && (pageIndex === lastUsedPage.index || currentPages.includes(pageIndex))) {\n return currentPages;\n }\n\n if (direction === 'forward') {\n const nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(1) : currentPages;\n return nextPages.concat(pageIndex);\n }\n\n if (direction === 'backward') {\n const nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(0, -1) : currentPages;\n return [pageIndex].concat(nextPages);\n }\n\n if (pageIndex === 0) {\n return [0];\n }\n\n // don't go forward, the current page will trigger load of the next page\n return [pageIndex - 1, pageIndex];\n}\n"],"names":["DATASET_SIZE_MULTIPLIER","useTableDataLoader2","fetchPage","fetchAll","options","pageSize","DEFAULT_PAGE_SIZE","loadPage","pageIndex","sorting","filters","search","hiddenColumns","reset","_hasFetchedAll","current","Promise","resolve","_pendingPageRequests","data","pages","includes","position","indexOf","rows","undefined","_lastUsedSorting","_lastUsedFilters","direction","getDirection2","_lastFetchedPage","_temp2","_finallyRethrows","_catch","then","response","length","setData","currentData","nextPages","getPages","nextRows","index","startIndex","concat","Array","fill","slice","DATASET_SIZE","_wasThrown2","_result2","e","reject","React","useRef","useState","_lastUsedSearch","_lastUsedHiddenColumns","loadAll","_temp","from","keys","_wasThrown","_result","invalidate","getCurrentPage","handleSort","handleFilter","handleSearch","onChangeFilter","onChangeSearch","onChangeSort","_experimentalDataLoader2","currentPages","lastFetchedPage","_currentPages$","middle","Math","floor","lastUsedPage"],"mappings":";;;;AAYA,MAAMA,uBAAuB,GAAG,EAAE;SAyClBC,mBAAmBA,CAC/BC,SAA0C,EAC1CC,QAAwC,EACxCC,UAAqC;EAAEC,QAAQ,EAAEC;CAAmB;QAqBrDC,QAAQ,aACnBC,SAAiB,EACjBC,OAA0B,EAC1BC,OAA4B,EAC5BC,MAA0B,EAC1BC,aAAuB,EACvBC,KAAK,GAAG,KAAK;IAAA;MAEb,IAAIC,cAAc,CAACC,OAAO,EAAE;QACxB,OAAAC,OAAA,CAAAC,OAAA;;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AAE,CAAC,CAAC,CAAC,GAAG0B,YAAY;IAC5G,OAAO,CAACjE,SAAS,CAAC,CAACoC,MAAM,CAACL,SAAS,CAAC;;EAGxC,IAAI/B,SAAS,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,CAAC,CAAC;;;EAId,OAAO,CAACA,SAAS,GAAG,CAAC,EAAEA,SAAS,CAAC;AACrC;;;;"}
1
+ {"version":3,"file":"useTableDataLoader2.js","sources":["../../../../../../../src/primitives/Table/useTableDataLoader2.ts"],"sourcesContent":["import React from 'react';\nimport {\n TableColumnFilter,\n TableColumnSort,\n TableFilterHandler,\n TableServerLoadPageHandler,\n TableServerLoadAllHandler,\n TableSortHandler,\n TableSearchHandler,\n} from './types';\nimport { DEFAULT_PAGE_SIZE, useTableDataLoaderOptions } from './useTableDataLoader';\n\nconst DATASET_SIZE_MULTIPLIER = 15;\n\nexport type useTableDataPageFetcher2<TType = unknown> = (\n pageIndex: number,\n pageSize: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTableDataAllFetcher2<TType = unknown> = (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTableDataLoaderValues2<TType = unknown> = {\n data: TType[];\n length: number | undefined;\n loadAll: TableServerLoadAllHandler;\n loadPage: TableServerLoadPageHandler;\n onChangeFilter: TableFilterHandler;\n onChangeSearch: TableSearchHandler;\n onChangeSort: TableSortHandler;\n pageSize: number;\n pages: number[];\n _experimentalDataLoader2: boolean;\n};\n\ntype Data<TType = unknown> = {\n rows: TType[];\n pages: number[];\n};\ntype Direction = 'forward' | 'backward' | undefined;\ntype LastFetchedPage = {\n index: number | undefined;\n direction: Direction;\n};\n\nexport function useTableDataLoader2<TType = unknown>(\n fetchPage: useTableDataPageFetcher2<TType>,\n fetchAll: useTableDataAllFetcher2<TType>,\n options: useTableDataLoaderOptions = { pageSize: DEFAULT_PAGE_SIZE }\n): [useTableDataLoaderValues2<TType>, () => void] {\n const { pageSize } = options;\n const DATASET_SIZE = DATASET_SIZE_MULTIPLIER * pageSize;\n\n // track the data length, we don't know it until the first request\n const length = React.useRef<number>(0);\n // data will be filled after the first request\n const [data, setData] = React.useState<Data<TType>>({ rows: [], pages: [] });\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 | undefined>();\n const _lastUsedHiddenColumns = React.useRef<string[]>([]);\n const _lastFetchedPage = React.useRef<LastFetchedPage>({\n index: undefined,\n direction: undefined,\n });\n\n async function loadPage(\n pageIndex: number,\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[],\n reset = false\n ) {\n if (_pendingPageRequests.current[pageIndex] && !reset) {\n return;\n }\n\n const hasChangedData =\n JSON.stringify(sorting) !== JSON.stringify(_lastUsedSorting.current) ||\n JSON.stringify(filters) !== JSON.stringify(_lastUsedFilters.current) ||\n search !== _lastUsedSearch.current;\n\n // set values so we can track if they changed between loads\n _lastUsedSorting.current = sorting;\n _lastUsedFilters.current = filters;\n _lastUsedSearch.current = search;\n _lastUsedHiddenColumns.current = hiddenColumns;\n\n // if the page is already loaded and has actual rows, abort\n if (data.pages.includes(pageIndex) && !hasChangedData && !reset) {\n const position = data.pages.indexOf(pageIndex);\n\n if (data.rows[position * pageSize] !== undefined) {\n return;\n }\n }\n\n // set the page as loading, so that subsequent requests don't retrigger it\n _pendingPageRequests.current[pageIndex] = true;\n\n const direction = getDirection2(pageIndex, _lastFetchedPage.current);\n\n try {\n const response = await fetchPage(pageIndex, pageSize, sorting, filters, search, hiddenColumns);\n length.current = response.length;\n\n // update state, here we do some \"magic\" to support \"load in place\"\n setData(currentData => {\n const nextPages = getPages(pageIndex, _lastFetchedPage.current, reset ? [] : currentData.pages, direction);\n let nextRows = currentData.rows;\n\n if (reset || !direction) {\n const index = nextPages.indexOf(pageIndex);\n const startIndex = (index > -1 ? index : 0) * pageSize;\n\n if (reset) {\n nextRows = ([] as TType[]).concat(response.data);\n } else if (startIndex > 0 || pageIndex === 0) {\n nextRows = Array(startIndex).fill(undefined).concat(response.data);\n } else if (startIndex === 0) {\n nextRows = response.data.concat(currentData.rows.slice(pageSize));\n }\n } else if (direction === 'forward') {\n // if the new data will exceed the dataset size, then chop off the start or end\n // this keeps the stored dataset to our preferred size\n if (currentData.rows.length >= DATASET_SIZE) {\n nextRows = currentData.rows.slice(DEFAULT_PAGE_SIZE).concat(response.data);\n } else {\n nextRows = currentData.rows.concat(response.data);\n }\n } else if (direction === 'backward') {\n if (currentData.rows.length >= DATASET_SIZE) {\n nextRows = response.data.concat(currentData.rows.slice(0, -1 * pageSize));\n } else {\n nextRows = currentData.rows.concat(response.data);\n }\n }\n\n return {\n rows: nextRows,\n pages: nextPages,\n };\n });\n } catch {\n //\n } finally {\n // reset pending requests\n delete _pendingPageRequests.current[pageIndex];\n // update the last loaded page\n _lastFetchedPage.current = {\n index: pageIndex,\n direction,\n };\n }\n }\n\n const loadAll = async (\n sorting: TableColumnSort[],\n filters: TableColumnFilter[],\n search: string | undefined,\n hiddenColumns: string[]\n ) => {\n // set values so we can track if they changed between loads\n _lastUsedSorting.current = sorting;\n _lastUsedFilters.current = filters;\n _lastUsedSearch.current = search;\n _lastUsedHiddenColumns.current = hiddenColumns;\n\n try {\n const response = await fetchAll(sorting, filters, search, hiddenColumns);\n length.current = response.length;\n\n setData({\n rows: response.data,\n pages: Array.from(Array(response.length / pageSize).keys()),\n });\n } catch {\n //\n } finally {\n // reset pending requests\n _pendingPageRequests.current = {};\n }\n };\n\n const invalidate = async () => {\n console.log('invalidate');\n // reset stuff\n _pendingPageRequests.current = {};\n\n // load the current page again\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n _lastUsedFilters.current,\n _lastUsedSearch.current,\n _lastUsedHiddenColumns.current,\n true\n );\n };\n\n const handleSort = async (sorting: TableColumnSort[]) => {\n // reset before loading the current page\n _pendingPageRequests.current = {};\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n sorting,\n _lastUsedFilters.current,\n _lastUsedSearch.current,\n _lastUsedHiddenColumns.current,\n true\n );\n };\n const handleFilter = async (filters: TableColumnFilter[], hiddenColumns: string[]) => {\n // reset before loading the current page\n _pendingPageRequests.current = {};\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n filters,\n _lastUsedSearch.current,\n hiddenColumns,\n true\n );\n };\n const handleSearch = async (search: string | undefined, hiddenColumns: string[]) => {\n // reset before loading the current page\n _pendingPageRequests.current = {};\n\n return loadPage(\n getCurrentPage(data.pages, _lastFetchedPage.current),\n _lastUsedSorting.current,\n _lastUsedFilters.current,\n search,\n hiddenColumns,\n true\n );\n };\n\n return [\n {\n data: data.rows,\n pages: data.pages,\n length: length.current,\n loadAll,\n loadPage,\n onChangeFilter: handleFilter,\n onChangeSearch: handleSearch,\n onChangeSort: handleSort,\n pageSize,\n _experimentalDataLoader2: true,\n },\n invalidate,\n ];\n}\n\nfunction getCurrentPage(currentPages: number[], lastFetchedPage: LastFetchedPage): number {\n if (currentPages.length <= 2) {\n return currentPages[0] ?? 0;\n }\n\n const middle = Math.floor(DATASET_SIZE_MULTIPLIER / 2);\n\n if (lastFetchedPage.index) {\n if (!lastFetchedPage.direction) {\n return lastFetchedPage.index;\n }\n\n return lastFetchedPage.direction === 'forward' ? lastFetchedPage.index + middle : lastFetchedPage.index - middle;\n }\n\n return 0;\n}\n\nfunction getDirection2(pageIndex: number, lastUsedPage: LastFetchedPage): Direction {\n if (lastUsedPage.index === undefined) {\n return undefined;\n }\n\n if (pageIndex > lastUsedPage.index) {\n if (lastUsedPage.index + 1 === pageIndex || lastUsedPage.index + DATASET_SIZE_MULTIPLIER === pageIndex) {\n return 'forward';\n }\n } else if (pageIndex < lastUsedPage.index) {\n if (lastUsedPage.index - 1 === pageIndex || lastUsedPage.index - DATASET_SIZE_MULTIPLIER === pageIndex) {\n return 'backward';\n }\n }\n\n return undefined;\n}\n\nfunction getPages(pageIndex: number, lastUsedPage: LastFetchedPage, currentPages: number[], direction: Direction) {\n if (currentPages.length && (pageIndex === lastUsedPage.index || currentPages.includes(pageIndex))) {\n return currentPages;\n }\n\n if (direction === 'forward') {\n const nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(1) : currentPages;\n return nextPages.concat(pageIndex);\n }\n\n if (direction === 'backward') {\n const nextPages = currentPages.length === DATASET_SIZE_MULTIPLIER ? currentPages.slice(0, -1) : currentPages;\n return [pageIndex].concat(nextPages);\n }\n\n if (pageIndex === 0) {\n return [0];\n }\n\n // don't go forward, the current page will trigger load of the next page\n return [pageIndex - 1, pageIndex];\n}\n"],"names":["DATASET_SIZE_MULTIPLIER","useTableDataLoader2","fetchPage","fetchAll","options","loadPage","pageIndex","sorting","filters","search","hiddenColumns","reset","_pendingPageRequests","current","Promise","resolve","hasChangedData","JSON","stringify","_lastUsedSorting","_lastUsedFilters","_lastUsedSearch","_lastUsedHiddenColumns","data","pages","includes","position","indexOf","rows","pageSize","undefined","direction","getDirection2","_lastFetchedPage","_temp2","_finallyRethrows","_catch","then","response","length","setData","currentData","nextPages","getPages","nextRows","index","startIndex","concat","Array","fill","slice","DATASET_SIZE","DEFAULT_PAGE_SIZE","_wasThrown2","_result2","e","reject","_options","React","useRef","_React$useState","useState","loadAll","_temp","from","keys","_wasThrown","_result","invalidate","console","log","getCurrentPage","handleSort","handleFilter","handleSearch","onChangeFilter","onChangeSearch","onChangeSort","_experimentalDataLoader2","currentPages","lastFetchedPage","_currentPages$","middle","Math","floor","lastUsedPage"],"mappings":";;;;AAYA,IAAMA,uBAAuB,GAAG,EAAE;SAyClBC,mBAAmBA,CAC/B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AAY,CAACtD,QAAQ,CAACnB,SAAS,CAAC,CAAC,EAAE;IAC/F,OAAOyE,YAAY;;EAGvB,IAAIhD,SAAS,KAAK,SAAS,EAAE;IACzB,IAAMW,SAAS,GAAGqC,YAAY,CAACxC,MAAM,KAAKvC,uBAAuB,GAAG+E,YAAY,CAAC7B,KAAK,CAAC,CAAC,CAAC,GAAG6B,YAAY;IACxG,OAAOrC,SAAS,CAACK,MAAM,CAACzC,SAAS,CAAC;;EAGtC,IAAIyB,SAAS,KAAK,UAAU,EAAE;IAC1B,IAAMW,UAAS,GAAGqC,YAAY,CAACxC,MAAM,KAAKvC,uBAAuB,GAAG+E,YAAY,CAAC7B,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG6B,YAAY;IAC5G,OAAO,CAACzE,SAAS,CAAC,CAACyC,MAAM,CAACL,UAAS,CAAC;;EAGxC,IAAIpC,SAAS,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,CAAC,CAAC;;;EAId,OAAO,CAACA,SAAS,GAAG,CAAC,EAAEA,SAAS,CAAC;AACrC;;;;"}
@@ -1,9 +1,14 @@
1
1
  import React__default from 'react';
2
2
 
3
3
  /* column freezing uses the native column pinning feature, this hook is really just a container for scrolled state */
4
- function useTableColumnFreezing(isEnabled = false) {
5
- const [isHorizontallyScrolled, setHorizontallyScrolled] = React__default.useState(false);
6
- const handleScroll = event => {
4
+ function useTableColumnFreezing(isEnabled) {
5
+ if (isEnabled === void 0) {
6
+ isEnabled = false;
7
+ }
8
+ var _React$useState = React__default.useState(false),
9
+ isHorizontallyScrolled = _React$useState[0],
10
+ setHorizontallyScrolled = _React$useState[1];
11
+ var handleScroll = function handleScroll(event) {
7
12
  if (event.currentTarget.scrollLeft > 0 && !isHorizontallyScrolled) {
8
13
  setHorizontallyScrolled(true);
9
14
  } else if (event.currentTarget.scrollLeft === 0 && isHorizontallyScrolled) {
@@ -11,9 +16,9 @@ function useTableColumnFreezing(isEnabled = false) {
11
16
  }
12
17
  };
13
18
  return {
14
- isEnabled,
15
- isHorizontallyScrolled,
16
- handleScroll
19
+ isEnabled: isEnabled,
20
+ isHorizontallyScrolled: isHorizontallyScrolled,
21
+ handleScroll: handleScroll
17
22
  };
18
23
  }
19
24
 
@@ -1 +1 @@
1
- {"version":3,"file":"useTableColumnFreezing.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableColumnFreezing.ts"],"sourcesContent":["import React from 'react';\n\n/* column freezing uses the native column pinning feature, this hook is really just a container for scrolled state */\nexport function useTableColumnFreezing(isEnabled = false) {\n const [isHorizontallyScrolled, setHorizontallyScrolled] = React.useState(false);\n\n const handleScroll = (event: React.MouseEvent<HTMLTableElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !isHorizontallyScrolled) {\n setHorizontallyScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && isHorizontallyScrolled) {\n setHorizontallyScrolled(false);\n }\n };\n\n return {\n isEnabled,\n isHorizontallyScrolled,\n handleScroll,\n };\n}\n"],"names":["useTableColumnFreezing","isEnabled","isHorizontallyScrolled","setHorizontallyScrolled","React","useState","handleScroll","event","currentTarget","scrollLeft"],"mappings":";;AAEA;SACgBA,sBAAsBA,CAACC,SAAS,GAAG,KAAK;EACpD,MAAM,CAACC,sBAAsB,EAAEC,uBAAuB,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;EAE/E,MAAMC,YAAY,GAAIC,KAAyC;IAC3D,IAAIA,KAAK,CAACC,aAAa,CAACC,UAAU,GAAG,CAAC,IAAI,CAACP,sBAAsB,EAAE;MAC/DC,uBAAuB,CAAC,IAAI,CAAC;KAChC,MAAM,IAAII,KAAK,CAACC,aAAa,CAACC,UAAU,KAAK,CAAC,IAAIP,sBAAsB,EAAE;MACvEC,uBAAuB,CAAC,KAAK,CAAC;;GAErC;EAED,OAAO;IACHF,SAAS;IACTC,sBAAsB;IACtBI;GACH;AACL;;;;"}
1
+ {"version":3,"file":"useTableColumnFreezing.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableColumnFreezing.ts"],"sourcesContent":["import React from 'react';\n\n/* column freezing uses the native column pinning feature, this hook is really just a container for scrolled state */\nexport function useTableColumnFreezing(isEnabled = false) {\n const [isHorizontallyScrolled, setHorizontallyScrolled] = React.useState(false);\n\n const handleScroll = (event: React.MouseEvent<HTMLTableElement>) => {\n if (event.currentTarget.scrollLeft > 0 && !isHorizontallyScrolled) {\n setHorizontallyScrolled(true);\n } else if (event.currentTarget.scrollLeft === 0 && isHorizontallyScrolled) {\n setHorizontallyScrolled(false);\n }\n };\n\n return {\n isEnabled,\n isHorizontallyScrolled,\n handleScroll,\n };\n}\n"],"names":["useTableColumnFreezing","isEnabled","_React$useState","React","useState","isHorizontallyScrolled","setHorizontallyScrolled","handleScroll","event","currentTarget","scrollLeft"],"mappings":";;AAEA;SACgBA,sBAAsBA,CAACC,SAAS;MAATA,SAAS;IAATA,SAAS,GAAG,KAAK;;EACpD,IAAAC,eAAA,GAA0DC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;IAAxEC,sBAAsB,GAAAH,eAAA;IAAEI,uBAAuB,GAAAJ,eAAA;EAEtD,IAAMK,YAAY,GAAG,SAAfA,YAAYA,CAAIC,KAAyC;IAC3D,IAAIA,KAAK,CAACC,aAAa,CAACC,UAAU,GAAG,CAAC,IAAI,CAACL,sBAAsB,EAAE;MAC/DC,uBAAuB,CAAC,IAAI,CAAC;KAChC,MAAM,IAAIE,KAAK,CAACC,aAAa,CAACC,UAAU,KAAK,CAAC,IAAIL,sBAAsB,EAAE;MACvEC,uBAAuB,CAAC,KAAK,CAAC;;GAErC;EAED,OAAO;IACHL,SAAS,EAATA,SAAS;IACTI,sBAAsB,EAAtBA,sBAAsB;IACtBE,YAAY,EAAZA;GACH;AACL;;;;"}
@@ -1,6 +1,9 @@
1
- function useTableColumnOrdering(isEnabled = false) {
1
+ function useTableColumnOrdering(isEnabled) {
2
+ if (isEnabled === void 0) {
3
+ isEnabled = false;
4
+ }
2
5
  return {
3
- isEnabled
6
+ isEnabled: isEnabled
4
7
  };
5
8
  }
6
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"useTableColumnOrdering.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/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
+ {"version":3,"file":"useTableColumnOrdering.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableColumnOrdering.ts"],"sourcesContent":["export function useTableColumnOrdering(isEnabled = false) {\n return {\n isEnabled,\n };\n}\n"],"names":["useTableColumnOrdering","isEnabled"],"mappings":"SAAgBA,sBAAsBA,CAACC,SAAS;MAATA,SAAS;IAATA,SAAS,GAAG,KAAK;;EACpD,OAAO;IACHA,SAAS,EAATA;GACH;AACL;;;;"}
@@ -1,11 +1,21 @@
1
1
  import React__default from 'react';
2
2
 
3
- function useTableFontSize(isEnabled = false, defaultFontSize = 'medium') {
4
- const [size, setSize] = React__default.useState(defaultFontSize);
3
+ function useTableFontSize(isEnabled, defaultFontSize) {
4
+ if (isEnabled === void 0) {
5
+ isEnabled = false;
6
+ }
7
+ if (defaultFontSize === void 0) {
8
+ defaultFontSize = 'medium';
9
+ }
10
+ var _React$useState = React__default.useState(defaultFontSize),
11
+ size = _React$useState[0],
12
+ setSize = _React$useState[1];
5
13
  return {
6
- isEnabled,
7
- size,
8
- setSize: isEnabled ? setSize : () => undefined
14
+ isEnabled: isEnabled,
15
+ size: size,
16
+ setSize: isEnabled ? setSize : function () {
17
+ return undefined;
18
+ }
9
19
  };
10
20
  }
11
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"useTableFontSize.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/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
+ {"version":3,"file":"useTableFontSize.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/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","_React$useState","React","useState","size","setSize","undefined"],"mappings":";;SAGgBA,gBAAgBA,CAACC,SAAS,EAAUC;MAAnBD,SAAS;IAATA,SAAS,GAAG,KAAK;;EAAA,IAAEC;IAAAA,kBAA4B,QAAQ;;EACpF,IAAAC,eAAA,GAAwBC,cAAK,CAACC,QAAQ,CAAWH,eAAe,CAAC;IAA1DI,IAAI,GAAAH,eAAA;IAAEI,OAAO,GAAAJ,eAAA;EAEpB,OAAO;IACHF,SAAS,EAATA,SAAS;IACTK,IAAI,EAAJA,IAAI;IACJC,OAAO,EAAEN,SAAS,GAAGM,OAAO,GAAG;MAAA,OAAMC,SAAS;;GACjD;AACL;;;;"}
@@ -1,6 +1,9 @@
1
- function useTableFooter(isEnabled = false) {
1
+ function useTableFooter(isEnabled) {
2
+ if (isEnabled === void 0) {
3
+ isEnabled = false;
4
+ }
2
5
  return {
3
- isEnabled
6
+ isEnabled: isEnabled
4
7
  };
5
8
  }
6
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"useTableFooter.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableFooter.ts"],"sourcesContent":["export function useTableFooter(isEnabled = false) {\n return {\n isEnabled,\n };\n}\n"],"names":["useTableFooter","isEnabled"],"mappings":"SAAgBA,cAAcA,CAACC,SAAS,GAAG,KAAK;EAC5C,OAAO;IACHA;GACH;AACL;;;;"}
1
+ {"version":3,"file":"useTableFooter.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableFooter.ts"],"sourcesContent":["export function useTableFooter(isEnabled = false) {\n return {\n isEnabled,\n };\n}\n"],"names":["useTableFooter","isEnabled"],"mappings":"SAAgBA,cAAcA,CAACC,SAAS;MAATA,SAAS;IAATA,SAAS,GAAG,KAAK;;EAC5C,OAAO;IACHA,SAAS,EAATA;GACH;AACL;;;;"}
@@ -1,33 +1,43 @@
1
1
  import React__default from 'react';
2
+ import { extends as _extends } from '../../../../../../../_virtual/_rollupPluginBabelHelpers.js';
2
3
  import { useTacoSettings } from '../../../../hooks/useTacoSettings.js';
3
4
  import { useLocalStorage } from '../../../../hooks/useLocalStorage.js';
4
5
 
5
- function useTablePrinting(isEnabled = false, tableId) {
6
- const [isPrinting, setIsPrinting] = React__default.useState(false);
7
- const [settings, setSetting] = useTablePrintingSettings(tableId);
6
+ function useTablePrinting(isEnabled, tableId) {
7
+ if (isEnabled === void 0) {
8
+ isEnabled = false;
9
+ }
10
+ var _React$useState = React__default.useState(false),
11
+ isPrinting = _React$useState[0],
12
+ setIsPrinting = _React$useState[1];
13
+ var _useTablePrintingSett = useTablePrintingSettings(tableId),
14
+ settings = _useTablePrintingSett[0],
15
+ setSetting = _useTablePrintingSett[1];
8
16
  return {
9
- isEnabled,
10
- isPrinting,
11
- setIsPrinting,
12
- settings,
13
- setSetting
17
+ isEnabled: isEnabled,
18
+ isPrinting: isPrinting,
19
+ setIsPrinting: setIsPrinting,
20
+ settings: settings,
21
+ setSetting: setSetting
14
22
  };
15
23
  }
16
- const DEFAULT_PRINT_SETTINGS = {
24
+ var DEFAULT_PRINT_SETTINGS = {
17
25
  size: 'A4',
18
26
  orientation: 'portrait',
19
27
  allRows: true,
20
28
  splitGroups: true
21
29
  };
22
30
  function useTablePrintingSettings(tableId) {
23
- const tacoSettings = useTacoSettings();
24
- const uniqueId = `taco.${tacoSettings.uniqueUserIdentifier}.table.${tableId}.print.settings`;
25
- const [persistedSettings, setPersistedSettings] = useLocalStorage(uniqueId, DEFAULT_PRINT_SETTINGS);
31
+ var tacoSettings = useTacoSettings();
32
+ var uniqueId = "taco." + tacoSettings.uniqueUserIdentifier + ".table." + tableId + ".print.settings";
33
+ var _useLocalStorage = useLocalStorage(uniqueId, DEFAULT_PRINT_SETTINGS),
34
+ persistedSettings = _useLocalStorage[0],
35
+ setPersistedSettings = _useLocalStorage[1];
26
36
  function setSetting(key, value) {
27
- setPersistedSettings(currentSettings => ({
28
- ...currentSettings,
29
- [key]: value
30
- }));
37
+ setPersistedSettings(function (currentSettings) {
38
+ var _extends2;
39
+ return _extends({}, currentSettings, (_extends2 = {}, _extends2[key] = value, _extends2));
40
+ });
31
41
  }
32
42
  return [persistedSettings, setSetting];
33
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useTablePrinting.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTablePrinting.ts"],"sourcesContent":["import React from 'react';\nimport { useTacoSettings } from '../../../../hooks/useTacoSettings';\nimport { useLocalStorage } from '../../../../hooks/useLocalStorage';\n\ntype TablePrintSettings = {\n allRows: boolean;\n orientation: 'portrait' | 'landscape';\n size: 'A3' | 'A4' | 'A5' | 'letter' | 'legal';\n splitGroups: boolean;\n};\n\nexport function useTablePrinting(isEnabled = false, tableId: string) {\n const [isPrinting, setIsPrinting] = React.useState(false);\n const [settings, setSetting] = useTablePrintingSettings(tableId);\n\n return {\n isEnabled,\n isPrinting,\n setIsPrinting,\n settings,\n setSetting,\n };\n}\n\nconst DEFAULT_PRINT_SETTINGS: TablePrintSettings = {\n size: 'A4',\n orientation: 'portrait',\n allRows: true,\n splitGroups: true,\n};\n\nfunction useTablePrintingSettings(tableId: string): [TablePrintSettings, (key: keyof TablePrintSettings, value: any) => void] {\n const tacoSettings = useTacoSettings();\n const uniqueId = `taco.${tacoSettings.uniqueUserIdentifier}.table.${tableId}.print.settings`;\n\n const [persistedSettings, setPersistedSettings] = useLocalStorage<TablePrintSettings>(uniqueId, DEFAULT_PRINT_SETTINGS);\n\n function setSetting(key: keyof TablePrintSettings, value: any) {\n setPersistedSettings(currentSettings => ({\n ...currentSettings,\n [key]: value,\n }));\n }\n\n return [persistedSettings, setSetting];\n}\n"],"names":["useTablePrinting","isEnabled","tableId","isPrinting","setIsPrinting","React","useState","settings","setSetting","useTablePrintingSettings","DEFAULT_PRINT_SETTINGS","size","orientation","allRows","splitGroups","tacoSettings","useTacoSettings","uniqueId","uniqueUserIdentifier","persistedSettings","setPersistedSettings","useLocalStorage","key","value","currentSettings"],"mappings":";;;;SAWgBA,gBAAgBA,CAACC,SAAS,GAAG,KAAK,EAAEC,OAAe;EAC/D,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;EACzD,MAAM,CAACC,QAAQ,EAAEC,UAAU,CAAC,GAAGC,wBAAwB,CAACP,OAAO,CAAC;EAEhE,OAAO;IACHD,SAAS;IACTE,UAAU;IACVC,aAAa;IACbG,QAAQ;IACRC;GACH;AACL;AAEA,MAAME,sBAAsB,GAAuB;EAC/CC,IAAI,EAAE,IAAI;EACVC,WAAW,EAAE,UAAU;EACvBC,OAAO,EAAE,IAAI;EACbC,WAAW,EAAE;CAChB;AAED,SAASL,wBAAwBA,CAACP,OAAe;EAC7C,MAAMa,YAAY,GAAGC,eAAe,EAAE;EACtC,MAAMC,QAAQ,GAAG,QAAQF,YAAY,CAACG,oBAAoB,UAAUhB,OAAO,iBAAiB;EAE5F,MAAM,CAACiB,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGC,eAAe,CAAqBJ,QAAQ,EAAEP,sBAAsB,CAAC;EAEvH,SAASF,UAAUA,CAACc,GAA6B,EAAEC,KAAU;IACzDH,oBAAoB,CAACI,eAAe,KAAK;MACrC,GAAGA,eAAe;MAClB,CAACF,GAAG,GAAGC;KACV,CAAC,CAAC;;EAGP,OAAO,CAACJ,iBAAiB,EAAEX,UAAU,CAAC;AAC1C;;;;"}
1
+ {"version":3,"file":"useTablePrinting.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTablePrinting.ts"],"sourcesContent":["import React from 'react';\nimport { useTacoSettings } from '../../../../hooks/useTacoSettings';\nimport { useLocalStorage } from '../../../../hooks/useLocalStorage';\n\ntype TablePrintSettings = {\n allRows: boolean;\n orientation: 'portrait' | 'landscape';\n size: 'A3' | 'A4' | 'A5' | 'letter' | 'legal';\n splitGroups: boolean;\n};\n\nexport function useTablePrinting(isEnabled = false, tableId: string) {\n const [isPrinting, setIsPrinting] = React.useState(false);\n const [settings, setSetting] = useTablePrintingSettings(tableId);\n\n return {\n isEnabled,\n isPrinting,\n setIsPrinting,\n settings,\n setSetting,\n };\n}\n\nconst DEFAULT_PRINT_SETTINGS: TablePrintSettings = {\n size: 'A4',\n orientation: 'portrait',\n allRows: true,\n splitGroups: true,\n};\n\nfunction useTablePrintingSettings(tableId: string): [TablePrintSettings, (key: keyof TablePrintSettings, value: any) => void] {\n const tacoSettings = useTacoSettings();\n const uniqueId = `taco.${tacoSettings.uniqueUserIdentifier}.table.${tableId}.print.settings`;\n\n const [persistedSettings, setPersistedSettings] = useLocalStorage<TablePrintSettings>(uniqueId, DEFAULT_PRINT_SETTINGS);\n\n function setSetting(key: keyof TablePrintSettings, value: any) {\n setPersistedSettings(currentSettings => ({\n ...currentSettings,\n [key]: value,\n }));\n }\n\n return [persistedSettings, setSetting];\n}\n"],"names":["useTablePrinting","isEnabled","tableId","_React$useState","React","useState","isPrinting","setIsPrinting","_useTablePrintingSett","useTablePrintingSettings","settings","setSetting","DEFAULT_PRINT_SETTINGS","size","orientation","allRows","splitGroups","tacoSettings","useTacoSettings","uniqueId","uniqueUserIdentifier","_useLocalStorage","useLocalStorage","persistedSettings","setPersistedSettings","key","value","currentSettings","_extends2","_extends"],"mappings":";;;;;SAWgBA,gBAAgBA,CAACC,SAAS,EAAUC,OAAe;MAAlCD,SAAS;IAATA,SAAS,GAAG,KAAK;;EAC9C,IAAAE,eAAA,GAAoCC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;IAAlDC,UAAU,GAAAH,eAAA;IAAEI,aAAa,GAAAJ,eAAA;EAChC,IAAAK,qBAAA,GAA+BC,wBAAwB,CAACP,OAAO,CAAC;IAAzDQ,QAAQ,GAAAF,qBAAA;IAAEG,UAAU,GAAAH,qBAAA;EAE3B,OAAO;IACHP,SAAS,EAATA,SAAS;IACTK,UAAU,EAAVA,UAAU;IACVC,aAAa,EAAbA,aAAa;IACbG,QAAQ,EAARA,QAAQ;IACRC,UAAU,EAAVA;GACH;AACL;AAEA,IAAMC,sBAAsB,GAAuB;EAC/CC,IAAI,EAAE,IAAI;EACVC,WAAW,EAAE,UAAU;EACvBC,OAAO,EAAE,IAAI;EACbC,WAAW,EAAE;CAChB;AAED,SAASP,wBAAwBA,CAACP,OAAe;EAC7C,IAAMe,YAAY,GAAGC,eAAe,EAAE;EACtC,IAAMC,QAAQ,aAAWF,YAAY,CAACG,oBAAoB,eAAUlB,OAAO,oBAAiB;EAE5F,IAAAmB,gBAAA,GAAkDC,eAAe,CAAqBH,QAAQ,EAAEP,sBAAsB,CAAC;IAAhHW,iBAAiB,GAAAF,gBAAA;IAAEG,oBAAoB,GAAAH,gBAAA;EAE9C,SAASV,UAAUA,CAACc,GAA6B,EAAEC,KAAU;IACzDF,oBAAoB,CAAC,UAAAG,eAAe;MAAA,IAAAC,SAAA;MAAA,OAAAC,QAAA,KAC7BF,eAAe,GAAAC,SAAA,OAAAA,SAAA,CACjBH,GAAG,IAAGC,KAAK,EAAAE,SAAA;KACd,CAAC;;EAGP,OAAO,CAACL,iBAAiB,EAAEZ,UAAU,CAAC;AAC1C;;;;"}
@@ -1,7 +1,13 @@
1
- const DEFAULT_ROW_ACTIONS_LENGTH = 4;
2
- function useTableRowActions(isEnabled = false, rowActions, rowActionsLength = DEFAULT_ROW_ACTIONS_LENGTH) {
1
+ var DEFAULT_ROW_ACTIONS_LENGTH = 4;
2
+ function useTableRowActions(isEnabled, rowActions, rowActionsLength) {
3
+ if (isEnabled === void 0) {
4
+ isEnabled = false;
5
+ }
6
+ if (rowActionsLength === void 0) {
7
+ rowActionsLength = DEFAULT_ROW_ACTIONS_LENGTH;
8
+ }
3
9
  return {
4
- isEnabled,
10
+ isEnabled: isEnabled,
5
11
  rowActions: isEnabled ? rowActions : undefined,
6
12
  rowActionsLength: rowActions ? Math.min(rowActions.length, rowActionsLength) : 0
7
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useTableRowActions.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableRowActions.ts"],"sourcesContent":["import { TableRowActionRenderer } from '../../types';\n\nconst DEFAULT_ROW_ACTIONS_LENGTH = 4;\n\nexport function useTableRowActions<TType = unknown>(\n isEnabled = false,\n rowActions?: TableRowActionRenderer<TType>[],\n rowActionsLength = DEFAULT_ROW_ACTIONS_LENGTH\n) {\n return {\n isEnabled,\n rowActions: isEnabled ? rowActions : undefined,\n rowActionsLength: rowActions ? Math.min(rowActions.length, rowActionsLength) : 0,\n };\n}\n"],"names":["DEFAULT_ROW_ACTIONS_LENGTH","useTableRowActions","isEnabled","rowActions","rowActionsLength","undefined","Math","min","length"],"mappings":"AAEA,MAAMA,0BAA0B,GAAG,CAAC;SAEpBC,kBAAkBA,CAC9BC,SAAS,GAAG,KAAK,EACjBC,UAA4C,EAC5CC,gBAAgB,GAAGJ,0BAA0B;EAE7C,OAAO;IACHE,SAAS;IACTC,UAAU,EAAED,SAAS,GAAGC,UAAU,GAAGE,SAAS;IAC9CD,gBAAgB,EAAED,UAAU,GAAGG,IAAI,CAACC,GAAG,CAACJ,UAAU,CAACK,MAAM,EAAEJ,gBAAgB,CAAC,GAAG;GAClF;AACL;;;;"}
1
+ {"version":3,"file":"useTableRowActions.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/features/useTableRowActions.ts"],"sourcesContent":["import { TableRowActionRenderer } from '../../types';\n\nconst DEFAULT_ROW_ACTIONS_LENGTH = 4;\n\nexport function useTableRowActions<TType = unknown>(\n isEnabled = false,\n rowActions?: TableRowActionRenderer<TType>[],\n rowActionsLength = DEFAULT_ROW_ACTIONS_LENGTH\n) {\n return {\n isEnabled,\n rowActions: isEnabled ? rowActions : undefined,\n rowActionsLength: rowActions ? Math.min(rowActions.length, rowActionsLength) : 0,\n };\n}\n"],"names":["DEFAULT_ROW_ACTIONS_LENGTH","useTableRowActions","isEnabled","rowActions","rowActionsLength","undefined","Math","min","length"],"mappings":"AAEA,IAAMA,0BAA0B,GAAG,CAAC;SAEpBC,kBAAkBA,CAC9BC,SAAS,EACTC,UAA4C,EAC5CC,gBAAgB;MAFhBF,SAAS;IAATA,SAAS,GAAG,KAAK;;EAAA,IAEjBE,gBAAgB;IAAhBA,gBAAgB,GAAGJ,0BAA0B;;EAE7C,OAAO;IACHE,SAAS,EAATA,SAAS;IACTC,UAAU,EAAED,SAAS,GAAGC,UAAU,GAAGE,SAAS;IAC9CD,gBAAgB,EAAED,UAAU,GAAGG,IAAI,CAACC,GAAG,CAACJ,UAAU,CAACK,MAAM,EAAEJ,gBAAgB,CAAC,GAAG;GAClF;AACL;;;;"}