vsn 0.1.130 → 0.1.132

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 (48) hide show
  1. package/demo/examples/cascading-function-sheets.html +27 -7
  2. package/demo/examples/item-filtering.html +1 -1
  3. package/demo/examples/persist.html +17 -0
  4. package/demo/resources/xhr-lazy.html +4 -3
  5. package/demo/resources/xhr-persist.html +40 -0
  6. package/demo/vsn.js +2 -2
  7. package/dist/AST/AssignmentNode.js.map +1 -1
  8. package/dist/AST/ClassNode.d.ts +3 -0
  9. package/dist/AST/ClassNode.js +10 -6
  10. package/dist/AST/ClassNode.js.map +1 -1
  11. package/dist/AST/FunctionNode.js +11 -3
  12. package/dist/AST/FunctionNode.js.map +1 -1
  13. package/dist/AST/IndexNode.js +0 -1
  14. package/dist/AST/IndexNode.js.map +1 -1
  15. package/dist/Attribute.js.map +1 -1
  16. package/dist/DOM/AbstractDOM.d.ts +1 -0
  17. package/dist/DOM/AbstractDOM.js +116 -91
  18. package/dist/DOM/AbstractDOM.js.map +1 -1
  19. package/dist/DOM/DOMObject.js +3 -0
  20. package/dist/DOM/DOMObject.js.map +1 -1
  21. package/dist/Tag.d.ts +1 -0
  22. package/dist/Tag.js +22 -9
  23. package/dist/Tag.js.map +1 -1
  24. package/dist/attributes/PersistAttribute.d.ts +15 -0
  25. package/dist/attributes/PersistAttribute.js +215 -0
  26. package/dist/attributes/PersistAttribute.js.map +1 -0
  27. package/dist/attributes/_imports.d.ts +1 -0
  28. package/dist/attributes/_imports.js +3 -1
  29. package/dist/attributes/_imports.js.map +1 -1
  30. package/dist/demo.min.js +3 -0
  31. package/dist/demo.min.js.LICENSE.txt +9 -0
  32. package/dist/version.d.ts +1 -1
  33. package/dist/version.js +1 -1
  34. package/dist/vsn.min.js +3 -0
  35. package/dist/vsn.min.js.LICENSE.txt +9 -0
  36. package/package.json +1 -1
  37. package/src/AST/AssignmentNode.ts +1 -0
  38. package/src/AST/ClassNode.ts +9 -4
  39. package/src/AST/FunctionNode.ts +11 -3
  40. package/src/AST/IndexNode.ts +0 -1
  41. package/src/Attribute.ts +0 -1
  42. package/src/DOM/AbstractDOM.ts +18 -3
  43. package/src/DOM/DOMObject.ts +3 -0
  44. package/src/Tag.ts +19 -10
  45. package/src/attributes/PersistAttribute.ts +83 -0
  46. package/src/attributes/_imports.ts +1 -0
  47. package/src/version.ts +1 -1
  48. package/test/AST/ClassNode.spec.ts +5 -5
@@ -9,20 +9,40 @@
9
9
  <body>
10
10
 
11
11
  <script type="text/javascript" src="../vsn.js"></script>
12
+
12
13
  <script type="text/vsn" vsn-script>
13
- class .btn {
14
+ class .testing {
15
+ func construct() {
16
+ log('.testing construct');
17
+ this.a|integer = 0;
18
+ log('this.a', this.a);
19
+ }
20
+
21
+ class .test {
22
+ func construct() {
23
+ log('.test construct');
24
+ ?<(.testing).a += 1;
25
+ }
26
+ }
27
+ }
28
+
29
+ class #testing {
14
30
  func construct() {
15
- log('btn construct', this);
31
+ log('#testing construct');
32
+ this.a|integer = 0;
33
+ log('this.a', this.a);
16
34
  }
17
35
 
18
- on click() {
19
- log('btn click');
36
+ class .test {
37
+ func construct() {
38
+ log('.test construct');
39
+ ?<(.testing).a += 1;
40
+ }
20
41
  }
21
42
  }
22
43
  </script>
23
- <div id="test"></div>
24
- <div id="html-container"></div>
25
- <a href="../resources/xhr-cfs.html" vsn-xhr="#html-container.@html = response;?(#html-header).$color='yellow';" class="btn">XHR</a>
44
+ <div id="testing" class="testing"><span class="test"></span><span class="test"></span><span class="test"></span></div>
45
+ <button vsn-on:click="log(?(.testing).a)">wut</button>
26
46
 
27
47
  </body>
28
48
  </html>
@@ -25,7 +25,7 @@
25
25
  on keyup() {
26
26
  val = @value;
27
27
  if (val) {
28
- val = val.toLowerCase();
28
+ val = val.toLowerCase().trim();
29
29
  for (ele of ?(#items .item)) {
30
30
  if (ele.@itemname.indexOf(val) > -1) {
31
31
  ele.$display = 'list-item';
@@ -0,0 +1,17 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Persist</title>
6
+
7
+ <style></style>
8
+ </head>
9
+ <body>
10
+
11
+ <script type="text/javascript" src="../vsn.js"></script>
12
+
13
+ <div id="container" vsn-lazy="@html = << '../resources/xhr-persist.html'"></div>
14
+ <button vsn-on:click="#container.@html = << '../resources/xhr-persist.html'">Load Persist</button>
15
+ <button vsn-on:click="#container.@html = << '../resources/xhr-html.html'">Load Test</button>
16
+ </body>
17
+ </html>
@@ -12,7 +12,8 @@
12
12
  class input {
13
13
  func construct() {
14
14
  log('.simple input construct');
15
- a|float = 0.0;
15
+ this.a|float = 0.0;
16
+ log(this.a);
16
17
  @value = 'wut';
17
18
  }
18
19
 
@@ -22,8 +23,8 @@
22
23
 
23
24
  on focus() {
24
25
  log(@type);
25
- a += 0.1;
26
- log(a);
26
+ this.a += 0.1;
27
+ log(this.a);
27
28
  }
28
29
 
29
30
  on mouseenter() {
@@ -0,0 +1,40 @@
1
+ <style>
2
+ #nav-test {
3
+ display: none;
4
+ }
5
+ #nav-test.open {
6
+ display: block;
7
+ }
8
+
9
+ #nav-test.highlight {
10
+ color: #0074D9;
11
+ }
12
+ </style>
13
+ <div vsn-lazy="#nav-test.@class ~ 'open'">
14
+ <ul id="nav-test" vsn-persist="@class">
15
+ <li>Foo</li>
16
+ <li>Bar</li>
17
+ </ul>
18
+ <button vsn-on:click="#nav-test.@class ~ 'open'">Toggle</button>
19
+ <button vsn-on:click="#nav-test.@class ~ 'highlight'">Highlight</button>
20
+
21
+ <input id="input-test" vsn-persist="@value" />
22
+ </div>
23
+
24
+ <script type="text/vsn" vsn-script>
25
+ class #input-test {
26
+ func construct() {
27
+ this.search();
28
+ }
29
+
30
+ on input() {
31
+ this.search();
32
+ }
33
+
34
+ func search() {
35
+ if (@value) {
36
+ log('input value', @value.trim());
37
+ }
38
+ }
39
+ }
40
+ </script>