@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.
- package/dist/index.d.ts +1 -1
- package/dist/src/WebObjects/ParentWebObject.d.ts +24 -24
- package/dist/src/WebObjects/ParentWebObject.js +7 -7
- package/dist/src/WebObjects/WebObject.d.ts +153 -153
- package/dist/src/WebObjects/WebObject.js +476 -561
- package/dist/src/WebObjects/WebObjectHelper.d.ts +9 -9
- package/dist/src/WebObjects/WebObjectHelper.js +4 -4
- package/dist/src/WebObjects/WebObjectHelper.test.d.ts +1 -1
- package/dist/src/WebObjects/WebObjectHelper.test.js +1 -1
- package/dist/src/WebObjects/WebObjectManager.d.ts +68 -68
- package/dist/src/WebObjects/WebObjectManager.js +303 -350
- package/dist/src/WebObjects/WebObjectPathHelper.d.ts +36 -36
- package/dist/src/WebObjects/WebObjectPathHelper.js +31 -39
- package/dist/src/WebObjects/WebObjectPathHelper.test.d.ts +1 -1
- package/dist/src/WebObjects/WebObjectPathHelper.test.js +55 -61
- package/dist/src/index.d.ts +10 -10
- package/dist/src/structs/DummyObject.d.ts +5 -5
- package/dist/src/structs/DummyObject.js +1 -1
- package/dist/src/structs/MapableObject.d.ts +43 -43
- package/dist/src/structs/MapableObject.js +3 -3
- package/dist/src/structs/MetaObject.d.ts +15 -15
- package/dist/src/structs/MetaObject.js +19 -25
- package/dist/src/structs/ObjectArray.d.ts +10 -10
- package/dist/src/structs/ObjectArray.js +1 -1
- package/dist/src/structs/ObjectManager.d.ts +140 -140
- package/dist/src/structs/ObjectManager.js +202 -223
- package/dist/src/structs/ObjectWithTemp.d.ts +17 -17
- package/dist/src/structs/ObjectWithTemp.js +13 -17
- package/dist/src/structs/SimpleObject.d.ts +318 -303
- package/dist/src/structs/SimpleObject.js +423 -467
- 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
|
-
|
|
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
|
|
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,
|
|
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__*/
|
|
60
|
+
var _notifyChanged = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(type, key, value, subvalue) {
|
|
59
61
|
var obj, typestr;
|
|
60
|
-
return
|
|
61
|
-
while (1) switch (_context.
|
|
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.
|
|
67
|
+
_context.n = 1;
|
|
66
68
|
break;
|
|
67
69
|
}
|
|
68
|
-
return _context.
|
|
69
|
-
case
|
|
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.
|
|
74
|
+
_context.n = 2;
|
|
73
75
|
return this.event_run("on_change", typestr, value);
|
|
74
|
-
case
|
|
75
|
-
return _context.
|
|
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__*/
|
|
229
|
-
var thisobj;
|
|
230
|
-
return
|
|
231
|
-
while (1) switch (_context2.
|
|
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.
|
|
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.
|
|
240
|
-
case
|
|
241
|
-
_context2.
|
|
238
|
+
return _context2.a(2, false);
|
|
239
|
+
case 1:
|
|
240
|
+
_context2.n = 2;
|
|
242
241
|
return thisobj.set(key, value);
|
|
243
|
-
case
|
|
244
|
-
|
|
245
|
-
if (
|
|
246
|
-
_context2.
|
|
242
|
+
case 2:
|
|
243
|
+
_t = _context2.v;
|
|
244
|
+
if (_t) {
|
|
245
|
+
_context2.n = 3;
|
|
247
246
|
break;
|
|
248
247
|
}
|
|
249
|
-
|
|
250
|
-
case
|
|
251
|
-
return _context2.
|
|
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__*/
|
|
270
|
+
var _setSubValue = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(key, objKey, subvalue) {
|
|
275
271
|
var _yield$this$obj$setSu, _this$obj8;
|
|
276
|
-
|
|
277
|
-
|
|
272
|
+
var _t2, _t3, _t4;
|
|
273
|
+
return _regenerator().w(function (_context3) {
|
|
274
|
+
while (1) switch (_context3.n) {
|
|
278
275
|
case 0:
|
|
279
|
-
_context3.
|
|
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
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
if (!
|
|
285
|
-
_context3.
|
|
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
|
-
|
|
289
|
-
case
|
|
290
|
-
if (!
|
|
291
|
-
_context3.
|
|
285
|
+
_t2 = _yield$this$obj$setSu !== void 0;
|
|
286
|
+
case 2:
|
|
287
|
+
if (!_t2) {
|
|
288
|
+
_context3.n = 3;
|
|
292
289
|
break;
|
|
293
290
|
}
|
|
294
|
-
|
|
295
|
-
_context3.
|
|
291
|
+
_t4 = _yield$this$obj$setSu;
|
|
292
|
+
_context3.n = 4;
|
|
296
293
|
break;
|
|
297
|
-
case
|
|
298
|
-
|
|
299
|
-
case
|
|
300
|
-
return _context3.
|
|
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__*/
|
|
310
|
+
var _pushValue = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(key, value) {
|
|
317
311
|
var _yield$this$obj$pushV, _this$obj9;
|
|
318
|
-
|
|
319
|
-
|
|
312
|
+
var _t5, _t6, _t7;
|
|
313
|
+
return _regenerator().w(function (_context4) {
|
|
314
|
+
while (1) switch (_context4.n) {
|
|
320
315
|
case 0:
|
|
321
|
-
_context4.
|
|
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
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
if (!
|
|
327
|
-
_context4.
|
|
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
|
-
|
|
331
|
-
case
|
|
332
|
-
if (!
|
|
333
|
-
_context4.
|
|
325
|
+
_t5 = _yield$this$obj$pushV !== void 0;
|
|
326
|
+
case 2:
|
|
327
|
+
if (!_t5) {
|
|
328
|
+
_context4.n = 3;
|
|
334
329
|
break;
|
|
335
330
|
}
|
|
336
|
-
|
|
337
|
-
_context4.
|
|
331
|
+
_t7 = _yield$this$obj$pushV;
|
|
332
|
+
_context4.n = 4;
|
|
338
333
|
break;
|
|
339
|
-
case
|
|
340
|
-
|
|
341
|
-
case
|
|
342
|
-
return _context4.
|
|
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__*/
|
|
349
|
+
var _set_temp = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(key, value) {
|
|
358
350
|
var sendChanges,
|
|
359
351
|
_args5 = arguments;
|
|
360
|
-
return
|
|
361
|
-
while (1) switch (_context5.
|
|
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.
|
|
356
|
+
_context5.n = 1;
|
|
365
357
|
return this.setObjectTemp(key, value, sendChanges);
|
|
366
|
-
case
|
|
367
|
-
_context5.
|
|
358
|
+
case 1:
|
|
359
|
+
_context5.n = 2;
|
|
368
360
|
return _superPropGet(ObjectManager, "set_temp", this, 3)([key, value]);
|
|
369
|
-
case
|
|
370
|
-
return _context5.
|
|
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__*/
|
|
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
|
-
|
|
391
|
-
|
|
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.
|
|
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
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
if (!
|
|
400
|
-
_context6.
|
|
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
|
-
|
|
404
|
-
case
|
|
405
|
-
if (!
|
|
406
|
-
_context6.
|
|
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
|
-
|
|
410
|
-
_context6.
|
|
401
|
+
_t0 = _yield$this$obj$set_t;
|
|
402
|
+
_context6.n = 4;
|
|
411
403
|
break;
|
|
412
|
-
case
|
|
413
|
-
|
|
414
|
-
case
|
|
415
|
-
return _context6.
|
|
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__*/
|
|
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
|
|
464
|
-
while (1) switch (_context7.
|
|
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.
|
|
458
|
+
_context7.n = 1;
|
|
470
459
|
return _event["default"].run.apply(_event["default"], [this, eventName].concat(params));
|
|
471
|
-
case
|
|
472
|
-
return _context7.
|
|
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__*/
|
|
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
|
|
517
|
-
while (1) switch (_context8.
|
|
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.
|
|
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
|
|
530
|
-
|
|
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__*/
|
|
565
|
+
var _toggleOption = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(key, value) {
|
|
581
566
|
var oldval;
|
|
582
|
-
return
|
|
583
|
-
while (1) switch (_context9.
|
|
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.
|
|
572
|
+
_context9.n = 2;
|
|
588
573
|
break;
|
|
589
574
|
}
|
|
590
|
-
_context9.
|
|
575
|
+
_context9.n = 1;
|
|
591
576
|
return this.setOption(key, null);
|
|
592
|
-
case
|
|
593
|
-
_context9.
|
|
577
|
+
case 1:
|
|
578
|
+
_context9.n = 3;
|
|
594
579
|
break;
|
|
595
|
-
case
|
|
596
|
-
_context9.
|
|
580
|
+
case 2:
|
|
581
|
+
_context9.n = 3;
|
|
597
582
|
return this.setOption(key, value);
|
|
598
|
-
case
|
|
599
|
-
|
|
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__*/
|
|
609
|
+
var _setOption = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(key, value) {
|
|
626
610
|
var isChanged;
|
|
627
|
-
return
|
|
628
|
-
while (1) switch (_context0.
|
|
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.
|
|
622
|
+
_context0.n = 1;
|
|
639
623
|
return this.event_run("on_option_change", key, value);
|
|
640
|
-
case
|
|
641
|
-
return _context0.
|
|
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__*/
|
|
679
|
-
return
|
|
680
|
-
while (1) switch (_context1.
|
|
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.
|
|
663
|
+
_context1.p = 0;
|
|
683
664
|
this.setOption(key, value);
|
|
684
665
|
if (!(typeof action === "function")) {
|
|
685
|
-
_context1.
|
|
666
|
+
_context1.n = 1;
|
|
686
667
|
break;
|
|
687
668
|
}
|
|
688
|
-
_context1.
|
|
669
|
+
_context1.n = 1;
|
|
689
670
|
return action();
|
|
690
|
-
case
|
|
691
|
-
_context1.
|
|
671
|
+
case 1:
|
|
672
|
+
_context1.p = 1;
|
|
692
673
|
this.setOption(key, nextvalue);
|
|
693
|
-
return _context1.
|
|
694
|
-
case
|
|
695
|
-
|
|
696
|
-
return _context1.stop();
|
|
674
|
+
return _context1.f(1);
|
|
675
|
+
case 2:
|
|
676
|
+
return _context1.a(2);
|
|
697
677
|
}
|
|
698
|
-
}, _callee1, this, [[0,,
|
|
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__*/
|
|
719
|
-
return
|
|
720
|
-
while (1) switch (_context10.
|
|
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.
|
|
702
|
+
_context10.n = 1;
|
|
723
703
|
return this.setOption("ischanged", this.isChanged);
|
|
724
|
-
case
|
|
725
|
-
|
|
726
|
-
return _context10.stop();
|
|
704
|
+
case 1:
|
|
705
|
+
return _context10.a(2);
|
|
727
706
|
}
|
|
728
707
|
}, _callee10, this);
|
|
729
708
|
}));
|