@povio/ui 3.3.0 → 3.4.0-rc.10
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/locales/en/translation.json.d.ts +158 -0
- package/dist/assets/locales/sl/translation.json.d.ts +154 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +7 -7
- package/dist/components/Menu/MenuDesktop.js +1 -1
- package/dist/components/Menu/MenuItem.js +4 -4
- package/dist/components/Menu/MenuMobile.js +5 -5
- package/dist/components/Menu/MenuPopover.js +2 -2
- package/dist/components/buttons/Button/Button.js +1 -1
- package/dist/components/buttons/PillButton/PillButton.js +4 -4
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/buttons/SplitButton/SplitButton.js +3 -3
- package/dist/components/buttons/shared/ButtonContent.js +2 -2
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +1 -1
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -2
- package/dist/components/inputs/Checkbox/Checkbox.js +95 -102
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +2 -3
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +1 -2
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +111 -115
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +17 -22
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +17 -23
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +21 -25
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +225 -238
- package/dist/components/inputs/DateTime/shared/Calendar.js +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +7 -10
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +8 -12
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateField.js +4 -4
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -2
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +8 -16
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +3 -3
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +2 -2
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +1 -1
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +2 -2
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +2 -2
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +4 -5
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +10 -11
- package/dist/components/inputs/DateTime/shared/YearPicker.js +2 -2
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +46 -1
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +1 -1
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +20 -20
- package/dist/components/inputs/File/InputUpload.d.ts +1 -1
- package/dist/components/inputs/File/InputUpload.js +19 -19
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/inputUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +1 -1
- package/dist/components/inputs/File/shared/FileCardList.js +1 -1
- package/dist/components/inputs/File/shared/FileUploadContent.js +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +3 -3
- package/dist/components/inputs/File/shared/FileUploadContentError.js +5 -6
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +5 -6
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +4 -5
- package/dist/components/inputs/File/shared/InputUploadContent.js +4 -4
- package/dist/components/inputs/File/shared/InputUploadFilled.js +3 -3
- package/dist/components/inputs/FormField/FormFieldError.js +1 -1
- package/dist/components/inputs/FormField/FormFieldHeader.js +4 -4
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +3 -3
- package/dist/components/inputs/FormField/FormFieldHelper.js +1 -1
- package/dist/components/inputs/FormField/FormFieldLabel.js +2 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +109 -107
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +2 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +265 -254
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +2 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +25 -24
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +3 -4
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +2 -1
- package/dist/components/inputs/Input/TextArea/TextArea.js +118 -117
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +129 -129
- package/dist/components/inputs/Input/shared/InputContent.d.ts +2 -1
- package/dist/components/inputs/Input/shared/InputContent.js +50 -48
- package/dist/components/inputs/Inputs/Form.d.ts +4 -4
- package/dist/components/inputs/Inputs/Form.js +1 -1
- package/dist/components/inputs/Inputs/InputItem.d.ts +22 -22
- package/dist/components/inputs/Inputs/InputItem.js +36 -37
- package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +109 -113
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +16 -16
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +20 -20
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.js +20 -20
- package/dist/components/inputs/Selection/Select/Select.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/Select.js +23 -23
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +34 -37
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +58 -56
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +57 -56
- package/dist/components/inputs/Selection/shared/SelectListBox.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +5 -4
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +3 -3
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +5 -9
- package/dist/components/inputs/Selection/shared/select.types.d.ts +1 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +10 -7
- package/dist/components/inputs/Slider/Slider.d.ts +1 -1
- package/dist/components/inputs/Slider/Slider.js +20 -20
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +20 -20
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +2 -2
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +4 -4
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +4 -4
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +5 -8
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +3 -3
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +4 -5
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +4 -5
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +6 -9
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -2
- package/dist/components/inputs/Toggle/Toggle.js +61 -65
- package/dist/components/inputs/shared/CheckContent.js +1 -1
- package/dist/components/inputs/shared/InputClear.js +45 -28
- package/dist/components/inputs/shared/TooltipWrapper.d.ts +1 -1
- package/dist/components/inputs/shared/form.binding.d.ts +27 -0
- package/dist/components/inputs/shared/form.binding.js +57 -0
- package/dist/components/inputs/shared/form.types.d.ts +9 -8
- package/dist/components/inputs/shared/form.types.js +8 -0
- package/dist/components/inputs/shared/input.cva.js +1 -1
- package/dist/components/inputs/shared/useStaticInputHandoff.js +64 -38
- package/dist/components/navigation/Accordion/Accordion.js +1 -1
- package/dist/components/navigation/Accordion/AccordionItem.js +3 -3
- package/dist/components/navigation/Stepper/Stepper.js +2 -2
- package/dist/components/navigation/Stepper/StepperItem.js +4 -4
- package/dist/components/overlays/ActionModal/ActionModal.js +1 -1
- package/dist/components/overlays/BottomSheet/BottomSheet.js +3 -3
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +4 -4
- package/dist/components/overlays/Drawer/Drawer.js +2 -2
- package/dist/components/overlays/Modal/Modal.js +3 -3
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +15 -8
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +1 -1
- package/dist/components/segment/Segment.d.ts +1 -1
- package/dist/components/segment/Segment.js +21 -21
- package/dist/components/segment/SegmentItem.js +1 -1
- package/dist/components/segment/segment.types.d.ts +1 -1
- package/dist/components/shared/pagination/Pagination.js +1 -1
- package/dist/components/shared/pagination/PaginationList.js +6 -9
- package/dist/components/table/ColumnConfig.js +1 -1
- package/dist/components/table/InfiniteTable.js +1 -1
- package/dist/components/table/Table.js +6 -8
- package/dist/components/text/Link/Link.js +1 -1
- package/dist/components/text/Pill/Pill.js +3 -3
- package/dist/components/text/Tag/Tag.js +3 -3
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +1 -1
- package/dist/config/router.context.js +1 -1
- package/dist/config/theme.context.js +1 -1
- package/dist/config/uiConfig.context.d.ts +14 -5
- package/dist/config/uiConfig.context.js +9 -11
- package/dist/config/uiOverrides.context.js +2 -2
- package/dist/helpers/dynamicColumns.d.ts +1 -1
- package/dist/helpers/dynamicInputs.d.ts +7 -7
- package/dist/hooks/useAutosave.d.ts +4 -4
- package/dist/hooks/useAutosave.js +64 -49
- package/dist/hooks/useFilters.js +1 -1
- package/dist/hooks/useForm.d.ts +39 -15
- package/dist/hooks/useForm.js +96 -43
- package/dist/hooks/useFormAutosave.d.ts +8 -9
- package/dist/hooks/useFormAutosave.js +23 -9
- package/dist/hooks/useIntersectionObserver.js +1 -1
- package/dist/hooks/useLocalStorage.js +1 -1
- package/dist/hooks/usePagination.js +1 -1
- package/dist/hooks/useScrollableListBox.js +1 -1
- package/dist/hooks/useSorting.js +1 -1
- package/dist/hooks/useStateAndRef.js +1 -1
- package/dist/hooks/useTableColumnConfig.js +1 -1
- package/dist/index.d.ts +1 -263
- package/dist/index.js +11 -71
- package/dist/rhf/Inputs.d.ts +60 -0
- package/dist/rhf/Inputs.js +148 -0
- package/dist/rhf/components.d.ts +80 -0
- package/dist/rhf/components.js +101 -0
- package/dist/rhf/dynamicInputs.d.ts +18 -0
- package/dist/rhf/dynamicInputs.js +5 -0
- package/dist/rhf/fieldAdapter.d.ts +7 -0
- package/dist/rhf/fieldAdapter.js +40 -0
- package/dist/rhf/form.types.d.ts +12 -0
- package/dist/rhf/useAutosave.d.ts +10 -0
- package/dist/rhf/useAutosave.js +71 -0
- package/dist/rhf/useForm.d.ts +18 -0
- package/dist/rhf/useForm.js +48 -0
- package/dist/rhf/useFormAutosave.d.ts +15 -0
- package/dist/rhf/useFormAutosave.js +59 -0
- package/dist/rhf.d.ts +225 -0
- package/dist/tanstack.d.ts +224 -0
- package/dist/tanstack.js +141 -0
- package/package.json +15 -3
- package/dist/assets/icons/Account.d.ts +0 -2
- package/dist/assets/icons/AlignCenter.d.ts +0 -2
- package/dist/assets/icons/AlignCenter.js +0 -30
- package/dist/assets/icons/AlignLeft.d.ts +0 -2
- package/dist/assets/icons/AlignLeft.js +0 -30
- package/dist/assets/icons/AlignLeftRight.d.ts +0 -2
- package/dist/assets/icons/AlignLeftRight.js +0 -30
- package/dist/assets/icons/AlignRight.d.ts +0 -2
- package/dist/assets/icons/AlignRight.js +0 -30
- package/dist/assets/icons/ArrowDropDown.d.ts +0 -2
- package/dist/assets/icons/ArrowDropDown.js +0 -30
- package/dist/assets/icons/ArrowDropUp.d.ts +0 -2
- package/dist/assets/icons/ArrowDropUp.js +0 -30
- package/dist/assets/icons/ArrowLeft.d.ts +0 -2
- package/dist/assets/icons/ArrowLeft.js +0 -30
- package/dist/assets/icons/ArrowRight.d.ts +0 -2
- package/dist/assets/icons/ArrowRight.js +0 -30
- package/dist/assets/icons/Board.d.ts +0 -2
- package/dist/assets/icons/Bold.d.ts +0 -2
- package/dist/assets/icons/Bold.js +0 -30
- package/dist/assets/icons/BulletedList.d.ts +0 -2
- package/dist/assets/icons/BulletedList.js +0 -30
- package/dist/assets/icons/Calendar.d.ts +0 -2
- package/dist/assets/icons/Calendar.js +0 -32
- package/dist/assets/icons/Check.d.ts +0 -2
- package/dist/assets/icons/Check.js +0 -32
- package/dist/assets/icons/CheckCircle.d.ts +0 -2
- package/dist/assets/icons/CheckCircle.js +0 -30
- package/dist/assets/icons/CheckboxCheckmark.d.ts +0 -2
- package/dist/assets/icons/CheckboxCheckmark.js +0 -33
- package/dist/assets/icons/CheckboxIndeterminate.d.ts +0 -2
- package/dist/assets/icons/CheckboxIndeterminate.js +0 -33
- package/dist/assets/icons/ChevronDown.d.ts +0 -2
- package/dist/assets/icons/ChevronDown.js +0 -32
- package/dist/assets/icons/ChevronLeft.d.ts +0 -2
- package/dist/assets/icons/ChevronLeft.js +0 -32
- package/dist/assets/icons/ChevronRight.d.ts +0 -2
- package/dist/assets/icons/ChevronRight.js +0 -32
- package/dist/assets/icons/ChevronUp.d.ts +0 -2
- package/dist/assets/icons/ChevronUp.js +0 -32
- package/dist/assets/icons/ChevronsLeft.d.ts +0 -2
- package/dist/assets/icons/ChevronsLeft.js +0 -32
- package/dist/assets/icons/ChevronsRight.d.ts +0 -2
- package/dist/assets/icons/ChevronsRight.js +0 -32
- package/dist/assets/icons/Clock.d.ts +0 -2
- package/dist/assets/icons/Clock.js +0 -30
- package/dist/assets/icons/Close.d.ts +0 -2
- package/dist/assets/icons/Close.js +0 -30
- package/dist/assets/icons/DateTime.d.ts +0 -2
- package/dist/assets/icons/DateTime.js +0 -39
- package/dist/assets/icons/DragIndicator.d.ts +0 -2
- package/dist/assets/icons/DragIndicator.js +0 -30
- package/dist/assets/icons/Edit.d.ts +0 -2
- package/dist/assets/icons/Emoji.d.ts +0 -2
- package/dist/assets/icons/File.d.ts +0 -2
- package/dist/assets/icons/File.js +0 -32
- package/dist/assets/icons/Grid.d.ts +0 -2
- package/dist/assets/icons/Highlight.d.ts +0 -2
- package/dist/assets/icons/Highlight.js +0 -30
- package/dist/assets/icons/HighlightOn.d.ts +0 -6
- package/dist/assets/icons/HighlightOn.js +0 -55
- package/dist/assets/icons/Home.d.ts +0 -2
- package/dist/assets/icons/Home.js +0 -30
- package/dist/assets/icons/Image.d.ts +0 -2
- package/dist/assets/icons/ImageError.d.ts +0 -2
- package/dist/assets/icons/Info.d.ts +0 -2
- package/dist/assets/icons/Info.js +0 -41
- package/dist/assets/icons/Italic.d.ts +0 -2
- package/dist/assets/icons/Italic.js +0 -30
- package/dist/assets/icons/Link.d.ts +0 -2
- package/dist/assets/icons/Link.js +0 -30
- package/dist/assets/icons/Loader.d.ts +0 -2
- package/dist/assets/icons/MapPin.d.ts +0 -2
- package/dist/assets/icons/Menu.d.ts +0 -2
- package/dist/assets/icons/Menu.js +0 -30
- package/dist/assets/icons/Minus.d.ts +0 -2
- package/dist/assets/icons/MoreHoriz.d.ts +0 -2
- package/dist/assets/icons/NumberedList.d.ts +0 -2
- package/dist/assets/icons/NumberedList.js +0 -30
- package/dist/assets/icons/Pause.d.ts +0 -2
- package/dist/assets/icons/Plus.d.ts +0 -2
- package/dist/assets/icons/PointerHorizontal.d.ts +0 -2
- package/dist/assets/icons/PointerHorizontal.js +0 -30
- package/dist/assets/icons/PointerVertical.d.ts +0 -2
- package/dist/assets/icons/PointerVertical.js +0 -30
- package/dist/assets/icons/Retry.d.ts +0 -2
- package/dist/assets/icons/Search.d.ts +0 -2
- package/dist/assets/icons/Search.js +0 -30
- package/dist/assets/icons/Send.d.ts +0 -2
- package/dist/assets/icons/Send.js +0 -32
- package/dist/assets/icons/Share.d.ts +0 -2
- package/dist/assets/icons/Slash.d.ts +0 -2
- package/dist/assets/icons/Strikethrough.d.ts +0 -2
- package/dist/assets/icons/Strikethrough.js +0 -30
- package/dist/assets/icons/TextColor.d.ts +0 -6
- package/dist/assets/icons/TextColor.js +0 -52
- package/dist/assets/icons/Today.d.ts +0 -2
- package/dist/assets/icons/Today.js +0 -30
- package/dist/assets/icons/Trash.d.ts +0 -2
- package/dist/assets/icons/Underlined.d.ts +0 -2
- package/dist/assets/icons/Underlined.js +0 -32
- package/dist/assets/icons/Upload.d.ts +0 -2
- package/dist/assets/icons/Upload.js +0 -39
- package/dist/assets/icons/User.d.ts +0 -2
- package/dist/assets/icons/Visibility.d.ts +0 -2
- package/dist/assets/icons/Visibility.js +0 -30
- package/dist/assets/icons/VisibilityOff.d.ts +0 -2
- package/dist/assets/icons/VisibilityOff.js +0 -30
- package/dist/assets/icons/WarningFilled.d.ts +0 -2
- package/dist/assets/icons/WarningFilled.js +0 -32
- package/dist/assets/icons/WarningOutlined.d.ts +0 -2
- /package/dist/{hooks/useAutosave.spec.d.ts → rhf/entrypoints.type-test.d.ts} +0 -0
|
@@ -2,6 +2,7 @@ import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
|
2
2
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
3
3
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
4
4
|
import "../../../../config/i18n.js";
|
|
5
|
+
import { FieldController } from "../../shared/form.binding.js";
|
|
5
6
|
import { FormField } from "../../FormField/FormField.js";
|
|
6
7
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
7
8
|
import { datePickerInputContentRowDefinition } from "../shared/datePickerInput.cva.js";
|
|
@@ -13,16 +14,14 @@ import { getStaticDateRangeSegments, getStaticDateTimeFocusTarget } from "../sha
|
|
|
13
14
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
14
15
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
15
16
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
16
|
-
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
17
17
|
import { RangeCalendar } from "../shared/RangeCalendar.js";
|
|
18
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
18
|
import { clsx } from "clsx";
|
|
20
19
|
import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
21
20
|
import { Button } from "react-aria-components";
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
22
|
import { useDateRangePicker, useLocale as useLocale$1 } from "react-aria";
|
|
23
23
|
import { mergeRefs } from "@react-aria/utils";
|
|
24
24
|
import { useTranslation } from "react-i18next";
|
|
25
|
-
import { Controller } from "react-hook-form";
|
|
26
25
|
import { createCalendar, endOfMonth, endOfWeek, endOfYear, getLocalTimeZone, startOfMonth, startOfWeek, startOfYear, toCalendarDate, today } from "@internationalized/date";
|
|
27
26
|
import { DateTime } from "luxon";
|
|
28
27
|
import { useDateRangePickerState, useRangeCalendarState } from "react-stately";
|
|
@@ -30,7 +29,7 @@ import { useDateRangePickerState, useRangeCalendarState } from "react-stately";
|
|
|
30
29
|
var DateRangePickerBase = (props) => {
|
|
31
30
|
const ui = UIConfig.useConfig();
|
|
32
31
|
const { t } = useTranslation();
|
|
33
|
-
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,
|
|
32
|
+
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, isClearableIfDisabled, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, autoFixYear: autoFixYearProp, allowPartialRange: allowPartialRangeProp, minValue, maxValue, ...rest } = props;
|
|
34
33
|
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
35
34
|
const variant = variantProp ?? ui.input.variant;
|
|
36
35
|
const as = asProp ?? ui.input.as;
|
|
@@ -43,7 +42,6 @@ var DateRangePickerBase = (props) => {
|
|
|
43
42
|
const shouldForceLeadingZeros = shouldForceLeadingZerosProp ?? ui.dateInput.shouldForceLeadingZeros;
|
|
44
43
|
const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
|
|
45
44
|
const autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
|
|
46
|
-
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
|
|
47
45
|
const allowPartialRange = allowPartialRangeProp ?? ui.dateInput.allowPartialRange;
|
|
48
46
|
const timeZone = ui.dateInput.timeZone;
|
|
49
47
|
let effectiveTimeZone = getLocalTimeZone();
|
|
@@ -77,7 +75,6 @@ var DateRangePickerBase = (props) => {
|
|
|
77
75
|
onChange?.(newValue);
|
|
78
76
|
if (isInvalidRange) return;
|
|
79
77
|
handleCalendarStatesChange(newValue);
|
|
80
|
-
if (fireBlurOnChange) debouncedBlur(newValue);
|
|
81
78
|
},
|
|
82
79
|
shouldCloseOnSelect: false
|
|
83
80
|
});
|
|
@@ -105,7 +102,6 @@ var DateRangePickerBase = (props) => {
|
|
|
105
102
|
if (partialRange.start && partialRange.end) return;
|
|
106
103
|
const newValue_0 = partialRange.start || partialRange.end ? partialRange : null;
|
|
107
104
|
onChange?.(newValue_0);
|
|
108
|
-
if (fireBlurOnChange) debouncedBlur(newValue_0);
|
|
109
105
|
};
|
|
110
106
|
const { locale } = useLocale$1();
|
|
111
107
|
useImperativeHandle(ref, () => ({
|
|
@@ -117,7 +113,6 @@ var DateRangePickerBase = (props) => {
|
|
|
117
113
|
const handleBlur = (newValue_1) => {
|
|
118
114
|
onBlur?.({ target: { value: newValue_1 } });
|
|
119
115
|
};
|
|
120
|
-
const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
|
|
121
116
|
const formFieldProps = {
|
|
122
117
|
error: error || validationRangeError,
|
|
123
118
|
label,
|
|
@@ -429,7 +424,6 @@ var DateRangePickerBase = (props) => {
|
|
|
429
424
|
}
|
|
430
425
|
}
|
|
431
426
|
state.toggle();
|
|
432
|
-
if (fireBlurOnChange) handleBlur(valueToApply);
|
|
433
427
|
};
|
|
434
428
|
const onTodayPress = () => {
|
|
435
429
|
const todayDate = today(effectiveTimeZone);
|
|
@@ -457,7 +451,6 @@ var DateRangePickerBase = (props) => {
|
|
|
457
451
|
isSelecting: false
|
|
458
452
|
});
|
|
459
453
|
setHoverDate(null);
|
|
460
|
-
if (fireBlurOnChange) handleBlur(null);
|
|
461
454
|
};
|
|
462
455
|
const syncSelectionFromControlledValue = () => {
|
|
463
456
|
const currentValue = state.value;
|
|
@@ -656,6 +649,7 @@ var DateRangePickerBase = (props) => {
|
|
|
656
649
|
variant,
|
|
657
650
|
size,
|
|
658
651
|
isClearable,
|
|
652
|
+
isClearableIfDisabled,
|
|
659
653
|
headerProps,
|
|
660
654
|
todayIcon,
|
|
661
655
|
todayIconButtonSize,
|
|
@@ -668,7 +662,6 @@ var DateRangePickerBase = (props) => {
|
|
|
668
662
|
className: inputClassName,
|
|
669
663
|
onOpenDropdown,
|
|
670
664
|
timeZone: effectiveTimeZone,
|
|
671
|
-
fireBlurOnChange,
|
|
672
665
|
onClear: onInputClear
|
|
673
666
|
}), /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
674
667
|
hideSidebar,
|
|
@@ -812,6 +805,7 @@ var DateRangePickerInner = ({ fullIso = true, minValue, maxValue, renderStaticIn
|
|
|
812
805
|
});
|
|
813
806
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
814
807
|
...props,
|
|
808
|
+
onClear: () => props.onChange?.(null),
|
|
815
809
|
isDisabled,
|
|
816
810
|
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
817
811
|
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
@@ -855,20 +849,20 @@ var DateRangePickerInner = ({ fullIso = true, minValue, maxValue, renderStaticIn
|
|
|
855
849
|
});
|
|
856
850
|
};
|
|
857
851
|
var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput, ...props }) => {
|
|
858
|
-
if ("
|
|
859
|
-
const {
|
|
860
|
-
const controlWithOptions =
|
|
861
|
-
return /* @__PURE__ */ jsx(
|
|
862
|
-
control:
|
|
863
|
-
name:
|
|
864
|
-
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DateRangePickerInner, {
|
|
852
|
+
if ("field" in props && props.field) {
|
|
853
|
+
const { field, ref, ...innerProps } = props;
|
|
854
|
+
const controlWithOptions = field.form;
|
|
855
|
+
return /* @__PURE__ */ jsx(FieldController, {
|
|
856
|
+
control: field.form,
|
|
857
|
+
name: field.name,
|
|
858
|
+
render: ({ field: field_0, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DateRangePickerInner, {
|
|
865
859
|
...innerProps,
|
|
866
|
-
ref: mergeRefs(ref,
|
|
867
|
-
value:
|
|
868
|
-
onChange:
|
|
869
|
-
onBlur:
|
|
860
|
+
ref: mergeRefs(ref, field_0.ref),
|
|
861
|
+
value: field_0.value ?? null,
|
|
862
|
+
onChange: (value) => field_0.onChange(value ?? null),
|
|
863
|
+
onBlur: field_0.onBlur,
|
|
870
864
|
isDirty,
|
|
871
|
-
isDisabled:
|
|
865
|
+
isDisabled: field_0.disabled || props.isDisabled,
|
|
872
866
|
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
873
867
|
error: props.error ?? error?.message,
|
|
874
868
|
fullIso,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FocusEvent, Ref } from 'react';
|
|
2
2
|
import { DateValue } from 'react-aria';
|
|
3
|
-
import { FieldValues } from '
|
|
3
|
+
import { FieldValues } from '../../shared/form.binding';
|
|
4
4
|
import { DatePickerStateOptions } from 'react-stately';
|
|
5
5
|
import { DatePickerInputHandle } from '../shared/DatePickerInput';
|
|
6
6
|
import { DatePickerTodayIcon, DatePickerTodayIconButtonComponent, DatePickerTodayIconButtonSize, DatePickerTodayIconPlacement } from '../shared/datePicker.types';
|
|
@@ -12,6 +12,7 @@ interface DateTimePickerBaseProps extends FormFieldProps, InputVariantProps, Omi
|
|
|
12
12
|
disableDropdown?: boolean;
|
|
13
13
|
isTimeOptional?: boolean;
|
|
14
14
|
isClearable?: boolean;
|
|
15
|
+
isClearableIfDisabled?: boolean;
|
|
15
16
|
todayIcon?: DatePickerTodayIcon;
|
|
16
17
|
todayIconButtonSize?: DatePickerTodayIconButtonSize;
|
|
17
18
|
todayIconButtonComponent?: DatePickerTodayIconButtonComponent;
|
|
@@ -27,7 +28,6 @@ interface DateTimePickerBaseProps extends FormFieldProps, InputVariantProps, Omi
|
|
|
27
28
|
timeZone?: string;
|
|
28
29
|
format?: string;
|
|
29
30
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
30
|
-
fireBlurOnChange?: boolean;
|
|
31
31
|
}
|
|
32
32
|
export interface DateTimePickerProps extends Omit<DateTimePickerBaseProps, "value" | "onChange"> {
|
|
33
33
|
value?: string | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
|
+
import { FieldController } from "../../shared/form.binding.js";
|
|
3
4
|
import { FormField } from "../../FormField/FormField.js";
|
|
4
5
|
import { Calendar } from "../shared/Calendar.js";
|
|
5
6
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
@@ -12,19 +13,17 @@ import { getStaticCalendarDateTimeSegments, getStaticDateTimeFocusTarget } from
|
|
|
12
13
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
13
14
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
14
15
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
15
|
-
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
16
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
16
|
import { clsx } from "clsx";
|
|
18
17
|
import { useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
18
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
import { useDatePicker, useLocale } from "react-aria";
|
|
20
20
|
import { mergeRefs } from "@react-aria/utils";
|
|
21
|
-
import { Controller } from "react-hook-form";
|
|
22
21
|
import { Time, createCalendar, getLocalTimeZone, toCalendarDate, toCalendarDateTime, today } from "@internationalized/date";
|
|
23
22
|
import { useCalendarState, useDatePickerState } from "react-stately";
|
|
24
23
|
//#region src/components/inputs/DateTime/DateTimePicker/DateTimePicker.tsx
|
|
25
24
|
var DateTimePickerBase = (props) => {
|
|
26
25
|
const ui = UIConfig.useConfig();
|
|
27
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, isTimeOptional, placeholder, inputClassName, shouldShrinkInput, hideLabel: hideLabelProp, variant: variantProp, as: asProp, size: sizeProp, isClearable: isClearableProp, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, timeZone: timeZoneProp, autoFixYear: autoFixYearProp,
|
|
26
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, isTimeOptional, placeholder, inputClassName, shouldShrinkInput, hideLabel: hideLabelProp, variant: variantProp, as: asProp, size: sizeProp, isClearable: isClearableProp, isClearableIfDisabled, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, timeZone: timeZoneProp, autoFixYear: autoFixYearProp, format, setDateValueOnDateSelection: setDateValueOnDateSelectionProp, ...rest } = props;
|
|
28
27
|
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
29
28
|
const variant = variantProp ?? ui.input.variant;
|
|
30
29
|
const as = asProp ?? ui.input.as;
|
|
@@ -38,7 +37,6 @@ var DateTimePickerBase = (props) => {
|
|
|
38
37
|
const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
|
|
39
38
|
const shouldUpdateDateOnMonthYearChange = shouldUpdateDateOnMonthYearChangeProp ?? ui.dateInput.shouldUpdateDateOnMonthYearChange;
|
|
40
39
|
const autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
|
|
41
|
-
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
|
|
42
40
|
const setDateValueOnDateSelection = setDateValueOnDateSelectionProp ?? ui.dateInput.setDateValueOnDateSelection;
|
|
43
41
|
const timeZone = timeZoneProp ?? ui.dateInput.timeZone;
|
|
44
42
|
let effectiveTimeZone = getLocalTimeZone();
|
|
@@ -69,7 +67,6 @@ var DateTimePickerBase = (props) => {
|
|
|
69
67
|
const handleBlur = (val) => {
|
|
70
68
|
onBlur?.({ target: { value: val } });
|
|
71
69
|
};
|
|
72
|
-
const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
|
|
73
70
|
const normalizedValue = value ?? null;
|
|
74
71
|
const dialogState = useDatePickerState({
|
|
75
72
|
...rest,
|
|
@@ -90,7 +87,6 @@ var DateTimePickerBase = (props) => {
|
|
|
90
87
|
onChange?.(val_0);
|
|
91
88
|
dialogState.setValue(val_0);
|
|
92
89
|
calendarState.setFocusedDate(val_0 || today(effectiveTimeZone));
|
|
93
|
-
if (fireBlurOnChange) debouncedBlur(val_0);
|
|
94
90
|
},
|
|
95
91
|
shouldCloseOnSelect: false,
|
|
96
92
|
granularity: "minute",
|
|
@@ -126,10 +122,10 @@ var DateTimePickerBase = (props) => {
|
|
|
126
122
|
labelProps
|
|
127
123
|
};
|
|
128
124
|
const onApply = () => {
|
|
129
|
-
const newValue = dialogState.value;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
125
|
+
const newValue = dialogState.value ?? null;
|
|
126
|
+
onChange?.(newValue);
|
|
127
|
+
dialogState.setValue(newValue);
|
|
128
|
+
state.close();
|
|
133
129
|
};
|
|
134
130
|
const onMonthYearChange = (selectedDate) => {
|
|
135
131
|
if (!shouldUpdateDateOnMonthYearChange) return;
|
|
@@ -154,7 +150,6 @@ var DateTimePickerBase = (props) => {
|
|
|
154
150
|
const onInputClear = () => {
|
|
155
151
|
onChange?.(null);
|
|
156
152
|
dialogState.setValue(null);
|
|
157
|
-
if (fireBlurOnChange) handleBlur(null);
|
|
158
153
|
};
|
|
159
154
|
const syncDialogFromControlledValue = () => {
|
|
160
155
|
dialogState.setValue(state.value);
|
|
@@ -210,6 +205,7 @@ var DateTimePickerBase = (props) => {
|
|
|
210
205
|
isDateTime: true,
|
|
211
206
|
shouldShrinkInput,
|
|
212
207
|
isClearable,
|
|
208
|
+
isClearableIfDisabled,
|
|
213
209
|
headerProps,
|
|
214
210
|
todayIcon,
|
|
215
211
|
todayIconButtonSize,
|
|
@@ -224,7 +220,6 @@ var DateTimePickerBase = (props) => {
|
|
|
224
220
|
timeZone: effectiveTimeZone,
|
|
225
221
|
isTimeOptional,
|
|
226
222
|
format,
|
|
227
|
-
fireBlurOnChange,
|
|
228
223
|
onClear: onInputClear
|
|
229
224
|
}), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
230
225
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
@@ -314,6 +309,7 @@ var DateTimePickerInner = ({ fullIso: _fullIso = true, renderStaticInput, isForm
|
|
|
314
309
|
});
|
|
315
310
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
316
311
|
...props,
|
|
312
|
+
onClear: () => props.onChange?.(null),
|
|
317
313
|
isDisabled,
|
|
318
314
|
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
319
315
|
inputClassName: clsx(props.shouldShrinkInput ? "min-w-0" : "min-w-input-width-min-width", props.inputClassName),
|
|
@@ -356,20 +352,20 @@ var DateTimePickerInner = ({ fullIso: _fullIso = true, renderStaticInput, isForm
|
|
|
356
352
|
});
|
|
357
353
|
};
|
|
358
354
|
var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
|
|
359
|
-
if ("
|
|
360
|
-
const {
|
|
361
|
-
const controlWithOptions =
|
|
362
|
-
return /* @__PURE__ */ jsx(
|
|
363
|
-
control:
|
|
364
|
-
name:
|
|
365
|
-
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DateTimePickerInner, {
|
|
355
|
+
if ("field" in props && props.field) {
|
|
356
|
+
const { field, ref, ...innerProps } = props;
|
|
357
|
+
const controlWithOptions = field.form;
|
|
358
|
+
return /* @__PURE__ */ jsx(FieldController, {
|
|
359
|
+
control: field.form,
|
|
360
|
+
name: field.name,
|
|
361
|
+
render: ({ field: field_0, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DateTimePickerInner, {
|
|
366
362
|
...innerProps,
|
|
367
|
-
ref: mergeRefs(ref,
|
|
368
|
-
value:
|
|
369
|
-
onChange:
|
|
370
|
-
onBlur:
|
|
363
|
+
ref: mergeRefs(ref, field_0.ref),
|
|
364
|
+
value: field_0.value ?? null,
|
|
365
|
+
onChange: (value) => field_0.onChange(value ?? null),
|
|
366
|
+
onBlur: field_0.onBlur,
|
|
371
367
|
isDirty,
|
|
372
|
-
isDisabled:
|
|
368
|
+
isDisabled: field_0.disabled || props.isDisabled,
|
|
373
369
|
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
374
370
|
error: props.error ?? error?.message,
|
|
375
371
|
fullIso,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref, FocusEvent } from 'react';
|
|
2
2
|
import { AriaTimeFieldProps, TimeValue } from 'react-aria';
|
|
3
|
-
import { FieldValues } from '
|
|
3
|
+
import { FieldValues } from '../../shared/form.binding';
|
|
4
4
|
import { FormFieldProps } from '../../FormField/FormField';
|
|
5
5
|
import { ControlProps } from '../../shared/form.types';
|
|
6
6
|
import { InputVariantProps } from '../../shared/input.cva';
|
|
@@ -9,12 +9,12 @@ interface TimePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<Ar
|
|
|
9
9
|
disableDropdown?: boolean;
|
|
10
10
|
date?: string | null;
|
|
11
11
|
isClearable?: boolean;
|
|
12
|
+
isClearableIfDisabled?: boolean;
|
|
12
13
|
isDirty?: boolean;
|
|
13
14
|
disableManualEntry?: boolean;
|
|
14
15
|
placeholder?: string;
|
|
15
16
|
inputClassName?: string;
|
|
16
17
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
17
|
-
fireBlurOnChange?: boolean;
|
|
18
18
|
shouldForceLeadingZeros?: boolean;
|
|
19
19
|
}
|
|
20
20
|
export interface TimePickerProps extends Omit<TimePickerBaseProps, "value" | "onChange"> {
|