vsn 0.1.18 → 0.1.19

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 (105) hide show
  1. package/dist/AST.js +1998 -0
  2. package/dist/AST.js.map +1 -0
  3. package/dist/Attribute.js +187 -0
  4. package/dist/Attribute.js.map +1 -0
  5. package/dist/Bencmark.js +179 -0
  6. package/dist/Bencmark.js.map +1 -0
  7. package/dist/Configuration.js +64 -0
  8. package/dist/Configuration.js.map +1 -0
  9. package/dist/Controller.js +39 -0
  10. package/dist/Controller.js.map +1 -0
  11. package/dist/DOM/DOMObject.js +45 -0
  12. package/dist/DOM/DOMObject.js.map +1 -0
  13. package/dist/DOM/WrappedDocument.js +34 -0
  14. package/dist/DOM/WrappedDocument.js.map +1 -0
  15. package/dist/DOM/WrappedWindow.js +45 -0
  16. package/dist/DOM/WrappedWindow.js.map +1 -0
  17. package/dist/DOM.js +547 -0
  18. package/dist/DOM.js.map +1 -0
  19. package/dist/Formats.js +44 -0
  20. package/dist/Formats.js.map +1 -0
  21. package/dist/Query.js +66 -0
  22. package/dist/Query.js.map +1 -0
  23. package/dist/Registry.js +138 -0
  24. package/dist/Registry.js.map +1 -0
  25. package/dist/Scope.js +505 -0
  26. package/dist/Scope.js.map +1 -0
  27. package/dist/Tag/List.js +85 -0
  28. package/dist/Tag/List.js.map +1 -0
  29. package/dist/Tag.js +715 -0
  30. package/dist/Tag.js.map +1 -0
  31. package/dist/Types.js +48 -0
  32. package/dist/Types.js.map +1 -0
  33. package/dist/Vision.js +161 -0
  34. package/dist/Vision.js.map +1 -0
  35. package/dist/attributes/AddClassIf.js +93 -0
  36. package/dist/attributes/AddClassIf.js.map +1 -0
  37. package/dist/attributes/Bind.js +272 -0
  38. package/dist/attributes/Bind.js.map +1 -0
  39. package/dist/attributes/ClassConstructor.js +104 -0
  40. package/dist/attributes/ClassConstructor.js.map +1 -0
  41. package/dist/attributes/ClickRemoveClass.js +102 -0
  42. package/dist/attributes/ClickRemoveClass.js.map +1 -0
  43. package/dist/attributes/ClickToggleClass.js +102 -0
  44. package/dist/attributes/ClickToggleClass.js.map +1 -0
  45. package/dist/attributes/ControllerAttribute.js +28 -0
  46. package/dist/attributes/ControllerAttribute.js.map +1 -0
  47. package/dist/attributes/DisableIf.js +94 -0
  48. package/dist/attributes/DisableIf.js.map +1 -0
  49. package/dist/attributes/Exec.js +102 -0
  50. package/dist/attributes/Exec.js.map +1 -0
  51. package/dist/attributes/Format.js +96 -0
  52. package/dist/attributes/Format.js.map +1 -0
  53. package/dist/attributes/If.js +147 -0
  54. package/dist/attributes/If.js.map +1 -0
  55. package/dist/attributes/JSONAttribute.js +115 -0
  56. package/dist/attributes/JSONAttribute.js.map +1 -0
  57. package/dist/attributes/KeyAbstract.js +110 -0
  58. package/dist/attributes/KeyAbstract.js.map +1 -0
  59. package/dist/attributes/KeyDown.js +82 -0
  60. package/dist/attributes/KeyDown.js.map +1 -0
  61. package/dist/attributes/KeyUp.js +82 -0
  62. package/dist/attributes/KeyUp.js.map +1 -0
  63. package/dist/attributes/List.js +273 -0
  64. package/dist/attributes/List.js.map +1 -0
  65. package/dist/attributes/ListItem.js +135 -0
  66. package/dist/attributes/ListItem.js.map +1 -0
  67. package/dist/attributes/ListItemModel.js +39 -0
  68. package/dist/attributes/ListItemModel.js.map +1 -0
  69. package/dist/attributes/ModelAttribute.js +29 -0
  70. package/dist/attributes/ModelAttribute.js.map +1 -0
  71. package/dist/attributes/Name.js +88 -0
  72. package/dist/attributes/Name.js.map +1 -0
  73. package/dist/attributes/On.js +123 -0
  74. package/dist/attributes/On.js.map +1 -0
  75. package/dist/attributes/Radio.js +127 -0
  76. package/dist/attributes/Radio.js.map +1 -0
  77. package/dist/attributes/Referenced.js +38 -0
  78. package/dist/attributes/Referenced.js.map +1 -0
  79. package/dist/attributes/RootAttribute.js +85 -0
  80. package/dist/attributes/RootAttribute.js.map +1 -0
  81. package/dist/attributes/ScopeAttribute.js +40 -0
  82. package/dist/attributes/ScopeAttribute.js.map +1 -0
  83. package/dist/attributes/ScopeChange.js +124 -0
  84. package/dist/attributes/ScopeChange.js.map +1 -0
  85. package/dist/attributes/SetAttribute.js +130 -0
  86. package/dist/attributes/SetAttribute.js.map +1 -0
  87. package/dist/attributes/StandardAttribute.js +168 -0
  88. package/dist/attributes/StandardAttribute.js.map +1 -0
  89. package/dist/attributes/Template.js +39 -0
  90. package/dist/attributes/Template.js.map +1 -0
  91. package/dist/attributes/TypeAttribute.js +101 -0
  92. package/dist/attributes/TypeAttribute.js.map +1 -0
  93. package/dist/attributes/_imports.js +58 -0
  94. package/dist/attributes/_imports.js.map +1 -0
  95. package/dist/helpers/DOMHelper.js +81 -0
  96. package/dist/helpers/DOMHelper.js.map +1 -0
  97. package/dist/helpers/ElementHelper.js +25 -0
  98. package/dist/helpers/ElementHelper.js.map +1 -0
  99. package/dist/helpers/VisionHelper.js +71 -0
  100. package/dist/helpers/VisionHelper.js.map +1 -0
  101. package/dist/helpers/decorators.js +38 -0
  102. package/dist/helpers/decorators.js.map +1 -0
  103. package/main.py +16 -0
  104. package/package.json +2 -2
  105. package/dist/vision.min.js +0 -1
@@ -0,0 +1,88 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,123 @@
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
@@ -0,0 +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;;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"}
@@ -0,0 +1,127 @@
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
@@ -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;;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"}
@@ -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,85 @@
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
@@ -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;;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"}
@@ -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,124 @@
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