@shijiu/jsview-vue 0.9.684 → 0.9.783
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 -1
- 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/BasicFocusControl/components/BaseBlock.vue +2 -2
- package/samples/Collision/App.vue +11 -11
- package/samples/DemoHomepage/App.vue +67 -8
- package/samples/DemoHomepage/components/TabFrame.vue +7 -0
- package/samples/DemoHomepage/router.js +27 -26
- package/samples/DemoHomepage/views/Homepage.vue +89 -98
- package/samples/FilterDemo/App.vue +1 -1
- package/samples/FlipCard/App.vue +2 -2
- package/samples/FlipCard/FlipCard.vue +3 -3
- package/samples/FocusBlockDemos/AutoFocus/App.vue +51 -0
- package/samples/FocusBlockDemos/AutoFocus/BaseBlock.vue +82 -0
- package/samples/FocusBlockDemos/AutoFocus/DialogBlock.vue +89 -0
- package/samples/FocusBlockDemos/AutoFocus/DialogContorls.js +42 -0
- package/samples/FocusBlockDemos/AutoFocus/FocusNamesDefine.js +9 -0
- package/samples/FocusBlockDemos/AutoFocus/PlaneBlock.vue +71 -0
- package/samples/FocusBlockDemos/ProgressiveFocusControl/App.vue +78 -0
- package/samples/FocusBlockDemos/ProgressiveFocusControl/BaseBlock.vue +77 -0
- package/samples/FocusBlockDemos/ProgressiveFocusControl/DownPlaneBlock.vue +83 -0
- package/samples/FocusBlockDemos/ProgressiveFocusControl/FocusNamesDefine.js +12 -0
- package/samples/FocusBlockDemos/ProgressiveFocusControl/UpPlaneBlock.vue +83 -0
- 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 +34 -3
- package/samples/Marquee/longText.js +2 -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/App.vue +22 -11
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +5 -5
- package/samples/MetroWidgetDemos/{Item.vue → PingPong/Item.vue} +3 -21
- package/samples/MetroWidgetDemos/PingPong/TabItem.vue +1 -1
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +5 -5
- package/samples/MetroWidgetDemos/{WidgetItem.vue → PingPong/WidgetItem.vue} +8 -4
- package/samples/MetroWidgetDemos/basic/App.vue +162 -0
- package/samples/MetroWidgetDemos/basic/Item.vue +43 -0
- package/samples/MetroWidgetDemos/direction/App.vue +158 -0
- package/samples/MetroWidgetDemos/direction/Item.vue +45 -0
- package/samples/MetroWidgetDemos/focusableItemBasic/App.vue +67 -0
- package/samples/MetroWidgetDemos/{Advanced → focusableItemBasic}/ButtonItem.vue +17 -21
- package/samples/MetroWidgetDemos/focusableItemMetroWidget/App.vue +74 -0
- package/samples/MetroWidgetDemos/{Advanced/widgets → focusableItemMetroWidget}/Item.vue +13 -32
- package/samples/MetroWidgetDemos/{Advanced/widgets → focusableItemMetroWidget}/WidgetItem.vue +12 -12
- package/samples/MetroWidgetDemos/focusableItemMix/App.vue +88 -0
- package/samples/MetroWidgetDemos/focusableItemMix/ButtonItem.vue +86 -0
- package/samples/MetroWidgetDemos/focusableItemMix/Item.vue +43 -0
- package/samples/MetroWidgetDemos/index.js +6 -0
- package/samples/MetroWidgetDemos/layoutType/App.vue +180 -0
- package/samples/MetroWidgetDemos/layoutType/Item.vue +45 -0
- package/samples/MetroWidgetDemos/padding/App.vue +222 -0
- package/samples/MetroWidgetDemos/padding/Item.vue +64 -0
- package/samples/MetroWidgetDemos/routeList.js +64 -0
- package/samples/MetroWidgetDemos/slideSetting/App.vue +225 -0
- package/samples/MetroWidgetDemos/slideSetting/Item.vue +45 -0
- package/samples/NinePatchDemo/App.vue +78 -122
- package/samples/NinePatchDemo/Item.vue +29 -27
- package/samples/Preload/App.vue +1 -1
- package/samples/Preload/Item.vue +1 -1
- package/samples/QrcodeDemo/App.vue +1 -1
- package/samples/SoundPool/App.vue +3 -3
- package/samples/SpriteImage/App.vue +5 -0
- package/samples/Swiper/App.vue +148 -0
- package/samples/TextBox/App.vue +2 -1
- package/samples/TextureAnimation/App2.vue +1 -1
- 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/MetroWidget.vue +79 -50
- package/utils/JsViewEngineWidget/TemplateParser.js +144 -147
- package/utils/JsViewEngineWidget/WidgetCommon.js +12 -3
- 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/index.js +1 -1
- 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/{JsViewVueWidget/utils/text.js → JsViewVueTools/JsvTextTools.js} +24 -4
- 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 +91 -20
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvNinePatch.vue +63 -53
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +10 -5
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -2
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +116 -80
- package/utils/JsViewVueWidget/JsvSwiper/index.js +3 -2
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +1 -1
- package/utils/JsViewVueWidget/JsvTextBox.vue +11 -31
- package/utils/JsViewVueWidget/JsvTouchContainer.vue +2 -2
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +5 -5
- package/utils/JsViewVueWidget/index.js +8 -8
- package/samples/MetroWidgetDemos/Advanced/App.vue +0 -46
- package/samples/MetroWidgetDemos/Advanced/Buttons.vue +0 -70
- package/samples/MetroWidgetDemos/Advanced/Mixed.vue +0 -77
- package/samples/MetroWidgetDemos/Advanced/widgets/Widgets.vue +0 -116
- package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
- package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +0 -75
- package/samples/MetroWidgetDemos/Simple/App.vue +0 -45
- package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +0 -111
- package/samples/MetroWidgetDemos/data.js +0 -205
- package/utils/JsViewVueWidget/JsvSwiper/Indicator.vue +0 -35
- package/utils/JsViewVueWidget/utils/index.js +0 -8
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
* indicatorAlign {String} 指示面板的 align, 值为 start / middle / end,默认为middle
|
|
11
11
|
* totalFrame {int} (必需)item 的个数
|
|
12
12
|
* firstFrame {int} 初始 item 的 index,默认为0
|
|
13
|
-
* layoutInfo {Object} (必需)
|
|
14
|
-
* onClick
|
|
13
|
+
* layoutInfo {Object} (必需)组件的大小及位置 {top: 0, left: 0, width: 0, height: 0}
|
|
14
|
+
* onClick {Function} 点击事件 function () {}
|
|
15
15
|
* onChange {Function} 滚动事件 function (index) {}
|
|
16
|
+
* onEdge {Function} 到达边缘事件 ({direction: EdgeDirection}) => Void
|
|
16
17
|
* autoplayInterval {int} 自动滚动的时间(毫秒),等于0时不自动滚动, 默认为5000
|
|
17
18
|
* animation {Object} 滚动动画设置 {duration: 0, easing: "linear"}
|
|
18
19
|
* vertical {boolean} 组件是否为纵向的,默认为 false
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
* swipeType {String} 切换方式,目前只支持 translate,之后可能会添加 opacity 等方式
|
|
23
24
|
* smoothTranslate {boolean} 平滑模式动画开关
|
|
24
25
|
* reverseSwipe {boolean} 反转滚动方向,默认值为false. 默认滚动方向是正向, 既向index增大的方向, 反转后为反向, 既向index减小的方向
|
|
26
|
+
* disableLoopWhenFocus {boolean} 获焦时按键是否循环滚动
|
|
25
27
|
* public methods:
|
|
26
28
|
* slideTo
|
|
27
29
|
* @description 滚动到指定id
|
|
@@ -35,8 +37,8 @@ import JsvActorMove, {
|
|
|
35
37
|
JsvActorMoveControl,
|
|
36
38
|
} from "jsview/utils/JsViewVueWidget/JsvActorMove";
|
|
37
39
|
import JsvVisibleSensor from "jsview/utils/JsViewVueWidget/JsvVisibleSensor";
|
|
38
|
-
import
|
|
39
|
-
import { ref } from "vue";
|
|
40
|
+
import { EdgeDirection } from "../../JsViewEngineWidget/WidgetCommon";
|
|
41
|
+
import { ref, shallowRef } from "vue";
|
|
40
42
|
|
|
41
43
|
const VIEW_NUM = 3;
|
|
42
44
|
|
|
@@ -50,8 +52,24 @@ function modToRange(value, mod, start = 0) {
|
|
|
50
52
|
return m;
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
const keyCode2EdgeDirection = (keyCode) => {
|
|
56
|
+
switch (keyCode) {
|
|
57
|
+
case 37:
|
|
58
|
+
return EdgeDirection.left;
|
|
59
|
+
case 38:
|
|
60
|
+
return EdgeDirection.top;
|
|
61
|
+
case 39:
|
|
62
|
+
return EdgeDirection.right;
|
|
63
|
+
case 40:
|
|
64
|
+
return EdgeDirection.bottom;
|
|
65
|
+
default:
|
|
66
|
+
console.error("not direction key", keyCode);
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
53
71
|
export default {
|
|
54
|
-
components: {
|
|
72
|
+
components: { JsvActorMove, JsvVisibleSensor },
|
|
55
73
|
props: {
|
|
56
74
|
showIndicator: {
|
|
57
75
|
type: Boolean,
|
|
@@ -71,6 +89,10 @@ export default {
|
|
|
71
89
|
},
|
|
72
90
|
indicatorAlign: {
|
|
73
91
|
type: String,
|
|
92
|
+
validator(value) {
|
|
93
|
+
// The value must match one of these strings
|
|
94
|
+
return ["start", "middle", "end"].includes(value);
|
|
95
|
+
},
|
|
74
96
|
default: "middle",
|
|
75
97
|
},
|
|
76
98
|
totalFrame: {
|
|
@@ -91,6 +113,9 @@ export default {
|
|
|
91
113
|
onChange: {
|
|
92
114
|
type: Function,
|
|
93
115
|
},
|
|
116
|
+
onEdge: {
|
|
117
|
+
type: Function,
|
|
118
|
+
},
|
|
94
119
|
autoplayInterval: {
|
|
95
120
|
type: Number,
|
|
96
121
|
default: 5000,
|
|
@@ -129,8 +154,17 @@ export default {
|
|
|
129
154
|
type: Boolean,
|
|
130
155
|
default: false,
|
|
131
156
|
},
|
|
157
|
+
disableLoopWhenFocus: {
|
|
158
|
+
type: Boolean,
|
|
159
|
+
default: false,
|
|
160
|
+
},
|
|
132
161
|
},
|
|
133
162
|
computed: {
|
|
163
|
+
indexList() {
|
|
164
|
+
return new Array(this.totalFrame).fill(0).map((_, index) => {
|
|
165
|
+
return index;
|
|
166
|
+
});
|
|
167
|
+
},
|
|
134
168
|
indicatorLayout() {
|
|
135
169
|
let indicatorSize =
|
|
136
170
|
this.totalFrame * (this.dotSize + this.dotGap) - this.dotGap;
|
|
@@ -286,47 +320,64 @@ export default {
|
|
|
286
320
|
}
|
|
287
321
|
},
|
|
288
322
|
_onKeyDown(ev) {
|
|
323
|
+
let direction = 0;
|
|
289
324
|
switch (ev.keyCode) {
|
|
290
325
|
case 37:
|
|
291
326
|
if (!this.vertical) {
|
|
292
|
-
|
|
293
|
-
return true;
|
|
327
|
+
direction = -1;
|
|
294
328
|
}
|
|
295
329
|
break;
|
|
296
330
|
case 38:
|
|
297
331
|
if (this.vertical) {
|
|
298
|
-
|
|
299
|
-
return true;
|
|
332
|
+
direction = -1;
|
|
300
333
|
}
|
|
301
334
|
break;
|
|
302
335
|
case 39:
|
|
303
336
|
if (!this.vertical) {
|
|
304
|
-
|
|
305
|
-
return true;
|
|
337
|
+
direction = 1;
|
|
306
338
|
}
|
|
307
339
|
break;
|
|
308
340
|
case 40:
|
|
309
341
|
if (this.vertical) {
|
|
310
|
-
|
|
311
|
-
return true;
|
|
342
|
+
direction = 1;
|
|
312
343
|
}
|
|
313
344
|
break;
|
|
314
345
|
case 13:
|
|
315
|
-
this.onClick?.();
|
|
346
|
+
this.onClick?.(this.currentDataIndex);
|
|
316
347
|
return true;
|
|
317
348
|
default:
|
|
318
|
-
|
|
349
|
+
return false;
|
|
319
350
|
}
|
|
320
351
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
352
|
+
//处理方向键
|
|
353
|
+
if (direction !== 0) {
|
|
354
|
+
if (!this.disableLoopWhenFocus) {
|
|
355
|
+
this._trigger(direction);
|
|
356
|
+
return true;
|
|
357
|
+
} else {
|
|
358
|
+
if (
|
|
359
|
+
this.currentDataIndex + direction >= 0 &&
|
|
360
|
+
this.currentDataIndex + direction < this.totalFrame
|
|
361
|
+
) {
|
|
362
|
+
this._trigger(direction);
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
//未处理方向键
|
|
369
|
+
this.onEdge?.({
|
|
370
|
+
direction: keyCode2EdgeDirection(ev.keyCode),
|
|
371
|
+
rect: {
|
|
372
|
+
x: this.layoutInfo.left,
|
|
373
|
+
y: this.layoutInfo.top,
|
|
374
|
+
width: this.layoutInfo.width,
|
|
375
|
+
height: this.layoutInfo.height,
|
|
376
|
+
},
|
|
377
|
+
});
|
|
378
|
+
return true;
|
|
329
379
|
},
|
|
380
|
+
_onAnimationEnd() {},
|
|
330
381
|
_onFocus() {
|
|
331
382
|
this.focused = true;
|
|
332
383
|
this.stopAutoplay();
|
|
@@ -370,12 +421,14 @@ export default {
|
|
|
370
421
|
curViewAnimation.SetAnimationListener(
|
|
371
422
|
new Forge.AnimationListener(null, this._onAnimationEnd, null)
|
|
372
423
|
);
|
|
373
|
-
this.$refs["element" + this.currentViewIndex]
|
|
374
|
-
|
|
375
|
-
|
|
424
|
+
this.$refs["element" + this.currentViewIndex]
|
|
425
|
+
?.jsvGetProxyView(true)
|
|
426
|
+
.StartAnimation(curViewAnimation);
|
|
376
427
|
this.$refs[
|
|
377
428
|
"element" + modToRange(this.currentViewIndex - direction, VIEW_NUM)
|
|
378
|
-
]
|
|
429
|
+
]
|
|
430
|
+
?.jsvGetProxyView(true)
|
|
431
|
+
.StartAnimation(preViewAnimation);
|
|
379
432
|
},
|
|
380
433
|
_startSmoothTranslateAnimation() {
|
|
381
434
|
let curController = this.controllerList[this.currentViewIndex];
|
|
@@ -412,7 +465,9 @@ export default {
|
|
|
412
465
|
if ((old_h && !new_h) || (old_v && !new_h)) {
|
|
413
466
|
this.stopAutoplay();
|
|
414
467
|
} else if ((!old_h && new_h) || (!old_v && new_h)) {
|
|
415
|
-
this.
|
|
468
|
+
if (!this.focused) {
|
|
469
|
+
this.startAutoplay();
|
|
470
|
+
}
|
|
416
471
|
}
|
|
417
472
|
},
|
|
418
473
|
},
|
|
@@ -438,6 +493,12 @@ export default {
|
|
|
438
493
|
></jsv-visible-sensor>
|
|
439
494
|
<jsv-focus-block
|
|
440
495
|
:name="name"
|
|
496
|
+
:style="{
|
|
497
|
+
left: layoutInfo.left,
|
|
498
|
+
top: layoutInfo.top,
|
|
499
|
+
width: layoutInfo.width,
|
|
500
|
+
height: layoutInfo.height,
|
|
501
|
+
}"
|
|
441
502
|
:onAction="{
|
|
442
503
|
onFocus: _onFocus,
|
|
443
504
|
onBlur: _onBlur,
|
|
@@ -481,17 +542,6 @@ export default {
|
|
|
481
542
|
:focused="focused"
|
|
482
543
|
></slot>
|
|
483
544
|
</div>
|
|
484
|
-
|
|
485
|
-
<!-- <div
|
|
486
|
-
:style="{
|
|
487
|
-
width: 50,
|
|
488
|
-
height: 50,
|
|
489
|
-
top: 200,
|
|
490
|
-
fontSize: '30px',
|
|
491
|
-
}"
|
|
492
|
-
>
|
|
493
|
-
{{ index }}
|
|
494
|
-
</div> -->
|
|
495
545
|
</jsv-actor-move>
|
|
496
546
|
</div>
|
|
497
547
|
<div v-else>
|
|
@@ -510,53 +560,39 @@ export default {
|
|
|
510
560
|
:focused="focused"
|
|
511
561
|
></slot>
|
|
512
562
|
</div>
|
|
513
|
-
|
|
514
|
-
<!-- <div
|
|
515
|
-
:style="{
|
|
516
|
-
width: 50,
|
|
517
|
-
height: 50,
|
|
518
|
-
top: 200,
|
|
519
|
-
fontSize: '30px',
|
|
520
|
-
}"
|
|
521
|
-
>
|
|
522
|
-
{{ index + " " + item.dataIndex }}
|
|
523
|
-
</div> -->
|
|
524
563
|
</div>
|
|
525
564
|
</div>
|
|
526
565
|
</div>
|
|
527
566
|
|
|
528
567
|
<div v-if="showIndicator" :style="indicatorLayout">
|
|
529
|
-
<
|
|
530
|
-
|
|
531
|
-
:
|
|
532
|
-
:
|
|
533
|
-
|
|
568
|
+
<div
|
|
569
|
+
v-for="index in indexList"
|
|
570
|
+
:key="index"
|
|
571
|
+
:style="
|
|
572
|
+
vertical
|
|
573
|
+
? { top: indicatorDotSize * index }
|
|
574
|
+
: { left: indicatorDotSize * index }
|
|
575
|
+
"
|
|
534
576
|
>
|
|
535
|
-
<
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
borderRadius: '5px',
|
|
555
|
-
}"
|
|
556
|
-
></div>
|
|
557
|
-
</slot>
|
|
558
|
-
</template>
|
|
559
|
-
</indicator>
|
|
577
|
+
<slot
|
|
578
|
+
name="indicatorDot"
|
|
579
|
+
:dataIndex="index"
|
|
580
|
+
:currentIndex="currentDataIndex"
|
|
581
|
+
:focused="focused"
|
|
582
|
+
>
|
|
583
|
+
<div
|
|
584
|
+
:style="{
|
|
585
|
+
width: dotSize,
|
|
586
|
+
height: dotSize,
|
|
587
|
+
backgroundColor:
|
|
588
|
+
index == currentDataIndex
|
|
589
|
+
? 'rgba(50, 50, 50, 1.0)'
|
|
590
|
+
: 'rgba(100, 100, 100, 0.7)',
|
|
591
|
+
borderRadius: Math.round(dotSize / 2) + 'px',
|
|
592
|
+
}"
|
|
593
|
+
></div>
|
|
594
|
+
</slot>
|
|
595
|
+
</div>
|
|
560
596
|
</div>
|
|
561
597
|
</div>
|
|
562
598
|
</jsv-focus-block>
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
* verticalAlign {string} 垂直对齐方式 (必需) top、middle、bottom
|
|
9
9
|
* style {object} 样式(必需)
|
|
10
10
|
* enableLatex {bool} 是否启用Latex文字描画模式
|
|
11
|
+
* textDirection {string} 内容文字的方向, 默认是unset, 此时会根据第一个字符的语言确定文字是ltr还是rtl
|
|
11
12
|
-->
|
|
12
13
|
|
|
13
14
|
<script setup>
|
|
14
|
-
import { ref, computed } from "vue";
|
|
15
|
+
import { ref, shallowRef, computed } from "vue";
|
|
15
16
|
|
|
16
17
|
const props = defineProps({
|
|
17
18
|
style: Object,
|
|
@@ -23,49 +24,28 @@ const props = defineProps({
|
|
|
23
24
|
type: String,
|
|
24
25
|
default: "middle",
|
|
25
26
|
},
|
|
26
|
-
enableLatex:
|
|
27
|
+
enableLatex: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false,
|
|
30
|
+
},
|
|
27
31
|
className: String,
|
|
32
|
+
textDirection: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "unset",
|
|
35
|
+
},
|
|
28
36
|
});
|
|
29
37
|
|
|
30
|
-
const innerStyle = computed(() => {
|
|
31
|
-
let result = { ...props.style };
|
|
32
|
-
if (!result.verticalAlign) {
|
|
33
|
-
result.verticalAlign = props.verticalAlign;
|
|
34
|
-
}
|
|
35
|
-
if (!result.lineAlign) {
|
|
36
|
-
result.lineAlign = props.lineAlign;
|
|
37
|
-
}
|
|
38
|
-
return result;
|
|
39
|
-
});
|
|
40
|
-
const disable = window.JsvDisableReactWrapper;
|
|
41
38
|
</script>
|
|
42
39
|
|
|
43
40
|
<template>
|
|
44
41
|
<div>
|
|
45
|
-
<div v-if="disable" :style="style">
|
|
46
|
-
<div :style="{ position: 'static', display: 'table' }">
|
|
47
|
-
<div
|
|
48
|
-
:className="className"
|
|
49
|
-
:style="{
|
|
50
|
-
position: 'static',
|
|
51
|
-
display: 'table-cell',
|
|
52
|
-
width: style.width,
|
|
53
|
-
height: style.height,
|
|
54
|
-
verticalAlign: verticalAlign,
|
|
55
|
-
}"
|
|
56
|
-
jsv-inherit-class="2"
|
|
57
|
-
>
|
|
58
|
-
<slot></slot>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
42
|
<div
|
|
63
|
-
v-else
|
|
64
43
|
:className="className"
|
|
65
44
|
:style="style"
|
|
66
45
|
:jsv_text_latex_enable="enableLatex ? 'true' : ''"
|
|
67
46
|
:jsv_text_vertical_align="verticalAlign"
|
|
68
47
|
:jsv_text_line_align="lineAlign"
|
|
48
|
+
:jsv_text_inner_direction="textDirection"
|
|
69
49
|
jsv-inherit-class="1"
|
|
70
50
|
>
|
|
71
51
|
<slot></slot>
|
|
@@ -66,8 +66,8 @@ export default {
|
|
|
66
66
|
},
|
|
67
67
|
created() {},
|
|
68
68
|
mounted() {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
const view = this.$refs.touchContainer?.jsvGetProxyView(true);
|
|
70
|
+
if (view) {
|
|
71
71
|
const page_width = this.flingPageWidth;
|
|
72
72
|
const page_edge = this.flingPageEdge;
|
|
73
73
|
const direction = this.direction;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script setup>
|
|
32
|
-
import { reactive, ref, toRaw, watchEffect, onMounted, defineExpose } from 'vue'
|
|
32
|
+
import { reactive, ref, shallowRef, toRaw, watchEffect, onMounted, defineExpose } from 'vue'
|
|
33
33
|
import { Forge } from "jsview/dom/jsv-forge-define";
|
|
34
34
|
|
|
35
35
|
const props = defineProps({
|
|
@@ -69,7 +69,7 @@ const props = defineProps({
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
// 内部状态变量
|
|
72
|
-
const viewRef =
|
|
72
|
+
const viewRef = shallowRef(null);
|
|
73
73
|
const viewMounted = reactive({status: false})
|
|
74
74
|
let sensorRef = null;
|
|
75
75
|
|
|
@@ -96,9 +96,9 @@ watchEffect(()=>{
|
|
|
96
96
|
if (props.container) {
|
|
97
97
|
window.MyContainerView = toRaw(props.container);
|
|
98
98
|
|
|
99
|
-
let jsv_main_view_ref = toRaw(props.container).
|
|
99
|
+
let jsv_main_view_ref = toRaw(props.container).jsvGetProxyView();
|
|
100
100
|
if (jsv_main_view_ref) {
|
|
101
|
-
sensorRef.ResetContainer(
|
|
101
|
+
sensorRef.ResetContainer(jsv_main_view_ref);
|
|
102
102
|
} else {
|
|
103
103
|
console.error("Error: container is NOT a div");
|
|
104
104
|
}
|
|
@@ -111,7 +111,7 @@ watchEffect(()=>{
|
|
|
111
111
|
onMounted(()=>{
|
|
112
112
|
console.log("JsvVisibleSensor: on mounted");
|
|
113
113
|
|
|
114
|
-
sensorRef = new Forge.VisibleSensor(toRaw(viewRef.value).
|
|
114
|
+
sensorRef = new Forge.VisibleSensor(toRaw(viewRef.value).jsvGetProxyView(), (old_h, new_h, old_v, new_v)=>{
|
|
115
115
|
// 获得横向和纵向的新旧状态值
|
|
116
116
|
if (props.callback) {
|
|
117
117
|
props.callback(old_h, new_h, old_v, new_v);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-07-05 11:00:51
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-11-23 14:06:24
|
|
6
6
|
* @Description: file content
|
|
7
7
|
*/
|
|
8
8
|
export { default as JsvActorMove, JsvActorMoveControl } from "./JsvActorMove";
|
|
@@ -18,15 +18,15 @@ export { default as JsvSpray } from "./JsvSpray";
|
|
|
18
18
|
export { default as JsvSpriteAnim, SpriteController } from "./JsvSpriteAnim";
|
|
19
19
|
export { default as JsvSwiper } from "./JsvSwiper";
|
|
20
20
|
export { default as JsvSwiper3D } from "./JsvSwiper3D";
|
|
21
|
-
export {
|
|
21
|
+
export {
|
|
22
|
+
default as JsvTextureAnim,
|
|
23
|
+
TexAlignAnchor,
|
|
24
|
+
DECORATE_NINEPATCH_ALPHA_MIX,
|
|
25
|
+
DECORATE_BORDER_RADIUS,
|
|
26
|
+
} from "./JsvTextureAnim";
|
|
22
27
|
export { default as JsvVisibleSensor } from "./JsvVisibleSensor";
|
|
23
28
|
export { default as JsvFilterView } from "./JsvFilterView.vue";
|
|
24
|
-
export {
|
|
25
|
-
default as JsvGrid,
|
|
26
|
-
PageType,
|
|
27
|
-
LineType,
|
|
28
|
-
FocusMoveType,
|
|
29
|
-
} from "./JsvGrid.vue";
|
|
29
|
+
export { default as JsvGrid, PageType, LineType } from "./JsvGrid.vue";
|
|
30
30
|
export { default as JsvHole } from "./JsvHole.js";
|
|
31
31
|
export { default as JsvMarquee } from "./JsvMarquee.vue";
|
|
32
32
|
export { default as JsvMaskClipDiv } from "./JsvMaskClipDiv.vue";
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2022-07-11 13:31:36
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-11-02 14:51:40
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script setup>
|
|
9
|
-
import { MetroWidget, VERTICAL, EdgeDirection, useFocusHub } from "jsview";
|
|
10
|
-
import { useRouter } from "vue-router";
|
|
11
|
-
import Buttons from "./Buttons.vue";
|
|
12
|
-
import Mixed from "./Mixed.vue";
|
|
13
|
-
import Widgets from "./widgets/Widgets.vue";
|
|
14
|
-
|
|
15
|
-
const router = useRouter();
|
|
16
|
-
const focusHub = useFocusHub();
|
|
17
|
-
|
|
18
|
-
const onFocus = () => {
|
|
19
|
-
focusHub.setFocus("mwButton");
|
|
20
|
-
};
|
|
21
|
-
const onKeyDown = (ev) => {
|
|
22
|
-
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
23
|
-
router.go(-1);
|
|
24
|
-
}
|
|
25
|
-
return true;
|
|
26
|
-
};
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<template>
|
|
30
|
-
<jsv-focus-block
|
|
31
|
-
autoFocus
|
|
32
|
-
:onAction="{
|
|
33
|
-
onKeyDown,
|
|
34
|
-
onFocus,
|
|
35
|
-
}"
|
|
36
|
-
:style="{
|
|
37
|
-
width: 1920,
|
|
38
|
-
height: 1080,
|
|
39
|
-
backgroundColor: '#007788',
|
|
40
|
-
}"
|
|
41
|
-
>
|
|
42
|
-
<buttons></buttons>
|
|
43
|
-
<mixed></mixed>
|
|
44
|
-
<widgets></widgets>
|
|
45
|
-
</jsv-focus-block>
|
|
46
|
-
</template>
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: ChenChanghua
|
|
3
|
-
* @Date: 2022-07-11 13:31:36
|
|
4
|
-
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-07-18 09:49:59
|
|
6
|
-
* @Description: file content
|
|
7
|
-
-->
|
|
8
|
-
<script setup>
|
|
9
|
-
import { MetroWidget, VERTICAL, EdgeDirection } from "jsview";
|
|
10
|
-
import { useFocusHub } from "jsview";
|
|
11
|
-
import { advanceButton } from "../data";
|
|
12
|
-
import ButtonItem from "./ButtonItem.vue";
|
|
13
|
-
|
|
14
|
-
const focusHub = useFocusHub();
|
|
15
|
-
|
|
16
|
-
//item为Buttonitem的一些回调
|
|
17
|
-
const provideData = () => {
|
|
18
|
-
return advanceButton;
|
|
19
|
-
};
|
|
20
|
-
const measures = (item) => {
|
|
21
|
-
return {
|
|
22
|
-
width: item.width,
|
|
23
|
-
height: item.height,
|
|
24
|
-
marginRight: item.marginRight,
|
|
25
|
-
marginBottom: item.marginBottom,
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
const onEdge = (edgeInfo) => {
|
|
29
|
-
if (edgeInfo.direction == EdgeDirection.right) {
|
|
30
|
-
focusHub.setFocus("mwWidget");
|
|
31
|
-
} else if (edgeInfo.direction == EdgeDirection.bottom) {
|
|
32
|
-
focusHub.setFocus("mwMix");
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<template>
|
|
38
|
-
<div
|
|
39
|
-
:style="{
|
|
40
|
-
left: 50,
|
|
41
|
-
top: 20,
|
|
42
|
-
width: 300,
|
|
43
|
-
height: 400,
|
|
44
|
-
fontSize: 30,
|
|
45
|
-
color: '#FFFFFF',
|
|
46
|
-
}"
|
|
47
|
-
>
|
|
48
|
-
{{ `item可以是可获得焦点的控件` }}
|
|
49
|
-
</div>
|
|
50
|
-
<metro-widget
|
|
51
|
-
name="mwButton"
|
|
52
|
-
:top="120"
|
|
53
|
-
:left="50"
|
|
54
|
-
:provideData="provideData"
|
|
55
|
-
:width="220"
|
|
56
|
-
:height="400"
|
|
57
|
-
:direction="VERTICAL"
|
|
58
|
-
:measures="measures"
|
|
59
|
-
:onEdge="onEdge"
|
|
60
|
-
>
|
|
61
|
-
<template #renderItem="{ data, query, onAction, onItemEdge }">
|
|
62
|
-
<button-item
|
|
63
|
-
:data="data"
|
|
64
|
-
:query="query"
|
|
65
|
-
:onAction="onAction"
|
|
66
|
-
:onItemEdge="onItemEdge"
|
|
67
|
-
/>
|
|
68
|
-
</template>
|
|
69
|
-
</metro-widget>
|
|
70
|
-
</template>
|