@@ -36,14 +36,14 @@ import history from "util/history";
3636import {
3737DataOption ,
3838DataOptionType ,
39- ModeOptions ,
4039jsonMenuItems ,
4140menuItemStyleOptions
4241} from "./navLayoutConstants" ;
4342import { clickEvent , eventHandlerControl } from "@lowcoder-ee/comps/controls/eventHandlerControl" ;
4443import { childrenToProps } from "@lowcoder-ee/comps/generators/multi" ;
44+ import { NavPosition , NavPositionOptions } from "./navLayoutConstants" ;
4545
46- const { Header} = Layout ;
46+ const { Header, Footer } = Layout ;
4747
4848const DEFAULT_WIDTH = 240 ;
4949type MenuItemStyleOptionValue = "normal" | "hover" | "active" ;
@@ -197,7 +197,7 @@ let NavTmpLayout = (function () {
197197jsonItems :jsonControl ( convertTreeData , jsonMenuItems ) ,
198198width :withDefault ( StringControl , DEFAULT_WIDTH ) ,
199199backgroundImage :withDefault ( StringControl , "" ) ,
200- mode :dropdownControl ( ModeOptions , "inline" ) ,
200+ position :dropdownControl ( NavPositionOptions , NavPosition . Left ) ,
201201collapse :BoolCodeControl ,
202202navStyle :styleControl ( NavLayoutStyle , 'navStyle' ) ,
203203navItemStyle :styleControl ( NavLayoutItemStyle , 'navItemStyle' ) ,
@@ -234,7 +234,7 @@ let NavTmpLayout = (function () {
234234tooltip :trans ( "navLayout.widthTooltip" ) ,
235235placeholder :DEFAULT_WIDTH + "" ,
236236} ) }
237- { children . mode . propertyView ( {
237+ { children . position . propertyView ( {
238238label :trans ( "labelProp.position" ) ,
239239radioButton :true
240240} ) }
@@ -280,7 +280,7 @@ NavTmpLayout = withViewFn(NavTmpLayout, (comp) => {
280280const [ selectedKey , setSelectedKey ] = useState ( "" ) ;
281281const items = comp . children . items . getView ( ) ;
282282const navWidth = comp . children . width . getView ( ) ;
283- const navMode = comp . children . mode . getView ( ) ;
283+ const navPosition = comp . children . position . getView ( ) ;
284284const navCollapse = comp . children . collapse . getView ( ) ;
285285const navStyle = comp . children . navStyle . getView ( ) ;
286286const navItemStyle = comp . children . navItemStyle . getView ( ) ;
@@ -568,12 +568,14 @@ NavTmpLayout = withViewFn(NavTmpLayout, (comp) => {
568568let navMenu = (
569569< StyledMenu
570570items = { menuItems }
571- mode = { navMode }
571+ mode = { ( navPosition === 'top' || navPosition === 'bottom' ) ? 'horizontal' : 'inline' }
572572style = { {
573573height :`calc(100% -${ getVerticalMargin ( navStyle . margin . split ( ' ' ) ) } )` ,
574574width :`calc(100% -${ getHorizontalMargin ( navStyle . margin . split ( ' ' ) ) } )` ,
575- borderRight :navMode !== 'horizontal' ?`1px solid${ navStyle . border } ` :'none' ,
576- borderBottom :navMode === 'horizontal' ?`1px solid${ navStyle . border } ` :'none' ,
575+ borderRight :navPosition === 'left' ?`1px solid${ navStyle . border } ` :'none' ,
576+ borderLeft :navPosition === 'right' ?`1px solid${ navStyle . border } ` :'none' ,
577+ borderBottom :navPosition === 'top' ?`1px solid${ navStyle . border } ` :'none' ,
578+ borderTop :navPosition === 'bottom' ?`1px solid${ navStyle . border } ` :'none' ,
577579borderRadius :navStyle . radius ,
578580color :navStyle . text ,
579581margin :navStyle . margin ,
@@ -585,7 +587,7 @@ NavTmpLayout = withViewFn(NavTmpLayout, (comp) => {
585587defaultOpenKeys = { defaultOpenKeys }
586588selectedKeys = { [ selectedKey ] }
587589$navItemStyle = { {
588- width :navMode === 'horizontal' ?'auto' :`calc(100% -${ getHorizontalMargin ( navItemStyle . margin . split ( ' ' ) ) } )` ,
590+ width :( navPosition === 'top' || navPosition === 'bottom' ) ?'auto' :`calc(100% -${ getHorizontalMargin ( navItemStyle . margin . split ( ' ' ) ) } )` ,
589591 ...navItemStyle ,
590592} }
591593$navItemHoverStyle = { navItemHoverStyle }
@@ -595,16 +597,27 @@ NavTmpLayout = withViewFn(NavTmpLayout, (comp) => {
595597
596598let content = (
597599< Layout >
598- { navMode === 'horizontal' ? (
600+ { ( navPosition === 'top' ) && (
599601< Header style = { { display :'flex' , alignItems :'center' , padding :0 } } >
600602{ navMenu }
601603</ Header >
602- ) :(
604+ ) }
605+ { ( navPosition === 'left' ) && (
603606< StyledSide theme = "light" width = { navWidth } collapsed = { navCollapse } >
604607{ navMenu }
605608</ StyledSide >
606609) }
607610< MainContent > { pageView } </ MainContent >
611+ { ( navPosition === 'bottom' ) && (
612+ < Footer style = { { display :'flex' , alignItems :'center' , padding :0 } } >
613+ { navMenu }
614+ </ Footer >
615+ ) }
616+ { ( navPosition === 'right' ) && (
617+ < StyledSide theme = "light" width = { navWidth } collapsed = { navCollapse } >
618+ { navMenu }
619+ </ StyledSide >
620+ ) }
608621</ Layout >
609622) ;
610623return isViewMode ?(