@povio/ui 2.3.3 → 3.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/AlignCenter.js +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +215 -64
- package/dist/components/Breadcrumbs/breadcrumbs.cva.d.ts +40 -14
- package/dist/components/Breadcrumbs/breadcrumbs.cva.js +21 -18
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +35 -12
- package/dist/components/Menu/MenuMobile.js +103 -44
- package/dist/components/Menu/MenuPopover.js +110 -34
- package/dist/components/Menu/menu.cva.d.ts +35 -13
- package/dist/components/Menu/menu.cva.js +30 -24
- package/dist/components/buttons/Button/Button.js +7 -7
- package/dist/components/buttons/Button/button.cva.d.ts +95 -26
- package/dist/components/buttons/Button/button.cva.js +601 -589
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +59 -21
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +33 -9
- package/dist/components/buttons/PillButton/pillButton.cva.js +247 -239
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +83 -25
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +3 -5
- package/dist/components/buttons/shared/buttonContent.cva.js +1 -8
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +203 -37
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +28 -14
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +26 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.js +47 -40
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +373 -75
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +492 -186
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +13 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +273 -47
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +7 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +611 -121
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +338 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +310 -103
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.js +286 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +13 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +358 -133
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +96 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +84 -30
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +214 -69
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +27 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +40 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +85 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +87 -44
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +151 -37
- package/dist/components/inputs/File/shared/InputUploadFilled.js +51 -10
- package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +26 -9
- package/dist/components/inputs/File/shared/fileUpload.cva.js +48 -40
- package/dist/components/inputs/File/shared/inputUploadButton.cva.d.ts +23 -6
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +29 -20
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +27 -7
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +28 -8
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +46 -15
- package/dist/components/inputs/FormField/formFieldError.cva.d.ts +12 -5
- package/dist/components/inputs/FormField/formFieldError.cva.js +11 -8
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +22 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +13 -0
- package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +12 -5
- package/dist/components/inputs/FormField/formFieldHelper.cva.js +11 -8
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +450 -100
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +575 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +12 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +4 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +309 -94
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +422 -93
- package/dist/components/inputs/Input/shared/InputContent.js +196 -63
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +356 -64
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +101 -6
- package/dist/components/inputs/RadioGroup/radio.cva.js +74 -24
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +214 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +107 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +37 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +178 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +225 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +396 -141
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +398 -119
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +88 -38
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +72 -19
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +73 -24
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +14 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +43 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +10 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +4 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectItem.cva.d.ts +16 -6
- package/dist/components/inputs/Selection/shared/selectItem.cva.js +21 -18
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +37 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +82 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +548 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -76
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +450 -101
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +105 -33
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +217 -40
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +15 -6
- package/dist/components/inputs/Toggle/toggle.cva.js +25 -21
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +23 -13
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +88 -12
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +137 -16
- package/dist/components/inputs/shared/input.cva.js +317 -273
- package/dist/components/inputs/shared/label.cva.d.ts +15 -6
- package/dist/components/inputs/shared/label.cva.js +28 -25
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +12 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +4 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +14 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +100 -0
- package/dist/components/navigation/Accordion/Accordion.js +71 -24
- package/dist/components/navigation/Accordion/AccordionItem.js +97 -52
- package/dist/components/navigation/Accordion/accordion.cva.d.ts +109 -44
- package/dist/components/navigation/Accordion/accordion.cva.js +114 -84
- package/dist/components/navigation/Stepper/Stepper.js +69 -24
- package/dist/components/navigation/Stepper/StepperItem.js +112 -39
- package/dist/components/navigation/Stepper/StepperSeparator.js +25 -7
- package/dist/components/navigation/Stepper/stepper.cva.d.ts +86 -30
- package/dist/components/navigation/Stepper/stepper.cva.js +104 -83
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/Modal/Modal.js +5 -5
- package/dist/components/overlays/Modal/modal.cva.d.ts +34 -9
- package/dist/components/overlays/Modal/modal.cva.js +38 -27
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +86 -30
- package/dist/components/overlays/Tooltip/Tooltip.js +143 -34
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/overlays/Tooltip/tooltip.cva.d.ts +45 -17
- package/dist/components/overlays/Tooltip/tooltip.cva.js +38 -26
- package/dist/components/segment/Segment.js +221 -60
- package/dist/components/segment/SegmentItem.js +70 -13
- package/dist/components/segment/segment.cva.d.ts +18 -7
- package/dist/components/segment/segment.cva.js +24 -21
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/shared/popover.cva.d.ts +7 -3
- package/dist/components/shared/popover.cva.js +3 -3
- package/dist/components/status/Alert/Alert.js +103 -36
- package/dist/components/status/Alert/alert.cva.d.ts +18 -6
- package/dist/components/status/Alert/alert.cva.js +60 -57
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Loader/loader.cva.d.ts +23 -4
- package/dist/components/status/Loader/loader.cva.js +22 -13
- package/dist/components/status/Toast/Toast.js +27 -20
- package/dist/components/status/Toast/toast.cva.d.ts +61 -10
- package/dist/components/status/Toast/toast.cva.js +129 -64
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/status/shared/status.cva.d.ts +30 -8
- package/dist/components/status/shared/status.cva.js +56 -50
- package/dist/components/table/CellText.js +3 -3
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/HeaderText.js +3 -3
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +34 -33
- package/dist/components/table/table.cva.d.ts +52 -19
- package/dist/components/table/table.cva.js +44 -35
- package/dist/components/text/Link/Link.js +22 -10
- package/dist/components/text/Link/link.cva.d.ts +11 -5
- package/dist/components/text/Link/link.cva.js +8 -5
- package/dist/components/text/Tag/Tag.js +3 -3
- package/dist/components/text/Tag/tag.cva.d.ts +15 -5
- package/dist/components/text/Tag/tag.cva.js +51 -48
- package/dist/components/text/Typography/Typography.js +25 -10
- package/dist/components/text/Typography/typography.cva.d.ts +93 -7
- package/dist/components/text/Typography/typography.cva.js +126 -122
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +20 -6
- package/dist/config/uiConfig.context.js +68 -14
- package/dist/config/uiOverrides.context.d.ts +192 -0
- package/dist/config/uiOverrides.context.js +113 -0
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +3 -0
- package/dist/hooks/useAutosave.d.ts +2 -1
- package/dist/hooks/useAutosave.js +12 -4
- package/dist/hooks/useAutosave.spec.d.ts +1 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.d.ts +3 -1
- package/dist/hooks/useFormAutosave.js +122 -30
- package/dist/hooks/useFormAutosave.spec.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useKeyInteractions.d.ts +20 -0
- package/dist/hooks/useKeyInteractions.js +54 -0
- package/dist/hooks/useKeyInteractions.spec.d.ts +1 -0
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +72 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +37 -1
- package/dist/index.js +34 -3
- package/dist/tw-ui-plugin.js +6 -0
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +136 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/dist/utils/style-merge.util.d.ts +43 -0
- package/dist/utils/style-merge.util.js +233 -0
- package/dist/utils/style-merge.util.spec.d.ts +1 -0
- package/package.json +1 -1
- package/dist/config/uiStyle.context.d.ts +0 -162
- package/dist/config/uiStyle.context.js +0 -30
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
1
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
2
3
|
import { Calendar } from "../shared/Calendar.js";
|
|
3
4
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
5
|
+
import { datePickerInputContentRow } from "../shared/datePickerInput.cva.js";
|
|
6
|
+
import { renderDatePickerTodayIcon } from "../shared/datePickerTodayIcon.js";
|
|
4
7
|
import { DatePickerInput } from "../shared/DatePickerInput.js";
|
|
5
8
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
6
9
|
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
10
|
+
import { getStaticCalendarDateSegments } from "../shared/staticDateTimeSegments.js";
|
|
7
11
|
import { FormField } from "../../FormField/FormField.js";
|
|
8
12
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
13
|
+
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
14
|
+
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
15
|
+
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
16
|
+
import { c } from "react/compiler-runtime";
|
|
9
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
18
|
import { clsx } from "clsx";
|
|
11
|
-
import { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from "react";
|
|
19
|
+
import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
12
20
|
import { useDatePicker, useLocale } from "react-aria";
|
|
13
21
|
import { mergeRefs } from "@react-aria/utils";
|
|
14
22
|
import { Controller } from "react-hook-form";
|
|
@@ -18,7 +26,25 @@ import { useCalendarState, useDatePickerState } from "react-stately";
|
|
|
18
26
|
//#region src/components/inputs/DateTime/DatePicker/DatePicker.tsx
|
|
19
27
|
var DatePickerBase = (props) => {
|
|
20
28
|
const ui = UIConfig.useConfig();
|
|
21
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, className, placeholder, inputClassName, as
|
|
29
|
+
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, fireBlurOnChange: fireBlurOnChangeProp, format, ...rest } = props;
|
|
30
|
+
const as = asProp ?? ui.input.as;
|
|
31
|
+
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
32
|
+
const variant = variantProp ?? ui.input.variant;
|
|
33
|
+
const size = sizeProp ?? ui.input.size;
|
|
34
|
+
const isClearable = isClearableProp ?? ui.input.isClearable;
|
|
35
|
+
const todayIcon = todayIconProp ?? ui.dateInput.todayIcon;
|
|
36
|
+
const todayIconButtonSize = todayIconButtonSizeProp ?? ui.dateInput.todayIconButtonSize;
|
|
37
|
+
const todayIconButtonComponent = todayIconButtonComponentProp ?? ui.dateInput.todayIconButtonComponent;
|
|
38
|
+
const todayIconPlacement = todayIconPlacementProp ?? ui.dateInput.todayIconPlacement;
|
|
39
|
+
const shouldForceLeadingZeros = shouldForceLeadingZerosProp ?? ui.dateInput.shouldForceLeadingZeros;
|
|
40
|
+
const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
|
|
41
|
+
const shouldUpdateDateOnMonthYearChange = shouldUpdateDateOnMonthYearChangeProp ?? ui.dateInput.shouldUpdateDateOnMonthYearChange;
|
|
42
|
+
const granularity = granularityProp ?? ui.dateInput.granularity;
|
|
43
|
+
const autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
|
|
44
|
+
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
|
|
45
|
+
const timeZone = ui.dateInput.timeZone;
|
|
46
|
+
let effectiveTimeZone = getLocalTimeZone();
|
|
47
|
+
if (timeZone !== "clientLocal") effectiveTimeZone = timeZone;
|
|
22
48
|
const normalizeByGranularity = useCallback((date) => {
|
|
23
49
|
if (granularity === "year") return date.set({
|
|
24
50
|
month: 1,
|
|
@@ -44,33 +70,42 @@ var DatePickerBase = (props) => {
|
|
|
44
70
|
const datePickerRef = useMemo(() => ({ get current() {
|
|
45
71
|
return datePickerInputRef.current?.getContainer?.() || null;
|
|
46
72
|
} }), []);
|
|
47
|
-
useImperativeHandle(ref, () => ({
|
|
48
|
-
|
|
49
|
-
|
|
73
|
+
useImperativeHandle(ref, () => ({
|
|
74
|
+
clear: () => {
|
|
75
|
+
datePickerInputRef.current?.clear();
|
|
76
|
+
},
|
|
77
|
+
getContainer: () => datePickerInputRef.current?.getContainer?.() ?? null
|
|
78
|
+
}));
|
|
79
|
+
const handleBlur = (val) => {
|
|
80
|
+
onBlur?.({ target: { value: val } });
|
|
81
|
+
};
|
|
82
|
+
const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
|
|
83
|
+
const normalizedValue = value ?? null;
|
|
50
84
|
const dialogState = useDatePickerState({
|
|
51
85
|
...rest,
|
|
52
|
-
defaultValue:
|
|
86
|
+
defaultValue: normalizedValue ?? rest.defaultValue ?? null,
|
|
53
87
|
shouldCloseOnSelect: false,
|
|
54
88
|
shouldForceLeadingZeros
|
|
55
89
|
});
|
|
56
90
|
const state = useDatePickerState({
|
|
57
91
|
...rest,
|
|
58
92
|
shouldForceLeadingZeros,
|
|
59
|
-
value,
|
|
60
|
-
onChange: (
|
|
61
|
-
let
|
|
62
|
-
if (
|
|
63
|
-
if (
|
|
93
|
+
value: normalizedValue,
|
|
94
|
+
onChange: (val_0) => {
|
|
95
|
+
let normalizedValue_0 = val_0;
|
|
96
|
+
if (val_0) normalizedValue_0 = normalizeByGranularity(val_0);
|
|
97
|
+
if (normalizedValue_0 && (rest.minValue && normalizedValue_0 < rest?.minValue || rest?.maxValue && normalizedValue_0 > rest?.maxValue)) {
|
|
64
98
|
state.setValue(state.value);
|
|
65
99
|
return;
|
|
66
100
|
}
|
|
67
|
-
onChange?.(
|
|
68
|
-
dialogState.setValue(
|
|
69
|
-
if (
|
|
70
|
-
|
|
101
|
+
onChange?.(normalizedValue_0);
|
|
102
|
+
dialogState.setValue(normalizedValue_0);
|
|
103
|
+
if (fireBlurOnChange) debouncedBlur(normalizedValue_0);
|
|
104
|
+
if (normalizedValue_0) {
|
|
105
|
+
calendarState.setFocusedDate(normalizedValue_0);
|
|
71
106
|
return;
|
|
72
107
|
}
|
|
73
|
-
calendarState.setFocusedDate(today(
|
|
108
|
+
calendarState.setFocusedDate(today(effectiveTimeZone));
|
|
74
109
|
},
|
|
75
110
|
shouldCloseOnSelect: false
|
|
76
111
|
});
|
|
@@ -102,13 +137,14 @@ var DatePickerBase = (props) => {
|
|
|
102
137
|
labelProps
|
|
103
138
|
};
|
|
104
139
|
const onApply = () => {
|
|
105
|
-
|
|
106
|
-
|
|
140
|
+
const newValue = dialogState.value ? normalizeByGranularity(dialogState.value) : dialogState.value;
|
|
141
|
+
state.setValue(newValue);
|
|
107
142
|
state.toggle();
|
|
143
|
+
if (fireBlurOnChange) handleBlur(newValue);
|
|
108
144
|
};
|
|
109
145
|
const onMonthYearChange = (selectedDate) => {
|
|
110
146
|
if (!(shouldUpdateDateOnMonthYearChange || granularity !== "day")) return;
|
|
111
|
-
const updatedDate = normalizeByGranularity((dialogState.value || state.value || today(
|
|
147
|
+
const updatedDate = normalizeByGranularity((dialogState.value || state.value || today(effectiveTimeZone)).set({
|
|
112
148
|
year: selectedDate.year,
|
|
113
149
|
month: selectedDate.month
|
|
114
150
|
}));
|
|
@@ -119,15 +155,20 @@ var DatePickerBase = (props) => {
|
|
|
119
155
|
onApply();
|
|
120
156
|
};
|
|
121
157
|
const onTodayPress = () => {
|
|
122
|
-
const todayValue = normalizeByGranularity(today(
|
|
158
|
+
const todayValue = normalizeByGranularity(today(effectiveTimeZone));
|
|
123
159
|
dialogState.setValue(todayValue);
|
|
124
160
|
calendarState.setFocusedDate(todayValue);
|
|
125
161
|
};
|
|
162
|
+
const onInputClear = () => {
|
|
163
|
+
onChange?.(null);
|
|
164
|
+
dialogState.setValue(null);
|
|
165
|
+
if (fireBlurOnChange) handleBlur(null);
|
|
166
|
+
};
|
|
126
167
|
useEffect(() => {
|
|
127
168
|
if (!state.isOpen) return;
|
|
128
169
|
if (granularity !== "year") return;
|
|
129
170
|
if (dialogState.value) return;
|
|
130
|
-
const defaultYearValue = normalizeByGranularity(today(
|
|
171
|
+
const defaultYearValue = normalizeByGranularity(today(effectiveTimeZone));
|
|
131
172
|
dialogState.setValue(defaultYearValue);
|
|
132
173
|
calendarState.setFocusedDate(defaultYearValue);
|
|
133
174
|
}, [
|
|
@@ -136,12 +177,13 @@ var DatePickerBase = (props) => {
|
|
|
136
177
|
dialogState.value,
|
|
137
178
|
dialogState,
|
|
138
179
|
calendarState,
|
|
139
|
-
normalizeByGranularity
|
|
180
|
+
normalizeByGranularity,
|
|
181
|
+
effectiveTimeZone
|
|
140
182
|
]);
|
|
141
183
|
const onOpenChange = (isOpen) => {
|
|
142
184
|
state.toggle();
|
|
143
185
|
if (state.value) calendarState.setFocusedDate(normalizeByGranularity(state.value));
|
|
144
|
-
if (!state.value) calendarState.setFocusedDate(today(
|
|
186
|
+
if (!state.value) calendarState.setFocusedDate(today(effectiveTimeZone));
|
|
145
187
|
if (!isOpen) dialogState.setValue(state.value);
|
|
146
188
|
};
|
|
147
189
|
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
@@ -158,11 +200,21 @@ var DatePickerBase = (props) => {
|
|
|
158
200
|
ref: mergeRefs(ref, datePickerInputRef),
|
|
159
201
|
as,
|
|
160
202
|
groupProps,
|
|
161
|
-
fieldProps
|
|
203
|
+
fieldProps: {
|
|
204
|
+
...fieldProps,
|
|
205
|
+
onBlur: (event) => {
|
|
206
|
+
fieldProps.onBlur?.(event);
|
|
207
|
+
handleBlur(state.value);
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
fieldValue: normalizedValue,
|
|
211
|
+
isValueControlled: true,
|
|
212
|
+
hasValue: normalizedValue != null,
|
|
162
213
|
buttonProps,
|
|
163
214
|
isDirty,
|
|
164
215
|
isDisabled,
|
|
165
216
|
disableManualEntry,
|
|
217
|
+
autoFixYear,
|
|
166
218
|
isInvalid: !!error,
|
|
167
219
|
disableDropdown,
|
|
168
220
|
variant,
|
|
@@ -170,13 +222,18 @@ var DatePickerBase = (props) => {
|
|
|
170
222
|
isClearable,
|
|
171
223
|
headerProps,
|
|
172
224
|
todayIcon,
|
|
225
|
+
todayIconButtonSize,
|
|
226
|
+
todayIconButtonComponent,
|
|
227
|
+
todayIconPlacement,
|
|
173
228
|
onOpenDropdown: () => state.toggle(),
|
|
174
229
|
placeholder,
|
|
175
230
|
className: inputClassName,
|
|
176
231
|
dateGranularity: granularity,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
232
|
+
format,
|
|
233
|
+
timeZone: effectiveTimeZone,
|
|
234
|
+
fireBlurOnChange,
|
|
235
|
+
onClear: onInputClear
|
|
236
|
+
}), (!disableDropdown || disableManualEntry) && state.isOpen && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
180
237
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
181
238
|
isDisabled,
|
|
182
239
|
isValid: !dialogState.isInvalid && !!dialogState.value,
|
|
@@ -201,57 +258,298 @@ var DatePickerBase = (props) => {
|
|
|
201
258
|
})
|
|
202
259
|
});
|
|
203
260
|
};
|
|
204
|
-
var
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
261
|
+
var DatePickerInner = (t0) => {
|
|
262
|
+
const $ = c(28);
|
|
263
|
+
const { fullIso: t1, granularity: t2, minValue, maxValue, renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
264
|
+
const fullIso = t1 === void 0 ? true : t1;
|
|
265
|
+
const granularity = t2 === void 0 ? "day" : t2;
|
|
266
|
+
const ui = UIConfig.useConfig();
|
|
267
|
+
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRow);
|
|
268
|
+
const { locale } = useLocale();
|
|
269
|
+
const shouldForceLeadingZeros = props.shouldForceLeadingZeros ?? ui.dateInput.shouldForceLeadingZeros;
|
|
270
|
+
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
271
|
+
const inputRef = useRef(null);
|
|
272
|
+
const { renderRealInput } = useStaticInputHandoff({
|
|
273
|
+
inputRef,
|
|
274
|
+
renderInput,
|
|
275
|
+
setRenderInput,
|
|
276
|
+
getFocusTarget: _temp
|
|
277
|
+
});
|
|
278
|
+
const normalizedValue = props.value ?? null;
|
|
279
|
+
let t3;
|
|
280
|
+
if ($[0] !== granularity) {
|
|
281
|
+
t3 = (date) => {
|
|
282
|
+
if (granularity === "year") return date.set({
|
|
283
|
+
month: 1,
|
|
284
|
+
day: 1
|
|
285
|
+
});
|
|
286
|
+
if (granularity === "month") return date.set({ day: 1 });
|
|
287
|
+
return date;
|
|
288
|
+
};
|
|
289
|
+
$[0] = granularity;
|
|
290
|
+
$[1] = t3;
|
|
291
|
+
} else t3 = $[1];
|
|
292
|
+
const normalizeByGranularity = t3;
|
|
293
|
+
let t4;
|
|
294
|
+
if ($[2] !== fullIso || $[3] !== normalizeByGranularity) {
|
|
295
|
+
t4 = (calendarDate) => {
|
|
296
|
+
if (calendarDate === null) return null;
|
|
297
|
+
const normalizedDate = normalizeByGranularity(calendarDate);
|
|
298
|
+
if (fullIso) return DateTimeUtils.fromCalendarDateToUTCISO(normalizedDate);
|
|
299
|
+
const date_0 = DateTimeUtils.fromDateValueToLocal(normalizedDate, "UTC");
|
|
300
|
+
return DateTime.fromJSDate(date_0, { zone: "UTC" }).toISODate();
|
|
301
|
+
};
|
|
302
|
+
$[2] = fullIso;
|
|
303
|
+
$[3] = normalizeByGranularity;
|
|
304
|
+
$[4] = t4;
|
|
305
|
+
} else t4 = $[4];
|
|
306
|
+
const formatCalendarDate = t4;
|
|
307
|
+
let t5;
|
|
308
|
+
if ($[5] !== fullIso || $[6] !== normalizeByGranularity) {
|
|
309
|
+
t5 = (formattedDate) => {
|
|
310
|
+
if (formattedDate == null) return null;
|
|
311
|
+
if (fullIso) return normalizeByGranularity(DateTimeUtils.fromUTCISOToCalendarDate(formattedDate));
|
|
312
|
+
const date_1 = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
|
|
313
|
+
return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date_1, "UTC")));
|
|
314
|
+
};
|
|
315
|
+
$[5] = fullIso;
|
|
316
|
+
$[6] = normalizeByGranularity;
|
|
317
|
+
$[7] = t5;
|
|
318
|
+
} else t5 = $[7];
|
|
319
|
+
const parseCalendarDate = t5;
|
|
320
|
+
let t6;
|
|
321
|
+
if ($[8] !== minValue || $[9] !== parseCalendarDate) {
|
|
322
|
+
t6 = typeof minValue === "string" ? parseCalendarDate(minValue) : minValue;
|
|
323
|
+
$[8] = minValue;
|
|
324
|
+
$[9] = parseCalendarDate;
|
|
325
|
+
$[10] = t6;
|
|
326
|
+
} else t6 = $[10];
|
|
327
|
+
let t7;
|
|
328
|
+
if ($[11] !== maxValue || $[12] !== parseCalendarDate) {
|
|
329
|
+
t7 = typeof maxValue === "string" ? parseCalendarDate(maxValue) : maxValue;
|
|
330
|
+
$[11] = maxValue;
|
|
331
|
+
$[12] = parseCalendarDate;
|
|
332
|
+
$[13] = t7;
|
|
333
|
+
} else t7 = $[13];
|
|
334
|
+
let t8;
|
|
335
|
+
if ($[14] !== t6 || $[15] !== t7) {
|
|
336
|
+
t8 = {
|
|
337
|
+
minValue: t6,
|
|
338
|
+
maxValue: t7
|
|
339
|
+
};
|
|
340
|
+
$[14] = t6;
|
|
341
|
+
$[15] = t7;
|
|
342
|
+
$[16] = t8;
|
|
343
|
+
} else t8 = $[16];
|
|
344
|
+
const dateLimits = t8;
|
|
345
|
+
if (!renderInput) {
|
|
346
|
+
const dateValue = normalizedValue ? parseCalendarDate(normalizedValue) : null;
|
|
347
|
+
const as = props.as ?? ui.input.as;
|
|
348
|
+
const size = props.size ?? ui.input.size;
|
|
349
|
+
const isDisabled = isFormControlDisabled || !!props.isDisabled;
|
|
350
|
+
const todayIcon = props.todayIcon ?? ui.dateInput.todayIcon;
|
|
351
|
+
const todayIconButtonSize = props.todayIconButtonSize ?? ui.dateInput.todayIconButtonSize;
|
|
352
|
+
const todayIconButtonComponent = props.todayIconButtonComponent ?? ui.dateInput.todayIconButtonComponent;
|
|
353
|
+
const todayIconPlacement = props.todayIconPlacement ?? ui.dateInput.todayIconPlacement;
|
|
354
|
+
const staticTodayIcon = renderDatePickerTodayIcon(todayIcon, {
|
|
355
|
+
isDisabled,
|
|
356
|
+
renderStatic: true,
|
|
357
|
+
size: todayIconButtonSize,
|
|
358
|
+
todayIconButtonComponent
|
|
209
359
|
});
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
360
|
+
const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
|
|
361
|
+
const showDropdown = !props.disableDropdown || disableManualEntry;
|
|
362
|
+
const staticSegments = getStaticCalendarDateSegments({
|
|
363
|
+
value: dateValue,
|
|
364
|
+
locale,
|
|
365
|
+
shouldForceLeadingZeros,
|
|
366
|
+
isDisabled,
|
|
367
|
+
hidePlaceholder: as === "floating" && !dateValue,
|
|
368
|
+
disableManualEntry,
|
|
369
|
+
placeholder: props.placeholder,
|
|
370
|
+
dateGranularity: granularity
|
|
371
|
+
});
|
|
372
|
+
return /* @__PURE__ */ jsx(InputFrame, {
|
|
373
|
+
...props,
|
|
374
|
+
isDisabled,
|
|
375
|
+
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
376
|
+
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
377
|
+
contentClassName: "pr-0!",
|
|
378
|
+
contentWrapperClassName: datePickerInputContentRowCva({ size }),
|
|
379
|
+
contentGroup: "date-picker",
|
|
380
|
+
labelPlacement: "content-row",
|
|
381
|
+
dataAttributes: {
|
|
382
|
+
dataIsEmpty: dateValue == null,
|
|
383
|
+
dataIsFilled: dateValue != null,
|
|
384
|
+
dataIsDirty: props.isDirty,
|
|
385
|
+
dataIsRequired: props.isRequired,
|
|
386
|
+
dataIsDisabled: isDisabled,
|
|
387
|
+
dataDisabled: isDisabled,
|
|
388
|
+
dataInvalid: !!props.error,
|
|
389
|
+
dataHasSelection: dateValue != null
|
|
390
|
+
},
|
|
391
|
+
renderStatic: true,
|
|
392
|
+
onStaticInteract: renderRealInput,
|
|
393
|
+
actionContent: staticTodayIcon,
|
|
394
|
+
actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
|
|
395
|
+
showClear: dateValue != null,
|
|
396
|
+
wrapContentAndTrailing: true,
|
|
397
|
+
contentAndTrailingClassName: "gap-2!",
|
|
398
|
+
trailingClassName: "py-0! pl-0!",
|
|
399
|
+
action: showDropdown ? {
|
|
400
|
+
icon: ui.dateInput.calendarIcon,
|
|
401
|
+
onClick: _temp2,
|
|
402
|
+
altText: ""
|
|
403
|
+
} : void 0,
|
|
404
|
+
children: staticSegments
|
|
246
405
|
});
|
|
247
406
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
407
|
+
const T0 = DatePickerBase;
|
|
408
|
+
const t9 = mergeRefs(props.ref, inputRef);
|
|
409
|
+
const t10 = parseCalendarDate(normalizedValue);
|
|
410
|
+
let t11;
|
|
411
|
+
if ($[17] !== formatCalendarDate || $[18] !== props) {
|
|
412
|
+
t11 = (value) => props.onChange?.(formatCalendarDate(value));
|
|
413
|
+
$[17] = formatCalendarDate;
|
|
414
|
+
$[18] = props;
|
|
415
|
+
$[19] = t11;
|
|
416
|
+
} else t11 = $[19];
|
|
417
|
+
let t12;
|
|
418
|
+
if ($[20] !== T0 || $[21] !== dateLimits || $[22] !== granularity || $[23] !== props || $[24] !== t10 || $[25] !== t11 || $[26] !== t9) {
|
|
419
|
+
t12 = /* @__PURE__ */ jsx(T0, {
|
|
420
|
+
...props,
|
|
421
|
+
...dateLimits,
|
|
422
|
+
ref: t9,
|
|
423
|
+
granularity,
|
|
424
|
+
value: t10,
|
|
425
|
+
onChange: t11
|
|
426
|
+
});
|
|
427
|
+
$[20] = T0;
|
|
428
|
+
$[21] = dateLimits;
|
|
429
|
+
$[22] = granularity;
|
|
430
|
+
$[23] = props;
|
|
431
|
+
$[24] = t10;
|
|
432
|
+
$[25] = t11;
|
|
433
|
+
$[26] = t9;
|
|
434
|
+
$[27] = t12;
|
|
435
|
+
} else t12 = $[27];
|
|
436
|
+
return t12;
|
|
437
|
+
};
|
|
438
|
+
var DatePicker = (t0) => {
|
|
439
|
+
const $ = c(33);
|
|
440
|
+
let maxValue;
|
|
441
|
+
let minValue;
|
|
442
|
+
let props;
|
|
443
|
+
let renderStaticInput;
|
|
444
|
+
let t1;
|
|
445
|
+
let t2;
|
|
446
|
+
if ($[0] !== t0) {
|
|
447
|
+
({fullIso: t1, granularity: t2, minValue, maxValue, renderStaticInput, ...props} = t0);
|
|
448
|
+
$[0] = t0;
|
|
449
|
+
$[1] = maxValue;
|
|
450
|
+
$[2] = minValue;
|
|
451
|
+
$[3] = props;
|
|
452
|
+
$[4] = renderStaticInput;
|
|
453
|
+
$[5] = t1;
|
|
454
|
+
$[6] = t2;
|
|
455
|
+
} else {
|
|
456
|
+
maxValue = $[1];
|
|
457
|
+
minValue = $[2];
|
|
458
|
+
props = $[3];
|
|
459
|
+
renderStaticInput = $[4];
|
|
460
|
+
t1 = $[5];
|
|
461
|
+
t2 = $[6];
|
|
462
|
+
}
|
|
463
|
+
const fullIso = t1 === void 0 ? true : t1;
|
|
464
|
+
const granularity = t2 === void 0 ? "day" : t2;
|
|
465
|
+
if ("formControl" in props && props.formControl) {
|
|
466
|
+
let formControl;
|
|
467
|
+
let innerProps;
|
|
468
|
+
let ref;
|
|
469
|
+
if ($[7] !== props) {
|
|
470
|
+
({formControl, ref, ...innerProps} = props);
|
|
471
|
+
$[7] = props;
|
|
472
|
+
$[8] = formControl;
|
|
473
|
+
$[9] = innerProps;
|
|
474
|
+
$[10] = ref;
|
|
475
|
+
} else {
|
|
476
|
+
formControl = $[8];
|
|
477
|
+
innerProps = $[9];
|
|
478
|
+
ref = $[10];
|
|
479
|
+
}
|
|
480
|
+
const controlWithOptions = formControl.control;
|
|
481
|
+
let t3;
|
|
482
|
+
if ($[11] !== controlWithOptions._options?.disabled || $[12] !== fullIso || $[13] !== granularity || $[14] !== innerProps || $[15] !== maxValue || $[16] !== minValue || $[17] !== props.error || $[18] !== props.isDisabled || $[19] !== ref || $[20] !== renderStaticInput) {
|
|
483
|
+
t3 = (t4) => {
|
|
484
|
+
const { field, fieldState: t5 } = t4;
|
|
485
|
+
const { error, isDirty } = t5;
|
|
486
|
+
return /* @__PURE__ */ jsx(DatePickerInner, {
|
|
487
|
+
...innerProps,
|
|
488
|
+
ref: mergeRefs(ref, field.ref),
|
|
489
|
+
value: field.value ?? null,
|
|
490
|
+
onChange: field.onChange,
|
|
491
|
+
onBlur: field.onBlur,
|
|
492
|
+
isDirty,
|
|
493
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
494
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
495
|
+
error: props.error ?? error?.message,
|
|
496
|
+
fullIso,
|
|
497
|
+
granularity,
|
|
498
|
+
minValue,
|
|
499
|
+
maxValue,
|
|
500
|
+
renderStaticInput
|
|
501
|
+
});
|
|
502
|
+
};
|
|
503
|
+
$[11] = controlWithOptions._options?.disabled;
|
|
504
|
+
$[12] = fullIso;
|
|
505
|
+
$[13] = granularity;
|
|
506
|
+
$[14] = innerProps;
|
|
507
|
+
$[15] = maxValue;
|
|
508
|
+
$[16] = minValue;
|
|
509
|
+
$[17] = props.error;
|
|
510
|
+
$[18] = props.isDisabled;
|
|
511
|
+
$[19] = ref;
|
|
512
|
+
$[20] = renderStaticInput;
|
|
513
|
+
$[21] = t3;
|
|
514
|
+
} else t3 = $[21];
|
|
515
|
+
let t4;
|
|
516
|
+
if ($[22] !== formControl.control || $[23] !== formControl.name || $[24] !== t3) {
|
|
517
|
+
t4 = /* @__PURE__ */ jsx(Controller, {
|
|
518
|
+
control: formControl.control,
|
|
519
|
+
name: formControl.name,
|
|
520
|
+
render: t3
|
|
521
|
+
});
|
|
522
|
+
$[22] = formControl.control;
|
|
523
|
+
$[23] = formControl.name;
|
|
524
|
+
$[24] = t3;
|
|
525
|
+
$[25] = t4;
|
|
526
|
+
} else t4 = $[25];
|
|
527
|
+
return t4;
|
|
528
|
+
}
|
|
529
|
+
let t3;
|
|
530
|
+
if ($[26] !== fullIso || $[27] !== granularity || $[28] !== maxValue || $[29] !== minValue || $[30] !== props || $[31] !== renderStaticInput) {
|
|
531
|
+
t3 = /* @__PURE__ */ jsx(DatePickerInner, {
|
|
532
|
+
...props,
|
|
533
|
+
fullIso,
|
|
534
|
+
granularity,
|
|
535
|
+
minValue,
|
|
536
|
+
maxValue,
|
|
537
|
+
renderStaticInput
|
|
538
|
+
});
|
|
539
|
+
$[26] = fullIso;
|
|
540
|
+
$[27] = granularity;
|
|
541
|
+
$[28] = maxValue;
|
|
542
|
+
$[29] = minValue;
|
|
543
|
+
$[30] = props;
|
|
544
|
+
$[31] = renderStaticInput;
|
|
545
|
+
$[32] = t3;
|
|
546
|
+
} else t3 = $[32];
|
|
547
|
+
return t3;
|
|
255
548
|
};
|
|
549
|
+
function _temp(input) {
|
|
550
|
+
const container = input.getContainer?.() ?? input;
|
|
551
|
+
return container instanceof HTMLElement ? container.querySelector("input, button, [tabindex]:not([tabindex='-1'])") : null;
|
|
552
|
+
}
|
|
553
|
+
function _temp2() {}
|
|
256
554
|
//#endregion
|
|
257
555
|
export { DatePicker };
|
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
import { CalendarDate } from '@internationalized/date';
|
|
2
|
-
import { Ref } from 'react';
|
|
2
|
+
import { FocusEvent, Ref } from 'react';
|
|
3
3
|
import { DateValue } from 'react-aria';
|
|
4
4
|
import { FieldValues } from 'react-hook-form';
|
|
5
5
|
import { DateRangePickerStateOptions } from 'react-stately';
|
|
6
6
|
import { DatePickerInputHandle } from '../shared/DatePickerInput';
|
|
7
|
+
import { DatePickerTodayIcon, DatePickerTodayIconButtonComponent, DatePickerTodayIconButtonSize, DatePickerTodayIconPlacement } from '../shared/datePicker.types';
|
|
7
8
|
import { FormFieldProps } from '../../FormField/FormField';
|
|
8
9
|
import { ControlProps } from '../../shared/form.types';
|
|
9
10
|
import { InputVariantProps } from '../../shared/input.cva';
|
|
10
|
-
interface DateRangePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<DateRangePickerStateOptions<CalendarDate>, "granularity" | "shouldCloseOnSelect" | "label"> {
|
|
11
|
+
interface DateRangePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<DateRangePickerStateOptions<CalendarDate>, "granularity" | "shouldCloseOnSelect" | "label" | "onBlur"> {
|
|
11
12
|
ref?: Ref<DatePickerInputHandle & HTMLDivElement>;
|
|
12
13
|
disableDropdown?: boolean;
|
|
13
14
|
isClearable?: boolean;
|
|
14
15
|
hideSidebar?: boolean;
|
|
15
16
|
className?: string;
|
|
16
|
-
todayIcon?:
|
|
17
|
+
todayIcon?: DatePickerTodayIcon;
|
|
18
|
+
todayIconButtonSize?: DatePickerTodayIconButtonSize;
|
|
19
|
+
todayIconButtonComponent?: DatePickerTodayIconButtonComponent;
|
|
20
|
+
todayIconPlacement?: DatePickerTodayIconPlacement;
|
|
17
21
|
isDirty?: boolean;
|
|
18
22
|
disableManualEntry?: boolean;
|
|
23
|
+
autoFixYear?: boolean;
|
|
19
24
|
placeholder?: string;
|
|
20
25
|
inputClassName?: string;
|
|
21
|
-
|
|
26
|
+
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
27
|
+
fireBlurOnChange?: boolean;
|
|
22
28
|
}
|
|
23
29
|
export interface DateRangePickerProps extends Omit<DateRangePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue"> {
|
|
24
30
|
value?: {
|
|
@@ -32,7 +38,8 @@ export interface DateRangePickerProps extends Omit<DateRangePickerBaseProps, "va
|
|
|
32
38
|
fullIso?: boolean;
|
|
33
39
|
minValue?: DateValue | string;
|
|
34
40
|
maxValue?: DateValue | string;
|
|
41
|
+
renderStaticInput?: boolean;
|
|
35
42
|
}
|
|
36
43
|
export type ControlledDateRangePickerProps<TFieldValues extends FieldValues> = ControlProps<DateRangePickerProps, TFieldValues>;
|
|
37
|
-
export declare const DateRangePicker: <TFieldValues extends FieldValues>({ fullIso, minValue, maxValue, ...props }: ControlledDateRangePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare const DateRangePicker: <TFieldValues extends FieldValues>({ fullIso, minValue, maxValue, renderStaticInput, ...props }: ControlledDateRangePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
38
45
|
export {};
|