@trackunit/react-form-components 1.3.125 → 1.3.126
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/index.cjs.js +2 -2
- package/index.esm.js +2 -2
- package/package.json +2 -2
package/index.cjs.js
CHANGED
|
@@ -3023,7 +3023,7 @@ const usePhoneInput = () => {
|
|
|
3023
3023
|
*/
|
|
3024
3024
|
const useZodValidators = () => {
|
|
3025
3025
|
const [t] = useTranslation();
|
|
3026
|
-
const ZodPhoneValidator = zod.z.string().superRefine((phoneNumber, ctx) => {
|
|
3026
|
+
const ZodPhoneValidator = React.useMemo(() => zod.z.string().superRefine((phoneNumber, ctx) => {
|
|
3027
3027
|
if (!phoneNumber) {
|
|
3028
3028
|
return undefined;
|
|
3029
3029
|
}
|
|
@@ -3064,7 +3064,7 @@ const useZodValidators = () => {
|
|
|
3064
3064
|
message: t("phoneField.error.TOO_SHORT"),
|
|
3065
3065
|
});
|
|
3066
3066
|
}
|
|
3067
|
-
});
|
|
3067
|
+
}), [t]);
|
|
3068
3068
|
return React.useMemo(() => ({ ZodPhoneValidator }), [ZodPhoneValidator]);
|
|
3069
3069
|
};
|
|
3070
3070
|
|
package/index.esm.js
CHANGED
|
@@ -3004,7 +3004,7 @@ const usePhoneInput = () => {
|
|
|
3004
3004
|
*/
|
|
3005
3005
|
const useZodValidators = () => {
|
|
3006
3006
|
const [t] = useTranslation();
|
|
3007
|
-
const ZodPhoneValidator = z.string().superRefine((phoneNumber, ctx) => {
|
|
3007
|
+
const ZodPhoneValidator = useMemo(() => z.string().superRefine((phoneNumber, ctx) => {
|
|
3008
3008
|
if (!phoneNumber) {
|
|
3009
3009
|
return undefined;
|
|
3010
3010
|
}
|
|
@@ -3045,7 +3045,7 @@ const useZodValidators = () => {
|
|
|
3045
3045
|
message: t("phoneField.error.TOO_SHORT"),
|
|
3046
3046
|
});
|
|
3047
3047
|
}
|
|
3048
|
-
});
|
|
3048
|
+
}), [t]);
|
|
3049
3049
|
return useMemo(() => ({ ZodPhoneValidator }), [ZodPhoneValidator]);
|
|
3050
3050
|
};
|
|
3051
3051
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.126",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"react-hook-form": "7.53.1",
|
|
19
19
|
"tailwind-merge": "^2.0.0",
|
|
20
20
|
"@trackunit/css-class-variance-utilities": "1.3.93",
|
|
21
|
-
"@trackunit/react-components": "1.4.
|
|
21
|
+
"@trackunit/react-components": "1.4.110",
|
|
22
22
|
"@trackunit/ui-icons": "1.3.93",
|
|
23
23
|
"@trackunit/shared-utils": "1.5.93",
|
|
24
24
|
"@trackunit/ui-design-tokens": "1.3.93",
|