@@ -33,6 +33,8 @@ import { AlignRight } from "lowcoder-design";
3333import { LayoutActionComp } from "./layoutActionComp" ;
3434import { defaultTheme } from "@lowcoder-ee/constants/themeConstants" ;
3535import { clickEvent , eventHandlerControl } from "@lowcoder-ee/comps/controls/eventHandlerControl" ;
36+ import { useMergeCompStyles } from "@lowcoder-ee/util/hooks" ;
37+ import { childrenToProps } from "@lowcoder-ee/comps/generators/multi" ;
3638
3739const TabBar = React . lazy ( ( ) => import ( "antd-mobile/es/components/tab-bar" ) ) ;
3840const TabBarItem = React . lazy ( ( ) =>
@@ -228,9 +230,10 @@ function TabBarView(props: TabBarProps & {
228230 >
229231 < StyledTabBar
230232 onChange = { ( key : string ) => {
233+ console . log ( key )
231234 if ( key ) {
232- props . onEvent ( 'click' )
233235 props . onChange ( key ) ;
236+ props . onEvent ( 'click' )
234237 }
235238 } }
236239 activeKey = { props . selectedKey }
@@ -289,7 +292,7 @@ let MobileTabLayoutTmp = (function () {
289292 const childrenMap = {
290293 onEvent : eventHandlerControl ( EventOptions ) ,
291294 dataOptionType : dropdownControl ( DataOptionType , DataOption . Manual ) ,
292- jsonItems : jsonControl < JsonItemNode [ ] > ( convertTreeData , mobileNavJsonMenuItems ) ,
295+ jsonItems : jsonControl < JsonItemNode [ ] > ( convertTreeData , mobileNavJsonMenuItems ) ,
293296 tabs : manualOptionsControl ( TabOptionComp , {
294297 initOptions : [
295298 {
@@ -315,12 +318,12 @@ let MobileTabLayoutTmp = (function () {
315318 maxWidth : withDefault ( NumberControl , 450 ) ,
316319 verticalAlignment : dropdownControl ( VerticalAlignmentOptions , "stretch" ) ,
317320 showSeparator : withDefault ( BoolCodeControl , true ) ,
318- navStyle : withDefault ( styleControl ( NavLayoutStyle ) , defaultStyle ) ,
319- navItemStyle : withDefault ( styleControl ( NavLayoutItemStyle ) , defaultStyle ) ,
320- navItemHoverStyle : withDefault ( styleControl ( NavLayoutItemHoverStyle ) , { } ) ,
321- navItemActiveStyle : withDefault ( styleControl ( NavLayoutItemActiveStyle ) , { } ) ,
321+ navStyle : styleControl ( NavLayoutStyle , 'navStyle' ) ,
322+ navItemStyle : styleControl ( NavLayoutItemStyle , 'navItemStyle' ) ,
323+ navItemHoverStyle : styleControl ( NavLayoutItemHoverStyle , 'navItemHoverStyle' ) ,
324+ navItemActiveStyle : styleControl ( NavLayoutItemActiveStyle , 'navItemActiveStyle' ) ,
322325 } ;
323- return new MultiCompBuilder ( childrenMap , ( props ) => {
326+ return new MultiCompBuilder ( childrenMap , ( props , dispatch ) => {
324327 return null ;
325328 } )
326329 . setPropertyViewFn ( ( children ) => {
@@ -402,6 +405,8 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
402405 const bgColor = ( useContext ( ThemeContext ) ?. theme || defaultTheme ) . canvas ;
403406 const onEvent = comp . children . onEvent . getView ( ) ;
404407
408+ useMergeCompStyles ( childrenToProps ( comp . children ) , comp . dispatch ) ;
409+
405410 useEffect ( ( ) => {
406411 comp . children . jsonTabs . dispatchChangeValueAction ( {
407412 manual : jsonItems as unknown as Array < ConstructorToDataType < typeof TabOptionComp > >
@@ -427,9 +432,20 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
427432 const appView = useMemo ( ( ) => {
428433 const currentTab = tabViews [ tabIndex ] ;
429434
435+ if ( dataOptionType === DataOption . Json ) {
436+ return ( currentTab &&
437+ currentTab . children . app . getAppId ( ) &&
438+ currentTab . children . app . getView ( ) ) || (
439+ < EmptyContent
440+ text = { readOnly ? "" : trans ( "aggregation.emptyTabTooltip" ) }
441+ style = { { height : "100%" , backgroundColor : "white" } }
442+ />
443+ ) ;
444+ }
445+
430446 return ( currentTab &&
431- currentTab . children . app . getAppId ( ) &&
432- currentTab . children . app . getView ( ) ) || (
447+ // currentTab.children.app.getAppId() &&
448+ currentTab . children . action . getView ( ) ) || (
433449 < EmptyContent
434450 text = { readOnly ? "" : trans ( "aggregation.emptyTabTooltip" ) }
435451 style = { { height : "100%" , backgroundColor : "white" } }
0 commit comments