@shijiu/jsview-vue-samples 1.9.783 → 1.9.825
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/Basic/components/text/TextDirection.vue +104 -0
- package/Basic/components/text/TextEmoji.vue +1 -1
- package/Basic/components/text/TextGroup1.vue +1 -1
- package/Basic/components/text/TextGroup2.vue +11 -1
- package/DemoHomepage/views/Homepage.vue +2 -1
- package/FilterDemo/App.vue +2 -2
- package/ImpactStop/App.vue +10 -6
- package/MetroWidgetDemos/Advanced/ButtonItem.vue +2 -2
- package/MetroWidgetDemos/Advanced/widgets/Item.vue +1 -2
- package/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +0 -1
- package/MetroWidgetDemos/Item.vue +1 -17
- package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +2 -2
- package/MetroWidgetDemos/WidgetItem.vue +0 -1
- package/NinePatchDemo/Item.vue +2 -2
- package/SoundPool/App.vue +1 -1
- package/ThrowMoveDemo/LRParabolicDemo.vue +33 -47
- package/package.json +1 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const gap = 5;
|
|
3
|
+
const blockSize = {
|
|
4
|
+
width: 180,
|
|
5
|
+
height: 30,
|
|
6
|
+
};
|
|
7
|
+
const unitHeight = 20 + 35;
|
|
8
|
+
|
|
9
|
+
const ltrText = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
10
|
+
const rtlText = "شلؤيثبلاهتنمةىخحضقسفعررصءغئا";
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div id="layout-root">
|
|
15
|
+
<div
|
|
16
|
+
:style="{
|
|
17
|
+
top: unitHeight * 0,
|
|
18
|
+
}"
|
|
19
|
+
>
|
|
20
|
+
<div class="explain">ltr文字省略尾部</div>
|
|
21
|
+
<div
|
|
22
|
+
class="content-font base"
|
|
23
|
+
:style="{
|
|
24
|
+
direction: 'ltr',
|
|
25
|
+
}"
|
|
26
|
+
>
|
|
27
|
+
{{ ltrText }}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div
|
|
32
|
+
:style="{
|
|
33
|
+
top: unitHeight * 1,
|
|
34
|
+
}"
|
|
35
|
+
>
|
|
36
|
+
<div class="explain">ltr文字省略头部</div>
|
|
37
|
+
<div
|
|
38
|
+
class="content-font base"
|
|
39
|
+
:style="{
|
|
40
|
+
direction: 'rtl',
|
|
41
|
+
}"
|
|
42
|
+
>
|
|
43
|
+
{{ ltrText }}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div
|
|
48
|
+
:style="{
|
|
49
|
+
top: unitHeight * 2,
|
|
50
|
+
}"
|
|
51
|
+
>
|
|
52
|
+
<div class="explain">rtl文字省略尾部</div>
|
|
53
|
+
<div
|
|
54
|
+
class="content-font base"
|
|
55
|
+
:style="{
|
|
56
|
+
direction: 'rtl',
|
|
57
|
+
}"
|
|
58
|
+
>
|
|
59
|
+
{{ rtlText }}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div
|
|
64
|
+
:style="{
|
|
65
|
+
top: unitHeight * 3,
|
|
66
|
+
}"
|
|
67
|
+
>
|
|
68
|
+
<div class="explain">rtl文字省略头部</div>
|
|
69
|
+
<div
|
|
70
|
+
class="content-font base"
|
|
71
|
+
:style="{
|
|
72
|
+
direction: 'ltr',
|
|
73
|
+
}"
|
|
74
|
+
>
|
|
75
|
+
{{ rtlText }}
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<style>
|
|
82
|
+
@import "../FontStyle.css";
|
|
83
|
+
|
|
84
|
+
.base {
|
|
85
|
+
top: 25px;
|
|
86
|
+
width: 180px;
|
|
87
|
+
height: 30px;
|
|
88
|
+
line-height: 30px;
|
|
89
|
+
background-color: rgba(255, 255, 0, 0.5);
|
|
90
|
+
color: #ff0000;
|
|
91
|
+
font-size: 25px;
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
text-overflow: ellipsis;
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.explain {
|
|
98
|
+
width: 180px;
|
|
99
|
+
height: 20px;
|
|
100
|
+
line-height: 20px;
|
|
101
|
+
font-size: 15px;
|
|
102
|
+
color: #000000;
|
|
103
|
+
}
|
|
104
|
+
</style>
|
|
@@ -38,7 +38,7 @@ const contentBlockProps = {
|
|
|
38
38
|
<ContentBlock
|
|
39
39
|
:class="contentClass"
|
|
40
40
|
:style="{ top: itemSides.height * 2 }"
|
|
41
|
-
:="{ ...contentBlockProps, itemSides: { ...itemSides, height:
|
|
41
|
+
:="{ ...contentBlockProps, itemSides: { ...itemSides, height: 320 } }"
|
|
42
42
|
:index="2"
|
|
43
43
|
title="文字折行"
|
|
44
44
|
>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import ContentBlock from "../ContentBlock.vue";
|
|
3
3
|
import TextEmoji from "./TextEmoji.vue";
|
|
4
|
+
import TextDirection from "./TextDirection.vue";
|
|
4
5
|
|
|
5
6
|
const props = defineProps({
|
|
6
7
|
contentClass: String,
|
|
@@ -19,10 +20,19 @@ const contentBlockProps = {
|
|
|
19
20
|
:style="{ top: itemSides.height * 0 }"
|
|
20
21
|
:="contentBlockProps"
|
|
21
22
|
:index="0"
|
|
22
|
-
title="
|
|
23
|
+
title="emoji"
|
|
23
24
|
>
|
|
24
25
|
<TextEmoji />
|
|
25
26
|
</ContentBlock>
|
|
27
|
+
<ContentBlock
|
|
28
|
+
:class="contentClass"
|
|
29
|
+
:style="{ top: itemSides.height * 1 }"
|
|
30
|
+
:="{ ...contentBlockProps, itemSides: { ...itemSides, height: 250 } }"
|
|
31
|
+
:index="0"
|
|
32
|
+
title="不同方向文字省略"
|
|
33
|
+
>
|
|
34
|
+
<text-direction />
|
|
35
|
+
</ContentBlock>
|
|
26
36
|
</div>
|
|
27
37
|
</template>
|
|
28
38
|
|
|
@@ -40,6 +40,7 @@ export default {
|
|
|
40
40
|
tabId: 0,
|
|
41
41
|
preFocusName: "",
|
|
42
42
|
curFocusName: "",
|
|
43
|
+
isDevelopment: process.env.NODE_ENV !== 'production',
|
|
43
44
|
};
|
|
44
45
|
},
|
|
45
46
|
setup() {
|
|
@@ -128,7 +129,7 @@ export default {
|
|
|
128
129
|
<div class="address">
|
|
129
130
|
{{ address }}
|
|
130
131
|
</div>
|
|
131
|
-
<div class="logo">JsView-Vue3 (Vite3)</div>
|
|
132
|
+
<div class="logo">{{ 'JsView-Vue3 (Vite3) [' + (isDevelopment ? 'Debug' : 'Release') + ']' }}</div>
|
|
132
133
|
|
|
133
134
|
<jsv-focus-block
|
|
134
135
|
autoFocus
|
package/FilterDemo/App.vue
CHANGED
|
@@ -63,7 +63,7 @@ onMounted(() => {
|
|
|
63
63
|
:width="501"
|
|
64
64
|
:height="401"
|
|
65
65
|
ref="filter1"
|
|
66
|
-
:filterType="
|
|
66
|
+
:filterType="filterType.type"
|
|
67
67
|
>
|
|
68
68
|
<div
|
|
69
69
|
:style="{
|
|
@@ -92,7 +92,7 @@ onMounted(() => {
|
|
|
92
92
|
:width="402"
|
|
93
93
|
:height="402"
|
|
94
94
|
ref="filter2"
|
|
95
|
-
:filterType="
|
|
95
|
+
:filterType="filterType.type"
|
|
96
96
|
>
|
|
97
97
|
<div
|
|
98
98
|
:style="{
|
package/ImpactStop/App.vue
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script setup>
|
|
9
|
+
import { jJsvRuntimeBridge } from "@shijiu/jsview-vue/utils/JsViewVueTools/JsvRuntimeBridge";
|
|
9
10
|
import {
|
|
10
11
|
JsvActorMoveControl,
|
|
11
12
|
JsvActorMove,
|
|
@@ -28,10 +29,11 @@ const verticalControl = new JsvActorMoveControl();
|
|
|
28
29
|
const boxLeft = shallowRef(null);
|
|
29
30
|
const boxMid = shallowRef(null);
|
|
30
31
|
const boxRight = shallowRef(null);
|
|
31
|
-
const actorVertical = { current: null };
|
|
32
|
-
const actorHorizontal = { current: null };
|
|
33
32
|
const actor = shallowRef(null);
|
|
34
33
|
|
|
34
|
+
let actorVertical = shallowRef(null);
|
|
35
|
+
let actorHorizontal = shallowRef(null);
|
|
36
|
+
|
|
35
37
|
let viewsAutoFroze = null;
|
|
36
38
|
let sensorList = [];
|
|
37
39
|
let onBoard = CONST_BOARD_LEFT;
|
|
@@ -195,7 +197,7 @@ onMounted(() => {
|
|
|
195
197
|
|
|
196
198
|
/* 将碰撞发生后要停止动画的元素打包 */
|
|
197
199
|
viewsAutoFroze = createImpactAutoFroze(
|
|
198
|
-
[actorVertical.
|
|
200
|
+
[actorVertical.value.mainDiv, actorHorizontal.value.mainDiv],
|
|
199
201
|
null
|
|
200
202
|
); // 此句柄最好保留,未来可以通过此句柄统一进行views list更新
|
|
201
203
|
|
|
@@ -236,6 +238,8 @@ onMounted(() => {
|
|
|
236
238
|
);
|
|
237
239
|
|
|
238
240
|
reset();
|
|
241
|
+
|
|
242
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
239
243
|
});
|
|
240
244
|
|
|
241
245
|
onBeforeUnmount(() => {
|
|
@@ -379,12 +383,12 @@ onBeforeUnmount(() => {
|
|
|
379
383
|
<div key="actor" :style="{ top: 520 - CONST_BOX_HEIGHT - 2, left: 40 }">
|
|
380
384
|
<jsv-actor-move
|
|
381
385
|
key="horizontal"
|
|
382
|
-
|
|
386
|
+
ref="actorHorizontal"
|
|
383
387
|
:control="horizontalControl"
|
|
384
388
|
>
|
|
385
389
|
<jsv-actor-move
|
|
386
390
|
key="vertical"
|
|
387
|
-
|
|
391
|
+
ref="actorVertical"
|
|
388
392
|
:control="verticalControl"
|
|
389
393
|
>
|
|
390
394
|
<div
|
|
@@ -432,4 +436,4 @@ onBeforeUnmount(() => {
|
|
|
432
436
|
text-overflow: ellipsis;
|
|
433
437
|
text-align: center;
|
|
434
438
|
}
|
|
435
|
-
</style>
|
|
439
|
+
</style>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-07-11 13:26:24
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-12-02 16:10:16
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script setup>
|
|
@@ -11,7 +11,7 @@ import { useFocusHub } from "jsview";
|
|
|
11
11
|
|
|
12
12
|
const props = defineProps({
|
|
13
13
|
data: Object,
|
|
14
|
-
query:
|
|
14
|
+
query: Object,
|
|
15
15
|
onAction: Object,
|
|
16
16
|
onItemEdge: Function,
|
|
17
17
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-11-01 15:30:14
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-12-02 16:11:54
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<!--
|
|
@@ -74,7 +74,6 @@ props.onAction.register("onClick", onClick);
|
|
|
74
74
|
color: '#FFFFFF',
|
|
75
75
|
backgroundColor: data.color,
|
|
76
76
|
borderRadius: '10px',
|
|
77
|
-
animation: animation,
|
|
78
77
|
}"
|
|
79
78
|
>
|
|
80
79
|
{{ data.content }}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-05-10 15:21:24
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-12-02 16:12:43
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script setup>
|
|
@@ -17,25 +17,9 @@ const props = defineProps({
|
|
|
17
17
|
const divRef = shallowRef(null);
|
|
18
18
|
const focused = ref(false);
|
|
19
19
|
|
|
20
|
-
const focusSize = inject("focusSize");
|
|
21
|
-
|
|
22
20
|
// 自身的焦点状态自己记录, 通过回调来改变
|
|
23
21
|
const onFocus = () => {
|
|
24
22
|
focused.value = true;
|
|
25
|
-
if (focusSize) {
|
|
26
|
-
divRef.value?.getBoundingClientRect().then(
|
|
27
|
-
(data) => {
|
|
28
|
-
console.log("testtest focus size", data)
|
|
29
|
-
focusSize.width = data.width;
|
|
30
|
-
focusSize.height = data.height;
|
|
31
|
-
focusSize.left = data.left;
|
|
32
|
-
focusSize.top = data.top;
|
|
33
|
-
},
|
|
34
|
-
(error) => {
|
|
35
|
-
console.log("testtest abs failed", error);
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
23
|
};
|
|
40
24
|
const onBlur = () => {
|
|
41
25
|
focused.value = false;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-09-29 16:13:35
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2022-12-02 16:14:11
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
@@ -10,7 +10,7 @@ import { ref, shallowRef } from "vue";
|
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
props: {
|
|
13
|
-
name:
|
|
13
|
+
name: String,
|
|
14
14
|
onEdgeDown: Function,
|
|
15
15
|
onItemFocus: Function,
|
|
16
16
|
},
|
package/NinePatchDemo/Item.vue
CHANGED
|
@@ -50,7 +50,7 @@ props.onAction.register("onClick", onClicked);
|
|
|
50
50
|
|
|
51
51
|
<template>
|
|
52
52
|
<div :class="focused ? 'focus' : 'blur'" :style="styleValue">
|
|
53
|
-
{{
|
|
53
|
+
{{ data.content }}
|
|
54
54
|
</div>
|
|
55
55
|
</template>
|
|
56
56
|
|
|
@@ -66,4 +66,4 @@ props.onAction.register("onClick", onClicked);
|
|
|
66
66
|
transition: transform 0.25s linear;
|
|
67
67
|
font-size: 30px;
|
|
68
68
|
}
|
|
69
|
-
</style>
|
|
69
|
+
</style>
|
package/SoundPool/App.vue
CHANGED
|
@@ -128,7 +128,7 @@ onBeforeUnmount(() => {
|
|
|
128
128
|
`[确定]: 播放背景音乐\n[左]: 播放失败音乐1\n[右]: 播放失败音乐2\n[上]: 播放硬币音乐1\n[下]: 播放硬币音乐2`
|
|
129
129
|
}}
|
|
130
130
|
</div>
|
|
131
|
-
<audiotrack ref="bgm" :src="bgmusic" loop="loop" />
|
|
131
|
+
<jsv-audiotrack ref="bgm" :src="bgmusic" loop="loop" />
|
|
132
132
|
</div>
|
|
133
133
|
</jsv-focus-block>
|
|
134
134
|
</template>
|
|
@@ -5,56 +5,42 @@
|
|
|
5
5
|
* @LastEditTime: 2021-10-21 14:01:59
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
|
-
<script>
|
|
8
|
+
<script setup>
|
|
9
9
|
import { JsvActorMoveControl, JsvActorMove } from "jsview";
|
|
10
|
+
import { shallowRef } from "vue";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
props: {
|
|
16
|
-
name: String,
|
|
17
|
-
},
|
|
18
|
-
data() {
|
|
19
|
-
return {
|
|
20
|
-
direction: 1,
|
|
21
|
-
};
|
|
22
|
-
},
|
|
23
|
-
setup() {
|
|
24
|
-
let throwControl = new JsvActorMoveControl(); // 抛物运动体控制器
|
|
25
|
-
let moveControl = new JsvActorMoveControl(); // 平移运动体控制器
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
name: String,
|
|
14
|
+
});
|
|
26
15
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
moveControl,
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
methods: {
|
|
33
|
-
onKeyDown(ev) {
|
|
34
|
-
switch (ev.keyCode) {
|
|
35
|
-
case 13:
|
|
36
|
-
this.direction = -this.direction;
|
|
16
|
+
let throwControl = new JsvActorMoveControl(); // 抛物运动体控制器
|
|
17
|
+
let moveControl = new JsvActorMoveControl(); // 平移运动体控制器
|
|
37
18
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
19
|
+
let direction = shallowRef(1);
|
|
20
|
+
|
|
21
|
+
function onKeyDown(ev) {
|
|
22
|
+
switch (ev.keyCode) {
|
|
23
|
+
case 13:
|
|
24
|
+
direction.value = -direction.value;
|
|
25
|
+
|
|
26
|
+
moveControl.moveToX(195 * direction.value, 250, (x, y) => {
|
|
27
|
+
console.log(`Move end with x=${x} y=${y}`);
|
|
28
|
+
});
|
|
29
|
+
throwControl.throwAlongY(
|
|
30
|
+
-500,
|
|
31
|
+
750,
|
|
32
|
+
{ type: "catch", position: 0, direction: 1 },
|
|
33
|
+
(x, y) => {
|
|
34
|
+
console.log(`Throw end with x=${x} y=${y}`);
|
|
35
|
+
},
|
|
36
|
+
() => {
|
|
37
|
+
console.log("Get to the pole...");
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
58
44
|
</script>
|
|
59
45
|
|
|
60
46
|
<template>
|
|
@@ -112,4 +98,4 @@ export default {
|
|
|
112
98
|
text-overflow: ellipsis;
|
|
113
99
|
text-align: center;
|
|
114
100
|
}
|
|
115
|
-
</style>
|
|
101
|
+
</style>
|