@azrico/webobject 1.5.65 → 1.5.67

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.
@@ -1,4 +1,5 @@
1
1
  import { PropOf, PropType, WriteablePropOf } from "@azrico/types";
2
+ import EventContext from "@azrico/event";
2
3
  import SimpleObject, { WithManager } from "./SimpleObject";
3
4
  import { saveResultType, sendChangesType } from "./SimpleObject";
4
5
  import { ClassType } from "@azrico/types";
@@ -7,9 +8,7 @@ import RawObject from "./MapableObject";
7
8
  * This class manages the events of an Simple Object
8
9
  */
9
10
  export declare class ObjectManager<ObjType extends SimpleObject> extends RawObject {
10
- __eventList: any;
11
- __eventPrefix?: string;
12
- __stopEvents?: boolean;
11
+ __eventContext: EventContext | {};
13
12
  protected static readonly __object_type: () => typeof SimpleObject | ClassType<SimpleObject>;
14
13
  protected __last_object_data: {
15
14
  [key: string]: string;
@@ -18,7 +17,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> extends RawObje
18
17
  protected __options?: object;
19
18
  __object_nullable: boolean;
20
19
  constructor(defaultObject?: ObjType);
21
- notifyChanged(type: string, key: PropOf<ObjType> | string, value?: any, subvalue?: string): Promise<false | any[] | undefined>;
20
+ notifyChanged(type: string, key: PropOf<ObjType> | string, value?: any, subvalue?: string): Promise<false | any[]>;
22
21
  /**
23
22
  * Get the object this manager is managing
24
23
  * @returns the object
@@ -75,7 +74,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> extends RawObje
75
74
  getIndexOrID(): number | string;
76
75
  getIndex(): number;
77
76
  getID(): string;
78
- event_run(eventName: string, ...params: any): Promise<any[] | undefined>;
77
+ event_run(eventName: string, ...params: any): Promise<any[]>;
79
78
  event_use(name: string, runEvent: (...inputdata: any) => any, onlyOn?: any, runOnce?: boolean): any;
80
79
  /**
81
80
  * only useful for getter functions that dont rely on states
@@ -85,8 +84,8 @@ export declare class ObjectManager<ObjType extends SimpleObject> extends RawObje
85
84
  * @returns
86
85
  */
87
86
  event_use_getter(name: string, runEvent: (...inputdata: any) => any, onlyOn?: any): any;
88
- event_remove(name: string, uname: string): boolean;
89
- event_add(name: string, uname: string, runEvent: (...inputdata: any) => any, onlyOn?: any, runOnce?: boolean): Promise<void>;
87
+ event_remove(name: string, uname: string): Promise<boolean | undefined>;
88
+ event_add(eventName: string, uniqueName: string, eventFunction: (...inputdata: any) => any, eventChecker?: any, runOnRegister?: boolean): Promise<void>;
90
89
  events_start(): void;
91
90
  events_stop(): void;
92
91
  events_clear(): void;
@@ -4,13 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = exports.ObjectManager = void 0;
7
- var _event = require("@azrico/event");
7
+ var _event = _interopRequireWildcard(require("@azrico/event"));
8
8
  var _SimpleObject = _interopRequireDefault(require("./SimpleObject"));
9
9
  var _string = require("@azrico/string");
10
10
  var _global = require("@azrico/global");
11
11
  var _object = require("@azrico/object");
12
12
  var _MapableObject = _interopRequireDefault(require("./MapableObject"));
13
+ var _useGetter = _interopRequireDefault(require("@azrico/event/dist/src/hooks/useGetter"));
13
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); }
14
16
  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); }
15
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; }
16
18
  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); }
@@ -39,9 +41,7 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
39
41
  var _this;
40
42
  _classCallCheck(this, ObjectManager);
41
43
  _this = _callSuper(this, ObjectManager);
42
- _defineProperty(_this, "__eventList", {});
43
- _defineProperty(_this, "__eventPrefix", void 0);
44
- _defineProperty(_this, "__stopEvents", void 0);
44
+ _defineProperty(_this, "__eventContext", {});
45
45
  _defineProperty(_this, "__last_object_data", {});
46
46
  _defineProperty(_this, "__currentObject", void 0);
47
47
  _defineProperty(_this, "__options", void 0);
@@ -213,7 +213,7 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
213
213
  }, {
214
214
  key: "use",
215
215
  value: function use(key) {
216
- return _event.EventManager.useProperty(this, key);
216
+ return (0, _event.useProperty)(this, key);
217
217
  }
218
218
  /**
219
219
  * set value
@@ -461,20 +461,14 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
461
461
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
462
462
  while (1) switch (_context7.prev = _context7.next) {
463
463
  case 0:
464
- if (!(this.__stopEvents === true)) {
465
- _context7.next = 2;
466
- break;
467
- }
468
- return _context7.abrupt("return");
469
- case 2:
470
464
  for (_len = _args7.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
471
465
  params[_key - 1] = _args7[_key];
472
466
  }
473
- _context7.next = 5;
474
- return _event.EventManager.run.apply(_event.EventManager, [this, eventName].concat(params));
475
- case 5:
467
+ _context7.next = 3;
468
+ return _event["default"].run.apply(_event["default"], [this, eventName].concat(params));
469
+ case 3:
476
470
  return _context7.abrupt("return", _context7.sent);
477
- case 6:
471
+ case 4:
478
472
  case "end":
479
473
  return _context7.stop();
480
474
  }
@@ -490,7 +484,7 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
490
484
  value: function event_use(name, runEvent) {
491
485
  var onlyOn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
492
486
  var runOnce = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
493
- return _event.EventManager.use(this, name, runEvent, onlyOn, runOnce);
487
+ return (0, _event.useEvent)(this, name, runEvent, onlyOn, runOnce);
494
488
  }
495
489
  /**
496
490
  * only useful for getter functions that dont rely on states
@@ -503,27 +497,33 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
503
497
  key: "event_use_getter",
504
498
  value: function event_use_getter(name, runEvent) {
505
499
  var onlyOn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
506
- return _event.EventManager.use_getter(this, name, runEvent, onlyOn);
500
+ return (0, _useGetter["default"])(this, name, runEvent, onlyOn);
507
501
  }
508
502
  }, {
509
503
  key: "event_remove",
510
504
  value: function event_remove(name, uname) {
511
- return _event.EventManager.remove(this, name, uname);
505
+ return _event["default"].remove(this, name, uname);
512
506
  }
513
507
  }, {
514
508
  key: "event_add",
515
509
  value: function () {
516
- var _event_add = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(name, uname, runEvent) {
517
- var onlyOn,
518
- runOnce,
510
+ var _event_add = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(eventName, uniqueName, eventFunction) {
511
+ var eventChecker,
512
+ runOnRegister,
519
513
  _args8 = arguments;
520
514
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
521
515
  while (1) switch (_context8.prev = _context8.next) {
522
516
  case 0:
523
- onlyOn = _args8.length > 3 && _args8[3] !== undefined ? _args8[3] : null;
524
- runOnce = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : false;
517
+ eventChecker = _args8.length > 3 && _args8[3] !== undefined ? _args8[3] : null;
518
+ runOnRegister = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : false;
525
519
  _context8.next = 4;
526
- return _event.EventManager.add(this, name, uname, runEvent, onlyOn, runOnce);
520
+ return _event.EventManager.add(this, {
521
+ eventName: eventName,
522
+ uniqueName: uniqueName,
523
+ eventFunction: eventFunction,
524
+ eventChecker: eventChecker,
525
+ runOnRegister: runOnRegister
526
+ });
527
527
  case 4:
528
528
  case "end":
529
529
  return _context8.stop();
@@ -538,12 +538,12 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
538
538
  }, {
539
539
  key: "events_start",
540
540
  value: function events_start() {
541
- delete this.__stopEvents;
541
+ // delete this.__stopEvents;
542
542
  }
543
543
  }, {
544
544
  key: "events_stop",
545
545
  value: function events_stop() {
546
- this.__stopEvents = true;
546
+ // this.__setopEvents = true;
547
547
  }
548
548
  }, {
549
549
  key: "events_clear",
@@ -760,7 +760,7 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
760
760
  }], [{
761
761
  key: "events_clear",
762
762
  value: function events_clear(obj) {
763
- _event.EventManager.removeAll(obj);
763
+ _event["default"].removeAll(obj);
764
764
  }
765
765
  }, {
766
766
  key: "addError",
@@ -171,7 +171,7 @@ export declare class SimpleObject extends MapableObject {
171
171
  * @param subvalue
172
172
  * @returns true if manager was notified. false otherwise
173
173
  */
174
- notifyChanged<MKey extends PropOf<this>>(type: string, key: MKey | string, value: any, subvalue?: any): Promise<false | any[] | undefined>;
174
+ notifyChanged<MKey extends PropOf<this>>(type: string, key: MKey | string, value: any, subvalue?: any): Promise<false | any[]>;
175
175
  /**
176
176
  * get a list of all keys that can be changed in given objcet
177
177
  * @param object
@@ -265,7 +265,7 @@ export declare class SimpleObject extends MapableObject {
265
265
  static getID(obj: any): string;
266
266
  event_run(eventName: string, ...params: any): Promise<any[] | undefined>;
267
267
  event_use(name: string, runEvent: (...inputdata: any) => any, onlyOn?: any, runOnce?: boolean): any;
268
- event_remove(name: string, uname: string): boolean | undefined;
268
+ event_remove(name: string, uname: string): Promise<boolean | undefined> | undefined;
269
269
  event_add(name: string, uname: string, runEvent: (...inputdata: any) => any, onlyOn?: any, runOnce?: boolean): Promise<void>;
270
270
  getOriginal(): this | undefined;
271
271
  setOriginal(toObj?: null | 0 | any): this | undefined;
@@ -20,9 +20,9 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
20
20
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
21
21
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
22
22
  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; }
23
- 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); }
24
23
  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); }
25
24
  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); }); }; }
25
+ 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); }
26
26
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
27
27
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
28
28
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
@@ -154,7 +154,11 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
154
154
  console.warn("Objects with no manager should not use useProperty");
155
155
  return this.get(key);
156
156
  }
157
- return this.manager.use(key);
157
+ var property_obj = this.manager.use(key);
158
+ if (_typeof(property_obj) === "object" && null != property_obj && key in property_obj) {
159
+ return property_obj[key];
160
+ }
161
+ return property_obj;
158
162
  }
159
163
  }, {
160
164
  key: "setDefaultValue",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.5.65",
3
+ "version": "1.5.67",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",
@@ -70,7 +70,7 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@azrico/convert": "^1.1.7",
73
- "@azrico/event": "^1.2.91",
73
+ "@azrico/event": "^1.3.8",
74
74
  "@azrico/global": "^1.3.85",
75
75
  "@azrico/math": "^1.0.5",
76
76
  "@azrico/object": "^1.4.137",