@azrico/webobject 1.2.22 → 1.2.23
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.
|
@@ -32,7 +32,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> {
|
|
|
32
32
|
get __cache_name(): string;
|
|
33
33
|
getSaveResult(): any;
|
|
34
34
|
getSaveResultType(): saveResultType | null;
|
|
35
|
-
setSaveResult(toObj: any, type: saveResultType):
|
|
35
|
+
setSaveResult(toObj: any, type: saveResultType): void | undefined;
|
|
36
36
|
apply_changes(): false | undefined;
|
|
37
37
|
getValue(key: PropOf<ObjType>, original?: boolean): NonNullable<ObjType>[any] | undefined;
|
|
38
38
|
get: (key: PropOf<ObjType>, original?: boolean) => NonNullable<ObjType>[any] | undefined;
|
|
@@ -200,7 +200,9 @@ var ObjectManager = /*#__PURE__*/function () {
|
|
|
200
200
|
}, {
|
|
201
201
|
key: "setSaveResult",
|
|
202
202
|
value: function setSaveResult(toObj, type) {
|
|
203
|
-
|
|
203
|
+
var _this$getObject3;
|
|
204
|
+
|
|
205
|
+
return (_this$getObject3 = this.getObject()) === null || _this$getObject3 === void 0 ? void 0 : _this$getObject3.setSaveResult(toObj, type);
|
|
204
206
|
}
|
|
205
207
|
}, {
|
|
206
208
|
key: "apply_changes",
|
|
@@ -25,7 +25,7 @@ export declare class SimpleObject extends MapableObject {
|
|
|
25
25
|
__showErrors?: boolean;
|
|
26
26
|
__saveResultObject?: any;
|
|
27
27
|
__saveResultIsSuccess?: boolean;
|
|
28
|
-
__saveResultType
|
|
28
|
+
__saveResultType?: saveResultType;
|
|
29
29
|
_index_key: string;
|
|
30
30
|
_index_value: number;
|
|
31
31
|
constructor(is_readonly?: boolean);
|
|
@@ -99,10 +99,20 @@ export declare class SimpleObject extends MapableObject {
|
|
|
99
99
|
static addError(o?: SimpleObject, title?: string, message?: string, sendToRegister?: boolean | "auto"): any[] | undefined;
|
|
100
100
|
static getErrors(o: SimpleObject): any[];
|
|
101
101
|
static clearErrors(o: SimpleObject): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Checks if the given object is a valid and truthy save result
|
|
104
|
+
* @param result_object
|
|
105
|
+
* @returns
|
|
106
|
+
*/
|
|
102
107
|
static isResultValid(result_object: any): any;
|
|
103
|
-
|
|
108
|
+
/**
|
|
109
|
+
* set the response of last save from site
|
|
110
|
+
* and its type
|
|
111
|
+
* @param toObj
|
|
112
|
+
*/
|
|
113
|
+
setSaveResult(toObj: any, type: saveResultType | "auto"): void;
|
|
104
114
|
getSaveResult(): any;
|
|
105
|
-
getSaveResultType(): saveResultType
|
|
115
|
+
getSaveResultType(): saveResultType;
|
|
106
116
|
static factoryClear(obj: SimpleObject): void;
|
|
107
117
|
static delete_cache(): void;
|
|
108
118
|
static get_canModify(o: SimpleObject): boolean;
|
|
@@ -125,7 +125,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
125
125
|
|
|
126
126
|
_defineProperty(_assertThisInitialized(_this), "__saveResultIsSuccess", void 0);
|
|
127
127
|
|
|
128
|
-
_defineProperty(_assertThisInitialized(_this), "__saveResultType",
|
|
128
|
+
_defineProperty(_assertThisInitialized(_this), "__saveResultType", void 0);
|
|
129
129
|
|
|
130
130
|
_defineProperty(_assertThisInitialized(_this), "_index_key", "");
|
|
131
131
|
|
|
@@ -683,19 +683,33 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
683
683
|
}
|
|
684
684
|
}, {
|
|
685
685
|
key: "setSaveResult",
|
|
686
|
-
value:
|
|
687
|
-
|
|
686
|
+
value:
|
|
687
|
+
/**
|
|
688
|
+
* set the response of last save from site
|
|
689
|
+
* and its type
|
|
690
|
+
* @param toObj
|
|
691
|
+
*/
|
|
692
|
+
function setSaveResult(toObj, type) {
|
|
693
|
+
if (toObj != null) {
|
|
694
|
+
_classPrivateMethodGet(this, _setSaveResultObject, _setSaveResultObject2).call(this, toObj);
|
|
695
|
+
} else {
|
|
696
|
+
_classPrivateMethodGet(this, _setSaveResultObject, _setSaveResultObject2).call(this, null);
|
|
697
|
+
} //check if the given object is a valid save result
|
|
688
698
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
}
|
|
699
|
+
|
|
700
|
+
this.__saveResultIsSuccess = Boolean(type === "nothing" || this.constructor["isResultValid"](toObj));
|
|
701
|
+
|
|
702
|
+
if (type === "auto") {
|
|
703
|
+
type = this.__saveResultIsSuccess ? "normal" : "error";
|
|
695
704
|
}
|
|
696
705
|
|
|
697
|
-
this.
|
|
706
|
+
this.__saveResultType = type;
|
|
698
707
|
}
|
|
708
|
+
/**
|
|
709
|
+
* set the response of last save from site
|
|
710
|
+
* @param toObj
|
|
711
|
+
*/
|
|
712
|
+
|
|
699
713
|
}, {
|
|
700
714
|
key: "getSaveResult",
|
|
701
715
|
value: function getSaveResult() {
|
|
@@ -705,7 +719,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
705
719
|
}, {
|
|
706
720
|
key: "getSaveResultType",
|
|
707
721
|
value: function getSaveResultType() {
|
|
708
|
-
return this.__saveResultType ||
|
|
722
|
+
return this.__saveResultType || "nothing";
|
|
709
723
|
}
|
|
710
724
|
/* -------------------------------------------------------------------------- */
|
|
711
725
|
|
|
@@ -915,6 +929,12 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
915
929
|
|
|
916
930
|
/* -------------------------------------------------------------------------- */
|
|
917
931
|
|
|
932
|
+
/**
|
|
933
|
+
* Checks if the given object is a valid and truthy save result
|
|
934
|
+
* @param result_object
|
|
935
|
+
* @returns
|
|
936
|
+
*/
|
|
937
|
+
|
|
918
938
|
}, {
|
|
919
939
|
key: "isResultValid",
|
|
920
940
|
value: function isResultValid(result_object) {
|