@azrico/webobject 1.4.171 → 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.
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ClassType } from "@azrico/types";
|
|
2
2
|
import { WebObject, sendChangesType } from "../index";
|
|
3
3
|
import ObjectManager from "../structs/ObjectManager";
|
|
4
|
-
import { RunnableOrValue } from "@azrico/object";
|
|
5
4
|
/**
|
|
6
5
|
* This class manages the events of an Simple Object
|
|
7
6
|
*/
|
|
8
7
|
export declare class WebObjectManager<T extends WebObject> extends ObjectManager<T> {
|
|
9
|
-
static readonly __object_type:
|
|
8
|
+
static readonly __object_type: () => ClassType<WebObject>;
|
|
10
9
|
static readonly __save_message: boolean;
|
|
11
10
|
constructor(defaultObject?: T);
|
|
12
11
|
setObject(toObj: T | undefined): boolean;
|
|
@@ -62,6 +61,7 @@ export declare class WebObjectManager<T extends WebObject> extends ObjectManager
|
|
|
62
61
|
*/
|
|
63
62
|
onSave(...p: any): Promise<any>;
|
|
64
63
|
onAfterSave(...p: any): Promise<any>;
|
|
64
|
+
getObjectType(): ClassType<WebObject>;
|
|
65
65
|
static getObjectType(): ClassType<WebObject>;
|
|
66
66
|
}
|
|
67
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 "";
|
|
@@ -834,7 +835,15 @@ var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_Object
|
|
|
834
835
|
return _onAfterSave.apply(this, arguments);
|
|
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
|
+
}
|
|
838
847
|
}], [{
|
|
839
848
|
key: "getObjectType",
|
|
840
849
|
value: function getObjectType() {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PropOf, WriteablePropOf } from "@azrico/types";
|
|
2
2
|
import SimpleObject, { WithManager } from "./SimpleObject";
|
|
3
|
-
import { RunnableOrValue } from "@azrico/object";
|
|
4
3
|
import { saveResultType, sendChangesType } from "./SimpleObject";
|
|
5
4
|
import { ClassType } from "@azrico/types";
|
|
6
5
|
import RawObject from "./MapableObject";
|
|
@@ -11,7 +10,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> extends RawObje
|
|
|
11
10
|
__eventList: any;
|
|
12
11
|
__eventPrefix?: string;
|
|
13
12
|
__stopEvents?: boolean;
|
|
14
|
-
static readonly __object_type:
|
|
13
|
+
static readonly __object_type: () => ClassType<SimpleObject>;
|
|
15
14
|
protected __last_object_data: {
|
|
16
15
|
[key: string]: string;
|
|
17
16
|
};
|
|
@@ -131,6 +130,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> extends RawObje
|
|
|
131
130
|
static addError(o?: ObjectManager<any>, title?: string, message?: string, sendToRegister?: boolean | "auto"): any[] | undefined;
|
|
132
131
|
static getErrors(o: ObjectManager<any>): any[];
|
|
133
132
|
static clearErrors(o: ObjectManager<any>): boolean;
|
|
133
|
+
getObjectType(): ClassType<SimpleObject>;
|
|
134
134
|
static getObjectType(): ClassType<SimpleObject>;
|
|
135
135
|
}
|
|
136
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) {
|