@@ -17,7 +17,7 @@ import { sameTypeMap, UICompBuilder, withDefault } from "comps/generators";
17
17
import { addMapChildAction } from "comps/generators/sameTypeMap" ;
18
18
import { NameConfigHidden , withExposingConfigs } from "comps/generators/withExposing" ;
19
19
import { NameGenerator } from "comps/utils" ;
20
- import { Section , controlItem , sectionNames } from "lowcoder-design" ;
20
+ import { ScrollBar , Section , controlItem , sectionNames } from "lowcoder-design" ;
21
21
import { HintPlaceHolder } from "lowcoder-design" ;
22
22
import _ from "lodash" ;
23
23
import styled from "styled-components" ;
@@ -96,6 +96,7 @@ const childrenMap = {
96
96
templateRows : withDefault ( StringControl , "1fr" ) ,
97
97
rowGap : withDefault ( StringControl , "20px" ) ,
98
98
templateColumns : withDefault ( StringControl , "1fr 1fr" ) ,
99
+ mainScrollbar : withDefault ( BoolControl , false ) ,
99
100
columnGap : withDefault ( StringControl , "20px" ) ,
100
101
style : styleControl ( ContainerStyle , 'style' ) ,
101
102
columnStyle : styleControl ( ResponsiveLayoutColStyle , 'columnStyle' )
@@ -133,48 +134,53 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
133
134
columnGap,
134
135
columnStyle,
135
136
horizontalGridCells,
137
+ mainScrollbar
136
138
} = props ;
137
139
138
140
return (
139
141
< BackgroundColorContext . Provider value = { props . style . background } >
140
142
< DisabledContext . Provider value = { props . disabled } >
141
- < ContainWrapper $style = { {
142
- ...props . style ,
143
- display : "grid" ,
144
- gridTemplateColumns : templateColumns ,
145
- columnGap,
146
- gridTemplateRows : templateRows ,
147
- rowGap,
148
- } } >
149
- { columns . map ( column => {
150
- const id = String ( column . id ) ;
151
- const childDispatch = wrapDispatch ( wrapDispatch ( dispatch , "containers" ) , id ) ;
152
- if ( ! containers [ id ] ) return null
153
- const containerProps = containers [ id ] . children ;
154
- const noOfColumns = columns . length ;
155
- return (
156
- < BackgroundColorContext . Provider value = { props . columnStyle . background } >
157
- < ColWrapper
158
- key = { id }
159
- $style = { props . columnStyle }
160
- $minWidth = { column . minWidth }
161
- $matchColumnsHeight = { matchColumnsHeight }
162
- >
163
- < ColumnContainer
164
- layout = { containerProps . layout . getView ( ) }
165
- items = { gridItemCompToGridItems ( containerProps . items . getView ( ) ) }
166
- horizontalGridCells = { horizontalGridCells }
167
- positionParams = { containerProps . positionParams . getView ( ) }
168
- dispatch = { childDispatch }
169
- autoHeight = { props . autoHeight }
170
- style = { columnStyle }
171
- />
172
- </ ColWrapper >
173
- </ BackgroundColorContext . Provider >
174
- )
175
- } )
176
- }
177
- </ ContainWrapper >
143
+ < div style = { { height : "inherit" , overflow : "auto" } } >
144
+ < ScrollBar style = { { margin : "0px" , padding : "0px" } } overflow = "scroll" hideScrollbar = { ! mainScrollbar } >
145
+ < ContainWrapper $style = { {
146
+ ...props . style ,
147
+ display : "grid" ,
148
+ gridTemplateColumns : templateColumns ,
149
+ columnGap,
150
+ gridTemplateRows : templateRows ,
151
+ rowGap,
152
+ } } >
153
+ { columns . map ( column => {
154
+ const id = String ( column . id ) ;
155
+ const childDispatch = wrapDispatch ( wrapDispatch ( dispatch , "containers" ) , id ) ;
156
+ if ( ! containers [ id ] ) return null
157
+ const containerProps = containers [ id ] . children ;
158
+ const noOfColumns = columns . length ;
159
+ return (
160
+ < BackgroundColorContext . Provider value = { props . columnStyle . background } >
161
+ < ColWrapper
162
+ key = { id }
163
+ $style = { props . columnStyle }
164
+ $minWidth = { column . minWidth }
165
+ $matchColumnsHeight = { matchColumnsHeight }
166
+ >
167
+ < ColumnContainer
168
+ layout = { containerProps . layout . getView ( ) }
169
+ items = { gridItemCompToGridItems ( containerProps . items . getView ( ) ) }
170
+ horizontalGridCells = { horizontalGridCells }
171
+ positionParams = { containerProps . positionParams . getView ( ) }
172
+ dispatch = { childDispatch }
173
+ autoHeight = { props . autoHeight }
174
+ style = { columnStyle }
175
+ />
176
+ </ ColWrapper >
177
+ </ BackgroundColorContext . Provider >
178
+ )
179
+ } )
180
+ }
181
+ </ ContainWrapper >
182
+ </ ScrollBar >
183
+ </ div >
178
184
</ DisabledContext . Provider >
179
185
</ BackgroundColorContext . Provider >
180
186
) ;
@@ -207,6 +213,9 @@ export const ResponsiveLayoutBaseComp = (function () {
207
213
< >
208
214
< Section name = { sectionNames . layout } >
209
215
{ children . autoHeight . getPropertyView ( ) }
216
+ { ( ! children . autoHeight . getView ( ) ) && children . mainScrollbar . propertyView ( {
217
+ label : trans ( "prop.mainScrollbar" )
218
+ } ) }
210
219
{ children . horizontalGridCells . propertyView ( {
211
220
label : trans ( 'prop.horizontalGridCells' ) ,
212
221
} ) }
0 commit comments