1
- import { CompParams } from 'lowcoder-core' ;
2
- import { ToDataType } from 'comps/generators/multi' ;
3
- import {
4
- NameConfigDisabled ,
5
- NameConfigHidden ,
6
- withExposingConfigs ,
7
- NameConfig ,
8
- CompDepsConfig ,
9
- } from 'comps/generators/withExposing' ;
10
- import { withMethodExposing } from 'comps/generators/withMethodExposing' ;
11
- import { NameGenerator } from 'comps/utils/nameGenerator' ;
12
- import { Section , sectionNames } from 'lowcoder-design' ;
13
- import { oldContainerParamsToNew } from '../containerBase' ;
14
- import { toSimpleContainerData } from '../containerBase/simpleContainerComp' ;
15
- import {
16
- disabledPropertyView ,
17
- hiddenPropertyView ,
18
- } from 'comps/utils/propertyUtils' ;
19
- import { trans } from 'i18n' ;
20
- import { BoolCodeControl } from 'comps/controls/codeControl' ;
21
- import { DisabledContext } from 'comps/generators/uiCompBuilder' ;
22
- import React , { useContext , useEffect , useState } from 'react' ;
23
- import { EditorContext } from 'comps/editorState' ;
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" ;
24
15
25
- import {
26
- ContainerChildren ,
27
- ContainerCompBuilder ,
28
- } from '../pageLayoutComp/pageLayoutCompBuilder' ;
29
- import { PageLayout } from '../pageLayoutComp/pageLayout' ;
30
- import { AnimationStyle , styleControl } from '@lowcoder-ee/index.sdk' ;
16
+ import { ContainerChildren , ContainerCompBuilder } from "../pageLayoutComp/pageLayoutCompBuilder" ;
17
+ import { PageLayout } from "../pageLayoutComp/pageLayout" ;
18
+ import { AnimationStyle , styleControl } from "@lowcoder-ee/index.sdk" ;
31
19
32
20
export const ContainerBaseComp = ( function ( ) {
33
21
const childrenMap = {
@@ -51,17 +39,17 @@ export const ContainerBaseComp = (function () {
51
39
. setPropertyViewFn ( ( children ) => {
52
40
return (
53
41
< >
54
- { ( useContext ( EditorContext ) . editorModeStatus === ' logic' ||
55
- useContext ( EditorContext ) . editorModeStatus === ' both' ) && (
42
+ { ( useContext ( EditorContext ) . editorModeStatus === " logic" ||
43
+ useContext ( EditorContext ) . editorModeStatus === " both" ) && (
56
44
< Section name = { sectionNames . interaction } >
57
45
{ disabledPropertyView ( children ) }
58
46
{ hiddenPropertyView ( children ) }
59
47
{ children . container . appSelectorPropertyView ( ) }
60
48
</ Section >
61
49
) }
62
50
63
- { ( useContext ( EditorContext ) . editorModeStatus === ' layout' ||
64
- useContext ( EditorContext ) . editorModeStatus === ' both' ) && (
51
+ { ( useContext ( EditorContext ) . editorModeStatus === " layout" ||
52
+ useContext ( EditorContext ) . editorModeStatus === " both" ) && (
65
53
< >
66
54
< Section name = { sectionNames . layout } >
67
55
{ children . container . getPropertyView ( ) }
@@ -73,20 +61,20 @@ export const ContainerBaseComp = (function () {
73
61
{ children . animationStyle . getPropertyView ( ) }
74
62
</ Section >
75
63
{ children . container . children . showHeader . getView ( ) && (
76
- < Section name = { ' Header Style' } >
64
+ < Section name = { " Header Style" } >
77
65
{ children . container . headerStylePropertyView ( ) }
78
66
</ Section >
79
67
) }
80
68
{ children . container . children . showSider . getView ( ) && (
81
- < Section name = { ' Sider Style' } >
69
+ < Section name = { " Sider Style" } >
82
70
{ children . container . siderStylePropertyView ( ) }
83
71
</ Section >
84
72
) }
85
- < Section name = { ' Body Style' } >
73
+ < Section name = { " Body Style" } >
86
74
{ children . container . bodyStylePropertyView ( ) }
87
75
</ Section >
88
76
{ children . container . children . showFooter . getView ( ) && (
89
- < Section name = { ' Footer Style' } >
77
+ < Section name = { " Footer Style" } >
90
78
{ children . container . footerStylePropertyView ( ) }
91
79
</ Section >
92
80
) }
@@ -108,7 +96,7 @@ function convertOldContainerParams(params: CompParams<any>) {
108
96
// old params
109
97
if (
110
98
container &&
111
- ( container . hasOwnProperty ( ' layout' ) || container . hasOwnProperty ( ' items' ) )
99
+ ( container . hasOwnProperty ( " layout" ) || container . hasOwnProperty ( " items" ) )
112
100
) {
113
101
const autoHeight = tempParams . value . autoHeight ;
114
102
const scrollbars = tempParams . value . scrollbars ;
@@ -140,23 +128,23 @@ const PageLayoutCompTmP = withExposingConfigs(ContainerTmpComp, [
140
128
NameConfigHidden ,
141
129
NameConfigDisabled ,
142
130
143
- new NameConfig ( ' container' , trans ( ' export.ratingValueDesc' ) ) ,
131
+ new NameConfig ( " container" , trans ( " export.ratingValueDesc" ) ) ,
144
132
new CompDepsConfig (
145
- ' siderCollapsed' ,
133
+ " siderCollapsed" ,
146
134
( comp ) => ( {
147
135
data : comp . children . container . children . siderCollapsed . nodeWithoutCache ( ) ,
148
136
} ) ,
149
137
( input ) => input . data . value ,
150
- trans ( ' listView.itemsDesc' )
138
+ trans ( " listView.itemsDesc" )
151
139
) ,
152
140
] ) ;
153
141
154
142
export const PageLayoutComp = withMethodExposing ( PageLayoutCompTmP , [
155
143
{
156
144
method : {
157
- name : ' setSiderCollapsed' ,
158
- description : ' Set the Sider of the PageLayout to be collapsed or not' ,
159
- params : [ { name : ' collapsed' , type : ' boolean' } ] ,
145
+ name : " setSiderCollapsed" ,
146
+ description : " Set the Sider of the PageLayout to be collapsed or not" ,
147
+ params : [ { name : " collapsed" , type : " boolean" } ] ,
160
148
} ,
161
149
execute : ( comp , values ) => {
162
150
const page = values [ 0 ] as number ;
@@ -178,44 +166,44 @@ export function defaultPageLayoutData(
178
166
header : toSimpleContainerData ( [
179
167
{
180
168
item : {
181
- compType : ' navigation' ,
182
- name : nameGenerator . genItemName ( ' pageNavigation' ) ,
169
+ compType : " navigation" ,
170
+ name : nameGenerator . genItemName ( " pageNavigation" ) ,
183
171
comp : {
184
- logoUrl : '' ,
172
+ logoUrl : "" ,
185
173
hidden : false ,
186
174
items : [
187
175
{
188
- label : ' Home' ,
176
+ label : " Home" ,
189
177
hidden : false ,
190
178
active : false ,
191
179
} ,
192
180
{
193
- label : ' Services' ,
181
+ label : " Services" ,
194
182
hidden : false ,
195
183
active : false ,
196
184
items : [
197
185
{
198
- label : ' Lowcode Platform' ,
186
+ label : " Lowcode Platform" ,
199
187
hidden : false ,
200
188
active : false ,
201
189
} ,
202
190
{
203
- label : ' App Development' ,
191
+ label : " App Development" ,
204
192
hidden : false ,
205
193
active : false ,
206
194
} ,
207
195
] ,
208
196
} ,
209
197
{
210
- label : ' About' ,
198
+ label : " About" ,
211
199
hidden : false ,
212
200
active : false ,
213
201
} ,
214
202
] ,
215
203
} ,
216
204
} ,
217
205
layoutItem : {
218
- i : '' ,
206
+ i : "" ,
219
207
h : 6 ,
220
208
w : 24 ,
221
209
x : 0 ,
0 commit comments