@@ -11,11 +11,11 @@ import { AppSelectComp } from "comps/comps/layout/appSelectComp";
1111import { NameAndExposingInfo } from "comps/utils/exposingTypes" ;
1212import { ConstructorToComp , ConstructorToDataType } from "lowcoder-core" ;
1313import { CanvasContainer } from "comps/comps/gridLayoutComp/canvasView" ;
14- import { CanvasContainerID } from "constants/domLocators" ;
15- import { PreviewContainerID } from "constants/domLocators" ;
14+ import { CanvasContainerID , PreviewContainerID } from "constants/domLocators" ;
1615import { EditorContainer , EmptyContent } from "pages/common/styledComponent" ;
1716import { Layers } from "constants/Layers" ;
1817import { ExternalEditorContext } from "util/context/ExternalEditorContext" ;
18+ import { EditorContext } from "comps/editorState" ;
1919import { default as Skeleton } from "antd/es/skeleton" ;
2020import { hiddenPropertyView } from "comps/utils/propertyUtils" ;
2121import { dropdownControl } from "@lowcoder-ee/comps/controls/dropdownControl" ;
@@ -47,6 +47,21 @@ const TabBarItem = React.lazy(() =>
4747) ;
4848const EventOptions = [ clickEvent ] as const ;
4949
50+ /** Mobile nav editor: tab bar uses position:absolute bottom; this root is the containing block */
51+ const MobileNavCanvasRoot = styled ( CanvasContainer ) `
52+ position: relative;
53+ ` ;
54+
55+ /** Strip shared EditorContainer defaults (16px padding + scrollbar-gutter: stable) for mobile nav */
56+ const MobileNavEditorContainer = styled ( EditorContainer ) `
57+ padding: 0;
58+ padding-right: 0;
59+ scrollbar-gutter: auto;
60+ overflow-x: auto;
61+ overflow-y: auto;
62+ background: transparent;
63+ ` ;
64+
5065const AppViewContainer = styled . div `
5166 position: absolute;
5267 width: 100%;
@@ -221,17 +236,17 @@ const TabBarWrapper = styled.div<{
221236 $readOnly : boolean ,
222237 $canvasBg : string ,
223238 $tabBarHeight : string ,
224- $maxWidth : number ,
225239 $verticalAlignment : string ;
226240} > `
241+ box-sizing: border-box;
227242 max-width: inherit;
228243 background: ${ ( props ) => ( props . $canvasBg ) } ;
229244 margin: 0 auto;
230- position: fixed;
245+ position: ${ ( props ) => ( props . $readOnly ? " fixed" : "absolute" ) } ;
231246 bottom: 0;
232247 left: 0;
233248 right: 0;
234- width: ${ ( props ) => props . $readOnly ? " 100%" : ` ${ props . $maxWidth - 30 } px` } ;
249+ width: 100%;
235250 z-index: ${ Layers . tabBar } ;
236251 padding-bottom: env(safe-area-inset-bottom, 0);
237252
@@ -389,7 +404,6 @@ function convertTreeData(data: any) {
389404
390405function TabBarView ( props : TabBarProps & {
391406 tabBarHeight : string ;
392- maxWidth : number ;
393407 verticalAlignment : string ;
394408 showSeparator : boolean ;
395409 navIconSize : string ;
@@ -404,7 +418,6 @@ function TabBarView(props: TabBarProps & {
404418 $readOnly = { props . readOnly }
405419 $canvasBg = { canvasBg }
406420 $tabBarHeight = { props . tabBarHeight }
407- $maxWidth = { props . maxWidth }
408421 $verticalAlignment = { props . verticalAlignment }
409422 >
410423 < StyledTabBar
@@ -664,6 +677,36 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
664677 const bgColor = ( useContext ( ThemeContext ) ?. theme || defaultTheme ) . canvas ;
665678 const onEvent = comp . children . onEvent . getView ( ) ;
666679
680+ // Pull app-level Theme / Canvas Settings (managed via the left-sidebar
681+ // "Canvas" pane and shared with normal apps + modules). Mobile nav already
682+ // owns its own maxWidth + grid behaviour, so we only consume the
683+ // background + padding subset here.
684+ const editorState = useContext ( EditorContext ) ;
685+ const appSettings = editorState ?. getAppSettings ( ) ;
686+ const canvasBg = appSettings ?. gridBg ;
687+ const canvasBgImage = appSettings ?. gridBgImage ;
688+ const canvasBgImageRepeat = appSettings ?. gridBgImageRepeat || "no-repeat" ;
689+ const canvasBgImageSize = appSettings ?. gridBgImageSize || "cover" ;
690+ const canvasBgImagePosition = appSettings ?. gridBgImagePosition || "center" ;
691+ const canvasBgImageOrigin = appSettings ?. gridBgImageOrigin || "padding-box" ;
692+ const canvasPaddingX = appSettings ?. gridPaddingX ?? 0 ;
693+ const canvasPaddingY = appSettings ?. gridPaddingY ?? 0 ;
694+
695+ const canvasBackgroundStyle : React . CSSProperties = {
696+ background : "#FFFFFF" ,
697+ } ;
698+ if ( canvasBg ) {
699+ canvasBackgroundStyle . background = canvasBg ;
700+ }
701+ if ( canvasBgImage ) {
702+ canvasBackgroundStyle . backgroundImage = `url('${ canvasBgImage } ')` ;
703+ canvasBackgroundStyle . backgroundRepeat = canvasBgImageRepeat ;
704+ canvasBackgroundStyle . backgroundSize = canvasBgImageSize ;
705+ canvasBackgroundStyle . backgroundPosition = canvasBgImagePosition ;
706+ canvasBackgroundStyle . backgroundOrigin = canvasBgImageOrigin ;
707+ }
708+ const canvasContentPadding = `${ canvasPaddingY } px ${ canvasPaddingX } px` ;
709+
667710 const getContainer = useCallback ( ( ) =>
668711 document . querySelector ( `#${ PreviewContainerID } ` ) ||
669712 document . querySelector ( `#${ CanvasContainerID } ` ) ||
@@ -702,7 +745,7 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
702745 currentTab . children . app . getView ( ) ) || (
703746 < EmptyContent
704747 text = { readOnly ? "" : trans ( "aggregation.emptyTabTooltip" ) }
705- style = { { height : "100%" , backgroundColor : "white" } }
748+ style = { { height : "100%" } }
706749 />
707750 ) ;
708751 }
@@ -712,7 +755,7 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
712755 currentTab . children . action . getView ( ) ) || (
713756 < EmptyContent
714757 text = { readOnly ? "" : trans ( "aggregation.emptyTabTooltip" ) }
715- style = { { height : "100%" , backgroundColor : "white" } }
758+ style = { { height : "100%" } }
716759 />
717760 )
718761 } , [ tabIndex , tabViews , dataOptionType ] ) ;
@@ -769,7 +812,6 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
769812 tabItemActiveStyle = { navItemActiveStyle }
770813 tabBarHeight = { tabBarHeight }
771814 navIconSize = { navIconSize }
772- maxWidth = { maxWidth }
773815 verticalAlignment = { verticalAlignment }
774816 showSeparator = { showSeparator }
775817 />
@@ -870,8 +912,12 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
870912
871913 if ( readOnly ) {
872914 return (
873- < TabLayoutViewContainer maxWidth = { maxWidth } tabBarHeight = { containerTabBarHeight } >
874- < AppViewContainer > { appView } </ AppViewContainer >
915+ < TabLayoutViewContainer
916+ maxWidth = { maxWidth }
917+ tabBarHeight = { containerTabBarHeight }
918+ style = { canvasBackgroundStyle }
919+ >
920+ < AppViewContainer style = { { padding : canvasContentPadding } } > { appView } </ AppViewContainer >
875921 { menuMode === MobileMode . Hamburger ? (
876922 < >
877923 { hamburgerButton }
@@ -885,8 +931,12 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
885931 }
886932
887933 return (
888- < CanvasContainer $maxWidth = { maxWidth } id = { CanvasContainerID } >
889- < EditorContainer > { appView } </ EditorContainer >
934+ < MobileNavCanvasRoot
935+ $maxWidth = { maxWidth }
936+ id = { CanvasContainerID }
937+ style = { canvasBackgroundStyle }
938+ >
939+ < MobileNavEditorContainer style = { { padding : canvasContentPadding } } > { appView } </ MobileNavEditorContainer >
890940 { menuMode === MobileMode . Hamburger ? (
891941 < >
892942 { hamburgerButton }
@@ -895,7 +945,7 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
895945 ) : (
896946 tabBarView
897947 ) }
898- </ CanvasContainer >
948+ </ MobileNavCanvasRoot >
899949 ) ;
900950} ) ;
901951
0 commit comments