@omer-x/tailwind-ui-kit 1.0.0-alpha.17 → 1.0.0-alpha.18
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.
|
@@ -11,6 +11,6 @@ type BaseFormProps = Omit<ComponentPropsWithoutRef<"form">, "action"> & {
|
|
|
11
11
|
renderMessages?: ComponentProps<typeof JustDiv>["render"];
|
|
12
12
|
onStateChange?: (state: Record<string, string>) => void;
|
|
13
13
|
};
|
|
14
|
-
declare const BaseForm: ({ action, defaultValues, onlyDirty, messages: messageTranslations, renderMessages, onStateChange, children, ...otherProps }: BaseFormProps) => react.JSX.Element;
|
|
14
|
+
declare const BaseForm: ({ action, defaultValues, onlyDirty, messages: messageTranslations, renderMessages, onStateChange, onSubmit, children, ...otherProps }: BaseFormProps) => react.JSX.Element;
|
|
15
15
|
|
|
16
16
|
export { BaseForm as default };
|
|
@@ -12,6 +12,7 @@ const BaseForm = ({
|
|
|
12
12
|
messages: messageTranslations = {},
|
|
13
13
|
renderMessages,
|
|
14
14
|
onStateChange,
|
|
15
|
+
onSubmit,
|
|
15
16
|
children,
|
|
16
17
|
...otherProps
|
|
17
18
|
}) => {
|
|
@@ -55,6 +56,10 @@ const BaseForm = ({
|
|
|
55
56
|
ref: formRef,
|
|
56
57
|
action: alteredAction,
|
|
57
58
|
errors: fieldMessages,
|
|
59
|
+
onSubmit: (e) => {
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
onSubmit?.(e);
|
|
62
|
+
},
|
|
58
63
|
children: [
|
|
59
64
|
Object.entries(formMessages).map(([messageKey, message]) => /* @__PURE__ */ jsx(
|
|
60
65
|
JustDiv,
|