@povio/ui 3.4.0-rc.14 → 3.4.0-rc.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/locales/en/{translation.json.js → translation.js} +1 -0
- package/dist/assets/locales/sl/{translation.json.js → translation.js} +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +17 -14
- package/dist/components/Breadcrumbs/Breadcrumbs.js +206 -55
- package/dist/components/Breadcrumbs/breadcrumbs.cva.d.ts +39 -40
- package/dist/components/Breadcrumbs/breadcrumbs.cva.js +5 -5
- package/dist/components/Menu/Menu.d.ts +20 -18
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/MenuDesktop.js +2 -2
- package/dist/components/Menu/MenuItem.d.ts +6 -3
- package/dist/components/Menu/MenuItem.js +2 -2
- package/dist/components/Menu/MenuMobile.js +2 -2
- package/dist/components/Menu/MenuPopover.d.ts +7 -5
- package/dist/components/Menu/MenuPopover.js +2 -2
- package/dist/components/Menu/menu.cva.d.ts +35 -35
- package/dist/components/Menu/menu.cva.js +4 -4
- package/dist/components/buttons/Button/Button.d.ts +25 -23
- package/dist/components/buttons/Button/Button.js +1 -1
- package/dist/components/buttons/Button/button.cva.d.ts +89 -95
- package/dist/components/buttons/Button/button.cva.js +8 -44
- package/dist/components/buttons/IconButton/IconButton.d.ts +13 -10
- package/dist/components/buttons/IconButton/IconButton.js +1 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +15 -12
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.d.ts +14 -11
- package/dist/components/buttons/PillButton/PillButton.js +2 -2
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +33 -38
- package/dist/components/buttons/PillButton/pillButton.cva.js +5 -5
- package/dist/components/buttons/SplitButton/SplitButton.d.ts +14 -11
- package/dist/components/buttons/SplitButton/SplitButton.js +2 -2
- package/dist/components/buttons/TextButton/TextButton.d.ts +14 -11
- package/dist/components/buttons/TextButton/TextButton.js +1 -1
- package/dist/components/buttons/ToggleButton/ToggleButton.d.ts +11 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +1 -1
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +6 -8
- package/dist/components/buttons/shared/buttonContent.cva.js +1 -1
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +22 -19
- package/dist/components/inputs/Checkbox/Checkbox.js +45 -201
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +1 -1
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +27 -25
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +126 -355
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +73 -89
- package/dist/components/inputs/Checkbox/checkbox.cva.js +8 -8
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +40 -37
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +44 -35
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +46 -43
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +172 -168
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +41 -38
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +21 -18
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +29 -26
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +166 -541
- package/dist/components/inputs/DateTime/shared/Calendar.js +17 -14
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +17 -17
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +5 -4
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +8 -7
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +43 -43
- package/dist/components/inputs/DateTime/shared/DateField.js +19 -20
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +11 -45
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +1 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +26 -102
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +28 -83
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +2 -2
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
- package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +111 -281
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +71 -214
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +8 -5
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +16 -15
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +1 -1
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +11 -50
- package/dist/components/inputs/DateTime/shared/datePickerValue.utils.js +4 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +12 -11
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +12 -26
- package/dist/components/inputs/File/FileUpload.d.ts +7 -4
- package/dist/components/inputs/File/FileUpload.js +49 -88
- package/dist/components/inputs/File/FileUploadContainer.d.ts +5 -3
- package/dist/components/inputs/File/FileUploadContainer.js +10 -17
- package/dist/components/inputs/File/InputUpload.d.ts +7 -4
- package/dist/components/inputs/File/InputUpload.js +26 -65
- package/dist/components/inputs/File/fileUpload.types.d.ts +87 -84
- package/dist/components/inputs/File/inputUpload.types.d.ts +34 -32
- package/dist/components/inputs/File/inputUpload.types.js +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +47 -110
- package/dist/components/inputs/File/shared/FileCardList.js +16 -54
- package/dist/components/inputs/File/shared/FileUploadContent.js +47 -188
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentError.js +3 -3
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +3 -3
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +1 -1
- package/dist/components/inputs/File/shared/InputUploadContent.js +36 -149
- package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -48
- package/dist/components/inputs/File/shared/ProgressBar.d.ts +6 -4
- package/dist/components/inputs/File/shared/ProgressBar.js +1 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +17 -16
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
- package/dist/components/inputs/File/shared/inputUploadButton.cva.d.ts +24 -25
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +5 -5
- package/dist/components/inputs/File/shared/progressBar.cva.d.ts +34 -33
- package/dist/components/inputs/File/shared/progressBar.cva.js +5 -5
- package/dist/components/inputs/FormField/FormField.d.ts +21 -17
- package/dist/components/inputs/FormField/FormField.js +39 -119
- package/dist/components/inputs/FormField/FormFieldError.d.ts +9 -6
- package/dist/components/inputs/FormField/FormFieldError.js +6 -24
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +15 -13
- package/dist/components/inputs/FormField/FormFieldHeader.js +22 -78
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +7 -25
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/FormField/formFieldError.cva.d.ts +13 -12
- package/dist/components/inputs/FormField/formFieldError.cva.js +1 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +13 -12
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +1 -1
- package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +13 -12
- package/dist/components/inputs/FormField/formFieldHelper.cva.js +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +25 -21
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +145 -394
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +11 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +120 -553
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +37 -34
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +93 -164
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +10 -7
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +12 -50
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +8 -7
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +20 -18
- package/dist/components/inputs/Input/TextArea/TextArea.js +96 -304
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +24 -20
- package/dist/components/inputs/Input/TextInput/TextInput.js +151 -380
- package/dist/components/inputs/Input/shared/InputContent.d.ts +25 -27
- package/dist/components/inputs/Input/shared/InputContent.js +59 -193
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +1 -1
- package/dist/components/inputs/Inputs/Form.d.ts +19 -19
- package/dist/components/inputs/Inputs/Form.js +23 -51
- package/dist/components/inputs/Inputs/InputItem.d.ts +77 -58
- package/dist/components/inputs/Inputs/InputItem.js +16 -65
- package/dist/components/inputs/Inputs/Inputs.d.ts +12 -9
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +23 -21
- package/dist/components/inputs/RadioGroup/RadioGroup.js +114 -320
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +49 -59
- package/dist/components/inputs/RadioGroup/radio.cva.js +6 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +15 -11
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +25 -55
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +8 -4
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +46 -117
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +25 -38
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +18 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +58 -115
- package/dist/components/inputs/Selection/Select/Select.d.ts +15 -11
- package/dist/components/inputs/Selection/Select/Select.js +35 -111
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +39 -37
- package/dist/components/inputs/Selection/shared/SelectBase.js +26 -70
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +144 -392
- package/dist/components/inputs/Selection/shared/SelectInput.js +161 -428
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +26 -100
- package/dist/components/inputs/Selection/shared/SelectListBox.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +23 -71
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
- package/dist/components/inputs/Selection/shared/SelectMobile.js +1 -1
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +14 -39
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +8 -15
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +6 -6
- package/dist/components/inputs/Selection/shared/select.context.js +52 -52
- package/dist/components/inputs/Selection/shared/select.types.d.ts +60 -62
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +8 -5
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +1 -1
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -11
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +1 -1
- package/dist/components/inputs/Selection/shared/selectItem.cva.d.ts +16 -15
- package/dist/components/inputs/Selection/shared/selectItem.cva.js +1 -1
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +3 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +12 -12
- package/dist/components/inputs/Skeleton/InputFrame.js +27 -27
- package/dist/components/inputs/Slider/Slider.d.ts +20 -17
- package/dist/components/inputs/Slider/Slider.js +86 -268
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +24 -20
- package/dist/components/inputs/TextEditor/TextEditor.js +21 -62
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
- package/dist/components/inputs/TextEditor/textEditor.types.js +1 -1
- package/dist/components/inputs/Toggle/Toggle.d.ts +18 -15
- package/dist/components/inputs/Toggle/Toggle.js +50 -210
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +15 -18
- package/dist/components/inputs/Toggle/toggle.cva.js +3 -3
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.js +30 -102
- package/dist/components/inputs/shared/TooltipWrapper.js +13 -48
- package/dist/components/inputs/shared/form.binding.d.ts +7 -27
- package/dist/components/inputs/shared/form.binding.js +8 -37
- package/dist/components/inputs/shared/form.types.d.ts +11 -11
- package/dist/components/inputs/shared/form.types.js +1 -1
- package/dist/components/inputs/shared/input.cva.d.ts +76 -85
- package/dist/components/inputs/shared/input.cva.js +9 -19
- package/dist/components/inputs/shared/label.cva.d.ts +18 -18
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +10 -7
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +1 -1
- package/dist/components/inputs/shared/useFieldAccessibility.js +19 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +50 -105
- package/dist/components/navigation/Accordion/Accordion.d.ts +5 -3
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Accordion/accordion.cva.d.ts +76 -100
- package/dist/components/navigation/Accordion/accordion.cva.js +10 -10
- package/dist/components/navigation/Accordion/accordion.types.d.ts +52 -49
- package/dist/components/navigation/Stepper/Stepper.d.ts +5 -2
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +2 -2
- package/dist/components/navigation/Stepper/StepperSeparator.js +1 -1
- package/dist/components/navigation/Stepper/stepper.cva.d.ts +73 -86
- package/dist/components/navigation/Stepper/stepper.cva.js +7 -7
- package/dist/components/navigation/Stepper/stepper.types.d.ts +29 -37
- package/dist/components/outline.clsx.d.ts +4 -2
- package/dist/components/outline.clsx.js +2 -2
- package/dist/components/overlays/ActionModal/ActionModal.d.ts +23 -21
- package/dist/components/overlays/ActionModal/ActionModal.js +170 -36
- package/dist/components/overlays/BottomSheet/BottomSheet.d.ts +30 -28
- package/dist/components/overlays/BottomSheet/BottomSheet.js +13 -10
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +2 -2
- package/dist/components/overlays/Drawer/Drawer.d.ts +17 -14
- package/dist/components/overlays/Drawer/Drawer.js +3 -3
- package/dist/components/overlays/Modal/Modal.d.ts +18 -14
- package/dist/components/overlays/Modal/Modal.js +3 -1
- package/dist/components/overlays/Modal/modal.cva.d.ts +34 -34
- package/dist/components/overlays/Modal/modal.cva.js +4 -4
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +16 -14
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +110 -29
- package/dist/components/overlays/Tooltip/Tooltip.d.ts +15 -12
- package/dist/components/overlays/Tooltip/Tooltip.js +3 -3
- package/dist/components/overlays/Tooltip/TooltipEllipsis.d.ts +10 -7
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +2 -2
- package/dist/components/overlays/Tooltip/tooltip.cva.d.ts +39 -45
- package/dist/components/overlays/Tooltip/tooltip.cva.js +4 -4
- package/dist/components/segment/Segment.d.ts +7 -4
- package/dist/components/segment/Segment.js +3 -3
- package/dist/components/segment/SegmentItem.js +2 -2
- package/dist/components/segment/segment.cva.d.ts +20 -18
- package/dist/components/segment/segment.cva.js +2 -2
- package/dist/components/segment/segment.types.d.ts +33 -30
- package/dist/components/shared/pagination/Pagination.d.ts +11 -8
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.d.ts +17 -14
- package/dist/components/shared/pagination/PaginationList.js +2 -2
- package/dist/components/shared/pagination/minWidth.cva.js +1 -1
- package/dist/components/shared/popover.cva.d.ts +8 -7
- package/dist/components/shared/popover.cva.js +1 -1
- package/dist/components/status/Alert/Alert.d.ts +13 -10
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Alert/alert.cva.d.ts +21 -18
- package/dist/components/status/Alert/alert.cva.js +1 -1
- package/dist/components/status/Loader/Loader.d.ts +7 -5
- package/dist/components/status/Loader/Loader.js +1 -1
- package/dist/components/status/Loader/loader.cva.d.ts +23 -26
- package/dist/components/status/Loader/loader.cva.js +4 -4
- package/dist/components/status/Toast/Toast.d.ts +15 -12
- package/dist/components/status/Toast/Toast.js +2 -2
- package/dist/components/status/Toast/toast.cva.d.ts +58 -77
- package/dist/components/status/Toast/toast.cva.js +6 -6
- package/dist/components/status/Toast/useToast.d.ts +14 -11
- package/dist/components/status/Toast/useToast.js +1 -1
- package/dist/components/status/shared/status.cva.d.ts +32 -28
- package/dist/components/status/shared/status.cva.js +2 -2
- package/dist/components/table/CellText.d.ts +10 -7
- package/dist/components/table/CellText.js +3 -2
- package/dist/components/table/ColumnConfig.d.ts +12 -9
- package/dist/components/table/ColumnConfig.js +6 -5
- package/dist/components/table/HeaderText.d.ts +10 -7
- package/dist/components/table/HeaderText.js +3 -2
- package/dist/components/table/InfiniteTable.d.ts +10 -8
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.d.ts +12 -10
- package/dist/components/table/PaginatedTable.js +1 -1
- package/dist/components/table/Table.d.ts +34 -35
- package/dist/components/table/Table.js +18 -16
- package/dist/components/table/table.cva.d.ts +40 -59
- package/dist/components/table/table.cva.js +7 -7
- package/dist/components/text/Link/Link.d.ts +10 -8
- package/dist/components/text/Link/Link.js +2 -2
- package/dist/components/text/Link/link.cva.d.ts +14 -11
- package/dist/components/text/Link/link.cva.js +1 -1
- package/dist/components/text/Pill/Pill.d.ts +17 -14
- package/dist/components/text/Pill/Pill.js +1 -1
- package/dist/components/text/Tag/Tag.d.ts +17 -14
- package/dist/components/text/Tag/Tag.js +1 -1
- package/dist/components/text/Tag/tag.cva.d.ts +18 -15
- package/dist/components/text/Tag/tag.cva.js +1 -1
- package/dist/components/text/Typography/Typography.d.ts +10 -9
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/components/text/Typography/typography.cva.d.ts +51 -48
- package/dist/components/text/Typography/typography.cva.js +1 -1
- package/dist/config/confirmation.context.d.ts +22 -19
- package/dist/config/confirmation.context.js +2 -2
- package/dist/config/i18n.d.ts +311 -308
- package/dist/config/i18n.js +4 -4
- package/dist/config/link.context.d.ts +9 -7
- package/dist/config/link.context.js +2 -2
- package/dist/config/router.context.d.ts +11 -9
- package/dist/config/router.context.js +2 -2
- package/dist/config/theme.context.d.ts +19 -16
- package/dist/config/theme.context.js +99 -46
- package/dist/config/uiConfig.context.d.ts +80 -75
- package/dist/config/uiConfig.context.js +46 -9
- package/dist/config/uiOverrides.context.d.ts +205 -204
- package/dist/config/uiOverrides.context.js +2 -2
- package/dist/helpers/dynamicColumns.d.ts +27 -28
- package/dist/helpers/dynamicColumns.js +32 -31
- package/dist/helpers/dynamicInputs.d.ts +66 -74
- package/dist/helpers/dynamicInputs.js +21 -20
- package/dist/hooks/useAutosave.d.ts +12 -9
- package/dist/hooks/useAutosave.js +1 -1
- package/dist/hooks/useBreakpoint.d.ts +4 -2
- package/dist/hooks/useBreakpoint.js +37 -10
- package/dist/hooks/useDebounceCallback.d.ts +7 -4
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useDeepCompare.d.ts +7 -4
- package/dist/hooks/useDeepCompare.js +4 -4
- package/dist/hooks/useFilters.d.ts +10 -7
- package/dist/hooks/useFilters.js +8 -6
- package/dist/hooks/useForm.d.ts +35 -35
- package/dist/hooks/useForm.js +6 -6
- package/dist/hooks/useFormAutosave.d.ts +16 -13
- package/dist/hooks/useFormAutosave.js +18 -17
- package/dist/hooks/useIntersectionObserver.d.ts +7 -5
- package/dist/hooks/useIntersectionObserver.js +2 -2
- package/dist/hooks/useKeyInteractions.d.ts +19 -16
- package/dist/hooks/useKeyInteractions.js +5 -5
- package/dist/hooks/useLocalStorage.d.ts +10 -8
- package/dist/hooks/useLocalStorage.js +3 -3
- package/dist/hooks/useLongPressRepeat.d.ts +10 -7
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.d.ts +9 -6
- package/dist/hooks/usePagination.js +2 -2
- package/dist/hooks/useQueryAutocomplete.js +2 -2
- package/dist/hooks/useScrollableListBox.d.ts +5 -2
- package/dist/hooks/useScrollableListBox.js +1 -1
- package/dist/hooks/useSorting.d.ts +8 -5
- package/dist/hooks/useSorting.js +1 -1
- package/dist/hooks/useStateAndRef.d.ts +5 -3
- package/dist/hooks/useStateAndRef.js +2 -2
- package/dist/hooks/useTableColumnConfig.d.ts +15 -13
- package/dist/hooks/useTableColumnConfig.js +1 -1
- package/dist/hooks/useTableNav.d.ts +79 -77
- package/dist/hooks/useTableNav.js +19 -37
- package/dist/hooks/useTranslationMemo.d.ts +5 -3
- package/dist/index.d.ts +145 -1
- package/dist/index.js +3 -3
- package/dist/rhf/Inputs.d.ts +55 -54
- package/dist/rhf/Inputs.js +62 -17
- package/dist/rhf/components.d.ts +77 -75
- package/dist/rhf/components.js +27 -27
- package/dist/rhf/dynamicInputs.d.ts +16 -14
- package/dist/rhf/dynamicInputs.js +1 -1
- package/dist/rhf/fieldAdapter.d.ts +8 -6
- package/dist/rhf/form.types.d.ts +11 -10
- package/dist/rhf/useAutosave.d.ts +12 -9
- package/dist/rhf/useForm.d.ts +13 -13
- package/dist/rhf/useFormAutosave.d.ts +17 -14
- package/dist/rhf/useFormAutosave.js +121 -34
- package/dist/rhf.d.ts +146 -225
- package/dist/rhf.js +120 -0
- package/dist/tanstack.d.ts +151 -224
- package/dist/tanstack.js +3 -3
- package/dist/text-editor.d.ts +2 -2
- package/dist/tw-ui-plugin.d.ts +4 -2
- package/dist/tw-ui-plugin.js +1 -1
- package/dist/types/common.d.ts +11 -12
- package/dist/types/error-handling.d.ts +8 -5
- package/dist/utils/array.utils.d.ts +5 -2
- package/dist/utils/array.utils.js +1 -1
- package/dist/utils/compoundMapper.d.ts +12 -14
- package/dist/utils/compoundMapper.js +1 -1
- package/dist/utils/date-time.utils.d.ts +44 -41
- package/dist/utils/date-time.utils.js +7 -9
- package/dist/utils/date.utils.d.ts +6 -4
- package/dist/utils/date.utils.js +29 -6
- package/dist/utils/dom.utils.d.ts +7 -4
- package/dist/utils/dom.utils.js +2 -2
- package/dist/utils/file.utils.d.ts +20 -12
- package/dist/utils/file.utils.js +19 -8
- package/dist/utils/intl.utils.d.ts +7 -5
- package/dist/utils/intl.utils.js +2 -2
- package/dist/utils/isEqual.d.ts +4 -1
- package/dist/utils/isEqual.js +3 -3
- package/dist/utils/logger.d.ts +9 -6
- package/dist/utils/logger.js +1 -1
- package/dist/utils/object.utils.d.ts +12 -9
- package/dist/utils/object.utils.js +1 -1
- package/dist/utils/queries.utils.d.ts +6 -3
- package/dist/utils/queries.utils.js +1 -1
- package/dist/utils/query.utils.js +1 -1
- package/dist/utils/routing.utils.d.ts +6 -3
- package/dist/utils/routing.utils.js +1 -1
- package/dist/utils/string.utils.d.ts +6 -3
- package/dist/utils/string.utils.js +1 -1
- package/dist/utils/style-merge.util.d.ts +38 -41
- package/dist/utils/style-merge.util.js +7 -4
- package/dist/utils/zod.utils.d.ts +22 -19
- package/dist/utils/zod.utils.js +1 -1
- package/package.json +30 -8
- package/dist/assets/locales/en/translation.json.d.ts +0 -158
- package/dist/assets/locales/sl/translation.json.d.ts +0 -154
- package/dist/components/Menu/MenuDesktop.d.ts +0 -2
- package/dist/components/Menu/MenuMobile.d.ts +0 -2
- package/dist/components/buttons/shared/ButtonContent.d.ts +0 -14
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.d.ts +0 -9
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +0 -29
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +0 -22
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +0 -27
- package/dist/components/inputs/DateTime/shared/CalendarHeader.d.ts +0 -18
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.d.ts +0 -17
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +0 -21
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -28
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.d.ts +0 -18
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.d.ts +0 -8
- package/dist/components/inputs/DateTime/shared/MonthPicker.d.ts +0 -11
- package/dist/components/inputs/DateTime/shared/RangeCalendar.d.ts +0 -26
- package/dist/components/inputs/DateTime/shared/TimeField.d.ts +0 -12
- package/dist/components/inputs/DateTime/shared/TimePickerForm.d.ts +0 -10
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +0 -25
- package/dist/components/inputs/DateTime/shared/YearPicker.d.ts +0 -12
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -41
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.d.ts +0 -2
- package/dist/components/inputs/File/index.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileCard.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileCardList.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileUploadContent.d.ts +0 -10
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileUploadContentError.d.ts +0 -11
- package/dist/components/inputs/File/shared/FileUploadContentFilled.d.ts +0 -11
- package/dist/components/inputs/File/shared/FileUploadContentLoading.d.ts +0 -9
- package/dist/components/inputs/File/shared/InputUploadContent.d.ts +0 -9
- package/dist/components/inputs/File/shared/InputUploadFilled.d.ts +0 -8
- package/dist/components/inputs/FormField/FormFieldHeaderClose.d.ts +0 -5
- package/dist/components/inputs/FormField/FormFieldHelper.d.ts +0 -8
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +0 -13
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +0 -15
- package/dist/components/inputs/Selection/shared/SelectInputTags.d.ts +0 -12
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.d.ts +0 -7
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.d.ts +0 -4
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/select.context.d.ts +0 -32
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Selection/shared/useSelectItems.d.ts +0 -23
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -84
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.d.ts +0 -7
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.d.ts +0 -10
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.d.ts +0 -6
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/textEditor.types.d.ts +0 -5
- package/dist/components/inputs/shared/CheckContent.d.ts +0 -9
- package/dist/components/inputs/shared/InputClear.d.ts +0 -10
- package/dist/components/inputs/shared/TooltipWrapper.d.ts +0 -10
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -15
- package/dist/components/navigation/Accordion/AccordionItem.d.ts +0 -2
- package/dist/components/navigation/Stepper/StepperItem.d.ts +0 -2
- package/dist/components/navigation/Stepper/StepperSeparator.d.ts +0 -5
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.d.ts +0 -13
- package/dist/components/segment/SegmentItem.d.ts +0 -2
- package/dist/components/shared/pagination/minWidth.cva.d.ts +0 -3
- package/dist/hooks/useFormAutosave.spec.d.ts +0 -1
- package/dist/hooks/useKeyInteractions.spec.d.ts +0 -1
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -13
- package/dist/rhf/entrypoints.type-test.d.ts +0 -1
- package/dist/types/react-query.d.ts +0 -6
- package/dist/utils/array.utils.spec.d.ts +0 -1
- package/dist/utils/compoundMapper.spec.d.ts +0 -1
- package/dist/utils/date-time.utils.spec.d.ts +0 -1
- package/dist/utils/date.utils.spec.d.ts +0 -1
- package/dist/utils/intl.utils.spec.d.ts +0 -1
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/rest.utils.d.ts +0 -10
- package/dist/utils/rest.utils.js +0 -33
- package/dist/utils/style-merge.util.spec.d.ts +0 -1
|
@@ -8,30 +8,21 @@ import { SelectBase } from "../shared/SelectBase.js";
|
|
|
8
8
|
import { StaticSelectTrailingContent } from "../shared/StaticSelectTrailingContent.js";
|
|
9
9
|
import { getStaticSelectValue } from "../shared/staticSelect.utils.js";
|
|
10
10
|
import { clsx } from "clsx";
|
|
11
|
-
import { useRef, useState } from "react";
|
|
12
|
-
import { c } from "react/compiler-runtime";
|
|
11
|
+
import { memo, useRef, useState } from "react";
|
|
13
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
13
|
import { mergeRefs } from "@react-aria/utils";
|
|
15
14
|
//#region src/components/inputs/Selection/Autocomplete/Autocomplete.tsx
|
|
16
|
-
function AutocompleteInner(
|
|
17
|
-
const $ = c(8);
|
|
18
|
-
const { renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
15
|
+
function AutocompleteInner({ renderStaticInput, isFormControlDisabled, ...props }) {
|
|
19
16
|
const ui = UIConfig.useConfig();
|
|
20
17
|
const selectInputTagsContentWrapperCva = UIOverrides.useCva("select.tagsContentWrapperCva", selectInputTagsContentWrapperDefinition);
|
|
21
18
|
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
22
19
|
const rootRef = useRef(null);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
getFocusTarget: _temp
|
|
30
|
-
};
|
|
31
|
-
$[0] = renderInput;
|
|
32
|
-
$[1] = t1;
|
|
33
|
-
} else t1 = $[1];
|
|
34
|
-
const { renderRealInput, replayStaticInputChange, replayStaticInputPress } = useStaticInputHandoff(t1);
|
|
20
|
+
const { renderRealInput, replayStaticInputChange, replayStaticInputPress } = useStaticInputHandoff({
|
|
21
|
+
inputRef: rootRef,
|
|
22
|
+
renderInput,
|
|
23
|
+
setRenderInput,
|
|
24
|
+
getFocusTarget: (root) => root.querySelector("input, [data-type='select-trigger'], button, [tabindex]")
|
|
25
|
+
});
|
|
35
26
|
const currentValue = props.value;
|
|
36
27
|
if (!renderInput && !!props.customTrigger) setRenderInput(true);
|
|
37
28
|
if (!renderInput) {
|
|
@@ -72,22 +63,13 @@ function AutocompleteInner(t0) {
|
|
|
72
63
|
dataHasSelection: !isEmpty,
|
|
73
64
|
dataHasSearch: false
|
|
74
65
|
};
|
|
75
|
-
const t2 = isDisabled;
|
|
76
|
-
const t3 = clsx("w-full", props.containerClassName);
|
|
77
|
-
const t4 = clsx(props.className, props.inputClassName);
|
|
78
|
-
let t5;
|
|
79
|
-
if ($[2] !== selectInputTagsContentWrapperCva) {
|
|
80
|
-
t5 = selectInputTagsContentWrapperCva({ isSearchable: true });
|
|
81
|
-
$[2] = selectInputTagsContentWrapperCva;
|
|
82
|
-
$[3] = t5;
|
|
83
|
-
} else t5 = $[3];
|
|
84
66
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
85
67
|
...props,
|
|
86
|
-
isDisabled
|
|
68
|
+
isDisabled,
|
|
87
69
|
isLoading: false,
|
|
88
|
-
className:
|
|
89
|
-
inputClassName:
|
|
90
|
-
contentWrapperClassName:
|
|
70
|
+
className: clsx("w-full", props.containerClassName),
|
|
71
|
+
inputClassName: clsx(props.className, props.inputClassName),
|
|
72
|
+
contentWrapperClassName: selectInputTagsContentWrapperCva({ isSearchable: true }),
|
|
91
73
|
contentGroup: "select",
|
|
92
74
|
labelPlacement: "content-row",
|
|
93
75
|
dataAttributes,
|
|
@@ -115,40 +97,27 @@ function AutocompleteInner(t0) {
|
|
|
115
97
|
})] })
|
|
116
98
|
});
|
|
117
99
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
...props,
|
|
124
|
-
ref: t2,
|
|
125
|
-
isSearchable: true
|
|
126
|
-
});
|
|
127
|
-
$[4] = T0;
|
|
128
|
-
$[5] = props;
|
|
129
|
-
$[6] = t2;
|
|
130
|
-
$[7] = t3;
|
|
131
|
-
} else t3 = $[7];
|
|
132
|
-
return t3;
|
|
133
|
-
}
|
|
134
|
-
function _temp(root) {
|
|
135
|
-
return root.querySelector("input, [data-type='select-trigger'], button, [tabindex]");
|
|
100
|
+
return /* @__PURE__ */ jsx(SelectBase, {
|
|
101
|
+
...props,
|
|
102
|
+
ref: mergeRefs(props.ref, rootRef),
|
|
103
|
+
isSearchable: true
|
|
104
|
+
});
|
|
136
105
|
}
|
|
137
|
-
function
|
|
106
|
+
function AutocompleteComponent({ renderStaticInput, ...props }) {
|
|
138
107
|
if ("field" in props && props.field) {
|
|
139
108
|
const { ignoreInputValueFiltering = true, field, ref, ...innerProps } = props;
|
|
140
109
|
const controlWithOptions = field.form;
|
|
141
110
|
return /* @__PURE__ */ jsx(FieldController, {
|
|
142
111
|
control: field.form,
|
|
143
112
|
name: field.name,
|
|
144
|
-
render: ({ field
|
|
113
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(AutocompleteInner, {
|
|
145
114
|
...innerProps,
|
|
146
|
-
ref: mergeRefs(ref,
|
|
147
|
-
value:
|
|
148
|
-
onChange:
|
|
149
|
-
onBlur:
|
|
115
|
+
ref: mergeRefs(ref, field.ref),
|
|
116
|
+
value: field.value,
|
|
117
|
+
onChange: field.onChange,
|
|
118
|
+
onBlur: field.onBlur,
|
|
150
119
|
isDirty,
|
|
151
|
-
isDisabled:
|
|
120
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
152
121
|
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
153
122
|
error: props.error ?? error?.message,
|
|
154
123
|
ignoreInputValueFiltering,
|
|
@@ -161,5 +130,6 @@ function Autocomplete({ renderStaticInput, ...props }) {
|
|
|
161
130
|
renderStaticInput
|
|
162
131
|
});
|
|
163
132
|
}
|
|
133
|
+
const Autocomplete = memo(AutocompleteComponent);
|
|
164
134
|
//#endregion
|
|
165
135
|
export { Autocomplete };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { FieldValues } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { FieldValues } from "../../shared/form.binding.js";
|
|
2
|
+
import { SelectItem } from "../shared/select.types.js";
|
|
3
|
+
import { QueryAutocompleteProps, QueryFn } from "./queryAutocomplete.types.js";
|
|
4
|
+
//#region src/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts
|
|
5
|
+
declare const QueryAutocompleteComponent: <TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn>(props: QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const QueryAutocomplete: typeof QueryAutocompleteComponent;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { QueryAutocomplete };
|
|
@@ -3,16 +3,15 @@ import { FieldController } from "../../shared/form.binding.js";
|
|
|
3
3
|
import { Autocomplete } from "./Autocomplete.js";
|
|
4
4
|
import { getQueryItems, getSelectionIdsToResolve } from "../shared/querySelect.utils.js";
|
|
5
5
|
import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
|
|
6
|
-
import { useState } from "react";
|
|
7
|
-
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { memo, useCallback, useMemo, useState } from "react";
|
|
8
7
|
import { jsx } from "react/jsx-runtime";
|
|
9
8
|
import { mergeRefs } from "@react-aria/utils";
|
|
10
9
|
//#region src/components/inputs/Selection/Autocomplete/QueryAutocomplete.tsx
|
|
11
|
-
|
|
10
|
+
const LoadedQueryAutocompleteContent = ({ query, queryParams, queryOptions, queryMap, resolveSelectedItemsWithIds, isQueryEnabledInitially = false, leadingContent, ...props }) => {
|
|
12
11
|
"use no memo";
|
|
13
12
|
const ui = UIConfig.useConfig();
|
|
14
13
|
const [search, setSearch] = useState("");
|
|
15
|
-
const {
|
|
14
|
+
const { onBlur, onChange } = props;
|
|
16
15
|
const value = "value" in props ? props.value : void 0;
|
|
17
16
|
const selectedIdsToResolve = getSelectionIdsToResolve({
|
|
18
17
|
initialSelection: props.initialSelection,
|
|
@@ -26,21 +25,24 @@ var LoadedQueryAutocompleteContent = ({ query, queryParams, queryOptions, queryM
|
|
|
26
25
|
query,
|
|
27
26
|
queryParams,
|
|
28
27
|
queryOptions,
|
|
29
|
-
mapItems: (data) => getQueryItems(data, queryMap),
|
|
28
|
+
mapItems: useCallback((data) => getQueryItems(data, queryMap), [queryMap]),
|
|
30
29
|
resolveSelectedItemsWithIds: resolveSelectedItemsWithIds ?? ui.queryAutocomplete?.resolveSelectedItemsWithIds,
|
|
31
30
|
search,
|
|
32
31
|
initialQueryState: shouldDisableInitialQuery,
|
|
33
32
|
selectedIdsToResolve: selectedIdsToResolve.items
|
|
34
33
|
});
|
|
35
|
-
const handleChange = (
|
|
36
|
-
onChange?.(
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
const handleChange = useCallback((value) => {
|
|
35
|
+
onChange?.(value);
|
|
36
|
+
onBlur?.({ target: { value: null } });
|
|
37
|
+
}, [onBlur, onChange]);
|
|
38
|
+
const autocompleteProps = useMemo(() => {
|
|
39
|
+
const { isInitialQueryDisabled: _, onChange: __, ...rest } = props;
|
|
40
|
+
return rest;
|
|
41
|
+
}, [props]);
|
|
42
|
+
const onSearchChange = useCallback((value) => {
|
|
43
|
+
setSearch(value);
|
|
42
44
|
handleEnableQuery();
|
|
43
|
-
};
|
|
45
|
+
}, [handleEnableQuery]);
|
|
44
46
|
return /* @__PURE__ */ jsx(Autocomplete, {
|
|
45
47
|
...autocompleteProps,
|
|
46
48
|
items,
|
|
@@ -57,120 +59,47 @@ var LoadedQueryAutocompleteContent = ({ query, queryParams, queryOptions, queryM
|
|
|
57
59
|
onLoadMore: fetchNextPage
|
|
58
60
|
});
|
|
59
61
|
};
|
|
60
|
-
|
|
61
|
-
const $ = c(9);
|
|
62
|
+
const QueryAutocompleteContent = (props) => {
|
|
62
63
|
const [isQueryMounted, setIsQueryMounted] = useState(false);
|
|
63
64
|
const value = "value" in props ? props.value : void 0;
|
|
64
65
|
if (!getSelectionIdsToResolve({
|
|
65
66
|
initialSelection: props.initialSelection,
|
|
66
67
|
value,
|
|
67
68
|
mapInitialToSelectItem: props.mapInitialToSelectItem
|
|
68
|
-
}).isResolvedByInitialSelection || isQueryMounted) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
let autocompleteProps;
|
|
82
|
-
if ($[3] !== props) {
|
|
83
|
-
const { query: _, queryParams: _queryParams, queryOptions: _queryOptions, queryMap: _queryMap, resolveSelectedItemsWithIds: _resolveSelectedItemsWithIds, isInitialQueryDisabled: _isInitialQueryDisabled, ...t0 } = props;
|
|
84
|
-
autocompleteProps = t0;
|
|
85
|
-
$[3] = props;
|
|
86
|
-
$[4] = autocompleteProps;
|
|
87
|
-
} else autocompleteProps = $[4];
|
|
88
|
-
let t0;
|
|
89
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
90
|
-
t0 = () => setIsQueryMounted(true);
|
|
91
|
-
$[5] = t0;
|
|
92
|
-
} else t0 = $[5];
|
|
93
|
-
const mountQuery = t0;
|
|
94
|
-
let t1;
|
|
95
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
96
|
-
t1 = [];
|
|
97
|
-
$[6] = t1;
|
|
98
|
-
} else t1 = $[6];
|
|
99
|
-
let t2;
|
|
100
|
-
if ($[7] !== autocompleteProps) {
|
|
101
|
-
t2 = /* @__PURE__ */ jsx(Autocomplete, {
|
|
102
|
-
...autocompleteProps,
|
|
103
|
-
items: t1,
|
|
104
|
-
onMouseEnter: mountQuery,
|
|
105
|
-
onFocusCapture: mountQuery
|
|
106
|
-
});
|
|
107
|
-
$[7] = autocompleteProps;
|
|
108
|
-
$[8] = t2;
|
|
109
|
-
} else t2 = $[8];
|
|
110
|
-
return t2;
|
|
69
|
+
}).isResolvedByInitialSelection || isQueryMounted) return /* @__PURE__ */ jsx(LoadedQueryAutocompleteContent, {
|
|
70
|
+
...props,
|
|
71
|
+
isQueryEnabledInitially: isQueryMounted
|
|
72
|
+
});
|
|
73
|
+
const { query: _, queryParams: _queryParams, queryOptions: _queryOptions, queryMap: _queryMap, resolveSelectedItemsWithIds: _resolveSelectedItemsWithIds, isInitialQueryDisabled: _isInitialQueryDisabled, ...autocompleteProps } = props;
|
|
74
|
+
const mountQuery = () => setIsQueryMounted(true);
|
|
75
|
+
return /* @__PURE__ */ jsx(Autocomplete, {
|
|
76
|
+
...autocompleteProps,
|
|
77
|
+
items: [],
|
|
78
|
+
onMouseEnter: mountQuery,
|
|
79
|
+
onFocusCapture: mountQuery
|
|
80
|
+
});
|
|
111
81
|
};
|
|
112
|
-
|
|
113
|
-
const $ = c(16);
|
|
82
|
+
const QueryAutocompleteComponent = (props) => {
|
|
114
83
|
if ("field" in props && props.field) {
|
|
115
|
-
|
|
116
|
-
let innerProps;
|
|
117
|
-
let ref;
|
|
118
|
-
if ($[0] !== props) {
|
|
119
|
-
({field, ref, ...innerProps} = props);
|
|
120
|
-
$[0] = props;
|
|
121
|
-
$[1] = field;
|
|
122
|
-
$[2] = innerProps;
|
|
123
|
-
$[3] = ref;
|
|
124
|
-
} else {
|
|
125
|
-
field = $[1];
|
|
126
|
-
innerProps = $[2];
|
|
127
|
-
ref = $[3];
|
|
128
|
-
}
|
|
84
|
+
const { field, ref, ...innerProps } = props;
|
|
129
85
|
const controlWithOptions = field.form;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
|
-
$[4] = controlWithOptions;
|
|
147
|
-
$[5] = innerProps;
|
|
148
|
-
$[6] = props.error;
|
|
149
|
-
$[7] = props.isDisabled;
|
|
150
|
-
$[8] = ref;
|
|
151
|
-
$[9] = t0;
|
|
152
|
-
} else t0 = $[9];
|
|
153
|
-
let t1;
|
|
154
|
-
if ($[10] !== field.form || $[11] !== field.name || $[12] !== t0) {
|
|
155
|
-
t1 = /* @__PURE__ */ jsx(FieldController, {
|
|
156
|
-
control: field.form,
|
|
157
|
-
name: field.name,
|
|
158
|
-
render: t0
|
|
159
|
-
});
|
|
160
|
-
$[10] = field.form;
|
|
161
|
-
$[11] = field.name;
|
|
162
|
-
$[12] = t0;
|
|
163
|
-
$[13] = t1;
|
|
164
|
-
} else t1 = $[13];
|
|
165
|
-
return t1;
|
|
86
|
+
return /* @__PURE__ */ jsx(FieldController, {
|
|
87
|
+
control: field.form,
|
|
88
|
+
name: field.name,
|
|
89
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(QueryAutocompleteContent, {
|
|
90
|
+
...innerProps,
|
|
91
|
+
ref: mergeRefs(ref, field.ref),
|
|
92
|
+
value: field.value,
|
|
93
|
+
onChange: field.onChange,
|
|
94
|
+
onBlur: field.onBlur,
|
|
95
|
+
isDirty,
|
|
96
|
+
isDisabled: field.disabled || props.isDisabled || !!controlWithOptions._options?.disabled,
|
|
97
|
+
error: props.error ?? error?.message
|
|
98
|
+
})
|
|
99
|
+
});
|
|
166
100
|
}
|
|
167
|
-
|
|
168
|
-
if ($[14] !== props) {
|
|
169
|
-
t0 = /* @__PURE__ */ jsx(QueryAutocompleteContent, { ...props });
|
|
170
|
-
$[14] = props;
|
|
171
|
-
$[15] = t0;
|
|
172
|
-
} else t0 = $[15];
|
|
173
|
-
return t0;
|
|
101
|
+
return /* @__PURE__ */ jsx(QueryAutocompleteContent, { ...props });
|
|
174
102
|
};
|
|
103
|
+
const QueryAutocomplete = memo(QueryAutocompleteComponent);
|
|
175
104
|
//#endregion
|
|
176
105
|
export { QueryAutocomplete };
|
|
@@ -1,39 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { AutocompleteProps } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { FieldValues } from "../../shared/form.binding.js";
|
|
2
|
+
import { GroupedSelectControlProps, GroupedSelectProps, SelectItem } from "../shared/select.types.js";
|
|
3
|
+
import { OmitDiscriminatedUnion } from "../../../../types/common.js";
|
|
4
|
+
import { AutocompleteProps } from "./Autocomplete.js";
|
|
5
|
+
import { Key } from "react-aria-components";
|
|
6
|
+
import { InfiniteData, UseInfiniteQueryResult, UseQueryResult } from "@tanstack/react-query";
|
|
7
|
+
//#region src/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts
|
|
8
|
+
type QueryResult<TData> = UseQueryResult<TData> | UseInfiniteQueryResult<TData>;
|
|
9
|
+
type QueryFn = (params: any, options?: any) => QueryResult<any>;
|
|
10
|
+
type ExtractQueryParams<TQueryFn> = TQueryFn extends ((params: infer TParams, ...args: any[]) => any) ? TParams : never;
|
|
11
|
+
type ExtractQueryOptions<TQueryFn> = TQueryFn extends ((params: any, options?: infer TOptions) => any) ? TOptions : never;
|
|
12
|
+
type QueryDataType<TQueryFn extends QueryFn> = Exclude<ReturnType<TQueryFn>["data"], undefined>;
|
|
13
|
+
type ExtractPageType<T> = T extends InfiniteData<infer TPage> ? TPage : T;
|
|
14
|
+
type ExtractedDataType<TQueryFn extends QueryFn> = ExtractPageType<QueryDataType<TQueryFn>> | ExtractPageType<QueryDataType<TQueryFn>>[];
|
|
15
|
+
type QueryAutocompleteProps<TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn> = OmitDiscriminatedUnion<AutocompleteProps<TSelectItem["id"]>, "items" | "onSearchChange" | "isLoading" | keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TSelectItem["id"]> & {
|
|
16
|
+
query: TQueryFn;
|
|
17
|
+
queryParams?: Omit<ExtractQueryParams<TQueryFn>, "search" | "limit"> & {
|
|
18
|
+
limit?: number;
|
|
19
|
+
};
|
|
20
|
+
queryOptions?: ExtractQueryOptions<TQueryFn>;
|
|
21
|
+
queryMap?: (data: ExtractedDataType<TQueryFn>) => SelectItem<TSelectItem["id"]>[];
|
|
22
|
+
resolveSelectedItemsWithIds?: boolean;
|
|
23
|
+
isInitialQueryDisabled?: boolean;
|
|
10
24
|
};
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
export type ExtractQueryParams<TQueryFn> = TQueryFn extends (params: infer TParams, ...args: any[]) => any ? TParams : never;
|
|
14
|
-
export type ExtractQueryOptions<TQueryFn> = TQueryFn extends (params: any, options?: infer TOptions) => any ? TOptions : never;
|
|
15
|
-
export type QueryDataType<TQueryFn extends QueryFn> = Exclude<ReturnType<TQueryFn>["data"], undefined>;
|
|
16
|
-
export type ExtractPageType<T> = T extends InfiniteData<infer TPage> ? TPage : T;
|
|
17
|
-
export type ExtractedDataType<TQueryFn extends QueryFn> = ExtractPageType<QueryDataType<TQueryFn>> | ExtractPageType<QueryDataType<TQueryFn>>[];
|
|
18
|
-
export type QueryAutocompleteProps<TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn> = OmitDiscriminatedUnion<AutocompleteProps<TSelectItem["id"]>, "items" | "onSearchChange" | "isLoading" | keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TSelectItem["id"]> & {
|
|
19
|
-
query: TQueryFn;
|
|
20
|
-
queryParams?: Omit<ExtractQueryParams<TQueryFn>, "search" | "limit"> & {
|
|
21
|
-
limit?: number;
|
|
22
|
-
};
|
|
23
|
-
queryOptions?: ExtractQueryOptions<TQueryFn>;
|
|
24
|
-
queryMap?: (data: ExtractedDataType<TQueryFn>) => SelectItem<TSelectItem["id"]>[];
|
|
25
|
-
resolveSelectedItemsWithIds?: boolean;
|
|
26
|
-
isInitialQueryDisabled?: boolean;
|
|
27
|
-
};
|
|
28
|
-
export interface UseQueryAutocompleteOptions<TQueryFn extends QueryFn, TKey extends Key = Key> {
|
|
29
|
-
query: TQueryFn;
|
|
30
|
-
queryParams?: Omit<ExtractQueryParams<TQueryFn>, "search" | "limit"> & {
|
|
31
|
-
limit?: number;
|
|
32
|
-
};
|
|
33
|
-
queryOptions?: ExtractQueryOptions<TQueryFn>;
|
|
34
|
-
mapItems: (data: QueryDataType<TQueryFn>) => SelectItem<TKey>[];
|
|
35
|
-
resolveSelectedItemsWithIds?: boolean;
|
|
36
|
-
initialQueryState?: boolean;
|
|
37
|
-
search?: string;
|
|
38
|
-
selectedIdsToResolve?: TKey[];
|
|
39
|
-
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { ExtractPageType, ExtractQueryOptions, ExtractQueryParams, ExtractedDataType, QueryAutocompleteProps, QueryDataType, QueryFn, QueryResult };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { SelectProps } from
|
|
5
|
-
import { QueryDataType, QueryFn } from
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { FieldValues } from "../../shared/form.binding.js";
|
|
2
|
+
import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps, SelectItem } from "../shared/select.types.js";
|
|
3
|
+
import { OmitDiscriminatedUnion } from "../../../../types/common.js";
|
|
4
|
+
import { SelectProps } from "./Select.js";
|
|
5
|
+
import { QueryDataType, QueryFn } from "../shared/querySelect.utils.js";
|
|
6
|
+
import { Key } from "react-aria-components";
|
|
7
|
+
//#region src/components/inputs/Selection/Select/QuerySelect.d.ts
|
|
8
|
+
type QuerySelectProps<TFieldValues extends FieldValues, TQueryFn extends QueryFn, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = OmitDiscriminatedUnion<SelectProps<TKey, TInitialSelectItem>, "items" | "totalItems" | keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TKey, TInitialSelectItem> & {
|
|
9
|
+
query: TQueryFn;
|
|
10
|
+
queryParams?: Parameters<TQueryFn>[0];
|
|
11
|
+
queryOptions?: Parameters<TQueryFn>[1];
|
|
12
|
+
queryMap?: (data: QueryDataType<TQueryFn>) => SelectItem<TKey>[];
|
|
13
|
+
resolveSelectedItemsWithIds?: boolean;
|
|
14
|
+
isInitialQueryDisabled?: boolean;
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
+
declare const QuerySelectComponent: <TFieldValues extends FieldValues, TQueryFn extends QueryFn, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: QuerySelectProps<TFieldValues, TQueryFn, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare const QuerySelect: typeof QuerySelectComponent;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { QuerySelect, QuerySelectProps };
|
|
@@ -3,12 +3,11 @@ import { FieldController } from "../../shared/form.binding.js";
|
|
|
3
3
|
import { Select } from "./Select.js";
|
|
4
4
|
import { getQueryItems, getSelectionIdsToResolve } from "../shared/querySelect.utils.js";
|
|
5
5
|
import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
|
|
6
|
-
import { useState } from "react";
|
|
7
|
-
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { memo, useCallback, useMemo, useState } from "react";
|
|
8
7
|
import { jsx } from "react/jsx-runtime";
|
|
9
8
|
import { mergeRefs } from "@react-aria/utils";
|
|
10
9
|
//#region src/components/inputs/Selection/Select/QuerySelect.tsx
|
|
11
|
-
|
|
10
|
+
const LoadedQuerySelectContent = ({ query, queryParams, queryOptions, queryMap, resolveSelectedItemsWithIds, isQueryEnabledInitially = false, ...props }) => {
|
|
12
11
|
const ui = UIConfig.useConfig();
|
|
13
12
|
const [search, setSearch] = useState("");
|
|
14
13
|
const isSearchable = props.isSearchable ?? ui.select.isSearchable;
|
|
@@ -25,19 +24,23 @@ var LoadedQuerySelectContent = ({ query, queryParams, queryOptions, queryMap, re
|
|
|
25
24
|
query,
|
|
26
25
|
queryParams,
|
|
27
26
|
queryOptions,
|
|
28
|
-
mapItems: (data) => getQueryItems(data, queryMap),
|
|
27
|
+
mapItems: useCallback((data) => getQueryItems(data, queryMap), [queryMap]),
|
|
29
28
|
resolveSelectedItemsWithIds: resolveSelectedItemsWithIds ?? ui.querySelect?.resolveSelectedItemsWithIds,
|
|
30
29
|
search: isSearchable ? search : void 0,
|
|
31
30
|
initialQueryState: shouldDisableInitialQuery,
|
|
32
31
|
selectedIdsToResolve: selectedIdsToResolve.items
|
|
33
32
|
});
|
|
34
|
-
const {
|
|
35
|
-
const
|
|
36
|
-
|
|
33
|
+
const { onSearchChange } = props;
|
|
34
|
+
const selectProps = useMemo(() => {
|
|
35
|
+
const { isInitialQueryDisabled: _, onSearchChange: __, ...rest } = props;
|
|
36
|
+
return rest;
|
|
37
|
+
}, [props]);
|
|
38
|
+
const handleSearchChange = useCallback((value) => {
|
|
39
|
+
setSearch(value);
|
|
37
40
|
handleEnableQuery();
|
|
38
|
-
onSearchChange?.(
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
+
onSearchChange?.(value);
|
|
42
|
+
}, [handleEnableQuery, onSearchChange]);
|
|
43
|
+
const asyncSelectProps = useMemo(() => ({
|
|
41
44
|
...selectProps,
|
|
42
45
|
items,
|
|
43
46
|
isLoading,
|
|
@@ -51,122 +54,62 @@ var LoadedQuerySelectContent = ({ query, queryParams, queryOptions, queryMap, re
|
|
|
51
54
|
isClientSearchDisabled: true,
|
|
52
55
|
onSearchChange: handleSearchChange
|
|
53
56
|
}
|
|
54
|
-
})
|
|
57
|
+
}), [
|
|
58
|
+
selectProps,
|
|
59
|
+
items,
|
|
60
|
+
isLoading,
|
|
61
|
+
totalItems,
|
|
62
|
+
hasNextPage,
|
|
63
|
+
fetchNextPage,
|
|
64
|
+
props.searchDebounceDelay,
|
|
65
|
+
ui.querySelect?.searchDebounceDelay,
|
|
66
|
+
handleEnableQuery,
|
|
67
|
+
isSearchable,
|
|
68
|
+
handleSearchChange
|
|
69
|
+
]);
|
|
70
|
+
return /* @__PURE__ */ jsx(Select, { ...asyncSelectProps });
|
|
55
71
|
};
|
|
56
|
-
|
|
57
|
-
const $ = c(9);
|
|
72
|
+
const QuerySelectContent = (props) => {
|
|
58
73
|
const [isQueryMounted, setIsQueryMounted] = useState(false);
|
|
59
74
|
const value = "value" in props ? props.value : void 0;
|
|
60
75
|
if (!getSelectionIdsToResolve({
|
|
61
76
|
initialSelection: props.initialSelection,
|
|
62
77
|
value,
|
|
63
78
|
mapInitialToSelectItem: props.mapInitialToSelectItem
|
|
64
|
-
}).isResolvedByInitialSelection || isQueryMounted) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
let selectProps;
|
|
78
|
-
if ($[3] !== props) {
|
|
79
|
-
const { query: _, queryParams: _queryParams, queryOptions: _queryOptions, queryMap: _queryMap, resolveSelectedItemsWithIds: _resolveSelectedItemsWithIds, isInitialQueryDisabled: _isInitialQueryDisabled, ...t0 } = props;
|
|
80
|
-
selectProps = t0;
|
|
81
|
-
$[3] = props;
|
|
82
|
-
$[4] = selectProps;
|
|
83
|
-
} else selectProps = $[4];
|
|
84
|
-
let t0;
|
|
85
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
86
|
-
t0 = () => setIsQueryMounted(true);
|
|
87
|
-
$[5] = t0;
|
|
88
|
-
} else t0 = $[5];
|
|
89
|
-
const mountQuery = t0;
|
|
90
|
-
let t1;
|
|
91
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
92
|
-
t1 = [];
|
|
93
|
-
$[6] = t1;
|
|
94
|
-
} else t1 = $[6];
|
|
95
|
-
let t2;
|
|
96
|
-
if ($[7] !== selectProps) {
|
|
97
|
-
t2 = /* @__PURE__ */ jsx(Select, {
|
|
98
|
-
...selectProps,
|
|
99
|
-
items: t1,
|
|
100
|
-
onMouseEnter: mountQuery,
|
|
101
|
-
onFocusCapture: mountQuery
|
|
102
|
-
});
|
|
103
|
-
$[7] = selectProps;
|
|
104
|
-
$[8] = t2;
|
|
105
|
-
} else t2 = $[8];
|
|
106
|
-
return t2;
|
|
79
|
+
}).isResolvedByInitialSelection || isQueryMounted) return /* @__PURE__ */ jsx(LoadedQuerySelectContent, {
|
|
80
|
+
...props,
|
|
81
|
+
isQueryEnabledInitially: isQueryMounted
|
|
82
|
+
});
|
|
83
|
+
const { query: _, queryParams: _queryParams, queryOptions: _queryOptions, queryMap: _queryMap, resolveSelectedItemsWithIds: _resolveSelectedItemsWithIds, isInitialQueryDisabled: _isInitialQueryDisabled, ...selectProps } = props;
|
|
84
|
+
const mountQuery = () => setIsQueryMounted(true);
|
|
85
|
+
return /* @__PURE__ */ jsx(Select, {
|
|
86
|
+
...selectProps,
|
|
87
|
+
items: [],
|
|
88
|
+
onMouseEnter: mountQuery,
|
|
89
|
+
onFocusCapture: mountQuery
|
|
90
|
+
});
|
|
107
91
|
};
|
|
108
|
-
|
|
109
|
-
const $ = c(16);
|
|
92
|
+
const QuerySelectComponent = (props) => {
|
|
110
93
|
if ("field" in props && props.field) {
|
|
111
|
-
|
|
112
|
-
let innerProps;
|
|
113
|
-
let ref;
|
|
114
|
-
if ($[0] !== props) {
|
|
115
|
-
({field, ref, ...innerProps} = props);
|
|
116
|
-
$[0] = props;
|
|
117
|
-
$[1] = field;
|
|
118
|
-
$[2] = innerProps;
|
|
119
|
-
$[3] = ref;
|
|
120
|
-
} else {
|
|
121
|
-
field = $[1];
|
|
122
|
-
innerProps = $[2];
|
|
123
|
-
ref = $[3];
|
|
124
|
-
}
|
|
94
|
+
const { field, ref, ...innerProps } = props;
|
|
125
95
|
const controlWithOptions = field.form;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
$[4] = controlWithOptions;
|
|
143
|
-
$[5] = innerProps;
|
|
144
|
-
$[6] = props.error;
|
|
145
|
-
$[7] = props.isDisabled;
|
|
146
|
-
$[8] = ref;
|
|
147
|
-
$[9] = t0;
|
|
148
|
-
} else t0 = $[9];
|
|
149
|
-
let t1;
|
|
150
|
-
if ($[10] !== field.form || $[11] !== field.name || $[12] !== t0) {
|
|
151
|
-
t1 = /* @__PURE__ */ jsx(FieldController, {
|
|
152
|
-
control: field.form,
|
|
153
|
-
name: field.name,
|
|
154
|
-
render: t0
|
|
155
|
-
});
|
|
156
|
-
$[10] = field.form;
|
|
157
|
-
$[11] = field.name;
|
|
158
|
-
$[12] = t0;
|
|
159
|
-
$[13] = t1;
|
|
160
|
-
} else t1 = $[13];
|
|
161
|
-
return t1;
|
|
96
|
+
return /* @__PURE__ */ jsx(FieldController, {
|
|
97
|
+
control: field.form,
|
|
98
|
+
name: field.name,
|
|
99
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(QuerySelectContent, {
|
|
100
|
+
...innerProps,
|
|
101
|
+
ref: mergeRefs(ref, field.ref),
|
|
102
|
+
value: field.value,
|
|
103
|
+
onChange: field.onChange,
|
|
104
|
+
onBlur: field.onBlur,
|
|
105
|
+
isDirty,
|
|
106
|
+
isDisabled: field.disabled || props.isDisabled || !!controlWithOptions._options?.disabled,
|
|
107
|
+
error: props.error ?? error?.message
|
|
108
|
+
})
|
|
109
|
+
});
|
|
162
110
|
}
|
|
163
|
-
|
|
164
|
-
if ($[14] !== props) {
|
|
165
|
-
t0 = /* @__PURE__ */ jsx(QuerySelectContent, { ...props });
|
|
166
|
-
$[14] = props;
|
|
167
|
-
$[15] = t0;
|
|
168
|
-
} else t0 = $[15];
|
|
169
|
-
return t0;
|
|
111
|
+
return /* @__PURE__ */ jsx(QuerySelectContent, { ...props });
|
|
170
112
|
};
|
|
113
|
+
const QuerySelect = memo(QuerySelectComponent);
|
|
171
114
|
//#endregion
|
|
172
115
|
export { QuerySelect };
|