neo.mjs 5.12.3 → 5.12.4
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/apps/ServiceWorker.mjs +2 -2
- package/examples/ServiceWorker.mjs +2 -2
- package/package.json +1 -1
- package/src/DefaultConfig.mjs +2 -2
- package/src/button/Base.mjs +42 -60
- package/src/core/Base.mjs +27 -24
- package/src/selection/menu/ListModel.mjs +2 -2
- package/src/table/View.mjs +5 -0
package/apps/ServiceWorker.mjs
CHANGED
package/package.json
CHANGED
package/src/DefaultConfig.mjs
CHANGED
@@ -236,12 +236,12 @@ const DefaultConfig = {
|
|
236
236
|
useVdomWorker: true,
|
237
237
|
/**
|
238
238
|
* buildScripts/injectPackageVersion.mjs will update this value
|
239
|
-
* @default '5.12.
|
239
|
+
* @default '5.12.4'
|
240
240
|
* @memberOf! module:Neo
|
241
241
|
* @name config.version
|
242
242
|
* @type String
|
243
243
|
*/
|
244
|
-
version: '5.12.
|
244
|
+
version: '5.12.4'
|
245
245
|
};
|
246
246
|
|
247
247
|
Object.assign(DefaultConfig, {
|
package/src/button/Base.mjs
CHANGED
@@ -139,6 +139,20 @@ class Base extends Component {
|
|
139
139
|
*/
|
140
140
|
#rippleTimeoutId = null
|
141
141
|
|
142
|
+
/**
|
143
|
+
* @param {Object} config
|
144
|
+
*/
|
145
|
+
construct(config) {
|
146
|
+
super.construct(config);
|
147
|
+
|
148
|
+
let me = this;
|
149
|
+
|
150
|
+
me.addDomListeners({
|
151
|
+
click: me.onClick,
|
152
|
+
scope: me
|
153
|
+
})
|
154
|
+
}
|
155
|
+
|
142
156
|
/**
|
143
157
|
* Triggered after the badgePosition config got changed
|
144
158
|
* @param {String} value
|
@@ -173,26 +187,6 @@ class Base extends Component {
|
|
173
187
|
this.update();
|
174
188
|
}
|
175
189
|
|
176
|
-
/**
|
177
|
-
* Triggered after the handler config got changed
|
178
|
-
* @param {String} value
|
179
|
-
* @param {String} oldValue
|
180
|
-
* @protected
|
181
|
-
*/
|
182
|
-
afterSetHandler(value, oldValue) {
|
183
|
-
let me = this;
|
184
|
-
|
185
|
-
value && me.addDomListeners({
|
186
|
-
click: value,
|
187
|
-
scope: me.handlerScope || me
|
188
|
-
});
|
189
|
-
|
190
|
-
me.menu && me.addDomListeners({
|
191
|
-
click: me.toggleMenu,
|
192
|
-
scope: me
|
193
|
-
})
|
194
|
-
}
|
195
|
-
|
196
190
|
/**
|
197
191
|
* Triggered after the iconCls config got changed
|
198
192
|
* @param {String} value
|
@@ -312,21 +306,6 @@ class Base extends Component {
|
|
312
306
|
this.cls = cls;
|
313
307
|
}
|
314
308
|
|
315
|
-
/**
|
316
|
-
* Triggered after the route config got changed
|
317
|
-
* @param {String} value
|
318
|
-
* @param {String} oldValue
|
319
|
-
* @protected
|
320
|
-
*/
|
321
|
-
afterSetRoute(value, oldValue) {
|
322
|
-
let me = this;
|
323
|
-
|
324
|
-
value && me.addDomListeners({
|
325
|
-
click: me.changeRoute,
|
326
|
-
scope: me
|
327
|
-
})
|
328
|
-
}
|
329
|
-
|
330
309
|
/**
|
331
310
|
* Triggered after the text config got changed
|
332
311
|
* @param {String|null} value
|
@@ -349,7 +328,7 @@ class Base extends Component {
|
|
349
328
|
textNode.innerHTML = value;
|
350
329
|
}
|
351
330
|
|
352
|
-
me.update()
|
331
|
+
me.update()
|
353
332
|
}
|
354
333
|
|
355
334
|
/**
|
@@ -369,7 +348,7 @@ class Base extends Component {
|
|
369
348
|
vdomRoot.tag = 'button';
|
370
349
|
}
|
371
350
|
|
372
|
-
this.update()
|
351
|
+
this.update()
|
373
352
|
}
|
374
353
|
|
375
354
|
/**
|
@@ -379,19 +358,9 @@ class Base extends Component {
|
|
379
358
|
* @protected
|
380
359
|
*/
|
381
360
|
afterSetUseRippleEffect(value, oldValue) {
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
if (!value && oldValue) {
|
387
|
-
me.removeDomListeners(listener);
|
388
|
-
} else if (value) {
|
389
|
-
me.addDomListeners(listener);
|
390
|
-
}
|
391
|
-
|
392
|
-
// setting the config to false should end running ripple animations
|
393
|
-
rippleWrapper.removeDom = true;
|
394
|
-
me.update();
|
361
|
+
// setting the config to false ends running ripple animations
|
362
|
+
this.getRippleWrapper().removeDom = true;
|
363
|
+
this.update()
|
395
364
|
}
|
396
365
|
|
397
366
|
/**
|
@@ -410,7 +379,7 @@ class Base extends Component {
|
|
410
379
|
delete vdomRoot.target;
|
411
380
|
}
|
412
381
|
|
413
|
-
me.update()
|
382
|
+
me.update()
|
414
383
|
}
|
415
384
|
|
416
385
|
/**
|
@@ -425,7 +394,7 @@ class Base extends Component {
|
|
425
394
|
return iconCls.join(' ');
|
426
395
|
}
|
427
396
|
|
428
|
-
return iconCls
|
397
|
+
return iconCls
|
429
398
|
}
|
430
399
|
|
431
400
|
/**
|
@@ -436,7 +405,7 @@ class Base extends Component {
|
|
436
405
|
* @protected
|
437
406
|
*/
|
438
407
|
beforeSetBadgePosition(value, oldValue) {
|
439
|
-
return this.beforeSetEnumValue(value, oldValue, 'badgePosition')
|
408
|
+
return this.beforeSetEnumValue(value, oldValue, 'badgePosition')
|
440
409
|
}
|
441
410
|
|
442
411
|
/**
|
@@ -451,7 +420,7 @@ class Base extends Component {
|
|
451
420
|
value = value.split(' ').filter(Boolean);
|
452
421
|
}
|
453
422
|
|
454
|
-
return value
|
423
|
+
return value
|
455
424
|
}
|
456
425
|
|
457
426
|
/**
|
@@ -471,9 +440,9 @@ class Base extends Component {
|
|
471
440
|
let me = this;
|
472
441
|
|
473
442
|
if (me.editRoute) {
|
474
|
-
Neo.Main.editRoute(me.route)
|
443
|
+
Neo.Main.editRoute(me.route)
|
475
444
|
} else {
|
476
|
-
Neo.Main.setRoute({value: me.route})
|
445
|
+
Neo.Main.setRoute({value: me.route})
|
477
446
|
}
|
478
447
|
}
|
479
448
|
|
@@ -482,7 +451,7 @@ class Base extends Component {
|
|
482
451
|
* @returns {Object}
|
483
452
|
*/
|
484
453
|
getBadgeNode() {
|
485
|
-
return this.getVdomRoot().cn[2]
|
454
|
+
return this.getVdomRoot().cn[2]
|
486
455
|
}
|
487
456
|
|
488
457
|
/**
|
@@ -490,7 +459,7 @@ class Base extends Component {
|
|
490
459
|
* @returns {Object}
|
491
460
|
*/
|
492
461
|
getIconNode() {
|
493
|
-
return this.getVdomRoot().cn[0]
|
462
|
+
return this.getVdomRoot().cn[0]
|
494
463
|
}
|
495
464
|
|
496
465
|
/**
|
@@ -498,7 +467,20 @@ class Base extends Component {
|
|
498
467
|
* @returns {Object}
|
499
468
|
*/
|
500
469
|
getRippleWrapper() {
|
501
|
-
return this.getVdomRoot().cn[3]
|
470
|
+
return this.getVdomRoot().cn[3]
|
471
|
+
}
|
472
|
+
|
473
|
+
/**
|
474
|
+
* @param {Object} data
|
475
|
+
*/
|
476
|
+
onClick(data) {
|
477
|
+
let me = this;
|
478
|
+
|
479
|
+
me.handler?.call(me.handlerScope || me, data);
|
480
|
+
|
481
|
+
me.menu && me.toggleMenu();
|
482
|
+
me.route && me.changeRoute();
|
483
|
+
me.useRippleEffect && me.showRipple(data)
|
502
484
|
}
|
503
485
|
|
504
486
|
/**
|
@@ -536,7 +518,7 @@ class Base extends Component {
|
|
536
518
|
me.#rippleTimeoutId = null;
|
537
519
|
|
538
520
|
rippleWrapper.removeDom = true;
|
539
|
-
me.update()
|
521
|
+
me.update()
|
540
522
|
}
|
541
523
|
}, rippleEffectDuration);
|
542
524
|
}
|
package/src/core/Base.mjs
CHANGED
@@ -24,7 +24,9 @@ class Base {
|
|
24
24
|
static observable = false
|
25
25
|
/**
|
26
26
|
* Keep the overwritten methods
|
27
|
-
* @
|
27
|
+
* @member {Object} overwrittenMethods={}
|
28
|
+
* @protected
|
29
|
+
* @static
|
28
30
|
*/
|
29
31
|
static overwrittenMethods = {}
|
30
32
|
/**
|
@@ -116,7 +118,7 @@ class Base {
|
|
116
118
|
value : true
|
117
119
|
});
|
118
120
|
|
119
|
-
me.remote && setTimeout(me.initRemote.bind(me), 1)
|
121
|
+
me.remote && setTimeout(me.initRemote.bind(me), 1)
|
120
122
|
}
|
121
123
|
|
122
124
|
/**
|
@@ -133,9 +135,9 @@ class Base {
|
|
133
135
|
|
134
136
|
if (oldValue) {
|
135
137
|
if (hasManager) {
|
136
|
-
Neo.manager.Instance.unregister(oldValue)
|
138
|
+
Neo.manager.Instance.unregister(oldValue)
|
137
139
|
} else {
|
138
|
-
delete Neo.idMap[oldValue]
|
140
|
+
delete Neo.idMap[oldValue]
|
139
141
|
}
|
140
142
|
}
|
141
143
|
|
@@ -143,7 +145,7 @@ class Base {
|
|
143
145
|
Neo.manager.Instance.register(me);
|
144
146
|
} else {
|
145
147
|
Neo.idMap = Neo.idMap || {};
|
146
|
-
Neo.idMap[me.id] = me
|
148
|
+
Neo.idMap[me.id] = me
|
147
149
|
}
|
148
150
|
}
|
149
151
|
|
@@ -169,8 +171,9 @@ class Base {
|
|
169
171
|
}
|
170
172
|
}
|
171
173
|
}
|
174
|
+
|
172
175
|
// Apply configs to prototype
|
173
|
-
overwrites && Object.assign(cfg, overwrites)
|
176
|
+
overwrites && Object.assign(cfg, overwrites)
|
174
177
|
}
|
175
178
|
}
|
176
179
|
|
@@ -187,10 +190,10 @@ class Base {
|
|
187
190
|
|
188
191
|
if (!values.includes(value)) {
|
189
192
|
console.error(`Supported values for ${name} are: ${values.join(', ')}`, this);
|
190
|
-
return oldValue
|
193
|
+
return oldValue
|
191
194
|
}
|
192
195
|
|
193
|
-
return value
|
196
|
+
return value
|
194
197
|
}
|
195
198
|
|
196
199
|
/**
|
@@ -217,7 +220,7 @@ class Base {
|
|
217
220
|
regex = Base.methodNameRegex,
|
218
221
|
methodName = stack.match(regex)[1];
|
219
222
|
|
220
|
-
this.__proto__.constructor.overwrittenMethods[methodName].call(this, ...args)
|
223
|
+
this.__proto__.constructor.overwrittenMethods[methodName].call(this, ...args)
|
221
224
|
}
|
222
225
|
|
223
226
|
/**
|
@@ -238,14 +241,14 @@ class Base {
|
|
238
241
|
let me = this;
|
239
242
|
|
240
243
|
if (Base.instanceManagerAvailable === true) {
|
241
|
-
Neo.manager.Instance.unregister(me)
|
244
|
+
Neo.manager.Instance.unregister(me)
|
242
245
|
} else if (Neo.idMap) {
|
243
|
-
delete Neo.idMap[me.id]
|
246
|
+
delete Neo.idMap[me.id]
|
244
247
|
}
|
245
248
|
|
246
249
|
Object.keys(me).forEach(key => {
|
247
250
|
if (Object.getOwnPropertyDescriptor(me, key).writable) {
|
248
|
-
delete me[key]
|
251
|
+
delete me[key]
|
249
252
|
}
|
250
253
|
})
|
251
254
|
}
|
@@ -299,7 +302,7 @@ class Base {
|
|
299
302
|
listenerId;
|
300
303
|
|
301
304
|
if (!me.singleton) {
|
302
|
-
throw new Error('Remote method access is only functional for Singleton classes ' + className)
|
305
|
+
throw new Error('Remote method access is only functional for Singleton classes ' + className)
|
303
306
|
}
|
304
307
|
|
305
308
|
if (!Neo.config.unitTestMode && Neo.isObject(remote)) {
|
@@ -325,11 +328,11 @@ class Base {
|
|
325
328
|
ctor = me.constructor;
|
326
329
|
|
327
330
|
if (!ctor.config) {
|
328
|
-
throw new Error('Neo.applyClassConfig has not been run on ' + me.className)
|
331
|
+
throw new Error('Neo.applyClassConfig has not been run on ' + me.className)
|
329
332
|
}
|
330
333
|
|
331
334
|
if (!preventOriginalConfig) {
|
332
|
-
me.originalConfig = Neo.clone(config, true, true)
|
335
|
+
me.originalConfig = Neo.clone(config, true, true)
|
333
336
|
}
|
334
337
|
|
335
338
|
return {...ctor.config, ...config}
|
@@ -364,7 +367,7 @@ class Base {
|
|
364
367
|
|
365
368
|
if (items) {
|
366
369
|
if (!Array.isArray(items)) {
|
367
|
-
items = [items]
|
370
|
+
items = [items]
|
368
371
|
}
|
369
372
|
|
370
373
|
items.forEach(item => {
|
@@ -377,16 +380,16 @@ class Base {
|
|
377
380
|
ns = Neo.ns(nsArray, false, me);
|
378
381
|
|
379
382
|
if (ns[nsKey] === undefined) {
|
380
|
-
console.error('The used @config does not exist:', nsKey, nsArray.join('.'))
|
383
|
+
console.error('The used @config does not exist:', nsKey, nsArray.join('.'))
|
381
384
|
} else {
|
382
385
|
symbolNs = Neo.ns(nsArray, false, me[configSymbol]);
|
383
386
|
|
384
387
|
// The config might not be processed yet, especially for configs
|
385
388
|
// not ending with an underscore, so we need to check the configSymbol first.
|
386
389
|
if (symbolNs && Object.hasOwn(symbolNs, nsKey)) {
|
387
|
-
item[key] = symbolNs[nsKey]
|
390
|
+
item[key] = symbolNs[nsKey]
|
388
391
|
} else {
|
389
|
-
item[key] = ns[nsKey]
|
392
|
+
item[key] = ns[nsKey]
|
390
393
|
}
|
391
394
|
}
|
392
395
|
}
|
@@ -414,7 +417,7 @@ class Base {
|
|
414
417
|
me[keys[0]] = me[configSymbol][keys[0]];
|
415
418
|
}
|
416
419
|
|
417
|
-
// there is a delete
|
420
|
+
// there is a delete-call inside the config getter as well (Neo.mjs => autoGenerateGetSet())
|
418
421
|
// we need to keep this one for configs, which do not use getters (no trailing underscore)
|
419
422
|
delete me[configSymbol][keys[0]];
|
420
423
|
|
@@ -439,7 +442,7 @@ class Base {
|
|
439
442
|
methods
|
440
443
|
})
|
441
444
|
}
|
442
|
-
})
|
445
|
+
})
|
443
446
|
}
|
444
447
|
|
445
448
|
/**
|
@@ -455,7 +458,7 @@ class Base {
|
|
455
458
|
// finish this one first before dropping new values into the configSymbol.
|
456
459
|
// see: https://github.com/neomjs/neo/issues/2201
|
457
460
|
if (me[forceAssignConfigs] !== true && Object.keys(me[configSymbol]).length > 0) {
|
458
|
-
me.processConfigs()
|
461
|
+
me.processConfigs()
|
459
462
|
}
|
460
463
|
|
461
464
|
Object.assign(me[configSymbol], values);
|
@@ -476,11 +479,11 @@ class Base {
|
|
476
479
|
Object.entries(config).forEach(([key, value]) => {
|
477
480
|
if (!configNames.hasOwnProperty(key) && !Neo.hasPropertySetter(me, key)) {
|
478
481
|
me[key] = value;
|
479
|
-
delete config[key]
|
482
|
+
delete config[key]
|
480
483
|
}
|
481
484
|
})
|
482
485
|
|
483
|
-
return config
|
486
|
+
return config
|
484
487
|
}
|
485
488
|
|
486
489
|
/**
|
@@ -28,7 +28,7 @@ class ListModel extends BaseListModel {
|
|
28
28
|
if (parentMenu) {
|
29
29
|
view.hideSubMenu();
|
30
30
|
view.selectionModel.deselectAll();
|
31
|
-
parentMenu.selectionModel.selectAt(view.parentIndex)
|
31
|
+
parentMenu.selectionModel.selectAt(view.parentIndex)
|
32
32
|
}
|
33
33
|
}
|
34
34
|
|
@@ -39,7 +39,7 @@ class ListModel extends BaseListModel {
|
|
39
39
|
let activeSubMenu = this.view.activeSubMenu;
|
40
40
|
|
41
41
|
if (activeSubMenu) {
|
42
|
-
activeSubMenu.selectionModel.selectAt(0)
|
42
|
+
activeSubMenu.selectionModel.selectAt(0)
|
43
43
|
}
|
44
44
|
}
|
45
45
|
}
|
package/src/table/View.mjs
CHANGED
@@ -111,6 +111,10 @@ class View extends Component {
|
|
111
111
|
value : rendererValue
|
112
112
|
});
|
113
113
|
|
114
|
+
if (!rendererOutput) {
|
115
|
+
rendererOutput = ''
|
116
|
+
}
|
117
|
+
|
114
118
|
cellCls = ['neo-table-cell'];
|
115
119
|
|
116
120
|
switch (Neo.typeOf(rendererOutput)) {
|
@@ -122,6 +126,7 @@ class View extends Component {
|
|
122
126
|
}
|
123
127
|
break;
|
124
128
|
}
|
129
|
+
case 'Number':
|
125
130
|
case 'String': {
|
126
131
|
rendererOutput = {
|
127
132
|
cls : cellCls,
|