@@ -55,7 +55,8 @@ const renewConfigFromOptions = (config, options) => {
5555 if ( panel ) {
5656 optionPanel . params = {
5757 ...panel . params ,
58- ...optionPanel . params
58+ ...optionPanel . params ,
59+ visible : panel . params . visible
5960 }
6061 config . panels [ panel . id ] = optionPanel
6162 }
@@ -232,6 +233,10 @@ const getTree = (contentItem, { width, height, orientation }, parent, panels, ge
232233 if ( contentItem . type === 'row' || contentItem . type === 'column' ) {
233234 obj . type = 'branch' ;
234235 obj . size = getSize ( boxSize , contentItem . width || contentItem . height ) || size
236+ if ( contentItem . content . length == 0 || contentItem . content . every ( item => ! item . visible ) ) {
237+ obj . size = 0
238+ }
239+
235240 obj . data = contentItem . content . map ( item => getTree ( item , { width, height, orientation } , contentItem , panels , getGroupId , options ) )
236241 }
237242 else if ( contentItem . type === 'group' ) {
@@ -279,24 +284,22 @@ const getLeafNode = (contentItem, size, boxSize, parent, panels, getGroupId, opt
279284 const visible = contentItem . visible !== false ;
280285 const data = {
281286 type : 'leaf' ,
282- visible,
287+ visible : true ,
283288 size : getSize ( boxSize , contentItem . width || contentItem . height ) || size ,
284289 data : {
285290 id : getGroupId ( ) ,
286291 activeView : contentItem . id ,
287292 hideHeader : contentItem . showHeader === false ,
288- views : visible ? [ contentItem . id ] : [ ]
293+ views : [ contentItem . id ]
289294 }
290295 } ;
291- if ( visible ) {
292- panels [ contentItem . id ] = {
293- id : contentItem . id ,
294- title : contentItem . title ,
295- renderer : contentItem . renderer || options . renderer ,
296- tabComponent : contentItem . componentName ,
297- contentComponent : contentItem . componentName ,
298- params : { ...contentItem , parentId : parent . id }
299- }
296+ panels [ contentItem . id ] = {
297+ id : contentItem . id ,
298+ title : contentItem . title ,
299+ renderer : contentItem . renderer || options . renderer ,
300+ tabComponent : contentItem . componentName ,
301+ contentComponent : contentItem . componentName ,
302+ params : { ...contentItem , parentId : parent . id }
300303 }
301304 return data ;
302305}
0 commit comments