@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
|
@@ -1,32 +1,31 @@
|
|
|
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 { checkboxContentRowDefinition, checkboxContentWrapperDefinition, checkboxGroupLabelDefinition } from "./checkbox.cva.js";
|
|
4
5
|
import { CheckboxBase } from "./Checkbox.js";
|
|
5
6
|
import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
|
|
6
7
|
import { FormField } from "../FormField/FormField.js";
|
|
7
8
|
import { inputBaseDefinition, inputSizeDefinition } from "../shared/input.cva.js";
|
|
8
|
-
import { c } from "react/compiler-runtime";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import { clsx } from "clsx";
|
|
11
10
|
import { CheckboxGroup } from "react-aria-components";
|
|
11
|
+
import { c } from "react/compiler-runtime";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { useLabel } from "react-aria";
|
|
13
14
|
import { mergeRefs } from "@react-aria/utils";
|
|
14
|
-
import { Controller } from "react-hook-form";
|
|
15
15
|
//#region src/components/inputs/Checkbox/CheckboxGroup.tsx
|
|
16
16
|
var CheckboxGroupBase = (props) => {
|
|
17
|
-
const $ = c(
|
|
17
|
+
const $ = c(99);
|
|
18
18
|
const ui = UIConfig.useConfig();
|
|
19
19
|
const checkboxContentWrapperCva = UIOverrides.useCva("checkbox.contentWrapperCva", checkboxContentWrapperDefinition);
|
|
20
20
|
const checkboxContentRowCva = UIOverrides.useCva("checkbox.contentRowCva", checkboxContentRowDefinition);
|
|
21
21
|
const checkboxGroupLabelCva = UIOverrides.useCva("checkbox.groupLabelCva", checkboxGroupLabelDefinition);
|
|
22
22
|
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
23
23
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
24
|
-
const { ref, label, tooltipText, helperText, isDirty, isRequired, rightContent, isDisabled, headerClassName, errorClassName, labelClassName, inputClassName, isHeaderHidden, error, className, options, allValue, value, defaultValue, onChange, onBlur,
|
|
24
|
+
const { ref, label, tooltipText, helperText, isDirty, isRequired, rightContent, isDisabled, headerClassName, errorClassName, labelClassName, inputClassName, isHeaderHidden, error, className, options, allValue, value, defaultValue, onChange, onBlur, as: asProp, size: sizeProp, variant: variantProp, hideLabel: hideLabelProp, ...rest } = props;
|
|
25
25
|
const as = asProp ?? ui.input.as;
|
|
26
26
|
const size = sizeProp ?? ui.input.size;
|
|
27
27
|
const variant = variantProp ?? ui.checkbox.variant;
|
|
28
28
|
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
29
|
-
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.checkbox.fireBlurOnChange;
|
|
30
29
|
let optionValues;
|
|
31
30
|
let resolvedValue;
|
|
32
31
|
let t0;
|
|
@@ -122,19 +121,16 @@ var CheckboxGroupBase = (props) => {
|
|
|
122
121
|
} else t5 = $[31];
|
|
123
122
|
const headerProps = t5;
|
|
124
123
|
let t6;
|
|
125
|
-
if ($[32] !== allValue || $[33] !==
|
|
124
|
+
if ($[32] !== allValue || $[33] !== onChange || $[34] !== optionValues) {
|
|
126
125
|
t6 = (nextValue) => {
|
|
127
126
|
const hasAllOptions = allValue !== void 0 && optionValues.length > 0 && optionValues.every((optionValue) => nextValue.includes(optionValue));
|
|
128
127
|
onChange?.(hasAllOptions ? allValue : nextValue);
|
|
129
|
-
if (fireBlurOnChange) onBlur?.({});
|
|
130
128
|
};
|
|
131
129
|
$[32] = allValue;
|
|
132
|
-
$[33] =
|
|
133
|
-
$[34] =
|
|
134
|
-
$[35] =
|
|
135
|
-
|
|
136
|
-
$[37] = t6;
|
|
137
|
-
} else t6 = $[37];
|
|
130
|
+
$[33] = onChange;
|
|
131
|
+
$[34] = optionValues;
|
|
132
|
+
$[35] = t6;
|
|
133
|
+
} else t6 = $[35];
|
|
138
134
|
const handleChange = t6;
|
|
139
135
|
const T0 = CheckboxGroup;
|
|
140
136
|
const t7 = !!error;
|
|
@@ -144,26 +140,26 @@ var CheckboxGroupBase = (props) => {
|
|
|
144
140
|
const T1 = FormField;
|
|
145
141
|
const t11 = as === "inline" && "h-full";
|
|
146
142
|
let t12;
|
|
147
|
-
if ($[
|
|
143
|
+
if ($[36] !== className || $[37] !== t11) {
|
|
148
144
|
t12 = clsx("w-full", t11, className);
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
} else t12 = $[
|
|
145
|
+
$[36] = className;
|
|
146
|
+
$[37] = t11;
|
|
147
|
+
$[38] = t12;
|
|
148
|
+
} else t12 = $[38];
|
|
153
149
|
const t13 = as === "inline" ? -1 : void 0;
|
|
154
150
|
let t14;
|
|
155
|
-
if ($[
|
|
151
|
+
if ($[39] !== as || $[40] !== inputBaseCva || $[41] !== inputClassName || $[42] !== shouldRenderInputFrame || $[43] !== ui) {
|
|
156
152
|
t14 = clsx("group/checkbox-group-content relative", shouldRenderInputFrame && inputBaseCva({
|
|
157
153
|
variant: ui.input.variant,
|
|
158
154
|
as
|
|
159
155
|
}), inputClassName);
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
} else t14 = $[
|
|
156
|
+
$[39] = as;
|
|
157
|
+
$[40] = inputBaseCva;
|
|
158
|
+
$[41] = inputClassName;
|
|
159
|
+
$[42] = shouldRenderInputFrame;
|
|
160
|
+
$[43] = ui;
|
|
161
|
+
$[44] = t14;
|
|
162
|
+
} else t14 = $[44];
|
|
167
163
|
const t15 = "";
|
|
168
164
|
const t16 = isDisabled || void 0;
|
|
169
165
|
const t17 = isDisabled || void 0;
|
|
@@ -183,20 +179,20 @@ var CheckboxGroupBase = (props) => {
|
|
|
183
179
|
const t22 = isDirty || void 0;
|
|
184
180
|
const t23 = isRequired || void 0;
|
|
185
181
|
let t24;
|
|
186
|
-
if ($[
|
|
182
|
+
if ($[45] !== as || $[46] !== checkboxGroupLabelCva || $[47] !== headerClassName || $[48] !== headerProps || $[49] !== size) {
|
|
187
183
|
t24 = as && ["filter", "floating"].includes(as) && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
188
184
|
...headerProps,
|
|
189
185
|
as: as === "floating" ? "filter" : as,
|
|
190
186
|
size,
|
|
191
187
|
className: clsx(headerClassName, checkboxGroupLabelCva({ as }))
|
|
192
188
|
});
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
} else t24 = $[
|
|
189
|
+
$[45] = as;
|
|
190
|
+
$[46] = checkboxGroupLabelCva;
|
|
191
|
+
$[47] = headerClassName;
|
|
192
|
+
$[48] = headerProps;
|
|
193
|
+
$[49] = size;
|
|
194
|
+
$[50] = t24;
|
|
195
|
+
} else t24 = $[50];
|
|
200
196
|
const t25 = checkboxContentRowCva({
|
|
201
197
|
variant,
|
|
202
198
|
as,
|
|
@@ -204,9 +200,9 @@ var CheckboxGroupBase = (props) => {
|
|
|
204
200
|
...rest
|
|
205
201
|
});
|
|
206
202
|
let t26;
|
|
207
|
-
if ($[
|
|
203
|
+
if ($[51] !== hideLabel || $[52] !== labelClassName || $[53] !== options || $[54] !== variant) {
|
|
208
204
|
let t27;
|
|
209
|
-
if ($[
|
|
205
|
+
if ($[56] !== hideLabel || $[57] !== labelClassName || $[58] !== variant) {
|
|
210
206
|
t27 = (option_0) => /* @__PURE__ */ jsx(CheckboxBase, {
|
|
211
207
|
value: option_0.value,
|
|
212
208
|
variant,
|
|
@@ -215,45 +211,45 @@ var CheckboxGroupBase = (props) => {
|
|
|
215
211
|
labelClassName,
|
|
216
212
|
children: option_0.label
|
|
217
213
|
}, option_0.value);
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
} else t27 = $[
|
|
214
|
+
$[56] = hideLabel;
|
|
215
|
+
$[57] = labelClassName;
|
|
216
|
+
$[58] = variant;
|
|
217
|
+
$[59] = t27;
|
|
218
|
+
} else t27 = $[59];
|
|
223
219
|
t26 = options.map(t27);
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
} else t26 = $[
|
|
220
|
+
$[51] = hideLabel;
|
|
221
|
+
$[52] = labelClassName;
|
|
222
|
+
$[53] = options;
|
|
223
|
+
$[54] = variant;
|
|
224
|
+
$[55] = t26;
|
|
225
|
+
} else t26 = $[55];
|
|
230
226
|
let t27;
|
|
231
|
-
if ($[
|
|
227
|
+
if ($[60] !== t25 || $[61] !== t26) {
|
|
232
228
|
t27 = /* @__PURE__ */ jsx("div", {
|
|
233
229
|
className: t25,
|
|
234
230
|
children: t26
|
|
235
231
|
});
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
} else t27 = $[
|
|
232
|
+
$[60] = t25;
|
|
233
|
+
$[61] = t26;
|
|
234
|
+
$[62] = t27;
|
|
235
|
+
} else t27 = $[62];
|
|
240
236
|
let t28;
|
|
241
|
-
if ($[
|
|
237
|
+
if ($[63] !== t21 || $[64] !== t22 || $[65] !== t23 || $[66] !== t24 || $[67] !== t27) {
|
|
242
238
|
t28 = /* @__PURE__ */ jsxs("div", {
|
|
243
239
|
className: t21,
|
|
244
240
|
"data-is-dirty": t22,
|
|
245
241
|
"data-is-required": t23,
|
|
246
242
|
children: [t24, t27]
|
|
247
243
|
});
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
} else t28 = $[
|
|
244
|
+
$[63] = t21;
|
|
245
|
+
$[64] = t22;
|
|
246
|
+
$[65] = t23;
|
|
247
|
+
$[66] = t24;
|
|
248
|
+
$[67] = t27;
|
|
249
|
+
$[68] = t28;
|
|
250
|
+
} else t28 = $[68];
|
|
255
251
|
let t29;
|
|
256
|
-
if ($[
|
|
252
|
+
if ($[69] !== t14 || $[70] !== t16 || $[71] !== t17 || $[72] !== t18 || $[73] !== t19 || $[74] !== t28) {
|
|
257
253
|
t29 = /* @__PURE__ */ jsx("div", {
|
|
258
254
|
className: t14,
|
|
259
255
|
"data-rac": t15,
|
|
@@ -264,16 +260,16 @@ var CheckboxGroupBase = (props) => {
|
|
|
264
260
|
"data-checkbox-group-content": t20,
|
|
265
261
|
children: t28
|
|
266
262
|
});
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
} else t29 = $[
|
|
263
|
+
$[69] = t14;
|
|
264
|
+
$[70] = t16;
|
|
265
|
+
$[71] = t17;
|
|
266
|
+
$[72] = t18;
|
|
267
|
+
$[73] = t19;
|
|
268
|
+
$[74] = t28;
|
|
269
|
+
$[75] = t29;
|
|
270
|
+
} else t29 = $[75];
|
|
275
271
|
let t30;
|
|
276
|
-
if ($[
|
|
272
|
+
if ($[76] !== T1 || $[77] !== as || $[78] !== formFieldProps || $[79] !== labelProps || $[80] !== t12 || $[81] !== t13 || $[82] !== t29) {
|
|
277
273
|
t30 = /* @__PURE__ */ jsx(T1, {
|
|
278
274
|
...formFieldProps,
|
|
279
275
|
as,
|
|
@@ -282,17 +278,17 @@ var CheckboxGroupBase = (props) => {
|
|
|
282
278
|
tabIndex: t13,
|
|
283
279
|
children: t29
|
|
284
280
|
});
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
} else t30 = $[
|
|
281
|
+
$[76] = T1;
|
|
282
|
+
$[77] = as;
|
|
283
|
+
$[78] = formFieldProps;
|
|
284
|
+
$[79] = labelProps;
|
|
285
|
+
$[80] = t12;
|
|
286
|
+
$[81] = t13;
|
|
287
|
+
$[82] = t29;
|
|
288
|
+
$[83] = t30;
|
|
289
|
+
} else t30 = $[83];
|
|
294
290
|
let t31;
|
|
295
|
-
if ($[
|
|
291
|
+
if ($[84] !== T0 || $[85] !== fieldProps || $[86] !== handleChange || $[87] !== isDisabled || $[88] !== isRequired || $[89] !== onBlur || $[90] !== ref || $[91] !== resolvedDefaultValue || $[92] !== resolvedValue || $[93] !== rest || $[94] !== t30 || $[95] !== t7 || $[96] !== t8 || $[97] !== t9) {
|
|
296
292
|
t31 = /* @__PURE__ */ jsx(T0, {
|
|
297
293
|
...rest,
|
|
298
294
|
...fieldProps,
|
|
@@ -309,55 +305,55 @@ var CheckboxGroupBase = (props) => {
|
|
|
309
305
|
className: t10,
|
|
310
306
|
children: t30
|
|
311
307
|
});
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
323
|
-
$[
|
|
324
|
-
$[
|
|
325
|
-
$[
|
|
326
|
-
$[
|
|
327
|
-
} else t31 = $[
|
|
308
|
+
$[84] = T0;
|
|
309
|
+
$[85] = fieldProps;
|
|
310
|
+
$[86] = handleChange;
|
|
311
|
+
$[87] = isDisabled;
|
|
312
|
+
$[88] = isRequired;
|
|
313
|
+
$[89] = onBlur;
|
|
314
|
+
$[90] = ref;
|
|
315
|
+
$[91] = resolvedDefaultValue;
|
|
316
|
+
$[92] = resolvedValue;
|
|
317
|
+
$[93] = rest;
|
|
318
|
+
$[94] = t30;
|
|
319
|
+
$[95] = t7;
|
|
320
|
+
$[96] = t8;
|
|
321
|
+
$[97] = t9;
|
|
322
|
+
$[98] = t31;
|
|
323
|
+
} else t31 = $[98];
|
|
328
324
|
return t31;
|
|
329
325
|
};
|
|
330
326
|
var CheckboxGroup$1 = (props) => {
|
|
331
327
|
const $ = c(15);
|
|
332
|
-
if ("
|
|
333
|
-
let
|
|
328
|
+
if ("field" in props && props.field) {
|
|
329
|
+
let field;
|
|
334
330
|
let innerProps;
|
|
335
331
|
let ref;
|
|
336
332
|
if ($[0] !== props) {
|
|
337
|
-
({
|
|
333
|
+
({field, ref, ...innerProps} = props);
|
|
338
334
|
$[0] = props;
|
|
339
|
-
$[1] =
|
|
335
|
+
$[1] = field;
|
|
340
336
|
$[2] = innerProps;
|
|
341
337
|
$[3] = ref;
|
|
342
338
|
} else {
|
|
343
|
-
|
|
339
|
+
field = $[1];
|
|
344
340
|
innerProps = $[2];
|
|
345
341
|
ref = $[3];
|
|
346
342
|
}
|
|
347
343
|
let t0;
|
|
348
344
|
if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
|
|
349
345
|
t0 = (t1) => {
|
|
350
|
-
const { field, fieldState: t2 } = t1;
|
|
346
|
+
const { field: field_0, fieldState: t2 } = t1;
|
|
351
347
|
const { error, isDirty } = t2;
|
|
352
348
|
return /* @__PURE__ */ jsx(CheckboxGroupBase, {
|
|
353
349
|
...innerProps,
|
|
354
|
-
ref: mergeRefs(ref,
|
|
355
|
-
value:
|
|
356
|
-
onChange:
|
|
357
|
-
onBlur:
|
|
358
|
-
name:
|
|
350
|
+
ref: mergeRefs(ref, field_0.ref),
|
|
351
|
+
value: field_0.value,
|
|
352
|
+
onChange: field_0.onChange,
|
|
353
|
+
onBlur: field_0.onBlur,
|
|
354
|
+
name: field_0.name,
|
|
359
355
|
isDirty,
|
|
360
|
-
isDisabled:
|
|
356
|
+
isDisabled: field_0.disabled || props.isDisabled,
|
|
361
357
|
error: props.error ?? error?.message
|
|
362
358
|
});
|
|
363
359
|
};
|
|
@@ -368,14 +364,14 @@ var CheckboxGroup$1 = (props) => {
|
|
|
368
364
|
$[8] = t0;
|
|
369
365
|
} else t0 = $[8];
|
|
370
366
|
let t1;
|
|
371
|
-
if ($[9] !==
|
|
372
|
-
t1 = /* @__PURE__ */ jsx(
|
|
373
|
-
control:
|
|
374
|
-
name:
|
|
367
|
+
if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
|
|
368
|
+
t1 = /* @__PURE__ */ jsx(FieldController, {
|
|
369
|
+
control: field.form,
|
|
370
|
+
name: field.name,
|
|
375
371
|
render: t0
|
|
376
372
|
});
|
|
377
|
-
$[9] =
|
|
378
|
-
$[10] =
|
|
373
|
+
$[9] = field.form;
|
|
374
|
+
$[10] = field.name;
|
|
379
375
|
$[11] = t0;
|
|
380
376
|
$[12] = t1;
|
|
381
377
|
} else t1 = $[12];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CalendarDate, DateValue } from '@internationalized/date';
|
|
2
2
|
import { FocusEvent, Ref } from 'react';
|
|
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 DatePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<Da
|
|
|
12
12
|
ref?: Ref<DatePickerInputHandle & HTMLDivElement>;
|
|
13
13
|
disableDropdown?: boolean;
|
|
14
14
|
isClearable?: boolean;
|
|
15
|
+
isClearableIfDisabled?: boolean;
|
|
15
16
|
className?: string;
|
|
16
17
|
todayIcon?: DatePickerTodayIcon;
|
|
17
18
|
todayIconButtonSize?: DatePickerTodayIconButtonSize;
|
|
@@ -26,7 +27,6 @@ interface DatePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<Da
|
|
|
26
27
|
shouldUpdateDateOnMonthYearChange?: boolean;
|
|
27
28
|
granularity?: DatePickerGranularity;
|
|
28
29
|
format?: string;
|
|
29
|
-
fireBlurOnChange?: boolean;
|
|
30
30
|
}
|
|
31
31
|
export interface DatePickerProps extends Omit<DatePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue"> {
|
|
32
32
|
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,20 +13,18 @@ import { getStaticCalendarDateSegments, 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 { useCallback, 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 { createCalendar, getLocalTimeZone, toCalendarDate, today } from "@internationalized/date";
|
|
23
22
|
import { DateTime } from "luxon";
|
|
24
23
|
import { useCalendarState, useDatePickerState } from "react-stately";
|
|
25
24
|
//#region src/components/inputs/DateTime/DatePicker/DatePicker.tsx
|
|
26
25
|
var DatePickerBase = (props) => {
|
|
27
26
|
const ui = UIConfig.useConfig();
|
|
28
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, placeholder, inputClassName, as: asProp, hideLabel: hideLabelProp, variant: variantProp, size: sizeProp, isClearable: isClearableProp, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, granularity: granularityProp, autoFixYear: autoFixYearProp,
|
|
27
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, placeholder, inputClassName, as: asProp, hideLabel: hideLabelProp, variant: variantProp, size: sizeProp, isClearable: isClearableProp, isClearableIfDisabled, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, granularity: granularityProp, autoFixYear: autoFixYearProp, format, ...rest } = props;
|
|
29
28
|
const as = asProp ?? ui.input.as;
|
|
30
29
|
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
31
30
|
const variant = variantProp ?? ui.input.variant;
|
|
@@ -40,7 +39,6 @@ var DatePickerBase = (props) => {
|
|
|
40
39
|
const shouldUpdateDateOnMonthYearChange = shouldUpdateDateOnMonthYearChangeProp ?? ui.dateInput.shouldUpdateDateOnMonthYearChange;
|
|
41
40
|
const granularity = granularityProp ?? ui.dateInput.granularity;
|
|
42
41
|
const autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
|
|
43
|
-
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
|
|
44
42
|
const timeZone = ui.dateInput.timeZone;
|
|
45
43
|
let effectiveTimeZone = getLocalTimeZone();
|
|
46
44
|
if (timeZone !== "clientLocal") effectiveTimeZone = timeZone;
|
|
@@ -78,7 +76,6 @@ var DatePickerBase = (props) => {
|
|
|
78
76
|
const handleBlur = (val) => {
|
|
79
77
|
onBlur?.({ target: { value: val } });
|
|
80
78
|
};
|
|
81
|
-
const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
|
|
82
79
|
const normalizedValue = value ?? null;
|
|
83
80
|
const dialogState = useDatePickerState({
|
|
84
81
|
...rest,
|
|
@@ -99,7 +96,6 @@ var DatePickerBase = (props) => {
|
|
|
99
96
|
}
|
|
100
97
|
onChange?.(normalizedValue_0);
|
|
101
98
|
dialogState.setValue(normalizedValue_0);
|
|
102
|
-
if (fireBlurOnChange) debouncedBlur(normalizedValue_0);
|
|
103
99
|
if (normalizedValue_0) {
|
|
104
100
|
calendarState.setFocusedDate(normalizedValue_0);
|
|
105
101
|
return;
|
|
@@ -139,7 +135,6 @@ var DatePickerBase = (props) => {
|
|
|
139
135
|
const newValue = dialogState.value ? normalizeByGranularity(dialogState.value) : dialogState.value;
|
|
140
136
|
state.setValue(newValue);
|
|
141
137
|
state.toggle();
|
|
142
|
-
if (fireBlurOnChange) handleBlur(newValue);
|
|
143
138
|
};
|
|
144
139
|
const onMonthYearChange = (selectedDate) => {
|
|
145
140
|
if (!(shouldUpdateDateOnMonthYearChange || granularity !== "day")) return;
|
|
@@ -161,7 +156,6 @@ var DatePickerBase = (props) => {
|
|
|
161
156
|
const onInputClear = () => {
|
|
162
157
|
onChange?.(null);
|
|
163
158
|
dialogState.setValue(null);
|
|
164
|
-
if (fireBlurOnChange) handleBlur(null);
|
|
165
159
|
};
|
|
166
160
|
const syncDialogFromControlledValue = () => {
|
|
167
161
|
dialogState.setValue(state.value);
|
|
@@ -233,6 +227,7 @@ var DatePickerBase = (props) => {
|
|
|
233
227
|
variant,
|
|
234
228
|
size,
|
|
235
229
|
isClearable,
|
|
230
|
+
isClearableIfDisabled,
|
|
236
231
|
headerProps,
|
|
237
232
|
todayIcon,
|
|
238
233
|
todayIconButtonSize,
|
|
@@ -244,7 +239,6 @@ var DatePickerBase = (props) => {
|
|
|
244
239
|
dateGranularity: granularity,
|
|
245
240
|
format,
|
|
246
241
|
timeZone: effectiveTimeZone,
|
|
247
|
-
fireBlurOnChange,
|
|
248
242
|
onClear: onInputClear
|
|
249
243
|
}), (!disableDropdown || disableManualEntry) && state.isOpen && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
250
244
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
@@ -347,6 +341,7 @@ var DatePickerInner = ({ fullIso = true, granularity = "day", minValue, maxValue
|
|
|
347
341
|
});
|
|
348
342
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
349
343
|
...props,
|
|
344
|
+
onClear: () => props.onChange?.(null),
|
|
350
345
|
isDisabled,
|
|
351
346
|
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
352
347
|
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
@@ -391,20 +386,20 @@ var DatePickerInner = ({ fullIso = true, granularity = "day", minValue, maxValue
|
|
|
391
386
|
});
|
|
392
387
|
};
|
|
393
388
|
var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, renderStaticInput, ...props }) => {
|
|
394
|
-
if ("
|
|
395
|
-
const {
|
|
396
|
-
const controlWithOptions =
|
|
397
|
-
return /* @__PURE__ */ jsx(
|
|
398
|
-
control:
|
|
399
|
-
name:
|
|
400
|
-
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DatePickerInner, {
|
|
389
|
+
if ("field" in props && props.field) {
|
|
390
|
+
const { field, ref, ...innerProps } = props;
|
|
391
|
+
const controlWithOptions = field.form;
|
|
392
|
+
return /* @__PURE__ */ jsx(FieldController, {
|
|
393
|
+
control: field.form,
|
|
394
|
+
name: field.name,
|
|
395
|
+
render: ({ field: field_0, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DatePickerInner, {
|
|
401
396
|
...innerProps,
|
|
402
|
-
ref: mergeRefs(ref,
|
|
403
|
-
value:
|
|
404
|
-
onChange:
|
|
405
|
-
onBlur:
|
|
397
|
+
ref: mergeRefs(ref, field_0.ref),
|
|
398
|
+
value: field_0.value ?? null,
|
|
399
|
+
onChange: (value) => field_0.onChange(value ?? null),
|
|
400
|
+
onBlur: field_0.onBlur,
|
|
406
401
|
isDirty,
|
|
407
|
-
isDisabled:
|
|
402
|
+
isDisabled: field_0.disabled || props.isDisabled,
|
|
408
403
|
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
409
404
|
error: props.error ?? error?.message,
|
|
410
405
|
fullIso,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CalendarDate } from '@internationalized/date';
|
|
2
2
|
import { FocusEvent, Ref } from 'react';
|
|
3
3
|
import { DateValue } from 'react-aria';
|
|
4
|
-
import { FieldValues } from '
|
|
4
|
+
import { FieldValues } from '../../shared/form.binding';
|
|
5
5
|
import { DateRangePickerStateOptions } from 'react-stately';
|
|
6
6
|
import { DatePickerInputHandle } from '../shared/DatePickerInput';
|
|
7
7
|
import { DatePickerTodayIcon, DatePickerTodayIconButtonComponent, DatePickerTodayIconButtonSize, DatePickerTodayIconPlacement } from '../shared/datePicker.types';
|
|
@@ -12,6 +12,7 @@ interface DateRangePickerBaseProps extends FormFieldProps, InputVariantProps, Om
|
|
|
12
12
|
ref?: Ref<DatePickerInputHandle & HTMLDivElement>;
|
|
13
13
|
disableDropdown?: boolean;
|
|
14
14
|
isClearable?: boolean;
|
|
15
|
+
isClearableIfDisabled?: boolean;
|
|
15
16
|
hideSidebar?: boolean;
|
|
16
17
|
className?: string;
|
|
17
18
|
todayIcon?: DatePickerTodayIcon;
|
|
@@ -24,7 +25,6 @@ interface DateRangePickerBaseProps extends FormFieldProps, InputVariantProps, Om
|
|
|
24
25
|
placeholder?: string;
|
|
25
26
|
inputClassName?: string;
|
|
26
27
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
27
|
-
fireBlurOnChange?: boolean;
|
|
28
28
|
allowPartialRange?: boolean;
|
|
29
29
|
}
|
|
30
30
|
export interface DateRangePickerProps extends Omit<DateRangePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue"> {
|