@azrico/webobject 1.4.70 → 1.4.72
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.
|
@@ -53,7 +53,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> {
|
|
|
53
53
|
*/
|
|
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
|
-
setTemp(key: string, value: any): Promise<
|
|
56
|
+
setTemp(key: string, value: any): Promise<boolean>;
|
|
57
57
|
getTemp(key: string): Promise<any>;
|
|
58
58
|
getIndexOrID(): number | string;
|
|
59
59
|
getIndex(): number;
|
|
@@ -52,7 +52,7 @@ export declare class SimpleObject extends MapableObject {
|
|
|
52
52
|
*/
|
|
53
53
|
setValue(key: WriteablePropOf<this>, value: any, sendChanges?: sendChangesType): Promise<boolean>;
|
|
54
54
|
set: (key: WriteablePropOf<this>, value: any, sendChanges?: sendChangesType) => Promise<boolean>;
|
|
55
|
-
setTemp
|
|
55
|
+
setTemp(key: string, value: any, sendChanges?: sendChangesType): Promise<void>;
|
|
56
56
|
setAll<K extends WriteablePropOf<this>>(setObj: {
|
|
57
57
|
[key in K]: any;
|
|
58
58
|
}): Promise<boolean>;
|
|
@@ -104,6 +104,12 @@ export declare class SimpleObject extends MapableObject {
|
|
|
104
104
|
* Apply the changes and empty the delta object
|
|
105
105
|
*/
|
|
106
106
|
apply_changes(): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* apply changes for the given field
|
|
109
|
+
* @param key
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
112
|
+
apply(key: string): boolean;
|
|
107
113
|
/**
|
|
108
114
|
* set the value to its original
|
|
109
115
|
* @param key
|
|
@@ -185,7 +191,7 @@ export declare class SimpleObject extends MapableObject {
|
|
|
185
191
|
setSaveResult(toObj: any, type?: saveResultType | "auto"): void;
|
|
186
192
|
getSaveResult(original?: boolean): any;
|
|
187
193
|
getSaveResultType(): saveResultType;
|
|
188
|
-
static setTemp(obj: any, key: string, value: any):
|
|
194
|
+
static setTemp(obj: any, key: string, value: any): Promise<void> | undefined;
|
|
189
195
|
static factoryClear(obj: SimpleObject): void;
|
|
190
196
|
static delete_cache(): void;
|
|
191
197
|
static get_canModify(o: SimpleObject): boolean;
|
|
@@ -46,7 +46,7 @@ var _getProperty = /*#__PURE__*/new WeakSet();
|
|
|
46
46
|
var _getTempProperty = /*#__PURE__*/new WeakSet();
|
|
47
47
|
var _setTempProperty = /*#__PURE__*/new WeakSet();
|
|
48
48
|
var _setSaveResultObject = /*#__PURE__*/new WeakSet();
|
|
49
|
-
var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _setSubValue, _pushValue, _notifyChanged, _reset, _resetAll, _event_run, _event_add) {
|
|
49
|
+
var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _setAll, _setSubValue, _pushValue, _notifyChanged, _reset, _resetAll, _event_run, _event_add) {
|
|
50
50
|
_inherits(SimpleObject, _MapableObject);
|
|
51
51
|
var _super = _createSuper(SimpleObject);
|
|
52
52
|
function SimpleObject() {
|
|
@@ -97,7 +97,6 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
|
|
|
97
97
|
_defineProperty(_assertThisInitialized(_this), "get", _classPrivateMethodGet(_assertThisInitialized(_this), _getProperty, _getProperty2));
|
|
98
98
|
_defineProperty(_assertThisInitialized(_this), "getTemp", _classPrivateMethodGet(_assertThisInitialized(_this), _getTempProperty, _getTempProperty2));
|
|
99
99
|
_defineProperty(_assertThisInitialized(_this), "set", _this.setValue);
|
|
100
|
-
_defineProperty(_assertThisInitialized(_this), "setTemp", _classPrivateMethodGet(_assertThisInitialized(_this), _setTempProperty, _setTempProperty2));
|
|
101
100
|
/**
|
|
102
101
|
* set value of a key only if the value is empty
|
|
103
102
|
* @param key
|
|
@@ -189,39 +188,72 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
|
|
|
189
188
|
}))).apply(this, arguments);
|
|
190
189
|
}
|
|
191
190
|
}, {
|
|
192
|
-
key: "
|
|
193
|
-
value: function
|
|
194
|
-
return (
|
|
195
|
-
var
|
|
191
|
+
key: "setTemp",
|
|
192
|
+
value: function setTemp(_x3, _x4) {
|
|
193
|
+
return (_setTemp = _setTemp || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(key, value) {
|
|
194
|
+
var sendChanges,
|
|
195
|
+
isValueChanged,
|
|
196
|
+
_args2 = arguments;
|
|
196
197
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
197
198
|
while (1) switch (_context2.prev = _context2.next) {
|
|
199
|
+
case 0:
|
|
200
|
+
sendChanges = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : "auto";
|
|
201
|
+
isValueChanged = false;
|
|
202
|
+
_context2.prev = 2;
|
|
203
|
+
isValueChanged = _classPrivateMethodGet(this, _getTempProperty, _getTempProperty2).call(this, key) != value;
|
|
204
|
+
_classPrivateMethodGet(this, _setTempProperty, _setTempProperty2).call(this, key, value);
|
|
205
|
+
//console.log("SV:", isValueChanged, oldval, key, value);
|
|
206
|
+
case 5:
|
|
207
|
+
_context2.prev = 5;
|
|
208
|
+
if (!(sendChanges === true || sendChanges === "auto" && isValueChanged)) {
|
|
209
|
+
_context2.next = 9;
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
_context2.next = 9;
|
|
213
|
+
return this.notifyChanged("temp", key, value);
|
|
214
|
+
case 9:
|
|
215
|
+
return _context2.finish(5);
|
|
216
|
+
case 10:
|
|
217
|
+
case "end":
|
|
218
|
+
return _context2.stop();
|
|
219
|
+
}
|
|
220
|
+
}, _callee2, this, [[2,, 5, 10]]);
|
|
221
|
+
}))).apply(this, arguments);
|
|
222
|
+
}
|
|
223
|
+
}, {
|
|
224
|
+
key: "setAll",
|
|
225
|
+
value: function setAll(_x5) {
|
|
226
|
+
return (_setAll = _setAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(setObj) {
|
|
227
|
+
var finalRes, key;
|
|
228
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
229
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
198
230
|
case 0:
|
|
199
231
|
finalRes = true;
|
|
200
|
-
|
|
232
|
+
_context3.t0 = _regeneratorRuntime().keys(setObj);
|
|
201
233
|
case 2:
|
|
202
|
-
if ((
|
|
203
|
-
|
|
234
|
+
if ((_context3.t1 = _context3.t0()).done) {
|
|
235
|
+
_context3.next = 10;
|
|
204
236
|
break;
|
|
205
237
|
}
|
|
206
|
-
key =
|
|
207
|
-
|
|
238
|
+
key = _context3.t1.value;
|
|
239
|
+
_context3.next = 6;
|
|
208
240
|
return this.setValue(key, setObj[key]);
|
|
209
241
|
case 6:
|
|
210
|
-
if (
|
|
211
|
-
|
|
242
|
+
if (_context3.sent) {
|
|
243
|
+
_context3.next = 8;
|
|
212
244
|
break;
|
|
213
245
|
}
|
|
214
246
|
finalRes = false;
|
|
215
247
|
case 8:
|
|
216
|
-
|
|
248
|
+
_context3.next = 2;
|
|
217
249
|
break;
|
|
218
250
|
case 10:
|
|
219
|
-
return
|
|
251
|
+
return _context3.abrupt("return", finalRes);
|
|
220
252
|
case 11:
|
|
221
253
|
case "end":
|
|
222
|
-
return
|
|
254
|
+
return _context3.stop();
|
|
223
255
|
}
|
|
224
|
-
},
|
|
256
|
+
}, _callee3, this);
|
|
225
257
|
}))).apply(this, arguments);
|
|
226
258
|
}
|
|
227
259
|
/**
|
|
@@ -245,30 +277,30 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
|
|
|
245
277
|
* @param subvalue
|
|
246
278
|
* @return true if changed , false otherwise
|
|
247
279
|
*/
|
|
248
|
-
function setSubValue(
|
|
249
|
-
return (_setSubValue = _setSubValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
280
|
+
function setSubValue(_x6, _x7, _x8) {
|
|
281
|
+
return (_setSubValue = _setSubValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(key, objKey, subvalue) {
|
|
250
282
|
var sendChanges,
|
|
251
283
|
isValueChanged,
|
|
252
284
|
subval,
|
|
253
|
-
|
|
254
|
-
return _regeneratorRuntime().wrap(function
|
|
255
|
-
while (1) switch (
|
|
285
|
+
_args4 = arguments;
|
|
286
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
287
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
256
288
|
case 0:
|
|
257
|
-
sendChanges =
|
|
289
|
+
sendChanges = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : "auto";
|
|
258
290
|
if (this.canModify) {
|
|
259
|
-
|
|
291
|
+
_context4.next = 7;
|
|
260
292
|
break;
|
|
261
293
|
}
|
|
262
294
|
if (!(this.__throw_errors !== false)) {
|
|
263
|
-
|
|
295
|
+
_context4.next = 6;
|
|
264
296
|
break;
|
|
265
297
|
}
|
|
266
298
|
throw Error("Cant use setValue when on readonly mode");
|
|
267
299
|
case 6:
|
|
268
|
-
return
|
|
300
|
+
return _context4.abrupt("return", false);
|
|
269
301
|
case 7:
|
|
270
302
|
isValueChanged = false;
|
|
271
|
-
|
|
303
|
+
_context4.prev = 8;
|
|
272
304
|
//if accessing subval of an object, make sure the object is not null
|
|
273
305
|
subval = _classPrivateMethodGet(this, _getSubProperty, _getSubProperty2).call(this, key, objKey);
|
|
274
306
|
if (!(0, _object.object_equals)(subval, subvalue, {
|
|
@@ -279,22 +311,22 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
|
|
|
279
311
|
isValueChanged = true;
|
|
280
312
|
} else isValueChanged = false;
|
|
281
313
|
case 11:
|
|
282
|
-
|
|
314
|
+
_context4.prev = 11;
|
|
283
315
|
if (!(sendChanges === true || sendChanges === "auto" && isValueChanged)) {
|
|
284
|
-
|
|
316
|
+
_context4.next = 15;
|
|
285
317
|
break;
|
|
286
318
|
}
|
|
287
|
-
|
|
319
|
+
_context4.next = 15;
|
|
288
320
|
return this.notifyChanged("", key, objKey, subvalue);
|
|
289
321
|
case 15:
|
|
290
|
-
return
|
|
322
|
+
return _context4.finish(11);
|
|
291
323
|
case 16:
|
|
292
|
-
return
|
|
324
|
+
return _context4.abrupt("return", isValueChanged);
|
|
293
325
|
case 17:
|
|
294
326
|
case "end":
|
|
295
|
-
return
|
|
327
|
+
return _context4.stop();
|
|
296
328
|
}
|
|
297
|
-
},
|
|
329
|
+
}, _callee4, this, [[8,, 11, 16]]);
|
|
298
330
|
}))).apply(this, arguments);
|
|
299
331
|
}
|
|
300
332
|
}, {
|
|
@@ -307,74 +339,74 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
|
|
|
307
339
|
* @param sendChanges
|
|
308
340
|
* @returns
|
|
309
341
|
*/
|
|
310
|
-
function pushValue(
|
|
311
|
-
return (_pushValue = _pushValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
342
|
+
function pushValue(_x9, _x10) {
|
|
343
|
+
return (_pushValue = _pushValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, value) {
|
|
312
344
|
var sendChanges,
|
|
313
345
|
tempArray,
|
|
314
|
-
|
|
315
|
-
return _regeneratorRuntime().wrap(function
|
|
316
|
-
while (1) switch (
|
|
346
|
+
_args5 = arguments;
|
|
347
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
348
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
317
349
|
case 0:
|
|
318
|
-
sendChanges =
|
|
350
|
+
sendChanges = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : "auto";
|
|
319
351
|
if (!(value == null)) {
|
|
320
|
-
|
|
352
|
+
_context5.next = 3;
|
|
321
353
|
break;
|
|
322
354
|
}
|
|
323
|
-
return
|
|
355
|
+
return _context5.abrupt("return", false);
|
|
324
356
|
case 3:
|
|
325
357
|
if (this.canModify) {
|
|
326
|
-
|
|
358
|
+
_context5.next = 9;
|
|
327
359
|
break;
|
|
328
360
|
}
|
|
329
361
|
if (!(this.__throw_errors !== false)) {
|
|
330
|
-
|
|
362
|
+
_context5.next = 8;
|
|
331
363
|
break;
|
|
332
364
|
}
|
|
333
365
|
throw Error("Cant use pushValue when on readonly mode");
|
|
334
366
|
case 8:
|
|
335
|
-
return
|
|
367
|
+
return _context5.abrupt("return", false);
|
|
336
368
|
case 9:
|
|
337
369
|
if (_classPrivateMethodGet(this, _getProperty, _getProperty2).call(this, key) == null) {
|
|
338
370
|
_classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key, []);
|
|
339
371
|
}
|
|
340
372
|
tempArray = _classPrivateMethodGet(this, _getProperty, _getProperty2).call(this, key);
|
|
341
373
|
if (Array.isArray(tempArray)) {
|
|
342
|
-
|
|
374
|
+
_context5.next = 17;
|
|
343
375
|
break;
|
|
344
376
|
}
|
|
345
377
|
if (!(this.__throw_errors !== false)) {
|
|
346
|
-
|
|
378
|
+
_context5.next = 16;
|
|
347
379
|
break;
|
|
348
380
|
}
|
|
349
381
|
throw Error("Cant use pushValue on non Array keys");
|
|
350
382
|
case 16:
|
|
351
|
-
return
|
|
383
|
+
return _context5.abrupt("return", false);
|
|
352
384
|
case 17:
|
|
353
385
|
_classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key, [].concat(_toConsumableArray(tempArray), [value]));
|
|
354
386
|
if (!(sendChanges === true || sendChanges === "auto")) {
|
|
355
|
-
|
|
387
|
+
_context5.next = 21;
|
|
356
388
|
break;
|
|
357
389
|
}
|
|
358
|
-
|
|
390
|
+
_context5.next = 21;
|
|
359
391
|
return this.notifyChanged("", key, value);
|
|
360
392
|
case 21:
|
|
361
|
-
return
|
|
393
|
+
return _context5.abrupt("return", tempArray);
|
|
362
394
|
case 22:
|
|
363
395
|
case "end":
|
|
364
|
-
return
|
|
396
|
+
return _context5.stop();
|
|
365
397
|
}
|
|
366
|
-
},
|
|
398
|
+
}, _callee5, this);
|
|
367
399
|
}))).apply(this, arguments);
|
|
368
400
|
}
|
|
369
401
|
}, {
|
|
370
402
|
key: "notifyChanged",
|
|
371
|
-
value: function notifyChanged(
|
|
372
|
-
return (_notifyChanged = _notifyChanged || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
403
|
+
value: function notifyChanged(_x11, _x12, _x13, _x14) {
|
|
404
|
+
return (_notifyChanged = _notifyChanged || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(type, key, value, subvalue) {
|
|
373
405
|
var lc, manager_class;
|
|
374
|
-
return _regeneratorRuntime().wrap(function
|
|
375
|
-
while (1) switch (
|
|
406
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
407
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
376
408
|
case 0:
|
|
377
|
-
if (value === undefined && type
|
|
409
|
+
if (value === undefined && type == "") value = this.getValue(key);
|
|
378
410
|
this.__changed = true;
|
|
379
411
|
lc = "";
|
|
380
412
|
if (type) lc += "$".concat(String(type), "$");
|
|
@@ -387,16 +419,16 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
|
|
|
387
419
|
/* --------------------------- notify the manager --------------------------- */
|
|
388
420
|
manager_class = this.manager;
|
|
389
421
|
if (!(manager_class instanceof _ObjectManager["default"])) {
|
|
390
|
-
|
|
422
|
+
_context6.next = 10;
|
|
391
423
|
break;
|
|
392
424
|
}
|
|
393
|
-
|
|
425
|
+
_context6.next = 10;
|
|
394
426
|
return manager_class.notifyChanged(type, key, value, subvalue);
|
|
395
427
|
case 10:
|
|
396
428
|
case "end":
|
|
397
|
-
return
|
|
429
|
+
return _context6.stop();
|
|
398
430
|
}
|
|
399
|
-
},
|
|
431
|
+
}, _callee6, this);
|
|
400
432
|
}))).apply(this, arguments);
|
|
401
433
|
}
|
|
402
434
|
/**
|
|
@@ -434,29 +466,49 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
|
|
|
434
466
|
this.clear_changes();
|
|
435
467
|
}
|
|
436
468
|
}
|
|
469
|
+
/**
|
|
470
|
+
* apply changes for the given field
|
|
471
|
+
* @param key
|
|
472
|
+
* @returns
|
|
473
|
+
*/
|
|
474
|
+
}, {
|
|
475
|
+
key: "apply",
|
|
476
|
+
value: function apply(key) {
|
|
477
|
+
try {
|
|
478
|
+
if (!this.__use_delta) {
|
|
479
|
+
//in this mode , we track changes by updating the original
|
|
480
|
+
return true;
|
|
481
|
+
}
|
|
482
|
+
if (this.__delta != null && key in this.__delta) {
|
|
483
|
+
this[key] = this.__delta[key];
|
|
484
|
+
delete this.__delta[key];
|
|
485
|
+
}
|
|
486
|
+
return true;
|
|
487
|
+
} finally {}
|
|
488
|
+
}
|
|
437
489
|
/**
|
|
438
490
|
* set the value to its original
|
|
439
491
|
* @param key
|
|
440
492
|
*/
|
|
441
493
|
}, {
|
|
442
494
|
key: "reset",
|
|
443
|
-
value: function reset(
|
|
444
|
-
return (_reset = _reset || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
495
|
+
value: function reset(_x15) {
|
|
496
|
+
return (_reset = _reset || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(key) {
|
|
445
497
|
var notifyChanged,
|
|
446
|
-
|
|
447
|
-
return _regeneratorRuntime().wrap(function
|
|
448
|
-
while (1) switch (
|
|
498
|
+
_args7 = arguments;
|
|
499
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
500
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
449
501
|
case 0:
|
|
450
|
-
notifyChanged =
|
|
451
|
-
|
|
502
|
+
notifyChanged = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : "auto";
|
|
503
|
+
_context7.next = 3;
|
|
452
504
|
return this.setValue(key, this[key], notifyChanged);
|
|
453
505
|
case 3:
|
|
454
|
-
return
|
|
506
|
+
return _context7.abrupt("return", _context7.sent);
|
|
455
507
|
case 4:
|
|
456
508
|
case "end":
|
|
457
|
-
return
|
|
509
|
+
return _context7.stop();
|
|
458
510
|
}
|
|
459
|
-
},
|
|
511
|
+
}, _callee7, this);
|
|
460
512
|
}))).apply(this, arguments);
|
|
461
513
|
}
|
|
462
514
|
/**
|
|
@@ -467,43 +519,43 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
|
|
|
467
519
|
}, {
|
|
468
520
|
key: "resetAll",
|
|
469
521
|
value: function resetAll() {
|
|
470
|
-
return (_resetAll = _resetAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
522
|
+
return (_resetAll = _resetAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
471
523
|
var notifyChanged,
|
|
472
524
|
fr,
|
|
473
525
|
key,
|
|
474
|
-
|
|
475
|
-
return _regeneratorRuntime().wrap(function
|
|
476
|
-
while (1) switch (
|
|
526
|
+
_args8 = arguments;
|
|
527
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
528
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
477
529
|
case 0:
|
|
478
|
-
notifyChanged =
|
|
530
|
+
notifyChanged = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : "auto";
|
|
479
531
|
fr = true;
|
|
480
|
-
|
|
532
|
+
_context8.t0 = _regeneratorRuntime().keys(this.__delta);
|
|
481
533
|
case 3:
|
|
482
|
-
if ((
|
|
483
|
-
|
|
534
|
+
if ((_context8.t1 = _context8.t0()).done) {
|
|
535
|
+
_context8.next = 13;
|
|
484
536
|
break;
|
|
485
537
|
}
|
|
486
|
-
key =
|
|
487
|
-
|
|
488
|
-
if (!
|
|
489
|
-
|
|
538
|
+
key = _context8.t1.value;
|
|
539
|
+
_context8.t2 = fr;
|
|
540
|
+
if (!_context8.t2) {
|
|
541
|
+
_context8.next = 10;
|
|
490
542
|
break;
|
|
491
543
|
}
|
|
492
|
-
|
|
544
|
+
_context8.next = 9;
|
|
493
545
|
return this.reset(key, notifyChanged);
|
|
494
546
|
case 9:
|
|
495
|
-
|
|
547
|
+
_context8.t2 = _context8.sent;
|
|
496
548
|
case 10:
|
|
497
|
-
fr =
|
|
498
|
-
|
|
549
|
+
fr = _context8.t2;
|
|
550
|
+
_context8.next = 3;
|
|
499
551
|
break;
|
|
500
552
|
case 13:
|
|
501
|
-
return
|
|
553
|
+
return _context8.abrupt("return", fr);
|
|
502
554
|
case 14:
|
|
503
555
|
case "end":
|
|
504
|
-
return
|
|
556
|
+
return _context8.stop();
|
|
505
557
|
}
|
|
506
|
-
},
|
|
558
|
+
}, _callee8, this);
|
|
507
559
|
}))).apply(this, arguments);
|
|
508
560
|
}
|
|
509
561
|
/**
|
|
@@ -667,35 +719,35 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
|
|
|
667
719
|
/* -------------------------------------------------------------------------- */
|
|
668
720
|
/* Events */
|
|
669
721
|
/* -------------------------------------------------------------------------- */
|
|
670
|
-
function event_run(
|
|
671
|
-
return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
722
|
+
function event_run(_x16) {
|
|
723
|
+
return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(eventName) {
|
|
672
724
|
var _this$manager;
|
|
673
725
|
var _len,
|
|
674
726
|
params,
|
|
675
727
|
_key,
|
|
676
|
-
|
|
677
|
-
return _regeneratorRuntime().wrap(function
|
|
678
|
-
while (1) switch (
|
|
728
|
+
_args9 = arguments;
|
|
729
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
730
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
679
731
|
case 0:
|
|
680
732
|
if (this.manager) {
|
|
681
|
-
|
|
733
|
+
_context9.next = 3;
|
|
682
734
|
break;
|
|
683
735
|
}
|
|
684
736
|
if (this.__showErrors === true) console.error("you cant use events if your object has no manager");
|
|
685
|
-
return
|
|
737
|
+
return _context9.abrupt("return");
|
|
686
738
|
case 3:
|
|
687
|
-
for (_len =
|
|
688
|
-
params[_key - 1] =
|
|
739
|
+
for (_len = _args9.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
740
|
+
params[_key - 1] = _args9[_key];
|
|
689
741
|
}
|
|
690
|
-
|
|
742
|
+
_context9.next = 6;
|
|
691
743
|
return (_this$manager = this.manager).event_run.apply(_this$manager, [eventName].concat(params));
|
|
692
744
|
case 6:
|
|
693
|
-
return
|
|
745
|
+
return _context9.abrupt("return", _context9.sent);
|
|
694
746
|
case 7:
|
|
695
747
|
case "end":
|
|
696
|
-
return
|
|
748
|
+
return _context9.stop();
|
|
697
749
|
}
|
|
698
|
-
},
|
|
750
|
+
}, _callee9, this);
|
|
699
751
|
}))).apply(this, arguments);
|
|
700
752
|
}
|
|
701
753
|
}, {
|
|
@@ -720,30 +772,30 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
|
|
|
720
772
|
}
|
|
721
773
|
}, {
|
|
722
774
|
key: "event_add",
|
|
723
|
-
value: function event_add(
|
|
724
|
-
return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
775
|
+
value: function event_add(_x17, _x18, _x19) {
|
|
776
|
+
return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(name, uname, runEvent) {
|
|
725
777
|
var onlyOn,
|
|
726
778
|
runOnce,
|
|
727
|
-
|
|
728
|
-
return _regeneratorRuntime().wrap(function
|
|
729
|
-
while (1) switch (
|
|
779
|
+
_args10 = arguments;
|
|
780
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
781
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
730
782
|
case 0:
|
|
731
|
-
onlyOn =
|
|
732
|
-
runOnce =
|
|
783
|
+
onlyOn = _args10.length > 3 && _args10[3] !== undefined ? _args10[3] : null;
|
|
784
|
+
runOnce = _args10.length > 4 && _args10[4] !== undefined ? _args10[4] : false;
|
|
733
785
|
if (this.manager) {
|
|
734
|
-
|
|
786
|
+
_context10.next = 5;
|
|
735
787
|
break;
|
|
736
788
|
}
|
|
737
789
|
if (this.__showErrors === true) console.error("you cant use events if your object has no manager");
|
|
738
|
-
return
|
|
790
|
+
return _context10.abrupt("return");
|
|
739
791
|
case 5:
|
|
740
|
-
|
|
792
|
+
_context10.next = 7;
|
|
741
793
|
return this.manager.event_add(name, uname, runEvent, onlyOn, runOnce);
|
|
742
794
|
case 7:
|
|
743
795
|
case "end":
|
|
744
|
-
return
|
|
796
|
+
return _context10.stop();
|
|
745
797
|
}
|
|
746
|
-
},
|
|
798
|
+
}, _callee10, this);
|
|
747
799
|
}))).apply(this, arguments);
|
|
748
800
|
}
|
|
749
801
|
/* -------------------------------------------------------------------------- */
|
|
@@ -1164,6 +1216,7 @@ function _getTempProperty2(key) {
|
|
|
1164
1216
|
function _setTempProperty2(key, value) {
|
|
1165
1217
|
if (this.__temp == null) this.__temp = {};
|
|
1166
1218
|
if (value == null) delete this.__temp[key];else this.__temp[key] = value;
|
|
1219
|
+
return true;
|
|
1167
1220
|
}
|
|
1168
1221
|
function _setSaveResultObject2(toObj) {
|
|
1169
1222
|
if (toObj == null) toObj = null; //null or undefined
|