@shijiu/jsview-vue 0.9.490 → 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 +20 -6
- 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 +33 -34
- 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/NinePatchDemo/assets/border.png +0 -0
- 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-build.js +6 -1
- 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 +1557 -1656
- package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.js +136 -0
- package/utils/JsViewEngineWidget/MetroWidget/ToolFunctions.js +18 -0
- package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +2 -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 +284 -57
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +5 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +25 -12
- 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 +25 -10
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/BrowserApic.vue +1 -1
- package/utils/JsViewVueWidget/JsvFilterView.vue +59 -51
- package/utils/JsViewVueWidget/JsvGrid.vue +140 -42
- 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 +13 -4
- 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
|
@@ -47,19 +47,14 @@ export default {
|
|
|
47
47
|
// 通过内置函数构造定制的NativeSharedView
|
|
48
48
|
this.jsvMainView = new Forge.NativeSharedView(textureSetting);
|
|
49
49
|
this.innerViewId = ForgeExtension.RootActivity.ViewStore.add(
|
|
50
|
-
new Forge.ViewInfo(this.jsvMainView
|
|
50
|
+
new Forge.ViewInfo(this.jsvMainView)
|
|
51
51
|
);
|
|
52
52
|
|
|
53
53
|
// 更新宽高
|
|
54
54
|
if(typeof this.jsvMainView!="undefined" && this.jsvMainView){
|
|
55
|
-
this.jsvMainView.ResetLayoutParams({
|
|
56
|
-
width: this.style.width,
|
|
57
|
-
height: this.style.height,
|
|
58
|
-
});
|
|
59
|
-
|
|
60
55
|
if (this.setId) {
|
|
61
56
|
// 使用设置进来的track id,而非自动生成
|
|
62
|
-
this.jsvMainView.SetTrackId();
|
|
57
|
+
this.jsvMainView.SetTrackId(this.setId);
|
|
63
58
|
}
|
|
64
59
|
|
|
65
60
|
this.getId?.(this.jsvMainView.GetTrackId());
|
|
@@ -77,21 +72,17 @@ export default {
|
|
|
77
72
|
this.jsvMainView = null;
|
|
78
73
|
}
|
|
79
74
|
},
|
|
80
|
-
updated() {
|
|
81
|
-
// 更新宽高
|
|
82
|
-
if(typeof this.jsvMainView!="undefined" && this.jsvMainView){
|
|
83
|
-
this.jsvMainView.ResetLayoutParams({
|
|
84
|
-
width: this.style.width,
|
|
85
|
-
height: this.style.height,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
75
|
};
|
|
90
76
|
</script>
|
|
91
77
|
|
|
92
78
|
<template>
|
|
93
79
|
<div v-if="!isBrowserDebug"
|
|
94
|
-
:style="{
|
|
80
|
+
:style="{
|
|
81
|
+
left: style.left,
|
|
82
|
+
top: style.top,
|
|
83
|
+
width: style.width,
|
|
84
|
+
height: style.height
|
|
85
|
+
}"
|
|
95
86
|
:jsv_innerview="innerViewId"
|
|
96
87
|
>
|
|
97
88
|
<slot/>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* 原图中圆弧半径 = (原图宽度 - borderOutset * 2) / 2
|
|
13
13
|
* 四角为其他形状时,原图.9图的四角区域,缩放到要和显示图形重合后的宽度。
|
|
14
14
|
* borderOutset {int} (必填)原图信息: 图片边缘到中心内容区域边缘的距离, 快速计算: (原图宽度 - 原图中放内容宽度) / 2
|
|
15
|
-
* animTime {int} (必填)缩放动画的时长(
|
|
15
|
+
* animTime {int} (必填)缩放动画的时长(单位秒)
|
|
16
16
|
* waitForInit {boolean} (选填)尺寸为0时是否进行描画(例如: 首次显示不展示动画的场合,设置为true),默认值为true
|
|
17
17
|
-->
|
|
18
18
|
|
|
@@ -1,17 +1,47 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* 【模块 export 内容】
|
|
3
3
|
* JsvPosterDiv:Vue高阶组件,海报描画
|
|
4
|
+
* props说明:
|
|
5
|
+
* style {Object} 包含
|
|
6
|
+
* left/top/width/height
|
|
7
|
+
* border-radius
|
|
8
|
+
* backgroundImage/backgroundColor
|
|
9
|
+
* 的style设置
|
|
4
10
|
-->
|
|
11
|
+
<script setup>
|
|
12
|
+
|
|
13
|
+
import { reactive, watchEffect } from "vue";
|
|
14
|
+
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
style: Object,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
let common_style = reactive({});
|
|
20
|
+
let image_style = reactive({});
|
|
21
|
+
|
|
22
|
+
watchEffect(()=>{
|
|
23
|
+
if (props.style) {
|
|
24
|
+
let {left, top, width, height, ...others} = props.style;
|
|
25
|
+
|
|
26
|
+
common_style.left = left;
|
|
27
|
+
common_style.top = top;
|
|
28
|
+
|
|
29
|
+
image_style.width = width;
|
|
30
|
+
image_style.height = height;
|
|
31
|
+
Object.assign(image_style, others)
|
|
32
|
+
}
|
|
33
|
+
})
|
|
5
34
|
|
|
6
|
-
<script>
|
|
7
|
-
export default {
|
|
8
|
-
//不让根元素继承style,以导致多画一个图片。同时注意slot和div的位置
|
|
9
|
-
inheritAttrs: false,
|
|
10
|
-
};
|
|
11
35
|
</script>
|
|
36
|
+
|
|
12
37
|
<template>
|
|
13
|
-
<div>
|
|
38
|
+
<div :style="common_style">
|
|
14
39
|
<slot></slot>
|
|
15
|
-
<div
|
|
40
|
+
<div
|
|
41
|
+
jsv_enable_fade="true"
|
|
42
|
+
jsv_poster_on_top="true"
|
|
43
|
+
:style="image_style"
|
|
44
|
+
v-bind="$attrs"
|
|
45
|
+
/>
|
|
16
46
|
</div>
|
|
17
47
|
</template>
|
|
@@ -1,30 +1,51 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* 【模块 export 内容】
|
|
3
3
|
* JsvPosterImage:Vue高阶组件,海报描画,可设置color space 和 texture size
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* props说明:
|
|
5
|
+
* colorSpace {String} 颜色空间,默认RGBA_8888
|
|
6
|
+
* style {Object} 包含left/top/width/height/border-radius的style设置
|
|
6
7
|
-->
|
|
7
8
|
|
|
8
|
-
<script>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
<script setup>
|
|
10
|
+
|
|
11
|
+
import { reactive, watchEffect } from "vue";
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
colorSpace: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "RGBA_8888",
|
|
15
17
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
style: Object,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
let common_style = reactive({});
|
|
23
|
+
let image_style = reactive({});
|
|
24
|
+
|
|
25
|
+
watchEffect(()=>{
|
|
26
|
+
if (props.style) {
|
|
27
|
+
let {left, top, width, height, ...others} = props.style;
|
|
28
|
+
|
|
29
|
+
common_style.left = left;
|
|
30
|
+
common_style.top = top;
|
|
31
|
+
|
|
32
|
+
image_style.width = width;
|
|
33
|
+
image_style.height = height;
|
|
34
|
+
Object.assign(image_style, others)
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
|
|
18
38
|
</script>
|
|
19
39
|
|
|
20
40
|
<template>
|
|
21
|
-
<div>
|
|
41
|
+
<div :style="common_style">
|
|
22
42
|
<slot></slot>
|
|
23
43
|
<img
|
|
24
44
|
jsv_enable_fade="true"
|
|
25
45
|
jsv_poster_on_top="true"
|
|
26
46
|
jsv_img_scaledown_tex="true"
|
|
27
|
-
:jsv_img_color_space="
|
|
47
|
+
:jsv_img_color_space="colorSpace"
|
|
48
|
+
:style="image_style"
|
|
28
49
|
v-bind="$attrs"
|
|
29
50
|
/>
|
|
30
51
|
</div>
|
|
@@ -248,12 +248,7 @@ export default {
|
|
|
248
248
|
const preload_view = new Forge.PreloadView(texture_setting);
|
|
249
249
|
return {
|
|
250
250
|
viewId: ForgeExtension.RootActivity.ViewStore.add(
|
|
251
|
-
new Forge.ViewInfo(preload_view
|
|
252
|
-
x: 0,
|
|
253
|
-
y: 0,
|
|
254
|
-
width: 0,
|
|
255
|
-
height: 0,
|
|
256
|
-
})
|
|
251
|
+
new Forge.ViewInfo(preload_view)
|
|
257
252
|
),
|
|
258
253
|
textureRef: texture,
|
|
259
254
|
callToken: callback_token,
|
|
@@ -318,12 +313,7 @@ export default {
|
|
|
318
313
|
|
|
319
314
|
return {
|
|
320
315
|
viewId: ForgeExtension.RootActivity.ViewStore.add(
|
|
321
|
-
new Forge.ViewInfo(preload_view
|
|
322
|
-
x: 0,
|
|
323
|
-
y: 0,
|
|
324
|
-
width: 0,
|
|
325
|
-
height: 0,
|
|
326
|
-
})
|
|
316
|
+
new Forge.ViewInfo(preload_view)
|
|
327
317
|
),
|
|
328
318
|
textureRef: texture,
|
|
329
319
|
callToken: callback_token,
|
|
@@ -22,9 +22,18 @@ export default {
|
|
|
22
22
|
props: {
|
|
23
23
|
value: String,
|
|
24
24
|
size: Number,
|
|
25
|
-
fgColor:
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
fgColor: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "#000000"
|
|
28
|
+
},
|
|
29
|
+
bgColor: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "#ffffff"
|
|
32
|
+
},
|
|
33
|
+
level: {
|
|
34
|
+
type: String, // ,容错级别,分别是L(7%)、M(15%)、Q(25%)、H(30%),
|
|
35
|
+
default: "L"
|
|
36
|
+
},
|
|
28
37
|
imageSettings: Object,
|
|
29
38
|
},
|
|
30
39
|
methods: {
|
|
@@ -107,7 +116,7 @@ export default {
|
|
|
107
116
|
if (this.jsvBaseView === null) {
|
|
108
117
|
this.jsvBaseView = new Forge.LayoutView();
|
|
109
118
|
this.innerViewId = ForgeExtension.RootActivity.ViewStore.add(
|
|
110
|
-
new Forge.ViewInfo(this.jsvBaseView
|
|
119
|
+
new Forge.ViewInfo(this.jsvBaseView)
|
|
111
120
|
);
|
|
112
121
|
}
|
|
113
122
|
// 构建QRCdoe view
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<script>
|
|
35
35
|
import { Forge, ForgeExtension } from "../../../dom/jsv-forge-define";
|
|
36
36
|
|
|
37
|
-
let buildForgeView = (pointRes, sprayStyle) => {
|
|
37
|
+
let buildForgeView = (pointRes, sprayStyle, sizeRef) => {
|
|
38
38
|
if (!pointRes) {
|
|
39
39
|
return -1;
|
|
40
40
|
}
|
|
@@ -88,13 +88,10 @@ let buildForgeView = (pointRes, sprayStyle) => {
|
|
|
88
88
|
sprayStyle.deltaWidth === 0 ? 1 : 2 * sprayStyle.deltaWidth;
|
|
89
89
|
const view_height =
|
|
90
90
|
sprayStyle.deltaHeight === 0 ? 1 : 2 * sprayStyle.deltaHeight;
|
|
91
|
+
sizeRef.width = view_width;
|
|
92
|
+
sizeRef.height = view_height;
|
|
91
93
|
return ForgeExtension.RootActivity.ViewStore.add(
|
|
92
|
-
new Forge.ViewInfo(spray_view
|
|
93
|
-
x: 0,
|
|
94
|
-
y: 0,
|
|
95
|
-
width: view_width,
|
|
96
|
-
height: view_height,
|
|
97
|
-
})
|
|
94
|
+
new Forge.ViewInfo(spray_view)
|
|
98
95
|
);
|
|
99
96
|
};
|
|
100
97
|
|
|
@@ -111,6 +108,10 @@ export default {
|
|
|
111
108
|
},
|
|
112
109
|
data() {
|
|
113
110
|
return {
|
|
111
|
+
size: {
|
|
112
|
+
width: 0,
|
|
113
|
+
height: 0
|
|
114
|
+
},
|
|
114
115
|
viewId: -1,
|
|
115
116
|
};
|
|
116
117
|
},
|
|
@@ -123,11 +124,11 @@ export default {
|
|
|
123
124
|
},
|
|
124
125
|
},
|
|
125
126
|
created() {
|
|
126
|
-
this.viewId = buildForgeView(this.pointRes, this.sprayStyle);
|
|
127
|
+
this.viewId = buildForgeView(this.pointRes, this.sprayStyle, this.size);
|
|
127
128
|
},
|
|
128
129
|
updated() {
|
|
129
130
|
this.unloadView();
|
|
130
|
-
this.viewId = buildForgeView(this.pointRes, this.sprayStyle);
|
|
131
|
+
this.viewId = buildForgeView(this.pointRes, this.sprayStyle, this.size);
|
|
131
132
|
},
|
|
132
133
|
beforeUnmount() {
|
|
133
134
|
this.unloadView();
|
|
@@ -136,5 +137,7 @@ export default {
|
|
|
136
137
|
</script>
|
|
137
138
|
|
|
138
139
|
<template>
|
|
139
|
-
<div
|
|
140
|
+
<div
|
|
141
|
+
:style="{width: size.width, height: size.height}"
|
|
142
|
+
:jsv_innerview="viewId"></div>
|
|
140
143
|
</template>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import JsvSpriteAnim from
|
|
2
|
-
import SpriteController from
|
|
1
|
+
import JsvSpriteAnim from "./JsvSpriteAnim.vue";
|
|
2
|
+
import { SpriteController } from "./SpriteController.js";
|
|
3
3
|
|
|
4
4
|
export default JsvSpriteAnim;
|
|
5
5
|
export { SpriteController };
|
|
6
|
-
|
|
@@ -204,7 +204,8 @@ export default {
|
|
|
204
204
|
|
|
205
205
|
if (decorate && decorate.type == DECORATE_NINEPATCH_ALPHA_MIX && decorate.animTime > 0) {
|
|
206
206
|
// Ninepatch模式可以设置长宽的过渡动画
|
|
207
|
-
|
|
207
|
+
let anim_time = decorate.animTime;
|
|
208
|
+
transition = `left ${anim_time}s, top ${anim_time}s, width ${anim_time}s, height ${anim_time}s`;
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
return transition;
|
|
@@ -237,21 +238,25 @@ export default {
|
|
|
237
238
|
}
|
|
238
239
|
|
|
239
240
|
// 4.设置texture的动画形变
|
|
240
|
-
this.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
1,
|
|
245
|
-
1
|
|
246
|
-
);
|
|
247
|
-
this.forgeAnimation.EnableDelay(this.delay).SetRepeat(this.repeat);
|
|
248
|
-
this.forgeAnimation.SetAnimationListener(
|
|
249
|
-
new Forge.AnimationListener(
|
|
241
|
+
if (this.animation) {
|
|
242
|
+
this.forgeAnimation = new Forge.CssKeyframeAnimation(
|
|
243
|
+
"@keyframes test" + this.animation,
|
|
244
|
+
this.duration,
|
|
250
245
|
null,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
)
|
|
254
|
-
|
|
246
|
+
1,
|
|
247
|
+
1
|
|
248
|
+
);
|
|
249
|
+
this.forgeAnimation.EnableDelay(this.delay).SetRepeat(this.repeat);
|
|
250
|
+
this.forgeAnimation.SetAnimationListener(
|
|
251
|
+
new Forge.AnimationListener(
|
|
252
|
+
null,
|
|
253
|
+
this._onAnimationEnd,
|
|
254
|
+
null
|
|
255
|
+
)
|
|
256
|
+
);
|
|
257
|
+
} else {
|
|
258
|
+
this.forgeAnimation = null;
|
|
259
|
+
}
|
|
255
260
|
|
|
256
261
|
// 5. inner view标准处理
|
|
257
262
|
this.viewStoreRef = ForgeExtension.RootActivity
|
|
@@ -259,12 +264,7 @@ export default {
|
|
|
259
264
|
: Forge.sViewStore;
|
|
260
265
|
|
|
261
266
|
this.innerViewId = this.viewStoreRef.add(
|
|
262
|
-
new Forge.ViewInfo(this.innerView
|
|
263
|
-
x: 0,
|
|
264
|
-
y: 0,
|
|
265
|
-
width: this.width,
|
|
266
|
-
height: this.height,
|
|
267
|
-
})
|
|
267
|
+
new Forge.ViewInfo(this.innerView)
|
|
268
268
|
);
|
|
269
269
|
}
|
|
270
270
|
},
|
|
@@ -285,6 +285,10 @@ export default {
|
|
|
285
285
|
<template>
|
|
286
286
|
<div
|
|
287
287
|
:style="{
|
|
288
|
+
top: top,
|
|
289
|
+
left: left,
|
|
290
|
+
width: width,
|
|
291
|
+
height: height,
|
|
288
292
|
transition: getTransition(),
|
|
289
293
|
}"
|
|
290
294
|
:jsv_innerview="innerViewId">
|
|
@@ -41,15 +41,9 @@ export default {
|
|
|
41
41
|
// 通过内置函数构造定制的LayoutView
|
|
42
42
|
this.innerView = new Forge.LayoutView(textureSetting);
|
|
43
43
|
this.innerViewId = ForgeExtension.RootActivity.ViewStore.add(
|
|
44
|
-
new Forge.ViewInfo(this.innerView
|
|
44
|
+
new Forge.ViewInfo(this.innerView)
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
// 更新宽高
|
|
49
|
-
this.innerView.ResetLayoutParams({
|
|
50
|
-
width: this.style.width,
|
|
51
|
-
height: this.style.height,
|
|
52
|
-
});
|
|
53
47
|
},
|
|
54
48
|
},
|
|
55
49
|
created() {
|
|
@@ -81,7 +75,12 @@ export default {
|
|
|
81
75
|
></div>
|
|
82
76
|
<div
|
|
83
77
|
:jsv_innerview="innerViewId"
|
|
84
|
-
:style="{
|
|
78
|
+
:style="{
|
|
79
|
+
left: style.left,
|
|
80
|
+
top: style.top,
|
|
81
|
+
width: style.width,
|
|
82
|
+
height: style.height
|
|
83
|
+
}"
|
|
85
84
|
>
|
|
86
85
|
<slot></slot>
|
|
87
86
|
</div>
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* 【模块 export 内容】
|
|
3
|
+
* JsvVisibleSensor: 可视区域监控器
|
|
4
|
+
* props说明:
|
|
5
|
+
* horizonShown {number} (可选, 可响应式, 默认1.0完全露出)横轴百分比区域完全显示时(左边或右边完全露出,仅中间段判断会失效),
|
|
6
|
+
* 横轴切换到显示状态,否则为不可视状态
|
|
7
|
+
* verticalShown {number} (可选, 可响应式)纵轴百分比区域完全显示时(上边或下边完全露出,仅中间段判断会失效),
|
|
8
|
+
* 纵轴切换到显示状态,否则为不可视状态
|
|
9
|
+
* left {number} (可选, 可响应式)可视检测区域的left
|
|
10
|
+
* top {number} (可选, 可响应式)可视检测区域的top
|
|
11
|
+
* width {number} (可选, 可响应式)可视检测区域的width
|
|
12
|
+
* height {number} (可选, 可响应式)可视检测区域的height
|
|
13
|
+
*
|
|
14
|
+
* container {div reference} (可选, 可响应式)子区域参照,若为null,则认为检测可视区域为全屏幕
|
|
15
|
+
*
|
|
16
|
+
* callback {function} (必须, 可响应式)可视变化时的回调处理, 参数
|
|
17
|
+
* (old_horizantal_visible, new_horizantal_visible, old_vertical_visible, new_vertical_visible)
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div ref="viewRef" :style="{
|
|
22
|
+
top: props.top,
|
|
23
|
+
left: props.left,
|
|
24
|
+
width: props.width,
|
|
25
|
+
height: props.height,
|
|
26
|
+
}" >
|
|
27
|
+
<slot/>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script setup>
|
|
32
|
+
import { reactive, ref, toRaw, watchEffect, onMounted, defineExpose } from 'vue'
|
|
33
|
+
import { Forge } from "jsview/dom/jsv-forge-define";
|
|
34
|
+
|
|
35
|
+
const props = defineProps({
|
|
36
|
+
// (支持reactive)可视区域设定
|
|
37
|
+
horizonShown: Number,
|
|
38
|
+
verticalShown: Number,
|
|
39
|
+
|
|
40
|
+
// (支持reactive)Container, 父区域的div引用,
|
|
41
|
+
container: Object,
|
|
42
|
+
|
|
43
|
+
// (不支持reactive)回调处理
|
|
44
|
+
callback: Function,
|
|
45
|
+
|
|
46
|
+
// (支持reactive)位置信息
|
|
47
|
+
left: {
|
|
48
|
+
type: Number,
|
|
49
|
+
default: 0,
|
|
50
|
+
},
|
|
51
|
+
top: {
|
|
52
|
+
type: Number,
|
|
53
|
+
default: 0,
|
|
54
|
+
},
|
|
55
|
+
width: {
|
|
56
|
+
type: Number,
|
|
57
|
+
require: true,
|
|
58
|
+
},
|
|
59
|
+
height: {
|
|
60
|
+
type: Number,
|
|
61
|
+
require: true,
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
// (支持reactive)是否激活,仍然在渲染树时,非必须可以通过enable关闭以节省CPU开销
|
|
65
|
+
enable: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: true,
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// 内部状态变量
|
|
72
|
+
const viewRef = ref(null);
|
|
73
|
+
const viewMounted = reactive({status: false})
|
|
74
|
+
let sensorRef = null;
|
|
75
|
+
|
|
76
|
+
// 变更检测范围
|
|
77
|
+
watchEffect(()=>{
|
|
78
|
+
if (viewMounted.status) {
|
|
79
|
+
let horizon = fixAreaValue(props.horizonShown);
|
|
80
|
+
let vertical = fixAreaValue(props.verticalShown);
|
|
81
|
+
|
|
82
|
+
sensorRef.ResetArea({horizon, vertical})
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
// 变更enable状态
|
|
87
|
+
watchEffect(()=>{
|
|
88
|
+
if (viewMounted.status) {
|
|
89
|
+
sensorRef.Enable(props.enable)
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
// 检测container变化
|
|
94
|
+
watchEffect(()=>{
|
|
95
|
+
if (viewMounted.status) {
|
|
96
|
+
if (props.container) {
|
|
97
|
+
window.MyContainerView = toRaw(props.container);
|
|
98
|
+
|
|
99
|
+
let jsv_main_view_ref = toRaw(props.container).jsvMainView;
|
|
100
|
+
if (jsv_main_view_ref) {
|
|
101
|
+
sensorRef.ResetContainer(toRaw(props.container).jsvMainView);
|
|
102
|
+
} else {
|
|
103
|
+
console.error("Error: container is NOT a div");
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
sensorRef.ResetContainer(null); // 无container
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
onMounted(()=>{
|
|
112
|
+
console.log("JsvVisibleSensor: on mounted");
|
|
113
|
+
|
|
114
|
+
sensorRef = new Forge.VisibleSensor(toRaw(viewRef.value).jsvMainView, (old_h, new_h, old_v, new_v)=>{
|
|
115
|
+
// 获得横向和纵向的新旧状态值
|
|
116
|
+
if (props.callback) {
|
|
117
|
+
props.callback(old_h, new_h, old_v, new_v);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
viewMounted.status = true;
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
// 外部方法
|
|
124
|
+
defineExpose({
|
|
125
|
+
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
// 内部方法
|
|
129
|
+
function fixAreaValue(origin_value) {
|
|
130
|
+
if (origin_value > 1) {
|
|
131
|
+
console.warn(`will limited to 1 origin=${origin_value}`);
|
|
132
|
+
return 1;
|
|
133
|
+
} else if (origin_value < 0) {
|
|
134
|
+
console.warn(`will limited to 0 origin=${origin_value}`);
|
|
135
|
+
return 0;
|
|
136
|
+
} else {
|
|
137
|
+
return origin_value;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
</script>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//考虑到.vue文件除了export default的component外,还有可能export其他对象,因此使用import * as
|
|
2
|
+
import * as JsvVisibleSensor from "./JsvVisibleSensor.vue";
|
|
3
|
+
|
|
4
|
+
let _JsvVisibleSensor = JsvVisibleSensor;
|
|
5
|
+
// if (window.JsvWidgetWrapperGroup && window.JsvWidgetWrapperGroup.BrowserVisibleSensor) {
|
|
6
|
+
// JsvVisibleSensor = window.JsvWidgetWrapperGroup.BrowserVisibleSensor;
|
|
7
|
+
// }
|
|
8
|
+
|
|
9
|
+
export default _JsvVisibleSensor.default
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-07-05 11:00:51
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-07-08 17:08:08
|
|
6
|
+
* @Description: file content
|
|
7
|
+
*/
|
|
8
|
+
export { default as JsvActorMove, JsvActorMoveControl } from "./JsvActorMove";
|
|
9
|
+
export { default as JsvApic, LoopType } from "./JsvApic";
|
|
10
|
+
export { default as JsvInput, InputType } from "./JsvInput";
|
|
11
|
+
export {
|
|
12
|
+
default as JsvPreload,
|
|
13
|
+
buildPreloadInfo,
|
|
14
|
+
buildDownloadInfo,
|
|
15
|
+
} from "./JsvPreload";
|
|
16
|
+
export { default as JsvQrcode } from "./JsvQrcode";
|
|
17
|
+
export { default as JsvSpray } from "./JsvSpray";
|
|
18
|
+
export { default as JsvSpriteAnim, SpriteController } from "./JsvSpriteAnim";
|
|
19
|
+
export { default as JsvSwiper } from "./JsvSwiper";
|
|
20
|
+
export { default as JsvSwiper3D } from "./JsvSwiper3D";
|
|
21
|
+
export { default as JsvTextureAnim } from "./JsvTextureAnim";
|
|
22
|
+
export { default as JsvVisibleSensor } from "./JsvVisibleSensor";
|
|
23
|
+
export { default as JsvFilterView } from "./JsvFilterView.vue";
|
|
24
|
+
export {
|
|
25
|
+
default as JsvGrid,
|
|
26
|
+
PageType,
|
|
27
|
+
LineType,
|
|
28
|
+
FocusMoveType,
|
|
29
|
+
} from "./JsvGrid.vue";
|
|
30
|
+
export { default as JsvHole } from "./JsvHole.js";
|
|
31
|
+
export { default as JsvMarquee } from "./JsvMarquee.vue";
|
|
32
|
+
export { default as JsvMaskClipDiv } from "./JsvMaskClipDiv.vue";
|
|
33
|
+
export { default as JsvNativeSharedDiv } from "./JsvNativeSharedDiv.vue";
|
|
34
|
+
export { default as JsvNinePatch } from "./JsvNinePatch.vue";
|
|
35
|
+
export { default as JsvPosterDiv } from "./JsvPosterDiv.vue";
|
|
36
|
+
export { default as JsvPosterImage } from "./JsvPosterImage.vue";
|
|
37
|
+
export { default as JsvScaleTextBox } from "./JsvScaleTextBox.vue";
|
|
38
|
+
export { JsvSoundPool } from "./JsvSoundPool.js";
|
|
39
|
+
export { default as JsvTextBox } from "./JsvTextBox.vue";
|
|
40
|
+
export { default as JsvTouchContainer } from "./JsvTouchContainer.vue";
|
|
41
|
+
export { default as JsvTransparentDiv } from "./JsvTransparentDiv.vue";
|
|
42
|
+
export { default as JsvVideo } from "./JsvVideo.vue";
|