remix-forms
Advanced tools
+2
-1
@@ -108,3 +108,3 @@ import * as React$1 from 'react'; | ||
| declare type BaseFormPropsWithHTMLAttributes = React$1.FormHTMLAttributes<HTMLFormElement> & BaseFormProps; | ||
| declare type FormComponent = React$1.ForwardRefExoticComponent<BaseFormProps>; | ||
| declare type FormComponent = React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<BaseFormProps> & React$1.RefAttributes<HTMLFormElement>>; | ||
| declare type Field<SchemaType> = { | ||
@@ -136,2 +136,3 @@ shape: ZodTypeAny; | ||
| Button: ComponentOrTagName<'button'>; | ||
| submit: () => void; | ||
| } & UseFormReturn<z.infer<Schema>, any>) => React$1.ReactNode; | ||
@@ -138,0 +139,0 @@ declare type Transition = { |
+13
-3
@@ -406,3 +406,3 @@ "use strict"; | ||
| }), | ||
| [Input, Multiline, Select, Checkbox, Radio, RadioWrapper, Label] | ||
| [] | ||
| ); | ||
@@ -726,2 +726,9 @@ if (childrenFn) { | ||
| }; | ||
| const formRef = React3.useRef(null); | ||
| const doSubmit = () => { | ||
| var _a; | ||
| (_a = formRef.current) == null ? void 0 : _a.dispatchEvent( | ||
| new Event("submit", { cancelable: true, bubbles: true }) | ||
| ); | ||
| }; | ||
| const Field = React3.useMemo( | ||
@@ -755,3 +762,4 @@ () => createField({ | ||
| fieldErrorsComponent, | ||
| Error2 | ||
| Error2, | ||
| form.register | ||
| ] | ||
@@ -820,2 +828,3 @@ ); | ||
| Button, | ||
| submit: doSubmit, | ||
| ...form | ||
@@ -895,3 +904,3 @@ }), | ||
| setDisabled(shouldDisable); | ||
| }, [transition.state, formState]); | ||
| }, [transition.state, formState, mode, isValid]); | ||
| React3.useEffect(() => { | ||
@@ -929,2 +938,3 @@ const newDefaults = Object.fromEntries( | ||
| children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Component, { | ||
| ref: formRef, | ||
| method, | ||
@@ -931,0 +941,0 @@ onSubmit, |
+13
-3
@@ -371,3 +371,3 @@ // src/createForm.tsx | ||
| }), | ||
| [Input, Multiline, Select, Checkbox, Radio, RadioWrapper, Label] | ||
| [] | ||
| ); | ||
@@ -691,2 +691,9 @@ if (childrenFn) { | ||
| }; | ||
| const formRef = React3.useRef(null); | ||
| const doSubmit = () => { | ||
| var _a; | ||
| (_a = formRef.current) == null ? void 0 : _a.dispatchEvent( | ||
| new Event("submit", { cancelable: true, bubbles: true }) | ||
| ); | ||
| }; | ||
| const Field = React3.useMemo( | ||
@@ -720,3 +727,4 @@ () => createField({ | ||
| fieldErrorsComponent, | ||
| Error2 | ||
| Error2, | ||
| form.register | ||
| ] | ||
@@ -785,2 +793,3 @@ ); | ||
| Button, | ||
| submit: doSubmit, | ||
| ...form | ||
@@ -860,3 +869,3 @@ }), | ||
| setDisabled(shouldDisable); | ||
| }, [transition.state, formState]); | ||
| }, [transition.state, formState, mode, isValid]); | ||
| React3.useEffect(() => { | ||
@@ -894,2 +903,3 @@ const newDefaults = Object.fromEntries( | ||
| children: /* @__PURE__ */ jsxs2(Component, { | ||
| ref: formRef, | ||
| method, | ||
@@ -896,0 +906,0 @@ onSubmit, |
+1
-1
| { | ||
| "name": "remix-forms", | ||
| "version": "1.4.0", | ||
| "version": "1.5.0", | ||
| "description": "The full-stack form library for Remix and React Router", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
74470
0.81%2175
0.97%