@@ -12,7 +12,7 @@ import {
12
12
NameConfigRequired ,
13
13
withExposingConfigs ,
14
14
} from "comps/generators/withExposing" ;
15
- import styled from "styled-components" ;
15
+ import styled , { css } from "styled-components" ;
16
16
import { UICompBuilder } from "../../generators" ;
17
17
import { FormDataPropertyView } from "../formComp/formDataConstants" ;
18
18
import { jsonControl } from "comps/controls/codeControl" ;
@@ -56,8 +56,38 @@ import {
56
56
componentSize ,
57
57
} from "./autoCompleteConstants" ;
58
58
59
+ // const InputStyle = styled(Input)<{ $style: InputLikeStyleType }>`
60
+ // ${(props) => props.$style && getStyle(props.$style) }
61
+ // `;
62
+
59
63
const InputStyle = styled ( Input ) < { $style : InputLikeStyleType } > `
60
- ${ ( props ) => props . $style && getStyle ( props . $style ) }
64
+ ${ ( props ) => css `
65
+ ${ getStyle ( props . $style ) }
66
+ .ant-select-selection-search-input {
67
+ height : 100% ;
68
+ }
69
+ input {
70
+ padding : ${ props . style ?. padding }
71
+ }
72
+ ` }
73
+ ` ;
74
+
75
+ const CustomStyledSearch = styled ( AntInput . Search ) < { $style : InputLikeStyleType } > `
76
+ ${ ( props ) => css `
77
+ padding : 0 ;
78
+ input .ant-input {
79
+ padding : ${ props . $style ?. padding } ;
80
+ }
81
+ .ant-btn .ant-input-search-button {
82
+ height : 100% ;
83
+ padding : ${ props . $style ?. padding } !important ;
84
+ padding-left : 15px !important ;
85
+ padding-right : 15px !important ;
86
+ .ant-btn-icon {
87
+ line-height : 28px ;
88
+ }
89
+ }
90
+ ` }
61
91
` ;
62
92
63
93
const childrenMap = {
@@ -156,12 +186,6 @@ let AutoCompleteCompBase = (function () {
156
186
< AutoComplete
157
187
disabled = { props . disabled }
158
188
value = { searchtext }
159
- style = { {
160
- width : "100%" ,
161
- height : "100%" ,
162
- padding : props . style . padding ,
163
- margin : props . style . margin ,
164
- } }
165
189
options = { items }
166
190
onChange = { ( value : string , option ) => {
167
191
props . valueInItems . onChange ( false ) ;
@@ -259,20 +283,21 @@ let AutoCompleteCompBase = (function () {
259
283
} }
260
284
>
261
285
{ autoCompleteType === "AntDesign" ? (
262
- < AntInput . Search
286
+ < CustomStyledSearch
263
287
placeholder = { placeholder }
264
288
enterButton = { autocompleteIconColor === "blue" }
265
289
allowClear = { props . allowClear }
266
290
ref = { props . viewRef }
267
291
onPressEnter = { undefined }
268
292
status = { getValidate ( validateState ) }
269
293
onSubmit = { ( ) => props . onEvent ( "submit" ) }
294
+ $style = { props . style }
270
295
/>
271
296
) : (
272
297
< InputStyle
273
- style = { {
274
- height : componentSize === "small" ? "30px" : "38px" ,
275
- } }
298
+ // style={{
299
+ // height: componentSize === "small" ? "30px" : "38px",
300
+ // }}
276
301
ref = { props . viewRef }
277
302
placeholder = { placeholder }
278
303
allowClear = { props . allowClear }
@@ -299,11 +324,6 @@ let AutoCompleteCompBase = (function () {
299
324
label : trans ( "autoComplete.type" ) ,
300
325
radioButton : true ,
301
326
} ) }
302
- { allowClearPropertyView ( children ) }
303
- { children . componentSize . propertyView ( {
304
- label : trans ( "autoComplete.componentSize" ) ,
305
- radioButton : true ,
306
- } ) }
307
327
{ children . autoCompleteType . getView ( ) === "AntDesign" &&
308
328
children . autocompleteIconColor . propertyView ( {
309
329
label : trans ( "button.prefixIcon" ) ,
@@ -318,6 +338,7 @@ let AutoCompleteCompBase = (function () {
318
338
children . suffixIcon . propertyView ( {
319
339
label : trans ( "button.suffixIcon" ) ,
320
340
} ) }
341
+ { allowClearPropertyView ( children ) }
321
342
</ Section >
322
343
< Section name = { trans ( "autoComplete.SectionDataName" ) } >
323
344
{ children . items . propertyView ( {
0 commit comments