neo.mjs 9.10.5 → 9.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ServiceWorker.mjs CHANGED
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='9.10.5'
23
+ * @member {String} version='9.11.0'
24
24
  */
25
- version: '9.10.5'
25
+ version: '9.11.0'
26
26
  }
27
27
 
28
28
  /**
@@ -107,7 +107,7 @@ class FooterContainer extends Container {
107
107
  }, {
108
108
  module: Component,
109
109
  cls : ['neo-version'],
110
- html : 'v9.10.5'
110
+ html : 'v9.11.0'
111
111
  }]
112
112
  }],
113
113
  /**
@@ -28,12 +28,13 @@ class MainContainer extends Viewport {
28
28
  * @member {Object[]} items
29
29
  */
30
30
  items: [HeaderContainer, {
31
- module : TabContainer,
32
- activeIndex: null, // render no items initially
33
- flex : 1,
34
- reference : 'tab-container',
35
- sortable : true,
36
- style : {margin: '10px', marginTop: 0},
31
+ module : TabContainer,
32
+ activateInsertedTabs: true,
33
+ activeIndex : null, // render no items initially
34
+ flex : 1,
35
+ reference : 'tab-container',
36
+ sortable : true,
37
+ style : {margin: '10px', marginTop: 0},
37
38
 
38
39
  items: [{
39
40
  module : () => import('./TableContainer.mjs'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name" : "neo.mjs",
3
- "version" : "9.10.5",
3
+ "version" : "9.11.0",
4
4
  "description" : "The webworkers driven UI framework",
5
5
  "type" : "module",
6
6
  "repository" : {
@@ -2,7 +2,7 @@
2
2
  .neo-docs-navigation-tab-container {
3
3
  background-color: var(--docs-navigation-tab-container-background-color);
4
4
 
5
- .neo-tab-content-container {
5
+ .neo-tab-body-container {
6
6
  border-right: none;
7
7
  }
8
8
  }
@@ -6,7 +6,7 @@
6
6
  overflow-y: auto;
7
7
  }
8
8
 
9
- .neo-tab-content-container {
9
+ .neo-tab-body-container {
10
10
  border: 0 !important;
11
11
  }
12
12
  }
@@ -22,7 +22,7 @@
22
22
  margin-top: calc(var(--cmp-tab-strip-height) * (-1) - 1px);
23
23
  }
24
24
 
25
- .neo-tab-content-container {
25
+ .neo-tab-body-container {
26
26
  background-color : transparent;
27
27
  border : 1px solid #e6e6e6;
28
28
  border-bottom-left-radius : calc(var(--cmp-tab-strip-height) + var(--cmp-button-borderradius));
@@ -1,24 +1,24 @@
1
1
  .neo-tab-container {
2
2
  &.neo-bottom {
3
- > .neo-tab-content-container {
3
+ > .neo-tab-body-container {
4
4
  border-bottom: 0;
5
5
  }
6
6
  }
7
7
 
8
8
  &.neo-left {
9
- > .neo-tab-content-container {
9
+ > .neo-tab-body-container {
10
10
  border-left: 0;
11
11
  }
12
12
  }
13
13
 
14
14
  &.neo-right {
15
- > .neo-tab-content-container {
15
+ > .neo-tab-body-container {
16
16
  border-right: 0;
17
17
  }
18
18
  }
19
19
 
20
20
  &.neo-top {
21
- > .neo-tab-content-container {
21
+ > .neo-tab-body-container {
22
22
  border-top: 0;
23
23
  }
24
24
  }
@@ -27,7 +27,7 @@
27
27
 
28
28
  }
29
29
 
30
- .neo-tab-content-container {
30
+ .neo-tab-body-container {
31
31
  border : var(--tab-container-content-border);
32
32
  overflow: hidden;
33
33
  }
@@ -264,12 +264,12 @@ const DefaultConfig = {
264
264
  useVdomWorker: true,
265
265
  /**
266
266
  * buildScripts/injectPackageVersion.mjs will update this value
267
- * @default '9.10.5'
267
+ * @default '9.11.0'
268
268
  * @memberOf! module:Neo
269
269
  * @name config.version
270
270
  * @type String
271
271
  */
272
- version: '9.10.5'
272
+ version: '9.11.0'
273
273
  };
274
274
 
275
275
  Object.assign(DefaultConfig, {
@@ -0,0 +1,39 @@
1
+ import Container from '../container/Base.mjs';
2
+
3
+ /**
4
+ * @class Neo.tab.BodyContainer
5
+ * @extends Neo.container.Base
6
+ */
7
+ class BodyContainer extends Container {
8
+ static config = {
9
+ /**
10
+ * @member {String} className='Neo.tab.BodyContainer'
11
+ * @protected
12
+ */
13
+ className: 'Neo.tab.BodyContainer',
14
+ /**
15
+ * @member {String[]} baseCls=['neo-container', 'neo-tab-body-container']
16
+ * @protected
17
+ */
18
+ baseCls: ['neo-container', 'neo-tab-body-container']
19
+ }
20
+
21
+ /**
22
+ * When adding an existing tab into a different container, it will get automatically from the closest parent.
23
+ * In this case, we also want to remove the tab.header.Button from the tab.header.Toolbar.
24
+ * Use case: SharedCovid.view.MainContainerController
25
+ * @param {Neo.component.Base} component
26
+ * @param {Boolean} [destroyItem=true]
27
+ * @param {Boolean} [silent=false]
28
+ * @returns {Neo.component.Base|null}
29
+ */
30
+ remove(component, destroyItem, silent) {
31
+ if (component?.isTab) {
32
+ this.parent.remove(component, destroyItem, silent)
33
+ } else {
34
+ super.remove(component, destroyItem, silent)
35
+ }
36
+ }
37
+ }
38
+
39
+ export default Neo.setupClass(BodyContainer);
@@ -1,4 +1,5 @@
1
1
  import BaseContainer from '../container/Base.mjs';
2
+ import BodyContainer from './BodyContainer.mjs';
2
3
  import HeaderButton from './header/Button.mjs';
3
4
  import HeaderToolbar from './header/Toolbar.mjs';
4
5
  import NeoArray from '../util/Array.mjs';
@@ -44,14 +45,14 @@ class Container extends BaseContainer {
44
45
  */
45
46
  baseCls: ['neo-tab-container'],
46
47
  /**
47
- * @member {String|null} cardContainerId=null
48
+ * Default configs for the tab.BodyContainer
49
+ * @member {Object|null} bodyContainer=null
48
50
  */
49
- cardContainerId: null,
51
+ bodyContainer: null,
50
52
  /**
51
- * Default configs for the tab.Strip
52
- * @member {Object|null} contentContainer=null
53
+ * @member {String|null} bodyContainerId=null
53
54
  */
54
- contentContainer: null,
55
+ bodyContainerId: null,
55
56
  /**
56
57
  * Default configs for the tab.HeaderToolbar
57
58
  * @member {Object|null} headerToolbar=null
@@ -125,7 +126,7 @@ class Container extends BaseContainer {
125
126
  */
126
127
  async afterSetActiveIndex(value, oldValue) {
127
128
  let me = this,
128
- cardContainer = Neo.getComponent(me.cardContainerId);
129
+ cardContainer = Neo.getComponent(me.bodyContainerId);
129
130
 
130
131
  if (Neo.isNumber(value) && value > -1 && !cardContainer) {
131
132
  me.on('constructed', () => {
@@ -236,12 +237,13 @@ class Container extends BaseContainer {
236
237
  */
237
238
  createItems() {
238
239
  let me = this,
240
+ {activeIndex, removeInactiveCards, useActiveTabIndicator} = me,
239
241
  items = me.items || [],
240
242
  tabButtons = [],
241
243
  tabComponents = [];
242
244
 
243
245
  Object.assign(me, {
244
- cardContainerId: me.cardContainerId || Neo.getId('container'),
246
+ bodyContainerId: me.bodyContainerId || Neo.getId('container'),
245
247
  tabBarId : me.tabBarId || Neo.getId('tab-header-toolbar'),
246
248
  tabStripId : me.tabStripId || Neo.getId('tab-strip')
247
249
  });
@@ -257,32 +259,31 @@ class Container extends BaseContainer {
257
259
  });
258
260
 
259
261
  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,
267
269
  ...me.headerToolbar
268
270
  }, {
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,
275
277
  ...me.tabStrip
276
278
  }, {
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
+ }]
286
287
 
287
288
  me.itemDefaults = null;
288
289
 
@@ -310,7 +311,7 @@ class Container extends BaseContainer {
310
311
  * @returns {Neo.container.Base}
311
312
  */
312
313
  getCardContainer() {
313
- return Neo.getComponent(this.cardContainerId)
314
+ return Neo.getComponent(this.bodyContainerId)
314
315
  }
315
316
 
316
317
  /**