@povio/ui 3.3.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +1 -1
  2. package/dist/browser-tests/checkbox/CheckboxGroupHarness.d.ts +10 -0
  3. package/dist/browser-tests/checkbox/CheckboxHarness.d.ts +10 -0
  4. package/dist/browser-tests/checkbox/checkbox-group.spec.d.ts +1 -0
  5. package/dist/browser-tests/checkbox/checkbox.spec.d.ts +1 -0
  6. package/dist/browser-tests/datetime-picker/DateTimeHarnesses.d.ts +43 -0
  7. package/dist/browser-tests/datetime-picker/assertions.d.ts +9 -0
  8. package/dist/browser-tests/datetime-picker/date-input-focus.firefox.spec.d.ts +1 -0
  9. package/dist/browser-tests/datetime-picker/date-picker.spec.d.ts +1 -0
  10. package/dist/browser-tests/datetime-picker/date-range-picker.spec.d.ts +1 -0
  11. package/dist/browser-tests/datetime-picker/date-time-picker.spec.d.ts +1 -0
  12. package/dist/browser-tests/datetime-picker/time-picker.spec.d.ts +1 -0
  13. package/dist/browser-tests/file-upload/FileUploadHarness.d.ts +4 -0
  14. package/dist/browser-tests/file-upload/file-upload.spec.d.ts +1 -0
  15. package/dist/browser-tests/file-upload-container/FileUploadContainerHarness.d.ts +4 -0
  16. package/dist/browser-tests/file-upload-container/file-upload-container.spec.d.ts +1 -0
  17. package/dist/browser-tests/input-upload/InputUploadHarness.d.ts +9 -0
  18. package/dist/browser-tests/input-upload/input-upload.spec.d.ts +1 -0
  19. package/dist/browser-tests/modal/ModalHarness.d.ts +5 -0
  20. package/dist/browser-tests/modal/modal.spec.d.ts +1 -0
  21. package/dist/browser-tests/number-input/NumberInputHarness.d.ts +10 -0
  22. package/dist/browser-tests/number-input/number-input.spec.d.ts +1 -0
  23. package/dist/browser-tests/number-range-input/NumberRangeInputHarness.d.ts +10 -0
  24. package/dist/browser-tests/number-range-input/number-range-input.spec.d.ts +1 -0
  25. package/dist/browser-tests/password-input/PasswordInputHarness.d.ts +6 -0
  26. package/dist/browser-tests/password-input/password-input.spec.d.ts +1 -0
  27. package/dist/browser-tests/radio-group/RadioGroupHarness.d.ts +15 -0
  28. package/dist/browser-tests/radio-group/radio-group.spec.d.ts +1 -0
  29. package/dist/browser-tests/selection/SelectionHarnesses.d.ts +61 -0
  30. package/dist/browser-tests/selection/autocomplete.spec.d.ts +1 -0
  31. package/dist/browser-tests/selection/interactions.d.ts +2 -0
  32. package/dist/browser-tests/selection/query-autocomplete.spec.d.ts +1 -0
  33. package/dist/browser-tests/selection/query-select.spec.d.ts +1 -0
  34. package/dist/browser-tests/selection/select.spec.d.ts +1 -0
  35. package/dist/browser-tests/slider/SliderHarness.d.ts +11 -0
  36. package/dist/browser-tests/slider/slider.spec.d.ts +1 -0
  37. package/dist/browser-tests/text-area/TextAreaHarness.d.ts +10 -0
  38. package/dist/browser-tests/text-area/text-area.spec.d.ts +1 -0
  39. package/dist/browser-tests/text-input/TextInputHarness.d.ts +10 -0
  40. package/dist/browser-tests/text-input/text-input.spec.d.ts +1 -0
  41. package/dist/browser-tests/toggle/ToggleHarness.d.ts +10 -0
  42. package/dist/browser-tests/toggle/toggle.spec.d.ts +1 -0
  43. package/dist/browser-tests/utils/blur.d.ts +22 -0
  44. package/dist/browser-tests/utils/events.d.ts +4 -0
  45. package/dist/browser-tests/utils/input.d.ts +10 -0
  46. package/dist/components/Breadcrumbs/Breadcrumbs.js +206 -55
  47. package/dist/components/buttons/Button/button.cva.d.ts +1 -1
  48. package/dist/components/buttons/Button/button.cva.js +4 -4
  49. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
  50. package/dist/components/buttons/PillButton/pillButton.cva.js +4 -4
  51. package/dist/components/buttons/shared/ButtonContent.js +80 -22
  52. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  53. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +222 -74
  54. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +182 -56
  55. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +128 -41
  56. package/dist/components/inputs/DateTime/shared/Calendar.js +339 -139
  57. package/dist/components/inputs/DateTime/shared/CalendarCell.js +308 -114
  58. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -35
  59. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +229 -95
  60. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +296 -115
  61. package/dist/components/inputs/DateTime/shared/DateField.js +306 -135
  62. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +338 -140
  63. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  64. package/dist/components/inputs/File/FileUpload.js +1 -1
  65. package/dist/components/inputs/File/InputUpload.js +261 -65
  66. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +180 -48
  67. package/dist/components/inputs/File/shared/FileUploadContentError.js +265 -95
  68. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +261 -99
  69. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +234 -56
  70. package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
  71. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +313 -75
  72. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +83 -23
  73. package/dist/components/inputs/Selection/Select/QuerySelect.js +96 -30
  74. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  75. package/dist/components/inputs/Selection/shared/useSelectItems.js +108 -48
  76. package/dist/components/inputs/Skeleton/InputFrame.js +550 -177
  77. package/dist/components/inputs/TextEditor/TextEditor.js +389 -87
  78. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  79. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  80. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  81. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  82. package/dist/components/overlays/BottomSheet/BottomSheet.js +1 -1
  83. package/dist/components/overlays/Modal/Modal.d.ts +3 -2
  84. package/dist/components/overlays/Modal/Modal.js +3 -1
  85. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +110 -29
  86. package/dist/components/shared/pagination/Pagination.js +108 -22
  87. package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
  88. package/dist/components/status/Alert/Alert.js +97 -30
  89. package/dist/components/table/InfiniteTable.js +67 -16
  90. package/dist/components/text/Typography/Typography.js +23 -8
  91. package/dist/config/confirmation.context.js +1 -1
  92. package/dist/config/theme.context.js +98 -45
  93. package/dist/config/uiConfig.context.js +39 -8
  94. package/dist/hooks/useDebounceCallback.js +51 -17
  95. package/dist/hooks/useFormAutosave.js +120 -33
  96. package/dist/hooks/useLongPressRepeat.js +55 -20
  97. package/dist/vitest.setup.browser.d.ts +6 -0
  98. package/package.json +1 -1
@@ -28,99 +28,337 @@ var normalizeRangeValue = (value, minValue, maxValue) => {
28
28
  };
29
29
  };
30
30
  var NumberRangeInputBase = (props) => {
31
+ const $ = c(114);
31
32
  const ui = UIConfig.useConfig();
32
33
  const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
33
34
  const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
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;
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;
35
154
  const isClearable = isClearableProps ?? ui.input.isClearable;
36
155
  const as = asProp ?? ui.input.as;
37
156
  const variant = variantProps ?? ui.input.variant;
38
157
  const size = sizeProps ?? ui.input.size;
39
158
  const hideLabel = hideLabelProps ?? ui.input.hideLabel;
40
- const rangeValue = normalizeRangeValue(value, minValue, maxValue);
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;
41
168
  const isEmpty = rangeValue.min === null && rangeValue.max === null;
42
169
  const rangeError = rangeValue.min !== null && rangeValue.max !== null && rangeValue.min > rangeValue.max ? invalidRangeError : void 0;
43
170
  const effectiveError = error || rangeError;
44
- const { hoverProps, isHovered } = useHover({ isDisabled });
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);
45
178
  const { isFocusVisible } = useFocusVisible();
46
179
  const [isFocused, setIsFocused] = useState(false);
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
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
75
201
  };
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({
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: "" } });
263
+ };
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({
93
272
  variant,
94
273
  as
95
- }),
96
- inputSizeClassName: inputSizeCva({
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({
97
283
  size,
98
284
  as
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
- });
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;
124
362
  };
125
363
  var NumberRangeInputInner = (t0) => {
126
364
  const $ = c(5);
@@ -134,32 +134,92 @@ 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({ renderStaticInput, ...props }) {
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
+ }
138
150
  if ("formControl" in props && props.formControl) {
139
- const { ignoreInputValueFiltering = true, formControl, ref, ...innerProps } = props;
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;
140
169
  const controlWithOptions = formControl.control;
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
- })
157
- });
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;
158
211
  }
159
- return /* @__PURE__ */ jsx(AutocompleteInner, {
160
- ...props,
161
- renderStaticInput
162
- });
212
+ let t1;
213
+ if ($[20] !== props || $[21] !== renderStaticInput) {
214
+ t1 = /* @__PURE__ */ jsx(AutocompleteInner, {
215
+ ...props,
216
+ renderStaticInput
217
+ });
218
+ $[20] = props;
219
+ $[21] = renderStaticInput;
220
+ $[22] = t1;
221
+ } else t1 = $[22];
222
+ return t1;
163
223
  }
164
224
  //#endregion
165
225
  export { Autocomplete };
@@ -8,7 +8,10 @@ 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 = ({ query, queryParams, queryOptions, queryMap, resolveSelectedItemsWithIds, isQueryEnabledInitially = false, ...props }) => {
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;
12
15
  const ui = UIConfig.useConfig();
13
16
  const [search, setSearch] = useState("");
14
17
  const isSearchable = props.isSearchable ?? ui.select.isSearchable;
@@ -21,37 +24,100 @@ var LoadedQuerySelectContent = ({ query, queryParams, queryOptions, queryMap, re
21
24
  const shouldEnableInitialQuery = selectedIdsToResolve.count > 0;
22
25
  const isInitialQueryDisabled = props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled;
23
26
  const shouldDisableInitialQuery = !isQueryEnabledInitially && !shouldEnableInitialQuery && (selectedIdsToResolve.isResolvedByInitialSelection || isInitialQueryDisabled);
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 && {
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 && {
51
88
  isClientSearchDisabled: true,
52
89
  onSearchChange: handleSearchChange
53
- }
54
- });
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;
55
121
  };
56
122
  var QuerySelectContent = (props) => {
57
123
  const $ = c(9);