@@ -33,6 +33,8 @@ import { AlignRight } from "lowcoder-design";
33
33
import { LayoutActionComp } from "./layoutActionComp" ;
34
34
import { defaultTheme } from "@lowcoder-ee/constants/themeConstants" ;
35
35
import { 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" ;
36
38
37
39
const TabBar = React . lazy ( ( ) => import ( "antd-mobile/es/components/tab-bar" ) ) ;
38
40
const TabBarItem = React . lazy ( ( ) =>
@@ -228,9 +230,10 @@ function TabBarView(props: TabBarProps & {
228
230
>
229
231
< StyledTabBar
230
232
onChange = { ( key : string ) => {
233
+ console . log ( key )
231
234
if ( key ) {
232
- props . onEvent ( 'click' )
233
235
props . onChange ( key ) ;
236
+ props . onEvent ( 'click' )
234
237
}
235
238
} }
236
239
activeKey = { props . selectedKey }
@@ -289,7 +292,7 @@ let MobileTabLayoutTmp = (function () {
289
292
const childrenMap = {
290
293
onEvent : eventHandlerControl ( EventOptions ) ,
291
294
dataOptionType : dropdownControl ( DataOptionType , DataOption . Manual ) ,
292
- jsonItems : jsonControl < JsonItemNode [ ] > ( convertTreeData , mobileNavJsonMenuItems ) ,
295
+ jsonItems : jsonControl < JsonItemNode [ ] > ( convertTreeData , mobileNavJsonMenuItems ) ,
293
296
tabs : manualOptionsControl ( TabOptionComp , {
294
297
initOptions : [
295
298
{
@@ -315,12 +318,12 @@ let MobileTabLayoutTmp = (function () {
315
318
maxWidth : withDefault ( NumberControl , 450 ) ,
316
319
verticalAlignment : dropdownControl ( VerticalAlignmentOptions , "stretch" ) ,
317
320
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' ) ,
322
325
} ;
323
- return new MultiCompBuilder ( childrenMap , ( props ) => {
326
+ return new MultiCompBuilder ( childrenMap , ( props , dispatch ) => {
324
327
return null ;
325
328
} )
326
329
. setPropertyViewFn ( ( children ) => {
@@ -402,6 +405,8 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
402
405
const bgColor = ( useContext ( ThemeContext ) ?. theme || defaultTheme ) . canvas ;
403
406
const onEvent = comp . children . onEvent . getView ( ) ;
404
407
408
+ useMergeCompStyles ( childrenToProps ( comp . children ) , comp . dispatch ) ;
409
+
405
410
useEffect ( ( ) => {
406
411
comp . children . jsonTabs . dispatchChangeValueAction ( {
407
412
manual : jsonItems as unknown as Array < ConstructorToDataType < typeof TabOptionComp > >
@@ -427,9 +432,20 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
427
432
const appView = useMemo ( ( ) => {
428
433
const currentTab = tabViews [ tabIndex ] ;
429
434
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
+
430
446
return ( currentTab &&
431
- currentTab . children . app . getAppId ( ) &&
432
- currentTab . children . app . getView ( ) ) || (
447
+ // currentTab.children.app.getAppId() &&
448
+ currentTab . children . action . getView ( ) ) || (
433
449
< EmptyContent
434
450
text = { readOnly ? "" : trans ( "aggregation.emptyTabTooltip" ) }
435
451
style = { { height : "100%" , backgroundColor : "white" } }
0 commit comments