@rio-cloud/rio-uikit 2.0.1 → 2.2.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 (567) hide show
  1. package/CircularProgress.d.ts +2 -0
  2. package/CircularProgress.js +5 -0
  3. package/CircularProgress.js.map +1 -0
  4. package/RadioCardGroup.d.ts +2 -0
  5. package/RadioCardGroup.js +7 -0
  6. package/RadioCardGroup.js.map +1 -0
  7. package/SearchHighlightText.d.ts +2 -0
  8. package/SearchHighlightText.js +5 -0
  9. package/SearchHighlightText.js.map +1 -0
  10. package/TextTruncateMiddle.d.ts +2 -0
  11. package/TextTruncateMiddle.js +5 -0
  12. package/TextTruncateMiddle.js.map +1 -0
  13. package/Tracker.d.ts +2 -0
  14. package/Tracker.js +5 -0
  15. package/Tracker.js.map +1 -0
  16. package/classNames.d.ts +2 -0
  17. package/classNames.js +5 -0
  18. package/classNames.js.map +1 -0
  19. package/components/accentBar/AccentBar.js +1 -1
  20. package/components/accentBar/AccentBar.js.map +1 -1
  21. package/components/actionBarItem/ActionBarItem.d.ts +2 -2
  22. package/components/actionBarItem/ActionBarItem.js +7 -7
  23. package/components/actionBarItem/ActionBarItem.js.map +1 -1
  24. package/components/actionBarItem/ActionBarItemIcon.js +1 -1
  25. package/components/actionBarItem/ActionBarItemIcon.js.map +1 -1
  26. package/components/actionBarItem/ActionBarItemList.js +1 -1
  27. package/components/actionBarItem/ActionBarItemList.js.map +1 -1
  28. package/components/actionBarItem/ActionBarItemListItem.js +1 -1
  29. package/components/actionBarItem/ActionBarItemListItem.js.map +1 -1
  30. package/components/actionBarItem/ActionBarItemListSeparator.js +1 -1
  31. package/components/actionBarItem/ActionBarItemListSeparator.js.map +1 -1
  32. package/components/actionBarItem/ActionBarItemPopoverContent.js +3 -3
  33. package/components/actionBarItem/ActionBarItemPopoverContent.js.map +1 -1
  34. package/components/actionBarItem/ActionBarOverlay.js +1 -1
  35. package/components/actionBarItem/ActionBarOverlay.js.map +1 -1
  36. package/components/activity/Activity.js +1 -1
  37. package/components/activity/Activity.js.map +1 -1
  38. package/components/animatedTextReveal/AnimatedTextReveal.js +1 -1
  39. package/components/animatedTextReveal/AnimatedTextReveal.js.map +1 -1
  40. package/components/applicationHeader/AppMenu.js +2 -2
  41. package/components/applicationHeader/AppMenu.js.map +1 -1
  42. package/components/applicationHeader/AppMenuDropdown.js +13 -11
  43. package/components/applicationHeader/AppMenuDropdown.js.map +1 -1
  44. package/components/applicationHeader/ApplicationHeader.d.ts +6 -7
  45. package/components/applicationHeader/ApplicationHeader.js +1 -1
  46. package/components/applicationHeader/ApplicationHeader.js.map +1 -1
  47. package/components/applicationHeader/MobileHeaderModal.js +8 -8
  48. package/components/applicationHeader/MobileHeaderModal.js.map +1 -1
  49. package/components/applicationHeader/MobileSubmoduleNavigation.js +1 -1
  50. package/components/applicationHeader/MobileSubmoduleNavigation.js.map +1 -1
  51. package/components/applicationHeader/NavItems.js +4 -4
  52. package/components/applicationHeader/NavItems.js.map +1 -1
  53. package/components/applicationLayout/ApplicationLayout.js +10 -10
  54. package/components/applicationLayout/ApplicationLayout.js.map +1 -1
  55. package/components/applicationLayout/ApplicationLayoutBody.js +2 -2
  56. package/components/applicationLayout/ApplicationLayoutBody.js.map +1 -1
  57. package/components/applicationLayout/ApplicationLayoutBodyBanner.js +1 -1
  58. package/components/applicationLayout/ApplicationLayoutBodyBanner.js.map +1 -1
  59. package/components/applicationLayout/ApplicationLayoutBodyBottomBar.js +1 -1
  60. package/components/applicationLayout/ApplicationLayoutBodyBottomBar.js.map +1 -1
  61. package/components/applicationLayout/ApplicationLayoutBodyNavigation.js +1 -1
  62. package/components/applicationLayout/ApplicationLayoutBodyNavigation.js.map +1 -1
  63. package/components/applicationLayout/ApplicationLayoutHeader.js +1 -1
  64. package/components/applicationLayout/ApplicationLayoutHeader.js.map +1 -1
  65. package/components/applicationLayout/ApplicationLayoutSidebar.js +1 -1
  66. package/components/applicationLayout/ApplicationLayoutSidebar.js.map +1 -1
  67. package/components/applicationLayout/SubNavigation.d.ts +7 -0
  68. package/components/applicationLayout/SubNavigation.js +1 -1
  69. package/components/applicationLayout/SubNavigation.js.map +1 -1
  70. package/components/assetTree/AssetTree.d.ts +7 -0
  71. package/components/assetTree/AssetTree.js +1 -1
  72. package/components/assetTree/AssetTree.js.map +1 -1
  73. package/components/assetTree/Tree.d.ts +15 -0
  74. package/components/assetTree/Tree.js +1 -1
  75. package/components/assetTree/Tree.js.map +1 -1
  76. package/components/assetTree/TreeIcon.d.ts +30 -0
  77. package/components/assetTree/TreeIcon.js +16 -0
  78. package/components/assetTree/TreeIcon.js.map +1 -0
  79. package/components/assetTree/TreeLeaf.js +23 -23
  80. package/components/assetTree/TreeLeaf.js.map +1 -1
  81. package/components/assetTree/TreeNode.js +25 -25
  82. package/components/assetTree/TreeNode.js.map +1 -1
  83. package/components/assetTree/TreeNodeContainer.js +1 -1
  84. package/components/assetTree/TreeNodeContainer.js.map +1 -1
  85. package/components/assetTree/TreeOption.js +3 -3
  86. package/components/assetTree/TreeOption.js.map +1 -1
  87. package/components/assetTree/TreeOptions.js +4 -4
  88. package/components/assetTree/TreeOptions.js.map +1 -1
  89. package/components/assetTree/TreeRoot.js +3 -3
  90. package/components/assetTree/TreeRoot.js.map +1 -1
  91. package/components/assetTree/TreeSearch.d.ts +2 -0
  92. package/components/assetTree/TreeSearch.js +3 -3
  93. package/components/assetTree/TreeSearch.js.map +1 -1
  94. package/components/assetTree/TreeSidebar.js +1 -1
  95. package/components/assetTree/TreeSidebar.js.map +1 -1
  96. package/components/assetTree/TreeSidebarCategories.js +4 -4
  97. package/components/assetTree/TreeSidebarCategories.js.map +1 -1
  98. package/components/assetTree/TreeSummary.js +1 -1
  99. package/components/assetTree/TreeSummary.js.map +1 -1
  100. package/components/assetTree/TypeCounter.js +1 -1
  101. package/components/assetTree/TypeCounter.js.map +1 -1
  102. package/components/autosuggest/AutoSuggest.js +1 -1
  103. package/components/autosuggest/AutoSuggest.js.map +1 -1
  104. package/components/avatar/Avatar.js +1 -1
  105. package/components/avatar/Avatar.js.map +1 -1
  106. package/components/banner/Banner.js +1 -1
  107. package/components/banner/Banner.js.map +1 -1
  108. package/components/banner/BannerContent.js +1 -1
  109. package/components/banner/BannerContent.js.map +1 -1
  110. package/components/barList/BarList.d.ts +26 -0
  111. package/components/barList/BarList.js +1 -1
  112. package/components/barList/BarList.js.map +1 -1
  113. package/components/bottomSheet/BottomSheet.d.ts +17 -3
  114. package/components/bottomSheet/BottomSheet.js +1 -1
  115. package/components/bottomSheet/BottomSheet.js.map +1 -1
  116. package/components/bottomSheet/TimedBottomSheet.d.ts +10 -0
  117. package/components/bottomSheet/TimedBottomSheet.js.map +1 -1
  118. package/components/button/Button.d.ts +53 -7
  119. package/components/button/Button.js +87 -64
  120. package/components/button/Button.js.map +1 -1
  121. package/components/button/ButtonToolbar.js +1 -1
  122. package/components/button/ButtonToolbar.js.map +1 -1
  123. package/components/button/ToggleButton.d.ts +4 -1
  124. package/components/button/ToggleButton.js.map +1 -1
  125. package/components/calendarStripe/CalendarStripe.d.ts +1 -1
  126. package/components/calendarStripe/CalendarStripe.js +48 -50
  127. package/components/calendarStripe/CalendarStripe.js.map +1 -1
  128. package/components/card/Card.js +1 -1
  129. package/components/card/Card.js.map +1 -1
  130. package/components/charts/Area.d.ts +2 -2
  131. package/components/charts/Area.js.map +1 -1
  132. package/components/charts/Line.d.ts +2 -2
  133. package/components/charts/Line.js.map +1 -1
  134. package/components/charts/RadialBarChart.js +106 -103
  135. package/components/charts/RadialBarChart.js.map +1 -1
  136. package/components/checkbox/Checkbox.d.ts +0 -3
  137. package/components/checkbox/Checkbox.js +6 -6
  138. package/components/checkbox/Checkbox.js.map +1 -1
  139. package/components/circularProgress/CircularProgress.d.ts +139 -0
  140. package/components/circularProgress/CircularProgress.js +197 -0
  141. package/components/circularProgress/CircularProgress.js.map +1 -0
  142. package/components/clearableInput/ClearableInput.d.ts +21 -20
  143. package/components/clearableInput/ClearableInput.js +9 -9
  144. package/components/clearableInput/ClearableInput.js.map +1 -1
  145. package/components/collapse/Collapse.d.ts +3 -0
  146. package/components/collapse/Collapse.js +12 -12
  147. package/components/collapse/Collapse.js.map +1 -1
  148. package/components/contentLoader/ContentLoader.d.ts +10 -2
  149. package/components/contentLoader/ContentLoader.js.map +1 -1
  150. package/components/dataTabs/DataTabHeader.js +1 -1
  151. package/components/dataTabs/DataTabHeader.js.map +1 -1
  152. package/components/dataTabs/DataTabs.d.ts +6 -0
  153. package/components/dataTabs/DataTabs.js +4 -4
  154. package/components/dataTabs/DataTabs.js.map +1 -1
  155. package/components/datepicker/DatePicker.js +6 -6
  156. package/components/datepicker/DatePicker.js.map +1 -1
  157. package/components/datepicker/DateRangePicker.js +1 -1
  158. package/components/datepicker/DateRangePicker.js.map +1 -1
  159. package/components/datepicker/DayPicker.js +1 -1
  160. package/components/datepicker/DayPicker.js.map +1 -1
  161. package/components/dialog/ConfirmationDialog.d.ts +22 -0
  162. package/components/dialog/ConfirmationDialog.js.map +1 -1
  163. package/components/dialog/Dialog.d.ts +13 -1
  164. package/components/dialog/Dialog.js +55 -55
  165. package/components/dialog/Dialog.js.map +1 -1
  166. package/components/dialog/DialogBody.js +1 -1
  167. package/components/dialog/DialogBody.js.map +1 -1
  168. package/components/dialog/DialogFooter.js +1 -1
  169. package/components/dialog/DialogFooter.js.map +1 -1
  170. package/components/dialog/DialogHeader.js +1 -1
  171. package/components/dialog/DialogHeader.js.map +1 -1
  172. package/components/dialog/MediaDialog.js +1 -1
  173. package/components/dialog/MediaDialog.js.map +1 -1
  174. package/components/dialog/ReleaseNotesDialog.d.ts +3 -3
  175. package/components/dialog/ReleaseNotesDialog.js.map +1 -1
  176. package/components/dialog/SplitDialog.js +1 -1
  177. package/components/dialog/SplitDialog.js.map +1 -1
  178. package/components/divider/Divider.js +1 -1
  179. package/components/divider/Divider.js.map +1 -1
  180. package/components/dropdown/ButtonDropdown.d.ts +4 -0
  181. package/components/dropdown/ButtonDropdown.js +52 -52
  182. package/components/dropdown/ButtonDropdown.js.map +1 -1
  183. package/components/dropdown/DropdownSubmenu.d.ts +4 -0
  184. package/components/dropdown/DropdownSubmenu.js +3 -3
  185. package/components/dropdown/DropdownSubmenu.js.map +1 -1
  186. package/components/dropdown/DropdownToggleButton.d.ts +1 -1
  187. package/components/dropdown/DropdownToggleButton.js +4 -3
  188. package/components/dropdown/DropdownToggleButton.js.map +1 -1
  189. package/components/dropdown/SplitCaretButton.js +6 -6
  190. package/components/dropdown/SplitCaretButton.js.map +1 -1
  191. package/components/editableContent/EditableContent.d.ts +6 -0
  192. package/components/editableContent/EditableContent.js +1 -1
  193. package/components/editableContent/EditableContent.js.map +1 -1
  194. package/components/ellipsis/TextTruncateMiddle.d.ts +23 -0
  195. package/components/ellipsis/TextTruncateMiddle.js +21 -0
  196. package/components/ellipsis/TextTruncateMiddle.js.map +1 -0
  197. package/components/expander/ExpanderList.d.ts +3 -0
  198. package/components/expander/ExpanderList.js +5 -5
  199. package/components/expander/ExpanderList.js.map +1 -1
  200. package/components/expander/ExpanderPanel.d.ts +14 -4
  201. package/components/expander/ExpanderPanel.js +1 -1
  202. package/components/expander/ExpanderPanel.js.map +1 -1
  203. package/components/fade/Fade.d.ts +1 -1
  204. package/components/fade/Fade.js.map +1 -1
  205. package/components/feedback/FeedbackRating.js +1 -1
  206. package/components/feedback/FeedbackRating.js.map +1 -1
  207. package/components/feedback/FeedbackReactions.js +1 -1
  208. package/components/feedback/FeedbackReactions.js.map +1 -1
  209. package/components/filepicker/FilePicker.d.ts +0 -2
  210. package/components/filepicker/FilePicker.js.map +1 -1
  211. package/components/formLabel/FormLabel.js +6 -9
  212. package/components/formLabel/FormLabel.js.map +1 -1
  213. package/components/formLabel/LabeledElement.js +1 -1
  214. package/components/formLabel/LabeledElement.js.map +1 -1
  215. package/components/groupedItemList/GroupedItemList.d.ts +10 -7
  216. package/components/groupedItemList/GroupedItemList.js.map +1 -1
  217. package/components/listMenu/ListMenu.js +2 -5
  218. package/components/listMenu/ListMenu.js.map +1 -1
  219. package/components/listMenu/ListMenuGroup.d.ts +2 -1
  220. package/components/listMenu/ListMenuGroup.js +2 -2
  221. package/components/listMenu/ListMenuGroup.js.map +1 -1
  222. package/components/loadMore/LoadMoreButton.js +1 -1
  223. package/components/loadMore/LoadMoreButton.js.map +1 -1
  224. package/components/loadMore/LoadMoreProgress.js +1 -1
  225. package/components/loadMore/LoadMoreProgress.js.map +1 -1
  226. package/components/map/components/Map.js.map +1 -1
  227. package/components/map/components/constants.js.map +1 -1
  228. package/components/map/components/features/ContextMenuItem.d.ts +1 -1
  229. package/components/map/components/features/ContextMenuItem.js +2 -17
  230. package/components/map/components/features/ContextMenuItem.js.map +1 -1
  231. package/components/map/components/features/MapSettings.js +4 -4
  232. package/components/map/components/features/MapSettings.js.map +1 -1
  233. package/components/map/components/features/basics/Polyline.d.ts +4 -1
  234. package/components/map/components/features/basics/Polyline.js +1 -1
  235. package/components/map/components/features/basics/Polyline.js.map +1 -1
  236. package/components/map/components/features/layers/MarkerLayer.d.ts +3 -1
  237. package/components/map/components/features/layers/MarkerLayer.js.map +1 -1
  238. package/components/map/components/features/layers/clustering/ClusterLayer.js +1 -1
  239. package/components/map/components/features/layers/clustering/ClusterLayer.js.map +1 -1
  240. package/components/map/components/features/layers/clustering/SimpleClusterLayer.d.ts +3 -2
  241. package/components/map/components/features/layers/clustering/SimpleClusterLayer.js.map +1 -1
  242. package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js +7 -7
  243. package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js.map +1 -1
  244. package/components/map/components/features/layers/overlayLayers/TrafficLayer.js +4 -4
  245. package/components/map/components/features/layers/overlayLayers/TrafficLayer.js.map +1 -1
  246. package/components/map/components/features/settings/MapSettingsItem.js +1 -1
  247. package/components/map/components/features/settings/MapSettingsItem.js.map +1 -1
  248. package/components/map/components/features/settings/MapSettingsPanel.js +6 -20
  249. package/components/map/components/features/settings/MapSettingsPanel.js.map +1 -1
  250. package/components/map/components/features/settings/MapSettingsTile.js +87 -61
  251. package/components/map/components/features/settings/MapSettingsTile.js.map +1 -1
  252. package/components/map/components/features/settings/ZoomButtons.js +1 -1
  253. package/components/map/components/features/settings/ZoomButtons.js.map +1 -1
  254. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.d.ts +38 -1
  255. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +128 -92
  256. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js.map +1 -1
  257. package/components/map/utils/clustering.d.ts +6 -1
  258. package/components/map/utils/clustering.js +25 -19
  259. package/components/map/utils/clustering.js.map +1 -1
  260. package/components/map/utils/eventHandling.js +9 -9
  261. package/components/map/utils/eventHandling.js.map +1 -1
  262. package/components/map/utils/mapUtils.d.ts +6 -6
  263. package/components/map/utils/mapUtils.js +14 -19
  264. package/components/map/utils/mapUtils.js.map +1 -1
  265. package/components/map/utils/rendering.d.ts +1 -1
  266. package/components/map/utils/rendering.js +23 -23
  267. package/components/map/utils/rendering.js.map +1 -1
  268. package/components/mapMarker/ClusterMapMarker.js +1 -1
  269. package/components/mapMarker/ClusterMapMarker.js.map +1 -1
  270. package/components/mapMarker/SingleMapMarker.js +1 -1
  271. package/components/mapMarker/SingleMapMarker.js.map +1 -1
  272. package/components/menuItems/MenuItem.d.ts +23 -0
  273. package/components/menuItems/MenuItem.js +1 -1
  274. package/components/menuItems/MenuItem.js.map +1 -1
  275. package/components/menuItems/MenuItemList.js +1 -1
  276. package/components/menuItems/MenuItemList.js.map +1 -1
  277. package/components/navigation/AppNavigationBar.js +4 -4
  278. package/components/navigation/AppNavigationBar.js.map +1 -1
  279. package/components/noData/NoData.js +1 -1
  280. package/components/noData/NoData.js.map +1 -1
  281. package/components/notification/Notification.js +4 -4
  282. package/components/notification/Notification.js.map +1 -1
  283. package/components/numberControl/NumberControl.js +4 -4
  284. package/components/numberControl/NumberControl.js.map +1 -1
  285. package/components/numberInput/NumberInput.js +1 -1
  286. package/components/numberInput/NumberInput.js.map +1 -1
  287. package/components/onboarding/OnboardingTip.d.ts +18 -12
  288. package/components/onboarding/OnboardingTip.js +4 -4
  289. package/components/onboarding/OnboardingTip.js.map +1 -1
  290. package/components/overlay/OverlayTrigger.d.ts +43 -1
  291. package/components/overlay/OverlayTrigger.js.map +1 -1
  292. package/components/page/Page.js +1 -1
  293. package/components/page/Page.js.map +1 -1
  294. package/components/pager/Pager.d.ts +3 -0
  295. package/components/pager/Pager.js +1 -1
  296. package/components/pager/Pager.js.map +1 -1
  297. package/components/popover/Popover.d.ts +1 -0
  298. package/components/popover/Popover.js.map +1 -1
  299. package/components/preloader/ImagePreloader.d.ts +1 -1
  300. package/components/preloader/ImagePreloader.js.map +1 -1
  301. package/components/radiobutton/RadioButton.d.ts +10 -6
  302. package/components/radiobutton/RadioButton.js +5 -5
  303. package/components/radiobutton/RadioButton.js.map +1 -1
  304. package/components/radiobutton/RadioCardGroup.d.ts +86 -0
  305. package/components/radiobutton/RadioCardGroup.js +110 -0
  306. package/components/radiobutton/RadioCardGroup.js.map +1 -0
  307. package/components/releaseNotes/ReleaseNotes.d.ts +0 -3
  308. package/components/releaseNotes/ReleaseNotes.js.map +1 -1
  309. package/components/resizer/Resizer.d.ts +17 -3
  310. package/components/resizer/Resizer.js +1 -1
  311. package/components/resizer/Resizer.js.map +1 -1
  312. package/components/responsiveColumnStripe/ResponsiveColumnStripe.js +1 -1
  313. package/components/responsiveColumnStripe/ResponsiveColumnStripe.js.map +1 -1
  314. package/components/rioglyph/Rioglyph.d.ts +20 -8
  315. package/components/rioglyph/Rioglyph.js +1 -1
  316. package/components/rioglyph/Rioglyph.js.map +1 -1
  317. package/components/rioglyph/RioglyphIconType.d.ts +1 -1
  318. package/components/rules/RuleConnector.js +1 -1
  319. package/components/rules/RuleConnector.js.map +1 -1
  320. package/components/rules/RuleContainer.js +27 -27
  321. package/components/rules/RuleContainer.js.map +1 -1
  322. package/components/rules/RulesWrapper.js +1 -1
  323. package/components/rules/RulesWrapper.js.map +1 -1
  324. package/components/saveableInput/SaveableDateInput.d.ts +20 -2
  325. package/components/saveableInput/SaveableDateInput.js +1 -1
  326. package/components/saveableInput/SaveableDateInput.js.map +1 -1
  327. package/components/saveableInput/SaveableInput.d.ts +10 -2
  328. package/components/saveableInput/SaveableInput.js +49 -49
  329. package/components/saveableInput/SaveableInput.js.map +1 -1
  330. package/components/searchHighlight/SearchHighlightText.d.ts +28 -0
  331. package/components/searchHighlight/SearchHighlightText.js +15 -0
  332. package/components/searchHighlight/SearchHighlightText.js.map +1 -0
  333. package/components/selects/BaseSelectDropdown.js +90 -79
  334. package/components/selects/BaseSelectDropdown.js.map +1 -1
  335. package/components/selects/ClearButton.js +4 -4
  336. package/components/selects/ClearButton.js.map +1 -1
  337. package/components/selects/Multiselect.js +6 -6
  338. package/components/selects/Multiselect.js.map +1 -1
  339. package/components/selects/MultiselectToggleFilter.js +4 -4
  340. package/components/selects/MultiselectToggleFilter.js.map +1 -1
  341. package/components/selects/MultiselectToggleSelection.js +1 -1
  342. package/components/selects/MultiselectToggleSelection.js.map +1 -1
  343. package/components/selects/Select.d.ts +5 -0
  344. package/components/selects/Select.js +93 -93
  345. package/components/selects/Select.js.map +1 -1
  346. package/components/selects/SelectFilter.js +1 -1
  347. package/components/selects/SelectFilter.js.map +1 -1
  348. package/components/selects/WithFeedbackAndAddon.js +1 -1
  349. package/components/selects/WithFeedbackAndAddon.js.map +1 -1
  350. package/components/sidebars/Sidebar.d.ts +19 -3
  351. package/components/sidebars/Sidebar.js +54 -54
  352. package/components/sidebars/Sidebar.js.map +1 -1
  353. package/components/sidebars/SidebarBackdrop.js +4 -4
  354. package/components/sidebars/SidebarBackdrop.js.map +1 -1
  355. package/components/sidebars/SidebarFooter.js +1 -1
  356. package/components/sidebars/SidebarFooter.js.map +1 -1
  357. package/components/sidebars/SidebarFullscreenToggle.js +4 -4
  358. package/components/sidebars/SidebarFullscreenToggle.js.map +1 -1
  359. package/components/slider/RangeSlider.d.ts +15 -0
  360. package/components/slider/RangeSlider.js +1 -1
  361. package/components/slider/RangeSlider.js.map +1 -1
  362. package/components/slider/Slider.d.ts +9 -0
  363. package/components/slider/Slider.js +1 -1
  364. package/components/slider/Slider.js.map +1 -1
  365. package/components/smoothScrollbars/SmoothScrollbars.d.ts +44 -0
  366. package/components/smoothScrollbars/SmoothScrollbars.js +1 -1
  367. package/components/smoothScrollbars/SmoothScrollbars.js.map +1 -1
  368. package/components/spinner/Spinner.d.ts +3 -3
  369. package/components/spinner/Spinner.js +5 -4
  370. package/components/spinner/Spinner.js.map +1 -1
  371. package/components/states/CustomState.d.ts +69 -1
  372. package/components/states/CustomState.js +1 -1
  373. package/components/states/CustomState.js.map +1 -1
  374. package/components/states/EmptyState.d.ts +1 -1
  375. package/components/states/EmptyState.js.map +1 -1
  376. package/components/states/ErrorState.d.ts +1 -1
  377. package/components/states/ErrorState.js.map +1 -1
  378. package/components/states/ForbiddenState.d.ts +1 -1
  379. package/components/states/ForbiddenState.js.map +1 -1
  380. package/components/states/MaintenanceState.d.ts +1 -1
  381. package/components/states/MaintenanceState.js.map +1 -1
  382. package/components/states/NotBookedState.d.ts +1 -1
  383. package/components/states/NotBookedState.js.map +1 -1
  384. package/components/states/NotFoundState.d.ts +1 -1
  385. package/components/states/NotFoundState.js.map +1 -1
  386. package/components/states/StateButton.js +1 -1
  387. package/components/states/StateButton.js.map +1 -1
  388. package/components/states/StateIcon.d.ts +14 -1
  389. package/components/states/StateIcon.js.map +1 -1
  390. package/components/statsWidget/StatsWidget.d.ts +2 -0
  391. package/components/statsWidget/StatsWidget.js +1 -1
  392. package/components/statsWidget/StatsWidget.js.map +1 -1
  393. package/components/statsWidget/StatsWidgetBody.d.ts +1 -0
  394. package/components/statsWidget/StatsWidgetBody.js +1 -1
  395. package/components/statsWidget/StatsWidgetBody.js.map +1 -1
  396. package/components/statsWidget/StatsWidgetFooter.js +1 -1
  397. package/components/statsWidget/StatsWidgetFooter.js.map +1 -1
  398. package/components/statsWidget/StatsWidgetHeader.js +1 -1
  399. package/components/statsWidget/StatsWidgetHeader.js.map +1 -1
  400. package/components/statsWidget/StatsWidgetNumber.d.ts +2 -0
  401. package/components/statsWidget/StatsWidgetNumber.js +2 -2
  402. package/components/statsWidget/StatsWidgetNumber.js.map +1 -1
  403. package/components/statsWidget/StatsWidgetSpacer.js +1 -1
  404. package/components/statsWidget/StatsWidgetSpacer.js.map +1 -1
  405. package/components/statsWidget/StatsWidgets.js +1 -1
  406. package/components/statsWidget/StatsWidgets.js.map +1 -1
  407. package/components/statusBar/StatusBar.d.ts +98 -3
  408. package/components/statusBar/StatusBar.js +24 -17
  409. package/components/statusBar/StatusBar.js.map +1 -1
  410. package/components/statusBar/StatusBarIcon.d.ts +2 -2
  411. package/components/statusBar/StatusBarIcon.js +4 -4
  412. package/components/statusBar/StatusBarIcon.js.map +1 -1
  413. package/components/statusBar/StatusBarLabel.d.ts +2 -2
  414. package/components/statusBar/StatusBarLabel.js +5 -7
  415. package/components/statusBar/StatusBarLabel.js.map +1 -1
  416. package/components/statusBar/StatusBarProgressBar.d.ts +1 -1
  417. package/components/statusBar/StatusBarProgressBar.js +1 -1
  418. package/components/statusBar/StatusBarProgressBar.js.map +1 -1
  419. package/components/steppedProgressBar/SteppedProgressBar.d.ts +1 -1
  420. package/components/steppedProgressBar/SteppedProgressBar.js +1 -1
  421. package/components/steppedProgressBar/SteppedProgressBar.js.map +1 -1
  422. package/components/switch/Switch.d.ts +28 -1
  423. package/components/switch/Switch.js +77 -35
  424. package/components/switch/Switch.js.map +1 -1
  425. package/components/table/SortArrowDown.d.ts +1 -1
  426. package/components/table/SortArrowDown.js.map +1 -1
  427. package/components/table/SortArrowUp.d.ts +1 -1
  428. package/components/table/SortArrowUp.js.map +1 -1
  429. package/components/table/TableCardsSorting.js +4 -4
  430. package/components/table/TableCardsSorting.js.map +1 -1
  431. package/components/table/TableHead.js +1 -1
  432. package/components/table/TableHead.js.map +1 -1
  433. package/components/table/TableSearch.js +1 -1
  434. package/components/table/TableSearch.js.map +1 -1
  435. package/components/table/TableSettingsColumnButtons.d.ts +1 -1
  436. package/components/table/TableSettingsColumnButtons.js +1 -1
  437. package/components/table/TableSettingsColumnButtons.js.map +1 -1
  438. package/components/table/TableSettingsColumnDetails.d.ts +1 -1
  439. package/components/table/TableSettingsColumnDetails.js +1 -1
  440. package/components/table/TableSettingsColumnDetails.js.map +1 -1
  441. package/components/table/TableSettingsDialog.d.ts +56 -1
  442. package/components/table/TableSettingsDialog.js +170 -144
  443. package/components/table/TableSettingsDialog.js.map +1 -1
  444. package/components/table/TableSettingsDialogFooter.js +9 -9
  445. package/components/table/TableSettingsDialogFooter.js.map +1 -1
  446. package/components/table/TableSettingsListContainer.d.ts +1 -1
  447. package/components/table/TableSettingsListContainer.js.map +1 -1
  448. package/components/table/TableSettingsListItem.d.ts +1 -1
  449. package/components/table/TableSettingsListItem.js +8 -8
  450. package/components/table/TableSettingsListItem.js.map +1 -1
  451. package/components/table/TableToolbar.js +1 -1
  452. package/components/table/TableToolbar.js.map +1 -1
  453. package/components/table/TableViewToggles.d.ts +21 -1
  454. package/components/table/TableViewToggles.js +1 -1
  455. package/components/table/TableViewToggles.js.map +1 -1
  456. package/components/tag/Tag.d.ts +7 -2
  457. package/components/tag/Tag.js +1 -1
  458. package/components/tag/Tag.js.map +1 -1
  459. package/components/tag/TagList.js +1 -1
  460. package/components/tag/TagList.js.map +1 -1
  461. package/components/tagManager/CustomSuggestionItem.js +1 -1
  462. package/components/tagManager/CustomSuggestionItem.js.map +1 -1
  463. package/components/tagManager/TagManager.d.ts +29 -2
  464. package/components/tagManager/TagManager.js +6 -6
  465. package/components/tagManager/TagManager.js.map +1 -1
  466. package/components/tagManager/TagManagerItemList.d.ts +1 -1
  467. package/components/tagManager/TagManagerItemList.js +1 -1
  468. package/components/tagManager/TagManagerItemList.js.map +1 -1
  469. package/components/teaser/Teaser.d.ts +57 -55
  470. package/components/teaser/Teaser.js +1 -1
  471. package/components/teaser/Teaser.js.map +1 -1
  472. package/components/teaser/TeaserContainer.d.ts +1 -1
  473. package/components/teaser/TeaserContainer.js +1 -1
  474. package/components/teaser/TeaserContainer.js.map +1 -1
  475. package/components/timepicker/TimePicker.d.ts +20 -0
  476. package/components/timepicker/TimePicker.js +153 -99
  477. package/components/timepicker/TimePicker.js.map +1 -1
  478. package/components/tooltip/SimpleTooltip.d.ts +22 -4
  479. package/components/tooltip/SimpleTooltip.js.map +1 -1
  480. package/components/tooltip/Tooltip.d.ts +22 -2
  481. package/components/tooltip/Tooltip.js +1 -1
  482. package/components/tooltip/Tooltip.js.map +1 -1
  483. package/components/tracker/Tracker.d.ts +85 -0
  484. package/components/tracker/Tracker.js +54 -0
  485. package/components/tracker/Tracker.js.map +1 -0
  486. package/components/tracker/TrackerBlock.d.ts +11 -0
  487. package/components/tracker/TrackerBlock.js +34 -0
  488. package/components/tracker/TrackerBlock.js.map +1 -0
  489. package/components/video/ResponsiveVideo.d.ts +8 -3
  490. package/components/video/ResponsiveVideo.js +1 -1
  491. package/components/video/ResponsiveVideo.js.map +1 -1
  492. package/hooks/useCookies.d.ts +79 -0
  493. package/hooks/useCookies.js +33 -0
  494. package/hooks/useCookies.js.map +1 -0
  495. package/hooks/useInterval.js +5 -5
  496. package/hooks/useInterval.js.map +1 -1
  497. package/hooks/useIsFocusWithin.js +3 -3
  498. package/hooks/useIsFocusWithin.js.map +1 -1
  499. package/hooks/useKey.d.ts +1 -1
  500. package/hooks/useKey.js.map +1 -1
  501. package/hooks/useLatest.d.ts +16 -0
  502. package/hooks/useLatest.js +11 -0
  503. package/hooks/useLatest.js.map +1 -0
  504. package/hooks/useOnboarding.d.ts +86 -80
  505. package/hooks/useOnboarding.js.map +1 -1
  506. package/hooks/usePostMessage.d.ts +2 -1
  507. package/hooks/usePostMessage.js.map +1 -1
  508. package/hooks/useRioCookieConsent.d.ts +49 -0
  509. package/hooks/useRioCookieConsent.js +44 -0
  510. package/hooks/useRioCookieConsent.js.map +1 -0
  511. package/hooks/useSearch.d.ts +1 -1
  512. package/hooks/useSearch.js +28 -17
  513. package/hooks/useSearch.js.map +1 -1
  514. package/hooks/useSearchHighlight.d.ts +60 -0
  515. package/hooks/useSearchHighlight.js +54 -0
  516. package/hooks/useSearchHighlight.js.map +1 -0
  517. package/hooks/useTableExport.js.map +1 -1
  518. package/hooks/useTimeout.js +11 -11
  519. package/hooks/useTimeout.js.map +1 -1
  520. package/hooks/useUncontrollable.d.ts +1 -1
  521. package/hooks/useUncontrollable.js.map +1 -1
  522. package/hooks/useUrlState.d.ts +62 -0
  523. package/hooks/useUrlState.js +137 -0
  524. package/hooks/useUrlState.js.map +1 -0
  525. package/mergeClassNameOverrides.d.ts +1 -0
  526. package/mergeClassNameOverrides.js +5 -0
  527. package/mergeClassNameOverrides.js.map +1 -0
  528. package/package.json +18 -21
  529. package/routeUtils.js +11 -5
  530. package/routeUtils.js.map +1 -1
  531. package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +1 -1
  532. package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js.map +1 -1
  533. package/useCookies.d.ts +2 -0
  534. package/useCookies.js +5 -0
  535. package/useCookies.js.map +1 -0
  536. package/useRioCookieConsent.d.ts +2 -0
  537. package/useRioCookieConsent.js +5 -0
  538. package/useRioCookieConsent.js.map +1 -0
  539. package/useSearchHighlight.d.ts +2 -0
  540. package/useSearchHighlight.js +6 -0
  541. package/useSearchHighlight.js.map +1 -0
  542. package/useUrlState.d.ts +2 -0
  543. package/useUrlState.js +5 -0
  544. package/useUrlState.js.map +1 -0
  545. package/utils/classNames.d.ts +3 -0
  546. package/utils/classNames.js +5 -0
  547. package/utils/classNames.js.map +1 -0
  548. package/utils/colorScheme.js +14 -13
  549. package/utils/colorScheme.js.map +1 -1
  550. package/utils/cssuseragent.js.map +1 -1
  551. package/utils/mergeClassNameOverrides.d.ts +1 -0
  552. package/utils/mergeClassNameOverrides.js +55 -0
  553. package/utils/mergeClassNameOverrides.js.map +1 -0
  554. package/utils/routeUtils.d.ts +122 -13
  555. package/utils/routeUtils.js +89 -31
  556. package/utils/routeUtils.js.map +1 -1
  557. package/utils/scrollItemIntoView.js +12 -11
  558. package/utils/scrollItemIntoView.js.map +1 -1
  559. package/utils/urlFeatureToggles.js +19 -20
  560. package/utils/urlFeatureToggles.js.map +1 -1
  561. package/version.d.ts +1 -1
  562. package/version.js +1 -1
  563. package/version.js.map +1 -1
  564. package/components/states/BaseStateProps.d.ts +0 -66
  565. package/components/statusBar/StatusBar.types.d.ts +0 -85
  566. package/components/table/TableSettingsDialog.types.d.ts +0 -39
  567. package/components/tagManager/TagManagerTag.d.ts +0 -5
@@ -1 +1 @@
1
- {"version":3,"file":"RuleConnector.js","sources":["../../../src/components/rules/RuleConnector.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react';\nimport classNames from 'classnames';\n\nconst getBorderColorFromBg = (bg: string) => bg.replace('bg', 'border-color');\n\nconst commonRoundedClasses = classNames(\n 'width-20',\n 'height-20',\n 'rounded-circle',\n 'position-relative',\n 'z-index-2',\n 'box-sizing-content-box'\n);\n\nconst commonRoundedBorderClippingClasses = classNames('position-relative', 'width-20', 'height-20');\n\nexport type RuleConnectorProps = {\n /**\n * The placement for the connector.\n *\n * Possible values are `start`, `center` and `end`.\n *\n * @default 'center'\n */\n placement?: 'start' | 'center' | 'end';\n\n /**\n * The rioglyph icon name.\n *\n * @default 'rioglyph-plus'\n */\n icon?: string;\n\n /**\n * Defines whether the connector is shown.\n *\n * @default false\n */\n hidden?: boolean;\n\n /**\n * Background color of the connector itself.\n *\n * @default 'bg-lightest'\n */\n background?: string;\n\n /**\n * Background color of the surrounding area where the rule containers are placed.\n *\n * @default 'bg-white'\n */\n pageBackground?: string;\n\n /**\n * Classes to be set on the connector content.\n *\n * @default 'text-color-light'\n */\n contentClassName?: string;\n\n /**\n * Defines whether the connector has a border.\n *\n * @default false\n */\n hasBorder?: boolean;\n\n /**\n * The border color class name.\n */\n borderColor?: string;\n\n /**\n * Additional classes for the wrapper element.\n */\n className?: string;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'className'>;\n\nconst RuleConnector = (props: PropsWithChildren<RuleConnectorProps>) => {\n const {\n placement = 'center',\n icon = 'rioglyph-plus',\n hidden = false,\n background = 'bg-lightest',\n pageBackground = 'bg-white',\n contentClassName = 'text-color-light',\n hasBorder = false,\n borderColor = '',\n className = '',\n children,\n ...remainingProps\n } = props;\n\n const wrapperClassNames = classNames(\n 'RuleConnector',\n 'height-20',\n 'display-flex',\n `justify-content-${placement}`,\n 'align-items-center',\n 'position-relative',\n hidden && 'opacity-0',\n className\n );\n\n const leftRoundedBox = classNames(\n 'margin-right--10',\n commonRoundedClasses,\n pageBackground,\n hasBorder && `border ${borderColor}`\n );\n\n const leftRoundedBoxBorderClipping = classNames('right-50pct', commonRoundedBorderClippingClasses, pageBackground);\n\n const contentWrapperClassNames = classNames(\n 'padding-left-20 padding-right-20',\n 'z-index-1',\n background,\n hasBorder && `border ${getBorderColorFromBg(background)}`\n );\n\n const rightRoundedBox = classNames(\n 'margin-left--10',\n commonRoundedClasses,\n pageBackground,\n hasBorder && `border ${borderColor}`\n );\n\n const rightRoundedBoxBorderClipping = classNames('left-50pct', commonRoundedBorderClippingClasses, pageBackground);\n\n return (\n <div data-testid='ruleConnector' {...remainingProps} className={wrapperClassNames}>\n <div className={leftRoundedBox}>\n <div className={leftRoundedBoxBorderClipping} />\n </div>\n <span className={contentWrapperClassNames}>\n <span className={contentClassName}>\n {children ? children : <span className={`rioglyph ${icon}`} data-testid='ruleConnectorIcon' />}\n </span>\n </span>\n <div className={rightRoundedBox}>\n <div className={rightRoundedBoxBorderClipping} />\n </div>\n </div>\n );\n};\n\nRuleConnector.START = 'start';\nRuleConnector.CENTER = 'center';\nRuleConnector.END = 'end';\n\nexport default RuleConnector;\n"],"names":["getBorderColorFromBg","bg","commonRoundedClasses","classNames","commonRoundedBorderClippingClasses","RuleConnector","props","placement","icon","hidden","background","pageBackground","contentClassName","hasBorder","borderColor","className","children","remainingProps","wrapperClassNames","leftRoundedBox","leftRoundedBoxBorderClipping","contentWrapperClassNames","rightRoundedBox","rightRoundedBoxBorderClipping","jsx"],"mappings":";;AAGA,MAAMA,IAAuB,CAACC,MAAeA,EAAG,QAAQ,MAAM,cAAc,GAEtEC,IAAuBC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAEMC,IAAqCD,EAAW,qBAAqB,YAAY,WAAW,GAiE5FE,IAAgB,CAACC,MAAiD;AACpE,QAAM;AAAA,IACF,WAAAC,IAAY;AAAA,IACZ,MAAAC,IAAO;AAAA,IACP,QAAAC,IAAS;AAAA,IACT,YAAAC,IAAa;AAAA,IACb,gBAAAC,IAAiB;AAAA,IACjB,kBAAAC,IAAmB;AAAA,IACnB,WAAAC,IAAY;AAAA,IACZ,aAAAC,IAAc;AAAA,IACd,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHX,GAEEY,IAAoBf;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAmBI,CAAS;AAAA,IAC5B;AAAA,IACA;AAAA,IACAE,KAAU;AAAA,IACVM;AAAA,EAAA,GAGEI,IAAiBhB;AAAA,IACnB;AAAA,IACAD;AAAA,IACAS;AAAA,IACAE,KAAa,UAAUC,CAAW;AAAA,EAAA,GAGhCM,IAA+BjB,EAAW,eAAeC,GAAoCO,CAAc,GAE3GU,IAA2BlB;AAAA,IAC7B;AAAA,IACA;AAAA,IACAO;AAAA,IACAG,KAAa,UAAUb,EAAqBU,CAAU,CAAC;AAAA,EAAA,GAGrDY,IAAkBnB;AAAA,IACpB;AAAA,IACAD;AAAA,IACAS;AAAA,IACAE,KAAa,UAAUC,CAAW;AAAA,EAAA,GAGhCS,IAAgCpB,EAAW,cAAcC,GAAoCO,CAAc;AAEjH,2BACK,OAAA,EAAI,eAAY,iBAAiB,GAAGM,GAAgB,WAAWC,GAC5D,UAAA;AAAA,IAAA,gBAAAM,EAAC,SAAI,WAAWL,GACZ,4BAAC,OAAA,EAAI,WAAWC,GAA8B,EAAA,CAClD;AAAA,sBACC,QAAA,EAAK,WAAWC,GACb,UAAA,gBAAAG,EAAC,QAAA,EAAK,WAAWZ,GACZ,UAAAI,KAAsB,gBAAAQ,EAAC,QAAA,EAAK,WAAW,YAAYhB,CAAI,IAAI,eAAY,qBAAoB,GAChG,EAAA,CACJ;AAAA,IACA,gBAAAgB,EAAC,SAAI,WAAWF,GACZ,4BAAC,OAAA,EAAI,WAAWC,GAA+B,EAAA,CACnD;AAAA,EAAA,GACJ;AAER;AAEAlB,EAAc,QAAQ;AACtBA,EAAc,SAAS;AACvBA,EAAc,MAAM;"}
1
+ {"version":3,"file":"RuleConnector.js","sources":["../../../src/components/rules/RuleConnector.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nconst getBorderColorFromBg = (bg: string) => bg.replace('bg', 'border-color');\n\nconst commonRoundedClasses = classNames(\n 'width-20',\n 'height-20',\n 'rounded-circle',\n 'position-relative',\n 'z-index-2',\n 'box-sizing-content-box'\n);\n\nconst commonRoundedBorderClippingClasses = classNames('position-relative', 'width-20', 'height-20');\n\nexport type RuleConnectorProps = {\n /**\n * The placement for the connector.\n *\n * Possible values are `start`, `center` and `end`.\n *\n * @default 'center'\n */\n placement?: 'start' | 'center' | 'end';\n\n /**\n * The rioglyph icon name.\n *\n * @default 'rioglyph-plus'\n */\n icon?: string;\n\n /**\n * Defines whether the connector is shown.\n *\n * @default false\n */\n hidden?: boolean;\n\n /**\n * Background color of the connector itself.\n *\n * @default 'bg-lightest'\n */\n background?: string;\n\n /**\n * Background color of the surrounding area where the rule containers are placed.\n *\n * @default 'bg-white'\n */\n pageBackground?: string;\n\n /**\n * Classes to be set on the connector content.\n *\n * @default 'text-color-light'\n */\n contentClassName?: string;\n\n /**\n * Defines whether the connector has a border.\n *\n * @default false\n */\n hasBorder?: boolean;\n\n /**\n * The border color class name.\n */\n borderColor?: string;\n\n /**\n * Additional classes for the wrapper element.\n */\n className?: string;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'className'>;\n\nconst RuleConnector = (props: PropsWithChildren<RuleConnectorProps>) => {\n const {\n placement = 'center',\n icon = 'rioglyph-plus',\n hidden = false,\n background = 'bg-lightest',\n pageBackground = 'bg-white',\n contentClassName = 'text-color-light',\n hasBorder = false,\n borderColor = '',\n className = '',\n children,\n ...remainingProps\n } = props;\n\n const wrapperClassNames = classNames(\n 'RuleConnector',\n 'height-20',\n 'display-flex',\n `justify-content-${placement}`,\n 'align-items-center',\n 'position-relative',\n hidden && 'opacity-0',\n className\n );\n\n const leftRoundedBox = classNames(\n 'margin-right--10',\n commonRoundedClasses,\n pageBackground,\n hasBorder && `border ${borderColor}`\n );\n\n const leftRoundedBoxBorderClipping = classNames('right-50pct', commonRoundedBorderClippingClasses, pageBackground);\n\n const contentWrapperClassNames = classNames(\n 'padding-left-20 padding-right-20',\n 'z-index-1',\n background,\n hasBorder && `border ${getBorderColorFromBg(background)}`\n );\n\n const rightRoundedBox = classNames(\n 'margin-left--10',\n commonRoundedClasses,\n pageBackground,\n hasBorder && `border ${borderColor}`\n );\n\n const rightRoundedBoxBorderClipping = classNames('left-50pct', commonRoundedBorderClippingClasses, pageBackground);\n\n return (\n <div data-testid='ruleConnector' {...remainingProps} className={wrapperClassNames}>\n <div className={leftRoundedBox}>\n <div className={leftRoundedBoxBorderClipping} />\n </div>\n <span className={contentWrapperClassNames}>\n <span className={contentClassName}>\n {children ? children : <span className={`rioglyph ${icon}`} data-testid='ruleConnectorIcon' />}\n </span>\n </span>\n <div className={rightRoundedBox}>\n <div className={rightRoundedBoxBorderClipping} />\n </div>\n </div>\n );\n};\n\nRuleConnector.START = 'start';\nRuleConnector.CENTER = 'center';\nRuleConnector.END = 'end';\n\nexport default RuleConnector;\n"],"names":["getBorderColorFromBg","bg","commonRoundedClasses","classNames","commonRoundedBorderClippingClasses","RuleConnector","props","placement","icon","hidden","background","pageBackground","contentClassName","hasBorder","borderColor","className","children","remainingProps","wrapperClassNames","leftRoundedBox","leftRoundedBoxBorderClipping","contentWrapperClassNames","rightRoundedBox","rightRoundedBoxBorderClipping","jsx"],"mappings":";;AAIA,MAAMA,IAAuB,CAACC,MAAeA,EAAG,QAAQ,MAAM,cAAc,GAEtEC,IAAuBC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAEMC,IAAqCD,EAAW,qBAAqB,YAAY,WAAW,GAiE5FE,IAAgB,CAACC,MAAiD;AACpE,QAAM;AAAA,IACF,WAAAC,IAAY;AAAA,IACZ,MAAAC,IAAO;AAAA,IACP,QAAAC,IAAS;AAAA,IACT,YAAAC,IAAa;AAAA,IACb,gBAAAC,IAAiB;AAAA,IACjB,kBAAAC,IAAmB;AAAA,IACnB,WAAAC,IAAY;AAAA,IACZ,aAAAC,IAAc;AAAA,IACd,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHX,GAEEY,IAAoBf;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAmBI,CAAS;AAAA,IAC5B;AAAA,IACA;AAAA,IACAE,KAAU;AAAA,IACVM;AAAA,EAAA,GAGEI,IAAiBhB;AAAA,IACnB;AAAA,IACAD;AAAA,IACAS;AAAA,IACAE,KAAa,UAAUC,CAAW;AAAA,EAAA,GAGhCM,IAA+BjB,EAAW,eAAeC,GAAoCO,CAAc,GAE3GU,IAA2BlB;AAAA,IAC7B;AAAA,IACA;AAAA,IACAO;AAAA,IACAG,KAAa,UAAUb,EAAqBU,CAAU,CAAC;AAAA,EAAA,GAGrDY,IAAkBnB;AAAA,IACpB;AAAA,IACAD;AAAA,IACAS;AAAA,IACAE,KAAa,UAAUC,CAAW;AAAA,EAAA,GAGhCS,IAAgCpB,EAAW,cAAcC,GAAoCO,CAAc;AAEjH,2BACK,OAAA,EAAI,eAAY,iBAAiB,GAAGM,GAAgB,WAAWC,GAC5D,UAAA;AAAA,IAAA,gBAAAM,EAAC,SAAI,WAAWL,GACZ,4BAAC,OAAA,EAAI,WAAWC,GAA8B,EAAA,CAClD;AAAA,sBACC,QAAA,EAAK,WAAWC,GACb,UAAA,gBAAAG,EAAC,QAAA,EAAK,WAAWZ,GACZ,UAAAI,KAAsB,gBAAAQ,EAAC,QAAA,EAAK,WAAW,YAAYhB,CAAI,IAAI,eAAY,qBAAoB,GAChG,EAAA,CACJ;AAAA,IACA,gBAAAgB,EAAC,SAAI,WAAWF,GACZ,4BAAC,OAAA,EAAI,WAAWC,GAA+B,EAAA,CACnD;AAAA,EAAA,GACJ;AAER;AAEAlB,EAAc,QAAQ;AACtBA,EAAc,SAAS;AACvBA,EAAc,MAAM;"}
@@ -1,50 +1,50 @@
1
- import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
- import { Children as f } from "react";
3
- import C from "classnames";
4
- import { AnimatePresence as b, motion as x } from "motion/react";
5
- import y from "./RuleConnector.js";
6
- const j = (i) => {
1
+ import { jsxs as k, jsx as n } from "react/jsx-runtime";
2
+ import { Children as x, isValidElement as N } from "react";
3
+ import { AnimatePresence as R, motion as v } from "motion/react";
4
+ import A from "../../utils/classNames.js";
5
+ import w from "./RuleConnector.js";
6
+ const F = (a) => {
7
7
  const {
8
- show: a = !0,
9
- unchecked: o = !1,
8
+ show: l = !0,
9
+ unchecked: r = !1,
10
10
  background: s = "bg-lightest",
11
11
  borderColor: d = "",
12
- hideConnector: l = !1,
13
- customConnector: n,
12
+ hideConnector: c = !1,
13
+ customConnector: o,
14
14
  className: m = "",
15
- children: c,
16
- ...u
17
- } = i;
18
- if (!a)
15
+ children: u,
16
+ ...p
17
+ } = a;
18
+ if (!l)
19
19
  return null;
20
- const p = C(
20
+ const y = A(
21
21
  "RuleContainerBox",
22
22
  "position-relative",
23
23
  "rounded padding-20",
24
24
  s,
25
- o && `border border-width border-style-dashed ${d}`,
25
+ r && `border border-width border-style-dashed ${d}`,
26
26
  m
27
- );
28
- return /* @__PURE__ */ h("div", { className: "RuleContainer", ...u, children: [
29
- /* @__PURE__ */ e("div", { className: p, "data-testid": "ruleContainerBox", children: /* @__PURE__ */ e(b, { mode: "wait", children: f.map(c, (r) => {
30
- if (!r)
27
+ ), t = x.toArray(u).filter(Boolean), h = t.length > 1 ? "sync" : "wait";
28
+ return /* @__PURE__ */ k("div", { className: "RuleContainer", ...p, children: [
29
+ /* @__PURE__ */ n("div", { className: y, "data-testid": "ruleContainerBox", children: /* @__PURE__ */ n(R, { mode: h, children: t.map((e, C) => {
30
+ if (!e)
31
31
  return null;
32
- const t = r;
33
- return /* @__PURE__ */ e(
34
- x.div,
32
+ const i = e, f = N(e) && e.key != null ? String(e.key) : null, b = `${i.type?.name || i.type || "RuleContainerChild"}-${C}`, g = f || b;
33
+ return /* @__PURE__ */ n(
34
+ v.div,
35
35
  {
36
36
  initial: { opacity: 0 },
37
37
  animate: { opacity: 1 },
38
38
  exit: { opacity: 0 },
39
- children: r
39
+ children: e
40
40
  },
41
- t.type?.name || t.type
41
+ g
42
42
  );
43
43
  }) }) }),
44
- n || /* @__PURE__ */ e(y, { hidden: o || l })
44
+ o || /* @__PURE__ */ n(w, { hidden: r || c })
45
45
  ] });
46
46
  };
47
47
  export {
48
- j as default
48
+ F as default
49
49
  };
50
50
  //# sourceMappingURL=RuleContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RuleContainer.js","sources":["../../../src/components/rules/RuleContainer.tsx"],"sourcesContent":["import { Children, type HTMLAttributes, type JSX, type PropsWithChildren } from 'react';\nimport classNames from 'classnames';\nimport { AnimatePresence, motion } from 'motion/react';\n\nimport RuleConnector from './RuleConnector';\n\nexport type RuleContainerProps = {\n /**\n * Defines whether the container is shown.\n *\n * @default true\n */\n show?: boolean;\n\n /**\n * Determines the container style for when no rule option is selected.\n *\n * It also hides the connector in this case.\n *\n * @default false\n */\n unchecked?: boolean;\n\n /**\n * The box background class name.\n *\n * @default 'bg-lightest'\n */\n background?: string;\n\n /**\n * The border color class name.\n */\n borderColor?: string;\n\n /**\n * Defines whether the connector is shown.\n *\n * @default false\n */\n hideConnector?: boolean;\n\n /**\n * Overwrites the default connector.\n */\n customConnector?: string | JSX.Element;\n\n /**\n * Additional classes for the wrapper element.\n */\n className?: string;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'className'>;\n\nconst RuleContainer = (props: PropsWithChildren<RuleContainerProps>) => {\n const {\n show = true,\n unchecked = false,\n background = 'bg-lightest',\n borderColor = '',\n hideConnector = false,\n customConnector,\n className = '',\n children,\n ...remainingProps\n } = props;\n\n if (!show) {\n return null;\n }\n\n const boxClassNames = classNames(\n 'RuleContainerBox',\n 'position-relative',\n 'rounded padding-20',\n background,\n unchecked && `border border-width border-style-dashed ${borderColor}`,\n className\n );\n\n return (\n <div className='RuleContainer' {...remainingProps}>\n <div className={boxClassNames} data-testid='ruleContainerBox'>\n <AnimatePresence mode='wait'>\n {Children.map(children, child => {\n if (!child) {\n return null;\n }\n\n // just bending the type system a bit so that it matches the existing implementation :)\n const childAsElement = child as unknown as { type: string & { name: string } };\n\n // In case there are multiple children of RuleContainer, use the\n // type name or the type itself as a key to animate between the two children\n return (\n <motion.div\n key={childAsElement.type?.name || childAsElement.type}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n >\n {child}\n </motion.div>\n );\n })}\n </AnimatePresence>\n </div>\n {customConnector ? customConnector : <RuleConnector hidden={unchecked || hideConnector} />}\n </div>\n );\n};\n\nexport default RuleContainer;\n"],"names":["RuleContainer","props","show","unchecked","background","borderColor","hideConnector","customConnector","className","children","remainingProps","boxClassNames","classNames","jsxs","jsx","AnimatePresence","Children","child","childAsElement","motion","RuleConnector"],"mappings":";;;;;AAqDA,MAAMA,IAAgB,CAACC,MAAiD;AACpE,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,WAAAC,IAAY;AAAA,IACZ,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,eAAAC,IAAgB;AAAA,IAChB,iBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHT;AAEJ,MAAI,CAACC;AACD,WAAO;AAGX,QAAMS,IAAgBC;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACAR;AAAA,IACAD,KAAa,2CAA2CE,CAAW;AAAA,IACnEG;AAAA,EAAA;AAGJ,SACI,gBAAAK,EAAC,OAAA,EAAI,WAAU,iBAAiB,GAAGH,GAC/B,UAAA;AAAA,IAAA,gBAAAI,EAAC,OAAA,EAAI,WAAWH,GAAe,eAAY,oBACvC,UAAA,gBAAAG,EAACC,GAAA,EAAgB,MAAK,QACjB,UAAAC,EAAS,IAAIP,GAAU,CAAAQ,MAAS;AAC7B,UAAI,CAACA;AACD,eAAO;AAIX,YAAMC,IAAiBD;AAIvB,aACI,gBAAAH;AAAA,QAACK,EAAO;AAAA,QAAP;AAAA,UAEG,SAAS,EAAE,SAAS,EAAA;AAAA,UACpB,SAAS,EAAE,SAAS,EAAA;AAAA,UACpB,MAAM,EAAE,SAAS,EAAA;AAAA,UAEhB,UAAAF;AAAA,QAAA;AAAA,QALIC,EAAe,MAAM,QAAQA,EAAe;AAAA,MAAA;AAAA,IAQ7D,CAAC,GACL,GACJ;AAAA,IACCX,KAAoC,gBAAAO,EAACM,GAAA,EAAc,QAAQjB,KAAaG,EAAA,CAAe;AAAA,EAAA,GAC5F;AAER;"}
1
+ {"version":3,"file":"RuleContainer.js","sources":["../../../src/components/rules/RuleContainer.tsx"],"sourcesContent":["import { Children, isValidElement, type HTMLAttributes, type JSX, type PropsWithChildren } from 'react';\nimport { AnimatePresence, motion } from 'motion/react';\n\nimport classNames from '../../utils/classNames';\nimport RuleConnector from './RuleConnector';\n\nexport type RuleContainerProps = {\n /**\n * Defines whether the container is shown.\n *\n * @default true\n */\n show?: boolean;\n\n /**\n * Determines the container style for when no rule option is selected.\n *\n * It also hides the connector in this case.\n *\n * @default false\n */\n unchecked?: boolean;\n\n /**\n * The box background class name.\n *\n * @default 'bg-lightest'\n */\n background?: string;\n\n /**\n * The border color class name.\n */\n borderColor?: string;\n\n /**\n * Defines whether the connector is shown.\n *\n * @default false\n */\n hideConnector?: boolean;\n\n /**\n * Overwrites the default connector.\n */\n customConnector?: string | JSX.Element;\n\n /**\n * Additional classes for the wrapper element.\n */\n className?: string;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'className'>;\n\nconst RuleContainer = (props: PropsWithChildren<RuleContainerProps>) => {\n const {\n show = true,\n unchecked = false,\n background = 'bg-lightest',\n borderColor = '',\n hideConnector = false,\n customConnector,\n className = '',\n children,\n ...remainingProps\n } = props;\n\n if (!show) {\n return null;\n }\n\n const boxClassNames = classNames(\n 'RuleContainerBox',\n 'position-relative',\n 'rounded padding-20',\n background,\n unchecked && `border border-width border-style-dashed ${borderColor}`,\n className\n );\n\n const childrenArray = Children.toArray(children).filter(Boolean);\n const animatePresenceMode = childrenArray.length > 1 ? 'sync' : 'wait';\n\n return (\n <div className='RuleContainer' {...remainingProps}>\n <div className={boxClassNames} data-testid='ruleContainerBox'>\n <AnimatePresence mode={animatePresenceMode}>\n {childrenArray.map((child, index) => {\n if (!child) {\n return null;\n }\n\n // just bending the type system a bit so that it matches the existing implementation :)\n const childAsElement = child as unknown as { type: string & { name: string } };\n\n const keyFromChild = isValidElement(child) && child.key != null ? String(child.key) : null;\n const fallbackKey = `${childAsElement.type?.name || childAsElement.type || 'RuleContainerChild'}-${index}`;\n\n const key = keyFromChild || fallbackKey;\n\n // In case there are multiple children of RuleContainer, use the\n // type name or the type itself as a key to animate between the two children\n return (\n <motion.div\n key={key}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n >\n {child}\n </motion.div>\n );\n })}\n </AnimatePresence>\n </div>\n {customConnector ? customConnector : <RuleConnector hidden={unchecked || hideConnector} />}\n </div>\n );\n};\n\nexport default RuleContainer;\n"],"names":["RuleContainer","props","show","unchecked","background","borderColor","hideConnector","customConnector","className","children","remainingProps","boxClassNames","classNames","childrenArray","Children","animatePresenceMode","jsxs","jsx","AnimatePresence","child","index","childAsElement","keyFromChild","isValidElement","fallbackKey","key","motion","RuleConnector"],"mappings":";;;;;AAqDA,MAAMA,IAAgB,CAACC,MAAiD;AACpE,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,WAAAC,IAAY;AAAA,IACZ,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,eAAAC,IAAgB;AAAA,IAChB,iBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHT;AAEJ,MAAI,CAACC;AACD,WAAO;AAGX,QAAMS,IAAgBC;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACAR;AAAA,IACAD,KAAa,2CAA2CE,CAAW;AAAA,IACnEG;AAAA,EAAA,GAGEK,IAAgBC,EAAS,QAAQL,CAAQ,EAAE,OAAO,OAAO,GACzDM,IAAsBF,EAAc,SAAS,IAAI,SAAS;AAEhE,SACI,gBAAAG,EAAC,OAAA,EAAI,WAAU,iBAAiB,GAAGN,GAC/B,UAAA;AAAA,IAAA,gBAAAO,EAAC,OAAA,EAAI,WAAWN,GAAe,eAAY,oBACvC,UAAA,gBAAAM,EAACC,GAAA,EAAgB,MAAMH,GAClB,UAAAF,EAAc,IAAI,CAACM,GAAOC,MAAU;AACjC,UAAI,CAACD;AACD,eAAO;AAIX,YAAME,IAAiBF,GAEjBG,IAAeC,EAAeJ,CAAK,KAAKA,EAAM,OAAO,OAAO,OAAOA,EAAM,GAAG,IAAI,MAChFK,IAAc,GAAGH,EAAe,MAAM,QAAQA,EAAe,QAAQ,oBAAoB,IAAID,CAAK,IAElGK,IAAMH,KAAgBE;AAI5B,aACI,gBAAAP;AAAA,QAACS,EAAO;AAAA,QAAP;AAAA,UAEG,SAAS,EAAE,SAAS,EAAA;AAAA,UACpB,SAAS,EAAE,SAAS,EAAA;AAAA,UACpB,MAAM,EAAE,SAAS,EAAA;AAAA,UAEhB,UAAAP;AAAA,QAAA;AAAA,QALIM;AAAA,MAAA;AAAA,IAQjB,CAAC,GACL,GACJ;AAAA,IACClB,KAAoC,gBAAAU,EAACU,GAAA,EAAc,QAAQxB,KAAaG,EAAA,CAAe;AAAA,EAAA,GAC5F;AAER;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { motion as e, AnimatePresence as r } from "motion/react";
3
3
  const n = ({ children: o, ...t }) => (
4
- // @ts-ignore-next-line
4
+ // @ts-expect-error-next-line
5
5
  /* @__PURE__ */ i(e.div, { initial: !1, layout: !0, ...t, children: /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(e.div, { layout: "position", children: o }) }) })
6
6
  );
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"RulesWrapper.js","sources":["../../../src/components/rules/RulesWrapper.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react';\nimport { AnimatePresence, motion } from 'motion/react';\n\ntype RulesWrapperProps = HTMLAttributes<HTMLDivElement>;\n\nconst RulesWrapper = ({ children, ...remainingProps }: PropsWithChildren<RulesWrapperProps>) => (\n // @ts-ignore-next-line\n <motion.div initial={false} layout {...remainingProps}>\n {/* @ts-ignore-next-line */}\n <AnimatePresence>\n <motion.div layout='position'>{children}</motion.div>\n </AnimatePresence>\n </motion.div>\n);\n\nexport default RulesWrapper;\n"],"names":["RulesWrapper","children","remainingProps","jsx","motion","AnimatePresence"],"mappings":";;AAKA,MAAMA,IAAe,CAAC,EAAE,UAAAC,GAAU,GAAGC,EAAA;AAAA;AAAA,EAEjC,gBAAAC,EAACC,EAAO,KAAP,EAAW,SAAS,IAAO,QAAM,IAAE,GAAGF,GAEnC,4BAACG,GAAA,EACG,UAAA,gBAAAF,EAACC,EAAO,KAAP,EAAW,QAAO,YAAY,UAAAH,GAAS,GAC5C,EAAA,CACJ;AAAA;"}
1
+ {"version":3,"file":"RulesWrapper.js","sources":["../../../src/components/rules/RulesWrapper.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react';\nimport { AnimatePresence, motion } from 'motion/react';\n\ntype RulesWrapperProps = HTMLAttributes<HTMLDivElement>;\n\nconst RulesWrapper = ({ children, ...remainingProps }: PropsWithChildren<RulesWrapperProps>) => (\n // @ts-expect-error-next-line\n <motion.div initial={false} layout {...remainingProps}>\n <AnimatePresence>\n <motion.div layout='position'>{children}</motion.div>\n </AnimatePresence>\n </motion.div>\n);\n\nexport default RulesWrapper;\n"],"names":["RulesWrapper","children","remainingProps","jsx","motion","AnimatePresence"],"mappings":";;AAKA,MAAMA,IAAe,CAAC,EAAE,UAAAC,GAAU,GAAGC,EAAA;AAAA;AAAA,EAEjC,gBAAAC,EAACC,EAAO,KAAP,EAAW,SAAS,IAAO,QAAM,IAAE,GAAGF,GACnC,4BAACG,GAAA,EACG,UAAA,gBAAAF,EAACC,EAAO,KAAP,EAAW,QAAO,YAAY,UAAAH,GAAS,GAC5C,EAAA,CACJ;AAAA;"}
@@ -18,15 +18,20 @@ export type SaveableDateInputProps = {
18
18
  */
19
19
  isValid?: boolean;
20
20
  /**
21
- * This is the error message that is shown below the input. It uses the built-in error handling, and will be shown when the "isValid" prop is set to false.
21
+ * This is the error message that is shown below the input. It uses the built-in error handling,
22
+ * and will be shown when the "isValid" prop is set to false.
22
23
  */
23
24
  errorMessage?: string | React.ReactNode;
24
25
  /**
25
- * Defines wether the error icon is shown or not. If enabled, it will be shown when the "isValid" prop is set to false.
26
+ * Defines wether the error icon is shown or not. If enabled, it will be shown when the "isValid" prop
27
+ * is set to false.
28
+ *
29
+ * @default false
26
30
  */
27
31
  hideErrorIcon?: boolean;
28
32
  /**
29
33
  * Callback function triggered when the value changes and is saved.
34
+ *
30
35
  * @param value
31
36
  * @param previousValue
32
37
  * @returns
@@ -35,6 +40,7 @@ export type SaveableDateInputProps = {
35
40
  /**
36
41
  * Callback function that gets triggered on every input change. Use this to control the component
37
42
  * or when implementing key validation.
43
+ *
38
44
  * @param keyValue the key value that has been entered
39
45
  * @returns
40
46
  */
@@ -42,11 +48,13 @@ export type SaveableDateInputProps = {
42
48
  /**
43
49
  * Callback function that gets triggered when the input is in edit mode. Use this
44
50
  * to control the component and to handle the previous value on the outside.
51
+ *
45
52
  * @returns
46
53
  */
47
54
  onEnterEdit?: () => void;
48
55
  /**
49
56
  * Callback function that gets triggered when edit mode is exited (either saved or cancelled).
57
+ *
50
58
  * @param wasSaved - true if value was saved, false if cancelled/reset
51
59
  * @returns
52
60
  */
@@ -54,6 +62,7 @@ export type SaveableDateInputProps = {
54
62
  /**
55
63
  * Callback function that gets triggered when the user aborts the edit mode. Use this
56
64
  * to control the component and handle the resetting of previous value on the outside.
65
+ *
57
66
  * @returns
58
67
  */
59
68
  onCancel?: () => void;
@@ -67,15 +76,24 @@ export type SaveableDateInputProps = {
67
76
  invalidExitBehavior?: 'stay-open' | 'reset-and-close';
68
77
  /**
69
78
  * Defines the button style: `default` or `primary`.
79
+ *
80
+ * @default 'primary'
70
81
  */
71
82
  buttonStyle?: 'primary' | 'default';
72
83
  /**
73
84
  * Additional HTML attributes to be set on the input element.
74
85
  */
75
86
  inputProps?: HTMLAttributes<HTMLInputElement>;
87
+ /**
88
+ * Additional props passed to the underlying DatePicker component.
89
+ *
90
+ * @default {}
91
+ */
76
92
  datePickerProps?: DatePickerProps;
77
93
  /**
78
94
  * Disables the component so the user cannot enter the edit mode.
95
+ *
96
+ * @default false
79
97
  */
80
98
  disabled?: boolean;
81
99
  /**
@@ -1,7 +1,7 @@
1
1
  import { jsxs as N, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as r, useRef as f } from "react";
3
- import h from "classnames";
4
3
  import { noop as l } from "es-toolkit/function";
4
+ import h from "../../utils/classNames.js";
5
5
  import X from "../button/Button.js";
6
6
  import Z from "../datepicker/DatePicker.js";
7
7
  import $ from "../../hooks/useIsFocusWithin.js";
@@ -1 +1 @@
1
- {"version":3,"file":"SaveableDateInput.js","sources":["../../../src/components/saveableInput/SaveableDateInput.tsx"],"sourcesContent":["import { useRef, useState, type HTMLAttributes, type CSSProperties } from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/function';\nimport type { Moment } from 'moment';\n\nimport Button from '../../Button';\nimport DatePicker, { type DatePickerProps } from '../datepicker/DatePicker';\nimport useIsFocusWithin from '../../hooks/useIsFocusWithin';\nimport useEsc from '../../hooks/useEsc';\n\nconst DEFAULT_BUTTON_STYLE = 'primary';\n\nexport type SaveableDateInputProps = {\n /**\n * The input placeholder.\n */\n placeholder?: string;\n\n /**\n * The actual input value.\n */\n value?: Date | Moment | string;\n\n /**\n * Used to control the save button from the outside to disable it in case\n * the entered value is not valid.\n *\n * @default true\n */\n isValid?: boolean;\n\n /**\n * This is the error message that is shown below the input. It uses the built-in error handling, and will be shown when the \"isValid\" prop is set to false.\n */\n errorMessage?: string | React.ReactNode;\n\n /**\n * Defines wether the error icon is shown or not. If enabled, it will be shown when the \"isValid\" prop is set to false.\n */\n hideErrorIcon?: boolean;\n\n /**\n * Callback function triggered when the value changes and is saved.\n * @param value\n * @param previousValue\n * @returns\n */\n onValueChanged?: (value: Moment | string, previousValue: Moment | string | Date) => void;\n\n /**\n * Callback function that gets triggered on every input change. Use this to control the component\n * or when implementing key validation.\n * @param keyValue the key value that has been entered\n * @returns\n */\n onInputChange?: (value: Moment | string, isValid: boolean) => void;\n\n /**\n * Callback function that gets triggered when the input is in edit mode. Use this\n * to control the component and to handle the previous value on the outside.\n * @returns\n */\n onEnterEdit?: () => void;\n\n /**\n * Callback function that gets triggered when edit mode is exited (either saved or cancelled).\n * @param wasSaved - true if value was saved, false if cancelled/reset\n * @returns\n */\n onExitEdit?: (wasSaved: boolean) => void;\n\n /**\n * Callback function that gets triggered when the user aborts the edit mode. Use this\n * to control the component and handle the resetting of previous value on the outside.\n * @returns\n */\n onCancel?: () => void;\n\n /**\n * Behavior when trying to exit edit mode with invalid input:\n * - 'stay-open': Keep edit mode open until valid input is provided\n * - 'reset-and-close': Close edit mode and reset to initial value\n *\n * @default 'stay-open'\n */\n invalidExitBehavior?: 'stay-open' | 'reset-and-close';\n\n /**\n * Defines the button style: `default` or `primary`.\n */\n buttonStyle?: 'primary' | 'default';\n\n /**\n * Additional HTML attributes to be set on the input element.\n */\n inputProps?: HTMLAttributes<HTMLInputElement>;\n\n datePickerProps?: DatePickerProps;\n\n /**\n * Disables the component so the user cannot enter the edit mode.\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the input itself.\n */\n inputClassName?: string;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n};\n\n// Validate date outside the component (via form library) if controlled usage\n// Use as controlled component: value, is Valid, and change callback\n// - if is valid, on save, call callback \"onValueChanged\"\n// - if not valid, keep edit mode open, outside is showing error message\n// - close edit mode only if date is valid - or close edit mode and reset to initial value -> customizable via prop\n// Keep picker open until user has clicked save, otherwise he might forget to click save if the dropdown closes automatically\n\nconst SaveableDateInput = (props: SaveableDateInputProps) => {\n const {\n placeholder,\n value: externalValue = '',\n isValid = true,\n errorMessage,\n hideErrorIcon = false,\n onValueChanged = noop,\n onInputChange, // for controlled usage\n onEnterEdit = noop,\n onExitEdit = noop,\n onCancel = noop,\n buttonStyle = DEFAULT_BUTTON_STYLE,\n inputClassName,\n inputProps,\n invalidExitBehavior = 'stay-open',\n datePickerProps = {},\n disabled = false,\n className,\n ...remainingProps\n } = props;\n\n // if callback is provided, assume it is controlled case\n const isControlledCase = onInputChange !== undefined;\n\n const [inputValue, setInputValue] = useState<Date | Moment | string>(externalValue);\n\n const [editInput, setEditInput] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n const initialInputValueRef = useRef(inputValue);\n\n useIsFocusWithin({\n ref: wrapperRef,\n onFocusWithin: () => {\n setIsFocused(true);\n },\n onBlurWithin: () => {\n setIsFocused(false);\n },\n });\n\n // Handle escape key to cancel edit mode\n useEsc(() => {\n if (isFocused && editInput) {\n handleCancelEdit();\n }\n });\n\n // Update internal state in a controlled environment\n const [previousExternalValue, setPreviousExternalValue] = useState(externalValue);\n if (previousExternalValue !== externalValue) {\n setInputValue(externalValue);\n setPreviousExternalValue(externalValue);\n // Update initial value ref when external value changes while not in edit mode\n if (!editInput) {\n initialInputValueRef.current = externalValue;\n }\n }\n\n const handleToggleInput = () => {\n if (!editInput) {\n // Enter edit mode\n setEditInput(true);\n initialInputValueRef.current = inputValue;\n\n // open the dropdown\n setIsPickerOpen(true);\n\n onEnterEdit();\n } else {\n // Try to exit edit mode\n handleSaveAttempt();\n }\n };\n\n const handleSaveAttempt = () => {\n if (isValid) {\n // Save the value (only if valid)\n setEditInput(false);\n onValueChanged(inputValue as Moment | string, initialInputValueRef.current);\n onExitEdit(true);\n\n // close the dropdown\n setIsPickerOpen(false);\n } else {\n // Handle invalid input based on behavior setting\n if (invalidExitBehavior === 'reset-and-close') {\n handleCancelEdit();\n }\n // If 'stay-open', do nothing - keep edit mode open\n }\n };\n\n const handleCancelEdit = () => {\n setEditInput(false);\n\n // Reset to initial value\n if (isControlledCase) {\n // In controlled mode, trigger change to reset to initial value\n onInputChange(initialInputValueRef.current as Moment | string, true);\n } else {\n setInputValue(initialInputValueRef.current);\n }\n\n // Close the dropdown\n setIsPickerOpen(false);\n\n onCancel();\n onExitEdit(false);\n };\n\n const handleDateChange = (value: Moment | string, isValid: boolean) => {\n if (isControlledCase) {\n onInputChange(value, isValid);\n } else {\n setInputValue(value);\n }\n };\n\n const handleCloseDropdown = () => setIsPickerOpen(false);\n\n const wrapperClasses = classNames('form-group', !isValid && 'has-feedback has-error', className);\n\n const buttonIconClasses = classNames('rioglyph', editInput ? 'rioglyph-ok' : 'rioglyph-pencil');\n\n const dateInputClasses = classNames('margin-0 width-100pct', inputClassName);\n\n // Button should be disabled if:\n // - Component is disabled, OR\n // - In edit mode and invalid input (and behavior is stay-open)\n const disableButton = disabled || (editInput && !isValid && invalidExitBehavior === 'stay-open');\n\n let inputStyle: CSSProperties = {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n };\n\n if (!isValid && hideErrorIcon) {\n // If the error icon shall not be shown, remove the input padding to avoid cutting of the date value\n inputStyle = { ...inputStyle, paddingRight: '10px' };\n }\n\n return (\n <div ref={wrapperRef} {...remainingProps} className={wrapperClasses}>\n <div className='input-group'>\n <DatePicker\n {...{ ...datePickerProps, open: isPickerOpen }}\n className={dateInputClasses}\n inputProps={{\n ...inputProps,\n placeholder,\n disabled: !editInput,\n style: inputStyle,\n }}\n value={inputValue}\n onChange={handleDateChange}\n onClose={handleCloseDropdown}\n />\n {!isValid && !hideErrorIcon && (\n <span className='right-25 margin-right-10 form-control-feedback rioglyph rioglyph-error-sign' />\n )}\n <div className='input-group-btn'>\n <Button\n ref={buttonRef}\n bsStyle={buttonStyle}\n iconOnly\n onClick={handleToggleInput}\n disabled={disableButton}\n >\n <span className={buttonIconClasses} />\n </Button>\n </div>\n </div>\n {!isValid && errorMessage && (\n <span className='help-block z-index-max'>\n <span>{errorMessage}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default SaveableDateInput;\n"],"names":["DEFAULT_BUTTON_STYLE","SaveableDateInput","props","placeholder","externalValue","isValid","errorMessage","hideErrorIcon","onValueChanged","noop","onInputChange","onEnterEdit","onExitEdit","onCancel","buttonStyle","inputClassName","inputProps","invalidExitBehavior","datePickerProps","disabled","className","remainingProps","isControlledCase","inputValue","setInputValue","useState","editInput","setEditInput","isFocused","setIsFocused","isPickerOpen","setIsPickerOpen","wrapperRef","useRef","buttonRef","initialInputValueRef","useIsFocusWithin","useEsc","handleCancelEdit","previousExternalValue","setPreviousExternalValue","handleToggleInput","handleSaveAttempt","handleDateChange","value","handleCloseDropdown","wrapperClasses","classNames","buttonIconClasses","dateInputClasses","disableButton","inputStyle","jsxs","jsx","DatePicker","Button"],"mappings":";;;;;;;;AAUA,MAAMA,KAAuB,WAgHvBC,KAAoB,CAACC,MAAkC;AACzD,QAAM;AAAA,IACF,aAAAC;AAAA,IACA,OAAOC,IAAgB;AAAA,IACvB,SAAAC,IAAU;AAAA,IACV,cAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,gBAAAC,IAAiBC;AAAA,IACjB,eAAAC;AAAA;AAAA,IACA,aAAAC,IAAcF;AAAA,IACd,YAAAG,IAAaH;AAAA,IACb,UAAAI,IAAWJ;AAAA,IACX,aAAAK,IAAcd;AAAA,IACd,gBAAAe;AAAA,IACA,YAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,IACtB,iBAAAC,IAAkB,CAAA;AAAA,IAClB,UAAAC,IAAW;AAAA,IACX,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHnB,GAGEoB,IAAmBZ,MAAkB,QAErC,CAACa,GAAYC,CAAa,IAAIC,EAAiCrB,CAAa,GAE5E,CAACsB,GAAWC,CAAY,IAAIF,EAAS,EAAK,GAC1C,CAACG,GAAWC,CAAY,IAAIJ,EAAS,EAAK,GAE1C,CAACK,GAAcC,CAAe,IAAIN,EAAS,EAAK,GAEhDO,IAAaC,EAAuB,IAAI,GACxCC,IAAYD,EAA0B,IAAI,GAE1CE,IAAuBF,EAAOV,CAAU;AAE9C,EAAAa,EAAiB;AAAA,IACb,KAAKJ;AAAA,IACL,eAAe,MAAM;AACjB,MAAAH,EAAa,EAAI;AAAA,IACrB;AAAA,IACA,cAAc,MAAM;AAChB,MAAAA,EAAa,EAAK;AAAA,IACtB;AAAA,EAAA,CACH,GAGDQ,GAAO,MAAM;AACT,IAAIT,KAAaF,KACbY,EAAA;AAAA,EAER,CAAC;AAGD,QAAM,CAACC,GAAuBC,CAAwB,IAAIf,E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gBAAAM,EAAC,OAAA,EAAI,WAAU,eACX,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACS,GAAGpC;AAAA,UAAiB,MAAMY;AAAA,UAChC,WAAWmB;AAAA,UACX,YAAY;AAAA,YACR,GAAGjC;AAAA,YACH,aAAAb;AAAA,YACA,UAAU,CAACuB;AAAA,YACX,OAAOyB;AAAA,UAAA;AAAA,UAEX,OAAO5B;AAAA,UACP,UAAUoB;AAAA,UACV,SAASE;AAAA,QAAA;AAAA,MAAA;AAAA,MAEZ,CAACxC,KAAW,CAACE,KACV,gBAAA8C,EAAC,QAAA,EAAK,WAAU,+EAA8E;AAAA,MAElG,gBAAAA,EAAC,OAAA,EAAI,WAAU,mBACX,UAAA,gBAAAA;AAAA,QAACE;AAAA,QAAA;AAAA,UACG,KAAKrB;AAAA,UACL,SAASpB;AAAA,UACT,UAAQ;AAAA,UACR,SAAS2B;AAAA,UACT,UAAUS;AAAA,UAEV,UAAA,gBAAAG,EAAC,QAAA,EAAK,WAAWL,EAAA,CAAmB;AAAA,QAAA;AAAA,MAAA,EACxC,CACJ;AAAA,IAAA,GACJ;AAAA,IACC,CAAC3C,KAAWC,KACT,gBAAA+C,EAAC,QAAA,EAAK,WAAU,0BACZ,UAAA,gBAAAA,EAAC,QAAA,EAAM,UAAA/C,EAAA,CAAa,EAAA,CACxB;AAAA,EAAA,GAER;AAER;"}
1
+ {"version":3,"file":"SaveableDateInput.js","sources":["../../../src/components/saveableInput/SaveableDateInput.tsx"],"sourcesContent":["import { useRef, useState, type HTMLAttributes, type CSSProperties } from 'react';\nimport { noop } from 'es-toolkit/function';\nimport type { Moment } from 'moment';\n\nimport classNames from '../../utils/classNames';\nimport Button from '../../Button';\nimport DatePicker, { type DatePickerProps } from '../datepicker/DatePicker';\nimport useIsFocusWithin from '../../hooks/useIsFocusWithin';\nimport useEsc from '../../hooks/useEsc';\n\nconst DEFAULT_BUTTON_STYLE = 'primary';\n\nexport type SaveableDateInputProps = {\n /**\n * The input placeholder.\n */\n placeholder?: string;\n\n /**\n * The actual input value.\n */\n value?: Date | Moment | string;\n\n /**\n * Used to control the save button from the outside to disable it in case\n * the entered value is not valid.\n *\n * @default true\n */\n isValid?: boolean;\n\n /**\n * This is the error message that is shown below the input. It uses the built-in error handling,\n * and will be shown when the \"isValid\" prop is set to false.\n */\n errorMessage?: string | React.ReactNode;\n\n /**\n * Defines wether the error icon is shown or not. If enabled, it will be shown when the \"isValid\" prop\n * is set to false.\n *\n * @default false\n */\n hideErrorIcon?: boolean;\n\n /**\n * Callback function triggered when the value changes and is saved.\n *\n * @param value\n * @param previousValue\n * @returns\n */\n onValueChanged?: (value: Moment | string, previousValue: Moment | string | Date) => void;\n\n /**\n * Callback function that gets triggered on every input change. Use this to control the component\n * or when implementing key validation.\n *\n * @param keyValue the key value that has been entered\n * @returns\n */\n onInputChange?: (value: Moment | string, isValid: boolean) => void;\n\n /**\n * Callback function that gets triggered when the input is in edit mode. Use this\n * to control the component and to handle the previous value on the outside.\n *\n * @returns\n */\n onEnterEdit?: () => void;\n\n /**\n * Callback function that gets triggered when edit mode is exited (either saved or cancelled).\n *\n * @param wasSaved - true if value was saved, false if cancelled/reset\n * @returns\n */\n onExitEdit?: (wasSaved: boolean) => void;\n\n /**\n * Callback function that gets triggered when the user aborts the edit mode. Use this\n * to control the component and handle the resetting of previous value on the outside.\n *\n * @returns\n */\n onCancel?: () => void;\n\n /**\n * Behavior when trying to exit edit mode with invalid input:\n * - 'stay-open': Keep edit mode open until valid input is provided\n * - 'reset-and-close': Close edit mode and reset to initial value\n *\n * @default 'stay-open'\n */\n invalidExitBehavior?: 'stay-open' | 'reset-and-close';\n\n /**\n * Defines the button style: `default` or `primary`.\n *\n * @default 'primary'\n */\n buttonStyle?: 'primary' | 'default';\n\n /**\n * Additional HTML attributes to be set on the input element.\n */\n inputProps?: HTMLAttributes<HTMLInputElement>;\n\n /**\n * Additional props passed to the underlying DatePicker component.\n *\n * @default {}\n */\n datePickerProps?: DatePickerProps;\n\n /**\n * Disables the component so the user cannot enter the edit mode.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the input itself.\n */\n inputClassName?: string;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n};\n\n// Validate date outside the component (via form library) if controlled usage\n// Use as controlled component: value, is Valid, and change callback\n// - if is valid, on save, call callback \"onValueChanged\"\n// - if not valid, keep edit mode open, outside is showing error message\n// - close edit mode only if date is valid - or close edit mode and reset to initial value -> customizable via prop\n// Keep picker open until user has clicked save, otherwise he might forget to click save if the dropdown closes automatically\n\nconst SaveableDateInput = (props: SaveableDateInputProps) => {\n const {\n placeholder,\n value: externalValue = '',\n isValid = true,\n errorMessage,\n hideErrorIcon = false,\n onValueChanged = noop,\n onInputChange, // for controlled usage\n onEnterEdit = noop,\n onExitEdit = noop,\n onCancel = noop,\n buttonStyle = DEFAULT_BUTTON_STYLE,\n inputClassName,\n inputProps,\n invalidExitBehavior = 'stay-open',\n datePickerProps = {},\n disabled = false,\n className,\n ...remainingProps\n } = props;\n\n // if callback is provided, assume it is controlled case\n const isControlledCase = onInputChange !== undefined;\n\n const [inputValue, setInputValue] = useState<Date | Moment | string>(externalValue);\n\n const [editInput, setEditInput] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n const initialInputValueRef = useRef(inputValue);\n\n useIsFocusWithin({\n ref: wrapperRef,\n onFocusWithin: () => {\n setIsFocused(true);\n },\n onBlurWithin: () => {\n setIsFocused(false);\n },\n });\n\n // Handle escape key to cancel edit mode\n useEsc(() => {\n if (isFocused && editInput) {\n handleCancelEdit();\n }\n });\n\n // Update internal state in a controlled environment\n const [previousExternalValue, setPreviousExternalValue] = useState(externalValue);\n if (previousExternalValue !== externalValue) {\n setInputValue(externalValue);\n setPreviousExternalValue(externalValue);\n // Update initial value ref when external value changes while not in edit mode\n if (!editInput) {\n initialInputValueRef.current = externalValue;\n }\n }\n\n const handleToggleInput = () => {\n if (!editInput) {\n // Enter edit mode\n setEditInput(true);\n initialInputValueRef.current = inputValue;\n\n // open the dropdown\n setIsPickerOpen(true);\n\n onEnterEdit();\n } else {\n // Try to exit edit mode\n handleSaveAttempt();\n }\n };\n\n const handleSaveAttempt = () => {\n if (isValid) {\n // Save the value (only if valid)\n setEditInput(false);\n onValueChanged(inputValue as Moment | string, initialInputValueRef.current);\n onExitEdit(true);\n\n // close the dropdown\n setIsPickerOpen(false);\n } else {\n // Handle invalid input based on behavior setting\n if (invalidExitBehavior === 'reset-and-close') {\n handleCancelEdit();\n }\n // If 'stay-open', do nothing - keep edit mode open\n }\n };\n\n const handleCancelEdit = () => {\n setEditInput(false);\n\n // Reset to initial value\n if (isControlledCase) {\n // In controlled mode, trigger change to reset to initial value\n onInputChange(initialInputValueRef.current as Moment | string, true);\n } else {\n setInputValue(initialInputValueRef.current);\n }\n\n // Close the dropdown\n setIsPickerOpen(false);\n\n onCancel();\n onExitEdit(false);\n };\n\n const handleDateChange = (value: Moment | string, isValid: boolean) => {\n if (isControlledCase) {\n onInputChange(value, isValid);\n } else {\n setInputValue(value);\n }\n };\n\n const handleCloseDropdown = () => setIsPickerOpen(false);\n\n const wrapperClasses = classNames('form-group', !isValid && 'has-feedback has-error', className);\n\n const buttonIconClasses = classNames('rioglyph', editInput ? 'rioglyph-ok' : 'rioglyph-pencil');\n\n const dateInputClasses = classNames('margin-0 width-100pct', inputClassName);\n\n // Button should be disabled if:\n // - Component is disabled, OR\n // - In edit mode and invalid input (and behavior is stay-open)\n const disableButton = disabled || (editInput && !isValid && invalidExitBehavior === 'stay-open');\n\n let inputStyle: CSSProperties = {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n };\n\n if (!isValid && hideErrorIcon) {\n // If the error icon shall not be shown, remove the input padding to avoid cutting of the date value\n inputStyle = { ...inputStyle, paddingRight: '10px' };\n }\n\n return (\n <div ref={wrapperRef} {...remainingProps} className={wrapperClasses}>\n <div className='input-group'>\n <DatePicker\n {...{ ...datePickerProps, open: isPickerOpen }}\n className={dateInputClasses}\n inputProps={{\n ...inputProps,\n placeholder,\n disabled: !editInput,\n style: inputStyle,\n }}\n value={inputValue}\n onChange={handleDateChange}\n onClose={handleCloseDropdown}\n />\n {!isValid && !hideErrorIcon && (\n <span className='right-25 margin-right-10 form-control-feedback rioglyph rioglyph-error-sign' />\n )}\n <div className='input-group-btn'>\n <Button\n ref={buttonRef}\n bsStyle={buttonStyle}\n iconOnly\n onClick={handleToggleInput}\n disabled={disableButton}\n >\n <span className={buttonIconClasses} />\n </Button>\n </div>\n </div>\n {!isValid && errorMessage && (\n <span className='help-block z-index-max'>\n <span>{errorMessage}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default SaveableDateInput;\n"],"names":["DEFAULT_BUTTON_STYLE","SaveableDateInput","props","placeholder","externalValue","isValid","errorMessage","hideErrorIcon","onValueChanged","noop","onInputChange","onEnterEdit","onExitEdit","onCancel","buttonStyle","inputClassName","inputProps","invalidExitBehavior","datePickerProps","disabled","className","remainingProps","isControlledCase","inputValue","setInputValue","useState","editInput","setEditInput","isFocused","setIsFocused","isPickerOpen","setIsPickerOpen","wrapperRef","useRef","buttonRef","initialInputValueRef","useIsFocusWithin","useEsc","handleCancelEdit","previousExternalValue","setPreviousExternalValue","handleToggleInput","handleSaveAttempt","handleDateChange","value","handleCloseDropdown","wrapperClasses","classNames","buttonIconClasses","dateInputClasses","disableButton","inputStyle","jsxs","jsx","DatePicker","Button"],"mappings":";;;;;;;;AAUA,MAAMA,KAAuB,WAkIvBC,KAAoB,CAACC,MAAkC;AACzD,QAAM;AAAA,IACF,aAAAC;AAAA,IACA,OAAOC,IAAgB;AAAA,IACvB,SAAAC,IAAU;AAAA,IACV,cAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,gBAAAC,IAAiBC;AAAA,IACjB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,CAACxC,KAAW,CAACE,KACV,gBAAA8C,EAAC,QAAA,EAAK,WAAU,+EAA8E;AAAA,MAElG,gBAAAA,EAAC,OAAA,EAAI,WAAU,mBACX,UAAA,gBAAAA;AAAA,QAACE;AAAA,QAAA;AAAA,UACG,KAAKrB;AAAA,UACL,SAASpB;AAAA,UACT,UAAQ;AAAA,UACR,SAAS2B;AAAA,UACT,UAAUS;AAAA,UAEV,UAAA,gBAAAG,EAAC,QAAA,EAAK,WAAWL,EAAA,CAAmB;AAAA,QAAA;AAAA,MAAA,EACxC,CACJ;AAAA,IAAA,GACJ;AAAA,IACC,CAAC3C,KAAWC,KACT,gBAAA+C,EAAC,QAAA,EAAK,WAAU,0BACZ,UAAA,gBAAAA,EAAC,QAAA,EAAM,UAAA/C,EAAA,CAAa,EAAA,CACxB;AAAA,EAAA,GAER;AAER;"}
@@ -26,11 +26,15 @@ export type SaveableInputProps = {
26
26
  */
27
27
  isValid?: boolean;
28
28
  /**
29
- * This is the error message that is shown below the input. It uses the built-in error handling, and will be shown when the "isValid" prop is set to false.
29
+ * This is the error message that is shown below the input. It uses the built-in error handling,
30
+ * and will be shown when the "isValid" prop is set to false.
30
31
  */
31
32
  errorMessage?: string | React.ReactNode;
32
33
  /**
33
- * Defines wether the error icon is shown or not. If enabled, it will be shown when the "isValid" prop is set to false.
34
+ * Defines wether the error icon is shown or not. If enabled, it will be shown when the "isValid" prop
35
+ * is set to false.
36
+ *
37
+ * @default false
34
38
  */
35
39
  hideErrorIcon?: boolean;
36
40
  /**
@@ -62,6 +66,8 @@ export type SaveableInputProps = {
62
66
  onEnterEdit?: () => void;
63
67
  /**
64
68
  * Defines the button style: `default` or `primary`.
69
+ *
70
+ * @default 'primary'
65
71
  */
66
72
  buttonStyle?: 'primary' | 'default';
67
73
  /**
@@ -79,6 +85,8 @@ export type SaveableInputProps = {
79
85
  icon?: string;
80
86
  /**
81
87
  * Disables the component so the user cannot enter the edit mode.
88
+ *
89
+ * @default false
82
90
  */
83
91
  disabled?: boolean;
84
92
  /**
@@ -1,65 +1,65 @@
1
1
  import { jsxs as T, jsx as e } from "react/jsx-runtime";
2
- import { useState as o, useRef as x, useEffect as te } from "react";
3
- import f from "classnames";
4
- import { isEmpty as ne } from "es-toolkit/compat";
2
+ import { useState as l, useRef as x, useEffect as ne } from "react";
3
+ import { isEmpty as ae } from "es-toolkit/compat";
5
4
  import { noop as b } from "es-toolkit/function";
6
- import ae from "../button/Button.js";
7
- import se from "../../hooks/useKey.js";
8
- import re from "../../hooks/useEsc.js";
9
- const le = "primary", oe = (p) => {
5
+ import f from "../../utils/classNames.js";
6
+ import se from "../button/Button.js";
7
+ import re from "../../hooks/useKey.js";
8
+ import oe from "../../hooks/useEsc.js";
9
+ const le = "primary", ie = (c) => {
10
10
  const n = x(null);
11
- return te(() => {
12
- n.current && p && n.current.focus();
13
- }, [n.current, p]), n;
14
- }, ge = (p) => {
11
+ return ne(() => {
12
+ n.current && c && n.current.focus();
13
+ }, [n.current, c]), n;
14
+ }, ve = (c) => {
15
15
  const {
16
16
  placeholder: n,
17
17
  fixedPreviousValue: m = "",
18
- previousValue: B = "",
18
+ previousValue: P = "",
19
19
  value: i = "",
20
20
  isValid: a = !0,
21
21
  errorMessage: E,
22
22
  hideErrorIcon: I = !1,
23
- onValueChanged: P = b,
23
+ onValueChanged: R = b,
24
24
  onInputChange: N,
25
- onEsc: R = b,
26
- onEnterEdit: S = b,
27
- buttonStyle: z = le,
25
+ onEsc: S = b,
26
+ onEnterEdit: z = b,
27
+ buttonStyle: U = le,
28
28
  inputClassName: j,
29
29
  inputProps: w,
30
30
  icon: h,
31
- unit: u,
31
+ unit: y,
32
32
  disabled: D = !1,
33
33
  className: L,
34
- ...U
35
- } = p, c = B || m, [s, g] = o(i), [r, v] = o(c), [t, V] = o(!1), [y, C] = o(!1), d = x(s), O = x(r), [_, A] = o(i);
36
- _ !== i && (g(i), A(i));
37
- const [K, M] = o(c);
38
- K !== c && (v(c), M(c));
39
- const Y = oe(t);
40
- se((l) => {
41
- y && t && a && l.key === "Enter" && k();
42
- }), re(() => {
43
- y && (g(d.current), v(O.current), V(!1), R());
34
+ ..._
35
+ } = c, u = P || m, [s, g] = l(i), [r, v] = l(u), [t, V] = l(!1), [C, O] = l(!1), p = x(s), k = x(r), [A, K] = l(i);
36
+ A !== i && (g(i), K(i));
37
+ const [M, Y] = l(u);
38
+ M !== u && (v(u), Y(u));
39
+ const $ = ie(t);
40
+ re((o) => {
41
+ C && t && a && o.key === "Enter" && B();
42
+ }), oe(() => {
43
+ C && (g(p.current), v(k.current), V(!1), S());
44
44
  });
45
- const k = () => {
46
- t === !1 ? (V(!0), m || (O.current = r), d.current = s, S()) : (V(!1), d.current !== s && (v(m || d.current), P(s, r)));
47
- }, $ = (l) => {
45
+ const B = () => {
46
+ t === !1 ? (V(!0), m || (k.current = r), p.current = s, z()) : (V(!1), p.current !== s && (v(m || p.current), R(s, r)));
47
+ }, q = (o) => {
48
48
  if (N) {
49
- const Z = l.nativeEvent?.data, ee = l.target.value;
50
- N(Z ?? ee, l.currentTarget.value);
49
+ const ee = o.nativeEvent?.data, te = o.target.value;
50
+ N(ee ?? te, o.currentTarget.value);
51
51
  return;
52
52
  }
53
- g(l.target.value);
54
- }, q = () => C(!0), G = () => C(!1), F = !ne(r) && r !== s && !t, H = f("form-group", !a && "has-feedback has-error", L), J = f(
53
+ g(o.target.value);
54
+ }, G = () => O(!0), H = () => O(!1), F = !ae(r) && r !== s && !t, d = !!y, J = f("form-group", !a && "has-feedback has-error", L), Q = f(
55
55
  "form-control",
56
56
  F && "padding-bottom-0 padding-top-10 text-size-12",
57
- u && "padding-right-50",
57
+ d && "padding-right-50",
58
58
  // This value is not perfect as with longer units it might conflict with the value
59
- !u && !a && I && "padding-right-10",
59
+ !d && !a && I && "padding-right-10",
60
60
  // remove the padding for the error icon if not needed
61
61
  j
62
- ), Q = f(
62
+ ), W = f(
63
63
  "position-absolute",
64
64
  "top-2",
65
65
  "left-10",
@@ -67,34 +67,34 @@ const le = "primary", oe = (p) => {
67
67
  "text-size-10",
68
68
  "text-decoration-line-through",
69
69
  h && "padding-left-20"
70
- ), W = f("rioglyph", t ? "rioglyph-ok" : "rioglyph-pencil"), X = t && !a || D;
71
- return /* @__PURE__ */ T("div", { ...U, className: H, children: [
70
+ ), X = f("rioglyph", t ? "rioglyph-ok" : "rioglyph-pencil"), Z = t && !a || D;
71
+ return /* @__PURE__ */ T("div", { ..._, className: J, children: [
72
72
  /* @__PURE__ */ T("div", { className: "input-group", children: [
73
73
  h && /* @__PURE__ */ e("span", { className: "input-group-addon", children: /* @__PURE__ */ e("span", { className: `rioglyph ${h}`, "aria-hidden": "true", "aria-label": "input icon" }) }),
74
74
  /* @__PURE__ */ e(
75
75
  "input",
76
76
  {
77
77
  type: "text",
78
- ref: Y,
78
+ ref: $,
79
79
  placeholder: n,
80
- className: J,
80
+ className: Q,
81
81
  value: s,
82
- onChange: $,
83
- onFocus: q,
84
- onBlur: G,
82
+ onChange: q,
83
+ onFocus: G,
84
+ onBlur: H,
85
85
  disabled: !t,
86
86
  ...w
87
87
  }
88
88
  ),
89
- u && /* @__PURE__ */ e("div", { className: "position-absolute right-0 margin-right-50", "aria-label": "unit", children: u }),
90
- F && /* @__PURE__ */ e("div", { className: Q, "aria-label": "previous value", children: r }),
91
- /* @__PURE__ */ e("div", { className: "input-group-btn", children: /* @__PURE__ */ e(ae, { bsStyle: z, iconOnly: !0, onClick: k, disabled: X, children: /* @__PURE__ */ e("span", { className: W }) }) })
89
+ d && /* @__PURE__ */ e("div", { className: "position-absolute right-0 margin-right-50", "aria-label": "unit", children: y }),
90
+ F && /* @__PURE__ */ e("div", { className: W, "aria-label": "previous value", children: r }),
91
+ /* @__PURE__ */ e("div", { className: "input-group-btn", children: /* @__PURE__ */ e(se, { bsStyle: U, iconOnly: !0, onClick: B, disabled: Z, children: /* @__PURE__ */ e("span", { className: X }) }) })
92
92
  ] }),
93
- !a && !I && !u && /* @__PURE__ */ e("span", { className: "right-25 margin-right-10 form-control-feedback rioglyph rioglyph-error-sign" }),
93
+ !a && !I && !d && /* @__PURE__ */ e("span", { className: "right-25 margin-right-10 form-control-feedback rioglyph rioglyph-error-sign" }),
94
94
  !a && E && /* @__PURE__ */ e("span", { className: "help-block z-index-max", children: /* @__PURE__ */ e("span", { children: E }) })
95
95
  ] });
96
96
  };
97
97
  export {
98
- ge as default
98
+ ve as default
99
99
  };
100
100
  //# sourceMappingURL=SaveableInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SaveableInput.js","sources":["../../../src/components/saveableInput/SaveableInput.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, type ChangeEvent, type HTMLAttributes } from 'react';\nimport classNames from 'classnames';\nimport { isEmpty } from 'es-toolkit/compat';\nimport { noop } from 'es-toolkit/function';\n\n// @ts-ignore\nimport Button from '../../Button';\nimport useKey from '../../hooks/useKey';\nimport useEsc from '../../hooks/useEsc';\n\nconst DEFAULT_BUTTON_STYLE = 'primary';\n\nconst useFocus = (isEditable: boolean) => {\n const inputRef = useRef<HTMLInputElement>(null);\n useEffect(() => {\n if (inputRef.current && isEditable) {\n inputRef.current.focus();\n }\n }, [inputRef.current, isEditable]);\n\n return inputRef;\n};\n\nexport type SaveableInputProps = {\n /**\n * The input placeholder.\n */\n placeholder?: string;\n\n /**\n * The previous or old value shown above the input value.\n * This value will *not* be changed for new input values.\n */\n fixedPreviousValue?: string;\n\n /**\n * The previous or old value shown above the input value.\n * This value *changes* when a new input value is accepted.\n */\n previousValue?: string;\n\n /**\n * The actual input value.\n */\n value?: string;\n\n /**\n * Used to control the save button from the outside to disable it in case\n * the entered value is not valid.\n *\n * @default true\n */\n isValid?: boolean;\n\n /**\n * This is the error message that is shown below the input. It uses the built-in error handling, and will be shown when the \"isValid\" prop is set to false.\n */\n errorMessage?: string | React.ReactNode;\n\n /**\n * Defines wether the error icon is shown or not. If enabled, it will be shown when the \"isValid\" prop is set to false.\n */\n hideErrorIcon?: boolean;\n\n /**\n * Callback function triggered when the value changes.\n * @param value\n * @param previousValue\n * @returns\n */\n onValueChanged?: (value: string, previousValue: string) => void;\n\n /**\n * Callback function that gets triggered on every input change. Use this to control the component\n * or when implementing key validation.\n * @param keyValue the key value that has been entered\n * @param inputValue the current complete value of the input\n * @returns\n */\n onInputChange?: (keyValue: string, inputValue: string) => void;\n\n /**\n * Callback function that gets triggered when the user aborts the edit mode. Use this\n * to control the component and handle the resetting of previous value on the outside.\n * @returns\n */\n onEsc?: () => void;\n\n /**\n * Callback function that gets triggered when the input is in edit mode. Use this\n * to control the component dna to handle the previous value on the outside.\n * @returns\n */\n onEnterEdit?: () => void;\n\n /**\n * Defines the button style: `default` or `primary`.\n */\n buttonStyle?: 'primary' | 'default';\n\n /**\n * Additional HTML attributes to be set on the input element.\n */\n inputProps?: HTMLAttributes<HTMLInputElement>;\n\n /**\n * Adds a given unit to the input.\n */\n unit?: string | React.ReactNode;\n\n /**\n * Icon class name that shall be used. If defined, the input element is wrapped in an input-group\n * and the icon will be set in an input-addon. Example: `rioglyph-search`.\n */\n icon?: string;\n\n /**\n * Disables the component so the user cannot enter the edit mode.\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the input itself.\n */\n inputClassName?: string;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n};\n\n// Features:\n// [ ] what shall happen when user leaves component while in edit mode (click outside or tab) - close on blur?\n// [x] avoid save without change\n// [x] use fixed previous value\n// [x] enter = save\n// [x] esc key to abort and leave edit mode\n// [x] tab focus + enter = go into edit mode\n// [x] validate after each key, i.e for number inputs - use onInputChange callback\n// [x] support form feedback error - wrap it with form-group and feedback classes\n// [x] allow for unit and icon\n// [x] disabled input\n\nconst SaveableInput = (props: SaveableInputProps) => {\n const {\n placeholder,\n fixedPreviousValue = '',\n previousValue = '',\n value: externalValue = '',\n isValid = true,\n errorMessage,\n hideErrorIcon = false,\n onValueChanged = noop,\n onInputChange,\n onEsc = noop,\n onEnterEdit = noop,\n buttonStyle = DEFAULT_BUTTON_STYLE,\n inputClassName,\n inputProps,\n icon,\n unit,\n disabled = false,\n className,\n ...remainingProps\n } = props;\n\n const externalOldValue = previousValue || fixedPreviousValue;\n\n const [inputValue, setInputValue] = useState(externalValue);\n const [oldInputValue, setOldInputValue] = useState(externalOldValue);\n\n const [editInput, setEditInput] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\n const initialInputValueRef = useRef(inputValue);\n const initialOldInputValueRef = useRef(oldInputValue);\n\n // Update internal state in a controlled environment\n const [previousExternalValue, setPreviousExternalValue] = useState(externalValue);\n if (previousExternalValue !== externalValue) {\n setInputValue(externalValue);\n setPreviousExternalValue(externalValue);\n }\n\n // Update internal state in a controlled environment\n const [previousExternalOldValue, setPreviousExternalOldValue] = useState(externalOldValue);\n if (previousExternalOldValue !== externalOldValue) {\n setOldInputValue(externalOldValue);\n setPreviousExternalOldValue(externalOldValue);\n }\n\n // Set focus on input when being in edit mode\n const inputRef = useFocus(editInput);\n\n // Allow to exit \"edit\" mode with \"Enter\" to accept changes\n useKey((event: KeyboardEvent) => {\n if (isFocused && editInput && isValid && event.key === 'Enter') {\n handleToggleInput();\n }\n });\n\n // Allow to exit \"edit\" mode with \"Esc\" to ignore changes\n useEsc(() => {\n if (isFocused) {\n // Restore local state to initial vales as it was when entering edit mode\n setInputValue(initialInputValueRef.current);\n setOldInputValue(initialOldInputValueRef.current);\n setEditInput(false);\n onEsc();\n }\n });\n\n const handleToggleInput = () => {\n if (editInput === false) {\n setEditInput(true);\n\n // Temporarily store values of input and oldInput to be used when\n // discarding changes on \"esc\" or to avoid saving without changes\n if (!fixedPreviousValue) {\n initialOldInputValueRef.current = oldInputValue;\n }\n initialInputValueRef.current = inputValue;\n\n onEnterEdit();\n } else {\n setEditInput(false);\n\n // In case the new input value has not changed to the initial value\n // reset the internal old value to the initial\n if (initialInputValueRef.current !== inputValue) {\n setOldInputValue(fixedPreviousValue || initialInputValueRef.current);\n onValueChanged(inputValue, oldInputValue);\n }\n }\n };\n\n const handleInputChange = (event: ChangeEvent<HTMLInputElement>) => {\n // Only update internal value if the external \"onInputChange\" callback function is not defined\n // as it will be used in a controlled way\n if (onInputChange) {\n // Use type assertion to access nativeEvent.data\n const nativeEventData = (event.nativeEvent as InputEvent)?.data;\n\n // Whe \"backspace\" is used to remove a value, the nativeEventData is undefined. In this case\n // we need to use the target value for the callback otherwise the user will not be able to\n // remove a character from the input\n const currentInputValue = event.target.value;\n\n onInputChange(nativeEventData ?? currentInputValue, event.currentTarget.value);\n return;\n }\n\n setInputValue(event.target.value);\n };\n\n const handleFocus = () => setIsFocused(true);\n const handleBlur = () => setIsFocused(false);\n\n const showOldValue = !isEmpty(oldInputValue) && oldInputValue !== inputValue && !editInput;\n\n const wrapperClasses = classNames('form-group', !isValid && 'has-feedback has-error', className);\n\n const inputClasses = classNames(\n 'form-control',\n showOldValue && 'padding-bottom-0 padding-top-10 text-size-12',\n unit && 'padding-right-50', // This value is not perfect as with longer units it might conflict with the value\n !unit && !isValid && hideErrorIcon && 'padding-right-10', // remove the padding for the error icon if not needed\n inputClassName\n );\n\n const oldValueClasses = classNames(\n 'position-absolute',\n 'top-2',\n 'left-10',\n 'margin-left-3',\n 'text-size-10',\n 'text-decoration-line-through',\n icon && 'padding-left-20'\n );\n\n const buttonIconClasses = classNames('rioglyph', editInput ? 'rioglyph-ok' : 'rioglyph-pencil');\n\n const disableButton = (editInput && !isValid) || disabled;\n\n return (\n <div {...remainingProps} className={wrapperClasses}>\n <div className='input-group'>\n {icon && (\n <span className='input-group-addon'>\n <span className={`rioglyph ${icon}`} aria-hidden='true' aria-label='input icon' />\n </span>\n )}\n <input\n type='text'\n ref={inputRef}\n placeholder={placeholder}\n className={inputClasses}\n value={inputValue}\n onChange={handleInputChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n disabled={!editInput}\n {...inputProps}\n />\n {unit && (\n <div className='position-absolute right-0 margin-right-50' aria-label='unit'>\n {unit}\n </div>\n )}\n {showOldValue && (\n <div className={oldValueClasses} aria-label='previous value'>\n {oldInputValue}\n </div>\n )}\n <div className='input-group-btn'>\n <Button bsStyle={buttonStyle} iconOnly onClick={handleToggleInput} disabled={disableButton}>\n <span className={buttonIconClasses} />\n </Button>\n </div>\n </div>\n {!isValid && !hideErrorIcon && !unit && (\n <span className='right-25 margin-right-10 form-control-feedback rioglyph rioglyph-error-sign' />\n )}\n {!isValid && errorMessage && (\n <span className='help-block z-index-max'>\n <span>{errorMessage}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default SaveableInput;\n"],"names":["DEFAULT_BUTTON_STYLE","useFocus","isEditable","inputRef","useRef","useEffect","SaveableInput","props","placeholder","fixedPreviousValue","previousValue","externalValue","isValid","errorMessage","hideErrorIcon","onValueChanged","noop","onInputChange","onEsc","onEnterEdit","buttonStyle","inputClassName","inputProps","icon","unit","disabled","className","remainingProps","externalOldValue","inputValue","setInputValue","useState","oldInputValue","setOldInputValue","editInput","setEditInput","isFocused","setIsFocused","initialInputValueRef","initialOldInputValueRef","previousExternalValue","setPreviousExternalValue","previousExternalOldValue","setPreviousExternalOldValue","useKey","event","handleToggleInput","useEsc","handleInputChange","nativeEventData","currentInputValue","handleFocus","handleBlur","showOldValue","isEmpty","wrapperClasses","classNames","inputClasses","oldValueClasses","buttonIconClasses","disableButton","jsxs","jsx","Button"],"mappings":";;;;;;;;AAUA,MAAMA,KAAuB,WAEvBC,KAAW,CAACC,MAAwB;AACtC,QAAMC,IAAWC,EAAyB,IAAI;AAC9C,SAAAC,GAAU,MAAM;AACZ,IAAIF,EAAS,WAAWD,KACpBC,EAAS,QAAQ,MAAA;AAAA,EAEzB,GAAG,CAACA,EAAS,SAASD,CAAU,CAAC,GAE1BC;AACX,GA2HMG,KAAgB,CAACC,MAA8B;AACjD,QAAM;AAAA,IACF,aAAAC;AAAA,IACA,oBAAAC,IAAqB;AAAA,IACrB,eAAAC,IAAgB;AAAA,IAChB,OAAOC,IAAgB;AAAA,IACvB,SAAAC,IAAU;AAAA,IACV,cAAAC;AAA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uC;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,MAAK;AAAA,UACL,KAAK3D;AAAA,UACL,aAAAK;AAAA,UACA,WAAWiD;AAAA,UACX,OAAO5B;AAAA,UACP,UAAUmB;AAAA,UACV,SAASG;AAAA,UACT,QAAQC;AAAA,UACR,UAAU,CAAClB;AAAA,UACV,GAAGZ;AAAA,QAAA;AAAA,MAAA;AAAA,MAEPE,KACG,gBAAAsC,EAAC,OAAA,EAAI,WAAU,6CAA4C,cAAW,QACjE,UAAAtC,GACL;AAAA,MAEH6B,KACG,gBAAAS,EAAC,OAAA,EAAI,WAAWJ,GAAiB,cAAW,kBACvC,UAAA1B,GACL;AAAA,wBAEH,OAAA,EAAI,WAAU,mBACX,UAAA,gBAAA8B,EAACC,IAAA,EAAO,SAAS3C,GAAa,UAAQ,IAAC,SAAS0B,GAAmB,UAAUc,GACzE,UAAA,gBAAAE,EAAC,UAAK,WAAWH,EAAA,CAAmB,GACxC,EAAA,CACJ;AAAA,IAAA,GACJ;AAAA,IACC,CAAC/C,KAAW,CAACE,KAAiB,CAACU,KAC5B,gBAAAsC,EAAC,QAAA,EAAK,WAAU,+EAA8E;AAAA,IAEjG,CAAClD,KAAWC,KACT,gBAAAiD,EAAC,QAAA,EAAK,WAAU,0BACZ,UAAA,gBAAAA,EAAC,QAAA,EAAM,UAAAjD,EAAA,CAAa,EAAA,CACxB;AAAA,EAAA,GAER;AAER;"}
1
+ {"version":3,"file":"SaveableInput.js","sources":["../../../src/components/saveableInput/SaveableInput.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, type ChangeEvent, type HTMLAttributes } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\nimport { noop } from 'es-toolkit/function';\n\nimport classNames from '../../utils/classNames';\nimport Button from '../../Button';\nimport useKey from '../../hooks/useKey';\nimport useEsc from '../../hooks/useEsc';\n\nconst DEFAULT_BUTTON_STYLE = 'primary';\n\nconst useFocus = (isEditable: boolean) => {\n const inputRef = useRef<HTMLInputElement>(null);\n useEffect(() => {\n if (inputRef.current && isEditable) {\n inputRef.current.focus();\n }\n }, [inputRef.current, isEditable]);\n\n return inputRef;\n};\n\nexport type SaveableInputProps = {\n /**\n * The input placeholder.\n */\n placeholder?: string;\n\n /**\n * The previous or old value shown above the input value.\n * This value will *not* be changed for new input values.\n */\n fixedPreviousValue?: string;\n\n /**\n * The previous or old value shown above the input value.\n * This value *changes* when a new input value is accepted.\n */\n previousValue?: string;\n\n /**\n * The actual input value.\n */\n value?: string;\n\n /**\n * Used to control the save button from the outside to disable it in case\n * the entered value is not valid.\n *\n * @default true\n */\n isValid?: boolean;\n\n /**\n * This is the error message that is shown below the input. It uses the built-in error handling,\n * and will be shown when the \"isValid\" prop is set to false.\n */\n errorMessage?: string | React.ReactNode;\n\n /**\n * Defines wether the error icon is shown or not. If enabled, it will be shown when the \"isValid\" prop\n * is set to false.\n *\n * @default false\n */\n hideErrorIcon?: boolean;\n\n /**\n * Callback function triggered when the value changes.\n * @param value\n * @param previousValue\n * @returns\n */\n onValueChanged?: (value: string, previousValue: string) => void;\n\n /**\n * Callback function that gets triggered on every input change. Use this to control the component\n * or when implementing key validation.\n * @param keyValue the key value that has been entered\n * @param inputValue the current complete value of the input\n * @returns\n */\n onInputChange?: (keyValue: string, inputValue: string) => void;\n\n /**\n * Callback function that gets triggered when the user aborts the edit mode. Use this\n * to control the component and handle the resetting of previous value on the outside.\n * @returns\n */\n onEsc?: () => void;\n\n /**\n * Callback function that gets triggered when the input is in edit mode. Use this\n * to control the component dna to handle the previous value on the outside.\n * @returns\n */\n onEnterEdit?: () => void;\n\n /**\n * Defines the button style: `default` or `primary`.\n *\n * @default 'primary'\n */\n buttonStyle?: 'primary' | 'default';\n\n /**\n * Additional HTML attributes to be set on the input element.\n */\n inputProps?: HTMLAttributes<HTMLInputElement>;\n\n /**\n * Adds a given unit to the input.\n */\n unit?: string | React.ReactNode;\n\n /**\n * Icon class name that shall be used. If defined, the input element is wrapped in an input-group\n * and the icon will be set in an input-addon. Example: `rioglyph-search`.\n */\n icon?: string;\n\n /**\n * Disables the component so the user cannot enter the edit mode.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the input itself.\n */\n inputClassName?: string;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n};\n\n// Features:\n// [ ] what shall happen when user leaves component while in edit mode (click outside or tab) - close on blur?\n// [x] avoid save without change\n// [x] use fixed previous value\n// [x] enter = save\n// [x] esc key to abort and leave edit mode\n// [x] tab focus + enter = go into edit mode\n// [x] validate after each key, i.e for number inputs - use onInputChange callback\n// [x] support form feedback error - wrap it with form-group and feedback classes\n// [x] allow for unit and icon\n// [x] disabled input\n\nconst SaveableInput = (props: SaveableInputProps) => {\n const {\n placeholder,\n fixedPreviousValue = '',\n previousValue = '',\n value: externalValue = '',\n isValid = true,\n errorMessage,\n hideErrorIcon = false,\n onValueChanged = noop,\n onInputChange,\n onEsc = noop,\n onEnterEdit = noop,\n buttonStyle = DEFAULT_BUTTON_STYLE,\n inputClassName,\n inputProps,\n icon,\n unit,\n disabled = false,\n className,\n ...remainingProps\n } = props;\n\n const externalOldValue = previousValue || fixedPreviousValue;\n\n const [inputValue, setInputValue] = useState(externalValue);\n const [oldInputValue, setOldInputValue] = useState(externalOldValue);\n\n const [editInput, setEditInput] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\n const initialInputValueRef = useRef(inputValue);\n const initialOldInputValueRef = useRef(oldInputValue);\n\n // Update internal state in a controlled environment\n const [previousExternalValue, setPreviousExternalValue] = useState(externalValue);\n if (previousExternalValue !== externalValue) {\n setInputValue(externalValue);\n setPreviousExternalValue(externalValue);\n }\n\n // Update internal state in a controlled environment\n const [previousExternalOldValue, setPreviousExternalOldValue] = useState(externalOldValue);\n if (previousExternalOldValue !== externalOldValue) {\n setOldInputValue(externalOldValue);\n setPreviousExternalOldValue(externalOldValue);\n }\n\n // Set focus on input when being in edit mode\n const inputRef = useFocus(editInput);\n\n // Allow to exit \"edit\" mode with \"Enter\" to accept changes\n useKey((event: KeyboardEvent) => {\n if (isFocused && editInput && isValid && event.key === 'Enter') {\n handleToggleInput();\n }\n });\n\n // Allow to exit \"edit\" mode with \"Esc\" to ignore changes\n useEsc(() => {\n if (isFocused) {\n // Restore local state to initial vales as it was when entering edit mode\n setInputValue(initialInputValueRef.current);\n setOldInputValue(initialOldInputValueRef.current);\n setEditInput(false);\n onEsc();\n }\n });\n\n const handleToggleInput = () => {\n if (editInput === false) {\n setEditInput(true);\n\n // Temporarily store values of input and oldInput to be used when\n // discarding changes on \"esc\" or to avoid saving without changes\n if (!fixedPreviousValue) {\n initialOldInputValueRef.current = oldInputValue;\n }\n initialInputValueRef.current = inputValue;\n\n onEnterEdit();\n } else {\n setEditInput(false);\n\n // In case the new input value has not changed to the initial value\n // reset the internal old value to the initial\n if (initialInputValueRef.current !== inputValue) {\n setOldInputValue(fixedPreviousValue || initialInputValueRef.current);\n onValueChanged(inputValue, oldInputValue);\n }\n }\n };\n\n const handleInputChange = (event: ChangeEvent<HTMLInputElement>) => {\n // Only update internal value if the external \"onInputChange\" callback function is not defined\n // as it will be used in a controlled way\n if (onInputChange) {\n // Use type assertion to access nativeEvent.data\n const nativeEventData = (event.nativeEvent as InputEvent)?.data;\n\n // Whe \"backspace\" is used to remove a value, the nativeEventData is undefined. In this case\n // we need to use the target value for the callback otherwise the user will not be able to\n // remove a character from the input\n const currentInputValue = event.target.value;\n\n onInputChange(nativeEventData ?? currentInputValue, event.currentTarget.value);\n return;\n }\n\n setInputValue(event.target.value);\n };\n\n const handleFocus = () => setIsFocused(true);\n const handleBlur = () => setIsFocused(false);\n\n const showOldValue = !isEmpty(oldInputValue) && oldInputValue !== inputValue && !editInput;\n const hasUnit = Boolean(unit);\n\n const wrapperClasses = classNames('form-group', !isValid && 'has-feedback has-error', className);\n\n const inputClasses = classNames(\n 'form-control',\n showOldValue && 'padding-bottom-0 padding-top-10 text-size-12',\n hasUnit && 'padding-right-50', // This value is not perfect as with longer units it might conflict with the value\n !hasUnit && !isValid && hideErrorIcon && 'padding-right-10', // remove the padding for the error icon if not needed\n inputClassName\n );\n\n const oldValueClasses = classNames(\n 'position-absolute',\n 'top-2',\n 'left-10',\n 'margin-left-3',\n 'text-size-10',\n 'text-decoration-line-through',\n icon && 'padding-left-20'\n );\n\n const buttonIconClasses = classNames('rioglyph', editInput ? 'rioglyph-ok' : 'rioglyph-pencil');\n\n const disableButton = (editInput && !isValid) || disabled;\n\n return (\n <div {...remainingProps} className={wrapperClasses}>\n <div className='input-group'>\n {icon && (\n <span className='input-group-addon'>\n <span className={`rioglyph ${icon}`} aria-hidden='true' aria-label='input icon' />\n </span>\n )}\n <input\n type='text'\n ref={inputRef}\n placeholder={placeholder}\n className={inputClasses}\n value={inputValue}\n onChange={handleInputChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n disabled={!editInput}\n {...inputProps}\n />\n {hasUnit && (\n <div className='position-absolute right-0 margin-right-50' aria-label='unit'>\n {unit}\n </div>\n )}\n {showOldValue && (\n <div className={oldValueClasses} aria-label='previous value'>\n {oldInputValue}\n </div>\n )}\n <div className='input-group-btn'>\n <Button bsStyle={buttonStyle} iconOnly onClick={handleToggleInput} disabled={disableButton}>\n <span className={buttonIconClasses} />\n </Button>\n </div>\n </div>\n {!isValid && !hideErrorIcon && !hasUnit && (\n <span className='right-25 margin-right-10 form-control-feedback rioglyph rioglyph-error-sign' />\n )}\n {!isValid && errorMessage && (\n <span className='help-block z-index-max'>\n <span>{errorMessage}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default SaveableInput;\n"],"names":["DEFAULT_BUTTON_STYLE","useFocus","isEditable","inputRef","useRef","useEffect","SaveableInput","props","placeholder","fixedPreviousValue","previousValue","externalValue","isValid","errorMessage","hideErrorIcon","onValueChanged","noop","onInputChange","onEsc","onEnterEdit","buttonStyle","inputClassName","inputProps","icon","unit","disabled","className","remainingProps","externalOldValue","inputValue","setInputValue","useState","oldInputValue","setOldInputValue","editInput","setEditInput","isFocused","setIsFocused","initialInputValueRef","initialOldInputValueRef","previousExternalValue","setPreviousExternalValue","previousExternalOldValue","setPreviousExternalOldValue","useKey","event","handleToggleInput","useEsc","handleInputChange","nativeEventData","currentInputValue","handleFocus","handleBlur","showOldValue","isEmpty","hasUnit","wrapperClasses","classNames","inputClasses","oldValueClasses","buttonIconClasses","disableButton","jsxs","jsx","Button"],"mappings":";;;;;;;;AASA,MAAMA,KAAuB,WAEvBC,KAAW,CAACC,MAAwB;AACtC,QAAMC,IAAWC,EAAyB,IAAI;AAC9C,SAAAC,GAAU,MAAM;AACZ,IAAIF,EAAS,WAAWD,KACpBC,EAAS,QAAQ,MAAA;AAAA,EAEzB,GAAG,CAACA,EAAS,SAASD,CAAU,CAAC,GAE1BC;AACX,GAmIMG,KAAgB,CAACC,MAA8B;AACjD,QAAM;AAAA,IACF,aAAAC;AAAA,IACA,oBAAAC,IAAqB;AAAA,IACrB,eAAAC,IAAgB;AAAA,IAChB,OAAOC,IAAgB;AAAA,IACvB,SAAAC,IAAU;AAAA,IACV,cAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,gBAAAC,IAAiBC;AAAA,IACjB,eAAAC;AAAA,IACA,OAAAC,IAAQF;AAAA,IACR,aAAAG,IAAcH;AAAA,IACd,aAAAI,IAAcpB;AAAA,IACd,gBAAAqB;AAAA,IACA,YAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHpB,GAEEqB,IAAmBlB,KAAiBD,GAEpC,CAACoB,GAAYC,CAAa,IAAIC,EAASpB,CAAa,GACpD,CAACqB,GAAeC,CAAgB,IAAIF,EAASH,CAAgB,GAE7D,CAACM,GAAWC,CAAY,IAAIJ,EAAS,EAAK,GAC1C,CAACK,GAAWC,CAAY,IAAIN,EAAS,EAAK,GAE1CO,IAAuBlC,EAAOyB,CAAU,GACxCU,IAA0BnC,EAAO4B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