@bgscore/react-form 0.0.51 → 0.0.52

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.d.cts CHANGED
@@ -30,12 +30,13 @@ type FormProps<T = unknown> = Omit<React.FormHTMLAttributes<HTMLFormElement>, "o
30
30
  formData?: Partial<T> | null;
31
31
  controller?: UseFormInitReturn<T> | UseFormInitReturn<T>[];
32
32
  onSubmit?: OnSubmit<T>;
33
- onChange?: (values: T, event: {
34
- name?: string | undefined;
35
- type?: EventType | undefined;
36
- }) => void;
33
+ onChange?: OnChange<T>;
37
34
  onInvalid?: (errors: FieldErrors) => void;
38
35
  };
36
+ type OnChange<T = unknown> = (values: T, event: {
37
+ name?: string | undefined;
38
+ type?: EventType | undefined;
39
+ }) => void;
39
40
  type SetSelectedFn<T> = (newState: SelectedNested<T> | ((prev: SelectedNested<T>) => SelectedNested<T>)) => void;
40
41
  interface UseFormInitReturn<T = unknown> extends FormDefaultProps, Omit<UseFormReturn, "reset"> {
41
42
  reset: (field?: string | string[]) => void;
@@ -218,4 +219,4 @@ declare function createStore<T>(initialState: T): {
218
219
  };
219
220
  };
220
221
 
221
- export { FormArray as BgsFormArray, FormGroup as BgsFormGroup, BgsReactFormProvider, type ControllerProps, type FormArrayProps, type FormGroupProps, type FormProps, type OnSubmit, type PatternType, PatternTypeEnum, type SelectedNested, type TriggerSubmit, type UseBgsForm, type UseController, type UseFormArray, type UseFormArrayInitReturn, type UseFormInitReturn, type UseSelected, type ValidationCallback, type ValidationOptions, type ValidationRules, createStore, BgsForm as default, getFieldValue, useBgsController, useForm as useBgsForm, useFormArray as useBgsFormArray, useBgsFormArrayInit, useFormGroup as useBgsFormGroup, useBgsFormInit };
222
+ export { FormArray as BgsFormArray, FormGroup as BgsFormGroup, BgsReactFormProvider, type ControllerProps, type FormArrayProps, type FormGroupProps, type FormProps, type OnChange, type OnSubmit, type PatternType, PatternTypeEnum, type SelectedNested, type TriggerSubmit, type UseBgsForm, type UseController, type UseFormArray, type UseFormArrayInitReturn, type UseFormInitReturn, type UseSelected, type ValidationCallback, type ValidationOptions, type ValidationRules, createStore, BgsForm as default, getFieldValue, useBgsController, useForm as useBgsForm, useFormArray as useBgsFormArray, useBgsFormArrayInit, useFormGroup as useBgsFormGroup, useBgsFormInit };
package/dist/index.d.ts CHANGED
@@ -30,12 +30,13 @@ type FormProps<T = unknown> = Omit<React.FormHTMLAttributes<HTMLFormElement>, "o
30
30
  formData?: Partial<T> | null;
31
31
  controller?: UseFormInitReturn<T> | UseFormInitReturn<T>[];
32
32
  onSubmit?: OnSubmit<T>;
33
- onChange?: (values: T, event: {
34
- name?: string | undefined;
35
- type?: EventType | undefined;
36
- }) => void;
33
+ onChange?: OnChange<T>;
37
34
  onInvalid?: (errors: FieldErrors) => void;
38
35
  };
36
+ type OnChange<T = unknown> = (values: T, event: {
37
+ name?: string | undefined;
38
+ type?: EventType | undefined;
39
+ }) => void;
39
40
  type SetSelectedFn<T> = (newState: SelectedNested<T> | ((prev: SelectedNested<T>) => SelectedNested<T>)) => void;
40
41
  interface UseFormInitReturn<T = unknown> extends FormDefaultProps, Omit<UseFormReturn, "reset"> {
41
42
  reset: (field?: string | string[]) => void;
@@ -218,4 +219,4 @@ declare function createStore<T>(initialState: T): {
218
219
  };
219
220
  };
220
221
 
221
- export { FormArray as BgsFormArray, FormGroup as BgsFormGroup, BgsReactFormProvider, type ControllerProps, type FormArrayProps, type FormGroupProps, type FormProps, type OnSubmit, type PatternType, PatternTypeEnum, type SelectedNested, type TriggerSubmit, type UseBgsForm, type UseController, type UseFormArray, type UseFormArrayInitReturn, type UseFormInitReturn, type UseSelected, type ValidationCallback, type ValidationOptions, type ValidationRules, createStore, BgsForm as default, getFieldValue, useBgsController, useForm as useBgsForm, useFormArray as useBgsFormArray, useBgsFormArrayInit, useFormGroup as useBgsFormGroup, useBgsFormInit };
222
+ export { FormArray as BgsFormArray, FormGroup as BgsFormGroup, BgsReactFormProvider, type ControllerProps, type FormArrayProps, type FormGroupProps, type FormProps, type OnChange, type OnSubmit, type PatternType, PatternTypeEnum, type SelectedNested, type TriggerSubmit, type UseBgsForm, type UseController, type UseFormArray, type UseFormArrayInitReturn, type UseFormInitReturn, type UseSelected, type ValidationCallback, type ValidationOptions, type ValidationRules, createStore, BgsForm as default, getFieldValue, useBgsController, useForm as useBgsForm, useFormArray as useBgsFormArray, useBgsFormArrayInit, useFormGroup as useBgsFormGroup, useBgsFormInit };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgscore/react-form",
3
- "version": "0.0.51",
3
+ "version": "0.0.52",
4
4
  "description": "React form component library using context and react-hook-form with dynamic arrays, groups, and validations.",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",