@azrico/webobject 1.4.150 → 1.4.152
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.
|
@@ -69,11 +69,12 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
|
69
69
|
case 3:
|
|
70
70
|
if (value === undefined && type != "meta") value = obj.getValue(key);
|
|
71
71
|
typestr = (type ? "$".concat(type, "$") : "") + String(key);
|
|
72
|
-
|
|
72
|
+
console.log("event_run", typestr, value);
|
|
73
|
+
_context.next = 8;
|
|
73
74
|
return this.event_run("on_change", typestr, value);
|
|
74
|
-
case 7:
|
|
75
|
-
return _context.abrupt("return", _context.sent);
|
|
76
75
|
case 8:
|
|
76
|
+
return _context.abrupt("return", _context.sent);
|
|
77
|
+
case 9:
|
|
77
78
|
case "end":
|
|
78
79
|
return _context.stop();
|
|
79
80
|
}
|
|
@@ -113,9 +114,13 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
|
113
114
|
}, {
|
|
114
115
|
key: "setObject",
|
|
115
116
|
value: function setObject(toObj) {
|
|
117
|
+
var _this2 = this;
|
|
116
118
|
this.__currentObject = toObj;
|
|
117
|
-
if (this.
|
|
118
|
-
this.
|
|
119
|
+
if (this.obj) {
|
|
120
|
+
this.obj.get_managerClass = function () {
|
|
121
|
+
return _this2;
|
|
122
|
+
};
|
|
123
|
+
// this.obj.set_managerClass(this);
|
|
119
124
|
}
|
|
120
125
|
if (toObj == null && !this.__object_nullable) {
|
|
121
126
|
console.warn("setObject was used to set null. try to use empty objects instead of null");
|
|
@@ -635,9 +640,9 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
|
635
640
|
}, {
|
|
636
641
|
key: "useOption",
|
|
637
642
|
value: function useOption(key) {
|
|
638
|
-
var
|
|
643
|
+
var _this3 = this;
|
|
639
644
|
return this.event_use_getter("on_option_change", function () {
|
|
640
|
-
return
|
|
645
|
+
return _this3.getOption(key);
|
|
641
646
|
}, [key]);
|
|
642
647
|
}
|
|
643
648
|
/**
|
|
@@ -200,7 +200,16 @@ export declare class SimpleObject extends MapableObject {
|
|
|
200
200
|
get lastChanged(): string;
|
|
201
201
|
get manager(): ObjectManager<any> | undefined;
|
|
202
202
|
get_managerClass: () => ObjectManager<any> | undefined;
|
|
203
|
-
|
|
203
|
+
/**
|
|
204
|
+
* @deprecated use setManager
|
|
205
|
+
* @param mng
|
|
206
|
+
*/
|
|
207
|
+
set_managerClass(mng: any): boolean | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* update the manager class for this object
|
|
210
|
+
* @param mng
|
|
211
|
+
*/
|
|
212
|
+
setManager(mng: any): boolean | undefined;
|
|
204
213
|
static isDeleted<T extends SimpleObject>(obj: T): boolean;
|
|
205
214
|
getIndexOrID(): number | string;
|
|
206
215
|
getIndex(): number;
|
|
@@ -184,9 +184,8 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
184
184
|
_context.next = 13;
|
|
185
185
|
return this.notifyChanged("", key, value);
|
|
186
186
|
case 13:
|
|
187
|
-
console.log("setValue", key, value, isValueChanged);
|
|
188
187
|
return _context.abrupt("return", isValueChanged);
|
|
189
|
-
case
|
|
188
|
+
case 14:
|
|
190
189
|
case "end":
|
|
191
190
|
return _context.stop();
|
|
192
191
|
}
|
|
@@ -617,16 +616,17 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
617
616
|
/* --------------------------- notify the manager --------------------------- */
|
|
618
617
|
manager_class = this.manager;
|
|
619
618
|
if (!(typeof (manager_class === null || manager_class === void 0 ? void 0 : manager_class.notifyChanged) === "function")) {
|
|
620
|
-
_context11.next =
|
|
619
|
+
_context11.next = 12;
|
|
621
620
|
break;
|
|
622
621
|
}
|
|
623
|
-
|
|
622
|
+
console.log("notify manager", type, key, value);
|
|
623
|
+
_context11.next = 11;
|
|
624
624
|
return manager_class.notifyChanged(type, key, value, subvalue);
|
|
625
|
-
case 10:
|
|
626
|
-
return _context11.abrupt("return", _context11.sent);
|
|
627
625
|
case 11:
|
|
628
|
-
return _context11.abrupt("return",
|
|
626
|
+
return _context11.abrupt("return", _context11.sent);
|
|
629
627
|
case 12:
|
|
628
|
+
return _context11.abrupt("return", false);
|
|
629
|
+
case 13:
|
|
630
630
|
case "end":
|
|
631
631
|
return _context11.stop();
|
|
632
632
|
}
|
|
@@ -927,10 +927,25 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
927
927
|
}
|
|
928
928
|
}, {
|
|
929
929
|
key: "set_managerClass",
|
|
930
|
-
value:
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
930
|
+
value:
|
|
931
|
+
/**
|
|
932
|
+
* @deprecated use setManager
|
|
933
|
+
* @param mng
|
|
934
|
+
*/
|
|
935
|
+
function set_managerClass(mng) {
|
|
936
|
+
return this.setManager(mng);
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* update the manager class for this object
|
|
940
|
+
* @param mng
|
|
941
|
+
*/
|
|
942
|
+
}, {
|
|
943
|
+
key: "setManager",
|
|
944
|
+
value: function setManager(mng) {
|
|
945
|
+
if (mng instanceof _ObjectManager["default"] && typeof mng.setObject === "function") {
|
|
946
|
+
//make sure the manager knows what object it is managing
|
|
947
|
+
return mng.setObject(this);
|
|
948
|
+
} else {
|
|
934
949
|
console.error("set_managerClass was used with a bad manager. make sure the input to this function is a correct ObjectManager");
|
|
935
950
|
}
|
|
936
951
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azrico/webobject",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.152",
|
|
4
4
|
"description": "Stateful object",
|
|
5
5
|
"author": "Azrideus",
|
|
6
6
|
"license": "MIT",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@azrico/convert": "^1.0.5",
|
|
73
|
-
"@azrico/event": "^1.2.
|
|
74
|
-
"@azrico/global": "^1.3.
|
|
73
|
+
"@azrico/event": "^1.2.43",
|
|
74
|
+
"@azrico/global": "^1.3.78",
|
|
75
75
|
"@azrico/math": "^1.0.5",
|
|
76
76
|
"@azrico/object": "^1.4.101",
|
|
77
77
|
"@azrico/string": "^1.2.95",
|