@trackunit/react-form-wizard 1.11.7 → 1.11.9
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-wizard",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.9",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"dependencies": {
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"react-hook-form": "7.62.0",
|
|
11
11
|
"@tanstack/react-router": "1.114.29",
|
|
12
12
|
"@tanstack/router-core": "1.114.29",
|
|
13
|
-
"@trackunit/shared-utils": "1.13.
|
|
14
|
-
"@trackunit/css-class-variance-utilities": "1.11.
|
|
15
|
-
"@trackunit/react-components": "1.15.
|
|
16
|
-
"@trackunit/i18n-library-translation": "1.11.
|
|
13
|
+
"@trackunit/shared-utils": "1.13.8",
|
|
14
|
+
"@trackunit/css-class-variance-utilities": "1.11.8",
|
|
15
|
+
"@trackunit/react-components": "1.15.9",
|
|
16
|
+
"@trackunit/i18n-library-translation": "1.11.8"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">=24.x",
|
|
@@ -6,9 +6,9 @@ import { UseFormReturn } from "react-hook-form";
|
|
|
6
6
|
import { AnyZodObject, SomeZodObject, z } from "zod";
|
|
7
7
|
export type StepState = "active" | "done" | "invalid" | "disabled" | "ready";
|
|
8
8
|
export type StepDefinitions<TFullSchema extends AnyZodObject> = {
|
|
9
|
-
[
|
|
9
|
+
[KeyFullStep in keyof z.TypeOf<TFullSchema>]: KeyFullStep extends `${infer KeyParentStep}/${infer KeySubStep}` ? KeyParentStep extends keyof z.TypeOf<TFullSchema> ? DefinedStep<z.TypeOf<TFullSchema>[KeyFullStep], z.TypeOf<TFullSchema>> & {
|
|
10
10
|
shouldRender?: (fullFormState: Partial<z.TypeOf<TFullSchema>>) => boolean;
|
|
11
|
-
} : never : DefinedStep<z.TypeOf<TFullSchema>[
|
|
11
|
+
} : never : DefinedStep<z.TypeOf<TFullSchema>[KeyFullStep], z.TypeOf<TFullSchema>>;
|
|
12
12
|
};
|
|
13
13
|
export type StepComponentPropsInner<TStepSchema extends TFullSchemaValue[keyof TFullSchemaValue], TFullSchemaValue extends z.TypeOf<AnyZodObject>> = {
|
|
14
14
|
form: UseFormReturn<TStepSchema>;
|
|
@@ -21,7 +21,7 @@ export interface FormWizardStepWrapperProps<TStepKey extends keyof z.TypeOf<TFul
|
|
|
21
21
|
component: (props: StepComponentPropsInner<DeepPartial<z.TypeOf<TFullSchema>[TStepKey]>, z.TypeOf<TFullSchema>>) => ReactNode;
|
|
22
22
|
stepForms: FormWizardStepFormReturnMap<TFullSchema>;
|
|
23
23
|
setStepForms: Dispatch<SetStateAction<Partial<{
|
|
24
|
-
[
|
|
24
|
+
[TStepKeyName in keyof z.TypeOf<TFullSchema>]: UseFormReturn<z.TypeOf<TFullSchema>[TStepKeyName]>;
|
|
25
25
|
}>>>;
|
|
26
26
|
onPrimaryAction?: (form: UseFormReturn<DeepPartial<z.TypeOf<TFullSchema>[TStepKey]>>) => Promise<unknown> | void;
|
|
27
27
|
initialFullFormState: DefaultValues<z.TypeOf<TFullSchema>>;
|