1
1
import { ReactNode } from "react" ;
2
- import { Field } from "@data-driven-forms/react-form-renderer" ;
2
+ import { Field , AnyObject , FormOptions } from "@data-driven-forms/react-form-renderer" ;
3
3
4
4
export interface WizardButtonLabels {
5
5
submit ?: ReactNode ;
@@ -8,6 +8,53 @@ export interface WizardButtonLabels {
8
8
next ?: ReactNode ;
9
9
}
10
10
11
+ export interface WizardNextStepFunctionArgument {
12
+ values ?: AnyObject ;
13
+ value ?: any ;
14
+ }
15
+
16
+ export interface WizardNextStepFunction {
17
+ ( formState : WizardNextStepFunctionArgument ) : string ;
18
+ }
19
+
20
+ export interface WizardStepMapper {
21
+ [ key : string ] : string | number ;
22
+ }
23
+
24
+ export interface WizardNextStepMapper {
25
+ when : string ;
26
+ stepMapper : WizardStepMapper ;
27
+ }
28
+
29
+ export type WizardNextStep = string | WizardNextStepMapper | WizardNextStepFunction ;
30
+
31
+ export interface WizardButtonsProps {
32
+ ConditionalNext : React . ComponentType ;
33
+ SubmitButton : React . ComponentType ;
34
+ SimpleNext : React . ComponentType ;
35
+ formOptions : FormOptions ;
36
+ disableBack ?: boolean ;
37
+ handlePrev : any ;
38
+ nextStep ?: string | number ;
39
+ FieldProvider ?: React . ComponentType ;
40
+ handleNext : any ;
41
+ buttonsClassname ?: string ;
42
+ buttonLabels : AnyObject ;
43
+ renderNextButton : any ;
44
+ }
45
+
46
+ export interface WizardField {
47
+ name : string | number ;
48
+ fields : Field [ ] ;
49
+ nextStep ?: WizardNextStep ;
50
+ substepOf ?: string | number ;
51
+ title ?: ReactNode ;
52
+ showTitle ?: boolean ;
53
+ customTitle ?: ReactNode ;
54
+ disableForwardJumping ?: boolean ;
55
+ buttons ?: ReactNode | React . ComponentType < WizardButtonsProps > ;
56
+ }
57
+
11
58
export interface WizardProps {
12
59
buttonLabels ?: WizardButtonLabels ;
13
60
buttonsClassName ?: string ;
@@ -20,7 +67,7 @@ export interface WizardProps {
20
67
isDynamic ?: boolean ;
21
68
showTitles ?: boolean ;
22
69
crossroads ?: string [ ] ;
23
- fields : Field [ ] ;
70
+ fields : WizardField [ ] ;
24
71
}
25
72
26
73
declare const Wizard : React . ComponentType < WizardProps > ;
0 commit comments