@azrico/webobject 1.3.7 → 1.3.9
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.
|
@@ -69,6 +69,7 @@ export declare class WebObject extends SimpleObject {
|
|
|
69
69
|
static get_webname(): string | undefined;
|
|
70
70
|
get manager(): WebObjectManager<any> | null;
|
|
71
71
|
get_managerClass: () => WebObjectManager<any> | null;
|
|
72
|
+
onDelete(...p: any): Promise<any>;
|
|
72
73
|
onLoad(...p: any): Promise<any>;
|
|
73
74
|
onSave(...p: any): Promise<any>;
|
|
74
75
|
onNew(...p: any): Promise<any>;
|
|
@@ -344,9 +344,9 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
344
344
|
return this.get_managerClass();
|
|
345
345
|
}
|
|
346
346
|
}, {
|
|
347
|
-
key: "
|
|
347
|
+
key: "onDelete",
|
|
348
348
|
value: /* -------------------------------------------------------------------------- */function () {
|
|
349
|
-
var
|
|
349
|
+
var _onDelete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
350
350
|
var _this$manager;
|
|
351
351
|
var _len,
|
|
352
352
|
p,
|
|
@@ -355,19 +355,51 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
355
355
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
356
356
|
while (1) switch (_context6.prev = _context6.next) {
|
|
357
357
|
case 0:
|
|
358
|
+
this.isDeleted = true;
|
|
358
359
|
for (_len = _args6.length, p = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
359
360
|
p[_key] = _args6[_key];
|
|
360
361
|
}
|
|
361
|
-
_context6.next =
|
|
362
|
-
return (_this$manager = this.manager) === null || _this$manager === void 0 ? void 0 : _this$manager.
|
|
363
|
-
case 3:
|
|
364
|
-
return _context6.abrupt("return", _context6.sent);
|
|
362
|
+
_context6.next = 4;
|
|
363
|
+
return (_this$manager = this.manager) === null || _this$manager === void 0 ? void 0 : _this$manager.onDelete.apply(_this$manager, p);
|
|
365
364
|
case 4:
|
|
365
|
+
return _context6.abrupt("return", _context6.sent);
|
|
366
|
+
case 5:
|
|
366
367
|
case "end":
|
|
367
368
|
return _context6.stop();
|
|
368
369
|
}
|
|
369
370
|
}, _callee6, this);
|
|
370
371
|
}));
|
|
372
|
+
function onDelete() {
|
|
373
|
+
return _onDelete.apply(this, arguments);
|
|
374
|
+
}
|
|
375
|
+
return onDelete;
|
|
376
|
+
}()
|
|
377
|
+
}, {
|
|
378
|
+
key: "onLoad",
|
|
379
|
+
value: function () {
|
|
380
|
+
var _onLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
381
|
+
var _this$manager2;
|
|
382
|
+
var _len2,
|
|
383
|
+
p,
|
|
384
|
+
_key2,
|
|
385
|
+
_args7 = arguments;
|
|
386
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
387
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
388
|
+
case 0:
|
|
389
|
+
this.isDeleted = false;
|
|
390
|
+
for (_len2 = _args7.length, p = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
391
|
+
p[_key2] = _args7[_key2];
|
|
392
|
+
}
|
|
393
|
+
_context7.next = 4;
|
|
394
|
+
return (_this$manager2 = this.manager) === null || _this$manager2 === void 0 ? void 0 : _this$manager2.onLoad.apply(_this$manager2, p);
|
|
395
|
+
case 4:
|
|
396
|
+
return _context7.abrupt("return", _context7.sent);
|
|
397
|
+
case 5:
|
|
398
|
+
case "end":
|
|
399
|
+
return _context7.stop();
|
|
400
|
+
}
|
|
401
|
+
}, _callee7, this);
|
|
402
|
+
}));
|
|
371
403
|
function onLoad() {
|
|
372
404
|
return _onLoad.apply(this, arguments);
|
|
373
405
|
}
|
|
@@ -376,17 +408,17 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
376
408
|
}, {
|
|
377
409
|
key: "onSave",
|
|
378
410
|
value: function () {
|
|
379
|
-
var _onSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
411
|
+
var _onSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
380
412
|
var _this3 = this,
|
|
381
|
-
_this$
|
|
413
|
+
_this$manager3;
|
|
382
414
|
var srObject,
|
|
383
415
|
actual_sr,
|
|
384
|
-
|
|
416
|
+
_len3,
|
|
385
417
|
p,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
return _regeneratorRuntime().wrap(function
|
|
389
|
-
while (1) switch (
|
|
418
|
+
_key3,
|
|
419
|
+
_args8 = arguments;
|
|
420
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
421
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
390
422
|
case 0:
|
|
391
423
|
if (this.isSaved) {
|
|
392
424
|
this.apply_changes();
|
|
@@ -410,18 +442,18 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
410
442
|
}
|
|
411
443
|
}
|
|
412
444
|
}
|
|
413
|
-
for (
|
|
414
|
-
p[
|
|
445
|
+
for (_len3 = _args8.length, p = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
446
|
+
p[_key3] = _args8[_key3];
|
|
415
447
|
}
|
|
416
|
-
|
|
417
|
-
return (_this$
|
|
448
|
+
_context8.next = 4;
|
|
449
|
+
return (_this$manager3 = this.manager) === null || _this$manager3 === void 0 ? void 0 : _this$manager3.onSave.apply(_this$manager3, p);
|
|
418
450
|
case 4:
|
|
419
|
-
return
|
|
451
|
+
return _context8.abrupt("return", _context8.sent);
|
|
420
452
|
case 5:
|
|
421
453
|
case "end":
|
|
422
|
-
return
|
|
454
|
+
return _context8.stop();
|
|
423
455
|
}
|
|
424
|
-
},
|
|
456
|
+
}, _callee8, this);
|
|
425
457
|
}));
|
|
426
458
|
function onSave() {
|
|
427
459
|
return _onSave.apply(this, arguments);
|
|
@@ -431,27 +463,27 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
431
463
|
}, {
|
|
432
464
|
key: "onNew",
|
|
433
465
|
value: function () {
|
|
434
|
-
var _onNew = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
435
|
-
var _this$
|
|
436
|
-
var
|
|
466
|
+
var _onNew = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
467
|
+
var _this$manager4;
|
|
468
|
+
var _len4,
|
|
437
469
|
p,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
return _regeneratorRuntime().wrap(function
|
|
441
|
-
while (1) switch (
|
|
470
|
+
_key4,
|
|
471
|
+
_args9 = arguments;
|
|
472
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
473
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
442
474
|
case 0:
|
|
443
|
-
for (
|
|
444
|
-
p[
|
|
475
|
+
for (_len4 = _args9.length, p = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
476
|
+
p[_key4] = _args9[_key4];
|
|
445
477
|
}
|
|
446
|
-
|
|
447
|
-
return (_this$
|
|
478
|
+
_context9.next = 3;
|
|
479
|
+
return (_this$manager4 = this.manager) === null || _this$manager4 === void 0 ? void 0 : _this$manager4.onNew.apply(_this$manager4, p);
|
|
448
480
|
case 3:
|
|
449
|
-
return
|
|
481
|
+
return _context9.abrupt("return", _context9.sent);
|
|
450
482
|
case 4:
|
|
451
483
|
case "end":
|
|
452
|
-
return
|
|
484
|
+
return _context9.stop();
|
|
453
485
|
}
|
|
454
|
-
},
|
|
486
|
+
}, _callee9, this);
|
|
455
487
|
}));
|
|
456
488
|
function onNew() {
|
|
457
489
|
return _onNew.apply(this, arguments);
|
|
@@ -503,64 +535,64 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
503
535
|
}, {
|
|
504
536
|
key: "get_single",
|
|
505
537
|
value: function () {
|
|
506
|
-
var _get_single = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
507
|
-
var
|
|
538
|
+
var _get_single = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
539
|
+
var _len5,
|
|
508
540
|
p,
|
|
509
|
-
|
|
541
|
+
_key5,
|
|
510
542
|
search,
|
|
511
543
|
readonly,
|
|
512
544
|
fetchID,
|
|
513
545
|
res,
|
|
514
546
|
params,
|
|
515
|
-
|
|
516
|
-
return _regeneratorRuntime().wrap(function
|
|
517
|
-
while (1) switch (
|
|
547
|
+
_args10 = arguments;
|
|
548
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
549
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
518
550
|
case 0:
|
|
519
|
-
for (
|
|
520
|
-
p[
|
|
551
|
+
for (_len5 = _args10.length, p = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
552
|
+
p[_key5] = _args10[_key5];
|
|
521
553
|
}
|
|
522
554
|
search = p.shift();
|
|
523
555
|
readonly = p.shift();
|
|
524
556
|
fetchID = p.shift();
|
|
525
557
|
if (!(0, _object.object_isEmpty)(search)) {
|
|
526
|
-
|
|
558
|
+
_context10.next = 6;
|
|
527
559
|
break;
|
|
528
560
|
}
|
|
529
|
-
return
|
|
561
|
+
return _context10.abrupt("return", undefined);
|
|
530
562
|
case 6:
|
|
531
563
|
params = {};
|
|
532
564
|
params.context = readonly ? "view" : "edit";
|
|
533
|
-
|
|
534
|
-
|
|
565
|
+
_context10.t0 = _typeof(search);
|
|
566
|
+
_context10.next = _context10.t0 === "string" ? 11 : _context10.t0 === "number" ? 11 : _context10.t0 === "object" ? 19 : 19;
|
|
535
567
|
break;
|
|
536
568
|
case 11:
|
|
537
569
|
search = String(search);
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
570
|
+
_context10.t1 = this;
|
|
571
|
+
_context10.t2 = this;
|
|
572
|
+
_context10.next = 16;
|
|
541
573
|
return _global.gfunc.run_action("get", this.__web_path + "/" + search, params, {
|
|
542
574
|
fetchID: fetchID
|
|
543
575
|
});
|
|
544
576
|
case 16:
|
|
545
|
-
|
|
546
|
-
res =
|
|
547
|
-
return
|
|
577
|
+
_context10.t3 = _context10.sent;
|
|
578
|
+
res = _context10.t1.ensure.call(_context10.t1, _context10.t2, _context10.t3);
|
|
579
|
+
return _context10.abrupt("break", 25);
|
|
548
580
|
case 19:
|
|
549
|
-
|
|
550
|
-
|
|
581
|
+
_context10.t4 = _object.object_first;
|
|
582
|
+
_context10.next = 22;
|
|
551
583
|
return this.get_list(search, readonly, fetchID);
|
|
552
584
|
case 22:
|
|
553
|
-
|
|
554
|
-
res = (0,
|
|
555
|
-
return
|
|
585
|
+
_context10.t5 = _context10.sent;
|
|
586
|
+
res = (0, _context10.t4)(_context10.t5);
|
|
587
|
+
return _context10.abrupt("break", 25);
|
|
556
588
|
case 25:
|
|
557
589
|
WebObject.setReadonly(res, readonly);
|
|
558
|
-
return
|
|
590
|
+
return _context10.abrupt("return", res);
|
|
559
591
|
case 27:
|
|
560
592
|
case "end":
|
|
561
|
-
return
|
|
593
|
+
return _context10.stop();
|
|
562
594
|
}
|
|
563
|
-
},
|
|
595
|
+
}, _callee10, this);
|
|
564
596
|
}));
|
|
565
597
|
function get_single() {
|
|
566
598
|
return _get_single.apply(this, arguments);
|
|
@@ -574,42 +606,42 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
574
606
|
}, {
|
|
575
607
|
key: "get_list",
|
|
576
608
|
value: function () {
|
|
577
|
-
var _get_list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
578
|
-
var
|
|
609
|
+
var _get_list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
610
|
+
var _len6,
|
|
579
611
|
p,
|
|
580
|
-
|
|
612
|
+
_key6,
|
|
581
613
|
search,
|
|
582
614
|
readonly,
|
|
583
615
|
fetchID,
|
|
584
616
|
result_items,
|
|
585
617
|
selftype,
|
|
586
618
|
res,
|
|
587
|
-
|
|
588
|
-
return _regeneratorRuntime().wrap(function
|
|
589
|
-
while (1) switch (
|
|
619
|
+
_args11 = arguments;
|
|
620
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
621
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
590
622
|
case 0:
|
|
591
|
-
for (
|
|
592
|
-
p[
|
|
623
|
+
for (_len6 = _args11.length, p = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
624
|
+
p[_key6] = _args11[_key6];
|
|
593
625
|
}
|
|
594
626
|
search = p.shift();
|
|
595
627
|
readonly = p.shift();
|
|
596
628
|
fetchID = p.shift();
|
|
597
629
|
if (!search) search = {};
|
|
598
|
-
|
|
630
|
+
_context11.next = 7;
|
|
599
631
|
return _global.gfunc.run_action("get", this.__web_path, search, {
|
|
600
632
|
fetchID: fetchID
|
|
601
633
|
});
|
|
602
634
|
case 7:
|
|
603
|
-
result_items =
|
|
635
|
+
result_items = _context11.sent;
|
|
604
636
|
selftype = this.prototype;
|
|
605
637
|
res = WebObject.map_rowindex(WebObject.mapto(selftype, result_items, readonly));
|
|
606
638
|
WebObject.setReadonly(res, readonly);
|
|
607
|
-
return
|
|
639
|
+
return _context11.abrupt("return", res);
|
|
608
640
|
case 12:
|
|
609
641
|
case "end":
|
|
610
|
-
return
|
|
642
|
+
return _context11.stop();
|
|
611
643
|
}
|
|
612
|
-
},
|
|
644
|
+
}, _callee11, this);
|
|
613
645
|
}));
|
|
614
646
|
function get_list() {
|
|
615
647
|
return _get_list.apply(this, arguments);
|
|
@@ -32,6 +32,12 @@ export declare class WebObjectManager<T extends WebObject> extends ObjectManager
|
|
|
32
32
|
* @returns
|
|
33
33
|
*/
|
|
34
34
|
onNew(...p: any): Promise<any>;
|
|
35
|
+
/**
|
|
36
|
+
* Use this when you delete Object
|
|
37
|
+
* @param p
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
onDelete(...p: any): Promise<any>;
|
|
35
41
|
/**
|
|
36
42
|
* Use this when you load data to the object
|
|
37
43
|
* @param p
|
|
@@ -254,39 +254,75 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager) {
|
|
|
254
254
|
return onNew;
|
|
255
255
|
}()
|
|
256
256
|
/**
|
|
257
|
-
* Use this when you
|
|
257
|
+
* Use this when you delete Object
|
|
258
258
|
* @param p
|
|
259
259
|
* @returns
|
|
260
260
|
*/
|
|
261
261
|
}, {
|
|
262
|
-
key: "
|
|
262
|
+
key: "onDelete",
|
|
263
263
|
value: function () {
|
|
264
|
-
var
|
|
265
|
-
var _this$obj9;
|
|
264
|
+
var _onDelete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
266
265
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
267
266
|
while (1) switch (_context6.prev = _context6.next) {
|
|
268
267
|
case 0:
|
|
269
|
-
if (this.
|
|
270
|
-
|
|
268
|
+
if (this.obj) {
|
|
269
|
+
this.obj.isDeleted = true;
|
|
271
270
|
}
|
|
272
271
|
_context6.next = 3;
|
|
273
|
-
return this.event_run("
|
|
272
|
+
return this.event_run("on_delete");
|
|
274
273
|
case 3:
|
|
275
274
|
_context6.next = 5;
|
|
276
|
-
return this.event_run("
|
|
275
|
+
return this.event_run("on_after_delete");
|
|
277
276
|
case 5:
|
|
278
277
|
_context6.next = 7;
|
|
278
|
+
return Promise.resolve(true);
|
|
279
|
+
case 7:
|
|
280
|
+
return _context6.abrupt("return", _context6.sent);
|
|
281
|
+
case 8:
|
|
282
|
+
case "end":
|
|
283
|
+
return _context6.stop();
|
|
284
|
+
}
|
|
285
|
+
}, _callee6, this);
|
|
286
|
+
}));
|
|
287
|
+
function onDelete() {
|
|
288
|
+
return _onDelete.apply(this, arguments);
|
|
289
|
+
}
|
|
290
|
+
return onDelete;
|
|
291
|
+
}()
|
|
292
|
+
/**
|
|
293
|
+
* Use this when you load data to the object
|
|
294
|
+
* @param p
|
|
295
|
+
* @returns
|
|
296
|
+
*/
|
|
297
|
+
}, {
|
|
298
|
+
key: "onLoad",
|
|
299
|
+
value: function () {
|
|
300
|
+
var _onLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
301
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
302
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
303
|
+
case 0:
|
|
304
|
+
if (this.canModify && this.obj) {
|
|
305
|
+
this.obj.isDeleted = false;
|
|
306
|
+
this.obj.setOriginal();
|
|
307
|
+
}
|
|
308
|
+
_context7.next = 3;
|
|
309
|
+
return this.event_run("on_load");
|
|
310
|
+
case 3:
|
|
311
|
+
_context7.next = 5;
|
|
312
|
+
return this.event_run("on_change", true);
|
|
313
|
+
case 5:
|
|
314
|
+
_context7.next = 7;
|
|
279
315
|
return this.event_run("on_after_load");
|
|
280
316
|
case 7:
|
|
281
|
-
|
|
317
|
+
_context7.next = 9;
|
|
282
318
|
return Promise.resolve(true);
|
|
283
319
|
case 9:
|
|
284
|
-
return
|
|
320
|
+
return _context7.abrupt("return", _context7.sent);
|
|
285
321
|
case 10:
|
|
286
322
|
case "end":
|
|
287
|
-
return
|
|
323
|
+
return _context7.stop();
|
|
288
324
|
}
|
|
289
|
-
},
|
|
325
|
+
}, _callee7, this);
|
|
290
326
|
}));
|
|
291
327
|
function onLoad() {
|
|
292
328
|
return _onLoad.apply(this, arguments);
|
|
@@ -301,28 +337,28 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager) {
|
|
|
301
337
|
}, {
|
|
302
338
|
key: "onSave",
|
|
303
339
|
value: function () {
|
|
304
|
-
var _onSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
305
|
-
return _regeneratorRuntime().wrap(function
|
|
306
|
-
while (1) switch (
|
|
340
|
+
var _onSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
341
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
342
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
307
343
|
case 0:
|
|
308
|
-
|
|
344
|
+
_context8.next = 2;
|
|
309
345
|
return this.event_run("on_save");
|
|
310
346
|
case 2:
|
|
311
|
-
|
|
347
|
+
_context8.next = 4;
|
|
312
348
|
return this.event_run("on_change", true);
|
|
313
349
|
case 4:
|
|
314
|
-
|
|
350
|
+
_context8.next = 6;
|
|
315
351
|
return this.event_run("on_after_save");
|
|
316
352
|
case 6:
|
|
317
|
-
|
|
353
|
+
_context8.next = 8;
|
|
318
354
|
return Promise.resolve(true);
|
|
319
355
|
case 8:
|
|
320
|
-
return
|
|
356
|
+
return _context8.abrupt("return", _context8.sent);
|
|
321
357
|
case 9:
|
|
322
358
|
case "end":
|
|
323
|
-
return
|
|
359
|
+
return _context8.stop();
|
|
324
360
|
}
|
|
325
|
-
},
|
|
361
|
+
}, _callee8, this);
|
|
326
362
|
}));
|
|
327
363
|
function onSave() {
|
|
328
364
|
return _onSave.apply(this, arguments);
|
|
@@ -13,6 +13,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
13
13
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
14
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
17
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
20
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
21
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
16
22
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
17
23
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
18
24
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -282,7 +288,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
282
288
|
return _context3.abrupt("return", false);
|
|
283
289
|
case 9:
|
|
284
290
|
if (_classPrivateMethodGet(this, _getProperty, _getProperty2).call(this, key) == null) {
|
|
285
|
-
_classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key,
|
|
291
|
+
_classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key, []);
|
|
286
292
|
}
|
|
287
293
|
tempArray = _classPrivateMethodGet(this, _getProperty, _getProperty2).call(this, key);
|
|
288
294
|
if (Array.isArray(tempArray)) {
|
|
@@ -297,17 +303,16 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
297
303
|
case 16:
|
|
298
304
|
return _context3.abrupt("return", false);
|
|
299
305
|
case 17:
|
|
300
|
-
|
|
301
|
-
_classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key, tempArray);
|
|
306
|
+
_classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key, [].concat(_toConsumableArray(tempArray), [value]));
|
|
302
307
|
if (!(sendChanges === true || sendChanges === "auto")) {
|
|
303
|
-
_context3.next =
|
|
308
|
+
_context3.next = 21;
|
|
304
309
|
break;
|
|
305
310
|
}
|
|
306
|
-
_context3.next =
|
|
311
|
+
_context3.next = 21;
|
|
307
312
|
return this.notifyChanged("", String(key), value);
|
|
308
|
-
case
|
|
313
|
+
case 21:
|
|
309
314
|
return _context3.abrupt("return", tempArray);
|
|
310
|
-
case
|
|
315
|
+
case 22:
|
|
311
316
|
case "end":
|
|
312
317
|
return _context3.stop();
|
|
313
318
|
}
|