@@ -3,7 +3,7 @@ import { JSONObject, JSONValue } from "util/jsonTypes";
33import { CompAction , CompActionTypes , deleteCompAction , wrapChildAction } from "lowcoder-core" ;
44import { DispatchType , RecordConstructorToView , wrapDispatch } from "lowcoder-core" ;
55import { AutoHeightControl } from "comps/controls/autoHeightControl" ;
6- import { BooleanStateControl , booleanExposingStateControl , stringExposingStateControl } from "comps/controls/codeStateControl" ;
6+ import { stringExposingStateControl } from "comps/controls/codeStateControl" ;
77import { eventHandlerControl } from "comps/controls/eventHandlerControl" ;
88import { TabsOptionControl } from "comps/controls/optionsControl" ;
99import { styleControl } from "comps/controls/styleControl" ;
@@ -12,7 +12,7 @@ import { sameTypeMap, UICompBuilder, withDefault } from "comps/generators";
1212import { addMapChildAction } from "comps/generators/sameTypeMap" ;
1313import { NameConfig , NameConfigHidden , withExposingConfigs } from "comps/generators/withExposing" ;
1414import { NameGenerator } from "comps/utils" ;
15- import { ControlNode , Section , sectionNames } from "lowcoder-design" ;
15+ import { ScrollBar , Section , sectionNames } from "lowcoder-design" ;
1616import { HintPlaceHolder } from "lowcoder-design" ;
1717import _ from "lodash" ;
1818import React , { useCallback , useContext } from "react" ;
@@ -33,6 +33,7 @@ import { DisabledContext } from "comps/generators/uiCompBuilder";
3333import { EditorContext } from "comps/editorState" ;
3434import { checkIsMobile } from "util/commonUtils" ;
3535import { messageInstance } from "lowcoder-design" ;
36+ import { BoolControl } from "comps/controls/boolControl" ;
3637
3738const EVENT_OPTIONS = [
3839 {
@@ -50,9 +51,10 @@ const childrenMap = {
5051 1 : { layout : { } , items : { } } ,
5152 } ) ,
5253 autoHeight : AutoHeightControl ,
54+ scrollbars : withDefault ( BoolControl , false ) ,
5355 onEvent : eventHandlerControl ( EVENT_OPTIONS ) ,
5456 disabled : BoolCodeControl ,
55- showHeader : withDefault ( BooleanStateControl , " true" ) ,
57+ showHeader : withDefault ( BoolControl , true ) ,
5658 style : styleControl ( TabContainerStyle ) ,
5759 headerStyle : styleControl ( ContainerHeaderStyle ) ,
5860 bodyStyle : styleControl ( ContainerBodyStyle ) ,
@@ -211,7 +213,7 @@ const TabbedContainer = (props: TabbedContainerProps) => {
211213 const editorState = useContext ( EditorContext ) ;
212214 const maxWidth = editorState . getAppSettings ( ) . maxWidth ;
213215 const isMobile = checkIsMobile ( maxWidth ) ;
214- const showHeader = props . showHeader . value ;
216+ const showHeader = props . showHeader . valueOf ( ) ;
215217 const paddingWidth = isMobile ? 8 : 0 ;
216218
217219 const tabItems = visibleTabs . map ( ( tab ) => {
@@ -236,14 +238,16 @@ const TabbedContainer = (props: TabbedContainerProps) => {
236238 forceRender : true ,
237239 children : (
238240 < 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 >
247251 </ BackgroundColorContext . Provider >
248252 )
249253 }
@@ -307,6 +311,11 @@ export const TabbedContainerBaseComp = (function () {
307311 < >
308312 < Section name = { sectionNames . layout } >
309313 { children . autoHeight . getPropertyView ( ) }
314+ { ! children . autoHeight . getView ( ) && (
315+ children . scrollbars . propertyView ( {
316+ label : trans ( "prop.scrollbar" ) ,
317+ } )
318+ ) }
310319 </ Section >
311320 < Section name = { sectionNames . style } >
312321 { children . style . getPropertyView ( ) }
0 commit comments