@azrico/webobject 1.2.31 → 1.2.33
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/README.md +52 -52
- package/dist/index.js +0 -2
- package/dist/src/WebObjects/ParentWebObject.js +5 -29
- package/dist/src/WebObjects/WebObject.d.ts +1 -1
- package/dist/src/WebObjects/WebObject.js +284 -462
- package/dist/src/WebObjects/WebObjectManager.d.ts +1 -0
- package/dist/src/WebObjects/WebObjectManager.js +134 -209
- package/dist/src/index.js +0 -18
- package/dist/src/structs/DummyObject.js +3 -22
- package/dist/src/structs/MapableObject.js +4 -35
- package/dist/src/structs/MetaObject.js +28 -74
- package/dist/src/structs/ObjectArray.d.ts +1 -1
- package/dist/src/structs/ObjectArray.js +5 -17
- package/dist/src/structs/ObjectManager.d.ts +4 -4
- package/dist/src/structs/ObjectManager.js +152 -295
- package/dist/src/structs/SimpleObject.d.ts +10 -10
- package/dist/src/structs/SimpleObject.js +190 -414
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import WebObject from "./WebObject";
|
|
|
5
5
|
* This class manages the events of an Simple Object
|
|
6
6
|
*/
|
|
7
7
|
export declare class WebObjectManager<T extends WebObject> extends ObjectManager<T> {
|
|
8
|
+
#private;
|
|
8
9
|
/**
|
|
9
10
|
* Update meta value of this object , meta data is stored in meta_data variable
|
|
10
11
|
* @param key
|
|
@@ -4,64 +4,50 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.WebObjectManager = void 0;
|
|
7
|
-
|
|
8
7
|
var _ObjectManager2 = _interopRequireDefault(require("../structs/ObjectManager"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
9
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
13
|
-
|
|
14
|
-
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
15
|
-
|
|
10
|
+
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
16
11
|
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); } }
|
|
17
|
-
|
|
18
12
|
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
|
-
|
|
20
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
-
|
|
22
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23
|
-
|
|
14
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
24
15
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
-
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
26
18
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
-
|
|
28
19
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
|
|
30
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
-
|
|
32
21
|
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); }
|
|
33
|
-
|
|
34
22
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
-
|
|
36
23
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
-
|
|
38
24
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
-
|
|
25
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
|
26
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
27
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
|
28
|
+
var _isValidSR = /*#__PURE__*/new WeakSet();
|
|
40
29
|
/**
|
|
41
30
|
* This class manages the events of an Simple Object
|
|
42
31
|
*/
|
|
43
32
|
var WebObjectManager = /*#__PURE__*/function (_ObjectManager) {
|
|
44
33
|
_inherits(WebObjectManager, _ObjectManager);
|
|
45
|
-
|
|
46
34
|
var _super = _createSuper(WebObjectManager);
|
|
47
|
-
|
|
48
35
|
function WebObjectManager() {
|
|
36
|
+
var _this;
|
|
49
37
|
_classCallCheck(this, WebObjectManager);
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
39
|
+
args[_key] = arguments[_key];
|
|
40
|
+
}
|
|
41
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
42
|
+
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _isValidSR);
|
|
43
|
+
return _this;
|
|
52
44
|
}
|
|
53
|
-
|
|
54
45
|
_createClass(WebObjectManager, [{
|
|
55
46
|
key: "setMetaValue",
|
|
56
|
-
value:
|
|
47
|
+
value: /* -------------------------------------------------------------------------- */
|
|
57
48
|
/* -------------------------------------------------------------------------- */
|
|
58
|
-
|
|
59
|
-
/* -------------------------------------------------------------------------- */
|
|
60
|
-
|
|
61
49
|
/* Meta data */
|
|
62
|
-
|
|
63
50
|
/* -------------------------------------------------------------------------- */
|
|
64
|
-
|
|
65
51
|
/**
|
|
66
52
|
* Update meta value of this object , meta data is stored in meta_data variable
|
|
67
53
|
* @param key
|
|
@@ -72,7 +58,6 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager) {
|
|
|
72
58
|
*/
|
|
73
59
|
function setMetaValue(key, value) {
|
|
74
60
|
var _this$obj;
|
|
75
|
-
|
|
76
61
|
var createIfNotExists = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
77
62
|
var sendChange = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "auto";
|
|
78
63
|
return (_this$obj = this.obj) === null || _this$obj === void 0 ? void 0 : _this$obj.setMetaValue(key, value, createIfNotExists, sendChange);
|
|
@@ -81,98 +66,73 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager) {
|
|
|
81
66
|
key: "getMeta",
|
|
82
67
|
value: function getMeta(key) {
|
|
83
68
|
var _this$obj2;
|
|
84
|
-
|
|
85
69
|
return (_this$obj2 = this.obj) === null || _this$obj2 === void 0 ? void 0 : _this$obj2.getMeta(key);
|
|
86
70
|
}
|
|
87
71
|
}, {
|
|
88
72
|
key: "getMetaValue",
|
|
89
73
|
value: function getMetaValue(key) {
|
|
90
74
|
var _this$obj3;
|
|
91
|
-
|
|
92
75
|
return (_this$obj3 = this.obj) === null || _this$obj3 === void 0 ? void 0 : _this$obj3.getMetaValue(key);
|
|
93
76
|
}
|
|
94
77
|
/* -------------------------------------------------------------------------- */
|
|
95
|
-
|
|
96
78
|
}, {
|
|
97
79
|
key: "get_deltaObject",
|
|
98
80
|
value: function () {
|
|
99
81
|
var _get_deltaObject = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
100
82
|
var _this$obj4;
|
|
101
|
-
|
|
102
83
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
103
|
-
while (1) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
_context.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
case 5:
|
|
120
|
-
return _context.abrupt("return", _context.t0);
|
|
121
|
-
|
|
122
|
-
case 6:
|
|
123
|
-
case "end":
|
|
124
|
-
return _context.stop();
|
|
125
|
-
}
|
|
84
|
+
while (1) switch (_context.prev = _context.next) {
|
|
85
|
+
case 0:
|
|
86
|
+
_context.next = 2;
|
|
87
|
+
return (_this$obj4 = this.obj) === null || _this$obj4 === void 0 ? void 0 : _this$obj4.get_deltaObject();
|
|
88
|
+
case 2:
|
|
89
|
+
_context.t0 = _context.sent;
|
|
90
|
+
if (_context.t0) {
|
|
91
|
+
_context.next = 5;
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
_context.t0 = {};
|
|
95
|
+
case 5:
|
|
96
|
+
return _context.abrupt("return", _context.t0);
|
|
97
|
+
case 6:
|
|
98
|
+
case "end":
|
|
99
|
+
return _context.stop();
|
|
126
100
|
}
|
|
127
101
|
}, _callee, this);
|
|
128
102
|
}));
|
|
129
|
-
|
|
130
103
|
function get_deltaObject() {
|
|
131
104
|
return _get_deltaObject.apply(this, arguments);
|
|
132
105
|
}
|
|
133
|
-
|
|
134
106
|
return get_deltaObject;
|
|
135
|
-
}()
|
|
136
|
-
/* ------------------------------ save and load ----------------------------- */
|
|
137
|
-
|
|
107
|
+
}() /* ------------------------------ save and load ----------------------------- */
|
|
138
108
|
}, {
|
|
139
109
|
key: "Save",
|
|
140
110
|
value: function () {
|
|
141
111
|
var _Save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
142
112
|
var _this$obj5;
|
|
143
|
-
|
|
144
113
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
145
|
-
while (1) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
_context2.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
case 5:
|
|
162
|
-
return _context2.abrupt("return", _context2.t0);
|
|
163
|
-
|
|
164
|
-
case 6:
|
|
165
|
-
case "end":
|
|
166
|
-
return _context2.stop();
|
|
167
|
-
}
|
|
114
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
115
|
+
case 0:
|
|
116
|
+
_context2.next = 2;
|
|
117
|
+
return (_this$obj5 = this.obj) === null || _this$obj5 === void 0 ? void 0 : _this$obj5.Save();
|
|
118
|
+
case 2:
|
|
119
|
+
_context2.t0 = _context2.sent;
|
|
120
|
+
if (_context2.t0) {
|
|
121
|
+
_context2.next = 5;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
_context2.t0 = false;
|
|
125
|
+
case 5:
|
|
126
|
+
return _context2.abrupt("return", _context2.t0);
|
|
127
|
+
case 6:
|
|
128
|
+
case "end":
|
|
129
|
+
return _context2.stop();
|
|
168
130
|
}
|
|
169
131
|
}, _callee2, this);
|
|
170
132
|
}));
|
|
171
|
-
|
|
172
133
|
function Save() {
|
|
173
134
|
return _Save.apply(this, arguments);
|
|
174
135
|
}
|
|
175
|
-
|
|
176
136
|
return Save;
|
|
177
137
|
}()
|
|
178
138
|
}, {
|
|
@@ -180,43 +140,33 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager) {
|
|
|
180
140
|
value: function () {
|
|
181
141
|
var _Load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(search) {
|
|
182
142
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
183
|
-
while (1) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
case "end":
|
|
190
|
-
return _context3.stop();
|
|
191
|
-
}
|
|
143
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
144
|
+
case 0:
|
|
145
|
+
throw Error("load not implented");
|
|
146
|
+
case 1:
|
|
147
|
+
case "end":
|
|
148
|
+
return _context3.stop();
|
|
192
149
|
}
|
|
193
150
|
}, _callee3);
|
|
194
151
|
}));
|
|
195
|
-
|
|
196
152
|
function Load(_x) {
|
|
197
153
|
return _Load.apply(this, arguments);
|
|
198
154
|
}
|
|
199
|
-
|
|
200
155
|
return Load;
|
|
201
156
|
}()
|
|
202
157
|
/* -------------------------------------------------------------------------- */
|
|
203
|
-
|
|
204
158
|
/* Child Functions */
|
|
205
|
-
|
|
206
159
|
/* -------------------------------------------------------------------------- */
|
|
207
|
-
|
|
208
160
|
}, {
|
|
209
161
|
key: "__web_path",
|
|
210
162
|
get: function get() {
|
|
211
163
|
var _this$obj6;
|
|
212
|
-
|
|
213
164
|
return ((_this$obj6 = this.obj) === null || _this$obj6 === void 0 ? void 0 : _this$obj6.__web_path) || "";
|
|
214
165
|
}
|
|
215
166
|
}, {
|
|
216
167
|
key: "__web_type",
|
|
217
168
|
get: function get() {
|
|
218
169
|
var _this$obj7;
|
|
219
|
-
|
|
220
170
|
return ((_this$obj7 = this.obj) === null || _this$obj7 === void 0 ? void 0 : _this$obj7.__web_type) || "";
|
|
221
171
|
}
|
|
222
172
|
}, {
|
|
@@ -225,57 +175,43 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager) {
|
|
|
225
175
|
return this.__web_path || this.__web_type || this.__cache_name;
|
|
226
176
|
}
|
|
227
177
|
/* -------------------------------------------------------------------------- */
|
|
228
|
-
|
|
229
178
|
/* Default Events */
|
|
230
|
-
|
|
231
179
|
/* -------------------------------------------------------------------------- */
|
|
232
|
-
|
|
233
180
|
/**
|
|
234
181
|
* Use this when you load new Object
|
|
235
182
|
* @param p
|
|
236
183
|
* @returns
|
|
237
184
|
*/
|
|
238
|
-
|
|
239
185
|
}, {
|
|
240
186
|
key: "onNew",
|
|
241
187
|
value: function () {
|
|
242
188
|
var _onNew = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
243
189
|
var _this$obj8;
|
|
244
|
-
|
|
245
190
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
246
|
-
while (1) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
case 7:
|
|
265
|
-
return _context4.abrupt("return", _context4.sent);
|
|
266
|
-
|
|
267
|
-
case 8:
|
|
268
|
-
case "end":
|
|
269
|
-
return _context4.stop();
|
|
270
|
-
}
|
|
191
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
192
|
+
case 0:
|
|
193
|
+
if (this.canModify) {
|
|
194
|
+
(_this$obj8 = this.obj) === null || _this$obj8 === void 0 ? void 0 : _this$obj8.setOriginal();
|
|
195
|
+
}
|
|
196
|
+
_context4.next = 3;
|
|
197
|
+
return this.event_run("on_new");
|
|
198
|
+
case 3:
|
|
199
|
+
_context4.next = 5;
|
|
200
|
+
return this.event_run("on_change", true);
|
|
201
|
+
case 5:
|
|
202
|
+
_context4.next = 7;
|
|
203
|
+
return Promise.resolve(true);
|
|
204
|
+
case 7:
|
|
205
|
+
return _context4.abrupt("return", _context4.sent);
|
|
206
|
+
case 8:
|
|
207
|
+
case "end":
|
|
208
|
+
return _context4.stop();
|
|
271
209
|
}
|
|
272
210
|
}, _callee4, this);
|
|
273
211
|
}));
|
|
274
|
-
|
|
275
212
|
function onNew() {
|
|
276
213
|
return _onNew.apply(this, arguments);
|
|
277
214
|
}
|
|
278
|
-
|
|
279
215
|
return onNew;
|
|
280
216
|
}()
|
|
281
217
|
/**
|
|
@@ -283,115 +219,104 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager) {
|
|
|
283
219
|
* @param p
|
|
284
220
|
* @returns
|
|
285
221
|
*/
|
|
286
|
-
|
|
287
222
|
}, {
|
|
288
223
|
key: "onLoad",
|
|
289
224
|
value: function () {
|
|
290
225
|
var _onLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
291
226
|
var _this$obj9;
|
|
292
|
-
|
|
293
227
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
294
|
-
while (1) {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
case 7:
|
|
313
|
-
return _context5.abrupt("return", _context5.sent);
|
|
314
|
-
|
|
315
|
-
case 8:
|
|
316
|
-
case "end":
|
|
317
|
-
return _context5.stop();
|
|
318
|
-
}
|
|
228
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
229
|
+
case 0:
|
|
230
|
+
if (this.canModify) {
|
|
231
|
+
(_this$obj9 = this.obj) === null || _this$obj9 === void 0 ? void 0 : _this$obj9.setOriginal();
|
|
232
|
+
}
|
|
233
|
+
_context5.next = 3;
|
|
234
|
+
return this.event_run("on_load");
|
|
235
|
+
case 3:
|
|
236
|
+
_context5.next = 5;
|
|
237
|
+
return this.event_run("on_change", true);
|
|
238
|
+
case 5:
|
|
239
|
+
_context5.next = 7;
|
|
240
|
+
return Promise.resolve(true);
|
|
241
|
+
case 7:
|
|
242
|
+
return _context5.abrupt("return", _context5.sent);
|
|
243
|
+
case 8:
|
|
244
|
+
case "end":
|
|
245
|
+
return _context5.stop();
|
|
319
246
|
}
|
|
320
247
|
}, _callee5, this);
|
|
321
248
|
}));
|
|
322
|
-
|
|
323
249
|
function onLoad() {
|
|
324
250
|
return _onLoad.apply(this, arguments);
|
|
325
251
|
}
|
|
326
|
-
|
|
327
252
|
return onLoad;
|
|
328
253
|
}()
|
|
254
|
+
}, {
|
|
255
|
+
key: "onSave",
|
|
256
|
+
value:
|
|
329
257
|
/**
|
|
330
258
|
* Use this after succesful save to Database
|
|
331
259
|
* @param p
|
|
332
260
|
* @returns
|
|
333
261
|
*/
|
|
334
|
-
|
|
335
|
-
}, {
|
|
336
|
-
key: "onSave",
|
|
337
|
-
value: function () {
|
|
262
|
+
function () {
|
|
338
263
|
var _onSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
339
|
-
var
|
|
264
|
+
var _this2 = this;
|
|
265
|
+
var srObject, actual_sr;
|
|
340
266
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
341
|
-
while (1) {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
267
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
268
|
+
case 0:
|
|
269
|
+
if (this.isSaved && this.obj) {
|
|
270
|
+
this.apply_changes();
|
|
271
|
+
srObject = this.obj.getSaveResult(true);
|
|
272
|
+
if (srObject != null) {
|
|
273
|
+
//we may have some extra data in the save result.
|
|
274
|
+
//try to find the main data
|
|
275
|
+
if (Array.isArray(srObject)) {
|
|
276
|
+
actual_sr = srObject.find(function (s) {
|
|
277
|
+
return _classPrivateMethodGet(_this2, _isValidSR, _isValidSR2).call(_this2, s);
|
|
278
|
+
});
|
|
279
|
+
if (actual_sr) srObject = actual_sr;
|
|
280
|
+
}
|
|
281
|
+
if (_classPrivateMethodGet(this, _isValidSR, _isValidSR2).call(this, srObject)) {
|
|
282
|
+
if (srObject.insertedId || srObject._id) {
|
|
283
|
+
this.obj._id = srObject.insertedId || srObject._id;
|
|
353
284
|
}
|
|
354
|
-
|
|
355
285
|
if (srObject._index_value && !Number.isNaN(srObject._index_value)) {
|
|
356
286
|
this.obj._index_value = Number(srObject._index_value);
|
|
357
287
|
}
|
|
358
|
-
}
|
|
359
|
-
|
|
288
|
+
}
|
|
360
289
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
case 8:
|
|
377
|
-
case "end":
|
|
378
|
-
return _context6.stop();
|
|
379
|
-
}
|
|
290
|
+
//this.loadValues(srObject);
|
|
291
|
+
}
|
|
292
|
+
_context6.next = 3;
|
|
293
|
+
return this.event_run("on_save");
|
|
294
|
+
case 3:
|
|
295
|
+
_context6.next = 5;
|
|
296
|
+
return this.event_run("on_change", true);
|
|
297
|
+
case 5:
|
|
298
|
+
_context6.next = 7;
|
|
299
|
+
return Promise.resolve(true);
|
|
300
|
+
case 7:
|
|
301
|
+
return _context6.abrupt("return", _context6.sent);
|
|
302
|
+
case 8:
|
|
303
|
+
case "end":
|
|
304
|
+
return _context6.stop();
|
|
380
305
|
}
|
|
381
306
|
}, _callee6, this);
|
|
382
307
|
}));
|
|
383
|
-
|
|
384
308
|
function onSave() {
|
|
385
309
|
return _onSave.apply(this, arguments);
|
|
386
310
|
}
|
|
387
|
-
|
|
388
311
|
return onSave;
|
|
389
312
|
}()
|
|
390
313
|
}]);
|
|
391
|
-
|
|
392
314
|
return WebObjectManager;
|
|
393
315
|
}(_ObjectManager2["default"]);
|
|
394
|
-
|
|
395
316
|
exports.WebObjectManager = WebObjectManager;
|
|
317
|
+
function _isValidSR2(s) {
|
|
318
|
+
if (_typeof(s) !== "object" && s == null) return false;
|
|
319
|
+
return s.insertedId || s._id || s._index_value && !Number.isNaN(s._index_value);
|
|
320
|
+
}
|
|
396
321
|
var _default = WebObjectManager;
|
|
397
322
|
exports["default"] = _default;
|