@azrico/webobject 1.4.95 → 1.4.97
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.
|
@@ -42,6 +42,7 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
42
42
|
_defineProperty(_assertThisInitialized(_this), "__last_web_path", "");
|
|
43
43
|
_defineProperty(_assertThisInitialized(_this), "__last_web_type", "");
|
|
44
44
|
if (_this.constructor["__save_message"]) {
|
|
45
|
+
var _ref2, _ref3, _ref4;
|
|
45
46
|
_this.event_add("on_save", "on_save-sendmsg", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
46
47
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
47
48
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -79,68 +80,99 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
79
80
|
}
|
|
80
81
|
}, _callee);
|
|
81
82
|
})));
|
|
82
|
-
_this.event_add("
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
})
|
|
113
|
-
_this.event_add("
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
})
|
|
83
|
+
_this.event_add("on_archive", "on_archive-sendmsg", function (_x) {
|
|
84
|
+
return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(srType) {
|
|
85
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
86
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
87
|
+
case 0:
|
|
88
|
+
_context2.t0 = srType;
|
|
89
|
+
_context2.next = _context2.t0 === "normal" ? 3 : 6;
|
|
90
|
+
break;
|
|
91
|
+
case 3:
|
|
92
|
+
_context2.next = 5;
|
|
93
|
+
return _global.gfunc.run_action("show_message", {
|
|
94
|
+
message: "Archived",
|
|
95
|
+
type: "success"
|
|
96
|
+
});
|
|
97
|
+
case 5:
|
|
98
|
+
return _context2.abrupt("return", _context2.sent);
|
|
99
|
+
case 6:
|
|
100
|
+
_context2.next = 8;
|
|
101
|
+
return _global.gfunc.run_action("show_message", {
|
|
102
|
+
message: "Not archived (".concat(srType, ")"),
|
|
103
|
+
type: "error"
|
|
104
|
+
});
|
|
105
|
+
case 8:
|
|
106
|
+
return _context2.abrupt("return", _context2.sent);
|
|
107
|
+
case 9:
|
|
108
|
+
case "end":
|
|
109
|
+
return _context2.stop();
|
|
110
|
+
}
|
|
111
|
+
}, _callee2);
|
|
112
|
+
}))).apply(this, arguments);
|
|
113
|
+
});
|
|
114
|
+
_this.event_add("on_unarchive", "on_unarchive-sendmsg", function (_x2) {
|
|
115
|
+
return (_ref3 = _ref3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(srType) {
|
|
116
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
117
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
118
|
+
case 0:
|
|
119
|
+
_context3.t0 = srType;
|
|
120
|
+
_context3.next = _context3.t0 === "normal" ? 3 : 6;
|
|
121
|
+
break;
|
|
122
|
+
case 3:
|
|
123
|
+
_context3.next = 5;
|
|
124
|
+
return _global.gfunc.run_action("show_message", {
|
|
125
|
+
message: "Restored",
|
|
126
|
+
type: "success"
|
|
127
|
+
});
|
|
128
|
+
case 5:
|
|
129
|
+
return _context3.abrupt("return", _context3.sent);
|
|
130
|
+
case 6:
|
|
131
|
+
_context3.next = 8;
|
|
132
|
+
return _global.gfunc.run_action("show_message", {
|
|
133
|
+
message: "Not restored (".concat(srType, ")"),
|
|
134
|
+
type: "error"
|
|
135
|
+
});
|
|
136
|
+
case 8:
|
|
137
|
+
return _context3.abrupt("return", _context3.sent);
|
|
138
|
+
case 9:
|
|
139
|
+
case "end":
|
|
140
|
+
return _context3.stop();
|
|
141
|
+
}
|
|
142
|
+
}, _callee3);
|
|
143
|
+
}))).apply(this, arguments);
|
|
144
|
+
});
|
|
145
|
+
_this.event_add("on_delete", "on_delete-sendmsg", function (_x3) {
|
|
146
|
+
return (_ref4 = _ref4 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(srType) {
|
|
147
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
148
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
149
|
+
case 0:
|
|
150
|
+
_context4.t0 = srType;
|
|
151
|
+
_context4.next = _context4.t0 === "normal" ? 3 : 6;
|
|
152
|
+
break;
|
|
153
|
+
case 3:
|
|
154
|
+
_context4.next = 5;
|
|
155
|
+
return _global.gfunc.run_action("show_message", {
|
|
156
|
+
message: "Deleted",
|
|
157
|
+
type: "success"
|
|
158
|
+
});
|
|
159
|
+
case 5:
|
|
160
|
+
return _context4.abrupt("return", _context4.sent);
|
|
161
|
+
case 6:
|
|
162
|
+
_context4.next = 8;
|
|
163
|
+
return _global.gfunc.run_action("show_message", {
|
|
164
|
+
message: "Not deleted (".concat(srType, ")"),
|
|
165
|
+
type: "error"
|
|
166
|
+
});
|
|
167
|
+
case 8:
|
|
168
|
+
return _context4.abrupt("return", _context4.sent);
|
|
169
|
+
case 9:
|
|
170
|
+
case "end":
|
|
171
|
+
return _context4.stop();
|
|
172
|
+
}
|
|
173
|
+
}, _callee4);
|
|
174
|
+
}))).apply(this, arguments);
|
|
175
|
+
});
|
|
144
176
|
}
|
|
145
177
|
return _this;
|
|
146
178
|
}
|
|
@@ -168,24 +200,24 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
168
200
|
*/
|
|
169
201
|
}, {
|
|
170
202
|
key: "setMetaValue",
|
|
171
|
-
value: function setMetaValue(
|
|
172
|
-
return (_setMetaValue = _setMetaValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
203
|
+
value: function setMetaValue(_x4, _x5) {
|
|
204
|
+
return (_setMetaValue = _setMetaValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, value) {
|
|
173
205
|
var _this$obj;
|
|
174
206
|
var sendChange,
|
|
175
|
-
|
|
176
|
-
return _regeneratorRuntime().wrap(function
|
|
177
|
-
while (1) switch (
|
|
207
|
+
_args5 = arguments;
|
|
208
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
209
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
178
210
|
case 0:
|
|
179
|
-
sendChange =
|
|
180
|
-
|
|
211
|
+
sendChange = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : "auto";
|
|
212
|
+
_context5.next = 3;
|
|
181
213
|
return (_this$obj = this.obj) === null || _this$obj === void 0 ? void 0 : _this$obj.setMetaValue(key, value, sendChange);
|
|
182
214
|
case 3:
|
|
183
|
-
return
|
|
215
|
+
return _context5.abrupt("return", _context5.sent);
|
|
184
216
|
case 4:
|
|
185
217
|
case "end":
|
|
186
|
-
return
|
|
218
|
+
return _context5.stop();
|
|
187
219
|
}
|
|
188
|
-
},
|
|
220
|
+
}, _callee5, this);
|
|
189
221
|
}))).apply(this, arguments);
|
|
190
222
|
}
|
|
191
223
|
}, {
|
|
@@ -198,68 +230,68 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
198
230
|
}, {
|
|
199
231
|
key: "get_deltaObject",
|
|
200
232
|
value: function get_deltaObject() {
|
|
201
|
-
return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
233
|
+
return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
202
234
|
var _this$obj3;
|
|
203
|
-
return _regeneratorRuntime().wrap(function
|
|
204
|
-
while (1) switch (
|
|
235
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
236
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
205
237
|
case 0:
|
|
206
|
-
|
|
238
|
+
_context6.next = 2;
|
|
207
239
|
return (_this$obj3 = this.obj) === null || _this$obj3 === void 0 ? void 0 : _this$obj3.get_deltaObject();
|
|
208
240
|
case 2:
|
|
209
|
-
|
|
210
|
-
if (
|
|
211
|
-
|
|
241
|
+
_context6.t0 = _context6.sent;
|
|
242
|
+
if (_context6.t0) {
|
|
243
|
+
_context6.next = 5;
|
|
212
244
|
break;
|
|
213
245
|
}
|
|
214
|
-
|
|
246
|
+
_context6.t0 = {};
|
|
215
247
|
case 5:
|
|
216
|
-
return
|
|
248
|
+
return _context6.abrupt("return", _context6.t0);
|
|
217
249
|
case 6:
|
|
218
250
|
case "end":
|
|
219
|
-
return
|
|
251
|
+
return _context6.stop();
|
|
220
252
|
}
|
|
221
|
-
},
|
|
253
|
+
}, _callee6, this);
|
|
222
254
|
}))).apply(this, arguments);
|
|
223
255
|
} /* ------------------------------ save and load ----------------------------- */
|
|
224
256
|
}, {
|
|
225
257
|
key: "Save",
|
|
226
258
|
value: function Save() {
|
|
227
|
-
return (_Save = _Save || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
259
|
+
return (_Save = _Save || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
228
260
|
var _this$obj4;
|
|
229
|
-
return _regeneratorRuntime().wrap(function
|
|
230
|
-
while (1) switch (
|
|
261
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
262
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
231
263
|
case 0:
|
|
232
|
-
|
|
264
|
+
_context7.next = 2;
|
|
233
265
|
return (_this$obj4 = this.obj) === null || _this$obj4 === void 0 ? void 0 : _this$obj4.Save();
|
|
234
266
|
case 2:
|
|
235
|
-
|
|
236
|
-
if (
|
|
237
|
-
|
|
267
|
+
_context7.t0 = _context7.sent;
|
|
268
|
+
if (_context7.t0) {
|
|
269
|
+
_context7.next = 5;
|
|
238
270
|
break;
|
|
239
271
|
}
|
|
240
|
-
|
|
272
|
+
_context7.t0 = false;
|
|
241
273
|
case 5:
|
|
242
|
-
return
|
|
274
|
+
return _context7.abrupt("return", _context7.t0);
|
|
243
275
|
case 6:
|
|
244
276
|
case "end":
|
|
245
|
-
return
|
|
277
|
+
return _context7.stop();
|
|
246
278
|
}
|
|
247
|
-
},
|
|
279
|
+
}, _callee7, this);
|
|
248
280
|
}))).apply(this, arguments);
|
|
249
281
|
}
|
|
250
282
|
}, {
|
|
251
283
|
key: "Load",
|
|
252
|
-
value: function Load(
|
|
253
|
-
return (_Load = _Load || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
254
|
-
return _regeneratorRuntime().wrap(function
|
|
255
|
-
while (1) switch (
|
|
284
|
+
value: function Load(_x6) {
|
|
285
|
+
return (_Load = _Load || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(search) {
|
|
286
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
287
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
256
288
|
case 0:
|
|
257
289
|
throw Error("load not implented");
|
|
258
290
|
case 1:
|
|
259
291
|
case "end":
|
|
260
|
-
return
|
|
292
|
+
return _context8.stop();
|
|
261
293
|
}
|
|
262
|
-
},
|
|
294
|
+
}, _callee8);
|
|
263
295
|
}))).apply(this, arguments);
|
|
264
296
|
}
|
|
265
297
|
/* -------------------------------------------------------------------------- */
|
|
@@ -295,32 +327,32 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
295
327
|
}, {
|
|
296
328
|
key: "onNew",
|
|
297
329
|
value: function onNew() {
|
|
298
|
-
return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
330
|
+
return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
299
331
|
var _this$obj9;
|
|
300
|
-
return _regeneratorRuntime().wrap(function
|
|
301
|
-
while (1) switch (
|
|
332
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
333
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
302
334
|
case 0:
|
|
303
335
|
if (this.canModify) {
|
|
304
336
|
(_this$obj9 = this.obj) === null || _this$obj9 === void 0 || _this$obj9.setOriginal();
|
|
305
337
|
}
|
|
306
|
-
|
|
338
|
+
_context9.next = 3;
|
|
307
339
|
return this.event_run("on_new");
|
|
308
340
|
case 3:
|
|
309
|
-
|
|
341
|
+
_context9.next = 5;
|
|
310
342
|
return this.event_run("on_change", true);
|
|
311
343
|
case 5:
|
|
312
|
-
|
|
344
|
+
_context9.next = 7;
|
|
313
345
|
return this.event_run("on_after_new");
|
|
314
346
|
case 7:
|
|
315
|
-
|
|
347
|
+
_context9.next = 9;
|
|
316
348
|
return Promise.resolve(true);
|
|
317
349
|
case 9:
|
|
318
|
-
return
|
|
350
|
+
return _context9.abrupt("return", _context9.sent);
|
|
319
351
|
case 10:
|
|
320
352
|
case "end":
|
|
321
|
-
return
|
|
353
|
+
return _context9.stop();
|
|
322
354
|
}
|
|
323
|
-
},
|
|
355
|
+
}, _callee9, this);
|
|
324
356
|
}))).apply(this, arguments);
|
|
325
357
|
}
|
|
326
358
|
/**
|
|
@@ -331,64 +363,70 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
331
363
|
}, {
|
|
332
364
|
key: "onDelete",
|
|
333
365
|
value: function onDelete() {
|
|
334
|
-
return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
335
|
-
|
|
336
|
-
|
|
366
|
+
return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
367
|
+
var srt;
|
|
368
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
369
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
337
370
|
case 0:
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
return _context9.abrupt("return", true);
|
|
371
|
+
srt = this.getSaveResultType();
|
|
372
|
+
_context10.next = 3;
|
|
373
|
+
return this.event_run("on_delete", srt);
|
|
374
|
+
case 3:
|
|
375
|
+
_context10.next = 5;
|
|
376
|
+
return this.event_run("on_after_delete", srt);
|
|
345
377
|
case 5:
|
|
378
|
+
return _context10.abrupt("return", true);
|
|
379
|
+
case 6:
|
|
346
380
|
case "end":
|
|
347
|
-
return
|
|
381
|
+
return _context10.stop();
|
|
348
382
|
}
|
|
349
|
-
},
|
|
383
|
+
}, _callee10, this);
|
|
350
384
|
}))).apply(this, arguments);
|
|
351
385
|
}
|
|
352
386
|
}, {
|
|
353
387
|
key: "onArchive",
|
|
354
388
|
value: function onArchive() {
|
|
355
|
-
return (_onArchive = _onArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
356
|
-
|
|
357
|
-
|
|
389
|
+
return (_onArchive = _onArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
390
|
+
var srt;
|
|
391
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
392
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
358
393
|
case 0:
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
return _context10.abrupt("return", true);
|
|
394
|
+
srt = this.getSaveResultType();
|
|
395
|
+
_context11.next = 3;
|
|
396
|
+
return this.event_run("on_archive", srt);
|
|
397
|
+
case 3:
|
|
398
|
+
_context11.next = 5;
|
|
399
|
+
return this.event_run("on_after_archive", srt);
|
|
366
400
|
case 5:
|
|
401
|
+
return _context11.abrupt("return", true);
|
|
402
|
+
case 6:
|
|
367
403
|
case "end":
|
|
368
|
-
return
|
|
404
|
+
return _context11.stop();
|
|
369
405
|
}
|
|
370
|
-
},
|
|
406
|
+
}, _callee11, this);
|
|
371
407
|
}))).apply(this, arguments);
|
|
372
408
|
}
|
|
373
409
|
}, {
|
|
374
410
|
key: "onUnArchive",
|
|
375
411
|
value: function onUnArchive() {
|
|
376
|
-
return (_onUnArchive = _onUnArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
377
|
-
|
|
378
|
-
|
|
412
|
+
return (_onUnArchive = _onUnArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
413
|
+
var srt;
|
|
414
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
415
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
379
416
|
case 0:
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
return _context11.abrupt("return", true);
|
|
417
|
+
srt = this.getSaveResultType();
|
|
418
|
+
_context12.next = 3;
|
|
419
|
+
return this.event_run("on_unarchive", srt);
|
|
420
|
+
case 3:
|
|
421
|
+
_context12.next = 5;
|
|
422
|
+
return this.event_run("on_after_unarchive", srt);
|
|
387
423
|
case 5:
|
|
424
|
+
return _context12.abrupt("return", true);
|
|
425
|
+
case 6:
|
|
388
426
|
case "end":
|
|
389
|
-
return
|
|
427
|
+
return _context12.stop();
|
|
390
428
|
}
|
|
391
|
-
},
|
|
429
|
+
}, _callee12, this);
|
|
392
430
|
}))).apply(this, arguments);
|
|
393
431
|
}
|
|
394
432
|
/**
|
|
@@ -399,32 +437,32 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
399
437
|
}, {
|
|
400
438
|
key: "onLoad",
|
|
401
439
|
value: function onLoad() {
|
|
402
|
-
return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
403
|
-
return _regeneratorRuntime().wrap(function
|
|
404
|
-
while (1) switch (
|
|
440
|
+
return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
441
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
442
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
405
443
|
case 0:
|
|
406
444
|
if (this.canModify && this.obj) {
|
|
407
445
|
this.obj.isDeleted = false;
|
|
408
446
|
this.obj.setOriginal();
|
|
409
447
|
}
|
|
410
|
-
|
|
448
|
+
_context13.next = 3;
|
|
411
449
|
return this.event_run("on_load");
|
|
412
450
|
case 3:
|
|
413
|
-
|
|
451
|
+
_context13.next = 5;
|
|
414
452
|
return this.event_run("on_change", true);
|
|
415
453
|
case 5:
|
|
416
|
-
|
|
454
|
+
_context13.next = 7;
|
|
417
455
|
return this.event_run("on_after_load");
|
|
418
456
|
case 7:
|
|
419
|
-
|
|
457
|
+
_context13.next = 9;
|
|
420
458
|
return this.event_run("on_load_finished");
|
|
421
459
|
case 9:
|
|
422
|
-
return
|
|
460
|
+
return _context13.abrupt("return", true);
|
|
423
461
|
case 10:
|
|
424
462
|
case "end":
|
|
425
|
-
return
|
|
463
|
+
return _context13.stop();
|
|
426
464
|
}
|
|
427
|
-
},
|
|
465
|
+
}, _callee13, this);
|
|
428
466
|
}))).apply(this, arguments);
|
|
429
467
|
}
|
|
430
468
|
/**
|
|
@@ -435,49 +473,53 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
435
473
|
}, {
|
|
436
474
|
key: "onSave",
|
|
437
475
|
value: function onSave() {
|
|
438
|
-
return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
439
|
-
|
|
440
|
-
|
|
476
|
+
return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
477
|
+
var srt;
|
|
478
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
479
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
441
480
|
case 0:
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
481
|
+
srt = this.getSaveResultType();
|
|
482
|
+
_context14.next = 3;
|
|
483
|
+
return this.event_run("on_save", srt);
|
|
484
|
+
case 3:
|
|
485
|
+
_context14.next = 5;
|
|
446
486
|
return this.event_run("on_change", true);
|
|
447
|
-
case
|
|
448
|
-
|
|
487
|
+
case 5:
|
|
488
|
+
_context14.next = 7;
|
|
449
489
|
return Promise.resolve(true);
|
|
450
|
-
case 6:
|
|
451
|
-
return _context13.abrupt("return", _context13.sent);
|
|
452
490
|
case 7:
|
|
491
|
+
return _context14.abrupt("return", _context14.sent);
|
|
492
|
+
case 8:
|
|
453
493
|
case "end":
|
|
454
|
-
return
|
|
494
|
+
return _context14.stop();
|
|
455
495
|
}
|
|
456
|
-
},
|
|
496
|
+
}, _callee14, this);
|
|
457
497
|
}))).apply(this, arguments);
|
|
458
498
|
}
|
|
459
499
|
}, {
|
|
460
500
|
key: "onAfterSave",
|
|
461
501
|
value: function onAfterSave() {
|
|
462
|
-
return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
463
|
-
|
|
464
|
-
|
|
502
|
+
return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
503
|
+
var srt;
|
|
504
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
505
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
465
506
|
case 0:
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
507
|
+
srt = this.getSaveResultType();
|
|
508
|
+
_context15.next = 3;
|
|
509
|
+
return this.event_run("on_after_save", srt);
|
|
510
|
+
case 3:
|
|
511
|
+
_context15.next = 5;
|
|
512
|
+
return this.event_run("on_save_finished", srt);
|
|
513
|
+
case 5:
|
|
514
|
+
_context15.next = 7;
|
|
473
515
|
return Promise.resolve(true);
|
|
474
|
-
case 6:
|
|
475
|
-
return _context14.abrupt("return", _context14.sent);
|
|
476
516
|
case 7:
|
|
517
|
+
return _context15.abrupt("return", _context15.sent);
|
|
518
|
+
case 8:
|
|
477
519
|
case "end":
|
|
478
|
-
return
|
|
520
|
+
return _context15.stop();
|
|
479
521
|
}
|
|
480
|
-
},
|
|
522
|
+
}, _callee15, this);
|
|
481
523
|
}))).apply(this, arguments);
|
|
482
524
|
}
|
|
483
525
|
}]);
|
|
@@ -38,9 +38,9 @@ export declare class ObjectManager<ObjType extends SimpleObject> {
|
|
|
38
38
|
get isNew(): boolean;
|
|
39
39
|
get isSaved(): boolean;
|
|
40
40
|
get __cache_name(): string;
|
|
41
|
-
getSaveResult(): any;
|
|
41
|
+
getSaveResult(): any | null;
|
|
42
42
|
getSaveResultType(): saveResultType | null;
|
|
43
|
-
setSaveResult(toObj: any, type: saveResultType):
|
|
43
|
+
setSaveResult(toObj: any, type: saveResultType): saveResultType | undefined;
|
|
44
44
|
apply_changes(): boolean;
|
|
45
45
|
getValue(key: PropOf<ObjType>, original?: boolean): import("./SimpleObject").PropType<ObjType, any> | null;
|
|
46
46
|
get: (key: PropOf<ObjType>, original?: boolean) => import("./SimpleObject").PropType<ObjType, any> | null;
|
|
@@ -152,7 +152,7 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
152
152
|
key: "getSaveResult",
|
|
153
153
|
value: function getSaveResult() {
|
|
154
154
|
var _this$obj5;
|
|
155
|
-
return ((_this$obj5 = this.obj) === null || _this$obj5 === void 0 ? void 0 : _this$obj5.getSaveResult()) ||
|
|
155
|
+
return ((_this$obj5 = this.obj) === null || _this$obj5 === void 0 ? void 0 : _this$obj5.getSaveResult()) || null;
|
|
156
156
|
}
|
|
157
157
|
}, {
|
|
158
158
|
key: "getSaveResultType",
|
|
@@ -191,7 +191,7 @@ export declare class SimpleObject extends MapableObject {
|
|
|
191
191
|
* and its type
|
|
192
192
|
* @param toObj
|
|
193
193
|
*/
|
|
194
|
-
setSaveResult(toObj: any, type?: saveResultType | "auto", registerErrors?: boolean):
|
|
194
|
+
setSaveResult(toObj: any, type?: saveResultType | "auto", registerErrors?: boolean): saveResultType;
|
|
195
195
|
getSaveResult(original?: boolean): any;
|
|
196
196
|
getSaveResultType(): saveResultType;
|
|
197
197
|
static setTemp(obj: SimpleObject | any, key: string, value: any, sendChanges?: sendChangesType): Promise<void>;
|
|
@@ -877,6 +877,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
877
877
|
SimpleObject.addError(this, "save result is not valid", "the response from server was not valid", true);
|
|
878
878
|
}
|
|
879
879
|
this.__saveResultType = type;
|
|
880
|
+
return type;
|
|
880
881
|
}
|
|
881
882
|
}, {
|
|
882
883
|
key: "getSaveResult",
|