@rio-cloud/rio-uikit 2.2.1 → 2.3.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (475) hide show
  1. package/AnalyticsAnalysisOverlay.d.ts +1 -0
  2. package/AnalyticsAnalysisOverlay.js +5 -0
  3. package/AnalyticsAnalysisOverlay.js.map +1 -0
  4. package/DayPicker.js +6 -2
  5. package/DayPicker.js.map +1 -1
  6. package/DayPickerCalendar.d.ts +2 -0
  7. package/DayPickerCalendar.js +5 -0
  8. package/DayPickerCalendar.js.map +1 -0
  9. package/DayPickerPrototype.d.ts +2 -0
  10. package/DayPickerPrototype.js +5 -0
  11. package/DayPickerPrototype.js.map +1 -0
  12. package/Table.d.ts +2 -0
  13. package/Table.js +23 -0
  14. package/Table.js.map +1 -0
  15. package/TableCol.d.ts +2 -2
  16. package/TableCol.js +1 -1
  17. package/TableHead.d.ts +2 -2
  18. package/TableHead.js +1 -1
  19. package/TableNext.d.ts +2 -0
  20. package/TableNext.js +23 -0
  21. package/TableNext.js.map +1 -0
  22. package/TableSettingsDialog.d.ts +2 -2
  23. package/TableSettingsDialog.js +1 -1
  24. package/TableToolbar.js +4 -2
  25. package/TableToolbar.js.map +1 -1
  26. package/analyticsAnalysisUtils.d.ts +1 -0
  27. package/analyticsAnalysisUtils.js +13 -0
  28. package/analyticsAnalysisUtils.js.map +1 -0
  29. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.d.ts +18 -0
  30. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.js +128 -0
  31. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.js.map +1 -0
  32. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.d.ts +9 -0
  33. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.js +73 -0
  34. package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.js.map +1 -0
  35. package/components/applicationHeader/AppMenuContent.js.map +1 -1
  36. package/components/applicationHeader/ApplicationActionBar.js +4 -4
  37. package/components/applicationHeader/ApplicationActionBar.js.map +1 -1
  38. package/components/applicationHeader/CollapsedNavItem.js +5 -14
  39. package/components/applicationHeader/CollapsedNavItem.js.map +1 -1
  40. package/components/applicationHeader/NavItems.js +10 -10
  41. package/components/applicationHeader/NavItems.js.map +1 -1
  42. package/components/assetTree/AssetTree.js +23 -23
  43. package/components/assetTree/AssetTree.js.map +1 -1
  44. package/components/assetTree/Tree.js +13 -13
  45. package/components/assetTree/TreeNothingFound.js +2 -2
  46. package/components/assetTree/TreeNothingFound.js.map +1 -1
  47. package/components/assetTree/treeUtils.js.map +1 -1
  48. package/components/autosuggest/AutoSuggest.js +31 -31
  49. package/components/autosuggest/AutoSuggest.js.map +1 -1
  50. package/components/autosuggest/AutoSuggestAddons.js +9 -9
  51. package/components/autosuggest/AutoSuggestAddons.js.map +1 -1
  52. package/components/banner/BannerActions.js +2 -2
  53. package/components/banner/BannerActions.js.map +1 -1
  54. package/components/banner/BannerIcon.js +3 -3
  55. package/components/banner/BannerIcon.js.map +1 -1
  56. package/components/banner/BannerPage.js +4 -4
  57. package/components/banner/BannerPage.js.map +1 -1
  58. package/components/button/Button.d.ts +7 -0
  59. package/components/button/Button.js +73 -65
  60. package/components/button/Button.js.map +1 -1
  61. package/components/charts/Area.d.ts +5 -3
  62. package/components/charts/Area.js +4 -3
  63. package/components/charts/Area.js.map +1 -1
  64. package/components/charts/AreaChart.js.map +1 -1
  65. package/components/charts/ComposedChart.js.map +1 -1
  66. package/components/checkbox/Checkbox.js +18 -17
  67. package/components/checkbox/Checkbox.js.map +1 -1
  68. package/components/clearableInput/ClearableInput.d.ts +30 -0
  69. package/components/clearableInput/ClearableInput.js +81 -78
  70. package/components/clearableInput/ClearableInput.js.map +1 -1
  71. package/components/datepicker/DateRangePicker.js +0 -2
  72. package/components/datepicker/DateRangePicker.js.map +1 -1
  73. package/components/datepicker/DayPicker.d.ts +4 -51
  74. package/components/datepicker/DayPicker.js +264 -256
  75. package/components/datepicker/DayPicker.js.map +1 -1
  76. package/components/datepicker/DayPickerCalendar.d.ts +4 -0
  77. package/components/datepicker/DayPickerCalendar.js +129 -0
  78. package/components/datepicker/DayPickerCalendar.js.map +1 -0
  79. package/components/datepicker/DayPickerDropdown.d.ts +18 -0
  80. package/components/datepicker/DayPickerDropdown.js +75 -0
  81. package/components/datepicker/DayPickerDropdown.js.map +1 -0
  82. package/components/datepicker/DayPickerDropdownFooter.d.ts +7 -0
  83. package/components/datepicker/DayPickerDropdownFooter.js +7 -0
  84. package/components/datepicker/DayPickerDropdownFooter.js.map +1 -0
  85. package/components/datepicker/DayPickerDropdownSidebar.d.ts +8 -0
  86. package/components/datepicker/DayPickerDropdownSidebar.js +7 -0
  87. package/components/datepicker/DayPickerDropdownSidebar.js.map +1 -0
  88. package/components/datepicker/DayPickerInput.d.ts +28 -0
  89. package/components/datepicker/DayPickerInput.js +65 -0
  90. package/components/datepicker/DayPickerInput.js.map +1 -0
  91. package/components/datepicker/DayPickerPrototype.d.ts +53 -0
  92. package/components/datepicker/DayPickerPrototype.js +285 -0
  93. package/components/datepicker/DayPickerPrototype.js.map +1 -0
  94. package/components/datepicker/dayPickerRangeSelectionUtils.d.ts +15 -0
  95. package/components/datepicker/dayPickerRangeSelectionUtils.js +31 -0
  96. package/components/datepicker/dayPickerRangeSelectionUtils.js.map +1 -0
  97. package/components/datepicker/dayPickerTypes.d.ts +517 -0
  98. package/components/datepicker/dayPickerTypes.js +7 -0
  99. package/components/datepicker/dayPickerTypes.js.map +1 -0
  100. package/components/datepicker/dayPickerUtils.d.ts +10 -0
  101. package/components/datepicker/dayPickerUtils.js +92 -0
  102. package/components/datepicker/dayPickerUtils.js.map +1 -0
  103. package/components/datepicker/useDayPickerInputState.d.ts +32 -0
  104. package/components/datepicker/useDayPickerInputState.js +85 -0
  105. package/components/datepicker/useDayPickerInputState.js.map +1 -0
  106. package/components/datepicker/useStackedDayPickerCalendars.d.ts +5 -0
  107. package/components/datepicker/useStackedDayPickerCalendars.js +39 -0
  108. package/components/datepicker/useStackedDayPickerCalendars.js.map +1 -0
  109. package/components/dialog/Dialog.js.map +1 -1
  110. package/components/dialog/DialogHeader.js +23 -20
  111. package/components/dialog/DialogHeader.js.map +1 -1
  112. package/components/dialog/MediaDialog.js +1 -1
  113. package/components/dialog/MediaDialog.js.map +1 -1
  114. package/components/divider/Divider.js +6 -6
  115. package/components/dropdown/ButtonDropdown.d.ts +4 -0
  116. package/components/dropdown/ButtonDropdown.js +70 -68
  117. package/components/dropdown/ButtonDropdown.js.map +1 -1
  118. package/components/dropdown/DropdownToggleButton.d.ts +1 -0
  119. package/components/dropdown/DropdownToggleButton.js +17 -15
  120. package/components/dropdown/DropdownToggleButton.js.map +1 -1
  121. package/components/editableContent/EditableContent.js +7 -7
  122. package/components/editableContent/EditableContent.js.map +1 -1
  123. package/components/expander/ExpanderList.d.ts +5 -0
  124. package/components/expander/ExpanderList.js +25 -16
  125. package/components/expander/ExpanderList.js.map +1 -1
  126. package/components/expander/ExpanderPanel.d.ts +5 -0
  127. package/components/expander/ExpanderPanel.js +29 -28
  128. package/components/expander/ExpanderPanel.js.map +1 -1
  129. package/components/fade/FadeExpander.js +17 -20
  130. package/components/fade/FadeExpander.js.map +1 -1
  131. package/components/filepicker/FilePicker.js.map +1 -1
  132. package/components/loadMore/LoadMoreButton.d.ts +5 -0
  133. package/components/loadMore/LoadMoreButton.js +33 -29
  134. package/components/loadMore/LoadMoreButton.js.map +1 -1
  135. package/components/loadMore/LoadMoreProgress.js +6 -7
  136. package/components/map/components/Map.js +3 -3
  137. package/components/map/components/features/ContextMenu.js +13 -13
  138. package/components/map/components/features/ContextMenu.js.map +1 -1
  139. package/components/map/components/features/basics/InfoBubble.js.map +1 -1
  140. package/components/map/components/features/settings/MapSettingsTile.js.map +1 -1
  141. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +6 -6
  142. package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js.map +1 -1
  143. package/components/map/utils/eventHandling.js +18 -18
  144. package/components/map/utils/eventHandling.js.map +1 -1
  145. package/components/map/utils/positions.d.ts +1 -1
  146. package/components/map/utils/positions.js +15 -12
  147. package/components/map/utils/positions.js.map +1 -1
  148. package/components/map/utils/rendering.d.ts +1 -1
  149. package/components/map/utils/rendering.js +5 -5
  150. package/components/menuItems/MenuItems.js +6 -6
  151. package/components/menuItems/MenuItems.js.map +1 -1
  152. package/components/notification/NotificationsContainer.js.map +1 -1
  153. package/components/numberInput/NumberInput.js +57 -56
  154. package/components/numberInput/NumberInput.js.map +1 -1
  155. package/components/popover/Popover.js +3 -3
  156. package/components/popover/Popover.js.map +1 -1
  157. package/components/radiobutton/RadioCardGroup.js +3 -3
  158. package/components/resizer/Resizer.js +6 -3
  159. package/components/resizer/Resizer.js.map +1 -1
  160. package/components/rioglyph/RioglyphIconType.d.ts +1 -1
  161. package/components/selects/BaseSelectDropdown.js +34 -32
  162. package/components/selects/BaseSelectDropdown.js.map +1 -1
  163. package/components/selects/Multiselect.d.ts +6 -0
  164. package/components/selects/Multiselect.js +164 -150
  165. package/components/selects/Multiselect.js.map +1 -1
  166. package/components/selects/MultiselectTogglePlaceholder.js.map +1 -1
  167. package/components/selects/MultiselectToggleSelection.js +11 -11
  168. package/components/selects/MultiselectToggleSelection.js.map +1 -1
  169. package/components/selects/Select.js +39 -37
  170. package/components/selects/Select.js.map +1 -1
  171. package/components/sidebars/Sidebar.js +12 -12
  172. package/components/sidebars/Sidebar.js.map +1 -1
  173. package/components/sidebars/SidebarCloseButton.js +2 -2
  174. package/components/sidebars/SidebarCloseButton.js.map +1 -1
  175. package/components/smoothScrollbars/SmoothScrollbars.d.ts +4 -3
  176. package/components/smoothScrollbars/SmoothScrollbars.js +11 -11
  177. package/components/smoothScrollbars/SmoothScrollbars.js.map +1 -1
  178. package/components/states/CustomState.js.map +1 -1
  179. package/components/svgImage/svgConverter.js.map +1 -1
  180. package/components/table/Table.d.ts +46 -0
  181. package/components/table/Table.js +256 -0
  182. package/components/table/Table.js.map +1 -0
  183. package/components/table/Table.types.d.ts +379 -0
  184. package/components/table/TableBody.d.ts +70 -0
  185. package/components/table/TableBody.js +135 -0
  186. package/components/table/TableBody.js.map +1 -0
  187. package/components/table/TableCardsSorting.js +25 -32
  188. package/components/table/TableCardsSorting.js.map +1 -1
  189. package/components/table/TableColumn.d.ts +55 -0
  190. package/components/table/TableColumn.js +115 -0
  191. package/components/table/TableColumn.js.map +1 -0
  192. package/components/table/TableExpandedContentRow.d.ts +22 -0
  193. package/components/table/TableExpandedContentRow.js +110 -0
  194. package/components/table/TableExpandedContentRow.js.map +1 -0
  195. package/components/table/TableExpandedRow.d.ts +22 -0
  196. package/components/table/TableExpandedRow.js +150 -0
  197. package/components/table/TableExpandedRow.js.map +1 -0
  198. package/components/table/TableExpanderButton.d.ts +25 -0
  199. package/components/table/TableExpanderButton.js +24 -0
  200. package/components/table/TableExpanderButton.js.map +1 -0
  201. package/components/table/TableFooter.d.ts +17 -0
  202. package/components/table/TableFooter.js +52 -0
  203. package/components/table/TableFooter.js.map +1 -0
  204. package/components/table/TableGroupFooterRow.d.ts +18 -0
  205. package/components/table/TableGroupFooterRow.js +30 -0
  206. package/components/table/TableGroupFooterRow.js.map +1 -0
  207. package/components/table/TableGroupRow.d.ts +24 -0
  208. package/components/table/TableGroupRow.js +36 -0
  209. package/components/table/TableGroupRow.js.map +1 -0
  210. package/components/table/TableHeader.d.ts +14 -0
  211. package/components/table/TableHeader.js +107 -0
  212. package/components/table/TableHeader.js.map +1 -0
  213. package/components/table/TableHeaderColumn.d.ts +76 -0
  214. package/components/table/TableHeaderColumn.js +81 -0
  215. package/components/table/TableHeaderColumn.js.map +1 -0
  216. package/components/table/TableHeaderRow.d.ts +9 -0
  217. package/components/table/TableHeaderRow.js +14 -0
  218. package/components/table/TableHeaderRow.js.map +1 -0
  219. package/components/table/TableRow.d.ts +24 -0
  220. package/components/table/TableRow.js +111 -0
  221. package/components/table/TableRow.js.map +1 -0
  222. package/components/table/TableSpacerRow.d.ts +13 -0
  223. package/components/table/TableSpacerRow.js +29 -0
  224. package/components/table/TableSpacerRow.js.map +1 -0
  225. package/components/table/TableToolbar.d.ts +3 -0
  226. package/components/table/TableToolbar.js +49 -4
  227. package/components/table/TableToolbar.js.map +1 -1
  228. package/components/table/TableToolbarColumn.d.ts +31 -0
  229. package/components/table/TableToolbarColumn.js +33 -0
  230. package/components/table/TableToolbarColumn.js.map +1 -0
  231. package/components/table/TableViewToggles.d.ts +21 -3
  232. package/components/table/TableViewToggles.js +59 -87
  233. package/components/table/TableViewToggles.js.map +1 -1
  234. package/components/table/context/TableInteractionContext.d.ts +26 -0
  235. package/components/table/context/TableInteractionContext.js +7 -0
  236. package/components/table/context/TableInteractionContext.js.map +1 -0
  237. package/components/table/context/TableLayoutContext.d.ts +25 -0
  238. package/components/table/context/TableLayoutContext.js +7 -0
  239. package/components/table/context/TableLayoutContext.js.map +1 -0
  240. package/components/table/context/TableRenderConfigContext.d.ts +27 -0
  241. package/components/table/context/TableRenderConfigContext.js +7 -0
  242. package/components/table/context/TableRenderConfigContext.js.map +1 -0
  243. package/components/table/context/TableRenderContext.d.ts +85 -0
  244. package/components/table/context/TableRenderContext.js +7 -0
  245. package/components/table/context/TableRenderContext.js.map +1 -0
  246. package/components/table/context/TableStructureContext.d.ts +31 -0
  247. package/components/table/context/TableStructureContext.js +17 -0
  248. package/components/table/context/TableStructureContext.js.map +1 -0
  249. package/components/table/layout/columnSizing.d.ts +3 -0
  250. package/components/table/layout/columnSizing.js +23 -0
  251. package/components/table/layout/columnSizing.js.map +1 -0
  252. package/components/table/layout/useDraggableColumns.d.ts +14 -0
  253. package/components/table/layout/useDraggableColumns.js +47 -0
  254. package/components/table/layout/useDraggableColumns.js.map +1 -0
  255. package/components/table/layout/useHorizontalSectionSync.d.ts +13 -0
  256. package/components/table/layout/useHorizontalSectionSync.js +43 -0
  257. package/components/table/layout/useHorizontalSectionSync.js.map +1 -0
  258. package/components/table/layout/useMeasuredColumnMaxWidths.d.ts +12 -0
  259. package/components/table/layout/useMeasuredColumnMaxWidths.js +85 -0
  260. package/components/table/layout/useMeasuredColumnMaxWidths.js.map +1 -0
  261. package/components/table/layout/useResizableColumns.d.ts +15 -0
  262. package/components/table/layout/useResizableColumns.js +132 -0
  263. package/components/table/layout/useResizableColumns.js.map +1 -0
  264. package/components/table/layout/useTableBodyScrollBottom.d.ts +12 -0
  265. package/components/table/layout/useTableBodyScrollBottom.js +37 -0
  266. package/components/table/layout/useTableBodyScrollBottom.js.map +1 -0
  267. package/components/table/layout/useTableLayout.d.ts +36 -0
  268. package/components/table/layout/useTableLayout.js +59 -0
  269. package/components/table/layout/useTableLayout.js.map +1 -0
  270. package/components/table/layout/useTableVirtualization.d.ts +22 -0
  271. package/components/table/layout/useTableVirtualization.js +125 -0
  272. package/components/table/layout/useTableVirtualization.js.map +1 -0
  273. package/components/table/model/resolveRowMeta.d.ts +3 -0
  274. package/components/table/model/resolveRowMeta.js +15 -0
  275. package/components/table/model/resolveRowMeta.js.map +1 -0
  276. package/components/table/model/resolveTableClassConfig.d.ts +47 -0
  277. package/components/table/model/resolveTableClassConfig.js +64 -0
  278. package/components/table/model/resolveTableClassConfig.js.map +1 -0
  279. package/components/table/model/tableView.types.d.ts +41 -0
  280. package/components/table/native/TableCol.js.map +1 -0
  281. package/components/table/{TableHead.js → native/TableHead.js} +2 -2
  282. package/components/table/native/TableHead.js.map +1 -0
  283. package/components/table/native/TableSettingsColumnButtons.js +59 -0
  284. package/components/table/native/TableSettingsColumnButtons.js.map +1 -0
  285. package/components/table/{TableSettingsColumnDetails.js → native/TableSettingsColumnDetails.js} +2 -2
  286. package/components/table/native/TableSettingsColumnDetails.js.map +1 -0
  287. package/components/table/{TableSettingsDialog.d.ts → native/TableSettingsDialog.d.ts} +2 -3
  288. package/components/table/native/TableSettingsDialog.js +216 -0
  289. package/components/table/native/TableSettingsDialog.js.map +1 -0
  290. package/components/table/{TableSettingsDialogFooter.js → native/TableSettingsDialogFooter.js} +2 -2
  291. package/components/table/native/TableSettingsDialogFooter.js.map +1 -0
  292. package/components/table/native/TableSettingsListContainer.js.map +1 -0
  293. package/components/table/native/TableSettingsListItem.js +100 -0
  294. package/components/table/native/TableSettingsListItem.js.map +1 -0
  295. package/components/table/render/body/TableBodyContent.d.ts +21 -0
  296. package/components/table/render/body/TableBodyContent.js +52 -0
  297. package/components/table/render/body/TableBodyContent.js.map +1 -0
  298. package/components/table/render/body/TableEmptyRow.d.ts +7 -0
  299. package/components/table/render/body/TableEmptyRow.js +6 -0
  300. package/components/table/render/body/TableEmptyRow.js.map +1 -0
  301. package/components/table/render/footer/TableFooterContent.d.ts +6 -0
  302. package/components/table/render/footer/TableFooterContent.js +6 -0
  303. package/components/table/render/footer/TableFooterContent.js.map +1 -0
  304. package/components/table/render/header/TableBatchDropdown.d.ts +13 -0
  305. package/components/table/render/header/TableBatchDropdown.js +30 -0
  306. package/components/table/render/header/TableBatchDropdown.js.map +1 -0
  307. package/components/table/render/header/TableColumnFilter.d.ts +66 -0
  308. package/components/table/render/header/TableColumnFilter.js +72 -0
  309. package/components/table/render/header/TableColumnFilter.js.map +1 -0
  310. package/components/table/render/header/TableDraggableHeaderCell.d.ts +4 -0
  311. package/components/table/render/header/TableDraggableHeaderCell.js +64 -0
  312. package/components/table/render/header/TableDraggableHeaderCell.js.map +1 -0
  313. package/components/table/render/header/TableHeader.types.d.ts +37 -0
  314. package/components/table/render/header/TableHeaderCellContent.d.ts +4 -0
  315. package/components/table/render/header/TableHeaderCellContent.js +57 -0
  316. package/components/table/render/header/TableHeaderCellContent.js.map +1 -0
  317. package/components/table/render/header/TableHeaderCellResizeHandle.d.ts +4 -0
  318. package/components/table/render/header/TableHeaderCellResizeHandle.js +22 -0
  319. package/components/table/render/header/TableHeaderCellResizeHandle.js.map +1 -0
  320. package/components/table/render/header/TableHeaderDragOverlay.d.ts +14 -0
  321. package/components/table/render/header/TableHeaderDragOverlay.js +35 -0
  322. package/components/table/render/header/TableHeaderDragOverlay.js.map +1 -0
  323. package/components/table/render/header/TableHeaderSelectionCell.d.ts +9 -0
  324. package/components/table/render/header/TableHeaderSelectionCell.js +41 -0
  325. package/components/table/render/header/TableHeaderSelectionCell.js.map +1 -0
  326. package/components/table/render/header/TableStaticHeaderCell.d.ts +4 -0
  327. package/components/table/render/header/TableStaticHeaderCell.js +48 -0
  328. package/components/table/render/header/TableStaticHeaderCell.js.map +1 -0
  329. package/components/table/render/header/resolveAriaSort.d.ts +3 -0
  330. package/components/table/render/header/resolveAriaSort.js +8 -0
  331. package/components/table/render/header/resolveAriaSort.js.map +1 -0
  332. package/components/table/render/header/resolveColumnCollisionDetection.d.ts +2 -0
  333. package/components/table/render/header/resolveColumnCollisionDetection.js +9 -0
  334. package/components/table/render/header/resolveColumnCollisionDetection.js.map +1 -0
  335. package/components/table/render/header/resolveHeaderCellClassName.d.ts +12 -0
  336. package/components/table/render/header/resolveHeaderCellClassName.js +23 -0
  337. package/components/table/render/header/resolveHeaderCellClassName.js.map +1 -0
  338. package/components/table/render/header/resolveHeaderCellStyle.d.ts +830 -0
  339. package/components/table/render/header/resolveHeaderCellStyle.js +9 -0
  340. package/components/table/render/header/resolveHeaderCellStyle.js.map +1 -0
  341. package/components/table/runtime/shouldAnimateBodyRows.d.ts +17 -0
  342. package/components/table/runtime/shouldAnimateBodyRows.js +5 -0
  343. package/components/table/runtime/shouldAnimateBodyRows.js.map +1 -0
  344. package/components/table/runtime/useRenderDraftState.d.ts +14 -0
  345. package/components/table/runtime/useRenderDraftState.js +80 -0
  346. package/components/table/runtime/useRenderDraftState.js.map +1 -0
  347. package/components/table/runtime/useResolvedRenderColumns.d.ts +43 -0
  348. package/components/table/runtime/useResolvedRenderColumns.js +113 -0
  349. package/components/table/runtime/useResolvedRenderColumns.js.map +1 -0
  350. package/components/table/runtime/useResolvedRenderHeader.d.ts +27 -0
  351. package/components/table/runtime/useResolvedRenderHeader.js +67 -0
  352. package/components/table/runtime/useResolvedRenderHeader.js.map +1 -0
  353. package/components/table/selection/useInternalTableSelectionState.d.ts +17 -0
  354. package/components/table/selection/useInternalTableSelectionState.js +28 -0
  355. package/components/table/selection/useInternalTableSelectionState.js.map +1 -0
  356. package/components/table/selection/useTableSelection.d.ts +82 -0
  357. package/components/table/selection/useTableSelection.js +35 -0
  358. package/components/table/selection/useTableSelection.js.map +1 -0
  359. package/components/table/settings/TableColumnsDropdown.d.ts +90 -0
  360. package/components/table/settings/TableColumnsDropdown.js +137 -0
  361. package/components/table/settings/TableColumnsDropdown.js.map +1 -0
  362. package/components/table/settings/TableColumnsDropdownItem.d.ts +8 -0
  363. package/components/table/settings/TableColumnsDropdownItem.js +66 -0
  364. package/components/table/settings/TableColumnsDropdownItem.js.map +1 -0
  365. package/components/table/shared/getAlignClassName.d.ts +3 -0
  366. package/components/table/shared/getAlignClassName.js +6 -0
  367. package/components/table/shared/getAlignClassName.js.map +1 -0
  368. package/components/table/shared/getCellContentOverflowClassName.d.ts +3 -0
  369. package/components/table/shared/getCellContentOverflowClassName.js +18 -0
  370. package/components/table/shared/getCellContentOverflowClassName.js.map +1 -0
  371. package/components/table/shared/getInteractiveRowProps.d.ts +15 -0
  372. package/components/table/shared/getInteractiveRowProps.js +15 -0
  373. package/components/table/shared/getInteractiveRowProps.js.map +1 -0
  374. package/components/table/shared/resolveTableAria.d.ts +2 -0
  375. package/components/table/shared/resolveTableAria.js +6 -0
  376. package/components/table/shared/resolveTableAria.js.map +1 -0
  377. package/components/table/tableSizing.constants.d.ts +4 -0
  378. package/components/table/tableSizing.constants.js +8 -0
  379. package/components/table/tableSizing.constants.js.map +1 -0
  380. package/components/teaser/TeaserContainer.js +3 -3
  381. package/components/teaser/TeaserContainer.js.map +1 -1
  382. package/components/virtualList/VirtualList.js +16 -13
  383. package/components/virtualList/VirtualList.js.map +1 -1
  384. package/googleAnalyticsUtils.d.ts +1 -0
  385. package/googleAnalyticsUtils.js +9 -0
  386. package/googleAnalyticsUtils.js.map +1 -0
  387. package/hooks/useCookies.js +17 -17
  388. package/hooks/useCookies.js.map +1 -1
  389. package/hooks/useDraggableElement.d.ts +35 -0
  390. package/hooks/useDraggableElement.js +49 -0
  391. package/hooks/useDraggableElement.js.map +1 -0
  392. package/hooks/useElapsedTime.js +4 -4
  393. package/hooks/useElapsedTime.js.map +1 -1
  394. package/hooks/useLocationSuggestions.js +13 -10
  395. package/hooks/useLocationSuggestions.js.map +1 -1
  396. package/hooks/useMergeRefs.js +12 -12
  397. package/hooks/useMergeRefs.js.map +1 -1
  398. package/hooks/usePrevious.d.ts +1 -1
  399. package/hooks/usePrevious.js.map +1 -1
  400. package/hooks/useResizeObserver.js +25 -10
  401. package/hooks/useResizeObserver.js.map +1 -1
  402. package/hooks/useRioCookieConsent.js +7 -4
  403. package/hooks/useRioCookieConsent.js.map +1 -1
  404. package/hooks/useSorting.js +10 -10
  405. package/hooks/useSorting.js.map +1 -1
  406. package/hooks/useStorage.js +12 -12
  407. package/hooks/useStorage.js.map +1 -1
  408. package/hooks/useSum.js +10 -7
  409. package/hooks/useSum.js.map +1 -1
  410. package/hooks/useTableSelection.js.map +1 -1
  411. package/hooks/useTimeout.js +6 -3
  412. package/hooks/useTimeout.js.map +1 -1
  413. package/hooks/useUrlState.js +3 -3
  414. package/package.json +17 -18
  415. package/routeUtils.js +12 -10
  416. package/utils/analytics/analyticsAnalysisUtils.d.ts +27 -0
  417. package/utils/analytics/analyticsAnalysisUtils.js +161 -0
  418. package/utils/analytics/analyticsAnalysisUtils.js.map +1 -0
  419. package/utils/analytics/autoTracking.d.ts +14 -0
  420. package/utils/analytics/autoTracking.js +19 -0
  421. package/utils/analytics/autoTracking.js.map +1 -0
  422. package/utils/analytics/createAnalyticsOverlayTooltip.d.ts +36 -0
  423. package/utils/analytics/createAnalyticsOverlayTooltip.js +203 -0
  424. package/utils/analytics/createAnalyticsOverlayTooltip.js.map +1 -0
  425. package/utils/analytics/googleAnalyticsUtils.d.ts +37 -0
  426. package/utils/analytics/googleAnalyticsUtils.js +37 -0
  427. package/utils/analytics/googleAnalyticsUtils.js.map +1 -0
  428. package/utils/analytics/logAnalyticsOverlayUnmatchedEntries.d.ts +8 -0
  429. package/utils/analytics/logAnalyticsOverlayUnmatchedEntries.js +61 -0
  430. package/utils/analytics/logAnalyticsOverlayUnmatchedEntries.js.map +1 -0
  431. package/utils/analytics/useAnalyticsOverlayDom.d.ts +11 -0
  432. package/utils/analytics/useAnalyticsOverlayDom.js +120 -0
  433. package/utils/analytics/useAnalyticsOverlayDom.js.map +1 -0
  434. package/utils/arrayMove.js +11 -0
  435. package/utils/arrayMove.js.map +1 -0
  436. package/utils/cssuseragent.js +2 -2
  437. package/utils/cssuseragent.js.map +1 -1
  438. package/utils/deviceUtils.js.map +1 -1
  439. package/utils/formatUtils.js.map +1 -1
  440. package/utils/hasUtilityClass.js +3 -3
  441. package/utils/hasUtilityClass.js.map +1 -1
  442. package/utils/hidePiiData.js.map +1 -1
  443. package/utils/init/checkForReleaseVersion.js +4 -4
  444. package/utils/init/checkForReleaseVersion.js.map +1 -1
  445. package/utils/init/styledLogs.js.map +1 -1
  446. package/utils/mergeRefs.js +3 -3
  447. package/utils/mergeRefs.js.map +1 -1
  448. package/utils/routeUtils.d.ts +37 -3
  449. package/utils/routeUtils.js +88 -70
  450. package/utils/routeUtils.js.map +1 -1
  451. package/utils/storageUtils.js +9 -9
  452. package/utils/storageUtils.js.map +1 -1
  453. package/version.d.ts +1 -1
  454. package/version.js +2 -2
  455. package/version.js.map +1 -1
  456. package/components/table/TableCol.js.map +0 -1
  457. package/components/table/TableHead.js.map +0 -1
  458. package/components/table/TableSettingsColumnButtons.js +0 -45
  459. package/components/table/TableSettingsColumnButtons.js.map +0 -1
  460. package/components/table/TableSettingsColumnDetails.js.map +0 -1
  461. package/components/table/TableSettingsDialog.js +0 -208
  462. package/components/table/TableSettingsDialog.js.map +0 -1
  463. package/components/table/TableSettingsDialogFooter.js.map +0 -1
  464. package/components/table/TableSettingsListContainer.js.map +0 -1
  465. package/components/table/TableSettingsListItem.js +0 -96
  466. package/components/table/TableSettingsListItem.js.map +0 -1
  467. /package/components/table/{TableCol.d.ts → native/TableCol.d.ts} +0 -0
  468. /package/components/table/{TableCol.js → native/TableCol.js} +0 -0
  469. /package/components/table/{TableHead.d.ts → native/TableHead.d.ts} +0 -0
  470. /package/components/table/{TableSettingsColumnButtons.d.ts → native/TableSettingsColumnButtons.d.ts} +0 -0
  471. /package/components/table/{TableSettingsColumnDetails.d.ts → native/TableSettingsColumnDetails.d.ts} +0 -0
  472. /package/components/table/{TableSettingsDialogFooter.d.ts → native/TableSettingsDialogFooter.d.ts} +0 -0
  473. /package/components/table/{TableSettingsListContainer.d.ts → native/TableSettingsListContainer.d.ts} +0 -0
  474. /package/components/table/{TableSettingsListContainer.js → native/TableSettingsListContainer.js} +0 -0
  475. /package/components/table/{TableSettingsListItem.d.ts → native/TableSettingsListItem.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"AreaChart.js","sources":["../../../src/components/charts/AreaChart.tsx"],"sourcesContent":["import type React from 'react';\nimport {\n AreaChart as RechartsAreaChart,\n Area as RechartsArea,\n Legend as RechartsLegend,\n Brush,\n CartesianGrid,\n ResponsiveContainer,\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n type XAxisProps,\n type YAxisProps,\n type AreaProps as RechartsAreaProps,\n} from 'recharts';\nimport { isObject } from 'es-toolkit/compat';\n\nimport { getColor, mapGridOptions } from './chartHelper';\nimport AreaGradient, { DEFAULT_ARIA_GRADIENT_ID, type AreaGradientProps } from './AreaGradient';\nimport ChartTooltip, { type ChartTooltipProps } from './ChartTooltip';\nimport { getLegendDefaultProps, type LegendProps } from './Legend';\nimport { renderAxis } from './XAxis';\nimport { getAreaDefaultProps, type AreaProps } from './Area';\nimport type { GridProps } from './ChartGrid';\nimport type { ResponsiveContainerProps } from './ResponsiveContainer';\nimport { renderReferenceLine, type ReferenceLineProps } from './ReferenceLine';\n\ntype RechartsAreaChartProps = React.ComponentProps<typeof RechartsAreaChart>;\n\nexport type AreaChartProps<T extends object> = Omit<RechartsAreaChartProps, 'data'> & {\n width?: number;\n height?: number;\n data: T[];\n dataUnit?: string;\n // biome-ignore lint/suspicious/noExplicitAny: unknown type\n dataKey?: string | number | ((obj: T) => any);\n gradients?: React.ReactElement<AreaGradientProps>[];\n areas: React.ReactElement<AreaProps>[];\n referenceLines?: React.ReactElement<ReferenceLineProps>[];\n xAxisOptions?: XAxisProps;\n yAxisOptions?: YAxisProps;\n additionalAxes?: React.ReactElement<XAxisProps | YAxisProps>[];\n gridOptions?: GridProps;\n showGrid?: boolean;\n containerOptions?: ResponsiveContainerProps;\n showXAxis?: boolean;\n showYAxis?: boolean;\n legend?: React.ReactElement<LegendProps> | boolean;\n tooltip?: React.ReactElement<ChartTooltipProps> | boolean;\n brush?: boolean;\n};\n\nconst AreaChart = <T extends object>(props: AreaChartProps<T>) => {\n const {\n width,\n height,\n data = [],\n dataUnit = '',\n dataKey = 'value',\n gradients = [],\n areas = [],\n referenceLines = [],\n xAxisOptions,\n yAxisOptions,\n gridOptions,\n containerOptions,\n showXAxis = true,\n showYAxis = false,\n additionalAxes = [],\n showGrid = false,\n legend,\n brush = false,\n tooltip = true,\n ...remainingProps\n } = props;\n\n const areasWithGradient = areas.map(area => {\n const areaPropsWithDefault = { ...getAreaDefaultProps(), ...area.props };\n const { strokeColor, ...remainingAreaProps } = areaPropsWithDefault;\n const gradientId = area.key;\n const stroke = getColor(strokeColor);\n return {\n area: (\n <RechartsArea\n {...(remainingAreaProps as Omit<RechartsAreaProps, 'ref'>)}\n key={area.key}\n stroke={stroke}\n fill={`url(#${gradientId})`}\n />\n ),\n gradient: <AreaGradient key={area.key} id={gradientId || DEFAULT_ARIA_GRADIENT_ID} color={strokeColor} />,\n };\n });\n\n const tooltipProps = isObject(tooltip) ? tooltip.props : {};\n const legendProps = isObject(legend) ? { ...getLegendDefaultProps(), ...legend.props } : ({} as LegendProps);\n\n return (\n <ResponsiveContainer\n minHeight={100}\n minWidth={100}\n initialDimension={{ width: 100, height: 100 }}\n {...containerOptions}\n >\n <RechartsAreaChart\n width={width}\n height={height}\n data={data}\n margin={{ top: 15, right: 15, left: 15, bottom: 15 }}\n {...remainingProps}\n >\n <defs>\n {gradients}\n {areasWithGradient.map(areaWithGradient => areaWithGradient.gradient)}\n </defs>\n\n {showGrid && <CartesianGrid strokeDasharray='3 3' {...mapGridOptions(gridOptions)} />}\n\n <RechartsXAxis hide={!showXAxis} dataKey={dataKey} {...xAxisOptions} />\n <RechartsYAxis hide={!showYAxis} unit={dataUnit} {...yAxisOptions} />\n\n {additionalAxes.map(renderAxis)}\n\n {tooltip && <ChartTooltip {...tooltipProps} />}\n\n {legend && legendProps && (\n <>\n {/* @ts-ignore: intentionally as formatter is different. See Legend component */}\n <RechartsLegend\n wrapperStyle={\n legendProps.verticalAlign === 'bottom' ? { bottom: 0 } : legendProps.wrapperStyle\n }\n {...legendProps}\n />\n </>\n )}\n\n {areasWithGradient.map(areaWithGradient => areaWithGradient.area)}\n\n {referenceLines.map(renderReferenceLine)}\n\n {brush && <Brush stroke={getColor('gray')} />}\n </RechartsAreaChart>\n </ResponsiveContainer>\n );\n};\n\nexport default AreaChart;\n"],"names":["AreaChart","props","width","height","data","dataUnit","dataKey","gradients","areas","referenceLines","xAxisOptions","yAxisOptions","gridOptions","containerOptions","showXAxis","showYAxis","additionalAxes","showGrid","legend","brush","tooltip","remainingProps","areasWithGradient","area","areaPropsWithDefault","getAreaDefaultProps","strokeColor","remainingAreaProps","gradientId","stroke","getColor","createElement","RechartsArea","AreaGradient","DEFAULT_ARIA_GRADIENT_ID","tooltipProps","isObject","legendProps","getLegendDefaultProps","jsx","ResponsiveContainer","jsxs","RechartsAreaChart","areaWithGradient","CartesianGrid","mapGridOptions","RechartsXAxis","RechartsYAxis","renderAxis","ChartTooltip","Fragment","RechartsLegend","renderReferenceLine","Brush"],"mappings":";;;;;;;;;;;AAmDA,MAAMA,KAAY,C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AAGZ;"}
1
+ {"version":3,"file":"AreaChart.js","sources":["../../../src/components/charts/AreaChart.tsx"],"sourcesContent":["import type React from 'react';\nimport {\n AreaChart as RechartsAreaChart,\n Area as RechartsArea,\n Legend as RechartsLegend,\n Brush,\n CartesianGrid,\n ResponsiveContainer,\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n type XAxisProps,\n type YAxisProps,\n type AreaProps as RechartsAreaProps,\n} from 'recharts';\nimport { isObject } from 'es-toolkit/compat';\n\nimport { getColor, mapGridOptions } from './chartHelper';\nimport AreaGradient, { DEFAULT_ARIA_GRADIENT_ID, type AreaGradientProps } from './AreaGradient';\nimport ChartTooltip, { type ChartTooltipProps } from './ChartTooltip';\nimport { getLegendDefaultProps, type LegendProps } from './Legend';\nimport { renderAxis } from './XAxis';\nimport { getAreaDefaultProps, type AreaProps } from './Area';\nimport type { GridProps } from './ChartGrid';\nimport type { ResponsiveContainerProps } from './ResponsiveContainer';\nimport { renderReferenceLine, type ReferenceLineProps } from './ReferenceLine';\n\ntype RechartsAreaChartProps = React.ComponentProps<typeof RechartsAreaChart>;\n\nexport type AreaChartProps<T extends object> = Omit<RechartsAreaChartProps, 'data'> & {\n width?: number;\n height?: number;\n data: T[];\n dataUnit?: string;\n // biome-ignore lint/suspicious/noExplicitAny: unknown type\n dataKey?: string | number | ((obj: T) => any);\n gradients?: React.ReactElement<AreaGradientProps>[];\n areas: React.ReactElement<AreaProps>[];\n referenceLines?: React.ReactElement<ReferenceLineProps>[];\n xAxisOptions?: XAxisProps;\n yAxisOptions?: YAxisProps;\n additionalAxes?: React.ReactElement<XAxisProps | YAxisProps>[];\n gridOptions?: GridProps;\n showGrid?: boolean;\n containerOptions?: ResponsiveContainerProps;\n showXAxis?: boolean;\n showYAxis?: boolean;\n legend?: React.ReactElement<LegendProps> | boolean;\n tooltip?: React.ReactElement<ChartTooltipProps> | boolean;\n brush?: boolean;\n};\n\nconst AreaChart = <T extends object>(props: AreaChartProps<T>) => {\n const {\n width,\n height,\n data = [],\n dataUnit = '',\n dataKey = 'value',\n gradients = [],\n areas = [],\n referenceLines = [],\n xAxisOptions,\n yAxisOptions,\n gridOptions,\n containerOptions,\n showXAxis = true,\n showYAxis = false,\n additionalAxes = [],\n showGrid = false,\n legend,\n brush = false,\n tooltip = true,\n ...remainingProps\n } = props;\n\n const areasWithGradient = areas.map(area => {\n const areaPropsWithDefault = { ...getAreaDefaultProps(), ...area.props };\n const { strokeColor, ...remainingAreaProps } = areaPropsWithDefault;\n const gradientId = area.key;\n const stroke = getColor(strokeColor);\n return {\n area: (\n <RechartsArea\n {...(remainingAreaProps as Omit<RechartsAreaProps<unknown, unknown>, 'ref'>)}\n key={area.key}\n stroke={stroke}\n fill={`url(#${gradientId})`}\n />\n ),\n gradient: <AreaGradient key={area.key} id={gradientId || DEFAULT_ARIA_GRADIENT_ID} color={strokeColor} />,\n };\n });\n\n const tooltipProps = isObject(tooltip) ? tooltip.props : {};\n const legendProps = isObject(legend) ? { ...getLegendDefaultProps(), ...legend.props } : ({} as LegendProps);\n\n return (\n <ResponsiveContainer\n minHeight={100}\n minWidth={100}\n initialDimension={{ width: 100, height: 100 }}\n {...containerOptions}\n >\n <RechartsAreaChart\n width={width}\n height={height}\n data={data}\n margin={{ top: 15, right: 15, left: 15, bottom: 15 }}\n {...remainingProps}\n >\n <defs>\n {gradients}\n {areasWithGradient.map(areaWithGradient => areaWithGradient.gradient)}\n </defs>\n\n {showGrid && <CartesianGrid strokeDasharray='3 3' {...mapGridOptions(gridOptions)} />}\n\n <RechartsXAxis hide={!showXAxis} dataKey={dataKey} {...xAxisOptions} />\n <RechartsYAxis hide={!showYAxis} unit={dataUnit} {...yAxisOptions} />\n\n {additionalAxes.map(renderAxis)}\n\n {tooltip && <ChartTooltip {...tooltipProps} />}\n\n {legend && legendProps && (\n <>\n {/* @ts-ignore: intentionally as formatter is different. See Legend component */}\n <RechartsLegend\n wrapperStyle={\n legendProps.verticalAlign === 'bottom' ? { bottom: 0 } : legendProps.wrapperStyle\n }\n {...legendProps}\n />\n </>\n )}\n\n {areasWithGradient.map(areaWithGradient => areaWithGradient.area)}\n\n {referenceLines.map(renderReferenceLine)}\n\n {brush && <Brush stroke={getColor('gray')} />}\n </RechartsAreaChart>\n </ResponsiveContainer>\n );\n};\n\nexport default AreaChart;\n"],"names":["AreaChart","props","width","height","data","dataUnit","dataKey","gradients","areas","referenceLines","xAxisOptions","yAxisOptions","gridOptions","containerOptions","showXAxis","showYAxis","additionalAxes","showGrid","legend","brush","tooltip","remainingProps","areasWithGradient","area","areaPropsWithDefault","getAreaDefaultProps","strokeColor","remainingAreaProps","gradientId","stroke","getColor","createElement","RechartsArea","AreaGradient","DEFAULT_ARIA_GRADIENT_ID","tooltipProps","isObject","legendProps","getLegendDefaultProps","jsx","ResponsiveContainer","jsxs","RechartsAreaChart","areaWithGradient","CartesianGrid","mapGridOptions","RechartsXAxis","RechartsYAxis","renderAxis","ChartTooltip","Fragment","RechartsLegend","renderReferenceLine","Brush"],"mappings":";;;;;;;;;;;AAmDA,MAAMA,KAAY,CAAmBC,MAA6B;AAC9D,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAO,CAAA;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,SAAAC,IAAU;AAAA,IACV,WAAAC,IAAY,CAAA;AAAA,IACZ,OAAAC,IAAQ,CAAA;AAAA,IACR,gBAAAC,IAAiB,CAAA;AAAA,IACjB,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,gBAAAC,IAAiB,CAAA;AAAA,IACjB,UAAAC,IAAW;AAAA,IACX,QAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,SAAAC,IAAU;AAAA,IACV,GAAGC;AAAA,EAAA,IACHpB,GAEEqB,IAAoBd,EAAM,IAAI,CAAAe,MAAQ;AACxC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,GAAmB,GAAGI,GAAc;AAAA,YACrE,gBAAA6B,EAACQ,KAAc,MAAM,CAAChC,GAAW,MAAMV,GAAW,GAAGM,GAAc;AAAA,YAElEK,EAAe,IAAIgC,CAAU;AAAA,YAE7B5B,KAAW,gBAAAmB,EAACU,GAAA,EAAc,GAAGd,EAAA,CAAc;AAAA,YAE3CjB,KAAUmB,KACP,gBAAAE,EAAAW,GAAA,EAEI,UAAA,gBAAAX;AAAA,cAACY;AAAAA,cAAA;AAAA,gBACG,cACId,EAAY,kBAAkB,WAAW,EAAE,QAAQ,EAAA,IAAMA,EAAY;AAAA,gBAExE,GAAGA;AAAA,cAAA;AAAA,YAAA,GAEZ;AAAA,YAGHf,EAAkB,IAAI,CAAAqB,MAAoBA,EAAiB,IAAI;AAAA,YAE/DlC,EAAe,IAAI2C,CAAmB;AAAA,YAEtCjC,KAAS,gBAAAoB,EAACc,GAAA,EAAM,QAAQvB,EAAS,MAAM,EAAA,CAAG;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/C;AAAA,EAAA;AAGZ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ComposedChart.js","sources":["../../../src/components/charts/ComposedChart.tsx"],"sourcesContent":["import type React from 'react';\nimport {\n ComposedChart as RechartsComposedChart,\n Line as RechartsLine,\n Bar as RechartsBar,\n Area as RechartsArea,\n Legend as RechartsLegend,\n Brush,\n CartesianGrid,\n ResponsiveContainer,\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n type XAxisProps,\n type YAxisProps,\n type AreaProps as RechartsAreaProps,\n type LineProps as RechartsLineProps,\n} from 'recharts';\nimport { isObject } from 'es-toolkit/compat';\n\nimport { getColor, mapGridOptions } from './chartHelper';\nimport ChartTooltip, { type ChartTooltipProps } from './ChartTooltip';\nimport { getLegendDefaultProps, type LegendProps } from './Legend';\nimport { renderAxis } from './XAxis';\nimport { getBarDefaultProps, type BarProps } from './Bar';\nimport { renderReferenceLine, type ReferenceLineProps } from './ReferenceLine';\nimport { getLineDefaultProps, type LineProps } from './Line';\nimport { getAreaDefaultProps, type AreaProps } from './Area';\nimport type { GridProps } from './ChartGrid';\nimport type { ResponsiveContainerProps } from './ResponsiveContainer';\n\ntype RechartsComposedChartProps = React.ComponentProps<typeof RechartsComposedChart>;\n\nexport type ComposedChartProps<T extends object> = Omit<RechartsComposedChartProps, 'data'> & {\n width?: number;\n height?: number;\n data: T[];\n dataUnit?: string;\n // biome-ignore lint/suspicious/noExplicitAny: unknown type\n dataKey?: string | number | ((obj: T) => any);\n lines?: React.ReactElement<LineProps>[];\n bars?: React.ReactElement<BarProps>[];\n areas?: React.ReactElement<AreaProps>[];\n referenceLines?: React.ReactElement<ReferenceLineProps>[];\n xAxisOptions?: XAxisProps;\n yAxisOptions?: YAxisProps;\n additionalAxes?: React.ReactElement<XAxisProps | YAxisProps>[];\n gridOptions?: GridProps;\n containerOptions?: ResponsiveContainerProps;\n showXAxis?: boolean;\n showYAxis?: boolean;\n showGrid?: boolean;\n legend?: React.ReactElement<LegendProps> | boolean;\n tooltip?: React.ReactElement<ChartTooltipProps> | boolean;\n brush?: boolean;\n};\n\nconst ComposedChart = <T extends object>(props: ComposedChartProps<T>) => {\n const {\n width,\n height,\n data = [],\n dataUnit = '',\n dataKey = 'value',\n lines = [],\n bars = [],\n areas = [],\n referenceLines = [],\n xAxisOptions,\n yAxisOptions,\n additionalAxes = [],\n gridOptions,\n containerOptions,\n showXAxis = true,\n showYAxis = false,\n showGrid = false,\n legend,\n brush = false,\n tooltip = true,\n ...remainingProps\n } = props;\n\n const tooltipProps = isObject(tooltip) ? tooltip.props : {};\n const legendProps = isObject(legend) ? { ...getLegendDefaultProps(), ...legend.props } : {};\n\n return (\n <ResponsiveContainer\n minHeight={100}\n minWidth={100}\n initialDimension={{ width: 100, height: 100 }}\n {...containerOptions}\n >\n <RechartsComposedChart\n width={width}\n height={height}\n data={data}\n margin={{ top: 15, right: 15, left: 15, bottom: 15 }}\n {...remainingProps}\n >\n {showGrid && <CartesianGrid strokeDasharray='3 3' {...mapGridOptions(gridOptions)} />}\n\n <RechartsXAxis hide={!showXAxis} dataKey={dataKey} {...xAxisOptions} />\n <RechartsYAxis hide={!showYAxis} unit={dataUnit} {...yAxisOptions} />\n\n {additionalAxes.map(renderAxis)}\n\n {tooltip && <ChartTooltip {...tooltipProps} />}\n\n {legend && <RechartsLegend {...legendProps} />}\n\n {areas.map(area => {\n const areaPropsWithDefault = { ...getAreaDefaultProps(), ...area.props };\n const { strokeColor, fill, ...remainingAreaProps } = areaPropsWithDefault;\n return (\n <RechartsArea\n {...(remainingAreaProps as Omit<RechartsAreaProps, 'ref'>)}\n key={area.key}\n stroke={getColor(strokeColor)}\n fill={getColor(fill)}\n />\n );\n })}\n\n {bars.map(bar => {\n const barPropsWithDefault = { ...getBarDefaultProps(), ...bar.props };\n const { color, ...remainingBarProps } = barPropsWithDefault;\n const cellColor = color && getColor(color);\n return <RechartsBar key={bar.key} unit={dataUnit} {...remainingBarProps} fill={cellColor} />;\n })}\n\n {lines.map(line => {\n const linePropsWithDefault = { ...getLineDefaultProps(), ...line.props };\n const { strokeColor, ...remainingLineProps } = linePropsWithDefault;\n return (\n <RechartsLine\n {...(remainingLineProps as Omit<RechartsLineProps, 'ref'>)}\n key={line.key}\n stroke={getColor(strokeColor)}\n />\n );\n })}\n\n {referenceLines.map(renderReferenceLine)}\n\n {brush && <Brush stroke={getColor('gray')} />}\n </RechartsComposedChart>\n </ResponsiveContainer>\n );\n};\n\nexport default ComposedChart;\n"],"names":["ComposedChart","props","width","height","data","dataUnit","dataKey","lines","bars","areas","referenceLines","xAxisOptions","yAxisOptions","additionalAxes","gridOptions","containerOptions","showXAxis","showYAxis","showGrid","legend","brush","tooltip","remainingProps","tooltipProps","isObject","legendProps","getLegendDefaultProps","jsx","ResponsiveContainer","jsxs","RechartsComposedChart","CartesianGrid","mapGridOptions","RechartsXAxis","RechartsYAxis","renderAxis","ChartTooltip","RechartsLegend","area","areaPropsWithDefault","getAreaDefaultProps","strokeColor","fill","remainingAreaProps","createElement","RechartsArea","getColor","bar","barPropsWithDefault","getBarDefaultProps","color","remainingBarProps","cellColor","RechartsBar","line","linePropsWithDefault","getLineDefaultProps","remainingLineProps","RechartsLine","renderReferenceLine","Brush"],"mappings":";;;;;;;;;;;;AAwDA,MAAMA,KAAgB,CAAmBC,MAAiC;AACtE,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAO,CAAA;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,SAAAC,IAAU;AAAA,IACV,OAAAC,IAAQ,CAAA;AAAA,IACR,MAAAC,IAAO,CAAA;AAAA,IACP,OAAAC,IAAQ,CAAA;AAAA,IACR,gBAAAC,IAAiB,CAAA;AAAA,IACjB,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC,IAAiB,CAAA;AAAA,IACjB,aAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,UAAAC,IAAW;AAAA,IACX,QAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,SAAAC,IAAU;AAAA,IACV,GAAGC;AAAA,EAAA,IACHrB,GAEEsB,IAAeC,EAASH,CAAO,IAAIA,EAAQ,QAAQ,CAAA,GACnDI,IAAcD,EAASL,CAAM,IAAI,EAAE,GAAGO,EAAA,GAAyB,GAAGP,EAAO,MAAA,IAAU,CAAA;AAEzF,SACI,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,WAAW;AAAA,MACX,UAAU;AAAA,MACV,kBAAkB,EAAE,OAAO,KAAK,QAAQ,IAAA;AAAA,MACvC,GAAGb;AAAA,MAEJ,UAAA,gBAAAc;AAAA,QAACC;AAAAA,QAAA;AAAA,UACG,OAAA5B;AAAA,UACA,QAAAC;AAAA,UACA,MAAAC;AAAA,UACA,QAAQ,EAAE,KAAK,IAAI,OAAO,IAAI,MAAM,IAAI,QAAQ,G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,GAAa,GAAGgB,EAAA,IAAuBF;AAC/C,qBACI,gBAAAX;AAAA,gBAACc;AAAAA,gBAAA;AAAA,kBACI,GAAID;AAAA,kBACL,KAAKH,EAAK;AAAA,kBACV,QAAQR,EAASL,CAAW;AAAA,gBAAA;AAAA,cAAA;AAAA,YAGxC,CAAC;AAAA,YAEA/B,EAAe,IAAIiD,CAAmB;AAAA,YAEtCvC,KAAS,gBAAAO,EAACiC,GAAA,EAAM,QAAQd,EAAS,MAAM,EAAA,CAAG;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/C;AAAA,EAAA;AAGZ;"}
1
+ {"version":3,"file":"ComposedChart.js","sources":["../../../src/components/charts/ComposedChart.tsx"],"sourcesContent":["import type React from 'react';\nimport {\n ComposedChart as RechartsComposedChart,\n Line as RechartsLine,\n Bar as RechartsBar,\n Area as RechartsArea,\n Legend as RechartsLegend,\n Brush,\n CartesianGrid,\n ResponsiveContainer,\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n type XAxisProps,\n type YAxisProps,\n type AreaProps as RechartsAreaProps,\n type LineProps as RechartsLineProps,\n} from 'recharts';\nimport { isObject } from 'es-toolkit/compat';\n\nimport { getColor, mapGridOptions } from './chartHelper';\nimport ChartTooltip, { type ChartTooltipProps } from './ChartTooltip';\nimport { getLegendDefaultProps, type LegendProps } from './Legend';\nimport { renderAxis } from './XAxis';\nimport { getBarDefaultProps, type BarProps } from './Bar';\nimport { renderReferenceLine, type ReferenceLineProps } from './ReferenceLine';\nimport { getLineDefaultProps, type LineProps } from './Line';\nimport { getAreaDefaultProps, type AreaProps } from './Area';\nimport type { GridProps } from './ChartGrid';\nimport type { ResponsiveContainerProps } from './ResponsiveContainer';\n\ntype RechartsComposedChartProps = React.ComponentProps<typeof RechartsComposedChart>;\n\nexport type ComposedChartProps<T extends object> = Omit<RechartsComposedChartProps, 'data'> & {\n width?: number;\n height?: number;\n data: T[];\n dataUnit?: string;\n // biome-ignore lint/suspicious/noExplicitAny: unknown type\n dataKey?: string | number | ((obj: T) => any);\n lines?: React.ReactElement<LineProps>[];\n bars?: React.ReactElement<BarProps>[];\n areas?: React.ReactElement<AreaProps>[];\n referenceLines?: React.ReactElement<ReferenceLineProps>[];\n xAxisOptions?: XAxisProps;\n yAxisOptions?: YAxisProps;\n additionalAxes?: React.ReactElement<XAxisProps | YAxisProps>[];\n gridOptions?: GridProps;\n containerOptions?: ResponsiveContainerProps;\n showXAxis?: boolean;\n showYAxis?: boolean;\n showGrid?: boolean;\n legend?: React.ReactElement<LegendProps> | boolean;\n tooltip?: React.ReactElement<ChartTooltipProps> | boolean;\n brush?: boolean;\n};\n\nconst ComposedChart = <T extends object>(props: ComposedChartProps<T>) => {\n const {\n width,\n height,\n data = [],\n dataUnit = '',\n dataKey = 'value',\n lines = [],\n bars = [],\n areas = [],\n referenceLines = [],\n xAxisOptions,\n yAxisOptions,\n additionalAxes = [],\n gridOptions,\n containerOptions,\n showXAxis = true,\n showYAxis = false,\n showGrid = false,\n legend,\n brush = false,\n tooltip = true,\n ...remainingProps\n } = props;\n\n const tooltipProps = isObject(tooltip) ? tooltip.props : {};\n const legendProps = isObject(legend) ? { ...getLegendDefaultProps(), ...legend.props } : {};\n\n return (\n <ResponsiveContainer\n minHeight={100}\n minWidth={100}\n initialDimension={{ width: 100, height: 100 }}\n {...containerOptions}\n >\n <RechartsComposedChart\n width={width}\n height={height}\n data={data}\n margin={{ top: 15, right: 15, left: 15, bottom: 15 }}\n {...remainingProps}\n >\n {showGrid && <CartesianGrid strokeDasharray='3 3' {...mapGridOptions(gridOptions)} />}\n\n <RechartsXAxis hide={!showXAxis} dataKey={dataKey} {...xAxisOptions} />\n <RechartsYAxis hide={!showYAxis} unit={dataUnit} {...yAxisOptions} />\n\n {additionalAxes.map(renderAxis)}\n\n {tooltip && <ChartTooltip {...tooltipProps} />}\n\n {legend && <RechartsLegend {...legendProps} />}\n\n {areas.map(area => {\n const areaPropsWithDefault = { ...getAreaDefaultProps(), ...area.props };\n const { strokeColor, fill, ...remainingAreaProps } = areaPropsWithDefault;\n return (\n <RechartsArea\n {...(remainingAreaProps as Omit<RechartsAreaProps<unknown, unknown>, 'ref'>)}\n key={area.key}\n stroke={getColor(strokeColor)}\n fill={getColor(fill)}\n />\n );\n })}\n\n {bars.map(bar => {\n const barPropsWithDefault = { ...getBarDefaultProps(), ...bar.props };\n const { color, ...remainingBarProps } = barPropsWithDefault;\n const cellColor = color && getColor(color);\n return <RechartsBar key={bar.key} unit={dataUnit} {...remainingBarProps} fill={cellColor} />;\n })}\n\n {lines.map(line => {\n const linePropsWithDefault = { ...getLineDefaultProps(), ...line.props };\n const { strokeColor, ...remainingLineProps } = linePropsWithDefault;\n return (\n <RechartsLine\n {...(remainingLineProps as Omit<RechartsLineProps, 'ref'>)}\n key={line.key}\n stroke={getColor(strokeColor)}\n />\n );\n })}\n\n {referenceLines.map(renderReferenceLine)}\n\n {brush && <Brush stroke={getColor('gray')} />}\n </RechartsComposedChart>\n </ResponsiveContainer>\n );\n};\n\nexport default ComposedChart;\n"],"names":["ComposedChart","props","width","height","data","dataUnit","dataKey","lines","bars","areas","referenceLines","xAxisOptions","yAxisOptions","additionalAxes","gridOptions","containerOptions","showXAxis","showYAxis","showGrid","legend","brush","tooltip","remainingProps","tooltipProps","isObject","legendProps","getLegendDefaultProps","jsx","ResponsiveContainer","jsxs","RechartsComposedChart","CartesianGrid","mapGridOptions","RechartsXAxis","RechartsYAxis","renderAxis","ChartTooltip","RechartsLegend","area","areaPropsWithDefault","getAreaDefaultProps","strokeColor","fill","remainingAreaProps","createElement","RechartsArea","getColor","bar","barPropsWithDefault","getBarDefaultProps","color","remainingBarProps","cellColor","RechartsBar","line","linePropsWithDefault","getLineDefaultProps","remainingLineProps","RechartsLine","renderReferenceLine","Brush"],"mappings":";;;;;;;;;;;;AAwDA,MAAMA,KAAgB,CAAmBC,MAAiC;AACtE,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAA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AAQd,EAAS,MAAM,EAAA,CAAG;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/C;AAAA,EAAA;AAGZ;"}
@@ -3,20 +3,20 @@ import { useRef as H, useEffect as K } from "react";
3
3
  import { noop as k } from "es-toolkit/function";
4
4
  import p from "../../utils/classNames.js";
5
5
  import { CheckboxIcon as P } from "./CheckboxIcon.js";
6
- const S = 16, x = "vertical", V = "horizontal", I = (i) => {
6
+ const S = 16, x = "vertical", V = "horizontal", I = (l) => {
7
7
  const {
8
8
  checked: L,
9
9
  children: o,
10
- className: l,
10
+ className: d,
11
11
  custom: m = !1,
12
12
  defaultChecked: g,
13
- disabled: d = !1,
13
+ disabled: c = !1,
14
14
  error: N = !1,
15
- icon: c = "",
15
+ icon: s = "",
16
16
  iconLabelPosition: E = x,
17
17
  iconSize: _ = S,
18
- id: f = i.name,
19
- indeterminate: s = !1,
18
+ id: f = l.name,
19
+ indeterminate: a = !1,
20
20
  inline: A = !1,
21
21
  inputRef: O,
22
22
  label: R,
@@ -28,11 +28,11 @@ const S = 16, x = "vertical", V = "horizontal", I = (i) => {
28
28
  size: C,
29
29
  tabIndex: B = 0,
30
30
  ...w
31
- } = i, n = H(null);
31
+ } = l, n = H(null);
32
32
  K(() => {
33
33
  const e = n.current?.firstChild;
34
- e && (e.indeterminate = s);
35
- }, [s, n.current]);
34
+ e && (e.indeterminate = a);
35
+ }, [a, n.current]);
36
36
  const z = (e) => {
37
37
  switch (e.key) {
38
38
  case " ":
@@ -43,21 +43,22 @@ const S = 16, x = "vertical", V = "horizontal", I = (i) => {
43
43
  break;
44
44
  }
45
45
  }, b = (e) => {
46
- if (e.preventDefault(), d)
46
+ if (e.preventDefault(), c)
47
47
  return;
48
48
  const t = n.current?.firstChild;
49
49
  t.indeterminate && (t.indeterminate = !1), t.checked = !t.checked, u(e), h(e);
50
- }, a = R || o, Z = p(
50
+ }, i = R || o, Z = p(
51
51
  "checkbox",
52
52
  A && "checkbox-inline",
53
53
  C === "large" && "checkbox-large",
54
54
  y && "checkbox-right",
55
- l
55
+ c && "disabled",
56
+ d
56
57
  ), j = p(
57
58
  N && "error",
58
59
  C === "large" && "large",
59
- s && "indeterminate",
60
- l
60
+ a && "indeterminate",
61
+ d
61
62
  );
62
63
  return /* @__PURE__ */ F(
63
64
  "label",
@@ -78,15 +79,15 @@ const S = 16, x = "vertical", V = "horizontal", I = (i) => {
78
79
  checked: L,
79
80
  required: T,
80
81
  defaultChecked: g,
81
- disabled: d,
82
+ disabled: c,
82
83
  className: j,
83
84
  onClick: u,
84
85
  onChange: h,
85
86
  ref: O
86
87
  }
87
88
  ),
88
- !!c && /* @__PURE__ */ r(P, { icon: c, iconSize: _, iconLabelPosition: E, text: a }),
89
- !c && !m && /* @__PURE__ */ r("span", { className: "checkbox-text", children: a && /* @__PURE__ */ r("span", { children: a }) }),
89
+ !!s && /* @__PURE__ */ r(P, { icon: s, iconSize: _, iconLabelPosition: E, text: i }),
90
+ !s && !m && /* @__PURE__ */ r("span", { className: "checkbox-text", children: i && /* @__PURE__ */ r("span", { children: i }) }),
90
91
  m && o && o
91
92
  ]
92
93
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../src/components/checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useRef, useEffect, type ReactNode, type PropsWithChildren } from 'react';\nimport { noop } from 'es-toolkit/function';\n\nimport classNames from '../../utils/classNames';\nimport { CheckboxIcon } from './CheckboxIcon';\n\nconst DEFAULT_ICON_SIZE = 16;\n\nconst ICON_LABEL_VERTICAL = 'vertical';\nconst ICON_LABEL_HORIZONTAL = 'horizontal';\n\nexport type CheckboxProps = {\n /**\n * Passed through as HTML attribute to the underlying input.\n * Set an `id` or a `name` otherwise.\n */\n id?: string;\n\n /**\n * Passed through as HTML attribute to the underlying input\n */\n name?: string;\n\n /**\n * Define some text or component as a label.\n */\n label?: string | ReactNode;\n\n /**\n * Define a custom icon for the checkbox by naming a rioglyph icon like `rioglyph-truck`.\n */\n icon?: string;\n\n /**\n * The icon size in pixel.\n */\n iconSize?: number;\n\n /**\n * The label position for a custom icon checkbox. Using this on a regular checkbox has no effect.\n *\n * Possible values are: `horizontal` or `vertical`.\n */\n iconLabelPosition?: typeof ICON_LABEL_VERTICAL | typeof ICON_LABEL_HORIZONTAL;\n\n /**\n * Callback function that is invoked when the checkbox is checked or unchecked.\n * @param event\n * @returns\n */\n onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;\n\n /**\n * Callback function that is invoked when the checkbox value changes.\n * This will also be invoked by a keyboard event.\n * @param event\n * @returns\n */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n\n /**\n * Defines whether the checkbox is checked or not (state cannot be changed).\n */\n checked?: boolean;\n\n /**\n * Defines whether the checkbox is initially checked or not (state can be changed on click).\n */\n defaultChecked?: boolean;\n\n /**\n * Defines whether the checkbox is disabled or not.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Allows for rendering a completely different layout with or without a checkbox tick.\n * Note, when using the `custom` option, make sure to wrap the children with the class name\n * `checkbox-text-wrapper`. For using the checkbox tick, use an element with class name\n * `checkbox-text`.\n *\n * @example\n * <div className='checkbox-text-wrapper display-flex justify-content-between'>\n * <div className='margin-right-15'>\n * <div className='text-medium text-size-16 text-color-darker'>Option 1</div>\n * <div className='text-color-dark'>This option is a first option</div>\n * </div>\n * <div className='checkbox-text' />\n * </div>\n */\n custom?: boolean;\n\n /**\n * Defines whether the checkbox is required or not.\n *\n * @default false\n */\n required?: boolean;\n\n /**\n * Defines if the checkbox is in an indeterminate state in regard to other checkboxes that may be in different\n * selection state.\n *\n * @default false\n */\n indeterminate?: boolean;\n\n /**\n * Defines whether the checkbox is applying an inline style. Use this in combination\n * with other checkboxes.\n *\n * @default false\n */\n inline?: boolean;\n\n /**\n * Defines whether the checkbox is on the right side.\n *\n * @default false\n */\n right?: boolean;\n\n /**\n * Use \"error\" to change color of the checkbox.\n *\n * @default false\n */\n error?: boolean;\n\n /**\n * Defines the size of the checkbox. Omitting this prop renders the Checkbox in normal size.\n *\n * Possible values are:\n * `large`\n */\n size?: 'large';\n\n /**\n * A React ref assigned to the input itself.\n */\n inputRef?: React.RefObject<HTMLInputElement>;\n\n /**\n * Number of the index used for keyboard support.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Additional classes to be set on the input field.\n */\n className?: string;\n};\n\ntype CheckboxEvent =\n | React.MouseEvent<HTMLInputElement>\n | React.ChangeEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLLabelElement>;\n\nconst Checkbox = (props: PropsWithChildren<CheckboxProps>) => {\n const {\n checked,\n children,\n className,\n custom = false,\n defaultChecked,\n disabled = false,\n error = false,\n icon = '',\n iconLabelPosition = ICON_LABEL_VERTICAL,\n iconSize = DEFAULT_ICON_SIZE,\n id = props.name,\n indeterminate = false,\n inline = false,\n inputRef,\n label,\n name,\n onChange = noop,\n onClick = noop,\n required = false,\n right,\n size,\n tabIndex = 0,\n ...remainingProps\n } = props;\n\n const labelRef = useRef<HTMLLabelElement>(null);\n\n useEffect(() => {\n const input = labelRef.current?.firstChild as HTMLInputElement;\n if (input) {\n input.indeterminate = indeterminate;\n }\n }, [indeterminate, labelRef.current]);\n\n const handleToggleKeyDown = (event: React.KeyboardEvent<HTMLLabelElement>) => {\n switch (event.key) {\n case ' ':\n // toggle on space\n toggle(event);\n break;\n case 'Enter':\n // open on enter\n toggle(event);\n break;\n default:\n break;\n }\n };\n\n const toggle = (event: CheckboxEvent) => {\n event.preventDefault();\n\n if (disabled) {\n return;\n }\n\n const input = labelRef.current?.firstChild as HTMLInputElement;\n\n if (input.indeterminate) {\n input.indeterminate = false;\n }\n\n input.checked = !input.checked;\n\n onClick(event as React.MouseEvent<HTMLInputElement>);\n onChange(event as React.ChangeEvent<HTMLInputElement>);\n };\n\n const text = label || children;\n\n const labelClassnames = classNames(\n 'checkbox',\n inline && 'checkbox-inline',\n size === 'large' && 'checkbox-large',\n right && 'checkbox-right',\n className\n );\n\n const inputClassnames = classNames(\n error && 'error',\n size === 'large' && 'large',\n indeterminate && 'indeterminate',\n className\n );\n\n const renderCustomIcon = !!icon;\n const renderCustomContent = custom && children;\n const renderDefault = !icon && !custom;\n\n return (\n <label\n {...remainingProps}\n className={labelClassnames}\n tabIndex={tabIndex}\n htmlFor={id}\n onKeyDown={handleToggleKeyDown}\n ref={labelRef}\n >\n <input\n id={id}\n name={name}\n type='checkbox'\n checked={checked}\n required={required}\n defaultChecked={defaultChecked}\n disabled={disabled}\n className={inputClassnames}\n onClick={onClick}\n onChange={onChange}\n ref={inputRef}\n />\n {renderCustomIcon && (\n <CheckboxIcon icon={icon} iconSize={iconSize} iconLabelPosition={iconLabelPosition} text={text} />\n )}\n {renderDefault && <span className='checkbox-text'>{text && <span>{text}</span>}</span>}\n {renderCustomContent && children}\n </label>\n );\n};\n\nCheckbox.ICON_LABEL_VERTICAL = ICON_LABEL_VERTICAL as typeof ICON_LABEL_VERTICAL;\nCheckbox.ICON_LABEL_HORIZONTAL = ICON_LABEL_HORIZONTAL as typeof ICON_LABEL_HORIZONTAL;\n\nexport default Checkbox;\n"],"names":["DEFAULT_ICON_SIZE","ICON_LABEL_VERTICAL","ICON_LABEL_HORIZONTAL","Checkbox","props","checked","children","className","custom","defaultChecked","disabled","error","icon","iconLabelPosition","iconSize","id","indeterminate","inline","inputRef","label","name","onChange","noop","onClick","required","right","size","tabIndex","remainingProps","labelRef","useRef","useEffect","input","handleToggleKeyDown","event","toggle","text","labelClassnames","classNames","inputClassnames","jsxs","jsx","CheckboxIcon"],"mappings":";;;;;AAMA,MAAMA,IAAoB,IAEpBC,IAAsB,YACtBC,IAAwB,cAwJxBC,IAAW,CAACC,MAA4C;AAC1D,QAAM;AAAA,IACF,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,gBAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ;AAAA,IACR,MAAAC,IAAO;AAA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IAAA;AAAA,MACI,GAAGZ;AAAA,MACJ,WAAWS;AAAA,MACX,UAAAV;AAAA,MACA,SAASZ;AAAA,MACT,WAAWkB;AAAA,MACX,KAAKJ;AAAA,MAEL,UAAA;AAAA,QAAA,gBAAAY;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,IAAA1B;AAAA,YACA,MAAAK;AAAA,YACA,MAAK;AAAA,YACL,SAAAf;AAAA,YACA,UAAAmB;AAAA,YACA,gBAAAf;AAAA,YACA,UAAAC;AAAA,YACA,WAAW6B;AAAA,YACX,SAAAhB;AAAA,YACA,UAAAF;AAAA,YACA,KAAKH;AAAA,UAAA;AAAA,QAAA;AAAA,QAxBQ,CAAC,CAACN,KA2Bf,gBAAA6B,EAACC,GAAA,EAAa,MAAA9B,GAAY,UAAAE,GAAoB,mBAAAD,GAAsC,MAAAuB,GAAY;AAAA,QAzBtF,CAACxB,KAAQ,CAACJ,uBA2BL,QAAA,EAAK,WAAU,iBAAiB,UAAA4B,KAAQ,gBAAAK,EAAC,QAAA,EAAM,UAAAL,EAAA,CAAK,EAAA,CAAQ;AAAA,QA5B3D5B,KAAUF,KA6BNA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpC;AAEAH,EAAS,sBAAsBF;AAC/BE,EAAS,wBAAwBD;"}
1
+ {"version":3,"file":"Checkbox.js","sources":["../../../src/components/checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useRef, useEffect, type ReactNode, type PropsWithChildren } from 'react';\nimport { noop } from 'es-toolkit/function';\n\nimport classNames from '../../utils/classNames';\nimport { CheckboxIcon } from './CheckboxIcon';\n\nconst DEFAULT_ICON_SIZE = 16;\n\nconst ICON_LABEL_VERTICAL = 'vertical';\nconst ICON_LABEL_HORIZONTAL = 'horizontal';\n\nexport type CheckboxProps = {\n /**\n * Passed through as HTML attribute to the underlying input.\n * Set an `id` or a `name` otherwise.\n */\n id?: string;\n\n /**\n * Passed through as HTML attribute to the underlying input\n */\n name?: string;\n\n /**\n * Define some text or component as a label.\n */\n label?: string | ReactNode;\n\n /**\n * Define a custom icon for the checkbox by naming a rioglyph icon like `rioglyph-truck`.\n */\n icon?: string;\n\n /**\n * The icon size in pixel.\n */\n iconSize?: number;\n\n /**\n * The label position for a custom icon checkbox. Using this on a regular checkbox has no effect.\n *\n * Possible values are: `horizontal` or `vertical`.\n */\n iconLabelPosition?: typeof ICON_LABEL_VERTICAL | typeof ICON_LABEL_HORIZONTAL;\n\n /**\n * Callback function that is invoked when the checkbox is checked or unchecked.\n * @param event\n * @returns\n */\n onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;\n\n /**\n * Callback function that is invoked when the checkbox value changes.\n * This will also be invoked by a keyboard event.\n * @param event\n * @returns\n */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n\n /**\n * Defines whether the checkbox is checked or not (state cannot be changed).\n */\n checked?: boolean;\n\n /**\n * Defines whether the checkbox is initially checked or not (state can be changed on click).\n */\n defaultChecked?: boolean;\n\n /**\n * Defines whether the checkbox is disabled or not.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Allows for rendering a completely different layout with or without a checkbox tick.\n * Note, when using the `custom` option, make sure to wrap the children with the class name\n * `checkbox-text-wrapper`. For using the checkbox tick, use an element with class name\n * `checkbox-text`.\n *\n * @example\n * <div className='checkbox-text-wrapper display-flex justify-content-between'>\n * <div className='margin-right-15'>\n * <div className='text-medium text-size-16 text-color-darker'>Option 1</div>\n * <div className='text-color-dark'>This option is a first option</div>\n * </div>\n * <div className='checkbox-text' />\n * </div>\n */\n custom?: boolean;\n\n /**\n * Defines whether the checkbox is required or not.\n *\n * @default false\n */\n required?: boolean;\n\n /**\n * Defines if the checkbox is in an indeterminate state in regard to other checkboxes that may be in different\n * selection state.\n *\n * @default false\n */\n indeterminate?: boolean;\n\n /**\n * Defines whether the checkbox is applying an inline style. Use this in combination\n * with other checkboxes.\n *\n * @default false\n */\n inline?: boolean;\n\n /**\n * Defines whether the checkbox is on the right side.\n *\n * @default false\n */\n right?: boolean;\n\n /**\n * Use \"error\" to change color of the checkbox.\n *\n * @default false\n */\n error?: boolean;\n\n /**\n * Defines the size of the checkbox. Omitting this prop renders the Checkbox in normal size.\n *\n * Possible values are:\n * `large`\n */\n size?: 'large';\n\n /**\n * A React ref assigned to the input itself.\n */\n inputRef?: React.RefObject<HTMLInputElement>;\n\n /**\n * Number of the index used for keyboard support.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Additional classes to be set on the input field.\n */\n className?: string;\n};\n\ntype CheckboxEvent =\n | React.MouseEvent<HTMLInputElement>\n | React.ChangeEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLLabelElement>;\n\nconst Checkbox = (props: PropsWithChildren<CheckboxProps>) => {\n const {\n checked,\n children,\n className,\n custom = false,\n defaultChecked,\n disabled = false,\n error = false,\n icon = '',\n iconLabelPosition = ICON_LABEL_VERTICAL,\n iconSize = DEFAULT_ICON_SIZE,\n id = props.name,\n indeterminate = false,\n inline = false,\n inputRef,\n label,\n name,\n onChange = noop,\n onClick = noop,\n required = false,\n right,\n size,\n tabIndex = 0,\n ...remainingProps\n } = props;\n\n const labelRef = useRef<HTMLLabelElement>(null);\n\n useEffect(() => {\n const input = labelRef.current?.firstChild as HTMLInputElement;\n if (input) {\n input.indeterminate = indeterminate;\n }\n }, [indeterminate, labelRef.current]);\n\n const handleToggleKeyDown = (event: React.KeyboardEvent<HTMLLabelElement>) => {\n switch (event.key) {\n case ' ':\n // toggle on space\n toggle(event);\n break;\n case 'Enter':\n // open on enter\n toggle(event);\n break;\n default:\n break;\n }\n };\n\n const toggle = (event: CheckboxEvent) => {\n event.preventDefault();\n\n if (disabled) {\n return;\n }\n\n const input = labelRef.current?.firstChild as HTMLInputElement;\n\n if (input.indeterminate) {\n input.indeterminate = false;\n }\n\n input.checked = !input.checked;\n\n onClick(event as React.MouseEvent<HTMLInputElement>);\n onChange(event as React.ChangeEvent<HTMLInputElement>);\n };\n\n const text = label || children;\n\n const labelClassnames = classNames(\n 'checkbox',\n inline && 'checkbox-inline',\n size === 'large' && 'checkbox-large',\n right && 'checkbox-right',\n disabled && 'disabled',\n className\n );\n\n const inputClassnames = classNames(\n error && 'error',\n size === 'large' && 'large',\n indeterminate && 'indeterminate',\n className\n );\n\n const renderCustomIcon = !!icon;\n const renderCustomContent = custom && children;\n const renderDefault = !icon && !custom;\n\n return (\n <label\n {...remainingProps}\n className={labelClassnames}\n tabIndex={tabIndex}\n htmlFor={id}\n onKeyDown={handleToggleKeyDown}\n ref={labelRef}\n >\n <input\n id={id}\n name={name}\n type='checkbox'\n checked={checked}\n required={required}\n defaultChecked={defaultChecked}\n disabled={disabled}\n className={inputClassnames}\n onClick={onClick}\n onChange={onChange}\n ref={inputRef}\n />\n {renderCustomIcon && (\n <CheckboxIcon icon={icon} iconSize={iconSize} iconLabelPosition={iconLabelPosition} text={text} />\n )}\n {renderDefault && <span className='checkbox-text'>{text && <span>{text}</span>}</span>}\n {renderCustomContent && children}\n </label>\n );\n};\n\nCheckbox.ICON_LABEL_VERTICAL = ICON_LABEL_VERTICAL as typeof ICON_LABEL_VERTICAL;\nCheckbox.ICON_LABEL_HORIZONTAL = ICON_LABEL_HORIZONTAL as typeof ICON_LABEL_HORIZONTAL;\n\nexport default Checkbox;\n"],"names":["DEFAULT_ICON_SIZE","ICON_LABEL_VERTICAL","ICON_LABEL_HORIZONTAL","Checkbox","props","checked","children","className","custom","defaultChecked","disabled","error","icon","iconLabelPosition","iconSize","id","indeterminate","inline","inputRef","label","name","onChange","noop","onClick","required","right","size","tabIndex","remainingProps","labelRef","useRef","useEffect","input","handleToggleKeyDown","event","toggle","text","labelClassnames","classNames","inputClassnames","jsxs","jsx","CheckboxIcon"],"mappings":";;;;;AAMA,MAAMA,IAAoB,IAEpBC,IAAsB,YACtBC,IAAwB,cAwJxBC,IAAW,CAACC,MAA4C;AAC1D,QAAM;AAAA,IACF,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC,I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B,KAAS;AAAA,IACTe,MAAS,WAAW;AAAA,IACpBV,KAAiB;AAAA,IACjBT;AAAA,EAAA;AAOJ,SACI,gBAAAiC;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGZ;AAAA,MACJ,WAAWS;AAAA,MACX,UAAAV;AAAA,MACA,SAASZ;AAAA,MACT,WAAWkB;AAAA,MACX,KAAKJ;AAAA,MAEL,UAAA;AAAA,QAAA,gBAAAY;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,IAAA1B;AAAA,YACA,MAAAK;AAAA,YACA,MAAK;AAAA,YACL,SAAAf;AAAA,YACA,UAAAmB;AAAA,YACA,gBAAAf;AAAA,YACA,UAAAC;AAAA,YACA,WAAW6B;AAAA,YACX,SAAAhB;AAAA,YACA,UAAAF;AAAA,YACA,KAAKH;AAAA,UAAA;AAAA,QAAA;AAAA,QAxBQ,CAAC,CAACN,KA2Bf,gBAAA6B,EAACC,GAAA,EAAa,MAAA9B,GAAY,UAAAE,GAAoB,mBAAAD,GAAsC,MAAAuB,GAAY;AAAA,QAzBtF,CAACxB,KAAQ,CAACJ,uBA2BL,QAAA,EAAK,WAAU,iBAAiB,UAAA4B,KAAQ,gBAAAK,EAAC,QAAA,EAAM,UAAAL,EAAA,CAAK,EAAA,CAAQ;AAAA,QA5B3D5B,KAAUF,KA6BNA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpC;AAEAH,EAAS,sBAAsBF;AAC/BE,EAAS,wBAAwBD;"}
@@ -148,6 +148,25 @@ export type ClearableInputProps = {
148
148
  * Note, this function may not be an empty function, otherwise the mask selection won't work
149
149
  */
150
150
  maskDispatch?: (appended: string, dynamicMasked: any) => any;
151
+ /**
152
+ * Pattern used by IMask date masks.
153
+ *
154
+ * @example
155
+ * 'Y-m-d'
156
+ */
157
+ pattern?: string;
158
+ /**
159
+ * Formats a typed date value to the masked string representation.
160
+ */
161
+ format?: (value: Date | null, masked: unknown) => string;
162
+ /**
163
+ * Parses the masked string representation back to a typed date value.
164
+ */
165
+ parse?: (value: string, masked: unknown) => Date | null;
166
+ /**
167
+ * Enables IMask autofix behavior for date and number masks.
168
+ */
169
+ autofix?: boolean | 'pad';
151
170
  /**
152
171
  * Controls when the mask pattern is visible.
153
172
  *
@@ -182,6 +201,17 @@ export type ClearableInputProps = {
182
201
  * @default false
183
202
  */
184
203
  disabled?: boolean;
204
+ /**
205
+ * Makes the input read-only.
206
+ */
207
+ readOnly?: boolean;
208
+ /**
209
+ * Controls whether the clear button is rendered.
210
+ * This might be useful to reuse this component for other use-cases.
211
+ *
212
+ * @default true
213
+ */
214
+ showClearButton?: boolean;
185
215
  /**
186
216
  * Additional classes to be set on the input element.
187
217
  */
@@ -1,58 +1,60 @@
1
- import { jsxs as ue, jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as ce, useState as d, useRef as pe } from "react";
3
- import { omit as me, isEmpty as fe } from "es-toolkit/compat";
4
- import { isNil as de, isFunction as he } from "es-toolkit/predicate";
1
+ import { jsxs as pe, jsx as u } from "react/jsx-runtime";
2
+ import { forwardRef as me, useState as d, useRef as fe } from "react";
3
+ import { omit as de, isEmpty as he } from "es-toolkit/compat";
4
+ import { isNil as Ce, isFunction as ge } from "es-toolkit/predicate";
5
5
  import { noop as t } from "es-toolkit/function";
6
- import { IMaskInput as ge } from "react-imask";
6
+ import { IMaskInput as ve } from "react-imask";
7
7
  import h from "../../utils/classNames.js";
8
- import ve from "../../hooks/usePrevious.js";
9
- import Ce from "../../hooks/useMergeRefs.js";
10
- const R = "text", ke = ["text", "password", "email"], T = (u) => !fe(`${u}`), Te = ce((u, g) => {
8
+ import ke from "../../hooks/usePrevious.js";
9
+ import ye from "../../hooks/useMergeRefs.js";
10
+ const R = "text", Ie = ["text", "password", "email"], T = (i) => !he(`${i}`), De = me((i, C) => {
11
11
  const {
12
- type: B = R,
13
- defaultValue: D,
12
+ type: D = R,
13
+ defaultValue: M,
14
14
  value: s,
15
- maxLength: M,
16
- tabIndex: S = 0,
15
+ showClearButton: g = !0,
16
+ maxLength: S,
17
+ tabIndex: O = 0,
17
18
  hasError: L = !1,
18
19
  inputRef: v,
19
- autoComplete: O,
20
- onChange: n = t,
21
- onBlur: _ = t,
22
- onFocus: j = t,
23
- onClear: C = t,
24
- onKeyPress: A = t,
25
- onClick: K = t,
26
- mask: k,
27
- maskPlaceholder: U = "_",
28
- maskVisibility: Y = "always",
29
- maskOverwrite: z = !0,
30
- maskDefinitions: $,
31
- maskDispatch: y,
32
- inputClassName: q = "",
20
+ autoComplete: _,
21
+ onChange: a = t,
22
+ onBlur: j = t,
23
+ onFocus: A = t,
24
+ onClear: k = t,
25
+ onKeyPress: K = t,
26
+ onClick: U = t,
27
+ mask: y,
28
+ maskPlaceholder: Y = "_",
29
+ maskVisibility: z = "always",
30
+ maskOverwrite: $ = !0,
31
+ maskDefinitions: q,
32
+ maskDispatch: I,
33
+ inputClassName: G = "",
33
34
  disabled: c = !1,
34
- className: I = "",
35
+ readOnly: H = !1,
36
+ className: P = "",
35
37
  children: p,
36
- ...G
37
- } = u, P = s || D || "", [b, H] = d(P), [w, J] = d(T(P)), [N, V] = d(!1), x = !de(s), o = pe(null), Q = Ce(o, v, g), r = !!k, W = () => {
38
- switch (Y) {
38
+ ...J
39
+ } = i, w = s || M || "", [b, Q] = d(w), [N, W] = d(T(w)), [V, x] = d(!1), B = !Ce(s), o = fe(null), X = ye(o, v, C), r = !!y, Z = () => {
40
+ switch (z) {
39
41
  case "always":
40
42
  return !0;
41
43
  case "onFocus":
42
- return N;
44
+ return V;
43
45
  case "never":
44
46
  return !1;
45
47
  default:
46
- return N;
48
+ return V;
47
49
  }
48
50
  }, l = (e = "") => {
49
- b !== e && (H(e), J(T(e)));
51
+ b !== e && (Q(e), W(T(e)));
50
52
  };
51
- ve(s) !== s && l(s);
52
- const X = (e) => {
53
- const a = e.target.value;
54
- x || l(a), n(a, e);
55
- }, Z = (e, a, Ie) => {
53
+ ke(s) !== s && l(s);
54
+ const ee = (e) => {
55
+ const n = e.target.value;
56
+ B || l(n), a(n, e);
57
+ }, te = (e, n, we) => {
56
58
  if (!o.current)
57
59
  return;
58
60
  const f = {
@@ -73,66 +75,67 @@ const R = "text", ke = ["text", "password", "email"], T = (u) => !fe(`${u}`), Te
73
75
  type: "change",
74
76
  timeStamp: Date.now()
75
77
  };
76
- f.target.unmaskedValue = a.unmaskedValue, x || l(e), n(e, f);
77
- }, ee = (e) => {
78
- V(!0), j(e);
79
- }, te = (e) => {
80
- V(!1), _(e);
78
+ f.target.unmaskedValue = n.unmaskedValue, B || l(e), a(e, f);
81
79
  }, se = (e) => {
82
- A(e);
80
+ x(!0), A(e);
81
+ }, ae = (e) => {
82
+ x(!1), j(e);
83
83
  }, ne = (e) => {
84
- l(""), n("", e), C && C(e);
85
- }, ae = h(
84
+ K(e);
85
+ }, oe = (e) => {
86
+ l(""), a("", e), k && k(e);
87
+ }, re = h(
86
88
  "ClearableInput",
87
89
  "input-group",
88
90
  L && "has-error",
89
91
  c && "pointer-events-none",
90
- I && I
91
- ), oe = h(
92
+ P && P
93
+ ), le = h(
92
94
  "form-control",
93
- q,
94
- w && "withClearButton",
95
+ G,
96
+ N && g && "withClearButton",
95
97
  r && "withInputMask",
96
98
  c && "disabled"
97
- ), re = h("clearButton", !w && "hide"), E = B?.toLowerCase(), le = ke.indexOf(E) !== -1 ? E : R, m = {
98
- ...me(G, ["value", "defaultValue", "onClear"]),
99
- className: oe,
100
- autoComplete: O,
101
- type: le,
99
+ ), ue = h("clearButton", (!N || !g) && "hide"), E = D?.toLowerCase(), ie = Ie.indexOf(E) !== -1 ? E : R, m = {
100
+ ...de(J, ["value", "defaultValue", "onClear"]),
101
+ className: le,
102
+ autoComplete: _,
103
+ type: ie,
102
104
  value: b,
103
- onKeyPress: se,
104
- onBlur: te,
105
- onFocus: ee,
106
- onChange: r ? void 0 : X,
105
+ onKeyPress: ne,
106
+ onBlur: ae,
107
+ onFocus: se,
108
+ onChange: r ? void 0 : ee,
107
109
  // In case of masked input, the onAccept callback is used
108
- onClick: K,
110
+ onClick: U,
109
111
  disabled: c,
110
- maxLength: r ? void 0 : M,
111
- tabIndex: S
112
+ readOnly: H,
113
+ maxLength: r ? void 0 : S,
114
+ tabIndex: O
112
115
  }, F = {};
113
- y && (F.dispatch = y);
114
- const ie = r ? /* @__PURE__ */ i(
115
- ge,
116
+ I && (F.dispatch = I);
117
+ const ce = r ? /* @__PURE__ */ u(
118
+ ve,
116
119
  {
117
120
  ...m,
118
- inputRef: Q,
119
- mask: k,
120
- definitions: $,
121
+ inputRef: X,
122
+ mask: y,
123
+ definitions: q,
121
124
  ...F,
122
- placeholderChar: U,
123
- onAccept: Z,
124
- lazy: !W(),
125
- overwrite: z
125
+ placeholderChar: Y,
126
+ onAccept: te,
127
+ lazy: !Z(),
128
+ overwrite: $
126
129
  }
127
- ) : /* @__PURE__ */ i("input", { ...m, ref: v || g });
128
- return /* @__PURE__ */ ue("div", { className: ae, children: [
129
- p && he(p) ? p(m) : ie,
130
- /* @__PURE__ */ i("span", { className: re, onClick: ne, children: /* @__PURE__ */ i("span", { className: "clearButtonIcon rioglyph rioglyph-remove-sign" }) })
130
+ ) : /* @__PURE__ */ u("input", { ...m, ref: v || C });
131
+ return /* @__PURE__ */ pe("div", { className: re, children: [
132
+ p && ge(p) ? p(m) : ce,
133
+ /* @__PURE__ */ u("span", { className: ue, onClick: oe, children: /* @__PURE__ */ u("span", { className: "clearButtonIcon rioglyph rioglyph-remove-sign" }) })
131
134
  ] });
132
135
  });
133
136
  export {
134
137
  R as DEFAULT_TYPE,
135
- ke as SUPPORTED_TYPES,
136
- Te as default
138
+ Ie as SUPPORTED_TYPES,
139
+ De as default
137
140
  };
138
141
  //# sourceMappingURL=ClearableInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClearableInput.js","sources":["../../../src/components/clearableInput/ClearableInput.tsx"],"sourcesContent":["/** biome-ignore-all lint/complexity/noBannedTypes: <explanation> */\nimport React, { useState, forwardRef, type ForwardedRef, useRef } from 'react';\nimport { isEmpty, omit } from 'es-toolkit/compat';\nimport { isFunction, isNil } from 'es-toolkit/predicate';\nimport { noop } from 'es-toolkit/function';\nimport { IMaskInput } from 'react-imask';\n\nimport classNames from '../../utils/classNames';\nimport usePrevious from '../../hooks/usePrevious';\nimport useMergeRefs from '../../hooks/useMergeRefs';\n\nexport const DEFAULT_TYPE = 'text';\nexport const SUPPORTED_TYPES = ['text', 'password', 'email'];\n\nexport type MaskVisibility = 'always' | 'onFocus' | 'never';\nexport type MaskDefinition = {\n mask: string;\n definitions?: Record<string, string | RegExp>;\n startsWith?: string;\n [key: string]: any;\n};\n\nexport type ClearableInputProps = {\n /**\n * Gives the input element the id.\n */\n id?: string;\n\n /**\n * Gives the input element a name.\n */\n name?: string;\n\n /**\n * The translated text that shall be shown when the input is empty.\n */\n placeholder?: string | React.ReactNode;\n\n /**\n * Defines the type of the input itself.\n *\n * There are three types supported:\n * `text`, `email`, `password`.\n *\n * @default 'text'\n */\n type?: 'text' | 'password' | 'email';\n\n /**\n * Initial value of the ClearableInput. Pass this prop if you want to use this\n * component as an uncontrolled component.\n */\n defaultValue?: string;\n\n /**\n * Value of the ClearableInput. Pass this prop if you want to use this\n * component as a controlled component.\n */\n value?: string;\n\n /**\n * Defines the maximum amount of characters that can be entered.\n */\n maxLength?: number;\n\n /**\n * Defines the tab index to be added to the input element.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Defined whether or not the input has the error styling.\n *\n * @default false\n */\n hasError?: boolean;\n\n /**\n * The callback ref for the underlying input. Alternatively, use can use a forward ref.\n */\n inputRef?: React.RefObject<HTMLInputElement>;\n\n /**\n * Sets autocomplete value for autosuggest forms.\n */\n autoComplete?: string;\n\n /**\n * Callback function for when the value changes. Receives new value as an argument.\n * @param newValue\n * @param event\n * @returns\n */\n onChange?: (\n newValue: string,\n event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLSpanElement>\n ) => void;\n\n /**\n * Callback function which gets triggered when the input looses the focus.\n * @param event\n * @returns\n */\n onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\n /**\n * Callback function which gets triggered when the input gains the focus.\n * @param event\n * @returns\n */\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\n /**\n * Callback function for when the value is cleared via the clear button.\n * @param event\n * @returns\n */\n onClear?: (event: React.MouseEvent<HTMLSpanElement>) => void;\n\n /**\n * Callback function for every key pressed including `Enter` key.\n * @param event\n * @returns\n */\n onKeyPress?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n\n /**\n * Callback triggered when clicked into the input to react on it like when using an auto suggest dropdown\n * @param event\n * @returns\n */\n onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;\n\n /**\n * The mask prop will allow to use the component with an input mask.\n * It defines the pattern that should be followed.\n *\n * For more details on masking, checkout the third party documentation for the\n * input mask here: {@link https://imask.js.org/guide.html}\n *\n * Simple masks can be defined as strings.\n *\n * The following characters will define mask format:\n *\n * - \"0\" = allowed input: \"0-9\" (digit)\n * - \"a\" = allowed input: \"a-z, A-Z\" (letter)\n * - \"*\" = allowed input: any character\n * - \"#\" = allowed input: \"0-9, a-z, A-Z\" (digit or letter)\n *\n * Other chars which is not in custom definitions supposed to be fixed:\n *\n * - [] - make input optional\n * - {} - include fixed part in unmasked value\n * - ` - prevent symbols shift back\n *\n * If definition character should be treated as fixed it should be escaped by \\\\ (E.g. \\\\0).\n *\n * Additionally you can provide custom definitions.\n *\n * @example\n * '-- ### ### ###' or '+49 00 000 00'\n */\n mask?: string | (string | RegExp)[] | RegExp | DateConstructor | number | Function | MaskDefinition[];\n\n /**\n * Placeholder to cover unfilled parts of the mask.\n *\n * @default '_'\n */\n maskPlaceholder?: string | null;\n\n /**\n * Enable characters overwriting\n *\n * @default true\n */\n maskOverwrite?: boolean | 'shift' | undefined;\n\n /**\n * Chooses the mask for dynamic masking depending on input value.\n * Note, this function may not be an empty function, otherwise the mask selection won't work\n */\n maskDispatch?: (appended: string, dynamicMasked: any) => any;\n\n /**\n * Controls when the mask pattern is visible.\n *\n * - 'always': Mask is always visible\n * - 'onFocus': Mask is hidden but shown when input is focused\n * - 'never': Mask is never shown\n *\n * @default 'always'\n */\n maskVisibility?: MaskVisibility;\n\n /**\n * Custom definitions to have more control over your mask. The defined character will be replaced in your mask.\n *\n * @example\n * mask='AAA AAA.AA'\n * maskDefinitions={{ A: /[A-Z0-9]/ }}\n */\n maskDefinitions?: Record<string, string | RegExp>;\n\n /**\n * Minimum value to be entered. This prop is extended to accept a Date\n * when used with an input mask.\n */\n min?: string | number | undefined | Date;\n\n /**\n * Maximum value to be entered. This prop is extended to accept a Date\n * when used with an input mask.\n */\n max?: string | number | undefined | Date;\n\n /**\n * Disabled the input component.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the input element.\n */\n inputClassName?: string;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n\n /**\n * Render-prop to customize the rendered input.\n *\n * The function gets the `inputProps` passed and is responsible for rendering the custom `<input>` component.\n *\n * Receives the computed `input` props so you can render your own field. See: {@link https://reactjs.org/docs/render-props.html}\n */\n children?: (props: React.InputHTMLAttributes<HTMLInputElement>) => React.ReactNode;\n};\n\nconst hasValue = (value: unknown) => !isEmpty(`${value}`);\n\nconst ClearableInput = forwardRef((props: ClearableInputProps, ref: ForwardedRef<HTMLInputElement>) => {\n const {\n type = DEFAULT_TYPE,\n defaultValue,\n value,\n maxLength,\n tabIndex = 0,\n hasError = false,\n inputRef,\n autoComplete,\n onChange = noop,\n onBlur = noop,\n onFocus = noop,\n onClear = noop,\n onKeyPress = noop,\n onClick = noop,\n mask,\n maskPlaceholder = '_',\n maskVisibility = 'always',\n maskOverwrite = true,\n maskDefinitions,\n maskDispatch,\n inputClassName = '',\n disabled = false,\n className = '',\n children,\n ...remainingProps\n } = props;\n\n const initialValue = value || defaultValue || '';\n\n const [inputValue, setInputValue] = useState(initialValue);\n const [showClear, setShowClear] = useState(hasValue(initialValue));\n const [isFocused, setIsFocused] = useState(false);\n\n const isControlled = !isNil(value);\n\n const internalMaskRef = useRef<HTMLInputElement>(null);\n const mergedInternalMaskRef = useMergeRefs(internalMaskRef, inputRef, ref);\n\n const hasMask = !!mask;\n\n // Calculate if mask should be visible (lazy=false means visible, lazy=true means hidden)\n const shouldShowMask = () => {\n switch (maskVisibility) {\n case 'always':\n return true;\n case 'onFocus':\n return isFocused;\n case 'never':\n return false;\n default:\n return isFocused;\n }\n };\n\n // Handles new input value and saves it in the local state.\n // The value stored in the state is used for rendering.\n const changeInternalValue = (newValue = '') => {\n // this is there to prevent that onChange and UNSAFE_componentWillReceiveProps set state at the same time\n if (inputValue === newValue) {\n return;\n }\n\n setInputValue(newValue);\n setShowClear(hasValue(newValue));\n };\n\n // important for when used as a controlled component and value changes from the outside.\n const previousValue = usePrevious(value);\n if (previousValue !== value) {\n changeInternalValue(value);\n }\n\n // only gets triggered on user interaction.\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = event.target.value;\n\n if (isControlled) {\n onChange(newValue, event);\n } else {\n changeInternalValue(newValue);\n onChange(newValue, event);\n }\n };\n\n const handleAccept = (newValue: string, maskRef: any, _event?: InputEvent) => {\n if (!internalMaskRef.current) {\n return;\n }\n\n // Simulate a ChangeEvent for backwards compatibility since react-imask does not return a change event itself\n const syntheticEvent = {\n target: internalMaskRef.current,\n currentTarget: internalMaskRef.current,\n // Standard synthetic event props\n bubbles: true,\n cancelable: true,\n defaultPrevented: false,\n isTrusted: true,\n preventDefault: () => {},\n stopPropagation: () => {},\n persist: () => {},\n nativeEvent: {} as any,\n type: 'change',\n timeStamp: Date.now(),\n } as unknown as React.ChangeEvent<HTMLInputElement>;\n\n // Set unmasked value manually if needed\n // (you can use data-attributes or attach it directly)\n (syntheticEvent.target as any).unmaskedValue = maskRef.unmaskedValue;\n\n if (isControlled) {\n onChange(newValue, syntheticEvent);\n } else {\n changeInternalValue(newValue);\n onChange(newValue, syntheticEvent);\n }\n };\n\n const handleInputFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true);\n onFocus(event);\n };\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(false);\n onBlur(event);\n };\n\n // Will be triggered on every key press but also when pressing 'Enter' for example\n const handleKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyPress(event);\n };\n\n const clearInputValue = (event: React.MouseEvent<HTMLSpanElement>) => {\n changeInternalValue('');\n onChange('', event);\n\n if (onClear) {\n onClear(event);\n }\n };\n\n const classes = classNames(\n 'ClearableInput',\n 'input-group',\n hasError && 'has-error',\n disabled && 'pointer-events-none',\n className && className\n );\n\n const inputClassNames = classNames(\n 'form-control',\n inputClassName,\n showClear && 'withClearButton',\n hasMask && 'withInputMask',\n disabled && 'disabled'\n );\n\n const clearButtonClassNames = classNames('clearButton', !showClear && 'hide');\n\n const convertedType = type?.toLowerCase();\n const inputType = SUPPORTED_TYPES.indexOf(convertedType) !== -1 ? convertedType : DEFAULT_TYPE;\n\n const inputProps = {\n ...omit(remainingProps, ['value', 'defaultValue', 'onClear']),\n className: inputClassNames,\n autoComplete,\n type: inputType,\n value: inputValue,\n onKeyPress: handleKeyPress,\n onBlur: handleInputBlur,\n onFocus: handleInputFocus,\n onChange: hasMask ? undefined : handleChange, // In case of masked input, the onAccept callback is used\n onClick,\n disabled,\n maxLength: hasMask ? undefined : maxLength,\n tabIndex,\n } as any;\n\n // The dispatch function may not be an empty function. Specify it when\n // using dynamic masking and need more control over which mask gets selected\n const maskDispatchObj: any = {};\n if (maskDispatch) {\n maskDispatchObj.dispatch = maskDispatch;\n }\n\n const input = hasMask ? (\n <IMaskInput\n {...inputProps}\n inputRef={mergedInternalMaskRef}\n mask={mask}\n definitions={maskDefinitions}\n {...maskDispatchObj}\n placeholderChar={maskPlaceholder}\n onAccept={handleAccept}\n lazy={!shouldShowMask()}\n overwrite={maskOverwrite}\n />\n ) : (\n <input {...inputProps} ref={inputRef || ref} />\n );\n\n return (\n <div className={classes}>\n {children && isFunction(children) ? children(inputProps) : input}\n <span className={clearButtonClassNames} onClick={clearInputValue}>\n <span className='clearButtonIcon rioglyph rioglyph-remove-sign' />\n </span>\n </div>\n );\n});\n\nexport default ClearableInput;\n"],"names":["DEFAULT_TYPE","SUPPORTED_TYPES","hasValue","value","isEmpty","ClearableInput","forwardRef","props","ref","type","defaultValue","maxLength","tabIndex","hasError","inputRef","autoComplete","onChange","noop","onBlur","onFocus","onClear","onKeyPress","onClick","mask","maskPlaceholder","maskVisibility","maskOverwrite","maskDefinitions","maskDispatch","inputClassName","disabled","className","children","remainingProps","initialValue","inputValue","setInputValue","useState","showClear","setShowClear","isFocused","setIsFocused","isControlled","isNil","internalMaskRef","useRef","mergedInternalMaskRef","useMergeRefs","hasMask","shouldShowMask","changeInternalValue","newValue","usePrevious","handleChange","event","handleAccept","maskRef","_event","syntheticEvent","handleInputFocus","handleInputBlur","handleKeyPress","clearInputValue","classes","classNames","inputClassNames","clearButtonClassNames","convertedType","inputType","inputProps","omit","maskDispatchObj","input","jsx","IMaskInput","jsxs","isFunction"],"mappings":";;;;;;;;;AAWO,MAAMA,IAAe,QACfC,KAAkB,CAAC,QAAQ,YAAY,OAAO,GAyOrDC,IAAW,CAACC,MAAmB,CAACC,GAAQ,GAAGD,CAAK,EAAE,GAElDE,KAAiBC,GAAW,CAACC,GAA4BC,MAAwC;AACnG,QAAM;AAAA,IACF,MAAAC,IAAOT;AAAA,IACP,cAAAU;AAAA,IACA,OAAAP;AAAA,IACA,WAAAQ;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC,IAAWC;AAAA,IACX,QAAAC,IAASD;AAAA,IACT,SAAAE,IAAUF;AAAA,IACV,SAAAG,IAAUH;AAAA,IACV,YAAAI,IAAaJ;AAAA,IACb,SAAAK,IAAUL;AAAA,IACV,MAAAM;AAAA,IACA,iBAAAC,IAAkB;AAA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AMqD;AAAA,IACN,OAAOjC;AAAA,IACP,YAAY0B;AAAA,IACZ,QAAQD;AAAA,IACR,SAASD;AAAA,IACT,UAAUX,IAAU,SAAYK;AAAA;AAAA,IAChC,SAAA/B;AAAA,IACA,UAAAQ;AAAA,IACA,WAAWkB,IAAU,SAAYrC;AAAA,IACjC,UAAAC;AAAA,EAAA,GAKE2D,IAAuB,CAAA;AAC7B,EAAI3C,MACA2C,EAAgB,WAAW3C;AAG/B,QAAM4C,KAAQxB,IACV,gBAAAyB;AAAA,IAACC;AAAA,IAAA;AAAA,MACI,GAAGL;AAAA,MACJ,UAAUvB;AAAA,MACV,MAAAvB;AAAA,MACA,aAAaI;AAAA,MACZ,GAAG4C;AAAA,MACJ,iBAAiB/C;AAAA,MACjB,UAAU+B;AAAA,MACV,MAAM,CAACN,EAAA;AAAA,MACP,WAAWvB;AAAA,IAAA;AAAA,EAAA,IAGf,gBAAA+C,EAAC,SAAA,EAAO,GAAGJ,GAAY,KAAKvD,KAAYN,GAAK;AAGjD,SACI,gBAAAmE,GAAC,OAAA,EAAI,WAAWZ,IACX,UAAA;AAAA,IAAA/B,KAAY4C,GAAW5C,CAAQ,IAAIA,EAASqC,CAAU,IAAIG;AAAA,IAC3D,gBAAAC,EAAC,QAAA,EAAK,WAAWP,IAAuB,SAASJ,IAC7C,UAAA,gBAAAW,EAAC,QAAA,EAAK,WAAU,gDAAA,CAAgD,EAAA,CACpE;AAAA,EAAA,GACJ;AAER,CAAC;"}
1
+ {"version":3,"file":"ClearableInput.js","sources":["../../../src/components/clearableInput/ClearableInput.tsx"],"sourcesContent":["/** biome-ignore-all lint/complexity/noBannedTypes: <explanation> */\nimport React, { useState, forwardRef, type ForwardedRef, useRef } from 'react';\nimport { isEmpty, omit } from 'es-toolkit/compat';\nimport { isFunction, isNil } from 'es-toolkit/predicate';\nimport { noop } from 'es-toolkit/function';\nimport { IMaskInput } from 'react-imask';\n\nimport classNames from '../../utils/classNames';\nimport usePrevious from '../../hooks/usePrevious';\nimport useMergeRefs from '../../hooks/useMergeRefs';\n\nexport const DEFAULT_TYPE = 'text';\nexport const SUPPORTED_TYPES = ['text', 'password', 'email'];\n\nexport type MaskVisibility = 'always' | 'onFocus' | 'never';\nexport type MaskDefinition = {\n mask: string;\n definitions?: Record<string, string | RegExp>;\n startsWith?: string;\n [key: string]: any;\n};\n\nexport type ClearableInputProps = {\n /**\n * Gives the input element the id.\n */\n id?: string;\n\n /**\n * Gives the input element a name.\n */\n name?: string;\n\n /**\n * The translated text that shall be shown when the input is empty.\n */\n placeholder?: string | React.ReactNode;\n\n /**\n * Defines the type of the input itself.\n *\n * There are three types supported:\n * `text`, `email`, `password`.\n *\n * @default 'text'\n */\n type?: 'text' | 'password' | 'email';\n\n /**\n * Initial value of the ClearableInput. Pass this prop if you want to use this\n * component as an uncontrolled component.\n */\n defaultValue?: string;\n\n /**\n * Value of the ClearableInput. Pass this prop if you want to use this\n * component as a controlled component.\n */\n value?: string;\n\n /**\n * Defines the maximum amount of characters that can be entered.\n */\n maxLength?: number;\n\n /**\n * Defines the tab index to be added to the input element.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Defined whether or not the input has the error styling.\n *\n * @default false\n */\n hasError?: boolean;\n\n /**\n * The callback ref for the underlying input. Alternatively, use can use a forward ref.\n */\n inputRef?: React.RefObject<HTMLInputElement>;\n\n /**\n * Sets autocomplete value for autosuggest forms.\n */\n autoComplete?: string;\n\n /**\n * Callback function for when the value changes. Receives new value as an argument.\n * @param newValue\n * @param event\n * @returns\n */\n onChange?: (\n newValue: string,\n event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLSpanElement>\n ) => void;\n\n /**\n * Callback function which gets triggered when the input looses the focus.\n * @param event\n * @returns\n */\n onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\n /**\n * Callback function which gets triggered when the input gains the focus.\n * @param event\n * @returns\n */\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\n /**\n * Callback function for when the value is cleared via the clear button.\n * @param event\n * @returns\n */\n onClear?: (event: React.MouseEvent<HTMLSpanElement>) => void;\n\n /**\n * Callback function for every key pressed including `Enter` key.\n * @param event\n * @returns\n */\n onKeyPress?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n\n /**\n * Callback triggered when clicked into the input to react on it like when using an auto suggest dropdown\n * @param event\n * @returns\n */\n onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;\n\n /**\n * The mask prop will allow to use the component with an input mask.\n * It defines the pattern that should be followed.\n *\n * For more details on masking, checkout the third party documentation for the\n * input mask here: {@link https://imask.js.org/guide.html}\n *\n * Simple masks can be defined as strings.\n *\n * The following characters will define mask format:\n *\n * - \"0\" = allowed input: \"0-9\" (digit)\n * - \"a\" = allowed input: \"a-z, A-Z\" (letter)\n * - \"*\" = allowed input: any character\n * - \"#\" = allowed input: \"0-9, a-z, A-Z\" (digit or letter)\n *\n * Other chars which is not in custom definitions supposed to be fixed:\n *\n * - [] - make input optional\n * - {} - include fixed part in unmasked value\n * - ` - prevent symbols shift back\n *\n * If definition character should be treated as fixed it should be escaped by \\\\ (E.g. \\\\0).\n *\n * Additionally you can provide custom definitions.\n *\n * @example\n * '-- ### ### ###' or '+49 00 000 00'\n */\n mask?: string | (string | RegExp)[] | RegExp | DateConstructor | number | Function | MaskDefinition[];\n\n /**\n * Placeholder to cover unfilled parts of the mask.\n *\n * @default '_'\n */\n maskPlaceholder?: string | null;\n\n /**\n * Enable characters overwriting\n *\n * @default true\n */\n maskOverwrite?: boolean | 'shift' | undefined;\n\n /**\n * Chooses the mask for dynamic masking depending on input value.\n * Note, this function may not be an empty function, otherwise the mask selection won't work\n */\n maskDispatch?: (appended: string, dynamicMasked: any) => any;\n\n /**\n * Pattern used by IMask date masks.\n *\n * @example\n * 'Y-m-d'\n */\n pattern?: string;\n\n /**\n * Formats a typed date value to the masked string representation.\n */\n format?: (value: Date | null, masked: unknown) => string;\n\n /**\n * Parses the masked string representation back to a typed date value.\n */\n parse?: (value: string, masked: unknown) => Date | null;\n\n /**\n * Enables IMask autofix behavior for date and number masks.\n */\n autofix?: boolean | 'pad';\n\n /**\n * Controls when the mask pattern is visible.\n *\n * - 'always': Mask is always visible\n * - 'onFocus': Mask is hidden but shown when input is focused\n * - 'never': Mask is never shown\n *\n * @default 'always'\n */\n maskVisibility?: MaskVisibility;\n\n /**\n * Custom definitions to have more control over your mask. The defined character will be replaced in your mask.\n *\n * @example\n * mask='AAA AAA.AA'\n * maskDefinitions={{ A: /[A-Z0-9]/ }}\n */\n maskDefinitions?: Record<string, string | RegExp>;\n\n /**\n * Minimum value to be entered. This prop is extended to accept a Date\n * when used with an input mask.\n */\n min?: string | number | undefined | Date;\n\n /**\n * Maximum value to be entered. This prop is extended to accept a Date\n * when used with an input mask.\n */\n max?: string | number | undefined | Date;\n\n /**\n * Disabled the input component.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Makes the input read-only.\n */\n readOnly?: boolean;\n\n /**\n * Controls whether the clear button is rendered.\n * This might be useful to reuse this component for other use-cases.\n *\n * @default true\n */\n showClearButton?: boolean;\n\n /**\n * Additional classes to be set on the input element.\n */\n inputClassName?: string;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n\n /**\n * Render-prop to customize the rendered input.\n *\n * The function gets the `inputProps` passed and is responsible for rendering the custom `<input>` component.\n *\n * Receives the computed `input` props so you can render your own field. See: {@link https://reactjs.org/docs/render-props.html}\n */\n children?: (props: React.InputHTMLAttributes<HTMLInputElement>) => React.ReactNode;\n};\n\nconst hasValue = (value: unknown) => !isEmpty(`${value}`);\n\nconst ClearableInput = forwardRef((props: ClearableInputProps, ref: ForwardedRef<HTMLInputElement>) => {\n const {\n type = DEFAULT_TYPE,\n defaultValue,\n value,\n showClearButton = true,\n maxLength,\n tabIndex = 0,\n hasError = false,\n inputRef,\n autoComplete,\n onChange = noop,\n onBlur = noop,\n onFocus = noop,\n onClear = noop,\n onKeyPress = noop,\n onClick = noop,\n mask,\n maskPlaceholder = '_',\n maskVisibility = 'always',\n maskOverwrite = true,\n maskDefinitions,\n maskDispatch,\n inputClassName = '',\n disabled = false,\n readOnly = false,\n className = '',\n children,\n ...remainingProps\n } = props;\n\n const initialValue = value || defaultValue || '';\n\n const [inputValue, setInputValue] = useState(initialValue);\n const [showClear, setShowClear] = useState(hasValue(initialValue));\n const [isFocused, setIsFocused] = useState(false);\n\n const isControlled = !isNil(value);\n\n const internalMaskRef = useRef<HTMLInputElement>(null);\n const mergedInternalMaskRef = useMergeRefs(internalMaskRef, inputRef, ref);\n\n const hasMask = !!mask;\n\n // Calculate if mask should be visible (lazy=false means visible, lazy=true means hidden)\n const shouldShowMask = () => {\n switch (maskVisibility) {\n case 'always':\n return true;\n case 'onFocus':\n return isFocused;\n case 'never':\n return false;\n default:\n return isFocused;\n }\n };\n\n // Handles new input value and saves it in the local state.\n // The value stored in the state is used for rendering.\n const changeInternalValue = (newValue = '') => {\n // this is there to prevent that onChange and UNSAFE_componentWillReceiveProps set state at the same time\n if (inputValue === newValue) {\n return;\n }\n\n setInputValue(newValue);\n setShowClear(hasValue(newValue));\n };\n\n // important for when used as a controlled component and value changes from the outside.\n const previousValue = usePrevious(value);\n if (previousValue !== value) {\n changeInternalValue(value);\n }\n\n // only gets triggered on user interaction.\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = event.target.value;\n\n if (isControlled) {\n onChange(newValue, event);\n } else {\n changeInternalValue(newValue);\n onChange(newValue, event);\n }\n };\n\n const handleAccept = (newValue: string, maskRef: any, _event?: InputEvent) => {\n if (!internalMaskRef.current) {\n return;\n }\n\n // Simulate a ChangeEvent for backwards compatibility since react-imask does not return a change event itself\n const syntheticEvent = {\n target: internalMaskRef.current,\n currentTarget: internalMaskRef.current,\n // Standard synthetic event props\n bubbles: true,\n cancelable: true,\n defaultPrevented: false,\n isTrusted: true,\n preventDefault: () => {},\n stopPropagation: () => {},\n persist: () => {},\n nativeEvent: {} as any,\n type: 'change',\n timeStamp: Date.now(),\n } as unknown as React.ChangeEvent<HTMLInputElement>;\n\n // Set unmasked value manually if needed\n // (you can use data-attributes or attach it directly)\n (syntheticEvent.target as any).unmaskedValue = maskRef.unmaskedValue;\n\n if (isControlled) {\n onChange(newValue, syntheticEvent);\n } else {\n changeInternalValue(newValue);\n onChange(newValue, syntheticEvent);\n }\n };\n\n const handleInputFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true);\n onFocus(event);\n };\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(false);\n onBlur(event);\n };\n\n // Will be triggered on every key press but also when pressing 'Enter' for example\n const handleKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyPress(event);\n };\n\n const clearInputValue = (event: React.MouseEvent<HTMLSpanElement>) => {\n changeInternalValue('');\n onChange('', event);\n\n if (onClear) {\n onClear(event);\n }\n };\n\n const classes = classNames(\n 'ClearableInput',\n 'input-group',\n hasError && 'has-error',\n disabled && 'pointer-events-none',\n className && className\n );\n\n const inputClassNames = classNames(\n 'form-control',\n inputClassName,\n showClear && showClearButton && 'withClearButton',\n hasMask && 'withInputMask',\n disabled && 'disabled'\n );\n\n const clearButtonClassNames = classNames('clearButton', (!showClear || !showClearButton) && 'hide');\n\n const convertedType = type?.toLowerCase();\n const inputType = SUPPORTED_TYPES.indexOf(convertedType) !== -1 ? convertedType : DEFAULT_TYPE;\n\n const inputProps = {\n ...omit(remainingProps, ['value', 'defaultValue', 'onClear']),\n className: inputClassNames,\n autoComplete,\n type: inputType,\n value: inputValue,\n onKeyPress: handleKeyPress,\n onBlur: handleInputBlur,\n onFocus: handleInputFocus,\n onChange: hasMask ? undefined : handleChange, // In case of masked input, the onAccept callback is used\n onClick,\n disabled,\n readOnly,\n maxLength: hasMask ? undefined : maxLength,\n tabIndex,\n } as any;\n\n // The dispatch function may not be an empty function. Specify it when\n // using dynamic masking and need more control over which mask gets selected\n const maskDispatchObj: any = {};\n if (maskDispatch) {\n maskDispatchObj.dispatch = maskDispatch;\n }\n\n const input = hasMask ? (\n <IMaskInput\n {...inputProps}\n inputRef={mergedInternalMaskRef}\n mask={mask}\n definitions={maskDefinitions}\n {...maskDispatchObj}\n placeholderChar={maskPlaceholder}\n onAccept={handleAccept}\n lazy={!shouldShowMask()}\n overwrite={maskOverwrite}\n />\n ) : (\n <input {...inputProps} ref={inputRef || ref} />\n );\n\n return (\n <div className={classes}>\n {children && isFunction(children) ? children(inputProps) : input}\n <span className={clearButtonClassNames} onClick={clearInputValue}>\n <span className='clearButtonIcon rioglyph rioglyph-remove-sign' />\n </span>\n </div>\n );\n});\n\nexport default ClearableInput;\n"],"names":["DEFAULT_TYPE","SUPPORTED_TYPES","hasValue","value","isEmpty","ClearableInput","forwardRef","props","ref","type","defaultValue","showClearButton","maxLength","tabIndex","hasError","inputRef","autoComplete","onChange","noop","onBlur","onFocus","onClear","onKeyPress","onClick","mask","maskPlaceholder","maskVisibility","maskOverwrite","maskDefinitions","maskDispatch","inputClassName","disabled","readOnly","className","children","remainingProps","initialValue","inputValue","setInputValue","useState","showClear","setShowClear","isFocused","setIsFocused","isControlled","isNil","internalMaskRef","useRef","mergedInternalMaskRef","useMergeRefs","hasMask","shouldShowMask","changeInternalValue","newValue","usePrevious","handleChange","event","handleAccept","maskRef","_event","syntheticEvent","handleInputFocus","handleInputBlur","handleKeyPress","clearInputValue","classes","classNames","inputClassNames","clearButtonClassNames","convertedType","inputType","inputProps","omit","maskDispatchObj","input","jsx","IMaskInput","jsxs","isFunction"],"mappings":";;;;;;;;;AAWO,MAAMA,IAAe,QACfC,KAAkB,CAAC,QAAQ,YAAY,OAAO,GA6QrDC,IAAW,CAACC,MAAmB,CAACC,GAAQ,GAAGD,CAAK,EAAE,GAElDE,KAAiBC,GAAW,CAACC,GAA4BC,MAAwC;AACnG,QAAM;AAAA,IACF,MAAAC,IAAOT;AAAA,IACP,cAAAU;AAAA,IACA,OAAAP;AAAA,IACA,iBAAAQ,IAAkB;AAAA,IA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,CAAgD,EAAA,CACpE;AAAA,EAAA,GACJ;AAER,CAAC;"}
@@ -121,7 +121,6 @@ class E extends W {
121
121
  * @param {object} nextProps - The next props.
122
122
  * @returns {undefined}
123
123
  */
124
- // eslint-disable-next-line camelcase
125
124
  UNSAFE_componentWillReceiveProps(e) {
126
125
  const { startValue: a, endValue: s, textDefault: i, customRangeOnly: n, locale: l, defaultStartValue: d, defaultEndValue: r } = e, { internalStartValue: u, internalEndValue: c } = this.state, m = R(a) && R(s) && R(u) && R(c), g = T(a) && T(s);
127
126
  m || g ? this.setState({
@@ -340,7 +339,6 @@ class E extends W {
340
339
  i
341
340
  ), /* @__PURE__ */ React.createElement("button", { type: "button", onClick: this.toggleDropdownOpen, className: "btn btn-default pull-right" }, n)));
342
341
  }
343
- // eslint-disable-next-line complexity
344
342
  render() {
345
343
  const {
346
344
  locale: e,