@povio/ui 3.3.0-rc.4 → 3.3.0

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 (63) hide show
  1. package/README.md +15 -1
  2. package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
  3. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  4. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  5. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  6. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +93 -227
  7. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +84 -202
  8. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +60 -132
  9. package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
  10. package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
  11. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
  12. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
  13. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
  14. package/dist/components/inputs/DateTime/shared/DateField.js +135 -306
  15. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +140 -338
  16. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  17. package/dist/components/inputs/File/FileUpload.js +1 -1
  18. package/dist/components/inputs/File/InputUpload.js +65 -261
  19. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
  20. package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
  21. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
  22. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
  23. package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
  24. package/dist/components/inputs/FormField/FormField.js +34 -47
  25. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +75 -313
  26. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +23 -83
  27. package/dist/components/inputs/Selection/Select/QuerySelect.js +30 -96
  28. package/dist/components/inputs/Selection/Select/Select.js +3 -3
  29. package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
  30. package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
  31. package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
  32. package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
  33. package/dist/components/inputs/TextEditor/TextEditor.js +87 -389
  34. package/dist/components/inputs/shared/InputClear.js +24 -40
  35. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  36. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  37. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  38. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  39. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
  40. package/dist/components/shared/pagination/Pagination.js +22 -108
  41. package/dist/components/status/Alert/Alert.js +30 -97
  42. package/dist/components/table/InfiniteTable.js +16 -67
  43. package/dist/components/table/Table.d.ts +2 -8
  44. package/dist/components/table/Table.js +33 -55
  45. package/dist/components/text/Typography/Typography.js +8 -23
  46. package/dist/config/confirmation.context.js +1 -1
  47. package/dist/config/theme.context.js +45 -98
  48. package/dist/config/uiConfig.context.js +8 -39
  49. package/dist/config/uiOverrides.context.d.ts +0 -1
  50. package/dist/hooks/useDebounceCallback.js +17 -51
  51. package/dist/hooks/useFormAutosave.js +33 -120
  52. package/dist/hooks/useLongPressRepeat.js +20 -55
  53. package/dist/index.d.ts +0 -1
  54. package/dist/index.js +1 -2
  55. package/package.json +2 -2
  56. package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
  57. package/dist/components/inputs/FormField/formField.cva.js +0 -16
  58. package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
  59. package/dist/components/table/TableColumnFilterInput.js +0 -108
  60. package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
  61. package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
  62. package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
  63. package/dist/components/table/TableColumnFilterRow.js +0 -68
@@ -28,337 +28,99 @@ var normalizeRangeValue = (value, minValue, maxValue) => {
28
28
  };
29
29
  };
30
30
  var NumberRangeInputBase = (props) => {
31
- const $ = c(114);
32
31
  const ui = UIConfig.useConfig();
33
32
  const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
34
33
  const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
35
- let asProp;
36
- let autoFocusOnMount;
37
- let className;
38
- let error;
39
- let errorClassName;
40
- let headerClassName;
41
- let helperText;
42
- let hideLabelProps;
43
- let inputClassName;
44
- let isClearableProps;
45
- let isDirty;
46
- let isDisabled;
47
- let isHeaderHidden;
48
- let isRequired;
49
- let label;
50
- let maxInputClassName;
51
- let maxValue;
52
- let minInputClassName;
53
- let minValue;
54
- let onBlur;
55
- let onChange;
56
- let onMaxChange;
57
- let onMinChange;
58
- let ref;
59
- let rest;
60
- let rightContent;
61
- let sizeProps;
62
- let t0;
63
- let t1;
64
- let t2;
65
- let t3;
66
- let t4;
67
- let t5;
68
- let tooltipText;
69
- let value;
70
- let variantProps;
71
- if ($[0] !== props) {
72
- ({ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, inputClassName, minInputClassName, maxInputClassName, value, minValue, maxValue, minPlaceholder: t0, maxPlaceholder: t1, minLabel: t2, maxLabel: t3, invalidRangeError: t4, hideInnerLabels: t5, isDirty, autoFocusOnMount, onChange, onMinChange, onMaxChange, onBlur, isClearable: isClearableProps, as: asProp, variant: variantProps, size: sizeProps, hideLabel: hideLabelProps, ...rest} = props);
73
- $[0] = props;
74
- $[1] = asProp;
75
- $[2] = autoFocusOnMount;
76
- $[3] = className;
77
- $[4] = error;
78
- $[5] = errorClassName;
79
- $[6] = headerClassName;
80
- $[7] = helperText;
81
- $[8] = hideLabelProps;
82
- $[9] = inputClassName;
83
- $[10] = isClearableProps;
84
- $[11] = isDirty;
85
- $[12] = isDisabled;
86
- $[13] = isHeaderHidden;
87
- $[14] = isRequired;
88
- $[15] = label;
89
- $[16] = maxInputClassName;
90
- $[17] = maxValue;
91
- $[18] = minInputClassName;
92
- $[19] = minValue;
93
- $[20] = onBlur;
94
- $[21] = onChange;
95
- $[22] = onMaxChange;
96
- $[23] = onMinChange;
97
- $[24] = ref;
98
- $[25] = rest;
99
- $[26] = rightContent;
100
- $[27] = sizeProps;
101
- $[28] = t0;
102
- $[29] = t1;
103
- $[30] = t2;
104
- $[31] = t3;
105
- $[32] = t4;
106
- $[33] = t5;
107
- $[34] = tooltipText;
108
- $[35] = value;
109
- $[36] = variantProps;
110
- } else {
111
- asProp = $[1];
112
- autoFocusOnMount = $[2];
113
- className = $[3];
114
- error = $[4];
115
- errorClassName = $[5];
116
- headerClassName = $[6];
117
- helperText = $[7];
118
- hideLabelProps = $[8];
119
- inputClassName = $[9];
120
- isClearableProps = $[10];
121
- isDirty = $[11];
122
- isDisabled = $[12];
123
- isHeaderHidden = $[13];
124
- isRequired = $[14];
125
- label = $[15];
126
- maxInputClassName = $[16];
127
- maxValue = $[17];
128
- minInputClassName = $[18];
129
- minValue = $[19];
130
- onBlur = $[20];
131
- onChange = $[21];
132
- onMaxChange = $[22];
133
- onMinChange = $[23];
134
- ref = $[24];
135
- rest = $[25];
136
- rightContent = $[26];
137
- sizeProps = $[27];
138
- t0 = $[28];
139
- t1 = $[29];
140
- t2 = $[30];
141
- t3 = $[31];
142
- t4 = $[32];
143
- t5 = $[33];
144
- tooltipText = $[34];
145
- value = $[35];
146
- variantProps = $[36];
147
- }
148
- const minPlaceholder = t0 === void 0 ? "Min" : t0;
149
- const maxPlaceholder = t1 === void 0 ? "Max" : t1;
150
- const minLabel = t2 === void 0 ? "Minimum" : t2;
151
- const maxLabel = t3 === void 0 ? "Maximum" : t3;
152
- const invalidRangeError = t4 === void 0 ? "Minimum cannot be greater than maximum" : t4;
153
- const hideInnerLabels = t5 === void 0 ? true : t5;
34
+ const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, inputClassName, minInputClassName, maxInputClassName, value, minValue, maxValue, minPlaceholder = "Min", maxPlaceholder = "Max", minLabel = "Minimum", maxLabel = "Maximum", invalidRangeError = "Minimum cannot be greater than maximum", hideInnerLabels = true, isDirty, autoFocusOnMount, onChange, onMinChange, onMaxChange, onBlur, isClearable: isClearableProps, as: asProp, variant: variantProps, size: sizeProps, hideLabel: hideLabelProps, ...rest } = props;
154
35
  const isClearable = isClearableProps ?? ui.input.isClearable;
155
36
  const as = asProp ?? ui.input.as;
156
37
  const variant = variantProps ?? ui.input.variant;
157
38
  const size = sizeProps ?? ui.input.size;
158
39
  const hideLabel = hideLabelProps ?? ui.input.hideLabel;
159
- let t6;
160
- if ($[37] !== maxValue || $[38] !== minValue || $[39] !== value) {
161
- t6 = normalizeRangeValue(value, minValue, maxValue);
162
- $[37] = maxValue;
163
- $[38] = minValue;
164
- $[39] = value;
165
- $[40] = t6;
166
- } else t6 = $[40];
167
- const rangeValue = t6;
40
+ const rangeValue = normalizeRangeValue(value, minValue, maxValue);
168
41
  const isEmpty = rangeValue.min === null && rangeValue.max === null;
169
42
  const rangeError = rangeValue.min !== null && rangeValue.max !== null && rangeValue.min > rangeValue.max ? invalidRangeError : void 0;
170
43
  const effectiveError = error || rangeError;
171
- let t7;
172
- if ($[41] !== isDisabled) {
173
- t7 = { isDisabled };
174
- $[41] = isDisabled;
175
- $[42] = t7;
176
- } else t7 = $[42];
177
- const { hoverProps, isHovered } = useHover(t7);
44
+ const { hoverProps, isHovered } = useHover({ isDisabled });
178
45
  const { isFocusVisible } = useFocusVisible();
179
46
  const [isFocused, setIsFocused] = useState(false);
180
- let t8;
181
- if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
182
- t8 = { onFocusWithinChange: setIsFocused };
183
- $[43] = t8;
184
- } else t8 = $[43];
185
- const { focusWithinProps } = useFocusWithin(t8);
186
- const t9 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
187
- let t10;
188
- if ($[44] !== effectiveError || $[45] !== errorClassName || $[46] !== headerClassName || $[47] !== helperText || $[48] !== hideLabel || $[49] !== isDisabled || $[50] !== isRequired || $[51] !== label || $[52] !== rightContent || $[53] !== t9 || $[54] !== tooltipText) {
189
- t10 = {
190
- error: effectiveError,
191
- label,
192
- tooltipText,
193
- helperText,
194
- isRequired,
195
- rightContent,
196
- isHeaderHidden: t9,
197
- hideLabel,
198
- isDisabled,
199
- headerClassName,
200
- errorClassName
201
- };
202
- $[44] = effectiveError;
203
- $[45] = errorClassName;
204
- $[46] = headerClassName;
205
- $[47] = helperText;
206
- $[48] = hideLabel;
207
- $[49] = isDisabled;
208
- $[50] = isRequired;
209
- $[51] = label;
210
- $[52] = rightContent;
211
- $[53] = t9;
212
- $[54] = tooltipText;
213
- $[55] = t10;
214
- } else t10 = $[55];
215
- const formFieldProps = t10;
216
- const t11 = hideLabel || isHeaderHidden;
217
- let t12;
218
- if ($[56] !== headerClassName || $[57] !== helperText || $[58] !== isDisabled || $[59] !== isRequired || $[60] !== label || $[61] !== rightContent || $[62] !== t11 || $[63] !== tooltipText) {
219
- t12 = {
220
- label,
221
- tooltipText,
222
- helperText,
223
- isRequired,
224
- rightContent,
225
- isHeaderHidden: t11,
226
- isDisabled,
227
- className: headerClassName
228
- };
229
- $[56] = headerClassName;
230
- $[57] = helperText;
231
- $[58] = isDisabled;
232
- $[59] = isRequired;
233
- $[60] = label;
234
- $[61] = rightContent;
235
- $[62] = t11;
236
- $[63] = tooltipText;
237
- $[64] = t12;
238
- } else t12 = $[64];
239
- const headerProps = t12;
240
- let t13;
241
- if ($[65] !== onChange || $[66] !== onMaxChange || $[67] !== onMinChange || $[68] !== rangeValue) {
242
- t13 = (side, nextValue) => {
243
- const nextRange = {
244
- ...rangeValue,
245
- [side]: nextValue
246
- };
247
- onChange?.(nextRange);
248
- if (side === "min") onMinChange?.(nextValue);
249
- else onMaxChange?.(nextValue);
250
- };
251
- $[65] = onChange;
252
- $[66] = onMaxChange;
253
- $[67] = onMinChange;
254
- $[68] = rangeValue;
255
- $[69] = t13;
256
- } else t13 = $[69];
257
- const updateRange = t13;
258
- let t14;
259
- if ($[70] !== onBlur || $[71] !== updateRange) {
260
- t14 = (side_0) => {
261
- updateRange(side_0, null);
262
- onBlur?.({ target: { value: "" } });
47
+ const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
48
+ const formFieldProps = {
49
+ error: effectiveError,
50
+ label,
51
+ tooltipText,
52
+ helperText,
53
+ isRequired,
54
+ rightContent,
55
+ isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
56
+ hideLabel,
57
+ isDisabled,
58
+ headerClassName,
59
+ errorClassName
60
+ };
61
+ const headerProps = {
62
+ label,
63
+ tooltipText,
64
+ helperText,
65
+ isRequired,
66
+ rightContent,
67
+ isHeaderHidden: hideLabel || isHeaderHidden,
68
+ isDisabled,
69
+ className: headerClassName
70
+ };
71
+ const updateRange = (side, nextValue) => {
72
+ const nextRange = {
73
+ ...rangeValue,
74
+ [side]: nextValue
263
75
  };
264
- $[70] = onBlur;
265
- $[71] = updateRange;
266
- $[72] = t14;
267
- } else t14 = $[72];
268
- const clearRangeSide = t14;
269
- let t15;
270
- if ($[73] !== as || $[74] !== inputBaseCva || $[75] !== variant) {
271
- t15 = inputBaseCva({
76
+ onChange?.(nextRange);
77
+ if (side === "min") onMinChange?.(nextValue);
78
+ else onMaxChange?.(nextValue);
79
+ };
80
+ const clearRangeSide = (side_0) => {
81
+ updateRange(side_0, null);
82
+ onBlur?.({ target: { value: "" } });
83
+ };
84
+ return /* @__PURE__ */ jsx(NumberRangeField, {
85
+ ...rest,
86
+ ref,
87
+ as,
88
+ className,
89
+ inputClassName,
90
+ minInputClassName,
91
+ maxInputClassName,
92
+ inputBaseClassName: inputBaseCva({
272
93
  variant,
273
94
  as
274
- });
275
- $[73] = as;
276
- $[74] = inputBaseCva;
277
- $[75] = variant;
278
- $[76] = t15;
279
- } else t15 = $[76];
280
- let t16;
281
- if ($[77] !== as || $[78] !== inputSizeCva || $[79] !== size) {
282
- t16 = inputSizeCva({
95
+ }),
96
+ inputSizeClassName: inputSizeCva({
283
97
  size,
284
98
  as
285
- });
286
- $[77] = as;
287
- $[78] = inputSizeCva;
288
- $[79] = size;
289
- $[80] = t16;
290
- } else t16 = $[80];
291
- let t17;
292
- if ($[81] !== as || $[82] !== autoFocusOnMount || $[83] !== className || $[84] !== clearRangeSide || $[85] !== effectiveError || $[86] !== focusWithinProps || $[87] !== formFieldProps || $[88] !== headerProps || $[89] !== hideInnerLabels || $[90] !== hoverProps || $[91] !== inputClassName || $[92] !== isClearable || $[93] !== isDirty || $[94] !== isDisabled || $[95] !== isEmpty || $[96] !== isFocusVisible || $[97] !== isFocused || $[98] !== isHovered || $[99] !== isRequired || $[100] !== maxInputClassName || $[101] !== maxLabel || $[102] !== maxPlaceholder || $[103] !== minInputClassName || $[104] !== minLabel || $[105] !== minPlaceholder || $[106] !== onBlur || $[107] !== rangeValue || $[108] !== ref || $[109] !== rest || $[110] !== t15 || $[111] !== t16 || $[112] !== updateRange) {
293
- t17 = /* @__PURE__ */ jsx(NumberRangeField, {
294
- ...rest,
295
- ref,
296
- as,
297
- className,
298
- inputClassName,
299
- minInputClassName,
300
- maxInputClassName,
301
- inputBaseClassName: t15,
302
- inputSizeClassName: t16,
303
- formFieldProps,
304
- headerProps,
305
- rangeValue,
306
- effectiveError,
307
- minPlaceholder,
308
- maxPlaceholder,
309
- minLabel,
310
- maxLabel,
311
- hideInnerLabels,
312
- isDirty,
313
- isClearable,
314
- autoFocusOnMount,
315
- isDisabled,
316
- isRequired,
317
- isEmpty,
318
- isHovered,
319
- isFocused,
320
- isFocusVisible,
321
- focusWithinProps,
322
- hoverProps,
323
- onRangeSideChange: updateRange,
324
- onRangeSideClear: clearRangeSide,
325
- onBlur
326
- });
327
- $[81] = as;
328
- $[82] = autoFocusOnMount;
329
- $[83] = className;
330
- $[84] = clearRangeSide;
331
- $[85] = effectiveError;
332
- $[86] = focusWithinProps;
333
- $[87] = formFieldProps;
334
- $[88] = headerProps;
335
- $[89] = hideInnerLabels;
336
- $[90] = hoverProps;
337
- $[91] = inputClassName;
338
- $[92] = isClearable;
339
- $[93] = isDirty;
340
- $[94] = isDisabled;
341
- $[95] = isEmpty;
342
- $[96] = isFocusVisible;
343
- $[97] = isFocused;
344
- $[98] = isHovered;
345
- $[99] = isRequired;
346
- $[100] = maxInputClassName;
347
- $[101] = maxLabel;
348
- $[102] = maxPlaceholder;
349
- $[103] = minInputClassName;
350
- $[104] = minLabel;
351
- $[105] = minPlaceholder;
352
- $[106] = onBlur;
353
- $[107] = rangeValue;
354
- $[108] = ref;
355
- $[109] = rest;
356
- $[110] = t15;
357
- $[111] = t16;
358
- $[112] = updateRange;
359
- $[113] = t17;
360
- } else t17 = $[113];
361
- return t17;
99
+ }),
100
+ formFieldProps,
101
+ headerProps,
102
+ rangeValue,
103
+ effectiveError,
104
+ minPlaceholder,
105
+ maxPlaceholder,
106
+ minLabel,
107
+ maxLabel,
108
+ hideInnerLabels,
109
+ isDirty,
110
+ isClearable,
111
+ autoFocusOnMount,
112
+ isDisabled,
113
+ isRequired,
114
+ isEmpty,
115
+ isHovered,
116
+ isFocused,
117
+ isFocusVisible,
118
+ focusWithinProps,
119
+ hoverProps,
120
+ onRangeSideChange: updateRange,
121
+ onRangeSideClear: clearRangeSide,
122
+ onBlur
123
+ });
362
124
  };
363
125
  var NumberRangeInputInner = (t0) => {
364
126
  const $ = c(5);
@@ -134,92 +134,32 @@ function AutocompleteInner(t0) {
134
134
  function _temp(root) {
135
135
  return root.querySelector("input, [data-type='select-trigger'], button, [tabindex]");
136
136
  }
137
- function Autocomplete(t0) {
138
- const $ = c(23);
139
- let props;
140
- let renderStaticInput;
141
- if ($[0] !== t0) {
142
- ({renderStaticInput, ...props} = t0);
143
- $[0] = t0;
144
- $[1] = props;
145
- $[2] = renderStaticInput;
146
- } else {
147
- props = $[1];
148
- renderStaticInput = $[2];
149
- }
137
+ function Autocomplete({ renderStaticInput, ...props }) {
150
138
  if ("formControl" in props && props.formControl) {
151
- let formControl;
152
- let innerProps;
153
- let ref;
154
- let t1;
155
- if ($[3] !== props) {
156
- ({ignoreInputValueFiltering: t1, formControl, ref, ...innerProps} = props);
157
- $[3] = props;
158
- $[4] = formControl;
159
- $[5] = innerProps;
160
- $[6] = ref;
161
- $[7] = t1;
162
- } else {
163
- formControl = $[4];
164
- innerProps = $[5];
165
- ref = $[6];
166
- t1 = $[7];
167
- }
168
- const ignoreInputValueFiltering = t1 === void 0 ? true : t1;
139
+ const { ignoreInputValueFiltering = true, formControl, ref, ...innerProps } = props;
169
140
  const controlWithOptions = formControl.control;
170
- let t2;
171
- if ($[8] !== controlWithOptions._options?.disabled || $[9] !== ignoreInputValueFiltering || $[10] !== innerProps || $[11] !== props.error || $[12] !== props.isDisabled || $[13] !== ref || $[14] !== renderStaticInput) {
172
- t2 = (t3) => {
173
- const { field, fieldState: t4 } = t3;
174
- const { error, isDirty } = t4;
175
- return /* @__PURE__ */ jsx(AutocompleteInner, {
176
- ...innerProps,
177
- ref: mergeRefs(ref, field.ref),
178
- value: field.value,
179
- onChange: field.onChange,
180
- onBlur: field.onBlur,
181
- isDirty,
182
- isDisabled: field.disabled || props.isDisabled,
183
- isFormControlDisabled: !!controlWithOptions._options?.disabled,
184
- error: props.error ?? error?.message,
185
- ignoreInputValueFiltering,
186
- renderStaticInput
187
- });
188
- };
189
- $[8] = controlWithOptions._options?.disabled;
190
- $[9] = ignoreInputValueFiltering;
191
- $[10] = innerProps;
192
- $[11] = props.error;
193
- $[12] = props.isDisabled;
194
- $[13] = ref;
195
- $[14] = renderStaticInput;
196
- $[15] = t2;
197
- } else t2 = $[15];
198
- let t3;
199
- if ($[16] !== formControl.control || $[17] !== formControl.name || $[18] !== t2) {
200
- t3 = /* @__PURE__ */ jsx(Controller, {
201
- control: formControl.control,
202
- name: formControl.name,
203
- render: t2
204
- });
205
- $[16] = formControl.control;
206
- $[17] = formControl.name;
207
- $[18] = t2;
208
- $[19] = t3;
209
- } else t3 = $[19];
210
- return t3;
211
- }
212
- let t1;
213
- if ($[20] !== props || $[21] !== renderStaticInput) {
214
- t1 = /* @__PURE__ */ jsx(AutocompleteInner, {
215
- ...props,
216
- renderStaticInput
141
+ return /* @__PURE__ */ jsx(Controller, {
142
+ control: formControl.control,
143
+ name: formControl.name,
144
+ render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(AutocompleteInner, {
145
+ ...innerProps,
146
+ ref: mergeRefs(ref, field.ref),
147
+ value: field.value,
148
+ onChange: field.onChange,
149
+ onBlur: field.onBlur,
150
+ isDirty,
151
+ isDisabled: field.disabled || props.isDisabled,
152
+ isFormControlDisabled: !!controlWithOptions._options?.disabled,
153
+ error: props.error ?? error?.message,
154
+ ignoreInputValueFiltering,
155
+ renderStaticInput
156
+ })
217
157
  });
218
- $[20] = props;
219
- $[21] = renderStaticInput;
220
- $[22] = t1;
221
- } else t1 = $[22];
222
- return t1;
158
+ }
159
+ return /* @__PURE__ */ jsx(AutocompleteInner, {
160
+ ...props,
161
+ renderStaticInput
162
+ });
223
163
  }
224
164
  //#endregion
225
165
  export { Autocomplete };
@@ -8,10 +8,7 @@ import { useState } from "react";
8
8
  import { mergeRefs } from "@react-aria/utils";
9
9
  import { Controller } from "react-hook-form";
10
10
  //#region src/components/inputs/Selection/Select/QuerySelect.tsx
11
- var LoadedQuerySelectContent = (t0) => {
12
- const $ = c(31);
13
- const { query, queryParams, queryOptions, queryMap, resolveSelectedItemsWithIds, isQueryEnabledInitially: t1, ...props } = t0;
14
- const isQueryEnabledInitially = t1 === void 0 ? false : t1;
11
+ var LoadedQuerySelectContent = ({ query, queryParams, queryOptions, queryMap, resolveSelectedItemsWithIds, isQueryEnabledInitially = false, ...props }) => {
15
12
  const ui = UIConfig.useConfig();
16
13
  const [search, setSearch] = useState("");
17
14
  const isSearchable = props.isSearchable ?? ui.select.isSearchable;
@@ -24,100 +21,37 @@ var LoadedQuerySelectContent = (t0) => {
24
21
  const shouldEnableInitialQuery = selectedIdsToResolve.count > 0;
25
22
  const isInitialQueryDisabled = props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled;
26
23
  const shouldDisableInitialQuery = !isQueryEnabledInitially && !shouldEnableInitialQuery && (selectedIdsToResolve.isResolvedByInitialSelection || isInitialQueryDisabled);
27
- let t2;
28
- if ($[0] !== queryMap) {
29
- t2 = (data) => getQueryItems(data, queryMap);
30
- $[0] = queryMap;
31
- $[1] = t2;
32
- } else t2 = $[1];
33
- const t3 = resolveSelectedItemsWithIds ?? ui.querySelect?.resolveSelectedItemsWithIds;
34
- const t4 = isSearchable ? search : void 0;
35
- let t5;
36
- if ($[2] !== query || $[3] !== queryOptions || $[4] !== queryParams || $[5] !== selectedIdsToResolve.items || $[6] !== shouldDisableInitialQuery || $[7] !== t2 || $[8] !== t3 || $[9] !== t4) {
37
- t5 = {
38
- query,
39
- queryParams,
40
- queryOptions,
41
- mapItems: t2,
42
- resolveSelectedItemsWithIds: t3,
43
- search: t4,
44
- initialQueryState: shouldDisableInitialQuery,
45
- selectedIdsToResolve: selectedIdsToResolve.items
46
- };
47
- $[2] = query;
48
- $[3] = queryOptions;
49
- $[4] = queryParams;
50
- $[5] = selectedIdsToResolve.items;
51
- $[6] = shouldDisableInitialQuery;
52
- $[7] = t2;
53
- $[8] = t3;
54
- $[9] = t4;
55
- $[10] = t5;
56
- } else t5 = $[10];
57
- const { items, totalItems, isLoading, handleEnableQuery, hasNextPage, fetchNextPage } = useQueryAutocomplete(t5);
58
- let onSearchChange;
59
- let selectProps;
60
- if ($[11] !== props) {
61
- const { isInitialQueryDisabled: _, onSearchChange: t6, ...t7 } = props;
62
- onSearchChange = t6;
63
- selectProps = t7;
64
- $[11] = props;
65
- $[12] = onSearchChange;
66
- $[13] = selectProps;
67
- } else {
68
- onSearchChange = $[12];
69
- selectProps = $[13];
70
- }
71
- let t6;
72
- if ($[14] !== handleEnableQuery || $[15] !== onSearchChange || $[16] !== setSearch) {
73
- t6 = (value_0) => {
74
- setSearch(value_0);
75
- handleEnableQuery();
76
- onSearchChange?.(value_0);
77
- };
78
- $[14] = handleEnableQuery;
79
- $[15] = onSearchChange;
80
- $[16] = setSearch;
81
- $[17] = t6;
82
- } else t6 = $[17];
83
- const handleSearchChange = t6;
84
- const t7 = props.searchDebounceDelay ?? ui.querySelect?.searchDebounceDelay;
85
- let t8;
86
- if ($[18] !== handleSearchChange || $[19] !== isSearchable) {
87
- t8 = isSearchable && {
24
+ const { items, totalItems, isLoading, handleEnableQuery, hasNextPage, fetchNextPage } = useQueryAutocomplete({
25
+ query,
26
+ queryParams,
27
+ queryOptions,
28
+ mapItems: (data) => getQueryItems(data, queryMap),
29
+ resolveSelectedItemsWithIds: resolveSelectedItemsWithIds ?? ui.querySelect?.resolveSelectedItemsWithIds,
30
+ search: isSearchable ? search : void 0,
31
+ initialQueryState: shouldDisableInitialQuery,
32
+ selectedIdsToResolve: selectedIdsToResolve.items
33
+ });
34
+ const { isInitialQueryDisabled: _, onSearchChange, ...selectProps } = props;
35
+ const handleSearchChange = (value_0) => {
36
+ setSearch(value_0);
37
+ handleEnableQuery();
38
+ onSearchChange?.(value_0);
39
+ };
40
+ return /* @__PURE__ */ jsx(Select, {
41
+ ...selectProps,
42
+ items,
43
+ isLoading,
44
+ totalItems,
45
+ hasLoadMore: hasNextPage,
46
+ onLoadMore: fetchNextPage,
47
+ searchDebounceDelay: props.searchDebounceDelay ?? ui.querySelect?.searchDebounceDelay,
48
+ onMouseEnter: handleEnableQuery,
49
+ onFocusCapture: handleEnableQuery,
50
+ ...isSearchable && {
88
51
  isClientSearchDisabled: true,
89
52
  onSearchChange: handleSearchChange
90
- };
91
- $[18] = handleSearchChange;
92
- $[19] = isSearchable;
93
- $[20] = t8;
94
- } else t8 = $[20];
95
- let t9;
96
- if ($[21] !== fetchNextPage || $[22] !== handleEnableQuery || $[23] !== hasNextPage || $[24] !== isLoading || $[25] !== items || $[26] !== selectProps || $[27] !== t7 || $[28] !== t8 || $[29] !== totalItems) {
97
- t9 = /* @__PURE__ */ jsx(Select, {
98
- ...selectProps,
99
- items,
100
- isLoading,
101
- totalItems,
102
- hasLoadMore: hasNextPage,
103
- onLoadMore: fetchNextPage,
104
- searchDebounceDelay: t7,
105
- onMouseEnter: handleEnableQuery,
106
- onFocusCapture: handleEnableQuery,
107
- ...t8
108
- });
109
- $[21] = fetchNextPage;
110
- $[22] = handleEnableQuery;
111
- $[23] = hasNextPage;
112
- $[24] = isLoading;
113
- $[25] = items;
114
- $[26] = selectProps;
115
- $[27] = t7;
116
- $[28] = t8;
117
- $[29] = totalItems;
118
- $[30] = t9;
119
- } else t9 = $[30];
120
- return t9;
53
+ }
54
+ });
121
55
  };
122
56
  var QuerySelectContent = (props) => {
123
57
  const $ = c(9);
@@ -77,12 +77,12 @@ function SelectInner(t0) {
77
77
  };
78
78
  const buttonContent = isMultiple && !isEmpty ? /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }) : isEmpty ? /* @__PURE__ */ jsx(Typography, {
79
79
  size: "label-1",
80
- as: "p",
80
+ as: "span",
81
81
  className: "block truncate text-text-default-3",
82
- children: placeholder || (as === "filter" ? "\xA0" : null)
82
+ children: placeholder
83
83
  }) : /* @__PURE__ */ jsx(Typography, {
84
84
  size: "label-1",
85
- as: "p",
85
+ as: "span",
86
86
  className: "block truncate",
87
87
  children: displayValue
88
88
  });