@@ -3,7 +3,7 @@ import { JSONObject, JSONValue } from "util/jsonTypes";
3
3
import { CompAction , CompActionTypes , deleteCompAction , wrapChildAction } from "lowcoder-core" ;
4
4
import { DispatchType , RecordConstructorToView , wrapDispatch } from "lowcoder-core" ;
5
5
import { AutoHeightControl } from "comps/controls/autoHeightControl" ;
6
- import { BooleanStateControl , booleanExposingStateControl , stringExposingStateControl } from "comps/controls/codeStateControl" ;
6
+ import { stringExposingStateControl } from "comps/controls/codeStateControl" ;
7
7
import { eventHandlerControl } from "comps/controls/eventHandlerControl" ;
8
8
import { TabsOptionControl } from "comps/controls/optionsControl" ;
9
9
import { styleControl } from "comps/controls/styleControl" ;
@@ -12,7 +12,7 @@ import { sameTypeMap, UICompBuilder, withDefault } from "comps/generators";
12
12
import { addMapChildAction } from "comps/generators/sameTypeMap" ;
13
13
import { NameConfig , NameConfigHidden , withExposingConfigs } from "comps/generators/withExposing" ;
14
14
import { NameGenerator } from "comps/utils" ;
15
- import { ControlNode , Section , sectionNames } from "lowcoder-design" ;
15
+ import { ScrollBar , Section , sectionNames } from "lowcoder-design" ;
16
16
import { HintPlaceHolder } from "lowcoder-design" ;
17
17
import _ from "lodash" ;
18
18
import React , { useCallback , useContext } from "react" ;
@@ -33,6 +33,7 @@ import { DisabledContext } from "comps/generators/uiCompBuilder";
33
33
import { EditorContext } from "comps/editorState" ;
34
34
import { checkIsMobile } from "util/commonUtils" ;
35
35
import { messageInstance } from "lowcoder-design" ;
36
+ import { BoolControl } from "comps/controls/boolControl" ;
36
37
37
38
const EVENT_OPTIONS = [
38
39
{
@@ -50,9 +51,10 @@ const childrenMap = {
50
51
1 : { layout : { } , items : { } } ,
51
52
} ) ,
52
53
autoHeight : AutoHeightControl ,
54
+ scrollbars : withDefault ( BoolControl , false ) ,
53
55
onEvent : eventHandlerControl ( EVENT_OPTIONS ) ,
54
56
disabled : BoolCodeControl ,
55
- showHeader : withDefault ( BooleanStateControl , " true" ) ,
57
+ showHeader : withDefault ( BoolControl , true ) ,
56
58
style : styleControl ( TabContainerStyle ) ,
57
59
headerStyle : styleControl ( ContainerHeaderStyle ) ,
58
60
bodyStyle : styleControl ( ContainerBodyStyle ) ,
@@ -211,7 +213,7 @@ const TabbedContainer = (props: TabbedContainerProps) => {
211
213
const editorState = useContext ( EditorContext ) ;
212
214
const maxWidth = editorState . getAppSettings ( ) . maxWidth ;
213
215
const isMobile = checkIsMobile ( maxWidth ) ;
214
- const showHeader = props . showHeader . value ;
216
+ const showHeader = props . showHeader . valueOf ( ) ;
215
217
const paddingWidth = isMobile ? 8 : 0 ;
216
218
217
219
const tabItems = visibleTabs . map ( ( tab ) => {
@@ -236,14 +238,16 @@ const TabbedContainer = (props: TabbedContainerProps) => {
236
238
forceRender : true ,
237
239
children : (
238
240
< BackgroundColorContext . Provider value = { bodyStyle . background } >
239
- < ContainerInTab
240
- layout = { containerProps . layout . getView ( ) }
241
- items = { gridItemCompToGridItems ( containerProps . items . getView ( ) ) }
242
- positionParams = { containerProps . positionParams . getView ( ) }
243
- dispatch = { childDispatch }
244
- autoHeight = { props . autoHeight }
245
- containerPadding = { [ paddingWidth , 20 ] }
246
- />
241
+ < ScrollBar style = { { height : props . autoHeight ? "100%" : "auto" , margin : "0px" , padding : "0px" } } hideScrollbar = { ! props . scrollbars } >
242
+ < ContainerInTab
243
+ layout = { containerProps . layout . getView ( ) }
244
+ items = { gridItemCompToGridItems ( containerProps . items . getView ( ) ) }
245
+ positionParams = { containerProps . positionParams . getView ( ) }
246
+ dispatch = { childDispatch }
247
+ autoHeight = { props . autoHeight }
248
+ containerPadding = { [ paddingWidth , 20 ] }
249
+ />
250
+ </ ScrollBar >
247
251
</ BackgroundColorContext . Provider >
248
252
)
249
253
}
@@ -307,6 +311,11 @@ export const TabbedContainerBaseComp = (function () {
307
311
< >
308
312
< Section name = { sectionNames . layout } >
309
313
{ children . autoHeight . getPropertyView ( ) }
314
+ { ! children . autoHeight . getView ( ) && (
315
+ children . scrollbars . propertyView ( {
316
+ label : trans ( "prop.scrollbar" ) ,
317
+ } )
318
+ ) }
310
319
</ Section >
311
320
< Section name = { sectionNames . style } >
312
321
{ children . style . getPropertyView ( ) }
0 commit comments