File tree Expand file tree Collapse file tree 3 files changed +394
-2
lines changed
packages/carbon-component-mapper/src Expand file tree Collapse file tree 3 files changed +394
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { Field , AnyObject } from "@data-driven-forms/react-form-renderer" ;
2
+ import { ReactNode } from "react" ;
3
+ import { ButtonProps , ProgressIndicatorProps , ProgressStepProps } from "carbon-components-react" ;
4
+
5
+ export interface WizardButtonLabels {
6
+ submit ?: ReactNode ;
7
+ back ?: ReactNode ;
8
+ next ?: ReactNode ;
9
+ }
2
10
3
11
export interface WizardNextStepFunctionArgument {
4
12
values ?: AnyObject ;
@@ -27,9 +35,21 @@ export interface WizardField {
27
35
disableForwardJumping ?: boolean ;
28
36
}
29
37
38
+ export interface WizardNavItem extends ProgressStepProps {
39
+ title : ReactNode ;
40
+ }
41
+
30
42
export interface WizardProps {
31
43
crossroads ?: string [ ] ;
32
44
fields : WizardField [ ] ;
45
+ buttonLabels ?: WizardButtonLabels ;
46
+ BackButtonProps ?: ButtonProps ;
47
+ NextButtonProps ?: ButtonProps ;
48
+ SubmitButtonProps ?: ButtonProps ;
49
+ ButtonSetProps ?: React . HTMLProps < HTMLDivElement > ;
50
+ ProgressIndicatorProps ?: ProgressIndicatorProps ;
51
+ vertical ?: boolean ;
52
+ stepsInfo ?: WizardNavItem [ ] ;
33
53
}
34
54
35
55
declare const Wizard : React . ComponentType < WizardProps > ;
Original file line number Diff line number Diff line change @@ -99,13 +99,17 @@ const WizardInternal = ({
99
99
{ currentStep . nextStep ? (
100
100
< Button
101
101
onClick = { ( ) => handleNext ( selectNext ( currentStep . nextStep , formOptions . getState ) ) }
102
- disabled = { invalid || validating || submitting }
102
+ disabled = { ! formOptions . valid || invalid || validating || submitting }
103
103
{ ...NextButtonProps }
104
104
>
105
105
{ finalButtoLabels . next }
106
106
</ Button >
107
107
) : (
108
- < Button onClick = { ( ) => formOptions . handleSubmit ( ) } disabled = { invalid || validating || submitting } { ...SubmitButtonProps } >
108
+ < Button
109
+ onClick = { ( ) => formOptions . handleSubmit ( ) }
110
+ disabled = { ! formOptions . valid || invalid || validating || submitting }
111
+ { ...SubmitButtonProps }
112
+ >
109
113
{ finalButtoLabels . submit }
110
114
</ Button >
111
115
) }
You can’t perform that action at this time.
0 commit comments