remix-forms
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -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 = { |
@@ -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, |
{ | ||
"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", |
Sorry, the diff of this file is not supported yet
74470
2175