neo.mjs 8.41.2 → 8.42.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/portal/view/home/FooterContainer.mjs +1 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/grid/nestedRecordFields/ViewportController.mjs +4 -4
- package/package.json +2 -2
- package/src/DefaultConfig.mjs +2 -2
- package/src/collection/Base.mjs +2 -2
- package/src/container/Base.mjs +4 -2
- package/src/manager/Component.mjs +19 -10
- package/src/util/Logger.mjs +1 -1
package/apps/ServiceWorker.mjs
CHANGED
@@ -23,9 +23,9 @@ class ViewportController extends Component {
|
|
23
23
|
*/
|
24
24
|
editButtonHandler(data) {
|
25
25
|
let me = this,
|
26
|
+
{dialog} = me,
|
26
27
|
button = data.component,
|
27
|
-
{appName,
|
28
|
-
{record} = button;
|
28
|
+
{appName, record, theme, windowId} = button;
|
29
29
|
|
30
30
|
if (!dialog) {
|
31
31
|
import('./EditUserDialog.mjs').then(module => {
|
@@ -91,7 +91,7 @@ class ViewportController extends Component {
|
|
91
91
|
onSwitchThemeButtonClick(data) {
|
92
92
|
let me = this,
|
93
93
|
button = data.component,
|
94
|
-
isDarkTheme =
|
94
|
+
isDarkTheme = button.theme !== 'neo-theme-light',
|
95
95
|
theme = isDarkTheme ? 'neo-theme-light' : 'neo-theme-dark';
|
96
96
|
|
97
97
|
button.set({
|
@@ -99,7 +99,7 @@ class ViewportController extends Component {
|
|
99
99
|
text : isDarkTheme ? 'Dark Theme' : 'Light Theme'
|
100
100
|
});
|
101
101
|
|
102
|
-
me.theme = theme;
|
102
|
+
me.component.theme = theme;
|
103
103
|
|
104
104
|
if (me.dialog) {
|
105
105
|
me.dialog.theme = theme
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "8.
|
3
|
+
"version": "8.42.0",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -65,7 +65,7 @@
|
|
65
65
|
"sass": "^1.86.3",
|
66
66
|
"siesta-lite": "5.5.2",
|
67
67
|
"url": "^0.11.4",
|
68
|
-
"webpack": "^5.99.
|
68
|
+
"webpack": "^5.99.5",
|
69
69
|
"webpack-cli": "^6.0.1",
|
70
70
|
"webpack-dev-server": "^5.2.1",
|
71
71
|
"webpack-hook-plugin": "^1.0.7",
|
package/src/DefaultConfig.mjs
CHANGED
@@ -263,12 +263,12 @@ const DefaultConfig = {
|
|
263
263
|
useVdomWorker: true,
|
264
264
|
/**
|
265
265
|
* buildScripts/injectPackageVersion.mjs will update this value
|
266
|
-
* @default '8.
|
266
|
+
* @default '8.42.0'
|
267
267
|
* @memberOf! module:Neo
|
268
268
|
* @name config.version
|
269
269
|
* @type String
|
270
270
|
*/
|
271
|
-
version: '8.
|
271
|
+
version: '8.42.0'
|
272
272
|
};
|
273
273
|
|
274
274
|
Object.assign(DefaultConfig, {
|
package/src/collection/Base.mjs
CHANGED
@@ -811,7 +811,7 @@ class Collection extends Base {
|
|
811
811
|
/**
|
812
812
|
* Returns the first item which matches the property and value
|
813
813
|
* @param {Object|String} property
|
814
|
-
* @param {String
|
814
|
+
* @param {Number|String} [value] Only required in case the first param is a string
|
815
815
|
* @returns {Object} Returns the first found item or null
|
816
816
|
*/
|
817
817
|
findFirst(property, value) {
|
@@ -828,7 +828,7 @@ class Collection extends Base {
|
|
828
828
|
|
829
829
|
/**
|
830
830
|
* Returns the object associated to the key, or null if there is none.
|
831
|
-
* @param key
|
831
|
+
* @param {Number|String} key
|
832
832
|
* @returns {Object|null}
|
833
833
|
*/
|
834
834
|
get(key) {
|
package/src/container/Base.mjs
CHANGED
@@ -303,7 +303,7 @@ class Container extends Component {
|
|
303
303
|
createItem(item, index) {
|
304
304
|
let me = this,
|
305
305
|
config = {appName: me.appName, parentId: me.id, parentIndex: index, windowId: me.windowId},
|
306
|
-
defaults = {
|
306
|
+
defaults = {...me.itemDefaults},
|
307
307
|
lazyLoadItem, module;
|
308
308
|
|
309
309
|
if (defaults) {
|
@@ -319,6 +319,7 @@ class Container extends Component {
|
|
319
319
|
switch (Neo.typeOf(item)) {
|
320
320
|
case 'NeoClass': {
|
321
321
|
item = Neo.create({
|
322
|
+
theme: item.config.theme || me.theme,
|
322
323
|
...defaults,
|
323
324
|
module: item,
|
324
325
|
...config
|
@@ -350,7 +351,8 @@ class Container extends Component {
|
|
350
351
|
lazyLoadItem = module && !module.isClass && Neo.isFunction(module);
|
351
352
|
|
352
353
|
if (module && !lazyLoadItem) {
|
353
|
-
item.className = module.prototype.className
|
354
|
+
item.className = module.prototype.className;
|
355
|
+
item.theme = defaults.theme || module.config.theme || me.theme
|
354
356
|
}
|
355
357
|
|
356
358
|
if (item.handlerScope === 'this') {
|
@@ -35,7 +35,7 @@ class Component extends Manager {
|
|
35
35
|
let me = this;
|
36
36
|
|
37
37
|
Neo.first = me.getFirst.bind(me); // alias
|
38
|
-
Neo.getComponent = me.
|
38
|
+
Neo.getComponent = me.get .bind(me) // alias
|
39
39
|
}
|
40
40
|
|
41
41
|
/**
|
@@ -157,7 +157,7 @@ class Component extends Manager {
|
|
157
157
|
}
|
158
158
|
|
159
159
|
/**
|
160
|
-
* @param {
|
160
|
+
* @param {Object[]} path
|
161
161
|
* @returns {String|null} the component id in case there is a match
|
162
162
|
*/
|
163
163
|
findParentComponent(path) {
|
@@ -179,11 +179,20 @@ class Component extends Manager {
|
|
179
179
|
|
180
180
|
/**
|
181
181
|
* Returns the object associated to the key, or null if there is none.
|
182
|
-
* @param key
|
182
|
+
* @param {Number|String} key
|
183
|
+
* @param {Boolean} [includeWrapperNodes=true]
|
183
184
|
* @returns {Neo.component.Base|null}
|
184
185
|
*/
|
185
|
-
get(key) {
|
186
|
-
|
186
|
+
get(key, includeWrapperNodes=true) {
|
187
|
+
if (includeWrapperNodes) {
|
188
|
+
let wrapperNode = this.wrapperNodes.get(key);
|
189
|
+
|
190
|
+
if (wrapperNode) {
|
191
|
+
return wrapperNode
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
return super.get(key)
|
187
196
|
}
|
188
197
|
|
189
198
|
/**
|
@@ -333,7 +342,7 @@ class Component extends Manager {
|
|
333
342
|
let parentIds = [];
|
334
343
|
|
335
344
|
while (component?.parentId) {
|
336
|
-
component = this.
|
345
|
+
component = this.get(component.parentId);
|
337
346
|
|
338
347
|
if (component) {
|
339
348
|
parentIds.push(component.id)
|
@@ -369,13 +378,13 @@ class Component extends Manager {
|
|
369
378
|
*/
|
370
379
|
getParents(component) {
|
371
380
|
if (Neo.isString(component)) {
|
372
|
-
component = this.
|
381
|
+
component = this.get(component)
|
373
382
|
}
|
374
383
|
|
375
384
|
let parents = [];
|
376
385
|
|
377
386
|
while (component?.parentId) {
|
378
|
-
component = this.
|
387
|
+
component = this.get(component.parentId);
|
379
388
|
|
380
389
|
if (component) {
|
381
390
|
parents.push(component)
|
@@ -509,7 +518,7 @@ class Component extends Manager {
|
|
509
518
|
* @returns {Neo.component.Base|Neo.component.Base[]|null}
|
510
519
|
*/
|
511
520
|
up(componentId, config, returnFirstMatch=true) {
|
512
|
-
let component = this.
|
521
|
+
let component = this.get(componentId),
|
513
522
|
returnArray = [],
|
514
523
|
configArray, configLength, matchArray;
|
515
524
|
|
@@ -525,7 +534,7 @@ class Component extends Manager {
|
|
525
534
|
configLength = configArray.length;
|
526
535
|
|
527
536
|
while (component?.parentId) {
|
528
|
-
component = this.
|
537
|
+
component = this.get(component.parentId);
|
529
538
|
|
530
539
|
if (!component) {
|
531
540
|
return returnFirstMatch ? null : returnArray
|
package/src/util/Logger.mjs
CHANGED