@azrico/webobject 1.4.73 → 1.4.75
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.
|
@@ -54,7 +54,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> {
|
|
|
54
54
|
setSubValue(key: PropOf<ObjType>, objKey: string, subvalue: any): Promise<boolean>;
|
|
55
55
|
pushValue(key: PropOf<ObjType>, value: any): Promise<false | NonNullable<Awaited<ObjType[any]>>>;
|
|
56
56
|
setTemp(key: string, value: any, sendChanges?: sendChangesType): Promise<boolean>;
|
|
57
|
-
getTemp(key: string):
|
|
57
|
+
getTemp(key: string): any;
|
|
58
58
|
getIndexOrID(): number | string;
|
|
59
59
|
getIndex(): number;
|
|
60
60
|
getID(): string;
|
|
@@ -23,7 +23,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
23
23
|
/**
|
|
24
24
|
* This class manages the events of an Simple Object
|
|
25
25
|
*/
|
|
26
|
-
var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubValue, _pushValue, _setTemp,
|
|
26
|
+
var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubValue, _pushValue, _setTemp, _event_run, _event_add, _toggleOption, _setOption, _holdOption) {
|
|
27
27
|
function ObjectManager() {
|
|
28
28
|
_classCallCheck(this, ObjectManager);
|
|
29
29
|
_defineProperty(this, "__eventList", void 0);
|
|
@@ -303,30 +303,11 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
303
303
|
} //get temp value
|
|
304
304
|
}, {
|
|
305
305
|
key: "getTemp",
|
|
306
|
-
value: function getTemp(
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
case 0:
|
|
312
|
-
_context6.next = 2;
|
|
313
|
-
return (_this$obj9 = this.obj) === null || _this$obj9 === void 0 ? void 0 : _this$obj9.getTemp(key);
|
|
314
|
-
case 2:
|
|
315
|
-
_context6.t0 = _context6.sent;
|
|
316
|
-
if (_context6.t0) {
|
|
317
|
-
_context6.next = 5;
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
_context6.t0 = false;
|
|
321
|
-
case 5:
|
|
322
|
-
return _context6.abrupt("return", _context6.t0);
|
|
323
|
-
case 6:
|
|
324
|
-
case "end":
|
|
325
|
-
return _context6.stop();
|
|
326
|
-
}
|
|
327
|
-
}, _callee6, this);
|
|
328
|
-
}))).apply(this, arguments);
|
|
329
|
-
} /* -------------------------------------------------------------------------- */
|
|
306
|
+
value: function getTemp(key) {
|
|
307
|
+
var _this$obj9;
|
|
308
|
+
return ((_this$obj9 = this.obj) === null || _this$obj9 === void 0 ? void 0 : _this$obj9.getTemp(key)) || false;
|
|
309
|
+
}
|
|
310
|
+
/* -------------------------------------------------------------------------- */
|
|
330
311
|
}, {
|
|
331
312
|
key: "getIndexOrID",
|
|
332
313
|
value: function getIndexOrID() {
|
|
@@ -350,33 +331,33 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
350
331
|
/* -------------------------------------------------------------------------- */
|
|
351
332
|
}, {
|
|
352
333
|
key: "event_run",
|
|
353
|
-
value: function event_run(
|
|
354
|
-
return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
334
|
+
value: function event_run(_x14) {
|
|
335
|
+
return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(eventName) {
|
|
355
336
|
var _len,
|
|
356
337
|
params,
|
|
357
338
|
_key,
|
|
358
|
-
|
|
359
|
-
return _regeneratorRuntime().wrap(function
|
|
360
|
-
while (1) switch (
|
|
339
|
+
_args6 = arguments;
|
|
340
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
341
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
361
342
|
case 0:
|
|
362
343
|
if (!(this.__stopEvents === true)) {
|
|
363
|
-
|
|
344
|
+
_context6.next = 2;
|
|
364
345
|
break;
|
|
365
346
|
}
|
|
366
|
-
return
|
|
347
|
+
return _context6.abrupt("return");
|
|
367
348
|
case 2:
|
|
368
|
-
for (_len =
|
|
369
|
-
params[_key - 1] =
|
|
349
|
+
for (_len = _args6.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
350
|
+
params[_key - 1] = _args6[_key];
|
|
370
351
|
}
|
|
371
|
-
|
|
352
|
+
_context6.next = 5;
|
|
372
353
|
return _event.EventManager.run.apply(_event.EventManager, [this, eventName].concat(params));
|
|
373
354
|
case 5:
|
|
374
|
-
return
|
|
355
|
+
return _context6.abrupt("return", _context6.sent);
|
|
375
356
|
case 6:
|
|
376
357
|
case "end":
|
|
377
|
-
return
|
|
358
|
+
return _context6.stop();
|
|
378
359
|
}
|
|
379
|
-
},
|
|
360
|
+
}, _callee6, this);
|
|
380
361
|
}))).apply(this, arguments);
|
|
381
362
|
}
|
|
382
363
|
}, {
|
|
@@ -406,23 +387,23 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
406
387
|
}
|
|
407
388
|
}, {
|
|
408
389
|
key: "event_add",
|
|
409
|
-
value: function event_add(_x16, _x17
|
|
410
|
-
return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
390
|
+
value: function event_add(_x15, _x16, _x17) {
|
|
391
|
+
return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(name, uname, runEvent) {
|
|
411
392
|
var onlyOn,
|
|
412
393
|
runOnce,
|
|
413
|
-
|
|
414
|
-
return _regeneratorRuntime().wrap(function
|
|
415
|
-
while (1) switch (
|
|
394
|
+
_args7 = arguments;
|
|
395
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
396
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
416
397
|
case 0:
|
|
417
|
-
onlyOn =
|
|
418
|
-
runOnce =
|
|
419
|
-
|
|
398
|
+
onlyOn = _args7.length > 3 && _args7[3] !== undefined ? _args7[3] : null;
|
|
399
|
+
runOnce = _args7.length > 4 && _args7[4] !== undefined ? _args7[4] : false;
|
|
400
|
+
_context7.next = 4;
|
|
420
401
|
return _event.EventManager.add(this, name, uname, runEvent, onlyOn, runOnce);
|
|
421
402
|
case 4:
|
|
422
403
|
case "end":
|
|
423
|
-
return
|
|
404
|
+
return _context7.stop();
|
|
424
405
|
}
|
|
425
|
-
},
|
|
406
|
+
}, _callee7, this);
|
|
426
407
|
}))).apply(this, arguments);
|
|
427
408
|
}
|
|
428
409
|
}, {
|
|
@@ -464,38 +445,38 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
464
445
|
* @param value
|
|
465
446
|
* @returns
|
|
466
447
|
*/
|
|
467
|
-
function toggleOption(
|
|
468
|
-
return (_toggleOption = _toggleOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
448
|
+
function toggleOption(_x18, _x19) {
|
|
449
|
+
return (_toggleOption = _toggleOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(key, value) {
|
|
469
450
|
var oldval;
|
|
470
|
-
return _regeneratorRuntime().wrap(function
|
|
471
|
-
while (1) switch (
|
|
451
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
452
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
472
453
|
case 0:
|
|
473
454
|
oldval = this.getOption(key);
|
|
474
455
|
if (!(0, _object.object_equals_loose)(oldval, value)) {
|
|
475
|
-
|
|
456
|
+
_context8.next = 6;
|
|
476
457
|
break;
|
|
477
458
|
}
|
|
478
|
-
|
|
459
|
+
_context8.next = 4;
|
|
479
460
|
return this.setOption(key, null);
|
|
480
461
|
case 4:
|
|
481
|
-
|
|
462
|
+
_context8.next = 8;
|
|
482
463
|
break;
|
|
483
464
|
case 6:
|
|
484
|
-
|
|
465
|
+
_context8.next = 8;
|
|
485
466
|
return this.setOption(key, value);
|
|
486
467
|
case 8:
|
|
487
468
|
case "end":
|
|
488
|
-
return
|
|
469
|
+
return _context8.stop();
|
|
489
470
|
}
|
|
490
|
-
},
|
|
471
|
+
}, _callee8, this);
|
|
491
472
|
}))).apply(this, arguments);
|
|
492
473
|
}
|
|
493
474
|
}, {
|
|
494
475
|
key: "setOption",
|
|
495
|
-
value: function setOption(
|
|
496
|
-
return (_setOption = _setOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
497
|
-
return _regeneratorRuntime().wrap(function
|
|
498
|
-
while (1) switch (
|
|
476
|
+
value: function setOption(_x20, _x21) {
|
|
477
|
+
return (_setOption = _setOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(key, value) {
|
|
478
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
479
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
499
480
|
case 0:
|
|
500
481
|
if (this.__options == null) this.__options = {};
|
|
501
482
|
if (value == null) {
|
|
@@ -503,15 +484,15 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
503
484
|
} else {
|
|
504
485
|
this.__options[key] = value;
|
|
505
486
|
}
|
|
506
|
-
|
|
487
|
+
_context9.next = 4;
|
|
507
488
|
return this.event_run("on_option_change", key, value);
|
|
508
489
|
case 4:
|
|
509
|
-
return
|
|
490
|
+
return _context9.abrupt("return", _context9.sent);
|
|
510
491
|
case 5:
|
|
511
492
|
case "end":
|
|
512
|
-
return
|
|
493
|
+
return _context9.stop();
|
|
513
494
|
}
|
|
514
|
-
},
|
|
495
|
+
}, _callee9, this);
|
|
515
496
|
}))).apply(this, arguments);
|
|
516
497
|
}
|
|
517
498
|
/**
|
|
@@ -537,28 +518,28 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
537
518
|
*/
|
|
538
519
|
}, {
|
|
539
520
|
key: "holdOption",
|
|
540
|
-
value: function holdOption(_x23, _x24, _x25
|
|
541
|
-
return (_holdOption = _holdOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
542
|
-
return _regeneratorRuntime().wrap(function
|
|
543
|
-
while (1) switch (
|
|
521
|
+
value: function holdOption(_x22, _x23, _x24, _x25) {
|
|
522
|
+
return (_holdOption = _holdOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(key, value, nextvalue, action) {
|
|
523
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
524
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
544
525
|
case 0:
|
|
545
|
-
|
|
526
|
+
_context10.prev = 0;
|
|
546
527
|
this.setOption(key, value);
|
|
547
528
|
if (!(typeof action === "function")) {
|
|
548
|
-
|
|
529
|
+
_context10.next = 5;
|
|
549
530
|
break;
|
|
550
531
|
}
|
|
551
|
-
|
|
532
|
+
_context10.next = 5;
|
|
552
533
|
return action();
|
|
553
534
|
case 5:
|
|
554
|
-
|
|
535
|
+
_context10.prev = 5;
|
|
555
536
|
this.setOption(key, nextvalue);
|
|
556
|
-
return
|
|
537
|
+
return _context10.finish(5);
|
|
557
538
|
case 8:
|
|
558
539
|
case "end":
|
|
559
|
-
return
|
|
540
|
+
return _context10.stop();
|
|
560
541
|
}
|
|
561
|
-
},
|
|
542
|
+
}, _callee10, this, [[0,, 5, 8]]);
|
|
562
543
|
}))).apply(this, arguments);
|
|
563
544
|
}
|
|
564
545
|
}, {
|
|
@@ -1148,7 +1148,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
1148
1148
|
case 7:
|
|
1149
1149
|
//
|
|
1150
1150
|
if (obj.__temp == null) obj.__temp = {};
|
|
1151
|
-
|
|
1151
|
+
(0, _object.object_set)(obj.__temp, key, value);
|
|
1152
1152
|
case 9:
|
|
1153
1153
|
case "end":
|
|
1154
1154
|
return _context11.stop();
|
|
@@ -1238,12 +1238,11 @@ function _getProperty2(key) {
|
|
|
1238
1238
|
}
|
|
1239
1239
|
function _getTempProperty2(key) {
|
|
1240
1240
|
if (this.__temp == null) return undefined;
|
|
1241
|
-
return this.__temp
|
|
1241
|
+
return (0, _object.object_get)(this.__temp, key);
|
|
1242
1242
|
}
|
|
1243
1243
|
function _setTempProperty2(key, value) {
|
|
1244
1244
|
if (this.__temp == null) this.__temp = {};
|
|
1245
|
-
|
|
1246
|
-
return true;
|
|
1245
|
+
return (0, _object.object_set)(this.__temp, key, value);
|
|
1247
1246
|
}
|
|
1248
1247
|
function _setSaveResultObject2(toObj) {
|
|
1249
1248
|
if (toObj == null) toObj = null; //null or undefined
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azrico/webobject",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.75",
|
|
4
4
|
"description": "Stateful object",
|
|
5
5
|
"author": "Azrideus",
|
|
6
6
|
"license": "MIT",
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@azrico/convert": "^1.0.3",
|
|
75
75
|
"@azrico/event": "^1.2.17",
|
|
76
|
-
"@azrico/global": "^1.3.
|
|
76
|
+
"@azrico/global": "^1.3.50",
|
|
77
77
|
"@azrico/math": "^1.0.3",
|
|
78
|
-
"@azrico/object": "^1.4.
|
|
79
|
-
"@azrico/string": "^1.2.
|
|
80
|
-
"@azrico/types": "^1.0.
|
|
78
|
+
"@azrico/object": "^1.4.86",
|
|
79
|
+
"@azrico/string": "^1.2.84",
|
|
80
|
+
"@azrico/types": "^1.0.4",
|
|
81
81
|
"@azrico/uid": "^1.0.5"
|
|
82
82
|
},
|
|
83
83
|
"packageManager": "yarn@3.5.0"
|