Skip to content

Commit 698c72f

Browse files
committed
formating removed-75
1 parent aaeb3c6 commit 698c72f

File tree

1 file changed

+44
-69
lines changed

1 file changed

+44
-69
lines changed

client/packages/lowcoder/src/comps/comps/textInputComp/passwordComp.tsx

Lines changed: 44 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
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";
33
import {
44
NameConfig,
55
NameConfigPlaceHolder,
66
NameConfigRequired,
77
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";
1515
import {
1616
fixOldInputCompData,
1717
getStyle,
@@ -22,34 +22,28 @@ import {
2222
TextInputInteractionSection,
2323
TextInputValidationOptions,
2424
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";
3630
import {
3731
hiddenPropertyView,
3832
minLengthPropertyView,
3933
readOnlyPropertyView,
4034
requiredPropertyView,
4135
regexPropertyView,
4236
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";
5145

52-
const PasswordStyle = styled(InputPassword)<{
46+
const PasswordStyle = styled(InputPassword) <{
5347
$style: InputLikeStyleType;
5448
}>`
5549
${(props) => props.$style && getStyle(props.$style)}
@@ -59,14 +53,14 @@ let PasswordTmpComp = (function () {
5953
const childrenMap = {
6054
...textInputChildren,
6155
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"),
6458
visibilityToggle: BoolControl.DEFAULT_TRUE,
6559
prefixIcon: IconControl,
6660
style: withDefault(styleControl(InputFieldStyle), {borderWidth: '1px'}),
6761
labelStyle: styleControl(LabelStyle),
6862
inputFieldStyle: styleControl(InputLikeStyle),
69-
animationStyle: styleControl(AnimationStyle),
63+
animationStyle: styleControl(AnimationStyle),
7064
};
7165
return new UICompBuilder(childrenMap, (props) => {
7266
const [inputProps, validateState] = useTextInputProps(props);
@@ -83,8 +77,8 @@ let PasswordTmpComp = (function () {
8377
),
8478
style: props.style,
8579
labelStyle: props.labelStyle,
86-
inputFieldStyle: props.inputFieldStyle,
87-
animationStyle: props.animationStyle,
80+
inputFieldStyle:props.inputFieldStyle,
81+
animationStyle:props.animationStyle,
8882
...validateState,
8983
});
9084
})
@@ -94,53 +88,34 @@ let PasswordTmpComp = (function () {
9488
<TextInputBasicSection {...children} />
9589
<FormDataPropertyView {...children} />
9690

97-
{['layout', 'both'].includes(
98-
useContext(EditorContext).editorModeStatus
99-
) && children.label.getPropertyView()}
91+
{["layout", "both"].includes(useContext(EditorContext).editorModeStatus) && (
92+
children.label.getPropertyView()
93+
)}
10094

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>
10998
<Section name={sectionNames.advanced}>
11099
{children.visibilityToggle.propertyView({
111-
label: trans('password.visibilityToggle'),
100+
label: trans("password.visibilityToggle"),
112101
})}
113102
{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}>
119105
{requiredPropertyView(children)}
120106
{regexPropertyView(children)}
121107
{minLengthPropertyView(children)}
122108
{maxLengthPropertyView(children)}
123109
{children.customRule.propertyView({})}
124-
</Section>
125-
</>
110+
</Section></>
126111
)}
127112

128-
{['layout', 'both'].includes(
129-
useContext(EditorContext).editorModeStatus
130-
) && (
113+
{["layout", "both"].includes(useContext(EditorContext).editorModeStatus) && (
131114
<>
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>
144119
</>
145120
)}
146121
</>
@@ -154,7 +129,7 @@ PasswordTmpComp = migrateOldData(PasswordTmpComp, fixOldInputCompData);
154129
const PasswordTmp2Comp = withMethodExposing(PasswordTmpComp, inputRefMethods);
155130

156131
export const PasswordComp = withExposingConfigs(PasswordTmp2Comp, [
157-
new NameConfig('value', trans('export.inputValueDesc')),
132+
new NameConfig("value", trans("export.inputValueDesc")),
158133
NameConfigPlaceHolder,
159134
NameConfigRequired,
160135
...TextInputConfigs,

0 commit comments

Comments
 (0)