@azrico/webobject 1.4.72 → 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<boolean>;
|
|
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
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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 =
|
|
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
|
}
|
|
@@ -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): Promise<void
|
|
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, _setTemp, _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() {
|
|
@@ -197,7 +197,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
197
197
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
198
198
|
while (1) switch (_context2.prev = _context2.next) {
|
|
199
199
|
case 0:
|
|
200
|
-
sendChanges = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] :
|
|
200
|
+
sendChanges = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : false;
|
|
201
201
|
isValueChanged = false;
|
|
202
202
|
_context2.prev = 2;
|
|
203
203
|
isValueChanged = _classPrivateMethodGet(this, _getTempProperty, _getTempProperty2).call(this, key) != value;
|
|
@@ -1123,11 +1123,38 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
1123
1123
|
}
|
|
1124
1124
|
}, {
|
|
1125
1125
|
key: "setTemp",
|
|
1126
|
-
value: function setTemp(
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
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);
|
|
1131
1158
|
}
|
|
1132
1159
|
}, {
|
|
1133
1160
|
key: "factoryClear",
|