1
- import { Input , Section , sectionNames } from 'lowcoder-design' ;
2
- import { BoolControl } from 'comps/controls/boolControl' ;
3
- import { styleControl } from 'comps/controls/styleControl' ;
4
- import {
5
- AnimationStyle ,
6
- InputFieldStyle ,
7
- InputLikeStyle ,
8
- InputLikeStyleType ,
9
- LabelStyle ,
10
- LabelStyleType ,
11
- } from 'comps/controls/styleControlConstants' ;
1
+ import { Input , Section , sectionNames } from "lowcoder-design" ;
2
+ import { BoolControl } from "comps/controls/boolControl" ;
3
+ import { styleControl } from "comps/controls/styleControl" ;
4
+ import { AnimationStyle , InputFieldStyle , InputLikeStyle , InputLikeStyleType , LabelStyle , LabelStyleType } from "comps/controls/styleControlConstants" ;
12
5
import {
13
6
NameConfig ,
14
7
NameConfigPlaceHolder ,
15
8
NameConfigRequired ,
16
- } from ' comps/generators/withExposing' ;
17
- import styled from ' styled-components' ;
18
- import { UICompBuilder } from ' ../../generators' ;
19
- import { FormDataPropertyView } from ' ../formComp/formDataConstants' ;
9
+ } from " comps/generators/withExposing" ;
10
+ import styled from " styled-components" ;
11
+ import { UICompBuilder } from " ../../generators" ;
12
+ import { FormDataPropertyView } from " ../formComp/formDataConstants" ;
20
13
import {
21
14
fixOldInputCompData ,
22
15
getStyle ,
@@ -27,27 +20,27 @@ import {
27
20
TextInputInteractionSection ,
28
21
TextInputValidationSection ,
29
22
useTextInputProps ,
30
- } from ' ./textInputConstants' ;
23
+ } from " ./textInputConstants" ;
31
24
import {
32
25
allowClearPropertyView ,
33
26
hiddenPropertyView ,
34
27
readOnlyPropertyView ,
35
- } from ' comps/utils/propertyUtils' ;
36
- import { trans } from ' i18n' ;
37
- import { IconControl } from ' comps/controls/iconControl' ;
38
- import { hasIcon } from ' comps/utils' ;
39
- import { InputRef } from ' antd/es/input' ;
40
- import { RefControl } from ' comps/controls/refControl' ;
41
- import { migrateOldData , withDefault } from ' comps/generators/simpleGenerators' ;
28
+ } from " comps/utils/propertyUtils" ;
29
+ import { trans } from " i18n" ;
30
+ import { IconControl } from " comps/controls/iconControl" ;
31
+ import { hasIcon } from " comps/utils" ;
32
+ import { InputRef } from " antd/es/input" ;
33
+ import { RefControl } from " comps/controls/refControl" ;
34
+ import { migrateOldData , withDefault } from " comps/generators/simpleGenerators" ;
42
35
43
- import React , { useContext } from ' react' ;
44
- import { EditorContext } from ' comps/editorState' ;
36
+ import React , { useContext } from " react" ;
37
+ import { EditorContext } from " comps/editorState" ;
45
38
46
39
/**
47
40
* Input Comp
48
41
*/
49
42
50
- const InputStyle = styled ( Input ) < { $style : InputLikeStyleType } > `
43
+ const InputStyle = styled ( Input ) < { $style : InputLikeStyleType } > `
51
44
${ ( props ) => props . $style && getStyle ( props . $style ) }
52
45
` ;
53
46
@@ -81,8 +74,8 @@ let InputBasicComp = new UICompBuilder(childrenMap, (props) => {
81
74
) ,
82
75
style : props . style ,
83
76
labelStyle : props . labelStyle ,
84
- inputFieldStyle : props . inputFieldStyle ,
85
- animationStyle : props . animationStyle ,
77
+ inputFieldStyle :props . inputFieldStyle ,
78
+ animationStyle :props . animationStyle ,
86
79
...validateState ,
87
80
} ) ;
88
81
} )
@@ -92,64 +85,44 @@ let InputBasicComp = new UICompBuilder(childrenMap, (props) => {
92
85
< TextInputBasicSection { ...children } />
93
86
< FormDataPropertyView { ...children } />
94
87
95
- { [ ' layout' , ' both' ] . includes (
96
- useContext ( EditorContext ) . editorModeStatus
97
- ) && children . label . getPropertyView ( ) }
88
+ { [ " layout" , " both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
89
+ children . label . getPropertyView ( )
90
+ ) }
98
91
99
- { [ 'logic' , 'both' ] . includes (
100
- useContext ( EditorContext ) . editorModeStatus
101
- ) && (
102
- < >
103
- < TextInputInteractionSection { ...children } />
104
- < Section name = { sectionNames . layout } >
105
- { hiddenPropertyView ( children ) }
106
- </ Section >
92
+ { [ "logic" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
93
+ < > < TextInputInteractionSection { ...children } />
94
+ < Section name = { sectionNames . layout } > { hiddenPropertyView ( children ) } </ Section >
107
95
< Section name = { sectionNames . advanced } >
108
- { children . prefixIcon . propertyView ( {
109
- label : trans ( 'button.prefixIcon' ) ,
110
- } ) }
111
- { children . suffixIcon . propertyView ( {
112
- label : trans ( 'button.suffixIcon' ) ,
113
- } ) }
114
- { children . showCount . propertyView ( {
115
- label : trans ( 'prop.showCount' ) ,
116
- } ) }
96
+ { children . prefixIcon . propertyView ( { label : trans ( "button.prefixIcon" ) } ) }
97
+ { children . suffixIcon . propertyView ( { label : trans ( "button.suffixIcon" ) } ) }
98
+ { children . showCount . propertyView ( { label : trans ( "prop.showCount" ) } ) }
117
99
{ allowClearPropertyView ( children ) }
118
100
{ readOnlyPropertyView ( children ) }
119
101
</ Section >
120
102
< TextInputValidationSection { ...children } />
121
103
</ >
122
104
) }
123
- { [ 'layout' , 'both' ] . includes (
124
- useContext ( EditorContext ) . editorModeStatus
125
- ) && (
105
+ { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
126
106
< >
127
- < Section name = { sectionNames . style } >
128
- { children . style . getPropertyView ( ) }
129
- </ Section >
130
- < Section name = { sectionNames . labelStyle } >
131
- { children . labelStyle . getPropertyView ( ) }
132
- </ Section >
133
- < Section name = { sectionNames . inputFieldStyle } >
134
- { children . inputFieldStyle . getPropertyView ( ) }
135
- </ Section >
136
- < Section name = { sectionNames . animationStyle } >
137
- { children . animationStyle . getPropertyView ( ) }
138
- </ Section >
107
+ < Section name = { sectionNames . style } > { children . style . getPropertyView ( ) } </ Section >
108
+ < Section name = { sectionNames . labelStyle } > { children . labelStyle . getPropertyView ( ) } </ Section >
109
+ < Section name = { sectionNames . inputFieldStyle } > { children . inputFieldStyle . getPropertyView ( ) } </ Section >
110
+ < Section name = { sectionNames . animationStyle } > { children . animationStyle . getPropertyView ( ) } </ Section >
139
111
</ >
140
112
) }
141
113
</ >
142
114
) ;
143
115
} )
144
116
. setExposeMethodConfigs ( inputRefMethods )
145
117
. setExposeStateConfigs ( [
146
- new NameConfig ( ' value' , trans ( ' export.inputValueDesc' ) ) ,
118
+ new NameConfig ( " value" , trans ( " export.inputValueDesc" ) ) ,
147
119
NameConfigPlaceHolder ,
148
120
NameConfigRequired ,
149
121
...TextInputConfigs ,
150
122
] )
151
123
. build ( ) ;
152
124
125
+
153
126
const InputComp = migrateOldData ( InputBasicComp , fixOldInputCompData ) ;
154
127
155
- export { InputComp } ;
128
+ export { InputComp } ;
0 commit comments