neo.mjs 9.16.0 → 10.0.0-alpha.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/ServiceWorker.mjs +2 -2
- package/apps/email/view/Viewport.mjs +2 -2
- package/apps/form/view/Viewport.mjs +1 -1
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/examples/List.mjs +1 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/apps/realworld2/view/HomeContainer.mjs +1 -1
- package/apps/route/view/center/CardAdministration.mjs +3 -3
- package/apps/route/view/center/CardAdministrationDenied.mjs +2 -2
- package/apps/route/view/center/CardContact.mjs +2 -2
- package/apps/route/view/center/CardHome.mjs +2 -2
- package/apps/route/view/center/CardSection1.mjs +2 -2
- package/apps/route/view/center/CardSection2.mjs +2 -2
- package/buildScripts/createApp.mjs +2 -2
- package/docs/app/view/classdetails/HeaderComponent.mjs +3 -3
- package/docs/app/view/classdetails/MembersList.mjs +43 -46
- package/docs/app/view/classdetails/SourceViewComponent.mjs +1 -1
- package/docs/app/view/classdetails/TutorialComponent.mjs +1 -1
- package/examples/component/toast/MainContainer.mjs +16 -16
- package/examples/component/wrapper/googleMaps/MarkerDialog.mjs +4 -4
- package/examples/fields/MainContainer.mjs +1 -1
- package/examples/panel/MainContainer.mjs +2 -2
- package/examples/tab/container/MainContainer.mjs +3 -3
- package/examples/tabs/MainContainer.mjs +2 -2
- package/examples/tabs/MainContainer2.mjs +3 -3
- package/examples/viewport/MainContainer.mjs +2 -2
- package/package.json +3 -3
- package/resources/data/deck/learnneo/pages/benefits/FourEnvironments.md +1 -1
- package/resources/data/deck/learnneo/pages/benefits/Introduction.md +4 -3
- package/resources/data/deck/learnneo/pages/guides/events/DomEvents.md +5 -5
- package/resources/data/deck/training/pages/2022-12-27T21-55-23-144Z.md +2 -2
- package/resources/data/deck/training/pages/2022-12-29T18-36-08-226Z.md +1 -1
- package/resources/data/deck/training/pages/2022-12-29T18-36-56-893Z.md +2 -2
- package/resources/data/deck/training/pages/2022-12-29T20-37-08-919Z.md +2 -2
- package/resources/data/deck/training/pages/2022-12-29T20-37-20-344Z.md +2 -2
- package/resources/data/deck/training/pages/2023-01-13T21-48-17-258Z.md +2 -2
- package/resources/data/deck/training/pages/2023-02-05T17-44-53-815Z.md +9 -9
- package/resources/data/deck/training/pages/2023-10-14T19-25-08-153Z.md +1 -1
- package/src/DefaultConfig.mjs +14 -2
- package/src/Main.mjs +14 -5
- package/src/button/Base.mjs +1 -1
- package/src/calendar/view/calendars/List.mjs +1 -1
- package/src/component/Base.mjs +11 -11
- package/src/component/Chip.mjs +1 -1
- package/src/component/Helix.mjs +3 -3
- package/src/component/Process.mjs +2 -2
- package/src/component/StatusBadge.mjs +2 -2
- package/src/component/Timer.mjs +1 -1
- package/src/component/Toast.mjs +2 -2
- package/src/container/Base.mjs +1 -1
- package/src/form/field/CheckBox.mjs +2 -2
- package/src/form/field/FileUpload.mjs +14 -14
- package/src/form/field/Range.mjs +1 -1
- package/src/form/field/Text.mjs +1 -1
- package/src/form/field/trigger/Base.mjs +2 -2
- package/src/form/field/trigger/SpinUpDown.mjs +2 -2
- package/src/grid/View.mjs +1 -1
- package/src/main/DeltaUpdates.mjs +382 -0
- package/src/main/DomAccess.mjs +13 -36
- package/src/main/render/DomApiRenderer.mjs +138 -0
- package/src/main/render/StringBasedRenderer.mjs +58 -0
- package/src/table/View.mjs +1 -1
- package/src/table/plugin/CellEditing.mjs +1 -1
- package/src/tree/Accordion.mjs +11 -11
- package/src/tree/List.mjs +12 -5
- package/src/vdom/Helper.mjs +174 -292
- package/src/vdom/VNode.mjs +47 -11
- package/src/vdom/domConstants.mjs +65 -0
- package/src/vdom/util/DomApiVnodeCreator.mjs +51 -0
- package/src/vdom/util/StringFromVnode.mjs +123 -0
- package/src/worker/mixin/RemoteMethodAccess.mjs +13 -1
- package/src/main/mixin/DeltaUpdates.mjs +0 -352
@@ -44,14 +44,14 @@ class MainView extends Container {
|
|
44
44
|
style : {padding: '1em'},
|
45
45
|
|
46
46
|
items: [{
|
47
|
-
vdom: {tag: 'button',
|
47
|
+
vdom: {tag: 'button', html: 'Button 1'},
|
48
48
|
|
49
49
|
domListeners: [{
|
50
50
|
click: data => Neo.Main.log({value: `Clicked on ${data.component.id}`})
|
51
51
|
}]
|
52
52
|
}, {
|
53
53
|
style: {marginTop: '1em'},
|
54
|
-
vdom : {tag: 'button',
|
54
|
+
vdom : {tag: 'button', html: 'Button 2'},
|
55
55
|
|
56
56
|
domListeners: [{
|
57
57
|
click(data) {
|
@@ -82,7 +82,7 @@ class MainView extends Container {
|
|
82
82
|
style : {padding: '1em'},
|
83
83
|
|
84
84
|
items: [{
|
85
|
-
vdom: {tag: 'button',
|
85
|
+
vdom: {tag: 'button', html: 'Button 1'},
|
86
86
|
|
87
87
|
domListeners: [{
|
88
88
|
click: 'up.onButtonClick'
|
@@ -129,7 +129,7 @@ class MainView extends Container {
|
|
129
129
|
style : {padding: '1em'},
|
130
130
|
|
131
131
|
items: [{
|
132
|
-
vdom: {tag: 'button',
|
132
|
+
vdom: {tag: 'button', html: 'Button 1'},
|
133
133
|
|
134
134
|
domListeners: [{
|
135
135
|
click: 'onButtonClick'
|
@@ -247,7 +247,7 @@ class MainView extends Container {
|
|
247
247
|
style : {padding: '1em'},
|
248
248
|
|
249
249
|
items: [{
|
250
|
-
vdom : {tag: 'button',
|
250
|
+
vdom : {tag: 'button', html: 'Button 1'},
|
251
251
|
|
252
252
|
domListeners: [
|
253
253
|
{click: data => Neo.Main.log({value: 'Listener 1'})},
|
@@ -27,13 +27,13 @@ class MainContainer extends Viewport {
|
|
27
27
|
iconCls: 'fa fa-home',
|
28
28
|
text: 'Tab 1'
|
29
29
|
},
|
30
|
-
vdom: {
|
30
|
+
vdom: { html: 'Welcome to your new Neo App.' }
|
31
31
|
}, {
|
32
32
|
header: {
|
33
33
|
iconCls: 'fa fa-play-circle',
|
34
34
|
text: 'Tab 2'
|
35
35
|
},
|
36
|
-
vdom: {
|
36
|
+
vdom: { html: 'Have fun creating something awesome!' }
|
37
37
|
}]
|
38
38
|
}]
|
39
39
|
}
|
@@ -85,7 +85,7 @@ class MainContainer extends Viewport {
|
|
85
85
|
text: 'Tab 1'
|
86
86
|
},
|
87
87
|
vdom: {
|
88
|
-
|
88
|
+
html: 'Welcome to your new Neo App.'
|
89
89
|
}
|
90
90
|
}, {
|
91
91
|
header: {
|
@@ -93,7 +93,7 @@ class MainContainer extends Viewport {
|
|
93
93
|
text: 'Tab 2'
|
94
94
|
},
|
95
95
|
vdom: {
|
96
|
-
|
96
|
+
html: 'Have fun creating something awesome!'
|
97
97
|
}
|
98
98
|
}]
|
99
99
|
}],
|
@@ -30,13 +30,13 @@ class MainContainer extends Viewport {
|
|
30
30
|
iconCls: 'fa fa-home',
|
31
31
|
text: 'Tab 1'
|
32
32
|
},
|
33
|
-
vdom: {
|
33
|
+
vdom: { html: 'Welcome to your new Neo App.' }
|
34
34
|
}, {
|
35
35
|
header: {
|
36
36
|
iconCls: 'fa fa-play-circle',
|
37
37
|
text: 'Tab 2'
|
38
38
|
},
|
39
|
-
vdom: {
|
39
|
+
vdom: { html: 'Have fun creating something awesome!' }
|
40
40
|
}]
|
41
41
|
}]
|
42
42
|
}
|
@@ -27,13 +27,13 @@ class MainContainer extends Viewport {
|
|
27
27
|
iconCls: 'fa fa-home',
|
28
28
|
text: 'Tab 1'
|
29
29
|
},
|
30
|
-
vdom: {
|
30
|
+
vdom: { html: 'Welcome to your new Neo App.' }
|
31
31
|
}, {
|
32
32
|
header: {
|
33
33
|
iconCls: 'fa fa-play-circle',
|
34
34
|
text: 'Tab 2'
|
35
35
|
},
|
36
|
-
vdom: {
|
36
|
+
vdom: { html: 'Have fun creating something awesome!' }
|
37
37
|
}]
|
38
38
|
}]
|
39
39
|
}
|
@@ -27,8 +27,8 @@ in the `afterSetBusiness()` method.
|
|
27
27
|
},
|
28
28
|
vdom: {
|
29
29
|
cn: [{
|
30
|
-
tag: 'h2',
|
31
|
-
|
30
|
+
tag : 'h2',
|
31
|
+
html: 'foo'
|
32
32
|
}]
|
33
33
|
}
|
34
34
|
}, {
|
@@ -47,14 +47,14 @@ Change the detail view's `afterSetBusiness()` method to update the `vdom`.
|
|
47
47
|
afterSetBusiness(business){
|
48
48
|
if (!business) return;
|
49
49
|
const view = this.getReference('view');
|
50
|
-
view.vdom.cn[0].
|
50
|
+
view.vdom.cn[0].html = business.title;
|
51
51
|
view.update();
|
52
52
|
}
|
53
53
|
|
54
54
|
<b>Important: </b>The `update()` method tells Neo to apply vdom changes to the DOM.
|
55
55
|
Any time you change a set of vdom properties you need to run `update()`.
|
56
56
|
|
57
|
-
You don't need the first item's `
|
57
|
+
You don't need the first item's `html:'foo'` property any more, so you can
|
58
58
|
remove that from the first item's config.
|
59
59
|
|
60
60
|
Save, refresh, and confirm that the title is shown as the business is set.
|
@@ -76,8 +76,8 @@ The util method lets you find the node using the id (or using a more complex sel
|
|
76
76
|
Use the utility method, replacing the statement referencing the vdom hierarchy.
|
77
77
|
|
78
78
|
<pre>
|
79
|
-
<s>view.vdom.cn[0].
|
80
|
-
Neo.util.VDom.find(view.vdom, 'title').vdom.
|
79
|
+
<s>view.vdom.cn[0].html = business.title;</s>
|
80
|
+
Neo.util.VDom.find(view.vdom, 'title').vdom.html = business.title;
|
81
81
|
</pre>
|
82
82
|
|
83
83
|
|
@@ -96,7 +96,7 @@ find = Neo.util.VDom.find;
|
|
96
96
|
afterSetBusiness(business){
|
97
97
|
if (!business) return;
|
98
98
|
const view = this.getReference('view');
|
99
|
-
this.find(view.vdom, 'title').vdom.
|
99
|
+
this.find(view.vdom, 'title').vdom.html = business.title;
|
100
100
|
view.update();
|
101
101
|
}
|
102
102
|
</pre>
|
@@ -173,7 +173,7 @@ be a div that shows the address.
|
|
173
173
|
|
174
174
|
Then modify the `afterSetBusiness()` method to update the _address_ element's
|
175
175
|
`cn` to be an array of items, one per item in the address array. Each item should
|
176
|
-
be a _div_ with its `
|
176
|
+
be a _div_ with its `html` set to that part of the address.
|
177
177
|
|
178
178
|
Hint: The business record's `address` property is an array, and the `cn` is
|
179
179
|
also an array. Maybe there's a easy way to map the address array into a new
|
@@ -186,7 +186,7 @@ Here's one way to code it. How does this compare to your solution?
|
|
186
186
|
|
187
187
|
this.find(view.vdom, 'address').vdom.cn = business
|
188
188
|
.address
|
189
|
-
.map(item => ({tag: 'div',
|
189
|
+
.map(item => ({tag: 'div', html: item}));
|
190
190
|
|
191
191
|
??One last point...
|
192
192
|
|
@@ -98,7 +98,7 @@ item in our container. In Neo.mjs terms we're _configuring_ the button. Neo.mjs
|
|
98
98
|
which components and objects are _described_. It's an abstraction. In other words we're saying
|
99
99
|
what we want, but not how it's done. We want a button with some text — how that's done
|
100
100
|
isn't important here in the container. A non-declarative approach would be more focused on _how_,
|
101
|
-
where you might way "I want a <button> HTML element with its
|
101
|
+
where you might way "I want a <button> HTML element with its html set to some value."
|
102
102
|
|
103
103
|
In another topic you'll learn about the Neo.mjs config system and declaratively describing
|
104
104
|
views, controllers, and other things.
|
package/src/DefaultConfig.mjs
CHANGED
@@ -246,6 +246,18 @@ const DefaultConfig = {
|
|
246
246
|
* @type Boolean
|
247
247
|
*/
|
248
248
|
useSharedWorkers: false,
|
249
|
+
/**
|
250
|
+
* `true` will let the `vdom.Helper` create a String-based representation of the vnode tree.
|
251
|
+
* Main will then use e.g.`parentNode.insertAdjacentHTML('beforeend', delta.outerHTML);`
|
252
|
+
* This affects the initial painting of your apps, but also the creation of new component trees at run-time.
|
253
|
+
* `false` will skip the creation of the String, and instead use DOM APIs to generate a fragment inside Main,
|
254
|
+
* into which the vnode tree will get applied.
|
255
|
+
* @default false
|
256
|
+
* @memberOf! module:Neo
|
257
|
+
* @name config.useStringBasedMounting
|
258
|
+
* @type Boolean
|
259
|
+
*/
|
260
|
+
useStringBasedMounting: false,
|
249
261
|
/**
|
250
262
|
* True will generate a new task worker, which can get filled with own expensive remote methods
|
251
263
|
* @default false
|
@@ -264,12 +276,12 @@ const DefaultConfig = {
|
|
264
276
|
useVdomWorker: true,
|
265
277
|
/**
|
266
278
|
* buildScripts/injectPackageVersion.mjs will update this value
|
267
|
-
* @default '
|
279
|
+
* @default '10.0.0-alpha.1'
|
268
280
|
* @memberOf! module:Neo
|
269
281
|
* @name config.version
|
270
282
|
* @type String
|
271
283
|
*/
|
272
|
-
version: '
|
284
|
+
version: '10.0.0-alpha.1'
|
273
285
|
};
|
274
286
|
|
275
287
|
Object.assign(DefaultConfig, {
|
package/src/Main.mjs
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import Neo from './Neo.mjs';
|
2
2
|
import * as core from './core/_export.mjs';
|
3
|
-
import DomAccess from './main/DomAccess.mjs';
|
3
|
+
import DomAccess from './main/DomAccess.mjs'; // has to get imported before DeltaUpdates
|
4
|
+
import DeltaUpdates from './main/DeltaUpdates.mjs';
|
4
5
|
import DomEvents from './main/DomEvents.mjs';
|
5
6
|
import Observable from './core/Observable.mjs';
|
6
7
|
import WorkerManager from './worker/Manager.mjs';
|
@@ -336,8 +337,9 @@ class Main extends core.Base {
|
|
336
337
|
* @protected
|
337
338
|
*/
|
338
339
|
processQueue(queue, start) {
|
339
|
-
let me
|
340
|
-
|
340
|
+
let me = this,
|
341
|
+
{mode} = me,
|
342
|
+
limit = me.timeLimit,
|
341
343
|
operation;
|
342
344
|
|
343
345
|
while (operation = queue.shift()) {
|
@@ -345,7 +347,14 @@ class Main extends core.Base {
|
|
345
347
|
queue.unshift(operation);
|
346
348
|
return requestAnimationFrame(me.renderFrame.bind(me))
|
347
349
|
} else {
|
348
|
-
|
350
|
+
if (mode === 'read') {
|
351
|
+
DomAccess.read(operation)
|
352
|
+
} else if (mode === 'write') {
|
353
|
+
DeltaUpdates.insertNode(operation)
|
354
|
+
} else {
|
355
|
+
DeltaUpdates.update(operation)
|
356
|
+
}
|
357
|
+
|
349
358
|
WorkerManager.resolveDomOperationPromise(operation.replyId)
|
350
359
|
}
|
351
360
|
}
|
@@ -531,7 +540,7 @@ class Main extends core.Base {
|
|
531
540
|
}
|
532
541
|
|
533
542
|
/**
|
534
|
-
* Open a new popup window and return if
|
543
|
+
* Open a new popup window and return if successful
|
535
544
|
* @param {Object} data
|
536
545
|
* @param {String} data.url
|
537
546
|
* @param {String} data.windowFeatures
|
package/src/button/Base.mjs
CHANGED
@@ -77,7 +77,7 @@ class List extends ComponentList {
|
|
77
77
|
|
78
78
|
return [
|
79
79
|
checkBox.createVdomReference(),
|
80
|
-
{tag: 'i', cls: ['neo-edit-icon', 'fas fa-edit'], id: me.getEditIconId(index)}
|
80
|
+
{tag: 'i', cls: ['neo-edit-icon', 'fas', 'fa-edit'], id: me.getEditIconId(index)}
|
81
81
|
]
|
82
82
|
}
|
83
83
|
|
package/src/component/Base.mjs
CHANGED
@@ -1663,7 +1663,7 @@ class Component extends Base {
|
|
1663
1663
|
controller = me.getConfigInstanceByNtype('controller', ntype);
|
1664
1664
|
|
1665
1665
|
if (!ntype) {
|
1666
|
-
me[closestController] = controller
|
1666
|
+
me[closestController] = controller
|
1667
1667
|
}
|
1668
1668
|
|
1669
1669
|
return controller
|
@@ -1911,7 +1911,7 @@ class Component extends Base {
|
|
1911
1911
|
} else {
|
1912
1912
|
let style = me.style;
|
1913
1913
|
style.visibility = 'hidden';
|
1914
|
-
me.style = style
|
1914
|
+
me.style = style
|
1915
1915
|
}
|
1916
1916
|
|
1917
1917
|
me._hidden = true
|
@@ -2136,14 +2136,14 @@ class Component extends Base {
|
|
2136
2136
|
onFocusEnter(data) {
|
2137
2137
|
// If we are hidden, or unmounted while we still contain focus, we have to revert
|
2138
2138
|
// focus to where it came from if possible
|
2139
|
-
this.focusEnterData = data
|
2139
|
+
this.focusEnterData = data
|
2140
2140
|
}
|
2141
2141
|
|
2142
2142
|
/**
|
2143
2143
|
* @param {Object} data
|
2144
2144
|
*/
|
2145
2145
|
onFocusLeave(data) {
|
2146
|
-
this.focusEnterData = null
|
2146
|
+
this.focusEnterData = null
|
2147
2147
|
}
|
2148
2148
|
|
2149
2149
|
/**
|
@@ -2171,11 +2171,11 @@ class Component extends Base {
|
|
2171
2171
|
|
2172
2172
|
/**
|
2173
2173
|
* Gets called from the render() promise success handler
|
2174
|
-
* @param {Object}
|
2174
|
+
* @param {Object} vnode
|
2175
2175
|
* @param {Boolean} autoMount Mount the DOM after the vnode got created
|
2176
2176
|
* @protected
|
2177
2177
|
*/
|
2178
|
-
onRender(
|
2178
|
+
onRender(vnode, autoMount) {
|
2179
2179
|
let me = this,
|
2180
2180
|
{app} = me;
|
2181
2181
|
|
@@ -2189,9 +2189,9 @@ class Component extends Base {
|
|
2189
2189
|
app.fire('render')
|
2190
2190
|
}
|
2191
2191
|
|
2192
|
-
me.vnode =
|
2192
|
+
me.vnode = vnode;
|
2193
2193
|
|
2194
|
-
let childIds = ComponentManager.getChildIds(
|
2194
|
+
let childIds = ComponentManager.getChildIds(vnode),
|
2195
2195
|
i = 0,
|
2196
2196
|
len = childIds.length,
|
2197
2197
|
child;
|
@@ -2333,11 +2333,11 @@ class Component extends Base {
|
|
2333
2333
|
autoMount,
|
2334
2334
|
parentId : autoMount ? me.getMountedParentId() : undefined,
|
2335
2335
|
parentIndex: autoMount ? me.getMountedParentIndex() : undefined,
|
2336
|
-
|
2337
|
-
|
2336
|
+
vdom : ComponentManager.getVdomTree(me.vdom),
|
2337
|
+
windowId : me.windowId
|
2338
2338
|
});
|
2339
2339
|
|
2340
|
-
me.onRender(data, useVdomWorker ? autoMount : false);
|
2340
|
+
me.onRender(data.vnode, useVdomWorker ? autoMount : false);
|
2341
2341
|
me.isVdomUpdating = false;
|
2342
2342
|
|
2343
2343
|
autoMount && !useVdomWorker && me.mount();
|
package/src/component/Chip.mjs
CHANGED
package/src/component/Helix.mjs
CHANGED
@@ -701,8 +701,8 @@ class Helix extends Component {
|
|
701
701
|
|
702
702
|
if (me.showCloneInfo) {
|
703
703
|
itemVdom.cn.push({
|
704
|
-
cls
|
705
|
-
|
704
|
+
cls : ['contact-name'],
|
705
|
+
html: record.firstname + ' ' + record.lastname
|
706
706
|
})
|
707
707
|
}
|
708
708
|
|
@@ -711,7 +711,7 @@ class Helix extends Component {
|
|
711
711
|
autoMount : true,
|
712
712
|
parentId : group.id,
|
713
713
|
parentIndex: store.getCount(),
|
714
|
-
|
714
|
+
vdom : itemVdom
|
715
715
|
}).then(data => {
|
716
716
|
me.clonedItems.push(itemVdom);
|
717
717
|
|
@@ -173,8 +173,8 @@ class Process extends Base {
|
|
173
173
|
content = curItem.cn[3];
|
174
174
|
|
175
175
|
content.cn[0].cls.push(newItem.iconCls);
|
176
|
-
content.cn[1].
|
177
|
-
content.cn[2].
|
176
|
+
content.cn[1].html = newItem.title;
|
177
|
+
content.cn[2].html = newItem.text;
|
178
178
|
|
179
179
|
NeoArray.add(vdomRoot.cn, curItem)
|
180
180
|
})
|
@@ -329,7 +329,7 @@ class StatusBadge extends Base {
|
|
329
329
|
break;
|
330
330
|
}
|
331
331
|
|
332
|
-
labelNode.
|
332
|
+
labelNode.html = showLabel;
|
333
333
|
|
334
334
|
me.updateStateIconNode(showStateIcon);
|
335
335
|
me.updateSideIconNode(showSideIcon)
|
@@ -382,7 +382,7 @@ class StatusBadge extends Base {
|
|
382
382
|
updateLabelNode(value) {
|
383
383
|
let labelNode = this.getVdomRoot().cn[1];
|
384
384
|
|
385
|
-
labelNode.
|
385
|
+
labelNode.html = value;
|
386
386
|
labelNode.removeDom = !Boolean(value);
|
387
387
|
|
388
388
|
this.update()
|
package/src/component/Timer.mjs
CHANGED
package/src/component/Toast.mjs
CHANGED
@@ -175,7 +175,7 @@ class Toast extends Component {
|
|
175
175
|
afterSetMsg(value, oldValue) {
|
176
176
|
let vdom = this.getTextRootVdom().cn[1];
|
177
177
|
|
178
|
-
vdom.
|
178
|
+
vdom.html = value
|
179
179
|
}
|
180
180
|
|
181
181
|
/**
|
@@ -221,7 +221,7 @@ class Toast extends Component {
|
|
221
221
|
let vdom = this.getTextRootVdom().cn[0];
|
222
222
|
|
223
223
|
vdom.removeDom = Neo.isEmpty(value);
|
224
|
-
vdom.
|
224
|
+
vdom.html = value;
|
225
225
|
NeoArray[value ? 'add' : 'remove'](vdom.cls, 'neo-toast-has-title')
|
226
226
|
}
|
227
227
|
|
package/src/container/Base.mjs
CHANGED
@@ -324,7 +324,7 @@ class CheckBox extends Field {
|
|
324
324
|
value = `<span class="${me.labelIdCls.join(',')}">${me.labelId}</span>${me.labelIdSeparator + value}`
|
325
325
|
}
|
326
326
|
|
327
|
-
me.vdom.cn[0].cn[0].
|
327
|
+
me.vdom.cn[0].cn[0].html = value;
|
328
328
|
me.update()
|
329
329
|
}
|
330
330
|
|
@@ -397,7 +397,7 @@ class CheckBox extends Field {
|
|
397
397
|
showLabel = !!value; // hide the label, in case value === null || value === ''
|
398
398
|
|
399
399
|
if (showLabel) {
|
400
|
-
valueLabel.
|
400
|
+
valueLabel.html = value
|
401
401
|
}
|
402
402
|
|
403
403
|
valueLabel.removeDom = !showLabel;
|
@@ -410,13 +410,13 @@ class FileUpload extends Field {
|
|
410
410
|
escapedFileName = StringUtil.escapeHtml(file.name);
|
411
411
|
|
412
412
|
if (me.types && !types[type]) {
|
413
|
-
body.cn[0].
|
414
|
-
body.cn[1].
|
413
|
+
body.cn[0].html = escapedFileName;
|
414
|
+
body.cn[1].html = `${me.invalidFileFormat} (.${type}) ${me.formatSize(file.size)}`;
|
415
415
|
me.error = me.pleaseUseTheseTypes?.replace('{allowedFileTypes}', Object.keys(types).join(' .'))
|
416
416
|
}
|
417
417
|
else if (file.size > me.maxSize) {
|
418
|
-
body.cn[0].
|
419
|
-
body.cn[1].
|
418
|
+
body.cn[0].html = escapedFileName;
|
419
|
+
body.cn[1].html = me.formatSize(file.size);
|
420
420
|
me.error = me.fileSizeMoreThan?.replace('{allowedFileSize}', String(me._maxSize).toUpperCase());
|
421
421
|
}
|
422
422
|
// If it passes the type and maxSize check, upload it
|
@@ -448,7 +448,7 @@ class FileUpload extends Field {
|
|
448
448
|
await me.timeout(100);
|
449
449
|
me.focus(me.vdom.cn[2].id);
|
450
450
|
|
451
|
-
me.vdom.cn[1].cn[0].
|
451
|
+
me.vdom.cn[1].cn[0].html = StringUtil.escapeHtml(file.name);
|
452
452
|
me.update();
|
453
453
|
me.state = 'uploading';
|
454
454
|
|
@@ -492,7 +492,7 @@ class FileUpload extends Field {
|
|
492
492
|
|
493
493
|
(vdom.style || (vdom.style = {}))['--upload-progress'] = `${progress}turn`;
|
494
494
|
|
495
|
-
vdom.cn[1].cn[1].
|
495
|
+
vdom.cn[1].cn[1].html = `${this.uploading}... (${Math.round(progress * 100)}%)`;
|
496
496
|
|
497
497
|
this.uploadSize = loaded;
|
498
498
|
this.update();
|
@@ -673,7 +673,7 @@ class FileUpload extends Field {
|
|
673
673
|
|
674
674
|
me.documentId = document.id;
|
675
675
|
me.fileSize = me.formatSize(document.size);
|
676
|
-
me.vdom.cn[1].cn[0].
|
676
|
+
me.vdom.cn[1].cn[0].html = StringUtil.escapeHtml(document.fileName);
|
677
677
|
me.state = me.documentStatusMap[document.status];
|
678
678
|
}
|
679
679
|
}
|
@@ -704,15 +704,15 @@ class FileUpload extends Field {
|
|
704
704
|
isChangeEventNeeded = true;
|
705
705
|
break;
|
706
706
|
case 'upload-failed':
|
707
|
-
status.
|
707
|
+
status.html = `${me.uploadFailed}${isNaN(me.progress) ? '' : `... (${Math.round(me.progress * 100)}%)`}`;
|
708
708
|
isChangeEventNeeded = true;
|
709
709
|
break;
|
710
710
|
case 'processing':
|
711
|
-
status.
|
711
|
+
status.html = `${me.scanning}... (${me.formatSize(me.uploadSize)})`;
|
712
712
|
vdom.inert = true;
|
713
713
|
break;
|
714
714
|
case 'scan-failed':
|
715
|
-
status.
|
715
|
+
status.html = `${me.malwareFoundInFile}. \u2022 ${me.fileSize}`;
|
716
716
|
me.error = me.pleaseCheck;
|
717
717
|
isChangeEventNeeded = true;
|
718
718
|
break;
|
@@ -721,19 +721,19 @@ class FileUpload extends Field {
|
|
721
721
|
anchor.href = me.createUrl(me.downloadUrl, {
|
722
722
|
[me.documentIdParameter] : me.documentId
|
723
723
|
});
|
724
|
-
status.
|
724
|
+
status.html = me.fileSize;
|
725
725
|
isChangeEventNeeded = true;
|
726
726
|
break;
|
727
727
|
case 'not-downloadable':
|
728
|
-
status.
|
728
|
+
status.html = me.document ? me.fileSize : `${me.successfullyUploaded} \u2022 ${me.fileSize}`;
|
729
729
|
isChangeEventNeeded = true;
|
730
730
|
break;
|
731
731
|
case 'deleted':
|
732
|
-
status.
|
732
|
+
status.html = me.fileWasDeleted;
|
733
733
|
isChangeEventNeeded = true;
|
734
734
|
break;
|
735
735
|
case 'error':
|
736
|
-
status.
|
736
|
+
status.html = me.fileIsInAnErrorState;
|
737
737
|
me.error = me.pleaseCheck;
|
738
738
|
isChangeEventNeeded = true;
|
739
739
|
}
|
package/src/form/field/Range.mjs
CHANGED
package/src/form/field/Text.mjs
CHANGED
@@ -594,7 +594,7 @@ class Text extends Field {
|
|
594
594
|
value = `<span class="${me.labelIdCls.join(',')}">${me.labelId}</span>${me.labelIdSeparator + value}`
|
595
595
|
}
|
596
596
|
|
597
|
-
me.getLabelEl().
|
597
|
+
me.getLabelEl().html = value;
|
598
598
|
|
599
599
|
if (!me.hideLabel) {
|
600
600
|
if (me.labelPosition === 'inline') {
|
@@ -137,10 +137,10 @@ class Base extends Component {
|
|
137
137
|
afterSetIconCls(value, oldValue) {
|
138
138
|
let {cls} = this;
|
139
139
|
|
140
|
-
NeoArray.remove(cls, oldValue);
|
140
|
+
NeoArray.remove(cls, oldValue?.split(' '));
|
141
141
|
|
142
142
|
if (value && value !== '') {
|
143
|
-
NeoArray.add(cls, value)
|
143
|
+
NeoArray.add(cls, value?.split(' '))
|
144
144
|
}
|
145
145
|
|
146
146
|
this.cls = cls
|
@@ -44,8 +44,8 @@ class SpinUpDown extends Base {
|
|
44
44
|
let me = this;
|
45
45
|
|
46
46
|
me.vdom.cn = [
|
47
|
-
{cls: ['neo-spin-button', 'neo-up', me.spinButtonUpIconCls]},
|
48
|
-
{cls: ['neo-spin-button', 'neo-down', me.spinButtonDownIconCls]}
|
47
|
+
{cls: ['neo-spin-button', 'neo-up', ...me.spinButtonUpIconCls .split(' ')]},
|
48
|
+
{cls: ['neo-spin-button', 'neo-down', ...me.spinButtonDownIconCls.split(' ')]}
|
49
49
|
];
|
50
50
|
|
51
51
|
me.update();
|
package/src/grid/View.mjs
CHANGED