@povio/ui 3.4.0-rc.10 → 3.4.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/Account.d.ts +2 -0
- package/dist/assets/icons/AlignCenter.d.ts +2 -0
- package/dist/assets/icons/AlignCenter.js +30 -0
- package/dist/assets/icons/AlignLeft.d.ts +2 -0
- package/dist/assets/icons/AlignLeft.js +30 -0
- package/dist/assets/icons/AlignLeftRight.d.ts +2 -0
- package/dist/assets/icons/AlignLeftRight.js +30 -0
- package/dist/assets/icons/AlignRight.d.ts +2 -0
- package/dist/assets/icons/AlignRight.js +30 -0
- package/dist/assets/icons/ArrowDropDown.d.ts +2 -0
- package/dist/assets/icons/ArrowDropDown.js +30 -0
- package/dist/assets/icons/ArrowDropUp.d.ts +2 -0
- package/dist/assets/icons/ArrowDropUp.js +30 -0
- package/dist/assets/icons/ArrowLeft.d.ts +2 -0
- package/dist/assets/icons/ArrowLeft.js +30 -0
- package/dist/assets/icons/ArrowRight.d.ts +2 -0
- package/dist/assets/icons/ArrowRight.js +30 -0
- package/dist/assets/icons/Board.d.ts +2 -0
- package/dist/assets/icons/Bold.d.ts +2 -0
- package/dist/assets/icons/Bold.js +30 -0
- package/dist/assets/icons/BulletedList.d.ts +2 -0
- package/dist/assets/icons/BulletedList.js +30 -0
- package/dist/assets/icons/Calendar.d.ts +2 -0
- package/dist/assets/icons/Calendar.js +32 -0
- package/dist/assets/icons/Check.d.ts +2 -0
- package/dist/assets/icons/Check.js +32 -0
- package/dist/assets/icons/CheckCircle.d.ts +2 -0
- package/dist/assets/icons/CheckCircle.js +30 -0
- package/dist/assets/icons/CheckboxCheckmark.d.ts +2 -0
- package/dist/assets/icons/CheckboxCheckmark.js +33 -0
- package/dist/assets/icons/CheckboxIndeterminate.d.ts +2 -0
- package/dist/assets/icons/CheckboxIndeterminate.js +33 -0
- package/dist/assets/icons/ChevronDown.d.ts +2 -0
- package/dist/assets/icons/ChevronDown.js +32 -0
- package/dist/assets/icons/ChevronLeft.d.ts +2 -0
- package/dist/assets/icons/ChevronLeft.js +32 -0
- package/dist/assets/icons/ChevronRight.d.ts +2 -0
- package/dist/assets/icons/ChevronRight.js +32 -0
- package/dist/assets/icons/ChevronUp.d.ts +2 -0
- package/dist/assets/icons/ChevronUp.js +32 -0
- package/dist/assets/icons/ChevronsLeft.d.ts +2 -0
- package/dist/assets/icons/ChevronsLeft.js +32 -0
- package/dist/assets/icons/ChevronsRight.d.ts +2 -0
- package/dist/assets/icons/ChevronsRight.js +32 -0
- package/dist/assets/icons/Clock.d.ts +2 -0
- package/dist/assets/icons/Clock.js +30 -0
- package/dist/assets/icons/Close.d.ts +2 -0
- package/dist/assets/icons/Close.js +30 -0
- package/dist/assets/icons/DateTime.d.ts +2 -0
- package/dist/assets/icons/DateTime.js +39 -0
- package/dist/assets/icons/DragIndicator.d.ts +2 -0
- package/dist/assets/icons/DragIndicator.js +30 -0
- package/dist/assets/icons/Edit.d.ts +2 -0
- package/dist/assets/icons/Emoji.d.ts +2 -0
- package/dist/assets/icons/File.d.ts +2 -0
- package/dist/assets/icons/File.js +32 -0
- package/dist/assets/icons/Grid.d.ts +2 -0
- package/dist/assets/icons/Highlight.d.ts +2 -0
- package/dist/assets/icons/Highlight.js +30 -0
- package/dist/assets/icons/HighlightOn.d.ts +6 -0
- package/dist/assets/icons/HighlightOn.js +55 -0
- package/dist/assets/icons/Home.d.ts +2 -0
- package/dist/assets/icons/Home.js +30 -0
- package/dist/assets/icons/Image.d.ts +2 -0
- package/dist/assets/icons/ImageError.d.ts +2 -0
- package/dist/assets/icons/Info.d.ts +2 -0
- package/dist/assets/icons/Info.js +41 -0
- package/dist/assets/icons/Italic.d.ts +2 -0
- package/dist/assets/icons/Italic.js +30 -0
- package/dist/assets/icons/Link.d.ts +2 -0
- package/dist/assets/icons/Link.js +30 -0
- package/dist/assets/icons/Loader.d.ts +2 -0
- package/dist/assets/icons/MapPin.d.ts +2 -0
- package/dist/assets/icons/Menu.d.ts +2 -0
- package/dist/assets/icons/Menu.js +30 -0
- package/dist/assets/icons/Minus.d.ts +2 -0
- package/dist/assets/icons/MoreHoriz.d.ts +2 -0
- package/dist/assets/icons/NumberedList.d.ts +2 -0
- package/dist/assets/icons/NumberedList.js +30 -0
- package/dist/assets/icons/Pause.d.ts +2 -0
- package/dist/assets/icons/Plus.d.ts +2 -0
- package/dist/assets/icons/PointerHorizontal.d.ts +2 -0
- package/dist/assets/icons/PointerHorizontal.js +30 -0
- package/dist/assets/icons/PointerVertical.d.ts +2 -0
- package/dist/assets/icons/PointerVertical.js +30 -0
- package/dist/assets/icons/Retry.d.ts +2 -0
- package/dist/assets/icons/Search.d.ts +2 -0
- package/dist/assets/icons/Search.js +30 -0
- package/dist/assets/icons/Send.d.ts +2 -0
- package/dist/assets/icons/Send.js +32 -0
- package/dist/assets/icons/Share.d.ts +2 -0
- package/dist/assets/icons/Slash.d.ts +2 -0
- package/dist/assets/icons/Strikethrough.d.ts +2 -0
- package/dist/assets/icons/Strikethrough.js +30 -0
- package/dist/assets/icons/TextColor.d.ts +6 -0
- package/dist/assets/icons/TextColor.js +52 -0
- package/dist/assets/icons/Today.d.ts +2 -0
- package/dist/assets/icons/Today.js +30 -0
- package/dist/assets/icons/Trash.d.ts +2 -0
- package/dist/assets/icons/Underlined.d.ts +2 -0
- package/dist/assets/icons/Underlined.js +32 -0
- package/dist/assets/icons/Upload.d.ts +2 -0
- package/dist/assets/icons/Upload.js +39 -0
- package/dist/assets/icons/User.d.ts +2 -0
- package/dist/assets/icons/Visibility.d.ts +2 -0
- package/dist/assets/icons/Visibility.js +30 -0
- package/dist/assets/icons/VisibilityOff.d.ts +2 -0
- package/dist/assets/icons/VisibilityOff.js +30 -0
- package/dist/assets/icons/WarningFilled.d.ts +2 -0
- package/dist/assets/icons/WarningFilled.js +32 -0
- package/dist/assets/icons/WarningOutlined.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +7 -7
- package/dist/components/Menu/MenuDesktop.js +1 -1
- package/dist/components/Menu/MenuItem.js +4 -4
- package/dist/components/Menu/MenuMobile.js +5 -5
- package/dist/components/Menu/MenuPopover.js +2 -2
- package/dist/components/buttons/Button/Button.js +1 -1
- package/dist/components/buttons/PillButton/PillButton.js +4 -4
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/buttons/SplitButton/SplitButton.js +3 -3
- package/dist/components/buttons/shared/ButtonContent.js +2 -2
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +1 -1
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +2 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +102 -95
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +3 -2
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +2 -1
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +115 -111
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +22 -17
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +23 -17
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +25 -21
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +2 -2
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +238 -225
- package/dist/components/inputs/DateTime/shared/Calendar.js +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +10 -7
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +12 -8
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/DateField.js +4 -4
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -2
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +16 -8
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +3 -3
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +2 -2
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +1 -1
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +2 -2
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +2 -2
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +5 -4
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +11 -10
- package/dist/components/inputs/DateTime/shared/YearPicker.js +2 -2
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +1 -46
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +1 -1
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +20 -20
- package/dist/components/inputs/File/InputUpload.d.ts +1 -1
- package/dist/components/inputs/File/InputUpload.js +19 -19
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/inputUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +1 -1
- package/dist/components/inputs/File/shared/FileCardList.js +1 -1
- package/dist/components/inputs/File/shared/FileUploadContent.js +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +3 -3
- package/dist/components/inputs/File/shared/FileUploadContentError.js +6 -5
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +6 -5
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +5 -4
- package/dist/components/inputs/File/shared/InputUploadContent.js +4 -4
- package/dist/components/inputs/File/shared/InputUploadFilled.js +3 -3
- package/dist/components/inputs/FormField/FormFieldError.js +1 -1
- package/dist/components/inputs/FormField/FormFieldHeader.js +4 -4
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +3 -3
- package/dist/components/inputs/FormField/FormFieldHelper.js +1 -1
- package/dist/components/inputs/FormField/FormFieldLabel.js +2 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +107 -109
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +1 -2
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +254 -265
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +1 -2
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +24 -25
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +4 -3
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -2
- package/dist/components/inputs/Input/TextArea/TextArea.js +117 -118
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +129 -129
- package/dist/components/inputs/Input/shared/InputContent.d.ts +1 -2
- package/dist/components/inputs/Input/shared/InputContent.js +48 -50
- package/dist/components/inputs/Inputs/Form.d.ts +4 -4
- package/dist/components/inputs/Inputs/Form.js +1 -1
- package/dist/components/inputs/Inputs/InputItem.d.ts +22 -22
- package/dist/components/inputs/Inputs/InputItem.js +37 -36
- package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +2 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +113 -109
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +16 -16
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +20 -20
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.js +20 -20
- package/dist/components/inputs/Selection/Select/Select.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/Select.js +23 -23
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +37 -34
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +56 -58
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +56 -57
- package/dist/components/inputs/Selection/shared/SelectListBox.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +4 -5
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +3 -3
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +9 -5
- package/dist/components/inputs/Selection/shared/select.types.d.ts +1 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.js +7 -10
- package/dist/components/inputs/Slider/Slider.d.ts +1 -1
- package/dist/components/inputs/Slider/Slider.js +20 -20
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +20 -20
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +2 -2
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +4 -4
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +4 -4
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +8 -5
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +3 -3
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +5 -4
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +5 -4
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +9 -6
- package/dist/components/inputs/Toggle/Toggle.d.ts +2 -1
- package/dist/components/inputs/Toggle/Toggle.js +65 -61
- package/dist/components/inputs/shared/CheckContent.js +1 -1
- package/dist/components/inputs/shared/InputClear.js +28 -45
- package/dist/components/inputs/shared/TooltipWrapper.d.ts +1 -1
- package/dist/components/inputs/shared/form.types.d.ts +8 -9
- package/dist/components/inputs/shared/input.cva.js +1 -1
- package/dist/components/inputs/shared/useStaticInputHandoff.js +38 -64
- package/dist/components/navigation/Accordion/Accordion.js +1 -1
- package/dist/components/navigation/Accordion/AccordionItem.js +3 -3
- package/dist/components/navigation/Stepper/Stepper.js +2 -2
- package/dist/components/navigation/Stepper/StepperItem.js +4 -4
- package/dist/components/overlays/ActionModal/ActionModal.js +1 -1
- package/dist/components/overlays/BottomSheet/BottomSheet.js +3 -3
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +4 -4
- package/dist/components/overlays/Drawer/Drawer.js +2 -2
- package/dist/components/overlays/Modal/Modal.js +3 -3
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +8 -15
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +1 -1
- package/dist/components/segment/Segment.d.ts +1 -1
- package/dist/components/segment/Segment.js +21 -21
- package/dist/components/segment/SegmentItem.js +1 -1
- package/dist/components/segment/segment.types.d.ts +1 -1
- package/dist/components/shared/pagination/Pagination.js +1 -1
- package/dist/components/shared/pagination/PaginationList.js +9 -6
- package/dist/components/table/ColumnConfig.js +1 -1
- package/dist/components/table/InfiniteTable.js +1 -1
- package/dist/components/table/Table.js +8 -6
- package/dist/components/text/Link/Link.js +1 -1
- package/dist/components/text/Pill/Pill.js +3 -3
- package/dist/components/text/Tag/Tag.js +3 -3
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +1 -1
- package/dist/config/router.context.js +1 -1
- package/dist/config/theme.context.js +1 -1
- package/dist/config/uiConfig.context.d.ts +5 -14
- package/dist/config/uiConfig.context.js +11 -9
- package/dist/config/uiOverrides.context.js +2 -2
- package/dist/helpers/dynamicColumns.d.ts +1 -1
- package/dist/helpers/dynamicInputs.d.ts +7 -7
- package/dist/hooks/useAutosave.d.ts +4 -4
- package/dist/hooks/useAutosave.js +49 -64
- package/dist/hooks/useFilters.js +1 -1
- package/dist/hooks/useForm.d.ts +15 -39
- package/dist/hooks/useForm.js +43 -96
- package/dist/hooks/useFormAutosave.d.ts +9 -8
- package/dist/hooks/useFormAutosave.js +9 -23
- package/dist/hooks/useIntersectionObserver.js +1 -1
- package/dist/hooks/useLocalStorage.js +1 -1
- package/dist/hooks/usePagination.js +1 -1
- package/dist/hooks/useScrollableListBox.js +1 -1
- package/dist/hooks/useSorting.js +1 -1
- package/dist/hooks/useStateAndRef.js +1 -1
- package/dist/hooks/useTableColumnConfig.js +1 -1
- package/dist/index.d.ts +263 -1
- package/dist/index.js +71 -11
- package/package.json +3 -15
- package/dist/assets/locales/en/translation.json.d.ts +0 -158
- package/dist/assets/locales/sl/translation.json.d.ts +0 -154
- package/dist/components/inputs/shared/form.binding.d.ts +0 -27
- package/dist/components/inputs/shared/form.binding.js +0 -57
- package/dist/components/inputs/shared/form.types.js +0 -8
- package/dist/rhf/Inputs.d.ts +0 -60
- package/dist/rhf/Inputs.js +0 -148
- package/dist/rhf/components.d.ts +0 -80
- package/dist/rhf/components.js +0 -101
- package/dist/rhf/dynamicInputs.d.ts +0 -18
- package/dist/rhf/dynamicInputs.js +0 -5
- package/dist/rhf/fieldAdapter.d.ts +0 -7
- package/dist/rhf/fieldAdapter.js +0 -40
- package/dist/rhf/form.types.d.ts +0 -12
- package/dist/rhf/useAutosave.d.ts +0 -10
- package/dist/rhf/useAutosave.js +0 -71
- package/dist/rhf/useForm.d.ts +0 -18
- package/dist/rhf/useForm.js +0 -48
- package/dist/rhf/useFormAutosave.d.ts +0 -15
- package/dist/rhf/useFormAutosave.js +0 -59
- package/dist/rhf.d.ts +0 -225
- package/dist/tanstack.d.ts +0 -224
- package/dist/tanstack.js +0 -141
- /package/dist/{rhf/entrypoints.type-test.d.ts → hooks/useAutosave.spec.d.ts} +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
|
-
import { FieldController } from "../../shared/form.binding.js";
|
|
4
3
|
import { FormField } from "../../FormField/FormField.js";
|
|
5
4
|
import { inputBaseDefinition } from "../../shared/input.cva.js";
|
|
6
5
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
7
6
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
8
7
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
9
8
|
import { InputContent } from "../shared/InputContent.js";
|
|
9
|
+
import { c } from "react/compiler-runtime";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
11
|
import { clsx } from "clsx";
|
|
11
12
|
import { useEffect, useRef, useState } from "react";
|
|
12
13
|
import { Input } from "react-aria-components";
|
|
13
|
-
import { c } from "react/compiler-runtime";
|
|
14
|
-
import { jsx } from "react/jsx-runtime";
|
|
15
14
|
import { useFocusVisible, useTextField } from "react-aria";
|
|
16
15
|
import { mergeRefs } from "@react-aria/utils";
|
|
16
|
+
import { Controller } from "react-hook-form";
|
|
17
17
|
//#region src/components/inputs/Input/TextInput/TextInput.tsx
|
|
18
18
|
var TextInputBase = (props) => {
|
|
19
|
-
const $ = c(
|
|
19
|
+
const $ = c(84);
|
|
20
20
|
const ui = UIConfig.useConfig();
|
|
21
21
|
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
22
22
|
const inputRef = useRef(null);
|
|
23
|
-
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, as: asProp, hideLabel: hideLabelProp, variant: variantProp, size: sizeProp, isClearable: isClearableProp,
|
|
23
|
+
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, as: asProp, hideLabel: hideLabelProp, variant: variantProp, size: sizeProp, isClearable: isClearableProp, autoFocusOnMount, ...rest } = props;
|
|
24
24
|
const as = asProp ?? ui.input.as;
|
|
25
25
|
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
26
26
|
const variant = variantProp ?? ui.input.variant;
|
|
@@ -87,7 +87,7 @@ var TextInputBase = (props) => {
|
|
|
87
87
|
} else t3 = $[15];
|
|
88
88
|
const formFieldProps = t3;
|
|
89
89
|
let t4;
|
|
90
|
-
if ($[16] !== action || $[17] !== inputValue || $[18] !== isClearable || $[19] !==
|
|
90
|
+
if ($[16] !== action || $[17] !== inputValue || $[18] !== isClearable || $[19] !== isDisabled || $[20] !== isLoading || $[21] !== leadingIcon || $[22] !== onBlur || $[23] !== onChange || $[24] !== trailingIcon || $[25] !== unit) {
|
|
91
91
|
t4 = {
|
|
92
92
|
unit,
|
|
93
93
|
isLoading,
|
|
@@ -96,7 +96,6 @@ var TextInputBase = (props) => {
|
|
|
96
96
|
leadingIcon,
|
|
97
97
|
trailingIcon,
|
|
98
98
|
isClearable,
|
|
99
|
-
isClearableIfDisabled,
|
|
100
99
|
value: inputValue,
|
|
101
100
|
onChange,
|
|
102
101
|
onBlur
|
|
@@ -104,20 +103,19 @@ var TextInputBase = (props) => {
|
|
|
104
103
|
$[16] = action;
|
|
105
104
|
$[17] = inputValue;
|
|
106
105
|
$[18] = isClearable;
|
|
107
|
-
$[19] =
|
|
108
|
-
$[20] =
|
|
109
|
-
$[21] =
|
|
110
|
-
$[22] =
|
|
111
|
-
$[23] =
|
|
112
|
-
$[24] =
|
|
113
|
-
$[25] =
|
|
114
|
-
$[26] =
|
|
115
|
-
|
|
116
|
-
} else t4 = $[27];
|
|
106
|
+
$[19] = isDisabled;
|
|
107
|
+
$[20] = isLoading;
|
|
108
|
+
$[21] = leadingIcon;
|
|
109
|
+
$[22] = onBlur;
|
|
110
|
+
$[23] = onChange;
|
|
111
|
+
$[24] = trailingIcon;
|
|
112
|
+
$[25] = unit;
|
|
113
|
+
$[26] = t4;
|
|
114
|
+
} else t4 = $[26];
|
|
117
115
|
const inputContentProps = t4;
|
|
118
116
|
const t5 = hideLabel || isHeaderHidden;
|
|
119
117
|
let t6;
|
|
120
|
-
if ($[
|
|
118
|
+
if ($[27] !== headerClassName || $[28] !== helperText || $[29] !== isDisabled || $[30] !== isRequired || $[31] !== label || $[32] !== labelProps || $[33] !== rightContent || $[34] !== t5 || $[35] !== tooltipText) {
|
|
121
119
|
t6 = {
|
|
122
120
|
label,
|
|
123
121
|
tooltipText,
|
|
@@ -129,17 +127,17 @@ var TextInputBase = (props) => {
|
|
|
129
127
|
className: headerClassName,
|
|
130
128
|
labelProps
|
|
131
129
|
};
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
} else t6 = $[
|
|
130
|
+
$[27] = headerClassName;
|
|
131
|
+
$[28] = helperText;
|
|
132
|
+
$[29] = isDisabled;
|
|
133
|
+
$[30] = isRequired;
|
|
134
|
+
$[31] = label;
|
|
135
|
+
$[32] = labelProps;
|
|
136
|
+
$[33] = rightContent;
|
|
137
|
+
$[34] = t5;
|
|
138
|
+
$[35] = tooltipText;
|
|
139
|
+
$[36] = t6;
|
|
140
|
+
} else t6 = $[36];
|
|
143
141
|
const headerProps = t6;
|
|
144
142
|
const dataIsDisabled = isDisabled || void 0;
|
|
145
143
|
const T0 = TooltipWrapper;
|
|
@@ -147,12 +145,12 @@ var TextInputBase = (props) => {
|
|
|
147
145
|
const T1 = FormField;
|
|
148
146
|
const t8 = as === "inline" && "h-full";
|
|
149
147
|
let t9;
|
|
150
|
-
if ($[
|
|
148
|
+
if ($[37] !== className || $[38] !== t8) {
|
|
151
149
|
t9 = clsx("group w-full", t8, className);
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
} else t9 = $[
|
|
150
|
+
$[37] = className;
|
|
151
|
+
$[38] = t8;
|
|
152
|
+
$[39] = t9;
|
|
153
|
+
} else t9 = $[39];
|
|
156
154
|
const t10 = as === "inline" ? -1 : void 0;
|
|
157
155
|
const t11 = value === "" || value === null || value === void 0 || void 0;
|
|
158
156
|
const t12 = isRequired || void 0;
|
|
@@ -162,35 +160,35 @@ var TextInputBase = (props) => {
|
|
|
162
160
|
...rest
|
|
163
161
|
}), inputClassName);
|
|
164
162
|
let t14;
|
|
165
|
-
if ($[
|
|
163
|
+
if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
|
|
166
164
|
t14 = () => inputRef.current?.focus();
|
|
167
|
-
$[
|
|
168
|
-
} else t14 = $[
|
|
165
|
+
$[40] = t14;
|
|
166
|
+
} else t14 = $[40];
|
|
169
167
|
const t15 = value === "" || value === null || value === void 0 || void 0;
|
|
170
168
|
const t16 = isRequired || void 0;
|
|
171
169
|
let t17;
|
|
172
|
-
if ($[
|
|
170
|
+
if ($[41] !== ref) {
|
|
173
171
|
t17 = mergeRefs(ref, inputRef);
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
} else t17 = $[
|
|
172
|
+
$[41] = ref;
|
|
173
|
+
$[42] = t17;
|
|
174
|
+
} else t17 = $[42];
|
|
177
175
|
const t18 = value === "" || value === null || value === void 0 || void 0;
|
|
178
176
|
const t19 = !(value === "" || value === null || value === void 0) || void 0;
|
|
179
177
|
const t20 = isDirty || void 0;
|
|
180
178
|
const t21 = isRequired || void 0;
|
|
181
179
|
const t22 = as === "floating" ? "\xA0" : inputProps.placeholder;
|
|
182
180
|
let t23;
|
|
183
|
-
if ($[
|
|
181
|
+
if ($[43] !== inputProps || $[44] !== isFocusVisible) {
|
|
184
182
|
t23 = (e) => {
|
|
185
183
|
inputProps.onFocus?.(e);
|
|
186
184
|
if (isFocusVisible) e.target.select();
|
|
187
185
|
};
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
} else t23 = $[
|
|
186
|
+
$[43] = inputProps;
|
|
187
|
+
$[44] = isFocusVisible;
|
|
188
|
+
$[45] = t23;
|
|
189
|
+
} else t23 = $[45];
|
|
192
190
|
let t24;
|
|
193
|
-
if ($[
|
|
191
|
+
if ($[46] !== dataIsDisabled || $[47] !== inputProps || $[48] !== t17 || $[49] !== t18 || $[50] !== t19 || $[51] !== t20 || $[52] !== t21 || $[53] !== t22 || $[54] !== t23) {
|
|
194
192
|
t24 = /* @__PURE__ */ jsx(Input, {
|
|
195
193
|
...inputProps,
|
|
196
194
|
ref: t17,
|
|
@@ -203,19 +201,19 @@ var TextInputBase = (props) => {
|
|
|
203
201
|
className: "w-full bg-transparent outline-none",
|
|
204
202
|
onFocus: t23
|
|
205
203
|
});
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
} else t24 = $[
|
|
204
|
+
$[46] = dataIsDisabled;
|
|
205
|
+
$[47] = inputProps;
|
|
206
|
+
$[48] = t17;
|
|
207
|
+
$[49] = t18;
|
|
208
|
+
$[50] = t19;
|
|
209
|
+
$[51] = t20;
|
|
210
|
+
$[52] = t21;
|
|
211
|
+
$[53] = t22;
|
|
212
|
+
$[54] = t23;
|
|
213
|
+
$[55] = t24;
|
|
214
|
+
} else t24 = $[55];
|
|
217
215
|
let t25;
|
|
218
|
-
if ($[
|
|
216
|
+
if ($[56] !== as || $[57] !== headerProps || $[58] !== inputContentProps || $[59] !== size || $[60] !== t24) {
|
|
219
217
|
t25 = /* @__PURE__ */ jsx(InputContent, {
|
|
220
218
|
...inputContentProps,
|
|
221
219
|
headerProps,
|
|
@@ -223,15 +221,15 @@ var TextInputBase = (props) => {
|
|
|
223
221
|
size,
|
|
224
222
|
children: t24
|
|
225
223
|
});
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
} else t25 = $[
|
|
224
|
+
$[56] = as;
|
|
225
|
+
$[57] = headerProps;
|
|
226
|
+
$[58] = inputContentProps;
|
|
227
|
+
$[59] = size;
|
|
228
|
+
$[60] = t24;
|
|
229
|
+
$[61] = t25;
|
|
230
|
+
} else t25 = $[61];
|
|
233
231
|
let t26;
|
|
234
|
-
if ($[
|
|
232
|
+
if ($[62] !== dataIsDisabled || $[63] !== t13 || $[64] !== t15 || $[65] !== t16 || $[66] !== t25) {
|
|
235
233
|
t26 = /* @__PURE__ */ jsx("div", {
|
|
236
234
|
className: t13,
|
|
237
235
|
onClick: t14,
|
|
@@ -240,15 +238,15 @@ var TextInputBase = (props) => {
|
|
|
240
238
|
"data-is-disabled": dataIsDisabled,
|
|
241
239
|
children: t25
|
|
242
240
|
});
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
} else t26 = $[
|
|
241
|
+
$[62] = dataIsDisabled;
|
|
242
|
+
$[63] = t13;
|
|
243
|
+
$[64] = t15;
|
|
244
|
+
$[65] = t16;
|
|
245
|
+
$[66] = t25;
|
|
246
|
+
$[67] = t26;
|
|
247
|
+
} else t26 = $[67];
|
|
250
248
|
let t27;
|
|
251
|
-
if ($[
|
|
249
|
+
if ($[68] !== T1 || $[69] !== as || $[70] !== formFieldProps || $[71] !== labelProps || $[72] !== t10 || $[73] !== t11 || $[74] !== t12 || $[75] !== t26 || $[76] !== t9) {
|
|
252
250
|
t27 = /* @__PURE__ */ jsx(T1, {
|
|
253
251
|
...formFieldProps,
|
|
254
252
|
as,
|
|
@@ -259,32 +257,32 @@ var TextInputBase = (props) => {
|
|
|
259
257
|
"data-is-required": t12,
|
|
260
258
|
children: t26
|
|
261
259
|
});
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
} else t27 = $[
|
|
260
|
+
$[68] = T1;
|
|
261
|
+
$[69] = as;
|
|
262
|
+
$[70] = formFieldProps;
|
|
263
|
+
$[71] = labelProps;
|
|
264
|
+
$[72] = t10;
|
|
265
|
+
$[73] = t11;
|
|
266
|
+
$[74] = t12;
|
|
267
|
+
$[75] = t26;
|
|
268
|
+
$[76] = t9;
|
|
269
|
+
$[77] = t27;
|
|
270
|
+
} else t27 = $[77];
|
|
273
271
|
let t28;
|
|
274
|
-
if ($[
|
|
272
|
+
if ($[78] !== T0 || $[79] !== as || $[80] !== error || $[81] !== t27 || $[82] !== t7) {
|
|
275
273
|
t28 = /* @__PURE__ */ jsx(T0, {
|
|
276
274
|
as,
|
|
277
275
|
error,
|
|
278
276
|
triggerTabIndex: t7,
|
|
279
277
|
children: t27
|
|
280
278
|
});
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
} else t28 = $[
|
|
279
|
+
$[78] = T0;
|
|
280
|
+
$[79] = as;
|
|
281
|
+
$[80] = error;
|
|
282
|
+
$[81] = t27;
|
|
283
|
+
$[82] = t7;
|
|
284
|
+
$[83] = t28;
|
|
285
|
+
} else t28 = $[83];
|
|
288
286
|
return t28;
|
|
289
287
|
};
|
|
290
288
|
var TextInputInner = (t0) => {
|
|
@@ -379,7 +377,7 @@ var TextInputInner = (t0) => {
|
|
|
379
377
|
return t3;
|
|
380
378
|
};
|
|
381
379
|
var TextInput = (t0) => {
|
|
382
|
-
const $ = c(
|
|
380
|
+
const $ = c(21);
|
|
383
381
|
let props;
|
|
384
382
|
let renderStaticInput;
|
|
385
383
|
if ($[0] !== t0) {
|
|
@@ -391,70 +389,72 @@ var TextInput = (t0) => {
|
|
|
391
389
|
props = $[1];
|
|
392
390
|
renderStaticInput = $[2];
|
|
393
391
|
}
|
|
394
|
-
if ("
|
|
395
|
-
let
|
|
392
|
+
if ("formControl" in props && props.formControl) {
|
|
393
|
+
let formControl;
|
|
396
394
|
let innerProps;
|
|
397
395
|
let ref;
|
|
398
396
|
if ($[3] !== props) {
|
|
399
|
-
({
|
|
397
|
+
({formControl, ref, ...innerProps} = props);
|
|
400
398
|
$[3] = props;
|
|
401
|
-
$[4] =
|
|
399
|
+
$[4] = formControl;
|
|
402
400
|
$[5] = innerProps;
|
|
403
401
|
$[6] = ref;
|
|
404
402
|
} else {
|
|
405
|
-
|
|
403
|
+
formControl = $[4];
|
|
406
404
|
innerProps = $[5];
|
|
407
405
|
ref = $[6];
|
|
408
406
|
}
|
|
407
|
+
const controlWithOptions = formControl.control;
|
|
409
408
|
let t1;
|
|
410
|
-
if ($[7] !==
|
|
409
|
+
if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
|
|
411
410
|
t1 = (t2) => {
|
|
412
|
-
const { field
|
|
411
|
+
const { field, fieldState: t3 } = t2;
|
|
413
412
|
const { error, isDirty } = t3;
|
|
414
413
|
return /* @__PURE__ */ jsx(TextInputInner, {
|
|
415
414
|
...innerProps,
|
|
416
|
-
ref: mergeRefs(ref,
|
|
417
|
-
value:
|
|
418
|
-
onChange:
|
|
419
|
-
onBlur:
|
|
415
|
+
ref: mergeRefs(ref, field.ref),
|
|
416
|
+
value: field.value,
|
|
417
|
+
onChange: field.onChange,
|
|
418
|
+
onBlur: field.onBlur,
|
|
420
419
|
isDirty,
|
|
421
|
-
isDisabled:
|
|
422
|
-
isFormControlDisabled:
|
|
420
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
421
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
423
422
|
error: props.error ?? error?.message,
|
|
424
423
|
renderStaticInput
|
|
425
424
|
});
|
|
426
425
|
};
|
|
427
|
-
$[7] =
|
|
428
|
-
$[8] =
|
|
429
|
-
$[9] = props.
|
|
430
|
-
$[10] =
|
|
431
|
-
$[11] =
|
|
432
|
-
$[12] =
|
|
433
|
-
|
|
426
|
+
$[7] = controlWithOptions._options?.disabled;
|
|
427
|
+
$[8] = innerProps;
|
|
428
|
+
$[9] = props.error;
|
|
429
|
+
$[10] = props.isDisabled;
|
|
430
|
+
$[11] = ref;
|
|
431
|
+
$[12] = renderStaticInput;
|
|
432
|
+
$[13] = t1;
|
|
433
|
+
} else t1 = $[13];
|
|
434
434
|
let t2;
|
|
435
|
-
if ($[
|
|
436
|
-
t2 = /* @__PURE__ */ jsx(
|
|
437
|
-
control:
|
|
438
|
-
name:
|
|
435
|
+
if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
|
|
436
|
+
t2 = /* @__PURE__ */ jsx(Controller, {
|
|
437
|
+
control: formControl.control,
|
|
438
|
+
name: formControl.name,
|
|
439
439
|
render: t1
|
|
440
440
|
});
|
|
441
|
-
$[
|
|
442
|
-
$[
|
|
443
|
-
$[
|
|
444
|
-
$[
|
|
445
|
-
} else t2 = $[
|
|
441
|
+
$[14] = formControl.control;
|
|
442
|
+
$[15] = formControl.name;
|
|
443
|
+
$[16] = t1;
|
|
444
|
+
$[17] = t2;
|
|
445
|
+
} else t2 = $[17];
|
|
446
446
|
return t2;
|
|
447
447
|
}
|
|
448
448
|
let t1;
|
|
449
|
-
if ($[
|
|
449
|
+
if ($[18] !== props || $[19] !== renderStaticInput) {
|
|
450
450
|
t1 = /* @__PURE__ */ jsx(TextInputInner, {
|
|
451
451
|
...props,
|
|
452
452
|
renderStaticInput
|
|
453
453
|
});
|
|
454
|
-
$[
|
|
455
|
-
$[
|
|
456
|
-
$[
|
|
457
|
-
} else t1 = $[
|
|
454
|
+
$[18] = props;
|
|
455
|
+
$[19] = renderStaticInput;
|
|
456
|
+
$[20] = t1;
|
|
457
|
+
} else t1 = $[20];
|
|
458
458
|
return t1;
|
|
459
459
|
};
|
|
460
460
|
function _temp(input) {
|
|
@@ -16,7 +16,6 @@ export interface InputContentProps {
|
|
|
16
16
|
leadingIcon?: FC<SVGProps<SVGSVGElement>> | ReactElement;
|
|
17
17
|
trailingIcon?: FC<SVGProps<SVGSVGElement>> | ReactElement;
|
|
18
18
|
isClearable?: boolean;
|
|
19
|
-
isClearableIfDisabled?: boolean;
|
|
20
19
|
value?: string | number | null;
|
|
21
20
|
onChange?: (value: string) => void;
|
|
22
21
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
@@ -25,5 +24,5 @@ export interface InputContentProps {
|
|
|
25
24
|
interface InputContentComponentProps extends InputContentProps, InputVariantProps {
|
|
26
25
|
children: ReactNode;
|
|
27
26
|
}
|
|
28
|
-
export declare const InputContent: ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable,
|
|
27
|
+
export declare const InputContent: ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable, value, onChange, onBlur, children, headerProps, as, size, }: InputContentComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
28
|
export {};
|
|
@@ -5,14 +5,14 @@ import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconBu
|
|
|
5
5
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
6
6
|
import { inputContentWrapperDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
|
|
7
7
|
import { InputClear } from "../../shared/InputClear.js";
|
|
8
|
-
import { clsx } from "clsx";
|
|
9
|
-
import { isValidElement } from "react";
|
|
10
8
|
import { c } from "react/compiler-runtime";
|
|
11
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { clsx } from "clsx";
|
|
11
|
+
import { isValidElement } from "react";
|
|
12
12
|
//#region src/components/inputs/Input/shared/InputContent.tsx
|
|
13
13
|
var InputContent = (t0) => {
|
|
14
|
-
const $ = c(
|
|
15
|
-
const { leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable,
|
|
14
|
+
const $ = c(64);
|
|
15
|
+
const { leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable, value, onChange, onBlur, children, headerProps, as, size } = t0;
|
|
16
16
|
const typographyCva = UIOverrides.useCva("typography.cva", typographyDefinition);
|
|
17
17
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
18
18
|
const inputContentWrapperCva = UIOverrides.useCva("input.contentWrapperCva", inputContentWrapperDefinition);
|
|
@@ -30,7 +30,7 @@ var InputContent = (t0) => {
|
|
|
30
30
|
$[3] = t2;
|
|
31
31
|
} else t2 = $[3];
|
|
32
32
|
const isTrailingIconElement = t2;
|
|
33
|
-
const showClear = value != null && value !== "" &&
|
|
33
|
+
const showClear = value != null && value !== "" && !isDisabled;
|
|
34
34
|
const t3 = as === "inline" && "h-full";
|
|
35
35
|
let t4;
|
|
36
36
|
if ($[4] !== as || $[5] !== inputSizeCva || $[6] !== size || $[7] !== t3) {
|
|
@@ -111,8 +111,8 @@ var InputContent = (t0) => {
|
|
|
111
111
|
$[34] = t10;
|
|
112
112
|
} else t10 = $[34];
|
|
113
113
|
let t11;
|
|
114
|
-
if ($[35] !== isClearable || $[36] !==
|
|
115
|
-
t11 = isClearable &&
|
|
114
|
+
if ($[35] !== isClearable || $[36] !== onBlur || $[37] !== onChange || $[38] !== showClear) {
|
|
115
|
+
t11 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
116
116
|
onClear: () => {
|
|
117
117
|
onChange?.("");
|
|
118
118
|
onBlur?.({ target: { value: "" } });
|
|
@@ -120,15 +120,13 @@ var InputContent = (t0) => {
|
|
|
120
120
|
show: showClear
|
|
121
121
|
});
|
|
122
122
|
$[35] = isClearable;
|
|
123
|
-
$[36] =
|
|
124
|
-
$[37] =
|
|
125
|
-
$[38] =
|
|
126
|
-
$[39] =
|
|
127
|
-
|
|
128
|
-
$[41] = t11;
|
|
129
|
-
} else t11 = $[41];
|
|
123
|
+
$[36] = onBlur;
|
|
124
|
+
$[37] = onChange;
|
|
125
|
+
$[38] = showClear;
|
|
126
|
+
$[39] = t11;
|
|
127
|
+
} else t11 = $[39];
|
|
130
128
|
let t12;
|
|
131
|
-
if ($[
|
|
129
|
+
if ($[40] !== typographyCva || $[41] !== unit) {
|
|
132
130
|
t12 = unit && /* @__PURE__ */ jsx("span", {
|
|
133
131
|
className: typographyCva({
|
|
134
132
|
size: "label-2",
|
|
@@ -138,21 +136,21 @@ var InputContent = (t0) => {
|
|
|
138
136
|
}),
|
|
139
137
|
children: unit
|
|
140
138
|
});
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
} else t12 = $[
|
|
139
|
+
$[40] = typographyCva;
|
|
140
|
+
$[41] = unit;
|
|
141
|
+
$[42] = t12;
|
|
142
|
+
} else t12 = $[42];
|
|
145
143
|
let t13;
|
|
146
|
-
if ($[
|
|
144
|
+
if ($[43] !== isLoading) {
|
|
147
145
|
t13 = isLoading && /* @__PURE__ */ jsx("div", {
|
|
148
146
|
className: "inline-flex",
|
|
149
147
|
children: /* @__PURE__ */ jsx(Loader, {})
|
|
150
148
|
});
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
} else t13 = $[
|
|
149
|
+
$[43] = isLoading;
|
|
150
|
+
$[44] = t13;
|
|
151
|
+
} else t13 = $[44];
|
|
154
152
|
let t14;
|
|
155
|
-
if ($[
|
|
153
|
+
if ($[45] !== action || $[46] !== isDisabled || $[47] !== isLoading) {
|
|
156
154
|
t14 = !isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
157
155
|
color: "secondary",
|
|
158
156
|
icon: action.icon,
|
|
@@ -163,22 +161,22 @@ var InputContent = (t0) => {
|
|
|
163
161
|
className: clsx("border-0!", action.className),
|
|
164
162
|
"data-static-press-action": ""
|
|
165
163
|
});
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
} else t14 = $[
|
|
164
|
+
$[45] = action;
|
|
165
|
+
$[46] = isDisabled;
|
|
166
|
+
$[47] = isLoading;
|
|
167
|
+
$[48] = t14;
|
|
168
|
+
} else t14 = $[48];
|
|
171
169
|
let t15;
|
|
172
|
-
if ($[
|
|
170
|
+
if ($[49] !== TrailingIcon || $[50] !== action || $[51] !== isLoading || $[52] !== isTrailingIconElement) {
|
|
173
171
|
t15 = !isLoading && !action && TrailingIcon && (isTrailingIconElement ? TrailingIcon : /* @__PURE__ */ jsx(TrailingIcon, { className: "size-6 text-interactive-text-secondary-idle" }));
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
} else t15 = $[
|
|
172
|
+
$[49] = TrailingIcon;
|
|
173
|
+
$[50] = action;
|
|
174
|
+
$[51] = isLoading;
|
|
175
|
+
$[52] = isTrailingIconElement;
|
|
176
|
+
$[53] = t15;
|
|
177
|
+
} else t15 = $[53];
|
|
180
178
|
let t16;
|
|
181
|
-
if ($[
|
|
179
|
+
if ($[54] !== t10 || $[55] !== t11 || $[56] !== t12 || $[57] !== t13 || $[58] !== t14 || $[59] !== t15) {
|
|
182
180
|
t16 = /* @__PURE__ */ jsxs("div", {
|
|
183
181
|
className: t10,
|
|
184
182
|
children: [
|
|
@@ -189,24 +187,24 @@ var InputContent = (t0) => {
|
|
|
189
187
|
t15
|
|
190
188
|
]
|
|
191
189
|
});
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
} else t16 = $[
|
|
190
|
+
$[54] = t10;
|
|
191
|
+
$[55] = t11;
|
|
192
|
+
$[56] = t12;
|
|
193
|
+
$[57] = t13;
|
|
194
|
+
$[58] = t14;
|
|
195
|
+
$[59] = t15;
|
|
196
|
+
$[60] = t16;
|
|
197
|
+
} else t16 = $[60];
|
|
200
198
|
let t17;
|
|
201
|
-
if ($[
|
|
199
|
+
if ($[61] !== t16 || $[62] !== t9) {
|
|
202
200
|
t17 = /* @__PURE__ */ jsxs("div", {
|
|
203
201
|
className: "flex w-full items-center gap-input-gap-input-text-to-elements",
|
|
204
202
|
children: [t9, t16]
|
|
205
203
|
});
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
} else t17 = $[
|
|
204
|
+
$[61] = t16;
|
|
205
|
+
$[62] = t9;
|
|
206
|
+
$[63] = t17;
|
|
207
|
+
} else t17 = $[63];
|
|
210
208
|
return t17;
|
|
211
209
|
};
|
|
212
210
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { SubmitErrorHandler, SubmitHandler, UseFormReturn } from 'react-hook-form';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { InputComponentProps, InputDefBaseProps } from './InputItem';
|
|
4
5
|
import { AllowedComponentType, DefaultComponentType } from '../../../helpers/dynamicInputs';
|
|
5
|
-
import { FormSubmitErrorHandler, FormSubmitHandler, UIForm } from '../../../hooks/useForm';
|
|
6
6
|
type Capitalize<T extends string> = T extends `${infer First}${infer Rest}` ? `${Uppercase<First>}${Rest}` : T;
|
|
7
7
|
type FieldProps<TProps = {}> = {
|
|
8
8
|
label: string;
|
|
@@ -15,10 +15,10 @@ type FieldComponents<TSchema extends z.ZodObject<any>> = {
|
|
|
15
15
|
[K in keyof Required<z.infer<TSchema>> as Capitalize<K & string>]: <T extends AllowedComponentType<TSchema["shape"][K]> | undefined = undefined>(props: FieldComponentProps<TSchema, K, T>) => ReactNode;
|
|
16
16
|
};
|
|
17
17
|
interface FormProps<TSchema extends z.ZodObject<any>, TSchemaType extends Record<string, any> = z.infer<TSchema>> {
|
|
18
|
-
form:
|
|
18
|
+
form: UseFormReturn<TSchemaType>;
|
|
19
19
|
schema: TSchema;
|
|
20
|
-
onSubmit:
|
|
21
|
-
onError?:
|
|
20
|
+
onSubmit: SubmitHandler<TSchemaType>;
|
|
21
|
+
onError?: SubmitErrorHandler<TSchemaType>;
|
|
22
22
|
className?: string;
|
|
23
23
|
children: (components: FieldComponents<TSchema>) => ReactNode;
|
|
24
24
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { InputItem } from "./InputItem.js";
|
|
1
2
|
import { StringUtils } from "../../../utils/string.utils.js";
|
|
2
3
|
import { ZodUtils } from "../../../utils/zod.utils.js";
|
|
3
4
|
import { getDefaultInputComponentType } from "../../../helpers/dynamicInputs.js";
|
|
4
|
-
import { InputItem } from "./InputItem.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { z } from "zod";
|