@azrico/webobject 1.4.170 → 1.4.173
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.
|
@@ -5,7 +5,7 @@ import ObjectManager from "../structs/ObjectManager";
|
|
|
5
5
|
* This class manages the events of an Simple Object
|
|
6
6
|
*/
|
|
7
7
|
export declare class WebObjectManager<T extends WebObject> extends ObjectManager<T> {
|
|
8
|
-
static readonly __object_type: ClassType<WebObject>;
|
|
8
|
+
static readonly __object_type: () => ClassType<WebObject>;
|
|
9
9
|
static readonly __save_message: boolean;
|
|
10
10
|
constructor(defaultObject?: T);
|
|
11
11
|
setObject(toObj: T | undefined): boolean;
|
|
@@ -61,5 +61,7 @@ export declare class WebObjectManager<T extends WebObject> extends ObjectManager
|
|
|
61
61
|
*/
|
|
62
62
|
onSave(...p: any): Promise<any>;
|
|
63
63
|
onAfterSave(...p: any): Promise<any>;
|
|
64
|
+
getObjectType(): ClassType<WebObject>;
|
|
65
|
+
static getObjectType(): ClassType<WebObject>;
|
|
64
66
|
}
|
|
65
67
|
export default WebObjectManager;
|
|
@@ -537,10 +537,11 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
537
537
|
}, {
|
|
538
538
|
key: "__getObjectData",
|
|
539
539
|
value: function __getObjectData(checkKeys) {
|
|
540
|
+
var objtype = this.getObjectType();
|
|
540
541
|
for (var index = 0; index < checkKeys.length; index++) {
|
|
541
|
-
var _this$obj10
|
|
542
|
+
var _this$obj10;
|
|
542
543
|
var k = checkKeys[index];
|
|
543
|
-
var v = ((_this$obj10 = this.obj) === null || _this$obj10 === void 0 ? void 0 : _this$obj10[k]) ||
|
|
544
|
+
var v = ((_this$obj10 = this.obj) === null || _this$obj10 === void 0 ? void 0 : _this$obj10[k]) || this.__last_object_data[k] || (objtype === null || objtype === void 0 ? void 0 : objtype[k]);
|
|
544
545
|
if (v) return v;
|
|
545
546
|
}
|
|
546
547
|
return "";
|
|
@@ -835,6 +836,19 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
835
836
|
}
|
|
836
837
|
return onAfterSave;
|
|
837
838
|
}()
|
|
839
|
+
/* -------------------------------------------------------------------------- */
|
|
840
|
+
/* get __object_type */
|
|
841
|
+
/* -------------------------------------------------------------------------- */
|
|
842
|
+
}, {
|
|
843
|
+
key: "getObjectType",
|
|
844
|
+
value: function getObjectType() {
|
|
845
|
+
return this.constructor["getObjectType"]();
|
|
846
|
+
}
|
|
847
|
+
}], [{
|
|
848
|
+
key: "getObjectType",
|
|
849
|
+
value: function getObjectType() {
|
|
850
|
+
return (0, _object.fn_eval)(this.__object_type);
|
|
851
|
+
}
|
|
838
852
|
}]);
|
|
839
853
|
}(_ObjectManager2["default"]);
|
|
840
854
|
_defineProperty(WebObjectManager, "__object_type", void 0);
|
|
@@ -10,7 +10,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> extends RawObje
|
|
|
10
10
|
__eventList: any;
|
|
11
11
|
__eventPrefix?: string;
|
|
12
12
|
__stopEvents?: boolean;
|
|
13
|
-
static readonly __object_type: ClassType<SimpleObject>;
|
|
13
|
+
static readonly __object_type: () => ClassType<SimpleObject>;
|
|
14
14
|
protected __last_object_data: {
|
|
15
15
|
[key: string]: string;
|
|
16
16
|
};
|
|
@@ -130,5 +130,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> extends RawObje
|
|
|
130
130
|
static addError(o?: ObjectManager<any>, title?: string, message?: string, sendToRegister?: boolean | "auto"): any[] | undefined;
|
|
131
131
|
static getErrors(o: ObjectManager<any>): any[];
|
|
132
132
|
static clearErrors(o: ObjectManager<any>): boolean;
|
|
133
|
+
getObjectType(): ClassType<SimpleObject>;
|
|
134
|
+
static getObjectType(): ClassType<SimpleObject>;
|
|
133
135
|
}
|
|
134
136
|
export default ObjectManager;
|
|
@@ -724,6 +724,14 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
|
724
724
|
//// return this.event_use("on_{change,save,load}", () => this.isChanged);
|
|
725
725
|
}
|
|
726
726
|
/* -------------------------------------------------------------------------- */
|
|
727
|
+
}, {
|
|
728
|
+
key: "getObjectType",
|
|
729
|
+
value: /* -------------------------------------------------------------------------- */
|
|
730
|
+
/* get __object_type */
|
|
731
|
+
/* -------------------------------------------------------------------------- */
|
|
732
|
+
function getObjectType() {
|
|
733
|
+
return this.constructor["getObjectType"]();
|
|
734
|
+
}
|
|
727
735
|
}], [{
|
|
728
736
|
key: "events_clear",
|
|
729
737
|
value: function events_clear(obj) {
|
|
@@ -755,6 +763,11 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
|
|
|
755
763
|
value: function clearErrors(o) {
|
|
756
764
|
return _SimpleObject["default"].clearErrors(o.obj);
|
|
757
765
|
}
|
|
766
|
+
}, {
|
|
767
|
+
key: "getObjectType",
|
|
768
|
+
value: function getObjectType() {
|
|
769
|
+
return (0, _object.fn_eval)(this.__object_type);
|
|
770
|
+
}
|
|
758
771
|
}]);
|
|
759
772
|
}(_MapableObject["default"]);
|
|
760
773
|
_defineProperty(ObjectManager, "__object_type", void 0);
|