@povio/ui 2.3.1 → 2.3.2-rc.2
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/dist/assets/icons/AlignCenter.js +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +32 -9
- package/dist/components/Menu/MenuMobile.js +97 -38
- package/dist/components/Menu/MenuPopover.js +105 -29
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +55 -17
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +201 -35
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/inputs/Checkbox/checkbox.cva.js +4 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +368 -76
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +456 -167
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +13 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +273 -57
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +6 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +605 -130
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +332 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +3 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +301 -102
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +3 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +146 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.js +311 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +13 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +384 -139
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +96 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +210 -65
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +7 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +13 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +39 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +85 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +87 -44
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
- package/dist/components/inputs/File/shared/InputUploadFilled.js +50 -9
- package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +25 -5
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +6 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +11 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +447 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +575 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +4 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +419 -90
- package/dist/components/inputs/Input/shared/InputContent.js +192 -59
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +353 -60
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +17 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +42 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +213 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +34 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +36 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +104 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +224 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +330 -116
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +12 -5
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +7 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +24 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +3 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +37 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +80 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +528 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -75
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +214 -37
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
- package/dist/components/inputs/Toggle/toggle.cva.js +4 -2
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +21 -11
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +88 -12
- package/dist/components/inputs/shared/StaticInput.d.ts +38 -0
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +10 -0
- package/dist/components/inputs/shared/input.cva.js +54 -14
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +4 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +14 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +100 -0
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +104 -31
- package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
- package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/segment/Segment.js +218 -57
- package/dist/components/segment/SegmentItem.js +67 -10
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +21 -13
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +28 -27
- package/dist/components/text/Link/Link.js +19 -7
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +20 -7
- package/dist/config/uiConfig.context.js +67 -14
- package/dist/config/uiStyle.context.d.ts +27 -4
- package/dist/config/uiStyle.context.js +15 -5
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +3 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.js +101 -30
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +57 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -2
- package/dist/tw-ui-plugin.js +8 -1
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +134 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/package.json +1 -1
|
@@ -1,13 +1,21 @@
|
|
|
1
|
+
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
1
2
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
2
3
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
4
|
import "../../../../config/i18n.js";
|
|
4
5
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
6
|
+
import { datePickerInputContentRow } from "../shared/datePickerInput.cva.js";
|
|
7
|
+
import { renderDatePickerTodayIcon } from "../shared/datePickerTodayIcon.js";
|
|
5
8
|
import { DatePickerInput } from "../shared/DatePickerInput.js";
|
|
6
9
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
7
10
|
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
11
|
+
import { getStaticDateRangeSegments } from "../shared/staticDateTimeSegments.js";
|
|
8
12
|
import { FormField } from "../../FormField/FormField.js";
|
|
9
13
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
14
|
+
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
15
|
+
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
16
|
+
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
10
17
|
import { RangeCalendar } from "../shared/RangeCalendar.js";
|
|
18
|
+
import { c } from "react/compiler-runtime";
|
|
11
19
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
20
|
import { clsx } from "clsx";
|
|
13
21
|
import { useCallback, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
@@ -16,33 +24,49 @@ import { useDateRangePicker, useLocale as useLocale$1 } from "react-aria";
|
|
|
16
24
|
import { mergeRefs } from "@react-aria/utils";
|
|
17
25
|
import { useTranslation } from "react-i18next";
|
|
18
26
|
import { Controller } from "react-hook-form";
|
|
19
|
-
import { createCalendar, endOfMonth, endOfWeek, endOfYear,
|
|
27
|
+
import { createCalendar, endOfMonth, endOfWeek, endOfYear, startOfMonth, startOfWeek, startOfYear, toCalendarDate, today } from "@internationalized/date";
|
|
20
28
|
import { DateTime } from "luxon";
|
|
21
29
|
import { useDateRangePickerState, useRangeCalendarState } from "react-stately";
|
|
22
30
|
//#region src/components/inputs/DateTime/DateRangePicker/DateRangePicker.tsx
|
|
31
|
+
var DATE_PICKER_TIME_ZONE = "UTC";
|
|
23
32
|
var DateRangePickerBase = (props) => {
|
|
24
33
|
const ui = UIConfig.useConfig();
|
|
25
34
|
const { t } = useTranslation();
|
|
26
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, className, hideSidebar, placeholder, inputClassName, hideLabel
|
|
35
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, hideSidebar, placeholder, inputClassName, hideLabel: hideLabelProp, variant: variantProp, as: asProp, size: sizeProp, isClearable: isClearableProp, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, autoFixYear: autoFixYearProp, fireBlurOnChange: fireBlurOnChangeProp, ...rest } = props;
|
|
36
|
+
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
37
|
+
const variant = variantProp ?? ui.input.variant;
|
|
38
|
+
const as = asProp ?? ui.input.as;
|
|
39
|
+
const size = sizeProp ?? ui.input.size;
|
|
40
|
+
const isClearable = isClearableProp ?? ui.input.isClearable;
|
|
41
|
+
const todayIcon = todayIconProp ?? ui.dateInput.todayIcon;
|
|
42
|
+
const todayIconButtonSize = todayIconButtonSizeProp ?? ui.dateInput.todayIconButtonSize;
|
|
43
|
+
const todayIconButtonComponent = todayIconButtonComponentProp ?? ui.dateInput.todayIconButtonComponent;
|
|
44
|
+
const todayIconPlacement = todayIconPlacementProp ?? ui.dateInput.todayIconPlacement;
|
|
45
|
+
const shouldForceLeadingZeros = shouldForceLeadingZerosProp ?? ui.dateInput.shouldForceLeadingZeros;
|
|
46
|
+
const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
|
|
47
|
+
const autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
|
|
48
|
+
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
|
|
27
49
|
const [validationRangeError, setValidationRangeError] = useState();
|
|
28
50
|
const datePickerInputRef = useRef(null);
|
|
29
51
|
const dateRangePickerRef = useMemo(() => ({ get current() {
|
|
30
52
|
return datePickerInputRef.current?.getContainer?.() || null;
|
|
31
53
|
} }), []);
|
|
54
|
+
const normalizedValue = value ?? null;
|
|
32
55
|
const dialogState = useDateRangePickerState({
|
|
33
56
|
...rest,
|
|
34
|
-
value,
|
|
57
|
+
value: normalizedValue,
|
|
35
58
|
shouldCloseOnSelect: false,
|
|
36
59
|
shouldForceLeadingZeros
|
|
37
60
|
});
|
|
38
61
|
const state = useDateRangePickerState({
|
|
39
62
|
...rest,
|
|
40
63
|
shouldForceLeadingZeros,
|
|
41
|
-
value,
|
|
64
|
+
value: normalizedValue,
|
|
42
65
|
onChange: (newValue) => {
|
|
43
66
|
if (isValidRange(newValue)) return;
|
|
44
67
|
onChange?.(newValue);
|
|
45
68
|
handleCalendarStatesChange(newValue);
|
|
69
|
+
if (fireBlurOnChange) debouncedBlur(newValue);
|
|
46
70
|
},
|
|
47
71
|
shouldCloseOnSelect: false
|
|
48
72
|
});
|
|
@@ -57,9 +81,16 @@ var DateRangePickerBase = (props) => {
|
|
|
57
81
|
shouldForceLeadingZeros
|
|
58
82
|
}, dialogState, dateRangePickerRef);
|
|
59
83
|
const { locale } = useLocale$1();
|
|
60
|
-
useImperativeHandle(ref, () => ({
|
|
61
|
-
|
|
62
|
-
|
|
84
|
+
useImperativeHandle(ref, () => ({
|
|
85
|
+
clear: () => {
|
|
86
|
+
datePickerInputRef.current?.clear();
|
|
87
|
+
},
|
|
88
|
+
getContainer: () => datePickerInputRef.current?.getContainer?.() ?? null
|
|
89
|
+
}));
|
|
90
|
+
const handleBlur = (newValue_0) => {
|
|
91
|
+
onBlur?.({ target: { value: newValue_0 } });
|
|
92
|
+
};
|
|
93
|
+
const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
|
|
63
94
|
const formFieldProps = {
|
|
64
95
|
error: error || validationRangeError,
|
|
65
96
|
label,
|
|
@@ -88,7 +119,7 @@ var DateRangePickerBase = (props) => {
|
|
|
88
119
|
createCalendar,
|
|
89
120
|
pageBehavior: "single",
|
|
90
121
|
visibleDuration: { months: 1 },
|
|
91
|
-
defaultFocusedValue: today(
|
|
122
|
+
defaultFocusedValue: today(DATE_PICKER_TIME_ZONE).add({ months: 1 }),
|
|
92
123
|
minValue: void 0,
|
|
93
124
|
maxValue: void 0
|
|
94
125
|
});
|
|
@@ -110,10 +141,10 @@ var DateRangePickerBase = (props) => {
|
|
|
110
141
|
className: headerClassName,
|
|
111
142
|
labelProps
|
|
112
143
|
};
|
|
113
|
-
const isValidRange = useCallback((
|
|
114
|
-
if (
|
|
115
|
-
const startDate =
|
|
116
|
-
if (
|
|
144
|
+
const isValidRange = useCallback((newValue_1) => {
|
|
145
|
+
if (newValue_1?.start && newValue_1?.end) {
|
|
146
|
+
const startDate = newValue_1.start;
|
|
147
|
+
if (newValue_1.end.compare(startDate) < 0) {
|
|
117
148
|
setValidationRangeError(t(($) => $.ui.datePicker.errors.endDateBeforeStart, { ns: "ui" }));
|
|
118
149
|
return true;
|
|
119
150
|
}
|
|
@@ -121,20 +152,20 @@ var DateRangePickerBase = (props) => {
|
|
|
121
152
|
} else setValidationRangeError(void 0);
|
|
122
153
|
return false;
|
|
123
154
|
}, [t]);
|
|
124
|
-
const handleCalendarStatesChange = (
|
|
125
|
-
if (
|
|
126
|
-
if (isValidRange(
|
|
127
|
-
dialogState.setValue(
|
|
128
|
-
const
|
|
129
|
-
const
|
|
130
|
-
leftCalendarState.setFocusedDate(
|
|
131
|
-
if (
|
|
132
|
-
else rightCalendarState.setFocusedDate(
|
|
133
|
-
leftCalendarState.setValue(
|
|
134
|
-
rightCalendarState.setValue(
|
|
155
|
+
const handleCalendarStatesChange = (newValue_2) => {
|
|
156
|
+
if (newValue_2) {
|
|
157
|
+
if (isValidRange(newValue_2)) return;
|
|
158
|
+
dialogState.setValue(newValue_2);
|
|
159
|
+
const startDate_0 = newValue_2.start;
|
|
160
|
+
const endDate_0 = newValue_2.end;
|
|
161
|
+
leftCalendarState.setFocusedDate(startDate_0);
|
|
162
|
+
if (startDate_0.year === endDate_0.year && startDate_0.month === endDate_0.month) rightCalendarState.setFocusedDate(startDate_0.add({ months: 1 }));
|
|
163
|
+
else rightCalendarState.setFocusedDate(endDate_0);
|
|
164
|
+
leftCalendarState.setValue(newValue_2);
|
|
165
|
+
rightCalendarState.setValue(newValue_2);
|
|
135
166
|
setRangeSelection({
|
|
136
|
-
start:
|
|
137
|
-
end:
|
|
167
|
+
start: newValue_2.start,
|
|
168
|
+
end: newValue_2.end,
|
|
138
169
|
isSelecting: false
|
|
139
170
|
});
|
|
140
171
|
setHoverDate(null);
|
|
@@ -158,27 +189,27 @@ var DateRangePickerBase = (props) => {
|
|
|
158
189
|
setHoverDate(date);
|
|
159
190
|
});
|
|
160
191
|
}, []);
|
|
161
|
-
const handleDateHover = useCallback((
|
|
162
|
-
if (rangeSelection.isSelecting && rangeSelection.start) throttledSetHoverDate(
|
|
192
|
+
const handleDateHover = useCallback((date_0) => {
|
|
193
|
+
if (rangeSelection.isSelecting && rangeSelection.start) throttledSetHoverDate(date_0);
|
|
163
194
|
}, [
|
|
164
195
|
rangeSelection.isSelecting,
|
|
165
196
|
rangeSelection.start,
|
|
166
197
|
throttledSetHoverDate
|
|
167
198
|
]);
|
|
168
|
-
const handleDateSelection = useCallback((
|
|
199
|
+
const handleDateSelection = useCallback((date_1, calendarSide) => {
|
|
169
200
|
if (calendarSide) {
|
|
170
201
|
const currentVisibleMonth = (calendarSide === "left" ? leftCalendarState : rightCalendarState).visibleRange.start;
|
|
171
|
-
if (
|
|
172
|
-
leftCalendarState.setFocusedDate(
|
|
173
|
-
rightCalendarState.setFocusedDate(
|
|
202
|
+
if (date_1.month !== currentVisibleMonth.month || date_1.year !== currentVisibleMonth.year) if (calendarSide === "left") {
|
|
203
|
+
leftCalendarState.setFocusedDate(date_1);
|
|
204
|
+
rightCalendarState.setFocusedDate(date_1.add({ months: 1 }));
|
|
174
205
|
} else {
|
|
175
|
-
rightCalendarState.setFocusedDate(
|
|
176
|
-
leftCalendarState.setFocusedDate(
|
|
206
|
+
rightCalendarState.setFocusedDate(date_1);
|
|
207
|
+
leftCalendarState.setFocusedDate(date_1.subtract({ months: 1 }));
|
|
177
208
|
}
|
|
178
209
|
}
|
|
179
210
|
if (!rangeSelection.isSelecting || !rangeSelection.start) {
|
|
180
211
|
setRangeSelection({
|
|
181
|
-
start:
|
|
212
|
+
start: date_1,
|
|
182
213
|
end: null,
|
|
183
214
|
isSelecting: true
|
|
184
215
|
});
|
|
@@ -187,7 +218,7 @@ var DateRangePickerBase = (props) => {
|
|
|
187
218
|
rightCalendarState.setValue(null);
|
|
188
219
|
} else {
|
|
189
220
|
const { start } = rangeSelection;
|
|
190
|
-
const end =
|
|
221
|
+
const end = date_1;
|
|
191
222
|
const finalStart = start.compare(end) <= 0 ? start : end;
|
|
192
223
|
const finalEnd = start.compare(end) <= 0 ? end : start;
|
|
193
224
|
const newRange = {
|
|
@@ -211,16 +242,16 @@ var DateRangePickerBase = (props) => {
|
|
|
211
242
|
rightCalendarState,
|
|
212
243
|
dialogState
|
|
213
244
|
]);
|
|
214
|
-
const handleKeyboardNavigation = useCallback((event,
|
|
215
|
-
const
|
|
216
|
-
const otherState =
|
|
245
|
+
const handleKeyboardNavigation = useCallback((event, date_2, calendarSide_0) => {
|
|
246
|
+
const currentState_0 = calendarSide_0 === "left" ? leftCalendarState : rightCalendarState;
|
|
247
|
+
const otherState = calendarSide_0 === "left" ? rightCalendarState : leftCalendarState;
|
|
217
248
|
let shouldPreventDefault = false;
|
|
218
249
|
switch (event.key) {
|
|
219
250
|
case "ArrowRight": {
|
|
220
|
-
const nextDate =
|
|
221
|
-
const
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
251
|
+
const nextDate = date_2.add({ days: 1 });
|
|
252
|
+
const currentMonth_2 = currentState_0.visibleRange.start;
|
|
253
|
+
const otherMonth_2 = otherState.visibleRange.start;
|
|
254
|
+
if (calendarSide_0 === "left" && nextDate.month !== currentMonth_2.month) if (nextDate.year === otherMonth_2.year && nextDate.month === otherMonth_2.month) {
|
|
224
255
|
otherState.setFocusedDate(nextDate);
|
|
225
256
|
shouldPreventDefault = true;
|
|
226
257
|
} else {
|
|
@@ -230,10 +261,10 @@ var DateRangePickerBase = (props) => {
|
|
|
230
261
|
break;
|
|
231
262
|
}
|
|
232
263
|
case "ArrowLeft": {
|
|
233
|
-
const prevDate =
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
264
|
+
const prevDate = date_2.subtract({ days: 1 });
|
|
265
|
+
const currentMonth_1 = currentState_0.visibleRange.start;
|
|
266
|
+
const otherMonth_1 = otherState.visibleRange.start;
|
|
267
|
+
if (calendarSide_0 === "right" && prevDate.month !== currentMonth_1.month) if (prevDate.year === otherMonth_1.year && prevDate.month === otherMonth_1.month) {
|
|
237
268
|
otherState.setFocusedDate(prevDate);
|
|
238
269
|
shouldPreventDefault = true;
|
|
239
270
|
} else {
|
|
@@ -243,10 +274,10 @@ var DateRangePickerBase = (props) => {
|
|
|
243
274
|
break;
|
|
244
275
|
}
|
|
245
276
|
case "ArrowDown": {
|
|
246
|
-
const nextWeekDate =
|
|
247
|
-
const
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
277
|
+
const nextWeekDate = date_2.add({ weeks: 1 });
|
|
278
|
+
const currentMonth_0 = currentState_0.visibleRange.start;
|
|
279
|
+
const otherMonth_0 = otherState.visibleRange.start;
|
|
280
|
+
if (calendarSide_0 === "left" && nextWeekDate.month !== currentMonth_0.month) if (nextWeekDate.year === otherMonth_0.year && nextWeekDate.month === otherMonth_0.month) {
|
|
250
281
|
otherState.setFocusedDate(nextWeekDate);
|
|
251
282
|
shouldPreventDefault = true;
|
|
252
283
|
} else {
|
|
@@ -256,10 +287,10 @@ var DateRangePickerBase = (props) => {
|
|
|
256
287
|
break;
|
|
257
288
|
}
|
|
258
289
|
case "ArrowUp": {
|
|
259
|
-
const prevWeekDate =
|
|
260
|
-
const currentMonth =
|
|
290
|
+
const prevWeekDate = date_2.subtract({ weeks: 1 });
|
|
291
|
+
const currentMonth = currentState_0.visibleRange.start;
|
|
261
292
|
const otherMonth = otherState.visibleRange.start;
|
|
262
|
-
if (
|
|
293
|
+
if (calendarSide_0 === "right" && prevWeekDate.month !== currentMonth.month) if (prevWeekDate.year === otherMonth.year && prevWeekDate.month === otherMonth.month) {
|
|
263
294
|
otherState.setFocusedDate(prevWeekDate);
|
|
264
295
|
shouldPreventDefault = true;
|
|
265
296
|
} else {
|
|
@@ -270,7 +301,7 @@ var DateRangePickerBase = (props) => {
|
|
|
270
301
|
}
|
|
271
302
|
case "Enter":
|
|
272
303
|
case " ":
|
|
273
|
-
handleDateSelection(
|
|
304
|
+
handleDateSelection(date_2);
|
|
274
305
|
shouldPreventDefault = true;
|
|
275
306
|
break;
|
|
276
307
|
case "Escape":
|
|
@@ -294,14 +325,14 @@ var DateRangePickerBase = (props) => {
|
|
|
294
325
|
rightCalendarState,
|
|
295
326
|
handleDateSelection
|
|
296
327
|
]);
|
|
297
|
-
const syncCalendarStates = useCallback((
|
|
298
|
-
if (isValidRange(
|
|
299
|
-
leftCalendarState.setValue(
|
|
300
|
-
rightCalendarState.setValue(
|
|
301
|
-
dialogState.setValue(
|
|
302
|
-
if (
|
|
303
|
-
start:
|
|
304
|
-
end:
|
|
328
|
+
const syncCalendarStates = useCallback((newValue_3) => {
|
|
329
|
+
if (isValidRange(newValue_3)) return;
|
|
330
|
+
leftCalendarState.setValue(newValue_3);
|
|
331
|
+
rightCalendarState.setValue(newValue_3);
|
|
332
|
+
dialogState.setValue(newValue_3);
|
|
333
|
+
if (newValue_3) setRangeSelection({
|
|
334
|
+
start: newValue_3.start,
|
|
335
|
+
end: newValue_3.end,
|
|
305
336
|
isSelecting: false
|
|
306
337
|
});
|
|
307
338
|
else setRangeSelection({
|
|
@@ -321,11 +352,14 @@ var DateRangePickerBase = (props) => {
|
|
|
321
352
|
start: rangeSelection.start,
|
|
322
353
|
end: rangeSelection.end
|
|
323
354
|
} : dialogState.value;
|
|
324
|
-
if (valueToApply)
|
|
355
|
+
if (valueToApply) {
|
|
356
|
+
state.setValue(valueToApply);
|
|
357
|
+
if (fireBlurOnChange) handleBlur(valueToApply);
|
|
358
|
+
}
|
|
325
359
|
state.toggle();
|
|
326
360
|
};
|
|
327
361
|
const onTodayPress = () => {
|
|
328
|
-
const todayDate = today(
|
|
362
|
+
const todayDate = today(DATE_PICKER_TIME_ZONE);
|
|
329
363
|
leftCalendarState.setFocusedDate(todayDate);
|
|
330
364
|
rightCalendarState.setFocusedDate(todayDate.add({ months: 1 }));
|
|
331
365
|
syncCalendarStates({
|
|
@@ -333,6 +367,9 @@ var DateRangePickerBase = (props) => {
|
|
|
333
367
|
end: todayDate
|
|
334
368
|
});
|
|
335
369
|
};
|
|
370
|
+
const onInputClear = () => {
|
|
371
|
+
onChange?.(null);
|
|
372
|
+
};
|
|
336
373
|
const onOpenChange = (isOpen) => {
|
|
337
374
|
state.toggle();
|
|
338
375
|
if (!isOpen) {
|
|
@@ -340,11 +377,11 @@ var DateRangePickerBase = (props) => {
|
|
|
340
377
|
dialogState.setValue(state.value);
|
|
341
378
|
leftCalendarState.setValue(state.value);
|
|
342
379
|
rightCalendarState.setValue(state.value);
|
|
343
|
-
const
|
|
344
|
-
const
|
|
345
|
-
leftCalendarState.setFocusedDate(
|
|
346
|
-
if (
|
|
347
|
-
else rightCalendarState.setFocusedDate(
|
|
380
|
+
const startDate_1 = state.value.start || today(DATE_PICKER_TIME_ZONE);
|
|
381
|
+
const endDate_1 = state.value.end || today(DATE_PICKER_TIME_ZONE).add({ months: 1 });
|
|
382
|
+
leftCalendarState.setFocusedDate(startDate_1);
|
|
383
|
+
if (startDate_1.year === endDate_1.year && startDate_1.month === endDate_1.month) rightCalendarState.setFocusedDate(startDate_1.add({ months: 1 }));
|
|
384
|
+
else rightCalendarState.setFocusedDate(endDate_1);
|
|
348
385
|
setRangeSelection({
|
|
349
386
|
start: state.value.start,
|
|
350
387
|
end: state.value.end,
|
|
@@ -353,87 +390,87 @@ var DateRangePickerBase = (props) => {
|
|
|
353
390
|
}
|
|
354
391
|
}
|
|
355
392
|
};
|
|
356
|
-
const
|
|
393
|
+
const todayDate_0 = today(DATE_PICKER_TIME_ZONE);
|
|
357
394
|
const getThisWeekRange = () => {
|
|
358
395
|
return {
|
|
359
|
-
start: startOfWeek(
|
|
360
|
-
end: endOfWeek(
|
|
396
|
+
start: startOfWeek(todayDate_0, locale),
|
|
397
|
+
end: endOfWeek(todayDate_0, locale)
|
|
361
398
|
};
|
|
362
399
|
};
|
|
363
400
|
const getLastWeekRange = () => {
|
|
364
|
-
const thisWeekStart = startOfWeek(
|
|
401
|
+
const thisWeekStart = startOfWeek(todayDate_0, locale);
|
|
365
402
|
return {
|
|
366
403
|
start: thisWeekStart.subtract({ weeks: 1 }),
|
|
367
404
|
end: thisWeekStart.subtract({ days: 1 })
|
|
368
405
|
};
|
|
369
406
|
};
|
|
370
407
|
const getThisAndLastWeekRange = () => {
|
|
371
|
-
const thisWeekEnd = endOfWeek(
|
|
408
|
+
const thisWeekEnd = endOfWeek(todayDate_0, locale);
|
|
372
409
|
return {
|
|
373
|
-
start: startOfWeek(
|
|
410
|
+
start: startOfWeek(todayDate_0, locale).subtract({ weeks: 1 }),
|
|
374
411
|
end: thisWeekEnd
|
|
375
412
|
};
|
|
376
413
|
};
|
|
377
414
|
const getThisMonthRange = () => {
|
|
378
415
|
return {
|
|
379
|
-
start: startOfMonth(
|
|
380
|
-
end: endOfMonth(
|
|
416
|
+
start: startOfMonth(todayDate_0),
|
|
417
|
+
end: endOfMonth(todayDate_0)
|
|
381
418
|
};
|
|
382
419
|
};
|
|
383
420
|
const getThisAndLastMonthRange = () => {
|
|
384
|
-
const thisMonthEnd = endOfMonth(
|
|
421
|
+
const thisMonthEnd = endOfMonth(todayDate_0);
|
|
385
422
|
return {
|
|
386
|
-
start: startOfMonth(
|
|
423
|
+
start: startOfMonth(todayDate_0).subtract({ months: 1 }),
|
|
387
424
|
end: thisMonthEnd
|
|
388
425
|
};
|
|
389
426
|
};
|
|
390
427
|
const presets = [
|
|
391
428
|
{
|
|
392
|
-
label: t(($) =>
|
|
429
|
+
label: t(($_0) => $_0.ui.datePicker.presets.thisWeek, { ns: "ui" }),
|
|
393
430
|
getValue: getThisWeekRange
|
|
394
431
|
},
|
|
395
432
|
{
|
|
396
|
-
label: t(($) =>
|
|
433
|
+
label: t(($_1) => $_1.ui.datePicker.presets.lastWeek, { ns: "ui" }),
|
|
397
434
|
getValue: getLastWeekRange
|
|
398
435
|
},
|
|
399
436
|
{
|
|
400
|
-
label: t(($) =>
|
|
437
|
+
label: t(($_2) => $_2.ui.datePicker.presets.thisAndLastWeek, { ns: "ui" }),
|
|
401
438
|
getValue: getThisAndLastWeekRange
|
|
402
439
|
},
|
|
403
440
|
{
|
|
404
|
-
label: t(($) =>
|
|
441
|
+
label: t(($_3) => $_3.ui.datePicker.presets.thisMonth, { ns: "ui" }),
|
|
405
442
|
getValue: getThisMonthRange
|
|
406
443
|
},
|
|
407
444
|
{
|
|
408
|
-
label: t(($) =>
|
|
445
|
+
label: t(($_4) => $_4.ui.datePicker.presets.thisAndLastMonth, { ns: "ui" }),
|
|
409
446
|
getValue: getThisAndLastMonthRange
|
|
410
447
|
},
|
|
411
448
|
{
|
|
412
|
-
label: t(($) =>
|
|
449
|
+
label: t(($_5) => $_5.ui.datePicker.presets.thisYear, { ns: "ui" }),
|
|
413
450
|
getValue: () => ({
|
|
414
|
-
start: startOfYear(
|
|
415
|
-
end:
|
|
451
|
+
start: startOfYear(todayDate_0),
|
|
452
|
+
end: todayDate_0
|
|
416
453
|
})
|
|
417
454
|
},
|
|
418
455
|
{
|
|
419
|
-
label: t(($) =>
|
|
456
|
+
label: t(($_6) => $_6.ui.datePicker.presets.lastYear, { ns: "ui" }),
|
|
420
457
|
getValue: () => ({
|
|
421
|
-
start: startOfYear(
|
|
422
|
-
end: endOfYear(
|
|
458
|
+
start: startOfYear(todayDate_0.subtract({ years: 1 })),
|
|
459
|
+
end: endOfYear(todayDate_0.subtract({ years: 1 }))
|
|
423
460
|
})
|
|
424
461
|
},
|
|
425
462
|
{
|
|
426
|
-
label: t(($) =>
|
|
463
|
+
label: t(($_7) => $_7.ui.datePicker.presets.thisAndLastYear, { ns: "ui" }),
|
|
427
464
|
getValue: () => ({
|
|
428
|
-
start: startOfYear(
|
|
429
|
-
end:
|
|
465
|
+
start: startOfYear(todayDate_0.subtract({ years: 1 })),
|
|
466
|
+
end: todayDate_0
|
|
430
467
|
})
|
|
431
468
|
},
|
|
432
469
|
{
|
|
433
|
-
label: t(($) =>
|
|
470
|
+
label: t(($_8) => $_8.ui.datePicker.presets.soFar, { ns: "ui" }),
|
|
434
471
|
getValue: () => ({
|
|
435
|
-
start: startOfYear(
|
|
436
|
-
end:
|
|
472
|
+
start: startOfYear(todayDate_0),
|
|
473
|
+
end: todayDate_0
|
|
437
474
|
})
|
|
438
475
|
}
|
|
439
476
|
];
|
|
@@ -441,12 +478,12 @@ var DateRangePickerBase = (props) => {
|
|
|
441
478
|
setActivePreset(preset.label);
|
|
442
479
|
const presetValue = preset.getValue();
|
|
443
480
|
syncCalendarStates(presetValue);
|
|
444
|
-
const
|
|
445
|
-
leftCalendarState.setFocusedDate(
|
|
446
|
-
const
|
|
447
|
-
if ((
|
|
481
|
+
const startDate_2 = presetValue.start;
|
|
482
|
+
leftCalendarState.setFocusedDate(startDate_2);
|
|
483
|
+
const endDate_2 = presetValue.end;
|
|
484
|
+
if ((endDate_2.year - startDate_2.year) * 12 + (endDate_2.month - startDate_2.month) > 2) rightCalendarState.setFocusedDate(endDate_2);
|
|
448
485
|
else {
|
|
449
|
-
const rightCalendarMonth =
|
|
486
|
+
const rightCalendarMonth = startDate_2.add({ months: 1 });
|
|
450
487
|
rightCalendarState.setFocusedDate(rightCalendarMonth);
|
|
451
488
|
}
|
|
452
489
|
};
|
|
@@ -458,14 +495,30 @@ var DateRangePickerBase = (props) => {
|
|
|
458
495
|
...formFieldProps,
|
|
459
496
|
as,
|
|
460
497
|
labelProps,
|
|
461
|
-
className: clsx("relative inline-flex w-full flex-col text-left", className),
|
|
498
|
+
className: clsx("group relative inline-flex w-full flex-col text-left", className),
|
|
462
499
|
tabIndex: as === "inline" ? -1 : void 0,
|
|
463
500
|
children: [/* @__PURE__ */ jsx(DatePickerInput, {
|
|
464
501
|
ref: mergeRefs(ref, datePickerInputRef),
|
|
465
502
|
as,
|
|
466
503
|
groupProps,
|
|
467
|
-
fieldProps:
|
|
468
|
-
|
|
504
|
+
fieldProps: {
|
|
505
|
+
...startFieldProps,
|
|
506
|
+
onBlur: (event_0) => {
|
|
507
|
+
startFieldProps.onBlur?.(event_0);
|
|
508
|
+
handleBlur(state.value);
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
endFieldProps: {
|
|
512
|
+
...endFieldProps,
|
|
513
|
+
onBlur: (event_1) => {
|
|
514
|
+
endFieldProps.onBlur?.(event_1);
|
|
515
|
+
handleBlur(state.value);
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
fieldValue: normalizedValue?.start ?? null,
|
|
519
|
+
endFieldValue: normalizedValue?.end ?? null,
|
|
520
|
+
isValueControlled: true,
|
|
521
|
+
hasValue: normalizedValue?.start != null || normalizedValue?.end != null,
|
|
469
522
|
buttonProps,
|
|
470
523
|
isDisabled,
|
|
471
524
|
isInvalid: !!error,
|
|
@@ -475,27 +528,33 @@ var DateRangePickerBase = (props) => {
|
|
|
475
528
|
isClearable,
|
|
476
529
|
headerProps,
|
|
477
530
|
todayIcon,
|
|
531
|
+
todayIconButtonSize,
|
|
532
|
+
todayIconButtonComponent,
|
|
533
|
+
todayIconPlacement,
|
|
478
534
|
isDirty,
|
|
479
535
|
disableManualEntry,
|
|
536
|
+
autoFixYear,
|
|
480
537
|
placeholder,
|
|
481
538
|
className: inputClassName,
|
|
482
539
|
onOpenDropdown: () => state.toggle(),
|
|
483
|
-
|
|
540
|
+
timeZone: DATE_PICKER_TIME_ZONE,
|
|
541
|
+
fireBlurOnChange,
|
|
542
|
+
onClear: onInputClear
|
|
484
543
|
}), /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
485
544
|
hideSidebar,
|
|
486
545
|
sidebar: /* @__PURE__ */ jsx("div", {
|
|
487
546
|
className: "flex w-full flex-row overflow-auto border-elevation-outline-default-1 border-solid [-ms-overflow-style:none] [scrollbar-width:none] md:w-[156px] md:flex-col md:border-r [&::-webkit-scrollbar]:hidden",
|
|
488
|
-
children: presets.map((
|
|
489
|
-
onClick: () => selectPreset(
|
|
490
|
-
className: clsx("w-full px-2 py-1 text-left md:px-list-side-item-left md:py-list-height-item", activePreset !==
|
|
547
|
+
children: presets.map((preset_0) => /* @__PURE__ */ jsx(Button, {
|
|
548
|
+
onClick: () => selectPreset(preset_0),
|
|
549
|
+
className: clsx("w-full px-2 py-1 text-left md:px-list-side-item-left md:py-list-height-item", activePreset !== preset_0.label && "text-interactive-text-secondary-idle hover:text-interactive-text-secondary-hover", activePreset === preset_0.label && "bg-interactive-contained-primary-idle text-interactive-text-secondary-idle-inverted"),
|
|
491
550
|
children: /* @__PURE__ */ jsx(Typography, {
|
|
492
551
|
size: "label-2",
|
|
493
552
|
sizeMobile: "label-3",
|
|
494
553
|
as: "span",
|
|
495
554
|
className: "whitespace-nowrap",
|
|
496
|
-
children:
|
|
555
|
+
children: preset_0.label
|
|
497
556
|
})
|
|
498
|
-
},
|
|
557
|
+
}, preset_0.label))
|
|
499
558
|
}),
|
|
500
559
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
501
560
|
isDisabled,
|
|
@@ -530,69 +589,299 @@ var DateRangePickerBase = (props) => {
|
|
|
530
589
|
})
|
|
531
590
|
});
|
|
532
591
|
};
|
|
533
|
-
var
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
592
|
+
var DateRangePickerInner = (t0) => {
|
|
593
|
+
const $ = c(25);
|
|
594
|
+
const { fullIso: t1, minValue, maxValue, renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
595
|
+
const fullIso = t1 === void 0 ? true : t1;
|
|
596
|
+
const ui = UIConfig.useConfig();
|
|
597
|
+
const datePickerInputContentRowCva = UIStyle.useCva("datePickerInput.contentRowCva", datePickerInputContentRow);
|
|
598
|
+
const { locale } = useLocale$1();
|
|
599
|
+
const shouldForceLeadingZeros = props.shouldForceLeadingZeros ?? ui.dateInput.shouldForceLeadingZeros;
|
|
600
|
+
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
601
|
+
const inputRef = useRef(null);
|
|
602
|
+
const { renderRealInput } = useStaticInputHandoff({
|
|
603
|
+
inputRef,
|
|
604
|
+
renderInput,
|
|
605
|
+
setRenderInput,
|
|
606
|
+
getFocusTarget: _temp
|
|
607
|
+
});
|
|
608
|
+
const normalizedValue = props.value ?? null;
|
|
609
|
+
let t2;
|
|
610
|
+
if ($[0] !== fullIso) {
|
|
611
|
+
t2 = (range) => {
|
|
612
|
+
if (!range?.start || !range?.end) return null;
|
|
613
|
+
if (fullIso) return {
|
|
614
|
+
start: DateTimeUtils.fromCalendarDateToUTCISO(range.start),
|
|
615
|
+
end: DateTimeUtils.fromCalendarDateToUTCISO(range.end, { endOfDay: true })
|
|
616
|
+
};
|
|
617
|
+
const startDate = DateTimeUtils.fromDateValueToLocal(range.start, "UTC");
|
|
618
|
+
const endDate = DateTimeUtils.fromDateValueToLocal(range.end, "UTC");
|
|
619
|
+
return {
|
|
620
|
+
start: DateTime.fromJSDate(startDate, { zone: "UTC" }).toISODate(),
|
|
621
|
+
end: DateTime.fromJSDate(endDate, { zone: "UTC" }).toISODate()
|
|
622
|
+
};
|
|
539
623
|
};
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
624
|
+
$[0] = fullIso;
|
|
625
|
+
$[1] = t2;
|
|
626
|
+
} else t2 = $[1];
|
|
627
|
+
const formatDateRange = t2;
|
|
628
|
+
let t3;
|
|
629
|
+
if ($[2] !== fullIso) {
|
|
630
|
+
t3 = (formattedRange) => {
|
|
631
|
+
if (!formattedRange?.start || !formattedRange?.end) return null;
|
|
632
|
+
if (fullIso) return {
|
|
633
|
+
start: DateTimeUtils.fromUTCISOToCalendarDate(formattedRange.start),
|
|
634
|
+
end: DateTimeUtils.fromUTCISOToCalendarDate(formattedRange.end)
|
|
635
|
+
};
|
|
636
|
+
const startDate_0 = DateTime.fromISO(formattedRange.start, { zone: "UTC" }).toJSDate();
|
|
637
|
+
const endDate_0 = DateTime.fromISO(formattedRange.end, { zone: "UTC" }).toJSDate();
|
|
638
|
+
const startZonedDateTime = DateTimeUtils.fromLocalToZonedDateTime(startDate_0, "UTC");
|
|
639
|
+
const endZonedDateTime = DateTimeUtils.fromLocalToZonedDateTime(endDate_0, "UTC");
|
|
640
|
+
return {
|
|
641
|
+
start: toCalendarDate(startZonedDateTime),
|
|
642
|
+
end: toCalendarDate(endZonedDateTime)
|
|
643
|
+
};
|
|
545
644
|
};
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
645
|
+
$[2] = fullIso;
|
|
646
|
+
$[3] = t3;
|
|
647
|
+
} else t3 = $[3];
|
|
648
|
+
const parseDateRange = t3;
|
|
649
|
+
let t4;
|
|
650
|
+
if ($[4] !== fullIso) {
|
|
651
|
+
t4 = (formattedDate) => {
|
|
652
|
+
if (formattedDate == null) return null;
|
|
653
|
+
if (fullIso) return DateTimeUtils.fromUTCISOToCalendarDate(formattedDate);
|
|
654
|
+
const date = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
|
|
655
|
+
return toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date, "UTC"));
|
|
552
656
|
};
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
657
|
+
$[4] = fullIso;
|
|
658
|
+
$[5] = t4;
|
|
659
|
+
} else t4 = $[5];
|
|
660
|
+
const parseCalendarDate = t4;
|
|
661
|
+
let t5;
|
|
662
|
+
if ($[6] !== minValue || $[7] !== parseCalendarDate) {
|
|
663
|
+
t5 = typeof minValue === "string" ? parseCalendarDate(minValue) : minValue;
|
|
664
|
+
$[6] = minValue;
|
|
665
|
+
$[7] = parseCalendarDate;
|
|
666
|
+
$[8] = t5;
|
|
667
|
+
} else t5 = $[8];
|
|
668
|
+
let t6;
|
|
669
|
+
if ($[9] !== maxValue || $[10] !== parseCalendarDate) {
|
|
670
|
+
t6 = typeof maxValue === "string" ? parseCalendarDate(maxValue) : maxValue;
|
|
671
|
+
$[9] = maxValue;
|
|
672
|
+
$[10] = parseCalendarDate;
|
|
673
|
+
$[11] = t6;
|
|
674
|
+
} else t6 = $[11];
|
|
675
|
+
let t7;
|
|
676
|
+
if ($[12] !== t5 || $[13] !== t6) {
|
|
677
|
+
t7 = {
|
|
678
|
+
minValue: t5,
|
|
679
|
+
maxValue: t6
|
|
560
680
|
};
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
681
|
+
$[12] = t5;
|
|
682
|
+
$[13] = t6;
|
|
683
|
+
$[14] = t7;
|
|
684
|
+
} else t7 = $[14];
|
|
685
|
+
const dateLimits = t7;
|
|
686
|
+
if (!renderInput) {
|
|
687
|
+
const startDateValue = parseCalendarDate(normalizedValue?.start ?? null);
|
|
688
|
+
const endDateValue = parseCalendarDate(normalizedValue?.end ?? null);
|
|
689
|
+
const hasProvidedRangeValue = !!(normalizedValue?.start || normalizedValue?.end);
|
|
690
|
+
const as = props.as ?? ui.input.as;
|
|
691
|
+
const size = props.size ?? ui.input.size;
|
|
692
|
+
const isDisabled = isFormControlDisabled || !!props.isDisabled;
|
|
693
|
+
const todayIcon = props.todayIcon ?? ui.dateInput.todayIcon;
|
|
694
|
+
const todayIconButtonSize = props.todayIconButtonSize ?? ui.dateInput.todayIconButtonSize;
|
|
695
|
+
const todayIconButtonComponent = props.todayIconButtonComponent ?? ui.dateInput.todayIconButtonComponent;
|
|
696
|
+
const todayIconPlacement = props.todayIconPlacement ?? ui.dateInput.todayIconPlacement;
|
|
697
|
+
const staticTodayIcon = renderDatePickerTodayIcon(todayIcon, {
|
|
698
|
+
isDisabled,
|
|
699
|
+
renderStatic: true,
|
|
700
|
+
size: todayIconButtonSize,
|
|
701
|
+
todayIconButtonComponent
|
|
702
|
+
});
|
|
703
|
+
const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
|
|
704
|
+
const showDropdown = !props.disableDropdown || disableManualEntry;
|
|
705
|
+
const staticSegments = getStaticDateRangeSegments({
|
|
706
|
+
start: startDateValue,
|
|
707
|
+
end: endDateValue,
|
|
708
|
+
locale,
|
|
709
|
+
shouldForceLeadingZeros,
|
|
710
|
+
isDisabled,
|
|
711
|
+
hidePlaceholder: as === "floating" && !hasProvidedRangeValue,
|
|
712
|
+
disableManualEntry,
|
|
713
|
+
placeholder: props.placeholder
|
|
714
|
+
});
|
|
715
|
+
return /* @__PURE__ */ jsx(InputFrame, {
|
|
716
|
+
...props,
|
|
717
|
+
isDisabled,
|
|
718
|
+
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
719
|
+
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
720
|
+
contentClassName: "pr-0!",
|
|
721
|
+
contentWrapperClassName: datePickerInputContentRowCva({ size }),
|
|
722
|
+
labelPlacement: "content-row",
|
|
723
|
+
dataAttributes: {
|
|
724
|
+
dataIsEmpty: !hasProvidedRangeValue,
|
|
725
|
+
dataIsFilled: hasProvidedRangeValue,
|
|
726
|
+
dataIsDirty: props.isDirty,
|
|
727
|
+
dataIsRequired: props.isRequired,
|
|
728
|
+
dataIsDisabled: isDisabled,
|
|
729
|
+
dataDisabled: isDisabled,
|
|
730
|
+
dataInvalid: !!props.error,
|
|
731
|
+
dataHasSelection: hasProvidedRangeValue
|
|
732
|
+
},
|
|
733
|
+
renderStatic: true,
|
|
734
|
+
onStaticInteract: renderRealInput,
|
|
735
|
+
actionContent: staticTodayIcon,
|
|
736
|
+
actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
|
|
737
|
+
showClear: hasProvidedRangeValue,
|
|
738
|
+
wrapContentAndTrailing: true,
|
|
739
|
+
contentAndTrailingClassName: "gap-2!",
|
|
740
|
+
trailingClassName: "py-0! pl-0!",
|
|
741
|
+
action: showDropdown ? {
|
|
742
|
+
icon: ui.dateInput.calendarIcon,
|
|
743
|
+
onClick: _temp2,
|
|
744
|
+
altText: ""
|
|
745
|
+
} : void 0,
|
|
746
|
+
children: staticSegments
|
|
588
747
|
});
|
|
589
748
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
749
|
+
const T0 = DateRangePickerBase;
|
|
750
|
+
const t8 = mergeRefs(props.ref, inputRef);
|
|
751
|
+
const t9 = parseDateRange(normalizedValue);
|
|
752
|
+
let t10;
|
|
753
|
+
if ($[15] !== formatDateRange || $[16] !== props) {
|
|
754
|
+
t10 = (value) => props.onChange?.(formatDateRange(value));
|
|
755
|
+
$[15] = formatDateRange;
|
|
756
|
+
$[16] = props;
|
|
757
|
+
$[17] = t10;
|
|
758
|
+
} else t10 = $[17];
|
|
759
|
+
let t11;
|
|
760
|
+
if ($[18] !== T0 || $[19] !== dateLimits || $[20] !== props || $[21] !== t10 || $[22] !== t8 || $[23] !== t9) {
|
|
761
|
+
t11 = /* @__PURE__ */ jsx(T0, {
|
|
762
|
+
...props,
|
|
763
|
+
...dateLimits,
|
|
764
|
+
ref: t8,
|
|
765
|
+
value: t9,
|
|
766
|
+
onChange: t10
|
|
767
|
+
});
|
|
768
|
+
$[18] = T0;
|
|
769
|
+
$[19] = dateLimits;
|
|
770
|
+
$[20] = props;
|
|
771
|
+
$[21] = t10;
|
|
772
|
+
$[22] = t8;
|
|
773
|
+
$[23] = t9;
|
|
774
|
+
$[24] = t11;
|
|
775
|
+
} else t11 = $[24];
|
|
776
|
+
return t11;
|
|
777
|
+
};
|
|
778
|
+
var DateRangePicker = (t0) => {
|
|
779
|
+
const $ = c(30);
|
|
780
|
+
let maxValue;
|
|
781
|
+
let minValue;
|
|
782
|
+
let props;
|
|
783
|
+
let renderStaticInput;
|
|
784
|
+
let t1;
|
|
785
|
+
if ($[0] !== t0) {
|
|
786
|
+
({fullIso: t1, minValue, maxValue, renderStaticInput, ...props} = t0);
|
|
787
|
+
$[0] = t0;
|
|
788
|
+
$[1] = maxValue;
|
|
789
|
+
$[2] = minValue;
|
|
790
|
+
$[3] = props;
|
|
791
|
+
$[4] = renderStaticInput;
|
|
792
|
+
$[5] = t1;
|
|
793
|
+
} else {
|
|
794
|
+
maxValue = $[1];
|
|
795
|
+
minValue = $[2];
|
|
796
|
+
props = $[3];
|
|
797
|
+
renderStaticInput = $[4];
|
|
798
|
+
t1 = $[5];
|
|
799
|
+
}
|
|
800
|
+
const fullIso = t1 === void 0 ? true : t1;
|
|
801
|
+
if ("formControl" in props && props.formControl) {
|
|
802
|
+
let formControl;
|
|
803
|
+
let innerProps;
|
|
804
|
+
let ref;
|
|
805
|
+
if ($[6] !== props) {
|
|
806
|
+
({formControl, ref, ...innerProps} = props);
|
|
807
|
+
$[6] = props;
|
|
808
|
+
$[7] = formControl;
|
|
809
|
+
$[8] = innerProps;
|
|
810
|
+
$[9] = ref;
|
|
811
|
+
} else {
|
|
812
|
+
formControl = $[7];
|
|
813
|
+
innerProps = $[8];
|
|
814
|
+
ref = $[9];
|
|
815
|
+
}
|
|
816
|
+
const controlWithOptions = formControl.control;
|
|
817
|
+
let t2;
|
|
818
|
+
if ($[10] !== controlWithOptions._options?.disabled || $[11] !== fullIso || $[12] !== innerProps || $[13] !== maxValue || $[14] !== minValue || $[15] !== props.error || $[16] !== props.isDisabled || $[17] !== ref || $[18] !== renderStaticInput) {
|
|
819
|
+
t2 = (t3) => {
|
|
820
|
+
const { field, fieldState: t4 } = t3;
|
|
821
|
+
const { error, isDirty } = t4;
|
|
822
|
+
return /* @__PURE__ */ jsx(DateRangePickerInner, {
|
|
823
|
+
...innerProps,
|
|
824
|
+
ref: mergeRefs(ref, field.ref),
|
|
825
|
+
value: field.value ?? null,
|
|
826
|
+
onChange: field.onChange,
|
|
827
|
+
onBlur: field.onBlur,
|
|
828
|
+
isDirty,
|
|
829
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
830
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
831
|
+
error: props.error ?? error?.message,
|
|
832
|
+
fullIso,
|
|
833
|
+
minValue,
|
|
834
|
+
maxValue,
|
|
835
|
+
renderStaticInput
|
|
836
|
+
});
|
|
837
|
+
};
|
|
838
|
+
$[10] = controlWithOptions._options?.disabled;
|
|
839
|
+
$[11] = fullIso;
|
|
840
|
+
$[12] = innerProps;
|
|
841
|
+
$[13] = maxValue;
|
|
842
|
+
$[14] = minValue;
|
|
843
|
+
$[15] = props.error;
|
|
844
|
+
$[16] = props.isDisabled;
|
|
845
|
+
$[17] = ref;
|
|
846
|
+
$[18] = renderStaticInput;
|
|
847
|
+
$[19] = t2;
|
|
848
|
+
} else t2 = $[19];
|
|
849
|
+
let t3;
|
|
850
|
+
if ($[20] !== formControl.control || $[21] !== formControl.name || $[22] !== t2) {
|
|
851
|
+
t3 = /* @__PURE__ */ jsx(Controller, {
|
|
852
|
+
control: formControl.control,
|
|
853
|
+
name: formControl.name,
|
|
854
|
+
render: t2
|
|
855
|
+
});
|
|
856
|
+
$[20] = formControl.control;
|
|
857
|
+
$[21] = formControl.name;
|
|
858
|
+
$[22] = t2;
|
|
859
|
+
$[23] = t3;
|
|
860
|
+
} else t3 = $[23];
|
|
861
|
+
return t3;
|
|
862
|
+
}
|
|
863
|
+
let t2;
|
|
864
|
+
if ($[24] !== fullIso || $[25] !== maxValue || $[26] !== minValue || $[27] !== props || $[28] !== renderStaticInput) {
|
|
865
|
+
t2 = /* @__PURE__ */ jsx(DateRangePickerInner, {
|
|
866
|
+
...props,
|
|
867
|
+
fullIso,
|
|
868
|
+
minValue,
|
|
869
|
+
maxValue,
|
|
870
|
+
renderStaticInput
|
|
871
|
+
});
|
|
872
|
+
$[24] = fullIso;
|
|
873
|
+
$[25] = maxValue;
|
|
874
|
+
$[26] = minValue;
|
|
875
|
+
$[27] = props;
|
|
876
|
+
$[28] = renderStaticInput;
|
|
877
|
+
$[29] = t2;
|
|
878
|
+
} else t2 = $[29];
|
|
879
|
+
return t2;
|
|
596
880
|
};
|
|
881
|
+
function _temp(input) {
|
|
882
|
+
const container = input.getContainer?.() ?? input;
|
|
883
|
+
return container instanceof HTMLElement ? container.querySelector("input, button, [tabindex]:not([tabindex='-1'])") : null;
|
|
884
|
+
}
|
|
885
|
+
function _temp2() {}
|
|
597
886
|
//#endregion
|
|
598
887
|
export { DateRangePicker };
|