Skip to content

Commit 365e46f

Browse files
authored
Merge branch 'dev' into module_loading_issues
2 parents 383c716 + d51734a commit 365e46f

File tree

17 files changed

+915
-319
lines changed

17 files changed

+915
-319
lines changed

client/packages/lowcoder/src/base/codeEditor/codeEditor.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const CodeEditorTooltipContainer = styled.div`
5252
// tooltip common
5353
.cm-tooltip {
5454
z-index: ${Layers.codeEditorTooltip};
55-
border: none;
55+
border: 1px solid #d7d9e0;
5656
}
5757
// make sure antd popover in the code editor available
5858
.ant-popover {
@@ -84,6 +84,7 @@ export const CodeEditorTooltipContainer = styled.div`
8484
border-radius: 8px;
8585
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
8686
transform: translate(-16px, 10px);
87+
z-index: ${Layers.codeEditorTooltip};
8788
}
8889
8990
// left minor tooltip
@@ -109,6 +110,7 @@ export const CodeEditorTooltipContainer = styled.div`
109110
color: #4965f2;
110111
${textStyle};
111112
font-weight: 600;
113+
z-index: ${Layers.codeEditorTooltip};
112114
}
113115
114116
.cm-tooltip > .cm-completionInfo .hintDiv:hover {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
import { CompParams } from "lowcoder-core";
2+
import { ToDataType } from "comps/generators/multi";
3+
import { NameConfigDisabled, NameConfigHidden, withExposingConfigs, NameConfig, CompDepsConfig } from "comps/generators/withExposing";
4+
import { withMethodExposing } from "comps/generators/withMethodExposing";
5+
import { NameGenerator } from "comps/utils/nameGenerator";
6+
import { Section, sectionNames } from "lowcoder-design";
7+
import { oldContainerParamsToNew } from "../containerBase";
8+
import { toSimpleContainerData } from "../containerBase/simpleContainerComp";
9+
import { disabledPropertyView, hiddenPropertyView } from "comps/utils/propertyUtils";
10+
import { trans } from "i18n";
11+
import { BoolCodeControl } from "comps/controls/codeControl";
12+
import { DisabledContext } from "comps/generators/uiCompBuilder";
13+
import React, { useContext, useEffect, useState } from "react";
14+
import { EditorContext } from "comps/editorState";
15+
16+
import {
17+
ContainerChildren,
18+
ContainerCompBuilder,
19+
} from "../pageLayoutComp/pageLayoutCompBuilder";
20+
import { PageLayout } from "../pageLayoutComp/pageLayout";
21+
22+
23+
export const ContainerBaseComp = (function () {
24+
const childrenMap = {
25+
disabled: BoolCodeControl
26+
};
27+
28+
return new ContainerCompBuilder(childrenMap, (props, dispatch) => {
29+
30+
const [siderCollapsed, setSiderCollapsed] = useState(false);
31+
32+
return (
33+
<DisabledContext.Provider value={props.disabled}>
34+
<PageLayout {...props} siderCollapsed={siderCollapsed} setSiderCollapsed={setSiderCollapsed} />
35+
</DisabledContext.Provider>
36+
);
37+
})
38+
.setPropertyViewFn((children) => {
39+
return (
40+
<>
41+
{(useContext(EditorContext).editorModeStatus === "logic" || useContext(EditorContext).editorModeStatus === "both") && (
42+
<Section name={sectionNames.interaction}>
43+
{disabledPropertyView(children)}
44+
{hiddenPropertyView(children)}
45+
{ children.container.appSelectorPropertyView()}
46+
</Section>
47+
)}
48+
49+
{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && (
50+
<><Section name={sectionNames.layout}>
51+
{children.container.getPropertyView()}
52+
</Section>
53+
<Section name={sectionNames.style}>
54+
{ children.container.stylePropertyView() }
55+
</Section>
56+
{children.container.children.showHeader.getView() && (
57+
<Section name={"Header Style"}>
58+
{ children.container.headerStylePropertyView() }
59+
</Section>
60+
)}
61+
{children.container.children.showSider.getView() && (
62+
<Section name={"Sider Style"}>
63+
{ children.container.siderStylePropertyView() }
64+
</Section>
65+
)}
66+
<Section name={"Body Style"}>
67+
{ children.container.bodyStylePropertyView() }
68+
</Section>
69+
{children.container.children.showFooter.getView() && (
70+
<Section name={"Footer Style"}>
71+
{ children.container.footerStylePropertyView() }
72+
</Section>
73+
)}
74+
</>
75+
)}
76+
</>
77+
);
78+
})
79+
.build();
80+
})();
81+
82+
// Compatible with old data
83+
function convertOldContainerParams(params: CompParams<any>) {
84+
// convert older params to old params
85+
let tempParams = oldContainerParamsToNew(params);
86+
87+
if (tempParams.value) {
88+
const container = tempParams.value.container;
89+
// old params
90+
if (container && (container.hasOwnProperty("layout") || container.hasOwnProperty("items"))) {
91+
const autoHeight = tempParams.value.autoHeight;
92+
const scrollbars = tempParams.value.scrollbars;
93+
return {
94+
...tempParams,
95+
value: {
96+
container: {
97+
showHeader: true,
98+
body: { 0: { view: container } },
99+
showFooter: false,
100+
showSider: true,
101+
autoHeight: autoHeight,
102+
contentScrollbars: scrollbars,
103+
},
104+
},
105+
};
106+
}
107+
}
108+
return tempParams;
109+
}
110+
111+
112+
class ContainerTmpComp extends ContainerBaseComp {
113+
constructor(params: CompParams<any>) {
114+
super(convertOldContainerParams(params));
115+
}
116+
}
117+
118+
const PageLayoutCompTmP = withExposingConfigs(ContainerTmpComp, [
119+
NameConfigHidden,
120+
NameConfigDisabled,
121+
122+
new NameConfig("container", trans("export.ratingValueDesc")),
123+
new CompDepsConfig(
124+
"siderCollapsed",
125+
(comp) => ({ data : comp.children.container.children.siderCollapsed.nodeWithoutCache()}),
126+
(input) => input.data.value, trans("listView.itemsDesc")
127+
),
128+
]);
129+
130+
export const PageLayoutComp = withMethodExposing(PageLayoutCompTmP, [
131+
132+
{
133+
method: {
134+
name: "setSiderCollapsed",
135+
description: "Set the Sider of the PageLayout to be collapsed or not",
136+
params: [{ name: "collapsed", type: "boolean" }],
137+
},
138+
execute: (comp, values) => {
139+
const page = values[0] as number;
140+
if (page && page > 0) {
141+
// comp.children.pagination.children.pageNo.dispatchChangeValueAction(page);
142+
}
143+
},
144+
}
145+
]);
146+
147+
type ContainerDataType = ToDataType<ContainerChildren<{}>>;
148+
149+
export function defaultPageLayoutData(
150+
compName: string,
151+
nameGenerator: NameGenerator
152+
): ContainerDataType {
153+
return {
154+
container: {
155+
header: toSimpleContainerData([
156+
{
157+
item: {
158+
compType: "navigation",
159+
name: nameGenerator.genItemName("pageNavigation"),
160+
comp: {
161+
logoUrl: "",
162+
hidden: false,
163+
items: [
164+
{
165+
label: "Home",
166+
hidden: false,
167+
active: false,
168+
},
169+
{
170+
label: "Services",
171+
hidden: false,
172+
active: false,
173+
items: [
174+
{
175+
label: "Lowcode Platform",
176+
hidden: false,
177+
active: false,
178+
},
179+
{
180+
label: "App Development",
181+
hidden: false,
182+
active: false,
183+
},
184+
],
185+
},
186+
{
187+
label: "About",
188+
hidden: false,
189+
active: false,
190+
},
191+
],
192+
},
193+
},
194+
layoutItem: {
195+
i: "",
196+
h: 6,
197+
w: 24,
198+
x: 0,
199+
y: 0,
200+
},
201+
},
202+
]),
203+
},
204+
};
205+
}

client/packages/lowcoder/src/comps/comps/layout/mobileTabLayout.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
191191
/>
192192
);
193193

194+
//console.log("appView", appView);
195+
194196
if (readOnly) {
195197
return (
196198
<TabLayoutViewContainer>

0 commit comments

Comments
 (0)