@azrico/webobject 1.5.67 → 1.5.69
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/src/structs/ObjectManager.d.ts +4 -3
- package/dist/src/structs/ObjectManager.js +19 -17
- package/dist/src/structs/ObjectWithTemp.d.ts +3 -2
- package/dist/src/structs/ObjectWithTemp.js +19 -23
- package/dist/src/structs/SimpleObject.d.ts +2 -1
- package/dist/src/structs/SimpleObject.js +13 -11
- package/package.json +1 -1
|
@@ -3,11 +3,11 @@ import EventContext from "@azrico/event";
|
|
|
3
3
|
import SimpleObject, { WithManager } from "./SimpleObject";
|
|
4
4
|
import { saveResultType, sendChangesType } from "./SimpleObject";
|
|
5
5
|
import { ClassType } from "@azrico/types";
|
|
6
|
-
import
|
|
6
|
+
import MapableObject from "./MapableObject";
|
|
7
7
|
/**
|
|
8
8
|
* This class manages the events of an Simple Object
|
|
9
9
|
*/
|
|
10
|
-
export declare class ObjectManager<ObjType extends SimpleObject> extends
|
|
10
|
+
export declare class ObjectManager<ObjType extends SimpleObject> extends MapableObject {
|
|
11
11
|
__eventContext: EventContext | {};
|
|
12
12
|
protected static readonly __object_type: () => typeof SimpleObject | ClassType<SimpleObject>;
|
|
13
13
|
protected __last_object_data: {
|
|
@@ -68,7 +68,8 @@ export declare class ObjectManager<ObjType extends SimpleObject> extends RawObje
|
|
|
68
68
|
*/
|
|
69
69
|
setSubValue(key: PropOf<ObjType>, objKey: string, subvalue: any): Promise<boolean>;
|
|
70
70
|
pushValue(key: PropOf<ObjType>, value: any): Promise<false | NonNullable<Awaited<ObjType[any]>>>;
|
|
71
|
-
|
|
71
|
+
set_temp(key: string, value: any, sendChanges?: sendChangesType): Promise<boolean>;
|
|
72
|
+
setTemp: (key: string, value: any, sendChanges?: sendChangesType) => Promise<boolean>;
|
|
72
73
|
setObjectTemp(key: string, value: any, sendChanges?: sendChangesType): Promise<boolean>;
|
|
73
74
|
getObjectTemp(key: string): any;
|
|
74
75
|
getIndexOrID(): number | string;
|
|
@@ -9,7 +9,7 @@ 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
|
-
var
|
|
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
|
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); }
|
|
@@ -36,7 +36,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
36
36
|
/**
|
|
37
37
|
* This class manages the events of an Simple Object
|
|
38
38
|
*/
|
|
39
|
-
var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (
|
|
39
|
+
var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_MapableObject) {
|
|
40
40
|
function ObjectManager(defaultObject) {
|
|
41
41
|
var _this;
|
|
42
42
|
_classCallCheck(this, ObjectManager);
|
|
@@ -47,10 +47,11 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
|
47
47
|
_defineProperty(_this, "__options", void 0);
|
|
48
48
|
//can the current object be set to null safely?
|
|
49
49
|
_defineProperty(_this, "__object_nullable", false);
|
|
50
|
+
_defineProperty(_this, "setTemp", _this.set_temp);
|
|
50
51
|
_this.setObject(defaultObject);
|
|
51
52
|
return _this;
|
|
52
53
|
}
|
|
53
|
-
_inherits(ObjectManager,
|
|
54
|
+
_inherits(ObjectManager, _MapableObject);
|
|
54
55
|
return _createClass(ObjectManager, [{
|
|
55
56
|
key: "notifyChanged",
|
|
56
57
|
value: function () {
|
|
@@ -351,9 +352,9 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
|
351
352
|
return pushValue;
|
|
352
353
|
}() //set temp value of object
|
|
353
354
|
}, {
|
|
354
|
-
key: "
|
|
355
|
+
key: "set_temp",
|
|
355
356
|
value: function () {
|
|
356
|
-
var
|
|
357
|
+
var _set_temp = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, value) {
|
|
357
358
|
var sendChanges,
|
|
358
359
|
_args5 = arguments;
|
|
359
360
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
@@ -364,7 +365,7 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
|
364
365
|
return this.setObjectTemp(key, value, sendChanges);
|
|
365
366
|
case 3:
|
|
366
367
|
_context5.next = 5;
|
|
367
|
-
return _superPropGet(ObjectManager, "
|
|
368
|
+
return _superPropGet(ObjectManager, "set_temp", this, 3)([key, value]);
|
|
368
369
|
case 5:
|
|
369
370
|
return _context5.abrupt("return", _context5.sent);
|
|
370
371
|
case 6:
|
|
@@ -373,16 +374,17 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
|
373
374
|
}
|
|
374
375
|
}, _callee5, this);
|
|
375
376
|
}));
|
|
376
|
-
function
|
|
377
|
-
return
|
|
377
|
+
function set_temp(_x10, _x11) {
|
|
378
|
+
return _set_temp.apply(this, arguments);
|
|
378
379
|
}
|
|
379
|
-
return
|
|
380
|
-
}()
|
|
380
|
+
return set_temp;
|
|
381
|
+
}()
|
|
381
382
|
}, {
|
|
382
383
|
key: "setObjectTemp",
|
|
383
|
-
value:
|
|
384
|
+
value: //set temp value of object
|
|
385
|
+
function () {
|
|
384
386
|
var _setObjectTemp = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(key, value) {
|
|
385
|
-
var _yield$this$obj$
|
|
387
|
+
var _yield$this$obj$set_t, _this$obj0;
|
|
386
388
|
var sendChanges,
|
|
387
389
|
_args6 = arguments;
|
|
388
390
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
@@ -390,21 +392,21 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
|
390
392
|
case 0:
|
|
391
393
|
sendChanges = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : false;
|
|
392
394
|
_context6.next = 3;
|
|
393
|
-
return (_this$obj0 = this.obj) === null || _this$obj0 === void 0 ? void 0 : _this$obj0.
|
|
395
|
+
return (_this$obj0 = this.obj) === null || _this$obj0 === void 0 ? void 0 : _this$obj0.set_temp(key, value, sendChanges);
|
|
394
396
|
case 3:
|
|
395
|
-
_context6.t1 = _yield$this$obj$
|
|
397
|
+
_context6.t1 = _yield$this$obj$set_t = _context6.sent;
|
|
396
398
|
_context6.t0 = _context6.t1 !== null;
|
|
397
399
|
if (!_context6.t0) {
|
|
398
400
|
_context6.next = 7;
|
|
399
401
|
break;
|
|
400
402
|
}
|
|
401
|
-
_context6.t0 = _yield$this$obj$
|
|
403
|
+
_context6.t0 = _yield$this$obj$set_t !== void 0;
|
|
402
404
|
case 7:
|
|
403
405
|
if (!_context6.t0) {
|
|
404
406
|
_context6.next = 11;
|
|
405
407
|
break;
|
|
406
408
|
}
|
|
407
|
-
_context6.t2 = _yield$this$obj$
|
|
409
|
+
_context6.t2 = _yield$this$obj$set_t;
|
|
408
410
|
_context6.next = 12;
|
|
409
411
|
break;
|
|
410
412
|
case 11:
|
|
@@ -794,6 +796,6 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
|
794
796
|
return (0, _object.fn_eval)(this.__object_type);
|
|
795
797
|
}
|
|
796
798
|
}]);
|
|
797
|
-
}(
|
|
799
|
+
}(_MapableObject2["default"]);
|
|
798
800
|
_defineProperty(ObjectManager, "__object_type", void 0);
|
|
799
801
|
var _default = exports["default"] = ObjectManager;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* This object supports temp values
|
|
3
3
|
*/
|
|
4
4
|
export declare class ObjectWithTemp {
|
|
5
|
-
#private;
|
|
6
5
|
protected __temp: any;
|
|
7
6
|
constructor();
|
|
7
|
+
setTemp: (key: string, value: any) => Promise<boolean>;
|
|
8
8
|
getTemp: (key: string) => any;
|
|
9
|
-
|
|
9
|
+
get_temp(key: string): any;
|
|
10
|
+
set_temp(key: string, value: any): Promise<boolean>;
|
|
10
11
|
/**
|
|
11
12
|
* clear and discard all temp values
|
|
12
13
|
* @returns
|
|
@@ -1,46 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
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); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports["default"] = exports.ObjectWithTemp = void 0;
|
|
8
7
|
var _object = require("@azrico/object");
|
|
8
|
+
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); }
|
|
9
9
|
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; }
|
|
10
10
|
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); }
|
|
11
11
|
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); }); }; }
|
|
12
12
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
13
|
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); } }
|
|
14
14
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
|
-
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
16
|
-
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
17
15
|
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; }
|
|
18
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
17
|
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); }
|
|
20
|
-
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
21
18
|
/**
|
|
22
19
|
* This object supports temp values
|
|
23
20
|
*/
|
|
24
|
-
var _ObjectWithTemp_brand = /*#__PURE__*/new WeakSet();
|
|
25
21
|
var ObjectWithTemp = exports.ObjectWithTemp = /*#__PURE__*/function () {
|
|
26
22
|
function ObjectWithTemp() {
|
|
27
23
|
_classCallCheck(this, ObjectWithTemp);
|
|
28
|
-
/* ---------------------------------- temp ---------------------------------- */
|
|
29
|
-
_classPrivateMethodInitSpec(this, _ObjectWithTemp_brand);
|
|
30
24
|
_defineProperty(this, "__temp", undefined);
|
|
31
|
-
_defineProperty(this, "
|
|
25
|
+
_defineProperty(this, "setTemp", this.set_temp);
|
|
26
|
+
_defineProperty(this, "getTemp", this.get_temp);
|
|
27
|
+
this.__temp = {};
|
|
32
28
|
}
|
|
33
29
|
return _createClass(ObjectWithTemp, [{
|
|
34
|
-
key: "
|
|
30
|
+
key: "get_temp",
|
|
31
|
+
value: /* ---------------------------------- temp ---------------------------------- */
|
|
32
|
+
function get_temp(key) {
|
|
33
|
+
// if (this.__temp == null) return undefined;
|
|
34
|
+
return (0, _object.object_get)(this.__temp, key);
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "set_temp",
|
|
35
38
|
value: function () {
|
|
36
|
-
var
|
|
39
|
+
var _set_temp = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(key, value) {
|
|
37
40
|
var isValueChanged;
|
|
38
41
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
42
|
while (1) switch (_context.prev = _context.next) {
|
|
40
43
|
case 0:
|
|
41
44
|
isValueChanged = false;
|
|
42
|
-
isValueChanged =
|
|
43
|
-
|
|
45
|
+
isValueChanged = this.getTemp(key) != value;
|
|
46
|
+
// if (this.__temp == null) this.__temp = {};
|
|
47
|
+
(0, _object.object_set)(this.__temp, key, value);
|
|
44
48
|
return _context.abrupt("return", isValueChanged);
|
|
45
49
|
case 4:
|
|
46
50
|
case "end":
|
|
@@ -48,10 +52,10 @@ var ObjectWithTemp = exports.ObjectWithTemp = /*#__PURE__*/function () {
|
|
|
48
52
|
}
|
|
49
53
|
}, _callee, this);
|
|
50
54
|
}));
|
|
51
|
-
function
|
|
52
|
-
return
|
|
55
|
+
function set_temp(_x, _x2) {
|
|
56
|
+
return _set_temp.apply(this, arguments);
|
|
53
57
|
}
|
|
54
|
-
return
|
|
58
|
+
return set_temp;
|
|
55
59
|
}()
|
|
56
60
|
/**
|
|
57
61
|
* clear and discard all temp values
|
|
@@ -65,12 +69,4 @@ var ObjectWithTemp = exports.ObjectWithTemp = /*#__PURE__*/function () {
|
|
|
65
69
|
}
|
|
66
70
|
}]);
|
|
67
71
|
}();
|
|
68
|
-
function _getTempProperty(key) {
|
|
69
|
-
if (this.__temp == null) return undefined;
|
|
70
|
-
return (0, _object.object_get)(this.__temp, key);
|
|
71
|
-
}
|
|
72
|
-
function _setTempProperty(key, value) {
|
|
73
|
-
if (this.__temp == null) this.__temp = {};
|
|
74
|
-
return (0, _object.object_set)(this.__temp, key, value);
|
|
75
|
-
}
|
|
76
72
|
var _default = exports["default"] = ObjectWithTemp;
|
|
@@ -134,7 +134,8 @@ export declare class SimpleObject extends MapableObject {
|
|
|
134
134
|
* @return true if changed , false otherwise
|
|
135
135
|
*/
|
|
136
136
|
setSubValue<MKey extends PropOf<this>>(key: MKey, objKey: string, subvalue: any, sendChanges?: sendChangesType): Promise<boolean>;
|
|
137
|
-
|
|
137
|
+
set_temp(key: string, value: any, sendChanges?: sendChangesType): Promise<boolean>;
|
|
138
|
+
setTemp: (key: string, value: any, sendChanges?: sendChangesType) => Promise<boolean>;
|
|
138
139
|
/**
|
|
139
140
|
* Push a single value to array property
|
|
140
141
|
* @param key
|
|
@@ -92,6 +92,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
92
92
|
_defineProperty(_this, "_index_value", -1);
|
|
93
93
|
_defineProperty(_this, "getSubValue", _assertClassBrand(_SimpleObject_brand, _this, _getSubProperty));
|
|
94
94
|
_defineProperty(_this, "setDefault", _this.setDefaultValue);
|
|
95
|
+
_defineProperty(_this, "setTemp", _this.set_temp);
|
|
95
96
|
_defineProperty(_this, "get_managerClass", function () {
|
|
96
97
|
return undefined;
|
|
97
98
|
});
|
|
@@ -464,9 +465,9 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
464
465
|
return setSubValue;
|
|
465
466
|
}())
|
|
466
467
|
}, {
|
|
467
|
-
key: "
|
|
468
|
+
key: "set_temp",
|
|
468
469
|
value: function () {
|
|
469
|
-
var
|
|
470
|
+
var _set_temp = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(key, value) {
|
|
470
471
|
var sendChanges,
|
|
471
472
|
isValueChanged,
|
|
472
473
|
_args6 = arguments;
|
|
@@ -475,7 +476,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
475
476
|
case 0:
|
|
476
477
|
sendChanges = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : false;
|
|
477
478
|
_context6.next = 3;
|
|
478
|
-
return _superPropGet(SimpleObject, "
|
|
479
|
+
return _superPropGet(SimpleObject, "set_temp", this, 3)([key, value]);
|
|
479
480
|
case 3:
|
|
480
481
|
isValueChanged = _context6.sent;
|
|
481
482
|
if (!(sendChanges === true || sendChanges === "auto" && isValueChanged)) {
|
|
@@ -492,11 +493,14 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
492
493
|
}
|
|
493
494
|
}, _callee6, this);
|
|
494
495
|
}));
|
|
495
|
-
function
|
|
496
|
-
return
|
|
496
|
+
function set_temp(_x10, _x11) {
|
|
497
|
+
return _set_temp.apply(this, arguments);
|
|
497
498
|
}
|
|
498
|
-
return
|
|
499
|
+
return set_temp;
|
|
499
500
|
}()
|
|
501
|
+
}, {
|
|
502
|
+
key: "pushValue",
|
|
503
|
+
value: (
|
|
500
504
|
/**
|
|
501
505
|
* Push a single value to array property
|
|
502
506
|
* @param key
|
|
@@ -504,9 +508,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
504
508
|
* @param sendChanges
|
|
505
509
|
* @returns
|
|
506
510
|
*/
|
|
507
|
-
|
|
508
|
-
key: "pushValue",
|
|
509
|
-
value: (function () {
|
|
511
|
+
function () {
|
|
510
512
|
var _pushValue = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(key, value) {
|
|
511
513
|
var sendChanges,
|
|
512
514
|
_args7 = arguments;
|
|
@@ -1645,7 +1647,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
1645
1647
|
}, {
|
|
1646
1648
|
key: "setTemp",
|
|
1647
1649
|
value: (function () {
|
|
1648
|
-
var
|
|
1650
|
+
var _setTemp = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(obj, key, value) {
|
|
1649
1651
|
var sendChanges,
|
|
1650
1652
|
_args16 = arguments;
|
|
1651
1653
|
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
@@ -1677,7 +1679,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
1677
1679
|
}, _callee16);
|
|
1678
1680
|
}));
|
|
1679
1681
|
function setTemp(_x28, _x29, _x30) {
|
|
1680
|
-
return
|
|
1682
|
+
return _setTemp.apply(this, arguments);
|
|
1681
1683
|
}
|
|
1682
1684
|
return setTemp;
|
|
1683
1685
|
}())
|