vasille 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cdn/es2015.js CHANGED
@@ -1749,9 +1749,15 @@ class Reactive extends Destroyable {
1749
1749
  applyOptions(input) {
1750
1750
  // empty
1751
1751
  }
1752
+ applyOptionsNow() {
1753
+ this.applyOptions(this.input);
1754
+ }
1752
1755
  compose(input) {
1753
1756
  // empty
1754
1757
  }
1758
+ composeNow() {
1759
+ this.compose(this.input);
1760
+ }
1755
1761
  runFunctional(f, ...args) {
1756
1762
  stack(this);
1757
1763
  // yet another ts bug
@@ -1838,6 +1844,10 @@ class Fragment extends Reactive {
1838
1844
  const $ = this.$;
1839
1845
  $.preinit(app, parent);
1840
1846
  }
1847
+ init() {
1848
+ super.init();
1849
+ this.ready();
1850
+ }
1841
1851
  compose(input) {
1842
1852
  super.compose(input);
1843
1853
  input.slot && input.slot(this);
@@ -1948,7 +1958,6 @@ class Fragment extends Reactive {
1948
1958
  node.input.slot = callback || node.input.slot;
1949
1959
  this.pushNode(node);
1950
1960
  node.init();
1951
- node.ready();
1952
1961
  }
1953
1962
  /**
1954
1963
  * Defines an if node
@@ -2453,6 +2462,11 @@ class Extension extends INode {
2453
2462
  * @extends Extension
2454
2463
  */
2455
2464
  class Component extends Extension {
2465
+ init() {
2466
+ super.composeNow();
2467
+ this.ready();
2468
+ super.applyOptionsNow();
2469
+ }
2456
2470
  ready() {
2457
2471
  super.ready();
2458
2472
  if (this.children.size !== 1) {
package/cdn/es5.js CHANGED
@@ -13,7 +13,7 @@ var __spreadArray = function (to, from, pack) {
13
13
  };
14
14
 
15
15
  var __assign = function(o1, o2) {
16
- for (let i in o2) {
16
+ for (var i in o2) {
17
17
  o1[i] = o2[i];
18
18
  }
19
19
 
@@ -182,7 +182,7 @@ window.Reflect = window.Reflect || {
182
182
  return false;
183
183
  },
184
184
  ownKeys: function (obj) {
185
- let ret = [];
185
+ var ret = [];
186
186
 
187
187
  for (var i in obj) {
188
188
  if (obj.hasOwnProperty(i)) {
@@ -2111,9 +2111,15 @@ var Reactive = /** @class */ (function (_super) {
2111
2111
  Reactive.prototype.applyOptions = function (input) {
2112
2112
  // empty
2113
2113
  };
2114
+ Reactive.prototype.applyOptionsNow = function () {
2115
+ this.applyOptions(this.input);
2116
+ };
2114
2117
  Reactive.prototype.compose = function (input) {
2115
2118
  // empty
2116
2119
  };
2120
+ Reactive.prototype.composeNow = function () {
2121
+ this.compose(this.input);
2122
+ };
2117
2123
  Reactive.prototype.runFunctional = function (f) {
2118
2124
  var args = [];
2119
2125
  for (var _i = 1; _i < arguments.length; _i++) {
@@ -2217,6 +2223,10 @@ var Fragment = /** @class */ (function (_super) {
2217
2223
  var $ = this.$;
2218
2224
  $.preinit(app, parent);
2219
2225
  };
2226
+ Fragment.prototype.init = function () {
2227
+ _super.prototype.init.call(this);
2228
+ this.ready();
2229
+ };
2220
2230
  Fragment.prototype.compose = function (input) {
2221
2231
  _super.prototype.compose.call(this, input);
2222
2232
  input.slot && input.slot(this);
@@ -2327,7 +2337,6 @@ var Fragment = /** @class */ (function (_super) {
2327
2337
  node.input.slot = callback || node.input.slot;
2328
2338
  this.pushNode(node);
2329
2339
  node.init();
2330
- node.ready();
2331
2340
  };
2332
2341
  /**
2333
2342
  * Defines an if node
@@ -2872,6 +2881,11 @@ var Component = /** @class */ (function (_super) {
2872
2881
  function Component() {
2873
2882
  return _super !== null && _super.apply(this, arguments) || this;
2874
2883
  }
2884
+ Component.prototype.init = function () {
2885
+ _super.prototype.composeNow.call(this);
2886
+ this.ready();
2887
+ _super.prototype.applyOptionsNow.call(this);
2888
+ };
2875
2889
  Component.prototype.ready = function () {
2876
2890
  _super.prototype.ready.call(this);
2877
2891
  if (this.children.size !== 1) {
@@ -637,7 +637,8 @@ declare class Fragment<T> extends Reactive {
637
637
  * @param data {*} additional data
638
638
  */
639
639
  preinit(app: AppNode, parent: Fragment, data?: any): void;
640
- compose(input: Options): void;
640
+ init(): void;
641
+ compose(input: T): void;
641
642
  /** To be overloaded: ready event handler */
642
643
  ready(): void;
643
644
  /**
@@ -887,6 +888,7 @@ declare class Extension<T> extends INode<T> {
887
888
  * @extends Extension
888
889
  */
889
890
  declare class Component<T> extends Extension<T> {
891
+ init(): void;
890
892
  ready(): void;
891
893
  preinit(app: AppNode, parent: Fragment): void;
892
894
  }
@@ -1342,7 +1344,9 @@ declare class Reactive<T> extends Destroyable {
1342
1344
  bindAlive(cond: IValue<boolean>, onOff?: () => void, onOn?: () => void): this;
1343
1345
  init(): void;
1344
1346
  applyOptions(input: T): void;
1347
+ applyOptionsNow(): void;
1345
1348
  compose(input: T): void;
1349
+ composeNow(): void;
1346
1350
  runFunctional<F>(f: F, ...args: Parameters<F>): ReturnType<F>;
1347
1351
  runOnDestroy(func: () => void): void;
1348
1352
  destroy(): void;
package/lib/core/core.js CHANGED
@@ -209,9 +209,15 @@ export class Reactive extends Destroyable {
209
209
  applyOptions(input) {
210
210
  // empty
211
211
  }
212
+ applyOptionsNow() {
213
+ this.applyOptions(this.input);
214
+ }
212
215
  compose(input) {
213
216
  // empty
214
217
  }
218
+ composeNow() {
219
+ this.compose(this.input);
220
+ }
215
221
  runFunctional(f, ...args) {
216
222
  stack(this);
217
223
  // yet another ts bug
package/lib/node/node.js CHANGED
@@ -69,6 +69,10 @@ export class Fragment extends Reactive {
69
69
  const $ = this.$;
70
70
  $.preinit(app, parent);
71
71
  }
72
+ init() {
73
+ super.init();
74
+ this.ready();
75
+ }
72
76
  compose(input) {
73
77
  super.compose(input);
74
78
  input.slot && input.slot(this);
@@ -179,7 +183,6 @@ export class Fragment extends Reactive {
179
183
  node.input.slot = callback || node.input.slot;
180
184
  this.pushNode(node);
181
185
  node.init();
182
- node.ready();
183
186
  }
184
187
  /**
185
188
  * Defines an if node
@@ -684,6 +687,11 @@ export class Extension extends INode {
684
687
  * @extends Extension
685
688
  */
686
689
  export class Component extends Extension {
690
+ init() {
691
+ super.composeNow();
692
+ this.ready();
693
+ super.applyOptionsNow();
694
+ }
687
695
  ready() {
688
696
  super.ready();
689
697
  if (this.children.size !== 1) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Vasille - Safe. Fast. Powerful.",
4
4
  "main": "lib/index.js",
5
5
  "types": "types/index.d.ts",
6
- "version": "2.2.0",
6
+ "version": "2.2.1",
7
7
  "exports": {
8
8
  "import": "./lib/index.js",
9
9
  "browser": "./lib/index.js"
@@ -123,7 +123,9 @@ export declare class Reactive<T extends Options = Options> extends Destroyable {
123
123
  bindAlive(cond: IValue<boolean>, onOff?: () => void, onOn?: () => void): this;
124
124
  init(): void;
125
125
  protected applyOptions(input: T): void;
126
+ protected applyOptionsNow(): void;
126
127
  protected compose(input: T): void;
128
+ protected composeNow(): void;
127
129
  runFunctional<F extends (...args: any) => any>(f: F, ...args: Parameters<F>): ReturnType<F>;
128
130
  runOnDestroy(func: () => void): void;
129
131
  destroy(): void;
@@ -74,7 +74,8 @@ export declare class Fragment<T extends Options = Options> extends Reactive {
74
74
  * @param data {*} additional data
75
75
  */
76
76
  preinit(app: AppNode, parent: Fragment, data?: unknown): void;
77
- protected compose(input: Options): void;
77
+ init(): void;
78
+ protected compose(input: T): void;
78
79
  /** To be overloaded: ready event handler */
79
80
  ready(): void;
80
81
  /**
@@ -324,6 +325,7 @@ export declare class Extension<T extends TagOptions<any> = TagOptions<any>> exte
324
325
  * @extends Extension
325
326
  */
326
327
  export declare class Component<T extends TagOptions<any>> extends Extension<T> {
328
+ init(): void;
327
329
  ready(): void;
328
330
  preinit(app: AppNode, parent: Fragment): void;
329
331
  }