@@ -14,53 +14,53 @@ import { trans } from "i18n";
14
14
import { fixOldInputCompData } from "../textInputComp/textInputConstants" ;
15
15
import { migrateOldData } from "comps/generators/simpleGenerators" ;
16
16
17
- const getStyle = ( style : RadioStyleType ) => {
17
+ const getStyle = ( style : RadioStyleType , inputFieldStyle ?: RadioStyleType ) => {
18
18
return css `
19
19
.ant-radio-wrapper : not (.ant-radio-wrapper-disabled ) {
20
- color : ${ style . staticText } ;
20
+ color : ${ inputFieldStyle ? .staticText } ;
21
21
// height: 22px;
22
22
max-width : calc (100% - 8px );
23
- padding : ${ style . padding } ;
23
+ padding : ${ inputFieldStyle ? .padding } ;
24
24
span : not (.ant-radio ) {
25
25
${ EllipsisTextCss } ;
26
- font- family: ${ style . fontFamily } ;
27
- font- size: ${ style . textSize } ;
28
- font- weight: ${ style . textWeight } ;
29
- font- style: ${ style . fontStyle } ;
30
- text- transfor m: ${ style . textTransform } ;
31
- text- decor ation: ${ style . textDecoration } ;
26
+ font- family: ${ inputFieldStyle ? .fontFamily } ;
27
+ font- size: ${ inputFieldStyle ? .textSize } ;
28
+ font- weight: ${ inputFieldStyle ? .textWeight } ;
29
+ font- style: ${ inputFieldStyle ? .fontStyle } ;
30
+ text- transfor m: ${ inputFieldStyle ? .textTransform } ;
31
+ text- decor ation: ${ inputFieldStyle ? .textDecoration } ;
32
32
}
33
33
34
34
.ant-radio-checked {
35
35
.ant-radio-inner {
36
- background-color : ${ style . checkedBackground } ;
37
- border-color : ${ style . checkedBackground } ;
36
+ background-color : ${ inputFieldStyle ? .checkedBackground } ;
37
+ border-color : ${ inputFieldStyle ?. uncheckedBorder } ;
38
38
}
39
39
40
40
& ::after {
41
- border-color : ${ style . checkedBackground } ;
41
+ border-color : ${ inputFieldStyle ?. uncheckedBorder } ;
42
42
}
43
43
}
44
44
45
45
.ant-radio-inner {
46
- background-color : ${ style . uncheckedBackground } ;
47
- border-color : ${ style . uncheckedBorder } ;
48
- border-width : ${ style . borderWidth } ;
46
+ background-color : ${ inputFieldStyle ? .uncheckedBackground } ;
47
+ border-color : ${ inputFieldStyle ? .uncheckedBorder } ;
48
+ border-width : ${ inputFieldStyle ? .borderWidth } ;
49
49
& ::after {
50
- background-color : ${ style . checked } ;
50
+ background-color : ${ inputFieldStyle ? .checked } ;
51
51
}
52
52
}
53
53
54
54
& : hover .ant-radio-inner ,
55
55
.ant-radio : hover .ant-radio-inner ,
56
56
.ant-radio-input + ant-radio-inner {
57
- background-color : ${ style . hoverBackground ? style . hoverBackground :'#ffff' } ;
57
+ background-color : ${ inputFieldStyle ? .hoverBackground ? inputFieldStyle ? .hoverBackground :'#ffff' } ;
58
58
}
59
59
60
60
& : hover .ant-radio-inner ,
61
61
.ant-radio : hover .ant-radio-inner ,
62
62
.ant-radio-input : focus + .ant-radio-inner {
63
- border-color : ${ style . checkedBackground } ;
63
+ border-color : ${ inputFieldStyle ?. uncheckedBorder } ;
64
64
}
65
65
}
66
66
` ;
@@ -69,11 +69,12 @@ const getStyle = (style: RadioStyleType) => {
69
69
const Radio = styled ( AntdRadioGroup ) < {
70
70
$style : RadioStyleType ;
71
71
$layout : ValueFromOption < typeof RadioLayoutOptions > ;
72
+ $inputFieldStyle :RadioStyleType
72
73
} > `
73
74
width: 100%;
74
75
min-height: 32px;
75
76
76
- ${ ( props ) => props . $style && getStyle ( props . $style ) }
77
+ ${ ( props ) => props . $style && getStyle ( props . $style , props . $inputFieldStyle ) }
77
78
${ ( props ) => {
78
79
if ( props . $layout === "horizontal" ) {
79
80
return css `
@@ -112,6 +113,7 @@ let RadioBasicComp = (function () {
112
113
disabled = { props . disabled }
113
114
value = { props . value . value }
114
115
$style = { props . style }
116
+ $inputFieldStyle = { props . inputFieldStyle }
115
117
$layout = { props . layout }
116
118
onChange = { ( e ) => {
117
119
handleChange ( e . target . value ) ;
0 commit comments