vsn 0.1.44 → 0.1.47
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/demo.html +11 -9
- package/demo/markup.html +2 -0
- package/demo/vsn.js +1 -1
- package/demo/xhr.vsn +4 -0
- package/dist/AST/ArithmeticAssignmentNode.js +8 -1
- package/dist/AST/ArithmeticAssignmentNode.js.map +1 -1
- package/dist/AST/FunctionNode.d.ts +0 -0
- package/dist/AST/FunctionNode.js +1 -0
- package/dist/AST/FunctionNode.js.map +1 -0
- package/dist/AST/StringFormatNode.d.ts +18 -0
- package/dist/{attributes/ClickToggleClass.js → AST/StringFormatNode.js} +49 -49
- package/dist/AST/StringFormatNode.js.map +1 -0
- package/dist/AST/WASM/Context.d.ts +4 -0
- package/dist/AST/WASM/Context.js +18 -0
- package/dist/AST/WASM/Context.js.map +1 -0
- package/dist/AST/WASM/Function.d.ts +22 -0
- package/dist/AST/WASM/Function.js +110 -0
- package/dist/AST/WASM/Function.js.map +1 -0
- package/dist/AST/WASM/Memory.d.ts +12 -0
- package/dist/AST/WASM/Memory.js +22 -0
- package/dist/AST/WASM/Memory.js.map +1 -0
- package/dist/AST/WASM/Section.d.ts +5 -0
- package/dist/AST/WASM/Section.js +11 -0
- package/dist/AST/WASM/Section.js.map +1 -0
- package/dist/AST/WASM.d.ts +58 -0
- package/dist/AST/WASM.js +277 -0
- package/dist/AST/WASM.js.map +1 -0
- package/dist/AST/XHRNode.d.ts +15 -0
- package/dist/AST/XHRNode.js +146 -0
- package/dist/AST/XHRNode.js.map +1 -0
- package/dist/AST.d.ts +62 -55
- package/dist/AST.js +123 -83
- package/dist/AST.js.map +1 -1
- package/dist/DOM/DOMObject.d.ts +1 -0
- package/dist/DOM/DOMObject.js +6 -0
- package/dist/DOM/DOMObject.js.map +1 -1
- package/dist/DOM.js +61 -90
- package/dist/DOM.js.map +1 -1
- package/dist/Registry.d.ts +2 -0
- package/dist/Registry.js +13 -9
- package/dist/Registry.js.map +1 -1
- package/dist/Scope/ScopeDataAbstract.js +2 -2
- package/dist/Scope/ScopeDataAbstract.js.map +1 -1
- package/dist/Scope/properties/Property.d.ts +5 -6
- package/dist/Scope/properties/Property.js +17 -25
- package/dist/Scope/properties/Property.js.map +1 -1
- package/dist/Scope/properties/_imports.d.ts +1 -1
- package/dist/Scope/properties/_imports.js.map +1 -1
- package/dist/Tag.d.ts +5 -0
- package/dist/Tag.js +55 -11
- package/dist/Tag.js.map +1 -1
- package/dist/attributes/Bind.js +2 -2
- package/dist/attributes/Bind.js.map +1 -1
- package/dist/attributes/StandardAttribute.d.ts +0 -1
- package/dist/attributes/StandardAttribute.js +4 -34
- package/dist/attributes/StandardAttribute.js.map +1 -1
- package/dist/attributes/_imports.d.ts +0 -2
- package/dist/attributes/_imports.js +1 -5
- package/dist/attributes/_imports.js.map +1 -1
- package/dist/helpers/VisionHelper.d.ts +1 -0
- package/dist/helpers/VisionHelper.js +17 -0
- package/dist/helpers/VisionHelper.js.map +1 -1
- package/package.json +1 -1
- package/src/AST/ArithmeticAssignmentNode.ts +9 -2
- package/src/AST/FunctionNode.ts +0 -0
- package/src/AST/StringFormatNode.ts +43 -0
- package/src/AST/WASM/Context.ts +12 -0
- package/src/AST/WASM/Function.ts +67 -0
- package/src/AST/WASM/Memory.ts +21 -0
- package/src/AST/WASM/Section.ts +6 -0
- package/src/AST/WASM.ts +244 -0
- package/src/AST/XHRNode.ts +81 -0
- package/src/AST.ts +66 -31
- package/src/DOM/DOMObject.ts +6 -0
- package/src/DOM.ts +11 -25
- package/src/Registry.ts +12 -9
- package/src/Scope/ScopeDataAbstract.ts +2 -2
- package/src/Scope/properties/Property.ts +17 -28
- package/src/Scope/properties/_imports.ts +1 -1
- package/src/Tag.ts +56 -9
- package/src/attributes/AddClassIf.ts +1 -1
- package/src/attributes/Bind.ts +2 -2
- package/src/attributes/StandardAttribute.ts +4 -32
- package/src/attributes/_imports.ts +0 -2
- package/src/helpers/VisionHelper.ts +13 -0
- package/test/AST/ArithmeticAssignmentNode.spec.ts +0 -2
- package/test/AST/StringFormatNode.spec.ts +12 -0
- package/test/AST/WASM.spec.ts +63 -0
- package/test/AST/XHRNode.spec.ts +10 -0
- package/test/Scope/ScopeData.spec.ts +5 -5
- package/types/vsn-component.d.ts +5 -0
- package/dist/attributes/ClickRemoveClass.d.ts +0 -8
- package/dist/attributes/ClickRemoveClass.js +0 -114
- package/dist/attributes/ClickRemoveClass.js.map +0 -1
- package/dist/attributes/ClickToggleClass.d.ts +0 -8
- package/dist/attributes/ClickToggleClass.js.map +0 -1
- package/src/attributes/ClickRemoveClass.ts +0 -30
- package/src/attributes/ClickToggleClass.ts +0 -30
|
@@ -1,114 +0,0 @@
|
|
|
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.ClickRemoveClass = void 0;
|
|
61
|
-
var Attribute_1 = require("../Attribute");
|
|
62
|
-
var Registry_1 = require("../Registry");
|
|
63
|
-
var ClickRemoveClass = /** @class */ (function (_super) {
|
|
64
|
-
__extends(ClickRemoveClass, _super);
|
|
65
|
-
function ClickRemoveClass() {
|
|
66
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
67
|
-
_this.cssClass = '';
|
|
68
|
-
_this.target = null;
|
|
69
|
-
return _this;
|
|
70
|
-
}
|
|
71
|
-
ClickRemoveClass.prototype.setup = function () {
|
|
72
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
-
return __generator(this, function (_a) {
|
|
74
|
-
switch (_a.label) {
|
|
75
|
-
case 0:
|
|
76
|
-
this.cssClass = this.getAttributeBinding('active');
|
|
77
|
-
this.target = this.getAttributeValue();
|
|
78
|
-
return [4 /*yield*/, _super.prototype.setup.call(this)];
|
|
79
|
-
case 1:
|
|
80
|
-
_a.sent();
|
|
81
|
-
return [2 /*return*/];
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
ClickRemoveClass.prototype.connect = function () {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
88
|
-
return __generator(this, function (_a) {
|
|
89
|
-
switch (_a.label) {
|
|
90
|
-
case 0:
|
|
91
|
-
this.tag.addEventHandler('click', this.getAttributeModifiers(), this.onClick.bind(this));
|
|
92
|
-
return [4 /*yield*/, _super.prototype.connect.call(this)];
|
|
93
|
-
case 1:
|
|
94
|
-
_a.sent();
|
|
95
|
-
return [2 /*return*/];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
ClickRemoveClass.prototype.onClick = function (e) {
|
|
101
|
-
var element = this.tag.element;
|
|
102
|
-
if (!!this.target) {
|
|
103
|
-
element = document.getElementById(this.target);
|
|
104
|
-
}
|
|
105
|
-
if (element)
|
|
106
|
-
element.classList.remove(this.cssClass);
|
|
107
|
-
};
|
|
108
|
-
ClickRemoveClass = __decorate([
|
|
109
|
-
Registry_1.Registry.attribute('vsn-click-remove-class')
|
|
110
|
-
], ClickRemoveClass);
|
|
111
|
-
return ClickRemoveClass;
|
|
112
|
-
}(Attribute_1.Attribute));
|
|
113
|
-
exports.ClickRemoveClass = ClickRemoveClass;
|
|
114
|
-
//# sourceMappingURL=ClickRemoveClass.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClickRemoveClass.js","sourceRoot":"","sources":["../../src/attributes/ClickRemoveClass.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AACvC,wCAAqC;AAGrC;IAAsC,oCAAS;IAA/C;QAAA,qEAyBC;QAxBa,cAAQ,GAAW,EAAE,CAAC;QACtB,YAAM,GAAW,IAAI,CAAC;;IAuBpC,CAAC;IArBgB,gCAAK,GAAlB;;;;;wBACI,IAAI,CAAC,QAA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IAuBpC,CAAC;IArBgB,gCAAK,GAAlB;;;;;wBACI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAE,QAAQ,CAAC,CAAC;wBACpD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;wBACvC,qBAAM,iBAAM,KAAK,WAAE,EAAA;;wBAAnB,SAAmB,CAAC;;;;;KACvB;IAEY,kCAAO,GAApB;;;;;wBACI,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;wBACzF,qBAAM,iBAAM,OAAO,WAAE,EAAA;;wBAArB,SAAqB,CAAC;;;;;KACzB;IAED,kCAAO,GAAP,UAAQ,CAAC;QACL,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE;YAEf,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAClD;QAED,IAAI,OAAO;YACP,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAxBQ,gBAAgB;QAD5B,mBAAQ,CAAC,SAAS,CAAC,wBAAwB,CAAC;OAChC,gBAAgB,CAyB5B;IAAD,uBAAC;CAAA,AAzBD,CAAsC,qBAAS,GAyB9C;AAzBY,4CAAgB"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {Attribute} from "../Attribute";
|
|
2
|
-
import {Registry} from "../Registry";
|
|
3
|
-
|
|
4
|
-
@Registry.attribute('vsn-click-remove-class')
|
|
5
|
-
export class ClickRemoveClass extends Attribute {
|
|
6
|
-
protected cssClass: string = '';
|
|
7
|
-
protected target: string = null;
|
|
8
|
-
|
|
9
|
-
public async setup() {
|
|
10
|
-
this.cssClass = this.getAttributeBinding('active');
|
|
11
|
-
this.target = this.getAttributeValue();
|
|
12
|
-
await super.setup();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public async connect() {
|
|
16
|
-
this.tag.addEventHandler('click', this.getAttributeModifiers(), this.onClick.bind(this));
|
|
17
|
-
await super.connect();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
onClick(e) {
|
|
21
|
-
let element = this.tag.element;
|
|
22
|
-
|
|
23
|
-
if (!!this.target) {
|
|
24
|
-
element = document.getElementById(this.target);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (element)
|
|
28
|
-
element.classList.remove(this.cssClass);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {Attribute} from "../Attribute";
|
|
2
|
-
import {Registry} from "../Registry";
|
|
3
|
-
|
|
4
|
-
@Registry.attribute('vsn-click-toggle-class')
|
|
5
|
-
export class ClickToggleClass extends Attribute {
|
|
6
|
-
protected cssClass: string = '';
|
|
7
|
-
protected target: string = null;
|
|
8
|
-
|
|
9
|
-
public async setup() {
|
|
10
|
-
this.cssClass = this.getAttributeBinding( 'active');
|
|
11
|
-
this.target = this.getAttributeValue();
|
|
12
|
-
await super.setup();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public async connect() {
|
|
16
|
-
this.tag.addEventHandler('click', this.getAttributeModifiers(), this.onClick.bind(this));
|
|
17
|
-
await super.connect();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
onClick(e) {
|
|
21
|
-
let element = this.tag.element;
|
|
22
|
-
if (!!this.target) {
|
|
23
|
-
|
|
24
|
-
element = document.getElementById(this.target);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (element)
|
|
28
|
-
element.classList.toggle(this.cssClass);
|
|
29
|
-
}
|
|
30
|
-
}
|