@shijiu/jsview-vue 1.9.650 → 1.9.720
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/package.json +7 -18
- package/samples/AnimPicture/App.vue +5 -5
- package/samples/Basic/components/div/DivLayout.vue +1 -1
- package/samples/Basic/components/text/TextOverflow.vue +10 -5
- package/samples/BasicFocusControl/components/BaseBlock.vue +2 -2
- package/samples/Collision/App.vue +452 -0
- package/samples/DemoHomepage/components/BodyFrame.vue +2 -0
- package/samples/DemoHomepage/router.js +21 -1
- package/samples/DemoHomepage/views/Homepage.vue +3 -7
- package/samples/FilterDemo/App.vue +1 -1
- package/samples/FlipCard/App.vue +2 -2
- package/samples/FlipCard/FlipCard.vue +2 -2
- 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 +435 -0
- package/samples/Input/App.vue +8 -17
- package/samples/Input/InputPanel.vue +19 -12
- 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 +3 -3
- package/samples/MetroWidgetDemos/Advanced/Buttons.vue +5 -5
- package/samples/MetroWidgetDemos/Advanced/Mixed.vue +4 -4
- package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +83 -0
- package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +89 -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 +20 -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 +1 -1
- package/samples/MetroWidgetDemos/PingPong/App.vue +3 -3
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +17 -2
- package/samples/MetroWidgetDemos/PingPong/AppTab.vue +3 -10
- package/samples/MetroWidgetDemos/PingPong/{Item.vue → TabItem.vue} +3 -11
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +2 -2
- 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 -2
- package/samples/MetroWidgetDemos/data.js +2 -1
- package/samples/NinePatchDemo/App.vue +2 -2
- package/samples/NinePatchDemo/Item.vue +1 -1
- package/samples/Preload/App.vue +17 -12
- 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 +1 -1
- 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 +43 -15
- package/samples/TextureAnimation/assets/light.png +0 -0
- package/samples/TextureAnimation/assets/light2.png +0 -0
- package/samples/TextureSize/App.vue +3 -3
- 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/VisibleSensorDemo/App.vue +94 -27
- package/tsconfig.json +6 -6
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +55 -59
- package/utils/JsViewEngineWidget/JsvFocusManager.js +1 -1
- package/utils/JsViewEngineWidget/MetroWidget/Const.js +11 -0
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +226 -107
- package/utils/JsViewEngineWidget/TemplateParser.js +227 -178
- package/utils/JsViewEngineWidget/WidgetCommon.js +13 -5
- package/utils/JsViewEngineWidget/index.js +3 -2
- package/utils/JsViewPlugin/BrowserPluginLoader.js +1 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +95 -12
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +23 -2
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +1 -1
- package/utils/JsViewPlugin/JsvPlayer/index.js +22 -1
- package/utils/JsViewPlugin/JsvPlayer/version.js +4 -4
- package/utils/JsViewVueTools/JsvImpactTracer.js +113 -0
- package/utils/JsViewVueTools/JsvStyleClass.js +1 -1
- package/utils/JsViewVueTools/index.js +2 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +11 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +1 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +7 -9
- package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +1 -1
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +3 -3
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +1 -1
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +5 -5
- package/utils/JsViewVueWidget/JsvFilterView.vue +1 -1
- package/utils/JsViewVueWidget/JsvGrid.vue +3 -11
- package/utils/JsViewVueWidget/JsvInput/Cursor.vue +5 -3
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +15 -14
- package/utils/JsViewVueWidget/JsvMarquee.vue +180 -207
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +2 -2
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +35 -27
- package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -2
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +38 -42
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +1 -1
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +1 -1
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +24 -8
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +23 -3
- package/utils/JsViewVueWidget/JsvTextBox.vue +20 -86
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +2 -9
- package/utils/JsViewVueWidget/JsvTouchContainer.vue +6 -7
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +6 -6
- package/utils/JsViewVueWidget/index.js +8 -8
- package/utils/JsViewVueWidget/utils/index.js +8 -0
- package/utils/JsViewVueWidget/utils/text.js +19 -0
- package/dom/bin/jsview-browser-debug-dom.min.js +0 -1
- package/dom/bin/jsview-dom.min.js +0 -1
- package/dom/bin/jsview-forge-define.min.js +0 -1
- package/dom/browser-root-style.css +0 -21
- package/dom/jsv-browser-debug-dom.js +0 -8
- package/dom/jsv-dom.js +0 -6
- package/dom/jsv-forge-define.js +0 -6
- package/dom/target_core_revision.mjs +0 -15
- package/loader/header_script_loader.js +0 -134
- package/loader/jsview-main.js +0 -42
- package/loader/jsview.config.default.js +0 -37
- package/loader/jsview.default.config.js +0 -37
- package/loader/loader.js +0 -179
- package/loader/loader_webkit.js +0 -40
- package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +0 -17609
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js +0 -335
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-format.js +0 -446
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-style-types.js +0 -91
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -8038
- package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1700
- package/patches/node_modules/postcss-js/objectifier.js +0 -90
- package/patches/node_modules/vite/dist/node/chunks/dep-0fc8e132.js +0 -63147
- package/patches/node_modules/vite/dist/node/jsview.vite.config.js +0 -53
- package/patches/node_modules/vue-router/dist/vue-router.mjs +0 -3595
- package/scripts/common.js +0 -58
- package/scripts/jsview-install-local-packages.js +0 -73
- package/scripts/jsview-jsmap-serve.js +0 -105
- package/scripts/jsview-post-build.js +0 -183
- package/scripts/jsview-post-install.js +0 -102
- package/scripts/jsview-run-android.js +0 -67
- 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
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* play(): 开始播放
|
|
21
21
|
-->
|
|
22
22
|
<script>
|
|
23
|
-
import { ForgeExtension } from "
|
|
23
|
+
import { ForgeExtension } from "../../../../jsview/dom/jsv-forge-define";
|
|
24
24
|
|
|
25
25
|
let LOOP_DEFAULT = 0;
|
|
26
26
|
let LOOP_INFINITE = 1;
|
|
@@ -68,7 +68,7 @@ export default {
|
|
|
68
68
|
methods: {
|
|
69
69
|
play() {
|
|
70
70
|
if (this.$refs.element) {
|
|
71
|
-
let main_view = this.$refs.element.
|
|
71
|
+
let main_view = this.$refs.element.jsvGetProxyView();
|
|
72
72
|
if (main_view && main_view.ChildViews.length > 0) {
|
|
73
73
|
let target_view = main_view.ChildViews[0];
|
|
74
74
|
if (
|
|
@@ -106,7 +106,7 @@ export default {
|
|
|
106
106
|
},
|
|
107
107
|
stop() {
|
|
108
108
|
if (this.$refs.element) {
|
|
109
|
-
let main_view = this.$refs.element.
|
|
109
|
+
let main_view = this.$refs.element.jsvGetProxyView();
|
|
110
110
|
if (main_view && main_view.ChildViews.length > 0) {
|
|
111
111
|
let target_view = main_view.ChildViews[0];
|
|
112
112
|
if (
|
|
@@ -130,7 +130,7 @@ export default {
|
|
|
130
130
|
}
|
|
131
131
|
if (this.onLoad) {
|
|
132
132
|
if (this.$refs.element) {
|
|
133
|
-
let main_view = this.$refs.element.
|
|
133
|
+
let main_view = this.$refs.element.jsvGetProxyView();
|
|
134
134
|
if (main_view && main_view.ChildViews.length > 0) {
|
|
135
135
|
let target_view = main_view.ChildViews[0];
|
|
136
136
|
if (
|
|
@@ -151,7 +151,7 @@ export default {
|
|
|
151
151
|
beforeUnmount() {
|
|
152
152
|
this.stop();
|
|
153
153
|
if (this.$refs.element) {
|
|
154
|
-
let main_view = this.$refs.element.
|
|
154
|
+
let main_view = this.$refs.element.jsvGetProxyView();
|
|
155
155
|
if (main_view && main_view.ChildViews.length > 0) {
|
|
156
156
|
let target_view = main_view.ChildViews[0];
|
|
157
157
|
if (
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* "gray-down": 黑白滤镜(公祭日滤镜)
|
|
12
12
|
-->
|
|
13
13
|
<script setup>
|
|
14
|
-
import { Forge, ForgeExtension } from "
|
|
14
|
+
import { Forge, ForgeExtension } from "../../../jsview/dom/jsv-forge-define";
|
|
15
15
|
import { onBeforeUnmount, watchEffect } from "vue";
|
|
16
16
|
|
|
17
17
|
const props = defineProps({
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
-->
|
|
67
67
|
<script>
|
|
68
68
|
import { reactive } from "vue";
|
|
69
|
-
import { EdgeDirection } from "
|
|
69
|
+
import { EdgeDirection, FocusMoveType } from "../JsViewEngineWidget";
|
|
70
70
|
|
|
71
71
|
const TAG = "JsvGrid";
|
|
72
72
|
|
|
@@ -93,15 +93,7 @@ class LineType extends UpdateType {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
NO_ADJUST: 0x00000000,
|
|
98
|
-
COLUMN_LOOP: 0x00000001,
|
|
99
|
-
ROW_LOOP: 0x00000001 << 1,
|
|
100
|
-
COLUMN_FIND_NEAR: 0x00000001 << 2,
|
|
101
|
-
ROW_FIND_NEAR: 0x00000001 << 3,
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export { PageType, LineType, FocusMoveType };
|
|
96
|
+
export { PageType, LineType };
|
|
105
97
|
|
|
106
98
|
export default {
|
|
107
99
|
props: {
|
|
@@ -668,4 +660,4 @@ export default {
|
|
|
668
660
|
></slot>
|
|
669
661
|
</div>
|
|
670
662
|
</jsv-focus-block>
|
|
671
|
-
</template>
|
|
663
|
+
</template>
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-01-20 10:37:01
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-09-02 13:28:59
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import { ref } from "vue";
|
|
9
|
+
import { ref, shallowRef } from "vue";
|
|
10
10
|
export default {
|
|
11
11
|
props: {
|
|
12
12
|
left: Number,
|
|
@@ -39,7 +39,9 @@ export default {
|
|
|
39
39
|
this.visible = show;
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
|
-
mounted() {
|
|
42
|
+
mounted() {
|
|
43
|
+
this.startBlink();
|
|
44
|
+
},
|
|
43
45
|
beforeUnmount() {
|
|
44
46
|
this._cleanInterval();
|
|
45
47
|
},
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-01-20 10:35:56
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-02
|
|
5
|
+
* @LastEditTime: 2022-09-02 13:44:56
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
|
-
import { EdgeDirection } from "
|
|
10
|
-
import { Forge, ForgeExtension } from "
|
|
9
|
+
import { EdgeDirection } from "../../JsViewEngineWidget";
|
|
10
|
+
import { Forge, ForgeExtension } from "../../../../jsview/dom/jsv-forge-define";
|
|
11
11
|
import CursorVue from "./Cursor.vue";
|
|
12
12
|
|
|
13
13
|
const InputType = {
|
|
@@ -228,9 +228,9 @@ export default {
|
|
|
228
228
|
!ifDigital(add_text) &&
|
|
229
229
|
this.type === InputType.NUMBER
|
|
230
230
|
) {
|
|
231
|
-
console.log(
|
|
232
|
-
|
|
233
|
-
);
|
|
231
|
+
// console.log(
|
|
232
|
+
// `onTextChanged add text failed, add_text:${add_text}, when input type is number!`
|
|
233
|
+
// );
|
|
234
234
|
if (this.editControlView) {
|
|
235
235
|
this.editControlView.updateCursorOffset(
|
|
236
236
|
this.fullString,
|
|
@@ -255,7 +255,7 @@ export default {
|
|
|
255
255
|
|
|
256
256
|
// 1:shown 0:hidden
|
|
257
257
|
_onStatusChanged(status) {
|
|
258
|
-
console.log("OnStatusChanged status", status);
|
|
258
|
+
// console.log("OnStatusChanged status", status);
|
|
259
259
|
},
|
|
260
260
|
|
|
261
261
|
_getStringWithFont(str) {
|
|
@@ -327,7 +327,7 @@ export default {
|
|
|
327
327
|
|
|
328
328
|
add(string) {
|
|
329
329
|
if (this.type === InputType.NUMBER && !ifDigital(string)) {
|
|
330
|
-
console.log(`The input data:${string} is not number`);
|
|
330
|
+
// console.log(`The input data:${string} is not number`);
|
|
331
331
|
return;
|
|
332
332
|
}
|
|
333
333
|
const pre_full_str = this.fullString;
|
|
@@ -573,8 +573,9 @@ export default {
|
|
|
573
573
|
},
|
|
574
574
|
|
|
575
575
|
onFocus() {
|
|
576
|
-
console.log("Input Focus");
|
|
576
|
+
// console.log("Input Focus");
|
|
577
577
|
this.isFocus = true;
|
|
578
|
+
this.$refs.cursor?.startBlink();
|
|
578
579
|
if (this.editControlView && !this.readonly) {
|
|
579
580
|
this.editControlView.showIme(
|
|
580
581
|
this.type,
|
|
@@ -586,7 +587,7 @@ export default {
|
|
|
586
587
|
|
|
587
588
|
onBlur() {
|
|
588
589
|
this.isFocus = false;
|
|
589
|
-
console.log("Input Blur");
|
|
590
|
+
// console.log("Input Blur");
|
|
590
591
|
if (this.editControlView && !this.readonly) {
|
|
591
592
|
this.editControlView.hideIme();
|
|
592
593
|
}
|
|
@@ -604,9 +605,7 @@ export default {
|
|
|
604
605
|
}
|
|
605
606
|
this.clearCursorPauseTimer();
|
|
606
607
|
this.cursorPauseTimeoutToken = setTimeout(() => {
|
|
607
|
-
|
|
608
|
-
this.$refs.cursor?.startBlink();
|
|
609
|
-
}
|
|
608
|
+
this.$refs.cursor?.startBlink();
|
|
610
609
|
}, 500);
|
|
611
610
|
},
|
|
612
611
|
onKeyDown(keyEvent) {
|
|
@@ -731,7 +730,9 @@ export default {
|
|
|
731
730
|
this.textWidth = cur_position > this.width ? cur_position : this.width;
|
|
732
731
|
this.textLeft = this._calculateSlide("", this.value, this.value.length);
|
|
733
732
|
},
|
|
734
|
-
mounted() {
|
|
733
|
+
mounted() {
|
|
734
|
+
this.$refs.cursor?.startBlink();
|
|
735
|
+
},
|
|
735
736
|
beforeUnmount() {
|
|
736
737
|
if (this.editControlViewId != -1) {
|
|
737
738
|
const view_store = ForgeExtension.RootActivity
|
|
@@ -3,239 +3,212 @@
|
|
|
3
3
|
* JsvMarquee:Vue高阶组件,文字跑马灯
|
|
4
4
|
* props说明:
|
|
5
5
|
* text {String} 文字内容
|
|
6
|
-
*
|
|
7
|
-
* fontStyles {Array|Object} 文字样式
|
|
6
|
+
* style {Object} 样式
|
|
8
7
|
* slideSpeed {int} 滚动速度 px/s, 默认60
|
|
9
8
|
* forceSlide {boolean} 短文字是否滚动,默认false
|
|
10
9
|
-->
|
|
11
10
|
|
|
12
|
-
<script>
|
|
13
|
-
import { Forge } from "
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
JsvTextStyleClass,
|
|
17
|
-
combinedStyles,
|
|
18
|
-
} from "../JsViewVueTools/JsvStyleClass";
|
|
11
|
+
<script setup>
|
|
12
|
+
import { Forge } from "../../../jsview/dom/jsv-forge-define";
|
|
13
|
+
import { getTextWidth } from "./utils";
|
|
14
|
+
import { ref, shallowRef, computed, toRaw, onMounted, onBeforeUnmount } from "vue";
|
|
19
15
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// 60px per second
|
|
51
|
-
type: Number,
|
|
52
|
-
default: 60,
|
|
53
|
-
},
|
|
54
|
-
forceSlide: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false,
|
|
57
|
-
},
|
|
58
|
-
className: {
|
|
59
|
-
type: String,
|
|
16
|
+
const defaultFontStyle = () => {
|
|
17
|
+
return {
|
|
18
|
+
color: "rgba(255,255,255,1.0)",
|
|
19
|
+
fontSize: 10,
|
|
20
|
+
textAlign: "start",
|
|
21
|
+
lineHeight: "20px",
|
|
22
|
+
whiteSpace: "nowrap",
|
|
23
|
+
direction: 'ltr'
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
text: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "",
|
|
30
|
+
},
|
|
31
|
+
style: {
|
|
32
|
+
type: Object,
|
|
33
|
+
default() {
|
|
34
|
+
return {
|
|
35
|
+
left: 0,
|
|
36
|
+
top: 0,
|
|
37
|
+
width: 0,
|
|
38
|
+
height: 20,
|
|
39
|
+
color: "rgba(255,255,255,1.0)",
|
|
40
|
+
fontSize: 10,
|
|
41
|
+
textAlign: "start",
|
|
42
|
+
lineHeight: "20px",
|
|
43
|
+
whiteSpace: "nowrap",
|
|
44
|
+
direction: 'ltr,'
|
|
45
|
+
};
|
|
60
46
|
},
|
|
61
47
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
rollTimeId: -1,
|
|
66
|
-
animationCount: 0,
|
|
67
|
-
LayoutStyle: null,
|
|
68
|
-
FontStyle: null,
|
|
69
|
-
FontStyleClass: null,
|
|
70
|
-
TokenProcessed: null,
|
|
71
|
-
};
|
|
48
|
+
slideSpeed: {
|
|
49
|
+
type: Number,
|
|
50
|
+
default: 60,
|
|
72
51
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return this.FontStyleClass ? this.FontStyleClass : this.className;
|
|
77
|
-
},
|
|
52
|
+
forceSlide: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false,
|
|
78
55
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
56
|
+
});
|
|
57
|
+
const slideDiv = shallowRef(null);
|
|
58
|
+
const textDiv = shallowRef(null);
|
|
59
|
+
let animState = 0;
|
|
60
|
+
let animIdleHandler = -1;
|
|
61
|
+
let asyncStartHandler = -1;
|
|
62
|
+
const fontStyle = computed(() => {
|
|
63
|
+
let { left, top, width, height, ...rest } = props.style;
|
|
64
|
+
let r = defaultFontStyle();
|
|
65
|
+
Object.assign(r, rest);
|
|
66
|
+
if (props.forceSlide) {
|
|
67
|
+
//滚送时必需start对齐
|
|
68
|
+
r.textAlign = "start";
|
|
69
|
+
}
|
|
70
|
+
return r;
|
|
71
|
+
});
|
|
72
|
+
//rtl文字需要先获得文字宽度
|
|
73
|
+
let textWidth =
|
|
74
|
+
fontStyle.value.direction == "rtl" ? getTextWidth(props.text, fontStyle.value) : 0;
|
|
75
|
+
const slideDivLeft = computed(() =>
|
|
76
|
+
fontStyle.value.direction == "rtl" && props.style.width < textWidth
|
|
77
|
+
? props.style.width - textWidth
|
|
78
|
+
: 0
|
|
79
|
+
);
|
|
83
80
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const text_width = this.$refs.textRef.clientWidth;
|
|
107
|
-
if (this.animationCount % 2 === 0) {
|
|
108
|
-
// 文字从原始位置,向左移动出屏幕(每次完整移动,停顿1秒)
|
|
109
|
-
this.rollTimeId = setTimeout(() => {
|
|
110
|
-
this.rollTimeId = -1;
|
|
111
|
-
const anim = new Forge.TranslateFrameAnimation(
|
|
112
|
-
0,
|
|
113
|
-
-text_width,
|
|
114
|
-
this.$props.slideSpeed,
|
|
115
|
-
true,
|
|
116
|
-
0,
|
|
117
|
-
0
|
|
118
|
-
);
|
|
119
|
-
anim.SetAnimationListener(
|
|
120
|
-
new Forge.AnimationListener(
|
|
121
|
-
null,
|
|
122
|
-
(ended) => {
|
|
123
|
-
if (ended) {
|
|
124
|
-
// 正常结束,非Cancel时,进行下一个动作
|
|
125
|
-
this._slideNextStep();
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
null
|
|
129
|
-
)
|
|
130
|
-
);
|
|
131
|
-
anim.Enable(Forge.AnimationEnable.ReleaseAfterEndCallback);
|
|
132
|
-
this.$refs.sliderRef.jsvMaskView.StartAnimation(anim);
|
|
133
|
-
this.animationCount += 1;
|
|
134
|
-
}, 1000);
|
|
135
|
-
} else {
|
|
136
|
-
// 文字从右边屏幕外部,移动回屏幕中的文字原始位置
|
|
137
|
-
const anim = new Forge.TranslateFrameAnimation(
|
|
138
|
-
this.LayoutStyle.width,
|
|
139
|
-
0,
|
|
140
|
-
this.$props.slideSpeed,
|
|
141
|
-
true,
|
|
142
|
-
this.LayoutStyle.width,
|
|
143
|
-
0
|
|
144
|
-
);
|
|
145
|
-
anim.SetAnimationListener(
|
|
146
|
-
new Forge.AnimationListener(
|
|
147
|
-
null,
|
|
148
|
-
(ended) => {
|
|
149
|
-
if (ended) {
|
|
150
|
-
// 正常结束,非Cancel时,进行下一个动作
|
|
151
|
-
this._slideNextStep();
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
null
|
|
155
|
-
)
|
|
156
|
-
);
|
|
157
|
-
this.$refs.sliderRef.jsvMaskView.StartAnimation(anim);
|
|
158
|
-
this.animationCount += 1;
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
_AnalyzeStyleChange() {
|
|
162
|
-
if (this.$props.styleToken !== this.TokenProcessed) {
|
|
163
|
-
// Token变化时,重新解析style array
|
|
164
|
-
let style_list;
|
|
165
|
-
if (this.layoutStyles instanceof Array) {
|
|
166
|
-
style_list = this.layoutStyles;
|
|
167
|
-
} else {
|
|
168
|
-
style_list = [this.layoutStyles];
|
|
169
|
-
}
|
|
170
|
-
const layout_set = combinedStyles(style_list, true);
|
|
171
|
-
this.LayoutStyle = layout_set.combinedStyle;
|
|
172
|
-
if (this.fontStyles) {
|
|
173
|
-
if (this.fontStyles instanceof Array) {
|
|
174
|
-
if (this.fontStyles[0] instanceof JsvStyleClass) {
|
|
175
|
-
style_list = [...this.fontStyles, sCommonFontStyle];
|
|
176
|
-
} else {
|
|
177
|
-
style_list = this.fontStyles.map(
|
|
178
|
-
(item) => new JsvStyleClass(item)
|
|
179
|
-
);
|
|
180
|
-
style_list.push(sCommonFontStyle);
|
|
81
|
+
const slideStep = () => {
|
|
82
|
+
if (animState == 0) {
|
|
83
|
+
// 文字从原始位置,移动出屏幕(每次完整移动,停顿1秒)
|
|
84
|
+
let start = 0,
|
|
85
|
+
end = fontStyle.value.direction == "rtl" ? textWidth : -textWidth;
|
|
86
|
+
animIdleHandler = setTimeout(() => {
|
|
87
|
+
animIdleHandler = -1;
|
|
88
|
+
const anim = new Forge.TranslateFrameAnimation(
|
|
89
|
+
start,
|
|
90
|
+
end,
|
|
91
|
+
props.slideSpeed,
|
|
92
|
+
true,
|
|
93
|
+
0,
|
|
94
|
+
0
|
|
95
|
+
);
|
|
96
|
+
anim.SetAnimationListener(
|
|
97
|
+
new Forge.AnimationListener(
|
|
98
|
+
null,
|
|
99
|
+
(ended) => {
|
|
100
|
+
if (ended) {
|
|
101
|
+
// 正常结束,非Cancel时,进行下一个动作
|
|
102
|
+
slideStep();
|
|
181
103
|
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
104
|
+
},
|
|
105
|
+
null
|
|
106
|
+
)
|
|
107
|
+
);
|
|
108
|
+
anim.Enable(Forge.AnimationEnable.ReleaseAfterEndCallback);
|
|
109
|
+
toRaw(slideDiv.value).jsvGetProxyView(true).StartAnimation(anim);
|
|
110
|
+
animState = 1;
|
|
111
|
+
}, 1000);
|
|
112
|
+
} else {
|
|
113
|
+
// 文字从屏幕外部,移动回屏幕中的文字原始位置
|
|
114
|
+
let start =
|
|
115
|
+
fontStyle.value.direction == "rtl" ? -props.style.width : props.style.width,
|
|
116
|
+
end = 0;
|
|
117
|
+
const anim = new Forge.TranslateFrameAnimation(
|
|
118
|
+
start,
|
|
119
|
+
end,
|
|
120
|
+
props.slideSpeed,
|
|
121
|
+
true,
|
|
122
|
+
props.style.width,
|
|
123
|
+
0
|
|
124
|
+
);
|
|
125
|
+
anim.SetAnimationListener(
|
|
126
|
+
new Forge.AnimationListener(
|
|
127
|
+
null,
|
|
128
|
+
(ended) => {
|
|
129
|
+
if (ended) {
|
|
130
|
+
// 正常结束,非Cancel时,进行下一个动作
|
|
131
|
+
slideStep();
|
|
189
132
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
133
|
+
},
|
|
134
|
+
null
|
|
135
|
+
)
|
|
136
|
+
);
|
|
137
|
+
toRaw(slideDiv.value.jsvGetProxyView(true)).StartAnimation(anim);
|
|
138
|
+
animState = 0;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
194
141
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
142
|
+
const stopSlide = () => {
|
|
143
|
+
if (animIdleHandler > 0) {
|
|
144
|
+
clearTimeout(animIdleHandler);
|
|
145
|
+
animIdleHandler = -1;
|
|
146
|
+
}
|
|
147
|
+
animState = 0;
|
|
148
|
+
toRaw(slideDiv.value?.jsvGetProxyView(true))?.StopAnimation();
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const asyncStartAnim = () => {
|
|
152
|
+
stopSlide();
|
|
153
|
+
// 稍进行延迟,以等待JsView的native端描绘文字并回传文字宽度
|
|
154
|
+
if (asyncStartHandler > 0) {
|
|
155
|
+
clearTimeout(asyncStartHandler);
|
|
156
|
+
}
|
|
157
|
+
asyncStartHandler = setTimeout(() => {
|
|
158
|
+
if (textWidth <= 0) {
|
|
159
|
+
textWidth = textDiv.value.clientWidth;
|
|
213
160
|
}
|
|
214
|
-
|
|
215
|
-
|
|
161
|
+
if (props.forceSlide || textWidth > props.style.width) {
|
|
162
|
+
slideStep();
|
|
163
|
+
}
|
|
164
|
+
asyncStartHandler = -1;
|
|
165
|
+
}, 500);
|
|
216
166
|
};
|
|
167
|
+
|
|
168
|
+
onMounted(() => {
|
|
169
|
+
if (fontStyle.value.direction == "ltr") {
|
|
170
|
+
//普通的ltr文字异步通过clientWidth获取文字宽度
|
|
171
|
+
asyncStartAnim();
|
|
172
|
+
} else {
|
|
173
|
+
if (props.forceSlide || textWidth > props.style.width) {
|
|
174
|
+
slideStep();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
onBeforeUnmount(() => {
|
|
180
|
+
clearTimeout(asyncStartHandler);
|
|
181
|
+
asyncStartHandler = -1;
|
|
182
|
+
stopSlide();
|
|
183
|
+
});
|
|
217
184
|
</script>
|
|
218
185
|
|
|
219
186
|
<template>
|
|
220
|
-
<div
|
|
187
|
+
<div
|
|
188
|
+
:style="{
|
|
189
|
+
left: style.left,
|
|
190
|
+
top: style.top,
|
|
191
|
+
width: style.width,
|
|
192
|
+
height: style.height,
|
|
193
|
+
overflow: 'hidden',
|
|
194
|
+
}"
|
|
195
|
+
>
|
|
221
196
|
<div
|
|
222
|
-
ref="
|
|
197
|
+
ref="slideDiv"
|
|
223
198
|
:style="{
|
|
224
|
-
left:
|
|
199
|
+
left: slideDivLeft,
|
|
225
200
|
top: 0,
|
|
226
|
-
width:
|
|
227
|
-
height:
|
|
201
|
+
width: style.width,
|
|
202
|
+
height: style.height,
|
|
228
203
|
}"
|
|
229
204
|
>
|
|
230
205
|
<div
|
|
231
|
-
ref="
|
|
232
|
-
:
|
|
233
|
-
:
|
|
234
|
-
:jsv_text_align_minwidth="LayoutStyle.width"
|
|
235
|
-
jsv-inherit-class="2"
|
|
206
|
+
ref="textDiv"
|
|
207
|
+
:style="{ ...fontStyle, height: style.height }"
|
|
208
|
+
:jsv_text_align_minwidth="style.width"
|
|
236
209
|
>
|
|
237
210
|
{{ text }}
|
|
238
211
|
</div>
|
|
239
212
|
</div>
|
|
240
213
|
</div>
|
|
241
|
-
</template>
|
|
214
|
+
</template>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
-->
|
|
14
14
|
<script>
|
|
15
|
-
import { Forge, ForgeExtension } from "
|
|
15
|
+
import { Forge, ForgeExtension } from "../../../jsview/dom/jsv-forge-define";
|
|
16
16
|
export default {
|
|
17
17
|
props: {
|
|
18
18
|
class: {
|
|
@@ -110,7 +110,7 @@ export default {
|
|
|
110
110
|
const canvas = window.originDocument.createElement("canvas");
|
|
111
111
|
canvas.style.width = this.style.width + "px";
|
|
112
112
|
canvas.style.height = this.style.height + "px";
|
|
113
|
-
this.$refs.innerView?.
|
|
113
|
+
this.$refs.innerView?.jsvGetProxyView(true).Element.appendChild(canvas);
|
|
114
114
|
|
|
115
115
|
const clip_image = new Image();
|
|
116
116
|
const bg_image = new Image();
|