@harnessio/forms 0.16.0 → 1.0.0
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/dist/core/components/RootForm.d.ts +1 -1
- package/dist/core/transformers/transformers.d.ts +2 -1
- package/dist/core/utils/transform-utils.d.ts +2 -0
- package/dist/core/utils/zod-resolver-utils.d.ts +1 -1
- package/dist/core/validation/zod-validation.d.ts +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3293 -681
- package/dist/index.js.map +1 -1
- package/dist/types/types.d.ts +12 -2
- package/package.json +4 -4
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema } from 'zod';
|
|
1
|
+
import { Schema } from 'zod/v3';
|
|
2
2
|
/** @deprecated use AnyFormValue */
|
|
3
3
|
export type AnyFormikValue = any;
|
|
4
4
|
export type AnyFormValue = any;
|
|
@@ -15,7 +15,7 @@ export type IInputTransformerFunc = (value: any, values: any) => {
|
|
|
15
15
|
value: any;
|
|
16
16
|
path?: string;
|
|
17
17
|
} | undefined;
|
|
18
|
-
export type IOutputTransformerFunc = (value: any, values: any) => {
|
|
18
|
+
export type IOutputTransformerFunc = (value: any, values: any, targetValue: any, targetValues: any) => {
|
|
19
19
|
value: any;
|
|
20
20
|
path?: string;
|
|
21
21
|
unset?: boolean;
|
|
@@ -106,6 +106,16 @@ export interface IInputDefinition<TConfig = unknown, TValue = unknown, TInputTyp
|
|
|
106
106
|
description?: string;
|
|
107
107
|
inputTransform?: IInputTransformerFunc | IInputTransformerFunc[] | undefined;
|
|
108
108
|
outputTransform?: IOutputTransformerFunc | IOutputTransformerFunc[] | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Transformer execution priority. Controls the order transformers run relative to other transformers.
|
|
111
|
+
* - 'early': Runs before 'normal' (useful for expanding shorthand forms on input)
|
|
112
|
+
* - 'normal': Default priority
|
|
113
|
+
* - 'late': Runs after 'normal' (useful for collapsing to shorthand forms on output)
|
|
114
|
+
*/
|
|
115
|
+
transformerPriority?: {
|
|
116
|
+
input?: 'early' | 'normal' | 'late';
|
|
117
|
+
output?: 'early' | 'normal' | 'late';
|
|
118
|
+
};
|
|
109
119
|
autofocus?: boolean;
|
|
110
120
|
/**
|
|
111
121
|
* Multiple named overrides for this input definition.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harnessio/forms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Harness Forms Library",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
},
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@hookform/resolvers": "^
|
|
29
|
+
"@hookform/resolvers": "^5.0.0",
|
|
30
30
|
"lodash-es": "^4.17.21",
|
|
31
31
|
"react": "^17.0.2",
|
|
32
32
|
"react-dom": "^17.0.2",
|
|
33
|
-
"react-hook-form": "^7.
|
|
33
|
+
"react-hook-form": "^7.55.0",
|
|
34
34
|
"uuid": "^8.3.0",
|
|
35
35
|
"yup": "^0.29.1",
|
|
36
|
-
"zod": "^
|
|
36
|
+
"zod": "^4.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@testing-library/jest-dom": "^6.9.1",
|