@@ -29,9 +29,6 @@ import {
2929 NavLayoutItemStyle ,
3030 NavLayoutItemHoverStyle ,
3131 NavLayoutItemActiveStyle ,
32- NavSubMenuItemStyle ,
33- NavSubMenuItemHoverStyle ,
34- NavSubMenuItemActiveStyle ,
3532} from "comps/controls/styleControlConstants" ;
3633import { hiddenPropertyView , showDataLoadingIndicatorsPropertyView } from "comps/utils/propertyUtils" ;
3734import { trans } from "i18n" ;
@@ -390,9 +387,7 @@ function renderAdvancedSection(children: any) {
390387function renderStyleSections (
391388 children : any ,
392389 styleSegment : MenuItemStyleOptionValue ,
393- setStyleSegment : ( k : MenuItemStyleOptionValue ) => void ,
394- subStyleSegment : MenuItemStyleOptionValue ,
395- setSubStyleSegment : ( k : MenuItemStyleOptionValue ) => void
390+ setStyleSegment : ( k : MenuItemStyleOptionValue ) => void
396391) {
397392 const isHamburger = children . displayMode . getView ( ) === 'hamburger' ;
398393 return (
@@ -415,19 +410,6 @@ function renderStyleSections(
415410 { styleSegment === "hover" && children . navItemHoverStyle . getPropertyView ( ) }
416411 { styleSegment === "active" && children . navItemActiveStyle . getPropertyView ( ) }
417412 </ Section >
418- < Section name = { "Submenu Item Style" } >
419- { controlItem ( { } , (
420- < Segmented
421- block
422- options = { menuItemStyleOptions as any }
423- value = { subStyleSegment }
424- onChange = { ( k ) => setSubStyleSegment ( k as MenuItemStyleOptionValue ) }
425- />
426- ) ) }
427- { subStyleSegment === "normal" && children . subNavItemStyle . getPropertyView ( ) }
428- { subStyleSegment === "hover" && children . subNavItemHoverStyle . getPropertyView ( ) }
429- { subStyleSegment === "active" && children . subNavItemActiveStyle . getPropertyView ( ) }
430- </ Section >
431413 { isHamburger && (
432414 < >
433415 < Section name = { "Hamburger Button Style" } >
@@ -475,14 +457,30 @@ const childrenMap = {
475457 hamburgerButtonStyle : styleControl ( HamburgerButtonStyle , 'hamburgerButtonStyle' ) ,
476458 drawerContainerStyle : styleControl ( DrawerContainerStyle , 'drawerContainerStyle' ) ,
477459 animationStyle : styleControl ( AnimationStyle , 'animationStyle' ) ,
478- subNavItemStyle : styleControl ( NavSubMenuItemStyle , 'subNavItemStyle' ) ,
479- subNavItemHoverStyle : styleControl ( NavSubMenuItemHoverStyle , 'subNavItemHoverStyle' ) ,
480- subNavItemActiveStyle : styleControl ( NavSubMenuItemActiveStyle , 'subNavItemActiveStyle' ) ,
481460 items : withDefault ( migrateOldData ( createNavItemsControl ( ) , fixOldItemsData ) , {
482461 optionType : "manual" ,
483462 manual : [
484463 {
485464 label : trans ( "menuItem" ) + " 1" ,
465+ items : [
466+ {
467+ label : trans ( "subMenuItem" ) + " 1" ,
468+ items : [
469+ {
470+ label : trans ( "subMenuItem" ) + " 1-1" ,
471+ } ,
472+ {
473+ label : trans ( "subMenuItem" ) + " 1-2" ,
474+ } ,
475+ ] ,
476+ } ,
477+ {
478+ label : trans ( "subMenuItem" ) + " 2" ,
479+ } ,
480+ {
481+ label : trans ( "subMenuItem" ) + " 3" ,
482+ } ,
483+ ] ,
486484 } ,
487485 ] ,
488486 } ) ,
@@ -505,7 +503,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
505503 return null ;
506504 }
507505
508- const label = view ?. label ;
506+ const label = view ?. label || trans ( "untitled" ) ;
509507 const icon = hasIcon ( view ?. icon ) ? view . icon : undefined ;
510508 const active = ! ! view ?. active ;
511509 const onEvent = view ?. onEvent ;
@@ -524,7 +522,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
524522 const children = buildSubMenuItems ( subItem . getView ( ) ?. items , key ) ;
525523 return {
526524 key,
527- label : subItem . children . label . getView ( ) ,
525+ label : subItem . children . label . getView ( ) || trans ( "untitled" ) ,
528526 icon : subIcon ,
529527 disabled : ! ! subItem . children . disabled . getView ( ) ,
530528 ...( children . length > 0 ? { children } : { } ) ,
@@ -566,7 +564,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
566564 ) ;
567565 if ( subMenuItems . length > 0 ) {
568566 const subMenu = (
569- < ScrollBar style = { { height : "200px" } } >
567+ < ScrollBar style = { { height : "200px" , minWidth : "200px" } } >
570568 < StyledMenu
571569 onClick = { ( e ) => {
572570 if ( disabled ) return ;
@@ -588,22 +586,22 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
588586 ...item ,
589587 icon : item . icon || undefined ,
590588 } ) ) }
591- $color = { ( props . subNavItemStyle && props . subNavItemStyle . text ) || props . style . text }
592- $hoverColor = { ( props . subNavItemHoverStyle && props . subNavItemHoverStyle . text ) || props . style . accent }
593- $activeColor = { ( props . subNavItemActiveStyle && props . subNavItemActiveStyle . text ) || props . style . accent }
594- $bg = { ( props . subNavItemStyle && props . subNavItemStyle . background ) || undefined }
595- $hoverBg = { ( props . subNavItemHoverStyle && props . subNavItemHoverStyle . background ) || undefined }
596- $activeBg = { ( props . subNavItemActiveStyle && props . subNavItemActiveStyle . background ) || undefined }
597- $border = { ( props . subNavItemStyle && props . subNavItemStyle . border ) || undefined }
598- $hoverBorder = { ( props . subNavItemHoverStyle && props . subNavItemHoverStyle . border ) || undefined }
599- $activeBorder = { ( props . subNavItemActiveStyle && props . subNavItemActiveStyle . border ) || undefined }
600- $radius = { ( props . subNavItemStyle && props . subNavItemStyle . radius ) || undefined }
589+ $color = { props . style . text }
590+ $hoverColor = { props . style . accent }
591+ $activeColor = { props . style . accent }
592+ $bg = { undefined }
593+ $hoverBg = { undefined }
594+ $activeBg = { undefined }
595+ $border = { undefined }
596+ $hoverBorder = { undefined }
597+ $activeBorder = { undefined }
598+ $radius = { undefined }
601599 $fontFamily = { props . style . fontFamily }
602600 $fontStyle = { props . style . fontStyle }
603601 $textWeight = { props . style . textWeight }
604602 $textSize = { props . style . textSize }
605- $padding = { ( props . subNavItemStyle && props . subNavItemStyle . padding ) || props . style . padding }
606- $margin = { ( props . subNavItemStyle && props . subNavItemStyle . margin ) || props . style . margin }
603+ $padding = { props . style . padding }
604+ $margin = { props . style . margin }
607605 $textTransform = { props . style . textTransform }
608606 $textDecoration = { props . style . textDecoration }
609607 />
@@ -708,15 +706,14 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
708706 const showLogic = mode === "logic" || mode === "both" ;
709707 const showLayout = mode === "layout" || mode === "both" ;
710708 const [ styleSegment , setStyleSegment ] = useState < MenuItemStyleOptionValue > ( "normal" ) ;
711- const [ subStyleSegment , setSubStyleSegment ] = useState < MenuItemStyleOptionValue > ( "normal" ) ;
712709
713710 return (
714711 < >
715712 { renderBasicSection ( children ) }
716713 { showLogic && renderInteractionSection ( children ) }
717714 { showLayout && renderLayoutSection ( children ) }
718715 { showLogic && renderAdvancedSection ( children ) }
719- { showLayout && renderStyleSections ( children , styleSegment , setStyleSegment , subStyleSegment , setSubStyleSegment ) }
716+ { showLayout && renderStyleSections ( children , styleSegment , setStyleSegment ) }
720717 </ >
721718 ) ;
722719 } )
0 commit comments