neo.mjs 5.0.3 → 5.1.1
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/.github/CODING_GUIDELINES.md +294 -12
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/realworld/view/HomeComponent.mjs +16 -16
- package/apps/realworld/view/MainContainerController.mjs +7 -0
- package/examples/ServiceWorker.mjs +2 -2
- package/package.json +3 -3
- package/src/DefaultConfig.mjs +2 -2
- package/src/Neo.mjs +8 -8
- package/src/button/Base.mjs +21 -26
- package/src/calendar/view/week/Component.mjs +1 -2
- package/src/collection/Base.mjs +1 -1
- package/src/component/wrapper/GoogleMaps.mjs +35 -35
- package/src/container/Base.mjs +1 -0
- package/src/controller/Component.mjs +11 -0
- package/src/core/Base.mjs +66 -0
- package/src/core/Observable.mjs +3 -1
- package/src/data/connection/Fetch.mjs +5 -5
- package/src/data/connection/WebSocket.mjs +25 -24
- package/src/dialog/header/Toolbar.mjs +12 -12
- package/src/form/field/Search.mjs +1 -1
- package/src/form/field/Select.mjs +10 -10
- package/src/form/field/Text.mjs +40 -26
- package/src/form/field/trigger/Date.mjs +3 -3
- package/src/form/field/trigger/Search.mjs +28 -0
- package/src/grid/Container.mjs +20 -20
- package/src/grid/header/Button.mjs +10 -10
- package/src/list/Color.mjs +7 -7
- package/src/main/addon/CesiumJS.mjs +6 -6
- package/src/main/addon/GoogleMaps.mjs +13 -13
- package/src/manager/Component.mjs +5 -5
- package/src/manager/Task.mjs +2 -2
- package/src/manager/Toast.mjs +13 -13
- package/src/manager/rpc/Message.mjs +20 -20
- package/src/vdom/Helper.mjs +24 -24
- package/src/worker/App.mjs +18 -18
- package/src/worker/Base.mjs +17 -17
- package/src/worker/Data.mjs +11 -11
- package/src/worker/Manager.mjs +9 -9
- package/src/worker/ServiceBase.mjs +25 -25
@@ -9,19 +9,6 @@ import Observable from '../../core/Observable.mjs';
|
|
9
9
|
* @singleton
|
10
10
|
*/
|
11
11
|
class GoogleMaps extends Base {
|
12
|
-
/**
|
13
|
-
* @member {google.maps.Geocoder|null} maps=null
|
14
|
-
*/
|
15
|
-
geoCoder = null
|
16
|
-
/**
|
17
|
-
* @member {Object} maps={}
|
18
|
-
*/
|
19
|
-
maps = {}
|
20
|
-
/**
|
21
|
-
* @member {Object} markers={}
|
22
|
-
*/
|
23
|
-
markers = {}
|
24
|
-
|
25
12
|
static config = {
|
26
13
|
/**
|
27
14
|
* @member {String} className='Neo.main.addon.GoogleMaps'
|
@@ -57,6 +44,19 @@ class GoogleMaps extends Base {
|
|
57
44
|
singleton: true
|
58
45
|
}
|
59
46
|
|
47
|
+
/**
|
48
|
+
* @member {google.maps.Geocoder|null} maps=null
|
49
|
+
*/
|
50
|
+
geoCoder = null
|
51
|
+
/**
|
52
|
+
* @member {Object} maps={}
|
53
|
+
*/
|
54
|
+
maps = {}
|
55
|
+
/**
|
56
|
+
* @member {Object} markers={}
|
57
|
+
*/
|
58
|
+
markers = {}
|
59
|
+
|
60
60
|
/**
|
61
61
|
* @param {Object} config
|
62
62
|
*/
|
@@ -182,7 +182,7 @@ class Component extends Base {
|
|
182
182
|
root = app.mainView;
|
183
183
|
|
184
184
|
/* create an array of objects from string */
|
185
|
-
if(Neo.isString(componentDescription)) {
|
185
|
+
if (Neo.isString(componentDescription)) {
|
186
186
|
const regex = /(\w*)(\[[^\]]*\])|(\w*)/g;
|
187
187
|
let match;
|
188
188
|
|
@@ -193,11 +193,11 @@ class Component extends Base {
|
|
193
193
|
ntype = ntype || ntypeOnly;
|
194
194
|
obj = {ntype};
|
195
195
|
|
196
|
-
if(pairs) {
|
196
|
+
if (pairs) {
|
197
197
|
const pairsRegex = /\[(.*?)\]/,
|
198
198
|
pairsMatch = pairs.match(pairsRegex);
|
199
199
|
|
200
|
-
if(pairsMatch) {
|
200
|
+
if (pairsMatch) {
|
201
201
|
const pairs = pairsMatch[1].split(',');
|
202
202
|
pairs.forEach((pair) => {
|
203
203
|
const [key, value] = pair.split('=');
|
@@ -217,10 +217,10 @@ class Component extends Base {
|
|
217
217
|
|
218
218
|
/* find the correct child using down() */
|
219
219
|
const result = objects.reduce((acc, key) => {
|
220
|
-
if(acc) {
|
220
|
+
if (acc) {
|
221
221
|
let child = acc.down(key, returnFirstMatch);
|
222
222
|
|
223
|
-
if(!!child) {
|
223
|
+
if (!!child) {
|
224
224
|
return child;
|
225
225
|
}
|
226
226
|
}
|
package/src/manager/Task.mjs
CHANGED
@@ -102,7 +102,7 @@ class Task extends Base {
|
|
102
102
|
let fn = function(task) {
|
103
103
|
task.runCount++;
|
104
104
|
|
105
|
-
if(task.addCountToArgs) {
|
105
|
+
if (task.addCountToArgs) {
|
106
106
|
task.args[task.args.length - 1] = task.runCount;
|
107
107
|
}
|
108
108
|
|
@@ -170,7 +170,7 @@ class Task extends Base {
|
|
170
170
|
task.runCount = 0;
|
171
171
|
task.runner = null;
|
172
172
|
|
173
|
-
if(task.addCountToArgs) {
|
173
|
+
if (task.addCountToArgs) {
|
174
174
|
task.args[task.args.length - 1] = 0;
|
175
175
|
}
|
176
176
|
}
|
package/src/manager/Toast.mjs
CHANGED
@@ -8,6 +8,19 @@ import NeoArray from "../util/Array.mjs";
|
|
8
8
|
* @singleton
|
9
9
|
*/
|
10
10
|
class Toast extends Base {
|
11
|
+
static config = {
|
12
|
+
/**
|
13
|
+
* @member {String} className='Neo.manager.Toast'
|
14
|
+
* @protected
|
15
|
+
*/
|
16
|
+
className: 'Neo.manager.Toast',
|
17
|
+
/**
|
18
|
+
* @member {Boolean} singleton=true
|
19
|
+
* @protected
|
20
|
+
*/
|
21
|
+
singleton: true
|
22
|
+
}
|
23
|
+
|
11
24
|
/**
|
12
25
|
* Using a default margin between the item
|
13
26
|
* If you switch the distance to the top or bottom you have to change this value accordingly
|
@@ -33,19 +46,6 @@ class Toast extends Base {
|
|
33
46
|
*/
|
34
47
|
toastClass = 'Neo.component.Toast'
|
35
48
|
|
36
|
-
static config = {
|
37
|
-
/**
|
38
|
-
* @member {String} className='Neo.manager.Toast'
|
39
|
-
* @protected
|
40
|
-
*/
|
41
|
-
className: 'Neo.manager.Toast',
|
42
|
-
/**
|
43
|
-
* @member {Boolean} singleton=true
|
44
|
-
* @protected
|
45
|
-
*/
|
46
|
-
singleton: true
|
47
|
-
}
|
48
|
-
|
49
49
|
/**
|
50
50
|
* @param {Object} config
|
51
51
|
*/
|
@@ -7,6 +7,26 @@ import NeoArray from '../../util/Array.mjs';
|
|
7
7
|
* @singleton
|
8
8
|
*/
|
9
9
|
class Message extends Base {
|
10
|
+
static config = {
|
11
|
+
/**
|
12
|
+
* @member {String} className='Neo.manager.rpc.Message'
|
13
|
+
* @protected
|
14
|
+
*/
|
15
|
+
className: 'Neo.manager.rpc.Message',
|
16
|
+
/**
|
17
|
+
* @member {Boolean} singleton=true
|
18
|
+
* @protected
|
19
|
+
*/
|
20
|
+
singleton: true,
|
21
|
+
/**
|
22
|
+
* @member {Object[]} sorters
|
23
|
+
*/
|
24
|
+
sorters: [{
|
25
|
+
direction: 'ASC',
|
26
|
+
property : 'id'
|
27
|
+
}]
|
28
|
+
}
|
29
|
+
|
10
30
|
/**
|
11
31
|
* Stores the urls of endpoints for which a setTimeout() call is in progress
|
12
32
|
* @member {String[]} endPointTimeouts=[]
|
@@ -34,26 +54,6 @@ class Message extends Base {
|
|
34
54
|
*/
|
35
55
|
transactionId = 1
|
36
56
|
|
37
|
-
static config = {
|
38
|
-
/**
|
39
|
-
* @member {String} className='Neo.manager.rpc.Message'
|
40
|
-
* @protected
|
41
|
-
*/
|
42
|
-
className: 'Neo.manager.rpc.Message',
|
43
|
-
/**
|
44
|
-
* @member {Boolean} singleton=true
|
45
|
-
* @protected
|
46
|
-
*/
|
47
|
-
singleton: true,
|
48
|
-
/**
|
49
|
-
* @member {Object[]} sorters
|
50
|
-
*/
|
51
|
-
sorters: [{
|
52
|
-
direction: 'ASC',
|
53
|
-
property : 'id'
|
54
|
-
}]
|
55
|
-
}
|
56
|
-
|
57
57
|
/**
|
58
58
|
*
|
59
59
|
* @param {Object} msg
|
package/src/vdom/Helper.mjs
CHANGED
@@ -11,6 +11,30 @@ import VNodeUtil from '../util/VNode.mjs';
|
|
11
11
|
* @singleton
|
12
12
|
*/
|
13
13
|
class Helper extends Base {
|
14
|
+
static config = {
|
15
|
+
/**
|
16
|
+
* @member {String} className='Neo.vdom.Helper'
|
17
|
+
* @protected
|
18
|
+
*/
|
19
|
+
className: 'Neo.vdom.Helper',
|
20
|
+
/**
|
21
|
+
* Remote method access for other workers
|
22
|
+
* @member {Object} remote={app:['create','update']}
|
23
|
+
* @protected
|
24
|
+
*/
|
25
|
+
remote: {
|
26
|
+
app: [
|
27
|
+
'create',
|
28
|
+
'update'
|
29
|
+
]
|
30
|
+
},
|
31
|
+
/**
|
32
|
+
* @member {Boolean} singleton=true
|
33
|
+
* @protected
|
34
|
+
*/
|
35
|
+
singleton: true
|
36
|
+
}
|
37
|
+
|
14
38
|
/**
|
15
39
|
* @member {Boolean} returnChildNodeOuterHtml=false
|
16
40
|
*/
|
@@ -48,30 +72,6 @@ class Helper extends Base {
|
|
48
72
|
'wbr'
|
49
73
|
]
|
50
74
|
|
51
|
-
static config = {
|
52
|
-
/**
|
53
|
-
* @member {String} className='Neo.vdom.Helper'
|
54
|
-
* @protected
|
55
|
-
*/
|
56
|
-
className: 'Neo.vdom.Helper',
|
57
|
-
/**
|
58
|
-
* Remote method access for other workers
|
59
|
-
* @member {Object} remote={app:['create','update']}
|
60
|
-
* @protected
|
61
|
-
*/
|
62
|
-
remote: {
|
63
|
-
app: [
|
64
|
-
'create',
|
65
|
-
'update'
|
66
|
-
]
|
67
|
-
},
|
68
|
-
/**
|
69
|
-
* @member {Boolean} singleton=true
|
70
|
-
* @protected
|
71
|
-
*/
|
72
|
-
singleton: true
|
73
|
-
}
|
74
|
-
|
75
75
|
/**
|
76
76
|
* Creates a Neo.vdom.VNode tree for the given vdom template.
|
77
77
|
* The top level vnode contains the outerHTML as a string.
|
package/src/worker/App.mjs
CHANGED
@@ -14,24 +14,6 @@ import HashHistory from '../util/HashHistory.mjs';
|
|
14
14
|
* @singleton
|
15
15
|
*/
|
16
16
|
class App extends Base {
|
17
|
-
/**
|
18
|
-
* @member {Object|null} data=null
|
19
|
-
* @protected
|
20
|
-
*/
|
21
|
-
data = null
|
22
|
-
/**
|
23
|
-
* @member {Boolean} isUsingViewModels=false
|
24
|
-
* @protected
|
25
|
-
*/
|
26
|
-
isUsingViewModels = false
|
27
|
-
/**
|
28
|
-
* We are storing the params of insertThemeFiles() calls here, in case the method does get triggered
|
29
|
-
* before the json theme structure got loaded.
|
30
|
-
* @member {Array[]} themeFilesCache=[]
|
31
|
-
* @protected
|
32
|
-
*/
|
33
|
-
themeFilesCache = []
|
34
|
-
|
35
17
|
static config = {
|
36
18
|
/**
|
37
19
|
* @member {String} className='Neo.worker.App'
|
@@ -50,6 +32,24 @@ class App extends Base {
|
|
50
32
|
workerId: 'app'
|
51
33
|
}
|
52
34
|
|
35
|
+
/**
|
36
|
+
* @member {Object|null} data=null
|
37
|
+
* @protected
|
38
|
+
*/
|
39
|
+
data = null
|
40
|
+
/**
|
41
|
+
* @member {Boolean} isUsingViewModels=false
|
42
|
+
* @protected
|
43
|
+
*/
|
44
|
+
isUsingViewModels = false
|
45
|
+
/**
|
46
|
+
* We are storing the params of insertThemeFiles() calls here, in case the method does get triggered
|
47
|
+
* before the json theme structure got loaded.
|
48
|
+
* @member {Array[]} themeFilesCache=[]
|
49
|
+
* @protected
|
50
|
+
*/
|
51
|
+
themeFilesCache = []
|
52
|
+
|
53
53
|
/**
|
54
54
|
* @param {Object} config
|
55
55
|
*/
|
package/src/worker/Base.mjs
CHANGED
@@ -10,6 +10,23 @@ import RemoteMethodAccess from './mixin/RemoteMethodAccess.mjs';
|
|
10
10
|
* @abstract
|
11
11
|
*/
|
12
12
|
class Base extends CoreBase {
|
13
|
+
static config = {
|
14
|
+
/**
|
15
|
+
* @member {String} className='Neo.worker.Base'
|
16
|
+
* @protected
|
17
|
+
*/
|
18
|
+
className: 'Neo.worker.Base',
|
19
|
+
/**
|
20
|
+
* @member {String[]|Neo.core.Base[]|null} mixins=[Observable,RemoteMethodAccess]
|
21
|
+
*/
|
22
|
+
mixins: [Observable, RemoteMethodAccess],
|
23
|
+
/**
|
24
|
+
* @member {String|null} workerId=null
|
25
|
+
* @protected
|
26
|
+
*/
|
27
|
+
workerId: null
|
28
|
+
}
|
29
|
+
|
13
30
|
/**
|
14
31
|
* @member {Object|null} channelPorts=null
|
15
32
|
* @protected
|
@@ -32,23 +49,6 @@ class Base extends CoreBase {
|
|
32
49
|
*/
|
33
50
|
ports = null
|
34
51
|
|
35
|
-
static config = {
|
36
|
-
/**
|
37
|
-
* @member {String} className='Neo.worker.Base'
|
38
|
-
* @protected
|
39
|
-
*/
|
40
|
-
className: 'Neo.worker.Base',
|
41
|
-
/**
|
42
|
-
* @member {String[]|Neo.core.Base[]|null} mixins=[Observable,RemoteMethodAccess]
|
43
|
-
*/
|
44
|
-
mixins: [Observable, RemoteMethodAccess],
|
45
|
-
/**
|
46
|
-
* @member {String|null} workerId=null
|
47
|
-
* @protected
|
48
|
-
*/
|
49
|
-
workerId: null
|
50
|
-
}
|
51
|
-
|
52
52
|
/**
|
53
53
|
* @param {Object} config
|
54
54
|
*/
|
package/src/worker/Data.mjs
CHANGED
@@ -14,17 +14,6 @@ import Xhr from '../Xhr.mjs';
|
|
14
14
|
* @singleton
|
15
15
|
*/
|
16
16
|
class Data extends Base {
|
17
|
-
/**
|
18
|
-
* @member {Boolean} rpcApiManagerLoaded=false
|
19
|
-
* @protected
|
20
|
-
*/
|
21
|
-
rpcApiManagerLoaded = false
|
22
|
-
/**
|
23
|
-
* @member {Boolean} rpcMessageManagerLoaded=false
|
24
|
-
* @protected
|
25
|
-
*/
|
26
|
-
rpcMessageManagerLoaded = false
|
27
|
-
|
28
17
|
static config = {
|
29
18
|
/**
|
30
19
|
* @member {String} className='Neo.worker.Data'
|
@@ -43,6 +32,17 @@ class Data extends Base {
|
|
43
32
|
workerId: 'data'
|
44
33
|
}
|
45
34
|
|
35
|
+
/**
|
36
|
+
* @member {Boolean} rpcApiManagerLoaded=false
|
37
|
+
* @protected
|
38
|
+
*/
|
39
|
+
rpcApiManagerLoaded = false
|
40
|
+
/**
|
41
|
+
* @member {Boolean} rpcMessageManagerLoaded=false
|
42
|
+
* @protected
|
43
|
+
*/
|
44
|
+
rpcMessageManagerLoaded = false
|
45
|
+
|
46
46
|
/**
|
47
47
|
*
|
48
48
|
*/
|
package/src/worker/Manager.mjs
CHANGED
@@ -16,15 +16,6 @@ const NeoConfig = Neo.config,
|
|
16
16
|
* @singleton
|
17
17
|
*/
|
18
18
|
class Manager extends Base {
|
19
|
-
/**
|
20
|
-
* navigator.serviceWorker.controller can be null in case we load a page for the first time
|
21
|
-
* or in case of a force refresh.
|
22
|
-
* See: https://www.w3.org/TR/service-workers/#navigator-service-worker-controller
|
23
|
-
* Only in this case main.addon.ServiceWorker will store the active registration once ready here.
|
24
|
-
* @member {ServiceWorker|null} serviceWorker=null
|
25
|
-
*/
|
26
|
-
serviceWorker = null
|
27
|
-
|
28
19
|
static config = {
|
29
20
|
/**
|
30
21
|
* @member {String} className='Neo.worker.Manager'
|
@@ -101,6 +92,15 @@ class Manager extends Base {
|
|
101
92
|
}
|
102
93
|
}
|
103
94
|
|
95
|
+
/**
|
96
|
+
* navigator.serviceWorker.controller can be null in case we load a page for the first time
|
97
|
+
* or in case of a force refresh.
|
98
|
+
* See: https://www.w3.org/TR/service-workers/#navigator-service-worker-controller
|
99
|
+
* Only in this case main.addon.ServiceWorker will store the active registration once ready here.
|
100
|
+
* @member {ServiceWorker|null} serviceWorker=null
|
101
|
+
*/
|
102
|
+
serviceWorker = null
|
103
|
+
|
104
104
|
/**
|
105
105
|
* @param {Object} config
|
106
106
|
*/
|
@@ -8,6 +8,31 @@ import RemoteMethodAccess from './mixin/RemoteMethodAccess.mjs';
|
|
8
8
|
* @abstract
|
9
9
|
*/
|
10
10
|
class ServiceBase extends Base {
|
11
|
+
static config = {
|
12
|
+
/**
|
13
|
+
* @member {String} className='Neo.worker.ServiceBase'
|
14
|
+
* @protected
|
15
|
+
*/
|
16
|
+
className: 'Neo.worker.ServiceBase',
|
17
|
+
/**
|
18
|
+
* @member {String[]|Neo.core.Base[]|null} mixins=[RemoteMethodAccess]
|
19
|
+
*/
|
20
|
+
mixins: [RemoteMethodAccess],
|
21
|
+
/**
|
22
|
+
* Remote method access for other workers
|
23
|
+
* @member {Object} remote={app: [//...]}
|
24
|
+
* @protected
|
25
|
+
*/
|
26
|
+
remote: {
|
27
|
+
app: [
|
28
|
+
'clearCache',
|
29
|
+
'clearCaches',
|
30
|
+
'preloadAssets',
|
31
|
+
'removeAssets'
|
32
|
+
]
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
11
36
|
/**
|
12
37
|
* @member {String} cacheName='neo-runtime'
|
13
38
|
*/
|
@@ -47,31 +72,6 @@ class ServiceBase extends Base {
|
|
47
72
|
*/
|
48
73
|
workerId = null
|
49
74
|
|
50
|
-
static config = {
|
51
|
-
/**
|
52
|
-
* @member {String} className='Neo.worker.ServiceBase'
|
53
|
-
* @protected
|
54
|
-
*/
|
55
|
-
className: 'Neo.worker.ServiceBase',
|
56
|
-
/**
|
57
|
-
* @member {String[]|Neo.core.Base[]|null} mixins=[RemoteMethodAccess]
|
58
|
-
*/
|
59
|
-
mixins: [RemoteMethodAccess],
|
60
|
-
/**
|
61
|
-
* Remote method access for other workers
|
62
|
-
* @member {Object} remote={app: [//...]}
|
63
|
-
* @protected
|
64
|
-
*/
|
65
|
-
remote: {
|
66
|
-
app: [
|
67
|
-
'clearCache',
|
68
|
-
'clearCaches',
|
69
|
-
'preloadAssets',
|
70
|
-
'removeAssets'
|
71
|
-
]
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
75
|
/**
|
76
76
|
* @param {Object} config
|
77
77
|
*/
|