@shijiu/jsview-vue 0.9.502 → 0.9.631
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 +63 -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 +78 -59
- 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/Collision/App.vue +452 -0
- package/samples/ColorSpace/App.vue +15 -24
- package/samples/DemoHomepage/App.vue +7 -11
- package/samples/DemoHomepage/components/BodyFrame.vue +21 -9
- package/samples/DemoHomepage/components/TabFrame.vue +7 -8
- package/samples/DemoHomepage/router.js +52 -33
- package/samples/DemoHomepage/views/Homepage.vue +18 -9
- 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/ImpactStop/App.vue +435 -0
- package/samples/Input/App.vue +8 -18
- package/samples/Input/FullKeyboard.vue +2 -6
- package/samples/Input/InputPanel.vue +18 -12
- 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 +47 -0
- package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
- package/samples/MetroWidgetDemos/Advanced/Buttons.vue +70 -0
- package/samples/MetroWidgetDemos/Advanced/Mixed.vue +77 -0
- package/samples/MetroWidgetDemos/Advanced/Widgets.vue +71 -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 +73 -0
- package/samples/MetroWidgetDemos/PingPong/AppTab.vue +62 -0
- package/samples/MetroWidgetDemos/PingPong/TabItem.vue +84 -0
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
- package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +75 -0
- package/samples/MetroWidgetDemos/Simple/App.vue +45 -0
- package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +111 -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 +67 -64
- 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/TextureAnimation/App2.vue +111 -0
- package/samples/TextureAnimation/assets/blackWhiteGrid.png +0 -0
- package/samples/TextureAnimation/assets/light.png +0 -0
- package/samples/TextureAnimation/assets/light2.png +0 -0
- package/samples/TextureAnimation/assets/mask.png +0 -0
- 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 +234 -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 +1561 -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 +301 -58
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +22 -3
- package/utils/JsViewPlugin/JsvPlayer/index.js +8 -1
- package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
- package/utils/JsViewVueTools/JsvImpactTracer.js +113 -0
- package/utils/JsViewVueTools/JsvRefTaker.js +35 -0
- package/utils/JsViewVueTools/index.js +20 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +11 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +8 -4
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +203 -14
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +2 -2
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +2 -2
- package/utils/JsViewVueWidget/JsvFilterView.vue +59 -51
- package/utils/JsViewVueWidget/JsvGrid.vue +139 -41
- package/utils/JsViewVueWidget/JsvInput/Cursor.vue +4 -2
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +13 -12
- 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 +39 -53
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +1 -1
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +13 -10
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +282 -285
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +2 -3
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +6 -1
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +6 -1
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +142 -61
- package/utils/JsViewVueWidget/JsvTextureAnim/index.js +9 -5
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +7 -8
- package/utils/JsViewVueWidget/JsvVideo.vue +9 -12
- 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
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-07-11 14:00:33
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-07-12 14:35:01
|
|
6
|
+
* @Description: file content
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const randomColor = () => {
|
|
10
|
+
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|
|
11
|
+
return (
|
|
12
|
+
"#" + new Array(6 - randomColor.length).fill("0").join("") + randomColor
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const simpleData = [
|
|
17
|
+
{
|
|
18
|
+
width: 90,
|
|
19
|
+
height: 90,
|
|
20
|
+
marginRight: 10,
|
|
21
|
+
marginBottom: 10,
|
|
22
|
+
color: randomColor(),
|
|
23
|
+
content: "0",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
width: 90,
|
|
27
|
+
height: 90,
|
|
28
|
+
marginRight: 10,
|
|
29
|
+
marginBottom: 10,
|
|
30
|
+
color: randomColor(),
|
|
31
|
+
content: "1",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
width: 90,
|
|
35
|
+
height: 90,
|
|
36
|
+
marginRight: 10,
|
|
37
|
+
marginBottom: 10,
|
|
38
|
+
color: randomColor(),
|
|
39
|
+
content: "2",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
width: 190,
|
|
43
|
+
height: 190,
|
|
44
|
+
marginRight: 10,
|
|
45
|
+
marginBottom: 10,
|
|
46
|
+
color: randomColor(),
|
|
47
|
+
content: "3",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
width: 90,
|
|
51
|
+
height: 90,
|
|
52
|
+
marginRight: 10,
|
|
53
|
+
marginBottom: 10,
|
|
54
|
+
color: randomColor(),
|
|
55
|
+
content: "4",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
width: 90,
|
|
59
|
+
height: 90,
|
|
60
|
+
marginRight: 10,
|
|
61
|
+
marginBottom: 10,
|
|
62
|
+
color: randomColor(),
|
|
63
|
+
content: "5",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
width: 90,
|
|
67
|
+
height: 190,
|
|
68
|
+
marginRight: 10,
|
|
69
|
+
marginBottom: 10,
|
|
70
|
+
color: randomColor(),
|
|
71
|
+
content: "6",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
width: 90,
|
|
75
|
+
height: 90,
|
|
76
|
+
marginRight: 10,
|
|
77
|
+
marginBottom: 10,
|
|
78
|
+
color: randomColor(),
|
|
79
|
+
content: "7",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
width: 90,
|
|
83
|
+
height: 190,
|
|
84
|
+
marginRight: 10,
|
|
85
|
+
marginBottom: 10,
|
|
86
|
+
color: randomColor(),
|
|
87
|
+
content: "8",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
width: 90,
|
|
91
|
+
height: 90,
|
|
92
|
+
marginRight: 10,
|
|
93
|
+
marginBottom: 10,
|
|
94
|
+
color: randomColor(),
|
|
95
|
+
content: "9",
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
const simpleDataAbs = [
|
|
100
|
+
{
|
|
101
|
+
left: 0,
|
|
102
|
+
top: 0,
|
|
103
|
+
width: 90,
|
|
104
|
+
height: 90,
|
|
105
|
+
marginRight: 10,
|
|
106
|
+
marginBottom: 10,
|
|
107
|
+
color: randomColor(),
|
|
108
|
+
content: "0",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
left: 0,
|
|
112
|
+
top: 200,
|
|
113
|
+
width: 90,
|
|
114
|
+
height: 90,
|
|
115
|
+
marginRight: 10,
|
|
116
|
+
marginBottom: 10,
|
|
117
|
+
color: randomColor(),
|
|
118
|
+
content: "1",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
left: 200,
|
|
122
|
+
top: 0,
|
|
123
|
+
width: 90,
|
|
124
|
+
height: 90,
|
|
125
|
+
marginRight: 10,
|
|
126
|
+
marginBottom: 10,
|
|
127
|
+
color: randomColor(),
|
|
128
|
+
content: "2",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
left: 200,
|
|
132
|
+
top: 200,
|
|
133
|
+
width: 90,
|
|
134
|
+
height: 90,
|
|
135
|
+
marginRight: 10,
|
|
136
|
+
marginBottom: 10,
|
|
137
|
+
color: randomColor(),
|
|
138
|
+
content: "3",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
left: 400,
|
|
142
|
+
top: 0,
|
|
143
|
+
width: 90,
|
|
144
|
+
height: 90,
|
|
145
|
+
marginRight: 10,
|
|
146
|
+
marginBottom: 10,
|
|
147
|
+
color: randomColor(),
|
|
148
|
+
content: "4",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
left: 400,
|
|
152
|
+
top: 200,
|
|
153
|
+
width: 90,
|
|
154
|
+
height: 90,
|
|
155
|
+
marginRight: 10,
|
|
156
|
+
marginBottom: 10,
|
|
157
|
+
color: randomColor(),
|
|
158
|
+
content: "5",
|
|
159
|
+
},
|
|
160
|
+
];
|
|
161
|
+
|
|
162
|
+
const advanceButton = [];
|
|
163
|
+
for (let i = 0; i < 6; i++) {
|
|
164
|
+
advanceButton.push({
|
|
165
|
+
width: 100,
|
|
166
|
+
height: 50,
|
|
167
|
+
name: "button_" + i,
|
|
168
|
+
marginRight: 10,
|
|
169
|
+
marginBottom: 10,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const advanceMetroWidget = [];
|
|
174
|
+
for (let i = 0; i < 10; i++) {
|
|
175
|
+
advanceMetroWidget.push({
|
|
176
|
+
width: 500,
|
|
177
|
+
height: 170,
|
|
178
|
+
name: "widget_" + i,
|
|
179
|
+
marginBottom: 10,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const advanceMix = [];
|
|
184
|
+
for (let i = 0; i < 6; i++) {
|
|
185
|
+
advanceMix.push({
|
|
186
|
+
width: 100,
|
|
187
|
+
height: 50,
|
|
188
|
+
name: "mix_button_" + i,
|
|
189
|
+
marginRight: 10,
|
|
190
|
+
marginBottom: 10,
|
|
191
|
+
type: i % 3 == 0 ? "button" : "item",
|
|
192
|
+
color: randomColor(),
|
|
193
|
+
content: i,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export {
|
|
198
|
+
randomColor,
|
|
199
|
+
simpleData,
|
|
200
|
+
simpleDataAbs,
|
|
201
|
+
advanceButton,
|
|
202
|
+
advanceMetroWidget,
|
|
203
|
+
advanceMix,
|
|
204
|
+
};
|
|
@@ -1,27 +1,119 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import {
|
|
3
|
+
jJsvRuntimeBridge,
|
|
4
|
+
MetroWidget,
|
|
5
|
+
HORIZONTAL,
|
|
6
|
+
JsvNinePatch,
|
|
7
|
+
} from "jsview";
|
|
8
|
+
import Item from "./Item.vue";
|
|
9
|
+
import borderImageUrl from "./assets/border.png";
|
|
10
|
+
import { ref, onMounted } from "vue";
|
|
11
|
+
import { useRouter, useRoute } from "vue-router";
|
|
12
|
+
|
|
13
|
+
const router = useRouter();
|
|
14
|
+
|
|
15
|
+
const data = [
|
|
16
|
+
{
|
|
17
|
+
blocks: {
|
|
18
|
+
w: 160,
|
|
19
|
+
h: 160,
|
|
20
|
+
},
|
|
21
|
+
color: "#FF9900",
|
|
22
|
+
content: 0,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
blocks: {
|
|
26
|
+
w: 300,
|
|
27
|
+
h: 300,
|
|
28
|
+
},
|
|
29
|
+
color: "#0099FF",
|
|
30
|
+
content: 1,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
blocks: {
|
|
34
|
+
w: 160,
|
|
35
|
+
h: 160,
|
|
36
|
+
},
|
|
37
|
+
color: "#FF9900",
|
|
38
|
+
content: 2,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const framePosition = ref({
|
|
43
|
+
x: 0,
|
|
44
|
+
y: 0,
|
|
45
|
+
width: 50,
|
|
46
|
+
height: 50,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const _onFramePositionChanged = (new_x, new_y, new_width, new_height) => {
|
|
50
|
+
console.log(
|
|
51
|
+
`new x=${new_x} y=${new_y} width=${new_width} height=${new_height}`
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
framePosition.value = {
|
|
55
|
+
x: new_x,
|
|
56
|
+
y: new_y,
|
|
57
|
+
width: new_width,
|
|
58
|
+
height: new_height,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const _measures = (item) => {
|
|
63
|
+
return {
|
|
64
|
+
width: item.blocks.w,
|
|
65
|
+
height: item.blocks.h,
|
|
66
|
+
marginRight: 10,
|
|
67
|
+
marginTop: 10,
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const _onKeyDown = (ev) => {
|
|
72
|
+
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
73
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
74
|
+
router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const myFocusWidget = ref(null);
|
|
81
|
+
|
|
82
|
+
onMounted(() => {
|
|
83
|
+
myFocusWidget.value.getFocusBlockRef().requestFocus();
|
|
84
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
85
|
+
});
|
|
86
|
+
</script>
|
|
87
|
+
|
|
1
88
|
<template>
|
|
2
89
|
<div :style="{ width: 1280, height: 720, backgroundColor: '#FFFFFF' }">
|
|
3
90
|
<jsv-focus-block ref="focusNode" :onKeyDown="_onKeyDown">
|
|
4
|
-
<div
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
91
|
+
<div
|
|
92
|
+
:style="{
|
|
93
|
+
textAlign: 'center',
|
|
94
|
+
fontSize: 30,
|
|
95
|
+
lineHeight: 50,
|
|
96
|
+
color: '#ffffff',
|
|
97
|
+
left: 140,
|
|
98
|
+
top: 20,
|
|
99
|
+
width: 1000,
|
|
100
|
+
height: 50,
|
|
101
|
+
backgroundColor: 'rgba(27,38,151,0.8)',
|
|
102
|
+
}"
|
|
103
|
+
>
|
|
104
|
+
NinePatch展示,框的四个角的方形中心和项目的四个顶点严格对齐
|
|
105
|
+
</div>
|
|
15
106
|
<metro-widget
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
107
|
+
ref="myFocusWidget"
|
|
108
|
+
:top="100"
|
|
109
|
+
:left="250"
|
|
110
|
+
:width="1000"
|
|
111
|
+
:height="400"
|
|
112
|
+
:direction="HORIZONTAL"
|
|
113
|
+
:data="data"
|
|
114
|
+
:measures="_measures"
|
|
115
|
+
:padding="{ left: 50, right: 50, top: 50, height: 50 }"
|
|
116
|
+
>
|
|
25
117
|
<template #renderItem="{ data, query, onEdge, onAction }">
|
|
26
118
|
<item
|
|
27
119
|
:data="data"
|
|
@@ -32,7 +124,7 @@
|
|
|
32
124
|
/>
|
|
33
125
|
</template>
|
|
34
126
|
</metro-widget>
|
|
35
|
-
<div :style="{top:150, left:300}">
|
|
127
|
+
<div :style="{ top: 150, left: 300 }">
|
|
36
128
|
<jsv-nine-patch
|
|
37
129
|
:style="{
|
|
38
130
|
width: framePosition.width,
|
|
@@ -40,7 +132,7 @@
|
|
|
40
132
|
top: framePosition.y,
|
|
41
133
|
left: framePosition.x,
|
|
42
134
|
}"
|
|
43
|
-
:imageUrl="
|
|
135
|
+
:imageUrl="borderImageUrl"
|
|
44
136
|
:imageWidth="81"
|
|
45
137
|
:centerWidth="25"
|
|
46
138
|
:borderOutset="14"
|
|
@@ -51,96 +143,3 @@
|
|
|
51
143
|
</jsv-focus-block>
|
|
52
144
|
</div>
|
|
53
145
|
</template>
|
|
54
|
-
<script setup>
|
|
55
|
-
import { jJsvRuntimeBridge } from "jsview/utils/JsViewVueTools/JsvRuntimeBridge";
|
|
56
|
-
import {
|
|
57
|
-
HORIZONTAL,
|
|
58
|
-
MetroWidget,
|
|
59
|
-
} from "jsview/utils/JsViewEngineWidget";
|
|
60
|
-
import JsvNinePatch from "jsview/utils/JsViewVueWidget/JsvNinePatch.vue";
|
|
61
|
-
import Item from "./Item.vue";
|
|
62
|
-
import borderImageUrl from "./assets/border.png"
|
|
63
|
-
import { ref, onMounted } from 'vue'
|
|
64
|
-
import { useRouter, useRoute } from 'vue-router'
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const router = useRouter();
|
|
68
|
-
|
|
69
|
-
const data = [
|
|
70
|
-
{
|
|
71
|
-
blocks: {
|
|
72
|
-
w: 160,
|
|
73
|
-
h: 160
|
|
74
|
-
},
|
|
75
|
-
color: "#FF9900",
|
|
76
|
-
content: 0
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
blocks: {
|
|
80
|
-
w: 300,
|
|
81
|
-
h: 300
|
|
82
|
-
},
|
|
83
|
-
color: "#0099FF",
|
|
84
|
-
content: 1
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
blocks: {
|
|
88
|
-
w: 160,
|
|
89
|
-
h: 160
|
|
90
|
-
},
|
|
91
|
-
color: "#FF9900",
|
|
92
|
-
content: 2
|
|
93
|
-
},
|
|
94
|
-
];
|
|
95
|
-
|
|
96
|
-
const framePosition = ref({
|
|
97
|
-
x: 0,
|
|
98
|
-
y: 0,
|
|
99
|
-
width: 50,
|
|
100
|
-
height: 50
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
const direction = HORIZONTAL;
|
|
104
|
-
|
|
105
|
-
const imageUrl = borderImageUrl;
|
|
106
|
-
|
|
107
|
-
const _onFramePositionChanged = (new_x, new_y, new_width, new_height) => {
|
|
108
|
-
console.log(`new x=${new_x} y=${new_y} width=${new_width} height=${new_height}`);
|
|
109
|
-
|
|
110
|
-
framePosition.value = {
|
|
111
|
-
x: new_x,
|
|
112
|
-
y: new_y,
|
|
113
|
-
width: new_width,
|
|
114
|
-
height: new_height
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const _measures = (item)=>{
|
|
119
|
-
return {
|
|
120
|
-
width: item.blocks.w,
|
|
121
|
-
height: item.blocks.h,
|
|
122
|
-
marginRight: 10,
|
|
123
|
-
marginTop: 10,
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const _onKeyDown = (ev) => {
|
|
128
|
-
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
129
|
-
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
130
|
-
router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
131
|
-
return true;
|
|
132
|
-
}
|
|
133
|
-
return false;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const myFocusWidget = ref(null);
|
|
137
|
-
|
|
138
|
-
onMounted(()=>{
|
|
139
|
-
myFocusWidget.value.getFocusBlockRef().requestFocus();
|
|
140
|
-
jJsvRuntimeBridge.notifyPageLoaded();
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
</script>
|
|
144
|
-
<style scoped>
|
|
145
|
-
|
|
146
|
-
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, computed } from
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
3
|
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
data: Object,
|
|
@@ -11,7 +11,7 @@ const props = defineProps({
|
|
|
11
11
|
|
|
12
12
|
let focused = ref(false);
|
|
13
13
|
|
|
14
|
-
let styleValue = computed(()=>{
|
|
14
|
+
let styleValue = computed(() => {
|
|
15
15
|
return {
|
|
16
16
|
width: props.data.blocks.w,
|
|
17
17
|
height: props.data.blocks.h,
|
|
@@ -20,7 +20,7 @@ let styleValue = computed(()=>{
|
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
const onFocus = ()=>{
|
|
23
|
+
const onFocus = () => {
|
|
24
24
|
focused.value = true;
|
|
25
25
|
if (props.frameChanged) {
|
|
26
26
|
let pos = props.query.position(props.query.id);
|
|
@@ -33,25 +33,24 @@ const onFocus = ()=>{
|
|
|
33
33
|
|
|
34
34
|
props.frameChanged(new_x, new_y, new_width, new_height);
|
|
35
35
|
}
|
|
36
|
-
}
|
|
36
|
+
};
|
|
37
37
|
|
|
38
|
-
const onBlur = ()=>{
|
|
38
|
+
const onBlur = () => {
|
|
39
39
|
focused.value = false;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const onClicked = ()=>{
|
|
42
|
+
const onClicked = () => {
|
|
43
43
|
onsole.log(`item ${props.query.id} clicked`);
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
props.onAction.register("onFocus", onFocus);
|
|
47
47
|
props.onAction.register("onBlur", onBlur);
|
|
48
48
|
props.onAction.register("onClick", onClicked);
|
|
49
|
-
|
|
50
49
|
</script>
|
|
51
50
|
|
|
52
51
|
<template>
|
|
53
52
|
<div :class="focused ? 'focus' : 'blur'" :style="styleValue">
|
|
54
|
-
{{
|
|
53
|
+
{{ "" + props.data.content + (testData != null ? testData.MyName : "") }}
|
|
55
54
|
</div>
|
|
56
55
|
</template>
|
|
57
56
|
|
package/samples/Preload/App.vue
CHANGED
|
@@ -1,75 +1,78 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import {
|
|
1
|
+
<script setup>
|
|
2
|
+
import {
|
|
3
|
+
HORIZONTAL,
|
|
4
|
+
MetroWidget,
|
|
5
|
+
JsvPreload,
|
|
6
|
+
buildPreloadInfo,
|
|
7
|
+
buildDownloadInfo,
|
|
8
|
+
useFocusHub,
|
|
9
|
+
} from "jsview";
|
|
3
10
|
import awesome from "./images/awesomeface.png";
|
|
4
11
|
import cat from "./images/cat.jpg";
|
|
5
12
|
import { data } from "./data.js";
|
|
6
13
|
import Item from "./Item.vue";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
import { ref } from "vue";
|
|
15
|
+
import { useRouter } from "vue-router";
|
|
16
|
+
|
|
17
|
+
const name = "/preload";
|
|
18
|
+
const focusHub = useFocusHub();
|
|
19
|
+
const text = ref("");
|
|
20
|
+
let preloadInfo = [];
|
|
21
|
+
let downloadInfo = [];
|
|
22
|
+
const router = useRouter();
|
|
23
|
+
|
|
24
|
+
const _onPreloading = (percent) => {
|
|
25
|
+
console.log("preloading ", percent);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const _onPreloadDone = (imageInfo) => {
|
|
29
|
+
console.log("PRELOAD DONE!", imageInfo);
|
|
30
|
+
};
|
|
11
31
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
data,
|
|
17
|
-
name: "/preload",
|
|
18
|
-
text: "",
|
|
19
|
-
direction: HORIZONTAL,
|
|
20
|
-
awesome,
|
|
21
|
-
cat,
|
|
22
|
-
preloadInfo: [],
|
|
23
|
-
downloadInfo: [],
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
methods: {
|
|
27
|
-
_onPreloading(percent) {
|
|
28
|
-
console.log("preloading ", percent)
|
|
29
|
-
},
|
|
30
|
-
_onPreloadDone(imageInfo) {
|
|
31
|
-
console.log("PRELOAD DONE!", imageInfo);
|
|
32
|
-
},
|
|
33
|
-
_onDownloadDone() {
|
|
34
|
-
console.log("DOWNLOAD DONE!");
|
|
35
|
-
this.text = `图片下载完成\n${this.awesome}\n${this.cat}`;
|
|
36
|
-
},
|
|
37
|
-
_measures() {
|
|
38
|
-
return {
|
|
39
|
-
width: 180,
|
|
40
|
-
height: 90,
|
|
41
|
-
focusable: true,
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
_onKeyDown(ev) {
|
|
45
|
-
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
46
|
-
this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
47
|
-
}
|
|
48
|
-
return true;
|
|
49
|
-
},
|
|
50
|
-
_onFocus() {
|
|
51
|
-
this.$refs.focusNode.findBlockByName(this.name).requestFocus();
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
created() {
|
|
55
|
-
for (const item of this.data) {
|
|
56
|
-
this.preloadInfo.push(buildPreloadInfo(item.url));
|
|
57
|
-
this.preloadInfo.push(buildPreloadInfo(item.focusUrl));
|
|
58
|
-
}
|
|
59
|
-
this.preloadInfo.push(null); // 测试item为null的加载
|
|
60
|
-
this.downloadInfo = [
|
|
61
|
-
buildDownloadInfo(this.awesome),
|
|
62
|
-
buildDownloadInfo(this.cat),
|
|
63
|
-
buildDownloadInfo(null), // 测试URL为null的加载
|
|
64
|
-
];
|
|
65
|
-
},
|
|
32
|
+
const _onDownloadDone = (urls, extra) => {
|
|
33
|
+
console.log("DOWNLOAD DONE!", urls, extra);
|
|
34
|
+
text.value = `图片下载完成\n${awesome}\n${cat}`;
|
|
66
35
|
};
|
|
36
|
+
|
|
37
|
+
const _measures = () => {
|
|
38
|
+
return {
|
|
39
|
+
width: 180,
|
|
40
|
+
height: 90,
|
|
41
|
+
focusable: true,
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const _onKeyDown = (ev) => {
|
|
46
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
47
|
+
router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
48
|
+
}
|
|
49
|
+
return true;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const _onFocus = () => {
|
|
53
|
+
focusHub.setFocus(name);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
for (const item of data) {
|
|
57
|
+
preloadInfo.push(buildPreloadInfo(item.url));
|
|
58
|
+
preloadInfo.push(buildPreloadInfo(item.focusUrl));
|
|
59
|
+
}
|
|
60
|
+
preloadInfo.push(null); // 测试item为null的加载
|
|
61
|
+
downloadInfo = [
|
|
62
|
+
buildDownloadInfo(awesome, null, true),
|
|
63
|
+
buildDownloadInfo(cat, null, true),
|
|
64
|
+
buildDownloadInfo(null), // 测试URL为null的加载
|
|
65
|
+
];
|
|
67
66
|
</script>
|
|
68
67
|
|
|
69
68
|
<template>
|
|
70
69
|
<jsv-focus-block
|
|
71
|
-
ref="focusNode"
|
|
72
70
|
autoFocus
|
|
71
|
+
:style="{
|
|
72
|
+
width: 1920,
|
|
73
|
+
height: 1080,
|
|
74
|
+
backgroundColor: '#FFFFFF',
|
|
75
|
+
}"
|
|
73
76
|
:onAction="{
|
|
74
77
|
onKeyDown: _onKeyDown,
|
|
75
78
|
onFocus: _onFocus,
|
|
@@ -91,11 +94,11 @@ export default {
|
|
|
91
94
|
预加载后,图片(按钮焦点切换)切换不闪屏
|
|
92
95
|
</div>
|
|
93
96
|
<div :style="{ top: 200, left: 300 }">
|
|
94
|
-
<
|
|
97
|
+
<metro-widget
|
|
95
98
|
:name="name"
|
|
96
99
|
:width="540"
|
|
97
100
|
:height="90"
|
|
98
|
-
:direction="
|
|
101
|
+
:direction="HORIZONTAL"
|
|
99
102
|
:data="data"
|
|
100
103
|
:measures="_measures"
|
|
101
104
|
>
|
|
@@ -107,7 +110,7 @@ export default {
|
|
|
107
110
|
:onAction="onAction"
|
|
108
111
|
/>
|
|
109
112
|
</template>
|
|
110
|
-
</
|
|
113
|
+
</metro-widget>
|
|
111
114
|
</div>
|
|
112
115
|
<div
|
|
113
116
|
:style="{
|