@shijiu/jsview-vue 1.9.648 → 1.9.719

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.
Files changed (157) hide show
  1. package/package.json +7 -18
  2. package/samples/AnimPicture/App.vue +5 -5
  3. package/samples/Basic/components/div/DivLayout.vue +1 -1
  4. package/samples/Basic/components/text/TextOverflow.vue +10 -5
  5. package/samples/BasicFocusControl/components/BaseBlock.vue +2 -2
  6. package/samples/Collision/App.vue +452 -0
  7. package/samples/DemoHomepage/components/BodyFrame.vue +2 -0
  8. package/samples/DemoHomepage/router.js +21 -1
  9. package/samples/DemoHomepage/views/Homepage.vue +3 -7
  10. package/samples/FilterDemo/App.vue +1 -1
  11. package/samples/FlipCard/App.vue +2 -2
  12. package/samples/FlipCard/FlipCard.vue +2 -2
  13. package/samples/GridDemo/App.vue +3 -3
  14. package/samples/GridDemo/ButtonBlock.vue +2 -2
  15. package/samples/GridDemo/FocusItem.vue +2 -2
  16. package/samples/GridDemo/Item.vue +1 -1
  17. package/samples/HashHistory/App.vue +10 -3
  18. package/samples/HashHistory/components/Item.vue +1 -1
  19. package/samples/ImpactStop/App.vue +435 -0
  20. package/samples/Input/App.vue +8 -17
  21. package/samples/Input/InputPanel.vue +19 -12
  22. package/samples/LongImage/Button.vue +1 -1
  23. package/samples/LongImage/ButtonItem.vue +1 -1
  24. package/samples/LongImage/LongImageScroll.vue +2 -2
  25. package/samples/LongText/App.vue +1 -1
  26. package/samples/LongText/Button.vue +1 -1
  27. package/samples/LongText/ButtonItem.vue +1 -1
  28. package/samples/LongText/LongTextScroll.vue +3 -3
  29. package/samples/Marquee/App.vue +176 -40
  30. package/samples/Marquee/longText.js +14 -0
  31. package/samples/MetroWidgetDemos/Advanced/App.vue +5 -6
  32. package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +3 -3
  33. package/samples/MetroWidgetDemos/Advanced/Buttons.vue +5 -5
  34. package/samples/MetroWidgetDemos/Advanced/Mixed.vue +4 -4
  35. package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +83 -0
  36. package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +89 -0
  37. package/samples/MetroWidgetDemos/Advanced/{Widgets.vue → widgets/Widgets.vue} +56 -11
  38. package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
  39. package/samples/MetroWidgetDemos/Item.vue +20 -2
  40. package/samples/MetroWidgetDemos/PerformanceTest/App.vue +4 -4
  41. package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +1 -1
  42. package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +1 -1
  43. package/samples/MetroWidgetDemos/PingPong/App.vue +3 -3
  44. package/samples/MetroWidgetDemos/PingPong/AppPage.vue +17 -2
  45. package/samples/MetroWidgetDemos/PingPong/AppTab.vue +3 -10
  46. package/samples/MetroWidgetDemos/PingPong/{Item.vue → TabItem.vue} +3 -11
  47. package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +2 -2
  48. package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +2 -2
  49. package/samples/MetroWidgetDemos/Simple/App.vue +2 -2
  50. package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +6 -6
  51. package/samples/MetroWidgetDemos/WidgetItem.vue +2 -2
  52. package/samples/MetroWidgetDemos/data.js +2 -1
  53. package/samples/NinePatchDemo/App.vue +2 -2
  54. package/samples/NinePatchDemo/Item.vue +1 -1
  55. package/samples/Preload/App.vue +17 -12
  56. package/samples/Preload/Item.vue +1 -1
  57. package/samples/QrcodeDemo/App.vue +1 -1
  58. package/samples/ScaleDownNeon/App.vue +107 -0
  59. package/samples/SoundPool/App.vue +1 -1
  60. package/samples/TextBox/App.vue +9 -82
  61. package/samples/TextBox/RenderCenter.vue +40 -16
  62. package/samples/TextBox/RenderLeft.vue +48 -19
  63. package/samples/TextBox/RenderOneLine.vue +30 -49
  64. package/samples/TextBox/RenderRight.vue +40 -16
  65. package/samples/TextShadowDemo/App.vue +11 -17
  66. package/samples/TextureAnimation/App2.vue +43 -15
  67. package/samples/TextureAnimation/assets/light.png +0 -0
  68. package/samples/TextureAnimation/assets/light2.png +0 -0
  69. package/samples/TextureSize/App.vue +3 -3
  70. package/samples/TouchSample/MetroWidgetHorizontal.vue +1 -1
  71. package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
  72. package/samples/TransitPage/App.vue +1 -1
  73. package/samples/VideoDemo/App.vue +8 -8
  74. package/samples/VideoDemo/components/Button.vue +1 -1
  75. package/samples/VisibleSensorDemo/App.vue +94 -27
  76. package/tsconfig.json +6 -6
  77. package/utils/JsViewEngineWidget/JsvFocusBlock.vue +55 -59
  78. package/utils/JsViewEngineWidget/JsvFocusManager.js +1 -1
  79. package/utils/JsViewEngineWidget/MetroWidget/Const.js +11 -0
  80. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +226 -107
  81. package/utils/JsViewEngineWidget/TemplateParser.js +227 -178
  82. package/utils/JsViewEngineWidget/WidgetCommon.js +13 -5
  83. package/utils/JsViewEngineWidget/index.js +3 -2
  84. package/utils/JsViewPlugin/BrowserPluginLoader.js +1 -1
  85. package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +95 -12
  86. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +23 -2
  87. package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +1 -1
  88. package/utils/JsViewPlugin/JsvPlayer/index.js +22 -1
  89. package/utils/JsViewPlugin/JsvPlayer/version.js +4 -4
  90. package/utils/JsViewVueTools/JsvImpactTracer.js +113 -0
  91. package/utils/JsViewVueTools/JsvStyleClass.js +1 -1
  92. package/utils/JsViewVueTools/index.js +2 -1
  93. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +11 -1
  94. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +1 -1
  95. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +7 -9
  96. package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +1 -1
  97. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +3 -3
  98. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +1 -1
  99. package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +5 -5
  100. package/utils/JsViewVueWidget/JsvFilterView.vue +1 -1
  101. package/utils/JsViewVueWidget/JsvGrid.vue +3 -11
  102. package/utils/JsViewVueWidget/JsvInput/Cursor.vue +5 -3
  103. package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +15 -14
  104. package/utils/JsViewVueWidget/JsvMarquee.vue +180 -207
  105. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +2 -2
  106. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +35 -27
  107. package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -2
  108. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +38 -42
  109. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +1 -1
  110. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +1 -1
  111. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +24 -8
  112. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +23 -3
  113. package/utils/JsViewVueWidget/JsvTextBox.vue +20 -86
  114. package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +2 -9
  115. package/utils/JsViewVueWidget/JsvTouchContainer.vue +6 -7
  116. package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
  117. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +6 -6
  118. package/utils/JsViewVueWidget/index.js +8 -8
  119. package/utils/JsViewVueWidget/utils/index.js +8 -0
  120. package/utils/JsViewVueWidget/utils/text.js +19 -0
  121. package/dom/bin/jsview-browser-debug-dom.min.js +0 -1
  122. package/dom/bin/jsview-dom.min.js +0 -1
  123. package/dom/bin/jsview-forge-define.min.js +0 -1
  124. package/dom/browser-root-style.css +0 -21
  125. package/dom/jsv-browser-debug-dom.js +0 -8
  126. package/dom/jsv-dom.js +0 -6
  127. package/dom/jsv-forge-define.js +0 -6
  128. package/dom/target_core_revision.mjs +0 -15
  129. package/loader/header_script_loader.js +0 -134
  130. package/loader/jsview-main.js +0 -42
  131. package/loader/jsview.config.default.js +0 -37
  132. package/loader/jsview.default.config.js +0 -37
  133. package/loader/loader.js +0 -179
  134. package/loader/loader_webkit.js +0 -40
  135. package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +0 -17609
  136. package/patches/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js +0 -335
  137. package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-format.js +0 -446
  138. package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-types.js +0 -91
  139. package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -8038
  140. package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1700
  141. package/patches/node_modules/postcss-js/objectifier.js +0 -90
  142. package/patches/node_modules/vite/dist/node/chunks/dep-0fc8e132.js +0 -63147
  143. package/patches/node_modules/vite/dist/node/jsview.vite.config.js +0 -50
  144. package/patches/node_modules/vue-router/dist/vue-router.mjs +0 -3595
  145. package/scripts/common.js +0 -58
  146. package/scripts/jsview-install-local-packages.js +0 -73
  147. package/scripts/jsview-jsmap-serve.js +0 -105
  148. package/scripts/jsview-post-build.js +0 -183
  149. package/scripts/jsview-post-install.js +0 -102
  150. package/scripts/jsview-run-android.js +0 -67
  151. package/utils/JsViewEngineWidget/MetroPage.js +0 -2128
  152. package/utils/JsViewEngineWidget/SimpleWidget/ContentView.vue +0 -51
  153. package/utils/JsViewEngineWidget/SimpleWidget/Dispatcher.js +0 -19
  154. package/utils/JsViewEngineWidget/SimpleWidget/DivWrapper.vue +0 -53
  155. package/utils/JsViewEngineWidget/SimpleWidget/ItemView.vue +0 -142
  156. package/utils/JsViewEngineWidget/SimpleWidget/RootView.vue +0 -140
  157. 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/swipLight.png";
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(50);
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
- const texCoord = ref({
36
- width: 400,
37
- height: 400,
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(50, 200);
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: 'https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg',
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>
@@ -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无透明图片` }}
@@ -10,7 +10,7 @@ import {
10
10
  import Item from "./Item.vue";
11
11
 
12
12
  import { metroWidgetH, measures } from "./data.js";
13
- import { ref } from "vue";
13
+ import { ref, shallowRef } from "vue";
14
14
 
15
15
  export default {
16
16
  components: {
@@ -10,7 +10,7 @@ import {
10
10
  import Item from "./Item.vue";
11
11
 
12
12
  import { metroWidgetV, measures } from "./data.js";
13
- import { ref } from "vue";
13
+ import { ref, shallowRef } from "vue";
14
14
 
15
15
  export default {
16
16
  components: {
@@ -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 = ref(null);
22
- let useTexture = ref(null);
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 = ref(null);
27
+ let objectFitTitle = shallowRef(null);
28
28
  let playStatus = ref("");
29
29
  provide("useTexture", useTexture);
30
- provide("objectFit", ref(null));
30
+ provide("objectFit", shallowRef(null));
31
31
  provide("videoRect", ref({}));
32
- provide("playVideo", ref(null));
33
- provide("seekVideo", ref(null));
34
- provide("enableAnimation", ref(null));
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,5 +1,5 @@
1
1
  <script setup>
2
- import { ref } from "vue";
2
+ import { ref, shallowRef } from "vue";
3
3
  const props = defineProps({
4
4
  style: Object,
5
5
  autoFocus: Boolean,
@@ -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 = "#00FFFF";
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
- let shown = reactive({
13
- vertical: 0.25,
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
- case_config.value = getTestCase(0);
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 5s infinite linear";
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 = 0.25;
74
+ test_config.vertical = VISIBLE_RANGE;
67
75
  break;
68
76
  }
69
77
  case 1: {
70
78
  // 左到右
71
- test_config.animation = "visibleSensor_leftRight 5s infinite linear";
79
+ test_config.animation = "visibleSensor_leftRight 8s infinite linear";
72
80
  test_config.text = "从左到右";
73
- test_config.horizon = 0.25;
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: 100,
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
- `new horizon: ${status_text.newH}
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,
110
- width: 800,
111
- height: 500,
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
- {{ case_config.text }}
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(300px, -200px, 0);
219
+ transform: translate3d(75px, -180px, 0);
153
220
  }
154
221
  to {
155
- transform: translate3d(300px, 600px, 0);
222
+ transform: translate3d(75px, 330px, 0);
156
223
  }
157
224
  }
158
225
 
159
226
  @keyframes visibleSensor_leftRight {
160
227
  from {
161
- transform: translate3d(-160px, 200px, 0);
228
+ transform: translate3d(-180px, 75px, 0);
162
229
  }
163
230
  to {
164
- transform: translate3d(1400px, 200px, 0);
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
- function getName() {
70
- return toRaw(_fDivRef.value)?.FocusNodeRef.getName();
71
+ const getName = () => {
72
+ return toRaw(fDivRef.value)?.FocusNodeRef.getName();
71
73
  };
72
74
 
73
- function getNamespace() {
74
- let focusNode = toRaw(_fDivRef.value)?.FocusNodeRef;
75
+ const getNamespace = () => {
76
+ let focusNode = toRaw(fDivRef.value)?.FocusNodeRef;
75
77
  if (focusNode?.AsHub) {
76
78
  // hub的getHub返回的是自己
77
- focusNode = toRaw(_fDivRef.value)?.FocusNodeRef.GetParentPage();
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
- function findBlockByName(name) {
84
- const focusNode = toRaw(_fDivRef.value)?.FocusNodeRef.getNodeByName(name);
85
+ const findBlockByName = (name) => {
86
+ const focusNode = toRaw(fDivRef.value)?.FocusNodeRef.getNodeByName(name);
85
87
  return focusNode?.jsvVueComponent;
86
88
  };
87
89
 
88
- function requestFocus(passToChild) {
89
- toRaw(_fDivRef.value)?.FocusNodeRef.requestFocus(passToChild);
90
+ const requestFocus = (passToChild) => {
91
+ toRaw(fDivRef.value)?.FocusNodeRef.requestFocus(passToChild);
90
92
  };
91
93
 
92
- function returnFocusToParent() {
93
- toRaw(_fDivRef.value)?.FocusNodeRef.ReturnFocusToParent();
94
+ const returnFocusToParent = () => {
95
+ toRaw(fDivRef.value)?.FocusNodeRef.ReturnFocusToParent();
94
96
  };
95
97
 
96
- function bubbleCustomerEvent(ev) {
97
- toRaw(_fDivRef.value)?.FocusNodeRef.bubbleCustomerEvent(ev);
98
+ const bubbleCustomerEvent = (ev) => {
99
+ toRaw(fDivRef.value)?.FocusNodeRef.bubbleCustomerEvent(ev);
98
100
  };
99
101
 
100
- function debugPrintFocusChain() {
101
- toRaw(_fDivRef.value)?.FocusNodeRef.printFocusNodeList();
102
+ const debugPrintFocusChain = () => {
103
+ toRaw(fDivRef.value)?.FocusNodeRef.printFocusNodeList();
102
104
  };
103
105
 
104
- function debugPrintLastFocus() {
105
- toRaw(_fDivRef.value)?.FocusNodeRef.printGlobalLastFocus();
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
- function _mountToFocusSystem() {
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
- _actionCallback.onDispatchKeyDown =
127
+ actionCallback.onDispatchKeyDown =
127
128
  props.onDispatchKeyDown || props.onAction?.onDispatchKeyDown;
128
- if (_actionCallback.onDispatchKeyDown) {
129
+ if (actionCallback.onDispatchKeyDown) {
129
130
  focusNode.setDispatchKeyDown(_onDispatchKeyDown);
130
131
  }
131
- _actionCallback.onDispatchKeyUp =
132
+ actionCallback.onDispatchKeyUp =
132
133
  props.onDispatchKeyUp || props.onAction?.onDispatchKeyUp;
133
- if (_actionCallback.onDispatchKeyUp) {
134
+ if (actionCallback.onDispatchKeyUp) {
134
135
  focusNode.setDispatchKeyUp(_onDispatchKeyUp);
135
136
  }
136
- _actionCallback.onKeyDown = props.onKeyDown || props.onAction?.onKeyDown;
137
- if (_actionCallback.onKeyDown) {
137
+ actionCallback.onKeyDown = props.onKeyDown || props.onAction?.onKeyDown;
138
+ if (actionCallback.onKeyDown) {
138
139
  focusNode.setOnKeyDown(_onKeyDown);
139
140
  }
140
- _actionCallback.onKeyUp = props.onKeyUp || props.onAction?.onKeyUp;
141
- if (_actionCallback.onKeyUp) {
141
+ actionCallback.onKeyUp = props.onKeyUp || props.onAction?.onKeyUp;
142
+ if (actionCallback.onKeyUp) {
142
143
  focusNode.setOnKeyUp(_onKeyUp);
143
144
  }
144
- _actionCallback.onFocus = props.onFocus || props.onAction?.onFocus;
145
- if (_actionCallback.onFocus) {
145
+ actionCallback.onFocus = props.onFocus || props.onAction?.onFocus;
146
+ if (actionCallback.onFocus) {
146
147
  focusNode.setOnFocus(_onFocus);
147
148
  }
148
- _actionCallback.onBlur = props.onBlur || props.onAction?.onBlur;
149
- if (_actionCallback.onBlur) {
149
+ actionCallback.onBlur = props.onBlur || props.onAction?.onBlur;
150
+ if (actionCallback.onBlur) {
150
151
  focusNode.setOnBlur(_onBlur);
151
152
  }
152
153
 
153
- _actionCallback.onCustomerEvent =
154
+ actionCallback.onCustomerEvent =
154
155
  props.onCustomerEvent || props.onAction?.onCustomerEvent;
155
- if (_actionCallback.onCustomerEvent) {
156
+ if (actionCallback.onCustomerEvent) {
156
157
  focusNode.setOnCustomerEvent(_onCustomerEvent);
157
158
  }
158
159
  // 建立父子关系链
159
- let self = toRaw(_fDivRef.value);
160
- let parent = self.parentElement;
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.parentElement;
168
+ parent = parent.parentNode;
168
169
  continue;
169
170
  }
170
171
 
@@ -173,35 +174,32 @@ function _mountToFocusSystem() {
173
174
  }
174
175
  };
175
176
 
176
- function _onDispatchKeyDown(ev) {
177
+ const _onDispatchKeyDown = (ev) => {
177
178
  ev.ownerNode = exportObject;
178
- return _actionCallback?.onDispatchKeyDown(ev) || false;
179
+ return actionCallback?.onDispatchKeyDown(ev) || false;
179
180
  };
180
- function _onDispatchKeyUp(ev) {
181
+ const _onDispatchKeyUp = (ev) => {
181
182
  ev.ownerNode = exportObject;
182
- return _actionCallback?.onDispatchKeyUp(ev) || false;
183
+ return actionCallback?.onDispatchKeyUp(ev) || false;
183
184
  };
184
- function _onKeyDown(ev) {
185
+ const _onKeyDown = (ev) => {
185
186
  ev.ownerNode = exportObject;
186
- return _actionCallback?.onKeyDown(ev) || false;
187
+ return actionCallback?.onKeyDown(ev) || false;
187
188
  };
188
- function _onKeyUp(ev) {
189
+ const _onKeyUp = (ev) => {
189
190
  ev.ownerNode = exportObject;
190
- return _actionCallback?.onKeyUp(ev) || false;
191
+ return actionCallback?.onKeyUp(ev) || false;
191
192
  };
192
- function _onFocus() {
193
- _actionCallback?.onFocus(exportObject);
193
+ const _onFocus = () => {
194
+ actionCallback?.onFocus(exportObject);
194
195
  };
195
- function _onBlur() {
196
- _actionCallback?.onBlur(exportObject);
196
+ const _onBlur = () => {
197
+ actionCallback?.onBlur(exportObject);
197
198
  };
198
- function _onCustomerEvent(ev) {
199
- return _actionCallback?.onCustomerEvent(ev) || false;
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(_fDivRef.value)?.FocusNodeRef;
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
- <div>
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>