@payfit/unity-components 2.9.6 → 2.9.8
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.
|
@@ -51,5 +51,5 @@ export interface FieldRevalidateLogicProps {
|
|
|
51
51
|
* </form.AppField>
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
export declare const fieldRevalidateLogic: (
|
|
54
|
+
export declare const fieldRevalidateLogic: (config: FieldRevalidateLogicProps) => ValidationLogicFn;
|
|
55
55
|
export {};
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import { defaultValidationLogic as l } from "@tanstack/form-core";
|
|
2
|
-
const
|
|
2
|
+
const v = {
|
|
3
3
|
change: ["change", "blur", "submit"],
|
|
4
4
|
blur: ["blur", "submit"],
|
|
5
5
|
submit: ["submit"]
|
|
6
|
-
},
|
|
7
|
-
whenPristine:
|
|
8
|
-
|
|
9
|
-
}) => {
|
|
10
|
-
let n = !1;
|
|
6
|
+
}, b = (n) => {
|
|
7
|
+
const { whenPristine: s = "blur", whenDirty: d = "change" } = n;
|
|
8
|
+
let r = !1;
|
|
11
9
|
return (a) => {
|
|
12
10
|
if (Object.keys(a.validators ?? {}).length === 0)
|
|
13
11
|
return a.runValidation({ validators: [], form: a.form });
|
|
14
12
|
const e = a.event.async ? a.validators?.onDynamicAsync : a.validators?.onDynamic;
|
|
15
13
|
if (!e)
|
|
16
14
|
return l(a);
|
|
17
|
-
a.event.type === "blur" && (
|
|
15
|
+
a.event.type === "blur" && (r = !0);
|
|
18
16
|
const o = {
|
|
19
17
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- TanStack FormValidators properties are typed as `any`
|
|
20
18
|
fn: e,
|
|
21
19
|
cause: "dynamic"
|
|
22
|
-
}, u =
|
|
23
|
-
|
|
20
|
+
}, u = r ? d : s, t = [];
|
|
21
|
+
v[u].includes(a.event.type) && t.push(o);
|
|
24
22
|
let i = [];
|
|
25
23
|
return l({
|
|
26
24
|
...a,
|
|
27
|
-
runValidation: (
|
|
28
|
-
i =
|
|
25
|
+
runValidation: (m) => {
|
|
26
|
+
i = m.validators;
|
|
29
27
|
}
|
|
30
28
|
}), t.length === 0 ? a.runValidation({
|
|
31
29
|
validators: i,
|
|
@@ -37,5 +35,5 @@ const m = {
|
|
|
37
35
|
};
|
|
38
36
|
};
|
|
39
37
|
export {
|
|
40
|
-
|
|
38
|
+
b as fieldRevalidateLogic
|
|
41
39
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/unity-components",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.8",
|
|
4
4
|
"module": "./dist/esm/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"@hookform/devtools": "4.4.0",
|
|
43
43
|
"@hookform/resolvers": "5.2.1",
|
|
44
44
|
"@internationalized/date": "3.11.0",
|
|
45
|
-
"@payfit/unity-illustrations": "2.9.
|
|
45
|
+
"@payfit/unity-illustrations": "2.9.8",
|
|
46
46
|
"@radix-ui/react-avatar": "1.1.11",
|
|
47
47
|
"@radix-ui/react-slot": "1.2.4",
|
|
48
48
|
"@react-aria/interactions": "3.27.0",
|
|
49
49
|
"@react-aria/utils": "3.33.0",
|
|
50
50
|
"@react-types/shared": "3.26.0",
|
|
51
51
|
"@standard-schema/spec": "1.1.0",
|
|
52
|
-
"@tanstack/form-core": "1.28.
|
|
53
|
-
"@tanstack/react-form": "1.28.
|
|
52
|
+
"@tanstack/form-core": "1.28.3",
|
|
53
|
+
"@tanstack/react-form": "1.28.3",
|
|
54
54
|
"@tanstack/react-virtual": "3.13.18",
|
|
55
55
|
"@use-gesture/react": "10.3.1",
|
|
56
56
|
"prettier": "3.1.0",
|
|
@@ -64,15 +64,15 @@
|
|
|
64
64
|
"react-international-phone": "4.5.0",
|
|
65
65
|
"react-intl": "7.1.14",
|
|
66
66
|
"react-stately": "3.44.0",
|
|
67
|
-
"storybook": "10.2.
|
|
67
|
+
"storybook": "10.2.10",
|
|
68
68
|
"tailwind-variants": "3.2.2",
|
|
69
69
|
"usehooks-ts": "3.1.0",
|
|
70
70
|
"zod": "4.3.6"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@hookform/devtools": "^4",
|
|
74
|
-
"@payfit/unity-icons": "2.9.
|
|
75
|
-
"@payfit/unity-themes": "2.9.
|
|
74
|
+
"@payfit/unity-icons": "2.9.8",
|
|
75
|
+
"@payfit/unity-themes": "2.9.8",
|
|
76
76
|
"@storybook/react-vite": "^10.2.2",
|
|
77
77
|
"@tanstack/react-query": "^5",
|
|
78
78
|
"@tanstack/react-router": "^1.131",
|
|
@@ -91,17 +91,17 @@
|
|
|
91
91
|
"@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
|
|
92
92
|
"@payfit/storybook-addon-console-errors": "0.0.0-use.local",
|
|
93
93
|
"@payfit/storybook-config": "0.0.0-use.local",
|
|
94
|
-
"@payfit/unity-icons": "2.9.
|
|
95
|
-
"@payfit/unity-illustrations": "2.9.
|
|
96
|
-
"@payfit/unity-themes": "2.9.
|
|
94
|
+
"@payfit/unity-icons": "2.9.8",
|
|
95
|
+
"@payfit/unity-illustrations": "2.9.8",
|
|
96
|
+
"@payfit/unity-themes": "2.9.8",
|
|
97
97
|
"@payfit/vite-configs": "0.0.0-use.local",
|
|
98
|
-
"@storybook/addon-a11y": "10.2.
|
|
99
|
-
"@storybook/addon-docs": "10.2.
|
|
100
|
-
"@storybook/addon-links": "10.2.
|
|
101
|
-
"@storybook/addon-vitest": "10.2.
|
|
102
|
-
"@storybook/react-vite": "10.2.
|
|
98
|
+
"@storybook/addon-a11y": "10.2.10",
|
|
99
|
+
"@storybook/addon-docs": "10.2.10",
|
|
100
|
+
"@storybook/addon-links": "10.2.10",
|
|
101
|
+
"@storybook/addon-vitest": "10.2.10",
|
|
102
|
+
"@storybook/react-vite": "10.2.10",
|
|
103
103
|
"@tanstack/react-devtools": "0.9.6",
|
|
104
|
-
"@tanstack/react-form-devtools": "0.2.
|
|
104
|
+
"@tanstack/react-form-devtools": "0.2.16",
|
|
105
105
|
"@tanstack/react-query": "5.90.21",
|
|
106
106
|
"@tanstack/react-router": "1.159.5",
|
|
107
107
|
"@tanstack/react-router-devtools": "1.159.5",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"prettier": "3.1.0",
|
|
121
121
|
"react-docgen-typescript": "2.2.2",
|
|
122
122
|
"react-hot-toast": "2.5.1",
|
|
123
|
-
"storybook": "10.2.
|
|
123
|
+
"storybook": "10.2.10",
|
|
124
124
|
"storybook-addon-pseudo-states": "10.2.2",
|
|
125
125
|
"storybook-addon-tag-badges": "3.0.6",
|
|
126
126
|
"storybook-mock-date-decorator": "3.0.0",
|