dothtml 4.8.6 → 5.0.2

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 (80) hide show
  1. package/{jest.config.js → jest.config.ts} +19 -16
  2. package/lib/arg-callback-obj.d.ts +29 -0
  3. package/lib/built-in-components/nav-link.d.ts +8 -0
  4. package/lib/built-in-components/router.d.ts +57 -0
  5. package/lib/component.d.ts +73 -0
  6. package/lib/dot-component-legacy.d.ts +0 -0
  7. package/lib/dot-document.d.ts +0 -0
  8. package/lib/dot-util.d.ts +13 -0
  9. package/lib/dot.d.ts +5 -0
  10. package/lib/dothtml.d.ts +21 -0
  11. package/lib/dothtml.js +2 -0
  12. package/lib/dothtml.js.LICENSE.txt +1 -0
  13. package/lib/err.d.ts +2 -0
  14. package/lib/event-bus.d.ts +10 -0
  15. package/lib/i-dot.d.ts +674 -0
  16. package/lib/i-dotcss.d.ts +827 -0
  17. package/lib/node-polyfill.d.ts +2 -0
  18. package/lib/observable-array.d.ts +49 -0
  19. package/lib/style-builder.d.ts +3 -0
  20. package/package.json +11 -5
  21. package/readme.md +3 -2
  22. package/src/{arg-callback-obj.js → arg-callback-obj.ts} +18 -6
  23. package/src/built-in-components/nav-link.ts +21 -0
  24. package/src/built-in-components/router.ts +315 -0
  25. package/src/component.ts +369 -0
  26. package/src/dot-component-legacy.ts +79 -0
  27. package/src/dot-document.ts +0 -0
  28. package/src/dot-util.ts +33 -0
  29. package/src/dot.ts +1147 -0
  30. package/src/dothtml.ts +33 -0
  31. package/src/err.ts +22 -0
  32. package/src/event-bus.ts +39 -0
  33. package/src/i-dot.ts +787 -0
  34. package/src/i-dotcss.ts +918 -0
  35. package/src/node-polyfill.ts +11 -0
  36. package/src/{observable-array.js → observable-array.ts} +10 -5
  37. package/src/{style-builder.js → style-builder.ts} +219 -183
  38. package/tsconfig.json +99 -0
  39. package/unittests/advanced-bindings.test.ts +421 -0
  40. package/unittests/{array-evaluation.test.js → array-evaluation.test.ts} +1 -1
  41. package/unittests/{basic-functionality.test.js → basic-functionality.test.ts} +14 -10
  42. package/unittests/class-binding.test.ts +227 -0
  43. package/unittests/component-decorator.-.ts +14 -0
  44. package/unittests/components-data.test.ts +153 -0
  45. package/unittests/components.test.ts +257 -0
  46. package/unittests/computed.test.ts +35 -0
  47. package/unittests/{core.js → core.ts} +5 -2
  48. package/unittests/element-and-attribute-coverage.test.ts +472 -0
  49. package/unittests/hooks.test.ts +67 -0
  50. package/unittests/immutable-if.test.ts +19 -0
  51. package/unittests/input-bindings.test.ts +166 -0
  52. package/unittests/integration.test.ts +5 -0
  53. package/unittests/{iterations.test.js → iterations.test.ts} +5 -5
  54. package/unittests/logic.test.ts +18 -0
  55. package/unittests/refs.test.ts +36 -0
  56. package/unittests/routing.-.ts +56 -0
  57. package/unittests/{scopes.test.js → scopes.test.ts} +5 -5
  58. package/unittests/special-tags.test.ts +39 -0
  59. package/unittests/styles.test.ts +9 -0
  60. package/unittests/{testpage.js → testpage.ts} +2 -0
  61. package/unittests/{wait.test.js → wait.test.ts} +8 -5
  62. package/webpack.config.js +13 -1
  63. package/lib/dothtml.min.js +0 -1
  64. package/src/component.js +0 -305
  65. package/src/err.js +0 -20
  66. package/src/event-bus.js +0 -40
  67. package/src/index.js +0 -1453
  68. package/src/util.js +0 -13
  69. package/unittests/advanced-bindings.test.js +0 -386
  70. package/unittests/class-binding.test.js +0 -53
  71. package/unittests/components-data.test.js +0 -97
  72. package/unittests/components.test.js +0 -151
  73. package/unittests/computed.test.js +0 -36
  74. package/unittests/hooks.test.js +0 -57
  75. package/unittests/immutable-if.test.js +0 -15
  76. package/unittests/input-bindings.test.js +0 -155
  77. package/unittests/integration.test.js +0 -6
  78. package/unittests/logic.test.js +0 -18
  79. package/unittests/routing.-.js +0 -56
  80. package/unittests/special-tags.test.js +0 -32
@@ -0,0 +1,11 @@
1
+
2
+ var NodePolyfill: unknown = window.Node;
3
+ if(!Node){
4
+ NodePolyfill = class{
5
+ ELEMENT_NODE: number = 1;
6
+ ATTRIBUTE_NODE: number = 2;
7
+ TEXT_NODE: number = 3;
8
+ };
9
+ }
10
+
11
+ export default (NodePolyfill as Node);
@@ -1,15 +1,14 @@
1
- import { removeComponent } from "./component";
2
1
 
3
- export default function ObservableArray(items, target) {
2
+
3
+ export default function ObservableArray(items/*, ...target: Array<any>*/) {
4
4
  var _self = this,
5
5
  _array = [],
6
6
  _handlers = {
7
7
  itemadded: [],
8
8
  itemremoved: [],
9
- itemset: []
9
+ itemset: [],
10
+ read: []
10
11
  };
11
-
12
- this._dependencies = [];
13
12
 
14
13
  function defineIndexProperty(index) {
15
14
  if (!(index in _self)) {
@@ -17,6 +16,11 @@ export default function ObservableArray(items, target) {
17
16
  configurable: true,
18
17
  enumerable: true,
19
18
  get: function() {
19
+ raiseEvent({
20
+ type: "read",
21
+ index: index,
22
+ item: _array[index]
23
+ });
20
24
  return _array[index];
21
25
  },
22
26
  set: function(v) {
@@ -233,6 +237,7 @@ export default function ObservableArray(items, target) {
233
237
  }
234
238
  }
235
239
 
240
+ ObservableArray.prototype.length = 0;
236
241
 
237
242
  /**
238
243