@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.
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -2
- package/dist/components/inputs/Checkbox/Checkbox.js +93 -100
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +1 -2
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +109 -113
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +14 -21
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +14 -22
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +14 -21
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +275 -294
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +1 -10
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +43 -46
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +17 -17
- package/dist/components/inputs/File/InputUpload.d.ts +1 -1
- package/dist/components/inputs/File/InputUpload.js +17 -17
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/inputUpload.types.d.ts +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +19 -19
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +18 -18
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.js +18 -18
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +36 -38
- package/dist/components/inputs/Inputs/Form.d.ts +4 -4
- package/dist/components/inputs/Inputs/InputItem.d.ts +22 -22
- package/dist/components/inputs/Inputs/InputItem.js +35 -36
- package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +107 -111
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +13 -13
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +19 -19
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.js +19 -19
- package/dist/components/inputs/Selection/Select/Select.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/Select.js +19 -19
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +0 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +34 -37
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +4 -8
- package/dist/components/inputs/Selection/shared/select.types.d.ts +1 -1
- package/dist/components/inputs/Slider/Slider.d.ts +1 -1
- package/dist/components/inputs/Slider/Slider.js +18 -18
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +18 -18
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -2
- package/dist/components/inputs/Toggle/Toggle.js +59 -63
- package/dist/components/inputs/shared/form.binding.d.ts +27 -0
- package/dist/components/inputs/shared/form.binding.js +57 -0
- package/dist/components/inputs/shared/form.types.d.ts +9 -8
- package/dist/components/inputs/shared/form.types.js +8 -0
- package/dist/components/segment/Segment.d.ts +1 -1
- package/dist/components/segment/Segment.js +17 -17
- package/dist/components/segment/segment.types.d.ts +1 -1
- package/dist/config/uiConfig.context.d.ts +5 -5
- package/dist/config/uiConfig.context.js +3 -12
- package/dist/helpers/dynamicColumns.d.ts +1 -1
- package/dist/helpers/dynamicInputs.d.ts +7 -7
- package/dist/hooks/useAutosave.d.ts +4 -4
- package/dist/hooks/useAutosave.js +64 -49
- package/dist/hooks/useForm.d.ts +39 -15
- package/dist/hooks/useForm.js +96 -43
- package/dist/hooks/useFormAutosave.d.ts +8 -9
- package/dist/hooks/useFormAutosave.js +23 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/package.json +2 -3
- 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(
|
|
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,
|
|
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] !==
|
|
111
|
+
if ($[25] !== onChange) {
|
|
113
112
|
t5 = (nextValue) => {
|
|
114
113
|
onChange?.(nextValue);
|
|
115
|
-
if (fireBlurOnChange) onBlur?.({});
|
|
116
114
|
};
|
|
117
|
-
$[25] =
|
|
118
|
-
$[26] =
|
|
119
|
-
|
|
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 ($[
|
|
127
|
+
if ($[27] !== className || $[28] !== t10) {
|
|
132
128
|
t11 = clsx("w-full", t10, className);
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
} else t11 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
} else t13 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
} else t23 = $[
|
|
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 ($[
|
|
183
|
+
if ($[40] !== labelClassName || $[41] !== options || $[42] !== radioClassName || $[43] !== radioContentClassNameValue || $[44] !== radioTypographyProps) {
|
|
188
184
|
let t26;
|
|
189
|
-
if ($[
|
|
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
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
} else t26 = $[
|
|
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
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
} else t25 = $[
|
|
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 ($[
|
|
211
|
+
if ($[51] !== t24 || $[52] !== t25) {
|
|
216
212
|
t26 = /* @__PURE__ */ jsx("div", {
|
|
217
213
|
className: t24,
|
|
218
214
|
children: t25
|
|
219
215
|
});
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
} else t26 = $[
|
|
216
|
+
$[51] = t24;
|
|
217
|
+
$[52] = t25;
|
|
218
|
+
$[53] = t26;
|
|
219
|
+
} else t26 = $[53];
|
|
224
220
|
let t27;
|
|
225
|
-
if ($[
|
|
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
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
} else t27 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
} else t28 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
} else t29 = $[
|
|
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 ($[
|
|
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
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
} else t30 = $[
|
|
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 ("
|
|
315
|
-
let
|
|
310
|
+
if ("field" in props && props.field) {
|
|
311
|
+
let field;
|
|
316
312
|
let innerProps;
|
|
317
313
|
let ref;
|
|
318
314
|
if ($[0] !== props) {
|
|
319
|
-
({
|
|
315
|
+
({field, ref, ...innerProps} = props);
|
|
320
316
|
$[0] = props;
|
|
321
|
-
$[1] =
|
|
317
|
+
$[1] = field;
|
|
322
318
|
$[2] = innerProps;
|
|
323
319
|
$[3] = ref;
|
|
324
320
|
} else {
|
|
325
|
-
|
|
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,
|
|
337
|
-
value:
|
|
338
|
-
onChange:
|
|
339
|
-
onBlur:
|
|
340
|
-
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:
|
|
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] !==
|
|
354
|
-
t1 = /* @__PURE__ */ jsx(
|
|
355
|
-
control:
|
|
356
|
-
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] =
|
|
360
|
-
$[10] =
|
|
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 '
|
|
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 ("
|
|
139
|
-
const { ignoreInputValueFiltering = true,
|
|
140
|
-
const controlWithOptions =
|
|
141
|
-
return /* @__PURE__ */ jsx(
|
|
142
|
-
control:
|
|
143
|
-
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,
|
|
147
|
-
value:
|
|
148
|
-
onChange:
|
|
149
|
-
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:
|
|
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 '
|
|
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 ("
|
|
115
|
-
let
|
|
114
|
+
if ("field" in props && props.field) {
|
|
115
|
+
let field;
|
|
116
116
|
let innerProps;
|
|
117
117
|
let ref;
|
|
118
118
|
if ($[0] !== props) {
|
|
119
|
-
({
|
|
119
|
+
({field, ref, ...innerProps} = props);
|
|
120
120
|
$[0] = props;
|
|
121
|
-
$[1] =
|
|
121
|
+
$[1] = field;
|
|
122
122
|
$[2] = innerProps;
|
|
123
123
|
$[3] = ref;
|
|
124
124
|
} else {
|
|
125
|
-
|
|
125
|
+
field = $[1];
|
|
126
126
|
innerProps = $[2];
|
|
127
127
|
ref = $[3];
|
|
128
128
|
}
|
|
129
|
-
const controlWithOptions =
|
|
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,
|
|
138
|
-
value:
|
|
139
|
-
onChange:
|
|
140
|
-
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:
|
|
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] !==
|
|
155
|
-
t1 = /* @__PURE__ */ jsx(
|
|
156
|
-
control:
|
|
157
|
-
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] =
|
|
161
|
-
$[11] =
|
|
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 '
|
|
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 '
|
|
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 ("
|
|
111
|
-
let
|
|
110
|
+
if ("field" in props && props.field) {
|
|
111
|
+
let field;
|
|
112
112
|
let innerProps;
|
|
113
113
|
let ref;
|
|
114
114
|
if ($[0] !== props) {
|
|
115
|
-
({
|
|
115
|
+
({field, ref, ...innerProps} = props);
|
|
116
116
|
$[0] = props;
|
|
117
|
-
$[1] =
|
|
117
|
+
$[1] = field;
|
|
118
118
|
$[2] = innerProps;
|
|
119
119
|
$[3] = ref;
|
|
120
120
|
} else {
|
|
121
|
-
|
|
121
|
+
field = $[1];
|
|
122
122
|
innerProps = $[2];
|
|
123
123
|
ref = $[3];
|
|
124
124
|
}
|
|
125
|
-
const controlWithOptions =
|
|
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,
|
|
134
|
-
value:
|
|
135
|
-
onChange:
|
|
136
|
-
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:
|
|
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] !==
|
|
151
|
-
t1 = /* @__PURE__ */ jsx(
|
|
152
|
-
control:
|
|
153
|
-
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] =
|
|
157
|
-
$[11] =
|
|
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 '
|
|
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';
|