Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbe65063

Browse files
committed
Fixed shape component can not call PropertyView
1 parentfeefeb0 commitbe65063

File tree

3 files changed

+9
-48
lines changed

3 files changed

+9
-48
lines changed

‎client/packages/lowcoder/src/comps/comps/shapeComp/propertyView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { trans } from "@lowcoder-ee/i18n";
33
importReact,{useContext}from"react";
44
import{disabledPropertyView,EditorContext,hiddenPropertyView}from"lowcoder-sdk";
55

6-
console.log("shape");
7-
86
constPropertyView=((children:any)=>{
97
consteditorModeStatus=useContext(EditorContext).editorModeStatus;
108
return(

‎client/packages/lowcoder/src/comps/comps/shapeComp/shapeComp.tsx

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
withExposingConfigs,
66
}from"comps/generators/withExposing";
77
import{NameGenerator}from"comps/utils/nameGenerator";
8-
import{Section,sectionNames}from"lowcoder-design";
98
import{oldContainerParamsToNew}from"../containerBase";
109
import{toSimpleContainerData}from"../containerBase/simpleContainerComp";
1110
import{ShapeTriContainer}from"./shapeTriContainer";
@@ -15,22 +14,18 @@ import {
1514
ContainerChildren,
1615
ContainerCompBuilder,
1716
}from"../triContainerComp/triContainerCompBuilder";
18-
import{
19-
disabledPropertyView,
20-
hiddenPropertyView,
21-
}from"comps/utils/propertyUtils";
2217
import{trans}from"i18n";
2318
import{BoolCodeControl}from"comps/controls/codeControl";
2419
import{DisabledContext}from"comps/generators/uiCompBuilder";
25-
importReact,{useContext,useEffect,useState}from"react";
26-
import{EditorContext}from"comps/editorState";
27-
20+
importReactfrom"react";
21+
import{viewMode}from"@lowcoder-ee/util/editor";
22+
constPropertyView=React.lazy(async()=>awaitimport("./propertyView"));
2823
exportconstContainerBaseComp=(function(){
2924
constchildrenMap={
3025
disabled:BoolCodeControl,
3126
icon:withDefault(ShapeControl,""),
3227
};
33-
returnnewContainerCompBuilder(childrenMap,(props,dispatch)=>{
28+
letbuilder=newContainerCompBuilder(childrenMap,(props,dispatch)=>{
3429

3530

3631
return(
@@ -39,42 +34,10 @@ export const ContainerBaseComp = (function () {
3934
</DisabledContext.Provider>
4035
);
4136
})
42-
.setPropertyViewFn((children)=>{
43-
return(
44-
<>
45-
<Sectionname={sectionNames.basic}>
46-
{children.icon.propertyView({
47-
label:trans("iconComp.icon"),
48-
IconType:"All",
49-
})}
50-
</Section>
51-
{(useContext(EditorContext).editorModeStatus==="logic"||
52-
useContext(EditorContext).editorModeStatus==="both")&&(
53-
<Sectionname={sectionNames.interaction}>
54-
{disabledPropertyView(children)}
55-
{hiddenPropertyView(children)}
56-
</Section>
57-
)}
58-
59-
{(useContext(EditorContext).editorModeStatus==="layout"||
60-
useContext(EditorContext).editorModeStatus==="both")&&(
61-
<>
62-
<Sectionname={sectionNames.layout}>
63-
{children.container.getPropertyView()}
64-
</Section>
65-
<Sectionname={sectionNames.style}>
66-
{children.container.stylePropertyView()}
67-
</Section>
68-
{children.container.children.showBody.getView()&&(
69-
<Sectionname={"Body Style"}>
70-
{children.container.bodyStylePropertyView()}
71-
</Section>
72-
)}
73-
</>
74-
)}
75-
</>
76-
);
77-
})
37+
if(viewMode()!=="admin"){
38+
builder.setPropertyViewFn((children)=><PropertyView{...children}></PropertyView>);
39+
}
40+
returnbuilder
7841
.build();
7942
})();
8043

‎client/packages/lowcoder/src/comps/controls/shapeControl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export class ShapeControl extends AbstractComp<
213213

214214
propertyView(params:ControlParams){
215215
constjsContent=(
216-
<MultiIconDisplayidentifier={SwitchJsIcon}
216+
<SwitchJsIcon
217217
checked={this.useCodeEditor}
218218
onChange={()=>this.dispatch(this.changeModeAction())}
219219
/>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp