55 withExposingConfigs ,
66} from "comps/generators/withExposing" ;
77import { NameGenerator } from "comps/utils/nameGenerator" ;
8- import { Section , sectionNames } from "lowcoder-design" ;
98import { oldContainerParamsToNew } from "../containerBase" ;
109import { toSimpleContainerData } from "../containerBase/simpleContainerComp" ;
1110import { 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" ;
2217import { trans } from "i18n" ;
2318import { BoolCodeControl } from "comps/controls/codeControl" ;
2419import { 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" ) ) ;
2823export const ContainerBaseComp = ( function ( ) {
2924 const childrenMap = {
3025 disabled : BoolCodeControl ,
3126 icon : withDefault ( ShapeControl , "" ) ,
3227 } ;
33- return new ContainerCompBuilder ( childrenMap , ( props , dispatch ) => {
28+ let builder = new ContainerCompBuilder ( 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- < 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
7841 . build ( ) ;
7942} ) ( ) ;
8043
0 commit comments