@rio-cloud/rio-uikit 2.1.0 → 2.2.1
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.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.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.js +1 -1
- package/components/applicationLayout/SubNavigation.js.map +1 -1
- package/components/assetTree/AssetTree.js +1 -1
- package/components/assetTree/AssetTree.js.map +1 -1
- package/components/assetTree/Tree.js +1 -1
- package/components/assetTree/Tree.js.map +1 -1
- package/components/assetTree/TreeIcon.js +3 -3
- package/components/assetTree/TreeIcon.js.map +1 -1
- package/components/assetTree/TreeLeaf.js +4 -4
- package/components/assetTree/TreeLeaf.js.map +1 -1
- package/components/assetTree/TreeNode.js +1 -1
- 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.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.js +1 -1
- package/components/barList/BarList.js.map +1 -1
- package/components/bottomSheet/BottomSheet.js +1 -1
- package/components/bottomSheet/BottomSheet.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.js +16 -16
- 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/RadialBarChart.js +106 -103
- package/components/charts/RadialBarChart.js.map +1 -1
- 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.js +9 -9
- package/components/clearableInput/ClearableInput.js.map +1 -1
- package/components/dataTabs/DataTabHeader.js +1 -1
- package/components/dataTabs/DataTabHeader.js.map +1 -1
- 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/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/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.js +1 -1
- package/components/dropdown/ButtonDropdown.js.map +1 -1
- 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.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.js +5 -5
- package/components/expander/ExpanderList.js.map +1 -1
- package/components/expander/ExpanderPanel.js +1 -1
- package/components/expander/ExpanderPanel.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/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/listMenu/ListMenu.js +2 -5
- package/components/listMenu/ListMenu.js.map +1 -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/features/MapSettings.js +4 -4
- package/components/map/components/features/MapSettings.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/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/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.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/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.js +4 -4
- package/components/onboarding/OnboardingTip.js.map +1 -1
- package/components/page/Page.js +1 -1
- package/components/page/Page.js.map +1 -1
- package/components/pager/Pager.js +1 -1
- package/components/pager/Pager.js.map +1 -1
- package/components/radiobutton/RadioButton.d.ts +1 -1
- 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/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.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/saveableInput/SaveableDateInput.js +1 -1
- package/components/saveableInput/SaveableDateInput.js.map +1 -1
- 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 +1 -1
- 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.js +6 -6
- 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.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.js +1 -1
- package/components/slider/RangeSlider.js.map +1 -1
- package/components/slider/Slider.js +1 -1
- package/components/slider/Slider.js.map +1 -1
- package/components/smoothScrollbars/SmoothScrollbars.js +1 -1
- package/components/smoothScrollbars/SmoothScrollbars.js.map +1 -1
- 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/statsWidget/StatsWidget.js +1 -1
- package/components/statsWidget/StatsWidget.js.map +1 -1
- 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.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 +126 -2
- package/components/statusBar/StatusBar.js +24 -17
- package/components/statusBar/StatusBar.js.map +1 -1
- package/components/statusBar/StatusBarIcon.d.ts +1 -1
- package/components/statusBar/StatusBarIcon.js +4 -4
- package/components/statusBar/StatusBarIcon.js.map +1 -1
- package/components/statusBar/StatusBarLabel.d.ts +1 -1
- 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.js +1 -1
- package/components/steppedProgressBar/SteppedProgressBar.js.map +1 -1
- package/components/switch/Switch.d.ts +16 -1
- package/components/switch/Switch.js +77 -35
- package/components/switch/Switch.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 +51 -1
- package/components/table/TableSettingsDialog.js +170 -154
- package/components/table/TableSettingsDialog.js.map +1 -1
- package/components/table/TableSettingsDialogFooter.js +1 -1
- package/components/table/TableSettingsDialogFooter.js.map +1 -1
- package/components/table/TableSettingsListContainer.d.ts +1 -1
- package/components/table/TableSettingsListContainer.js +8 -8
- package/components/table/TableSettingsListContainer.js.map +1 -1
- package/components/table/TableSettingsListItem.d.ts +1 -1
- package/components/table/TableSettingsListItem.js +26 -26
- 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.js +1 -1
- package/components/table/TableViewToggles.js.map +1 -1
- 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 +14 -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.js +1 -1
- package/components/teaser/Teaser.js.map +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/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.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/useLatest.d.ts +16 -0
- package/hooks/useLatest.js +11 -0
- package/hooks/useLatest.js.map +1 -0
- 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/useTimeout.js +11 -11
- package/hooks/useTimeout.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 +17 -18
- 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/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/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/components/states/BaseStateProps.d.ts +0 -70
- package/components/statusBar/StatusBarProps.d.ts +0 -127
- package/components/table/TableSettingsDialog.types.d.ts +0 -39
- package/components/tagManager/TagManagerTag.d.ts +0 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import g, { forwardRef as B, useRef as H, useImperativeHandle as S, useCallback as E } from "react";
|
|
3
3
|
import { isEmpty as m } from "es-toolkit/compat";
|
|
4
|
-
import W from "
|
|
4
|
+
import W from "../../utils/classNames.js";
|
|
5
5
|
import j from "./AppMenu.js";
|
|
6
6
|
import b from "./ApplicationActionBar.js";
|
|
7
7
|
import F from "./MobileSubmoduleNavigation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationHeader.js","sources":["../../../src/components/applicationHeader/ApplicationHeader.tsx"],"sourcesContent":["import React, { useRef, forwardRef, useCallback, useImperativeHandle, type ForwardedRef } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"ApplicationHeader.js","sources":["../../../src/components/applicationHeader/ApplicationHeader.tsx"],"sourcesContent":["import React, { useRef, forwardRef, useCallback, useImperativeHandle, type ForwardedRef } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\n\nimport classNames from '../../utils/classNames';\nimport AppMenu from './AppMenu';\nimport ApplicationActionBar from './ApplicationActionBar';\nimport MobileSubmoduleNavigation from './MobileSubmoduleNavigation';\nimport MobileAppMenu from './MobileAppMenu';\nimport useResizeObserver from '../../hooks/useResizeObserver';\nimport NavItems from './NavItems';\n\nconst SCREEN_SM = 768; // @screen-sm: 768px;\n\nexport type ModulePropType = {\n /**\n * Unique key for the sub-module navigation component of an app.\n */\n key: string;\n\n /**\n * The navigation link component used for rendering the name and for routing.\n *\n * @example\n * <NavLink to='/app/ipsum'>Lorem ipsum</NavLink>\n */\n route: React.ReactNode;\n};\n\nexport type ApplicationHeaderProps = {\n /**\n * The service name shown as the navigator dropdown label.\n */\n label?: string | React.ReactNode;\n\n /**\n * The home URL that shall be used for the home button. Pass a `react-router-dom` `NavLink`\n * as homeRoute into the header. For example:\n *\n * @example\n * <NavLink to='https://home.rio.cloud' />\n */\n homeRoute?: React.ReactNode;\n\n /**\n * Defines to either show the home icon or the RIO logo as brand logo.\n *\n * @default true\n */\n showHomeIcon?: boolean;\n\n /**\n * The component for the navigation between apps which will be shown inside the main dropdown.\n *\n * Platform apps may use the default AppNavigator, but there are also cases like support apps where it's just a\n * simple list In this case, use the prop `appMenuItems`.\n *\n * If no appNavigator is defined, the dropdown menu will not be rendered.\n */\n appNavigator?: React.ReactNode;\n\n /**\n * Additional class names that are added to the appNavigator.\n */\n appNavigatorClassName?: string;\n\n /**\n * List of application navigation link components.\n */\n appMenuItems?: ModulePropType[];\n\n /**\n * List of submodule navigation component of an app.\n *\n * Items collapse into a dropdown if remaining space in the header is not sufficient.\n */\n navItems?: ModulePropType[];\n\n /**\n * List of external smart components.\n *\n * For example, the rio-accountmenu or application-owned components such as a ServiceInfo icon. These components\n * are based on the `ActionBarItem`.\n *\n * @default []\n */\n actionBarItems?: React.ReactNode[];\n\n /**\n * Callback function triggered when the application menu is open or closed.\n *\n * @default () => {}\n * @param isOpen The new \"open\" state.\n */\n onToggleAppMenu?: (isOpen: boolean) => void;\n\n /**\n * Additional class names that are added to the wrapper component.\n */\n className?: string;\n};\n\nexport const ApplicationHeader = forwardRef((props: ApplicationHeaderProps, ref: ForwardedRef<HTMLDivElement>) => {\n const {\n homeRoute = '',\n showHomeIcon = true,\n label,\n className,\n appNavigator,\n appNavigatorClassName,\n appMenuItems,\n navItems,\n actionBarItems = [],\n onToggleAppMenu = () => {},\n ...remainingProps\n } = props;\n\n const actionBarRef = useRef(null);\n\n const [navRef, entry] = useResizeObserver();\n\n const contentRect = entry?.contentRect;\n\n useImperativeHandle<HTMLDivElement, any>(ref, () => navRef, [navRef]);\n\n const getContentRect = useCallback(\n (key: keyof DOMRectReadOnly) => {\n if (contentRect) {\n const value = contentRect[key];\n return typeof value === 'number' && Math.round(value);\n }\n },\n [contentRect]\n );\n\n // If container width cannot be properly read initially, fall back to window width.\n // This fixes ugly jumping on mobile header and desktop header on mount.\n const containerWidth = getContentRect('width') || window.innerWidth;\n\n const isMobileWidth = containerWidth <= SCREEN_SM;\n\n const hasActionBarItems = !isEmpty(actionBarItems);\n\n const wrapperClassNames = classNames(\n 'ApplicationHeader',\n 'user-select-none',\n isMobileWidth && 'mobile',\n className && className\n );\n\n return (\n <nav {...remainingProps} className={wrapperClassNames} ref={navRef}>\n {isMobileWidth && (\n <React.Fragment>\n <MobileAppMenu\n showHomeIcon={showHomeIcon}\n homeRoute={homeRoute}\n appMenuItems={appMenuItems}\n appNavigator={appNavigator}\n onToggleAppMenu={onToggleAppMenu}\n />\n <div className='flex-1-1-0 display-flex gap-10'>\n <MobileSubmoduleNavigation className='flex-1-1' label={label} navItems={navItems} />\n {hasActionBarItems && <Divider />}\n <ApplicationActionBar className='mobile' nodeRef={actionBarRef} items={actionBarItems} />\n </div>\n </React.Fragment>\n )}\n {!isMobileWidth && (\n <React.Fragment>\n <div className='navbar-header'>\n <span className={`navbar-brand ${showHomeIcon ? 'home-icon' : ''}`}>{homeRoute}</span>\n </div>\n {label && (\n <AppMenu\n label={label}\n key='AppMenu'\n appMenuItems={appMenuItems}\n appNavigator={appNavigator}\n appNavigatorClassName={appNavigatorClassName}\n onToggleAppMenu={onToggleAppMenu}\n />\n )}\n {isEmpty(navItems) && <ul className='SubmoduleNavigation nav' />}\n {!isEmpty(navItems) && (\n <NavItems\n key='NavItems'\n navItems={navItems}\n containerWidth={containerWidth}\n actionBarItems={actionBarItems}\n />\n )}\n <ApplicationActionBar nodeRef={actionBarRef} items={actionBarItems} />\n </React.Fragment>\n )}\n </nav>\n );\n});\n\nconst Divider = () => (\n <div className='divider display-flex align-items-center'>\n <div className='width-3 height-20 bg-lighter' />\n </div>\n);\n\nexport default ApplicationHeader;\n"],"names":["SCREEN_SM","ApplicationHeader","forwardRef","props","ref","homeRoute","showHomeIcon","label","className","appNavigator","appNavigatorClassName","appMenuItems","navItems","actionBarItems","onToggleAppMenu","remainingProps","actionBarRef","useRef","navRef","entry","useResizeObserver","contentRect","useImperativeHandle","containerWidth","useCallback","key","value","isMobileWidth","hasActionBarItems","isEmpty","wrapperClassNames","classNames","jsxs","React","jsx","MobileAppMenu","MobileSubmoduleNavigation","Divider","ApplicationActionBar","AppMenu","NavItems"],"mappings":";;;;;;;;;;AAWA,MAAMA,IAAY,KA0FLC,IAAoBC,EAAW,CAACC,GAA+BC,MAAsC;AAC9G,QAAM;AAAA,IACF,WAAAC,IAAY;AAAA,IACZ,cAAAC,IAAe;AAAA,IACf,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC,IAAiB,CAAA;AAAA,IACjB,iBAAAC,IAAkB,MAAM;AAAA,IAAC;AAAA,IACzB,GAAGC;AAAA,EAAA,IACHZ,GAEEa,IAAeC,EAAO,IAAI,GAE1B,CAACC,GAAQC,CAAK,IAAIC,EAAA,GAElBC,IAAcF,GAAO;AAE3B,EAAAG,EAAyClB,GAAK,MAAMc,GAAQ,CAACA,CAAM,CAAC;AAcpE,QAAMK,IAZiBC;AAAA,IACnB,CAACC,MAA+B;AAC5B,UAAIJ,GAAa;AACb,cAAMK,IAAQL,EAAYI,CAAG;AAC7B,eAAO,OAAOC,KAAU,YAAY,KAAK,MAAMA,CAAK;AAAA,MACxD;AAAA,IACJ;AAAA,IACA,CAACL,CAAW;AAAA,EAAA,EAKsB,OAAO,KAAK,OAAO,YAEnDM,IAAgBJ,KAAkBvB,GAElC4B,IAAoB,CAACC,EAAQhB,CAAc,GAE3CiB,IAAoBC;AAAA,IACtB;AAAA,IACA;AAAA,IACAJ,KAAiB;AAAA,IACjBnB,KAAaA;AAAA,EAAA;AAGjB,2BACK,OAAA,EAAK,GAAGO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,SAAStB,GAAc,OAAOH,EAAA,CAAgB;AAAA,IAAA,EAAA,CACxE;AAAA,EAAA,GAER;AAER,CAAC,GAEKwB,IAAU,MACZ,gBAAAH,EAAC,OAAA,EAAI,WAAU,2CACX,UAAA,gBAAAA,EAAC,OAAA,EAAI,WAAU,+BAAA,CAA+B,EAAA,CAClD;"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as t, Fragment as y, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import w from "react";
|
|
3
3
|
import u from "react-dom";
|
|
4
|
-
import a from "
|
|
5
|
-
import
|
|
4
|
+
import { AnimatePresence as a, motion as r } from "motion/react";
|
|
5
|
+
import s from "../../utils/classNames.js";
|
|
6
6
|
import { getOrCreatePortalRoot as N } from "../../utils/portalRoot.js";
|
|
7
7
|
const b = -1e3, P = (n) => {
|
|
8
8
|
const { show: e = !1, showClose: l = !0, modalClassName: c, className: m, onClose: d = () => {
|
|
9
|
-
}, children: p } = n, h =
|
|
9
|
+
}, children: p } = n, h = s(
|
|
10
10
|
"MobileHeaderModal",
|
|
11
11
|
"position-fixed left-0 right-0 bottom-0",
|
|
12
12
|
"z-index-max",
|
|
13
13
|
m
|
|
14
|
-
), g =
|
|
14
|
+
), g = s(
|
|
15
15
|
"display-flex flex-column justify-content-center",
|
|
16
16
|
"margin-15",
|
|
17
17
|
"text-center",
|
|
@@ -23,8 +23,8 @@ const b = -1e3, P = (n) => {
|
|
|
23
23
|
), f = N(), x = window.innerHeight - 30, o = b - window.innerHeight;
|
|
24
24
|
return /* @__PURE__ */ t(y, { children: u.createPortal(
|
|
25
25
|
/* @__PURE__ */ i(w.Fragment, { children: [
|
|
26
|
-
/* @__PURE__ */ t(
|
|
27
|
-
|
|
26
|
+
/* @__PURE__ */ t(a, { children: e && /* @__PURE__ */ i(
|
|
27
|
+
r.div,
|
|
28
28
|
{
|
|
29
29
|
className: h,
|
|
30
30
|
initial: { opacity: 0, top: o },
|
|
@@ -43,8 +43,8 @@ const b = -1e3, P = (n) => {
|
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
) }),
|
|
46
|
-
/* @__PURE__ */ t(
|
|
47
|
-
|
|
46
|
+
/* @__PURE__ */ t(a, { children: e && /* @__PURE__ */ t(
|
|
47
|
+
r.div,
|
|
48
48
|
{
|
|
49
49
|
className: "bottom-sheet-backdrop",
|
|
50
50
|
initial: { opacity: 0 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileHeaderModal.js","sources":["../../../src/components/applicationHeader/MobileHeaderModal.tsx"],"sourcesContent":["import React, { type PropsWithChildren } from 'react';\nimport ReactDOM from 'react-dom';\nimport
|
|
1
|
+
{"version":3,"file":"MobileHeaderModal.js","sources":["../../../src/components/applicationHeader/MobileHeaderModal.tsx"],"sourcesContent":["import React, { type PropsWithChildren } from 'react';\nimport ReactDOM from 'react-dom';\nimport { AnimatePresence, motion } from 'motion/react';\n\nimport classNames from '../../utils/classNames';\nimport { getOrCreatePortalRoot } from '../../utils/portalRoot';\n\nconst OFFSET_POSITION = -1000;\n\nexport type MobileHeaderModalProps = {\n show?: boolean;\n showClose?: boolean;\n modalClassName?: string;\n onClose?: () => void;\n className?: string;\n};\n\nconst MobileHeaderModal = (props: PropsWithChildren<MobileHeaderModalProps>) => {\n const { show = false, showClose = true, modalClassName, className, onClose = () => {}, children } = props;\n\n const wrapperClasses = classNames(\n 'MobileHeaderModal',\n 'position-fixed left-0 right-0 bottom-0',\n 'z-index-max',\n className\n );\n\n const modalClasses = classNames(\n 'display-flex flex-column justify-content-center',\n 'margin-15',\n 'text-center',\n 'rounded',\n 'bg-white',\n 'shadow-hard',\n 'overflow-auto',\n modalClassName\n );\n\n const modalRoot = getOrCreatePortalRoot();\n\n const pageHeight = window.innerHeight - 30;\n const offset = OFFSET_POSITION - window.innerHeight;\n\n return (\n <>\n {ReactDOM.createPortal(\n <React.Fragment>\n <AnimatePresence>\n {show && (\n <motion.div\n className={wrapperClasses}\n initial={{ opacity: 0, top: offset }}\n animate={{ opacity: 1, y: 0, top: 0 }}\n exit={{ opacity: 0, transition: { duration: 0.3 }, top: offset }}\n >\n <div className={modalClasses} style={{ height: `${pageHeight}px` }}>\n {children}\n </div>\n {showClose && (\n <div\n className={\n 'position-absolute top-15 right-15 margin-top-15 margin-right-15 ' +\n 'text-size-20 text-color-dark'\n }\n onClick={onClose}\n >\n <span className='rioglyph rioglyph-remove' />\n </div>\n )}\n </motion.div>\n )}\n </AnimatePresence>\n <AnimatePresence>\n {show && (\n <motion.div\n className='bottom-sheet-backdrop'\n initial={{ opacity: 0 }}\n animate={{ opacity: 0.5 }}\n exit={{ opacity: 0 }}\n />\n )}\n </AnimatePresence>\n </React.Fragment>,\n modalRoot\n )}\n </>\n );\n};\n\nexport default MobileHeaderModal;\n"],"names":["OFFSET_POSITION","MobileHeaderModal","props","show","showClose","modalClassName","className","onClose","children","wrapperClasses","classNames","modalClasses","modalRoot","getOrCreatePortalRoot","pageHeight","offset","ReactDOM","jsxs","React","jsx","AnimatePresence","motion"],"mappings":";;;;;;AAOA,MAAMA,IAAkB,MAUlBC,IAAoB,CAACC,MAAqD;AAC5E,QAAM,EAAE,MAAAC,IAAO,IAAO,WAAAC,IAAY,IAAM,gBAAAC,GAAgB,WAAAC,GAAW,SAAAC,IAAU,MAAM;AAAA,EAAC,GAAG,UAAAC,MAAaN,GAE9FO,IAAiBC;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACAJ;AAAA,EAAA,GAGEK,IAAeD;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAL;AAAA,EAAA,GAGEO,IAAYC,EAAA,GAEZC,IAAa,OAAO,cAAc,IAClCC,IAASf,IAAkB,OAAO;AAExC,gCAES,UAAAgB,EAAS;AAAA,IACN,gBAAAC,EAACC,EAAM,UAAN,EACG,UAAA;AAAA,MAAA,gBAAAC,EAACC,KACI,UAAAjB,KACG,gBAAAc;AAAA,QAACI,EAAO;AAAA,QAAP;AAAA,UACG,WAAWZ;AAAA,UACX,SAAS,EAAE,SAAS,GAAG,KAAKM,EAAA;AAAA,UAC5B,SAAS,EAAE,SAAS,GAAG,GAAG,GAAG,KAAK,EAAA;AAAA,UAClC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAU,IAAA,GAAO,KAAKA,EAAA;AAAA,UAExD,UAAA;AAAA,YAAA,gBAAAI,EAAC,OAAA,EAAI,WAAWR,GAAc,OAAO,EAAE,QAAQ,GAAGG,CAAU,KAAA,GACvD,UAAAN,EAAA,CACL;AAAA,YACCJ,KACG,gBAAAe;AAAA,cAAC;AAAA,cAAA;AAAA,gBACG,WACI;AAAA,gBAGJ,SAASZ;AAAA,gBAET,UAAA,gBAAAY,EAAC,QAAA,EAAK,WAAU,2BAAA,CAA2B;AAAA,cAAA;AAAA,YAAA;AAAA,UAC/C;AAAA,QAAA;AAAA,MAAA,GAIhB;AAAA,MACA,gBAAAA,EAACC,KACI,UAAAjB,KACG,gBAAAgB;AAAA,QAACE,EAAO;AAAA,QAAP;AAAA,UACG,WAAU;AAAA,UACV,SAAS,EAAE,SAAS,EAAA;AAAA,UACpB,SAAS,EAAE,SAAS,IAAA;AAAA,UACpB,MAAM,EAAE,SAAS,EAAA;AAAA,QAAE;AAAA,MAAA,EACvB,CAER;AAAA,IAAA,GACJ;AAAA,IACAT;AAAA,EAAA,GAER;AAER;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import o, { useState as g } from "react";
|
|
3
|
-
import c from "classnames";
|
|
4
3
|
import { isEmpty as u } from "es-toolkit/compat";
|
|
4
|
+
import c from "../../utils/classNames.js";
|
|
5
5
|
import f from "./MobileHeaderModal.js";
|
|
6
6
|
const z = (r) => {
|
|
7
7
|
const { navItems: s = [], label: n, className: d } = r, [l, m] = g(!1), h = () => m(!l), i = !u(s), p = c(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileSubmoduleNavigation.js","sources":["../../../src/components/applicationHeader/MobileSubmoduleNavigation.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"MobileSubmoduleNavigation.js","sources":["../../../src/components/applicationHeader/MobileSubmoduleNavigation.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\n\nimport classNames from '../../utils/classNames';\nimport MobileHeaderModal from './MobileHeaderModal';\nimport type { ModulePropType } from './ApplicationHeader';\n\nexport type MobileSubmoduleNavigationProps = {\n label: React.ReactNode;\n navItems?: ModulePropType[];\n className?: string;\n};\n\nconst MobileSubmoduleNavigation = (props: MobileSubmoduleNavigationProps) => {\n const { navItems = [], label, className } = props;\n\n const [isShown, setIsShown] = useState(false);\n\n const handleToggleNavigation = () => setIsShown(!isShown);\n\n const hasNavItems = !isEmpty(navItems);\n\n const classes = classNames(\n 'MobileSubmoduleNavigation',\n 'display-flex gap-10 align-items-center',\n 'padding-x-10',\n 'cursor-pointer',\n className\n );\n\n const labelClasses = classNames(\n hasNavItems\n ? 'text-size-12 text-color-dark line-height-14'\n : 'text-size-16 line-height-16 text-color-darkest text-medium text-uppercase',\n 'width-100pct ellipsis-1'\n );\n\n return (\n <div className={classes} onClick={handleToggleNavigation}>\n <div className='flex-1-1 display-flex flex-column align-items-center width-0'>\n <div className={labelClasses}>{label}</div>\n <div className='text-medium width-100pct'>\n {navItems.map(navItem => (\n <div key={navItem.key} className='ellipsis-1'>\n {React.cloneElement(navItem.route as React.ReactElement, {\n className: 'text-size-16 line-height-16 text-color-darkest text-decoration-none',\n onClick: (event: MouseEvent) => event.preventDefault(),\n })}\n </div>\n ))}\n </div>\n </div>\n {hasNavItems && (\n <div className='text-size-16 text-color-dark'>\n <span className='rioglyph rioglyph-chevron-down' />\n </div>\n )}\n {hasNavItems && (\n <MobileHeaderModal show={isShown}>\n {navItems.map(navItem => (\n <div key={navItem.key} className='margin-y-15 font-size-20'>\n {React.cloneElement(navItem.route as React.ReactElement, {\n className: 'text-size-20 text-color-darker',\n })}\n </div>\n ))}\n </MobileHeaderModal>\n )}\n </div>\n );\n};\n\nexport default MobileSubmoduleNavigation;\n"],"names":["MobileSubmoduleNavigation","props","navItems","label","className","isShown","setIsShown","useState","handleToggleNavigation","hasNavItems","isEmpty","classes","classNames","labelClasses","jsxs","jsx","navItem","React","event","MobileHeaderModal"],"mappings":";;;;;AAaA,MAAMA,IAA4B,CAACC,MAA0C;AACzE,QAAM,EAAE,UAAAC,IAAW,CAAA,GAAI,OAAAC,GAAO,WAAAC,MAAcH,GAEtC,CAACI,GAASC,CAAU,IAAIC,EAAS,EAAK,GAEtCC,IAAyB,MAAMF,EAAW,CAACD,CAAO,GAElDI,IAAc,CAACC,EAAQR,CAAQ,GAE/BS,IAAUC;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAR;AAAA,EAAA,GAGES,IAAeD;AAAA,IACjBH,IACM,gDACA;AAAA,IACN;AAAA,EAAA;AAGJ,SACI,gBAAAK,EAAC,OAAA,EAAI,WAAWH,GAAS,SAASH,GAC9B,UAAA;AAAA,IAAA,gBAAAM,EAAC,OAAA,EAAI,WAAU,gEACX,UAAA;AAAA,MAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWF,GAAe,UAAAV,GAAM;AAAA,MACrC,gBAAAY,EAAC,OAAA,EAAI,WAAU,4BACV,YAAS,IAAI,CAAAC,MACV,gBAAAD,EAAC,OAAA,EAAsB,WAAU,cAC5B,UAAAE,EAAM,aAAaD,EAAQ,OAA6B;AAAA,QACrD,WAAW;AAAA,QACX,SAAS,CAACE,MAAsBA,EAAM,eAAA;AAAA,MAAe,CACxD,KAJKF,EAAQ,GAKlB,CACH,EAAA,CACL;AAAA,IAAA,GACJ;AAAA,IACCP,uBACI,OAAA,EAAI,WAAU,gCACX,UAAA,gBAAAM,EAAC,QAAA,EAAK,WAAU,iCAAA,CAAiC,EAAA,CACrD;AAAA,IAEHN,KACG,gBAAAM,EAACI,GAAA,EAAkB,MAAMd,GACpB,UAAAH,EAAS,IAAI,CAAAc,MACV,gBAAAD,EAAC,SAAsB,WAAU,4BAC5B,UAAAE,EAAM,aAAaD,EAAQ,OAA6B;AAAA,MACrD,WAAW;AAAA,IAAA,CACd,KAHKA,EAAQ,GAIlB,CACH,EAAA,CACL;AAAA,EAAA,GAER;AAER;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m, useRef as b, useEffect as L, useLayoutEffect as V } from "react";
|
|
3
|
-
import j from "
|
|
4
|
-
import
|
|
3
|
+
import { isEmpty as j } from "es-toolkit/compat";
|
|
4
|
+
import q from "../../utils/classNames.js";
|
|
5
5
|
import z from "../../hooks/useClickOutside.js";
|
|
6
6
|
import B from "./CollapsedNavItem.js";
|
|
7
7
|
const $ = 50, F = 15, Q = (C) => {
|
|
@@ -42,7 +42,7 @@ const $ = 50, F = 15, Q = (C) => {
|
|
|
42
42
|
children: e.route
|
|
43
43
|
},
|
|
44
44
|
e.key
|
|
45
|
-
), x = () => !t.current && !
|
|
45
|
+
), x = () => !t.current && !j(u) ? [
|
|
46
46
|
...y.map((s) => p(s, t.current)),
|
|
47
47
|
/* @__PURE__ */ i(
|
|
48
48
|
B,
|
|
@@ -56,7 +56,7 @@ const $ = 50, F = 15, Q = (C) => {
|
|
|
56
56
|
},
|
|
57
57
|
"CollapsedNavItem"
|
|
58
58
|
)
|
|
59
|
-
] : r.map((e) => p(e, t.current)), R =
|
|
59
|
+
] : r.map((e) => p(e, t.current)), R = q("SubmoduleNavigation", "nav");
|
|
60
60
|
return /* @__PURE__ */ i("ul", { className: R, ref: f, children: x() });
|
|
61
61
|
};
|
|
62
62
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavItems.js","sources":["../../../src/components/applicationHeader/NavItems.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"NavItems.js","sources":["../../../src/components/applicationHeader/NavItems.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\n\nimport classNames from '../../utils/classNames';\nimport useClickOutside from '../../hooks/useClickOutside';\nimport CollapsedNavItem from './CollapsedNavItem';\nimport type { ModulePropType } from './ApplicationHeader';\n\nconst collapsedDropdownWidth = 50;\nconst paddingLeft = 15;\n\nexport type NavItemsProps = {\n navItems?: ModulePropType[];\n containerWidth: number;\n actionBarItems?: React.ReactNode[];\n};\n\nexport const NavItems = (props: NavItemsProps) => {\n const { navItems: externalNavItems = [], actionBarItems = [], containerWidth } = props;\n\n const [isCollapsedNavItemOpen, setIsCollapsedNavItemOpen] = useState(false);\n const [collapsedNavItems, setCollapsedNavItems] = useState<ModulePropType[]>([]);\n const [visibleNavItems, setVisibleNavItems] = useState<ModulePropType[]>([]);\n\n const collapsedDropdownRef = useClickOutside(() => setIsCollapsedNavItemOpen(false));\n\n const navigationRef = useRef(null);\n const isOffscreen = useRef(true);\n\n // console.log({ containerWidth });\n\n // Before any new changes are applied\n useEffect(() => {\n // After the component received new props, every nav item has to be rendered offscreen\n // again without collapsing them into the dropdown to measure its width\n isOffscreen.current = true;\n }, [externalNavItems, actionBarItems, containerWidth]);\n\n // After the component has been rendered\n useLayoutEffect(() => {\n // After every nav item was rendered offscreen again we need to recalculate the width\n // of the items again and render the result with possible collapsible dropdown.\n if (isOffscreen.current) {\n computeNavItems();\n }\n });\n\n const getAvailableWidth = (element: HTMLElement) => {\n // Get relevant elements\n // const parent = element.parentNode;\n\n // const actionBar = head(parent.getElementsByClassName('ApplicationActionBar'));\n // const actionBarWidth = actionBar && actionBar.childElementCount > 0 ? actionBar.scrollWidth : 0;\n\n // Since the collapsed dropdown has not been rendered yet,\n // use the fixed with for it to compute available width\n const availableWidth = element.scrollWidth - collapsedDropdownWidth - paddingLeft;\n return availableWidth;\n };\n\n const computeNavItems = () => {\n const element: HTMLElement | null = navigationRef.current;\n\n if (!element) {\n return;\n }\n\n const navItems = [...((element as HTMLElement).children || [])];\n\n const availableWidth = getAvailableWidth(element);\n\n if (availableWidth < 0) {\n return;\n }\n\n // Iterate over all rendered navItems to figure out their widths in order to figure out\n // which navItems need to be rendered in the collapsed dropdown\n let requiredNavItemsSize = 0;\n\n const updatedVisibleItems: ModulePropType[] = [];\n const updatedCollapsedItems: ModulePropType[] = [];\n\n navItems.forEach(item => {\n if (!item.className) {\n return;\n }\n\n // Calculate the remaining width\n requiredNavItemsSize = requiredNavItemsSize + item.scrollWidth;\n\n // console.log({ requiredNavItemsSize });\n\n // Use the navItems.key to find corresponding navItems for each DOM node\n const matchedNavItem = externalNavItems.find(navItem => {\n const dataAttr = item.attributes.getNamedItem('data-nav-item-key');\n return dataAttr && navItem.key === dataAttr.value;\n });\n\n if (!matchedNavItem) {\n return;\n }\n\n // Add navItems to the visible group until the available with exceeds.\n // All other navItems will be added to the collapsed group\n if (availableWidth > requiredNavItemsSize) {\n updatedVisibleItems.push(matchedNavItem);\n } else {\n updatedCollapsedItems.push(matchedNavItem);\n }\n });\n\n // Set the state to render the navItems again\n isOffscreen.current = false;\n\n setVisibleNavItems(updatedVisibleItems);\n setCollapsedNavItems(updatedCollapsedItems);\n };\n\n const handleCollapsedDropdown = () => {\n // When the dropdown is open, set showCollapsedNavItems to false so all submodule items\n // are rendered and their size can be computed\n if (isCollapsedNavItemOpen) {\n setIsCollapsedNavItemOpen(false);\n } else {\n // When the dropdown is closed, just set the flag to open is enough\n setIsCollapsedNavItemOpen(true);\n }\n };\n\n const handleCollapsedNavItemSelected = () => {\n // Close collapsed dropdown on item select\n if (isCollapsedNavItemOpen) {\n setIsCollapsedNavItemOpen(false);\n }\n };\n\n const renderNavItem = (navItem: ModulePropType, isItemOffscreen: boolean) => {\n return (\n <li\n key={navItem.key}\n className={`submodule ${isItemOffscreen ? 'offscreen' : ''}`}\n data-nav-item-key={navItem.key}\n >\n {navItem.route}\n </li>\n );\n };\n\n const renderNavItems = () => {\n if (!isOffscreen.current && !isEmpty(collapsedNavItems)) {\n const visibleItems = visibleNavItems.map(navItem => renderNavItem(navItem, isOffscreen.current));\n\n return [\n ...visibleItems,\n <CollapsedNavItem\n key='CollapsedNavItem'\n ref={collapsedDropdownRef}\n show={isCollapsedNavItemOpen}\n navItems={collapsedNavItems}\n actionBarItems={actionBarItems}\n onDropdownClick={handleCollapsedDropdown}\n onItemClick={handleCollapsedNavItemSelected}\n />,\n ];\n }\n\n return externalNavItems.map(navItem => renderNavItem(navItem, isOffscreen.current));\n };\n\n // As all navItems need to be added to the DOM first in order to get their real size\n // the computation whether a navItem need to be shown under the collapsed dropdown or not\n // needs to be done after the component did mount to the DOM.\n\n const classes = classNames('SubmoduleNavigation', 'nav');\n\n return (\n <ul className={classes} ref={navigationRef}>\n {renderNavItems()}\n </ul>\n );\n};\n\nexport default NavItems;\n"],"names":["collapsedDropdownWidth","paddingLeft","NavItems","props","externalNavItems","actionBarItems","containerWidth","isCollapsedNavItemOpen","setIsCollapsedNavItemOpen","useState","collapsedNavItems","setCollapsedNavItems","visibleNavItems","setVisibleNavItems","collapsedDropdownRef","useClickOutside","navigationRef","useRef","isOffscreen","useEffect","useLayoutEffect","computeNavItems","getAvailableWidth","element","navItems","availableWidth","requiredNavItemsSize","updatedVisibleItems","updatedCollapsedItems","item","matchedNavItem","navItem","dataAttr","handleCollapsedDropdown","handleCollapsedNavItemSelected","renderNavItem","isItemOffscreen","jsx","renderNavItems","isEmpty","CollapsedNavItem","classes","classNames"],"mappings":";;;;;;AASA,MAAMA,IAAyB,IACzBC,IAAc,IAQPC,IAAW,CAACC,MAAyB;AAC9C,QAAM,EAAE,UAAUC,IAAmB,CAAA,GAAI,gBAAAC,IAAiB,CAAA,GAAI,gBAAAC,EAAA,IAAmBH,GAE3E,CAACI,GAA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,CAAAD,CAC+B;AAAA,EAKvC,GAEM2B,IAAiC,MAAM;AAEzC,IAAI3B,KACAC,EAA0B,EAAK;AAAA,EAEvC,GAEM2B,IAAgB,CAACJ,GAAyBK,MAExC,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MAEG,WAAW,aAAaD,IAAkB,cAAc,EAAE;AAAA,MAC1D,qBAAmBL,EAAQ;AAAA,MAE1B,UAAAA,EAAQ;AAAA,IAAA;AAAA,IAJJA,EAAQ;AAAA,EAAA,GASnBO,IAAiB,MACf,CAACpB,EAAY,WAAW,CAACqB,EAAQ7B,CAAiB,IAG3C;AAAA,IACH,GAHiBE,EAAgB,IAAI,CAAAmB,MAAWI,EAAcJ,GAASb,EAAY,OAAO,CAAC;AAAA,IAI3F,gBAAAmB;AAAA,MAACG;AAAA,MAAA;AAAA,QAEG,KAAK1B;AAAA,QACL,MAAMP;AAAA,QACN,UAAUG;AAAA,QACV,gBAAAL;AAAA,QACA,iBAAiB4B;AAAA,QACjB,aAAaC;AAAA,MAAA;AAAA,MANT;AAAA,IAAA;AAAA,EAOR,IAID9B,EAAiB,IAAI,CAAA2B,MAAWI,EAAcJ,GAASb,EAAY,OAAO,CAAC,GAOhFuB,IAAUC,EAAW,uBAAuB,KAAK;AAEvD,2BACK,MAAA,EAAG,WAAWD,GAAS,KAAKzB,GACxB,eACL;AAER;"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
|
-
import c from "
|
|
4
|
-
import f from "./
|
|
5
|
-
import l from "./
|
|
6
|
-
import d from "
|
|
7
|
-
import
|
|
8
|
-
|
|
3
|
+
import c from "./ApplicationLayoutHeader.js";
|
|
4
|
+
import f from "./ApplicationLayoutSidebar.js";
|
|
5
|
+
import l from "./ApplicationLayoutBody.js";
|
|
6
|
+
import { initDocumentBootstrapping as d } from "../../utils/init/initDocumentBootstrapping.js";
|
|
7
|
+
import u from "../../utils/classNames.js";
|
|
8
|
+
d();
|
|
9
9
|
const o = n((r, t) => {
|
|
10
|
-
const { className: a, layoutRef: i, children: p, ...e } = r, m =
|
|
10
|
+
const { className: a, layoutRef: i, children: p, ...e } = r, m = u("ApplicationLayout", a);
|
|
11
11
|
return /* @__PURE__ */ s("div", { ...e, ref: t || i, className: m, children: p });
|
|
12
12
|
});
|
|
13
|
-
o.Header =
|
|
14
|
-
o.Sidebar =
|
|
15
|
-
o.Body =
|
|
13
|
+
o.Header = c;
|
|
14
|
+
o.Sidebar = f;
|
|
15
|
+
o.Body = l;
|
|
16
16
|
export {
|
|
17
17
|
o as default
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationLayout.js","sources":["../../../src/components/applicationLayout/ApplicationLayout.tsx"],"sourcesContent":["/* eslint-disable import/order */\nimport {\n forwardRef,\n type PropsWithChildren,\n type ForwardedRef,\n type MutableRefObject,\n type RefAttributes,\n type ForwardRefExoticComponent,\n} from 'react';\
|
|
1
|
+
{"version":3,"file":"ApplicationLayout.js","sources":["../../../src/components/applicationLayout/ApplicationLayout.tsx"],"sourcesContent":["/* eslint-disable import/order */\nimport {\n forwardRef,\n type PropsWithChildren,\n type ForwardedRef,\n type MutableRefObject,\n type RefAttributes,\n type ForwardRefExoticComponent,\n} from 'react';\n\nimport ApplicationLayoutHeader from './ApplicationLayoutHeader';\nimport ApplicationLayoutSidebar from './ApplicationLayoutSidebar';\nimport ApplicationLayoutBody from './ApplicationLayoutBody';\nimport { initDocumentBootstrapping } from '../../utils/init/initDocumentBootstrapping';\nimport classNames from '../../utils/classNames';\n\n// initializes document bootstrapping - keep the import to avoid being tree-shaken\n// noinspection JSIgnoredPromiseFromCall\ninitDocumentBootstrapping();\n\nexport type ApplicationLayoutProps = {\n /**\n * A React ref function assigned to the wrapper element.\n */\n layoutRef?: MutableRefObject<HTMLDivElement | null>;\n\n /**\n * Additional class names that are added to the respective component\n */\n className?: string;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\ntype Props = PropsWithChildren<ApplicationLayoutProps>;\n\ntype ApplicationLayoutType = ForwardRefExoticComponent<Props & RefAttributes<HTMLDivElement>> & {\n Header: typeof ApplicationLayoutHeader;\n Sidebar: typeof ApplicationLayoutSidebar;\n Body: typeof ApplicationLayoutBody;\n};\n\nconst ApplicationLayout = forwardRef((props: Props, ref: Ref) => {\n const { className, layoutRef, children, ...remainingProps } = props;\n\n const classes = classNames('ApplicationLayout', className);\n\n return (\n <div {...remainingProps} ref={ref || layoutRef} className={classes}>\n {children}\n </div>\n );\n}) as ApplicationLayoutType;\n\nApplicationLayout.Header = ApplicationLayoutHeader;\nApplicationLayout.Sidebar = ApplicationLayoutSidebar;\nApplicationLayout.Body = ApplicationLayoutBody;\n\nexport default ApplicationLayout;\n"],"names":["initDocumentBootstrapping","ApplicationLayout","forwardRef","props","ref","className","layoutRef","children","remainingProps","classes","classNames","jsx","ApplicationLayoutHeader","ApplicationLayoutSidebar","ApplicationLayoutBody"],"mappings":";;;;;;;AAkBAA,EAAA;AAuBA,MAAMC,IAAoBC,EAAW,CAACC,GAAcC,MAAa;AAC7D,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,GAAGC,MAAmBL,GAExDM,IAAUC,EAAW,qBAAqBL,CAAS;AAEzD,SACI,gBAAAM,EAAC,SAAK,GAAGH,GAAgB,KAAKJ,KAAOE,GAAW,WAAWG,GACtD,UAAAF,EAAA,CACL;AAER,CAAC;AAEDN,EAAkB,SAASW;AAC3BX,EAAkB,UAAUY;AAC5BZ,EAAkB,OAAOa;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import I, { forwardRef as O, useState as x, useRef as h, useImperativeHandle as _, useEffect as T } from "react";
|
|
3
3
|
import { debounce as k } from "es-toolkit/compat";
|
|
4
|
-
import a from "
|
|
4
|
+
import a from "../../utils/classNames.js";
|
|
5
5
|
import F from "../smoothScrollbars/SmoothScrollbars.js";
|
|
6
6
|
const j = 200, G = 54, Z = O((g, y) => {
|
|
7
7
|
const {
|
|
@@ -32,7 +32,7 @@ const j = 200, G = 54, Z = O((g, y) => {
|
|
|
32
32
|
return;
|
|
33
33
|
const l = o.current.container, f = l.firstElementChild, t = f?.scrollTop ?? 0;
|
|
34
34
|
t > 10 ? (window.requestAnimationFrame(d), f?.scrollTo(0, t - t / 5), l.classList.add("is-scrolling-to-top"), n(t)) : l.classList.remove("is-scrolling-to-top");
|
|
35
|
-
}, w = a("ApplicationLayoutBody", s
|
|
35
|
+
}, w = a("ApplicationLayoutBody", s ? "has-footer" : "", b), v = a(
|
|
36
36
|
"module-content",
|
|
37
37
|
i && i
|
|
38
38
|
), A = window.innerHeight * 0.1, C = a("scroll-to-top", H > A && "in");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationLayoutBody.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutBody.tsx"],"sourcesContent":["import React, {\n useState,\n useRef,\n useEffect,\n forwardRef,\n useImperativeHandle,\n type PropsWithChildren,\n type ForwardedRef,\n} from 'react';\nimport { debounce } from 'es-toolkit/compat';\
|
|
1
|
+
{"version":3,"file":"ApplicationLayoutBody.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutBody.tsx"],"sourcesContent":["import React, {\n useState,\n useRef,\n useEffect,\n forwardRef,\n useImperativeHandle,\n type PropsWithChildren,\n type ForwardedRef,\n} from 'react';\nimport { debounce } from 'es-toolkit/compat';\n\nimport type Scrollbars from 'react-custom-scrollbars-4';\n\nimport classNames from '../../utils/classNames';\nimport SmoothScrollbars from '../smoothScrollbars/SmoothScrollbars';\n\nconst RESIZE_THROTTLING = 200;\nconst DEFAULT_BOTTOM_BAR_HEIGHT = 54;\n\nexport type ApplicationLayoutBodyProps = {\n /**\n * Show scroll to top button after scrolling the content.\n *\n * @default true\n */\n enableScrollToTop?: boolean;\n\n /**\n * Always show vertical scrollbar to prevent the content from jumping.\n *\n * @default true\n */\n forceScrollbar?: boolean;\n\n /**\n * Prop to trigger scroll reset from outside. This comes in handy when changing the body content\n * and to reset the scrolling like when the pathname changes from an body internal menu.\n */\n scrollResetTrigger?: any;\n\n /**\n * The ApplicationLayoutBodyBanner component.\n */\n banner?: React.ReactNode;\n\n /**\n * The `ApplicationLayoutBodyNavigation` component.\n */\n navigation?: React.ReactNode;\n\n /**\n * Optional bottom bar component or a simple string.\n */\n bottomBar?: React.ReactNode;\n\n /**\n * Height of the bottomBar in pixel.\n *\n * @default 54\n */\n bottomBarHeight?: number;\n\n /**\n * Additional class names that are added to the inner module-content component.\n */\n innerClassName?: string;\n\n /**\n * Additional class names that are added to the respective component.\n */\n className?: string;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\ntype Props = PropsWithChildren<ApplicationLayoutBodyProps>;\n\nconst ApplicationLayoutBody = forwardRef((props: Props, ref: Ref) => {\n const {\n className,\n innerClassName,\n forceScrollbar = true,\n enableScrollToTop = true,\n banner,\n navigation,\n bottomBar,\n bottomBarHeight = DEFAULT_BOTTOM_BAR_HEIGHT,\n scrollResetTrigger,\n children,\n ...remainingProps\n } = props;\n\n const [offset, setOffset] = useState(0);\n const moduleContentRef = useRef<Scrollbars>(null);\n const layoutBodyRef = useRef<HTMLDivElement | null>(null);\n\n // Use imperative handle to expose the internal layout ref. Usually this is used to\n // expose internal function without exposing the underlying DOM element.\n // In this case however, we want access to the element to trigger functions like scrollIntoView()\n useImperativeHandle<HTMLDivElement, any>(ref, () => layoutBodyRef?.current, []);\n\n // Reset scroll position when children are different. This fixes the issue of\n // changing body content (like in another route) and still having the same scroll position\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => {\n if (moduleContentRef.current) {\n moduleContentRef.current.scrollTop(0);\n setOffset(0);\n }\n }, [scrollResetTrigger]);\n\n useEffect(() => {\n if (layoutBodyRef.current?.parentNode instanceof HTMLElement) {\n layoutBodyRef.current.parentNode.style.setProperty(\n '--ApplicationLayoutBodyBottomBarHeight',\n `${bottomBarHeight}px`\n );\n }\n }, [bottomBarHeight]);\n\n const handleScroll = debounce(() => {\n if (moduleContentRef.current) {\n setOffset(moduleContentRef.current.getScrollTop());\n }\n }, RESIZE_THROTTLING);\n\n const handleToTop = () => {\n if (!moduleContentRef.current) {\n return;\n }\n\n const scrollWrapper = moduleContentRef.current.container;\n const scrollingElement = scrollWrapper.firstElementChild;\n const currentScroll = scrollingElement?.scrollTop ?? 0;\n const scrollThreshold = 10;\n\n if (currentScroll > scrollThreshold) {\n window.requestAnimationFrame(handleToTop);\n scrollingElement?.scrollTo(0, currentScroll - currentScroll / 5);\n scrollWrapper.classList.add('is-scrolling-to-top');\n setOffset(currentScroll);\n } else {\n scrollWrapper.classList.remove('is-scrolling-to-top');\n }\n };\n\n const classes = classNames('ApplicationLayoutBody', bottomBar ? 'has-footer' : '', className);\n\n const innerClasses = classNames(\n 'module-content',\n\n innerClassName && innerClassName\n );\n\n const offsetThreshold = window.innerHeight * 0.1;\n\n const scrollToTopClasses = classNames('scroll-to-top', offset > offsetThreshold && 'in');\n\n return (\n <React.Fragment>\n <div {...remainingProps} ref={layoutBodyRef} className={classes}>\n <div className='module-content-wrapper'>\n {navigation && navigation}\n {banner && banner}\n\n <SmoothScrollbars\n ref={moduleContentRef}\n slideIn={!forceScrollbar}\n largeTrack\n trackOffset\n className={innerClasses}\n onScroll={handleScroll}\n >\n <div className='scrollbar-content'>{children}</div>\n </SmoothScrollbars>\n </div>\n\n {enableScrollToTop && (\n <span className={scrollToTopClasses}>\n <button type='button' className='btn btn-primary btn-icon-only' onClick={handleToTop}>\n <span className='rioglyph rioglyph-arrow-up' />\n </button>\n </span>\n )}\n </div>\n\n {bottomBar && bottomBar}\n </React.Fragment>\n );\n});\n\nexport default ApplicationLayoutBody;\n"],"names":["RESIZE_THROTTLING","DEFAULT_BOTTOM_BAR_HEIGHT","ApplicationLayoutBody","forwardRef","props","ref","className","innerClassName","forceScrollbar","enableScrollToTop","banner","navigation","bottomBar","bottomBarHeight","scrollResetTrigger","children","remainingProps","offset","setOffset","useState","moduleContentRef","useRef","layoutBodyRef","useImperativeHandle","useEffect","handleScroll","debounce","handleToTop","scrollWrapper","scrollingElement","currentScroll","classes","classNames","innerClasses","offsetThreshold","scrollToTopClasses","jsxs","React","jsx","SmoothScrollbars"],"mappings":";;;;;AAgBA,MAAMA,IAAoB,KACpBC,IAA4B,IA2D5BC,IAAwBC,EAAW,CAACC,GAAcC,MAAa;AACjE,QAAM;AAAA,IACF,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,mBAAAC,IAAoB;AAAA,IACpB,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC,IAAkBZ;AAAA,IAClB,oBAAAa;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHZ,GAEE,CAACa,GAAQC,CAAS,IAAIC,EAAS,CAAC,GAChCC,IAAmBC,EAAmB,IAAI,GAC1CC,IAAgBD,EAA8B,IAAI;AAKxD,EAAAE,EAAyClB,GAAK,MAAMiB,GAAe,SAAS,CAAA,CAAE,GAK9EE,EAAU,MAAM;AACZ,IAAIJ,EAAiB,YACjBA,EAAiB,QAAQ,UAAU,CAAC,GACpCF,EAAU,CAAC;AAAA,EAEnB,GAAG,CAACJ,CAAkB,CAAC,GAEvBU,EAAU,MAAM;AACZ,IAAIF,EAAc,SAAS,sBAAsB,eAC7CA,EAAc,QAAQ,WAAW,MAAM;AAAA,MACnC;AAAA,MACA,GAAGT,CAAe;AAAA,IAAA;AAAA,EAG9B,GAAG,CAACA,CAAe,CAAC;AAEpB,QAAMY,IAAeC,EAAS,MAAM;AAChC,IAAIN,EAAiB,WACjBF,EAAUE,EAAiB,QAAQ,cAAc;AAAA,EAEzD,GAAGpB,CAAiB,GAEd2B,IAAc,MAAM;AACtB,QAAI,CAACP,EAAiB;AAClB;A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A,GAClB;AAER,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationLayoutBodyBanner.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutBodyBanner.tsx"],"sourcesContent":["import { type PropsWithChildren, type ForwardedRef, forwardRef } from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"ApplicationLayoutBodyBanner.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutBodyBanner.tsx"],"sourcesContent":["import { type PropsWithChildren, type ForwardedRef, forwardRef } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nconst DEFAULT_TEXT_COLOR = 'text-color-white';\nconst DEFAULT_BACKGROUND_COLOR = 'bg-primary';\n\nexport type ApplicationLayoutBodyBannerProps = {\n /**\n * One of the `text-color` utility classes.\n * @default `text-color-white`\n */\n textColor?: string;\n /**\n * One of the `bg-color` utility classes.\n * @default `bg-primary`\n */\n backgroundColor?: string;\n /**\n * Allows sticky banner while scrolling.\n * @default false\n */\n isSticky?: boolean;\n /**\n * Additional class names that are added to the respective component.\n */\n className?: string;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\ntype Props = PropsWithChildren<ApplicationLayoutBodyBannerProps>;\n\nconst ApplicationLayoutBodyBanner = forwardRef((props: Props, ref: Ref) => {\n const {\n textColor = DEFAULT_TEXT_COLOR,\n backgroundColor = DEFAULT_BACKGROUND_COLOR,\n isSticky = true,\n className,\n children,\n ...remainingProps\n } = props;\n\n const bannerClasses = classNames(\n 'ApplicationLayoutBodyBanner',\n textColor,\n backgroundColor,\n isSticky && 'position-sticky top-0 z-index-3',\n className\n );\n\n return (\n <div {...remainingProps} ref={ref} className={bannerClasses}>\n {children}\n </div>\n );\n});\n\nexport default ApplicationLayoutBodyBanner;\n"],"names":["DEFAULT_TEXT_COLOR","DEFAULT_BACKGROUND_COLOR","ApplicationLayoutBodyBanner","forwardRef","props","ref","textColor","backgroundColor","isSticky","className","children","remainingProps","bannerClasses","classNames"],"mappings":";;;AAIA,MAAMA,IAAqB,oBACrBC,IAA2B,cA2B3BC,IAA8BC,EAAW,CAACC,GAAcC,MAAa;AACvE,QAAM;AAAA,IACF,WAAAC,IAAYN;AAAA,IACZ,iBAAAO,IAAkBN;AAAA,IAClB,UAAAO,IAAW;AAAA,IACX,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHP,GAEEQ,IAAgBC;AAAA,IAClB;AAAA,IACAP;AAAA,IACAC;AAAA,IACAC,KAAY;AAAA,IACZC;AAAA,EAAA;AAGJ,2BACK,OAAA,EAAK,GAAGE,GAAgB,KAAAN,GAAU,WAAWO,GACzC,UAAAF,GACL;AAER,CAAC;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as f } from "react";
|
|
3
|
-
import l from "
|
|
3
|
+
import l from "../../utils/classNames.js";
|
|
4
4
|
const e = f((s, n) => {
|
|
5
5
|
const { className: o, buttonAlignment: t, useBodyPaddings: a = !1, children: i, ...r } = s, c = l(
|
|
6
6
|
"ApplicationLayoutBodyBottomBar",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationLayoutBodyBottomBar.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutBodyBottomBar.tsx"],"sourcesContent":["import {\n forwardRef,\n type PropsWithChildren,\n type ForwardedRef,\n type ForwardRefExoticComponent,\n type RefAttributes,\n} from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"ApplicationLayoutBodyBottomBar.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutBodyBottomBar.tsx"],"sourcesContent":["import {\n forwardRef,\n type PropsWithChildren,\n type ForwardedRef,\n type ForwardRefExoticComponent,\n type RefAttributes,\n} from 'react';\n\nimport classNames from '../../utils/classNames';\n\ntype ButtonAlignmentLeft = 'left';\ntype ButtonAlignmentRight = 'right';\n\nexport type ApplicationLayoutBodyBottomBarProps = {\n /**\n * Additional class names that are added to the respective component\n */\n className?: string;\n /**\n * Use same paddings (left and right) as the ApplicationLayoutBody.\n * @default false\n */\n useBodyPaddings?: boolean;\n /**\n * Tells the buttons if they are left or right aligned.\n * Default behavior is: 1st button left and 2nd button right.\n *\n * Possible values are:\n * `ApplicationLayoutBodyBottomBar.LEFT`, `ApplicationLayoutBodyBottomBar.RIGHT` or\n * `left`, `right`\n */\n buttonAlignment?: ButtonAlignmentLeft | ButtonAlignmentRight;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\ntype Props = PropsWithChildren<ApplicationLayoutBodyBottomBarProps>;\n\ntype ApplicationLayoutBodyBottomBarType = ForwardRefExoticComponent<Props & RefAttributes<HTMLDivElement>> & {\n LEFT: ButtonAlignmentLeft;\n RIGHT: ButtonAlignmentRight;\n};\n\nconst ApplicationLayoutBodyBottomBar = forwardRef((props: Props, ref: Ref) => {\n const { className, buttonAlignment, useBodyPaddings = false, children, ...remainingProps } = props;\n\n const classes = classNames(\n 'ApplicationLayoutBodyBottomBar',\n buttonAlignment === 'left' && 'justify-content-start',\n buttonAlignment === 'right' && 'justify-content-end',\n buttonAlignment !== 'left' && buttonAlignment !== 'right' && 'justify-content-between',\n useBodyPaddings && 'use-body-padding',\n className && className\n );\n\n return (\n <div ref={ref} {...remainingProps} className={classes}>\n {children}\n </div>\n );\n}) as ApplicationLayoutBodyBottomBarType;\n\nApplicationLayoutBodyBottomBar.LEFT = 'left';\nApplicationLayoutBodyBottomBar.RIGHT = 'right';\n\nexport default ApplicationLayoutBodyBottomBar;\n"],"names":["ApplicationLayoutBodyBottomBar","forwardRef","props","ref","className","buttonAlignment","useBodyPaddings","children","remainingProps","classes","classNames"],"mappings":";;;AA0CA,MAAMA,IAAiCC,EAAW,CAACC,GAAcC,MAAa;AAC1E,QAAM,EAAE,WAAAC,GAAW,iBAAAC,GAAiB,iBAAAC,IAAkB,IAAO,UAAAC,GAAU,GAAGC,MAAmBN,GAEvFO,IAAUC;AAAA,IACZ;AAAA,IACAL,MAAoB,UAAU;AAAA,IAC9BA,MAAoB,WAAW;AAAA,IAC/BA,MAAoB,UAAUA,MAAoB,WAAW;AAAA,IAC7DC,KAAmB;AAAA,IACnBF,KAAaA;AAAA,EAAA;AAGjB,2BACK,OAAA,EAAI,KAAAD,GAAW,GAAGK,GAAgB,WAAWC,GACzC,UAAAF,GACL;AAER,CAAC;AAEDP,EAA+B,OAAO;AACtCA,EAA+B,QAAQ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as e } from "react";
|
|
3
|
-
import m from "
|
|
3
|
+
import m from "../../utils/classNames.js";
|
|
4
4
|
const d = e((a, o) => {
|
|
5
5
|
const { className: i, children: s, ...t } = a, r = m("ApplicationLayoutBodyNavigation", i);
|
|
6
6
|
return /* @__PURE__ */ n("div", { ref: o, ...t, className: r, children: s });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationLayoutBodyNavigation.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutBodyNavigation.tsx"],"sourcesContent":["import { type ForwardedRef, type PropsWithChildren, forwardRef } from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"ApplicationLayoutBodyNavigation.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutBodyNavigation.tsx"],"sourcesContent":["import { type ForwardedRef, type PropsWithChildren, forwardRef } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type ApplicationLayoutBodyNavigationProps = {\n /**\n * Additional class names that are added to the respective component. Example: `has-offset`.\n */\n className?: string;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\ntype Props = PropsWithChildren<ApplicationLayoutBodyNavigationProps>;\n\nconst ApplicationLayoutBodyNavigation = forwardRef((props: Props, ref: Ref) => {\n const { className, children, ...remainingProps } = props;\n\n const navigationClasses = classNames('ApplicationLayoutBodyNavigation', className);\n\n return (\n <div ref={ref} {...remainingProps} className={navigationClasses}>\n {children}\n </div>\n );\n});\n\nexport default ApplicationLayoutBodyNavigation;\n"],"names":["ApplicationLayoutBodyNavigation","forwardRef","props","ref","className","children","remainingProps","navigationClasses","classNames"],"mappings":";;;AAcA,MAAMA,IAAkCC,EAAW,CAACC,GAAcC,MAAa;AAC3E,QAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,MAAmBJ,GAE7CK,IAAoBC,EAAW,mCAAmCJ,CAAS;AAEjF,2BACK,OAAA,EAAI,KAAAD,GAAW,GAAGG,GAAgB,WAAWC,GACzC,UAAAF,GACL;AAER,CAAC;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as c } from "react";
|
|
3
|
-
import p from "
|
|
3
|
+
import p from "../../utils/classNames.js";
|
|
4
4
|
const d = c((a, o) => {
|
|
5
5
|
const { className: r, children: e, ...s } = a, t = p("ApplicationLayoutHeader", r);
|
|
6
6
|
return /* @__PURE__ */ i("div", { ref: o, ...s, className: t, id: "ApplicationLayoutHeader", children: e });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationLayoutHeader.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutHeader.tsx"],"sourcesContent":["import { type ForwardedRef, type PropsWithChildren, forwardRef } from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"ApplicationLayoutHeader.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutHeader.tsx"],"sourcesContent":["import { type ForwardedRef, type PropsWithChildren, forwardRef } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type ApplicationLayoutHeaderProps = {\n /**\n * Additional class names that are added to the respective component.\n */\n className?: string;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\ntype Props = PropsWithChildren<ApplicationLayoutHeaderProps>;\n\nconst ApplicationLayoutHeader = forwardRef((props: Props, ref: Ref) => {\n const { className, children, ...remainingProps } = props;\n\n const classes = classNames('ApplicationLayoutHeader', className);\n\n return (\n <div ref={ref} {...remainingProps} className={classes} id='ApplicationLayoutHeader'>\n {children}\n </div>\n );\n});\n\nexport default ApplicationLayoutHeader;\n"],"names":["ApplicationLayoutHeader","forwardRef","props","ref","className","children","remainingProps","classes","classNames","jsx"],"mappings":";;;AAcA,MAAMA,IAA0BC,EAAW,CAACC,GAAcC,MAAa;AACnE,QAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,MAAmBJ,GAE7CK,IAAUC,EAAW,2BAA2BJ,CAAS;AAE/D,SACI,gBAAAK,EAAC,SAAI,KAAAN,GAAW,GAAGG,GAAgB,WAAWC,GAAS,IAAG,2BACrD,UAAAF,EAAA,CACL;AAER,CAAC;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as c } from "react";
|
|
3
|
-
import m from "
|
|
3
|
+
import m from "../../utils/classNames.js";
|
|
4
4
|
const d = c((a, o) => {
|
|
5
5
|
const { className: r, children: s, ...i } = a, t = m("ApplicationLayoutSidebar", r);
|
|
6
6
|
return /* @__PURE__ */ e("div", { ref: o, ...i, className: t, children: s });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationLayoutSidebar.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutSidebar.tsx"],"sourcesContent":["import { type ForwardedRef, type PropsWithChildren, forwardRef } from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"ApplicationLayoutSidebar.js","sources":["../../../src/components/applicationLayout/ApplicationLayoutSidebar.tsx"],"sourcesContent":["import { type ForwardedRef, type PropsWithChildren, forwardRef } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type ApplicationLayoutSidebarProps = {\n /**\n * Additional class names that are added to the respective component\n */\n className?: string;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\ntype Props = PropsWithChildren<ApplicationLayoutSidebarProps>;\n\nconst ApplicationLayoutSidebar = forwardRef((props: Props, ref: Ref) => {\n const { className, children, ...remainingProps } = props;\n const classes = classNames('ApplicationLayoutSidebar', className);\n\n return (\n <div ref={ref} {...remainingProps} className={classes}>\n {children}\n </div>\n );\n});\n\nexport default ApplicationLayoutSidebar;\n"],"names":["ApplicationLayoutSidebar","forwardRef","props","ref","className","children","remainingProps","classes","classNames"],"mappings":";;;AAcA,MAAMA,IAA2BC,EAAW,CAACC,GAAcC,MAAa;AACpE,QAAM,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,MAAmBJ,GAC7CK,IAAUC,EAAW,4BAA4BJ,CAAS;AAEhE,2BACK,OAAA,EAAI,KAAAD,GAAW,GAAGG,GAAgB,WAAWC,GACzC,UAAAF,GACL;AAER,CAAC;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as m } from "react";
|
|
3
|
-
import n from "
|
|
3
|
+
import n from "../../utils/classNames.js";
|
|
4
4
|
const N = m((s, e) => {
|
|
5
5
|
const { className: i, navItems: r = [], ...t } = s, l = n("SubNavigation", "width-100pct overflow-auto", i);
|
|
6
6
|
return /* @__PURE__ */ o("div", { ref: e, ...t, className: l, children: /* @__PURE__ */ o("ul", { className: "SubmoduleNavigation nav", children: r.map((a) => /* @__PURE__ */ o("li", { className: "submodule", "data-nav-item-key": a.key, children: a.route }, a.key)) }) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubNavigation.js","sources":["../../../src/components/applicationLayout/SubNavigation.tsx"],"sourcesContent":["import { forwardRef, type ForwardedRef } from 'react';\nimport classNames from '
|
|
1
|
+
{"version":3,"file":"SubNavigation.js","sources":["../../../src/components/applicationLayout/SubNavigation.tsx"],"sourcesContent":["import { forwardRef, type ForwardedRef } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nimport type { ModulePropType } from '../applicationHeader/ApplicationHeader';\n\nexport type SubNavigationProps = {\n /**\n * List of navigation items with key and route prop.\n * The route prop is a react-router NavLink component with an `active` style.\n */\n navItems?: ModulePropType[];\n\n /**\n * Additional classes for the wrapper element.\n */\n className?: string;\n};\n\ntype Ref = ForwardedRef<HTMLDivElement>;\n\nconst SubNavigation = forwardRef((props: SubNavigationProps, ref: Ref) => {\n const { className, navItems = [], ...remainingProps } = props;\n\n const navigationClasses = classNames('SubNavigation', 'width-100pct overflow-auto', className);\n\n return (\n <div ref={ref} {...remainingProps} className={navigationClasses}>\n <ul className='SubmoduleNavigation nav'>\n {navItems.map(navItem => (\n <li className='submodule' key={navItem.key} data-nav-item-key={navItem.key}>\n {navItem.route}\n </li>\n ))}\n </ul>\n </div>\n );\n});\n\nexport default SubNavigation;\n"],"names":["SubNavigation","forwardRef","props","ref","className","navItems","remainingProps","navigationClasses","classNames","jsx","navItem"],"mappings":";;;AAqBA,MAAMA,IAAgBC,EAAW,CAACC,GAA2BC,MAAa;AACtE,QAAM,EAAE,WAAAC,GAAW,UAAAC,IAAW,CAAA,GAAI,GAAGC,MAAmBJ,GAElDK,IAAoBC,EAAW,iBAAiB,8BAA8BJ,CAAS;AAE7F,SACI,gBAAAK,EAAC,OAAA,EAAI,KAAAN,GAAW,GAAGG,GAAgB,WAAWC,GAC1C,UAAA,gBAAAE,EAAC,MAAA,EAAG,WAAU,2BACT,UAAAJ,EAAS,IAAI,CAAAK,MACV,gBAAAD,EAAC,MAAA,EAAG,WAAU,aAA8B,qBAAmBC,EAAQ,KAClE,UAAAA,EAAQ,SADkBA,EAAQ,GAEvC,CACH,EAAA,CACL,GACJ;AAER,CAAC;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as A, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import R, { memo as re, forwardRef as oe, useState as f, useRef as ne } from "react";
|
|
3
|
-
import g from "classnames";
|
|
4
3
|
import { noop as y, head as E, isArray as L } from "es-toolkit/compat";
|
|
5
4
|
import ie from "tiny-invariant";
|
|
5
|
+
import g from "../../utils/classNames.js";
|
|
6
6
|
import de from "./TreeCategory.js";
|
|
7
7
|
import T from "../resizer/Resizer.js";
|
|
8
8
|
import ae from "./TreeSidebar.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetTree.js","sources":["../../../src/components/assetTree/AssetTree.tsx"],"sourcesContent":["import React, { memo, useState, useRef, forwardRef, type PropsWithChildren } from 'react';\nimport classNames from 'classnames';\nimport { head, isArray, noop } from 'es-toolkit/compat';\nimport invariant from 'tiny-invariant';\n\nimport TreeCategory, { type TreeCategoryProps } from './TreeCategory';\nimport Resizer from '../resizer/Resizer';\nimport TreeSidebar from './TreeSidebar';\nimport getWidthInBoundaries from '../../utils/getWidthInBoundaries';\nimport mergeRefs from '../../utils/mergeRefs';\nimport usePrevious from '../../usePrevious';\nimport SmoothScrollbars from '../smoothScrollbars/SmoothScrollbars';\n\nconst DEFAULT_WIDTH = 350;\nconst DEFAULT_MIN_WIDTH = 100;\nconst DEFAULT_MAX_WIDTH = 0;\n\nconst TreeMode = {\n MODE_FLY: 'fly',\n MODE_FLUID: 'fluid',\n} as const;\n\nconst getSidebarBodyRef = (sidebarRef: React.MutableRefObject<HTMLDivElement | null>) =>\n head(sidebarRef?.current?.getElementsByClassName('AssetTreeBody'));\n\nconst getCurrentCategoryElement = (children: React.ReactElement[], currentCategoryId: string) => {\n return isArray(children) ? children.find(child => child && child.props.id === currentCategoryId) : children;\n};\n\nconst renderTreesOffscreen = (children: React.ReactElement[], categoryId: string | undefined) => {\n return React.Children.map(children, child => {\n const offscreenClasses = classNames(\n 'TreeOffscreenWrapper',\n child && child.props.id !== categoryId && 'position-offscreen pointer-events-none'\n );\n return <div className={offscreenClasses}>{child}</div>;\n });\n};\n\nexport type AssetTreeProps = {\n /**\n * Defines if the component will overlap the body content.\n *\n * @default false\n */\n fly?: boolean;\n\n /**\n * Defines whether or not the sidebar is resizable.\n *\n * @default true\n */\n resizable?: boolean;\n\n /**\n * Defines whether the component has a border or not.\n *\n * @default false\n */\n bordered?: boolean;\n\n /**\n * Defines the width of the component. The value is set as inline style.\n *\n * Note: when component is resizable it will take the provided\n * width in px only and convert it to number in case.\n *\n * @default 350\n */\n width?: number;\n\n /**\n * Defines the minimum width of the component in px that will take effect when resizing.\n *\n * @default 100\n */\n minWidth?: number;\n\n /**\n * Defines the maximum width of the component in px that will take effect when resizing.\n *\n * @default 0\n */\n maxWidth?: number;\n\n /**\n * Defines the height of the component in px.\n */\n height?: number;\n\n /**\n * Defines whether the component is open or not.\n *\n * @default true\n */\n isOpen?: boolean;\n\n /**\n * Callback for when the tree visibility is toggled.\n *\n * @default () => {}\n * @param isOpen\n * @returns\n */\n onToggleTree?: (isOpen: boolean) => void;\n\n /**\n * The id of the category which is currently active and shall be shown.\n */\n currentCategoryId?: string;\n\n /**\n * Callback for handling change of category.\n *\n * @default () => {}\n * @param selectedCategoryId\n * @returns\n */\n onCategoryChange?: (selectedCategoryId: string) => void;\n\n /**\n * Callback for when the resize is done.\n *\n * @default () => {}\n */\n onResizeEnd?: VoidFunction;\n\n /**\n * Defines whether the tree components are rendered offscreen and kept mounted in the DOM.\n *\n * @default false\n */\n useOffscreen?: boolean;\n\n /**\n * Additional classes added on the wrapper element.\n */\n className?: string;\n};\n\n// Check if the child is a React element and if it has the type TreeCategory\nconst isTreeCategory = (child: React.ReactNode): child is React.ReactElement<TreeCategoryProps> => {\n return React.isValidElement(child) && child.type === TreeCategory;\n};\n\nconst AssetTree = memo(\n forwardRef<HTMLDivElement, PropsWithChildren<AssetTreeProps>>((props, ref) => {\n const {\n className,\n resizable = true,\n width = DEFAULT_WIDTH,\n minWidth = DEFAULT_MIN_WIDTH,\n maxWidth = DEFAULT_MAX_WIDTH,\n height,\n bordered = false,\n currentCategoryId,\n isOpen = true,\n useOffscreen = false,\n fly = false,\n onCategoryChange = noop,\n onToggleTree = noop,\n onResizeEnd = noop,\n children = [],\n ...remainingProps\n } = props;\n\n const getSidebarMode = (isFly: boolean) => (isFly ? TreeMode.MODE_FLY : TreeMode.MODE_FLUID);\n\n const [treeWidth, setTreeWidth] = useState(width);\n const [isResize, setIsResize] = useState(false);\n const [sidebarMode, setSidebarMode] = useState(getSidebarMode(fly));\n\n const sidebarRef = useRef<HTMLDivElement>(null);\n\n const mergedRefs = mergeRefs([ref, sidebarRef]);\n\n // Update internal state when props change\n const previousWidth = usePrevious(width);\n if (previousWidth !== width) {\n setTreeWidth(width);\n }\n\n const [previousMode, setPreviousMode] = useState(fly);\n if (previousMode !== fly) {\n setSidebarMode(getSidebarMode(fly));\n setPreviousMode(fly);\n }\n\n const childrenArray = React.Children.toArray(children);\n\n // check for children type of TreeCategory and throw error in case\n invariant(childrenArray.every(isTreeCategory), 'AssetTree only excepts children of type \"TreeCategory\"');\n\n const classes = classNames(\n 'AssetTree',\n className,\n !isOpen && 'closed',\n bordered && 'border',\n sidebarMode === TreeMode.MODE_FLY ? 'fly' : 'fluid'\n );\n\n const resizeLimitClasses = classNames('AssetTreeResizeLimit', isResize && 'display-block');\n\n const resizeIndicatorPosition = maxWidth || window.innerWidth * 0.5;\n const resizeLimitStyle = { left: resizeIndicatorPosition };\n\n const firstChild = head(childrenArray);\n\n const category = currentCategoryId ? getCurrentCategoryElement(childrenArray, currentCategoryId) : firstChild;\n\n const style = {\n width: treeWidth,\n height,\n };\n\n const handleToggleTreeContent = () => onToggleTree(!isOpen);\n\n const handleSelectCategory = (selectedCategoryId: string) => {\n onCategoryChange(selectedCategoryId);\n\n if (!isOpen) {\n handleToggleTreeContent();\n } else if (isOpen && currentCategoryId === selectedCategoryId) {\n handleToggleTreeContent();\n }\n };\n\n const handleResize = (diff: number) => {\n const halfWindowWidth = window.innerWidth * 0.5;\n const usedMaxWidth = maxWidth || halfWindowWidth;\n\n // Check for sidebar width if it is half window size. If it was before but the sidebar was resized so it is\n // no longer half window size, set the sidebar width to half the window size to avoid jumping sidebar\n // to old width\n setTreeWidth(oldWidth => {\n const updatedWidth = oldWidth - diff;\n return getWidthInBoundaries(minWidth, usedMaxWidth, updatedWidth);\n });\n };\n\n const handleResizeStart = () => {\n const body = getSidebarBodyRef(sidebarRef);\n if (body) {\n body.classList.add('pointer-events-none');\n }\n setIsResize(true);\n };\n\n const handleResizeEnd = () => {\n const body = getSidebarBodyRef(sidebarRef);\n if (body) {\n body.classList.remove('pointer-events-none');\n }\n setIsResize(false);\n onResizeEnd();\n };\n\n return (\n <div {...remainingProps} className={classes} style={style} ref={mergedRefs}>\n <div className={resizeLimitClasses} style={resizeLimitStyle} />\n <div className='AssetTreeContent'>\n <TreeSidebar\n onSelectCategory={handleSelectCategory}\n currentCategoryId={currentCategoryId}\n onClick={handleToggleTreeContent}\n >\n {isArray(children) ? children : [children]}\n </TreeSidebar>\n <SmoothScrollbars slideIn className='AssetTreeBody'>\n {useOffscreen ? renderTreesOffscreen(childrenArray, currentCategoryId) : category}\n </SmoothScrollbars>\n </div>\n {resizable && isOpen && (\n <Resizer\n onResizeStart={handleResizeStart}\n onResize={handleResize}\n onResizeEnd={handleResizeEnd}\n direction={Resizer.HORIZONTAL}\n position={Resizer.RIGHT}\n />\n )}\n </div>\n );\n })\n);\n\nObject.assign(AssetTree, TreeMode);\n\nexport default AssetTree;\n"],"names":["DEFAULT_WIDTH","DEFAULT_MIN_WIDTH","DEFAULT_MAX_WIDTH","TreeMode","getSidebarBodyRef","sidebarRef","head","getCurrentCategoryElement","children","currentCategoryId","isArray","child","renderTreesOffscreen","categoryId","React","offscreenClasses","classNames","jsx","isTreeCategory","TreeCategory","AssetTree","memo","forwardRef","props","ref","className","resizable","width","minWidth","maxWidth","height","bordered","isOpen","useOffscreen","fly","onCategoryChange","noop","onToggleTree","onResizeEnd","remainingProps","getSidebarMode","isFly","treeWidth","setTreeWidth","useState","isResize","setIsResize","sidebarMode","setSidebarMode","useRef","mergedRefs","mergeRefs","usePrevious","previousMode","setPreviousMode","childrenArray","invariant","classes","resizeLimitClasses","resizeLimitStyle","firstChild","category","style","handleToggleTreeContent","handleSelectCategory","selectedCategoryId","handleResize","diff","halfWindowWidth","usedMaxWidth","oldWidth","updatedWidth","getWidthInBoundaries","handleResizeStart","body","handleResizeEnd","jsxs","TreeSidebar","SmoothScrollbars","Resizer"],"mappings":";;;;;;;;;;;;AAaA,MAAMA,KAAgB,KAChBC,KAAoB,KACpBC,KAAoB,GAEpBC,IAAW;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AAChB,GAEMC,IAAoB,CAACC,MACvBC,EAAKD,GAAY,SAAS,uBAAuB,eAAe,CAAC,GAE/DE,KAA4B,CAACC,GAAgCC,MACxDC,EAAQF,CAAQ,IAAIA,EAAS,KAAK,CAAAG,MAASA,KAASA,EAAM,MAAM,OAAOF,CAAiB,IAAID,GAGjGI,KAAuB,CAACJ,GAAgCK,MACnDC,EAAM,SAAS,IAAIN,GAAU,CAAAG,MAAS;AACzC,QAAMI,IAAmBC;AAAA,IACrB;AAAA,IACAL,KAASA,EAAM,MAAM,OAAOE,KAAc;AAAA,EAAA;AAE9C,SAAO,gBAAAI,EAAC,OAAA,EAAI,WAAWF,GAAmB,UAAAJ,GAAM;AACpD,CAAC,GAyGCO,KAAiB,CAACP,MACbG,EAAM,eAAeH,CAAK,KAAKA,EAAM,SAASQ,IAGnDC,KAAYC;AAAA,EACdC,GAA8D,CAACC,GAAOC,MAAQ;AAC1E,UAAM;AAAA,MACF,WAAAC;AAAA,MACA,WAAAC,IAAY;AAAA,MACZ,OAAAC,IAAQ3B;AAAA,MACR,UAAA4B,IAAW3B;AAAA,MACX,UAAA4B,IAAW3B;AAAA,MACX,QAAA4B;AAAA,MACA,UAAAC,IAAW;AAAA,MACX,mBAAAtB;AAAA,MACA,QAAAuB,IAAS;AAAA,MACT,cAAAC,IAAe;AAAA,MACf,KAAAC,IAAM;AAAA,MACN,kBAAAC,IAAmBC;AAAA,MACnB,cAAAC,IAAeD;AAAA,MACf,aAAAE,IAAcF;AAAA,MACd,UAAA5B,IAAW,CAAA;AAAA,MACX,GAAG+B;AAAA,IAAA,IACHhB,GAEEiB,IAAiB,CAACC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,OAAO,OAAO3D,IAAWjB,CAAQ;"}
|
|
1
|
+
{"version":3,"file":"AssetTree.js","sources":["../../../src/components/assetTree/AssetTree.tsx"],"sourcesContent":["import React, { memo, useState, useRef, forwardRef, type PropsWithChildren } from 'react';\nimport { head, isArray, noop } from 'es-toolkit/compat';\nimport invariant from 'tiny-invariant';\n\nimport classNames from '../../utils/classNames';\nimport TreeCategory, { type TreeCategoryProps } from './TreeCategory';\nimport Resizer from '../resizer/Resizer';\nimport TreeSidebar from './TreeSidebar';\nimport getWidthInBoundaries from '../../utils/getWidthInBoundaries';\nimport mergeRefs from '../../utils/mergeRefs';\nimport usePrevious from '../../usePrevious';\nimport SmoothScrollbars from '../smoothScrollbars/SmoothScrollbars';\n\nconst DEFAULT_WIDTH = 350;\nconst DEFAULT_MIN_WIDTH = 100;\nconst DEFAULT_MAX_WIDTH = 0;\n\nconst TreeMode = {\n MODE_FLY: 'fly',\n MODE_FLUID: 'fluid',\n} as const;\n\nconst getSidebarBodyRef = (sidebarRef: React.MutableRefObject<HTMLDivElement | null>) =>\n head(sidebarRef?.current?.getElementsByClassName('AssetTreeBody'));\n\nconst getCurrentCategoryElement = (children: React.ReactElement[], currentCategoryId: string) => {\n return isArray(children) ? children.find(child => child && child.props.id === currentCategoryId) : children;\n};\n\nconst renderTreesOffscreen = (children: React.ReactElement[], categoryId: string | undefined) => {\n return React.Children.map(children, child => {\n const offscreenClasses = classNames(\n 'TreeOffscreenWrapper',\n child && child.props.id !== categoryId && 'position-offscreen pointer-events-none'\n );\n return <div className={offscreenClasses}>{child}</div>;\n });\n};\n\nexport type AssetTreeProps = {\n /**\n * Defines if the component will overlap the body content.\n *\n * @default false\n */\n fly?: boolean;\n\n /**\n * Defines whether or not the sidebar is resizable.\n *\n * @default true\n */\n resizable?: boolean;\n\n /**\n * Defines whether the component has a border or not.\n *\n * @default false\n */\n bordered?: boolean;\n\n /**\n * Defines the width of the component. The value is set as inline style.\n *\n * Note: when component is resizable it will take the provided\n * width in px only and convert it to number in case.\n *\n * @default 350\n */\n width?: number;\n\n /**\n * Defines the minimum width of the component in px that will take effect when resizing.\n *\n * @default 100\n */\n minWidth?: number;\n\n /**\n * Defines the maximum width of the component in px that will take effect when resizing.\n *\n * @default 0\n */\n maxWidth?: number;\n\n /**\n * Defines the height of the component in px.\n */\n height?: number;\n\n /**\n * Defines whether the component is open or not.\n *\n * @default true\n */\n isOpen?: boolean;\n\n /**\n * Callback for when the tree visibility is toggled.\n *\n * @default () => {}\n * @param isOpen\n * @returns\n */\n onToggleTree?: (isOpen: boolean) => void;\n\n /**\n * The id of the category which is currently active and shall be shown.\n */\n currentCategoryId?: string;\n\n /**\n * Callback for handling change of category.\n *\n * @default () => {}\n * @param selectedCategoryId\n * @returns\n */\n onCategoryChange?: (selectedCategoryId: string) => void;\n\n /**\n * Callback for when the resize is done.\n *\n * @default () => {}\n */\n onResizeEnd?: VoidFunction;\n\n /**\n * Defines whether the tree components are rendered offscreen and kept mounted in the DOM.\n *\n * @default false\n */\n useOffscreen?: boolean;\n\n /**\n * Additional classes added on the wrapper element.\n */\n className?: string;\n};\n\n// Check if the child is a React element and if it has the type TreeCategory\nconst isTreeCategory = (child: React.ReactNode): child is React.ReactElement<TreeCategoryProps> => {\n return React.isValidElement(child) && child.type === TreeCategory;\n};\n\nconst AssetTree = memo(\n forwardRef<HTMLDivElement, PropsWithChildren<AssetTreeProps>>((props, ref) => {\n const {\n className,\n resizable = true,\n width = DEFAULT_WIDTH,\n minWidth = DEFAULT_MIN_WIDTH,\n maxWidth = DEFAULT_MAX_WIDTH,\n height,\n bordered = false,\n currentCategoryId,\n isOpen = true,\n useOffscreen = false,\n fly = false,\n onCategoryChange = noop,\n onToggleTree = noop,\n onResizeEnd = noop,\n children = [],\n ...remainingProps\n } = props;\n\n const getSidebarMode = (isFly: boolean) => (isFly ? TreeMode.MODE_FLY : TreeMode.MODE_FLUID);\n\n const [treeWidth, setTreeWidth] = useState(width);\n const [isResize, setIsResize] = useState(false);\n const [sidebarMode, setSidebarMode] = useState(getSidebarMode(fly));\n\n const sidebarRef = useRef<HTMLDivElement>(null);\n\n const mergedRefs = mergeRefs([ref, sidebarRef]);\n\n // Update internal state when props change\n const previousWidth = usePrevious(width);\n if (previousWidth !== width) {\n setTreeWidth(width);\n }\n\n const [previousMode, setPreviousMode] = useState(fly);\n if (previousMode !== fly) {\n setSidebarMode(getSidebarMode(fly));\n setPreviousMode(fly);\n }\n\n const childrenArray = React.Children.toArray(children);\n\n // check for children type of TreeCategory and throw error in case\n invariant(childrenArray.every(isTreeCategory), 'AssetTree only excepts children of type \"TreeCategory\"');\n\n const classes = classNames(\n 'AssetTree',\n className,\n !isOpen && 'closed',\n bordered && 'border',\n sidebarMode === TreeMode.MODE_FLY ? 'fly' : 'fluid'\n );\n\n const resizeLimitClasses = classNames('AssetTreeResizeLimit', isResize && 'display-block');\n\n const resizeIndicatorPosition = maxWidth || window.innerWidth * 0.5;\n const resizeLimitStyle = { left: resizeIndicatorPosition };\n\n const firstChild = head(childrenArray);\n\n const category = currentCategoryId ? getCurrentCategoryElement(childrenArray, currentCategoryId) : firstChild;\n\n const style = {\n width: treeWidth,\n height,\n };\n\n const handleToggleTreeContent = () => onToggleTree(!isOpen);\n\n const handleSelectCategory = (selectedCategoryId: string) => {\n onCategoryChange(selectedCategoryId);\n\n if (!isOpen) {\n handleToggleTreeContent();\n } else if (isOpen && currentCategoryId === selectedCategoryId) {\n handleToggleTreeContent();\n }\n };\n\n const handleResize = (diff: number) => {\n const halfWindowWidth = window.innerWidth * 0.5;\n const usedMaxWidth = maxWidth || halfWindowWidth;\n\n // Check for sidebar width if it is half window size. If it was before but the sidebar was resized so it is\n // no longer half window size, set the sidebar width to half the window size to avoid jumping sidebar\n // to old width\n setTreeWidth(oldWidth => {\n const updatedWidth = oldWidth - diff;\n return getWidthInBoundaries(minWidth, usedMaxWidth, updatedWidth);\n });\n };\n\n const handleResizeStart = () => {\n const body = getSidebarBodyRef(sidebarRef);\n if (body) {\n body.classList.add('pointer-events-none');\n }\n setIsResize(true);\n };\n\n const handleResizeEnd = () => {\n const body = getSidebarBodyRef(sidebarRef);\n if (body) {\n body.classList.remove('pointer-events-none');\n }\n setIsResize(false);\n onResizeEnd();\n };\n\n return (\n <div {...remainingProps} className={classes} style={style} ref={mergedRefs}>\n <div className={resizeLimitClasses} style={resizeLimitStyle} />\n <div className='AssetTreeContent'>\n <TreeSidebar\n onSelectCategory={handleSelectCategory}\n currentCategoryId={currentCategoryId}\n onClick={handleToggleTreeContent}\n >\n {isArray(children) ? children : [children]}\n </TreeSidebar>\n <SmoothScrollbars slideIn className='AssetTreeBody'>\n {useOffscreen ? renderTreesOffscreen(childrenArray, currentCategoryId) : category}\n </SmoothScrollbars>\n </div>\n {resizable && isOpen && (\n <Resizer\n onResizeStart={handleResizeStart}\n onResize={handleResize}\n onResizeEnd={handleResizeEnd}\n direction={Resizer.HORIZONTAL}\n position={Resizer.RIGHT}\n />\n )}\n </div>\n );\n })\n);\n\nObject.assign(AssetTree, TreeMode);\n\nexport default AssetTree;\n"],"names":["DEFAULT_WIDTH","DEFAULT_MIN_WIDTH","DEFAULT_MAX_WIDTH","TreeMode","getSidebarBodyRef","sidebarRef","head","getCurrentCategoryElement","children","currentCategoryId","isArray","child","renderTreesOffscreen","categoryId","React","offscreenClasses","classNames","jsx","isTreeCategory","TreeCategory","AssetTree","memo","forwardRef","props","ref","className","resizable","width","minWidth","maxWidth","height","bordered","isOpen","useOffscreen","fly","onCategoryChange","noop","onToggleTree","onResizeEnd","remainingProps","getSidebarMode","isFly","treeWidth","setTreeWidth","useState","isResize","setIsResize","sidebarMode","setSidebarMode","useRef","mergedRefs","mergeRefs","usePrevious","previousMode","setPreviousMode","childrenArray","invariant","classes","resizeLimitClasses","resizeLimitStyle","firstChild","category","style","handleToggleTreeContent","handleSelectCategory","selectedCategoryId","handleResize","diff","halfWindowWidth","usedMaxWidth","oldWidth","updatedWidth","getWidthInBoundaries","handleResizeStart","body","handleResizeEnd","jsxs","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