@zauru-sdk/components 2.0.51 → 2.0.53
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.53](https://github.com/intuitiva/zauru-typescript-sdk/compare/v2.0.52...v2.0.53) (2024-11-08)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @zauru-sdk/components
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.0.52](https://github.com/intuitiva/zauru-typescript-sdk/compare/v2.0.51...v2.0.52) (2024-10-30)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @zauru-sdk/components
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [2.0.51](https://github.com/intuitiva/zauru-typescript-sdk/compare/v2.0.50...v2.0.51) (2024-10-23)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @zauru-sdk/components
|
|
@@ -8,6 +8,7 @@ type Props = {
|
|
|
8
8
|
id?: string;
|
|
9
9
|
method?: "post" | "put" | "delete" | "patch";
|
|
10
10
|
className?: string;
|
|
11
|
+
encType?: "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
|
|
11
12
|
};
|
|
12
13
|
export declare const ReactZodForm: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export
|
|
14
|
+
export {};
|
|
@@ -5,7 +5,7 @@ import { FormProvider, useForm, } from "react-hook-form";
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
const emptySchema = z.any();
|
|
7
7
|
export const ReactZodForm = (props) => {
|
|
8
|
-
const { children, method = "post", schema = emptySchema, onSubmit, id, className, } = props;
|
|
8
|
+
const { children, method = "post", schema = emptySchema, onSubmit, id, className, encType, } = props;
|
|
9
9
|
const submit = useSubmit();
|
|
10
10
|
const methods = useForm({
|
|
11
11
|
resolver: zodResolver(schema),
|
|
@@ -20,6 +20,5 @@ export const ReactZodForm = (props) => {
|
|
|
20
20
|
submit(event?.target, { method });
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
return (_jsx(FormProvider, { ...methods, children: _jsx(Form, { onSubmit: methods.handleSubmit(handleSubmit), method: method, id: id, className: className, children: children }) }));
|
|
23
|
+
return (_jsx(FormProvider, { ...methods, children: _jsx(Form, { onSubmit: methods.handleSubmit(handleSubmit), method: method, id: id, className: className, encType: encType, children: children }) }));
|
|
24
24
|
};
|
|
25
|
-
export default ReactZodForm;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.53",
|
|
4
4
|
"description": "Componentes reutilizables en las WebApps de Zauru.",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@zauru-sdk/hooks": "^2.0.51",
|
|
38
38
|
"@zauru-sdk/icons": "^2.0.0",
|
|
39
39
|
"@zauru-sdk/types": "^2.0.51",
|
|
40
|
-
"@zauru-sdk/utils": "^2.0.
|
|
40
|
+
"@zauru-sdk/utils": "^2.0.53",
|
|
41
41
|
"framer-motion": "^11.7.0",
|
|
42
42
|
"jsonwebtoken": "^9.0.2",
|
|
43
43
|
"react": "^18.2.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"styled-components": "^5.3.5",
|
|
50
50
|
"zod": "^3.23.8"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "7052c88abd3f37cbe402ed396bdc4c7ee8242556"
|
|
53
53
|
}
|
|
@@ -16,6 +16,10 @@ type Props = {
|
|
|
16
16
|
id?: string;
|
|
17
17
|
method?: "post" | "put" | "delete" | "patch";
|
|
18
18
|
className?: string;
|
|
19
|
+
encType?:
|
|
20
|
+
| "application/x-www-form-urlencoded"
|
|
21
|
+
| "multipart/form-data"
|
|
22
|
+
| "text/plain";
|
|
19
23
|
};
|
|
20
24
|
|
|
21
25
|
const emptySchema = z.any();
|
|
@@ -28,6 +32,7 @@ export const ReactZodForm = (props: Props) => {
|
|
|
28
32
|
onSubmit,
|
|
29
33
|
id,
|
|
30
34
|
className,
|
|
35
|
+
encType,
|
|
31
36
|
} = props;
|
|
32
37
|
|
|
33
38
|
const submit = useSubmit();
|
|
@@ -52,11 +57,10 @@ export const ReactZodForm = (props: Props) => {
|
|
|
52
57
|
method={method}
|
|
53
58
|
id={id}
|
|
54
59
|
className={className}
|
|
60
|
+
encType={encType}
|
|
55
61
|
>
|
|
56
62
|
{children}
|
|
57
63
|
</Form>
|
|
58
64
|
</FormProvider>
|
|
59
65
|
);
|
|
60
66
|
};
|
|
61
|
-
|
|
62
|
-
export default ReactZodForm;
|