@hitachivantara/uikit-react-core 6.8.2 → 6.9.0

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 (441) hide show
  1. package/dist/Accordion/Accordion.js +69 -80
  2. package/dist/Accordion/Accordion.styles.js +21 -16
  3. package/dist/ActionBar/ActionBar.js +18 -17
  4. package/dist/ActionBar/ActionBar.styles.js +12 -15
  5. package/dist/ActionsGeneric/ActionsGeneric.js +72 -98
  6. package/dist/ActionsGeneric/ActionsGeneric.styles.js +17 -14
  7. package/dist/AppSwitcher/Action/Action.js +96 -111
  8. package/dist/AppSwitcher/Action/Action.styles.js +44 -48
  9. package/dist/AppSwitcher/AppSwitcher.js +70 -98
  10. package/dist/AppSwitcher/AppSwitcher.styles.js +50 -53
  11. package/dist/Avatar/Avatar.js +66 -111
  12. package/dist/Avatar/Avatar.styles.js +62 -52
  13. package/dist/AvatarGroup/AvatarGroup.js +49 -78
  14. package/dist/AvatarGroup/AvatarGroup.styles.js +40 -60
  15. package/dist/AvatarGroup/AvatarGroupContext.js +13 -16
  16. package/dist/Badge/Badge.js +40 -49
  17. package/dist/Badge/Badge.styles.js +50 -50
  18. package/dist/Banner/Banner.js +51 -83
  19. package/dist/Banner/Banner.styles.js +13 -22
  20. package/dist/Banner/BannerContent/BannerContent.js +35 -56
  21. package/dist/Banner/BannerContent/BannerContent.styles.js +31 -36
  22. package/dist/BaseCheckBox/BaseCheckBox.js +71 -88
  23. package/dist/BaseCheckBox/BaseCheckBox.styles.js +24 -31
  24. package/dist/BaseCheckBox/CheckBoxIcon.js +57 -73
  25. package/dist/BaseDropdown/BaseDropdown.js +147 -189
  26. package/dist/BaseDropdown/BaseDropdown.styles.js +72 -84
  27. package/dist/BaseDropdown/BaseDropdownPanel.js +69 -86
  28. package/dist/BaseDropdown/utils.js +77 -76
  29. package/dist/BaseInput/BaseInput.js +53 -89
  30. package/dist/BaseInput/BaseInput.styles.js +85 -105
  31. package/dist/BaseInput/validations.js +72 -69
  32. package/dist/BaseRadio/BaseRadio.js +61 -85
  33. package/dist/BaseRadio/BaseRadio.styles.js +26 -31
  34. package/dist/BaseRadio/RadioIcon.js +43 -48
  35. package/dist/BaseSwitch/BaseSwitch.js +70 -108
  36. package/dist/BaseSwitch/BaseSwitch.styles.js +94 -113
  37. package/dist/BreadCrumb/BreadCrumb.js +84 -106
  38. package/dist/BreadCrumb/BreadCrumb.styles.js +20 -17
  39. package/dist/BreadCrumb/Page/Page.js +24 -34
  40. package/dist/BreadCrumb/Page/Page.styles.js +20 -25
  41. package/dist/BreadCrumb/PathElement/PathElement.js +17 -17
  42. package/dist/BreadCrumb/PathElement/PathElement.styles.js +9 -7
  43. package/dist/BreadCrumb/utils.js +19 -27
  44. package/dist/BulkActions/BulkActions.js +57 -96
  45. package/dist/BulkActions/BulkActions.styles.js +37 -45
  46. package/dist/Button/Button.js +67 -95
  47. package/dist/Button/Button.styles.js +107 -124
  48. package/dist/ButtonBase/ButtonBase.js +32 -51
  49. package/dist/ButtonBase/ButtonBase.styles.js +21 -30
  50. package/dist/Calendar/Calendar.js +73 -101
  51. package/dist/Calendar/Calendar.styles.js +14 -32
  52. package/dist/Calendar/CalendarHeader/CalendarHeader.js +91 -118
  53. package/dist/Calendar/CalendarHeader/CalendarHeader.styles.js +11 -16
  54. package/dist/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js +36 -50
  55. package/dist/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js +12 -18
  56. package/dist/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js +23 -43
  57. package/dist/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.js +21 -24
  58. package/dist/Calendar/CalendarNavigation/Navigation/Navigation.js +43 -59
  59. package/dist/Calendar/CalendarNavigation/Navigation/Navigation.styles.js +21 -24
  60. package/dist/Calendar/SingleCalendar/CalendarCell.js +60 -84
  61. package/dist/Calendar/SingleCalendar/CalendarCell.styles.js +39 -56
  62. package/dist/Calendar/SingleCalendar/SingleCalendar.js +121 -154
  63. package/dist/Calendar/SingleCalendar/SingleCalendar.styles.js +53 -68
  64. package/dist/Calendar/model.js +45 -62
  65. package/dist/Calendar/utils.js +233 -128
  66. package/dist/Card/Card.js +35 -53
  67. package/dist/Card/Card.styles.js +37 -50
  68. package/dist/Card/Content/Content.js +15 -27
  69. package/dist/Card/Content/Content.styles.js +5 -10
  70. package/dist/Card/Header/Header.js +22 -35
  71. package/dist/Card/Header/Header.styles.js +22 -25
  72. package/dist/Card/Media/Media.js +16 -26
  73. package/dist/Card/Media/Media.styles.js +6 -7
  74. package/dist/Carousel/Carousel.js +179 -207
  75. package/dist/Carousel/Carousel.styles.js +141 -166
  76. package/dist/Carousel/CarouselControls.js +48 -62
  77. package/dist/Carousel/CarouselSlide/CarouselSlide.js +19 -25
  78. package/dist/Carousel/CarouselSlide/CarouselSlide.styles.js +10 -11
  79. package/dist/Carousel/CarouselThumbnails.js +29 -36
  80. package/dist/CheckBox/CheckBox.js +112 -182
  81. package/dist/CheckBox/CheckBox.styles.js +48 -57
  82. package/dist/CheckBoxGroup/CheckBoxGroup.js +154 -245
  83. package/dist/CheckBoxGroup/CheckBoxGroup.styles.js +29 -35
  84. package/dist/ColorPicker/ColorPicker.js +146 -222
  85. package/dist/ColorPicker/ColorPicker.styles.js +40 -45
  86. package/dist/ColorPicker/Picker/Fields.js +125 -141
  87. package/dist/ColorPicker/Picker/Picker.js +51 -50
  88. package/dist/ColorPicker/Picker/Picker.styles.js +42 -42
  89. package/dist/ColorPicker/PresetColors/PresetColors.js +25 -28
  90. package/dist/ColorPicker/PresetColors/PresetColors.styles.js +17 -17
  91. package/dist/ColorPicker/SavedColors/SavedColors.js +37 -41
  92. package/dist/ColorPicker/SavedColors/SavedColors.styles.js +27 -29
  93. package/dist/ColorPicker/Swatch.js +22 -37
  94. package/dist/Container/Container.js +37 -58
  95. package/dist/Container/Container.styles.js +12 -13
  96. package/dist/Controls/Controls.js +50 -74
  97. package/dist/Controls/Controls.styles.js +16 -13
  98. package/dist/Controls/LeftControl/LeftControl.js +25 -38
  99. package/dist/Controls/LeftControl/LeftControl.styles.js +7 -7
  100. package/dist/Controls/RightControl/RightControl.js +31 -46
  101. package/dist/Controls/RightControl/RightControl.styles.js +9 -7
  102. package/dist/Controls/context/ControlsContext.js +5 -6
  103. package/dist/DatePicker/DatePicker.js +286 -339
  104. package/dist/DatePicker/DatePicker.styles.js +25 -40
  105. package/dist/DatePicker/useVisibleDate.js +142 -126
  106. package/dist/DatePicker/utils.js +17 -26
  107. package/dist/Dialog/Actions/Actions.js +19 -29
  108. package/dist/Dialog/Actions/Actions.styles.js +20 -20
  109. package/dist/Dialog/Content/Content.js +29 -46
  110. package/dist/Dialog/Content/Content.styles.js +14 -15
  111. package/dist/Dialog/Dialog.js +49 -69
  112. package/dist/Dialog/Dialog.styles.js +33 -46
  113. package/dist/Dialog/Title/Title.js +20 -42
  114. package/dist/Dialog/Title/Title.styles.js +14 -16
  115. package/dist/Dialog/context.js +5 -6
  116. package/dist/DotPagination/DotPagination.js +44 -59
  117. package/dist/DotPagination/DotPagination.styles.js +44 -47
  118. package/dist/Drawer/Drawer.js +37 -64
  119. package/dist/Drawer/Drawer.styles.js +18 -21
  120. package/dist/DropDownMenu/DropDownMenu.js +88 -124
  121. package/dist/DropDownMenu/DropDownMenu.styles.js +12 -21
  122. package/dist/Dropdown/Dropdown.js +221 -310
  123. package/dist/Dropdown/Dropdown.styles.js +39 -48
  124. package/dist/Dropdown/List/List.js +194 -176
  125. package/dist/Dropdown/List/List.styles.js +23 -24
  126. package/dist/Dropdown/utils.js +15 -16
  127. package/dist/DropdownButton/DropdownButton.js +42 -46
  128. package/dist/DropdownButton/DropdownButton.styles.js +37 -47
  129. package/dist/EmptyState/EmptyState.js +48 -61
  130. package/dist/EmptyState/EmptyState.styles.js +31 -31
  131. package/dist/FileUploader/DropZone/DropZone.js +141 -179
  132. package/dist/FileUploader/DropZone/DropZone.styles.js +55 -68
  133. package/dist/FileUploader/File/File.js +85 -75
  134. package/dist/FileUploader/File/File.styles.js +55 -60
  135. package/dist/FileUploader/FileList/FileList.js +19 -28
  136. package/dist/FileUploader/FileList/FileList.styles.js +15 -16
  137. package/dist/FileUploader/FileUploader.js +35 -55
  138. package/dist/FileUploader/FileUploader.styles.js +4 -7
  139. package/dist/FileUploader/Preview/Preview.js +37 -52
  140. package/dist/FileUploader/Preview/Preview.styles.js +22 -28
  141. package/dist/FileUploader/utils.js +24 -11
  142. package/dist/FilterGroup/Counter/Counter.js +31 -43
  143. package/dist/FilterGroup/Counter/Counter.styles.js +12 -15
  144. package/dist/FilterGroup/FilterContent/FilterContent.js +138 -177
  145. package/dist/FilterGroup/FilterContent/FilterContent.styles.js +46 -53
  146. package/dist/FilterGroup/FilterContent/HeaderButton.js +77 -100
  147. package/dist/FilterGroup/FilterGroup.js +87 -136
  148. package/dist/FilterGroup/FilterGroup.styles.js +9 -10
  149. package/dist/FilterGroup/FilterGroupContext.js +68 -73
  150. package/dist/FilterGroup/LeftPanel/LeftPanel.js +28 -31
  151. package/dist/FilterGroup/LeftPanel/LeftPanel.styles.js +6 -11
  152. package/dist/FilterGroup/RightPanel/RightPanel.js +118 -151
  153. package/dist/FilterGroup/RightPanel/RightPanel.styles.js +17 -27
  154. package/dist/Focus/Focus.js +248 -344
  155. package/dist/Focus/Focus.styles.js +28 -39
  156. package/dist/Focus/utils.js +14 -20
  157. package/dist/Footer/Footer.js +36 -38
  158. package/dist/Footer/Footer.styles.js +40 -43
  159. package/dist/FormElement/Adornment/Adornment.js +38 -49
  160. package/dist/FormElement/Adornment/Adornment.styles.js +14 -15
  161. package/dist/FormElement/CharCounter/CharCounter.js +51 -73
  162. package/dist/FormElement/CharCounter/CharCounter.styles.js +12 -10
  163. package/dist/FormElement/FormElement.js +53 -31
  164. package/dist/FormElement/FormElement.styles.js +4 -7
  165. package/dist/FormElement/InfoMessage/InfoMessage.js +26 -41
  166. package/dist/FormElement/InfoMessage/InfoMessage.styles.js +11 -9
  167. package/dist/FormElement/Label/Label.js +33 -56
  168. package/dist/FormElement/Label/Label.styles.js +11 -9
  169. package/dist/FormElement/LabelContainer.js +46 -55
  170. package/dist/FormElement/Suggestions/Suggestions.js +46 -71
  171. package/dist/FormElement/Suggestions/Suggestions.styles.js +9 -16
  172. package/dist/FormElement/WarningText/WarningText.js +41 -62
  173. package/dist/FormElement/WarningText/WarningText.styles.js +25 -28
  174. package/dist/FormElement/context.js +6 -10
  175. package/dist/FormElement/utils.js +54 -58
  176. package/dist/GlobalActions/GlobalActions.js +53 -59
  177. package/dist/GlobalActions/GlobalActions.styles.js +67 -76
  178. package/dist/Grid/Grid.js +82 -112
  179. package/dist/Grid/Grid.styles.js +37 -38
  180. package/dist/Header/Actions/Actions.js +15 -17
  181. package/dist/Header/Actions/Actions.styles.js +12 -15
  182. package/dist/Header/Brand/Brand.js +27 -23
  183. package/dist/Header/Brand/Brand.styles.js +16 -14
  184. package/dist/Header/Header.js +22 -31
  185. package/dist/Header/Header.styles.js +32 -30
  186. package/dist/Header/Navigation/MenuBar/Bar.js +23 -36
  187. package/dist/Header/Navigation/MenuBar/Bar.styles.js +54 -61
  188. package/dist/Header/Navigation/MenuBar/MenuBar.js +20 -26
  189. package/dist/Header/Navigation/MenuItem/MenuItem.js +104 -120
  190. package/dist/Header/Navigation/MenuItem/MenuItem.styles.js +48 -63
  191. package/dist/Header/Navigation/Navigation.js +32 -37
  192. package/dist/Header/Navigation/Navigation.styles.js +11 -17
  193. package/dist/Header/Navigation/useSelectionPath.js +17 -20
  194. package/dist/Header/Navigation/utils/FocusContext.js +23 -20
  195. package/dist/Header/Navigation/utils/SelectionContext.js +4 -4
  196. package/dist/IconButton/IconButton.js +25 -32
  197. package/dist/IconContainer/IconContainer.js +55 -76
  198. package/dist/InlineEditor/InlineEditor.js +105 -131
  199. package/dist/InlineEditor/InlineEditor.styles.js +44 -53
  200. package/dist/Input/Input.js +385 -461
  201. package/dist/Input/Input.styles.js +34 -47
  202. package/dist/Input/icons.js +16 -21
  203. package/dist/Input/utils.js +8 -11
  204. package/dist/List/List.js +196 -247
  205. package/dist/List/List.styles.js +44 -49
  206. package/dist/List/useSelectableList.js +11 -8
  207. package/dist/List/utils.js +24 -33
  208. package/dist/ListContainer/ListContainer.js +52 -65
  209. package/dist/ListContainer/ListContainer.styles.js +7 -10
  210. package/dist/ListContainer/ListContext/ListContext.js +4 -4
  211. package/dist/ListContainer/ListItem/ListItem.js +79 -117
  212. package/dist/ListContainer/ListItem/ListItem.styles.js +57 -78
  213. package/dist/Loading/Loading.js +31 -46
  214. package/dist/Loading/Loading.styles.js +41 -48
  215. package/dist/LoadingContainer/LoadingContainer.js +34 -40
  216. package/dist/LoadingContainer/LoadingContainer.styles.js +17 -18
  217. package/dist/Login/Login.js +22 -29
  218. package/dist/Login/Login.styles.js +20 -21
  219. package/dist/MultiButton/MultiButton.js +41 -59
  220. package/dist/MultiButton/MultiButton.styles.js +117 -137
  221. package/dist/NumberInput/NumberInput.js +51 -50
  222. package/dist/NumberInput/NumberInput.styles.js +5 -10
  223. package/dist/OverflowTooltip/OverflowTooltip.js +55 -75
  224. package/dist/OverflowTooltip/OverflowTooltip.styles.js +19 -23
  225. package/dist/Pagination/Pagination.js +176 -164
  226. package/dist/Pagination/Pagination.styles.js +86 -90
  227. package/dist/Pagination/Select.js +51 -60
  228. package/dist/Pagination/Select.styles.js +13 -19
  229. package/dist/Panel/Panel.js +19 -20
  230. package/dist/Panel/Panel.styles.js +12 -15
  231. package/dist/ProgressBar/ProgressBar.js +40 -53
  232. package/dist/ProgressBar/ProgressBar.styles.js +28 -40
  233. package/dist/QueryBuilder/ConfirmationDialog.js +35 -28
  234. package/dist/QueryBuilder/Context.js +308 -322
  235. package/dist/QueryBuilder/QueryBuilder.js +108 -137
  236. package/dist/QueryBuilder/QueryBuilder.styles.js +117 -108
  237. package/dist/QueryBuilder/Rule/Attribute.js +56 -63
  238. package/dist/QueryBuilder/Rule/Operator.js +53 -58
  239. package/dist/QueryBuilder/Rule/Rule.js +70 -88
  240. package/dist/QueryBuilder/Rule/Rule.styles.js +49 -56
  241. package/dist/QueryBuilder/RuleGroup.js +160 -206
  242. package/dist/QueryBuilder/Value/BooleanValue.js +38 -37
  243. package/dist/QueryBuilder/Value/DateTimeValue.js +233 -299
  244. package/dist/QueryBuilder/Value/EmptyValue.js +14 -14
  245. package/dist/QueryBuilder/Value/NumericValue.js +152 -204
  246. package/dist/QueryBuilder/Value/TextValue.js +38 -54
  247. package/dist/QueryBuilder/Value/Value.js +42 -67
  248. package/dist/QueryBuilder/types.js +4 -4
  249. package/dist/QueryBuilder/utils/index.js +40 -74
  250. package/dist/QueryBuilder/utils/reducer.js +86 -92
  251. package/dist/Radio/Radio.js +96 -145
  252. package/dist/Radio/Radio.styles.js +47 -55
  253. package/dist/RadioGroup/RadioGroup.js +98 -159
  254. package/dist/RadioGroup/RadioGroup.styles.js +28 -34
  255. package/dist/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.js +34 -51
  256. package/dist/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.js +39 -48
  257. package/dist/ScrollToHorizontal/ScrollToHorizontal.js +56 -91
  258. package/dist/ScrollToHorizontal/ScrollToHorizontal.styles.js +28 -32
  259. package/dist/ScrollToVertical/ScrollToVertical.js +45 -77
  260. package/dist/ScrollToVertical/ScrollToVertical.styles.js +31 -38
  261. package/dist/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.js +30 -39
  262. package/dist/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.styles.js +44 -51
  263. package/dist/SearchInput/SearchInput.js +27 -25
  264. package/dist/SearchInput/SearchInput.styles.js +6 -7
  265. package/dist/Section/Section.js +69 -104
  266. package/dist/Section/Section.styles.js +53 -57
  267. package/dist/Select/Option.js +29 -46
  268. package/dist/Select/OptionGroup.js +18 -30
  269. package/dist/Select/Select.js +163 -219
  270. package/dist/Select/Select.styles.js +26 -32
  271. package/dist/SelectionList/SelectionList.js +162 -216
  272. package/dist/SelectionList/SelectionList.styles.js +36 -36
  273. package/dist/SimpleGrid/SimpleGrid.js +16 -27
  274. package/dist/SimpleGrid/SimpleGrid.styles.js +28 -39
  275. package/dist/Skeleton/Skeleton.js +26 -44
  276. package/dist/Skeleton/Skeleton.styles.js +43 -66
  277. package/dist/Slider/Slider.js +316 -431
  278. package/dist/Slider/Slider.styles.js +183 -216
  279. package/dist/Slider/SliderInput/SliderInput.js +38 -57
  280. package/dist/Slider/SliderInput/SliderInput.styles.js +13 -14
  281. package/dist/Slider/base.js +221 -243
  282. package/dist/Slider/utils.js +247 -233
  283. package/dist/Snackbar/Snackbar.js +59 -88
  284. package/dist/Snackbar/Snackbar.styles.js +25 -42
  285. package/dist/Snackbar/SnackbarContent/SnackbarContent.js +31 -50
  286. package/dist/Snackbar/SnackbarContent/SnackbarContent.styles.js +27 -30
  287. package/dist/SnackbarProvider/SnackbarProvider.js +73 -105
  288. package/dist/SnackbarProvider/SnackbarProvider.styles.js +20 -26
  289. package/dist/Stack/Stack.js +74 -84
  290. package/dist/Stack/Stack.styles.js +14 -33
  291. package/dist/StatusIcon/StatusIcon.js +78 -102
  292. package/dist/StatusIcon/StatusIcon.styles.js +42 -52
  293. package/dist/Switch/Switch.js +91 -138
  294. package/dist/Switch/Switch.styles.js +49 -60
  295. package/dist/Table/Table.js +62 -66
  296. package/dist/Table/Table.styles.js +23 -28
  297. package/dist/Table/TableBody/TableBody.js +45 -56
  298. package/dist/Table/TableBody/TableBody.styles.js +8 -7
  299. package/dist/Table/TableCell/TableCell.js +37 -66
  300. package/dist/Table/TableCell/TableCell.styles.js +125 -162
  301. package/dist/Table/TableContainer/TableContainer.js +18 -28
  302. package/dist/Table/TableContainer/TableContainer.styles.js +8 -12
  303. package/dist/Table/TableContext.js +4 -4
  304. package/dist/Table/TableHead/TableHead.js +27 -39
  305. package/dist/Table/TableHead/TableHead.styles.js +10 -7
  306. package/dist/Table/TableHeader/TableHeader.js +73 -124
  307. package/dist/Table/TableHeader/TableHeader.styles.js +135 -150
  308. package/dist/Table/TableHeader/utils.js +11 -15
  309. package/dist/Table/TableRow/TableRow.js +32 -51
  310. package/dist/Table/TableRow/TableRow.styles.js +64 -84
  311. package/dist/Table/TableSection/TableSection.js +21 -20
  312. package/dist/Table/TableSection/TableSection.styles.js +63 -96
  313. package/dist/Table/TableSectionContext.js +4 -4
  314. package/dist/Table/hooks/useHvBulkActions.js +54 -89
  315. package/dist/Table/hooks/useHvFilters.js +4 -4
  316. package/dist/Table/hooks/useHvGlobalFilter.js +4 -4
  317. package/dist/Table/hooks/useHvHeaderGroups.js +73 -82
  318. package/dist/Table/hooks/useHvPagination.js +31 -51
  319. package/dist/Table/hooks/useHvResizeColumns.js +25 -31
  320. package/dist/Table/hooks/useHvRowExpand.js +54 -69
  321. package/dist/Table/hooks/useHvRowSelection.js +294 -420
  322. package/dist/Table/hooks/useHvRowState.js +4 -4
  323. package/dist/Table/hooks/useHvSortBy.js +23 -30
  324. package/dist/Table/hooks/useHvSticky.js +114 -154
  325. package/dist/Table/hooks/useHvTable.js +40 -64
  326. package/dist/Table/hooks/useHvTableStyles.js +51 -82
  327. package/dist/Table/renderers/DateColumnCell.js +12 -13
  328. package/dist/Table/renderers/DefaultCell.js +13 -20
  329. package/dist/Table/renderers/DropdownColumnCell.js +4 -4
  330. package/dist/Table/renderers/ProgressColumnCell.js +43 -47
  331. package/dist/Table/renderers/SwitchColumnCell.js +37 -50
  332. package/dist/Table/renderers/renderers.js +146 -183
  333. package/dist/Tabs/Tab/Tab.js +21 -31
  334. package/dist/Tabs/Tab/Tab.styles.js +44 -54
  335. package/dist/Tabs/Tabs.js +23 -28
  336. package/dist/Tabs/Tabs.styles.js +9 -14
  337. package/dist/Tag/Tag.js +86 -129
  338. package/dist/Tag/Tag.styles.js +63 -88
  339. package/dist/TagsInput/TagsInput.js +349 -417
  340. package/dist/TagsInput/TagsInput.styles.js +77 -90
  341. package/dist/TextArea/TextArea.js +207 -274
  342. package/dist/TextArea/TextArea.styles.js +25 -20
  343. package/dist/TimeAgo/TimeAgo.js +24 -30
  344. package/dist/TimeAgo/TimeAgo.styles.js +4 -7
  345. package/dist/TimeAgo/formatUtils.js +57 -65
  346. package/dist/TimeAgo/useTimeAgo.js +18 -18
  347. package/dist/TimeAgo/useTimeout.js +14 -14
  348. package/dist/TimePicker/Placeholder.js +46 -52
  349. package/dist/TimePicker/TimePicker.js +164 -214
  350. package/dist/TimePicker/TimePicker.styles.js +30 -39
  351. package/dist/TimePicker/Unit/Unit.js +63 -49
  352. package/dist/TimePicker/Unit/Unit.styles.js +41 -46
  353. package/dist/ToggleButton/ToggleButton.js +25 -34
  354. package/dist/Tooltip/Tooltip.js +41 -51
  355. package/dist/Tooltip/Tooltip.styles.js +25 -26
  356. package/dist/TreeView/TreeItem/DefaultContent.js +51 -72
  357. package/dist/TreeView/TreeItem/TreeItem.js +102 -140
  358. package/dist/TreeView/TreeItem/TreeItem.styles.js +56 -70
  359. package/dist/TreeView/TreeItem/useHvTreeItem.js +38 -53
  360. package/dist/TreeView/TreeView.js +65 -62
  361. package/dist/TreeView/TreeView.styles.js +11 -13
  362. package/dist/TreeView/internals/DescendantProvider.js +120 -120
  363. package/dist/TreeView/internals/TreeViewProvider.js +32 -26
  364. package/dist/TreeView/internals/corePlugins.js +8 -4
  365. package/dist/TreeView/internals/hooks/plugins/defaultPlugins.js +10 -10
  366. package/dist/TreeView/internals/hooks/plugins/useTreeViewContextValueBuilder.js +20 -22
  367. package/dist/TreeView/internals/hooks/plugins/useTreeViewExpansion.js +39 -61
  368. package/dist/TreeView/internals/hooks/plugins/useTreeViewFocus.js +56 -80
  369. package/dist/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.js +149 -211
  370. package/dist/TreeView/internals/hooks/plugins/useTreeViewNodes.js +42 -68
  371. package/dist/TreeView/internals/hooks/plugins/useTreeViewSelection.js +162 -195
  372. package/dist/TreeView/internals/hooks/useInstanceEventHandler.js +52 -74
  373. package/dist/TreeView/internals/hooks/useTreeView.js +54 -69
  374. package/dist/TreeView/internals/hooks/useTreeViewInstanceEvents.js +28 -33
  375. package/dist/TreeView/internals/hooks/useTreeViewModels.js +34 -43
  376. package/dist/TreeView/internals/hooks/utils.js +28 -42
  377. package/dist/TreeView/internals/utils/EventManager.js +49 -58
  378. package/dist/TreeView/internals/utils/FinalizationRegistryBasedCleanupTracking.js +14 -18
  379. package/dist/TreeView/internals/utils/TimerBasedCleanupTracking.js +33 -37
  380. package/dist/TreeView/internals/utils/publishTreeViewEvent.js +5 -5
  381. package/dist/Typography/Typography.js +34 -51
  382. package/dist/Typography/Typography.styles.js +20 -23
  383. package/dist/VerticalNavigation/Actions/Action.js +23 -42
  384. package/dist/VerticalNavigation/Actions/Action.styles.js +21 -28
  385. package/dist/VerticalNavigation/Actions/Actions.js +15 -31
  386. package/dist/VerticalNavigation/Actions/Actions.styles.js +13 -19
  387. package/dist/VerticalNavigation/Header/Header.js +51 -91
  388. package/dist/VerticalNavigation/Header/Header.styles.js +22 -32
  389. package/dist/VerticalNavigation/Navigation/Navigation.js +183 -267
  390. package/dist/VerticalNavigation/Navigation/Navigation.styles.js +14 -24
  391. package/dist/VerticalNavigation/NavigationPopup/NavigationPopup.styles.js +9 -17
  392. package/dist/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js +30 -32
  393. package/dist/VerticalNavigation/NavigationSlider/NavigationSlider.js +45 -63
  394. package/dist/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js +23 -33
  395. package/dist/VerticalNavigation/NavigationSlider/utils.js +56 -39
  396. package/dist/VerticalNavigation/TreeView/TreeView.js +515 -664
  397. package/dist/VerticalNavigation/TreeView/TreeView.styles.js +10 -16
  398. package/dist/VerticalNavigation/TreeView/TreeViewContext.js +5 -6
  399. package/dist/VerticalNavigation/TreeView/TreeViewItem.js +319 -414
  400. package/dist/VerticalNavigation/TreeView/TreeViewItem.styles.js +91 -143
  401. package/dist/VerticalNavigation/VerticalNavigation.js +70 -97
  402. package/dist/VerticalNavigation/VerticalNavigation.styles.js +31 -45
  403. package/dist/VerticalNavigation/VerticalNavigationContext.js +8 -10
  404. package/dist/hooks/useClickOutside.js +21 -23
  405. package/dist/hooks/useComputation.js +13 -13
  406. package/dist/hooks/useControlled.js +10 -17
  407. package/dist/hooks/useEnhancedEffect.js +5 -5
  408. package/dist/hooks/useExpandable.js +24 -31
  409. package/dist/hooks/useFocus.js +31 -34
  410. package/dist/hooks/useForkRef.js +19 -19
  411. package/dist/hooks/useImageLoaded.js +26 -26
  412. package/dist/hooks/useIsMounted.js +13 -13
  413. package/dist/hooks/useLabels.js +7 -7
  414. package/dist/hooks/useScrollTo.js +101 -130
  415. package/dist/hooks/useUniqueId.js +6 -6
  416. package/dist/hooks/useWidth.js +10 -13
  417. package/dist/icons.js +77 -88
  418. package/dist/index.d.ts +8 -8
  419. package/dist/index.js +226 -554
  420. package/dist/providers/Provider.js +44 -75
  421. package/dist/providers/ThemeProvider.js +79 -71
  422. package/dist/providers/utils.js +40 -47
  423. package/dist/themes/index.js +6 -5
  424. package/dist/themes/next.js +132 -271
  425. package/dist/themes/pentaho.js +832 -1173
  426. package/dist/types/generic.js +5 -4
  427. package/dist/utils/Callout.js +123 -171
  428. package/dist/utils/CounterLabel.js +14 -15
  429. package/dist/utils/deepMerge.js +13 -15
  430. package/dist/utils/document.js +8 -8
  431. package/dist/utils/focusUtils.js +6 -7
  432. package/dist/utils/focusableElementFinder.js +23 -26
  433. package/dist/utils/helpers.js +15 -23
  434. package/dist/utils/iconVariant.js +15 -12
  435. package/dist/utils/keyboardUtils.js +28 -28
  436. package/dist/utils/multiSelectionEventHandler.js +37 -52
  437. package/dist/utils/scroll.js +50 -76
  438. package/dist/utils/setId.js +4 -4
  439. package/dist/utils/theme.js +11 -8
  440. package/dist/utils/useSavedState.js +19 -16
  441. package/package.json +5 -5
@@ -1,6 +1,6 @@
1
1
  import { useRowState } from "react-table";
2
- const useHvRowState = useRowState.bind({});
2
+ //#region src/Table/hooks/useHvRowState.ts
3
+ var useHvRowState = useRowState.bind({});
3
4
  useHvRowState.pluginName = "useHvRowState";
4
- export {
5
- useHvRowState
6
- };
5
+ //#endregion
6
+ export { useHvRowState };
@@ -1,36 +1,29 @@
1
1
  import { ensurePluginOrder } from "react-table";
2
- const getHeaderPropsHook = (props, { instance, column }) => {
3
- const { isMultiSortEvent = (e) => e.shiftKey } = instance;
4
- const sortDirection = column.isSortedDesc ? "descending" : "ascending";
5
- const nextProps = {
6
- sortable: column.canSort,
7
- sorted: column.isSorted,
8
- sortDirection: column.isSorted ? sortDirection : void 0,
9
- onClick: column.canSort ? (e) => {
10
- e.persist();
11
- column.toggleSortBy(
12
- void 0,
13
- !instance.disableMultiSort && isMultiSortEvent(e)
14
- );
15
- } : void 0
16
- };
17
- return [props, nextProps];
2
+ //#region src/Table/hooks/useHvSortBy.ts
3
+ var getHeaderPropsHook = (props, { instance, column }) => {
4
+ const { isMultiSortEvent = (e) => e.shiftKey } = instance;
5
+ const sortDirection = column.isSortedDesc ? "descending" : "ascending";
6
+ return [props, {
7
+ sortable: column.canSort,
8
+ sorted: column.isSorted,
9
+ sortDirection: column.isSorted ? sortDirection : void 0,
10
+ onClick: column.canSort ? (e) => {
11
+ e.persist();
12
+ column.toggleSortBy(void 0, !instance.disableMultiSort && isMultiSortEvent(e));
13
+ } : void 0
14
+ }];
18
15
  };
19
- const getCellPropsHook = (props, { cell }) => {
20
- const nextProps = {
21
- sorted: cell.column.isSorted
22
- };
23
- return [props, nextProps];
16
+ var getCellPropsHook = (props, { cell }) => {
17
+ return [props, { sorted: cell.column.isSorted }];
24
18
  };
25
- const useInstanceHook = (instance) => {
26
- ensurePluginOrder(instance.plugins, ["useSortBy"], "useHvSortBy");
19
+ var useInstanceHook = (instance) => {
20
+ ensurePluginOrder(instance.plugins, ["useSortBy"], "useHvSortBy");
27
21
  };
28
- const useHvSortBy = (hooks) => {
29
- hooks.getHeaderProps.push(getHeaderPropsHook);
30
- hooks.getCellProps.push(getCellPropsHook);
31
- hooks.useInstance.push(useInstanceHook);
22
+ var useHvSortBy = (hooks) => {
23
+ hooks.getHeaderProps.push(getHeaderPropsHook);
24
+ hooks.getCellProps.push(getCellPropsHook);
25
+ hooks.useInstance.push(useInstanceHook);
32
26
  };
33
27
  useHvSortBy.pluginName = "useHvSortBy";
34
- export {
35
- useHvSortBy
36
- };
28
+ //#endregion
29
+ export { useHvSortBy };
@@ -1,169 +1,129 @@
1
- import { useGetLatest, makePropGetter } from "react-table";
2
1
  import { theme } from "@hitachivantara/uikit-styles";
3
- const isSticky = (value) => /left|right/i.test(value);
4
- const getStickyValue = ({ sticky, parent }) => {
5
- if (isSticky(sticky)) {
6
- return sticky;
7
- }
8
- if (parent != null) {
9
- sticky = getStickyValue(parent);
10
- if (isSticky(sticky)) {
11
- return sticky;
12
- }
13
- const { columns } = parent;
14
- if (columns?.length > 0) {
15
- sticky = columns?.find((col) => col.sticky != null)?.sticky;
16
- if (isSticky(sticky)) {
17
- return sticky;
18
- }
19
- }
20
- }
21
- return void 0;
2
+ import { makePropGetter, useGetLatest } from "react-table";
3
+ //#region src/Table/hooks/useHvSticky.ts
4
+ var isSticky = (value) => /left|right/i.test(value);
5
+ var getStickyValue = ({ sticky, parent }) => {
6
+ if (isSticky(sticky)) return sticky;
7
+ if (parent != null) {
8
+ sticky = getStickyValue(parent);
9
+ if (isSticky(sticky)) return sticky;
10
+ const { columns } = parent;
11
+ if (columns?.length > 0) {
12
+ sticky = columns?.find((col) => col.sticky != null)?.sticky;
13
+ if (isSticky(sticky)) return sticky;
14
+ }
15
+ }
22
16
  };
23
- const updateColumnAndParent = (column, props) => {
24
- Object.assign(column, props);
25
- if (column.parent != null) {
26
- updateColumnAndParent(column.parent, props);
27
- }
17
+ var updateColumnAndParent = (column, props) => {
18
+ Object.assign(column, props);
19
+ if (column.parent != null) updateColumnAndParent(column.parent, props);
28
20
  };
29
- const visibleColumnsHook = (columns, { instance }) => {
30
- const toTheLeft = [];
31
- const toTheRight = [];
32
- const others = [];
33
- columns.forEach((column) => {
34
- const sticky = getStickyValue(column)?.toLowerCase();
35
- updateColumnAndParent(column, { sticky });
36
- if (sticky === "left") {
37
- toTheLeft.push(column);
38
- } else if (sticky === "right") {
39
- toTheRight.push(column);
40
- } else {
41
- others.push(column);
42
- }
43
- });
44
- if (others.length > 0) {
45
- const [firstNotSticky] = others;
46
- updateColumnAndParent(firstNotSticky, { isFirstNotSticky: true });
47
- const lastNotSticky = others[others.length - 1];
48
- updateColumnAndParent(lastNotSticky, { isLastNotSticky: true });
49
- }
50
- const hasLeftSticky = toTheLeft.length > 0;
51
- if (hasLeftSticky) {
52
- const lastLeftSticky = toTheLeft[toTheLeft.length - 1];
53
- updateColumnAndParent(lastLeftSticky, { isLastLeftSticky: true });
54
- }
55
- const hasRightSticky = toTheRight.length > 0;
56
- if (hasRightSticky) {
57
- const [firstRightSticky] = toTheRight;
58
- updateColumnAndParent(firstRightSticky, { isFirstRightSticky: true });
59
- }
60
- instance.hasStickyColumns = hasLeftSticky || hasRightSticky;
61
- return [...toTheLeft, ...others, ...toTheRight];
21
+ var visibleColumnsHook = (columns, { instance }) => {
22
+ const toTheLeft = [];
23
+ const toTheRight = [];
24
+ const others = [];
25
+ columns.forEach((column) => {
26
+ const sticky = getStickyValue(column)?.toLowerCase();
27
+ updateColumnAndParent(column, { sticky });
28
+ if (sticky === "left") toTheLeft.push(column);
29
+ else if (sticky === "right") toTheRight.push(column);
30
+ else others.push(column);
31
+ });
32
+ if (others.length > 0) {
33
+ const [firstNotSticky] = others;
34
+ updateColumnAndParent(firstNotSticky, { isFirstNotSticky: true });
35
+ const lastNotSticky = others[others.length - 1];
36
+ updateColumnAndParent(lastNotSticky, { isLastNotSticky: true });
37
+ }
38
+ const hasLeftSticky = toTheLeft.length > 0;
39
+ if (hasLeftSticky) {
40
+ const lastLeftSticky = toTheLeft[toTheLeft.length - 1];
41
+ updateColumnAndParent(lastLeftSticky, { isLastLeftSticky: true });
42
+ }
43
+ const hasRightSticky = toTheRight.length > 0;
44
+ if (hasRightSticky) {
45
+ const [firstRightSticky] = toTheRight;
46
+ updateColumnAndParent(firstRightSticky, { isFirstRightSticky: true });
47
+ }
48
+ instance.hasStickyColumns = hasLeftSticky || hasRightSticky;
49
+ return [
50
+ ...toTheLeft,
51
+ ...others,
52
+ ...toTheRight
53
+ ];
62
54
  };
63
- const calculateHeaderWidthsToTheRight = (headers, right = 0) => {
64
- if (!headers?.length) {
65
- return;
66
- }
67
- for (let i = headers.length - 1; i !== -1; i -= 1) {
68
- const header = headers[i];
69
- header.totalRight = right;
70
- const { headers: subHeaders } = header;
71
- if (subHeaders?.length > 0) {
72
- calculateHeaderWidthsToTheRight(subHeaders, right);
73
- }
74
- if (header.isVisible) {
75
- right += header.totalWidth;
76
- }
77
- }
55
+ var calculateHeaderWidthsToTheRight = (headers, right = 0) => {
56
+ if (!headers?.length) return;
57
+ for (let i = headers.length - 1; i !== -1; i -= 1) {
58
+ const header = headers[i];
59
+ header.totalRight = right;
60
+ const { headers: subHeaders } = header;
61
+ if (subHeaders?.length > 0) calculateHeaderWidthsToTheRight(subHeaders, right);
62
+ if (header.isVisible) right += header.totalWidth;
63
+ }
78
64
  };
79
- const useInstanceHook = (instance) => {
80
- calculateHeaderWidthsToTheRight(instance.headers);
81
- const getInstance = useGetLatest(instance);
82
- instance.getTableHeadProps = makePropGetter(
83
- instance.getHooks().getTableHeadProps,
84
- {
85
- instance: getInstance()
86
- }
87
- );
65
+ var useInstanceHook = (instance) => {
66
+ calculateHeaderWidthsToTheRight(instance.headers);
67
+ const getInstance = useGetLatest(instance);
68
+ instance.getTableHeadProps = makePropGetter(instance.getHooks().getTableHeadProps, { instance: getInstance() });
88
69
  };
89
- const getRowProps = () => ({
90
- style: {
91
- display: "flex",
92
- flex: "1 0 auto"
93
- }
94
- });
95
- const getCellProps = (header, isHeaderCell) => {
96
- const props = {
97
- style: {
98
- display: "inline-flex",
99
- flex: `${header.totalWidth} ${header.totalMinWidth} auto`,
100
- alignItems: isHeaderCell ? "start" : "center",
101
- justifyContent: header.align,
102
- width: `${header.totalWidth}px`,
103
- minWidth: `${header.totalMinWidth}px`,
104
- ...isHeaderCell && { backgroundColor: theme.colors.bgPage }
105
- }
106
- };
107
- if (header.sticky != null) {
108
- props.stickyColumn = true;
109
- const margin = header.sticky === "left" ? header.totalLeft : header.totalRight;
110
- props.style[header.sticky] = `${margin}px`;
111
- if (header.isLastLeftSticky) {
112
- props.stickyColumnMostLeft = true;
113
- }
114
- if (header.isFirstRightSticky) {
115
- props.stickyColumnLeastRight = true;
116
- }
117
- } else {
118
- if (header.isFirstNotSticky) {
119
- props.style.borderLeft = 0;
120
- }
121
- if (header.isLastNotSticky) {
122
- props.style.borderRight = 0;
123
- }
124
- }
125
- return props;
70
+ var getRowProps = () => ({ style: {
71
+ display: "flex",
72
+ flex: "1 0 auto"
73
+ } });
74
+ var getCellProps = (header, isHeaderCell) => {
75
+ const props = { style: {
76
+ display: "inline-flex",
77
+ flex: `${header.totalWidth} ${header.totalMinWidth} auto`,
78
+ alignItems: isHeaderCell ? "start" : "center",
79
+ justifyContent: header.align,
80
+ width: `${header.totalWidth}px`,
81
+ minWidth: `${header.totalMinWidth}px`,
82
+ ...isHeaderCell && { backgroundColor: theme.colors.bgPage }
83
+ } };
84
+ if (header.sticky != null) {
85
+ props.stickyColumn = true;
86
+ const margin = header.sticky === "left" ? header.totalLeft : header.totalRight;
87
+ props.style[header.sticky] = `${margin}px`;
88
+ if (header.isLastLeftSticky) props.stickyColumnMostLeft = true;
89
+ if (header.isFirstRightSticky) props.stickyColumnLeastRight = true;
90
+ } else {
91
+ if (header.isFirstNotSticky) props.style.borderLeft = 0;
92
+ if (header.isLastNotSticky) props.style.borderRight = 0;
93
+ }
94
+ return props;
126
95
  };
127
- const getTablePropsHook = (props, { instance }) => {
128
- const nextProps = {
129
- stickyHeader: instance.stickyHeader,
130
- stickyColumns: instance.hasStickyColumns
131
- };
132
- return [props, nextProps];
96
+ var getTablePropsHook = (props, { instance }) => {
97
+ return [props, {
98
+ stickyHeader: instance.stickyHeader,
99
+ stickyColumns: instance.hasStickyColumns
100
+ }];
133
101
  };
134
- const getTableHeadPropsHook = (props, { instance }) => {
135
- const nextProps = {
136
- stickyHeader: instance.stickyHeader
137
- };
138
- return [props, nextProps];
102
+ var getTableHeadPropsHook = (props, { instance }) => {
103
+ return [props, { stickyHeader: instance.stickyHeader }];
139
104
  };
140
- const getHeaderGroupPropsHook = (props, { instance }) => {
141
- const nextProps = instance.hasStickyColumns ? getRowProps() : {};
142
- return [props, nextProps];
105
+ var getHeaderGroupPropsHook = (props, { instance }) => {
106
+ return [props, instance.hasStickyColumns ? getRowProps() : {}];
143
107
  };
144
- const getHeaderPropsHook = (props, { instance, column }) => {
145
- const nextProps = instance.hasStickyColumns ? getCellProps(column, true) : {};
146
- return [props, nextProps];
108
+ var getHeaderPropsHook = (props, { instance, column }) => {
109
+ return [props, instance.hasStickyColumns ? getCellProps(column, true) : {}];
147
110
  };
148
- const getRowPropsHook = (props, { instance }) => {
149
- const nextProps = instance.hasStickyColumns ? getRowProps() : {};
150
- return [props, nextProps];
111
+ var getRowPropsHook = (props, { instance }) => {
112
+ return [props, instance.hasStickyColumns ? getRowProps() : {}];
151
113
  };
152
- const getCellPropsHook = (props, { instance, cell }) => {
153
- const nextProps = instance.hasStickyColumns ? getCellProps(cell.column, false) : {};
154
- return [props, nextProps];
114
+ var getCellPropsHook = (props, { instance, cell }) => {
115
+ return [props, instance.hasStickyColumns ? getCellProps(cell.column, false) : {}];
155
116
  };
156
- const useHvTableSticky = (hooks) => {
157
- hooks.visibleColumns.push(visibleColumnsHook);
158
- hooks.useInstance.push(useInstanceHook);
159
- hooks.getTableProps.push(getTablePropsHook);
160
- hooks.getTableHeadProps = [getTableHeadPropsHook];
161
- hooks.getHeaderGroupProps.push(getHeaderGroupPropsHook);
162
- hooks.getHeaderProps.push(getHeaderPropsHook);
163
- hooks.getRowProps.push(getRowPropsHook);
164
- hooks.getCellProps.push(getCellPropsHook);
117
+ var useHvTableSticky = (hooks) => {
118
+ hooks.visibleColumns.push(visibleColumnsHook);
119
+ hooks.useInstance.push(useInstanceHook);
120
+ hooks.getTableProps.push(getTablePropsHook);
121
+ hooks.getTableHeadProps = [getTableHeadPropsHook];
122
+ hooks.getHeaderGroupProps.push(getHeaderGroupPropsHook);
123
+ hooks.getHeaderProps.push(getHeaderPropsHook);
124
+ hooks.getRowProps.push(getRowPropsHook);
125
+ hooks.getCellProps.push(getCellPropsHook);
165
126
  };
166
127
  useHvTableSticky.pluginName = "useHvTableSticky";
167
- export {
168
- useHvTableSticky
169
- };
128
+ //#endregion
129
+ export { useHvTableSticky };
@@ -1,80 +1,56 @@
1
- import { useMemo } from "react";
2
- import { useTable, usePagination, useExpanded, useSortBy, useResizeColumns } from "react-table";
3
1
  import { DefaultCell } from "../renderers/DefaultCell.js";
4
2
  import { useHvTableStyles } from "./useHvTableStyles.js";
5
- const toTitleCase = (str) => {
6
- return str.replace(/([^A-Z])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").toLowerCase().replace(/(^\w|\b\w)/g, (m) => m.toUpperCase()).replace(/\s+/g, " ").trim();
3
+ import { useMemo } from "react";
4
+ import { useExpanded, usePagination, useResizeColumns, useSortBy, useTable } from "react-table";
5
+ //#region src/Table/hooks/useHvTable.ts
6
+ var toTitleCase = (str) => {
7
+ return str.replace(/([^A-Z])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").toLowerCase().replace(/(^\w|\b\w)/g, (m) => m.toUpperCase()).replace(/\s+/g, " ").trim();
7
8
  };
8
9
  function useDefaultData(data) {
9
- return useMemo(() => {
10
- return data || [];
11
- }, [data]);
10
+ return useMemo(() => {
11
+ return data || [];
12
+ }, [data]);
12
13
  }
13
14
  function useDefaultColumns(data, columns) {
14
- return useMemo(() => {
15
- if (columns != null) {
16
- return columns;
17
- }
18
- const uniqueKeys = Object.keys(Object.assign({}, ...data));
19
- return uniqueKeys.filter((key) => !["subRows", "subComponent"].includes(key)).map((key) => ({
20
- accessor: key,
21
- Header: toTitleCase(key)
22
- }));
23
- }, [columns, data]);
15
+ return useMemo(() => {
16
+ if (columns != null) return columns;
17
+ return Object.keys(Object.assign({}, ...data)).filter((key) => !["subRows", "subComponent"].includes(key)).map((key) => ({
18
+ accessor: key,
19
+ Header: toTitleCase(key)
20
+ }));
21
+ }, [columns, data]);
24
22
  }
25
23
  function ensureCorePluginInstallation(plugins, hvPluginName, corePluginToInstall) {
26
- const indexOfCorePlugin = plugins.findIndex(
27
- (plugin) => plugin.pluginName === corePluginToInstall.pluginName
28
- );
29
- const indexOfHvPlugin = plugins.findIndex(
30
- (plugin) => plugin.pluginName === hvPluginName
31
- );
32
- if (indexOfHvPlugin !== -1 && (indexOfCorePlugin === -1 || indexOfCorePlugin > indexOfHvPlugin)) {
33
- if (indexOfCorePlugin > -1) {
34
- plugins.splice(indexOfCorePlugin, 1);
35
- }
36
- plugins.splice(indexOfHvPlugin, 0, corePluginToInstall);
37
- }
24
+ const indexOfCorePlugin = plugins.findIndex((plugin) => plugin.pluginName === corePluginToInstall.pluginName);
25
+ const indexOfHvPlugin = plugins.findIndex((plugin) => plugin.pluginName === hvPluginName);
26
+ if (indexOfHvPlugin !== -1 && (indexOfCorePlugin === -1 || indexOfCorePlugin > indexOfHvPlugin)) {
27
+ if (indexOfCorePlugin > -1) plugins.splice(indexOfCorePlugin, 1);
28
+ plugins.splice(indexOfHvPlugin, 0, corePluginToInstall);
29
+ }
38
30
  }
39
31
  function useInstanceHook(instance) {
40
- const { rowsById } = instance;
41
- Object.assign(instance, {
42
- initialRowsById: rowsById
43
- });
32
+ const { rowsById } = instance;
33
+ Object.assign(instance, { initialRowsById: rowsById });
44
34
  }
45
35
  function useHvTableSetup(hooks) {
46
- hooks.useInstance.push(useInstanceHook);
36
+ hooks.useInstance.push(useInstanceHook);
47
37
  }
48
38
  useHvTableSetup.pluginName = "useHvTableSetup";
49
39
  function useHvTable(options, ...plugins) {
50
- const { data: dataProp, columns: columnsProp, ...others } = options;
51
- const data = useDefaultData(dataProp);
52
- const columns = useDefaultColumns(data, columnsProp);
53
- ensureCorePluginInstallation(plugins, "useHvPagination", usePagination);
54
- ensureCorePluginInstallation(plugins, "useHvRowExpand", useExpanded);
55
- ensureCorePluginInstallation(plugins, "useHvSortBy", useSortBy);
56
- ensureCorePluginInstallation(
57
- plugins,
58
- "useHvResizeColumns",
59
- useResizeColumns
60
- );
61
- const indexOfHvTableStylesPlugin = plugins.findIndex(
62
- (plugin) => plugin.pluginName === "useHvTableStyles"
63
- );
64
- if (indexOfHvTableStylesPlugin === -1) {
65
- plugins.push(useHvTableStyles);
66
- }
67
- return useTable(
68
- {
69
- data,
70
- columns,
71
- defaultColumn: { Cell: DefaultCell },
72
- ...others
73
- },
74
- useHvTableSetup,
75
- ...plugins
76
- );
40
+ const { data: dataProp, columns: columnsProp, ...others } = options;
41
+ const data = useDefaultData(dataProp);
42
+ const columns = useDefaultColumns(data, columnsProp);
43
+ ensureCorePluginInstallation(plugins, "useHvPagination", usePagination);
44
+ ensureCorePluginInstallation(plugins, "useHvRowExpand", useExpanded);
45
+ ensureCorePluginInstallation(plugins, "useHvSortBy", useSortBy);
46
+ ensureCorePluginInstallation(plugins, "useHvResizeColumns", useResizeColumns);
47
+ if (plugins.findIndex((plugin) => plugin.pluginName === "useHvTableStyles") === -1) plugins.push(useHvTableStyles);
48
+ return useTable({
49
+ data,
50
+ columns,
51
+ defaultColumn: { Cell: DefaultCell },
52
+ ...others
53
+ }, useHvTableSetup, ...plugins);
77
54
  }
78
- export {
79
- useHvTable
80
- };
55
+ //#endregion
56
+ export { useHvTable };
@@ -1,89 +1,58 @@
1
1
  import { clsx } from "clsx";
2
- const getTablePropsHook = (props, { instance }) => {
3
- const nextProps = {
4
- component: instance.tableComponent
5
- };
6
- if (instance.style != null) {
7
- nextProps.style = instance.style;
8
- }
9
- if (instance.className != null) {
10
- nextProps.className = instance.className;
11
- }
12
- if (instance.classes != null) {
13
- nextProps.classes = instance.classes;
14
- }
15
- return [props, nextProps];
2
+ //#region src/Table/hooks/useHvTableStyles.ts
3
+ var getTablePropsHook = (props, { instance }) => {
4
+ const nextProps = { component: instance.tableComponent };
5
+ if (instance.style != null) nextProps.style = instance.style;
6
+ if (instance.className != null) nextProps.className = instance.className;
7
+ if (instance.classes != null) nextProps.classes = instance.classes;
8
+ return [props, nextProps];
16
9
  };
17
- const getHeaderFooterPropsHook = (props, { column }) => {
18
- const nextProps = {
19
- variant: column.variant,
20
- align: column.align
21
- };
22
- if (column.style != null || column.headerStyle != null) {
23
- nextProps.style = {
24
- ...props.style,
25
- ...column.style,
26
- ...column.headerStyle
27
- };
28
- }
29
- if (column.className != null || column.headerClassName != null) {
30
- nextProps.className = clsx(
31
- props.className,
32
- column.className,
33
- column.headerClassName
34
- );
35
- }
36
- if (column.classes != null || column.headerClasses) {
37
- nextProps.classes = {
38
- ...props.classes,
39
- ...column.classes,
40
- ...column.headerClasses
41
- };
42
- }
43
- return [props, nextProps];
10
+ var getHeaderFooterPropsHook = (props, { column }) => {
11
+ const nextProps = {
12
+ variant: column.variant,
13
+ align: column.align
14
+ };
15
+ if (column.style != null || column.headerStyle != null) nextProps.style = {
16
+ ...props.style,
17
+ ...column.style,
18
+ ...column.headerStyle
19
+ };
20
+ if (column.className != null || column.headerClassName != null) nextProps.className = clsx(props.className, column.className, column.headerClassName);
21
+ if (column.classes != null || column.headerClasses) nextProps.classes = {
22
+ ...props.classes,
23
+ ...column.classes,
24
+ ...column.headerClasses
25
+ };
26
+ return [props, nextProps];
44
27
  };
45
- const getRowPropsHook = (props) => {
46
- const nextProps = {
47
- hover: true
48
- };
49
- return [props, nextProps];
28
+ var getRowPropsHook = (props) => {
29
+ return [props, { hover: true }];
50
30
  };
51
- const getCellPropsHook = (props, { cell }) => {
52
- const nextProps = {
53
- variant: cell.column.variant,
54
- align: cell.column.align
55
- };
56
- if (cell.column.style != null || cell.column.cellStyle != null) {
57
- nextProps.style = {
58
- ...props.style,
59
- ...cell.column.style,
60
- ...cell.column.cellStyle
61
- };
62
- }
63
- if (cell.column.className != null || cell.column.cellClassName != null) {
64
- nextProps.className = clsx(
65
- props.className,
66
- cell.column.className,
67
- cell.column.cellClassName
68
- );
69
- }
70
- if (cell.column.classes != null || cell.column.cellClasses) {
71
- nextProps.classes = {
72
- ...props.classes,
73
- ...cell.column.classes,
74
- ...cell.column.cellClasses
75
- };
76
- }
77
- return [props, nextProps];
31
+ var getCellPropsHook = (props, { cell }) => {
32
+ const nextProps = {
33
+ variant: cell.column.variant,
34
+ align: cell.column.align
35
+ };
36
+ if (cell.column.style != null || cell.column.cellStyle != null) nextProps.style = {
37
+ ...props.style,
38
+ ...cell.column.style,
39
+ ...cell.column.cellStyle
40
+ };
41
+ if (cell.column.className != null || cell.column.cellClassName != null) nextProps.className = clsx(props.className, cell.column.className, cell.column.cellClassName);
42
+ if (cell.column.classes != null || cell.column.cellClasses) nextProps.classes = {
43
+ ...props.classes,
44
+ ...cell.column.classes,
45
+ ...cell.column.cellClasses
46
+ };
47
+ return [props, nextProps];
78
48
  };
79
- const useHvTableStyles = (hooks) => {
80
- hooks.getTableProps.push(getTablePropsHook);
81
- hooks.getHeaderProps.push(getHeaderFooterPropsHook);
82
- hooks.getFooterProps.push(getHeaderFooterPropsHook);
83
- hooks.getRowProps.push(getRowPropsHook);
84
- hooks.getCellProps.push(getCellPropsHook);
49
+ var useHvTableStyles = (hooks) => {
50
+ hooks.getTableProps.push(getTablePropsHook);
51
+ hooks.getHeaderProps.push(getHeaderFooterPropsHook);
52
+ hooks.getFooterProps.push(getHeaderFooterPropsHook);
53
+ hooks.getRowProps.push(getRowPropsHook);
54
+ hooks.getCellProps.push(getCellPropsHook);
85
55
  };
86
56
  useHvTableStyles.pluginName = "useHvTableStyles";
87
- export {
88
- useHvTableStyles
89
- };
57
+ //#endregion
58
+ export { useHvTableStyles };
@@ -1,16 +1,15 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
1
  import { HvOverflowTooltip } from "../../OverflowTooltip/OverflowTooltip.js";
4
- const formatter = new Intl.DateTimeFormat(void 0, {
5
- dateStyle: "short",
6
- timeStyle: "medium"
2
+ import { useMemo } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/Table/renderers/DateColumnCell.tsx
5
+ var formatter = new Intl.DateTimeFormat(void 0, {
6
+ dateStyle: "short",
7
+ timeStyle: "medium"
7
8
  });
8
- const HvDateColumnCell = ({ date }) => {
9
- const formattedDate = useMemo(() => {
10
- return date ? formatter.format(new Date(date)) : "—";
11
- }, [date]);
12
- return /* @__PURE__ */ jsx(HvOverflowTooltip, { data: formattedDate });
13
- };
14
- export {
15
- HvDateColumnCell
9
+ var HvDateColumnCell = ({ date }) => {
10
+ return /* @__PURE__ */ jsx(HvOverflowTooltip, { data: useMemo(() => {
11
+ return date ? formatter.format(new Date(date)) : "—";
12
+ }, [date]) });
16
13
  };
14
+ //#endregion
15
+ export { HvDateColumnCell };