@rio-cloud/rio-uikit 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CircularProgress.d.ts +2 -0
- package/CircularProgress.js +5 -0
- package/CircularProgress.js.map +1 -0
- package/RadioCardGroup.d.ts +2 -0
- package/RadioCardGroup.js +7 -0
- package/RadioCardGroup.js.map +1 -0
- package/SearchHighlightText.d.ts +2 -0
- package/SearchHighlightText.js +5 -0
- package/SearchHighlightText.js.map +1 -0
- package/TextTruncateMiddle.d.ts +2 -0
- package/TextTruncateMiddle.js +5 -0
- package/TextTruncateMiddle.js.map +1 -0
- package/Tracker.d.ts +2 -0
- package/Tracker.js +5 -0
- package/Tracker.js.map +1 -0
- package/classNames.d.ts +2 -0
- package/classNames.js +5 -0
- package/classNames.js.map +1 -0
- package/components/accentBar/AccentBar.js +1 -1
- package/components/accentBar/AccentBar.js.map +1 -1
- package/components/actionBarItem/ActionBarItem.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 +164 -148
- 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.map +1 -1
- package/components/table/TableSettingsListItem.d.ts +1 -1
- package/components/table/TableSettingsListItem.js +8 -8
- package/components/table/TableSettingsListItem.js.map +1 -1
- package/components/table/TableToolbar.js +1 -1
- package/components/table/TableToolbar.js.map +1 -1
- package/components/table/TableViewToggles.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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePicker.js","sources":["../../../src/components/datepicker/DateRangePicker.jsx"],"sourcesContent":["import { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport onClickOutside from 'react-onclickoutside';\nimport moment from 'moment';\nimport classNames from 'classnames';\nimport { isEqual, isNull, isNil } from 'es-toolkit/predicate';\n\nimport DatePicker from './DatePicker';\nimport getDropDirection from '../../utils/getDropDirection';\n\nconst Placeholder = ({ text }) => <span className='placeholder'>{text}</span>;\n\nconst propTypes = {\n startValue: PropTypes.object,\n endValue: PropTypes.object,\n defaultStartValue: PropTypes.object,\n defaultEndValue: PropTypes.object,\n minValue: PropTypes.object,\n maxValue: PropTypes.object,\n onRangeChange: PropTypes.func,\n locale: PropTypes.string,\n textDefault: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textToday: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textLastWeek: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textLastMonth: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textLastYear: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textCustom: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textApply: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textCancel: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textFrom: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textTo: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n className: PropTypes.string,\n dropdownClass: PropTypes.string,\n dropdownMenuClass: PropTypes.string,\n hasTimePicker: PropTypes.bool,\n customRangeOnly: PropTypes.bool,\n customPresets: PropTypes.arrayOf(\n PropTypes.shape({\n startValue: PropTypes.object.isRequired,\n endValue: PropTypes.object.isRequired,\n text: PropTypes.string.isRequired,\n onSelect: PropTypes.func,\n })\n ),\n dropup: PropTypes.bool,\n pullRight: PropTypes.bool,\n autoDropDirection: PropTypes.bool,\n clearable: PropTypes.bool,\n onClear: PropTypes.func,\n};\n\nconst defaultProps = {\n defaultStartValue: moment().startOf('day'),\n defaultEndValue: moment().endOf('day'),\n minValue: null,\n maxValue: null,\n locale: 'en-GB',\n textDefault: 'Select date range ...',\n textToday: 'Today',\n textLastWeek: 'Last week',\n textLastMonth: 'Last month',\n textCustom: 'Custom',\n textFrom: 'From',\n textTo: 'To',\n textApply: 'Apply',\n textCancel: 'Cancel',\n dropdownClass: '',\n dropdownMenuClass: '',\n hasTimePicker: false,\n customRangeOnly: false,\n customPresets: [\n {\n text: 'Today',\n startValue: moment().startOf('day'),\n endValue: moment().endOf('day'),\n },\n {\n text: 'Last week',\n startValue: moment().subtract(1, 'weeks').startOf('isoWeek'),\n endValue: moment().subtract(1, 'weeks').endOf('isoWeek'),\n },\n {\n text: 'Last Month',\n startValue: moment().subtract(1, 'months').startOf('month'),\n endValue: moment().subtract(1, 'months').endOf('month'),\n },\n ],\n onRangeChange: () => {\n // function when range changes\n },\n autoDropDirection: true,\n dropup: false,\n pullRight: false,\n clearable: false,\n onClear: () => undefined,\n};\n\nconst LOCAL_DATE_FORMAT = 'dd L LT';\nconst LOCAL_DATE_FORMAT_NO_TIME = 'dd L';\n\nconst DROPDOWN_WIDTH = 600;\n\n/**\n * Wrapper component for React-Datetime.\n *\n * @deprecated This will be removed from the UIKIT at some time.\n */\nclass DateRangePicker extends Component {\n constructor(props) {\n super(props);\n\n const customRangeStartValue = props.startValue ? props.startValue : props.defaultStartValue;\n const customRangeEndValue = props.endValue ? props.endValue : props.defaultEndValue;\n\n this.state = {\n internalStartValue: props.startValue,\n internalEndValue: props.endValue,\n isMounted: false,\n isCustomVisible: props.customRangeOnly,\n isDropdownOpen: false,\n customRangeStartValue: moment(customRangeStartValue), // default value for individual datepickers\n customRangeEndValue: moment(customRangeEndValue), // default value for individual datepickers\n isStartValid: true,\n isEndValid: true,\n dropdownToggleText: <Placeholder text={props.textDefault} />,\n dropup: props.dropup,\n pullRight: props.pullRight,\n };\n\n this.toggleDropdownOpen = this.toggleDropdownOpen.bind(this);\n this.handleCustomToggle = this.handleCustomToggle.bind(this);\n this.handleCustomApply = this.handleCustomApply.bind(this);\n this.onStartChange = this.onStartChange.bind(this);\n this.getValidStartDates = this.getValidStartDates.bind(this);\n this.onEndChange = this.onEndChange.bind(this);\n this.getValidEndDates = this.getValidEndDates.bind(this);\n this.handleResetInternalState = this.handleResetInternalState.bind(this);\n }\n\n componentDidMount() {\n const { startValue, endValue, locale } = this.props;\n if (!this.state.isMounted) {\n this.setState({\n isMounted: true,\n });\n }\n\n // initial mount value\n if (startValue && endValue) {\n this.update(startValue, endValue, locale);\n }\n }\n\n /**\n * Responsible for handling start/end values given from outside (controlled component context).\n * @param {object} nextProps - The next props.\n * @returns {undefined}\n */\n // eslint-disable-next-line camelcase\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { startValue, endValue, textDefault, customRangeOnly, locale, defaultStartValue, defaultEndValue } =\n nextProps;\n\n const { internalStartValue, internalEndValue } = this.state;\n\n // handle reset:\n // reset condition 1 is for uncontrolled components,\n // making sure that when a time is selected, and then the locale changed, that the selection remains\n const resetCondition1 =\n isNil(startValue) && isNil(endValue) && isNil(internalStartValue) && isNil(internalEndValue);\n\n // reset condition 2 is for controlled components,\n // when a time is set / defined, and the controlling component wants a hard reset\n const resetCondition2 = isNull(startValue) && isNull(endValue);\n\n // reset to original state\n if (resetCondition1 || resetCondition2) {\n this.setState({\n internalStartValue: undefined,\n internalEndValue: undefined,\n customRangeStartValue: defaultStartValue,\n customRangeEndValue: defaultEndValue,\n dropdownToggleText: <Placeholder text={textDefault} />,\n isCustomVisible: customRangeOnly,\n isDropdownOpen: false,\n isStartValid: true,\n isEndValid: true,\n pullRight: nextProps.pullRight,\n dropup: nextProps.dropup,\n });\n } else if (startValue !== this.props.startValue || endValue !== this.props.endValue) {\n this.update(startValue, endValue, locale);\n } else {\n this.update(internalStartValue, internalEndValue, locale);\n }\n }\n\n /**\n * Converts start/end values to moments, makes them readable,\n * crafts a dropdownToggleText and updates state.\n * @param {object} startValue - the start date (date or moment).\n * @param {object} endValue - the start date (date or moment).\n * @param {object} locale - the locale to use.\n * @param {object} extras - additional state, which needs to update.\n * @param {object} callback - callback to be called, after state has changed.\n * @returns {undefined}\n */\n update(startValue, endValue, locale, extras, callback) {\n const { hasTimePicker } = this.props;\n const format = hasTimePicker ? LOCAL_DATE_FORMAT : LOCAL_DATE_FORMAT_NO_TIME;\n\n // necessary to set start to startOf / end day to endOf, when selecting \"without time\"\n const finalStartValue = hasTimePicker ? moment(startValue) : moment(startValue).startOf('day');\n const finalEndValue = hasTimePicker ? moment(endValue) : moment(endValue).endOf('day');\n\n // composition of dropdownToggleText\n const startValueText = `${finalStartValue.locale(locale).format(format)}`;\n const endValueText = `${finalEndValue.locale(locale).format(format)}`;\n const dropdownToggleText =\n startValueText === endValueText ? startValueText : `${startValueText} → ${endValueText}`;\n\n // set state, and call callback\n this.setState(\n {\n internalStartValue: finalStartValue,\n internalEndValue: finalEndValue,\n customRangeStartValue: finalStartValue,\n customRangeEndValue: finalEndValue,\n dropdownToggleText,\n startValueText,\n endValueText,\n isStartValid: true,\n isEndValid: !finalEndValue.isBefore(finalStartValue),\n ...extras,\n },\n () => {\n callback && callback(finalStartValue, finalEndValue);\n }\n );\n }\n\n handleResetInternalState(event) {\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n const { textDefault, customRangeOnly, defaultStartValue, defaultEndValue, pullRight, dropup, onClear } =\n this.props;\n\n this.setState({\n internalStartValue: undefined,\n internalEndValue: undefined,\n customRangeStartValue: defaultStartValue,\n customRangeEndValue: defaultEndValue,\n dropdownToggleText: <Placeholder text={textDefault} />,\n isCustomVisible: customRangeOnly,\n isDropdownOpen: false,\n isStartValid: true,\n isEndValid: true,\n startValueText: null,\n endValueText: null,\n pullRight,\n dropup,\n });\n\n onClear();\n }\n\n /**\n * Gets called by wrapper component \"onClickOutside\".\n * Responsible for closing the dropdown when a click occured outside.\n * @returns {undefined}\n */\n handleClickOutside() {\n if (this.state.isMounted) {\n this.setState({\n isDropdownOpen: false,\n });\n }\n }\n\n /**\n * Toggles dropdown open status and visibility of custom range area.\n * @param {object} event - mouse event on toggle dropdown\n * @returns {undefined}\n */\n toggleDropdownOpen(event) {\n const toggleNode = ReactDOM.findDOMNode(this.refDropdownToggle);\n const menuNode = ReactDOM.findDOMNode(this.refDropdownMenu);\n\n const dropDirection =\n this.isAutoDropActive() && !this.state.isDropdownOpen ? getDropDirection(toggleNode, menuNode) : {};\n\n const left = event.currentTarget.getBoundingClientRect().left;\n\n this.setState(prevState => ({\n isDropdownOpen: !prevState.isDropdownOpen,\n isCustomVisible: this.props.customRangeOnly,\n ...dropDirection,\n pullRight: left + DROPDOWN_WIDTH > document.body.clientWidth,\n }));\n }\n\n isAutoDropActive() {\n return !(!this.props.autoDropDirection || this.props.dropup || this.props.pullRight);\n }\n\n /**\n * Only gets called on manual change of datePicker (user interaction).\n * Has influence the validity of the end date.\n *\n * Important to note that the start date is not limited,\n * whereas the end date is limited by the start date (see 'getValidEndDates').\n *\n * @param {object} startValue - the start date (date or moment).\n * @param {object} isValidDate - if the date is valid or not.\n * @returns {undefined}\n */\n onStartChange(startValue, isValidDate) {\n const newState = { isStartValid: false };\n const { hasTimePicker, minValue, maxValue } = this.props;\n const { customRangeEndValue } = this.state;\n\n if (moment.isMoment(startValue)) {\n // necessary to set start to startOf / end day to endOf, when selecting \"without time\"\n const finalStartValue = hasTimePicker ? startValue : moment(startValue).startOf('day');\n\n // check validity of input (min/max)\n const passesMin = minValue ? finalStartValue.isSameOrAfter(moment(minValue)) : true;\n const passesMax = maxValue ? finalStartValue.isSameOrBefore(moment(maxValue)) : true;\n const isValidInput = isValidDate && passesMin && passesMax;\n newState.isStartValid = isValidInput;\n if (isValidDate) {\n newState.customRangeStartValue = finalStartValue;\n newState.isEndValid = !customRangeEndValue.isBefore(finalStartValue);\n }\n }\n\n this.setState(newState);\n }\n\n /**\n * Only gets called on manual change of datePicker (user interaction)\n * @param {object} endValue - the start date (date or moment).\n * @param {object} isValidDate - if the date is valid or not.\n * @returns {undefined}\n */\n onEndChange(endValue, isValidDate) {\n const newState = { isEndValid: false };\n const { hasTimePicker, minValue, maxValue } = this.props;\n const { customRangeStartValue } = this.state;\n // let isValidInput = false;\n\n if (moment.isMoment(endValue)) {\n // necessary to set end of seconds and milliseconds for every end value\n const correctedEndValue = isValidDate ? endValue.endOf('minute') : endValue;\n\n // necessary to set start to startOf / end day to endOf, when selecting \"without time\"\n const finalEndValue = hasTimePicker ? correctedEndValue : moment(endValue).endOf('day');\n\n // check validity of input (min/max)\n const passesMin = minValue ? finalEndValue.isSameOrAfter(moment(minValue)) : true;\n const passesMax = maxValue ? finalEndValue.isSameOrBefore(moment(maxValue)) : true;\n const isValidInput = isValidDate && passesMin && passesMax && finalEndValue.isAfter(customRangeStartValue);\n newState.isEndValid = isValidInput;\n\n if (isValidDate) {\n newState.customRangeEndValue = finalEndValue;\n }\n }\n\n this.setState(newState);\n }\n\n /**\n * Callback method for DatePicker to limit selection in DatePicker.\n * @param {object} current - Current date in the loop.\n * @returns {undefined}\n */\n getValidStartDates(current) {\n const { minValue, maxValue } = this.props;\n const customRangeEndValue = moment(this.state.customRangeEndValue);\n\n if (current.isSame(customRangeEndValue, 'day')) {\n return true;\n }\n\n const passesMin = minValue ? current.isSameOrAfter(moment(minValue)) : true;\n const passesMax = maxValue ? current.isSameOrBefore(moment(maxValue)) : true;\n\n return passesMin && passesMax;\n }\n\n /**\n * Callback method for DatePicker to limit selection in DatePicker.\n * End date has to be after start date.\n * @param {object} current - Current date in the loop.\n * @returns {undefined}\n */\n getValidEndDates(current) {\n const { minValue, maxValue } = this.props;\n const customRangeStartValue = moment(this.state.customRangeStartValue);\n\n if (current.isSame(customRangeStartValue, 'day')) {\n return true;\n }\n\n const passesMin = minValue ? current.isSameOrAfter(moment(minValue)) : true;\n const passesMax = maxValue ? current.isSameOrBefore(moment(maxValue)) : true;\n const isAfterStart = current.isAfter(customRangeStartValue);\n\n return passesMin && passesMax && isAfterStart;\n }\n\n /**\n * Gets called when \"custom ...\" has been selected.\n * @returns {undefined}\n */\n handleCustomToggle() {\n this.setState(prevState => {\n return {\n isCustomVisible: !prevState.isCustomVisible,\n };\n });\n }\n\n handleCustomPresetSelect(preset) {\n if (typeof preset.onSelect === 'function') {\n preset.onSelect();\n }\n this.handleSelect(preset.startValue, preset.endValue);\n }\n\n /**\n * Gets called when a preset has been selected.\n * @param {object} startValue - the start date (date or moment).\n * @param {object} endValue - the start date (date or moment).\n * @returns {undefined}\n */\n handleSelect(startValue, endValue) {\n const { onRangeChange, locale } = this.props;\n\n const extras = { isDropdownOpen: false };\n this.update(startValue, endValue, locale, extras, onRangeChange);\n }\n\n /**\n * Gets called user clicks the apply button.\n * @returns {undefined}\n */\n handleCustomApply() {\n const { customRangeStartValue, customRangeEndValue, isStartValid, isEndValid } = this.state;\n const { onRangeChange, locale } = this.props;\n\n if (isStartValid && isEndValid) {\n const extras = { isDropdownOpen: false };\n this.update(customRangeStartValue, customRangeEndValue, locale, extras, onRangeChange);\n }\n }\n\n getDropdownToggle(dropdownToggleText) {\n const { children, clearable } = this.props;\n const { startValueText, endValueText } = this.state;\n\n const isClearable = clearable && dropdownToggleText.type !== Placeholder;\n\n const labelClassNames = classNames(isClearable && 'withClearButton');\n\n const isRenderCallback = children && typeof children === 'function';\n\n // Note: due to issues with nested events in Firefox (for toggle and inside the clear)\n // the toggle element must not be a <button> but a div.\n return (\n <div\n type='button'\n className='DateRangePickerToggle form-control dropdown-toggle text-left'\n aria-haspopup='true'\n aria-expanded='true'\n onClick={this.toggleDropdownOpen}\n ref={node => (this.refDropdownToggle = node)}\n >\n {isRenderCallback ? (\n this.props.children(startValueText, endValueText)\n ) : (\n <span className={labelClassNames}>{dropdownToggleText}</span>\n )}\n {isClearable && this.getClearButton()}\n <span className='caret' />\n </div>\n );\n }\n\n getClearButton() {\n return (\n <span className='clearButton' onClick={this.handleResetInternalState}>\n <span className='clearButtonIcon rioglyph rioglyph-remove-sign' />\n </span>\n );\n }\n\n getCustomPanelToggle(isCustomVisible, textCustom) {\n return (\n <li className={classNames('custom-panel-toggle', isCustomVisible && 'hidden')}>\n <a role='button' onClick={this.handleCustomToggle}>\n {textCustom} ...\n </a>\n </li>\n );\n }\n\n getCustomPanelButtons(isCustomVisible, isStartValid, isEndValid, textApply, textCancel) {\n return (\n <li className={classNames('custom-panel-buttons', 'margin-20', !isCustomVisible && 'hidden')}>\n <div className='btn-toolbar'>\n <button\n type='button'\n disabled={!isStartValid || !isEndValid}\n onClick={this.handleCustomApply}\n className='btn btn-primary pull-right'\n >\n {textApply}\n </button>\n <button type='button' onClick={this.toggleDropdownOpen} className='btn btn-default pull-right'>\n {textCancel}\n </button>\n </div>\n </li>\n );\n }\n\n // eslint-disable-next-line complexity\n render() {\n const {\n locale,\n textCustom,\n textApply,\n textCancel,\n textFrom,\n textTo,\n textToday,\n textLastWeek,\n textLastMonth,\n className,\n clearable,\n dropdownClass,\n dropdownMenuClass,\n customPresets,\n hasTimePicker,\n } = this.props;\n\n const {\n customRangeStartValue,\n customRangeEndValue,\n isStartValid,\n isEndValid,\n isCustomVisible,\n isDropdownOpen,\n dropdownToggleText,\n } = this.state;\n\n const pullRight = this.isAutoDropActive() ? this.state.pullRight : this.props.pullRight;\n const dropup = this.isAutoDropActive() ? this.state.dropup : this.props.dropup;\n\n if (customPresets && isEqual(customPresets, defaultProps.customPresets)) {\n // support backward compatibility to override default drop down text values\n customPresets[0].text = textToday;\n customPresets[1].text = textLastWeek;\n customPresets[2].text = textLastMonth;\n }\n\n const classes = classNames('DateRangePicker', className && className);\n\n const dropDownClassNames = classNames(\n 'select',\n 'dropdown',\n dropdownClass,\n isDropdownOpen && 'open',\n dropup && 'dropup'\n );\n\n return (\n <div className={classes}>\n <div className={dropDownClassNames}>\n {this.getDropdownToggle(dropdownToggleText, clearable)}\n <ul\n className={classNames('dropdown-menu', pullRight && 'pull-right', dropdownMenuClass)}\n ref={node => (this.refDropdownMenu = node)}\n >\n {customPresets.map((preset, i) => {\n return (\n <li\n key={`preset-${i}`}\n title={(preset.disabled && preset.disabledText) || null}\n className={classNames(preset.disabled && 'disabled')}\n >\n <a\n role='button'\n className={classNames(isCustomVisible && 'hidden')}\n onClick={\n !preset.disabled\n ? this.handleCustomPresetSelect.bind(this, preset)\n : undefined\n }\n >\n {preset.text}\n </a>\n </li>\n );\n })}\n <li role='separator' className={classNames('divider', isCustomVisible && 'hidden')} />\n {this.getCustomPanelToggle(isCustomVisible, textCustom)}\n <li className={classNames('custom-panel', !isCustomVisible && 'hidden')}>\n <div className='row'>\n <div className='col-sm-6'>\n <label>{textFrom}</label>\n <DatePicker\n locale={locale}\n open\n autoDropDirection={false}\n dateFormat\n timeFormat={hasTimePicker}\n initialValue={customRangeStartValue}\n onChange={this.onStartChange}\n closeOnSelect\n isValidDate={this.getValidStartDates}\n className={classNames('DatePicker', !isStartValid && 'has-error')}\n />\n </div>\n <div className='col-sm-6'>\n <label>{textTo}</label>\n <DatePicker\n locale={locale}\n open\n autoDropDirection={false}\n dateFormat\n timeFormat={hasTimePicker}\n initialValue={customRangeEndValue}\n onChange={this.onEndChange}\n closeOnSelect\n isValidDate={this.getValidEndDates}\n className={classNames('DatePicker', !isEndValid && 'has-error')}\n />\n </div>\n </div>\n </li>\n {this.getCustomPanelButtons(isCustomVisible, isStartValid, isEndValid, textApply, textCancel)}\n </ul>\n </div>\n </div>\n );\n }\n}\n\nDateRangePicker.propTypes = propTypes;\nDateRangePicker.defaultProps = defaultProps;\n\n/**\n * Wrapper component for React-Datetime.\n *\n * @deprecated This will be removed from the UIKIT at some time.\n */\nexport default onClickOutside(DateRangePicker);\nexport { DateRangePicker as DateRangePickerPure };\n"],"names":["Placeholder","text","propTypes","PropTypes","defaultProps","moment","LOCAL_DATE_FORMAT","LOCAL_DATE_FORMAT_NO_TIME","DROPDOWN_WIDTH","DateRangePicker","Component","props","customRangeStartValue","customRangeEndValue","startValue","endValue","locale","nextProps","textDefault","customRangeOnly","defaultStartValue","defaultEndValue","internalStartValue","internalEndValue","resetCondition1","isNil","resetCondition2","isNull","extras","callback","hasTimePicker","format","finalStartValue","finalEndValue","startValueText","endValueText","dropdownToggleText","event","pullRight","dropup","onClear","toggleNode","ReactDOM","menuNode","dropDirection","getDropDirection","left","prevState","isValidDate","newState","minValue","maxValue","passesMin","passesMax","isValidInput","correctedEndValue","current","isAfterStart","preset","onRangeChange","isStartValid","isEndValid","children","clearable","isClearable","labelClassNames","classNames","isRenderCallback","node","isCustomVisible","textCustom","textApply","textCancel","textFrom","textTo","textToday","textLastWeek","textLastMonth","className","dropdownClass","dropdownMenuClass","customPresets","isDropdownOpen","isEqual","classes","dropDownClassNames","i","DatePicker","DeprecatedDateRangePicker","onClickOutside"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAc,CAAC,EAAE,MAAAC,EAAA,MAAW,sBAAA,cAAC,QAAA,EAAK,WAAU,cAAA,GAAeA,CAAK,GAEhEC,IAAY;AAAA,EACd,YAAYC,EAAU;AAAA,EACtB,UAAUA,EAAU;AAAA,EACpB,mBAAmBA,EAAU;AAAA,EAC7B,iBAAiBA,EAAU;AAAA,EAC3B,UAAUA,EAAU;AAAA,EACpB,UAAUA,EAAU;AAAA,EACpB,eAAeA,EAAU;AAAA,EACzB,QAAQA,EAAU;AAAA,EAClB,aAAaA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EACnE,WAAWA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EACjE,cAAcA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EACpE,eAAeA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EACrE,cAAcA,EAAU,UAAU,CAAC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["../../../src/components/datepicker/DateRangePicker.jsx"],"sourcesContent":["import { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport onClickOutside from 'react-onclickoutside';\nimport moment from 'moment';\nimport classNames from '../../utils/classNames';\nimport { isEqual, isNull, isNil } from 'es-toolkit/predicate';\n\nimport DatePicker from './DatePicker';\nimport getDropDirection from '../../utils/getDropDirection';\n\nconst Placeholder = ({ text }) => <span className='placeholder'>{text}</span>;\n\nconst propTypes = {\n startValue: PropTypes.object,\n endValue: PropTypes.object,\n defaultStartValue: PropTypes.object,\n defaultEndValue: PropTypes.object,\n minValue: PropTypes.object,\n maxValue: PropTypes.object,\n onRangeChange: PropTypes.func,\n locale: PropTypes.string,\n textDefault: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textToday: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textLastWeek: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textLastMonth: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textLastYear: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textCustom: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textApply: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textCancel: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textFrom: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n textTo: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n className: PropTypes.string,\n dropdownClass: PropTypes.string,\n dropdownMenuClass: PropTypes.string,\n hasTimePicker: PropTypes.bool,\n customRangeOnly: PropTypes.bool,\n customPresets: PropTypes.arrayOf(\n PropTypes.shape({\n startValue: PropTypes.object.isRequired,\n endValue: PropTypes.object.isRequired,\n text: PropTypes.string.isRequired,\n onSelect: PropTypes.func,\n })\n ),\n dropup: PropTypes.bool,\n pullRight: PropTypes.bool,\n autoDropDirection: PropTypes.bool,\n clearable: PropTypes.bool,\n onClear: PropTypes.func,\n};\n\nconst defaultProps = {\n defaultStartValue: moment().startOf('day'),\n defaultEndValue: moment().endOf('day'),\n minValue: null,\n maxValue: null,\n locale: 'en-GB',\n textDefault: 'Select date range ...',\n textToday: 'Today',\n textLastWeek: 'Last week',\n textLastMonth: 'Last month',\n textCustom: 'Custom',\n textFrom: 'From',\n textTo: 'To',\n textApply: 'Apply',\n textCancel: 'Cancel',\n dropdownClass: '',\n dropdownMenuClass: '',\n hasTimePicker: false,\n customRangeOnly: false,\n customPresets: [\n {\n text: 'Today',\n startValue: moment().startOf('day'),\n endValue: moment().endOf('day'),\n },\n {\n text: 'Last week',\n startValue: moment().subtract(1, 'weeks').startOf('isoWeek'),\n endValue: moment().subtract(1, 'weeks').endOf('isoWeek'),\n },\n {\n text: 'Last Month',\n startValue: moment().subtract(1, 'months').startOf('month'),\n endValue: moment().subtract(1, 'months').endOf('month'),\n },\n ],\n onRangeChange: () => {\n // function when range changes\n },\n autoDropDirection: true,\n dropup: false,\n pullRight: false,\n clearable: false,\n onClear: () => undefined,\n};\n\nconst LOCAL_DATE_FORMAT = 'dd L LT';\nconst LOCAL_DATE_FORMAT_NO_TIME = 'dd L';\n\nconst DROPDOWN_WIDTH = 600;\n\n/**\n * Wrapper component for React-Datetime.\n *\n * @deprecated This will be removed from the UIKIT at some time.\n */\nclass DateRangePicker extends Component {\n constructor(props) {\n super(props);\n\n const customRangeStartValue = props.startValue ? props.startValue : props.defaultStartValue;\n const customRangeEndValue = props.endValue ? props.endValue : props.defaultEndValue;\n\n this.state = {\n internalStartValue: props.startValue,\n internalEndValue: props.endValue,\n isMounted: false,\n isCustomVisible: props.customRangeOnly,\n isDropdownOpen: false,\n customRangeStartValue: moment(customRangeStartValue), // default value for individual datepickers\n customRangeEndValue: moment(customRangeEndValue), // default value for individual datepickers\n isStartValid: true,\n isEndValid: true,\n dropdownToggleText: <Placeholder text={props.textDefault} />,\n dropup: props.dropup,\n pullRight: props.pullRight,\n };\n\n this.toggleDropdownOpen = this.toggleDropdownOpen.bind(this);\n this.handleCustomToggle = this.handleCustomToggle.bind(this);\n this.handleCustomApply = this.handleCustomApply.bind(this);\n this.onStartChange = this.onStartChange.bind(this);\n this.getValidStartDates = this.getValidStartDates.bind(this);\n this.onEndChange = this.onEndChange.bind(this);\n this.getValidEndDates = this.getValidEndDates.bind(this);\n this.handleResetInternalState = this.handleResetInternalState.bind(this);\n }\n\n componentDidMount() {\n const { startValue, endValue, locale } = this.props;\n if (!this.state.isMounted) {\n this.setState({\n isMounted: true,\n });\n }\n\n // initial mount value\n if (startValue && endValue) {\n this.update(startValue, endValue, locale);\n }\n }\n\n /**\n * Responsible for handling start/end values given from outside (controlled component context).\n * @param {object} nextProps - The next props.\n * @returns {undefined}\n */\n // eslint-disable-next-line camelcase\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { startValue, endValue, textDefault, customRangeOnly, locale, defaultStartValue, defaultEndValue } =\n nextProps;\n\n const { internalStartValue, internalEndValue } = this.state;\n\n // handle reset:\n // reset condition 1 is for uncontrolled components,\n // making sure that when a time is selected, and then the locale changed, that the selection remains\n const resetCondition1 =\n isNil(startValue) && isNil(endValue) && isNil(internalStartValue) && isNil(internalEndValue);\n\n // reset condition 2 is for controlled components,\n // when a time is set / defined, and the controlling component wants a hard reset\n const resetCondition2 = isNull(startValue) && isNull(endValue);\n\n // reset to original state\n if (resetCondition1 || resetCondition2) {\n this.setState({\n internalStartValue: undefined,\n internalEndValue: undefined,\n customRangeStartValue: defaultStartValue,\n customRangeEndValue: defaultEndValue,\n dropdownToggleText: <Placeholder text={textDefault} />,\n isCustomVisible: customRangeOnly,\n isDropdownOpen: false,\n isStartValid: true,\n isEndValid: true,\n pullRight: nextProps.pullRight,\n dropup: nextProps.dropup,\n });\n } else if (startValue !== this.props.startValue || endValue !== this.props.endValue) {\n this.update(startValue, endValue, locale);\n } else {\n this.update(internalStartValue, internalEndValue, locale);\n }\n }\n\n /**\n * Converts start/end values to moments, makes them readable,\n * crafts a dropdownToggleText and updates state.\n * @param {object} startValue - the start date (date or moment).\n * @param {object} endValue - the start date (date or moment).\n * @param {object} locale - the locale to use.\n * @param {object} extras - additional state, which needs to update.\n * @param {object} callback - callback to be called, after state has changed.\n * @returns {undefined}\n */\n update(startValue, endValue, locale, extras, callback) {\n const { hasTimePicker } = this.props;\n const format = hasTimePicker ? LOCAL_DATE_FORMAT : LOCAL_DATE_FORMAT_NO_TIME;\n\n // necessary to set start to startOf / end day to endOf, when selecting \"without time\"\n const finalStartValue = hasTimePicker ? moment(startValue) : moment(startValue).startOf('day');\n const finalEndValue = hasTimePicker ? moment(endValue) : moment(endValue).endOf('day');\n\n // composition of dropdownToggleText\n const startValueText = `${finalStartValue.locale(locale).format(format)}`;\n const endValueText = `${finalEndValue.locale(locale).format(format)}`;\n const dropdownToggleText =\n startValueText === endValueText ? startValueText : `${startValueText} → ${endValueText}`;\n\n // set state, and call callback\n this.setState(\n {\n internalStartValue: finalStartValue,\n internalEndValue: finalEndValue,\n customRangeStartValue: finalStartValue,\n customRangeEndValue: finalEndValue,\n dropdownToggleText,\n startValueText,\n endValueText,\n isStartValid: true,\n isEndValid: !finalEndValue.isBefore(finalStartValue),\n ...extras,\n },\n () => {\n callback && callback(finalStartValue, finalEndValue);\n }\n );\n }\n\n handleResetInternalState(event) {\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n const { textDefault, customRangeOnly, defaultStartValue, defaultEndValue, pullRight, dropup, onClear } =\n this.props;\n\n this.setState({\n internalStartValue: undefined,\n internalEndValue: undefined,\n customRangeStartValue: defaultStartValue,\n customRangeEndValue: defaultEndValue,\n dropdownToggleText: <Placeholder text={textDefault} />,\n isCustomVisible: customRangeOnly,\n isDropdownOpen: false,\n isStartValid: true,\n isEndValid: true,\n startValueText: null,\n endValueText: null,\n pullRight,\n dropup,\n });\n\n onClear();\n }\n\n /**\n * Gets called by wrapper component \"onClickOutside\".\n * Responsible for closing the dropdown when a click occured outside.\n * @returns {undefined}\n */\n handleClickOutside() {\n if (this.state.isMounted) {\n this.setState({\n isDropdownOpen: false,\n });\n }\n }\n\n /**\n * Toggles dropdown open status and visibility of custom range area.\n * @param {object} event - mouse event on toggle dropdown\n * @returns {undefined}\n */\n toggleDropdownOpen(event) {\n const toggleNode = ReactDOM.findDOMNode(this.refDropdownToggle);\n const menuNode = ReactDOM.findDOMNode(this.refDropdownMenu);\n\n const dropDirection =\n this.isAutoDropActive() && !this.state.isDropdownOpen ? getDropDirection(toggleNode, menuNode) : {};\n\n const left = event.currentTarget.getBoundingClientRect().left;\n\n this.setState(prevState => ({\n isDropdownOpen: !prevState.isDropdownOpen,\n isCustomVisible: this.props.customRangeOnly,\n ...dropDirection,\n pullRight: left + DROPDOWN_WIDTH > document.body.clientWidth,\n }));\n }\n\n isAutoDropActive() {\n return !(!this.props.autoDropDirection || this.props.dropup || this.props.pullRight);\n }\n\n /**\n * Only gets called on manual change of datePicker (user interaction).\n * Has influence the validity of the end date.\n *\n * Important to note that the start date is not limited,\n * whereas the end date is limited by the start date (see 'getValidEndDates').\n *\n * @param {object} startValue - the start date (date or moment).\n * @param {object} isValidDate - if the date is valid or not.\n * @returns {undefined}\n */\n onStartChange(startValue, isValidDate) {\n const newState = { isStartValid: false };\n const { hasTimePicker, minValue, maxValue } = this.props;\n const { customRangeEndValue } = this.state;\n\n if (moment.isMoment(startValue)) {\n // necessary to set start to startOf / end day to endOf, when selecting \"without time\"\n const finalStartValue = hasTimePicker ? startValue : moment(startValue).startOf('day');\n\n // check validity of input (min/max)\n const passesMin = minValue ? finalStartValue.isSameOrAfter(moment(minValue)) : true;\n const passesMax = maxValue ? finalStartValue.isSameOrBefore(moment(maxValue)) : true;\n const isValidInput = isValidDate && passesMin && passesMax;\n newState.isStartValid = isValidInput;\n if (isValidDate) {\n newState.customRangeStartValue = finalStartValue;\n newState.isEndValid = !customRangeEndValue.isBefore(finalStartValue);\n }\n }\n\n this.setState(newState);\n }\n\n /**\n * Only gets called on manual change of datePicker (user interaction)\n * @param {object} endValue - the start date (date or moment).\n * @param {object} isValidDate - if the date is valid or not.\n * @returns {undefined}\n */\n onEndChange(endValue, isValidDate) {\n const newState = { isEndValid: false };\n const { hasTimePicker, minValue, maxValue } = this.props;\n const { customRangeStartValue } = this.state;\n // let isValidInput = false;\n\n if (moment.isMoment(endValue)) {\n // necessary to set end of seconds and milliseconds for every end value\n const correctedEndValue = isValidDate ? endValue.endOf('minute') : endValue;\n\n // necessary to set start to startOf / end day to endOf, when selecting \"without time\"\n const finalEndValue = hasTimePicker ? correctedEndValue : moment(endValue).endOf('day');\n\n // check validity of input (min/max)\n const passesMin = minValue ? finalEndValue.isSameOrAfter(moment(minValue)) : true;\n const passesMax = maxValue ? finalEndValue.isSameOrBefore(moment(maxValue)) : true;\n const isValidInput = isValidDate && passesMin && passesMax && finalEndValue.isAfter(customRangeStartValue);\n newState.isEndValid = isValidInput;\n\n if (isValidDate) {\n newState.customRangeEndValue = finalEndValue;\n }\n }\n\n this.setState(newState);\n }\n\n /**\n * Callback method for DatePicker to limit selection in DatePicker.\n * @param {object} current - Current date in the loop.\n * @returns {undefined}\n */\n getValidStartDates(current) {\n const { minValue, maxValue } = this.props;\n const customRangeEndValue = moment(this.state.customRangeEndValue);\n\n if (current.isSame(customRangeEndValue, 'day')) {\n return true;\n }\n\n const passesMin = minValue ? current.isSameOrAfter(moment(minValue)) : true;\n const passesMax = maxValue ? current.isSameOrBefore(moment(maxValue)) : true;\n\n return passesMin && passesMax;\n }\n\n /**\n * Callback method for DatePicker to limit selection in DatePicker.\n * End date has to be after start date.\n * @param {object} current - Current date in the loop.\n * @returns {undefined}\n */\n getValidEndDates(current) {\n const { minValue, maxValue } = this.props;\n const customRangeStartValue = moment(this.state.customRangeStartValue);\n\n if (current.isSame(customRangeStartValue, 'day')) {\n return true;\n }\n\n const passesMin = minValue ? current.isSameOrAfter(moment(minValue)) : true;\n const passesMax = maxValue ? current.isSameOrBefore(moment(maxValue)) : true;\n const isAfterStart = current.isAfter(customRangeStartValue);\n\n return passesMin && passesMax && isAfterStart;\n }\n\n /**\n * Gets called when \"custom ...\" has been selected.\n * @returns {undefined}\n */\n handleCustomToggle() {\n this.setState(prevState => {\n return {\n isCustomVisible: !prevState.isCustomVisible,\n };\n });\n }\n\n handleCustomPresetSelect(preset) {\n if (typeof preset.onSelect === 'function') {\n preset.onSelect();\n }\n this.handleSelect(preset.startValue, preset.endValue);\n }\n\n /**\n * Gets called when a preset has been selected.\n * @param {object} startValue - the start date (date or moment).\n * @param {object} endValue - the start date (date or moment).\n * @returns {undefined}\n */\n handleSelect(startValue, endValue) {\n const { onRangeChange, locale } = this.props;\n\n const extras = { isDropdownOpen: false };\n this.update(startValue, endValue, locale, extras, onRangeChange);\n }\n\n /**\n * Gets called user clicks the apply button.\n * @returns {undefined}\n */\n handleCustomApply() {\n const { customRangeStartValue, customRangeEndValue, isStartValid, isEndValid } = this.state;\n const { onRangeChange, locale } = this.props;\n\n if (isStartValid && isEndValid) {\n const extras = { isDropdownOpen: false };\n this.update(customRangeStartValue, customRangeEndValue, locale, extras, onRangeChange);\n }\n }\n\n getDropdownToggle(dropdownToggleText) {\n const { children, clearable } = this.props;\n const { startValueText, endValueText } = this.state;\n\n const isClearable = clearable && dropdownToggleText.type !== Placeholder;\n\n const labelClassNames = classNames(isClearable && 'withClearButton');\n\n const isRenderCallback = children && typeof children === 'function';\n\n // Note: due to issues with nested events in Firefox (for toggle and inside the clear)\n // the toggle element must not be a <button> but a div.\n return (\n <div\n type='button'\n className='DateRangePickerToggle form-control dropdown-toggle text-left'\n aria-haspopup='true'\n aria-expanded='true'\n onClick={this.toggleDropdownOpen}\n ref={node => (this.refDropdownToggle = node)}\n >\n {isRenderCallback ? (\n this.props.children(startValueText, endValueText)\n ) : (\n <span className={labelClassNames}>{dropdownToggleText}</span>\n )}\n {isClearable && this.getClearButton()}\n <span className='caret' />\n </div>\n );\n }\n\n getClearButton() {\n return (\n <span className='clearButton' onClick={this.handleResetInternalState}>\n <span className='clearButtonIcon rioglyph rioglyph-remove-sign' />\n </span>\n );\n }\n\n getCustomPanelToggle(isCustomVisible, textCustom) {\n return (\n <li className={classNames('custom-panel-toggle', isCustomVisible && 'hidden')}>\n <a role='button' onClick={this.handleCustomToggle}>\n {textCustom} ...\n </a>\n </li>\n );\n }\n\n getCustomPanelButtons(isCustomVisible, isStartValid, isEndValid, textApply, textCancel) {\n return (\n <li className={classNames('custom-panel-buttons', 'margin-20', !isCustomVisible && 'hidden')}>\n <div className='btn-toolbar'>\n <button\n type='button'\n disabled={!isStartValid || !isEndValid}\n onClick={this.handleCustomApply}\n className='btn btn-primary pull-right'\n >\n {textApply}\n </button>\n <button type='button' onClick={this.toggleDropdownOpen} className='btn btn-default pull-right'>\n {textCancel}\n </button>\n </div>\n </li>\n );\n }\n\n // eslint-disable-next-line complexity\n render() {\n const {\n locale,\n textCustom,\n textApply,\n textCancel,\n textFrom,\n textTo,\n textToday,\n textLastWeek,\n textLastMonth,\n className,\n clearable,\n dropdownClass,\n dropdownMenuClass,\n customPresets,\n hasTimePicker,\n } = this.props;\n\n const {\n customRangeStartValue,\n customRangeEndValue,\n isStartValid,\n isEndValid,\n isCustomVisible,\n isDropdownOpen,\n dropdownToggleText,\n } = this.state;\n\n const pullRight = this.isAutoDropActive() ? this.state.pullRight : this.props.pullRight;\n const dropup = this.isAutoDropActive() ? this.state.dropup : this.props.dropup;\n\n if (customPresets && isEqual(customPresets, defaultProps.customPresets)) {\n // support backward compatibility to override default drop down text values\n customPresets[0].text = textToday;\n customPresets[1].text = textLastWeek;\n customPresets[2].text = textLastMonth;\n }\n\n const classes = classNames('DateRangePicker', className && className);\n\n const dropDownClassNames = classNames(\n 'select',\n 'dropdown',\n dropdownClass,\n isDropdownOpen && 'open',\n dropup && 'dropup'\n );\n\n return (\n <div className={classes}>\n <div className={dropDownClassNames}>\n {this.getDropdownToggle(dropdownToggleText, clearable)}\n <ul\n className={classNames('dropdown-menu', pullRight && 'pull-right', dropdownMenuClass)}\n ref={node => (this.refDropdownMenu = node)}\n >\n {customPresets.map((preset, i) => {\n return (\n <li\n key={`preset-${i}`}\n title={(preset.disabled && preset.disabledText) || null}\n className={classNames(preset.disabled && 'disabled')}\n >\n <a\n role='button'\n className={classNames(isCustomVisible && 'hidden')}\n onClick={\n !preset.disabled\n ? this.handleCustomPresetSelect.bind(this, preset)\n : undefined\n }\n >\n {preset.text}\n </a>\n </li>\n );\n })}\n <li role='separator' className={classNames('divider', isCustomVisible && 'hidden')} />\n {this.getCustomPanelToggle(isCustomVisible, textCustom)}\n <li className={classNames('custom-panel', !isCustomVisible && 'hidden')}>\n <div className='row'>\n <div className='col-sm-6'>\n <label>{textFrom}</label>\n <DatePicker\n locale={locale}\n open\n autoDropDirection={false}\n dateFormat\n timeFormat={hasTimePicker}\n initialValue={customRangeStartValue}\n onChange={this.onStartChange}\n closeOnSelect\n isValidDate={this.getValidStartDates}\n className={classNames('DatePicker', !isStartValid && 'has-error')}\n />\n </div>\n <div className='col-sm-6'>\n <label>{textTo}</label>\n <DatePicker\n locale={locale}\n open\n autoDropDirection={false}\n dateFormat\n timeFormat={hasTimePicker}\n initialValue={customRangeEndValue}\n onChange={this.onEndChange}\n closeOnSelect\n isValidDate={this.getValidEndDates}\n className={classNames('DatePicker', !isEndValid && 'has-error')}\n />\n </div>\n </div>\n </li>\n {this.getCustomPanelButtons(isCustomVisible, isStartValid, isEndValid, textApply, textCancel)}\n </ul>\n </div>\n </div>\n );\n }\n}\n\nDateRangePicker.propTypes = propTypes;\nDateRangePicker.defaultProps = defaultProps;\n\n/**\n * Wrapper component for React-Datetime.\n *\n * @deprecated This will be removed from the UIKIT at some time.\n */\nexport default onClickOutside(DateRangePicker);\nexport { DateRangePicker as DateRangePickerPure };\n"],"names":["Placeholder","text","propTypes","PropTypes","defaultProps","moment","LOCAL_DATE_FORMAT","LOCAL_DATE_FORMAT_NO_TIME","DROPDOWN_WIDTH","DateRangePicker","Component","props","customRangeStartValue","customRangeEndValue","startValue","endValue","locale","nextProps","textDefault","customRangeOnly","defaultStartValue","defaultEndValue","internalStartValue","internalEndValue","resetCondition1","isNil","resetCondition2","isNull","extras","callback","hasTimePicker","format","finalStartValue","finalEndValue","startValueText","endValueText","dropdownToggleText","event","pullRight","dropup","onClear","toggleNode","ReactDOM","menuNode","dropDirection","getDropDirection","left","prevState","isValidDate","newState","minValue","maxValue","passesMin","passesMax","isValidInput","correctedEndValue","current","isAfterStart","preset","onRangeChange","isStartValid","isEndValid","children","clearable","isClearable","labelClassNames","classNames","isRenderCallback","node","isCustomVisible","textCustom","textApply","textCancel","textFrom","textTo","textToday","textLastWeek","textLastMonth","className","dropdownClass","dropdownMenuClass","customPresets","isDropdownOpen","isEqual","classes","dropDownClassNames","i","DatePicker","DeprecatedDateRangePicker","onClickOutside"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAc,CAAC,EAAE,MAAAC,EAAA,MAAW,sBAAA,cAAC,QAAA,EAAK,WAAU,cAAA,GAAeA,CAAK,GAEhEC,IAAY;AAAA,EACd,YAAYC,EAAU;AAAA,EACtB,UAAUA,EAAU;AAAA,EACpB,mBAAmBA,EAAU;AAAA,EAC7B,iBAAiBA,EAAU;AAAA,EAC3B,UAAUA,EAAU;AAAA,EACpB,UAAUA,EAAU;AAAA,EACpB,eAAeA,EAAU;AAAA,EACzB,QAAQA,EAAU;AAAA,EAClB,aAAaA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EACnE,WAAWA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EACjE,cAAcA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EACpE,eAAeA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EACrE,cAAcA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EACpE,YAAYA,EAAU,UAAU,CAACA,EAAU,QAAQA,EAAU,IAAI,CAAC;AAAA,EAClE,WAAWA,EAAU,UAA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AiBC,CAAU;AAAA,MACtD,sBAAA,cAAC,QAAG,WAAWJ,EAAW,gBAAgB,CAACG,KAAmB,QAAQ,EAAA,GAClE,sBAAA,cAAC,SAAI,WAAU,MAAA,uCACV,OAAA,EAAI,WAAU,cACX,sBAAA,cAAC,SAAA,MAAOI,CAAS,GACjB,sBAAA;AAAA,QAACc;AAAA,QAAA;AAAA,UACG,QAAAvE;AAAA,UACA,MAAI;AAAA,UACJ,mBAAmB;AAAA,UACnB,YAAU;AAAA,UACV,YAAYc;AAAA,UACZ,cAAclB;AAAA,UACd,UAAU,KAAK;AAAA,UACf,eAAa;AAAA,UACb,aAAa,KAAK;AAAA,UAClB,WAAWsD,EAAW,cAAc,CAACN,KAAgB,WAAW;AAAA,QAAA;AAAA,MAAA,CAExE,GACA,sBAAA,cAAC,OAAA,EAAI,WAAU,WAAA,GACX,sBAAA,cAAC,SAAA,MAAOc,CAAO,GACf,sBAAA;AAAA,QAACa;AAAA,QAAA;AAAA,UACG,QAAAvE;AAAA,UACA,MAAI;AAAA,UACJ,mBAAmB;AAAA,UACnB,YAAU;AAAA,UACV,YAAYc;AAAA,UACZ,cAAcjB;AAAA,UACd,UAAU,KAAK;AAAA,UACf,eAAa;AAAA,UACb,aAAa,KAAK;AAAA,UAClB,WAAWqD,EAAW,cAAc,CAACL,KAAc,WAAW;AAAA,QAAA;AAAA,MAAA,CAEtE,CACJ,CACJ;AAAA,MACC,KAAK,sBAAsBQ,GAAiBT,GAAcC,GAAYU,GAAWC,CAAU;AAAA,IAAA,CAEpG,CACJ;AAAA,EAER;AACJ;AAEA/D,EAAgB,YAAYP;AAC5BO,EAAgB,eAAeL;AAO/B,MAAAoF,KAAeC,EAAehF,CAAe;"}
|
|
@@ -9,7 +9,7 @@ import Pe from "../../hooks/useClickOutside.js";
|
|
|
9
9
|
import ke from "../../hooks/usePopperDropdown.js";
|
|
10
10
|
import Ne from "../../hooks/useKey.js";
|
|
11
11
|
import we from "../clearableInput/ClearableInput.js";
|
|
12
|
-
import Re from "
|
|
12
|
+
import Re from "../../utils/classNames.js";
|
|
13
13
|
const Ee = (e) => !e.mode || e.mode === "single", xe = (e) => e.mode === "multiple", Le = (e) => e.mode === "range", Je = (e) => {
|
|
14
14
|
const {
|
|
15
15
|
id: o,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DayPicker.js","sources":["../../../src/components/datepicker/DayPicker.tsx"],"sourcesContent":["import { useEffect, useState, useRef } from 'react';\nimport { DayPicker as ReactDayPicker } from 'react-day-picker';\nimport { format, isValid, parse, type Locale } from 'date-fns';\nimport * as locales from 'date-fns/locale';\nimport { debounce } from 'es-toolkit/function';\n\nimport 'react-day-picker/dist/style.css';\n\nimport useClickOutside from '../../hooks/useClickOutside';\nimport usePopperDropdown from '../../hooks/usePopperDropdown';\nimport useKey from '../../hooks/useKey';\nimport ClearableInput from '../clearableInput/ClearableInput';\nimport classNames from 'classnames';\n\n// Features\n// [ ] input parsing and error handling\n// [-] time picker -> use a dedicated time picker input next to the day picker\n// [-] time range callback + validation\n// [ ] wrap all react-day-picker callbacks to avoid exposing internals and types\n// [x] start/end month\n// [ ] reserved days / unselectable days\n// [ ] disable editable input - use selected date only\n// [x] disallow editing input for mode: \"multi\" and \"range\" since input contains custom value\n// [ ] modifier and modifiersStyles\n// [x] closeOnSelect\n// [x] enter confirms the manual input and closes the dropdown\n// [x] esc closed the dropdown\n// [ ] support different sizes\n// [ ] mandatory value\n// [x] avoid opening dropdown again when clicking inside the input\n// [x] clear inputs\n// [ ] tab should select elements inside the dropdown, select should close but keep focus on input\n\nexport type DateRange = {\n from?: Date | undefined;\n to?: Date | undefined;\n};\n\nexport type Modifiers = Record<string, boolean>;\n\nexport type OnSelectHandler<T> = (\n selected: T,\n triggerDate: Date,\n modifiers: Modifiers,\n event: React.MouseEvent | React.KeyboardEvent\n) => void;\n\n// - By default, don't show a time picker\n// - Handle given formats like \"2020-04-04\" or ISO dates \"2020-03-12T16:20:44.193Z\" as initialValue - really?\n\ntype CommonProps = Omit<React.HTMLProps<HTMLInputElement>, 'onChange' | 'value' | 'selected'> & {\n id?: string;\n locale?: string;\n closeOnSelect?: boolean;\n initialValue?: Date;\n inputProps?: Omit<React.HTMLProps<HTMLInputElement>, 'type' | 'defaultValue' | 'children'>;\n\n /**\n * Custom format string (e.g., 'yyyy-MM-dd') to override locale-based formatting.\n * If omitted, locale-based display is used for the input.\n */\n dateFormat?: string;\n\n alignRight?: boolean;\n isClearable?: boolean;\n minWidth?: number;\n mandatory?: boolean;\n bsSize?: 'sm' | 'md' | 'lg' | 'xl';\n footer?: React.ReactNode;\n inline?: boolean;\n placeholder?: string | React.ReactElement;\n\n inputClassName?: string;\n className?: string;\n\n // react-day-picker props\n showOutsideDays?: boolean;\n fixedWeeks?: boolean;\n defaultMonth?: Date;\n startMonth?: Date;\n endMonth?: Date;\n};\n\ntype SingleModeProps = CommonProps & {\n mode?: 'single';\n selected?: Date;\n onInputChange?: (rawValue: string, parsedDate: Date | undefined, isValid: boolean) => void;\n onSelectChange?: (value: Date | undefined, modifiers: Modifiers) => void;\n};\n\ntype MultipleModeProps = CommonProps & {\n mode: 'multiple';\n selected?: Date[];\n onSelectChange?: (value: Date[] | undefined, modifiers: Modifiers) => void;\n};\n\ntype RangeModeProps = CommonProps & {\n mode: 'range';\n selected?: DateRange;\n onChange?: (value: DateRange | undefined) => void;\n onSelectChange?: (value: DateRange | undefined, modifiers: Modifiers) => void;\n};\n\ntype DayPickerProps = SingleModeProps | MultipleModeProps | RangeModeProps;\n\nconst isSingleProps = (props: DayPickerProps): props is SingleModeProps => !props.mode || props.mode === 'single';\nconst isMultipleProps = (props: DayPickerProps): props is MultipleModeProps => props.mode === 'multiple';\nconst isRangeProps = (props: DayPickerProps): props is RangeModeProps => props.mode === 'range';\n\nconst DayPicker = (props: DayPickerProps) => {\n const {\n id,\n selected,\n inputProps = {},\n alignRight,\n bsSize = '',\n locale = 'en-GB',\n footer,\n inline,\n showOutsideDays = true,\n fixedWeeks = true,\n mode = 'single',\n dateFormat,\n placeholder,\n isClearable = false,\n closeOnSelect = true,\n defaultMonth,\n startMonth,\n endMonth,\n inputClassName,\n className,\n } = props;\n\n const isSingleMode = mode === 'single';\n const isMultipleMode = mode === 'multiple';\n const isRangeMode = mode === 'range';\n\n const isControlled = selected !== undefined;\n const [internalSelected, setInternalSelected] = useState<typeof selected>();\n\n const selectedValue = isControlled ? selected : internalSelected;\n\n const narrowedSelected = (() => {\n if (isSingleMode) {\n return selectedValue instanceof Date ? selectedValue : undefined;\n }\n if (isMultipleMode) {\n return Array.isArray(selectedValue) ? selectedValue : undefined;\n }\n return isDateRange(selectedValue) ? selectedValue : undefined;\n })();\n\n const selectionProps = { selected: narrowedSelected };\n\n const resolvedLocale = resolveLocale(locale);\n\n const [internalInputValue, setInternalInputValue] = useState<string>('');\n\n const inputValue =\n isControlled && !isSingleMode\n ? formatSelectedForInput(narrowedSelected, locale, mode, dateFormat)\n : internalInputValue;\n\n // const inputValue = isSingleMode\n // ? internalInputValue\n // : formatSelectedForInput(narrowedSelected, locale, mode, dateFormat);\n\n // const inputValue = internalInputValue;\n\n // This ensures that whenever the external selected prop changes, the input field gets updated accordingly\n useEffect(() => {\n if (isSingleMode && isControlled && selected instanceof Date) {\n setInternalInputValue(formatDate(selected, locale, dateFormat));\n }\n }, [selected, isSingleMode, isControlled, locale, dateFormat]);\n\n const notifySelectChange = (value: typeof selected, modifiers: Modifiers) => {\n if (isSingleProps(props) && props.onSelectChange) {\n props.onSelectChange(value as SingleModeProps['selected'], modifiers);\n return;\n }\n\n if (isMultipleProps(props) && props.onSelectChange) {\n props.onSelectChange(value as MultipleModeProps['selected'], modifiers);\n return;\n }\n\n if (isRangeProps(props) && props.onSelectChange) {\n props.onSelectChange(value as RangeModeProps['selected'], modifiers);\n }\n };\n\n const handleInputChange = (newValue: string) => doHandleInputValue(newValue);\n const handleInputChangeNative = (event: any) => doHandleInputValue(event.currentTarget.value);\n\n const debouncedParseInput = useRef(\n debounce((rawValue: string) => {\n const parsed = parseDateString(rawValue, locale);\n console.log(parsed);\n const isValid = !!parsed;\n\n setInternalSelected(parsed as typeof props.selected);\n\n if (isSingleMode && 'onInputChange' in props && props.onInputChange) {\n props.onInputChange(rawValue, parsed, isValid);\n }\n\n const shouldNotify = parsed !== undefined || rawValue === '';\n if (shouldNotify) {\n // parse to desired dateFormat for use on outside\n const formattedSelected = dateFormat ? parseDateString(rawValue, locale, dateFormat) : parsed;\n notifySelectChange(formattedSelected as typeof selected, {});\n }\n }, 300)\n ).current;\n\n const doHandleInputValue = (rawValue: string) => {\n // const parsed = parseDateString(rawValue, locale, dateFormat);\n\n // const isValid = !!parsed;\n\n // if (!isControlled) {\n // // && isValidDate(parsed); // TODO: optional second validation\n\n // setInternalInputValue(rawValue);\n // setInternalSelected(parsed as typeof props.selected);\n // } else if (isSingleMode) {\n // setInternalInputValue(rawValue);\n // }\n\n // if (isSingleMode && 'onInputChange' in props && props.onInputChange) {\n // props.onInputChange(rawValue, parsed, isValid);\n // }\n\n // const shouldNotify = parsed !== undefined || rawValue === '';\n // if (shouldNotify) {\n // onSelectChange(parsed as typeof selected, {});\n // }\n\n setInternalInputValue(rawValue); // always update input state\n debouncedParseInput(rawValue); // defer parsing & callback execution\n };\n\n const keyboardRef = useRef(false);\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n // Do not close the dropdown on input blur when the user selects something inside the dropdown itself\n const nextFocused = event.relatedTarget as Node | null;\n const focusInsideDropdown = nextFocused && popperElementRef.current?.contains(nextFocused);\n if (isDropdownOpen && !focusInsideDropdown) {\n closePopper();\n }\n\n if (!isSingleMode) {\n return;\n }\n\n const parsed = parseDateString(internalInputValue, locale, dateFormat);\n\n if (parsed && isValid(parsed)) {\n setInternalSelected(parsed as typeof selected);\n notifySelectChange(parsed as typeof selected, {});\n setInternalInputValue(formatDate(parsed, locale, dateFormat));\n }\n };\n\n const handleOnInputFocus = () => {\n if (!isDropdownOpen) {\n openPopper();\n }\n };\n\n const handleInputKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {\n // Workaround to figure out if the user navigates via keyboard\n if (event.key === 'Tab') {\n keyboardRef.current = true;\n }\n\n if (event.key !== 'Enter') {\n return;\n }\n // In case the dropdown is not open but the input is focused, open the dropdown on enter\n if (!isDropdownOpen) {\n handleInputClick();\n return;\n }\n // In case the dropdown is open, the input is focused and the prop allows it, close the dropdown\n if (isDropdownOpen && closeOnSelect) {\n notifySelectChange(narrowedSelected as typeof selected, {});\n closePopper();\n }\n };\n\n const handleSelectedChange = (newValue: typeof selected) => {\n if (!isControlled) {\n setInternalSelected(newValue);\n }\n };\n\n const handleClearSelection = () => {\n handleInputChange('');\n handleSelectedChange(undefined as typeof selected);\n setInternalInputValue('');\n\n if (isControlled) {\n setInternalSelected(undefined);\n }\n\n if (isRangeMode && 'onChange' in props && props.onChange) {\n props.onChange(undefined);\n }\n\n notifySelectChange(undefined as typeof selected, {});\n };\n\n const handleDaySelect: OnSelectHandler<typeof selected> = (selected, triggerDate, modifiers, event) => {\n // safe because of discriminated union\n handleSelectedChange(selected as typeof selected);\n\n // trigger callback\n notifySelectChange(selected, modifiers);\n\n if (isSingleMode && !isControlled) {\n // should be the only place formatting is applied to the input\n setInternalInputValue(formatDate(selected as Date, locale, dateFormat));\n }\n\n if (keyboardRef.current) {\n // Note: When the date is selected via enter key, assume the user uses keyboard navigation.\n // In this case the input should be focused to allow to tab to another element in his form.\n // However, it is not possible to detect according to the event since the event.type is alway \"click\".\n // Instead we check if the user used the tab key to focus the day picker.\n inputRef?.current?.focus();\n }\n\n if (closeOnSelect) {\n closePopper();\n keyboardRef.current = false;\n }\n };\n\n const {\n isOpen: isDropdownOpen,\n open: openPopper,\n close: closePopper,\n referenceRef: popperRef,\n popperElementRef: setPopperElement,\n popperStyles,\n popperAttributes,\n } = usePopperDropdown({ placement: alignRight ? 'bottom-end' : 'bottom-start' });\n\n const inputRef = useRef<HTMLInputElement>(null);\n const popperElementRef = useRef<HTMLElement | null>(null);\n\n const assignPopperElement = (element: HTMLElement | null) => {\n popperElementRef.current = element;\n setPopperElement(element);\n };\n\n // Close the dropdown when clicking outside the dropdown wrapper.\n // It also checks if the click happened into the input, in which case the\n // dropdown will remain open.\n const outsideRef = useClickOutside(\n event => {\n const target = event.target as Node | null;\n if (!target) {\n closePopper();\n return;\n }\n\n const clickedWithinTrigger = popperRef.current?.contains(target);\n const clickedWithinInput = inputRef.current?.contains(target);\n\n if (clickedWithinTrigger || clickedWithinInput) {\n return;\n }\n\n closePopper();\n },\n undefined,\n isDropdownOpen\n );\n\n const handleInputClick = () => {\n openPopper();\n inputRef.current?.focus();\n };\n\n // Needed to select all tabbable elements inside the dropdown calendar and to disable the\n // focus on tab for all of these. This allows the user to tab between multiple inputs on the page\n // or when having two day pickers side by side. Tabbing from one day picker input to the other will\n // open and close the dropdown respectively and achieving the same usability as the old DatePicker.\n // useEffect(() => {\n // if (isDropdownOpen && outsideRef.current) {\n // // get all buttons to disable the tab on them\n // const tabbableElements = (outsideRef.current as HTMLElement).querySelectorAll<HTMLElement>(\n // 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n // );\n\n // tabbableElements.forEach((element: Element) => {\n // element.setAttribute('tabindex', '-1');\n // });\n // }\n // }, [isDropdownOpen, outsideRef]);\n\n // Close the dropdown when it is open and when the user presses the \"escape\" key\n useKey('Escape', event => {\n const target = event.target;\n const isInput = inputRef.current && inputRef.current === target;\n\n if (isInput && isDropdownOpen) {\n closePopper();\n }\n });\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (!isDropdownOpen || !outsideRef.current) {\n return;\n }\n\n if (event.key === 'Tab') {\n const focusedInside = outsideRef.current.contains(document.activeElement);\n if (focusedInside) {\n keyboardRef.current = true;\n console.log('User tabbed into dropdown');\n // Optional: closePopper(); or focus inputRef.current\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [isDropdownOpen]);\n\n const dayPickerClassName = `DayPicker ${bsSize === 'sm' ? 'margin-10' : 'margin-15'} ${bsSize}`;\n\n if (inline) {\n // Render day picker inline without a dropdown and an input\n return (\n <div className={`display-flex flex-column justify-content-between ${className}`}>\n <ReactDayPicker\n {...selectionProps}\n mode={mode as any}\n defaultMonth={defaultMonth}\n locale={resolvedLocale}\n onSelect={handleDaySelect}\n captionLayout='dropdown'\n animate\n navLayout='around'\n startMonth={startMonth}\n endMonth={endMonth}\n showOutsideDays={showOutsideDays}\n fixedWeeks={fixedWeeks}\n className={dayPickerClassName}\n />\n {footer ? <div className='padding-15'>{footer}</div> : <div />}\n </div>\n );\n }\n\n const clearableInputProps = {\n ...inputProps,\n readOnly: !isSingleMode,\n style: {\n background: 'var(--color-white)',\n ...(inputProps?.style ?? {}),\n },\n };\n\n return (\n <>\n <div ref={popperRef} className={`form-group ${className}`}>\n <div className='input-group'>\n <span className='input-group-addon' onClick={handleInputClick}>\n <span className='rioglyph rioglyph-calendar' aria-hidden='true' />\n </span>\n {isClearable && (\n <ClearableInput\n id={id}\n autoComplete='off'\n placeholder={placeholder}\n {...clearableInputProps}\n type='text'\n value={inputValue}\n onChange={handleInputChange}\n onClick={handleInputClick}\n onClear={handleClearSelection}\n onBlur={handleInputBlur}\n onFocus={handleOnInputFocus}\n onKeyPress={handleInputKeyPress}\n // hasError={hasError}\n ref={inputRef}\n inputClassName={inputClassName}\n />\n )}\n {!isClearable && (\n <input\n id={id}\n size={12}\n type='text'\n autoComplete='off'\n placeholder={placeholder}\n {...inputProps}\n value={inputValue}\n onChange={handleInputChangeNative}\n onClick={handleInputClick}\n onBlur={handleInputBlur}\n onFocus={handleOnInputFocus}\n onKeyDown={handleInputKeyPress}\n ref={inputRef}\n readOnly={!isSingleMode}\n className={classNames('ClearableInput form-control bg-white', inputClassName)}\n />\n )}\n </div>\n </div>\n {isDropdownOpen && (\n <div\n style={popperStyles}\n className='DayPickerPopover z-index-max bg-white shadow-default rounded margin-y-3 border'\n {...popperAttributes}\n ref={assignPopperElement}\n role='dialog'\n aria-label='DayPicker calendar'\n >\n <div ref={outsideRef} className='display-flex flex-column justify-content-between'>\n <ReactDayPicker\n {...selectionProps}\n mode={mode as any}\n defaultMonth={defaultMonth}\n locale={resolvedLocale}\n onSelect={handleDaySelect}\n captionLayout='dropdown'\n animate\n navLayout='around'\n startMonth={startMonth}\n endMonth={endMonth}\n showOutsideDays={showOutsideDays}\n fixedWeeks={fixedWeeks}\n className={dayPickerClassName}\n />\n {footer ? <div className='padding-15'>{footer}</div> : <div />}\n </div>\n </div>\n )}\n </>\n );\n};\n\nconst isDateRange = (value: unknown): value is DateRange => {\n if (!value || typeof value !== 'object') {\n return false;\n }\n\n const range = value as DateRange;\n\n const fromIsValid = range.from === undefined || range.from instanceof Date;\n const toIsValid = range.to === undefined || range.to instanceof Date;\n\n return fromIsValid && toIsValid;\n};\n\nconst resolveLocale = (localeCode: string): Locale => {\n const baseCode = localeCode.split('-')[0]; // 'de-DE' → 'de'\n return (\n (locales as Record<string, Locale>)[baseCode] || (locales as Record<string, Locale>)[localeCode] || locales.enGB\n );\n};\n\nconst formatDate = (date: Date | undefined, localeCode: string, dateFormat?: string): string => {\n if (!date) {\n return '';\n }\n\n if (dateFormat) {\n return format(date, dateFormat); // use override\n }\n\n // fallback to locale-based formatting\n return new Intl.DateTimeFormat(localeCode).format(date);\n};\n\nconst formatSelectedForInput = (\n selected: unknown,\n localeCode: string,\n mode: 'single' | 'multiple' | 'range',\n dateFormat?: string\n): string => {\n if (!selected) {\n return '';\n }\n\n const formatFn = (date: Date) =>\n dateFormat ? format(date, dateFormat) : new Intl.DateTimeFormat(localeCode).format(date);\n\n if (mode === 'single' && selected instanceof Date) {\n return formatFn(selected);\n }\n\n if (mode === 'multiple' && Array.isArray(selected)) {\n return selected.map(formatFn).join(', ');\n }\n\n if (mode === 'range' && typeof selected === 'object' && 'from' in selected) {\n const { from, to } = selected as { from?: Date; to?: Date };\n if (!from || !to) {\n return '';\n }\n return [from, to].filter(Boolean).map(formatFn).join(' – ');\n }\n\n return '';\n};\n\nconst localeFormatMap: Record<string, string> = {\n 'bg-BG': 'dd.MM.yyyy',\n 'cs-CZ': 'dd.MM.yyyy',\n 'da-DK': 'dd-MM-yyyy',\n 'de-DE': 'dd.MM.yyyy',\n 'el-GR': 'dd/MM/yyyy',\n 'en-GB': 'dd/MM/yyyy',\n 'es-ES': 'dd/MM/yyyy',\n 'et-EE': 'dd.MM.yyyy',\n 'fi-FI': 'dd.MM.yyyy',\n 'fr-FR': 'dd/MM/yyyy',\n 'hr-HR': 'dd.MM.yyyy',\n 'hu-HU': 'yyyy. MM. dd.',\n 'it-IT': 'dd/MM/yyyy',\n 'lt-LT': 'dd-MM-yyyy',\n 'lv-LV': 'dd.MM.yyyy',\n 'nb-NO': 'dd.MM.yyyy',\n 'nl-NL': 'dd-MM-yyyy',\n 'pl-PL': 'dd.MM.yyyy',\n 'pt-BR': 'dd/MM/yyyy',\n 'pt-PT': 'dd/MM/yyyy',\n 'ro-RO': 'dd.MM.yyyy',\n 'sk-SK': 'dd.MM.yyyy',\n 'sl-SI': 'dd.MM.yyyy',\n 'sv-SE': 'yyyy-MM-dd',\n};\n\nconst getFormatForLocale = (localeCode: string, fallback = 'yyyy-MM-dd'): string => {\n return localeFormatMap[localeCode] || fallback;\n};\n\nconst parseDateString = (value: string | undefined, localeCode: string, dateFormat?: string): Date | undefined => {\n if (!value) {\n return undefined;\n }\n\n const formatToUse = dateFormat || getFormatForLocale(localeCode, dateFormat);\n const parsed = parse(value, formatToUse, new Date());\n\n return isValid(parsed) ? parsed : undefined;\n};\n\nexport default DayPicker;\n"],"names":["isSingleProps","props","isMultipleProps","isRangeProps","DayPicker","id","selected","inputProps","alignRight","bsSize","locale","footer","inline","showOutsideDays","fixedWeeks","mode","dateFormat","placeholder","isClearable","closeOnSelect","defaultMonth","startMonth","endMonth","inputClassName","className","isSingleMode","isMultipleMode","isRangeMode","isControlled","internalSelected","setInternalSelected","useState","selectedValue","narrowedSelected","isDateRange","selectionProps","resolvedLocale","resolveLocale","internalInputValue","setInternalInputValue","inputValue","formatSelectedForInput","useEffect","formatDate","notifySelectChange","value","modifiers","handleInputChange","newValue","doHandleInputValue","handleInputChangeNative","event","debouncedParseInput","useRef","debounce","rawValue","parsed","parseDateString","isValid","formattedSelected","keyboardRef","handleInputBlur","nextFocused","focusInsideDropdown","popperElementRef","isDropdownOpen","closePopper","handleOnInputFocus","openPopper","handleInputKeyPress","handleInputClick","handleSelectedChange","handleClearSelection","handleDaySelect","triggerDate","inputRef","popperRef","setPopperElement","popperStyles","popperAttributes","usePopperDropdown","assignPopperElement","element","outsideRef","useClickOutside","target","clickedWithinTrigger","clickedWithinInput","useKey","handleKeyDown","dayPickerClassName","jsxs","jsx","ReactDayPicker","clearableInputProps","Fragment","ClearableInput","classNames","range","fromIsValid","toIsValid","localeCode","baseCode","locales","date","format","formatFn","from","to","localeFormatMap","getFormatForLocale","fallback","formatToUse","parse"],"mappings":";;;;;;;;;;;;AAyGA,MAAMA,KAAgB,CAACC,MAAoD,CAACA,EAAM,QAAQA,EAAM,SAAS,UACnGC,KAAkB,CAACD,MAAsDA,EAAM,SAAS,YACxFE,KAAe,CAACF,MAAmDA,EAAM,SAAS,SAElFG,KAAY,CAACH,MAA0B;AACzC,QAAM;AAAA,IACF,IAAAI;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC,IAAa,CAAA;AAAA,IACb,YAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,QAAAC,IAAS;AAAA,IACT,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,YAAAC,IAAa;AAAA,IACb,MAAAC,IAAO;AAAA,IACP,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,eAAAC,IAAgB;AAAA,IAChB,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WA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
+
{"version":3,"file":"DayPicker.js","sources":["../../../src/components/datepicker/DayPicker.tsx"],"sourcesContent":["import { useEffect, useState, useRef } from 'react';\nimport { DayPicker as ReactDayPicker } from 'react-day-picker';\nimport { format, isValid, parse, type Locale } from 'date-fns';\nimport * as locales from 'date-fns/locale';\nimport { debounce } from 'es-toolkit/function';\n\nimport 'react-day-picker/dist/style.css';\n\nimport useClickOutside from '../../hooks/useClickOutside';\nimport usePopperDropdown from '../../hooks/usePopperDropdown';\nimport useKey from '../../hooks/useKey';\nimport ClearableInput from '../clearableInput/ClearableInput';\nimport classNames from '../../utils/classNames';\n\n// Features\n// [ ] input parsing and error handling\n// [-] time picker -> use a dedicated time picker input next to the day picker\n// [-] time range callback + validation\n// [ ] wrap all react-day-picker callbacks to avoid exposing internals and types\n// [x] start/end month\n// [ ] reserved days / unselectable days\n// [ ] disable editable input - use selected date only\n// [x] disallow editing input for mode: \"multi\" and \"range\" since input contains custom value\n// [ ] modifier and modifiersStyles\n// [x] closeOnSelect\n// [x] enter confirms the manual input and closes the dropdown\n// [x] esc closed the dropdown\n// [ ] support different sizes\n// [ ] mandatory value\n// [x] avoid opening dropdown again when clicking inside the input\n// [x] clear inputs\n// [ ] tab should select elements inside the dropdown, select should close but keep focus on input\n\nexport type DateRange = {\n from?: Date | undefined;\n to?: Date | undefined;\n};\n\nexport type Modifiers = Record<string, boolean>;\n\nexport type OnSelectHandler<T> = (\n selected: T,\n triggerDate: Date,\n modifiers: Modifiers,\n event: React.MouseEvent | React.KeyboardEvent\n) => void;\n\n// - By default, don't show a time picker\n// - Handle given formats like \"2020-04-04\" or ISO dates \"2020-03-12T16:20:44.193Z\" as initialValue - really?\n\ntype CommonProps = Omit<React.HTMLProps<HTMLInputElement>, 'onChange' | 'value' | 'selected'> & {\n id?: string;\n locale?: string;\n closeOnSelect?: boolean;\n initialValue?: Date;\n inputProps?: Omit<React.HTMLProps<HTMLInputElement>, 'type' | 'defaultValue' | 'children'>;\n\n /**\n * Custom format string (e.g., 'yyyy-MM-dd') to override locale-based formatting.\n * If omitted, locale-based display is used for the input.\n */\n dateFormat?: string;\n\n alignRight?: boolean;\n isClearable?: boolean;\n minWidth?: number;\n mandatory?: boolean;\n bsSize?: 'sm' | 'md' | 'lg' | 'xl';\n footer?: React.ReactNode;\n inline?: boolean;\n placeholder?: string | React.ReactElement;\n\n inputClassName?: string;\n className?: string;\n\n // react-day-picker props\n showOutsideDays?: boolean;\n fixedWeeks?: boolean;\n defaultMonth?: Date;\n startMonth?: Date;\n endMonth?: Date;\n};\n\ntype SingleModeProps = CommonProps & {\n mode?: 'single';\n selected?: Date;\n onInputChange?: (rawValue: string, parsedDate: Date | undefined, isValid: boolean) => void;\n onSelectChange?: (value: Date | undefined, modifiers: Modifiers) => void;\n};\n\ntype MultipleModeProps = CommonProps & {\n mode: 'multiple';\n selected?: Date[];\n onSelectChange?: (value: Date[] | undefined, modifiers: Modifiers) => void;\n};\n\ntype RangeModeProps = CommonProps & {\n mode: 'range';\n selected?: DateRange;\n onChange?: (value: DateRange | undefined) => void;\n onSelectChange?: (value: DateRange | undefined, modifiers: Modifiers) => void;\n};\n\ntype DayPickerProps = SingleModeProps | MultipleModeProps | RangeModeProps;\n\nconst isSingleProps = (props: DayPickerProps): props is SingleModeProps => !props.mode || props.mode === 'single';\nconst isMultipleProps = (props: DayPickerProps): props is MultipleModeProps => props.mode === 'multiple';\nconst isRangeProps = (props: DayPickerProps): props is RangeModeProps => props.mode === 'range';\n\nconst DayPicker = (props: DayPickerProps) => {\n const {\n id,\n selected,\n inputProps = {},\n alignRight,\n bsSize = '',\n locale = 'en-GB',\n footer,\n inline,\n showOutsideDays = true,\n fixedWeeks = true,\n mode = 'single',\n dateFormat,\n placeholder,\n isClearable = false,\n closeOnSelect = true,\n defaultMonth,\n startMonth,\n endMonth,\n inputClassName,\n className,\n } = props;\n\n const isSingleMode = mode === 'single';\n const isMultipleMode = mode === 'multiple';\n const isRangeMode = mode === 'range';\n\n const isControlled = selected !== undefined;\n const [internalSelected, setInternalSelected] = useState<typeof selected>();\n\n const selectedValue = isControlled ? selected : internalSelected;\n\n const narrowedSelected = (() => {\n if (isSingleMode) {\n return selectedValue instanceof Date ? selectedValue : undefined;\n }\n if (isMultipleMode) {\n return Array.isArray(selectedValue) ? selectedValue : undefined;\n }\n return isDateRange(selectedValue) ? selectedValue : undefined;\n })();\n\n const selectionProps = { selected: narrowedSelected };\n\n const resolvedLocale = resolveLocale(locale);\n\n const [internalInputValue, setInternalInputValue] = useState<string>('');\n\n const inputValue =\n isControlled && !isSingleMode\n ? formatSelectedForInput(narrowedSelected, locale, mode, dateFormat)\n : internalInputValue;\n\n // const inputValue = isSingleMode\n // ? internalInputValue\n // : formatSelectedForInput(narrowedSelected, locale, mode, dateFormat);\n\n // const inputValue = internalInputValue;\n\n // This ensures that whenever the external selected prop changes, the input field gets updated accordingly\n useEffect(() => {\n if (isSingleMode && isControlled && selected instanceof Date) {\n setInternalInputValue(formatDate(selected, locale, dateFormat));\n }\n }, [selected, isSingleMode, isControlled, locale, dateFormat]);\n\n const notifySelectChange = (value: typeof selected, modifiers: Modifiers) => {\n if (isSingleProps(props) && props.onSelectChange) {\n props.onSelectChange(value as SingleModeProps['selected'], modifiers);\n return;\n }\n\n if (isMultipleProps(props) && props.onSelectChange) {\n props.onSelectChange(value as MultipleModeProps['selected'], modifiers);\n return;\n }\n\n if (isRangeProps(props) && props.onSelectChange) {\n props.onSelectChange(value as RangeModeProps['selected'], modifiers);\n }\n };\n\n const handleInputChange = (newValue: string) => doHandleInputValue(newValue);\n const handleInputChangeNative = (event: any) => doHandleInputValue(event.currentTarget.value);\n\n const debouncedParseInput = useRef(\n debounce((rawValue: string) => {\n const parsed = parseDateString(rawValue, locale);\n console.log(parsed);\n const isValid = !!parsed;\n\n setInternalSelected(parsed as typeof props.selected);\n\n if (isSingleMode && 'onInputChange' in props && props.onInputChange) {\n props.onInputChange(rawValue, parsed, isValid);\n }\n\n const shouldNotify = parsed !== undefined || rawValue === '';\n if (shouldNotify) {\n // parse to desired dateFormat for use on outside\n const formattedSelected = dateFormat ? parseDateString(rawValue, locale, dateFormat) : parsed;\n notifySelectChange(formattedSelected as typeof selected, {});\n }\n }, 300)\n ).current;\n\n const doHandleInputValue = (rawValue: string) => {\n // const parsed = parseDateString(rawValue, locale, dateFormat);\n\n // const isValid = !!parsed;\n\n // if (!isControlled) {\n // // && isValidDate(parsed); // TODO: optional second validation\n\n // setInternalInputValue(rawValue);\n // setInternalSelected(parsed as typeof props.selected);\n // } else if (isSingleMode) {\n // setInternalInputValue(rawValue);\n // }\n\n // if (isSingleMode && 'onInputChange' in props && props.onInputChange) {\n // props.onInputChange(rawValue, parsed, isValid);\n // }\n\n // const shouldNotify = parsed !== undefined || rawValue === '';\n // if (shouldNotify) {\n // onSelectChange(parsed as typeof selected, {});\n // }\n\n setInternalInputValue(rawValue); // always update input state\n debouncedParseInput(rawValue); // defer parsing & callback execution\n };\n\n const keyboardRef = useRef(false);\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n // Do not close the dropdown on input blur when the user selects something inside the dropdown itself\n const nextFocused = event.relatedTarget as Node | null;\n const focusInsideDropdown = nextFocused && popperElementRef.current?.contains(nextFocused);\n if (isDropdownOpen && !focusInsideDropdown) {\n closePopper();\n }\n\n if (!isSingleMode) {\n return;\n }\n\n const parsed = parseDateString(internalInputValue, locale, dateFormat);\n\n if (parsed && isValid(parsed)) {\n setInternalSelected(parsed as typeof selected);\n notifySelectChange(parsed as typeof selected, {});\n setInternalInputValue(formatDate(parsed, locale, dateFormat));\n }\n };\n\n const handleOnInputFocus = () => {\n if (!isDropdownOpen) {\n openPopper();\n }\n };\n\n const handleInputKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {\n // Workaround to figure out if the user navigates via keyboard\n if (event.key === 'Tab') {\n keyboardRef.current = true;\n }\n\n if (event.key !== 'Enter') {\n return;\n }\n // In case the dropdown is not open but the input is focused, open the dropdown on enter\n if (!isDropdownOpen) {\n handleInputClick();\n return;\n }\n // In case the dropdown is open, the input is focused and the prop allows it, close the dropdown\n if (isDropdownOpen && closeOnSelect) {\n notifySelectChange(narrowedSelected as typeof selected, {});\n closePopper();\n }\n };\n\n const handleSelectedChange = (newValue: typeof selected) => {\n if (!isControlled) {\n setInternalSelected(newValue);\n }\n };\n\n const handleClearSelection = () => {\n handleInputChange('');\n handleSelectedChange(undefined as typeof selected);\n setInternalInputValue('');\n\n if (isControlled) {\n setInternalSelected(undefined);\n }\n\n if (isRangeMode && 'onChange' in props && props.onChange) {\n props.onChange(undefined);\n }\n\n notifySelectChange(undefined as typeof selected, {});\n };\n\n const handleDaySelect: OnSelectHandler<typeof selected> = (selected, triggerDate, modifiers, event) => {\n // safe because of discriminated union\n handleSelectedChange(selected as typeof selected);\n\n // trigger callback\n notifySelectChange(selected, modifiers);\n\n if (isSingleMode && !isControlled) {\n // should be the only place formatting is applied to the input\n setInternalInputValue(formatDate(selected as Date, locale, dateFormat));\n }\n\n if (keyboardRef.current) {\n // Note: When the date is selected via enter key, assume the user uses keyboard navigation.\n // In this case the input should be focused to allow to tab to another element in his form.\n // However, it is not possible to detect according to the event since the event.type is alway \"click\".\n // Instead we check if the user used the tab key to focus the day picker.\n inputRef?.current?.focus();\n }\n\n if (closeOnSelect) {\n closePopper();\n keyboardRef.current = false;\n }\n };\n\n const {\n isOpen: isDropdownOpen,\n open: openPopper,\n close: closePopper,\n referenceRef: popperRef,\n popperElementRef: setPopperElement,\n popperStyles,\n popperAttributes,\n } = usePopperDropdown({ placement: alignRight ? 'bottom-end' : 'bottom-start' });\n\n const inputRef = useRef<HTMLInputElement>(null);\n const popperElementRef = useRef<HTMLElement | null>(null);\n\n const assignPopperElement = (element: HTMLElement | null) => {\n popperElementRef.current = element;\n setPopperElement(element);\n };\n\n // Close the dropdown when clicking outside the dropdown wrapper.\n // It also checks if the click happened into the input, in which case the\n // dropdown will remain open.\n const outsideRef = useClickOutside(\n event => {\n const target = event.target as Node | null;\n if (!target) {\n closePopper();\n return;\n }\n\n const clickedWithinTrigger = popperRef.current?.contains(target);\n const clickedWithinInput = inputRef.current?.contains(target);\n\n if (clickedWithinTrigger || clickedWithinInput) {\n return;\n }\n\n closePopper();\n },\n undefined,\n isDropdownOpen\n );\n\n const handleInputClick = () => {\n openPopper();\n inputRef.current?.focus();\n };\n\n // Needed to select all tabbable elements inside the dropdown calendar and to disable the\n // focus on tab for all of these. This allows the user to tab between multiple inputs on the page\n // or when having two day pickers side by side. Tabbing from one day picker input to the other will\n // open and close the dropdown respectively and achieving the same usability as the old DatePicker.\n // useEffect(() => {\n // if (isDropdownOpen && outsideRef.current) {\n // // get all buttons to disable the tab on them\n // const tabbableElements = (outsideRef.current as HTMLElement).querySelectorAll<HTMLElement>(\n // 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n // );\n\n // tabbableElements.forEach((element: Element) => {\n // element.setAttribute('tabindex', '-1');\n // });\n // }\n // }, [isDropdownOpen, outsideRef]);\n\n // Close the dropdown when it is open and when the user presses the \"escape\" key\n useKey('Escape', event => {\n const target = event.target;\n const isInput = inputRef.current && inputRef.current === target;\n\n if (isInput && isDropdownOpen) {\n closePopper();\n }\n });\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (!isDropdownOpen || !outsideRef.current) {\n return;\n }\n\n if (event.key === 'Tab') {\n const focusedInside = outsideRef.current.contains(document.activeElement);\n if (focusedInside) {\n keyboardRef.current = true;\n console.log('User tabbed into dropdown');\n // Optional: closePopper(); or focus inputRef.current\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [isDropdownOpen]);\n\n const dayPickerClassName = `DayPicker ${bsSize === 'sm' ? 'margin-10' : 'margin-15'} ${bsSize}`;\n\n if (inline) {\n // Render day picker inline without a dropdown and an input\n return (\n <div className={`display-flex flex-column justify-content-between ${className}`}>\n <ReactDayPicker\n {...selectionProps}\n mode={mode as any}\n defaultMonth={defaultMonth}\n locale={resolvedLocale}\n onSelect={handleDaySelect}\n captionLayout='dropdown'\n animate\n navLayout='around'\n startMonth={startMonth}\n endMonth={endMonth}\n showOutsideDays={showOutsideDays}\n fixedWeeks={fixedWeeks}\n className={dayPickerClassName}\n />\n {footer ? <div className='padding-15'>{footer}</div> : <div />}\n </div>\n );\n }\n\n const clearableInputProps = {\n ...inputProps,\n readOnly: !isSingleMode,\n style: {\n background: 'var(--color-white)',\n ...(inputProps?.style ?? {}),\n },\n };\n\n return (\n <>\n <div ref={popperRef} className={`form-group ${className}`}>\n <div className='input-group'>\n <span className='input-group-addon' onClick={handleInputClick}>\n <span className='rioglyph rioglyph-calendar' aria-hidden='true' />\n </span>\n {isClearable && (\n <ClearableInput\n id={id}\n autoComplete='off'\n placeholder={placeholder}\n {...clearableInputProps}\n type='text'\n value={inputValue}\n onChange={handleInputChange}\n onClick={handleInputClick}\n onClear={handleClearSelection}\n onBlur={handleInputBlur}\n onFocus={handleOnInputFocus}\n onKeyPress={handleInputKeyPress}\n // hasError={hasError}\n ref={inputRef}\n inputClassName={inputClassName}\n />\n )}\n {!isClearable && (\n <input\n id={id}\n size={12}\n type='text'\n autoComplete='off'\n placeholder={placeholder}\n {...inputProps}\n value={inputValue}\n onChange={handleInputChangeNative}\n onClick={handleInputClick}\n onBlur={handleInputBlur}\n onFocus={handleOnInputFocus}\n onKeyDown={handleInputKeyPress}\n ref={inputRef}\n readOnly={!isSingleMode}\n className={classNames('ClearableInput form-control bg-white', inputClassName)}\n />\n )}\n </div>\n </div>\n {isDropdownOpen && (\n <div\n style={popperStyles}\n className='DayPickerPopover z-index-max bg-white shadow-default rounded margin-y-3 border'\n {...popperAttributes}\n ref={assignPopperElement}\n role='dialog'\n aria-label='DayPicker calendar'\n >\n <div ref={outsideRef} className='display-flex flex-column justify-content-between'>\n <ReactDayPicker\n {...selectionProps}\n mode={mode as any}\n defaultMonth={defaultMonth}\n locale={resolvedLocale}\n onSelect={handleDaySelect}\n captionLayout='dropdown'\n animate\n navLayout='around'\n startMonth={startMonth}\n endMonth={endMonth}\n showOutsideDays={showOutsideDays}\n fixedWeeks={fixedWeeks}\n className={dayPickerClassName}\n />\n {footer ? <div className='padding-15'>{footer}</div> : <div />}\n </div>\n </div>\n )}\n </>\n );\n};\n\nconst isDateRange = (value: unknown): value is DateRange => {\n if (!value || typeof value !== 'object') {\n return false;\n }\n\n const range = value as DateRange;\n\n const fromIsValid = range.from === undefined || range.from instanceof Date;\n const toIsValid = range.to === undefined || range.to instanceof Date;\n\n return fromIsValid && toIsValid;\n};\n\nconst resolveLocale = (localeCode: string): Locale => {\n const baseCode = localeCode.split('-')[0]; // 'de-DE' → 'de'\n return (\n (locales as Record<string, Locale>)[baseCode] || (locales as Record<string, Locale>)[localeCode] || locales.enGB\n );\n};\n\nconst formatDate = (date: Date | undefined, localeCode: string, dateFormat?: string): string => {\n if (!date) {\n return '';\n }\n\n if (dateFormat) {\n return format(date, dateFormat); // use override\n }\n\n // fallback to locale-based formatting\n return new Intl.DateTimeFormat(localeCode).format(date);\n};\n\nconst formatSelectedForInput = (\n selected: unknown,\n localeCode: string,\n mode: 'single' | 'multiple' | 'range',\n dateFormat?: string\n): string => {\n if (!selected) {\n return '';\n }\n\n const formatFn = (date: Date) =>\n dateFormat ? format(date, dateFormat) : new Intl.DateTimeFormat(localeCode).format(date);\n\n if (mode === 'single' && selected instanceof Date) {\n return formatFn(selected);\n }\n\n if (mode === 'multiple' && Array.isArray(selected)) {\n return selected.map(formatFn).join(', ');\n }\n\n if (mode === 'range' && typeof selected === 'object' && 'from' in selected) {\n const { from, to } = selected as { from?: Date; to?: Date };\n if (!from || !to) {\n return '';\n }\n return [from, to].filter(Boolean).map(formatFn).join(' – ');\n }\n\n return '';\n};\n\nconst localeFormatMap: Record<string, string> = {\n 'bg-BG': 'dd.MM.yyyy',\n 'cs-CZ': 'dd.MM.yyyy',\n 'da-DK': 'dd-MM-yyyy',\n 'de-DE': 'dd.MM.yyyy',\n 'el-GR': 'dd/MM/yyyy',\n 'en-GB': 'dd/MM/yyyy',\n 'es-ES': 'dd/MM/yyyy',\n 'et-EE': 'dd.MM.yyyy',\n 'fi-FI': 'dd.MM.yyyy',\n 'fr-FR': 'dd/MM/yyyy',\n 'hr-HR': 'dd.MM.yyyy',\n 'hu-HU': 'yyyy. MM. dd.',\n 'it-IT': 'dd/MM/yyyy',\n 'lt-LT': 'dd-MM-yyyy',\n 'lv-LV': 'dd.MM.yyyy',\n 'nb-NO': 'dd.MM.yyyy',\n 'nl-NL': 'dd-MM-yyyy',\n 'pl-PL': 'dd.MM.yyyy',\n 'pt-BR': 'dd/MM/yyyy',\n 'pt-PT': 'dd/MM/yyyy',\n 'ro-RO': 'dd.MM.yyyy',\n 'sk-SK': 'dd.MM.yyyy',\n 'sl-SI': 'dd.MM.yyyy',\n 'sv-SE': 'yyyy-MM-dd',\n};\n\nconst getFormatForLocale = (localeCode: string, fallback = 'yyyy-MM-dd'): string => {\n return localeFormatMap[localeCode] || fallback;\n};\n\nconst parseDateString = (value: string | undefined, localeCode: string, dateFormat?: string): Date | undefined => {\n if (!value) {\n return undefined;\n }\n\n const formatToUse = dateFormat || getFormatForLocale(localeCode, dateFormat);\n const parsed = parse(value, formatToUse, new Date());\n\n return isValid(parsed) ? parsed : undefined;\n};\n\nexport default DayPicker;\n"],"names":["isSingleProps","props","isMultipleProps","isRangeProps","DayPicker","id","selected","inputProps","alignRight","bsSize","locale","footer","inline","showOutsideDays","fixedWeeks","mode","dateFormat","placeholder","isClearable","closeOnSelect","defaultMonth","startMonth","endMonth","inputClassName","className","isSingleMode","isMultipleMode","isRangeMode","isControlled","internalSelected","setInternalSelected","useState","selectedValue","narrowedSelected","isDateRange","selectionProps","resolvedLocale","resolveLocale","internalInputValue","setInternalInputValue","inputValue","formatSelectedForInput","useEffect","formatDate","notifySelectChange","value","modifiers","handleInputChange","newValue","doHandleInputValue","handleInputChangeNative","event","debouncedParseInput","useRef","debounce","rawValue","parsed","parseDateString","isValid","formattedSelected","keyboardRef","handleInputBlur","nextFocused","focusInsideDropdown","popperElementRef","isDropdownOpen","closePopper","handleOnInputFocus","openPopper","handleInputKeyPress","handleInputClick","handleSelectedChange","handleClearSelection","handleDaySelect","triggerDate","inputRef","popperRef","setPopperElement","popperStyles","popperAttributes","usePopperDropdown","assignPopperElement","element","outsideRef","useClickOutside","target","clickedWithinTrigger","clickedWithinInput","useKey","handleKeyDown","dayPickerClassName","jsxs","jsx","ReactDayPicker","clearableInputProps","Fragment","ClearableInput","classNames","range","fromIsValid","toIsValid","localeCode","baseCode","locales","date","format","formatFn","from","to","localeFormatMap","getFormatForLocale","fallback","formatToUse","parse"],"mappings":";;;;;;;;;;;;AAyGA,MAAMA,KAAgB,CAACC,MAAoD,CAACA,EAAM,QAAQA,EAAM,SAAS,UACnGC,KAAkB,CAACD,MAAsDA,EAAM,SAAS,YACxFE,KAAe,CAACF,MAAmDA,EAAM,SAAS,SAElFG,KAAY,CAACH,MAA0B;AACzC,QAAM;AAAA,IACF,IAAAI;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC,IAAa,CAAA;AAAA,IACb,YAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,QAAAC,IAAS;AAAA,IACT,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,YAAAC,IAAa;AAAA,IACb,MAAAC,IAAO;AAAA,IACP,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,eAAAC,IAAgB;AAAA,IAChB,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,EAAA,IACAvB,GAEEwB,IAAeV,MAAS,UACxBW,KAAiBX,MAAS,YAC1BY,KAAcZ,MAAS,SAEvBa,IAAetB,MAAa,QAC5B,CAACuB,IAAkBC,CAAmB,IAAIC,GAAA,GAE1CC,IAAgBJ,IAAetB,IAAWuB,IAE1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EAAS,IAAIoG,CAAQ,EAAE,KAAK,IAAI;AAG3C,MAAI3F,MAAS,WAAW,OAAOT,KAAa,YAAY,UAAUA,GAAU;AACxE,UAAM,EAAE,MAAAqG,GAAM,IAAAC,EAAA,IAAOtG;AACrB,WAAI,CAACqG,KAAQ,CAACC,IACH,KAEJ,CAACD,GAAMC,CAAE,EAAE,OAAO,OAAO,EAAE,IAAIF,CAAQ,EAAE,KAAK,KAAK;AAAA,EAC9D;AAEA,SAAO;AACX,GAEMG,KAA0C;AAAA,EAC5C,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AACb,GAEMC,KAAqB,CAACT,GAAoBU,IAAW,iBAChDF,GAAgBR,CAAU,KAAKU,GAGpCtD,IAAkB,CAACZ,GAA2BwD,GAAoBrF,MAA0C;AAC9G,MAAI,CAAC6B;AACD;AAGJ,QAAMmE,IAAchG,KAAc8F,GAAmBT,GAAYrF,CAAU,GACrEwC,IAASyD,GAAMpE,GAAOmE,GAAa,oBAAI,MAAM;AAEnD,SAAOtD,GAAQF,CAAM,IAAIA,IAAS;AACtC;"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as s, jsxs as r, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import L from "
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { getOrCreatePortalRoot as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
1
|
+
import { jsx as s, jsxs as r, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m } from "react";
|
|
3
|
+
import oo from "react-dom";
|
|
4
|
+
import { noop as L } from "es-toolkit/function";
|
|
5
|
+
import { useReducedMotion as eo, AnimatePresence as lo, motion as S } from "motion/react";
|
|
6
|
+
import _ from "../../utils/classNames.js";
|
|
7
|
+
import { getOrCreatePortalRoot as to } from "../../utils/portalRoot.js";
|
|
8
|
+
import so from "../../hooks/useEsc.js";
|
|
9
|
+
import I from "./DialogHeader.js";
|
|
10
|
+
import v from "./DialogBody.js";
|
|
11
11
|
import D from "./DialogFooter.js";
|
|
12
|
-
import
|
|
13
|
-
import { DialogContextProvider as
|
|
14
|
-
const C = "modal-dialog",
|
|
12
|
+
import ao from "../../hooks/useFocusTrap.js";
|
|
13
|
+
import { DialogContextProvider as io } from "./dialogContext.js";
|
|
14
|
+
const C = "modal-dialog", x = "modal-open", o = (w) => {
|
|
15
15
|
const {
|
|
16
|
-
title:
|
|
16
|
+
title: c,
|
|
17
17
|
subtitle: N,
|
|
18
18
|
body: d,
|
|
19
19
|
footer: f,
|
|
@@ -21,39 +21,39 @@ const C = "modal-dialog", v = "modal-open", o = (w) => {
|
|
|
21
21
|
className: F = "",
|
|
22
22
|
bodyClassName: Z,
|
|
23
23
|
footerClassName: A,
|
|
24
|
-
showXsDialogBorders:
|
|
25
|
-
showCloseButton:
|
|
26
|
-
useOverflow:
|
|
24
|
+
showXsDialogBorders: O = !1,
|
|
25
|
+
showCloseButton: B = !0,
|
|
26
|
+
useOverflow: H = !1,
|
|
27
27
|
bsSize: e,
|
|
28
28
|
show: a = !1,
|
|
29
|
-
onClose:
|
|
29
|
+
onClose: R = L,
|
|
30
30
|
disableEsc: T = !1,
|
|
31
|
-
onEsc: M =
|
|
31
|
+
onEsc: M = L,
|
|
32
32
|
onCloseValidation: P = () => !0,
|
|
33
33
|
children: u,
|
|
34
34
|
...G
|
|
35
|
-
} = w, [U, h] =
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
t ? document.body.classList.add(
|
|
40
|
-
},
|
|
41
|
-
P() && (h(!1),
|
|
42
|
-
}, [z, K] =
|
|
43
|
-
a !== z && (h(a),
|
|
44
|
-
if (!
|
|
35
|
+
} = w, [U, h] = m(a), p = to(), l = eo(), [n, X] = m(null);
|
|
36
|
+
ao(n);
|
|
37
|
+
const j = (t) => {
|
|
38
|
+
const i = p.getElementsByClassName(C).length > 1;
|
|
39
|
+
t ? document.body.classList.add(x) : !t && !i && document.body.classList.remove(x);
|
|
40
|
+
}, k = () => g(), g = (t) => {
|
|
41
|
+
P() && (h(!1), R(), M());
|
|
42
|
+
}, [z, K] = m(a);
|
|
43
|
+
a !== z && (h(a), j(a), K(a)), so(() => {
|
|
44
|
+
if (!n)
|
|
45
45
|
return;
|
|
46
|
-
const t =
|
|
47
|
-
!T && t.contains(
|
|
46
|
+
const t = n, i = document.activeElement;
|
|
47
|
+
!T && t.contains(i) && g();
|
|
48
48
|
});
|
|
49
49
|
const V = (t) => {
|
|
50
50
|
if (t.opacity === 0)
|
|
51
51
|
return;
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
},
|
|
52
|
+
const i = n, Y = document.activeElement;
|
|
53
|
+
i?.contains(Y) || i?.focus();
|
|
54
|
+
}, W = _("modal", "show", F), E = e === "xs", y = !!u, q = _(
|
|
55
55
|
C,
|
|
56
|
-
|
|
56
|
+
H && "modal-overflow",
|
|
57
57
|
e === "xs" && "modal-xs",
|
|
58
58
|
e === "sm" && "modal-sm",
|
|
59
59
|
e === "lg" && "modal-lg",
|
|
@@ -64,22 +64,22 @@ const C = "modal-dialog", v = "modal-open", o = (w) => {
|
|
|
64
64
|
e === "fullheight-lg" && "modal-full-height modal-lg",
|
|
65
65
|
e === "fullheight-xl" && "modal-full-height modal-xl",
|
|
66
66
|
e === "fullscreen" && "modal-fullscreen"
|
|
67
|
-
),
|
|
67
|
+
), J = {
|
|
68
68
|
type: "spring",
|
|
69
69
|
damping: 33,
|
|
70
70
|
stiffness: 500
|
|
71
|
-
},
|
|
71
|
+
}, Q = {
|
|
72
72
|
type: "spring",
|
|
73
73
|
damping: 25,
|
|
74
74
|
stiffness: 400
|
|
75
75
|
};
|
|
76
|
-
return
|
|
76
|
+
return oo.createPortal(
|
|
77
77
|
/* @__PURE__ */ s(
|
|
78
|
-
|
|
78
|
+
io,
|
|
79
79
|
{
|
|
80
|
-
value: { onClose:
|
|
80
|
+
value: { onClose: k, isSmallestDialog: E, showXsDialogBorders: O, showCloseButton: B },
|
|
81
81
|
children: /* @__PURE__ */ s(
|
|
82
|
-
|
|
82
|
+
lo,
|
|
83
83
|
{
|
|
84
84
|
initial: !1,
|
|
85
85
|
mode: "wait",
|
|
@@ -87,45 +87,45 @@ const C = "modal-dialog", v = "modal-open", o = (w) => {
|
|
|
87
87
|
"div",
|
|
88
88
|
{
|
|
89
89
|
...G,
|
|
90
|
-
className:
|
|
90
|
+
className: W,
|
|
91
91
|
role: "dialog",
|
|
92
|
-
ref: i,
|
|
93
92
|
"aria-label": "dialog",
|
|
94
93
|
tabIndex: 0,
|
|
95
94
|
children: [
|
|
96
95
|
/* @__PURE__ */ s(
|
|
97
|
-
|
|
96
|
+
S.div,
|
|
98
97
|
{
|
|
99
98
|
initial: l ? !1 : { opacity: 0, y: "-50%" },
|
|
100
|
-
animate: l ? { opacity: 1 } : { opacity: 1, y: 0, transition: E ?
|
|
99
|
+
animate: l ? { opacity: 1 } : { opacity: 1, y: 0, transition: E ? Q : J },
|
|
101
100
|
exit: l ? void 0 : { opacity: 0, y: "-150%" },
|
|
102
101
|
transition: l ? { duration: 0 } : {
|
|
103
102
|
opacity: { duration: 0.2 },
|
|
104
103
|
y: { duration: 0.3 }
|
|
105
104
|
},
|
|
106
105
|
onAnimationComplete: V,
|
|
107
|
-
ref:
|
|
108
|
-
className:
|
|
106
|
+
ref: X,
|
|
107
|
+
className: q,
|
|
109
108
|
role: "document",
|
|
109
|
+
tabIndex: -1,
|
|
110
110
|
children: /* @__PURE__ */ r("div", { className: "modal-content", children: [
|
|
111
111
|
y && u,
|
|
112
|
-
!y && /* @__PURE__ */ r(
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
!y && /* @__PURE__ */ r($, { children: [
|
|
113
|
+
c && /* @__PURE__ */ s(
|
|
114
|
+
I,
|
|
115
115
|
{
|
|
116
|
-
title:
|
|
116
|
+
title: c,
|
|
117
117
|
subtitle: N,
|
|
118
118
|
headerButtons: b
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
|
-
d && /* @__PURE__ */ s(
|
|
121
|
+
d && /* @__PURE__ */ s(v, { className: Z, children: d }),
|
|
122
122
|
f && /* @__PURE__ */ s(D, { className: A, children: f })
|
|
123
123
|
] })
|
|
124
124
|
] })
|
|
125
125
|
}
|
|
126
126
|
),
|
|
127
127
|
/* @__PURE__ */ s(
|
|
128
|
-
|
|
128
|
+
S.div,
|
|
129
129
|
{
|
|
130
130
|
initial: l ? !1 : { opacity: 0 },
|
|
131
131
|
animate: { opacity: 1 },
|
|
@@ -144,8 +144,8 @@ const C = "modal-dialog", v = "modal-open", o = (w) => {
|
|
|
144
144
|
p
|
|
145
145
|
);
|
|
146
146
|
};
|
|
147
|
-
o.Title =
|
|
148
|
-
o.Body =
|
|
147
|
+
o.Title = I;
|
|
148
|
+
o.Body = v;
|
|
149
149
|
o.Footer = D;
|
|
150
150
|
o.SIZE_XS = "xs";
|
|
151
151
|
o.SIZE_SM = "sm";
|