@povio/ui 2.3.2-rc.3 → 2.3.3
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 +11 -26
- package/dist/assets/icons/AlignLeft.js +11 -26
- package/dist/assets/icons/AlignLeftRight.js +11 -26
- package/dist/assets/icons/AlignRight.js +11 -26
- package/dist/assets/icons/ArrowDropDown.js +11 -26
- package/dist/assets/icons/ArrowDropUp.js +11 -26
- package/dist/assets/icons/ArrowLeft.js +11 -26
- package/dist/assets/icons/ArrowRight.js +11 -26
- package/dist/assets/icons/Bold.js +11 -26
- package/dist/assets/icons/BulletedList.js +11 -26
- package/dist/assets/icons/Calendar.js +13 -28
- package/dist/assets/icons/Check.js +13 -28
- package/dist/assets/icons/CheckCircle.js +11 -26
- package/dist/assets/icons/CheckboxCheckmark.js +14 -29
- package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
- package/dist/assets/icons/ChevronDown.js +13 -28
- package/dist/assets/icons/ChevronLeft.js +13 -28
- package/dist/assets/icons/ChevronRight.js +13 -28
- package/dist/assets/icons/ChevronUp.js +13 -28
- package/dist/assets/icons/ChevronsLeft.js +13 -28
- package/dist/assets/icons/ChevronsRight.js +13 -28
- package/dist/assets/icons/Clock.js +11 -26
- package/dist/assets/icons/Close.js +11 -26
- package/dist/assets/icons/DateTime.js +14 -35
- package/dist/assets/icons/DragIndicator.js +11 -26
- package/dist/assets/icons/File.js +13 -28
- package/dist/assets/icons/Highlight.js +11 -26
- package/dist/assets/icons/HighlightOn.js +15 -49
- package/dist/assets/icons/Home.js +11 -26
- package/dist/assets/icons/Info.js +16 -37
- package/dist/assets/icons/Italic.js +11 -26
- package/dist/assets/icons/Link.js +11 -26
- package/dist/assets/icons/Menu.js +11 -26
- package/dist/assets/icons/NumberedList.js +11 -26
- package/dist/assets/icons/PointerHorizontal.js +11 -26
- package/dist/assets/icons/PointerVertical.js +11 -26
- package/dist/assets/icons/Search.js +11 -26
- package/dist/assets/icons/Send.js +13 -28
- package/dist/assets/icons/Strikethrough.js +11 -26
- package/dist/assets/icons/TextColor.js +14 -48
- package/dist/assets/icons/Today.js +11 -26
- package/dist/assets/icons/Underlined.js +13 -28
- package/dist/assets/icons/Upload.js +14 -35
- package/dist/assets/icons/Visibility.js +11 -26
- package/dist/assets/icons/VisibilityOff.js +11 -26
- package/dist/assets/icons/WarningFilled.js +13 -28
- package/dist/assets/locales/sl/translation.json.js +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
- package/dist/components/Menu/Menu.js +2 -18
- package/dist/components/Menu/MenuDesktop.js +7 -41
- package/dist/components/Menu/MenuItem.js +9 -32
- package/dist/components/Menu/MenuMobile.js +38 -97
- package/dist/components/Menu/MenuPopover.js +29 -105
- package/dist/components/buttons/IconButton/IconButton.js +8 -40
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/PillButton/PillButton.js +17 -55
- package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
- package/dist/components/buttons/TextButton/TextButton.js +8 -30
- package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +0 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +35 -201
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
- package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -12
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +75 -368
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -12
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +298 -506
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -13
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +56 -273
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -6
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +130 -606
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +119 -332
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -3
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -301
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -3
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -146
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -311
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -13
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +139 -383
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -96
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
- package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -4
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -210
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/File/FileUpload.js +44 -87
- package/dist/components/inputs/File/FileUploadContainer.js +7 -15
- package/dist/components/inputs/File/InputUpload.js +79 -317
- package/dist/components/inputs/File/shared/FileCard.js +41 -104
- package/dist/components/inputs/File/shared/FileCardList.js +12 -47
- package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
- package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
- package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
- package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
- package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +37 -119
- package/dist/components/inputs/FormField/FormFieldError.js +5 -25
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +97 -447
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
- package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
- package/dist/components/inputs/Input/TextInput/TextInput.js +90 -419
- package/dist/components/inputs/Input/shared/InputContent.js +59 -192
- package/dist/components/inputs/Inputs/Form.js +11 -40
- package/dist/components/inputs/Inputs/InputItem.d.ts +21 -15
- package/dist/components/inputs/Inputs/InputItem.js +14 -69
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.js +61 -353
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +22 -214
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -104
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +18 -225
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
- package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +116 -330
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/select.context.js +36 -67
- package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
- package/dist/components/inputs/Slider/Slider.d.ts +1 -2
- package/dist/components/inputs/Slider/Slider.js +76 -265
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
- package/dist/components/inputs/Toggle/Toggle.d.ts +0 -1
- package/dist/components/inputs/Toggle/Toggle.js +37 -214
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
- package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
- package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.d.ts +1 -2
- package/dist/components/inputs/shared/InputClear.js +12 -88
- package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
- package/dist/components/inputs/shared/input.cva.d.ts +0 -10
- package/dist/components/inputs/shared/input.cva.js +4 -32
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/navigation/Stepper/StepperItem.js +31 -104
- package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/BottomSheet/BottomSheet.js +23 -96
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +20 -62
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
- package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
- package/dist/components/segment/Segment.js +57 -218
- package/dist/components/segment/SegmentItem.js +10 -67
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/shared/pagination/PaginationList.js +64 -167
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/status/Loader/Loader.js +22 -77
- package/dist/components/status/Toast/Toast.js +13 -21
- package/dist/components/status/Toast/useToast.js +57 -62
- package/dist/components/table/ColumnConfig.js +54 -158
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/PaginatedTable.js +18 -84
- package/dist/components/table/Table.js +27 -28
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +9 -23
- package/dist/config/router.context.js +16 -42
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +6 -19
- package/dist/config/uiConfig.context.js +14 -67
- package/dist/config/uiStyle.context.d.ts +4 -27
- package/dist/config/uiStyle.context.js +5 -15
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useBreakpoint.js +3 -16
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFilters.js +64 -125
- package/dist/hooks/useForm.js +8 -42
- package/dist/hooks/useFormAutosave.js +30 -101
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +24 -91
- package/dist/hooks/useLocalStorage.js +10 -43
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/hooks/usePagination.js +19 -49
- package/dist/hooks/useScrollableListBox.js +16 -37
- package/dist/hooks/useSorting.js +28 -69
- package/dist/hooks/useStateAndRef.js +7 -21
- package/dist/hooks/useTableColumnConfig.js +31 -124
- package/dist/hooks/useTranslationMemo.js +5 -25
- package/dist/index.d.ts +0 -7
- package/dist/index.js +2 -4
- package/dist/tw-ui-plugin.js +0 -6
- package/dist/utils/date-time.utils.d.ts +10 -38
- package/dist/utils/date-time.utils.js +22 -134
- package/package.json +1 -1
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -5
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -32
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -39
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -85
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -575
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -173
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -12
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -36
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -82
- package/dist/components/inputs/Skeleton/InputFrame.js +0 -548
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
- package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -57
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -1,40 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ref } from 'react';
|
|
2
2
|
import { DateValue } from 'react-aria';
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
4
|
import { DatePickerStateOptions } from 'react-stately';
|
|
5
5
|
import { DatePickerInputHandle } from '../shared/DatePickerInput';
|
|
6
|
-
import { DatePickerTodayIcon, DatePickerTodayIconButtonComponent, DatePickerTodayIconButtonSize, DatePickerTodayIconPlacement } from '../shared/datePicker.types';
|
|
7
6
|
import { FormFieldProps } from '../../FormField/FormField';
|
|
8
7
|
import { ControlProps } from '../../shared/form.types';
|
|
9
8
|
import { InputVariantProps } from '../../shared/input.cva';
|
|
10
|
-
interface DateTimePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<DatePickerStateOptions<DateValue>, "granularity" | "shouldCloseOnSelect" | "label"
|
|
9
|
+
interface DateTimePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<DatePickerStateOptions<DateValue>, "granularity" | "shouldCloseOnSelect" | "label"> {
|
|
11
10
|
ref?: Ref<DatePickerInputHandle & HTMLDivElement>;
|
|
12
11
|
disableDropdown?: boolean;
|
|
13
12
|
isTimeOptional?: boolean;
|
|
14
13
|
isClearable?: boolean;
|
|
15
|
-
todayIcon?:
|
|
16
|
-
todayIconButtonSize?: DatePickerTodayIconButtonSize;
|
|
17
|
-
todayIconButtonComponent?: DatePickerTodayIconButtonComponent;
|
|
18
|
-
todayIconPlacement?: DatePickerTodayIconPlacement;
|
|
14
|
+
todayIcon?: boolean;
|
|
19
15
|
isDirty?: boolean;
|
|
20
16
|
disableManualEntry?: boolean;
|
|
21
|
-
autoFixYear?: boolean;
|
|
22
|
-
setDateValueOnDateSelection?: boolean;
|
|
23
17
|
placeholder?: string;
|
|
24
18
|
inputClassName?: string;
|
|
25
19
|
shouldUpdateDateOnMonthYearChange?: boolean;
|
|
26
20
|
timeZone?: string;
|
|
21
|
+
autoFixYear?: boolean;
|
|
27
22
|
format?: string;
|
|
28
|
-
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
29
|
-
fireBlurOnChange?: boolean;
|
|
30
23
|
}
|
|
31
24
|
export interface DateTimePickerProps extends Omit<DateTimePickerBaseProps, "value" | "onChange"> {
|
|
32
25
|
value?: string | null;
|
|
33
26
|
onChange?: (value: string | null) => void;
|
|
34
27
|
fullIso?: boolean;
|
|
35
|
-
renderStaticInput?: boolean;
|
|
36
28
|
timeZone?: string;
|
|
37
29
|
}
|
|
38
30
|
export type ControlledDateTimePickerProps<TFieldValues extends FieldValues> = ControlProps<DateTimePickerProps, TFieldValues>;
|
|
39
|
-
export declare const DateTimePicker: <TFieldValues extends FieldValues>({ fullIso,
|
|
31
|
+
export declare const DateTimePicker: <TFieldValues extends FieldValues>({ fullIso, ...props }: ControlledDateTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
40
32
|
export {};
|
|
@@ -1,47 +1,24 @@
|
|
|
1
|
-
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
2
1
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
2
|
import { Calendar } from "../shared/Calendar.js";
|
|
4
3
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
5
|
-
import { datePickerInputContentRow } from "../shared/datePickerInput.cva.js";
|
|
6
|
-
import { renderDatePickerTodayIcon } from "../shared/datePickerTodayIcon.js";
|
|
7
4
|
import { DatePickerInput } from "../shared/DatePickerInput.js";
|
|
8
5
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
9
6
|
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
10
|
-
import { getStaticCalendarDateTimeSegments } from "../shared/staticDateTimeSegments.js";
|
|
11
7
|
import { FormField } from "../../FormField/FormField.js";
|
|
12
8
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
13
|
-
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
14
|
-
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
15
|
-
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
16
|
-
import { c } from "react/compiler-runtime";
|
|
17
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
-
import {
|
|
19
|
-
import { useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
10
|
+
import { useEffect, useImperativeHandle, useMemo, useRef } from "react";
|
|
20
11
|
import { useDatePicker, useLocale } from "react-aria";
|
|
21
12
|
import { mergeRefs } from "@react-aria/utils";
|
|
22
13
|
import { Controller } from "react-hook-form";
|
|
23
|
-
import { Time, createCalendar,
|
|
14
|
+
import { Time, createCalendar, getLocalTimeZone, now, toCalendarDateTime, today } from "@internationalized/date";
|
|
24
15
|
import { useCalendarState, useDatePickerState } from "react-stately";
|
|
25
16
|
//#region src/components/inputs/DateTime/DateTimePicker/DateTimePicker.tsx
|
|
26
17
|
var DateTimePickerBase = (props) => {
|
|
27
18
|
const ui = UIConfig.useConfig();
|
|
28
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const as = asProp ?? ui.input.as;
|
|
32
|
-
const size = sizeProp ?? ui.input.size;
|
|
33
|
-
const isClearable = isClearableProp ?? ui.input.isClearable;
|
|
34
|
-
const todayIcon = todayIconProp ?? ui.dateInput.todayIcon;
|
|
35
|
-
const todayIconButtonSize = todayIconButtonSizeProp ?? ui.dateInput.todayIconButtonSize;
|
|
36
|
-
const todayIconButtonComponent = todayIconButtonComponentProp ?? ui.dateInput.todayIconButtonComponent;
|
|
37
|
-
const todayIconPlacement = todayIconPlacementProp ?? ui.dateInput.todayIconPlacement;
|
|
38
|
-
const shouldForceLeadingZeros = shouldForceLeadingZerosProp ?? ui.dateInput.shouldForceLeadingZeros;
|
|
39
|
-
const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
|
|
40
|
-
const shouldUpdateDateOnMonthYearChange = shouldUpdateDateOnMonthYearChangeProp ?? ui.dateInput.shouldUpdateDateOnMonthYearChange;
|
|
41
|
-
const autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
|
|
42
|
-
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
|
|
43
|
-
const setDateValueOnDateSelection = setDateValueOnDateSelectionProp ?? ui.dateInput.setDateValueOnDateSelection;
|
|
44
|
-
const effectiveTimeZone = "UTC";
|
|
19
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, isTimeOptional, placeholder, inputClassName, hideLabel = ui.input.hideLabel, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, shouldUpdateDateOnMonthYearChange = ui.dateInput.shouldUpdateDateOnMonthYearChange, timeZone, autoFixYear = ui.dateInput.autoFixYear, format, ...rest } = props;
|
|
20
|
+
let effectiveTimeZone = getLocalTimeZone();
|
|
21
|
+
if (timeZone) effectiveTimeZone = timeZone;
|
|
45
22
|
const formFieldProps = {
|
|
46
23
|
error,
|
|
47
24
|
label,
|
|
@@ -59,20 +36,12 @@ var DateTimePickerBase = (props) => {
|
|
|
59
36
|
const datePickerRef = useMemo(() => ({ get current() {
|
|
60
37
|
return datePickerInputRef.current?.getContainer?.() || null;
|
|
61
38
|
} }), []);
|
|
62
|
-
useImperativeHandle(ref, () => ({
|
|
63
|
-
clear
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
getContainer: () => datePickerInputRef.current?.getContainer?.() ?? null
|
|
67
|
-
}));
|
|
68
|
-
const handleBlur = (val) => {
|
|
69
|
-
onBlur?.({ target: { value: val } });
|
|
70
|
-
};
|
|
71
|
-
const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
|
|
72
|
-
const normalizedValue = value ?? null;
|
|
39
|
+
useImperativeHandle(ref, () => ({ clear: () => {
|
|
40
|
+
datePickerInputRef.current?.clear();
|
|
41
|
+
} }));
|
|
73
42
|
const dialogState = useDatePickerState({
|
|
74
43
|
...rest,
|
|
75
|
-
defaultValue:
|
|
44
|
+
defaultValue: value || rest.defaultValue,
|
|
76
45
|
shouldCloseOnSelect: false,
|
|
77
46
|
granularity: "minute",
|
|
78
47
|
hideTimeZone: true,
|
|
@@ -84,12 +53,11 @@ var DateTimePickerBase = (props) => {
|
|
|
84
53
|
const state = useDatePickerState({
|
|
85
54
|
...rest,
|
|
86
55
|
shouldForceLeadingZeros,
|
|
87
|
-
value
|
|
88
|
-
onChange: (
|
|
89
|
-
onChange?.(
|
|
90
|
-
dialogState.setValue(
|
|
91
|
-
calendarState.setFocusedDate(
|
|
92
|
-
if (fireBlurOnChange) debouncedBlur(val_0);
|
|
56
|
+
value,
|
|
57
|
+
onChange: (val) => {
|
|
58
|
+
onChange?.(val);
|
|
59
|
+
dialogState.setValue(val);
|
|
60
|
+
calendarState.setFocusedDate(val || today(effectiveTimeZone));
|
|
93
61
|
},
|
|
94
62
|
shouldCloseOnSelect: false,
|
|
95
63
|
granularity: "minute",
|
|
@@ -125,10 +93,8 @@ var DateTimePickerBase = (props) => {
|
|
|
125
93
|
labelProps
|
|
126
94
|
};
|
|
127
95
|
const onApply = () => {
|
|
128
|
-
|
|
129
|
-
state.setValue(newValue);
|
|
96
|
+
state.setValue(dialogState.value);
|
|
130
97
|
state.toggle();
|
|
131
|
-
if (fireBlurOnChange) handleBlur(newValue);
|
|
132
98
|
};
|
|
133
99
|
const onMonthYearChange = (selectedDate) => {
|
|
134
100
|
if (!shouldUpdateDateOnMonthYearChange) return;
|
|
@@ -146,9 +112,8 @@ var DateTimePickerBase = (props) => {
|
|
|
146
112
|
calendarState.setFocusedDate(selectedDate);
|
|
147
113
|
};
|
|
148
114
|
const onTodayPress = () => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
calendarState.setFocusedDate(toCalendarDate(currentValue));
|
|
115
|
+
dialogState.setValue(toCalendarDateTime(now(effectiveTimeZone)));
|
|
116
|
+
calendarState.setFocusedDate(today(effectiveTimeZone));
|
|
152
117
|
};
|
|
153
118
|
const onOpenChange = (isOpen) => {
|
|
154
119
|
state.toggle();
|
|
@@ -161,7 +126,7 @@ var DateTimePickerBase = (props) => {
|
|
|
161
126
|
dialogState.setValue(state.value);
|
|
162
127
|
return;
|
|
163
128
|
}
|
|
164
|
-
const textValue = e
|
|
129
|
+
const textValue = e.currentTarget.textContent;
|
|
165
130
|
const dateTimeValue = DateTimeUtils.formatTextDateToCalendarDateTime(textValue, effectiveTimeZone, locale);
|
|
166
131
|
if (dateTimeValue) {
|
|
167
132
|
state.setValue(dateTimeValue);
|
|
@@ -185,15 +150,11 @@ var DateTimePickerBase = (props) => {
|
|
|
185
150
|
groupProps,
|
|
186
151
|
fieldProps: {
|
|
187
152
|
...fieldProps,
|
|
188
|
-
onBlur: (
|
|
189
|
-
fieldProps.onBlur?.(
|
|
190
|
-
|
|
191
|
-
onInputBlur(e_0);
|
|
153
|
+
onBlur: (e) => {
|
|
154
|
+
fieldProps.onBlur?.(e);
|
|
155
|
+
onInputBlur(e);
|
|
192
156
|
}
|
|
193
157
|
},
|
|
194
|
-
fieldValue: normalizedValue,
|
|
195
|
-
isValueControlled: true,
|
|
196
|
-
hasValue: normalizedValue != null,
|
|
197
158
|
buttonProps,
|
|
198
159
|
isDirty,
|
|
199
160
|
isDisabled,
|
|
@@ -205,19 +166,15 @@ var DateTimePickerBase = (props) => {
|
|
|
205
166
|
isClearable,
|
|
206
167
|
headerProps,
|
|
207
168
|
todayIcon,
|
|
208
|
-
todayIconButtonSize,
|
|
209
|
-
todayIconButtonComponent,
|
|
210
|
-
todayIconPlacement,
|
|
211
169
|
isRequired,
|
|
212
170
|
disableManualEntry,
|
|
213
|
-
autoFixYear,
|
|
214
171
|
placeholder,
|
|
215
172
|
onOpenDropdown: () => state.toggle(),
|
|
216
173
|
className: inputClassName,
|
|
217
174
|
timeZone: effectiveTimeZone,
|
|
175
|
+
autoFixYear,
|
|
218
176
|
isTimeOptional,
|
|
219
|
-
format
|
|
220
|
-
fireBlurOnChange
|
|
177
|
+
format
|
|
221
178
|
}), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
222
179
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
223
180
|
isDisabled,
|
|
@@ -237,220 +194,46 @@ var DateTimePickerBase = (props) => {
|
|
|
237
194
|
datePickerState: dialogState,
|
|
238
195
|
onApply,
|
|
239
196
|
onMonthYearChange,
|
|
240
|
-
granularity: "day"
|
|
241
|
-
setDateValueOnDateSelection
|
|
197
|
+
granularity: "day"
|
|
242
198
|
})
|
|
243
199
|
})]
|
|
244
200
|
})
|
|
245
201
|
});
|
|
246
202
|
};
|
|
247
|
-
var
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
setRenderInput,
|
|
260
|
-
getFocusTarget: _temp
|
|
261
|
-
});
|
|
262
|
-
const normalizedValue = props.value ?? null;
|
|
263
|
-
const formatDateValue = _temp2;
|
|
264
|
-
const parseDateValue = _temp3;
|
|
265
|
-
if (!renderInput) {
|
|
266
|
-
const dateTimeValue = normalizedValue ? parseDateValue(normalizedValue) : null;
|
|
267
|
-
const as = props.as ?? ui.input.as;
|
|
268
|
-
const size = props.size ?? ui.input.size;
|
|
269
|
-
const isDisabled = isFormControlDisabled || !!props.isDisabled;
|
|
270
|
-
const todayIcon = props.todayIcon ?? ui.dateInput.todayIcon;
|
|
271
|
-
const todayIconButtonSize = props.todayIconButtonSize ?? ui.dateInput.todayIconButtonSize;
|
|
272
|
-
const todayIconButtonComponent = props.todayIconButtonComponent ?? ui.dateInput.todayIconButtonComponent;
|
|
273
|
-
const todayIconPlacement = props.todayIconPlacement ?? ui.dateInput.todayIconPlacement;
|
|
274
|
-
const staticTodayIcon = renderDatePickerTodayIcon(todayIcon, {
|
|
275
|
-
isDisabled,
|
|
276
|
-
renderStatic: true,
|
|
277
|
-
size: todayIconButtonSize,
|
|
278
|
-
todayIconButtonComponent
|
|
279
|
-
});
|
|
280
|
-
const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
|
|
281
|
-
const showDropdown = !props.disableDropdown || disableManualEntry;
|
|
282
|
-
const staticSegments = getStaticCalendarDateTimeSegments({
|
|
283
|
-
value: dateTimeValue,
|
|
284
|
-
locale,
|
|
285
|
-
shouldForceLeadingZeros,
|
|
286
|
-
isDisabled,
|
|
287
|
-
hidePlaceholder: as === "floating" && !dateTimeValue,
|
|
288
|
-
disableManualEntry,
|
|
289
|
-
placeholder: props.placeholder
|
|
290
|
-
});
|
|
291
|
-
return /* @__PURE__ */ jsx(InputFrame, {
|
|
292
|
-
...props,
|
|
293
|
-
isDisabled,
|
|
294
|
-
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
295
|
-
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
296
|
-
contentClassName: "pr-0!",
|
|
297
|
-
contentWrapperClassName: datePickerInputContentRowCva({ size }),
|
|
298
|
-
contentGroup: "date-picker",
|
|
299
|
-
labelPlacement: "content-row",
|
|
300
|
-
dataAttributes: {
|
|
301
|
-
dataIsEmpty: dateTimeValue == null,
|
|
302
|
-
dataIsFilled: dateTimeValue != null,
|
|
303
|
-
dataIsDirty: props.isDirty,
|
|
304
|
-
dataIsRequired: props.isRequired,
|
|
305
|
-
dataIsDisabled: isDisabled,
|
|
306
|
-
dataDisabled: isDisabled,
|
|
307
|
-
dataInvalid: !!props.error,
|
|
308
|
-
dataHasSelection: dateTimeValue != null
|
|
309
|
-
},
|
|
310
|
-
renderStatic: true,
|
|
311
|
-
onStaticInteract: renderRealInput,
|
|
312
|
-
actionContent: staticTodayIcon,
|
|
313
|
-
actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
|
|
314
|
-
showClear: dateTimeValue != null,
|
|
315
|
-
wrapContentAndTrailing: true,
|
|
316
|
-
contentAndTrailingClassName: "gap-2!",
|
|
317
|
-
trailingClassName: "py-0! pl-0!",
|
|
318
|
-
action: showDropdown ? {
|
|
319
|
-
icon: ui.dateInput.dateTimeIcon,
|
|
320
|
-
onClick: _temp4,
|
|
321
|
-
altText: ""
|
|
322
|
-
} : void 0,
|
|
323
|
-
children: staticSegments
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
const T0 = DateTimePickerBase;
|
|
327
|
-
const t2 = mergeRefs(props.ref, inputRef);
|
|
328
|
-
const t3 = parseDateValue(normalizedValue);
|
|
329
|
-
let t4;
|
|
330
|
-
if ($[0] !== formatDateValue || $[1] !== props) {
|
|
331
|
-
t4 = (value) => props.onChange?.(formatDateValue(value));
|
|
332
|
-
$[0] = formatDateValue;
|
|
333
|
-
$[1] = props;
|
|
334
|
-
$[2] = t4;
|
|
335
|
-
} else t4 = $[2];
|
|
336
|
-
let t5;
|
|
337
|
-
if ($[3] !== T0 || $[4] !== props || $[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
|
|
338
|
-
t5 = /* @__PURE__ */ jsx(T0, {
|
|
339
|
-
...props,
|
|
340
|
-
ref: t2,
|
|
341
|
-
value: t3,
|
|
342
|
-
onChange: t4
|
|
343
|
-
});
|
|
344
|
-
$[3] = T0;
|
|
345
|
-
$[4] = props;
|
|
346
|
-
$[5] = t2;
|
|
347
|
-
$[6] = t3;
|
|
348
|
-
$[7] = t4;
|
|
349
|
-
$[8] = t5;
|
|
350
|
-
} else t5 = $[8];
|
|
351
|
-
return t5;
|
|
352
|
-
};
|
|
353
|
-
var DateTimePicker = (t0) => {
|
|
354
|
-
const $ = c(24);
|
|
355
|
-
let props;
|
|
356
|
-
let renderStaticInput;
|
|
357
|
-
let t1;
|
|
358
|
-
if ($[0] !== t0) {
|
|
359
|
-
({fullIso: t1, renderStaticInput, ...props} = t0);
|
|
360
|
-
$[0] = t0;
|
|
361
|
-
$[1] = props;
|
|
362
|
-
$[2] = renderStaticInput;
|
|
363
|
-
$[3] = t1;
|
|
364
|
-
} else {
|
|
365
|
-
props = $[1];
|
|
366
|
-
renderStaticInput = $[2];
|
|
367
|
-
t1 = $[3];
|
|
368
|
-
}
|
|
369
|
-
const fullIso = t1 === void 0 ? true : t1;
|
|
203
|
+
var DateTimePicker = ({ fullIso = true, ...props }) => {
|
|
204
|
+
let effectiveTimeZone = getLocalTimeZone();
|
|
205
|
+
if (props.timeZone) effectiveTimeZone = props.timeZone;
|
|
206
|
+
const formatDateValue = (dateValue) => {
|
|
207
|
+
if (dateValue === null) return null;
|
|
208
|
+
if (fullIso) return DateTimeUtils.fromDateValueToISO(dateValue, effectiveTimeZone);
|
|
209
|
+
return DateTimeUtils.fromDateValueToISO(dateValue, effectiveTimeZone);
|
|
210
|
+
};
|
|
211
|
+
const parseDateValue = (isoString) => {
|
|
212
|
+
if (isoString == null) return isoString;
|
|
213
|
+
return DateTimeUtils.fromUTCISOToCalendarDateTime(isoString, effectiveTimeZone);
|
|
214
|
+
};
|
|
370
215
|
if ("formControl" in props && props.formControl) {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
({
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
const controlWithOptions = formControl.control;
|
|
386
|
-
let t2;
|
|
387
|
-
if ($[8] !== controlWithOptions._options?.disabled || $[9] !== fullIso || $[10] !== innerProps || $[11] !== props.error || $[12] !== props.isDisabled || $[13] !== ref || $[14] !== renderStaticInput) {
|
|
388
|
-
t2 = (t3) => {
|
|
389
|
-
const { field, fieldState: t4 } = t3;
|
|
390
|
-
const { error, isDirty } = t4;
|
|
391
|
-
return /* @__PURE__ */ jsx(DateTimePickerInner, {
|
|
392
|
-
...innerProps,
|
|
393
|
-
ref: mergeRefs(ref, field.ref),
|
|
394
|
-
value: field.value ?? null,
|
|
395
|
-
onChange: field.onChange,
|
|
396
|
-
onBlur: field.onBlur,
|
|
397
|
-
isDirty,
|
|
398
|
-
isDisabled: field.disabled || props.isDisabled,
|
|
399
|
-
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
400
|
-
error: props.error ?? error?.message,
|
|
401
|
-
fullIso,
|
|
402
|
-
renderStaticInput
|
|
403
|
-
});
|
|
404
|
-
};
|
|
405
|
-
$[8] = controlWithOptions._options?.disabled;
|
|
406
|
-
$[9] = fullIso;
|
|
407
|
-
$[10] = innerProps;
|
|
408
|
-
$[11] = props.error;
|
|
409
|
-
$[12] = props.isDisabled;
|
|
410
|
-
$[13] = ref;
|
|
411
|
-
$[14] = renderStaticInput;
|
|
412
|
-
$[15] = t2;
|
|
413
|
-
} else t2 = $[15];
|
|
414
|
-
let t3;
|
|
415
|
-
if ($[16] !== formControl.control || $[17] !== formControl.name || $[18] !== t2) {
|
|
416
|
-
t3 = /* @__PURE__ */ jsx(Controller, {
|
|
417
|
-
control: formControl.control,
|
|
418
|
-
name: formControl.name,
|
|
419
|
-
render: t2
|
|
420
|
-
});
|
|
421
|
-
$[16] = formControl.control;
|
|
422
|
-
$[17] = formControl.name;
|
|
423
|
-
$[18] = t2;
|
|
424
|
-
$[19] = t3;
|
|
425
|
-
} else t3 = $[19];
|
|
426
|
-
return t3;
|
|
427
|
-
}
|
|
428
|
-
let t2;
|
|
429
|
-
if ($[20] !== fullIso || $[21] !== props || $[22] !== renderStaticInput) {
|
|
430
|
-
t2 = /* @__PURE__ */ jsx(DateTimePickerInner, {
|
|
431
|
-
...props,
|
|
432
|
-
fullIso,
|
|
433
|
-
renderStaticInput
|
|
216
|
+
const { formControl, ref, ...innerProps } = props;
|
|
217
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
218
|
+
control: formControl.control,
|
|
219
|
+
name: formControl.name,
|
|
220
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DateTimePickerBase, {
|
|
221
|
+
...innerProps,
|
|
222
|
+
ref: mergeRefs(ref, field.ref),
|
|
223
|
+
value: parseDateValue(field.value),
|
|
224
|
+
onChange: (value) => field.onChange(formatDateValue(value)),
|
|
225
|
+
onBlur: field.onBlur,
|
|
226
|
+
isDirty,
|
|
227
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
228
|
+
error: props.error ?? error?.message
|
|
229
|
+
})
|
|
434
230
|
});
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
231
|
+
}
|
|
232
|
+
return /* @__PURE__ */ jsx(DateTimePickerBase, {
|
|
233
|
+
...props,
|
|
234
|
+
value: parseDateValue(props.value),
|
|
235
|
+
onChange: (value) => props.onChange?.(formatDateValue(value))
|
|
236
|
+
});
|
|
441
237
|
};
|
|
442
|
-
function _temp(input) {
|
|
443
|
-
const container = input.getContainer?.() ?? input;
|
|
444
|
-
return container instanceof HTMLElement ? container.querySelector("input, button, [tabindex]:not([tabindex='-1'])") : null;
|
|
445
|
-
}
|
|
446
|
-
function _temp2(dateValue) {
|
|
447
|
-
if (dateValue === null) return null;
|
|
448
|
-
return DateTimeUtils.fromDateValueFieldsToUTCISO(dateValue);
|
|
449
|
-
}
|
|
450
|
-
function _temp3(isoString) {
|
|
451
|
-
if (isoString == null) return null;
|
|
452
|
-
return DateTimeUtils.fromUTCISOToCalendarDateTime(isoString, "UTC");
|
|
453
|
-
}
|
|
454
|
-
function _temp4() {}
|
|
455
238
|
//#endregion
|
|
456
239
|
export { DateTimePicker };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Ref
|
|
1
|
+
import { Ref } from 'react';
|
|
2
2
|
import { AriaTimeFieldProps, TimeValue } from 'react-aria';
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
4
|
import { FormFieldProps } from '../../FormField/FormField';
|
|
5
5
|
import { ControlProps } from '../../shared/form.types';
|
|
6
6
|
import { InputVariantProps } from '../../shared/input.cva';
|
|
7
|
-
interface TimePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<AriaTimeFieldProps<TimeValue>, "label"
|
|
7
|
+
interface TimePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<AriaTimeFieldProps<TimeValue>, "label"> {
|
|
8
8
|
ref?: Ref<HTMLDivElement>;
|
|
9
9
|
disableDropdown?: boolean;
|
|
10
10
|
date?: string | null;
|
|
@@ -13,16 +13,13 @@ interface TimePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<Ar
|
|
|
13
13
|
disableManualEntry?: boolean;
|
|
14
14
|
placeholder?: string;
|
|
15
15
|
inputClassName?: string;
|
|
16
|
-
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
17
|
-
fireBlurOnChange?: boolean;
|
|
18
16
|
}
|
|
19
17
|
export interface TimePickerProps extends Omit<TimePickerBaseProps, "value" | "onChange"> {
|
|
20
18
|
value?: string | null;
|
|
21
19
|
onChange?: (value: string | null) => void;
|
|
22
20
|
fullIso?: boolean;
|
|
23
21
|
timeZone?: string;
|
|
24
|
-
renderStaticInput?: boolean;
|
|
25
22
|
}
|
|
26
23
|
export type ControlledTimePickerProps<TFieldValues extends FieldValues> = ControlProps<TimePickerProps, TFieldValues>;
|
|
27
|
-
export declare const TimePicker: <TFieldValues extends FieldValues>(
|
|
24
|
+
export declare const TimePicker: <TFieldValues extends FieldValues>(props: ControlledTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
28
25
|
export {};
|