native-document 1.0.26 → 1.0.28
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/dist/native-document.dev.js +20 -5
- package/dist/native-document.dev.js.map +1 -1
- package/dist/native-document.min.js +1 -1
- package/docs/observables.md +50 -0
- package/index.d.ts +17 -0
- package/package.json +3 -2
- package/readme.md +3 -2
- package/src/utils/events.js +16 -1
- package/src/wrappers/AttributesWrapper.js +1 -1
- package/src/wrappers/NDElement.js +3 -3
- package/types/control-flow.d.ts +51 -0
- package/types/elements.d.ts +460 -0
- package/types/forms.d.ts +34 -0
- package/types/images.d.ts +12 -0
- package/types/observable.d.ts +129 -0
- package/types/polyfill.d.ts +8 -0
- package/types/router.d.ts +80 -0
- package/types/store.d.ts +12 -0
|
@@ -331,7 +331,7 @@ var NativeDocument = (function (exports) {
|
|
|
331
331
|
};
|
|
332
332
|
ObservableItem.prototype.get = ObservableItem.prototype.check;
|
|
333
333
|
|
|
334
|
-
ObservableItem.prototype.
|
|
334
|
+
ObservableItem.prototype.when = function(value) {
|
|
335
335
|
return {$target: value, $observer: this};
|
|
336
336
|
};
|
|
337
337
|
|
|
@@ -505,7 +505,22 @@ var NativeDocument = (function (exports) {
|
|
|
505
505
|
"Suspend",
|
|
506
506
|
"TimeUpdate",
|
|
507
507
|
"VolumeChange",
|
|
508
|
-
"Waiting"
|
|
508
|
+
"Waiting",
|
|
509
|
+
|
|
510
|
+
"TouchCancel",
|
|
511
|
+
"TouchEnd",
|
|
512
|
+
"TouchMove",
|
|
513
|
+
"TouchStart",
|
|
514
|
+
"AnimationEnd",
|
|
515
|
+
"AnimationIteration",
|
|
516
|
+
"AnimationStart",
|
|
517
|
+
"TransitionEnd",
|
|
518
|
+
"Copy",
|
|
519
|
+
"Cut",
|
|
520
|
+
"Paste",
|
|
521
|
+
"FocusIn",
|
|
522
|
+
"FocusOut",
|
|
523
|
+
"ContextMenu"
|
|
509
524
|
];
|
|
510
525
|
|
|
511
526
|
function NDElement(element) {
|
|
@@ -523,14 +538,14 @@ var NativeDocument = (function (exports) {
|
|
|
523
538
|
NDElement.prototype['onPrevent'+event] = function(callback) {
|
|
524
539
|
this.$element.addEventListener(eventName, function(event) {
|
|
525
540
|
event.preventDefault();
|
|
526
|
-
callback(event);
|
|
541
|
+
callback && callback(event);
|
|
527
542
|
});
|
|
528
543
|
return this;
|
|
529
544
|
};
|
|
530
545
|
NDElement.prototype['onStop'+event] = function(callback) {
|
|
531
546
|
this.$element.addEventListener(eventName, function(event) {
|
|
532
547
|
event.stopPropagation();
|
|
533
|
-
callback(event);
|
|
548
|
+
callback && callback(event);
|
|
534
549
|
});
|
|
535
550
|
return this;
|
|
536
551
|
};
|
|
@@ -538,7 +553,7 @@ var NativeDocument = (function (exports) {
|
|
|
538
553
|
this.$element.addEventListener(eventName, function(event) {
|
|
539
554
|
event.stopPropagation();
|
|
540
555
|
event.preventDefault();
|
|
541
|
-
callback(event);
|
|
556
|
+
callback && callback(event);
|
|
542
557
|
});
|
|
543
558
|
return this;
|
|
544
559
|
};
|