@uxf/form 11.36.0 → 11.38.1

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/form/form.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode, Ref } from "react";
2
- import { FieldValues, SubmitHandler, UseFormReturn } from "react-hook-form";
2
+ import { FieldValues, SubmitErrorHandler, SubmitHandler, UseFormReturn } from "react-hook-form";
3
3
  export type FormProps<TFieldValues extends FieldValues> = {
4
4
  children: ReactNode;
5
5
  className?: string;
@@ -7,8 +7,9 @@ export type FormProps<TFieldValues extends FieldValues> = {
7
7
  forwardRef?: Ref<HTMLFormElement> | undefined;
8
8
  id: string;
9
9
  method?: "get" | "post";
10
- omitSubmitInput?: boolean;
10
+ onError?: SubmitErrorHandler<TFieldValues>;
11
11
  onSubmit: SubmitHandler<TFieldValues>;
12
+ shouldOmitSubmitInput?: boolean;
12
13
  };
13
14
  export declare function Form<TFieldValues extends FieldValues = FieldValues>(props: FormProps<TFieldValues>): React.JSX.Element;
14
15
  export declare namespace Form {
package/form/form.js CHANGED
@@ -12,8 +12,8 @@ function Form(props) {
12
12
  var _a;
13
13
  return (react_1.default.createElement(form_id_context_1.FormIdContextProvider, { value: props.id },
14
14
  react_1.default.createElement(react_hook_form_1.FormProvider, { ...props.formApi },
15
- react_1.default.createElement("form", { className: props.className, id: props.id, method: (_a = props.method) !== null && _a !== void 0 ? _a : "post", noValidate: true, onSubmit: props.formApi.handleSubmit(props.onSubmit), ref: props.forwardRef },
15
+ react_1.default.createElement("form", { className: props.className, id: props.id, method: (_a = props.method) !== null && _a !== void 0 ? _a : "post", noValidate: true, onSubmit: props.formApi.handleSubmit(props.onSubmit, props.onError), ref: props.forwardRef },
16
16
  props.children,
17
- !props.omitSubmitInput && react_1.default.createElement("input", { style: sr_only_1.srOnly, type: "submit" })))));
17
+ !props.shouldOmitSubmitInput && react_1.default.createElement("input", { style: sr_only_1.srOnly, type: "submit" })))));
18
18
  }
19
19
  Form.displayName = "UxfForm";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/form",
3
- "version": "11.36.0",
3
+ "version": "11.38.1",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "@uxf/ui": "11.36.0",
18
+ "@uxf/ui": "11.38.1",
19
19
  "coordinate-parser": "1.0.7",
20
20
  "dayjs": "1.11.13",
21
21
  "react-hook-form": "7.53.0"