@azrico/webobject 1.4.89 → 1.4.91
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.
|
@@ -63,6 +63,7 @@ export declare class WebObject extends SimpleObject {
|
|
|
63
63
|
Save(): Promise<any>;
|
|
64
64
|
Delete(): Promise<boolean>;
|
|
65
65
|
Archive(): Promise<boolean>;
|
|
66
|
+
UnArchive(): Promise<boolean>;
|
|
66
67
|
canSave(deltaObj?: any): true | string;
|
|
67
68
|
canDelete(): boolean;
|
|
68
69
|
canArchive(): boolean;
|
|
@@ -34,7 +34,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
34
34
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
35
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
36
36
|
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); }
|
|
37
|
-
var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Delete, _Archive, _get_deltaObject, _onDelete, _onArchive, _onLoad, _onSave, _onAfterSave, _onNew, _saveList, _get_single, _get_list) {
|
|
37
|
+
var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Delete, _Archive, _UnArchive, _get_deltaObject, _onDelete, _onArchive, _onLoad, _onSave, _onAfterSave, _onNew, _saveList, _get_single, _get_list) {
|
|
38
38
|
_inherits(WebObject, _SimpleObject);
|
|
39
39
|
var _super = _createSuper(WebObject);
|
|
40
40
|
function WebObject() {
|
|
@@ -260,6 +260,29 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
260
260
|
}
|
|
261
261
|
}, _callee4, this);
|
|
262
262
|
}))).apply(this, arguments);
|
|
263
|
+
}
|
|
264
|
+
}, {
|
|
265
|
+
key: "UnArchive",
|
|
266
|
+
value: function UnArchive() {
|
|
267
|
+
return (_UnArchive = _UnArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
268
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
269
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
270
|
+
case 0:
|
|
271
|
+
if (!(this.__throw_errors !== false)) {
|
|
272
|
+
_context5.next = 2;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
throw new Error("UnArchive not implented");
|
|
276
|
+
case 2:
|
|
277
|
+
WebObject.addError(this, "UnArchive not implented", "NOSAVE", true);
|
|
278
|
+
this.setSaveResult(false, "canceled");
|
|
279
|
+
return _context5.abrupt("return", false);
|
|
280
|
+
case 5:
|
|
281
|
+
case "end":
|
|
282
|
+
return _context5.stop();
|
|
283
|
+
}
|
|
284
|
+
}, _callee5, this);
|
|
285
|
+
}))).apply(this, arguments);
|
|
263
286
|
} /* -------------------------------------------------------------------------- */
|
|
264
287
|
}, {
|
|
265
288
|
key: "canSave",
|
|
@@ -291,74 +314,74 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
291
314
|
}, {
|
|
292
315
|
key: "get_deltaObject",
|
|
293
316
|
value: function get_deltaObject(_x3) {
|
|
294
|
-
return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
317
|
+
return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(p) {
|
|
295
318
|
var _this2 = this,
|
|
296
319
|
_parseObj;
|
|
297
320
|
var final_object, isChild, useDelta, allProperties, needId, chkChangables, useExtraProps, dlt, allkeys, changableKeys, functionProps, index, fp, parseObj, _iterator, _step, key, tempusers;
|
|
298
|
-
return _regeneratorRuntime().wrap(function
|
|
299
|
-
while (1) switch (
|
|
321
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
322
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
300
323
|
case 0:
|
|
301
324
|
parseObj = function _parseObj2(_x4) {
|
|
302
|
-
return (_parseObj = _parseObj || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
325
|
+
return (_parseObj = _parseObj || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(obj) {
|
|
303
326
|
var _ref;
|
|
304
327
|
var newobj_dlt;
|
|
305
|
-
return _regeneratorRuntime().wrap(function
|
|
306
|
-
while (1) switch (
|
|
328
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
329
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
307
330
|
case 0:
|
|
308
331
|
if (!(obj == null)) {
|
|
309
|
-
|
|
332
|
+
_context7.next = 2;
|
|
310
333
|
break;
|
|
311
334
|
}
|
|
312
|
-
return
|
|
335
|
+
return _context7.abrupt("return", undefined);
|
|
313
336
|
case 2:
|
|
314
337
|
if (!Array.isArray(obj)) {
|
|
315
|
-
|
|
338
|
+
_context7.next = 6;
|
|
316
339
|
break;
|
|
317
340
|
}
|
|
318
|
-
|
|
341
|
+
_context7.next = 5;
|
|
319
342
|
return Promise.all(obj.map(function (_x5) {
|
|
320
|
-
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
321
|
-
return _regeneratorRuntime().wrap(function
|
|
322
|
-
while (1) switch (
|
|
343
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(r) {
|
|
344
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
345
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
323
346
|
case 0:
|
|
324
|
-
|
|
347
|
+
_context6.next = 2;
|
|
325
348
|
return parseObj(r);
|
|
326
349
|
case 2:
|
|
327
|
-
return
|
|
350
|
+
return _context6.abrupt("return", _context6.sent);
|
|
328
351
|
case 3:
|
|
329
352
|
case "end":
|
|
330
|
-
return
|
|
353
|
+
return _context6.stop();
|
|
331
354
|
}
|
|
332
|
-
},
|
|
355
|
+
}, _callee6);
|
|
333
356
|
}))).apply(this, arguments);
|
|
334
357
|
}));
|
|
335
358
|
case 5:
|
|
336
|
-
return
|
|
359
|
+
return _context7.abrupt("return", _context7.sent);
|
|
337
360
|
case 6:
|
|
338
361
|
if (!(obj instanceof WebObject && typeof obj.get_deltaObject === "function")) {
|
|
339
|
-
|
|
362
|
+
_context7.next = 15;
|
|
340
363
|
break;
|
|
341
364
|
}
|
|
342
|
-
|
|
365
|
+
_context7.next = 9;
|
|
343
366
|
return obj.get_deltaObject(_objectSpread(_objectSpread({}, p), {}, {
|
|
344
367
|
isChild: true
|
|
345
368
|
}));
|
|
346
369
|
case 9:
|
|
347
|
-
newobj_dlt =
|
|
370
|
+
newobj_dlt = _context7.sent;
|
|
348
371
|
if ((0, _object.object_isEmpty)(newobj_dlt)) {
|
|
349
|
-
|
|
372
|
+
_context7.next = 14;
|
|
350
373
|
break;
|
|
351
374
|
}
|
|
352
|
-
return
|
|
375
|
+
return _context7.abrupt("return", newobj_dlt);
|
|
353
376
|
case 14:
|
|
354
|
-
return
|
|
377
|
+
return _context7.abrupt("return", obj);
|
|
355
378
|
case 15:
|
|
356
|
-
return
|
|
379
|
+
return _context7.abrupt("return", obj);
|
|
357
380
|
case 16:
|
|
358
381
|
case "end":
|
|
359
|
-
return
|
|
382
|
+
return _context7.stop();
|
|
360
383
|
}
|
|
361
|
-
},
|
|
384
|
+
}, _callee7);
|
|
362
385
|
}))).apply(this, arguments);
|
|
363
386
|
};
|
|
364
387
|
if (!p) p = {};
|
|
@@ -377,7 +400,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
377
400
|
ignoreProtected: allProperties
|
|
378
401
|
});
|
|
379
402
|
}) : allkeys;
|
|
380
|
-
|
|
403
|
+
_context8.next = 14;
|
|
381
404
|
return _convert["default"].applyFormats({
|
|
382
405
|
inputobject: dlt,
|
|
383
406
|
formats: (0, _object.object_getStatic)(this, "__formatList"),
|
|
@@ -398,32 +421,32 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
398
421
|
/* parse all changableKeys */
|
|
399
422
|
/* -------------------------------------------------------------------------- */
|
|
400
423
|
_iterator = _createForOfIteratorHelper(changableKeys);
|
|
401
|
-
|
|
424
|
+
_context8.prev = 17;
|
|
402
425
|
_iterator.s();
|
|
403
426
|
case 19:
|
|
404
427
|
if ((_step = _iterator.n()).done) {
|
|
405
|
-
|
|
428
|
+
_context8.next = 26;
|
|
406
429
|
break;
|
|
407
430
|
}
|
|
408
431
|
key = _step.value;
|
|
409
|
-
|
|
432
|
+
_context8.next = 23;
|
|
410
433
|
return parseObj(dlt[key]);
|
|
411
434
|
case 23:
|
|
412
|
-
final_object[key] =
|
|
435
|
+
final_object[key] = _context8.sent;
|
|
413
436
|
case 24:
|
|
414
|
-
|
|
437
|
+
_context8.next = 19;
|
|
415
438
|
break;
|
|
416
439
|
case 26:
|
|
417
|
-
|
|
440
|
+
_context8.next = 31;
|
|
418
441
|
break;
|
|
419
442
|
case 28:
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
_iterator.e(
|
|
443
|
+
_context8.prev = 28;
|
|
444
|
+
_context8.t0 = _context8["catch"](17);
|
|
445
|
+
_iterator.e(_context8.t0);
|
|
423
446
|
case 31:
|
|
424
|
-
|
|
447
|
+
_context8.prev = 31;
|
|
425
448
|
_iterator.f();
|
|
426
|
-
return
|
|
449
|
+
return _context8.finish(31);
|
|
427
450
|
case 34:
|
|
428
451
|
/* -------------------------------------------------------------------------- */
|
|
429
452
|
/* add id properties */
|
|
@@ -446,12 +469,12 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
446
469
|
});
|
|
447
470
|
final_object["_users"] = (0, _object.wrap_array)(tempusers);
|
|
448
471
|
}
|
|
449
|
-
return
|
|
472
|
+
return _context8.abrupt("return", final_object);
|
|
450
473
|
case 38:
|
|
451
474
|
case "end":
|
|
452
|
-
return
|
|
475
|
+
return _context8.stop();
|
|
453
476
|
}
|
|
454
|
-
},
|
|
477
|
+
}, _callee8, this, [[17, 28, 31, 34]]);
|
|
455
478
|
}))).apply(this, arguments);
|
|
456
479
|
} /* --------------------------------- Getters -------------------------------- */
|
|
457
480
|
}, {
|
|
@@ -477,154 +500,154 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
477
500
|
}, {
|
|
478
501
|
key: "onDelete",
|
|
479
502
|
value: /* -------------------------------------------------------------------------- */function onDelete() {
|
|
480
|
-
return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
503
|
+
return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
481
504
|
var _this$manager;
|
|
482
505
|
var _len,
|
|
483
506
|
p,
|
|
484
507
|
_key,
|
|
485
|
-
|
|
486
|
-
return _regeneratorRuntime().wrap(function
|
|
487
|
-
while (1) switch (
|
|
508
|
+
_args9 = arguments;
|
|
509
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
510
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
488
511
|
case 0:
|
|
489
512
|
this.isDeleted = true;
|
|
490
|
-
for (_len =
|
|
491
|
-
p[_key] =
|
|
513
|
+
for (_len = _args9.length, p = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
514
|
+
p[_key] = _args9[_key];
|
|
492
515
|
}
|
|
493
|
-
|
|
516
|
+
_context9.next = 4;
|
|
494
517
|
return (_this$manager = this.manager) === null || _this$manager === void 0 ? void 0 : _this$manager.onDelete.apply(_this$manager, p);
|
|
495
518
|
case 4:
|
|
496
|
-
return
|
|
519
|
+
return _context9.abrupt("return", _context9.sent);
|
|
497
520
|
case 5:
|
|
498
521
|
case "end":
|
|
499
|
-
return
|
|
522
|
+
return _context9.stop();
|
|
500
523
|
}
|
|
501
|
-
},
|
|
524
|
+
}, _callee9, this);
|
|
502
525
|
}))).apply(this, arguments);
|
|
503
526
|
}
|
|
504
527
|
}, {
|
|
505
528
|
key: "onArchive",
|
|
506
529
|
value: function onArchive() {
|
|
507
|
-
return (_onArchive = _onArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
530
|
+
return (_onArchive = _onArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
508
531
|
var _this$manager2;
|
|
509
532
|
var _len2,
|
|
510
533
|
p,
|
|
511
534
|
_key2,
|
|
512
|
-
|
|
513
|
-
return _regeneratorRuntime().wrap(function
|
|
514
|
-
while (1) switch (
|
|
535
|
+
_args10 = arguments;
|
|
536
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
537
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
515
538
|
case 0:
|
|
516
539
|
this.isArchived = true;
|
|
517
|
-
for (_len2 =
|
|
518
|
-
p[_key2] =
|
|
540
|
+
for (_len2 = _args10.length, p = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
541
|
+
p[_key2] = _args10[_key2];
|
|
519
542
|
}
|
|
520
|
-
|
|
543
|
+
_context10.next = 4;
|
|
521
544
|
return (_this$manager2 = this.manager) === null || _this$manager2 === void 0 ? void 0 : _this$manager2.onArchive.apply(_this$manager2, p);
|
|
522
545
|
case 4:
|
|
523
|
-
return
|
|
546
|
+
return _context10.abrupt("return", _context10.sent);
|
|
524
547
|
case 5:
|
|
525
548
|
case "end":
|
|
526
|
-
return
|
|
549
|
+
return _context10.stop();
|
|
527
550
|
}
|
|
528
|
-
},
|
|
551
|
+
}, _callee10, this);
|
|
529
552
|
}))).apply(this, arguments);
|
|
530
553
|
}
|
|
531
554
|
}, {
|
|
532
555
|
key: "onLoad",
|
|
533
556
|
value: function onLoad() {
|
|
534
|
-
return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
557
|
+
return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
535
558
|
var _this$manager3;
|
|
536
559
|
var _len3,
|
|
537
560
|
p,
|
|
538
561
|
_key3,
|
|
539
|
-
|
|
540
|
-
return _regeneratorRuntime().wrap(function
|
|
541
|
-
while (1) switch (
|
|
562
|
+
_args11 = arguments;
|
|
563
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
564
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
542
565
|
case 0:
|
|
543
566
|
this.isDeleted = false;
|
|
544
|
-
for (_len3 =
|
|
545
|
-
p[_key3] =
|
|
567
|
+
for (_len3 = _args11.length, p = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
568
|
+
p[_key3] = _args11[_key3];
|
|
546
569
|
}
|
|
547
|
-
|
|
570
|
+
_context11.next = 4;
|
|
548
571
|
return (_this$manager3 = this.manager) === null || _this$manager3 === void 0 ? void 0 : _this$manager3.onLoad.apply(_this$manager3, p);
|
|
549
572
|
case 4:
|
|
550
|
-
return
|
|
573
|
+
return _context11.abrupt("return", _context11.sent);
|
|
551
574
|
case 5:
|
|
552
575
|
case "end":
|
|
553
|
-
return
|
|
576
|
+
return _context11.stop();
|
|
554
577
|
}
|
|
555
|
-
},
|
|
578
|
+
}, _callee11, this);
|
|
556
579
|
}))).apply(this, arguments);
|
|
557
580
|
}
|
|
558
581
|
}, {
|
|
559
582
|
key: "onSave",
|
|
560
583
|
value: function onSave() {
|
|
561
|
-
return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
584
|
+
return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
562
585
|
var _this$manager5;
|
|
563
586
|
var srObject,
|
|
564
587
|
_this$manager4,
|
|
565
588
|
_len4,
|
|
566
589
|
p,
|
|
567
590
|
_key4,
|
|
568
|
-
|
|
569
|
-
return _regeneratorRuntime().wrap(function
|
|
570
|
-
while (1) switch (
|
|
591
|
+
_args12 = arguments;
|
|
592
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
593
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
571
594
|
case 0:
|
|
572
595
|
if (!this.isSaved) {
|
|
573
|
-
|
|
596
|
+
_context12.next = 7;
|
|
574
597
|
break;
|
|
575
598
|
}
|
|
576
599
|
this.apply_changes();
|
|
577
600
|
srObject = this.getSaveResult(true);
|
|
578
601
|
if (!this.saveResultHasID(srObject)) {
|
|
579
|
-
|
|
602
|
+
_context12.next = 7;
|
|
580
603
|
break;
|
|
581
604
|
}
|
|
582
605
|
/* -------------------------------------------------------------------------- */
|
|
583
606
|
WebObject.LoadIdsFromSaveResult(this, srObject);
|
|
584
|
-
|
|
607
|
+
_context12.next = 7;
|
|
585
608
|
return (_this$manager4 = this.manager) === null || _this$manager4 === void 0 ? void 0 : _this$manager4.event_run("on_id_change");
|
|
586
609
|
case 7:
|
|
587
|
-
for (_len4 =
|
|
588
|
-
p[_key4] =
|
|
610
|
+
for (_len4 = _args12.length, p = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
611
|
+
p[_key4] = _args12[_key4];
|
|
589
612
|
}
|
|
590
|
-
|
|
613
|
+
_context12.next = 10;
|
|
591
614
|
return (_this$manager5 = this.manager) === null || _this$manager5 === void 0 ? void 0 : _this$manager5.onSave.apply(_this$manager5, p);
|
|
592
615
|
case 10:
|
|
593
|
-
|
|
616
|
+
_context12.next = 12;
|
|
594
617
|
return this.onAfterSave();
|
|
595
618
|
case 12:
|
|
596
|
-
return
|
|
619
|
+
return _context12.abrupt("return", true);
|
|
597
620
|
case 13:
|
|
598
621
|
case "end":
|
|
599
|
-
return
|
|
622
|
+
return _context12.stop();
|
|
600
623
|
}
|
|
601
|
-
},
|
|
624
|
+
}, _callee12, this);
|
|
602
625
|
}))).apply(this, arguments);
|
|
603
626
|
}
|
|
604
627
|
}, {
|
|
605
628
|
key: "onAfterSave",
|
|
606
629
|
value: function onAfterSave() {
|
|
607
|
-
return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
630
|
+
return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
608
631
|
var _this$manager6;
|
|
609
632
|
var _len5,
|
|
610
633
|
p,
|
|
611
634
|
_key5,
|
|
612
|
-
|
|
613
|
-
return _regeneratorRuntime().wrap(function
|
|
614
|
-
while (1) switch (
|
|
635
|
+
_args13 = arguments;
|
|
636
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
637
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
615
638
|
case 0:
|
|
616
|
-
for (_len5 =
|
|
617
|
-
p[_key5] =
|
|
639
|
+
for (_len5 = _args13.length, p = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
640
|
+
p[_key5] = _args13[_key5];
|
|
618
641
|
}
|
|
619
|
-
|
|
642
|
+
_context13.next = 3;
|
|
620
643
|
return (_this$manager6 = this.manager) === null || _this$manager6 === void 0 ? void 0 : _this$manager6.onAfterSave.apply(_this$manager6, p);
|
|
621
644
|
case 3:
|
|
622
|
-
return
|
|
645
|
+
return _context13.abrupt("return", true);
|
|
623
646
|
case 4:
|
|
624
647
|
case "end":
|
|
625
|
-
return
|
|
648
|
+
return _context13.stop();
|
|
626
649
|
}
|
|
627
|
-
},
|
|
650
|
+
}, _callee13, this);
|
|
628
651
|
}))).apply(this, arguments);
|
|
629
652
|
}
|
|
630
653
|
}, {
|
|
@@ -645,27 +668,27 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
645
668
|
}, {
|
|
646
669
|
key: "onNew",
|
|
647
670
|
value: function onNew() {
|
|
648
|
-
return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
671
|
+
return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
649
672
|
var _this$manager7;
|
|
650
673
|
var _len6,
|
|
651
674
|
p,
|
|
652
675
|
_key6,
|
|
653
|
-
|
|
654
|
-
return _regeneratorRuntime().wrap(function
|
|
655
|
-
while (1) switch (
|
|
676
|
+
_args14 = arguments;
|
|
677
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
678
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
656
679
|
case 0:
|
|
657
|
-
for (_len6 =
|
|
658
|
-
p[_key6] =
|
|
680
|
+
for (_len6 = _args14.length, p = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
681
|
+
p[_key6] = _args14[_key6];
|
|
659
682
|
}
|
|
660
|
-
|
|
683
|
+
_context14.next = 3;
|
|
661
684
|
return (_this$manager7 = this.manager) === null || _this$manager7 === void 0 ? void 0 : _this$manager7.onNew.apply(_this$manager7, p);
|
|
662
685
|
case 3:
|
|
663
|
-
return
|
|
686
|
+
return _context14.abrupt("return", _context14.sent);
|
|
664
687
|
case 4:
|
|
665
688
|
case "end":
|
|
666
|
-
return
|
|
689
|
+
return _context14.stop();
|
|
667
690
|
}
|
|
668
|
-
},
|
|
691
|
+
}, _callee14, this);
|
|
669
692
|
}))).apply(this, arguments);
|
|
670
693
|
} /* -------------------------------------------------------------------------- */
|
|
671
694
|
}, {
|
|
@@ -712,7 +735,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
712
735
|
}, {
|
|
713
736
|
key: "saveList",
|
|
714
737
|
value: function saveList(_x6) {
|
|
715
|
-
return (_saveList = _saveList || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
738
|
+
return (_saveList = _saveList || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(itemList) {
|
|
716
739
|
var _extraOptions$chunksi;
|
|
717
740
|
var extraOptions,
|
|
718
741
|
chunks,
|
|
@@ -729,11 +752,11 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
729
752
|
_item,
|
|
730
753
|
_index2,
|
|
731
754
|
_item2,
|
|
732
|
-
|
|
733
|
-
return _regeneratorRuntime().wrap(function
|
|
734
|
-
while (1) switch (
|
|
755
|
+
_args15 = arguments;
|
|
756
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
757
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
735
758
|
case 0:
|
|
736
|
-
extraOptions =
|
|
759
|
+
extraOptions = _args15.length > 1 && _args15[1] !== undefined ? _args15[1] : {};
|
|
737
760
|
if (!extraOptions) extraOptions = {};
|
|
738
761
|
chunks = (0, _object.array_chunks)(itemList, (_extraOptions$chunksi = extraOptions.chunksize) !== null && _extraOptions$chunksi !== void 0 ? _extraOptions$chunksi : 50);
|
|
739
762
|
delete extraOptions.chunksize;
|
|
@@ -741,7 +764,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
741
764
|
index = 0;
|
|
742
765
|
case 6:
|
|
743
766
|
if (!(index < chunks.length)) {
|
|
744
|
-
|
|
767
|
+
_context15.next = 36;
|
|
745
768
|
break;
|
|
746
769
|
}
|
|
747
770
|
items_to_save = chunks[index];
|
|
@@ -749,81 +772,81 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
749
772
|
k = 0;
|
|
750
773
|
case 10:
|
|
751
774
|
if (!(k < items_to_save.length)) {
|
|
752
|
-
|
|
775
|
+
_context15.next = 19;
|
|
753
776
|
break;
|
|
754
777
|
}
|
|
755
778
|
item = items_to_save[k];
|
|
756
|
-
|
|
779
|
+
_context15.next = 14;
|
|
757
780
|
return item.get_deltaObject();
|
|
758
781
|
case 14:
|
|
759
|
-
dlt =
|
|
782
|
+
dlt = _context15.sent;
|
|
760
783
|
save_array.push(item.isNew ? _objectSpread({}, dlt) : _objectSpread({
|
|
761
784
|
_id: item.getID()
|
|
762
785
|
}, dlt));
|
|
763
786
|
case 16:
|
|
764
787
|
k++;
|
|
765
|
-
|
|
788
|
+
_context15.next = 10;
|
|
766
789
|
break;
|
|
767
790
|
case 19:
|
|
768
|
-
|
|
791
|
+
_context15.next = 21;
|
|
769
792
|
return _global.gfunc.run_action("post", putAddress, _objectSpread({
|
|
770
793
|
__save_list: WebObject.zipSaveList(save_array)
|
|
771
794
|
}, extraOptions));
|
|
772
795
|
case 21:
|
|
773
|
-
resultObject =
|
|
796
|
+
resultObject = _context15.sent;
|
|
774
797
|
if (!Array.isArray(resultObject)) {
|
|
775
|
-
|
|
798
|
+
_context15.next = 33;
|
|
776
799
|
break;
|
|
777
800
|
}
|
|
778
801
|
_index = 0;
|
|
779
802
|
case 24:
|
|
780
803
|
if (!(_index < Math.min(resultObject.length, items_to_save.length))) {
|
|
781
|
-
|
|
804
|
+
_context15.next = 33;
|
|
782
805
|
break;
|
|
783
806
|
}
|
|
784
807
|
res = resultObject[_index];
|
|
785
808
|
_item = items_to_save[_index];
|
|
786
809
|
_item.setSaveResult(res);
|
|
787
|
-
|
|
810
|
+
_context15.next = 30;
|
|
788
811
|
return _item.onSave();
|
|
789
812
|
case 30:
|
|
790
813
|
_index++;
|
|
791
|
-
|
|
814
|
+
_context15.next = 24;
|
|
792
815
|
break;
|
|
793
816
|
case 33:
|
|
794
817
|
index++;
|
|
795
|
-
|
|
818
|
+
_context15.next = 6;
|
|
796
819
|
break;
|
|
797
820
|
case 36:
|
|
798
821
|
_index2 = 0;
|
|
799
822
|
case 37:
|
|
800
823
|
if (!(_index2 < itemList.length)) {
|
|
801
|
-
|
|
824
|
+
_context15.next = 46;
|
|
802
825
|
break;
|
|
803
826
|
}
|
|
804
827
|
_item2 = itemList[_index2];
|
|
805
828
|
if (_item2.isSaved) {
|
|
806
|
-
|
|
829
|
+
_context15.next = 41;
|
|
807
830
|
break;
|
|
808
831
|
}
|
|
809
|
-
return
|
|
832
|
+
return _context15.abrupt("return", false);
|
|
810
833
|
case 41:
|
|
811
834
|
if (!(_item2.getSaveResultType() != "normal")) {
|
|
812
|
-
|
|
835
|
+
_context15.next = 43;
|
|
813
836
|
break;
|
|
814
837
|
}
|
|
815
|
-
return
|
|
838
|
+
return _context15.abrupt("return", false);
|
|
816
839
|
case 43:
|
|
817
840
|
_index2++;
|
|
818
|
-
|
|
841
|
+
_context15.next = 37;
|
|
819
842
|
break;
|
|
820
843
|
case 46:
|
|
821
|
-
return
|
|
844
|
+
return _context15.abrupt("return", true);
|
|
822
845
|
case 47:
|
|
823
846
|
case "end":
|
|
824
|
-
return
|
|
847
|
+
return _context15.stop();
|
|
825
848
|
}
|
|
826
|
-
},
|
|
849
|
+
}, _callee15, this);
|
|
827
850
|
}))).apply(this, arguments);
|
|
828
851
|
}
|
|
829
852
|
}, {
|
|
@@ -869,7 +892,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
869
892
|
}, {
|
|
870
893
|
key: "get_single",
|
|
871
894
|
value: function get_single() {
|
|
872
|
-
return (_get_single = _get_single || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
895
|
+
return (_get_single = _get_single || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
873
896
|
var _len7,
|
|
874
897
|
p,
|
|
875
898
|
_key7,
|
|
@@ -878,55 +901,55 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
878
901
|
fetchID,
|
|
879
902
|
res,
|
|
880
903
|
params,
|
|
881
|
-
|
|
882
|
-
return _regeneratorRuntime().wrap(function
|
|
883
|
-
while (1) switch (
|
|
904
|
+
_args16 = arguments;
|
|
905
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
906
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
884
907
|
case 0:
|
|
885
|
-
for (_len7 =
|
|
886
|
-
p[_key7] =
|
|
908
|
+
for (_len7 = _args16.length, p = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
909
|
+
p[_key7] = _args16[_key7];
|
|
887
910
|
}
|
|
888
911
|
search = p.shift();
|
|
889
912
|
readonly = p.shift();
|
|
890
913
|
fetchID = p.shift();
|
|
891
914
|
if (!(0, _object.object_isEmpty)(search)) {
|
|
892
|
-
|
|
915
|
+
_context16.next = 6;
|
|
893
916
|
break;
|
|
894
917
|
}
|
|
895
|
-
return
|
|
918
|
+
return _context16.abrupt("return", undefined);
|
|
896
919
|
case 6:
|
|
897
920
|
params = {};
|
|
898
921
|
params.context = readonly ? "view" : "edit";
|
|
899
|
-
|
|
900
|
-
|
|
922
|
+
_context16.t0 = _typeof(search);
|
|
923
|
+
_context16.next = _context16.t0 === "string" ? 11 : _context16.t0 === "number" ? 11 : _context16.t0 === "object" ? 19 : 19;
|
|
901
924
|
break;
|
|
902
925
|
case 11:
|
|
903
926
|
search = String(search);
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
927
|
+
_context16.t1 = this;
|
|
928
|
+
_context16.t2 = this;
|
|
929
|
+
_context16.next = 16;
|
|
907
930
|
return _global.gfunc.run_action("get", this.__web_path + "/" + search, params, {
|
|
908
931
|
fetchID: fetchID
|
|
909
932
|
});
|
|
910
933
|
case 16:
|
|
911
|
-
|
|
912
|
-
res =
|
|
913
|
-
return
|
|
934
|
+
_context16.t3 = _context16.sent;
|
|
935
|
+
res = _context16.t1.ensure.call(_context16.t1, _context16.t2, _context16.t3);
|
|
936
|
+
return _context16.abrupt("break", 25);
|
|
914
937
|
case 19:
|
|
915
|
-
|
|
916
|
-
|
|
938
|
+
_context16.t4 = _object.object_first;
|
|
939
|
+
_context16.next = 22;
|
|
917
940
|
return this.get_list(search, readonly, fetchID);
|
|
918
941
|
case 22:
|
|
919
|
-
|
|
920
|
-
res = (0,
|
|
921
|
-
return
|
|
942
|
+
_context16.t5 = _context16.sent;
|
|
943
|
+
res = (0, _context16.t4)(_context16.t5);
|
|
944
|
+
return _context16.abrupt("break", 25);
|
|
922
945
|
case 25:
|
|
923
946
|
WebObject.setReadonly(res, readonly);
|
|
924
|
-
return
|
|
947
|
+
return _context16.abrupt("return", res);
|
|
925
948
|
case 27:
|
|
926
949
|
case "end":
|
|
927
|
-
return
|
|
950
|
+
return _context16.stop();
|
|
928
951
|
}
|
|
929
|
-
},
|
|
952
|
+
}, _callee16, this);
|
|
930
953
|
}))).apply(this, arguments);
|
|
931
954
|
}
|
|
932
955
|
/**
|
|
@@ -936,7 +959,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
936
959
|
}, {
|
|
937
960
|
key: "get_list",
|
|
938
961
|
value: function get_list() {
|
|
939
|
-
return (_get_list = _get_list || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
962
|
+
return (_get_list = _get_list || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
940
963
|
var _len8,
|
|
941
964
|
p,
|
|
942
965
|
_key8,
|
|
@@ -946,32 +969,32 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Del
|
|
|
946
969
|
result_items,
|
|
947
970
|
selftype,
|
|
948
971
|
res,
|
|
949
|
-
|
|
950
|
-
return _regeneratorRuntime().wrap(function
|
|
951
|
-
while (1) switch (
|
|
972
|
+
_args17 = arguments;
|
|
973
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
974
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
952
975
|
case 0:
|
|
953
|
-
for (_len8 =
|
|
954
|
-
p[_key8] =
|
|
976
|
+
for (_len8 = _args17.length, p = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
|
977
|
+
p[_key8] = _args17[_key8];
|
|
955
978
|
}
|
|
956
979
|
search = p.shift();
|
|
957
980
|
readonly = p.shift();
|
|
958
981
|
fetchID = p.shift();
|
|
959
982
|
if (!search) search = {};
|
|
960
|
-
|
|
983
|
+
_context17.next = 7;
|
|
961
984
|
return _global.gfunc.run_action("get", this.__web_path, search, {
|
|
962
985
|
fetchID: fetchID
|
|
963
986
|
});
|
|
964
987
|
case 7:
|
|
965
|
-
result_items =
|
|
988
|
+
result_items = _context17.sent;
|
|
966
989
|
selftype = this.prototype;
|
|
967
990
|
res = WebObject.map_rowindex(WebObject.mapto(selftype, result_items, readonly));
|
|
968
991
|
WebObject.setReadonly(res, readonly);
|
|
969
|
-
return
|
|
992
|
+
return _context17.abrupt("return", res);
|
|
970
993
|
case 12:
|
|
971
994
|
case "end":
|
|
972
|
-
return
|
|
995
|
+
return _context17.stop();
|
|
973
996
|
}
|
|
974
|
-
},
|
|
997
|
+
}, _callee17, this);
|
|
975
998
|
}))).apply(this, arguments);
|
|
976
999
|
}
|
|
977
1000
|
}]);
|
|
@@ -40,6 +40,7 @@ export declare class WebObjectManager<T extends WebObject> extends ObjectManager
|
|
|
40
40
|
*/
|
|
41
41
|
onDelete(...p: any): Promise<any>;
|
|
42
42
|
onArchive(...p: any): Promise<any>;
|
|
43
|
+
onUnArchive(...p: any): Promise<any>;
|
|
43
44
|
/**
|
|
44
45
|
* Use this when you load data to the object
|
|
45
46
|
* @param p
|
|
@@ -30,7 +30,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
30
30
|
/**
|
|
31
31
|
* This class manages the events of an Simple Object
|
|
32
32
|
*/
|
|
33
|
-
var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _get_deltaObject, _Save, _Load, _onNew, _onDelete, _onArchive, _onLoad, _onSave, _onAfterSave) {
|
|
33
|
+
var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _get_deltaObject, _Save, _Load, _onNew, _onDelete, _onArchive, _onUnArchive, _onLoad, _onSave, _onAfterSave) {
|
|
34
34
|
_inherits(WebObjectManager, _ObjectManager);
|
|
35
35
|
var _super = _createSuper(WebObjectManager);
|
|
36
36
|
/* -------------------------------------------------------------------------- */
|
|
@@ -42,7 +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
|
-
_this.event_add("on_save", "
|
|
45
|
+
_this.event_add("on_save", "on_save-sendmsg", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
46
46
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
47
47
|
while (1) switch (_context.prev = _context.next) {
|
|
48
48
|
case 0:
|
|
@@ -79,6 +79,64 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
79
79
|
}
|
|
80
80
|
}, _callee);
|
|
81
81
|
})));
|
|
82
|
+
_this.event_add("on_{archive,unarchive}", "on_archive-sendmsg", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
83
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
84
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
85
|
+
case 0:
|
|
86
|
+
_context2.t0 = _this.getSaveResultType();
|
|
87
|
+
_context2.next = _context2.t0 === "normal" ? 3 : 6;
|
|
88
|
+
break;
|
|
89
|
+
case 3:
|
|
90
|
+
_context2.next = 5;
|
|
91
|
+
return _global.gfunc.run_action("show_message", {
|
|
92
|
+
message: _this.isArchived ? "Archived" : "Restored",
|
|
93
|
+
type: "success"
|
|
94
|
+
});
|
|
95
|
+
case 5:
|
|
96
|
+
return _context2.abrupt("return", _context2.sent);
|
|
97
|
+
case 6:
|
|
98
|
+
_context2.next = 8;
|
|
99
|
+
return _global.gfunc.run_action("show_message", {
|
|
100
|
+
message: "Not archived",
|
|
101
|
+
type: "error"
|
|
102
|
+
});
|
|
103
|
+
case 8:
|
|
104
|
+
return _context2.abrupt("return", _context2.sent);
|
|
105
|
+
case 9:
|
|
106
|
+
case "end":
|
|
107
|
+
return _context2.stop();
|
|
108
|
+
}
|
|
109
|
+
}, _callee2);
|
|
110
|
+
})));
|
|
111
|
+
_this.event_add("on_delete", "on_delete-sendmsg", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
112
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
113
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
114
|
+
case 0:
|
|
115
|
+
_context3.t0 = _this.getSaveResultType();
|
|
116
|
+
_context3.next = _context3.t0 === "normal" ? 3 : 6;
|
|
117
|
+
break;
|
|
118
|
+
case 3:
|
|
119
|
+
_context3.next = 5;
|
|
120
|
+
return _global.gfunc.run_action("show_message", {
|
|
121
|
+
message: "Deleted",
|
|
122
|
+
type: "success"
|
|
123
|
+
});
|
|
124
|
+
case 5:
|
|
125
|
+
return _context3.abrupt("return", _context3.sent);
|
|
126
|
+
case 6:
|
|
127
|
+
_context3.next = 8;
|
|
128
|
+
return _global.gfunc.run_action("show_message", {
|
|
129
|
+
message: "Not deleted",
|
|
130
|
+
type: "error"
|
|
131
|
+
});
|
|
132
|
+
case 8:
|
|
133
|
+
return _context3.abrupt("return", _context3.sent);
|
|
134
|
+
case 9:
|
|
135
|
+
case "end":
|
|
136
|
+
return _context3.stop();
|
|
137
|
+
}
|
|
138
|
+
}, _callee3);
|
|
139
|
+
})));
|
|
82
140
|
}
|
|
83
141
|
return _this;
|
|
84
142
|
}
|
|
@@ -107,23 +165,23 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
107
165
|
}, {
|
|
108
166
|
key: "setMetaValue",
|
|
109
167
|
value: function setMetaValue(_x, _x2) {
|
|
110
|
-
return (_setMetaValue = _setMetaValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
168
|
+
return (_setMetaValue = _setMetaValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(key, value) {
|
|
111
169
|
var _this$obj;
|
|
112
170
|
var sendChange,
|
|
113
|
-
|
|
114
|
-
return _regeneratorRuntime().wrap(function
|
|
115
|
-
while (1) switch (
|
|
171
|
+
_args4 = arguments;
|
|
172
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
173
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
116
174
|
case 0:
|
|
117
|
-
sendChange =
|
|
118
|
-
|
|
175
|
+
sendChange = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : "auto";
|
|
176
|
+
_context4.next = 3;
|
|
119
177
|
return (_this$obj = this.obj) === null || _this$obj === void 0 ? void 0 : _this$obj.setMetaValue(key, value, sendChange);
|
|
120
178
|
case 3:
|
|
121
|
-
return
|
|
179
|
+
return _context4.abrupt("return", _context4.sent);
|
|
122
180
|
case 4:
|
|
123
181
|
case "end":
|
|
124
|
-
return
|
|
182
|
+
return _context4.stop();
|
|
125
183
|
}
|
|
126
|
-
},
|
|
184
|
+
}, _callee4, this);
|
|
127
185
|
}))).apply(this, arguments);
|
|
128
186
|
}
|
|
129
187
|
}, {
|
|
@@ -136,68 +194,68 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
136
194
|
}, {
|
|
137
195
|
key: "get_deltaObject",
|
|
138
196
|
value: function get_deltaObject() {
|
|
139
|
-
return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
197
|
+
return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
140
198
|
var _this$obj3;
|
|
141
|
-
return _regeneratorRuntime().wrap(function
|
|
142
|
-
while (1) switch (
|
|
199
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
200
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
143
201
|
case 0:
|
|
144
|
-
|
|
202
|
+
_context5.next = 2;
|
|
145
203
|
return (_this$obj3 = this.obj) === null || _this$obj3 === void 0 ? void 0 : _this$obj3.get_deltaObject();
|
|
146
204
|
case 2:
|
|
147
|
-
|
|
148
|
-
if (
|
|
149
|
-
|
|
205
|
+
_context5.t0 = _context5.sent;
|
|
206
|
+
if (_context5.t0) {
|
|
207
|
+
_context5.next = 5;
|
|
150
208
|
break;
|
|
151
209
|
}
|
|
152
|
-
|
|
210
|
+
_context5.t0 = {};
|
|
153
211
|
case 5:
|
|
154
|
-
return
|
|
212
|
+
return _context5.abrupt("return", _context5.t0);
|
|
155
213
|
case 6:
|
|
156
214
|
case "end":
|
|
157
|
-
return
|
|
215
|
+
return _context5.stop();
|
|
158
216
|
}
|
|
159
|
-
},
|
|
217
|
+
}, _callee5, this);
|
|
160
218
|
}))).apply(this, arguments);
|
|
161
219
|
} /* ------------------------------ save and load ----------------------------- */
|
|
162
220
|
}, {
|
|
163
221
|
key: "Save",
|
|
164
222
|
value: function Save() {
|
|
165
|
-
return (_Save = _Save || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
223
|
+
return (_Save = _Save || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
166
224
|
var _this$obj4;
|
|
167
|
-
return _regeneratorRuntime().wrap(function
|
|
168
|
-
while (1) switch (
|
|
225
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
226
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
169
227
|
case 0:
|
|
170
|
-
|
|
228
|
+
_context6.next = 2;
|
|
171
229
|
return (_this$obj4 = this.obj) === null || _this$obj4 === void 0 ? void 0 : _this$obj4.Save();
|
|
172
230
|
case 2:
|
|
173
|
-
|
|
174
|
-
if (
|
|
175
|
-
|
|
231
|
+
_context6.t0 = _context6.sent;
|
|
232
|
+
if (_context6.t0) {
|
|
233
|
+
_context6.next = 5;
|
|
176
234
|
break;
|
|
177
235
|
}
|
|
178
|
-
|
|
236
|
+
_context6.t0 = false;
|
|
179
237
|
case 5:
|
|
180
|
-
return
|
|
238
|
+
return _context6.abrupt("return", _context6.t0);
|
|
181
239
|
case 6:
|
|
182
240
|
case "end":
|
|
183
|
-
return
|
|
241
|
+
return _context6.stop();
|
|
184
242
|
}
|
|
185
|
-
},
|
|
243
|
+
}, _callee6, this);
|
|
186
244
|
}))).apply(this, arguments);
|
|
187
245
|
}
|
|
188
246
|
}, {
|
|
189
247
|
key: "Load",
|
|
190
248
|
value: function Load(_x3) {
|
|
191
|
-
return (_Load = _Load || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
192
|
-
return _regeneratorRuntime().wrap(function
|
|
193
|
-
while (1) switch (
|
|
249
|
+
return (_Load = _Load || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(search) {
|
|
250
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
251
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
194
252
|
case 0:
|
|
195
253
|
throw Error("load not implented");
|
|
196
254
|
case 1:
|
|
197
255
|
case "end":
|
|
198
|
-
return
|
|
256
|
+
return _context7.stop();
|
|
199
257
|
}
|
|
200
|
-
},
|
|
258
|
+
}, _callee7);
|
|
201
259
|
}))).apply(this, arguments);
|
|
202
260
|
}
|
|
203
261
|
/* -------------------------------------------------------------------------- */
|
|
@@ -233,32 +291,32 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
233
291
|
}, {
|
|
234
292
|
key: "onNew",
|
|
235
293
|
value: function onNew() {
|
|
236
|
-
return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
294
|
+
return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
237
295
|
var _this$obj9;
|
|
238
|
-
return _regeneratorRuntime().wrap(function
|
|
239
|
-
while (1) switch (
|
|
296
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
297
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
240
298
|
case 0:
|
|
241
299
|
if (this.canModify) {
|
|
242
300
|
(_this$obj9 = this.obj) === null || _this$obj9 === void 0 || _this$obj9.setOriginal();
|
|
243
301
|
}
|
|
244
|
-
|
|
302
|
+
_context8.next = 3;
|
|
245
303
|
return this.event_run("on_new");
|
|
246
304
|
case 3:
|
|
247
|
-
|
|
305
|
+
_context8.next = 5;
|
|
248
306
|
return this.event_run("on_change", true);
|
|
249
307
|
case 5:
|
|
250
|
-
|
|
308
|
+
_context8.next = 7;
|
|
251
309
|
return this.event_run("on_after_new");
|
|
252
310
|
case 7:
|
|
253
|
-
|
|
311
|
+
_context8.next = 9;
|
|
254
312
|
return Promise.resolve(true);
|
|
255
313
|
case 9:
|
|
256
|
-
return
|
|
314
|
+
return _context8.abrupt("return", _context8.sent);
|
|
257
315
|
case 10:
|
|
258
316
|
case "end":
|
|
259
|
-
return
|
|
317
|
+
return _context8.stop();
|
|
260
318
|
}
|
|
261
|
-
},
|
|
319
|
+
}, _callee8, this);
|
|
262
320
|
}))).apply(this, arguments);
|
|
263
321
|
}
|
|
264
322
|
/**
|
|
@@ -269,49 +327,73 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
269
327
|
}, {
|
|
270
328
|
key: "onDelete",
|
|
271
329
|
value: function onDelete() {
|
|
272
|
-
return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
273
|
-
return _regeneratorRuntime().wrap(function
|
|
274
|
-
while (1) switch (
|
|
330
|
+
return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
331
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
332
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
275
333
|
case 0:
|
|
276
334
|
if (this.obj) {
|
|
277
335
|
this.obj.isDeleted = true;
|
|
278
336
|
}
|
|
279
|
-
|
|
337
|
+
_context9.next = 3;
|
|
280
338
|
return this.event_run("on_delete");
|
|
281
339
|
case 3:
|
|
282
|
-
|
|
340
|
+
_context9.next = 5;
|
|
283
341
|
return this.event_run("on_after_delete");
|
|
284
342
|
case 5:
|
|
285
|
-
return
|
|
343
|
+
return _context9.abrupt("return", true);
|
|
286
344
|
case 6:
|
|
287
345
|
case "end":
|
|
288
|
-
return
|
|
346
|
+
return _context9.stop();
|
|
289
347
|
}
|
|
290
|
-
},
|
|
348
|
+
}, _callee9, this);
|
|
291
349
|
}))).apply(this, arguments);
|
|
292
350
|
}
|
|
293
351
|
}, {
|
|
294
352
|
key: "onArchive",
|
|
295
353
|
value: function onArchive() {
|
|
296
|
-
return (_onArchive = _onArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
297
|
-
return _regeneratorRuntime().wrap(function
|
|
298
|
-
while (1) switch (
|
|
354
|
+
return (_onArchive = _onArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
355
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
356
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
299
357
|
case 0:
|
|
300
358
|
if (this.obj) {
|
|
301
|
-
this.obj.
|
|
359
|
+
this.obj.isArchived = true;
|
|
302
360
|
}
|
|
303
|
-
|
|
361
|
+
_context10.next = 3;
|
|
304
362
|
return this.event_run("on_archive");
|
|
305
363
|
case 3:
|
|
306
|
-
|
|
364
|
+
_context10.next = 5;
|
|
307
365
|
return this.event_run("on_after_archive");
|
|
308
366
|
case 5:
|
|
309
|
-
return
|
|
367
|
+
return _context10.abrupt("return", true);
|
|
310
368
|
case 6:
|
|
311
369
|
case "end":
|
|
312
|
-
return
|
|
370
|
+
return _context10.stop();
|
|
313
371
|
}
|
|
314
|
-
},
|
|
372
|
+
}, _callee10, this);
|
|
373
|
+
}))).apply(this, arguments);
|
|
374
|
+
}
|
|
375
|
+
}, {
|
|
376
|
+
key: "onUnArchive",
|
|
377
|
+
value: function onUnArchive() {
|
|
378
|
+
return (_onUnArchive = _onUnArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
379
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
380
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
381
|
+
case 0:
|
|
382
|
+
if (this.obj) {
|
|
383
|
+
this.obj.isArchived = false;
|
|
384
|
+
}
|
|
385
|
+
_context11.next = 3;
|
|
386
|
+
return this.event_run("on_unarchive");
|
|
387
|
+
case 3:
|
|
388
|
+
_context11.next = 5;
|
|
389
|
+
return this.event_run("on_after_unarchive");
|
|
390
|
+
case 5:
|
|
391
|
+
return _context11.abrupt("return", true);
|
|
392
|
+
case 6:
|
|
393
|
+
case "end":
|
|
394
|
+
return _context11.stop();
|
|
395
|
+
}
|
|
396
|
+
}, _callee11, this);
|
|
315
397
|
}))).apply(this, arguments);
|
|
316
398
|
}
|
|
317
399
|
/**
|
|
@@ -322,32 +404,32 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
322
404
|
}, {
|
|
323
405
|
key: "onLoad",
|
|
324
406
|
value: function onLoad() {
|
|
325
|
-
return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
326
|
-
return _regeneratorRuntime().wrap(function
|
|
327
|
-
while (1) switch (
|
|
407
|
+
return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
408
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
409
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
328
410
|
case 0:
|
|
329
411
|
if (this.canModify && this.obj) {
|
|
330
412
|
this.obj.isDeleted = false;
|
|
331
413
|
this.obj.setOriginal();
|
|
332
414
|
}
|
|
333
|
-
|
|
415
|
+
_context12.next = 3;
|
|
334
416
|
return this.event_run("on_load");
|
|
335
417
|
case 3:
|
|
336
|
-
|
|
418
|
+
_context12.next = 5;
|
|
337
419
|
return this.event_run("on_change", true);
|
|
338
420
|
case 5:
|
|
339
|
-
|
|
421
|
+
_context12.next = 7;
|
|
340
422
|
return this.event_run("on_after_load");
|
|
341
423
|
case 7:
|
|
342
|
-
|
|
424
|
+
_context12.next = 9;
|
|
343
425
|
return this.event_run("on_load_finished");
|
|
344
426
|
case 9:
|
|
345
|
-
return
|
|
427
|
+
return _context12.abrupt("return", true);
|
|
346
428
|
case 10:
|
|
347
429
|
case "end":
|
|
348
|
-
return
|
|
430
|
+
return _context12.stop();
|
|
349
431
|
}
|
|
350
|
-
},
|
|
432
|
+
}, _callee12, this);
|
|
351
433
|
}))).apply(this, arguments);
|
|
352
434
|
}
|
|
353
435
|
/**
|
|
@@ -358,49 +440,49 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
358
440
|
}, {
|
|
359
441
|
key: "onSave",
|
|
360
442
|
value: function onSave() {
|
|
361
|
-
return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
362
|
-
return _regeneratorRuntime().wrap(function
|
|
363
|
-
while (1) switch (
|
|
443
|
+
return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
444
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
445
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
364
446
|
case 0:
|
|
365
|
-
|
|
447
|
+
_context13.next = 2;
|
|
366
448
|
return this.event_run("on_save");
|
|
367
449
|
case 2:
|
|
368
|
-
|
|
450
|
+
_context13.next = 4;
|
|
369
451
|
return this.event_run("on_change", true);
|
|
370
452
|
case 4:
|
|
371
|
-
|
|
453
|
+
_context13.next = 6;
|
|
372
454
|
return Promise.resolve(true);
|
|
373
455
|
case 6:
|
|
374
|
-
return
|
|
456
|
+
return _context13.abrupt("return", _context13.sent);
|
|
375
457
|
case 7:
|
|
376
458
|
case "end":
|
|
377
|
-
return
|
|
459
|
+
return _context13.stop();
|
|
378
460
|
}
|
|
379
|
-
},
|
|
461
|
+
}, _callee13, this);
|
|
380
462
|
}))).apply(this, arguments);
|
|
381
463
|
}
|
|
382
464
|
}, {
|
|
383
465
|
key: "onAfterSave",
|
|
384
466
|
value: function onAfterSave() {
|
|
385
|
-
return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
386
|
-
return _regeneratorRuntime().wrap(function
|
|
387
|
-
while (1) switch (
|
|
467
|
+
return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
468
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
469
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
388
470
|
case 0:
|
|
389
|
-
|
|
471
|
+
_context14.next = 2;
|
|
390
472
|
return this.event_run("on_after_save");
|
|
391
473
|
case 2:
|
|
392
|
-
|
|
474
|
+
_context14.next = 4;
|
|
393
475
|
return this.event_run("on_save_finished");
|
|
394
476
|
case 4:
|
|
395
|
-
|
|
477
|
+
_context14.next = 6;
|
|
396
478
|
return Promise.resolve(true);
|
|
397
479
|
case 6:
|
|
398
|
-
return
|
|
480
|
+
return _context14.abrupt("return", _context14.sent);
|
|
399
481
|
case 7:
|
|
400
482
|
case "end":
|
|
401
|
-
return
|
|
483
|
+
return _context14.stop();
|
|
402
484
|
}
|
|
403
|
-
},
|
|
485
|
+
}, _callee14, this);
|
|
404
486
|
}))).apply(this, arguments);
|
|
405
487
|
}
|
|
406
488
|
}]);
|