File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed
packages/mui-component-mapper/src/form-fields Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -132,19 +132,23 @@ const selectComponent = ({
132
132
{ ...rest }
133
133
/> ) ,
134
134
[ componentTypes . SWITCH ] : ( ) => (
135
- < FormGroup row >
136
- < FormControlLabel
137
- control = { < Switch
138
- { ...rest }
139
- { ...input }
140
- readOnly = { isReadOnly }
141
- disabled = { isDisabled || isReadOnly }
142
- checked = { ! ! input . value }
143
- onChange = { ( { target : { checked } } ) => input . onChange ( checked ) }
144
- /> }
145
- label = { label }
146
- />
147
- </ FormGroup > ) ,
135
+ < FormControl required = { isRequired } error = { invalid } component = "fieldset" >
136
+ < FormGroup >
137
+ < FormControlLabel
138
+ control = { < Switch
139
+ { ...rest }
140
+ { ...input }
141
+ readOnly = { isReadOnly }
142
+ disabled = { isDisabled || isReadOnly }
143
+ checked = { ! ! input . value }
144
+ onChange = { ( { target : { checked } } ) => input . onChange ( checked ) }
145
+ /> }
146
+ label = { input . value ? onText || label : offText || label }
147
+ />
148
+ { ( invalid || helperText ) && < FormHelperText > { invalid || helperText } </ FormHelperText > }
149
+ </ FormGroup >
150
+ </ FormControl >
151
+ ) ,
148
152
[ componentTypes . DATE_PICKER ] : ( ) => (
149
153
< MuiPickersUtilsProvider locale = { locale } utils = { MomentUtils } >
150
154
< DatePicker
You can’t perform that action at this time.
0 commit comments