1
- import { default as InputPassword } from ' antd/es/input/Password' ;
2
- import { InputRef } from ' antd/es/input' ;
1
+ import { default as InputPassword } from " antd/es/input/Password" ;
2
+ import { InputRef } from " antd/es/input" ;
3
3
import {
4
4
NameConfig ,
5
5
NameConfigPlaceHolder ,
6
6
NameConfigRequired ,
7
7
withExposingConfigs ,
8
- } from ' comps/generators/withExposing' ;
9
- import { Section , sectionNames } from ' lowcoder-design' ;
10
- import { BoolControl } from ' ../../controls/boolControl' ;
11
- import { dropdownControl } from ' ../../controls/dropdownControl' ;
12
- import { LabelControl } from ' ../../controls/labelControl' ;
13
- import { UICompBuilder , withDefault } from ' ../../generators' ;
14
- import { FormDataPropertyView } from ' ../formComp/formDataConstants' ;
8
+ } from " comps/generators/withExposing" ;
9
+ import { Section , sectionNames } from " lowcoder-design" ;
10
+ import { BoolControl } from " ../../controls/boolControl" ;
11
+ import { dropdownControl } from " ../../controls/dropdownControl" ;
12
+ import { LabelControl } from " ../../controls/labelControl" ;
13
+ import { UICompBuilder , withDefault } from " ../../generators" ;
14
+ import { FormDataPropertyView } from " ../formComp/formDataConstants" ;
15
15
import {
16
16
fixOldInputCompData ,
17
17
getStyle ,
@@ -22,34 +22,28 @@ import {
22
22
TextInputInteractionSection ,
23
23
TextInputValidationOptions ,
24
24
useTextInputProps ,
25
- } from './textInputConstants' ;
26
- import { withMethodExposing } from '../../generators/withMethodExposing' ;
27
- import { styleControl } from 'comps/controls/styleControl' ;
28
- import styled from 'styled-components' ;
29
- import {
30
- AnimationStyle ,
31
- InputFieldStyle ,
32
- InputLikeStyle ,
33
- InputLikeStyleType ,
34
- LabelStyle ,
35
- } from 'comps/controls/styleControlConstants' ;
25
+ } from "./textInputConstants" ;
26
+ import { withMethodExposing } from "../../generators/withMethodExposing" ;
27
+ import { styleControl } from "comps/controls/styleControl" ;
28
+ import styled from "styled-components" ;
29
+ import { AnimationStyle , InputFieldStyle , InputLikeStyle , InputLikeStyleType , LabelStyle } from "comps/controls/styleControlConstants" ;
36
30
import {
37
31
hiddenPropertyView ,
38
32
minLengthPropertyView ,
39
33
readOnlyPropertyView ,
40
34
requiredPropertyView ,
41
35
regexPropertyView ,
42
36
maxLengthPropertyView ,
43
- } from ' comps/utils/propertyUtils' ;
44
- import { trans } from ' i18n' ;
45
- import { IconControl } from ' comps/controls/iconControl' ;
46
- import { hasIcon } from ' comps/utils' ;
47
- import { RefControl } from ' comps/controls/refControl' ;
48
- import React , { useContext } from ' react' ;
49
- import { EditorContext } from ' comps/editorState' ;
50
- import { migrateOldData } from ' comps/generators/simpleGenerators' ;
37
+ } from " comps/utils/propertyUtils" ;
38
+ import { trans } from " i18n" ;
39
+ import { IconControl } from " comps/controls/iconControl" ;
40
+ import { hasIcon } from " comps/utils" ;
41
+ import { RefControl } from " comps/controls/refControl" ;
42
+ import React , { useContext } from " react" ;
43
+ import { EditorContext } from " comps/editorState" ;
44
+ import { migrateOldData } from " comps/generators/simpleGenerators" ;
51
45
52
- const PasswordStyle = styled ( InputPassword ) < {
46
+ const PasswordStyle = styled ( InputPassword ) < {
53
47
$style : InputLikeStyleType ;
54
48
} > `
55
49
${ ( props ) => props . $style && getStyle ( props . $style ) }
@@ -59,14 +53,14 @@ let PasswordTmpComp = (function () {
59
53
const childrenMap = {
60
54
...textInputChildren ,
61
55
viewRef : RefControl < InputRef > ,
62
- label : withDefault ( LabelControl , { text : trans ( ' password.label' ) } ) ,
63
- validationType : dropdownControl ( TextInputValidationOptions , ' Regex' ) ,
56
+ label : withDefault ( LabelControl , { text : trans ( " password.label" ) } ) ,
57
+ validationType : dropdownControl ( TextInputValidationOptions , " Regex" ) ,
64
58
visibilityToggle : BoolControl . DEFAULT_TRUE ,
65
59
prefixIcon : IconControl ,
66
60
style : withDefault ( styleControl ( InputFieldStyle ) , { borderWidth : '1px' } ) ,
67
61
labelStyle : styleControl ( LabelStyle ) ,
68
62
inputFieldStyle : styleControl ( InputLikeStyle ) ,
69
- animationStyle : styleControl ( AnimationStyle ) ,
63
+ animationStyle : styleControl ( AnimationStyle ) ,
70
64
} ;
71
65
return new UICompBuilder ( childrenMap , ( props ) => {
72
66
const [ inputProps , validateState ] = useTextInputProps ( props ) ;
@@ -83,8 +77,8 @@ let PasswordTmpComp = (function () {
83
77
) ,
84
78
style : props . style ,
85
79
labelStyle : props . labelStyle ,
86
- inputFieldStyle : props . inputFieldStyle ,
87
- animationStyle : props . animationStyle ,
80
+ inputFieldStyle :props . inputFieldStyle ,
81
+ animationStyle :props . animationStyle ,
88
82
...validateState ,
89
83
} ) ;
90
84
} )
@@ -94,53 +88,34 @@ let PasswordTmpComp = (function () {
94
88
< TextInputBasicSection { ...children } />
95
89
< FormDataPropertyView { ...children } />
96
90
97
- { [ ' layout' , ' both' ] . includes (
98
- useContext ( EditorContext ) . editorModeStatus
99
- ) && children . label . getPropertyView ( ) }
91
+ { [ " layout" , " both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
92
+ children . label . getPropertyView ( )
93
+ ) }
100
94
101
- { [ 'logic' , 'both' ] . includes (
102
- useContext ( EditorContext ) . editorModeStatus
103
- ) && (
104
- < >
105
- < TextInputInteractionSection { ...children } />
106
- < Section name = { sectionNames . layout } >
107
- { hiddenPropertyView ( children ) }
108
- </ Section >
95
+ { [ "logic" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
96
+ < > < TextInputInteractionSection { ...children } />
97
+ < Section name = { sectionNames . layout } > { hiddenPropertyView ( children ) } </ Section >
109
98
< Section name = { sectionNames . advanced } >
110
99
{ children . visibilityToggle . propertyView ( {
111
- label : trans ( ' password.visibilityToggle' ) ,
100
+ label : trans ( " password.visibilityToggle" ) ,
112
101
} ) }
113
102
{ readOnlyPropertyView ( children ) }
114
- { children . prefixIcon . propertyView ( {
115
- label : trans ( 'button.prefixIcon' ) ,
116
- } ) }
117
- </ Section >
118
- < Section name = { sectionNames . validation } >
103
+ { children . prefixIcon . propertyView ( { label : trans ( "button.prefixIcon" ) } ) }
104
+ </ Section > < Section name = { sectionNames . validation } >
119
105
{ requiredPropertyView ( children ) }
120
106
{ regexPropertyView ( children ) }
121
107
{ minLengthPropertyView ( children ) }
122
108
{ maxLengthPropertyView ( children ) }
123
109
{ children . customRule . propertyView ( { } ) }
124
- </ Section >
125
- </ >
110
+ </ Section > </ >
126
111
) }
127
112
128
- { [ 'layout' , 'both' ] . includes (
129
- useContext ( EditorContext ) . editorModeStatus
130
- ) && (
113
+ { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
131
114
< >
132
- < Section name = { sectionNames . style } >
133
- { children . style . getPropertyView ( ) }
134
- </ Section >
135
- < Section name = { sectionNames . labelStyle } >
136
- { children . labelStyle . getPropertyView ( ) }
137
- </ Section >
138
- < Section name = { sectionNames . inputFieldStyle } >
139
- { children . inputFieldStyle . getPropertyView ( ) }
140
- </ Section >
141
- < Section name = { sectionNames . animationStyle } >
142
- { children . animationStyle . getPropertyView ( ) }
143
- </ Section >
115
+ < Section name = { sectionNames . style } > { children . style . getPropertyView ( ) } </ Section >
116
+ < Section name = { sectionNames . labelStyle } > { children . labelStyle . getPropertyView ( ) } </ Section >
117
+ < Section name = { sectionNames . inputFieldStyle } > { children . inputFieldStyle . getPropertyView ( ) } </ Section >
118
+ < Section name = { sectionNames . animationStyle } > { children . animationStyle . getPropertyView ( ) } </ Section >
144
119
</ >
145
120
) }
146
121
</ >
@@ -154,7 +129,7 @@ PasswordTmpComp = migrateOldData(PasswordTmpComp, fixOldInputCompData);
154
129
const PasswordTmp2Comp = withMethodExposing ( PasswordTmpComp , inputRefMethods ) ;
155
130
156
131
export const PasswordComp = withExposingConfigs ( PasswordTmp2Comp , [
157
- new NameConfig ( ' value' , trans ( ' export.inputValueDesc' ) ) ,
132
+ new NameConfig ( " value" , trans ( " export.inputValueDesc" ) ) ,
158
133
NameConfigPlaceHolder ,
159
134
NameConfigRequired ,
160
135
...TextInputConfigs ,
0 commit comments