neo.mjs 10.0.0-alpha.4 → 10.0.0-beta.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/portal/index.html +1 -1
- package/apps/portal/resources/data/examples_devmode.json +26 -27
- package/apps/portal/resources/data/examples_dist_dev.json +26 -27
- package/apps/portal/resources/data/examples_dist_esm.json +26 -27
- package/apps/portal/resources/data/examples_dist_prod.json +27 -28
- package/apps/portal/view/blog/List.mjs +1 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/apps/portal/view/learn/ContentComponent.mjs +102 -111
- package/buildScripts/buildThemes.mjs +1 -1
- package/examples/grid/animatedRowSorting/Viewport.mjs +4 -4
- package/examples/grid/bigData/ControlsContainer.mjs +3 -3
- package/examples/grid/bigData/GridContainer.mjs +8 -8
- package/examples/grid/cellEditing/MainContainer.mjs +5 -5
- package/examples/grid/container/MainContainer.mjs +4 -4
- package/examples/grid/nestedRecordFields/Viewport.mjs +5 -5
- package/examples/table/cellEditing/MainContainer.mjs +1 -1
- package/examples/table/container/MainContainer.mjs +3 -3
- package/examples/table/nestedRecordFields/Viewport.mjs +6 -6
- package/examples/tableFiltering/MainContainer.mjs +1 -1
- package/examples/tablePerformance/MainContainer.mjs +1 -1
- package/examples/tablePerformance/MainContainer2.mjs +1 -1
- package/examples/tablePerformance/MainContainer3.mjs +2 -2
- package/examples/tableStore/MainContainer.mjs +2 -2
- package/learn/UsingTheseTopics.md +2 -2
- package/learn/benefits/ConfigSystem.md +2 -2
- package/learn/benefits/FormsEngine.md +14 -14
- package/learn/benefits/MultiWindow.md +2 -2
- package/learn/benefits/OffTheMainThread.md +2 -2
- package/learn/benefits/Speed.md +2 -2
- package/learn/gettingstarted/ComponentModels.md +4 -4
- package/learn/gettingstarted/Config.md +6 -6
- package/learn/gettingstarted/DescribingTheUI.md +4 -4
- package/learn/gettingstarted/Events.md +6 -6
- package/learn/gettingstarted/Extending.md +4 -4
- package/learn/gettingstarted/References.md +6 -6
- package/learn/gettingstarted/Workspaces.md +6 -6
- package/learn/guides/ApplicationBootstrap.md +40 -42
- package/learn/guides/ComponentsAndContainers.md +12 -12
- package/learn/guides/CustomComponents.md +2 -2
- package/learn/guides/MainThreadAddonIntro.md +2 -2
- package/learn/guides/PortalApp.md +2 -2
- package/learn/guides/StateProviders.md +12 -12
- package/learn/guides/events/CustomEvents.md +16 -16
- package/learn/guides/events/DomEvents.md +12 -12
- package/learn/javascript/ClassFeatures.md +3 -2
- package/learn/javascript/Classes.md +8 -8
- package/learn/javascript/NewNode.md +4 -4
- package/learn/javascript/Overrides.md +8 -8
- package/learn/javascript/Super.md +10 -8
- package/learn/tutorials/Earthquakes.md +54 -57
- package/learn/tutorials/TodoList.md +4 -4
- package/package.json +1 -1
- package/resources/scss/src/apps/portal/learn/ContentComponent.scss +12 -0
- package/resources/scss/src/grid/{View.scss → Body.scss} +2 -2
- package/resources/scss/src/grid/VerticalScrollbar.scss +1 -1
- package/resources/scss/src/grid/plugin/AnimateRows.scss +1 -1
- package/resources/scss/src/grid/plugin/CellEditing.scss +1 -1
- package/resources/scss/src/table/{View.scss → Body.scss} +1 -1
- package/resources/scss/src/table/plugin/CellEditing.scss +1 -1
- package/resources/scss/theme-dark/grid/{View.scss → Body.scss} +1 -1
- package/resources/scss/theme-dark/table/{View.scss → Body.scss} +1 -1
- package/resources/scss/theme-light/grid/{View.scss → Body.scss} +1 -1
- package/resources/scss/theme-light/table/{View.scss → Body.scss} +1 -1
- package/resources/scss/theme-neo-light/Global.scss +1 -2
- package/resources/scss/theme-neo-light/grid/{View.scss → Body.scss} +1 -1
- package/resources/scss/theme-neo-light/table/{View.scss → Body.scss} +1 -1
- package/src/DefaultConfig.mjs +2 -2
- package/src/core/Base.mjs +59 -12
- package/src/core/Util.mjs +14 -2
- package/src/draggable/grid/header/toolbar/SortZone.mjs +21 -21
- package/src/draggable/table/header/toolbar/SortZone.mjs +1 -1
- package/src/grid/{View.mjs → Body.mjs} +19 -20
- package/src/grid/Container.mjs +58 -58
- package/src/grid/ScrollManager.mjs +56 -56
- package/src/grid/VerticalScrollbar.mjs +2 -2
- package/src/grid/_export.mjs +2 -2
- package/src/grid/column/AnimatedChange.mjs +5 -5
- package/src/grid/column/Base.mjs +1 -1
- package/src/grid/column/Component.mjs +6 -6
- package/src/grid/header/Toolbar.mjs +9 -9
- package/src/grid/plugin/AnimateRows.mjs +1 -2
- package/src/main/addon/AmCharts.mjs +8 -11
- package/src/main/addon/Base.mjs +150 -42
- package/src/main/addon/GoogleMaps.mjs +9 -16
- package/src/main/addon/HighlightJS.mjs +2 -13
- package/src/main/addon/IntersectionObserver.mjs +21 -21
- package/src/main/addon/MonacoEditor.mjs +1 -6
- package/src/table/{View.mjs → Body.mjs} +19 -20
- package/src/table/Container.mjs +43 -43
- package/src/table/_export.mjs +2 -2
- package/src/table/plugin/CellEditing.mjs +19 -19
- package/src/util/Style.mjs +2 -6
- package/src/vdom/Helper.mjs +10 -13
- package/src/worker/App.mjs +6 -18
- package/src/worker/Base.mjs +1 -1
- package/src/worker/Manager.mjs +4 -8
- package/src/worker/mixin/RemoteMethodAccess.mjs +1 -1
package/src/table/Container.mjs
CHANGED
@@ -3,7 +3,7 @@ import ClassSystemUtil from '../util/ClassSystem.mjs';
|
|
3
3
|
import CssUtil from '../util/Css.mjs';
|
4
4
|
import NeoArray from '../util/Array.mjs';
|
5
5
|
import Store from '../data/Store.mjs';
|
6
|
-
import
|
6
|
+
import TableBody from './Body.mjs';
|
7
7
|
import * as header from './header/_export.mjs';
|
8
8
|
|
9
9
|
/**
|
@@ -26,6 +26,16 @@ class Container extends BaseContainer {
|
|
26
26
|
* @member {String[]} baseCls=['neo-table-container']
|
27
27
|
*/
|
28
28
|
baseCls: ['neo-table-container'],
|
29
|
+
/**
|
30
|
+
* Configs for Neo.table.Body
|
31
|
+
* @member {Object|null} [bodyConfig=null]
|
32
|
+
*/
|
33
|
+
bodyConfig: null,
|
34
|
+
/**
|
35
|
+
* @member {String|null} bodyId_=null
|
36
|
+
* @protected
|
37
|
+
*/
|
38
|
+
bodyId_: null,
|
29
39
|
/**
|
30
40
|
* true uses table.plugin.CellEditing
|
31
41
|
* @member {Boolean} cellEditing_=false
|
@@ -75,16 +85,6 @@ class Container extends BaseContainer {
|
|
75
85
|
* @member {Boolean} useCustomScrollbars_=true
|
76
86
|
*/
|
77
87
|
useCustomScrollbars_: true,
|
78
|
-
/**
|
79
|
-
* Configs for Neo.table.View
|
80
|
-
* @member {Object|null} [viewConfig=null]
|
81
|
-
*/
|
82
|
-
viewConfig: null,
|
83
|
-
/**
|
84
|
-
* @member {String|null} viewId_=null
|
85
|
-
* @protected
|
86
|
-
*/
|
87
|
-
viewId_: null,
|
88
88
|
/**
|
89
89
|
* @member {Array|null} items=null
|
90
90
|
* @protected
|
@@ -100,19 +100,19 @@ class Container extends BaseContainer {
|
|
100
100
|
}
|
101
101
|
|
102
102
|
/**
|
103
|
-
* Convenience method to access the Neo.table.
|
104
|
-
* @returns {Neo.table.
|
103
|
+
* Convenience method to access the Neo.table.Body
|
104
|
+
* @returns {Neo.table.Body|null}
|
105
105
|
*/
|
106
|
-
get
|
107
|
-
return Neo.getComponent(this.
|
106
|
+
get body() {
|
107
|
+
return Neo.getComponent(this.bodyId) || Neo.get(this.bodyId)
|
108
108
|
}
|
109
109
|
|
110
110
|
/**
|
111
|
-
* Convenience method to access the Neo.table.
|
112
|
-
* @returns {Neo.table.
|
111
|
+
* Convenience method to access the Neo.table.header.Toolbar
|
112
|
+
* @returns {Neo.table.header.Toolbar|null}
|
113
113
|
*/
|
114
|
-
get
|
115
|
-
return Neo.getComponent(this.
|
114
|
+
get headerToolbar() {
|
115
|
+
return Neo.getComponent(this.headerToolbarId) || Neo.get(this.headerToolbarId)
|
116
116
|
}
|
117
117
|
|
118
118
|
/**
|
@@ -123,8 +123,8 @@ class Container extends BaseContainer {
|
|
123
123
|
|
124
124
|
let me = this;
|
125
125
|
|
126
|
+
me.bodyId = Neo.getId('table-body');
|
126
127
|
me.headerToolbarId = Neo.getId('table-header-toolbar');
|
127
|
-
me.viewId = Neo.getId('table-view');
|
128
128
|
|
129
129
|
me.items = [{
|
130
130
|
module : header.Toolbar,
|
@@ -133,11 +133,11 @@ class Container extends BaseContainer {
|
|
133
133
|
sortable : me.sortable,
|
134
134
|
...me.headerToolbarConfig
|
135
135
|
}, {
|
136
|
-
module :
|
136
|
+
module : TableBody,
|
137
137
|
containerId: me.id,
|
138
|
-
id : me.
|
138
|
+
id : me.bodyId,
|
139
139
|
store : me.store,
|
140
|
-
...me.
|
140
|
+
...me.bodyConfig
|
141
141
|
}];
|
142
142
|
|
143
143
|
me.vdom.id = me.getWrapperId();
|
@@ -184,7 +184,7 @@ class Container extends BaseContainer {
|
|
184
184
|
headerToolbar.createItems()
|
185
185
|
}
|
186
186
|
|
187
|
-
me.
|
187
|
+
me.body?.createViewData()
|
188
188
|
}
|
189
189
|
}
|
190
190
|
|
@@ -229,9 +229,9 @@ class Container extends BaseContainer {
|
|
229
229
|
value ?.on(listeners);
|
230
230
|
oldValue?.un(listeners);
|
231
231
|
|
232
|
-
// in case we dynamically change the store, the
|
233
|
-
if (me.
|
234
|
-
me.
|
232
|
+
// in case we dynamically change the store, the body needs to get the new reference
|
233
|
+
if (me.body) {
|
234
|
+
me.body.store = value
|
235
235
|
}
|
236
236
|
}
|
237
237
|
|
@@ -270,6 +270,16 @@ class Container extends BaseContainer {
|
|
270
270
|
me.scrollbarsCssApplied = true
|
271
271
|
}
|
272
272
|
|
273
|
+
/**
|
274
|
+
* Triggered before the bodyId config gets changed.
|
275
|
+
* @param {String} value
|
276
|
+
* @param {String} oldValue
|
277
|
+
* @protected
|
278
|
+
*/
|
279
|
+
beforeSetBodyId(value, oldValue) {
|
280
|
+
return value || oldValue
|
281
|
+
}
|
282
|
+
|
273
283
|
/**
|
274
284
|
* Triggered before the columns config gets changed.
|
275
285
|
* @param {Object[]} value
|
@@ -308,16 +318,6 @@ class Container extends BaseContainer {
|
|
308
318
|
return value
|
309
319
|
}
|
310
320
|
|
311
|
-
/**
|
312
|
-
* Triggered before the viewId config gets changed.
|
313
|
-
* @param {String} value
|
314
|
-
* @param {String} oldValue
|
315
|
-
* @protected
|
316
|
-
*/
|
317
|
-
beforeSetViewId(value, oldValue) {
|
318
|
-
return value || oldValue
|
319
|
-
}
|
320
|
-
|
321
321
|
/**
|
322
322
|
* In case you want to update multiple existing records in parallel,
|
323
323
|
* using this method is faster than updating each record one by one.
|
@@ -325,19 +325,19 @@ class Container extends BaseContainer {
|
|
325
325
|
* @param {Object[]} records
|
326
326
|
*/
|
327
327
|
bulkUpdateRecords(records) {
|
328
|
-
let {
|
328
|
+
let {body, store} = this,
|
329
329
|
{keyProperty} = store;
|
330
330
|
|
331
|
-
if (
|
332
|
-
|
331
|
+
if (body) {
|
332
|
+
body.silentVdomUpdate = true;
|
333
333
|
|
334
334
|
records.forEach(item => {
|
335
335
|
store.get(item[keyProperty])?.set(item)
|
336
336
|
});
|
337
337
|
|
338
|
-
|
338
|
+
body.silentVdomUpdate = false;
|
339
339
|
|
340
|
-
|
340
|
+
body.update()
|
341
341
|
}
|
342
342
|
}
|
343
343
|
|
@@ -426,7 +426,7 @@ class Container extends BaseContainer {
|
|
426
426
|
|
427
427
|
me.store.sort(opts);
|
428
428
|
me.removeSortingCss(opts.property);
|
429
|
-
opts.direction && me.
|
429
|
+
opts.direction && me.body.onStoreLoad()
|
430
430
|
}
|
431
431
|
|
432
432
|
/**
|
package/src/table/_export.mjs
CHANGED
@@ -69,7 +69,7 @@ class CellEditing extends Plugin {
|
|
69
69
|
me.onSelectionModelChange({value: selectionModel})
|
70
70
|
}
|
71
71
|
|
72
|
-
owner.
|
72
|
+
owner.body.keys.add({
|
73
73
|
Enter: 'onTableKeyDown',
|
74
74
|
Space: 'onTableKeyDown',
|
75
75
|
scope: me
|
@@ -109,9 +109,9 @@ class CellEditing extends Plugin {
|
|
109
109
|
|
110
110
|
let me = this,
|
111
111
|
{appName, windowId} = me,
|
112
|
-
{
|
113
|
-
cellId =
|
114
|
-
cellNode = VdomUtil.find(
|
112
|
+
{body} = me.owner,
|
113
|
+
cellId = body.getCellId(record, dataField),
|
114
|
+
cellNode = VdomUtil.find(body.vdom, cellId).vdom,
|
115
115
|
column = me.owner.headerToolbar.getColumn(dataField),
|
116
116
|
editor = me.editors[dataField],
|
117
117
|
value = record[dataField],
|
@@ -133,7 +133,7 @@ class CellEditing extends Plugin {
|
|
133
133
|
cls : me.editorCls,
|
134
134
|
dataField,
|
135
135
|
hideLabel: true,
|
136
|
-
parentId :
|
136
|
+
parentId : body.id,
|
137
137
|
record,
|
138
138
|
value,
|
139
139
|
windowId,
|
@@ -163,9 +163,9 @@ class CellEditing extends Plugin {
|
|
163
163
|
cellNode.cn = [editor.createVdomReference()];
|
164
164
|
delete cellNode.html;
|
165
165
|
|
166
|
-
|
166
|
+
body.updateDepth = -1;
|
167
167
|
|
168
|
-
await
|
168
|
+
await body.promiseUpdate();
|
169
169
|
|
170
170
|
await me.timeout(30);
|
171
171
|
|
@@ -175,13 +175,13 @@ class CellEditing extends Plugin {
|
|
175
175
|
/**
|
176
176
|
*
|
177
177
|
* @param {Object} data
|
178
|
-
* @param {
|
179
|
-
* @param {
|
180
|
-
* @param {
|
181
|
-
* @param {
|
178
|
+
* @param {Neo.table.Body} data.body
|
179
|
+
* @param {Object} data.data
|
180
|
+
* @param {String} data.dataField
|
181
|
+
* @param {Object} data.record
|
182
182
|
* @returns {Promise<void>}
|
183
183
|
*/
|
184
|
-
async onCellDoubleClick({data, dataField, record
|
184
|
+
async onCellDoubleClick({body, data, dataField, record}) {
|
185
185
|
await this.mountEditor(record, dataField)
|
186
186
|
}
|
187
187
|
|
@@ -262,12 +262,12 @@ class CellEditing extends Plugin {
|
|
262
262
|
async onTableKeyDown(data) {
|
263
263
|
let me = this,
|
264
264
|
{target} = data,
|
265
|
-
{
|
265
|
+
{body} = me.owner,
|
266
266
|
dataField, record;
|
267
267
|
|
268
268
|
if (!me.mountedEditor && target.cls?.includes('neo-selected')) {
|
269
|
-
dataField =
|
270
|
-
record =
|
269
|
+
dataField = body.getCellDataField(target.id);
|
270
|
+
record = body.getRecord(target.id);
|
271
271
|
|
272
272
|
await me.mountEditor(record, dataField)
|
273
273
|
}
|
@@ -328,13 +328,13 @@ class CellEditing extends Plugin {
|
|
328
328
|
|
329
329
|
let me = this,
|
330
330
|
record = me.mountedEditor.record,
|
331
|
-
{
|
332
|
-
rowIndex =
|
331
|
+
{body} = me.owner,
|
332
|
+
rowIndex = body.store.indexOf(record);
|
333
333
|
|
334
334
|
me.mountedEditor = null;
|
335
335
|
|
336
|
-
|
337
|
-
await
|
336
|
+
body.getVdomRoot().cn[rowIndex] = body.createRow({record, rowIndex});
|
337
|
+
await body.promiseUpdate()
|
338
338
|
}
|
339
339
|
}
|
340
340
|
|
package/src/util/Style.mjs
CHANGED
@@ -36,19 +36,15 @@ class Style extends Base {
|
|
36
36
|
return null
|
37
37
|
} else if (!oldStyle) {
|
38
38
|
return Neo.clone(newStyle)
|
39
|
-
} else if (!newStyle) {
|
40
|
-
Object.keys(oldStyle).forEach(function(style) {
|
41
|
-
styles[style] = null
|
42
|
-
});
|
43
39
|
} else {
|
44
|
-
Object.keys(newStyle).forEach(style => {
|
40
|
+
newStyle && Object.keys(newStyle).forEach(style => {
|
45
41
|
if (!oldStyle.hasOwnProperty(style) || oldStyle[style] !== newStyle[style]) {
|
46
42
|
styles[style] = newStyle[style]
|
47
43
|
}
|
48
44
|
});
|
49
45
|
|
50
46
|
Object.keys(oldStyle).forEach(style => {
|
51
|
-
if (!newStyle.hasOwnProperty(style)) {
|
47
|
+
if (!newStyle || !newStyle.hasOwnProperty(style)) {
|
52
48
|
styles[style] = null
|
53
49
|
}
|
54
50
|
});
|
package/src/vdom/Helper.mjs
CHANGED
@@ -38,23 +38,20 @@ class Helper extends Base {
|
|
38
38
|
}
|
39
39
|
|
40
40
|
/**
|
41
|
-
* @
|
41
|
+
* @returns {Promise<void>}
|
42
42
|
*/
|
43
|
-
|
44
|
-
super.
|
43
|
+
async initAsync() {
|
44
|
+
super.initAsync();
|
45
45
|
|
46
46
|
let me = this;
|
47
47
|
|
48
|
-
//
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
scope : me
|
54
|
-
});
|
48
|
+
// Subscribe to global Neo.config changes for dynamic renderer switching.
|
49
|
+
Neo.currentWorker.on({
|
50
|
+
neoConfigChange: me.onNeoConfigChange,
|
51
|
+
scope : me
|
52
|
+
});
|
55
53
|
|
56
|
-
|
57
|
-
})
|
54
|
+
await me.importUtil()
|
58
55
|
}
|
59
56
|
|
60
57
|
/**
|
@@ -107,7 +104,7 @@ class Helper extends Base {
|
|
107
104
|
Object.entries(value).forEach(([key, value]) => {
|
108
105
|
const
|
109
106
|
oldValue = oldVnode.attributes[key],
|
110
|
-
hasOldValue = Object.hasOwn(oldVnode.attributes,
|
107
|
+
hasOldValue = Object.hasOwn(oldVnode.attributes, key);
|
111
108
|
|
112
109
|
// If the attribute has an old value AND the value hasn't changed, skip.
|
113
110
|
if (hasOldValue && oldValue === value) {
|
package/src/worker/App.mjs
CHANGED
@@ -46,11 +46,6 @@ class App extends Base {
|
|
46
46
|
singleton: true
|
47
47
|
}
|
48
48
|
|
49
|
-
/**
|
50
|
-
* @member {Object|null} data=null
|
51
|
-
* @protected
|
52
|
-
*/
|
53
|
-
data = null
|
54
49
|
/**
|
55
50
|
* @member {Boolean} isUsingStateProviders=false
|
56
51
|
* @protected
|
@@ -388,23 +383,16 @@ class App extends Base {
|
|
388
383
|
* @param {Object} data
|
389
384
|
*/
|
390
385
|
onLoadApplication(data) {
|
391
|
-
let me
|
392
|
-
{config}
|
393
|
-
|
394
|
-
|
395
|
-
if (data) {
|
396
|
-
me.data = data;
|
397
|
-
config.resourcesPath = data.resourcesPath
|
398
|
-
}
|
399
|
-
|
400
|
-
path = me.data.path;
|
386
|
+
let me = this,
|
387
|
+
{config} = Neo,
|
388
|
+
{appPath} = config;
|
401
389
|
|
402
390
|
if (config.environment !== 'development') {
|
403
|
-
|
391
|
+
appPath = appPath.startsWith('/') ? appPath.substring(1) : appPath
|
404
392
|
}
|
405
393
|
|
406
|
-
me.importApp(
|
407
|
-
|
394
|
+
me.importApp(appPath).then(module => {
|
395
|
+
module.onStart();
|
408
396
|
|
409
397
|
// short delay to ensure Component Controllers are ready
|
410
398
|
config.hash && me.timeout(5).then(() => {
|
package/src/worker/Base.mjs
CHANGED
@@ -4,7 +4,7 @@ import Message from './Message.mjs';
|
|
4
4
|
import RemoteMethodAccess from './mixin/RemoteMethodAccess.mjs';
|
5
5
|
|
6
6
|
/**
|
7
|
-
* The abstract base class for the App, Data & VDom worker
|
7
|
+
* The abstract base class for e.g. the App, Data & VDom worker
|
8
8
|
* @class Neo.worker.Base
|
9
9
|
* @extends Neo.core.Base
|
10
10
|
* @abstract
|
package/src/worker/Manager.mjs
CHANGED
@@ -270,14 +270,10 @@ class Manager extends Base {
|
|
270
270
|
}
|
271
271
|
|
272
272
|
/**
|
273
|
-
*
|
273
|
+
*
|
274
274
|
*/
|
275
|
-
loadApplication(
|
276
|
-
this.sendMessage('app', {
|
277
|
-
action : 'loadApplication',
|
278
|
-
path,
|
279
|
-
resourcesPath: NeoConfig.resourcesPath
|
280
|
-
})
|
275
|
+
loadApplication() {
|
276
|
+
this.sendMessage('app', {action: 'loadApplication' })
|
281
277
|
}
|
282
278
|
|
283
279
|
/**
|
@@ -291,7 +287,7 @@ class Manager extends Base {
|
|
291
287
|
if (me.constructedThreads === me.activeWorkers) {
|
292
288
|
// better safe than sorry => all remotes need to be registered
|
293
289
|
NeoConfig.appPath && me.timeout(NeoConfig.loadApplicationDelay).then(() => {
|
294
|
-
me.loadApplication(
|
290
|
+
me.loadApplication()
|
295
291
|
})
|
296
292
|
}
|
297
293
|
}
|