@azrico/webobject 1.5.70 → 1.5.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/src/WebObjects/ParentWebObject.d.ts +24 -24
- package/dist/src/WebObjects/ParentWebObject.js +7 -7
- package/dist/src/WebObjects/WebObject.d.ts +153 -153
- package/dist/src/WebObjects/WebObject.js +476 -561
- package/dist/src/WebObjects/WebObjectHelper.d.ts +9 -9
- package/dist/src/WebObjects/WebObjectHelper.js +4 -4
- package/dist/src/WebObjects/WebObjectHelper.test.d.ts +1 -1
- package/dist/src/WebObjects/WebObjectHelper.test.js +1 -1
- package/dist/src/WebObjects/WebObjectManager.d.ts +68 -68
- package/dist/src/WebObjects/WebObjectManager.js +303 -350
- package/dist/src/WebObjects/WebObjectPathHelper.d.ts +36 -36
- package/dist/src/WebObjects/WebObjectPathHelper.js +31 -39
- package/dist/src/WebObjects/WebObjectPathHelper.test.d.ts +1 -1
- package/dist/src/WebObjects/WebObjectPathHelper.test.js +55 -61
- package/dist/src/index.d.ts +10 -10
- package/dist/src/structs/DummyObject.d.ts +5 -5
- package/dist/src/structs/DummyObject.js +1 -1
- package/dist/src/structs/MapableObject.d.ts +43 -43
- package/dist/src/structs/MapableObject.js +3 -3
- package/dist/src/structs/MetaObject.d.ts +15 -15
- package/dist/src/structs/MetaObject.js +19 -25
- package/dist/src/structs/ObjectArray.d.ts +10 -10
- package/dist/src/structs/ObjectArray.js +1 -1
- package/dist/src/structs/ObjectManager.d.ts +140 -140
- package/dist/src/structs/ObjectManager.js +202 -223
- package/dist/src/structs/ObjectWithTemp.d.ts +17 -17
- package/dist/src/structs/ObjectWithTemp.js +13 -17
- package/dist/src/structs/SimpleObject.d.ts +318 -303
- package/dist/src/structs/SimpleObject.js +423 -467
- package/package.json +63 -82
|
@@ -10,7 +10,8 @@ var _global = require("@azrico/global");
|
|
|
10
10
|
var _object = require("@azrico/object");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
12
|
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); }
|
|
13
|
-
function
|
|
13
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
14
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
14
15
|
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); }
|
|
15
16
|
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); }); }; }
|
|
16
17
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -28,9 +29,9 @@ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new T
|
|
|
28
29
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
29
30
|
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; }
|
|
30
31
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
31
|
-
function _toPrimitive(t,
|
|
32
|
-
/**
|
|
33
|
-
* This class manages the events of an Simple Object
|
|
32
|
+
function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
|
|
33
|
+
/**
|
|
34
|
+
* This class manages the events of an Simple Object
|
|
34
35
|
*/
|
|
35
36
|
var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_ObjectManager) {
|
|
36
37
|
/* -------------------------------------------------------------------------- */
|
|
@@ -41,40 +42,40 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
41
42
|
if (_this.constructor["__save_message"]) {
|
|
42
43
|
/* ---------------- should we display a message after saving ? -------------- */
|
|
43
44
|
_this.event_add("on_save", "on_save-sendmsg", /*#__PURE__*/function () {
|
|
44
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(srt) {
|
|
46
|
+
var _t;
|
|
47
|
+
return _regenerator().w(function (_context) {
|
|
48
|
+
while (1) switch (_context.n) {
|
|
47
49
|
case 0:
|
|
48
|
-
|
|
49
|
-
_context.
|
|
50
|
+
_t = srt;
|
|
51
|
+
_context.n = _t === "nothing" ? 1 : _t === "normal" ? 3 : 5;
|
|
50
52
|
break;
|
|
51
|
-
case
|
|
52
|
-
_context.
|
|
53
|
+
case 1:
|
|
54
|
+
_context.n = 2;
|
|
53
55
|
return _global.gfunc.run_action("show_message", {
|
|
54
56
|
message: "Nothing to save",
|
|
55
57
|
type: "info"
|
|
56
58
|
});
|
|
57
|
-
case
|
|
58
|
-
return _context.
|
|
59
|
-
case
|
|
60
|
-
_context.
|
|
59
|
+
case 2:
|
|
60
|
+
return _context.a(2, _context.v);
|
|
61
|
+
case 3:
|
|
62
|
+
_context.n = 4;
|
|
61
63
|
return _global.gfunc.run_action("show_message", {
|
|
62
64
|
message: "Saved",
|
|
63
65
|
type: "success"
|
|
64
66
|
});
|
|
65
|
-
case
|
|
66
|
-
return _context.
|
|
67
|
-
case
|
|
68
|
-
_context.
|
|
67
|
+
case 4:
|
|
68
|
+
return _context.a(2, _context.v);
|
|
69
|
+
case 5:
|
|
70
|
+
_context.n = 6;
|
|
69
71
|
return _global.gfunc.run_action("show_message", {
|
|
70
72
|
message: "Not saved",
|
|
71
73
|
type: "error"
|
|
72
74
|
});
|
|
73
|
-
case
|
|
74
|
-
return _context.
|
|
75
|
-
case
|
|
76
|
-
|
|
77
|
-
return _context.stop();
|
|
75
|
+
case 6:
|
|
76
|
+
return _context.a(2, _context.v);
|
|
77
|
+
case 7:
|
|
78
|
+
return _context.a(2);
|
|
78
79
|
}
|
|
79
80
|
}, _callee);
|
|
80
81
|
}));
|
|
@@ -83,32 +84,32 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
83
84
|
};
|
|
84
85
|
}());
|
|
85
86
|
_this.event_add("on_archive", "on_archive-sendmsg", /*#__PURE__*/function () {
|
|
86
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(srType) {
|
|
88
|
+
var _t2;
|
|
89
|
+
return _regenerator().w(function (_context2) {
|
|
90
|
+
while (1) switch (_context2.n) {
|
|
89
91
|
case 0:
|
|
90
|
-
|
|
91
|
-
_context2.
|
|
92
|
+
_t2 = srType;
|
|
93
|
+
_context2.n = _t2 === "normal" ? 1 : 3;
|
|
92
94
|
break;
|
|
93
|
-
case
|
|
94
|
-
_context2.
|
|
95
|
+
case 1:
|
|
96
|
+
_context2.n = 2;
|
|
95
97
|
return _global.gfunc.run_action("show_message", {
|
|
96
98
|
message: "Archived",
|
|
97
99
|
type: "success"
|
|
98
100
|
});
|
|
99
|
-
case
|
|
100
|
-
return _context2.
|
|
101
|
-
case
|
|
102
|
-
_context2.
|
|
101
|
+
case 2:
|
|
102
|
+
return _context2.a(2, _context2.v);
|
|
103
|
+
case 3:
|
|
104
|
+
_context2.n = 4;
|
|
103
105
|
return _global.gfunc.run_action("show_message", {
|
|
104
106
|
message: "Not archived (".concat(srType, ")"),
|
|
105
107
|
type: "error"
|
|
106
108
|
});
|
|
107
|
-
case
|
|
108
|
-
return _context2.
|
|
109
|
-
case
|
|
110
|
-
|
|
111
|
-
return _context2.stop();
|
|
109
|
+
case 4:
|
|
110
|
+
return _context2.a(2, _context2.v);
|
|
111
|
+
case 5:
|
|
112
|
+
return _context2.a(2);
|
|
112
113
|
}
|
|
113
114
|
}, _callee2);
|
|
114
115
|
}));
|
|
@@ -117,32 +118,32 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
117
118
|
};
|
|
118
119
|
}());
|
|
119
120
|
_this.event_add("on_unarchive", "on_unarchive-sendmsg", /*#__PURE__*/function () {
|
|
120
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(srType) {
|
|
122
|
+
var _t3;
|
|
123
|
+
return _regenerator().w(function (_context3) {
|
|
124
|
+
while (1) switch (_context3.n) {
|
|
123
125
|
case 0:
|
|
124
|
-
|
|
125
|
-
_context3.
|
|
126
|
+
_t3 = srType;
|
|
127
|
+
_context3.n = _t3 === "normal" ? 1 : 3;
|
|
126
128
|
break;
|
|
127
|
-
case
|
|
128
|
-
_context3.
|
|
129
|
+
case 1:
|
|
130
|
+
_context3.n = 2;
|
|
129
131
|
return _global.gfunc.run_action("show_message", {
|
|
130
132
|
message: "Restored",
|
|
131
133
|
type: "success"
|
|
132
134
|
});
|
|
133
|
-
case
|
|
134
|
-
return _context3.
|
|
135
|
-
case
|
|
136
|
-
_context3.
|
|
135
|
+
case 2:
|
|
136
|
+
return _context3.a(2, _context3.v);
|
|
137
|
+
case 3:
|
|
138
|
+
_context3.n = 4;
|
|
137
139
|
return _global.gfunc.run_action("show_message", {
|
|
138
140
|
message: "Not restored (".concat(srType, ")"),
|
|
139
141
|
type: "error"
|
|
140
142
|
});
|
|
141
|
-
case
|
|
142
|
-
return _context3.
|
|
143
|
-
case
|
|
144
|
-
|
|
145
|
-
return _context3.stop();
|
|
143
|
+
case 4:
|
|
144
|
+
return _context3.a(2, _context3.v);
|
|
145
|
+
case 5:
|
|
146
|
+
return _context3.a(2);
|
|
146
147
|
}
|
|
147
148
|
}, _callee3);
|
|
148
149
|
}));
|
|
@@ -151,32 +152,32 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
151
152
|
};
|
|
152
153
|
}());
|
|
153
154
|
_this.event_add("on_delete", "on_delete-sendmsg", /*#__PURE__*/function () {
|
|
154
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(srType) {
|
|
156
|
+
var _t4;
|
|
157
|
+
return _regenerator().w(function (_context4) {
|
|
158
|
+
while (1) switch (_context4.n) {
|
|
157
159
|
case 0:
|
|
158
|
-
|
|
159
|
-
_context4.
|
|
160
|
+
_t4 = srType;
|
|
161
|
+
_context4.n = _t4 === "normal" ? 1 : 3;
|
|
160
162
|
break;
|
|
161
|
-
case
|
|
162
|
-
_context4.
|
|
163
|
+
case 1:
|
|
164
|
+
_context4.n = 2;
|
|
163
165
|
return _global.gfunc.run_action("show_message", {
|
|
164
166
|
message: "Deleted",
|
|
165
167
|
type: "success"
|
|
166
168
|
});
|
|
167
|
-
case
|
|
168
|
-
return _context4.
|
|
169
|
-
case
|
|
170
|
-
_context4.
|
|
169
|
+
case 2:
|
|
170
|
+
return _context4.a(2, _context4.v);
|
|
171
|
+
case 3:
|
|
172
|
+
_context4.n = 4;
|
|
171
173
|
return _global.gfunc.run_action("show_message", {
|
|
172
174
|
message: "Not deleted (".concat(srType, ")"),
|
|
173
175
|
type: "error"
|
|
174
176
|
});
|
|
175
|
-
case
|
|
176
|
-
return _context4.
|
|
177
|
-
case
|
|
178
|
-
|
|
179
|
-
return _context4.stop();
|
|
177
|
+
case 4:
|
|
178
|
+
return _context4.a(2, _context4.v);
|
|
179
|
+
case 5:
|
|
180
|
+
return _context4.a(2);
|
|
180
181
|
}
|
|
181
182
|
}, _callee4);
|
|
182
183
|
}));
|
|
@@ -206,32 +207,29 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
206
207
|
/* -------------------------------------------------------------------------- */
|
|
207
208
|
/* Meta data */
|
|
208
209
|
/* -------------------------------------------------------------------------- */
|
|
209
|
-
/**
|
|
210
|
-
* Update meta value of this object , meta data is stored in meta_data variable
|
|
211
|
-
* @param key
|
|
212
|
-
* @param value
|
|
213
|
-
* @param createIfNotExists should we create a new meta if key does not exist
|
|
214
|
-
* @param sendChange
|
|
215
|
-
* @returns
|
|
210
|
+
/**
|
|
211
|
+
* Update meta value of this object , meta data is stored in meta_data variable
|
|
212
|
+
* @param key
|
|
213
|
+
* @param value
|
|
214
|
+
* @param createIfNotExists should we create a new meta if key does not exist
|
|
215
|
+
* @param sendChange
|
|
216
|
+
* @returns
|
|
216
217
|
*/
|
|
217
218
|
}, {
|
|
218
219
|
key: "setMetaValue",
|
|
219
220
|
value: (function () {
|
|
220
|
-
var _setMetaValue = _asyncToGenerator(/*#__PURE__*/
|
|
221
|
+
var _setMetaValue = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(key, value) {
|
|
221
222
|
var _this$obj;
|
|
222
223
|
var sendChange,
|
|
223
224
|
_args5 = arguments;
|
|
224
|
-
return
|
|
225
|
-
while (1) switch (_context5.
|
|
225
|
+
return _regenerator().w(function (_context5) {
|
|
226
|
+
while (1) switch (_context5.n) {
|
|
226
227
|
case 0:
|
|
227
228
|
sendChange = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : "auto";
|
|
228
|
-
_context5.
|
|
229
|
+
_context5.n = 1;
|
|
229
230
|
return (_this$obj = this.obj) === null || _this$obj === void 0 ? void 0 : _this$obj.setMetaValue(key, value, sendChange);
|
|
230
|
-
case
|
|
231
|
-
return _context5.
|
|
232
|
-
case 4:
|
|
233
|
-
case "end":
|
|
234
|
-
return _context5.stop();
|
|
231
|
+
case 1:
|
|
232
|
+
return _context5.a(2, _context5.v);
|
|
235
233
|
}
|
|
236
234
|
}, _callee5, this);
|
|
237
235
|
}));
|
|
@@ -250,25 +248,23 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
250
248
|
}, {
|
|
251
249
|
key: "get_deltaObject",
|
|
252
250
|
value: (function () {
|
|
253
|
-
var _get_deltaObject = _asyncToGenerator(/*#__PURE__*/
|
|
251
|
+
var _get_deltaObject = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
254
252
|
var _this$obj3;
|
|
255
|
-
|
|
256
|
-
|
|
253
|
+
var _t5;
|
|
254
|
+
return _regenerator().w(function (_context6) {
|
|
255
|
+
while (1) switch (_context6.n) {
|
|
257
256
|
case 0:
|
|
258
|
-
_context6.
|
|
257
|
+
_context6.n = 1;
|
|
259
258
|
return (_this$obj3 = this.obj) === null || _this$obj3 === void 0 ? void 0 : _this$obj3.get_deltaObject();
|
|
260
|
-
case
|
|
261
|
-
|
|
262
|
-
if (
|
|
263
|
-
_context6.
|
|
259
|
+
case 1:
|
|
260
|
+
_t5 = _context6.v;
|
|
261
|
+
if (_t5) {
|
|
262
|
+
_context6.n = 2;
|
|
264
263
|
break;
|
|
265
264
|
}
|
|
266
|
-
|
|
267
|
-
case
|
|
268
|
-
return _context6.
|
|
269
|
-
case 6:
|
|
270
|
-
case "end":
|
|
271
|
-
return _context6.stop();
|
|
265
|
+
_t5 = {};
|
|
266
|
+
case 2:
|
|
267
|
+
return _context6.a(2, _t5);
|
|
272
268
|
}
|
|
273
269
|
}, _callee6, this);
|
|
274
270
|
}));
|
|
@@ -280,25 +276,23 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
280
276
|
}, {
|
|
281
277
|
key: "Save",
|
|
282
278
|
value: (function () {
|
|
283
|
-
var _Save = _asyncToGenerator(/*#__PURE__*/
|
|
279
|
+
var _Save = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
|
|
284
280
|
var _this$obj4;
|
|
285
|
-
|
|
286
|
-
|
|
281
|
+
var _t6;
|
|
282
|
+
return _regenerator().w(function (_context7) {
|
|
283
|
+
while (1) switch (_context7.n) {
|
|
287
284
|
case 0:
|
|
288
|
-
_context7.
|
|
285
|
+
_context7.n = 1;
|
|
289
286
|
return (_this$obj4 = this.obj) === null || _this$obj4 === void 0 ? void 0 : _this$obj4.Save();
|
|
290
|
-
case
|
|
291
|
-
|
|
292
|
-
if (
|
|
293
|
-
_context7.
|
|
287
|
+
case 1:
|
|
288
|
+
_t6 = _context7.v;
|
|
289
|
+
if (_t6) {
|
|
290
|
+
_context7.n = 2;
|
|
294
291
|
break;
|
|
295
292
|
}
|
|
296
|
-
|
|
297
|
-
case
|
|
298
|
-
return _context7.
|
|
299
|
-
case 6:
|
|
300
|
-
case "end":
|
|
301
|
-
return _context7.stop();
|
|
293
|
+
_t6 = false;
|
|
294
|
+
case 2:
|
|
295
|
+
return _context7.a(2, _t6);
|
|
302
296
|
}
|
|
303
297
|
}, _callee7, this);
|
|
304
298
|
}));
|
|
@@ -310,18 +304,17 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
310
304
|
}, {
|
|
311
305
|
key: "New",
|
|
312
306
|
value: function () {
|
|
313
|
-
var _New = _asyncToGenerator(/*#__PURE__*/
|
|
307
|
+
var _New = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
314
308
|
var cls;
|
|
315
|
-
return
|
|
316
|
-
while (1) switch (_context8.
|
|
309
|
+
return _regenerator().w(function (_context8) {
|
|
310
|
+
while (1) switch (_context8.n) {
|
|
317
311
|
case 0:
|
|
318
312
|
cls = this.getObjectType();
|
|
319
313
|
this.setObject(new cls());
|
|
320
|
-
_context8.
|
|
314
|
+
_context8.n = 1;
|
|
321
315
|
return this.onNew();
|
|
322
|
-
case
|
|
323
|
-
|
|
324
|
-
return _context8.stop();
|
|
316
|
+
case 1:
|
|
317
|
+
return _context8.a(2);
|
|
325
318
|
}
|
|
326
319
|
}, _callee8, this);
|
|
327
320
|
}));
|
|
@@ -333,25 +326,23 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
333
326
|
}, {
|
|
334
327
|
key: "Delete",
|
|
335
328
|
value: function () {
|
|
336
|
-
var _Delete = _asyncToGenerator(/*#__PURE__*/
|
|
329
|
+
var _Delete = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
|
|
337
330
|
var _this$obj5;
|
|
338
|
-
|
|
339
|
-
|
|
331
|
+
var _t7;
|
|
332
|
+
return _regenerator().w(function (_context9) {
|
|
333
|
+
while (1) switch (_context9.n) {
|
|
340
334
|
case 0:
|
|
341
|
-
_context9.
|
|
335
|
+
_context9.n = 1;
|
|
342
336
|
return (_this$obj5 = this.obj) === null || _this$obj5 === void 0 ? void 0 : _this$obj5.Delete();
|
|
343
|
-
case
|
|
344
|
-
|
|
345
|
-
if (
|
|
346
|
-
_context9.
|
|
337
|
+
case 1:
|
|
338
|
+
_t7 = _context9.v;
|
|
339
|
+
if (_t7) {
|
|
340
|
+
_context9.n = 2;
|
|
347
341
|
break;
|
|
348
342
|
}
|
|
349
|
-
|
|
350
|
-
case
|
|
351
|
-
return _context9.
|
|
352
|
-
case 6:
|
|
353
|
-
case "end":
|
|
354
|
-
return _context9.stop();
|
|
343
|
+
_t7 = false;
|
|
344
|
+
case 2:
|
|
345
|
+
return _context9.a(2, _t7);
|
|
355
346
|
}
|
|
356
347
|
}, _callee9, this);
|
|
357
348
|
}));
|
|
@@ -363,25 +354,23 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
363
354
|
}, {
|
|
364
355
|
key: "Lock",
|
|
365
356
|
value: function () {
|
|
366
|
-
var _Lock = _asyncToGenerator(/*#__PURE__*/
|
|
357
|
+
var _Lock = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
|
|
367
358
|
var _this$obj6;
|
|
368
|
-
|
|
369
|
-
|
|
359
|
+
var _t8;
|
|
360
|
+
return _regenerator().w(function (_context0) {
|
|
361
|
+
while (1) switch (_context0.n) {
|
|
370
362
|
case 0:
|
|
371
|
-
_context0.
|
|
363
|
+
_context0.n = 1;
|
|
372
364
|
return (_this$obj6 = this.obj) === null || _this$obj6 === void 0 ? void 0 : _this$obj6.Lock();
|
|
373
|
-
case
|
|
374
|
-
|
|
375
|
-
if (
|
|
376
|
-
_context0.
|
|
365
|
+
case 1:
|
|
366
|
+
_t8 = _context0.v;
|
|
367
|
+
if (_t8) {
|
|
368
|
+
_context0.n = 2;
|
|
377
369
|
break;
|
|
378
370
|
}
|
|
379
|
-
|
|
380
|
-
case
|
|
381
|
-
return _context0.
|
|
382
|
-
case 6:
|
|
383
|
-
case "end":
|
|
384
|
-
return _context0.stop();
|
|
371
|
+
_t8 = false;
|
|
372
|
+
case 2:
|
|
373
|
+
return _context0.a(2, _t8);
|
|
385
374
|
}
|
|
386
375
|
}, _callee0, this);
|
|
387
376
|
}));
|
|
@@ -393,25 +382,23 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
393
382
|
}, {
|
|
394
383
|
key: "UnLock",
|
|
395
384
|
value: function () {
|
|
396
|
-
var _UnLock = _asyncToGenerator(/*#__PURE__*/
|
|
385
|
+
var _UnLock = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
|
|
397
386
|
var _this$obj7;
|
|
398
|
-
|
|
399
|
-
|
|
387
|
+
var _t9;
|
|
388
|
+
return _regenerator().w(function (_context1) {
|
|
389
|
+
while (1) switch (_context1.n) {
|
|
400
390
|
case 0:
|
|
401
|
-
_context1.
|
|
391
|
+
_context1.n = 1;
|
|
402
392
|
return (_this$obj7 = this.obj) === null || _this$obj7 === void 0 ? void 0 : _this$obj7.UnLock();
|
|
403
|
-
case
|
|
404
|
-
|
|
405
|
-
if (
|
|
406
|
-
_context1.
|
|
393
|
+
case 1:
|
|
394
|
+
_t9 = _context1.v;
|
|
395
|
+
if (_t9) {
|
|
396
|
+
_context1.n = 2;
|
|
407
397
|
break;
|
|
408
398
|
}
|
|
409
|
-
|
|
410
|
-
case
|
|
411
|
-
return _context1.
|
|
412
|
-
case 6:
|
|
413
|
-
case "end":
|
|
414
|
-
return _context1.stop();
|
|
399
|
+
_t9 = false;
|
|
400
|
+
case 2:
|
|
401
|
+
return _context1.a(2, _t9);
|
|
415
402
|
}
|
|
416
403
|
}, _callee1, this);
|
|
417
404
|
}));
|
|
@@ -423,25 +410,23 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
423
410
|
}, {
|
|
424
411
|
key: "Archive",
|
|
425
412
|
value: function () {
|
|
426
|
-
var _Archive = _asyncToGenerator(/*#__PURE__*/
|
|
413
|
+
var _Archive = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
|
|
427
414
|
var _this$obj8;
|
|
428
|
-
|
|
429
|
-
|
|
415
|
+
var _t0;
|
|
416
|
+
return _regenerator().w(function (_context10) {
|
|
417
|
+
while (1) switch (_context10.n) {
|
|
430
418
|
case 0:
|
|
431
|
-
_context10.
|
|
419
|
+
_context10.n = 1;
|
|
432
420
|
return (_this$obj8 = this.obj) === null || _this$obj8 === void 0 ? void 0 : _this$obj8.Archive();
|
|
433
|
-
case
|
|
434
|
-
|
|
435
|
-
if (
|
|
436
|
-
_context10.
|
|
421
|
+
case 1:
|
|
422
|
+
_t0 = _context10.v;
|
|
423
|
+
if (_t0) {
|
|
424
|
+
_context10.n = 2;
|
|
437
425
|
break;
|
|
438
426
|
}
|
|
439
|
-
|
|
440
|
-
case
|
|
441
|
-
return _context10.
|
|
442
|
-
case 6:
|
|
443
|
-
case "end":
|
|
444
|
-
return _context10.stop();
|
|
427
|
+
_t0 = false;
|
|
428
|
+
case 2:
|
|
429
|
+
return _context10.a(2, _t0);
|
|
445
430
|
}
|
|
446
431
|
}, _callee10, this);
|
|
447
432
|
}));
|
|
@@ -453,25 +438,23 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
453
438
|
}, {
|
|
454
439
|
key: "UnArchive",
|
|
455
440
|
value: function () {
|
|
456
|
-
var _UnArchive = _asyncToGenerator(/*#__PURE__*/
|
|
441
|
+
var _UnArchive = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
|
|
457
442
|
var _this$obj9;
|
|
458
|
-
|
|
459
|
-
|
|
443
|
+
var _t1;
|
|
444
|
+
return _regenerator().w(function (_context11) {
|
|
445
|
+
while (1) switch (_context11.n) {
|
|
460
446
|
case 0:
|
|
461
|
-
_context11.
|
|
447
|
+
_context11.n = 1;
|
|
462
448
|
return (_this$obj9 = this.obj) === null || _this$obj9 === void 0 ? void 0 : _this$obj9.UnArchive();
|
|
463
|
-
case
|
|
464
|
-
|
|
465
|
-
if (
|
|
466
|
-
_context11.
|
|
449
|
+
case 1:
|
|
450
|
+
_t1 = _context11.v;
|
|
451
|
+
if (_t1) {
|
|
452
|
+
_context11.n = 2;
|
|
467
453
|
break;
|
|
468
454
|
}
|
|
469
|
-
|
|
470
|
-
case
|
|
471
|
-
return _context11.
|
|
472
|
-
case 6:
|
|
473
|
-
case "end":
|
|
474
|
-
return _context11.stop();
|
|
455
|
+
_t1 = false;
|
|
456
|
+
case 2:
|
|
457
|
+
return _context11.a(2, _t1);
|
|
475
458
|
}
|
|
476
459
|
}, _callee11, this);
|
|
477
460
|
}));
|
|
@@ -483,51 +466,48 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
483
466
|
}, {
|
|
484
467
|
key: "Load",
|
|
485
468
|
value: (function () {
|
|
486
|
-
var _Load = _asyncToGenerator(/*#__PURE__*/
|
|
469
|
+
var _Load = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12(id) {
|
|
487
470
|
var classType, result_product;
|
|
488
|
-
return
|
|
489
|
-
while (1) switch (_context12.
|
|
471
|
+
return _regenerator().w(function (_context12) {
|
|
472
|
+
while (1) switch (_context12.p = _context12.n) {
|
|
490
473
|
case 0:
|
|
491
474
|
if (id) {
|
|
492
|
-
_context12.
|
|
475
|
+
_context12.n = 1;
|
|
493
476
|
break;
|
|
494
477
|
}
|
|
495
|
-
return _context12.
|
|
496
|
-
case
|
|
497
|
-
_context12.
|
|
478
|
+
return _context12.a(2);
|
|
479
|
+
case 1:
|
|
480
|
+
_context12.p = 1;
|
|
498
481
|
this.event_run("on_process_start", true);
|
|
499
482
|
classType = this.getObjectType();
|
|
500
483
|
if (!classType) {
|
|
501
484
|
console.error("[webobjectmanager]", "getObjectType failed to get the object_type.", "did you set the __object_type correctly ?");
|
|
502
485
|
}
|
|
503
|
-
_context12.
|
|
486
|
+
_context12.n = 2;
|
|
504
487
|
return classType.get_single(id, false);
|
|
505
|
-
case
|
|
506
|
-
result_product = _context12.
|
|
488
|
+
case 2:
|
|
489
|
+
result_product = _context12.v;
|
|
507
490
|
if (!(result_product && _typeof(result_product) === "object" && _index.WebObject.getID(result_product))) {
|
|
508
|
-
_context12.
|
|
491
|
+
_context12.n = 4;
|
|
509
492
|
break;
|
|
510
493
|
}
|
|
511
494
|
this.setObject(result_product);
|
|
512
|
-
_context12.
|
|
495
|
+
_context12.n = 3;
|
|
513
496
|
return result_product.onLoad();
|
|
514
|
-
case
|
|
515
|
-
_context12.
|
|
497
|
+
case 3:
|
|
498
|
+
_context12.n = 5;
|
|
516
499
|
break;
|
|
517
|
-
case
|
|
500
|
+
case 4:
|
|
518
501
|
console.error("badobject:", id, result_product);
|
|
519
502
|
_index.WebObject.addError(this.obj, "Invalid ".concat(this.__object_name), "The loaded ".concat(this.__object_name, " from website is invalid"), true);
|
|
520
|
-
case
|
|
521
|
-
_context12.
|
|
503
|
+
case 5:
|
|
504
|
+
_context12.p = 5;
|
|
522
505
|
this.event_run("on_process_end", true);
|
|
523
|
-
return _context12.
|
|
524
|
-
case
|
|
525
|
-
return _context12.
|
|
526
|
-
case 21:
|
|
527
|
-
case "end":
|
|
528
|
-
return _context12.stop();
|
|
506
|
+
return _context12.f(5);
|
|
507
|
+
case 6:
|
|
508
|
+
return _context12.a(2, this.getObject());
|
|
529
509
|
}
|
|
530
|
-
}, _callee12, this, [[
|
|
510
|
+
}, _callee12, this, [[1,, 5, 6]]);
|
|
531
511
|
}));
|
|
532
512
|
function Load(_x7) {
|
|
533
513
|
return _Load.apply(this, arguments);
|
|
@@ -573,30 +553,27 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
573
553
|
/* -------------------------------------------------------------------------- */
|
|
574
554
|
/* Default Events */
|
|
575
555
|
/* -------------------------------------------------------------------------- */
|
|
576
|
-
/**
|
|
577
|
-
* Use this when you delete Object
|
|
578
|
-
* @param p
|
|
579
|
-
* @returns
|
|
556
|
+
/**
|
|
557
|
+
* Use this when you delete Object
|
|
558
|
+
* @param p
|
|
559
|
+
* @returns
|
|
580
560
|
*/
|
|
581
561
|
}, {
|
|
582
562
|
key: "onDelete",
|
|
583
563
|
value: (function () {
|
|
584
|
-
var _onDelete = _asyncToGenerator(/*#__PURE__*/
|
|
564
|
+
var _onDelete = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
|
|
585
565
|
var srt;
|
|
586
|
-
return
|
|
587
|
-
while (1) switch (_context13.
|
|
566
|
+
return _regenerator().w(function (_context13) {
|
|
567
|
+
while (1) switch (_context13.n) {
|
|
588
568
|
case 0:
|
|
589
569
|
srt = this.getSaveResultType();
|
|
590
|
-
_context13.
|
|
570
|
+
_context13.n = 1;
|
|
591
571
|
return this.event_run("on_delete", srt);
|
|
592
|
-
case
|
|
593
|
-
_context13.
|
|
572
|
+
case 1:
|
|
573
|
+
_context13.n = 2;
|
|
594
574
|
return this.event_run("on_after_delete", srt);
|
|
595
|
-
case
|
|
596
|
-
return _context13.
|
|
597
|
-
case 6:
|
|
598
|
-
case "end":
|
|
599
|
-
return _context13.stop();
|
|
575
|
+
case 2:
|
|
576
|
+
return _context13.a(2, true);
|
|
600
577
|
}
|
|
601
578
|
}, _callee13, this);
|
|
602
579
|
}));
|
|
@@ -608,22 +585,19 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
608
585
|
}, {
|
|
609
586
|
key: "onArchive",
|
|
610
587
|
value: function () {
|
|
611
|
-
var _onArchive = _asyncToGenerator(/*#__PURE__*/
|
|
588
|
+
var _onArchive = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14() {
|
|
612
589
|
var srt;
|
|
613
|
-
return
|
|
614
|
-
while (1) switch (_context14.
|
|
590
|
+
return _regenerator().w(function (_context14) {
|
|
591
|
+
while (1) switch (_context14.n) {
|
|
615
592
|
case 0:
|
|
616
593
|
srt = this.getSaveResultType();
|
|
617
|
-
_context14.
|
|
594
|
+
_context14.n = 1;
|
|
618
595
|
return this.event_run("on_archive", srt);
|
|
619
|
-
case
|
|
620
|
-
_context14.
|
|
596
|
+
case 1:
|
|
597
|
+
_context14.n = 2;
|
|
621
598
|
return this.event_run("on_after_archive", srt);
|
|
622
|
-
case
|
|
623
|
-
return _context14.
|
|
624
|
-
case 6:
|
|
625
|
-
case "end":
|
|
626
|
-
return _context14.stop();
|
|
599
|
+
case 2:
|
|
600
|
+
return _context14.a(2, true);
|
|
627
601
|
}
|
|
628
602
|
}, _callee14, this);
|
|
629
603
|
}));
|
|
@@ -635,22 +609,19 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
635
609
|
}, {
|
|
636
610
|
key: "onUnArchive",
|
|
637
611
|
value: function () {
|
|
638
|
-
var _onUnArchive = _asyncToGenerator(/*#__PURE__*/
|
|
612
|
+
var _onUnArchive = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
|
|
639
613
|
var srt;
|
|
640
|
-
return
|
|
641
|
-
while (1) switch (_context15.
|
|
614
|
+
return _regenerator().w(function (_context15) {
|
|
615
|
+
while (1) switch (_context15.n) {
|
|
642
616
|
case 0:
|
|
643
617
|
srt = this.getSaveResultType();
|
|
644
|
-
_context15.
|
|
618
|
+
_context15.n = 1;
|
|
645
619
|
return this.event_run("on_unarchive", srt);
|
|
646
|
-
case
|
|
647
|
-
_context15.
|
|
620
|
+
case 1:
|
|
621
|
+
_context15.n = 2;
|
|
648
622
|
return this.event_run("on_after_unarchive", srt);
|
|
649
|
-
case
|
|
650
|
-
return _context15.
|
|
651
|
-
case 6:
|
|
652
|
-
case "end":
|
|
653
|
-
return _context15.stop();
|
|
623
|
+
case 2:
|
|
624
|
+
return _context15.a(2, true);
|
|
654
625
|
}
|
|
655
626
|
}, _callee15, this);
|
|
656
627
|
}));
|
|
@@ -662,22 +633,19 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
662
633
|
}, {
|
|
663
634
|
key: "onLock",
|
|
664
635
|
value: function () {
|
|
665
|
-
var _onLock = _asyncToGenerator(/*#__PURE__*/
|
|
636
|
+
var _onLock = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16() {
|
|
666
637
|
var srt;
|
|
667
|
-
return
|
|
668
|
-
while (1) switch (_context16.
|
|
638
|
+
return _regenerator().w(function (_context16) {
|
|
639
|
+
while (1) switch (_context16.n) {
|
|
669
640
|
case 0:
|
|
670
641
|
srt = this.getSaveResultType();
|
|
671
|
-
_context16.
|
|
642
|
+
_context16.n = 1;
|
|
672
643
|
return this.event_run("on_lock", srt);
|
|
673
|
-
case
|
|
674
|
-
_context16.
|
|
644
|
+
case 1:
|
|
645
|
+
_context16.n = 2;
|
|
675
646
|
return this.event_run("on_after_lock", srt);
|
|
676
|
-
case
|
|
677
|
-
return _context16.
|
|
678
|
-
case 6:
|
|
679
|
-
case "end":
|
|
680
|
-
return _context16.stop();
|
|
647
|
+
case 2:
|
|
648
|
+
return _context16.a(2, true);
|
|
681
649
|
}
|
|
682
650
|
}, _callee16, this);
|
|
683
651
|
}));
|
|
@@ -689,22 +657,19 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
689
657
|
}, {
|
|
690
658
|
key: "onUnLock",
|
|
691
659
|
value: function () {
|
|
692
|
-
var _onUnLock = _asyncToGenerator(/*#__PURE__*/
|
|
660
|
+
var _onUnLock = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
|
|
693
661
|
var srt;
|
|
694
|
-
return
|
|
695
|
-
while (1) switch (_context17.
|
|
662
|
+
return _regenerator().w(function (_context17) {
|
|
663
|
+
while (1) switch (_context17.n) {
|
|
696
664
|
case 0:
|
|
697
665
|
srt = this.getSaveResultType();
|
|
698
|
-
_context17.
|
|
666
|
+
_context17.n = 1;
|
|
699
667
|
return this.event_run("on_unlock", srt);
|
|
700
|
-
case
|
|
701
|
-
_context17.
|
|
668
|
+
case 1:
|
|
669
|
+
_context17.n = 2;
|
|
702
670
|
return this.event_run("on_after_unlock", srt);
|
|
703
|
-
case
|
|
704
|
-
return _context17.
|
|
705
|
-
case 6:
|
|
706
|
-
case "end":
|
|
707
|
-
return _context17.stop();
|
|
671
|
+
case 2:
|
|
672
|
+
return _context17.a(2, true);
|
|
708
673
|
}
|
|
709
674
|
}, _callee17, this);
|
|
710
675
|
}));
|
|
@@ -713,41 +678,38 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
713
678
|
}
|
|
714
679
|
return onUnLock;
|
|
715
680
|
}()
|
|
716
|
-
/**
|
|
717
|
-
* Use this when you load new Object
|
|
718
|
-
* @param p
|
|
719
|
-
* @returns
|
|
681
|
+
/**
|
|
682
|
+
* Use this when you load new Object
|
|
683
|
+
* @param p
|
|
684
|
+
* @returns
|
|
720
685
|
*/
|
|
721
686
|
}, {
|
|
722
687
|
key: "onNew",
|
|
723
688
|
value: (function () {
|
|
724
|
-
var _onNew = _asyncToGenerator(/*#__PURE__*/
|
|
689
|
+
var _onNew = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18() {
|
|
725
690
|
var _this$obj1;
|
|
726
|
-
return
|
|
727
|
-
while (1) switch (_context18.
|
|
691
|
+
return _regenerator().w(function (_context18) {
|
|
692
|
+
while (1) switch (_context18.n) {
|
|
728
693
|
case 0:
|
|
729
694
|
if (this.canModify) {
|
|
730
695
|
(_this$obj1 = this.obj) === null || _this$obj1 === void 0 || _this$obj1.setOriginal();
|
|
731
696
|
}
|
|
732
|
-
_context18.
|
|
697
|
+
_context18.n = 1;
|
|
733
698
|
return this.event_run("on_new");
|
|
734
|
-
case
|
|
735
|
-
_context18.
|
|
699
|
+
case 1:
|
|
700
|
+
_context18.n = 2;
|
|
736
701
|
return this.event_run("on_change", true);
|
|
737
|
-
case
|
|
738
|
-
_context18.
|
|
702
|
+
case 2:
|
|
703
|
+
_context18.n = 3;
|
|
739
704
|
return this.event_run("on_after_new");
|
|
740
|
-
case
|
|
741
|
-
_context18.
|
|
705
|
+
case 3:
|
|
706
|
+
_context18.n = 4;
|
|
742
707
|
return this.checkIsChanged();
|
|
743
|
-
case
|
|
744
|
-
_context18.
|
|
708
|
+
case 4:
|
|
709
|
+
_context18.n = 5;
|
|
745
710
|
return Promise.resolve(true);
|
|
746
|
-
case
|
|
747
|
-
return _context18.
|
|
748
|
-
case 12:
|
|
749
|
-
case "end":
|
|
750
|
-
return _context18.stop();
|
|
711
|
+
case 5:
|
|
712
|
+
return _context18.a(2, _context18.v);
|
|
751
713
|
}
|
|
752
714
|
}, _callee18, this);
|
|
753
715
|
}));
|
|
@@ -756,42 +718,39 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
756
718
|
}
|
|
757
719
|
return onNew;
|
|
758
720
|
}()
|
|
759
|
-
/**
|
|
760
|
-
* Use this when you load data to the object
|
|
761
|
-
* @param p
|
|
762
|
-
* @returns
|
|
721
|
+
/**
|
|
722
|
+
* Use this when you load data to the object
|
|
723
|
+
* @param p
|
|
724
|
+
* @returns
|
|
763
725
|
*/
|
|
764
726
|
)
|
|
765
727
|
}, {
|
|
766
728
|
key: "onLoad",
|
|
767
729
|
value: (function () {
|
|
768
|
-
var _onLoad = _asyncToGenerator(/*#__PURE__*/
|
|
769
|
-
return
|
|
770
|
-
while (1) switch (_context19.
|
|
730
|
+
var _onLoad = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19() {
|
|
731
|
+
return _regenerator().w(function (_context19) {
|
|
732
|
+
while (1) switch (_context19.n) {
|
|
771
733
|
case 0:
|
|
772
734
|
if (this.canModify && this.obj) {
|
|
773
735
|
this.obj.isDeleted = false;
|
|
774
736
|
this.obj.setOriginal();
|
|
775
737
|
}
|
|
776
|
-
_context19.
|
|
738
|
+
_context19.n = 1;
|
|
777
739
|
return this.event_run("on_load");
|
|
778
|
-
case
|
|
779
|
-
_context19.
|
|
740
|
+
case 1:
|
|
741
|
+
_context19.n = 2;
|
|
780
742
|
return this.event_run("on_change", true);
|
|
781
|
-
case
|
|
782
|
-
_context19.
|
|
743
|
+
case 2:
|
|
744
|
+
_context19.n = 3;
|
|
783
745
|
return this.event_run("on_after_load");
|
|
784
|
-
case
|
|
785
|
-
_context19.
|
|
746
|
+
case 3:
|
|
747
|
+
_context19.n = 4;
|
|
786
748
|
return this.event_run("on_load_finished");
|
|
787
|
-
case
|
|
788
|
-
_context19.
|
|
749
|
+
case 4:
|
|
750
|
+
_context19.n = 5;
|
|
789
751
|
return this.checkIsChanged();
|
|
790
|
-
case
|
|
791
|
-
return _context19.
|
|
792
|
-
case 12:
|
|
793
|
-
case "end":
|
|
794
|
-
return _context19.stop();
|
|
752
|
+
case 5:
|
|
753
|
+
return _context19.a(2, true);
|
|
795
754
|
}
|
|
796
755
|
}, _callee19, this);
|
|
797
756
|
}));
|
|
@@ -800,37 +759,34 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
800
759
|
}
|
|
801
760
|
return onLoad;
|
|
802
761
|
}()
|
|
803
|
-
/**
|
|
804
|
-
* Use this after succesful save to Database
|
|
805
|
-
* @param p
|
|
806
|
-
* @returns
|
|
762
|
+
/**
|
|
763
|
+
* Use this after succesful save to Database
|
|
764
|
+
* @param p
|
|
765
|
+
* @returns
|
|
807
766
|
*/
|
|
808
767
|
)
|
|
809
768
|
}, {
|
|
810
769
|
key: "onSave",
|
|
811
770
|
value: (function () {
|
|
812
|
-
var _onSave = _asyncToGenerator(/*#__PURE__*/
|
|
771
|
+
var _onSave = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20() {
|
|
813
772
|
var srt;
|
|
814
|
-
return
|
|
815
|
-
while (1) switch (_context20.
|
|
773
|
+
return _regenerator().w(function (_context20) {
|
|
774
|
+
while (1) switch (_context20.n) {
|
|
816
775
|
case 0:
|
|
817
776
|
srt = this.getSaveResultType();
|
|
818
|
-
_context20.
|
|
777
|
+
_context20.n = 1;
|
|
819
778
|
return this.event_run("on_save", srt);
|
|
820
|
-
case
|
|
821
|
-
_context20.
|
|
779
|
+
case 1:
|
|
780
|
+
_context20.n = 2;
|
|
822
781
|
return this.event_run("on_change", true);
|
|
823
|
-
case
|
|
824
|
-
_context20.
|
|
782
|
+
case 2:
|
|
783
|
+
_context20.n = 3;
|
|
825
784
|
return this.checkIsChanged();
|
|
826
|
-
case
|
|
827
|
-
_context20.
|
|
785
|
+
case 3:
|
|
786
|
+
_context20.n = 4;
|
|
828
787
|
return Promise.resolve(true);
|
|
829
|
-
case
|
|
830
|
-
return _context20.
|
|
831
|
-
case 10:
|
|
832
|
-
case "end":
|
|
833
|
-
return _context20.stop();
|
|
788
|
+
case 4:
|
|
789
|
+
return _context20.a(2, _context20.v);
|
|
834
790
|
}
|
|
835
791
|
}, _callee20, this);
|
|
836
792
|
}));
|
|
@@ -842,25 +798,22 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
842
798
|
}, {
|
|
843
799
|
key: "onAfterSave",
|
|
844
800
|
value: function () {
|
|
845
|
-
var _onAfterSave = _asyncToGenerator(/*#__PURE__*/
|
|
801
|
+
var _onAfterSave = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21() {
|
|
846
802
|
var srt;
|
|
847
|
-
return
|
|
848
|
-
while (1) switch (_context21.
|
|
803
|
+
return _regenerator().w(function (_context21) {
|
|
804
|
+
while (1) switch (_context21.n) {
|
|
849
805
|
case 0:
|
|
850
806
|
srt = this.getSaveResultType();
|
|
851
|
-
_context21.
|
|
807
|
+
_context21.n = 1;
|
|
852
808
|
return this.event_run("on_after_save", srt);
|
|
853
|
-
case
|
|
854
|
-
_context21.
|
|
809
|
+
case 1:
|
|
810
|
+
_context21.n = 2;
|
|
855
811
|
return this.event_run("on_save_finished", srt);
|
|
856
|
-
case
|
|
857
|
-
_context21.
|
|
812
|
+
case 2:
|
|
813
|
+
_context21.n = 3;
|
|
858
814
|
return Promise.resolve(true);
|
|
859
|
-
case
|
|
860
|
-
return _context21.
|
|
861
|
-
case 8:
|
|
862
|
-
case "end":
|
|
863
|
-
return _context21.stop();
|
|
815
|
+
case 3:
|
|
816
|
+
return _context21.a(2, _context21.v);
|
|
864
817
|
}
|
|
865
818
|
}, _callee21, this);
|
|
866
819
|
}));
|