@s_mart/form 3.2.0 → 3.2.2

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 (2) hide show
  1. package/dist/index.d.ts +5 -5
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { UseFormProps, UseFormReturn, FieldValues, ControllerProps, UseControllerProps } from 'react-hook-form';
2
+ import { FieldValues, UseFormProps, UseFormReturn, ControllerProps, UseControllerProps } from 'react-hook-form';
3
3
  import { z } from 'zod';
4
4
  import * as react from 'react';
5
5
  import { TextFieldProps as TextFieldProps$1, SelectProps as SelectProps$1, AutocompleteProps as AutocompleteProps$1, CheckboxProps as CheckboxProps$1, SwitchProps as SwitchProps$1, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, SliderProps as SliderProps$1 } from '@mui/material';
6
6
  import { DatePickerProps as DatePickerProps$1, TimePickerProps as TimePickerProps$1 } from '@mui/x-date-pickers';
7
7
 
8
- interface IFormProps<T> extends Omit<UseFormProps, 'resolver'> {
9
- onSubmit: (data: T, methods: UseFormReturn) => void;
10
- children: ((methods: UseFormReturn & {
8
+ interface IFormProps<T extends FieldValues> extends Omit<UseFormProps, 'resolver'> {
9
+ onSubmit: (data: T, methods: UseFormReturn<T>) => void;
10
+ children: ((methods: UseFormReturn<T> & {
11
11
  onSubmit: (e?: React.FormEvent | undefined) => Promise<void>;
12
12
  }) => React.ReactNode) | React.ReactNode;
13
13
  style?: React.HTMLAttributes<HTMLFormElement>['style'];
@@ -15,7 +15,7 @@ interface IFormProps<T> extends Omit<UseFormProps, 'resolver'> {
15
15
  * Prop que faz com que o formulário não atualize ao mudar o defaultValue
16
16
  */
17
17
  disableDefaultValuesUpdate?: boolean;
18
- schema?: z.ZodObject<any>;
18
+ schema?: z.ZodObject<any> | z.ZodEffects<z.ZodObject<any>>;
19
19
  }
20
20
 
21
21
  declare function Form({ children, onSubmit, style, disableDefaultValuesUpdate, ...rest }: IFormProps<any>): react_jsx_runtime.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s_mart/form",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",