@duet3d/objectmodel 3.5.0-b1 → 3.5.0-b3
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/dist/ModelDictionary.js +5 -0
- package/dist/ModelObject.js +16 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/ModelDictionary.js
CHANGED
|
@@ -57,6 +57,11 @@ class ModelDictionary extends Map {
|
|
|
57
57
|
if (jsonElement === null) {
|
|
58
58
|
this.clear();
|
|
59
59
|
}
|
|
60
|
+
else if (jsonElement instanceof Map) {
|
|
61
|
+
for (const [key, value] of jsonElement.entries()) {
|
|
62
|
+
this.set(key, value);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
60
65
|
else {
|
|
61
66
|
for (const [key, value] of Object.entries(jsonElement)) {
|
|
62
67
|
this.set(key, value);
|
package/dist/ModelObject.js
CHANGED
|
@@ -137,6 +137,22 @@ class ModelObject {
|
|
|
137
137
|
console.warn(`Incompatible string target type ${typeof value} for property ${key}`);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
+
else if (propType === "function") {
|
|
141
|
+
if (typeof value === "function") {
|
|
142
|
+
this[ownKey] = value;
|
|
143
|
+
}
|
|
144
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
145
|
+
console.warn(`Incompatible function target type ${typeof value} for property ${key}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else if (propType === "object") {
|
|
149
|
+
if (typeof value === "object") {
|
|
150
|
+
this[ownKey] = value;
|
|
151
|
+
}
|
|
152
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
153
|
+
console.warn(`Incompatible object target type ${typeof value} for property ${key}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
140
156
|
else if (process.env.NODE_ENV !== "production") {
|
|
141
157
|
console.warn(`Incompatible type ${propType} for property ${key} (${typeof value})`);
|
|
142
158
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from "./ModelCollection";
|
|
|
2
2
|
export * from "./ModelDictionary";
|
|
3
3
|
export * from "./ModelObject";
|
|
4
4
|
export * from "./boards";
|
|
5
|
-
export * from "./state";
|
|
6
5
|
export * from "./directories";
|
|
7
6
|
export * from "./fans";
|
|
8
7
|
export * from "./heat";
|
|
@@ -17,6 +16,7 @@ export * from "./plugins";
|
|
|
17
16
|
export * from "./scanner";
|
|
18
17
|
export * from "./sensors";
|
|
19
18
|
export * from "./spindles";
|
|
19
|
+
export * from "./state";
|
|
20
20
|
export * from "./tools";
|
|
21
21
|
export * from "./userSessions";
|
|
22
22
|
export * from "./volumes";
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,6 @@ __exportStar(require("./ModelCollection"), exports);
|
|
|
20
20
|
__exportStar(require("./ModelDictionary"), exports);
|
|
21
21
|
__exportStar(require("./ModelObject"), exports);
|
|
22
22
|
__exportStar(require("./boards"), exports);
|
|
23
|
-
__exportStar(require("./state"), exports);
|
|
24
23
|
__exportStar(require("./directories"), exports);
|
|
25
24
|
__exportStar(require("./fans"), exports);
|
|
26
25
|
__exportStar(require("./heat"), exports);
|
|
@@ -35,6 +34,7 @@ __exportStar(require("./plugins"), exports);
|
|
|
35
34
|
__exportStar(require("./scanner"), exports);
|
|
36
35
|
__exportStar(require("./sensors"), exports);
|
|
37
36
|
__exportStar(require("./spindles"), exports);
|
|
37
|
+
__exportStar(require("./state"), exports);
|
|
38
38
|
__exportStar(require("./tools"), exports);
|
|
39
39
|
__exportStar(require("./userSessions"), exports);
|
|
40
40
|
__exportStar(require("./volumes"), exports);
|
|
@@ -46,6 +46,8 @@ exports.default = ObjectModel_1.default;
|
|
|
46
46
|
// This will become obsolete as soon as DWC is upgraded to Vue 3, but that isn't going to happen anytime soon.
|
|
47
47
|
// Until then a Vue 2 user would have to call something like this on initialization to work around this limitation:
|
|
48
48
|
// globalThis._duetModelSetArray = (array, index, value) => Vue.set(array, index, value);
|
|
49
|
+
// or in TypeScript
|
|
50
|
+
// (globalThis as any)._duetModelSetArray = (array: object, index: string | number, value: any) => Vue.set(array, index, value);
|
|
49
51
|
globalThis._duetModelSetArray = (array, index, value) => array[index] = value;
|
|
50
52
|
function setArrayItem(array, index, value) {
|
|
51
53
|
globalThis._duetModelSetArray(array, index, value);
|