@shijiu/jsview-vue 0.9.422 → 0.9.490
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/jsv-browser-debug-dom.js_1 +8 -0
- package/dom/jsv-dom.js_1 +6 -0
- package/dom/jsv-forge-define.js_1 +6 -0
- package/dom/target_core_revision.js +3 -3
- package/package.json +1 -1
- package/patches/node_modules/@vue/cli-service/lib/config/assets.js +1 -1
- package/samples/ColorSpace/App.vue +4 -4
- package/samples/DemoHomepage/router.js +16 -1
- package/samples/FilterDemo/App.vue +121 -0
- package/samples/GridDemo/App.vue +183 -0
- package/samples/GridDemo/ButtonBlock.vue +111 -0
- package/samples/GridDemo/FocusItem.vue +56 -0
- package/samples/GridDemo/Item.vue +101 -0
- package/samples/NinePatchDemo/App.vue +146 -0
- package/samples/NinePatchDemo/Item.vue +70 -0
- package/samples/TouchSample/App.vue +137 -0
- package/samples/TouchSample/Item.vue +101 -0
- package/samples/TouchSample/MetroWidgetHorizontal.vue +144 -0
- package/samples/TouchSample/MetroWidgetVertical.vue +144 -0
- package/samples/TouchSample/TouchContainerHorizontal.vue +159 -0
- package/samples/TouchSample/TouchContainerVertical.vue +159 -0
- package/samples/TouchSample/data.js +81 -0
- package/samples/{ColorSpace → assets}/bmpDemo.bmp +0 -0
- package/samples/{ColorSpace → assets}/jpegDemo.jpeg +0 -0
- package/samples/{ColorSpace → assets}/pngDemo.png +0 -0
- package/samples/{ColorSpace → assets}/pngNoAlphaDemo.png +0 -0
- package/samples/assets/webpDemo.webp +0 -0
- package/scripts/jsview-jsmap-serve.js +63 -0
- package/scripts/jsview-post-build.js +45 -3
- package/scripts/jsview-post-install.js +22 -0
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +7 -5
- package/utils/JsViewEngineWidget/JsvFocusManager.js +5 -0
- package/utils/JsViewEngineWidget/MetroWidget/ItemView.vue +7 -14
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +212 -89
- package/utils/JsViewEngineWidget/MetroWidget/RootView.vue +4 -3
- package/utils/JsViewEngineWidget/TemplateParser.js +8 -6
- package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +20 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +203 -85
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +43 -14
- package/utils/JsViewPlugin/JsvPlayer/index.js +4 -0
- package/utils/JsViewPlugin/JsvPlayer/version.js +19 -0
- package/utils/JsViewVueTools/DebugTool.js +24 -0
- package/utils/JsViewVueTools/NinePatchHelper.js +44 -0
- package/utils/JsViewVueTools/TypeCheckAndSet.js +27 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +2 -2
- package/utils/JsViewVueWidget/JsvFilterView.vue +73 -0
- package/utils/JsViewVueWidget/JsvGrid.vue +573 -0
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +7 -0
- package/utils/JsViewVueWidget/JsvNinePatch.vue +2 -2
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +1 -1
- package/utils/JsViewVueWidget/JsvTextureAnim/CommonType.js +8 -0
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +171 -38
- package/utils/JsViewVueWidget/JsvTextureAnim/index.js +3 -2
- package/utils/JsViewVueWidget/JsvTouchContainer.vue +184 -0
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-09-22 16:08:58
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-05-17 13:01:47
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
<!--
|
|
10
10
|
* 【界面概述】
|
|
11
|
-
* 展示
|
|
11
|
+
* 展示MetroWidget控件的用法
|
|
12
12
|
*
|
|
13
13
|
* 【控件介绍】
|
|
14
|
-
*
|
|
14
|
+
* MetroWidget:
|
|
15
15
|
* props:
|
|
16
16
|
* top {int} 控件的y,默认为0
|
|
17
17
|
* left {int} 控件的x, 默认为0
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
@params {int} id 落焦时的焦点id
|
|
90
90
|
setEnterFocusRect
|
|
91
91
|
@description 设置落焦时的焦点查找去区域
|
|
92
|
-
@params {Object} rectInfo 焦点移入时的区域,
|
|
92
|
+
@params {Object} rectInfo 焦点移入时的区域,MetroWidget 将会根据此区域寻找最近的item
|
|
93
93
|
{
|
|
94
94
|
direction: {EdgeDirection}
|
|
95
95
|
rect: {
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
{
|
|
115
115
|
id: {int} item的id,
|
|
116
116
|
position: {Function} (index : int) => {left: 0, top: 0, width: 0, height: 0}
|
|
117
|
-
获取 item 相对
|
|
117
|
+
获取 item 相对 MetroWidget 左上角坐标
|
|
118
118
|
templatePosition: {Function} (index : int) => {left: 0, top: 0, width: 0, height: 0}
|
|
119
119
|
获取 item 的布局坐标, 一般用于自定义滚动
|
|
120
120
|
absolutePosition: {Function} (index : int) => {left: 0, top: 0, width: 0, height: 0}
|
|
@@ -152,6 +152,8 @@
|
|
|
152
152
|
requestFocus函数需要传递一个false参数
|
|
153
153
|
-->
|
|
154
154
|
<script>
|
|
155
|
+
/* eslint-disable no-unused-vars */
|
|
156
|
+
|
|
155
157
|
import { ref, reactive } from "vue";
|
|
156
158
|
import RootView from "./RootView.vue";
|
|
157
159
|
import Forge from "../ForgeDefine";
|
|
@@ -331,30 +333,50 @@ class PageUpdater {
|
|
|
331
333
|
this._updateFunc = update_func;
|
|
332
334
|
}
|
|
333
335
|
|
|
334
|
-
update(
|
|
336
|
+
update(
|
|
337
|
+
template,
|
|
338
|
+
visible_start,
|
|
339
|
+
visible_end,
|
|
340
|
+
anchor_id,
|
|
341
|
+
merge_tmp,
|
|
342
|
+
permanent_list
|
|
343
|
+
) {
|
|
344
|
+
if (!template || template.GetLength() === 0) return;
|
|
335
345
|
let visible_range = template.GetVisibleItemList(
|
|
336
346
|
visible_start,
|
|
337
347
|
visible_end,
|
|
338
348
|
anchor_id
|
|
339
349
|
);
|
|
350
|
+
if (!visible_range) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
let pre_tmp = this.tmpRangeList;
|
|
354
|
+
let pre_list = this.rangeList;
|
|
340
355
|
let range = new ItemRange(
|
|
341
356
|
visible_range.visibleStart,
|
|
342
357
|
visible_range.visibleEnd
|
|
343
358
|
);
|
|
344
|
-
|
|
345
|
-
if (
|
|
346
|
-
let
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
359
|
+
this.rangeList = [range];
|
|
360
|
+
if (permanent_list) {
|
|
361
|
+
let permanent_show_list = permanent_list.filter((item) => {
|
|
362
|
+
let result = false;
|
|
363
|
+
if (item.alreadyShow || item.index <= range.end) {
|
|
364
|
+
item.alreadyShow = true;
|
|
365
|
+
result = true;
|
|
366
|
+
}
|
|
367
|
+
return result;
|
|
368
|
+
});
|
|
369
|
+
let permanent_range_list = permanent_show_list.map((item) => {
|
|
370
|
+
return new ItemRange(item.index, item.index);
|
|
371
|
+
});
|
|
372
|
+
this.rangeList = mergeRangeList([range], permanent_range_list);
|
|
373
|
+
}
|
|
374
|
+
if (pre_list.length > 0) {
|
|
375
|
+
this.tmpRangeList = mergeRangeList(this.rangeList, pre_list);
|
|
352
376
|
if (merge_tmp) {
|
|
353
377
|
this.tmpRangeList = mergeRangeList(this.tmpRangeList, pre_tmp);
|
|
354
378
|
}
|
|
355
379
|
}
|
|
356
|
-
|
|
357
|
-
this.rangeList = [range];
|
|
358
380
|
}
|
|
359
381
|
|
|
360
382
|
debugPrint() {
|
|
@@ -454,7 +476,7 @@ const directionFreeKeyMap = {
|
|
|
454
476
|
};
|
|
455
477
|
|
|
456
478
|
const defaultSlideSetting = new SeamlessSlide(0.2, 0.8);
|
|
457
|
-
const
|
|
479
|
+
const MetroWidget = {
|
|
458
480
|
components: { RootView },
|
|
459
481
|
props: {
|
|
460
482
|
padding: {
|
|
@@ -610,8 +632,8 @@ const SimpleWidget = {
|
|
|
610
632
|
visibleRange: 0,
|
|
611
633
|
visibleRangeWithPadding: 0,
|
|
612
634
|
|
|
613
|
-
touchContainerW: 0,
|
|
614
|
-
touchContainerH: 0,
|
|
635
|
+
touchContainerW: ref(0),
|
|
636
|
+
touchContainerH: ref(0),
|
|
615
637
|
touchListener: null,
|
|
616
638
|
innerPadding: null,
|
|
617
639
|
slidePile: null,
|
|
@@ -620,6 +642,11 @@ const SimpleWidget = {
|
|
|
620
642
|
preAnchorItemIndex: -1,
|
|
621
643
|
templateItemAdder: null,
|
|
622
644
|
itemRender: ref(false),
|
|
645
|
+
permanentItemList: [],
|
|
646
|
+
preUpdateVisibleStart: 0,
|
|
647
|
+
|
|
648
|
+
updateTimerHandler: -1,
|
|
649
|
+
mounted: false,
|
|
623
650
|
};
|
|
624
651
|
},
|
|
625
652
|
methods: {
|
|
@@ -775,6 +802,10 @@ const SimpleWidget = {
|
|
|
775
802
|
}
|
|
776
803
|
},
|
|
777
804
|
|
|
805
|
+
getFocusBlockRef() {
|
|
806
|
+
return this.$refs.focusNode;
|
|
807
|
+
},
|
|
808
|
+
|
|
778
809
|
setEnterFocusId(id) {
|
|
779
810
|
this.templateItemAdder.tryAddItemById(id);
|
|
780
811
|
this.enterFocusId = id;
|
|
@@ -807,7 +838,9 @@ const SimpleWidget = {
|
|
|
807
838
|
this.templateParser,
|
|
808
839
|
this.visibleStart,
|
|
809
840
|
this.visibleStart + this.visibleRangeWithPadding - 1,
|
|
810
|
-
this.focusId
|
|
841
|
+
this.focusId,
|
|
842
|
+
false,
|
|
843
|
+
this.permanentItemList
|
|
811
844
|
);
|
|
812
845
|
if (doAnim) {
|
|
813
846
|
this.pageUpdater.applyTmp();
|
|
@@ -836,7 +869,11 @@ const SimpleWidget = {
|
|
|
836
869
|
console.error("refreshData: provideData is null.");
|
|
837
870
|
return;
|
|
838
871
|
}
|
|
872
|
+
let _force_update = force_update;
|
|
839
873
|
let template_list = this.templateParser.GetTemplate().List;
|
|
874
|
+
if (!template_list || template_list.length === 0) {
|
|
875
|
+
_force_update = true;
|
|
876
|
+
}
|
|
840
877
|
let new_list = this.provideData();
|
|
841
878
|
if (this.focusId >= new_list.length) {
|
|
842
879
|
this.focusId = 0;
|
|
@@ -847,7 +884,7 @@ const SimpleWidget = {
|
|
|
847
884
|
}
|
|
848
885
|
}
|
|
849
886
|
let new_index = 0;
|
|
850
|
-
if (!
|
|
887
|
+
if (!_force_update) {
|
|
851
888
|
for (new_index = 0; new_index < new_list.length; ++new_index) {
|
|
852
889
|
let already_add = false;
|
|
853
890
|
for (let j = 0; j < template_list.length; ++j) {
|
|
@@ -862,7 +899,7 @@ const SimpleWidget = {
|
|
|
862
899
|
}
|
|
863
900
|
}
|
|
864
901
|
let need_update_content = false;
|
|
865
|
-
if (new_index === template_list.length) {
|
|
902
|
+
if (!_force_update && new_index === template_list.length) {
|
|
866
903
|
//原始数据都在
|
|
867
904
|
if (new_index !== new_list.length) {
|
|
868
905
|
//增加数据
|
|
@@ -873,8 +910,9 @@ const SimpleWidget = {
|
|
|
873
910
|
}
|
|
874
911
|
} else {
|
|
875
912
|
//数据更改
|
|
913
|
+
this.permanentItemList = [];
|
|
876
914
|
need_update_content = true;
|
|
877
|
-
|
|
915
|
+
this.templateParser = _getTemplateParser(
|
|
878
916
|
this.width,
|
|
879
917
|
this.height,
|
|
880
918
|
this.direction,
|
|
@@ -885,14 +923,13 @@ const SimpleWidget = {
|
|
|
885
923
|
this.innerData = [];
|
|
886
924
|
this.dataList = new_list;
|
|
887
925
|
this.templateItemAdder = new TemplateItemAdder(
|
|
888
|
-
|
|
926
|
+
this.templateParser,
|
|
889
927
|
new_list,
|
|
890
928
|
this.measures,
|
|
891
929
|
this.visibleRangeWithPadding,
|
|
892
930
|
this._onTemplateAdd
|
|
893
931
|
);
|
|
894
932
|
this.templateItemAdder.tryAddItemById(this.focusId);
|
|
895
|
-
this.templateParser = template_parser;
|
|
896
933
|
}
|
|
897
934
|
if (need_update_content) {
|
|
898
935
|
let template_list = this.templateParser.GetTemplate().List;
|
|
@@ -922,7 +959,9 @@ const SimpleWidget = {
|
|
|
922
959
|
this.templateParser,
|
|
923
960
|
this.visibleStart,
|
|
924
961
|
this.visibleStart + this.visibleRangeWithPadding - 1,
|
|
925
|
-
this.focusId
|
|
962
|
+
this.focusId,
|
|
963
|
+
false,
|
|
964
|
+
this.permanentItemList
|
|
926
965
|
);
|
|
927
966
|
this.dataUpdateToken++;
|
|
928
967
|
this.pageUpdater.apply();
|
|
@@ -1132,6 +1171,27 @@ const SimpleWidget = {
|
|
|
1132
1171
|
},
|
|
1133
1172
|
|
|
1134
1173
|
onKeyDown(ev) {
|
|
1174
|
+
if (this.innerData.length == 0) {
|
|
1175
|
+
const edgeDirectionMap = {
|
|
1176
|
+
37: EdgeDirection.left,
|
|
1177
|
+
38: EdgeDirection.top,
|
|
1178
|
+
39: EdgeDirection.right,
|
|
1179
|
+
40: EdgeDirection.bottom,
|
|
1180
|
+
};
|
|
1181
|
+
if (typeof edgeDirectionMap[ev.keyCode] !== "undefined") {
|
|
1182
|
+
this.onEdge?.({
|
|
1183
|
+
direction: edgeDirectionMap[ev.keyCode],
|
|
1184
|
+
rect: {
|
|
1185
|
+
x: 0,
|
|
1186
|
+
y: 0,
|
|
1187
|
+
width: 0,
|
|
1188
|
+
height: 0,
|
|
1189
|
+
},
|
|
1190
|
+
});
|
|
1191
|
+
return true;
|
|
1192
|
+
}
|
|
1193
|
+
return false;
|
|
1194
|
+
}
|
|
1135
1195
|
let horizontal_direction = 0;
|
|
1136
1196
|
let vertical_direction = 0;
|
|
1137
1197
|
switch (ev.keyCode) {
|
|
@@ -1182,6 +1242,18 @@ const SimpleWidget = {
|
|
|
1182
1242
|
itemHandler: {},
|
|
1183
1243
|
itemConfig: this.itemConfig?.(item.data),
|
|
1184
1244
|
});
|
|
1245
|
+
if (item.permanent) {
|
|
1246
|
+
this.permanentItemList.push({
|
|
1247
|
+
index: this.innerData.length - 1,
|
|
1248
|
+
alreadyShow: false,
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
const lastItem = this.templateParser.GetItem(-1);
|
|
1252
|
+
if (this.direction == VERTICAL) {
|
|
1253
|
+
this.touchContainerH = lastItem.yPos + lastItem.height - 1;
|
|
1254
|
+
} else {
|
|
1255
|
+
this.touchContainerW = lastItem.xPos + lastItem.width - 1;
|
|
1256
|
+
}
|
|
1185
1257
|
},
|
|
1186
1258
|
|
|
1187
1259
|
_onCustomerEvent(ev) {
|
|
@@ -1223,7 +1295,8 @@ const SimpleWidget = {
|
|
|
1223
1295
|
this.visibleStart,
|
|
1224
1296
|
this.visibleStart + this.visibleRangeWithPadding - 1,
|
|
1225
1297
|
this.focusId,
|
|
1226
|
-
true
|
|
1298
|
+
true,
|
|
1299
|
+
this.permanentItemList
|
|
1227
1300
|
);
|
|
1228
1301
|
this.pageUpdater.applyTmp();
|
|
1229
1302
|
this._slideTo(this.visibleStart, {
|
|
@@ -1288,7 +1361,9 @@ const SimpleWidget = {
|
|
|
1288
1361
|
this.templateParser,
|
|
1289
1362
|
cur_visible_start,
|
|
1290
1363
|
cur_visible_start + this.visibleRangeWithPadding - 1,
|
|
1291
|
-
next_item_id
|
|
1364
|
+
next_item_id,
|
|
1365
|
+
false,
|
|
1366
|
+
this.permanentItemList
|
|
1292
1367
|
);
|
|
1293
1368
|
this.pageUpdater.applyTmp();
|
|
1294
1369
|
}
|
|
@@ -1401,7 +1476,7 @@ const SimpleWidget = {
|
|
|
1401
1476
|
_calculateVisibleStart(target_item, direction) {
|
|
1402
1477
|
if (!target_item) {
|
|
1403
1478
|
console.error(
|
|
1404
|
-
"
|
|
1479
|
+
"MetroWidget: _calculateVisibleStart target item is null"
|
|
1405
1480
|
);
|
|
1406
1481
|
return 0;
|
|
1407
1482
|
}
|
|
@@ -1465,7 +1540,7 @@ const SimpleWidget = {
|
|
|
1465
1540
|
break;
|
|
1466
1541
|
default:
|
|
1467
1542
|
console.error(
|
|
1468
|
-
"
|
|
1543
|
+
"MetroWidget: undefined slide type",
|
|
1469
1544
|
this.slideSetting.Type
|
|
1470
1545
|
);
|
|
1471
1546
|
}
|
|
@@ -1525,10 +1600,20 @@ const SimpleWidget = {
|
|
|
1525
1600
|
},
|
|
1526
1601
|
|
|
1527
1602
|
_setZIndex(index, z_index) {
|
|
1528
|
-
this.innerData[index]
|
|
1603
|
+
if (this.innerData[index]) {
|
|
1604
|
+
this.innerData[index].controller.zIndex = z_index;
|
|
1605
|
+
}
|
|
1529
1606
|
},
|
|
1530
1607
|
|
|
1531
1608
|
_onFocus() {
|
|
1609
|
+
this.isFocus = true;
|
|
1610
|
+
this.preFocusId = -1;
|
|
1611
|
+
if (this.innerData.length === 0) {
|
|
1612
|
+
console.warn(
|
|
1613
|
+
`MetroWidget: ${this.name} get focus while data is empty.`
|
|
1614
|
+
);
|
|
1615
|
+
return;
|
|
1616
|
+
}
|
|
1532
1617
|
let focus_id =
|
|
1533
1618
|
typeof this.enterFocusId !== "undefined" &&
|
|
1534
1619
|
this.enterFocusId >= 0 &&
|
|
@@ -1542,9 +1627,7 @@ const SimpleWidget = {
|
|
|
1542
1627
|
)
|
|
1543
1628
|
: focus_id;
|
|
1544
1629
|
this.preEdgeRect = this.enterFocusRect;
|
|
1545
|
-
this.isFocus = true;
|
|
1546
1630
|
this.focusId = focus_id;
|
|
1547
|
-
this.preFocusId = -1;
|
|
1548
1631
|
this.enterFocusId = -1;
|
|
1549
1632
|
this.enterFocusRect = null;
|
|
1550
1633
|
this._updateFocusItem();
|
|
@@ -1566,9 +1649,11 @@ const SimpleWidget = {
|
|
|
1566
1649
|
this.isFocus = false;
|
|
1567
1650
|
this.enterFocusId = -1;
|
|
1568
1651
|
this.enterFocusRect = null;
|
|
1569
|
-
|
|
1570
|
-
this.preFocusId = this.focusId;
|
|
1571
1652
|
this.preEdgeRect = null;
|
|
1653
|
+
if (this.innerData.length === 0) {
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
this.preFocusId = this.focusId;
|
|
1572
1657
|
this._updateBlurItem();
|
|
1573
1658
|
this.innerData[
|
|
1574
1659
|
this.templateParser.FocusIdToIndex(this.preFocusId)
|
|
@@ -1635,28 +1720,22 @@ const SimpleWidget = {
|
|
|
1635
1720
|
this.rootElement = ele;
|
|
1636
1721
|
},
|
|
1637
1722
|
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
// let cur_visible_end =
|
|
1655
|
-
// this.visibleStart + this.visibleRangeWithPadding * 3 - 1;
|
|
1656
|
-
// let baseItemId = this.visibleRangeSearchBaseItem
|
|
1657
|
-
// ? this.visibleRangeSearchBaseItem
|
|
1658
|
-
// : 0;
|
|
1659
|
-
// this._updateVisibleList(baseItemId, cur_visible_start, cur_visible_end);
|
|
1723
|
+
_onDragUpdateItem(visible_start, visible_end) {
|
|
1724
|
+
this.templateItemAdder.tryAddItemByPosition(visible_end);
|
|
1725
|
+
let baseItemId = this.visibleRangeSearchBaseItem
|
|
1726
|
+
? this.visibleRangeSearchBaseItem
|
|
1727
|
+
: 0;
|
|
1728
|
+
this.pageUpdater.update(
|
|
1729
|
+
this.templateParser,
|
|
1730
|
+
visible_start,
|
|
1731
|
+
visible_end,
|
|
1732
|
+
baseItemId,
|
|
1733
|
+
false,
|
|
1734
|
+
this.permanentItemList
|
|
1735
|
+
);
|
|
1736
|
+
this.pageUpdater.apply();
|
|
1737
|
+
|
|
1738
|
+
Forge.sRenderBridge.InstantPerformSwap();
|
|
1660
1739
|
},
|
|
1661
1740
|
|
|
1662
1741
|
_getTouchListener() {
|
|
@@ -1665,37 +1744,72 @@ const SimpleWidget = {
|
|
|
1665
1744
|
}
|
|
1666
1745
|
let callback = {
|
|
1667
1746
|
OnDragStart: (msg) => {
|
|
1668
|
-
// console.log("SimpleWidget Container OnDragStart:", msg);
|
|
1669
1747
|
//删除焦点
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1748
|
+
if (this.mounted) {
|
|
1749
|
+
Promise.resolve().then(() => {
|
|
1750
|
+
let cur_visible_start =
|
|
1751
|
+
this.visibleStart - this.visibleRangeWithPadding * 2;
|
|
1752
|
+
let cur_visible_end =
|
|
1753
|
+
this.visibleStart + this.visibleRangeWithPadding * 3 - 1;
|
|
1754
|
+
this.preUpdateVisibleStart = cur_visible_start;
|
|
1755
|
+
this._onDragUpdateItem(cur_visible_start, cur_visible_end);
|
|
1756
|
+
});
|
|
1757
|
+
}
|
|
1674
1758
|
return true;
|
|
1675
1759
|
},
|
|
1676
1760
|
OnMoved: (msg) => {
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1761
|
+
if (this.mounted) {
|
|
1762
|
+
Promise.resolve().then(() => {
|
|
1763
|
+
if (
|
|
1764
|
+
typeof msg.viewY != "undefined" &&
|
|
1765
|
+
typeof msg.viewX != "undefined"
|
|
1766
|
+
) {
|
|
1767
|
+
if (this.direction === VERTICAL) {
|
|
1768
|
+
this.visibleStart = -msg.viewY;
|
|
1769
|
+
} else {
|
|
1770
|
+
this.visibleStart = -msg.viewX;
|
|
1771
|
+
}
|
|
1772
|
+
if (this.visibleStart < 0) {
|
|
1773
|
+
this.visibleStart = 0;
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
if (
|
|
1777
|
+
Math.abs(this.visibleStart - this.preUpdateVisibleStart) <=
|
|
1778
|
+
this.visibleRangeWithPadding
|
|
1779
|
+
) {
|
|
1780
|
+
let cur_visible_start =
|
|
1781
|
+
this.visibleStart - this.visibleRangeWithPadding * 2;
|
|
1782
|
+
let cur_visible_end =
|
|
1783
|
+
this.visibleStart + this.visibleRangeWithPadding * 3 - 1;
|
|
1784
|
+
this.preUpdateVisibleStart = cur_visible_start;
|
|
1785
|
+
this._onDragUpdateItem(cur_visible_start, cur_visible_end);
|
|
1786
|
+
}
|
|
1787
|
+
});
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1681
1790
|
return true;
|
|
1682
1791
|
},
|
|
1683
1792
|
OnDragEnd: (msg) => {
|
|
1684
|
-
|
|
1685
|
-
this.
|
|
1793
|
+
this.$refs.rootView?.updatePosition(msg["viewX"], msg["viewY"], null);
|
|
1794
|
+
this.preUpdateVisibleStart = this.visibleStart;
|
|
1795
|
+
this._onDragUpdateItem(
|
|
1796
|
+
this.visibleStart,
|
|
1797
|
+
this.visibleStart + this.visibleRangeWithPadding - 1
|
|
1798
|
+
);
|
|
1686
1799
|
this._updateFocusByDragInfo(msg["viewX"], msg["viewY"]);
|
|
1687
|
-
this._onSlideEnd();
|
|
1688
1800
|
return true;
|
|
1689
1801
|
},
|
|
1690
1802
|
OnFling: (msg) => {
|
|
1691
|
-
|
|
1692
|
-
this.
|
|
1803
|
+
this.$refs.rootView?.updatePosition(msg["viewX"], msg["viewY"], null);
|
|
1804
|
+
this.preUpdateVisibleStart = this.visibleStart;
|
|
1805
|
+
this._onDragUpdateItem(
|
|
1806
|
+
this.visibleStart,
|
|
1807
|
+
this.visibleStart + this.visibleRangeWithPadding - 1
|
|
1808
|
+
);
|
|
1693
1809
|
this._updateFocusByDragInfo(msg["viewX"], msg["viewY"]);
|
|
1694
|
-
this._onSlideEnd();
|
|
1695
1810
|
return true;
|
|
1696
1811
|
},
|
|
1697
|
-
OnRelease: () => {
|
|
1698
|
-
// console.log("SimpleWidget Container OnRelease:", msg);
|
|
1812
|
+
OnRelease: (msg) => {
|
|
1699
1813
|
return true;
|
|
1700
1814
|
},
|
|
1701
1815
|
};
|
|
@@ -1717,7 +1831,8 @@ const SimpleWidget = {
|
|
|
1717
1831
|
this.$refs.rootView?.updateData(list);
|
|
1718
1832
|
this.refreshToken++;
|
|
1719
1833
|
this.itemRender = false;
|
|
1720
|
-
|
|
1834
|
+
clearTimeout(this.updateTimerHandler);
|
|
1835
|
+
this.updateTimerHandler = setTimeout(() => {
|
|
1721
1836
|
this.itemRender = true;
|
|
1722
1837
|
}, 0);
|
|
1723
1838
|
},
|
|
@@ -1744,7 +1859,8 @@ const SimpleWidget = {
|
|
|
1744
1859
|
} else if (this.data) {
|
|
1745
1860
|
this.dataList = this.data;
|
|
1746
1861
|
}
|
|
1747
|
-
|
|
1862
|
+
|
|
1863
|
+
this.templateParser = _getTemplateParser(
|
|
1748
1864
|
this.width,
|
|
1749
1865
|
this.height,
|
|
1750
1866
|
this.direction,
|
|
@@ -1753,25 +1869,26 @@ const SimpleWidget = {
|
|
|
1753
1869
|
this.layoutType
|
|
1754
1870
|
);
|
|
1755
1871
|
this.templateItemAdder = new TemplateItemAdder(
|
|
1756
|
-
|
|
1872
|
+
this.templateParser,
|
|
1757
1873
|
this.dataList,
|
|
1758
1874
|
this.measures,
|
|
1759
1875
|
this.visibleRangeWithPadding,
|
|
1760
1876
|
this._onTemplateAdd
|
|
1761
1877
|
);
|
|
1762
1878
|
this.templateItemAdder.tryAddItem(null, 2);
|
|
1763
|
-
this.templateParser = template_parser;
|
|
1764
1879
|
let template_list = this.templateParser.GetTemplate().List;
|
|
1765
1880
|
let last_item = template_list[template_list.length - 1];
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
this.
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
this.
|
|
1773
|
-
|
|
1774
|
-
|
|
1881
|
+
if (last_item) {
|
|
1882
|
+
this.touchListener = this._getTouchListener();
|
|
1883
|
+
this.touchContainerW =
|
|
1884
|
+
this.direction === VERTICAL
|
|
1885
|
+
? this.width
|
|
1886
|
+
: last_item.xPos + last_item.width;
|
|
1887
|
+
this.touchContainerH =
|
|
1888
|
+
this.direction === VERTICAL
|
|
1889
|
+
? last_item.yPos + last_item.height
|
|
1890
|
+
: this.height;
|
|
1891
|
+
}
|
|
1775
1892
|
this.slidePile = new Forge.RectArea(
|
|
1776
1893
|
0,
|
|
1777
1894
|
0,
|
|
@@ -1782,6 +1899,7 @@ const SimpleWidget = {
|
|
|
1782
1899
|
let cur_visible_start = 0;
|
|
1783
1900
|
|
|
1784
1901
|
if (this.initFocusId) {
|
|
1902
|
+
this.templateItemAdder.tryAddItemById(this.initFocusId);
|
|
1785
1903
|
const item = this.templateParser.GetItemById(this.initFocusId);
|
|
1786
1904
|
if (item) {
|
|
1787
1905
|
init_focus_id = this.initFocusId;
|
|
@@ -1799,18 +1917,23 @@ const SimpleWidget = {
|
|
|
1799
1917
|
this.templateParser,
|
|
1800
1918
|
this.visibleStart,
|
|
1801
1919
|
this.visibleStart + this.visibleRangeWithPadding - 1,
|
|
1802
|
-
0
|
|
1920
|
+
0,
|
|
1921
|
+
false,
|
|
1922
|
+
this.permanentItemList
|
|
1803
1923
|
);
|
|
1804
1924
|
this.pageUpdater.apply();
|
|
1925
|
+
this.mounted = true;
|
|
1805
1926
|
},
|
|
1806
1927
|
beforeUnmount() {
|
|
1928
|
+
this.mounted = false;
|
|
1807
1929
|
if (this.dispatcher) {
|
|
1808
1930
|
this.dispatcher.unregisterComponent();
|
|
1809
1931
|
}
|
|
1932
|
+
clearTimeout(this.updateTimerHandler);
|
|
1810
1933
|
},
|
|
1811
1934
|
};
|
|
1812
1935
|
|
|
1813
|
-
export default
|
|
1936
|
+
export default MetroWidget;
|
|
1814
1937
|
</script>
|
|
1815
1938
|
|
|
1816
1939
|
<template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-09-22 14:03:32
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-04-12 09:14:22
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
@@ -117,7 +117,8 @@ export default {
|
|
|
117
117
|
},
|
|
118
118
|
mounted() {
|
|
119
119
|
//TODO 触控的处理有待添加
|
|
120
|
-
|
|
120
|
+
this.$_rootView_initTouch_();
|
|
121
|
+
//window.touchDiv = this.$refs.element
|
|
121
122
|
},
|
|
122
123
|
};
|
|
123
124
|
</script>
|
|
@@ -150,4 +151,4 @@ export default {
|
|
|
150
151
|
</div>
|
|
151
152
|
</div>
|
|
152
153
|
</div>
|
|
153
|
-
</template>
|
|
154
|
+
</template>
|
|
@@ -102,6 +102,10 @@ function getTemplateItem(measure_obj, data_info) {
|
|
|
102
102
|
typeof measure_obj.doSlide !== "undefined" ? measure_obj.doSlide : true,
|
|
103
103
|
pageNumber: -1,
|
|
104
104
|
pageHeadIndex: -1,
|
|
105
|
+
permanent:
|
|
106
|
+
typeof measure_obj.permanent !== "undefined"
|
|
107
|
+
? measure_obj.permanent
|
|
108
|
+
: false,
|
|
105
109
|
};
|
|
106
110
|
}
|
|
107
111
|
|
|
@@ -235,11 +239,9 @@ class Fence {
|
|
|
235
239
|
}
|
|
236
240
|
}
|
|
237
241
|
|
|
238
|
-
if (gap_idx === -1)
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
);
|
|
242
|
-
// Forge.ThrowError("Error in mark gap used, not found suitable gap of offset=" + this.AheadOffset);
|
|
242
|
+
if (gap_idx === -1) {
|
|
243
|
+
return; // 区域完全重复,无法找到新区域
|
|
244
|
+
}
|
|
243
245
|
|
|
244
246
|
this._SplitGap(gap_idx, start_pos, width);
|
|
245
247
|
|
|
@@ -848,7 +850,7 @@ class TemplateParser {
|
|
|
848
850
|
let gap_info = null;
|
|
849
851
|
while (fence_stack.length > 0) {
|
|
850
852
|
const checking_fence = fence_stack[fence_stack.length - 1];
|
|
851
|
-
gap_info = checking_fence.HasGapFor(item_key_width);
|
|
853
|
+
gap_info = checking_fence.HasGapFor(item_key_width + item_key_margin);
|
|
852
854
|
if (gap_info !== null) {
|
|
853
855
|
top_fence = checking_fence;
|
|
854
856
|
break;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import PluginInfo from './version'
|
|
2
|
+
|
|
3
|
+
function reconfigPluginInfo() {
|
|
4
|
+
if(typeof window.jJsvRuntimeBridge!=='undefined' && window.jJsvRuntimeBridge && typeof window.jJsvRuntimeBridge.getPluginBaseUrl !== "undefined"){
|
|
5
|
+
let plugin_base_url = window.jJsvRuntimeBridge.getPluginBaseUrl();
|
|
6
|
+
if(plugin_base_url){
|
|
7
|
+
PluginInfo.downloadUrl = (plugin_base_url[plugin_base_url.length-1]==="/"?plugin_base_url:(plugin_base_url+"/"))+PluginInfo.packageName+"/JsvPlayer-"+PluginInfo.versionCodeMax+".zip?md5="+PluginInfo.md5;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
reconfigPluginInfo();
|
|
13
|
+
|
|
14
|
+
function getPluginInfo(){
|
|
15
|
+
return PluginInfo;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
getPluginInfo
|
|
20
|
+
}
|