@azrico/webobject 1.4.161 → 1.4.163
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/WebObjects/ParentWebObject.js +5 -6
- package/dist/src/WebObjects/WebObject.js +16 -16
- package/dist/src/WebObjects/WebObjectManager.js +4 -5
- package/dist/src/WebObjects/WebObjectPathHelper.js +3 -4
- package/dist/src/WebObjects/WebObjectPathHelper.test.js +3 -3
- package/dist/src/structs/DummyObject.js +2 -2
- package/dist/src/structs/MapableObject.js +8 -9
- package/dist/src/structs/MetaObject.js +8 -9
- package/dist/src/structs/ObjectArray.js +2 -3
- package/dist/src/structs/ObjectManager.js +13 -14
- package/dist/src/structs/ObjectWithTemp.js +11 -14
- package/dist/src/structs/SimpleObject.js +56 -69
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
15
|
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); }
|
|
16
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw
|
|
16
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { 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 && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
17
17
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
18
18
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
19
19
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -21,8 +21,8 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
21
21
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
22
22
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
23
23
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
24
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
24
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
25
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
26
26
|
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
27
27
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
28
28
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
@@ -31,91 +31,74 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Objec
|
|
|
31
31
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
|
32
32
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
33
33
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
34
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i :
|
|
34
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
35
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
|
-
function
|
|
37
|
-
var
|
|
38
|
-
var _getSubProperty = /*#__PURE__*/new WeakSet();
|
|
39
|
-
var _setProperty = /*#__PURE__*/new WeakSet();
|
|
40
|
-
var _setDefaultProperty = /*#__PURE__*/new WeakSet();
|
|
41
|
-
var _setDefaultPropertyNow = /*#__PURE__*/new WeakSet();
|
|
42
|
-
var _getProperty = /*#__PURE__*/new WeakSet();
|
|
43
|
-
var _setSaveResultObject = /*#__PURE__*/new WeakSet();
|
|
36
|
+
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"); }
|
|
37
|
+
var _SimpleObject_brand = /*#__PURE__*/new WeakSet();
|
|
44
38
|
var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
45
|
-
_inherits(SimpleObject, _MapableObject);
|
|
46
39
|
function SimpleObject() {
|
|
47
40
|
var _this;
|
|
48
41
|
var is_readonly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
49
42
|
_classCallCheck(this, SimpleObject);
|
|
50
43
|
_this = _callSuper(this, SimpleObject);
|
|
51
|
-
|
|
52
|
-
* set the response of last save from site
|
|
53
|
-
* @param toObj
|
|
54
|
-
*/
|
|
55
|
-
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _setSaveResultObject);
|
|
56
|
-
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _getProperty);
|
|
57
|
-
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _setDefaultPropertyNow);
|
|
58
|
-
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _setDefaultProperty);
|
|
59
|
-
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _setProperty);
|
|
60
|
-
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _getSubProperty);
|
|
61
|
-
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _setSubProperty);
|
|
44
|
+
_classPrivateMethodInitSpec(_this, _SimpleObject_brand);
|
|
62
45
|
//an exact copy of this object is stored here
|
|
63
|
-
_defineProperty(
|
|
46
|
+
_defineProperty(_this, "__originalobject", void 0);
|
|
64
47
|
//changes are saved here
|
|
65
|
-
_defineProperty(
|
|
66
|
-
_defineProperty(
|
|
48
|
+
_defineProperty(_this, "__delta", {});
|
|
49
|
+
_defineProperty(_this, "__changed", false);
|
|
67
50
|
//the last thing that was changed on this object
|
|
68
|
-
_defineProperty(
|
|
51
|
+
_defineProperty(_this, "__lastChanged", void 0);
|
|
69
52
|
//is the object read only
|
|
70
|
-
_defineProperty(
|
|
53
|
+
_defineProperty(_this, "__is_readonly", void 0);
|
|
71
54
|
//should we throw errors when encountering an error?
|
|
72
55
|
//is TRUE by default
|
|
73
|
-
_defineProperty(
|
|
56
|
+
_defineProperty(_this, "__throw_errors", void 0);
|
|
74
57
|
//is this object marked as deleted?
|
|
75
|
-
_defineProperty(
|
|
76
|
-
_defineProperty(
|
|
77
|
-
_defineProperty(
|
|
58
|
+
_defineProperty(_this, "_deleted", void 0);
|
|
59
|
+
_defineProperty(_this, "_archived", void 0);
|
|
60
|
+
_defineProperty(_this, "_deletedBy", void 0);
|
|
78
61
|
//is this object locked?
|
|
79
|
-
_defineProperty(
|
|
62
|
+
_defineProperty(_this, "_locked", void 0);
|
|
80
63
|
//errors
|
|
81
|
-
_defineProperty(
|
|
82
|
-
_defineProperty(
|
|
64
|
+
_defineProperty(_this, "__errors", void 0);
|
|
65
|
+
_defineProperty(_this, "__showErrors", void 0);
|
|
83
66
|
//refresh func
|
|
84
|
-
_defineProperty(
|
|
67
|
+
_defineProperty(_this, "__refresh_functions", void 0);
|
|
85
68
|
//save results
|
|
86
|
-
_defineProperty(
|
|
87
|
-
_defineProperty(
|
|
88
|
-
_defineProperty(
|
|
89
|
-
_defineProperty(
|
|
69
|
+
_defineProperty(_this, "__saveResultObject", void 0);
|
|
70
|
+
_defineProperty(_this, "__saveResultIsSuccess", true);
|
|
71
|
+
_defineProperty(_this, "__saveResultType", void 0);
|
|
72
|
+
_defineProperty(_this, "_id", "");
|
|
90
73
|
//sequence key (usually managed by the database)
|
|
91
|
-
_defineProperty(
|
|
74
|
+
_defineProperty(_this, "_index_key", "");
|
|
92
75
|
//sequence value , used to index the object with increasing numbers
|
|
93
|
-
_defineProperty(
|
|
94
|
-
_defineProperty(
|
|
95
|
-
_defineProperty(
|
|
76
|
+
_defineProperty(_this, "_index_value", -1);
|
|
77
|
+
_defineProperty(_this, "getValue", _assertClassBrand(_SimpleObject_brand, _this, _getProperty));
|
|
78
|
+
_defineProperty(_this, "get", _assertClassBrand(_SimpleObject_brand, _this, _getProperty));
|
|
96
79
|
/**
|
|
97
80
|
* set value
|
|
98
81
|
* @param key
|
|
99
82
|
* @param value
|
|
100
83
|
* @return true if changed , false otherwise
|
|
101
84
|
*/
|
|
102
|
-
_defineProperty(
|
|
85
|
+
_defineProperty(_this, "set", _this.setValue);
|
|
103
86
|
/**
|
|
104
87
|
* set value of a key to now date time
|
|
105
88
|
* @param key
|
|
106
89
|
* @param value
|
|
107
90
|
* @returns
|
|
108
91
|
*/
|
|
109
|
-
_defineProperty(
|
|
92
|
+
_defineProperty(_this, "setDefaultValueNow", _assertClassBrand(_SimpleObject_brand, _this, _setDefaultPropertyNow));
|
|
110
93
|
/**
|
|
111
94
|
* set value of a key only if the value is empty (null,undef,"")
|
|
112
95
|
* @param key
|
|
113
96
|
* @param value
|
|
114
97
|
* @returns
|
|
115
98
|
*/
|
|
116
|
-
_defineProperty(
|
|
117
|
-
_defineProperty(
|
|
118
|
-
_defineProperty(
|
|
99
|
+
_defineProperty(_this, "setDefault", _this.setDefaultValue);
|
|
100
|
+
_defineProperty(_this, "getSubValue", _assertClassBrand(_SimpleObject_brand, _this, _getSubProperty));
|
|
101
|
+
_defineProperty(_this, "get_managerClass", function () {
|
|
119
102
|
return undefined;
|
|
120
103
|
});
|
|
121
104
|
_this.__is_readonly = is_readonly;
|
|
@@ -123,7 +106,8 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
123
106
|
_this.clear_changes();
|
|
124
107
|
return _this;
|
|
125
108
|
}
|
|
126
|
-
|
|
109
|
+
_inherits(SimpleObject, _MapableObject);
|
|
110
|
+
return _createClass(SimpleObject, [{
|
|
127
111
|
key: "_static",
|
|
128
112
|
value: function _static() {
|
|
129
113
|
return this.constructor;
|
|
@@ -181,7 +165,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
181
165
|
strictArrayCheck: true,
|
|
182
166
|
ignoredStartingWords: "_"
|
|
183
167
|
})) {
|
|
184
|
-
|
|
168
|
+
_assertClassBrand(_SimpleObject_brand, this, _setProperty).call(this, key, value);
|
|
185
169
|
isValueChanged = true;
|
|
186
170
|
} else isValueChanged = false;
|
|
187
171
|
/* --------------------------------- notify --------------------------------- */
|
|
@@ -422,7 +406,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
422
406
|
}, {
|
|
423
407
|
key: "setDefaultValue",
|
|
424
408
|
value: function setDefaultValue(key, value) {
|
|
425
|
-
return
|
|
409
|
+
return _assertClassBrand(_SimpleObject_brand, this, _setDefaultProperty).call(this, key, value);
|
|
426
410
|
}
|
|
427
411
|
}, {
|
|
428
412
|
key: "setSubValue",
|
|
@@ -459,12 +443,12 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
459
443
|
isValueChanged = false;
|
|
460
444
|
_context8.prev = 8;
|
|
461
445
|
//if accessing subval of an object, make sure the object is not null
|
|
462
|
-
subval =
|
|
446
|
+
subval = _assertClassBrand(_SimpleObject_brand, this, _getSubProperty).call(this, key, objKey);
|
|
463
447
|
if (!(0, _object.object_equals)(subval, subvalue, {
|
|
464
448
|
ignoredStartingWords: "_",
|
|
465
449
|
strictArrayCheck: true
|
|
466
450
|
})) {
|
|
467
|
-
|
|
451
|
+
_assertClassBrand(_SimpleObject_brand, this, _setSubProperty).call(this, key, objKey, subvalue);
|
|
468
452
|
isValueChanged = true;
|
|
469
453
|
} else isValueChanged = false;
|
|
470
454
|
case 11:
|
|
@@ -560,8 +544,8 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
560
544
|
case 8:
|
|
561
545
|
return _context10.abrupt("return", false);
|
|
562
546
|
case 9:
|
|
563
|
-
if (
|
|
564
|
-
tempArray =
|
|
547
|
+
if (_assertClassBrand(_SimpleObject_brand, this, _getProperty).call(this, key) == null) _assertClassBrand(_SimpleObject_brand, this, _setProperty).call(this, key, []);
|
|
548
|
+
tempArray = _assertClassBrand(_SimpleObject_brand, this, _getProperty).call(this, key);
|
|
565
549
|
if (Array.isArray(tempArray)) {
|
|
566
550
|
_context10.next = 17;
|
|
567
551
|
break;
|
|
@@ -574,7 +558,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
574
558
|
case 16:
|
|
575
559
|
return _context10.abrupt("return", false);
|
|
576
560
|
case 17:
|
|
577
|
-
|
|
561
|
+
_assertClassBrand(_SimpleObject_brand, this, _setProperty).call(this, key, (0, _object.array_merge)(tempArray, values));
|
|
578
562
|
if (!(sendChanges === true || sendChanges === "auto")) {
|
|
579
563
|
_context10.next = 21;
|
|
580
564
|
break;
|
|
@@ -1129,7 +1113,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
1129
1113
|
function setSaveResult(toObj) {
|
|
1130
1114
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "auto";
|
|
1131
1115
|
var registerErrors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1132
|
-
|
|
1116
|
+
_assertClassBrand(_SimpleObject_brand, this, _setSaveResultObject).call(this, toObj);
|
|
1133
1117
|
//check if the given object is a valid save result
|
|
1134
1118
|
if (type === "error") this.__saveResultIsSuccess = false;else this.__saveResultIsSuccess = Boolean(type === "nothing" || this.constructor["isResultValid"](toObj));
|
|
1135
1119
|
if (type === "auto") {
|
|
@@ -1142,6 +1126,10 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
1142
1126
|
this.__saveResultType = type;
|
|
1143
1127
|
return type;
|
|
1144
1128
|
}
|
|
1129
|
+
/**
|
|
1130
|
+
* set the response of last save from site
|
|
1131
|
+
* @param toObj
|
|
1132
|
+
*/
|
|
1145
1133
|
}, {
|
|
1146
1134
|
key: "getSaveResult",
|
|
1147
1135
|
value: function getSaveResult() {
|
|
@@ -1508,22 +1496,21 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
1508
1496
|
return a === b;
|
|
1509
1497
|
}
|
|
1510
1498
|
}]);
|
|
1511
|
-
return SimpleObject;
|
|
1512
1499
|
}(_MapableObject2.MapableObject);
|
|
1513
|
-
function
|
|
1514
|
-
var subobj =
|
|
1500
|
+
function _setSubProperty(key, subkey, value) {
|
|
1501
|
+
var subobj = _assertClassBrand(_SimpleObject_brand, this, _getProperty).call(this, key);
|
|
1515
1502
|
//@ts-ignore
|
|
1516
1503
|
if (subobj == null || _typeof(subobj) !== "object") subobj = {};else subobj = _objectSpread({}, subobj); //make a clone so we dont update the original
|
|
1517
1504
|
subobj[subkey] = value;
|
|
1518
|
-
|
|
1505
|
+
_assertClassBrand(_SimpleObject_brand, this, _setProperty).call(this, key, subobj);
|
|
1519
1506
|
}
|
|
1520
|
-
function
|
|
1507
|
+
function _getSubProperty(key, subkey) {
|
|
1521
1508
|
var original = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1522
|
-
var subobj =
|
|
1509
|
+
var subobj = _assertClassBrand(_SimpleObject_brand, this, _getProperty).call(this, key, original);
|
|
1523
1510
|
if (subobj == null || _typeof(subobj) !== "object") return undefined;
|
|
1524
1511
|
return subobj[subkey];
|
|
1525
1512
|
}
|
|
1526
|
-
function
|
|
1513
|
+
function _setProperty(key, value) {
|
|
1527
1514
|
if (!this.__use_delta) {
|
|
1528
1515
|
this[key] = value; //on noDelta mode, also update the obj
|
|
1529
1516
|
this.__delta[key] = value; //always update delta to keep track of changes
|
|
@@ -1541,7 +1528,7 @@ function _setProperty2(key, value) {
|
|
|
1541
1528
|
}
|
|
1542
1529
|
}
|
|
1543
1530
|
}
|
|
1544
|
-
function
|
|
1531
|
+
function _setDefaultProperty(key, value) {
|
|
1545
1532
|
//@ts-ignore
|
|
1546
1533
|
if (this[key] == undefined || this[key] === "" || this[key] === 0) {
|
|
1547
1534
|
this[key] = value;
|
|
@@ -1549,7 +1536,7 @@ function _setDefaultProperty2(key, value) {
|
|
|
1549
1536
|
}
|
|
1550
1537
|
return false;
|
|
1551
1538
|
}
|
|
1552
|
-
function
|
|
1539
|
+
function _setDefaultPropertyNow(key) {
|
|
1553
1540
|
//@ts-ignore
|
|
1554
1541
|
if (this[key] == undefined || this[key] === "" || this[key] === 0) {
|
|
1555
1542
|
this[key] = new Date();
|
|
@@ -1557,7 +1544,7 @@ function _setDefaultPropertyNow2(key) {
|
|
|
1557
1544
|
}
|
|
1558
1545
|
return false;
|
|
1559
1546
|
}
|
|
1560
|
-
function
|
|
1547
|
+
function _getProperty(key) {
|
|
1561
1548
|
var original = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1562
1549
|
//check if we should treat the prop as a function
|
|
1563
1550
|
var is_fnc = this.constructor["__functionProperties"] != null && this.constructor["__functionProperties"].includes(key);
|
|
@@ -1570,7 +1557,7 @@ function _getProperty2(key) {
|
|
|
1570
1557
|
if (use_orig) return this[key];
|
|
1571
1558
|
return this.__delta[key];
|
|
1572
1559
|
}
|
|
1573
|
-
function
|
|
1560
|
+
function _setSaveResultObject(toObj) {
|
|
1574
1561
|
if (toObj == null) toObj = null; //null or undefined
|
|
1575
1562
|
this.__saveResultObject = toObj;
|
|
1576
1563
|
return true;
|