@azrico/webobject 1.5.70 → 1.5.71

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.
Files changed (31) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/src/WebObjects/ParentWebObject.d.ts +24 -24
  3. package/dist/src/WebObjects/ParentWebObject.js +7 -7
  4. package/dist/src/WebObjects/WebObject.d.ts +153 -153
  5. package/dist/src/WebObjects/WebObject.js +476 -561
  6. package/dist/src/WebObjects/WebObjectHelper.d.ts +9 -9
  7. package/dist/src/WebObjects/WebObjectHelper.js +4 -4
  8. package/dist/src/WebObjects/WebObjectHelper.test.d.ts +1 -1
  9. package/dist/src/WebObjects/WebObjectHelper.test.js +1 -1
  10. package/dist/src/WebObjects/WebObjectManager.d.ts +68 -68
  11. package/dist/src/WebObjects/WebObjectManager.js +303 -350
  12. package/dist/src/WebObjects/WebObjectPathHelper.d.ts +36 -36
  13. package/dist/src/WebObjects/WebObjectPathHelper.js +31 -39
  14. package/dist/src/WebObjects/WebObjectPathHelper.test.d.ts +1 -1
  15. package/dist/src/WebObjects/WebObjectPathHelper.test.js +55 -61
  16. package/dist/src/index.d.ts +10 -10
  17. package/dist/src/structs/DummyObject.d.ts +5 -5
  18. package/dist/src/structs/DummyObject.js +1 -1
  19. package/dist/src/structs/MapableObject.d.ts +43 -43
  20. package/dist/src/structs/MapableObject.js +3 -3
  21. package/dist/src/structs/MetaObject.d.ts +15 -15
  22. package/dist/src/structs/MetaObject.js +19 -25
  23. package/dist/src/structs/ObjectArray.d.ts +10 -10
  24. package/dist/src/structs/ObjectArray.js +1 -1
  25. package/dist/src/structs/ObjectManager.d.ts +140 -140
  26. package/dist/src/structs/ObjectManager.js +202 -223
  27. package/dist/src/structs/ObjectWithTemp.d.ts +17 -17
  28. package/dist/src/structs/ObjectWithTemp.js +13 -17
  29. package/dist/src/structs/SimpleObject.d.ts +318 -303
  30. package/dist/src/structs/SimpleObject.js +423 -467
  31. package/package.json +63 -82
@@ -12,9 +12,11 @@ var _object = require("@azrico/object");
12
12
  var _MapableObject2 = _interopRequireDefault(require("./MapableObject"));
13
13
  var _useGetter = _interopRequireDefault(require("@azrico/event/dist/src/hooks/useGetter"));
14
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
15
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
15
+ var cache;
16
+ function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, "default": e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
16
17
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
17
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return Object.defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = Object.getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); function g(t) { ["next", "throw", "return"].forEach(function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(_typeof(r) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
18
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
19
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
18
20
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
19
21
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
20
22
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -32,9 +34,9 @@ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new T
32
34
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
33
35
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
34
36
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
35
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
36
- /**
37
- * This class manages the events of an Simple Object
37
+ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
38
+ /**
39
+ * This class manages the events of an Simple Object
38
40
  */
39
41
  var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObject) {
40
42
  function ObjectManager(defaultObject) {
@@ -55,27 +57,24 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
55
57
  return _createClass(ObjectManager, [{
56
58
  key: "notifyChanged",
57
59
  value: function () {
58
- var _notifyChanged = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(type, key, value, subvalue) {
60
+ var _notifyChanged = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(type, key, value, subvalue) {
59
61
  var obj, typestr;
60
- return _regeneratorRuntime().wrap(function _callee$(_context) {
61
- while (1) switch (_context.prev = _context.next) {
62
+ return _regenerator().w(function (_context) {
63
+ while (1) switch (_context.n) {
62
64
  case 0:
63
65
  obj = this.getObject();
64
66
  if (obj) {
65
- _context.next = 3;
67
+ _context.n = 1;
66
68
  break;
67
69
  }
68
- return _context.abrupt("return", false);
69
- case 3:
70
+ return _context.a(2, false);
71
+ case 1:
70
72
  if (value === undefined && type != "meta") value = obj.get(key);
71
73
  typestr = (type ? "$".concat(type, "$") : "") + String(key);
72
- _context.next = 7;
74
+ _context.n = 2;
73
75
  return this.event_run("on_change", typestr, value);
74
- case 7:
75
- return _context.abrupt("return", _context.sent);
76
- case 8:
77
- case "end":
78
- return _context.stop();
76
+ case 2:
77
+ return _context.a(2, _context.v);
79
78
  }
80
79
  }, _callee, this);
81
80
  }));
@@ -85,9 +84,9 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
85
84
  return notifyChanged;
86
85
  }()
87
86
  /* -------------------------------------------------------------------------- */
88
- /**
89
- * Get the object this manager is managing
90
- * @returns the object
87
+ /**
88
+ * Get the object this manager is managing
89
+ * @returns the object
91
90
  */
92
91
  }, {
93
92
  key: "obj",
@@ -95,9 +94,9 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
95
94
  var _this$__currentObject;
96
95
  return (_this$__currentObject = this.__currentObject) !== null && _this$__currentObject !== void 0 ? _this$__currentObject : undefined;
97
96
  }
98
- /**
99
- * Get the object this manager is managing
100
- * @returns the object
97
+ /**
98
+ * Get the object this manager is managing
99
+ * @returns the object
101
100
  */
102
101
  }, {
103
102
  key: "getObject",
@@ -105,10 +104,10 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
105
104
  var _this$__currentObject2;
106
105
  return (_this$__currentObject2 = this.__currentObject) !== null && _this$__currentObject2 !== void 0 ? _this$__currentObject2 : undefined;
107
106
  }
108
- /**
109
- * Set the object this manager is managing
110
- * @param toObj
111
- * @returns
107
+ /**
108
+ * Set the object this manager is managing
109
+ * @param toObj
110
+ * @returns
112
111
  */
113
112
  }, {
114
113
  key: "setObject",
@@ -207,51 +206,48 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
207
206
  }
208
207
  return thisobj.get(key, original);
209
208
  }
210
- /**
211
- * use a property from the object, this will return latest value of the property
212
- * uses `EventManager` to detect changes
209
+ /**
210
+ * use a property from the object, this will return latest value of the property
211
+ * uses `EventManager` to detect changes
213
212
  */
214
213
  }, {
215
214
  key: "use",
216
215
  value: function use(key) {
217
216
  return (0, _event.useProperty)(this, key);
218
217
  }
219
- /**
220
- * set value
221
- * @param key
222
- * @param value
223
- * @return true if changed , false otherwise
218
+ /**
219
+ * set value
220
+ * @param key
221
+ * @param value
222
+ * @return true if changed , false otherwise
224
223
  */
225
224
  }, {
226
225
  key: "set",
227
226
  value: (function () {
228
- var _set = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(key, value) {
229
- var thisobj;
230
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
231
- while (1) switch (_context2.prev = _context2.next) {
227
+ var _set = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(key, value) {
228
+ var thisobj, _t;
229
+ return _regenerator().w(function (_context2) {
230
+ while (1) switch (_context2.n) {
232
231
  case 0:
233
232
  thisobj = this.obj;
234
233
  if (!(thisobj == null || typeof thisobj.set != "function")) {
235
- _context2.next = 4;
234
+ _context2.n = 1;
236
235
  break;
237
236
  }
238
237
  if (!this.__object_nullable) console.error("cant use set when object is not defined. maybe you have to use New() ?");
239
- return _context2.abrupt("return", false);
240
- case 4:
241
- _context2.next = 6;
238
+ return _context2.a(2, false);
239
+ case 1:
240
+ _context2.n = 2;
242
241
  return thisobj.set(key, value);
243
- case 6:
244
- _context2.t0 = _context2.sent;
245
- if (_context2.t0) {
246
- _context2.next = 9;
242
+ case 2:
243
+ _t = _context2.v;
244
+ if (_t) {
245
+ _context2.n = 3;
247
246
  break;
248
247
  }
249
- _context2.t0 = false;
250
- case 9:
251
- return _context2.abrupt("return", _context2.t0);
252
- case 10:
253
- case "end":
254
- return _context2.stop();
248
+ _t = false;
249
+ case 3:
250
+ return _context2.a(2, _t);
255
251
  }
256
252
  }, _callee2, this);
257
253
  }));
@@ -260,47 +256,45 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
260
256
  }
261
257
  return set;
262
258
  }()
263
- /**
264
- * set key of subObject
265
- * @param key
266
- * @param value
267
- * @param subvalue
268
- * @return true if changed , false otherwise
259
+ /**
260
+ * set key of subObject
261
+ * @param key
262
+ * @param value
263
+ * @param subvalue
264
+ * @return true if changed , false otherwise
269
265
  */
270
266
  )
271
267
  }, {
272
268
  key: "setSubValue",
273
269
  value: (function () {
274
- var _setSubValue = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(key, objKey, subvalue) {
270
+ var _setSubValue = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(key, objKey, subvalue) {
275
271
  var _yield$this$obj$setSu, _this$obj8;
276
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
277
- while (1) switch (_context3.prev = _context3.next) {
272
+ var _t2, _t3, _t4;
273
+ return _regenerator().w(function (_context3) {
274
+ while (1) switch (_context3.n) {
278
275
  case 0:
279
- _context3.next = 2;
276
+ _context3.n = 1;
280
277
  return (_this$obj8 = this.obj) === null || _this$obj8 === void 0 ? void 0 : _this$obj8.setSubValue(key, objKey, subvalue);
281
- case 2:
282
- _context3.t1 = _yield$this$obj$setSu = _context3.sent;
283
- _context3.t0 = _context3.t1 !== null;
284
- if (!_context3.t0) {
285
- _context3.next = 6;
278
+ case 1:
279
+ _t3 = _yield$this$obj$setSu = _context3.v;
280
+ _t2 = _t3 !== null;
281
+ if (!_t2) {
282
+ _context3.n = 2;
286
283
  break;
287
284
  }
288
- _context3.t0 = _yield$this$obj$setSu !== void 0;
289
- case 6:
290
- if (!_context3.t0) {
291
- _context3.next = 10;
285
+ _t2 = _yield$this$obj$setSu !== void 0;
286
+ case 2:
287
+ if (!_t2) {
288
+ _context3.n = 3;
292
289
  break;
293
290
  }
294
- _context3.t2 = _yield$this$obj$setSu;
295
- _context3.next = 11;
291
+ _t4 = _yield$this$obj$setSu;
292
+ _context3.n = 4;
296
293
  break;
297
- case 10:
298
- _context3.t2 = false;
299
- case 11:
300
- return _context3.abrupt("return", _context3.t2);
301
- case 12:
302
- case "end":
303
- return _context3.stop();
294
+ case 3:
295
+ _t4 = false;
296
+ case 4:
297
+ return _context3.a(2, _t4);
304
298
  }
305
299
  }, _callee3, this);
306
300
  }));
@@ -313,36 +307,34 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
313
307
  }, {
314
308
  key: "pushValue",
315
309
  value: function () {
316
- var _pushValue = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(key, value) {
310
+ var _pushValue = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(key, value) {
317
311
  var _yield$this$obj$pushV, _this$obj9;
318
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
319
- while (1) switch (_context4.prev = _context4.next) {
312
+ var _t5, _t6, _t7;
313
+ return _regenerator().w(function (_context4) {
314
+ while (1) switch (_context4.n) {
320
315
  case 0:
321
- _context4.next = 2;
316
+ _context4.n = 1;
322
317
  return (_this$obj9 = this.obj) === null || _this$obj9 === void 0 ? void 0 : _this$obj9.pushValue(key, value);
323
- case 2:
324
- _context4.t1 = _yield$this$obj$pushV = _context4.sent;
325
- _context4.t0 = _context4.t1 !== null;
326
- if (!_context4.t0) {
327
- _context4.next = 6;
318
+ case 1:
319
+ _t6 = _yield$this$obj$pushV = _context4.v;
320
+ _t5 = _t6 !== null;
321
+ if (!_t5) {
322
+ _context4.n = 2;
328
323
  break;
329
324
  }
330
- _context4.t0 = _yield$this$obj$pushV !== void 0;
331
- case 6:
332
- if (!_context4.t0) {
333
- _context4.next = 10;
325
+ _t5 = _yield$this$obj$pushV !== void 0;
326
+ case 2:
327
+ if (!_t5) {
328
+ _context4.n = 3;
334
329
  break;
335
330
  }
336
- _context4.t2 = _yield$this$obj$pushV;
337
- _context4.next = 11;
331
+ _t7 = _yield$this$obj$pushV;
332
+ _context4.n = 4;
338
333
  break;
339
- case 10:
340
- _context4.t2 = false;
341
- case 11:
342
- return _context4.abrupt("return", _context4.t2);
343
- case 12:
344
- case "end":
345
- return _context4.stop();
334
+ case 3:
335
+ _t7 = false;
336
+ case 4:
337
+ return _context4.a(2, _t7);
346
338
  }
347
339
  }, _callee4, this);
348
340
  }));
@@ -354,23 +346,20 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
354
346
  }, {
355
347
  key: "set_temp",
356
348
  value: function () {
357
- var _set_temp = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, value) {
349
+ var _set_temp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(key, value) {
358
350
  var sendChanges,
359
351
  _args5 = arguments;
360
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
361
- while (1) switch (_context5.prev = _context5.next) {
352
+ return _regenerator().w(function (_context5) {
353
+ while (1) switch (_context5.n) {
362
354
  case 0:
363
355
  sendChanges = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : false;
364
- _context5.next = 3;
356
+ _context5.n = 1;
365
357
  return this.setObjectTemp(key, value, sendChanges);
366
- case 3:
367
- _context5.next = 5;
358
+ case 1:
359
+ _context5.n = 2;
368
360
  return _superPropGet(ObjectManager, "set_temp", this, 3)([key, value]);
369
- case 5:
370
- return _context5.abrupt("return", _context5.sent);
371
- case 6:
372
- case "end":
373
- return _context5.stop();
361
+ case 2:
362
+ return _context5.a(2, _context5.v);
374
363
  }
375
364
  }, _callee5, this);
376
365
  }));
@@ -383,39 +372,39 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
383
372
  key: "setObjectTemp",
384
373
  value: //set temp value of object
385
374
  function () {
386
- var _setObjectTemp = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(key, value) {
375
+ var _setObjectTemp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(key, value) {
387
376
  var _yield$this$obj$set_t, _this$obj0;
388
377
  var sendChanges,
389
- _args6 = arguments;
390
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
391
- while (1) switch (_context6.prev = _context6.next) {
378
+ _args6 = arguments,
379
+ _t8,
380
+ _t9,
381
+ _t0;
382
+ return _regenerator().w(function (_context6) {
383
+ while (1) switch (_context6.n) {
392
384
  case 0:
393
385
  sendChanges = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : false;
394
- _context6.next = 3;
386
+ _context6.n = 1;
395
387
  return (_this$obj0 = this.obj) === null || _this$obj0 === void 0 ? void 0 : _this$obj0.set_temp(key, value, sendChanges);
396
- case 3:
397
- _context6.t1 = _yield$this$obj$set_t = _context6.sent;
398
- _context6.t0 = _context6.t1 !== null;
399
- if (!_context6.t0) {
400
- _context6.next = 7;
388
+ case 1:
389
+ _t9 = _yield$this$obj$set_t = _context6.v;
390
+ _t8 = _t9 !== null;
391
+ if (!_t8) {
392
+ _context6.n = 2;
401
393
  break;
402
394
  }
403
- _context6.t0 = _yield$this$obj$set_t !== void 0;
404
- case 7:
405
- if (!_context6.t0) {
406
- _context6.next = 11;
395
+ _t8 = _yield$this$obj$set_t !== void 0;
396
+ case 2:
397
+ if (!_t8) {
398
+ _context6.n = 3;
407
399
  break;
408
400
  }
409
- _context6.t2 = _yield$this$obj$set_t;
410
- _context6.next = 12;
401
+ _t0 = _yield$this$obj$set_t;
402
+ _context6.n = 4;
411
403
  break;
412
- case 11:
413
- _context6.t2 = false;
414
- case 12:
415
- return _context6.abrupt("return", _context6.t2);
416
- case 13:
417
- case "end":
418
- return _context6.stop();
404
+ case 3:
405
+ _t0 = false;
406
+ case 4:
407
+ return _context6.a(2, _t0);
419
408
  }
420
409
  }, _callee6, this);
421
410
  }));
@@ -455,24 +444,21 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
455
444
  }, {
456
445
  key: "event_run",
457
446
  value: (function () {
458
- var _event_run = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(eventName) {
447
+ var _event_run = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(eventName) {
459
448
  var _len,
460
449
  params,
461
450
  _key,
462
451
  _args7 = arguments;
463
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
464
- while (1) switch (_context7.prev = _context7.next) {
452
+ return _regenerator().w(function (_context7) {
453
+ while (1) switch (_context7.n) {
465
454
  case 0:
466
455
  for (_len = _args7.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
467
456
  params[_key - 1] = _args7[_key];
468
457
  }
469
- _context7.next = 3;
458
+ _context7.n = 1;
470
459
  return _event["default"].run.apply(_event["default"], [this, eventName].concat(params));
471
- case 3:
472
- return _context7.abrupt("return", _context7.sent);
473
- case 4:
474
- case "end":
475
- return _context7.stop();
460
+ case 1:
461
+ return _context7.a(2, _context7.v);
476
462
  }
477
463
  }, _callee7, this);
478
464
  }));
@@ -488,12 +474,12 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
488
474
  var runOnce = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
489
475
  return (0, _event.useEvent)(this, name, runEvent, onlyOn, runOnce);
490
476
  }
491
- /**
492
- * only useful for getter functions that dont rely on states
493
- * @param name
494
- * @param runEvent
495
- * @param onlyOn
496
- * @returns
477
+ /**
478
+ * only useful for getter functions that dont rely on states
479
+ * @param name
480
+ * @param runEvent
481
+ * @param onlyOn
482
+ * @returns
497
483
  */
498
484
  }, {
499
485
  key: "event_use_getter",
@@ -509,16 +495,16 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
509
495
  }, {
510
496
  key: "event_add",
511
497
  value: function () {
512
- var _event_add = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(eventName, uniqueName, eventFunction) {
498
+ var _event_add = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(eventName, uniqueName, eventFunction) {
513
499
  var eventChecker,
514
500
  runOnRegister,
515
501
  _args8 = arguments;
516
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
517
- while (1) switch (_context8.prev = _context8.next) {
502
+ return _regenerator().w(function (_context8) {
503
+ while (1) switch (_context8.n) {
518
504
  case 0:
519
505
  eventChecker = _args8.length > 3 && _args8[3] !== undefined ? _args8[3] : null;
520
506
  runOnRegister = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : false;
521
- _context8.next = 4;
507
+ _context8.n = 1;
522
508
  return _event.EventManager.add(this, {
523
509
  eventName: eventName,
524
510
  uniqueName: uniqueName,
@@ -526,9 +512,8 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
526
512
  eventChecker: eventChecker,
527
513
  runOnRegister: runOnRegister
528
514
  });
529
- case 4:
530
- case "end":
531
- return _context8.stop();
515
+ case 1:
516
+ return _context8.a(2);
532
517
  }
533
518
  }, _callee8, this);
534
519
  }));
@@ -570,34 +555,33 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
570
555
  /* -------------------------------------------------------------------------- */
571
556
  /* Options */
572
557
  /* -------------------------------------------------------------------------- */
573
- /**
574
- * Set an option to some value, if its already equal to the value it will be deleted instead
575
- * @param key
576
- * @param value
577
- * @returns
558
+ /**
559
+ * Set an option to some value, if its already equal to the value it will be deleted instead
560
+ * @param key
561
+ * @param value
562
+ * @returns
578
563
  */
579
564
  function () {
580
- var _toggleOption = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(key, value) {
565
+ var _toggleOption = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(key, value) {
581
566
  var oldval;
582
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
583
- while (1) switch (_context9.prev = _context9.next) {
567
+ return _regenerator().w(function (_context9) {
568
+ while (1) switch (_context9.n) {
584
569
  case 0:
585
570
  oldval = this.getOption(key);
586
571
  if (!(0, _object.object_equals_loose)(oldval, value)) {
587
- _context9.next = 6;
572
+ _context9.n = 2;
588
573
  break;
589
574
  }
590
- _context9.next = 4;
575
+ _context9.n = 1;
591
576
  return this.setOption(key, null);
592
- case 4:
593
- _context9.next = 8;
577
+ case 1:
578
+ _context9.n = 3;
594
579
  break;
595
- case 6:
596
- _context9.next = 8;
580
+ case 2:
581
+ _context9.n = 3;
597
582
  return this.setOption(key, value);
598
- case 8:
599
- case "end":
600
- return _context9.stop();
583
+ case 3:
584
+ return _context9.a(2);
601
585
  }
602
586
  }, _callee9, this);
603
587
  }));
@@ -613,19 +597,19 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
613
597
  key = key.toLowerCase();
614
598
  return this.__options[key];
615
599
  }
616
- /**
617
- * updates `__options` and runs the `event_run`
618
- * @param key
619
- * @param value
620
- * @returns true if changed, false otherwise
600
+ /**
601
+ * updates `__options` and runs the `event_run`
602
+ * @param key
603
+ * @param value
604
+ * @returns true if changed, false otherwise
621
605
  */
622
606
  }, {
623
607
  key: "setOption",
624
608
  value: (function () {
625
- var _setOption = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee0(key, value) {
609
+ var _setOption = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(key, value) {
626
610
  var isChanged;
627
- return _regeneratorRuntime().wrap(function _callee0$(_context0) {
628
- while (1) switch (_context0.prev = _context0.next) {
611
+ return _regenerator().w(function (_context0) {
612
+ while (1) switch (_context0.n) {
629
613
  case 0:
630
614
  if (this.__options == null) this.__options = {};
631
615
  key = key.toLowerCase();
@@ -635,13 +619,10 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
635
619
  } else {
636
620
  this.__options[key] = value;
637
621
  }
638
- _context0.next = 6;
622
+ _context0.n = 1;
639
623
  return this.event_run("on_option_change", key, value);
640
- case 6:
641
- return _context0.abrupt("return", isChanged);
642
- case 7:
643
- case "end":
644
- return _context0.stop();
624
+ case 1:
625
+ return _context0.a(2, isChanged);
645
626
  }
646
627
  }, _callee0, this);
647
628
  }));
@@ -650,10 +631,10 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
650
631
  }
651
632
  return setOption;
652
633
  }()
653
- /**
654
- * use an option and detect its changes in real time. similar to React state
655
- * @param key name of the option
656
- * @returns value of the option
634
+ /**
635
+ * use an option and detect its changes in real time. similar to React state
636
+ * @param key name of the option
637
+ * @returns value of the option
657
638
  */
658
639
  )
659
640
  }, {
@@ -664,38 +645,37 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
664
645
  return _this3.getOption(key);
665
646
  }, [key]);
666
647
  }
667
- /**
668
- * Sets an option then does an action,
669
- * after the action is run, updates the option again
670
- * @param key
671
- * @param value
672
- * @param nextvalue
673
- * @param action
648
+ /**
649
+ * Sets an option then does an action,
650
+ * after the action is run, updates the option again
651
+ * @param key
652
+ * @param value
653
+ * @param nextvalue
654
+ * @param action
674
655
  */
675
656
  }, {
676
657
  key: "holdOption",
677
658
  value: (function () {
678
- var _holdOption = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee1(key, value, nextvalue, action) {
679
- return _regeneratorRuntime().wrap(function _callee1$(_context1) {
680
- while (1) switch (_context1.prev = _context1.next) {
659
+ var _holdOption = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(key, value, nextvalue, action) {
660
+ return _regenerator().w(function (_context1) {
661
+ while (1) switch (_context1.p = _context1.n) {
681
662
  case 0:
682
- _context1.prev = 0;
663
+ _context1.p = 0;
683
664
  this.setOption(key, value);
684
665
  if (!(typeof action === "function")) {
685
- _context1.next = 5;
666
+ _context1.n = 1;
686
667
  break;
687
668
  }
688
- _context1.next = 5;
669
+ _context1.n = 1;
689
670
  return action();
690
- case 5:
691
- _context1.prev = 5;
671
+ case 1:
672
+ _context1.p = 1;
692
673
  this.setOption(key, nextvalue);
693
- return _context1.finish(5);
694
- case 8:
695
- case "end":
696
- return _context1.stop();
674
+ return _context1.f(1);
675
+ case 2:
676
+ return _context1.a(2);
697
677
  }
698
- }, _callee1, this, [[0,, 5, 8]]);
678
+ }, _callee1, this, [[0,, 1, 2]]);
699
679
  }));
700
680
  function holdOption(_x22, _x23, _x24, _x25) {
701
681
  return _holdOption.apply(this, arguments);
@@ -703,8 +683,8 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
703
683
  return holdOption;
704
684
  }()
705
685
  /* ------------------------------ useIsChanged; ----------------------------- */
706
- /**
707
- * @returns isChanged
686
+ /**
687
+ * @returns isChanged
708
688
  */
709
689
  )
710
690
  }, {
@@ -715,15 +695,14 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObjec
715
695
  }, {
716
696
  key: "checkIsChanged",
717
697
  value: function () {
718
- var _checkIsChanged = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
719
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
720
- while (1) switch (_context10.prev = _context10.next) {
698
+ var _checkIsChanged = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
699
+ return _regenerator().w(function (_context10) {
700
+ while (1) switch (_context10.n) {
721
701
  case 0:
722
- _context10.next = 2;
702
+ _context10.n = 1;
723
703
  return this.setOption("ischanged", this.isChanged);
724
- case 2:
725
- case "end":
726
- return _context10.stop();
704
+ case 1:
705
+ return _context10.a(2);
727
706
  }
728
707
  }, _callee10, this);
729
708
  }));