@azrico/webobject 1.2.27 → 1.2.29
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.
|
@@ -3,8 +3,8 @@ import WebObject from "./WebObject";
|
|
|
3
3
|
* This web object contains some more webobjects
|
|
4
4
|
*/
|
|
5
5
|
export declare class ParentWebObject extends WebObject {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
constructor(is_readonly?: boolean);
|
|
7
|
+
__children: WebObject[] | undefined;
|
|
8
|
+
set_children(val: WebObject[] | undefined): void;
|
|
9
9
|
}
|
|
10
10
|
export default ParentWebObject;
|
|
@@ -31,21 +31,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
31
31
|
|
|
32
32
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
33
|
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
37
|
-
|
|
38
|
-
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
|
39
|
-
|
|
40
|
-
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
|
41
|
-
|
|
42
|
-
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
|
43
|
-
|
|
44
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
|
45
|
-
|
|
46
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
|
47
|
-
|
|
48
|
-
var _children_items = /*#__PURE__*/new WeakMap();
|
|
34
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
49
35
|
|
|
50
36
|
/**
|
|
51
37
|
* This web object contains some more webobjects
|
|
@@ -58,28 +44,20 @@ var ParentWebObject = /*#__PURE__*/function (_WebObject) {
|
|
|
58
44
|
function ParentWebObject() {
|
|
59
45
|
var _this;
|
|
60
46
|
|
|
61
|
-
|
|
47
|
+
var is_readonly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
62
48
|
|
|
63
|
-
|
|
64
|
-
args[_key] = arguments[_key];
|
|
65
|
-
}
|
|
49
|
+
_classCallCheck(this, ParentWebObject);
|
|
66
50
|
|
|
67
|
-
_this = _super.call
|
|
51
|
+
_this = _super.call(this, is_readonly);
|
|
68
52
|
|
|
69
|
-
|
|
70
|
-
writable: true,
|
|
71
|
-
value: undefined
|
|
72
|
-
});
|
|
53
|
+
_defineProperty(_assertThisInitialized(_this), "__children", undefined);
|
|
73
54
|
|
|
74
55
|
return _this;
|
|
75
56
|
}
|
|
76
57
|
|
|
77
58
|
_createClass(ParentWebObject, [{
|
|
78
|
-
key: "
|
|
79
|
-
|
|
80
|
-
return _classPrivateFieldGet(this, _children_items);
|
|
81
|
-
},
|
|
82
|
-
set: function set(val) {
|
|
59
|
+
key: "set_children",
|
|
60
|
+
value: function set_children(val) {
|
|
83
61
|
if (Array.isArray(val)) {
|
|
84
62
|
var selftableid = this.__table_id;
|
|
85
63
|
val.forEach(function (v) {
|
|
@@ -87,7 +65,7 @@ var ParentWebObject = /*#__PURE__*/function (_WebObject) {
|
|
|
87
65
|
});
|
|
88
66
|
} else val = [];
|
|
89
67
|
|
|
90
|
-
|
|
68
|
+
this.__children = val;
|
|
91
69
|
}
|
|
92
70
|
}]);
|
|
93
71
|
|
|
@@ -114,8 +114,13 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
114
114
|
if (this.__throw_errors) throw Error("Cant use setMetaValue on ".concat(key, " when on readonly mode"));else return false;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
if (!key || typeof key != "string") {
|
|
118
|
+
if (this.__throw_errors) throw Error("Bad key at setMetaValue");else return false;
|
|
119
|
+
}
|
|
120
|
+
|
|
117
121
|
var old_value = WebObject.getMetaValue(this, key);
|
|
118
|
-
if ((0, _object.object_equals)(old_value, value)) return false;
|
|
122
|
+
if ((0, _object.object_equals)(old_value, value)) return false; //same value, no changes
|
|
123
|
+
|
|
119
124
|
var old_metalist = (0, _object.to_array)(this.getValue("meta_data")).map(function (s) {
|
|
120
125
|
return (0, _object.object_shallow_clone)(s);
|
|
121
126
|
});
|
|
@@ -575,6 +580,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
575
580
|
key: "getMeta",
|
|
576
581
|
value: function getMeta(o, key) {
|
|
577
582
|
if (o == null) return null;
|
|
583
|
+
if (!key || typeof key != "string") return undefined;
|
|
578
584
|
var metalist = [];
|
|
579
585
|
|
|
580
586
|
if (_typeof(o) === "object") {
|