Skip to content

Commit 44427df

Browse files
committed
formating removed-2
1 parent 1e16d61 commit 44427df

File tree

1 file changed

+50
-46
lines changed

1 file changed

+50
-46
lines changed

client/packages/lowcoder/src/comps/comps/autoCompleteComp/autoCompleteComp.tsx

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React, {useEffect, useState} from 'react';
2-
import {Input, Section, sectionNames} from 'lowcoder-design';
3-
import {BoolControl} from 'comps/controls/boolControl';
4-
import {styleControl} from 'comps/controls/styleControl';
1+
import React, { useEffect, useState } from "react";
2+
import { Input, Section, sectionNames } from "lowcoder-design";
3+
import { BoolControl } from "comps/controls/boolControl";
4+
import { styleControl } from "comps/controls/styleControl";
55
import {
66
AnimationStyle,
77
InputFieldStyle,
@@ -14,12 +14,12 @@ import {
1414
NameConfigPlaceHolder,
1515
NameConfigRequired,
1616
withExposingConfigs,
17-
} from 'comps/generators/withExposing';
18-
import styled, {css} from 'styled-components';
19-
import {UICompBuilder} from '../../generators';
20-
import {FormDataPropertyView} from '../formComp/formDataConstants';
21-
import {jsonControl} from 'comps/controls/codeControl';
22-
import {dropdownControl} from 'comps/controls/dropdownControl';
17+
} from "comps/generators/withExposing";
18+
import styled, { css } from "styled-components";
19+
import { UICompBuilder } from "../../generators";
20+
import { FormDataPropertyView } from "../formComp/formDataConstants";
21+
import { jsonControl } from "comps/controls/codeControl";
22+
import { dropdownControl } from "comps/controls/dropdownControl";
2323
import {
2424
getStyle,
2525
TextInputBasicSection,
@@ -28,21 +28,23 @@ import {
2828
TextInputInteractionSection,
2929
textInputValidate,
3030
TextInputValidationSection,
31-
} from '../textInputComp/textInputConstants';
31+
} from "../textInputComp/textInputConstants";
3232
import {
3333
allowClearPropertyView,
3434
hiddenPropertyView,
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 {default as ConfigProvider} from 'antd/es/config-provider';
41-
import {default as AutoComplete} from 'antd/es/auto-complete';
42-
import {RefControl} from 'comps/controls/refControl';
43-
import {booleanExposingStateControl} from 'comps/controls/codeStateControl';
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 { default as ConfigProvider } from "antd/es/config-provider";
41+
import { default as AutoComplete } from "antd/es/auto-complete";
42+
import { RefControl } from "comps/controls/refControl";
43+
import {
44+
booleanExposingStateControl,
45+
} from "comps/controls/codeStateControl";
4446

45-
import {getDayJSLocale} from 'i18n/dayjsLocale';
47+
import { getDayJSLocale } from "i18n/dayjsLocale";
4648
import {
4749
autoCompleteDate,
4850
itemsDataTooltip,
@@ -52,23 +54,24 @@ import {
5254
autoCompleteType,
5355
autocompleteIconColor,
5456
componentSize,
55-
} from './autoCompleteConstants';
57+
} from "./autoCompleteConstants";
58+
59+
5660

5761
const InputStyle = styled(Input)<{$style: InputLikeStyleType}>`
58-
${(props) => {
59-
return css`
60-
${getStyle(props.$style)}
61-
input {
62-
padding: ${props.style?.padding};
63-
rotate: ${props?.$style?.rotation};
64-
}
65-
.ant-select-single {
66-
width: 100% !important;
67-
}
68-
`;
69-
}}
62+
${(props) => css`
63+
${getStyle(props.$style)}
64+
input {
65+
padding: ${props.style?.padding};
66+
rotate: ${props?.$style?.rotation};
67+
}
68+
.ant-select-single {
69+
width: 100% !important;
70+
}
71+
`}
7072
`;
7173

74+
7275
const childrenMap = {
7376
...textInputChildren,
7477
viewRef: RefControl<InputRef>,
@@ -91,13 +94,13 @@ const childrenMap = {
9194
animationStyle: styleControl(AnimationStyle),
9295
};
9396

94-
const getValidate = (value: any): '' | 'warning' | 'error' | undefined => {
97+
const getValidate = (value: any): "" | "warning" | "error" | undefined => {
9598
if (
96-
value.hasOwnProperty('validateStatus') &&
97-
value['validateStatus'] === 'error'
99+
value.hasOwnProperty("validateStatus") &&
100+
value["validateStatus"] === "error"
98101
)
99-
return 'error';
100-
return '';
102+
return "error";
103+
return "";
101104
};
102105

103106
let AutoCompleteCompBase = (function () {
@@ -115,10 +118,11 @@ let AutoCompleteCompBase = (function () {
115118
autocompleteIconColor,
116119
componentSize,
117120
} = props;
121+
118122

119123
const getTextInputValidate = () => {
120124
return {
121-
value: {value: props.value.value},
125+
value: { value: props.value.value },
122126
required: props.required,
123127
minLength: props?.minLength ?? 0,
124128
maxLength: props?.maxLength ?? 0,
@@ -133,7 +137,7 @@ let AutoCompleteCompBase = (function () {
133137
const [validateState, setvalidateState] = useState({});
134138

135139
// 是否中文环境
136-
const [chineseEnv, setChineseEnv] = useState(getDayJSLocale() === 'zh-cn');
140+
const [chineseEnv, setChineseEnv] = useState(getDayJSLocale() === "zh-cn");
137141

138142
useEffect(() => {
139143
setsearchtext(props.value.value);
@@ -355,8 +359,8 @@ let AutoCompleteCompBase = (function () {
355359
})
356360
.setExposeMethodConfigs(autoCompleteRefMethods)
357361
.setExposeStateConfigs([
358-
new NameConfig('value', trans('export.inputValueDesc')),
359-
new NameConfig('valueInItems', trans('autoComplete.valueInItems')),
362+
new NameConfig("value", trans("export.inputValueDesc")),
363+
new NameConfig("valueInItems", trans("autoComplete.valueInItems")),
360364
NameConfigPlaceHolder,
361365
NameConfigRequired,
362366
...TextInputConfigs,
@@ -371,9 +375,9 @@ AutoCompleteCompBase = class extends AutoCompleteCompBase {
371375
};
372376

373377
export const AutoCompleteComp = withExposingConfigs(AutoCompleteCompBase, [
374-
new NameConfig('value', trans('export.inputValueDesc')),
375-
new NameConfig('valueInItems', trans('autoComplete.valueInItems')),
378+
new NameConfig("value", trans("export.inputValueDesc")),
379+
new NameConfig("valueInItems", trans("autoComplete.valueInItems")),
376380
NameConfigPlaceHolder,
377-
NameConfigRequired,
381+
NameConfigRequired,
378382
...TextInputConfigs,
379383
]);

0 commit comments

Comments
 (0)