vsn 0.1.26 → 0.1.27
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/dist/AST.js +2197 -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 +1 -1
- package/dist/Controller.js +54 -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 +26 -0
- package/dist/EventDispatcher.js +117 -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 +14 -0
- package/dist/MessageList.js +88 -0
- package/dist/MessageList.js.map +1 -0
- package/dist/Model/Collection.d.ts +5 -0
- package/dist/Model/Collection.js +37 -0
- package/dist/Model/Collection.js.map +1 -0
- package/dist/Model/DataModel.d.ts +6 -0
- package/dist/Model/DataModel.js +54 -0
- package/dist/Model/DataModel.js.map +1 -0
- package/dist/Model/ModelAbstract.d.ts +20 -0
- package/dist/Model/ModelAbstract.js +122 -0
- package/dist/Model/ModelAbstract.js.map +1 -0
- package/dist/Model/fields/BooleanField.d.ts +5 -0
- package/dist/Model/fields/BooleanField.js +43 -0
- package/dist/Model/fields/BooleanField.js.map +1 -0
- package/dist/Model/fields/EmailField.d.ts +5 -0
- package/dist/Model/fields/EmailField.js +36 -0
- package/dist/Model/fields/EmailField.js.map +1 -0
- package/dist/Model/fields/Field.d.ts +13 -0
- package/dist/Model/fields/Field.js +79 -0
- package/dist/Model/fields/Field.js.map +1 -0
- package/dist/Model/fields/FloatField.d.ts +5 -0
- package/dist/Model/fields/FloatField.js +47 -0
- package/dist/Model/fields/FloatField.js.map +1 -0
- package/dist/Model/fields/PositiveNumberField.d.ts +5 -0
- package/dist/Model/fields/PositiveNumberField.js +51 -0
- package/dist/Model/fields/PositiveNumberField.js.map +1 -0
- package/dist/Model/fields/StringField.d.ts +5 -0
- package/dist/Model/fields/StringField.js +43 -0
- package/dist/Model/fields/StringField.js.map +1 -0
- package/dist/Model.d.ts +11 -0
- package/dist/Model.js +72 -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 +2 -2
- package/dist/Registry.js +128 -0
- package/dist/Registry.js.map +1 -0
- package/dist/Scope.d.ts +7 -10
- package/dist/Scope.js +462 -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.js +48 -0
- package/dist/Types.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.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 +2 -1
- package/dist/vsn.js +166 -0
- package/dist/vsn.js.map +1 -0
- package/package.json +2 -6
- package/src/AST.ts +2 -2
- package/src/Attribute.ts +2 -2
- package/src/Configuration.ts +3 -3
- package/src/Controller.ts +1 -1
- package/src/DOM/DOMObject.ts +1 -1
- package/src/DOM.ts +3 -3
- package/src/EventDispatcher.ts +117 -0
- package/src/Formats.ts +2 -2
- package/src/MessageList.ts +81 -0
- package/src/Model/Collection.ts +13 -0
- package/src/Model/DataModel.ts +29 -0
- package/src/Model/ModelAbstract.ts +114 -0
- package/src/Model/fields/BooleanField.ts +16 -0
- package/src/Model/fields/EmailField.ts +12 -0
- package/src/Model/fields/Field.ts +65 -0
- package/src/Model/fields/FloatField.ts +22 -0
- package/src/Model/fields/PositiveNumberField.ts +24 -0
- package/src/Model/fields/StringField.ts +16 -0
- package/src/Model.ts +57 -0
- package/src/Registry.ts +3 -3
- package/src/Scope.ts +33 -89
- package/src/SimplePromise.ts +219 -0
- package/src/Tag.ts +2 -2
- package/src/attributes/Bind.ts +1 -1
- package/src/attributes/List.ts +3 -3
- package/src/attributes/Radio.ts +1 -1
- package/src/attributes/ScopeChange.ts +1 -1
- package/src/attributes/StandardAttribute.ts +1 -1
- package/src/attributes/StyleAttribute.ts +1 -1
- package/src/vsn.ts +3 -2
- package/test/AST.spec.ts +2 -1
- package/test/MessageList.spec.ts +101 -0
- package/test/Model/DataModel.spec.ts +141 -0
- package/test/Model.spec.ts +306 -0
- package/test/Scope.spec.ts +2 -2
- package/test/SimplePromise.spec.ts +271 -0
- package/test/attributes/Bind.spec.ts +5 -5
- package/test/attributes/ListItem.spec.ts +1 -1
- package/dist/vsn.min.js +0 -1
|
@@ -0,0 +1,135 @@
|
|
|
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
24
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
25
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
26
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
27
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
28
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
29
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
33
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
34
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
35
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
36
|
+
function step(op) {
|
|
37
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
38
|
+
while (_) try {
|
|
39
|
+
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;
|
|
40
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
41
|
+
switch (op[0]) {
|
|
42
|
+
case 0: case 1: t = op; break;
|
|
43
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
44
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
45
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
46
|
+
default:
|
|
47
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
48
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
49
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
50
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
51
|
+
if (t[2]) _.ops.pop();
|
|
52
|
+
_.trys.pop(); continue;
|
|
53
|
+
}
|
|
54
|
+
op = body.call(thisArg, _);
|
|
55
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
56
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
+
exports.On = void 0;
|
|
61
|
+
var Attribute_1 = require("../Attribute");
|
|
62
|
+
var AST_1 = require("../AST");
|
|
63
|
+
var Registry_1 = require("../Registry");
|
|
64
|
+
var On = /** @class */ (function (_super) {
|
|
65
|
+
__extends(On, _super);
|
|
66
|
+
function On() {
|
|
67
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
68
|
+
}
|
|
69
|
+
On.prototype.compile = function () {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
+
var code;
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
switch (_a.label) {
|
|
74
|
+
case 0:
|
|
75
|
+
code = this.getAttributeValue();
|
|
76
|
+
this.handler = new AST_1.Tree(code);
|
|
77
|
+
return [4 /*yield*/, this.handler.prepare(this.tag.scope, this.tag.dom, this.tag)];
|
|
78
|
+
case 1:
|
|
79
|
+
_a.sent();
|
|
80
|
+
return [4 /*yield*/, _super.prototype.compile.call(this)];
|
|
81
|
+
case 2:
|
|
82
|
+
_a.sent();
|
|
83
|
+
return [2 /*return*/];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
On.prototype.handleEvent = function (e) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
+
return __generator(this, function (_a) {
|
|
91
|
+
switch (_a.label) {
|
|
92
|
+
case 0:
|
|
93
|
+
if (this.hasModifier('preventdefault'))
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
return [4 /*yield*/, this.handler.evaluate(this.tag.scope, this.tag.dom, this.tag)];
|
|
96
|
+
case 1:
|
|
97
|
+
_a.sent();
|
|
98
|
+
return [2 /*return*/];
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
On.prototype.connect = function () {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
105
|
+
return __generator(this, function (_a) {
|
|
106
|
+
switch (_a.label) {
|
|
107
|
+
case 0:
|
|
108
|
+
this.tag.addEventHandler(this.getAttributeBinding(), this.getAttributeModifiers(), this.handleEvent.bind(this));
|
|
109
|
+
return [4 /*yield*/, _super.prototype.connect.call(this)];
|
|
110
|
+
case 1:
|
|
111
|
+
_a.sent();
|
|
112
|
+
return [2 /*return*/];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
On.WindowEvents = [
|
|
118
|
+
'abort',
|
|
119
|
+
'afterprint',
|
|
120
|
+
'beforeprint',
|
|
121
|
+
'error',
|
|
122
|
+
'hashchange',
|
|
123
|
+
'load',
|
|
124
|
+
'popstate',
|
|
125
|
+
'resize',
|
|
126
|
+
'scroll',
|
|
127
|
+
'unload',
|
|
128
|
+
];
|
|
129
|
+
On = __decorate([
|
|
130
|
+
Registry_1.Registry.attribute('vsn-on')
|
|
131
|
+
], On);
|
|
132
|
+
return On;
|
|
133
|
+
}(Attribute_1.Attribute));
|
|
134
|
+
exports.On = On;
|
|
135
|
+
//# sourceMappingURL=On.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"On.js","sourceRoot":"","sources":["../../src/attributes/On.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Q;KACX,CAAC;IAbgB,EAAE;QADvB,mBAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;OACP,EAAE,CAgCvB;IAAD,SAAC;CAAA,AAhCD,CAAiC,qBAAS,GAgCzC;AAhCqB,gBAAE"}
|
|
@@ -0,0 +1,174 @@
|
|
|
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
24
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
25
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
26
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
27
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
28
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
29
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
33
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
34
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
35
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
36
|
+
function step(op) {
|
|
37
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
38
|
+
while (_) try {
|
|
39
|
+
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;
|
|
40
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
41
|
+
switch (op[0]) {
|
|
42
|
+
case 0: case 1: t = op; break;
|
|
43
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
44
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
45
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
46
|
+
default:
|
|
47
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
48
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
49
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
50
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
51
|
+
if (t[2]) _.ops.pop();
|
|
52
|
+
_.trys.pop(); continue;
|
|
53
|
+
}
|
|
54
|
+
op = body.call(thisArg, _);
|
|
55
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
56
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
+
exports.Radio = void 0;
|
|
61
|
+
var Registry_1 = require("../Registry");
|
|
62
|
+
var Attribute_1 = require("../Attribute");
|
|
63
|
+
var Radio = /** @class */ (function (_super) {
|
|
64
|
+
__extends(Radio, _super);
|
|
65
|
+
function Radio() {
|
|
66
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
67
|
+
}
|
|
68
|
+
Radio.prototype.setup = function () {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
+
var scopeKey, ref, _a, _b;
|
|
71
|
+
return __generator(this, function (_c) {
|
|
72
|
+
switch (_c.label) {
|
|
73
|
+
case 0:
|
|
74
|
+
scopeKey = this.getAttributeValue() || this.tag.getRawAttributeValue('name');
|
|
75
|
+
try {
|
|
76
|
+
ref = this.tag.scope.getReference(scopeKey);
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
console.error('error', e);
|
|
80
|
+
return [2 /*return*/];
|
|
81
|
+
}
|
|
82
|
+
_a = this;
|
|
83
|
+
return [4 /*yield*/, ref.getKey()];
|
|
84
|
+
case 1:
|
|
85
|
+
_a.key = _c.sent();
|
|
86
|
+
_b = this;
|
|
87
|
+
return [4 /*yield*/, ref.getScope()];
|
|
88
|
+
case 2:
|
|
89
|
+
_b.boundScope = _c.sent();
|
|
90
|
+
return [4 /*yield*/, _super.prototype.setup.call(this)];
|
|
91
|
+
case 3:
|
|
92
|
+
_c.sent();
|
|
93
|
+
return [2 /*return*/];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
Radio.prototype.extract = function () {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
+
return __generator(this, function (_a) {
|
|
101
|
+
switch (_a.label) {
|
|
102
|
+
case 0:
|
|
103
|
+
if (!this.tag.checked) return [3 /*break*/, 2];
|
|
104
|
+
return [4 /*yield*/, this.handleEvent(null)];
|
|
105
|
+
case 1:
|
|
106
|
+
_a.sent();
|
|
107
|
+
_a.label = 2;
|
|
108
|
+
case 2: return [4 /*yield*/, _super.prototype.extract.call(this)];
|
|
109
|
+
case 3:
|
|
110
|
+
_a.sent();
|
|
111
|
+
return [2 /*return*/];
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
Radio.prototype.connect = function () {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
+
return __generator(this, function (_a) {
|
|
119
|
+
switch (_a.label) {
|
|
120
|
+
case 0:
|
|
121
|
+
this.boundScope.on("change:" + this.key, this.checkSelected, this);
|
|
122
|
+
this.tag.addEventHandler('change', this.getAttributeModifiers(), this.handleEvent.bind(this));
|
|
123
|
+
return [4 /*yield*/, this.checkSelected()];
|
|
124
|
+
case 1:
|
|
125
|
+
_a.sent();
|
|
126
|
+
return [4 /*yield*/, _super.prototype.connect.call(this)];
|
|
127
|
+
case 2:
|
|
128
|
+
_a.sent();
|
|
129
|
+
return [2 /*return*/];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
Radio.prototype.evaluate = function () {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
136
|
+
return __generator(this, function (_a) {
|
|
137
|
+
switch (_a.label) {
|
|
138
|
+
case 0: return [4 /*yield*/, this.checkSelected()];
|
|
139
|
+
case 1:
|
|
140
|
+
_a.sent();
|
|
141
|
+
return [4 /*yield*/, _super.prototype.evaluate.call(this)];
|
|
142
|
+
case 2:
|
|
143
|
+
_a.sent();
|
|
144
|
+
return [2 /*return*/];
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
Radio.prototype.handleEvent = function (e) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
151
|
+
return __generator(this, function (_a) {
|
|
152
|
+
this.boundScope.set(this.key, this.tag.value);
|
|
153
|
+
return [2 /*return*/];
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
Radio.prototype.checkSelected = function () {
|
|
158
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
159
|
+
var scopeValue;
|
|
160
|
+
return __generator(this, function (_a) {
|
|
161
|
+
scopeValue = this.boundScope.get(this.key);
|
|
162
|
+
this.tag.checked = "" + scopeValue === this.tag.value;
|
|
163
|
+
return [2 /*return*/];
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
Radio.canDefer = false;
|
|
168
|
+
Radio = __decorate([
|
|
169
|
+
Registry_1.Registry.attribute('vsn-radio')
|
|
170
|
+
], Radio);
|
|
171
|
+
return Radio;
|
|
172
|
+
}(Attribute_1.Attribute));
|
|
173
|
+
exports.Radio = Radio;
|
|
174
|
+
//# sourceMappingURL=Radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../src/attributes/Radio.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAqC;AACrC,0CAAuC;AAKvC;IAA2B,yBAAS;IAApC;;IA8CA,CAAC;IAzCgB,qBAAK,GAAlB;;;;;;wBACQ,QAAQ,GAAW,IAAI,CAAC,iBAAiB,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;wBAEzF,IAAI;4BACA,GAAG,GAAG,IA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B,qBAAM,iBAAM,QAAQ,WAAE,EAAA;;wBAAtB,SAAsB,CAAC;;;;;KAC1B;IAEK,2BAAW,GAAjB,UAAkB,CAAC;;;gBACf,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;;;;KACjD;IAEK,6BAAa,GAAnB;;;;gBACU,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACjD,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,KAAG,UAAY,KAAK,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;;;;KACzD;IA5CsB,cAAQ,GAAY,KAAK,CAAC;IADxC,KAAK;QADjB,mBAAQ,CAAC,SAAS,CAAC,WAAW,CAAC;OACnB,KAAK,CA8CjB;IAAD,YAAC;CAAA,AA9CD,CAA2B,qBAAS,GA8CnC;AA9CY,sBAAK"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.Referenced = void 0;
|
|
25
|
+
var Registry_1 = require("../Registry");
|
|
26
|
+
var Attribute_1 = require("../Attribute");
|
|
27
|
+
var Referenced = /** @class */ (function (_super) {
|
|
28
|
+
__extends(Referenced, _super);
|
|
29
|
+
function Referenced() {
|
|
30
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
+
}
|
|
32
|
+
Referenced = __decorate([
|
|
33
|
+
Registry_1.Registry.attribute('vsn-ref')
|
|
34
|
+
], Referenced);
|
|
35
|
+
return Referenced;
|
|
36
|
+
}(Attribute_1.Attribute));
|
|
37
|
+
exports.Referenced = Referenced;
|
|
38
|
+
//# sourceMappingURL=Referenced.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Referenced.js","sourceRoot":"","sources":["../../src/attributes/Referenced.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAqC;AACrC,0CAAuC;AAGvC;IAAgC,8BAAS;IAAzC;;IAA2C,CAAC;IAA/B,UAAU;QADtB,mBAAQ,CAAC,SAAS,CAAC,SAAS,CAAC;OACjB,UAAU,CAAqB;IAAD,iBAAC;CAAA,AAA5C,CAAgC,qBAAS,GAAG;AAA/B,gCAAU"}
|
|
@@ -0,0 +1,91 @@
|
|
|
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
24
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
25
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
26
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
27
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
28
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
29
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
33
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
34
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
35
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
36
|
+
function step(op) {
|
|
37
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
38
|
+
while (_) try {
|
|
39
|
+
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;
|
|
40
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
41
|
+
switch (op[0]) {
|
|
42
|
+
case 0: case 1: t = op; break;
|
|
43
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
44
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
45
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
46
|
+
default:
|
|
47
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
48
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
49
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
50
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
51
|
+
if (t[2]) _.ops.pop();
|
|
52
|
+
_.trys.pop(); continue;
|
|
53
|
+
}
|
|
54
|
+
op = body.call(thisArg, _);
|
|
55
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
56
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
+
exports.RootAttribute = void 0;
|
|
61
|
+
var Attribute_1 = require("../Attribute");
|
|
62
|
+
var VisionHelper_1 = require("../helpers/VisionHelper");
|
|
63
|
+
var Registry_1 = require("../Registry");
|
|
64
|
+
var RootAttribute = /** @class */ (function (_super) {
|
|
65
|
+
__extends(RootAttribute, _super);
|
|
66
|
+
function RootAttribute() {
|
|
67
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
68
|
+
}
|
|
69
|
+
RootAttribute.prototype.setup = function () {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
+
return __generator(this, function (_a) {
|
|
72
|
+
switch (_a.label) {
|
|
73
|
+
case 0:
|
|
74
|
+
this.tag.scope.set('$mobile', VisionHelper_1.VisionHelper.isMobile());
|
|
75
|
+
return [4 /*yield*/, _super.prototype.setup.call(this)];
|
|
76
|
+
case 1:
|
|
77
|
+
_a.sent();
|
|
78
|
+
return [2 /*return*/];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
RootAttribute.canDefer = false;
|
|
84
|
+
RootAttribute.scoped = true;
|
|
85
|
+
RootAttribute = __decorate([
|
|
86
|
+
Registry_1.Registry.attribute('vsn-root')
|
|
87
|
+
], RootAttribute);
|
|
88
|
+
return RootAttribute;
|
|
89
|
+
}(Attribute_1.Attribute));
|
|
90
|
+
exports.RootAttribute = RootAttribute;
|
|
91
|
+
//# sourceMappingURL=RootAttribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RootAttribute.js","sourceRoot":"","sources":["../../src/attributes/RootAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AACvC,wDAAqD;AACrD,wCAAqC;AAGrC;IAAmC,iCAAS;IAA5C;;IAQA,CAAC;IAJgB,6BAAK,GAAlB;;;;;wBACI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,2BAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;wBACvD,qBAAM,iBAAM,KAAK,WAAE,EAAA;;wBAAnB,SAAmB,CAAC;;;;;KACvB;IANsB,sBAAQ,GAAY,KAAK,CAAC;IAC1B,oBAAM,GAAY,IAAI,CAAC;IAFrC,aAAa;QADzB,mBAAQ,CAAC,SAAS,CAAC,UAAU,CAAC;OAClB,aAAa,CAQzB;IAAD,oBAAC;CAAA,AARD,CAAmC,qBAAS,GAQ3C;AARY,sCAAa"}
|
|
@@ -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
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.ScopeAttribute = void 0;
|
|
25
|
+
var Attribute_1 = require("../Attribute");
|
|
26
|
+
var Registry_1 = require("../Registry");
|
|
27
|
+
var ScopeAttribute = /** @class */ (function (_super) {
|
|
28
|
+
__extends(ScopeAttribute, _super);
|
|
29
|
+
function ScopeAttribute() {
|
|
30
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
+
}
|
|
32
|
+
ScopeAttribute.canDefer = false;
|
|
33
|
+
ScopeAttribute.scoped = true;
|
|
34
|
+
ScopeAttribute = __decorate([
|
|
35
|
+
Registry_1.Registry.attribute('vsn-scope')
|
|
36
|
+
], ScopeAttribute);
|
|
37
|
+
return ScopeAttribute;
|
|
38
|
+
}(Attribute_1.Attribute));
|
|
39
|
+
exports.ScopeAttribute = ScopeAttribute;
|
|
40
|
+
//# sourceMappingURL=ScopeAttribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScopeAttribute.js","sourceRoot":"","sources":["../../src/attributes/ScopeAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AACvC,wCAAqC;AAGrC;IAAoC,kCAAS;IAA7C;;IAGA,CAAC;IAF0B,uBAAQ,GAAY,KAAK,CAAC;IAC1B,qBAAM,GAAY,IAAI,CAAC;IAFrC,cAAc;QAD1B,mBAAQ,CAAC,SAAS,CAAC,WAAW,CAAC;OACnB,cAAc,CAG1B;IAAD,qBAAC;CAAA,AAHD,CAAoC,qBAAS,GAG5C;AAHY,wCAAc"}
|
|
@@ -0,0 +1,130 @@
|
|
|
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
24
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
25
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
26
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
27
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
28
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
29
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
33
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
34
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
35
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
36
|
+
function step(op) {
|
|
37
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
38
|
+
while (_) try {
|
|
39
|
+
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;
|
|
40
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
41
|
+
switch (op[0]) {
|
|
42
|
+
case 0: case 1: t = op; break;
|
|
43
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
44
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
45
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
46
|
+
default:
|
|
47
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
48
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
49
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
50
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
51
|
+
if (t[2]) _.ops.pop();
|
|
52
|
+
_.trys.pop(); continue;
|
|
53
|
+
}
|
|
54
|
+
op = body.call(thisArg, _);
|
|
55
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
56
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
+
exports.ScopeChange = void 0;
|
|
61
|
+
var Attribute_1 = require("../Attribute");
|
|
62
|
+
var AST_1 = require("../AST");
|
|
63
|
+
var Registry_1 = require("../Registry");
|
|
64
|
+
var ScopeChange = /** @class */ (function (_super) {
|
|
65
|
+
__extends(ScopeChange, _super);
|
|
66
|
+
function ScopeChange() {
|
|
67
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
68
|
+
}
|
|
69
|
+
ScopeChange.prototype.compile = function () {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
+
var code;
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
switch (_a.label) {
|
|
74
|
+
case 0:
|
|
75
|
+
code = this.getAttributeValue();
|
|
76
|
+
this.handler = new AST_1.Tree(code);
|
|
77
|
+
return [4 /*yield*/, this.handler.prepare(this.tag.scope, this.tag.dom, this.tag)];
|
|
78
|
+
case 1:
|
|
79
|
+
_a.sent();
|
|
80
|
+
return [4 /*yield*/, _super.prototype.compile.call(this)];
|
|
81
|
+
case 2:
|
|
82
|
+
_a.sent();
|
|
83
|
+
return [2 /*return*/];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
ScopeChange.prototype.connect = function () {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
+
var binding, ref, _a, _b, _c;
|
|
91
|
+
return __generator(this, function (_d) {
|
|
92
|
+
switch (_d.label) {
|
|
93
|
+
case 0:
|
|
94
|
+
binding = this.getAttributeBinding();
|
|
95
|
+
ref = this.tag.scope.getReference(binding, false);
|
|
96
|
+
return [4 /*yield*/, ref.getScope()];
|
|
97
|
+
case 1:
|
|
98
|
+
_b = (_a = (_d.sent())).on;
|
|
99
|
+
_c = "change:";
|
|
100
|
+
return [4 /*yield*/, ref.getKey()];
|
|
101
|
+
case 2:
|
|
102
|
+
_b.apply(_a, [_c + (_d.sent()), this.handleEvent.bind(this)]);
|
|
103
|
+
return [4 /*yield*/, _super.prototype.connect.call(this)];
|
|
104
|
+
case 3:
|
|
105
|
+
_d.sent();
|
|
106
|
+
return [2 /*return*/];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
ScopeChange.prototype.handleEvent = function (e) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
113
|
+
return __generator(this, function (_a) {
|
|
114
|
+
switch (_a.label) {
|
|
115
|
+
case 0: return [4 /*yield*/, this.handler.evaluate(this.tag.scope, this.tag.dom, this.tag)];
|
|
116
|
+
case 1:
|
|
117
|
+
_a.sent();
|
|
118
|
+
return [2 /*return*/];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
ScopeChange.canDefer = false;
|
|
124
|
+
ScopeChange = __decorate([
|
|
125
|
+
Registry_1.Registry.attribute('vsn-scope-change')
|
|
126
|
+
], ScopeChange);
|
|
127
|
+
return ScopeChange;
|
|
128
|
+
}(Attribute_1.Attribute));
|
|
129
|
+
exports.ScopeChange = ScopeChange;
|
|
130
|
+
//# sourceMappingURL=ScopeChange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScopeChange.js","sourceRoot":"","sources":["../../src/attributes/ScopeChange.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AACvC,8BAA4B;AAE5B,wCAAqC;AAGrC;IAA0C,+BAAS;IAAnD;;IAqBA,CAAC;IAjBgB,6BAAO,GAApB;;;;;;wBACU,IAAI,GAAW,IAAI,CAAC,iBAAiB,EAAE,CAAC;wBAC9C,IAAI,CAAC,OAAO,GAAG,IAAI,UAAI,CAAC,IAAI,CAAC,CAAC;wBAC9B,qBAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GA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