@povio/ui 3.0.0-rc.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- 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/components/Breadcrumbs/Breadcrumbs.js +56 -207
- package/dist/components/Menu/Menu.d.ts +4 -0
- 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.d.ts +1 -1
- package/dist/components/Menu/MenuMobile.js +39 -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 -373
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -12
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +186 -492
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -14
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +47 -273
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -7
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +121 -611
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +3 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +120 -338
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +103 -310
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +98 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -286
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -14
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +129 -356
- 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.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +28 -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 +45 -88
- 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.d.ts +2 -2
- package/dist/components/inputs/File/shared/ProgressBar.js +20 -53
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +1 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
- package/dist/components/inputs/File/shared/progressBar.cva.d.ts +38 -0
- package/dist/components/inputs/File/shared/progressBar.cva.js +28 -0
- 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 -45
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -48
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +22 -217
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -107
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +18 -227
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +3 -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 -397
- 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 +6 -11
- 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 -28
- package/dist/components/inputs/shared/input.cva.js +4 -38
- 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 +25 -98
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +22 -64
- package/dist/components/overlays/Modal/modal.cva.js +1 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +5 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +28 -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 +17 -22
- package/dist/components/status/Toast/toast.cva.d.ts +14 -3
- package/dist/components/status/Toast/toast.cva.js +12 -10
- 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 +30 -30
- package/dist/components/table/table.cva.d.ts +7 -0
- package/dist/components/table/table.cva.js +2 -1
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Pill/Pill.d.ts +15 -0
- package/dist/components/text/Pill/Pill.js +44 -0
- 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 +10 -21
- package/dist/config/uiConfig.context.js +18 -69
- package/dist/config/uiOverrides.context.d.ts +10 -20
- package/dist/config/uiOverrides.context.js +14 -54
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useAutosave.d.ts +1 -2
- package/dist/hooks/useAutosave.js +4 -12
- 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.d.ts +1 -3
- package/dist/hooks/useFormAutosave.js +30 -122
- 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 +7 -16
- package/dist/index.js +6 -13
- 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 -136
- 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 -16
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -16
- 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 -40
- 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 -13
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -14
- 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 -8
- 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 -37
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -178
- 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 -14
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -43
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -12
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -8
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -54
- 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 -8
- 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/useAutosave.spec.d.ts +0 -1
- package/dist/hooks/useFormAutosave.spec.d.ts +0 -1
- package/dist/hooks/useKeyInteractions.d.ts +0 -20
- package/dist/hooks/useKeyInteractions.js +0 -54
- package/dist/hooks/useKeyInteractions.spec.d.ts +0 -1
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -72
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -3,14 +3,9 @@ import { TimePickerForm } from "../shared/TimePickerForm.js";
|
|
|
3
3
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
4
4
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
5
5
|
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
6
|
-
import { getStaticTimeSegments } from "../shared/staticDateTimeSegments.js";
|
|
7
6
|
import { FormField } from "../../FormField/FormField.js";
|
|
8
7
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
9
|
-
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
10
|
-
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
11
|
-
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
12
8
|
import { TimePickerInput } from "../shared/TimePickerInput.js";
|
|
13
|
-
import { c } from "react/compiler-runtime";
|
|
14
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
10
|
import { clsx } from "clsx";
|
|
16
11
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -22,465 +17,117 @@ import { DateTime } from "luxon";
|
|
|
22
17
|
import { useTimeFieldState } from "react-stately";
|
|
23
18
|
//#region src/components/inputs/DateTime/TimePicker/TimePicker.tsx
|
|
24
19
|
var TimePickerBase = (props) => {
|
|
25
|
-
const $ = c(147);
|
|
26
20
|
const ui = UIConfig.useConfig();
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
let isHeaderHidden;
|
|
42
|
-
let isRequired;
|
|
43
|
-
let label;
|
|
44
|
-
let onBlur;
|
|
45
|
-
let onChange;
|
|
46
|
-
let placeholder;
|
|
47
|
-
let ref;
|
|
48
|
-
let rest;
|
|
49
|
-
let rightContent;
|
|
50
|
-
let shouldForceLeadingZerosProp;
|
|
51
|
-
let sizeProp;
|
|
52
|
-
let tooltipText;
|
|
53
|
-
let value;
|
|
54
|
-
let variantProp;
|
|
55
|
-
if ($[0] !== props) {
|
|
56
|
-
({ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, placeholder, className, inputClassName, variant: variantProp, as: asProp, size: sizeProp, hideLabel: hideLabelProp, isClearable: isClearableProp, disableManualEntry: disableManualEntryProp, fireBlurOnChange: fireBlurOnChangeProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, ...rest} = props);
|
|
57
|
-
$[0] = props;
|
|
58
|
-
$[1] = asProp;
|
|
59
|
-
$[2] = className;
|
|
60
|
-
$[3] = disableDropdown;
|
|
61
|
-
$[4] = disableManualEntryProp;
|
|
62
|
-
$[5] = error;
|
|
63
|
-
$[6] = errorClassName;
|
|
64
|
-
$[7] = fireBlurOnChangeProp;
|
|
65
|
-
$[8] = headerClassName;
|
|
66
|
-
$[9] = helperText;
|
|
67
|
-
$[10] = hideLabelProp;
|
|
68
|
-
$[11] = inputClassName;
|
|
69
|
-
$[12] = isClearableProp;
|
|
70
|
-
$[13] = isDirty;
|
|
71
|
-
$[14] = isDisabled;
|
|
72
|
-
$[15] = isHeaderHidden;
|
|
73
|
-
$[16] = isRequired;
|
|
74
|
-
$[17] = label;
|
|
75
|
-
$[18] = onBlur;
|
|
76
|
-
$[19] = onChange;
|
|
77
|
-
$[20] = placeholder;
|
|
78
|
-
$[21] = ref;
|
|
79
|
-
$[22] = rest;
|
|
80
|
-
$[23] = rightContent;
|
|
81
|
-
$[24] = shouldForceLeadingZerosProp;
|
|
82
|
-
$[25] = sizeProp;
|
|
83
|
-
$[26] = tooltipText;
|
|
84
|
-
$[27] = value;
|
|
85
|
-
$[28] = variantProp;
|
|
86
|
-
} else {
|
|
87
|
-
asProp = $[1];
|
|
88
|
-
className = $[2];
|
|
89
|
-
disableDropdown = $[3];
|
|
90
|
-
disableManualEntryProp = $[4];
|
|
91
|
-
error = $[5];
|
|
92
|
-
errorClassName = $[6];
|
|
93
|
-
fireBlurOnChangeProp = $[7];
|
|
94
|
-
headerClassName = $[8];
|
|
95
|
-
helperText = $[9];
|
|
96
|
-
hideLabelProp = $[10];
|
|
97
|
-
inputClassName = $[11];
|
|
98
|
-
isClearableProp = $[12];
|
|
99
|
-
isDirty = $[13];
|
|
100
|
-
isDisabled = $[14];
|
|
101
|
-
isHeaderHidden = $[15];
|
|
102
|
-
isRequired = $[16];
|
|
103
|
-
label = $[17];
|
|
104
|
-
onBlur = $[18];
|
|
105
|
-
onChange = $[19];
|
|
106
|
-
placeholder = $[20];
|
|
107
|
-
ref = $[21];
|
|
108
|
-
rest = $[22];
|
|
109
|
-
rightContent = $[23];
|
|
110
|
-
shouldForceLeadingZerosProp = $[24];
|
|
111
|
-
sizeProp = $[25];
|
|
112
|
-
tooltipText = $[26];
|
|
113
|
-
value = $[27];
|
|
114
|
-
variantProp = $[28];
|
|
115
|
-
}
|
|
116
|
-
const variant = variantProp ?? ui.input.variant;
|
|
117
|
-
const as = asProp ?? ui.input.as;
|
|
118
|
-
const size = sizeProp ?? ui.input.size;
|
|
119
|
-
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
120
|
-
const isClearable = isClearableProp ?? ui.input.isClearable;
|
|
121
|
-
const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
|
|
122
|
-
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
|
|
123
|
-
const shouldForceLeadingZeros = shouldForceLeadingZerosProp ?? ui.dateInput.shouldForceLeadingZeros;
|
|
124
|
-
const t0 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
|
|
125
|
-
let t1;
|
|
126
|
-
if ($[29] !== error || $[30] !== errorClassName || $[31] !== headerClassName || $[32] !== helperText || $[33] !== hideLabel || $[34] !== isDisabled || $[35] !== isRequired || $[36] !== label || $[37] !== rightContent || $[38] !== t0 || $[39] !== tooltipText) {
|
|
127
|
-
t1 = {
|
|
128
|
-
error,
|
|
129
|
-
label,
|
|
130
|
-
tooltipText,
|
|
131
|
-
helperText,
|
|
132
|
-
isRequired,
|
|
133
|
-
rightContent,
|
|
134
|
-
isHeaderHidden: t0,
|
|
135
|
-
hideLabel,
|
|
136
|
-
isDisabled,
|
|
137
|
-
headerClassName,
|
|
138
|
-
errorClassName
|
|
139
|
-
};
|
|
140
|
-
$[29] = error;
|
|
141
|
-
$[30] = errorClassName;
|
|
142
|
-
$[31] = headerClassName;
|
|
143
|
-
$[32] = helperText;
|
|
144
|
-
$[33] = hideLabel;
|
|
145
|
-
$[34] = isDisabled;
|
|
146
|
-
$[35] = isRequired;
|
|
147
|
-
$[36] = label;
|
|
148
|
-
$[37] = rightContent;
|
|
149
|
-
$[38] = t0;
|
|
150
|
-
$[39] = tooltipText;
|
|
151
|
-
$[40] = t1;
|
|
152
|
-
} else t1 = $[40];
|
|
153
|
-
const formFieldProps = t1;
|
|
21
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, placeholder, className, inputClassName, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, hideLabel = ui.input.hideLabel, isClearable = ui.input.isClearable, disableManualEntry = ui.dateInput.disableManualEntry, ...rest } = props;
|
|
22
|
+
const formFieldProps = {
|
|
23
|
+
error,
|
|
24
|
+
label,
|
|
25
|
+
tooltipText,
|
|
26
|
+
helperText,
|
|
27
|
+
isRequired,
|
|
28
|
+
rightContent,
|
|
29
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
30
|
+
hideLabel,
|
|
31
|
+
isDisabled,
|
|
32
|
+
headerClassName,
|
|
33
|
+
errorClassName
|
|
34
|
+
};
|
|
154
35
|
const [isOpen, setIsOpen] = useState(false);
|
|
155
36
|
const initialDateEmitRef = useRef(true);
|
|
156
37
|
const { locale } = useLocale();
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
t4 = (val) => {
|
|
177
|
-
onBlur?.({ target: { value: val } });
|
|
178
|
-
};
|
|
179
|
-
$[46] = onBlur;
|
|
180
|
-
$[47] = t4;
|
|
181
|
-
} else t4 = $[47];
|
|
182
|
-
const handleBlur = t4;
|
|
183
|
-
let t5;
|
|
184
|
-
if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
|
|
185
|
-
t5 = { delay: 500 };
|
|
186
|
-
$[48] = t5;
|
|
187
|
-
} else t5 = $[48];
|
|
188
|
-
const { callback: debouncedBlur } = useDebounceCallback(handleBlur, t5);
|
|
189
|
-
let t6;
|
|
190
|
-
if ($[49] !== debouncedBlur || $[50] !== fireBlurOnChange || $[51] !== onChange) {
|
|
191
|
-
t6 = (val_0) => {
|
|
192
|
-
onChange?.(val_0);
|
|
193
|
-
if (fireBlurOnChange) debouncedBlur(val_0);
|
|
194
|
-
};
|
|
195
|
-
$[49] = debouncedBlur;
|
|
196
|
-
$[50] = fireBlurOnChange;
|
|
197
|
-
$[51] = onChange;
|
|
198
|
-
$[52] = t6;
|
|
199
|
-
} else t6 = $[52];
|
|
200
|
-
let t7;
|
|
201
|
-
if ($[53] !== isDisabled || $[54] !== locale || $[55] !== normalizedValue || $[56] !== rest || $[57] !== shouldForceLeadingZeros || $[58] !== t6) {
|
|
202
|
-
t7 = {
|
|
203
|
-
...rest,
|
|
204
|
-
isDisabled,
|
|
205
|
-
value: normalizedValue,
|
|
206
|
-
onChange: t6,
|
|
207
|
-
locale,
|
|
208
|
-
shouldForceLeadingZeros
|
|
209
|
-
};
|
|
210
|
-
$[53] = isDisabled;
|
|
211
|
-
$[54] = locale;
|
|
212
|
-
$[55] = normalizedValue;
|
|
213
|
-
$[56] = rest;
|
|
214
|
-
$[57] = shouldForceLeadingZeros;
|
|
215
|
-
$[58] = t6;
|
|
216
|
-
$[59] = t7;
|
|
217
|
-
} else t7 = $[59];
|
|
218
|
-
const state = useTimeFieldState(t7);
|
|
219
|
-
let t8;
|
|
220
|
-
if ($[60] !== onChange || $[61] !== state.timeValue) {
|
|
221
|
-
t8 = () => {
|
|
222
|
-
if (initialDateEmitRef.current) {
|
|
223
|
-
initialDateEmitRef.current = false;
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
if (state.timeValue) onChange?.(state.timeValue);
|
|
227
|
-
};
|
|
228
|
-
$[60] = onChange;
|
|
229
|
-
$[61] = state.timeValue;
|
|
230
|
-
$[62] = t8;
|
|
231
|
-
} else t8 = $[62];
|
|
232
|
-
let t9;
|
|
233
|
-
if ($[63] !== rest.date) {
|
|
234
|
-
t9 = [rest.date];
|
|
235
|
-
$[63] = rest.date;
|
|
236
|
-
$[64] = t9;
|
|
237
|
-
} else t9 = $[64];
|
|
238
|
-
useEffect(t8, t9);
|
|
38
|
+
const dialogState = useTimeFieldState({
|
|
39
|
+
...rest,
|
|
40
|
+
defaultValue: value || rest.defaultValue,
|
|
41
|
+
locale
|
|
42
|
+
});
|
|
43
|
+
const state = useTimeFieldState({
|
|
44
|
+
...rest,
|
|
45
|
+
isDisabled,
|
|
46
|
+
value,
|
|
47
|
+
onChange,
|
|
48
|
+
locale
|
|
49
|
+
});
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (initialDateEmitRef.current) {
|
|
52
|
+
initialDateEmitRef.current = false;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (state.timeValue) onChange?.(state.timeValue);
|
|
56
|
+
}, [rest.date]);
|
|
239
57
|
const timeFieldRef = useRef(null);
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
$[74] = label;
|
|
274
|
-
$[75] = labelProps;
|
|
275
|
-
$[76] = rightContent;
|
|
276
|
-
$[77] = t11;
|
|
277
|
-
$[78] = tooltipText;
|
|
278
|
-
$[79] = t12;
|
|
279
|
-
} else t12 = $[79];
|
|
280
|
-
const headerProps = t12;
|
|
281
|
-
let t13;
|
|
282
|
-
if ($[80] !== dialogState.value || $[81] !== fireBlurOnChange || $[82] !== handleBlur || $[83] !== state) {
|
|
283
|
-
t13 = () => {
|
|
284
|
-
const newValue = dialogState.value;
|
|
285
|
-
state.setValue(newValue);
|
|
286
|
-
setIsOpen(false);
|
|
287
|
-
if (fireBlurOnChange) handleBlur(newValue);
|
|
288
|
-
};
|
|
289
|
-
$[80] = dialogState.value;
|
|
290
|
-
$[81] = fireBlurOnChange;
|
|
291
|
-
$[82] = handleBlur;
|
|
292
|
-
$[83] = state;
|
|
293
|
-
$[84] = t13;
|
|
294
|
-
} else t13 = $[84];
|
|
295
|
-
const onApply = t13;
|
|
296
|
-
let t14;
|
|
297
|
-
if ($[85] !== dialogState || $[86] !== isOpen || $[87] !== state.value) {
|
|
298
|
-
t14 = (open) => {
|
|
299
|
-
setIsOpen(open);
|
|
300
|
-
if (!isOpen) dialogState.setValue(state.value);
|
|
301
|
-
};
|
|
302
|
-
$[85] = dialogState;
|
|
303
|
-
$[86] = isOpen;
|
|
304
|
-
$[87] = state.value;
|
|
305
|
-
$[88] = t14;
|
|
306
|
-
} else t14 = $[88];
|
|
307
|
-
const onOpenChange = t14;
|
|
308
|
-
let t15;
|
|
309
|
-
if ($[89] !== dialogState || $[90] !== state.value) {
|
|
310
|
-
t15 = () => {
|
|
311
|
-
dialogState.setValue(state.value);
|
|
312
|
-
setIsOpen(true);
|
|
313
|
-
};
|
|
314
|
-
$[89] = dialogState;
|
|
315
|
-
$[90] = state.value;
|
|
316
|
-
$[91] = t15;
|
|
317
|
-
} else t15 = $[91];
|
|
318
|
-
const onOpen = t15;
|
|
319
|
-
let t16;
|
|
320
|
-
if ($[92] !== onChange) {
|
|
321
|
-
t16 = () => {
|
|
322
|
-
onChange?.(null);
|
|
323
|
-
};
|
|
324
|
-
$[92] = onChange;
|
|
325
|
-
$[93] = t16;
|
|
326
|
-
} else t16 = $[93];
|
|
327
|
-
const onInputClear = t16;
|
|
328
|
-
const t17 = as === "inline" ? -1 : void 0;
|
|
329
|
-
let t18;
|
|
330
|
-
if ($[94] !== className) {
|
|
331
|
-
t18 = clsx("group relative inline-flex w-full flex-col text-left", className);
|
|
332
|
-
$[94] = className;
|
|
333
|
-
$[95] = t18;
|
|
334
|
-
} else t18 = $[95];
|
|
335
|
-
const t19 = as === "inline" ? -1 : void 0;
|
|
336
|
-
let t20;
|
|
337
|
-
if ($[96] !== ref) {
|
|
338
|
-
t20 = mergeRefs(ref, timeFieldRef);
|
|
339
|
-
$[96] = ref;
|
|
340
|
-
$[97] = t20;
|
|
341
|
-
} else t20 = $[97];
|
|
342
|
-
let t21;
|
|
343
|
-
if ($[98] !== fieldProps || $[99] !== handleBlur || $[100] !== state.value) {
|
|
344
|
-
t21 = (event) => {
|
|
345
|
-
fieldProps.onBlur?.(event);
|
|
346
|
-
handleBlur(state.value);
|
|
347
|
-
};
|
|
348
|
-
$[98] = fieldProps;
|
|
349
|
-
$[99] = handleBlur;
|
|
350
|
-
$[100] = state.value;
|
|
351
|
-
$[101] = t21;
|
|
352
|
-
} else t21 = $[101];
|
|
353
|
-
let t22;
|
|
354
|
-
if ($[102] !== fieldProps || $[103] !== t21) {
|
|
355
|
-
t22 = {
|
|
356
|
-
...fieldProps,
|
|
357
|
-
onBlur: t21
|
|
358
|
-
};
|
|
359
|
-
$[102] = fieldProps;
|
|
360
|
-
$[103] = t21;
|
|
361
|
-
$[104] = t22;
|
|
362
|
-
} else t22 = $[104];
|
|
363
|
-
const t23 = !!error;
|
|
364
|
-
let t24;
|
|
365
|
-
if ($[105] !== as || $[106] !== disableDropdown || $[107] !== disableManualEntry || $[108] !== fireBlurOnChange || $[109] !== headerProps || $[110] !== inputClassName || $[111] !== isClearable || $[112] !== isDirty || $[113] !== isDisabled || $[114] !== isRequired || $[115] !== onInputClear || $[116] !== onOpen || $[117] !== placeholder || $[118] !== size || $[119] !== state || $[120] !== t20 || $[121] !== t22 || $[122] !== t23 || $[123] !== variant) {
|
|
366
|
-
t24 = /* @__PURE__ */ jsx(TimePickerInput, {
|
|
367
|
-
ref: t20,
|
|
368
|
-
as,
|
|
369
|
-
fieldProps: t22,
|
|
370
|
-
state,
|
|
371
|
-
onPress: onOpen,
|
|
372
|
-
isDisabled,
|
|
373
|
-
isDirty,
|
|
374
|
-
isRequired,
|
|
375
|
-
isInvalid: t23,
|
|
376
|
-
disableDropdown,
|
|
377
|
-
variant,
|
|
378
|
-
size,
|
|
379
|
-
isClearable,
|
|
380
|
-
headerProps,
|
|
381
|
-
disableManualEntry,
|
|
382
|
-
placeholder,
|
|
383
|
-
className: inputClassName,
|
|
384
|
-
onClear: onInputClear,
|
|
385
|
-
fireBlurOnChange
|
|
386
|
-
});
|
|
387
|
-
$[105] = as;
|
|
388
|
-
$[106] = disableDropdown;
|
|
389
|
-
$[107] = disableManualEntry;
|
|
390
|
-
$[108] = fireBlurOnChange;
|
|
391
|
-
$[109] = headerProps;
|
|
392
|
-
$[110] = inputClassName;
|
|
393
|
-
$[111] = isClearable;
|
|
394
|
-
$[112] = isDirty;
|
|
395
|
-
$[113] = isDisabled;
|
|
396
|
-
$[114] = isRequired;
|
|
397
|
-
$[115] = onInputClear;
|
|
398
|
-
$[116] = onOpen;
|
|
399
|
-
$[117] = placeholder;
|
|
400
|
-
$[118] = size;
|
|
401
|
-
$[119] = state;
|
|
402
|
-
$[120] = t20;
|
|
403
|
-
$[121] = t22;
|
|
404
|
-
$[122] = t23;
|
|
405
|
-
$[123] = variant;
|
|
406
|
-
$[124] = t24;
|
|
407
|
-
} else t24 = $[124];
|
|
408
|
-
let t25;
|
|
409
|
-
if ($[125] !== dialogState || $[126] !== disableDropdown || $[127] !== disableManualEntry || $[128] !== isDisabled || $[129] !== isOpen || $[130] !== label || $[131] !== onApply || $[132] !== onOpenChange) {
|
|
410
|
-
t25 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
411
|
-
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
412
|
-
isDisabled,
|
|
413
|
-
onApply,
|
|
414
|
-
isValid: !dialogState.isInvalid && !!dialogState.value
|
|
415
|
-
}),
|
|
416
|
-
label,
|
|
417
|
-
triggerRef: timeFieldRef,
|
|
418
|
-
isOpen,
|
|
419
|
-
onOpenChange,
|
|
420
|
-
children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
|
|
421
|
-
});
|
|
422
|
-
$[125] = dialogState;
|
|
423
|
-
$[126] = disableDropdown;
|
|
424
|
-
$[127] = disableManualEntry;
|
|
425
|
-
$[128] = isDisabled;
|
|
426
|
-
$[129] = isOpen;
|
|
427
|
-
$[130] = label;
|
|
428
|
-
$[131] = onApply;
|
|
429
|
-
$[132] = onOpenChange;
|
|
430
|
-
$[133] = t25;
|
|
431
|
-
} else t25 = $[133];
|
|
432
|
-
let t26;
|
|
433
|
-
if ($[134] !== as || $[135] !== formFieldProps || $[136] !== labelProps || $[137] !== t18 || $[138] !== t19 || $[139] !== t24 || $[140] !== t25) {
|
|
434
|
-
t26 = /* @__PURE__ */ jsxs(FormField, {
|
|
58
|
+
const { labelProps, fieldProps } = useTimeField({
|
|
59
|
+
...rest,
|
|
60
|
+
label,
|
|
61
|
+
isReadOnly: disableManualEntry
|
|
62
|
+
}, state, timeFieldRef);
|
|
63
|
+
const headerProps = {
|
|
64
|
+
label,
|
|
65
|
+
tooltipText,
|
|
66
|
+
helperText,
|
|
67
|
+
isRequired,
|
|
68
|
+
rightContent,
|
|
69
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
70
|
+
isDisabled,
|
|
71
|
+
className: headerClassName,
|
|
72
|
+
labelProps
|
|
73
|
+
};
|
|
74
|
+
const onApply = () => {
|
|
75
|
+
state.setValue(dialogState.value);
|
|
76
|
+
setIsOpen(false);
|
|
77
|
+
};
|
|
78
|
+
const onOpenChange = (open) => {
|
|
79
|
+
setIsOpen(open);
|
|
80
|
+
if (!isOpen) dialogState.setValue(state.value);
|
|
81
|
+
};
|
|
82
|
+
const onOpen = () => {
|
|
83
|
+
dialogState.setValue(state.value);
|
|
84
|
+
setIsOpen(true);
|
|
85
|
+
};
|
|
86
|
+
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
87
|
+
as,
|
|
88
|
+
error,
|
|
89
|
+
triggerTabIndex: as === "inline" ? -1 : void 0,
|
|
90
|
+
children: /* @__PURE__ */ jsxs(FormField, {
|
|
435
91
|
...formFieldProps,
|
|
436
92
|
as,
|
|
437
93
|
labelProps,
|
|
438
|
-
className:
|
|
439
|
-
tabIndex:
|
|
440
|
-
children: [
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
94
|
+
className: clsx("group relative inline-flex w-full flex-col text-left", className),
|
|
95
|
+
tabIndex: as === "inline" ? -1 : void 0,
|
|
96
|
+
children: [/* @__PURE__ */ jsx(TimePickerInput, {
|
|
97
|
+
ref: mergeRefs(ref, timeFieldRef),
|
|
98
|
+
as,
|
|
99
|
+
fieldProps,
|
|
100
|
+
state,
|
|
101
|
+
onPress: onOpen,
|
|
102
|
+
isDisabled,
|
|
103
|
+
isDirty,
|
|
104
|
+
isInvalid: !!error,
|
|
105
|
+
disableDropdown,
|
|
106
|
+
variant,
|
|
107
|
+
size,
|
|
108
|
+
isClearable,
|
|
109
|
+
headerProps,
|
|
110
|
+
disableManualEntry,
|
|
111
|
+
placeholder,
|
|
112
|
+
className: inputClassName
|
|
113
|
+
}), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
114
|
+
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
115
|
+
isDisabled,
|
|
116
|
+
onApply,
|
|
117
|
+
isValid: !dialogState.isInvalid && !!dialogState.value
|
|
118
|
+
}),
|
|
119
|
+
label,
|
|
120
|
+
triggerRef: timeFieldRef,
|
|
121
|
+
isOpen,
|
|
122
|
+
onOpenChange,
|
|
123
|
+
children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
|
|
124
|
+
})]
|
|
125
|
+
})
|
|
126
|
+
});
|
|
466
127
|
};
|
|
467
|
-
var
|
|
468
|
-
const $ = c(9);
|
|
469
|
-
const { renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
470
|
-
const ui = UIConfig.useConfig();
|
|
471
|
-
const timeZone = props.timeZone ?? ui.dateInput.timeZone;
|
|
128
|
+
var TimePicker = (props) => {
|
|
472
129
|
let effectiveTimeZone = getLocalTimeZone();
|
|
473
|
-
if (timeZone
|
|
474
|
-
const { locale } = useLocale();
|
|
475
|
-
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
476
|
-
const inputRef = useRef(null);
|
|
477
|
-
const { renderRealInput } = useStaticInputHandoff({
|
|
478
|
-
inputRef,
|
|
479
|
-
renderInput,
|
|
480
|
-
setRenderInput,
|
|
481
|
-
getFocusTarget: _temp
|
|
482
|
-
});
|
|
483
|
-
const normalizedValue = props.value ?? null;
|
|
130
|
+
if (props.timeZone) effectiveTimeZone = props.timeZone;
|
|
484
131
|
const formatTimeValue = (timeValue) => {
|
|
485
132
|
if (timeValue === null) return null;
|
|
486
133
|
let parsedDate;
|
|
@@ -491,167 +138,30 @@ var TimePickerInner = (t0) => {
|
|
|
491
138
|
return DateTimeUtils.fromDateValueToISO(dateTimeValue, effectiveTimeZone);
|
|
492
139
|
};
|
|
493
140
|
const parseTimeValue = (isoString) => {
|
|
494
|
-
if (isoString == null) return
|
|
141
|
+
if (isoString == null) return isoString;
|
|
495
142
|
return toTime(DateTimeUtils.fromISOtoZonedDateTime(isoString, effectiveTimeZone));
|
|
496
143
|
};
|
|
497
|
-
if (!renderInput) {
|
|
498
|
-
const timeValue_0 = normalizedValue ? parseTimeValue(normalizedValue) : null;
|
|
499
|
-
const as = props.as ?? ui.input.as;
|
|
500
|
-
const isDisabled = isFormControlDisabled || !!props.isDisabled;
|
|
501
|
-
const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
|
|
502
|
-
const shouldForceLeadingZeros = props.shouldForceLeadingZeros ?? ui.dateInput.shouldForceLeadingZeros;
|
|
503
|
-
const showDropdown = !props.disableDropdown || disableManualEntry;
|
|
504
|
-
const staticSegments = getStaticTimeSegments({
|
|
505
|
-
value: timeValue_0,
|
|
506
|
-
locale,
|
|
507
|
-
shouldForceLeadingZeros,
|
|
508
|
-
isDisabled,
|
|
509
|
-
hidePlaceholder: as === "floating" && !timeValue_0,
|
|
510
|
-
disableManualEntry,
|
|
511
|
-
placeholder: props.placeholder
|
|
512
|
-
});
|
|
513
|
-
return /* @__PURE__ */ jsx(InputFrame, {
|
|
514
|
-
...props,
|
|
515
|
-
isDisabled,
|
|
516
|
-
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
517
|
-
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
518
|
-
contentClassName: "pr-0!",
|
|
519
|
-
contentGroup: "date-picker",
|
|
520
|
-
labelPlacement: "content-row",
|
|
521
|
-
dataAttributes: {
|
|
522
|
-
dataIsEmpty: timeValue_0 == null,
|
|
523
|
-
dataIsFilled: timeValue_0 != null,
|
|
524
|
-
dataIsDirty: props.isDirty,
|
|
525
|
-
dataIsRequired: props.isRequired,
|
|
526
|
-
dataIsDisabled: isDisabled,
|
|
527
|
-
dataDisabled: isDisabled,
|
|
528
|
-
dataInvalid: !!props.error,
|
|
529
|
-
dataHasSelection: timeValue_0 != null
|
|
530
|
-
},
|
|
531
|
-
renderStatic: true,
|
|
532
|
-
onStaticInteract: renderRealInput,
|
|
533
|
-
showClear: timeValue_0 != null,
|
|
534
|
-
wrapContentAndTrailing: true,
|
|
535
|
-
trailingClassName: "py-0! pl-0!",
|
|
536
|
-
action: showDropdown ? {
|
|
537
|
-
icon: ui.dateInput.timeIcon,
|
|
538
|
-
onClick: _temp2,
|
|
539
|
-
altText: ""
|
|
540
|
-
} : void 0,
|
|
541
|
-
children: staticSegments
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
const T0 = TimePickerBase;
|
|
545
|
-
const t1 = mergeRefs(props.ref, inputRef);
|
|
546
|
-
const t2 = parseTimeValue(normalizedValue);
|
|
547
|
-
let t3;
|
|
548
|
-
if ($[0] !== formatTimeValue || $[1] !== props) {
|
|
549
|
-
t3 = (value) => props.onChange?.(formatTimeValue(value));
|
|
550
|
-
$[0] = formatTimeValue;
|
|
551
|
-
$[1] = props;
|
|
552
|
-
$[2] = t3;
|
|
553
|
-
} else t3 = $[2];
|
|
554
|
-
let t4;
|
|
555
|
-
if ($[3] !== T0 || $[4] !== props || $[5] !== t1 || $[6] !== t2 || $[7] !== t3) {
|
|
556
|
-
t4 = /* @__PURE__ */ jsx(T0, {
|
|
557
|
-
...props,
|
|
558
|
-
ref: t1,
|
|
559
|
-
value: t2,
|
|
560
|
-
onChange: t3
|
|
561
|
-
});
|
|
562
|
-
$[3] = T0;
|
|
563
|
-
$[4] = props;
|
|
564
|
-
$[5] = t1;
|
|
565
|
-
$[6] = t2;
|
|
566
|
-
$[7] = t3;
|
|
567
|
-
$[8] = t4;
|
|
568
|
-
} else t4 = $[8];
|
|
569
|
-
return t4;
|
|
570
|
-
};
|
|
571
|
-
var TimePicker = (t0) => {
|
|
572
|
-
const $ = c(21);
|
|
573
|
-
let props;
|
|
574
|
-
let renderStaticInput;
|
|
575
|
-
if ($[0] !== t0) {
|
|
576
|
-
({renderStaticInput, ...props} = t0);
|
|
577
|
-
$[0] = t0;
|
|
578
|
-
$[1] = props;
|
|
579
|
-
$[2] = renderStaticInput;
|
|
580
|
-
} else {
|
|
581
|
-
props = $[1];
|
|
582
|
-
renderStaticInput = $[2];
|
|
583
|
-
}
|
|
584
144
|
if ("formControl" in props && props.formControl) {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
({
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
}
|
|
599
|
-
const controlWithOptions = formControl.control;
|
|
600
|
-
let t1;
|
|
601
|
-
if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
|
|
602
|
-
t1 = (t2) => {
|
|
603
|
-
const { field, fieldState: t3 } = t2;
|
|
604
|
-
const { error, isDirty } = t3;
|
|
605
|
-
return /* @__PURE__ */ jsx(TimePickerInner, {
|
|
606
|
-
...innerProps,
|
|
607
|
-
ref: mergeRefs(ref, field.ref),
|
|
608
|
-
value: field.value ?? null,
|
|
609
|
-
onChange: field.onChange,
|
|
610
|
-
onBlur: field.onBlur,
|
|
611
|
-
isDirty,
|
|
612
|
-
isDisabled: field.disabled || props.isDisabled,
|
|
613
|
-
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
614
|
-
error: props.error ?? error?.message,
|
|
615
|
-
renderStaticInput
|
|
616
|
-
});
|
|
617
|
-
};
|
|
618
|
-
$[7] = controlWithOptions._options?.disabled;
|
|
619
|
-
$[8] = innerProps;
|
|
620
|
-
$[9] = props.error;
|
|
621
|
-
$[10] = props.isDisabled;
|
|
622
|
-
$[11] = ref;
|
|
623
|
-
$[12] = renderStaticInput;
|
|
624
|
-
$[13] = t1;
|
|
625
|
-
} else t1 = $[13];
|
|
626
|
-
let t2;
|
|
627
|
-
if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
|
|
628
|
-
t2 = /* @__PURE__ */ jsx(Controller, {
|
|
629
|
-
control: formControl.control,
|
|
630
|
-
name: formControl.name,
|
|
631
|
-
render: t1
|
|
632
|
-
});
|
|
633
|
-
$[14] = formControl.control;
|
|
634
|
-
$[15] = formControl.name;
|
|
635
|
-
$[16] = t1;
|
|
636
|
-
$[17] = t2;
|
|
637
|
-
} else t2 = $[17];
|
|
638
|
-
return t2;
|
|
639
|
-
}
|
|
640
|
-
let t1;
|
|
641
|
-
if ($[18] !== props || $[19] !== renderStaticInput) {
|
|
642
|
-
t1 = /* @__PURE__ */ jsx(TimePickerInner, {
|
|
643
|
-
...props,
|
|
644
|
-
renderStaticInput
|
|
145
|
+
const { formControl, ref, ...innerProps } = props;
|
|
146
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
147
|
+
control: formControl.control,
|
|
148
|
+
name: formControl.name,
|
|
149
|
+
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(TimePickerBase, {
|
|
150
|
+
...innerProps,
|
|
151
|
+
ref: mergeRefs(ref, field.ref),
|
|
152
|
+
value: parseTimeValue(field.value),
|
|
153
|
+
onChange: (value) => field.onChange(formatTimeValue(value)),
|
|
154
|
+
onBlur: field.onBlur,
|
|
155
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
156
|
+
error: props.error ?? error?.message
|
|
157
|
+
})
|
|
645
158
|
});
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
159
|
+
}
|
|
160
|
+
return /* @__PURE__ */ jsx(TimePickerBase, {
|
|
161
|
+
...props,
|
|
162
|
+
value: parseTimeValue(props.value),
|
|
163
|
+
onChange: (value) => props.onChange?.(formatTimeValue(value))
|
|
164
|
+
});
|
|
651
165
|
};
|
|
652
|
-
function _temp(input) {
|
|
653
|
-
return input.querySelector("input, button, [tabindex]:not([tabindex='-1'])");
|
|
654
|
-
}
|
|
655
|
-
function _temp2() {}
|
|
656
166
|
//#endregion
|
|
657
167
|
export { TimePicker };
|