@@ -24,18 +24,9 @@ import genVariantsStyle from './variants';
24
24
export type { ComponentToken , PanelComponentToken , PickerPanelToken } ;
25
25
export { initPickerPanelToken , initPanelComponentToken , genPanelStyle } ;
26
26
27
- const genPickerPadding = (
28
- token : PickerToken ,
29
- inputHeight : number ,
30
- fontHeight : number ,
31
- paddingHorizontal : number ,
32
- ) : CSSObject => {
33
- const height = token . calc ( fontHeight ) . add ( 2 ) . equal ( ) ;
34
- const paddingTop = token . max ( token . calc ( inputHeight ) . sub ( height ) . div ( 2 ) . equal ( ) , 0 ) ;
35
- const paddingBottom = token . max ( token . calc ( inputHeight ) . sub ( height ) . sub ( paddingTop ) . equal ( ) , 0 ) ;
36
-
27
+ const genPickerPadding = ( paddingBlock : number , paddingInline : number ) : CSSObject => {
37
28
return {
38
- padding : `${ unit ( paddingTop ) } ${ unit ( paddingHorizontal ) } ${ unit ( paddingBottom ) } ` ,
29
+ padding : `${ unit ( paddingBlock ) } ${ unit ( paddingInline ) } ` ,
39
30
} ;
40
31
} ;
41
32
@@ -63,7 +54,6 @@ const genPickerStyle: GenerateStyle<PickerToken> = (token) => {
63
54
const {
64
55
componentCls,
65
56
antCls,
66
- controlHeight,
67
57
paddingInline,
68
58
lineWidth,
69
59
lineType,
@@ -72,8 +62,10 @@ const genPickerStyle: GenerateStyle<PickerToken> = (token) => {
72
62
motionDurationMid,
73
63
colorTextDisabled,
74
64
colorTextPlaceholder,
75
- controlHeightLG,
76
65
fontSizeLG,
66
+ inputFontSizeLG,
67
+ fontSizeSM,
68
+ inputFontSizeSM,
77
69
controlHeightSM,
78
70
paddingInlineSM,
79
71
paddingXS,
@@ -95,15 +87,14 @@ const genPickerStyle: GenerateStyle<PickerToken> = (token) => {
95
87
presetsMaxWidth,
96
88
boxShadowPopoverArrow,
97
89
fontHeight,
98
- fontHeightLG,
99
90
lineHeightLG,
100
91
} = token ;
101
92
102
93
return [
103
94
{
104
95
[ componentCls ] : {
105
96
...resetComponent ( token ) ,
106
- ...genPickerPadding ( token , controlHeight , fontHeight , paddingInline ) ,
97
+ ...genPickerPadding ( token . paddingBlock , token . paddingInline ) ,
107
98
position : 'relative' ,
108
99
display : 'inline-flex' ,
109
100
alignItems : 'center' ,
@@ -128,7 +119,7 @@ const genPickerStyle: GenerateStyle<PickerToken> = (token) => {
128
119
display : 'inline-block' ,
129
120
width : '100%' ,
130
121
color : 'inherit' ,
131
- fontSize : token . fontSize ,
122
+ fontSize : token . inputFontSize ?? token . fontSize ,
132
123
lineHeight : token . lineHeight ,
133
124
transition : `all ${ motionDurationMid } ` ,
134
125
...genPlaceholderStyle ( colorTextPlaceholder ) ,
@@ -164,16 +155,18 @@ const genPickerStyle: GenerateStyle<PickerToken> = (token) => {
164
155
165
156
// Size
166
157
'&-large' : {
167
- ...genPickerPadding ( token , controlHeightLG , fontHeightLG , paddingInline ) ,
168
-
158
+ ...genPickerPadding ( token . paddingBlockLG , token . paddingInlineLG ) ,
169
159
[ `${ componentCls } -input > input` ] : {
170
- fontSize : fontSizeLG ,
160
+ fontSize : inputFontSizeLG ?? fontSizeLG ,
171
161
lineHeight : lineHeightLG ,
172
162
} ,
173
163
} ,
174
164
175
165
'&-small' : {
176
- ...genPickerPadding ( token , controlHeightSM , fontHeight , paddingInlineSM ) ,
166
+ ...genPickerPadding ( token . paddingBlockSM , token . paddingInlineSM ) ,
167
+ [ `${ componentCls } -input > input` ] : {
168
+ fontSize : inputFontSizeSM ?? fontSizeSM ,
169
+ } ,
177
170
} ,
178
171
179
172
[ `${ componentCls } -suffix` ] : {
0 commit comments