@povio/ui 3.3.0 → 3.4.0-rc.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 (78) hide show
  1. package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -2
  2. package/dist/components/inputs/Checkbox/Checkbox.js +93 -100
  3. package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +1 -2
  4. package/dist/components/inputs/Checkbox/CheckboxGroup.js +109 -113
  5. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -2
  6. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +14 -21
  7. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -2
  8. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +14 -22
  9. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -2
  10. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +14 -21
  11. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -2
  12. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +275 -294
  13. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +1 -2
  14. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +1 -10
  15. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
  16. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +43 -46
  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 +36 -38
  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 +35 -36
  35. package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
  36. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
  37. package/dist/components/inputs/RadioGroup/RadioGroup.js +107 -111
  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 +0 -1
  48. package/dist/components/inputs/Selection/shared/SelectBase.js +34 -37
  49. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
  50. package/dist/components/inputs/Selection/shared/select.context.js +4 -8
  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 +1 -2
  57. package/dist/components/inputs/Toggle/Toggle.js +59 -63
  58. package/dist/components/inputs/shared/form.binding.d.ts +27 -0
  59. package/dist/components/inputs/shared/form.binding.js +57 -0
  60. package/dist/components/inputs/shared/form.types.d.ts +9 -8
  61. package/dist/components/inputs/shared/form.types.js +8 -0
  62. package/dist/components/segment/Segment.d.ts +1 -1
  63. package/dist/components/segment/Segment.js +17 -17
  64. package/dist/components/segment/segment.types.d.ts +1 -1
  65. package/dist/config/uiConfig.context.d.ts +5 -5
  66. package/dist/config/uiConfig.context.js +3 -12
  67. package/dist/helpers/dynamicColumns.d.ts +1 -1
  68. package/dist/helpers/dynamicInputs.d.ts +7 -7
  69. package/dist/hooks/useAutosave.d.ts +4 -4
  70. package/dist/hooks/useAutosave.js +64 -49
  71. package/dist/hooks/useForm.d.ts +39 -15
  72. package/dist/hooks/useForm.js +96 -43
  73. package/dist/hooks/useFormAutosave.d.ts +8 -9
  74. package/dist/hooks/useFormAutosave.js +23 -9
  75. package/dist/index.d.ts +2 -2
  76. package/dist/index.js +3 -3
  77. package/package.json +2 -3
  78. package/dist/hooks/useAutosave.spec.d.ts +0 -1
@@ -1,5 +1,6 @@
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";
3
4
  import { CheckContent } from "../shared/CheckContent.js";
4
5
  import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
5
6
  import { FormField } from "../FormField/FormField.js";
@@ -11,10 +12,9 @@ import { clsx } from "clsx";
11
12
  import { Radio, RadioGroup } from "react-aria-components";
12
13
  import { useLabel } from "react-aria";
13
14
  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(91);
17
+ const $ = c(89);
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,12 +23,11 @@ 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, fireBlurOnChange: fireBlurOnChangeProp, 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, 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;
32
31
  const radioClassName = radioCva({
33
32
  variant,
34
33
  ...rest
@@ -109,16 +108,13 @@ var RadioGroupBase = (props) => {
109
108
  const selectedValue = value ?? defaultValue;
110
109
  const shouldRenderInputFrame = as !== "default";
111
110
  let t5;
112
- if ($[25] !== fireBlurOnChange || $[26] !== onBlur || $[27] !== onChange) {
111
+ if ($[25] !== onChange) {
113
112
  t5 = (nextValue) => {
114
113
  onChange?.(nextValue);
115
- if (fireBlurOnChange) onBlur?.({});
116
114
  };
117
- $[25] = fireBlurOnChange;
118
- $[26] = onBlur;
119
- $[27] = onChange;
120
- $[28] = t5;
121
- } else t5 = $[28];
115
+ $[25] = onChange;
116
+ $[26] = t5;
117
+ } else t5 = $[26];
122
118
  const handleChange = t5;
123
119
  const T0 = RadioGroup;
124
120
  const t6 = !!error;
@@ -128,26 +124,26 @@ var RadioGroupBase = (props) => {
128
124
  const T1 = FormField;
129
125
  const t10 = as === "inline" && "h-full";
130
126
  let t11;
131
- if ($[29] !== className || $[30] !== t10) {
127
+ if ($[27] !== className || $[28] !== t10) {
132
128
  t11 = clsx("w-full", t10, className);
133
- $[29] = className;
134
- $[30] = t10;
135
- $[31] = t11;
136
- } else t11 = $[31];
129
+ $[27] = className;
130
+ $[28] = t10;
131
+ $[29] = t11;
132
+ } else t11 = $[29];
137
133
  const t12 = as === "inline" ? -1 : void 0;
138
134
  let t13;
139
- if ($[32] !== as || $[33] !== inputBaseCva || $[34] !== inputClassName || $[35] !== shouldRenderInputFrame || $[36] !== ui) {
135
+ if ($[30] !== as || $[31] !== inputBaseCva || $[32] !== inputClassName || $[33] !== shouldRenderInputFrame || $[34] !== ui) {
140
136
  t13 = clsx("group/radio-group-content relative", shouldRenderInputFrame && inputBaseCva({
141
137
  variant: ui.input.variant,
142
138
  as
143
139
  }), inputClassName);
144
- $[32] = as;
145
- $[33] = inputBaseCva;
146
- $[34] = inputClassName;
147
- $[35] = shouldRenderInputFrame;
148
- $[36] = ui;
149
- $[37] = t13;
150
- } else t13 = $[37];
140
+ $[30] = as;
141
+ $[31] = inputBaseCva;
142
+ $[32] = inputClassName;
143
+ $[33] = shouldRenderInputFrame;
144
+ $[34] = ui;
145
+ $[35] = t13;
146
+ } else t13 = $[35];
151
147
  const t14 = "";
152
148
  const t15 = isDisabled || void 0;
153
149
  const t16 = isDisabled || void 0;
@@ -166,17 +162,17 @@ var RadioGroupBase = (props) => {
166
162
  const t21 = isDirty || void 0;
167
163
  const t22 = isRequired || void 0;
168
164
  let t23;
169
- if ($[38] !== as || $[39] !== headerProps || $[40] !== size) {
165
+ if ($[36] !== as || $[37] !== headerProps || $[38] !== size) {
170
166
  t23 = as && ["filter", "floating"].includes(as) && /* @__PURE__ */ jsx(FormFieldLabel, {
171
167
  as,
172
168
  size,
173
169
  ...headerProps
174
170
  });
175
- $[38] = as;
176
- $[39] = headerProps;
177
- $[40] = size;
178
- $[41] = t23;
179
- } else t23 = $[41];
171
+ $[36] = as;
172
+ $[37] = headerProps;
173
+ $[38] = size;
174
+ $[39] = t23;
175
+ } else t23 = $[39];
180
176
  const t24 = radioContentRowCva({
181
177
  variant,
182
178
  as,
@@ -184,9 +180,9 @@ var RadioGroupBase = (props) => {
184
180
  ...rest
185
181
  });
186
182
  let t25;
187
- if ($[42] !== labelClassName || $[43] !== options || $[44] !== radioClassName || $[45] !== radioContentClassNameValue || $[46] !== radioTypographyProps) {
183
+ if ($[40] !== labelClassName || $[41] !== options || $[42] !== radioClassName || $[43] !== radioContentClassNameValue || $[44] !== radioTypographyProps) {
188
184
  let t26;
189
- if ($[48] !== labelClassName || $[49] !== radioClassName || $[50] !== radioContentClassNameValue || $[51] !== radioTypographyProps) {
185
+ if ($[46] !== labelClassName || $[47] !== radioClassName || $[48] !== radioContentClassNameValue || $[49] !== radioTypographyProps) {
190
186
  t26 = (option) => /* @__PURE__ */ jsxs(Radio, {
191
187
  value: option.value,
192
188
  className: clsx("relative", radioIndicatorClass),
@@ -197,47 +193,47 @@ var RadioGroupBase = (props) => {
197
193
  children: option.label
198
194
  })]
199
195
  }, option.value);
200
- $[48] = labelClassName;
201
- $[49] = radioClassName;
202
- $[50] = radioContentClassNameValue;
203
- $[51] = radioTypographyProps;
204
- $[52] = t26;
205
- } else t26 = $[52];
196
+ $[46] = labelClassName;
197
+ $[47] = radioClassName;
198
+ $[48] = radioContentClassNameValue;
199
+ $[49] = radioTypographyProps;
200
+ $[50] = t26;
201
+ } else t26 = $[50];
206
202
  t25 = options.map(t26);
207
- $[42] = labelClassName;
208
- $[43] = options;
209
- $[44] = radioClassName;
210
- $[45] = radioContentClassNameValue;
211
- $[46] = radioTypographyProps;
212
- $[47] = t25;
213
- } else t25 = $[47];
203
+ $[40] = labelClassName;
204
+ $[41] = options;
205
+ $[42] = radioClassName;
206
+ $[43] = radioContentClassNameValue;
207
+ $[44] = radioTypographyProps;
208
+ $[45] = t25;
209
+ } else t25 = $[45];
214
210
  let t26;
215
- if ($[53] !== t24 || $[54] !== t25) {
211
+ if ($[51] !== t24 || $[52] !== t25) {
216
212
  t26 = /* @__PURE__ */ jsx("div", {
217
213
  className: t24,
218
214
  children: t25
219
215
  });
220
- $[53] = t24;
221
- $[54] = t25;
222
- $[55] = t26;
223
- } else t26 = $[55];
216
+ $[51] = t24;
217
+ $[52] = t25;
218
+ $[53] = t26;
219
+ } else t26 = $[53];
224
220
  let t27;
225
- if ($[56] !== t20 || $[57] !== t21 || $[58] !== t22 || $[59] !== t23 || $[60] !== t26) {
221
+ if ($[54] !== t20 || $[55] !== t21 || $[56] !== t22 || $[57] !== t23 || $[58] !== t26) {
226
222
  t27 = /* @__PURE__ */ jsxs("div", {
227
223
  className: t20,
228
224
  "data-is-dirty": t21,
229
225
  "data-is-required": t22,
230
226
  children: [t23, t26]
231
227
  });
232
- $[56] = t20;
233
- $[57] = t21;
234
- $[58] = t22;
235
- $[59] = t23;
236
- $[60] = t26;
237
- $[61] = t27;
238
- } else t27 = $[61];
228
+ $[54] = t20;
229
+ $[55] = t21;
230
+ $[56] = t22;
231
+ $[57] = t23;
232
+ $[58] = t26;
233
+ $[59] = t27;
234
+ } else t27 = $[59];
239
235
  let t28;
240
- if ($[62] !== t13 || $[63] !== t15 || $[64] !== t16 || $[65] !== t17 || $[66] !== t18 || $[67] !== t27) {
236
+ if ($[60] !== t13 || $[61] !== t15 || $[62] !== t16 || $[63] !== t17 || $[64] !== t18 || $[65] !== t27) {
241
237
  t28 = /* @__PURE__ */ jsx("div", {
242
238
  className: t13,
243
239
  "data-rac": t14,
@@ -248,16 +244,16 @@ var RadioGroupBase = (props) => {
248
244
  "data-radio-group-content": t19,
249
245
  children: t27
250
246
  });
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];
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];
259
255
  let t29;
260
- if ($[69] !== T1 || $[70] !== as || $[71] !== formFieldProps || $[72] !== labelProps || $[73] !== t11 || $[74] !== t12 || $[75] !== t28) {
256
+ if ($[67] !== T1 || $[68] !== as || $[69] !== formFieldProps || $[70] !== labelProps || $[71] !== t11 || $[72] !== t12 || $[73] !== t28) {
261
257
  t29 = /* @__PURE__ */ jsx(T1, {
262
258
  ...formFieldProps,
263
259
  as,
@@ -266,17 +262,17 @@ var RadioGroupBase = (props) => {
266
262
  tabIndex: t12,
267
263
  children: t28
268
264
  });
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];
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];
278
274
  let t30;
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) {
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) {
280
276
  t30 = /* @__PURE__ */ jsx(T0, {
281
277
  ...rest,
282
278
  ...fieldProps,
@@ -292,54 +288,54 @@ var RadioGroupBase = (props) => {
292
288
  className: t9,
293
289
  children: t29
294
290
  });
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];
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];
310
306
  return t30;
311
307
  };
312
308
  var RadioGroup$1 = (props) => {
313
309
  const $ = c(15);
314
- if ("formControl" in props && props.formControl) {
315
- let formControl;
310
+ if ("field" in props && props.field) {
311
+ let field;
316
312
  let innerProps;
317
313
  let ref;
318
314
  if ($[0] !== props) {
319
- ({formControl, ref, ...innerProps} = props);
315
+ ({field, ref, ...innerProps} = props);
320
316
  $[0] = props;
321
- $[1] = formControl;
317
+ $[1] = field;
322
318
  $[2] = innerProps;
323
319
  $[3] = ref;
324
320
  } else {
325
- formControl = $[1];
321
+ field = $[1];
326
322
  innerProps = $[2];
327
323
  ref = $[3];
328
324
  }
329
325
  let t0;
330
326
  if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
331
327
  t0 = (t1) => {
332
- const { field, fieldState: t2 } = t1;
328
+ const { field: field_0, fieldState: t2 } = t1;
333
329
  const { error, isDirty } = t2;
334
330
  return /* @__PURE__ */ jsx(RadioGroupBase, {
335
331
  ...innerProps,
336
- ref: mergeRefs(ref, field.ref),
337
- value: field.value,
338
- onChange: field.onChange,
339
- onBlur: field.onBlur,
340
- name: field.name,
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,
341
337
  isDirty,
342
- isDisabled: field.disabled || props.isDisabled,
338
+ isDisabled: field_0.disabled || props.isDisabled,
343
339
  error: props.error ?? error?.message
344
340
  });
345
341
  };
@@ -350,14 +346,14 @@ var RadioGroup$1 = (props) => {
350
346
  $[8] = t0;
351
347
  } else t0 = $[8];
352
348
  let t1;
353
- if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
354
- t1 = /* @__PURE__ */ jsx(Controller, {
355
- control: formControl.control,
356
- name: formControl.name,
349
+ if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
350
+ t1 = /* @__PURE__ */ jsx(FieldController, {
351
+ control: field.form,
352
+ name: field.name,
357
353
  render: t0
358
354
  });
359
- $[9] = formControl.control;
360
- $[10] = formControl.name;
355
+ $[9] = field.form;
356
+ $[10] = field.name;
361
357
  $[11] = t0;
362
358
  $[12] = t1;
363
359
  } 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 'react-hook-form';
3
+ import { FieldValues } from '../../shared/form.binding';
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,5 +1,6 @@
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";
3
4
  import { InputFrame } from "../../Skeleton/InputFrame.js";
4
5
  import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
5
6
  import { selectInputTagsContentWrapperDefinition } from "../shared/selectInput.cva.js";
@@ -11,7 +12,6 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
12
  import { clsx } from "clsx";
12
13
  import { useRef, useState } from "react";
13
14
  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 ("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, {
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, {
145
145
  ...innerProps,
146
- ref: mergeRefs(ref, field.ref),
147
- value: field.value,
148
- onChange: field.onChange,
149
- onBlur: field.onBlur,
146
+ ref: mergeRefs(ref, field_0.ref),
147
+ value: field_0.value,
148
+ onChange: field_0.onChange,
149
+ onBlur: field_0.onBlur,
150
150
  isDirty,
151
- isDisabled: field.disabled || props.isDisabled,
151
+ isDisabled: field_0.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 'react-hook-form';
1
+ import { FieldValues } from '../../shared/form.binding';
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,4 +1,5 @@
1
1
  import { UIConfig } from "../../../../config/uiConfig.context.js";
2
+ import { FieldController } from "../../shared/form.binding.js";
2
3
  import { Autocomplete } from "./Autocomplete.js";
3
4
  import { getQueryItems, getSelectionIdsToResolve } from "../shared/querySelect.utils.js";
4
5
  import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
@@ -6,7 +7,6 @@ import { c } from "react/compiler-runtime";
6
7
  import { jsx } from "react/jsx-runtime";
7
8
  import { useState } from "react";
8
9
  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 ("formControl" in props && props.formControl) {
115
- let formControl;
114
+ if ("field" in props && props.field) {
115
+ let field;
116
116
  let innerProps;
117
117
  let ref;
118
118
  if ($[0] !== props) {
119
- ({formControl, ref, ...innerProps} = props);
119
+ ({field, ref, ...innerProps} = props);
120
120
  $[0] = props;
121
- $[1] = formControl;
121
+ $[1] = field;
122
122
  $[2] = innerProps;
123
123
  $[3] = ref;
124
124
  } else {
125
- formControl = $[1];
125
+ field = $[1];
126
126
  innerProps = $[2];
127
127
  ref = $[3];
128
128
  }
129
- const controlWithOptions = formControl.control;
129
+ const controlWithOptions = field.form;
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, fieldState: t2 } = t1;
133
+ const { field: field_0, fieldState: t2 } = t1;
134
134
  const { error, isDirty } = t2;
135
135
  return /* @__PURE__ */ jsx(QueryAutocompleteContent, {
136
136
  ...innerProps,
137
- ref: mergeRefs(ref, field.ref),
138
- value: field.value,
139
- onChange: field.onChange,
140
- onBlur: field.onBlur,
137
+ ref: mergeRefs(ref, field_0.ref),
138
+ value: field_0.value,
139
+ onChange: field_0.onChange,
140
+ onBlur: field_0.onBlur,
141
141
  isDirty,
142
- isDisabled: field.disabled || props.isDisabled || !!controlWithOptions._options?.disabled,
142
+ isDisabled: field_0.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] !== formControl.control || $[11] !== formControl.name || $[12] !== t0) {
155
- t1 = /* @__PURE__ */ jsx(Controller, {
156
- control: formControl.control,
157
- name: formControl.name,
154
+ if ($[10] !== field.form || $[11] !== field.name || $[12] !== t0) {
155
+ t1 = /* @__PURE__ */ jsx(FieldController, {
156
+ control: field.form,
157
+ name: field.name,
158
158
  render: t0
159
159
  });
160
- $[10] = formControl.control;
161
- $[11] = formControl.name;
160
+ $[10] = field.form;
161
+ $[11] = field.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 'react-hook-form';
3
+ import { FieldValues } from '../../shared/form.binding';
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 'react-hook-form';
2
+ import { FieldValues } from '../../shared/form.binding';
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,4 +1,5 @@
1
1
  import { UIConfig } from "../../../../config/uiConfig.context.js";
2
+ import { FieldController } from "../../shared/form.binding.js";
2
3
  import { Select } from "./Select.js";
3
4
  import { getQueryItems, getSelectionIdsToResolve } from "../shared/querySelect.utils.js";
4
5
  import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
@@ -6,7 +7,6 @@ import { c } from "react/compiler-runtime";
6
7
  import { jsx } from "react/jsx-runtime";
7
8
  import { useState } from "react";
8
9
  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 ("formControl" in props && props.formControl) {
111
- let formControl;
110
+ if ("field" in props && props.field) {
111
+ let field;
112
112
  let innerProps;
113
113
  let ref;
114
114
  if ($[0] !== props) {
115
- ({formControl, ref, ...innerProps} = props);
115
+ ({field, ref, ...innerProps} = props);
116
116
  $[0] = props;
117
- $[1] = formControl;
117
+ $[1] = field;
118
118
  $[2] = innerProps;
119
119
  $[3] = ref;
120
120
  } else {
121
- formControl = $[1];
121
+ field = $[1];
122
122
  innerProps = $[2];
123
123
  ref = $[3];
124
124
  }
125
- const controlWithOptions = formControl.control;
125
+ const controlWithOptions = field.form;
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, fieldState: t2 } = t1;
129
+ const { field: field_0, fieldState: t2 } = t1;
130
130
  const { error, isDirty } = t2;
131
131
  return /* @__PURE__ */ jsx(QuerySelectContent, {
132
132
  ...innerProps,
133
- ref: mergeRefs(ref, field.ref),
134
- value: field.value,
135
- onChange: field.onChange,
136
- onBlur: field.onBlur,
133
+ ref: mergeRefs(ref, field_0.ref),
134
+ value: field_0.value,
135
+ onChange: field_0.onChange,
136
+ onBlur: field_0.onBlur,
137
137
  isDirty,
138
- isDisabled: field.disabled || props.isDisabled || !!controlWithOptions._options?.disabled,
138
+ isDisabled: field_0.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] !== formControl.control || $[11] !== formControl.name || $[12] !== t0) {
151
- t1 = /* @__PURE__ */ jsx(Controller, {
152
- control: formControl.control,
153
- name: formControl.name,
150
+ if ($[10] !== field.form || $[11] !== field.name || $[12] !== t0) {
151
+ t1 = /* @__PURE__ */ jsx(FieldController, {
152
+ control: field.form,
153
+ name: field.name,
154
154
  render: t0
155
155
  });
156
- $[10] = formControl.control;
157
- $[11] = formControl.name;
156
+ $[10] = field.form;
157
+ $[11] = field.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 'react-hook-form';
3
+ import { FieldValues } from '../../shared/form.binding';
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';