@azrico/webobject 1.4.71 → 1.4.73

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.
@@ -1,6 +1,6 @@
1
1
  import { PropOf, WriteablePropOf } from "./SimpleObject";
2
2
  import SimpleObject from "./SimpleObject";
3
- import { saveResultType } from "./SimpleObject";
3
+ import { saveResultType, sendChangesType } from "./SimpleObject";
4
4
  /**
5
5
  * This class manages the events of an Simple Object
6
6
  */
@@ -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<any>;
56
+ setTemp(key: string, value: any, sendChanges?: sendChangesType): Promise<boolean>;
57
57
  getTemp(key: string): Promise<any>;
58
58
  getIndexOrID(): number | string;
59
59
  getIndex(): number;
@@ -277,21 +277,24 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
277
277
  value: function setTemp(_x12, _x13) {
278
278
  return (_setTemp = _setTemp || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, value) {
279
279
  var _this$obj8;
280
+ var sendChanges,
281
+ _args5 = arguments;
280
282
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
281
283
  while (1) switch (_context5.prev = _context5.next) {
282
284
  case 0:
283
- _context5.next = 2;
284
- return (_this$obj8 = this.obj) === null || _this$obj8 === void 0 ? void 0 : _this$obj8.setTemp(key, value);
285
- case 2:
285
+ sendChanges = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : false;
286
+ _context5.next = 3;
287
+ return (_this$obj8 = this.obj) === null || _this$obj8 === void 0 ? void 0 : _this$obj8.setTemp(key, value, sendChanges);
288
+ case 3:
286
289
  _context5.t0 = _context5.sent;
287
290
  if (_context5.t0) {
288
- _context5.next = 5;
291
+ _context5.next = 6;
289
292
  break;
290
293
  }
291
294
  _context5.t0 = false;
292
- case 5:
293
- return _context5.abrupt("return", _context5.t0);
294
295
  case 6:
296
+ return _context5.abrupt("return", _context5.t0);
297
+ case 7:
295
298
  case "end":
296
299
  return _context5.stop();
297
300
  }
@@ -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: (key: string, value: any) => any;
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>;
@@ -191,7 +191,7 @@ export declare class SimpleObject extends MapableObject {
191
191
  setSaveResult(toObj: any, type?: saveResultType | "auto"): void;
192
192
  getSaveResult(original?: boolean): any;
193
193
  getSaveResultType(): saveResultType;
194
- static setTemp(obj: any, key: string, value: any): any;
194
+ static setTemp(obj: SimpleObject | any, key: string, value: any, sendChanges?: sendChangesType): Promise<void>;
195
195
  static factoryClear(obj: SimpleObject): void;
196
196
  static delete_cache(): void;
197
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, _setTemp2) {
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: "setAll",
193
- value: function setAll(_x3) {
194
- return (_setAll = _setAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(setObj) {
195
- var finalRes, key;
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] : false;
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
- _context2.t0 = _regeneratorRuntime().keys(setObj);
232
+ _context3.t0 = _regeneratorRuntime().keys(setObj);
201
233
  case 2:
202
- if ((_context2.t1 = _context2.t0()).done) {
203
- _context2.next = 10;
234
+ if ((_context3.t1 = _context3.t0()).done) {
235
+ _context3.next = 10;
204
236
  break;
205
237
  }
206
- key = _context2.t1.value;
207
- _context2.next = 6;
238
+ key = _context3.t1.value;
239
+ _context3.next = 6;
208
240
  return this.setValue(key, setObj[key]);
209
241
  case 6:
210
- if (_context2.sent) {
211
- _context2.next = 8;
242
+ if (_context3.sent) {
243
+ _context3.next = 8;
212
244
  break;
213
245
  }
214
246
  finalRes = false;
215
247
  case 8:
216
- _context2.next = 2;
248
+ _context3.next = 2;
217
249
  break;
218
250
  case 10:
219
- return _context2.abrupt("return", finalRes);
251
+ return _context3.abrupt("return", finalRes);
220
252
  case 11:
221
253
  case "end":
222
- return _context2.stop();
254
+ return _context3.stop();
223
255
  }
224
- }, _callee2, this);
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(_x4, _x5, _x6) {
249
- return (_setSubValue = _setSubValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(key, objKey, subvalue) {
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
- _args3 = arguments;
254
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
255
- while (1) switch (_context3.prev = _context3.next) {
285
+ _args4 = arguments;
286
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
287
+ while (1) switch (_context4.prev = _context4.next) {
256
288
  case 0:
257
- sendChanges = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : "auto";
289
+ sendChanges = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : "auto";
258
290
  if (this.canModify) {
259
- _context3.next = 7;
291
+ _context4.next = 7;
260
292
  break;
261
293
  }
262
294
  if (!(this.__throw_errors !== false)) {
263
- _context3.next = 6;
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 _context3.abrupt("return", false);
300
+ return _context4.abrupt("return", false);
269
301
  case 7:
270
302
  isValueChanged = false;
271
- _context3.prev = 8;
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
- _context3.prev = 11;
314
+ _context4.prev = 11;
283
315
  if (!(sendChanges === true || sendChanges === "auto" && isValueChanged)) {
284
- _context3.next = 15;
316
+ _context4.next = 15;
285
317
  break;
286
318
  }
287
- _context3.next = 15;
319
+ _context4.next = 15;
288
320
  return this.notifyChanged("", key, objKey, subvalue);
289
321
  case 15:
290
- return _context3.finish(11);
322
+ return _context4.finish(11);
291
323
  case 16:
292
- return _context3.abrupt("return", isValueChanged);
324
+ return _context4.abrupt("return", isValueChanged);
293
325
  case 17:
294
326
  case "end":
295
- return _context3.stop();
327
+ return _context4.stop();
296
328
  }
297
- }, _callee3, this, [[8,, 11, 16]]);
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(_x7, _x8) {
311
- return (_pushValue = _pushValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(key, value) {
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
- _args4 = arguments;
315
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
316
- while (1) switch (_context4.prev = _context4.next) {
346
+ _args5 = arguments;
347
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
348
+ while (1) switch (_context5.prev = _context5.next) {
317
349
  case 0:
318
- sendChanges = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : "auto";
350
+ sendChanges = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : "auto";
319
351
  if (!(value == null)) {
320
- _context4.next = 3;
352
+ _context5.next = 3;
321
353
  break;
322
354
  }
323
- return _context4.abrupt("return", false);
355
+ return _context5.abrupt("return", false);
324
356
  case 3:
325
357
  if (this.canModify) {
326
- _context4.next = 9;
358
+ _context5.next = 9;
327
359
  break;
328
360
  }
329
361
  if (!(this.__throw_errors !== false)) {
330
- _context4.next = 8;
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 _context4.abrupt("return", false);
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
- _context4.next = 17;
374
+ _context5.next = 17;
343
375
  break;
344
376
  }
345
377
  if (!(this.__throw_errors !== false)) {
346
- _context4.next = 16;
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 _context4.abrupt("return", false);
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
- _context4.next = 21;
387
+ _context5.next = 21;
356
388
  break;
357
389
  }
358
- _context4.next = 21;
390
+ _context5.next = 21;
359
391
  return this.notifyChanged("", key, value);
360
392
  case 21:
361
- return _context4.abrupt("return", tempArray);
393
+ return _context5.abrupt("return", tempArray);
362
394
  case 22:
363
395
  case "end":
364
- return _context4.stop();
396
+ return _context5.stop();
365
397
  }
366
- }, _callee4, this);
398
+ }, _callee5, this);
367
399
  }))).apply(this, arguments);
368
400
  }
369
401
  }, {
370
402
  key: "notifyChanged",
371
- value: function notifyChanged(_x9, _x10, _x11, _x12) {
372
- return (_notifyChanged = _notifyChanged || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(type, key, value, subvalue) {
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 _callee5$(_context5) {
375
- while (1) switch (_context5.prev = _context5.next) {
406
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
407
+ while (1) switch (_context6.prev = _context6.next) {
376
408
  case 0:
377
- if (value === undefined && type != "meta") value = this.getValue(key);
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
- _context5.next = 10;
422
+ _context6.next = 10;
391
423
  break;
392
424
  }
393
- _context5.next = 10;
425
+ _context6.next = 10;
394
426
  return manager_class.notifyChanged(type, key, value, subvalue);
395
427
  case 10:
396
428
  case "end":
397
- return _context5.stop();
429
+ return _context6.stop();
398
430
  }
399
- }, _callee5, this);
431
+ }, _callee6, this);
400
432
  }))).apply(this, arguments);
401
433
  }
402
434
  /**
@@ -460,23 +492,23 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
460
492
  */
461
493
  }, {
462
494
  key: "reset",
463
- value: function reset(_x13) {
464
- return (_reset = _reset || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(key) {
495
+ value: function reset(_x15) {
496
+ return (_reset = _reset || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(key) {
465
497
  var notifyChanged,
466
- _args6 = arguments;
467
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
468
- while (1) switch (_context6.prev = _context6.next) {
498
+ _args7 = arguments;
499
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
500
+ while (1) switch (_context7.prev = _context7.next) {
469
501
  case 0:
470
- notifyChanged = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : "auto";
471
- _context6.next = 3;
502
+ notifyChanged = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : "auto";
503
+ _context7.next = 3;
472
504
  return this.setValue(key, this[key], notifyChanged);
473
505
  case 3:
474
- return _context6.abrupt("return", _context6.sent);
506
+ return _context7.abrupt("return", _context7.sent);
475
507
  case 4:
476
508
  case "end":
477
- return _context6.stop();
509
+ return _context7.stop();
478
510
  }
479
- }, _callee6, this);
511
+ }, _callee7, this);
480
512
  }))).apply(this, arguments);
481
513
  }
482
514
  /**
@@ -487,43 +519,43 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
487
519
  }, {
488
520
  key: "resetAll",
489
521
  value: function resetAll() {
490
- return (_resetAll = _resetAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
522
+ return (_resetAll = _resetAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
491
523
  var notifyChanged,
492
524
  fr,
493
525
  key,
494
- _args7 = arguments;
495
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
496
- while (1) switch (_context7.prev = _context7.next) {
526
+ _args8 = arguments;
527
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
528
+ while (1) switch (_context8.prev = _context8.next) {
497
529
  case 0:
498
- notifyChanged = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : "auto";
530
+ notifyChanged = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : "auto";
499
531
  fr = true;
500
- _context7.t0 = _regeneratorRuntime().keys(this.__delta);
532
+ _context8.t0 = _regeneratorRuntime().keys(this.__delta);
501
533
  case 3:
502
- if ((_context7.t1 = _context7.t0()).done) {
503
- _context7.next = 13;
534
+ if ((_context8.t1 = _context8.t0()).done) {
535
+ _context8.next = 13;
504
536
  break;
505
537
  }
506
- key = _context7.t1.value;
507
- _context7.t2 = fr;
508
- if (!_context7.t2) {
509
- _context7.next = 10;
538
+ key = _context8.t1.value;
539
+ _context8.t2 = fr;
540
+ if (!_context8.t2) {
541
+ _context8.next = 10;
510
542
  break;
511
543
  }
512
- _context7.next = 9;
544
+ _context8.next = 9;
513
545
  return this.reset(key, notifyChanged);
514
546
  case 9:
515
- _context7.t2 = _context7.sent;
547
+ _context8.t2 = _context8.sent;
516
548
  case 10:
517
- fr = _context7.t2;
518
- _context7.next = 3;
549
+ fr = _context8.t2;
550
+ _context8.next = 3;
519
551
  break;
520
552
  case 13:
521
- return _context7.abrupt("return", fr);
553
+ return _context8.abrupt("return", fr);
522
554
  case 14:
523
555
  case "end":
524
- return _context7.stop();
556
+ return _context8.stop();
525
557
  }
526
- }, _callee7, this);
558
+ }, _callee8, this);
527
559
  }))).apply(this, arguments);
528
560
  }
529
561
  /**
@@ -687,35 +719,35 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
687
719
  /* -------------------------------------------------------------------------- */
688
720
  /* Events */
689
721
  /* -------------------------------------------------------------------------- */
690
- function event_run(_x14) {
691
- return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(eventName) {
722
+ function event_run(_x16) {
723
+ return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(eventName) {
692
724
  var _this$manager;
693
725
  var _len,
694
726
  params,
695
727
  _key,
696
- _args8 = arguments;
697
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
698
- while (1) switch (_context8.prev = _context8.next) {
728
+ _args9 = arguments;
729
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
730
+ while (1) switch (_context9.prev = _context9.next) {
699
731
  case 0:
700
732
  if (this.manager) {
701
- _context8.next = 3;
733
+ _context9.next = 3;
702
734
  break;
703
735
  }
704
736
  if (this.__showErrors === true) console.error("you cant use events if your object has no manager");
705
- return _context8.abrupt("return");
737
+ return _context9.abrupt("return");
706
738
  case 3:
707
- for (_len = _args8.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
708
- params[_key - 1] = _args8[_key];
739
+ for (_len = _args9.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
740
+ params[_key - 1] = _args9[_key];
709
741
  }
710
- _context8.next = 6;
742
+ _context9.next = 6;
711
743
  return (_this$manager = this.manager).event_run.apply(_this$manager, [eventName].concat(params));
712
744
  case 6:
713
- return _context8.abrupt("return", _context8.sent);
745
+ return _context9.abrupt("return", _context9.sent);
714
746
  case 7:
715
747
  case "end":
716
- return _context8.stop();
748
+ return _context9.stop();
717
749
  }
718
- }, _callee8, this);
750
+ }, _callee9, this);
719
751
  }))).apply(this, arguments);
720
752
  }
721
753
  }, {
@@ -740,30 +772,30 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
740
772
  }
741
773
  }, {
742
774
  key: "event_add",
743
- value: function event_add(_x15, _x16, _x17) {
744
- return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(name, uname, runEvent) {
775
+ value: function event_add(_x17, _x18, _x19) {
776
+ return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(name, uname, runEvent) {
745
777
  var onlyOn,
746
778
  runOnce,
747
- _args9 = arguments;
748
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
749
- while (1) switch (_context9.prev = _context9.next) {
779
+ _args10 = arguments;
780
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
781
+ while (1) switch (_context10.prev = _context10.next) {
750
782
  case 0:
751
- onlyOn = _args9.length > 3 && _args9[3] !== undefined ? _args9[3] : null;
752
- runOnce = _args9.length > 4 && _args9[4] !== undefined ? _args9[4] : false;
783
+ onlyOn = _args10.length > 3 && _args10[3] !== undefined ? _args10[3] : null;
784
+ runOnce = _args10.length > 4 && _args10[4] !== undefined ? _args10[4] : false;
753
785
  if (this.manager) {
754
- _context9.next = 5;
786
+ _context10.next = 5;
755
787
  break;
756
788
  }
757
789
  if (this.__showErrors === true) console.error("you cant use events if your object has no manager");
758
- return _context9.abrupt("return");
790
+ return _context10.abrupt("return");
759
791
  case 5:
760
- _context9.next = 7;
792
+ _context10.next = 7;
761
793
  return this.manager.event_add(name, uname, runEvent, onlyOn, runOnce);
762
794
  case 7:
763
795
  case "end":
764
- return _context9.stop();
796
+ return _context10.stop();
765
797
  }
766
- }, _callee9, this);
798
+ }, _callee10, this);
767
799
  }))).apply(this, arguments);
768
800
  }
769
801
  /* -------------------------------------------------------------------------- */
@@ -1091,11 +1123,38 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
1091
1123
  }
1092
1124
  }, {
1093
1125
  key: "setTemp",
1094
- value: function setTemp(obj, key, value) {
1095
- if (_typeof(obj) !== "object" || !obj || Array.isArray(obj)) return;
1096
- if (obj instanceof SimpleObject) return obj.setTemp(key, value);
1097
- if (obj.__temp == null) obj.__temp = {};
1098
- if (value == null) delete obj.__temp[key];else obj.__temp[key] = value;
1126
+ value: function setTemp(_x20, _x21, _x22) {
1127
+ return (_setTemp2 = _setTemp2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(obj, key, value) {
1128
+ var sendChanges,
1129
+ _args11 = arguments;
1130
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1131
+ while (1) switch (_context11.prev = _context11.next) {
1132
+ case 0:
1133
+ sendChanges = _args11.length > 3 && _args11[3] !== undefined ? _args11[3] : false;
1134
+ if (!(_typeof(obj) !== "object" || !obj || Array.isArray(obj))) {
1135
+ _context11.next = 3;
1136
+ break;
1137
+ }
1138
+ return _context11.abrupt("return");
1139
+ case 3:
1140
+ if (!(obj instanceof SimpleObject)) {
1141
+ _context11.next = 7;
1142
+ break;
1143
+ }
1144
+ _context11.next = 6;
1145
+ return obj.setTemp(key, value, sendChanges);
1146
+ case 6:
1147
+ return _context11.abrupt("return", _context11.sent);
1148
+ case 7:
1149
+ //
1150
+ if (obj.__temp == null) obj.__temp = {};
1151
+ if (value == null) delete obj.__temp[key];else obj.__temp[key] = value;
1152
+ case 9:
1153
+ case "end":
1154
+ return _context11.stop();
1155
+ }
1156
+ }, _callee11);
1157
+ }))).apply(this, arguments);
1099
1158
  }
1100
1159
  }, {
1101
1160
  key: "factoryClear",
@@ -1184,6 +1243,7 @@ function _getTempProperty2(key) {
1184
1243
  function _setTempProperty2(key, value) {
1185
1244
  if (this.__temp == null) this.__temp = {};
1186
1245
  if (value == null) delete this.__temp[key];else this.__temp[key] = value;
1246
+ return true;
1187
1247
  }
1188
1248
  function _setSaveResultObject2(toObj) {
1189
1249
  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.71",
3
+ "version": "1.4.73",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",