@povio/ui 2.3.0-rc.9 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/AlignCenter.js +11 -26
- package/dist/assets/icons/AlignLeft.js +11 -26
- package/dist/assets/icons/AlignLeftRight.js +11 -26
- package/dist/assets/icons/AlignRight.js +11 -26
- package/dist/assets/icons/ArrowDropDown.js +11 -26
- package/dist/assets/icons/ArrowDropUp.js +11 -26
- package/dist/assets/icons/ArrowLeft.js +11 -26
- package/dist/assets/icons/ArrowRight.js +11 -26
- package/dist/assets/icons/Bold.js +11 -26
- package/dist/assets/icons/BulletedList.js +11 -26
- package/dist/assets/icons/Calendar.js +13 -28
- package/dist/assets/icons/Check.js +13 -28
- package/dist/assets/icons/CheckCircle.js +11 -26
- package/dist/assets/icons/CheckboxCheckmark.js +14 -29
- package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
- package/dist/assets/icons/ChevronDown.js +13 -28
- package/dist/assets/icons/ChevronLeft.js +13 -28
- package/dist/assets/icons/ChevronRight.js +13 -28
- package/dist/assets/icons/ChevronUp.js +13 -28
- package/dist/assets/icons/ChevronsLeft.js +13 -28
- package/dist/assets/icons/ChevronsRight.js +13 -28
- package/dist/assets/icons/Clock.js +11 -26
- package/dist/assets/icons/Close.js +11 -26
- package/dist/assets/icons/DateTime.js +14 -35
- package/dist/assets/icons/DragIndicator.js +11 -26
- package/dist/assets/icons/File.js +13 -28
- package/dist/assets/icons/Highlight.js +11 -26
- package/dist/assets/icons/HighlightOn.js +15 -49
- package/dist/assets/icons/Home.js +11 -26
- package/dist/assets/icons/Info.js +16 -37
- package/dist/assets/icons/Italic.js +11 -26
- package/dist/assets/icons/Link.js +11 -26
- package/dist/assets/icons/Menu.js +11 -26
- package/dist/assets/icons/NumberedList.js +11 -26
- package/dist/assets/icons/PointerHorizontal.js +11 -26
- package/dist/assets/icons/PointerVertical.js +11 -26
- package/dist/assets/icons/Search.js +11 -26
- package/dist/assets/icons/Send.js +13 -28
- package/dist/assets/icons/Strikethrough.js +11 -26
- package/dist/assets/icons/TextColor.js +14 -48
- package/dist/assets/icons/Today.js +11 -26
- package/dist/assets/icons/Underlined.js +13 -28
- package/dist/assets/icons/Upload.js +14 -35
- package/dist/assets/icons/Visibility.js +11 -26
- package/dist/assets/icons/VisibilityOff.js +11 -26
- package/dist/assets/icons/WarningFilled.js +13 -28
- package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
- package/dist/components/Menu/Menu.js +2 -18
- package/dist/components/Menu/MenuDesktop.js +7 -41
- package/dist/components/Menu/MenuItem.js +9 -32
- package/dist/components/Menu/MenuMobile.js +38 -97
- package/dist/components/Menu/MenuPopover.js +29 -105
- package/dist/components/buttons/IconButton/IconButton.js +8 -40
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/PillButton/PillButton.js +17 -55
- package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
- package/dist/components/buttons/TextButton/TextButton.js +8 -30
- package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/Checkbox.js +35 -172
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
- package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -10
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +20 -121
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -10
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -215
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -11
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -123
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -5
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +104 -448
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +119 -330
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -283
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -142
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -296
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -6
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -355
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -14
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -97
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- 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 +110 -279
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -207
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/File/FileUpload.js +44 -87
- package/dist/components/inputs/File/FileUploadContainer.js +7 -15
- package/dist/components/inputs/File/InputUpload.js +79 -317
- package/dist/components/inputs/File/shared/FileCard.js +41 -104
- package/dist/components/inputs/File/shared/FileCardList.js +12 -47
- package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
- package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
- package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
- package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
- package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +37 -119
- package/dist/components/inputs/FormField/FormFieldError.js +5 -25
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +88 -334
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
- package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
- package/dist/components/inputs/Input/TextInput/TextInput.js +79 -319
- package/dist/components/inputs/Input/shared/InputContent.js +59 -192
- package/dist/components/inputs/Inputs/Form.js +11 -40
- package/dist/components/inputs/Inputs/InputItem.d.ts +21 -16
- package/dist/components/inputs/Inputs/InputItem.js +14 -71
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +60 -352
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +7 -109
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -34
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +5 -132
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
- package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +116 -338
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
- 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 +21 -70
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/select.context.js +34 -57
- package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
- package/dist/components/inputs/Slider/Slider.js +74 -250
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
- 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/Toggle/Toggle.js +37 -189
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
- package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
- package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.d.ts +1 -2
- package/dist/components/inputs/shared/InputClear.js +13 -79
- package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
- package/dist/components/inputs/shared/input.cva.d.ts +0 -10
- package/dist/components/inputs/shared/input.cva.js +4 -32
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/navigation/Stepper/StepperItem.js +31 -104
- package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/BottomSheet/BottomSheet.js +49 -98
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +20 -62
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
- package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
- package/dist/components/segment/Segment.js +57 -218
- package/dist/components/segment/SegmentItem.js +10 -67
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/shared/pagination/PaginationList.js +64 -167
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/status/Loader/Loader.js +22 -77
- package/dist/components/status/Toast/Toast.js +13 -21
- package/dist/components/status/Toast/useToast.js +57 -62
- package/dist/components/table/ColumnConfig.js +54 -158
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/PaginatedTable.js +18 -84
- package/dist/components/table/Table.js +27 -28
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +9 -23
- package/dist/config/router.context.js +16 -42
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +6 -16
- package/dist/config/uiConfig.context.js +13 -56
- package/dist/config/uiStyle.context.d.ts +4 -27
- package/dist/config/uiStyle.context.js +5 -15
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useBreakpoint.js +3 -16
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFilters.js +64 -125
- package/dist/hooks/useForm.js +8 -42
- package/dist/hooks/useFormAutosave.js +30 -101
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +24 -91
- package/dist/hooks/useLocalStorage.js +10 -43
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/hooks/usePagination.js +19 -49
- package/dist/hooks/useScrollableListBox.js +16 -37
- package/dist/hooks/useSorting.js +28 -69
- package/dist/hooks/useStateAndRef.js +7 -21
- package/dist/hooks/useTableColumnConfig.js +31 -124
- package/dist/hooks/useTranslationMemo.js +5 -25
- package/dist/index.d.ts +0 -7
- package/dist/index.js +3 -5
- package/dist/tw-ui-plugin.js +0 -2
- package/dist/utils/date-time.utils.d.ts +10 -31
- package/dist/utils/date-time.utils.js +22 -123
- package/dist/utils/dom.utils.js +1 -1
- package/package.json +1 -1
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -4
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -6
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -21
- 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 -31
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -80
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -479
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -122
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -13
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -79
- package/dist/components/inputs/Skeleton/InputFrame.js +0 -526
- package/dist/components/inputs/shared/StaticInput.d.ts +0 -38
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
- package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -57
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -3,29 +3,20 @@ import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
|
3
3
|
import { inputBase } from "../../shared/input.cva.js";
|
|
4
4
|
import { FormField } from "../../FormField/FormField.js";
|
|
5
5
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
6
|
-
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
7
|
-
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
8
6
|
import { InputContent } from "../shared/InputContent.js";
|
|
9
|
-
import { c } from "react/compiler-runtime";
|
|
10
7
|
import { jsx } from "react/jsx-runtime";
|
|
11
8
|
import { clsx } from "clsx";
|
|
12
|
-
import {
|
|
9
|
+
import { useRef } from "react";
|
|
13
10
|
import { Input } from "react-aria-components";
|
|
14
11
|
import { useFocusVisible, useTextField } from "react-aria";
|
|
15
12
|
import { mergeRefs } from "@react-aria/utils";
|
|
16
|
-
import { Controller
|
|
13
|
+
import { Controller } from "react-hook-form";
|
|
17
14
|
//#region src/components/inputs/Input/TextInput/TextInput.tsx
|
|
18
15
|
var TextInputBase = (props) => {
|
|
19
|
-
const $ = c(83);
|
|
20
16
|
const ui = UIConfig.useConfig();
|
|
21
17
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
22
18
|
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
|
|
24
|
-
const as = asProp ?? ui.input.as;
|
|
25
|
-
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
26
|
-
const variant = variantProp ?? ui.input.variant;
|
|
27
|
-
const size = sizeProp ?? ui.input.size;
|
|
28
|
-
const isClearable = isClearableProp ?? ui.input.isClearable;
|
|
19
|
+
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, ...rest } = props;
|
|
29
20
|
const textFieldRef = useRef(null);
|
|
30
21
|
const { isFocusVisible } = useFocusVisible();
|
|
31
22
|
const inputValue = value ?? "";
|
|
@@ -39,310 +30,84 @@ var TextInputBase = (props) => {
|
|
|
39
30
|
onChange,
|
|
40
31
|
onBlur
|
|
41
32
|
}, textFieldRef);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
$[8] = hideLabel;
|
|
80
|
-
$[9] = isDisabled;
|
|
81
|
-
$[10] = isRequired;
|
|
82
|
-
$[11] = label;
|
|
83
|
-
$[12] = rightContent;
|
|
84
|
-
$[13] = t2;
|
|
85
|
-
$[14] = tooltipText;
|
|
86
|
-
$[15] = t3;
|
|
87
|
-
} else t3 = $[15];
|
|
88
|
-
const formFieldProps = t3;
|
|
89
|
-
let t4;
|
|
90
|
-
if ($[16] !== action || $[17] !== inputValue || $[18] !== isClearable || $[19] !== isDisabled || $[20] !== isLoading || $[21] !== leadingIcon || $[22] !== onBlur || $[23] !== onChange || $[24] !== trailingIcon || $[25] !== unit) {
|
|
91
|
-
t4 = {
|
|
92
|
-
unit,
|
|
93
|
-
isLoading,
|
|
94
|
-
isDisabled,
|
|
95
|
-
action,
|
|
96
|
-
leadingIcon,
|
|
97
|
-
trailingIcon,
|
|
98
|
-
isClearable,
|
|
99
|
-
value: inputValue,
|
|
100
|
-
onChange,
|
|
101
|
-
onBlur
|
|
102
|
-
};
|
|
103
|
-
$[16] = action;
|
|
104
|
-
$[17] = inputValue;
|
|
105
|
-
$[18] = isClearable;
|
|
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];
|
|
115
|
-
const inputContentProps = t4;
|
|
116
|
-
const t5 = hideLabel || isHeaderHidden;
|
|
117
|
-
let t6;
|
|
118
|
-
if ($[27] !== headerClassName || $[28] !== helperText || $[29] !== isDisabled || $[30] !== isRequired || $[31] !== label || $[32] !== labelProps || $[33] !== rightContent || $[34] !== t5 || $[35] !== tooltipText) {
|
|
119
|
-
t6 = {
|
|
120
|
-
label,
|
|
121
|
-
tooltipText,
|
|
122
|
-
helperText,
|
|
123
|
-
isRequired,
|
|
124
|
-
rightContent,
|
|
125
|
-
isHeaderHidden: t5,
|
|
126
|
-
isDisabled,
|
|
127
|
-
className: headerClassName,
|
|
128
|
-
labelProps
|
|
129
|
-
};
|
|
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];
|
|
141
|
-
const headerProps = t6;
|
|
142
|
-
const T0 = TooltipWrapper;
|
|
143
|
-
const t7 = as === "inline" ? -1 : void 0;
|
|
144
|
-
const T1 = FormField;
|
|
145
|
-
const t8 = as === "inline" && "h-full";
|
|
146
|
-
let t9;
|
|
147
|
-
if ($[37] !== className || $[38] !== t8) {
|
|
148
|
-
t9 = clsx("group w-full", t8, className);
|
|
149
|
-
$[37] = className;
|
|
150
|
-
$[38] = t8;
|
|
151
|
-
$[39] = t9;
|
|
152
|
-
} else t9 = $[39];
|
|
153
|
-
const t10 = as === "inline" ? -1 : void 0;
|
|
154
|
-
const t11 = value === "" || value === null || value === void 0 || void 0;
|
|
155
|
-
const t12 = isRequired || void 0;
|
|
156
|
-
const t13 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
157
|
-
variant,
|
|
33
|
+
const formFieldProps = {
|
|
34
|
+
error,
|
|
35
|
+
label,
|
|
36
|
+
tooltipText,
|
|
37
|
+
helperText,
|
|
38
|
+
isRequired,
|
|
39
|
+
rightContent,
|
|
40
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
41
|
+
hideLabel,
|
|
42
|
+
isDisabled,
|
|
43
|
+
headerClassName,
|
|
44
|
+
errorClassName
|
|
45
|
+
};
|
|
46
|
+
const inputContentProps = {
|
|
47
|
+
unit,
|
|
48
|
+
isLoading,
|
|
49
|
+
isDisabled,
|
|
50
|
+
action,
|
|
51
|
+
leadingIcon,
|
|
52
|
+
trailingIcon,
|
|
53
|
+
isClearable,
|
|
54
|
+
value: inputValue,
|
|
55
|
+
onChange,
|
|
56
|
+
onBlur
|
|
57
|
+
};
|
|
58
|
+
const headerProps = {
|
|
59
|
+
label,
|
|
60
|
+
tooltipText,
|
|
61
|
+
helperText,
|
|
62
|
+
isRequired,
|
|
63
|
+
rightContent,
|
|
64
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
65
|
+
isDisabled,
|
|
66
|
+
className: headerClassName,
|
|
67
|
+
labelProps
|
|
68
|
+
};
|
|
69
|
+
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
158
70
|
as,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
|
|
163
|
-
t14 = () => inputRef.current?.focus();
|
|
164
|
-
$[40] = t14;
|
|
165
|
-
} else t14 = $[40];
|
|
166
|
-
const t15 = value === "" || value === null || value === void 0 || void 0;
|
|
167
|
-
const t16 = isRequired || void 0;
|
|
168
|
-
let t17;
|
|
169
|
-
if ($[41] !== ref) {
|
|
170
|
-
t17 = mergeRefs(ref, inputRef);
|
|
171
|
-
$[41] = ref;
|
|
172
|
-
$[42] = t17;
|
|
173
|
-
} else t17 = $[42];
|
|
174
|
-
const t18 = value === "" || value === null || value === void 0 || void 0;
|
|
175
|
-
const t19 = !(value === "" || value === null || value === void 0) || void 0;
|
|
176
|
-
const t20 = isDirty || void 0;
|
|
177
|
-
const t21 = isRequired || void 0;
|
|
178
|
-
const t22 = isDisabled || void 0;
|
|
179
|
-
const t23 = as === "floating" ? "\xA0" : inputProps.placeholder;
|
|
180
|
-
let t24;
|
|
181
|
-
if ($[43] !== inputProps || $[44] !== isFocusVisible) {
|
|
182
|
-
t24 = (e) => {
|
|
183
|
-
inputProps.onFocus?.(e);
|
|
184
|
-
if (isFocusVisible) e.target.select();
|
|
185
|
-
};
|
|
186
|
-
$[43] = inputProps;
|
|
187
|
-
$[44] = isFocusVisible;
|
|
188
|
-
$[45] = t24;
|
|
189
|
-
} else t24 = $[45];
|
|
190
|
-
let t25;
|
|
191
|
-
if ($[46] !== inputProps || $[47] !== t17 || $[48] !== t18 || $[49] !== t19 || $[50] !== t20 || $[51] !== t21 || $[52] !== t22 || $[53] !== t23 || $[54] !== t24) {
|
|
192
|
-
t25 = /* @__PURE__ */ jsx(Input, {
|
|
193
|
-
...inputProps,
|
|
194
|
-
ref: t17,
|
|
195
|
-
"data-is-empty": t18,
|
|
196
|
-
"data-is-filled": t19,
|
|
197
|
-
"data-is-dirty": t20,
|
|
198
|
-
"data-is-required": t21,
|
|
199
|
-
"data-is-disabled": t22,
|
|
200
|
-
placeholder: t23,
|
|
201
|
-
className: "w-full outline-none",
|
|
202
|
-
onFocus: t24
|
|
203
|
-
});
|
|
204
|
-
$[46] = inputProps;
|
|
205
|
-
$[47] = t17;
|
|
206
|
-
$[48] = t18;
|
|
207
|
-
$[49] = t19;
|
|
208
|
-
$[50] = t20;
|
|
209
|
-
$[51] = t21;
|
|
210
|
-
$[52] = t22;
|
|
211
|
-
$[53] = t23;
|
|
212
|
-
$[54] = t24;
|
|
213
|
-
$[55] = t25;
|
|
214
|
-
} else t25 = $[55];
|
|
215
|
-
let t26;
|
|
216
|
-
if ($[56] !== as || $[57] !== headerProps || $[58] !== inputContentProps || $[59] !== size || $[60] !== t25) {
|
|
217
|
-
t26 = /* @__PURE__ */ jsx(InputContent, {
|
|
218
|
-
...inputContentProps,
|
|
219
|
-
headerProps,
|
|
220
|
-
as,
|
|
221
|
-
size,
|
|
222
|
-
children: t25
|
|
223
|
-
});
|
|
224
|
-
$[56] = as;
|
|
225
|
-
$[57] = headerProps;
|
|
226
|
-
$[58] = inputContentProps;
|
|
227
|
-
$[59] = size;
|
|
228
|
-
$[60] = t25;
|
|
229
|
-
$[61] = t26;
|
|
230
|
-
} else t26 = $[61];
|
|
231
|
-
let t27;
|
|
232
|
-
if ($[62] !== t13 || $[63] !== t15 || $[64] !== t16 || $[65] !== t26) {
|
|
233
|
-
t27 = /* @__PURE__ */ jsx("div", {
|
|
234
|
-
className: t13,
|
|
235
|
-
onClick: t14,
|
|
236
|
-
"data-is-empty": t15,
|
|
237
|
-
"data-is-required": t16,
|
|
238
|
-
children: t26
|
|
239
|
-
});
|
|
240
|
-
$[62] = t13;
|
|
241
|
-
$[63] = t15;
|
|
242
|
-
$[64] = t16;
|
|
243
|
-
$[65] = t26;
|
|
244
|
-
$[66] = t27;
|
|
245
|
-
} else t27 = $[66];
|
|
246
|
-
let t28;
|
|
247
|
-
if ($[67] !== T1 || $[68] !== as || $[69] !== formFieldProps || $[70] !== labelProps || $[71] !== t10 || $[72] !== t11 || $[73] !== t12 || $[74] !== t27 || $[75] !== t9) {
|
|
248
|
-
t28 = /* @__PURE__ */ jsx(T1, {
|
|
71
|
+
error,
|
|
72
|
+
triggerTabIndex: as === "inline" ? -1 : void 0,
|
|
73
|
+
children: /* @__PURE__ */ jsx(FormField, {
|
|
249
74
|
...formFieldProps,
|
|
250
75
|
as,
|
|
251
76
|
labelProps,
|
|
252
|
-
className:
|
|
253
|
-
tabIndex:
|
|
254
|
-
"
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
$[81] = t7;
|
|
282
|
-
$[82] = t29;
|
|
283
|
-
} else t29 = $[82];
|
|
284
|
-
return t29;
|
|
285
|
-
};
|
|
286
|
-
var TextInput = ({ renderStaticInput, ...props }) => {
|
|
287
|
-
const ui = UIConfig.useConfig();
|
|
288
|
-
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
289
|
-
const inputRef = useRef(null);
|
|
290
|
-
const { shouldFocus, renderRealInput, replayStaticInputChange } = useStaticInputHandoff({
|
|
291
|
-
inputRef,
|
|
292
|
-
renderInput,
|
|
293
|
-
setRenderInput
|
|
294
|
-
});
|
|
295
|
-
const watchedValue = "formControl" in props && props.formControl ? useWatch({
|
|
296
|
-
control: props.formControl.control,
|
|
297
|
-
name: props.formControl.name
|
|
298
|
-
}) : props.value;
|
|
299
|
-
let isFormControlDisabled = false;
|
|
300
|
-
if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
|
|
301
|
-
const staticValue = watchedValue ?? props.value ?? props.defaultValue ?? "";
|
|
302
|
-
const inputType = props.type;
|
|
303
|
-
if (!renderInput && inputType === "password" && `${staticValue}`.length > 0) setRenderInput(true);
|
|
304
|
-
if (!renderInput) {
|
|
305
|
-
const as = props.as ?? ui.input.as;
|
|
306
|
-
let isDisabled = !!props.isDisabled;
|
|
307
|
-
if (isFormControlDisabled) isDisabled = true;
|
|
308
|
-
const maskedPasswordValue = inputType === "password" && `${staticValue}`.length > 0 ? "•".repeat(`${staticValue}`.length) : staticValue;
|
|
309
|
-
const displayValue = maskedPasswordValue == null ? "" : `${maskedPasswordValue}`;
|
|
310
|
-
const hasValue = displayValue !== "";
|
|
311
|
-
const dataAttributes = {
|
|
312
|
-
dataIsEmpty: !hasValue,
|
|
313
|
-
dataIsFilled: hasValue,
|
|
314
|
-
dataIsDirty: props.isDirty,
|
|
315
|
-
dataIsRequired: props.isRequired,
|
|
316
|
-
dataIsDisabled: isDisabled,
|
|
317
|
-
dataDisabled: isDisabled,
|
|
318
|
-
dataInvalid: !!props.error,
|
|
319
|
-
dataHasSelection: hasValue
|
|
320
|
-
};
|
|
321
|
-
return /* @__PURE__ */ jsx(InputFrame, {
|
|
322
|
-
...props,
|
|
323
|
-
isDisabled,
|
|
324
|
-
className: clsx("group w-full", as === "inline" && "h-full", props.className),
|
|
325
|
-
dataAttributes,
|
|
326
|
-
renderStatic: true,
|
|
327
|
-
onStaticInteract: renderRealInput,
|
|
328
|
-
inputClassName: props.inputClassName,
|
|
329
|
-
contentClassName: clsx(as === "inline" && "h-full", "pr-0!"),
|
|
330
|
-
trailingClassName: "py-0! pl-0!",
|
|
331
|
-
wrapContentAndTrailing: true,
|
|
332
|
-
children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
|
|
333
|
-
ref: inputRef,
|
|
334
|
-
type: inputType === "hidden" ? "password" : inputType,
|
|
335
|
-
disabled: isDisabled,
|
|
336
|
-
tabIndex: -1,
|
|
337
|
-
value: displayValue,
|
|
338
|
-
placeholder: as === "floating" ? "" : props.placeholder,
|
|
339
|
-
className: "w-full bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled",
|
|
340
|
-
onChange: (event) => replayStaticInputChange(event.target.value),
|
|
341
|
-
...dataAttributeProps,
|
|
342
|
-
"data-rac": true
|
|
77
|
+
className: clsx("group w-full", as === "inline" && "h-full", className),
|
|
78
|
+
tabIndex: as === "inline" ? -1 : void 0,
|
|
79
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
80
|
+
className: clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
81
|
+
variant,
|
|
82
|
+
as,
|
|
83
|
+
...rest
|
|
84
|
+
}), inputClassName),
|
|
85
|
+
onClick: () => inputRef.current?.focus(),
|
|
86
|
+
children: /* @__PURE__ */ jsx(InputContent, {
|
|
87
|
+
...inputContentProps,
|
|
88
|
+
headerProps,
|
|
89
|
+
as,
|
|
90
|
+
size,
|
|
91
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
92
|
+
...inputProps,
|
|
93
|
+
ref: mergeRefs(ref, inputRef),
|
|
94
|
+
"data-is-empty": inputValue === "" || void 0,
|
|
95
|
+
"data-is-dirty": isDirty || void 0,
|
|
96
|
+
"data-is-required": isRequired || void 0,
|
|
97
|
+
"data-is-disabled": isDisabled || void 0,
|
|
98
|
+
placeholder: as === "floating" ? "\xA0" : inputProps.placeholder,
|
|
99
|
+
className: "w-full outline-none",
|
|
100
|
+
onFocus: (e) => {
|
|
101
|
+
inputProps.onFocus?.(e);
|
|
102
|
+
if (isFocusVisible) e.target.select();
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
})
|
|
343
106
|
})
|
|
344
|
-
})
|
|
345
|
-
}
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
var TextInput = (props) => {
|
|
346
111
|
if ("formControl" in props && props.formControl) {
|
|
347
112
|
const { formControl, ref, ...innerProps } = props;
|
|
348
113
|
return /* @__PURE__ */ jsx(Controller, {
|
|
@@ -350,22 +115,17 @@ var TextInput = ({ renderStaticInput, ...props }) => {
|
|
|
350
115
|
name: formControl.name,
|
|
351
116
|
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(TextInputBase, {
|
|
352
117
|
...innerProps,
|
|
353
|
-
ref: mergeRefs(ref, field.ref
|
|
118
|
+
ref: mergeRefs(ref, field.ref),
|
|
354
119
|
value: field.value,
|
|
355
120
|
onChange: field.onChange,
|
|
356
121
|
onBlur: field.onBlur,
|
|
357
122
|
isDirty,
|
|
358
123
|
isDisabled: field.disabled || props.isDisabled,
|
|
359
|
-
error: props.error ?? error?.message
|
|
360
|
-
autoFocusOnMount: shouldFocus
|
|
124
|
+
error: props.error ?? error?.message
|
|
361
125
|
})
|
|
362
126
|
});
|
|
363
127
|
}
|
|
364
|
-
return /* @__PURE__ */ jsx(TextInputBase, {
|
|
365
|
-
...props,
|
|
366
|
-
ref: mergeRefs(props.ref, inputRef),
|
|
367
|
-
autoFocusOnMount: shouldFocus
|
|
368
|
-
});
|
|
128
|
+
return /* @__PURE__ */ jsx(TextInputBase, { ...props });
|
|
369
129
|
};
|
|
370
130
|
//#endregion
|
|
371
131
|
export { TextInput };
|