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 CHANGED
@@ -233,10 +233,14 @@ var entitiesToGroupedOption = (data, optionValue = "name") => {
233
233
  return entities;
234
234
  };
235
235
  var handleOnChage = (event, input, field) => {
236
- if (event) field?.onChange(event);
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?.(event, data);
239
- if (input.onAnyFieldChange) input.onAnyFieldChange?.(data);
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) => handleOnChage(event, input, field),
5667
- "aria-disabled": true,
5668
- disabled: input.disabled || isSubmitting
5670
+ onCheckedChange: (event) => {
5671
+ handleOnChage(event, input, field);
5672
+ },
5673
+ disabled: false
5669
5674
  }
5670
5675
  ) })
5671
5676
  ] }) })