@azrico/webobject 1.4.94 → 1.4.95
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.
|
@@ -80,29 +80,31 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
|
|
|
80
80
|
}, _callee);
|
|
81
81
|
})));
|
|
82
82
|
_this.event_add("on_{archive,unarchive}", "on_archive-sendmsg", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
83
|
+
var srType;
|
|
83
84
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
84
85
|
while (1) switch (_context2.prev = _context2.next) {
|
|
85
86
|
case 0:
|
|
86
|
-
|
|
87
|
-
_context2.
|
|
87
|
+
srType = _this.getSaveResultType();
|
|
88
|
+
_context2.t0 = srType;
|
|
89
|
+
_context2.next = _context2.t0 === "normal" ? 4 : 7;
|
|
88
90
|
break;
|
|
89
|
-
case
|
|
90
|
-
_context2.next =
|
|
91
|
+
case 4:
|
|
92
|
+
_context2.next = 6;
|
|
91
93
|
return _global.gfunc.run_action("show_message", {
|
|
92
94
|
message: _this.isArchived ? "Archived" : "Restored",
|
|
93
95
|
type: "success"
|
|
94
96
|
});
|
|
95
|
-
case 5:
|
|
96
|
-
return _context2.abrupt("return", _context2.sent);
|
|
97
97
|
case 6:
|
|
98
|
-
_context2.
|
|
98
|
+
return _context2.abrupt("return", _context2.sent);
|
|
99
|
+
case 7:
|
|
100
|
+
_context2.next = 9;
|
|
99
101
|
return _global.gfunc.run_action("show_message", {
|
|
100
|
-
message: "Not archived",
|
|
102
|
+
message: "Not archived (".concat(srType, ")"),
|
|
101
103
|
type: "error"
|
|
102
104
|
});
|
|
103
|
-
case 8:
|
|
104
|
-
return _context2.abrupt("return", _context2.sent);
|
|
105
105
|
case 9:
|
|
106
|
+
return _context2.abrupt("return", _context2.sent);
|
|
107
|
+
case 10:
|
|
106
108
|
case "end":
|
|
107
109
|
return _context2.stop();
|
|
108
110
|
}
|
|
@@ -14,6 +14,10 @@ export declare class ObjectManager<ObjType extends SimpleObject> {
|
|
|
14
14
|
protected __options?: object;
|
|
15
15
|
__object_nullable: boolean;
|
|
16
16
|
notifyChanged(type: string, key: PropOf<ObjType> | string, value?: any, subvalue?: string): Promise<false | any[] | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* Get the object this manager is managing
|
|
19
|
+
* @returns the object
|
|
20
|
+
*/
|
|
17
21
|
get obj(): ObjType | undefined;
|
|
18
22
|
/**
|
|
19
23
|
* Get the object this manager is managing
|
|
@@ -62,11 +62,17 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
62
62
|
}
|
|
63
63
|
}, _callee, this);
|
|
64
64
|
}))).apply(this, arguments);
|
|
65
|
-
}
|
|
65
|
+
}
|
|
66
|
+
/* -------------------------------------------------------------------------- */
|
|
67
|
+
/**
|
|
68
|
+
* Get the object this manager is managing
|
|
69
|
+
* @returns the object
|
|
70
|
+
*/
|
|
66
71
|
}, {
|
|
67
72
|
key: "obj",
|
|
68
73
|
get: function get() {
|
|
69
|
-
|
|
74
|
+
var _this$__currentObject;
|
|
75
|
+
return (_this$__currentObject = this.__currentObject) !== null && _this$__currentObject !== void 0 ? _this$__currentObject : undefined;
|
|
70
76
|
}
|
|
71
77
|
/**
|
|
72
78
|
* Get the object this manager is managing
|
|
@@ -75,8 +81,8 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
75
81
|
}, {
|
|
76
82
|
key: "getObject",
|
|
77
83
|
value: function getObject() {
|
|
78
|
-
var _this$
|
|
79
|
-
return (_this$
|
|
84
|
+
var _this$__currentObject2;
|
|
85
|
+
return (_this$__currentObject2 = this.__currentObject) !== null && _this$__currentObject2 !== void 0 ? _this$__currentObject2 : undefined;
|
|
80
86
|
}
|
|
81
87
|
/**
|
|
82
88
|
* Set the object this manager is managing
|
|
@@ -145,26 +151,26 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
145
151
|
}, {
|
|
146
152
|
key: "getSaveResult",
|
|
147
153
|
value: function getSaveResult() {
|
|
148
|
-
var _this$
|
|
149
|
-
return ((_this$
|
|
154
|
+
var _this$obj5;
|
|
155
|
+
return ((_this$obj5 = this.obj) === null || _this$obj5 === void 0 ? void 0 : _this$obj5.getSaveResult()) || undefined;
|
|
150
156
|
}
|
|
151
157
|
}, {
|
|
152
158
|
key: "getSaveResultType",
|
|
153
159
|
value: function getSaveResultType() {
|
|
154
|
-
var _this$
|
|
155
|
-
return ((_this$
|
|
160
|
+
var _this$obj6;
|
|
161
|
+
return ((_this$obj6 = this.obj) === null || _this$obj6 === void 0 ? void 0 : _this$obj6.getSaveResultType()) || null;
|
|
156
162
|
}
|
|
157
163
|
}, {
|
|
158
164
|
key: "setSaveResult",
|
|
159
165
|
value: function setSaveResult(toObj, type) {
|
|
160
|
-
var _this$
|
|
161
|
-
return (_this$
|
|
166
|
+
var _this$obj7;
|
|
167
|
+
return (_this$obj7 = this.obj) === null || _this$obj7 === void 0 ? void 0 : _this$obj7.setSaveResult(toObj, type);
|
|
162
168
|
}
|
|
163
169
|
}, {
|
|
164
170
|
key: "apply_changes",
|
|
165
171
|
value: function apply_changes() {
|
|
166
|
-
var _this$
|
|
167
|
-
return ((_this$
|
|
172
|
+
var _this$obj8;
|
|
173
|
+
return ((_this$obj8 = this.obj) === null || _this$obj8 === void 0 ? void 0 : _this$obj8.apply_changes()) || false;
|
|
168
174
|
}
|
|
169
175
|
}, {
|
|
170
176
|
key: "getValue",
|
|
@@ -229,12 +235,12 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
229
235
|
key: "setSubValue",
|
|
230
236
|
value: function setSubValue(_x7, _x8, _x9) {
|
|
231
237
|
return (_setSubValue = _setSubValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(key, objKey, subvalue) {
|
|
232
|
-
var _yield$this$obj$setSu, _this$
|
|
238
|
+
var _yield$this$obj$setSu, _this$obj9;
|
|
233
239
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
234
240
|
while (1) switch (_context3.prev = _context3.next) {
|
|
235
241
|
case 0:
|
|
236
242
|
_context3.next = 2;
|
|
237
|
-
return (_this$
|
|
243
|
+
return (_this$obj9 = this.obj) === null || _this$obj9 === void 0 ? void 0 : _this$obj9.setSubValue(key, objKey, subvalue);
|
|
238
244
|
case 2:
|
|
239
245
|
_context3.t1 = _yield$this$obj$setSu = _context3.sent;
|
|
240
246
|
_context3.t0 = _context3.t1 !== null;
|
|
@@ -266,12 +272,12 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
266
272
|
key: "pushValue",
|
|
267
273
|
value: function pushValue(_x10, _x11) {
|
|
268
274
|
return (_pushValue = _pushValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(key, value) {
|
|
269
|
-
var _yield$this$obj$pushV, _this$
|
|
275
|
+
var _yield$this$obj$pushV, _this$obj10;
|
|
270
276
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
271
277
|
while (1) switch (_context4.prev = _context4.next) {
|
|
272
278
|
case 0:
|
|
273
279
|
_context4.next = 2;
|
|
274
|
-
return (_this$
|
|
280
|
+
return (_this$obj10 = this.obj) === null || _this$obj10 === void 0 ? void 0 : _this$obj10.pushValue(key, value);
|
|
275
281
|
case 2:
|
|
276
282
|
_context4.t1 = _yield$this$obj$pushV = _context4.sent;
|
|
277
283
|
_context4.t0 = _context4.t1 !== null;
|
|
@@ -303,7 +309,7 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
303
309
|
key: "setTemp",
|
|
304
310
|
value: function setTemp(_x12, _x13) {
|
|
305
311
|
return (_setTemp = _setTemp || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, value) {
|
|
306
|
-
var _yield$this$obj$setTe, _this$
|
|
312
|
+
var _yield$this$obj$setTe, _this$obj11;
|
|
307
313
|
var sendChanges,
|
|
308
314
|
_args5 = arguments;
|
|
309
315
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
@@ -311,7 +317,7 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
311
317
|
case 0:
|
|
312
318
|
sendChanges = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : false;
|
|
313
319
|
_context5.next = 3;
|
|
314
|
-
return (_this$
|
|
320
|
+
return (_this$obj11 = this.obj) === null || _this$obj11 === void 0 ? void 0 : _this$obj11.setTemp(key, value, sendChanges);
|
|
315
321
|
case 3:
|
|
316
322
|
_context5.t1 = _yield$this$obj$setTe = _context5.sent;
|
|
317
323
|
_context5.t0 = _context5.t1 !== null;
|
|
@@ -342,27 +348,27 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
342
348
|
}, {
|
|
343
349
|
key: "getTemp",
|
|
344
350
|
value: function getTemp(key) {
|
|
345
|
-
var _this$obj$getTemp, _this$
|
|
346
|
-
return (_this$obj$getTemp = (_this$
|
|
351
|
+
var _this$obj$getTemp, _this$obj12;
|
|
352
|
+
return (_this$obj$getTemp = (_this$obj12 = this.obj) === null || _this$obj12 === void 0 ? void 0 : _this$obj12.getTemp(key)) !== null && _this$obj$getTemp !== void 0 ? _this$obj$getTemp : undefined;
|
|
347
353
|
}
|
|
348
354
|
/* -------------------------------------------------------------------------- */
|
|
349
355
|
}, {
|
|
350
356
|
key: "getIndexOrID",
|
|
351
357
|
value: function getIndexOrID() {
|
|
352
|
-
var _this$
|
|
353
|
-
return ((_this$
|
|
358
|
+
var _this$obj13;
|
|
359
|
+
return ((_this$obj13 = this.obj) === null || _this$obj13 === void 0 ? void 0 : _this$obj13.getIndexOrID()) || -1;
|
|
354
360
|
}
|
|
355
361
|
}, {
|
|
356
362
|
key: "getIndex",
|
|
357
363
|
value: function getIndex() {
|
|
358
|
-
var _this$
|
|
359
|
-
return ((_this$
|
|
364
|
+
var _this$obj14;
|
|
365
|
+
return ((_this$obj14 = this.obj) === null || _this$obj14 === void 0 ? void 0 : _this$obj14.getIndex()) || -1;
|
|
360
366
|
}
|
|
361
367
|
}, {
|
|
362
368
|
key: "getID",
|
|
363
369
|
value: function getID() {
|
|
364
|
-
var _this$
|
|
365
|
-
return ((_this$
|
|
370
|
+
var _this$obj15;
|
|
371
|
+
return ((_this$obj15 = this.obj) === null || _this$obj15 === void 0 ? void 0 : _this$obj15.getID()) || "";
|
|
366
372
|
}
|
|
367
373
|
/* -------------------------------------------------------------------------- */
|
|
368
374
|
/* Events */
|
|
@@ -462,14 +468,14 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
|
|
|
462
468
|
}, {
|
|
463
469
|
key: "clear_changes",
|
|
464
470
|
value: function clear_changes() {
|
|
465
|
-
var _this$
|
|
466
|
-
return (_this$
|
|
471
|
+
var _this$obj16;
|
|
472
|
+
return (_this$obj16 = this.obj) === null || _this$obj16 === void 0 ? void 0 : _this$obj16.clear_changes();
|
|
467
473
|
}
|
|
468
474
|
}, {
|
|
469
475
|
key: "clear_cache",
|
|
470
476
|
value: function clear_cache() {
|
|
471
|
-
var _this$
|
|
472
|
-
return (_this$
|
|
477
|
+
var _this$obj17;
|
|
478
|
+
return (_this$obj17 = this.obj) === null || _this$obj17 === void 0 ? void 0 : _this$obj17.clear_cache();
|
|
473
479
|
}
|
|
474
480
|
}, {
|
|
475
481
|
key: "toggleOption",
|
|
@@ -1261,6 +1261,7 @@ function _setTempProperty2(key, value) {
|
|
|
1261
1261
|
function _setSaveResultObject2(toObj) {
|
|
1262
1262
|
if (toObj == null) toObj = null; //null or undefined
|
|
1263
1263
|
this.__saveResultObject = toObj;
|
|
1264
|
+
return true;
|
|
1264
1265
|
}
|
|
1265
1266
|
_defineProperty(SimpleObject, "__cache_name", void 0);
|
|
1266
1267
|
//these properties should not be changed and are usually set by server
|