@azrico/webobject 1.2.26 → 1.2.28
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,9 +3,7 @@ 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
|
-
get __children(): WebObject[] | undefined;
|
|
9
|
-
set __children(val: WebObject[] | undefined);
|
|
6
|
+
__children: WebObject[] | undefined;
|
|
7
|
+
set_children(val: WebObject[] | undefined): void;
|
|
10
8
|
}
|
|
11
9
|
export default ParentWebObject;
|
|
@@ -31,24 +31,8 @@ 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 _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
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
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; }
|
|
39
35
|
|
|
40
|
-
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
|
41
|
-
|
|
42
|
-
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; } }
|
|
43
|
-
|
|
44
|
-
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
|
45
|
-
|
|
46
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
|
47
|
-
|
|
48
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
|
49
|
-
|
|
50
|
-
var _children_items = /*#__PURE__*/new WeakMap();
|
|
51
|
-
|
|
52
36
|
/**
|
|
53
37
|
* This web object contains some more webobjects
|
|
54
38
|
*/
|
|
@@ -68,23 +52,22 @@ var ParentWebObject = /*#__PURE__*/function (_WebObject) {
|
|
|
68
52
|
|
|
69
53
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
70
54
|
|
|
71
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
72
|
-
|
|
73
|
-
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _children_items, {
|
|
74
|
-
writable: true,
|
|
75
|
-
value: undefined
|
|
76
|
-
});
|
|
55
|
+
_defineProperty(_assertThisInitialized(_this), "__children", undefined);
|
|
77
56
|
|
|
78
57
|
return _this;
|
|
79
58
|
}
|
|
80
59
|
|
|
81
60
|
_createClass(ParentWebObject, [{
|
|
82
|
-
key: "
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
61
|
+
key: "set_children",
|
|
62
|
+
value: function set_children(val) {
|
|
63
|
+
if (Array.isArray(val)) {
|
|
64
|
+
var selftableid = this.__table_id;
|
|
65
|
+
val.forEach(function (v) {
|
|
66
|
+
v.__parent__table_id = selftableid;
|
|
67
|
+
});
|
|
68
|
+
} else val = [];
|
|
69
|
+
|
|
70
|
+
this.__children = val;
|
|
88
71
|
}
|
|
89
72
|
}]);
|
|
90
73
|
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.MapableObject = void 0;
|
|
7
7
|
|
|
8
|
-
var _object = require("@azrico/object");
|
|
9
|
-
|
|
10
8
|
var _ObjectArray = _interopRequireDefault(require("./ObjectArray"));
|
|
11
9
|
|
|
10
|
+
var _object = require("@azrico/object");
|
|
11
|
+
|
|
12
12
|
var _string = require("@azrico/string");
|
|
13
13
|
|
|
14
14
|
var _uid = require("@azrico/uid");
|
|
@@ -38,9 +38,12 @@ var MapableObject = /*#__PURE__*/function () {
|
|
|
38
38
|
|
|
39
39
|
_defineProperty(this, "__table_id", void 0);
|
|
40
40
|
|
|
41
|
+
_defineProperty(this, "__parent__table_id", void 0);
|
|
42
|
+
|
|
41
43
|
_defineProperty(this, "__row_number", void 0);
|
|
42
44
|
|
|
43
45
|
this.__uid = _uid.uid.localuid();
|
|
46
|
+
this.__table_id = this.__uid;
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
_createClass(MapableObject, [{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azrico/webobject",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.28",
|
|
4
4
|
"description": "Stateful object",
|
|
5
5
|
"author": "Azrideus",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@azrico/event": "^1",
|
|
73
73
|
"@azrico/global": "^1",
|
|
74
|
-
"@azrico/object": "^1.
|
|
74
|
+
"@azrico/object": "^1.4.4",
|
|
75
75
|
"@azrico/string": "^1",
|
|
76
76
|
"@azrico/uid": "^1"
|
|
77
77
|
}
|