@@ -23,28 +23,36 @@ const CInput = props => {
23
23
valid,
24
24
invalid,
25
25
plaintext,
26
- elementSize,
26
+ size,
27
+ sizeHtml,
27
28
...attributes
28
29
} = props
29
30
30
31
// render
31
32
const classes = mapToCssModules (
32
33
classNames (
33
34
plaintext ? 'form-control-plaintext' : 'form-control' ,
34
- elementSize && `form-control-${ elementSize } ` ,
35
+ size && `form-control-${ size } ` ,
35
36
invalid && 'is-invalid' ,
36
37
valid && 'is-valid' ,
37
38
className
38
39
) , cssModule )
39
40
40
- return < input className = { classes } type = { type } { ...attributes } ref = { innerRef } />
41
+ return < input
42
+ className = { classes }
43
+ type = { type }
44
+ { ...attributes }
45
+ size = { sizeHtml }
46
+ ref = { innerRef }
47
+ />
41
48
}
42
49
43
50
CInput . propTypes = {
44
51
...commonPropTypes ,
45
52
plaintext : PropTypes . bool ,
46
53
type : PropTypes . string ,
47
- elementSize : PropTypes . string
54
+ size : PropTypes . string ,
55
+ sizeHtml : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] )
48
56
} ;
49
57
50
58
CInput . defaultProps = {
@@ -154,7 +162,8 @@ const CSelect = props => {
154
162
innerRef,
155
163
valid,
156
164
invalid,
157
- elementSize,
165
+ size,
166
+ sizeHtml,
158
167
custom,
159
168
...attributes
160
169
} = props
@@ -163,19 +172,24 @@ const CSelect = props => {
163
172
const baseClass = custom ? 'custom-select' : 'form-control'
164
173
const classes = mapToCssModules ( classNames (
165
174
baseClass ,
166
- elementSize && `${ baseClass } -${ elementSize } ` ,
175
+ size && `${ baseClass } -${ size } ` ,
167
176
invalid && 'is-invalid' ,
168
177
valid && 'is-valid' ,
169
178
className
170
179
) , cssModule )
171
180
172
- return < select className = { classes } { ...attributes } ref = { innerRef } />
181
+ return < select
182
+ className = { classes }
183
+ { ...attributes }
184
+ size = { sizeHtml }
185
+ ref = { innerRef }
186
+ />
173
187
}
174
188
175
189
CSelect . propTypes = {
176
190
...commonPropTypes ,
177
- elementSize : PropTypes . string ,
178
-
191
+ size : PropTypes . string ,
192
+ sizeHtml : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] )
179
193
} ;
180
194
181
195
export {
0 commit comments