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