@shijiu/jsview-vue 1.9.650 → 1.9.720
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/package.json +7 -18
- package/samples/AnimPicture/App.vue +5 -5
- package/samples/Basic/components/div/DivLayout.vue +1 -1
- package/samples/Basic/components/text/TextOverflow.vue +10 -5
- package/samples/BasicFocusControl/components/BaseBlock.vue +2 -2
- package/samples/Collision/App.vue +452 -0
- package/samples/DemoHomepage/components/BodyFrame.vue +2 -0
- package/samples/DemoHomepage/router.js +21 -1
- package/samples/DemoHomepage/views/Homepage.vue +3 -7
- package/samples/FilterDemo/App.vue +1 -1
- package/samples/FlipCard/App.vue +2 -2
- package/samples/FlipCard/FlipCard.vue +2 -2
- package/samples/GridDemo/App.vue +3 -3
- package/samples/GridDemo/ButtonBlock.vue +2 -2
- package/samples/GridDemo/FocusItem.vue +2 -2
- package/samples/GridDemo/Item.vue +1 -1
- package/samples/HashHistory/App.vue +10 -3
- package/samples/HashHistory/components/Item.vue +1 -1
- package/samples/ImpactStop/App.vue +435 -0
- package/samples/Input/App.vue +8 -17
- package/samples/Input/InputPanel.vue +19 -12
- package/samples/LongImage/Button.vue +1 -1
- package/samples/LongImage/ButtonItem.vue +1 -1
- package/samples/LongImage/LongImageScroll.vue +2 -2
- package/samples/LongText/App.vue +1 -1
- package/samples/LongText/Button.vue +1 -1
- package/samples/LongText/ButtonItem.vue +1 -1
- package/samples/LongText/LongTextScroll.vue +3 -3
- package/samples/Marquee/App.vue +176 -40
- package/samples/Marquee/longText.js +14 -0
- package/samples/MetroWidgetDemos/Advanced/App.vue +5 -6
- package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +3 -3
- package/samples/MetroWidgetDemos/Advanced/Buttons.vue +5 -5
- package/samples/MetroWidgetDemos/Advanced/Mixed.vue +4 -4
- package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +83 -0
- package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +89 -0
- package/samples/MetroWidgetDemos/Advanced/{Widgets.vue → widgets/Widgets.vue} +56 -11
- package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
- package/samples/MetroWidgetDemos/Item.vue +20 -2
- package/samples/MetroWidgetDemos/PerformanceTest/App.vue +4 -4
- package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +1 -1
- package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +1 -1
- package/samples/MetroWidgetDemos/PingPong/App.vue +3 -3
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +17 -2
- package/samples/MetroWidgetDemos/PingPong/AppTab.vue +3 -10
- package/samples/MetroWidgetDemos/PingPong/{Item.vue → TabItem.vue} +3 -11
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +2 -2
- package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +2 -2
- package/samples/MetroWidgetDemos/Simple/App.vue +2 -2
- package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +6 -6
- package/samples/MetroWidgetDemos/WidgetItem.vue +2 -2
- package/samples/MetroWidgetDemos/data.js +2 -1
- package/samples/NinePatchDemo/App.vue +2 -2
- package/samples/NinePatchDemo/Item.vue +1 -1
- package/samples/Preload/App.vue +17 -12
- package/samples/Preload/Item.vue +1 -1
- package/samples/QrcodeDemo/App.vue +1 -1
- package/samples/ScaleDownNeon/App.vue +107 -0
- package/samples/SoundPool/App.vue +1 -1
- package/samples/TextBox/App.vue +9 -82
- package/samples/TextBox/RenderCenter.vue +40 -16
- package/samples/TextBox/RenderLeft.vue +48 -19
- package/samples/TextBox/RenderOneLine.vue +30 -49
- package/samples/TextBox/RenderRight.vue +40 -16
- package/samples/TextShadowDemo/App.vue +11 -17
- package/samples/TextureAnimation/App2.vue +43 -15
- package/samples/TextureAnimation/assets/light.png +0 -0
- package/samples/TextureAnimation/assets/light2.png +0 -0
- package/samples/TextureSize/App.vue +3 -3
- package/samples/TouchSample/MetroWidgetHorizontal.vue +1 -1
- package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
- package/samples/TransitPage/App.vue +1 -1
- package/samples/VideoDemo/App.vue +8 -8
- package/samples/VideoDemo/components/Button.vue +1 -1
- package/samples/VisibleSensorDemo/App.vue +94 -27
- package/tsconfig.json +6 -6
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +55 -59
- package/utils/JsViewEngineWidget/JsvFocusManager.js +1 -1
- package/utils/JsViewEngineWidget/MetroWidget/Const.js +11 -0
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +226 -107
- package/utils/JsViewEngineWidget/TemplateParser.js +227 -178
- package/utils/JsViewEngineWidget/WidgetCommon.js +13 -5
- package/utils/JsViewEngineWidget/index.js +3 -2
- package/utils/JsViewPlugin/BrowserPluginLoader.js +1 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +95 -12
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +23 -2
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +1 -1
- package/utils/JsViewPlugin/JsvPlayer/index.js +22 -1
- package/utils/JsViewPlugin/JsvPlayer/version.js +4 -4
- package/utils/JsViewVueTools/JsvImpactTracer.js +113 -0
- package/utils/JsViewVueTools/JsvStyleClass.js +1 -1
- package/utils/JsViewVueTools/index.js +2 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +11 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +1 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +7 -9
- package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +1 -1
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +3 -3
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +1 -1
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +5 -5
- package/utils/JsViewVueWidget/JsvFilterView.vue +1 -1
- package/utils/JsViewVueWidget/JsvGrid.vue +3 -11
- package/utils/JsViewVueWidget/JsvInput/Cursor.vue +5 -3
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +15 -14
- package/utils/JsViewVueWidget/JsvMarquee.vue +180 -207
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +2 -2
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +35 -27
- package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -2
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +38 -42
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +1 -1
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +1 -1
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +24 -8
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +23 -3
- package/utils/JsViewVueWidget/JsvTextBox.vue +20 -86
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +2 -9
- package/utils/JsViewVueWidget/JsvTouchContainer.vue +6 -7
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +6 -6
- package/utils/JsViewVueWidget/index.js +8 -8
- package/utils/JsViewVueWidget/utils/index.js +8 -0
- package/utils/JsViewVueWidget/utils/text.js +19 -0
- package/dom/bin/jsview-browser-debug-dom.min.js +0 -1
- package/dom/bin/jsview-dom.min.js +0 -1
- package/dom/bin/jsview-forge-define.min.js +0 -1
- package/dom/browser-root-style.css +0 -21
- package/dom/jsv-browser-debug-dom.js +0 -8
- package/dom/jsv-dom.js +0 -6
- package/dom/jsv-forge-define.js +0 -6
- package/dom/target_core_revision.mjs +0 -15
- package/loader/header_script_loader.js +0 -134
- package/loader/jsview-main.js +0 -42
- package/loader/jsview.config.default.js +0 -37
- package/loader/jsview.default.config.js +0 -37
- package/loader/loader.js +0 -179
- package/loader/loader_webkit.js +0 -40
- package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +0 -17609
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js +0 -335
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-format.js +0 -446
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-types.js +0 -91
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -8038
- package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1700
- package/patches/node_modules/postcss-js/objectifier.js +0 -90
- package/patches/node_modules/vite/dist/node/chunks/dep-0fc8e132.js +0 -63147
- package/patches/node_modules/vite/dist/node/jsview.vite.config.js +0 -53
- package/patches/node_modules/vue-router/dist/vue-router.mjs +0 -3595
- package/scripts/common.js +0 -58
- package/scripts/jsview-install-local-packages.js +0 -73
- package/scripts/jsview-jsmap-serve.js +0 -105
- package/scripts/jsview-post-build.js +0 -183
- package/scripts/jsview-post-install.js +0 -102
- package/scripts/jsview-run-android.js +0 -67
- package/utils/JsViewEngineWidget/MetroPage.js +0 -2128
- package/utils/JsViewEngineWidget/SimpleWidget/ContentView.vue +0 -51
- package/utils/JsViewEngineWidget/SimpleWidget/Dispatcher.js +0 -19
- package/utils/JsViewEngineWidget/SimpleWidget/DivWrapper.vue +0 -53
- package/utils/JsViewEngineWidget/SimpleWidget/ItemView.vue +0 -142
- package/utils/JsViewEngineWidget/SimpleWidget/RootView.vue +0 -140
- package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +0 -1629
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, reactive } from "vue";
|
|
2
|
+
import { ref, shallowRef, reactive } from "vue";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
4
|
import {
|
|
5
5
|
jJsvRuntimeBridge,
|
|
@@ -9,18 +9,19 @@ import {
|
|
|
9
9
|
DECORATE_NINEPATCH_ALPHA_MIX,
|
|
10
10
|
DECORATE_BORDER_RADIUS,
|
|
11
11
|
} from "jsview";
|
|
12
|
-
import img from "./assets/
|
|
12
|
+
import img from "./assets/light.png";
|
|
13
|
+
import img2 from "./assets/light2.png";
|
|
13
14
|
import mask from "./assets/mask.png";
|
|
14
15
|
|
|
15
16
|
const getRandom = (start, end) => {
|
|
16
17
|
return Math.round(Math.random() * (end - start) + start);
|
|
17
|
-
}
|
|
18
|
+
};
|
|
18
19
|
|
|
19
20
|
const router = useRouter();
|
|
20
21
|
const width = ref(300);
|
|
21
22
|
const height = ref(200);
|
|
22
23
|
const left = ref(50);
|
|
23
|
-
const top = ref(
|
|
24
|
+
const top = ref(80);
|
|
24
25
|
const rotateAnimation =
|
|
25
26
|
"{from {transform: rotate3d(0,0,1,0);} to {transform: rotate3d(0,0,1,360deg);}}";
|
|
26
27
|
|
|
@@ -32,23 +33,20 @@ const ninePatchDecorator = {
|
|
|
32
33
|
borderOutset: 0,
|
|
33
34
|
animTime: 0.5,
|
|
34
35
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
//注意texture的尺寸需要兼顾最大的view
|
|
37
|
+
const texCoord = {
|
|
38
|
+
width: 600,
|
|
39
|
+
height: 600,
|
|
40
|
+
};
|
|
39
41
|
const onKeyDown = (ev) => {
|
|
40
42
|
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
41
43
|
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
42
44
|
router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
43
45
|
} else if (ev.keyCode == 13) {
|
|
44
46
|
left.value = getRandom(50, 400);
|
|
45
|
-
top.value = getRandom(
|
|
47
|
+
top.value = getRandom(80, 200);
|
|
46
48
|
width.value = getRandom(100, 300);
|
|
47
49
|
height.value = getRandom(100, 300);
|
|
48
|
-
texCoord.value = {
|
|
49
|
-
width: Math.max(width.value, height.value) * 1.414,
|
|
50
|
-
height: Math.max(width.value, height.value) * 1.414,
|
|
51
|
-
}
|
|
52
50
|
}
|
|
53
51
|
return true;
|
|
54
52
|
};
|
|
@@ -60,12 +58,27 @@ const onKeyDown = (ev) => {
|
|
|
60
58
|
:style="{
|
|
61
59
|
width: 1280,
|
|
62
60
|
height: 720,
|
|
63
|
-
backgroundImage:
|
|
61
|
+
backgroundImage:
|
|
62
|
+
'https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg',
|
|
64
63
|
}"
|
|
65
64
|
>
|
|
65
|
+
<div
|
|
66
|
+
:style="{
|
|
67
|
+
textAlign: 'center',
|
|
68
|
+
fontSize: '30px',
|
|
69
|
+
lineHeight: '50px',
|
|
70
|
+
color: '#ffffff',
|
|
71
|
+
left: 140,
|
|
72
|
+
top: 20,
|
|
73
|
+
width: 1000,
|
|
74
|
+
height: 50,
|
|
75
|
+
backgroundColor: 'rgba(27,38,151,0.8)',
|
|
76
|
+
}"
|
|
77
|
+
>
|
|
78
|
+
.9型的旋转焦点框,OK键进行随机位置+尺寸变换
|
|
79
|
+
</div>
|
|
66
80
|
<div>
|
|
67
81
|
<jsv-texture-anim
|
|
68
|
-
ref="textureAnim1"
|
|
69
82
|
:src="img"
|
|
70
83
|
:left="left"
|
|
71
84
|
:top="top"
|
|
@@ -79,5 +92,20 @@ const onKeyDown = (ev) => {
|
|
|
79
92
|
:decorate="ninePatchDecorator"
|
|
80
93
|
></jsv-texture-anim>
|
|
81
94
|
</div>
|
|
95
|
+
<div>
|
|
96
|
+
<jsv-texture-anim
|
|
97
|
+
:src="img2"
|
|
98
|
+
:left="left + 500"
|
|
99
|
+
:top="top"
|
|
100
|
+
:width="width"
|
|
101
|
+
:height="height"
|
|
102
|
+
:texCoord="texCoord"
|
|
103
|
+
:animation="rotateAnimation"
|
|
104
|
+
:duration="2000"
|
|
105
|
+
:repeat="-1"
|
|
106
|
+
:autoStart="true"
|
|
107
|
+
:decorate="ninePatchDecorator"
|
|
108
|
+
></jsv-texture-anim>
|
|
109
|
+
</div>
|
|
82
110
|
</jsv-focus-block>
|
|
83
111
|
</template>
|
|
Binary file
|
|
Binary file
|
|
@@ -32,7 +32,7 @@ const onKeyDown = (ev) => {
|
|
|
32
32
|
</div>
|
|
33
33
|
<div class="leftFont top250">
|
|
34
34
|
{{
|
|
35
|
-
`指定尺寸加载\n
|
|
35
|
+
`指定尺寸加载\n内存占用由给定尺寸决定,图片质量基本没变,但更省内存`
|
|
36
36
|
}}
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
@@ -67,9 +67,9 @@ const onKeyDown = (ev) => {
|
|
|
67
67
|
<img alt="" class="graphSize top0" :src="pngDemo" />
|
|
68
68
|
<img
|
|
69
69
|
alt=""
|
|
70
|
+
:src="pngDemo"
|
|
70
71
|
class="graphSize top250"
|
|
71
72
|
jsvImgScaledownTex
|
|
72
|
-
:src="pngDemo"
|
|
73
73
|
/>
|
|
74
74
|
<div class="underFont">
|
|
75
75
|
{{ `png有透明图片\n指定尺寸有明显锯齿` }}
|
|
@@ -80,9 +80,9 @@ const onKeyDown = (ev) => {
|
|
|
80
80
|
<img alt="" class="graphSize top0" :src="pngNoAlphaDemo" />
|
|
81
81
|
<img
|
|
82
82
|
alt=""
|
|
83
|
+
:src="pngNoAlphaDemo"
|
|
83
84
|
class="graphSize top250"
|
|
84
85
|
jsvImgScaledownTex
|
|
85
|
-
:src="pngNoAlphaDemo"
|
|
86
86
|
/>
|
|
87
87
|
<div class="underFont">
|
|
88
88
|
{{ `png无透明图片` }}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import DemoApp from "../DemoHomepage/App.vue";
|
|
3
3
|
import ActivityApp from "../MetroWidgetDemos/PerformanceTest/App.vue"; // TODO
|
|
4
4
|
import { jJsvRuntimeBridge } from "jsview";
|
|
5
|
-
import { ref, onMounted } from "vue";
|
|
5
|
+
import { ref, shallowRef, onMounted } from "vue";
|
|
6
6
|
|
|
7
7
|
const getShowMode = () => {
|
|
8
8
|
let showMode = 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { provide, reactive, ref, watch } from "vue";
|
|
2
|
+
import { provide, reactive, ref, shallowRef, watch } from "vue";
|
|
3
3
|
import Controllor from "./components/Controllor.vue";
|
|
4
4
|
import VideoFrame from "./components/VideoFrame.vue";
|
|
5
5
|
|
|
@@ -18,20 +18,20 @@ const Caption = {
|
|
|
18
18
|
"2.支持ObjectFit调整\n",
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
let caption =
|
|
22
|
-
let useTexture =
|
|
21
|
+
let caption = shallowRef(null);
|
|
22
|
+
let useTexture = shallowRef(null);
|
|
23
23
|
let videoTime = reactive({
|
|
24
24
|
currentTime: 0,
|
|
25
25
|
duration: 0,
|
|
26
26
|
});
|
|
27
|
-
let objectFitTitle =
|
|
27
|
+
let objectFitTitle = shallowRef(null);
|
|
28
28
|
let playStatus = ref("");
|
|
29
29
|
provide("useTexture", useTexture);
|
|
30
|
-
provide("objectFit",
|
|
30
|
+
provide("objectFit", shallowRef(null));
|
|
31
31
|
provide("videoRect", ref({}));
|
|
32
|
-
provide("playVideo",
|
|
33
|
-
provide("seekVideo",
|
|
34
|
-
provide("enableAnimation",
|
|
32
|
+
provide("playVideo", shallowRef(null));
|
|
33
|
+
provide("seekVideo", shallowRef(null));
|
|
34
|
+
provide("enableAnimation", shallowRef(null));
|
|
35
35
|
provide("videoTime", videoTime);
|
|
36
36
|
provide("objectFitTitle", objectFitTitle);
|
|
37
37
|
provide("playStatus", playStatus);
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { reactive, onMounted, ref } from "vue";
|
|
2
|
+
import { watch, reactive, onMounted, ref, shallowRef } from "vue";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
4
|
import { jJsvRuntimeBridge, JsvVisibleSensor } from "jsview";
|
|
5
5
|
|
|
6
6
|
const BOX_WIDTH = 150;
|
|
7
7
|
const BOX_HEIGHT = 150;
|
|
8
|
-
const BOX_COLOR = "
|
|
8
|
+
const BOX_COLOR = "rgba(0,255,255,0.6)";
|
|
9
|
+
const VISIBLE_RANGE = 0.25;
|
|
9
10
|
|
|
10
11
|
const router = useRouter();
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
horizon: 1.0,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
let left_change = reactive({ left: 0 });
|
|
18
|
-
let top_change = reactive({ top: 0 });
|
|
19
|
-
|
|
20
|
-
const containerRef = ref(null);
|
|
21
|
-
let case_config = ref(null);
|
|
13
|
+
const containerRef = shallowRef(null);
|
|
14
|
+
let case_config = shallowRef(null);
|
|
22
15
|
let status_text = reactive({
|
|
23
16
|
oldH: "false",
|
|
24
17
|
newH: "false",
|
|
@@ -26,12 +19,24 @@ let status_text = reactive({
|
|
|
26
19
|
newV: "false",
|
|
27
20
|
});
|
|
28
21
|
|
|
29
|
-
|
|
22
|
+
let test_case_type = ref(0);
|
|
23
|
+
|
|
24
|
+
window.LudlTestCase = test_case_type;
|
|
25
|
+
|
|
26
|
+
case_config.value = getTestCase(test_case_type.value);
|
|
27
|
+
|
|
28
|
+
watch(test_case_type, () => {
|
|
29
|
+
case_config.value = getTestCase(test_case_type.value);
|
|
30
|
+
});
|
|
30
31
|
|
|
31
32
|
onMounted(() => {
|
|
32
33
|
jJsvRuntimeBridge.notifyPageLoaded();
|
|
33
34
|
});
|
|
34
35
|
|
|
36
|
+
// const onAnimDone = () => {
|
|
37
|
+
// test_case_type.value = (test_case_type.value + 1) % 2;
|
|
38
|
+
// };
|
|
39
|
+
|
|
35
40
|
// 内部接口
|
|
36
41
|
const onBeVisible = (old_h, new_h, old_v, new_v) => {
|
|
37
42
|
status_text.oldH = old_h ? "true" : "false";
|
|
@@ -46,6 +51,9 @@ const onKeyDown = (ev) => {
|
|
|
46
51
|
router?.go(-1); // 有router时,回退
|
|
47
52
|
return true;
|
|
48
53
|
}
|
|
54
|
+
if (ev.keyCode == 13) {
|
|
55
|
+
test_case_type.value = (test_case_type.value + 1) % 2;
|
|
56
|
+
}
|
|
49
57
|
return false;
|
|
50
58
|
};
|
|
51
59
|
|
|
@@ -60,17 +68,17 @@ function getTestCase(test_index) {
|
|
|
60
68
|
switch (test_index) {
|
|
61
69
|
case 0: {
|
|
62
70
|
// 上到下
|
|
63
|
-
test_config.animation = "visibleSensor_upDown
|
|
71
|
+
test_config.animation = "visibleSensor_upDown 8s infinite linear";
|
|
64
72
|
test_config.text = "从上到下";
|
|
65
73
|
test_config.horizon = 1.0;
|
|
66
|
-
test_config.vertical =
|
|
74
|
+
test_config.vertical = VISIBLE_RANGE;
|
|
67
75
|
break;
|
|
68
76
|
}
|
|
69
77
|
case 1: {
|
|
70
78
|
// 左到右
|
|
71
|
-
test_config.animation = "visibleSensor_leftRight
|
|
79
|
+
test_config.animation = "visibleSensor_leftRight 8s infinite linear";
|
|
72
80
|
test_config.text = "从左到右";
|
|
73
|
-
test_config.horizon =
|
|
81
|
+
test_config.horizon = VISIBLE_RANGE;
|
|
74
82
|
test_config.vertical = 1.0;
|
|
75
83
|
break;
|
|
76
84
|
}
|
|
@@ -87,7 +95,7 @@ function getTestCase(test_index) {
|
|
|
87
95
|
:style="{
|
|
88
96
|
left: 10,
|
|
89
97
|
top: 10,
|
|
90
|
-
height:
|
|
98
|
+
height: 120,
|
|
91
99
|
width: 900,
|
|
92
100
|
fontColor: '#000000',
|
|
93
101
|
fontSize: 15,
|
|
@@ -95,7 +103,8 @@ function getTestCase(test_index) {
|
|
|
95
103
|
}"
|
|
96
104
|
>
|
|
97
105
|
{{
|
|
98
|
-
|
|
106
|
+
`按OK键切换方向
|
|
107
|
+
new horizon: ${status_text.newH}
|
|
99
108
|
new vertical: ${status_text.newV}
|
|
100
109
|
-------
|
|
101
110
|
old horizon: ${status_text.oldH}
|
|
@@ -106,12 +115,34 @@ old vertical: ${status_text.oldV}`
|
|
|
106
115
|
ref="containerRef"
|
|
107
116
|
:style="{
|
|
108
117
|
left: 240,
|
|
109
|
-
top:
|
|
110
|
-
width:
|
|
111
|
-
height:
|
|
118
|
+
top: 180,
|
|
119
|
+
width: 300,
|
|
120
|
+
height: 300,
|
|
112
121
|
backgroundColor: '#00F0F0',
|
|
113
122
|
}"
|
|
114
123
|
>
|
|
124
|
+
<div
|
|
125
|
+
:style="{
|
|
126
|
+
left: 50,
|
|
127
|
+
top: 50,
|
|
128
|
+
width: 200,
|
|
129
|
+
height: 200,
|
|
130
|
+
backgroundColor: '#00AAAA',
|
|
131
|
+
zIndex: test_case_type == 0 ? -22 : 0,
|
|
132
|
+
}"
|
|
133
|
+
/>
|
|
134
|
+
|
|
135
|
+
<div
|
|
136
|
+
:style="{
|
|
137
|
+
left: 80,
|
|
138
|
+
top: 30,
|
|
139
|
+
width: 140,
|
|
140
|
+
height: 240,
|
|
141
|
+
backgroundColor: '#0000AA',
|
|
142
|
+
zIndex: test_case_type == 0 ? -33 : 0,
|
|
143
|
+
}"
|
|
144
|
+
/>
|
|
145
|
+
|
|
115
146
|
<div
|
|
116
147
|
:style="{
|
|
117
148
|
left: 0,
|
|
@@ -128,6 +159,40 @@ old vertical: ${status_text.oldV}`
|
|
|
128
159
|
:container="containerRef"
|
|
129
160
|
:callback="onBeVisible"
|
|
130
161
|
>
|
|
162
|
+
<div v-if="test_case_type == 0">
|
|
163
|
+
<div
|
|
164
|
+
:style="{
|
|
165
|
+
width: BOX_WIDTH,
|
|
166
|
+
height: BOX_HEIGHT * VISIBLE_RANGE,
|
|
167
|
+
backgroundColor: '#FF0000',
|
|
168
|
+
}"
|
|
169
|
+
/>
|
|
170
|
+
<div
|
|
171
|
+
:style="{
|
|
172
|
+
top: BOX_HEIGHT * (1 - VISIBLE_RANGE),
|
|
173
|
+
width: BOX_WIDTH,
|
|
174
|
+
height: BOX_HEIGHT * VISIBLE_RANGE,
|
|
175
|
+
backgroundColor: '#FF0000',
|
|
176
|
+
}"
|
|
177
|
+
/>
|
|
178
|
+
</div>
|
|
179
|
+
<div v-else>
|
|
180
|
+
<div
|
|
181
|
+
:style="{
|
|
182
|
+
width: BOX_WIDTH * VISIBLE_RANGE,
|
|
183
|
+
height: BOX_HEIGHT,
|
|
184
|
+
backgroundColor: '#FF0000',
|
|
185
|
+
}"
|
|
186
|
+
/>
|
|
187
|
+
<div
|
|
188
|
+
:style="{
|
|
189
|
+
left: BOX_WIDTH * (1 - VISIBLE_RANGE),
|
|
190
|
+
width: BOX_WIDTH * VISIBLE_RANGE,
|
|
191
|
+
height: BOX_HEIGHT,
|
|
192
|
+
backgroundColor: '#FF0000',
|
|
193
|
+
}"
|
|
194
|
+
/>
|
|
195
|
+
</div>
|
|
131
196
|
<div
|
|
132
197
|
:style="{
|
|
133
198
|
width: BOX_WIDTH,
|
|
@@ -137,7 +202,9 @@ old vertical: ${status_text.oldV}`
|
|
|
137
202
|
lineHeight: 30,
|
|
138
203
|
}"
|
|
139
204
|
>
|
|
140
|
-
{{
|
|
205
|
+
{{
|
|
206
|
+
`${case_config.text}\nH:${status_text.newH}\nV:${status_text.newV}`
|
|
207
|
+
}}
|
|
141
208
|
</div>
|
|
142
209
|
</JsvVisibleSensor>
|
|
143
210
|
</div>
|
|
@@ -149,19 +216,19 @@ old vertical: ${status_text.oldV}`
|
|
|
149
216
|
<style scoped>
|
|
150
217
|
@keyframes visibleSensor_upDown {
|
|
151
218
|
from {
|
|
152
|
-
transform: translate3d(
|
|
219
|
+
transform: translate3d(75px, -180px, 0);
|
|
153
220
|
}
|
|
154
221
|
to {
|
|
155
|
-
transform: translate3d(
|
|
222
|
+
transform: translate3d(75px, 330px, 0);
|
|
156
223
|
}
|
|
157
224
|
}
|
|
158
225
|
|
|
159
226
|
@keyframes visibleSensor_leftRight {
|
|
160
227
|
from {
|
|
161
|
-
transform: translate3d(-
|
|
228
|
+
transform: translate3d(-180px, 75px, 0);
|
|
162
229
|
}
|
|
163
230
|
to {
|
|
164
|
-
transform: translate3d(
|
|
231
|
+
transform: translate3d(330px, 75px, 0);
|
|
165
232
|
}
|
|
166
233
|
}
|
|
167
234
|
</style>
|
package/tsconfig.json
CHANGED
|
@@ -13,18 +13,18 @@
|
|
|
13
13
|
"allowSyntheticDefaultImports": true,
|
|
14
14
|
"sourceMap": true,
|
|
15
15
|
"baseUrl": ".",
|
|
16
|
-
"types": [
|
|
17
|
-
"webpack-env"
|
|
18
|
-
],
|
|
19
16
|
"paths": {
|
|
20
|
-
"@/*": [
|
|
21
|
-
"src/*"
|
|
22
|
-
],
|
|
23
17
|
"jsview/*": [
|
|
24
18
|
"./*"
|
|
25
19
|
],
|
|
26
20
|
"jsview": [
|
|
27
21
|
"./index.js"
|
|
22
|
+
],
|
|
23
|
+
"jsview-vue/*": [
|
|
24
|
+
"./*"
|
|
25
|
+
],
|
|
26
|
+
"jsview-vue": [
|
|
27
|
+
"./index.js"
|
|
28
28
|
]
|
|
29
29
|
},
|
|
30
30
|
"lib": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
<script setup>
|
|
32
32
|
/* eslint-disable */
|
|
33
|
-
import { onMounted, onBeforeUnmount, ref, toRaw } from "vue";
|
|
33
|
+
import { onMounted, onBeforeUnmount, ref, shallowRef, toRaw } from "vue";
|
|
34
34
|
const props = defineProps({
|
|
35
35
|
name: String,
|
|
36
36
|
namespace: String,
|
|
@@ -64,45 +64,47 @@ if (props.name && props.name.indexOf(".") >= 0) {
|
|
|
64
64
|
'". name must not contains "."'
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
|
+
let actionCallback = {};
|
|
68
|
+
let fDivRef = shallowRef(null);
|
|
67
69
|
|
|
68
70
|
//methods
|
|
69
|
-
|
|
70
|
-
return toRaw(
|
|
71
|
+
const getName = () => {
|
|
72
|
+
return toRaw(fDivRef.value)?.FocusNodeRef.getName();
|
|
71
73
|
};
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
let focusNode = toRaw(
|
|
75
|
+
const getNamespace = () => {
|
|
76
|
+
let focusNode = toRaw(fDivRef.value)?.FocusNodeRef;
|
|
75
77
|
if (focusNode?.AsHub) {
|
|
76
78
|
// hub的getHub返回的是自己
|
|
77
|
-
focusNode = toRaw(
|
|
79
|
+
focusNode = toRaw(fDivRef.value)?.FocusNodeRef.GetParentPage();
|
|
78
80
|
}
|
|
79
81
|
const namespace = focusNode.getName();
|
|
80
82
|
return namespace !== ".__AppRoot__" ? namespace : "";
|
|
81
83
|
};
|
|
82
84
|
|
|
83
|
-
|
|
84
|
-
const focusNode = toRaw(
|
|
85
|
+
const findBlockByName = (name) => {
|
|
86
|
+
const focusNode = toRaw(fDivRef.value)?.FocusNodeRef.getNodeByName(name);
|
|
85
87
|
return focusNode?.jsvVueComponent;
|
|
86
88
|
};
|
|
87
89
|
|
|
88
|
-
|
|
89
|
-
toRaw(
|
|
90
|
+
const requestFocus = (passToChild) => {
|
|
91
|
+
toRaw(fDivRef.value)?.FocusNodeRef.requestFocus(passToChild);
|
|
90
92
|
};
|
|
91
93
|
|
|
92
|
-
|
|
93
|
-
toRaw(
|
|
94
|
+
const returnFocusToParent = () => {
|
|
95
|
+
toRaw(fDivRef.value)?.FocusNodeRef.ReturnFocusToParent();
|
|
94
96
|
};
|
|
95
97
|
|
|
96
|
-
|
|
97
|
-
toRaw(
|
|
98
|
+
const bubbleCustomerEvent = (ev) => {
|
|
99
|
+
toRaw(fDivRef.value)?.FocusNodeRef.bubbleCustomerEvent(ev);
|
|
98
100
|
};
|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
toRaw(
|
|
102
|
+
const debugPrintFocusChain = () => {
|
|
103
|
+
toRaw(fDivRef.value)?.FocusNodeRef.printFocusNodeList();
|
|
102
104
|
};
|
|
103
105
|
|
|
104
|
-
|
|
105
|
-
toRaw(
|
|
106
|
+
const debugPrintLastFocus = () => {
|
|
107
|
+
toRaw(fDivRef.value)?.FocusNodeRef.printGlobalLastFocus();
|
|
106
108
|
};
|
|
107
109
|
|
|
108
110
|
const exportObject = {
|
|
@@ -115,56 +117,55 @@ const exportObject = {
|
|
|
115
117
|
debugPrintFocusChain,
|
|
116
118
|
debugPrintLastFocus,
|
|
117
119
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const focusNode = toRaw(_fDivRef.value)?.FocusNodeRef;
|
|
120
|
+
const _mountToFocusSystem = () => {
|
|
121
|
+
const focusNode = toRaw(fDivRef.value)?.FocusNodeRef;
|
|
121
122
|
|
|
122
123
|
// 保存self,find用, 通过exportObject代表自己的instance
|
|
123
124
|
focusNode.jsvVueComponent = exportObject;
|
|
124
125
|
|
|
125
126
|
// 注册回调函数
|
|
126
|
-
|
|
127
|
+
actionCallback.onDispatchKeyDown =
|
|
127
128
|
props.onDispatchKeyDown || props.onAction?.onDispatchKeyDown;
|
|
128
|
-
if (
|
|
129
|
+
if (actionCallback.onDispatchKeyDown) {
|
|
129
130
|
focusNode.setDispatchKeyDown(_onDispatchKeyDown);
|
|
130
131
|
}
|
|
131
|
-
|
|
132
|
+
actionCallback.onDispatchKeyUp =
|
|
132
133
|
props.onDispatchKeyUp || props.onAction?.onDispatchKeyUp;
|
|
133
|
-
if (
|
|
134
|
+
if (actionCallback.onDispatchKeyUp) {
|
|
134
135
|
focusNode.setDispatchKeyUp(_onDispatchKeyUp);
|
|
135
136
|
}
|
|
136
|
-
|
|
137
|
-
if (
|
|
137
|
+
actionCallback.onKeyDown = props.onKeyDown || props.onAction?.onKeyDown;
|
|
138
|
+
if (actionCallback.onKeyDown) {
|
|
138
139
|
focusNode.setOnKeyDown(_onKeyDown);
|
|
139
140
|
}
|
|
140
|
-
|
|
141
|
-
if (
|
|
141
|
+
actionCallback.onKeyUp = props.onKeyUp || props.onAction?.onKeyUp;
|
|
142
|
+
if (actionCallback.onKeyUp) {
|
|
142
143
|
focusNode.setOnKeyUp(_onKeyUp);
|
|
143
144
|
}
|
|
144
|
-
|
|
145
|
-
if (
|
|
145
|
+
actionCallback.onFocus = props.onFocus || props.onAction?.onFocus;
|
|
146
|
+
if (actionCallback.onFocus) {
|
|
146
147
|
focusNode.setOnFocus(_onFocus);
|
|
147
148
|
}
|
|
148
|
-
|
|
149
|
-
if (
|
|
149
|
+
actionCallback.onBlur = props.onBlur || props.onAction?.onBlur;
|
|
150
|
+
if (actionCallback.onBlur) {
|
|
150
151
|
focusNode.setOnBlur(_onBlur);
|
|
151
152
|
}
|
|
152
153
|
|
|
153
|
-
|
|
154
|
+
actionCallback.onCustomerEvent =
|
|
154
155
|
props.onCustomerEvent || props.onAction?.onCustomerEvent;
|
|
155
|
-
if (
|
|
156
|
+
if (actionCallback.onCustomerEvent) {
|
|
156
157
|
focusNode.setOnCustomerEvent(_onCustomerEvent);
|
|
157
158
|
}
|
|
158
159
|
// 建立父子关系链
|
|
159
|
-
let self = toRaw(
|
|
160
|
-
let parent = self.
|
|
160
|
+
let self = toRaw(fDivRef.value);
|
|
161
|
+
let parent = self.parentNode;
|
|
161
162
|
while (parent) {
|
|
162
163
|
if (self.FocusNodeRef.GetParentPage()) {
|
|
163
164
|
break;
|
|
164
165
|
}
|
|
165
166
|
|
|
166
167
|
if (parent.tagName !== "FDIV") {
|
|
167
|
-
parent = parent.
|
|
168
|
+
parent = parent.parentNode;
|
|
168
169
|
continue;
|
|
169
170
|
}
|
|
170
171
|
|
|
@@ -173,35 +174,32 @@ function _mountToFocusSystem() {
|
|
|
173
174
|
}
|
|
174
175
|
};
|
|
175
176
|
|
|
176
|
-
|
|
177
|
+
const _onDispatchKeyDown = (ev) => {
|
|
177
178
|
ev.ownerNode = exportObject;
|
|
178
|
-
return
|
|
179
|
+
return actionCallback?.onDispatchKeyDown(ev) || false;
|
|
179
180
|
};
|
|
180
|
-
|
|
181
|
+
const _onDispatchKeyUp = (ev) => {
|
|
181
182
|
ev.ownerNode = exportObject;
|
|
182
|
-
return
|
|
183
|
+
return actionCallback?.onDispatchKeyUp(ev) || false;
|
|
183
184
|
};
|
|
184
|
-
|
|
185
|
+
const _onKeyDown = (ev) => {
|
|
185
186
|
ev.ownerNode = exportObject;
|
|
186
|
-
return
|
|
187
|
+
return actionCallback?.onKeyDown(ev) || false;
|
|
187
188
|
};
|
|
188
|
-
|
|
189
|
+
const _onKeyUp = (ev) => {
|
|
189
190
|
ev.ownerNode = exportObject;
|
|
190
|
-
return
|
|
191
|
+
return actionCallback?.onKeyUp(ev) || false;
|
|
191
192
|
};
|
|
192
|
-
|
|
193
|
-
|
|
193
|
+
const _onFocus = () => {
|
|
194
|
+
actionCallback?.onFocus(exportObject);
|
|
194
195
|
};
|
|
195
|
-
|
|
196
|
-
|
|
196
|
+
const _onBlur = () => {
|
|
197
|
+
actionCallback?.onBlur(exportObject);
|
|
197
198
|
};
|
|
198
|
-
|
|
199
|
-
return
|
|
199
|
+
const _onCustomerEvent = (ev) => {
|
|
200
|
+
return actionCallback?.onCustomerEvent(ev) || false;
|
|
200
201
|
};
|
|
201
202
|
|
|
202
|
-
let _actionCallback = {};
|
|
203
|
-
let _fDivRef = ref(null);
|
|
204
|
-
|
|
205
203
|
onMounted(() => {
|
|
206
204
|
_mountToFocusSystem();
|
|
207
205
|
|
|
@@ -211,7 +209,7 @@ onMounted(() => {
|
|
|
211
209
|
});
|
|
212
210
|
|
|
213
211
|
onBeforeUnmount(() => {
|
|
214
|
-
const focusNode = toRaw(
|
|
212
|
+
const focusNode = toRaw(fDivRef.value)?.FocusNodeRef;
|
|
215
213
|
focusNode?.onUnMount();
|
|
216
214
|
if (focusNode?.jsvVueComponent) {
|
|
217
215
|
focusNode.jsvVueComponent = undefined;
|
|
@@ -222,9 +220,7 @@ defineExpose(exportObject);
|
|
|
222
220
|
</script>
|
|
223
221
|
|
|
224
222
|
<template>
|
|
225
|
-
<
|
|
226
|
-
<fdiv ref="_fDivRef" :fname="name" :new-namespace="namespace">
|
|
223
|
+
<fdiv ref="fDivRef" :fname="name" :new-namespace="namespace">
|
|
227
224
|
<slot></slot>
|
|
228
225
|
</fdiv>
|
|
229
|
-
</div>
|
|
230
226
|
</template>
|