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 11import { 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+ }
210
311export interface WizardNextStepFunctionArgument {
412 values ?: AnyObject ;
@@ -27,9 +35,21 @@ export interface WizardField {
2735 disableForwardJumping ?: boolean ;
2836}
2937
38+ export interface WizardNavItem extends ProgressStepProps {
39+ title : ReactNode ;
40+ }
41+
3042export interface WizardProps {
3143 crossroads ?: string [ ] ;
3244 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 [ ] ;
3353}
3454
3555declare const Wizard : React . ComponentType < WizardProps > ;
Original file line number Diff line number Diff line change @@ -99,13 +99,17 @@ const WizardInternal = ({
9999 { currentStep . nextStep ? (
100100 < Button
101101 onClick = { ( ) => handleNext ( selectNext ( currentStep . nextStep , formOptions . getState ) ) }
102- disabled = { invalid || validating || submitting }
102+ disabled = { ! formOptions . valid || invalid || validating || submitting }
103103 { ...NextButtonProps }
104104 >
105105 { finalButtoLabels . next }
106106 </ Button >
107107 ) : (
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+ >
109113 { finalButtoLabels . submit }
110114 </ Button >
111115 ) }
You can’t perform that action at this time.
0 commit comments