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