5
5
withExposingConfigs ,
6
6
} from "comps/generators/withExposing" ;
7
7
import { NameGenerator } from "comps/utils/nameGenerator" ;
8
- import { Section , sectionNames } from "lowcoder-design" ;
9
8
import { oldContainerParamsToNew } from "../containerBase" ;
10
9
import { toSimpleContainerData } from "../containerBase/simpleContainerComp" ;
11
10
import { ShapeTriContainer } from "./shapeTriContainer" ;
@@ -15,22 +14,18 @@ import {
15
14
ContainerChildren ,
16
15
ContainerCompBuilder ,
17
16
} from "../triContainerComp/triContainerCompBuilder" ;
18
- import {
19
- disabledPropertyView ,
20
- hiddenPropertyView ,
21
- } from "comps/utils/propertyUtils" ;
22
17
import { trans } from "i18n" ;
23
18
import { BoolCodeControl } from "comps/controls/codeControl" ;
24
19
import { DisabledContext } from "comps/generators/uiCompBuilder" ;
25
- import React , { useContext , useEffect , useState } from "react" ;
26
- import { EditorContext } from "comps/editorState " ;
27
-
20
+ import React from "react" ;
21
+ import { viewMode } from "@lowcoder-ee/util/editor " ;
22
+ const PropertyView = React . lazy ( async ( ) => await import ( "./propertyView" ) ) ;
28
23
export const ContainerBaseComp = ( function ( ) {
29
24
const childrenMap = {
30
25
disabled : BoolCodeControl ,
31
26
icon : withDefault ( ShapeControl , "" ) ,
32
27
} ;
33
- return new ContainerCompBuilder ( childrenMap , ( props , dispatch ) => {
28
+ let builder = new ContainerCompBuilder ( childrenMap , ( props , dispatch ) => {
34
29
35
30
36
31
return (
@@ -39,42 +34,10 @@ export const ContainerBaseComp = (function () {
39
34
</ DisabledContext . Provider >
40
35
) ;
41
36
} )
42
- . setPropertyViewFn ( ( children ) => {
43
- return (
44
- < >
45
- < Section name = { 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
- < Section name = { sectionNames . interaction } >
54
- { disabledPropertyView ( children ) }
55
- { hiddenPropertyView ( children ) }
56
- </ Section >
57
- ) }
58
-
59
- { ( useContext ( EditorContext ) . editorModeStatus === "layout" ||
60
- useContext ( EditorContext ) . editorModeStatus === "both" ) && (
61
- < >
62
- < Section name = { sectionNames . layout } >
63
- { children . container . getPropertyView ( ) }
64
- </ Section >
65
- < Section name = { sectionNames . style } >
66
- { children . container . stylePropertyView ( ) }
67
- </ Section >
68
- { children . container . children . showBody . getView ( ) && (
69
- < Section name = { "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
+ return builder
78
41
. build ( ) ;
79
42
} ) ( ) ;
80
43
0 commit comments