Skip to content

Commit a6a9ecb

Browse files
committed
formating removed-72
1 parent 534e45c commit a6a9ecb

File tree

1 file changed

+38
-65
lines changed
  • client/packages/lowcoder/src/comps/comps/textInputComp

1 file changed

+38
-65
lines changed
Lines changed: 38 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
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";
125
import {
136
NameConfig,
147
NameConfigPlaceHolder,
158
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";
2013
import {
2114
fixOldInputCompData,
2215
getStyle,
@@ -27,27 +20,27 @@ import {
2720
TextInputInteractionSection,
2821
TextInputValidationSection,
2922
useTextInputProps,
30-
} from './textInputConstants';
23+
} from "./textInputConstants";
3124
import {
3225
allowClearPropertyView,
3326
hiddenPropertyView,
3427
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";
4235

43-
import React, {useContext} from 'react';
44-
import {EditorContext} from 'comps/editorState';
36+
import React, { useContext } from "react";
37+
import { EditorContext } from "comps/editorState";
4538

4639
/**
4740
* Input Comp
4841
*/
4942

50-
const InputStyle = styled(Input)<{$style: InputLikeStyleType}>`
43+
const InputStyle = styled(Input) <{ $style: InputLikeStyleType }>`
5144
${(props) => props.$style && getStyle(props.$style)}
5245
`;
5346

@@ -81,8 +74,8 @@ let InputBasicComp = new UICompBuilder(childrenMap, (props) => {
8174
),
8275
style: props.style,
8376
labelStyle: props.labelStyle,
84-
inputFieldStyle: props.inputFieldStyle,
85-
animationStyle: props.animationStyle,
77+
inputFieldStyle:props.inputFieldStyle,
78+
animationStyle:props.animationStyle,
8679
...validateState,
8780
});
8881
})
@@ -92,64 +85,44 @@ let InputBasicComp = new UICompBuilder(childrenMap, (props) => {
9285
<TextInputBasicSection {...children} />
9386
<FormDataPropertyView {...children} />
9487

95-
{['layout', 'both'].includes(
96-
useContext(EditorContext).editorModeStatus
97-
) && children.label.getPropertyView()}
88+
{["layout", "both"].includes(useContext(EditorContext).editorModeStatus) && (
89+
children.label.getPropertyView()
90+
)}
9891

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>
10795
<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") })}
11799
{allowClearPropertyView(children)}
118100
{readOnlyPropertyView(children)}
119101
</Section>
120102
<TextInputValidationSection {...children} />
121103
</>
122104
)}
123-
{['layout', 'both'].includes(
124-
useContext(EditorContext).editorModeStatus
125-
) && (
105+
{["layout", "both"].includes(useContext(EditorContext).editorModeStatus) && (
126106
<>
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>
139111
</>
140112
)}
141113
</>
142114
);
143115
})
144116
.setExposeMethodConfigs(inputRefMethods)
145117
.setExposeStateConfigs([
146-
new NameConfig('value', trans('export.inputValueDesc')),
118+
new NameConfig("value", trans("export.inputValueDesc")),
147119
NameConfigPlaceHolder,
148120
NameConfigRequired,
149121
...TextInputConfigs,
150122
])
151123
.build();
152124

125+
153126
const InputComp = migrateOldData(InputBasicComp, fixOldInputCompData);
154127

155-
export {InputComp};
128+
export { InputComp };

0 commit comments

Comments
 (0)