neo.mjs 4.0.92 → 4.0.93
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.93",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -54,7 +54,7 @@
|
|
54
54
|
"neo-jsdoc": "^1.0.1",
|
55
55
|
"neo-jsdoc-x": "^1.0.4",
|
56
56
|
"postcss": "^8.4.16",
|
57
|
-
"sass": "^1.54.
|
57
|
+
"sass": "^1.54.5",
|
58
58
|
"webpack": "^5.74.0",
|
59
59
|
"webpack-cli": "^4.10.0",
|
60
60
|
"webpack-dev-server": "4.10.0",
|
package/src/component/Canvas.mjs
CHANGED
@@ -42,14 +42,16 @@ class Canvas extends Component {
|
|
42
42
|
afterSetMounted(value, oldValue) {
|
43
43
|
super.afterSetMounted(value, oldValue);
|
44
44
|
|
45
|
-
let me
|
46
|
-
id
|
47
|
-
|
45
|
+
let me = this,
|
46
|
+
id = me.getCanvasId(),
|
47
|
+
offscreen = me.offscreen,
|
48
|
+
worker = Neo.currentWorker;
|
48
49
|
|
49
|
-
if (value &&
|
50
|
+
if (value && offscreen) {
|
50
51
|
worker.promiseMessage('main', {
|
51
|
-
action: 'getOffscreenCanvas',
|
52
|
-
|
52
|
+
action : 'getOffscreenCanvas',
|
53
|
+
appName: me.appName,
|
54
|
+
nodeId : id
|
53
55
|
}).then(data => {
|
54
56
|
worker.promiseMessage('canvas', {
|
55
57
|
action: 'registerCanvas',
|
@@ -59,6 +61,8 @@ class Canvas extends Component {
|
|
59
61
|
me.offscreenRegistered = true;
|
60
62
|
});
|
61
63
|
});
|
64
|
+
} else if (offscreen) {
|
65
|
+
me.offscreenRegistered = false;
|
62
66
|
}
|
63
67
|
}
|
64
68
|
|
package/src/form/Container.mjs
CHANGED
@@ -36,9 +36,10 @@ class Container extends BaseContainer {
|
|
36
36
|
* @returns {Neo.form.field.Base|null} fields
|
37
37
|
*/
|
38
38
|
getField(name) {
|
39
|
-
let fields = ComponentManager.getChildren(this)
|
39
|
+
let fields = ComponentManager.getChildren(this),
|
40
|
+
field;
|
40
41
|
|
41
|
-
for (
|
42
|
+
for (field of fields) {
|
42
43
|
if (field instanceof BaseField) {
|
43
44
|
if (field.id === name || field.name === name) {
|
44
45
|
return field;
|
@@ -53,10 +54,9 @@ class Container extends BaseContainer {
|
|
53
54
|
* @returns {Neo.form.field.Base[]} fields
|
54
55
|
*/
|
55
56
|
getFields() {
|
56
|
-
let
|
57
|
-
fields = [];
|
57
|
+
let fields = [];
|
58
58
|
|
59
|
-
|
59
|
+
ComponentManager.getChildren(this).forEach(item => {
|
60
60
|
item instanceof BaseField && fields.push(item);
|
61
61
|
});
|
62
62
|
|
@@ -67,10 +67,9 @@ class Container extends BaseContainer {
|
|
67
67
|
* @returns {Object}
|
68
68
|
*/
|
69
69
|
getSubmitValues() {
|
70
|
-
let
|
71
|
-
values = {};
|
70
|
+
let values = {};
|
72
71
|
|
73
|
-
|
72
|
+
this.getFields().forEach(item => {
|
74
73
|
values[item.name || item.id] = item.getSubmitValue();
|
75
74
|
});
|
76
75
|
|
@@ -81,10 +80,9 @@ class Container extends BaseContainer {
|
|
81
80
|
* @returns {Object}
|
82
81
|
*/
|
83
82
|
getValues() {
|
84
|
-
let
|
85
|
-
values = {};
|
83
|
+
let values = {};
|
86
84
|
|
87
|
-
|
85
|
+
this.getFields().forEach(item => {
|
88
86
|
values[item.name || item.id] = item.value;
|
89
87
|
});
|
90
88
|
|
@@ -115,11 +113,10 @@ class Container extends BaseContainer {
|
|
115
113
|
* @param {Object} [values]
|
116
114
|
*/
|
117
115
|
reset(values={}) {
|
118
|
-
let
|
119
|
-
keys = values ? Object.keys(values) : [],
|
116
|
+
let keys = values ? Object.keys(values) : [],
|
120
117
|
index;
|
121
118
|
|
122
|
-
|
119
|
+
this.getFields().forEach(item => {
|
123
120
|
index = keys.indexOf(item.name);
|
124
121
|
|
125
122
|
if (index < 0) {
|
@@ -135,11 +132,10 @@ class Container extends BaseContainer {
|
|
135
132
|
* @param {Object} values={}
|
136
133
|
*/
|
137
134
|
setValues(values={}) {
|
138
|
-
let
|
139
|
-
keys = Object.keys(values),
|
135
|
+
let keys = Object.keys(values),
|
140
136
|
index;
|
141
137
|
|
142
|
-
|
138
|
+
this.getFields().forEach(item => {
|
143
139
|
index = keys.indexOf(item.name);
|
144
140
|
|
145
141
|
if (index < 0) {
|
@@ -157,9 +153,7 @@ class Container extends BaseContainer {
|
|
157
153
|
* This can be useful for create entity forms which show up "clean", when pressing a submit button.
|
158
154
|
*/
|
159
155
|
validate() {
|
160
|
-
|
161
|
-
|
162
|
-
fields.forEach(item => {
|
156
|
+
this.getFields().forEach(item => {
|
163
157
|
item.validate?.(false);
|
164
158
|
});
|
165
159
|
}
|