vsn 0.1.23 → 0.1.24
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 +1 -1
- package/demo/vision.js +1 -1
- package/dist/Controller.d.ts +3 -4
- package/dist/Controller.js +4 -13
- package/dist/Controller.js.map +1 -1
- package/dist/Scope.js +1 -1
- package/dist/Scope.js.map +1 -1
- package/dist/Tag.js.map +1 -1
- package/dist/attributes/ClickRemoveClass.js +17 -5
- package/dist/attributes/ClickRemoveClass.js.map +1 -1
- package/dist/attributes/ClickToggleClass.js +17 -5
- package/dist/attributes/ClickToggleClass.js.map +1 -1
- package/dist/attributes/Exec.js +6 -0
- package/dist/attributes/Exec.js.map +1 -1
- package/dist/attributes/Format.js +3 -0
- package/dist/attributes/Format.js.map +1 -1
- package/dist/attributes/If.js +12 -0
- package/dist/attributes/If.js.map +1 -1
- package/dist/attributes/JSONAttribute.js +3 -0
- package/dist/attributes/JSONAttribute.js.map +1 -1
- package/dist/attributes/KeyAbstract.js +11 -4
- package/dist/attributes/KeyAbstract.js.map +1 -1
- package/dist/attributes/KeyDown.js +8 -2
- package/dist/attributes/KeyDown.js.map +1 -1
- package/dist/attributes/KeyUp.js +8 -2
- package/dist/attributes/KeyUp.js.map +1 -1
- package/dist/attributes/List.js +11 -2
- package/dist/attributes/List.js.map +1 -1
- package/dist/attributes/ListItem.js +3 -0
- package/dist/attributes/ListItem.js.map +1 -1
- package/dist/attributes/On.js +11 -2
- package/dist/attributes/On.js.map +1 -1
- package/dist/attributes/Radio.d.ts +2 -0
- package/dist/attributes/Radio.js +49 -4
- package/dist/attributes/Radio.js.map +1 -1
- package/dist/attributes/RootAttribute.js +8 -2
- package/dist/attributes/RootAttribute.js.map +1 -1
- package/dist/attributes/ScopeChange.js +6 -0
- package/dist/attributes/ScopeChange.js.map +1 -1
- package/dist/attributes/SetAttribute.js +3 -0
- package/dist/attributes/SetAttribute.js.map +1 -1
- package/dist/attributes/StandardAttribute.js +25 -7
- package/dist/attributes/StandardAttribute.js.map +1 -1
- package/dist/attributes/TypeAttribute.js +3 -0
- package/dist/attributes/TypeAttribute.js.map +1 -1
- package/package.json +1 -1
- package/src/Controller.ts +4 -12
- package/src/Scope.ts +1 -1
- package/src/Tag.ts +2 -3
- package/src/attributes/ClickRemoveClass.ts +2 -0
- package/src/attributes/ClickToggleClass.ts +2 -0
- package/src/attributes/Exec.ts +2 -0
- package/src/attributes/Format.ts +1 -0
- package/src/attributes/If.ts +4 -0
- package/src/attributes/JSONAttribute.ts +1 -0
- package/src/attributes/KeyAbstract.ts +2 -1
- package/src/attributes/KeyDown.ts +1 -0
- package/src/attributes/KeyUp.ts +1 -0
- package/src/attributes/List.ts +3 -0
- package/src/attributes/ListItem.ts +1 -0
- package/src/attributes/On.ts +2 -0
- package/src/attributes/Radio.ts +15 -1
- package/src/attributes/RootAttribute.ts +1 -0
- package/src/attributes/ScopeChange.ts +2 -0
- package/src/attributes/SetAttribute.ts +1 -0
- package/src/attributes/StandardAttribute.ts +3 -0
- package/src/attributes/TypeAttribute.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"On.js","sourceRoot":"","sources":["../../src/attributes/On.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AACvC,8BAA4B;AAC5B,wCAAqC;AAGrC;IAAiC,sBAAS;IAA1C;;
|
|
1
|
+
{"version":3,"file":"On.js","sourceRoot":"","sources":["../../src/attributes/On.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AACvC,8BAA4B;AAC5B,wCAAqC;AAGrC;IAAiC,sBAAS;IAA1C;;IA8BA,CAAC;IAfgB,oBAAO,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,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,EAAA;;wBAAlE,SAAkE,CAAC;wBACnE,qBAAM,iBAAM,OAAO,WAAE,EAAA;;wBAArB,SAAqB,CAAC;;;;;KACzB;IAEK,wBAAW,GAAjB,UAAkB,CAAC;;;;4BACf,qBAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,EAAA;;wBAAnE,SAAmE,CAAC;;;;;KACvE;IAEY,oBAAO,GAApB;;;;;wBACI,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;wBAChH,qBAAM,iBAAM,OAAO,WAAE,EAAA;;wBAArB,SAAqB,CAAC;;;;;KACzB;IA3BsB,eAAY,GAAa;QAC5C,OAAO;QACP,YAAY;QACZ,aAAa;QACb,OAAO;QACP,YAAY;QACZ,MAAM;QACN,UAAU;QACV,QAAQ;QACR,QAAQ;QACR,QAAQ;KACX,CAAC;IAbgB,EAAE;QADvB,mBAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;OACP,EAAE,CA8BvB;IAAD,SAAC;CAAA,AA9BD,CAAiC,qBAAS,GA8BzC;AA9BqB,gBAAE"}
|
|
@@ -4,8 +4,10 @@ export declare class Radio extends Attribute {
|
|
|
4
4
|
static readonly canDefer: boolean;
|
|
5
5
|
protected key?: string;
|
|
6
6
|
protected boundScope?: Scope;
|
|
7
|
+
setup(): Promise<void>;
|
|
7
8
|
extract(): Promise<void>;
|
|
8
9
|
connect(): Promise<void>;
|
|
10
|
+
evaluate(): Promise<void>;
|
|
9
11
|
handleEvent(e: any): Promise<void>;
|
|
10
12
|
checkSelected(): Promise<void>;
|
|
11
13
|
}
|
package/dist/attributes/Radio.js
CHANGED
|
@@ -65,7 +65,7 @@ var Radio = /** @class */ (function (_super) {
|
|
|
65
65
|
function Radio() {
|
|
66
66
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
67
67
|
}
|
|
68
|
-
Radio.prototype.
|
|
68
|
+
Radio.prototype.setup = function () {
|
|
69
69
|
return __awaiter(this, void 0, void 0, function () {
|
|
70
70
|
var scopeKey, ref, _a, _b;
|
|
71
71
|
return __generator(this, function (_c) {
|
|
@@ -87,6 +87,27 @@ var Radio = /** @class */ (function (_super) {
|
|
|
87
87
|
return [4 /*yield*/, ref.getScope()];
|
|
88
88
|
case 2:
|
|
89
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();
|
|
90
111
|
return [2 /*return*/];
|
|
91
112
|
}
|
|
92
113
|
});
|
|
@@ -95,9 +116,33 @@ var Radio = /** @class */ (function (_super) {
|
|
|
95
116
|
Radio.prototype.connect = function () {
|
|
96
117
|
return __awaiter(this, void 0, void 0, function () {
|
|
97
118
|
return __generator(this, function (_a) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
119
|
+
switch (_a.label) {
|
|
120
|
+
case 0:
|
|
121
|
+
this.boundScope.bind("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
|
+
}
|
|
101
146
|
});
|
|
102
147
|
});
|
|
103
148
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../src/attributes/Radio.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAqC;AACrC,0CAAuC;AAKvC;IAA2B,yBAAS;IAApC;;
|
|
1
|
+
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../src/attributes/Radio.ts"],"names":[],"mappings":";;;;;;;;;;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EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;wBAC9F,qBAAM,IAAI,CAAC,aAAa,EAAE,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,qBAAM,iBAAM,OAAO,WAAE,EAAA;;wBAArB,SAAqB,CAAC;;;;;KACzB;IAEY,wBAAQ,GAArB;;;;4BACI,qBAAM,IAAI,CAAC,aAAa,EAAE,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,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;;;gBACI,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;;;;KACvE;IA3CsB,cAAQ,GAAY,KAAK,CAAC;IADxC,KAAK;QADjB,mBAAQ,CAAC,SAAS,CAAC,WAAW,CAAC;OACnB,KAAK,CA6CjB;IAAD,YAAC;CAAA,AA7CD,CAA2B,qBAAS,GA6CnC;AA7CY,sBAAK"}
|
|
@@ -69,8 +69,14 @@ var RootAttribute = /** @class */ (function (_super) {
|
|
|
69
69
|
RootAttribute.prototype.setup = function () {
|
|
70
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
71
71
|
return __generator(this, function (_a) {
|
|
72
|
-
|
|
73
|
-
|
|
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
|
+
}
|
|
74
80
|
});
|
|
75
81
|
});
|
|
76
82
|
};
|
|
@@ -1 +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;;
|
|
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"}
|
|
@@ -76,6 +76,9 @@ var ScopeChange = /** @class */ (function (_super) {
|
|
|
76
76
|
this.handler = new AST_1.Tree(code);
|
|
77
77
|
return [4 /*yield*/, this.handler.prepare(this.tag.scope, this.tag.dom, this.tag)];
|
|
78
78
|
case 1:
|
|
79
|
+
_a.sent();
|
|
80
|
+
return [4 /*yield*/, _super.prototype.compile.call(this)];
|
|
81
|
+
case 2:
|
|
79
82
|
_a.sent();
|
|
80
83
|
return [2 /*return*/];
|
|
81
84
|
}
|
|
@@ -97,6 +100,9 @@ var ScopeChange = /** @class */ (function (_super) {
|
|
|
97
100
|
return [4 /*yield*/, ref.getKey()];
|
|
98
101
|
case 2:
|
|
99
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();
|
|
100
106
|
return [2 /*return*/];
|
|
101
107
|
}
|
|
102
108
|
});
|
|
@@ -1 +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;;
|
|
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,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,EAAA;;wBAAlE,SAAkE,CAAC;wBACnE,qBAAM,iBAAM,OAAO,WAAE,EAAA;;wBAArB,SAAqB,CAAC;;;;;KACzB;IAEY,6BAAO,GAApB;;;;;;wBACU,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;wBACrC,GAAG,GAAmB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;wBACvE,qBAAM,GAAG,CAAC,QAAQ,EAAE,EAAA;;wBAArB,KAAA,CAAA,KAAA,CAAC,SAAoB,CAAC,CAAA,CAAC,IAAI,CAAA;;wBAAW,qBAAM,GAAG,CAAC,MAAM,EAAE,EAAA;;wBAAxD,cAA4B,MAAU,SAAkB,CAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,CAAC;wBACzF,qBAAM,iBAAM,OAAO,WAAE,EAAA;;wBAArB,SAAqB,CAAC;;;;;KACzB;IAEK,iCAAW,GAAjB,UAAkB,CAAC;;;;4BACf,qBAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,EAAA;;wBAAnE,SAAmE,CAAC;;;;;KACvE;IAnBsB,oBAAQ,GAAY,KAAK,CAAC;IAD/B,WAAW;QADhC,mBAAQ,CAAC,SAAS,CAAC,kBAAkB,CAAC;OACjB,WAAW,CAqBhC;IAAD,kBAAC;CAAA,AArBD,CAA0C,qBAAS,GAqBlD;AArBqB,kCAAW"}
|
|
@@ -100,6 +100,9 @@ var SetAttribute = /** @class */ (function (_super) {
|
|
|
100
100
|
return [4 /*yield*/, ref.getScope()];
|
|
101
101
|
case 2:
|
|
102
102
|
_b.boundScope = _c.sent();
|
|
103
|
+
return [4 /*yield*/, _super.prototype.setup.call(this)];
|
|
104
|
+
case 3:
|
|
105
|
+
_c.sent();
|
|
103
106
|
return [2 /*return*/];
|
|
104
107
|
}
|
|
105
108
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetAttribute.js","sourceRoot":"","sources":["../../src/attributes/SetAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAAuC;AACvC,wCAAqC;AAGrC;IAAkC,gCAAS;IAA3C;;
|
|
1
|
+
{"version":3,"file":"SetAttribute.js","sourceRoot":"","sources":["../../src/attributes/SetAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAAuC;AACvC,wCAAqC;AAGrC;IAAkC,gCAAS;IAA3C;;IAuCA,CAAC;IAjCG,sBAAW,+BAAK;aAMhB;YACI,IAAI,CAAC,IAAI,CAAC,UAAU;gBAAE,OAAO,IAAI,CAAC;YAClC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;aATD,UAAiB,CAAM;YACnB,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;aACpC;QACL,CAAC;;;OAAA;IAOY,4BAAK,GAAlB;;;;;;wBACI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;wBAE3C,IAAI;4BACA,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;yBACpD;wBAAC,OAAO,CAAC,EAAE;4BACR,sBAAO;yBACV;wBACD,KAAA,IAAI,CAAA;wBAAO,qBAAM,GAAG,CAAC,MAAM,EAAE,EAAA;;wBAA7B,GAAK,GAAG,GAAG,SAAkB,CAAC;wBAC9B,KAAA,IAAI,CAAA;wBAAc,qBAAM,GAAG,CAAC,QAAQ,EAAE,EAAA;;wBAAtC,GAAK,UAAU,GAAG,SAAoB,CAAC;wBACvC,qBAAM,iBAAM,KAAK,WAAE,EAAA;;wBAAnB,SAAmB,CAAC;;;;;KACvB;IAEY,8BAAO,GAApB;;;;gBACQ,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;gBACnC,SAAS,GAAW,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC5D,IAAI,SAAS,GAAG,CAAC,CAAC,EAAE;oBAChB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;oBAC/D,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;iBACtC;gBACD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;;;;KACxC;IArCsB,qBAAQ,GAAY,KAAK,CAAC;IADxC,YAAY;QADxB,mBAAQ,CAAC,SAAS,CAAC,SAAS,CAAC;OACjB,YAAY,CAuCxB;IAAD,mBAAC;CAAA,AAvCD,CAAkC,qBAAS,GAuC1C;AAvCY,oCAAY"}
|
|
@@ -61,26 +61,44 @@ var StandardAttribute = /** @class */ (function (_super) {
|
|
|
61
61
|
StandardAttribute.prototype.setup = function () {
|
|
62
62
|
return __awaiter(this, void 0, void 0, function () {
|
|
63
63
|
return __generator(this, function (_a) {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
switch (_a.label) {
|
|
65
|
+
case 0:
|
|
66
|
+
if (StandardAttribute.magicAttributes.indexOf(this.key) === -1 && !this.tag.element.hasAttribute(this.attributeName)) {
|
|
67
|
+
this.tag.element.setAttribute(this.attributeName, '');
|
|
68
|
+
}
|
|
69
|
+
return [4 /*yield*/, _super.prototype.setup.call(this)];
|
|
70
|
+
case 1:
|
|
71
|
+
_a.sent();
|
|
72
|
+
return [2 /*return*/];
|
|
66
73
|
}
|
|
67
|
-
return [2 /*return*/];
|
|
68
74
|
});
|
|
69
75
|
});
|
|
70
76
|
};
|
|
71
77
|
StandardAttribute.prototype.extract = function () {
|
|
72
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
73
79
|
return __generator(this, function (_a) {
|
|
74
|
-
|
|
75
|
-
|
|
80
|
+
switch (_a.label) {
|
|
81
|
+
case 0:
|
|
82
|
+
this.updateFrom();
|
|
83
|
+
return [4 /*yield*/, _super.prototype.extract.call(this)];
|
|
84
|
+
case 1:
|
|
85
|
+
_a.sent();
|
|
86
|
+
return [2 /*return*/];
|
|
87
|
+
}
|
|
76
88
|
});
|
|
77
89
|
});
|
|
78
90
|
};
|
|
79
91
|
StandardAttribute.prototype.connect = function () {
|
|
80
92
|
return __awaiter(this, void 0, void 0, function () {
|
|
81
93
|
return __generator(this, function (_a) {
|
|
82
|
-
|
|
83
|
-
|
|
94
|
+
switch (_a.label) {
|
|
95
|
+
case 0:
|
|
96
|
+
this.tag.scope.bind("change:" + this.key, this.updateTo.bind(this));
|
|
97
|
+
return [4 /*yield*/, _super.prototype.connect.call(this)];
|
|
98
|
+
case 1:
|
|
99
|
+
_a.sent();
|
|
100
|
+
return [2 /*return*/];
|
|
101
|
+
}
|
|
84
102
|
});
|
|
85
103
|
});
|
|
86
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardAttribute.js","sourceRoot":"","sources":["../../src/attributes/StandardAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AAEvC;IAAuC,qCAAS;IAAhD;;
|
|
1
|
+
{"version":3,"file":"StandardAttribute.js","sourceRoot":"","sources":["../../src/attributes/StandardAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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KAAK,CAAC,CAAC;QACjE,CAAC;;;OAAA;IA7EsB,0BAAQ,GAAY,KAAK,CAAC;IACvB,iCAAe,GAAa;QAClD,OAAO;QACP,OAAO;QACP,QAAQ;QACR,QAAQ;KACX,CAAC;IAqFN,wBAAC;CAAA,AA5FD,CAAuC,qBAAS,GA4F/C;AA5FY,8CAAiB"}
|
|
@@ -86,6 +86,9 @@ var TypeAttribute = /** @class */ (function (_super) {
|
|
|
86
86
|
return [4 /*yield*/, ref.getKey()];
|
|
87
87
|
case 2:
|
|
88
88
|
_b.apply(_a, [_c.sent(), type]);
|
|
89
|
+
return [4 /*yield*/, _super.prototype.extract.call(this)];
|
|
90
|
+
case 3:
|
|
91
|
+
_c.sent();
|
|
89
92
|
return [2 /*return*/];
|
|
90
93
|
}
|
|
91
94
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeAttribute.js","sourceRoot":"","sources":["../../src/attributes/TypeAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AAEvC,wCAAqC;AAGrC;IAAmC,iCAAS;IAA5C;;
|
|
1
|
+
{"version":3,"file":"TypeAttribute.js","sourceRoot":"","sources":["../../src/attributes/TypeAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AAEvC,wCAAqC;AAGrC;IAAmC,iCAAS;IAA5C;;IAiBA,CAAC;IAfgB,+BAAO,GAApB;;;;;;wBACU,GAAG,GAAW,IAAI,CAAC,mBAAmB,EAAE,CAAC;wBAC3C,IAAI,GAAW,IAAI,CAAC,iBAAiB,EAAE,CAAC;wBAG5C,IAAI;4BACA,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;yBAC1C;wBAAC,OAAO,CAAC,EAAE;4BACR,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;4BAC1B,sBAAO;yBACV;wBAEA,qBAAM,GAAG,CAAC,QAAQ,EAAE,EAAA;;wBAArB,KAAA,CAAA,KAAA,CAAC,SAAoB,CAAC,CAAA,CAAC,OAAO,CAAA;wBAAC,qBAAM,GAAG,CAAC,MAAM,EAAE,EAAA;;wBAAjD,cAA+B,SAAkB,EAAE,IAAI,EAAC,CAAC;wBACzD,qBAAM,iBAAM,OAAO,WAAE,EAAA;;wBAArB,SAAqB,CAAC;;;;;KACzB;IAfsB,sBAAQ,GAAY,KAAK,CAAC;IADxC,aAAa;QADzB,mBAAQ,CAAC,SAAS,CAAC,UAAU,CAAC;OAClB,aAAa,CAiBzB;IAAD,oBAAC;CAAA,AAjBD,CAAmC,qBAAS,GAiB3C;AAjBY,sCAAa"}
|
package/package.json
CHANGED
package/src/Controller.ts
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import {EventDispatcher} from "simple-ts-event-dispatcher";
|
|
2
|
+
import {Tag} from "./Tag";
|
|
2
3
|
|
|
3
4
|
export abstract class Controller extends EventDispatcher {
|
|
4
|
-
protected
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
protected constructor(
|
|
6
|
+
protected tag: Tag
|
|
7
|
+
) {
|
|
7
8
|
super();
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
public get tag(): any {
|
|
11
|
-
return this._tag;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public set tag(tag: any) {
|
|
15
|
-
this._tag = tag;
|
|
16
|
-
this.trigger('tag', tag);
|
|
17
|
-
}
|
|
18
10
|
}
|
package/src/Scope.ts
CHANGED
package/src/Tag.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {On} from "./attributes/On";
|
|
|
8
8
|
import {Registry} from "./Registry";
|
|
9
9
|
import {benchmarkEnd, benchmarkStart} from "./Bencmark";
|
|
10
10
|
import {DOMObject} from "./DOM/DOMObject";
|
|
11
|
-
import {
|
|
11
|
+
import {Tree} from "./AST";
|
|
12
12
|
import {StyleAttribute} from "./attributes/StyleAttribute";
|
|
13
13
|
|
|
14
14
|
export enum TagState {
|
|
@@ -428,8 +428,7 @@ export class Tag extends DOMObject {
|
|
|
428
428
|
|
|
429
429
|
this.scope.set('$event', e);
|
|
430
430
|
this.scope.set('$value', this.value);
|
|
431
|
-
for (const handler of this.onEventHandlers[eventType])
|
|
432
|
-
{
|
|
431
|
+
for (const handler of this.onEventHandlers[eventType]) {
|
|
433
432
|
handler(e);
|
|
434
433
|
}
|
|
435
434
|
}
|
|
@@ -9,10 +9,12 @@ export class ClickRemoveClass extends Attribute {
|
|
|
9
9
|
public async setup() {
|
|
10
10
|
this.cssClass = this.getAttributeBinding('active');
|
|
11
11
|
this.target = this.getAttributeValue();
|
|
12
|
+
await super.setup();
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
public async connect() {
|
|
15
16
|
this.tag.addEventHandler('click', this.getAttributeModifiers(), this.onClick.bind(this));
|
|
17
|
+
await super.connect();
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
onClick(e) {
|
|
@@ -9,10 +9,12 @@ export class ClickToggleClass extends Attribute {
|
|
|
9
9
|
public async setup() {
|
|
10
10
|
this.cssClass = this.getAttributeBinding( 'active');
|
|
11
11
|
this.target = this.getAttributeValue();
|
|
12
|
+
await super.setup();
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
public async connect() {
|
|
15
16
|
this.tag.addEventHandler('click', this.getAttributeModifiers(), this.onClick.bind(this));
|
|
17
|
+
await super.connect();
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
onClick(e) {
|
package/src/attributes/Exec.ts
CHANGED
|
@@ -10,9 +10,11 @@ export class Exec extends Attribute {
|
|
|
10
10
|
public async compile() {
|
|
11
11
|
this.tree = new Tree(this.getAttributeValue());
|
|
12
12
|
await this.tree.prepare(this.tag.scope, this.tag.dom, this.tag);
|
|
13
|
+
await super.compile();
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
public async extract() {
|
|
16
17
|
await this.tree.evaluate(this.tag.scope, this.tag.dom, this.tag);
|
|
18
|
+
await super.extract();
|
|
17
19
|
}
|
|
18
20
|
}
|
package/src/attributes/Format.ts
CHANGED
package/src/attributes/If.ts
CHANGED
|
@@ -11,18 +11,22 @@ export class If extends Attribute {
|
|
|
11
11
|
const statement: string = this.getAttributeValue();
|
|
12
12
|
this.tree = new Tree(statement);
|
|
13
13
|
await this.tree.prepare(this.tag.scope, this.tag.dom, this.tag);
|
|
14
|
+
await super.compile();
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
public async extract() {
|
|
17
18
|
await this.evaluate();
|
|
19
|
+
await super.extract();
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
public async connect() {
|
|
21
23
|
await this.tree.bindToScopeChanges(this.tag.scope, this.onChange.bind(this), this.tag.dom, this.tag);
|
|
24
|
+
await super.connect();
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
public async evaluate() {
|
|
25
28
|
await this.onChange();
|
|
29
|
+
await super.evaluate();
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
async onChange() {
|
|
@@ -4,12 +4,13 @@ export abstract class KeyAbstract extends On {
|
|
|
4
4
|
protected specificKey: string = null;
|
|
5
5
|
|
|
6
6
|
public async compile() {
|
|
7
|
-
await super.compile();
|
|
8
7
|
this.specificKey = this.getAttributeBinding();
|
|
8
|
+
await super.compile();
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public async connect() {
|
|
12
12
|
this.tag.addEventHandler('keydown', this.getAttributeModifiers(), this.handleEvent.bind(this));
|
|
13
|
+
await super.connect();
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
public async handleEvent(e) {
|
package/src/attributes/KeyUp.ts
CHANGED
package/src/attributes/List.ts
CHANGED
|
@@ -19,6 +19,7 @@ export class List extends Attribute {
|
|
|
19
19
|
const listAttr: string = this.getAttributeBinding();
|
|
20
20
|
this.tree = new Tree(listAttr);
|
|
21
21
|
await this.tree.prepare(this.tag.scope, this.tag.dom, this.tag);
|
|
22
|
+
await super.compile();
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
public async setup() {
|
|
@@ -43,6 +44,7 @@ export class List extends Attribute {
|
|
|
43
44
|
this.template = templateNode.element.content.cloneNode(true);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
47
|
+
await super.setup();
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
public async extract() {
|
|
@@ -55,6 +57,7 @@ export class List extends Attribute {
|
|
|
55
57
|
await this.add({});
|
|
56
58
|
}
|
|
57
59
|
}
|
|
60
|
+
await super.extract();
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
protected async addExistingItems(defaultList: any[] | null) {
|
|
@@ -23,6 +23,7 @@ export class ListItem extends Attribute {
|
|
|
23
23
|
const modelName: string = (await this.getList()).listItemModel;
|
|
24
24
|
const cls = await Registry.instance.classes.get(modelName);
|
|
25
25
|
this.instantiateModel(cls);
|
|
26
|
+
await super.setup();
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
public get listItemName(): string {
|
package/src/attributes/On.ts
CHANGED
|
@@ -22,6 +22,7 @@ export abstract class On extends Attribute {
|
|
|
22
22
|
const code: string = this.getAttributeValue();
|
|
23
23
|
this.handler = new Tree(code);
|
|
24
24
|
await this.handler.prepare(this.tag.scope, this.tag.dom, this.tag);
|
|
25
|
+
await super.compile();
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
async handleEvent(e) {
|
|
@@ -30,5 +31,6 @@ export abstract class On extends Attribute {
|
|
|
30
31
|
|
|
31
32
|
public async connect() {
|
|
32
33
|
this.tag.addEventHandler(this.getAttributeBinding(), this.getAttributeModifiers(), this.handleEvent.bind(this));
|
|
34
|
+
await super.connect();
|
|
33
35
|
}
|
|
34
36
|
}
|
package/src/attributes/Radio.ts
CHANGED
|
@@ -9,7 +9,7 @@ export class Radio extends Attribute {
|
|
|
9
9
|
protected key?: string;
|
|
10
10
|
protected boundScope?: Scope;
|
|
11
11
|
|
|
12
|
-
public async
|
|
12
|
+
public async setup() {
|
|
13
13
|
let scopeKey: string = this.getAttributeValue() || this.tag.getRawAttributeValue('name');
|
|
14
14
|
let ref: ScopeReference;
|
|
15
15
|
try {
|
|
@@ -21,11 +21,25 @@ export class Radio extends Attribute {
|
|
|
21
21
|
|
|
22
22
|
this.key = await ref.getKey();
|
|
23
23
|
this.boundScope = await ref.getScope();
|
|
24
|
+
await super.setup();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public async extract() {
|
|
28
|
+
if (this.tag.checked)
|
|
29
|
+
await this.handleEvent(null);
|
|
30
|
+
await super.extract();
|
|
24
31
|
}
|
|
25
32
|
|
|
26
33
|
public async connect() {
|
|
27
34
|
this.boundScope.bind(`change:${this.key}`, this.checkSelected, this);
|
|
28
35
|
this.tag.addEventHandler('change', this.getAttributeModifiers(), this.handleEvent.bind(this));
|
|
36
|
+
await this.checkSelected();
|
|
37
|
+
await super.connect();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public async evaluate() {
|
|
41
|
+
await this.checkSelected();
|
|
42
|
+
await super.evaluate();
|
|
29
43
|
}
|
|
30
44
|
|
|
31
45
|
async handleEvent(e) {
|
|
@@ -12,12 +12,14 @@ export abstract class ScopeChange extends Attribute {
|
|
|
12
12
|
const code: string = this.getAttributeValue();
|
|
13
13
|
this.handler = new Tree(code);
|
|
14
14
|
await this.handler.prepare(this.tag.scope, this.tag.dom, this.tag);
|
|
15
|
+
await super.compile();
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
public async connect() {
|
|
18
19
|
const binding = this.getAttributeBinding();
|
|
19
20
|
const ref: ScopeReference = this.tag.scope.getReference(binding, false);
|
|
20
21
|
(await ref.getScope()).bind(`change:${await ref.getKey()}`, this.handleEvent.bind(this));
|
|
22
|
+
await super.connect();
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
async handleEvent(e) {
|
|
@@ -13,14 +13,17 @@ export class StandardAttribute extends Attribute {
|
|
|
13
13
|
if (StandardAttribute.magicAttributes.indexOf(this.key) === -1 && !this.tag.element.hasAttribute(this.attributeName)) {
|
|
14
14
|
this.tag.element.setAttribute(this.attributeName, '');
|
|
15
15
|
}
|
|
16
|
+
await super.setup();
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
public async extract() {
|
|
19
20
|
this.updateFrom();
|
|
21
|
+
await super.extract();
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
public async connect() {
|
|
23
25
|
this.tag.scope.bind(`change:${this.key}`, this.updateTo.bind(this));
|
|
26
|
+
await super.connect();
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
public mutate(mutation: MutationRecord) {
|