@@ -33,11 +33,14 @@ import { BackgroundColorContext } from "comps/utils/backgroundColorContext";
33
33
import { trans } from "i18n" ;
34
34
import { messageInstance } from "lowcoder-design" ;
35
35
import { BoolControl } from "comps/controls/boolControl" ;
36
- import { NumberControl } from "comps/controls/codeControl" ;
36
+ import { BoolCodeControl , NumberControl } from "comps/controls/codeControl" ;
37
37
38
38
import { useContext } from "react" ;
39
39
import { EditorContext } from "comps/editorState" ;
40
40
41
+ import { disabledPropertyView , hiddenPropertyView } from "comps/utils/propertyUtils" ;
42
+ import { DisabledContext } from "comps/generators/uiCompBuilder" ;
43
+
41
44
const RowWrapper = styled ( Row ) < { $style : ResponsiveLayoutRowStyleType } > `
42
45
height: 100%;
43
46
border: 1px solid ${ ( props ) => props . $style . border } ;
@@ -62,7 +65,8 @@ const ColWrapper = styled(Col)<{
62
65
}
63
66
` ;
64
67
65
- const childrenMap = {
68
+ const childrenMap = {
69
+ disabled : BoolCodeControl ,
66
70
columns : ColumnOptionControl ,
67
71
containers : withDefault ( sameTypeMap ( SimpleContainerComp ) , {
68
72
0 : { view : { } , layout : { } } ,
@@ -117,58 +121,60 @@ const ResponsiveLayout = (props: ResponsiveLayoutProps) => {
117
121
118
122
return (
119
123
< BackgroundColorContext . Provider value = { props . rowStyle . background } >
120
- < div style = { { padding : rowStyle . margin , height : '100%' } } >
121
- < RowWrapper
122
- $style = { rowStyle }
123
- wrap = { rowBreak }
124
- gutter = { [ horizontalSpacing , verticalSpacing ] }
125
- >
126
- { columns . map ( column => {
127
- const id = String ( column . id ) ;
128
- const childDispatch = wrapDispatch ( wrapDispatch ( dispatch , "containers" ) , id ) ;
129
- if ( ! containers [ id ] ) return null
130
- const containerProps = containers [ id ] . children ;
124
+ < DisabledContext . Provider value = { props . disabled } >
125
+ < div style = { { padding : rowStyle . margin , height : '100%' } } >
126
+ < RowWrapper
127
+ $style = { rowStyle }
128
+ wrap = { rowBreak }
129
+ gutter = { [ horizontalSpacing , verticalSpacing ] }
130
+ >
131
+ { columns . map ( column => {
132
+ const id = String ( column . id ) ;
133
+ const childDispatch = wrapDispatch ( wrapDispatch ( dispatch , "containers" ) , id ) ;
134
+ if ( ! containers [ id ] ) return null
135
+ const containerProps = containers [ id ] . children ;
131
136
132
- const columnCustomStyle = {
133
- margin : ! _ . isEmpty ( column . margin ) ? column . margin : columnStyle . margin ,
134
- padding : ! _ . isEmpty ( column . padding ) ? column . padding : columnStyle . padding ,
135
- radius : ! _ . isEmpty ( column . radius ) ? column . radius : columnStyle . radius ,
136
- border : `1px solid ${ ! _ . isEmpty ( column . border ) ? column . border : columnStyle . border } ` ,
137
- background : ! _ . isEmpty ( column . background ) ? column . background : columnStyle . background ,
138
- }
139
- const noOfColumns = columns . length ;
140
- let backgroundStyle = columnCustomStyle . background ;
141
- if ( ! _ . isEmpty ( column . backgroundImage ) ) {
142
- backgroundStyle = `center / cover url('${ column . backgroundImage } ') no-repeat, ${ backgroundStyle } ` ;
137
+ const columnCustomStyle = {
138
+ margin : ! _ . isEmpty ( column . margin ) ? column . margin : columnStyle . margin ,
139
+ padding : ! _ . isEmpty ( column . padding ) ? column . padding : columnStyle . padding ,
140
+ radius : ! _ . isEmpty ( column . radius ) ? column . radius : columnStyle . radius ,
141
+ border : `1px solid ${ ! _ . isEmpty ( column . border ) ? column . border : columnStyle . border } ` ,
142
+ background : ! _ . isEmpty ( column . background ) ? column . background : columnStyle . background ,
143
+ }
144
+ const noOfColumns = columns . length ;
145
+ let backgroundStyle = columnCustomStyle . background ;
146
+ if ( ! _ . isEmpty ( column . backgroundImage ) ) {
147
+ backgroundStyle = `center / cover url('${ column . backgroundImage } ') no-repeat, ${ backgroundStyle } ` ;
148
+ }
149
+ return (
150
+ < ColWrapper
151
+ key = { id }
152
+ lg = { 24 / ( noOfColumns < columnPerRowLG ? noOfColumns : columnPerRowLG ) }
153
+ md = { 24 / ( noOfColumns < columnPerRowMD ? noOfColumns : columnPerRowMD ) }
154
+ sm = { 24 / ( noOfColumns < columnPerRowSM ? noOfColumns : columnPerRowSM ) }
155
+ xs = { 24 / ( noOfColumns < columnPerRowSM ? noOfColumns : columnPerRowSM ) }
156
+ $style = { columnCustomStyle }
157
+ $minWidth = { column . minWidth }
158
+ $matchColumnsHeight = { matchColumnsHeight }
159
+ >
160
+ < ColumnContainer
161
+ layout = { containerProps . layout . getView ( ) }
162
+ items = { gridItemCompToGridItems ( containerProps . items . getView ( ) ) }
163
+ positionParams = { containerProps . positionParams . getView ( ) }
164
+ dispatch = { childDispatch }
165
+ autoHeight = { props . autoHeight }
166
+ style = { {
167
+ ...columnCustomStyle ,
168
+ background : backgroundStyle ,
169
+ } }
170
+ />
171
+ </ ColWrapper >
172
+ )
173
+ } )
143
174
}
144
- return (
145
- < ColWrapper
146
- key = { id }
147
- lg = { 24 / ( noOfColumns < columnPerRowLG ? noOfColumns : columnPerRowLG ) }
148
- md = { 24 / ( noOfColumns < columnPerRowMD ? noOfColumns : columnPerRowMD ) }
149
- sm = { 24 / ( noOfColumns < columnPerRowSM ? noOfColumns : columnPerRowSM ) }
150
- xs = { 24 / ( noOfColumns < columnPerRowSM ? noOfColumns : columnPerRowSM ) }
151
- $style = { columnCustomStyle }
152
- $minWidth = { column . minWidth }
153
- $matchColumnsHeight = { matchColumnsHeight }
154
- >
155
- < ColumnContainer
156
- layout = { containerProps . layout . getView ( ) }
157
- items = { gridItemCompToGridItems ( containerProps . items . getView ( ) ) }
158
- positionParams = { containerProps . positionParams . getView ( ) }
159
- dispatch = { childDispatch }
160
- autoHeight = { props . autoHeight }
161
- style = { {
162
- ...columnCustomStyle ,
163
- background : backgroundStyle ,
164
- } }
165
- />
166
- </ ColWrapper >
167
- )
168
- } )
169
- }
170
- </ RowWrapper >
171
- </ div >
175
+ </ RowWrapper >
176
+ </ div >
177
+ </ DisabledContext . Provider >
172
178
</ BackgroundColorContext . Provider >
173
179
) ;
174
180
} ;
@@ -189,6 +195,13 @@ export const ResponsiveLayoutBaseComp = (function () {
189
195
} ) }
190
196
</ Section >
191
197
198
+ { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
199
+ < Section name = { sectionNames . interaction } >
200
+ { disabledPropertyView ( children ) }
201
+ { hiddenPropertyView ( children ) }
202
+ </ Section >
203
+ ) }
204
+
192
205
{ [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
193
206
< >
194
207
< Section name = { sectionNames . layout } >
0 commit comments