@shijiu/jsview-vue 0.9.631 → 0.9.766
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/bin/jsview-engine-js-browser.min.js +1 -0
- package/dom/bin/jsview-forge-define.min.js +1 -1
- package/dom/jsv-engine-js-browser.js +6 -0
- package/dom/target_core_revision.js +4 -4
- package/loader/loader.js +4 -0
- package/package.json +1 -1
- package/patches/node_modules/@vue/cli-service/lib/config/base.js +1 -1
- package/samples/AnimPicture/App.vue +5 -5
- package/samples/Basic/components/div/DivLayout.vue +1 -1
- package/samples/Basic/components/img/ImageGroup.vue +2 -2
- package/samples/Basic/components/img/ImgLayout.vue +79 -15
- package/samples/Basic/components/text/TextDirection.vue +104 -0
- package/samples/Basic/components/text/TextEmoji.vue +1 -1
- package/samples/Basic/components/text/TextGroup1.vue +1 -1
- package/samples/Basic/components/text/TextGroup2.vue +11 -1
- package/samples/Basic/components/text/TextOverflow.vue +8 -3
- package/samples/BasicFocusControl/components/BaseBlock.vue +2 -2
- package/samples/Collision/App.vue +11 -11
- package/samples/DemoHomepage/App.vue +43 -8
- package/samples/DemoHomepage/router.js +18 -10
- package/samples/DemoHomepage/views/Homepage.vue +83 -96
- package/samples/FilterDemo/App.vue +1 -1
- package/samples/FlipCard/App.vue +2 -2
- package/samples/FlipCard/FlipCard.vue +3 -3
- package/samples/GridDemo/App.vue +3 -3
- package/samples/GridDemo/ButtonBlock.vue +2 -2
- package/samples/GridDemo/FocusItem.vue +2 -2
- package/samples/GridDemo/Item.vue +1 -1
- package/samples/HashHistory/App.vue +10 -3
- package/samples/HashHistory/components/Item.vue +1 -1
- package/samples/ImpactStop/App.vue +15 -11
- package/samples/Input/InputPanel.vue +1 -1
- package/samples/LongImage/Button.vue +1 -1
- package/samples/LongImage/ButtonItem.vue +1 -1
- package/samples/LongImage/LongImageScroll.vue +2 -2
- package/samples/LongText/App.vue +1 -1
- package/samples/LongText/Button.vue +1 -1
- package/samples/LongText/ButtonItem.vue +1 -1
- package/samples/LongText/LongTextScroll.vue +3 -3
- package/samples/Marquee/App.vue +176 -40
- package/samples/Marquee/longText.js +14 -0
- package/samples/MetroWidgetDemos/Advanced/App.vue +5 -6
- package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +4 -4
- package/samples/MetroWidgetDemos/Advanced/Buttons.vue +5 -5
- package/samples/MetroWidgetDemos/Advanced/Mixed.vue +4 -4
- package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +82 -0
- package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +88 -0
- package/samples/MetroWidgetDemos/Advanced/{Widgets.vue → widgets/Widgets.vue} +56 -11
- package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
- package/samples/MetroWidgetDemos/Item.vue +4 -2
- package/samples/MetroWidgetDemos/PerformanceTest/App.vue +4 -4
- package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +1 -1
- package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +3 -3
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +2 -2
- package/samples/MetroWidgetDemos/PingPong/TabItem.vue +1 -1
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +3 -3
- package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +2 -2
- package/samples/MetroWidgetDemos/Simple/App.vue +2 -2
- package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +6 -6
- package/samples/MetroWidgetDemos/WidgetItem.vue +2 -3
- package/samples/MetroWidgetDemos/data.js +2 -1
- package/samples/NinePatchDemo/App.vue +2 -2
- package/samples/NinePatchDemo/Item.vue +2 -2
- package/samples/Preload/App.vue +1 -1
- package/samples/Preload/Item.vue +1 -1
- package/samples/QrcodeDemo/App.vue +1 -1
- package/samples/ScaleDownNeon/App.vue +107 -0
- package/samples/SoundPool/App.vue +3 -3
- package/samples/SpriteImage/App.vue +5 -0
- package/samples/TextBox/App.vue +9 -82
- package/samples/TextBox/RenderCenter.vue +40 -16
- package/samples/TextBox/RenderLeft.vue +48 -19
- package/samples/TextBox/RenderOneLine.vue +30 -49
- package/samples/TextBox/RenderRight.vue +40 -16
- package/samples/TextShadowDemo/App.vue +11 -17
- package/samples/TextureAnimation/App2.vue +1 -1
- package/samples/TextureSize/App.vue +3 -3
- package/samples/ThrowMoveDemo/LRParabolicDemo.vue +33 -47
- package/samples/TouchSample/MetroWidgetHorizontal.vue +1 -1
- package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
- package/samples/TransitPage/App.vue +1 -1
- package/samples/VideoDemo/App.vue +8 -8
- package/samples/VideoDemo/components/Button.vue +1 -1
- package/samples/VideoDemo/components/Controllor.vue +1 -1
- package/samples/VisibleSensorDemo/App.vue +3 -3
- package/scripts/jsview-run-android.js +5 -4
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +4 -4
- package/utils/JsViewEngineWidget/MetroWidget/Const.js +11 -0
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +245 -111
- package/utils/JsViewEngineWidget/TemplateParser.js +227 -178
- package/utils/JsViewEngineWidget/WidgetCommon.js +14 -6
- package/utils/JsViewEngineWidget/index.js +3 -2
- package/utils/JsViewPlugin/BrowserPluginLoader.js +4 -2
- package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +302 -0
- package/utils/JsViewPlugin/JsvAudio/CheckType.js +68 -0
- package/utils/JsViewPlugin/JsvAudio/Events.js +17 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +176 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.js +40 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudioBrowser.vue +46 -0
- package/utils/JsViewPlugin/JsvAudio/PluginLoader.js +140 -0
- package/utils/JsViewPlugin/JsvAudio/index.js +26 -0
- package/utils/JsViewPlugin/JsvAudio/version.js +24 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +61 -12
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +8 -1
- package/utils/JsViewPlugin/JsvPlayer/index.js +14 -0
- package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
- package/utils/JsViewVueTools/JsvHashHistory.js +34 -8
- package/utils/JsViewVueTools/JsvImpactTracer.js +2 -2
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +46 -8
- package/utils/JsViewVueTools/JsvStyleClass.js +9 -0
- package/utils/JsViewVueTools/JsvTextTools.js +18 -0
- package/utils/JsViewVueTools/TypeCheckAndSet.js +3 -3
- package/utils/JsViewVueTools/index.js +2 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +5 -7
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +20 -22
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +4 -4
- package/utils/JsViewVueWidget/JsvGrid.vue +1 -9
- package/utils/JsViewVueWidget/JsvInput/Cursor.vue +1 -1
- package/utils/JsViewVueWidget/JsvMarquee.vue +188 -205
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +35 -27
- package/utils/JsViewVueWidget/JsvNinePatch.vue +63 -54
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +10 -5
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -2
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +21 -5
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +23 -3
- package/utils/JsViewVueWidget/JsvTextBox.vue +27 -84
- package/utils/JsViewVueWidget/JsvTouchContainer.vue +5 -6
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +5 -5
- package/utils/JsViewVueWidget/index.js +8 -8
- package/utils/JsViewEngineWidget/MetroPage.js +0 -2128
- package/utils/JsViewEngineWidget/SimpleWidget/ContentView.vue +0 -51
- package/utils/JsViewEngineWidget/SimpleWidget/Dispatcher.js +0 -19
- package/utils/JsViewEngineWidget/SimpleWidget/DivWrapper.vue +0 -53
- package/utils/JsViewEngineWidget/SimpleWidget/ItemView.vue +0 -142
- package/utils/JsViewEngineWidget/SimpleWidget/RootView.vue +0 -140
- package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +0 -1629
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2021-09-22 13:47:23
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-02-11 17:55:55
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script>
|
|
9
|
-
import ItemView from "./ItemView.vue";
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
props: {
|
|
13
|
-
token: Number,
|
|
14
|
-
onItemEdge: Function,
|
|
15
|
-
data: Object,
|
|
16
|
-
loadAll: Boolean,
|
|
17
|
-
enableTouch: Boolean,
|
|
18
|
-
onLoad: Function,
|
|
19
|
-
widgetHandler: Object,
|
|
20
|
-
enableItemRenderBreak: Boolean,
|
|
21
|
-
},
|
|
22
|
-
components: {
|
|
23
|
-
ItemView,
|
|
24
|
-
},
|
|
25
|
-
mounted() {
|
|
26
|
-
this.onLoad();
|
|
27
|
-
},
|
|
28
|
-
updated() {
|
|
29
|
-
this.onLoad();
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<item-view
|
|
36
|
-
v-for="(item, index) in data"
|
|
37
|
-
:key="item.id"
|
|
38
|
-
:index="index"
|
|
39
|
-
:data="item.data"
|
|
40
|
-
:loadAll="loadAll"
|
|
41
|
-
:enableTouch="enableTouch"
|
|
42
|
-
:onEdge="onItemEdge"
|
|
43
|
-
:controlObj="item.controller"
|
|
44
|
-
:widgetHandler="widgetHandler"
|
|
45
|
-
:allowRenderBreak="enableItemRenderBreak"
|
|
46
|
-
>
|
|
47
|
-
<template v-slot:renderItem="slotProps">
|
|
48
|
-
<slot name="renderItem" v-bind="slotProps"></slot>
|
|
49
|
-
</template>
|
|
50
|
-
</item-view>
|
|
51
|
-
</template>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2021-09-22 16:50:09
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-01-26 10:17:47
|
|
6
|
-
* @Description: file content
|
|
7
|
-
*/
|
|
8
|
-
import { BaseDispatcher } from "../WidgetCommon";
|
|
9
|
-
|
|
10
|
-
class Dispatcher extends BaseDispatcher {}
|
|
11
|
-
Dispatcher.Type = {
|
|
12
|
-
setFocusId: Symbol("setFocusId"),
|
|
13
|
-
updateItem: Symbol("updateItem"),
|
|
14
|
-
slideToItem: Symbol("slideTo"),
|
|
15
|
-
setEnterFocusId: Symbol("setEnterFocusId"),
|
|
16
|
-
setEnterFocusRect: Symbol("setEnterFocusRect"),
|
|
17
|
-
};
|
|
18
|
-
export { Dispatcher as SWidgetDispatcher };
|
|
19
|
-
export default Dispatcher;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2022-01-14 18:18:00
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-01-26 17:35:26
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script>
|
|
9
|
-
export default {
|
|
10
|
-
props: [
|
|
11
|
-
"data",
|
|
12
|
-
"controlObj",
|
|
13
|
-
"onEdge",
|
|
14
|
-
"onAction",
|
|
15
|
-
"queryObj",
|
|
16
|
-
"widgetHandler",
|
|
17
|
-
"index",
|
|
18
|
-
"onFocus",
|
|
19
|
-
],
|
|
20
|
-
mounted() {
|
|
21
|
-
this.widgetHandler.updateMounted(this.index, true);
|
|
22
|
-
const curFocus = this.widgetHandler.getCurrentFocusId();
|
|
23
|
-
if (this.widgetHandler.isFocus() && curFocus.index === this.index) {
|
|
24
|
-
//unmount 后导致的onFocus 在 mount 前,onFocus 为生效的问题
|
|
25
|
-
this.onFocus();
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
beforeUnmount() {
|
|
29
|
-
this.widgetHandler.updateMounted(this.index, false);
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<div
|
|
36
|
-
ref="element"
|
|
37
|
-
:style="{
|
|
38
|
-
left: data.xPos,
|
|
39
|
-
top: data.yPos,
|
|
40
|
-
width: data.width,
|
|
41
|
-
height: data.height,
|
|
42
|
-
zIndex: controlObj.zIndex,
|
|
43
|
-
}"
|
|
44
|
-
>
|
|
45
|
-
<slot
|
|
46
|
-
name="renderItem"
|
|
47
|
-
:data="data.data"
|
|
48
|
-
:onEdge="onEdge"
|
|
49
|
-
:onAction="onAction"
|
|
50
|
-
:query="queryObj"
|
|
51
|
-
></slot>
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2021-09-18 14:34:20
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-02-11 13:43:39
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script>
|
|
9
|
-
import Forge from "../ForgeDefine";
|
|
10
|
-
import DivWrapper from "./DivWrapper.vue";
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
components: { DivWrapper },
|
|
14
|
-
props: {
|
|
15
|
-
data: Object,
|
|
16
|
-
loadAll: Boolean,
|
|
17
|
-
enableTouch: Boolean,
|
|
18
|
-
controlObj: Object,
|
|
19
|
-
onEdge: Function,
|
|
20
|
-
widgetHandler: Object,
|
|
21
|
-
index: Number,
|
|
22
|
-
},
|
|
23
|
-
setup() {
|
|
24
|
-
let onAction = {
|
|
25
|
-
register(name, func) {
|
|
26
|
-
this[name] = func;
|
|
27
|
-
},
|
|
28
|
-
unregister(name) {
|
|
29
|
-
delete this[name];
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
return {
|
|
33
|
-
onAction,
|
|
34
|
-
queryObj: null,
|
|
35
|
-
touchTested: false,
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
methods: {
|
|
39
|
-
onFocus(preEdge) {
|
|
40
|
-
this.widgetHandler.onFocusChange(this.data.id);
|
|
41
|
-
if (this.onAction.onFocus) {
|
|
42
|
-
this.onAction.onFocus(preEdge);
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
onBlur() {
|
|
46
|
-
if (this.onAction.onBlur) {
|
|
47
|
-
this.onAction.onBlur();
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
onClick() {
|
|
51
|
-
if (this.onAction.onClick) {
|
|
52
|
-
return this.onAction.onClick();
|
|
53
|
-
} else {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
reachEdge(edgeInfo) {
|
|
58
|
-
if (this.onAction.onWidgetEdge) {
|
|
59
|
-
this.onAction.onWidgetEdge(edgeInfo);
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
getDivElement() {
|
|
63
|
-
return this.$refs.element?.$refs?.element;
|
|
64
|
-
},
|
|
65
|
-
testTouchEnable() {
|
|
66
|
-
if (this.enableTouch) {
|
|
67
|
-
if (this.$refs.element?.$refs?.element /* DivWrapper的element ref */) {
|
|
68
|
-
if (!this.touchTested) {
|
|
69
|
-
// 为view添加触控处理
|
|
70
|
-
let view = this.$refs.element.$refs.element.jsvMaskView;
|
|
71
|
-
var dragSetting = new Forge.DragSetting(
|
|
72
|
-
Forge.DragSetting.DIRECTION_DISABLE,
|
|
73
|
-
20,
|
|
74
|
-
false,
|
|
75
|
-
new Forge.RectArea(0, 0, 0, 0),
|
|
76
|
-
-1,
|
|
77
|
-
3 / 4
|
|
78
|
-
);
|
|
79
|
-
let callback = {
|
|
80
|
-
OnTap: (msg) => {
|
|
81
|
-
console.log("Item View Container OnTap:", msg);
|
|
82
|
-
return this.onClick(this.data.id);
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
view.EnableDrag(dragSetting, callback, "translateMat(dx,dy,0)");
|
|
86
|
-
this.touchTested = true;
|
|
87
|
-
}
|
|
88
|
-
} else {
|
|
89
|
-
// 元素消失后要重新设置Touch处理
|
|
90
|
-
this.touchTested = false;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
created() {
|
|
96
|
-
this.queryObj = {
|
|
97
|
-
id: this.data.id,
|
|
98
|
-
index: this.index,
|
|
99
|
-
position: this.widgetHandler.getPosition,
|
|
100
|
-
templatePosition: this.widgetHandler.getTemplatePosition,
|
|
101
|
-
absolutePosition: this.widgetHandler.getAbsolutePosition,
|
|
102
|
-
getCurrentFocusId: this.widgetHandler.getCurrentFocusId,
|
|
103
|
-
slideTo: this.widgetHandler.customerSlide,
|
|
104
|
-
};
|
|
105
|
-
this.widgetHandler.registerItemRef(this.index, this);
|
|
106
|
-
//export handlers
|
|
107
|
-
this.widgetHandler.registerItemFunc(this.index, {
|
|
108
|
-
onFocus: this.onFocus,
|
|
109
|
-
onBlur: this.onBlur,
|
|
110
|
-
onClick: this.onClick,
|
|
111
|
-
reachEdge: this.reachEdge,
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
mounted() {
|
|
115
|
-
this.testTouchEnable();
|
|
116
|
-
},
|
|
117
|
-
updated() {
|
|
118
|
-
this.testTouchEnable();
|
|
119
|
-
},
|
|
120
|
-
beforeUnmount() {},
|
|
121
|
-
};
|
|
122
|
-
</script>
|
|
123
|
-
|
|
124
|
-
<template>
|
|
125
|
-
<div-wrapper
|
|
126
|
-
v-if="loadAll || controlObj.visible"
|
|
127
|
-
:key="data.xPos + '_' + data.yPos"
|
|
128
|
-
ref="element"
|
|
129
|
-
:data="data"
|
|
130
|
-
:controlObj="controlObj"
|
|
131
|
-
:onEdge="onEdge"
|
|
132
|
-
:onAction="onAction"
|
|
133
|
-
:queryObj="queryObj"
|
|
134
|
-
:widgetHandler="widgetHandler"
|
|
135
|
-
:index="index"
|
|
136
|
-
:onFocus="onFocus"
|
|
137
|
-
>
|
|
138
|
-
<template v-slot:renderItem="slotProps">
|
|
139
|
-
<slot name="renderItem" v-bind="slotProps"></slot>
|
|
140
|
-
</template>
|
|
141
|
-
</div-wrapper>
|
|
142
|
-
</template>
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2021-09-22 14:03:32
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-02-11 14:49:26
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script>
|
|
9
|
-
import ContentView from "./ContentView.vue";
|
|
10
|
-
import Forge from "../ForgeDefine";
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
props: {
|
|
14
|
-
token: Number,
|
|
15
|
-
data: Object,
|
|
16
|
-
onItemEdge: Function,
|
|
17
|
-
onLoad: Function,
|
|
18
|
-
register: Function,
|
|
19
|
-
widgetHandler: Object,
|
|
20
|
-
|
|
21
|
-
x: Number,
|
|
22
|
-
y: Number,
|
|
23
|
-
width: Number,
|
|
24
|
-
height: Number,
|
|
25
|
-
|
|
26
|
-
loadAll: Boolean,
|
|
27
|
-
enableTouch: Boolean,
|
|
28
|
-
touchListener: Object,
|
|
29
|
-
flingPageWidth: Number,
|
|
30
|
-
flingPageEdge: Number,
|
|
31
|
-
slidePile: Object,
|
|
32
|
-
direction: Number, //Forge.DragSetting的方向是数字类型
|
|
33
|
-
enableItemRenderBreak: Boolean,
|
|
34
|
-
},
|
|
35
|
-
components: {
|
|
36
|
-
ContentView,
|
|
37
|
-
},
|
|
38
|
-
data() {
|
|
39
|
-
return {
|
|
40
|
-
innerX: 0,
|
|
41
|
-
innerY: 0,
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
setup() {
|
|
45
|
-
let element = {};
|
|
46
|
-
return {
|
|
47
|
-
element,
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
methods: {
|
|
51
|
-
$_rootView_initTouch_() {
|
|
52
|
-
if (this.touchListener && this.$refs.element) {
|
|
53
|
-
let view = this.$refs.element.jsvMaskView;
|
|
54
|
-
let page_width = this.flingPageWidth;
|
|
55
|
-
let page_edge = this.flingPageEdge;
|
|
56
|
-
let slide_pile = this.slidePile;
|
|
57
|
-
var drag_setting = new Forge.DragSetting(
|
|
58
|
-
this.direction,
|
|
59
|
-
20,
|
|
60
|
-
false,
|
|
61
|
-
slide_pile,
|
|
62
|
-
page_width,
|
|
63
|
-
page_edge
|
|
64
|
-
);
|
|
65
|
-
view.EnableDrag(
|
|
66
|
-
drag_setting,
|
|
67
|
-
this.touchListener,
|
|
68
|
-
"translateMat(dx,dy,0)"
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
updatePosition(x, y, anim_info) {
|
|
73
|
-
if (this.$refs.element) {
|
|
74
|
-
let pre_pos = this.$refs.element.jsvMaskView.GetLayoutParams();
|
|
75
|
-
//jsvMaskView的位置更新时会被设置位0,因此不能通过ResetLayoutParams设置位置
|
|
76
|
-
this.innerX = x;
|
|
77
|
-
this.innerY = y;
|
|
78
|
-
if (anim_info) {
|
|
79
|
-
let delta_x = Math.abs(pre_pos.MarginLeft - x);
|
|
80
|
-
let delta_y = Math.abs(pre_pos.MarginTop - y);
|
|
81
|
-
let duration = Math.round(
|
|
82
|
-
delta_x === 0
|
|
83
|
-
? delta_y / anim_info.speed
|
|
84
|
-
: delta_x / anim_info.speed
|
|
85
|
-
);
|
|
86
|
-
let slide_animation = new Forge.TranslateAnimation(
|
|
87
|
-
pre_pos.MarginLeft - x,
|
|
88
|
-
0,
|
|
89
|
-
pre_pos.MarginTop - y,
|
|
90
|
-
0,
|
|
91
|
-
duration,
|
|
92
|
-
anim_info.easing
|
|
93
|
-
);
|
|
94
|
-
slide_animation.SetAnimationListener(
|
|
95
|
-
new Forge.AnimationListener(
|
|
96
|
-
anim_info.onstart,
|
|
97
|
-
anim_info.onend,
|
|
98
|
-
null
|
|
99
|
-
)
|
|
100
|
-
);
|
|
101
|
-
this.$refs.element.jsvMaskView.StartAnimation(slide_animation);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
created() {
|
|
107
|
-
if (this.register) {
|
|
108
|
-
this.register(this);
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
mounted() {
|
|
112
|
-
this.$_rootView_initTouch_();
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
</script>
|
|
116
|
-
|
|
117
|
-
<template>
|
|
118
|
-
<div :style="{ left: x, top: y }">
|
|
119
|
-
<div
|
|
120
|
-
key="touchcontainer"
|
|
121
|
-
ref="element"
|
|
122
|
-
:style="{ left: innerX, top: innerY, width: width, height: height }"
|
|
123
|
-
>
|
|
124
|
-
<content-view
|
|
125
|
-
:token="token"
|
|
126
|
-
:data="data"
|
|
127
|
-
:onItemEdge="onItemEdge"
|
|
128
|
-
:loadAll="loadAll"
|
|
129
|
-
:enableTouch="enableTouch"
|
|
130
|
-
:onLoad="onLoad"
|
|
131
|
-
:widgetHandler="widgetHandler"
|
|
132
|
-
:enableItemRenderBreak="enableItemRenderBreak"
|
|
133
|
-
>
|
|
134
|
-
<template v-slot:renderItem="slotProps">
|
|
135
|
-
<slot name="renderItem" v-bind="slotProps"></slot>
|
|
136
|
-
</template>
|
|
137
|
-
</content-view>
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
</template>
|