neo.mjs 8.0.0-beta.2 → 8.0.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/apps/covid/view/MainContainerController.mjs +7 -4
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/apps/sharedcovid/view/MainContainerController.mjs +7 -4
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/calendar/weekview/MainContainer.mjs +6 -6
- package/package.json +5 -5
- package/src/DefaultConfig.mjs +2 -2
- package/src/Neo.mjs +2 -2
- package/src/code/LivePreview.mjs +2 -2
- package/src/core/Base.mjs +1 -1
- package/src/tooltip/Base.mjs +17 -17
- package/src/vdom/Helper.mjs +1 -3
package/apps/ServiceWorker.mjs
CHANGED
@@ -123,10 +123,13 @@ class MainContainerController extends ComponentController {
|
|
123
123
|
|
124
124
|
me.summaryData = data;
|
125
125
|
|
126
|
-
container.items[0].vdom.cn[1].html = Util.formatNumber({value: data.cases});
|
127
|
-
container.items[1].vdom.cn[1].html = Util.formatNumber({value: data.active});
|
128
|
-
container.items[2].vdom.cn[1].html = Util.formatNumber({value: data.recovered});
|
129
|
-
container.items[3].vdom.cn[1].html = Util.formatNumber({value: data.deaths});
|
126
|
+
container.items[0].vdom.cn[1].html = Util.formatNumber({value: data.cases});
|
127
|
+
container.items[1].vdom.cn[1].html = Util.formatNumber({value: data.active});
|
128
|
+
container.items[2].vdom.cn[1].html = Util.formatNumber({value: data.recovered});
|
129
|
+
container.items[3].vdom.cn[1].html = Util.formatNumber({value: data.deaths});
|
130
|
+
|
131
|
+
container.updateDepth = 2;
|
132
|
+
container.update();
|
130
133
|
|
131
134
|
container = me.getReference('last-update');
|
132
135
|
vdom = container.vdom;
|
package/apps/portal/index.html
CHANGED
@@ -131,10 +131,13 @@ class MainContainerController extends ComponentController {
|
|
131
131
|
|
132
132
|
me.summaryData = data;
|
133
133
|
|
134
|
-
container.items[0].vdom.cn[1].html = Util.formatNumber({value: data.cases});
|
135
|
-
container.items[1].vdom.cn[1].html = Util.formatNumber({value: data.active});
|
136
|
-
container.items[2].vdom.cn[1].html = Util.formatNumber({value: data.recovered});
|
137
|
-
container.items[3].vdom.cn[1].html = Util.formatNumber({value: data.deaths});
|
134
|
+
container.items[0].vdom.cn[1].html = Util.formatNumber({value: data.cases});
|
135
|
+
container.items[1].vdom.cn[1].html = Util.formatNumber({value: data.active});
|
136
|
+
container.items[2].vdom.cn[1].html = Util.formatNumber({value: data.recovered});
|
137
|
+
container.items[3].vdom.cn[1].html = Util.formatNumber({value: data.deaths});
|
138
|
+
|
139
|
+
container.updateDepth = 2;
|
140
|
+
container.update();
|
138
141
|
|
139
142
|
container = me.getReference('last-update');
|
140
143
|
vdom = container.vdom;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import
|
2
|
-
import Viewport
|
3
|
-
import WeekComponent
|
1
|
+
import MainContainerStateProvider from '../../../src/calendar/view/MainContainerStateProvider.mjs';
|
2
|
+
import Viewport from '../../../src/container/Viewport.mjs';
|
3
|
+
import WeekComponent from '../../../src/calendar/view/week/Component.mjs';
|
4
4
|
|
5
5
|
/**
|
6
6
|
* @class Neo.examples.calendar.weekview.MainContainer
|
@@ -24,10 +24,10 @@ class MainContainer extends Viewport {
|
|
24
24
|
* configs. We have two options here:
|
25
25
|
* 1. Extend Neo.calendar.view.week.Component and add the configs and view model there.
|
26
26
|
* 2. Just drop them into a parent view.
|
27
|
-
* @member {Neo.calendar.view.
|
27
|
+
* @member {Neo.calendar.view.MainContainerStateProvider} stateProvider=MainContainerStateProvider
|
28
28
|
*/
|
29
|
-
|
30
|
-
module:
|
29
|
+
stateProvider: {
|
30
|
+
module: MainContainerStateProvider,
|
31
31
|
data : {
|
32
32
|
currentDate: new Date('2024-07-21')
|
33
33
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "8.0.0
|
3
|
+
"version": "8.0.0",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -54,18 +54,18 @@
|
|
54
54
|
"envinfo": "^7.14.0",
|
55
55
|
"fs-extra": "^11.2.0",
|
56
56
|
"highlightjs-line-numbers.js": "^2.9.0",
|
57
|
-
"inquirer": "^12.
|
57
|
+
"inquirer": "^12.2.0",
|
58
58
|
"marked": "^15.0.3",
|
59
59
|
"monaco-editor": "0.50.0",
|
60
60
|
"neo-jsdoc": "1.0.1",
|
61
61
|
"neo-jsdoc-x": "1.0.5",
|
62
62
|
"postcss": "^8.4.49",
|
63
|
-
"sass": "^1.
|
63
|
+
"sass": "^1.83.0",
|
64
64
|
"siesta-lite": "5.5.2",
|
65
65
|
"url": "^0.11.4",
|
66
|
-
"webpack": "^5.
|
66
|
+
"webpack": "^5.97.1",
|
67
67
|
"webpack-cli": "^5.1.4",
|
68
|
-
"webpack-dev-server": "^5.
|
68
|
+
"webpack-dev-server": "^5.2.0",
|
69
69
|
"webpack-hook-plugin": "^1.0.7",
|
70
70
|
"webpack-node-externals": "^3.0.0"
|
71
71
|
},
|
package/src/DefaultConfig.mjs
CHANGED
@@ -262,12 +262,12 @@ const DefaultConfig = {
|
|
262
262
|
useVdomWorker: true,
|
263
263
|
/**
|
264
264
|
* buildScripts/injectPackageVersion.mjs will update this value
|
265
|
-
* @default '8.0.0
|
265
|
+
* @default '8.0.0'
|
266
266
|
* @memberOf! module:Neo
|
267
267
|
* @name config.version
|
268
268
|
* @type String
|
269
269
|
*/
|
270
|
-
version: '8.0.0
|
270
|
+
version: '8.0.0'
|
271
271
|
};
|
272
272
|
|
273
273
|
Object.assign(DefaultConfig, {
|
package/src/Neo.mjs
CHANGED
@@ -5,12 +5,12 @@ const
|
|
5
5
|
configSymbol = Symbol.for('configSymbol'),
|
6
6
|
getSetCache = Symbol('getSetCache'),
|
7
7
|
typeDetector = {
|
8
|
-
function:
|
8
|
+
function: item => {
|
9
9
|
if (item.prototype?.constructor.isClass) {
|
10
10
|
return 'NeoClass'
|
11
11
|
}
|
12
12
|
},
|
13
|
-
object:
|
13
|
+
object: item => {
|
14
14
|
if (item.constructor.isClass && item instanceof Neo.core.Base) {
|
15
15
|
return 'NeoInstance'
|
16
16
|
}
|
package/src/code/LivePreview.mjs
CHANGED
@@ -244,9 +244,9 @@ class LivePreview extends Container {
|
|
244
244
|
index = path.lastIndexOf('../');
|
245
245
|
|
246
246
|
if (index === 0) {
|
247
|
-
path = '../../../../src/' + path.slice(index+3);
|
247
|
+
path = '../../../../src/' + path.slice(index + 3);
|
248
248
|
} else {
|
249
|
-
path = path.slice(0, index) + '../../../' + path.slice(index+3);
|
249
|
+
path = path.slice(0, index) + '../../../' + path.slice(index + 3);
|
250
250
|
}
|
251
251
|
}
|
252
252
|
|
package/src/core/Base.mjs
CHANGED
@@ -605,7 +605,7 @@ class Base {
|
|
605
605
|
timeout(time) {
|
606
606
|
return new Promise(resolve => {
|
607
607
|
let timeoutIds = this.#timeoutIds,
|
608
|
-
timeoutId = setTimeout(() => {timeoutIds.splice(timeoutIds.indexOf(timeoutId, 1)
|
608
|
+
timeoutId = setTimeout(() => {timeoutIds.splice(timeoutIds.indexOf(timeoutId), 1); resolve()}, time);
|
609
609
|
|
610
610
|
timeoutIds.push(timeoutId)
|
611
611
|
})
|
package/src/tooltip/Base.mjs
CHANGED
@@ -200,21 +200,22 @@ class Base extends Container {
|
|
200
200
|
windowId : app.mainView.windowId,
|
201
201
|
listeners : {
|
202
202
|
// Reconfigure on over a target
|
203
|
-
|
204
|
-
|
203
|
+
targetOver({ target, data }) {
|
204
|
+
let me = this,
|
205
|
+
config, key;
|
205
206
|
|
206
207
|
// Revert last pointerOver config set to initial setting.
|
207
|
-
me.
|
208
|
+
me.setSilent(me.resetCfg);
|
208
209
|
me.resetCfg = {};
|
209
210
|
|
210
211
|
// Use the tooltip config block that the target was configured with
|
211
212
|
// to reconfigure this instance, or if there was none, check the
|
212
213
|
// data-neo-tooltip property for a text string.
|
213
|
-
|
214
|
+
config = target?._tooltip || {text: data.target.data.neoTooltip};
|
214
215
|
|
215
216
|
// Cache things we have to reset
|
216
|
-
for (
|
217
|
-
me.resetCfg[key] = me[key]
|
217
|
+
for (key in config) {
|
218
|
+
me.resetCfg[key] = me[key]
|
218
219
|
}
|
219
220
|
|
220
221
|
// Set ourself up as the target wants
|
@@ -227,6 +228,15 @@ class Base extends Container {
|
|
227
228
|
return singletons[app.name]
|
228
229
|
}
|
229
230
|
|
231
|
+
// Used as a delegate filter to activate on targets which have a tooltip configuration
|
232
|
+
static delegateFilter(path) {
|
233
|
+
for (let i = 0, { length } = path; i < length; i++) {
|
234
|
+
if (path[i].cls.includes('neo-uses-shared-tooltip') || path[i].data['neoTooltip']) {
|
235
|
+
return i
|
236
|
+
}
|
237
|
+
}
|
238
|
+
}
|
239
|
+
|
230
240
|
/**
|
231
241
|
* Instantly hides the tooltip
|
232
242
|
*/
|
@@ -277,22 +287,12 @@ class Base extends Container {
|
|
277
287
|
if (me.mounted) {
|
278
288
|
me.show();
|
279
289
|
me.alignTo()
|
280
|
-
}
|
281
|
-
else {
|
290
|
+
} else {
|
282
291
|
me.showDelayed(data)
|
283
292
|
}
|
284
293
|
}
|
285
294
|
}
|
286
295
|
|
287
|
-
// Used as a delegate filter to activate on targets which have a tooltip configuration
|
288
|
-
static delegateFilter(path) {
|
289
|
-
for (let i = 0, { length } = path; i < length; i++) {
|
290
|
-
if (path[i].cls.includes('neo-uses-shared-tooltip') || path[i].data['neoTooltip']) {
|
291
|
-
return i
|
292
|
-
}
|
293
|
-
}
|
294
|
-
}
|
295
|
-
|
296
296
|
/**
|
297
297
|
* @param {Object} data
|
298
298
|
*/
|
package/src/vdom/Helper.mjs
CHANGED
@@ -276,8 +276,6 @@ class Helper extends Base {
|
|
276
276
|
childNode = childNodes[i];
|
277
277
|
oldChildNode = oldChildNodes[i + indexDelta];
|
278
278
|
|
279
|
-
// console.log(childNode?.id, oldChildNode?.id);
|
280
|
-
|
281
279
|
if (!childNode && !oldChildNode) {
|
282
280
|
break
|
283
281
|
}
|
@@ -556,7 +554,7 @@ class Helper extends Base {
|
|
556
554
|
}
|
557
555
|
|
558
556
|
/**
|
559
|
-
* Creates a
|
557
|
+
* Creates a flat map of the tree, containing ids as keys and infos as values
|
560
558
|
* @param {Object} config
|
561
559
|
* @param {Neo.vdom.VNode} config.vnode
|
562
560
|
* @param {Neo.vdom.VNode} [config.parentNode=null]
|