@povio/ui 2.3.0-rc.4 → 2.3.0-rc.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/AlignCenter.js +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +32 -9
- package/dist/components/Menu/MenuMobile.js +97 -38
- package/dist/components/Menu/MenuPopover.js +105 -29
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +55 -17
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +193 -34
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +289 -93
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +376 -189
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +189 -75
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +559 -159
- package/dist/components/inputs/DateTime/shared/Calendar.js +333 -137
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +301 -102
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +146 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +245 -90
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.js +311 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +7 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +374 -147
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +3 -2
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +93 -21
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +3 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +208 -70
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +9 -1
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +43 -7
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +16 -8
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +46 -41
- package/dist/components/inputs/File/FileUpload.js +86 -44
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
- package/dist/components/inputs/File/shared/InputUploadFilled.js +50 -9
- package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +25 -5
- package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
- package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +400 -125
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +486 -146
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.js +298 -89
- package/dist/components/inputs/Input/TextInput/TextInput.js +370 -121
- package/dist/components/inputs/Input/shared/InputContent.js +190 -58
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +0 -1
- package/dist/components/inputs/Inputs/InputItem.js +65 -16
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -0
- package/dist/components/inputs/RadioGroup/RadioGroup.js +320 -108
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +146 -50
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +4 -4
- package/dist/components/inputs/Selection/Select/QuerySelect.js +90 -28
- package/dist/components/inputs/Selection/Select/Select.js +140 -45
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +328 -137
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -2
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +12 -1
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +47 -39
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +3 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +445 -117
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -78
- package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +212 -41
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/CheckContent.js +21 -10
- package/dist/components/inputs/shared/InputClear.js +88 -21
- package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
- package/dist/components/inputs/shared/input.cva.js +35 -13
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/inputs/shared/useStaticInputHandoff.js +83 -40
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +104 -31
- package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +122 -25
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
- package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/segment/Segment.js +218 -57
- package/dist/components/segment/SegmentItem.js +67 -10
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +21 -13
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +23 -23
- package/dist/components/text/Link/Link.js +19 -7
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +7 -5
- package/dist/config/uiConfig.context.js +52 -12
- package/dist/config/uiStyle.context.js +15 -5
- package/dist/helpers/dynamicInputs.d.ts +1 -1
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.js +101 -30
- package/dist/hooks/useIntersectionObserver.js +86 -32
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.js +1 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.js +2 -2
- package/dist/tw-ui-plugin.js +6 -1
- package/dist/utils/date-time.utils.d.ts +7 -0
- package/dist/utils/date-time.utils.js +34 -23
- package/dist/utils/dom.utils.js +1 -1
- package/package.json +1 -1
|
@@ -1,59 +1,40 @@
|
|
|
1
|
-
import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
|
|
2
1
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
2
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
4
3
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
4
|
+
import { selectInputTagsContentWrapperCva } from "../shared/selectInput.cva.js";
|
|
5
5
|
import { SelectBase } from "../shared/SelectBase.js";
|
|
6
|
+
import { StaticSelectTrailingContent } from "../shared/StaticSelectTrailingContent.js";
|
|
6
7
|
import { getStaticSelectValue } from "../shared/staticSelect.utils.js";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
7
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
10
|
import { clsx } from "clsx";
|
|
9
11
|
import { useRef, useState } from "react";
|
|
10
12
|
import { mergeRefs } from "@react-aria/utils";
|
|
11
|
-
import { Controller
|
|
13
|
+
import { Controller } from "react-hook-form";
|
|
12
14
|
//#region src/components/inputs/Selection/Autocomplete/Autocomplete.tsx
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return /* @__PURE__ */ jsx(Controller, {
|
|
17
|
-
control: formControl.control,
|
|
18
|
-
name: formControl.name,
|
|
19
|
-
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(SelectBase, {
|
|
20
|
-
...innerProps,
|
|
21
|
-
ref: mergeRefs(ref, field.ref),
|
|
22
|
-
value: field.value,
|
|
23
|
-
onChange: field.onChange,
|
|
24
|
-
onBlur: field.onBlur,
|
|
25
|
-
isDirty,
|
|
26
|
-
isDisabled: field.disabled || props.isDisabled,
|
|
27
|
-
error: props.error ?? error?.message,
|
|
28
|
-
isSearchable: true,
|
|
29
|
-
ignoreInputValueFiltering
|
|
30
|
-
})
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return /* @__PURE__ */ jsx(SelectBase, {
|
|
34
|
-
...props,
|
|
35
|
-
isSearchable: true
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function Autocomplete({ renderStaticInput, ...props }) {
|
|
15
|
+
function AutocompleteInner(t0) {
|
|
16
|
+
const $ = c(7);
|
|
17
|
+
const { renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
39
18
|
const ui = UIConfig.useConfig();
|
|
40
19
|
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
41
20
|
const rootRef = useRef(null);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[0] !== renderInput) {
|
|
23
|
+
t1 = {
|
|
24
|
+
inputRef: rootRef,
|
|
25
|
+
renderInput,
|
|
26
|
+
setRenderInput,
|
|
27
|
+
getFocusTarget: _temp
|
|
28
|
+
};
|
|
29
|
+
$[0] = renderInput;
|
|
30
|
+
$[1] = t1;
|
|
31
|
+
} else t1 = $[1];
|
|
32
|
+
const { renderRealInput, replayStaticInputChange } = useStaticInputHandoff(t1);
|
|
33
|
+
const currentValue = props.value;
|
|
54
34
|
if (!renderInput && !!props.customTrigger) setRenderInput(true);
|
|
55
35
|
if (!renderInput) {
|
|
56
36
|
const as = props.as ?? ui.input.as;
|
|
37
|
+
const size = props.size ?? ui.input.size;
|
|
57
38
|
let isDisabled = !!props.isDisabled;
|
|
58
39
|
if (isFormControlDisabled) isDisabled = true;
|
|
59
40
|
const mode = props.selectionMode ?? ui.select.selectionMode;
|
|
@@ -69,7 +50,12 @@ function Autocomplete({ renderStaticInput, ...props }) {
|
|
|
69
50
|
selectedTagsType: props.selectedTagsType ?? ui.select.selectedTagsType
|
|
70
51
|
});
|
|
71
52
|
const isMultiple = mode === "multiple";
|
|
72
|
-
const trailingContent =
|
|
53
|
+
const trailingContent = /* @__PURE__ */ jsx(StaticSelectTrailingContent, {
|
|
54
|
+
trailingContent: props.trailingContent,
|
|
55
|
+
hideDropdownIcon: props.hideDropdownIcon,
|
|
56
|
+
isDisabled,
|
|
57
|
+
size
|
|
58
|
+
});
|
|
73
59
|
const placeholder = as === "floating" ? null : props.placeholder;
|
|
74
60
|
const shouldRenderPlaceholderAfterValue = mode !== "single" && props.placeholder && !isEmpty;
|
|
75
61
|
const inputValue = !isMultiple && selectedItem ? selectedItem.label : "";
|
|
@@ -84,17 +70,26 @@ function Autocomplete({ renderStaticInput, ...props }) {
|
|
|
84
70
|
dataHasSelection: !isEmpty,
|
|
85
71
|
dataHasSearch: false
|
|
86
72
|
};
|
|
73
|
+
const t2 = isDisabled;
|
|
74
|
+
const t3 = clsx("w-full", props.containerClassName);
|
|
75
|
+
const t4 = clsx(props.className, props.inputClassName);
|
|
76
|
+
let t5;
|
|
77
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
78
|
+
t5 = selectInputTagsContentWrapperCva({ isSearchable: true });
|
|
79
|
+
$[2] = t5;
|
|
80
|
+
} else t5 = $[2];
|
|
87
81
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
88
82
|
...props,
|
|
89
|
-
isDisabled,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
isDisabled: t2,
|
|
84
|
+
isLoading: false,
|
|
85
|
+
className: t3,
|
|
86
|
+
inputClassName: t4,
|
|
87
|
+
contentWrapperClassName: t5,
|
|
93
88
|
labelPlacement: "content-row",
|
|
94
89
|
dataAttributes,
|
|
95
90
|
renderStatic: true,
|
|
96
91
|
onStaticInteract: renderRealInput,
|
|
97
|
-
|
|
92
|
+
wrapTrailingContent: false,
|
|
98
93
|
leadingContent: props.leadingContent && /* @__PURE__ */ jsx("div", {
|
|
99
94
|
className: "ml-input-side-default flex shrink-0 items-center",
|
|
100
95
|
children: props.leadingContent
|
|
@@ -116,10 +111,111 @@ function Autocomplete({ renderStaticInput, ...props }) {
|
|
|
116
111
|
})] })
|
|
117
112
|
});
|
|
118
113
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
const T0 = SelectBase;
|
|
115
|
+
const t2 = mergeRefs(props.ref, rootRef);
|
|
116
|
+
let t3;
|
|
117
|
+
if ($[3] !== T0 || $[4] !== props || $[5] !== t2) {
|
|
118
|
+
t3 = /* @__PURE__ */ jsx(T0, {
|
|
119
|
+
...props,
|
|
120
|
+
ref: t2,
|
|
121
|
+
isSearchable: true
|
|
122
|
+
});
|
|
123
|
+
$[3] = T0;
|
|
124
|
+
$[4] = props;
|
|
125
|
+
$[5] = t2;
|
|
126
|
+
$[6] = t3;
|
|
127
|
+
} else t3 = $[6];
|
|
128
|
+
return t3;
|
|
129
|
+
}
|
|
130
|
+
function _temp(root) {
|
|
131
|
+
return root.querySelector("input, [data-type='select-trigger'], button, [tabindex]");
|
|
132
|
+
}
|
|
133
|
+
function Autocomplete(t0) {
|
|
134
|
+
const $ = c(23);
|
|
135
|
+
let props;
|
|
136
|
+
let renderStaticInput;
|
|
137
|
+
if ($[0] !== t0) {
|
|
138
|
+
({renderStaticInput, ...props} = t0);
|
|
139
|
+
$[0] = t0;
|
|
140
|
+
$[1] = props;
|
|
141
|
+
$[2] = renderStaticInput;
|
|
142
|
+
} else {
|
|
143
|
+
props = $[1];
|
|
144
|
+
renderStaticInput = $[2];
|
|
145
|
+
}
|
|
146
|
+
if ("formControl" in props && props.formControl) {
|
|
147
|
+
let formControl;
|
|
148
|
+
let innerProps;
|
|
149
|
+
let ref;
|
|
150
|
+
let t1;
|
|
151
|
+
if ($[3] !== props) {
|
|
152
|
+
({ignoreInputValueFiltering: t1, formControl, ref, ...innerProps} = props);
|
|
153
|
+
$[3] = props;
|
|
154
|
+
$[4] = formControl;
|
|
155
|
+
$[5] = innerProps;
|
|
156
|
+
$[6] = ref;
|
|
157
|
+
$[7] = t1;
|
|
158
|
+
} else {
|
|
159
|
+
formControl = $[4];
|
|
160
|
+
innerProps = $[5];
|
|
161
|
+
ref = $[6];
|
|
162
|
+
t1 = $[7];
|
|
163
|
+
}
|
|
164
|
+
const ignoreInputValueFiltering = t1 === void 0 ? true : t1;
|
|
165
|
+
const controlWithOptions = formControl.control;
|
|
166
|
+
let t2;
|
|
167
|
+
if ($[8] !== controlWithOptions._options?.disabled || $[9] !== ignoreInputValueFiltering || $[10] !== innerProps || $[11] !== props.error || $[12] !== props.isDisabled || $[13] !== ref || $[14] !== renderStaticInput) {
|
|
168
|
+
t2 = (t3) => {
|
|
169
|
+
const { field, fieldState: t4 } = t3;
|
|
170
|
+
const { error, isDirty } = t4;
|
|
171
|
+
return /* @__PURE__ */ jsx(AutocompleteInner, {
|
|
172
|
+
...innerProps,
|
|
173
|
+
ref: mergeRefs(ref, field.ref),
|
|
174
|
+
value: field.value,
|
|
175
|
+
onChange: field.onChange,
|
|
176
|
+
onBlur: field.onBlur,
|
|
177
|
+
isDirty,
|
|
178
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
179
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
180
|
+
error: props.error ?? error?.message,
|
|
181
|
+
ignoreInputValueFiltering,
|
|
182
|
+
renderStaticInput
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
$[8] = controlWithOptions._options?.disabled;
|
|
186
|
+
$[9] = ignoreInputValueFiltering;
|
|
187
|
+
$[10] = innerProps;
|
|
188
|
+
$[11] = props.error;
|
|
189
|
+
$[12] = props.isDisabled;
|
|
190
|
+
$[13] = ref;
|
|
191
|
+
$[14] = renderStaticInput;
|
|
192
|
+
$[15] = t2;
|
|
193
|
+
} else t2 = $[15];
|
|
194
|
+
let t3;
|
|
195
|
+
if ($[16] !== formControl.control || $[17] !== formControl.name || $[18] !== t2) {
|
|
196
|
+
t3 = /* @__PURE__ */ jsx(Controller, {
|
|
197
|
+
control: formControl.control,
|
|
198
|
+
name: formControl.name,
|
|
199
|
+
render: t2
|
|
200
|
+
});
|
|
201
|
+
$[16] = formControl.control;
|
|
202
|
+
$[17] = formControl.name;
|
|
203
|
+
$[18] = t2;
|
|
204
|
+
$[19] = t3;
|
|
205
|
+
} else t3 = $[19];
|
|
206
|
+
return t3;
|
|
207
|
+
}
|
|
208
|
+
let t1;
|
|
209
|
+
if ($[20] !== props || $[21] !== renderStaticInput) {
|
|
210
|
+
t1 = /* @__PURE__ */ jsx(AutocompleteInner, {
|
|
211
|
+
...props,
|
|
212
|
+
renderStaticInput
|
|
213
|
+
});
|
|
214
|
+
$[20] = props;
|
|
215
|
+
$[21] = renderStaticInput;
|
|
216
|
+
$[22] = t1;
|
|
217
|
+
} else t1 = $[22];
|
|
218
|
+
return t1;
|
|
123
219
|
}
|
|
124
220
|
//#endregion
|
|
125
221
|
export { Autocomplete };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
2
2
|
import { Autocomplete } from "./Autocomplete.js";
|
|
3
|
-
import { getQueryItems } from "../shared/querySelect.utils.js";
|
|
3
|
+
import { getQueryItems, isInitialSelectionLabelMissing } from "../shared/querySelect.utils.js";
|
|
4
4
|
import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { useState } from "react";
|
|
@@ -16,15 +16,15 @@ var QueryAutocomplete = ({ query, queryParams, queryOptions, queryMap, leadingCo
|
|
|
16
16
|
queryOptions,
|
|
17
17
|
mapItems: (data) => getQueryItems(data, queryMap),
|
|
18
18
|
search,
|
|
19
|
-
initialQueryState: props.isInitialQueryDisabled ?? ui.queryAutocomplete?.isInitialQueryDisabled
|
|
19
|
+
initialQueryState: isInitialSelectionLabelMissing(props.initialSelection, props.mapInitialToSelectItem) ? false : props.isInitialQueryDisabled ?? ui.queryAutocomplete?.isInitialQueryDisabled
|
|
20
20
|
});
|
|
21
21
|
const handleChange = (value) => {
|
|
22
22
|
onChange?.(value);
|
|
23
23
|
props.onBlur?.({ target: { value: null } });
|
|
24
24
|
};
|
|
25
25
|
const { isInitialQueryDisabled: _, ...autocompleteProps } = restProps;
|
|
26
|
-
const onSearchChange = (
|
|
27
|
-
setSearch(
|
|
26
|
+
const onSearchChange = (value_0) => {
|
|
27
|
+
setSearch(value_0);
|
|
28
28
|
handleEnableQuery();
|
|
29
29
|
};
|
|
30
30
|
return /* @__PURE__ */ jsx(Autocomplete, {
|
|
@@ -1,42 +1,104 @@
|
|
|
1
1
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
2
2
|
import { Select } from "./Select.js";
|
|
3
|
-
import { getQueryItems } from "../shared/querySelect.utils.js";
|
|
3
|
+
import { getQueryItems, isInitialSelectionLabelMissing } from "../shared/querySelect.utils.js";
|
|
4
4
|
import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
import { useState } from "react";
|
|
7
8
|
//#region src/components/inputs/Selection/Select/QuerySelect.tsx
|
|
8
|
-
var QuerySelect = (
|
|
9
|
+
var QuerySelect = (t0) => {
|
|
10
|
+
const $ = c(28);
|
|
11
|
+
const { query, queryParams, queryOptions, queryMap, ...props } = t0;
|
|
9
12
|
const ui = UIConfig.useConfig();
|
|
10
13
|
const [search, setSearch] = useState("");
|
|
11
14
|
const isSearchable = props.isSearchable ?? ui.select.isSearchable;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
let t1;
|
|
16
|
+
if ($[0] !== queryMap) {
|
|
17
|
+
t1 = (data) => getQueryItems(data, queryMap);
|
|
18
|
+
$[0] = queryMap;
|
|
19
|
+
$[1] = t1;
|
|
20
|
+
} else t1 = $[1];
|
|
21
|
+
const t2 = isSearchable ? search : void 0;
|
|
22
|
+
const t3 = isInitialSelectionLabelMissing(props.initialSelection, props.mapInitialToSelectItem) ? false : props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled;
|
|
23
|
+
let t4;
|
|
24
|
+
if ($[2] !== query || $[3] !== queryOptions || $[4] !== queryParams || $[5] !== t1 || $[6] !== t2 || $[7] !== t3) {
|
|
25
|
+
t4 = {
|
|
26
|
+
query,
|
|
27
|
+
queryParams,
|
|
28
|
+
queryOptions,
|
|
29
|
+
mapItems: t1,
|
|
30
|
+
search: t2,
|
|
31
|
+
initialQueryState: t3
|
|
32
|
+
};
|
|
33
|
+
$[2] = query;
|
|
34
|
+
$[3] = queryOptions;
|
|
35
|
+
$[4] = queryParams;
|
|
36
|
+
$[5] = t1;
|
|
37
|
+
$[6] = t2;
|
|
38
|
+
$[7] = t3;
|
|
39
|
+
$[8] = t4;
|
|
40
|
+
} else t4 = $[8];
|
|
41
|
+
const { items, totalItems, isLoading, handleEnableQuery, hasNextPage, fetchNextPage } = useQueryAutocomplete(t4);
|
|
42
|
+
let onSearchChange;
|
|
43
|
+
let selectProps;
|
|
44
|
+
if ($[9] !== props) {
|
|
45
|
+
const { isInitialQueryDisabled: _, onSearchChange: t5, ...t6 } = props;
|
|
46
|
+
onSearchChange = t5;
|
|
47
|
+
selectProps = t6;
|
|
48
|
+
$[9] = props;
|
|
49
|
+
$[10] = onSearchChange;
|
|
50
|
+
$[11] = selectProps;
|
|
51
|
+
} else {
|
|
52
|
+
onSearchChange = $[10];
|
|
53
|
+
selectProps = $[11];
|
|
54
|
+
}
|
|
55
|
+
let t5;
|
|
56
|
+
if ($[12] !== handleEnableQuery || $[13] !== onSearchChange || $[14] !== setSearch) {
|
|
57
|
+
t5 = (value) => {
|
|
58
|
+
setSearch(value);
|
|
59
|
+
handleEnableQuery();
|
|
60
|
+
onSearchChange?.(value);
|
|
61
|
+
};
|
|
62
|
+
$[12] = handleEnableQuery;
|
|
63
|
+
$[13] = onSearchChange;
|
|
64
|
+
$[14] = setSearch;
|
|
65
|
+
$[15] = t5;
|
|
66
|
+
} else t5 = $[15];
|
|
67
|
+
const handleSearchChange = t5;
|
|
68
|
+
let t6;
|
|
69
|
+
if ($[16] !== handleSearchChange || $[17] !== isSearchable) {
|
|
70
|
+
t6 = isSearchable && {
|
|
36
71
|
isClientSearchDisabled: true,
|
|
37
72
|
onSearchChange: handleSearchChange
|
|
38
|
-
}
|
|
39
|
-
|
|
73
|
+
};
|
|
74
|
+
$[16] = handleSearchChange;
|
|
75
|
+
$[17] = isSearchable;
|
|
76
|
+
$[18] = t6;
|
|
77
|
+
} else t6 = $[18];
|
|
78
|
+
let t7;
|
|
79
|
+
if ($[19] !== fetchNextPage || $[20] !== handleEnableQuery || $[21] !== hasNextPage || $[22] !== isLoading || $[23] !== items || $[24] !== selectProps || $[25] !== t6 || $[26] !== totalItems) {
|
|
80
|
+
t7 = /* @__PURE__ */ jsx(Select, {
|
|
81
|
+
...selectProps,
|
|
82
|
+
items,
|
|
83
|
+
isLoading,
|
|
84
|
+
totalItems,
|
|
85
|
+
hasLoadMore: hasNextPage,
|
|
86
|
+
onLoadMore: fetchNextPage,
|
|
87
|
+
onMouseEnter: handleEnableQuery,
|
|
88
|
+
onFocusCapture: handleEnableQuery,
|
|
89
|
+
...t6
|
|
90
|
+
});
|
|
91
|
+
$[19] = fetchNextPage;
|
|
92
|
+
$[20] = handleEnableQuery;
|
|
93
|
+
$[21] = hasNextPage;
|
|
94
|
+
$[22] = isLoading;
|
|
95
|
+
$[23] = items;
|
|
96
|
+
$[24] = selectProps;
|
|
97
|
+
$[25] = t6;
|
|
98
|
+
$[26] = totalItems;
|
|
99
|
+
$[27] = t7;
|
|
100
|
+
} else t7 = $[27];
|
|
101
|
+
return t7;
|
|
40
102
|
};
|
|
41
103
|
//#endregion
|
|
42
104
|
export { QuerySelect };
|
|
@@ -1,55 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Typography } from "../../../text/Typography/Typography.js";
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
3
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
4
4
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
5
|
+
import { selectInputTagsContentWrapperCva } from "../shared/selectInput.cva.js";
|
|
5
6
|
import { SelectBase } from "../shared/SelectBase.js";
|
|
7
|
+
import { StaticSelectTrailingContent } from "../shared/StaticSelectTrailingContent.js";
|
|
6
8
|
import { getStaticSelectValue } from "../shared/staticSelect.utils.js";
|
|
9
|
+
import { c } from "react/compiler-runtime";
|
|
7
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
11
|
import { clsx } from "clsx";
|
|
9
12
|
import { useRef, useState } from "react";
|
|
10
13
|
import { mergeRefs } from "@react-aria/utils";
|
|
11
|
-
import { Controller
|
|
14
|
+
import { Controller } from "react-hook-form";
|
|
12
15
|
//#region src/components/inputs/Selection/Select/Select.tsx
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return /* @__PURE__ */ jsx(Controller, {
|
|
17
|
-
control: formControl.control,
|
|
18
|
-
name: formControl.name,
|
|
19
|
-
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(SelectBase, {
|
|
20
|
-
...innerProps,
|
|
21
|
-
ref: mergeRefs(ref, field.ref),
|
|
22
|
-
value: field.value,
|
|
23
|
-
onChange: field.onChange,
|
|
24
|
-
onBlur: field.onBlur,
|
|
25
|
-
isDirty,
|
|
26
|
-
isDisabled: field.disabled || props.isDisabled,
|
|
27
|
-
error: props.error ?? error?.message
|
|
28
|
-
})
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
return /* @__PURE__ */ jsx(SelectBase, { ...props });
|
|
32
|
-
}
|
|
33
|
-
function Select({ renderStaticInput, ...props }) {
|
|
16
|
+
function SelectInner(t0) {
|
|
17
|
+
const $ = c(6);
|
|
18
|
+
const { renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
34
19
|
const ui = UIConfig.useConfig();
|
|
35
20
|
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
36
21
|
const rootRef = useRef(null);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[0] !== renderInput) {
|
|
24
|
+
t1 = {
|
|
25
|
+
inputRef: rootRef,
|
|
26
|
+
renderInput,
|
|
27
|
+
setRenderInput,
|
|
28
|
+
getFocusTarget: _temp
|
|
29
|
+
};
|
|
30
|
+
$[0] = renderInput;
|
|
31
|
+
$[1] = t1;
|
|
32
|
+
} else t1 = $[1];
|
|
33
|
+
const { renderRealInput, replayStaticInputChange, replayStaticInputPress } = useStaticInputHandoff(t1);
|
|
34
|
+
const currentValue = props.value;
|
|
49
35
|
if (!renderInput && props.selectionMode !== "multiple" && !!props.showSelectionContent && currentValue != null) setRenderInput(true);
|
|
50
36
|
if (!renderInput && !!props.customTrigger) setRenderInput(true);
|
|
51
37
|
if (!renderInput) {
|
|
52
38
|
const as = props.as ?? ui.input.as;
|
|
39
|
+
const size = props.size ?? ui.input.size;
|
|
53
40
|
let isDisabled = !!props.isDisabled;
|
|
54
41
|
if (isFormControlDisabled) isDisabled = true;
|
|
55
42
|
const mode = props.selectionMode ?? ui.select.selectionMode;
|
|
@@ -66,7 +53,12 @@ function Select({ renderStaticInput, ...props }) {
|
|
|
66
53
|
selectedTagsType: props.selectedTagsType ?? ui.select.selectedTagsType
|
|
67
54
|
});
|
|
68
55
|
const isSearchable = props.isSearchable ?? ui.select.isSearchable;
|
|
69
|
-
const trailingContent =
|
|
56
|
+
const trailingContent = /* @__PURE__ */ jsx(StaticSelectTrailingContent, {
|
|
57
|
+
trailingContent: props.trailingContent,
|
|
58
|
+
hideDropdownIcon: props.hideDropdownIcon,
|
|
59
|
+
isDisabled,
|
|
60
|
+
size
|
|
61
|
+
});
|
|
70
62
|
const placeholder = as === "floating" ? null : props.placeholder;
|
|
71
63
|
const inputValue = !isMultiple && selectedItem ? selectedItem.label : "";
|
|
72
64
|
const shouldRenderPlaceholderAfterValue = isMultiple && props.placeholder && !isEmpty;
|
|
@@ -81,20 +73,29 @@ function Select({ renderStaticInput, ...props }) {
|
|
|
81
73
|
dataHasSelection: !isEmpty,
|
|
82
74
|
dataHasSearch: false
|
|
83
75
|
};
|
|
84
|
-
const buttonContent = isMultiple && !isEmpty ? /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }) : isEmpty ? /* @__PURE__ */ jsx(
|
|
85
|
-
|
|
76
|
+
const buttonContent = isMultiple && !isEmpty ? /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }) : isEmpty ? /* @__PURE__ */ jsx(Typography, {
|
|
77
|
+
size: "label-1",
|
|
78
|
+
as: "span",
|
|
79
|
+
className: "block truncate text-text-default-3",
|
|
86
80
|
children: placeholder
|
|
87
|
-
}) :
|
|
81
|
+
}) : /* @__PURE__ */ jsx(Typography, {
|
|
82
|
+
size: "label-1",
|
|
83
|
+
as: "span",
|
|
84
|
+
className: "block truncate",
|
|
85
|
+
children: displayValue
|
|
86
|
+
});
|
|
88
87
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
89
88
|
...props,
|
|
90
89
|
isDisabled,
|
|
90
|
+
isLoading: false,
|
|
91
91
|
className: clsx("w-full", props.containerClassName),
|
|
92
92
|
inputClassName: clsx(props.className, props.inputClassName),
|
|
93
|
+
contentWrapperClassName: selectInputTagsContentWrapperCva({ isSearchable }),
|
|
93
94
|
typographySize: "label-1",
|
|
94
95
|
labelPlacement: "content-row",
|
|
95
96
|
dataAttributes,
|
|
96
97
|
renderStatic: true,
|
|
97
|
-
|
|
98
|
+
wrapTrailingContent: false,
|
|
98
99
|
onStaticInteract: renderRealInput,
|
|
99
100
|
leadingContent: props.leadingContent && /* @__PURE__ */ jsx("div", {
|
|
100
101
|
className: "ml-input-side-default flex shrink-0 items-center",
|
|
@@ -121,17 +122,111 @@ function Select({ renderStaticInput, ...props }) {
|
|
|
121
122
|
tabIndex: -1,
|
|
122
123
|
"data-type": "select-trigger",
|
|
123
124
|
className: clsx("w-full truncate bg-transparent text-start outline-none disabled:text-interactive-text-secondary-disabled", isMultiple && !isEmpty && "absolute inset-0 z-0"),
|
|
124
|
-
|
|
125
|
+
onClick: replayStaticInputPress,
|
|
125
126
|
...dataAttributeProps,
|
|
126
127
|
"data-rac": true,
|
|
127
128
|
children: buttonContent
|
|
128
129
|
})] })
|
|
129
130
|
});
|
|
130
131
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
const T0 = SelectBase;
|
|
133
|
+
const t2 = mergeRefs(props.ref, rootRef);
|
|
134
|
+
let t3;
|
|
135
|
+
if ($[2] !== T0 || $[3] !== props || $[4] !== t2) {
|
|
136
|
+
t3 = /* @__PURE__ */ jsx(T0, {
|
|
137
|
+
...props,
|
|
138
|
+
ref: t2
|
|
139
|
+
});
|
|
140
|
+
$[2] = T0;
|
|
141
|
+
$[3] = props;
|
|
142
|
+
$[4] = t2;
|
|
143
|
+
$[5] = t3;
|
|
144
|
+
} else t3 = $[5];
|
|
145
|
+
return t3;
|
|
146
|
+
}
|
|
147
|
+
function _temp(root) {
|
|
148
|
+
return root.querySelector("[data-type='select-trigger'], input, button, [tabindex]");
|
|
149
|
+
}
|
|
150
|
+
function Select(t0) {
|
|
151
|
+
const $ = c(21);
|
|
152
|
+
let props;
|
|
153
|
+
let renderStaticInput;
|
|
154
|
+
if ($[0] !== t0) {
|
|
155
|
+
({renderStaticInput, ...props} = t0);
|
|
156
|
+
$[0] = t0;
|
|
157
|
+
$[1] = props;
|
|
158
|
+
$[2] = renderStaticInput;
|
|
159
|
+
} else {
|
|
160
|
+
props = $[1];
|
|
161
|
+
renderStaticInput = $[2];
|
|
162
|
+
}
|
|
163
|
+
if ("formControl" in props && props.formControl) {
|
|
164
|
+
let formControl;
|
|
165
|
+
let innerProps;
|
|
166
|
+
let ref;
|
|
167
|
+
if ($[3] !== props) {
|
|
168
|
+
({formControl, ref, ...innerProps} = props);
|
|
169
|
+
$[3] = props;
|
|
170
|
+
$[4] = formControl;
|
|
171
|
+
$[5] = innerProps;
|
|
172
|
+
$[6] = ref;
|
|
173
|
+
} else {
|
|
174
|
+
formControl = $[4];
|
|
175
|
+
innerProps = $[5];
|
|
176
|
+
ref = $[6];
|
|
177
|
+
}
|
|
178
|
+
const controlWithOptions = formControl.control;
|
|
179
|
+
let t1;
|
|
180
|
+
if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
|
|
181
|
+
t1 = (t2) => {
|
|
182
|
+
const { field, fieldState: t3 } = t2;
|
|
183
|
+
const { error, isDirty } = t3;
|
|
184
|
+
return /* @__PURE__ */ jsx(SelectInner, {
|
|
185
|
+
...innerProps,
|
|
186
|
+
ref: mergeRefs(ref, field.ref),
|
|
187
|
+
value: field.value,
|
|
188
|
+
onChange: field.onChange,
|
|
189
|
+
onBlur: field.onBlur,
|
|
190
|
+
isDirty,
|
|
191
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
192
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
193
|
+
error: props.error ?? error?.message,
|
|
194
|
+
renderStaticInput
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
$[7] = controlWithOptions._options?.disabled;
|
|
198
|
+
$[8] = innerProps;
|
|
199
|
+
$[9] = props.error;
|
|
200
|
+
$[10] = props.isDisabled;
|
|
201
|
+
$[11] = ref;
|
|
202
|
+
$[12] = renderStaticInput;
|
|
203
|
+
$[13] = t1;
|
|
204
|
+
} else t1 = $[13];
|
|
205
|
+
let t2;
|
|
206
|
+
if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
|
|
207
|
+
t2 = /* @__PURE__ */ jsx(Controller, {
|
|
208
|
+
control: formControl.control,
|
|
209
|
+
name: formControl.name,
|
|
210
|
+
render: t1
|
|
211
|
+
});
|
|
212
|
+
$[14] = formControl.control;
|
|
213
|
+
$[15] = formControl.name;
|
|
214
|
+
$[16] = t1;
|
|
215
|
+
$[17] = t2;
|
|
216
|
+
} else t2 = $[17];
|
|
217
|
+
return t2;
|
|
218
|
+
}
|
|
219
|
+
let t1;
|
|
220
|
+
if ($[18] !== props || $[19] !== renderStaticInput) {
|
|
221
|
+
t1 = /* @__PURE__ */ jsx(SelectInner, {
|
|
222
|
+
...props,
|
|
223
|
+
renderStaticInput
|
|
224
|
+
});
|
|
225
|
+
$[18] = props;
|
|
226
|
+
$[19] = renderStaticInput;
|
|
227
|
+
$[20] = t1;
|
|
228
|
+
} else t1 = $[20];
|
|
229
|
+
return t1;
|
|
135
230
|
}
|
|
136
231
|
//#endregion
|
|
137
232
|
export { Select };
|