neo.mjs 6.11.0 → 6.12.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/apps/ServiceWorker.mjs +2 -2
- package/examples/ServiceWorker.mjs +2 -2
- package/package.json +1 -1
- package/src/DefaultConfig.mjs +2 -2
- package/src/Main.mjs +20 -2
- package/src/component/Base.mjs +18 -7
- package/src/core/Base.mjs +1 -1
- package/src/form/field/Select.mjs +1 -1
- package/src/form/field/Text.mjs +2 -1
- package/src/main/addon/AmCharts.mjs +10 -16
- package/src/main/addon/AnalyticsByGoogle.mjs +5 -11
- package/src/main/addon/Base.mjs +26 -0
- package/src/main/addon/CesiumJS.mjs +5 -11
- package/src/main/addon/CloneNode.mjs +8 -13
- package/src/main/addon/Cookie.mjs +5 -11
- package/src/main/addon/DragDrop.mjs +5 -11
- package/src/main/addon/GoogleMaps.mjs +7 -13
- package/src/main/addon/HighlightJS.mjs +4 -10
- package/src/main/addon/LocalStorage.mjs +5 -11
- package/src/main/addon/MapboxGL.mjs +16 -22
- package/src/main/addon/Markdown.mjs +5 -11
- package/src/main/addon/Mwc.mjs +4 -10
- package/src/main/addon/Navigator.mjs +6 -12
- package/src/main/addon/Popover.mjs +7 -12
- package/src/main/addon/PrefixField.mjs +18 -25
- package/src/main/addon/ResizeObserver.mjs +5 -10
- package/src/main/addon/ServiceWorker.mjs +5 -11
- package/src/main/addon/Siesta.mjs +5 -11
- package/src/main/addon/Stylesheet.mjs +5 -11
- package/src/main/addon/WebComponent.mjs +5 -11
- package/src/main/addon/WindowPosition.mjs +4 -10
- package/src/menu/List.mjs +3 -0
- package/src/selection/ListModel.mjs +6 -1
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 '6.
|
239
|
+
* @default '6.12.0'
|
240
240
|
* @memberOf! module:Neo
|
241
241
|
* @name config.version
|
242
242
|
* @type String
|
243
243
|
*/
|
244
|
-
version: '6.
|
244
|
+
version: '6.12.0'
|
245
245
|
};
|
246
246
|
|
247
247
|
Object.assign(DefaultConfig, {
|
package/src/Main.mjs
CHANGED
@@ -209,7 +209,7 @@ class Main extends core.Base {
|
|
209
209
|
module = await import(`./main/addon/${name}.mjs`)
|
210
210
|
}
|
211
211
|
|
212
|
-
this.
|
212
|
+
this.registerAddon(module.default);
|
213
213
|
|
214
214
|
return true
|
215
215
|
}
|
@@ -254,7 +254,7 @@ class Main extends core.Base {
|
|
254
254
|
me.addon = {};
|
255
255
|
|
256
256
|
modules.forEach(module => {
|
257
|
-
me.
|
257
|
+
me.registerAddon(module.default)
|
258
258
|
});
|
259
259
|
|
260
260
|
WorkerManager.onWorkerConstructed({
|
@@ -370,6 +370,24 @@ class Main extends core.Base {
|
|
370
370
|
window.location.href = data.url;
|
371
371
|
}
|
372
372
|
|
373
|
+
/**
|
374
|
+
* Helper method to register main thread addons
|
375
|
+
* @param {Neo.core.Base} addon Can either be a neo class or instance
|
376
|
+
*/
|
377
|
+
registerAddon(addon) {
|
378
|
+
if (Neo.typeOf(addon) === 'NeoClass') {
|
379
|
+
// Addons could get imported multiple times. Ensure to only create an instance once.
|
380
|
+
if (Neo.typeOf(Neo.ns(addon.prototype.className)) !== 'NeoInstance') {
|
381
|
+
addon = Neo.create(addon)
|
382
|
+
}
|
383
|
+
|
384
|
+
// Main thread addons need to get registered as singletons inside the neo namespace
|
385
|
+
Neo.applyToGlobalNs(addon)
|
386
|
+
}
|
387
|
+
|
388
|
+
this.addon[addon.constructor.name] = addon;
|
389
|
+
}
|
390
|
+
|
373
391
|
/**
|
374
392
|
* Triggers the different DOM operation queues
|
375
393
|
* @protected
|
package/src/component/Base.mjs
CHANGED
@@ -801,12 +801,6 @@ class Base extends CoreBase {
|
|
801
801
|
}
|
802
802
|
}
|
803
803
|
|
804
|
-
revertFocus() {
|
805
|
-
if (this.containsFocus && this.focusEnterData?.relatedTarget) {
|
806
|
-
Neo.getComponent(this.focusEnterData.relatedTarget.id)?.focus();
|
807
|
-
}
|
808
|
-
}
|
809
|
-
|
810
804
|
/**
|
811
805
|
* Triggered after the reference config got changed
|
812
806
|
* @param {String|null} value
|
@@ -1838,13 +1832,19 @@ class Base extends CoreBase {
|
|
1838
1832
|
this.keys?.register(this)
|
1839
1833
|
}
|
1840
1834
|
|
1835
|
+
/**
|
1836
|
+
* @param {Object} data
|
1837
|
+
*/
|
1841
1838
|
onFocusEnter(data) {
|
1842
1839
|
// If we are hidden, or unmounted while we still contain focus, we have to revert
|
1843
1840
|
// focus to where it came from if possible
|
1844
1841
|
this.focusEnterData = data;
|
1845
1842
|
}
|
1846
1843
|
|
1847
|
-
|
1844
|
+
/**
|
1845
|
+
* @param {Object} data
|
1846
|
+
*/
|
1847
|
+
onFocusLeave(data) {
|
1848
1848
|
this.focusEnterData = null;
|
1849
1849
|
}
|
1850
1850
|
|
@@ -2067,6 +2067,17 @@ class Base extends CoreBase {
|
|
2067
2067
|
}
|
2068
2068
|
}
|
2069
2069
|
|
2070
|
+
/**
|
2071
|
+
*
|
2072
|
+
*/
|
2073
|
+
revertFocus() {
|
2074
|
+
let relatedTarget = this.focusEnterData?.relatedTarget;
|
2075
|
+
|
2076
|
+
if (this.containsFocus && relatedTarget) {
|
2077
|
+
Neo.getComponent(relatedTarget.id)?.focus()
|
2078
|
+
}
|
2079
|
+
}
|
2080
|
+
|
2070
2081
|
/**
|
2071
2082
|
* Change multiple configs at once, ensuring that all afterSet methods get all new assigned values
|
2072
2083
|
* @param {Object} values={}
|
package/src/core/Base.mjs
CHANGED
@@ -370,7 +370,7 @@ class Base {
|
|
370
370
|
currentWorker = Neo.currentWorker,
|
371
371
|
listenerId;
|
372
372
|
|
373
|
-
if (!me.singleton) {
|
373
|
+
if (!me.singleton && !me.isMainThreadAddon) {
|
374
374
|
throw new Error('Remote method access is only functional for Singleton classes ' + className)
|
375
375
|
}
|
376
376
|
|
@@ -661,7 +661,7 @@ class Select extends Picker {
|
|
661
661
|
cls: ['neo-input-field-wrapper'],
|
662
662
|
cn : [{
|
663
663
|
tag : 'input',
|
664
|
-
autocomplete: '
|
664
|
+
autocomplete: 'no', // while "off" is the correct value, browser vendors ignore it. Arbitrary strings do the trick.
|
665
665
|
autocorrect : 'off',
|
666
666
|
cls : ['neo-textfield-input', 'neo-typeahead-input'],
|
667
667
|
disabled : true,
|
package/src/form/field/Text.mjs
CHANGED
@@ -318,7 +318,8 @@ class Text extends Base {
|
|
318
318
|
* @protected
|
319
319
|
*/
|
320
320
|
afterSetAutoComplete(value, oldValue) {
|
321
|
-
|
321
|
+
// while "off" is the correct value, browser vendors ignore it. Arbitrary strings do the trick.
|
322
|
+
this.changeInputElKey('autocomplete', value ? null : 'no')
|
322
323
|
}
|
323
324
|
|
324
325
|
/**
|
@@ -1,12 +1,11 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
import DomAccess from '../DomAccess.mjs';
|
3
3
|
|
4
4
|
/**
|
5
5
|
* Helper class to include amCharts into your neo.mjs app
|
6
6
|
* https://www.amcharts.com/docs/v4/
|
7
7
|
* @class Neo.main.addon.AmCharts
|
8
|
-
* @extends Neo.
|
9
|
-
* @singleton
|
8
|
+
* @extends Neo.main.addon.Base
|
10
9
|
*/
|
11
10
|
class AmCharts extends Base {
|
12
11
|
static config = {
|
@@ -44,16 +43,6 @@ class AmCharts extends Base {
|
|
44
43
|
* @protected
|
45
44
|
*/
|
46
45
|
fallbackPath: 'https://neomjs.github.io/pages/resources/amCharts/',
|
47
|
-
/**
|
48
|
-
* @member {Boolean} scriptsLoaded_=true
|
49
|
-
* @protected
|
50
|
-
*/
|
51
|
-
scriptsLoaded_: false,
|
52
|
-
/**
|
53
|
-
* @member {Boolean} singleton=true
|
54
|
-
* @protected
|
55
|
-
*/
|
56
|
-
singleton: true,
|
57
46
|
/**
|
58
47
|
* Remote method access for other workers
|
59
48
|
* @member {Object} remote={app: [//...]}
|
@@ -68,7 +57,12 @@ class AmCharts extends Base {
|
|
68
57
|
'setProperty',
|
69
58
|
'updateData'
|
70
59
|
]
|
71
|
-
}
|
60
|
+
},
|
61
|
+
/**
|
62
|
+
* @member {Boolean} scriptsLoaded_=true
|
63
|
+
* @protected
|
64
|
+
*/
|
65
|
+
scriptsLoaded_: false
|
72
66
|
}
|
73
67
|
|
74
68
|
/**
|
@@ -278,6 +272,6 @@ class AmCharts extends Base {
|
|
278
272
|
}
|
279
273
|
}
|
280
274
|
|
281
|
-
|
275
|
+
Neo.applyClassConfig(AmCharts);
|
282
276
|
|
283
|
-
export default
|
277
|
+
export default AmCharts;
|
@@ -1,12 +1,11 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Required for the online version of the examples & docs app
|
5
5
|
* We can not name the file GoogleAnalytics, since it does break when using uBlock origin for dist versions.
|
6
6
|
* See: https://github.com/neomjs/neo/issues/651
|
7
7
|
* @class Neo.main.addon.AnalyticsByGoogle
|
8
|
-
* @extends Neo.
|
9
|
-
* @singleton
|
8
|
+
* @extends Neo.main.addon.Base
|
10
9
|
*/
|
11
10
|
class AnalyticsByGoogle extends Base {
|
12
11
|
static config = {
|
@@ -14,12 +13,7 @@ class AnalyticsByGoogle extends Base {
|
|
14
13
|
* @member {String} className='Neo.main.addon.AnalyticsByGoogle'
|
15
14
|
* @protected
|
16
15
|
*/
|
17
|
-
className: 'Neo.main.addon.AnalyticsByGoogle'
|
18
|
-
/**
|
19
|
-
* @member {Boolean} singleton=true
|
20
|
-
* @protected
|
21
|
-
*/
|
22
|
-
singleton: true
|
16
|
+
className: 'Neo.main.addon.AnalyticsByGoogle'
|
23
17
|
}
|
24
18
|
|
25
19
|
/**
|
@@ -54,6 +48,6 @@ class AnalyticsByGoogle extends Base {
|
|
54
48
|
}
|
55
49
|
}
|
56
50
|
|
57
|
-
|
51
|
+
Neo.applyClassConfig(AnalyticsByGoogle);
|
58
52
|
|
59
|
-
export default
|
53
|
+
export default AnalyticsByGoogle;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import CoreBase from '../../core/Base.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Base class for main thread addons
|
5
|
+
* @class Neo.main.addon.Base
|
6
|
+
* @extends Neo.core.Base
|
7
|
+
*/
|
8
|
+
class Base extends CoreBase {
|
9
|
+
static config = {
|
10
|
+
/**
|
11
|
+
* @member {String} className='Neo.main.addon.Base'
|
12
|
+
* @protected
|
13
|
+
*/
|
14
|
+
className: 'Neo.main.addon.Base',
|
15
|
+
/**
|
16
|
+
* An identifier for core.Base to get handled like singletons for remote method access
|
17
|
+
* @member {Boolean} isMainThreadAddon=true
|
18
|
+
* @protected
|
19
|
+
*/
|
20
|
+
isMainThreadAddon: true
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
Neo.applyClassConfig(Base);
|
25
|
+
|
26
|
+
export default Base;
|
@@ -1,11 +1,10 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
import DomAccess from '../DomAccess.mjs';
|
3
3
|
|
4
4
|
/**
|
5
5
|
* See: https://github.com/CesiumGS/cesium
|
6
6
|
* @class Neo.main.addon.CesiumJS
|
7
|
-
* @extends Neo.
|
8
|
-
* @singleton
|
7
|
+
* @extends Neo.main.addon.Base
|
9
8
|
*/
|
10
9
|
class CesiumJS extends Base {
|
11
10
|
static config = {
|
@@ -26,12 +25,7 @@ class CesiumJS extends Base {
|
|
26
25
|
'destroy',
|
27
26
|
'flyTo'
|
28
27
|
]
|
29
|
-
}
|
30
|
-
/**
|
31
|
-
* @member {Boolean} singleton=true
|
32
|
-
* @protected
|
33
|
-
*/
|
34
|
-
singleton: true
|
28
|
+
}
|
35
29
|
}
|
36
30
|
|
37
31
|
/**
|
@@ -117,6 +111,6 @@ class CesiumJS extends Base {
|
|
117
111
|
}
|
118
112
|
}
|
119
113
|
|
120
|
-
|
114
|
+
Neo.applyClassConfig(CesiumJS);
|
121
115
|
|
122
|
-
export default
|
116
|
+
export default CesiumJS;
|
@@ -1,11 +1,10 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Basic helper class to create template DOM nodes and apply them to a target node via cloning.
|
5
5
|
* See: https://github.com/neomjs/neo/blob/dev/apps/krausest/view/TableComponent.mjs
|
6
6
|
* @class Neo.main.addon.CloneNode
|
7
|
-
* @extends Neo.
|
8
|
-
* @singleton
|
7
|
+
* @extends Neo.main.addon.Base
|
9
8
|
*/
|
10
9
|
class CloneNode extends Base {
|
11
10
|
static config = {
|
@@ -30,12 +29,7 @@ class CloneNode extends Base {
|
|
30
29
|
'applyClones',
|
31
30
|
'createNode'
|
32
31
|
]
|
33
|
-
}
|
34
|
-
/**
|
35
|
-
* @member {Boolean} singleton=true
|
36
|
-
* @protected
|
37
|
-
*/
|
38
|
-
singleton: true
|
32
|
+
}
|
39
33
|
}
|
40
34
|
|
41
35
|
/**
|
@@ -93,15 +87,16 @@ class CloneNode extends Base {
|
|
93
87
|
*/
|
94
88
|
createNode(data) {
|
95
89
|
let template = document.createElement(data.tag);
|
90
|
+
|
96
91
|
template.innerHTML = data.html;
|
97
92
|
|
98
93
|
this.map[data.id] = {
|
99
|
-
paths
|
100
|
-
template
|
94
|
+
paths: data.paths,
|
95
|
+
template
|
101
96
|
};
|
102
97
|
}
|
103
98
|
}
|
104
99
|
|
105
|
-
|
100
|
+
Neo.applyClassConfig(CloneNode);
|
106
101
|
|
107
|
-
export default
|
102
|
+
export default CloneNode;
|
@@ -1,10 +1,9 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Basic Read and write access for document.cookie
|
5
5
|
* @class Neo.main.addon.Cookie
|
6
|
-
* @extends Neo.
|
7
|
-
* @singleton
|
6
|
+
* @extends Neo.main.addon.Base
|
8
7
|
*/
|
9
8
|
class Cookie extends Base {
|
10
9
|
static config = {
|
@@ -24,12 +23,7 @@ class Cookie extends Base {
|
|
24
23
|
'getCookies',
|
25
24
|
'setCookie'
|
26
25
|
]
|
27
|
-
}
|
28
|
-
/**
|
29
|
-
* @member {Boolean} singleton=true
|
30
|
-
* @protected
|
31
|
-
*/
|
32
|
-
singleton: true
|
26
|
+
}
|
33
27
|
}
|
34
28
|
|
35
29
|
/**
|
@@ -59,6 +53,6 @@ class Cookie extends Base {
|
|
59
53
|
}
|
60
54
|
}
|
61
55
|
|
62
|
-
|
56
|
+
Neo.applyClassConfig(Cookie);
|
63
57
|
|
64
|
-
export default
|
58
|
+
export default Cookie;
|
@@ -1,11 +1,10 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
import DomAccess from '../DomAccess.mjs';
|
3
3
|
import DomEvents from '../DomEvents.mjs';
|
4
4
|
|
5
5
|
/**
|
6
6
|
* @class Neo.main.addon.DragDrop
|
7
|
-
* @extends Neo.
|
8
|
-
* @singleton
|
7
|
+
* @extends Neo.main.addon.Base
|
9
8
|
*/
|
10
9
|
class DragDrop extends Base {
|
11
10
|
static config = {
|
@@ -124,12 +123,7 @@ class DragDrop extends Base {
|
|
124
123
|
/**
|
125
124
|
* @member {Number} scrollFactorTop=1
|
126
125
|
*/
|
127
|
-
scrollFactorTop: 1
|
128
|
-
/**
|
129
|
-
* @member {Boolean} singleton=true
|
130
|
-
* @protected
|
131
|
-
*/
|
132
|
-
singleton: true
|
126
|
+
scrollFactorTop: 1
|
133
127
|
}
|
134
128
|
|
135
129
|
/**
|
@@ -515,6 +509,6 @@ class DragDrop extends Base {
|
|
515
509
|
}
|
516
510
|
}
|
517
511
|
|
518
|
-
|
512
|
+
Neo.applyClassConfig(DragDrop);
|
519
513
|
|
520
|
-
export default
|
514
|
+
export default DragDrop;
|
@@ -1,12 +1,11 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
import DomAccess from '../DomAccess.mjs';
|
3
3
|
import DomEvents from '../DomEvents.mjs';
|
4
4
|
import Observable from '../../core/Observable.mjs';
|
5
5
|
|
6
6
|
/**
|
7
7
|
* @class Neo.main.addon.GoogleMaps
|
8
|
-
* @extends Neo.
|
9
|
-
* @singleton
|
8
|
+
* @extends Neo.main.addon.Base
|
10
9
|
*/
|
11
10
|
class GoogleMaps extends Base {
|
12
11
|
static config = {
|
@@ -37,12 +36,7 @@ class GoogleMaps extends Base {
|
|
37
36
|
'setZoom',
|
38
37
|
'showMarker'
|
39
38
|
]
|
40
|
-
}
|
41
|
-
/**
|
42
|
-
* @member {Boolean} singleton=true
|
43
|
-
* @protected
|
44
|
-
*/
|
45
|
-
singleton: true
|
39
|
+
}
|
46
40
|
}
|
47
41
|
|
48
42
|
/**
|
@@ -52,11 +46,11 @@ class GoogleMaps extends Base {
|
|
52
46
|
/**
|
53
47
|
* @member {Object} maps={}
|
54
48
|
*/
|
55
|
-
maps
|
49
|
+
maps = {}
|
56
50
|
/**
|
57
51
|
* @member {Object} markers={}
|
58
52
|
*/
|
59
|
-
markers
|
53
|
+
markers = {}
|
60
54
|
|
61
55
|
/**
|
62
56
|
* @param {Object} config
|
@@ -278,6 +272,6 @@ class GoogleMaps extends Base {
|
|
278
272
|
}
|
279
273
|
}
|
280
274
|
|
281
|
-
|
275
|
+
Neo.applyClassConfig(GoogleMaps);
|
282
276
|
|
283
|
-
export default
|
277
|
+
export default GoogleMaps;
|
@@ -1,12 +1,11 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
import DomAccess from '../DomAccess.mjs';
|
3
3
|
import Stylesheet from './Stylesheet.mjs'
|
4
4
|
|
5
5
|
/**
|
6
6
|
* Required for the docs app which uses highlight.js for the source views
|
7
7
|
* @class Neo.main.addon.HighlightJS
|
8
|
-
* @extends Neo.
|
9
|
-
* @singleton
|
8
|
+
* @extends Neo.main.addon.Base
|
10
9
|
*/
|
11
10
|
class HighlightJS extends Base {
|
12
11
|
static config = {
|
@@ -41,11 +40,6 @@ class HighlightJS extends Base {
|
|
41
40
|
'highlightAuto'
|
42
41
|
]
|
43
42
|
},
|
44
|
-
/**
|
45
|
-
* @member {Boolean} singleton=true
|
46
|
-
* @protected
|
47
|
-
*/
|
48
|
-
singleton: true,
|
49
43
|
/**
|
50
44
|
* @member {String} themePath='./resources/highlightjs-custom-github-theme.css'
|
51
45
|
* @protected
|
@@ -187,6 +181,6 @@ class HighlightJS extends Base {
|
|
187
181
|
}
|
188
182
|
}
|
189
183
|
|
190
|
-
|
184
|
+
Neo.applyClassConfig(HighlightJS);
|
191
185
|
|
192
|
-
export default
|
186
|
+
export default HighlightJS;
|
@@ -1,10 +1,9 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Basic CRUD support for window.localStorage
|
5
5
|
* @class Neo.main.addon.LocalStorage
|
6
|
-
* @extends Neo.
|
7
|
-
* @singleton
|
6
|
+
* @extends Neo.main.addon.Base
|
8
7
|
*/
|
9
8
|
class LocalStorage extends Base {
|
10
9
|
static config = {
|
@@ -25,12 +24,7 @@ class LocalStorage extends Base {
|
|
25
24
|
'readLocalStorageItem',
|
26
25
|
'updateLocalStorageItem'
|
27
26
|
]
|
28
|
-
}
|
29
|
-
/**
|
30
|
-
* @member {Boolean} singleton=true
|
31
|
-
* @protected
|
32
|
-
*/
|
33
|
-
singleton: true
|
27
|
+
}
|
34
28
|
}
|
35
29
|
|
36
30
|
/**
|
@@ -76,6 +70,6 @@ class LocalStorage extends Base {
|
|
76
70
|
}
|
77
71
|
}
|
78
72
|
|
79
|
-
|
73
|
+
Neo.applyClassConfig(LocalStorage);
|
80
74
|
|
81
|
-
export default
|
75
|
+
export default LocalStorage;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
import DomAccess from '../DomAccess.mjs';
|
3
3
|
|
4
4
|
/**
|
@@ -7,8 +7,7 @@ import DomAccess from '../DomAccess.mjs';
|
|
7
7
|
* In case you need more API methods to get exposed to the App worker,
|
8
8
|
* please open issues inside the tracker and / or submit PRs.
|
9
9
|
* @class Neo.main.addon.MapboxGL
|
10
|
-
* @extends Neo.
|
11
|
-
* @singleton
|
10
|
+
* @extends Neo.main.addon.Base
|
12
11
|
*/
|
13
12
|
class MapboxGL extends Base {
|
14
13
|
static config = {
|
@@ -48,23 +47,6 @@ class MapboxGL extends Base {
|
|
48
47
|
* @protected
|
49
48
|
*/
|
50
49
|
mapsToCreate: [],
|
51
|
-
/**
|
52
|
-
* @member {Boolean} scriptsLoaded_=true
|
53
|
-
* @protected
|
54
|
-
*/
|
55
|
-
scriptsLoaded_: false,
|
56
|
-
/**
|
57
|
-
* @member {Boolean} singleton=true
|
58
|
-
* @protected
|
59
|
-
*/
|
60
|
-
singleton: true,
|
61
|
-
/**
|
62
|
-
* Stores all map sources inside an object.
|
63
|
-
* key => map id, value => {Array} sources
|
64
|
-
* @member {Object} sources={}
|
65
|
-
* @protected
|
66
|
-
*/
|
67
|
-
sources: {},
|
68
50
|
/**
|
69
51
|
* Remote method access for other workers
|
70
52
|
* @member {Object} remote
|
@@ -86,6 +68,18 @@ class MapboxGL extends Base {
|
|
86
68
|
'zoom'
|
87
69
|
]
|
88
70
|
},
|
71
|
+
/**
|
72
|
+
* @member {Boolean} scriptsLoaded_=true
|
73
|
+
* @protected
|
74
|
+
*/
|
75
|
+
scriptsLoaded_: false,
|
76
|
+
/**
|
77
|
+
* Stores all map sources inside an object.
|
78
|
+
* key => map id, value => {Array} sources
|
79
|
+
* @member {Object} sources={}
|
80
|
+
* @protected
|
81
|
+
*/
|
82
|
+
sources: {},
|
89
83
|
/**
|
90
84
|
* Stores all map style objects inside an objects to prevent reloads when switching themes multiple times.
|
91
85
|
* key => style name (url)
|
@@ -488,6 +482,6 @@ class MapboxGL extends Base {
|
|
488
482
|
}
|
489
483
|
}
|
490
484
|
|
491
|
-
|
485
|
+
Neo.applyClassConfig(MapboxGL);
|
492
486
|
|
493
|
-
export default
|
487
|
+
export default MapboxGL;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
import DomAccess from '../DomAccess.mjs';
|
3
3
|
|
4
4
|
/**
|
@@ -7,8 +7,7 @@ import DomAccess from '../DomAccess.mjs';
|
|
7
7
|
* script tag with the markdown lib has to be added before the Main.mjs script tag in the index.html
|
8
8
|
* <script src="https://cdn.jsdelivr.net/npm/showdown@1.9.1/dist/showdown.min.js"></script>
|
9
9
|
* @class Neo.main.addon.Markdown
|
10
|
-
* @extends Neo.
|
11
|
-
* @singleton
|
10
|
+
* @extends Neo.main.addon.Base
|
12
11
|
*/
|
13
12
|
class Markdown extends Base {
|
14
13
|
static config = {
|
@@ -31,12 +30,7 @@ class Markdown extends Base {
|
|
31
30
|
* @member {String} showdownPath='https://cdn.jsdelivr.net/npm/showdown@1.9.1/dist/showdown.min.js'
|
32
31
|
* @protected
|
33
32
|
*/
|
34
|
-
showdownPath: 'https://cdn.jsdelivr.net/npm/showdown@1.9.1/dist/showdown.min.js'
|
35
|
-
/**
|
36
|
-
* @member {Boolean} singleton=true
|
37
|
-
* @protected
|
38
|
-
*/
|
39
|
-
singleton: true
|
33
|
+
showdownPath: 'https://cdn.jsdelivr.net/npm/showdown@1.9.1/dist/showdown.min.js'
|
40
34
|
}
|
41
35
|
|
42
36
|
/**
|
@@ -59,6 +53,6 @@ class Markdown extends Base {
|
|
59
53
|
}
|
60
54
|
}
|
61
55
|
|
62
|
-
|
56
|
+
Neo.applyClassConfig(Markdown);
|
63
57
|
|
64
|
-
export default
|
58
|
+
export default Markdown;
|
package/src/main/addon/Mwc.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Helper class to include Google's Material Web Components into your neo.mjs app
|
@@ -13,8 +13,7 @@ import Base from '../../core/Base.mjs';
|
|
13
13
|
* into the neo-config.json of your app. E.g.: [..., "WS/Mwc"].
|
14
14
|
*
|
15
15
|
* @class Neo.main.addon.Mwc
|
16
|
-
* @extends Neo.
|
17
|
-
* @singleton
|
16
|
+
* @extends Neo.main.addon.Base
|
18
17
|
*/
|
19
18
|
class Mwc extends Base {
|
20
19
|
static config = {
|
@@ -23,11 +22,6 @@ class Mwc extends Base {
|
|
23
22
|
* @protected
|
24
23
|
*/
|
25
24
|
className: 'Neo.main.addon.Mwc',
|
26
|
-
/**
|
27
|
-
* @member {Boolean} singleton=true
|
28
|
-
* @protected
|
29
|
-
*/
|
30
|
-
singleton: true,
|
31
25
|
/**
|
32
26
|
* Remote method access for other workers
|
33
27
|
* @member {Object} remote
|
@@ -90,6 +84,6 @@ class Mwc extends Base {
|
|
90
84
|
}
|
91
85
|
}
|
92
86
|
|
93
|
-
|
87
|
+
Neo.applyClassConfig(Mwc);
|
94
88
|
|
95
|
-
export default
|
89
|
+
export default Mwc;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
import DomAccess from '../DomAccess.mjs';
|
3
|
-
import DomUtils from '../DomUtils.mjs';
|
4
3
|
import DomEvents from '../DomEvents.mjs';
|
4
|
+
import DomUtils from '../DomUtils.mjs';
|
5
5
|
|
6
6
|
// We do not need to inject a synthesized "click" event when we detect an ENTER
|
7
7
|
// keypress on these element types.
|
@@ -13,8 +13,7 @@ const enterActivatedTags= {
|
|
13
13
|
/**
|
14
14
|
* Addon for Navigator
|
15
15
|
* @class Neo.main.addon.Navigator
|
16
|
-
* @extends Neo.
|
17
|
-
* @singleton
|
16
|
+
* @extends Neo.main.addon.Base
|
18
17
|
*/
|
19
18
|
class Navigator extends Base {
|
20
19
|
static config = {
|
@@ -34,12 +33,7 @@ class Navigator extends Base {
|
|
34
33
|
'subscribe',
|
35
34
|
'unsubscribe'
|
36
35
|
]
|
37
|
-
}
|
38
|
-
/**
|
39
|
-
* @member {Boolean} singleton=true
|
40
|
-
* @protected
|
41
|
-
*/
|
42
|
-
singleton: true
|
36
|
+
}
|
43
37
|
}
|
44
38
|
|
45
39
|
/**
|
@@ -451,6 +445,6 @@ class Navigator extends Base {
|
|
451
445
|
}
|
452
446
|
}
|
453
447
|
|
454
|
-
|
448
|
+
Neo.applyClassConfig(Navigator);
|
455
449
|
|
456
|
-
export default
|
450
|
+
export default Navigator;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import Base from '
|
2
|
-
import DomAccess from '../DomAccess.mjs'
|
1
|
+
import Base from './Base.mjs';
|
2
|
+
import DomAccess from '../DomAccess.mjs';
|
3
|
+
|
3
4
|
/**
|
4
5
|
* Addon for Popover
|
5
6
|
* @class Neo.main.addon.Popover
|
6
|
-
* @extends Neo.
|
7
|
-
* @singleton
|
7
|
+
* @extends Neo.main.addon.Base
|
8
8
|
*/
|
9
9
|
class Popover extends Base {
|
10
10
|
static config = {
|
@@ -24,12 +24,7 @@ class Popover extends Base {
|
|
24
24
|
'show',
|
25
25
|
'toggle'
|
26
26
|
]
|
27
|
-
}
|
28
|
-
/**
|
29
|
-
* @member {Boolean} singleton=true
|
30
|
-
* @protected
|
31
|
-
*/
|
32
|
-
singleton: true
|
27
|
+
}
|
33
28
|
}
|
34
29
|
|
35
30
|
/**
|
@@ -70,6 +65,6 @@ class Popover extends Base {
|
|
70
65
|
}
|
71
66
|
}
|
72
67
|
|
73
|
-
|
68
|
+
Neo.applyClassConfig(Popover);
|
74
69
|
|
75
|
-
export default
|
70
|
+
export default Popover;
|
@@ -1,11 +1,10 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Helper class to include Google's Material Web Components into your neo.mjs app
|
5
5
|
* https://www.amcharts.com/docs/v4/
|
6
6
|
* @class Neo.main.addon.PrefixField
|
7
|
-
* @extends Neo.
|
8
|
-
* @singleton
|
7
|
+
* @extends Neo.main.addon.Base
|
9
8
|
*/
|
10
9
|
class PrefixField extends Base {
|
11
10
|
static config = {
|
@@ -15,10 +14,16 @@ class PrefixField extends Base {
|
|
15
14
|
*/
|
16
15
|
className: 'Neo.main.addon.PrefixField',
|
17
16
|
/**
|
18
|
-
*
|
19
|
-
*
|
17
|
+
* regex to calculate if entered value is acceptable
|
18
|
+
* Preset to numbers only
|
19
|
+
*
|
20
|
+
* @member {regex|null} accept
|
20
21
|
*/
|
21
|
-
|
22
|
+
accept_: null,
|
23
|
+
/**
|
24
|
+
* @member {String} pattern=null
|
25
|
+
*/
|
26
|
+
pattern_: null,
|
22
27
|
/**
|
23
28
|
* Remote method access for other workers
|
24
29
|
* @member {Object} remote
|
@@ -33,18 +38,6 @@ class PrefixField extends Base {
|
|
33
38
|
'updateSlots',
|
34
39
|
]
|
35
40
|
},
|
36
|
-
|
37
|
-
/**
|
38
|
-
* regex to calculate if entered value is acceptable
|
39
|
-
* Preset to numbers only
|
40
|
-
*
|
41
|
-
* @member {regex|null} accept
|
42
|
-
*/
|
43
|
-
accept_: null,
|
44
|
-
/**
|
45
|
-
* @member {String} pattern=null
|
46
|
-
*/
|
47
|
-
pattern_: null,
|
48
41
|
/**
|
49
42
|
* Only add a String. A Set will be automatically created
|
50
43
|
* @member {String|Set|null} slots=null
|
@@ -52,15 +45,15 @@ class PrefixField extends Base {
|
|
52
45
|
slots_: null
|
53
46
|
}
|
54
47
|
|
55
|
-
|
48
|
+
elIds = new Map()
|
56
49
|
|
57
|
-
|
50
|
+
prev
|
58
51
|
|
59
|
-
|
52
|
+
back = false
|
60
53
|
|
61
|
-
|
54
|
+
destroy() {
|
62
55
|
|
63
|
-
|
56
|
+
}
|
64
57
|
|
65
58
|
/**
|
66
59
|
*
|
@@ -144,6 +137,6 @@ class PrefixField extends Base {
|
|
144
137
|
}
|
145
138
|
}
|
146
139
|
|
147
|
-
|
140
|
+
Neo.applyClassConfig(PrefixField);
|
148
141
|
|
149
|
-
export default
|
142
|
+
export default PrefixField;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
import DomAccess from '../DomAccess.mjs';
|
3
3
|
import DomEvents from '../DomEvents.mjs';
|
4
4
|
|
5
5
|
/**
|
6
6
|
* @class Neo.main.addon.ResizeObserver
|
7
|
-
* @extends Neo.
|
7
|
+
* @extends Neo.main.addon.Base
|
8
8
|
* @singleton
|
9
9
|
*/
|
10
10
|
class NeoResizeObserver extends Base {
|
@@ -29,12 +29,7 @@ class NeoResizeObserver extends Base {
|
|
29
29
|
'register',
|
30
30
|
'unregister'
|
31
31
|
]
|
32
|
-
}
|
33
|
-
/**
|
34
|
-
* @member {Boolean} singleton=true
|
35
|
-
* @protected
|
36
|
-
*/
|
37
|
-
singleton: true
|
32
|
+
}
|
38
33
|
}
|
39
34
|
|
40
35
|
/**
|
@@ -111,6 +106,6 @@ class NeoResizeObserver extends Base {
|
|
111
106
|
}
|
112
107
|
}
|
113
108
|
|
114
|
-
|
109
|
+
Neo.applyClassConfig(NeoResizeObserver);
|
115
110
|
|
116
|
-
export default
|
111
|
+
export default NeoResizeObserver;
|
@@ -1,11 +1,10 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
import WorkerManager from '../../worker/Manager.mjs';
|
3
3
|
|
4
4
|
/**
|
5
5
|
* Creates a ServiceWorker instance, in case Neo.config.useServiceWorker is set to true
|
6
6
|
* @class Neo.main.addon.ServiceWorker
|
7
|
-
* @extends Neo.
|
8
|
-
* @singleton
|
7
|
+
* @extends Neo.main.addon.Base
|
9
8
|
*/
|
10
9
|
class ServiceWorker extends Base {
|
11
10
|
static config = {
|
@@ -13,12 +12,7 @@ class ServiceWorker extends Base {
|
|
13
12
|
* @member {String} className='Neo.main.addon.ServiceWorker'
|
14
13
|
* @protected
|
15
14
|
*/
|
16
|
-
className: 'Neo.main.addon.ServiceWorker'
|
17
|
-
/**
|
18
|
-
* @member {Boolean} singleton=true
|
19
|
-
* @protected
|
20
|
-
*/
|
21
|
-
singleton: true
|
15
|
+
className: 'Neo.main.addon.ServiceWorker'
|
22
16
|
}
|
23
17
|
|
24
18
|
/**
|
@@ -70,6 +64,6 @@ class ServiceWorker extends Base {
|
|
70
64
|
}
|
71
65
|
}
|
72
66
|
|
73
|
-
|
67
|
+
Neo.applyClassConfig(ServiceWorker);
|
74
68
|
|
75
|
-
export default
|
69
|
+
export default ServiceWorker;
|
@@ -1,10 +1,9 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Required when running Neo Apps inside the Siesta browser harness (iframe)
|
5
5
|
* @class Neo.main.addon.Siesta
|
6
|
-
* @extends Neo.
|
7
|
-
* @singleton
|
6
|
+
* @extends Neo.main.addon.Base
|
8
7
|
*/
|
9
8
|
class Siesta extends Base {
|
10
9
|
static config = {
|
@@ -12,12 +11,7 @@ class Siesta extends Base {
|
|
12
11
|
* @member {String} className='Neo.main.addon.Siesta'
|
13
12
|
* @protected
|
14
13
|
*/
|
15
|
-
className: 'Neo.main.addon.Siesta'
|
16
|
-
/**
|
17
|
-
* @member {Boolean} singleton=true
|
18
|
-
* @protected
|
19
|
-
*/
|
20
|
-
singleton: true
|
14
|
+
className: 'Neo.main.addon.Siesta'
|
21
15
|
}
|
22
16
|
|
23
17
|
/**
|
@@ -47,6 +41,6 @@ class Siesta extends Base {
|
|
47
41
|
}
|
48
42
|
}
|
49
43
|
|
50
|
-
|
44
|
+
Neo.applyClassConfig(Siesta);
|
51
45
|
|
52
|
-
export default
|
46
|
+
export default Siesta;
|
@@ -1,11 +1,10 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Logic to work with stylesheets, e.g. apply & switch Neo based themes
|
5
5
|
* main.addon.HighlightJS requires this file
|
6
6
|
* @class Neo.main.addon.Stylesheet
|
7
|
-
* @extends Neo.
|
8
|
-
* @singleton
|
7
|
+
* @extends Neo.main.addon.Base
|
9
8
|
*/
|
10
9
|
class Stylesheet extends Base {
|
11
10
|
/**
|
@@ -34,12 +33,7 @@ class Stylesheet extends Base {
|
|
34
33
|
'setCssVariable',
|
35
34
|
'swapStyleSheet'
|
36
35
|
]
|
37
|
-
}
|
38
|
-
/**
|
39
|
-
* @member {Boolean} singleton=true
|
40
|
-
* @protected
|
41
|
-
*/
|
42
|
-
singleton: true
|
36
|
+
}
|
43
37
|
}
|
44
38
|
|
45
39
|
/**
|
@@ -301,6 +295,6 @@ class Stylesheet extends Base {
|
|
301
295
|
}
|
302
296
|
}
|
303
297
|
|
304
|
-
|
298
|
+
Neo.applyClassConfig(Stylesheet);
|
305
299
|
|
306
|
-
export default
|
300
|
+
export default Stylesheet;
|
@@ -1,10 +1,9 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Addon to register WebComponents
|
5
5
|
* @class Neo.main.addon.WebComponent
|
6
|
-
* @extends Neo.
|
7
|
-
* @singleton
|
6
|
+
* @extends Neo.main.addon.Base
|
8
7
|
*/
|
9
8
|
class WebComponent extends Base {
|
10
9
|
static config = {
|
@@ -12,12 +11,7 @@ class WebComponent extends Base {
|
|
12
11
|
* @member {String} className='Neo.main.addon.WebComponent'
|
13
12
|
* @protected
|
14
13
|
*/
|
15
|
-
className: 'Neo.main.addon.WebComponent'
|
16
|
-
/**
|
17
|
-
* @member {Boolean} singleton=true
|
18
|
-
* @protected
|
19
|
-
*/
|
20
|
-
singleton: true
|
14
|
+
className: 'Neo.main.addon.WebComponent'
|
21
15
|
}
|
22
16
|
|
23
17
|
/**
|
@@ -48,6 +42,6 @@ class WebComponent extends Base {
|
|
48
42
|
}
|
49
43
|
}
|
50
44
|
|
51
|
-
|
45
|
+
Neo.applyClassConfig(WebComponent);
|
52
46
|
|
53
|
-
export default
|
47
|
+
export default WebComponent;
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import Base from '
|
1
|
+
import Base from './Base.mjs';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* @class Neo.main.addon.WindowPosition
|
5
|
-
* @extends Neo.
|
6
|
-
* @singleton
|
5
|
+
* @extends Neo.main.addon.Base
|
7
6
|
*/
|
8
7
|
class WindowPosition extends Base {
|
9
8
|
static config = {
|
@@ -49,11 +48,6 @@ class WindowPosition extends Base {
|
|
49
48
|
* @member {Number|null} screenTop=null
|
50
49
|
*/
|
51
50
|
screenTop: null,
|
52
|
-
/**
|
53
|
-
* @member {Boolean} singleton=true
|
54
|
-
* @protected
|
55
|
-
*/
|
56
|
-
singleton: true,
|
57
51
|
/**
|
58
52
|
* @member {Object} windows={}
|
59
53
|
* @protected
|
@@ -297,6 +291,6 @@ class WindowPosition extends Base {
|
|
297
291
|
}
|
298
292
|
}
|
299
293
|
|
300
|
-
|
294
|
+
Neo.applyClassConfig(WindowPosition);
|
301
295
|
|
302
|
-
export default
|
296
|
+
export default WindowPosition;
|
package/src/menu/List.mjs
CHANGED
@@ -269,6 +269,7 @@ class List extends BaseList {
|
|
269
269
|
* @param {Object[]} data.path
|
270
270
|
*/
|
271
271
|
onFocusEnter(data) {
|
272
|
+
super.onFocusEnter(data);
|
272
273
|
this.menuFocus = true
|
273
274
|
}
|
274
275
|
|
@@ -277,6 +278,8 @@ class List extends BaseList {
|
|
277
278
|
* @param {Object[]} data.oldPath
|
278
279
|
*/
|
279
280
|
onFocusLeave(data) {
|
281
|
+
super.onFocusLeave(data);
|
282
|
+
|
280
283
|
let insideParent = false,
|
281
284
|
parentId = this.parentComponent?.id,
|
282
285
|
item;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import NeoArray from '../util/Array.mjs';
|
2
1
|
import Model from './Model.mjs';
|
3
2
|
|
4
3
|
/**
|
@@ -55,6 +54,9 @@ class ListModel extends Model {
|
|
55
54
|
*/
|
56
55
|
onKeyDownUp(data) {}
|
57
56
|
|
57
|
+
/**
|
58
|
+
* @param {Object} data
|
59
|
+
*/
|
58
60
|
onListClick({ currentTarget }) {
|
59
61
|
const { view } = this;
|
60
62
|
|
@@ -67,6 +69,9 @@ class ListModel extends Model {
|
|
67
69
|
}
|
68
70
|
}
|
69
71
|
|
72
|
+
/**
|
73
|
+
* @param {Object} data
|
74
|
+
*/
|
70
75
|
onListNavigate(data) {
|
71
76
|
const
|
72
77
|
{ view } = this,
|