@azrico/webobject 1.2.20 → 1.2.22

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.
@@ -63,8 +63,9 @@ export declare class WebObject extends SimpleObject {
63
63
  get_deltaObject(p?: deltaParams): Promise<any>;
64
64
  get __web_path(): string;
65
65
  get __web_type(): string;
66
- get_type: () => string;
66
+ get_webtype: () => string;
67
67
  get_webpath: () => string;
68
+ static get_webname(): string | undefined;
68
69
  get manager(): WebObjectManager<any> | null;
69
70
  get_managerClass: () => WebObjectManager<any> | null;
70
71
  onLoad(...p: any): Promise<any>;
@@ -73,7 +73,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
73
73
 
74
74
  _defineProperty(_assertThisInitialized(_this), "_created_date", "");
75
75
 
76
- _defineProperty(_assertThisInitialized(_this), "get_type", function () {
76
+ _defineProperty(_assertThisInitialized(_this), "get_webtype", function () {
77
77
  return _this.__web_type || _this.get_webpath();
78
78
  });
79
79
 
@@ -608,6 +608,11 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
608
608
 
609
609
  return false;
610
610
  }
611
+ }, {
612
+ key: "get_webname",
613
+ value: function get_webname() {
614
+ return this.__web_path || this.__web_type || this.__cache_name;
615
+ }
611
616
  }, {
612
617
  key: "get_single",
613
618
  value: function () {
@@ -16,6 +16,7 @@ export declare class SimpleObject extends MapableObject {
16
16
  _static(): Function;
17
17
  __originalobject?: this;
18
18
  __delta: Partial<this>;
19
+ __temp: any;
19
20
  __changed: boolean;
20
21
  __lastChanged: string;
21
22
  __is_readonly: boolean;
@@ -33,6 +34,7 @@ export declare class SimpleObject extends MapableObject {
33
34
  static getValue<T extends SimpleObject, MKey extends PropOf<T>>(o: T, key: MKey, original?: boolean): PropType<T, MKey> | undefined;
34
35
  getValue: <MKey extends keyof this>(key: MKey, original?: boolean) => PropType<this, MKey>;
35
36
  get: <MKey extends keyof this>(key: MKey, original?: boolean) => PropType<this, MKey>;
37
+ getTemp: (key: string) => any;
36
38
  /**
37
39
  * set value
38
40
  * @param key
@@ -41,6 +43,7 @@ export declare class SimpleObject extends MapableObject {
41
43
  */
42
44
  setValue(key: WriteablePropOf<this>, value: any, sendChanges?: sendChangesType): Promise<boolean>;
43
45
  set: (key: WriteablePropOf<this>, value: any, sendChanges?: sendChangesType) => Promise<boolean>;
46
+ setTemp: (key: string, value: any) => any;
44
47
  setDefaultValue(key: WriteablePropOf<this>, value: any): boolean;
45
48
  setDefault: (key: WriteablePropOf<this>, value: any) => boolean;
46
49
  /**
@@ -59,6 +62,7 @@ export declare class SimpleObject extends MapableObject {
59
62
  */
60
63
  apply_changes(): false | undefined;
61
64
  clear_changes(): void;
65
+ clear_cache(): void;
62
66
  /**
63
67
  * Sets readonly property on given objects
64
68
  * @param objs array of given objects or a single object
@@ -67,6 +67,10 @@ var _setDefaultProperty = /*#__PURE__*/new WeakSet();
67
67
 
68
68
  var _getProperty = /*#__PURE__*/new WeakSet();
69
69
 
70
+ var _getTempProperty = /*#__PURE__*/new WeakSet();
71
+
72
+ var _setTempProperty = /*#__PURE__*/new WeakSet();
73
+
70
74
  var _setSaveResultObject = /*#__PURE__*/new WeakSet();
71
75
 
72
76
  var SimpleObject = /*#__PURE__*/function (_MapableObject) {
@@ -85,6 +89,10 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
85
89
 
86
90
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _setSaveResultObject);
87
91
 
92
+ _classPrivateMethodInitSpec(_assertThisInitialized(_this), _setTempProperty);
93
+
94
+ _classPrivateMethodInitSpec(_assertThisInitialized(_this), _getTempProperty);
95
+
88
96
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _getProperty);
89
97
 
90
98
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _setDefaultProperty);
@@ -99,6 +107,8 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
99
107
 
100
108
  _defineProperty(_assertThisInitialized(_this), "__delta", void 0);
101
109
 
110
+ _defineProperty(_assertThisInitialized(_this), "__temp", void 0);
111
+
102
112
  _defineProperty(_assertThisInitialized(_this), "__changed", false);
103
113
 
104
114
  _defineProperty(_assertThisInitialized(_this), "__lastChanged", "");
@@ -125,8 +135,12 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
125
135
 
126
136
  _defineProperty(_assertThisInitialized(_this), "get", _classPrivateMethodGet(_assertThisInitialized(_this), _getProperty, _getProperty2));
127
137
 
138
+ _defineProperty(_assertThisInitialized(_this), "getTemp", _classPrivateMethodGet(_assertThisInitialized(_this), _getTempProperty, _getTempProperty2));
139
+
128
140
  _defineProperty(_assertThisInitialized(_this), "set", _this.setValue);
129
141
 
142
+ _defineProperty(_assertThisInitialized(_this), "setTemp", _classPrivateMethodGet(_assertThisInitialized(_this), _setTempProperty, _setTempProperty2));
143
+
130
144
  _defineProperty(_assertThisInitialized(_this), "setDefault", _this.setDefaultValue);
131
145
 
132
146
  _defineProperty(_assertThisInitialized(_this), "get_managerClass", function () {
@@ -134,6 +148,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
134
148
  });
135
149
 
136
150
  _this.__delta = {};
151
+ _this.__temp = {};
137
152
  _this.__is_readonly = is_readonly;
138
153
  _this.__throw_errors = true;
139
154
 
@@ -498,6 +513,11 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
498
513
  this.__delta = {};
499
514
  this.__changed = false;
500
515
  }
516
+ }, {
517
+ key: "clear_cache",
518
+ value: function clear_cache() {
519
+ this.__temp = {};
520
+ }
501
521
  /**
502
522
  * Sets readonly property on given objects
503
523
  * @param objs array of given objects or a single object
@@ -1010,6 +1030,16 @@ function _getProperty2(key) {
1010
1030
  return this[key];
1011
1031
  }
1012
1032
 
1033
+ function _getTempProperty2(key) {
1034
+ if (!this.__temp) return undefined;
1035
+ return this.__temp[key];
1036
+ }
1037
+
1038
+ function _setTempProperty2(key, value) {
1039
+ if (!this.__temp) this.__temp = {};
1040
+ this.__temp[key] = value;
1041
+ }
1042
+
1013
1043
  function _setSaveResultObject2(toObj) {
1014
1044
  this.__saveResultObject = toObj;
1015
1045
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",