File tree Expand file tree Collapse file tree 10 files changed +15
-15
lines changed
packages/mui-component-mapper/src/files Expand file tree Collapse file tree 10 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export const SingleCheckbox = (props) => {
33
33
type : 'checkbox'
34
34
} ) ;
35
35
const invalid = validationError ( meta , validateOnMount ) ;
36
- const text = invalid || helperText || description ;
36
+ const text = invalid || ( ( meta . touched || validateOnMount ) && meta . warning ) || helperText || description ;
37
37
38
38
return (
39
39
< FormFieldGrid { ...FormFieldGridProps } >
@@ -57,7 +57,7 @@ export const SingleCheckbox = (props) => {
57
57
disabled = { isDisabled || isReadOnly }
58
58
label = { < FormLabel { ...FormLabelProps } > { label } </ FormLabel > }
59
59
/>
60
- { ( invalid || text ) && < FormHelperText { ...FormHelperTextProps } > { invalid || text } </ FormHelperText > }
60
+ { text && < FormHelperText { ...FormHelperTextProps } > { text } </ FormHelperText > }
61
61
</ FormGroup >
62
62
</ FormControl >
63
63
</ FormFieldGrid >
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const DatePicker = (props) => {
34
34
fullWidth
35
35
margin = "normal"
36
36
label = { label }
37
- helperText = { invalid || helperText || description }
37
+ helperText = { invalid || ( ( meta . touched || validateOnMount ) && meta . warning ) || helperText || description }
38
38
disabled = { isDisabled || isReadOnly }
39
39
placeholder = { placeholder }
40
40
required = { isRequired }
Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ const DualListSelect = ({
309
309
} ) => {
310
310
const classes = useStyles ( ) ;
311
311
const invalid = validationError ( meta , validateOnMount ) ;
312
- const text = invalid || helperText || description ;
312
+ const text = invalid || ( ( meta . touched || validateOnMount ) && meta . warning ) || helperText || description ;
313
313
314
314
return (
315
315
< FormFieldGrid { ...FormFieldGridProps } >
@@ -475,7 +475,7 @@ const DualListSelect = ({
475
475
/>
476
476
</ Grid >
477
477
</ Grid >
478
- { ( invalid || text ) && < FormHelperText { ...FormHelperTextProps } > { invalid || text } </ FormHelperText > }
478
+ { text && < FormHelperText { ...FormHelperTextProps } > { text } </ FormHelperText > }
479
479
</ FormControl >
480
480
</ FormFieldGrid >
481
481
) ;
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ const Radio = ({ name, ...props }) => {
73
73
} ) ;
74
74
const classes = useStyles ( ) ;
75
75
const invalid = validationError ( meta , validateOnMount ) ;
76
- const text = invalid || helperText || description ;
76
+ const text = invalid || ( ( meta . touched || validateOnMount ) && meta . warning ) || helperText || description ;
77
77
return (
78
78
< FormFieldGrid className = { classes . grid } { ...FormFieldGridProps } >
79
79
< FormControl required = { isRequired } error = { ! ! invalid } component = "fieldset" { ...FormControlProps } >
@@ -83,7 +83,7 @@ const Radio = ({ name, ...props }) => {
83
83
{ options . map ( ( option ) => (
84
84
< RadioOption key = { option . value } name = { name } option = { option } isDisabled = { isDisabled } isReadOnly = { isReadOnly } { ...rest } />
85
85
) ) }
86
- { ( invalid || text ) && < FormHelperText { ...FormHelperTextProps } > { invalid || text } </ FormHelperText > }
86
+ { text && < FormHelperText { ...FormHelperTextProps } > { text } </ FormHelperText > }
87
87
</ FormControl >
88
88
</ FormFieldGrid >
89
89
) ;
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ const InternalSelect = ({
98
98
{ ...params }
99
99
required = { required }
100
100
error = { ! ! invalid }
101
- helperText = { invalid ? meta . error : helperText || description }
101
+ helperText = { invalid || ( ( meta . touched || validateOnMount ) && meta . warning ) || helperText || description }
102
102
label = { label }
103
103
margin = "normal"
104
104
{ ...TextFieldProps }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const Slider = (props) => {
32
32
} = useFieldApi ( props ) ;
33
33
34
34
const invalid = validationError ( meta , validateOnMount ) ;
35
- const text = invalid || helperText || description ;
35
+ const text = invalid || ( ( meta . touched || validateOnMount ) && meta . warning ) || helperText || description ;
36
36
37
37
return (
38
38
< FormFieldGrid { ...FormFieldGridProps } >
@@ -62,7 +62,7 @@ const Slider = (props) => {
62
62
</ Grid >
63
63
) }
64
64
</ Grid >
65
- { ( invalid || text ) && < FormHelperText { ...FormHelperTextProps } > { invalid || text } </ FormHelperText > }
65
+ { text && < FormHelperText { ...FormHelperTextProps } > { text } </ FormHelperText > }
66
66
</ FormGroup >
67
67
</ FormControl >
68
68
</ FormFieldGrid >
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export const Switch = (props) => {
33
33
type : 'checkbox'
34
34
} ) ;
35
35
const invalid = validationError ( meta , validateOnMount ) ;
36
- const text = invalid || helperText || description ;
36
+ const text = invalid || ( ( meta . touched || validateOnMount ) && meta . warning ) || helperText || description ;
37
37
38
38
return (
39
39
< FormFieldGrid { ...FormFieldGridProps } >
@@ -52,7 +52,7 @@ export const Switch = (props) => {
52
52
label = { < FormLabel { ...FormLabelProps } > { input . checked ? onText || label : offText || label } </ FormLabel > }
53
53
{ ...FormControlLabelProps }
54
54
/>
55
- { ( invalid || text ) && < FormHelperText { ...FormHelperTextProps } > { invalid || text } </ FormHelperText > }
55
+ { text && < FormHelperText { ...FormHelperTextProps } > { text } </ FormHelperText > }
56
56
</ FormGroup >
57
57
</ FormControl >
58
58
</ FormFieldGrid >
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ const TextField = (props) => {
31
31
{ ...input }
32
32
fullWidth
33
33
error = { ! ! invalid }
34
- helperText = { invalid || helperText || description }
34
+ helperText = { invalid || ( ( meta . touched || validateOnMount ) && meta . warning ) || helperText || description }
35
35
disabled = { isDisabled }
36
36
label = { label }
37
37
placeholder = { placeholder }
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ const Textarea = (props) => {
30
30
{ ...input }
31
31
fullWidth
32
32
error = { ! ! invalid }
33
- helperText = { invalid || helperText || description }
33
+ helperText = { invalid || ( ( meta . touched || validateOnMount ) && meta . warning ) || helperText || description }
34
34
disabled = { isDisabled }
35
35
label = { label }
36
36
placeholder = { placeholder }
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const TimePicker = (props) => {
34
34
fullWidth
35
35
margin = "normal"
36
36
label = { label }
37
- helperText = { invalid || helperText || description }
37
+ helperText = { invalid || ( ( meta . touched || validateOnMount ) && meta . warning ) || helperText || description }
38
38
disabled = { isDisabled || isReadOnly }
39
39
placeholder = { placeholder }
40
40
required = { isRequired }
You can’t perform that action at this time.
0 commit comments