11import BaseContainer from '../container/Base.mjs' ;
2+ import BodyContainer from './BodyContainer.mjs' ;
23import HeaderButton from './header/Button.mjs' ;
34import HeaderToolbar from './header/Toolbar.mjs' ;
45import NeoArray from '../util/Array.mjs' ;
@@ -44,14 +45,14 @@ class Container extends BaseContainer {
4445 */
4546 baseCls : [ 'neo-tab-container' ] ,
4647 /**
47- * @member {String|null} cardContainerId=null
48+ * Default configs for the tab.BodyContainer
49+ * @member {Object|null} bodyContainer=null
4850 */
49- cardContainerId : null ,
51+ bodyContainer : null ,
5052 /**
51- * Default configs for the tab.Strip
52- * @member {Object|null} contentContainer=null
53+ * @member {String|null} bodyContainerId=null
5354 */
54- contentContainer : null ,
55+ bodyContainerId : null ,
5556 /**
5657 * Default configs for the tab.HeaderToolbar
5758 * @member {Object|null} headerToolbar=null
@@ -125,7 +126,7 @@ class Container extends BaseContainer {
125126 */
126127 async afterSetActiveIndex ( value , oldValue ) {
127128 let me = this ,
128- cardContainer = Neo . getComponent ( me . cardContainerId ) ;
129+ cardContainer = Neo . getComponent ( me . bodyContainerId ) ;
129130
130131 if ( Neo . isNumber ( value ) && value > - 1 && ! cardContainer ) {
131132 me . on ( 'constructed' , ( ) => {
@@ -236,12 +237,13 @@ class Container extends BaseContainer {
236237 */
237238 createItems ( ) {
238239 let me = this ,
240+ { activeIndex, removeInactiveCards, useActiveTabIndicator} = me ,
239241 items = me . items || [ ] ,
240242 tabButtons = [ ] ,
241243 tabComponents = [ ] ;
242244
243245 Object . assign ( me , {
244- cardContainerId : me . cardContainerId || Neo . getId ( 'container' ) ,
246+ bodyContainerId : me . bodyContainerId || Neo . getId ( 'container' ) ,
245247 tabBarId : me . tabBarId || Neo . getId ( 'tab-header-toolbar' ) ,
246248 tabStripId : me . tabStripId || Neo . getId ( 'tab-strip' )
247249 } ) ;
@@ -257,32 +259,31 @@ class Container extends BaseContainer {
257259 } ) ;
258260
259261 me . items = [ {
260- module : HeaderToolbar ,
261- dock : me . tabBarPosition ,
262- flex : 'none' ,
263- id : me . tabBarId ,
264- items : tabButtons ,
265- sortable : me . sortable ,
266- useActiveTabIndicator : me . useActiveTabIndicator ,
262+ module : HeaderToolbar ,
263+ dock : me . tabBarPosition ,
264+ flex : 'none' ,
265+ id : me . tabBarId ,
266+ items : tabButtons ,
267+ sortable : me . sortable ,
268+ useActiveTabIndicator,
267269 ...me . headerToolbar
268270 } , {
269- module : Strip ,
270- cls : [ 'neo-tab-strip' , 'neo-dock-' + me . tabBarPosition ] ,
271- flex : 'none' ,
272- id : me . tabStripId ,
273- tabContainerId : me . id ,
274- useActiveTabIndicator : me . useActiveTabIndicator ,
271+ module : Strip ,
272+ cls : [ 'neo-dock-' + me . tabBarPosition ] ,
273+ flex : 'none' ,
274+ id : me . tabStripId ,
275+ tabContainerId : me . id ,
276+ useActiveTabIndicator,
275277 ...me . tabStrip
276278 } , {
277- ntype : 'container' ,
278- cls : [ 'neo-container' , 'neo-tab-content-container' ] ,
279- id : me . cardContainerId ,
280- itemDefaults : me . itemDefaults ,
281- items : tabComponents ,
282- layout : { ntype : 'card' , activeIndex : me . activeIndex , removeInactiveCards : me . removeInactiveCards } ,
283- useActiveTabIndicator : me . useActiveTabIndicator ,
284- ...me . contentContainer
285- } ] ;
279+ module : BodyContainer ,
280+ id : me . bodyContainerId ,
281+ itemDefaults : me . itemDefaults ,
282+ items : tabComponents ,
283+ layout : { ntype : 'card' , activeIndex, removeInactiveCards} ,
284+ useActiveTabIndicator,
285+ ...me . bodyContainer
286+ } ]
286287
287288 me . itemDefaults = null ;
288289
@@ -310,7 +311,7 @@ class Container extends BaseContainer {
310311 * @returns {Neo.container.Base }
311312 */
312313 getCardContainer ( ) {
313- return Neo . getComponent ( this . cardContainerId )
314+ return Neo . getComponent ( this . bodyContainerId )
314315 }
315316
316317 /**
0 commit comments