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.mjs
CHANGED
|
@@ -196,10 +196,14 @@ var entitiesToGroupedOption = (data, optionValue = "name") => {
|
|
|
196
196
|
return entities;
|
|
197
197
|
};
|
|
198
198
|
var handleOnChage = (event, input, field) => {
|
|
199
|
-
|
|
199
|
+
let value = event;
|
|
200
|
+
if (event && typeof event === "object" && "target" in event) {
|
|
201
|
+
value = event.target.value;
|
|
202
|
+
}
|
|
203
|
+
field?.onChange(value);
|
|
200
204
|
const data = input.form?.getValues();
|
|
201
|
-
input.onChange?.(
|
|
202
|
-
|
|
205
|
+
input.onChange?.(value, data);
|
|
206
|
+
input.onAnyFieldChange?.(data);
|
|
203
207
|
};
|
|
204
208
|
var isValidField = (input, form, defaultValue) => {
|
|
205
209
|
const value = defaultValue ?? form.getValues(input.name);
|
|
@@ -5626,9 +5630,10 @@ var FieldSwitch = ({ input, form, isSubmitting }) => {
|
|
|
5626
5630
|
Switch,
|
|
5627
5631
|
{
|
|
5628
5632
|
checked: field.value,
|
|
5629
|
-
onCheckedChange: (event) =>
|
|
5630
|
-
|
|
5631
|
-
|
|
5633
|
+
onCheckedChange: (event) => {
|
|
5634
|
+
handleOnChage(event, input, field);
|
|
5635
|
+
},
|
|
5636
|
+
disabled: false
|
|
5632
5637
|
}
|
|
5633
5638
|
) })
|
|
5634
5639
|
] }) })
|