@hazelcast/ui 3.0.1-canary.0 → 3.0.1-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (528) hide show
  1. package/lib/components/Alert.js +50 -116
  2. package/lib/components/Alert.js.map +1 -1
  3. package/lib/components/Alert.module.scss +141 -0
  4. package/lib/components/AppHeader/AppHeader.js +17 -39
  5. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  6. package/lib/components/AppHeader/AppHeader.module.scss +29 -0
  7. package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.js +7 -24
  8. package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.js.map +1 -1
  9. package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.module.scss +29 -0
  10. package/lib/components/AppHeader/AppHeaderLogo/index.js +2 -8
  11. package/lib/components/AppHeader/AppHeaderLogo/index.js.map +1 -1
  12. package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.js +14 -46
  13. package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.js.map +1 -1
  14. package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.module.scss +20 -0
  15. package/lib/components/AppHeader/AppHeaderMenu/index.js +2 -8
  16. package/lib/components/AppHeader/AppHeaderMenu/index.js.map +1 -1
  17. package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.js +9 -19
  18. package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.js.map +1 -1
  19. package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.module.scss +13 -0
  20. package/lib/components/AppHeader/EnvironmentBadge/index.js +2 -8
  21. package/lib/components/AppHeader/EnvironmentBadge/index.js.map +1 -1
  22. package/lib/components/AppHeader/SelectCluster/SelectCluster.js +32 -72
  23. package/lib/components/AppHeader/SelectCluster/SelectCluster.js.map +1 -1
  24. package/lib/components/AppHeader/SelectCluster/SelectCluster.module.scss +101 -0
  25. package/lib/components/AppHeader/SelectCluster/index.js +2 -8
  26. package/lib/components/AppHeader/SelectCluster/index.js.map +1 -1
  27. package/lib/components/AppHeader/index.js +2 -8
  28. package/lib/components/AppHeader/index.js.map +1 -1
  29. package/lib/components/AppSidebar/AppSidebar.js +30 -56
  30. package/lib/components/AppSidebar/AppSidebar.js.map +1 -1
  31. package/lib/components/AppSidebar/AppSidebar.module.scss +66 -0
  32. package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.js +21 -37
  33. package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.js.map +1 -1
  34. package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.module.scss +16 -0
  35. package/lib/components/AppSidebar/AppSidebarFavoriteButton/index.js +2 -8
  36. package/lib/components/AppSidebar/AppSidebarFavoriteButton/index.js.map +1 -1
  37. package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.js +10 -31
  38. package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.js.map +1 -1
  39. package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.module.scss +13 -0
  40. package/lib/components/AppSidebar/AppSidebarFavorites/index.js +2 -8
  41. package/lib/components/AppSidebar/AppSidebarFavorites/index.js.map +1 -1
  42. package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.js +22 -77
  43. package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.js.map +1 -1
  44. package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.module.scss +92 -0
  45. package/lib/components/AppSidebar/AppSidebarItem/index.js +2 -8
  46. package/lib/components/AppSidebar/AppSidebarItem/index.js.map +1 -1
  47. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.js +6 -17
  48. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.js.map +1 -1
  49. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.module.scss +24 -0
  50. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/index.js +2 -8
  51. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/index.js.map +1 -1
  52. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.js +14 -39
  53. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.js.map +1 -1
  54. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.module.scss +58 -0
  55. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSectionExpandable.js +53 -94
  56. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSectionExpandable.js.map +1 -1
  57. package/lib/components/AppSidebar/AppSidebarSection/appSidebarSectionContext.js +3 -8
  58. package/lib/components/AppSidebar/AppSidebarSection/appSidebarSectionContext.js.map +1 -1
  59. package/lib/components/AppSidebar/AppSidebarSection/index.js +2 -8
  60. package/lib/components/AppSidebar/AppSidebarSection/index.js.map +1 -1
  61. package/lib/components/AppSidebar/appSidebarContext.js +9 -14
  62. package/lib/components/AppSidebar/appSidebarContext.js.map +1 -1
  63. package/lib/components/AppSidebar/index.js +6 -16
  64. package/lib/components/AppSidebar/index.js.map +1 -1
  65. package/lib/components/AutocompleteField.js +154 -229
  66. package/lib/components/AutocompleteField.js.map +1 -1
  67. package/lib/components/AutocompleteField.module.scss +164 -0
  68. package/lib/components/AutocompleteFieldFormik.js +18 -41
  69. package/lib/components/AutocompleteFieldFormik.js.map +1 -1
  70. package/lib/components/Badge.js +42 -66
  71. package/lib/components/Badge.js.map +1 -1
  72. package/lib/components/Badge.module.scss +55 -0
  73. package/lib/components/Button.js +42 -115
  74. package/lib/components/Button.js.map +1 -1
  75. package/lib/components/Button.module.scss +329 -0
  76. package/lib/components/Calendar/Calendar.js +23 -77
  77. package/lib/components/Calendar/Calendar.js.map +1 -1
  78. package/lib/components/Calendar/Calendar.module.scss +185 -0
  79. package/lib/components/Calendar/CalendarRange.js +12 -60
  80. package/lib/components/Calendar/CalendarRange.js.map +1 -1
  81. package/lib/components/Calendar/CalendarRange.module.scss +21 -0
  82. package/lib/components/Calendar/components/CalendarHeader.js +12 -35
  83. package/lib/components/Calendar/components/CalendarHeader.js.map +1 -1
  84. package/lib/components/Calendar/components/CalendarInput.js +9 -39
  85. package/lib/components/Calendar/components/CalendarInput.js.map +1 -1
  86. package/lib/components/Calendar/components/CalendarTime.js +66 -104
  87. package/lib/components/Calendar/components/CalendarTime.js.map +1 -1
  88. package/lib/components/Calendar/components/CalendarTime.module.scss +72 -0
  89. package/lib/components/Calendar/helpers/consts.js +100 -8
  90. package/lib/components/Calendar/helpers/consts.js.map +1 -1
  91. package/lib/components/Card.js +14 -60
  92. package/lib/components/Card.js.map +1 -1
  93. package/lib/components/Card.module.scss +92 -0
  94. package/lib/components/Carousel.js +27 -60
  95. package/lib/components/Carousel.js.map +1 -1
  96. package/lib/components/Carousel.module.scss +43 -0
  97. package/lib/components/CenteredLoader.js +6 -18
  98. package/lib/components/CenteredLoader.js.map +1 -1
  99. package/lib/components/CenteredLoader.module.scss +11 -0
  100. package/lib/components/Checkbox.js +26 -87
  101. package/lib/components/Checkbox.js.map +1 -1
  102. package/lib/components/Checkbox.module.scss +106 -0
  103. package/lib/components/CheckboxFormik.js +16 -37
  104. package/lib/components/CheckboxFormik.js.map +1 -1
  105. package/lib/components/CircularProgressBar.js +27 -78
  106. package/lib/components/CircularProgressBar.js.map +1 -1
  107. package/lib/components/CircularProgressBar.module.scss +37 -0
  108. package/lib/components/ContextMenu.js +60 -86
  109. package/lib/components/ContextMenu.js.map +1 -1
  110. package/lib/components/ContextMenu.module.scss +37 -0
  111. package/lib/components/Dialog.js +30 -50
  112. package/lib/components/Dialog.js.map +1 -1
  113. package/lib/components/Dialog.module.scss +62 -0
  114. package/lib/components/EmptyState.js +20 -66
  115. package/lib/components/EmptyState.js.map +1 -1
  116. package/lib/components/EmptyState.module.scss +87 -0
  117. package/lib/components/Error.js +7 -28
  118. package/lib/components/Error.js.map +1 -1
  119. package/lib/components/Error.module.scss +12 -0
  120. package/lib/components/FieldHeader.js +14 -43
  121. package/lib/components/FieldHeader.js.map +1 -1
  122. package/lib/components/FieldHeader.module.scss +20 -0
  123. package/lib/components/Help.js +13 -42
  124. package/lib/components/Help.js.map +1 -1
  125. package/lib/components/Help.module.scss +9 -0
  126. package/lib/components/Icon.js +25 -48
  127. package/lib/components/Icon.js.map +1 -1
  128. package/lib/components/Icon.module.scss +33 -0
  129. package/lib/components/IconButton.js +23 -81
  130. package/lib/components/IconButton.js.map +1 -1
  131. package/lib/components/IconButton.module.scss +59 -0
  132. package/lib/components/InteractiveList.js +41 -115
  133. package/lib/components/InteractiveList.js.map +1 -1
  134. package/lib/components/InteractiveList.module.scss +72 -0
  135. package/lib/components/InteractiveListFormik.js +81 -110
  136. package/lib/components/InteractiveListFormik.js.map +1 -1
  137. package/lib/components/Label.js +5 -20
  138. package/lib/components/Label.js.map +1 -1
  139. package/lib/components/Label.module.scss +12 -0
  140. package/lib/components/Link.js +31 -59
  141. package/lib/components/Link.js.map +1 -1
  142. package/lib/components/Link.module.scss +64 -0
  143. package/lib/components/Loader.js +23 -82
  144. package/lib/components/Loader.js.map +1 -1
  145. package/lib/components/Loader.module.scss +74 -0
  146. package/lib/components/Modal.js +26 -93
  147. package/lib/components/Modal.js.map +1 -1
  148. package/lib/components/Modal.module.scss +109 -0
  149. package/lib/components/Notification.js +37 -75
  150. package/lib/components/Notification.js.map +1 -1
  151. package/lib/components/Notification.module.scss +97 -0
  152. package/lib/components/NumberBadge.js +7 -18
  153. package/lib/components/NumberBadge.js.map +1 -1
  154. package/lib/components/NumberBadge.module.scss +13 -0
  155. package/lib/components/NumberField.js +140 -181
  156. package/lib/components/NumberField.js.map +1 -1
  157. package/lib/components/NumberField.module.scss +76 -0
  158. package/lib/components/NumberFieldFormik.js +49 -69
  159. package/lib/components/NumberFieldFormik.js.map +1 -1
  160. package/lib/components/Overlay.js +29 -92
  161. package/lib/components/Overlay.js.map +1 -1
  162. package/lib/components/Overlay.module.scss +108 -0
  163. package/lib/components/Pagination.js +91 -198
  164. package/lib/components/Pagination.js.map +1 -1
  165. package/lib/components/Pagination.module.scss +117 -0
  166. package/lib/components/PasswordField.js +25 -61
  167. package/lib/components/PasswordField.js.map +1 -1
  168. package/lib/components/PasswordField.module.scss +26 -0
  169. package/lib/components/PasswordFieldFormik.js +16 -37
  170. package/lib/components/PasswordFieldFormik.js.map +1 -1
  171. package/lib/components/Popover.js +67 -85
  172. package/lib/components/Popover.js.map +1 -1
  173. package/lib/components/Popover.module.scss +12 -0
  174. package/lib/components/Radio.js +26 -67
  175. package/lib/components/Radio.js.map +1 -1
  176. package/lib/components/Radio.module.scss +112 -0
  177. package/lib/components/RadioFormik.js +11 -26
  178. package/lib/components/RadioFormik.js.map +1 -1
  179. package/lib/components/RadioGroup.js +18 -51
  180. package/lib/components/RadioGroup.js.map +1 -1
  181. package/lib/components/RadioGroup.module.scss +21 -0
  182. package/lib/components/RadioGroupContext.js +3 -10
  183. package/lib/components/RadioGroupContext.js.map +1 -1
  184. package/lib/components/RadioGroupFormik.js +16 -34
  185. package/lib/components/RadioGroupFormik.js.map +1 -1
  186. package/lib/components/SegmentedControl.js +9 -43
  187. package/lib/components/SegmentedControl.js.map +1 -1
  188. package/lib/components/SegmentedControl.module.scss +81 -0
  189. package/lib/components/SegmentedControlFormik.js +12 -30
  190. package/lib/components/SegmentedControlFormik.js.map +1 -1
  191. package/lib/components/Select/CheckableSelectField.js +74 -178
  192. package/lib/components/Select/CheckableSelectField.js.map +1 -1
  193. package/lib/components/Select/CheckableSelectField.module.scss +100 -0
  194. package/lib/components/Select/CheckableSelectFieldFormik.js +18 -41
  195. package/lib/components/Select/CheckableSelectFieldFormik.js.map +1 -1
  196. package/lib/components/Select/Common.js +44 -87
  197. package/lib/components/Select/Common.js.map +1 -1
  198. package/lib/components/Select/Common.module.scss +69 -0
  199. package/lib/components/Select/MultiSelectField.js +107 -187
  200. package/lib/components/Select/MultiSelectField.js.map +1 -1
  201. package/lib/components/Select/MultiSelectField.module.scss +72 -0
  202. package/lib/components/Select/MultiSelectFieldFormik.js +18 -41
  203. package/lib/components/Select/MultiSelectFieldFormik.js.map +1 -1
  204. package/lib/components/Select/SelectField.js +100 -169
  205. package/lib/components/Select/SelectField.js.map +1 -1
  206. package/lib/components/Select/SelectField.module.scss +194 -0
  207. package/lib/components/Select/SelectFieldFormik.js +18 -38
  208. package/lib/components/Select/SelectFieldFormik.js.map +1 -1
  209. package/lib/components/Select/helpers.js +25 -30
  210. package/lib/components/Select/helpers.js.map +1 -1
  211. package/lib/components/Select/index.js +8 -21
  212. package/lib/components/Select/index.js.map +1 -1
  213. package/lib/components/SimpleTable.js +13 -36
  214. package/lib/components/SimpleTable.js.map +1 -1
  215. package/lib/components/SimpleTable.module.scss +28 -0
  216. package/lib/components/Slider.js +173 -294
  217. package/lib/components/Slider.js.map +1 -1
  218. package/lib/components/Slider.module.scss +277 -0
  219. package/lib/components/SliderFormik.js +13 -30
  220. package/lib/components/SliderFormik.js.map +1 -1
  221. package/lib/components/Table/Cell.js +58 -111
  222. package/lib/components/Table/Cell.js.map +1 -1
  223. package/lib/components/Table/Cell.module.scss +61 -0
  224. package/lib/components/Table/CellWrapper.js +27 -44
  225. package/lib/components/Table/CellWrapper.js.map +1 -1
  226. package/lib/components/Table/EnhancedRenderers.js +12 -31
  227. package/lib/components/Table/EnhancedRenderers.js.map +1 -1
  228. package/lib/components/Table/Header.js +92 -141
  229. package/lib/components/Table/Header.js.map +1 -1
  230. package/lib/components/Table/Header.module.scss +128 -0
  231. package/lib/components/Table/Row.js +22 -77
  232. package/lib/components/Table/Row.js.map +1 -1
  233. package/lib/components/Table/Row.module.scss +59 -0
  234. package/lib/components/Table/Table.js +245 -456
  235. package/lib/components/Table/Table.js.map +1 -1
  236. package/lib/components/Table/Table.module.scss +31 -0
  237. package/lib/components/Table/TableContent.js +57 -129
  238. package/lib/components/Table/TableContent.js.map +1 -1
  239. package/lib/components/Table/TableContent.module.scss +21 -0
  240. package/lib/components/Table/constants.js +3 -8
  241. package/lib/components/Table/constants.js.map +1 -1
  242. package/lib/components/Table/features/columnsSelection/CellCopyablePopover.js +12 -39
  243. package/lib/components/Table/features/columnsSelection/CellCopyablePopover.js.map +1 -1
  244. package/lib/components/Table/features/columnsSelection/CellCopyablePopover.module.scss +12 -0
  245. package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.js +16 -23
  246. package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.js.map +1 -1
  247. package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.module.scss +6 -0
  248. package/lib/components/Table/features/columnsSelection/ContextMenu/index.js +2 -8
  249. package/lib/components/Table/features/columnsSelection/ContextMenu/index.js.map +1 -1
  250. package/lib/components/Table/features/columnsSelection/columnsSelection.js +68 -76
  251. package/lib/components/Table/features/columnsSelection/columnsSelection.js.map +1 -1
  252. package/lib/components/Table/features/columnsSelection/helpers.js +22 -28
  253. package/lib/components/Table/features/columnsSelection/helpers.js.map +1 -1
  254. package/lib/components/Table/features/columnsSelection/index.js +5 -16
  255. package/lib/components/Table/features/columnsSelection/index.js.map +1 -1
  256. package/lib/components/Table/helpers.js +9 -17
  257. package/lib/components/Table/helpers.js.map +1 -1
  258. package/lib/components/Table/tableTypes.js +2 -3
  259. package/lib/components/Table/tableTypes.js.map +1 -1
  260. package/lib/components/Table/useTrackTableState.js +29 -43
  261. package/lib/components/Table/useTrackTableState.js.map +1 -1
  262. package/lib/components/Table/utils.js +111 -176
  263. package/lib/components/Table/utils.js.map +1 -1
  264. package/lib/components/Tabs/Tab.js +27 -61
  265. package/lib/components/Tabs/Tab.js.map +1 -1
  266. package/lib/components/Tabs/Tab.module.scss +58 -0
  267. package/lib/components/Tabs/TabContext.js +26 -51
  268. package/lib/components/Tabs/TabContext.js.map +1 -1
  269. package/lib/components/Tabs/TabList.js +49 -62
  270. package/lib/components/Tabs/TabList.js.map +1 -1
  271. package/lib/components/Tabs/TabList.module.scss +3 -0
  272. package/lib/components/Tabs/TabPanel.js +9 -29
  273. package/lib/components/Tabs/TabPanel.js.map +1 -1
  274. package/lib/components/Tabs/TabPanel.module.scss +7 -0
  275. package/lib/components/Tabs/index.js +5 -20
  276. package/lib/components/Tabs/index.js.map +1 -1
  277. package/lib/components/Terminal.js +108 -179
  278. package/lib/components/Terminal.js.map +1 -1
  279. package/lib/components/Terminal.module.scss +109 -0
  280. package/lib/components/TextArea.js +24 -79
  281. package/lib/components/TextArea.js.map +1 -1
  282. package/lib/components/TextArea.module.scss +144 -0
  283. package/lib/components/TextAreaFormik.js +10 -26
  284. package/lib/components/TextAreaFormik.js.map +1 -1
  285. package/lib/components/TextField.js +48 -154
  286. package/lib/components/TextField.js.map +1 -1
  287. package/lib/components/TextField.module.scss +209 -0
  288. package/lib/components/TextFieldFormik.js +22 -46
  289. package/lib/components/TextFieldFormik.js.map +1 -1
  290. package/lib/components/TimeField.js +14 -62
  291. package/lib/components/TimeField.js.map +1 -1
  292. package/lib/components/TimeField.module.scss +4 -0
  293. package/lib/components/TimeFieldFormik.js +10 -26
  294. package/lib/components/TimeFieldFormik.js.map +1 -1
  295. package/lib/components/Toast.js +44 -79
  296. package/lib/components/Toast.js.map +1 -1
  297. package/lib/components/Toast.module.scss +53 -0
  298. package/lib/components/Toggle.js +21 -71
  299. package/lib/components/Toggle.js.map +1 -1
  300. package/lib/components/Toggle.module.scss +175 -0
  301. package/lib/components/ToggleFormik.js +11 -27
  302. package/lib/components/ToggleFormik.js.map +1 -1
  303. package/lib/components/Tooltip.js +39 -79
  304. package/lib/components/Tooltip.js.map +1 -1
  305. package/lib/components/Tooltip.module.scss +44 -0
  306. package/lib/components/TruncatedText.js +22 -49
  307. package/lib/components/TruncatedText.js.map +1 -1
  308. package/lib/components/TruncatedText.module.scss +9 -0
  309. package/lib/helpers/array.js +17 -26
  310. package/lib/helpers/array.js.map +1 -1
  311. package/lib/helpers/escapeHtml.js +6 -10
  312. package/lib/helpers/escapeHtml.js.map +1 -1
  313. package/lib/helpers/forms.js +14 -20
  314. package/lib/helpers/forms.js.map +1 -1
  315. package/lib/helpers/math.js +6 -10
  316. package/lib/helpers/math.js.map +1 -1
  317. package/lib/helpers/types.js +2 -6
  318. package/lib/helpers/types.js.map +1 -1
  319. package/lib/hooks/index.js +7 -17
  320. package/lib/hooks/index.js.map +1 -1
  321. package/lib/hooks/useCloseOnResize.js +12 -17
  322. package/lib/hooks/useCloseOnResize.js.map +1 -1
  323. package/lib/hooks/useDeepCompareMemo.js +7 -12
  324. package/lib/hooks/useDeepCompareMemo.js.map +1 -1
  325. package/lib/hooks/useDeepEqual.js +9 -14
  326. package/lib/hooks/useDeepEqual.js.map +1 -1
  327. package/lib/hooks/useDimensions.js +15 -26
  328. package/lib/hooks/useDimensions.js.map +1 -1
  329. package/lib/hooks/useIsMounted.js +11 -16
  330. package/lib/hooks/useIsMounted.js.map +1 -1
  331. package/lib/hooks/useOnClickOutside.js +32 -41
  332. package/lib/hooks/useOnClickOutside.js.map +1 -1
  333. package/lib/hooks/useOpenCloseState.js +13 -18
  334. package/lib/hooks/useOpenCloseState.js.map +1 -1
  335. package/lib/hooks/usePagination.js +60 -64
  336. package/lib/hooks/usePagination.js.map +1 -1
  337. package/lib/hooks/usePersistedState.js +33 -35
  338. package/lib/hooks/usePersistedState.js.map +1 -1
  339. package/lib/hooks/usePrevious.js +8 -13
  340. package/lib/hooks/usePrevious.js.map +1 -1
  341. package/lib/hooks/useRefValue.js +8 -13
  342. package/lib/hooks/useRefValue.js.map +1 -1
  343. package/lib/icons/Cluster.js +7 -44
  344. package/lib/icons/Cluster.js.map +1 -1
  345. package/lib/icons/Compare.js +7 -46
  346. package/lib/icons/Compare.js.map +1 -1
  347. package/lib/icons/Compute.js +7 -43
  348. package/lib/icons/Compute.js.map +1 -1
  349. package/lib/icons/Folder.js +4 -25
  350. package/lib/icons/Folder.js.map +1 -1
  351. package/lib/icons/PlusCircle.js +6 -37
  352. package/lib/icons/PlusCircle.js.map +1 -1
  353. package/lib/icons/Streaming.js +8 -45
  354. package/lib/icons/Streaming.js.map +1 -1
  355. package/lib/index.js +71 -178
  356. package/lib/index.js.map +1 -1
  357. package/lib/services/logger.js +75 -85
  358. package/lib/services/logger.js.map +1 -1
  359. package/lib/services/time.js +14 -18
  360. package/lib/services/time.js.map +1 -1
  361. package/lib/test-helpers/index.d.ts +3 -0
  362. package/lib/test-helpers/index.js +4 -0
  363. package/lib/test-helpers/index.js.map +1 -0
  364. package/lib/test-helpers/render.d.ts +10 -0
  365. package/lib/test-helpers/render.js +24 -0
  366. package/lib/test-helpers/render.js.map +1 -0
  367. package/lib/test-helpers/time.d.ts +1 -0
  368. package/lib/test-helpers/time.js +2 -0
  369. package/lib/test-helpers/time.js.map +1 -0
  370. package/lib/test-helpers/utils.d.ts +5 -0
  371. package/lib/test-helpers/utils.js +11 -0
  372. package/lib/test-helpers/utils.js.map +1 -0
  373. package/lib/types.js +2 -3
  374. package/lib/types.js.map +1 -1
  375. package/lib/utils/formik.js +7 -12
  376. package/lib/utils/formik.js.map +1 -1
  377. package/lib/utils/keyboard.js +3 -8
  378. package/lib/utils/keyboard.js.map +1 -1
  379. package/lib/utils/portal.js +14 -19
  380. package/lib/utils/portal.js.map +1 -1
  381. package/lib/utils/ssr.js +2 -6
  382. package/lib/utils/ssr.js.map +1 -1
  383. package/lib/utils/types.js +2 -3
  384. package/lib/utils/types.js.map +1 -1
  385. package/package.json +3 -2
  386. package/lib/components/Alert.module.scss.js +0 -8
  387. package/lib/components/Alert.module.scss.js.map +0 -1
  388. package/lib/components/AppHeader/AppHeader.module.scss.js +0 -8
  389. package/lib/components/AppHeader/AppHeader.module.scss.js.map +0 -1
  390. package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.module.scss.js +0 -8
  391. package/lib/components/AppHeader/AppHeaderLogo/AppHeaderLogo.module.scss.js.map +0 -1
  392. package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.module.scss.js +0 -8
  393. package/lib/components/AppHeader/AppHeaderMenu/AppHeaderMenu.module.scss.js.map +0 -1
  394. package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.module.scss.js +0 -8
  395. package/lib/components/AppHeader/EnvironmentBadge/EnvironmentBadge.module.scss.js.map +0 -1
  396. package/lib/components/AppHeader/SelectCluster/SelectCluster.module.scss.js +0 -8
  397. package/lib/components/AppHeader/SelectCluster/SelectCluster.module.scss.js.map +0 -1
  398. package/lib/components/AppSidebar/AppSidebar.module.scss.js +0 -8
  399. package/lib/components/AppSidebar/AppSidebar.module.scss.js.map +0 -1
  400. package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.module.scss.js +0 -8
  401. package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.module.scss.js.map +0 -1
  402. package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.module.scss.js +0 -8
  403. package/lib/components/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.module.scss.js.map +0 -1
  404. package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.module.scss.js +0 -8
  405. package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.module.scss.js.map +0 -1
  406. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.module.scss.js +0 -8
  407. package/lib/components/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.module.scss.js.map +0 -1
  408. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.module.scss.js +0 -8
  409. package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.module.scss.js.map +0 -1
  410. package/lib/components/AutocompleteField.module.scss.js +0 -8
  411. package/lib/components/AutocompleteField.module.scss.js.map +0 -1
  412. package/lib/components/Badge.module.scss.js +0 -8
  413. package/lib/components/Badge.module.scss.js.map +0 -1
  414. package/lib/components/Button.module.scss.js +0 -8
  415. package/lib/components/Button.module.scss.js.map +0 -1
  416. package/lib/components/Calendar/Calendar.module.scss.js +0 -8
  417. package/lib/components/Calendar/Calendar.module.scss.js.map +0 -1
  418. package/lib/components/Calendar/CalendarRange.module.scss.js +0 -8
  419. package/lib/components/Calendar/CalendarRange.module.scss.js.map +0 -1
  420. package/lib/components/Calendar/components/CalendarTime.module.scss.js +0 -8
  421. package/lib/components/Calendar/components/CalendarTime.module.scss.js.map +0 -1
  422. package/lib/components/Card.module.scss.js +0 -8
  423. package/lib/components/Card.module.scss.js.map +0 -1
  424. package/lib/components/Carousel.module.scss.js +0 -8
  425. package/lib/components/Carousel.module.scss.js.map +0 -1
  426. package/lib/components/CenteredLoader.module.scss.js +0 -8
  427. package/lib/components/CenteredLoader.module.scss.js.map +0 -1
  428. package/lib/components/Checkbox.module.scss.js +0 -8
  429. package/lib/components/Checkbox.module.scss.js.map +0 -1
  430. package/lib/components/CircularProgressBar.module.scss.js +0 -8
  431. package/lib/components/CircularProgressBar.module.scss.js.map +0 -1
  432. package/lib/components/ContextMenu.module.scss.js +0 -8
  433. package/lib/components/ContextMenu.module.scss.js.map +0 -1
  434. package/lib/components/Dialog.module.scss.js +0 -8
  435. package/lib/components/Dialog.module.scss.js.map +0 -1
  436. package/lib/components/EmptyState.module.scss.js +0 -8
  437. package/lib/components/EmptyState.module.scss.js.map +0 -1
  438. package/lib/components/Error.module.scss.js +0 -8
  439. package/lib/components/Error.module.scss.js.map +0 -1
  440. package/lib/components/FieldHeader.module.scss.js +0 -8
  441. package/lib/components/FieldHeader.module.scss.js.map +0 -1
  442. package/lib/components/Help.module.scss.js +0 -8
  443. package/lib/components/Help.module.scss.js.map +0 -1
  444. package/lib/components/Icon.module.scss.js +0 -8
  445. package/lib/components/Icon.module.scss.js.map +0 -1
  446. package/lib/components/IconButton.module.scss.js +0 -8
  447. package/lib/components/IconButton.module.scss.js.map +0 -1
  448. package/lib/components/InteractiveList.module.scss.js +0 -8
  449. package/lib/components/InteractiveList.module.scss.js.map +0 -1
  450. package/lib/components/Label.module.scss.js +0 -8
  451. package/lib/components/Label.module.scss.js.map +0 -1
  452. package/lib/components/Link.module.scss.js +0 -8
  453. package/lib/components/Link.module.scss.js.map +0 -1
  454. package/lib/components/Loader.module.scss.js +0 -8
  455. package/lib/components/Loader.module.scss.js.map +0 -1
  456. package/lib/components/Modal.module.scss.js +0 -8
  457. package/lib/components/Modal.module.scss.js.map +0 -1
  458. package/lib/components/Notification.module.scss.js +0 -8
  459. package/lib/components/Notification.module.scss.js.map +0 -1
  460. package/lib/components/NumberBadge.module.scss.js +0 -8
  461. package/lib/components/NumberBadge.module.scss.js.map +0 -1
  462. package/lib/components/NumberField.module.scss.js +0 -8
  463. package/lib/components/NumberField.module.scss.js.map +0 -1
  464. package/lib/components/Overlay.module.scss.js +0 -8
  465. package/lib/components/Overlay.module.scss.js.map +0 -1
  466. package/lib/components/Pagination.module.scss.js +0 -8
  467. package/lib/components/Pagination.module.scss.js.map +0 -1
  468. package/lib/components/PasswordField.module.scss.js +0 -8
  469. package/lib/components/PasswordField.module.scss.js.map +0 -1
  470. package/lib/components/Popover.module.scss.js +0 -8
  471. package/lib/components/Popover.module.scss.js.map +0 -1
  472. package/lib/components/Radio.module.scss.js +0 -8
  473. package/lib/components/Radio.module.scss.js.map +0 -1
  474. package/lib/components/RadioGroup.module.scss.js +0 -8
  475. package/lib/components/RadioGroup.module.scss.js.map +0 -1
  476. package/lib/components/SegmentedControl.module.scss.js +0 -8
  477. package/lib/components/SegmentedControl.module.scss.js.map +0 -1
  478. package/lib/components/Select/CheckableSelectField.module.scss.js +0 -8
  479. package/lib/components/Select/CheckableSelectField.module.scss.js.map +0 -1
  480. package/lib/components/Select/Common.module.scss.js +0 -8
  481. package/lib/components/Select/Common.module.scss.js.map +0 -1
  482. package/lib/components/Select/MultiSelectField.module.scss.js +0 -8
  483. package/lib/components/Select/MultiSelectField.module.scss.js.map +0 -1
  484. package/lib/components/Select/SelectField.module.scss.js +0 -8
  485. package/lib/components/Select/SelectField.module.scss.js.map +0 -1
  486. package/lib/components/SimpleTable.module.scss.js +0 -8
  487. package/lib/components/SimpleTable.module.scss.js.map +0 -1
  488. package/lib/components/Slider.module.scss.js +0 -8
  489. package/lib/components/Slider.module.scss.js.map +0 -1
  490. package/lib/components/Table/Cell.module.scss.js +0 -8
  491. package/lib/components/Table/Cell.module.scss.js.map +0 -1
  492. package/lib/components/Table/Header.module.scss.js +0 -8
  493. package/lib/components/Table/Header.module.scss.js.map +0 -1
  494. package/lib/components/Table/Row.module.scss.js +0 -8
  495. package/lib/components/Table/Row.module.scss.js.map +0 -1
  496. package/lib/components/Table/Table.module.scss.js +0 -8
  497. package/lib/components/Table/Table.module.scss.js.map +0 -1
  498. package/lib/components/Table/TableContent.module.scss.js +0 -8
  499. package/lib/components/Table/TableContent.module.scss.js.map +0 -1
  500. package/lib/components/Table/features/columnsSelection/CellCopyablePopover.module.scss.js +0 -8
  501. package/lib/components/Table/features/columnsSelection/CellCopyablePopover.module.scss.js.map +0 -1
  502. package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.module.scss.js +0 -8
  503. package/lib/components/Table/features/columnsSelection/ContextMenu/ContextMenu.module.scss.js.map +0 -1
  504. package/lib/components/Tabs/Tab.module.scss.js +0 -8
  505. package/lib/components/Tabs/Tab.module.scss.js.map +0 -1
  506. package/lib/components/Tabs/TabList.module.scss.js +0 -8
  507. package/lib/components/Tabs/TabList.module.scss.js.map +0 -1
  508. package/lib/components/Tabs/TabPanel.module.scss.js +0 -8
  509. package/lib/components/Tabs/TabPanel.module.scss.js.map +0 -1
  510. package/lib/components/Terminal.module.scss.js +0 -8
  511. package/lib/components/Terminal.module.scss.js.map +0 -1
  512. package/lib/components/TextArea.module.scss.js +0 -8
  513. package/lib/components/TextArea.module.scss.js.map +0 -1
  514. package/lib/components/TextField.module.scss.js +0 -8
  515. package/lib/components/TextField.module.scss.js.map +0 -1
  516. package/lib/components/TimeField.module.scss.js +0 -8
  517. package/lib/components/TimeField.module.scss.js.map +0 -1
  518. package/lib/components/Toast.module.scss.js +0 -8
  519. package/lib/components/Toast.module.scss.js.map +0 -1
  520. package/lib/components/Toggle.module.scss.js +0 -8
  521. package/lib/components/Toggle.module.scss.js.map +0 -1
  522. package/lib/components/Tooltip.module.scss.js +0 -8
  523. package/lib/components/Tooltip.module.scss.js.map +0 -1
  524. package/lib/components/TruncatedText.module.scss.js +0 -8
  525. package/lib/components/TruncatedText.module.scss.js.map +0 -1
  526. package/lib/styles/constants/export.module.scss.js +0 -8
  527. package/lib/styles/constants/export.module.scss.js.map +0 -1
  528. package/lib/styles.css +0 -1
@@ -1,30 +1,27 @@
1
- 'use strict';
2
-
3
- var debounce = require('lodash/debounce');
4
- var React = require('react');
5
- var cn = require('classnames');
6
- var HotKeys = require('react-hot-keys');
7
- var reactTable = require('@tanstack/react-table');
8
- var reactFeather = require('react-feather');
9
- var components_Pagination = require('../Pagination.js');
10
- var components_Table_Cell = require('./Cell.js');
11
- var components_Table_EnhancedRenderers = require('./EnhancedRenderers.js');
12
- var components_Table_Header = require('./Header.js');
13
- var components_Table_Row = require('./Row.js');
14
- var components_Loader = require('../Loader.js');
15
- var components_EmptyState = require('../EmptyState.js');
16
- var hooks_usePrevious = require('../../hooks/usePrevious.js');
17
- var components_Icon = require('../Icon.js');
18
- var components_Table_TableContent = require('./TableContent.js');
19
- var components_Table_constants = require('./constants.js');
20
- var components_Table_features_columnsSelection_columnsSelection = require('./features/columnsSelection/columnsSelection.js');
21
- var components_Table_features_columnsSelection_ContextMenu_ContextMenu = require('./features/columnsSelection/ContextMenu/ContextMenu.js');
22
- var components_Table_useTrackTableState = require('./useTrackTableState.js');
23
- var components_Table_utils = require('./utils.js');
24
- var Table_module = require('./Table.module.scss.js');
25
- var export_module = require('../../styles/constants/export.module.scss.js');
26
- var hooks_useRefValue = require('../../hooks/useRefValue.js');
27
-
1
+ import debounce from 'lodash/debounce';
2
+ import React, { useCallback, useEffect, useRef, useMemo, useState, } from 'react';
3
+ import cn from 'classnames';
4
+ import HotKeys from 'react-hot-keys';
5
+ import { useReactTable, getCoreRowModel, getPaginationRowModel, getSortedRowModel, getExpandedRowModel, getFilteredRowModel, } from '@tanstack/react-table';
6
+ import { AlertTriangle, ChevronDown, ChevronUp } from 'react-feather';
7
+ import { Pagination } from '../Pagination';
8
+ import { Cell } from './Cell';
9
+ import { EnhancedCellRenderer, EnhancedHeaderFooterRenderer } from './EnhancedRenderers';
10
+ import { Header } from './Header';
11
+ import { HeaderRow, Row } from './Row';
12
+ import { Loader } from '../Loader';
13
+ import { EmptyState } from '../EmptyState';
14
+ import { usePrevious } from '../../hooks/usePrevious';
15
+ import { Icon } from '../Icon';
16
+ import { TableContent } from './TableContent';
17
+ import { ROW_EXPANDER_COLUMN_ID } from './constants';
18
+ import { useColumnsSelection, ContextMenu } from './features/columnsSelection';
19
+ import { useRefValue } from '../../hooks';
20
+ import { useTrackTableState } from './useTrackTableState';
21
+ import { getCellStyle, getColumnDef, getRowStyle, getTableInitialState, prepareRow } from './utils';
22
+ import styles from './Table.module.scss';
23
+ import styleConsts from '../../../styles/constants/export.module.scss';
24
+ export * from './tableTypes';
28
25
  /**
29
26
  * ### Purpose
30
27
  * Table component allows to arrange data in rows and columns.
@@ -36,436 +33,228 @@ var hooks_useRefValue = require('../../hooks/useRefValue.js');
36
33
  * - Is able to resize columns out of the box
37
34
  */
38
35
  // Inspiration here: https://react-table.tanstack.com/docs/examples/basic
39
- const Table = ({
40
- 'data-test': dataTest,
41
- columns: propColumns,
42
- data,
43
- disableSortBy,
44
- onPaginationChange,
45
- onSortingChange,
46
- manualPagination,
47
- onRenderedContentChange,
48
- hidePagination = false,
49
- pageCount: controlledPageCount,
50
- defaultPageSize = 10,
51
- paginationOptions,
52
- onRowClick,
53
- getHref,
54
- AnchorComponent,
55
- getCustomRowProps,
56
- getCustomCellProps,
57
- loading,
58
- noDataTitle = 'The table is empty',
59
- pageIndex: incomingPageIndex,
60
- initialState = {
61
- paginationOptions: {
62
- pageIndex: incomingPageIndex || 0,
63
- pageSize: defaultPageSize
64
- }
65
- },
66
- className = '',
67
- headerClassName = '',
68
- contentClassName = '',
69
- footerClassName = '',
70
- searchValue,
71
- hideHeader,
72
- onPageChange,
73
- overlayLoading,
74
- onRowSelect,
75
- columnsOrdering = false,
76
- children,
77
- renderRowSubComponent,
78
- onCopy,
79
- canExpand,
80
- onStateChange
81
- }) => {
82
- var _a;
83
- const getOncopy = hooks_useRefValue.useRefValue(onCopy);
84
- const getCanExpand = hooks_useRefValue.useRefValue(canExpand);
85
- const getRenderRowSubComponent = hooks_useRefValue.useRefValue(renderRowSubComponent);
86
- const [contextMenuAnchorEl, setContextMenuAnchorEl] = React.useState(null);
87
- const draggedColumnRef = React.useRef(null);
88
- const previousIncomingPageIndex = hooks_usePrevious.usePrevious(incomingPageIndex);
89
- const columns = React.useMemo(() => {
90
- if (renderRowSubComponent || data.some(item => 'subRows' in item)) {
91
- const expander = {
92
- width: 60,
93
- disableResizing: true,
94
- id: components_Table_constants.ROW_EXPANDER_COLUMN_ID,
95
- Header: () => /*#__PURE__*/React.createElement("span", {
96
- role: "contentinfo",
97
- "aria-label": "row-expander-column-header"
98
- }),
99
- Cell: ({
100
- row
101
- }) => {
102
- if (row.getCanExpand()) {
103
- return /*#__PURE__*/React.createElement("div", {
104
- tabIndex: 0,
105
- role: "button",
106
- "data-test": "row-expander",
107
- "aria-expanded": row.getIsExpanded(),
108
- className: Table_module.default.expander,
109
- onClick: e => {
110
- e.preventDefault();
111
- row.getToggleExpandedHandler()();
112
- }
113
- }, /*#__PURE__*/React.createElement(components_Icon.Icon, {
114
- icon: row.getIsExpanded() ? reactFeather.ChevronUp : reactFeather.ChevronDown,
115
- ariaLabel: "row-expander"
116
- }));
117
- }
118
- return /*#__PURE__*/React.createElement(React.Fragment, null, null);
36
+ export const Table = ({ 'data-test': dataTest, columns: propColumns, data, disableSortBy, onPaginationChange, onSortingChange, manualPagination, onRenderedContentChange, hidePagination = false, pageCount: controlledPageCount, defaultPageSize = 10, paginationOptions, onRowClick, getHref, AnchorComponent, getCustomRowProps, getCustomCellProps, loading, noDataTitle = 'The table is empty', pageIndex: incomingPageIndex, initialState = { paginationOptions: { pageIndex: incomingPageIndex || 0, pageSize: defaultPageSize } }, className = '', headerClassName = '', contentClassName = '', footerClassName = '', searchValue, hideHeader, onPageChange, overlayLoading, onRowSelect, columnsOrdering = false, children, renderRowSubComponent, onCopy, canExpand, onStateChange, }) => {
37
+ var _a;
38
+ const getOncopy = useRefValue(onCopy);
39
+ const getCanExpand = useRefValue(canExpand);
40
+ const getRenderRowSubComponent = useRefValue(renderRowSubComponent);
41
+ const [contextMenuAnchorEl, setContextMenuAnchorEl] = useState(null);
42
+ const draggedColumnRef = useRef(null);
43
+ const previousIncomingPageIndex = usePrevious(incomingPageIndex);
44
+ const columns = useMemo(() => {
45
+ if (renderRowSubComponent || data.some((item) => 'subRows' in item)) {
46
+ const expander = {
47
+ width: 60,
48
+ disableResizing: true,
49
+ id: ROW_EXPANDER_COLUMN_ID,
50
+ Header: () => React.createElement("span", { role: "contentinfo", "aria-label": "row-expander-column-header" }),
51
+ Cell: ({ row }) => {
52
+ if (row.getCanExpand()) {
53
+ return (React.createElement("div", { tabIndex: 0, role: "button", "data-test": "row-expander", "aria-expanded": row.getIsExpanded(), className: styles.expander, onClick: (e) => {
54
+ e.preventDefault();
55
+ row.getToggleExpandedHandler()();
56
+ } },
57
+ React.createElement(Icon, { icon: row.getIsExpanded() ? ChevronUp : ChevronDown, ariaLabel: "row-expander" })));
58
+ }
59
+ return React.createElement(React.Fragment, null, null);
60
+ },
61
+ };
62
+ return [expander, ...propColumns].map(getColumnDef);
119
63
  }
120
- };
121
- return [expander, ...propColumns].map(components_Table_utils.getColumnDef);
122
- }
123
- return propColumns.map(components_Table_utils.getColumnDef);
124
- }, [propColumns, data, renderRowSubComponent]);
125
- const defaultColumn = React.useMemo(() => ({
126
- cell: props => /*#__PURE__*/React.createElement(components_Table_EnhancedRenderers.EnhancedCellRenderer, {
127
- cell: props.cell,
128
- columnResizing: props.column.getIsResizing()
129
- }),
130
- minSize: Number(export_module.default.tableColumnMinWidth),
131
- // minWidth is only used as a limit for resizing
132
- size: Number(export_module.default.tableColumnWidth),
133
- // width is used for both the flex-basis and flex-grow
134
- maxSize: Number(export_module.default.tableColumnMaxWidth) // maxWidth is only used as a limit for resizing
135
- }), []);
136
- const tableInitialState = React.useMemo(() => components_Table_utils.getTableInitialState(initialState), [initialState]);
137
- const tableInstance = reactTable.useReactTable({
138
- columns,
139
- data,
140
- enableSorting: !disableSortBy,
141
- enableMultiSort: false,
142
- // Pass our hoisted table state
143
- initialState: tableInitialState,
144
- // Tell the usePagination hook that we'll handle our own data fetching
145
- manualPagination: manualPagination,
146
- // This means we'll also have to provide our own pageCount
147
- pageCount: controlledPageCount,
148
- defaultColumn,
149
- columnResizeMode: 'onChange',
150
- paginateExpandedRows: false,
151
- autoResetPageIndex: false,
152
- getSubRows: React.useCallback(row => row.subRows, []),
153
- getRowCanExpand: React.useCallback(row => {
154
- var _a;
155
- const cb = getCanExpand();
156
- if (cb) {
157
- return cb(components_Table_utils.prepareRow(row));
158
- }
159
- if (getRenderRowSubComponent()) {
160
- return true;
161
- }
162
- return ((_a = row.subRows) === null || _a === void 0 ? void 0 : _a.length) > 0;
163
- }, [getCanExpand, getRenderRowSubComponent]),
164
- getCoreRowModel: reactTable.getCoreRowModel(),
165
- getPaginationRowModel: reactTable.getPaginationRowModel(),
166
- getSortedRowModel: reactTable.getSortedRowModel(),
167
- getExpandedRowModel: reactTable.getExpandedRowModel(),
168
- getFilteredRowModel: reactTable.getFilteredRowModel()
169
- });
170
- const {
171
- getVisibleFlatColumns,
172
- nextPage,
173
- setPageIndex: goToPage,
174
- getRowCount,
175
- getState,
176
- previousPage,
177
- setPageSize,
178
- setGlobalFilter,
179
- setColumnOrder,
180
- getPageCount,
181
- getCanNextPage,
182
- getCanPreviousPage,
183
- getFooterGroups
184
- } = tableInstance;
185
- components_Table_useTrackTableState.useTrackTableState(tableInstance, onStateChange);
186
- const footerGroups = getFooterGroups();
187
- const page = tableInstance.getPaginationRowModel().rows;
188
- const rowsPerPage = getRowCount();
189
- const pageCount = getPageCount();
190
- const {
191
- sorting: sortBy,
192
- columnOrder,
193
- columnSizing: columnResizing,
194
- rowSelection: selectedRowIds,
195
- pagination: {
196
- pageIndex,
197
- pageSize
198
- }
199
- } = getState();
200
- const getColumnOrder = hooks_useRefValue.useRefValue(columnOrder);
201
- // drag and drop
202
- const onDragStart = React.useCallback(e => {
203
- draggedColumnRef.current = Number(e.dataTransfer.getData('text/plain'));
204
- }, []);
205
- const onDrop = React.useCallback((_, columnIndex) => {
206
- if (draggedColumnRef.current !== null && columnIndex !== draggedColumnRef.current) {
207
- const visibleColumns = getColumnOrder() || getVisibleFlatColumns().map(({
208
- id
209
- }) => id);
210
- const newColumns = [...visibleColumns];
211
- newColumns[columnIndex] = visibleColumns[draggedColumnRef.current];
212
- newColumns[draggedColumnRef.current] = visibleColumns[columnIndex];
213
- setColumnOrder(newColumns);
214
- }
215
- }, [getColumnOrder, getVisibleFlatColumns, setColumnOrder]);
216
- const columnsSelectionProps = components_Table_features_columnsSelection_columnsSelection.useColumnsSelection({
217
- rowsPerPage,
218
- columnsPerRow: columns.length
219
- });
220
- const {
221
- onEndSelection,
222
- getSelectedColumns,
223
- selectedColumnValuesRef
224
- } = columnsSelectionProps;
225
- const onPaginationChangeDebounced = React.useMemo(() => onPaginationChange ? debounce(onPaginationChange, 200) : undefined, [onPaginationChange]);
226
- const onKeyUp = React.useCallback(() => {
227
- const callback = getOncopy();
228
- if (callback) {
229
- const {
64
+ return propColumns.map(getColumnDef);
65
+ }, [propColumns, data, renderRowSubComponent]);
66
+ const defaultColumn = useMemo(() => ({
67
+ cell: (props) => React.createElement(EnhancedCellRenderer, { cell: props.cell, columnResizing: props.column.getIsResizing() }),
68
+ minSize: Number(styleConsts.tableColumnMinWidth), // minWidth is only used as a limit for resizing
69
+ size: Number(styleConsts.tableColumnWidth), // width is used for both the flex-basis and flex-grow
70
+ maxSize: Number(styleConsts.tableColumnMaxWidth), // maxWidth is only used as a limit for resizing
71
+ }), []);
72
+ const tableInitialState = useMemo(() => getTableInitialState(initialState), [initialState]);
73
+ const tableInstance = useReactTable({
230
74
  columns,
231
- range
232
- } = getSelectedColumns();
233
- if (columns.size || range[0] !== undefined && range[0] !== undefined) {
234
- callback(selectedColumnValuesRef === null || selectedColumnValuesRef === void 0 ? void 0 : selectedColumnValuesRef.current);
235
- }
236
- }
237
- }, [getOncopy, getSelectedColumns, selectedColumnValuesRef]);
238
- React.useEffect(() => {
239
- return () => {
240
- document.body.removeEventListener('mouseup', onEndSelection);
241
- document.body.removeEventListener('contextmenu', onEndSelection);
242
- document.body.removeEventListener('keyup', onKeyUp);
243
- };
244
- }, [onKeyUp, onEndSelection]);
245
- // Listen for changes in pagination and use the state to fetch new data. This is a recommended way to fetch new data: https://react-table.tanstack.com/docs/faq#how-can-i-use-the-table-state-to-fetch-new-data
246
- React.useEffect(() => {
247
- if (onPaginationChangeDebounced) {
248
- onPaginationChangeDebounced({
249
- pageIndex,
250
- pageSize
251
- });
252
- }
253
- }, [onPaginationChangeDebounced, pageIndex, pageSize]);
254
- React.useEffect(() => {
255
- if (onSortingChange) {
256
- onSortingChange(sortBy);
257
- }
258
- }, [sortBy, onSortingChange]);
259
- // Debounce our `fetchData` call for 200ms.
260
- const onRenderedContentChangeDebounced = React.useMemo(() => onRenderedContentChange ? debounce(onRenderedContentChange, 200) : undefined, [onRenderedContentChange]);
261
- // Listen for changes in pagination and use the state to fetch new data. This is a recommended way to fetch new data: https://react-table.tanstack.com/docs/faq#how-can-i-use-the-table-state-to-fetch-new-data
262
- React.useEffect(() => {
263
- if (onRenderedContentChangeDebounced) {
264
- onRenderedContentChangeDebounced(page.map(components_Table_utils.prepareRow));
265
- }
266
- }, [onRenderedContentChangeDebounced, page]);
267
- // Apply global filter when searchValue changes
268
- React.useEffect(() => {
269
- if (searchValue !== undefined) {
270
- setGlobalFilter(searchValue);
271
- }
272
- }, [searchValue, setGlobalFilter]);
273
- React.useEffect(() => {
274
- if (pageCount < pageIndex + 1) {
275
- goToPage(pageCount - 1);
276
- }
277
- }, [pageIndex, pageCount, goToPage]);
278
- React.useEffect(() => {
279
- if (incomingPageIndex !== undefined && incomingPageIndex !== previousIncomingPageIndex) {
280
- goToPage(incomingPageIndex);
281
- }
282
- }, [goToPage, incomingPageIndex, previousIncomingPageIndex]);
283
- React.useEffect(() => {
284
- if (onRowSelect) {
285
- onRowSelect(Object.keys(selectedRowIds));
75
+ data,
76
+ enableSorting: !disableSortBy,
77
+ enableMultiSort: false,
78
+ // Pass our hoisted table state
79
+ initialState: tableInitialState,
80
+ // Tell the usePagination hook that we'll handle our own data fetching
81
+ manualPagination: manualPagination,
82
+ // This means we'll also have to provide our own pageCount
83
+ pageCount: controlledPageCount,
84
+ defaultColumn,
85
+ columnResizeMode: 'onChange',
86
+ paginateExpandedRows: false,
87
+ autoResetPageIndex: false,
88
+ getSubRows: useCallback((row) => row.subRows, []),
89
+ getRowCanExpand: useCallback((row) => {
90
+ var _a;
91
+ const cb = getCanExpand();
92
+ if (cb) {
93
+ return cb(prepareRow(row));
94
+ }
95
+ if (getRenderRowSubComponent()) {
96
+ return true;
97
+ }
98
+ return ((_a = row.subRows) === null || _a === void 0 ? void 0 : _a.length) > 0;
99
+ }, [getCanExpand, getRenderRowSubComponent]),
100
+ getCoreRowModel: getCoreRowModel(),
101
+ getPaginationRowModel: getPaginationRowModel(),
102
+ getSortedRowModel: getSortedRowModel(),
103
+ getExpandedRowModel: getExpandedRowModel(),
104
+ getFilteredRowModel: getFilteredRowModel(),
105
+ });
106
+ const { getVisibleFlatColumns, nextPage, setPageIndex: goToPage, getRowCount, getState, previousPage, setPageSize, setGlobalFilter, setColumnOrder, getPageCount, getCanNextPage, getCanPreviousPage, getFooterGroups, } = tableInstance;
107
+ useTrackTableState(tableInstance, onStateChange);
108
+ const footerGroups = getFooterGroups();
109
+ const page = tableInstance.getPaginationRowModel().rows;
110
+ const rowsPerPage = getRowCount();
111
+ const pageCount = getPageCount();
112
+ const { sorting: sortBy, columnOrder, columnSizing: columnResizing, rowSelection: selectedRowIds, pagination: { pageIndex, pageSize }, } = getState();
113
+ const getColumnOrder = useRefValue(columnOrder);
114
+ // drag and drop
115
+ const onDragStart = useCallback((e) => {
116
+ draggedColumnRef.current = Number(e.dataTransfer.getData('text/plain'));
117
+ }, []);
118
+ const onDrop = useCallback((_, columnIndex) => {
119
+ if (draggedColumnRef.current !== null && columnIndex !== draggedColumnRef.current) {
120
+ const visibleColumns = getColumnOrder() || getVisibleFlatColumns().map(({ id }) => id);
121
+ const newColumns = [...visibleColumns];
122
+ newColumns[columnIndex] = visibleColumns[draggedColumnRef.current];
123
+ newColumns[draggedColumnRef.current] = visibleColumns[columnIndex];
124
+ setColumnOrder(newColumns);
125
+ }
126
+ }, [getColumnOrder, getVisibleFlatColumns, setColumnOrder]);
127
+ const columnsSelectionProps = useColumnsSelection({
128
+ rowsPerPage,
129
+ columnsPerRow: columns.length,
130
+ });
131
+ const { onEndSelection, getSelectedColumns, selectedColumnValuesRef } = columnsSelectionProps;
132
+ const onPaginationChangeDebounced = useMemo(() => (onPaginationChange ? debounce(onPaginationChange, 200) : undefined), [onPaginationChange]);
133
+ const onKeyUp = useCallback(() => {
134
+ const callback = getOncopy();
135
+ if (callback) {
136
+ const { columns, range } = getSelectedColumns();
137
+ if (columns.size || (range[0] !== undefined && range[0] !== undefined)) {
138
+ callback(selectedColumnValuesRef === null || selectedColumnValuesRef === void 0 ? void 0 : selectedColumnValuesRef.current);
139
+ }
140
+ }
141
+ }, [getOncopy, getSelectedColumns, selectedColumnValuesRef]);
142
+ useEffect(() => {
143
+ return () => {
144
+ document.body.removeEventListener('mouseup', onEndSelection);
145
+ document.body.removeEventListener('contextmenu', onEndSelection);
146
+ document.body.removeEventListener('keyup', onKeyUp);
147
+ };
148
+ }, [onKeyUp, onEndSelection]);
149
+ // Listen for changes in pagination and use the state to fetch new data. This is a recommended way to fetch new data: https://react-table.tanstack.com/docs/faq#how-can-i-use-the-table-state-to-fetch-new-data
150
+ useEffect(() => {
151
+ if (onPaginationChangeDebounced) {
152
+ onPaginationChangeDebounced({ pageIndex, pageSize });
153
+ }
154
+ }, [onPaginationChangeDebounced, pageIndex, pageSize]);
155
+ useEffect(() => {
156
+ if (onSortingChange) {
157
+ onSortingChange(sortBy);
158
+ }
159
+ }, [sortBy, onSortingChange]);
160
+ // Debounce our `fetchData` call for 200ms.
161
+ const onRenderedContentChangeDebounced = useMemo(() => (onRenderedContentChange ? debounce(onRenderedContentChange, 200) : undefined), [onRenderedContentChange]);
162
+ // Listen for changes in pagination and use the state to fetch new data. This is a recommended way to fetch new data: https://react-table.tanstack.com/docs/faq#how-can-i-use-the-table-state-to-fetch-new-data
163
+ useEffect(() => {
164
+ if (onRenderedContentChangeDebounced) {
165
+ onRenderedContentChangeDebounced(page.map(prepareRow));
166
+ }
167
+ }, [onRenderedContentChangeDebounced, page]);
168
+ // Apply global filter when searchValue changes
169
+ useEffect(() => {
170
+ if (searchValue !== undefined) {
171
+ ;
172
+ setGlobalFilter(searchValue);
173
+ }
174
+ }, [searchValue, setGlobalFilter]);
175
+ useEffect(() => {
176
+ if (pageCount < pageIndex + 1) {
177
+ goToPage(pageCount - 1);
178
+ }
179
+ }, [pageIndex, pageCount, goToPage]);
180
+ useEffect(() => {
181
+ if (incomingPageIndex !== undefined && incomingPageIndex !== previousIncomingPageIndex) {
182
+ goToPage(incomingPageIndex);
183
+ }
184
+ }, [goToPage, incomingPageIndex, previousIncomingPageIndex]);
185
+ useEffect(() => {
186
+ if (onRowSelect) {
187
+ onRowSelect(Object.keys(selectedRowIds));
188
+ }
189
+ }, [onRowSelect, selectedRowIds]);
190
+ const hasData = data.length > 0;
191
+ // If at least one of the columns has footer then we display the footer row
192
+ const hasFooter = !loading && hasData && columns.some((col) => !!col.footer);
193
+ // Header row has always aria-rowindex = 1.
194
+ const headerIndex = 1;
195
+ // We're using this offset to display correct aria-rowindex when pagination is in action.
196
+ const cellIndexOffset = pageSize * pageIndex + headerIndex;
197
+ // Total row count.
198
+ const rowCount = data.length + headerIndex + (hasFooter ? 1 : 0);
199
+ const content = (React.createElement(React.Fragment, null,
200
+ React.createElement("div", { "data-test": dataTest !== null && dataTest !== void 0 ? dataTest : 'table-wrapper', className: className },
201
+ React.createElement("div", { className: cn(styles.container, {
202
+ [styles.spaceBottom]: !hidePagination,
203
+ }) },
204
+ React.createElement("div", { "data-test": "table", role: "table", "aria-rowcount": rowCount },
205
+ !hideHeader && (React.createElement("div", { "data-test": "table-header-row-group", role: "rowgroup", className: headerClassName }, tableInstance.getHeaderGroups().map((headerGroup) => (React.createElement(HeaderRow, { key: headerGroup.id, role: "row", ariaRowIndex: headerIndex, style: getRowStyle({ totalSize: tableInstance.getTotalSize() }) }, headerGroup.headers.map((header, i) => {
206
+ var _a, _b;
207
+ const canSort = header.column.getCanSort();
208
+ const isDraggable = columnsOrdering && header.id !== 'expander';
209
+ return (React.createElement(Header, { index: i, colSpan: 1, key: header.id, role: "columnheader", onDragStart: onDragStart, style: getCellStyle({ size: header.getSize(), minSize: header.column.columnDef.minSize || header.getSize() }), canSort: canSort, isSorted: !!header.column.getIsSorted(), isSortedDesc: (_a = sortBy[header.column.getSortIndex()]) === null || _a === void 0 ? void 0 : _a.desc, canResize: header.column.getCanResize(), onDrop: isDraggable ? onDrop : undefined, resizeHandler: header.getResizeHandler(), isResizing: header.column.getIsResizing(), align: (_b = header.column.columnDef.meta) === null || _b === void 0 ? void 0 : _b.align, onClick: canSort ? header.column.getToggleSortingHandler() : undefined },
210
+ React.createElement(EnhancedHeaderFooterRenderer, { type: "header", context: header.getContext() })));
211
+ })))))),
212
+ !overlayLoading && loading ? (React.createElement(Row, { role: "row" },
213
+ React.createElement(Cell, { role: "cell", align: "center", colSpan: columns.length, "data-test": "table-loader-cell" },
214
+ React.createElement(Loader, null)))) : hasData ? (React.createElement(HotKeys, { keyName: "ctrl+c, command+c", onKeyUp: onKeyUp },
215
+ React.createElement("div", { "data-test": "table-cell-row-group", className: styles.hotKeys },
216
+ React.createElement(TableContent, { page: page, onCopy: onCopy, getHref: getHref, totalSize: tableInstance.getTotalSize(), rootRef: setContextMenuAnchorEl, ...columnsSelectionProps, onRowClick: onRowClick, className: contentClassName, columnResizing: columnResizing, AnchorComponent: AnchorComponent, cellIndexOffset: cellIndexOffset, getCustomRowProps: getCustomRowProps, getCustomCellProps: getCustomCellProps, renderRowSubComponent: renderRowSubComponent })))) : (React.createElement("div", { role: "row" },
217
+ React.createElement("div", { role: "cell" },
218
+ React.createElement(EmptyState, { "data-test": "table-no-data", className: styles.empty, title: noDataTitle, icon: AlertTriangle, iconLabel: "Alert" })))),
219
+ hasFooter && (React.createElement("div", { "data-test": "table-footer-row-group", role: "rowgroup", className: footerClassName }, footerGroups.map((group) => {
220
+ const { id: footerGroupKey } = group;
221
+ return (
222
+ // Footer props getters do not provide role attributes
223
+ React.createElement(Row, { key: footerGroupKey, ariaRowIndex: rowCount, style: getRowStyle({ totalSize: tableInstance.getTotalSize() }), role: "row" }, group.headers.map((column) => {
224
+ var _a;
225
+ const { id: footerKey, column: { columnDef }, } = column;
226
+ return (
227
+ // Footer props getters do not provide role attributes
228
+ React.createElement(Cell, { key: footerKey, colSpan: 1, align: (_a = columnDef.meta) === null || _a === void 0 ? void 0 : _a.align, style: getCellStyle({ size: column.getSize(), maxSize: columnDef.maxSize, minSize: columnDef.minSize }), role: "cell" },
229
+ React.createElement(EnhancedHeaderFooterRenderer, { context: column.getContext(), type: "footer" })));
230
+ })));
231
+ }))))),
232
+ !hidePagination && hasData && (React.createElement(Pagination, { pageCount: pageCount, currentPage: pageIndex + 1, canPreviousPage: getCanPreviousPage(), canNextPage: getCanNextPage(), goToPage: (p) => {
233
+ if (onPageChange) {
234
+ onPageChange(p - 1);
235
+ }
236
+ else {
237
+ goToPage(p - 1);
238
+ }
239
+ }, nextPage: () => {
240
+ if (onPageChange) {
241
+ onPageChange(pageIndex + 1);
242
+ }
243
+ else {
244
+ nextPage();
245
+ }
246
+ }, previousPage: () => {
247
+ if (onPageChange) {
248
+ onPageChange(pageIndex - 1);
249
+ }
250
+ else {
251
+ previousPage();
252
+ }
253
+ }, pageSize: pageSize, setPageSize: setPageSize, numberOfItems: data.length, pageSizeOptions: (_a = paginationOptions === null || paginationOptions === void 0 ? void 0 : paginationOptions.pageSizeOptions) !== null && _a !== void 0 ? _a : [5, 10, 20] }))),
254
+ onCopy && React.createElement(ContextMenu, { anchorElement: contextMenuAnchorEl, onCopy: onKeyUp })));
255
+ if (children) {
256
+ return children(content);
286
257
  }
287
- }, [onRowSelect, selectedRowIds]);
288
- const hasData = data.length > 0;
289
- // If at least one of the columns has footer then we display the footer row
290
- const hasFooter = !loading && hasData && columns.some(col => !!col.footer);
291
- // Header row has always aria-rowindex = 1.
292
- const headerIndex = 1;
293
- // We're using this offset to display correct aria-rowindex when pagination is in action.
294
- const cellIndexOffset = pageSize * pageIndex + headerIndex;
295
- // Total row count.
296
- const rowCount = data.length + headerIndex + (hasFooter ? 1 : 0);
297
- const content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
298
- "data-test": dataTest !== null && dataTest !== void 0 ? dataTest : 'table-wrapper',
299
- className: className
300
- }, /*#__PURE__*/React.createElement("div", {
301
- className: cn(Table_module.default.container, {
302
- [Table_module.default.spaceBottom]: !hidePagination
303
- })
304
- }, /*#__PURE__*/React.createElement("div", {
305
- "data-test": "table",
306
- role: "table",
307
- "aria-rowcount": rowCount
308
- }, !hideHeader && (/*#__PURE__*/React.createElement("div", {
309
- "data-test": "table-header-row-group",
310
- role: "rowgroup",
311
- className: headerClassName
312
- }, tableInstance.getHeaderGroups().map(headerGroup => (/*#__PURE__*/React.createElement(components_Table_Row.HeaderRow, {
313
- key: headerGroup.id,
314
- role: "row",
315
- ariaRowIndex: headerIndex,
316
- style: components_Table_utils.getRowStyle({
317
- totalSize: tableInstance.getTotalSize()
318
- })
319
- }, headerGroup.headers.map((header, i) => {
320
- var _a, _b;
321
- const canSort = header.column.getCanSort();
322
- const isDraggable = columnsOrdering && header.id !== 'expander';
323
- return /*#__PURE__*/React.createElement(components_Table_Header.Header, {
324
- index: i,
325
- colSpan: 1,
326
- key: header.id,
327
- role: "columnheader",
328
- onDragStart: onDragStart,
329
- style: components_Table_utils.getCellStyle({
330
- size: header.getSize(),
331
- minSize: header.column.columnDef.minSize || header.getSize()
332
- }),
333
- canSort: canSort,
334
- isSorted: !!header.column.getIsSorted(),
335
- isSortedDesc: (_a = sortBy[header.column.getSortIndex()]) === null || _a === void 0 ? void 0 : _a.desc,
336
- canResize: header.column.getCanResize(),
337
- onDrop: isDraggable ? onDrop : undefined,
338
- resizeHandler: header.getResizeHandler(),
339
- isResizing: header.column.getIsResizing(),
340
- align: (_b = header.column.columnDef.meta) === null || _b === void 0 ? void 0 : _b.align,
341
- onClick: canSort ? header.column.getToggleSortingHandler() : undefined
342
- }, /*#__PURE__*/React.createElement(components_Table_EnhancedRenderers.EnhancedHeaderFooterRenderer, {
343
- type: "header",
344
- context: header.getContext()
345
- }));
346
- })))))), !overlayLoading && loading ? (/*#__PURE__*/React.createElement(components_Table_Row.Row, {
347
- role: "row"
348
- }, /*#__PURE__*/React.createElement(components_Table_Cell.Cell, {
349
- role: "cell",
350
- align: "center",
351
- colSpan: columns.length,
352
- "data-test": "table-loader-cell"
353
- }, /*#__PURE__*/React.createElement(components_Loader.Loader, null)))) : hasData ? (/*#__PURE__*/React.createElement(HotKeys, {
354
- keyName: "ctrl+c, command+c",
355
- onKeyUp: onKeyUp
356
- }, /*#__PURE__*/React.createElement("div", {
357
- "data-test": "table-cell-row-group",
358
- className: Table_module.default.hotKeys
359
- }, /*#__PURE__*/React.createElement(components_Table_TableContent.TableContent, {
360
- page: page,
361
- onCopy: onCopy,
362
- getHref: getHref,
363
- totalSize: tableInstance.getTotalSize(),
364
- rootRef: setContextMenuAnchorEl,
365
- ...columnsSelectionProps,
366
- onRowClick: onRowClick,
367
- className: contentClassName,
368
- columnResizing: columnResizing,
369
- AnchorComponent: AnchorComponent,
370
- cellIndexOffset: cellIndexOffset,
371
- getCustomRowProps: getCustomRowProps,
372
- getCustomCellProps: getCustomCellProps,
373
- renderRowSubComponent: renderRowSubComponent
374
- })))) : (/*#__PURE__*/React.createElement("div", {
375
- role: "row"
376
- }, /*#__PURE__*/React.createElement("div", {
377
- role: "cell"
378
- }, /*#__PURE__*/React.createElement(components_EmptyState.EmptyState, {
379
- "data-test": "table-no-data",
380
- className: Table_module.default.empty,
381
- title: noDataTitle,
382
- icon: reactFeather.AlertTriangle,
383
- iconLabel: "Alert"
384
- })))), hasFooter && (/*#__PURE__*/React.createElement("div", {
385
- "data-test": "table-footer-row-group",
386
- role: "rowgroup",
387
- className: footerClassName
388
- }, footerGroups.map(group => {
389
- const {
390
- id: footerGroupKey
391
- } = group;
392
- return (
393
- /*#__PURE__*/
394
- // Footer props getters do not provide role attributes
395
- React.createElement(components_Table_Row.Row, {
396
- key: footerGroupKey,
397
- ariaRowIndex: rowCount,
398
- style: components_Table_utils.getRowStyle({
399
- totalSize: tableInstance.getTotalSize()
400
- }),
401
- role: "row"
402
- }, group.headers.map(column => {
403
- var _a;
404
- const {
405
- id: footerKey,
406
- column: {
407
- columnDef
408
- }
409
- } = column;
410
- return (
411
- /*#__PURE__*/
412
- // Footer props getters do not provide role attributes
413
- React.createElement(components_Table_Cell.Cell, {
414
- key: footerKey,
415
- colSpan: 1,
416
- align: (_a = columnDef.meta) === null || _a === void 0 ? void 0 : _a.align,
417
- style: components_Table_utils.getCellStyle({
418
- size: column.getSize(),
419
- maxSize: columnDef.maxSize,
420
- minSize: columnDef.minSize
421
- }),
422
- role: "cell"
423
- }, /*#__PURE__*/React.createElement(components_Table_EnhancedRenderers.EnhancedHeaderFooterRenderer, {
424
- context: column.getContext(),
425
- type: "footer"
426
- }))
427
- );
428
- }))
429
- );
430
- }))))), !hidePagination && hasData && (/*#__PURE__*/React.createElement(components_Pagination.Pagination, {
431
- pageCount: pageCount,
432
- currentPage: pageIndex + 1,
433
- canPreviousPage: getCanPreviousPage(),
434
- canNextPage: getCanNextPage(),
435
- goToPage: p => {
436
- if (onPageChange) {
437
- onPageChange(p - 1);
438
- } else {
439
- goToPage(p - 1);
440
- }
441
- },
442
- nextPage: () => {
443
- if (onPageChange) {
444
- onPageChange(pageIndex + 1);
445
- } else {
446
- nextPage();
447
- }
448
- },
449
- previousPage: () => {
450
- if (onPageChange) {
451
- onPageChange(pageIndex - 1);
452
- } else {
453
- previousPage();
454
- }
455
- },
456
- pageSize: pageSize,
457
- setPageSize: setPageSize,
458
- numberOfItems: data.length,
459
- pageSizeOptions: (_a = paginationOptions === null || paginationOptions === void 0 ? void 0 : paginationOptions.pageSizeOptions) !== null && _a !== void 0 ? _a : [5, 10, 20]
460
- }))), onCopy && /*#__PURE__*/React.createElement(components_Table_features_columnsSelection_ContextMenu_ContextMenu.ContextMenu, {
461
- anchorElement: contextMenuAnchorEl,
462
- onCopy: onKeyUp
463
- }));
464
- if (children) {
465
- return children(content);
466
- }
467
- return content;
258
+ return content;
468
259
  };
469
-
470
- exports.Table = Table;
471
- //# sourceMappingURL=Table.js.map
260
+ //# sourceMappingURL=Table.js.map