@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":"FeedbackReactions.js","sources":["../../../src/components/feedback/FeedbackReactions.tsx"],"sourcesContent":["import React, { type ComponentProps, useRef } from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"FeedbackReactions.js","sources":["../../../src/components/feedback/FeedbackReactions.tsx"],"sourcesContent":["import React, { type ComponentProps, useRef } from 'react';\nimport { motion } from 'motion/react';\n\nimport classNames from '../../utils/classNames';\nimport useHover from '../../hooks/useHover';\n\ntype FeedbackReactionsProps = ComponentProps<'div'> & {\n /**\n * Optional headline inlined with the buttons.\n */\n headline?: React.ReactNode;\n\n /**\n * Size of the reaction buttons.\n *\n * @default 'md'\n */\n size?: 'sm' | 'md';\n\n /**\n * Position of the reaction button labels.\n *\n * @default 'bottom'\n */\n labelPosition?: 'right' | 'bottom';\n\n /**\n * Label for the up button.\n */\n labelUp?: React.ReactNode;\n\n /**\n * Label for the down button.\n */\n labelDown?: React.ReactNode;\n\n /**\n * Custom fill color for the up button.\n *\n * @default 'bg-lightest'\n */\n colorFillUp?: string;\n\n /**\n * Custom fill color for the down button.\n *\n * @default 'bg-lightest'\n */\n colorFillDown?: string;\n\n /**\n * Custom hover color for the up button.\n *\n * @default 'primary'\n */\n colorHoverUp?: string;\n\n /**\n * Custom hover color for the down button.\n *\n * @default 'primary'\n */\n colorHoverDown?: string;\n\n /**\n * Callback function triggered on up vote.\n */\n onVoteUp?: VoidFunction;\n\n /**\n * Callback function triggered on down vote.\n */\n onVoteDown?: VoidFunction;\n\n /**\n * Additional classes applied to the individual reaction item (button and label).\n */\n itemClassName?: string;\n\n /**\n * Defines whether the reaction icon is animated.\n *\n * @default false\n */\n animated?: boolean;\n};\n\nconst FeedbackReactions = (props: FeedbackReactionsProps) => {\n const {\n headline,\n animated,\n labelUp,\n labelDown,\n labelPosition = 'bottom',\n size = 'md',\n colorFillUp = '',\n colorFillDown = '',\n colorHoverUp = 'primary',\n colorHoverDown = 'primary',\n onVoteUp = () => {},\n onVoteDown = () => {},\n itemClassName,\n ...remainingProps\n } = props;\n\n const hasLabels = !!labelUp || !!labelDown;\n\n const wrapperClassName = classNames(\n hasLabels ? 'display-grid grid-cols-2' : 'display-flex',\n 'gap-15',\n 'padding-top-5',\n 'user-select-none'\n );\n\n return (\n <div {...remainingProps} className={wrapperClassName}>\n <FeedbackItem\n size={size}\n fillColor={colorFillDown}\n hoverColor={colorHoverDown}\n animated={animated}\n iconName='thumbs-down'\n text={labelDown}\n labelPosition={labelPosition}\n onClick={onVoteDown}\n className={itemClassName}\n />\n <FeedbackItem\n size={size}\n fillColor={colorFillUp}\n hoverColor={colorHoverUp}\n animated={animated}\n iconName='thumbs-up'\n text={labelUp}\n labelPosition={labelPosition}\n onClick={onVoteUp}\n className={itemClassName}\n />\n </div>\n );\n};\n\ntype FeedbackItemProps = {\n text?: React.ReactNode;\n iconName: string;\n onClick: VoidFunction;\n fillColor: string;\n hoverColor: string;\n animated?: boolean;\n labelPosition?: 'right' | 'bottom';\n size?: 'sm' | 'md';\n className?: string;\n};\n\nconst FeedbackItem = (props: FeedbackItemProps) => {\n const {\n size,\n text,\n iconName,\n onClick,\n fillColor,\n hoverColor,\n animated = false,\n labelPosition = 'bottom',\n className,\n } = props;\n\n const ref = useRef<HTMLDivElement>(null);\n const isHover = useHover(ref);\n\n const iconClasses = classNames(\n size === 'sm' ? 'width-40' : 'width-50',\n 'aspect-ratio-1',\n 'border rounded-circle',\n fillColor ? `bg-${fillColor} text-color-white` : 'bg-lightest',\n isHover ? `border-color-${hoverColor} text-color-${hoverColor}` : 'border-color-lightest',\n 'display-grid place-items-center',\n 'text-size-14'\n );\n\n const wrapperClassName = classNames(\n 'display-flex',\n 'gap-10',\n labelPosition === 'bottom' ? 'flex-column' : '',\n 'align-items-center',\n 'text-center',\n 'cursor-pointer',\n className\n );\n\n const isUp = iconName.includes('up');\n\n return (\n <div ref={ref} className={wrapperClassName} onClick={onClick}>\n <div className={iconClasses}>\n <motion.span\n initial={{ y: 0, rotate: 0 }}\n animate={\n animated && isHover ? { y: [0, isUp ? -3 : 3, 0], rotate: [0, isUp ? -10 : 10, 0] } : { y: 0 }\n }\n transition={{\n duration: 0.6,\n repeat: isHover ? Number.POSITIVE_INFINITY : 0,\n repeatType: 'loop',\n }}\n className={`rioglyph rioglyph-${iconName} text-size-200pct`}\n />\n </div>\n <div\n className={`text-wrap-balance line-height-125rel text-medium ${isHover ? `text-color-${hoverColor}` : 'text-color-darker'}`}\n >\n {text}\n </div>\n </div>\n );\n};\n\nexport default FeedbackReactions;\n"],"names":["FeedbackReactions","props","headline","animated","labelUp","labelDown","labelPosition","size","colorFillUp","colorFillDown","colorHoverUp","colorHoverDown","onVoteUp","onVoteDown","itemClassName","remainingProps","wrapperClassName","classNames","jsxs","jsx","FeedbackItem","text","iconName","onClick","fillColor","hoverColor","className","ref","useRef","isHover","useHover","iconClasses","isUp","motion"],"mappings":";;;;;AAuFA,MAAMA,IAAoB,CAACC,MAAkC;AACzD,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,MAAAC,IAAO;AAAA,IACP,aAAAC,IAAc;AAAA,IACd,eAAAC,IAAgB;AAAA,IAChB,cAAAC,IAAe;AAAA,IACf,gBAAAC,IAAiB;AAAA,IACjB,UAAAC,IAAW,MAAM;AAAA,IAAC;AAAA,IAClB,YAAAC,IAAa,MAAM;AAAA,IAAC;AAAA,IACpB,eAAAC;AAAA,IACA,GAAGC;AAAA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AAkB,WAAW,gBAAgB;AAAA,IAC7C;AAAA,IACA;AAAA,IACA;AAAA,IACAoB;AAAA,EAAA,GAGEM,IAAOV,EAAS,SAAS,IAAI;AAEnC,SACI,gBAAAJ,EAAC,OAAA,EAAI,KAAAS,GAAU,WAAWX,GAAkB,SAAAO,GACxC,UAAA;AAAA,IAAA,gBAAAJ,EAAC,OAAA,EAAI,WAAWY,GACZ,UAAA,gBAAAZ;AAAA,MAACc,EAAO;AAAA,MAAP;AAAA,QACG,SAAS,EAAE,GAAG,GAAG,QAAQ,EAAA;AAAA,QACzB,SACI9B,KAAY0B,IAAU,EAAE,GAAG,CAAC,GAAGG,IAAO,KAAK,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAGA,IAAO,MAAM,IAAI,CAAC,EAAA,IAAM,EAAE,GAAG,EAAA;AAAA,QAE/F,YAAY;AAAA,UACR,UAAU;AAAA,UACV,QAAQH,IAAU,OAAO,oBAAoB;AAAA,UAC7C,YAAY;AAAA,QAAA;AAAA,QAEhB,WAAW,qBAAqBP,CAAQ;AAAA,MAAA;AAAA,IAAA,GAEhD;AAAA,IACA,gBAAAH;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAW,oDAAoDU,IAAU,cAAcJ,CAAU,KAAK,mBAAmB;AAAA,QAExH,UAAAJ;AAAA,MAAA;AAAA,IAAA;AAAA,EACL,GACJ;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePicker.js","sources":["../../../src/components/filepicker/FilePicker.tsx"],"sourcesContent":["import { type ReactNode, useCallback, useEffect, useRef } from 'react';\nimport Dropzone, { type FileRejection, type DropzoneProps, type DropzoneRef } from 'react-dropzone';\nimport { noop } from 'es-toolkit/compat';\n\nimport Button from '../button/Button';\n\ntype FilePickerRenderProps = {\n isDragActive: boolean;\n};\n\nexport type FilePickerProps = {\n /**\n * Defines the file picker display mode.\n *\n * Possible values are `'button'` for a single button, `'dropzone'` for a custom dropzone passed as child function,\n * or `'full'` for showing both.\n *\n * @default 'button'\n */\n displayMode?: 'button' | 'dropzone' | 'full';\n\n /**\n * Indicating if multiple files may be selected.\n *\n * @default true\n */\n multiple?: boolean; // multi select\n\n /**\n * Text to display on Button if displayMode is set to \"button\".\n *\n * @default 'Select files'\n */\n label?: string | ReactNode;\n\n /**\n * Maximum file size in byte. 5 MB = 5,242,880 byte\n */\n maxSize?: number;\n\n /**\n * Function called after one or multiple files have been picked.\n */\n onPick?: (files: File[], rejectedFiles: FileRejection[]) => void;\n\n /**\n * Additional classes for the select button.\n
|
|
1
|
+
{"version":3,"file":"FilePicker.js","sources":["../../../src/components/filepicker/FilePicker.tsx"],"sourcesContent":["import { type ReactNode, useCallback, useEffect, useRef } from 'react';\nimport Dropzone, { type FileRejection, type DropzoneProps, type DropzoneRef } from 'react-dropzone';\nimport { noop } from 'es-toolkit/compat';\n\nimport Button from '../button/Button';\n\ntype FilePickerRenderProps = {\n isDragActive: boolean;\n};\n\nexport type FilePickerProps = {\n /**\n * Defines the file picker display mode.\n *\n * Possible values are `'button'` for a single button, `'dropzone'` for a custom dropzone passed as child function,\n * or `'full'` for showing both.\n *\n * @default 'button'\n */\n displayMode?: 'button' | 'dropzone' | 'full';\n\n /**\n * Indicating if multiple files may be selected.\n *\n * @default true\n */\n multiple?: boolean; // multi select\n\n /**\n * Text to display on Button if displayMode is set to \"button\".\n *\n * @default 'Select files'\n */\n label?: string | ReactNode;\n\n /**\n * Maximum file size in byte. 5 MB = 5,242,880 byte\n */\n maxSize?: number;\n\n /**\n * Function called after one or multiple files have been picked.\n */\n onPick?: (files: File[], rejectedFiles: FileRejection[]) => void;\n\n /**\n * Additional classes for the select button.\n */\n className?: string;\n\n /**\n * Flag to set the dropzone wrapper element to 100% height.\n *\n * This comes in handy, when the dropzone should have 100 % height so it can grow.\n *\n * @default false\n */\n fullHeight?: boolean;\n\n /**\n * Object list of accepted Mime Types as keys and file extensions array as value.\n */\n accept?: { [mimeType: string]: string[] };\n\n /**\n * Pass a custom dropzone element as function receiving some render props.\n */\n children?: ({ isDragActive }: FilePickerRenderProps) => React.ReactElement;\n};\n\nconst FilePicker = (props: FilePickerProps) => {\n const {\n displayMode = 'button',\n multiple = true,\n label = 'Select files',\n maxSize,\n onPick = noop,\n className = '',\n accept,\n fullHeight = false,\n children,\n ...remainingProps\n } = props;\n\n const dropzoneRef = useRef<DropzoneRef>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n const isFull = displayMode === 'full';\n const showButton = isFull || displayMode === 'button';\n const showDropzone = isFull || displayMode === 'dropzone';\n\n const handleDrop: NonNullable<DropzoneProps['onDrop']> = useCallback(\n (acceptedFiles, rejectedFiles) => {\n const hasImagesType = accept && Object.keys(accept).some(mimeType => mimeType.startsWith('image'));\n const files = hasImagesType\n ? acceptedFiles.map(file => Object.assign(file, { preview: URL.createObjectURL(file) }))\n : acceptedFiles;\n\n onPick(files, rejectedFiles);\n },\n [onPick, accept]\n );\n\n const handleClick = () => dropzoneRef.current?.open();\n\n useEffect(() => {\n // Set height to dropzones inner presentation div where there is no other access to this DOM element.\n // This comes in handy, when the dropzone should have 100 % height so it can grow.\n if (wrapperRef.current && fullHeight) {\n wrapperRef.current.querySelector('.FilePicker > div')?.setAttribute('class', 'height-100pct');\n }\n }, [fullHeight, wrapperRef.current]);\n\n return (\n <div ref={wrapperRef} className='FilePicker'>\n {showButton && (\n <Button onClick={handleClick} className={className}>\n {label}\n </Button>\n )}\n <Dropzone\n {...remainingProps}\n onDrop={handleDrop}\n accept={accept}\n multiple={multiple}\n maxSize={maxSize}\n ref={dropzoneRef}\n >\n {({ getRootProps, getInputProps, isDragActive }) => {\n return (\n <div {...getRootProps()}>\n <input {...getInputProps()} />\n {showDropzone && children && children({ isDragActive })}\n </div>\n );\n }}\n </Dropzone>\n </div>\n );\n};\n\nFilePicker.DISPLAY_MODE_BUTTON = 'button' as const;\nFilePicker.DISPLAY_MODE_DROPZONE = 'dropzone' as const;\nFilePicker.DISPLAY_MODE_FULL = 'full' as const;\n\nexport default FilePicker;\n"],"names":["FilePicker","props","displayMode","multiple","label","maxSize","onPick","noop","className","accept","fullHeight","children","remainingProps","dropzoneRef","useRef","wrapperRef","isFull","showButton","showDropzone","handleDrop","useCallback","acceptedFiles","rejectedFiles","files","mimeType","file","handleClick","useEffect","jsxs","jsx","Button","Dropzone","getRootProps","getInputProps","isDragActive"],"mappings":";;;;;AAsEA,MAAMA,IAAa,CAACC,MAA2B;AAC3C,QAAM;AAAA,IACF,aAAAC,IAAc;AAAA,IACd,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ;AAAA,IACR,SAAAC;AAAA,IACA,QAAAC,IAASC;AAAA,IACT,WAAAC,IAAY;AAAA,IACZ,QAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHX,GAEEY,IAAcC,EAAoB,IAAI,GACtCC,IAAaD,EAAuB,IAAI,GAExCE,IAASd,MAAgB,QACzBe,IAAaD,KAAUd,MAAgB,UACvCgB,IAAeF,KAAUd,MAAgB,YAEzCiB,IAAmDC;AAAA,IACrD,CAACC,GAAeC,MAAkB;AAE9B,YAAMC,IADgBd,KAAU,OAAO,KAAKA,CAAM,EAAE,KAAK,CAAAe,MAAYA,EAAS,WAAW,OAAO,CAAC,IAE3FH,EAAc,IAAI,CAAAI,MAAQ,OAAO,OAAOA,GAAM,EAAE,SAAS,IAAI,gBAAgBA,CAAI,EAAA,CAAG,CAAC,IACrFJ;AAEN,MAAAf,EAAOiB,GAAOD,CAAa;AAAA,IAC/B;AAAA,IACA,CAAChB,GAAQG,CAAM;AAAA,EAAA,GAGbiB,IAAc,MAAMb,EAAY,SAAS,KAAA;AAE/C,SAAAc,EAAU,MAAM;AAGZ,IAAIZ,EAAW,WAAWL,KACtBK,EAAW,QAAQ,cAAc,mBAAmB,GAAG,aAAa,SAAS,eAAe;AAAA,EAEpG,GAAG,CAACL,GAAYK,EAAW,OAAO,CAAC,GAG/B,gBAAAa,EAAC,OAAA,EAAI,KAAKb,GAAY,WAAU,cAC3B,UAAA;AAAA,IAAAE,KACG,gBAAAY,EAACC,GAAA,EAAO,SAASJ,GAAa,WAAAlB,GACzB,UAAAJ,GACL;AAAA,IAEJ,gBAAAyB;AAAA,MAACE;AAAA,MAAA;AAAA,QACI,GAAGnB;AAAA,QACJ,QAAQO;AAAA,QACR,QAAAV;AAAA,QACA,UAAAN;AAAA,QACA,SAAAE;AAAA,QACA,KAAKQ;AAAA,QAEJ,UAAA,CAAC,EAAE,cAAAmB,GAAc,eAAAC,GAAe,cAAAC,QAEzB,gBAAAN,EAAC,OAAA,EAAK,GAAGI,EAAA,GACL,UAAA;AAAA,UAAA,gBAAAH,EAAC,SAAA,EAAO,GAAGI,EAAA,EAAc,CAAG;AAAA,UAC3Bf,KAAgBP,KAAYA,EAAS,EAAE,cAAAuB,GAAc;AAAA,QAAA,GAC1D;AAAA,MAER;AAAA,IAAA;AAAA,EACJ,GACJ;AAER;AAEAlC,EAAW,sBAAsB;AACjCA,EAAW,wBAAwB;AACnCA,EAAW,oBAAoB;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as d, useState as g, useEffect as b } from "react";
|
|
3
|
-
import a from "
|
|
3
|
+
import a from "../../utils/classNames.js";
|
|
4
4
|
const w = (f) => {
|
|
5
5
|
const { className: l = "", children: o, supportingText: e, ...n } = f, i = d(null), [t, c] = g(null), u = "htmlFor" in n;
|
|
6
6
|
b(() => {
|
|
@@ -22,13 +22,10 @@ const w = (f) => {
|
|
|
22
22
|
e && "display-inline-flex flex-wrap justify-content-between width-100pct",
|
|
23
23
|
l
|
|
24
24
|
);
|
|
25
|
-
return (
|
|
26
|
-
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
e && /* @__PURE__ */ r("span", { className: m, children: e })
|
|
30
|
-
] })
|
|
31
|
-
);
|
|
25
|
+
return /* @__PURE__ */ p("label", { ref: i, ...n, className: s, children: [
|
|
26
|
+
/* @__PURE__ */ r("span", { children: o }),
|
|
27
|
+
e && /* @__PURE__ */ r("span", { className: m, children: e })
|
|
28
|
+
] });
|
|
32
29
|
}
|
|
33
30
|
const x = a(
|
|
34
31
|
"text-color-dark",
|
|
@@ -42,7 +39,7 @@ const w = (f) => {
|
|
|
42
39
|
l
|
|
43
40
|
);
|
|
44
41
|
return (
|
|
45
|
-
// @ts-
|
|
42
|
+
// @ts-expect-error
|
|
46
43
|
/* @__PURE__ */ p("div", { ref: i, ...n, className: x, children: [
|
|
47
44
|
o,
|
|
48
45
|
e && /* @__PURE__ */ r("span", { className: m, children: e })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLabel.js","sources":["../../../src/components/formLabel/FormLabel.tsx"],"sourcesContent":["import React, { type PropsWithChildren, type ComponentProps, useEffect, useRef, useState } from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"FormLabel.js","sources":["../../../src/components/formLabel/FormLabel.tsx"],"sourcesContent":["import React, { type PropsWithChildren, type ComponentProps, useEffect, useRef, useState } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type FormLabelProps = ComponentProps<'label'> & {\n /**\n * Additional supporting text displayed next to the label.\n */\n supportingText?: string | React.ReactElement;\n\n /**\n * Additional classes set to the outer element.\n */\n className?: string;\n};\n\nconst FormLabel = (props: PropsWithChildren<FormLabelProps>) => {\n const { className = '', children, supportingText, ...remainingProps } = props;\n\n const elementRef = useRef<HTMLDivElement | HTMLLabelElement>(null);\n\n const [parentSize, setParentSize] = useState<'lg' | 'sm' | null>(null);\n\n const isLabel = 'htmlFor' in remainingProps;\n\n useEffect(() => {\n if (!elementRef.current) {\n return;\n }\n\n const parent = elementRef.current.parentElement;\n if (!parent) {\n return;\n }\n\n if (parent.classList.contains('form-group-lg')) {\n setParentSize('lg');\n } else if (parent.classList.contains('form-group-sm')) {\n setParentSize('sm');\n }\n }, []);\n\n const supportingTextClasses = classNames(\n 'text-color-gray',\n typeof supportingText === 'string' && 'text-italic',\n parentSize === 'sm' && 'text-size-10',\n parentSize === 'lg' && 'text-size-14',\n !parentSize && 'text-size-12'\n );\n\n if (isLabel && remainingProps.htmlFor) {\n const labelClasses = classNames(\n !supportingText && 'display-inline-block',\n supportingText && 'display-inline-flex flex-wrap justify-content-between width-100pct',\n className\n );\n\n return (\n <label ref={elementRef as React.RefObject<HTMLLabelElement>} {...remainingProps} className={labelClasses}>\n <span>{children}</span>\n {supportingText && <span className={supportingTextClasses}>{supportingText}</span>}\n </label>\n );\n }\n\n const classes = classNames(\n 'text-color-dark',\n 'max-width-100pct',\n parentSize === 'sm' && 'text-size-10',\n parentSize === 'lg' && 'text-size-14',\n !parentSize && 'text-size-12',\n !supportingText && 'display-inline-block',\n supportingText && 'display-inline-flex flex-wrap justify-content-between width-100pct',\n !className.includes('margin-bottom') && 'margin-bottom-5',\n className\n );\n\n return (\n // @ts-expect-error\n <div ref={elementRef} {...remainingProps} className={classes}>\n {children}\n {supportingText && <span className={supportingTextClasses}>{supportingText}</span>}\n </div>\n );\n};\n\nexport default FormLabel;\n"],"names":["FormLabel","props","className","children","supportingText","remainingProps","elementRef","useRef","parentSize","setParentSize","useState","isLabel","useEffect","parent","supportingTextClasses","classNames","labelClasses","jsx","classes"],"mappings":";;;AAgBA,MAAMA,IAAY,CAACC,MAA6C;AAC5D,QAAM,EAAE,WAAAC,IAAY,IAAI,UAAAC,GAAU,gBAAAC,GAAgB,GAAGC,MAAmBJ,GAElEK,IAAaC,EAA0C,IAAI,GAE3D,CAACC,GAAYC,CAAa,IAAIC,EAA6B,IAAI,GAE/DC,IAAU,aAAaN;AAE7B,EAAAO,EAAU,MAAM;AACZ,QAAI,CAACN,EAAW;AACZ;AAGJ,UAAMO,IAASP,EAAW,QAAQ;AAClC,IAAKO,MAIDA,EAAO,UAAU,SAAS,eAAe,IACzCJ,EAAc,IAAI,IACXI,EAAO,UAAU,SAAS,eAAe,KAChDJ,EAAc,IAAI;AAAA,EAE1B,GAAG,CAAA,CAAE;AAEL,QAAMK,IAAwBC;AAAA,IAC1B;AAAA,IACA,OAAOX,KAAmB,YAAY;AAAA,IACtCI,MAAe,QAAQ;AAAA,IACvBA,MAAe,QAAQ;AAAA,IACvB,CAACA,KAAc;AAAA,EAAA;AAGnB,MAAIG,KAAWN,EAAe,SAAS;AACnC,UAAMW,IAAeD;AAAA,MACjB,CAACX,KAAkB;AAAA,MACnBA,KAAkB;AAAA,MAClBF;AAAA,IAAA;AAGJ,6BACK,SAAA,EAAM,KAAKI,GAAkD,GAAGD,GAAgB,WAAWW,GACxF,UAAA;AAAA,MAAA,gBAAAC,EAAC,UAAM,UAAAd,GAAS;AAAA,MACfC,KAAkB,gBAAAa,EAAC,QAAA,EAAK,WAAWH,GAAwB,UAAAV,EAAA,CAAe;AAAA,IAAA,GAC/E;AAAA,EAER;AAEA,QAAMc,IAAUH;AAAA,IACZ;AAAA,IACA;AAAA,IACAP,MAAe,QAAQ;AAAA,IACvBA,MAAe,QAAQ;AAAA,IACvB,CAACA,KAAc;AAAA,IACf,CAACJ,KAAkB;AAAA,IACnBA,KAAkB;AAAA,IAClB,CAACF,EAAU,SAAS,eAAe,KAAK;AAAA,IACxCA;AAAA,EAAA;AAGJ;AAAA;AAAA,sBAEK,OAAA,EAAI,KAAKI,GAAa,GAAGD,GAAgB,WAAWa,GAChD,UAAA;AAAA,MAAAf;AAAA,MACAC,KAAkB,gBAAAa,EAAC,QAAA,EAAK,WAAWH,GAAwB,UAAAV,EAAA,CAAe;AAAA,IAAA,EAAA,CAC/E;AAAA;AAER;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as d, jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import e from "
|
|
2
|
+
import e from "../../utils/classNames.js";
|
|
3
3
|
import f from "./FormLabel.js";
|
|
4
4
|
const L = (l) => {
|
|
5
5
|
const { label: a, htmlFor: s, labelProps: m = {}, noGap: o = !1, className: r = "", children: n, ...t } = l, { className: c, ...i } = m, b = e(c, o && "margin-bottom-0");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabeledElement.js","sources":["../../../src/components/formLabel/LabeledElement.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"LabeledElement.js","sources":["../../../src/components/formLabel/LabeledElement.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport FormLabel, { type FormLabelProps } from './FormLabel';\n\nexport type LabeledElementProps = {\n /**\n * The text to display for the label.\n */\n label: string | React.ReactElement;\n\n /**\n * Optional ID of the element associated with the label.\n */\n htmlFor?: string;\n\n /**\n * Additional props for the FormLabel, excluding children and htmlFor.\n */\n labelProps?: Omit<FormLabelProps, 'children'>;\n\n /**\n * If true, removes the bottom margin from the label.\n *\n * @default false\n */\n noGap?: boolean;\n\n /**\n * Additional classes for styling the wrapper.\n */\n className?: string;\n};\n\nconst LabeledElement = (props: PropsWithChildren<LabeledElementProps>) => {\n const { label, htmlFor, labelProps = {}, noGap = false, className = '', children, ...remainingProps } = props;\n\n // Extract and handle the `className` prop separately for the label\n const { className: labelClassName, ...otherLabelProps } = labelProps;\n const combinedLabelClassName = classNames(labelClassName, noGap && 'margin-bottom-0');\n\n return (\n <div {...remainingProps} className={classNames('LabeledElement display-flex flex-column', className)}>\n <FormLabel htmlFor={htmlFor} {...otherLabelProps} className={combinedLabelClassName}>\n {label}\n </FormLabel>\n {children}\n </div>\n );\n};\n\nexport default LabeledElement;\n"],"names":["LabeledElement","props","label","htmlFor","labelProps","noGap","className","children","remainingProps","labelClassName","otherLabelProps","combinedLabelClassName","classNames","jsxs","jsx","FormLabel"],"mappings":";;;AAmCA,MAAMA,IAAiB,CAACC,MAAkD;AACtE,QAAM,EAAE,OAAAC,GAAO,SAAAC,GAAS,YAAAC,IAAa,CAAA,GAAI,OAAAC,IAAQ,IAAO,WAAAC,IAAY,IAAI,UAAAC,GAAU,GAAGC,MAAmBP,GAGlG,EAAE,WAAWQ,GAAgB,GAAGC,MAAoBN,GACpDO,IAAyBC,EAAWH,GAAgBJ,KAAS,iBAAiB;AAEpF,SACI,gBAAAQ,EAAC,SAAK,GAAGL,GAAgB,WAAWI,EAAW,2CAA2CN,CAAS,GAC/F,UAAA;AAAA,IAAA,gBAAAQ,EAACC,KAAU,SAAAZ,GAAmB,GAAGO,GAAiB,WAAWC,GACxD,UAAAT,GACL;AAAA,IACCK;AAAA,EAAA,GACL;AAER;"}
|
|
@@ -8,25 +8,26 @@ export type GroupedItemListProps<T> = {
|
|
|
8
8
|
/**
|
|
9
9
|
* The list of items to be grouped and rendered.
|
|
10
10
|
*
|
|
11
|
-
* By default, the component assumes an item object containing an
|
|
11
|
+
* By default, the component assumes an item object containing an `id` and `name` property
|
|
12
12
|
* plus some other attributes.
|
|
13
13
|
*/
|
|
14
14
|
items: T[];
|
|
15
15
|
/**
|
|
16
16
|
* The property of the items to group by as a string, or a custom group function.
|
|
17
|
-
* Defaults to
|
|
17
|
+
* Defaults to `name` if not provided.
|
|
18
18
|
*
|
|
19
19
|
* @default 'name'
|
|
20
20
|
*/
|
|
21
21
|
groupBy?: keyof T | ((item: T) => string);
|
|
22
22
|
/**
|
|
23
|
-
* The order in which to sort the groups. Accepts
|
|
24
|
-
* @default 'asc'
|
|
23
|
+
* The order in which to sort the groups. Accepts `asc` for ascending or `desc` for descending.
|
|
24
|
+
* @default 'asc'
|
|
25
25
|
*/
|
|
26
26
|
groupSortOrder?: SortDirectionType;
|
|
27
27
|
/**
|
|
28
|
-
* The order in which to sort the items inside a group. Accepts
|
|
29
|
-
*
|
|
28
|
+
* The order in which to sort the items inside a group. Accepts `asc` for ascending or `desc` for descending.
|
|
29
|
+
*
|
|
30
|
+
* @default 'asc'
|
|
30
31
|
*/
|
|
31
32
|
itemSortOrder?: SortDirectionType;
|
|
32
33
|
/**
|
|
@@ -49,7 +50,9 @@ export type GroupedItemListProps<T> = {
|
|
|
49
50
|
renderItem?: (item: T) => React.ReactNode;
|
|
50
51
|
/**
|
|
51
52
|
* Specifies the HTML element to use for the list inside each group.
|
|
52
|
-
* Default is
|
|
53
|
+
* Default is `div`. Use `ul` for rendering the list items as `<li>` elements.
|
|
54
|
+
*
|
|
55
|
+
* @default 'div'
|
|
53
56
|
*/
|
|
54
57
|
listElement?: 'div' | 'ul';
|
|
55
58
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupedItemList.js","sources":["../../../src/components/groupedItemList/GroupedItemList.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { naturalSortByProperty, sortByProperty, type SortDirectionType } from '../../SortUtils';\n\nexport type Group = {\n groupKey: string;\n items: any[];\n};\n\nexport type GroupedItemListProps<T> = {\n /**\n * The list of items to be grouped and rendered.\n *\n * By default, the component assumes an item object containing an
|
|
1
|
+
{"version":3,"file":"GroupedItemList.js","sources":["../../../src/components/groupedItemList/GroupedItemList.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { naturalSortByProperty, sortByProperty, type SortDirectionType } from '../../SortUtils';\n\nexport type Group = {\n groupKey: string;\n items: any[];\n};\n\nexport type GroupedItemListProps<T> = {\n /**\n * The list of items to be grouped and rendered.\n *\n * By default, the component assumes an item object containing an `id` and `name` property\n * plus some other attributes.\n */\n items: T[];\n\n /**\n * The property of the items to group by as a string, or a custom group function.\n * Defaults to `name` if not provided.\n *\n * @default 'name'\n */\n groupBy?: keyof T | ((item: T) => string);\n\n /**\n * The order in which to sort the groups. Accepts `asc` for ascending or `desc` for descending.\n * @default 'asc'\n */\n groupSortOrder?: SortDirectionType;\n\n /**\n * The order in which to sort the items inside a group. Accepts `asc` for ascending or `desc` for descending.\n *\n * @default 'asc'\n */\n itemSortOrder?: SortDirectionType;\n\n /**\n * Sorting function for the groups.\n */\n groupSortFunction?: (groups: Group[]) => Group[];\n\n /**\n * Sorting function for the items within each group.\n */\n itemSortFunction?: (items: T[]) => T[];\n\n /**\n * A custom render function for the group divider.\n * Receives the group key (e.g., letter or date) as a parameter.\n */\n renderDivider?: (groupKey: string) => React.ReactNode;\n\n /**\n * A custom render function for individual list items.\n * Receives an item as a parameter.\n */\n renderItem?: (item: T) => React.ReactNode;\n\n /**\n * Specifies the HTML element to use for the list inside each group.\n * Default is `div`. Use `ul` for rendering the list items as `<li>` elements.\n *\n * @default 'div'\n */\n listElement?: 'div' | 'ul';\n\n /**\n * Optional class name for the list element inside each group.\n * Applied to the `div` or `ul` wrapping the items.\n */\n listElementClassName?: string;\n\n /**\n * Optional class name for the divider element in each group.\n * Applied to the `div` wrapping each group divider.\n */\n dividerElementClassName?: string;\n\n /**\n * Optional class name for the outer wrapper element.\n * Applied to the outer `div` wrapping the entire component.\n */\n className?: string;\n};\n\n/**\n * A React component that groups and renders a list of items based on a specified property.\n * The component can be customized to render dividers and list items in different styles.\n *\n * @param {GroupedItemListProps} props - The props for the component.\n * @returns {JSX.Element} The grouped and rendered list component.\n */\nconst GroupedItemList = <T,>(props: GroupedItemListProps<T>) => {\n const {\n items,\n groupBy = 'name',\n groupSortOrder = 'asc', // Default to ascending order if not specified\n groupSortFunction,\n itemSortFunction,\n itemSortOrder = 'asc', // Default to ascending order if not specified\n renderDivider,\n renderItem,\n listElement = 'div', // Default to 'div' if not specified\n listElementClassName,\n dividerElementClassName,\n className,\n } = props;\n\n // Default group sorting function or specific function provided\n const groupSortFn = groupSortFunction\n ? groupSortFunction\n : (groups: Group[]) => naturalSortByProperty(groups, 'groupKey', groupSortOrder);\n\n // Default item sorting within groups or specific function provided\n const itemSortFn = itemSortFunction\n ? itemSortFunction\n : (itemsToSort: T[]) => sortByProperty(itemsToSort, groupBy as keyof T, itemSortOrder);\n\n // Determine the grouping function based on the type of groupBy\n // const getGroupKey = (item: T): string => {\n // if (typeof groupBy === 'string') {\n // if (groupBy === 'name') {\n // return (item as any).name?.[0]?.toUpperCase() ?? '';\n // }\n // return (item as any)[groupBy]?.toString() ?? '';\n // } else if (typeof groupBy === 'function') {\n // return groupBy(item);\n // }\n // throw new Error('Please define a \"groupBy\" property as a string or function.');\n // };\n\n const getGroupKey =\n typeof groupBy === 'function'\n ? groupBy\n : (item: T) => ((item as any)[groupBy] as string)?.[0]?.toUpperCase() ?? '';\n\n // Group items by the specified property\n // const allGroups = useMemo(\n // () =>\n // items.reduce<Record<string, T[]>>((acc, item) => {\n // const groupKey = getGroupKey(item);\n // if (!acc[groupKey]) {\n // acc[groupKey] = [];\n // }\n // acc[groupKey].push(item);\n // return acc;\n // }, {}),\n // [items, getGroupKey]\n // );\n\n // Group items by the specified property\n const groupedItems = useMemo(() => {\n // Explicitly typing the accumulator as Record<string, T[]>\n const groups: Record<string, T[]> = items.reduce(\n (acc: Record<string, T[]>, item: T) => {\n const groupKey = getGroupKey(item);\n if (!acc[groupKey]) {\n acc[groupKey] = [];\n }\n acc[groupKey].push(item);\n return acc;\n },\n {} as Record<string, T[]>\n );\n\n return Object.keys(groups).map(groupKey => ({\n groupKey,\n items: groups[groupKey],\n }));\n }, [items, getGroupKey]);\n\n // Assign the specified list element ('div' or 'ul')\n const ListElement = listElement;\n\n // Sort groups using the provided sort function\n const sortedGroups = useMemo(() => groupSortFn(groupedItems), [groupedItems, groupSortFn]);\n\n return (\n <div className={`grouped-item-list ${className ?? ''}`}>\n {sortedGroups.map(group => (\n <React.Fragment key={group.groupKey}>\n <div className={`group-divider ${dividerElementClassName ?? ''}`}>\n {renderDivider ? renderDivider(group.groupKey) : group.groupKey}\n </div>\n <ListElement className={listElementClassName}>\n {itemSortFn(group.items).map(item =>\n renderItem ? (\n renderItem(item)\n ) : (\n <React.Fragment key={(item as any).id ?? crypto.randomUUID()}>\n <div className='item-name'>{(item as any).name}</div>\n </React.Fragment>\n )\n )}\n </ListElement>\n </React.Fragment>\n ))}\n </div>\n );\n};\n\nexport default GroupedItemList;\n"],"names":["GroupedItemList","props","items","groupBy","groupSortOrder","groupSortFunction","itemSortFunction","itemSortOrder","renderDivider","renderItem","listElement","listElementClassName","dividerElementClassName","className","groupSortFn","groups","naturalSortByProperty","itemSortFn","itemsToSort","sortByProperty","getGroupKey","item","groupedItems","useMemo","acc","groupKey","ListElement","sortedGroups","jsx","group","jsxs","React"],"mappings":";;;AA+FA,MAAMA,IAAkB,CAAKC,MAAmC;AAC5D,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,gBAAAC,IAAiB;AAAA;AAAA,IACjB,mBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA;AAAA,IAChB,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC,IAAc;AAAA;AAAA,IACd,sBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,WAAAC;AAAA,EAAA,IACAZ,GAGEa,IAAcT,MAEd,CAACU,MAAoBC,EAAsBD,GAAQ,YAAYX,CAAc,IAG7Ea,IAAaX,MAEb,CAACY,MAAqBC,EAAeD,GAAaf,GAAoBI,CAAa,IAenFa,IACF,OAAOjB,KAAY,aACbA,IACA,CAACkB,MAAcA,EAAalB,CAAO,IAAe,CAAC,GAAG,iBAAiB,IAiB3EmB,IAAeC,EAAQ,MAAM;AAE/B,UAAMR,IAA8Bb,EAAM;AAAA,MACtC,CAACsB,GAA0BH,MAAY;AACnC,cAAMI,IAAWL,EAAYC,CAAI;AACjC,eAAKG,EAAIC,CAAQ,MACbD,EAAIC,CAAQ,IAAI,CAAA,IAEpBD,EAAIC,CAAQ,EAAE,KAAKJ,CAAI,GAChBG;AAAA,MACX;AAAA,MACA,CAAA;AAAA,IAAC;AAGL,WAAO,OAAO,KAAKT,CAAM,EAAE,IAAI,CAAAU,OAAa;AAAA,MACxC,UAAAA;AAAA,MACA,OAAOV,EAAOU,CAAQ;AAAA,IAAA,EACxB;AAAA,EACN,GAAG,CAACvB,GAAOkB,CAAW,CAAC,GAGjBM,IAAchB,GAGdiB,IAAeJ,EAAQ,MAAMT,EAAYQ,CAAY,GAAG,CAACA,GAAcR,CAAW,CAAC;AAEzF,SACI,gBAAAc,EAAC,OAAA,EAAI,WAAW,qBAAqBf,KAAa,EAAE,IAC/C,UAAAc,EAAa,IAAI,CAAAE,MACd,gBAAAC,EAACC,EAAM,UAAN,EACG,UAAA;AAAA,IAAA,gBAAAH,EAAC,OAAA,EAAI,WAAW,iBAAiBhB,KAA2B,EAAE,IACzD,UAAAJ,IAAgBA,EAAcqB,EAAM,QAAQ,IAAIA,EAAM,UAC3D;AAAA,sBACCH,GAAA,EAAY,WAAWf,GACnB,UAAAM,EAAWY,EAAM,KAAK,EAAE;AAAA,MAAI,CAAAR,MACzBZ,IACIA,EAAWY,CAAI,IAEf,gBAAAO,EAACG,EAAM,UAAN,EACG,UAAA,gBAAAH,EAAC,SAAI,WAAU,aAAc,YAAa,KAAA,CAAK,EAAA,GAD7BP,EAAa,MAAM,OAAO,YAEhD;AAAA,IAAA,EAER,CACJ;AAAA,EAAA,EAAA,GAdiBQ,EAAM,QAe3B,CACH,GACL;AAER;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as i, useRef as b, useEffect as x } from "react";
|
|
3
3
|
import { isEmpty as _ } from "es-toolkit/compat";
|
|
4
|
-
import j from "
|
|
4
|
+
import j from "../../utils/classNames.js";
|
|
5
5
|
import A from "../../hooks/useEffectOnce.js";
|
|
6
6
|
import D from "../clearableInput/ClearableInput.js";
|
|
7
7
|
import G from "../expander/ExpanderPanel.js";
|
|
@@ -87,10 +87,7 @@ const J = 10, Q = 580, U = (n, s, r) => n.map((o) => ({
|
|
|
87
87
|
h && h
|
|
88
88
|
] }) }),
|
|
89
89
|
!Y(I) && /* @__PURE__ */ t("div", { className: "padding-top-25 text-center text-color-gray", children: L }),
|
|
90
|
-
I.map((e, p) => (
|
|
91
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: using a random key would re-render the list every time the parent updates
|
|
92
|
-
/* @__PURE__ */ t(V, { className: k, menuGroup: e }, p)
|
|
93
|
-
))
|
|
90
|
+
I.map((e, p) => /* @__PURE__ */ t(V, { className: k, menuGroup: e }, p))
|
|
94
91
|
] });
|
|
95
92
|
return f && T ? /* @__PURE__ */ t(
|
|
96
93
|
G,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListMenu.js","sources":["../../../src/components/listMenu/ListMenu.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: <explanation>\nimport React, { useEffect, useRef, useState, type MouseEvent, type ReactNode } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\nimport classNames from 'classnames';\n\nimport useEffectOnce from '../../hooks/useEffectOnce';\nimport ClearableInput from '../clearableInput/ClearableInput';\nimport ExpanderPanel from '../expander/ExpanderPanel';\nimport ListMenuGroup, { type ListMenuNavItem, type ListMenuItem } from './ListMenuGroup';\nimport useEsc from '../../hooks/useEsc';\nimport useWindowResize from '../../hooks/useWindowResize';\nimport useKey from '../../hooks/useKey';\nimport { debounce } from 'es-toolkit/function';\n\nexport type { ListMenuNavItem, ListMenuItem } from './ListMenuGroup';\n\nconst RESIZE_THROTTLING = 10;\nconst MOBILE_MAX_WIDTH = 580;\n\nconst filterMenuItems = <T extends ListMenuNavItem>(\n items: ListMenuItem<T>[],\n value: string,\n filterKey: keyof T\n): ListMenuItem<T>[] =>\n items.map(item => ({\n ...item,\n navItems: item.navItems.filter(navItem =>\n (navItem[filterKey] as string).toLowerCase().includes(value.toLowerCase())\n ),\n }));\n\nconst hasMenuItems = <T extends ListMenuNavItem>(items: ListMenuItem<T>[]) =>\n items.find(({ navItems }) => !isEmpty(navItems));\n\nexport type ListMenuProps<T extends ListMenuNavItem> = {\n /**\n * List of menu item groups to be shown.\n */\n menuItems: ListMenuItem<T>[];\n\n /**\n * Enables the filter.\n *\n * @default false\n */\n enableFilter?: boolean;\n\n /**\n * Focus the filter input.\n *\n * @default false\n */\n focusFilter?: boolean;\n\n /**\n * Define the attribute key for filtering.\n *\n * @default 'key'\n */\n filterKey?: keyof T;\n\n /**\n * The placeholder text for the filter input.\n */\n filterPlaceholder?: string;\n\n /**\n * Gets called when the filter input changes.\n *\n * @param value\n * @returns\n */\n onFilterChange?: (value: string) => void;\n\n /**\n * A localized message to be shown when the filter result is empty.\n */\n notFoundMessage?: string | ReactNode;\n\n /**\n * The menu uses collapses on smaller screens using an expander panel.\n *\n * @default true\n */\n responsive?: boolean;\n\n /**\n * Enables automatic closing of the expander panel.\n *\n * Only relevant when using the `responsive` flag. Note: Make sure to not stop the events from bubbling up when\n * clicking on a list item!\n *\n * Using `event.stopPropagation()` will prevent the panel from closing.\n *\n * @default true\n */\n autoClose?: boolean;\n\n /**\n * Additional classes to be set on the menu group element.\n */\n groupClassName?: string;\n\n /**\n * Additional addon for the input group.\n */\n trailingInputAddon?: React.ReactNode;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n};\n\nconst ListMenu = <T extends ListMenuNavItem>(props: ListMenuProps<T>) => {\n const {\n menuItems,\n focusFilter = false,\n enableFilter = false,\n filterPlaceholder,\n onFilterChange = () => {},\n notFoundMessage,\n className = '',\n groupClassName = '',\n responsive = true,\n autoClose = true,\n filterKey = 'key',\n trailingInputAddon,\n ...remainingProps\n } = props;\n\n const [filterValue, setFilterValue] = useState('');\n const [isMobileMode, setIsMobileMode] = useState(false);\n const [isExpanderOpen, setIsExpanderOpen] = useState(false);\n const [mobileHeader, setMobileHeader] = useState<ReactNode>('');\n\n const inputRef = useRef<HTMLInputElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n\n const buildMobileHeader = () => {\n if (responsive && listRef.current) {\n const [activeElement] = listRef.current.getElementsByClassName('active') as HTMLCollectionOf<HTMLElement>;\n setMobileHeader(\n <div className='display-flex align-items-center'>\n <span className='rioglyph rioglyph-menu-hamburger margin-right-10' />\n <span>{activeElement?.innerText}</span>\n </div>\n );\n }\n };\n\n // clear filter input on esc\n useEsc(() => {\n if (enableFilter && inputRef.current === document.activeElement) {\n setFilterValue('');\n }\n });\n\n // Convert the menu to an expandable panel for smaller screens\n const handleMobileSize = debounce(() => {\n buildMobileHeader();\n setIsMobileMode(window.innerWidth < MOBILE_MAX_WIDTH);\n }, RESIZE_THROTTLING);\n\n // Render a dropdown menu on mobile on mount\n useEffect(handleMobileSize, []);\n\n useWindowResize(handleMobileSize);\n\n const focusInput = () => {\n inputRef.current?.focus();\n };\n\n useKey((event: KeyboardEvent) => {\n if ((event.metaKey || event.ctrlKey) && event.key === 'k') {\n event.preventDefault();\n focusInput();\n }\n });\n\n // Focus filter input if requested\n useEffectOnce(() => {\n focusFilter && focusInput();\n });\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => buildMobileHeader, [menuItems]);\n\n const handleClear = () => focusFilter && focusInput();\n\n const handleFilterChange = (value: string) => {\n setFilterValue(value);\n onFilterChange(value);\n };\n\n const filteredMenuItems = filterMenuItems(menuItems, filterValue, filterKey);\n\n const handleExpanderBodyClick = (event: MouseEvent) => {\n const isListItem = (event.target as HTMLDivElement).parentElement?.tagName.toLowerCase() === 'li';\n if (autoClose && isListItem) {\n setIsExpanderOpen(false);\n }\n };\n\n const formClassNames = classNames(\n 'form-group',\n 'margin-bottom-5',\n 'padding-left-15',\n 'padding-right-15',\n 'padding-bottom-15',\n 'position-sticky',\n 'top-0',\n 'z-index-1'\n );\n\n const listMenu = (\n <div {...remainingProps} className={`ListMenu ${className} ${filterValue ? 'filtered' : ''}`} ref={listRef}>\n {enableFilter && (\n <div className={formClassNames}>\n <div className='input-group width-100pct'>\n <span className='input-group-addon'>\n <span className='rioglyph rioglyph-search' aria-hidden='true' />\n </span>\n <ClearableInput\n value={filterValue}\n inputRef={inputRef}\n placeholder={filterPlaceholder}\n onChange={handleFilterChange}\n onClear={handleClear}\n />\n {trailingInputAddon && trailingInputAddon}\n </div>\n </div>\n )}\n\n {!hasMenuItems(filteredMenuItems) && (\n <div className='padding-top-25 text-center text-color-gray'>{notFoundMessage}</div>\n )}\n\n {filteredMenuItems.map((menuGroup, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: using a random key would re-render the list every time the parent updates\n <ListMenuGroup key={index} className={groupClassName} menuGroup={menuGroup} />\n ))}\n </div>\n );\n\n if (responsive && isMobileMode) {\n return (\n <ExpanderPanel\n title={mobileHeader}\n bsStyle='default'\n open={isExpanderOpen}\n onToggle={() => setIsExpanderOpen(!isExpanderOpen)}\n unmountOnExit={false}\n className='shadow-default'\n >\n <div onClick={handleExpanderBodyClick}>{listMenu}</div>\n </ExpanderPanel>\n );\n }\n\n return listMenu;\n};\n\nexport default ListMenu;\n"],"names":["RESIZE_THROTTLING","MOBILE_MAX_WIDTH","filterMenuItems","items","value","filterKey","item","navItem","hasMenuItems","navItems","isEmpty","ListMenu","props","menuItems","focusFilter","enableFilter","filterPlaceholder","onFilterChange","notFoundMessage","className","groupClassName","responsive","autoClose","trailingInputAddon","remainingProps","filterValue","setFilterValue","useState","isMobileMode","setIsMobileMode","isExpanderOpen","setIsExpanderOpen","mobileHeader","setMobileHeader","inputRef","useRef","listRef","buildMobileHeader","activeElement","jsxs","jsx","useEsc","handleMobileSize","debounce","useEffect","useWindowResize","focusInput","useKey","event","useEffectOnce","handleClear","handleFilterChange","filteredMenuItems","handleExpanderBodyClick","isListItem","formClassNames","classNames","listMenu","ClearableInput","menuGroup","index","ListMenuGroup","ExpanderPanel"],"mappings":";;;;;;;;;;;;AAgBA,MAAMA,IAAoB,IACpBC,IAAmB,KAEnBC,IAAkB,CACpBC,GACAC,GACAC,MAEAF,EAAM,IAAI,CAAAG,OAAS;AAAA,EACf,GAAGA;AAAA,EACH,UAAUA,EAAK,SAAS;AAAA,IAAO,CAAAC,MAC1BA,EAAQF,CAAS,EAAa,cAAc,SAASD,EAAM,YAAA,CAAa;AAAA,EAAA;AAEjF,EAAE,GAEAI,IAAe,CAA4BL,MAC7CA,EAAM,KAAK,CAAC,EAAE,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UACG,OAAOjC;AAAA,UACP,UAAAS;AAAA,UACA,aAAalB;AAAA,UACb,UAAUmC;AAAA,UACV,SAASD;AAAA,QAAA;AAAA,MAAA;AAAA,MAEZ3B,KAAsBA;AAAA,IAAA,EAAA,CAC3B,EAAA,CACJ;AAAA,IAGH,CAACf,EAAa4C,CAAiB,uBAC3B,OAAA,EAAI,WAAU,8CAA8C,UAAAlC,GAAgB;AAAA,IAGhFkC,EAAkB,IAAI,CAACO,GAAWC;AAAA;AAAA,MAE/B,gBAAApB,EAACqB,GAAA,EAA0B,WAAWzC,GAAgB,WAAAuC,KAAlCC,CAAwD;AAAA,KAC/E;AAAA,EAAA,GACL;AAGJ,SAAIvC,KAAcO,IAEV,gBAAAY;AAAA,IAACsB;AAAA,IAAA;AAAA,MACG,OAAO9B;AAAA,MACP,SAAQ;AAAA,MACR,MAAMF;AAAA,MACN,UAAU,MAAMC,EAAkB,CAACD,CAAc;AAAA,MACjD,eAAe;AAAA,MACf,WAAU;AAAA,MAEV,UAAA,gBAAAU,EAAC,OAAA,EAAI,SAASa,GAA0B,UAAAI,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA,IAKtDA;AACX;"}
|
|
1
|
+
{"version":3,"file":"ListMenu.js","sources":["../../../src/components/listMenu/ListMenu.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, type MouseEvent, type ReactNode } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\n\nimport classNames from '../../utils/classNames';\nimport useEffectOnce from '../../hooks/useEffectOnce';\nimport ClearableInput from '../clearableInput/ClearableInput';\nimport ExpanderPanel from '../expander/ExpanderPanel';\nimport ListMenuGroup, { type ListMenuNavItem, type ListMenuItem } from './ListMenuGroup';\nimport useEsc from '../../hooks/useEsc';\nimport useWindowResize from '../../hooks/useWindowResize';\nimport useKey from '../../hooks/useKey';\nimport { debounce } from 'es-toolkit/function';\n\nexport type { ListMenuNavItem, ListMenuItem } from './ListMenuGroup';\n\nconst RESIZE_THROTTLING = 10;\nconst MOBILE_MAX_WIDTH = 580;\n\nconst filterMenuItems = <T extends ListMenuNavItem>(\n items: ListMenuItem<T>[],\n value: string,\n filterKey: keyof T\n): ListMenuItem<T>[] =>\n items.map(item => ({\n ...item,\n navItems: item.navItems.filter(navItem =>\n (navItem[filterKey] as string).toLowerCase().includes(value.toLowerCase())\n ),\n }));\n\nconst hasMenuItems = <T extends ListMenuNavItem>(items: ListMenuItem<T>[]) =>\n items.find(({ navItems }) => !isEmpty(navItems));\n\nexport type ListMenuProps<T extends ListMenuNavItem> = {\n /**\n * List of menu item groups to be shown.\n */\n menuItems: ListMenuItem<T>[];\n\n /**\n * Enables the filter.\n *\n * @default false\n */\n enableFilter?: boolean;\n\n /**\n * Focus the filter input.\n *\n * @default false\n */\n focusFilter?: boolean;\n\n /**\n * Define the attribute key for filtering.\n *\n * @default 'key'\n */\n filterKey?: keyof T;\n\n /**\n * The placeholder text for the filter input.\n */\n filterPlaceholder?: string;\n\n /**\n * Gets called when the filter input changes.\n *\n * @param value\n * @returns\n */\n onFilterChange?: (value: string) => void;\n\n /**\n * A localized message to be shown when the filter result is empty.\n */\n notFoundMessage?: string | ReactNode;\n\n /**\n * The menu uses collapses on smaller screens using an expander panel.\n *\n * @default true\n */\n responsive?: boolean;\n\n /**\n * Enables automatic closing of the expander panel.\n *\n * Only relevant when using the `responsive` flag. Note: Make sure to not stop the events from bubbling up when\n * clicking on a list item!\n *\n * Using `event.stopPropagation()` will prevent the panel from closing.\n *\n * @default true\n */\n autoClose?: boolean;\n\n /**\n * Additional classes to be set on the menu group element.\n */\n groupClassName?: string;\n\n /**\n * Additional addon for the input group.\n */\n trailingInputAddon?: React.ReactNode;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n};\n\nconst ListMenu = <T extends ListMenuNavItem>(props: ListMenuProps<T>) => {\n const {\n menuItems,\n focusFilter = false,\n enableFilter = false,\n filterPlaceholder,\n onFilterChange = () => {},\n notFoundMessage,\n className = '',\n groupClassName = '',\n responsive = true,\n autoClose = true,\n filterKey = 'key',\n trailingInputAddon,\n ...remainingProps\n } = props;\n\n const [filterValue, setFilterValue] = useState('');\n const [isMobileMode, setIsMobileMode] = useState(false);\n const [isExpanderOpen, setIsExpanderOpen] = useState(false);\n const [mobileHeader, setMobileHeader] = useState<ReactNode>('');\n\n const inputRef = useRef<HTMLInputElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n\n const buildMobileHeader = () => {\n if (responsive && listRef.current) {\n const [activeElement] = listRef.current.getElementsByClassName('active') as HTMLCollectionOf<HTMLElement>;\n setMobileHeader(\n <div className='display-flex align-items-center'>\n <span className='rioglyph rioglyph-menu-hamburger margin-right-10' />\n <span>{activeElement?.innerText}</span>\n </div>\n );\n }\n };\n\n // clear filter input on esc\n useEsc(() => {\n if (enableFilter && inputRef.current === document.activeElement) {\n setFilterValue('');\n }\n });\n\n // Convert the menu to an expandable panel for smaller screens\n const handleMobileSize = debounce(() => {\n buildMobileHeader();\n setIsMobileMode(window.innerWidth < MOBILE_MAX_WIDTH);\n }, RESIZE_THROTTLING);\n\n // Render a dropdown menu on mobile on mount\n useEffect(handleMobileSize, []);\n\n useWindowResize(handleMobileSize);\n\n const focusInput = () => {\n inputRef.current?.focus();\n };\n\n useKey((event: KeyboardEvent) => {\n if ((event.metaKey || event.ctrlKey) && event.key === 'k') {\n event.preventDefault();\n focusInput();\n }\n });\n\n // Focus filter input if requested\n useEffectOnce(() => {\n focusFilter && focusInput();\n });\n\n useEffect(() => buildMobileHeader, [menuItems]);\n\n const handleClear = () => focusFilter && focusInput();\n\n const handleFilterChange = (value: string) => {\n setFilterValue(value);\n onFilterChange(value);\n };\n\n const filteredMenuItems = filterMenuItems(menuItems, filterValue, filterKey);\n\n const handleExpanderBodyClick = (event: MouseEvent) => {\n const isListItem = (event.target as HTMLDivElement).parentElement?.tagName.toLowerCase() === 'li';\n if (autoClose && isListItem) {\n setIsExpanderOpen(false);\n }\n };\n\n const formClassNames = classNames(\n 'form-group',\n 'margin-bottom-5',\n 'padding-left-15',\n 'padding-right-15',\n 'padding-bottom-15',\n 'position-sticky',\n 'top-0',\n 'z-index-1'\n );\n\n const listMenu = (\n <div {...remainingProps} className={`ListMenu ${className} ${filterValue ? 'filtered' : ''}`} ref={listRef}>\n {enableFilter && (\n <div className={formClassNames}>\n <div className='input-group width-100pct'>\n <span className='input-group-addon'>\n <span className='rioglyph rioglyph-search' aria-hidden='true' />\n </span>\n <ClearableInput\n value={filterValue}\n inputRef={inputRef}\n placeholder={filterPlaceholder}\n onChange={handleFilterChange}\n onClear={handleClear}\n />\n {trailingInputAddon && trailingInputAddon}\n </div>\n </div>\n )}\n\n {!hasMenuItems(filteredMenuItems) && (\n <div className='padding-top-25 text-center text-color-gray'>{notFoundMessage}</div>\n )}\n\n {filteredMenuItems.map((menuGroup, index) => (\n <ListMenuGroup key={index} className={groupClassName} menuGroup={menuGroup} />\n ))}\n </div>\n );\n\n if (responsive && isMobileMode) {\n return (\n <ExpanderPanel\n title={mobileHeader}\n bsStyle='default'\n open={isExpanderOpen}\n onToggle={() => setIsExpanderOpen(!isExpanderOpen)}\n unmountOnExit={false}\n className='shadow-default'\n >\n <div onClick={handleExpanderBodyClick}>{listMenu}</div>\n </ExpanderPanel>\n );\n }\n\n return listMenu;\n};\n\nexport default ListMenu;\n"],"names":["RESIZE_THROTTLING","MOBILE_MAX_WIDTH","filterMenuItems","items","value","filterKey","item","navItem","hasMenuItems","navItems","isEmpty","ListMenu","props","menuItems","focusFilter","enableFilter","filterPlaceholder","onFilterChange","notFoundMessage","className","groupClassName","responsive","autoClose","trailingInputAddon","remainingProps","filterValue","setFilterValue","useState","isMobileMode","setIsMobileMode","isExpanderOpen","setIsExpanderOpen","mobileHeader","setMobileHeader","inputRef","useRef","listRef","buildMobileHeader","activeElement","jsxs","jsx","useEsc","handleMobileSize","debounce","useEffect","useWindowResize","focusInput","useKey","event","useEffectOnce","handleClear","handleFilterChange","filteredMenuItems","handleExpanderBodyClick","isListItem","formClassNames","classNames","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`<a>`, `<NavLink>`, `<Link>`, `<span>` or even a `<FormattedMessage>`.
|
|
13
13
|
*/
|
|
14
14
|
item: string | ReactNode;
|
|
15
15
|
/**
|
|
@@ -49,6 +49,7 @@ export type ListMenuItem<T extends ListMenuNavItem = ListMenuNavItem> = {
|
|
|
49
49
|
* The type of badge to display.
|
|
50
50
|
*
|
|
51
51
|
* Determines the visual style of the badge. Available types include:
|
|
52
|
+
*
|
|
52
53
|
* - `muted`: A subdued badge style.
|
|
53
54
|
* - `success`: Indicates a successful state.
|
|
54
55
|
* - `info`: Represents informational content.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import l from "
|
|
2
|
+
import l from "../../utils/classNames.js";
|
|
3
3
|
import i from "./ListMenuHeader.js";
|
|
4
4
|
const o = ({ menuGroup: e, className: r }) => e.navItems.length ? /* @__PURE__ */ t("ul", { className: `ListMenuGroup ${r}`, children: [
|
|
5
5
|
/* @__PURE__ */ a(i, { ...e }),
|
|
6
|
-
e.navItems.map((s) => /* @__PURE__ */ a("li", { className: l(
|
|
6
|
+
e.navItems.map((s) => /* @__PURE__ */ a("li", { className: l(s.disabled && "disabled", s.isSubItem && "subitem"), children: s.item }, s.key))
|
|
7
7
|
] }) : null;
|
|
8
8
|
export {
|
|
9
9
|
o as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListMenuGroup.js","sources":["../../../src/components/listMenu/ListMenuGroup.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"ListMenuGroup.js","sources":["../../../src/components/listMenu/ListMenuGroup.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport ListMenuHeader from './ListMenuHeader';\n\nexport type ListMenuNavItem = {\n /**\n * The name or key of the menu nav item.\n *\n * This key will be used for filtering, hence it should match the translated menu item name.\n */\n key: string;\n\n /**\n * The menu nav item itself.\n *\n * This can be a simple `<a>`, `<NavLink>`, `<Link>`, `<span>` or even a `<FormattedMessage>`.\n */\n item: string | ReactNode;\n\n /**\n * Disables the list item.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Whether the current menu item is a child of another menu item.\n */\n isSubItem?: boolean;\n} & {\n [otherFilterKey: Exclude<string, 'key' | 'item' | 'disabled' | 'isSubItem'>]: unknown;\n};\n\nexport type ListMenuItem<T extends ListMenuNavItem = ListMenuNavItem> = {\n /**\n * The optional group header to be shown.\n *\n * This can also be a component such as a `FormattedMessage`.\n */\n group?: string | ReactNode;\n\n /**\n * The optional group header link to be shown.\n *\n * This can be a link component such as `NavLink` or `Link`. This way, the header can be a link itself. In this\n * case, the `group` prop can be omitted.\n */\n groupNavItem?: string | ReactNode;\n\n /**\n * The optional badge displayed alongside the group or nav items.\n *\n * This can be text or a React node for additional flexibility.\n */\n badge?: string | ReactNode;\n\n /**\n * The type of badge to display.\n *\n * Determines the visual style of the badge. Available types include:\n *\n * - `muted`: A subdued badge style.\n * - `success`: Indicates a successful state.\n * - `info`: Represents informational content.\n * - `warning`: Warns of potential issues.\n * - `danger`: Highlights a critical state.\n */\n badgeType?: 'muted' | 'success' | 'info' | 'warning' | 'danger';\n\n /**\n * The list of all menu items of a group.\n */\n navItems: T[];\n};\n\ntype ListMenuGroupProps<T extends ListMenuNavItem> = {\n menuGroup: ListMenuItem<T>;\n className: string;\n};\n\nconst ListMenuGroup = <T extends ListMenuNavItem>({ menuGroup, className }: ListMenuGroupProps<T>) => {\n if (!menuGroup.navItems.length) {\n return null;\n }\n\n return (\n <ul className={`ListMenuGroup ${className}`}>\n <ListMenuHeader {...menuGroup} />\n\n {menuGroup.navItems.map(item => (\n <li key={item.key} className={classNames(item.disabled && 'disabled', item.isSubItem && 'subitem')}>\n {item.item}\n </li>\n ))}\n </ul>\n );\n};\n\nexport default ListMenuGroup;\n"],"names":["ListMenuGroup","menuGroup","className","jsxs","jsx","ListMenuHeader","classNames","item"],"mappings":";;;AAkFA,MAAMA,IAAgB,CAA4B,EAAE,WAAAC,GAAW,WAAAC,QACtDD,EAAU,SAAS,SAKpB,gBAAAE,EAAC,MAAA,EAAG,WAAW,iBAAiBD,CAAS,IACrC,UAAA;AAAA,EAAA,gBAAAE,EAACC,GAAA,EAAgB,GAAGJ,GAAW;AAAA,EAE9BA,EAAU,SAAS,IAAI,OACpB,gBAAAG,EAAC,MAAA,EAAkB,WAAWE,EAAWC,EAAK,YAAY,YAAYA,EAAK,aAAa,SAAS,GAC5F,YAAK,KAAA,GADDA,EAAK,GAEd,CACH;AAAA,GACL,IAZO;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadMoreButton.js","sources":["../../../src/components/loadMore/LoadMoreButton.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"LoadMoreButton.js","sources":["../../../src/components/loadMore/LoadMoreButton.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport { LoadMoreProgress, type ProgressBarStyle } from './LoadMoreProgress';\n\ntype LoadMoreButtonProps = {\n /**\n * The number of already loaded elements. If set to 0 the progress bar will not be shown.\n * @default 0\n */\n loaded?: number;\n\n /**\n * The number of all elements. If set to 0 the progress bar will not be shown.\n * @default 100\n */\n total?: number;\n\n /**\n * The message that will be shown when everything is loaded.\n */\n noMoreMessage?: string | ReactNode;\n\n /**\n * The text for the load more button.\n */\n loadMoreMessage?: string | ReactNode;\n\n /**\n * If set to `false`, the button will not be rendered. The loadMoreMessage will be shown as text.\n * @default true\n */\n isInteractive?: boolean;\n\n /**\n * Callback fired when clicking on the load more button.\n */\n onLoadMore?: VoidFunction;\n\n /**\n * In case the component is used on white background, set the progress bar style to `gray`.\n * @default 'white'\n */\n progressBarStyle?: ProgressBarStyle;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n};\n\nexport const LoadMoreButton = (props: LoadMoreButtonProps) => {\n const {\n loaded = 0,\n total = 100,\n onLoadMore = () => {},\n loadMoreMessage = '',\n noMoreMessage = '',\n isInteractive = true,\n progressBarStyle,\n className = '',\n ...remainingProps\n } = props;\n\n const wrapperClassNames = classNames(\n 'LoadMoreButton',\n 'align-items-center',\n 'display-flex',\n 'justify-content-center',\n 'margin-top-25',\n 'margin-bottom-25',\n 'non-printable',\n className\n );\n\n const hasMoreToLoad = loaded > 0 && total > 0 && loaded < total;\n\n return (\n <div {...remainingProps} className={wrapperClassNames}>\n <div className='min-width-150'>\n <LoadMoreProgress loaded={loaded} total={total} progressBarStyle={progressBarStyle} />\n <div className='display-flex justify-content-center'>\n {hasMoreToLoad && isInteractive && (\n <button\n className='btn btn-link padding-right-20 margin-top--5'\n type='button'\n onClick={onLoadMore}\n >\n <span className='rioglyph rioglyph-arrow-down' />\n {loadMoreMessage}\n </button>\n )}\n {hasMoreToLoad && !isInteractive && (\n <span className='padding-top-4 padding-bottom-10'>{loadMoreMessage}</span>\n )}\n {!hasMoreToLoad && <span className='padding-top-4 padding-bottom-10'>{noMoreMessage}</span>}\n </div>\n </div>\n </div>\n );\n};\n\nexport default LoadMoreButton;\n"],"names":["LoadMoreButton","props","loaded","total","onLoadMore","loadMoreMessage","noMoreMessage","isInteractive","progressBarStyle","className","remainingProps","wrapperClassNames","classNames","hasMoreToLoad","jsx","jsxs","LoadMoreProgress"],"mappings":";;;AAmDO,MAAMA,IAAiB,CAACC,MAA+B;AAC1D,QAAM;AAAA,IACF,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ;AAAA,IACR,YAAAC,IAAa,MAAM;AAAA,IAAC;AAAA,IACpB,iBAAAC,IAAkB;AAAA,IAClB,eAAAC,IAAgB;AAAA,IAChB,eAAAC,IAAgB;AAAA,IAChB,kBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,GAAGC;AAAA,EAAA,IACHT,GAEEU,IAAoBC;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAH;AAAA,EAAA,GAGEI,IAAgBX,IAAS,KAAKC,IAAQ,KAAKD,IAASC;AAE1D,SACI,gBAAAW,EAAC,SAAK,GAAGJ,GAAgB,WAAWC,GAChC,UAAA,gBAAAI,EAAC,OAAA,EAAI,WAAU,iBACX,UAAA;AAAA,IAAA,gBAAAD,EAACE,GAAA,EAAiB,QAAAd,GAAgB,OAAAC,GAAc,kBAAAK,EAAA,CAAoC;AAAA,IACpF,gBAAAO,EAAC,OAAA,EAAI,WAAU,uCACV,UAAA;AAAA,MAAAF,KAAiBN,KACd,gBAAAQ;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,WAAU;AAAA,UACV,MAAK;AAAA,UACL,SAASX;AAAA,UAET,UAAA;AAAA,YAAA,gBAAAU,EAAC,QAAA,EAAK,WAAU,+BAAA,CAA+B;AAAA,YAC9CT;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAGRQ,KAAiB,CAACN,uBACd,QAAA,EAAK,WAAU,mCAAmC,UAAAF,GAAgB;AAAA,MAEtE,CAACQ,KAAiB,gBAAAC,EAAC,QAAA,EAAK,WAAU,mCAAmC,UAAAR,EAAA,CAAc;AAAA,IAAA,EAAA,CACxF;AAAA,EAAA,EAAA,CACJ,EAAA,CACJ;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadMoreProgress.js","sources":["../../../src/components/loadMore/LoadMoreProgress.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"LoadMoreProgress.js","sources":["../../../src/components/loadMore/LoadMoreProgress.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from '../../utils/classNames';\n\nconst STYLE = {\n WHITE: 'white',\n GRAY: 'gray',\n} as const;\n\nexport type ProgressBarStyle = (typeof STYLE)[keyof typeof STYLE];\n\ntype LoadMoreProgressProps = {\n loaded: number;\n total: number;\n progressBarStyle?: ProgressBarStyle;\n};\n\nexport const LoadMoreProgress = ({ loaded = 0, total = 0, progressBarStyle = STYLE.WHITE }: LoadMoreProgressProps) => {\n if (!loaded || !total) {\n return null;\n }\n\n const width = `${(loaded / total) * 100}%`;\n\n const progressClassName = classNames(\n 'progress',\n 'height-2 margin-bottom-10',\n progressBarStyle === STYLE.GRAY ? 'bg-lighter' : 'bg-white'\n );\n\n const progressBarClassName = classNames(\n 'progress-bar',\n progressBarStyle === STYLE.GRAY &&\n width !== '100%' &&\n 'border border-right-only border-color-white border-width-2'\n );\n\n return (\n <React.Fragment>\n <div className='text-center margin-bottom-3'>\n <span className='text-medium'>{loaded}</span>\n <span className='margin-left-5 margin-right-5'>/</span>\n <span className='text-medium'>{total}</span>\n </div>\n <div className={progressClassName}>\n <div className={progressBarClassName} style={{ width }} />\n </div>\n </React.Fragment>\n );\n};\n\nexport default LoadMoreProgress;\n"],"names":["STYLE","LoadMoreProgress","loaded","total","progressBarStyle","width","progressClassName","classNames","progressBarClassName","jsxs","React","jsx"],"mappings":";;;AAIA,MAAMA,IAAQ;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AACV,GAUaC,IAAmB,CAAC,EAAE,QAAAC,IAAS,GAAG,OAAAC,IAAQ,GAAG,kBAAAC,IAAmBJ,EAAM,YAAmC;AAClH,MAAI,CAACE,KAAU,CAACC;AACZ,WAAO;AAGX,QAAME,IAAQ,GAAIH,IAASC,IAAS,GAAG,KAEjCG,IAAoBC;AAAA,IACtB;AAAA,IACA;AAAA,IACAH,MAAqBJ,EAAM,OAAO,eAAe;AAAA,EAAA,GAG/CQ,IAAuBD;AAAA,IACzB;AAAA,IACAH,MAAqBJ,EAAM,QACvBK,MAAU,UACV;AAAA,EAAA;AAGR,SACI,gBAAAI,EAACC,EAAM,UAAN,EACG,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAA,EAAI,WAAU,+BACX,UAAA;AAAA,MAAA,gBAAAE,EAAC,QAAA,EAAK,WAAU,eAAe,UAAAT,GAAO;AAAA,MACtC,gBAAAS,EAAC,QAAA,EAAK,WAAU,gCAA+B,UAAA,KAAC;AAAA,MAChD,gBAAAA,EAAC,QAAA,EAAK,WAAU,eAAe,UAAAR,EAAA,CAAM;AAAA,IAAA,GACzC;AAAA,IACA,gBAAAQ,EAAC,OAAA,EAAI,WAAWL,GACZ,UAAA,gBAAAK,EAAC,OAAA,EAAI,WAAWH,GAAsB,OAAO,EAAE,OAAAH,EAAA,EAAM,CAAG,EAAA,CAC5D;AAAA,EAAA,GACJ;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.js","sources":["../../../../src/components/map/components/Map.tsx"],"sourcesContent":["import { useRef, useState, useEffect, type CSSProperties } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\nimport { isEqual } from 'es-toolkit/predicate';\n\nimport {\n MAP_TYPE_DEFAULT,\n MAP_TYPE_FLEET_STYLE,\n MAP_TYPE_SATELLITE,\n MAP_TYPE_TERRAIN,\n MAP_TYPE_NIGHT,\n MAP_LAYER_INCIDENTS,\n MAP_LAYER_TRAFFIC,\n MAP_LAYER_ROAD_RESTRICTIONS,\n DEFAULT_MIN_ZOOM,\n DEFAULT_MAX_ZOOM,\n DEFAULT_PIXEL_RATIO,\n} from './constants';\n\nimport { addEventListenerMap, removeEventListenerMap } from '../utils/eventHandling';\nimport { MapContext } from './MapContext';\nimport { createUtils, getMapBounds } from '../utils/mapUtils';\nimport { getHereUi } from '../utils/mapUi';\nimport useDarkMode from '../../../hooks/useDarkMode';\nimport MapZoom from './features/MapZoom';\nimport MapOverlayLayers from './features/layers/MapOverlayLayers';\nimport MapSize from './MapSize';\nimport MapPosition from './MapPosition';\nimport MapElements from './MapElements';\nimport type { MapApi, MapLayer, MapProps, MapType } from '../utils/mapTypes';\nimport { getPlatform, getEngineType, getBaseLayer } from '../utils/rendering';\n\n// biome-ignore lint/suspicious/noShadowRestrictedNames: <explanation>\nconst Map = (props: MapProps) => {\n const {\n children,\n credentials,\n width,\n height,\n language: lang = 'en',\n center,\n zoom,\n zoomAnimation = false,\n boundingBox,\n hideClusterSettings = false,\n hideMapLayerSettings = false,\n disableMapEvents,\n disableBehavior = false,\n disableZoomMomentum = true,\n eventListenerMap,\n mapType = MAP_TYPE_DEFAULT,\n mapLayer = [],\n showCluster: externalShowCluster = true,\n showScaleBar = false,\n onMapLayerChange = () => {},\n onMapTypeChange = () => {},\n onShowClusterChange = () => {},\n onZoomIn = () => {},\n onZoomOut = () => {},\n onIncidentsChange = () => {},\n mapSettingsTooltip,\n mapSettings,\n enableWebGL = true,\n enableDevicePixelRatio = true,\n pixelRatio = DEFAULT_PIXEL_RATIO,\n minZoom = DEFAULT_MIN_ZOOM,\n maxZoom = DEFAULT_MAX_ZOOM,\n } = props;\n\n let safeMaxZoom = maxZoom;\n\n if (minZoom > maxZoom) {\n // Avoid crashing the map for invalid zoom limits\n safeMaxZoom = DEFAULT_MAX_ZOOM;\n console.error('Invalid condition for zoom limits: min <= max)');\n }\n\n const mapRef = useRef<HTMLDivElement>(null);\n\n const [isMapInitialized, setMapInitialized] = useState(false);\n\n const [api, setApi] = useState<MapApi>();\n\n const [baseLayer, setBaseLayer] = useState<MapType>(mapType);\n const [activeLayers, setActiveLayers] = useState<MapLayer[]>(mapLayer);\n const [showCluster, setShowCluster] = useState(externalShowCluster);\n\n const devicePixelRatio = enableDevicePixelRatio ? window.devicePixelRatio || pixelRatio : pixelRatio;\n\n // Only short locale is supported by HERE Map\n const language = (locale => (locale === 'nb' ? 'no' : locale))(lang.split('-')[0].toLowerCase());\n\n useEffect(() => {\n let allMapObjects: H.map.Object[] = [];\n\n if (api?.map) {\n allMapObjects = api.map.getObjects();\n console.debug('re-initialize here map');\n } else {\n console.debug('initialize here map');\n }\n\n if (api?.map) {\n // Cleanup any previously initialized map before doing anything else\n console.debug('disposing previous map');\n removeEventListenerMap(api.map);\n\n if (api.mapEvents) {\n api.mapEvents.dispose();\n }\n\n api.map.dispose();\n }\n\n const bounds = boundingBox && getMapBounds(boundingBox);\n\n // Initialize communication with the platform\n const platform = getPlatform(credentials);\n\n // Specify engine type. In this example, we use HARP rendering engine, which is capable\n // of rendering vector data using the style configuration exported from the HERE Style Editor.\n // HARP engine is not the default engine, and it's not included in the mapsjs-core.js module.\n // To use this engine, you need to include mapsjs-harp.js file to your HTML page\n const engineType = getEngineType(baseLayer, enableWebGL);\n\n // Obtain the default map types from the platform object\n // @ts-ignore-next-line: according to the Here docs, the engine type exists\n // see https://www.here.com/docs/bundle/maps-api-for-javascript-developer-guide/page/topics/harp-migrate.html\n const defaultLayers = platform.createDefaultLayers({ engineType, lg: language, pois: true });\n\n getBaseLayer({\n baseLayerName: baseLayer,\n defaultLayers,\n enableWebGL,\n platform,\n engineType,\n vehicleRestrictions: activeLayers.includes(MAP_LAYER_ROAD_RESTRICTIONS),\n language,\n minZoom,\n maxZoom: safeMaxZoom,\n }).then(defaultLayerMap => {\n // Initialize the map\n const hereMap = new H.Map(mapRef.current as Element, defaultLayerMap.baseLayer, {\n zoom,\n center,\n bounds,\n engineType,\n pixelRatio: devicePixelRatio,\n fixedCenter: true,\n });\n\n if (defaultLayerMap.overlayLayer) {\n // Special case for satellite map where we render street labels and road signs as well as additional pois as vector data\n // hereMap.setBaseLayer(defaultLayerMap.baseLayer);\n hereMap.addLayer(defaultLayerMap.overlayLayer);\n }\n\n setMapInitialized(true);\n\n let hereMapEvents: H.mapevents.MapEvents | false = false;\n let hereBehavior: H.mapevents.Behavior | undefined;\n\n if (!disableMapEvents) {\n // Enable the map event system\n hereMapEvents = new H.mapevents.MapEvents(hereMap);\n }\n\n if (!(disableMapEvents || disableBehavior)) {\n hereBehavior = new H.mapevents.Behavior(hereMapEvents as H.mapevents.MapEvents);\n // @ts-ignore-next-line\n hereBehavior.disable(H.mapevents.Behavior.Feature.FRACTIONAL_ZOOM);\n\n if (disableZoomMomentum) {\n // Disable the inertia that occurs on WebGL maps when scrolling/zooming.\n // This resulted in a very high scroll sensitivity.\n // @ts-ignore-next-line\n hereBehavior.disable(H.mapevents.Behavior.Feature.ZOOM_MOMENTUM);\n }\n }\n\n addEventListenerMap(hereMap, eventListenerMap, hereMap);\n\n const hereUi = getHereUi(hereMap, defaultLayers, showScaleBar, language);\n\n // The api will be passed to services when using a render function.\n // This allows the service to access the map internals\n setApi({\n credentials,\n defaultLayers,\n map: hereMap,\n mapEvents: hereMapEvents,\n behavior: hereBehavior,\n platform,\n ui: hereUi,\n utils: createUtils(hereMap),\n // Put settings back into the map API object so the invoking service\n // can check on these settings for instance inside a test\n settings: {\n enableWebGL,\n baseLayer,\n activeLayers,\n showCluster,\n minZoom,\n maxZoom: safeMaxZoom,\n },\n });\n\n if (allMapObjects) {\n // If the base layer changed, re-add all previous objects again,\n // otherwise the map would be empty\n hereMap.addObjects(allMapObjects);\n }\n });\n }, [enableWebGL, enableDevicePixelRatio, language, baseLayer, minZoom, maxZoom]);\n\n const isDarkMode = useDarkMode();\n useEffect(() => {\n // Toggle night map only if current map type is default\n if (isDarkMode && baseLayer === MAP_TYPE_DEFAULT) {\n handleMapTypeChange(MAP_TYPE_NIGHT);\n }\n // Toggle back to default map only if current map type is night\n else if (!isDarkMode && baseLayer === MAP_TYPE_NIGHT) {\n handleMapTypeChange(MAP_TYPE_DEFAULT);\n }\n }, [isDarkMode, language]);\n\n // Update MapType from outside\n useEffect(() => handleMapTypeChange(mapType), [mapType]);\n\n // Update MapLayer from outside\n const [previousMapLayer, setPreviousMapLayer] = useState(mapLayer);\n if (!isEqual(mapLayer, previousMapLayer)) {\n setActiveLayers(mapLayer);\n setPreviousMapLayer(mapLayer);\n }\n\n // Update Cluster setting from outside\n useEffect(() => setShowCluster(externalShowCluster), [externalShowCluster]);\n\n const handleMapTypeChange = (newMapType: MapType) => {\n setBaseLayer(newMapType);\n onMapTypeChange(newMapType, mapType);\n };\n\n const handleMapLayerChange = (layer: MapLayer) => {\n const removeLayer = (layerToRemove: string) => activeLayers.filter(item => item !== layerToRemove);\n const newActiveLayers = activeLayers.includes(layer) ? removeLayer(layer) : [...activeLayers, layer];\n setActiveLayers(newActiveLayers);\n onMapLayerChange(newActiveLayers, activeLayers);\n };\n\n const handleShowClusterChange = (newShowCluster: boolean) => {\n setShowCluster(newShowCluster);\n onShowClusterChange(newShowCluster);\n };\n\n // Note: For performance reasons, we deactivate pointer events and hence CSS style recalculation for the\n // the body. Having for instance many assets in the tree causes a performance loss when clicking on the map\n // to move it and zoom in/out since the map triggers a style invalidation and recalculation and\n // due to the nature of the AssetTree with it's hundreds DOM nodes, applying the CSS selectors\n // takes time.\n const handleMapInteractionStart = () => {\n document.querySelector('.AssetTree')?.classList.add('pointer-events-none');\n };\n const handleMapInteractionEnd = () => {\n document.querySelector('.AssetTree')?.classList.remove('pointer-events-none');\n };\n\n const style: CSSProperties = {};\n if (height) {\n style.height = height;\n }\n if (width) {\n style.width = width;\n }\n const autoHeightClass = isEmpty(style) ? 'height-100pct' : '';\n\n return (\n <div\n className={`Map position-relative map-type-${baseLayer.toLowerCase()} ${autoHeightClass}`}\n style={style}\n ref={mapRef}\n onTouchStart={handleMapInteractionStart}\n onTouchEnd={handleMapInteractionEnd}\n onMouseEnter={handleMapInteractionStart}\n onMouseOut={handleMapInteractionEnd}\n onBlur={handleMapInteractionEnd}\n >\n {isMapInitialized && api && (\n <MapContext.Provider\n value={{\n api,\n language,\n enableWebGL,\n showCluster,\n activeLayers,\n baseLayer,\n hideMapLayerSettings,\n hideClusterSettings,\n onMapTypeChange: handleMapTypeChange,\n onMapLayerChange: handleMapLayerChange,\n onShowClusterChange: handleShowClusterChange,\n mapSettingsTooltip,\n onIncidentsChange,\n devicePixelRatio,\n }}\n >\n <MapPosition api={api} boundingBox={boundingBox} center={center} zoomAnimation={zoomAnimation} />\n <MapSize api={api} />\n <MapZoom\n zoom={zoom}\n hideZoomButtons={disableBehavior}\n onZoomIn={onZoomIn}\n onZoomOut={onZoomOut}\n zoomAnimation={zoomAnimation}\n />\n {mapSettings && mapSettings}\n <MapOverlayLayers layers={activeLayers} />\n <MapElements api={api}>{children}</MapElements>\n </MapContext.Provider>\n )}\n </div>\n );\n};\n\nMap.TYPE_DEFAULT = MAP_TYPE_DEFAULT;\nMap.TYPE_FLEET_STYLE = MAP_TYPE_FLEET_STYLE;\nMap.TYPE_SATELLITE = MAP_TYPE_SATELLITE;\nMap.TYPE_TERRAIN = MAP_TYPE_TERRAIN;\nMap.TYPE_NIGHT = MAP_TYPE_NIGHT;\n\nMap.LAYER_INCIDENTS = MAP_LAYER_INCIDENTS;\nMap.LAYER_TRAFFIC = MAP_LAYER_TRAFFIC;\nMap.LAYER_ROAD_RESTRICTIONS = MAP_LAYER_ROAD_RESTRICTIONS;\n\nexport default Map;\n"],"names":["Map","props","children","credentials","width","height","lang","center","zoom","zoomAnimation","boundingBox","hideClusterSettings","hideMapLayerSettings","disableMapEvents","disableBehavior","disableZoomMomentum","eventListenerMap","mapType","MAP_TYPE_DEFAULT","mapLayer","externalShowCluster","showScaleBar","onMapLayerChange","onMapTypeChange","onShowClusterChange","onZoomIn","onZoomOut","onIncidentsChange","mapSettingsTooltip","mapSettings","enableWebGL","enableDevicePixelRatio","pixelRatio","DEFAULT_PIXEL_RATIO","minZoom","DEFAULT_MIN_ZOOM","maxZoom","DEFAULT_MAX_ZOOM","safeMaxZoom","mapRef","useRef","isMapInitialized","setMapInitialized","useState","api","setApi","baseLayer","setBaseLayer","activeLayers","setActiveLayers","showCluster","setShowCluster","devicePixelRatio","language","locale","useEffect","allMapObjects","removeEventListenerMap","bounds","getMapBounds","platform","getPlatform","engineType","getEngineType","defaultLayers","getBaseLayer","MAP_LAYER_ROAD_RESTRICTIONS","defaultLayerMap","hereMap","hereMapEvents","hereBehavior","addEventListenerMap","hereUi","getHereUi","createUtils","isDarkMode","useDarkMode","handleMapTypeChange","MAP_TYPE_NIGHT","previousMapLayer","setPreviousMapLayer","isEqual","newMapType","handleMapLayerChange","layer","removeLayer","layerToRemove","item","newActiveLayers","handleShowClusterChange","newShowCluster","handleMapInteractionStart","handleMapInteractionEnd","style","autoHeightClass","isEmpty","jsx","jsxs","MapContext","MapPosition","MapSize","MapZoom","MapOverlayLayers","MapElements","MAP_TYPE_FLEET_STYLE","MAP_TYPE_SATELLITE","MAP_TYPE_TERRAIN","MAP_LAYER_INCIDENTS","MAP_LAYER_TRAFFIC"],"mappings":";;;;;;;;;;;;;;;;AAgCA,MAAMA,IAAM,CAACC,MAAoB;AAC7B,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAUC,IAAO;AAAA,IACjB,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,aAAAC;AAAA,IACA,qBAAAC,KAAsB;AAAA,IACtB,sBAAAC,KAAuB;AAAA,IACvB,kBAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,qBAAAC,KAAsB;AAAA,IACtB,kBAAAC;AAAA,IACA,SAAAC,IAAUC;AAAA,IACV,UAAAC,IAAW,CAAA;AAAA,IACX,aAAaC,IAAsB;AAAA,IACnC,cAAAC,KAAe;AAAA,IACf,kBAAAC,KAAmB,MAAM;AAAA,IAAC;AAAA,IAC1B,iBAAAC,KAAkB,MAAM;AAAA,IAAC;AAAA,IACzB,qBAAAC,KAAsB,MAAM;AAAA,IAAC;AAAA,IAC7B,UAAAC,KAAW,MAAM;AAAA,IAAC;AAAA,IAClB,WAAAC,KAAY,MAAM;AAAA,IAAC;AAAA,IACnB,mBAAAC,KAAoB,MAAM;AAAA,IAAC;AAAA,IAC3B,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,wBAAAC,IAAyB;AAAA,IACzB,YAAAC,IAAaC;AAAA,IACb,SAAAC,IAAUC;AAAA,IACV,SAAAC,IAAUC;AAAA,EAAA,IACVpC;AAEJ,MAAIqC,IAAcF;AAElB,EAAIF,IAAUE,MAEVE,IAAcD,GACd,QAAQ,MAA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5G,EAAI,0BAA0BkE;"}
|
|
1
|
+
{"version":3,"file":"Map.js","sources":["../../../../src/components/map/components/Map.tsx"],"sourcesContent":["import { useRef, useState, useEffect, type CSSProperties } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\nimport { isEqual } from 'es-toolkit/predicate';\n\nimport {\n MAP_TYPE_DEFAULT,\n MAP_TYPE_FLEET_STYLE,\n MAP_TYPE_SATELLITE,\n MAP_TYPE_TERRAIN,\n MAP_TYPE_NIGHT,\n MAP_LAYER_INCIDENTS,\n MAP_LAYER_TRAFFIC,\n MAP_LAYER_ROAD_RESTRICTIONS,\n DEFAULT_MIN_ZOOM,\n DEFAULT_MAX_ZOOM,\n DEFAULT_PIXEL_RATIO,\n} from './constants';\n\nimport { addEventListenerMap, removeEventListenerMap } from '../utils/eventHandling';\nimport { MapContext } from './MapContext';\nimport { createUtils, getMapBounds } from '../utils/mapUtils';\nimport { getHereUi } from '../utils/mapUi';\nimport useDarkMode from '../../../hooks/useDarkMode';\nimport MapZoom from './features/MapZoom';\nimport MapOverlayLayers from './features/layers/MapOverlayLayers';\nimport MapSize from './MapSize';\nimport MapPosition from './MapPosition';\nimport MapElements from './MapElements';\nimport type { MapApi, MapLayer, MapProps, MapType } from '../utils/mapTypes';\nimport { getPlatform, getEngineType, getBaseLayer } from '../utils/rendering';\n\nconst Map = (props: MapProps) => {\n const {\n children,\n credentials,\n width,\n height,\n language: lang = 'en',\n center,\n zoom,\n zoomAnimation = false,\n boundingBox,\n hideClusterSettings = false,\n hideMapLayerSettings = false,\n disableMapEvents,\n disableBehavior = false,\n disableZoomMomentum = true,\n eventListenerMap,\n mapType = MAP_TYPE_DEFAULT,\n mapLayer = [],\n showCluster: externalShowCluster = true,\n showScaleBar = false,\n onMapLayerChange = () => {},\n onMapTypeChange = () => {},\n onShowClusterChange = () => {},\n onZoomIn = () => {},\n onZoomOut = () => {},\n onIncidentsChange = () => {},\n mapSettingsTooltip,\n mapSettings,\n enableWebGL = true,\n enableDevicePixelRatio = true,\n pixelRatio = DEFAULT_PIXEL_RATIO,\n minZoom = DEFAULT_MIN_ZOOM,\n maxZoom = DEFAULT_MAX_ZOOM,\n } = props;\n\n let safeMaxZoom = maxZoom;\n\n if (minZoom > maxZoom) {\n // Avoid crashing the map for invalid zoom limits\n safeMaxZoom = DEFAULT_MAX_ZOOM;\n console.error('Invalid condition for zoom limits: min <= max)');\n }\n\n const mapRef = useRef<HTMLDivElement>(null);\n\n const [isMapInitialized, setMapInitialized] = useState(false);\n\n const [api, setApi] = useState<MapApi>();\n\n const [baseLayer, setBaseLayer] = useState<MapType>(mapType);\n const [activeLayers, setActiveLayers] = useState<MapLayer[]>(mapLayer);\n const [showCluster, setShowCluster] = useState(externalShowCluster);\n\n const devicePixelRatio = enableDevicePixelRatio ? window.devicePixelRatio || pixelRatio : pixelRatio;\n\n // Only short locale is supported by HERE Map\n const language = (locale => (locale === 'nb' ? 'no' : locale))(lang.split('-')[0].toLowerCase());\n\n useEffect(() => {\n let allMapObjects: H.map.Object[] = [];\n\n if (api?.map) {\n allMapObjects = api.map.getObjects();\n console.debug('re-initialize here map');\n } else {\n console.debug('initialize here map');\n }\n\n if (api?.map) {\n // Cleanup any previously initialized map before doing anything else\n console.debug('disposing previous map');\n removeEventListenerMap(api.map);\n\n if (api.mapEvents) {\n api.mapEvents.dispose();\n }\n\n api.map.dispose();\n }\n\n const bounds = boundingBox && getMapBounds(boundingBox);\n\n // Initialize communication with the platform\n const platform = getPlatform(credentials);\n\n // Specify engine type. In this example, we use HARP rendering engine, which is capable\n // of rendering vector data using the style configuration exported from the HERE Style Editor.\n // HARP engine is not the default engine, and it's not included in the mapsjs-core.js module.\n // To use this engine, you need to include mapsjs-harp.js file to your HTML page\n const engineType = getEngineType(baseLayer, enableWebGL);\n\n // Obtain the default map types from the platform object\n // @ts-expect-error-next-line: according to the Here docs, the engine type exists\n // see https://www.here.com/docs/bundle/maps-api-for-javascript-developer-guide/page/topics/harp-migrate.html\n const defaultLayers = platform.createDefaultLayers({ engineType, lg: language, pois: true });\n\n getBaseLayer({\n baseLayerName: baseLayer,\n defaultLayers,\n enableWebGL,\n platform,\n engineType,\n vehicleRestrictions: activeLayers.includes(MAP_LAYER_ROAD_RESTRICTIONS),\n language,\n minZoom,\n maxZoom: safeMaxZoom,\n }).then(defaultLayerMap => {\n // Initialize the map\n const hereMap = new H.Map(mapRef.current as Element, defaultLayerMap.baseLayer, {\n zoom,\n center,\n bounds,\n engineType,\n pixelRatio: devicePixelRatio,\n fixedCenter: true,\n });\n\n if (defaultLayerMap.overlayLayer) {\n // Special case for satellite map where we render street labels and road signs as well as additional pois as vector data\n // hereMap.setBaseLayer(defaultLayerMap.baseLayer);\n hereMap.addLayer(defaultLayerMap.overlayLayer);\n }\n\n setMapInitialized(true);\n\n let hereMapEvents: H.mapevents.MapEvents | false = false;\n let hereBehavior: H.mapevents.Behavior | undefined;\n\n if (!disableMapEvents) {\n // Enable the map event system\n hereMapEvents = new H.mapevents.MapEvents(hereMap);\n }\n\n if (!(disableMapEvents || disableBehavior)) {\n hereBehavior = new H.mapevents.Behavior(hereMapEvents as H.mapevents.MapEvents);\n // @ts-expect-error-next-line\n hereBehavior.disable(H.mapevents.Behavior.Feature.FRACTIONAL_ZOOM);\n\n if (disableZoomMomentum) {\n // Disable the inertia that occurs on WebGL maps when scrolling/zooming.\n // This resulted in a very high scroll sensitivity.\n // @ts-expect-error-next-line\n hereBehavior.disable(H.mapevents.Behavior.Feature.ZOOM_MOMENTUM);\n }\n }\n\n addEventListenerMap(hereMap, eventListenerMap, hereMap);\n\n const hereUi = getHereUi(hereMap, defaultLayers, showScaleBar, language);\n\n // The api will be passed to services when using a render function.\n // This allows the service to access the map internals\n setApi({\n credentials,\n defaultLayers,\n map: hereMap,\n mapEvents: hereMapEvents,\n behavior: hereBehavior,\n platform,\n ui: hereUi,\n utils: createUtils(hereMap),\n // Put settings back into the map API object so the invoking service\n // can check on these settings for instance inside a test\n settings: {\n enableWebGL,\n baseLayer,\n activeLayers,\n showCluster,\n minZoom,\n maxZoom: safeMaxZoom,\n },\n });\n\n if (allMapObjects) {\n // If the base layer changed, re-add all previous objects again,\n // otherwise the map would be empty\n hereMap.addObjects(allMapObjects);\n }\n });\n }, [enableWebGL, enableDevicePixelRatio, language, baseLayer, minZoom, maxZoom]);\n\n const isDarkMode = useDarkMode();\n useEffect(() => {\n // Toggle night map only if current map type is default\n if (isDarkMode && baseLayer === MAP_TYPE_DEFAULT) {\n handleMapTypeChange(MAP_TYPE_NIGHT);\n }\n // Toggle back to default map only if current map type is night\n else if (!isDarkMode && baseLayer === MAP_TYPE_NIGHT) {\n handleMapTypeChange(MAP_TYPE_DEFAULT);\n }\n }, [isDarkMode, language]);\n\n // Update MapType from outside\n useEffect(() => handleMapTypeChange(mapType), [mapType]);\n\n // Update MapLayer from outside\n const [previousMapLayer, setPreviousMapLayer] = useState(mapLayer);\n if (!isEqual(mapLayer, previousMapLayer)) {\n setActiveLayers(mapLayer);\n setPreviousMapLayer(mapLayer);\n }\n\n // Update Cluster setting from outside\n useEffect(() => setShowCluster(externalShowCluster), [externalShowCluster]);\n\n const handleMapTypeChange = (newMapType: MapType) => {\n setBaseLayer(newMapType);\n onMapTypeChange(newMapType, mapType);\n };\n\n const handleMapLayerChange = (layer: MapLayer) => {\n const removeLayer = (layerToRemove: string) => activeLayers.filter(item => item !== layerToRemove);\n const newActiveLayers = activeLayers.includes(layer) ? removeLayer(layer) : [...activeLayers, layer];\n setActiveLayers(newActiveLayers);\n onMapLayerChange(newActiveLayers, activeLayers);\n };\n\n const handleShowClusterChange = (newShowCluster: boolean) => {\n setShowCluster(newShowCluster);\n onShowClusterChange(newShowCluster);\n };\n\n // Note: For performance reasons, we deactivate pointer events and hence CSS style recalculation for the\n // the body. Having for instance many assets in the tree causes a performance loss when clicking on the map\n // to move it and zoom in/out since the map triggers a style invalidation and recalculation and\n // due to the nature of the AssetTree with it's hundreds DOM nodes, applying the CSS selectors\n // takes time.\n const handleMapInteractionStart = () => {\n document.querySelector('.AssetTree')?.classList.add('pointer-events-none');\n };\n const handleMapInteractionEnd = () => {\n document.querySelector('.AssetTree')?.classList.remove('pointer-events-none');\n };\n\n const style: CSSProperties = {};\n if (height) {\n style.height = height;\n }\n if (width) {\n style.width = width;\n }\n const autoHeightClass = isEmpty(style) ? 'height-100pct' : '';\n\n return (\n <div\n className={`Map position-relative map-type-${baseLayer.toLowerCase()} ${autoHeightClass}`}\n style={style}\n ref={mapRef}\n onTouchStart={handleMapInteractionStart}\n onTouchEnd={handleMapInteractionEnd}\n onMouseEnter={handleMapInteractionStart}\n onMouseOut={handleMapInteractionEnd}\n onBlur={handleMapInteractionEnd}\n >\n {isMapInitialized && api && (\n <MapContext.Provider\n value={{\n api,\n language,\n enableWebGL,\n showCluster,\n activeLayers,\n baseLayer,\n hideMapLayerSettings,\n hideClusterSettings,\n onMapTypeChange: handleMapTypeChange,\n onMapLayerChange: handleMapLayerChange,\n onShowClusterChange: handleShowClusterChange,\n mapSettingsTooltip,\n onIncidentsChange,\n devicePixelRatio,\n }}\n >\n <MapPosition api={api} boundingBox={boundingBox} center={center} zoomAnimation={zoomAnimation} />\n <MapSize api={api} />\n <MapZoom\n zoom={zoom}\n hideZoomButtons={disableBehavior}\n onZoomIn={onZoomIn}\n onZoomOut={onZoomOut}\n zoomAnimation={zoomAnimation}\n />\n {mapSettings && mapSettings}\n <MapOverlayLayers layers={activeLayers} />\n <MapElements api={api}>{children}</MapElements>\n </MapContext.Provider>\n )}\n </div>\n );\n};\n\nMap.TYPE_DEFAULT = MAP_TYPE_DEFAULT;\nMap.TYPE_FLEET_STYLE = MAP_TYPE_FLEET_STYLE;\nMap.TYPE_SATELLITE = MAP_TYPE_SATELLITE;\nMap.TYPE_TERRAIN = MAP_TYPE_TERRAIN;\nMap.TYPE_NIGHT = MAP_TYPE_NIGHT;\n\nMap.LAYER_INCIDENTS = MAP_LAYER_INCIDENTS;\nMap.LAYER_TRAFFIC = MAP_LAYER_TRAFFIC;\nMap.LAYER_ROAD_RESTRICTIONS = MAP_LAYER_ROAD_RESTRICTIONS;\n\nexport default Map;\n"],"names":["Map","props","children","credentials","width","height","lang","center","zoom","zoomAnimation","boundingBox","hideClusterSettings","hideMapLayerSettings","disableMapEvents","disableBehavior","disableZoomMomentum","eventListenerMap","mapType","MAP_TYPE_DEFAULT","mapLayer","externalShowCluster","showScaleBar","onMapLayerChange","onMapTypeChange","onShowClusterChange","onZoomIn","onZoomOut","onIncidentsChange","mapSettingsTooltip","mapSettings","enableWebGL","enableDevicePixelRatio","pixelRatio","DEFAULT_PIXEL_RATIO","minZoom","DEFAULT_MIN_ZOOM","maxZoom","DEFAULT_MAX_ZOOM","safeMaxZoom","mapRef","useRef","isMapInitialized","setMapInitialized","useState","api","setApi","baseLayer","setBaseLayer","activeLayers","setActiveLayers","showCluster","setShowCluster","devicePixelRatio","language","locale","useEffect","allMapObjects","removeEventListenerMap","bounds","getMapBounds","platform","getPlatform","engineType","getEngineType","defaultLayers","getBaseLayer","MAP_LAYER_ROAD_RESTRICTIONS","defaultLayerMap","hereMap","hereMapEvents","hereBehavior","addEventListenerMap","hereUi","getHereUi","createUtils","isDarkMode","useDarkMode","handleMapTypeChange","MAP_TYPE_NIGHT","previousMapLayer","setPreviousMapLayer","isEqual","newMapType","handleMapLayerChange","layer","removeLayer","layerToRemove","item","newActiveLayers","handleShowClusterChange","newShowCluster","handleMapInteractionStart","handleMapInteractionEnd","style","autoHeightClass","isEmpty","jsx","jsxs","MapContext","MapPosition","MapSize","MapZoom","MapOverlayLayers","MapElements","MAP_TYPE_FLEET_STYLE","MAP_TYPE_SATELLITE","MAP_TYPE_TERRAIN","MAP_LAYER_INCIDENTS","MAP_LAYER_TRAFFIC"],"mappings":";;;;;;;;;;;;;;;;AA+BA,MAAMA,IAAM,CAACC,MAAoB;AAC7B,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAUC,IAAO;A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