shadcn-zod-formkit 1.27.2 → 1.27.3
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/index.cjs +11 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +11 -6
- package/dist/index.mjs.map +1 -1
- package/dist/shadcn-zod-formkit-1.27.3.tgz +0 -0
- package/package.json +1 -1
- package/dist/shadcn-zod-formkit-1.27.2.tgz +0 -0
package/dist/index.cjs
CHANGED
|
@@ -233,10 +233,14 @@ var entitiesToGroupedOption = (data, optionValue = "name") => {
|
|
|
233
233
|
return entities;
|
|
234
234
|
};
|
|
235
235
|
var handleOnChage = (event, input, field) => {
|
|
236
|
-
|
|
236
|
+
let value = event;
|
|
237
|
+
if (event && typeof event === "object" && "target" in event) {
|
|
238
|
+
value = event.target.value;
|
|
239
|
+
}
|
|
240
|
+
field?.onChange(value);
|
|
237
241
|
const data = input.form?.getValues();
|
|
238
|
-
input.onChange?.(
|
|
239
|
-
|
|
242
|
+
input.onChange?.(value, data);
|
|
243
|
+
input.onAnyFieldChange?.(data);
|
|
240
244
|
};
|
|
241
245
|
var isValidField = (input, form, defaultValue) => {
|
|
242
246
|
const value = defaultValue ?? form.getValues(input.name);
|
|
@@ -5663,9 +5667,10 @@ var FieldSwitch = ({ input, form, isSubmitting }) => {
|
|
|
5663
5667
|
Switch,
|
|
5664
5668
|
{
|
|
5665
5669
|
checked: field.value,
|
|
5666
|
-
onCheckedChange: (event) =>
|
|
5667
|
-
|
|
5668
|
-
|
|
5670
|
+
onCheckedChange: (event) => {
|
|
5671
|
+
handleOnChage(event, input, field);
|
|
5672
|
+
},
|
|
5673
|
+
disabled: false
|
|
5669
5674
|
}
|
|
5670
5675
|
) })
|
|
5671
5676
|
] }) })
|