neo.mjs 6.1.1 → 6.1.3

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.
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.1.1'
23
+ * @member {String} version='6.1.3'
24
24
  */
25
- version: '6.1.1'
25
+ version: '6.1.3'
26
26
  }
27
27
 
28
28
  /**
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.1.1'
23
+ * @member {String} version='6.1.3'
24
24
  */
25
- version: '6.1.1'
25
+ version: '6.1.3'
26
26
  }
27
27
 
28
28
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "6.1.1",
3
+ "version": "6.1.3",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -55,7 +55,7 @@
55
55
  "inquirer": "^9.2.10",
56
56
  "neo-jsdoc": "1.0.1",
57
57
  "neo-jsdoc-x": "1.0.5",
58
- "postcss": "^8.4.28",
58
+ "postcss": "^8.4.29",
59
59
  "sass": "^1.66.1",
60
60
  "showdown": "^2.1.0",
61
61
  "webpack": "^5.88.2",
@@ -11,7 +11,7 @@
11
11
  .neo-tab-button-indicator {
12
12
  bottom: unset;
13
13
  height: var(--tab-strip-height);
14
- top : calcVar(tab-strip-height, '*', -1);
14
+ top : calc(var(--tab-strip-height) * -1);
15
15
  width : 100%;
16
16
  }
17
17
 
@@ -33,7 +33,7 @@
33
33
  .neo-tab-button-indicator {
34
34
  bottom: unset;
35
35
  height: 100%;
36
- right : calcVar(tab-strip-height, '*', -1);
36
+ right : calc(var(--tab-strip-height) * -1);
37
37
  width : var(--tab-strip-height);
38
38
  }
39
39
 
@@ -62,7 +62,7 @@
62
62
  .neo-tab-button-indicator {
63
63
  bottom: unset;
64
64
  height: 100%;
65
- left : calcVar(tab-strip-height, '*', -1);
65
+ left : calc(var(--tab-strip-height) * -1);
66
66
  width : var(--tab-strip-height);
67
67
  }
68
68
 
@@ -236,12 +236,12 @@ const DefaultConfig = {
236
236
  useVdomWorker: true,
237
237
  /**
238
238
  * buildScripts/injectPackageVersion.mjs will update this value
239
- * @default '6.1.1'
239
+ * @default '6.1.3'
240
240
  * @memberOf! module:Neo
241
241
  * @name config.version
242
242
  * @type String
243
243
  */
244
- version: '6.1.1'
244
+ version: '6.1.3'
245
245
  };
246
246
 
247
247
  Object.assign(DefaultConfig, {
@@ -669,16 +669,9 @@ class DomEvents extends Base {
669
669
  * @returns {Object}
670
670
  */
671
671
  parseDomRect(rect) {
672
- return {
673
- bottom: rect.bottom,
674
- height: rect.height,
675
- left : rect.left,
676
- right : rect.right,
677
- top : rect.top,
678
- width : rect.width,
679
- x : rect.x,
680
- y : rect.y
681
- }
672
+ let {bottom, height, left, right, top, width, x, y} = rect;
673
+
674
+ return {bottom, height, left, right, top, width, x, y}
682
675
  }
683
676
 
684
677
  /**
@@ -122,12 +122,14 @@ class DeltaUpdates extends Base {
122
122
  node = this.getElement(delta.id),
123
123
  parentNode = this.getElement(delta.parentId);
124
124
 
125
- if (index >= parentNode.children.length) {
126
- parentNode.appendChild(node)
127
- } else {
128
- //index++; // todo?: increase the index in case same parent, oldIndex < newIndex, direct swap
129
- if (node && parentNode.children[index].id !== delta.id) {
130
- parentNode.insertBefore(node, parentNode.children[index])
125
+ if (parentNode) {
126
+ if (index >= parentNode.children.length) {
127
+ parentNode.appendChild(node)
128
+ } else {
129
+ //index++; // todo?: increase the index in case same parent, oldIndex < newIndex, direct swap
130
+ if (node && parentNode.children[index].id !== delta.id) {
131
+ parentNode.insertBefore(node, parentNode.children[index])
132
+ }
131
133
  }
132
134
  }
133
135
  }
@@ -39,7 +39,7 @@ class AccordionTree extends TreeList {
39
39
  firstParentIsVisible_: true,
40
40
  /**
41
41
  * Currently selected item, which is bindable
42
- * @member {Record[|null} selection=null
42
+ * @member {Object[]|null} selection=null
43
43
  *
44
44
  * @example
45
45
  * module: AccordionTree,
@@ -53,15 +53,17 @@ class AccordionTree extends TreeList {
53
53
  * @member {Object} _vdom
54
54
  */
55
55
  _vdom:
56
- {
57
- cn: [
58
- {tag: 'ul', cls: ['neo-list-container', 'neo-list', 'neo-accordion-style'], tabIndex: -1, cn: []}
59
- ]
60
- }
56
+ {cn: [
57
+ {tag: 'ul', cls: ['neo-list-container', 'neo-list', 'neo-accordion-style'], tabIndex: -1, cn: []}
58
+ ]}
61
59
  }
62
60
 
61
+ /**
62
+ *
63
+ */
63
64
  onConstructed() {
64
65
  super.onConstructed();
66
+
65
67
  let me = this;
66
68
 
67
69
  me.addDomListeners({
@@ -130,10 +132,10 @@ class AccordionTree extends TreeList {
130
132
  *
131
133
  * @param {Boolean} [withUpdate=true]
132
134
  */
133
- clear(withUpdate = true) {
135
+ clear(withUpdate=true) {
134
136
  delete this.getVdomRoot().cn[0].cn
135
137
 
136
- if (withUpdate) this.update();
138
+ withUpdate && this.update();
137
139
  }
138
140
 
139
141
  /**
@@ -155,7 +157,7 @@ class AccordionTree extends TreeList {
155
157
  items = me.store.find('parentId', parentId),
156
158
  itemCls = me.itemCls,
157
159
  folderCls = me.folderCls,
158
- cls, tmpRoot;
160
+ cls, id, tmpRoot;
159
161
 
160
162
  if (items.length > 0) {
161
163
  if (!vdomRoot.cn) {
@@ -166,7 +168,8 @@ class AccordionTree extends TreeList {
166
168
  vdomRoot.cn.push({
167
169
  tag: 'ul',
168
170
  cls: ['neo-list'],
169
- cn : []
171
+ cn : [],
172
+ id : `${me.id}__${parentId}__ul`
170
173
  });
171
174
 
172
175
  tmpRoot = vdomRoot.cn[vdomRoot.cn.length - 1];
@@ -194,24 +197,30 @@ class AccordionTree extends TreeList {
194
197
  }
195
198
  }
196
199
 
200
+ id = me.getItemId(item.id);
201
+
197
202
  tmpRoot.cn.push({
198
- tag : 'li',
203
+ tag: 'li',
199
204
  cls,
200
- id : me.getItemId(item.id),
201
- cn : [{
205
+ id,
206
+ cn : [{
202
207
  tag : 'span',
203
208
  cls : ['neo-accordion-item-icon', item.iconCls],
209
+ id : id + '__item',
204
210
  removeDom: !item.isLeaf
205
211
  }, {
206
212
  cls : [itemCls + '-content'],
213
+ id : id + '__item-content',
207
214
  style: {pointerEvents: 'none'},
208
215
  cn : [{
209
216
  tag : 'span',
210
217
  cls : [itemCls + '-content-header'],
218
+ id : id + '__item-content-header',
211
219
  innerHTML: item.name
212
220
  }, {
213
221
  tag : 'span',
214
222
  cls : [itemCls + '-content-text'],
223
+ id : id + '__item-content-text',
215
224
  innerHTML: item.content
216
225
  }]
217
226
  }],
@@ -231,7 +240,7 @@ class AccordionTree extends TreeList {
231
240
 
232
241
 
233
242
  /**
234
- * Expands an item based on the reord
243
+ * Expands an item based on the record
235
244
  * @param {Object} record
236
245
  */
237
246
  expandItem(record) {
@@ -284,7 +293,6 @@ class AccordionTree extends TreeList {
284
293
 
285
294
  /**
286
295
  * Accordion gaining focus without selection => setSelection
287
- *
288
296
  * @param {Object} data
289
297
  */
290
298
  onFocus(data) {
@@ -297,7 +305,6 @@ class AccordionTree extends TreeList {
297
305
 
298
306
  /**
299
307
  * Called from SelectionModel select()
300
- *
301
308
  * @param {String[]} value
302
309
  */
303
310
  onSelect(value) {
@@ -316,8 +323,7 @@ class AccordionTree extends TreeList {
316
323
 
317
324
  /**
318
325
  * After the store loaded, create the items for the list
319
- *
320
- * @param {Record[]} records
326
+ * @param {Object[]} records
321
327
  */
322
328
  onStoreLoad(records) {
323
329
  let me = this,
@@ -341,6 +347,9 @@ class AccordionTree extends TreeList {
341
347
  }
342
348
  }
343
349
 
350
+ /**
351
+ *
352
+ */
344
353
  onStoreRecordChange() {
345
354
  }
346
355
 
@@ -348,7 +357,7 @@ class AccordionTree extends TreeList {
348
357
  * Set the selection either bei record id or record.
349
358
  * You can pass a record or a recordId as value
350
359
  *
351
- * @param {Record|Record[]|Number|Number[]|String|String[]} value
360
+ * @param {Object|Object[]|Number|Number[]|String|String[]} value
352
361
  */
353
362
  setSelection(value) {
354
363
  if (value === null) {