vsn 0.1.26 → 0.1.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.
- package/demo/vsn.js +1 -1
- package/dist/AST/ArithmeticAssignmentNode.d.ts +23 -0
- package/dist/AST/ArithmeticAssignmentNode.js +313 -0
- package/dist/AST/ArithmeticAssignmentNode.js.map +1 -0
- package/dist/AST/ArithmeticNode.d.ts +15 -0
- package/dist/AST/ArithmeticNode.js +114 -0
- package/dist/AST/ArithmeticNode.js.map +1 -0
- package/dist/AST/ArrayNode.d.ts +14 -0
- package/dist/AST/ArrayNode.js +114 -0
- package/dist/AST/ArrayNode.js.map +1 -0
- package/dist/AST/BlockNode.d.ts +11 -0
- package/dist/AST/BlockNode.js +98 -0
- package/dist/AST/BlockNode.js.map +1 -0
- package/dist/AST/BooleanLiteralNode.d.ts +5 -0
- package/dist/AST/BooleanLiteralNode.js +31 -0
- package/dist/AST/BooleanLiteralNode.js.map +1 -0
- package/dist/AST/ComparisonNode.d.ts +15 -0
- package/dist/AST/ComparisonNode.js +120 -0
- package/dist/AST/ComparisonNode.js.map +1 -0
- package/dist/AST/ConditionalNode.d.ts +13 -0
- package/dist/AST/ConditionalNode.js +95 -0
- package/dist/AST/ConditionalNode.js.map +1 -0
- package/dist/AST/ElementAttributeNode.d.ts +18 -0
- package/dist/AST/ElementAttributeNode.js +159 -0
- package/dist/AST/ElementAttributeNode.js.map +1 -0
- package/dist/AST/ElementQueryNode.d.ts +12 -0
- package/dist/AST/ElementQueryNode.js +111 -0
- package/dist/AST/ElementQueryNode.js.map +1 -0
- package/dist/AST/ElementStyleNode.d.ts +18 -0
- package/dist/AST/ElementStyleNode.js +159 -0
- package/dist/AST/ElementStyleNode.js.map +1 -0
- package/dist/AST/ForStatementNode.d.ts +17 -0
- package/dist/AST/ForStatementNode.js +121 -0
- package/dist/AST/ForStatementNode.js.map +1 -0
- package/dist/AST/FunctionArgumentNode.d.ts +11 -0
- package/dist/AST/FunctionArgumentNode.js +100 -0
- package/dist/AST/FunctionArgumentNode.js.map +1 -0
- package/dist/AST/FunctionCallNode.d.ts +13 -0
- package/dist/AST/FunctionCallNode.js +102 -0
- package/dist/AST/FunctionCallNode.js.map +1 -0
- package/dist/AST/IfStatementNode.d.ts +14 -0
- package/dist/AST/IfStatementNode.js +128 -0
- package/dist/AST/IfStatementNode.js.map +1 -0
- package/dist/AST/InNode.d.ts +15 -0
- package/dist/AST/InNode.js +107 -0
- package/dist/AST/InNode.js.map +1 -0
- package/dist/AST/IndexNode.d.ts +16 -0
- package/dist/AST/IndexNode.js +126 -0
- package/dist/AST/IndexNode.js.map +1 -0
- package/dist/AST/LiteralNode.d.ts +10 -0
- package/dist/AST/LiteralNode.js +74 -0
- package/dist/AST/LiteralNode.js.map +1 -0
- package/dist/AST/Node.d.ts +19 -0
- package/dist/AST/Node.js +117 -0
- package/dist/AST/Node.js.map +1 -0
- package/dist/AST/NotNode.d.ts +12 -0
- package/dist/AST/NotNode.js +103 -0
- package/dist/AST/NotNode.js.map +1 -0
- package/dist/AST/NumberLiteralNode.d.ts +5 -0
- package/dist/AST/NumberLiteralNode.js +36 -0
- package/dist/AST/NumberLiteralNode.js.map +1 -0
- package/dist/AST/ObjectNode.d.ts +14 -0
- package/dist/AST/ObjectNode.js +131 -0
- package/dist/AST/ObjectNode.js.map +1 -0
- package/dist/AST/RootScopeMemberNode.d.ts +11 -0
- package/dist/AST/RootScopeMemberNode.js +87 -0
- package/dist/AST/RootScopeMemberNode.js.map +1 -0
- package/dist/AST/ScopeMemberNode.d.ts +12 -0
- package/dist/AST/ScopeMemberNode.js +128 -0
- package/dist/AST/ScopeMemberNode.js.map +1 -0
- package/dist/AST/UnitLiteralNode.d.ts +15 -0
- package/dist/AST/UnitLiteralNode.js +72 -0
- package/dist/AST/UnitLiteralNode.js.map +1 -0
- package/dist/AST.d.ts +7 -60
- package/dist/AST.js +778 -0
- package/dist/AST.js.map +1 -0
- package/dist/Attribute.d.ts +1 -1
- package/dist/Attribute.js +187 -0
- package/dist/Attribute.js.map +1 -0
- package/dist/Bencmark.js +179 -0
- package/dist/Bencmark.js.map +1 -0
- package/dist/Configuration.d.ts +1 -1
- package/dist/Configuration.js +64 -0
- package/dist/Configuration.js.map +1 -0
- package/dist/Controller.d.ts +4 -2
- package/dist/Controller.js +62 -0
- package/dist/Controller.js.map +1 -0
- package/dist/DOM/DOMObject.d.ts +1 -1
- package/dist/DOM/DOMObject.js +47 -0
- package/dist/DOM/DOMObject.js.map +1 -0
- package/dist/DOM/WrappedDocument.js +34 -0
- package/dist/DOM/WrappedDocument.js.map +1 -0
- package/dist/DOM/WrappedWindow.js +45 -0
- package/dist/DOM/WrappedWindow.js.map +1 -0
- package/dist/DOM.d.ts +1 -1
- package/dist/DOM.js +547 -0
- package/dist/DOM.js.map +1 -0
- package/dist/EventDispatcher.d.ts +29 -0
- package/dist/EventDispatcher.js +132 -0
- package/dist/EventDispatcher.js.map +1 -0
- package/dist/Formats.js +44 -0
- package/dist/Formats.js.map +1 -0
- package/dist/MessageList.d.ts +15 -0
- package/dist/MessageList.js +96 -0
- package/dist/MessageList.js.map +1 -0
- package/dist/Model/Field.d.ts +8 -0
- package/dist/Model/Field.js +38 -0
- package/dist/Model/Field.js.map +1 -0
- package/dist/Model.d.ts +12 -0
- package/dist/Model.js +61 -0
- package/dist/Model.js.map +1 -0
- package/dist/Query.js +66 -0
- package/dist/Query.js.map +1 -0
- package/dist/Registry.d.ts +5 -2
- package/dist/Registry.js +139 -0
- package/dist/Registry.js.map +1 -0
- package/dist/Scope/DynamicScopeData.d.ts +6 -0
- package/dist/Scope/DynamicScopeData.js +54 -0
- package/dist/Scope/DynamicScopeData.js.map +1 -0
- package/dist/Scope/QueryReference.d.ts +10 -0
- package/dist/Scope/QueryReference.js +103 -0
- package/dist/Scope/QueryReference.js.map +1 -0
- package/dist/Scope/ScopeData.d.ts +4 -0
- package/dist/Scope/ScopeData.js +40 -0
- package/dist/Scope/ScopeData.js.map +1 -0
- package/dist/Scope/ScopeDataAbstract.d.ts +22 -0
- package/dist/Scope/ScopeDataAbstract.js +137 -0
- package/dist/Scope/ScopeDataAbstract.js.map +1 -0
- package/dist/Scope/ScopeReference.d.ts +10 -0
- package/dist/Scope/ScopeReference.js +73 -0
- package/dist/Scope/ScopeReference.js.map +1 -0
- package/dist/Scope/ScopedVariableType.d.ts +6 -0
- package/dist/Scope/ScopedVariableType.js +14 -0
- package/dist/Scope/ScopedVariableType.js.map +1 -0
- package/dist/Scope/WrappedArray.d.ts +16 -0
- package/dist/Scope/WrappedArray.js +121 -0
- package/dist/Scope/WrappedArray.js.map +1 -0
- package/dist/Scope/properties/Property.d.ts +18 -0
- package/dist/Scope/properties/Property.js +93 -0
- package/dist/Scope/properties/Property.js.map +1 -0
- package/dist/Scope.d.ts +4 -48
- package/dist/Scope.js +227 -0
- package/dist/Scope.js.map +1 -0
- package/dist/SimplePromise.d.ts +42 -0
- package/dist/SimplePromise.js +217 -0
- package/dist/SimplePromise.js.map +1 -0
- package/dist/Tag/List.js +85 -0
- package/dist/Tag/List.js.map +1 -0
- package/dist/Tag.js +770 -0
- package/dist/Tag.js.map +1 -0
- package/dist/Types.d.ts +1 -0
- package/dist/Types.js +54 -0
- package/dist/Types.js.map +1 -0
- package/dist/Validators.d.ts +7 -0
- package/dist/Validators.js +54 -0
- package/dist/Validators.js.map +1 -0
- package/dist/attributes/AddClassIf.js +93 -0
- package/dist/attributes/AddClassIf.js.map +1 -0
- package/dist/attributes/Bind.js +272 -0
- package/dist/attributes/Bind.js.map +1 -0
- package/dist/attributes/ClassConstructor.d.ts +1 -0
- package/dist/attributes/ClassConstructor.js +104 -0
- package/dist/attributes/ClassConstructor.js.map +1 -0
- package/dist/attributes/ClickRemoveClass.js +114 -0
- package/dist/attributes/ClickRemoveClass.js.map +1 -0
- package/dist/attributes/ClickToggleClass.js +114 -0
- package/dist/attributes/ClickToggleClass.js.map +1 -0
- package/dist/attributes/ControllerAttribute.js +28 -0
- package/dist/attributes/ControllerAttribute.js.map +1 -0
- package/dist/attributes/DisableIf.js +94 -0
- package/dist/attributes/DisableIf.js.map +1 -0
- package/dist/attributes/Exec.js +108 -0
- package/dist/attributes/Exec.js.map +1 -0
- package/dist/attributes/Format.js +99 -0
- package/dist/attributes/Format.js.map +1 -0
- package/dist/attributes/If.js +159 -0
- package/dist/attributes/If.js.map +1 -0
- package/dist/attributes/JSONAttribute.js +118 -0
- package/dist/attributes/JSONAttribute.js.map +1 -0
- package/dist/attributes/KeyAbstract.js +117 -0
- package/dist/attributes/KeyAbstract.js.map +1 -0
- package/dist/attributes/KeyDown.js +88 -0
- package/dist/attributes/KeyDown.js.map +1 -0
- package/dist/attributes/KeyUp.js +88 -0
- package/dist/attributes/KeyUp.js.map +1 -0
- package/dist/attributes/List.js +282 -0
- package/dist/attributes/List.js.map +1 -0
- package/dist/attributes/ListItem.js +138 -0
- package/dist/attributes/ListItem.js.map +1 -0
- package/dist/attributes/ListItemModel.js +39 -0
- package/dist/attributes/ListItemModel.js.map +1 -0
- package/dist/attributes/ModelAttribute.js +29 -0
- package/dist/attributes/ModelAttribute.js.map +1 -0
- package/dist/attributes/Name.js +88 -0
- package/dist/attributes/Name.js.map +1 -0
- package/dist/attributes/On.js +135 -0
- package/dist/attributes/On.js.map +1 -0
- package/dist/attributes/Radio.js +174 -0
- package/dist/attributes/Radio.js.map +1 -0
- package/dist/attributes/Referenced.js +38 -0
- package/dist/attributes/Referenced.js.map +1 -0
- package/dist/attributes/RootAttribute.js +91 -0
- package/dist/attributes/RootAttribute.js.map +1 -0
- package/dist/attributes/ScopeAttribute.js +40 -0
- package/dist/attributes/ScopeAttribute.js.map +1 -0
- package/dist/attributes/ScopeChange.js +130 -0
- package/dist/attributes/ScopeChange.js.map +1 -0
- package/dist/attributes/SetAttribute.js +133 -0
- package/dist/attributes/SetAttribute.js.map +1 -0
- package/dist/attributes/StandardAttribute.js +186 -0
- package/dist/attributes/StandardAttribute.js.map +1 -0
- package/dist/attributes/StyleAttribute.js +183 -0
- package/dist/attributes/StyleAttribute.js.map +1 -0
- package/dist/attributes/Template.js +39 -0
- package/dist/attributes/Template.js.map +1 -0
- package/dist/attributes/TypeAttribute.js +104 -0
- package/dist/attributes/TypeAttribute.js.map +1 -0
- package/dist/attributes/_imports.js +60 -0
- package/dist/attributes/_imports.js.map +1 -0
- package/dist/helpers/DOMHelper.js +81 -0
- package/dist/helpers/DOMHelper.js.map +1 -0
- package/dist/helpers/ElementHelper.js +25 -0
- package/dist/helpers/ElementHelper.js.map +1 -0
- package/dist/helpers/VisionHelper.js +71 -0
- package/dist/helpers/VisionHelper.js.map +1 -0
- package/dist/helpers/decorators.js +38 -0
- package/dist/helpers/decorators.js.map +1 -0
- package/dist/vsn.d.ts +11 -2
- package/dist/vsn.js +181 -0
- package/dist/vsn.js.map +1 -0
- package/package.json +2 -6
- package/src/AST/ArithmeticAssignmentNode.ts +236 -0
- package/src/AST/ArithmeticNode.ts +52 -0
- package/src/AST/ArrayNode.ts +39 -0
- package/src/AST/BlockNode.ts +25 -0
- package/src/AST/BooleanLiteralNode.ts +10 -0
- package/src/AST/ComparisonNode.ts +57 -0
- package/src/AST/ConditionalNode.ts +36 -0
- package/src/AST/ElementAttributeNode.ts +63 -0
- package/src/AST/ElementQueryNode.ts +25 -0
- package/src/AST/ElementStyleNode.ts +63 -0
- package/src/AST/ForStatementNode.ts +59 -0
- package/src/AST/FunctionArgumentNode.ts +27 -0
- package/src/AST/FunctionCallNode.ts +32 -0
- package/src/AST/IfStatementNode.ts +67 -0
- package/src/AST/InNode.ts +46 -0
- package/src/AST/IndexNode.ts +61 -0
- package/src/AST/LiteralNode.ts +17 -0
- package/src/AST/Node.ts +71 -0
- package/src/AST/NotNode.ts +41 -0
- package/src/AST/NumberLiteralNode.ts +14 -0
- package/src/AST/ObjectNode.ts +55 -0
- package/src/AST/RootScopeMemberNode.ts +25 -0
- package/src/AST/ScopeMemberNode.ts +53 -0
- package/src/AST/UnitLiteralNode.ts +51 -0
- package/src/AST.ts +34 -1094
- package/src/Attribute.ts +2 -2
- package/src/Configuration.ts +3 -3
- package/src/Controller.ts +10 -2
- package/src/DOM/DOMObject.ts +1 -1
- package/src/DOM.ts +3 -3
- package/src/EventDispatcher.ts +134 -0
- package/src/Formats.ts +2 -2
- package/src/MessageList.ts +85 -0
- package/src/Model/Field.ts +20 -0
- package/src/Model.ts +43 -0
- package/src/Registry.ts +13 -3
- package/src/Scope/DynamicScopeData.ts +29 -0
- package/src/Scope/QueryReference.ts +29 -0
- package/src/Scope/ScopeData.ts +21 -0
- package/src/Scope/ScopeDataAbstract.ts +126 -0
- package/src/Scope/ScopeReference.ts +30 -0
- package/src/Scope/ScopedVariableType.ts +7 -0
- package/src/Scope/WrappedArray.ts +88 -0
- package/src/Scope/properties/Property.ts +79 -0
- package/src/Scope.ts +31 -252
- package/src/SimplePromise.ts +219 -0
- package/src/Tag.ts +3 -3
- package/src/Types.ts +6 -1
- package/src/Validators.ts +45 -0
- package/src/attributes/Bind.ts +4 -4
- package/src/attributes/ClassConstructor.ts +2 -1
- package/src/attributes/JSONAttribute.ts +2 -1
- package/src/attributes/List.ts +4 -4
- package/src/attributes/Radio.ts +3 -2
- package/src/attributes/ScopeChange.ts +2 -2
- package/src/attributes/SetAttribute.ts +2 -1
- package/src/attributes/StandardAttribute.ts +1 -1
- package/src/attributes/StyleAttribute.ts +3 -2
- package/src/attributes/TypeAttribute.ts +1 -1
- package/src/vsn.ts +16 -5
- package/test/AST/ArithmeticAssignmentNode.spec.ts +47 -0
- package/test/AST.spec.ts +3 -2
- package/test/Controller.spec.ts +44 -0
- package/test/MessageList.spec.ts +101 -0
- package/test/Model/DataModel.spec.ts +0 -0
- package/test/Scope/DynamicScopeData.spec.ts +141 -0
- package/test/Scope.spec.ts +15 -3
- package/test/SimplePromise.spec.ts +271 -0
- package/test/Tag/TagList.spec.ts +1 -1
- package/test/attributes/Bind.spec.ts +5 -5
- package/test/attributes/ListItem.spec.ts +1 -1
- package/dist/vsn.min.js +0 -1
package/dist/Registry.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.Registry = exports.RegistryStore = exports.register = void 0;
|
|
19
|
+
var VisionHelper_1 = require("./helpers/VisionHelper");
|
|
20
|
+
var EventDispatcher_1 = require("./EventDispatcher");
|
|
21
|
+
var SimplePromise_1 = require("./SimplePromise");
|
|
22
|
+
function register(store, key, setup) {
|
|
23
|
+
if (key === void 0) { key = null; }
|
|
24
|
+
if (setup === void 0) { setup = null; }
|
|
25
|
+
return function (target, _key) {
|
|
26
|
+
if (_key === void 0) { _key = null; }
|
|
27
|
+
key = key || target.prototype.constructor.name;
|
|
28
|
+
if (_key !== null)
|
|
29
|
+
target = target[_key];
|
|
30
|
+
Registry.instance[store].register(key, target);
|
|
31
|
+
if (setup)
|
|
32
|
+
setup();
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.register = register;
|
|
36
|
+
var RegistryStore = /** @class */ (function (_super) {
|
|
37
|
+
__extends(RegistryStore, _super);
|
|
38
|
+
function RegistryStore(defaults) {
|
|
39
|
+
if (defaults === void 0) { defaults = null; }
|
|
40
|
+
var _this = _super.call(this) || this;
|
|
41
|
+
_this.timeouts = {};
|
|
42
|
+
_this.store = defaults || {};
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
RegistryStore.prototype.register = function (key, item) {
|
|
46
|
+
this.store[key] = item;
|
|
47
|
+
this.dispatch("registered:" + key, item);
|
|
48
|
+
};
|
|
49
|
+
RegistryStore.prototype.get = function (key) {
|
|
50
|
+
var _this = this;
|
|
51
|
+
var deferred = SimplePromise_1.SimplePromise.defer();
|
|
52
|
+
if (!!this.store[key]) {
|
|
53
|
+
deferred.resolve(this.store[key]);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
console.warn("Waiting for " + key + " to be registered.");
|
|
57
|
+
this.timeouts[key] = setTimeout(function () {
|
|
58
|
+
console.warn("RegistryStore.get timed out after 5 seconds trying to find " + key + ". Make sure the item is registered.");
|
|
59
|
+
}, 5000);
|
|
60
|
+
this.once("registered:" + key, function (cls) {
|
|
61
|
+
clearTimeout(_this.timeouts[key]);
|
|
62
|
+
deferred.resolve(cls);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return deferred.promise;
|
|
66
|
+
};
|
|
67
|
+
RegistryStore.prototype.getSynchronous = function (key) {
|
|
68
|
+
return this.store[key];
|
|
69
|
+
};
|
|
70
|
+
return RegistryStore;
|
|
71
|
+
}(EventDispatcher_1.EventDispatcher));
|
|
72
|
+
exports.RegistryStore = RegistryStore;
|
|
73
|
+
var Registry = /** @class */ (function (_super) {
|
|
74
|
+
__extends(Registry, _super);
|
|
75
|
+
function Registry() {
|
|
76
|
+
var _this = _super.call(this) || this;
|
|
77
|
+
var w = VisionHelper_1.VisionHelper.window || {};
|
|
78
|
+
_this.classes = new RegistryStore(w['$classes'] || {});
|
|
79
|
+
_this.models = new RegistryStore(w['$models'] || {});
|
|
80
|
+
_this.templates = new RegistryStore(w['$templates'] || {});
|
|
81
|
+
_this.types = new RegistryStore(w['$types'] || {});
|
|
82
|
+
_this.validators = new RegistryStore(w['$validators'] || {});
|
|
83
|
+
_this.formats = new RegistryStore(w['$formats'] || {});
|
|
84
|
+
_this.attributes = new RegistryStore(w['$attributes'] || {});
|
|
85
|
+
return _this;
|
|
86
|
+
}
|
|
87
|
+
Registry.class = function (key, setup) {
|
|
88
|
+
if (key === void 0) { key = null; }
|
|
89
|
+
if (setup === void 0) { setup = null; }
|
|
90
|
+
return register('classes', key, setup);
|
|
91
|
+
};
|
|
92
|
+
Registry.controller = function (key, setup) {
|
|
93
|
+
if (key === void 0) { key = null; }
|
|
94
|
+
if (setup === void 0) { setup = null; }
|
|
95
|
+
return register('classes', key, setup);
|
|
96
|
+
};
|
|
97
|
+
Registry.model = function (key, setup) {
|
|
98
|
+
if (key === void 0) { key = null; }
|
|
99
|
+
if (setup === void 0) { setup = null; }
|
|
100
|
+
return register('models', key, setup);
|
|
101
|
+
};
|
|
102
|
+
Registry.template = function (key, setup) {
|
|
103
|
+
if (key === void 0) { key = null; }
|
|
104
|
+
if (setup === void 0) { setup = null; }
|
|
105
|
+
return register('templates', key, setup);
|
|
106
|
+
};
|
|
107
|
+
Registry.type = function (key, setup) {
|
|
108
|
+
if (key === void 0) { key = null; }
|
|
109
|
+
if (setup === void 0) { setup = null; }
|
|
110
|
+
return register('types', key, setup);
|
|
111
|
+
};
|
|
112
|
+
Registry.validator = function (key, setup) {
|
|
113
|
+
if (key === void 0) { key = null; }
|
|
114
|
+
if (setup === void 0) { setup = null; }
|
|
115
|
+
return register('validators', key, setup);
|
|
116
|
+
};
|
|
117
|
+
Registry.format = function (key, setup) {
|
|
118
|
+
if (key === void 0) { key = null; }
|
|
119
|
+
if (setup === void 0) { setup = null; }
|
|
120
|
+
return register('formats', key, setup);
|
|
121
|
+
};
|
|
122
|
+
Registry.attribute = function (attributeName, setup) {
|
|
123
|
+
if (attributeName === void 0) { attributeName = null; }
|
|
124
|
+
if (setup === void 0) { setup = null; }
|
|
125
|
+
return register('attributes', attributeName, setup);
|
|
126
|
+
};
|
|
127
|
+
Object.defineProperty(Registry, "instance", {
|
|
128
|
+
get: function () {
|
|
129
|
+
if (!Registry._instance)
|
|
130
|
+
Registry._instance = new Registry();
|
|
131
|
+
return Registry._instance;
|
|
132
|
+
},
|
|
133
|
+
enumerable: false,
|
|
134
|
+
configurable: true
|
|
135
|
+
});
|
|
136
|
+
return Registry;
|
|
137
|
+
}(EventDispatcher_1.EventDispatcher));
|
|
138
|
+
exports.Registry = Registry;
|
|
139
|
+
//# sourceMappingURL=Registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Registry.js","sourceRoot":"","sources":["../src/Registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uDAAoD;AACpD,qDAAkD;AAClD,iDAAmE;AAEnE,SAAgB,QAAQ,CAAC,KAAa,EAAE,GAAkB,EAAE,KAAwB;IAA5C,oBAAA,EAAA,UAAkB;IAAE,sBAAA,EAAA,YAAwB;IAChF,OAAO,UAAS,MAAW,EAAE,IAAmB;QAAnB,qBAAA,EAAA,WAAmB;QAC5C,GAAG,GAAG,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;QAC/C,IAAI,IAAI,KAAK,IAAI;YACb,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC1B,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC/C,IAAI,KAAK;YACL,KAAK,EAAE,CAAC;IAChB,CAAC,CAAA;AACL,CAAC;AATD,4BASC;AAED;IAAmC,iCAAe;IAI9C,uBAAY,QAAe;QAAf,yBAAA,EAAA,eAAe;QAA3B,YACI,iBAAO,SAEV;QANO,cAAQ,GAAG,EAAE,CAAC;QAKlB,KAAI,CAAC,KAAK,GAAG,QAAQ,IAAI,EAAE,CAAC;;IAChC,CAAC;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ynamicScopeData extends ScopeDataAbstract {
|
|
3
|
+
constructor(data: IScopeData | string[]);
|
|
4
|
+
setData(data: IScopeData): void;
|
|
5
|
+
on(event: string, fct: (...args: any[]) => any, context?: any, once?: boolean): number;
|
|
6
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.DynamicScopeData = void 0;
|
|
19
|
+
var ScopeDataAbstract_1 = require("./ScopeDataAbstract");
|
|
20
|
+
var DynamicScopeData = /** @class */ (function (_super) {
|
|
21
|
+
__extends(DynamicScopeData, _super);
|
|
22
|
+
function DynamicScopeData(data) {
|
|
23
|
+
var _this = _super.call(this) || this;
|
|
24
|
+
if (data instanceof Array) {
|
|
25
|
+
_this.__properties__ = data;
|
|
26
|
+
for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {
|
|
27
|
+
var field = data_1[_i];
|
|
28
|
+
_this.createProperty(field);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
_this.setData(data);
|
|
33
|
+
}
|
|
34
|
+
return _this;
|
|
35
|
+
}
|
|
36
|
+
DynamicScopeData.prototype.setData = function (data) {
|
|
37
|
+
for (var _i = 0, _a = Object.keys(data); _i < _a.length; _i++) {
|
|
38
|
+
var field = _a[_i];
|
|
39
|
+
if (this.__properties__.indexOf(field) == -1) {
|
|
40
|
+
this.__properties__.push(field);
|
|
41
|
+
this.createProperty(field);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
_super.prototype.setData.call(this, data);
|
|
45
|
+
};
|
|
46
|
+
DynamicScopeData.prototype.on = function (event, fct, context, once) {
|
|
47
|
+
if (event.indexOf('change:') == 0)
|
|
48
|
+
this.createProperty(event.substr(7));
|
|
49
|
+
return _super.prototype.on.call(this, event, fct, context, once);
|
|
50
|
+
};
|
|
51
|
+
return DynamicScopeData;
|
|
52
|
+
}(ScopeDataAbstract_1.ScopeDataAbstract));
|
|
53
|
+
exports.DynamicScopeData = DynamicScopeData;
|
|
54
|
+
//# sourceMappingURL=DynamicScopeData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicScopeData.js","sourceRoot":"","sources":["../../src/Scope/DynamicScopeData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,yDAAkE;AAElE;IAAsC,oCAAiB;IACnD,0BAAY,IAA2B;QAAvC,YACI,iBAAO,SAQV;QAPG,IAAG,IAAI,YAAY,KAAK,EAAE;YACtB,KAAI,CAAC,cAAc,GAAG,IAAI,CAAC;YAC3B,KAAoB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI;gBAAnB,IAAM,KAAK,aAAA;gBACZ,KAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;aAAA;SAClC;aAAM;YACH,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB;;IACL,CAAC;IAED,kCAAO,GAAP,UAAQ,IAAgB;QACpB,KAAmB,UAAiB,EAAjB,KAAA,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAjB,cAAiB,EAAjB,IAAiB;YAAhC,IAAM,KAAK,SAAA;YACX,IAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE;gBACzC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAChC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;aAC9B;SAAA;QACL,iBAAM,OAAO,YAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,6BAAE,GAAF,UAAG,KAAa,EAAE,GAA4B,EAAE,OAAa,EAAE,IAAc;QACzE,IAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;YAC5B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,OAAO,iBAAM,EAAE,YAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IACL,uBAAC;AAAD,CAAC,AA1BD,CAAsC,qCAAiB,GA0BtD;AA1BY,4CAAgB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Scope } from "../Scope";
|
|
2
|
+
import { ScopeReference } from "./ScopeReference";
|
|
3
|
+
export declare class QueryReference extends ScopeReference {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly scope: Scope;
|
|
6
|
+
constructor(path: string, scope: Scope);
|
|
7
|
+
getScope(): Promise<any>;
|
|
8
|
+
getKey(): Promise<string>;
|
|
9
|
+
getValue(): Promise<any>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.QueryReference = void 0;
|
|
55
|
+
var DOM_1 = require("../DOM");
|
|
56
|
+
var ScopeReference_1 = require("./ScopeReference");
|
|
57
|
+
var QueryReference = /** @class */ (function (_super) {
|
|
58
|
+
__extends(QueryReference, _super);
|
|
59
|
+
function QueryReference(path, scope) {
|
|
60
|
+
var _this = _super.call(this) || this;
|
|
61
|
+
_this.path = path;
|
|
62
|
+
_this.scope = scope;
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
QueryReference.prototype.getScope = function () {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
+
var parts, qResult;
|
|
68
|
+
return __generator(this, function (_a) {
|
|
69
|
+
switch (_a.label) {
|
|
70
|
+
case 0:
|
|
71
|
+
parts = this.path.split('.');
|
|
72
|
+
parts = parts.splice(0, parts.length - 1);
|
|
73
|
+
return [4 /*yield*/, DOM_1.DOM.instance.eval(parts.join('.'))];
|
|
74
|
+
case 1:
|
|
75
|
+
qResult = _a.sent();
|
|
76
|
+
return [2 /*return*/, qResult.length === 1 ? qResult[0].scope : qResult.map(function (dobj) { return dobj.scope; })];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
QueryReference.prototype.getKey = function () {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var parts;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
parts = this.path.split('.');
|
|
86
|
+
return [2 /*return*/, parts[parts.length - 1]];
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
QueryReference.prototype.getValue = function () {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
92
|
+
return __generator(this, function (_a) {
|
|
93
|
+
switch (_a.label) {
|
|
94
|
+
case 0: return [4 /*yield*/, DOM_1.DOM.instance.eval(this.path)];
|
|
95
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
return QueryReference;
|
|
101
|
+
}(ScopeReference_1.ScopeReference));
|
|
102
|
+
exports.QueryReference = QueryReference;
|
|
103
|
+
//# sourceMappingURL=QueryReference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryReference.js","sourceRoot":"","sources":["../../src/Scope/QueryReference.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA2B;AAE3B,mDAAgD;AAGhD;IAAoC,kCAAc;IAC9C,wBACoB,IAAY,EACZ,KAAY;QAFhC,YAII,iBAAO,SACV;QAJmB,UAAI,GAAJ,IAAI,CAAQ;QACZ,WAAK,GAAL,KAAK,CAAO;;IAGhC,CAAC;IAEY,iCAAQ,GAArB;;;;;;wBACQ,KAAK,GAAa,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;wBAC3C,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;wBAC1B,qBAAM,SAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAA;;wBAAlD,OAAO,GAAG,SAAwC;wBACxD,sBAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,KAAK,EAAV,CAAU,CAAC,EAAC;;;;KACtF;IAEY,+BAAM,GAAnB;;;;gBACU,KAAK,GAAa,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAC7C,sBAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAC;;;KAClC;IAEY,iCAAQ,GAArB;;;;4BACW,qBAAM,SAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAA;4BAAzC,sBAAO,SAAkC,EAAC;;;;KAC7C;IACL,qBAAC;AAAD,CAAC,AAvBD,CAAoC,+BAAc,GAuBjD;AAvBY,wCAAc"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ScopeData = void 0;
|
|
19
|
+
var ScopeDataAbstract_1 = require("./ScopeDataAbstract");
|
|
20
|
+
var ScopeData = /** @class */ (function (_super) {
|
|
21
|
+
__extends(ScopeData, _super);
|
|
22
|
+
function ScopeData() {
|
|
23
|
+
var _this = _super.call(this) || this;
|
|
24
|
+
var properties = _this.__properties__.splice(0, _this.__properties__.length);
|
|
25
|
+
for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) {
|
|
26
|
+
var property = properties_1[_i];
|
|
27
|
+
(function (_self, name) {
|
|
28
|
+
if (!_self['__' + name + '__'])
|
|
29
|
+
return;
|
|
30
|
+
_self.__properties__.push(name);
|
|
31
|
+
var _property = _self['__' + name + '__'], propertyType = _property[0], config = _property[1] || {};
|
|
32
|
+
_self.createProperty(name, propertyType, config);
|
|
33
|
+
})(_this, property);
|
|
34
|
+
}
|
|
35
|
+
return _this;
|
|
36
|
+
}
|
|
37
|
+
return ScopeData;
|
|
38
|
+
}(ScopeDataAbstract_1.ScopeDataAbstract));
|
|
39
|
+
exports.ScopeData = ScopeData;
|
|
40
|
+
//# sourceMappingURL=ScopeData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScopeData.js","sourceRoot":"","sources":["../../src/Scope/ScopeData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,yDAAsD;AAEtD;IAA+B,6BAAiB;IAC5C;QAAA,YACI,iBAAO,SAeV;QAdG,IAAM,UAAU,GAAG,KAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,KAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC7E,KAAsB,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU,EAAE;YAA9B,IAAM,QAAQ,mBAAA;YACd,CAAC,UAAS,KAAK,EAAE,IAAI;gBACjB,IAAG,CAAC,KAAK,CAAC,IAAI,GAAC,IAAI,GAAC,IAAI,CAAC;oBACrB,OAAO;gBAEX,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAChC,IAAM,SAAS,GAAG,KAAK,CAAC,IAAI,GAAC,IAAI,GAAC,IAAI,CAAC,EACnC,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,EAC3B,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;gBAEhC,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;YACrD,CAAC,CAAC,CAAC,KAAI,EAAE,QAAQ,CAAC,CAAC;SACtB;;IACL,CAAC;IACL,gBAAC;AAAD,CAAC,AAlBD,CAA+B,qCAAiB,GAkB/C;AAlBY,8BAAS"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IPropertyConfig, Property } from "./properties/Property";
|
|
2
|
+
import { EventDispatcher } from "../EventDispatcher";
|
|
3
|
+
export interface IScopeData {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export declare class ScopeDataAbstract extends EventDispatcher {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
__properties__: string[];
|
|
9
|
+
protected _lastData: any;
|
|
10
|
+
constructor();
|
|
11
|
+
createProperty(name: string, propertyType?: typeof Property, config?: IPropertyConfig): Property;
|
|
12
|
+
hasProperty(name: string): boolean;
|
|
13
|
+
get keys(): string[];
|
|
14
|
+
setData(data: IScopeData): void;
|
|
15
|
+
getData(): IScopeData;
|
|
16
|
+
getProperties(): string[];
|
|
17
|
+
getProperty(name: string, create?: boolean): Property;
|
|
18
|
+
bindToProperties(event: string, properties: string[], callback: (...args: any[]) => any): void;
|
|
19
|
+
setLastData(): void;
|
|
20
|
+
revert(): void;
|
|
21
|
+
isModified(): boolean;
|
|
22
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
18
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
19
|
+
to[j] = from[i];
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.ScopeDataAbstract = void 0;
|
|
24
|
+
var Property_1 = require("./properties/Property");
|
|
25
|
+
var EventDispatcher_1 = require("../EventDispatcher");
|
|
26
|
+
var ScopeDataAbstract = /** @class */ (function (_super) {
|
|
27
|
+
__extends(ScopeDataAbstract, _super);
|
|
28
|
+
function ScopeDataAbstract() {
|
|
29
|
+
var _this = _super.call(this) || this;
|
|
30
|
+
// Objects may have __properties__ from prototype
|
|
31
|
+
if (!_this['__properties__'])
|
|
32
|
+
_this.__properties__ = [];
|
|
33
|
+
return _this;
|
|
34
|
+
}
|
|
35
|
+
ScopeDataAbstract.prototype.createProperty = function (name, propertyType, config) {
|
|
36
|
+
var _this = this;
|
|
37
|
+
if (propertyType === void 0) { propertyType = Property_1.Property; }
|
|
38
|
+
config = config || {};
|
|
39
|
+
var instance = new propertyType(config.default, config), propDesc = Object.getOwnPropertyDescriptor(this, name);
|
|
40
|
+
this['__' + name] = instance;
|
|
41
|
+
// property getter
|
|
42
|
+
var propertyGetter = function () {
|
|
43
|
+
return instance.value;
|
|
44
|
+
};
|
|
45
|
+
var getter = propDesc ? propDesc.get : propertyGetter, propertySetter = function (newVal) {
|
|
46
|
+
instance.value = newVal;
|
|
47
|
+
}, setter = propDesc ? propDesc.set : propertySetter;
|
|
48
|
+
// Delete the original property
|
|
49
|
+
delete this[name];
|
|
50
|
+
// Create new property with getter and setter
|
|
51
|
+
Object.defineProperty(this, name, {
|
|
52
|
+
get: getter,
|
|
53
|
+
set: setter,
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true
|
|
56
|
+
});
|
|
57
|
+
instance.on('change', function () {
|
|
58
|
+
var args = [];
|
|
59
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
60
|
+
args[_i] = arguments[_i];
|
|
61
|
+
}
|
|
62
|
+
_this.dispatch.apply(_this, __spreadArray(['change', name], args));
|
|
63
|
+
_this.dispatch.apply(_this, __spreadArray(['change:' + name], args));
|
|
64
|
+
});
|
|
65
|
+
return instance;
|
|
66
|
+
};
|
|
67
|
+
ScopeDataAbstract.prototype.hasProperty = function (name) {
|
|
68
|
+
return this.__properties__.indexOf(name) !== -1;
|
|
69
|
+
};
|
|
70
|
+
Object.defineProperty(ScopeDataAbstract.prototype, "keys", {
|
|
71
|
+
get: function () {
|
|
72
|
+
return __spreadArray([], this.__properties__);
|
|
73
|
+
},
|
|
74
|
+
enumerable: false,
|
|
75
|
+
configurable: true
|
|
76
|
+
});
|
|
77
|
+
ScopeDataAbstract.prototype.setData = function (data) {
|
|
78
|
+
var properties = this.getProperties();
|
|
79
|
+
for (var key in data) {
|
|
80
|
+
if (properties.indexOf(key) > -1) {
|
|
81
|
+
this[key] = data[key];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
ScopeDataAbstract.prototype.getData = function () {
|
|
86
|
+
var data = {};
|
|
87
|
+
for (var _i = 0, _a = this.getProperties(); _i < _a.length; _i++) {
|
|
88
|
+
var key = _a[_i];
|
|
89
|
+
var property = this['__' + key];
|
|
90
|
+
if (this[key] == null || !property)
|
|
91
|
+
continue;
|
|
92
|
+
data[key] = property.getData();
|
|
93
|
+
}
|
|
94
|
+
return data;
|
|
95
|
+
};
|
|
96
|
+
ScopeDataAbstract.prototype.getProperties = function () {
|
|
97
|
+
return this.__properties__;
|
|
98
|
+
};
|
|
99
|
+
ScopeDataAbstract.prototype.getProperty = function (name, create) {
|
|
100
|
+
if (create === void 0) { create = false; }
|
|
101
|
+
var property = this['__' + name];
|
|
102
|
+
if (create && !property) {
|
|
103
|
+
property = this.createProperty(name);
|
|
104
|
+
}
|
|
105
|
+
return property;
|
|
106
|
+
};
|
|
107
|
+
ScopeDataAbstract.prototype.bindToProperties = function (event, properties, callback) {
|
|
108
|
+
for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) {
|
|
109
|
+
var name_1 = properties_1[_i];
|
|
110
|
+
var _property = this['__' + name_1];
|
|
111
|
+
if (_property)
|
|
112
|
+
_property.on(event, callback);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
ScopeDataAbstract.prototype.setLastData = function () {
|
|
116
|
+
this._lastData = this.getData();
|
|
117
|
+
};
|
|
118
|
+
/*
|
|
119
|
+
* Revert data to the last setData() call. Useful for forms that edit a
|
|
120
|
+
* list of items and then hit cancel rather than saving the list.
|
|
121
|
+
*/
|
|
122
|
+
ScopeDataAbstract.prototype.revert = function () {
|
|
123
|
+
this.setData(this._lastData);
|
|
124
|
+
};
|
|
125
|
+
ScopeDataAbstract.prototype.isModified = function () {
|
|
126
|
+
var oData = this._lastData, nData = this.getData();
|
|
127
|
+
for (var _i = 0, _a = this.getProperties(); _i < _a.length; _i++) {
|
|
128
|
+
var key = _a[_i];
|
|
129
|
+
if (nData[key] != oData[key])
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
return false;
|
|
133
|
+
};
|
|
134
|
+
return ScopeDataAbstract;
|
|
135
|
+
}(EventDispatcher_1.EventDispatcher));
|
|
136
|
+
exports.ScopeDataAbstract = ScopeDataAbstract;
|
|
137
|
+
//# sourceMappingURL=ScopeDataAbstract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScopeDataAbstract.js","sourceRoot":"","sources":["../../src/Scope/ScopeDataAbstract.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAgE;AAChE,sDAAmD;AAMnD;IAAuC,qCAAe;IAKlD;QAAA,YACI,iBAAO,SAKV;QAHG,iDAAiD;QACjD,IAAG,CAAC,KAAI,CAAC,gBAAgB,CAAC;YACtB,KAAI,CAAC,cAAc,GAAG,EAAE,CAAC;;IACjC,CAAC;IAED,0CAAc,GAAd,UAAe,IAAY,EAAE,YAAuB,EAAE,MAAwB;QAA9E,iBAgCC;QAhC4B,6BAAA,EAAA,eAAe,mBAAQ;QAChD,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;QACtB,IAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,EACrD,QAAQ,GAAG,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,GAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;QAE3B,kBAAkB;QAClB,IAAM,cAAc,GAAG;YACnB,OAAO,Q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AErC;IACL,CAAC;IAED,uCAAW,GAAX;QACI,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;IAED;;;OAGG;IACH,kCAAM,GAAN;QACI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,sCAAU,GAAV;QACI,IAAM,KAAK,GAAG,IAAI,CAAC,SAAS,EACxB,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC3B,KAAiB,UAAoB,EAApB,KAAA,IAAI,CAAC,aAAa,EAAE,EAApB,cAAoB,EAApB,IAAoB,EAAE;YAAnC,IAAM,GAAG,SAAA;YACT,IAAG,KAAK,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;gBACvB,OAAO,IAAI,CAAC;SACnB;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IACL,wBAAC;AAAD,CAAC,AAtHD,CAAuC,iCAAe,GAsHrD;AAtHY,8CAAiB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Scope } from "../Scope";
|
|
2
|
+
export declare class ScopeReference {
|
|
3
|
+
private _scope;
|
|
4
|
+
private _key;
|
|
5
|
+
private _value;
|
|
6
|
+
constructor(scope?: Scope, key?: string, value?: any);
|
|
7
|
+
getScope(): Promise<Scope>;
|
|
8
|
+
getKey(): Promise<string>;
|
|
9
|
+
getValue(): Promise<any>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ScopeReference = void 0;
|
|
40
|
+
var ScopeReference = /** @class */ (function () {
|
|
41
|
+
function ScopeReference(scope, key, value) {
|
|
42
|
+
if (scope === void 0) { scope = null; }
|
|
43
|
+
if (key === void 0) { key = null; }
|
|
44
|
+
if (value === void 0) { value = null; }
|
|
45
|
+
this._scope = scope;
|
|
46
|
+
this._key = key;
|
|
47
|
+
this._value = value;
|
|
48
|
+
}
|
|
49
|
+
ScopeReference.prototype.getScope = function () {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
return [2 /*return*/, this._scope];
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
ScopeReference.prototype.getKey = function () {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
58
|
+
return __generator(this, function (_a) {
|
|
59
|
+
return [2 /*return*/, this._key];
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
ScopeReference.prototype.getValue = function () {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
return __generator(this, function (_a) {
|
|
66
|
+
return [2 /*return*/, this._value];
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
return ScopeReference;
|
|
71
|
+
}());
|
|
72
|
+
exports.ScopeReference = ScopeReference;
|
|
73
|
+
//# sourceMappingURL=ScopeReference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScopeReference.js","sourceRoot":"","sources":["../../src/Scope/ScopeReference.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;IAKI,wBACI,KAAmB,EACnB,GAAkB,EAClB,KAAiB;QAFjB,sBAAA,EAAA,YAAmB;QACnB,oBAAA,EAAA,UAAkB;QAClB,sBAAA,EAAA,YAAiB;QAEjB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAEY,iCAAQ,GAArB;;;gBACI,sBAAO,IAAI,CAAC,MAAM,EAAC;;;KACtB;IAEY,+BAAM,GAAnB;;;gBACI,sBAAO,IAAI,CAAC,IAAI,EAAC;;;KACpB;IAEY,iCAAQ,GAArB;;;gBACI,sBAAO,IAAI,CAAC,MAAM,EAAC;;;KACtB;IACL,qBAAC;AAAD,CAAC,AA1BD,IA0BC;AA1BY,wCAAc"}
|