@shijiu/jsview-vue 0.0.1-beta.0
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/docs/IMPORT_CHANGE_LOG.txt +3 -0
- package/docs/git_commit.md +15 -0
- package/docs/test_version_up.txt +1 -0
- package/dom/bin/jsview-dom-1.0.313.tgz +0 -0
- package/dom/browser-root-style.css +21 -0
- package/dom/jsv-browser-debug-dom.js +8 -0
- package/dom/jsv-dom.js +6 -0
- package/dom/jsv-forge-define.js +6 -0
- package/dom/target_core_revision.js +14 -0
- package/load/header_script_loader.js +134 -0
- package/load/jsview-main.js +42 -0
- package/load/jsview.config.default.js +37 -0
- package/load/jsview.default.config.js +37 -0
- package/load/loader.js +172 -0
- package/load/loader_webkit.js +40 -0
- package/package.json +27 -0
- package/patch/node_modules/@babel/preset-env/lib/available-plugins.js +219 -0
- package/patch/node_modules/@vue/cli-plugin-typescript/index.js +100 -0
- package/patch/node_modules/@vue/cli-service/lib/commands/serve.js +395 -0
- package/patch/node_modules/@vue/cli-service/lib/config/app.js +272 -0
- package/patch/node_modules/@vue/cli-service/lib/config/assets.js +70 -0
- package/patch/node_modules/@vue/cli-service/lib/config/base.js +212 -0
- package/patch/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +2566 -0
- package/patch/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js +274 -0
- package/patch/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +1596 -0
- package/patch/node_modules/postcss-js/objectifier.js +90 -0
- package/patch/node_modules/vue-loader/dist/resolveScript.js +70 -0
- package/patch/package-lock.json +30051 -0
- package/samples/AdvanceMetroWidget/App.vue +123 -0
- package/samples/AdvanceMetroWidget/Frame.vue +101 -0
- package/samples/AdvanceMetroWidget/Item.vue +58 -0
- package/samples/AdvanceMetroWidget/data.js +137 -0
- package/samples/AnimPicture/App.vue +224 -0
- package/samples/AnimPicture/assets/animated_webp.webp +0 -0
- package/samples/AnimPicture/assets/ball_3.webp +0 -0
- package/samples/AnimPicture/assets/girl_run.gif +0 -0
- package/samples/AnimPicture/assets/quan.webp +0 -0
- package/samples/Basic/App.vue +129 -0
- package/samples/Basic/assets/border.png +0 -0
- package/samples/Basic/assets/border2.png +0 -0
- package/samples/Basic/assets/icon.png +0 -0
- package/samples/Basic/assets/test.jpg +0 -0
- package/samples/Basic/components/ContentBlock.vue +36 -0
- package/samples/Basic/components/FontStyle.css +10 -0
- package/samples/Basic/components/TitleBar.vue +29 -0
- package/samples/Basic/components/anim/AnimGroup.vue +68 -0
- package/samples/Basic/components/anim/AnimKeyframeBasic.vue +102 -0
- package/samples/Basic/components/anim/AnimKeyframeComposite.vue +53 -0
- package/samples/Basic/components/anim/AnimTransition.vue +116 -0
- package/samples/Basic/components/div/DivBackground.vue +15 -0
- package/samples/Basic/components/div/DivClip.vue +81 -0
- package/samples/Basic/components/div/DivCssScoped.vue +27 -0
- package/samples/Basic/components/div/DivCssVar.vue +50 -0
- package/samples/Basic/components/div/DivGroup1.vue +33 -0
- package/samples/Basic/components/div/DivGroup2.vue +41 -0
- package/samples/Basic/components/div/DivLayout.vue +12 -0
- package/samples/Basic/components/div/DivRadius.vue +47 -0
- package/samples/Basic/components/text/TextAlign.vue +48 -0
- package/samples/Basic/components/text/TextFontStyle.vue +58 -0
- package/samples/Basic/components/text/TextGroup.vue +32 -0
- package/samples/Basic/components/text/TextOverflow.vue +78 -0
- package/samples/BasicFocusControl/App.vue +125 -0
- package/samples/BasicFocusControl/components/BaseBlock.vue +51 -0
- package/samples/BasicFocusControl/components/MainArea.vue +98 -0
- package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +21 -0
- package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +30 -0
- package/samples/BasicFocusControl/components/SideBar.vue +73 -0
- package/samples/BasicFocusControl/components/SideBarBlock.vue +30 -0
- package/samples/ClassNameDemo/App.vue +119 -0
- package/samples/ClassNameDemo/assets/bg.jpg +0 -0
- package/samples/ClassNameDemo/assets/coupon_content.png +0 -0
- package/samples/ClassNameDemo/assets/coupon_left.png +0 -0
- package/samples/ClassNameDemo/assets/coupon_mid.png +0 -0
- package/samples/ClassNameDemo/assets/coupon_right.png +0 -0
- package/samples/ClassNameDemo/assets/focus_border.png +0 -0
- package/samples/ClassNameDemo/assets/holder_logo.png +0 -0
- package/samples/ClassNameDemo/assets/jrbm.png +0 -0
- package/samples/ClassNameDemo/assets/line_left.png +0 -0
- package/samples/ClassNameDemo/assets/line_mid.png +0 -0
- package/samples/ClassNameDemo/assets/line_right.png +0 -0
- package/samples/ClassNameDemo/assets/loading.png +0 -0
- package/samples/ClassNameDemo/assets/logo.png +0 -0
- package/samples/ClassNameDemo/assets/mcjx.png +0 -0
- package/samples/ClassNameDemo/assets/tao.png +0 -0
- package/samples/ClassNameDemo/assets/tmall.png +0 -0
- package/samples/ClassNameDemo/components/ContentItem.vue +253 -0
- package/samples/ClassNameDemo/components/LoadingView.vue +43 -0
- package/samples/ClassNameDemo/components/TitleView.vue +24 -0
- package/samples/ClassNameDemo/data.js +24 -0
- package/samples/ColorSpace/App.vue +135 -0
- package/samples/ColorSpace/bmpDemo.bmp +0 -0
- package/samples/ColorSpace/jpegDemo.jpeg +0 -0
- package/samples/ColorSpace/pngDemo.png +0 -0
- package/samples/ColorSpace/pngNoAlphaDemo.png +0 -0
- package/samples/DemoHomepage/App.vue +31 -0
- package/samples/DemoHomepage/components/BodyFrame.vue +82 -0
- package/samples/DemoHomepage/components/Dialog.vue +94 -0
- package/samples/DemoHomepage/components/Item.vue +77 -0
- package/samples/DemoHomepage/components/TabFrame.vue +86 -0
- package/samples/DemoHomepage/router.js +132 -0
- package/samples/DemoHomepage/views/Homepage.vue +186 -0
- package/samples/FlipCard/App.vue +80 -0
- package/samples/FlipCard/FlipCard.vue +124 -0
- package/samples/FlipCard/assets/blue_egg.png +0 -0
- package/samples/FlipCard/assets/red_egg.png +0 -0
- package/samples/FlipCard/data.js +13 -0
- package/samples/FlowMultiWidget/App.vue +91 -0
- package/samples/FlowMultiWidget/assets/nine_patch_focus.png +0 -0
- package/samples/FlowMultiWidget/components/Block.vue +107 -0
- package/samples/FlowMultiWidget/components/FlowPage.vue +60 -0
- package/samples/FlowMultiWidget/components/Item.vue +103 -0
- package/samples/FlowMultiWidget/components/MenuItem.vue +72 -0
- package/samples/FlowMultiWidget/components/MyMenu.vue +90 -0
- package/samples/FlowMultiWidget/data.js +446 -0
- package/samples/HashHistory/App.vue +124 -0
- package/samples/HashHistory/components/HorizontalButtonList.vue +114 -0
- package/samples/HashHistory/components/Item.vue +74 -0
- package/samples/HashHistory/router.js +30 -0
- package/samples/HashHistory/views/BasePage.vue +19 -0
- package/samples/HashHistory/views/MainPage.vue +68 -0
- package/samples/HashHistory/views/SubPage.vue +79 -0
- package/samples/HashHistory/views/SubPageFirst.vue +10 -0
- package/samples/HashHistory/views/SubPageSecond.vue +10 -0
- package/samples/LongImage/App.vue +96 -0
- package/samples/LongImage/Button.vue +153 -0
- package/samples/LongImage/LongImageScroll.vue +127 -0
- package/samples/LongImage/Scroll.vue +16 -0
- package/samples/LongImage/assets/1280x7200.jpg +0 -0
- package/samples/LongText/App.vue +111 -0
- package/samples/LongText/Button.vue +153 -0
- package/samples/LongText/LongTextScroll.vue +225 -0
- package/samples/LongText/Scroll.vue +16 -0
- package/samples/Preload/App.vue +146 -0
- package/samples/Preload/data.js +23 -0
- package/samples/Preload/images/awesomeface.png +0 -0
- package/samples/Preload/images/cat.jpg +0 -0
- package/samples/Preload/images/rank.png +0 -0
- package/samples/Preload/images/rank_focus.png +0 -0
- package/samples/Preload/images/rule.png +0 -0
- package/samples/Preload/images/rule_focus.png +0 -0
- package/samples/Preload/images/start.png +0 -0
- package/samples/Preload/images/start_focus.png +0 -0
- package/samples/Preload/preloadItem.vue +22 -0
- package/samples/QrcodeDemo/App.vue +73 -0
- package/samples/SimpleWidgetDemo/App.vue +204 -0
- package/samples/SimpleWidgetDemo/Item.vue +83 -0
- 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/border.png +0 -0
- package/samples/SimpleWidgetDemo/components/ContentItem.vue +412 -0
- package/samples/SimpleWidgetDemo/components/MyTab.vue +117 -0
- package/samples/SimpleWidgetDemo/data.js +110 -0
- package/samples/SprayView/App.vue +270 -0
- package/samples/SprayView/assets/snow.png +0 -0
- package/samples/SpriteImage/App.vue +174 -0
- package/samples/SpriteImage/images/cat_run.png +0 -0
- package/samples/SpriteImage/images/egg_break.json +116 -0
- package/samples/SpriteImage/images/egg_break.png +0 -0
- package/samples/SpriteImage/images/sprite.png +0 -0
- package/samples/TextBox/App.vue +179 -0
- package/samples/TextBox/RenderCenter.vue +109 -0
- package/samples/TextBox/RenderLeft.vue +109 -0
- package/samples/TextBox/RenderOneLine.vue +120 -0
- package/samples/TextBox/RenderRight.vue +107 -0
- package/samples/TextShadowDemo/App.vue +98 -0
- package/samples/TextureSize/App.vue +142 -0
- package/samples/TextureSize/bmpDemo.bmp +0 -0
- package/samples/TextureSize/jpegDemo.jpeg +0 -0
- package/samples/TextureSize/jpgDemo.jpg +0 -0
- package/samples/TextureSize/pngDemo.png +0 -0
- package/samples/TextureSize/pngNoAlphaDemo.png +0 -0
- package/samples/ThrowMoveDemo/AccelerateDemo.vue +118 -0
- package/samples/ThrowMoveDemo/App.vue +114 -0
- package/samples/ThrowMoveDemo/LRParabolicDemo.vue +116 -0
- package/samples/ThrowMoveDemo/TargetDemo.vue +117 -0
- package/samples/ThrowMoveDemo/UDParabolicDemo.vue +122 -0
- package/samples/TransitPage/App.vue +41 -0
- package/samples/VideoDemo/App.vue +137 -0
- package/samples/VideoDemo/components/Button.vue +69 -0
- package/samples/VideoDemo/components/Controllor.vue +195 -0
- package/samples/VideoDemo/components/VideoFrame.vue +152 -0
- package/scripts/git-commit-empty.js +21 -0
- package/scripts/install-local-packages.js +121 -0
- package/scripts/make-js.sh +181 -0
- package/scripts/post-build.js +132 -0
- package/scripts/post-install.js +127 -0
- package/scripts/pre-pack.js +2 -0
- package/scripts/run-android.js +64 -0
- package/utils/JsViewEngineWidget/bin/shijiu-jsview-vue-widget-1.0.1.tgz +0 -0
- package/utils/JsViewEngineWidget/index.d.ts +32 -0
- package/utils/JsViewEngineWidget/index.js +6 -0
- package/utils/JsViewVueTools/DebugContentShellJBridge.js +16 -0
- package/utils/JsViewVueTools/DebugTool.js +21 -0
- package/utils/JsViewVueTools/DefaultKeyMap.js +12 -0
- package/utils/JsViewVueTools/JsvDynamicCssStyle.js +73 -0
- package/utils/JsViewVueTools/JsvDynamicKeyFrames.js +128 -0
- package/utils/JsViewVueTools/JsvHashHistory.js +112 -0
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +417 -0
- package/utils/JsViewVueTools/JsvStyleClass.js +290 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +80 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +148 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +55 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/ApicDataBase.js +29 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/BrowserApic.vue +124 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/GifData.js +83 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/LoopToolBase.js +25 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/NormalLoopTool.js +61 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/PartLoopTool.js +119 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/Viewer.js +106 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/WebpData.js +141 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/WidgetLoader.js +20 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/WidgetWrapper.js +11 -0
- package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +204 -0
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +64 -0
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +427 -0
- package/utils/JsViewVueWidget/JsvActorMove/index.js +12 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +179 -0
- package/utils/JsViewVueWidget/JsvApic/index.js +17 -0
- package/utils/JsViewVueWidget/JsvMarquee.vue +197 -0
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +92 -0
- package/utils/JsViewVueWidget/JsvNinePatch.vue +76 -0
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +351 -0
- package/utils/JsViewVueWidget/JsvPreload/index.js +21 -0
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +140 -0
- package/utils/JsViewVueWidget/JsvQrcode/index.js +18 -0
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +140 -0
- package/utils/JsViewVueWidget/JsvSpray/index.js +15 -0
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +448 -0
- package/utils/JsViewVueWidget/JsvSpriteAnim/SpriteController.js +57 -0
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +6 -0
- package/utils/JsViewVueWidget/JsvSwiper/Indicator.vue +35 -0
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +495 -0
- package/utils/JsViewVueWidget/JsvSwiper/index.js +10 -0
- package/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue +35 -0
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +404 -0
- package/utils/JsViewVueWidget/JsvSwiper3D/index.js +10 -0
- package/utils/JsViewVueWidget/JsvTextBox.vue +111 -0
- package/utils/JsViewVueWidget/JsvVideo.vue +36 -0
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2021-11-23 09:42:26
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2021-11-29 11:04:37
|
|
6
|
+
* @Description: file content
|
|
7
|
+
-->
|
|
8
|
+
<script>
|
|
9
|
+
import Indicator from "./Indicator.vue";
|
|
10
|
+
import { ref } from "vue";
|
|
11
|
+
|
|
12
|
+
const VIEW_NUM = 4;
|
|
13
|
+
|
|
14
|
+
function modToRange(value, mod, start = 0) {
|
|
15
|
+
let m = value % mod;
|
|
16
|
+
if (m < start) {
|
|
17
|
+
m += mod;
|
|
18
|
+
} else if (m >= start + mod) {
|
|
19
|
+
m -= mod;
|
|
20
|
+
}
|
|
21
|
+
return m;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
window.modToRange = modToRange;
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
components: { Indicator },
|
|
28
|
+
props: {
|
|
29
|
+
showIndicator: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: true,
|
|
32
|
+
},
|
|
33
|
+
dotSize: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 10,
|
|
36
|
+
},
|
|
37
|
+
dotGap: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: 10,
|
|
40
|
+
},
|
|
41
|
+
indicatorPos: {
|
|
42
|
+
type: Number,
|
|
43
|
+
default: -1,
|
|
44
|
+
},
|
|
45
|
+
indicatorAlign: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "middle",
|
|
48
|
+
},
|
|
49
|
+
totalFrame: {
|
|
50
|
+
type: Number,
|
|
51
|
+
require: true,
|
|
52
|
+
},
|
|
53
|
+
firstFrame: {
|
|
54
|
+
type: Number,
|
|
55
|
+
default: 0,
|
|
56
|
+
},
|
|
57
|
+
layoutInfo: {
|
|
58
|
+
type: Object,
|
|
59
|
+
require: true,
|
|
60
|
+
},
|
|
61
|
+
onClick: {
|
|
62
|
+
type: Function,
|
|
63
|
+
},
|
|
64
|
+
onChange: {
|
|
65
|
+
type: Function,
|
|
66
|
+
},
|
|
67
|
+
scale: {
|
|
68
|
+
type: Number,
|
|
69
|
+
default: 1.0,
|
|
70
|
+
},
|
|
71
|
+
autoplayInterval: {
|
|
72
|
+
type: Number,
|
|
73
|
+
default: 5000,
|
|
74
|
+
},
|
|
75
|
+
animation: {
|
|
76
|
+
type: Object,
|
|
77
|
+
default() {
|
|
78
|
+
return {
|
|
79
|
+
duration: 200,
|
|
80
|
+
easing: "linear",
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
vertical: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: false,
|
|
87
|
+
},
|
|
88
|
+
name: {
|
|
89
|
+
type: String,
|
|
90
|
+
},
|
|
91
|
+
onFocus: {
|
|
92
|
+
type: Function,
|
|
93
|
+
},
|
|
94
|
+
onBlur: {
|
|
95
|
+
type: Function,
|
|
96
|
+
},
|
|
97
|
+
backgroundImage: {
|
|
98
|
+
type: String,
|
|
99
|
+
},
|
|
100
|
+
backgroundColor: {
|
|
101
|
+
type: String,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
computed: {
|
|
105
|
+
indicatorLayout() {
|
|
106
|
+
let indicatorSize =
|
|
107
|
+
this.totalFrame * (this.dotSize + this.dotGap) - this.dotGap;
|
|
108
|
+
if (this.vertical) {
|
|
109
|
+
let top;
|
|
110
|
+
if (this.indicatorAlign === "start") {
|
|
111
|
+
top = this.dotGap;
|
|
112
|
+
} else if (this.indicatorAlign === "end") {
|
|
113
|
+
top = this.layoutInfo.widgetHeight - indicatorSize - this.dotGap;
|
|
114
|
+
} else {
|
|
115
|
+
top = (this.layoutInfo.widgetHeight - indicatorSize) / 2;
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
left:
|
|
119
|
+
this.indicatorPos < 0
|
|
120
|
+
? this.layoutInfo.widgetWidth * 0.8
|
|
121
|
+
: this.indicatorPos,
|
|
122
|
+
top,
|
|
123
|
+
zIndex: 1,
|
|
124
|
+
};
|
|
125
|
+
} else {
|
|
126
|
+
let left;
|
|
127
|
+
if (this.indicatorAlign === "start") {
|
|
128
|
+
left = this.dotGap;
|
|
129
|
+
} else if (this.indicatorAlign === "end") {
|
|
130
|
+
left = this.layoutInfo.widgetWidth - indicatorSize - this.dotGap;
|
|
131
|
+
} else {
|
|
132
|
+
left = (this.layoutInfo.widgetWidth - indicatorSize) / 2;
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
left,
|
|
136
|
+
top:
|
|
137
|
+
this.indicatorPos < 0
|
|
138
|
+
? this.layoutInfo.widgetHeight * 0.8
|
|
139
|
+
: this.indicatorPos,
|
|
140
|
+
zIndex: 1,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
indicatorDotSize() {
|
|
145
|
+
return this.dotSize + this.dotGap;
|
|
146
|
+
},
|
|
147
|
+
currentDataIndex() {
|
|
148
|
+
return modToRange(this.firstFrame + this.offset, this.totalFrame);
|
|
149
|
+
},
|
|
150
|
+
currentViewIndex() {
|
|
151
|
+
return modToRange(this.offset + (VIEW_NUM / 2 - 1), VIEW_NUM);
|
|
152
|
+
},
|
|
153
|
+
viewInfoList() {
|
|
154
|
+
let layoutInfo = this.layoutInfo;
|
|
155
|
+
let currentLeft =
|
|
156
|
+
(this.layoutInfo.widgetWidth - this.layoutInfo.frameWidth) / 2;
|
|
157
|
+
let currentTop =
|
|
158
|
+
(this.layoutInfo.widgetHeight - this.layoutInfo.frameHeight) / 2;
|
|
159
|
+
let duration = this.animation.duration / 1000;
|
|
160
|
+
let easing = this.animation.easing ? this.animation.easing : "linear";
|
|
161
|
+
let styleList = [
|
|
162
|
+
{
|
|
163
|
+
layout: {
|
|
164
|
+
top: currentTop + (this.vertical ? -layoutInfo.deltaPos : 0),
|
|
165
|
+
left: currentLeft + (this.vertical ? 0 : -layoutInfo.deltaPos),
|
|
166
|
+
zIndex: this.offset - this.preOffset > 0 ? 3 : 1,
|
|
167
|
+
transition: `left ${duration}s ${easing}, top ${duration}s ${easing}`,
|
|
168
|
+
},
|
|
169
|
+
transform: {
|
|
170
|
+
transform: `scale3d(${this.scale}, ${this.scale}, 1.0)`,
|
|
171
|
+
width: this.layoutInfo.frameWidth,
|
|
172
|
+
height: this.layoutInfo.frameHeight,
|
|
173
|
+
transition: `transform ${duration}s ${easing}`,
|
|
174
|
+
},
|
|
175
|
+
} /*左副位*/,
|
|
176
|
+
{
|
|
177
|
+
layout: {
|
|
178
|
+
top: currentTop,
|
|
179
|
+
left: currentLeft,
|
|
180
|
+
zIndex: 4,
|
|
181
|
+
transition: `left ${duration}s ${easing}, top ${duration}s ${easing}`,
|
|
182
|
+
},
|
|
183
|
+
transform: {
|
|
184
|
+
transform: "scale3d(1.0, 1.0, 1.0)",
|
|
185
|
+
width: this.layoutInfo.frameWidth,
|
|
186
|
+
height: this.layoutInfo.frameHeight,
|
|
187
|
+
transition: `transform ${duration}s ${easing}`,
|
|
188
|
+
},
|
|
189
|
+
} /*主位*/,
|
|
190
|
+
{
|
|
191
|
+
layout: {
|
|
192
|
+
top: currentTop + (this.vertical ? layoutInfo.deltaPos : 0),
|
|
193
|
+
left: currentLeft + (this.vertical ? 0 : layoutInfo.deltaPos),
|
|
194
|
+
zIndex: this.offset - this.preOffset > 0 ? 1 : 3,
|
|
195
|
+
transition: `left ${duration}s ${easing}, top ${duration}s ${easing}`,
|
|
196
|
+
},
|
|
197
|
+
transform: {
|
|
198
|
+
transform: `scale3d(${this.scale}, ${this.scale}, 1.0)`,
|
|
199
|
+
width: this.layoutInfo.frameWidth,
|
|
200
|
+
height: this.layoutInfo.frameHeight,
|
|
201
|
+
transition: `transform ${duration}s ${easing}`,
|
|
202
|
+
},
|
|
203
|
+
} /*右副位*/,
|
|
204
|
+
{
|
|
205
|
+
layout: {
|
|
206
|
+
top: currentTop,
|
|
207
|
+
left: currentLeft,
|
|
208
|
+
zIndex: 0,
|
|
209
|
+
transition: `left ${duration}s ${easing}, top ${duration}s ${easing}`,
|
|
210
|
+
},
|
|
211
|
+
transform: {
|
|
212
|
+
transform: `scale3d(${this.scale}, ${this.scale}, 1.0)`,
|
|
213
|
+
width: this.layoutInfo.frameWidth,
|
|
214
|
+
height: this.layoutInfo.frameHeight,
|
|
215
|
+
transition: `transform ${duration}s ${easing}`,
|
|
216
|
+
},
|
|
217
|
+
} /*隐藏位*/,
|
|
218
|
+
];
|
|
219
|
+
let viewList = [];
|
|
220
|
+
for (let i = 0; i < VIEW_NUM; i++) {
|
|
221
|
+
viewList.push({
|
|
222
|
+
dataIndex: modToRange(
|
|
223
|
+
this.currentDataIndex +
|
|
224
|
+
modToRange(i - this.currentViewIndex, VIEW_NUM, -1),
|
|
225
|
+
this.totalFrame
|
|
226
|
+
),
|
|
227
|
+
style: styleList[modToRange(i - this.offset, VIEW_NUM)],
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
return viewList;
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
setup() {
|
|
234
|
+
let preOffset = -1;
|
|
235
|
+
let offset = ref(0);
|
|
236
|
+
let focused = ref(false);
|
|
237
|
+
let intervalHandler = -1;
|
|
238
|
+
return {
|
|
239
|
+
preOffset,
|
|
240
|
+
offset,
|
|
241
|
+
focused,
|
|
242
|
+
intervalHandler,
|
|
243
|
+
};
|
|
244
|
+
},
|
|
245
|
+
watch: {
|
|
246
|
+
offset(newValue) {
|
|
247
|
+
this.onChange?.(modToRange(this.firstFrame + newValue, this.totalFrame));
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
methods: {
|
|
251
|
+
_onKeyDown(ev) {
|
|
252
|
+
switch (ev.keyCode) {
|
|
253
|
+
case 37:
|
|
254
|
+
if (!this.vertical) {
|
|
255
|
+
this.preOffset = this.offset;
|
|
256
|
+
this.offset = this.offset - 1;
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
259
|
+
break;
|
|
260
|
+
case 38:
|
|
261
|
+
if (this.vertical) {
|
|
262
|
+
this.preOffset = this.offset;
|
|
263
|
+
this.offset = this.offset - 1;
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
266
|
+
break;
|
|
267
|
+
case 39:
|
|
268
|
+
if (!this.vertical) {
|
|
269
|
+
this.preOffset = this.offset;
|
|
270
|
+
this.offset = this.offset + 1;
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
break;
|
|
274
|
+
case 40:
|
|
275
|
+
if (this.vertical) {
|
|
276
|
+
this.preOffset = this.offset;
|
|
277
|
+
this.offset = this.offset + 1;
|
|
278
|
+
return true;
|
|
279
|
+
}
|
|
280
|
+
break;
|
|
281
|
+
case 13:
|
|
282
|
+
this.onClick?.();
|
|
283
|
+
return true;
|
|
284
|
+
default:
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return false;
|
|
289
|
+
},
|
|
290
|
+
_enableAutoplay() {
|
|
291
|
+
if (this.autoplayInterval > 0) {
|
|
292
|
+
this.intervalHandler = setInterval(() => {
|
|
293
|
+
this.preOffset = this.offset;
|
|
294
|
+
this.offset = this.offset + 1;
|
|
295
|
+
}, this.autoplayInterval);
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
_onFocus() {
|
|
299
|
+
this.focused = true;
|
|
300
|
+
clearInterval(this.intervalHandler);
|
|
301
|
+
this.onFocus?.();
|
|
302
|
+
},
|
|
303
|
+
_onBlur() {
|
|
304
|
+
this.focused = false;
|
|
305
|
+
this._enableAutoplay();
|
|
306
|
+
this.onBlur?.();
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
created() {
|
|
310
|
+
this._enableAutoplay();
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
</script>
|
|
314
|
+
|
|
315
|
+
<template>
|
|
316
|
+
<jsv-focus-block
|
|
317
|
+
:name="name"
|
|
318
|
+
:onAction="{
|
|
319
|
+
onFocus: _onFocus,
|
|
320
|
+
onBlur: _onBlur,
|
|
321
|
+
onKeyDown: _onKeyDown,
|
|
322
|
+
}"
|
|
323
|
+
>
|
|
324
|
+
<div
|
|
325
|
+
:style="{
|
|
326
|
+
width: layoutInfo.widgetWidth,
|
|
327
|
+
height: layoutInfo.widgetHeight,
|
|
328
|
+
overflow: 'hidden',
|
|
329
|
+
}"
|
|
330
|
+
>
|
|
331
|
+
<div :style="{ zIndex: 0 }">
|
|
332
|
+
<div
|
|
333
|
+
v-if="backgroundImage || backgroundColor"
|
|
334
|
+
:style="{
|
|
335
|
+
width: layoutInfo.widgetWidth,
|
|
336
|
+
height: layoutInfo.widgetHeight,
|
|
337
|
+
zIndex: 2,
|
|
338
|
+
backgroundImage,
|
|
339
|
+
backgroundColor,
|
|
340
|
+
}"
|
|
341
|
+
/>
|
|
342
|
+
<div
|
|
343
|
+
v-for="(item, index) in viewInfoList"
|
|
344
|
+
:key="index"
|
|
345
|
+
:style="item.style.layout"
|
|
346
|
+
>
|
|
347
|
+
<div :style="item.style.transform">
|
|
348
|
+
<slot
|
|
349
|
+
name="itemView"
|
|
350
|
+
:currentIndex="currentDataIndex"
|
|
351
|
+
:dataIndex="item.dataIndex"
|
|
352
|
+
:focused="focused"
|
|
353
|
+
></slot>
|
|
354
|
+
<!-- <div
|
|
355
|
+
:style="{
|
|
356
|
+
width: 50,
|
|
357
|
+
height: 50,
|
|
358
|
+
top: 50,
|
|
359
|
+
fontSize: '30px',
|
|
360
|
+
color: '#FF0000'
|
|
361
|
+
}"
|
|
362
|
+
>
|
|
363
|
+
{{ index }}
|
|
364
|
+
</div> -->
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
367
|
+
</div>
|
|
368
|
+
|
|
369
|
+
<div v-if="showIndicator" :style="indicatorLayout">
|
|
370
|
+
<indicator
|
|
371
|
+
:number="totalFrame"
|
|
372
|
+
:current="currentDataIndex"
|
|
373
|
+
:itemSize="indicatorDotSize"
|
|
374
|
+
:vertical="vertical"
|
|
375
|
+
>
|
|
376
|
+
<template #current>
|
|
377
|
+
<slot name="indicatorCur">
|
|
378
|
+
<div
|
|
379
|
+
:style="{
|
|
380
|
+
width: 10,
|
|
381
|
+
height: 10,
|
|
382
|
+
backgroundColor: 'rgba(50, 50, 50, 1.0)',
|
|
383
|
+
borderRadius: '5px',
|
|
384
|
+
}"
|
|
385
|
+
></div>
|
|
386
|
+
</slot>
|
|
387
|
+
</template>
|
|
388
|
+
<template #normal>
|
|
389
|
+
<slot name="indicatorNor">
|
|
390
|
+
<div
|
|
391
|
+
:style="{
|
|
392
|
+
width: 10,
|
|
393
|
+
height: 10,
|
|
394
|
+
backgroundColor: 'rgba(100, 100, 100, 0.7)',
|
|
395
|
+
borderRadius: '5px',
|
|
396
|
+
}"
|
|
397
|
+
></div>
|
|
398
|
+
</slot>
|
|
399
|
+
</template>
|
|
400
|
+
</indicator>
|
|
401
|
+
</div>
|
|
402
|
+
</div>
|
|
403
|
+
</jsv-focus-block>
|
|
404
|
+
</template>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* Created by chunfeng.luo@qcast.cn on 10/13/20.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* JsvTextBox:Vue高阶组件,文字的垂直对齐方式显示控件
|
|
7
|
+
* props说明:
|
|
8
|
+
* verticalAlign {string} 垂直对齐方式 (必需) top、middle、bottom
|
|
9
|
+
* stylesList {array} 布局样式(必需),数组中可包含样式对象或者JsvStyleClass,或者JsvTextStyleClass对象,
|
|
10
|
+
* 样式对象内容为{left:0, top:0, width:xxx, height:xxx},
|
|
11
|
+
* 布局样式为数组中所有样式的合并。
|
|
12
|
+
* styleToken {string} 类似于react html元素的key,当style变化时,由使用者改变此Token通知hoc进行style重新识别。
|
|
13
|
+
* Token不变的场景,props变化不会引起render,以提高渲染性能
|
|
14
|
+
* enableLatex {bool} 是否启用Latex文字描画模式
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import {
|
|
19
|
+
JsvTextStyleClass,
|
|
20
|
+
combinedStyles,
|
|
21
|
+
} from "jsview/utils/JsViewVueTools/JsvStyleClass.js";
|
|
22
|
+
|
|
23
|
+
let sAreaAlignStyleMap = new Map();
|
|
24
|
+
export default {
|
|
25
|
+
props: {
|
|
26
|
+
styleToken: String,
|
|
27
|
+
stylesList: Object,
|
|
28
|
+
verticalAlign: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "middle",
|
|
31
|
+
},
|
|
32
|
+
lineAlign: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "middle",
|
|
35
|
+
},
|
|
36
|
+
enableLatex: Boolean,
|
|
37
|
+
},
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
styleCombined: null,
|
|
41
|
+
styleClasses: null,
|
|
42
|
+
tokenProcesses: null,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
beforeMount() {
|
|
46
|
+
if (this.styleToken !== this.tokenProcesses) {
|
|
47
|
+
// Token变化时,重新解析style array
|
|
48
|
+
const style_set = combinedStyles(
|
|
49
|
+
this.stylesList,
|
|
50
|
+
!window.JsvDisableReactWrapper // 无ReactWrapper时,全解析style属性
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
this.styleCombined = style_set.combinedStyle;
|
|
54
|
+
// console.log("styleCombined = ", this.styleCombined);
|
|
55
|
+
if (!window.JsvDisableReactWrapper) {
|
|
56
|
+
this.styleClasses = style_set.combinedClass;
|
|
57
|
+
let key = this.verticalAlign + "_" + this.lineAlign;
|
|
58
|
+
if (!sAreaAlignStyleMap.has(key)) {
|
|
59
|
+
const text_class = new JsvTextStyleClass({});
|
|
60
|
+
text_class.setVerticalAlign(this.verticalAlign);
|
|
61
|
+
text_class.setLineAlign(this.lineAlign);
|
|
62
|
+
sAreaAlignStyleMap.set(key, text_class);
|
|
63
|
+
}
|
|
64
|
+
const va_set_class = sAreaAlignStyleMap.get(key);
|
|
65
|
+
if (this.styleClasses.length === 0) {
|
|
66
|
+
this.styleClasses += va_set_class.getName();
|
|
67
|
+
} else {
|
|
68
|
+
this.styleClasses = this.styleClasses + " " + va_set_class.getName();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
this.tokenProcesses = this.styleToken;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
methods: {
|
|
75
|
+
isJsvDisableReactWrapper() {
|
|
76
|
+
if (window.JsvDisableReactWrapper) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<template>
|
|
86
|
+
<div>
|
|
87
|
+
<div v-if="isJsvDisableReactWrapper()" :style="styleCombined">
|
|
88
|
+
<div :style="{ position: 'static', display: 'table' }">
|
|
89
|
+
<div
|
|
90
|
+
:style="{
|
|
91
|
+
position: 'static',
|
|
92
|
+
display: 'table-cell',
|
|
93
|
+
width: styleCombined.width,
|
|
94
|
+
height: styleCombined.height,
|
|
95
|
+
verticalAlign: verticalAlign,
|
|
96
|
+
}"
|
|
97
|
+
>
|
|
98
|
+
<slot></slot>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
<div
|
|
103
|
+
v-else
|
|
104
|
+
:className="styleClasses"
|
|
105
|
+
:style="{ ...styleCombined }"
|
|
106
|
+
:jsv_text_latex_enable="enableLatex ? 'true' : ''"
|
|
107
|
+
>
|
|
108
|
+
<slot></slot>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/*
|
|
3
|
+
* JsvVideo:Vue高阶组件,包装<video>标签,添加离屏模式这种可以支持圆角和旋转效果,但绘制性能略有焦点的特效
|
|
4
|
+
* props说明:
|
|
5
|
+
* usetexture {bool} 是否使用texture即离屏模式,true:使用离屏模式,false:使用普通video
|
|
6
|
+
* videoref {object} (必须) video 句柄,对video进行播控
|
|
7
|
+
* 特别说明:
|
|
8
|
+
* 其他属性同video标签
|
|
9
|
+
*/
|
|
10
|
+
-->
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { Options, Vue } from "vue-class-component";
|
|
14
|
+
|
|
15
|
+
@Options({
|
|
16
|
+
props: {
|
|
17
|
+
onRef: { type: Function, default: () => {} },
|
|
18
|
+
useTexture: { type: Boolean, default: false },
|
|
19
|
+
autoplay: { type: String, default: undefined },
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
class JsvVideo extends Vue {
|
|
23
|
+
constructor(props) {
|
|
24
|
+
super(props);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default JsvVideo;
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<video :ref="onRef" :jsv-media-usetexture="useTexture" v-bind="$attrs"/>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<style scoped>
|
|
36
|
+
</style>
|