neo.mjs 4.3.0 → 4.3.2

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.
Files changed (44) hide show
  1. package/apps/website/view/MainContainer.mjs +1 -0
  2. package/apps/website/view/MainContainerController.mjs +7 -0
  3. package/apps/website/view/blog/List.mjs +41 -3
  4. package/apps/website/view/examples/List.mjs +28 -3
  5. package/apps/website/view/examples/TabContainer.mjs +7 -4
  6. package/apps/website/view/home/DeveloperIntroComponent.mjs +227 -225
  7. package/apps/website/view/home/ExecutiveIntroComponent.mjs +242 -240
  8. package/buildScripts/addConfig.mjs +1 -0
  9. package/examples/tab/container/MainContainer.mjs +78 -5
  10. package/package.json +1 -1
  11. package/resources/scss/src/apps/website/blog/List.scss +2 -2
  12. package/resources/scss/src/apps/website/examples/List.scss +2 -2
  13. package/resources/scss/src/apps/website/home/TabContainer.scss +6 -1
  14. package/resources/scss/src/button/Base.scss +10 -8
  15. package/resources/scss/src/calendar/view/calendars/ColorsList.scss +5 -2
  16. package/resources/scss/src/component/Label.scss +2 -1
  17. package/resources/scss/src/form/field/Radio.scss +6 -4
  18. package/resources/scss/src/form/field/Text.scss +4 -3
  19. package/resources/scss/src/layout/Card.scss +6 -10
  20. package/resources/scss/src/list/Base.scss +11 -3
  21. package/resources/scss/src/tab/Container.scss +2 -1
  22. package/resources/scss/src/tab/header/Toolbar.scss +1 -1
  23. package/resources/scss/src/table/Container.scss +3 -1
  24. package/resources/scss/src/toolbar/Base.scss +69 -3
  25. package/resources/scss/src/tree/List.scss +11 -1
  26. package/resources/scss/theme-dark/button/Base.scss +4 -0
  27. package/resources/scss/theme-light/button/Base.scss +4 -0
  28. package/src/calendar/view/calendars/ColorsList.mjs +18 -0
  29. package/src/calendar/view/calendars/EditContainer.mjs +7 -9
  30. package/src/component/Base.mjs +184 -114
  31. package/src/container/Base.mjs +3 -3
  32. package/src/draggable/toolbar/DragZone.mjs +5 -6
  33. package/src/form/field/Text.mjs +3 -1
  34. package/src/layout/Base.mjs +5 -7
  35. package/src/layout/Card.mjs +32 -35
  36. package/src/layout/Fit.mjs +11 -11
  37. package/src/layout/Flexbox.mjs +32 -40
  38. package/src/layout/HBox.mjs +1 -1
  39. package/src/layout/VBox.mjs +1 -1
  40. package/src/list/Base.mjs +27 -5
  41. package/src/tab/Container.mjs +11 -11
  42. package/src/tab/header/Button.mjs +2 -2
  43. package/src/table/Container.mjs +11 -3
  44. package/src/tree/List.mjs +4 -0
@@ -26,7 +26,7 @@ class Fit extends Base {
26
26
  */
27
27
  applyChildAttributes(child, index) {
28
28
  if (!child.ignoreLayout) {
29
- child.cls = NeoArray.union(child.cls, 'neo-layout-fit-item');
29
+ child.wrapperCls = NeoArray.union(child.wrapperCls, 'neo-layout-fit-item');
30
30
  }
31
31
  }
32
32
 
@@ -34,17 +34,17 @@ class Fit extends Base {
34
34
  * Applies CSS classes to the container this layout is bound to
35
35
  */
36
36
  applyRenderAttributes() {
37
- let me = this,
38
- container = Neo.getComponent(me.containerId),
39
- cls = container?.cls || [];
37
+ let me = this,
38
+ container = Neo.getComponent(me.containerId),
39
+ wrapperCls = container?.wrapperCls || [];
40
40
 
41
41
  if (!container) {
42
42
  Neo.logError('layout.Fit: applyRenderAttributes -> container not yet created', me.containerId);
43
43
  }
44
44
 
45
- NeoArray.add(cls, 'neo-layout-fit');
45
+ NeoArray.add(wrapperCls, 'neo-layout-fit');
46
46
 
47
- container.cls = cls;
47
+ container.wrapperCls = wrapperCls;
48
48
  }
49
49
 
50
50
  /**
@@ -52,17 +52,17 @@ class Fit extends Base {
52
52
  * Gets called when switching to a different layout.
53
53
  */
54
54
  removeRenderAttributes() {
55
- let me = this,
56
- container = Neo.getComponent(me.containerId),
57
- cls = container?.cls || [];
55
+ let me = this,
56
+ container = Neo.getComponent(me.containerId),
57
+ wrapperCls = container?.wrapperCls || [];
58
58
 
59
59
  if (!container) {
60
60
  Neo.logError('layout.Fit: removeRenderAttributes -> container not yet created', me.containerId);
61
61
  }
62
62
 
63
- NeoArray.remove(cls, 'neo-layout-fit');
63
+ NeoArray.remove(wrapperCls, 'neo-layout-fit');
64
64
 
65
- container.cls = cls;
65
+ container.wrapperCls = wrapperCls;
66
66
  }
67
67
  }
68
68
 
@@ -82,7 +82,7 @@ class Flexbox extends Base {
82
82
  * @protected
83
83
  */
84
84
  afterSetAlign(value, oldValue) {
85
- this.updateInputValue(value, oldValue, 'align');
85
+ oldValue && this.updateInputValue(value, oldValue, 'align');
86
86
  }
87
87
 
88
88
  /**
@@ -92,7 +92,7 @@ class Flexbox extends Base {
92
92
  * @protected
93
93
  */
94
94
  afterSetDirection(value, oldValue) {
95
- this.updateInputValue(value, oldValue, 'direction');
95
+ oldValue && this.updateInputValue(value, oldValue, 'direction');
96
96
  }
97
97
 
98
98
  /**
@@ -102,7 +102,7 @@ class Flexbox extends Base {
102
102
  * @protected
103
103
  */
104
104
  afterSetPack(value, oldValue) {
105
- this.updateInputValue(value, oldValue, 'pack');
105
+ oldValue && this.updateInputValue(value, oldValue, 'pack');
106
106
  }
107
107
 
108
108
  /**
@@ -112,7 +112,7 @@ class Flexbox extends Base {
112
112
  * @protected
113
113
  */
114
114
  afterSetWrap(value, oldValue) {
115
- this.updateInputValue(value, oldValue, 'wrap');
115
+ oldValue && this.updateInputValue(value, oldValue, 'wrap');
116
116
  }
117
117
 
118
118
  /**
@@ -130,31 +130,23 @@ class Flexbox extends Base {
130
130
  * Applies CSS classes to the container this layout is bound to
131
131
  */
132
132
  applyRenderAttributes() {
133
- let me = this,
134
- container = Neo.getComponent(me.containerId),
135
- prefix = me.prefix,
136
- cls = container?.cls || [];
133
+ let me = this,
134
+ container = Neo.getComponent(me.containerId),
135
+ prefix = me.prefix,
136
+ wrapperCls = container?.wrapperCls || [];
137
137
 
138
138
  if (!container) {
139
139
  Neo.logError('layout.Flexbox: applyRenderAttributes -> container not yet created', me.containerId);
140
140
  }
141
141
 
142
- NeoArray.add(cls, prefix + 'container');
142
+ NeoArray.add(wrapperCls, prefix + 'container');
143
143
 
144
- if (me.align) {
145
- NeoArray.add(cls, prefix + 'align-' + me.align);
146
- }
147
- if (me.direction) {
148
- NeoArray.add(cls, prefix + 'direction-' + me.direction);
149
- }
150
- if (me.pack) {
151
- NeoArray.add(cls, prefix + 'pack-' + me.pack);
152
- }
153
- if (me.wrap) {
154
- NeoArray.add(cls, prefix + 'wrap-' + me.wrap);
155
- }
144
+ me.align && NeoArray.add(wrapperCls, prefix + 'align-' + me.align);
145
+ me.direction && NeoArray.add(wrapperCls, prefix + 'direction-' + me.direction);
146
+ me.pack && NeoArray.add(wrapperCls, prefix + 'pack-' + me.pack);
147
+ me.wrap && NeoArray.add(wrapperCls, prefix + 'wrap-' + me.wrap);
156
148
 
157
- container.cls = cls;
149
+ container.wrapperCls = wrapperCls;
158
150
  }
159
151
 
160
152
  /**
@@ -220,31 +212,31 @@ class Flexbox extends Base {
220
212
  * @protected
221
213
  */
222
214
  removeRenderAttributes() {
223
- let me = this,
224
- container = Neo.getComponent(me.containerId),
225
- prefix = me.prefix,
226
- cls = container?.cls || [];
215
+ let me = this,
216
+ container = Neo.getComponent(me.containerId),
217
+ prefix = me.prefix,
218
+ wrapperCls = container?.wrapperCls || [];
227
219
 
228
220
  if (!container) {
229
221
  Neo.logError('layout.Flexbox: removeRenderAttributes -> container not yet created', me.containerId);
230
222
  }
231
223
 
232
- NeoArray.remove(cls, prefix + 'container');
224
+ NeoArray.remove(wrapperCls, prefix + 'container');
233
225
 
234
226
  if (me.align) {
235
- NeoArray.remove(cls, prefix + 'align-' + me.align);
227
+ NeoArray.remove(wrapperCls, prefix + 'align-' + me.align);
236
228
  }
237
229
  if (me.direction) {
238
- NeoArray.remove(cls, prefix + 'direction-' + me.direction);
230
+ NeoArray.remove(wrapperCls, prefix + 'direction-' + me.direction);
239
231
  }
240
232
  if (me.pack) {
241
- NeoArray.remove(cls, prefix + 'pack-' + me.pack);
233
+ NeoArray.remove(wrapperCls, prefix + 'pack-' + me.pack);
242
234
  }
243
235
  if (me.wrap) {
244
- NeoArray.remove(cls, prefix + 'wrap-' + me.wrap);
236
+ NeoArray.remove(wrapperCls, prefix + 'wrap-' + me.wrap);
245
237
  }
246
238
 
247
- container.cls = cls;
239
+ container.wrapperCls = wrapperCls;
248
240
  }
249
241
 
250
242
  /**
@@ -268,26 +260,26 @@ class Flexbox extends Base {
268
260
  }
269
261
 
270
262
  /**
271
- * Updates the Container CSS cls
263
+ * Updates the Container CSS wrapperCls
272
264
  * @param {String|null} value
273
265
  * @param {String|null} oldValue
274
266
  * @param {String} propertyName
275
267
  * @protected
276
268
  */
277
269
  updateInputValue(value, oldValue, propertyName) {
278
- let me = this,
279
- container = Neo.getComponent(me.containerId),
280
- prefix = me.prefix,
281
- cls = container?.cls;
270
+ let me = this,
271
+ container = Neo.getComponent(me.containerId),
272
+ prefix = me.prefix,
273
+ wrapperCls = container?.wrapperCls;
282
274
 
283
275
  if (container?.rendered) {
284
- NeoArray.remove(cls, prefix + propertyName + '-' + oldValue);
276
+ NeoArray.remove(wrapperCls, prefix + propertyName + '-' + oldValue);
285
277
 
286
278
  if (value !== null) {
287
- NeoArray.add(cls, prefix + propertyName + '-' + value);
279
+ NeoArray.add(wrapperCls, prefix + propertyName + '-' + value);
288
280
  }
289
281
 
290
- container.cls = cls;
282
+ container.wrapperCls = wrapperCls;
291
283
  }
292
284
  }
293
285
  }
@@ -25,7 +25,7 @@ class HBox extends Flexbox {
25
25
 
26
26
  /**
27
27
  * Applies the flex value to an item of the container this layout is bound to
28
- * @param {Object} item
28
+ * @param {Neo.component.Base} item
29
29
  */
30
30
  applyChildAttributes(item) {
31
31
  // Do not apply flex if fixed width
@@ -25,7 +25,7 @@ class VBox extends Flexbox {
25
25
 
26
26
  /**
27
27
  * Applies the flex value to an item of the container this layout is bound to
28
- * @param {Object} item
28
+ * @param {Neo.component.Base} item
29
29
  */
30
30
  applyChildAttributes(item) {
31
31
  // Do not apply flex if fixed height
package/src/list/Base.mjs CHANGED
@@ -30,9 +30,9 @@ class Base extends Component {
30
30
  */
31
31
  autoDestroyStore: true,
32
32
  /**
33
- * @member {String[]} cls=['neo-list-container','neo-list']
33
+ * @member {String[]} cls=['neo-list']
34
34
  */
35
- cls: ['neo-list-container', 'neo-list'],
35
+ cls: ['neo-list'],
36
36
  /**
37
37
  * @member {Boolean} disableSelection_=false
38
38
  */
@@ -106,7 +106,11 @@ class Base extends Component {
106
106
  */
107
107
  useCheckBoxes_: false,
108
108
  /**
109
- * @member {Object} _vdom={tag:'ul',cn:[]}
109
+ * @member {Boolean} useWrapperNode_=false
110
+ */
111
+ useWrapperNode_: false,
112
+ /**
113
+ * @member {Object} _vdom
110
114
  */
111
115
  _vdom:
112
116
  {tag: 'ul', cn: []}
@@ -223,6 +227,24 @@ class Base extends Component {
223
227
  me.cls = cls;
224
228
  }
225
229
 
230
+ /**
231
+ * Triggered after the useWrapperNode config got changed
232
+ * @param {Boolean} value
233
+ * @param {Boolean} oldValue
234
+ * @protected
235
+ */
236
+ afterSetUseWrapperNode(value, oldValue) {
237
+ let me = this,
238
+ cls = me.cls,
239
+ wrapperCls = me.wrapperCls;
240
+
241
+ NeoArray[value ? 'add' : 'remove'](cls, 'neo-use-wrapper-node');
242
+ NeoArray[value ? 'add' : 'remove'](wrapperCls, 'neo-list-wrapper');
243
+
244
+ me.wrapperCls = wrapperCls;
245
+ me.cls = cls;
246
+ }
247
+
226
248
  /**
227
249
  * Triggered before the selectionModel config gets changed.
228
250
  * @param {Neo.selection.Model} value
@@ -271,7 +293,7 @@ class Base extends Component {
271
293
 
272
294
  item = {
273
295
  tag : me.itemTagName,
274
- cls : cls,
296
+ cls,
275
297
  id : itemId,
276
298
  tabIndex: -1
277
299
  };
@@ -341,7 +363,7 @@ class Base extends Component {
341
363
  */
342
364
  createItems(silent=false) {
343
365
  let me = this,
344
- vdom = me.vdom,
366
+ vdom = me.getVdomRoot(),
345
367
  listItem;
346
368
 
347
369
  if (!(me.animate && !me.getPlugin('animate'))) {
@@ -12,7 +12,7 @@ class Container extends BaseContainer {
12
12
  static getStaticConfig() {return {
13
13
  /**
14
14
  * Valid values for tabBarPosition
15
- * @member {String[]} tabBarPositions=['top', 'right', 'bottom', 'left']
15
+ * @member {String[]} tabBarPositions=['top','right','bottom','left']
16
16
  * @protected
17
17
  * @static
18
18
  */
@@ -45,7 +45,7 @@ class Container extends BaseContainer {
45
45
  */
46
46
  baseCls: 'neo-tab-container',
47
47
  /**
48
- * @member {String|null} [cardContainerId]=null
48
+ * @member {String|null} cardContainerId=null
49
49
  */
50
50
  cardContainerId: null,
51
51
  /**
@@ -56,12 +56,12 @@ class Container extends BaseContainer {
56
56
  cls: ['neo-tab-container'],
57
57
  /**
58
58
  * Default configs for the tab.Strip
59
- * @member {Object|null} [contentContainerDefaults]=null
59
+ * @member {Object|null} contentContainerDefaults=null
60
60
  */
61
61
  contentContainerDefaults: null,
62
62
  /**
63
63
  * Default configs for the tab.HeaderToolbar
64
- * @member {Object|null} [headerToolbarDefaults]=null
64
+ * @member {Object|null} headerToolbarDefaults=null
65
65
  */
66
66
  headerToolbarDefaults: null,
67
67
  /**
@@ -87,11 +87,11 @@ class Container extends BaseContainer {
87
87
  tabBarId: null,
88
88
  /**
89
89
  * Default configs for the tab.Strip
90
- * @member {Object|null} [tabStripDefaults]=null
90
+ * @member {Object|null} tabStripDefaults=null
91
91
  */
92
92
  tabStripDefaults: null,
93
93
  /**
94
- * @member {String|null} [tabStripId]=null
94
+ * @member {String|null} tabStripId=null
95
95
  */
96
96
  tabStripId: null,
97
97
  /**
@@ -117,8 +117,8 @@ class Container extends BaseContainer {
117
117
 
118
118
  /**
119
119
  * Triggered after the activeIndex config got changed
120
- * @param {Number} value
121
- * @param {Number} oldValue
120
+ * @param {Number|null} value
121
+ * @param {Number|null} oldValue
122
122
  * @protected
123
123
  */
124
124
  async afterSetActiveIndex(value, oldValue) {
@@ -157,7 +157,7 @@ class Container extends BaseContainer {
157
157
  afterSetPlain(value, oldValue) {
158
158
  let me = this,
159
159
  baseCls = me.baseCls,
160
- cls = me.cls || [];
160
+ cls = me.cls;
161
161
 
162
162
  NeoArray[value ? 'unshift' : 'remove'](cls, baseCls + '-plain');
163
163
  me.cls = cls;
@@ -196,8 +196,8 @@ class Container extends BaseContainer {
196
196
 
197
197
  me.fire('tabBarPositionChange', {
198
198
  component: me,
199
- oldValue : oldValue,
200
- value : value
199
+ oldValue,
200
+ value
201
201
  });
202
202
  }
203
203
  }
@@ -17,7 +17,7 @@ class Button extends BaseButton {
17
17
  */
18
18
  ntype: 'tab-header-button',
19
19
  /**
20
- * @member {Array} cls=['neo-button', 'neo-tab-button']
20
+ * @member {Array} cls=['neo-button','neo-tab-button']
21
21
  */
22
22
  cls: ['neo-tab-header-button', 'neo-button'],
23
23
  /**
@@ -57,7 +57,7 @@ class Button extends BaseButton {
57
57
  }
58
58
 
59
59
  /**
60
- * @param {Boolean} [silent=false]
60
+ * @param {Boolean} silent=false
61
61
  */
62
62
  updateUseActiveTabIndicator(silent=false) {
63
63
  let me = this,
@@ -135,7 +135,7 @@ class Container extends BaseContainer {
135
135
  ...me.viewConfig
136
136
  }];
137
137
 
138
- me.vdom.id = me.id + 'wrapper';
138
+ me.vdom.id = me.getWrapperId();
139
139
 
140
140
  me.createColumns(me.columns);
141
141
  }
@@ -179,14 +179,15 @@ class Container extends BaseContainer {
179
179
  */
180
180
  applyCustomScrollbarsCss() {
181
181
  let me = this,
182
+ id = me.getWrapperId(),
182
183
  cssRules = [];
183
184
 
184
185
  if (me.dockLeftMargin) {
185
- cssRules.push('#' + me.id + 'wrapper' + '::-webkit-scrollbar-track:horizontal {margin-left: ' + me.dockLeftMargin + 'px;}');
186
+ cssRules.push('#' + id + '::-webkit-scrollbar-track:horizontal {margin-left: ' + me.dockLeftMargin + 'px;}');
186
187
  }
187
188
 
188
189
  if (me.dockRightMargin) {
189
- cssRules.push('#' + me.id + 'wrapper' + '::-webkit-scrollbar-track:horizontal {margin-right: ' + me.dockRightMargin + 'px;}');
190
+ cssRules.push('#' + id + '::-webkit-scrollbar-track:horizontal {margin-right: ' + me.dockRightMargin + 'px;}');
190
191
  }
191
192
  if (cssRules.length > 0) {
192
193
  Css.insertRules(cssRules);
@@ -368,6 +369,13 @@ class Container extends BaseContainer {
368
369
  return this.vnode.childNodes[0];
369
370
  }
370
371
 
372
+ /**
373
+ * @returns {String}
374
+ */
375
+ getWrapperId() {
376
+ return `${this.id}__wrapper`;
377
+ }
378
+
371
379
  /**
372
380
  * @param {Number} countRows
373
381
  */
package/src/tree/List.mjs CHANGED
@@ -47,6 +47,10 @@ class Tree extends Base {
47
47
  * @member {Object} dragZoneConfig=null
48
48
  */
49
49
  sortZoneConfig: null,
50
+ /**
51
+ * @member {String[]} wrapperCls=[]
52
+ */
53
+ wrapperCls: [],
50
54
  /**
51
55
  * @member {Object} _vdom
52
56
  */