@azrico/webobject 1.4.151 → 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.
@@ -114,9 +114,13 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
114
114
  }, {
115
115
  key: "setObject",
116
116
  value: function setObject(toObj) {
117
+ var _this2 = this;
117
118
  this.__currentObject = toObj;
118
- if (this.__currentObject) {
119
- this.__currentObject.set_managerClass(this);
119
+ if (this.obj) {
120
+ this.obj.get_managerClass = function () {
121
+ return _this2;
122
+ };
123
+ // this.obj.set_managerClass(this);
120
124
  }
121
125
  if (toObj == null && !this.__object_nullable) {
122
126
  console.warn("setObject was used to set null. try to use empty objects instead of null");
@@ -636,9 +640,9 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
636
640
  }, {
637
641
  key: "useOption",
638
642
  value: function useOption(key) {
639
- var _this2 = this;
643
+ var _this3 = this;
640
644
  return this.event_use_getter("on_option_change", function () {
641
- return _this2.getOption(key);
645
+ return _this3.getOption(key);
642
646
  }, [key]);
643
647
  }
644
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
- set_managerClass(mng: any): void;
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;
@@ -927,10 +927,25 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
927
927
  }
928
928
  }, {
929
929
  key: "set_managerClass",
930
- value: function set_managerClass(mng) {
931
- if (mng instanceof _ObjectManager["default"] && typeof mng.event_run === "function") this.get_managerClass = function () {
932
- return mng;
933
- };else {
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.151",
3
+ "version": "1.4.152",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",