@shijiu/jsview-vue 0.9.502 → 0.9.590
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/dom/bin/jsview-browser-debug-dom.min.js +1 -1
- package/dom/bin/jsview-dom.min.js +1 -1
- package/dom/target_core_revision.js +4 -3
- package/index.js +10 -0
- package/package.json +8 -1
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +16 -5
- package/samples/AnimPicture/App.vue +89 -106
- package/samples/Basic/App.vue +65 -68
- package/samples/Basic/components/ContentBlock.vue +31 -36
- package/samples/Basic/components/anim/AnimGroup.vue +61 -75
- package/samples/Basic/components/anim/AnimKeyframeBasic.vue +54 -43
- package/samples/Basic/components/anim/AnimKeyframeComposite.vue +25 -31
- package/samples/Basic/components/anim/AnimTransition.vue +142 -105
- package/samples/Basic/components/div/DivBackground.vue +38 -16
- package/samples/Basic/components/div/DivClip.vue +143 -78
- package/samples/Basic/components/div/DivCssScoped.vue +10 -10
- package/samples/Basic/components/div/DivCssVar.vue +40 -42
- package/samples/Basic/components/div/DivGroup1.vue +45 -39
- package/samples/Basic/components/div/DivGroup2.vue +56 -45
- package/samples/Basic/components/div/DivLayout.vue +34 -5
- package/samples/Basic/components/div/DivRadius.vue +51 -42
- package/samples/Basic/components/div/DivTransform.vue +21 -16
- package/samples/Basic/components/panel/Panel1.vue +46 -44
- package/samples/Basic/components/panel/Panel2.vue +22 -26
- package/samples/Basic/components/panel/TitleBar.vue +12 -12
- package/samples/Basic/components/text/TextAlign.vue +54 -44
- package/samples/Basic/components/text/TextEmoji.vue +16 -20
- package/samples/Basic/components/text/TextFontStyle.vue +77 -53
- package/samples/Basic/components/text/TextGroup1.vue +46 -38
- package/samples/Basic/components/text/TextGroup2.vue +25 -28
- package/samples/Basic/components/text/TextOverflow.vue +76 -57
- package/samples/BasicFocusControl/App.vue +22 -43
- package/samples/BasicFocusControl/components/BaseBlock.vue +42 -43
- package/samples/BasicFocusControl/components/MainArea.vue +55 -70
- package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +11 -15
- package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +21 -24
- package/samples/BasicFocusControl/components/SideBar.vue +32 -47
- package/samples/BasicFocusControl/components/SideBarBlock.vue +20 -23
- package/samples/ColorSpace/App.vue +15 -24
- package/samples/DemoHomepage/App.vue +7 -11
- package/samples/DemoHomepage/components/BodyFrame.vue +19 -9
- package/samples/DemoHomepage/components/TabFrame.vue +7 -8
- package/samples/DemoHomepage/router.js +32 -33
- package/samples/DemoHomepage/views/Homepage.vue +24 -8
- package/samples/FilterDemo/AnimatePic.vue +58 -0
- package/samples/FilterDemo/App.vue +99 -61
- package/samples/FilterDemo/VideoLayer.vue +62 -0
- package/samples/FlipCard/App.vue +32 -41
- package/samples/FlipCard/FlipCard.vue +48 -54
- package/samples/GridDemo/App.vue +109 -77
- package/samples/GridDemo/ButtonBlock.vue +50 -49
- package/samples/GridDemo/FocusItem.vue +19 -38
- package/samples/GridDemo/Item.vue +46 -54
- package/samples/HashHistory/App.vue +63 -79
- package/samples/HashHistory/components/HorizontalButtonList.vue +72 -95
- package/samples/HashHistory/components/Item.vue +42 -56
- package/samples/HashHistory/router.js +23 -12
- package/samples/HashHistory/views/MainPage.vue +35 -46
- package/samples/HashHistory/views/SubPage.vue +34 -47
- package/samples/Input/App.vue +2 -3
- package/samples/Input/FullKeyboard.vue +2 -6
- package/samples/Input/InputPanel.vue +2 -3
- package/samples/Input/KeyboardItem.vue +1 -1
- package/samples/LongImage/App.vue +11 -27
- package/samples/LongImage/Button.vue +50 -145
- package/samples/LongImage/ButtonItem.vue +44 -0
- package/samples/LongImage/LongImageScroll.vue +71 -106
- package/samples/LongImage/Scroll.vue +7 -9
- package/samples/LongText/App.vue +13 -28
- package/samples/LongText/Button.vue +43 -145
- package/samples/LongText/ButtonItem.vue +44 -0
- package/samples/LongText/LongTextScroll.vue +68 -101
- package/samples/LongText/Scroll.vue +7 -9
- package/samples/Marquee/App.vue +34 -37
- package/samples/MaskClip/App.vue +17 -30
- package/samples/MetroWidgetDemos/Advanced/App.vue +211 -0
- package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
- package/samples/MetroWidgetDemos/Item.vue +67 -0
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/App.vue +80 -104
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/Item.vue +7 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/bg.jpg +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_content.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_left.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_mid.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_right.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/focus_border.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/holder_logo.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/jrbm.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_left.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_mid.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_right.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/loading.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/logo.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/mcjx.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/tao.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/tmall.png +0 -0
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/border.png +0 -0
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/components/ContentItem.vue +60 -86
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/components/MyTab.vue +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/data.js +45 -0
- package/samples/MetroWidgetDemos/PingPong/App.vue +135 -0
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +58 -0
- package/samples/MetroWidgetDemos/PingPong/AppTab.vue +69 -0
- package/samples/MetroWidgetDemos/PingPong/Item.vue +92 -0
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
- package/samples/MetroWidgetDemos/Simple/App.vue +194 -0
- package/samples/MetroWidgetDemos/WidgetItem.vue +89 -0
- package/samples/MetroWidgetDemos/data.js +204 -0
- package/samples/NinePatchDemo/App.vue +114 -115
- package/samples/NinePatchDemo/Item.vue +7 -8
- package/samples/Preload/App.vue +61 -63
- package/samples/Preload/Item.vue +21 -29
- package/samples/QrcodeDemo/App.vue +24 -29
- package/samples/SoundPool/App.vue +77 -106
- package/samples/SprayView/App.vue +10 -8
- package/samples/SpriteImage/App.vue +1 -2
- package/samples/TextBox/App.vue +86 -101
- package/samples/TextBox/RenderCenter.vue +1 -1
- package/samples/TextBox/RenderLeft.vue +1 -1
- package/samples/TextBox/RenderOneLine.vue +1 -1
- package/samples/TextBox/RenderRight.vue +1 -1
- package/samples/TextShadowDemo/App.vue +1 -2
- package/samples/TextureAnimation/App.vue +16 -13
- package/samples/TextureSize/App.vue +15 -25
- package/samples/ThrowMoveDemo/AccelerateDemo.vue +2 -4
- package/samples/ThrowMoveDemo/LRParabolicDemo.vue +2 -3
- package/samples/ThrowMoveDemo/TargetDemo.vue +3 -4
- package/samples/ThrowMoveDemo/UDParabolicDemo.vue +2 -3
- package/samples/TouchSample/App.vue +2 -3
- package/samples/TouchSample/Item.vue +15 -13
- package/samples/TouchSample/MetroWidgetHorizontal.vue +2 -2
- package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
- package/samples/TouchSample/TouchContainerHorizontal.vue +4 -3
- package/samples/TouchSample/TouchContainerVertical.vue +3 -2
- package/samples/TransitPage/App.vue +20 -32
- package/samples/VideoDemo/App.vue +65 -81
- package/samples/VideoDemo/components/Button.vue +41 -52
- package/samples/VideoDemo/components/Controllor.vue +171 -169
- package/samples/VideoDemo/components/VideoFrame.vue +87 -99
- package/samples/VisibleSensorDemo/App.vue +167 -0
- package/scripts/jsview-jsmap-serve.js +42 -0
- package/scripts/jsview-post-install.js +1 -1
- package/tsconfig.json +3 -0
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +204 -193
- package/utils/JsViewEngineWidget/JsvFocusManager.js +30 -17
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +1555 -1656
- package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.js +136 -0
- package/utils/JsViewEngineWidget/MetroWidget/ToolFunctions.js +18 -0
- package/utils/JsViewEngineWidget/TemplateParser.js +111 -1
- package/utils/JsViewEngineWidget/WidgetCommon.js +8 -2
- package/utils/JsViewEngineWidget/index.js +4 -4
- package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +1 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +264 -54
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +5 -1
- package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
- package/utils/JsViewVueTools/JsvRefTaker.js +35 -0
- package/utils/JsViewVueTools/index.js +19 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +8 -4
- package/utils/JsViewVueWidget/JsvFilterView.vue +59 -51
- package/utils/JsViewVueWidget/JsvGrid.vue +139 -41
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +3 -1
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +8 -17
- package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -1
- package/utils/JsViewVueWidget/JsvPosterDiv.vue +37 -7
- package/utils/JsViewVueWidget/JsvPosterImage.vue +34 -13
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +2 -12
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +1 -1
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +13 -10
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +2 -3
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +25 -21
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +7 -8
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +141 -0
- package/utils/JsViewVueWidget/JsvVisibleSensor/index.js +9 -0
- package/utils/JsViewVueWidget/index.js +42 -0
- package/samples/AdvanceMetroWidget/App.vue +0 -123
- package/samples/AdvanceMetroWidget/Frame.vue +0 -102
- package/samples/AdvanceMetroWidget/Item.vue +0 -63
- package/samples/AdvanceMetroWidget/data.js +0 -137
- package/samples/ClassNameDemo/App.vue +0 -119
- package/samples/ClassNameDemo/components/ContentItem.vue +0 -253
- package/samples/ClassNameDemo/components/LoadingView.vue +0 -43
- package/samples/ClassNameDemo/components/TitleView.vue +0 -24
- package/samples/ClassNameDemo/data.js +0 -24
- package/samples/FlowMultiWidget/App.vue +0 -91
- package/samples/FlowMultiWidget/assets/nine_patch_focus.png +0 -0
- package/samples/FlowMultiWidget/components/Block.vue +0 -107
- package/samples/FlowMultiWidget/components/FlowPage.vue +0 -60
- package/samples/FlowMultiWidget/components/Item.vue +0 -103
- package/samples/FlowMultiWidget/components/MenuItem.vue +0 -72
- package/samples/FlowMultiWidget/components/MyMenu.vue +0 -90
- package/samples/FlowMultiWidget/data.js +0 -446
- package/samples/HashHistory/views/BasePage.vue +0 -19
- package/samples/HashHistory/views/SubPageFirst.vue +0 -10
- package/samples/HashHistory/views/SubPageSecond.vue +0 -10
- package/samples/SimpleWidgetDemo/assets/bg.jpg +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_content.png +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_left.png +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_mid.png +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_right.png +0 -0
- package/samples/SimpleWidgetDemo/assets/focus_border.png +0 -0
- package/samples/SimpleWidgetDemo/assets/holder_logo.png +0 -0
- package/samples/SimpleWidgetDemo/assets/jrbm.png +0 -0
- package/samples/SimpleWidgetDemo/assets/line_left.png +0 -0
- package/samples/SimpleWidgetDemo/assets/line_mid.png +0 -0
- package/samples/SimpleWidgetDemo/assets/line_right.png +0 -0
- package/samples/SimpleWidgetDemo/assets/loading.png +0 -0
- package/samples/SimpleWidgetDemo/assets/logo.png +0 -0
- package/samples/SimpleWidgetDemo/assets/mcjx.png +0 -0
- package/samples/SimpleWidgetDemo/assets/tao.png +0 -0
- package/samples/SimpleWidgetDemo/assets/tmall.png +0 -0
- package/samples/SimpleWidgetDemo/data.js +0 -124
- package/utils/JsViewEngineWidget/MetroWidget/ContentView.vue +0 -63
- package/utils/JsViewEngineWidget/MetroWidget/DivWrapper.vue +0 -51
- package/utils/JsViewEngineWidget/MetroWidget/ItemView.vue +0 -213
- package/utils/JsViewEngineWidget/MetroWidget/RootView.vue +0 -154
|
@@ -1,153 +1,51 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
super(props);
|
|
6
|
-
}
|
|
7
|
-
private onKeyDown?: Function = undefined;
|
|
8
|
-
private leftRef: any = null;
|
|
9
|
-
private rightRef: any = null;
|
|
10
|
-
private focusId: Number = 0; // 0:button未获得焦点/焦点移出。 1:button获取焦点切焦点在按钮1上。 2:button获取焦点切焦点在按钮2上。
|
|
11
|
-
private focusName: String = "";
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import { HORIZONTAL, MetroWidget, EdgeDirection, useFocusHub } from "jsview";
|
|
4
|
+
import ButtonItem from "./ButtonItem.vue";
|
|
12
5
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
const focusHub = useFocusHub();
|
|
7
|
+
const data = [
|
|
8
|
+
{
|
|
9
|
+
width: 100,
|
|
10
|
+
height: 50,
|
|
11
|
+
marginRight: 100,
|
|
12
|
+
content: "同意",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
width: 100,
|
|
16
|
+
height: 50,
|
|
17
|
+
content: "取消",
|
|
18
|
+
},
|
|
19
|
+
];
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
private getLeftActionCallback() {
|
|
22
|
-
const onAction = {
|
|
23
|
-
// onKeyDown: this.onKeyDown,
|
|
24
|
-
onKeyDown: (ev: any) => {
|
|
25
|
-
let keyUsed = true;
|
|
26
|
-
switch (ev.keyCode) {
|
|
27
|
-
case 37:
|
|
28
|
-
this.focusName = "btn_left";
|
|
29
|
-
break;
|
|
30
|
-
case 38:
|
|
31
|
-
this.focusName = "LongTextScroll";
|
|
32
|
-
break;
|
|
33
|
-
case 39:
|
|
34
|
-
this.focusName = "btn_right";
|
|
35
|
-
break;
|
|
36
|
-
default:
|
|
37
|
-
keyUsed = false;
|
|
38
|
-
}
|
|
39
|
-
if (keyUsed) {
|
|
40
|
-
console.log("Button requestFocusName = ", this.focusName);
|
|
41
|
-
this.leftRef.findBlockByName(this.focusName).requestFocus();
|
|
42
|
-
}
|
|
43
|
-
return keyUsed;
|
|
44
|
-
},
|
|
45
|
-
onFocus: () => {
|
|
46
|
-
console.log("btn_left getFocus");
|
|
47
|
-
this.focusId = 1;
|
|
48
|
-
},
|
|
49
|
-
onBlur: () => {
|
|
50
|
-
console.log("btn_left loseFocus");
|
|
51
|
-
this.focusId = 0;
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
return onAction;
|
|
55
|
-
}
|
|
21
|
+
const measures = (item) => {
|
|
22
|
+
return item;
|
|
23
|
+
};
|
|
56
24
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onKeyDown: (ev: any) => {
|
|
61
|
-
let keyUsed = true;
|
|
62
|
-
switch (ev.keyCode) {
|
|
63
|
-
case 37:
|
|
64
|
-
this.focusName = "btn_left";
|
|
65
|
-
break;
|
|
66
|
-
case 38:
|
|
67
|
-
this.focusName = "LongTextScroll";
|
|
68
|
-
break;
|
|
69
|
-
case 39:
|
|
70
|
-
this.focusName = "btn_right";
|
|
71
|
-
break;
|
|
72
|
-
default:
|
|
73
|
-
keyUsed = false;
|
|
74
|
-
}
|
|
75
|
-
if (keyUsed) {
|
|
76
|
-
this.leftRef.findBlockByName(this.focusName).requestFocus();
|
|
77
|
-
}
|
|
78
|
-
return keyUsed;
|
|
79
|
-
},
|
|
80
|
-
onFocus: () => {
|
|
81
|
-
console.log("btn_left getFocus");
|
|
82
|
-
this.focusId = 2;
|
|
83
|
-
},
|
|
84
|
-
onBlur: () => {
|
|
85
|
-
console.log("btn_left loseFocus");
|
|
86
|
-
this.focusId = 0;
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
return onAction;
|
|
25
|
+
const onEdge = (edgeInfo) => {
|
|
26
|
+
if (edgeInfo.direction == EdgeDirection.top) {
|
|
27
|
+
focusHub.setFocus("longTextScroll");
|
|
90
28
|
}
|
|
91
|
-
}
|
|
29
|
+
};
|
|
92
30
|
</script>
|
|
93
31
|
|
|
94
32
|
<template>
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
height: 50,
|
|
114
|
-
left: -5,
|
|
115
|
-
fontSize: '30px',
|
|
116
|
-
textAlign: 'center',
|
|
117
|
-
lineHeight: '50px',
|
|
118
|
-
backgroundColor: '#EEEEEE',
|
|
119
|
-
}"
|
|
120
|
-
>
|
|
121
|
-
同意
|
|
122
|
-
</div>
|
|
123
|
-
</jsv-focus-block>
|
|
124
|
-
<jsv-focus-block
|
|
125
|
-
:ref="onRightRef"
|
|
126
|
-
namespace="btn_right"
|
|
127
|
-
:onAction="getRightActionCallback()"
|
|
128
|
-
>
|
|
129
|
-
<div
|
|
130
|
-
:style="{
|
|
131
|
-
width: 100,
|
|
132
|
-
height: 60,
|
|
133
|
-
left: 110,
|
|
134
|
-
top: -5,
|
|
135
|
-
backgroundColor: this.focusId === 2 ? '#DD0000' : '#FFFFFF',
|
|
136
|
-
}"
|
|
137
|
-
></div>
|
|
138
|
-
<div
|
|
139
|
-
:style="{
|
|
140
|
-
width: 90,
|
|
141
|
-
height: 50,
|
|
142
|
-
left: 115,
|
|
143
|
-
fontSize: '30px',
|
|
144
|
-
textAlign: 'center',
|
|
145
|
-
lineHeight: '50px',
|
|
146
|
-
backgroundColor: '#EEEEEE',
|
|
147
|
-
}"
|
|
148
|
-
>
|
|
149
|
-
取消
|
|
150
|
-
</div>
|
|
151
|
-
</jsv-focus-block>
|
|
152
|
-
</div>
|
|
33
|
+
<metro-widget
|
|
34
|
+
name="button"
|
|
35
|
+
:width="500"
|
|
36
|
+
:height="50"
|
|
37
|
+
:data="data"
|
|
38
|
+
:direction="HORIZONTAL"
|
|
39
|
+
:measures="measures"
|
|
40
|
+
:onEdge="onEdge"
|
|
41
|
+
>
|
|
42
|
+
<template #renderItem="{ data, query, onEdge, onAction }">
|
|
43
|
+
<button-item
|
|
44
|
+
:data="data"
|
|
45
|
+
:query="query"
|
|
46
|
+
:onEdge="onEdge"
|
|
47
|
+
:onAction="onAction"
|
|
48
|
+
/>
|
|
49
|
+
</template>
|
|
50
|
+
</metro-widget>
|
|
153
51
|
</template>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-07-08 15:05:00
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-07-08 17:45:44
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script setup>
|
|
9
|
+
import { ref } from "vue";
|
|
10
|
+
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
data: Object,
|
|
13
|
+
query: Object,
|
|
14
|
+
onEdge: Function,
|
|
15
|
+
onAction: Object,
|
|
16
|
+
});
|
|
17
|
+
const focused = ref(false);
|
|
18
|
+
const onFocus = () => {
|
|
19
|
+
focused.value = true;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const onBlur = () => {
|
|
23
|
+
focused.value = false;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const onClick = () => {};
|
|
27
|
+
|
|
28
|
+
props.onAction.register("onFocus", onFocus);
|
|
29
|
+
props.onAction.register("onBlur", onBlur);
|
|
30
|
+
props.onAction.register("onClick", onClick);
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<div
|
|
35
|
+
:style="{
|
|
36
|
+
width: props.data.width,
|
|
37
|
+
height: props.data.height,
|
|
38
|
+
fontSize: 30,
|
|
39
|
+
backgroundColor: focused ? '#DD8800' : '#BBBBAA',
|
|
40
|
+
}"
|
|
41
|
+
>
|
|
42
|
+
{{ data.content }}
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
@@ -1,118 +1,85 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script setup>
|
|
2
2
|
import Scroll from "./Scroll.vue";
|
|
3
|
-
import {
|
|
3
|
+
import { ref, onMounted } from "vue";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
scrollStyle: Object,
|
|
13
|
-
scrollBlockStyle: Object,
|
|
14
|
-
textStyle: Object,
|
|
15
|
-
},
|
|
16
|
-
})
|
|
17
|
-
export default class LongTextScroll extends Vue {
|
|
18
|
-
constructor(props: any) {
|
|
19
|
-
super(props);
|
|
20
|
-
console.log("test LongTextScoll");
|
|
21
|
-
}
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
step: Number,
|
|
7
|
+
style: Object,
|
|
8
|
+
scrollStyle: Object,
|
|
9
|
+
scrollBlockStyle: Object,
|
|
10
|
+
textStyle: Object,
|
|
11
|
+
});
|
|
22
12
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
const rootRef = ref(null);
|
|
14
|
+
const element = ref(null);
|
|
15
|
+
const scrollY = ref(0);
|
|
16
|
+
const textY = ref(0);
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
(this.element.clientHeight - this.style.height)) *
|
|
46
|
-
(this.scrollStyle.height - this.scrollBlockStyle.height));
|
|
47
|
-
}
|
|
48
|
-
break;
|
|
49
|
-
case 40:
|
|
50
|
-
if (
|
|
51
|
-
this.textY !==
|
|
52
|
-
this.style.height - this.element.clientHeight
|
|
53
|
-
) {
|
|
54
|
-
text_y =
|
|
55
|
-
this.textY - this.step <=
|
|
56
|
-
this.style.height - this.element.clientHeight
|
|
57
|
-
? this.style.height - this.element.clientHeight
|
|
58
|
-
: this.textY - this.step;
|
|
59
|
-
(this.textY = text_y),
|
|
60
|
-
(this.scrollY =
|
|
61
|
-
(-text_y /
|
|
62
|
-
(this.element.clientHeight - this.style.height)) *
|
|
63
|
-
(this.scrollStyle.height - this.scrollBlockStyle.height));
|
|
64
|
-
} else {
|
|
65
|
-
this.rootRef.findBlockByName("btn_left").requestFocus();
|
|
66
|
-
}
|
|
67
|
-
break;
|
|
18
|
+
const onAction = {
|
|
19
|
+
onKeyDown: (ev) => {
|
|
20
|
+
const valid =
|
|
21
|
+
element.value &&
|
|
22
|
+
element.value.clientHeight &&
|
|
23
|
+
element.value.clientHeight > props.style.height;
|
|
24
|
+
// let keyUsed = true;
|
|
25
|
+
if (valid) {
|
|
26
|
+
let text_y;
|
|
27
|
+
switch (ev.keyCode) {
|
|
28
|
+
case 38:
|
|
29
|
+
if (textY.value !== 0) {
|
|
30
|
+
text_y =
|
|
31
|
+
textY.value + props.step >= 0 ? 0 : textY.value + props.step;
|
|
32
|
+
(textY.value = text_y),
|
|
33
|
+
(scrollY.value =
|
|
34
|
+
(-text_y / (element.value.clientHeight - props.style.height)) *
|
|
35
|
+
(props.scrollStyle.height - props.scrollBlockStyle.height));
|
|
68
36
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
37
|
+
break;
|
|
38
|
+
case 40:
|
|
39
|
+
if (textY.value !== props.style.height - element.value.clientHeight) {
|
|
40
|
+
text_y =
|
|
41
|
+
textY.value - props.step <=
|
|
42
|
+
props.style.height - element.value.clientHeight
|
|
43
|
+
? props.style.height - element.value.clientHeight
|
|
44
|
+
: textY.value - props.step;
|
|
45
|
+
(textY.value = text_y),
|
|
46
|
+
(scrollY.value =
|
|
47
|
+
(-text_y / (element.value.clientHeight - props.style.height)) *
|
|
48
|
+
(props.scrollStyle.height - props.scrollBlockStyle.height));
|
|
49
|
+
} else {
|
|
50
|
+
rootRef.value.findBlockByName("button").requestFocus();
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
onFocus: () => {
|
|
57
|
+
console.log("LongTextScroll getFocus");
|
|
58
|
+
},
|
|
59
|
+
onBlur: () => {
|
|
60
|
+
console.log("LongTextScroll loseFocus");
|
|
61
|
+
},
|
|
62
|
+
};
|
|
95
63
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
64
|
+
const OnLoad = () => {
|
|
65
|
+
// 图片加载完成的回调
|
|
66
|
+
console.log("Image loaded!");
|
|
67
|
+
};
|
|
68
|
+
onMounted(() => {
|
|
69
|
+
rootRef.value.requestFocus();
|
|
70
|
+
});
|
|
100
71
|
</script>
|
|
101
72
|
|
|
102
73
|
|
|
103
74
|
<template>
|
|
104
75
|
<jsv-focus-block
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
:onAction="
|
|
76
|
+
ref="rootRef"
|
|
77
|
+
name="longTextScroll"
|
|
78
|
+
:onAction="onAction"
|
|
108
79
|
>
|
|
109
80
|
<div :style="{ clipPath: 'inset(0px 0px 0px 0px)', ...style }">
|
|
110
81
|
<div
|
|
111
|
-
|
|
112
|
-
(ele) => {
|
|
113
|
-
this.element = ele;
|
|
114
|
-
}
|
|
115
|
-
"
|
|
82
|
+
ref="element"
|
|
116
83
|
:style="{ top: textY, width: style.width, ...textStyle }"
|
|
117
84
|
>
|
|
118
85
|
{{
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
};
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
scrollStyle: Object,
|
|
4
|
+
top: Number,
|
|
5
|
+
scrollBlockStyle: Object,
|
|
6
|
+
});
|
|
9
7
|
</script>
|
|
10
8
|
<template>
|
|
11
9
|
<div :style="{ ...scrollStyle }">
|
|
12
10
|
<div :style="{ top: top }">
|
|
13
|
-
<div :style="{ ...scrollBlockStyle }"
|
|
11
|
+
<div :style="{ ...scrollBlockStyle }"></div>
|
|
14
12
|
</div>
|
|
15
13
|
</div>
|
|
16
14
|
</template>
|
package/samples/Marquee/App.vue
CHANGED
|
@@ -2,43 +2,34 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-01-18 18:24:18
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-07-08 13:41:53
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
|
-
<script>
|
|
9
|
-
import JsvMarquee from "jsview
|
|
10
|
-
import {
|
|
8
|
+
<script setup>
|
|
9
|
+
import { jJsvRuntimeBridge, JsvMarquee } from "jsview";
|
|
10
|
+
import { useRouter } from "vue-router";
|
|
11
|
+
import { onMounted } from "vue";
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
width: 600,
|
|
19
|
-
height: 50,
|
|
20
|
-
fontStyle: {
|
|
21
|
-
lineHeight: 50,
|
|
22
|
-
fontSize: 50,
|
|
23
|
-
},
|
|
24
|
-
longText:
|
|
25
|
-
"石室诗士施氏,嗜狮,誓食十狮。施氏时时适市视狮。十时,适十狮适市。是时,适施氏适市。施氏视是十狮,恃矢势,使是十狮逝世。氏拾是十狮尸,适石室。石室湿,氏使侍拭石室。石室拭,施氏始试食是十狮尸。食时,始识是十狮尸,实十石狮尸。试释是事。",
|
|
26
|
-
shortText: "测试文字",
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
methods: {
|
|
30
|
-
_onKeyDown(ev) {
|
|
31
|
-
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
32
|
-
this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
mounted() {
|
|
38
|
-
// 调试接口,对接JSCenter平台去掉启动图的处理
|
|
39
|
-
jJsvRuntimeBridge.notifyPageLoaded();
|
|
40
|
-
},
|
|
13
|
+
const width = 600;
|
|
14
|
+
const height = 50;
|
|
15
|
+
const fontStyle = {
|
|
16
|
+
lineHeight: 50,
|
|
17
|
+
fontSize: 50,
|
|
41
18
|
};
|
|
19
|
+
const longText =
|
|
20
|
+
"石室诗士施氏,嗜狮,誓食十狮。施氏时时适市视狮。十时,适十狮适市。是时,适施氏适市。施氏视是十狮,恃矢势,使是十狮逝世。氏拾是十狮尸,适石室。石室湿,氏使侍拭石室。石室拭,施氏始试食是十狮尸。食时,始识是十狮尸,实十石狮尸。试释是事。";
|
|
21
|
+
const shortText = "测试文字";
|
|
22
|
+
const router = useRouter();
|
|
23
|
+
|
|
24
|
+
const _onKeyDown = (ev) => {
|
|
25
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
26
|
+
router.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
};
|
|
30
|
+
onMounted(() => {
|
|
31
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
32
|
+
});
|
|
42
33
|
</script>
|
|
43
34
|
<template>
|
|
44
35
|
<jsv-focus-block
|
|
@@ -76,7 +67,6 @@ export default {
|
|
|
76
67
|
backgroundColor: '#007788',
|
|
77
68
|
}"
|
|
78
69
|
>
|
|
79
|
-
>
|
|
80
70
|
<jsv-marquee
|
|
81
71
|
:layoutStyles="{
|
|
82
72
|
width: width,
|
|
@@ -96,7 +86,6 @@ export default {
|
|
|
96
86
|
backgroundColor: '#007788',
|
|
97
87
|
}"
|
|
98
88
|
>
|
|
99
|
-
>
|
|
100
89
|
<jsv-marquee
|
|
101
90
|
:layoutStyles="[
|
|
102
91
|
{
|
|
@@ -104,11 +93,19 @@ export default {
|
|
|
104
93
|
height: height,
|
|
105
94
|
},
|
|
106
95
|
]"
|
|
107
|
-
:fontStyles="[fontStyle]"
|
|
108
96
|
:text="shortText"
|
|
109
97
|
:slideSpeed="60"
|
|
110
98
|
:forceSlide="true"
|
|
99
|
+
className="test-font"
|
|
111
100
|
/>
|
|
112
101
|
</div>
|
|
113
102
|
</jsv-focus-block>
|
|
114
|
-
</template>
|
|
103
|
+
</template>
|
|
104
|
+
|
|
105
|
+
<style scoped>
|
|
106
|
+
.test-font {
|
|
107
|
+
font-size: 50;
|
|
108
|
+
line-height: 50;
|
|
109
|
+
color: #ff0000;
|
|
110
|
+
}
|
|
111
|
+
</style>
|
package/samples/MaskClip/App.vue
CHANGED
|
@@ -2,45 +2,32 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-01-24 19:35:59
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-07-08 17:04:35
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
|
-
<script>
|
|
9
|
-
import {
|
|
10
|
-
|
|
8
|
+
<script setup>
|
|
9
|
+
import {
|
|
10
|
+
jJsvRuntimeBridge,
|
|
11
|
+
JsvMaskClipDiv,
|
|
12
|
+
} from "jsview";
|
|
13
|
+
import { useRouter } from "vue-router";
|
|
14
|
+
import { onMounted } from "vue";
|
|
11
15
|
import mask1_pic from "./images/mask-025/res/1.png";
|
|
12
16
|
import mask2_pic from "./images/mask-025/res/2.png";
|
|
13
17
|
import mask3_pic from "./images/mask-025/res/3.png";
|
|
14
18
|
import mask4_pic from "./images/mask-025/res/4.png";
|
|
15
19
|
import bg_pic from "./images/php.jpg";
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
mask1_pic,
|
|
25
|
-
mask2_pic,
|
|
26
|
-
mask3_pic,
|
|
27
|
-
mask4_pic,
|
|
28
|
-
bg_pic,
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
methods: {
|
|
32
|
-
_onKeyDown(ev) {
|
|
33
|
-
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
34
|
-
this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
mounted() {
|
|
40
|
-
// 调试接口,对接JSCenter平台去掉启动图的处理
|
|
41
|
-
jJsvRuntimeBridge.notifyPageLoaded();
|
|
42
|
-
},
|
|
21
|
+
const router = useRouter();
|
|
22
|
+
const _onKeyDown = (ev) => {
|
|
23
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
24
|
+
router.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
43
27
|
};
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
30
|
+
});
|
|
44
31
|
</script>
|
|
45
32
|
|
|
46
33
|
<template>
|