@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":"MultiselectToggleSelection.js","sources":["../../../src/components/selects/MultiselectToggleSelection.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"MultiselectToggleSelection.js","sources":["../../../src/components/selects/MultiselectToggleSelection.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\n\nimport classNames from '../../utils/classNames';\nimport type { SelectOption } from './BaseSelectDropdown';\n\nexport type MultiselectToggleSelectionProps = {\n options: SelectOption[];\n selectedItemIds: string[];\n showSelectedItemIcon: boolean;\n showUnselectedItemIcons: boolean;\n multiline: boolean;\n hasInputAddon: boolean;\n hasFilter: boolean;\n onRemoveItem: (event: React.MouseEvent<HTMLSpanElement>, itemId: string) => void;\n};\n\nconst MultiselectToggleSelection = (props: PropsWithChildren<MultiselectToggleSelectionProps>) => {\n const {\n options,\n selectedItemIds,\n showSelectedItemIcon,\n showUnselectedItemIcons,\n multiline,\n hasInputAddon,\n hasFilter,\n onRemoveItem,\n children,\n } = props;\n\n if (!options || isEmpty(options)) {\n return null;\n }\n\n const isItemSelected = (item: SelectOption) => {\n return selectedItemIds.indexOf(item.id) !== -1;\n };\n\n const renderSelectionItem = (item: SelectOption, index: number) => {\n if (showSelectedItemIcon) {\n const inactiveClassNames = classNames('margin-right-5', !isItemSelected(item) && 'inactiveIcon');\n\n return (\n <span key={item.id} className={inactiveClassNames}>\n {item.icon}\n </span>\n );\n }\n\n return (\n <span key={index} className='selected-option'>\n <span className='selected-label'>\n {item.icon && <span className='margin-right-5'>{item.icon}</span>}\n {item.label}\n </span>\n <span\n className='removeIcon'\n onClick={event => {\n onRemoveItem(event, item.id);\n }}\n >\n <span className='rioglyph rioglyph-remove' />\n </span>\n </span>\n );\n };\n\n const optionListClassNames = classNames(\n !showSelectedItemIcon && !showUnselectedItemIcons && 'selected-option-list',\n multiline && 'flex-wrap',\n hasInputAddon && 'margin-left-0',\n hasFilter && 'padding-left-1'\n );\n\n return (\n <span className={optionListClassNames}>\n {options\n .filter(option => (showUnselectedItemIcons ? !option.header : isItemSelected(option)))\n .map((option, index) => renderSelectionItem(option, index))}\n {children}\n </span>\n );\n};\n\nexport default MultiselectToggleSelection;\n"],"names":["MultiselectToggleSelection","props","options","selectedItemIds","showSelectedItemIcon","showUnselectedItemIcons","multiline","hasInputAddon","hasFilter","onRemoveItem","children","isEmpty","isItemSelected","item","renderSelectionItem","index","inactiveClassNames","classNames","jsxs","jsx","event","optionListClassNames","option"],"mappings":";;;AAkBA,MAAMA,IAA6B,CAACC,MAA8D;AAC9F,QAAM;AAAA,IACF,SAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,IACAT;AAEJ,MAAI,CAACC,KAAWS,EAAQT,CAAO;AAC3B,WAAO;AAGX,QAAMU,IAAiB,CAACC,MACbV,EAAgB,QAAQU,EAAK,EAAE,MAAM,IAG1CC,IAAsB,CAACD,GAAoBE,MAAkB;AAC/D,QAAIX,GAAsB;AACtB,YAAMY,IAAqBC,EAAW,kBAAkB,CAACL,EAAeC,CAAI,KAAK,cAAc;AAE/F,+BACK,QAAA,EAAmB,WAAWG,GAC1B,UAAAH,EAAK,KAAA,GADCA,EAAK,EAEhB;AAAA,IAER;AAEA,WACI,gBAAAK,EAAC,QAAA,EAAiB,WAAU,mBACxB,UAAA;AAAA,MAAA,gBAAAA,EAAC,QAAA,EAAK,WAAU,kBACX,UAAA;AAAA,QAAAL,EAAK,QAAQ,gBAAAM,EAAC,QAAA,EAAK,WAAU,kBAAkB,YAAK,MAAK;AAAA,QACzDN,EAAK;AAAA,MAAA,GACV;AAAA,MACA,gBAAAM;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,WAAU;AAAA,UACV,SAAS,CAAAC,MAAS;AACd,YAAAX,EAAaW,GAAOP,EAAK,EAAE;AAAA,UAC/B;AAAA,UAEA,UAAA,gBAAAM,EAAC,QAAA,EAAK,WAAU,2BAAA,CAA2B;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/C,EAAA,GAZOJ,CAaX;AAAA,EAER,GAEMM,IAAuBJ;AAAA,IACzB,CAACb,KAAwB,CAACC,KAA2B;AAAA,IACrDC,KAAa;AAAA,IACbC,KAAiB;AAAA,IACjBC,KAAa;AAAA,EAAA;AAGjB,SACI,gBAAAU,EAAC,QAAA,EAAK,WAAWG,GACZ,UAAA;AAAA,IAAAnB,EACI,OAAO,CAAAoB,MAAWjB,IAA0B,CAACiB,EAAO,SAASV,EAAeU,CAAM,CAAE,EACpF,IAAI,CAACA,GAAQP,MAAUD,EAAoBQ,GAAQP,CAAK,CAAC;AAAA,IAC7DL;AAAA,EAAA,GACL;AAER;"}
|
|
@@ -2,6 +2,10 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { SelectOption } from './BaseSelectDropdown';
|
|
3
3
|
import { WithFeedbackAndAddonProps } from './WithFeedbackAndAddon';
|
|
4
4
|
export type { SelectOption } from './BaseSelectDropdown';
|
|
5
|
+
/**
|
|
6
|
+
* Note: Even with a pre-selected item, when it first opens the dropdown it renders the full options list,
|
|
7
|
+
* not just the selected one. The filter is only usable while the dropdown is open.
|
|
8
|
+
*/
|
|
5
9
|
export type SelectProps<T extends SelectOption> = Omit<WithFeedbackAndAddonProps, 'bsSize'> & {
|
|
6
10
|
/**
|
|
7
11
|
* Passed through as HTML attribute to the toggle button.
|
|
@@ -105,6 +109,7 @@ export type SelectProps<T extends SelectOption> = Omit<WithFeedbackAndAddonProps
|
|
|
105
109
|
useClear?: boolean;
|
|
106
110
|
/**
|
|
107
111
|
* Shows a loading spinner instead of the menu items if set to true.
|
|
112
|
+
*
|
|
108
113
|
* @default false
|
|
109
114
|
*/
|
|
110
115
|
isLoading?: boolean;
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as o, useRef as
|
|
3
|
-
import V from "classnames";
|
|
1
|
+
import { jsxs as U, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as o, useRef as V } from "react";
|
|
4
3
|
import { isEqual as k } from "es-toolkit/predicate";
|
|
5
|
-
import { noop as
|
|
6
|
-
import
|
|
7
|
-
import ve from "
|
|
4
|
+
import { noop as Oe, isEmpty as be } from "es-toolkit/compat";
|
|
5
|
+
import K from "../../utils/classNames.js";
|
|
6
|
+
import ve, { filterOptions as xe } from "./BaseSelectDropdown.js";
|
|
7
|
+
import we from "../../hooks/useClickOutside.js";
|
|
8
8
|
import De from "../../hooks/useEffectOnce.js";
|
|
9
9
|
import Me from "../../hooks/useMergeRefs.js";
|
|
10
10
|
import Ee from "./ClearButton.js";
|
|
11
11
|
import Ne from "./SelectFilter.js";
|
|
12
12
|
import Ae from "./SelectedOption.js";
|
|
13
13
|
import Te from "./WithFeedbackAndAddon.js";
|
|
14
|
-
const
|
|
14
|
+
const u = -1, ze = (R) => {
|
|
15
15
|
const {
|
|
16
16
|
name: F,
|
|
17
17
|
id: B = F,
|
|
18
|
-
label:
|
|
19
|
-
options:
|
|
18
|
+
label: _,
|
|
19
|
+
options: t = [],
|
|
20
20
|
value: n,
|
|
21
|
-
onChange: O =
|
|
22
|
-
placeholder:
|
|
23
|
-
isLoading:
|
|
24
|
-
dropup:
|
|
25
|
-
pullRight:
|
|
26
|
-
autoDropDirection:
|
|
21
|
+
onChange: O = Oe,
|
|
22
|
+
placeholder: j,
|
|
23
|
+
isLoading: L = !1,
|
|
24
|
+
dropup: W = !1,
|
|
25
|
+
pullRight: q = !1,
|
|
26
|
+
autoDropDirection: z = !0,
|
|
27
27
|
bsSize: g = "md",
|
|
28
|
-
disabled:
|
|
29
|
-
tabIndex:
|
|
30
|
-
hasError:
|
|
31
|
-
useFilter:
|
|
32
|
-
useClear:
|
|
33
|
-
noItemMessage:
|
|
34
|
-
selectedOptionText:
|
|
35
|
-
showSelectedItemIcon:
|
|
36
|
-
showUnselectedItemIcons:
|
|
37
|
-
dropdownClassName:
|
|
38
|
-
btnClassName:
|
|
28
|
+
disabled: b = !1,
|
|
29
|
+
tabIndex: X = 0,
|
|
30
|
+
hasError: G = !1,
|
|
31
|
+
useFilter: H = !1,
|
|
32
|
+
useClear: J = !1,
|
|
33
|
+
noItemMessage: Q,
|
|
34
|
+
selectedOptionText: v,
|
|
35
|
+
showSelectedItemIcon: Y = !1,
|
|
36
|
+
showUnselectedItemIcons: Z = !1,
|
|
37
|
+
dropdownClassName: $,
|
|
38
|
+
btnClassName: x,
|
|
39
39
|
className: w,
|
|
40
|
-
inputAddon:
|
|
41
|
-
errorMessage:
|
|
42
|
-
warningMessage:
|
|
43
|
-
messageWhiteSpace:
|
|
44
|
-
|
|
45
|
-
} = R, [r,
|
|
46
|
-
|
|
40
|
+
inputAddon: D,
|
|
41
|
+
errorMessage: M,
|
|
42
|
+
warningMessage: E,
|
|
43
|
+
messageWhiteSpace: ee = "normal",
|
|
44
|
+
...te
|
|
45
|
+
} = R, [r, N] = o(!1), [h, p] = o(null), [I, c] = o(!1), [A, d] = o(""), [se, l] = o(t), [T, oe] = o([]), [ne, m] = o(u), [y, f] = o(!1), re = V(), P = V(null), le = we(() => S()), ae = Me(re, le), C = (e, s) => {
|
|
46
|
+
s && !be(s) ? p(e.find((a) => a.id === s[0]) || null) : e && p(e.find((a) => a.selected) || null);
|
|
47
47
|
};
|
|
48
48
|
De(() => {
|
|
49
|
-
|
|
49
|
+
C(t, n);
|
|
50
50
|
});
|
|
51
|
-
const [ie, ce] = o(
|
|
52
|
-
k(
|
|
51
|
+
const [ie, ce] = o(t);
|
|
52
|
+
k(t, ie) || (C(t, n), l(t), ce(t));
|
|
53
53
|
const [de, fe] = o(n);
|
|
54
|
-
k(n, de) || (
|
|
54
|
+
k(n, de) || (C(t, n), fe(n));
|
|
55
55
|
const ue = (e = []) => {
|
|
56
|
-
|
|
57
|
-
}, me = () => {
|
|
58
|
-
u(null), i(!1), c(""), O(void 0);
|
|
56
|
+
!e.length || (I || A) && T.length > 0 || oe(e);
|
|
59
57
|
}, pe = () => {
|
|
60
|
-
|
|
58
|
+
p(null), c(!1), d(""), l(t), f(!1), m(u), O(void 0);
|
|
59
|
+
}, me = () => {
|
|
60
|
+
const e = K(
|
|
61
61
|
"dropdown-toggle",
|
|
62
62
|
"form-control",
|
|
63
63
|
"text-left",
|
|
64
|
-
|
|
64
|
+
x && x,
|
|
65
65
|
g === "sm" && "input-sm",
|
|
66
66
|
g === "lg" && "input-lg",
|
|
67
|
-
|
|
68
|
-
),
|
|
67
|
+
b && "disabled"
|
|
68
|
+
), s = /* @__PURE__ */ U(
|
|
69
69
|
"button",
|
|
70
70
|
{
|
|
71
71
|
type: "button",
|
|
@@ -73,88 +73,88 @@ const p = -1, ze = (R) => {
|
|
|
73
73
|
name: F,
|
|
74
74
|
className: e,
|
|
75
75
|
"data-toggle": "dropdown",
|
|
76
|
-
tabIndex:
|
|
76
|
+
tabIndex: X,
|
|
77
77
|
"aria-haspopup": "true",
|
|
78
78
|
"aria-expanded": r,
|
|
79
79
|
onClick: Ce,
|
|
80
|
-
ref:
|
|
80
|
+
ref: P,
|
|
81
81
|
children: [
|
|
82
|
-
|
|
82
|
+
H && r && /* @__PURE__ */ i(
|
|
83
83
|
Ne,
|
|
84
84
|
{
|
|
85
|
-
isFilterActive:
|
|
86
|
-
filterValue:
|
|
87
|
-
onChange:
|
|
85
|
+
isFilterActive: I,
|
|
86
|
+
filterValue: A,
|
|
87
|
+
onChange: he
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
|
-
|
|
90
|
+
v || /* @__PURE__ */ i(
|
|
91
91
|
Ae,
|
|
92
92
|
{
|
|
93
|
-
label:
|
|
94
|
-
placeholder:
|
|
95
|
-
selectedItem:
|
|
96
|
-
options:
|
|
97
|
-
showSelectedItemIcon:
|
|
98
|
-
showUnselectedItemIcons:
|
|
93
|
+
label: _,
|
|
94
|
+
placeholder: j,
|
|
95
|
+
selectedItem: h,
|
|
96
|
+
options: t,
|
|
97
|
+
showSelectedItemIcon: Y,
|
|
98
|
+
showUnselectedItemIcons: Z
|
|
99
99
|
}
|
|
100
100
|
),
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ i(Ee, { showClear: J, selectedItem: h, onClear: pe }),
|
|
102
|
+
/* @__PURE__ */ i("span", { className: "caret" })
|
|
103
103
|
]
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
|
-
return !
|
|
106
|
+
return !D && !M && !E ? s : /* @__PURE__ */ i(
|
|
107
107
|
Te,
|
|
108
108
|
{
|
|
109
109
|
bsSize: g,
|
|
110
|
-
inputAddon:
|
|
111
|
-
errorMessage:
|
|
112
|
-
warningMessage:
|
|
113
|
-
messageWhiteSpace:
|
|
114
|
-
children:
|
|
110
|
+
inputAddon: D,
|
|
111
|
+
errorMessage: M,
|
|
112
|
+
warningMessage: E,
|
|
113
|
+
messageWhiteSpace: ee,
|
|
114
|
+
children: s
|
|
115
115
|
}
|
|
116
116
|
);
|
|
117
117
|
}, ge = () => {
|
|
118
118
|
let e = ne;
|
|
119
|
-
return
|
|
120
|
-
|
|
119
|
+
return y && !h && (e = 0), /* @__PURE__ */ i(
|
|
120
|
+
ve,
|
|
121
121
|
{
|
|
122
122
|
isOpen: r,
|
|
123
|
-
isLoading:
|
|
124
|
-
options:
|
|
123
|
+
isLoading: L,
|
|
124
|
+
options: se,
|
|
125
125
|
focusedItemIndex: e,
|
|
126
|
-
keyboardUsed:
|
|
126
|
+
keyboardUsed: y,
|
|
127
127
|
updateDOMValues: ue,
|
|
128
|
-
onSelect:
|
|
129
|
-
onClose:
|
|
130
|
-
noItemMessage:
|
|
131
|
-
pullRight:
|
|
132
|
-
dropup:
|
|
133
|
-
autoDropDirection:
|
|
134
|
-
dropdownClassName:
|
|
128
|
+
onSelect: Ie,
|
|
129
|
+
onClose: S,
|
|
130
|
+
noItemMessage: Q,
|
|
131
|
+
pullRight: q,
|
|
132
|
+
dropup: W,
|
|
133
|
+
autoDropDirection: z,
|
|
134
|
+
dropdownClassName: $
|
|
135
135
|
}
|
|
136
136
|
);
|
|
137
|
-
},
|
|
137
|
+
}, he = (e) => {
|
|
138
138
|
e.preventDefault();
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
|
|
139
|
+
const s = e.currentTarget.value;
|
|
140
|
+
if (s === "") {
|
|
141
|
+
c(!1), d(""), l(t), f(!1), m(u);
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
},
|
|
147
|
-
|
|
144
|
+
const a = xe(T, s, t), Fe = a.length > 0 ? 0 : u;
|
|
145
|
+
c(!0), d(s), l(a), f(!0), m(Fe);
|
|
146
|
+
}, Ie = (e) => {
|
|
147
|
+
p(e || null), c(!1), d(""), l(t), O(e), S();
|
|
148
148
|
}, Ce = (e) => {
|
|
149
|
-
if (
|
|
149
|
+
if (b || I)
|
|
150
150
|
return;
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
},
|
|
154
|
-
r && (
|
|
155
|
-
},
|
|
156
|
-
return /* @__PURE__ */
|
|
157
|
-
|
|
151
|
+
const s = e.detail === 0;
|
|
152
|
+
N(!r), f(s);
|
|
153
|
+
}, S = () => {
|
|
154
|
+
r && (N(!1), c(!1), d(""), l(t), f(!1), m(u), P.current?.focus());
|
|
155
|
+
}, Se = K("select", "dropdown", r && "open", G && "has-error", w && w);
|
|
156
|
+
return /* @__PURE__ */ U("div", { ...te, className: Se, ref: ae, children: [
|
|
157
|
+
me(),
|
|
158
158
|
ge()
|
|
159
159
|
] });
|
|
160
160
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/components/selects/Select.tsx"],"sourcesContent":["import type React from 'react';\nimport { useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport { isEqual } from 'es-toolkit/predicate';\nimport { isEmpty, noop } from 'es-toolkit/compat';\n\nimport BaseSelectDropdown, { filterOptions, type OptionDOMValue, type SelectOption } from './BaseSelectDropdown';\nimport useClickOutside from '../../useClickOutside';\nimport useEffectOnce from '../../hooks/useEffectOnce';\nimport useMergeRefs from '../../hooks/useMergeRefs';\nimport ClearButton from './ClearButton';\nimport SelectFilter from './SelectFilter';\nimport SelectedOption from './SelectedOption';\nimport WithFeedbackAndAddon, { type WithFeedbackAndAddonProps } from './WithFeedbackAndAddon';\n\nexport type { SelectOption } from './BaseSelectDropdown';\n\nconst DEFAULT_FOCUSED_ITEM_INDEX = -1;\n\nexport type SelectProps<T extends SelectOption> = Omit<WithFeedbackAndAddonProps, 'bsSize'> & {\n /**\n * Passed through as HTML attribute to the toggle button.\n */\n name?: string;\n\n /**\n * Passed through as HTML attribute to the toggle button.\n *\n * @default Uses the value given to `name` if not provided explicitly.\n */\n id?: string;\n\n /**\n * The toggle label in front of the selected text.\n */\n label?: string | React.ReactNode;\n\n /**\n * Items to display in the dropdown menu.\n *\n * @default []\n */\n options?: T[];\n\n /**\n * Sets the ids of the selected options when the component is already mounted.\n */\n value?: string[];\n\n /**\n * Callback function triggered when an item is selected.\n *\n * @param selectedOption The option that was selected (or undefined if none was).\n *\n * @default () => {}\n */\n onChange?: (selectOption: T | undefined) => void;\n\n /**\n * Text to display when nothing is selected.\n */\n placeholder?: string | React.ReactNode;\n\n /**\n * Defines whether the dropdown opens upwards.\n *\n * Set to `true` additionally disables autoDrop feature.\n *\n * @default false\n */\n dropup?: boolean;\n\n /**\n * Defines whether the dropdown opens right aligned to the dropdown toggle.\n *\n * Set to 'true' additionally disables autoDrop feature.\n *\n * @default false\n */\n pullRight?: boolean;\n\n /**\n * Enables or disables the autoDrop positioning feature.\n *\n * When enabled, the option list opens below or above the input depending on the surrounding space.\n *\n * @default true\n */\n autoDropDirection?: boolean;\n\n /**\n * Defines the size of the select to be rendered.\n *\n * @default 'md'\n */\n bsSize?: 'sm' | 'md' | 'lg';\n\n /**\n * Option to disable the opening of the option list.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Sets the input's tabindex attribute.\n *\n * The tabindex attribute allows developers to make HTML elements focusable, allow or prevent them from being\n * sequentially focusable (usually with the Tab key, hence the name) and determine their relative ordering for\n * sequential focus navigation.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Defines whether the Bootstrap error classes shall be added to the toggle element.\n *\n * @default false\n */\n hasError?: boolean;\n\n /**\n * Defines whether the component should be filterable.\n *\n * @default false\n */\n useFilter?: boolean;\n\n /**\n * Set to show a clear button.\n *\n * @default false\n */\n useClear?: boolean;\n\n /**\n * Shows a loading spinner instead of the menu items if set to true.\n * @default false\n */\n isLoading?: boolean;\n\n /**\n * Text that shall be shown when not match was found when filtering.\n */\n noItemMessage?: string | React.ReactNode;\n\n /**\n * Text or node to be rendered on the toggle select instead of the selected item label.\n */\n selectedOptionText?: string | React.ReactNode;\n\n /**\n * Set to show only the icon and not the label of selected item.\n *\n * @default false\n */\n showSelectedItemIcon?: boolean;\n\n /**\n * Set to show all item icons within the toggle element.\n *\n * Selected items are highlighted and unselected items are shown as inactive.\n *\n * @default false\n */\n showUnselectedItemIcons?: boolean;\n\n /**\n * Additional classes to be set to the dropdown.\n */\n dropdownClassName?: string;\n\n /**\n * Additional classes to be set to the select/input.\n */\n btnClassName?: string;\n\n /**\n * Additional classes to be set to the select wrapper.\n */\n className?: string;\n};\n\nconst Select = <T extends SelectOption>(props: SelectProps<T>) => {\n const {\n name,\n id = name,\n label,\n options = [],\n value,\n onChange = noop,\n placeholder,\n isLoading = false,\n dropup = false,\n pullRight = false,\n autoDropDirection = true,\n bsSize = 'md',\n disabled = false,\n tabIndex = 0,\n hasError = false,\n useFilter = false,\n useClear = false,\n noItemMessage,\n selectedOptionText,\n showSelectedItemIcon = false,\n showUnselectedItemIcons = false,\n dropdownClassName,\n btnClassName,\n className,\n\n inputAddon,\n errorMessage,\n warningMessage,\n messageWhiteSpace = 'normal',\n\n ...remainingProps\n } = props;\n\n const [isOpen, setIsOpen] = useState(false);\n const [selectedItem, setSelectedItem] = useState<SelectOption | null>(null);\n const [isFilterActive, setIsFilterActive] = useState(false);\n const [filterValue, setFilterValue] = useState('');\n const [filteredOptions, setFilteredOptions] = useState(options);\n const [itemDOMValues, setItemDOMValues] = useState<OptionDOMValue[]>([]);\n const [focusedItemIndex, setFocusedItemIndex] = useState(DEFAULT_FOCUSED_ITEM_INDEX);\n const [keyboardUsed, setKeyboardUsed] = useState(false);\n\n const refSelect = useRef();\n const refToggle = useRef<HTMLButtonElement>(null);\n\n const ref = useClickOutside(() => closeMenu());\n const mergedSelectRefs = useMergeRefs(refSelect, ref);\n\n const updateSelectedItem = (selectOptions: SelectOption[], updatedValue: string[] | undefined) => {\n if (updatedValue && !isEmpty(updatedValue)) {\n setSelectedItem(selectOptions.find(item => item.id === updatedValue[0]) || null);\n } else if (selectOptions) {\n setSelectedItem(selectOptions.find(item => item.selected) || null);\n }\n };\n\n useEffectOnce(() => {\n updateSelectedItem(options, value);\n });\n\n const [previousOptions, setPreviousOptions] = useState(options);\n if (!isEqual(options, previousOptions)) {\n updateSelectedItem(options, value);\n setFilteredOptions(options);\n setPreviousOptions(options);\n }\n\n const [previousValue, setPreviousValue] = useState(value);\n if (!isEqual(value, previousValue)) {\n updateSelectedItem(options, value);\n setPreviousValue(value);\n }\n\n const updateDOMValues = (itemDOMValuesToUpdated: OptionDOMValue[] = []) => {\n // preserve previous DOM values when empty\n setItemDOMValues(prev => (itemDOMValuesToUpdated.length ? itemDOMValuesToUpdated : prev));\n };\n\n const handleClearSelectedItem = () => {\n setSelectedItem(null);\n setIsFilterActive(false);\n setFilterValue('');\n\n onChange(undefined);\n };\n\n const renderToggle = () => {\n const toggleClasses = classNames(\n 'dropdown-toggle',\n 'form-control',\n 'text-left',\n btnClassName && btnClassName,\n bsSize === 'sm' && 'input-sm',\n bsSize === 'lg' && 'input-lg',\n disabled && 'disabled'\n );\n\n const toggleButton = (\n <button\n type='button'\n id={id}\n name={name}\n className={toggleClasses}\n data-toggle='dropdown'\n tabIndex={tabIndex}\n aria-haspopup='true'\n aria-expanded={isOpen}\n onClick={onToggle}\n ref={refToggle}\n >\n {useFilter && isOpen && (\n <SelectFilter\n isFilterActive={isFilterActive}\n filterValue={filterValue}\n onChange={handleFilterChange}\n />\n )}\n {selectedOptionText ? (\n selectedOptionText\n ) : (\n <SelectedOption\n label={label}\n placeholder={placeholder}\n selectedItem={selectedItem}\n options={options}\n showSelectedItemIcon={showSelectedItemIcon}\n showUnselectedItemIcons={showUnselectedItemIcons}\n />\n )}\n <ClearButton showClear={useClear} selectedItem={selectedItem} onClear={handleClearSelectedItem} />\n <span className='caret' />\n </button>\n );\n\n if (!inputAddon && !errorMessage && !warningMessage) {\n return toggleButton;\n }\n\n return (\n <WithFeedbackAndAddon\n bsSize={bsSize}\n inputAddon={inputAddon}\n errorMessage={errorMessage}\n warningMessage={warningMessage}\n messageWhiteSpace={messageWhiteSpace}\n >\n {toggleButton}\n </WithFeedbackAndAddon>\n );\n };\n\n const renderDropdownMenu = () => {\n // When an option was already selected, highlight this option by setting the focusedItemIndex accordingly.\n // In case there was nothing preselected, set the focusedItemIndex to the first item if keyboard was used.\n let currentFocusedItemIndex = focusedItemIndex;\n if (selectedItem) {\n currentFocusedItemIndex = options.findIndex(option => {\n return option.id === selectedItem.id;\n });\n } else if (keyboardUsed) {\n currentFocusedItemIndex = 0;\n }\n\n return (\n <BaseSelectDropdown\n isOpen={isOpen}\n isLoading={isLoading}\n options={filteredOptions}\n focusedItemIndex={currentFocusedItemIndex}\n keyboardUsed={keyboardUsed}\n updateDOMValues={updateDOMValues}\n onSelect={onOptionChange}\n onClose={closeMenu}\n noItemMessage={noItemMessage}\n pullRight={pullRight}\n dropup={dropup}\n autoDropDirection={autoDropDirection}\n dropdownClassName={dropdownClassName}\n />\n );\n };\n\n const handleFilterChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n event.preventDefault();\n\n const targetFilterValue = event.currentTarget.value;\n\n // if cleared: reset to defaults and bail early\n if (targetFilterValue === '') {\n setIsFilterActive(false);\n setFilterValue('');\n setFilteredOptions(options);\n setKeyboardUsed(false);\n setFocusedItemIndex(DEFAULT_FOCUSED_ITEM_INDEX);\n return;\n }\n\n // otherwise: filter against the last known non-empty DOM snapshot\n const currentFilteredOptions = filterOptions(itemDOMValues, targetFilterValue, options);\n\n // highlight the first item of the search result if at least one item was found\n const newFocusedItemIndex = currentFilteredOptions.length > 0 ? 0 : DEFAULT_FOCUSED_ITEM_INDEX;\n\n setIsFilterActive(true);\n setFilterValue(targetFilterValue);\n setFilteredOptions(currentFilteredOptions);\n setKeyboardUsed(true);\n setFocusedItemIndex(newFocusedItemIndex);\n };\n\n const onOptionChange = (currentSelectedItem: T | undefined) => {\n setSelectedItem(currentSelectedItem || null);\n setIsFilterActive(false);\n setFilterValue('');\n setFilteredOptions(options);\n\n onChange(currentSelectedItem);\n\n closeMenu();\n };\n\n const onToggle = (event: React.MouseEvent<HTMLButtonElement>) => {\n // Don't toggle when component is disabled or\n // when filter is active, means entering some filter value\n // in order to avoid closing menu on space but allow to use it for filtering\n if (disabled || isFilterActive) {\n return;\n }\n\n // using the enter key on the toggle button will trigger a synthetic click event as all buttons are of\n // type submit by default in HTML. In order to differentiate between real click and a synthetic event\n // caused by they keyboard, use the event details. A synthetic event is always 0.\n const isKeyboardUsed = event.detail === 0;\n\n setIsOpen(!isOpen);\n setKeyboardUsed(isKeyboardUsed);\n };\n\n const closeMenu = () => {\n if (isOpen) {\n setIsOpen(false);\n setIsFilterActive(false);\n setFilterValue('');\n setFilteredOptions(options);\n setKeyboardUsed(false);\n setFocusedItemIndex(DEFAULT_FOCUSED_ITEM_INDEX);\n refToggle.current?.focus();\n }\n };\n\n const classes = classNames('select', 'dropdown', isOpen && 'open', hasError && 'has-error', className && className);\n\n return (\n <div {...remainingProps} className={classes} ref={mergedSelectRefs}>\n {renderToggle()}\n {renderDropdownMenu()}\n </div>\n );\n};\n\nexport default Select;\n"],"names":["DEFAULT_FOCUSED_ITEM_INDEX","Select","props","name","id","label","options","value","onChange","noop","placeholder","isLoading","dropup","pullRight","autoDropDirection","bsSize","disabled","tabIndex","hasError","useFilter","useClear","noItemMessage","selectedOptionText","showSelectedItemIcon","showUnselectedItemIcons","dropdownClassName","btnClassName","className","inputAddon","errorMessage","warningMessage","messageWhiteSpace","remainingProps","isOpen","setIsOpen","useState","selectedItem","setSelectedItem","isFilterActive","setIsFilterActive","filterValue","setFilterValue","filteredOptions","setFilteredOptions","itemDOMValues","setItemDOMValues","focusedItemIndex","setFocusedItemIndex","keyboardUsed","setKeyboardUsed","refSelect","useRef","refToggle","ref","useClickOutside","closeMenu","mergedSelectRefs","useMergeRefs","updateSelectedItem","selectOptions","updatedValue","isEmpty","item","useEffectOnce","previousOptions","setPreviousOptions","isEqual","previousValue","setPreviousValue","updateDOMValues","itemDOMValuesToUpdated","prev","handleClearSelectedItem","renderToggle","toggleClasses","classNames","toggleButton","jsxs","onToggle","jsx","SelectFilter","handleFilterChange","SelectedOption","ClearButton","WithFeedbackAndAddon","renderDropdownMenu","currentFocusedItemIndex","option","BaseSelectDropdown","onOptionChange","event","targetFilterValue","currentFilteredOptions","filterOptions","newFocusedItemIndex","currentSelectedItem","isKeyboardUsed","classes"],"mappings":";;;;;;;;;;;;;AAiBA,MAAMA,IAA6B,IAuK7BC,KAAS,CAAyBC,MAA0B;AAC9D,QAAM;AAAA,IACF,MAAAC;AAAA,IAC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A;AAAA,EAAmB,GACxB;AAER;"}
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/components/selects/Select.tsx"],"sourcesContent":["import type React from 'react';\nimport { useRef, useState } from 'react';\nimport { isEqual } from 'es-toolkit/predicate';\nimport { isEmpty, noop } from 'es-toolkit/compat';\n\nimport classNames from '../../utils/classNames';\nimport BaseSelectDropdown, { filterOptions, type OptionDOMValue, type SelectOption } from './BaseSelectDropdown';\nimport useClickOutside from '../../useClickOutside';\nimport useEffectOnce from '../../hooks/useEffectOnce';\nimport useMergeRefs from '../../hooks/useMergeRefs';\nimport ClearButton from './ClearButton';\nimport SelectFilter from './SelectFilter';\nimport SelectedOption from './SelectedOption';\nimport WithFeedbackAndAddon, { type WithFeedbackAndAddonProps } from './WithFeedbackAndAddon';\n\nexport type { SelectOption } from './BaseSelectDropdown';\n\nconst DEFAULT_FOCUSED_ITEM_INDEX = -1;\n\n/**\n * Note: Even with a pre-selected item, when it first opens the dropdown it renders the full options list,\n * not just the selected one. The filter is only usable while the dropdown is open.\n */\nexport type SelectProps<T extends SelectOption> = Omit<WithFeedbackAndAddonProps, 'bsSize'> & {\n /**\n * Passed through as HTML attribute to the toggle button.\n */\n name?: string;\n\n /**\n * Passed through as HTML attribute to the toggle button.\n *\n * @default Uses the value given to `name` if not provided explicitly.\n */\n id?: string;\n\n /**\n * The toggle label in front of the selected text.\n */\n label?: string | React.ReactNode;\n\n /**\n * Items to display in the dropdown menu.\n *\n * @default []\n */\n options?: T[];\n\n /**\n * Sets the ids of the selected options when the component is already mounted.\n */\n value?: string[];\n\n /**\n * Callback function triggered when an item is selected.\n *\n * @param selectedOption The option that was selected (or undefined if none was).\n *\n * @default () => {}\n */\n onChange?: (selectOption: T | undefined) => void;\n\n /**\n * Text to display when nothing is selected.\n */\n placeholder?: string | React.ReactNode;\n\n /**\n * Defines whether the dropdown opens upwards.\n *\n * Set to `true` additionally disables autoDrop feature.\n *\n * @default false\n */\n dropup?: boolean;\n\n /**\n * Defines whether the dropdown opens right aligned to the dropdown toggle.\n *\n * Set to 'true' additionally disables autoDrop feature.\n *\n * @default false\n */\n pullRight?: boolean;\n\n /**\n * Enables or disables the autoDrop positioning feature.\n *\n * When enabled, the option list opens below or above the input depending on the surrounding space.\n *\n * @default true\n */\n autoDropDirection?: boolean;\n\n /**\n * Defines the size of the select to be rendered.\n *\n * @default 'md'\n */\n bsSize?: 'sm' | 'md' | 'lg';\n\n /**\n * Option to disable the opening of the option list.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Sets the input's tabindex attribute.\n *\n * The tabindex attribute allows developers to make HTML elements focusable, allow or prevent them from being\n * sequentially focusable (usually with the Tab key, hence the name) and determine their relative ordering for\n * sequential focus navigation.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Defines whether the Bootstrap error classes shall be added to the toggle element.\n *\n * @default false\n */\n hasError?: boolean;\n\n /**\n * Defines whether the component should be filterable.\n *\n * @default false\n */\n useFilter?: boolean;\n\n /**\n * Set to show a clear button.\n *\n * @default false\n */\n useClear?: boolean;\n\n /**\n * Shows a loading spinner instead of the menu items if set to true.\n *\n * @default false\n */\n isLoading?: boolean;\n\n /**\n * Text that shall be shown when not match was found when filtering.\n */\n noItemMessage?: string | React.ReactNode;\n\n /**\n * Text or node to be rendered on the toggle select instead of the selected item label.\n */\n selectedOptionText?: string | React.ReactNode;\n\n /**\n * Set to show only the icon and not the label of selected item.\n *\n * @default false\n */\n showSelectedItemIcon?: boolean;\n\n /**\n * Set to show all item icons within the toggle element.\n *\n * Selected items are highlighted and unselected items are shown as inactive.\n *\n * @default false\n */\n showUnselectedItemIcons?: boolean;\n\n /**\n * Additional classes to be set to the dropdown.\n */\n dropdownClassName?: string;\n\n /**\n * Additional classes to be set to the select/input.\n */\n btnClassName?: string;\n\n /**\n * Additional classes to be set to the select wrapper.\n */\n className?: string;\n};\n\nconst Select = <T extends SelectOption>(props: SelectProps<T>) => {\n const {\n name,\n id = name,\n label,\n options = [],\n value,\n onChange = noop,\n placeholder,\n isLoading = false,\n dropup = false,\n pullRight = false,\n autoDropDirection = true,\n bsSize = 'md',\n disabled = false,\n tabIndex = 0,\n hasError = false,\n useFilter = false,\n useClear = false,\n noItemMessage,\n selectedOptionText,\n showSelectedItemIcon = false,\n showUnselectedItemIcons = false,\n dropdownClassName,\n btnClassName,\n className,\n\n inputAddon,\n errorMessage,\n warningMessage,\n messageWhiteSpace = 'normal',\n\n ...remainingProps\n } = props;\n\n const [isOpen, setIsOpen] = useState(false);\n const [selectedItem, setSelectedItem] = useState<SelectOption | null>(null);\n const [isFilterActive, setIsFilterActive] = useState(false);\n const [filterValue, setFilterValue] = useState('');\n const [filteredOptions, setFilteredOptions] = useState(options);\n const [itemDOMValues, setItemDOMValues] = useState<OptionDOMValue[]>([]);\n const [focusedItemIndex, setFocusedItemIndex] = useState(DEFAULT_FOCUSED_ITEM_INDEX);\n const [keyboardUsed, setKeyboardUsed] = useState(false);\n\n const refSelect = useRef();\n const refToggle = useRef<HTMLButtonElement>(null);\n\n const ref = useClickOutside(() => closeMenu());\n const mergedSelectRefs = useMergeRefs(refSelect, ref);\n\n const updateSelectedItem = (selectOptions: SelectOption[], updatedValue: string[] | undefined) => {\n if (updatedValue && !isEmpty(updatedValue)) {\n setSelectedItem(selectOptions.find(item => item.id === updatedValue[0]) || null);\n } else if (selectOptions) {\n setSelectedItem(selectOptions.find(item => item.selected) || null);\n }\n };\n\n useEffectOnce(() => {\n updateSelectedItem(options, value);\n });\n\n const [previousOptions, setPreviousOptions] = useState(options);\n if (!isEqual(options, previousOptions)) {\n updateSelectedItem(options, value);\n setFilteredOptions(options);\n setPreviousOptions(options);\n }\n\n const [previousValue, setPreviousValue] = useState(value);\n if (!isEqual(value, previousValue)) {\n updateSelectedItem(options, value);\n setPreviousValue(value);\n }\n\n const updateDOMValues = (itemDOMValuesToUpdated: OptionDOMValue[] = []) => {\n // Skip updates when we have nothing new, or when filtering is active and we already hold a full snapshot.\n if (!itemDOMValuesToUpdated.length) {\n return;\n }\n\n const shouldKeepPreviousSnapshot = (isFilterActive || filterValue) && itemDOMValues.length > 0;\n if (shouldKeepPreviousSnapshot) {\n return;\n }\n\n setItemDOMValues(itemDOMValuesToUpdated);\n };\n\n const handleClearSelectedItem = () => {\n setSelectedItem(null);\n setIsFilterActive(false);\n setFilterValue('');\n setFilteredOptions(options);\n setKeyboardUsed(false);\n setFocusedItemIndex(DEFAULT_FOCUSED_ITEM_INDEX);\n\n onChange(undefined);\n };\n\n const renderToggle = () => {\n const toggleClasses = classNames(\n 'dropdown-toggle',\n 'form-control',\n 'text-left',\n btnClassName && btnClassName,\n bsSize === 'sm' && 'input-sm',\n bsSize === 'lg' && 'input-lg',\n disabled && 'disabled'\n );\n\n const toggleButton = (\n <button\n type='button'\n id={id}\n name={name}\n className={toggleClasses}\n data-toggle='dropdown'\n tabIndex={tabIndex}\n aria-haspopup='true'\n aria-expanded={isOpen}\n onClick={onToggle}\n ref={refToggle}\n >\n {useFilter && isOpen && (\n <SelectFilter\n isFilterActive={isFilterActive}\n filterValue={filterValue}\n onChange={handleFilterChange}\n />\n )}\n {selectedOptionText ? (\n selectedOptionText\n ) : (\n <SelectedOption\n label={label}\n placeholder={placeholder}\n selectedItem={selectedItem}\n options={options}\n showSelectedItemIcon={showSelectedItemIcon}\n showUnselectedItemIcons={showUnselectedItemIcons}\n />\n )}\n <ClearButton showClear={useClear} selectedItem={selectedItem} onClear={handleClearSelectedItem} />\n <span className='caret' />\n </button>\n );\n\n if (!inputAddon && !errorMessage && !warningMessage) {\n return toggleButton;\n }\n\n return (\n <WithFeedbackAndAddon\n bsSize={bsSize}\n inputAddon={inputAddon}\n errorMessage={errorMessage}\n warningMessage={warningMessage}\n messageWhiteSpace={messageWhiteSpace}\n >\n {toggleButton}\n </WithFeedbackAndAddon>\n );\n };\n\n const renderDropdownMenu = () => {\n // Start from the last tracked focus; only default to the first item when opened via keyboard and nothing is selected.\n let currentFocusedItemIndex = focusedItemIndex;\n\n // Do not auto-highlight a selected item on open; let keyboard navigation start from \"no focus\".\n // Only default to the first item when opened via keyboard and nothing was selected.\n if (keyboardUsed && !selectedItem) {\n currentFocusedItemIndex = 0;\n }\n\n return (\n <BaseSelectDropdown\n isOpen={isOpen}\n isLoading={isLoading}\n options={filteredOptions}\n focusedItemIndex={currentFocusedItemIndex}\n keyboardUsed={keyboardUsed}\n updateDOMValues={updateDOMValues}\n onSelect={onOptionChange}\n onClose={closeMenu}\n noItemMessage={noItemMessage}\n pullRight={pullRight}\n dropup={dropup}\n autoDropDirection={autoDropDirection}\n dropdownClassName={dropdownClassName}\n />\n );\n };\n\n const handleFilterChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n event.preventDefault();\n\n const targetFilterValue = event.currentTarget.value;\n\n // if cleared: reset to defaults and bail early\n if (targetFilterValue === '') {\n setIsFilterActive(false);\n setFilterValue('');\n setFilteredOptions(options);\n setKeyboardUsed(false);\n setFocusedItemIndex(DEFAULT_FOCUSED_ITEM_INDEX);\n return;\n }\n\n // otherwise: filter against the last known non-empty DOM snapshot\n const currentFilteredOptions = filterOptions(itemDOMValues, targetFilterValue, options);\n\n // highlight the first item of the search result if at least one item was found\n const newFocusedItemIndex = currentFilteredOptions.length > 0 ? 0 : DEFAULT_FOCUSED_ITEM_INDEX;\n\n setIsFilterActive(true);\n setFilterValue(targetFilterValue);\n setFilteredOptions(currentFilteredOptions);\n setKeyboardUsed(true);\n setFocusedItemIndex(newFocusedItemIndex);\n };\n\n const onOptionChange = (currentSelectedItem: T | undefined) => {\n setSelectedItem(currentSelectedItem || null);\n setIsFilterActive(false);\n setFilterValue('');\n setFilteredOptions(options);\n\n onChange(currentSelectedItem);\n\n closeMenu();\n };\n\n const onToggle = (event: React.MouseEvent<HTMLButtonElement>) => {\n // Don't toggle when component is disabled or\n // when filter is active, means entering some filter value\n // in order to avoid closing menu on space but allow to use it for filtering\n if (disabled || isFilterActive) {\n return;\n }\n\n // using the enter key on the toggle button will trigger a synthetic click event as all buttons are of\n // type submit by default in HTML. In order to differentiate between real click and a synthetic event\n // caused by they keyboard, use the event details. A synthetic event is always 0.\n const isKeyboardUsed = event.detail === 0;\n\n setIsOpen(!isOpen);\n setKeyboardUsed(isKeyboardUsed);\n };\n\n const closeMenu = () => {\n if (isOpen) {\n setIsOpen(false);\n setIsFilterActive(false);\n setFilterValue('');\n setFilteredOptions(options);\n setKeyboardUsed(false);\n setFocusedItemIndex(DEFAULT_FOCUSED_ITEM_INDEX);\n refToggle.current?.focus();\n }\n };\n\n const classes = classNames('select', 'dropdown', isOpen && 'open', hasError && 'has-error', className && className);\n\n return (\n <div {...remainingProps} className={classes} ref={mergedSelectRefs}>\n {renderToggle()}\n {renderDropdownMenu()}\n </div>\n );\n};\n\nexport default Select;\n"],"names":["DEFAULT_FOCUSED_ITEM_INDEX","Select","props","name","id","label","options","value","onChange","noop","placeholder","isLoading","dropup","pullRight","autoDropDirection","bsSize","disabled","tabIndex","hasError","useFilter","useClear","noItemMessage","selectedOptionText","showSelectedItemIcon","showUnselectedItemIcons","dropdownClassName","btnClassName","className","inputAddon","errorMessage","warningMessage","messageWhiteSpace","remainingProps","isOpen","setIsOpen","useState","selectedItem","setSelectedItem","isFilterActive","setIsFilterActive","filterValue","setFilterValue","filteredOptions","setFilteredOptions","itemDOMValues","setItemDOMValues","focusedItemIndex","setFocusedItemIndex","keyboardUsed","setKeyboardUsed","refSelect","useRef","refToggle","ref","useClickOutside","closeMenu","mergedSelectRefs","useMergeRefs","updateSelectedItem","selectOptions","updatedValue","isEmpty","item","useEffectOnce","previousOptions","setPreviousOptions","isEqual","previousValue","setPreviousValue","updateDOMValues","itemDOMValuesToUpdated","handleClearSelectedItem","renderToggle","toggleClasses","classNames","toggleButton","jsxs","onToggle","jsx","SelectFilter","handleFilterChange","SelectedOption","ClearButton","WithFeedbackAndAddon","renderDropdownMenu","currentFocusedItemIndex","BaseSelectDropdown","onOptionChange","event","targetFilterValue","currentFilteredOptions","filterOptions","newFocusedItemIndex","currentSelectedItem","isKe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YAAYzC,KAAU,QAAQf,KAAY,aAAaS,KAAaA,CAAS;AAElH,2BACK,OAAA,EAAK,GAAGK,IAAgB,WAAW+D,IAAS,KAAKvC,IAC7C,UAAA;AAAA,IAAAgB,GAAA;AAAA,IACAY,GAAA;AAAA,EAAmB,GACxB;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectFilter.js","sources":["../../../src/components/selects/SelectFilter.tsx"],"sourcesContent":["import type React from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"SelectFilter.js","sources":["../../../src/components/selects/SelectFilter.tsx"],"sourcesContent":["import type React from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type SelectFilterProps = {\n isFilterActive: boolean;\n filterValue: string;\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n};\n\nconst SelectFilter = (props: SelectFilterProps) => {\n const { isFilterActive, filterValue, onChange } = props;\n\n const inputClasses = classNames(\n 'select-filter-input',\n (isFilterActive || filterValue) && 'select-filter-input-active'\n );\n\n // biome-ignore lint/a11y/noAutofocus: autofocus is intentionally set to allow instant typing to filter\n return <input type='text' className={inputClasses} autoFocus onChange={onChange} value={filterValue} />;\n};\n\nexport default SelectFilter;\n"],"names":["SelectFilter","props","isFilterActive","filterValue","onChange","inputClasses","classNames","jsx"],"mappings":";;AAUA,MAAMA,IAAe,CAACC,MAA6B;AAC/C,QAAM,EAAE,gBAAAC,GAAgB,aAAAC,GAAa,UAAAC,EAAA,IAAaH,GAE5CI,IAAeC;AAAA,IACjB;AAAA,KACCJ,KAAkBC,MAAgB;AAAA,EAAA;AAIvC,SAAO,gBAAAI,EAAC,SAAA,EAAM,MAAK,QAAO,WAAWF,GAAc,WAAS,IAAC,UAAAD,GAAoB,OAAOD,EAAA,CAAa;AACzG;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s, jsxs as r, Fragment as t } from "react/jsx-runtime";
|
|
2
|
-
import c from "
|
|
2
|
+
import c from "../../utils/classNames.js";
|
|
3
3
|
const f = (i) => {
|
|
4
4
|
const { bsSize: n = "md", inputAddon: o, errorMessage: e, warningMessage: a, messageWhiteSpace: l = "normal", children: p } = i, d = c(
|
|
5
5
|
"form-group margin-bottom-0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithFeedbackAndAddon.js","sources":["../../../src/components/selects/WithFeedbackAndAddon.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"WithFeedbackAndAddon.js","sources":["../../../src/components/selects/WithFeedbackAndAddon.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type WithFeedbackAndAddonProps = {\n /**\n * Defines the size of the select to be rendered.\n *\n * @default 'md'\n */\n bsSize?: 'sm' | 'md' | 'lg';\n\n /**\n * Option to add an icon as a leading input addon to the select or multiselect component.\n */\n inputAddon?: string;\n\n /**\n * Input error message.\n */\n errorMessage?: string | React.ReactNode;\n\n /**\n * Input warning message.\n */\n warningMessage?: string | React.ReactNode;\n\n /**\n * Optional warning message white-space setting.\n *\n * @default 'normal'\n */\n messageWhiteSpace?: 'normal' | 'nowrap' | 'pre-line';\n};\n\nconst WithFeedbackAndAddon = (props: PropsWithChildren<WithFeedbackAndAddonProps>) => {\n const { bsSize = 'md', inputAddon, errorMessage, warningMessage, messageWhiteSpace = 'normal', children } = props;\n\n const formGroupClassName = classNames(\n 'form-group margin-bottom-0',\n (errorMessage || warningMessage) && 'has-feedback',\n errorMessage && 'has-error',\n warningMessage && 'has-warning'\n );\n\n const inputGroupClassNames = classNames(\n 'input-group',\n bsSize === 'sm' && 'input-group-sm',\n bsSize === 'lg' && 'input-group-lg'\n );\n\n const hasFeedbackMessage = errorMessage || warningMessage;\n\n return (\n <div className={formGroupClassName}>\n <div className={inputGroupClassNames}>\n {inputAddon && (\n <div className='input-group-addon'>\n <span className={inputAddon} />\n </div>\n )}\n <div className='form-control-feedback-wrapper'>\n {children}\n {hasFeedbackMessage && (\n <>\n {errorMessage && <span className='form-control-feedback rioglyph rioglyph-error-sign' />}\n {warningMessage && (\n <span className='form-control-feedback rioglyph rioglyph-warning-sign' />\n )}\n <span className={`help-block white-space-${messageWhiteSpace}`}>\n <span>{errorMessage || warningMessage}</span>\n </span>\n </>\n )}\n </div>\n </div>\n </div>\n );\n};\n\nexport default WithFeedbackAndAddon;\n"],"names":["WithFeedbackAndAddon","props","bsSize","inputAddon","errorMessage","warningMessage","messageWhiteSpace","children","formGroupClassName","classNames","inputGroupClassNames","jsxs","jsx","Fragment"],"mappings":";;AAoCA,MAAMA,IAAuB,CAACC,MAAwD;AAClF,QAAM,EAAE,QAAAC,IAAS,MAAM,YAAAC,GAAY,cAAAC,GAAc,gBAAAC,GAAgB,mBAAAC,IAAoB,UAAU,UAAAC,EAAA,IAAaN,GAEtGO,IAAqBC;AAAA,IACvB;AAAA,KACCL,KAAgBC,MAAmB;AAAA,IACpCD,KAAgB;AAAA,IAChBC,KAAkB;AAAA,EAAA,GAGhBK,IAAuBD;AAAA,IACzB;AAAA,IACAP,MAAW,QAAQ;AAAA,IACnBA,MAAW,QAAQ;AAAA,EAAA;AAKvB,2BACK,OAAA,EAAI,WAAWM,GACZ,UAAA,gBAAAG,EAAC,OAAA,EAAI,WAAWD,GACX,UAAA;AAAA,IAAAP,KACG,gBAAAS,EAAC,SAAI,WAAU,qBACX,4BAAC,QAAA,EAAK,WAAWT,GAAY,EAAA,CACjC;AAAA,IAEJ,gBAAAQ,EAAC,OAAA,EAAI,WAAU,iCACV,UAAA;AAAA,MAAAJ;AAAA,OAXUH,KAAgBC,MAavB,gBAAAM,EAAAE,GAAA,EACK,UAAA;AAAA,QAAAT,KAAgB,gBAAAQ,EAAC,QAAA,EAAK,WAAU,qDAAA,CAAqD;AAAA,QACrFP,KACG,gBAAAO,EAAC,QAAA,EAAK,WAAU,uDAAA,CAAuD;AAAA,QAE3E,gBAAAA,EAAC,QAAA,EAAK,WAAW,0BAA0BN,CAAiB,IACxD,UAAA,gBAAAM,EAAC,QAAA,EAAM,UAAAR,KAAgBC,EAAA,CAAe,EAAA,CAC1C;AAAA,MAAA,EAAA,CACJ;AAAA,IAAA,EAAA,CAER;AAAA,EAAA,EAAA,CACJ,EAAA,CACJ;AAER;"}
|
|
@@ -7,16 +7,19 @@ declare const SidebarPosition: {
|
|
|
7
7
|
export type SidebarProps = {
|
|
8
8
|
/**
|
|
9
9
|
* Defines if the component will overlap the body content.
|
|
10
|
+
*
|
|
10
11
|
* @default false
|
|
11
12
|
*/
|
|
12
13
|
fly?: boolean;
|
|
13
14
|
/**
|
|
14
15
|
* Defines whether the component is hidden or not.
|
|
16
|
+
*
|
|
15
17
|
* @default false
|
|
16
18
|
*/
|
|
17
19
|
closed?: boolean;
|
|
18
20
|
/**
|
|
19
21
|
* Hides the close button. This may be used when the sidebar is always visible and may not be closed.
|
|
22
|
+
*
|
|
20
23
|
* @default false
|
|
21
24
|
*/
|
|
22
25
|
disableClose?: boolean;
|
|
@@ -49,21 +52,25 @@ export type SidebarProps = {
|
|
|
49
52
|
* Note: In the past, the type allowed to pass in a sting value like "400px" but that is not
|
|
50
53
|
* possible anymore due to internal width calculations. To be backwards compatible for non
|
|
51
54
|
* Typescript projects, the width is converted to a number.
|
|
55
|
+
*
|
|
52
56
|
* @default 350
|
|
53
57
|
*/
|
|
54
58
|
width?: number;
|
|
55
59
|
/**
|
|
56
60
|
* Defines the minimum width in px of the component that will take effect when resizing.
|
|
61
|
+
*
|
|
57
62
|
* @default 100
|
|
58
63
|
*/
|
|
59
64
|
minWidth?: number;
|
|
60
65
|
/**
|
|
61
66
|
* Defines the maximum width in px of the component that will take effect when resizing.
|
|
67
|
+
*
|
|
62
68
|
* @default 800
|
|
63
69
|
*/
|
|
64
70
|
maxWidth?: number;
|
|
65
71
|
/**
|
|
66
72
|
* Opens Sidebar in fullscreen, means 100vw.
|
|
73
|
+
*
|
|
67
74
|
* @default false
|
|
68
75
|
*/
|
|
69
76
|
openInFullscreen?: boolean;
|
|
@@ -73,6 +80,7 @@ export type SidebarProps = {
|
|
|
73
80
|
onFullScreenChange?: (newFullscreenState: boolean) => void;
|
|
74
81
|
/**
|
|
75
82
|
* Enables the fullscreen functionality and shows the fullscreen toggle.
|
|
83
|
+
*
|
|
76
84
|
* @default false
|
|
77
85
|
*/
|
|
78
86
|
enableFullscreenToggle?: boolean;
|
|
@@ -85,11 +93,15 @@ export type SidebarProps = {
|
|
|
85
93
|
* respectively. Note: the position need to be set properly whe using the resize
|
|
86
94
|
* functionality to know on which side of the sidebar to attach the resizer handle.
|
|
87
95
|
*
|
|
88
|
-
* It is also relevant when the sidebar mode is set to
|
|
96
|
+
* It is also relevant when the sidebar mode is set to `fly` to properly animate
|
|
89
97
|
* the sidebar into the view.
|
|
90
98
|
*
|
|
91
99
|
* Possible values are:
|
|
92
|
-
*
|
|
100
|
+
*
|
|
101
|
+
* - `'left'`
|
|
102
|
+
* - `'right'`
|
|
103
|
+
* - `Sidebar.LEFT`
|
|
104
|
+
* - `Sidebar.RIGHT`
|
|
93
105
|
*
|
|
94
106
|
* @default 'left'
|
|
95
107
|
*/
|
|
@@ -112,21 +124,25 @@ export type SidebarProps = {
|
|
|
112
124
|
switchModeBreakpoint?: number;
|
|
113
125
|
/**
|
|
114
126
|
* By default the fullscreen mode can be left with "esc". If this is unwanted it can be disabled.
|
|
127
|
+
*
|
|
115
128
|
* @default false
|
|
116
129
|
*/
|
|
117
130
|
disableEsc?: boolean;
|
|
118
131
|
/**
|
|
119
132
|
* Defined whether or not a backdrop will be rendered behind the Sidebar to avoid clicks outside.
|
|
133
|
+
*
|
|
120
134
|
* @default false
|
|
121
135
|
*/
|
|
122
136
|
hasBackdrop?: boolean;
|
|
123
137
|
/**
|
|
124
|
-
* Defined whether or not the UIKIT SmoothScrollbar is active
|
|
138
|
+
* Defined whether or not the UIKIT SmoothScrollbar is active.
|
|
139
|
+
*
|
|
125
140
|
* @default false
|
|
126
141
|
*/
|
|
127
142
|
hasSmoothScrollbar?: boolean;
|
|
128
143
|
/**
|
|
129
144
|
* Defined whether or not the backdrop is visible similar to the backdrop for modal dialogs.
|
|
145
|
+
*
|
|
130
146
|
* @default false
|
|
131
147
|
*/
|
|
132
148
|
makeBackdropVisible?: boolean;
|