@@ -34,6 +34,8 @@ import { EditorContext } from "comps/editorState";
34
34
import { checkIsMobile } from "util/commonUtils" ;
35
35
import { messageInstance } from "lowcoder-design" ;
36
36
import { BoolControl } from "comps/controls/boolControl" ;
37
+ import { PositionControl } from "comps/controls/dropdownControl" ;
38
+ import { NumberControl , StringControl } from "@lowcoder-ee/index.sdk" ;
37
39
38
40
const EVENT_OPTIONS = [
39
41
{
@@ -52,12 +54,15 @@ const childrenMap = {
52
54
} ) ,
53
55
autoHeight : AutoHeightControl ,
54
56
scrollbars : withDefault ( BoolControl , false ) ,
57
+ placement : withDefault ( PositionControl , "top" ) ,
55
58
onEvent : eventHandlerControl ( EVENT_OPTIONS ) ,
56
59
disabled : BoolCodeControl ,
57
60
showHeader : withDefault ( BoolControl , true ) ,
58
61
style : styleControl ( TabContainerStyle ) ,
59
62
headerStyle : styleControl ( ContainerHeaderStyle ) ,
60
63
bodyStyle : styleControl ( ContainerBodyStyle ) ,
64
+ tabsGutter : withDefault ( NumberControl , 32 ) ,
65
+ tabsCentered : withDefault ( BoolControl , false ) ,
61
66
} ;
62
67
63
68
type ViewProps = RecordConstructorToView < typeof childrenMap > ;
@@ -114,6 +119,7 @@ const getStyle = (
114
119
}
115
120
116
121
.ant-tabs-tab-btn {
122
+ font-size : ${ style . textSize } ;
117
123
font-family : ${ style . fontFamily } ;
118
124
font-weight : ${ style . textWeight } ;
119
125
text-transform : ${ style . textTransform } ;
@@ -177,7 +183,7 @@ const StyledTabs = styled(Tabs)<{
177
183
178
184
const ContainerInTab = ( props : ContainerBaseProps ) => {
179
185
return (
180
- < InnerGrid { ...props } emptyRows = { 15 } bgColor = { "white" } hintPlaceholder = { HintPlaceHolder } />
186
+ < InnerGrid { ...props } emptyRows = { 15 } hintPlaceholder = { HintPlaceHolder } />
181
187
) ;
182
188
} ;
183
189
@@ -254,28 +260,33 @@ const TabbedContainer = (props: TabbedContainerProps) => {
254
260
} )
255
261
256
262
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 >
279
290
) ;
280
291
} ;
281
292
@@ -303,14 +314,17 @@ export const TabbedContainerBaseComp = (function () {
303
314
< Section name = { sectionNames . interaction } >
304
315
{ children . onEvent . getPropertyView ( ) }
305
316
{ disabledPropertyView ( children ) }
306
- { children . showHeader . propertyView ( { label : trans ( "prop.showHeader " ) } ) }
317
+ { children . showHeader . propertyView ( { label : trans ( "tabbedContainer.showTabs " ) } ) }
307
318
{ hiddenPropertyView ( children ) }
308
319
</ Section >
309
320
) }
310
321
311
322
{ [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
312
323
< >
313
324
< 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" ) } ) }
314
328
{ children . autoHeight . getPropertyView ( ) }
315
329
{ ! children . autoHeight . getView ( ) && (
316
330
children . scrollbars . propertyView ( {
0 commit comments