@@ -12,7 +12,7 @@ import {
1212 NameConfigRequired ,
1313 withExposingConfigs ,
1414} from "comps/generators/withExposing" ;
15- import styled from "styled-components" ;
15+ import styled , { css } from "styled-components" ;
1616import { UICompBuilder } from "../../generators" ;
1717import { FormDataPropertyView } from "../formComp/formDataConstants" ;
1818import { jsonControl } from "comps/controls/codeControl" ;
@@ -56,8 +56,38 @@ import {
5656 componentSize ,
5757} from "./autoCompleteConstants" ;
5858
59+ // const InputStyle = styled(Input)<{ $style: InputLikeStyleType }>`
60+ // ${(props) => props.$style && getStyle(props.$style) }
61+ // `;
62+
5963const 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+ ` }
6191` ;
6292
6393const childrenMap = {
@@ -156,12 +186,6 @@ let AutoCompleteCompBase = (function () {
156186 < AutoComplete
157187 disabled = { props . disabled }
158188 value = { searchtext }
159- style = { {
160- width : "100%" ,
161- height : "100%" ,
162- padding : props . style . padding ,
163- margin : props . style . margin ,
164- } }
165189 options = { items }
166190 onChange = { ( value : string , option ) => {
167191 props . valueInItems . onChange ( false ) ;
@@ -259,20 +283,21 @@ let AutoCompleteCompBase = (function () {
259283 } }
260284 >
261285 { autoCompleteType === "AntDesign" ? (
262- < AntInput . Search
286+ < CustomStyledSearch
263287 placeholder = { placeholder }
264288 enterButton = { autocompleteIconColor === "blue" }
265289 allowClear = { props . allowClear }
266290 ref = { props . viewRef }
267291 onPressEnter = { undefined }
268292 status = { getValidate ( validateState ) }
269293 onSubmit = { ( ) => props . onEvent ( "submit" ) }
294+ $style = { props . style }
270295 />
271296 ) : (
272297 < InputStyle
273- style = { {
274- height : componentSize === "small" ? "30px" : "38px" ,
275- } }
298+ // style={{
299+ // height: componentSize === "small" ? "30px" : "38px",
300+ // }}
276301 ref = { props . viewRef }
277302 placeholder = { placeholder }
278303 allowClear = { props . allowClear }
@@ -299,11 +324,6 @@ let AutoCompleteCompBase = (function () {
299324 label : trans ( "autoComplete.type" ) ,
300325 radioButton : true ,
301326 } ) }
302- { allowClearPropertyView ( children ) }
303- { children . componentSize . propertyView ( {
304- label : trans ( "autoComplete.componentSize" ) ,
305- radioButton : true ,
306- } ) }
307327 { children . autoCompleteType . getView ( ) === "AntDesign" &&
308328 children . autocompleteIconColor . propertyView ( {
309329 label : trans ( "button.prefixIcon" ) ,
@@ -318,6 +338,7 @@ let AutoCompleteCompBase = (function () {
318338 children . suffixIcon . propertyView ( {
319339 label : trans ( "button.suffixIcon" ) ,
320340 } ) }
341+ { allowClearPropertyView ( children ) }
321342 </ Section >
322343 < Section name = { trans ( "autoComplete.SectionDataName" ) } >
323344 { children . items . propertyView ( {
0 commit comments