@povio/ui 3.4.0-rc.1 → 3.4.0-rc.11

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 (78) hide show
  1. package/dist/components/inputs/Checkbox/Checkbox.d.ts +2 -1
  2. package/dist/components/inputs/Checkbox/Checkbox.js +100 -93
  3. package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +2 -1
  4. package/dist/components/inputs/Checkbox/CheckboxGroup.js +113 -109
  5. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +2 -1
  6. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +21 -14
  7. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +2 -1
  8. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +22 -14
  9. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +2 -1
  10. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +21 -14
  11. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +2 -1
  12. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +294 -275
  13. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
  14. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +10 -1
  15. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
  16. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +46 -43
  17. package/dist/components/inputs/File/FileUpload.d.ts +1 -1
  18. package/dist/components/inputs/File/FileUpload.js +17 -17
  19. package/dist/components/inputs/File/InputUpload.d.ts +1 -1
  20. package/dist/components/inputs/File/InputUpload.js +17 -17
  21. package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
  22. package/dist/components/inputs/File/inputUpload.types.d.ts +1 -1
  23. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +1 -1
  24. package/dist/components/inputs/Input/NumberInput/NumberInput.js +19 -19
  25. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +1 -1
  26. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +18 -18
  27. package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +1 -1
  28. package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -1
  29. package/dist/components/inputs/Input/TextArea/TextArea.js +18 -18
  30. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -2
  31. package/dist/components/inputs/Input/TextInput/TextInput.js +38 -36
  32. package/dist/components/inputs/Inputs/Form.d.ts +4 -4
  33. package/dist/components/inputs/Inputs/InputItem.d.ts +22 -22
  34. package/dist/components/inputs/Inputs/InputItem.js +36 -35
  35. package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
  36. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +2 -1
  37. package/dist/components/inputs/RadioGroup/RadioGroup.js +111 -107
  38. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +1 -1
  39. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +13 -13
  40. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
  41. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +19 -19
  42. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -1
  43. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -1
  44. package/dist/components/inputs/Selection/Select/QuerySelect.js +19 -19
  45. package/dist/components/inputs/Selection/Select/Select.d.ts +1 -1
  46. package/dist/components/inputs/Selection/Select/Select.js +19 -19
  47. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -0
  48. package/dist/components/inputs/Selection/shared/SelectBase.js +37 -34
  49. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
  50. package/dist/components/inputs/Selection/shared/select.context.js +8 -4
  51. package/dist/components/inputs/Selection/shared/select.types.d.ts +1 -1
  52. package/dist/components/inputs/Slider/Slider.d.ts +1 -1
  53. package/dist/components/inputs/Slider/Slider.js +18 -18
  54. package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -1
  55. package/dist/components/inputs/TextEditor/TextEditor.js +18 -18
  56. package/dist/components/inputs/Toggle/Toggle.d.ts +2 -1
  57. package/dist/components/inputs/Toggle/Toggle.js +63 -59
  58. package/dist/components/inputs/shared/form.types.d.ts +8 -9
  59. package/dist/components/segment/Segment.d.ts +1 -1
  60. package/dist/components/segment/Segment.js +17 -17
  61. package/dist/components/segment/segment.types.d.ts +1 -1
  62. package/dist/config/uiConfig.context.d.ts +5 -5
  63. package/dist/config/uiConfig.context.js +12 -3
  64. package/dist/helpers/dynamicColumns.d.ts +1 -1
  65. package/dist/helpers/dynamicInputs.d.ts +7 -7
  66. package/dist/hooks/useAutosave.d.ts +4 -4
  67. package/dist/hooks/useAutosave.js +49 -64
  68. package/dist/hooks/useAutosave.spec.d.ts +1 -0
  69. package/dist/hooks/useForm.d.ts +15 -39
  70. package/dist/hooks/useForm.js +43 -96
  71. package/dist/hooks/useFormAutosave.d.ts +9 -8
  72. package/dist/hooks/useFormAutosave.js +9 -23
  73. package/dist/index.d.ts +2 -2
  74. package/dist/index.js +3 -3
  75. package/package.json +3 -2
  76. package/dist/components/inputs/shared/form.binding.d.ts +0 -27
  77. package/dist/components/inputs/shared/form.binding.js +0 -57
  78. package/dist/components/inputs/shared/form.types.js +0 -8
@@ -1,6 +1,5 @@
1
1
  import { UIOverrides } from "../../../config/uiOverrides.context.js";
2
2
  import { UIConfig } from "../../../config/uiConfig.context.js";
3
- import { FieldController } from "../shared/form.binding.js";
4
3
  import { CheckContent } from "../shared/CheckContent.js";
5
4
  import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
6
5
  import { FormField } from "../FormField/FormField.js";
@@ -12,9 +11,10 @@ import { clsx } from "clsx";
12
11
  import { Radio, RadioGroup } from "react-aria-components";
13
12
  import { useLabel } from "react-aria";
14
13
  import { mergeRefs } from "@react-aria/utils";
14
+ import { Controller } from "react-hook-form";
15
15
  //#region src/components/inputs/RadioGroup/RadioGroup.tsx
16
16
  var RadioGroupBase = (props) => {
17
- const $ = c(89);
17
+ const $ = c(91);
18
18
  const ui = UIConfig.useConfig();
19
19
  const radioCva = UIOverrides.useCva("radio.cva", radioDefinition);
20
20
  const radioTypographyMap = UIOverrides.useMapper("radio.typography", radioTypography);
@@ -23,11 +23,12 @@ var RadioGroupBase = (props) => {
23
23
  const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
24
24
  const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
25
25
  const radioContentClassNameMap = UIOverrides.useMapper("radio.contentClassName", radioContentClassName);
26
- const { ref, label, tooltipText, helperText, isDirty, isRequired, rightContent, isDisabled, headerClassName, errorClassName, labelClassName, inputClassName, isHeaderHidden, error, className, options, value, defaultValue, onChange, onBlur, as: asProp, size: sizeProp, variant: variantProp, hideLabel: hideLabelProp, ...rest } = props;
26
+ const { ref, label, tooltipText, helperText, isDirty, isRequired, rightContent, isDisabled, headerClassName, errorClassName, labelClassName, inputClassName, isHeaderHidden, error, className, options, value, defaultValue, onChange, onBlur, fireBlurOnChange: fireBlurOnChangeProp, as: asProp, size: sizeProp, variant: variantProp, hideLabel: hideLabelProp, ...rest } = props;
27
27
  const as = asProp ?? ui.input.as;
28
28
  const size = sizeProp ?? ui.input.size;
29
29
  const variant = variantProp ?? ui.radioGroup.variant;
30
30
  const hideLabel = hideLabelProp ?? ui.radioGroup.hideLabel;
31
+ const fireBlurOnChange = fireBlurOnChangeProp ?? ui.radioGroup.fireBlurOnChange;
31
32
  const radioClassName = radioCva({
32
33
  variant,
33
34
  ...rest
@@ -108,13 +109,16 @@ var RadioGroupBase = (props) => {
108
109
  const selectedValue = value ?? defaultValue;
109
110
  const shouldRenderInputFrame = as !== "default";
110
111
  let t5;
111
- if ($[25] !== onChange) {
112
+ if ($[25] !== fireBlurOnChange || $[26] !== onBlur || $[27] !== onChange) {
112
113
  t5 = (nextValue) => {
113
114
  onChange?.(nextValue);
115
+ if (fireBlurOnChange) onBlur?.({});
114
116
  };
115
- $[25] = onChange;
116
- $[26] = t5;
117
- } else t5 = $[26];
117
+ $[25] = fireBlurOnChange;
118
+ $[26] = onBlur;
119
+ $[27] = onChange;
120
+ $[28] = t5;
121
+ } else t5 = $[28];
118
122
  const handleChange = t5;
119
123
  const T0 = RadioGroup;
120
124
  const t6 = !!error;
@@ -124,26 +128,26 @@ var RadioGroupBase = (props) => {
124
128
  const T1 = FormField;
125
129
  const t10 = as === "inline" && "h-full";
126
130
  let t11;
127
- if ($[27] !== className || $[28] !== t10) {
131
+ if ($[29] !== className || $[30] !== t10) {
128
132
  t11 = clsx("w-full", t10, className);
129
- $[27] = className;
130
- $[28] = t10;
131
- $[29] = t11;
132
- } else t11 = $[29];
133
+ $[29] = className;
134
+ $[30] = t10;
135
+ $[31] = t11;
136
+ } else t11 = $[31];
133
137
  const t12 = as === "inline" ? -1 : void 0;
134
138
  let t13;
135
- if ($[30] !== as || $[31] !== inputBaseCva || $[32] !== inputClassName || $[33] !== shouldRenderInputFrame || $[34] !== ui) {
139
+ if ($[32] !== as || $[33] !== inputBaseCva || $[34] !== inputClassName || $[35] !== shouldRenderInputFrame || $[36] !== ui) {
136
140
  t13 = clsx("group/radio-group-content relative", shouldRenderInputFrame && inputBaseCva({
137
141
  variant: ui.input.variant,
138
142
  as
139
143
  }), inputClassName);
140
- $[30] = as;
141
- $[31] = inputBaseCva;
142
- $[32] = inputClassName;
143
- $[33] = shouldRenderInputFrame;
144
- $[34] = ui;
145
- $[35] = t13;
146
- } else t13 = $[35];
144
+ $[32] = as;
145
+ $[33] = inputBaseCva;
146
+ $[34] = inputClassName;
147
+ $[35] = shouldRenderInputFrame;
148
+ $[36] = ui;
149
+ $[37] = t13;
150
+ } else t13 = $[37];
147
151
  const t14 = "";
148
152
  const t15 = isDisabled || void 0;
149
153
  const t16 = isDisabled || void 0;
@@ -162,17 +166,17 @@ var RadioGroupBase = (props) => {
162
166
  const t21 = isDirty || void 0;
163
167
  const t22 = isRequired || void 0;
164
168
  let t23;
165
- if ($[36] !== as || $[37] !== headerProps || $[38] !== size) {
169
+ if ($[38] !== as || $[39] !== headerProps || $[40] !== size) {
166
170
  t23 = as && ["filter", "floating"].includes(as) && /* @__PURE__ */ jsx(FormFieldLabel, {
167
171
  as,
168
172
  size,
169
173
  ...headerProps
170
174
  });
171
- $[36] = as;
172
- $[37] = headerProps;
173
- $[38] = size;
174
- $[39] = t23;
175
- } else t23 = $[39];
175
+ $[38] = as;
176
+ $[39] = headerProps;
177
+ $[40] = size;
178
+ $[41] = t23;
179
+ } else t23 = $[41];
176
180
  const t24 = radioContentRowCva({
177
181
  variant,
178
182
  as,
@@ -180,9 +184,9 @@ var RadioGroupBase = (props) => {
180
184
  ...rest
181
185
  });
182
186
  let t25;
183
- if ($[40] !== labelClassName || $[41] !== options || $[42] !== radioClassName || $[43] !== radioContentClassNameValue || $[44] !== radioTypographyProps) {
187
+ if ($[42] !== labelClassName || $[43] !== options || $[44] !== radioClassName || $[45] !== radioContentClassNameValue || $[46] !== radioTypographyProps) {
184
188
  let t26;
185
- if ($[46] !== labelClassName || $[47] !== radioClassName || $[48] !== radioContentClassNameValue || $[49] !== radioTypographyProps) {
189
+ if ($[48] !== labelClassName || $[49] !== radioClassName || $[50] !== radioContentClassNameValue || $[51] !== radioTypographyProps) {
186
190
  t26 = (option) => /* @__PURE__ */ jsxs(Radio, {
187
191
  value: option.value,
188
192
  className: clsx("relative", radioIndicatorClass),
@@ -193,47 +197,47 @@ var RadioGroupBase = (props) => {
193
197
  children: option.label
194
198
  })]
195
199
  }, option.value);
196
- $[46] = labelClassName;
197
- $[47] = radioClassName;
198
- $[48] = radioContentClassNameValue;
199
- $[49] = radioTypographyProps;
200
- $[50] = t26;
201
- } else t26 = $[50];
200
+ $[48] = labelClassName;
201
+ $[49] = radioClassName;
202
+ $[50] = radioContentClassNameValue;
203
+ $[51] = radioTypographyProps;
204
+ $[52] = t26;
205
+ } else t26 = $[52];
202
206
  t25 = options.map(t26);
203
- $[40] = labelClassName;
204
- $[41] = options;
205
- $[42] = radioClassName;
206
- $[43] = radioContentClassNameValue;
207
- $[44] = radioTypographyProps;
208
- $[45] = t25;
209
- } else t25 = $[45];
207
+ $[42] = labelClassName;
208
+ $[43] = options;
209
+ $[44] = radioClassName;
210
+ $[45] = radioContentClassNameValue;
211
+ $[46] = radioTypographyProps;
212
+ $[47] = t25;
213
+ } else t25 = $[47];
210
214
  let t26;
211
- if ($[51] !== t24 || $[52] !== t25) {
215
+ if ($[53] !== t24 || $[54] !== t25) {
212
216
  t26 = /* @__PURE__ */ jsx("div", {
213
217
  className: t24,
214
218
  children: t25
215
219
  });
216
- $[51] = t24;
217
- $[52] = t25;
218
- $[53] = t26;
219
- } else t26 = $[53];
220
+ $[53] = t24;
221
+ $[54] = t25;
222
+ $[55] = t26;
223
+ } else t26 = $[55];
220
224
  let t27;
221
- if ($[54] !== t20 || $[55] !== t21 || $[56] !== t22 || $[57] !== t23 || $[58] !== t26) {
225
+ if ($[56] !== t20 || $[57] !== t21 || $[58] !== t22 || $[59] !== t23 || $[60] !== t26) {
222
226
  t27 = /* @__PURE__ */ jsxs("div", {
223
227
  className: t20,
224
228
  "data-is-dirty": t21,
225
229
  "data-is-required": t22,
226
230
  children: [t23, t26]
227
231
  });
228
- $[54] = t20;
229
- $[55] = t21;
230
- $[56] = t22;
231
- $[57] = t23;
232
- $[58] = t26;
233
- $[59] = t27;
234
- } else t27 = $[59];
232
+ $[56] = t20;
233
+ $[57] = t21;
234
+ $[58] = t22;
235
+ $[59] = t23;
236
+ $[60] = t26;
237
+ $[61] = t27;
238
+ } else t27 = $[61];
235
239
  let t28;
236
- if ($[60] !== t13 || $[61] !== t15 || $[62] !== t16 || $[63] !== t17 || $[64] !== t18 || $[65] !== t27) {
240
+ if ($[62] !== t13 || $[63] !== t15 || $[64] !== t16 || $[65] !== t17 || $[66] !== t18 || $[67] !== t27) {
237
241
  t28 = /* @__PURE__ */ jsx("div", {
238
242
  className: t13,
239
243
  "data-rac": t14,
@@ -244,16 +248,16 @@ var RadioGroupBase = (props) => {
244
248
  "data-radio-group-content": t19,
245
249
  children: t27
246
250
  });
247
- $[60] = t13;
248
- $[61] = t15;
249
- $[62] = t16;
250
- $[63] = t17;
251
- $[64] = t18;
252
- $[65] = t27;
253
- $[66] = t28;
254
- } else t28 = $[66];
251
+ $[62] = t13;
252
+ $[63] = t15;
253
+ $[64] = t16;
254
+ $[65] = t17;
255
+ $[66] = t18;
256
+ $[67] = t27;
257
+ $[68] = t28;
258
+ } else t28 = $[68];
255
259
  let t29;
256
- if ($[67] !== T1 || $[68] !== as || $[69] !== formFieldProps || $[70] !== labelProps || $[71] !== t11 || $[72] !== t12 || $[73] !== t28) {
260
+ if ($[69] !== T1 || $[70] !== as || $[71] !== formFieldProps || $[72] !== labelProps || $[73] !== t11 || $[74] !== t12 || $[75] !== t28) {
257
261
  t29 = /* @__PURE__ */ jsx(T1, {
258
262
  ...formFieldProps,
259
263
  as,
@@ -262,17 +266,17 @@ var RadioGroupBase = (props) => {
262
266
  tabIndex: t12,
263
267
  children: t28
264
268
  });
265
- $[67] = T1;
266
- $[68] = as;
267
- $[69] = formFieldProps;
268
- $[70] = labelProps;
269
- $[71] = t11;
270
- $[72] = t12;
271
- $[73] = t28;
272
- $[74] = t29;
273
- } else t29 = $[74];
269
+ $[69] = T1;
270
+ $[70] = as;
271
+ $[71] = formFieldProps;
272
+ $[72] = labelProps;
273
+ $[73] = t11;
274
+ $[74] = t12;
275
+ $[75] = t28;
276
+ $[76] = t29;
277
+ } else t29 = $[76];
274
278
  let t30;
275
- if ($[75] !== T0 || $[76] !== defaultValue || $[77] !== fieldProps || $[78] !== handleChange || $[79] !== isDisabled || $[80] !== onBlur || $[81] !== ref || $[82] !== rest || $[83] !== t29 || $[84] !== t6 || $[85] !== t7 || $[86] !== t8 || $[87] !== value) {
279
+ if ($[77] !== T0 || $[78] !== defaultValue || $[79] !== fieldProps || $[80] !== handleChange || $[81] !== isDisabled || $[82] !== onBlur || $[83] !== ref || $[84] !== rest || $[85] !== t29 || $[86] !== t6 || $[87] !== t7 || $[88] !== t8 || $[89] !== value) {
276
280
  t30 = /* @__PURE__ */ jsx(T0, {
277
281
  ...rest,
278
282
  ...fieldProps,
@@ -288,54 +292,54 @@ var RadioGroupBase = (props) => {
288
292
  className: t9,
289
293
  children: t29
290
294
  });
291
- $[75] = T0;
292
- $[76] = defaultValue;
293
- $[77] = fieldProps;
294
- $[78] = handleChange;
295
- $[79] = isDisabled;
296
- $[80] = onBlur;
297
- $[81] = ref;
298
- $[82] = rest;
299
- $[83] = t29;
300
- $[84] = t6;
301
- $[85] = t7;
302
- $[86] = t8;
303
- $[87] = value;
304
- $[88] = t30;
305
- } else t30 = $[88];
295
+ $[77] = T0;
296
+ $[78] = defaultValue;
297
+ $[79] = fieldProps;
298
+ $[80] = handleChange;
299
+ $[81] = isDisabled;
300
+ $[82] = onBlur;
301
+ $[83] = ref;
302
+ $[84] = rest;
303
+ $[85] = t29;
304
+ $[86] = t6;
305
+ $[87] = t7;
306
+ $[88] = t8;
307
+ $[89] = value;
308
+ $[90] = t30;
309
+ } else t30 = $[90];
306
310
  return t30;
307
311
  };
308
312
  var RadioGroup$1 = (props) => {
309
313
  const $ = c(15);
310
- if ("field" in props && props.field) {
311
- let field;
314
+ if ("formControl" in props && props.formControl) {
315
+ let formControl;
312
316
  let innerProps;
313
317
  let ref;
314
318
  if ($[0] !== props) {
315
- ({field, ref, ...innerProps} = props);
319
+ ({formControl, ref, ...innerProps} = props);
316
320
  $[0] = props;
317
- $[1] = field;
321
+ $[1] = formControl;
318
322
  $[2] = innerProps;
319
323
  $[3] = ref;
320
324
  } else {
321
- field = $[1];
325
+ formControl = $[1];
322
326
  innerProps = $[2];
323
327
  ref = $[3];
324
328
  }
325
329
  let t0;
326
330
  if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
327
331
  t0 = (t1) => {
328
- const { field: field_0, fieldState: t2 } = t1;
332
+ const { field, fieldState: t2 } = t1;
329
333
  const { error, isDirty } = t2;
330
334
  return /* @__PURE__ */ jsx(RadioGroupBase, {
331
335
  ...innerProps,
332
- ref: mergeRefs(ref, field_0.ref),
333
- value: field_0.value,
334
- onChange: field_0.onChange,
335
- onBlur: field_0.onBlur,
336
- name: field_0.name,
336
+ ref: mergeRefs(ref, field.ref),
337
+ value: field.value,
338
+ onChange: field.onChange,
339
+ onBlur: field.onBlur,
340
+ name: field.name,
337
341
  isDirty,
338
- isDisabled: field_0.disabled || props.isDisabled,
342
+ isDisabled: field.disabled || props.isDisabled,
339
343
  error: props.error ?? error?.message
340
344
  });
341
345
  };
@@ -346,14 +350,14 @@ var RadioGroup$1 = (props) => {
346
350
  $[8] = t0;
347
351
  } else t0 = $[8];
348
352
  let t1;
349
- if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
350
- t1 = /* @__PURE__ */ jsx(FieldController, {
351
- control: field.form,
352
- name: field.name,
353
+ if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
354
+ t1 = /* @__PURE__ */ jsx(Controller, {
355
+ control: formControl.control,
356
+ name: formControl.name,
353
357
  render: t0
354
358
  });
355
- $[9] = field.form;
356
- $[10] = field.name;
359
+ $[9] = formControl.control;
360
+ $[10] = formControl.name;
357
361
  $[11] = t0;
358
362
  $[12] = t1;
359
363
  } else t1 = $[12];
@@ -1,6 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { Key } from 'react-aria-components';
3
- import { FieldValues } from '../../shared/form.binding';
3
+ import { FieldValues } from 'react-hook-form';
4
4
  import { SelectBaseProps } from '../shared/SelectBase';
5
5
  import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps } from '../shared/select.types';
6
6
  import { OmitDiscriminatedUnion } from '../../../../types/common';
@@ -1,6 +1,5 @@
1
1
  import { UIOverrides } from "../../../../config/uiOverrides.context.js";
2
2
  import { UIConfig } from "../../../../config/uiConfig.context.js";
3
- import { FieldController } from "../../shared/form.binding.js";
4
3
  import { InputFrame } from "../../Skeleton/InputFrame.js";
5
4
  import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
6
5
  import { selectInputTagsContentWrapperDefinition } from "../shared/selectInput.cva.js";
@@ -12,6 +11,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
11
  import { clsx } from "clsx";
13
12
  import { useRef, useState } from "react";
14
13
  import { mergeRefs } from "@react-aria/utils";
14
+ import { Controller } from "react-hook-form";
15
15
  //#region src/components/inputs/Selection/Autocomplete/Autocomplete.tsx
16
16
  function AutocompleteInner(t0) {
17
17
  const $ = c(8);
@@ -135,20 +135,20 @@ function _temp(root) {
135
135
  return root.querySelector("input, [data-type='select-trigger'], button, [tabindex]");
136
136
  }
137
137
  function Autocomplete({ renderStaticInput, ...props }) {
138
- if ("field" in props && props.field) {
139
- const { ignoreInputValueFiltering = true, field, ref, ...innerProps } = props;
140
- const controlWithOptions = field.form;
141
- return /* @__PURE__ */ jsx(FieldController, {
142
- control: field.form,
143
- name: field.name,
144
- render: ({ field: field_0, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(AutocompleteInner, {
138
+ if ("formControl" in props && props.formControl) {
139
+ const { ignoreInputValueFiltering = true, formControl, ref, ...innerProps } = props;
140
+ 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
145
  ...innerProps,
146
- ref: mergeRefs(ref, field_0.ref),
147
- value: field_0.value,
148
- onChange: field_0.onChange,
149
- onBlur: field_0.onBlur,
146
+ ref: mergeRefs(ref, field.ref),
147
+ value: field.value,
148
+ onChange: field.onChange,
149
+ onBlur: field.onBlur,
150
150
  isDirty,
151
- isDisabled: field_0.disabled || props.isDisabled,
151
+ isDisabled: field.disabled || props.isDisabled,
152
152
  isFormControlDisabled: !!controlWithOptions._options?.disabled,
153
153
  error: props.error ?? error?.message,
154
154
  ignoreInputValueFiltering,
@@ -1,4 +1,4 @@
1
- import { FieldValues } from '../../shared/form.binding';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { QueryAutocompleteProps, QueryFn } from './queryAutocomplete.types';
3
3
  import { SelectItem } from '../shared/select.types';
4
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;
@@ -1,5 +1,4 @@
1
1
  import { UIConfig } from "../../../../config/uiConfig.context.js";
2
- import { FieldController } from "../../shared/form.binding.js";
3
2
  import { Autocomplete } from "./Autocomplete.js";
4
3
  import { getQueryItems, getSelectionIdsToResolve } from "../shared/querySelect.utils.js";
5
4
  import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
@@ -7,6 +6,7 @@ import { c } from "react/compiler-runtime";
7
6
  import { jsx } from "react/jsx-runtime";
8
7
  import { useState } from "react";
9
8
  import { mergeRefs } from "@react-aria/utils";
9
+ import { Controller } from "react-hook-form";
10
10
  //#region src/components/inputs/Selection/Autocomplete/QueryAutocomplete.tsx
11
11
  var LoadedQueryAutocompleteContent = ({ query, queryParams, queryOptions, queryMap, resolveSelectedItemsWithIds, isQueryEnabledInitially = false, leadingContent, ...props }) => {
12
12
  "use no memo";
@@ -111,35 +111,35 @@ var QueryAutocompleteContent = (props) => {
111
111
  };
112
112
  var QueryAutocomplete = (props) => {
113
113
  const $ = c(16);
114
- if ("field" in props && props.field) {
115
- let field;
114
+ if ("formControl" in props && props.formControl) {
115
+ let formControl;
116
116
  let innerProps;
117
117
  let ref;
118
118
  if ($[0] !== props) {
119
- ({field, ref, ...innerProps} = props);
119
+ ({formControl, ref, ...innerProps} = props);
120
120
  $[0] = props;
121
- $[1] = field;
121
+ $[1] = formControl;
122
122
  $[2] = innerProps;
123
123
  $[3] = ref;
124
124
  } else {
125
- field = $[1];
125
+ formControl = $[1];
126
126
  innerProps = $[2];
127
127
  ref = $[3];
128
128
  }
129
- const controlWithOptions = field.form;
129
+ const controlWithOptions = formControl.control;
130
130
  let t0;
131
131
  if ($[4] !== controlWithOptions || $[5] !== innerProps || $[6] !== props.error || $[7] !== props.isDisabled || $[8] !== ref) {
132
132
  t0 = (t1) => {
133
- const { field: field_0, fieldState: t2 } = t1;
133
+ const { field, fieldState: t2 } = t1;
134
134
  const { error, isDirty } = t2;
135
135
  return /* @__PURE__ */ jsx(QueryAutocompleteContent, {
136
136
  ...innerProps,
137
- ref: mergeRefs(ref, field_0.ref),
138
- value: field_0.value,
139
- onChange: field_0.onChange,
140
- onBlur: field_0.onBlur,
137
+ ref: mergeRefs(ref, field.ref),
138
+ value: field.value,
139
+ onChange: field.onChange,
140
+ onBlur: field.onBlur,
141
141
  isDirty,
142
- isDisabled: field_0.disabled || props.isDisabled || !!controlWithOptions._options?.disabled,
142
+ isDisabled: field.disabled || props.isDisabled || !!controlWithOptions._options?.disabled,
143
143
  error: props.error ?? error?.message
144
144
  });
145
145
  };
@@ -151,14 +151,14 @@ var QueryAutocomplete = (props) => {
151
151
  $[9] = t0;
152
152
  } else t0 = $[9];
153
153
  let t1;
154
- if ($[10] !== field.form || $[11] !== field.name || $[12] !== t0) {
155
- t1 = /* @__PURE__ */ jsx(FieldController, {
156
- control: field.form,
157
- name: field.name,
154
+ if ($[10] !== formControl.control || $[11] !== formControl.name || $[12] !== t0) {
155
+ t1 = /* @__PURE__ */ jsx(Controller, {
156
+ control: formControl.control,
157
+ name: formControl.name,
158
158
  render: t0
159
159
  });
160
- $[10] = field.form;
161
- $[11] = field.name;
160
+ $[10] = formControl.control;
161
+ $[11] = formControl.name;
162
162
  $[12] = t0;
163
163
  $[13] = t1;
164
164
  } else t1 = $[13];
@@ -1,6 +1,6 @@
1
1
  import { InfiniteData, UseInfiniteQueryResult, UseQueryResult } from '@tanstack/react-query';
2
2
  import { Key } from 'react-aria-components';
3
- import { FieldValues } from '../../shared/form.binding';
3
+ import { FieldValues } from 'react-hook-form';
4
4
  import { AutocompleteProps } from './Autocomplete';
5
5
  import { GroupedSelectControlProps, GroupedSelectProps, SelectItem } from '../shared/select.types';
6
6
  import { OmitDiscriminatedUnion } from '../../../../types/common';
@@ -1,5 +1,5 @@
1
1
  import { Key } from 'react-aria-components';
2
- import { FieldValues } from '../../shared/form.binding';
2
+ import { FieldValues } from 'react-hook-form';
3
3
  import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps, SelectItem } from '../shared/select.types';
4
4
  import { SelectProps } from './Select';
5
5
  import { QueryDataType, QueryFn } from '../shared/querySelect.utils';
@@ -1,5 +1,4 @@
1
1
  import { UIConfig } from "../../../../config/uiConfig.context.js";
2
- import { FieldController } from "../../shared/form.binding.js";
3
2
  import { Select } from "./Select.js";
4
3
  import { getQueryItems, getSelectionIdsToResolve } from "../shared/querySelect.utils.js";
5
4
  import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
@@ -7,6 +6,7 @@ import { c } from "react/compiler-runtime";
7
6
  import { jsx } from "react/jsx-runtime";
8
7
  import { useState } from "react";
9
8
  import { mergeRefs } from "@react-aria/utils";
9
+ import { Controller } from "react-hook-form";
10
10
  //#region src/components/inputs/Selection/Select/QuerySelect.tsx
11
11
  var LoadedQuerySelectContent = ({ query, queryParams, queryOptions, queryMap, resolveSelectedItemsWithIds, isQueryEnabledInitially = false, ...props }) => {
12
12
  const ui = UIConfig.useConfig();
@@ -107,35 +107,35 @@ var QuerySelectContent = (props) => {
107
107
  };
108
108
  var QuerySelect = (props) => {
109
109
  const $ = c(16);
110
- if ("field" in props && props.field) {
111
- let field;
110
+ if ("formControl" in props && props.formControl) {
111
+ let formControl;
112
112
  let innerProps;
113
113
  let ref;
114
114
  if ($[0] !== props) {
115
- ({field, ref, ...innerProps} = props);
115
+ ({formControl, ref, ...innerProps} = props);
116
116
  $[0] = props;
117
- $[1] = field;
117
+ $[1] = formControl;
118
118
  $[2] = innerProps;
119
119
  $[3] = ref;
120
120
  } else {
121
- field = $[1];
121
+ formControl = $[1];
122
122
  innerProps = $[2];
123
123
  ref = $[3];
124
124
  }
125
- const controlWithOptions = field.form;
125
+ const controlWithOptions = formControl.control;
126
126
  let t0;
127
127
  if ($[4] !== controlWithOptions || $[5] !== innerProps || $[6] !== props.error || $[7] !== props.isDisabled || $[8] !== ref) {
128
128
  t0 = (t1) => {
129
- const { field: field_0, fieldState: t2 } = t1;
129
+ const { field, fieldState: t2 } = t1;
130
130
  const { error, isDirty } = t2;
131
131
  return /* @__PURE__ */ jsx(QuerySelectContent, {
132
132
  ...innerProps,
133
- ref: mergeRefs(ref, field_0.ref),
134
- value: field_0.value,
135
- onChange: field_0.onChange,
136
- onBlur: field_0.onBlur,
133
+ ref: mergeRefs(ref, field.ref),
134
+ value: field.value,
135
+ onChange: field.onChange,
136
+ onBlur: field.onBlur,
137
137
  isDirty,
138
- isDisabled: field_0.disabled || props.isDisabled || !!controlWithOptions._options?.disabled,
138
+ isDisabled: field.disabled || props.isDisabled || !!controlWithOptions._options?.disabled,
139
139
  error: props.error ?? error?.message
140
140
  });
141
141
  };
@@ -147,14 +147,14 @@ var QuerySelect = (props) => {
147
147
  $[9] = t0;
148
148
  } else t0 = $[9];
149
149
  let t1;
150
- if ($[10] !== field.form || $[11] !== field.name || $[12] !== t0) {
151
- t1 = /* @__PURE__ */ jsx(FieldController, {
152
- control: field.form,
153
- name: field.name,
150
+ if ($[10] !== formControl.control || $[11] !== formControl.name || $[12] !== t0) {
151
+ t1 = /* @__PURE__ */ jsx(Controller, {
152
+ control: formControl.control,
153
+ name: formControl.name,
154
154
  render: t0
155
155
  });
156
- $[10] = field.form;
157
- $[11] = field.name;
156
+ $[10] = formControl.control;
157
+ $[11] = formControl.name;
158
158
  $[12] = t0;
159
159
  $[13] = t1;
160
160
  } else t1 = $[13];
@@ -1,6 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { Key } from 'react-aria-components';
3
- import { FieldValues } from '../../shared/form.binding';
3
+ import { FieldValues } from 'react-hook-form';
4
4
  import { SelectBaseProps } from '../shared/SelectBase';
5
5
  import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps, SelectAsyncProps } from '../shared/select.types';
6
6
  import { OmitDiscriminatedUnion } from '../../../../types/common';