@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
@@ -13,6 +13,8 @@ import { useTableRefInstanceSetup } from './hooks/useTableRefInstanceSetup.js';
13
13
  import { Summary } from './components/columns/footer/Summary.js';
14
14
  import { useCssVars } from './hooks/useCssVars.js';
15
15
  import { useHeaderOffsetStyle } from './hooks/features/useHeaderOffsetStyle.js';
16
+ import { ErrorAlert } from './components/alert/ErrorAlert.js';
17
+ import { fixedForwardRef } from '../../types.js';
16
18
  export { useTable3DataLoader } from './hooks/useTableDataLoader.js';
17
19
 
18
20
  function Column(_) {
@@ -23,21 +25,19 @@ function Group(_) {
23
25
  return null;
24
26
  }
25
27
  Group.displayName = 'Table3Group';
26
- // Cast the old forwardRef to the new one
27
- const fixedForwardRef = React__default.forwardRef;
28
28
  const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
29
29
  const {
30
30
  emptyState: EmptyState,
31
31
  customSettings,
32
32
  toolbarLeft,
33
33
  toolbarRight,
34
- defaultCurrentRowIndex
34
+ defaultCurrentRowIndex: defaultRowActiveIndex
35
35
  } = props;
36
36
  const internalRef = useMergedRef(ref);
37
37
  const {
38
38
  table,
39
39
  length
40
- } = useTable(props);
40
+ } = useTable(props, internalRef);
41
41
  useTableRefInstanceSetup(table, internalRef);
42
42
  React__default.useEffect(() => {
43
43
  if (props.autoFocus) {
@@ -56,8 +56,8 @@ const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
56
56
  // On a very first render, the tanstack table rendered without any rows,
57
57
  // so we delaying default row scrolling logic with using of requestAnimation frame
58
58
  const animationFrameId = requestAnimationFrame(() => {
59
- if (defaultCurrentRowIndex) {
60
- scrollToIndex(defaultCurrentRowIndex, {
59
+ if (defaultRowActiveIndex) {
60
+ scrollToIndex(defaultRowActiveIndex, {
61
61
  align: 'center'
62
62
  });
63
63
  }
@@ -73,12 +73,15 @@ const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
73
73
  const eventOriginatedFromCombobox = !!target.closest('[role="combobox"]');
74
74
  // Don't trigger global shortcuts on the table if event originated from a combobox or if table is
75
75
  // outside the dialog
76
- if (eventOriginatedFromCombobox || dialog && !(dialog !== null && dialog !== void 0 && dialog.contains(internalRef.current))) {
76
+ if (eventOriginatedFromCombobox || dialog && !(dialog !== null && dialog !== void 0 && dialog.contains(internalRef.current)) || tableMeta.shortcutsState.isPaused) {
77
77
  return;
78
78
  }
79
- tableMeta.hoverState.handleKeyDown(event);
80
- tableMeta.currentRow.handleKeyDown(event, table.getRowModel().rows.length, scrollToIndex, tableMeta.editing.isEditing, internalRef);
81
- tableMeta.rowClick.handleKeyDown(event, table);
79
+ const rows = table.getRowModel().rows;
80
+ tableMeta.rowActive.handleKeyDown(event, rows.length, scrollToIndex, tableMeta.editing.isEditing ? undefined : internalRef);
81
+ if (tableMeta.rowActive.rowActiveIndex !== undefined) {
82
+ var _rows$tableMeta$rowAc;
83
+ tableMeta.rowClick.handleKeyDown(event, (_rows$tableMeta$rowAc = rows[tableMeta.rowActive.rowActiveIndex]) === null || _rows$tableMeta$rowAc === void 0 ? void 0 : _rows$tableMeta$rowAc.original);
84
+ }
82
85
  tableMeta.rowSelection.handleKeyDown(event, table);
83
86
  tableMeta.editing.handleKeyDown(event);
84
87
  };
@@ -90,16 +93,16 @@ const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
90
93
  // See https://github.com/e-conomic/taco/blob/dev/packages/taco/src/components/Table3/strategies/virtualised.tsx#L143
91
94
  // scrollToIndex function changes when row count changes, so it is important to update handlers with new
92
95
  // scrollToIndex function.
93
- [scrollToIndex, tableMeta.editing.isEditing, internalRef.current]);
96
+ [scrollToIndex, tableMeta.editing.isEditing, internalRef.current, tableMeta.rowActive.rowActiveIndex]);
94
97
  const handleBlur = tableMeta.editing.isEnabled ? event => {
95
98
  tableMeta.editing.handleBlur(event);
96
99
  } : undefined;
97
- const handleFocus = tableMeta.currentRow.currentRowIndex === undefined ? event => {
98
- tableMeta.currentRow.handleFocus(event, table.getRowModel().rows.length, scrollToIndex);
100
+ const handleFocus = tableMeta.rowActive.rowActiveIndex === undefined ? event => {
101
+ tableMeta.rowActive.handleFocus(event, table.getRowModel().rows.length, scrollToIndex);
99
102
  } : undefined;
100
103
  // mouse capture fires before focus, so we can prevent propagation and stop double setting of the active row
101
- const handleMouseCapture = tableMeta.currentRow.currentRowIndex === undefined ? event => {
102
- tableMeta.currentRow.handleMouseCapture(event, table.getRowModel().rows.length);
104
+ const handleMouseCapture = tableMeta.rowActive.rowActiveIndex === undefined ? event => {
105
+ tableMeta.rowActive.handleMouseCapture(event, table.getRowModel().rows.length);
103
106
  } : undefined;
104
107
  const handleScroll = function (event) {
105
108
  try {
@@ -118,7 +121,7 @@ const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
118
121
  // if the table is a print table or not.
119
122
  const {
120
123
  style: cssGridStyle
121
- } = useCssGrid(table, tableMeta.isPrinting, tableMeta.rowActions.actionsForRowLength, tableMeta.fontSize.size);
124
+ } = useCssGrid(table, tableMeta.printing.isPrinting, tableMeta.rowActions.actionsForRowLength, tableMeta.fontSize.size);
122
125
  const {
123
126
  style: cssVars
124
127
  } = useCssVars(tableMeta.rowHeight.height, tableMeta.fontSize.size);
@@ -132,12 +135,11 @@ const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
132
135
  const columnFreezingStyle = useColumnFreezingStyle(props.id, table);
133
136
  const headerOffsetStyle = useHeaderOffsetStyle(props.id, table);
134
137
  const isServerLoadingAndNotReady = tableMeta.isUsingServer && props.length === undefined;
135
- const isPrinting = tableMeta.isPrinting;
136
138
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, columnFreezingStyle ? /*#__PURE__*/React__default.createElement("style", {
137
139
  "data-taco": "table3-column-freezing-styles"
138
- }, columnFreezingStyle) : null, headerOffsetStyle && !isPrinting ? /*#__PURE__*/React__default.createElement("style", {
140
+ }, columnFreezingStyle) : null, headerOffsetStyle && !tableMeta.printing.isPrinting ? ( /*#__PURE__*/React__default.createElement("style", {
139
141
  "data-taco": "table3-column-header-offset-styles"
140
- }, headerOffsetStyle) : null, /*#__PURE__*/React__default.createElement(Toolbar, {
142
+ }, headerOffsetStyle)) : null, /*#__PURE__*/React__default.createElement(Toolbar, {
141
143
  table: table,
142
144
  tableProps: props,
143
145
  total: length,
@@ -145,13 +147,18 @@ const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
145
147
  right: toolbarRight,
146
148
  customSettings: customSettings,
147
149
  scrollToIndex: scrollToIndex
150
+ }), /*#__PURE__*/React__default.createElement(ErrorAlert, {
151
+ table: table,
152
+ tableRef: internalRef,
153
+ scrollToIndex: scrollToIndex,
154
+ rowIdentifier: props.rowIdentifier
148
155
  }), /*#__PURE__*/React__default.createElement("div", {
149
156
  className: className,
150
157
  id: props.id,
151
158
  "data-font-size": tableMeta.fontSize.size,
152
159
  "data-editing": tableMeta.editing.isEditing,
153
160
  "data-horizontally-scrolled": tableMeta.columnFreezing.horizontallyScrolled,
154
- "data-pause-hover": tableMeta === null || tableMeta === void 0 ? void 0 : tableMeta.hoverState.isPaused,
161
+ "data-pause-hover": tableMeta === null || tableMeta === void 0 ? void 0 : tableMeta.rowActive.isHoverStatePaused,
155
162
  "data-resizing": !!state.columnSizingInfo.isResizingColumn,
156
163
  "data-taco": "table2",
157
164
  onBlur: handleBlur,
@@ -161,11 +168,11 @@ const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
161
168
  role: "table",
162
169
  style: style,
163
170
  tabIndex: -1
164
- }, isServerLoadingAndNotReady ? null : /*#__PURE__*/React__default.createElement("div", {
171
+ }, isServerLoadingAndNotReady ? null : ( /*#__PURE__*/React__default.createElement("div", {
165
172
  className: "group/header contents",
166
173
  "data-taco": "table2-header",
167
174
  role: "rowgroup"
168
- }, table.getHeaderGroups().map(headerGroup => /*#__PURE__*/React__default.createElement("div", {
175
+ }, table.getHeaderGroups().map(headerGroup => ( /*#__PURE__*/React__default.createElement("div", {
169
176
  className: "contents",
170
177
  key: headerGroup.id,
171
178
  role: "row"
@@ -181,7 +188,7 @@ const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
181
188
  scrollToIndex,
182
189
  hasSeparator
183
190
  }));
184
- })))), table.getRowModel().rows.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(FocusScope, {
191
+ })))))), table.getRowModel().rows.length ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(FocusScope, {
185
192
  autoFocus: tableMeta.editing.isEditing
186
193
  }, /*#__PURE__*/React__default.createElement("div", {
187
194
  onMouseDownCapture: handleMouseCapture,
@@ -191,25 +198,25 @@ const Table = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
191
198
  ref: bodyRef
192
199
  }, renderBody())), /*#__PURE__*/React__default.createElement("div", {
193
200
  className: "border-grey-300 col-span-full translate-y-px border-t"
194
- }), tableMeta.enableFooter ? /*#__PURE__*/React__default.createElement("div", {
201
+ }), tableMeta.enableFooter ? ( /*#__PURE__*/React__default.createElement("div", {
195
202
  className: "group/footer contents",
196
203
  "data-taco": "table2-footer",
197
204
  role: "rowgroup"
198
205
  },
199
206
  // Render the footer cell only for individual columns, excluding column groups.
200
- table.getFooterGroups().slice(0, 1).map(footerGroup => /*#__PURE__*/React__default.createElement("div", {
207
+ table.getFooterGroups().slice(0, 1).map(footerGroup => ( /*#__PURE__*/React__default.createElement("div", {
201
208
  className: "contents",
202
209
  key: footerGroup.id,
203
210
  role: "row"
204
- }, footerGroup.headers.map(footer => /*#__PURE__*/React__default.createElement(React__default.Fragment, {
211
+ }, footerGroup.headers.map(footer => ( /*#__PURE__*/React__default.createElement(React__default.Fragment, {
205
212
  key: footer.id
206
- }, flexRender(footer.column.columnDef.footer, footer.getContext()))))), length ? /*#__PURE__*/React__default.createElement(Summary, {
213
+ }, flexRender(footer.column.columnDef.footer, footer.getContext()))))))), length ? ( /*#__PURE__*/React__default.createElement(Summary, {
207
214
  currentLength: table.getRowModel().rows.length,
208
215
  length: length,
209
216
  table: table
210
- }) : null) : null) : /*#__PURE__*/React__default.createElement("div", {
217
+ })) : null)) : null)) : ( /*#__PURE__*/React__default.createElement("div", {
211
218
  className: "col-span-full min-h-[theme(spacing.8)]"
212
- }, EmptyState ? /*#__PURE__*/React__default.createElement(EmptyState, null) : null)));
219
+ }, EmptyState ? /*#__PURE__*/React__default.createElement(EmptyState, null) : null))));
213
220
  });
214
221
  const Table3 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
215
222
  const stringifiedChildren = String(props.children);
@@ -224,5 +231,5 @@ const Table3 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
224
231
  Table3.Column = Column;
225
232
  Table3.Group = Group;
226
233
 
227
- export { Table3, fixedForwardRef };
234
+ export { Table3 };
228
235
  //# sourceMappingURL=Table3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table3.js","sources":["../../../../../../../src/components/Table3/Table3.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { flexRender, TableMeta } from '@tanstack/react-table';\nimport { FocusScope } from '@react-aria/focus';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { useCssGrid } from './hooks/useCssGrid';\nimport { useTable } from './hooks/useTable';\nimport { useTableRenderStrategy } from './strategies';\nimport { Table3ColumnProps, Table3GroupProps, Table3Props, Table3Ref } from './types';\nimport { Toolbar } from './components/toolbar/Toolbar';\nimport { useColumnFreezingStyle } from './hooks/features/useColumnFreezing';\nimport { useTableRefInstanceSetup } from './hooks/useTableRefInstanceSetup';\nimport { Summary } from './components/columns/footer/Summary';\nimport { useCssVars } from './hooks/useCssVars';\nimport './style.css';\nimport { useHeaderOffsetStyle } from './hooks/features/useHeaderOffsetStyle';\nimport { FONT_SIZE } from './components/toolbar/FontSize';\n\nfunction Column<TType = unknown>(_: Table3ColumnProps<TType>) {\n return null;\n}\nColumn.displayName = 'Table3Column';\n\nfunction Group(_: Table3GroupProps) {\n return null;\n}\nGroup.displayName = 'Table3Group';\n\ntype FixedForwardRef = <T, P = {}>(\n render: (props: P, ref: React.Ref<T>) => JSX.Element\n) => (props: P & React.RefAttributes<T>) => JSX.Element;\n\n// Cast the old forwardRef to the new one\nexport const fixedForwardRef = React.forwardRef as FixedForwardRef;\n\nconst Table = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const { emptyState: EmptyState, customSettings, toolbarLeft, toolbarRight, defaultCurrentRowIndex } = props;\n const internalRef = useMergedRef<Table3Ref>(ref);\n\n const { table, length } = useTable<TType>(props);\n useTableRefInstanceSetup(table, internalRef);\n\n React.useEffect(() => {\n if (props.autoFocus) {\n internalRef.current?.focus();\n }\n }, []);\n\n const { renderBody, scrollToIndex } = useTableRenderStrategy<TType>(props, table, internalRef);\n const tableMeta = table.options.meta as TableMeta<TType>;\n const state = table.getState();\n\n const bodyRef = React.useRef<HTMLDivElement | null>(null);\n\n React.useEffect(() => {\n // On a very first render, the tanstack table rendered without any rows,\n // so we delaying default row scrolling logic with using of requestAnimation frame\n const animationFrameId = requestAnimationFrame(() => {\n if (defaultCurrentRowIndex) {\n scrollToIndex(defaultCurrentRowIndex, { align: 'center' });\n }\n });\n\n return () => {\n cancelAnimationFrame(animationFrameId);\n };\n }, []);\n\n React.useEffect(\n () => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n const dialog = target.closest('[role=\"dialog\"]');\n const eventOriginatedFromCombobox = !!target.closest('[role=\"combobox\"]');\n\n // Don't trigger global shortcuts on the table if event originated from a combobox or if table is\n // outside the dialog\n if (eventOriginatedFromCombobox || (dialog && !dialog?.contains(internalRef.current))) {\n return;\n }\n\n tableMeta.hoverState.handleKeyDown(event);\n tableMeta.currentRow.handleKeyDown(\n event,\n table.getRowModel().rows.length,\n scrollToIndex,\n tableMeta.editing.isEditing,\n internalRef\n );\n tableMeta.rowClick.handleKeyDown(event, table);\n tableMeta.rowSelection.handleKeyDown(event, table);\n tableMeta.editing.handleKeyDown(event);\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n },\n // See https://github.com/e-conomic/taco/blob/dev/packages/taco/src/components/Table3/strategies/virtualised.tsx#L143\n // scrollToIndex function changes when row count changes, so it is important to update handlers with new\n // scrollToIndex function.\n [scrollToIndex, tableMeta.editing.isEditing, internalRef.current]\n );\n\n const handleBlur = tableMeta.editing.isEnabled\n ? (event: React.FocusEvent) => {\n tableMeta.editing.handleBlur(event);\n }\n : undefined;\n\n const handleFocus =\n tableMeta.currentRow.currentRowIndex === undefined\n ? (event: React.FocusEvent) => {\n tableMeta.currentRow.handleFocus(event, table.getRowModel().rows.length, scrollToIndex);\n }\n : undefined;\n\n // mouse capture fires before focus, so we can prevent propagation and stop double setting of the active row\n const handleMouseCapture =\n tableMeta.currentRow.currentRowIndex === undefined\n ? (event: React.MouseEvent) => {\n tableMeta.currentRow.handleMouseCapture(event, table.getRowModel().rows.length);\n }\n : undefined;\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n tableMeta.columnFreezing.handleScroll(event);\n };\n\n const className = cn(\n 'border-grey-300 relative grid h-full w-full flex-grow overflow-auto rounded border bg-white scroll-mt-[41px] focus-visible:outline-none',\n '[&[data-resizing=\"true\"]]:select-none',\n {\n 'text-xs': tableMeta.fontSize.size === FONT_SIZE.small,\n 'text-sm': tableMeta.fontSize.size === FONT_SIZE.medium,\n 'text-base': tableMeta.fontSize.size === FONT_SIZE.large,\n }\n );\n\n // Print tables have \"_print\" as the postfix for the table id, so we can use the it to determine\n // if the table is a print table or not.\n const { style: cssGridStyle } = useCssGrid<TType>(\n table,\n tableMeta.isPrinting,\n tableMeta.rowActions.actionsForRowLength,\n tableMeta.fontSize.size\n );\n const { style: cssVars } = useCssVars(tableMeta.rowHeight.height, tableMeta.fontSize.size);\n\n const style = {\n ...cssVars,\n ...cssGridStyle,\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n opacity: 0.999,\n };\n\n const columnFreezingStyle = useColumnFreezingStyle(props.id, table);\n const headerOffsetStyle = useHeaderOffsetStyle(props.id, table);\n const isServerLoadingAndNotReady = tableMeta.isUsingServer && props.length === undefined;\n const isPrinting = tableMeta.isPrinting;\n\n return (\n <>\n {columnFreezingStyle ? <style data-taco=\"table3-column-freezing-styles\">{columnFreezingStyle}</style> : null}\n {headerOffsetStyle && !isPrinting ? (\n <style data-taco=\"table3-column-header-offset-styles\">{headerOffsetStyle}</style>\n ) : null}\n <Toolbar\n table={table}\n tableProps={props}\n total={length}\n left={toolbarLeft}\n right={toolbarRight}\n customSettings={customSettings}\n scrollToIndex={scrollToIndex}\n />\n <div\n className={className}\n id={props.id}\n data-font-size={tableMeta.fontSize.size}\n data-editing={tableMeta.editing.isEditing}\n data-horizontally-scrolled={tableMeta.columnFreezing.horizontallyScrolled}\n data-pause-hover={tableMeta?.hoverState.isPaused}\n data-resizing={!!state.columnSizingInfo.isResizingColumn}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onFocus={handleFocus}\n onScroll={handleScroll}\n ref={internalRef}\n role=\"table\"\n style={style}\n tabIndex={-1}>\n {isServerLoadingAndNotReady ? null : (\n <div className=\"group/header contents\" data-taco=\"table2-header\" role=\"rowgroup\">\n {table.getHeaderGroups().map(headerGroup => (\n <div className=\"contents\" key={headerGroup.id} role=\"row\">\n {headerGroup.headers.map((header, index) => {\n // We need to render separator if column is not the last in array, if index is not equal to freeze column index,\n // if next element is not placeholder and if column itself is not placeholder.\n const hasSeparator =\n index !== tableMeta.columnFreezing.frozenColumnIndex &&\n index !== headerGroup.headers.length - 1 &&\n (!headerGroup.headers[index + 1]?.isPlaceholder || !header.isPlaceholder);\n return (\n <React.Fragment key={header.id}>\n {flexRender(header.column.columnDef.header, {\n ...header.getContext(),\n scrollToIndex,\n hasSeparator,\n })}\n </React.Fragment>\n );\n })}\n </div>\n ))}\n </div>\n )}\n {table.getRowModel().rows.length ? (\n <>\n <FocusScope autoFocus={tableMeta.editing.isEditing}>\n <div\n onMouseDownCapture={handleMouseCapture}\n className=\"group/body contents\"\n data-taco=\"table2-body\"\n role=\"rowgroup\"\n ref={bodyRef}>\n {renderBody()}\n </div>\n </FocusScope>\n {/* This div makes sure that there is always a free space between the rows and footer when\n table height exceeds the cumulative height of all rows. See useCSSGrid.ts */}\n {/* By vertically translating the div a pixel down, we hide the div border below footer so that\n the footer border doesn't appear an extra pixel thick */}\n <div className=\"border-grey-300 col-span-full translate-y-px border-t\" />\n {tableMeta.enableFooter ? (\n <div className=\"group/footer contents\" data-taco=\"table2-footer\" role=\"rowgroup\">\n {\n // Render the footer cell only for individual columns, excluding column groups.\n table\n .getFooterGroups()\n .slice(0, 1)\n .map(footerGroup => (\n <div className=\"contents\" key={footerGroup.id} role=\"row\">\n {footerGroup.headers.map(footer => (\n <React.Fragment key={footer.id}>\n {flexRender(footer.column.columnDef.footer, footer.getContext())}\n </React.Fragment>\n ))}\n </div>\n ))\n }\n {length ? (\n <Summary currentLength={table.getRowModel().rows.length} length={length} table={table} />\n ) : null}\n </div>\n ) : null}\n </>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n </div>\n </>\n );\n});\n\ntype Table3WithStatics = (<TType = unknown>(props: Table3Props<TType> & React.RefAttributes<Table3Ref>) => JSX.Element) & {\n Column: typeof Column;\n Group: typeof Group;\n};\n\nexport const Table3 = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const stringifiedChildren = String(props.children);\n // we force a remount (using key) when the child columns change because there are too many places to add children as an effect\n // this is cheaper from a complexity perspective, and probably performance wise as well\n const key = React.useMemo(() => String('tableKey_' + stringifiedChildren), [stringifiedChildren]);\n return <Table<TType> {...props} key={key} ref={ref} />;\n}) as Table3WithStatics;\nTable3.Column = Column;\nTable3.Group = Group;\n\n// hooks\nexport { useTable3DataLoader } from './hooks/useTableDataLoader';\n\n// types\nexport type {\n useTable3DataFetcher,\n useTable3DataOptions,\n useTable3DataFetcherValues as useTableDataValues,\n} from './hooks/useTableDataLoader';\n\nexport type {\n Table3Ref,\n Table3Props,\n Table3Preset,\n Table3Settings,\n Table3SettingsHandler,\n Table3RowHeight,\n Table3FilterComparator,\n Table3FilterHandler,\n Table3LoadPageHandler,\n Table3LoadAllHandler,\n Table3RowGotoHandler,\n Table3SortHandler,\n Table3Shortcuts,\n Table3ShortcutHandlerFn,\n Table3ShortcutHandlerObject,\n Table3FontSize,\n Table3SortDirection,\n Table3SortFn,\n Table3RowActionRenderer,\n Table3RowSelectionHandler,\n Table3RowExpansionRenderer,\n Table3RowDropHandler,\n Table3RowDragHandler,\n Table3RowClickHandler,\n Table3ColumnProps,\n Table3ColumnAlignment,\n Table3ColumnDataType,\n Table3ColumnHeaderMenu,\n Table3ColumnClassNameHandler,\n Table3ColumnFooterRenderer,\n Table3ColumnRenderer,\n Table3ColumnControlRenderer,\n Table3ColumnControlProps,\n} from './types';\n"],"names":["Column","_","displayName","Group","fixedForwardRef","React","forwardRef","Table","Table3","props","ref","emptyState","EmptyState","customSettings","toolbarLeft","toolbarRight","defaultCurrentRowIndex","internalRef","useMergedRef","table","length","useTable","useTableRefInstanceSetup","useEffect","autoFocus","_internalRef$current","current","focus","renderBody","scrollToIndex","useTableRenderStrategy","tableMeta","options","meta","state","getState","bodyRef","useRef","animationFrameId","requestAnimationFrame","align","cancelAnimationFrame","handleKeyDown","event","target","dialog","closest","eventOriginatedFromCombobox","contains","hoverState","currentRow","getRowModel","rows","editing","isEditing","rowClick","rowSelection","document","addEventListener","removeEventListener","handleBlur","isEnabled","undefined","handleFocus","currentRowIndex","handleMouseCapture","handleScroll","columnFreezing","Promise","resolve","e","reject","className","cn","fontSize","size","FONT_SIZE","small","medium","large","style","cssGridStyle","useCssGrid","isPrinting","rowActions","actionsForRowLength","cssVars","useCssVars","rowHeight","height","opacity","columnFreezingStyle","useColumnFreezingStyle","id","headerOffsetStyle","useHeaderOffsetStyle","isServerLoadingAndNotReady","isUsingServer","Toolbar","tableProps","total","left","right","horizontallyScrolled","isPaused","columnSizingInfo","isResizingColumn","onBlur","onFocus","onScroll","role","tabIndex","getHeaderGroups","map","headerGroup","key","headers","header","index","hasSeparator","frozenColumnIndex","_headerGroup$headers","isPlaceholder","Fragment","flexRender","column","columnDef","getContext","FocusScope","onMouseDownCapture","enableFooter","getFooterGroups","slice","footerGroup","footer","Summary","currentLength","stringifiedChildren","String","children","useMemo"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAASA,MAAMA,CAAkBC,CAA2B;EACxD,OAAO,IAAI;AACf;AACAD,MAAM,CAACE,WAAW,GAAG,cAAc;AAEnC,SAASC,KAAKA,CAACF,CAAmB;EAC9B,OAAO,IAAI;AACf;AACAE,KAAK,CAACD,WAAW,GAAG,aAAa;AAMjC;MACaE,eAAe,GAAGC,cAAK,CAACC;AAErC,MAAMC,KAAK,gBAAGH,eAAe,CAAC,SAASI,MAAMA,CAAkBC,KAAyB,EAAEC,GAAyB;EAC/G,MAAM;IAAEC,UAAU,EAAEC,UAAU;IAAEC,cAAc;IAAEC,WAAW;IAAEC,YAAY;IAAEC;GAAwB,GAAGP,KAAK;EAC3G,MAAMQ,WAAW,GAAGC,YAAY,CAAYR,GAAG,CAAC;EAEhD,MAAM;IAAES,KAAK;IAAEC;GAAQ,GAAGC,QAAQ,CAAQZ,KAAK,CAAC;EAChDa,wBAAwB,CAACH,KAAK,EAAEF,WAAW,CAAC;EAE5CZ,cAAK,CAACkB,SAAS,CAAC;IACZ,IAAId,KA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3BjI,6BAACA,cAAK,CAACsH,QAAQ;IAACR,GAAG,EAAEmB,MAAM,CAACzC;KACvB+B,UAAU,CAACU,MAAM,CAACT,MAAM,CAACC,SAAS,CAACQ,MAAM,EAAEA,MAAM,CAACP,UAAU,EAAE,CAAC,CAEvE,CAAC,CAET,CAAC,EAET3G,MAAM,gBACHf,6BAACkI,OAAO;IAACC,aAAa,EAAErH,KAAK,CAACgC,WAAW,EAAE,CAACC,IAAI,CAAChC,MAAM;IAAEA,MAAM,EAAEA,MAAM;IAAED,KAAK,EAAEA;IAAS,GACzF,IAAI,CACN,GACN,IAAI,CACT,gBAEHd;IAAKmE,SAAS,EAAC;KAA0C5D,UAAU,gBAAGP,6BAACO,UAAU,OAAG,GAAG,IAAI,CAC9F,CACC,CACP;AAEX,CAAC,CAAC;MAOWJ,MAAM,gBAAGJ,eAAe,CAAC,SAASI,MAAMA,CAAkBC,KAAyB,EAAEC,GAAyB;EACvH,MAAM+H,mBAAmB,GAAGC,MAAM,CAACjI,KAAK,CAACkI,QAAQ,CAAC;;;EAGlD,MAAMxB,GAAG,GAAG9G,cAAK,CAACuI,OAAO,CAAC,MAAMF,MAAM,CAAC,WAAW,GAAGD,mBAAmB,CAAC,EAAE,CAACA,mBAAmB,CAAC,CAAC;EACjG,oBAAOpI,6BAACE,KAAK,oBAAYE,KAAK;IAAE0G,GAAG,EAAEA,GAAG;IAAEzG,GAAG,EAAEA;KAAO;AAC1D,CAAC;AACDF,MAAM,CAACR,MAAM,GAAGA,MAAM;AACtBQ,MAAM,CAACL,KAAK,GAAGA,KAAK;;;;"}
1
+ {"version":3,"file":"Table3.js","sources":["../../../../../../../src/components/Table3/Table3.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { flexRender, TableMeta } from '@tanstack/react-table';\nimport { FocusScope } from '@react-aria/focus';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { useCssGrid } from './hooks/useCssGrid';\nimport { useTable } from './hooks/useTable';\nimport { useTableRenderStrategy } from './strategies';\nimport { Table3ColumnProps, Table3GroupProps, Table3Props, Table3Ref } from './types';\nimport { Toolbar } from './components/toolbar/Toolbar';\nimport { useColumnFreezingStyle } from './hooks/features/useColumnFreezing';\nimport { useTableRefInstanceSetup } from './hooks/useTableRefInstanceSetup';\nimport { Summary } from './components/columns/footer/Summary';\nimport { useCssVars } from './hooks/useCssVars';\nimport './style.css';\nimport { useHeaderOffsetStyle } from './hooks/features/useHeaderOffsetStyle';\nimport { FONT_SIZE } from './components/toolbar/FontSize';\nimport { ErrorAlert } from './components/alert/ErrorAlert';\nimport { fixedForwardRef } from '../../types';\n\nfunction Column<TType = unknown>(_: Table3ColumnProps<TType>) {\n return null;\n}\nColumn.displayName = 'Table3Column';\n\nfunction Group(_: Table3GroupProps) {\n return null;\n}\nGroup.displayName = 'Table3Group';\n\nconst Table = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const {\n emptyState: EmptyState,\n customSettings,\n toolbarLeft,\n toolbarRight,\n defaultCurrentRowIndex: defaultRowActiveIndex,\n } = props;\n const internalRef = useMergedRef<Table3Ref>(ref);\n\n const { table, length } = useTable<TType>(props, internalRef);\n useTableRefInstanceSetup(table, internalRef);\n\n React.useEffect(() => {\n if (props.autoFocus) {\n internalRef.current?.focus();\n }\n }, []);\n\n const { renderBody, scrollToIndex } = useTableRenderStrategy<TType>(props, table, internalRef);\n const tableMeta = table.options.meta as TableMeta<TType>;\n const state = table.getState();\n\n const bodyRef = React.useRef<HTMLDivElement | null>(null);\n\n React.useEffect(() => {\n // On a very first render, the tanstack table rendered without any rows,\n // so we delaying default row scrolling logic with using of requestAnimation frame\n const animationFrameId = requestAnimationFrame(() => {\n if (defaultRowActiveIndex) {\n scrollToIndex(defaultRowActiveIndex, { align: 'center' });\n }\n });\n\n return () => {\n cancelAnimationFrame(animationFrameId);\n };\n }, []);\n\n React.useEffect(\n () => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n const dialog = target.closest('[role=\"dialog\"]');\n const eventOriginatedFromCombobox = !!target.closest('[role=\"combobox\"]');\n\n // Don't trigger global shortcuts on the table if event originated from a combobox or if table is\n // outside the dialog\n if (\n eventOriginatedFromCombobox ||\n (dialog && !dialog?.contains(internalRef.current)) ||\n tableMeta.shortcutsState.isPaused\n ) {\n return;\n }\n\n const rows = table.getRowModel().rows;\n\n tableMeta.rowActive.handleKeyDown(\n event,\n rows.length,\n scrollToIndex,\n tableMeta.editing.isEditing ? undefined : internalRef\n );\n if (tableMeta.rowActive.rowActiveIndex !== undefined) {\n tableMeta.rowClick.handleKeyDown(event, rows[tableMeta.rowActive.rowActiveIndex]?.original);\n }\n tableMeta.rowSelection.handleKeyDown(event, table);\n tableMeta.editing.handleKeyDown(event);\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n },\n // See https://github.com/e-conomic/taco/blob/dev/packages/taco/src/components/Table3/strategies/virtualised.tsx#L143\n // scrollToIndex function changes when row count changes, so it is important to update handlers with new\n // scrollToIndex function.\n [scrollToIndex, tableMeta.editing.isEditing, internalRef.current, tableMeta.rowActive.rowActiveIndex]\n );\n\n const handleBlur = tableMeta.editing.isEnabled\n ? (event: React.FocusEvent) => {\n tableMeta.editing.handleBlur(event);\n }\n : undefined;\n\n const handleFocus =\n tableMeta.rowActive.rowActiveIndex === undefined\n ? (event: React.FocusEvent) => {\n tableMeta.rowActive.handleFocus(event, table.getRowModel().rows.length, scrollToIndex);\n }\n : undefined;\n\n // mouse capture fires before focus, so we can prevent propagation and stop double setting of the active row\n const handleMouseCapture =\n tableMeta.rowActive.rowActiveIndex === undefined\n ? (event: React.MouseEvent) => {\n tableMeta.rowActive.handleMouseCapture(event, table.getRowModel().rows.length);\n }\n : undefined;\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n tableMeta.columnFreezing.handleScroll(event);\n };\n\n const className = cn(\n 'border-grey-300 relative grid h-full w-full flex-grow overflow-auto rounded border bg-white scroll-mt-[41px] focus-visible:outline-none',\n '[&[data-resizing=\"true\"]]:select-none',\n {\n 'text-xs': tableMeta.fontSize.size === FONT_SIZE.small,\n 'text-sm': tableMeta.fontSize.size === FONT_SIZE.medium,\n 'text-base': tableMeta.fontSize.size === FONT_SIZE.large,\n }\n );\n\n // Print tables have \"_print\" as the postfix for the table id, so we can use the it to determine\n // if the table is a print table or not.\n const { style: cssGridStyle } = useCssGrid<TType>(\n table,\n tableMeta.printing.isPrinting,\n tableMeta.rowActions.actionsForRowLength,\n tableMeta.fontSize.size\n );\n const { style: cssVars } = useCssVars(tableMeta.rowHeight.height, tableMeta.fontSize.size);\n\n const style = {\n ...cssVars,\n ...cssGridStyle,\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n opacity: 0.999,\n };\n\n const columnFreezingStyle = useColumnFreezingStyle(props.id, table);\n const headerOffsetStyle = useHeaderOffsetStyle(props.id, table);\n const isServerLoadingAndNotReady = tableMeta.isUsingServer && props.length === undefined;\n\n return (\n <>\n {columnFreezingStyle ? <style data-taco=\"table3-column-freezing-styles\">{columnFreezingStyle}</style> : null}\n {headerOffsetStyle && !tableMeta.printing.isPrinting ? (\n <style data-taco=\"table3-column-header-offset-styles\">{headerOffsetStyle}</style>\n ) : null}\n <Toolbar\n table={table}\n tableProps={props}\n total={length}\n left={toolbarLeft}\n right={toolbarRight}\n customSettings={customSettings}\n scrollToIndex={scrollToIndex}\n />\n <ErrorAlert table={table} tableRef={internalRef} scrollToIndex={scrollToIndex} rowIdentifier={props.rowIdentifier} />\n <div\n className={className}\n id={props.id}\n data-font-size={tableMeta.fontSize.size}\n data-editing={tableMeta.editing.isEditing}\n data-horizontally-scrolled={tableMeta.columnFreezing.horizontallyScrolled}\n data-pause-hover={tableMeta?.rowActive.isHoverStatePaused}\n data-resizing={!!state.columnSizingInfo.isResizingColumn}\n data-taco=\"table2\"\n onBlur={handleBlur}\n onFocus={handleFocus}\n onScroll={handleScroll}\n ref={internalRef}\n role=\"table\"\n style={style}\n tabIndex={-1}>\n {isServerLoadingAndNotReady ? null : (\n <div className=\"group/header contents\" data-taco=\"table2-header\" role=\"rowgroup\">\n {table.getHeaderGroups().map(headerGroup => (\n <div className=\"contents\" key={headerGroup.id} role=\"row\">\n {headerGroup.headers.map((header, index) => {\n // We need to render separator if column is not the last in array, if index is not equal to freeze column index,\n // if next element is not placeholder and if column itself is not placeholder.\n const hasSeparator =\n index !== tableMeta.columnFreezing.frozenColumnIndex &&\n index !== headerGroup.headers.length - 1 &&\n (!headerGroup.headers[index + 1]?.isPlaceholder || !header.isPlaceholder);\n return (\n <React.Fragment key={header.id}>\n {flexRender(header.column.columnDef.header, {\n ...header.getContext(),\n scrollToIndex,\n hasSeparator,\n })}\n </React.Fragment>\n );\n })}\n </div>\n ))}\n </div>\n )}\n {table.getRowModel().rows.length ? (\n <>\n <FocusScope autoFocus={tableMeta.editing.isEditing}>\n <div\n onMouseDownCapture={handleMouseCapture}\n className=\"group/body contents\"\n data-taco=\"table2-body\"\n role=\"rowgroup\"\n ref={bodyRef}>\n {renderBody()}\n </div>\n </FocusScope>\n {/* This div makes sure that there is always a free space between the rows and footer when\n table height exceeds the cumulative height of all rows. See useCSSGrid.ts */}\n {/* By vertically translating the div a pixel down, we hide the div border below footer so that\n the footer border doesn't appear an extra pixel thick */}\n <div className=\"border-grey-300 col-span-full translate-y-px border-t\" />\n {tableMeta.enableFooter ? (\n <div className=\"group/footer contents\" data-taco=\"table2-footer\" role=\"rowgroup\">\n {\n // Render the footer cell only for individual columns, excluding column groups.\n table\n .getFooterGroups()\n .slice(0, 1)\n .map(footerGroup => (\n <div className=\"contents\" key={footerGroup.id} role=\"row\">\n {footerGroup.headers.map(footer => (\n <React.Fragment key={footer.id}>\n {flexRender(footer.column.columnDef.footer, footer.getContext())}\n </React.Fragment>\n ))}\n </div>\n ))\n }\n {length ? (\n <Summary currentLength={table.getRowModel().rows.length} length={length} table={table} />\n ) : null}\n </div>\n ) : null}\n </>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n </div>\n </>\n );\n});\n\ntype Table3WithStatics = (<TType = unknown>(props: Table3Props<TType> & React.RefAttributes<Table3Ref>) => JSX.Element) & {\n Column: typeof Column;\n Group: typeof Group;\n};\n\nexport const Table3 = fixedForwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const stringifiedChildren = String(props.children);\n // we force a remount (using key) when the child columns change because there are too many places to add children as an effect\n // this is cheaper from a complexity perspective, and probably performance wise as well\n const key = React.useMemo(() => String('tableKey_' + stringifiedChildren), [stringifiedChildren]);\n return <Table<TType> {...props} key={key} ref={ref} />;\n}) as Table3WithStatics;\nTable3.Column = Column;\nTable3.Group = Group;\n\n// hooks\nexport { useTable3DataLoader } from './hooks/useTableDataLoader';\n\n// types\nexport type {\n useTable3DataFetcher,\n useTable3DataOptions,\n useTable3DataFetcherValues as useTableDataValues,\n} from './hooks/useTableDataLoader';\n\nexport type {\n Table3Ref,\n Table3Props,\n Table3Preset,\n Table3Settings,\n Table3SettingsHandler,\n Table3RowHeight,\n Table3FilterComparator,\n Table3FilterHandler,\n Table3LoadPageHandler,\n Table3LoadAllHandler,\n Table3RowGotoHandler,\n Table3SortHandler,\n Table3Shortcuts,\n Table3ShortcutHandlerFn,\n Table3ShortcutHandlerObject,\n Table3FontSize,\n Table3SortDirection,\n Table3SortFn,\n Table3RowActionRenderer,\n Table3RowSelectionHandler,\n Table3RowExpansionRenderer,\n Table3RowDropHandler,\n Table3RowDragHandler,\n Table3RowClickHandler,\n Table3ColumnProps,\n Table3ColumnAlignment,\n Table3ColumnDataType,\n Table3ColumnHeaderMenu,\n Table3ColumnClassNameHandler,\n Table3ColumnFooterRenderer,\n Table3ColumnRenderer,\n Table3ColumnControlRenderer,\n Table3ColumnControlProps,\n} from './types';\n"],"names":["Column","_","displayName","Group","Table","fixedForwardRef","Table3","props","ref","emptyState","EmptyState","customSettings","toolbarLeft","toolbarRight","defaultCurrentRowIndex","defaultRowActiveIndex","internalRef","useMergedRef","table","length","useTable","useTableRefInstanceSetup","React","useEffect","autoFocus","_internalRef$current","current","focus","renderBody","scrollToIndex","useTableRenderStrategy","tableMeta","options","meta","state","getState","bodyRef","useRef","animationFrameId","requestAnimationFrame","align","cancelAnimationFrame","handleKeyDown","event","target","dialog","closest","eventOriginatedFromCombobox","contains","shortcutsState","isPaused","rows","getRowModel","rowActive","editing","isEditing","undefined","rowActiveIndex","_rows$tableMeta$rowAc","rowClick","original","rowSelection","document","addEventListener","removeEventListener","handleBlur","isEnabled","handleFocus","handleMouseCapture","handleScroll","columnFreezing","Promise","resolve","e","reject","className","cn","fontSize","size","FONT_SIZE","small","medium","large","style","cssGridStyle","useCssGrid","printing","isPrinting","rowActions","actionsForRowLength","cssVars","useCssVars","rowHeight","height","opacity","columnFreezingStyle","useColumnFreezingStyle","id","headerOffsetStyle","useHeaderOffsetStyle","isServerLoadingAndNotReady","isUsingServer","Toolbar","tableProps","total","left","right","ErrorAlert","tableRef","rowIdentifier","horizontallyScrolled","isHoverStatePaused","columnSizingInfo","isResizingColumn","onBlur","onFocus","onScroll","role","tabIndex","getHeaderGroups","map","headerGroup","key","headers","header","index","hasSeparator","frozenColumnIndex","_headerGroup$headers","isPlaceholder","Fragment","flexRender","column","columnDef","getContext","FocusScope","onMouseDownCapture","enableFooter","getFooterGroups","slice","footerGroup","footer","Summary","currentLength","stringifiedChildren","String","children","useMemo"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAASA,MAAMA,CAAkBC,CAA2B;EACxD,OAAO,IAAI;AACf;AACAD,MAAM,CAACE,WAAW,GAAG,cAAc;AAEnC,SAASC,KAAKA,CAACF,CAAmB;EAC9B,OAAO,IAAI;AACf;AACAE,KAAK,CAACD,WAAW,GAAG,aAAa;AA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CACN,IACN,IAAI,CACT,mBAEHI;IAAKqD,SAAS,EAAC;KAA0CjE,UAAU,gBAAGY,6BAACZ,UAAU,OAAG,GAAG,IAAI,CAAO,CACrG,CACC,CACP;AAEX,CAAC,CAAC;MAOWJ,MAAM,gBAAGD,eAAe,CAAC,SAASC,MAAMA,CAAkBC,KAAyB,EAAEC,GAAyB;EACvH,MAAMwI,mBAAmB,GAAGC,MAAM,CAAC1I,KAAK,CAAC2I,QAAQ,CAAC;;;EAGlD,MAAMxB,GAAG,GAAGpG,cAAK,CAAC6H,OAAO,CAAC,MAAMF,MAAM,CAAC,WAAW,GAAGD,mBAAmB,CAAC,EAAE,CAACA,mBAAmB,CAAC,CAAC;EACjG,oBAAO1H,6BAAClB,KAAK,oBAAYG,KAAK;IAAEmH,GAAG,EAAEA,GAAG;IAAElH,GAAG,EAAEA;KAAO;AAC1D,CAAC;AACDF,MAAM,CAACN,MAAM,GAAGA,MAAM;AACtBM,MAAM,CAACH,KAAK,GAAGA,KAAK;;;;"}
@@ -0,0 +1,154 @@
1
+ import React__default from 'react';
2
+ import { Alert } from '../../../Alert/Alert.js';
3
+ import { useLocalization } from '../../../Provider/Localization.js';
4
+ import { Button } from '../../../Button/Button.js';
5
+ import { Dialog } from '../../../Dialog/Dialog.js';
6
+ import { Group } from '../../../Group/Group.js';
7
+ import { focusableSelector } from '../../util/editing.js';
8
+ import { lastCellIndex } from '../rows/Row.js';
9
+
10
+ function ErrorAlert(props) {
11
+ var _column$columnDef$met;
12
+ const {
13
+ table,
14
+ tableRef,
15
+ scrollToIndex,
16
+ rowIdentifier
17
+ } = props;
18
+ const tableMeta = table.options.meta;
19
+ const errors = tableMeta.validation.errors;
20
+ const errorsRowIds = errors ? Object.keys(errors) : [];
21
+ const rows = table.getRowModel().rows;
22
+ const coreRows = table.getCoreRowModel().rows;
23
+ const {
24
+ texts
25
+ } = useLocalization();
26
+ const [resetFiltersConfirmationOpen, setResetFiltersConfirmationOpen] = React__default.useState(false);
27
+ const [internalRowId, setInternalRowId] = React__default.useState(null);
28
+ const [internalRowIndex, setInternalRowIndex] = React__default.useState(null);
29
+ const [isFiltersReset, setIsFiltersReset] = React__default.useState(false);
30
+ const columns = table.getAllFlatColumns();
31
+ const column = columns.find(column => column.id === rowIdentifier);
32
+ const rowIdentifierHeader = column === null || column === void 0 ? void 0 : (_column$columnDef$met = column.columnDef.meta) === null || _column$columnDef$met === void 0 ? void 0 : _column$columnDef$met.header;
33
+ // Find and focus first invalid cell
34
+ const navigateToFirstInvalidCell = () => {
35
+ var _tableRef$current;
36
+ const firstInvalidCell = (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.querySelector('[role="row"][data-current="true"] [role="cell"][data-invalid="true"]');
37
+ const firstInvalidElement = firstInvalidCell === null || firstInvalidCell === void 0 ? void 0 : firstInvalidCell.querySelector(focusableSelector);
38
+ if (firstInvalidElement) {
39
+ firstInvalidElement === null || firstInvalidElement === void 0 ? void 0 : firstInvalidElement.focus();
40
+ lastCellIndex.value = firstInvalidCell === null || firstInvalidCell === void 0 ? void 0 : firstInvalidCell.getAttribute('data-column-index');
41
+ }
42
+ };
43
+ // Navigate to row and focus first invalid cell
44
+ const navigateToRow = rowIndex => {
45
+ tableMeta.rowActive.setRowActiveIndex(rowIndex);
46
+ scrollToIndex(rowIndex, {
47
+ align: 'center'
48
+ });
49
+ lastCellIndex.value = undefined;
50
+ // Need to request animation frame here, because newly selected row is not rendered yet.
51
+ requestAnimationFrame(() => {
52
+ navigateToFirstInvalidCell();
53
+ });
54
+ };
55
+ // When internal row index is changed after click on row link, we should navigate to the row.
56
+ React__default.useEffect(() => {
57
+ if (internalRowIndex !== null && internalRowIndex >= 0) {
58
+ navigateToRow(internalRowIndex);
59
+ }
60
+ }, [internalRowIndex]);
61
+ // When filters are reset, we're able to get the real row index by rowId
62
+ React__default.useEffect(() => {
63
+ if (isFiltersReset) {
64
+ const rowIndex = rows.findIndex(row => row.id === internalRowId);
65
+ if (rowIndex === -1) {
66
+ return;
67
+ }
68
+ setInternalRowIndex(rowIndex);
69
+ }
70
+ }, [isFiltersReset]);
71
+ const onRowNumberClick = React__default.useCallback(rowId => {
72
+ // When row is hidden due filtering it will not be present in rows (but it still will be present in coreRows)
73
+ const foundIndex = rows.findIndex(row => row.id === rowId);
74
+ if (foundIndex === -1) {
75
+ setIsFiltersReset(false);
76
+ setResetFiltersConfirmationOpen(true);
77
+ // Since row indexes changed due filtering, we need to save row id, so that we can find it when filters will be reset
78
+ setInternalRowId(rowId);
79
+ return;
80
+ }
81
+ // In cases when user clicked on a row link multiple times we still need to navigate to the row, and focus the cell,
82
+ // because row/cell will loose focus on next click, but row index will not change.
83
+ if (foundIndex === internalRowIndex) {
84
+ navigateToRow(foundIndex);
85
+ } else {
86
+ setInternalRowIndex(foundIndex);
87
+ }
88
+ }, [rows, internalRowIndex]);
89
+ const onResetFiltersConfirm = () => {
90
+ setIsFiltersReset(true);
91
+ };
92
+ // Getting the row from core rows (ignoring search and filtering)
93
+ const getCoreRow = React__default.useCallback(rowId => coreRows.find(coreRow => coreRow.id === rowId), [coreRows]);
94
+ return /*#__PURE__*/React__default.createElement("div", {
95
+ className: "mb-4"
96
+ }, errorsRowIds.length ? ( /*#__PURE__*/React__default.createElement(Alert, {
97
+ state: "error",
98
+ className: "mb-1"
99
+ }, /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("b", null, errorsRowIds.length, " ", texts.table3.validation.alert.unsavedEntries(errorsRowIds.length)), ' '), rowIdentifierHeader || texts.table3.validation.index, ' ', errorsRowIds.map((rowId, index) => {
100
+ const coreRow = getCoreRow(rowId);
101
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Button, {
102
+ key: rowId,
103
+ className: "!min-h-[theme(spacing.2)] !min-w-[theme(spacing.2)] !px-1",
104
+ appearance: "discrete",
105
+ onClick: () => {
106
+ onRowNumberClick(rowId);
107
+ }
108
+ }, rowIdentifier ? coreRow === null || coreRow === void 0 ? void 0 : coreRow.original[rowIdentifier] : coreRow === null || coreRow === void 0 ? void 0 : coreRow.index), /*#__PURE__*/React__default.createElement("span", {
109
+ key: `${rowId}_comma`
110
+ }, index < errorsRowIds.length - 1 ? ',' : ''));
111
+ }), texts.table3.validation.alert.incompleteAndHavntBeenSaved(errorsRowIds.length))) : null, /*#__PURE__*/React__default.createElement(FilterResetDialog, {
112
+ open: resetFiltersConfirmationOpen,
113
+ onClose: () => {
114
+ setResetFiltersConfirmationOpen(false);
115
+ },
116
+ onConfirm: onResetFiltersConfirm,
117
+ table: table
118
+ }));
119
+ }
120
+ function FilterResetDialog(props) {
121
+ const {
122
+ open,
123
+ onClose,
124
+ onConfirm,
125
+ table
126
+ } = props;
127
+ const tableMeta = table.options.meta;
128
+ const {
129
+ texts
130
+ } = useLocalization();
131
+ const resetFilters = React__default.useCallback(() => {
132
+ tableMeta.search.setQuery('');
133
+ table.resetGlobalFilter();
134
+ table.resetColumnFilters();
135
+ }, [table, tableMeta.search]);
136
+ const handleConfirmClick = () => {
137
+ resetFilters();
138
+ onConfirm();
139
+ onClose();
140
+ };
141
+ return /*#__PURE__*/React__default.createElement(Dialog, {
142
+ open: open,
143
+ onClose: onClose,
144
+ size: "xs"
145
+ }, /*#__PURE__*/React__default.createElement(Dialog.Content, {
146
+ "aria-label": "Create a new account"
147
+ }, /*#__PURE__*/React__default.createElement(Dialog.Title, null, texts.table3.validation.resetFiltersDialog.title), /*#__PURE__*/React__default.createElement("p", null, texts.table3.validation.resetFiltersDialog.description), /*#__PURE__*/React__default.createElement(Dialog.Footer, null, /*#__PURE__*/React__default.createElement(Group, null, /*#__PURE__*/React__default.createElement(Dialog.Close, null, /*#__PURE__*/React__default.createElement(Button, null, texts.table3.validation.resetFiltersDialog.cancel)), /*#__PURE__*/React__default.createElement(Button, {
148
+ appearance: "primary",
149
+ onClick: handleConfirmClick
150
+ }, texts.table3.validation.resetFiltersDialog.confirm)))));
151
+ }
152
+
153
+ export { ErrorAlert };
154
+ //# sourceMappingURL=ErrorAlert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorAlert.js","sources":["../../../../../../../../../src/components/Table3/components/alert/ErrorAlert.tsx"],"sourcesContent":["import { Table as RTable, TableMeta } from '@tanstack/react-table';\nimport { TableStrategy } from '../../types';\nimport React from 'react';\nimport { Alert } from '../../../Alert/Alert';\nimport { Button } from '../../../Button/Button';\nimport { useLocalization } from '../../../Provider/Localization';\nimport { focusableSelector } from '../../util/editing';\nimport { lastCellIndex } from '../rows/Row';\nimport { Dialog } from '../../../Dialog/Dialog';\nimport { Group } from '../../../Group/Group';\n\nexport type ErrorAlertProps<TType = unknown> = {\n table: RTable<TType>;\n tableRef: React.RefObject<HTMLDivElement>;\n scrollToIndex: TableStrategy['scrollToIndex'];\n rowIdentifier?: string;\n};\n\nexport function ErrorAlert<TType = unknown>(props: ErrorAlertProps<TType>) {\n const { table, tableRef, scrollToIndex, rowIdentifier } = props;\n const tableMeta = table.options.meta as TableMeta<TType>;\n const errors = tableMeta.validation.errors;\n const errorsRowIds = errors ? Object.keys(errors) : [];\n const rows = table.getRowModel().rows;\n const coreRows = table.getCoreRowModel().rows;\n const { texts } = useLocalization();\n const [resetFiltersConfirmationOpen, setResetFiltersConfirmationOpen] = React.useState(false);\n const [internalRowId, setInternalRowId] = React.useState<string | null>(null);\n const [internalRowIndex, setInternalRowIndex] = React.useState<number | null>(null);\n const [isFiltersReset, setIsFiltersReset] = React.useState(false);\n const columns = table.getAllFlatColumns();\n const column = columns.find(column => column.id === rowIdentifier);\n const rowIdentifierHeader = column?.columnDef.meta?.header;\n\n // Find and focus first invalid cell\n const navigateToFirstInvalidCell = () => {\n const firstInvalidCell = tableRef.current?.querySelector(\n '[role=\"row\"][data-current=\"true\"] [role=\"cell\"][data-invalid=\"true\"]'\n );\n const firstInvalidElement = firstInvalidCell?.querySelector(focusableSelector);\n\n if (firstInvalidElement) {\n (firstInvalidElement as HTMLElement)?.focus();\n lastCellIndex.value = firstInvalidCell?.getAttribute('data-column-index');\n }\n };\n\n // Navigate to row and focus first invalid cell\n const navigateToRow = rowIndex => {\n tableMeta.rowActive.setRowActiveIndex(rowIndex);\n scrollToIndex(rowIndex, { align: 'center' });\n lastCellIndex.value = undefined;\n\n // Need to request animation frame here, because newly selected row is not rendered yet.\n requestAnimationFrame(() => {\n navigateToFirstInvalidCell();\n });\n };\n\n // When internal row index is changed after click on row link, we should navigate to the row.\n React.useEffect(() => {\n if (internalRowIndex !== null && internalRowIndex >= 0) {\n navigateToRow(internalRowIndex);\n }\n }, [internalRowIndex]);\n\n // When filters are reset, we're able to get the real row index by rowId\n React.useEffect(() => {\n if (isFiltersReset) {\n const rowIndex = rows.findIndex(row => row.id === internalRowId);\n if (rowIndex === -1) {\n return;\n }\n setInternalRowIndex(rowIndex);\n }\n }, [isFiltersReset]);\n\n const onRowNumberClick = React.useCallback(\n (rowId: string) => {\n // When row is hidden due filtering it will not be present in rows (but it still will be present in coreRows)\n const foundIndex = rows.findIndex(row => row.id === rowId);\n if (foundIndex === -1) {\n setIsFiltersReset(false);\n setResetFiltersConfirmationOpen(true);\n\n // Since row indexes changed due filtering, we need to save row id, so that we can find it when filters will be reset\n setInternalRowId(rowId);\n return;\n }\n\n // In cases when user clicked on a row link multiple times we still need to navigate to the row, and focus the cell,\n // because row/cell will loose focus on next click, but row index will not change.\n if (foundIndex === internalRowIndex) {\n navigateToRow(foundIndex);\n } else {\n setInternalRowIndex(foundIndex);\n }\n },\n [rows, internalRowIndex]\n );\n\n const onResetFiltersConfirm = () => {\n setIsFiltersReset(true);\n };\n\n // Getting the row from core rows (ignoring search and filtering)\n const getCoreRow = React.useCallback((rowId: string) => coreRows.find(coreRow => coreRow.id === rowId), [coreRows]);\n\n return (\n <div className=\"mb-4\">\n {errorsRowIds.length ? (\n <Alert state=\"error\" className=\"mb-1\">\n <>\n <b>\n {errorsRowIds.length} {texts.table3.validation.alert.unsavedEntries(errorsRowIds.length)}\n </b>{' '}\n </>\n {rowIdentifierHeader || texts.table3.validation.index}{' '}\n {errorsRowIds.map((rowId: string, index) => {\n const coreRow = getCoreRow(rowId);\n return (\n <>\n <Button\n key={rowId}\n className=\"!min-h-[theme(spacing.2)] !min-w-[theme(spacing.2)] !px-1\"\n appearance=\"discrete\"\n onClick={() => {\n onRowNumberClick(rowId);\n }}>\n {/* Getting row from core rows, because 'table.getRow' will fail if row is hidden due filtering */}\n {rowIdentifier ? coreRow?.original[rowIdentifier] : coreRow?.index}\n </Button>\n <span key={`${rowId}_comma`}>{index < errorsRowIds.length - 1 ? ',' : ''}</span>\n </>\n );\n })}\n {texts.table3.validation.alert.incompleteAndHavntBeenSaved(errorsRowIds.length)}\n </Alert>\n ) : null}\n <FilterResetDialog\n open={resetFiltersConfirmationOpen}\n onClose={() => {\n setResetFiltersConfirmationOpen(false);\n }}\n onConfirm={onResetFiltersConfirm}\n table={table}\n />\n </div>\n );\n}\n\ntype FilterResetDialogProps<TType = unknown> = {\n open: boolean;\n onClose: () => void;\n onConfirm: () => void;\n table: RTable<TType>;\n};\nfunction FilterResetDialog<TType = unknown>(props: FilterResetDialogProps<TType>) {\n const { open, onClose, onConfirm, table } = props;\n const tableMeta = table.options.meta as TableMeta<TType>;\n const { texts } = useLocalization();\n\n const resetFilters = React.useCallback(() => {\n tableMeta.search.setQuery('');\n table.resetGlobalFilter();\n table.resetColumnFilters();\n }, [table, tableMeta.search]);\n\n const handleConfirmClick = () => {\n resetFilters();\n onConfirm();\n onClose();\n };\n\n return (\n <Dialog open={open} onClose={onClose} size=\"xs\">\n <Dialog.Content aria-label=\"Create a new account\">\n <Dialog.Title>{texts.table3.validation.resetFiltersDialog.title}</Dialog.Title>\n\n <p>{texts.table3.validation.resetFiltersDialog.description}</p>\n\n <Dialog.Footer>\n <Group>\n <Dialog.Close>\n <Button>{texts.table3.validation.resetFiltersDialog.cancel}</Button>\n </Dialog.Close>\n <Button appearance=\"primary\" onClick={handleConfirmClick}>\n {texts.table3.validation.resetFiltersDialog.confirm}\n </Button>\n </Group>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n );\n}\n"],"names":["ErrorAlert","props","table","tableRef","scrollToIndex","rowIdentifier","tableMeta","options","meta","errors","validation","errorsRowIds","Object","keys","rows","getRowModel","coreRows","getCoreRowModel","texts","useLocalization","resetFiltersConfirmationOpen","setResetFiltersConfirmationOpen","React","useState","internalRowId","setInternalRowId","internalRowIndex","setInternalRowIndex","isFiltersReset","setIsFiltersReset","columns","getAllFlatColumns","column","find","id","rowIdentifierHeader","_column$columnDef$met","columnDef","header","navigateToFirstInvalidCell","firstInvalidCell","_tableRef$current","current","querySelector","firstInvalidElement","focusableSelector","focus","lastCellIndex","value","getAttribute","navigateToRow","rowIndex","rowActive","setRowActiveIndex","align","undefined","requestAnimationFrame","useEffect","findIndex","row","onRowNumberClick","useCallback","rowId","foundIndex","onResetFiltersConfirm","getCoreRow","coreRow","className","length","Alert","state","table3","alert","unsavedEntries","index","map","Button","key","appearance","onClick","original","incompleteAndHavntBeenSaved","FilterResetDialog","open","onClose","onConfirm","resetFilters","search","setQuery","resetGlobalFilter","resetColumnFilters","handleConfirmClick","Dialog","size","Content","Title","resetFiltersDialog","title","description","Footer","Group","Close","cancel","confirm"],"mappings":";;;;;;;;;SAkBgBA,UAAUA,CAAkBC,KAA6B;;EACrE,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,aAAa;IAAEC;GAAe,GAAGJ,KAAK;EAC/D,MAAMK,SAAS,GAAGJ,KAAK,CAACK,OAAO,CAACC,IAAwB;EACxD,MAAMC,MAAM,GAAGH,SAAS,CAACI,UAAU,CAACD,MAAM;EAC1C,MAAME,YAAY,GAAGF,MAAM,GAAGG,MAAM,CAACC,IAAI,CAACJ,MAAM,CAAC,GAAG,EAAE;EACtD,MAAMK,IAAI,GAAGZ,KAAK,CAACa,WAAW,EAAE,CAACD,IAAI;EACrC,MAAME,QAAQ,GAAGd,KAAK,CAACe,eAAe,EAAE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AAM,CAACO,MAAM,qBACV7E,6BAAC8E,KAAK,qBACF9E,6BAACsE,MAAM,CAACS,KAAK,qBACT/E,6BAACsD,MAAM,QAAE1D,KAAK,CAACqD,MAAM,CAAC7D,UAAU,CAACsF,kBAAkB,CAACM,MAAM,CAAU,CACzD,eACfhF,6BAACsD,MAAM;IAACE,UAAU,EAAC,SAAS;IAACC,OAAO,EAAEY;KACjCzE,KAAK,CAACqD,MAAM,CAAC7D,UAAU,CAACsF,kBAAkB,CAACO,OAAO,CAC9C,CACL,CACI,CACH,CACZ;AAEjB;;;;"}
@@ -1,27 +1,72 @@
1
1
  import React__default from 'react';
2
- import { useRowContext } from '../../rows/RowContext.js';
2
+ import { useRowContext, RowContext } from '../../rows/RowContext.js';
3
3
  import { DisplayCell } from './DisplayCell.js';
4
+ import { isCellHighlighted } from '../../../util/columns.js';
4
5
  import { EditingCell } from './EditingCell.js';
5
6
 
6
7
  function Cell(props) {
7
- var _rows$currentRowIndex;
8
+ var _rows$rowActiveIndex;
8
9
  const {
9
10
  column,
10
11
  row,
11
- table
12
+ table,
13
+ index,
14
+ getValue,
15
+ cell
12
16
  } = props;
13
17
  const {
14
- isHovered: isHoveredRow
18
+ isHovered: isHoveredRow,
19
+ hasError
15
20
  } = useRowContext();
16
21
  const rows = table.getRowModel().rows;
17
22
  const tableMeta = table.options.meta;
18
23
  const columnMeta = column.columnDef.meta;
19
- const currentRowIndex = tableMeta.currentRow.currentRowIndex;
20
- const isCurrentRow = currentRowIndex !== undefined && ((_rows$currentRowIndex = rows[currentRowIndex]) === null || _rows$currentRowIndex === void 0 ? void 0 : _rows$currentRowIndex.id) === row.id;
21
- if (tableMeta.editing.isEditing && columnMeta.control && (isCurrentRow || isHoveredRow && !tableMeta.hoverState.isPaused)) {
22
- return /*#__PURE__*/React__default.createElement(EditingCell, Object.assign({}, props));
24
+ const rowErrors = tableMeta.validation.errors ? tableMeta.validation.errors[row.id] : null;
25
+ const isColumnError = hasError && rowErrors && !!rowErrors[column.id];
26
+ const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;
27
+ const isActiveRow = rowActiveIndex !== undefined && ((_rows$rowActiveIndex = rows[rowActiveIndex]) === null || _rows$rowActiveIndex === void 0 ? void 0 : _rows$rowActiveIndex.id) === row.id;
28
+ let value = getValue();
29
+ // When row has changes we always need to show the editing state value, end revert it to original value only when row got saved successfully.
30
+ // Otherwise it might confuse user because it will look like display value is getting reverted everytime user leaves the row.
31
+ if (tableMeta.editing.isEditing) {
32
+ const editingValue = tableMeta.editing.getCellValue(cell);
33
+ value = editingValue !== null && editingValue !== void 0 ? editingValue : value;
23
34
  }
24
- return /*#__PURE__*/React__default.createElement(DisplayCell, Object.assign({}, props));
35
+ const {
36
+ rowIndex
37
+ } = React__default.useContext(RowContext);
38
+ const memoedHighlight = React__default.useMemo(() => {
39
+ var _tableMeta$search$que;
40
+ if (!tableMeta.search.isHighlightingEnabled || !columnMeta.enableSearch) {
41
+ return false;
42
+ }
43
+ if ((_tableMeta$search$que = tableMeta.search.query) !== null && _tableMeta$search$que !== void 0 && _tableMeta$search$que.length) {
44
+ return isCellHighlighted(tableMeta.search.query, value, columnMeta.dataType);
45
+ }
46
+ return false;
47
+ }, [value, tableMeta.search.isHighlightingEnabled, tableMeta.search.excludeUnmatchedResults, tableMeta.search.query]);
48
+ const memoedHighlightCurrent = React__default.useMemo(() => {
49
+ if (!tableMeta.search.isHighlightingEnabled || !memoedHighlight || tableMeta.search.currentHighlightColumnIndex === undefined) {
50
+ return false;
51
+ }
52
+ const [rowActiveIndex, currentColumnIndex] = tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex];
53
+ if (rowActiveIndex === rowIndex && currentColumnIndex === index) {
54
+ return true;
55
+ }
56
+ return false;
57
+ }, [memoedHighlight, tableMeta.search.highlightedColumnIndexes.length, tableMeta.search.currentHighlightColumnIndex]);
58
+ const highlightProps = {
59
+ highlighted: memoedHighlight,
60
+ highlightedAsCurrent: memoedHighlightCurrent
61
+ };
62
+ if (tableMeta.editing.isEditing && columnMeta.control && (isActiveRow || isHoveredRow && !tableMeta.rowActive.isHoverStatePaused ||
63
+ // When cell has error, we renderimg it in edit mode (UX reqirement)
64
+ isColumnError)) {
65
+ return /*#__PURE__*/React__default.createElement(EditingCell, Object.assign({}, props, highlightProps));
66
+ }
67
+ return /*#__PURE__*/React__default.createElement(DisplayCell, Object.assign({}, props, highlightProps, {
68
+ value: value
69
+ }));
25
70
  }
26
71
 
27
72
  export { Cell };
@@ -1 +1 @@
1
- {"version":3,"file":"Cell.js","sources":["../../../../../../../../../../src/components/Table3/components/columns/cell/Cell.tsx"],"sourcesContent":["import React from 'react';\nimport { CellContext, ColumnMeta, TableMeta } from '@tanstack/react-table';\nimport { DisplayCell } from './DisplayCell';\nimport { EditingCell } from './EditingCell';\nimport { useRowContext } from '../../rows/RowContext';\n\nexport type CellProps<TType = unknown> = CellContext<TType, unknown> & {\n children?: string | JSX.Element;\n};\n\nexport function Cell<TType = unknown>(props: CellProps<TType>) {\n const { column, row, table } = props;\n const { isHovered: isHoveredRow } = useRowContext();\n const rows = table.getRowModel().rows;\n const tableMeta = table.options.meta as TableMeta<unknown>;\n const columnMeta = column.columnDef.meta as ColumnMeta<TType, unknown>;\n\n const currentRowIndex = tableMeta.currentRow.currentRowIndex;\n const isCurrentRow =\n currentRowIndex !== undefined && rows[currentRowIndex]?.id === row.id;\n\n if (tableMeta.editing.isEditing && columnMeta.control && (isCurrentRow || (isHoveredRow && !tableMeta.hoverState.isPaused))) {\n return <EditingCell {...props} />;\n }\n\n return <DisplayCell {...props} />;\n}\n"],"names":["Cell","props","column","row","table","isHovered","isHoveredRow","useRowContext","rows","getRowModel","tableMeta","options","meta","columnMeta","columnDef","currentRowIndex","currentRow","isCurrentRow","undefined","_rows$currentRowIndex","id","editing","isEditing","control","hoverState","isPaused","React","EditingCell","DisplayCell"],"mappings":";;;;;SAUgBA,IAAIA,CAAkBC,KAAuB;;EACzD,MAAM;IAAEC,MAAM;IAAEC,GAAG;IAAEC;GAAO,GAAGH,KAAK;EACpC,MAAM;IAAEI,SAAS,EAAEC;GAAc,GAAGC,aAAa,EAAE;EACnD,MAAMC,IAAI,GAAGJ,KAAK,CAACK,WAAW,EAAE,CAACD,IAAI;EACrC,MAAME,SAAS,GAAGN,KAAK,CAACO,OAAO,CAACC,IAA0B;EAC1D,MAAMC,UAAU,GAAGX,MAAM,CAACY,SAAS,CAACF,IAAkC;EAEtE,MAAMG,eAAe,GAAGL,SAAS,CAACM,UAAU,CAACD,eAAe;EAC5D,MAAME,YAAY,GACdF,eAAe,KAAKG,SAAS,IAAI,EAAAC,qBAAA,GAAAX,IAAI,CAACO,eAAe,CAAC,cAAAI,qBAAA,uBAArBA,qBAAA,CAAuBC,EAAE,MAAKjB,GAAG,CAACiB,EAAE;EAEzE,IAAIV,SAAS,CAACW,OAAO,CAACC,SAAS,IAAIT,UAAU,CAACU,OAAO,KAAKN,YAAY,IAAKX,YAAY,IAAI,CAACI,SAAS,CAACc,UAAU,CAACC,QAAS,CAAC,EAAE;IACzH,oBAAOC,6BAACC,WAAW,oBAAK1B,KAAK,EAAI;;EAGrC,oBAAOyB,6BAACE,WAAW,oBAAK3B,KAAK,EAAI;AACrC;;;;"}
1
+ {"version":3,"file":"Cell.js","sources":["../../../../../../../../../../src/components/Table3/components/columns/cell/Cell.tsx"],"sourcesContent":["import React from 'react';\nimport { CellContext, ColumnMeta, TableMeta } from '@tanstack/react-table';\nimport { DisplayCell } from './DisplayCell';\nimport { EditingCell } from './EditingCell';\nimport { RowContext, useRowContext } from '../../rows/RowContext';\nimport { isCellHighlighted } from '../../../util/columns';\n\nexport type CellProps<TType = unknown> = CellContext<TType, unknown> & {\n children?: string | JSX.Element;\n};\n\nexport function Cell<TType = unknown>(props: CellProps<TType>) {\n const { column, row, table, index, getValue, cell } = props;\n const { isHovered: isHoveredRow, hasError } = useRowContext();\n const rows = table.getRowModel().rows;\n const tableMeta = table.options.meta as TableMeta<unknown>;\n const columnMeta = column.columnDef.meta as ColumnMeta<TType, unknown>;\n const rowErrors = tableMeta.validation.errors ? tableMeta.validation.errors[row.id] : null;\n const isColumnError = hasError && rowErrors && !!rowErrors[column.id];\n\n const rowActiveIndex = tableMeta.rowActive.rowActiveIndex;\n const isActiveRow = rowActiveIndex !== undefined && rows[rowActiveIndex]?.id === row.id;\n let value = getValue();\n\n // When row has changes we always need to show the editing state value, end revert it to original value only when row got saved successfully.\n // Otherwise it might confuse user because it will look like display value is getting reverted everytime user leaves the row.\n if (tableMeta.editing.isEditing) {\n const editingValue = tableMeta.editing.getCellValue(cell);\n value = editingValue ?? value;\n }\n\n const { rowIndex } = React.useContext(RowContext);\n\n const memoedHighlight = React.useMemo(() => {\n if (!tableMeta.search.isHighlightingEnabled || !columnMeta.enableSearch) {\n return false;\n }\n\n if (tableMeta.search.query?.length) {\n return isCellHighlighted(tableMeta.search.query, value, columnMeta.dataType);\n }\n\n return false;\n }, [value, tableMeta.search.isHighlightingEnabled, tableMeta.search.excludeUnmatchedResults, tableMeta.search.query]);\n\n const memoedHighlightCurrent = React.useMemo(() => {\n if (\n !tableMeta.search.isHighlightingEnabled ||\n !memoedHighlight ||\n tableMeta.search.currentHighlightColumnIndex === undefined\n ) {\n return false;\n }\n\n const [rowActiveIndex, currentColumnIndex] =\n tableMeta.search.highlightedColumnIndexes[tableMeta.search.currentHighlightColumnIndex];\n\n if (rowActiveIndex === rowIndex && currentColumnIndex === index) {\n return true;\n }\n\n return false;\n }, [memoedHighlight, tableMeta.search.highlightedColumnIndexes.length, tableMeta.search.currentHighlightColumnIndex]);\n\n const highlightProps = {\n highlighted: memoedHighlight,\n highlightedAsCurrent: memoedHighlightCurrent,\n };\n\n if (\n tableMeta.editing.isEditing &&\n columnMeta.control &&\n (isActiveRow ||\n (isHoveredRow && !tableMeta.rowActive.isHoverStatePaused) ||\n // When cell has error, we renderimg it in edit mode (UX reqirement)\n isColumnError)\n ) {\n return <EditingCell {...props} {...highlightProps} />;\n }\n\n return <DisplayCell {...props} {...highlightProps} value={value} />;\n}\n"],"names":["Cell","props","column","row","table","index","getValue","cell","isHovered","isHoveredRow","hasError","useRowContext","rows","getRowModel","tableMeta","options","meta","columnMeta","columnDef","rowErrors","validation","errors","id","isColumnError","rowActiveIndex","rowActive","isActiveRow","undefined","_rows$rowActiveIndex","value","editing","isEditing","editingValue","getCellValue","rowIndex","React","useContext","RowContext","memoedHighlight","useMemo","search","isHighlightingEnabled","enableSearch","_tableMeta$search$que","query","length","isCellHighlighted","dataType","excludeUnmatchedResults","memoedHighlightCurrent","currentHighlightColumnIndex","currentColumnIndex","highlightedColumnIndexes","highlightProps","highlighted","highlightedAsCurrent","control","isHoverStatePaused","EditingCell","DisplayCell"],"mappings":";;;;;;SAWgBA,IAAIA,CAAkBC,KAAuB;;EACzD,MAAM;IAAEC,MAAM;IAAEC,GAAG;IAAEC,KAAK;IAAEC,KAAK;IAAEC,QAAQ;IAAEC;GAAM,GAAGN,KAAK;EAC3D,MAAM;IAAEO,SAAS,EAAEC,YAAY;IAAEC;GAAU,GAAGC,aAAa,EAAE;EAC7D,MAAMC,IAAI,GAAGR,KAAK,CAACS,WAAW,EAAE,CAACD,IAAI;EACrC,MAAME,SAAS,GAAGV,KAAK,CAACW,OAAO,CAACC,IAA0B;EAC1D,MAAMC,UAAU,GAAGf,MAAM,CAACgB,SAAS,CAACF,IAAkC;EACtE,MAAMG,SAAS,GAAGL,SAAS,CAACM,UAAU,CAACC,MAAM,GAAGP,SAAS,CAACM,UAAU,CAACC,MAAM,CAAClB,GAAG,CAACmB,EAAE,CAAC,GAAG,IAAI;EAC1F,MAAMC,aAAa,GAAGb,QAAQ,IAAIS,SAAS,IAAI,CAAC,CAACA,SAAS,CAACjB,MAAM,CAACoB,EAAE,CAAC;EAErE,MAAME,cAAc,GAAGV,SAAS,CAACW,SAAS,CAACD,cAAc;EACzD,MAAME,WAAW,GAAGF,cAAc,KAAKG,SAAS,IAAI,EAAAC,oBAAA,GAAAhB,IAAI,CAACY,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