@extscreen/es-core 10000.0.10 → 10000.0.13
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +58 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import Vue from 'vue';
|
2
|
+
import { ESLog } from '@extscreen/es-log';
|
2
3
|
|
3
4
|
/**
|
4
5
|
*
|
@@ -2548,11 +2549,9 @@ function ESPageRootViewComponent() {
|
|
2548
2549
|
Vue.component('page', {
|
2549
2550
|
methods: {
|
2550
2551
|
onLifecycleChanged(evt) {
|
2551
|
-
console.log('ESRouter', "--------onLifecycleChanged------>>>>>" + evt);
|
2552
2552
|
this.$emit("onLifecycleChanged", evt);
|
2553
2553
|
},
|
2554
2554
|
onDispatchKeyEvent(evt) {
|
2555
|
-
console.log('ESRouter', "--------onDispatchKeyEvent------>>>>>" + evt);
|
2556
2555
|
this.$emit("onDispatchKeyEvent", evt);
|
2557
2556
|
},
|
2558
2557
|
},
|
@@ -2708,26 +2707,8 @@ const AUDIO_USAGE_ASSISTANT = 16;
|
|
2708
2707
|
*/
|
2709
2708
|
|
2710
2709
|
var ESBackPressMixin = {
|
2711
|
-
|
2712
2710
|
mounted() {
|
2713
2711
|
Vue.Native.callNative('DeviceEventModule', 'setListenBackPress', true);
|
2714
|
-
if (!ESLaunchManager$1.isESRouterEnabled()) {
|
2715
|
-
ESApp.$on('hardwareBackPress', this.onESBackPressed);
|
2716
|
-
}
|
2717
|
-
},
|
2718
|
-
beforeDestroy() {
|
2719
|
-
if (!ESLaunchManager$1.isESRouterEnabled()) {
|
2720
|
-
ESApp.$off('hardwareBackPress', this.onESBackPressed);
|
2721
|
-
}
|
2722
|
-
},
|
2723
|
-
|
2724
|
-
methods: {
|
2725
|
-
onESBackPressed() {
|
2726
|
-
this.onBackPressed();
|
2727
|
-
},
|
2728
|
-
onBackPressed() {
|
2729
|
-
|
2730
|
-
},
|
2731
2712
|
},
|
2732
2713
|
};
|
2733
2714
|
|
@@ -2735,12 +2716,22 @@ var ESBackPressMixin = {
|
|
2735
2716
|
const KEY_ACTION_DOWN = 0;
|
2736
2717
|
const KEY_ACTION_UP = 1;
|
2737
2718
|
|
2719
|
+
const KEYCODE_ENTER = 66;
|
2720
|
+
const KEYCODE_DPAD_CENTER = 23;
|
2721
|
+
const KEYCODE_DPAD_UP = 19;
|
2722
|
+
const KEYCODE_DPAD_DOWN = 20;
|
2723
|
+
const KEYCODE_DPAD_LEFT = 21;
|
2724
|
+
const KEYCODE_DPAD_RIGHT = 22;
|
2725
|
+
const KEYCODE_BACK = 4;
|
2726
|
+
const KEYCODE_ESCAPE = 111;
|
2727
|
+
const KEYCODE_MENU = 82;
|
2728
|
+
const KEYCODE_SEARCH = 84;
|
2729
|
+
|
2738
2730
|
/**
|
2739
2731
|
* 处理key事件
|
2740
2732
|
*/
|
2741
2733
|
|
2742
2734
|
var ESKeyEventMixin = {
|
2743
|
-
|
2744
2735
|
mounted() {
|
2745
2736
|
if (!ESLaunchManager$1.isESRouterEnabled()) {
|
2746
2737
|
ESApp.$on('DispatchKeyEvent', this.onDispatchKeyEvent);
|
@@ -2754,21 +2745,31 @@ var ESKeyEventMixin = {
|
|
2754
2745
|
|
2755
2746
|
methods: {
|
2756
2747
|
onDispatchKeyEvent(keyEvent) {
|
2748
|
+
if (ESLog.isLoggable(ESLog.DEBUG)) {
|
2749
|
+
ESLog.d('ESRouter', '----ESKeyEventMixin---onDispatchKeyEvent----->>>>' + JSON.stringify(keyEvent));
|
2750
|
+
}
|
2757
2751
|
if (keyEvent.action === KEY_ACTION_DOWN) {
|
2758
|
-
|
2752
|
+
if (keyEvent.keyCode === KEYCODE_BACK || keyEvent.keyCode === KEYCODE_ESCAPE) {
|
2753
|
+
this.onBackPressed();
|
2754
|
+
} else {
|
2755
|
+
this.onKeyDown(keyEvent);
|
2756
|
+
}
|
2759
2757
|
}
|
2760
2758
|
//
|
2761
2759
|
else if (keyEvent.action === KEY_ACTION_UP) {
|
2762
|
-
|
2760
|
+
if (keyEvent.keyCode === KEYCODE_BACK || keyEvent.keyCode === KEYCODE_ESCAPE) ; else {
|
2761
|
+
this.onKeyUp(keyEvent);
|
2762
|
+
}
|
2763
2763
|
}
|
2764
2764
|
},
|
2765
|
-
//页面复写即可
|
2766
2765
|
onKeyDown(keyEvent) {
|
2767
2766
|
|
2768
2767
|
},
|
2769
|
-
//页面复写即可
|
2770
2768
|
onKeyUp(keyEvent) {
|
2771
2769
|
|
2770
|
+
},
|
2771
|
+
onBackPressed() {
|
2772
|
+
|
2772
2773
|
},
|
2773
2774
|
},
|
2774
2775
|
};
|
@@ -2792,10 +2793,29 @@ var ESLifecycleMixin = {
|
|
2792
2793
|
|
2793
2794
|
methods: {
|
2794
2795
|
onESLifecycleChanged(event) {
|
2795
|
-
if (
|
2796
|
+
if (ESLog.isLoggable(ESLog.DEBUG)) {
|
2797
|
+
ESLog.d('ESRouter', '----ESLifecycleMixin---onESLifecycleChanged----->>>>' + event);
|
2798
|
+
}
|
2799
|
+
if (event === 'onCreate') {
|
2800
|
+
this.onESCreate();
|
2801
|
+
}
|
2802
|
+
//
|
2803
|
+
else if (event === 'onStart') {
|
2804
|
+
this.onESStart();
|
2805
|
+
}
|
2806
|
+
//
|
2807
|
+
else if (event === 'onResume') {
|
2796
2808
|
this.onESResume();
|
2797
2809
|
}
|
2798
2810
|
//
|
2811
|
+
else if (event === 'visibleToUser') {
|
2812
|
+
this.onESVisibleToUser();
|
2813
|
+
}
|
2814
|
+
//
|
2815
|
+
else if (event === 'invisibleToUser') {
|
2816
|
+
this.onESInvisibleToUser();
|
2817
|
+
}
|
2818
|
+
//
|
2799
2819
|
else if (event === 'onPause') {
|
2800
2820
|
this.onESPause();
|
2801
2821
|
}
|
@@ -2813,8 +2833,20 @@ var ESLifecycleMixin = {
|
|
2813
2833
|
},
|
2814
2834
|
|
2815
2835
|
//------------------------------------
|
2836
|
+
onESCreate() {
|
2837
|
+
|
2838
|
+
},
|
2839
|
+
onESStart() {
|
2840
|
+
|
2841
|
+
},
|
2816
2842
|
onESResume() {
|
2817
2843
|
|
2844
|
+
},
|
2845
|
+
onESInvisibleToUser() {
|
2846
|
+
|
2847
|
+
},
|
2848
|
+
onESVisibleToUser() {
|
2849
|
+
|
2818
2850
|
},
|
2819
2851
|
onESPause() {
|
2820
2852
|
|
@@ -2831,17 +2863,6 @@ var ESLifecycleMixin = {
|
|
2831
2863
|
},
|
2832
2864
|
};
|
2833
2865
|
|
2834
|
-
const KEYCODE_ENTER = 66;
|
2835
|
-
const KEYCODE_DPAD_CENTER = 23;
|
2836
|
-
const KEYCODE_DPAD_UP = 19;
|
2837
|
-
const KEYCODE_DPAD_DOWN = 20;
|
2838
|
-
const KEYCODE_DPAD_LEFT = 21;
|
2839
|
-
const KEYCODE_DPAD_RIGHT = 22;
|
2840
|
-
const KEYCODE_BACK = 4;
|
2841
|
-
const KEYCODE_ESCAPE = 111;
|
2842
|
-
const KEYCODE_MENU = 82;
|
2843
|
-
const KEYCODE_SEARCH = 84;
|
2844
|
-
|
2845
2866
|
//
|
2846
2867
|
const ES_ACCELERATE_DECELERATE_INTERPOLATOR = 1;
|
2847
2868
|
const ES_ACCELERATE_INTERPOLATOR = 2;
|