Skip to content

Commit c96a0ed

Browse files
committed
formating removed-69
1 parent 187c060 commit c96a0ed

File tree

1 file changed

+46
-60
lines changed

1 file changed

+46
-60
lines changed

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

Lines changed: 46 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,45 @@
1-
import {dropdownControl} from 'comps/controls/dropdownControl';
2-
import {stringExposingStateControl} from 'comps/controls/codeStateControl';
3-
import {AutoHeightControl} from 'comps/controls/autoHeightControl';
4-
import {Section, sectionNames} from 'lowcoder-design';
5-
import styled, {css} from 'styled-components';
6-
import {AlignCenter} from 'lowcoder-design';
7-
import {AlignLeft} from 'lowcoder-design';
8-
import {AlignRight} from 'lowcoder-design';
9-
import {UICompBuilder} from '../generators';
10-
import {
11-
NameConfig,
12-
NameConfigHidden,
13-
withExposingConfigs,
14-
} from '../generators/withExposing';
15-
import {markdownCompCss, TacoMarkDown} from 'lowcoder-design';
16-
import {styleControl} from 'comps/controls/styleControl';
17-
import {
18-
AnimationStyle,
19-
AnimationStyleType,
20-
TextStyle,
21-
TextStyleType,
22-
heightCalculator,
23-
widthCalculator,
24-
} from 'comps/controls/styleControlConstants';
25-
import {hiddenPropertyView} from 'comps/utils/propertyUtils';
26-
import {trans} from 'i18n';
27-
import {alignWithJustifyControl} from 'comps/controls/alignControl';
1+
import { dropdownControl } from "comps/controls/dropdownControl";
2+
import { stringExposingStateControl } from "comps/controls/codeStateControl";
3+
import { AutoHeightControl } from "comps/controls/autoHeightControl";
4+
import { Section, sectionNames } from "lowcoder-design";
5+
import styled, { css } from "styled-components";
6+
import { AlignCenter } from "lowcoder-design";
7+
import { AlignLeft } from "lowcoder-design";
8+
import { AlignRight } from "lowcoder-design";
9+
import { UICompBuilder } from "../generators";
10+
import { NameConfig, NameConfigHidden, withExposingConfigs } from "../generators/withExposing";
11+
import { markdownCompCss, TacoMarkDown } from "lowcoder-design";
12+
import { styleControl } from "comps/controls/styleControl";
13+
import { AnimationStyle, AnimationStyleType, TextStyle, TextStyleType, heightCalculator, widthCalculator } from "comps/controls/styleControlConstants";
14+
import { hiddenPropertyView } from "comps/utils/propertyUtils";
15+
import { trans } from "i18n";
16+
import { alignWithJustifyControl } from "comps/controls/alignControl";
2817

29-
import {MarginControl} from '../controls/marginControl';
30-
import {PaddingControl} from '../controls/paddingControl';
18+
import { MarginControl } from "../controls/marginControl";
19+
import { PaddingControl } from "../controls/paddingControl";
3120

32-
import React, {useContext} from 'react';
33-
import {EditorContext} from 'comps/editorState';
21+
import React, { useContext } from "react";
22+
import { EditorContext } from "comps/editorState";
3423

3524
const getStyle = (style: TextStyleType) => {
3625
return css`
37-
border-radius: ${style.radius ? style.radius : '4px'};
38-
border: ${style.borderWidth ? style.borderWidth : '0px'} solid
39-
${style.border};
26+
border-radius: ${(style.radius ? style.radius : "4px")};
27+
border: ${(style.borderWidth ? style.borderWidth : "0px")} solid ${style.border};
4028
color: ${style.text};
4129
font-size: ${style.textSize} !important;
4230
font-weight: ${style.textWeight} !important;
4331
font-family: ${style.fontFamily} !important;
44-
font-style: ${style.fontStyle} !important;
45-
text-transform: ${style.textTransform} !important;
46-
text-decoration: ${style.textDecoration} !important;
32+
font-style:${style.fontStyle} !important;
33+
text-transform:${style.textTransform} !important;
34+
text-decoration:${style.textDecoration} !important;
4735
background-color: ${style.background};
4836
.markdown-body a {
4937
color: ${style.links};
5038
}
5139
.markdown-body {
52-
margin: ${style.margin} !important;
53-
padding: ${style.padding};
54-
width: ${widthCalculator(style.margin)};
40+
margin: ${style.margin} !important;
41+
padding: ${style.padding};
42+
width: ${widthCalculator(style.margin)};
5543
// height: ${heightCalculator(style.margin)};
5644
h1 {
5745
line-height: 1.5;
@@ -87,12 +75,12 @@ const getStyle = (style: TextStyleType) => {
8775
const TextContainer = styled.div<{
8876
$type: string;
8977
$styleConfig: TextStyleType;
90-
$animationStyle: AnimationStyleType;
78+
$animationStyle:AnimationStyleType;
9179
}>`
9280
height: 100%;
9381
overflow: auto;
9482
margin: 0;
95-
${(props) => props.$animationStyle}
83+
${props=>props.$animationStyle}
9684
${(props) =>
9785
props.$type === 'text' && 'white-space:break-spaces;line-height: 1.9;'};
9886
${(props) => props.$styleConfig && getStyle(props.$styleConfig)}
@@ -116,21 +104,23 @@ const AlignVerticalCenter = styled(AlignCenter)`
116104

117105
const typeOptions = [
118106
{
119-
label: 'Markdown',
120-
value: 'markdown',
107+
label: "Markdown",
108+
value: "markdown",
121109
},
122110
{
123-
label: trans('text'),
124-
value: 'text',
111+
label: trans("text"),
112+
value: "text",
125113
},
126114
] as const;
127115
const VerticalAlignmentOptions = [
128-
{label: <AlignTop />, value: 'flex-start'},
129-
{label: <AlignVerticalCenter />, value: 'center'},
130-
{label: <AlignBottom />, value: 'flex-end'},
116+
{ label: <AlignTop />, value: "flex-start" },
117+
{ label: <AlignVerticalCenter />, value: "center" },
118+
{ label: <AlignBottom />, value: "flex-end" },
131119
] as const;
132120

121+
133122
let TextTmpComp = (function () {
123+
134124
const childrenMap = {
135125
text: stringExposingStateControl(
136126
'text',
@@ -171,34 +161,30 @@ let TextTmpComp = (function () {
171161
<>
172162
<Section name={sectionNames.basic}>
173163
{children.type.propertyView({
174-
label: trans('value'),
175-
tooltip: trans('textShow.valueTooltip'),
164+
label: trans("value"),
165+
tooltip: trans("textShow.valueTooltip"),
176166
radioButton: true,
177167
})}
178168
{children.text.propertyView({})}
179169
</Section>
180170

181-
{['logic', 'both'].includes(
182-
useContext(EditorContext).editorModeStatus
183-
) && (
171+
{["logic", "both"].includes(useContext(EditorContext).editorModeStatus) && (
184172
<Section name={sectionNames.interaction}>
185173
{hiddenPropertyView(children)}
186174
</Section>
187175
)}
188176

189-
{['layout', 'both'].includes(
190-
useContext(EditorContext).editorModeStatus
191-
) && (
177+
{["layout", "both"].includes(useContext(EditorContext).editorModeStatus) && (
192178
<>
193179
<Section name={sectionNames.layout}>
194180
{children.autoHeight.getPropertyView()}
195181
{!children.autoHeight.getView() &&
196182
children.verticalAlignment.propertyView({
197-
label: trans('textShow.verticalAlignment'),
183+
label: trans("textShow.verticalAlignment"),
198184
radioButton: true,
199185
})}
200186
{children.horizontalAlignment.propertyView({
201-
label: trans('textShow.horizontalAlignment'),
187+
label: trans("textShow.horizontalAlignment"),
202188
radioButton: true,
203189
})}
204190
</Section>
@@ -223,6 +209,6 @@ TextTmpComp = class extends TextTmpComp {
223209
};
224210

225211
export const TextComp = withExposingConfigs(TextTmpComp, [
226-
new NameConfig('text', trans('textShow.textDesc')),
212+
new NameConfig("text", trans("textShow.textDesc")),
227213
NameConfigHidden,
228214
]);

0 commit comments

Comments
 (0)