@azrico/webobject 1.5.16 → 1.5.19
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.
|
@@ -701,6 +701,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
701
701
|
return _convert["default"].applyFormats({
|
|
702
702
|
inputobject: changedFields,
|
|
703
703
|
formats: (0, _object.object_getStatic)(this, "__formatList"),
|
|
704
|
+
isNew: this.isNew,
|
|
704
705
|
changableKeys: changableKeys,
|
|
705
706
|
applyDefaults: true
|
|
706
707
|
});
|
|
@@ -21,6 +21,7 @@ export declare class WebObjectManager<ObjType extends WebObject> extends ObjectM
|
|
|
21
21
|
getMetaValue(key: string): any;
|
|
22
22
|
get_deltaObject(): Promise<any>;
|
|
23
23
|
Save(): Promise<boolean>;
|
|
24
|
+
New(): Promise<void>;
|
|
24
25
|
Delete(): Promise<any>;
|
|
25
26
|
Lock(): Promise<any>;
|
|
26
27
|
UnLock(): Promise<any>;
|
|
@@ -307,45 +307,38 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
307
307
|
return Save;
|
|
308
308
|
}())
|
|
309
309
|
}, {
|
|
310
|
-
key: "
|
|
310
|
+
key: "New",
|
|
311
311
|
value: function () {
|
|
312
|
-
var
|
|
313
|
-
var
|
|
312
|
+
var _New = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
313
|
+
var cls;
|
|
314
314
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
315
315
|
while (1) switch (_context8.prev = _context8.next) {
|
|
316
316
|
case 0:
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
_context8.next = 5;
|
|
323
|
-
break;
|
|
324
|
-
}
|
|
325
|
-
_context8.t0 = false;
|
|
326
|
-
case 5:
|
|
327
|
-
return _context8.abrupt("return", _context8.t0);
|
|
328
|
-
case 6:
|
|
317
|
+
cls = this.getObjectType();
|
|
318
|
+
this.setObject(new cls());
|
|
319
|
+
_context8.next = 4;
|
|
320
|
+
return this.onNew();
|
|
321
|
+
case 4:
|
|
329
322
|
case "end":
|
|
330
323
|
return _context8.stop();
|
|
331
324
|
}
|
|
332
325
|
}, _callee8, this);
|
|
333
326
|
}));
|
|
334
|
-
function
|
|
335
|
-
return
|
|
327
|
+
function New() {
|
|
328
|
+
return _New.apply(this, arguments);
|
|
336
329
|
}
|
|
337
|
-
return
|
|
330
|
+
return New;
|
|
338
331
|
}()
|
|
339
332
|
}, {
|
|
340
|
-
key: "
|
|
333
|
+
key: "Delete",
|
|
341
334
|
value: function () {
|
|
342
|
-
var
|
|
343
|
-
var _this$
|
|
335
|
+
var _Delete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
336
|
+
var _this$obj5;
|
|
344
337
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
345
338
|
while (1) switch (_context9.prev = _context9.next) {
|
|
346
339
|
case 0:
|
|
347
340
|
_context9.next = 2;
|
|
348
|
-
return (_this$
|
|
341
|
+
return (_this$obj5 = this.obj) === null || _this$obj5 === void 0 ? void 0 : _this$obj5.Delete();
|
|
349
342
|
case 2:
|
|
350
343
|
_context9.t0 = _context9.sent;
|
|
351
344
|
if (_context9.t0) {
|
|
@@ -361,21 +354,21 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
361
354
|
}
|
|
362
355
|
}, _callee9, this);
|
|
363
356
|
}));
|
|
364
|
-
function
|
|
365
|
-
return
|
|
357
|
+
function Delete() {
|
|
358
|
+
return _Delete.apply(this, arguments);
|
|
366
359
|
}
|
|
367
|
-
return
|
|
360
|
+
return Delete;
|
|
368
361
|
}()
|
|
369
362
|
}, {
|
|
370
|
-
key: "
|
|
363
|
+
key: "Lock",
|
|
371
364
|
value: function () {
|
|
372
|
-
var
|
|
373
|
-
var _this$
|
|
365
|
+
var _Lock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
366
|
+
var _this$obj6;
|
|
374
367
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
375
368
|
while (1) switch (_context10.prev = _context10.next) {
|
|
376
369
|
case 0:
|
|
377
370
|
_context10.next = 2;
|
|
378
|
-
return (_this$
|
|
371
|
+
return (_this$obj6 = this.obj) === null || _this$obj6 === void 0 ? void 0 : _this$obj6.Lock();
|
|
379
372
|
case 2:
|
|
380
373
|
_context10.t0 = _context10.sent;
|
|
381
374
|
if (_context10.t0) {
|
|
@@ -391,21 +384,21 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
391
384
|
}
|
|
392
385
|
}, _callee10, this);
|
|
393
386
|
}));
|
|
394
|
-
function
|
|
395
|
-
return
|
|
387
|
+
function Lock() {
|
|
388
|
+
return _Lock.apply(this, arguments);
|
|
396
389
|
}
|
|
397
|
-
return
|
|
390
|
+
return Lock;
|
|
398
391
|
}()
|
|
399
392
|
}, {
|
|
400
|
-
key: "
|
|
393
|
+
key: "UnLock",
|
|
401
394
|
value: function () {
|
|
402
|
-
var
|
|
403
|
-
var _this$
|
|
395
|
+
var _UnLock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
396
|
+
var _this$obj7;
|
|
404
397
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
405
398
|
while (1) switch (_context11.prev = _context11.next) {
|
|
406
399
|
case 0:
|
|
407
400
|
_context11.next = 2;
|
|
408
|
-
return (_this$
|
|
401
|
+
return (_this$obj7 = this.obj) === null || _this$obj7 === void 0 ? void 0 : _this$obj7.UnLock();
|
|
409
402
|
case 2:
|
|
410
403
|
_context11.t0 = _context11.sent;
|
|
411
404
|
if (_context11.t0) {
|
|
@@ -421,21 +414,21 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
421
414
|
}
|
|
422
415
|
}, _callee11, this);
|
|
423
416
|
}));
|
|
424
|
-
function
|
|
425
|
-
return
|
|
417
|
+
function UnLock() {
|
|
418
|
+
return _UnLock.apply(this, arguments);
|
|
426
419
|
}
|
|
427
|
-
return
|
|
420
|
+
return UnLock;
|
|
428
421
|
}()
|
|
429
422
|
}, {
|
|
430
|
-
key: "
|
|
423
|
+
key: "Archive",
|
|
431
424
|
value: function () {
|
|
432
|
-
var
|
|
433
|
-
var _this$
|
|
425
|
+
var _Archive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
426
|
+
var _this$obj8;
|
|
434
427
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
435
428
|
while (1) switch (_context12.prev = _context12.next) {
|
|
436
429
|
case 0:
|
|
437
430
|
_context12.next = 2;
|
|
438
|
-
return (_this$
|
|
431
|
+
return (_this$obj8 = this.obj) === null || _this$obj8 === void 0 ? void 0 : _this$obj8.Archive();
|
|
439
432
|
case 2:
|
|
440
433
|
_context12.t0 = _context12.sent;
|
|
441
434
|
if (_context12.t0) {
|
|
@@ -451,6 +444,36 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
451
444
|
}
|
|
452
445
|
}, _callee12, this);
|
|
453
446
|
}));
|
|
447
|
+
function Archive() {
|
|
448
|
+
return _Archive.apply(this, arguments);
|
|
449
|
+
}
|
|
450
|
+
return Archive;
|
|
451
|
+
}()
|
|
452
|
+
}, {
|
|
453
|
+
key: "UnArchive",
|
|
454
|
+
value: function () {
|
|
455
|
+
var _UnArchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
456
|
+
var _this$obj9;
|
|
457
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
458
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
459
|
+
case 0:
|
|
460
|
+
_context13.next = 2;
|
|
461
|
+
return (_this$obj9 = this.obj) === null || _this$obj9 === void 0 ? void 0 : _this$obj9.UnArchive();
|
|
462
|
+
case 2:
|
|
463
|
+
_context13.t0 = _context13.sent;
|
|
464
|
+
if (_context13.t0) {
|
|
465
|
+
_context13.next = 5;
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
_context13.t0 = false;
|
|
469
|
+
case 5:
|
|
470
|
+
return _context13.abrupt("return", _context13.t0);
|
|
471
|
+
case 6:
|
|
472
|
+
case "end":
|
|
473
|
+
return _context13.stop();
|
|
474
|
+
}
|
|
475
|
+
}, _callee13, this);
|
|
476
|
+
}));
|
|
454
477
|
function UnArchive() {
|
|
455
478
|
return _UnArchive.apply(this, arguments);
|
|
456
479
|
}
|
|
@@ -459,51 +482,51 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
459
482
|
}, {
|
|
460
483
|
key: "Load",
|
|
461
484
|
value: (function () {
|
|
462
|
-
var _Load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
485
|
+
var _Load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(id) {
|
|
463
486
|
var classType, result_product;
|
|
464
|
-
return _regeneratorRuntime().wrap(function
|
|
465
|
-
while (1) switch (
|
|
487
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
488
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
466
489
|
case 0:
|
|
467
490
|
if (id) {
|
|
468
|
-
|
|
491
|
+
_context14.next = 2;
|
|
469
492
|
break;
|
|
470
493
|
}
|
|
471
|
-
return
|
|
494
|
+
return _context14.abrupt("return");
|
|
472
495
|
case 2:
|
|
473
|
-
|
|
496
|
+
_context14.prev = 2;
|
|
474
497
|
this.event_run("on_process_start", true);
|
|
475
498
|
classType = this.getObjectType();
|
|
476
499
|
if (!classType) {
|
|
477
500
|
console.error("[webobjectmanager]", "getObjectType failed to get the object_type.", "did you set the __object_type correctly ?");
|
|
478
501
|
}
|
|
479
|
-
|
|
502
|
+
_context14.next = 8;
|
|
480
503
|
return classType.get_single(id, false);
|
|
481
504
|
case 8:
|
|
482
|
-
result_product =
|
|
505
|
+
result_product = _context14.sent;
|
|
483
506
|
if (!(result_product && _typeof(result_product) === "object" && _index.WebObject.getID(result_product))) {
|
|
484
|
-
|
|
507
|
+
_context14.next = 15;
|
|
485
508
|
break;
|
|
486
509
|
}
|
|
487
510
|
this.setObject(result_product);
|
|
488
|
-
|
|
511
|
+
_context14.next = 13;
|
|
489
512
|
return result_product.onLoad();
|
|
490
513
|
case 13:
|
|
491
|
-
|
|
514
|
+
_context14.next = 17;
|
|
492
515
|
break;
|
|
493
516
|
case 15:
|
|
494
517
|
console.error("badobject:", id, result_product);
|
|
495
518
|
_index.WebObject.addError(this.obj, "Invalid ".concat(this.__object_name), "The loaded ".concat(this.__object_name, " from website is invalid"), true);
|
|
496
519
|
case 17:
|
|
497
|
-
|
|
520
|
+
_context14.prev = 17;
|
|
498
521
|
this.event_run("on_process_end", true);
|
|
499
|
-
return
|
|
522
|
+
return _context14.finish(17);
|
|
500
523
|
case 20:
|
|
501
|
-
return
|
|
524
|
+
return _context14.abrupt("return", this.getObject());
|
|
502
525
|
case 21:
|
|
503
526
|
case "end":
|
|
504
|
-
return
|
|
527
|
+
return _context14.stop();
|
|
505
528
|
}
|
|
506
|
-
},
|
|
529
|
+
}, _callee14, this, [[2,, 17, 20]]);
|
|
507
530
|
}));
|
|
508
531
|
function Load(_x7) {
|
|
509
532
|
return _Load.apply(this, arguments);
|
|
@@ -557,24 +580,24 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
557
580
|
}, {
|
|
558
581
|
key: "onDelete",
|
|
559
582
|
value: (function () {
|
|
560
|
-
var _onDelete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
583
|
+
var _onDelete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
561
584
|
var srt;
|
|
562
|
-
return _regeneratorRuntime().wrap(function
|
|
563
|
-
while (1) switch (
|
|
585
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
586
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
564
587
|
case 0:
|
|
565
588
|
srt = this.getSaveResultType();
|
|
566
|
-
|
|
589
|
+
_context15.next = 3;
|
|
567
590
|
return this.event_run("on_delete", srt);
|
|
568
591
|
case 3:
|
|
569
|
-
|
|
592
|
+
_context15.next = 5;
|
|
570
593
|
return this.event_run("on_after_delete", srt);
|
|
571
594
|
case 5:
|
|
572
|
-
return
|
|
595
|
+
return _context15.abrupt("return", true);
|
|
573
596
|
case 6:
|
|
574
597
|
case "end":
|
|
575
|
-
return
|
|
598
|
+
return _context15.stop();
|
|
576
599
|
}
|
|
577
|
-
},
|
|
600
|
+
}, _callee15, this);
|
|
578
601
|
}));
|
|
579
602
|
function onDelete() {
|
|
580
603
|
return _onDelete.apply(this, arguments);
|
|
@@ -584,24 +607,24 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
584
607
|
}, {
|
|
585
608
|
key: "onArchive",
|
|
586
609
|
value: function () {
|
|
587
|
-
var _onArchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
610
|
+
var _onArchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
588
611
|
var srt;
|
|
589
|
-
return _regeneratorRuntime().wrap(function
|
|
590
|
-
while (1) switch (
|
|
612
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
613
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
591
614
|
case 0:
|
|
592
615
|
srt = this.getSaveResultType();
|
|
593
|
-
|
|
616
|
+
_context16.next = 3;
|
|
594
617
|
return this.event_run("on_archive", srt);
|
|
595
618
|
case 3:
|
|
596
|
-
|
|
619
|
+
_context16.next = 5;
|
|
597
620
|
return this.event_run("on_after_archive", srt);
|
|
598
621
|
case 5:
|
|
599
|
-
return
|
|
622
|
+
return _context16.abrupt("return", true);
|
|
600
623
|
case 6:
|
|
601
624
|
case "end":
|
|
602
|
-
return
|
|
625
|
+
return _context16.stop();
|
|
603
626
|
}
|
|
604
|
-
},
|
|
627
|
+
}, _callee16, this);
|
|
605
628
|
}));
|
|
606
629
|
function onArchive() {
|
|
607
630
|
return _onArchive.apply(this, arguments);
|
|
@@ -611,24 +634,24 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
611
634
|
}, {
|
|
612
635
|
key: "onUnArchive",
|
|
613
636
|
value: function () {
|
|
614
|
-
var _onUnArchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
637
|
+
var _onUnArchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
615
638
|
var srt;
|
|
616
|
-
return _regeneratorRuntime().wrap(function
|
|
617
|
-
while (1) switch (
|
|
639
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
640
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
618
641
|
case 0:
|
|
619
642
|
srt = this.getSaveResultType();
|
|
620
|
-
|
|
643
|
+
_context17.next = 3;
|
|
621
644
|
return this.event_run("on_unarchive", srt);
|
|
622
645
|
case 3:
|
|
623
|
-
|
|
646
|
+
_context17.next = 5;
|
|
624
647
|
return this.event_run("on_after_unarchive", srt);
|
|
625
648
|
case 5:
|
|
626
|
-
return
|
|
649
|
+
return _context17.abrupt("return", true);
|
|
627
650
|
case 6:
|
|
628
651
|
case "end":
|
|
629
|
-
return
|
|
652
|
+
return _context17.stop();
|
|
630
653
|
}
|
|
631
|
-
},
|
|
654
|
+
}, _callee17, this);
|
|
632
655
|
}));
|
|
633
656
|
function onUnArchive() {
|
|
634
657
|
return _onUnArchive.apply(this, arguments);
|
|
@@ -638,24 +661,24 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
638
661
|
}, {
|
|
639
662
|
key: "onLock",
|
|
640
663
|
value: function () {
|
|
641
|
-
var _onLock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
664
|
+
var _onLock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
642
665
|
var srt;
|
|
643
|
-
return _regeneratorRuntime().wrap(function
|
|
644
|
-
while (1) switch (
|
|
666
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
667
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
645
668
|
case 0:
|
|
646
669
|
srt = this.getSaveResultType();
|
|
647
|
-
|
|
670
|
+
_context18.next = 3;
|
|
648
671
|
return this.event_run("on_lock", srt);
|
|
649
672
|
case 3:
|
|
650
|
-
|
|
673
|
+
_context18.next = 5;
|
|
651
674
|
return this.event_run("on_after_lock", srt);
|
|
652
675
|
case 5:
|
|
653
|
-
return
|
|
676
|
+
return _context18.abrupt("return", true);
|
|
654
677
|
case 6:
|
|
655
678
|
case "end":
|
|
656
|
-
return
|
|
679
|
+
return _context18.stop();
|
|
657
680
|
}
|
|
658
|
-
},
|
|
681
|
+
}, _callee18, this);
|
|
659
682
|
}));
|
|
660
683
|
function onLock() {
|
|
661
684
|
return _onLock.apply(this, arguments);
|
|
@@ -665,24 +688,24 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
665
688
|
}, {
|
|
666
689
|
key: "onUnLock",
|
|
667
690
|
value: function () {
|
|
668
|
-
var _onUnLock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
691
|
+
var _onUnLock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
669
692
|
var srt;
|
|
670
|
-
return _regeneratorRuntime().wrap(function
|
|
671
|
-
while (1) switch (
|
|
693
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
694
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
672
695
|
case 0:
|
|
673
696
|
srt = this.getSaveResultType();
|
|
674
|
-
|
|
697
|
+
_context19.next = 3;
|
|
675
698
|
return this.event_run("on_unlock", srt);
|
|
676
699
|
case 3:
|
|
677
|
-
|
|
700
|
+
_context19.next = 5;
|
|
678
701
|
return this.event_run("on_after_unlock", srt);
|
|
679
702
|
case 5:
|
|
680
|
-
return
|
|
703
|
+
return _context19.abrupt("return", true);
|
|
681
704
|
case 6:
|
|
682
705
|
case "end":
|
|
683
|
-
return
|
|
706
|
+
return _context19.stop();
|
|
684
707
|
}
|
|
685
|
-
},
|
|
708
|
+
}, _callee19, this);
|
|
686
709
|
}));
|
|
687
710
|
function onUnLock() {
|
|
688
711
|
return _onUnLock.apply(this, arguments);
|
|
@@ -697,35 +720,35 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
697
720
|
}, {
|
|
698
721
|
key: "onNew",
|
|
699
722
|
value: (function () {
|
|
700
|
-
var _onNew = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
723
|
+
var _onNew = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
701
724
|
var _this$obj11;
|
|
702
|
-
return _regeneratorRuntime().wrap(function
|
|
703
|
-
while (1) switch (
|
|
725
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
726
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
704
727
|
case 0:
|
|
705
728
|
if (this.canModify) {
|
|
706
729
|
(_this$obj11 = this.obj) === null || _this$obj11 === void 0 || _this$obj11.setOriginal();
|
|
707
730
|
}
|
|
708
|
-
|
|
731
|
+
_context20.next = 3;
|
|
709
732
|
return this.event_run("on_new");
|
|
710
733
|
case 3:
|
|
711
|
-
|
|
734
|
+
_context20.next = 5;
|
|
712
735
|
return this.event_run("on_change", true);
|
|
713
736
|
case 5:
|
|
714
|
-
|
|
737
|
+
_context20.next = 7;
|
|
715
738
|
return this.event_run("on_after_new");
|
|
716
739
|
case 7:
|
|
717
|
-
|
|
740
|
+
_context20.next = 9;
|
|
718
741
|
return this.checkIsChanged();
|
|
719
742
|
case 9:
|
|
720
|
-
|
|
743
|
+
_context20.next = 11;
|
|
721
744
|
return Promise.resolve(true);
|
|
722
745
|
case 11:
|
|
723
|
-
return
|
|
746
|
+
return _context20.abrupt("return", _context20.sent);
|
|
724
747
|
case 12:
|
|
725
748
|
case "end":
|
|
726
|
-
return
|
|
749
|
+
return _context20.stop();
|
|
727
750
|
}
|
|
728
|
-
},
|
|
751
|
+
}, _callee20, this);
|
|
729
752
|
}));
|
|
730
753
|
function onNew() {
|
|
731
754
|
return _onNew.apply(this, arguments);
|
|
@@ -741,35 +764,35 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
741
764
|
}, {
|
|
742
765
|
key: "onLoad",
|
|
743
766
|
value: (function () {
|
|
744
|
-
var _onLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
745
|
-
return _regeneratorRuntime().wrap(function
|
|
746
|
-
while (1) switch (
|
|
767
|
+
var _onLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
768
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
769
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
747
770
|
case 0:
|
|
748
771
|
if (this.canModify && this.obj) {
|
|
749
772
|
this.obj.isDeleted = false;
|
|
750
773
|
this.obj.setOriginal();
|
|
751
774
|
}
|
|
752
|
-
|
|
775
|
+
_context21.next = 3;
|
|
753
776
|
return this.event_run("on_load");
|
|
754
777
|
case 3:
|
|
755
|
-
|
|
778
|
+
_context21.next = 5;
|
|
756
779
|
return this.event_run("on_change", true);
|
|
757
780
|
case 5:
|
|
758
|
-
|
|
781
|
+
_context21.next = 7;
|
|
759
782
|
return this.event_run("on_after_load");
|
|
760
783
|
case 7:
|
|
761
|
-
|
|
784
|
+
_context21.next = 9;
|
|
762
785
|
return this.event_run("on_load_finished");
|
|
763
786
|
case 9:
|
|
764
|
-
|
|
787
|
+
_context21.next = 11;
|
|
765
788
|
return this.checkIsChanged();
|
|
766
789
|
case 11:
|
|
767
|
-
return
|
|
790
|
+
return _context21.abrupt("return", true);
|
|
768
791
|
case 12:
|
|
769
792
|
case "end":
|
|
770
|
-
return
|
|
793
|
+
return _context21.stop();
|
|
771
794
|
}
|
|
772
|
-
},
|
|
795
|
+
}, _callee21, this);
|
|
773
796
|
}));
|
|
774
797
|
function onLoad() {
|
|
775
798
|
return _onLoad.apply(this, arguments);
|
|
@@ -785,30 +808,30 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
785
808
|
}, {
|
|
786
809
|
key: "onSave",
|
|
787
810
|
value: (function () {
|
|
788
|
-
var _onSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
811
|
+
var _onSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
789
812
|
var srt;
|
|
790
|
-
return _regeneratorRuntime().wrap(function
|
|
791
|
-
while (1) switch (
|
|
813
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
814
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
792
815
|
case 0:
|
|
793
816
|
srt = this.getSaveResultType();
|
|
794
|
-
|
|
817
|
+
_context22.next = 3;
|
|
795
818
|
return this.event_run("on_save", srt);
|
|
796
819
|
case 3:
|
|
797
|
-
|
|
820
|
+
_context22.next = 5;
|
|
798
821
|
return this.event_run("on_change", true);
|
|
799
822
|
case 5:
|
|
800
|
-
|
|
823
|
+
_context22.next = 7;
|
|
801
824
|
return this.checkIsChanged();
|
|
802
825
|
case 7:
|
|
803
|
-
|
|
826
|
+
_context22.next = 9;
|
|
804
827
|
return Promise.resolve(true);
|
|
805
828
|
case 9:
|
|
806
|
-
return
|
|
829
|
+
return _context22.abrupt("return", _context22.sent);
|
|
807
830
|
case 10:
|
|
808
831
|
case "end":
|
|
809
|
-
return
|
|
832
|
+
return _context22.stop();
|
|
810
833
|
}
|
|
811
|
-
},
|
|
834
|
+
}, _callee22, this);
|
|
812
835
|
}));
|
|
813
836
|
function onSave() {
|
|
814
837
|
return _onSave.apply(this, arguments);
|
|
@@ -818,27 +841,27 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
818
841
|
}, {
|
|
819
842
|
key: "onAfterSave",
|
|
820
843
|
value: function () {
|
|
821
|
-
var _onAfterSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
844
|
+
var _onAfterSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
822
845
|
var srt;
|
|
823
|
-
return _regeneratorRuntime().wrap(function
|
|
824
|
-
while (1) switch (
|
|
846
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
847
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
825
848
|
case 0:
|
|
826
849
|
srt = this.getSaveResultType();
|
|
827
|
-
|
|
850
|
+
_context23.next = 3;
|
|
828
851
|
return this.event_run("on_after_save", srt);
|
|
829
852
|
case 3:
|
|
830
|
-
|
|
853
|
+
_context23.next = 5;
|
|
831
854
|
return this.event_run("on_save_finished", srt);
|
|
832
855
|
case 5:
|
|
833
|
-
|
|
856
|
+
_context23.next = 7;
|
|
834
857
|
return Promise.resolve(true);
|
|
835
858
|
case 7:
|
|
836
|
-
return
|
|
859
|
+
return _context23.abrupt("return", _context23.sent);
|
|
837
860
|
case 8:
|
|
838
861
|
case "end":
|
|
839
|
-
return
|
|
862
|
+
return _context23.stop();
|
|
840
863
|
}
|
|
841
|
-
},
|
|
864
|
+
}, _callee23, this);
|
|
842
865
|
}));
|
|
843
866
|
function onAfterSave() {
|
|
844
867
|
return _onAfterSave.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azrico/webobject",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.19",
|
|
4
4
|
"description": "Stateful object",
|
|
5
5
|
"author": "Azrideus",
|
|
6
6
|
"license": "MIT",
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
"@azrico/uid": "*"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@azrico/convert": "^1.0.
|
|
73
|
-
"@azrico/event": "^1.2.
|
|
72
|
+
"@azrico/convert": "^1.0.18",
|
|
73
|
+
"@azrico/event": "^1.2.62",
|
|
74
74
|
"@azrico/global": "^1.3.85",
|
|
75
75
|
"@azrico/math": "^1.0.5",
|
|
76
|
-
"@azrico/object": "^1.4.
|
|
77
|
-
"@azrico/string": "^1.
|
|
76
|
+
"@azrico/object": "^1.4.126",
|
|
77
|
+
"@azrico/string": "^1.3.4",
|
|
78
78
|
"@azrico/types": "^1.0.11",
|
|
79
79
|
"@azrico/uid": "^1.0.8"
|
|
80
80
|
},
|