neo.mjs 6.7.6 → 6.7.8

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 (39) hide show
  1. package/apps/ServiceWorker.mjs +2 -2
  2. package/apps/covid/neo-config.json +1 -1
  3. package/apps/form/neo-config.json +1 -1
  4. package/apps/{sharedcovidchart → sharedcovid/childapps/sharedcovidchart}/MainContainer.mjs +1 -1
  5. package/apps/{sharedcovidchart → sharedcovid/childapps/sharedcovidchart}/index.html +1 -1
  6. package/apps/{sharedcovidchart → sharedcovid/childapps/sharedcovidchart}/neo-config.json +2 -2
  7. package/apps/{sharedcovidgallery → sharedcovid/childapps/sharedcovidgallery}/MainContainer.mjs +1 -1
  8. package/apps/{sharedcovidgallery → sharedcovid/childapps/sharedcovidgallery}/index.html +1 -1
  9. package/apps/{sharedcovidgallery → sharedcovid/childapps/sharedcovidgallery}/neo-config.json +2 -2
  10. package/apps/{sharedcovidhelix → sharedcovid/childapps/sharedcovidhelix}/MainContainer.mjs +1 -1
  11. package/apps/{sharedcovidhelix → sharedcovid/childapps/sharedcovidhelix}/index.html +1 -1
  12. package/apps/{sharedcovidhelix → sharedcovid/childapps/sharedcovidhelix}/neo-config.json +2 -2
  13. package/apps/{sharedcovidmap → sharedcovid/childapps/sharedcovidmap}/MainContainer.mjs +1 -1
  14. package/apps/{sharedcovidmap → sharedcovid/childapps/sharedcovidmap}/index.html +1 -1
  15. package/apps/{sharedcovidmap → sharedcovid/childapps/sharedcovidmap}/neo-config.json +2 -2
  16. package/apps/sharedcovid/view/MainContainerController.mjs +1 -1
  17. package/apps/{shareddialog2 → shareddialog/childapps/shareddialog2}/index.html +1 -1
  18. package/apps/{shareddialog2 → shareddialog/childapps/shareddialog2}/neo-config.json +2 -2
  19. package/apps/{shareddialog2 → shareddialog/childapps/shareddialog2}/view/MainContainer.mjs +3 -3
  20. package/apps/{shareddialog2 → shareddialog/childapps/shareddialog2}/view/MainContainerController.mjs +2 -6
  21. package/apps/shareddialog/view/MainContainerController.mjs +2 -2
  22. package/examples/ServiceWorker.mjs +2 -2
  23. package/examples/component/timer/neo-config.json +1 -1
  24. package/examples/component/toast/neo-config.json +1 -1
  25. package/examples/component/video/neo-config.json +1 -1
  26. package/examples/container/dialog/neo-config.json +1 -1
  27. package/examples/popover/neo-config.json +0 -1
  28. package/package.json +1 -1
  29. package/src/DefaultConfig.mjs +4 -4
  30. package/src/form/field/Date.mjs +2 -0
  31. package/src/form/field/FileUpload.mjs +8 -7
  32. package/src/form/field/Picker.mjs +0 -12
  33. package/src/form/field/Text.mjs +1 -0
  34. package/src/main/addon/ScrollSync.mjs +0 -146
  35. /package/apps/{sharedcovidchart → sharedcovid/childapps/sharedcovidchart}/app.mjs +0 -0
  36. /package/apps/{sharedcovidgallery → sharedcovid/childapps/sharedcovidgallery}/app.mjs +0 -0
  37. /package/apps/{sharedcovidhelix → sharedcovid/childapps/sharedcovidhelix}/app.mjs +0 -0
  38. /package/apps/{sharedcovidmap → sharedcovid/childapps/sharedcovidmap}/app.mjs +0 -0
  39. /package/apps/{shareddialog2 → shareddialog/childapps/shareddialog2}/app.mjs +0 -0
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.7.6'
23
+ * @member {String} version='6.7.8'
24
24
  */
25
- version: '6.7.6'
25
+ version: '6.7.8'
26
26
  }
27
27
 
28
28
  /**
@@ -3,6 +3,6 @@
3
3
  "basePath" : "../../",
4
4
  "environment" : "development",
5
5
  "mainPath" : "./Main.mjs",
6
- "mainThreadAddons": ["AmCharts", "DragDrop", "MapboxGL", "ScrollSync", "Stylesheet"],
6
+ "mainThreadAddons": ["AmCharts", "DragDrop", "MapboxGL", "Stylesheet"],
7
7
  "themes" : ["neo-theme-dark", "neo-theme-light"]
8
8
  }
@@ -3,5 +3,5 @@
3
3
  "basePath" : "../../",
4
4
  "environment" : "development",
5
5
  "mainPath" : "./Main.mjs",
6
- "mainThreadAddons": ["DragDrop", "LocalStorage", "ScrollSync", "Stylesheet"]
6
+ "mainThreadAddons": ["DragDrop", "LocalStorage", "Stylesheet"]
7
7
  }
@@ -1,4 +1,4 @@
1
- import Viewport from '../../src/container/Viewport.mjs';
1
+ import Viewport from '../../../../src/container/Viewport.mjs';
2
2
 
3
3
  /**
4
4
  * @class SharedCovidChart.MainContainer
@@ -6,6 +6,6 @@
6
6
  <title>SharedCovid Country Chart / Table</title>
7
7
  </head>
8
8
  <body>
9
- <script src="../../src/MicroLoader.mjs" type="module"></script>
9
+ <script src="../../../../src/MicroLoader.mjs" type="module"></script>
10
10
  </body>
11
11
  </html>
@@ -1,6 +1,6 @@
1
1
  {
2
- "appPath" : "apps/sharedcovidchart/app.mjs",
3
- "basePath" : "../../",
2
+ "appPath" : "apps/sharedcovid/childapps/sharedcovidchart/app.mjs",
3
+ "basePath" : "../../../../",
4
4
  "environment" : "development",
5
5
  "mainPath" : "./Main.mjs",
6
6
  "mainThreadAddons": ["AmCharts", "Stylesheet"],
@@ -1,4 +1,4 @@
1
- import Viewport from '../../src/container/Viewport.mjs';
1
+ import Viewport from '../../../../src/container/Viewport.mjs';
2
2
 
3
3
  /**
4
4
  * @class SharedCovidGallery.MainContainer
@@ -6,6 +6,6 @@
6
6
  <title>SharedCovid CountryGallery</title>
7
7
  </head>
8
8
  <body>
9
- <script src="../../src/MicroLoader.mjs" type="module"></script>
9
+ <script src="../../../../src/MicroLoader.mjs" type="module"></script>
10
10
  </body>
11
11
  </html>
@@ -1,6 +1,6 @@
1
1
  {
2
- "appPath" : "apps/sharedcovidgallery/app.mjs",
3
- "basePath" : "../../",
2
+ "appPath" : "apps/sharedcovid/childapps/sharedcovidgallery/app.mjs",
3
+ "basePath" : "../../../../",
4
4
  "environment" : "development",
5
5
  "mainPath" : "./Main.mjs",
6
6
  "mainThreadAddons": ["Stylesheet"],
@@ -1,4 +1,4 @@
1
- import Viewport from '../../src/container/Viewport.mjs';
1
+ import Viewport from '../../../../src/container/Viewport.mjs';
2
2
 
3
3
  /**
4
4
  * @class SharedCovidHelix.MainContainer
@@ -6,6 +6,6 @@
6
6
  <title>SharedCovid CountryHelix</title>
7
7
  </head>
8
8
  <body>
9
- <script src="../../src/MicroLoader.mjs" type="module"></script>
9
+ <script src="../../../../src/MicroLoader.mjs" type="module"></script>
10
10
  </body>
11
11
  </html>
@@ -1,6 +1,6 @@
1
1
  {
2
- "appPath" : "apps/sharedcovidhelix/app.mjs",
3
- "basePath" : "../../",
2
+ "appPath" : "apps/sharedcovid/childapps/sharedcovidhelix/app.mjs",
3
+ "basePath" : "../../../../",
4
4
  "environment" : "development",
5
5
  "mainPath" : "./Main.mjs",
6
6
  "mainThreadAddons": ["Stylesheet"],
@@ -1,4 +1,4 @@
1
- import Viewport from '../../src/container/Viewport.mjs';
1
+ import Viewport from '../../../../src/container/Viewport.mjs';
2
2
 
3
3
  /**
4
4
  * @class CovidMap.MainContainer
@@ -6,6 +6,6 @@
6
6
  <title>SharedCovid MapboxGL Map</title>
7
7
  </head>
8
8
  <body>
9
- <script src="../../src/MicroLoader.mjs" type="module"></script>
9
+ <script src="../../../../src/MicroLoader.mjs" type="module"></script>
10
10
  </body>
11
11
  </html>
@@ -1,6 +1,6 @@
1
1
  {
2
- "appPath" : "apps/sharedcovidmap/app.mjs",
3
- "basePath" : "../../",
2
+ "appPath" : "apps/sharedcovid/childapps/sharedcovidmap/app.mjs",
3
+ "basePath" : "../../../../",
4
4
  "environment" : "development",
5
5
  "mainPath" : "./Main.mjs",
6
6
  "mainThreadAddons": ["MapboxGL", "Stylesheet"],
@@ -173,7 +173,7 @@ class MainContainerController extends ComponentController {
173
173
  top += (winData.outerHeight - winData.innerHeight + winData.screenTop);
174
174
 
175
175
  Neo.Main.windowOpen({
176
- url : `../${url}/index.html`,
176
+ url : `../sharedcovid/childapps/${url}/index.html`,
177
177
  windowFeatures: `height=${height},left=${left},top=${top},width=${width}`,
178
178
  windowName
179
179
  });
@@ -6,6 +6,6 @@
6
6
  <title>SharedDialog2</title>
7
7
  </head>
8
8
  <body>
9
- <script src="../../src/MicroLoader.mjs" type="module"></script>
9
+ <script src="../../../../src/MicroLoader.mjs" type="module"></script>
10
10
  </body>
11
11
  </html>
@@ -1,6 +1,6 @@
1
1
  {
2
- "appPath" : "apps/shareddialog2/app.mjs",
3
- "basePath" : "../../",
2
+ "appPath" : "apps/shareddialog/childapps/shareddialog2/app.mjs",
3
+ "basePath" : "../../../../",
4
4
  "environment" : "development",
5
5
  "mainPath" : "./Main.mjs",
6
6
  "mainThreadAddons": ["DragDrop", "Stylesheet"],
@@ -1,7 +1,7 @@
1
- import Button from '../../../src/button/Base.mjs';
1
+ import Button from '../../../../../src/button/Base.mjs';
2
2
  import MainContainerController from './MainContainerController.mjs';
3
- import Toolbar from '../../../src/toolbar/Base.mjs';
4
- import Viewport from '../../../src/container/Viewport.mjs';
3
+ import Toolbar from '../../../../../src/toolbar/Base.mjs';
4
+ import Viewport from '../../../../../src/container/Viewport.mjs';
5
5
 
6
6
  /**
7
7
  * @class SharedDialog2.view.MainContainer
@@ -1,4 +1,4 @@
1
- import ComponentController from '../../../src/controller/Component.mjs';
1
+ import ComponentController from '../../../../../src/controller/Component.mjs';
2
2
 
3
3
  /**
4
4
  * @class SharedDialog2.view.MainContainerController
@@ -17,11 +17,7 @@ class MainContainerController extends ComponentController {
17
17
  * @param {Object} data
18
18
  */
19
19
  onCreateDialogButtonClick(data) {
20
- let app = Neo.apps['SharedDialog'];
21
-
22
- if (app) {
23
- app.mainView.controller.createDialog(data, this.component.appName);
24
- }
20
+ Neo.apps['SharedDialog']?.mainView.controller.createDialog(data, this.component.appName);
25
21
  }
26
22
  }
27
23
 
@@ -493,7 +493,7 @@ class MainContainerController extends ComponentController {
493
493
  dragMove : me.onDragMove,
494
494
  dragStart: me.onDragStart,
495
495
  scope : me
496
- });
496
+ })
497
497
  }
498
498
 
499
499
  /**
@@ -535,7 +535,7 @@ class MainContainerController extends ComponentController {
535
535
  }
536
536
 
537
537
  Neo.Main.windowOpen({
538
- url : '../shareddialog2/index.html',
538
+ url : 'childapps/shareddialog2/index.html',
539
539
  windowFeatures: `height=${height},left=${left},top=${top},width=${width}`,
540
540
  windowName : me.dockedWindowAppName
541
541
  });
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.7.6'
23
+ * @member {String} version='6.7.8'
24
24
  */
25
- version: '6.7.6'
25
+ version: '6.7.8'
26
26
  }
27
27
 
28
28
  /**
@@ -3,5 +3,5 @@
3
3
  "basePath" : "../../../",
4
4
  "environment" : "development",
5
5
  "mainPath" : "./Main.mjs",
6
- "mainThreadAddons": ["Stylesheet", "ScrollSync"]
6
+ "mainThreadAddons": ["Stylesheet"]
7
7
  }
@@ -3,5 +3,5 @@
3
3
  "basePath" : "../../../",
4
4
  "environment" : "development",
5
5
  "mainPath" : "./Main.mjs",
6
- "mainThreadAddons": ["HighlightJS", "Stylesheet", "ScrollSync"]
6
+ "mainThreadAddons": ["HighlightJS", "Stylesheet"]
7
7
  }
@@ -3,5 +3,5 @@
3
3
  "basePath" : "../../../",
4
4
  "environment" : "development",
5
5
  "mainPath" : "./Main.mjs",
6
- "mainThreadAddons": ["Stylesheet", "ScrollSync"]
6
+ "mainThreadAddons": ["Stylesheet"]
7
7
  }
@@ -3,5 +3,5 @@
3
3
  "basePath" : "../../../",
4
4
  "environment": "development",
5
5
  "mainPath" : "./Main.mjs",
6
- "mainThreadAddons": ["DragDrop", "ScrollSync", "Stylesheet", "Dialog"]
6
+ "mainThreadAddons": ["DragDrop", "Stylesheet", "Dialog"]
7
7
  }
@@ -6,7 +6,6 @@
6
6
  "themes" : ["neo-theme-dark", "neo-theme-light"],
7
7
  "mainThreadAddons": [
8
8
  "DragDrop",
9
- "ScrollSync",
10
9
  "Stylesheet",
11
10
  "Popover"
12
11
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "6.7.6",
3
+ "version": "6.7.8",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -126,12 +126,12 @@ const DefaultConfig = {
126
126
  * You can also create your own addons within your workspace scope. Make sure to put them inside 'src/main/addon/'
127
127
  * and prefix them with 'WS/' inside your neo-config.json file.
128
128
  * Example: ['DragDrop', 'Stylesheet', 'WS/MyAddon']
129
- * @default ['DragDrop','ScrollSync','Stylesheet']
129
+ * @default ['DragDrop', 'Stylesheet']
130
130
  * @memberOf! module:Neo
131
131
  * @name config.mainThreadAddons
132
132
  * @type String[]
133
133
  */
134
- mainThreadAddons: ['DragDrop', 'ScrollSync', 'Stylesheet'],
134
+ mainThreadAddons: ['DragDrop', 'Stylesheet'],
135
135
  /**
136
136
  * Pass the URL of a JSON-file, which contains the services and methods from your backend,
137
137
  * which you want to expose to the client.
@@ -236,12 +236,12 @@ const DefaultConfig = {
236
236
  useVdomWorker: true,
237
237
  /**
238
238
  * buildScripts/injectPackageVersion.mjs will update this value
239
- * @default '6.7.6'
239
+ * @default '6.7.8'
240
240
  * @memberOf! module:Neo
241
241
  * @name config.version
242
242
  * @type String
243
243
  */
244
- version: '6.7.6'
244
+ version: '6.7.8'
245
245
  };
246
246
 
247
247
  Object.assign(DefaultConfig, {
@@ -203,6 +203,8 @@ class DateField extends Picker {
203
203
  let me = this,
204
204
  vdom = me.vdom;
205
205
 
206
+ me.clean = false;
207
+
206
208
  if (me.hidePickerOnSelect) {
207
209
  VDomUtil.removeVdomChild(vdom, me.getPickerId());
208
210
 
@@ -138,7 +138,8 @@ class FileUpload extends Base {
138
138
  UN_DOWNLOADABLE : 'not-downloadable',
139
139
  AVAILABLE : 'not-downloadable',
140
140
  DOWNLOADABLE : 'downloadable',
141
- DELETED : 'deleted'
141
+ DELETED : 'deleted',
142
+ ERROR : 'error'
142
143
  },
143
144
 
144
145
  /**
@@ -533,12 +534,8 @@ class FileUpload extends Base {
533
534
  }
534
535
  }
535
536
  }
536
- // Failed network request
537
- else {
538
- me.error = xhr.response ? JSON.parse(xhr.response).message : `HTTP status : ${xhr.statusText}`;
539
- me.progress = NaN;
540
- me.state = 'upload-failed';
541
- }
537
+ // Failed network requests are handled in onUploadError
538
+ // so no else condition necessary here
542
539
  }
543
540
 
544
541
  onActionButtonClick() {
@@ -642,6 +639,10 @@ class FileUpload extends Base {
642
639
  me.error = `${me.documentText} ${me.documentId} ${isNoLongerAvailable}`;
643
640
  me.state = 'ready';
644
641
  break;
642
+ case 'error':
643
+ me.error = `${me.documentStatusError}: ${statusResponse.statusText || `Server error ${statusResponse.status}`}`;
644
+ me.state = 'deleted';
645
+ break;
645
646
  default:
646
647
  me.state = status;
647
648
  }
@@ -257,12 +257,6 @@ class Picker extends Text {
257
257
  picker.unmount();
258
258
 
259
259
  me.pickerIsMounted = false;
260
-
261
- Neo.main.addon.ScrollSync.unregister({
262
- appName : me.appName,
263
- sourceId: me.id,
264
- targetId: picker.id
265
- })
266
260
  }
267
261
  }
268
262
 
@@ -354,12 +348,6 @@ class Picker extends Text {
354
348
  });
355
349
 
356
350
  picker.render(true);
357
-
358
- Neo.main.addon.ScrollSync.register({
359
- appName : me.appName,
360
- sourceId: me.id,
361
- targetId: picker.id
362
- })
363
351
  }
364
352
  }
365
353
 
@@ -1261,6 +1261,7 @@ class Text extends Base {
1261
1261
  vnode.vnode.attributes.value = value;
1262
1262
  }
1263
1263
 
1264
+ me.clean = false;
1264
1265
  me.value = me.inputValueAdjustor(value);
1265
1266
 
1266
1267
  me.fireUserChangeEvent(value, oldValue)
@@ -1,146 +0,0 @@
1
- import Base from '../../core/Base.mjs';
2
- import DomEvents from '../DomEvents.mjs'
3
-
4
- /**
5
- * This addon keeps the position of overlays in sync with an anchor element,
6
- * when scrolling inside any parent node.
7
- * A prominent use case is Neo.form.field.Picker.
8
- * @class Neo.main.addon.ScrollSync
9
- * @extends Neo.core.Base
10
- * @singleton
11
- */
12
- class ScrollSync extends Base {
13
- static config = {
14
- /**
15
- * @member {String} className='Neo.main.addon.ScrollSync'
16
- * @protected
17
- */
18
- className: 'Neo.main.addon.ScrollSync',
19
- /**
20
- * Remote method access for other workers
21
- * @member {Object} remote={app: [//...]}
22
- * @protected
23
- */
24
- remote: {
25
- app: [
26
- 'register',
27
- 'unregister'
28
- ]
29
- },
30
- /**
31
- * @member {Boolean} singleton=true
32
- * @protected
33
- */
34
- singleton: true
35
- }
36
-
37
- /**
38
- * @member {Object} sourceMap={}
39
- * @protected
40
- */
41
- sourceMap = {}
42
-
43
- /**
44
- * @param {Object} config
45
- */
46
- construct(config) {
47
- super.construct(config);
48
-
49
- document.addEventListener('scroll', this.onDocumentScroll.bind(this), true)
50
- }
51
-
52
- /**
53
- * @param {Event} event
54
- */
55
- onDocumentScroll(event) {
56
- let me = this,
57
- scrollNode = event.target,
58
- sourceRect, targetNode;
59
-
60
- me.sourceMap[scrollNode.id]?.forEach(item => {
61
- sourceRect = document.getElementById(item.sourceId).getBoundingClientRect();
62
- targetNode = document.getElementById(item.targetId)
63
-
64
- targetNode.style.left = `${sourceRect.x + item.deltaX}px`;
65
- targetNode.style.top = `${sourceRect.y + item.deltaY}px`
66
- })
67
- }
68
-
69
- /**
70
- * @param {Object} data
71
- * @param {String} data.sourceId
72
- * @param {String} data.targetId
73
- * @returns Promise<Boolean>
74
- */
75
- async register(data) {
76
- // short delay to ensure the target node got mounted
77
- await this.timeout(50)
78
-
79
- let sourceId = data.sourceId,
80
- sourceMap = this.sourceMap,
81
- sourceNode = document.getElementById(sourceId),
82
- sourceRect = sourceNode.getBoundingClientRect(),
83
- parentNode = sourceNode.parentNode,
84
- targetId = data.targetId,
85
- targetRect = document.getElementById(targetId).getBoundingClientRect(),
86
- deltaX = targetRect.x - sourceRect.x,
87
- deltaY = targetRect.y - sourceRect.y,
88
- overflowX, overflowY, parentId;
89
-
90
- while (parentNode && parentNode.id) {
91
- parentId = parentNode.id;
92
-
93
- ({overflowX, overflowY} = getComputedStyle(parentNode))
94
-
95
- if (overflowX === 'auto' || overflowX === 'scroll' || overflowY === 'auto' || overflowY === 'scroll') {
96
- if (!sourceMap[parentId]) {
97
- sourceMap[parentId] = []
98
- }
99
-
100
- sourceMap[parentId].push({deltaX, deltaY, sourceId, targetId})
101
- }
102
-
103
- parentNode = parentNode.parentNode
104
- }
105
-
106
- return true
107
- }
108
-
109
- /**
110
- * @param {Object} data
111
- * @param {String} data.sourceId
112
- * @param {String} data.targetId
113
- * @returns {Boolean}
114
- */
115
- unregister(data) {
116
- let sourceId = data.sourceId,
117
- sourceMap = this.sourceMap,
118
- sourceNode = document.getElementById(sourceId),
119
- parentNode = sourceNode.parentNode,
120
- parentId;
121
-
122
- while (parentNode && parentNode.id) {
123
- parentId = parentNode.id;
124
-
125
- if (sourceMap[parentId]) {
126
- [...sourceMap[parentId]].forEach((item, index) => {
127
- if (item.sourceId === sourceId && item.targetId === data.targetId) {
128
- sourceMap[parentId].splice(index, 1)
129
- }
130
- })
131
-
132
- if (sourceMap[parentId].length < 1) {
133
- delete sourceMap[parentId]
134
- }
135
- }
136
-
137
- parentNode = parentNode.parentNode
138
- }
139
-
140
- return true
141
- }
142
- }
143
-
144
- let instance = Neo.applyClassConfig(ScrollSync);
145
-
146
- export default instance;