77import { BoolControl } from "../../controls/boolControl" ;
88import { LabelControl } from "../../controls/labelControl" ;
99import { BoolCodeControl , StringControl } from "../../controls/codeControl" ;
10- import { PaddingControl } from "../../controls/paddingControl" ;
10+ import { PaddingControl } from "../../controls/paddingControl" ;
1111import { MarginControl } from "../../controls/marginControl" ;
1212import {
1313 ControlNode ,
@@ -27,14 +27,17 @@ import {
2727 SelectInputValidationChildren ,
2828 SelectInputValidationSection ,
2929} from "./selectInputConstants" ;
30- import { formDataChildren , FormDataPropertyView } from "../formComp/formDataConstants" ;
30+ import {
31+ formDataChildren ,
32+ FormDataPropertyView ,
33+ } from "../formComp/formDataConstants" ;
3134import {
3235 CascaderStyleType ,
3336 MultiSelectStyleType ,
3437 SelectStyleType ,
3538 TreeSelectStyleType ,
3639 widthCalculator ,
37- heightCalculator
40+ heightCalculator ,
3841} from "comps/controls/styleControlConstants" ;
3942import { stateComp , withDefault } from "../../generators" ;
4043import {
@@ -55,34 +58,39 @@ import { useContext } from "react";
5558import { EditorContext } from "comps/editorState" ;
5659
5760export const getStyle = (
58- style : SelectStyleType | MultiSelectStyleType | CascaderStyleType | TreeSelectStyleType
61+ style :
62+ | SelectStyleType
63+ | MultiSelectStyleType
64+ | CascaderStyleType
65+ | TreeSelectStyleType
5966) => {
6067 return css `
6168 &.ant-select .ant-select-selector,
6269 &.ant-select-multiple .ant-select-selection-item {
6370 border-radius: ${ style . radius } ;
64- padding: ${ style . padding } ;
65- height: auto;
66- }
67- .ant-select-selection-search {
68- padding: ${ style . padding } ;
69- }
70- .ant-select-selector::after,
71- .ant-select-selection-placeholder,
72- .ant-select-selection-item {
71+ padding: ${ style . padding } ;
72+ height: auto;
73+ }
74+ .ant-select-selection-search {
75+ padding: ${ style . padding } ;
76+ }
77+ .ant-select-selector::after,
78+ .ant-select-selection-placeholder,
79+ .ant-select-selection-item {
7380 line-height: 1.5715 !important;
7481 }
7582
7683 &.ant-select:not(.ant-select-disabled) {
7784 color: ${ style . text } ;
78- .ant-select-selection-placeholder,
79- .ant-select-selection-item {
80- line-height: 1.5715 !important;
85+ .ant-select-selection-placeholder,
86+ .ant-select-selection-item {
87+ line-height: 1.5715 !important;
8188 }
8289 .ant-select-selection-placeholder,
8390 &.ant-select-single.ant-select-open .ant-select-selection-item {
8491 color: ${ style . text } ;
8592 opacity: 0.4;
93+ width: 100%;
8694 }
8795
8896 .ant-select-selector {
@@ -103,16 +111,16 @@ export const getStyle = (
103111 color: ${ style . text === "#222222"
104112 ? "#8B8FA3"
105113 : isDarkColor ( style . text )
106- ? lightenColor ( style . text , 0.2 )
107- : style . text } ;
114+ ? lightenColor ( style . text , 0.2 )
115+ : style . text } ;
108116 }
109117
110118 .ant-select-clear:hover {
111119 color: ${ style . text === "#222222"
112120 ? "#8B8FA3"
113121 : isDarkColor ( style . text )
114- ? lightenColor ( style . text , 0.1 )
115- : style . text } ;
122+ ? lightenColor ( style . text , 0.1 )
123+ : style . text } ;
116124 }
117125
118126 &.ant-select-multiple .ant-select-selection-item {
@@ -160,7 +168,9 @@ const getDropdownStyle = (style: MultiSelectStyleType) => {
160168 ` ;
161169} ;
162170
163- const Select = styled ( AntdSelect ) < { $style : SelectStyleType & MultiSelectStyleType } > `
171+ const Select = styled ( AntdSelect ) < {
172+ $style : SelectStyleType & MultiSelectStyleType ;
173+ } > `
164174 width: 100%;
165175
166176 ${ ( props ) => props . $style && getStyle ( props . $style ) }
@@ -169,7 +179,7 @@ const Select = styled(AntdSelect)<{ $style: SelectStyleType & MultiSelectStyleTy
169179const DropdownStyled = styled . div < { $style : MultiSelectStyleType } > `
170180 ${ ( props ) => props . $style && getDropdownStyle ( props . $style ) }
171181 .ant-select-item-option-content {
172- ${ ( props ) => `padding: ${ props . $style . padding } ` } ;
182+ ${ ( props ) => `padding: ${ props . $style . padding } ` } ;
173183 }
174184 .option-label img {
175185 min-width: 14px;
@@ -197,7 +207,7 @@ export const SelectChildrenMap = {
197207 inputValue : stateComp < string > ( "" ) , // user's input value when search
198208 showSearch : BoolControl . DEFAULT_TRUE ,
199209 viewRef : RefControl < BaseSelectRef > ,
200- margin : MarginControl ,
210+ margin : MarginControl ,
201211 padding : PaddingControl ,
202212 ...SelectInputValidationChildren ,
203213 ...formDataChildren ,
@@ -221,9 +231,13 @@ export const SelectUIView = (
221231 placeholder = { props . placeholder }
222232 value = { props . value }
223233 showSearch = { props . showSearch }
224- filterOption = { ( input , option ) => option ?. label . toLowerCase ( ) . includes ( input . toLowerCase ( ) ) }
234+ filterOption = { ( input , option ) =>
235+ option ?. label . toLowerCase ( ) . includes ( input . toLowerCase ( ) )
236+ }
225237 dropdownRender = { ( originNode : ReactNode ) => (
226- < DropdownStyled $style = { props . style as MultiSelectStyleType } > { originNode } </ DropdownStyled >
238+ < DropdownStyled $style = { props . style as MultiSelectStyleType } >
239+ { originNode }
240+ </ DropdownStyled >
227241 ) }
228242 dropdownStyle = { {
229243 padding : 0 ,
@@ -250,8 +264,8 @@ export const SelectUIView = (
250264 key = { option . value }
251265 >
252266 < Wrapper className = "option-label" >
253- { props . options . findIndex ( ( option ) => hasIcon ( option . prefixIcon ) ) > - 1 &&
254- option . prefixIcon }
267+ { props . options . findIndex ( ( option ) => hasIcon ( option . prefixIcon ) ) >
268+ - 1 && option . prefixIcon }
255269 { < span > { option . label } </ span > }
256270 </ Wrapper >
257271 </ Select . Option >
@@ -273,24 +287,28 @@ export const SelectPropertyView = (
273287 < >
274288 < Section name = { sectionNames . basic } >
275289 { children . options . propertyView ( { } ) }
276- { children . defaultValue . propertyView ( { label : trans ( "prop.defaultValue" ) } ) }
290+ { children . defaultValue . propertyView ( {
291+ label : trans ( "prop.defaultValue" ) ,
292+ } ) }
277293 { placeholderPropertyView ( children ) }
278294 </ Section >
279295
280296 { [ "logic" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
281- < > < >
282- < SelectInputValidationSection { ...children } />
283- < FormDataPropertyView { ...children } />
284- </ > < Section name = { sectionNames . interaction } >
297+ < >
298+ < >
299+ < SelectInputValidationSection { ...children } />
300+ < FormDataPropertyView { ...children } />
301+ </ >
302+ < Section name = { sectionNames . interaction } >
285303 { children . onEvent . getPropertyView ( ) }
286304 { disabledPropertyView ( children ) }
287305 { hiddenPropertyView ( children ) }
288- </ Section > </ >
306+ </ Section >
307+ </ >
289308 ) }
290309
291- { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
292- children . label . getPropertyView ( )
293- ) }
310+ { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) &&
311+ children . label . getPropertyView ( ) }
294312
295313 { [ "logic" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
296314 < Section name = { sectionNames . advanced } >
@@ -299,12 +317,17 @@ export const SelectPropertyView = (
299317 </ Section >
300318 ) }
301319
302- { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
320+ { [ "layout" , "both" ] . includes (
321+ useContext ( EditorContext ) . editorModeStatus
322+ ) && (
303323 < Section name = { sectionNames . style } >
304324 { children . style . getPropertyView ( ) }
305325 </ Section >
306326 ) }
307327 </ >
308328) ;
309329
310- export const baseSelectRefMethods = refMethods < BaseSelectRef > ( [ focusMethod , blurMethod ] ) ;
330+ export const baseSelectRefMethods = refMethods < BaseSelectRef > ( [
331+ focusMethod ,
332+ blurMethod ,
333+ ] ) ;
0 commit comments