@rio-cloud/rio-uikit 2.0.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CircularProgress.d.ts +2 -0
- package/CircularProgress.js +5 -0
- package/CircularProgress.js.map +1 -0
- package/RadioCardGroup.d.ts +2 -0
- package/RadioCardGroup.js +7 -0
- package/RadioCardGroup.js.map +1 -0
- package/SearchHighlightText.d.ts +2 -0
- package/SearchHighlightText.js +5 -0
- package/SearchHighlightText.js.map +1 -0
- package/TextTruncateMiddle.d.ts +2 -0
- package/TextTruncateMiddle.js +5 -0
- package/TextTruncateMiddle.js.map +1 -0
- package/Tracker.d.ts +2 -0
- package/Tracker.js +5 -0
- package/Tracker.js.map +1 -0
- package/classNames.d.ts +2 -0
- package/classNames.js +5 -0
- package/classNames.js.map +1 -0
- package/components/accentBar/AccentBar.js +1 -1
- package/components/accentBar/AccentBar.js.map +1 -1
- package/components/actionBarItem/ActionBarItem.d.ts +2 -2
- package/components/actionBarItem/ActionBarItem.js +7 -7
- package/components/actionBarItem/ActionBarItem.js.map +1 -1
- package/components/actionBarItem/ActionBarItemIcon.js +1 -1
- package/components/actionBarItem/ActionBarItemIcon.js.map +1 -1
- package/components/actionBarItem/ActionBarItemList.js +1 -1
- package/components/actionBarItem/ActionBarItemList.js.map +1 -1
- package/components/actionBarItem/ActionBarItemListItem.js +1 -1
- package/components/actionBarItem/ActionBarItemListItem.js.map +1 -1
- package/components/actionBarItem/ActionBarItemListSeparator.js +1 -1
- package/components/actionBarItem/ActionBarItemListSeparator.js.map +1 -1
- package/components/actionBarItem/ActionBarItemPopoverContent.js +3 -3
- package/components/actionBarItem/ActionBarItemPopoverContent.js.map +1 -1
- package/components/actionBarItem/ActionBarOverlay.js +1 -1
- package/components/actionBarItem/ActionBarOverlay.js.map +1 -1
- package/components/activity/Activity.js +1 -1
- package/components/activity/Activity.js.map +1 -1
- package/components/animatedTextReveal/AnimatedTextReveal.js +1 -1
- package/components/animatedTextReveal/AnimatedTextReveal.js.map +1 -1
- package/components/applicationHeader/AppMenu.js +2 -2
- package/components/applicationHeader/AppMenu.js.map +1 -1
- package/components/applicationHeader/AppMenuDropdown.js +13 -11
- package/components/applicationHeader/AppMenuDropdown.js.map +1 -1
- package/components/applicationHeader/ApplicationHeader.d.ts +6 -7
- package/components/applicationHeader/ApplicationHeader.js +1 -1
- package/components/applicationHeader/ApplicationHeader.js.map +1 -1
- package/components/applicationHeader/MobileHeaderModal.js +8 -8
- package/components/applicationHeader/MobileHeaderModal.js.map +1 -1
- package/components/applicationHeader/MobileSubmoduleNavigation.js +1 -1
- package/components/applicationHeader/MobileSubmoduleNavigation.js.map +1 -1
- package/components/applicationHeader/NavItems.js +4 -4
- package/components/applicationHeader/NavItems.js.map +1 -1
- package/components/applicationLayout/ApplicationLayout.js +10 -10
- package/components/applicationLayout/ApplicationLayout.js.map +1 -1
- package/components/applicationLayout/ApplicationLayoutBody.js +2 -2
- package/components/applicationLayout/ApplicationLayoutBody.js.map +1 -1
- package/components/applicationLayout/ApplicationLayoutBodyBanner.js +1 -1
- package/components/applicationLayout/ApplicationLayoutBodyBanner.js.map +1 -1
- package/components/applicationLayout/ApplicationLayoutBodyBottomBar.js +1 -1
- package/components/applicationLayout/ApplicationLayoutBodyBottomBar.js.map +1 -1
- package/components/applicationLayout/ApplicationLayoutBodyNavigation.js +1 -1
- package/components/applicationLayout/ApplicationLayoutBodyNavigation.js.map +1 -1
- package/components/applicationLayout/ApplicationLayoutHeader.js +1 -1
- package/components/applicationLayout/ApplicationLayoutHeader.js.map +1 -1
- package/components/applicationLayout/ApplicationLayoutSidebar.js +1 -1
- package/components/applicationLayout/ApplicationLayoutSidebar.js.map +1 -1
- package/components/applicationLayout/SubNavigation.d.ts +7 -0
- package/components/applicationLayout/SubNavigation.js +1 -1
- package/components/applicationLayout/SubNavigation.js.map +1 -1
- package/components/assetTree/AssetTree.d.ts +7 -0
- package/components/assetTree/AssetTree.js +1 -1
- package/components/assetTree/AssetTree.js.map +1 -1
- package/components/assetTree/Tree.d.ts +15 -0
- package/components/assetTree/Tree.js +1 -1
- package/components/assetTree/Tree.js.map +1 -1
- package/components/assetTree/TreeIcon.d.ts +30 -0
- package/components/assetTree/TreeIcon.js +16 -0
- package/components/assetTree/TreeIcon.js.map +1 -0
- package/components/assetTree/TreeLeaf.js +23 -23
- package/components/assetTree/TreeLeaf.js.map +1 -1
- package/components/assetTree/TreeNode.js +25 -25
- package/components/assetTree/TreeNode.js.map +1 -1
- package/components/assetTree/TreeNodeContainer.js +1 -1
- package/components/assetTree/TreeNodeContainer.js.map +1 -1
- package/components/assetTree/TreeOption.js +3 -3
- package/components/assetTree/TreeOption.js.map +1 -1
- package/components/assetTree/TreeOptions.js +4 -4
- package/components/assetTree/TreeOptions.js.map +1 -1
- package/components/assetTree/TreeRoot.js +3 -3
- package/components/assetTree/TreeRoot.js.map +1 -1
- package/components/assetTree/TreeSearch.d.ts +2 -0
- package/components/assetTree/TreeSearch.js +3 -3
- package/components/assetTree/TreeSearch.js.map +1 -1
- package/components/assetTree/TreeSidebar.js +1 -1
- package/components/assetTree/TreeSidebar.js.map +1 -1
- package/components/assetTree/TreeSidebarCategories.js +4 -4
- package/components/assetTree/TreeSidebarCategories.js.map +1 -1
- package/components/assetTree/TreeSummary.js +1 -1
- package/components/assetTree/TreeSummary.js.map +1 -1
- package/components/assetTree/TypeCounter.js +1 -1
- package/components/assetTree/TypeCounter.js.map +1 -1
- package/components/autosuggest/AutoSuggest.js +1 -1
- package/components/autosuggest/AutoSuggest.js.map +1 -1
- package/components/avatar/Avatar.js +1 -1
- package/components/avatar/Avatar.js.map +1 -1
- package/components/banner/Banner.js +1 -1
- package/components/banner/Banner.js.map +1 -1
- package/components/banner/BannerContent.js +1 -1
- package/components/banner/BannerContent.js.map +1 -1
- package/components/barList/BarList.d.ts +26 -0
- package/components/barList/BarList.js +1 -1
- package/components/barList/BarList.js.map +1 -1
- package/components/bottomSheet/BottomSheet.d.ts +17 -3
- package/components/bottomSheet/BottomSheet.js +1 -1
- package/components/bottomSheet/BottomSheet.js.map +1 -1
- package/components/bottomSheet/TimedBottomSheet.d.ts +10 -0
- package/components/bottomSheet/TimedBottomSheet.js.map +1 -1
- package/components/button/Button.d.ts +53 -7
- package/components/button/Button.js +87 -64
- package/components/button/Button.js.map +1 -1
- package/components/button/ButtonToolbar.js +1 -1
- package/components/button/ButtonToolbar.js.map +1 -1
- package/components/button/ToggleButton.d.ts +4 -1
- package/components/button/ToggleButton.js.map +1 -1
- package/components/calendarStripe/CalendarStripe.d.ts +1 -1
- package/components/calendarStripe/CalendarStripe.js +48 -50
- package/components/calendarStripe/CalendarStripe.js.map +1 -1
- package/components/card/Card.js +1 -1
- package/components/card/Card.js.map +1 -1
- package/components/charts/Area.d.ts +2 -2
- package/components/charts/Area.js.map +1 -1
- package/components/charts/Line.d.ts +2 -2
- package/components/charts/Line.js.map +1 -1
- package/components/charts/RadialBarChart.js +106 -103
- package/components/charts/RadialBarChart.js.map +1 -1
- package/components/checkbox/Checkbox.d.ts +0 -3
- package/components/checkbox/Checkbox.js +6 -6
- package/components/checkbox/Checkbox.js.map +1 -1
- package/components/circularProgress/CircularProgress.d.ts +139 -0
- package/components/circularProgress/CircularProgress.js +197 -0
- package/components/circularProgress/CircularProgress.js.map +1 -0
- package/components/clearableInput/ClearableInput.d.ts +21 -20
- package/components/clearableInput/ClearableInput.js +9 -9
- package/components/clearableInput/ClearableInput.js.map +1 -1
- package/components/collapse/Collapse.d.ts +3 -0
- package/components/collapse/Collapse.js +12 -12
- package/components/collapse/Collapse.js.map +1 -1
- package/components/contentLoader/ContentLoader.d.ts +10 -2
- package/components/contentLoader/ContentLoader.js.map +1 -1
- package/components/dataTabs/DataTabHeader.js +1 -1
- package/components/dataTabs/DataTabHeader.js.map +1 -1
- package/components/dataTabs/DataTabs.d.ts +6 -0
- package/components/dataTabs/DataTabs.js +4 -4
- package/components/dataTabs/DataTabs.js.map +1 -1
- package/components/datepicker/DatePicker.js +6 -6
- package/components/datepicker/DatePicker.js.map +1 -1
- package/components/datepicker/DateRangePicker.js +1 -1
- package/components/datepicker/DateRangePicker.js.map +1 -1
- package/components/datepicker/DayPicker.js +1 -1
- package/components/datepicker/DayPicker.js.map +1 -1
- package/components/dialog/ConfirmationDialog.d.ts +22 -0
- package/components/dialog/ConfirmationDialog.js.map +1 -1
- package/components/dialog/Dialog.d.ts +13 -1
- package/components/dialog/Dialog.js +55 -55
- package/components/dialog/Dialog.js.map +1 -1
- package/components/dialog/DialogBody.js +1 -1
- package/components/dialog/DialogBody.js.map +1 -1
- package/components/dialog/DialogFooter.js +1 -1
- package/components/dialog/DialogFooter.js.map +1 -1
- package/components/dialog/DialogHeader.js +1 -1
- package/components/dialog/DialogHeader.js.map +1 -1
- package/components/dialog/MediaDialog.js +1 -1
- package/components/dialog/MediaDialog.js.map +1 -1
- package/components/dialog/ReleaseNotesDialog.d.ts +3 -3
- package/components/dialog/ReleaseNotesDialog.js.map +1 -1
- package/components/dialog/SplitDialog.js +1 -1
- package/components/dialog/SplitDialog.js.map +1 -1
- package/components/divider/Divider.js +1 -1
- package/components/divider/Divider.js.map +1 -1
- package/components/dropdown/ButtonDropdown.d.ts +4 -0
- package/components/dropdown/ButtonDropdown.js +52 -52
- package/components/dropdown/ButtonDropdown.js.map +1 -1
- package/components/dropdown/DropdownSubmenu.d.ts +4 -0
- package/components/dropdown/DropdownSubmenu.js +3 -3
- package/components/dropdown/DropdownSubmenu.js.map +1 -1
- package/components/dropdown/DropdownToggleButton.d.ts +1 -1
- package/components/dropdown/DropdownToggleButton.js +4 -3
- package/components/dropdown/DropdownToggleButton.js.map +1 -1
- package/components/dropdown/SplitCaretButton.js +6 -6
- package/components/dropdown/SplitCaretButton.js.map +1 -1
- package/components/editableContent/EditableContent.d.ts +6 -0
- package/components/editableContent/EditableContent.js +1 -1
- package/components/editableContent/EditableContent.js.map +1 -1
- package/components/ellipsis/TextTruncateMiddle.d.ts +23 -0
- package/components/ellipsis/TextTruncateMiddle.js +21 -0
- package/components/ellipsis/TextTruncateMiddle.js.map +1 -0
- package/components/expander/ExpanderList.d.ts +3 -0
- package/components/expander/ExpanderList.js +5 -5
- package/components/expander/ExpanderList.js.map +1 -1
- package/components/expander/ExpanderPanel.d.ts +14 -4
- package/components/expander/ExpanderPanel.js +1 -1
- package/components/expander/ExpanderPanel.js.map +1 -1
- package/components/fade/Fade.d.ts +1 -1
- package/components/fade/Fade.js.map +1 -1
- package/components/feedback/FeedbackRating.js +1 -1
- package/components/feedback/FeedbackRating.js.map +1 -1
- package/components/feedback/FeedbackReactions.js +1 -1
- package/components/feedback/FeedbackReactions.js.map +1 -1
- package/components/filepicker/FilePicker.d.ts +0 -2
- package/components/filepicker/FilePicker.js.map +1 -1
- package/components/formLabel/FormLabel.js +6 -9
- package/components/formLabel/FormLabel.js.map +1 -1
- package/components/formLabel/LabeledElement.js +1 -1
- package/components/formLabel/LabeledElement.js.map +1 -1
- package/components/groupedItemList/GroupedItemList.d.ts +10 -7
- package/components/groupedItemList/GroupedItemList.js.map +1 -1
- package/components/listMenu/ListMenu.js +2 -5
- package/components/listMenu/ListMenu.js.map +1 -1
- package/components/listMenu/ListMenuGroup.d.ts +2 -1
- package/components/listMenu/ListMenuGroup.js +2 -2
- package/components/listMenu/ListMenuGroup.js.map +1 -1
- package/components/loadMore/LoadMoreButton.js +1 -1
- package/components/loadMore/LoadMoreButton.js.map +1 -1
- package/components/loadMore/LoadMoreProgress.js +1 -1
- package/components/loadMore/LoadMoreProgress.js.map +1 -1
- package/components/map/components/Map.js.map +1 -1
- package/components/map/components/constants.js.map +1 -1
- package/components/map/components/features/ContextMenuItem.d.ts +1 -1
- package/components/map/components/features/ContextMenuItem.js +2 -17
- package/components/map/components/features/ContextMenuItem.js.map +1 -1
- package/components/map/components/features/MapSettings.js +4 -4
- package/components/map/components/features/MapSettings.js.map +1 -1
- package/components/map/components/features/basics/Polyline.d.ts +4 -1
- package/components/map/components/features/basics/Polyline.js +1 -1
- package/components/map/components/features/basics/Polyline.js.map +1 -1
- package/components/map/components/features/layers/MarkerLayer.d.ts +3 -1
- package/components/map/components/features/layers/MarkerLayer.js.map +1 -1
- package/components/map/components/features/layers/clustering/ClusterLayer.js +1 -1
- package/components/map/components/features/layers/clustering/ClusterLayer.js.map +1 -1
- package/components/map/components/features/layers/clustering/SimpleClusterLayer.d.ts +3 -2
- package/components/map/components/features/layers/clustering/SimpleClusterLayer.js.map +1 -1
- package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js +7 -7
- package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js.map +1 -1
- package/components/map/components/features/layers/overlayLayers/TrafficLayer.js +4 -4
- package/components/map/components/features/layers/overlayLayers/TrafficLayer.js.map +1 -1
- package/components/map/components/features/settings/MapSettingsItem.js +1 -1
- package/components/map/components/features/settings/MapSettingsItem.js.map +1 -1
- package/components/map/components/features/settings/MapSettingsPanel.js +6 -20
- package/components/map/components/features/settings/MapSettingsPanel.js.map +1 -1
- package/components/map/components/features/settings/MapSettingsTile.js +87 -61
- package/components/map/components/features/settings/MapSettingsTile.js.map +1 -1
- package/components/map/components/features/settings/ZoomButtons.js +1 -1
- package/components/map/components/features/settings/ZoomButtons.js.map +1 -1
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.d.ts +38 -1
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +128 -92
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js.map +1 -1
- package/components/map/utils/clustering.d.ts +6 -1
- package/components/map/utils/clustering.js +25 -19
- package/components/map/utils/clustering.js.map +1 -1
- package/components/map/utils/eventHandling.js +9 -9
- package/components/map/utils/eventHandling.js.map +1 -1
- package/components/map/utils/mapUtils.d.ts +6 -6
- package/components/map/utils/mapUtils.js +14 -19
- package/components/map/utils/mapUtils.js.map +1 -1
- package/components/map/utils/rendering.d.ts +1 -1
- package/components/map/utils/rendering.js +23 -23
- package/components/map/utils/rendering.js.map +1 -1
- package/components/mapMarker/ClusterMapMarker.js +1 -1
- package/components/mapMarker/ClusterMapMarker.js.map +1 -1
- package/components/mapMarker/SingleMapMarker.js +1 -1
- package/components/mapMarker/SingleMapMarker.js.map +1 -1
- package/components/menuItems/MenuItem.d.ts +23 -0
- package/components/menuItems/MenuItem.js +1 -1
- package/components/menuItems/MenuItem.js.map +1 -1
- package/components/menuItems/MenuItemList.js +1 -1
- package/components/menuItems/MenuItemList.js.map +1 -1
- package/components/navigation/AppNavigationBar.js +4 -4
- package/components/navigation/AppNavigationBar.js.map +1 -1
- package/components/noData/NoData.js +1 -1
- package/components/noData/NoData.js.map +1 -1
- package/components/notification/Notification.js +4 -4
- package/components/notification/Notification.js.map +1 -1
- package/components/numberControl/NumberControl.js +4 -4
- package/components/numberControl/NumberControl.js.map +1 -1
- package/components/numberInput/NumberInput.js +1 -1
- package/components/numberInput/NumberInput.js.map +1 -1
- package/components/onboarding/OnboardingTip.d.ts +18 -12
- package/components/onboarding/OnboardingTip.js +4 -4
- package/components/onboarding/OnboardingTip.js.map +1 -1
- package/components/overlay/OverlayTrigger.d.ts +43 -1
- package/components/overlay/OverlayTrigger.js.map +1 -1
- package/components/page/Page.js +1 -1
- package/components/page/Page.js.map +1 -1
- package/components/pager/Pager.d.ts +3 -0
- package/components/pager/Pager.js +1 -1
- package/components/pager/Pager.js.map +1 -1
- package/components/popover/Popover.d.ts +1 -0
- package/components/popover/Popover.js.map +1 -1
- package/components/preloader/ImagePreloader.d.ts +1 -1
- package/components/preloader/ImagePreloader.js.map +1 -1
- package/components/radiobutton/RadioButton.d.ts +10 -6
- package/components/radiobutton/RadioButton.js +5 -5
- package/components/radiobutton/RadioButton.js.map +1 -1
- package/components/radiobutton/RadioCardGroup.d.ts +86 -0
- package/components/radiobutton/RadioCardGroup.js +110 -0
- package/components/radiobutton/RadioCardGroup.js.map +1 -0
- package/components/releaseNotes/ReleaseNotes.d.ts +0 -3
- package/components/releaseNotes/ReleaseNotes.js.map +1 -1
- package/components/resizer/Resizer.d.ts +17 -3
- package/components/resizer/Resizer.js +1 -1
- package/components/resizer/Resizer.js.map +1 -1
- package/components/responsiveColumnStripe/ResponsiveColumnStripe.js +1 -1
- package/components/responsiveColumnStripe/ResponsiveColumnStripe.js.map +1 -1
- package/components/rioglyph/Rioglyph.d.ts +20 -8
- package/components/rioglyph/Rioglyph.js +1 -1
- package/components/rioglyph/Rioglyph.js.map +1 -1
- package/components/rioglyph/RioglyphIconType.d.ts +1 -1
- package/components/rules/RuleConnector.js +1 -1
- package/components/rules/RuleConnector.js.map +1 -1
- package/components/rules/RuleContainer.js +27 -27
- package/components/rules/RuleContainer.js.map +1 -1
- package/components/rules/RulesWrapper.js +1 -1
- package/components/rules/RulesWrapper.js.map +1 -1
- package/components/saveableInput/SaveableDateInput.d.ts +20 -2
- package/components/saveableInput/SaveableDateInput.js +1 -1
- package/components/saveableInput/SaveableDateInput.js.map +1 -1
- package/components/saveableInput/SaveableInput.d.ts +10 -2
- package/components/saveableInput/SaveableInput.js +49 -49
- package/components/saveableInput/SaveableInput.js.map +1 -1
- package/components/searchHighlight/SearchHighlightText.d.ts +28 -0
- package/components/searchHighlight/SearchHighlightText.js +15 -0
- package/components/searchHighlight/SearchHighlightText.js.map +1 -0
- package/components/selects/BaseSelectDropdown.js +90 -79
- package/components/selects/BaseSelectDropdown.js.map +1 -1
- package/components/selects/ClearButton.js +4 -4
- package/components/selects/ClearButton.js.map +1 -1
- package/components/selects/Multiselect.js +6 -6
- package/components/selects/Multiselect.js.map +1 -1
- package/components/selects/MultiselectToggleFilter.js +4 -4
- package/components/selects/MultiselectToggleFilter.js.map +1 -1
- package/components/selects/MultiselectToggleSelection.js +1 -1
- package/components/selects/MultiselectToggleSelection.js.map +1 -1
- package/components/selects/Select.d.ts +5 -0
- package/components/selects/Select.js +93 -93
- package/components/selects/Select.js.map +1 -1
- package/components/selects/SelectFilter.js +1 -1
- package/components/selects/SelectFilter.js.map +1 -1
- package/components/selects/WithFeedbackAndAddon.js +1 -1
- package/components/selects/WithFeedbackAndAddon.js.map +1 -1
- package/components/sidebars/Sidebar.d.ts +19 -3
- package/components/sidebars/Sidebar.js +54 -54
- package/components/sidebars/Sidebar.js.map +1 -1
- package/components/sidebars/SidebarBackdrop.js +4 -4
- package/components/sidebars/SidebarBackdrop.js.map +1 -1
- package/components/sidebars/SidebarFooter.js +1 -1
- package/components/sidebars/SidebarFooter.js.map +1 -1
- package/components/sidebars/SidebarFullscreenToggle.js +4 -4
- package/components/sidebars/SidebarFullscreenToggle.js.map +1 -1
- package/components/slider/RangeSlider.d.ts +15 -0
- package/components/slider/RangeSlider.js +1 -1
- package/components/slider/RangeSlider.js.map +1 -1
- package/components/slider/Slider.d.ts +9 -0
- package/components/slider/Slider.js +1 -1
- package/components/slider/Slider.js.map +1 -1
- package/components/smoothScrollbars/SmoothScrollbars.d.ts +44 -0
- package/components/smoothScrollbars/SmoothScrollbars.js +1 -1
- package/components/smoothScrollbars/SmoothScrollbars.js.map +1 -1
- package/components/spinner/Spinner.d.ts +3 -3
- package/components/spinner/Spinner.js +5 -4
- package/components/spinner/Spinner.js.map +1 -1
- package/components/states/CustomState.d.ts +69 -1
- package/components/states/CustomState.js +1 -1
- package/components/states/CustomState.js.map +1 -1
- package/components/states/EmptyState.d.ts +1 -1
- package/components/states/EmptyState.js.map +1 -1
- package/components/states/ErrorState.d.ts +1 -1
- package/components/states/ErrorState.js.map +1 -1
- package/components/states/ForbiddenState.d.ts +1 -1
- package/components/states/ForbiddenState.js.map +1 -1
- package/components/states/MaintenanceState.d.ts +1 -1
- package/components/states/MaintenanceState.js.map +1 -1
- package/components/states/NotBookedState.d.ts +1 -1
- package/components/states/NotBookedState.js.map +1 -1
- package/components/states/NotFoundState.d.ts +1 -1
- package/components/states/NotFoundState.js.map +1 -1
- package/components/states/StateButton.js +1 -1
- package/components/states/StateButton.js.map +1 -1
- package/components/states/StateIcon.d.ts +14 -1
- package/components/states/StateIcon.js.map +1 -1
- package/components/statsWidget/StatsWidget.d.ts +2 -0
- package/components/statsWidget/StatsWidget.js +1 -1
- package/components/statsWidget/StatsWidget.js.map +1 -1
- package/components/statsWidget/StatsWidgetBody.d.ts +1 -0
- package/components/statsWidget/StatsWidgetBody.js +1 -1
- package/components/statsWidget/StatsWidgetBody.js.map +1 -1
- package/components/statsWidget/StatsWidgetFooter.js +1 -1
- package/components/statsWidget/StatsWidgetFooter.js.map +1 -1
- package/components/statsWidget/StatsWidgetHeader.js +1 -1
- package/components/statsWidget/StatsWidgetHeader.js.map +1 -1
- package/components/statsWidget/StatsWidgetNumber.d.ts +2 -0
- package/components/statsWidget/StatsWidgetNumber.js +2 -2
- package/components/statsWidget/StatsWidgetNumber.js.map +1 -1
- package/components/statsWidget/StatsWidgetSpacer.js +1 -1
- package/components/statsWidget/StatsWidgetSpacer.js.map +1 -1
- package/components/statsWidget/StatsWidgets.js +1 -1
- package/components/statsWidget/StatsWidgets.js.map +1 -1
- package/components/statusBar/StatusBar.d.ts +98 -3
- package/components/statusBar/StatusBar.js +24 -17
- package/components/statusBar/StatusBar.js.map +1 -1
- package/components/statusBar/StatusBarIcon.d.ts +2 -2
- package/components/statusBar/StatusBarIcon.js +4 -4
- package/components/statusBar/StatusBarIcon.js.map +1 -1
- package/components/statusBar/StatusBarLabel.d.ts +2 -2
- package/components/statusBar/StatusBarLabel.js +5 -7
- package/components/statusBar/StatusBarLabel.js.map +1 -1
- package/components/statusBar/StatusBarProgressBar.d.ts +1 -1
- package/components/statusBar/StatusBarProgressBar.js +1 -1
- package/components/statusBar/StatusBarProgressBar.js.map +1 -1
- package/components/steppedProgressBar/SteppedProgressBar.d.ts +1 -1
- package/components/steppedProgressBar/SteppedProgressBar.js +1 -1
- package/components/steppedProgressBar/SteppedProgressBar.js.map +1 -1
- package/components/switch/Switch.d.ts +28 -1
- package/components/switch/Switch.js +77 -35
- package/components/switch/Switch.js.map +1 -1
- package/components/table/SortArrowDown.d.ts +1 -1
- package/components/table/SortArrowDown.js.map +1 -1
- package/components/table/SortArrowUp.d.ts +1 -1
- package/components/table/SortArrowUp.js.map +1 -1
- package/components/table/TableCardsSorting.js +4 -4
- package/components/table/TableCardsSorting.js.map +1 -1
- package/components/table/TableHead.js +1 -1
- package/components/table/TableHead.js.map +1 -1
- package/components/table/TableSearch.js +1 -1
- package/components/table/TableSearch.js.map +1 -1
- package/components/table/TableSettingsColumnButtons.d.ts +1 -1
- package/components/table/TableSettingsColumnButtons.js +1 -1
- package/components/table/TableSettingsColumnButtons.js.map +1 -1
- package/components/table/TableSettingsColumnDetails.d.ts +1 -1
- package/components/table/TableSettingsColumnDetails.js +1 -1
- package/components/table/TableSettingsColumnDetails.js.map +1 -1
- package/components/table/TableSettingsDialog.d.ts +56 -1
- package/components/table/TableSettingsDialog.js +170 -144
- package/components/table/TableSettingsDialog.js.map +1 -1
- package/components/table/TableSettingsDialogFooter.js +9 -9
- package/components/table/TableSettingsDialogFooter.js.map +1 -1
- package/components/table/TableSettingsListContainer.d.ts +1 -1
- package/components/table/TableSettingsListContainer.js.map +1 -1
- package/components/table/TableSettingsListItem.d.ts +1 -1
- package/components/table/TableSettingsListItem.js +8 -8
- package/components/table/TableSettingsListItem.js.map +1 -1
- package/components/table/TableToolbar.js +1 -1
- package/components/table/TableToolbar.js.map +1 -1
- package/components/table/TableViewToggles.d.ts +21 -1
- package/components/table/TableViewToggles.js +1 -1
- package/components/table/TableViewToggles.js.map +1 -1
- package/components/tag/Tag.d.ts +7 -2
- package/components/tag/Tag.js +1 -1
- package/components/tag/Tag.js.map +1 -1
- package/components/tag/TagList.js +1 -1
- package/components/tag/TagList.js.map +1 -1
- package/components/tagManager/CustomSuggestionItem.js +1 -1
- package/components/tagManager/CustomSuggestionItem.js.map +1 -1
- package/components/tagManager/TagManager.d.ts +29 -2
- package/components/tagManager/TagManager.js +6 -6
- package/components/tagManager/TagManager.js.map +1 -1
- package/components/tagManager/TagManagerItemList.d.ts +1 -1
- package/components/tagManager/TagManagerItemList.js +1 -1
- package/components/tagManager/TagManagerItemList.js.map +1 -1
- package/components/teaser/Teaser.d.ts +57 -55
- package/components/teaser/Teaser.js +1 -1
- package/components/teaser/Teaser.js.map +1 -1
- package/components/teaser/TeaserContainer.d.ts +1 -1
- package/components/teaser/TeaserContainer.js +1 -1
- package/components/teaser/TeaserContainer.js.map +1 -1
- package/components/timepicker/TimePicker.d.ts +20 -0
- package/components/timepicker/TimePicker.js +153 -99
- package/components/timepicker/TimePicker.js.map +1 -1
- package/components/tooltip/SimpleTooltip.d.ts +22 -4
- package/components/tooltip/SimpleTooltip.js.map +1 -1
- package/components/tooltip/Tooltip.d.ts +22 -2
- package/components/tooltip/Tooltip.js +1 -1
- package/components/tooltip/Tooltip.js.map +1 -1
- package/components/tracker/Tracker.d.ts +85 -0
- package/components/tracker/Tracker.js +54 -0
- package/components/tracker/Tracker.js.map +1 -0
- package/components/tracker/TrackerBlock.d.ts +11 -0
- package/components/tracker/TrackerBlock.js +34 -0
- package/components/tracker/TrackerBlock.js.map +1 -0
- package/components/video/ResponsiveVideo.d.ts +8 -3
- package/components/video/ResponsiveVideo.js +1 -1
- package/components/video/ResponsiveVideo.js.map +1 -1
- package/hooks/useCookies.d.ts +79 -0
- package/hooks/useCookies.js +33 -0
- package/hooks/useCookies.js.map +1 -0
- package/hooks/useInterval.js +5 -5
- package/hooks/useInterval.js.map +1 -1
- package/hooks/useIsFocusWithin.js +3 -3
- package/hooks/useIsFocusWithin.js.map +1 -1
- package/hooks/useKey.d.ts +1 -1
- package/hooks/useKey.js.map +1 -1
- package/hooks/useLatest.d.ts +16 -0
- package/hooks/useLatest.js +11 -0
- package/hooks/useLatest.js.map +1 -0
- package/hooks/useOnboarding.d.ts +86 -80
- package/hooks/useOnboarding.js.map +1 -1
- package/hooks/usePostMessage.d.ts +2 -1
- package/hooks/usePostMessage.js.map +1 -1
- package/hooks/useRioCookieConsent.d.ts +49 -0
- package/hooks/useRioCookieConsent.js +44 -0
- package/hooks/useRioCookieConsent.js.map +1 -0
- package/hooks/useSearch.d.ts +1 -1
- package/hooks/useSearch.js +28 -17
- package/hooks/useSearch.js.map +1 -1
- package/hooks/useSearchHighlight.d.ts +60 -0
- package/hooks/useSearchHighlight.js +54 -0
- package/hooks/useSearchHighlight.js.map +1 -0
- package/hooks/useTableExport.js.map +1 -1
- package/hooks/useTimeout.js +11 -11
- package/hooks/useTimeout.js.map +1 -1
- package/hooks/useUncontrollable.d.ts +1 -1
- package/hooks/useUncontrollable.js.map +1 -1
- package/hooks/useUrlState.d.ts +62 -0
- package/hooks/useUrlState.js +137 -0
- package/hooks/useUrlState.js.map +1 -0
- package/mergeClassNameOverrides.d.ts +1 -0
- package/mergeClassNameOverrides.js +5 -0
- package/mergeClassNameOverrides.js.map +1 -0
- package/package.json +18 -21
- package/routeUtils.js +11 -5
- package/routeUtils.js.map +1 -1
- package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +1 -1
- package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js.map +1 -1
- package/useCookies.d.ts +2 -0
- package/useCookies.js +5 -0
- package/useCookies.js.map +1 -0
- package/useRioCookieConsent.d.ts +2 -0
- package/useRioCookieConsent.js +5 -0
- package/useRioCookieConsent.js.map +1 -0
- package/useSearchHighlight.d.ts +2 -0
- package/useSearchHighlight.js +6 -0
- package/useSearchHighlight.js.map +1 -0
- package/useUrlState.d.ts +2 -0
- package/useUrlState.js +5 -0
- package/useUrlState.js.map +1 -0
- package/utils/classNames.d.ts +3 -0
- package/utils/classNames.js +5 -0
- package/utils/classNames.js.map +1 -0
- package/utils/colorScheme.js +14 -13
- package/utils/colorScheme.js.map +1 -1
- package/utils/cssuseragent.js.map +1 -1
- package/utils/mergeClassNameOverrides.d.ts +1 -0
- package/utils/mergeClassNameOverrides.js +55 -0
- package/utils/mergeClassNameOverrides.js.map +1 -0
- package/utils/routeUtils.d.ts +122 -13
- package/utils/routeUtils.js +89 -31
- package/utils/routeUtils.js.map +1 -1
- package/utils/scrollItemIntoView.js +12 -11
- package/utils/scrollItemIntoView.js.map +1 -1
- package/utils/urlFeatureToggles.js +19 -20
- package/utils/urlFeatureToggles.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/components/states/BaseStateProps.d.ts +0 -66
- package/components/statusBar/StatusBar.types.d.ts +0 -85
- package/components/table/TableSettingsDialog.types.d.ts +0 -39
- package/components/tagManager/TagManagerTag.d.ts +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogHeader.js","sources":["../../../src/components/dialog/DialogHeader.tsx"],"sourcesContent":["import React, { type ComponentProps } from 'react';\nimport { noop } from 'es-toolkit/function';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"DialogHeader.js","sources":["../../../src/components/dialog/DialogHeader.tsx"],"sourcesContent":["import React, { type ComponentProps } from 'react';\nimport { noop } from 'es-toolkit/function';\n\nimport classNames from '../../utils/classNames';\nimport { useDialogContext } from './dialogContext';\n\nexport type DialogHeaderProps = Omit<ComponentProps<'div'>, 'title'> & {\n /**\n * The dialog title (can also be a FormattedMessage component).\n */\n title: string | React.ReactNode;\n\n /**\n * The dialog header subtitle content.\n */\n subtitle?: string | React.ReactNode;\n\n /**\n * Allows to add additional buttons to the dialog header.\n */\n headerButtons?: React.ReactNode;\n\n onCloseButtonClick?: () => void;\n};\n\nconst DialogHeader = (props: DialogHeaderProps) => {\n const { title, subtitle, headerButtons, onCloseButtonClick = noop, ...remainingProps } = props;\n\n const { onClose, isSmallestDialog, showXsDialogBorders, showCloseButton } = useDialogContext();\n\n const doShowXsDialogBorders = isSmallestDialog ? showXsDialogBorders : true;\n\n const doShowCloseButton = isSmallestDialog ? false : showCloseButton;\n\n const headerClasses = classNames('modal-header', !doShowXsDialogBorders && 'border-bottom-none');\n const headerTextClasses = classNames(\n 'modal-header-text',\n !doShowXsDialogBorders && 'padding-bottom-0 width-100pct'\n );\n\n const handleClose = (event: React.MouseEvent<HTMLButtonElement>) => {\n onCloseButtonClick();\n onClose(event);\n };\n\n return (\n <div {...remainingProps} className={headerClasses} aria-label='dialog header'>\n <div className={headerTextClasses}>\n {subtitle && <div className='modal-header-subtitle'>{subtitle}</div>}\n <div className='modal-header-title'>{title}</div>\n </div>\n <div className='modal-header-buttons'>\n {headerButtons && !isSmallestDialog && (\n <React.Fragment>\n {headerButtons}\n <div className='modal-header-buttons-spacer' />\n </React.Fragment>\n )}\n {doShowCloseButton && (\n <button\n type='button'\n className='btn btn-icon-only btn-muted modal-header-close close'\n onClick={handleClose}\n data-testid='close'\n aria-label='dialog close button'\n >\n <span className='rioglyph rioglyph-remove' aria-hidden='true' />\n </button>\n )}\n </div>\n </div>\n );\n};\n\nexport default DialogHeader;\n"],"names":["DialogHeader","props","title","subtitle","headerButtons","onCloseButtonClick","noop","remainingProps","onClose","isSmallestDialog","showXsDialogBorders","showCloseButton","useDialogContext","doShowXsDialogBorders","doShowCloseButton","headerClasses","classNames","headerTextClasses","handleClose","event","jsxs","jsx","React"],"mappings":";;;;;AAyBA,MAAMA,IAAe,CAACC,MAA6B;AAC/C,QAAM,EAAE,OAAAC,GAAO,UAAAC,GAAU,eAAAC,GAAe,oBAAAC,IAAqBC,GAAM,GAAGC,MAAmBN,GAEnF,EAAE,SAAAO,GAAS,kBAAAC,GAAkB,qBAAAC,GAAqB,iBAAAC,EAAA,IAAoBC,EAAA,GAEtEC,IAAwBJ,IAAmBC,IAAsB,IAEjEI,IAAoBL,IAAmB,KAAQE,GAE/CI,IAAgBC,EAAW,gBAAgB,CAACH,KAAyB,oBAAoB,GACzFI,IAAoBD;AAAA,IACtB;AAAA,IACA,CAACH,KAAyB;AAAA,EAAA,GAGxBK,IAAc,CAACC,MAA+C;AAChE,IAAAd,EAAA,GACAG,EAAQW,CAAK;AAAA,EACjB;AAEA,2BACK,OAAA,EAAK,GAAGZ,GAAgB,WAAWQ,GAAe,cAAW,iBAC1D,UAAA;AAAA,IAAA,gBAAAK,EAAC,OAAA,EAAI,WAAWH,GACX,UAAA;AAAA,MAAAd,KAAY,gBAAAkB,EAAC,OAAA,EAAI,WAAU,yBAAyB,UAAAlB,GAAS;AAAA,MAC9D,gBAAAkB,EAAC,OAAA,EAAI,WAAU,sBAAsB,UAAAnB,EAAA,CAAM;AAAA,IAAA,GAC/C;AAAA,IACA,gBAAAkB,EAAC,OAAA,EAAI,WAAU,wBACV,UAAA;AAAA,MAAAhB,KAAiB,CAACK,KACf,gBAAAW,EAACE,EAAM,UAAN,EACI,UAAA;AAAA,QAAAlB;AAAA,QACD,gBAAAiB,EAAC,OAAA,EAAI,WAAU,8BAAA,CAA8B;AAAA,MAAA,GACjD;AAAA,MAEHP,KACG,gBAAAO;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAASH;AAAA,UACT,eAAY;AAAA,UACZ,cAAW;AAAA,UAEX,UAAA,gBAAAG,EAAC,QAAA,EAAK,WAAU,4BAA2B,eAAY,OAAA,CAAO;AAAA,QAAA;AAAA,MAAA;AAAA,IAClE,EAAA,CAER;AAAA,EAAA,GACJ;AAER;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as s, jsxs as i, Fragment as z } from "react/jsx-runtime";
|
|
2
2
|
import { useState as F } from "react";
|
|
3
|
-
import r from "
|
|
3
|
+
import r from "../../utils/classNames.js";
|
|
4
4
|
import { noop as a } from "es-toolkit/function";
|
|
5
5
|
import R from "./Dialog.js";
|
|
6
6
|
import Y from "../video/ResponsiveVideo.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaDialog.js","sources":["../../../src/components/dialog/MediaDialog.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState } from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/function';\n\nimport Dialog, { type BaseDialogProps } from './Dialog';\nimport ResponsiveVideo from '../video/ResponsiveVideo';\nimport ImagePreloader from '../preloader/ImagePreloader';\nimport Spinner from '../spinner/Spinner';\n\n// TODO: add keyboard support left/right\n\nexport type MediaDialogMedia = {\n /**\n * Defines the media type that is going to be displayed.\n *\n * Possible values are: `image` and `video`.\n */\n type: 'image' | 'video';\n\n /**\n * The source location for the media data.\n */\n src: string;\n\n /**\n * The name or title of the media used for the dialogs title.\n */\n title: string | React.ReactNode;\n\n /**\n * Additional media information used for the dialogs subtitle.\n */\n subtitle?: string | React.ReactNode;\n\n /**\n * Only relevant for videos where the aspect of the video is defined.\n *\n * Possible values are: `4by3` and `16by9`.\n * @default '16by9'\n */\n aspectRatio?: '4by3' | '16by9';\n\n /**\n * Additional classes for the image element.\n */\n className?: string;\n};\n\nexport type MediaDialogProps = BaseDialogProps & {\n /**\n * List of media objects.\n */\n media: MediaDialogMedia[];\n\n /**\n * The button text for switching to the previous media if there are multiple.\n */\n previousButtonText: string | React.ReactNode;\n\n /**\n * Callback function for when the previous button is clicked.\n * @param newIndex\n * @returns\n */\n previousButtonCallback?: (newIndex: number) => void;\n\n /**\n * The button text for switching to the next media if there are multiple.\n */\n nextButtonText: string | React.ReactNode;\n\n /**\n * Callback function for when the next button is clicked.\n * @param newIndex\n * @returns\n */\n nextButtonCallback?: (newIndex: number) => void;\n};\n\nconst MediaDialog = (props: MediaDialogProps) => {\n const {\n show = false,\n onClose = noop,\n disableEsc = false,\n useOverflow = false,\n bsSize = 'lg',\n media = [],\n previousButtonText = 'Prev',\n previousButtonCallback = noop,\n nextButtonText = 'Next',\n nextButtonCallback = noop,\n className,\n ...remainingProps\n } = props;\n\n const [currentMediaIndex, setCurrentMediaIndex] = useState(0);\n\n const handlePrevious = () => {\n const oldIndex = currentMediaIndex;\n const newIndex = oldIndex === 0 ? props.media.length - 1 : oldIndex - 1;\n setCurrentMediaIndex(newIndex);\n previousButtonCallback(newIndex);\n };\n\n const handleNext = () => {\n const oldIndex = currentMediaIndex;\n const newIndex = oldIndex === props.media.length - 1 ? 0 : oldIndex + 1;\n setCurrentMediaIndex(newIndex);\n nextButtonCallback(newIndex);\n };\n\n const renderFallback = () => {\n return (\n <div className='text-center text-size-h3'>\n <span className='rioglyph rioglyph-missing text-size-200pct text-color-gray' />\n </div>\n );\n };\n\n const renderImage = (mediaData: MediaDialogMedia) => {\n const imageClassNames = classNames('img-responsive', mediaData.className && mediaData.className);\n\n return (\n // @ts-ignore\n <ImagePreloader src={mediaData.src} className={imageClassNames}>\n {({ status, image }: { status: 'PENDING' | 'LOADED' | 'FAILED'; image: { src: string } }) => {\n if (status === ImagePreloader.STATUS_LOADED) {\n // When image has been loaded, render the image tag\n return <img className='ani-fade-in' key={image.src} src={image.src} />;\n }\n\n if (status === ImagePreloader.STATUS_FAILED) {\n return renderFallback();\n }\n\n return <Spinner isInverse={false} />;\n }}\n </ImagePreloader>\n );\n };\n\n const renderVideo = (mediaData: MediaDialogMedia) => {\n const videoClassNames = classNames(mediaData.className && mediaData.className);\n return (\n <div className='flex-1-0'>\n <ResponsiveVideo\n src={mediaData.src}\n aspectRatio={mediaData.aspectRatio ?? '16by9'}\n className={videoClassNames}\n />\n </div>\n );\n };\n\n const renderMediaContent = (mediaData = {} as MediaDialogMedia) => {\n if (mediaData.type === MediaDialog.MEDIA_TYPE_VIDEO) {\n return renderVideo(mediaData);\n }\n\n // image media is default\n return mediaData.src && renderImage(mediaData);\n };\n\n const dialogClassName = classNames('media-dialog', className && className);\n const bodyClassNames = classNames('padding-0');\n const mediaContentClassNames = classNames('media-content', 'content-center');\n\n const mediaTitle = media[currentMediaIndex].title;\n const mediaSubtitle = media[currentMediaIndex].subtitle || null;\n\n return (\n <Dialog\n {...remainingProps}\n show={show}\n title={mediaTitle}\n subtitle={mediaSubtitle}\n body={<div className={mediaContentClassNames}>{renderMediaContent(media[currentMediaIndex])}</div>}\n footer={\n media?.length > 1 && (\n <>\n <button type='button' className='btn btn-primary btn-link pull-left' onClick={handlePrevious}>\n <span className='rioglyph rioglyph-chevron-left' />\n {previousButtonText}\n </button>\n <div>{`${currentMediaIndex + 1} / ${props.media.length}`}</div>\n <button type='button' className='btn btn-primary btn-link btn-icon-right' onClick={handleNext}>\n <span className='rioglyph rioglyph-chevron-right' />\n {nextButtonText}\n </button>\n </>\n )\n }\n onClose={onClose}\n className={dialogClassName}\n bodyClassName={bodyClassNames}\n disableEsc={disableEsc}\n useOverflow={useOverflow}\n bsSize={bsSize}\n />\n );\n};\n\nMediaDialog.MEDIA_TYPE_IMAGE = 'image' as const;\nMediaDialog.MEDIA_TYPE_VIDEO = 'video' as const;\n\nexport default MediaDialog;\n"],"names":["MediaDialog","props","show","onClose","noop","disableEsc","useOverflow","bsSize","media","previousButtonText","previousButtonCallback","nextButtonText","nextButtonCallback","className","remainingProps","currentMediaIndex","setCurrentMediaIndex","useState","handlePrevious","oldIndex","newIndex","handleNext","renderFallback","jsx","renderImage","mediaData","imageClassNames","classNames","ImagePreloader","status","image","Spinner","renderVideo","videoClassNames","ResponsiveVideo","renderMediaContent","dialogClassName","bodyClassNames","mediaContentClassNames","mediaTitle","mediaSubtitle","Dialog","jsxs","Fragment"],"mappings":";;;;;;;;AAgFA,MAAMA,IAAc,CAACC,MAA4B;AAC7C,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAUC;AAAA,IACV,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ,CAAA;AAAA,IACR,oBAAAC,IAAqB;AAAA,IACrB,wBAAAC,IAAyBN;AAAA,IACzB,gBAAAO,IAAiB;AAAA,IACjB,oBAAAC,IAAqBR;AAAA,IACrB,WAAAS;AAAA,IACA,GAAGC;AAAA,EAAA,IACHb,GAEE,CAACc,GAAmBC,CAAoB,IAAIC,EAAS,CAAC,GAEtDC,IAAiB,MAAM;AACzB,UAAMC,IAAWJ,GACXK,IAAWD,MAAa,IAAIlB,EAAM,MAAM,SAAS,IAAIkB,IAAW;AACtE,IAAAH,EAAqBI,CAAQ,GAC7BV,EAAuBU,CAAQ;AAAA,EACnC,GAEMC,IAAa,MAAM;AACrB,UAAM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gBhC,EAAMO,CAAiB,EAAE,YAAY;AAE3D,SACI,gBAAAQ;AAAA,IAACkB;AAAA,IAAA;AAAA,MACI,GAAG3B;AAAA,MACJ,MAAAZ;AAAA,MACA,OAAOqC;AAAA,MACP,UAAUC;AAAA,MACV,wBAAO,OAAA,EAAI,WAAWF,GAAyB,UAAAH,EAAmB3B,EAAMO,CAAiB,CAAC,EAAA,CAAE;AAAA,MAC5F,QACIP,GAAO,SAAS,KACZ,gBAAAkC,EAAAC,GAAA,EACI,UAAA;AAAA,QAAA,gBAAAD,EAAC,YAAO,MAAK,UAAS,WAAU,sCAAqC,SAASxB,GAC1E,UAAA;AAAA,UAAA,gBAAAK,EAAC,QAAA,EAAK,WAAU,iCAAA,CAAiC;AAAA,UAChDd;AAAA,QAAA,GACL;AAAA,QACA,gBAAAc,EAAC,SAAK,UAAA,GAAGR,IAAoB,CAAC,MAAMd,EAAM,MAAM,MAAM,GAAA,CAAG;AAAA,0BACxD,UAAA,EAAO,MAAK,UAAS,WAAU,2CAA0C,SAASoB,GAC/E,UAAA;AAAA,UAAA,gBAAAE,EAAC,QAAA,EAAK,WAAU,kCAAA,CAAkC;AAAA,UACjDZ;AAAA,QAAA,EAAA,CACL;AAAA,MAAA,GACJ;AAAA,MAGR,SAAAR;AAAA,MACA,WAAWiC;AAAA,MACX,eAAeC;AAAA,MACf,YAAAhC;AAAA,MACA,aAAAC;AAAA,MACA,QAAAC;AAAA,IAAA;AAAA,EAAA;AAGZ;AAEAP,EAAY,mBAAmB;AAC/BA,EAAY,mBAAmB;"}
|
|
1
|
+
{"version":3,"file":"MediaDialog.js","sources":["../../../src/components/dialog/MediaDialog.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState } from 'react';\nimport classNames from '../../utils/classNames';\nimport { noop } from 'es-toolkit/function';\n\nimport Dialog, { type BaseDialogProps } from './Dialog';\nimport ResponsiveVideo from '../video/ResponsiveVideo';\nimport ImagePreloader from '../preloader/ImagePreloader';\nimport Spinner from '../spinner/Spinner';\n\n// TODO: add keyboard support left/right\n\nexport type MediaDialogMedia = {\n /**\n * Defines the media type that is going to be displayed.\n *\n * Possible values are: `image` and `video`.\n */\n type: 'image' | 'video';\n\n /**\n * The source location for the media data.\n */\n src: string;\n\n /**\n * The name or title of the media used for the dialogs title.\n */\n title: string | React.ReactNode;\n\n /**\n * Additional media information used for the dialogs subtitle.\n */\n subtitle?: string | React.ReactNode;\n\n /**\n * Only relevant for videos where the aspect of the video is defined.\n *\n * Possible values are: `4by3` and `16by9`.\n * @default '16by9'\n */\n aspectRatio?: '4by3' | '16by9';\n\n /**\n * Additional classes for the image element.\n */\n className?: string;\n};\n\nexport type MediaDialogProps = BaseDialogProps & {\n /**\n * List of media objects.\n */\n media: MediaDialogMedia[];\n\n /**\n * The button text for switching to the previous media if there are multiple.\n */\n previousButtonText: string | React.ReactNode;\n\n /**\n * Callback function for when the previous button is clicked.\n * @param newIndex\n * @returns\n */\n previousButtonCallback?: (newIndex: number) => void;\n\n /**\n * The button text for switching to the next media if there are multiple.\n */\n nextButtonText: string | React.ReactNode;\n\n /**\n * Callback function for when the next button is clicked.\n * @param newIndex\n * @returns\n */\n nextButtonCallback?: (newIndex: number) => void;\n};\n\nconst MediaDialog = (props: MediaDialogProps) => {\n const {\n show = false,\n onClose = noop,\n disableEsc = false,\n useOverflow = false,\n bsSize = 'lg',\n media = [],\n previousButtonText = 'Prev',\n previousButtonCallback = noop,\n nextButtonText = 'Next',\n nextButtonCallback = noop,\n className,\n ...remainingProps\n } = props;\n\n const [currentMediaIndex, setCurrentMediaIndex] = useState(0);\n\n const handlePrevious = () => {\n const oldIndex = currentMediaIndex;\n const newIndex = oldIndex === 0 ? props.media.length - 1 : oldIndex - 1;\n setCurrentMediaIndex(newIndex);\n previousButtonCallback(newIndex);\n };\n\n const handleNext = () => {\n const oldIndex = currentMediaIndex;\n const newIndex = oldIndex === props.media.length - 1 ? 0 : oldIndex + 1;\n setCurrentMediaIndex(newIndex);\n nextButtonCallback(newIndex);\n };\n\n const renderFallback = () => {\n return (\n <div className='text-center text-size-h3'>\n <span className='rioglyph rioglyph-missing text-size-200pct text-color-gray' />\n </div>\n );\n };\n\n const renderImage = (mediaData: MediaDialogMedia) => {\n const imageClassNames = classNames('img-responsive', mediaData.className && mediaData.className);\n\n return (\n // @ts-ignore\n <ImagePreloader src={mediaData.src} className={imageClassNames}>\n {({ status, image }: { status: 'PENDING' | 'LOADED' | 'FAILED'; image: { src: string } }) => {\n if (status === ImagePreloader.STATUS_LOADED) {\n // When image has been loaded, render the image tag\n return <img className='ani-fade-in' key={image.src} src={image.src} />;\n }\n\n if (status === ImagePreloader.STATUS_FAILED) {\n return renderFallback();\n }\n\n return <Spinner isInverse={false} />;\n }}\n </ImagePreloader>\n );\n };\n\n const renderVideo = (mediaData: MediaDialogMedia) => {\n const videoClassNames = classNames(mediaData.className && mediaData.className);\n return (\n <div className='flex-1-0'>\n <ResponsiveVideo\n src={mediaData.src}\n aspectRatio={mediaData.aspectRatio ?? '16by9'}\n className={videoClassNames}\n />\n </div>\n );\n };\n\n const renderMediaContent = (mediaData = {} as MediaDialogMedia) => {\n if (mediaData.type === MediaDialog.MEDIA_TYPE_VIDEO) {\n return renderVideo(mediaData);\n }\n\n // image media is default\n return mediaData.src && renderImage(mediaData);\n };\n\n const dialogClassName = classNames('media-dialog', className && className);\n const bodyClassNames = classNames('padding-0');\n const mediaContentClassNames = classNames('media-content', 'content-center');\n\n const mediaTitle = media[currentMediaIndex].title;\n const mediaSubtitle = media[currentMediaIndex].subtitle || null;\n\n return (\n <Dialog\n {...remainingProps}\n show={show}\n title={mediaTitle}\n subtitle={mediaSubtitle}\n body={<div className={mediaContentClassNames}>{renderMediaContent(media[currentMediaIndex])}</div>}\n footer={\n media?.length > 1 && (\n <>\n <button type='button' className='btn btn-primary btn-link pull-left' onClick={handlePrevious}>\n <span className='rioglyph rioglyph-chevron-left' />\n {previousButtonText}\n </button>\n <div>{`${currentMediaIndex + 1} / ${props.media.length}`}</div>\n <button type='button' className='btn btn-primary btn-link btn-icon-right' onClick={handleNext}>\n <span className='rioglyph rioglyph-chevron-right' />\n {nextButtonText}\n </button>\n </>\n )\n }\n onClose={onClose}\n className={dialogClassName}\n bodyClassName={bodyClassNames}\n disableEsc={disableEsc}\n useOverflow={useOverflow}\n bsSize={bsSize}\n />\n );\n};\n\nMediaDialog.MEDIA_TYPE_IMAGE = 'image' as const;\nMediaDialog.MEDIA_TYPE_VIDEO = 'video' as const;\n\nexport default MediaDialog;\n"],"names":["MediaDialog","props","show","onClose","noop","disableEsc","useOverflow","bsSize","media","previousButtonText","previousButtonCallback","nextButtonText","nextButtonCallback","className","remainingProps","currentMediaIndex","setCurrentMediaIndex","useState","handlePrevious","oldIndex","newIndex","handleNext","renderFallback","jsx","renderImage","mediaData","imageClassNames","classNames","ImagePreloader","status","image","Spinner","renderVideo","videoClassNames","ResponsiveVideo","renderMediaContent","dialogClassName","bodyClassNames","mediaContentClassNames","mediaTitle","mediaSubtitle","Dialog","jsxs","Fragment"],"mappings":";;;;;;;;AAgFA,MAAMA,IAAc,CAACC,MAA4B;AAC7C,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAUC;AAAA,IACV,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ,CAAA;AAAA,IACR,oBAAAC,IAAqB;AAAA,IACrB,wBAAAC,IAAyBN;AAAA,IACzB,gBAAAO,IAAiB;AAAA,IACjB,oBAAAC,IAAqBR;AAAA,IACrB,WAAAS;AAAA,IACA,GAAGC;AAAA,EAAA,IACHb,GAEE,CAACc,GAAmBC,CAAoB,IAAIC,EAAS,CAAC,GAEtDC,IAAiB,MAAM;AACzB,UAAMC,IAAWJ,GACXK,IAAWD,MAAa,IAAIlB,EAAM,MAAM,SAAS,IAAIkB,IAAW;AACtE,IAAAH,EAAqBI,CAAQ,GAC7BV,EAAuBU,CAAQ;AAAA,EACnC,GAEMC,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AiB,EAAE,OACtCyB,IAAgBhC,EAAMO,CAAiB,EAAE,YAAY;AAE3D,SACI,gBAAAQ;AAAA,IAACkB;AAAA,IAAA;AAAA,MACI,GAAG3B;AAAA,MACJ,MAAAZ;AAAA,MACA,OAAOqC;AAAA,MACP,UAAUC;AAAA,MACV,wBAAO,OAAA,EAAI,WAAWF,GAAyB,UAAAH,EAAmB3B,EAAMO,CAAiB,CAAC,EAAA,CAAE;AAAA,MAC5F,QACIP,GAAO,SAAS,KACZ,gBAAAkC,EAAAC,GAAA,EACI,UAAA;AAAA,QAAA,gBAAAD,EAAC,YAAO,MAAK,UAAS,WAAU,sCAAqC,SAASxB,GAC1E,UAAA;AAAA,UAAA,gBAAAK,EAAC,QAAA,EAAK,WAAU,iCAAA,CAAiC;AAAA,UAChDd;AAAA,QAAA,GACL;AAAA,QACA,gBAAAc,EAAC,SAAK,UAAA,GAAGR,IAAoB,CAAC,MAAMd,EAAM,MAAM,MAAM,GAAA,CAAG;AAAA,0BACxD,UAAA,EAAO,MAAK,UAAS,WAAU,2CAA0C,SAASoB,GAC/E,UAAA;AAAA,UAAA,gBAAAE,EAAC,QAAA,EAAK,WAAU,kCAAA,CAAkC;AAAA,UACjDZ;AAAA,QAAA,EAAA,CACL;AAAA,MAAA,GACJ;AAAA,MAGR,SAAAR;AAAA,MACA,WAAWiC;AAAA,MACX,eAAeC;AAAA,MACf,YAAAhC;AAAA,MACA,aAAAC;AAAA,MACA,QAAAC;AAAA,IAAA;AAAA,EAAA;AAGZ;AAEAP,EAAY,mBAAmB;AAC/BA,EAAY,mBAAmB;"}
|
|
@@ -6,6 +6,7 @@ export type ReleaseNotesDialogProps = {
|
|
|
6
6
|
showReleaseNotes: boolean;
|
|
7
7
|
/**
|
|
8
8
|
* Callback set showReleaseNotes state
|
|
9
|
+
*
|
|
9
10
|
* @param show
|
|
10
11
|
* @returns
|
|
11
12
|
*/
|
|
@@ -26,8 +27,6 @@ export type ReleaseNotesDialogProps = {
|
|
|
26
27
|
* Translated release notes.
|
|
27
28
|
*
|
|
28
29
|
* @example
|
|
29
|
-
*
|
|
30
|
-
* ```tsx
|
|
31
30
|
* {
|
|
32
31
|
* "0.1.2": {
|
|
33
32
|
* date: '20.10.2023',
|
|
@@ -40,7 +39,6 @@ export type ReleaseNotesDialogProps = {
|
|
|
40
39
|
* ),
|
|
41
40
|
* }
|
|
42
41
|
* }
|
|
43
|
-
* ```
|
|
44
42
|
*/
|
|
45
43
|
translatedReleaseNotes: ReleaseNotesData;
|
|
46
44
|
/**
|
|
@@ -54,6 +52,8 @@ export type ReleaseNotesDialogProps = {
|
|
|
54
52
|
/**
|
|
55
53
|
* Enables the content of the dialog to scroll when it overflows.
|
|
56
54
|
* This means the dialog body scrolls instead of the entire dialog.
|
|
55
|
+
*
|
|
56
|
+
* @default true
|
|
57
57
|
*/
|
|
58
58
|
useOverflow?: boolean;
|
|
59
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReleaseNotesDialog.js","sources":["../../../src/components/dialog/ReleaseNotesDialog.tsx"],"sourcesContent":["import ReleaseNotes, { type ReleaseNotesData } from '../releaseNotes/ReleaseNotes';\n\nimport Button from '../button/Button';\nimport Dialog from './Dialog';\n\nconst setReleaseNotesItem = (props: ReleaseNotesDialogProps) => {\n window.localStorage.setItem(props.RELEASE_NOTES_ITEM, props.currentVersion);\n props.setShowReleaseNotes(false);\n};\n\nconst getModuleName = (moduleName: string | undefined, whatsNew: string | undefined) => (\n <span>{moduleName ? moduleName : whatsNew}</span>\n);\n\nexport type ReleaseNotesDialogProps = {\n /**\n * Decides if the dialog is opened.\n */\n showReleaseNotes: boolean;\n\n /**\n * Callback set showReleaseNotes state\n * @param show\n * @returns\n */\n setShowReleaseNotes: (show: boolean) => void;\n\n /**\n * Translated text for \"What`s new?\"\n */\n whatsNewTitle?: string;\n\n /**\n * The translated modulename.\n */\n moduleName?: string;\n\n /**\n * Translated text for the close button.\n */\n closeButtonText?: string;\n\n /**\n * Translated release notes.\n *\n * @example\n
|
|
1
|
+
{"version":3,"file":"ReleaseNotesDialog.js","sources":["../../../src/components/dialog/ReleaseNotesDialog.tsx"],"sourcesContent":["import ReleaseNotes, { type ReleaseNotesData } from '../releaseNotes/ReleaseNotes';\n\nimport Button from '../button/Button';\nimport Dialog from './Dialog';\n\nconst setReleaseNotesItem = (props: ReleaseNotesDialogProps) => {\n window.localStorage.setItem(props.RELEASE_NOTES_ITEM, props.currentVersion);\n props.setShowReleaseNotes(false);\n};\n\nconst getModuleName = (moduleName: string | undefined, whatsNew: string | undefined) => (\n <span>{moduleName ? moduleName : whatsNew}</span>\n);\n\nexport type ReleaseNotesDialogProps = {\n /**\n * Decides if the dialog is opened.\n */\n showReleaseNotes: boolean;\n\n /**\n * Callback set showReleaseNotes state\n *\n * @param show\n * @returns\n */\n setShowReleaseNotes: (show: boolean) => void;\n\n /**\n * Translated text for \"What`s new?\"\n */\n whatsNewTitle?: string;\n\n /**\n * The translated modulename.\n */\n moduleName?: string;\n\n /**\n * Translated text for the close button.\n */\n closeButtonText?: string;\n\n /**\n * Translated release notes.\n *\n * @example\n * {\n * \"0.1.2\": {\n * date: '20.10.2023',\n * content: (\n * <div className='padding-left-15'>\n * Summary\n * • Feature 1\n * • Feature 2\n * </div>\n * ),\n * }\n * }\n */\n translatedReleaseNotes: ReleaseNotesData;\n\n /**\n * Specifies the current module version.\n */\n currentVersion: string;\n\n /**\n * Specifies the item in the localStorage that is used to save the last read module version.\n */\n RELEASE_NOTES_ITEM: string;\n\n /**\n * Enables the content of the dialog to scroll when it overflows.\n * This means the dialog body scrolls instead of the entire dialog.\n *\n * @default true\n */\n useOverflow?: boolean;\n};\n\nconst ReleaseNotesDialog = (props: ReleaseNotesDialogProps) => {\n const { moduleName, whatsNewTitle, closeButtonText, translatedReleaseNotes, useOverflow = true } = props;\n\n return (\n <Dialog\n show={props.showReleaseNotes}\n useOverflow={useOverflow}\n title={getModuleName(moduleName, whatsNewTitle)}\n subtitle={moduleName && whatsNewTitle}\n body={<ReleaseNotes releaseNotes={translatedReleaseNotes} />}\n footer={<Button onClick={() => setReleaseNotesItem(props)}>{closeButtonText || 'Close'}</Button>}\n onClose={() => setReleaseNotesItem(props)}\n />\n );\n};\n\nexport default ReleaseNotesDialog;\n"],"names":["setReleaseNotesItem","props","getModuleName","moduleName","whatsNew","ReleaseNotesDialog","whatsNewTitle","closeButtonText","translatedReleaseNotes","useOverflow","jsx","Dialog","ReleaseNotes","Button"],"mappings":";;;;AAKA,MAAMA,IAAsB,CAACC,MAAmC;AAC5D,SAAO,aAAa,QAAQA,EAAM,oBAAoBA,EAAM,cAAc,GAC1EA,EAAM,oBAAoB,EAAK;AACnC,GAEMC,IAAgB,CAACC,GAAgCC,wBAClD,QAAA,EAAM,UAAAD,KAA0BC,GAAS,GAsExCC,IAAqB,CAACJ,MAAmC;AAC3D,QAAM,EAAE,YAAAE,GAAY,eAAAG,GAAe,iBAAAC,GAAiB,wBAAAC,GAAwB,aAAAC,IAAc,OAASR;AAEnG,SACI,gBAAAS;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,MAAMV,EAAM;AAAA,MACZ,aAAAQ;AAAA,MACA,OAAOP,EAAcC,GAAYG,CAAa;AAAA,MAC9C,UAAUH,KAAcG;AAAA,MACxB,MAAM,gBAAAI,EAACE,GAAA,EAAa,cAAcJ,EAAA,CAAwB;AAAA,MAC1D,0BAASK,GAAA,EAAO,SAAS,MAAMb,EAAoBC,CAAK,GAAI,UAAAM,KAAmB,QAAA,CAAQ;AAAA,MACvF,SAAS,MAAMP,EAAoBC,CAAK;AAAA,IAAA;AAAA,EAAA;AAGpD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitDialog.js","sources":["../../../src/components/dialog/SplitDialog.tsx"],"sourcesContent":["import type React from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"SplitDialog.js","sources":["../../../src/components/dialog/SplitDialog.tsx"],"sourcesContent":["import type React from 'react';\n\nimport classNames from '../../utils/classNames';\n\nimport Dialog, { type BaseDialogProps } from './Dialog';\n\nexport type SplitDialogProps = Omit<BaseDialogProps, 'useOverflow'> & {\n /**\n * The content to be shown on the left side.\n */\n leftContent?: string | React.ReactNode;\n\n /**\n * Additional classes for the left content element.\n */\n leftContentClassName?: string;\n\n /**\n * The content to be shown on the right side.\n */\n rightContent?: string | React.ReactNode;\n\n /**\n * Additional classes for the right content element.\n */\n rightContentClassName?: string;\n\n /**\n * The dialog body content.\n */\n footer?: React.ReactNode;\n\n /**\n * Additional classes for the modal-footer element.\n */\n footerClassName?: string;\n\n /**\n * A callback function to be executed before closing the dialog.\n *\n * If the function returns `false`, the dialog will not be closed\n */\n onCloseValidation?: () => boolean;\n\n /**\n * Enables the modal body to overflow and use inline scrolling if needed.\n *\n * @default true\n */\n useOverflow?: boolean;\n\n /**\n * Allows to disable the divider.\n *\n * @default true\n */\n showDivider?: boolean;\n};\n\nconst SplitDialog = (props: SplitDialogProps) => {\n const {\n leftContent,\n rightContent,\n leftContentClassName = '',\n rightContentClassName = '',\n className = '',\n useOverflow = true,\n showDivider = true,\n ...remainingProps\n } = props;\n\n const dialogClassName = `split-dialog ${className}`;\n\n const dividerClasses = classNames('split-divider', 'bg-lighter');\n\n const body = (\n <div className='split-wrapper'>\n <div className={`split-left ${leftContentClassName}`}>\n {leftContent}\n {showDivider && <div className={dividerClasses} />}\n </div>\n <div className={`split-right ${rightContentClassName}`}>{rightContent}</div>\n </div>\n );\n\n return <Dialog {...remainingProps} body={body} className={dialogClassName} useOverflow={useOverflow} />;\n};\n\nexport default SplitDialog;\n"],"names":["SplitDialog","props","leftContent","rightContent","leftContentClassName","rightContentClassName","className","useOverflow","showDivider","remainingProps","dialogClassName","dividerClasses","classNames","body","jsxs","jsx","Dialog"],"mappings":";;;AA2DA,MAAMA,IAAc,CAACC,MAA4B;AAC7C,QAAM;AAAA,IACF,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,sBAAAC,IAAuB;AAAA,IACvB,uBAAAC,IAAwB;AAAA,IACxB,WAAAC,IAAY;AAAA,IACZ,aAAAC,IAAc;AAAA,IACd,aAAAC,IAAc;AAAA,IACd,GAAGC;AAAA,EAAA,IACHR,GAEES,IAAkB,gBAAgBJ,CAAS,IAE3CK,IAAiBC,EAAW,iBAAiB,YAAY,GAEzDC,IACF,gBAAAC,EAAC,OAAA,EAAI,WAAU,iBACX,UAAA;AAAA,IAAA,gBAAAA,EAAC,OAAA,EAAI,WAAW,cAAcV,CAAoB,IAC7C,UAAA;AAAA,MAAAF;AAAA,MACAM,KAAe,gBAAAO,EAAC,OAAA,EAAI,WAAWJ,EAAA,CAAgB;AAAA,IAAA,GACpD;AAAA,sBACC,OAAA,EAAI,WAAW,eAAeN,CAAqB,IAAK,UAAAF,EAAA,CAAa;AAAA,EAAA,GAC1E;AAGJ,2BAAQa,GAAA,EAAQ,GAAGP,GAAgB,MAAAI,GAAY,WAAWH,GAAiB,aAAAH,GAA0B;AACzG;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.js","sources":["../../../src/components/divider/Divider.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"Divider.js","sources":["../../../src/components/divider/Divider.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type DividerProps = {\n /**\n * The amount of space to either side\n *\n * @default 15\n */\n spacing?: number;\n\n /**\n * Defines the width of the divider line\n *\n * @default 1\n */\n dividerWidth?: 1 | 2 | 3;\n\n /**\n * Defines the color of the divider line\n *\n * @default 'light'\n */\n dividerColor?: 'darkest' | 'darker' | 'dark' | 'gray' | 'light' | 'lighter' | 'lightest';\n\n /**\n * Use the component as a spacer element without the divider line\n *\n * @default false\n */\n asSpacer?: boolean;\n\n /**\n * Set the orientation for the divider line to vertical.\n * This may be useful for button toolbars or elements on a single row.\n *\n * @default false\n */\n vertical?: boolean;\n\n /**\n * Defines where the children are aligned on the divider line\n *\n * @default 'center'\n */\n titleAlignment?: 'left' | 'center' | 'right';\n\n /**\n * Additional classes added to the wrapping element.\n */\n className?: string;\n};\n\nconst Divider = (props: PropsWithChildren<DividerProps>) => {\n const {\n spacing = 15,\n dividerWidth = 1,\n dividerColor = 'light',\n asSpacer = false,\n vertical = false,\n titleAlignment = 'center',\n className = '',\n children,\n } = props;\n\n const classes = classNames('Divider', 'position-relative', !vertical && 'width-100pct', className);\n\n const spacingValue = `${spacing}px`;\n const wrapperStyle: React.CSSProperties = {};\n\n if (vertical) {\n wrapperStyle.paddingLeft = spacingValue;\n wrapperStyle.paddingRight = spacingValue;\n }\n\n if (!vertical) {\n wrapperStyle.paddingTop = spacingValue;\n wrapperStyle.paddingBottom = spacingValue;\n }\n\n const dividerLineClasses = classNames('divider-line', `bg-${dividerColor}`);\n\n const isStringTitle = typeof children === 'string';\n\n const line = (\n <div\n className={dividerLineClasses}\n style={{\n width: vertical ? `${dividerWidth}px` : '100%',\n height: vertical ? '100%' : `${dividerWidth}px`,\n }}\n />\n );\n\n const titleLine = <div className='flex-1-0'>{line}</div>;\n const title = <div className={isStringTitle ? 'padding-x-10' : ''}>{children}</div>;\n\n const dividerTitleClasses = classNames('divider-title', 'display-flex', 'align-items-center');\n\n return (\n <div className={classes} style={wrapperStyle}>\n {!asSpacer && !children && line}\n {children && (\n <div className={dividerTitleClasses}>\n {titleAlignment === 'left' && (\n <>\n {title}\n {titleLine}\n </>\n )}\n {titleAlignment === 'center' && (\n <>\n {titleLine}\n {title}\n {titleLine}\n </>\n )}\n {titleAlignment === 'right' && (\n <>\n {titleLine}\n {title}\n </>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default Divider;\n"],"names":["Divider","props","spacing","dividerWidth","dividerColor","asSpacer","vertical","titleAlignment","className","children","classes","classNames","spacingValue","wrapperStyle","dividerLineClasses","isStringTitle","line","jsx","titleLine","title","dividerTitleClasses","jsxs","Fragment"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AAA,GACL;AAAA,MAEHX,MAAmB,YAChB,gBAAAc,EAAAC,GAAA,EACK,UAAA;AAAA,QAAAJ;AAAA,QACAC;AAAA,QACAD;AAAA,MAAA,GACL;AAAA,MAEHX,MAAmB,WAChB,gBAAAc,EAAAC,GAAA,EACK,UAAA;AAAA,QAAAJ;AAAA,QACAC;AAAA,MAAA,EAAA,CACL;AAAA,IAAA,EAAA,CAER;AAAA,EAAA,GAER;AAER;"}
|
|
@@ -33,12 +33,16 @@ export type ButtonDropdownProps<T extends DropdownToggleButtonType = 'button'> =
|
|
|
33
33
|
* Defines how large the button will be rendered.
|
|
34
34
|
*
|
|
35
35
|
* Possible values are: `xs`, `sm`, `md`, `lg`
|
|
36
|
+
*
|
|
37
|
+
* @default 'md'
|
|
36
38
|
*/
|
|
37
39
|
bsSize?: BUTTON_SIZE;
|
|
38
40
|
/**
|
|
39
41
|
* Defines the button color.
|
|
40
42
|
*
|
|
41
43
|
* Possible values are: `default`, `primary`, `secondary`, `info`, `warning`, `danger`, `success`, `muted`
|
|
44
|
+
*
|
|
45
|
+
* @default 'default'
|
|
42
46
|
*/
|
|
43
47
|
bsStyle?: BUTTON_STYLE;
|
|
44
48
|
/**
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { usePopper as
|
|
5
|
-
import P from "classnames";
|
|
1
|
+
import { jsx as i, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ro, useState as f, useEffect as so } from "react";
|
|
3
|
+
import lo from "react-dom";
|
|
4
|
+
import { usePopper as po } from "react-popper";
|
|
6
5
|
import { noop as u } from "es-toolkit/function";
|
|
7
|
-
import { isNil as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
6
|
+
import { isNil as ao } from "es-toolkit/predicate";
|
|
7
|
+
import P from "../../utils/classNames.js";
|
|
8
|
+
import { getOrCreatePortalRoot as io } from "../../utils/portalRoot.js";
|
|
9
|
+
import fo, { DEFAULT_EVENT_TYPES as co } from "../../hooks/useClickOutside.js";
|
|
10
|
+
import mo from "../menuItems/MenuItems.js";
|
|
11
|
+
import uo from "../menuItems/MenuItemList.js";
|
|
12
|
+
import go from "./DropdownToggleButton.js";
|
|
13
|
+
import wo from "./SplitCaretButton.js";
|
|
14
|
+
import Co from "./Caret.js";
|
|
15
|
+
const Bo = (r, s) => r && s ? "top-end" : !r && s ? "top-start" : r && !s ? "bottom-end" : "bottom-start", Do = () => ro((r, s) => {
|
|
16
16
|
const {
|
|
17
17
|
id: g = Math.random().toString(36).slice(2, 16),
|
|
18
18
|
items: R = [],
|
|
@@ -26,61 +26,61 @@ const Do = (r, s) => r && s ? "top-end" : !r && s ? "top-start" : r && !s ? "bot
|
|
|
26
26
|
customDropdown: O,
|
|
27
27
|
open: e,
|
|
28
28
|
dropup: y = !1,
|
|
29
|
-
pullRight:
|
|
29
|
+
pullRight: c = !1,
|
|
30
30
|
noCaret: E = !1,
|
|
31
31
|
onOpen: L = u,
|
|
32
32
|
onClose: x = u,
|
|
33
33
|
onLabelButtonClick: I = u,
|
|
34
|
-
usePortal:
|
|
34
|
+
usePortal: l = !1,
|
|
35
35
|
popperConfig: j,
|
|
36
|
-
toggleButtonType:
|
|
36
|
+
toggleButtonType: U = "button",
|
|
37
37
|
toggleClassName: S = "",
|
|
38
|
-
dropdownClassName:
|
|
39
|
-
className:
|
|
40
|
-
...
|
|
41
|
-
} = r, [b, m] =
|
|
42
|
-
placement:
|
|
38
|
+
dropdownClassName: _,
|
|
39
|
+
className: v = "",
|
|
40
|
+
...z
|
|
41
|
+
} = r, [b, m] = f(e), [A, F] = f(null), [M, V] = f(null), [Y, q] = f(null), G = {
|
|
42
|
+
placement: Bo(c, y),
|
|
43
43
|
modifiers: []
|
|
44
|
-
}, H = t &&
|
|
44
|
+
}, H = t && c ? Y : A, { styles: J, attributes: K } = po(H, M, j || G), n = ao(e), p = n ? b : e, Q = fo(
|
|
45
45
|
(o) => {
|
|
46
|
-
|
|
46
|
+
l && M?.contains(o.target) || a();
|
|
47
47
|
},
|
|
48
|
-
|
|
49
|
-
!!
|
|
48
|
+
co,
|
|
49
|
+
!!p
|
|
50
50
|
// only listen to clicks outside when the dropdown is open
|
|
51
|
-
), W =
|
|
52
|
-
|
|
51
|
+
), W = io(), X = !E && !t && !D;
|
|
52
|
+
so(() => {
|
|
53
53
|
n || m(e);
|
|
54
54
|
}, [n, e]);
|
|
55
55
|
const d = (o) => {
|
|
56
|
-
(n ? b : e) ?
|
|
56
|
+
(n ? b : e) ? a() : Z(o);
|
|
57
57
|
}, Z = (o) => {
|
|
58
58
|
n && m(!0), o && L(o);
|
|
59
|
-
},
|
|
59
|
+
}, a = () => {
|
|
60
60
|
n && m(!1), x();
|
|
61
61
|
}, $ = () => {
|
|
62
|
-
|
|
62
|
+
a(), I();
|
|
63
63
|
}, oo = (o) => {
|
|
64
64
|
d(o);
|
|
65
65
|
}, to = (o) => {
|
|
66
66
|
t ? $() : d(o);
|
|
67
|
-
}, eo = P("dropdown", "btn-group",
|
|
68
|
-
|
|
69
|
-
t &&
|
|
70
|
-
|
|
71
|
-
),
|
|
72
|
-
|
|
67
|
+
}, eo = P("dropdown", "btn-group", p && "open", v), no = P(
|
|
68
|
+
l && "dropdown-portal",
|
|
69
|
+
t && c && "pull-right",
|
|
70
|
+
_
|
|
71
|
+
), N = /* @__PURE__ */ i(
|
|
72
|
+
uo,
|
|
73
73
|
{
|
|
74
74
|
className: no,
|
|
75
75
|
ref: V,
|
|
76
76
|
style: J.popper,
|
|
77
77
|
...K.popper,
|
|
78
|
-
children: O || /* @__PURE__ */
|
|
78
|
+
children: O || /* @__PURE__ */ i(mo, { items: R, closeMenu: d })
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
|
|
81
|
+
return /* @__PURE__ */ h("div", { ...z, className: eo, ref: Q, children: [
|
|
82
|
+
/* @__PURE__ */ h(
|
|
83
|
+
go,
|
|
84
84
|
{
|
|
85
85
|
id: g,
|
|
86
86
|
splitButton: t,
|
|
@@ -89,19 +89,19 @@ const Do = (r, s) => r && s ? "top-end" : !r && s ? "top-start" : r && !s ? "bot
|
|
|
89
89
|
variant: T,
|
|
90
90
|
iconOnly: D,
|
|
91
91
|
disabled: B,
|
|
92
|
-
ref:
|
|
92
|
+
ref: F,
|
|
93
93
|
onClick: to,
|
|
94
94
|
outerRef: s,
|
|
95
|
-
toggleButtonType:
|
|
95
|
+
toggleButtonType: U,
|
|
96
96
|
className: S,
|
|
97
|
-
children:
|
|
97
|
+
children: [
|
|
98
98
|
k,
|
|
99
|
-
X && /* @__PURE__ */
|
|
100
|
-
]
|
|
99
|
+
X && /* @__PURE__ */ i(Co, {})
|
|
100
|
+
]
|
|
101
101
|
}
|
|
102
102
|
),
|
|
103
|
-
t && /* @__PURE__ */
|
|
104
|
-
|
|
103
|
+
t && /* @__PURE__ */ i(
|
|
104
|
+
wo,
|
|
105
105
|
{
|
|
106
106
|
id: g,
|
|
107
107
|
bsStyle: C,
|
|
@@ -112,11 +112,11 @@ const Do = (r, s) => r && s ? "top-end" : !r && s ? "top-start" : r && !s ? "bot
|
|
|
112
112
|
ref: q
|
|
113
113
|
}
|
|
114
114
|
),
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
p && l && lo.createPortal(N, W),
|
|
116
|
+
p && !l && N
|
|
117
117
|
] });
|
|
118
|
-
}),
|
|
118
|
+
}), jo = Do();
|
|
119
119
|
export {
|
|
120
|
-
|
|
120
|
+
jo as default
|
|
121
121
|
};
|
|
122
122
|
//# sourceMappingURL=ButtonDropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonDropdown.js","sources":["../../../src/components/dropdown/ButtonDropdown.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: <explanation>\nimport React, { useState, useEffect, forwardRef, type PropsWithChildren } from 'react';\nimport ReactDOM from 'react-dom';\nimport { usePopper } from 'react-popper';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/function';\nimport { isNil } from 'es-toolkit/predicate';\n\nimport { getOrCreatePortalRoot } from '../../utils/portalRoot';\nimport useClickOutside, { DEFAULT_EVENT_TYPES } from '../../hooks/useClickOutside';\nimport MenuItems from '../menuItems/MenuItems';\nimport MenuItemList from '../menuItems/MenuItemList';\nimport DropdownToggleButton, { type DropdownToggleEvent, type DropdownToggleButtonType } from './DropdownToggleButton';\nimport SplitCaretButton from './SplitCaretButton';\nimport Caret from './Caret';\nimport type { MenuItemProps as MenuItem } from '../menuItems/MenuItem';\nimport type { BUTTON_SIZE, BUTTON_STYLE, BUTTON_VARIANT } from '../button/Button';\n\nconst getPlacement = (pullRight: boolean, dropup: boolean) => {\n if (pullRight && dropup) {\n return 'top-end';\n }\n if (!pullRight && dropup) {\n return 'top-start';\n }\n if (pullRight && !dropup) {\n return 'bottom-end';\n }\n return 'bottom-start';\n};\n\nexport type ButtonDropdownProps<T extends DropdownToggleButtonType = 'button'> = {\n /**\n * Unique button id. If not present a random id is generated.\n */\n id?: string;\n\n /**\n * The button title. This may be also a node, like a <span> or a <FormattedMessage>.\n */\n title: string | React.ReactNode;\n\n /**\n * Defined weather or not the menu is rendered.\n * Use this to control the component from the outside.\n *\n * @default undefined\n */\n open?: boolean;\n\n /**\n * Defines whether the dropdown opens above or below.\n * Set it to \"true\" additionally disables the automatic position feature.\n *\n * @default false\n */\n dropup?: boolean;\n\n /**\n * Defines whether the dropdown opens right aligned to the dropdown or not.\n */\n pullRight?: boolean;\n\n /**\n * Defines how large the button will be rendered.\n *\n * Possible values are: `xs`, `sm`, `md`, `lg`\n */\n bsSize?: BUTTON_SIZE;\n\n /**\n * Defines the button color.\n *\n * Possible values are: `default`, `primary`, `secondary`, `info`, `warning`, `danger`, `success`, `muted`\n */\n bsStyle?: BUTTON_STYLE;\n\n /**\n * Defines the variation of the button design.\n *\n * Possible values are: `link`, `link-inline`, `outline`, `action`\n */\n variant?: BUTTON_VARIANT;\n\n /**\n * Specify the toggle element type.\n * It supports the following types: \"button\" | \"tag\" | \"label\"\n *\n * @default 'button'\n */\n toggleButtonType?: DropdownToggleButtonType;\n\n /**\n * Optional prop to defines whether the dropdown title is icon only which\n * applies different padding so the button is a square.\n *\n * @default false\n */\n iconOnly?: boolean;\n\n /**\n * Defines whether the caret is shown or not.\n *\n * @default false\n */\n noCaret?: boolean;\n\n /**\n * Defines whether the dropdown-toggle (with caret) should be in a separate button.\n *\n * @default false\n */\n splitButton?: boolean;\n\n /**\n * Renders the dropdown into a dedicated react portal\n *\n * @default false\n */\n usePortal?: boolean;\n\n /**\n * Items to display in the dropdown menu. If you use a custom dropdown you can skip this prop.\n */\n items?: MenuItem[];\n\n /**\n * Disables the dropdown button.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback for splitButton label button click.\n */\n onLabelButtonClick?: () => void;\n\n /**\n * Callback for when the toggle button was clicked to open it.\n * @param event\n * @returns\n */\n onOpen?: (event: DropdownToggleEvent<T>) => void;\n\n /**\n * Callback for when the toggle button was clicked to close it.\n * @returns\n */\n onClose?: () => void;\n\n /**\n * Allows to pass in custom dropdown menu content.\n */\n customDropdown?: React.ReactNode;\n\n /**\n * Define custom popper.js configuration for dropdown placement and modifiers.\n */\n popperConfig?: object;\n\n /**\n * Additional classes to be set on the dropdown-toggle button.\n */\n toggleClassName?: string;\n\n /**\n * Additional classes to be set on the dropdown.\n */\n dropdownClassName?: string;\n\n /**\n * Additional classes to be set to the wrapper element.\n */\n className?: string;\n};\n\nconst createButtonDropdown = <T extends DropdownToggleButtonType = 'button'>() => {\n return forwardRef<\n T extends 'button' ? HTMLButtonElement : HTMLDivElement,\n PropsWithChildren<ButtonDropdownProps<T>>\n >((props, ref) => {\n const {\n id = Math.random().toString(36).slice(2, 16),\n items = [],\n bsSize = 'md',\n bsStyle = 'default',\n variant,\n disabled = false,\n iconOnly = false,\n title,\n splitButton = false,\n customDropdown,\n open,\n dropup = false,\n pullRight = false,\n noCaret = false,\n onOpen = noop,\n onClose = noop,\n onLabelButtonClick = noop,\n usePortal = false,\n popperConfig,\n toggleButtonType = 'button',\n toggleClassName = '',\n dropdownClassName,\n className = '',\n ...remainingProps\n } = props;\n\n const [internalOpen, setInternalOpen] = useState(open);\n\n const [refDropdownToggle, setRefDropdownToggle] = useState<HTMLButtonElement | HTMLDivElement | null>(null);\n const [refDropdownMenu, setRefDropdownMenu] = useState<HTMLUListElement | null>(null);\n const [refSplitButtonToggle, setRefSplitButtonToggle] = useState<HTMLButtonElement | null>(null);\n\n const defaultPopperConfig = {\n placement: getPlacement(pullRight, dropup),\n modifiers: [],\n };\n\n const popperParentRef = splitButton && pullRight ? refSplitButtonToggle : refDropdownToggle;\n\n const { styles, attributes } = usePopper(popperParentRef, refDropdownMenu, popperConfig || defaultPopperConfig);\n\n const isUncontrolled = isNil(open);\n const isOpen = isUncontrolled ? internalOpen : open;\n\n const wrapperRef = useClickOutside(\n event => {\n if (usePortal) {\n // In case the dropdown is rendered via portal the clickOutside the toggle button element is\n // triggered since the dropdown is not a child of the wrapper element.\n // In this case we need to check if the event target is inside the dropdown-menu and prevent closing\n // the dropdown\n if (!refDropdownMenu?.contains(event.target as Node)) {\n closeMenu();\n }\n } else {\n closeMenu();\n }\n },\n DEFAULT_EVENT_TYPES,\n Boolean(isOpen) // only listen to clicks outside when the dropdown is open\n );\n\n const dropdownRoot = getOrCreatePortalRoot();\n\n const shouldShowCaret = !noCaret && !splitButton && !iconOnly;\n\n useEffect(() => {\n if (!isUncontrolled) {\n setInternalOpen(open);\n }\n }, [isUncontrolled, open]);\n\n const toggleOpen = (event?: DropdownToggleEvent<T>) => {\n const isDropdownOpen = isUncontrolled ? internalOpen : open;\n\n if (isDropdownOpen) {\n closeMenu();\n } else {\n openMenu(event);\n }\n };\n\n const openMenu = (event?: DropdownToggleEvent<T>) => {\n if (isUncontrolled) {\n setInternalOpen(true);\n }\n if (event) {\n onOpen(event);\n }\n };\n\n const closeMenu = () => {\n if (isUncontrolled) {\n setInternalOpen(false);\n }\n onClose();\n };\n\n const handleSplitLabelButtonClick = () => {\n closeMenu();\n onLabelButtonClick();\n };\n\n const handleSplitCaretButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n toggleOpen(event as any);\n };\n\n const handleDropdownButtonClick = (event: React.MouseEvent<HTMLButtonElement | HTMLDivElement>) => {\n if (splitButton) {\n handleSplitLabelButtonClick();\n } else {\n toggleOpen(event as DropdownToggleEvent<T>);\n }\n };\n\n const wrapperClasses = classNames('dropdown', 'btn-group', isOpen && 'open', className);\n\n const dropdownClasses = classNames(\n usePortal && 'dropdown-portal',\n splitButton && pullRight && 'pull-right',\n dropdownClassName\n );\n\n const dropdownMenu = (\n <MenuItemList\n className={dropdownClasses}\n ref={setRefDropdownMenu}\n style={styles.popper}\n {...attributes.popper}\n >\n {customDropdown ? customDropdown : <MenuItems items={items} closeMenu={toggleOpen} />}\n </MenuItemList>\n );\n\n return (\n <div {...remainingProps} className={wrapperClasses} ref={wrapperRef}>\n <DropdownToggleButton\n id={id}\n splitButton={splitButton}\n bsStyle={bsStyle}\n bsSize={bsSize}\n variant={variant}\n iconOnly={iconOnly}\n disabled={disabled}\n ref={setRefDropdownToggle}\n onClick={handleDropdownButtonClick}\n outerRef={ref}\n toggleButtonType={toggleButtonType}\n className={toggleClassName}\n >\n <>\n {title}\n {shouldShowCaret && <Caret />}\n </>\n </DropdownToggleButton>\n {splitButton && (\n <SplitCaretButton\n id={id}\n bsStyle={bsStyle}\n bsSize={bsSize}\n disabled={disabled}\n className={toggleClassName}\n onClick={handleSplitCaretButtonClick}\n ref={setRefSplitButtonToggle}\n />\n )}\n {isOpen && usePortal && ReactDOM.createPortal(dropdownMenu, dropdownRoot)}\n {isOpen && !usePortal && dropdownMenu}\n </div>\n );\n });\n};\n\nconst ButtonDropdown = createButtonDropdown();\n\nexport default ButtonDropdown;\n"],"names":["getPlacement","pullRight","dropup","createButtonDropdown","forwardRef","props","ref","id","items","bsSize","bsStyle","variant","disabled","iconOnly","title","splitButton","customDropdown","open","noCaret","onOpen","noop","onClose","onLabelButtonClick","usePortal","popperConfig","toggleButtonType","toggleClassName","dropdownClassName","className","remainingProps","internalOpen","setInternalOpen","useState","refDropdownToggle","setRefDropdownToggle","refDropdownMenu","setRefDropdownMenu","refSplitButtonToggle","setRefSplitButtonToggle","defaultPopperConfig","popperParentRef","styles","attributes","usePopper","isUncontrolled","isNil","isOpen","wrapperRef","useClickOutside","event","closeMenu","DEFAULT_EVENT_TYPES","dropdownRoot","getOrCreatePortalRoot","shouldShowCaret","useEffect","toggleOpen","openMenu","handleSplitLabelButtonClick","handleSplitCaretButtonClick","handleDropdownButtonClick","wrapperClasses","classNames","dropdownClasses","dropdownMenu","jsx","MenuItemList","MenuItems","DropdownToggleButton","jsxs","Fragment","Caret","SplitCaretButton","ReactDOM","ButtonDropdown"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAMA,KAAe,CAACC,GAAoBC,MAClCD,KAAaC,IACN,YAEP,CAACD,KAAaC,IACP,cAEPD,KAAa,CAACC,IACP,eAEJ,gBAqJLC,KAAuB,MAClBC,GAGL,CAACC,GAAOC,MAAQ;AACd,QAAM;AAAA,IACF,IAAAC,IAAK,KAAK,SAAS,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE;AAAA,IAC3C,OAAAC,IAAQ,CAAA;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,SAAAC,IAAU;AAAA,IACV,SAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,gBAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAf,IAAS;AAAA,IACT,WAAAD,IAAY;AAAA,IACZ,SAAAiB,IAAU;AAAA,IACV,QAAAC,IAASC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AEHxD,KACG,gBAAAkD;AAAA,MAACO;AAAA,MAAA;AAAA,QACG,IAAAjE;AAAA,QACA,SAAAG;AAAA,QACA,QAAAD;AAAA,QACA,UAAAG;AAAA,QACA,WAAWc;AAAA,QACX,SAASiC;AAAA,QACT,KAAKrB;AAAA,MAAA;AAAA,IAAA;AAAA,IAGZQ,KAAUvB,KAAakD,GAAS,aAAaT,GAAcZ,CAAY;AAAA,IACvEN,KAAU,CAACvB,KAAayC;AAAA,EAAA,GAC7B;AAER,CAAC,GAGCU,KAAiBvE,GAAA;"}
|
|
1
|
+
{"version":3,"file":"ButtonDropdown.js","sources":["../../../src/components/dropdown/ButtonDropdown.tsx"],"sourcesContent":["import React, { useState, useEffect, forwardRef, type PropsWithChildren } from 'react';\nimport ReactDOM from 'react-dom';\nimport { usePopper } from 'react-popper';\nimport { noop } from 'es-toolkit/function';\nimport { isNil } from 'es-toolkit/predicate';\n\nimport classNames from '../../utils/classNames';\nimport { getOrCreatePortalRoot } from '../../utils/portalRoot';\nimport useClickOutside, { DEFAULT_EVENT_TYPES } from '../../hooks/useClickOutside';\nimport MenuItems from '../menuItems/MenuItems';\nimport MenuItemList from '../menuItems/MenuItemList';\nimport DropdownToggleButton, { type DropdownToggleEvent, type DropdownToggleButtonType } from './DropdownToggleButton';\nimport SplitCaretButton from './SplitCaretButton';\nimport Caret from './Caret';\nimport type { MenuItemProps as MenuItem } from '../menuItems/MenuItem';\nimport type { BUTTON_SIZE, BUTTON_STYLE, BUTTON_VARIANT } from '../button/Button';\n\nconst getPlacement = (pullRight: boolean, dropup: boolean) => {\n if (pullRight && dropup) {\n return 'top-end';\n }\n if (!pullRight && dropup) {\n return 'top-start';\n }\n if (pullRight && !dropup) {\n return 'bottom-end';\n }\n return 'bottom-start';\n};\n\nexport type ButtonDropdownProps<T extends DropdownToggleButtonType = 'button'> = {\n /**\n * Unique button id. If not present a random id is generated.\n */\n id?: string;\n\n /**\n * The button title. This may be also a node, like a <span> or a <FormattedMessage>.\n */\n title: string | React.ReactNode;\n\n /**\n * Defined weather or not the menu is rendered.\n * Use this to control the component from the outside.\n *\n * @default undefined\n */\n open?: boolean;\n\n /**\n * Defines whether the dropdown opens above or below.\n * Set it to \"true\" additionally disables the automatic position feature.\n *\n * @default false\n */\n dropup?: boolean;\n\n /**\n * Defines whether the dropdown opens right aligned to the dropdown or not.\n */\n pullRight?: boolean;\n\n /**\n * Defines how large the button will be rendered.\n *\n * Possible values are: `xs`, `sm`, `md`, `lg`\n *\n * @default 'md'\n */\n bsSize?: BUTTON_SIZE;\n\n /**\n * Defines the button color.\n *\n * Possible values are: `default`, `primary`, `secondary`, `info`, `warning`, `danger`, `success`, `muted`\n *\n * @default 'default'\n */\n bsStyle?: BUTTON_STYLE;\n\n /**\n * Defines the variation of the button design.\n *\n * Possible values are: `link`, `link-inline`, `outline`, `action`\n */\n variant?: BUTTON_VARIANT;\n\n /**\n * Specify the toggle element type.\n * It supports the following types: \"button\" | \"tag\" | \"label\"\n *\n * @default 'button'\n */\n toggleButtonType?: DropdownToggleButtonType;\n\n /**\n * Optional prop to defines whether the dropdown title is icon only which\n * applies different padding so the button is a square.\n *\n * @default false\n */\n iconOnly?: boolean;\n\n /**\n * Defines whether the caret is shown or not.\n *\n * @default false\n */\n noCaret?: boolean;\n\n /**\n * Defines whether the dropdown-toggle (with caret) should be in a separate button.\n *\n * @default false\n */\n splitButton?: boolean;\n\n /**\n * Renders the dropdown into a dedicated react portal\n *\n * @default false\n */\n usePortal?: boolean;\n\n /**\n * Items to display in the dropdown menu. If you use a custom dropdown you can skip this prop.\n */\n items?: MenuItem[];\n\n /**\n * Disables the dropdown button.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback for splitButton label button click.\n */\n onLabelButtonClick?: () => void;\n\n /**\n * Callback for when the toggle button was clicked to open it.\n * @param event\n * @returns\n */\n onOpen?: (event: DropdownToggleEvent<T>) => void;\n\n /**\n * Callback for when the toggle button was clicked to close it.\n * @returns\n */\n onClose?: () => void;\n\n /**\n * Allows to pass in custom dropdown menu content.\n */\n customDropdown?: React.ReactNode;\n\n /**\n * Define custom popper.js configuration for dropdown placement and modifiers.\n */\n popperConfig?: object;\n\n /**\n * Additional classes to be set on the dropdown-toggle button.\n */\n toggleClassName?: string;\n\n /**\n * Additional classes to be set on the dropdown.\n */\n dropdownClassName?: string;\n\n /**\n * Additional classes to be set to the wrapper element.\n */\n className?: string;\n};\n\nconst createButtonDropdown = <T extends DropdownToggleButtonType = 'button'>() => {\n return forwardRef<\n T extends 'button' ? HTMLButtonElement : HTMLDivElement,\n PropsWithChildren<ButtonDropdownProps<T>>\n >((props, ref) => {\n const {\n id = Math.random().toString(36).slice(2, 16),\n items = [],\n bsSize = 'md',\n bsStyle = 'default',\n variant,\n disabled = false,\n iconOnly = false,\n title,\n splitButton = false,\n customDropdown,\n open,\n dropup = false,\n pullRight = false,\n noCaret = false,\n onOpen = noop,\n onClose = noop,\n onLabelButtonClick = noop,\n usePortal = false,\n popperConfig,\n toggleButtonType = 'button',\n toggleClassName = '',\n dropdownClassName,\n className = '',\n ...remainingProps\n } = props;\n\n const [internalOpen, setInternalOpen] = useState(open);\n\n const [refDropdownToggle, setRefDropdownToggle] = useState<HTMLButtonElement | HTMLDivElement | null>(null);\n const [refDropdownMenu, setRefDropdownMenu] = useState<HTMLUListElement | null>(null);\n const [refSplitButtonToggle, setRefSplitButtonToggle] = useState<HTMLButtonElement | null>(null);\n\n const defaultPopperConfig = {\n placement: getPlacement(pullRight, dropup),\n modifiers: [],\n };\n\n const popperParentRef = splitButton && pullRight ? refSplitButtonToggle : refDropdownToggle;\n\n const { styles, attributes } = usePopper(popperParentRef, refDropdownMenu, popperConfig || defaultPopperConfig);\n\n const isUncontrolled = isNil(open);\n const isOpen = isUncontrolled ? internalOpen : open;\n\n const wrapperRef = useClickOutside(\n event => {\n if (usePortal) {\n // In case the dropdown is rendered via portal the clickOutside the toggle button element is\n // triggered since the dropdown is not a child of the wrapper element.\n // In this case we need to check if the event target is inside the dropdown-menu and prevent closing\n // the dropdown\n if (!refDropdownMenu?.contains(event.target as Node)) {\n closeMenu();\n }\n } else {\n closeMenu();\n }\n },\n DEFAULT_EVENT_TYPES,\n Boolean(isOpen) // only listen to clicks outside when the dropdown is open\n );\n\n const dropdownRoot = getOrCreatePortalRoot();\n\n const shouldShowCaret = !noCaret && !splitButton && !iconOnly;\n\n useEffect(() => {\n if (!isUncontrolled) {\n setInternalOpen(open);\n }\n }, [isUncontrolled, open]);\n\n const toggleOpen = (event?: DropdownToggleEvent<T>) => {\n const isDropdownOpen = isUncontrolled ? internalOpen : open;\n\n if (isDropdownOpen) {\n closeMenu();\n } else {\n openMenu(event);\n }\n };\n\n const openMenu = (event?: DropdownToggleEvent<T>) => {\n if (isUncontrolled) {\n setInternalOpen(true);\n }\n if (event) {\n onOpen(event);\n }\n };\n\n const closeMenu = () => {\n if (isUncontrolled) {\n setInternalOpen(false);\n }\n onClose();\n };\n\n const handleSplitLabelButtonClick = () => {\n closeMenu();\n onLabelButtonClick();\n };\n\n const handleSplitCaretButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n toggleOpen(event as any);\n };\n\n const handleDropdownButtonClick = (event: React.MouseEvent<HTMLButtonElement | HTMLDivElement>) => {\n if (splitButton) {\n handleSplitLabelButtonClick();\n } else {\n toggleOpen(event as DropdownToggleEvent<T>);\n }\n };\n\n const wrapperClasses = classNames('dropdown', 'btn-group', isOpen && 'open', className);\n\n const dropdownClasses = classNames(\n usePortal && 'dropdown-portal',\n splitButton && pullRight && 'pull-right',\n dropdownClassName\n );\n\n const dropdownMenu = (\n <MenuItemList\n className={dropdownClasses}\n ref={setRefDropdownMenu}\n style={styles.popper}\n {...attributes.popper}\n >\n {customDropdown ? customDropdown : <MenuItems items={items} closeMenu={toggleOpen} />}\n </MenuItemList>\n );\n\n return (\n <div {...remainingProps} className={wrapperClasses} ref={wrapperRef}>\n <DropdownToggleButton\n id={id}\n splitButton={splitButton}\n bsStyle={bsStyle}\n bsSize={bsSize}\n variant={variant}\n iconOnly={iconOnly}\n disabled={disabled}\n ref={setRefDropdownToggle}\n onClick={handleDropdownButtonClick}\n outerRef={ref}\n toggleButtonType={toggleButtonType}\n className={toggleClassName}\n >\n {title}\n {shouldShowCaret && <Caret />}\n </DropdownToggleButton>\n {splitButton && (\n <SplitCaretButton\n id={id}\n bsStyle={bsStyle}\n bsSize={bsSize}\n disabled={disabled}\n className={toggleClassName}\n onClick={handleSplitCaretButtonClick}\n ref={setRefSplitButtonToggle}\n />\n )}\n {isOpen && usePortal && ReactDOM.createPortal(dropdownMenu, dropdownRoot)}\n {isOpen && !usePortal && dropdownMenu}\n </div>\n );\n });\n};\n\nconst ButtonDropdown = createButtonDropdown();\n\nexport default ButtonDropdown;\n"],"names":["getPlacement","pullRight","dropup","createButtonDropdown","forwardRef","props","ref","id","items","bsSize","bsStyle","variant","disabled","iconOnly","title","splitButton","customDropdown","open","noCaret","onOpen","noop","onClose","onLabelButtonClick","usePortal","popperConfig","toggleButtonType","toggleClassName","dropdownClassName","className","remainingProps","internalOpen","setInternalOpen","useState","refDropdownToggle","setRefDropdownToggle","refDropdownMenu","setRefDropdownMenu","refSplitButtonToggle","setRefSplitButtonToggle","defaultPopperConfig","popperParentRef","styles","attributes","usePopper","isUncontrolled","isNil","isOpen","wrapperRef","useClickOutside","event","closeMenu","DEFAULT_EVENT_TYPES","dropdownRoot","getOrCreatePortalRoot","shouldShowCaret","useEffect","toggleOpen","openMenu","handleSplitLabelButtonClick","handleSplitCaretButtonClick","handleDropdownButtonClick","wrapperClasses","classNames","dropdownClasses","dropdownMenu","jsx","MenuItemList","MenuItems","jsxs","DropdownToggleButton","Caret","SplitCaretButton","ReactDOM","ButtonDropdown"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAMA,KAAe,CAACC,GAAoBC,MAClCD,KAAaC,IACN,YAEP,CAACD,KAAaC,IACP,cAEPD,KAAa,CAACC,IACP,eAEJ,gBAyJLC,KAAuB,MAClBC,GAGL,CAACC,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BAAAqB;AAAA,MAACC;AAAA,MAAA;AAAA,QACG,IAAA9D;AAAA,QACA,aAAAQ;AAAA,QACA,SAAAL;AAAA,QACA,QAAAD;AAAA,QACA,SAAAE;AAAA,QACA,UAAAE;AAAA,QACA,UAAAD;AAAA,QACA,KAAKsB;AAAA,QACL,SAAS0B;AAAA,QACT,UAAUtD;AAAA,QACV,kBAAAmB;AAAA,QACA,WAAWC;AAAA,QAEV,UAAA;AAAA,UAAAZ;AAAA,UACAwC,uBAAoBgB,IAAA,CAAA,CAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAE9BvD,KACG,gBAAAkD;AAAA,MAACM;AAAA,MAAA;AAAA,QACG,IAAAhE;AAAA,QACA,SAAAG;AAAA,QACA,QAAAD;AAAA,QACA,UAAAG;AAAA,QACA,WAAWc;AAAA,QACX,SAASiC;AAAA,QACT,KAAKrB;AAAA,MAAA;AAAA,IAAA;AAAA,IAGZQ,KAAUvB,KAAaiD,GAAS,aAAaR,GAAcZ,CAAY;AAAA,IACvEN,KAAU,CAACvB,KAAayC;AAAA,EAAA,GAC7B;AAER,CAAC,GAGCS,KAAiBtE,GAAA;"}
|
|
@@ -3,6 +3,8 @@ import { MenuItemProps as MenuItem } from '../menuItems/MenuItem';
|
|
|
3
3
|
export type DropdownSubmenuProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Displayed button title.
|
|
6
|
+
*
|
|
7
|
+
* @default ''
|
|
6
8
|
*/
|
|
7
9
|
title?: string | React.ReactNode;
|
|
8
10
|
/**
|
|
@@ -11,6 +13,8 @@ export type DropdownSubmenuProps = {
|
|
|
11
13
|
items?: MenuItem[];
|
|
12
14
|
/**
|
|
13
15
|
* Disables every entry on the title list item.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
14
18
|
*/
|
|
15
19
|
disabled?: boolean;
|
|
16
20
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as s } from "react";
|
|
3
|
-
import g from "
|
|
4
|
-
import
|
|
3
|
+
import { usePopper as g } from "react-popper";
|
|
4
|
+
import v from "../../utils/classNames.js";
|
|
5
5
|
import w from "../menuItems/MenuItems.js";
|
|
6
6
|
import x from "../menuItems/MenuItemList.js";
|
|
7
7
|
const E = (n) => {
|
|
8
|
-
const { title: a = "", items: l = [], disabled: t = !1, className: m, ...i } = n, p =
|
|
8
|
+
const { title: a = "", items: l = [], disabled: t = !1, className: m, ...i } = n, p = v("dropdown-submenu", t && "disabled", m), [u, c] = s(null), [f, d] = s(null), [h, o] = s(!1), b = () => o(!0), M = () => o(!1), { styles: N, attributes: P } = g(u, f, {
|
|
9
9
|
placement: "right-start",
|
|
10
10
|
modifiers: [
|
|
11
11
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownSubmenu.js","sources":["../../../src/components/dropdown/DropdownSubmenu.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState } from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"DropdownSubmenu.js","sources":["../../../src/components/dropdown/DropdownSubmenu.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState } from 'react';\nimport { usePopper } from 'react-popper';\n\nimport classNames from '../../utils/classNames';\nimport MenuItems from '../menuItems/MenuItems';\nimport MenuItemList from '../menuItems/MenuItemList';\nimport type { MenuItemProps as MenuItem } from '../menuItems/MenuItem';\n\nexport type DropdownSubmenuProps = {\n /**\n * Displayed button title.\n *\n * @default ''\n */\n title?: string | React.ReactNode;\n\n /**\n * Items to display in the dropdown sub menu.\n */\n items?: MenuItem[];\n\n /**\n * Disables every entry on the title list item.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the dropdown-submenu element.\n */\n className?: string;\n};\n\nconst DropdownSubmenu = (props: DropdownSubmenuProps) => {\n const { title = '', items = [], disabled = false, className, ...remainingProps } = props;\n\n const classes = classNames('dropdown-submenu', disabled && 'disabled', className);\n\n const [refParentPopper, setRefParentPopper] = useState<HTMLLIElement | null>(null);\n const [refDropdownSubmenu, setRefDropdownSubmenu] = useState<HTMLUListElement | null>(null);\n\n // We have to use the workaround of checking the hover state as popper may render\n // the sub menu on an odd place and fixes it's position on the next render cycle\n const [isHover, setIsHover] = useState(false);\n const handleMouseEnter = () => setIsHover(true);\n const handleMouseLeave = () => setIsHover(false);\n\n const { styles, attributes } = usePopper(refParentPopper, refDropdownSubmenu, {\n placement: 'right-start',\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [-4, 0],\n },\n },\n ],\n });\n\n // return a list item that is also automatically the new toggle for the submenu\n return (\n <li\n ref={setRefParentPopper}\n {...remainingProps}\n className={classes}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {/* biome-ignore lint/a11y/useValidAnchor: <explanation> */}\n <a className='submenu-title' role='menuitem'>\n <span className='submenu-title-text'>{title}</span>\n <span className='rioglyph rioglyph-chevron-right' />\n </a>\n {/* The actual submenu items */}\n {isHover && !disabled && (\n <MenuItemList ref={setRefDropdownSubmenu} style={styles.popper} {...attributes.popper}>\n <MenuItems items={items} />\n </MenuItemList>\n )}\n </li>\n );\n};\n\nexport default DropdownSubmenu;\n"],"names":["DropdownSubmenu","props","title","items","disabled","className","remainingProps","classes","classNames","refParentPopper","setRefParentPopper","useState","refDropdownSubmenu","setRefDropdownSubmenu","isHover","setIsHover","handleMouseEnter","handleMouseLeave","styles","attributes","usePopper","jsxs","jsx","MenuItemList","MenuItems"],"mappings":";;;;;;AAmCA,MAAMA,IAAkB,CAACC,MAAgC;AACrD,QAAM,EAAE,OAAAC,IAAQ,IAAI,OAAAC,IAAQ,CAAA,GAAI,UAAAC,IAAW,IAAO,WAAAC,GAAW,GAAGC,EAAA,IAAmBL,GAE7EM,IAAUC,EAAW,oBAAoBJ,KAAY,YAAYC,CAAS,GAE1E,CAACI,GAAiBC,CAAkB,IAAIC,EAA+B,IAAI,GAC3E,CAACC,GAAoBC,CAAqB,IAAIF,EAAkC,IAAI,GAIpF,CAACG,GAASC,CAAU,IAAIJ,EAAS,EAAK,GACtCK,IAAmB,MAAMD,EAAW,EAAI,GACxCE,IAAmB,MAAMF,EAAW,EAAK,GAEzC,EAAE,QAAAG,GAAQ,YAAAC,EAAA,IAAeC,EAAUX,GAAiBG,GAAoB;AAAA,IAC1E,WAAW;AAAA,IACX,WAAW;AAAA,MACP;AAAA,QACI,MAAM;AAAA,QACN,SAAS;AAAA,UACL,QAAQ,CAAC,IAAI,CAAC;AAAA,QAAA;AAAA,MAClB;AAAA,IACJ;AAAA,EACJ,CACH;AAGD,SACI,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAKX;AAAA,MACJ,GAAGJ;AAAA,MACJ,WAAWC;AAAA,MACX,cAAcS;AAAA,MACd,cAAcC;AAAA,MAGd,UAAA;AAAA,QAAA,gBAAAI,EAAC,KAAA,EAAE,WAAU,iBAAgB,MAAK,YAC9B,UAAA;AAAA,UAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,sBAAsB,UAAApB,GAAM;AAAA,UAC5C,gBAAAoB,EAAC,QAAA,EAAK,WAAU,kCAAA,CAAkC;AAAA,QAAA,GACtD;AAAA,QAECR,KAAW,CAACV,KACT,gBAAAkB,EAACC,GAAA,EAAa,KAAKV,GAAuB,OAAOK,EAAO,QAAS,GAAGC,EAAW,QAC3E,UAAA,gBAAAG,EAACE,GAAA,EAAU,OAAArB,GAAc,EAAA,CAC7B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIhB;"}
|
|
@@ -15,5 +15,5 @@ export type DropdownToggleButtonProps = HTMLProps<HTMLButtonElement> & {
|
|
|
15
15
|
outerRef?: React.Ref<HTMLButtonElement | HTMLDivElement>;
|
|
16
16
|
className?: string;
|
|
17
17
|
};
|
|
18
|
-
declare const DropdownToggleButton: import('react').ForwardRefExoticComponent<Omit<PropsWithChildren<DropdownToggleButtonProps>, "ref"> & import('react').RefAttributes<
|
|
18
|
+
declare const DropdownToggleButton: import('react').ForwardRefExoticComponent<Omit<PropsWithChildren<DropdownToggleButtonProps>, "ref"> & import('react').RefAttributes<HTMLDivElement | HTMLButtonElement>>;
|
|
19
19
|
export default DropdownToggleButton;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as x } from "react";
|
|
3
|
-
import c from "classnames";
|
|
4
3
|
import B from "../button/Button.js";
|
|
5
4
|
import C from "../../hooks/useMergeRefs.js";
|
|
6
|
-
|
|
5
|
+
import c from "../../utils/classNames.js";
|
|
6
|
+
const j = x((f, u) => {
|
|
7
7
|
const {
|
|
8
8
|
id: e,
|
|
9
9
|
disabled: t,
|
|
@@ -14,6 +14,7 @@ const $ = x((f, u) => {
|
|
|
14
14
|
onClick: s,
|
|
15
15
|
toggleButtonType: p = "button",
|
|
16
16
|
className: n = "",
|
|
17
|
+
as: R,
|
|
17
18
|
children: r,
|
|
18
19
|
outerRef: b,
|
|
19
20
|
iconOnly: y,
|
|
@@ -75,6 +76,6 @@ const $ = x((f, u) => {
|
|
|
75
76
|
);
|
|
76
77
|
});
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
j as default
|
|
79
80
|
};
|
|
80
81
|
//# sourceMappingURL=DropdownToggleButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownToggleButton.js","sources":["../../../src/components/dropdown/DropdownToggleButton.tsx"],"sourcesContent":["import { forwardRef, type HTMLProps, type PropsWithChildren } from 'react';\
|
|
1
|
+
{"version":3,"file":"DropdownToggleButton.js","sources":["../../../src/components/dropdown/DropdownToggleButton.tsx"],"sourcesContent":["import { forwardRef, type HTMLProps, type PropsWithChildren } from 'react';\n\nimport Button, { type BUTTON_VARIANT, type BUTTON_SIZE, type BUTTON_STYLE } from '../button/Button';\nimport useMergeRefs from '../../hooks/useMergeRefs';\nimport classNames from '../../utils/classNames';\n\nexport type DropdownToggleButtonType = 'button' | 'tag' | 'label';\n\nexport type DropdownToggleEvent<T extends DropdownToggleButtonType = 'button'> = T extends 'button'\n ? React.MouseEvent<HTMLButtonElement>\n : React.MouseEvent<HTMLDivElement>;\n\nexport type DropdownToggleButtonProps = HTMLProps<HTMLButtonElement> & {\n id?: string;\n disabled?: boolean;\n splitButton?: boolean;\n iconOnly?: boolean;\n onClick: (event: React.MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;\n bsSize: BUTTON_SIZE;\n bsStyle: BUTTON_STYLE;\n variant?: BUTTON_VARIANT;\n toggleButtonType?: DropdownToggleButtonType;\n outerRef?: React.Ref<HTMLButtonElement | HTMLDivElement>;\n className?: string;\n};\n\nconst DropdownToggleButton = forwardRef<\n HTMLButtonElement | HTMLDivElement,\n PropsWithChildren<DropdownToggleButtonProps>\n>((props, ref) => {\n const {\n id,\n disabled,\n bsSize,\n bsStyle,\n variant,\n splitButton = false,\n onClick,\n toggleButtonType = 'button',\n className = '',\n as: _as,\n children,\n outerRef,\n iconOnly,\n ...remainingProps\n } = props;\n\n const toggleRef = useMergeRefs(outerRef, ref);\n\n const buttonClasses = classNames(!splitButton && 'dropdown-toggle', !splitButton && className);\n\n const labelClasses = classNames(\n 'dropdown-toggle',\n 'label',\n `label-${bsStyle}`,\n 'display-flex align-items-center',\n 'user-select-none cursor-pointer',\n disabled && 'pointer-events-none',\n className\n );\n const tagClasses = classNames(\n 'dropdown-toggle',\n 'tag',\n 'clickable height-auto',\n bsSize === 'sm' && 'tag-small',\n 'display-flex align-items-center',\n 'user-select-none cursor-pointer',\n disabled && 'pointer-events-none',\n className\n );\n\n if (toggleButtonType === 'tag') {\n return (\n <div\n {...(remainingProps as typeof HTMLDivElement)}\n id={id}\n ref={toggleRef}\n onClick={onClick}\n className={tagClasses}\n >\n {children}\n </div>\n );\n }\n\n if (toggleButtonType === 'label') {\n return (\n <div\n {...(remainingProps as typeof HTMLDivElement)}\n id={id}\n ref={toggleRef}\n onClick={onClick}\n className={labelClasses}\n >\n {children}\n </div>\n );\n }\n\n return (\n <Button\n {...remainingProps}\n id={splitButton ? `button-${id}` : id}\n type='button'\n ref={toggleRef}\n disabled={disabled}\n bsStyle={bsStyle}\n bsSize={bsSize}\n variant={variant}\n onClick={onClick}\n iconOnly={iconOnly}\n className={buttonClasses}\n >\n {children}\n </Button>\n );\n});\n\nexport default DropdownToggleButton;\n"],"names":["DropdownToggleButton","forwardRef","props","ref","id","disabled","bsSize","bsStyle","variant","splitButton","onClick","toggleButtonType","className","_as","children","outerRef","iconOnly","remainingProps","toggleRef","useMergeRefs","buttonClasses","classNames","labelClasses","tagClasses","jsx","Button"],"mappings":";;;;;AA0BA,MAAMA,IAAuBC,EAG3B,CAACC,GAAOC,MAAQ;AACd,QAAM;AAAA,IACF,IAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,SAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,WAAAC,IAAY;AAAA,IACZ,IAAIC;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHf,GAEEgB,IAAYC,EAAaJ,GAAUZ,CAAG,GAEtCiB,IAAgBC,EAAW,CAACZ,KAAe,mBAAmB,CAACA,KAAeG,CAAS,GAEvFU,IAAeD;AAAA,IACjB;AAAA,IACA;AAAA,IACA,SAASd,CAAO;AAAA,IAChB;AAAA,IACA;AAAA,IACAF,KAAY;AAAA,IACZO;AAAA,EAAA,GAEEW,IAAaF;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACAf,MAAW,QAAQ;AAAA,IACnB;AAAA,IACA;AAAA,IACAD,KAAY;AAAA,IACZO;AAAA,EAAA;AAGJ,SAAID,MAAqB,QAEjB,gBAAAa;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAIP;AAAA,MACL,IAAAb;AAAA,MACA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