@economic/taco 2.15.0 → 2.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (291) hide show
  1. package/dist/components/Drawer/Drawer.d.ts +5 -1
  2. package/dist/components/Provider/Localization.d.ts +19 -0
  3. package/dist/components/SearchInput2/SearchInput2.d.ts +1 -0
  4. package/dist/components/Table3/Table3.d.ts +0 -2
  5. package/dist/components/Table3/components/alert/ErrorAlert.d.ts +10 -0
  6. package/dist/components/Table3/components/columns/cell/DisplayCell.d.ts +5 -2
  7. package/dist/components/Table3/components/columns/cell/EditingCell.d.ts +3 -0
  8. package/dist/components/Table3/components/columns/cell/EditingControl.d.ts +1 -1
  9. package/dist/components/Table3/components/columns/cell/Highlight.d.ts +2 -0
  10. package/dist/components/Table3/components/columns/header/Header.d.ts +1 -1
  11. package/dist/components/Table3/components/columns/internal/EditingActions.d.ts +1 -1
  12. package/dist/components/Table3/components/columns/styles.d.ts +2 -2
  13. package/dist/components/Table3/components/rows/Row.d.ts +5 -1
  14. package/dist/components/Table3/components/rows/RowContext.d.ts +1 -0
  15. package/dist/components/Table3/hooks/features/useEditing.d.ts +12 -11
  16. package/dist/components/Table3/hooks/features/{usePauseHoverState.d.ts → usePauseShortcuts.d.ts} +1 -2
  17. package/dist/components/Table3/hooks/features/useSearch.d.ts +3 -3
  18. package/dist/components/Table3/hooks/features/useValidation.d.ts +13 -0
  19. package/dist/components/Table3/hooks/useTable.d.ts +25 -20
  20. package/dist/components/Table3/types.d.ts +41 -19
  21. package/dist/components/Table3/util/editing.d.ts +6 -0
  22. package/dist/components/Table3/util/scrolling.d.ts +2 -0
  23. package/dist/esm/index.css +108 -33
  24. package/dist/esm/packages/taco/src/components/Banner/Banner.js +2 -2
  25. package/dist/esm/packages/taco/src/components/Banner/Banner.js.map +1 -1
  26. package/dist/esm/packages/taco/src/components/Calendar/Calendar.js +4 -4
  27. package/dist/esm/packages/taco/src/components/Calendar/Calendar.js.map +1 -1
  28. package/dist/esm/packages/taco/src/components/Combobox/Combobox.js +3 -3
  29. package/dist/esm/packages/taco/src/components/Combobox/Combobox.js.map +1 -1
  30. package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +2 -1
  31. package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
  32. package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js +6 -6
  33. package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
  34. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +3 -3
  35. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
  36. package/dist/esm/packages/taco/src/components/Drawer/Drawer.js +7 -2
  37. package/dist/esm/packages/taco/src/components/Drawer/Drawer.js.map +1 -1
  38. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +7 -7
  39. package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
  40. package/dist/esm/packages/taco/src/components/Field/Field.js +2 -2
  41. package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
  42. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js +2 -2
  43. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js.map +1 -1
  44. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +4 -4
  45. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -1
  46. package/dist/esm/packages/taco/src/components/Header/components/Link.js +2 -2
  47. package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -1
  48. package/dist/esm/packages/taco/src/components/Icon/Icon.js +2 -2
  49. package/dist/esm/packages/taco/src/components/Icon/Icon.js.map +1 -1
  50. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +2 -2
  51. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -1
  52. package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js +6 -6
  53. package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js.map +1 -1
  54. package/dist/esm/packages/taco/src/components/Menu/components/Item.js +4 -4
  55. package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
  56. package/dist/esm/packages/taco/src/components/Navigation/Navigation.js +2 -2
  57. package/dist/esm/packages/taco/src/components/Navigation/Navigation.js.map +1 -1
  58. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +3 -3
  59. package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -1
  60. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +2 -2
  61. package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -1
  62. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +1 -1
  63. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
  64. package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js +2 -2
  65. package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js.map +1 -1
  66. package/dist/esm/packages/taco/src/components/Pagination/Pagination.js +5 -5
  67. package/dist/esm/packages/taco/src/components/Pagination/Pagination.js.map +1 -1
  68. package/dist/esm/packages/taco/src/components/Popover/Popover.js +2 -2
  69. package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
  70. package/dist/esm/packages/taco/src/components/Provider/Localization.js +19 -0
  71. package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
  72. package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js +2 -2
  73. package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js.map +1 -1
  74. package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +12 -8
  75. package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
  76. package/dist/esm/packages/taco/src/components/Select/useSelect.js +2 -2
  77. package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
  78. package/dist/esm/packages/taco/src/components/Select2/Select2.js +7 -7
  79. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  80. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +8 -8
  81. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
  82. package/dist/esm/packages/taco/src/components/Select2/components/Option.js +5 -5
  83. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  84. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +10 -10
  85. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
  86. package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js +2 -2
  87. package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js.map +1 -1
  88. package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js +3 -3
  89. package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js.map +1 -1
  90. package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js +2 -2
  91. package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
  92. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js +10 -10
  93. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js.map +1 -1
  94. package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js +2 -2
  95. package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js.map +1 -1
  96. package/dist/esm/packages/taco/src/components/Table3/Table3.js +37 -30
  97. package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
  98. package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js +154 -0
  99. package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js.map +1 -0
  100. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js +54 -9
  101. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Cell.js.map +1 -1
  102. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +9 -57
  103. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
  104. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +72 -41
  105. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
  106. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +41 -17
  107. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
  108. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js +41 -0
  109. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/Highlight.js.map +1 -0
  110. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +23 -14
  111. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +1 -1
  112. package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js +3 -3
  113. package/dist/esm/packages/taco/src/components/Table3/components/columns/footer/Footer.js.map +1 -1
  114. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js +1 -1
  115. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js.map +1 -1
  116. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +9 -9
  117. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js.map +1 -1
  118. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +37 -6
  119. package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
  120. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +12 -12
  121. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
  122. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Drag.js +2 -2
  123. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Drag.js.map +1 -1
  124. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +63 -23
  125. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +1 -1
  126. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Expansion.js +3 -3
  127. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Expansion.js.map +1 -1
  128. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js +3 -3
  129. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Selection.js.map +1 -1
  130. package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js +2 -13
  131. package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +1 -1
  132. package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js +67 -57
  133. package/dist/esm/packages/taco/src/components/Table3/components/rows/Row.js.map +1 -1
  134. package/dist/esm/packages/taco/src/components/Table3/components/rows/RowContext.js +2 -1
  135. package/dist/esm/packages/taco/src/components/Table3/components/rows/RowContext.js.map +1 -1
  136. package/dist/esm/packages/taco/src/components/Table3/components/rows/SkeletonRow.js +2 -2
  137. package/dist/esm/packages/taco/src/components/Table3/components/rows/SkeletonRow.js.map +1 -1
  138. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +8 -6
  139. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +1 -1
  140. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +23 -8
  141. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
  142. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js +2 -2
  143. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js.map +1 -1
  144. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js +2 -2
  145. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js.map +1 -1
  146. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js +16 -16
  147. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintButton.js.map +1 -1
  148. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +1 -0
  149. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +1 -1
  150. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js +53 -4
  151. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js.map +1 -1
  152. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +8 -8
  153. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js.map +1 -1
  154. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useEditing.js +185 -101
  155. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useEditing.js.map +1 -1
  156. package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePauseShortcuts.js +12 -0
  157. package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePauseShortcuts.js.map +1 -0
  158. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSearch.js +4 -2
  159. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSearch.js.map +1 -1
  160. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useValidation.js +178 -0
  161. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useValidation.js.map +1 -0
  162. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useEditingStateListener.js +3 -3
  163. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useEditingStateListener.js.map +1 -1
  164. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js +1 -49
  165. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js.map +1 -1
  166. package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js +1 -2
  167. package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js.map +1 -1
  168. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js +0 -2
  169. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js.map +1 -1
  170. package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js +135 -111
  171. package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
  172. package/dist/esm/packages/taco/src/components/Table3/strategies/virtualised.js +4 -4
  173. package/dist/esm/packages/taco/src/components/Table3/strategies/virtualised.js.map +1 -1
  174. package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
  175. package/dist/esm/packages/taco/src/components/Table3/util/editing.js +21 -1
  176. package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
  177. package/dist/esm/packages/taco/src/components/Table3/util/scrolling.js +53 -0
  178. package/dist/esm/packages/taco/src/components/Table3/util/scrolling.js.map +1 -0
  179. package/dist/esm/packages/taco/src/components/Tag/Tag.js +4 -4
  180. package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
  181. package/dist/esm/packages/taco/src/components/Toast/Toaster.js +2 -2
  182. package/dist/esm/packages/taco/src/components/Toast/Toaster.js.map +1 -1
  183. package/dist/esm/packages/taco/src/components/Tour/Tour.js +4 -4
  184. package/dist/esm/packages/taco/src/components/Tour/Tour.js.map +1 -1
  185. package/dist/esm/packages/taco/src/components/Treeview/Treeview.js +2 -2
  186. package/dist/esm/packages/taco/src/components/Treeview/Treeview.js.map +1 -1
  187. package/dist/esm/packages/taco/src/index.js +2 -1
  188. package/dist/esm/packages/taco/src/index.js.map +1 -1
  189. package/dist/esm/packages/taco/src/primitives/Table/types.js +10 -0
  190. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -0
  191. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js +8 -0
  192. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableColumnOrdering.js.map +1 -0
  193. package/dist/esm/packages/taco/src/{components/Table3/hooks/features/useFontSize.js → primitives/Table/useTable/features/useTableFontSize.js} +3 -3
  194. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFontSize.js.map +1 -0
  195. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js +14 -0
  196. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTablePrinting.js.map +1 -0
  197. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActive.js +100 -0
  198. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowActive.js.map +1 -0
  199. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowClick.js +30 -0
  200. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowClick.js.map +1 -0
  201. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGoto.js +9 -0
  202. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowGoto.js.map +1 -0
  203. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowHeight.js +13 -0
  204. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowHeight.js.map +1 -0
  205. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js +32 -0
  206. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableRowSelection.js.map +1 -0
  207. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js +11 -0
  208. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableServerLoading.js.map +1 -0
  209. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableDataListener.js +15 -0
  210. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableDataListener.js.map +1 -0
  211. package/dist/esm/packages/taco/src/{components/Table3/hooks/listeners/useFilteringStateListener.js → primitives/Table/useTable/listeners/useTableFilterListener.js} +3 -3
  212. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFilterListener.js.map +1 -0
  213. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js +40 -0
  214. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js.map +1 -0
  215. package/dist/esm/packages/taco/src/{components/Table3/hooks/listeners/useRowSelectionListener.js → primitives/Table/useTable/listeners/useTableRowSelectionListener.js} +5 -6
  216. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableRowSelectionListener.js.map +1 -0
  217. package/dist/esm/packages/taco/src/{components/Table3/hooks/listeners/useServerLoadingListener.js → primitives/Table/useTable/listeners/useTableServerLoadingListener.js} +3 -3
  218. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableServerLoadingListener.js.map +1 -0
  219. package/dist/esm/packages/taco/src/{components/Table3/hooks/listeners/useShortcutsListener.js → primitives/Table/useTable/listeners/useTableShortcutsListener.js} +7 -7
  220. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableShortcutsListener.js.map +1 -0
  221. package/dist/esm/packages/taco/src/{components/Table3/hooks/listeners/useSortingStateListener.js → primitives/Table/useTable/listeners/useTableSortingListener.js} +6 -4
  222. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableSortingListener.js.map +1 -0
  223. package/dist/esm/packages/taco/src/{components/Table3/hooks/features/useColumnOrdering.js → primitives/Table/useTable/util/columns.js} +24 -15
  224. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js.map +1 -0
  225. package/dist/esm/packages/taco/src/types.js +6 -0
  226. package/dist/esm/packages/taco/src/types.js.map +1 -0
  227. package/dist/esm/packages/taco/src/utils/date.js +0 -1
  228. package/dist/esm/packages/taco/src/utils/date.js.map +1 -1
  229. package/dist/index.css +108 -33
  230. package/dist/primitives/Table/types.d.ts +35 -0
  231. package/dist/primitives/Table/useTable/features/useTableColumnOrdering.d.ts +3 -0
  232. package/dist/primitives/Table/useTable/features/useTableFontSize.d.ts +7 -0
  233. package/dist/primitives/Table/useTable/features/useTablePrinting.d.ts +7 -0
  234. package/dist/primitives/Table/useTable/features/useTableRowActive.d.ts +12 -0
  235. package/dist/primitives/Table/useTable/features/useTableRowClick.d.ts +7 -0
  236. package/dist/primitives/Table/useTable/features/useTableRowGoto.d.ts +5 -0
  237. package/dist/primitives/Table/useTable/features/useTableRowHeight.d.ts +7 -0
  238. package/dist/primitives/Table/useTable/features/useTableRowSelection.d.ts +6 -0
  239. package/dist/primitives/Table/useTable/features/useTableServerLoading.d.ts +6 -0
  240. package/dist/primitives/Table/useTable/listeners/useTableDataListener.d.ts +2 -0
  241. package/dist/primitives/Table/useTable/listeners/useTableFilterListener.d.ts +3 -0
  242. package/dist/primitives/Table/useTable/listeners/useTableFontSizeListener.d.ts +2 -0
  243. package/dist/primitives/Table/useTable/listeners/useTableRowSelectionListener.d.ts +3 -0
  244. package/dist/primitives/Table/useTable/listeners/useTableServerLoadingListener.d.ts +3 -0
  245. package/dist/primitives/Table/useTable/listeners/useTableShortcutsListener.d.ts +3 -0
  246. package/dist/primitives/Table/useTable/listeners/useTableSortingListener.d.ts +3 -0
  247. package/dist/primitives/Table/useTable/util/columns.d.ts +4 -0
  248. package/dist/taco.cjs.development.js +2294 -1543
  249. package/dist/taco.cjs.development.js.map +1 -1
  250. package/dist/taco.cjs.production.min.js +1 -1
  251. package/dist/taco.cjs.production.min.js.map +1 -1
  252. package/dist/types.d.ts +5 -0
  253. package/package.json +3 -3
  254. package/types.json +13547 -12953
  255. package/dist/components/Table3/hooks/features/useColumnOrdering.d.ts +0 -6
  256. package/dist/components/Table3/hooks/features/useCurrentRow.d.ts +0 -11
  257. package/dist/components/Table3/hooks/features/useFontSize.d.ts +0 -7
  258. package/dist/components/Table3/hooks/features/usePrinting.d.ts +0 -8
  259. package/dist/components/Table3/hooks/features/useRowClick.d.ts +0 -6
  260. package/dist/components/Table3/hooks/features/useRowGoto.d.ts +0 -5
  261. package/dist/components/Table3/hooks/features/useRowHeight.d.ts +0 -7
  262. package/dist/components/Table3/hooks/features/useRowSelection.d.ts +0 -6
  263. package/dist/components/Table3/hooks/listeners/useCurrentRowListener.d.ts +0 -2
  264. package/dist/components/Table3/hooks/listeners/useFilteringStateListener.d.ts +0 -3
  265. package/dist/components/Table3/hooks/listeners/useRowSelectionListener.d.ts +0 -3
  266. package/dist/components/Table3/hooks/listeners/useServerLoadingListener.d.ts +0 -3
  267. package/dist/components/Table3/hooks/listeners/useShortcutsListener.d.ts +0 -3
  268. package/dist/components/Table3/hooks/listeners/useSortingStateListener.d.ts +0 -3
  269. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useColumnOrdering.js.map +0 -1
  270. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useCurrentRow.js +0 -93
  271. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useCurrentRow.js.map +0 -1
  272. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useFontSize.js.map +0 -1
  273. package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePauseHoverState.js +0 -22
  274. package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePauseHoverState.js.map +0 -1
  275. package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePrinting.js +0 -14
  276. package/dist/esm/packages/taco/src/components/Table3/hooks/features/usePrinting.js.map +0 -1
  277. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowClick.js +0 -25
  278. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowClick.js.map +0 -1
  279. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowGoto.js +0 -9
  280. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowGoto.js.map +0 -1
  281. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowHeight.js +0 -27
  282. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowHeight.js.map +0 -1
  283. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowSelection.js +0 -32
  284. package/dist/esm/packages/taco/src/components/Table3/hooks/features/useRowSelection.js.map +0 -1
  285. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useCurrentRowListener.js +0 -15
  286. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useCurrentRowListener.js.map +0 -1
  287. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useFilteringStateListener.js.map +0 -1
  288. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useRowSelectionListener.js.map +0 -1
  289. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useServerLoadingListener.js.map +0 -1
  290. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useShortcutsListener.js.map +0 -1
  291. package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSortingStateListener.js.map +0 -1
@@ -0,0 +1,30 @@
1
+ import React__default from 'react';
2
+
3
+ function useTableRowClick(isEnabled = false, onRowClick) {
4
+ const handleKeyDown = React__default.useCallback(function (event, data) {
5
+ if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {
6
+ return;
7
+ }
8
+ if (data && event.key === 'Enter') {
9
+ event.preventDefault();
10
+ onRowClick(data);
11
+ return;
12
+ }
13
+ }, [isEnabled, onRowClick]);
14
+ const handleClick = React__default.useCallback(function (event, data) {
15
+ if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {
16
+ return;
17
+ }
18
+ event.preventDefault();
19
+ onRowClick(data);
20
+ return;
21
+ }, [isEnabled, onRowClick]);
22
+ return {
23
+ isEnabled,
24
+ handleClick,
25
+ handleKeyDown
26
+ };
27
+ }
28
+
29
+ export { useTableRowClick };
30
+ //# sourceMappingURL=useTableRowClick.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableRowClick.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowClick.ts"],"sourcesContent":["import React from 'react';\nimport { TableRowClickHandler } from '../../types';\n\nexport function useTableRowClick<TType = unknown>(isEnabled = false, onRowClick?: TableRowClickHandler<TType>) {\n const handleKeyDown = React.useCallback(\n function (event: KeyboardEvent, data: TType) {\n if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {\n return;\n }\n\n if (data && event.key === 'Enter') {\n event.preventDefault();\n onRowClick(data);\n return;\n }\n },\n [isEnabled, onRowClick]\n ) as <TType = unknown>(event: KeyboardEvent, data: TType) => void;\n\n const handleClick = React.useCallback(\n function (event: React.MouseEvent<HTMLDivElement>, data: TType) {\n if (!isEnabled || typeof onRowClick !== 'function' || event.defaultPrevented) {\n return;\n }\n\n event.preventDefault();\n onRowClick(data);\n return;\n },\n [isEnabled, onRowClick]\n );\n\n return {\n isEnabled,\n handleClick,\n handleKeyDown,\n };\n}\n"],"names":["useTableRowClick","isEnabled","onRowClick","handleKeyDown","React","useCallback","event","data","defaultPrevented","key","preventDefault","handleClick"],"mappings":";;SAGgBA,gBAAgBA,CAAkBC,SAAS,GAAG,KAAK,EAAEC,UAAwC;EACzG,MAAMC,aAAa,GAAGC,cAAK,CAACC,WAAW,CACnC,UAAUC,KAAoB,EAAEC,IAAW;IACvC,IAAI,CAACN,SAAS,IAAI,OAAOC,UAAU,KAAK,UAAU,IAAII,KAAK,CAACE,gBAAgB,EAAE;MAC1E;;IAGJ,IAAID,IAAI,IAAID,KAAK,CAACG,GAAG,KAAK,OAAO,EAAE;MAC/BH,KAAK,CAACI,cAAc,EAAE;MACtBR,UAAU,CAACK,IAAI,CAAC;MAChB;;GAEP,EACD,CAACN,SAAS,EAAEC,UAAU,CAAC,CACsC;EAEjE,MAAMS,WAAW,GAAGP,cAAK,CAACC,WAAW,CACjC,UAAUC,KAAuC,EAAEC,IAAW;IAC1D,IAAI,CAACN,SAAS,IAAI,OAAOC,UAAU,KAAK,UAAU,IAAII,KAAK,CAACE,gBAAgB,EAAE;MAC1E;;IAGJF,KAAK,CAACI,cAAc,EAAE;IACtBR,UAAU,CAACK,IAAI,CAAC;IAChB;GACH,EACD,CAACN,SAAS,EAAEC,UAAU,CAAC,CAC1B;EAED,OAAO;IACHD,SAAS;IACTU,WAAW;IACXR;GACH;AACL;;;;"}
@@ -0,0 +1,9 @@
1
+ function useTableRowGoto(isEnabled = false, handler) {
2
+ return {
3
+ isEnabled,
4
+ handleGoto: isEnabled && handler ? handler : () => undefined
5
+ };
6
+ }
7
+
8
+ export { useTableRowGoto };
9
+ //# sourceMappingURL=useTableRowGoto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableRowGoto.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowGoto.ts"],"sourcesContent":["import { TableRowGotoHandler } from '../../types';\n\nexport function useTableRowGoto(isEnabled = false, handler?: TableRowGotoHandler) {\n return {\n isEnabled,\n handleGoto: isEnabled && handler ? handler : () => undefined,\n };\n}\n"],"names":["useTableRowGoto","isEnabled","handler","handleGoto","undefined"],"mappings":"SAEgBA,eAAeA,CAACC,SAAS,GAAG,KAAK,EAAEC,OAA6B;EAC5E,OAAO;IACHD,SAAS;IACTE,UAAU,EAAEF,SAAS,IAAIC,OAAO,GAAGA,OAAO,GAAG,MAAME;GACtD;AACL;;;;"}
@@ -0,0 +1,13 @@
1
+ import React__default from 'react';
2
+
3
+ function useTableRowHeight(isEnabled = false, defaultRowHeight = 'medium') {
4
+ const [height, setHeight] = React__default.useState(defaultRowHeight);
5
+ return {
6
+ isEnabled,
7
+ height,
8
+ setHeight: isEnabled ? setHeight : () => undefined
9
+ };
10
+ }
11
+
12
+ export { useTableRowHeight };
13
+ //# sourceMappingURL=useTableRowHeight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableRowHeight.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowHeight.ts"],"sourcesContent":["import React from 'react';\nimport { TableRowHeight } from '../../types';\n\nexport function useTableRowHeight(isEnabled = false, defaultRowHeight: TableRowHeight = 'medium') {\n const [height, setHeight] = React.useState<TableRowHeight>(defaultRowHeight);\n\n return {\n isEnabled,\n height,\n setHeight: isEnabled ? setHeight : () => undefined,\n };\n}\n"],"names":["useTableRowHeight","isEnabled","defaultRowHeight","height","setHeight","React","useState","undefined"],"mappings":";;SAGgBA,iBAAiBA,CAACC,SAAS,GAAG,KAAK,EAAEC,mBAAmC,QAAQ;EAC5F,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAiBJ,gBAAgB,CAAC;EAE5E,OAAO;IACHD,SAAS;IACTE,MAAM;IACNC,SAAS,EAAEH,SAAS,GAAGG,SAAS,GAAG,MAAMG;GAC5C;AACL;;;;"}
@@ -0,0 +1,32 @@
1
+ import React__default from 'react';
2
+
3
+ function useTableRowSelection(isEnabled = false) {
4
+ const lastSelectedRowIndex = React__default.useRef();
5
+ const onKeyDown = React__default.useCallback((event, table) => {
6
+ if (!isEnabled || !table.options.enableRowSelection || event.defaultPrevented) {
7
+ return;
8
+ }
9
+ const rows = table.getRowModel().rows;
10
+ const tableMeta = table.options.meta;
11
+ if (event.key === ' ') {
12
+ event.preventDefault();
13
+ const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;
14
+ if (rowActiveIndex !== undefined) {
15
+ var _rows$rowActiveIndex;
16
+ (_rows$rowActiveIndex = rows[rowActiveIndex]) === null || _rows$rowActiveIndex === void 0 ? void 0 : _rows$rowActiveIndex.toggleSelected();
17
+ }
18
+ return;
19
+ } else if ((event.ctrlKey || event.metaKey) && event.key === 'a') {
20
+ event.preventDefault();
21
+ table.toggleAllRowsSelected();
22
+ return;
23
+ }
24
+ }, [isEnabled]);
25
+ return {
26
+ handleKeyDown: isEnabled ? onKeyDown : () => undefined,
27
+ lastSelectedRowIndex
28
+ };
29
+ }
30
+
31
+ export { useTableRowSelection };
32
+ //# sourceMappingURL=useTableRowSelection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableRowSelection.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableRowSelection.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\n\nexport function useTableRowSelection(isEnabled = false) {\n const lastSelectedRowIndex = React.useRef<number>();\n\n const onKeyDown = React.useCallback(\n <TType = unknown>(event: KeyboardEvent, table: ReactTable<TType>) => {\n if (!isEnabled || !table.options.enableRowSelection || event.defaultPrevented) {\n return;\n }\n\n const rows = table.getRowModel().rows;\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n\n if (event.key === ' ') {\n event.preventDefault();\n const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;\n\n if (rowActiveIndex !== undefined) {\n rows[rowActiveIndex]?.toggleSelected();\n }\n\n return;\n } else if ((event.ctrlKey || event.metaKey) && event.key === 'a') {\n event.preventDefault();\n table.toggleAllRowsSelected();\n return;\n }\n },\n [isEnabled]\n ) as <TType = unknown>(event: KeyboardEvent, table: ReactTable<TType>) => void;\n\n return {\n handleKeyDown: isEnabled ? onKeyDown : () => undefined,\n lastSelectedRowIndex,\n };\n}\n"],"names":["useTableRowSelection","isEnabled","lastSelectedRowIndex","React","useRef","onKeyDown","useCallback","event","table","options","enableRowSelection","defaultPrevented","rows","getRowModel","tableMeta","meta","key","preventDefault","rowActiveIndex","rowActive","undefined","_rows$rowActiveIndex","toggleSelected","ctrlKey","metaKey","toggleAllRowsSelected","handleKeyDown"],"mappings":";;SAGgBA,oBAAoBA,CAACC,SAAS,GAAG,KAAK;EAClD,MAAMC,oBAAoB,GAAGC,cAAK,CAACC,MAAM,EAAU;EAEnD,MAAMC,SAAS,GAAGF,cAAK,CAACG,WAAW,CAC/B,CAAkBC,KAAoB,EAAEC,KAAwB;IAC5D,IAAI,CAACP,SAAS,IAAI,CAACO,KAAK,CAACC,OAAO,CAACC,kBAAkB,IAAIH,KAAK,CAACI,gBAAgB,EAAE;MAC3E;;IAGJ,MAAMC,IAAI,GAAGJ,KAAK,CAACK,WAAW,EAAE,CAACD,IAAI;IACrC,MAAME,SAAS,GAAGN,KAAK,CAACC,OAAO,CAACM,IAA6B;IAE7D,IAAIR,KAAK,CAACS,GAAG,KAAK,GAAG,EAAE;MACnBT,KAAK,CAACU,cAAc,EAAE;MACtB,MAAMC,cAAc,GAAGJ,SAAS,CAACK,SAAS,CAACD,cAAc;MAEzD,IAAIA,cAAc,KAAKE,SAAS,EAAE;QAAA,IAAAC,oBAAA;QAC9B,CAAAA,oBAAA,GAAAT,IAAI,CAACM,cAAc,CAAC,cAAAG,oBAAA,uBAApBA,oBAAA,CAAsBC,cAAc,EAAE;;MAG1C;KACH,MAAM,IAAI,CAACf,KAAK,CAACgB,OAAO,IAAIhB,KAAK,CAACiB,OAAO,KAAKjB,KAAK,CAACS,GAAG,KAAK,GAAG,EAAE;MAC9DT,KAAK,CAACU,cAAc,EAAE;MACtBT,KAAK,CAACiB,qBAAqB,EAAE;MAC7B;;GAEP,EACD,CAACxB,SAAS,CAAC,CAC+D;EAE9E,OAAO;IACHyB,aAAa,EAAEzB,SAAS,GAAGI,SAAS,GAAG,MAAMe,SAAS;IACtDlB;GACH;AACL;;;;"}
@@ -0,0 +1,11 @@
1
+ function useTableServerLoading(loadPage, loadAll) {
2
+ const isEnabled = !!loadPage && !!loadAll;
3
+ return {
4
+ isEnabled,
5
+ loadPage,
6
+ loadAll
7
+ };
8
+ }
9
+
10
+ export { useTableServerLoading };
11
+ //# sourceMappingURL=useTableServerLoading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableServerLoading.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableServerLoading.ts"],"sourcesContent":["import { TableServerLoadAllHandler, TableServerLoadPageHandler } from '../../types';\n\nexport function useTableServerLoading(loadPage?: TableServerLoadPageHandler, loadAll?: TableServerLoadAllHandler) {\n const isEnabled = !!loadPage && !!loadAll;\n\n return {\n isEnabled,\n loadPage,\n loadAll,\n };\n}\n"],"names":["useTableServerLoading","loadPage","loadAll","isEnabled"],"mappings":"SAEgBA,qBAAqBA,CAACC,QAAqC,EAAEC,OAAmC;EAC5G,MAAMC,SAAS,GAAG,CAAC,CAACF,QAAQ,IAAI,CAAC,CAACC,OAAO;EAEzC,OAAO;IACHC,SAAS;IACTF,QAAQ;IACRC;GACH;AACL;;;;"}
@@ -0,0 +1,15 @@
1
+ import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
2
+
3
+ function useTableDataListener(table) {
4
+ const meta = table.options.meta;
5
+ const rows = table.getRowModel().rows;
6
+ useLazyEffect(() => {
7
+ const rowActiveIndex = meta.rowActive.rowActiveIndex;
8
+ if (rowActiveIndex !== undefined && rowActiveIndex > rows.length) {
9
+ meta.rowActive.setRowActiveIndex(0);
10
+ }
11
+ }, [rows.length]);
12
+ }
13
+
14
+ export { useTableDataListener };
15
+ //# sourceMappingURL=useTableDataListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableDataListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableDataListener.ts"],"sourcesContent":["import { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\n\nexport function useTableDataListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n useLazyEffect(() => {\n const rowActiveIndex = meta.rowActive.rowActiveIndex;\n\n if (rowActiveIndex !== undefined && rowActiveIndex > rows.length) {\n meta.rowActive.setRowActiveIndex(0);\n }\n }, [rows.length]);\n}\n"],"names":["useTableDataListener","table","meta","options","rows","getRowModel","useLazyEffect","rowActiveIndex","rowActive","undefined","length","setRowActiveIndex"],"mappings":";;SAGgBA,oBAAoBA,CAAkBC,KAAwB;EAC1E,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EACxD,MAAME,IAAI,GAAGH,KAAK,CAACI,WAAW,EAAE,CAACD,IAAI;EAErCE,aAAa,CAAC;IACV,MAAMC,cAAc,GAAGL,IAAI,CAACM,SAAS,CAACD,cAAc;IAEpD,IAAIA,cAAc,KAAKE,SAAS,IAAIF,cAAc,GAAGH,IAAI,CAACM,MAAM,EAAE;MAC9DR,IAAI,CAACM,SAAS,CAACG,iBAAiB,CAAC,CAAC,CAAC;;GAE1C,EAAE,CAACP,IAAI,CAACM,MAAM,CAAC,CAAC;AACrB;;;;"}
@@ -3,7 +3,7 @@ import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
3
3
  // we use a listener, and not the internal "controlled" change handlers because we don't actually want consumers
4
4
  // to control the state outside the table. this listener is really here to let the consumer make a server request
5
5
  // and provide the server with the filtering state, so that it can filter server side
6
- function useFilteringStateListener(table, onFilter) {
6
+ function useTableFilterListener(table, onFilter) {
7
7
  const columnFilters = table.getState().columnFilters;
8
8
  useLazyEffect(() => {
9
9
  if (table.options.enableColumnFilters && typeof onFilter === 'function') {
@@ -15,5 +15,5 @@ function useFilteringStateListener(table, onFilter) {
15
15
  }, [table.options.enableColumnFilters, columnFilters]);
16
16
  }
17
17
 
18
- export { useFilteringStateListener };
19
- //# sourceMappingURL=useFilteringStateListener.js.map
18
+ export { useTableFilterListener };
19
+ //# sourceMappingURL=useTableFilterListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableFilterListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableFilterListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableFilterHandler } from '../../types';\n\n// we use a listener, and not the internal \"controlled\" change handlers because we don't actually want consumers\n// to control the state outside the table. this listener is really here to let the consumer make a server request\n// and provide the server with the filtering state, so that it can filter server side\nexport function useTableFilterListener<TType = unknown>(table: ReactTable<TType>, onFilter?: TableFilterHandler) {\n const columnFilters = table.getState().columnFilters;\n\n useLazyEffect(() => {\n if (table.options.enableColumnFilters && typeof onFilter === 'function') {\n onFilter(columnFilters);\n\n if (table.options.enableRowSelection) {\n table.resetRowSelection();\n }\n }\n }, [table.options.enableColumnFilters, columnFilters]);\n}\n"],"names":["useTableFilterListener","table","onFilter","columnFilters","getState","useLazyEffect","options","enableColumnFilters","enableRowSelection","resetRowSelection"],"mappings":";;AAIA;AACA;AACA;SACgBA,sBAAsBA,CAAkBC,KAAwB,EAAEC,QAA6B;EAC3G,MAAMC,aAAa,GAAGF,KAAK,CAACG,QAAQ,EAAE,CAACD,aAAa;EAEpDE,aAAa,CAAC;IACV,IAAIJ,KAAK,CAACK,OAAO,CAACC,mBAAmB,IAAI,OAAOL,QAAQ,KAAK,UAAU,EAAE;MACrEA,QAAQ,CAACC,aAAa,CAAC;MAEvB,IAAIF,KAAK,CAACK,OAAO,CAACE,kBAAkB,EAAE;QAClCP,KAAK,CAACQ,iBAAiB,EAAE;;;GAGpC,EAAE,CAACR,KAAK,CAACK,OAAO,CAACC,mBAAmB,EAAEJ,aAAa,CAAC,CAAC;AAC1D;;;;"}
@@ -0,0 +1,40 @@
1
+ import React__default from 'react';
2
+ import { TableFontSizes } from '../../types.js';
3
+ import { getCellMinWidth } from '../util/columns.js';
4
+ import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
5
+
6
+ function useTableFontSizeListener(table) {
7
+ const meta = table.options.meta;
8
+ const previousFontSizeRef = React__default.useRef(meta.fontSize.size);
9
+ useLazyEffect(() => {
10
+ const cellWidthDifference = getCellWidthDifference(`${previousFontSizeRef.current}-${meta.fontSize.size}`);
11
+ table.setColumnSizing(sizes => {
12
+ const minColumnSize = getCellMinWidth(meta.fontSize.size);
13
+ return Object.fromEntries(Object.entries(sizes).map(([columnName, prevColumnSize]) => {
14
+ // Prevents width value in the setting to go below the minColumnSize
15
+ const newSize = Math.max(minColumnSize, prevColumnSize + cellWidthDifference);
16
+ return [columnName, newSize];
17
+ }));
18
+ });
19
+ previousFontSizeRef.current = meta.fontSize.size;
20
+ }, [meta.fontSize.size]);
21
+ }
22
+ function getCellWidthDifference(fontSizeKey) {
23
+ switch (fontSizeKey) {
24
+ case `${TableFontSizes.small}-${TableFontSizes.medium}`:
25
+ case `${TableFontSizes.medium}-${TableFontSizes.large}`:
26
+ return 8;
27
+ case `${TableFontSizes.medium}-${TableFontSizes.small}`:
28
+ case `${TableFontSizes.large}-${TableFontSizes.medium}`:
29
+ return -8;
30
+ case `${TableFontSizes.small}-${TableFontSizes.large}`:
31
+ return 16;
32
+ case `${TableFontSizes.large}-${TableFontSizes.small}`:
33
+ return -16;
34
+ default:
35
+ return 0;
36
+ }
37
+ }
38
+
39
+ export { useTableFontSizeListener };
40
+ //# sourceMappingURL=useTableFontSizeListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableFontSizeListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableFontSizeListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableFontSizes } from '../../types';\nimport { getCellMinWidth } from '../util/columns';\n\nexport function useTableFontSizeListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const previousFontSizeRef = React.useRef(meta.fontSize.size);\n\n useLazyEffect(() => {\n const cellWidthDifference = getCellWidthDifference(`${previousFontSizeRef.current}-${meta.fontSize.size}`);\n\n table.setColumnSizing(sizes => {\n const minColumnSize = getCellMinWidth(meta.fontSize.size);\n\n return Object.fromEntries(\n Object.entries(sizes).map(([columnName, prevColumnSize]) => {\n // Prevents width value in the setting to go below the minColumnSize\n const newSize = Math.max(minColumnSize, prevColumnSize + cellWidthDifference);\n return [columnName, newSize];\n })\n );\n });\n previousFontSizeRef.current = meta.fontSize.size;\n }, [meta.fontSize.size]);\n}\n\nfunction getCellWidthDifference(fontSizeKey: string) {\n switch (fontSizeKey) {\n case `${TableFontSizes.small}-${TableFontSizes.medium}`:\n case `${TableFontSizes.medium}-${TableFontSizes.large}`:\n return 8;\n\n case `${TableFontSizes.medium}-${TableFontSizes.small}`:\n case `${TableFontSizes.large}-${TableFontSizes.medium}`:\n return -8;\n\n case `${TableFontSizes.small}-${TableFontSizes.large}`:\n return 16;\n\n case `${TableFontSizes.large}-${TableFontSizes.small}`:\n return -16;\n\n default:\n return 0;\n }\n}\n"],"names":["useTableFontSizeListener","table","meta","options","previousFontSizeRef","React","useRef","fontSize","size","useLazyEffect","cellWidthDifference","getCellWidthDifference","current","setColumnSizing","sizes","minColumnSize","getCellMinWidth","Object","fromEntries","entries","map","columnName","prevColumnSize","newSize","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D,cAAc,CAACG,OAAO;MAClD,OAAO,EAAE;IAEb,QAAQH,cAAc,CAACG,SAASH,cAAc,CAACC,OAAO;MAClD,OAAO,CAAC,EAAE;IAEd;MACI,OAAO,CAAC;;AAEpB;;;;"}
@@ -1,10 +1,9 @@
1
1
  import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
2
2
 
3
- function useRowSelectionListener(table, onRowSelect) {
4
- const rowSelection = table.getState().rowSelection;
3
+ function useTableRowSelectionListener(table, onRowSelect) {
4
+ const selectedRows = table.getSelectedRowModel().rows;
5
5
  useLazyEffect(() => {
6
6
  if (table.options.enableRowSelection && typeof onRowSelect === 'function') {
7
- const selectedRows = table.getSelectedRowModel().rows;
8
7
  if (table.options.enableMultiRowSelection) {
9
8
  onRowSelect(selectedRows.map(row => row.original));
10
9
  } else {
@@ -12,8 +11,8 @@ function useRowSelectionListener(table, onRowSelect) {
12
11
  onRowSelect((_ref = [(_selectedRows$ = selectedRows[0]) === null || _selectedRows$ === void 0 ? void 0 : _selectedRows$.original]) !== null && _ref !== void 0 ? _ref : []);
13
12
  }
14
13
  }
15
- }, [table.options.enableRowSelection, rowSelection]);
14
+ }, [table.options.enableRowSelection, table.options.enableMultiRowSelection, selectedRows]);
16
15
  }
17
16
 
18
- export { useRowSelectionListener };
19
- //# sourceMappingURL=useRowSelectionListener.js.map
17
+ export { useTableRowSelectionListener };
18
+ //# sourceMappingURL=useTableRowSelectionListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableRowSelectionListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableRowSelectionListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableRowSelectHandler } from '../../types';\n\nexport function useTableRowSelectionListener<TType = unknown>(\n table: ReactTable<TType>,\n onRowSelect?: TableRowSelectHandler<TType>\n) {\n const selectedRows = table.getSelectedRowModel().rows;\n\n useLazyEffect(() => {\n if (table.options.enableRowSelection && typeof onRowSelect === 'function') {\n if (table.options.enableMultiRowSelection) {\n onRowSelect(selectedRows.map(row => row.original));\n } else {\n onRowSelect([selectedRows[0]?.original] ?? []);\n }\n }\n }, [table.options.enableRowSelection, table.options.enableMultiRowSelection, selectedRows]);\n}\n"],"names":["useTableRowSelectionListener","table","onRowSelect","selectedRows","getSelectedRowModel","rows","useLazyEffect","options","enableRowSelection","enableMultiRowSelection","map","row","original","_ref","_selectedRows$"],"mappings":";;SAIgBA,4BAA4BA,CACxCC,KAAwB,EACxBC,WAA0C;EAE1C,MAAMC,YAAY,GAAGF,KAAK,CAACG,mBAAmB,EAAE,CAACC,IAAI;EAErDC,aAAa,CAAC;IACV,IAAIL,KAAK,CAACM,OAAO,CAACC,kBAAkB,IAAI,OAAON,WAAW,KAAK,UAAU,EAAE;MACvE,IAAID,KAAK,CAACM,OAAO,CAACE,uBAAuB,EAAE;QACvCP,WAAW,CAACC,YAAY,CAACO,GAAG,CAACC,GAAG,IAAIA,GAAG,CAACC,QAAQ,CAAC,CAAC;OACrD,MAAM;QAAA,IAAAC,IAAA,EAAAC,cAAA;QACHZ,WAAW,EAAAW,IAAA,GAAC,EAAAC,cAAA,GAACX,YAAY,CAAC,CAAC,CAAC,cAAAW,cAAA,uBAAfA,cAAA,CAAiBF,QAAQ,CAAC,cAAAC,IAAA,cAAAA,IAAA,GAAI,EAAE,CAAC;;;GAGzD,EAAE,CAACZ,KAAK,CAACM,OAAO,CAACC,kBAAkB,EAAEP,KAAK,CAACM,OAAO,CAACE,uBAAuB,EAAEN,YAAY,CAAC,CAAC;AAC/F;;;;"}
@@ -1,6 +1,6 @@
1
1
  import React__default from 'react';
2
2
 
3
- function useServerLoadingListener(table, loadPage) {
3
+ function useTableServerLoadingListener(table, loadPage) {
4
4
  const sorting = table.getState().sorting;
5
5
  const columnFilters = table.getState().columnFilters;
6
6
  const search = table.getState().globalFilter;
@@ -12,5 +12,5 @@ function useServerLoadingListener(table, loadPage) {
12
12
  }, []);
13
13
  }
14
14
 
15
- export { useServerLoadingListener };
16
- //# sourceMappingURL=useServerLoadingListener.js.map
15
+ export { useTableServerLoadingListener };
16
+ //# sourceMappingURL=useTableServerLoadingListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableServerLoadingListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableServerLoadingListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable } from '@tanstack/react-table';\nimport { TableServerLoadPageHandler } from '../../types';\n\nexport function useTableServerLoadingListener<TType = unknown>(table: ReactTable<TType>, loadPage?: TableServerLoadPageHandler) {\n const sorting = table.getState().sorting;\n const columnFilters = table.getState().columnFilters;\n const search = table.getState().globalFilter;\n\n // trigger load of the first page on mount\n React.useEffect(() => {\n if (loadPage) {\n loadPage(0, sorting, columnFilters, search);\n }\n }, []);\n}\n"],"names":["useTableServerLoadingListener","table","loadPage","sorting","getState","columnFilters","search","globalFilter","React","useEffect"],"mappings":";;SAIgBA,6BAA6BA,CAAkBC,KAAwB,EAAEC,QAAqC;EAC1H,MAAMC,OAAO,GAAGF,KAAK,CAACG,QAAQ,EAAE,CAACD,OAAO;EACxC,MAAME,aAAa,GAAGJ,KAAK,CAACG,QAAQ,EAAE,CAACC,aAAa;EACpD,MAAMC,MAAM,GAAGL,KAAK,CAACG,QAAQ,EAAE,CAACG,YAAY;;EAG5CC,cAAK,CAACC,SAAS,CAAC;IACZ,IAAIP,QAAQ,EAAE;MACVA,QAAQ,CAAC,CAAC,EAAEC,OAAO,EAAEE,aAAa,EAAEC,MAAM,CAAC;;GAElD,EAAE,EAAE,CAAC;AACV;;;;"}
@@ -1,15 +1,15 @@
1
1
  import React__default from 'react';
2
2
  import { createShortcutKeyDownHandler } from '../../../../utils/keyboard.js';
3
3
 
4
- function useShortcutsListener(table, shortcuts) {
4
+ function useTableShortcutsListener(table, shortcuts) {
5
5
  const meta = table.options.meta;
6
6
  const rows = table.getRowModel().rows;
7
7
  React__default.useEffect(() => {
8
8
  const shortcutKeys = Object.keys(shortcuts !== null && shortcuts !== void 0 ? shortcuts : {});
9
9
  const globalHandlers = [];
10
10
  // convert the shortcut into the correct format to register it
11
- if (shortcuts && shortcutKeys.length && meta.currentRow.currentRowIndex !== undefined) {
12
- const currentRow = rows[meta.currentRow.currentRowIndex];
11
+ if (shortcuts && shortcutKeys.length && meta.rowActive.rowActiveIndex !== undefined) {
12
+ const rowActive = rows[meta.rowActive.rowActiveIndex];
13
13
  shortcutKeys.forEach(key => {
14
14
  const handler = shortcuts[key];
15
15
  let keyDownHandler;
@@ -30,7 +30,7 @@ function useShortcutsListener(table, shortcuts) {
30
30
  }
31
31
  globalHandlers.push(createShortcutKeyDownHandler(keyDownHandlerOptions, event => {
32
32
  event.preventDefault();
33
- keyDownHandler(currentRow === null || currentRow === void 0 ? void 0 : currentRow.original);
33
+ keyDownHandler(rowActive === null || rowActive === void 0 ? void 0 : rowActive.original);
34
34
  }));
35
35
  });
36
36
  }
@@ -42,8 +42,8 @@ function useShortcutsListener(table, shortcuts) {
42
42
  document.removeEventListener('keydown', handler);
43
43
  });
44
44
  };
45
- }, [shortcuts, meta.currentRow.currentRowIndex, rows.length]);
45
+ }, [shortcuts, meta.rowActive.rowActiveIndex, rows.length]);
46
46
  }
47
47
 
48
- export { useShortcutsListener };
49
- //# sourceMappingURL=useShortcutsListener.js.map
48
+ export { useTableShortcutsListener };
49
+ //# sourceMappingURL=useTableShortcutsListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableShortcutsListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableShortcutsListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { KeyDownHandlerOptions, createShortcutKeyDownHandler } from '../../../../utils/keyboard';\nimport { TableShortcutHandlerObject, TableShortcuts } from '../../types';\n\nexport function useTableShortcutsListener<TType = unknown>(\n table: ReactTable<TType>,\n shortcuts: TableShortcuts<TType> | undefined\n) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const rows = table.getRowModel().rows;\n\n React.useEffect(() => {\n const shortcutKeys = Object.keys(shortcuts ?? {});\n const globalHandlers: Array<(event: KeyboardEvent) => void> = [];\n\n // convert the shortcut into the correct format to register it\n if (shortcuts && shortcutKeys.length && meta.rowActive.rowActiveIndex !== undefined) {\n const rowActive = rows[meta.rowActive.rowActiveIndex];\n\n shortcutKeys.forEach(key => {\n const handler = shortcuts[key];\n\n let keyDownHandler;\n let keyDownHandlerOptions: KeyDownHandlerOptions;\n\n if (typeof handler === 'function') {\n keyDownHandler = handler;\n keyDownHandlerOptions = {\n key,\n };\n } else {\n const handlerObject = handler as TableShortcutHandlerObject<TType>;\n keyDownHandler = handlerObject.handler;\n keyDownHandlerOptions = {\n key,\n meta: handlerObject.meta,\n shift: handlerObject.shift,\n };\n }\n\n globalHandlers.push(\n createShortcutKeyDownHandler(keyDownHandlerOptions, event => {\n event.preventDefault();\n keyDownHandler(rowActive?.original);\n })\n );\n });\n }\n\n globalHandlers.forEach(handler => {\n document.addEventListener('keydown', handler);\n });\n\n return () => {\n globalHandlers.forEach(handler => {\n document.removeEventListener('keydown', handler);\n });\n };\n }, [shortcuts, meta.rowActive.rowActiveIndex, rows.length]);\n}\n"],"names":["useTableShortcutsListener","table","shortcuts","meta","options","rows","getRowModel","React","useEffect","shortcutKeys","Object","keys","globalHandlers","length","rowActive","rowActiveIndex","undefined","forEach","key","handler","keyDownHandler","keyDownHandlerOptions","handlerObject","shift","push","createShortcutKeyDownHandler","event","preventDefault","original","document","addEventListener","removeEventListener"],"mappings":";;;SAKgBA,yBAAyBA,CACrCC,KAAwB,EACxBC,SAA4C;EAE5C,MAAMC,IAAI,GAAGF,KAAK,CAACG,OAAO,CAACD,IAA6B;EACxD,MAAME,IAAI,GAAGJ,KAAK,CAACK,WAAW,EAAE,CAACD,IAAI;EAErCE,cAAK,CAACC,SAAS,CAAC;IACZ,MAAMC,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Ac,EAAEV,IAAI,CAACQ,MAAM,CAAC,CAAC;AAC/D;;;;"}
@@ -3,15 +3,17 @@ import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
3
3
  // we use a listener, and not the internal "controlled" change handlers because we don't actually want consumers
4
4
  // to control the state outside the table. this listener is really here to let the consumer make a server request
5
5
  // and provide the server with the sorting state, so that it can sort server side
6
- function useSortingStateListener(table, onSort) {
6
+ function useTableSortingListener(table, onSort) {
7
7
  const sorting = table.getState().sorting;
8
8
  useLazyEffect(() => {
9
- table.resetRowSelection();
10
9
  if (table.options.enableSorting && typeof onSort === 'function') {
11
10
  onSort(sorting);
11
+ if (table.options.enableRowSelection) {
12
+ table.resetRowSelection();
13
+ }
12
14
  }
13
15
  }, [table.options.enableSorting, sorting]);
14
16
  }
15
17
 
16
- export { useSortingStateListener };
17
- //# sourceMappingURL=useSortingStateListener.js.map
18
+ export { useTableSortingListener };
19
+ //# sourceMappingURL=useTableSortingListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableSortingListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableSortingListener.ts"],"sourcesContent":["import { Table as ReactTable } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableSortHandler } from '../../types';\n\n// we use a listener, and not the internal \"controlled\" change handlers because we don't actually want consumers\n// to control the state outside the table. this listener is really here to let the consumer make a server request\n// and provide the server with the sorting state, so that it can sort server side\nexport function useTableSortingListener<TType = unknown>(table: ReactTable<TType>, onSort?: TableSortHandler) {\n const sorting = table.getState().sorting;\n\n useLazyEffect(() => {\n if (table.options.enableSorting && typeof onSort === 'function') {\n onSort(sorting);\n\n if (table.options.enableRowSelection) {\n table.resetRowSelection();\n }\n }\n }, [table.options.enableSorting, sorting]);\n}\n"],"names":["useTableSortingListener","table","onSort","sorting","getState","useLazyEffect","options","enableSorting","enableRowSelection","resetRowSelection"],"mappings":";;AAIA;AACA;AACA;SACgBA,uBAAuBA,CAAkBC,KAAwB,EAAEC,MAAyB;EACxG,MAAMC,OAAO,GAAGF,KAAK,CAACG,QAAQ,EAAE,CAACD,OAAO;EAExCE,aAAa,CAAC;IACV,IAAIJ,KAAK,CAACK,OAAO,CAACC,aAAa,IAAI,OAAOL,MAAM,KAAK,UAAU,EAAE;MAC7DA,MAAM,CAACC,OAAO,CAAC;MAEf,IAAIF,KAAK,CAACK,OAAO,CAACE,kBAAkB,EAAE;QAClCP,KAAK,CAACQ,iBAAiB,EAAE;;;GAGpC,EAAE,CAACR,KAAK,CAACK,OAAO,CAACC,aAAa,EAAEJ,OAAO,CAAC,CAAC;AAC9C;;;;"}
@@ -1,16 +1,23 @@
1
- import { COLUMN_ID } from '../../components/columns/internal/Actions.js';
2
- import { COLUMN_ID as COLUMN_ID$1 } from '../../components/columns/internal/EditingActions.js';
1
+ import { TableFontSizes } from '../../types.js';
3
2
 
4
- function useColumnOrdering(options) {
5
- return {
6
- isEnabled: options.enableColumnOrdering
7
- };
8
- }
9
- function ensureOrdering(columns, settingsOrder) {
10
- // internal column come with a defined order
3
+ // column widths
4
+ const getCellMinWidth = (fontSize = 'medium') => {
5
+ switch (fontSize) {
6
+ case TableFontSizes.small:
7
+ return 57;
8
+ case TableFontSizes.large:
9
+ return 83;
10
+ default:
11
+ case TableFontSizes.medium:
12
+ return 72;
13
+ }
14
+ };
15
+ // ordering
16
+ function ensureOrdering(columns, internalColumnsPinnedToTheRight, settingsOrder) {
17
+ // internal columns come with a defined order
11
18
  const internalColumns = columns.filter(column => {
12
19
  var _column$id;
13
- return ((_column$id = column.id) === null || _column$id === void 0 ? void 0 : _column$id.startsWith('__')) && column.id !== COLUMN_ID && column.id !== COLUMN_ID$1;
20
+ return ((_column$id = column.id) === null || _column$id === void 0 ? void 0 : _column$id.startsWith('__')) && !internalColumnsPinnedToTheRight.includes(column.id);
14
21
  }).map(column => column.id);
15
22
  // columns with ordering disabled should be moved to the front
16
23
  const orderingDisabled = [];
@@ -35,11 +42,13 @@ function ensureOrdering(columns, settingsOrder) {
35
42
  });
36
43
  const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];
37
44
  // actions should always be last, enforce that
38
- if (columns.findIndex(column => column.id === COLUMN_ID || column.id === COLUMN_ID$1) > -1) {
39
- order.push(COLUMN_ID);
40
- }
45
+ internalColumnsPinnedToTheRight.forEach(id => {
46
+ if (columns.findIndex(column => column.id === id) > -1) {
47
+ order.push(id);
48
+ }
49
+ });
41
50
  return order;
42
51
  }
43
52
 
44
- export { ensureOrdering, useColumnOrdering };
45
- //# sourceMappingURL=useColumnOrdering.js.map
53
+ export { ensureOrdering, getCellMinWidth };
54
+ //# sourceMappingURL=columns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"columns.js","sources":["../../../../../../../../../src/primitives/Table/useTable/util/columns.ts"],"sourcesContent":["import { ColumnDef as ReactTableColumnDef } from '@tanstack/react-table';\nimport { TableFontSize, TableFontSizes } from '../../types';\n\n// column widths\nexport const getCellMinWidth = (fontSize: TableFontSize = 'medium') => {\n switch (fontSize) {\n case TableFontSizes.small:\n return 57;\n\n case TableFontSizes.large:\n return 83;\n\n default:\n case TableFontSizes.medium:\n return 72;\n }\n};\n\n// ordering\nexport function ensureOrdering<TType = unknown>(\n columns: ReactTableColumnDef<TType>[],\n internalColumnsPinnedToTheRight: string[],\n settingsOrder: string[] | undefined\n): string[] {\n // internal columns come with a defined order\n const internalColumns = columns\n .filter(column => column.id?.startsWith('__') && !internalColumnsPinnedToTheRight.includes(column.id))\n .map(column => column.id) as string[];\n\n // columns with ordering disabled should be moved to the front\n const orderingDisabled: string[] = [];\n const orderingEnabled: string[] = [];\n\n let orderedColumns = columns;\n\n // if settings is defined, make sure the columns that are actual children are sorted by it\n if (Array.isArray(settingsOrder)) {\n orderedColumns = columns.slice().sort(\n // the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end\n (a, b) => (settingsOrder.indexOf(a.id as string) >>> 0) - (settingsOrder.indexOf(b.id as string) >>> 0)\n );\n }\n\n orderedColumns.forEach(column => {\n if (column.id?.startsWith('__')) {\n return;\n }\n\n if (column.meta?.enableOrdering) {\n orderingEnabled.push(column.id as string);\n } else {\n orderingDisabled.push(column.id as string);\n }\n });\n\n const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];\n\n // actions should always be last, enforce that\n internalColumnsPinnedToTheRight.forEach(id => {\n if (columns.findIndex(column => column.id === id) > -1) {\n order.push(id);\n }\n });\n\n return order;\n}\n"],"names":["getCellMinWidth","fontSize","TableFontSizes","small","large","medium","ensureOrdering","columns","internalColumnsPinnedToTheRight","settingsOrder","internalColumns","filter","column","_column$id","id","startsWith","includes","map","orderingDisabled","orderingEnabled","orderedColumns","Array","isArray","slice","sort","a","b","indexOf","forEach","_column$id2","_column$meta","meta","enableOrdering","push","order","findIndex"],"mappings":";;AAGA;MACaA,eAAe,GAAGA,CAACC,WAA0B,QAAQ;EAC9D,QAAQA,QAAQ;IACZ,KAAKC,cAAc,CAACC,KAAK;MACrB,OAAO,EAAE;IAEb,KAAKD,cAAc,CAACE,KAAK;MACrB,OAAO,EAAE;IAEb;IACA,KAAKF,cAAc,CAACG,MAAM;MACtB,OAAO,EAAE;;AAErB;AAEA;SACgBC,cAAcA,CAC1BC,OAAqC,EACrCC,+BAAyC,EACzCC,aAAmC;;EAGnC,MAAMC,eAAe,GAAGH,OAAO,CAC1BI,MAAM,CAACC,MAAM;IAAA,IAAAC,UAAA;IAAA,OAAI,EAAAA,UAAA,GAAAD,MAAM,CAACE,EAAE,cAAAD,UAAA,uBAATA,UAAA,CAAWE,UAAU,CAAC,IAAI,CAAC,KAAI,CAACP,+BAA+B,CAACQ,QAAQ,CAACJ,MAAM,CAACE,EAAE,CAAC;IAAC,CACrGG,GAAG,CAACL,MAAM,IAAIA,MAAM,CAACE,EAAE,CAAa;;EAGzC,MAAMI,gBAAgB,GAAa,EAAE;EACrC,MAAMC,eAAe,GAAa,EAAE;EAEpC,IAAIC,cAAc,GAAGb,OAAO;;EAG5B,IAAIc,KAAK,CAACC,OAAO,CAACb,aAAa,CAAC,EAAE;IAC9BW,cAAc,GAAGb,OAAO,CAACgB,KAAK,EAAE,CAACC,IAAI;;IAEjC,CAACC,CAAC,EAAEC,CAAC,KAAK,CAACjB,aAAa,CAACkB,OAAO,CAACF,CAAC,CAACX,EAAY,CAAC,KAAK,CAAC,KAAKL,aAAa,CAACkB,OAAO,CAACD,CAAC,CAACZ,EAAY,CAAC,KAAK,CAAC,CAAC,CAC1G;;EAGLM,cAAc,CAACQ,OAAO,CAAChB,MAAM;;IACzB,KAAAiB,WAAA,GAAIjB,MAAM,CAACE,EAAE,cAAAe,WAAA,eAATA,WAAA,CAAWd,UAAU,CAAC,IAAI,CAAC,EAAE;MAC7B;;IAGJ,KAAAe,YAAA,GAAIlB,MAAM,CAACmB,IAAI,cAAAD,YAAA,eAAXA,YAAA,CAAaE,cAAc,EAAE;MAC7Bb,eAAe,CAACc,IAAI,CAACrB,MAAM,CAACE,EAAY,CAAC;KAC5C,MAAM;MACHI,gBAAgB,CAACe,IAAI,CAACrB,MAAM,CAACE,EAAY,CAAC;;GAEjD,CAAC;EAEF,MAAMoB,KAAK,GAAG,CAAC,GAAGxB,eAAe,EAAE,GAAGQ,gBAAgB,EAAE,GAAGC,eAAe,CAAC;;EAG3EX,+BAA+B,CAACoB,OAAO,CAACd,EAAE;IACtC,IAAIP,OAAO,CAAC4B,SAAS,CAACvB,MAAM,IAAIA,MAAM,CAACE,EAAE,KAAKA,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE;MACpDoB,KAAK,CAACD,IAAI,CAACnB,EAAE,CAAC;;GAErB,CAAC;EAEF,OAAOoB,KAAK;AAChB;;;;"}
@@ -0,0 +1,6 @@
1
+ import React__default from 'react';
2
+
3
+ const fixedForwardRef = React__default.forwardRef;
4
+
5
+ export { fixedForwardRef };
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../../../../../src/types.ts"],"sourcesContent":["import React from 'react';\nimport { AVAILABLE_COLORS } from './utils/tailwind';\n\nexport type Appearance = 'default' | 'primary' | 'danger' | 'ghost' | 'discrete' | 'transparent';\nexport type State = 'default' | 'success' | 'error' | 'warning' | 'information';\nexport type Locale = 'en-GB' | 'da-DK' | 'sv-SE' | 'no-NO';\nexport type Orientation = 'horizontal' | 'vertical';\nexport type Align = 'start' | 'center' | 'end';\nexport type Placement = 'right' | 'left' | 'top' | 'bottom';\nexport type Color = (typeof AVAILABLE_COLORS)[number];\n\n// helpers\ntype FixedForwardRef = <T, P = {}>(\n render: (props: P, ref: React.Ref<T>) => JSX.Element\n) => (props: P & React.RefAttributes<T>) => JSX.Element;\n\nexport const fixedForwardRef = React.forwardRef as FixedForwardRef;\n\nexport type ValueOf<T> = T[keyof T];\n"],"names":["fixedForwardRef","React","forwardRef"],"mappings":";;MAgBaA,eAAe,GAAGC,cAAK,CAACC;;;;"}
@@ -54,7 +54,6 @@ const parseFromCustomString = (date = '', mask = 'dd.mm.yy') => {
54
54
  Object.is(day, NaN) ? currentDate.getDate() : day, /* hours */12, /* minutes */0 // set to midday to avoid UTC offset causing dates to be mismatched server side
55
55
  );
56
56
  };
57
-
58
57
  const parseFromISOString = date => {
59
58
  const tempDate = new Date(date);
60
59
  return isValid(tempDate) ? parseFromCustomString(format(new Date(date))) : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","sources":["../../../../../../src/utils/date.ts"],"sourcesContent":["import { isDate, toDate, isValid } from 'date-fns';\n\nexport const isWeakEqual = (leftDate: Date, rightDate: Date) => {\n return (\n leftDate.getFullYear() === rightDate.getFullYear() &&\n leftDate.getMonth() === rightDate.getMonth() &&\n leftDate.getDay() === rightDate.getDay()\n );\n};\n\nexport const format = (date: Date | undefined, mask = 'dd.mm.yy'): string | undefined => {\n if (!date) {\n return undefined;\n }\n\n const value = isDate(date) ? date : toDate(date);\n\n if (!isValid(value)) {\n return undefined;\n }\n\n const pad = (v: number): string => (String(v).length === 1 ? `0${v}` : v.toString());\n\n return mask\n .replace('dd', pad(value.getDate()))\n .replace('mm', pad(value.getMonth() + 1))\n .replace('yy', String(value.getFullYear()).slice(2));\n};\n\nexport const parseFromCustomString = (date = '', mask = 'dd.mm.yy'): Date | undefined => {\n if (!date || !date.length) {\n return undefined;\n }\n\n const sanitizedMask = mask.split(/[^dmy]/);\n const dd = sanitizedMask.findIndex(x => x === 'dd');\n const mm = sanitizedMask.findIndex(x => x === 'mm');\n const yy = sanitizedMask.findIndex(x => x === 'yy' || x === 'yyyy');\n\n let day;\n let month;\n let year;\n\n const getFullYear = (y: string): string => {\n if (y && y.length === 2) {\n const z = Number.parseInt(y, 10);\n\n return z > 50 ? `19${y}` : `20${y}`;\n }\n\n return y;\n };\n\n const inputParts = date.split(/\\D/);\n\n if (inputParts.length === 1) {\n const fullDate = inputParts[0];\n const unseparatedMask = mask.replace(/[^dmy]/g, '');\n\n day = fullDate.slice(unseparatedMask.indexOf('d'), unseparatedMask.lastIndexOf('d') + 1);\n month = fullDate.slice(unseparatedMask.indexOf('m'), unseparatedMask.lastIndexOf('m') + 1);\n year = getFullYear(fullDate.slice(unseparatedMask.indexOf('y'), unseparatedMask.lastIndexOf('y') + 3)); // account for full years\n } else {\n day = inputParts[dd];\n month = inputParts[mm];\n year = getFullYear(inputParts[yy]);\n }\n\n day = Number.parseInt(day, 10);\n month = Number.parseInt(month, 10);\n year = Number.parseInt(year, 10);\n\n const currentDate = new Date();\n\n return new Date(\n /* year */ Object.is(year, NaN) ? currentDate.getFullYear() : year,\n /* month */ Object.is(month, NaN) ? currentDate.getMonth() : month - 1, // months are zero based in javascript, so subtract a day\n /* day */ Object.is(day, NaN) ? currentDate.getDate() : day,\n /* hours */ 12,\n /* minutes */ 0 // set to midday to avoid UTC offset causing dates to be mismatched server side\n );\n};\n\nexport const parseFromISOString = (date: string): Date | undefined => {\n const tempDate = new Date(date);\n return isValid(tempDate) ? parseFromCustomString(format(new Date(date))) : undefined;\n};\n"],"names":["isWeakEqual","leftDate","rightDate","getFullYear","getMonth","getDay","format","date","mask","undefined","value","isDate","toDate","isValid","pad","v","String","length","toString","replace","getDate","slice","parseFromCustomString","sanitizedMask","split","dd","findIndex","x","mm","yy","day","month","year","y","z","Number","parseInt","inputParts","fullDate","unseparatedMask","indexOf","lastIndexOf","currentDate","Date","Object","is","NaN","parseFromISOString","tempDate"],"mappings":";;MAEaA,WAAW,GAAGA,CAACC,QAAc,EAAEC,SAAe;EACvD,OACID,QAAQ,CAACE,WAAW,EAAE,KAAKD,SAAS,CAACC,WAAW,EAAE,IAClDF,QAAQ,CAACG,QAAQ,EAAE,KAAKF,SAAS,CAACE,QAAQ,EAAE,IAC5CH,QAAQ,CAACI,MAAM,EAAE,KAAKH,SAAS,CAACG,MAAM,EAAE;AAEhD;MAEaC,MAAM,GAAGA,CAACC,IAAsB,EAAEC,IAAI,GAAG,UAAU;EAC5D,IAAI,CAACD,IAAI,EAAE;IACP,OAAOE,SAAS;;EAGpB,MAAMC,KAAK,GAAGC,MAAM,CAACJ,IAAI,CAAC,GAAGA,IAAI,GAAGK,MAAM,CAACL,IAAI,CAAC;EAEhD,IAAI,CAACM,OAAO,CAACH,KAAK,CAAC,EAAE;IACjB,OAAOD,SAAS;;EAGpB,MAAMK,GAAG,GAAIC,CAAS,IAAcC,MAAM,CAACD,CAAC,CAAC,CAACE,MAAM,KAAK,CAAC,OAAOF,GAAG,GAAGA,CAAC,CAACG,QAAQ,EAAG;EAEpF,OAAOV,IAAI,CACNW,OAAO,CAAC,IAAI,EAAEL,GAAG,CAACJ,KAAK,CAACU,OAAO,EAAE,CAAC,CAAC,CACnCD,OAAO,CAAC,IAAI,EAAEL,GAAG,CAACJ,KAAK,CAACN,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CACxCe,OAAO,CAAC,IAAI,EAAEH,MAAM,CAACN,KAAK,CAACP,WAAW,EAAE,CAAC,CAACkB,KAAK,CAAC,CAAC,CAAC,CAAC;AAC5D;MAEaC,qBAAqB,G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CAAC,GAAG1B,qBAAqB,CAAChB,MAAM,CAAC,IAAIqC,IAAI,CAACpC,IAAI,CAAC,CAAC,CAAC,GAAGE,SAAS;AACxF;;;;"}
1
+ {"version":3,"file":"date.js","sources":["../../../../../../src/utils/date.ts"],"sourcesContent":["import { isDate, toDate, isValid } from 'date-fns';\n\nexport const isWeakEqual = (leftDate: Date, rightDate: Date) => {\n return (\n leftDate.getFullYear() === rightDate.getFullYear() &&\n leftDate.getMonth() === rightDate.getMonth() &&\n leftDate.getDay() === rightDate.getDay()\n );\n};\n\nexport const format = (date: Date | undefined, mask = 'dd.mm.yy'): string | undefined => {\n if (!date) {\n return undefined;\n }\n\n const value = isDate(date) ? date : toDate(date);\n\n if (!isValid(value)) {\n return undefined;\n }\n\n const pad = (v: number): string => (String(v).length === 1 ? `0${v}` : v.toString());\n\n return mask\n .replace('dd', pad(value.getDate()))\n .replace('mm', pad(value.getMonth() + 1))\n .replace('yy', String(value.getFullYear()).slice(2));\n};\n\nexport const parseFromCustomString = (date = '', mask = 'dd.mm.yy'): Date | undefined => {\n if (!date || !date.length) {\n return undefined;\n }\n\n const sanitizedMask = mask.split(/[^dmy]/);\n const dd = sanitizedMask.findIndex(x => x === 'dd');\n const mm = sanitizedMask.findIndex(x => x === 'mm');\n const yy = sanitizedMask.findIndex(x => x === 'yy' || x === 'yyyy');\n\n let day;\n let month;\n let year;\n\n const getFullYear = (y: string): string => {\n if (y && y.length === 2) {\n const z = Number.parseInt(y, 10);\n\n return z > 50 ? `19${y}` : `20${y}`;\n }\n\n return y;\n };\n\n const inputParts = date.split(/\\D/);\n\n if (inputParts.length === 1) {\n const fullDate = inputParts[0];\n const unseparatedMask = mask.replace(/[^dmy]/g, '');\n\n day = fullDate.slice(unseparatedMask.indexOf('d'), unseparatedMask.lastIndexOf('d') + 1);\n month = fullDate.slice(unseparatedMask.indexOf('m'), unseparatedMask.lastIndexOf('m') + 1);\n year = getFullYear(fullDate.slice(unseparatedMask.indexOf('y'), unseparatedMask.lastIndexOf('y') + 3)); // account for full years\n } else {\n day = inputParts[dd];\n month = inputParts[mm];\n year = getFullYear(inputParts[yy]);\n }\n\n day = Number.parseInt(day, 10);\n month = Number.parseInt(month, 10);\n year = Number.parseInt(year, 10);\n\n const currentDate = new Date();\n\n return new Date(\n /* year */ Object.is(year, NaN) ? currentDate.getFullYear() : year,\n /* month */ Object.is(month, NaN) ? currentDate.getMonth() : month - 1, // months are zero based in javascript, so subtract a day\n /* day */ Object.is(day, NaN) ? currentDate.getDate() : day,\n /* hours */ 12,\n /* minutes */ 0 // set to midday to avoid UTC offset causing dates to be mismatched server side\n );\n};\n\nexport const parseFromISOString = (date: string): Date | undefined => {\n const tempDate = new Date(date);\n return isValid(tempDate) ? parseFromCustomString(format(new Date(date))) : undefined;\n};\n"],"names":["isWeakEqual","leftDate","rightDate","getFullYear","getMonth","getDay","format","date","mask","undefined","value","isDate","toDate","isValid","pad","v","String","length","toString","replace","getDate","slice","parseFromCustomString","sanitizedMask","split","dd","findIndex","x","mm","yy","day","month","year","y","z","Number","parseInt","inputParts","fullDate","unseparatedMask","indexOf","lastIndexOf","currentDate","Date","Object","is","NaN","parseFromISOString","tempDate"],"mappings":";;MAEaA,WAAW,GAAGA,CAACC,QAAc,EAAEC,SAAe;EACvD,OACID,QAAQ,CAACE,WAAW,EAAE,KAAKD,SAAS,CAACC,WAAW,EAAE,IAClDF,QAAQ,CAACG,QAAQ,EAAE,KAAKF,SAAS,CAACE,QAAQ,EAAE,IAC5CH,QAAQ,CAACI,MAAM,EAAE,KAAKH,SAAS,CAACG,MAAM,EAAE;AAEhD;MAEaC,MAAM,GAAGA,CAACC,IAAsB,EAAEC,IAAI,GAAG,UAAU;EAC5D,IAAI,CAACD,IAAI,EAAE;IACP,OAAOE,SAAS;;EAGpB,MAAMC,KAAK,GAAGC,MAAM,CAACJ,IAAI,CAAC,GAAGA,IAAI,GAAGK,MAAM,CAACL,IAAI,CAAC;EAEhD,IAAI,CAACM,OAAO,CAACH,KAA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