vasille 2.2.2 → 2.3.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.
- package/README.md +34 -28
- package/cdn/es2015.js +18 -724
- package/cdn/es5.js +687 -957
- package/flow-typed/vasille.js +14 -59
- package/lib/core/core.js +3 -3
- package/lib/index.js +5 -4
- package/lib/models/array-model.js +6 -9
- package/lib/models/object-model.js +3 -17
- package/lib/node/node.js +6 -3
- package/lib/views/object-view.js +1 -1
- package/lib-node/binding/attribute.js +35 -0
- package/lib-node/binding/binding.js +33 -0
- package/lib-node/binding/class.js +48 -0
- package/lib-node/binding/style.js +27 -0
- package/lib-node/core/core.js +243 -0
- package/lib-node/core/destroyable.js +49 -0
- package/lib-node/core/errors.js +23 -0
- package/lib-node/core/ivalue.js +63 -0
- package/lib-node/functional/options.js +2 -0
- package/lib-node/index.js +54 -0
- package/lib-node/models/array-model.js +218 -0
- package/lib-node/models/listener.js +134 -0
- package/lib-node/models/map-model.js +70 -0
- package/lib-node/models/model.js +2 -0
- package/lib-node/models/object-model.js +82 -0
- package/lib-node/models/set-model.js +66 -0
- package/lib-node/node/app.js +54 -0
- package/lib-node/node/node.js +885 -0
- package/lib-node/node/watch.js +23 -0
- package/lib-node/spec/html.js +2 -0
- package/lib-node/spec/react.js +2 -0
- package/lib-node/spec/svg.js +2 -0
- package/lib-node/value/expression.js +90 -0
- package/lib-node/value/mirror.js +60 -0
- package/lib-node/value/pointer.js +30 -0
- package/lib-node/value/reference.js +55 -0
- package/lib-node/views/array-view.js +21 -0
- package/lib-node/views/base-view.js +43 -0
- package/lib-node/views/map-view.js +18 -0
- package/lib-node/views/object-view.js +20 -0
- package/lib-node/views/repeat-node.js +71 -0
- package/lib-node/views/set-view.js +19 -0
- package/package.json +21 -17
- package/types/core/core.d.ts +4 -4
- package/types/functional/options.d.ts +2 -2
- package/types/index.d.ts +10 -7
- package/types/models/array-model.d.ts +1 -1
- package/types/models/object-model.d.ts +1 -1
- package/types/node/node.d.ts +5 -4
- package/types/node/watch.d.ts +2 -2
- package/types/views/repeat-node.d.ts +2 -2
- package/lib/core/executor.js +0 -154
- package/lib/core/signal.js +0 -50
- package/lib/core/slot.js +0 -47
- package/lib/functional/components.js +0 -17
- package/lib/functional/merge.js +0 -41
- package/lib/functional/models.js +0 -26
- package/lib/functional/reactivity.js +0 -33
- package/lib/functional/stack.js +0 -127
- package/lib/node/interceptor.js +0 -83
- package/lib/v/index.js +0 -23
- package/lib/views/repeater.js +0 -63
- package/types/functional/components.d.ts +0 -4
- package/types/functional/merge.d.ts +0 -1
- package/types/functional/models.d.ts +0 -10
- package/types/functional/reactivity.d.ts +0 -11
- package/types/functional/stack.d.ts +0 -24
- package/types/v/index.d.ts +0 -36
package/cdn/es5.js
CHANGED
|
@@ -198,10 +198,14 @@ window.Proxy = window.Proxy || function (obj) {
|
|
|
198
198
|
return obj;
|
|
199
199
|
};
|
|
200
200
|
// ./lib-es5/models/model.js
|
|
201
|
-
|
|
201
|
+
"use strict";
|
|
202
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
202
203
|
|
|
203
204
|
|
|
204
205
|
// ./lib-es5/models/listener.js
|
|
206
|
+
"use strict";
|
|
207
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
208
|
+
exports.Listener = void 0;
|
|
205
209
|
/**
|
|
206
210
|
* Represent a listener for a model
|
|
207
211
|
* @class Listener
|
|
@@ -335,11 +339,29 @@ var Listener = /** @class */ (function () {
|
|
|
335
339
|
};
|
|
336
340
|
return Listener;
|
|
337
341
|
}());
|
|
342
|
+
exports.Listener = Listener;
|
|
338
343
|
|
|
339
344
|
|
|
340
|
-
window.Listener = Listener;
|
|
341
|
-
|
|
342
345
|
// ./lib-es5/models/object-model.js
|
|
346
|
+
"use strict";
|
|
347
|
+
var __extends = (this && this.__extends) || (function () {
|
|
348
|
+
var extendStatics = function (d, b) {
|
|
349
|
+
extendStatics = Object.setPrototypeOf ||
|
|
350
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
351
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
352
|
+
return extendStatics(d, b);
|
|
353
|
+
};
|
|
354
|
+
return function (d, b) {
|
|
355
|
+
if (typeof b !== "function" && b !== null)
|
|
356
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
357
|
+
extendStatics(d, b);
|
|
358
|
+
function __() { this.constructor = d; }
|
|
359
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
360
|
+
};
|
|
361
|
+
})();
|
|
362
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
363
|
+
exports.ObjectModel = void 0;
|
|
364
|
+
var listener_1 = require("./listener");
|
|
343
365
|
/**
|
|
344
366
|
* Object based model
|
|
345
367
|
* @extends Object
|
|
@@ -355,7 +377,7 @@ var ObjectModel = /** @class */ (function (_super) {
|
|
|
355
377
|
var _this = this; _super.call(this);
|
|
356
378
|
_this.container = Object.create(null);
|
|
357
379
|
Object.defineProperty(_this, 'listener', {
|
|
358
|
-
value: new Listener,
|
|
380
|
+
value: new listener_1.Listener,
|
|
359
381
|
writable: false,
|
|
360
382
|
configurable: false
|
|
361
383
|
});
|
|
@@ -400,6 +422,13 @@ var ObjectModel = /** @class */ (function (_super) {
|
|
|
400
422
|
this.listener.emitAdded(key, this.container[key]);
|
|
401
423
|
return this;
|
|
402
424
|
};
|
|
425
|
+
Object.defineProperty(ObjectModel.prototype, "values", {
|
|
426
|
+
get: function () {
|
|
427
|
+
return this.container;
|
|
428
|
+
},
|
|
429
|
+
enumerable: false,
|
|
430
|
+
configurable: true
|
|
431
|
+
});
|
|
403
432
|
/**
|
|
404
433
|
* Deletes an object property
|
|
405
434
|
* @param key {string} property name
|
|
@@ -410,23 +439,6 @@ var ObjectModel = /** @class */ (function (_super) {
|
|
|
410
439
|
delete this.container[key];
|
|
411
440
|
}
|
|
412
441
|
};
|
|
413
|
-
ObjectModel.prototype.proxy = function () {
|
|
414
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
415
|
-
var ts = this;
|
|
416
|
-
return new Proxy(this.container, {
|
|
417
|
-
get: function (target, p) {
|
|
418
|
-
return ts.get(p);
|
|
419
|
-
},
|
|
420
|
-
set: function (target, p, value) {
|
|
421
|
-
ts.set(p, value);
|
|
422
|
-
return true;
|
|
423
|
-
},
|
|
424
|
-
deleteProperty: function (target, p) {
|
|
425
|
-
ts.delete(p);
|
|
426
|
-
return true;
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
};
|
|
430
442
|
ObjectModel.prototype.enableReactivity = function () {
|
|
431
443
|
this.listener.enableReactivity();
|
|
432
444
|
};
|
|
@@ -435,11 +447,29 @@ var ObjectModel = /** @class */ (function (_super) {
|
|
|
435
447
|
};
|
|
436
448
|
return ObjectModel;
|
|
437
449
|
}(Object));
|
|
450
|
+
exports.ObjectModel = ObjectModel;
|
|
438
451
|
|
|
439
452
|
|
|
440
|
-
window.ObjectModel = ObjectModel;
|
|
441
|
-
|
|
442
453
|
// ./lib-es5/models/set-model.js
|
|
454
|
+
"use strict";
|
|
455
|
+
var __extends = (this && this.__extends) || (function () {
|
|
456
|
+
var extendStatics = function (d, b) {
|
|
457
|
+
extendStatics = Object.setPrototypeOf ||
|
|
458
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
459
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
460
|
+
return extendStatics(d, b);
|
|
461
|
+
};
|
|
462
|
+
return function (d, b) {
|
|
463
|
+
if (typeof b !== "function" && b !== null)
|
|
464
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
465
|
+
extendStatics(d, b);
|
|
466
|
+
function __() { this.constructor = d; }
|
|
467
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
468
|
+
};
|
|
469
|
+
})();
|
|
470
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
471
|
+
exports.SetModel = void 0;
|
|
472
|
+
var listener_1 = require("./listener");
|
|
443
473
|
/**
|
|
444
474
|
* A Set based model
|
|
445
475
|
* @class SetModel
|
|
@@ -456,7 +486,7 @@ var SetModel = /** @class */ (function (_super) {
|
|
|
456
486
|
if (set === void 0) { set = []; }
|
|
457
487
|
var _this = this; _super.call(this);
|
|
458
488
|
Object.defineProperty(_this, 'listener', {
|
|
459
|
-
value: new Listener,
|
|
489
|
+
value: new listener_1.Listener,
|
|
460
490
|
writable: false,
|
|
461
491
|
configurable: false
|
|
462
492
|
});
|
|
@@ -506,11 +536,29 @@ var SetModel = /** @class */ (function (_super) {
|
|
|
506
536
|
};
|
|
507
537
|
return SetModel;
|
|
508
538
|
}(Set));
|
|
539
|
+
exports.SetModel = SetModel;
|
|
509
540
|
|
|
510
541
|
|
|
511
|
-
window.SetModel = SetModel;
|
|
512
|
-
|
|
513
542
|
// ./lib-es5/models/map-model.js
|
|
543
|
+
"use strict";
|
|
544
|
+
var __extends = (this && this.__extends) || (function () {
|
|
545
|
+
var extendStatics = function (d, b) {
|
|
546
|
+
extendStatics = Object.setPrototypeOf ||
|
|
547
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
548
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
549
|
+
return extendStatics(d, b);
|
|
550
|
+
};
|
|
551
|
+
return function (d, b) {
|
|
552
|
+
if (typeof b !== "function" && b !== null)
|
|
553
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
554
|
+
extendStatics(d, b);
|
|
555
|
+
function __() { this.constructor = d; }
|
|
556
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
557
|
+
};
|
|
558
|
+
})();
|
|
559
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
560
|
+
exports.MapModel = void 0;
|
|
561
|
+
var listener_1 = require("./listener");
|
|
514
562
|
/**
|
|
515
563
|
* A Map based memory
|
|
516
564
|
* @class MapModel
|
|
@@ -527,7 +575,7 @@ var MapModel = /** @class */ (function (_super) {
|
|
|
527
575
|
if (map === void 0) { map = []; }
|
|
528
576
|
var _this = this; _super.call(this);
|
|
529
577
|
Object.defineProperty(_this, 'listener', {
|
|
530
|
-
value: new Listener,
|
|
578
|
+
value: new listener_1.Listener,
|
|
531
579
|
writable: false,
|
|
532
580
|
configurable: false
|
|
533
581
|
});
|
|
@@ -582,11 +630,38 @@ var MapModel = /** @class */ (function (_super) {
|
|
|
582
630
|
};
|
|
583
631
|
return MapModel;
|
|
584
632
|
}(Map));
|
|
633
|
+
exports.MapModel = MapModel;
|
|
585
634
|
|
|
586
635
|
|
|
587
|
-
window.MapModel = MapModel;
|
|
588
|
-
|
|
589
636
|
// ./lib-es5/models/array-model.js
|
|
637
|
+
"use strict";
|
|
638
|
+
var __extends = (this && this.__extends) || (function () {
|
|
639
|
+
var extendStatics = function (d, b) {
|
|
640
|
+
extendStatics = Object.setPrototypeOf ||
|
|
641
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
642
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
643
|
+
return extendStatics(d, b);
|
|
644
|
+
};
|
|
645
|
+
return function (d, b) {
|
|
646
|
+
if (typeof b !== "function" && b !== null)
|
|
647
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
648
|
+
extendStatics(d, b);
|
|
649
|
+
function __() { this.constructor = d; }
|
|
650
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
651
|
+
};
|
|
652
|
+
})();
|
|
653
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
654
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
655
|
+
if (ar || !(i in from)) {
|
|
656
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
657
|
+
ar[i] = from[i];
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
661
|
+
};
|
|
662
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
663
|
+
exports.ArrayModel = void 0;
|
|
664
|
+
var listener_1 = require("./listener");
|
|
590
665
|
/**
|
|
591
666
|
* Model based on Array class
|
|
592
667
|
* @extends Array
|
|
@@ -601,7 +676,7 @@ var ArrayModel = /** @class */ (function (_super) {
|
|
|
601
676
|
if (data === void 0) { data = []; }
|
|
602
677
|
var _this = this; _super.call(this);
|
|
603
678
|
Object.defineProperty(_this, 'listener', {
|
|
604
|
-
value: new Listener,
|
|
679
|
+
value: new listener_1.Listener,
|
|
605
680
|
writable: false,
|
|
606
681
|
configurable: false
|
|
607
682
|
});
|
|
@@ -610,15 +685,6 @@ var ArrayModel = /** @class */ (function (_super) {
|
|
|
610
685
|
}
|
|
611
686
|
return _this;
|
|
612
687
|
}
|
|
613
|
-
// proxy
|
|
614
|
-
ArrayModel.prototype.proxy = function () {
|
|
615
|
-
return new Proxy(this, {
|
|
616
|
-
set: function (target, p, value) {
|
|
617
|
-
target.splice(parseInt(p), 1, value);
|
|
618
|
-
return true;
|
|
619
|
-
}
|
|
620
|
-
});
|
|
621
|
-
};
|
|
622
688
|
Object.defineProperty(ArrayModel.prototype, "last", {
|
|
623
689
|
/* Array members */
|
|
624
690
|
/**
|
|
@@ -817,6 +883,12 @@ var ArrayModel = /** @class */ (function (_super) {
|
|
|
817
883
|
this.removeAt(this.indexOf(v));
|
|
818
884
|
return this;
|
|
819
885
|
};
|
|
886
|
+
ArrayModel.prototype.replace = function (at, with_) {
|
|
887
|
+
this.listener.emitAdded(this[at], with_);
|
|
888
|
+
this.listener.emitRemoved(this[at], this[at]);
|
|
889
|
+
this[at] = with_;
|
|
890
|
+
return this;
|
|
891
|
+
};
|
|
820
892
|
ArrayModel.prototype.enableReactivity = function () {
|
|
821
893
|
this.listener.enableReactivity();
|
|
822
894
|
};
|
|
@@ -825,329 +897,39 @@ var ArrayModel = /** @class */ (function (_super) {
|
|
|
825
897
|
};
|
|
826
898
|
return ArrayModel;
|
|
827
899
|
}(Array));
|
|
900
|
+
exports.ArrayModel = ArrayModel;
|
|
828
901
|
|
|
829
902
|
|
|
830
|
-
window.ArrayModel = ArrayModel;
|
|
831
|
-
|
|
832
|
-
// ./lib-es5/core/signal.js
|
|
833
|
-
/**
|
|
834
|
-
* Signal is an event generator
|
|
835
|
-
* @class Signal
|
|
836
|
-
*/
|
|
837
|
-
var Signal = /** @class */ (function () {
|
|
838
|
-
function Signal() {
|
|
839
|
-
/**
|
|
840
|
-
* Handler of event
|
|
841
|
-
* @type {Set}
|
|
842
|
-
* @private
|
|
843
|
-
*/
|
|
844
|
-
this.handlers = new Set;
|
|
845
|
-
}
|
|
846
|
-
/**
|
|
847
|
-
* Emit event
|
|
848
|
-
* @param a1 {*} argument
|
|
849
|
-
* @param a2 {*} argument
|
|
850
|
-
* @param a3 {*} argument
|
|
851
|
-
* @param a4 {*} argument
|
|
852
|
-
* @param a5 {*} argument
|
|
853
|
-
* @param a6 {*} argument
|
|
854
|
-
* @param a7 {*} argument
|
|
855
|
-
* @param a8 {*} argument
|
|
856
|
-
* @param a9 {*} argument
|
|
857
|
-
*/
|
|
858
|
-
Signal.prototype.emit = function (a1, a2, a3, a4, a5, a6, a7, a8, a9) {
|
|
859
|
-
this.handlers.forEach(function (handler) {
|
|
860
|
-
try {
|
|
861
|
-
handler(a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
|
862
|
-
}
|
|
863
|
-
catch (e) {
|
|
864
|
-
console.error("Vasille.js: Handler throw exception: ", e);
|
|
865
|
-
}
|
|
866
|
-
});
|
|
867
|
-
};
|
|
868
|
-
/**
|
|
869
|
-
* Subscribe to event
|
|
870
|
-
* @param func {function} handler
|
|
871
|
-
*/
|
|
872
|
-
Signal.prototype.subscribe = function (func) {
|
|
873
|
-
this.handlers.add(func);
|
|
874
|
-
};
|
|
875
|
-
/**
|
|
876
|
-
* Unsubscribe from event
|
|
877
|
-
* @param func {function} handler
|
|
878
|
-
*/
|
|
879
|
-
Signal.prototype.unsubscribe = function (func) {
|
|
880
|
-
this.handlers.delete(func);
|
|
881
|
-
};
|
|
882
|
-
return Signal;
|
|
883
|
-
}());
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
window.Signal = Signal;
|
|
887
|
-
|
|
888
|
-
// ./lib-es5/core/slot.js
|
|
889
|
-
/**
|
|
890
|
-
* Component slot
|
|
891
|
-
* @class Slot
|
|
892
|
-
*/
|
|
893
|
-
var Slot = /** @class */ (function () {
|
|
894
|
-
function Slot() {
|
|
895
|
-
}
|
|
896
|
-
/**
|
|
897
|
-
* Sets the runner
|
|
898
|
-
* @param func {function} the function to run
|
|
899
|
-
*/
|
|
900
|
-
Slot.prototype.insert = function (func) {
|
|
901
|
-
this.runner = func;
|
|
902
|
-
};
|
|
903
|
-
/**
|
|
904
|
-
* @param a0 {Fragment} node to paste content
|
|
905
|
-
* @param a1 {*} 1st argument
|
|
906
|
-
* @param a2 {*} 2nd argument
|
|
907
|
-
* @param a3 {*} 3rd argument
|
|
908
|
-
* @param a4 {*} 4th argument
|
|
909
|
-
* @param a5 {*} 5th argument
|
|
910
|
-
* @param a6 {*} 6th argument
|
|
911
|
-
* @param a7 {*} 7th argument
|
|
912
|
-
* @param a8 {*} 8th argument
|
|
913
|
-
* @param a9 {*} 9th argument
|
|
914
|
-
*/
|
|
915
|
-
Slot.prototype.release = function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
|
|
916
|
-
if (this.runner) {
|
|
917
|
-
this.runner(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
/**
|
|
921
|
-
* Predefine a handler for a slot
|
|
922
|
-
* @param func {function(node : Fragment)} Function to run if no handler specified
|
|
923
|
-
* @param a0 {Fragment} node to paste content
|
|
924
|
-
* @param a1 {*} 1st argument
|
|
925
|
-
* @param a2 {*} 2nd argument
|
|
926
|
-
* @param a3 {*} 3rd argument
|
|
927
|
-
* @param a4 {*} 4th argument
|
|
928
|
-
* @param a5 {*} 5th argument
|
|
929
|
-
* @param a6 {*} 6th argument
|
|
930
|
-
* @param a7 {*} 7th argument
|
|
931
|
-
* @param a8 {*} 8th argument
|
|
932
|
-
* @param a9 {*} 9th argument
|
|
933
|
-
*/
|
|
934
|
-
Slot.prototype.predefine = function (func, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
|
|
935
|
-
(this.runner || func)(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
|
936
|
-
};
|
|
937
|
-
return Slot;
|
|
938
|
-
}());
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
window.Slot = Slot;
|
|
942
|
-
|
|
943
903
|
// ./lib-es5/core/errors.js
|
|
904
|
+
"use strict";
|
|
905
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
906
|
+
exports.wrongBinding = exports.userError = exports.internalError = exports.notOverwritten = void 0;
|
|
944
907
|
var reportIt = "Report it here: https://gitlab.com/vasille-js/vasille-js/-/issues";
|
|
945
908
|
function notOverwritten() {
|
|
946
909
|
console.error("Vasille-SFP: Internal error", "Must be overwritten", reportIt);
|
|
947
910
|
return "not-overwritten";
|
|
948
911
|
}
|
|
912
|
+
exports.notOverwritten = notOverwritten;
|
|
949
913
|
function internalError(msg) {
|
|
950
914
|
console.error("Vasille-SFP: Internal error", msg, reportIt);
|
|
951
915
|
return "internal-error";
|
|
952
916
|
}
|
|
917
|
+
exports.internalError = internalError;
|
|
953
918
|
function userError(msg, err) {
|
|
954
919
|
console.error("Vasille-SFP: User error", msg);
|
|
955
920
|
return err;
|
|
956
921
|
}
|
|
922
|
+
exports.userError = userError;
|
|
957
923
|
function wrongBinding(msg) {
|
|
958
924
|
return userError(msg, "wrong-binding");
|
|
959
925
|
}
|
|
926
|
+
exports.wrongBinding = wrongBinding;
|
|
960
927
|
|
|
961
|
-
window.notOverwritten = notOverwritten;
|
|
962
|
-
window.internalError = internalError;
|
|
963
|
-
window.userError = userError;
|
|
964
|
-
window.wrongBinding = wrongBinding;
|
|
965
|
-
|
|
966
|
-
// ./lib-es5/core/executor.js
|
|
967
|
-
/**
|
|
968
|
-
* Represents an executor unit interface
|
|
969
|
-
* @class Executor
|
|
970
|
-
*/
|
|
971
|
-
var Executor = /** @class */ (function () {
|
|
972
|
-
function Executor() {
|
|
973
|
-
}
|
|
974
|
-
/**
|
|
975
|
-
* Adds a CSS class
|
|
976
|
-
* @param el {Element} element to manipulate
|
|
977
|
-
* @param cl {string} class to be added
|
|
978
|
-
*/
|
|
979
|
-
Executor.prototype.addClass = function (el, cl) {
|
|
980
|
-
throw notOverwritten();
|
|
981
|
-
};
|
|
982
|
-
/**
|
|
983
|
-
* Removes a CSS class
|
|
984
|
-
* @param el {Element} element to manipulate
|
|
985
|
-
* @param cl {string} class to be removed
|
|
986
|
-
*/
|
|
987
|
-
Executor.prototype.removeClass = function (el, cl) {
|
|
988
|
-
throw notOverwritten();
|
|
989
|
-
};
|
|
990
|
-
/**
|
|
991
|
-
* Sets a tag attribute
|
|
992
|
-
* @param el {Element} element to manipulate
|
|
993
|
-
* @param name {string} name of attribute
|
|
994
|
-
* @param value {string} value of attribute
|
|
995
|
-
*/
|
|
996
|
-
Executor.prototype.setAttribute = function (el, name, value) {
|
|
997
|
-
throw notOverwritten();
|
|
998
|
-
};
|
|
999
|
-
/**
|
|
1000
|
-
* Removes a tag attribute
|
|
1001
|
-
* @param el {Element} element to manipulate
|
|
1002
|
-
* @param name {string} name of attribute
|
|
1003
|
-
*/
|
|
1004
|
-
Executor.prototype.removeAttribute = function (el, name) {
|
|
1005
|
-
throw notOverwritten();
|
|
1006
|
-
};
|
|
1007
|
-
/**
|
|
1008
|
-
* Sets a style attribute
|
|
1009
|
-
* @param el {HTMLElement} element to manipulate
|
|
1010
|
-
* @param prop {string} property name
|
|
1011
|
-
* @param value {string} property value
|
|
1012
|
-
*/
|
|
1013
|
-
Executor.prototype.setStyle = function (el, prop, value) {
|
|
1014
|
-
throw notOverwritten();
|
|
1015
|
-
};
|
|
1016
|
-
/**
|
|
1017
|
-
* Inserts a child before target
|
|
1018
|
-
* @param target {Element} target element
|
|
1019
|
-
* @param child {Node} element to insert before
|
|
1020
|
-
*/
|
|
1021
|
-
Executor.prototype.insertBefore = function (target, child) {
|
|
1022
|
-
throw notOverwritten();
|
|
1023
|
-
};
|
|
1024
|
-
/**
|
|
1025
|
-
* Appends a child to element
|
|
1026
|
-
* @param el {Element} element
|
|
1027
|
-
* @param child {Node} child to be inserted
|
|
1028
|
-
*/
|
|
1029
|
-
Executor.prototype.appendChild = function (el, child) {
|
|
1030
|
-
throw notOverwritten();
|
|
1031
|
-
};
|
|
1032
|
-
/**
|
|
1033
|
-
* Calls a call-back function
|
|
1034
|
-
* @param cb {function} call-back function
|
|
1035
|
-
*/
|
|
1036
|
-
Executor.prototype.callCallback = function (cb) {
|
|
1037
|
-
throw notOverwritten();
|
|
1038
|
-
};
|
|
1039
|
-
return Executor;
|
|
1040
|
-
}());
|
|
1041
|
-
|
|
1042
|
-
/**
|
|
1043
|
-
* Executor which execute any commands immediately
|
|
1044
|
-
* @class InstantExecutor
|
|
1045
|
-
* @extends Executor
|
|
1046
|
-
*/
|
|
1047
|
-
var InstantExecutor = /** @class */ (function (_super) {
|
|
1048
|
-
__extends(InstantExecutor, _super);
|
|
1049
|
-
function InstantExecutor() {
|
|
1050
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1051
|
-
}
|
|
1052
|
-
InstantExecutor.prototype.addClass = function (el, cl) {
|
|
1053
|
-
el.classList.add(cl);
|
|
1054
|
-
};
|
|
1055
|
-
InstantExecutor.prototype.removeClass = function (el, cl) {
|
|
1056
|
-
el.classList.remove(cl);
|
|
1057
|
-
};
|
|
1058
|
-
InstantExecutor.prototype.setAttribute = function (el, name, value) {
|
|
1059
|
-
el.setAttribute(name, value);
|
|
1060
|
-
};
|
|
1061
|
-
InstantExecutor.prototype.removeAttribute = function (el, name) {
|
|
1062
|
-
el.removeAttribute(name);
|
|
1063
|
-
};
|
|
1064
|
-
InstantExecutor.prototype.setStyle = function (el, prop, value) {
|
|
1065
|
-
el.style.setProperty(prop, value);
|
|
1066
|
-
};
|
|
1067
|
-
InstantExecutor.prototype.insertBefore = function (target, child) {
|
|
1068
|
-
var parent = target.parentNode;
|
|
1069
|
-
if (!parent) {
|
|
1070
|
-
throw internalError('element don\'t have a parent node');
|
|
1071
|
-
}
|
|
1072
|
-
parent.insertBefore(child, target);
|
|
1073
|
-
};
|
|
1074
|
-
InstantExecutor.prototype.appendChild = function (el, child) {
|
|
1075
|
-
el.appendChild(child);
|
|
1076
|
-
};
|
|
1077
|
-
InstantExecutor.prototype.callCallback = function (cb) {
|
|
1078
|
-
cb();
|
|
1079
|
-
};
|
|
1080
|
-
return InstantExecutor;
|
|
1081
|
-
}(Executor));
|
|
1082
|
-
|
|
1083
|
-
/**
|
|
1084
|
-
* Executor which execute any commands over timeout
|
|
1085
|
-
* @class TimeoutExecutor
|
|
1086
|
-
* @extends InstantExecutor
|
|
1087
|
-
*/
|
|
1088
|
-
var TimeoutExecutor = /** @class */ (function (_super) {
|
|
1089
|
-
__extends(TimeoutExecutor, _super);
|
|
1090
|
-
function TimeoutExecutor() {
|
|
1091
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1092
|
-
}
|
|
1093
|
-
TimeoutExecutor.prototype.addClass = function (el, cl) {
|
|
1094
|
-
var _this = this;
|
|
1095
|
-
setTimeout(function () {
|
|
1096
|
-
_super.prototype.addClass.call(_this, el, cl);
|
|
1097
|
-
}, 0);
|
|
1098
|
-
};
|
|
1099
|
-
TimeoutExecutor.prototype.removeClass = function (el, cl) {
|
|
1100
|
-
var _this = this;
|
|
1101
|
-
setTimeout(function () {
|
|
1102
|
-
_super.prototype.removeClass.call(_this, el, cl);
|
|
1103
|
-
}, 0);
|
|
1104
|
-
};
|
|
1105
|
-
TimeoutExecutor.prototype.setAttribute = function (el, name, value) {
|
|
1106
|
-
var _this = this;
|
|
1107
|
-
setTimeout(function () {
|
|
1108
|
-
_super.prototype.setAttribute.call(_this, el, name, value);
|
|
1109
|
-
}, 0);
|
|
1110
|
-
};
|
|
1111
|
-
TimeoutExecutor.prototype.removeAttribute = function (el, name) {
|
|
1112
|
-
var _this = this;
|
|
1113
|
-
setTimeout(function () {
|
|
1114
|
-
_super.prototype.removeAttribute.call(_this, el, name);
|
|
1115
|
-
}, 0);
|
|
1116
|
-
};
|
|
1117
|
-
TimeoutExecutor.prototype.setStyle = function (el, prop, value) {
|
|
1118
|
-
var _this = this;
|
|
1119
|
-
setTimeout(function () {
|
|
1120
|
-
_super.prototype.setStyle.call(_this, el, prop, value);
|
|
1121
|
-
}, 0);
|
|
1122
|
-
};
|
|
1123
|
-
TimeoutExecutor.prototype.insertBefore = function (target, child) {
|
|
1124
|
-
var _this = this;
|
|
1125
|
-
setTimeout(function () {
|
|
1126
|
-
_super.prototype.insertBefore.call(_this, target, child);
|
|
1127
|
-
}, 0);
|
|
1128
|
-
};
|
|
1129
|
-
TimeoutExecutor.prototype.appendChild = function (el, child) {
|
|
1130
|
-
var _this = this;
|
|
1131
|
-
setTimeout(function () {
|
|
1132
|
-
_super.prototype.appendChild.call(_this, el, child);
|
|
1133
|
-
}, 0);
|
|
1134
|
-
};
|
|
1135
|
-
TimeoutExecutor.prototype.callCallback = function (cb) {
|
|
1136
|
-
setTimeout(cb, 0);
|
|
1137
|
-
};
|
|
1138
|
-
return TimeoutExecutor;
|
|
1139
|
-
}(InstantExecutor));
|
|
1140
|
-
|
|
1141
|
-
var instantExecutor = new InstantExecutor();
|
|
1142
|
-
var timeoutExecutor = new TimeoutExecutor();
|
|
1143
|
-
|
|
1144
|
-
window.Executor = Executor;
|
|
1145
|
-
window.InstantExecutor = InstantExecutor;
|
|
1146
|
-
window.TimeoutExecutor = TimeoutExecutor;
|
|
1147
|
-
window.instantExecutor = instantExecutor;
|
|
1148
|
-
window.timeoutExecutor = timeoutExecutor;
|
|
1149
928
|
|
|
1150
929
|
// ./lib-es5/core/destroyable.js
|
|
930
|
+
"use strict";
|
|
931
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
932
|
+
exports.Destroyable = void 0;
|
|
1151
933
|
/**
|
|
1152
934
|
* Mark an object which can be destroyed
|
|
1153
935
|
* @class Destroyable
|
|
@@ -1197,11 +979,30 @@ var Destroyable = /** @class */ (function () {
|
|
|
1197
979
|
};
|
|
1198
980
|
return Destroyable;
|
|
1199
981
|
}());
|
|
982
|
+
exports.Destroyable = Destroyable;
|
|
1200
983
|
|
|
1201
984
|
|
|
1202
|
-
window.Destroyable = Destroyable;
|
|
1203
|
-
|
|
1204
985
|
// ./lib-es5/core/ivalue.js
|
|
986
|
+
"use strict";
|
|
987
|
+
var __extends = (this && this.__extends) || (function () {
|
|
988
|
+
var extendStatics = function (d, b) {
|
|
989
|
+
extendStatics = Object.setPrototypeOf ||
|
|
990
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
991
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
992
|
+
return extendStatics(d, b);
|
|
993
|
+
};
|
|
994
|
+
return function (d, b) {
|
|
995
|
+
if (typeof b !== "function" && b !== null)
|
|
996
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
997
|
+
extendStatics(d, b);
|
|
998
|
+
function __() { this.constructor = d; }
|
|
999
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1000
|
+
};
|
|
1001
|
+
})();
|
|
1002
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1003
|
+
exports.IValue = exports.Switchable = void 0;
|
|
1004
|
+
var destroyable_js_1 = require("./destroyable.js");
|
|
1005
|
+
var errors_1 = require("./errors");
|
|
1205
1006
|
var Switchable = /** @class */ (function (_super) {
|
|
1206
1007
|
__extends(Switchable, _super);
|
|
1207
1008
|
function Switchable() {
|
|
@@ -1211,17 +1012,17 @@ var Switchable = /** @class */ (function (_super) {
|
|
|
1211
1012
|
* Enable update handlers triggering
|
|
1212
1013
|
*/
|
|
1213
1014
|
Switchable.prototype.$enable = function () {
|
|
1214
|
-
throw notOverwritten();
|
|
1015
|
+
throw (0, errors_1.notOverwritten)();
|
|
1215
1016
|
};
|
|
1216
1017
|
/**
|
|
1217
1018
|
* disable update handlers triggering
|
|
1218
1019
|
*/
|
|
1219
1020
|
Switchable.prototype.$disable = function () {
|
|
1220
|
-
throw notOverwritten();
|
|
1021
|
+
throw (0, errors_1.notOverwritten)();
|
|
1221
1022
|
};
|
|
1222
1023
|
return Switchable;
|
|
1223
|
-
}(Destroyable));
|
|
1224
|
-
|
|
1024
|
+
}(destroyable_js_1.Destroyable));
|
|
1025
|
+
exports.Switchable = Switchable;
|
|
1225
1026
|
/**
|
|
1226
1027
|
* Interface which describes a value
|
|
1227
1028
|
* @class IValue
|
|
@@ -1243,14 +1044,14 @@ var IValue = /** @class */ (function (_super) {
|
|
|
1243
1044
|
* @return {*} the encapsulated value
|
|
1244
1045
|
*/
|
|
1245
1046
|
get: function () {
|
|
1246
|
-
throw notOverwritten();
|
|
1047
|
+
throw (0, errors_1.notOverwritten)();
|
|
1247
1048
|
},
|
|
1248
1049
|
/**
|
|
1249
1050
|
* Sets the encapsulated value
|
|
1250
1051
|
* @param value {*} value to encapsulate
|
|
1251
1052
|
*/
|
|
1252
1053
|
set: function (value) {
|
|
1253
|
-
throw notOverwritten();
|
|
1054
|
+
throw (0, errors_1.notOverwritten)();
|
|
1254
1055
|
},
|
|
1255
1056
|
enumerable: false,
|
|
1256
1057
|
configurable: true
|
|
@@ -1260,39 +1061,113 @@ var IValue = /** @class */ (function (_super) {
|
|
|
1260
1061
|
* @param handler {function(value : *)} the handler to add
|
|
1261
1062
|
*/
|
|
1262
1063
|
IValue.prototype.$on = function (handler) {
|
|
1263
|
-
throw notOverwritten();
|
|
1064
|
+
throw (0, errors_1.notOverwritten)();
|
|
1264
1065
|
};
|
|
1265
1066
|
/**
|
|
1266
1067
|
* Removes a handler of value change
|
|
1267
1068
|
* @param handler {function(value : *)} the handler to remove
|
|
1268
1069
|
*/
|
|
1269
1070
|
IValue.prototype.$off = function (handler) {
|
|
1270
|
-
throw notOverwritten();
|
|
1071
|
+
throw (0, errors_1.notOverwritten)();
|
|
1271
1072
|
};
|
|
1272
1073
|
return IValue;
|
|
1273
1074
|
}(Switchable));
|
|
1075
|
+
exports.IValue = IValue;
|
|
1274
1076
|
|
|
1275
1077
|
|
|
1276
|
-
window.Switchable = Switchable;
|
|
1277
|
-
window.IValue = IValue;
|
|
1278
|
-
|
|
1279
1078
|
// ./lib-es5/index.js
|
|
1280
|
-
|
|
1079
|
+
"use strict";
|
|
1080
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1081
|
+
exports.current = exports.userError = exports.Watch = exports.Reactive = exports.Binding = exports.Expression = exports.Portal = exports.App = exports.AppNode = exports.Extension = exports.Component = exports.Tag = exports.INode = exports.Fragment = exports.SetView = exports.ObjectView = exports.MapView = exports.ArrayView = exports.Listener = exports.BaseView = exports.SetModel = exports.ObjectModel = exports.MapModel = exports.ArrayModel = exports.Pointer = exports.Mirror = exports.Reference = exports.IValue = exports.Destroyable = void 0;
|
|
1082
|
+
var destroyable_1 = require("./core/destroyable");
|
|
1083
|
+
Object.defineProperty(exports, "Destroyable", { enumerable: true, get: function () { return destroyable_1.Destroyable; } });
|
|
1084
|
+
var core_1 = require("./core/core");
|
|
1085
|
+
Object.defineProperty(exports, "current", { enumerable: true, get: function () { return core_1.current; } });
|
|
1086
|
+
Object.defineProperty(exports, "Reactive", { enumerable: true, get: function () { return core_1.Reactive; } });
|
|
1087
|
+
var ivalue_1 = require("./core/ivalue");
|
|
1088
|
+
Object.defineProperty(exports, "IValue", { enumerable: true, get: function () { return ivalue_1.IValue; } });
|
|
1089
|
+
var array_model_1 = require("./models/array-model");
|
|
1090
|
+
Object.defineProperty(exports, "ArrayModel", { enumerable: true, get: function () { return array_model_1.ArrayModel; } });
|
|
1091
|
+
var listener_1 = require("./models/listener");
|
|
1092
|
+
Object.defineProperty(exports, "Listener", { enumerable: true, get: function () { return listener_1.Listener; } });
|
|
1093
|
+
var map_model_1 = require("./models/map-model");
|
|
1094
|
+
Object.defineProperty(exports, "MapModel", { enumerable: true, get: function () { return map_model_1.MapModel; } });
|
|
1095
|
+
var object_model_1 = require("./models/object-model");
|
|
1096
|
+
Object.defineProperty(exports, "ObjectModel", { enumerable: true, get: function () { return object_model_1.ObjectModel; } });
|
|
1097
|
+
var set_model_1 = require("./models/set-model");
|
|
1098
|
+
Object.defineProperty(exports, "SetModel", { enumerable: true, get: function () { return set_model_1.SetModel; } });
|
|
1099
|
+
var app_1 = require("./node/app");
|
|
1100
|
+
Object.defineProperty(exports, "App", { enumerable: true, get: function () { return app_1.App; } });
|
|
1101
|
+
Object.defineProperty(exports, "AppNode", { enumerable: true, get: function () { return app_1.AppNode; } });
|
|
1102
|
+
Object.defineProperty(exports, "Portal", { enumerable: true, get: function () { return app_1.Portal; } });
|
|
1103
|
+
var node_1 = require("./node/node");
|
|
1104
|
+
Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return node_1.Component; } });
|
|
1105
|
+
Object.defineProperty(exports, "Extension", { enumerable: true, get: function () { return node_1.Extension; } });
|
|
1106
|
+
Object.defineProperty(exports, "Fragment", { enumerable: true, get: function () { return node_1.Fragment; } });
|
|
1107
|
+
Object.defineProperty(exports, "INode", { enumerable: true, get: function () { return node_1.INode; } });
|
|
1108
|
+
Object.defineProperty(exports, "Tag", { enumerable: true, get: function () { return node_1.Tag; } });
|
|
1109
|
+
var expression_1 = require("./value/expression");
|
|
1110
|
+
Object.defineProperty(exports, "Expression", { enumerable: true, get: function () { return expression_1.Expression; } });
|
|
1111
|
+
var mirror_1 = require("./value/mirror");
|
|
1112
|
+
Object.defineProperty(exports, "Mirror", { enumerable: true, get: function () { return mirror_1.Mirror; } });
|
|
1113
|
+
var pointer_1 = require("./value/pointer");
|
|
1114
|
+
Object.defineProperty(exports, "Pointer", { enumerable: true, get: function () { return pointer_1.Pointer; } });
|
|
1115
|
+
var reference_1 = require("./value/reference");
|
|
1116
|
+
Object.defineProperty(exports, "Reference", { enumerable: true, get: function () { return reference_1.Reference; } });
|
|
1117
|
+
var array_view_1 = require("./views/array-view");
|
|
1118
|
+
Object.defineProperty(exports, "ArrayView", { enumerable: true, get: function () { return array_view_1.ArrayView; } });
|
|
1119
|
+
var base_view_1 = require("./views/base-view");
|
|
1120
|
+
Object.defineProperty(exports, "BaseView", { enumerable: true, get: function () { return base_view_1.BaseView; } });
|
|
1121
|
+
var map_view_1 = require("./views/map-view");
|
|
1122
|
+
Object.defineProperty(exports, "MapView", { enumerable: true, get: function () { return map_view_1.MapView; } });
|
|
1123
|
+
var object_view_1 = require("./views/object-view");
|
|
1124
|
+
Object.defineProperty(exports, "ObjectView", { enumerable: true, get: function () { return object_view_1.ObjectView; } });
|
|
1125
|
+
var set_view_1 = require("./views/set-view");
|
|
1126
|
+
Object.defineProperty(exports, "SetView", { enumerable: true, get: function () { return set_view_1.SetView; } });
|
|
1127
|
+
var binding_1 = require("./binding/binding");
|
|
1128
|
+
Object.defineProperty(exports, "Binding", { enumerable: true, get: function () { return binding_1.Binding; } });
|
|
1129
|
+
var errors_1 = require("./core/errors");
|
|
1130
|
+
Object.defineProperty(exports, "userError", { enumerable: true, get: function () { return errors_1.userError; } });
|
|
1131
|
+
var watch_1 = require("./node/watch");
|
|
1132
|
+
Object.defineProperty(exports, "Watch", { enumerable: true, get: function () { return watch_1.Watch; } });
|
|
1281
1133
|
|
|
1282
1134
|
|
|
1283
1135
|
// ./lib-es5/spec/svg.js
|
|
1284
|
-
|
|
1136
|
+
"use strict";
|
|
1137
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1285
1138
|
|
|
1286
1139
|
|
|
1287
1140
|
// ./lib-es5/spec/react.js
|
|
1288
|
-
|
|
1141
|
+
"use strict";
|
|
1142
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1289
1143
|
|
|
1290
1144
|
|
|
1291
1145
|
// ./lib-es5/spec/html.js
|
|
1292
|
-
|
|
1146
|
+
"use strict";
|
|
1147
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1293
1148
|
|
|
1294
1149
|
|
|
1295
1150
|
// ./lib-es5/value/expression.js
|
|
1151
|
+
"use strict";
|
|
1152
|
+
var __extends = (this && this.__extends) || (function () {
|
|
1153
|
+
var extendStatics = function (d, b) {
|
|
1154
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1155
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1156
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1157
|
+
return extendStatics(d, b);
|
|
1158
|
+
};
|
|
1159
|
+
return function (d, b) {
|
|
1160
|
+
if (typeof b !== "function" && b !== null)
|
|
1161
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1162
|
+
extendStatics(d, b);
|
|
1163
|
+
function __() { this.constructor = d; }
|
|
1164
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1165
|
+
};
|
|
1166
|
+
})();
|
|
1167
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1168
|
+
exports.Expression = void 0;
|
|
1169
|
+
var reference_js_1 = require("./reference.js");
|
|
1170
|
+
var ivalue_1 = require("../core/ivalue");
|
|
1296
1171
|
/**
|
|
1297
1172
|
* Bind some values to one expression
|
|
1298
1173
|
* @class Expression
|
|
@@ -1325,7 +1200,7 @@ var Expression = /** @class */ (function (_super) {
|
|
|
1325
1200
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1326
1201
|
// @ts-ignore
|
|
1327
1202
|
_this.valuesCache = values.map(function (item) { return item.$; });
|
|
1328
|
-
_this.sync = new Reference(func.apply(_this, _this.valuesCache));
|
|
1203
|
+
_this.sync = new reference_js_1.Reference(func.apply(_this, _this.valuesCache));
|
|
1329
1204
|
var i = 0;
|
|
1330
1205
|
values.forEach(function () {
|
|
1331
1206
|
_this.linkedFunc.push(handler.bind(_this, Number(i++)));
|
|
@@ -1387,12 +1262,30 @@ var Expression = /** @class */ (function (_super) {
|
|
|
1387
1262
|
_super.prototype.$destroy.call(this);
|
|
1388
1263
|
};
|
|
1389
1264
|
return Expression;
|
|
1390
|
-
}(IValue));
|
|
1265
|
+
}(ivalue_1.IValue));
|
|
1266
|
+
exports.Expression = Expression;
|
|
1391
1267
|
|
|
1392
1268
|
|
|
1393
|
-
window.Expression = Expression;
|
|
1394
|
-
|
|
1395
1269
|
// ./lib-es5/value/reference.js
|
|
1270
|
+
"use strict";
|
|
1271
|
+
var __extends = (this && this.__extends) || (function () {
|
|
1272
|
+
var extendStatics = function (d, b) {
|
|
1273
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1274
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1275
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1276
|
+
return extendStatics(d, b);
|
|
1277
|
+
};
|
|
1278
|
+
return function (d, b) {
|
|
1279
|
+
if (typeof b !== "function" && b !== null)
|
|
1280
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1281
|
+
extendStatics(d, b);
|
|
1282
|
+
function __() { this.constructor = d; }
|
|
1283
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1284
|
+
};
|
|
1285
|
+
})();
|
|
1286
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1287
|
+
exports.Reference = void 0;
|
|
1288
|
+
var ivalue_1 = require("../core/ivalue");
|
|
1396
1289
|
/**
|
|
1397
1290
|
* Declares a notifiable value
|
|
1398
1291
|
* @class Reference
|
|
@@ -1450,12 +1343,30 @@ var Reference = /** @class */ (function (_super) {
|
|
|
1450
1343
|
this.$onchange.clear();
|
|
1451
1344
|
};
|
|
1452
1345
|
return Reference;
|
|
1453
|
-
}(IValue));
|
|
1346
|
+
}(ivalue_1.IValue));
|
|
1347
|
+
exports.Reference = Reference;
|
|
1454
1348
|
|
|
1455
1349
|
|
|
1456
|
-
window.Reference = Reference;
|
|
1457
|
-
|
|
1458
1350
|
// ./lib-es5/value/mirror.js
|
|
1351
|
+
"use strict";
|
|
1352
|
+
var __extends = (this && this.__extends) || (function () {
|
|
1353
|
+
var extendStatics = function (d, b) {
|
|
1354
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1355
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1356
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1357
|
+
return extendStatics(d, b);
|
|
1358
|
+
};
|
|
1359
|
+
return function (d, b) {
|
|
1360
|
+
if (typeof b !== "function" && b !== null)
|
|
1361
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1362
|
+
extendStatics(d, b);
|
|
1363
|
+
function __() { this.constructor = d; }
|
|
1364
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1365
|
+
};
|
|
1366
|
+
})();
|
|
1367
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1368
|
+
exports.Mirror = void 0;
|
|
1369
|
+
var reference_1 = require("./reference");
|
|
1459
1370
|
/**
|
|
1460
1371
|
* Declares a notifiable bind to a value
|
|
1461
1372
|
* @class Mirror
|
|
@@ -1518,12 +1429,30 @@ var Mirror = /** @class */ (function (_super) {
|
|
|
1518
1429
|
_super.prototype.$destroy.call(this);
|
|
1519
1430
|
};
|
|
1520
1431
|
return Mirror;
|
|
1521
|
-
}(Reference));
|
|
1432
|
+
}(reference_1.Reference));
|
|
1433
|
+
exports.Mirror = Mirror;
|
|
1522
1434
|
|
|
1523
1435
|
|
|
1524
|
-
window.Mirror = Mirror;
|
|
1525
|
-
|
|
1526
1436
|
// ./lib-es5/value/pointer.js
|
|
1437
|
+
"use strict";
|
|
1438
|
+
var __extends = (this && this.__extends) || (function () {
|
|
1439
|
+
var extendStatics = function (d, b) {
|
|
1440
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1441
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1442
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1443
|
+
return extendStatics(d, b);
|
|
1444
|
+
};
|
|
1445
|
+
return function (d, b) {
|
|
1446
|
+
if (typeof b !== "function" && b !== null)
|
|
1447
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1448
|
+
extendStatics(d, b);
|
|
1449
|
+
function __() { this.constructor = d; }
|
|
1450
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1451
|
+
};
|
|
1452
|
+
})();
|
|
1453
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1454
|
+
exports.Pointer = void 0;
|
|
1455
|
+
var mirror_1 = require("./mirror");
|
|
1527
1456
|
/**
|
|
1528
1457
|
* r/w pointer to a value
|
|
1529
1458
|
* @class Pointer
|
|
@@ -1555,12 +1484,30 @@ var Pointer = /** @class */ (function (_super) {
|
|
|
1555
1484
|
configurable: true
|
|
1556
1485
|
});
|
|
1557
1486
|
return Pointer;
|
|
1558
|
-
}(Mirror));
|
|
1487
|
+
}(mirror_1.Mirror));
|
|
1488
|
+
exports.Pointer = Pointer;
|
|
1559
1489
|
|
|
1560
1490
|
|
|
1561
|
-
window.Pointer = Pointer;
|
|
1562
|
-
|
|
1563
1491
|
// ./lib-es5/binding/binding.js
|
|
1492
|
+
"use strict";
|
|
1493
|
+
var __extends = (this && this.__extends) || (function () {
|
|
1494
|
+
var extendStatics = function (d, b) {
|
|
1495
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1496
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1497
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1498
|
+
return extendStatics(d, b);
|
|
1499
|
+
};
|
|
1500
|
+
return function (d, b) {
|
|
1501
|
+
if (typeof b !== "function" && b !== null)
|
|
1502
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1503
|
+
extendStatics(d, b);
|
|
1504
|
+
function __() { this.constructor = d; }
|
|
1505
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1506
|
+
};
|
|
1507
|
+
})();
|
|
1508
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1509
|
+
exports.Binding = void 0;
|
|
1510
|
+
var destroyable_1 = require("../core/destroyable");
|
|
1564
1511
|
/**
|
|
1565
1512
|
* Describe a common binding logic
|
|
1566
1513
|
* @class Binding
|
|
@@ -1591,20 +1538,52 @@ var Binding = /** @class */ (function (_super) {
|
|
|
1591
1538
|
_super.prototype.$destroy.call(this);
|
|
1592
1539
|
};
|
|
1593
1540
|
return Binding;
|
|
1594
|
-
}(Destroyable));
|
|
1541
|
+
}(destroyable_1.Destroyable));
|
|
1542
|
+
exports.Binding = Binding;
|
|
1595
1543
|
|
|
1596
1544
|
|
|
1597
|
-
window.Binding = Binding;
|
|
1598
|
-
|
|
1599
1545
|
// ./lib-es5/core/core.js
|
|
1600
|
-
|
|
1546
|
+
"use strict";
|
|
1547
|
+
var __extends = (this && this.__extends) || (function () {
|
|
1548
|
+
var extendStatics = function (d, b) {
|
|
1549
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1550
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1551
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1552
|
+
return extendStatics(d, b);
|
|
1553
|
+
};
|
|
1554
|
+
return function (d, b) {
|
|
1555
|
+
if (typeof b !== "function" && b !== null)
|
|
1556
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1557
|
+
extendStatics(d, b);
|
|
1558
|
+
function __() { this.constructor = d; }
|
|
1559
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1560
|
+
};
|
|
1561
|
+
})();
|
|
1562
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
1563
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1564
|
+
if (ar || !(i in from)) {
|
|
1565
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
1566
|
+
ar[i] = from[i];
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1570
|
+
};
|
|
1571
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1572
|
+
exports.Reactive = exports.ReactivePrivate = exports.current = void 0;
|
|
1573
|
+
var destroyable_js_1 = require("./destroyable.js");
|
|
1574
|
+
var errors_1 = require("./errors");
|
|
1575
|
+
var expression_1 = require("../value/expression");
|
|
1576
|
+
var reference_1 = require("../value/reference");
|
|
1577
|
+
var pointer_1 = require("../value/pointer");
|
|
1578
|
+
var mirror_1 = require("../value/mirror");
|
|
1579
|
+
exports.current = null;
|
|
1601
1580
|
var currentStack = [];
|
|
1602
1581
|
function stack(node) {
|
|
1603
|
-
currentStack.push(current);
|
|
1604
|
-
current = node;
|
|
1582
|
+
currentStack.push(exports.current);
|
|
1583
|
+
exports.current = node;
|
|
1605
1584
|
}
|
|
1606
1585
|
function unstack() {
|
|
1607
|
-
current = currentStack.pop();
|
|
1586
|
+
exports.current = currentStack.pop();
|
|
1608
1587
|
}
|
|
1609
1588
|
/**
|
|
1610
1589
|
* Private stuff of a reactive object
|
|
@@ -1654,8 +1633,8 @@ var ReactivePrivate = /** @class */ (function (_super) {
|
|
|
1654
1633
|
_super.prototype.$destroy.call(this);
|
|
1655
1634
|
};
|
|
1656
1635
|
return ReactivePrivate;
|
|
1657
|
-
}(Destroyable));
|
|
1658
|
-
|
|
1636
|
+
}(destroyable_js_1.Destroyable));
|
|
1637
|
+
exports.ReactivePrivate = ReactivePrivate;
|
|
1659
1638
|
/**
|
|
1660
1639
|
* A reactive object
|
|
1661
1640
|
* @class Reactive
|
|
@@ -1686,7 +1665,7 @@ var Reactive = /** @class */ (function (_super) {
|
|
|
1686
1665
|
*/
|
|
1687
1666
|
Reactive.prototype.ref = function (value) {
|
|
1688
1667
|
var $ = this.$;
|
|
1689
|
-
var ref = new Reference(value);
|
|
1668
|
+
var ref = new reference_1.Reference(value);
|
|
1690
1669
|
$.watch.add(ref);
|
|
1691
1670
|
return ref;
|
|
1692
1671
|
};
|
|
@@ -1695,7 +1674,7 @@ var Reactive = /** @class */ (function (_super) {
|
|
|
1695
1674
|
* @param value {IValue} value to mirror
|
|
1696
1675
|
*/
|
|
1697
1676
|
Reactive.prototype.mirror = function (value) {
|
|
1698
|
-
var mirror = new Mirror(value, false);
|
|
1677
|
+
var mirror = new mirror_1.Mirror(value, false);
|
|
1699
1678
|
this.$.watch.add(mirror);
|
|
1700
1679
|
return mirror;
|
|
1701
1680
|
};
|
|
@@ -1704,7 +1683,7 @@ var Reactive = /** @class */ (function (_super) {
|
|
|
1704
1683
|
* @param value {IValue} value to mirror
|
|
1705
1684
|
*/
|
|
1706
1685
|
Reactive.prototype.forward = function (value) {
|
|
1707
|
-
var mirror = new Mirror(value, true);
|
|
1686
|
+
var mirror = new mirror_1.Mirror(value, true);
|
|
1708
1687
|
this.$.watch.add(mirror);
|
|
1709
1688
|
return mirror;
|
|
1710
1689
|
};
|
|
@@ -1716,7 +1695,7 @@ var Reactive = /** @class */ (function (_super) {
|
|
|
1716
1695
|
Reactive.prototype.point = function (value, forwardOnly) {
|
|
1717
1696
|
if (forwardOnly === void 0) { forwardOnly = false; }
|
|
1718
1697
|
var $ = this.$;
|
|
1719
|
-
var pointer = new Pointer(value, forwardOnly);
|
|
1698
|
+
var pointer = new pointer_1.Pointer(value, forwardOnly);
|
|
1720
1699
|
$.watch.add(pointer);
|
|
1721
1700
|
return pointer;
|
|
1722
1701
|
};
|
|
@@ -1739,7 +1718,7 @@ var Reactive = /** @class */ (function (_super) {
|
|
|
1739
1718
|
values[_i - 1] = arguments[_i];
|
|
1740
1719
|
}
|
|
1741
1720
|
var $ = this.$;
|
|
1742
|
-
$.watch.add(new (Expression.bind.apply(Expression, __spreadArray([void 0, func, !this.$.frozen], values, false)))());
|
|
1721
|
+
$.watch.add(new (expression_1.Expression.bind.apply(expression_1.Expression, __spreadArray([void 0, func, !this.$.frozen], values, false)))());
|
|
1743
1722
|
};
|
|
1744
1723
|
/**
|
|
1745
1724
|
* Creates a computed value
|
|
@@ -1752,7 +1731,7 @@ var Reactive = /** @class */ (function (_super) {
|
|
|
1752
1731
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1753
1732
|
values[_i - 1] = arguments[_i];
|
|
1754
1733
|
}
|
|
1755
|
-
var res = new (Expression.bind.apply(Expression, __spreadArray([void 0, func, !this.$.frozen], values, false)))();
|
|
1734
|
+
var res = new (expression_1.Expression.bind.apply(expression_1.Expression, __spreadArray([void 0, func, !this.$.frozen], values, false)))();
|
|
1756
1735
|
var $ = this.$;
|
|
1757
1736
|
$.watch.add(res);
|
|
1758
1737
|
return res;
|
|
@@ -1797,12 +1776,12 @@ var Reactive = /** @class */ (function (_super) {
|
|
|
1797
1776
|
var _this = this;
|
|
1798
1777
|
var $ = this.$;
|
|
1799
1778
|
if ($.freezeExpr) {
|
|
1800
|
-
throw wrongBinding("this component already have a freeze state");
|
|
1779
|
+
throw (0, errors_1.wrongBinding)("this component already have a freeze state");
|
|
1801
1780
|
}
|
|
1802
1781
|
if ($.watch.has(cond)) {
|
|
1803
|
-
throw wrongBinding("freeze state must be bound to an external component");
|
|
1782
|
+
throw (0, errors_1.wrongBinding)("freeze state must be bound to an external component");
|
|
1804
1783
|
}
|
|
1805
|
-
$.freezeExpr = new Expression(function (cond) {
|
|
1784
|
+
$.freezeExpr = new expression_1.Expression(function (cond) {
|
|
1806
1785
|
$.frozen = !cond;
|
|
1807
1786
|
if (cond) {
|
|
1808
1787
|
onOn === null || onOn === void 0 ? void 0 : onOn();
|
|
@@ -1817,7 +1796,7 @@ var Reactive = /** @class */ (function (_super) {
|
|
|
1817
1796
|
};
|
|
1818
1797
|
Reactive.prototype.init = function () {
|
|
1819
1798
|
this.applyOptions(this.input);
|
|
1820
|
-
this.compose(this.input);
|
|
1799
|
+
return this.compose(this.input);
|
|
1821
1800
|
};
|
|
1822
1801
|
Reactive.prototype.applyOptions = function (input) {
|
|
1823
1802
|
// empty
|
|
@@ -1826,7 +1805,7 @@ var Reactive = /** @class */ (function (_super) {
|
|
|
1826
1805
|
this.applyOptions(this.input);
|
|
1827
1806
|
};
|
|
1828
1807
|
Reactive.prototype.compose = function (input) {
|
|
1829
|
-
|
|
1808
|
+
throw (0, errors_1.notOverwritten)();
|
|
1830
1809
|
};
|
|
1831
1810
|
Reactive.prototype.composeNow = function () {
|
|
1832
1811
|
this.compose(this.input);
|
|
@@ -1853,14 +1832,37 @@ var Reactive = /** @class */ (function (_super) {
|
|
|
1853
1832
|
this.$ = null;
|
|
1854
1833
|
};
|
|
1855
1834
|
return Reactive;
|
|
1856
|
-
}(Destroyable));
|
|
1857
|
-
|
|
1835
|
+
}(destroyable_js_1.Destroyable));
|
|
1836
|
+
exports.Reactive = Reactive;
|
|
1858
1837
|
|
|
1859
|
-
window.current = current;
|
|
1860
|
-
window.ReactivePrivate = ReactivePrivate;
|
|
1861
|
-
window.Reactive = Reactive;
|
|
1862
1838
|
|
|
1863
1839
|
// ./lib-es5/node/node.js
|
|
1840
|
+
"use strict";
|
|
1841
|
+
var __extends = (this && this.__extends) || (function () {
|
|
1842
|
+
var extendStatics = function (d, b) {
|
|
1843
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1844
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1845
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1846
|
+
return extendStatics(d, b);
|
|
1847
|
+
};
|
|
1848
|
+
return function (d, b) {
|
|
1849
|
+
if (typeof b !== "function" && b !== null)
|
|
1850
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1851
|
+
extendStatics(d, b);
|
|
1852
|
+
function __() { this.constructor = d; }
|
|
1853
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1854
|
+
};
|
|
1855
|
+
})();
|
|
1856
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1857
|
+
exports.DebugNode = exports.DebugPrivate = exports.SwitchedNode = exports.SwitchedNodePrivate = exports.Component = exports.Extension = exports.Tag = exports.INode = exports.INodePrivate = exports.TextNode = exports.TextNodePrivate = exports.Fragment = exports.FragmentPrivate = void 0;
|
|
1858
|
+
var core_1 = require("../core/core");
|
|
1859
|
+
var ivalue_1 = require("../core/ivalue");
|
|
1860
|
+
var reference_1 = require("../value/reference");
|
|
1861
|
+
var expression_1 = require("../value/expression");
|
|
1862
|
+
var attribute_1 = require("../binding/attribute");
|
|
1863
|
+
var class_1 = require("../binding/class");
|
|
1864
|
+
var style_1 = require("../binding/style");
|
|
1865
|
+
var errors_1 = require("../core/errors");
|
|
1864
1866
|
/**
|
|
1865
1867
|
* Represents a Vasille.js node
|
|
1866
1868
|
* @class FragmentPrivate
|
|
@@ -1891,8 +1893,8 @@ var FragmentPrivate = /** @class */ (function (_super) {
|
|
|
1891
1893
|
_super.prototype.$destroy.call(this);
|
|
1892
1894
|
};
|
|
1893
1895
|
return FragmentPrivate;
|
|
1894
|
-
}(ReactivePrivate));
|
|
1895
|
-
|
|
1896
|
+
}(core_1.ReactivePrivate));
|
|
1897
|
+
exports.FragmentPrivate = FragmentPrivate;
|
|
1896
1898
|
/**
|
|
1897
1899
|
* This class is symbolic
|
|
1898
1900
|
* @extends Reactive
|
|
@@ -1935,11 +1937,11 @@ var Fragment = /** @class */ (function (_super) {
|
|
|
1935
1937
|
$.preinit(app, parent);
|
|
1936
1938
|
};
|
|
1937
1939
|
Fragment.prototype.init = function () {
|
|
1938
|
-
_super.prototype.init.call(this);
|
|
1940
|
+
var ret = _super.prototype.init.call(this);
|
|
1939
1941
|
this.ready();
|
|
1942
|
+
return ret;
|
|
1940
1943
|
};
|
|
1941
1944
|
Fragment.prototype.compose = function (input) {
|
|
1942
|
-
_super.prototype.compose.call(this, input);
|
|
1943
1945
|
input.slot && input.slot(this);
|
|
1944
1946
|
};
|
|
1945
1947
|
/** To be overloaded: ready event handler */
|
|
@@ -2047,7 +2049,7 @@ var Fragment = /** @class */ (function (_super) {
|
|
|
2047
2049
|
node.preinit($.app, this);
|
|
2048
2050
|
node.input.slot = callback || node.input.slot;
|
|
2049
2051
|
this.pushNode(node);
|
|
2050
|
-
node.init();
|
|
2052
|
+
return node.init();
|
|
2051
2053
|
};
|
|
2052
2054
|
/**
|
|
2053
2055
|
* Defines an if node
|
|
@@ -2068,7 +2070,7 @@ var Fragment = /** @class */ (function (_super) {
|
|
|
2068
2070
|
this.lastChild.addCase(this.default(cb));
|
|
2069
2071
|
}
|
|
2070
2072
|
else {
|
|
2071
|
-
throw userError('wrong `else` function use', 'logic-error');
|
|
2073
|
+
throw (0, errors_1.userError)('wrong `else` function use', 'logic-error');
|
|
2072
2074
|
}
|
|
2073
2075
|
};
|
|
2074
2076
|
Fragment.prototype.elif = function (cond, cb) {
|
|
@@ -2076,7 +2078,7 @@ var Fragment = /** @class */ (function (_super) {
|
|
|
2076
2078
|
this.lastChild.addCase(this.case(cond, cb));
|
|
2077
2079
|
}
|
|
2078
2080
|
else {
|
|
2079
|
-
throw userError('wrong `elif` function use', 'logic-error');
|
|
2081
|
+
throw (0, errors_1.userError)('wrong `elif` function use', 'logic-error');
|
|
2080
2082
|
}
|
|
2081
2083
|
};
|
|
2082
2084
|
/**
|
|
@@ -2129,9 +2131,9 @@ var Fragment = /** @class */ (function (_super) {
|
|
|
2129
2131
|
_super.prototype.$destroy.call(this);
|
|
2130
2132
|
};
|
|
2131
2133
|
return Fragment;
|
|
2132
|
-
}(Reactive));
|
|
2133
|
-
|
|
2134
|
-
var trueIValue = new Reference(true);
|
|
2134
|
+
}(core_1.Reactive));
|
|
2135
|
+
exports.Fragment = Fragment;
|
|
2136
|
+
var trueIValue = new reference_1.Reference(true);
|
|
2135
2137
|
/**
|
|
2136
2138
|
* The private part of a text node
|
|
2137
2139
|
* @class TextNodePrivate
|
|
@@ -2153,9 +2155,9 @@ var TextNodePrivate = /** @class */ (function (_super) {
|
|
|
2153
2155
|
TextNodePrivate.prototype.preinitText = function (app, parent, text) {
|
|
2154
2156
|
var _this = this;
|
|
2155
2157
|
_super.prototype.preinit.call(this, app, parent);
|
|
2156
|
-
this.node = document.createTextNode(text instanceof IValue ? text.$ : text);
|
|
2157
|
-
if (text instanceof IValue) {
|
|
2158
|
-
this.bindings.add(new Expression(function (v) {
|
|
2158
|
+
this.node = document.createTextNode(text instanceof ivalue_1.IValue ? text.$ : text);
|
|
2159
|
+
if (text instanceof ivalue_1.IValue) {
|
|
2160
|
+
this.bindings.add(new expression_1.Expression(function (v) {
|
|
2159
2161
|
_this.node.replaceData(0, -1, v);
|
|
2160
2162
|
}, true, text));
|
|
2161
2163
|
}
|
|
@@ -2168,7 +2170,7 @@ var TextNodePrivate = /** @class */ (function (_super) {
|
|
|
2168
2170
|
};
|
|
2169
2171
|
return TextNodePrivate;
|
|
2170
2172
|
}(FragmentPrivate));
|
|
2171
|
-
|
|
2173
|
+
exports.TextNodePrivate = TextNodePrivate;
|
|
2172
2174
|
/**
|
|
2173
2175
|
* Represents a text node
|
|
2174
2176
|
* @class TextNode
|
|
@@ -2185,7 +2187,7 @@ var TextNode = /** @class */ (function (_super) {
|
|
|
2185
2187
|
TextNode.prototype.preinit = function (app, parent, text) {
|
|
2186
2188
|
var $ = this.$;
|
|
2187
2189
|
if (!text) {
|
|
2188
|
-
throw internalError('wrong TextNode::$preninit call');
|
|
2190
|
+
throw (0, errors_1.internalError)('wrong TextNode::$preninit call');
|
|
2189
2191
|
}
|
|
2190
2192
|
$.preinitText(app, parent, text);
|
|
2191
2193
|
$.parent.appendNode($.node);
|
|
@@ -2200,7 +2202,7 @@ var TextNode = /** @class */ (function (_super) {
|
|
|
2200
2202
|
};
|
|
2201
2203
|
return TextNode;
|
|
2202
2204
|
}(Fragment));
|
|
2203
|
-
|
|
2205
|
+
exports.TextNode = TextNode;
|
|
2204
2206
|
/**
|
|
2205
2207
|
* The private part of a base node
|
|
2206
2208
|
* @class INodePrivate
|
|
@@ -2223,7 +2225,7 @@ var INodePrivate = /** @class */ (function (_super) {
|
|
|
2223
2225
|
};
|
|
2224
2226
|
return INodePrivate;
|
|
2225
2227
|
}(FragmentPrivate));
|
|
2226
|
-
|
|
2228
|
+
exports.INodePrivate = INodePrivate;
|
|
2227
2229
|
/**
|
|
2228
2230
|
* Vasille node which can manipulate an element node
|
|
2229
2231
|
* @class INode
|
|
@@ -2258,7 +2260,7 @@ var INode = /** @class */ (function (_super) {
|
|
|
2258
2260
|
*/
|
|
2259
2261
|
INode.prototype.attr = function (name, value) {
|
|
2260
2262
|
var $ = this.$;
|
|
2261
|
-
var attr = new AttributeBinding(this, name, value);
|
|
2263
|
+
var attr = new attribute_1.AttributeBinding(this, name, value);
|
|
2262
2264
|
$.bindings.add(attr);
|
|
2263
2265
|
};
|
|
2264
2266
|
/**
|
|
@@ -2299,7 +2301,7 @@ var INode = /** @class */ (function (_super) {
|
|
|
2299
2301
|
*/
|
|
2300
2302
|
INode.prototype.bindClass = function (className) {
|
|
2301
2303
|
var $ = this.$;
|
|
2302
|
-
$.bindings.add(new DynamicalClassBinding(this, className));
|
|
2304
|
+
$.bindings.add(new class_1.DynamicalClassBinding(this, className));
|
|
2303
2305
|
return this;
|
|
2304
2306
|
};
|
|
2305
2307
|
/**
|
|
@@ -2308,7 +2310,7 @@ var INode = /** @class */ (function (_super) {
|
|
|
2308
2310
|
* @param className {string} class name
|
|
2309
2311
|
*/
|
|
2310
2312
|
INode.prototype.floatingClass = function (cond, className) {
|
|
2311
|
-
this.$.bindings.add(new StaticClassBinding(this, className, cond));
|
|
2313
|
+
this.$.bindings.add(new class_1.StaticClassBinding(this, className, cond));
|
|
2312
2314
|
return this;
|
|
2313
2315
|
};
|
|
2314
2316
|
/**
|
|
@@ -2319,10 +2321,10 @@ var INode = /** @class */ (function (_super) {
|
|
|
2319
2321
|
INode.prototype.style = function (name, value) {
|
|
2320
2322
|
var $ = this.$;
|
|
2321
2323
|
if ($.node instanceof HTMLElement) {
|
|
2322
|
-
$.bindings.add(new StyleBinding(this, name, value));
|
|
2324
|
+
$.bindings.add(new style_1.StyleBinding(this, name, value));
|
|
2323
2325
|
}
|
|
2324
2326
|
else {
|
|
2325
|
-
throw userError('style can be applied to HTML elements only', 'non-html-element');
|
|
2327
|
+
throw (0, errors_1.userError)('style can be applied to HTML elements only', 'non-html-element');
|
|
2326
2328
|
}
|
|
2327
2329
|
return this;
|
|
2328
2330
|
};
|
|
@@ -2336,7 +2338,7 @@ var INode = /** @class */ (function (_super) {
|
|
|
2336
2338
|
this.$.node.style.setProperty(prop, value);
|
|
2337
2339
|
}
|
|
2338
2340
|
else {
|
|
2339
|
-
throw userError("Style can be set for HTML elements only", "non-html-element");
|
|
2341
|
+
throw (0, errors_1.userError)("Style can be set for HTML elements only", "non-html-element");
|
|
2340
2342
|
}
|
|
2341
2343
|
return this;
|
|
2342
2344
|
};
|
|
@@ -2371,7 +2373,7 @@ var INode = /** @class */ (function (_super) {
|
|
|
2371
2373
|
});
|
|
2372
2374
|
}
|
|
2373
2375
|
else {
|
|
2374
|
-
throw userError('the element must be a html element', 'bind-show');
|
|
2376
|
+
throw (0, errors_1.userError)('the element must be a html element', 'bind-show');
|
|
2375
2377
|
}
|
|
2376
2378
|
};
|
|
2377
2379
|
/**
|
|
@@ -2388,14 +2390,14 @@ var INode = /** @class */ (function (_super) {
|
|
|
2388
2390
|
}, value);
|
|
2389
2391
|
}
|
|
2390
2392
|
else {
|
|
2391
|
-
throw userError("HTML can be bound for HTML nodes only", "dom-error");
|
|
2393
|
+
throw (0, errors_1.userError)("HTML can be bound for HTML nodes only", "dom-error");
|
|
2392
2394
|
}
|
|
2393
2395
|
};
|
|
2394
2396
|
INode.prototype.applyOptions = function (options) {
|
|
2395
2397
|
var _this = this;
|
|
2396
2398
|
options["v:attr"] && Object.keys(options["v:attr"]).forEach(function (name) {
|
|
2397
2399
|
var value = options["v:attr"][name];
|
|
2398
|
-
if (value instanceof IValue) {
|
|
2400
|
+
if (value instanceof ivalue_1.IValue) {
|
|
2399
2401
|
_this.attr(name, value);
|
|
2400
2402
|
}
|
|
2401
2403
|
else {
|
|
@@ -2404,7 +2406,7 @@ var INode = /** @class */ (function (_super) {
|
|
|
2404
2406
|
});
|
|
2405
2407
|
if (options.class) {
|
|
2406
2408
|
var handleClass_1 = function (name, value) {
|
|
2407
|
-
if (value instanceof IValue) {
|
|
2409
|
+
if (value instanceof ivalue_1.IValue) {
|
|
2408
2410
|
_this.floatingClass(value, name);
|
|
2409
2411
|
}
|
|
2410
2412
|
else if (value && name !== '$') {
|
|
@@ -2416,7 +2418,7 @@ var INode = /** @class */ (function (_super) {
|
|
|
2416
2418
|
};
|
|
2417
2419
|
if (Array.isArray(options.class)) {
|
|
2418
2420
|
options.class.forEach(function (item) {
|
|
2419
|
-
if (item instanceof IValue) {
|
|
2421
|
+
if (item instanceof ivalue_1.IValue) {
|
|
2420
2422
|
_this.bindClass(item);
|
|
2421
2423
|
}
|
|
2422
2424
|
else if (typeof item == "string") {
|
|
@@ -2440,14 +2442,14 @@ var INode = /** @class */ (function (_super) {
|
|
|
2440
2442
|
}
|
|
2441
2443
|
options.style && Object.keys(options.style).forEach(function (name) {
|
|
2442
2444
|
var value = options.style[name];
|
|
2443
|
-
if (value instanceof IValue) {
|
|
2445
|
+
if (value instanceof ivalue_1.IValue) {
|
|
2444
2446
|
_this.style(name, value);
|
|
2445
2447
|
}
|
|
2446
2448
|
else if (typeof value === "string") {
|
|
2447
2449
|
_this.setStyle(name, value);
|
|
2448
2450
|
}
|
|
2449
2451
|
else {
|
|
2450
|
-
if (value[0] instanceof IValue) {
|
|
2452
|
+
if (value[0] instanceof ivalue_1.IValue) {
|
|
2451
2453
|
_this.style(name, _this.expr(function (v) { return v + value[1]; }, value[0]));
|
|
2452
2454
|
}
|
|
2453
2455
|
else {
|
|
@@ -2480,7 +2482,7 @@ var INode = /** @class */ (function (_super) {
|
|
|
2480
2482
|
};
|
|
2481
2483
|
return INode;
|
|
2482
2484
|
}(Fragment));
|
|
2483
|
-
|
|
2485
|
+
exports.INode = INode;
|
|
2484
2486
|
/**
|
|
2485
2487
|
* Represents an Vasille.js HTML element node
|
|
2486
2488
|
* @class Tag
|
|
@@ -2495,7 +2497,7 @@ var Tag = /** @class */ (function (_super) {
|
|
|
2495
2497
|
}
|
|
2496
2498
|
Tag.prototype.preinit = function (app, parent, tagName) {
|
|
2497
2499
|
if (!tagName || typeof tagName !== "string") {
|
|
2498
|
-
throw internalError('wrong Tag::$preinit call');
|
|
2500
|
+
throw (0, errors_1.internalError)('wrong Tag::$preinit call');
|
|
2499
2501
|
}
|
|
2500
2502
|
var node = document.createElement(tagName);
|
|
2501
2503
|
var $ = this.$;
|
|
@@ -2551,7 +2553,7 @@ var Tag = /** @class */ (function (_super) {
|
|
|
2551
2553
|
};
|
|
2552
2554
|
return Tag;
|
|
2553
2555
|
}(INode));
|
|
2554
|
-
|
|
2556
|
+
exports.Tag = Tag;
|
|
2555
2557
|
/**
|
|
2556
2558
|
* Represents a vasille extension node
|
|
2557
2559
|
* @class Extension
|
|
@@ -2573,15 +2575,18 @@ var Extension = /** @class */ (function (_super) {
|
|
|
2573
2575
|
}
|
|
2574
2576
|
$.preinit(app, parent);
|
|
2575
2577
|
if (!it) {
|
|
2576
|
-
throw userError("A extension node can be encapsulated only in a tag/extension/component", "virtual-dom");
|
|
2578
|
+
throw (0, errors_1.userError)("A extension node can be encapsulated only in a tag/extension/component", "virtual-dom");
|
|
2577
2579
|
}
|
|
2578
2580
|
};
|
|
2581
|
+
Extension.prototype.extend = function (options) {
|
|
2582
|
+
this.applyOptions(options);
|
|
2583
|
+
};
|
|
2579
2584
|
Extension.prototype.$destroy = function () {
|
|
2580
2585
|
_super.prototype.$destroy.call(this);
|
|
2581
2586
|
};
|
|
2582
2587
|
return Extension;
|
|
2583
2588
|
}(INode));
|
|
2584
|
-
|
|
2589
|
+
exports.Extension = Extension;
|
|
2585
2590
|
/**
|
|
2586
2591
|
* Node which cas has just a child
|
|
2587
2592
|
* @class Component
|
|
@@ -2600,7 +2605,7 @@ var Component = /** @class */ (function (_super) {
|
|
|
2600
2605
|
Component.prototype.ready = function () {
|
|
2601
2606
|
_super.prototype.ready.call(this);
|
|
2602
2607
|
if (this.children.size !== 1) {
|
|
2603
|
-
throw userError("Component must have a child only", "dom-error");
|
|
2608
|
+
throw (0, errors_1.userError)("Component must have a child only", "dom-error");
|
|
2604
2609
|
}
|
|
2605
2610
|
var child = this.lastChild;
|
|
2606
2611
|
if (child instanceof Tag || child instanceof Component) {
|
|
@@ -2608,7 +2613,7 @@ var Component = /** @class */ (function (_super) {
|
|
|
2608
2613
|
$.node = child.node;
|
|
2609
2614
|
}
|
|
2610
2615
|
else {
|
|
2611
|
-
throw userError("Component child must be Tag or Component", "dom-error");
|
|
2616
|
+
throw (0, errors_1.userError)("Component child must be Tag or Component", "dom-error");
|
|
2612
2617
|
}
|
|
2613
2618
|
};
|
|
2614
2619
|
Component.prototype.preinit = function (app, parent) {
|
|
@@ -2616,7 +2621,7 @@ var Component = /** @class */ (function (_super) {
|
|
|
2616
2621
|
};
|
|
2617
2622
|
return Component;
|
|
2618
2623
|
}(Extension));
|
|
2619
|
-
|
|
2624
|
+
exports.Component = Component;
|
|
2620
2625
|
/**
|
|
2621
2626
|
* Private part of switch node
|
|
2622
2627
|
* @class SwitchedNodePrivate
|
|
@@ -2647,7 +2652,7 @@ var SwitchedNodePrivate = /** @class */ (function (_super) {
|
|
|
2647
2652
|
};
|
|
2648
2653
|
return SwitchedNodePrivate;
|
|
2649
2654
|
}(FragmentPrivate));
|
|
2650
|
-
|
|
2655
|
+
exports.SwitchedNodePrivate = SwitchedNodePrivate;
|
|
2651
2656
|
/**
|
|
2652
2657
|
* Defines a node witch can switch its children conditionally
|
|
2653
2658
|
*/
|
|
@@ -2718,7 +2723,7 @@ var SwitchedNode = /** @class */ (function (_super) {
|
|
|
2718
2723
|
};
|
|
2719
2724
|
return SwitchedNode;
|
|
2720
2725
|
}(Fragment));
|
|
2721
|
-
|
|
2726
|
+
exports.SwitchedNode = SwitchedNode;
|
|
2722
2727
|
/**
|
|
2723
2728
|
* The private part of a text node
|
|
2724
2729
|
*/
|
|
@@ -2739,7 +2744,7 @@ var DebugPrivate = /** @class */ (function (_super) {
|
|
|
2739
2744
|
var _this = this;
|
|
2740
2745
|
_super.prototype.preinit.call(this, app, parent);
|
|
2741
2746
|
this.node = document.createComment(text.$);
|
|
2742
|
-
this.bindings.add(new Expression(function (v) {
|
|
2747
|
+
this.bindings.add(new expression_1.Expression(function (v) {
|
|
2743
2748
|
_this.node.replaceData(0, -1, v);
|
|
2744
2749
|
}, true, text));
|
|
2745
2750
|
this.parent.appendNode(this.node);
|
|
@@ -2753,7 +2758,7 @@ var DebugPrivate = /** @class */ (function (_super) {
|
|
|
2753
2758
|
};
|
|
2754
2759
|
return DebugPrivate;
|
|
2755
2760
|
}(FragmentPrivate));
|
|
2756
|
-
|
|
2761
|
+
exports.DebugPrivate = DebugPrivate;
|
|
2757
2762
|
/**
|
|
2758
2763
|
* Represents a debug node
|
|
2759
2764
|
* @class DebugNode
|
|
@@ -2774,7 +2779,7 @@ var DebugNode = /** @class */ (function (_super) {
|
|
|
2774
2779
|
DebugNode.prototype.preinit = function (app, parent, text) {
|
|
2775
2780
|
var $ = this.$;
|
|
2776
2781
|
if (!text) {
|
|
2777
|
-
throw internalError('wrong DebugNode::$preninit call');
|
|
2782
|
+
throw (0, errors_1.internalError)('wrong DebugNode::$preninit call');
|
|
2778
2783
|
}
|
|
2779
2784
|
$.preinitComment(app, parent, text);
|
|
2780
2785
|
};
|
|
@@ -2787,23 +2792,29 @@ var DebugNode = /** @class */ (function (_super) {
|
|
|
2787
2792
|
};
|
|
2788
2793
|
return DebugNode;
|
|
2789
2794
|
}(Fragment));
|
|
2795
|
+
exports.DebugNode = DebugNode;
|
|
2790
2796
|
|
|
2791
2797
|
|
|
2792
|
-
window.FragmentPrivate = FragmentPrivate;
|
|
2793
|
-
window.Fragment = Fragment;
|
|
2794
|
-
window.TextNodePrivate = TextNodePrivate;
|
|
2795
|
-
window.TextNode = TextNode;
|
|
2796
|
-
window.INodePrivate = INodePrivate;
|
|
2797
|
-
window.INode = INode;
|
|
2798
|
-
window.Tag = Tag;
|
|
2799
|
-
window.Extension = Extension;
|
|
2800
|
-
window.Component = Component;
|
|
2801
|
-
window.SwitchedNodePrivate = SwitchedNodePrivate;
|
|
2802
|
-
window.SwitchedNode = SwitchedNode;
|
|
2803
|
-
window.DebugPrivate = DebugPrivate;
|
|
2804
|
-
window.DebugNode = DebugNode;
|
|
2805
|
-
|
|
2806
2798
|
// ./lib-es5/node/app.js
|
|
2799
|
+
"use strict";
|
|
2800
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2801
|
+
var extendStatics = function (d, b) {
|
|
2802
|
+
extendStatics = Object.setPrototypeOf ||
|
|
2803
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2804
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2805
|
+
return extendStatics(d, b);
|
|
2806
|
+
};
|
|
2807
|
+
return function (d, b) {
|
|
2808
|
+
if (typeof b !== "function" && b !== null)
|
|
2809
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2810
|
+
extendStatics(d, b);
|
|
2811
|
+
function __() { this.constructor = d; }
|
|
2812
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2813
|
+
};
|
|
2814
|
+
})();
|
|
2815
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2816
|
+
exports.Portal = exports.App = exports.AppNode = void 0;
|
|
2817
|
+
var node_1 = require("./node");
|
|
2807
2818
|
/**
|
|
2808
2819
|
* Application Node
|
|
2809
2820
|
* @class AppNode
|
|
@@ -2821,8 +2832,8 @@ var AppNode = /** @class */ (function (_super) {
|
|
|
2821
2832
|
return _this;
|
|
2822
2833
|
}
|
|
2823
2834
|
return AppNode;
|
|
2824
|
-
}(INode));
|
|
2825
|
-
|
|
2835
|
+
}(node_1.INode));
|
|
2836
|
+
exports.AppNode = AppNode;
|
|
2826
2837
|
/**
|
|
2827
2838
|
* Represents a Vasille.js application
|
|
2828
2839
|
* @class App
|
|
@@ -2848,7 +2859,7 @@ var App = /** @class */ (function (_super) {
|
|
|
2848
2859
|
};
|
|
2849
2860
|
return App;
|
|
2850
2861
|
}(AppNode));
|
|
2851
|
-
|
|
2862
|
+
exports.App = App;
|
|
2852
2863
|
var Portal = /** @class */ (function (_super) {
|
|
2853
2864
|
__extends(Portal, _super);
|
|
2854
2865
|
function Portal(input) {
|
|
@@ -2862,106 +2873,29 @@ var Portal = /** @class */ (function (_super) {
|
|
|
2862
2873
|
};
|
|
2863
2874
|
return Portal;
|
|
2864
2875
|
}(AppNode));
|
|
2876
|
+
exports.Portal = Portal;
|
|
2865
2877
|
|
|
2866
2878
|
|
|
2867
|
-
window.AppNode = AppNode;
|
|
2868
|
-
window.App = App;
|
|
2869
|
-
window.Portal = Portal;
|
|
2870
|
-
|
|
2871
|
-
// ./lib-es5/node/interceptor.js
|
|
2872
|
-
/**
|
|
2873
|
-
* Interceptor is designed to connect signals & methods of children elements
|
|
2874
|
-
* @class Interceptor
|
|
2875
|
-
* @extends Destroyable
|
|
2876
|
-
*/
|
|
2877
|
-
var Interceptor = /** @class */ (function (_super) {
|
|
2878
|
-
__extends(Interceptor, _super);
|
|
2879
|
-
function Interceptor() {
|
|
2880
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
2881
|
-
/**
|
|
2882
|
-
* Set of signals
|
|
2883
|
-
* @type Set
|
|
2884
|
-
*/
|
|
2885
|
-
_this.signals = new Set;
|
|
2886
|
-
/**
|
|
2887
|
-
* Set of handlers
|
|
2888
|
-
* @type Set
|
|
2889
|
-
*/
|
|
2890
|
-
_this.handlers = new Set;
|
|
2891
|
-
return _this;
|
|
2892
|
-
}
|
|
2893
|
-
/**
|
|
2894
|
-
* Connect a signal or a handler
|
|
2895
|
-
* @param thing {Signal | function}
|
|
2896
|
-
*/
|
|
2897
|
-
Interceptor.prototype.connect = function (thing) {
|
|
2898
|
-
// interceptor will connect signals and handlers together
|
|
2899
|
-
if (thing instanceof Signal) {
|
|
2900
|
-
this.handlers.forEach(function (handler) {
|
|
2901
|
-
thing.subscribe(handler);
|
|
2902
|
-
});
|
|
2903
|
-
this.signals.add(thing);
|
|
2904
|
-
}
|
|
2905
|
-
else {
|
|
2906
|
-
this.signals.forEach(function (signal) {
|
|
2907
|
-
signal.subscribe(thing);
|
|
2908
|
-
});
|
|
2909
|
-
this.handlers.add(thing);
|
|
2910
|
-
}
|
|
2911
|
-
};
|
|
2912
|
-
/**
|
|
2913
|
-
* Disconnect a handler from signals
|
|
2914
|
-
* @param handler {function}
|
|
2915
|
-
*/
|
|
2916
|
-
Interceptor.prototype.disconnect = function (handler) {
|
|
2917
|
-
this.signals.forEach(function (signal) {
|
|
2918
|
-
signal.unsubscribe(handler);
|
|
2919
|
-
});
|
|
2920
|
-
};
|
|
2921
|
-
Interceptor.prototype.destroy = function () {
|
|
2922
|
-
var _this = this;
|
|
2923
|
-
_super.prototype.destroy.call(this);
|
|
2924
|
-
this.signals.forEach(function (signal) {
|
|
2925
|
-
_this.handlers.forEach(function (handler) {
|
|
2926
|
-
signal.unsubscribe(handler);
|
|
2927
|
-
});
|
|
2928
|
-
});
|
|
2929
|
-
};
|
|
2930
|
-
return Interceptor;
|
|
2931
|
-
}(Destroyable));
|
|
2932
|
-
|
|
2933
|
-
/**
|
|
2934
|
-
* Interceptor node to implement directly to vasille DOM
|
|
2935
|
-
* @class InterceptorNode
|
|
2936
|
-
* @extends Extension
|
|
2937
|
-
*/
|
|
2938
|
-
var InterceptorNode = /** @class */ (function (_super) {
|
|
2939
|
-
__extends(InterceptorNode, _super);
|
|
2940
|
-
function InterceptorNode() {
|
|
2941
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
2942
|
-
/**
|
|
2943
|
-
* Internal interceptor
|
|
2944
|
-
* @type Interceptor
|
|
2945
|
-
*/
|
|
2946
|
-
_this.interceptor = new Interceptor;
|
|
2947
|
-
/**
|
|
2948
|
-
* The default slot of node
|
|
2949
|
-
* @type Slot
|
|
2950
|
-
*/
|
|
2951
|
-
_this.slot = new Slot;
|
|
2952
|
-
return _this;
|
|
2953
|
-
}
|
|
2954
|
-
InterceptorNode.prototype.compose = function () {
|
|
2955
|
-
this.slot.release(this, this.interceptor);
|
|
2956
|
-
};
|
|
2957
|
-
return InterceptorNode;
|
|
2958
|
-
}(Fragment));
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
window.Interceptor = Interceptor;
|
|
2962
|
-
window.InterceptorNode = InterceptorNode;
|
|
2963
|
-
|
|
2964
2879
|
// ./lib-es5/binding/attribute.js
|
|
2880
|
+
"use strict";
|
|
2881
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2882
|
+
var extendStatics = function (d, b) {
|
|
2883
|
+
extendStatics = Object.setPrototypeOf ||
|
|
2884
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2885
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2886
|
+
return extendStatics(d, b);
|
|
2887
|
+
};
|
|
2888
|
+
return function (d, b) {
|
|
2889
|
+
if (typeof b !== "function" && b !== null)
|
|
2890
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2891
|
+
extendStatics(d, b);
|
|
2892
|
+
function __() { this.constructor = d; }
|
|
2893
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2894
|
+
};
|
|
2895
|
+
})();
|
|
2896
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2897
|
+
exports.AttributeBinding = void 0;
|
|
2898
|
+
var binding_1 = require("./binding");
|
|
2965
2899
|
/**
|
|
2966
2900
|
* Represents an Attribute binding description
|
|
2967
2901
|
* @class AttributeBinding
|
|
@@ -2994,12 +2928,30 @@ var AttributeBinding = /** @class */ (function (_super) {
|
|
|
2994
2928
|
return _this;
|
|
2995
2929
|
}
|
|
2996
2930
|
return AttributeBinding;
|
|
2997
|
-
}(Binding));
|
|
2931
|
+
}(binding_1.Binding));
|
|
2932
|
+
exports.AttributeBinding = AttributeBinding;
|
|
2998
2933
|
|
|
2999
2934
|
|
|
3000
|
-
window.AttributeBinding = AttributeBinding;
|
|
3001
|
-
|
|
3002
2935
|
// ./lib-es5/binding/style.js
|
|
2936
|
+
"use strict";
|
|
2937
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2938
|
+
var extendStatics = function (d, b) {
|
|
2939
|
+
extendStatics = Object.setPrototypeOf ||
|
|
2940
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2941
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2942
|
+
return extendStatics(d, b);
|
|
2943
|
+
};
|
|
2944
|
+
return function (d, b) {
|
|
2945
|
+
if (typeof b !== "function" && b !== null)
|
|
2946
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2947
|
+
extendStatics(d, b);
|
|
2948
|
+
function __() { this.constructor = d; }
|
|
2949
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2950
|
+
};
|
|
2951
|
+
})();
|
|
2952
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2953
|
+
exports.StyleBinding = void 0;
|
|
2954
|
+
var binding_1 = require("./binding");
|
|
3003
2955
|
/**
|
|
3004
2956
|
* Describes a style attribute binding
|
|
3005
2957
|
* @class StyleBinding
|
|
@@ -3024,12 +2976,30 @@ var StyleBinding = /** @class */ (function (_super) {
|
|
|
3024
2976
|
return _this;
|
|
3025
2977
|
}
|
|
3026
2978
|
return StyleBinding;
|
|
3027
|
-
}(Binding));
|
|
2979
|
+
}(binding_1.Binding));
|
|
2980
|
+
exports.StyleBinding = StyleBinding;
|
|
3028
2981
|
|
|
3029
2982
|
|
|
3030
|
-
window.StyleBinding = StyleBinding;
|
|
3031
|
-
|
|
3032
2983
|
// ./lib-es5/binding/class.js
|
|
2984
|
+
"use strict";
|
|
2985
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2986
|
+
var extendStatics = function (d, b) {
|
|
2987
|
+
extendStatics = Object.setPrototypeOf ||
|
|
2988
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2989
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2990
|
+
return extendStatics(d, b);
|
|
2991
|
+
};
|
|
2992
|
+
return function (d, b) {
|
|
2993
|
+
if (typeof b !== "function" && b !== null)
|
|
2994
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2995
|
+
extendStatics(d, b);
|
|
2996
|
+
function __() { this.constructor = d; }
|
|
2997
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2998
|
+
};
|
|
2999
|
+
})();
|
|
3000
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3001
|
+
exports.DynamicalClassBinding = exports.StaticClassBinding = void 0;
|
|
3002
|
+
var binding_1 = require("./binding");
|
|
3033
3003
|
function addClass(node, cl) {
|
|
3034
3004
|
node.node.classList.add(cl);
|
|
3035
3005
|
}
|
|
@@ -3056,8 +3026,8 @@ var StaticClassBinding = /** @class */ (function (_super) {
|
|
|
3056
3026
|
return _this;
|
|
3057
3027
|
}
|
|
3058
3028
|
return StaticClassBinding;
|
|
3059
|
-
}(Binding));
|
|
3060
|
-
|
|
3029
|
+
}(binding_1.Binding));
|
|
3030
|
+
exports.StaticClassBinding = StaticClassBinding;
|
|
3061
3031
|
var DynamicalClassBinding = /** @class */ (function (_super) {
|
|
3062
3032
|
__extends(DynamicalClassBinding, _super);
|
|
3063
3033
|
function DynamicalClassBinding(node, value) {
|
|
@@ -3078,13 +3048,30 @@ var DynamicalClassBinding = /** @class */ (function (_super) {
|
|
|
3078
3048
|
return _this;
|
|
3079
3049
|
}
|
|
3080
3050
|
return DynamicalClassBinding;
|
|
3081
|
-
}(Binding));
|
|
3051
|
+
}(binding_1.Binding));
|
|
3052
|
+
exports.DynamicalClassBinding = DynamicalClassBinding;
|
|
3082
3053
|
|
|
3083
3054
|
|
|
3084
|
-
window.StaticClassBinding = StaticClassBinding;
|
|
3085
|
-
window.DynamicalClassBinding = DynamicalClassBinding;
|
|
3086
|
-
|
|
3087
3055
|
// ./lib-es5/views/repeat-node.js
|
|
3056
|
+
"use strict";
|
|
3057
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3058
|
+
var extendStatics = function (d, b) {
|
|
3059
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3060
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3061
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3062
|
+
return extendStatics(d, b);
|
|
3063
|
+
};
|
|
3064
|
+
return function (d, b) {
|
|
3065
|
+
if (typeof b !== "function" && b !== null)
|
|
3066
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3067
|
+
extendStatics(d, b);
|
|
3068
|
+
function __() { this.constructor = d; }
|
|
3069
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3070
|
+
};
|
|
3071
|
+
})();
|
|
3072
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3073
|
+
exports.RepeatNode = exports.RepeatNodePrivate = void 0;
|
|
3074
|
+
var node_1 = require("../node/node");
|
|
3088
3075
|
/**
|
|
3089
3076
|
* Private part of repeat node
|
|
3090
3077
|
* @class RepeatNodePrivate
|
|
@@ -3107,8 +3094,8 @@ var RepeatNodePrivate = /** @class */ (function (_super) {
|
|
|
3107
3094
|
_super.prototype.$destroy.call(this);
|
|
3108
3095
|
};
|
|
3109
3096
|
return RepeatNodePrivate;
|
|
3110
|
-
}(INodePrivate));
|
|
3111
|
-
|
|
3097
|
+
}(node_1.INodePrivate));
|
|
3098
|
+
exports.RepeatNodePrivate = RepeatNodePrivate;
|
|
3112
3099
|
/**
|
|
3113
3100
|
* Repeat node repeats its children
|
|
3114
3101
|
* @class RepeatNode
|
|
@@ -3125,7 +3112,7 @@ var RepeatNode = /** @class */ (function (_super) {
|
|
|
3125
3112
|
return _this;
|
|
3126
3113
|
}
|
|
3127
3114
|
RepeatNode.prototype.createChild = function (opts, id, item, before) {
|
|
3128
|
-
var node = new Fragment({});
|
|
3115
|
+
var node = new node_1.Fragment({});
|
|
3129
3116
|
this.destroyChild(id, item);
|
|
3130
3117
|
if (before) {
|
|
3131
3118
|
this.children.add(node);
|
|
@@ -3156,87 +3143,30 @@ var RepeatNode = /** @class */ (function (_super) {
|
|
|
3156
3143
|
}
|
|
3157
3144
|
};
|
|
3158
3145
|
return RepeatNode;
|
|
3159
|
-
}(Fragment));
|
|
3146
|
+
}(node_1.Fragment));
|
|
3147
|
+
exports.RepeatNode = RepeatNode;
|
|
3160
3148
|
|
|
3161
3149
|
|
|
3162
|
-
window.RepeatNodePrivate = RepeatNodePrivate;
|
|
3163
|
-
window.RepeatNode = RepeatNode;
|
|
3164
|
-
|
|
3165
|
-
// ./lib-es5/views/repeater.js
|
|
3166
|
-
/**
|
|
3167
|
-
* Private part of repeater
|
|
3168
|
-
* @class RepeaterPrivate
|
|
3169
|
-
* @extends RepeatNodePrivate
|
|
3170
|
-
*/
|
|
3171
|
-
var RepeaterPrivate = /** @class */ (function (_super) {
|
|
3172
|
-
__extends(RepeaterPrivate, _super);
|
|
3173
|
-
function RepeaterPrivate() {
|
|
3174
|
-
var _this = this; _super.call(this);
|
|
3175
|
-
/**
|
|
3176
|
-
* Current count of child nodes
|
|
3177
|
-
*/
|
|
3178
|
-
_this.currentCount = 0;
|
|
3179
|
-
_this.seal();
|
|
3180
|
-
return _this;
|
|
3181
|
-
}
|
|
3182
|
-
return RepeaterPrivate;
|
|
3183
|
-
}(RepeatNodePrivate));
|
|
3184
|
-
|
|
3185
|
-
/**
|
|
3186
|
-
* The simplest repeat node interpretation, repeat children pack a several times
|
|
3187
|
-
* @class Repeater
|
|
3188
|
-
* @extends RepeatNode
|
|
3189
|
-
*/
|
|
3190
|
-
var Repeater = /** @class */ (function (_super) {
|
|
3191
|
-
__extends(Repeater, _super);
|
|
3192
|
-
function Repeater($) {
|
|
3193
|
-
var _this = _super.call(this, $ || new RepeaterPrivate) || this;
|
|
3194
|
-
/**
|
|
3195
|
-
* The count of children
|
|
3196
|
-
*/
|
|
3197
|
-
_this.count = new Reference(0);
|
|
3198
|
-
_this.seal();
|
|
3199
|
-
return _this;
|
|
3200
|
-
}
|
|
3201
|
-
/**
|
|
3202
|
-
* Changes the children count
|
|
3203
|
-
*/
|
|
3204
|
-
Repeater.prototype.changeCount = function (number) {
|
|
3205
|
-
var $ = this.$;
|
|
3206
|
-
if (number > $.currentCount) {
|
|
3207
|
-
for (var i = $.currentCount; i < number; i++) {
|
|
3208
|
-
this.createChild(i, i);
|
|
3209
|
-
}
|
|
3210
|
-
}
|
|
3211
|
-
else {
|
|
3212
|
-
for (var i = $.currentCount - 1; i >= number; i--) {
|
|
3213
|
-
this.destroyChild(i, i);
|
|
3214
|
-
}
|
|
3215
|
-
}
|
|
3216
|
-
$.currentCount = number;
|
|
3217
|
-
};
|
|
3218
|
-
Repeater.prototype.created = function () {
|
|
3219
|
-
var $ = this.$;
|
|
3220
|
-
_super.prototype.created.call(this);
|
|
3221
|
-
$.updateHandler = this.changeCount.bind(this);
|
|
3222
|
-
this.count.on($.updateHandler);
|
|
3223
|
-
};
|
|
3224
|
-
Repeater.prototype.ready = function () {
|
|
3225
|
-
this.changeCount(this.count.$);
|
|
3226
|
-
};
|
|
3227
|
-
Repeater.prototype.destroy = function () {
|
|
3228
|
-
var $ = this.$;
|
|
3229
|
-
_super.prototype.destroy.call(this);
|
|
3230
|
-
this.count.off($.updateHandler);
|
|
3231
|
-
};
|
|
3232
|
-
return Repeater;
|
|
3233
|
-
}(RepeatNode));
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
window.RepeaterPrivate = RepeaterPrivate;
|
|
3237
|
-
window.Repeater = Repeater;
|
|
3238
|
-
|
|
3239
3150
|
// ./lib-es5/views/base-view.js
|
|
3151
|
+
"use strict";
|
|
3152
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3153
|
+
var extendStatics = function (d, b) {
|
|
3154
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3155
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3156
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3157
|
+
return extendStatics(d, b);
|
|
3158
|
+
};
|
|
3159
|
+
return function (d, b) {
|
|
3160
|
+
if (typeof b !== "function" && b !== null)
|
|
3161
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3162
|
+
extendStatics(d, b);
|
|
3163
|
+
function __() { this.constructor = d; }
|
|
3164
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3165
|
+
};
|
|
3166
|
+
})();
|
|
3167
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3168
|
+
exports.BaseView = exports.BaseViewPrivate = void 0;
|
|
3169
|
+
var repeat_node_1 = require("./repeat-node");
|
|
3240
3170
|
/**
|
|
3241
3171
|
* Private part of BaseView
|
|
3242
3172
|
* @class BaseViewPrivate
|
|
@@ -3250,8 +3180,8 @@ var BaseViewPrivate = /** @class */ (function (_super) {
|
|
|
3250
3180
|
return _this;
|
|
3251
3181
|
}
|
|
3252
3182
|
return BaseViewPrivate;
|
|
3253
|
-
}(RepeatNodePrivate));
|
|
3254
|
-
|
|
3183
|
+
}(repeat_node_1.RepeatNodePrivate));
|
|
3184
|
+
exports.BaseViewPrivate = BaseViewPrivate;
|
|
3255
3185
|
/**
|
|
3256
3186
|
* Base class of default views
|
|
3257
3187
|
* @class BaseView
|
|
@@ -3280,13 +3210,30 @@ var BaseView = /** @class */ (function (_super) {
|
|
|
3280
3210
|
});
|
|
3281
3211
|
};
|
|
3282
3212
|
return BaseView;
|
|
3283
|
-
}(RepeatNode));
|
|
3284
|
-
|
|
3213
|
+
}(repeat_node_1.RepeatNode));
|
|
3214
|
+
exports.BaseView = BaseView;
|
|
3285
3215
|
|
|
3286
|
-
window.BaseViewPrivate = BaseViewPrivate;
|
|
3287
|
-
window.BaseView = BaseView;
|
|
3288
3216
|
|
|
3289
3217
|
// ./lib-es5/views/array-view.js
|
|
3218
|
+
"use strict";
|
|
3219
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3220
|
+
var extendStatics = function (d, b) {
|
|
3221
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3222
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3223
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3224
|
+
return extendStatics(d, b);
|
|
3225
|
+
};
|
|
3226
|
+
return function (d, b) {
|
|
3227
|
+
if (typeof b !== "function" && b !== null)
|
|
3228
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3229
|
+
extendStatics(d, b);
|
|
3230
|
+
function __() { this.constructor = d; }
|
|
3231
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3232
|
+
};
|
|
3233
|
+
})();
|
|
3234
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3235
|
+
exports.ArrayView = void 0;
|
|
3236
|
+
var base_view_1 = require("./base-view");
|
|
3290
3237
|
/**
|
|
3291
3238
|
* Represents a view of an array model
|
|
3292
3239
|
* @class ArrayView
|
|
@@ -3308,12 +3255,30 @@ var ArrayView = /** @class */ (function (_super) {
|
|
|
3308
3255
|
});
|
|
3309
3256
|
};
|
|
3310
3257
|
return ArrayView;
|
|
3311
|
-
}(BaseView));
|
|
3312
|
-
|
|
3258
|
+
}(base_view_1.BaseView));
|
|
3259
|
+
exports.ArrayView = ArrayView;
|
|
3313
3260
|
|
|
3314
|
-
window.ArrayView = ArrayView;
|
|
3315
3261
|
|
|
3316
3262
|
// ./lib-es5/node/watch.js
|
|
3263
|
+
"use strict";
|
|
3264
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3265
|
+
var extendStatics = function (d, b) {
|
|
3266
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3267
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3268
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3269
|
+
return extendStatics(d, b);
|
|
3270
|
+
};
|
|
3271
|
+
return function (d, b) {
|
|
3272
|
+
if (typeof b !== "function" && b !== null)
|
|
3273
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3274
|
+
extendStatics(d, b);
|
|
3275
|
+
function __() { this.constructor = d; }
|
|
3276
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3277
|
+
};
|
|
3278
|
+
})();
|
|
3279
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3280
|
+
exports.Watch = void 0;
|
|
3281
|
+
var node_1 = require("./node");
|
|
3317
3282
|
/**
|
|
3318
3283
|
* Watch Node
|
|
3319
3284
|
* @class Watch
|
|
@@ -3337,12 +3302,30 @@ var Watch = /** @class */ (function (_super) {
|
|
|
3337
3302
|
input.slot(this, input.model.$);
|
|
3338
3303
|
};
|
|
3339
3304
|
return Watch;
|
|
3340
|
-
}(Fragment));
|
|
3341
|
-
|
|
3305
|
+
}(node_1.Fragment));
|
|
3306
|
+
exports.Watch = Watch;
|
|
3342
3307
|
|
|
3343
|
-
window.Watch = Watch;
|
|
3344
3308
|
|
|
3345
3309
|
// ./lib-es5/views/object-view.js
|
|
3310
|
+
"use strict";
|
|
3311
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3312
|
+
var extendStatics = function (d, b) {
|
|
3313
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3314
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3315
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3316
|
+
return extendStatics(d, b);
|
|
3317
|
+
};
|
|
3318
|
+
return function (d, b) {
|
|
3319
|
+
if (typeof b !== "function" && b !== null)
|
|
3320
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3321
|
+
extendStatics(d, b);
|
|
3322
|
+
function __() { this.constructor = d; }
|
|
3323
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3324
|
+
};
|
|
3325
|
+
})();
|
|
3326
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3327
|
+
exports.ObjectView = void 0;
|
|
3328
|
+
var base_view_1 = require("./base-view");
|
|
3346
3329
|
/**
|
|
3347
3330
|
* Create a children pack for each object field
|
|
3348
3331
|
* @class ObjectView
|
|
@@ -3355,19 +3338,37 @@ var ObjectView = /** @class */ (function (_super) {
|
|
|
3355
3338
|
}
|
|
3356
3339
|
ObjectView.prototype.compose = function (input) {
|
|
3357
3340
|
_super.prototype.compose.call(this, input);
|
|
3358
|
-
var obj = input.model.
|
|
3341
|
+
var obj = input.model.values;
|
|
3359
3342
|
for (var key in obj) {
|
|
3360
3343
|
this.createChild(input, key, obj[key]);
|
|
3361
3344
|
}
|
|
3362
3345
|
_super.prototype.ready.call(this);
|
|
3363
3346
|
};
|
|
3364
3347
|
return ObjectView;
|
|
3365
|
-
}(BaseView));
|
|
3366
|
-
|
|
3348
|
+
}(base_view_1.BaseView));
|
|
3349
|
+
exports.ObjectView = ObjectView;
|
|
3367
3350
|
|
|
3368
|
-
window.ObjectView = ObjectView;
|
|
3369
3351
|
|
|
3370
3352
|
// ./lib-es5/views/map-view.js
|
|
3353
|
+
"use strict";
|
|
3354
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3355
|
+
var extendStatics = function (d, b) {
|
|
3356
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3357
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3358
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3359
|
+
return extendStatics(d, b);
|
|
3360
|
+
};
|
|
3361
|
+
return function (d, b) {
|
|
3362
|
+
if (typeof b !== "function" && b !== null)
|
|
3363
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3364
|
+
extendStatics(d, b);
|
|
3365
|
+
function __() { this.constructor = d; }
|
|
3366
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3367
|
+
};
|
|
3368
|
+
})();
|
|
3369
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3370
|
+
exports.MapView = void 0;
|
|
3371
|
+
var base_view_1 = require("./base-view");
|
|
3371
3372
|
/**
|
|
3372
3373
|
* Create a children pack for each map value
|
|
3373
3374
|
* @class MapView
|
|
@@ -3386,12 +3387,30 @@ var MapView = /** @class */ (function (_super) {
|
|
|
3386
3387
|
});
|
|
3387
3388
|
};
|
|
3388
3389
|
return MapView;
|
|
3389
|
-
}(BaseView));
|
|
3390
|
-
|
|
3390
|
+
}(base_view_1.BaseView));
|
|
3391
|
+
exports.MapView = MapView;
|
|
3391
3392
|
|
|
3392
|
-
window.MapView = MapView;
|
|
3393
3393
|
|
|
3394
3394
|
// ./lib-es5/views/set-view.js
|
|
3395
|
+
"use strict";
|
|
3396
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3397
|
+
var extendStatics = function (d, b) {
|
|
3398
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3399
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3400
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3401
|
+
return extendStatics(d, b);
|
|
3402
|
+
};
|
|
3403
|
+
return function (d, b) {
|
|
3404
|
+
if (typeof b !== "function" && b !== null)
|
|
3405
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3406
|
+
extendStatics(d, b);
|
|
3407
|
+
function __() { this.constructor = d; }
|
|
3408
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3409
|
+
};
|
|
3410
|
+
})();
|
|
3411
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3412
|
+
exports.SetView = void 0;
|
|
3413
|
+
var base_view_1 = require("./base-view");
|
|
3395
3414
|
/**
|
|
3396
3415
|
* Create a children pack for each set value
|
|
3397
3416
|
* @class SetView
|
|
@@ -3411,302 +3430,13 @@ var SetView = /** @class */ (function (_super) {
|
|
|
3411
3430
|
});
|
|
3412
3431
|
};
|
|
3413
3432
|
return SetView;
|
|
3414
|
-
}(BaseView));
|
|
3415
|
-
|
|
3433
|
+
}(base_view_1.BaseView));
|
|
3434
|
+
exports.SetView = SetView;
|
|
3416
3435
|
|
|
3417
|
-
window.SetView = SetView;
|
|
3418
|
-
|
|
3419
|
-
// ./lib-es5/functional/merge.js
|
|
3420
|
-
function merge(main) {
|
|
3421
|
-
var targets = [];
|
|
3422
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
3423
|
-
targets[_i - 1] = arguments[_i];
|
|
3424
|
-
}
|
|
3425
|
-
function refactorClass(obj) {
|
|
3426
|
-
if (Array.isArray(obj.class)) {
|
|
3427
|
-
var out_1 = {
|
|
3428
|
-
$: []
|
|
3429
|
-
};
|
|
3430
|
-
obj.class.forEach(function (item) {
|
|
3431
|
-
if (item instanceof IValue) {
|
|
3432
|
-
out_1.$.push(item);
|
|
3433
|
-
}
|
|
3434
|
-
else if (typeof item === 'string') {
|
|
3435
|
-
out_1[item] = true;
|
|
3436
|
-
}
|
|
3437
|
-
else if (typeof item === 'object') {
|
|
3438
|
-
Object.assign(out_1, item);
|
|
3439
|
-
}
|
|
3440
|
-
});
|
|
3441
|
-
obj.class = out_1;
|
|
3442
|
-
}
|
|
3443
|
-
}
|
|
3444
|
-
refactorClass(main);
|
|
3445
|
-
targets.forEach(function (target) {
|
|
3446
|
-
Reflect.ownKeys(target).forEach(function (prop) {
|
|
3447
|
-
var _a;
|
|
3448
|
-
if (!Reflect.has(main, prop)) {
|
|
3449
|
-
main[prop] = target[prop];
|
|
3450
|
-
}
|
|
3451
|
-
else if (typeof main[prop] === 'object' && typeof target[prop] === 'object') {
|
|
3452
|
-
if (prop === 'class') {
|
|
3453
|
-
refactorClass(target);
|
|
3454
|
-
}
|
|
3455
|
-
if (prop === '$' && Array.isArray(main[prop]) && Array.isArray(target[prop])) {
|
|
3456
|
-
(_a = main.$).push.apply(_a, target.$);
|
|
3457
|
-
}
|
|
3458
|
-
else {
|
|
3459
|
-
merge(main[prop], target[prop]);
|
|
3460
|
-
}
|
|
3461
|
-
}
|
|
3462
|
-
});
|
|
3463
|
-
});
|
|
3464
|
-
}
|
|
3465
|
-
|
|
3466
|
-
window.merge = merge;
|
|
3467
|
-
|
|
3468
|
-
// ./lib-es5/functional/stack.js
|
|
3469
|
-
function app(renderer) {
|
|
3470
|
-
return function (node, opts) {
|
|
3471
|
-
return new App(node, opts).runFunctional(renderer, opts);
|
|
3472
|
-
};
|
|
3473
|
-
}
|
|
3474
|
-
function component(renderer) {
|
|
3475
|
-
return function (opts, callback) {
|
|
3476
|
-
var component = new Component(opts);
|
|
3477
|
-
if (!(current instanceof Fragment))
|
|
3478
|
-
throw userError('missing parent node', 'out-of-context');
|
|
3479
|
-
var ret;
|
|
3480
|
-
if (callback)
|
|
3481
|
-
opts.slot = callback;
|
|
3482
|
-
current.create(component, function (node) {
|
|
3483
|
-
ret = node.runFunctional(renderer, opts);
|
|
3484
|
-
});
|
|
3485
|
-
return ret;
|
|
3486
|
-
};
|
|
3487
|
-
}
|
|
3488
|
-
function fragment(renderer) {
|
|
3489
|
-
return function (opts, callback) {
|
|
3490
|
-
var frag = new Fragment(opts);
|
|
3491
|
-
if (!(current instanceof Fragment))
|
|
3492
|
-
throw userError('missing parent node', 'out-of-context');
|
|
3493
|
-
if (callback)
|
|
3494
|
-
opts.slot = callback;
|
|
3495
|
-
current.create(frag);
|
|
3496
|
-
return frag.runFunctional(renderer, opts);
|
|
3497
|
-
};
|
|
3498
|
-
}
|
|
3499
|
-
function extension(renderer) {
|
|
3500
|
-
return function (opts, callback) {
|
|
3501
|
-
var ext = new Extension(opts);
|
|
3502
|
-
if (!(current instanceof Fragment))
|
|
3503
|
-
throw userError('missing parent node', 'out-of-context');
|
|
3504
|
-
if (callback)
|
|
3505
|
-
opts.slot = callback;
|
|
3506
|
-
current.create(ext);
|
|
3507
|
-
return ext.runFunctional(renderer, opts);
|
|
3508
|
-
};
|
|
3509
|
-
}
|
|
3510
|
-
function tag(name, opts, callback) {
|
|
3511
|
-
if (!(current instanceof Fragment))
|
|
3512
|
-
throw userError('missing parent node', 'out-of-context');
|
|
3513
|
-
return {
|
|
3514
|
-
node: current.tag(name, opts, function (node) {
|
|
3515
|
-
callback && node.runFunctional(callback);
|
|
3516
|
-
})
|
|
3517
|
-
};
|
|
3518
|
-
}
|
|
3519
|
-
function create(node, callback) {
|
|
3520
|
-
if (!(current instanceof Fragment))
|
|
3521
|
-
throw userError('missing current node', 'out-of-context');
|
|
3522
|
-
current.create(node, function (node) {
|
|
3523
|
-
var args = [];
|
|
3524
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
3525
|
-
args[_i - 1] = arguments[_i];
|
|
3526
|
-
}
|
|
3527
|
-
callback && node.runFunctional.apply(node, __spreadArray([callback], args, false));
|
|
3528
|
-
});
|
|
3529
|
-
return node;
|
|
3530
|
-
}
|
|
3531
|
-
var vx = {
|
|
3532
|
-
if: function (condition, callback) {
|
|
3533
|
-
if (current instanceof Fragment) {
|
|
3534
|
-
current.if(condition, function (node) { return node.runFunctional(callback); });
|
|
3535
|
-
}
|
|
3536
|
-
else {
|
|
3537
|
-
throw userError("wrong use of `v.if` function", "logic-error");
|
|
3538
|
-
}
|
|
3539
|
-
},
|
|
3540
|
-
else: function (callback) {
|
|
3541
|
-
if (current instanceof Fragment) {
|
|
3542
|
-
current.else(function (node) { return node.runFunctional(callback); });
|
|
3543
|
-
}
|
|
3544
|
-
else {
|
|
3545
|
-
throw userError("wrong use of `v.else` function", "logic-error");
|
|
3546
|
-
}
|
|
3547
|
-
},
|
|
3548
|
-
elif: function (condition, callback) {
|
|
3549
|
-
if (current instanceof Fragment) {
|
|
3550
|
-
current.elif(condition, function (node) { return node.runFunctional(callback); });
|
|
3551
|
-
}
|
|
3552
|
-
else {
|
|
3553
|
-
throw userError("wrong use of `v.elif` function", "logic-error");
|
|
3554
|
-
}
|
|
3555
|
-
},
|
|
3556
|
-
for: function (model, callback) {
|
|
3557
|
-
if (model instanceof ArrayModel) {
|
|
3558
|
-
// for arrays T & K are the same type
|
|
3559
|
-
create(new ArrayView({ model: model }), callback);
|
|
3560
|
-
}
|
|
3561
|
-
else if (model instanceof MapModel) {
|
|
3562
|
-
create(new MapView({ model: model }), callback);
|
|
3563
|
-
}
|
|
3564
|
-
else if (model instanceof SetModel) {
|
|
3565
|
-
// for sets T & K are the same type
|
|
3566
|
-
create(new SetView({ model: model }), callback);
|
|
3567
|
-
}
|
|
3568
|
-
else if (model instanceof ObjectModel) {
|
|
3569
|
-
// for objects K is always string
|
|
3570
|
-
create(new ObjectView({ model: model }), callback);
|
|
3571
|
-
}
|
|
3572
|
-
else {
|
|
3573
|
-
throw userError("wrong use of `v.for` function", 'wrong-model');
|
|
3574
|
-
}
|
|
3575
|
-
},
|
|
3576
|
-
watch: function (model, callback) {
|
|
3577
|
-
var opts = { model: model };
|
|
3578
|
-
create(new Watch(opts), callback);
|
|
3579
|
-
},
|
|
3580
|
-
nextTick: function (callback) {
|
|
3581
|
-
var node = current;
|
|
3582
|
-
window.setTimeout(function () {
|
|
3583
|
-
node.runFunctional(callback);
|
|
3584
|
-
}, 0);
|
|
3585
|
-
}
|
|
3586
|
-
};
|
|
3587
|
-
|
|
3588
|
-
window.app = app;
|
|
3589
|
-
window.component = component;
|
|
3590
|
-
window.fragment = fragment;
|
|
3591
|
-
window.extension = extension;
|
|
3592
|
-
window.tag = tag;
|
|
3593
|
-
window.create = create;
|
|
3594
|
-
window.vx = vx;
|
|
3595
|
-
|
|
3596
|
-
// ./lib-es5/functional/models.js
|
|
3597
|
-
function arrayModel(arr) {
|
|
3598
|
-
if (arr === void 0) { arr = []; }
|
|
3599
|
-
if (!current)
|
|
3600
|
-
throw userError('missing parent node', 'out-of-context');
|
|
3601
|
-
return current.register(new ArrayModel(arr)).proxy();
|
|
3602
|
-
}
|
|
3603
|
-
function mapModel(map) {
|
|
3604
|
-
if (map === void 0) { map = []; }
|
|
3605
|
-
if (!current)
|
|
3606
|
-
throw userError('missing parent node', 'out-of-context');
|
|
3607
|
-
return current.register(new MapModel(map));
|
|
3608
|
-
}
|
|
3609
|
-
function setModel(arr) {
|
|
3610
|
-
if (arr === void 0) { arr = []; }
|
|
3611
|
-
if (!current)
|
|
3612
|
-
throw userError('missing parent node', 'out-of-context');
|
|
3613
|
-
return current.register(new SetModel(arr));
|
|
3614
|
-
}
|
|
3615
|
-
function objectModel(obj) {
|
|
3616
|
-
if (obj === void 0) { obj = {}; }
|
|
3617
|
-
if (!current)
|
|
3618
|
-
throw userError('missing parent node', 'out-of-context');
|
|
3619
|
-
return current.register(new ObjectModel(obj));
|
|
3620
|
-
}
|
|
3621
|
-
|
|
3622
|
-
window.arrayModel = arrayModel;
|
|
3623
|
-
window.mapModel = mapModel;
|
|
3624
|
-
window.setModel = setModel;
|
|
3625
|
-
window.objectModel = objectModel;
|
|
3626
3436
|
|
|
3627
3437
|
// ./lib-es5/functional/options.js
|
|
3438
|
+
"use strict";
|
|
3439
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3628
3440
|
|
|
3629
3441
|
|
|
3630
|
-
|
|
3631
|
-
// ./lib-es5/functional/reactivity.js
|
|
3632
|
-
function ref(value) {
|
|
3633
|
-
var ref = current.ref(value);
|
|
3634
|
-
return [ref, function (value) { return ref.$ = value; }];
|
|
3635
|
-
}
|
|
3636
|
-
function mirror(value) {
|
|
3637
|
-
return current.mirror(value);
|
|
3638
|
-
}
|
|
3639
|
-
function forward(value) {
|
|
3640
|
-
return current.forward(value);
|
|
3641
|
-
}
|
|
3642
|
-
function point(value) {
|
|
3643
|
-
return current.point(value);
|
|
3644
|
-
}
|
|
3645
|
-
function expr(func) {
|
|
3646
|
-
var values = [];
|
|
3647
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
3648
|
-
values[_i - 1] = arguments[_i];
|
|
3649
|
-
}
|
|
3650
|
-
return current.expr.apply(current, __spreadArray([func], values, false));
|
|
3651
|
-
}
|
|
3652
|
-
function watch(func) {
|
|
3653
|
-
var values = [];
|
|
3654
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
3655
|
-
values[_i - 1] = arguments[_i];
|
|
3656
|
-
}
|
|
3657
|
-
current.watch.apply(current, __spreadArray([func], values, false));
|
|
3658
|
-
}
|
|
3659
|
-
function valueOf(value) {
|
|
3660
|
-
return value.$;
|
|
3661
|
-
}
|
|
3662
|
-
function setValue(ref, value) {
|
|
3663
|
-
if (ref instanceof Pointer && value instanceof IValue) {
|
|
3664
|
-
ref.$$ = value;
|
|
3665
|
-
}
|
|
3666
|
-
else {
|
|
3667
|
-
ref.$ = value instanceof IValue ? value.$ : value;
|
|
3668
|
-
}
|
|
3669
|
-
}
|
|
3670
|
-
|
|
3671
|
-
window.ref = ref;
|
|
3672
|
-
window.mirror = mirror;
|
|
3673
|
-
window.forward = forward;
|
|
3674
|
-
window.point = point;
|
|
3675
|
-
window.expr = expr;
|
|
3676
|
-
window.watch = watch;
|
|
3677
|
-
window.valueOf = valueOf;
|
|
3678
|
-
window.setValue = setValue;
|
|
3679
|
-
|
|
3680
|
-
// ./lib-es5/functional/components.js
|
|
3681
|
-
function text(text) {
|
|
3682
|
-
if (!(current instanceof Fragment))
|
|
3683
|
-
throw userError('missing parent node', 'out-of-context');
|
|
3684
|
-
;
|
|
3685
|
-
current.text(text);
|
|
3686
|
-
}
|
|
3687
|
-
function debug(text) {
|
|
3688
|
-
if (!(current instanceof Fragment))
|
|
3689
|
-
throw userError('missing parent node', 'out-of-context');
|
|
3690
|
-
current.debug(text);
|
|
3691
|
-
}
|
|
3692
|
-
function predefine(slot, predefined) {
|
|
3693
|
-
return slot || predefined;
|
|
3694
|
-
}
|
|
3695
|
-
|
|
3696
|
-
window.text = text;
|
|
3697
|
-
window.debug = debug;
|
|
3698
|
-
window.predefine = predefine;
|
|
3699
|
-
|
|
3700
|
-
// ./lib-es5/v/index.js
|
|
3701
|
-
|
|
3702
|
-
var v = __assign(__assign({ ref: function (value) {
|
|
3703
|
-
return current.ref(value);
|
|
3704
|
-
}, expr: expr, of: valueOf, sv: setValue, alwaysFalse: new Reference(false), app: app, component: component, fragment: fragment, extension: extension, text: text, tag: tag, create: create }, vx), { merge: merge, destructor: function () {
|
|
3705
|
-
return current.$destroy.bind(current);
|
|
3706
|
-
}, runOnDestroy: function (callback) {
|
|
3707
|
-
current.runOnDestroy(callback);
|
|
3708
|
-
} });
|
|
3709
|
-
|
|
3710
|
-
window.v = v;
|
|
3711
|
-
|
|
3712
3442
|
})();
|