@povio/ui 2.3.2-rc.3 → 2.3.3

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.
Files changed (284) hide show
  1. package/dist/assets/icons/AlignCenter.js +11 -26
  2. package/dist/assets/icons/AlignLeft.js +11 -26
  3. package/dist/assets/icons/AlignLeftRight.js +11 -26
  4. package/dist/assets/icons/AlignRight.js +11 -26
  5. package/dist/assets/icons/ArrowDropDown.js +11 -26
  6. package/dist/assets/icons/ArrowDropUp.js +11 -26
  7. package/dist/assets/icons/ArrowLeft.js +11 -26
  8. package/dist/assets/icons/ArrowRight.js +11 -26
  9. package/dist/assets/icons/Bold.js +11 -26
  10. package/dist/assets/icons/BulletedList.js +11 -26
  11. package/dist/assets/icons/Calendar.js +13 -28
  12. package/dist/assets/icons/Check.js +13 -28
  13. package/dist/assets/icons/CheckCircle.js +11 -26
  14. package/dist/assets/icons/CheckboxCheckmark.js +14 -29
  15. package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
  16. package/dist/assets/icons/ChevronDown.js +13 -28
  17. package/dist/assets/icons/ChevronLeft.js +13 -28
  18. package/dist/assets/icons/ChevronRight.js +13 -28
  19. package/dist/assets/icons/ChevronUp.js +13 -28
  20. package/dist/assets/icons/ChevronsLeft.js +13 -28
  21. package/dist/assets/icons/ChevronsRight.js +13 -28
  22. package/dist/assets/icons/Clock.js +11 -26
  23. package/dist/assets/icons/Close.js +11 -26
  24. package/dist/assets/icons/DateTime.js +14 -35
  25. package/dist/assets/icons/DragIndicator.js +11 -26
  26. package/dist/assets/icons/File.js +13 -28
  27. package/dist/assets/icons/Highlight.js +11 -26
  28. package/dist/assets/icons/HighlightOn.js +15 -49
  29. package/dist/assets/icons/Home.js +11 -26
  30. package/dist/assets/icons/Info.js +16 -37
  31. package/dist/assets/icons/Italic.js +11 -26
  32. package/dist/assets/icons/Link.js +11 -26
  33. package/dist/assets/icons/Menu.js +11 -26
  34. package/dist/assets/icons/NumberedList.js +11 -26
  35. package/dist/assets/icons/PointerHorizontal.js +11 -26
  36. package/dist/assets/icons/PointerVertical.js +11 -26
  37. package/dist/assets/icons/Search.js +11 -26
  38. package/dist/assets/icons/Send.js +13 -28
  39. package/dist/assets/icons/Strikethrough.js +11 -26
  40. package/dist/assets/icons/TextColor.js +14 -48
  41. package/dist/assets/icons/Today.js +11 -26
  42. package/dist/assets/icons/Underlined.js +13 -28
  43. package/dist/assets/icons/Upload.js +14 -35
  44. package/dist/assets/icons/Visibility.js +11 -26
  45. package/dist/assets/icons/VisibilityOff.js +11 -26
  46. package/dist/assets/icons/WarningFilled.js +13 -28
  47. package/dist/assets/locales/sl/translation.json.js +2 -2
  48. package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
  49. package/dist/components/Menu/Menu.js +2 -18
  50. package/dist/components/Menu/MenuDesktop.js +7 -41
  51. package/dist/components/Menu/MenuItem.js +9 -32
  52. package/dist/components/Menu/MenuMobile.js +38 -97
  53. package/dist/components/Menu/MenuPopover.js +29 -105
  54. package/dist/components/buttons/IconButton/IconButton.js +8 -40
  55. package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
  56. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  57. package/dist/components/buttons/PillButton/PillButton.js +17 -55
  58. package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
  59. package/dist/components/buttons/TextButton/TextButton.js +8 -30
  60. package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
  61. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  62. package/dist/components/inputs/Checkbox/Checkbox.d.ts +0 -1
  63. package/dist/components/inputs/Checkbox/Checkbox.js +35 -201
  64. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  65. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
  66. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
  67. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -12
  68. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +75 -368
  69. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -12
  70. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +298 -506
  71. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -13
  72. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +56 -273
  73. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -6
  74. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +130 -606
  75. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
  76. package/dist/components/inputs/DateTime/shared/Calendar.js +119 -332
  77. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -3
  78. package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -301
  79. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -3
  80. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -146
  81. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
  82. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
  83. package/dist/components/inputs/DateTime/shared/DateField.js +112 -311
  84. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -13
  85. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +139 -383
  86. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -15
  87. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -96
  88. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
  89. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  90. package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
  91. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
  92. package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
  93. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
  94. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -4
  95. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -210
  96. package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
  97. package/dist/components/inputs/File/FileUpload.js +44 -87
  98. package/dist/components/inputs/File/FileUploadContainer.js +7 -15
  99. package/dist/components/inputs/File/InputUpload.js +79 -317
  100. package/dist/components/inputs/File/shared/FileCard.js +41 -104
  101. package/dist/components/inputs/File/shared/FileCardList.js +12 -47
  102. package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
  103. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
  104. package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
  105. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
  106. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
  107. package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
  108. package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
  109. package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
  110. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  111. package/dist/components/inputs/FormField/FormField.js +37 -119
  112. package/dist/components/inputs/FormField/FormFieldError.js +5 -25
  113. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  114. package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
  115. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
  116. package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
  117. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  118. package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
  119. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
  120. package/dist/components/inputs/Input/NumberInput/NumberInput.js +97 -447
  121. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
  122. package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
  123. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
  124. package/dist/components/inputs/Input/TextInput/TextInput.js +90 -419
  125. package/dist/components/inputs/Input/shared/InputContent.js +59 -192
  126. package/dist/components/inputs/Inputs/Form.js +11 -40
  127. package/dist/components/inputs/Inputs/InputItem.d.ts +21 -15
  128. package/dist/components/inputs/Inputs/InputItem.js +14 -69
  129. package/dist/components/inputs/Inputs/Inputs.js +11 -37
  130. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -3
  131. package/dist/components/inputs/RadioGroup/RadioGroup.js +61 -353
  132. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
  133. package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
  134. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
  135. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +22 -214
  136. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
  137. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -104
  138. package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
  139. package/dist/components/inputs/Selection/Select/Select.js +18 -225
  140. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
  141. package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
  142. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  143. package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
  144. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  145. package/dist/components/inputs/Selection/shared/SelectInput.js +116 -330
  146. package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
  147. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  148. package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
  149. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
  150. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
  151. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
  152. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
  153. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  154. package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
  155. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
  156. package/dist/components/inputs/Selection/shared/select.context.js +36 -67
  157. package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
  158. package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
  159. package/dist/components/inputs/Slider/Slider.d.ts +1 -2
  160. package/dist/components/inputs/Slider/Slider.js +76 -265
  161. package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
  162. package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
  163. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
  164. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
  165. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
  166. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
  167. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
  168. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
  169. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
  170. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
  171. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
  172. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
  173. package/dist/components/inputs/Toggle/Toggle.d.ts +0 -1
  174. package/dist/components/inputs/Toggle/Toggle.js +37 -214
  175. package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
  176. package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
  177. package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
  178. package/dist/components/inputs/shared/CheckContent.js +11 -21
  179. package/dist/components/inputs/shared/InputClear.d.ts +1 -2
  180. package/dist/components/inputs/shared/InputClear.js +12 -88
  181. package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
  182. package/dist/components/inputs/shared/input.cva.d.ts +0 -10
  183. package/dist/components/inputs/shared/input.cva.js +4 -32
  184. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  185. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  186. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  187. package/dist/components/navigation/Stepper/StepperItem.js +31 -104
  188. package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
  189. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  190. package/dist/components/overlays/BottomSheet/BottomSheet.js +23 -96
  191. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
  192. package/dist/components/overlays/Drawer/Drawer.js +20 -62
  193. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
  194. package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
  195. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
  196. package/dist/components/segment/Segment.js +57 -218
  197. package/dist/components/segment/SegmentItem.js +10 -67
  198. package/dist/components/shared/pagination/Pagination.js +22 -108
  199. package/dist/components/shared/pagination/PaginationList.js +64 -167
  200. package/dist/components/status/Alert/Alert.js +30 -97
  201. package/dist/components/status/Loader/Loader.js +22 -77
  202. package/dist/components/status/Toast/Toast.js +13 -21
  203. package/dist/components/status/Toast/useToast.js +57 -62
  204. package/dist/components/table/ColumnConfig.js +54 -158
  205. package/dist/components/table/InfiniteTable.js +16 -67
  206. package/dist/components/table/PaginatedTable.js +18 -84
  207. package/dist/components/table/Table.js +27 -28
  208. package/dist/components/text/Link/Link.js +7 -19
  209. package/dist/components/text/Typography/Typography.js +8 -23
  210. package/dist/config/confirmation.context.js +1 -1
  211. package/dist/config/link.context.js +9 -23
  212. package/dist/config/router.context.js +16 -42
  213. package/dist/config/theme.context.js +45 -98
  214. package/dist/config/uiConfig.context.d.ts +6 -19
  215. package/dist/config/uiConfig.context.js +14 -67
  216. package/dist/config/uiStyle.context.d.ts +4 -27
  217. package/dist/config/uiStyle.context.js +5 -15
  218. package/dist/helpers/dynamicInputs.d.ts +5 -5
  219. package/dist/helpers/dynamicInputs.js +0 -3
  220. package/dist/hooks/useBreakpoint.js +3 -16
  221. package/dist/hooks/useDebounceCallback.js +17 -51
  222. package/dist/hooks/useFilters.js +64 -125
  223. package/dist/hooks/useForm.js +8 -42
  224. package/dist/hooks/useFormAutosave.js +30 -101
  225. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  226. package/dist/hooks/useIntersectionObserver.js +24 -91
  227. package/dist/hooks/useLocalStorage.js +10 -43
  228. package/dist/hooks/useLongPressRepeat.js +20 -55
  229. package/dist/hooks/usePagination.js +19 -49
  230. package/dist/hooks/useScrollableListBox.js +16 -37
  231. package/dist/hooks/useSorting.js +28 -69
  232. package/dist/hooks/useStateAndRef.js +7 -21
  233. package/dist/hooks/useTableColumnConfig.js +31 -124
  234. package/dist/hooks/useTranslationMemo.js +5 -25
  235. package/dist/index.d.ts +0 -7
  236. package/dist/index.js +2 -4
  237. package/dist/tw-ui-plugin.js +0 -6
  238. package/dist/utils/date-time.utils.d.ts +10 -38
  239. package/dist/utils/date-time.utils.js +22 -134
  240. package/package.json +1 -1
  241. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -5
  242. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
  243. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
  244. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
  245. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -32
  246. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
  247. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
  248. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -39
  249. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -85
  250. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
  251. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
  252. package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
  253. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
  254. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
  255. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
  256. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -575
  257. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
  258. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
  259. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
  260. package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
  261. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
  262. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
  263. package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -173
  264. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
  265. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
  266. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -12
  267. package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -36
  268. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
  269. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
  270. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
  271. package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
  272. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
  273. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
  274. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
  275. package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -82
  276. package/dist/components/inputs/Skeleton/InputFrame.js +0 -548
  277. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
  278. package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
  279. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
  280. package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
  281. package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
  282. package/dist/hooks/useQueryAutocomplete.js +0 -57
  283. package/dist/utils/query.utils.d.ts +0 -4
  284. package/dist/utils/query.utils.js +0 -8
@@ -1,222 +1,30 @@
1
- import { UIConfig } from "../../../../config/uiConfig.context.js";
2
- import { InputFrame } from "../../Skeleton/InputFrame.js";
3
- import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
4
- import { selectInputTagsContentWrapperCva } from "../shared/selectInput.cva.js";
5
1
  import { SelectBase } from "../shared/SelectBase.js";
6
- import { StaticSelectTrailingContent } from "../shared/StaticSelectTrailingContent.js";
7
- import { getStaticSelectValue } from "../shared/staticSelect.utils.js";
8
- import { c } from "react/compiler-runtime";
9
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
- import { clsx } from "clsx";
11
- import { useRef, useState } from "react";
2
+ import { jsx } from "react/jsx-runtime";
12
3
  import { mergeRefs } from "@react-aria/utils";
13
4
  import { Controller } from "react-hook-form";
14
5
  //#region src/components/inputs/Selection/Autocomplete/Autocomplete.tsx
15
- function AutocompleteInner(t0) {
16
- const $ = c(7);
17
- const { renderStaticInput, isFormControlDisabled, ...props } = t0;
18
- const ui = UIConfig.useConfig();
19
- const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
20
- const rootRef = useRef(null);
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;
34
- if (!renderInput && !!props.customTrigger) setRenderInput(true);
35
- if (!renderInput) {
36
- const as = props.as ?? ui.input.as;
37
- const size = props.size ?? ui.input.size;
38
- let isDisabled = !!props.isDisabled;
39
- if (isFormControlDisabled) isDisabled = true;
40
- const mode = props.selectionMode ?? ui.select.selectionMode;
41
- const { selectedItem, displayValue, isEmpty } = getStaticSelectValue({
42
- items: props.items,
43
- value: currentValue,
44
- selectionMode: mode,
45
- initialSelection: props.initialSelection,
46
- mapInitialToSelectItem: props.mapInitialToSelectItem,
47
- showSelectionContent: props.showSelectionContent,
48
- isDisabled,
49
- collapseAfter: props.collapseAfter ?? ui.select.collapseAfter,
50
- selectedTagsType: props.selectedTagsType ?? ui.select.selectedTagsType
51
- });
52
- const isMultiple = mode === "multiple";
53
- const trailingContent = /* @__PURE__ */ jsx(StaticSelectTrailingContent, {
54
- trailingContent: props.trailingContent,
55
- hideDropdownIcon: props.hideDropdownIcon,
56
- isDisabled,
57
- size
58
- });
59
- const placeholder = as === "floating" ? null : props.placeholder;
60
- const shouldRenderPlaceholderAfterValue = mode !== "single" && props.placeholder && !isEmpty;
61
- const inputValue = !isMultiple && selectedItem ? selectedItem.label : "";
62
- const dataAttributes = {
63
- dataIsEmpty: isEmpty,
64
- dataIsFilled: !isEmpty,
65
- dataIsDirty: props.isDirty,
66
- dataIsRequired: props.isRequired,
67
- dataIsDisabled: isDisabled,
68
- dataDisabled: isDisabled,
69
- dataInvalid: !!props.error,
70
- dataHasSelection: !isEmpty,
71
- dataHasSearch: false
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];
81
- return /* @__PURE__ */ jsx(InputFrame, {
82
- ...props,
83
- isDisabled: t2,
84
- isLoading: false,
85
- className: t3,
86
- inputClassName: t4,
87
- contentWrapperClassName: t5,
88
- contentGroup: "select",
89
- labelPlacement: "content-row",
90
- dataAttributes,
91
- renderStatic: true,
92
- onStaticInteract: renderRealInput,
93
- wrapTrailingContent: false,
94
- leadingContent: props.leadingContent && /* @__PURE__ */ jsx("div", {
95
- className: "ml-input-side-default flex shrink-0 items-center",
96
- children: props.leadingContent
97
- }),
98
- trailingContent,
99
- children: (dataAttributeProps) => /* @__PURE__ */ jsxs(Fragment, { children: [isMultiple && !isEmpty && displayValue, /* @__PURE__ */ jsx("input", {
100
- disabled: isDisabled,
101
- tabIndex: -1,
102
- role: "combobox",
103
- "aria-autocomplete": "list",
104
- "aria-controls": `${dataAttributeProps.id}-listbox`,
105
- "aria-expanded": false,
106
- value: inputValue,
107
- placeholder: isMultiple && shouldRenderPlaceholderAfterValue ? props.placeholder : placeholder ?? void 0,
108
- className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", props.inputClassName),
109
- onChange: (event) => replayStaticInputChange(event.target.value),
110
- ...dataAttributeProps,
111
- "data-rac": true
112
- })] })
113
- });
114
- }
115
- const T0 = SelectBase;
116
- const t2 = mergeRefs(props.ref, rootRef);
117
- let t3;
118
- if ($[3] !== T0 || $[4] !== props || $[5] !== t2) {
119
- t3 = /* @__PURE__ */ jsx(T0, {
120
- ...props,
121
- ref: t2,
122
- isSearchable: true
123
- });
124
- $[3] = T0;
125
- $[4] = props;
126
- $[5] = t2;
127
- $[6] = t3;
128
- } else t3 = $[6];
129
- return t3;
130
- }
131
- function _temp(root) {
132
- return root.querySelector("input, [data-type='select-trigger'], button, [tabindex]");
133
- }
134
- function Autocomplete(t0) {
135
- const $ = c(23);
136
- let props;
137
- let renderStaticInput;
138
- if ($[0] !== t0) {
139
- ({renderStaticInput, ...props} = t0);
140
- $[0] = t0;
141
- $[1] = props;
142
- $[2] = renderStaticInput;
143
- } else {
144
- props = $[1];
145
- renderStaticInput = $[2];
146
- }
6
+ var Autocomplete = (props) => {
147
7
  if ("formControl" in props && props.formControl) {
148
- let formControl;
149
- let innerProps;
150
- let ref;
151
- let t1;
152
- if ($[3] !== props) {
153
- ({ignoreInputValueFiltering: t1, formControl, ref, ...innerProps} = props);
154
- $[3] = props;
155
- $[4] = formControl;
156
- $[5] = innerProps;
157
- $[6] = ref;
158
- $[7] = t1;
159
- } else {
160
- formControl = $[4];
161
- innerProps = $[5];
162
- ref = $[6];
163
- t1 = $[7];
164
- }
165
- const ignoreInputValueFiltering = t1 === void 0 ? true : t1;
166
- const controlWithOptions = formControl.control;
167
- let t2;
168
- if ($[8] !== controlWithOptions._options?.disabled || $[9] !== ignoreInputValueFiltering || $[10] !== innerProps || $[11] !== props.error || $[12] !== props.isDisabled || $[13] !== ref || $[14] !== renderStaticInput) {
169
- t2 = (t3) => {
170
- const { field, fieldState: t4 } = t3;
171
- const { error, isDirty } = t4;
172
- return /* @__PURE__ */ jsx(AutocompleteInner, {
173
- ...innerProps,
174
- ref: mergeRefs(ref, field.ref),
175
- value: field.value,
176
- onChange: field.onChange,
177
- onBlur: field.onBlur,
178
- isDirty,
179
- isDisabled: field.disabled || props.isDisabled,
180
- isFormControlDisabled: !!controlWithOptions._options?.disabled,
181
- error: props.error ?? error?.message,
182
- ignoreInputValueFiltering,
183
- renderStaticInput
184
- });
185
- };
186
- $[8] = controlWithOptions._options?.disabled;
187
- $[9] = ignoreInputValueFiltering;
188
- $[10] = innerProps;
189
- $[11] = props.error;
190
- $[12] = props.isDisabled;
191
- $[13] = ref;
192
- $[14] = renderStaticInput;
193
- $[15] = t2;
194
- } else t2 = $[15];
195
- let t3;
196
- if ($[16] !== formControl.control || $[17] !== formControl.name || $[18] !== t2) {
197
- t3 = /* @__PURE__ */ jsx(Controller, {
198
- control: formControl.control,
199
- name: formControl.name,
200
- render: t2
201
- });
202
- $[16] = formControl.control;
203
- $[17] = formControl.name;
204
- $[18] = t2;
205
- $[19] = t3;
206
- } else t3 = $[19];
207
- return t3;
208
- }
209
- let t1;
210
- if ($[20] !== props || $[21] !== renderStaticInput) {
211
- t1 = /* @__PURE__ */ jsx(AutocompleteInner, {
212
- ...props,
213
- renderStaticInput
8
+ const { formControl, ref, ...innerProps } = props;
9
+ return /* @__PURE__ */ jsx(Controller, {
10
+ control: formControl.control,
11
+ name: formControl.name,
12
+ render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(SelectBase, {
13
+ ...innerProps,
14
+ ref: mergeRefs(ref, field.ref),
15
+ value: field.value,
16
+ onChange: field.onChange,
17
+ onBlur: field.onBlur,
18
+ isDisabled: field.disabled || props.isDisabled,
19
+ error: props.error ?? error?.message,
20
+ isSearchable: true
21
+ })
214
22
  });
215
- $[20] = props;
216
- $[21] = renderStaticInput;
217
- $[22] = t1;
218
- } else t1 = $[22];
219
- return t1;
220
- }
23
+ }
24
+ return /* @__PURE__ */ jsx(SelectBase, {
25
+ ...props,
26
+ isSearchable: true
27
+ });
28
+ };
221
29
  //#endregion
222
30
  export { Autocomplete };
@@ -1,4 +1,19 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import { Key } from 'react-aria-components';
1
3
  import { FieldValues } from 'react-hook-form';
2
- import { QueryAutocompleteProps, QueryFn } from './queryAutocomplete.types';
3
- import { SelectItem } from '../shared/select.types';
4
- export declare const QueryAutocomplete: <TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn>(props: QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
4
+ import { AutocompleteProps } from './Autocomplete';
5
+ import { GroupedSelectControlProps, GroupedSelectProps, SelectItem } from '../shared/select.types';
6
+ import { OmitDiscriminatedUnion } from '../../../../types/common';
7
+ type QueryFn<TSelectItem extends SelectItem = SelectItem> = (...args: any) => UseQueryResult<Array<TSelectItem>>;
8
+ type TKey<TQueryFn extends QueryFn> = Exclude<ReturnType<TQueryFn>["data"], undefined>[0] extends {
9
+ id: infer InferredKey extends Key;
10
+ } ? InferredKey : never;
11
+ type QueryAutocompleteProps<TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn<TSelectItem>> = OmitDiscriminatedUnion<AutocompleteProps<TKey<TQueryFn>>, "items" | "onSearchChange" | "isLoading" | keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TKey<TQueryFn>> & {
12
+ query: Parameters<TQueryFn>[0] extends {
13
+ search?: string;
14
+ } ? TQueryFn : never;
15
+ queryParams?: Omit<Parameters<TQueryFn>[0], "search">;
16
+ queryOptions?: Parameters<TQueryFn>[1];
17
+ };
18
+ export declare const QueryAutocomplete: <TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn<TSelectItem>>({ query, queryParams, queryOptions, ...props }: QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -1,116 +1,20 @@
1
- import { UIConfig } from "../../../../config/uiConfig.context.js";
2
1
  import { Autocomplete } from "./Autocomplete.js";
3
- import { getQueryItems, shouldEnableQueryForSelection } from "../shared/querySelect.utils.js";
4
- import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
5
- import { c } from "react/compiler-runtime";
6
2
  import { jsx } from "react/jsx-runtime";
7
3
  import { useState } from "react";
8
- import { mergeRefs } from "@react-aria/utils";
9
- import { Controller } from "react-hook-form";
10
4
  //#region src/components/inputs/Selection/Autocomplete/QueryAutocomplete.tsx
11
- var QueryAutocompleteContent = ({ query, queryParams, queryOptions, queryMap, leadingContent, ...props }) => {
12
- "use no memo";
13
- const ui = UIConfig.useConfig();
5
+ var QueryAutocomplete = ({ query, queryParams, queryOptions, ...props }) => {
14
6
  const [search, setSearch] = useState("");
15
- const { onChange, ...restProps } = props;
16
- const { items, totalItems, isLoading, handleEnableQuery, hasNextPage, fetchNextPage } = useQueryAutocomplete({
17
- query,
18
- queryParams,
19
- queryOptions,
20
- mapItems: (data) => getQueryItems(data, queryMap),
7
+ const { data: items, isLoading } = query({
21
8
  search,
22
- initialQueryState: shouldEnableQueryForSelection({
23
- initialSelection: props.initialSelection,
24
- value: "value" in props ? props.value : void 0,
25
- mapInitialToSelectItem: props.mapInitialToSelectItem
26
- }) ? false : props.isInitialQueryDisabled ?? ui.queryAutocomplete?.isInitialQueryDisabled
27
- });
28
- const handleChange = (value) => {
29
- onChange?.(value);
30
- props.onBlur?.({ target: { value: null } });
31
- };
32
- const { isInitialQueryDisabled: _, ...autocompleteProps } = restProps;
33
- const onSearchChange = (value_0) => {
34
- setSearch(value_0);
35
- handleEnableQuery();
36
- };
9
+ ...queryParams
10
+ }, queryOptions);
37
11
  return /* @__PURE__ */ jsx(Autocomplete, {
38
- ...autocompleteProps,
39
- items,
40
- totalItems,
41
- onSearchChange,
12
+ ...props,
13
+ items: items ?? [],
14
+ onSearchChange: setSearch,
42
15
  isClientSearchDisabled: true,
43
- isLoading,
44
- onChange: handleChange,
45
- onMouseEnter: handleEnableQuery,
46
- onFocusCapture: handleEnableQuery,
47
- leadingContent,
48
- hasLoadMore: hasNextPage,
49
- onLoadMore: fetchNextPage
16
+ isLoading
50
17
  });
51
18
  };
52
- var QueryAutocomplete = (props) => {
53
- const $ = c(16);
54
- if ("formControl" in props && props.formControl) {
55
- let formControl;
56
- let innerProps;
57
- let ref;
58
- if ($[0] !== props) {
59
- ({formControl, ref, ...innerProps} = props);
60
- $[0] = props;
61
- $[1] = formControl;
62
- $[2] = innerProps;
63
- $[3] = ref;
64
- } else {
65
- formControl = $[1];
66
- innerProps = $[2];
67
- ref = $[3];
68
- }
69
- const controlWithOptions = formControl.control;
70
- let t0;
71
- if ($[4] !== controlWithOptions || $[5] !== innerProps || $[6] !== props.error || $[7] !== props.isDisabled || $[8] !== ref) {
72
- t0 = (t1) => {
73
- const { field, fieldState: t2 } = t1;
74
- const { error, isDirty } = t2;
75
- return /* @__PURE__ */ jsx(QueryAutocompleteContent, {
76
- ...innerProps,
77
- ref: mergeRefs(ref, field.ref),
78
- value: field.value,
79
- onChange: field.onChange,
80
- onBlur: field.onBlur,
81
- isDirty,
82
- isDisabled: field.disabled || props.isDisabled || !!controlWithOptions._options?.disabled,
83
- error: props.error ?? error?.message
84
- });
85
- };
86
- $[4] = controlWithOptions;
87
- $[5] = innerProps;
88
- $[6] = props.error;
89
- $[7] = props.isDisabled;
90
- $[8] = ref;
91
- $[9] = t0;
92
- } else t0 = $[9];
93
- let t1;
94
- if ($[10] !== formControl.control || $[11] !== formControl.name || $[12] !== t0) {
95
- t1 = /* @__PURE__ */ jsx(Controller, {
96
- control: formControl.control,
97
- name: formControl.name,
98
- render: t0
99
- });
100
- $[10] = formControl.control;
101
- $[11] = formControl.name;
102
- $[12] = t0;
103
- $[13] = t1;
104
- } else t1 = $[13];
105
- return t1;
106
- }
107
- let t0;
108
- if ($[14] !== props) {
109
- t0 = /* @__PURE__ */ jsx(QueryAutocompleteContent, { ...props });
110
- $[14] = props;
111
- $[15] = t0;
112
- } else t0 = $[15];
113
- return t0;
114
- };
115
19
  //#endregion
116
20
  export { QueryAutocomplete };
@@ -1,12 +1,8 @@
1
- import { ReactElement } from 'react';
2
1
  import { Key } from 'react-aria-components';
3
2
  import { FieldValues } from 'react-hook-form';
4
3
  import { SelectBaseProps } from '../shared/SelectBase';
5
4
  import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps, SelectAsyncProps } from '../shared/select.types';
6
5
  import { OmitDiscriminatedUnion } from '../../../../types/common';
7
- export type SelectProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = OmitDiscriminatedUnion<SelectBaseProps<TKey, TInitialSelectItem>, keyof SelectAsyncProps> & {
8
- renderStaticInput?: boolean;
9
- };
10
- export type ControlledSelectProps<TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = Omit<SelectProps<TKey, TInitialSelectItem>, keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TKey, TInitialSelectItem>;
11
- export declare function Select<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: SelectProps<TKey, TInitialSelectItem>): ReactElement;
12
- export declare function Select<TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: ControlledSelectProps<TFieldValues, TKey, TInitialSelectItem>): ReactElement;
6
+ export type SelectProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = OmitDiscriminatedUnion<SelectBaseProps<TKey, TInitialSelectItem>, "initialSelection" | "mapInitialToSelectItem" | keyof SelectAsyncProps>;
7
+ export type ControlledSelectProps<TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = Omit<SelectProps<TKey, TInitialSelectItem>, keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TKey>;
8
+ export declare const Select: <TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: ControlledSelectProps<TFieldValues, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
@@ -1,233 +1,26 @@
1
- import { Typography } from "../../../text/Typography/Typography.js";
2
- import { UIConfig } from "../../../../config/uiConfig.context.js";
3
- import { InputFrame } from "../../Skeleton/InputFrame.js";
4
- import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
5
- import { selectInputTagsContentWrapperCva } from "../shared/selectInput.cva.js";
6
1
  import { SelectBase } from "../shared/SelectBase.js";
7
- import { StaticSelectTrailingContent } from "../shared/StaticSelectTrailingContent.js";
8
- import { getStaticSelectValue } from "../shared/staticSelect.utils.js";
9
- import { c } from "react/compiler-runtime";
10
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- import { clsx } from "clsx";
12
- import { useRef, useState } from "react";
2
+ import { jsx } from "react/jsx-runtime";
13
3
  import { mergeRefs } from "@react-aria/utils";
14
4
  import { Controller } from "react-hook-form";
15
5
  //#region src/components/inputs/Selection/Select/Select.tsx
16
- function SelectInner(t0) {
17
- const $ = c(6);
18
- const { renderStaticInput, isFormControlDisabled, ...props } = t0;
19
- const ui = UIConfig.useConfig();
20
- const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
21
- const rootRef = useRef(null);
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;
35
- if (!renderInput && props.selectionMode !== "multiple" && !!props.showSelectionContent && currentValue != null) setRenderInput(true);
36
- if (!renderInput && !!props.customTrigger) setRenderInput(true);
37
- if (!renderInput) {
38
- const as = props.as ?? ui.input.as;
39
- const size = props.size ?? ui.input.size;
40
- let isDisabled = !!props.isDisabled;
41
- if (isFormControlDisabled) isDisabled = true;
42
- const mode = props.selectionMode ?? ui.select.selectionMode;
43
- const isMultiple = mode === "multiple";
44
- const { selectedItem, displayValue, isEmpty } = getStaticSelectValue({
45
- items: props.items,
46
- value: currentValue,
47
- selectionMode: mode,
48
- initialSelection: props.initialSelection,
49
- mapInitialToSelectItem: props.mapInitialToSelectItem,
50
- showSelectionContent: props.showSelectionContent,
51
- isDisabled,
52
- collapseAfter: props.collapseAfter ?? ui.select.collapseAfter,
53
- selectedTagsType: props.selectedTagsType ?? ui.select.selectedTagsType
54
- });
55
- const isSearchable = props.isSearchable ?? ui.select.isSearchable;
56
- const trailingContent = /* @__PURE__ */ jsx(StaticSelectTrailingContent, {
57
- trailingContent: props.trailingContent,
58
- hideDropdownIcon: props.hideDropdownIcon,
59
- isDisabled,
60
- size
61
- });
62
- const placeholder = as === "floating" ? null : props.placeholder;
63
- const inputValue = !isMultiple && selectedItem ? selectedItem.label : "";
64
- const shouldRenderPlaceholderAfterValue = isMultiple && props.placeholder && !isEmpty;
65
- const dataAttributes = {
66
- dataIsEmpty: isEmpty,
67
- dataIsFilled: !isEmpty,
68
- dataIsDirty: props.isDirty,
69
- dataIsRequired: props.isRequired,
70
- dataIsDisabled: isDisabled,
71
- dataDisabled: isDisabled,
72
- dataInvalid: !!props.error,
73
- dataHasSelection: !isEmpty,
74
- dataHasSearch: false
75
- };
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",
80
- children: placeholder
81
- }) : /* @__PURE__ */ jsx(Typography, {
82
- size: "label-1",
83
- as: "span",
84
- className: "block truncate",
85
- children: displayValue
86
- });
87
- return /* @__PURE__ */ jsx(InputFrame, {
88
- ...props,
89
- isDisabled,
90
- isLoading: false,
91
- className: clsx("w-full", props.containerClassName),
92
- inputClassName: clsx(props.className, props.inputClassName),
93
- contentWrapperClassName: selectInputTagsContentWrapperCva({ isSearchable }),
94
- contentGroup: "select",
95
- typographySize: "label-1",
96
- labelPlacement: "content-row",
97
- dataAttributes,
98
- renderStatic: true,
99
- wrapTrailingContent: false,
100
- onStaticInteract: renderRealInput,
101
- leadingContent: props.leadingContent && /* @__PURE__ */ jsx("div", {
102
- className: "ml-input-side-default flex shrink-0 items-center",
103
- children: props.leadingContent
104
- }),
105
- showClear: false,
106
- trailingContent,
107
- children: (dataAttributeProps) => /* @__PURE__ */ jsxs(Fragment, { children: [isMultiple && !isEmpty && displayValue, isSearchable ? /* @__PURE__ */ jsx("input", {
108
- disabled: isDisabled,
109
- tabIndex: -1,
110
- role: "combobox",
111
- "aria-autocomplete": "list",
112
- "aria-controls": `${dataAttributeProps.id}-listbox`,
113
- "aria-expanded": false,
114
- value: inputValue,
115
- placeholder: shouldRenderPlaceholderAfterValue ? props.placeholder : placeholder ?? void 0,
116
- className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", props.inputClassName),
117
- onChange: (event) => replayStaticInputChange(event.target.value),
118
- ...dataAttributeProps,
119
- "data-rac": true
120
- }) : /* @__PURE__ */ jsx("button", {
121
- type: "button",
122
- disabled: isDisabled,
123
- tabIndex: -1,
124
- "data-type": "select-trigger",
125
- className: clsx("w-full truncate bg-transparent text-start outline-none disabled:text-interactive-text-secondary-disabled", isMultiple && !isEmpty && "absolute inset-0 z-0"),
126
- onClick: replayStaticInputPress,
127
- ...dataAttributeProps,
128
- "data-rac": true,
129
- children: buttonContent
130
- })] })
131
- });
132
- }
133
- const T0 = SelectBase;
134
- const t2 = mergeRefs(props.ref, rootRef);
135
- let t3;
136
- if ($[2] !== T0 || $[3] !== props || $[4] !== t2) {
137
- t3 = /* @__PURE__ */ jsx(T0, {
138
- ...props,
139
- ref: t2
140
- });
141
- $[2] = T0;
142
- $[3] = props;
143
- $[4] = t2;
144
- $[5] = t3;
145
- } else t3 = $[5];
146
- return t3;
147
- }
148
- function _temp(root) {
149
- return root.querySelector("[data-type='select-trigger'], input, button, [tabindex]");
150
- }
151
- function Select(t0) {
152
- const $ = c(21);
153
- let props;
154
- let renderStaticInput;
155
- if ($[0] !== t0) {
156
- ({renderStaticInput, ...props} = t0);
157
- $[0] = t0;
158
- $[1] = props;
159
- $[2] = renderStaticInput;
160
- } else {
161
- props = $[1];
162
- renderStaticInput = $[2];
163
- }
6
+ var Select = (props) => {
164
7
  if ("formControl" in props && props.formControl) {
165
- let formControl;
166
- let innerProps;
167
- let ref;
168
- if ($[3] !== props) {
169
- ({formControl, ref, ...innerProps} = props);
170
- $[3] = props;
171
- $[4] = formControl;
172
- $[5] = innerProps;
173
- $[6] = ref;
174
- } else {
175
- formControl = $[4];
176
- innerProps = $[5];
177
- ref = $[6];
178
- }
179
- const controlWithOptions = formControl.control;
180
- let t1;
181
- if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
182
- t1 = (t2) => {
183
- const { field, fieldState: t3 } = t2;
184
- const { error, isDirty } = t3;
185
- return /* @__PURE__ */ jsx(SelectInner, {
186
- ...innerProps,
187
- ref: mergeRefs(ref, field.ref),
188
- value: field.value,
189
- onChange: field.onChange,
190
- onBlur: field.onBlur,
191
- isDirty,
192
- isDisabled: field.disabled || props.isDisabled,
193
- isFormControlDisabled: !!controlWithOptions._options?.disabled,
194
- error: props.error ?? error?.message,
195
- renderStaticInput
196
- });
197
- };
198
- $[7] = controlWithOptions._options?.disabled;
199
- $[8] = innerProps;
200
- $[9] = props.error;
201
- $[10] = props.isDisabled;
202
- $[11] = ref;
203
- $[12] = renderStaticInput;
204
- $[13] = t1;
205
- } else t1 = $[13];
206
- let t2;
207
- if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
208
- t2 = /* @__PURE__ */ jsx(Controller, {
209
- control: formControl.control,
210
- name: formControl.name,
211
- render: t1
212
- });
213
- $[14] = formControl.control;
214
- $[15] = formControl.name;
215
- $[16] = t1;
216
- $[17] = t2;
217
- } else t2 = $[17];
218
- return t2;
219
- }
220
- let t1;
221
- if ($[18] !== props || $[19] !== renderStaticInput) {
222
- t1 = /* @__PURE__ */ jsx(SelectInner, {
223
- ...props,
224
- renderStaticInput
8
+ const { formControl, ref, ...innerProps } = props;
9
+ return /* @__PURE__ */ jsx(Controller, {
10
+ control: formControl.control,
11
+ name: formControl.name,
12
+ render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(SelectBase, {
13
+ ...innerProps,
14
+ ref: mergeRefs(ref, field.ref),
15
+ value: field.value,
16
+ onChange: field.onChange,
17
+ onBlur: field.onBlur,
18
+ isDisabled: field.disabled || props.isDisabled,
19
+ error: props.error ?? error?.message
20
+ })
225
21
  });
226
- $[18] = props;
227
- $[19] = renderStaticInput;
228
- $[20] = t1;
229
- } else t1 = $[20];
230
- return t1;
231
- }
22
+ }
23
+ return /* @__PURE__ */ jsx(SelectBase, { ...props });
24
+ };
232
25
  //#endregion
233
26
  export { Select };