@@ -34,6 +34,8 @@ import { EditorContext } from "comps/editorState";
3434import { checkIsMobile } from "util/commonUtils" ;
3535import { messageInstance } from "lowcoder-design" ;
3636import { BoolControl } from "comps/controls/boolControl" ;
37+ import { PositionControl } from "comps/controls/dropdownControl" ;
38+ import { NumberControl , StringControl } from "@lowcoder-ee/index.sdk" ;
3739
3840const EVENT_OPTIONS = [
3941 {
@@ -52,12 +54,15 @@ const childrenMap = {
5254 } ) ,
5355 autoHeight : AutoHeightControl ,
5456 scrollbars : withDefault ( BoolControl , false ) ,
57+ placement : withDefault ( PositionControl , "top" ) ,
5558 onEvent : eventHandlerControl ( EVENT_OPTIONS ) ,
5659 disabled : BoolCodeControl ,
5760 showHeader : withDefault ( BoolControl , true ) ,
5861 style : styleControl ( TabContainerStyle ) ,
5962 headerStyle : styleControl ( ContainerHeaderStyle ) ,
6063 bodyStyle : styleControl ( ContainerBodyStyle ) ,
64+ tabsGutter : withDefault ( NumberControl , 32 ) ,
65+ tabsCentered : withDefault ( BoolControl , false ) ,
6166} ;
6267
6368type ViewProps = RecordConstructorToView < typeof childrenMap > ;
@@ -114,6 +119,7 @@ const getStyle = (
114119 }
115120
116121 .ant-tabs-tab-btn {
122+ font-size : ${ style . textSize } ;
117123 font-family : ${ style . fontFamily } ;
118124 font-weight : ${ style . textWeight } ;
119125 text-transform : ${ style . textTransform } ;
@@ -177,7 +183,7 @@ const StyledTabs = styled(Tabs)<{
177183
178184const ContainerInTab = ( props : ContainerBaseProps ) => {
179185 return (
180- < InnerGrid { ...props } emptyRows = { 15 } bgColor = { "white" } hintPlaceholder = { HintPlaceHolder } />
186+ < InnerGrid { ...props } emptyRows = { 15 } hintPlaceholder = { HintPlaceHolder } />
181187 ) ;
182188} ;
183189
@@ -254,28 +260,33 @@ const TabbedContainer = (props: TabbedContainerProps) => {
254260 } )
255261
256262 return (
257- < div style = { { padding : props . style . margin , height : '100%' } } >
258- < StyledTabs
259- // FALK: TODO tabPosition="right"
260- activeKey = { activeKey }
261- $style = { style }
262- $headerStyle = { headerStyle }
263- $bodyStyle = { bodyStyle }
264- $showHeader = { showHeader }
265- onChange = { ( key ) => {
266- if ( key !== props . selectedTabKey . value ) {
267- props . selectedTabKey . onChange ( key ) ;
268- props . onEvent ( "change" ) ;
269- }
270- } }
271- onTabClick = { onTabClick }
272- animated
273- $isMobile = { isMobile }
274- // tabBarGutter={32}
275- items = { tabItems }
276- >
277- </ StyledTabs >
278- </ div >
263+ < ScrollBar style = { { height : props . autoHeight ? "100%" : "auto" , margin : "0px" , padding : "0px" } } hideScrollbar = { ! props . scrollbars } >
264+ < div style = { { padding : props . style . margin , height : props . autoHeight ? "100%" : "auto" } } >
265+ < BackgroundColorContext . Provider value = { headerStyle . headerBackground } >
266+ < StyledTabs
267+ tabPosition = { props . placement }
268+ activeKey = { activeKey }
269+ $style = { style }
270+ $headerStyle = { headerStyle }
271+ $bodyStyle = { bodyStyle }
272+ $showHeader = { showHeader }
273+ onChange = { ( key ) => {
274+ if ( key !== props . selectedTabKey . value ) {
275+ props . selectedTabKey . onChange ( key ) ;
276+ props . onEvent ( "change" ) ;
277+ }
278+ } }
279+ onTabClick = { onTabClick }
280+ animated
281+ $isMobile = { isMobile }
282+ items = { tabItems }
283+ tabBarGutter = { props . tabsGutter }
284+ centered = { props . tabsCentered }
285+ >
286+ </ StyledTabs >
287+ </ BackgroundColorContext . Provider >
288+ </ div >
289+ </ ScrollBar >
279290 ) ;
280291} ;
281292
@@ -303,14 +314,17 @@ export const TabbedContainerBaseComp = (function () {
303314 < Section name = { sectionNames . interaction } >
304315 { children . onEvent . getPropertyView ( ) }
305316 { disabledPropertyView ( children ) }
306- { children . showHeader . propertyView ( { label : trans ( "prop.showHeader " ) } ) }
317+ { children . showHeader . propertyView ( { label : trans ( "tabbedContainer.showTabs " ) } ) }
307318 { hiddenPropertyView ( children ) }
308319 </ Section >
309320 ) }
310321
311322 { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
312323 < >
313324 < Section name = { sectionNames . layout } >
325+ { children . placement . propertyView ( { label : trans ( "tabbedContainer.placement" ) , radioButton : true } ) }
326+ { children . tabsCentered . propertyView ( { label : trans ( "tabbedContainer.tabsCentered" ) } ) }
327+ { children . tabsGutter . propertyView ( { label : trans ( "tabbedContainer.gutter" ) , tooltip : trans ( "tabbedContainer.gutterTooltip" ) } ) }
314328 { children . autoHeight . getPropertyView ( ) }
315329 { ! children . autoHeight . getView ( ) && (
316330 children . scrollbars . propertyView ( {
0 commit comments