vsn 0.1.16 → 0.1.17

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.
Files changed (110) hide show
  1. package/demo/vision.js +1 -1
  2. package/dist/Scope.d.ts +1 -0
  3. package/dist/vision.min.js +1 -0
  4. package/main.py +16 -0
  5. package/package.json +1 -1
  6. package/src/AST.ts +13 -9
  7. package/src/Scope.ts +7 -0
  8. package/test/AST.spec.ts +41 -12
  9. package/dist/AST.js +0 -1995
  10. package/dist/AST.js.map +0 -1
  11. package/dist/Attribute.js +0 -187
  12. package/dist/Attribute.js.map +0 -1
  13. package/dist/Bencmark.js +0 -179
  14. package/dist/Bencmark.js.map +0 -1
  15. package/dist/Configuration.js +0 -64
  16. package/dist/Configuration.js.map +0 -1
  17. package/dist/Controller.js +0 -39
  18. package/dist/Controller.js.map +0 -1
  19. package/dist/DOM/DOMObject.js +0 -45
  20. package/dist/DOM/DOMObject.js.map +0 -1
  21. package/dist/DOM/WrappedDocument.js +0 -34
  22. package/dist/DOM/WrappedDocument.js.map +0 -1
  23. package/dist/DOM/WrappedWindow.js +0 -45
  24. package/dist/DOM/WrappedWindow.js.map +0 -1
  25. package/dist/DOM.js +0 -547
  26. package/dist/DOM.js.map +0 -1
  27. package/dist/Formats.js +0 -44
  28. package/dist/Formats.js.map +0 -1
  29. package/dist/Query.js +0 -66
  30. package/dist/Query.js.map +0 -1
  31. package/dist/Registry.js +0 -138
  32. package/dist/Registry.js.map +0 -1
  33. package/dist/Scope.js +0 -499
  34. package/dist/Scope.js.map +0 -1
  35. package/dist/Tag/List.js +0 -85
  36. package/dist/Tag/List.js.map +0 -1
  37. package/dist/Tag.js +0 -715
  38. package/dist/Tag.js.map +0 -1
  39. package/dist/Types.js +0 -48
  40. package/dist/Types.js.map +0 -1
  41. package/dist/Vision.js +0 -161
  42. package/dist/Vision.js.map +0 -1
  43. package/dist/attributes/AddClassIf.js +0 -93
  44. package/dist/attributes/AddClassIf.js.map +0 -1
  45. package/dist/attributes/Bind.js +0 -272
  46. package/dist/attributes/Bind.js.map +0 -1
  47. package/dist/attributes/ClassConstructor.js +0 -104
  48. package/dist/attributes/ClassConstructor.js.map +0 -1
  49. package/dist/attributes/ClickRemoveClass.js +0 -102
  50. package/dist/attributes/ClickRemoveClass.js.map +0 -1
  51. package/dist/attributes/ClickToggleClass.js +0 -102
  52. package/dist/attributes/ClickToggleClass.js.map +0 -1
  53. package/dist/attributes/ControllerAttribute.js +0 -28
  54. package/dist/attributes/ControllerAttribute.js.map +0 -1
  55. package/dist/attributes/DisableIf.js +0 -94
  56. package/dist/attributes/DisableIf.js.map +0 -1
  57. package/dist/attributes/Exec.js +0 -102
  58. package/dist/attributes/Exec.js.map +0 -1
  59. package/dist/attributes/Format.js +0 -96
  60. package/dist/attributes/Format.js.map +0 -1
  61. package/dist/attributes/If.js +0 -147
  62. package/dist/attributes/If.js.map +0 -1
  63. package/dist/attributes/JSONAttribute.js +0 -115
  64. package/dist/attributes/JSONAttribute.js.map +0 -1
  65. package/dist/attributes/KeyAbstract.js +0 -110
  66. package/dist/attributes/KeyAbstract.js.map +0 -1
  67. package/dist/attributes/KeyDown.js +0 -82
  68. package/dist/attributes/KeyDown.js.map +0 -1
  69. package/dist/attributes/KeyUp.js +0 -82
  70. package/dist/attributes/KeyUp.js.map +0 -1
  71. package/dist/attributes/List.js +0 -273
  72. package/dist/attributes/List.js.map +0 -1
  73. package/dist/attributes/ListItem.js +0 -135
  74. package/dist/attributes/ListItem.js.map +0 -1
  75. package/dist/attributes/ListItemModel.js +0 -39
  76. package/dist/attributes/ListItemModel.js.map +0 -1
  77. package/dist/attributes/ModelAttribute.js +0 -29
  78. package/dist/attributes/ModelAttribute.js.map +0 -1
  79. package/dist/attributes/Name.js +0 -88
  80. package/dist/attributes/Name.js.map +0 -1
  81. package/dist/attributes/On.js +0 -123
  82. package/dist/attributes/On.js.map +0 -1
  83. package/dist/attributes/Radio.js +0 -127
  84. package/dist/attributes/Radio.js.map +0 -1
  85. package/dist/attributes/Referenced.js +0 -38
  86. package/dist/attributes/Referenced.js.map +0 -1
  87. package/dist/attributes/RootAttribute.js +0 -85
  88. package/dist/attributes/RootAttribute.js.map +0 -1
  89. package/dist/attributes/ScopeAttribute.js +0 -40
  90. package/dist/attributes/ScopeAttribute.js.map +0 -1
  91. package/dist/attributes/ScopeChange.js +0 -124
  92. package/dist/attributes/ScopeChange.js.map +0 -1
  93. package/dist/attributes/SetAttribute.js +0 -130
  94. package/dist/attributes/SetAttribute.js.map +0 -1
  95. package/dist/attributes/StandardAttribute.js +0 -168
  96. package/dist/attributes/StandardAttribute.js.map +0 -1
  97. package/dist/attributes/Template.js +0 -39
  98. package/dist/attributes/Template.js.map +0 -1
  99. package/dist/attributes/TypeAttribute.js +0 -101
  100. package/dist/attributes/TypeAttribute.js.map +0 -1
  101. package/dist/attributes/_imports.js +0 -58
  102. package/dist/attributes/_imports.js.map +0 -1
  103. package/dist/helpers/DOMHelper.js +0 -81
  104. package/dist/helpers/DOMHelper.js.map +0 -1
  105. package/dist/helpers/ElementHelper.js +0 -25
  106. package/dist/helpers/ElementHelper.js.map +0 -1
  107. package/dist/helpers/VisionHelper.js +0 -71
  108. package/dist/helpers/VisionHelper.js.map +0 -1
  109. package/dist/helpers/decorators.js +0 -38
  110. package/dist/helpers/decorators.js.map +0 -1
@@ -1,88 +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.Name = void 0;
61
- var Attribute_1 = require("../Attribute");
62
- var Registry_1 = require("../Registry");
63
- var Name = /** @class */ (function (_super) {
64
- __extends(Name, _super);
65
- function Name() {
66
- return _super !== null && _super.apply(this, arguments) || this;
67
- }
68
- Name.prototype.setup = function () {
69
- return __awaiter(this, void 0, void 0, function () {
70
- var parentScope;
71
- return __generator(this, function (_a) {
72
- parentScope = this.tag.scope.parentScope;
73
- if (parentScope) {
74
- parentScope.set(this.tag.parsedAttributes['vsn-name'][1], this.tag.scope);
75
- }
76
- return [2 /*return*/];
77
- });
78
- });
79
- };
80
- Name.canDefer = false;
81
- Name.scoped = true;
82
- Name = __decorate([
83
- Registry_1.Registry.attribute('vsn-name')
84
- ], Name);
85
- return Name;
86
- }(Attribute_1.Attribute));
87
- exports.Name = Name;
88
- //# sourceMappingURL=Name.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Name.js","sourceRoot":"","sources":["../../src/attributes/Name.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AAEvC,wCAAqC;AAGrC;IAA0B,wBAAS;IAAnC;;IAUA,CAAC;IANgB,oBAAK,GAAlB;;;;gBACU,WAAW,GAAU,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC;gBACtD,IAAI,WAAW,EAAE;oBACb,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;iBAC7E;;;;KACJ;IARsB,aAAQ,GAAY,KAAK,CAAC;IAC1B,WAAM,GAAY,IAAI,CAAC;IAFrC,IAAI;QADhB,mBAAQ,CAAC,SAAS,CAAC,UAAU,CAAC;OAClB,IAAI,CAUhB;IAAD,WAAC;CAAA,AAVD,CAA0B,qBAAS,GAUlC;AAVY,oBAAI"}
@@ -1,123 +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.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 [2 /*return*/];
81
- }
82
- });
83
- });
84
- };
85
- On.prototype.handleEvent = function (e) {
86
- return __awaiter(this, void 0, void 0, function () {
87
- return __generator(this, function (_a) {
88
- switch (_a.label) {
89
- case 0: return [4 /*yield*/, this.handler.evaluate(this.tag.scope, this.tag.dom, this.tag)];
90
- case 1:
91
- _a.sent();
92
- return [2 /*return*/];
93
- }
94
- });
95
- });
96
- };
97
- On.prototype.connect = function () {
98
- return __awaiter(this, void 0, void 0, function () {
99
- return __generator(this, function (_a) {
100
- this.tag.addEventHandler(this.getAttributeBinding(), this.getAttributeModifiers(), this.handleEvent.bind(this));
101
- return [2 /*return*/];
102
- });
103
- });
104
- };
105
- On.WindowEvents = [
106
- 'abort',
107
- 'afterprint',
108
- 'beforeprint',
109
- 'error',
110
- 'hashchange',
111
- 'load',
112
- 'popstate',
113
- 'resize',
114
- 'scroll',
115
- 'unload',
116
- ];
117
- On = __decorate([
118
- Registry_1.Registry.attribute('vsn-on')
119
- ], On);
120
- return On;
121
- }(Attribute_1.Attribute));
122
- exports.On = On;
123
- //# sourceMappingURL=On.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"On.js","sourceRoot":"","sources":["../../src/attributes/On.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AACvC,8BAA4B;AAC5B,wCAAqC;AAGrC;IAAiC,sBAAS;IAA1C;;IA4BA,CAAC;IAbgB,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;;;;;KACtE;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;;;gBACI,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;;;;KACnH;IAzBsB,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,CA4BvB;IAAD,SAAC;CAAA,AA5BD,CAAiC,qBAAS,GA4BzC;AA5BqB,gBAAE"}
@@ -1,127 +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.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.extract = 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 [2 /*return*/];
91
- }
92
- });
93
- });
94
- };
95
- Radio.prototype.connect = function () {
96
- return __awaiter(this, void 0, void 0, function () {
97
- return __generator(this, function (_a) {
98
- this.boundScope.bind("change:" + this.key, this.checkSelected, this);
99
- this.tag.addEventHandler('change', this.getAttributeModifiers(), this.handleEvent.bind(this));
100
- return [2 /*return*/];
101
- });
102
- });
103
- };
104
- Radio.prototype.handleEvent = function (e) {
105
- return __awaiter(this, void 0, void 0, function () {
106
- return __generator(this, function (_a) {
107
- this.boundScope.set(this.key, this.tag.value);
108
- return [2 /*return*/];
109
- });
110
- });
111
- };
112
- Radio.prototype.checkSelected = function () {
113
- return __awaiter(this, void 0, void 0, function () {
114
- return __generator(this, function (_a) {
115
- this.tag.checked = this.boundScope.get(this.key) === this.tag.value;
116
- return [2 /*return*/];
117
- });
118
- });
119
- };
120
- Radio.canDefer = false;
121
- Radio = __decorate([
122
- Registry_1.Registry.attribute('vsn-radio')
123
- ], Radio);
124
- return Radio;
125
- }(Attribute_1.Attribute));
126
- exports.Radio = Radio;
127
- //# sourceMappingURL=Radio.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../src/attributes/Radio.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAqC;AACrC,0CAAuC;AAKvC;IAA2B,yBAAS;IAApC;;IA+BA,CAAC;IA1BgB,uBAAO,GAApB;;;;;;wBACQ,QAAQ,GAAW,IAAI,CAAC,iBAAiB,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;wBAEzF,IAAI;4BACA,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;yBAC/C;wBAAC,OAAO,CAAC,EAAE;4BACR,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;4BAC1B,sBAAO;yBACV;wBAED,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;;;;;KAC1C;IAEY,uBAAO,GAApB;;;gBACI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAU,IAAI,CAAC,GAAK,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;gBACrE,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;;;;KACjG;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;IA7BsB,cAAQ,GAAY,KAAK,CAAC;IADxC,KAAK;QADjB,mBAAQ,CAAC,SAAS,CAAC,WAAW,CAAC;OACnB,KAAK,CA+BjB;IAAD,YAAC;CAAA,AA/BD,CAA2B,qBAAS,GA+BnC;AA/BY,sBAAK"}
@@ -1,38 +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
- 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
@@ -1 +0,0 @@
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"}
@@ -1,85 +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.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
- this.tag.scope.set('$mobile', VisionHelper_1.VisionHelper.isMobile());
73
- return [2 /*return*/];
74
- });
75
- });
76
- };
77
- RootAttribute.canDefer = false;
78
- RootAttribute.scoped = true;
79
- RootAttribute = __decorate([
80
- Registry_1.Registry.attribute('vsn-root')
81
- ], RootAttribute);
82
- return RootAttribute;
83
- }(Attribute_1.Attribute));
84
- exports.RootAttribute = RootAttribute;
85
- //# sourceMappingURL=RootAttribute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RootAttribute.js","sourceRoot":"","sources":["../../src/attributes/RootAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AACvC,wDAAqD;AACrD,wCAAqC;AAGrC;IAAmC,iCAAS;IAA5C;;IAOA,CAAC;IAHgB,6BAAK,GAAlB;;;gBACI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,2BAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;;;;KAC1D;IALsB,sBAAQ,GAAY,KAAK,CAAC;IAC1B,oBAAM,GAAY,IAAI,CAAC;IAFrC,aAAa;QADzB,mBAAQ,CAAC,SAAS,CAAC,UAAU,CAAC;OAClB,aAAa,CAOzB;IAAD,oBAAC;CAAA,AAPD,CAAmC,qBAAS,GAO3C;AAPY,sCAAa"}
@@ -1,40 +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
- 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
@@ -1 +0,0 @@
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"}
@@ -1,124 +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.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 [2 /*return*/];
81
- }
82
- });
83
- });
84
- };
85
- ScopeChange.prototype.connect = function () {
86
- return __awaiter(this, void 0, void 0, function () {
87
- var binding, ref, _a, _b, _c;
88
- return __generator(this, function (_d) {
89
- switch (_d.label) {
90
- case 0:
91
- binding = this.getAttributeBinding();
92
- ref = this.tag.scope.getReference(binding, false);
93
- return [4 /*yield*/, ref.getScope()];
94
- case 1:
95
- _b = (_a = (_d.sent())).bind;
96
- _c = "change:";
97
- return [4 /*yield*/, ref.getKey()];
98
- case 2:
99
- _b.apply(_a, [_c + (_d.sent()), this.handleEvent.bind(this)]);
100
- return [2 /*return*/];
101
- }
102
- });
103
- });
104
- };
105
- ScopeChange.prototype.handleEvent = function (e) {
106
- return __awaiter(this, void 0, void 0, function () {
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
109
- case 0: return [4 /*yield*/, this.handler.evaluate(this.tag.scope, this.tag.dom, this.tag)];
110
- case 1:
111
- _a.sent();
112
- return [2 /*return*/];
113
- }
114
- });
115
- });
116
- };
117
- ScopeChange.canDefer = false;
118
- ScopeChange = __decorate([
119
- Registry_1.Registry.attribute('vsn-scope-change')
120
- ], ScopeChange);
121
- return ScopeChange;
122
- }(Attribute_1.Attribute));
123
- exports.ScopeChange = ScopeChange;
124
- //# sourceMappingURL=ScopeChange.js.map