Skip to content

Commit a5304e1

Browse files
committed
formating removed-47
1 parent 9ed0c52 commit a5304e1

File tree

1 file changed

+56
-56
lines changed
  • client/packages/lowcoder/src/comps/comps/navComp

1 file changed

+56
-56
lines changed

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

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
import { NameConfig, NameConfigHidden,withExposingConfigs } from 'comps/generators/withExposing';
2-
import { UICompBuilder, withDefault } from 'comps/generators';
3-
import { Section, sectionNames } from 'lowcoder-design';
4-
import styled from 'styled-components';
5-
import { clickEvent,eventHandlerControl } from 'comps/controls/eventHandlerControl';
6-
import { StringControl } from 'comps/controls/codeControl';
7-
import { alignWithJustifyControl } from 'comps/controls/alignControl';
8-
import { navListComp } from './navItemComp';
9-
import { menuPropertyView } from './components/MenuItemList';
10-
import { default as DownOutlined } from '@ant-design/icons/DownOutlined';
11-
import { default as Dropdown } from 'antd/es/dropdown';
12-
import { default as Menu, MenuProps } from 'antd/es/menu';
13-
import { migrateOldData } from 'comps/generators/simpleGenerators';
14-
import { styleControl } from 'comps/controls/styleControl';
1+
import { NameConfig, NameConfigHidden,withExposingConfigs } from "comps/generators/withExposing";
2+
import { UICompBuilder, withDefault } from "comps/generators";
3+
import { Section, sectionNames } from "lowcoder-design";
4+
import styled from "styled-components";
5+
import { clickEvent,eventHandlerControl } from "comps/controls/eventHandlerControl";
6+
import { StringControl } from "comps/controls/codeControl";
7+
import { alignWithJustifyControl } from "comps/controls/alignControl";
8+
import { navListComp } from "./navItemComp";
9+
import { menuPropertyView } from "./components/MenuItemList";
10+
import { default as DownOutlined } from "@ant-design/icons/DownOutlined";
11+
import { default as Dropdown } from "antd/es/dropdown";
12+
import { default as Menu, MenuProps } from "antd/es/menu";
13+
import { migrateOldData } from "comps/generators/simpleGenerators";
14+
import { styleControl } from "comps/controls/styleControl";
1515
import {
1616
AnimationStyle,
1717
AnimationStyleType,
1818
NavigationStyle,
19-
} from 'comps/controls/styleControlConstants';
20-
import { hiddenPropertyView } from 'comps/utils/propertyUtils';
21-
import { trans } from 'i18n';
19+
} from "comps/controls/styleControlConstants";
20+
import { hiddenPropertyView } from "comps/utils/propertyUtils";
21+
import { trans } from "i18n";
2222

23-
import { useContext } from 'react';
24-
import { EditorContext } from 'comps/editorState';
23+
import { useContext } from "react";
24+
import { EditorContext } from "comps/editorState";
2525

2626
type IProps = {
2727
$justify: boolean;
@@ -32,24 +32,24 @@ type IProps = {
3232
$animationStyle:AnimationStyleType;
3333
};
3434

35-
const Wrapper = styled('div')<
36-
Pick<IProps, '$bgColor' | '$borderColor' | '$borderWidth' | '$borderRadius'|'$animationStyle'>
35+
const Wrapper = styled("div")<
36+
Pick<IProps, "$bgColor" | "$borderColor" | "$borderWidth" | "$borderRadius"|"$animationStyle">
3737
>`
3838
${props=>props.$animationStyle}
3939
height: 100%;
4040
border-radius: ${(props) =>
41-
props.$borderRadius ? props.$borderRadius : '2px'};
41+
props.$borderRadius ? props.$borderRadius : "2px"};
4242
box-sizing: border-box;
43-
border: ${(props) => (props.$borderWidth ? `${props.$borderWidth}` : '1px')}
43+
border: ${(props) => (props.$borderWidth ? `${props.$borderWidth}` : "1px")}
4444
solid ${(props) => props.$borderColor};
4545
background-color: ${(props) => props.$bgColor};
4646
`;
4747

48-
const NavInner = styled('div')<Pick<IProps, '$justify'>>`
48+
const NavInner = styled("div")<Pick<IProps, "$justify">>`
4949
// margin: 0 -16px;
5050
height: 100%;
5151
display: flex;
52-
justify-content: ${(props) => (props.$justify ? 'space-between' : 'left')};
52+
justify-content: ${(props) => (props.$justify ? "space-between" : "left")};
5353
`;
5454

5555
const Item = styled.div<{
@@ -67,18 +67,18 @@ const Item = styled.div<{
6767
}>`
6868
height: 30px;
6969
line-height: 30px;
70-
padding: ${(props) => (props.$padding ? props.$padding : '0 16px')};
70+
padding: ${(props) => (props.$padding ? props.$padding : "0 16px")};
7171
color: ${(props) => (props.$active ? props.$activeColor : props.$color)};
7272
font-weight: ${(props) => (props.$textWeight ? props.$textWeight : 500)};
7373
font-family: ${(props) =>
74-
props.$fontFamily ? props.$fontFamily : 'sans-serif'};
75-
font-style: ${(props) => (props.$fontStyle ? props.$fontStyle : 'normal')};
76-
font-size: ${(props) => (props.$textSize ? props.$textSize : '14px')};
74+
props.$fontFamily ? props.$fontFamily : "sans-serif"};
75+
font-style: ${(props) => (props.$fontStyle ? props.$fontStyle : "normal")};
76+
font-size: ${(props) => (props.$textSize ? props.$textSize : "14px")};
7777
text-transform: ${(props) =>
78-
props.$textTransform ? props.$textTransform : ''};
78+
props.$textTransform ? props.$textTransform : ""};
7979
text-decoration: ${(props) =>
80-
props.$textDecoration ? props.$textDecoration : ''};
81-
margin: ${(props) => (props.$margin ? props.$margin : '0px')};
80+
props.$textDecoration ? props.$textDecoration : ""};
81+
margin: ${(props) => (props.$margin ? props.$margin : "0px")};
8282
8383
&:hover {
8484
color: ${(props) => props.$activeColor};
@@ -120,10 +120,10 @@ const logoEventHandlers = [clickEvent];
120120
function fixOldStyleData(oldData: any) {
121121
if (
122122
oldData &&
123-
(oldData.hasOwnProperty('accentColor') ||
124-
oldData.hasOwnProperty('backgroundColor') ||
125-
oldData.hasOwnProperty('borderColor') ||
126-
oldData.hasOwnProperty('color'))
123+
(oldData.hasOwnProperty("accentColor") ||
124+
oldData.hasOwnProperty("backgroundColor") ||
125+
oldData.hasOwnProperty("borderColor") ||
126+
oldData.hasOwnProperty("color"))
127127
) {
128128
return {
129129
text: oldData.color,
@@ -138,14 +138,14 @@ function fixOldStyleData(oldData: any) {
138138
const childrenMap = {
139139
logoUrl: StringControl,
140140
logoEvent: withDefault(eventHandlerControl(logoEventHandlers), [
141-
{name: 'click'},
141+
{name: "click"},
142142
]),
143143
horizontalAlignment: alignWithJustifyControl(),
144144
style: migrateOldData(styleControl(NavigationStyle), fixOldStyleData),
145145
animationStyle: styleControl(AnimationStyle),
146146
items: withDefault(navListComp(), [
147147
{
148-
label: trans('menuItem') + ' 1',
148+
label: trans("menuItem") + " 1",
149149
},
150150
]),
151151
};
@@ -165,7 +165,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
165165
const subMenuItems: Array<{key: string; label: string}> = [];
166166
const subMenuSelectedKeys: Array<string> = [];
167167
visibleSubItems.forEach((subItem, index) => {
168-
const key = index + '';
168+
const key = index + "";
169169
subItem.children.active.getView() && subMenuSelectedKeys.push(key);
170170
subMenuItems.push({
171171
key: key,
@@ -186,7 +186,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
186186
$textTransform={props.style.textTransform}
187187
$textDecoration={props.style.textDecoration}
188188
$margin={props.style.margin}
189-
onClick={() => onEvent('click')}
189+
onClick={() => onEvent("click")}
190190
>
191191
{label}
192192
{items.length > 0 && <DownOutlined />}
@@ -197,7 +197,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
197197
<StyledMenu
198198
onClick={(e) => {
199199
const {onEvent: onSubEvent} = items[Number(e.key)]?.getView();
200-
onSubEvent('click');
200+
onSubEvent("click");
201201
}}
202202
selectedKeys={subMenuSelectedKeys}
203203
items={subMenuItems}
@@ -214,7 +214,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
214214
</>
215215
);
216216

217-
const justify = props.horizontalAlignment === 'justify';
217+
const justify = props.horizontalAlignment === "justify";
218218

219219
return (
220220
<Wrapper
@@ -226,7 +226,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
226226
>
227227
<NavInner $justify={justify}>
228228
{props.logoUrl && (
229-
<LogoWrapper onClick={() => props.logoEvent('click')}>
229+
<LogoWrapper onClick={() => props.logoEvent("click")}>
230230
<img src={props.logoUrl} alt="LOGO" />
231231
</LogoWrapper>
232232
)}
@@ -246,38 +246,38 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
246246
{menuPropertyView(children.items)}
247247
</Section>
248248

249-
{(useContext(EditorContext).editorModeStatus === 'logic' ||
250-
useContext(EditorContext).editorModeStatus === 'both') && (
249+
{(useContext(EditorContext).editorModeStatus === "logic" ||
250+
useContext(EditorContext).editorModeStatus === "both") && (
251251
<Section name={sectionNames.interaction}>
252252
{hiddenPropertyView(children)}
253253
</Section>
254254
)}
255255

256-
{(useContext(EditorContext).editorModeStatus === 'layout' ||
257-
useContext(EditorContext).editorModeStatus === 'both') && (
256+
{(useContext(EditorContext).editorModeStatus === "layout" ||
257+
useContext(EditorContext).editorModeStatus === "both") && (
258258
<Section name={sectionNames.layout}>
259259
{children.horizontalAlignment.propertyView({
260-
label: trans('navigation.horizontalAlignment'),
260+
label: trans("navigation.horizontalAlignment"),
261261
radioButton: true,
262262
})}
263263
{hiddenPropertyView(children)}
264264
</Section>
265265
)}
266266

267-
{(useContext(EditorContext).editorModeStatus === 'logic' ||
268-
useContext(EditorContext).editorModeStatus === 'both') && (
267+
{(useContext(EditorContext).editorModeStatus === "logic" ||
268+
useContext(EditorContext).editorModeStatus === "both") && (
269269
<Section name={sectionNames.advanced}>
270270
{children.logoUrl.propertyView({
271-
label: trans('navigation.logoURL'),
272-
tooltip: trans('navigation.logoURLDesc'),
271+
label: trans("navigation.logoURL"),
272+
tooltip: trans("navigation.logoURLDesc"),
273273
})}
274274
{children.logoUrl.getView() &&
275275
children.logoEvent.propertyView({inline: true})}
276276
</Section>
277277
)}
278278

279-
{(useContext(EditorContext).editorModeStatus === 'layout' ||
280-
useContext(EditorContext).editorModeStatus === 'both') && (
279+
{(useContext(EditorContext).editorModeStatus === "layout" ||
280+
useContext(EditorContext).editorModeStatus === "both") && (
281281
<>
282282
<Section name={sectionNames.style}>
283283
{children.style.getPropertyView()}
@@ -293,7 +293,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
293293
.build();
294294

295295
export const NavComp = withExposingConfigs(NavCompBase, [
296-
new NameConfig('logoUrl', trans('navigation.logoURLDesc')),
296+
new NameConfig("logoUrl", trans("navigation.logoURLDesc")),
297297
NameConfigHidden,
298-
new NameConfig('items', trans('navigation.itemsDesc')),
298+
new NameConfig("items", trans("navigation.itemsDesc")),
299299
]);

0 commit comments

Comments
 (0)