@azrico/webobject 1.4.128 → 1.4.130
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.
- package/README.md +9 -9
- package/dist/src/WebObjects/ParentWebObject.js +10 -13
- package/dist/src/WebObjects/WebObject.js +177 -109
- package/dist/src/WebObjects/WebObjectManager.js +128 -74
- package/dist/src/structs/DummyObject.js +9 -12
- package/dist/src/structs/MapableObject.js +10 -13
- package/dist/src/structs/MetaObject.js +34 -25
- package/dist/src/structs/ObjectArray.js +4 -6
- package/dist/src/structs/ObjectManager.d.ts +3 -3
- package/dist/src/structs/ObjectManager.js +102 -59
- package/dist/src/structs/ObjectWithTemp.js +12 -10
- package/dist/src/structs/SimpleObject.d.ts +3 -4
- package/dist/src/structs/SimpleObject.js +155 -86
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropOf, WriteablePropOf } from "
|
|
1
|
+
import { PropOf, WriteablePropOf } from "@azrico/types";
|
|
2
2
|
import SimpleObject from "./SimpleObject";
|
|
3
3
|
import { saveResultType, sendChangesType } from "./SimpleObject";
|
|
4
4
|
import { ClassType } from "@azrico/types";
|
|
@@ -43,8 +43,8 @@ export declare class ObjectManager<ObjType extends SimpleObject> extends RawObje
|
|
|
43
43
|
getSaveResultType(): saveResultType | null;
|
|
44
44
|
setSaveResult(toObj: any, type: saveResultType): saveResultType | undefined;
|
|
45
45
|
apply_changes(): boolean;
|
|
46
|
-
getValue(key: PropOf<ObjType>, original?: boolean): import("
|
|
47
|
-
get: (key: PropOf<ObjType>, original?: boolean) => import("
|
|
46
|
+
getValue(key: PropOf<ObjType>, original?: boolean): import("@azrico/types").PropType<ObjType, any> | null;
|
|
47
|
+
get: (key: PropOf<ObjType>, original?: boolean) => import("@azrico/types").PropType<ObjType, any> | null;
|
|
48
48
|
/**
|
|
49
49
|
* set value
|
|
50
50
|
* @param key
|
|
@@ -18,31 +18,30 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
18
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
19
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
20
20
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
22
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
23
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
25
|
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
22
26
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
27
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
28
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
24
29
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
25
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
26
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
27
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
28
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
29
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
30
30
|
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; }
|
|
31
|
-
function _toPropertyKey(
|
|
32
|
-
function _toPrimitive(
|
|
31
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
32
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
33
33
|
/**
|
|
34
34
|
* This class manages the events of an Simple Object
|
|
35
35
|
*/
|
|
36
|
-
var ObjectManager = /*#__PURE__*/function (_RawObject
|
|
36
|
+
var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
37
37
|
_inherits(ObjectManager, _RawObject);
|
|
38
|
-
var _super = _createSuper(ObjectManager);
|
|
39
38
|
function ObjectManager() {
|
|
40
39
|
var _this;
|
|
41
40
|
_classCallCheck(this, ObjectManager);
|
|
42
41
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
42
|
args[_key] = arguments[_key];
|
|
44
43
|
}
|
|
45
|
-
_this =
|
|
44
|
+
_this = _callSuper(this, ObjectManager, [].concat(args));
|
|
46
45
|
_defineProperty(_assertThisInitialized(_this), "__eventList", void 0);
|
|
47
46
|
_defineProperty(_assertThisInitialized(_this), "__eventPrefix", void 0);
|
|
48
47
|
_defineProperty(_assertThisInitialized(_this), "__stopEvents", void 0);
|
|
@@ -55,8 +54,8 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
55
54
|
}
|
|
56
55
|
_createClass(ObjectManager, [{
|
|
57
56
|
key: "notifyChanged",
|
|
58
|
-
value: function
|
|
59
|
-
|
|
57
|
+
value: function () {
|
|
58
|
+
var _notifyChanged = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(type, key, value, subvalue) {
|
|
60
59
|
var obj, typestr;
|
|
61
60
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
62
61
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -79,8 +78,12 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
79
78
|
return _context.stop();
|
|
80
79
|
}
|
|
81
80
|
}, _callee, this);
|
|
82
|
-
}))
|
|
83
|
-
|
|
81
|
+
}));
|
|
82
|
+
function notifyChanged(_x, _x2, _x3, _x4) {
|
|
83
|
+
return _notifyChanged.apply(this, arguments);
|
|
84
|
+
}
|
|
85
|
+
return notifyChanged;
|
|
86
|
+
}()
|
|
84
87
|
/* -------------------------------------------------------------------------- */
|
|
85
88
|
/**
|
|
86
89
|
* Get the object this manager is managing
|
|
@@ -203,15 +206,15 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
203
206
|
}
|
|
204
207
|
}, {
|
|
205
208
|
key: "setValue",
|
|
206
|
-
value:
|
|
209
|
+
value: (
|
|
207
210
|
/**
|
|
208
211
|
* set value
|
|
209
212
|
* @param key
|
|
210
213
|
* @param value
|
|
211
214
|
* @return true if changed , false otherwise
|
|
212
215
|
*/
|
|
213
|
-
function
|
|
214
|
-
|
|
216
|
+
function () {
|
|
217
|
+
var _setValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(key, value) {
|
|
215
218
|
var thisobj;
|
|
216
219
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
217
220
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -240,8 +243,12 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
240
243
|
return _context2.stop();
|
|
241
244
|
}
|
|
242
245
|
}, _callee2, this);
|
|
243
|
-
}))
|
|
244
|
-
|
|
246
|
+
}));
|
|
247
|
+
function setValue(_x5, _x6) {
|
|
248
|
+
return _setValue.apply(this, arguments);
|
|
249
|
+
}
|
|
250
|
+
return setValue;
|
|
251
|
+
}()
|
|
245
252
|
/**
|
|
246
253
|
* set key of subObject
|
|
247
254
|
* @param key
|
|
@@ -249,10 +256,11 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
249
256
|
* @param subvalue
|
|
250
257
|
* @return true if changed , false otherwise
|
|
251
258
|
*/
|
|
259
|
+
)
|
|
252
260
|
}, {
|
|
253
261
|
key: "setSubValue",
|
|
254
|
-
value: function
|
|
255
|
-
|
|
262
|
+
value: (function () {
|
|
263
|
+
var _setSubValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(key, objKey, subvalue) {
|
|
256
264
|
var _yield$this$obj$setSu, _this$obj9;
|
|
257
265
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
258
266
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -284,12 +292,17 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
284
292
|
return _context3.stop();
|
|
285
293
|
}
|
|
286
294
|
}, _callee3, this);
|
|
287
|
-
}))
|
|
288
|
-
|
|
295
|
+
}));
|
|
296
|
+
function setSubValue(_x7, _x8, _x9) {
|
|
297
|
+
return _setSubValue.apply(this, arguments);
|
|
298
|
+
}
|
|
299
|
+
return setSubValue;
|
|
300
|
+
}() //Push value on array
|
|
301
|
+
)
|
|
289
302
|
}, {
|
|
290
303
|
key: "pushValue",
|
|
291
|
-
value: function
|
|
292
|
-
|
|
304
|
+
value: function () {
|
|
305
|
+
var _pushValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(key, value) {
|
|
293
306
|
var _yield$this$obj$pushV, _this$obj10;
|
|
294
307
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
295
308
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -321,12 +334,16 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
321
334
|
return _context4.stop();
|
|
322
335
|
}
|
|
323
336
|
}, _callee4, this);
|
|
324
|
-
}))
|
|
325
|
-
|
|
337
|
+
}));
|
|
338
|
+
function pushValue(_x10, _x11) {
|
|
339
|
+
return _pushValue.apply(this, arguments);
|
|
340
|
+
}
|
|
341
|
+
return pushValue;
|
|
342
|
+
}() //set temp value of object
|
|
326
343
|
}, {
|
|
327
344
|
key: "setTemp",
|
|
328
|
-
value: function
|
|
329
|
-
|
|
345
|
+
value: function () {
|
|
346
|
+
var _setTemp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, value) {
|
|
330
347
|
var sendChanges,
|
|
331
348
|
_args5 = arguments;
|
|
332
349
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
@@ -345,12 +362,16 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
345
362
|
return _context5.stop();
|
|
346
363
|
}
|
|
347
364
|
}, _callee5, this);
|
|
348
|
-
}))
|
|
349
|
-
|
|
365
|
+
}));
|
|
366
|
+
function setTemp(_x12, _x13) {
|
|
367
|
+
return _setTemp.apply(this, arguments);
|
|
368
|
+
}
|
|
369
|
+
return setTemp;
|
|
370
|
+
}() //set temp value of object
|
|
350
371
|
}, {
|
|
351
372
|
key: "setObjectTemp",
|
|
352
|
-
value: function
|
|
353
|
-
|
|
373
|
+
value: function () {
|
|
374
|
+
var _setObjectTemp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(key, value) {
|
|
354
375
|
var _yield$this$obj$setTe, _this$obj11;
|
|
355
376
|
var sendChanges,
|
|
356
377
|
_args6 = arguments;
|
|
@@ -385,8 +406,12 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
385
406
|
return _context6.stop();
|
|
386
407
|
}
|
|
387
408
|
}, _callee6, this);
|
|
388
|
-
}))
|
|
389
|
-
|
|
409
|
+
}));
|
|
410
|
+
function setObjectTemp(_x14, _x15) {
|
|
411
|
+
return _setObjectTemp.apply(this, arguments);
|
|
412
|
+
}
|
|
413
|
+
return setObjectTemp;
|
|
414
|
+
}() //get temp value of object
|
|
390
415
|
}, {
|
|
391
416
|
key: "getObjectTemp",
|
|
392
417
|
value: function getObjectTemp(key) {
|
|
@@ -417,8 +442,8 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
417
442
|
/* -------------------------------------------------------------------------- */
|
|
418
443
|
}, {
|
|
419
444
|
key: "event_run",
|
|
420
|
-
value: function
|
|
421
|
-
|
|
445
|
+
value: (function () {
|
|
446
|
+
var _event_run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(eventName) {
|
|
422
447
|
var _len2,
|
|
423
448
|
params,
|
|
424
449
|
_key2,
|
|
@@ -444,8 +469,12 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
444
469
|
return _context7.stop();
|
|
445
470
|
}
|
|
446
471
|
}, _callee7, this);
|
|
447
|
-
}))
|
|
448
|
-
|
|
472
|
+
}));
|
|
473
|
+
function event_run(_x16) {
|
|
474
|
+
return _event_run.apply(this, arguments);
|
|
475
|
+
}
|
|
476
|
+
return event_run;
|
|
477
|
+
}())
|
|
449
478
|
}, {
|
|
450
479
|
key: "event_use",
|
|
451
480
|
value: function event_use(name, runEvent) {
|
|
@@ -473,8 +502,8 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
473
502
|
}
|
|
474
503
|
}, {
|
|
475
504
|
key: "event_add",
|
|
476
|
-
value: function
|
|
477
|
-
|
|
505
|
+
value: function () {
|
|
506
|
+
var _event_add = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(name, uname, runEvent) {
|
|
478
507
|
var onlyOn,
|
|
479
508
|
runOnce,
|
|
480
509
|
_args8 = arguments;
|
|
@@ -490,8 +519,12 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
490
519
|
return _context8.stop();
|
|
491
520
|
}
|
|
492
521
|
}, _callee8, this);
|
|
493
|
-
}))
|
|
494
|
-
|
|
522
|
+
}));
|
|
523
|
+
function event_add(_x17, _x18, _x19) {
|
|
524
|
+
return _event_add.apply(this, arguments);
|
|
525
|
+
}
|
|
526
|
+
return event_add;
|
|
527
|
+
}()
|
|
495
528
|
}, {
|
|
496
529
|
key: "events_start",
|
|
497
530
|
value: function events_start() {
|
|
@@ -521,7 +554,7 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
521
554
|
}
|
|
522
555
|
}, {
|
|
523
556
|
key: "toggleOption",
|
|
524
|
-
value:
|
|
557
|
+
value: (
|
|
525
558
|
/* -------------------------------------------------------------------------- */
|
|
526
559
|
/* Options */
|
|
527
560
|
/* -------------------------------------------------------------------------- */
|
|
@@ -531,8 +564,8 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
531
564
|
* @param value
|
|
532
565
|
* @returns
|
|
533
566
|
*/
|
|
534
|
-
function
|
|
535
|
-
|
|
567
|
+
function () {
|
|
568
|
+
var _toggleOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(key, value) {
|
|
536
569
|
var oldval;
|
|
537
570
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
538
571
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -555,12 +588,16 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
555
588
|
return _context9.stop();
|
|
556
589
|
}
|
|
557
590
|
}, _callee9, this);
|
|
558
|
-
}))
|
|
559
|
-
|
|
591
|
+
}));
|
|
592
|
+
function toggleOption(_x20, _x21) {
|
|
593
|
+
return _toggleOption.apply(this, arguments);
|
|
594
|
+
}
|
|
595
|
+
return toggleOption;
|
|
596
|
+
}())
|
|
560
597
|
}, {
|
|
561
598
|
key: "setOption",
|
|
562
|
-
value: function
|
|
563
|
-
|
|
599
|
+
value: function () {
|
|
600
|
+
var _setOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(key, value) {
|
|
564
601
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
565
602
|
while (1) switch (_context10.prev = _context10.next) {
|
|
566
603
|
case 0:
|
|
@@ -579,8 +616,12 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
579
616
|
return _context10.stop();
|
|
580
617
|
}
|
|
581
618
|
}, _callee10, this);
|
|
582
|
-
}))
|
|
583
|
-
|
|
619
|
+
}));
|
|
620
|
+
function setOption(_x22, _x23) {
|
|
621
|
+
return _setOption.apply(this, arguments);
|
|
622
|
+
}
|
|
623
|
+
return setOption;
|
|
624
|
+
}()
|
|
584
625
|
/**
|
|
585
626
|
* use an option and detect its changes in real time. similar to recat state
|
|
586
627
|
* @param key name of the option
|
|
@@ -604,8 +645,8 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
604
645
|
*/
|
|
605
646
|
}, {
|
|
606
647
|
key: "holdOption",
|
|
607
|
-
value: function
|
|
608
|
-
|
|
648
|
+
value: (function () {
|
|
649
|
+
var _holdOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(key, value, nextvalue, action) {
|
|
609
650
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
610
651
|
while (1) switch (_context11.prev = _context11.next) {
|
|
611
652
|
case 0:
|
|
@@ -626,8 +667,12 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
626
667
|
return _context11.stop();
|
|
627
668
|
}
|
|
628
669
|
}, _callee11, this, [[0,, 5, 8]]);
|
|
629
|
-
}))
|
|
630
|
-
|
|
670
|
+
}));
|
|
671
|
+
function holdOption(_x24, _x25, _x26, _x27) {
|
|
672
|
+
return _holdOption.apply(this, arguments);
|
|
673
|
+
}
|
|
674
|
+
return holdOption;
|
|
675
|
+
}())
|
|
631
676
|
}, {
|
|
632
677
|
key: "getOption",
|
|
633
678
|
value: function getOption(key) {
|
|
@@ -687,7 +732,5 @@ var ObjectManager = /*#__PURE__*/function (_RawObject, _notifyChanged, _setValue
|
|
|
687
732
|
}]);
|
|
688
733
|
return ObjectManager;
|
|
689
734
|
}(_MapableObject["default"]);
|
|
690
|
-
exports.ObjectManager = ObjectManager;
|
|
691
735
|
_defineProperty(ObjectManager, "__object_type", void 0);
|
|
692
|
-
var _default = ObjectManager;
|
|
693
|
-
exports["default"] = _default;
|
|
736
|
+
var _default = exports["default"] = ObjectManager;
|
|
@@ -15,15 +15,15 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
15
15
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
|
16
16
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
17
17
|
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; }
|
|
18
|
-
function _toPropertyKey(
|
|
19
|
-
function _toPrimitive(
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
20
|
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
|
21
21
|
/**
|
|
22
22
|
* This object can be mapped and converted
|
|
23
23
|
*/
|
|
24
24
|
var _getTempProperty = /*#__PURE__*/new WeakSet();
|
|
25
25
|
var _setTempProperty = /*#__PURE__*/new WeakSet();
|
|
26
|
-
var ObjectWithTemp = /*#__PURE__*/function (
|
|
26
|
+
var ObjectWithTemp = exports.ObjectWithTemp = /*#__PURE__*/function () {
|
|
27
27
|
function ObjectWithTemp() {
|
|
28
28
|
_classCallCheck(this, ObjectWithTemp);
|
|
29
29
|
_classPrivateMethodInitSpec(this, _setTempProperty);
|
|
@@ -34,8 +34,8 @@ var ObjectWithTemp = /*#__PURE__*/function (_setTemp) {
|
|
|
34
34
|
}
|
|
35
35
|
_createClass(ObjectWithTemp, [{
|
|
36
36
|
key: "setTemp",
|
|
37
|
-
value: function
|
|
38
|
-
|
|
37
|
+
value: function () {
|
|
38
|
+
var _setTemp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(key, value) {
|
|
39
39
|
var isValueChanged;
|
|
40
40
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41
41
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -49,12 +49,15 @@ var ObjectWithTemp = /*#__PURE__*/function (_setTemp) {
|
|
|
49
49
|
return _context.stop();
|
|
50
50
|
}
|
|
51
51
|
}, _callee, this);
|
|
52
|
-
}))
|
|
53
|
-
|
|
52
|
+
}));
|
|
53
|
+
function setTemp(_x, _x2) {
|
|
54
|
+
return _setTemp.apply(this, arguments);
|
|
55
|
+
}
|
|
56
|
+
return setTemp;
|
|
57
|
+
}()
|
|
54
58
|
}]);
|
|
55
59
|
return ObjectWithTemp;
|
|
56
60
|
}();
|
|
57
|
-
exports.ObjectWithTemp = ObjectWithTemp;
|
|
58
61
|
function _getTempProperty2(key) {
|
|
59
62
|
if (this.__temp == null) return undefined;
|
|
60
63
|
return (0, _object.object_get)(this.__temp, key);
|
|
@@ -63,5 +66,4 @@ function _setTempProperty2(key, value) {
|
|
|
63
66
|
if (this.__temp == null) this.__temp = {};
|
|
64
67
|
return (0, _object.object_set)(this.__temp, key, value);
|
|
65
68
|
}
|
|
66
|
-
var _default = ObjectWithTemp;
|
|
67
|
-
exports["default"] = _default;
|
|
69
|
+
var _default = exports["default"] = ObjectWithTemp;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import { PropType, WriteablePropOf, PropOf, Ensure } from "@azrico/types";
|
|
1
2
|
import { formatObject } from "@azrico/convert";
|
|
2
3
|
import { MapableObject } from "./MapableObject";
|
|
3
4
|
import ObjectManager from "./ObjectManager";
|
|
4
5
|
export type saveResultType = "normal" | "nothing" | "error" | "canceled";
|
|
5
6
|
export type saveType = "normal" | "quick";
|
|
6
7
|
export type sendChangesType = boolean | "auto";
|
|
7
|
-
export type
|
|
8
|
-
export type WriteablePropOf<obj> = keyof obj;
|
|
9
|
-
export type PropType<obj, prop extends keyof obj> = obj[prop];
|
|
8
|
+
export type WithManager<T extends SimpleObject> = Ensure<T, "manager">;
|
|
10
9
|
export declare class SimpleObject extends MapableObject {
|
|
11
10
|
#private;
|
|
12
11
|
static readonly __cache_name?: string;
|
|
@@ -132,7 +131,7 @@ export declare class SimpleObject extends MapableObject {
|
|
|
132
131
|
*/
|
|
133
132
|
apply_changes(): boolean;
|
|
134
133
|
/**
|
|
135
|
-
* apply changes for the given
|
|
134
|
+
* apply changes for the given fields
|
|
136
135
|
* @param key
|
|
137
136
|
* @returns
|
|
138
137
|
*/
|