File tree Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const classNames = require('classnames');
19
19
20
20
// for unit testing only
21
21
export const RawConfiguredField = ( {
22
+ widget,
22
23
data,
23
24
type,
24
25
descriptionText,
@@ -40,6 +41,7 @@ export const RawConfiguredField = ({
40
41
const isCustomComponent = type === 'null' || hasCustomComponent ;
41
42
const classes = fieldStyles ( ) ;
42
43
const FormRoot = isCustomComponent ? FormGroup : FormControl ;
44
+ const newLabel = widget === 'radio' ? classes . radioLabel : classes . normalLabel
43
45
return (
44
46
< FormRoot
45
47
id = { `${ htmlid } -formControl` }
@@ -50,7 +52,7 @@ export const RawConfiguredField = ({
50
52
LabelComponent && title && ! isCustomComponent && (
51
53
< LabelComponent
52
54
id = { `${ htmlid } -labelControl` }
53
- className = { descriptionText ? classes . customLabel : classes . normalLabel }
55
+ className = { descriptionText ? classes . customLabel : newLabel }
54
56
style = { activeCompColor ? { left : 41 , top : - 8 } : { } }
55
57
{ ...labelComponentProps }
56
58
>
@@ -88,6 +90,7 @@ export const RawConfiguredField = ({
88
90
< FormHelperText
89
91
error = { ! isEmpty ( hasInlineError ) || undefined }
90
92
id = { `${ id } -help` }
93
+ style = { { marginLeft : 0 , marginRight : 0 } }
91
94
>
92
95
{ helpText }
93
96
</ FormHelperText >
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export default (props: FieldProps) => {
23
23
isCustomComponent,
24
24
} = configureComponent ( { ...props , htmlid } ) ;
25
25
26
+ const widget = uiSchema [ 'ui:widget' ] ;
26
27
const options = uiSchema [ 'ui:options' ] || uiSchema [ 'ui:props' ] ;
27
28
const descriptionText = uiSchema && uiSchema [ 'ui:description' ] ;
28
29
const activeCompColor = uiSchema && uiSchema [ 'ui:activeCompColor' ] ;
@@ -62,6 +63,7 @@ export default (props: FieldProps) => {
62
63
isCustomComponent = { isCustomComponent }
63
64
hasError = { validation && validation . length }
64
65
hasInlineError = { hasInlineError }
66
+ widget = { widget }
65
67
/>
66
68
) ;
67
69
} ;
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ export default makeStyles((theme: Theme) => createStyles({
26
26
left : 8 ,
27
27
top : 8 ,
28
28
} ,
29
+ radioLabel : {
30
+ left : 1 ,
31
+ top : 8 ,
32
+ } ,
29
33
customLabel : {
30
34
'left' : 10 ,
31
35
'transform' : 'translate(0, 31px) scale(1)' ,
Original file line number Diff line number Diff line change 1
1
import { ReactElement } from 'react' ;
2
2
3
3
export type ConfiguredFieldProps = {
4
+ widget : string ;
4
5
data : any ;
5
6
type : string ;
6
7
descriptionText : string ;
You can’t perform that action at this time.
0 commit comments