@shijiu/jsview-vue 2.3.0 → 2.3.151-test.0

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.
Files changed (56) hide show
  1. package/bin/browser/BrowserAudio.vue.mjs +4 -1
  2. package/bin/jsview-vue.mjs +2200 -466
  3. package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +21 -1
  4. package/bin/types/utils/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +5 -1
  5. package/bin/types/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +2 -1
  6. package/bin/types/utils/JsViewEngineWidget/WidgetCommon.d.ts +10 -7
  7. package/bin/types/utils/JsViewVueTools/ForgeHandles.d.ts +1 -0
  8. package/bin/types/utils/JsViewVueTools/JsvRuntimeBridge.d.ts +37 -1
  9. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +3 -3
  10. package/bin/types/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.d.ts +7 -0
  11. package/bin/types/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +14 -1
  12. package/bin/types/utils/JsViewVueTools/JsvTextureStore/Store.d.ts +2 -0
  13. package/bin/types/utils/JsViewVueTools/JsvTextureStore/Texture.d.ts +4 -0
  14. package/bin/types/utils/JsViewVueWidget/JsvDashPath.vue.d.ts +11 -0
  15. package/bin/types/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +2 -1
  16. package/bin/types/utils/JsViewVueWidget/JsvSmoothSlideContainer.vue.d.ts +72 -0
  17. package/bin/types/utils/JsViewVueWidget/JsvSoundPool.d.ts +26 -0
  18. package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSmoothSwiper.vue.d.ts +112 -0
  19. package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper2.vue.d.ts +142 -0
  20. package/bin/types/utils/JsViewVueWidget/JsvSwiper/index.d.ts +3 -1
  21. package/bin/types/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +2 -2
  22. package/bin/types/utils/JsViewVueWidget/index.d.ts +2 -1
  23. package/package.json +1 -1
  24. package/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.ts +27 -1
  25. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +35 -3
  26. package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +736 -386
  27. package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +13 -2
  28. package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +38 -26
  29. package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +144 -73
  30. package/utils/JsViewEngineWidget/WidgetCommon.ts +12 -0
  31. package/utils/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue +4 -0
  32. package/utils/JsViewPlugin/JsvAudio/BrowserAudio/JsvSystemAudio.vue +13 -13
  33. package/utils/JsViewPlugin/JsvPlayer/BrowserJsvPlayer.vue +1 -1
  34. package/utils/JsViewVueTools/FeatureActive.ts +2 -1
  35. package/utils/JsViewVueTools/ForgeHandles.ts +5 -2
  36. package/utils/JsViewVueTools/JsvRuntimeBridge.js +97 -1
  37. package/utils/JsViewVueTools/JsvTextTools.ts +3 -1
  38. package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +15 -12
  39. package/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.ts +36 -0
  40. package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +23 -2
  41. package/utils/JsViewVueTools/JsvTextureStore/Store.ts +33 -21
  42. package/utils/JsViewVueTools/JsvTextureStore/Texture.ts +56 -41
  43. package/utils/JsViewVueWidget/JsvDashPath.vue +150 -0
  44. package/utils/JsViewVueWidget/JsvFlexCell/JsvFullScrAdjust.vue +3 -1
  45. package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +26 -22
  46. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +1 -1
  47. package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +1 -0
  48. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +2 -2
  49. package/utils/JsViewVueWidget/JsvSmoothSlideContainer.vue +108 -0
  50. package/utils/JsViewVueWidget/JsvSoundPool.js +75 -12
  51. package/utils/JsViewVueWidget/JsvSwiper/JsvSmoothSwiper.vue +543 -0
  52. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +3 -3
  53. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper2.vue +644 -0
  54. package/utils/JsViewVueWidget/JsvSwiper/index.js +3 -1
  55. package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +14 -8
  56. package/utils/JsViewVueWidget/index.js +2 -1
@@ -172,17 +172,20 @@ class SeamlessSlide extends SlideSetting {
172
172
  class FixPositionSlide extends SlideSetting {
173
173
  FixPercent;
174
174
  FixFirstPage;
175
+ Align;
175
176
  constructor({
176
177
  fixPercent = 0.5,
177
178
  speed = defaultSpeed,
178
179
  duration = null,
179
180
  easing = defaultEasing,
180
181
  fixFirstPage = false,
182
+ align = "center",
181
183
  boundaryProtect = SlideSetting.START_PROTECT | SlideSetting.END_PROTECT
182
184
  } = {}) {
183
185
  super(SlideSetting.Type.FIX_POSITION, speed, duration, easing, boundaryProtect);
184
186
  this.FixPercent = fixPercent;
185
187
  this.FixFirstPage = fixFirstPage;
188
+ this.Align = align;
186
189
  }
187
190
  }
188
191
  const FocusMoveType = {
@@ -1031,6 +1034,18 @@ class RangesModel {
1031
1034
  const TAG$5 = "CommonTemplateParser";
1032
1035
  ;
1033
1036
  ;
1037
+ function left(item) {
1038
+ return item.left;
1039
+ }
1040
+ function right(item) {
1041
+ return item.left + item.width - 1;
1042
+ }
1043
+ function top(item) {
1044
+ return item.top;
1045
+ }
1046
+ function bottom(item) {
1047
+ return item.top + item.height - 1;
1048
+ }
1034
1049
  class CommonMetroTemplate extends MetroTemplate {
1035
1050
  _FenceStack;
1036
1051
  _FenceEdge;
@@ -1339,15 +1354,104 @@ class CommonMetroTemplate extends MetroTemplate {
1339
1354
  );
1340
1355
  }
1341
1356
  }
1342
- if (nextTemplateItem === null) {
1343
- if (vOffset != 0 && moveType & FocusMoveType.ROW_FIND_NEAR) {
1344
- nextTemplateItem = this._GetNearLineItem(itemIndex, vOffset, true);
1345
- } else if (hOffset != 0 && moveType & FocusMoveType.COLUMN_FIND_NEAR) {
1346
- nextTemplateItem = this._GetNearLineItem(itemIndex, hOffset, false);
1357
+ if (vOffset != 0 && moveType & FocusMoveType.ROW_FIND_NEAR) {
1358
+ let rowNear = this._GetDirectionNearItem(itemIndex, vOffset > 0 ? "bottom" : "top");
1359
+ if (rowNear) {
1360
+ nextTemplateItem = rowNear;
1361
+ }
1362
+ } else if (hOffset != 0 && moveType & FocusMoveType.COLUMN_FIND_NEAR) {
1363
+ let colNear = this._GetDirectionNearItem(itemIndex, hOffset > 0 ? "right" : "left");
1364
+ if (colNear) {
1365
+ nextTemplateItem = colNear;
1347
1366
  }
1348
1367
  }
1349
1368
  return nextTemplateItem;
1350
1369
  }
1370
+ _GetDirectionNearItem(index, direction, mustFocusable = true) {
1371
+ const SEARCH_RANGE = 100;
1372
+ let searchMin = Math.max(0, index - SEARCH_RANGE);
1373
+ let searchMax = Math.min(this.templateList.length - 1, index + SEARCH_RANGE);
1374
+ let targetItem = this.templateList[index];
1375
+ let tl = left(targetItem);
1376
+ let tr = right(targetItem);
1377
+ let tt = top(targetItem);
1378
+ let tb = bottom(targetItem);
1379
+ let info = {
1380
+ item: null,
1381
+ minMainDistance: -1,
1382
+ minSubDistance: -1
1383
+ };
1384
+ const compare = (item, getMainDistance, getSubDistance) => {
1385
+ if (mustFocusable && !item.focusable)
1386
+ return;
1387
+ const mainDistance = getMainDistance(item);
1388
+ if (mainDistance <= 0)
1389
+ return;
1390
+ const subDistance = getSubDistance(item);
1391
+ if (info.minMainDistance < 0 || mainDistance < info.minMainDistance) {
1392
+ info.minMainDistance = mainDistance;
1393
+ info.minSubDistance = subDistance;
1394
+ info.item = item;
1395
+ } else if (mainDistance === info.minMainDistance && subDistance < info.minSubDistance) {
1396
+ info.minSubDistance = subDistance;
1397
+ info.item = item;
1398
+ }
1399
+ };
1400
+ for (let i = searchMin; i <= searchMax; i++) {
1401
+ const item = this.templateList[i];
1402
+ let il = left(item);
1403
+ let ir = right(item);
1404
+ let it = top(item);
1405
+ let ib = bottom(item);
1406
+ switch (direction) {
1407
+ case "left":
1408
+ compare(
1409
+ item,
1410
+ (item2) => {
1411
+ return tl - il;
1412
+ },
1413
+ (item2) => {
1414
+ return Math.min(Math.abs(tt - it), Math.abs(tb - ib), Math.abs(tt - ib), Math.abs(tb - it));
1415
+ }
1416
+ );
1417
+ break;
1418
+ case "right":
1419
+ compare(
1420
+ item,
1421
+ (item2) => {
1422
+ return ir - tr;
1423
+ },
1424
+ (item2) => {
1425
+ return Math.min(Math.abs(tt - it), Math.abs(tb - ib), Math.abs(tt - ib), Math.abs(tb - it));
1426
+ }
1427
+ );
1428
+ break;
1429
+ case "top":
1430
+ compare(
1431
+ item,
1432
+ (item2) => {
1433
+ return tt - it;
1434
+ },
1435
+ (item2) => {
1436
+ return Math.min(Math.abs(tl - il), Math.abs(tr - ir), Math.abs(tl - ir), Math.abs(tr - il));
1437
+ }
1438
+ );
1439
+ break;
1440
+ case "bottom":
1441
+ compare(
1442
+ item,
1443
+ (item2) => {
1444
+ return ib - tb;
1445
+ },
1446
+ (item2) => {
1447
+ return Math.min(Math.abs(tl - il), Math.abs(tr - ir), Math.abs(tl - ir), Math.abs(tr - il));
1448
+ }
1449
+ );
1450
+ break;
1451
+ }
1452
+ }
1453
+ return info.item;
1454
+ }
1351
1455
  getNextItemInner(index, offset, vertical, useHistory, checkAnchor = -1) {
1352
1456
  const templateList = this.templateList;
1353
1457
  const baseItem = templateList[index];
@@ -1489,6 +1593,21 @@ class CommonMetroTemplate extends MetroTemplate {
1489
1593
  }
1490
1594
  return nearestIndex;
1491
1595
  }
1596
+ _FindNearestByDirection(itemIndexList, direction) {
1597
+ return itemIndexList.reduce((acc, cur) => {
1598
+ const curItem = this.templateList[cur];
1599
+ const accItem = this.templateList[acc];
1600
+ if (direction == "left") {
1601
+ return curItem.left < accItem.left ? cur : acc;
1602
+ } else if (direction == "right") {
1603
+ return curItem.left + curItem.width > accItem.left + accItem.width ? cur : acc;
1604
+ } else if (direction == "top") {
1605
+ return curItem.top < accItem.top ? cur : acc;
1606
+ } else {
1607
+ return curItem.top + curItem.height > accItem.top + accItem.height ? cur : acc;
1608
+ }
1609
+ }, itemIndexList[0]);
1610
+ }
1492
1611
  _GetNextLoopItem(index, offset, isVertical) {
1493
1612
  const templateList = this.templateList;
1494
1613
  const baseItem = templateList[index];
@@ -1502,66 +1621,40 @@ class CommonMetroTemplate extends MetroTemplate {
1502
1621
  let focusableTarget = -1;
1503
1622
  let startIndex = -1;
1504
1623
  let neighborList = [];
1505
- neighborList = this._GetTotalNeighbor(index, searchDirection);
1506
- while (startIndex < 0 && neighborList.length > 0) {
1507
- for (let i of neighborList) {
1508
- if (this._GetTotalNeighbor(i, startDirection).length > 0) {
1509
- startIndex = i;
1510
- break;
1511
- } else {
1512
- neighborList = this._GetTotalNeighbor(i, searchDirection);
1513
- }
1624
+ let curIndex = index;
1625
+ let nextLevelNeighborList = this._GetTotalNeighbor(curIndex, startDirection);
1626
+ while (!nextLevelNeighborList || nextLevelNeighborList.length == 0) {
1627
+ const sameLevelList = this._GetTotalNeighbor(curIndex, searchDirection);
1628
+ if (sameLevelList.length > 0) {
1629
+ const i = this._FindNearestByDirection(sameLevelList, startDirection);
1630
+ nextLevelNeighborList = this._GetTotalNeighbor(i, startDirection);
1631
+ curIndex = i;
1632
+ } else {
1633
+ return null;
1514
1634
  }
1515
1635
  }
1516
- if (startIndex >= 0) {
1517
- neighborList = this._GetTotalNeighbor(startIndex, startDirection);
1518
- let nearestIndex = -1, minDistance = Number.POSITIVE_INFINITY;
1519
- for (let i of neighborList) {
1520
- const d = this._GetItemDistance(templateList[i], baseItem);
1521
- if (d < minDistance) {
1522
- nearestIndex = i;
1523
- minDistance = d;
1636
+ if (nextLevelNeighborList && nextLevelNeighborList.length > 0) {
1637
+ for (let i of nextLevelNeighborList) {
1638
+ const item = templateList[i];
1639
+ if (item.focusable) {
1640
+ focusableTarget = i;
1641
+ startIndex = i;
1642
+ break;
1524
1643
  }
1525
1644
  }
1526
- neighborList = this._GetTotalNeighbor(nearestIndex, searchDirection);
1645
+ neighborList = this._GetTotalNeighbor(startIndex, searchDirection);
1527
1646
  while (neighborList.length > 0) {
1528
- targetIndex = this._GetNearestItem(nearestIndex, neighborList);
1529
- if (templateList[targetIndex].focusable) {
1530
- focusableTarget = targetIndex;
1531
- }
1532
- neighborList = this._GetTotalNeighbor(targetIndex, searchDirection);
1533
- }
1534
- if (focusableTarget >= 0) {
1535
- return templateList[focusableTarget];
1536
- } else if (targetIndex >= 0) {
1537
- return this._GetNextLoopItem(targetIndex, offset, isVertical);
1538
- }
1539
- }
1540
- return null;
1541
- }
1542
- //获取临近行的item
1543
- _GetNearLineItem(index, offset, isVertical) {
1544
- const templateList = this.templateList;
1545
- let searchDirection = isVertical ? "right" : "bottom";
1546
- let startDirection = isVertical ? "top" : "left";
1547
- if (offset > 0) {
1548
- searchDirection = isVertical ? "left" : "top";
1549
- startDirection = isVertical ? "bottom" : "right";
1550
- }
1551
- let startIndex = -1;
1552
- let neighborList = [];
1553
- neighborList = this._GetTotalNeighbor(index, searchDirection);
1554
- while (startIndex < 0 && neighborList.length > 0) {
1555
- for (let i of neighborList) {
1556
- const n = this._GetTotalNeighbor(i, startDirection);
1557
- if (n.length > 0) {
1558
- return templateList[this._GetNearestItem(index, n)];
1559
- } else {
1560
- neighborList = this._GetTotalNeighbor(i, searchDirection);
1647
+ for (let i of neighborList) {
1648
+ const item = templateList[i];
1649
+ if (item.focusable) {
1650
+ focusableTarget = i;
1651
+ break;
1652
+ }
1561
1653
  }
1654
+ neighborList = this._GetTotalNeighbor(focusableTarget, searchDirection);
1562
1655
  }
1563
1656
  }
1564
- return null;
1657
+ return focusableTarget >= 0 ? templateList[focusableTarget] : null;
1565
1658
  }
1566
1659
  updateItemSize(index, newSize) {
1567
1660
  console.error(TAG$5, "updateItemSize is not supported.");
@@ -2436,11 +2529,13 @@ class RenderItem {
2436
2529
  rootDiv = null;
2437
2530
  enableTap = false;
2438
2531
  renderKey = ref(0);
2532
+ placeHolderLayout = null;
2439
2533
  customerCallbackMap = {};
2440
2534
  onRef;
2535
+ metroWidgetCbk;
2441
2536
  registerObj;
2442
2537
  query;
2443
- constructor(templateInfo, customerData, renderStyle, itemConfig, onRef, query) {
2538
+ constructor(templateInfo, customerData, renderStyle, itemConfig, onRef, query, metroWidgetCallback) {
2444
2539
  this.templateInfo = templateInfo;
2445
2540
  this.customerData = customerData;
2446
2541
  this.renderStyle = renderStyle;
@@ -2450,6 +2545,7 @@ class RenderItem {
2450
2545
  const unregister = this.unregister.bind(this);
2451
2546
  this.registerObj = { register, unregister };
2452
2547
  this.query = query;
2548
+ this.metroWidgetCbk = metroWidgetCallback;
2453
2549
  }
2454
2550
  get id() {
2455
2551
  return this.templateInfo.id;
@@ -2520,8 +2616,12 @@ class RenderItem {
2520
2616
  }
2521
2617
  }
2522
2618
  onTap = computed(() => {
2523
- return this.enableTap ? this.onClick.bind(this) : null;
2619
+ return this.enableTap ? this.innerOnTap.bind(this) : null;
2524
2620
  });
2621
+ innerOnTap() {
2622
+ this.metroWidgetCbk?.onTap?.(this);
2623
+ return this.onClick();
2624
+ }
2525
2625
  onClick() {
2526
2626
  if (this.mounted.value) {
2527
2627
  this.customerCallbackMap.onClick?.();
@@ -3140,7 +3240,7 @@ class ActorPackBuilder {
3140
3240
  xSpeed,
3141
3241
  ySpeed,
3142
3242
  [
3143
- ActionCmdBuilder.ResetAcc(0, 0),
3243
+ ActionCmdBuilder.SetAccel(0, 0),
3144
3244
  this._NexusRecv ? StateCmdBuilder.FireNexusEvent(ActEventDefine.ActFinish, this._NexusRecv.token) : null
3145
3245
  ],
3146
3246
  true,
@@ -3800,7 +3900,9 @@ class SlideAnimWrapper {
3800
3900
  if (typeof setting.duration == "number") {
3801
3901
  duration = setting.duration;
3802
3902
  } else if (typeof setting.speed == "number") {
3803
- duration = Math.round(Math.max(Math.abs(to[0] - from[0]), Math.abs(to[1] - from[1])) / setting.speed);
3903
+ duration = Math.round(
3904
+ Math.max(Math.abs(to[0] - from[0]), Math.abs(to[1] - from[1])) / setting.speed
3905
+ );
3804
3906
  }
3805
3907
  this.forgeAnim = new Forge$1.TranslateAnimation(
3806
3908
  from[0],
@@ -3808,10 +3910,14 @@ class SlideAnimWrapper {
3808
3910
  from[1],
3809
3911
  to[1],
3810
3912
  duration,
3811
- setting.easing
3913
+ Forge$1.Easing.str2Easing(setting.easing)
3812
3914
  );
3813
3915
  this.forgeAnim.SetAnimationListener(
3814
- new Forge$1.AnimationListener(this.onStart.bind(this), this.onEnd.bind(this), null)
3916
+ new Forge$1.AnimationListener(
3917
+ this.onStart.bind(this),
3918
+ this.onEnd.bind(this),
3919
+ null
3920
+ )
3815
3921
  );
3816
3922
  }
3817
3923
  start() {
@@ -3982,7 +4088,7 @@ function JsvUseFeature(from, comp_name) {
3982
4088
  if (sActivedMap.has(comp_name)) {
3983
4089
  return;
3984
4090
  }
3985
- console.error(`Error: ${comp_name}(from ${from}) is not activated, need JsvActiveFeature(JsvFeatureNames.${comp_name}) in boot`);
4091
+ console.log(`LOG: ${comp_name}(from ${from}) is not activated`);
3986
4092
  }
3987
4093
  function JsvShutdownFeatures(comp_name_list) {
3988
4094
  if (sActivedMap.size > 0) {
@@ -4214,6 +4320,17 @@ function openWindow(url, startup_image, startup_video, startup_duration, add_his
4214
4320
  setting.addHistory = add_history ? 1 : 0;
4215
4321
  return window.jJsvRuntimeBridge.openWindow(url, JSON.stringify(setting));
4216
4322
  }
4323
+ function openApp(url, startup_image, startup_video, startup_duration, add_history) {
4324
+ let setting = {};
4325
+ if (startup_image !== null && startup_image !== "")
4326
+ setting.startupImage = startup_image;
4327
+ if (startup_video !== null && startup_video !== "") {
4328
+ setting.startupVideo = startup_video;
4329
+ }
4330
+ setting.startupDuration = startup_duration;
4331
+ setting.addHistory = add_history ? 1 : 0;
4332
+ return window.jJsvRuntimeBridge.openApp(url, JSON.stringify(setting));
4333
+ }
4217
4334
  function startUrlInNewTab(url, startup_image, startup_video, startup_duration, add_history) {
4218
4335
  let setting = {};
4219
4336
  if (startup_image !== null && startup_image !== "")
@@ -4225,6 +4342,17 @@ function startUrlInNewTab(url, startup_image, startup_video, startup_duration, a
4225
4342
  setting.addHistory = add_history ? 1 : 0;
4226
4343
  return window.jJsvRuntimeBridge.startUrlInNewTab(url, JSON.stringify(setting));
4227
4344
  }
4345
+ function openAppInNewTab(url, startup_image, startup_video, startup_duration, add_history) {
4346
+ let setting = {};
4347
+ if (startup_image !== null && startup_image !== "")
4348
+ setting.startupImage = startup_image;
4349
+ if (startup_video !== null && startup_video !== "") {
4350
+ setting.startupVideo = startup_video;
4351
+ }
4352
+ setting.startupDuration = startup_duration;
4353
+ setting.addHistory = add_history ? 1 : 0;
4354
+ return window.jJsvRuntimeBridge.openAppInNewTab(url, JSON.stringify(setting));
4355
+ }
4228
4356
  function onWindowResult(data) {
4229
4357
  direct_call("onWindowResult", data);
4230
4358
  }
@@ -4248,7 +4376,7 @@ function getSystemProperty(key) {
4248
4376
  function getInstalledApps() {
4249
4377
  return direct_call("getInstalledApps");
4250
4378
  }
4251
- function startNativeApp(package_name, activity, action, uri, flags, param) {
4379
+ function startNativeApp(package_name, activity, action, uri, flags, param, category) {
4252
4380
  var obj = {};
4253
4381
  if (package_name !== null && package_name !== "")
4254
4382
  obj.packageName = package_name;
@@ -4262,8 +4390,28 @@ function startNativeApp(package_name, activity, action, uri, flags, param) {
4262
4390
  obj.flags = flags;
4263
4391
  if (param !== null && param.length > 0)
4264
4392
  obj.param = param;
4393
+ if (category !== null && category.length > 0)
4394
+ obj.category = category;
4265
4395
  direct_call("startNativeApp", JSON.stringify(obj));
4266
4396
  }
4397
+ function openNativeApp(package_name, activity, action, uri, flags, param, category) {
4398
+ var obj = {};
4399
+ if (package_name !== null && package_name !== "")
4400
+ obj.packageName = package_name;
4401
+ if (activity !== null && activity !== "")
4402
+ obj.activity = activity;
4403
+ if (action !== null && action !== "")
4404
+ obj.action = action;
4405
+ if (uri !== null && uri !== "")
4406
+ obj.uri = uri;
4407
+ if (flags !== null && flags.length > 0)
4408
+ obj.flags = flags;
4409
+ if (param !== null && param.length > 0)
4410
+ obj.param = param;
4411
+ if (category !== null && category.length > 0)
4412
+ obj.category = category;
4413
+ return direct_call("openNativeApp", JSON.stringify(obj));
4414
+ }
4267
4415
  function sendNativeBroadcast(package_name, broadcast, action, uri, flags, param) {
4268
4416
  var obj = {};
4269
4417
  if (typeof package_name != void 0 && package_name !== null && package_name !== "")
@@ -4449,7 +4597,9 @@ const bridge = {
4449
4597
  getDeviceUUID,
4450
4598
  getAndroidId,
4451
4599
  openWindow,
4600
+ openApp,
4452
4601
  startUrlInNewTab,
4602
+ openAppInNewTab,
4453
4603
  onWindowResult,
4454
4604
  reloadWindow,
4455
4605
  closePage,
@@ -4457,6 +4607,7 @@ const bridge = {
4457
4607
  getSystemProperty,
4458
4608
  getInstalledApps,
4459
4609
  startNativeApp,
4610
+ openNativeApp,
4460
4611
  sendNativeBroadcast,
4461
4612
  startService,
4462
4613
  getDeviceInfo,
@@ -4980,7 +5131,9 @@ function updateImpactAutoFroze(handler, element_auto_froze_pre_impact, element_a
4980
5131
  * @return {int} 文字宽度
4981
5132
  **/
4982
5133
  const getTextWidth = (text, style) => {
4983
- let forgeRef = Forge$1;
5134
+ if (text && typeof text != "string") {
5135
+ text = "" + text;
5136
+ }
4984
5137
  return Forge$1.TextUtils.GetTextWidth(text, style);
4985
5138
  };
4986
5139
  /*
@@ -5249,13 +5402,15 @@ class JsvPerformance {
5249
5402
  let handles = {
5250
5403
  TextureManager: null,
5251
5404
  RootView: null,
5252
- RootActivity: null
5405
+ RootActivity: null,
5406
+ sRenderBridge: null
5253
5407
  };
5254
5408
  const jsvCode = window.JsvCode;
5255
5409
  jsvCode.ForgeHandles.listenToReady(() => {
5256
5410
  handles.TextureManager = jsvCode.ForgeHandles.TextureManager;
5257
5411
  handles.RootView = jsvCode.ForgeHandles.RootView;
5258
5412
  handles.RootActivity = jsvCode.ForgeHandles.RootActivity;
5413
+ handles.sRenderBridge = jsvCode.ForgeHandles.sRenderBridge;
5259
5414
  });
5260
5415
 
5261
5416
  /*
@@ -5263,9 +5418,14 @@ jsvCode.ForgeHandles.listenToReady(() => {
5263
5418
  */
5264
5419
  class JsvTextureStore {
5265
5420
  textureMap = /* @__PURE__ */ new Map();
5421
+ hasAutoRecycle = false;
5266
5422
  constructor() {
5267
5423
  }
5268
5424
  addToStore(storeName, textureRef) {
5425
+ if (!this.hasAutoRecycle && textureRef && textureRef.isAutoRecycle()) {
5426
+ this.hasAutoRecycle = true;
5427
+ handles.sRenderBridge.AddWillSwapListener("jsv-texture-store", this.onWillSwap.bind(this));
5428
+ }
5269
5429
  this.textureMap.set(storeName, textureRef);
5270
5430
  }
5271
5431
  getFromStore(storeName) {
@@ -5281,22 +5441,43 @@ class JsvTextureStore {
5281
5441
  return void 0;
5282
5442
  }
5283
5443
  }
5444
+ onWillSwap() {
5445
+ this.textureMap.forEach((texture, key) => {
5446
+ if (texture && texture.isAutoRecycle()) {
5447
+ texture.tryRecycle();
5448
+ }
5449
+ });
5450
+ }
5284
5451
  }
5285
5452
  let sStore = new JsvTextureStore();
5286
5453
 
5287
5454
  /*
5288
5455
  + @file {@link file://./../../../../utils/JsViewVueTools/JsvTextureStore/Texture.ts}
5289
5456
  */
5457
+ const AUTO_RECYCLE_DELAY = 3;
5290
5458
  class TextureBase {
5291
5459
  baseName = "T";
5292
5460
  textureRef = null;
5293
5461
  // Forge.ImageTexture
5294
5462
  storeName = "";
5463
+ autoRecycle = false;
5464
+ autoRecycleDelay = AUTO_RECYCLE_DELAY;
5295
5465
  constructor(baseName) {
5296
5466
  if (baseName) {
5297
5467
  this.baseName = baseName;
5298
5468
  }
5299
5469
  }
5470
+ tryRecycle() {
5471
+ if (!this.autoRecycle)
5472
+ return;
5473
+ this.autoRecycleDelay--;
5474
+ if (this.autoRecycleDelay < 0) {
5475
+ this.recycle();
5476
+ }
5477
+ }
5478
+ isAutoRecycle() {
5479
+ return this.autoRecycle;
5480
+ }
5300
5481
  addToStore() {
5301
5482
  this.storeName = this.getStoreName();
5302
5483
  this.textureRef.DisableAutoRecycle();
@@ -5308,7 +5489,7 @@ class TextureBase {
5308
5489
  /**
5309
5490
  * commit
5310
5491
  * 完成绘制设置,出发制作目标texture
5311
- *
5492
+ *
5312
5493
  * @return {String} BaseName-textureId 格式的名字,用于 jsvtexturestore:// 的访问链接
5313
5494
  */
5314
5495
  commit() {
@@ -5317,7 +5498,7 @@ class TextureBase {
5317
5498
  /**
5318
5499
  * getTextureRef
5319
5500
  * 内部接口,获取内联的Forge.ImageTexture的句柄
5320
- *
5501
+ *
5321
5502
  * @return {String} BaseName-textureId 格式的名字,用于 jsvtexturestore:// 的访问链接
5322
5503
  */
5323
5504
  getTextureRef() {
@@ -5736,20 +5917,22 @@ class CanvasTexture extends TextureBase {
5736
5917
  + @file {@link file://./../../../../../utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts}
5737
5918
  */
5738
5919
  class CapturedTexture extends TextureBase {
5739
- _AutoRecycle;
5740
5920
  _Callback;
5741
5921
  _CaptureDiv;
5742
5922
  _Canceled = false;
5743
- constructor(captureDiv, callback, autoRecycle) {
5923
+ _PostProcessParams = null;
5924
+ constructor(captureDiv, callback, autoRecycle, postProcessParams = null) {
5744
5925
  super(null);
5745
5926
  JsvUseFeature("JsvTextureStoreApi", FeatureNames.Capture2Texture);
5746
5927
  this._CaptureDiv = captureDiv;
5747
5928
  this._Callback = callback;
5748
- this._AutoRecycle = autoRecycle;
5929
+ this.autoRecycle = autoRecycle;
5930
+ this._PostProcessParams = postProcessParams;
5749
5931
  }
5750
5932
  // 清理对Callback和div的引用,防止泄露
5751
5933
  cancel() {
5752
5934
  if (!this._Canceled) {
5935
+ this._Callback?.("", this.autoRecycle, 0, 0, true);
5753
5936
  this._Callback = null;
5754
5937
  this._CaptureDiv = null;
5755
5938
  this._Canceled = true;
@@ -5764,21 +5947,52 @@ class CapturedTexture extends TextureBase {
5764
5947
  if (this._Canceled) {
5765
5948
  return;
5766
5949
  }
5767
- if (!this._AutoRecycle) {
5768
- this.addToStore();
5769
- }
5950
+ this.addToStore();
5770
5951
  this._Callback?.(
5771
5952
  this.getStoreName(),
5772
- this._AutoRecycle,
5953
+ this.autoRecycle,
5773
5954
  resultObj.width,
5774
- resultObj.height
5955
+ resultObj.height,
5956
+ false
5775
5957
  );
5776
- }
5958
+ },
5959
+ this._PostProcessParams
5777
5960
  );
5778
5961
  return "";
5779
5962
  }
5780
5963
  }
5781
5964
 
5965
+ /*
5966
+ + @file {@link file://./../../../../../utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.ts}
5967
+ */
5968
+ function getDominantColorByForgeTexture(src, cbk) {
5969
+ if (!src) {
5970
+ console.warn("getDominantColorByForgeTexture: src is empty");
5971
+ return () => {
5972
+ };
5973
+ }
5974
+ const setting = { src };
5975
+ let texture = handles.TextureManager.GetImageProcessTexture(
5976
+ JSON.stringify(setting)
5977
+ );
5978
+ let canceled = false;
5979
+ const callback = (info) => {
5980
+ if (canceled) {
5981
+ return;
5982
+ }
5983
+ cbk(info.extra);
5984
+ texture?.RequestToUnload();
5985
+ texture = null;
5986
+ };
5987
+ texture.DisableAutoRecycle();
5988
+ texture.RegisterLoadImageCallback(src, callback, null);
5989
+ return () => {
5990
+ canceled = true;
5991
+ texture?.RequestToUnload();
5992
+ texture = null;
5993
+ };
5994
+ }
5995
+
5782
5996
  /*
5783
5997
  + @file {@link file://./../../../../utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts}
5784
5998
  */
@@ -5842,10 +6056,11 @@ let sTextureStoreApi = {
5842
6056
  不需要主动调用deleteTexture释放.
5843
6057
  false: 此场景在callback收到资源名后, 需要使用完毕后调用 deleteTexture 手动释放
5844
6058
  在手动释放之前,可以赋给其他div/img来复用
6059
+ * @param {any} postProcessParams 可选, 截图处理的参数
5845
6060
  * @return {CapturedTexture} 用于cancel的句柄,当cancel时,会清理对div和Callback的引用
5846
6061
  */
5847
- capture2Texture: (captureDiv, callback, autoRecycle = true) => {
5848
- let texture = new CapturedTexture(captureDiv, callback, autoRecycle);
6062
+ capture2Texture: (captureDiv, callback, autoRecycle = true, postProcessParams = null) => {
6063
+ let texture = new CapturedTexture(captureDiv, callback, autoRecycle, postProcessParams);
5849
6064
  texture.commit();
5850
6065
  return texture;
5851
6066
  },
@@ -5860,8 +6075,25 @@ let sTextureStoreApi = {
5860
6075
  if (textureRef) {
5861
6076
  textureRef.recycle();
5862
6077
  }
6078
+ },
6079
+ /**
6080
+ * getDominantColor
6081
+ * 获取图片的 dominant color
6082
+ *
6083
+ * @param src 图片的src
6084
+ * @param callback 回调函数, 参数: info
6085
+ * @return 用于cancel的句柄,当cancel时,会清理对div和Callback的引用
6086
+ */
6087
+ getDominantColor: (src, callback) => {
6088
+ return getDominantColorByForgeTexture(src, (i) => {
6089
+ callback(i);
6090
+ });
5863
6091
  }
5864
6092
  };
6093
+ var CaptureProcessType = /* @__PURE__ */ ((CaptureProcessType2) => {
6094
+ CaptureProcessType2[CaptureProcessType2["Blur"] = 1] = "Blur";
6095
+ return CaptureProcessType2;
6096
+ })(CaptureProcessType || {});
5865
6097
 
5866
6098
  /*
5867
6099
  + @file {@link file://./../../../utils/JsViewVueTools/JsvFederationTools.ts}
@@ -6140,7 +6372,11 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6140
6372
  if (props.itemConfig) {
6141
6373
  console.error(TAG$2, "prop: itemCofig will be deprecated soon.");
6142
6374
  }
6143
- let widgetRectInfo = new WidgetRectInfo(props.width, props.height, props.padding);
6375
+ let widgetRectInfo = new WidgetRectInfo(
6376
+ props.width,
6377
+ props.height,
6378
+ props.padding
6379
+ );
6144
6380
  let metroTemplate = _getMetroTemplate(
6145
6381
  widgetRectInfo,
6146
6382
  props.direction,
@@ -6293,7 +6529,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6293
6529
  if (animInfo) {
6294
6530
  resizeAnimInfo.doAnim = true;
6295
6531
  resizeAnimInfo.duration = animInfo.duration ?? resizeAnimInfo.duration;
6296
- resizeAnimInfo.easing = animInfo.duration ?? "";
6532
+ resizeAnimInfo.easing = animInfo.easing ?? "";
6297
6533
  }
6298
6534
  minIndex = Math.min(minIndex, index);
6299
6535
  metroTemplate.updateItemSize(task.params.index, {
@@ -6316,7 +6552,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6316
6552
  }
6317
6553
  }
6318
6554
  }
6319
- let targetRect2 = null;
6555
+ let targetRect = null;
6320
6556
  let direction = void 0;
6321
6557
  let validSlideTask = false;
6322
6558
  let forceSlide = false;
@@ -6330,20 +6566,28 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6330
6566
  case SlideTaskType.SLIDE_BY_DIV:
6331
6567
  {
6332
6568
  const div = slideTask.params.div;
6333
- const item_layout = div.jsvGetRelativePosition(toRaw(locateDiv.value));
6569
+ const item_layout = div.jsvGetRelativePosition(
6570
+ toRaw(locateDiv.value)
6571
+ );
6334
6572
  let fakeItem = {
6335
6573
  templateInfo: {
6336
6574
  left: item_layout.left,
6337
6575
  top: item_layout.top,
6338
6576
  width: item_layout.width,
6339
6577
  height: item_layout.height,
6340
- centerYPos: Math.floor(item_layout.top + item_layout.height / 2),
6341
- centerXPos: Math.floor(item_layout.left + item_layout.width / 2),
6578
+ centerYPos: Math.floor(
6579
+ item_layout.top + item_layout.height / 2
6580
+ ),
6581
+ centerXPos: Math.floor(
6582
+ item_layout.left + item_layout.width / 2
6583
+ ),
6342
6584
  index: id2Index(focusId)
6343
6585
  }
6344
6586
  };
6345
- templateItemAdder.tryAddItemByPosition(vertical ? fakeItem.templateInfo.top : fakeItem.templateInfo.left);
6346
- targetRect2 = fakeItem.templateInfo;
6587
+ templateItemAdder.tryAddItemByPosition(
6588
+ vertical ? fakeItem.templateInfo.top : fakeItem.templateInfo.left
6589
+ );
6590
+ targetRect = fakeItem.templateInfo;
6347
6591
  }
6348
6592
  break;
6349
6593
  case SlideTaskType.SLIDE_BY_POS:
@@ -6362,7 +6606,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6362
6606
  if (typeof slideTask.params.direction != "undefined") {
6363
6607
  direction = slideTask.params.direction;
6364
6608
  }
6365
- targetRect2 = targetItem.templateInfo;
6609
+ targetRect = targetItem.templateInfo;
6366
6610
  } else {
6367
6611
  validSlideTask = false;
6368
6612
  }
@@ -6373,7 +6617,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6373
6617
  if (typeof slideTask.params.direction != "undefined") {
6374
6618
  direction = slideTask.params.direction;
6375
6619
  }
6376
- targetRect2 = slideTask.params.rect;
6620
+ targetRect = slideTask.params.rect;
6377
6621
  }
6378
6622
  break;
6379
6623
  default:
@@ -6383,37 +6627,57 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6383
6627
  }
6384
6628
  if (!validSlideTask && resizeList.length > 0) {
6385
6629
  if (anchorInfo) {
6386
- const focusItem = getItemById(focusId);
6387
- let start = focusItem.templateInfo[pos_key] + focusItem.templateInfo[size_key] * anchorInfo.anchor - 1 - anchorInfo.anchorPosition;
6630
+ const focusItem2 = getItemById(focusId);
6631
+ let start = focusItem2.templateInfo[pos_key] + focusItem2.templateInfo[size_key] * anchorInfo.anchor - 1 - anchorInfo.anchorPosition;
6388
6632
  let totalSize = metroTemplate.getBoundingBoxSize();
6389
- start = Math.min(Math.max(0, start), totalSize[size_key] - visibleInfo.range);
6390
- if (focusItem.index == 0) {
6391
- if (start > focusItem.templateInfo[pos_key]) {
6633
+ start = Math.min(
6634
+ Math.max(0, start),
6635
+ totalSize[size_key] - visibleInfo.range
6636
+ );
6637
+ if (focusItem2.index == 0) {
6638
+ if (start > focusItem2.templateInfo[pos_key]) {
6392
6639
  start = 0;
6393
6640
  }
6394
- } else if (focusItem.templateInfo.index == metroTemplate.getTailItemIndex()) {
6395
- if (start + visibleInfo.range > focusItem.templateInfo[pos_key]) {
6396
- start = Math.max(focusItem.templateInfo[size_key] + focusItem.templateInfo[pos_key] - visibleInfo.range, 0);
6641
+ } else if (focusItem2.templateInfo.index == metroTemplate.getTailItemIndex()) {
6642
+ if (start + visibleInfo.range > focusItem2.templateInfo[pos_key]) {
6643
+ start = Math.max(
6644
+ focusItem2.templateInfo[size_key] + focusItem2.templateInfo[pos_key] - visibleInfo.range,
6645
+ 0
6646
+ );
6397
6647
  }
6398
6648
  }
6399
- targetVisibleStart = normalizeVisibleStart(start, focusItem.templateInfo, focusItem.templateInfo.index, visibleInfo);
6649
+ targetVisibleStart = normalizeVisibleStart(
6650
+ start,
6651
+ focusItem2.templateInfo,
6652
+ focusItem2.templateInfo.index,
6653
+ visibleInfo
6654
+ );
6400
6655
  } else {
6401
- targetRect2 = getItemById(focusId).templateInfo;
6656
+ targetRect = getItemById(focusId).templateInfo;
6402
6657
  }
6403
6658
  slideDoAnim = resizeAnimInfo.doAnim;
6404
6659
  }
6405
- if (targetRect2) {
6660
+ if (targetRect) {
6406
6661
  const v = visibleInfo.copy();
6407
6662
  let preInfo = null;
6408
6663
  if (resizeList.length > 0) {
6409
6664
  preInfo = mRectCache.getPreRect();
6410
6665
  if (preInfo) {
6411
6666
  let totalSize = metroTemplate.getBoundingBoxSize();
6412
- v.start = Math.min(Math.max(0, targetRect2[pos_key] - preInfo[pos_key] + v.start), Math.max(0, totalSize[size_key] - v.range));
6667
+ v.start = Math.min(
6668
+ Math.max(0, targetRect[pos_key] - preInfo[pos_key] + v.start),
6669
+ Math.max(0, totalSize[size_key] - v.range)
6670
+ );
6413
6671
  preInfo[pos_key] += v.start - visibleInfo.start;
6414
6672
  }
6415
6673
  }
6416
- targetVisibleStart = _calculateVisibleStart(targetRect2, direction, targetRect2, v, preInfo);
6674
+ targetVisibleStart = _calculateVisibleStart(
6675
+ targetRect,
6676
+ direction,
6677
+ targetRect,
6678
+ v,
6679
+ preInfo
6680
+ );
6417
6681
  } else {
6418
6682
  if (resizeList.length > 0) {
6419
6683
  let tRect = getItemById(focusId)?.templateInfo;
@@ -6469,7 +6733,10 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6469
6733
  div,
6470
6734
  [layoutCache.left - left, layoutCache.top - top],
6471
6735
  [0, 0],
6472
- resizeTaskMap[index] ? resizeTaskMap[index].params.animInfo : { duration: resizeAnimInfo.duration }
6736
+ resizeTaskMap[index] ? resizeTaskMap[index].params.animInfo : {
6737
+ duration: resizeAnimInfo.duration,
6738
+ easing: resizeAnimInfo.easing
6739
+ }
6473
6740
  );
6474
6741
  return () => {
6475
6742
  cancel();
@@ -6495,8 +6762,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6495
6762
  let animInfo = void 0;
6496
6763
  if (slideDoAnim) {
6497
6764
  animInfo = {
6498
- easing: null,
6499
- //resizeAnimInfo.doAnim ? resizeAnimInfo.easing : '' /* innerSlideSetting.Easing */,
6765
+ easing: resizeAnimInfo.doAnim ? resizeAnimInfo.easing : innerSlideSetting.Easing,
6500
6766
  duration: resizeAnimInfo.doAnim ? resizeAnimInfo.duration : innerSlideSetting.Duration,
6501
6767
  speed: innerSlideSetting.Speed,
6502
6768
  onStart: null,
@@ -6573,21 +6839,18 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6573
6839
  const updateItemSize = (index, newSize, animInfo) => {
6574
6840
  const item = getItemByIndex(index);
6575
6841
  if (item && (item.templateInfo.width !== newSize.width || item.templateInfo.height !== newSize.height)) {
6576
- taskManager.addTask(
6577
- TaskType.RESIZE_ITEM,
6578
- {
6579
- index,
6580
- width: newSize.width,
6581
- height: newSize.height,
6582
- animInfo,
6583
- preRect: {
6584
- left: item.templateInfo.left,
6585
- top: item.templateInfo.top,
6586
- width: item.templateInfo.width,
6587
- height: item.templateInfo.height
6588
- }
6842
+ taskManager.addTask(TaskType.RESIZE_ITEM, {
6843
+ index,
6844
+ width: newSize.width,
6845
+ height: newSize.height,
6846
+ animInfo,
6847
+ preRect: {
6848
+ left: item.templateInfo.left,
6849
+ top: item.templateInfo.top,
6850
+ width: item.templateInfo.width,
6851
+ height: item.templateInfo.height
6589
6852
  }
6590
- );
6853
+ });
6591
6854
  }
6592
6855
  };
6593
6856
  let callFocusAfterUpdate = false;
@@ -6664,7 +6927,6 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6664
6927
  if (!item) {
6665
6928
  return;
6666
6929
  }
6667
- ;
6668
6930
  if (isFocus) {
6669
6931
  item.onClick();
6670
6932
  }
@@ -6678,24 +6940,24 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6678
6940
  }
6679
6941
  };
6680
6942
  let gazeIndex = -1;
6681
- const onItemFocus = (focusItem, rect) => {
6682
- if (!focusItem)
6943
+ const onItemFocus = (focusItem2, rect) => {
6944
+ if (!focusItem2)
6683
6945
  return;
6684
- setItemZIndex(focusItem, innerData.length, true);
6946
+ setItemZIndex(focusItem2, innerData.length, true);
6685
6947
  if (isFocus) {
6686
- _itemOnFocusSideEffect(focusItem, rect);
6948
+ _itemOnFocusSideEffect(focusItem2, rect);
6687
6949
  }
6688
- if (focusItem.mounted.value) {
6689
- if (gazeIndex != focusItem.templateInfo.index) {
6950
+ if (focusItem2.mounted.value) {
6951
+ if (gazeIndex != focusItem2.templateInfo.index) {
6690
6952
  let preGazeItem = getItemByIndex(gazeIndex);
6691
6953
  if (preGazeItem) {
6692
6954
  preGazeItem.onIgnore();
6693
6955
  }
6694
- gazeIndex = focusItem.templateInfo.index;
6695
- focusItem.onGaze(rect);
6956
+ gazeIndex = focusItem2.templateInfo.index;
6957
+ focusItem2.onGaze(rect);
6696
6958
  }
6697
6959
  if (isFocus) {
6698
- focusItem.onFocus(rect);
6960
+ focusItem2.onFocus(rect);
6699
6961
  }
6700
6962
  return true;
6701
6963
  } else {
@@ -6711,6 +6973,16 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6711
6973
  item.onLongPress();
6712
6974
  }
6713
6975
  };
6976
+ const onItemTap = (gazeItem) => {
6977
+ if (gazeIndex != gazeItem.templateInfo.index) {
6978
+ let preGazeItem = getItemByIndex(gazeIndex);
6979
+ if (preGazeItem) {
6980
+ preGazeItem.onIgnore();
6981
+ }
6982
+ gazeIndex = gazeItem.templateInfo.index;
6983
+ gazeItem.onGaze(null);
6984
+ }
6985
+ };
6714
6986
  const setFocusByUid = (uid, needSlide = true, doAnim = false, extraSetting) => {
6715
6987
  if (!uid || innerData.length <= 0) {
6716
6988
  return;
@@ -6821,8 +7093,11 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6821
7093
  if (slideLock || position == (vertical ? slideDivTop.value : slideDivLeft.value)) {
6822
7094
  return;
6823
7095
  }
6824
- ;
6825
- taskManager.addTask(TaskType.SLIDE, { position, doAnim, updateParam }, SlideTaskType.SLIDE_BY_POS);
7096
+ taskManager.addTask(
7097
+ TaskType.SLIDE,
7098
+ { position, doAnim, updateParam },
7099
+ SlideTaskType.SLIDE_BY_POS
7100
+ );
6826
7101
  };
6827
7102
  const slideTo = (position, doAnim) => {
6828
7103
  if (typeof position == "number") {
@@ -6897,55 +7172,61 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6897
7172
  let layoutChange = false;
6898
7173
  let onlyDataChangeList = [];
6899
7174
  let targetFocusId = focusId;
6900
- if (focusId >= newData.length) {
6901
- targetFocusId = newData.length - 1;
6902
- }
6903
- if (!forceUpdate) {
6904
- for (let i = 0; i < dataList.length; ++i) {
6905
- let oldItem = dataList[i];
6906
- let newItem = newData[i];
6907
- if (newItem) {
6908
- if ((typeof newItem[DATA_ID_KEY] == "undefined" || typeof dataKeyList[i] == "undefined") && newItem === oldItem || typeof newItem[DATA_ID_KEY] !== "undefined" && typeof dataKeyList[i] !== "undefined" && newItem[DATA_ID_KEY] === dataKeyList[i]) {
6909
- maxSameIndex = Math.max(maxSameIndex, i);
6910
- } else {
6911
- const newMeasureItem = props.measures(newItem);
6912
- const oldMeasureItem = props.measures(oldItem);
6913
- layoutChange = ifLayoutChange(props.layoutType, oldMeasureItem, newMeasureItem);
6914
- if (layoutChange) {
6915
- break;
7175
+ let curFocusItemChanged = true;
7176
+ if (newData.length == 0) {
7177
+ layoutChange = true;
7178
+ targetFocusId = -1;
7179
+ } else {
7180
+ if (focusId < 0) {
7181
+ targetFocusId = 0;
7182
+ } else if (focusId >= newData.length) {
7183
+ targetFocusId = newData.length - 1;
7184
+ }
7185
+ if (!forceUpdate) {
7186
+ const curFocusIndex = id2Index(focusId);
7187
+ for (let i = 0; i < dataList.length; ++i) {
7188
+ let oldItem = dataList[i];
7189
+ let newItem = newData[i];
7190
+ if (newItem) {
7191
+ if ((typeof newItem[DATA_ID_KEY] == "undefined" || typeof dataKeyList[i] == "undefined") && newItem === oldItem || typeof newItem[DATA_ID_KEY] !== "undefined" && typeof dataKeyList[i] !== "undefined" && newItem[DATA_ID_KEY] === dataKeyList[i]) {
7192
+ maxSameIndex = Math.max(maxSameIndex, i);
7193
+ if (curFocusIndex == i) {
7194
+ curFocusItemChanged = false;
7195
+ }
6916
7196
  } else {
6917
- if (i < innerData.length) {
6918
- onlyDataChangeList.push({
6919
- templateInfo: innerData[i].templateInfo,
6920
- measureObj: newMeasureItem,
6921
- data: newItem,
6922
- index: i
6923
- });
7197
+ const newMeasureItem = props.measures(newItem);
7198
+ const oldMeasureItem = props.measures(oldItem);
7199
+ layoutChange = ifLayoutChange(
7200
+ props.layoutType,
7201
+ oldMeasureItem,
7202
+ newMeasureItem
7203
+ );
7204
+ if (layoutChange) {
7205
+ break;
7206
+ } else {
7207
+ if (i < innerData.length) {
7208
+ onlyDataChangeList.push({
7209
+ templateInfo: innerData[i].templateInfo,
7210
+ measureObj: newMeasureItem,
7211
+ data: newItem,
7212
+ index: i
7213
+ });
7214
+ }
6924
7215
  }
6925
7216
  }
6926
- }
6927
- } else {
6928
- if (i >= newData.length) {
6929
- layoutChange = true;
6930
- break;
6931
7217
  } else {
6932
- throw new Error("undefined item in data list.", i, newData);
7218
+ if (i >= newData.length) {
7219
+ layoutChange = true;
7220
+ break;
7221
+ } else {
7222
+ throw new Error("undefined item in data list.", i, newData);
7223
+ }
6933
7224
  }
6934
7225
  }
6935
7226
  }
6936
7227
  }
6937
- let needSlide = false;
6938
- if (slideToFocus == "enable") {
6939
- needSlide = true;
6940
- } else if (slideToFocus == "disable") {
6941
- needSlide = false;
6942
- } else {
6943
- let targetRect2 = mRectCache.getCurRect() ?? mRectCache.getPreRect();
6944
- if (targetRect2) {
6945
- needSlide = rectVisibleState(targetRect2) !== 0;
6946
- } else {
6947
- needSlide = rectVisibleState(getItemById(focusId)?.templateInfo) !== 0;
6948
- }
7228
+ if (forceUpdate || curFocusItemChanged || targetFocusId != focusId) {
7229
+ gazeIndex = -1;
6949
7230
  }
6950
7231
  dataList = newData;
6951
7232
  dataKeyList = dataList.map((i) => i[DATA_ID_KEY]);
@@ -6969,15 +7250,15 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6969
7250
  props.name,
6970
7251
  _onTemplateAddDone
6971
7252
  );
6972
- if (props.onScroll) {
7253
+ if (props.onScroll || props.touchFlag > 0) {
6973
7254
  templateItemAdder.tryAddItemByIndex(dataList.length - 1);
6974
7255
  } else {
6975
7256
  templateItemAdder.tryAddItemById(targetFocusId);
6976
7257
  }
6977
7258
  } else {
7259
+ templateItemAdder.updateData(newData);
6978
7260
  if (maxSameIndex < newData.length - 1) {
6979
- templateItemAdder.updateData(newData);
6980
- if (props.onScroll) {
7261
+ if (props.onScroll || props.touchFlag > 0) {
6981
7262
  templateItemAdder.tryAddItemByIndex(dataList.length - 1);
6982
7263
  } else {
6983
7264
  templateItemAdder.tryAddItemById(targetFocusId);
@@ -6986,7 +7267,10 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6986
7267
  if (onlyDataChangeList.length > 0) {
6987
7268
  for (let i of onlyDataChangeList) {
6988
7269
  if (i.index < innerData.length) {
6989
- innerData[i.index].updateCustomData(i.data, _getItemConfigFromMeasursObj(i.measureObj));
7270
+ innerData[i.index].updateCustomData(
7271
+ i.data,
7272
+ _getItemConfigFromMeasursObj(i.measureObj)
7273
+ );
6990
7274
  innerData[i.index].enableTap = i.measureObj.enableTap ?? false;
6991
7275
  } else {
6992
7276
  break;
@@ -6994,14 +7278,6 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
6994
7278
  }
6995
7279
  }
6996
7280
  }
6997
- if (targetFocusId != focusId) {
6998
- _changeFocusId(targetFocusId, false);
6999
- visibleInfo = visibleInfo.copy();
7000
- visibleInfo.start = 0;
7001
- visibleInfo._startMax = 0;
7002
- slideDivLeft.value = 0;
7003
- slideDivTop.value = 0;
7004
- }
7005
7281
  const updater = pageUpdater.update(
7006
7282
  metroTemplate,
7007
7283
  visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
@@ -7011,16 +7287,50 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7011
7287
  permanentItemList
7012
7288
  );
7013
7289
  updater.apply();
7014
- const focusItem = getItemById(focusId);
7015
- onItemFocus(focusItem, null);
7016
- if (needSlide) {
7017
- if (targetRect) {
7018
- slideToRectInner(targetRect, false, 0, true);
7019
- } else if (focusItem.itemConfig.itemSlide == METRO_WIDGET.ITEM_SLIDE.ACT_ITEM_FOCUS) {
7020
- slideToItemInner(id2Index(focusId), false, 0, 0, true);
7290
+ if (mode.getMode() == TOUCH_MODE) {
7291
+ } else {
7292
+ let needSlide = false;
7293
+ let targetRect = mRectCache.getCurRect() ?? mRectCache.getPreRect();
7294
+ if (targetFocusId != focusId) {
7295
+ needSlide = true;
7296
+ } else if (slideToFocus == "enable") {
7297
+ needSlide = true;
7298
+ } else if (slideToFocus == "disable") {
7299
+ needSlide = false;
7300
+ } else {
7301
+ if (targetRect) {
7302
+ needSlide = rectVisibleState(targetRect) !== 0;
7303
+ } else {
7304
+ needSlide = rectVisibleState(getItemById(focusId)?.templateInfo) !== 0;
7305
+ }
7306
+ }
7307
+ if (targetFocusId != focusId) {
7308
+ visibleInfo = visibleInfo.copy();
7309
+ visibleInfo.start = 0;
7310
+ visibleInfo._startMax = 0;
7311
+ slideDivLeft.value = 0;
7312
+ slideDivTop.value = 0;
7313
+ }
7314
+ if (targetFocusId != focusId) {
7315
+ _changeFocusId(targetFocusId, false);
7316
+ }
7317
+ const focusItem2 = getItemById(focusId);
7318
+ if (focusItem2) {
7319
+ preEdgeRect = null;
7320
+ onItemFocus(focusItem2, null);
7321
+ if (needSlide) {
7322
+ if (targetRect) {
7323
+ slideToRectInner(targetRect, false, 0, true);
7324
+ } else if (focusItem2.itemConfig.itemSlide == METRO_WIDGET.ITEM_SLIDE.ACT_ITEM_FOCUS) {
7325
+ slideToItemInner(id2Index(focusId), false, 0, 0, true);
7326
+ }
7327
+ }
7328
+ } else {
7329
+ slideToInner(0, false);
7330
+ preEdgeRect = null;
7331
+ mRectCache.clean();
7021
7332
  }
7022
7333
  }
7023
- updateTouchBoxCondition();
7024
7334
  }
7025
7335
  } catch (e) {
7026
7336
  console.log(TAG$2, "refresh error", e);
@@ -7252,13 +7562,16 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7252
7562
  if (mode.getMode() == TOUCH_MODE && !mode.duringTouch()) {
7253
7563
  if (ev.keyCode == 37 || ev.keyCode == 38 || ev.keyCode == 39 || ev.keyCode == 40) {
7254
7564
  mode.keyDown();
7255
- const focusItem = _getVisibleFocusableItem();
7256
- const preFocusItem = getItemById(focusId);
7257
- _changeFocusId(focusItem.id, false);
7258
- if (preFocusItem.id !== focusItem.id) {
7259
- onItemBlur(preFocusItem);
7565
+ const focusItem2 = _getVisibleFocusableItem();
7566
+ if (focusItem2) {
7567
+ const preFocusItem = getItemById(focusId);
7568
+ _changeFocusId(focusItem2.id, false);
7569
+ if (preFocusItem.id !== focusItem2.id) {
7570
+ onItemBlur(preFocusItem);
7571
+ }
7572
+ onItemFocus(focusItem2);
7260
7573
  }
7261
- onItemFocus(focusItem);
7574
+ return true;
7262
7575
  }
7263
7576
  }
7264
7577
  return false;
@@ -7284,13 +7597,14 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7284
7597
  let clickDownReceived = false;
7285
7598
  let longPressTriggered = false;
7286
7599
  const focusBlockOnKeyUp = (ev) => {
7287
- if (!props.enableLongPress) {
7600
+ const curFocusItem = getItemById(focusId);
7601
+ if (!curFocusItem || !curFocusItem.itemConfig.enableLongPress) {
7288
7602
  return false;
7289
7603
  }
7290
7604
  if (!longPressTriggered) {
7291
7605
  if (ev.keyCode == 13 && clickDownReceived) {
7292
7606
  clickDownReceived = false;
7293
- onItemClick(getItemById(focusId));
7607
+ onItemClick(curFocusItem);
7294
7608
  return true;
7295
7609
  }
7296
7610
  } else {
@@ -7317,14 +7631,15 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7317
7631
  return true;
7318
7632
  }
7319
7633
  if (ev.keyCode == 13) {
7634
+ const curFocusItem = getItemById(focusId);
7320
7635
  clickDownReceived = true;
7321
- if (props.enableLongPress) {
7636
+ if (curFocusItem.itemConfig.enableLongPress) {
7322
7637
  if (ev.repeat && ev.timeStamp - preStartKeyDownTime > LONGPRESS_TIMEOUT && !longPressTriggered) {
7323
7638
  longPressTriggered = true;
7324
- onItemLongPress(getItemById(focusId));
7639
+ onItemLongPress(curFocusItem);
7325
7640
  }
7326
7641
  } else if (!ev.repeat) {
7327
- onItemClick(getItemById(focusId));
7642
+ onItemClick(curFocusItem);
7328
7643
  }
7329
7644
  return true;
7330
7645
  } else {
@@ -7374,7 +7689,8 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7374
7689
  normalZIndex,
7375
7690
  permanent: measuresObj.permanent ?? false,
7376
7691
  itemSlide: measuresObj.itemSlide ?? METRO_WIDGET.ITEM_SLIDE.ACT_ITEM_FOCUS,
7377
- showSkeleton: measuresObj.showSkeleton ?? true
7692
+ showSkeleton: measuresObj.showSkeleton ?? true,
7693
+ enableLongPress: measuresObj.enableLongPress ?? props.enableLongPress
7378
7694
  };
7379
7695
  };
7380
7696
  const _onTemplateItemAdd = (customerData, templateItem, measuresObj) => {
@@ -7409,9 +7725,24 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7409
7725
  slideTo,
7410
7726
  updateItemSize,
7411
7727
  widgetHandler: exportObject
7728
+ },
7729
+ {
7730
+ onTap: onItemTap
7412
7731
  }
7413
7732
  );
7414
7733
  item.enableTap = measuresObj.enableTap ?? false;
7734
+ if (props.enableItemRenderBreak) {
7735
+ if (measuresObj.placeHolderLayout && typeof measuresObj.placeHolderLayout.left == "number" && typeof measuresObj.placeHolderLayout.top == "number" && typeof measuresObj.placeHolderLayout.width == "number" && typeof measuresObj.placeHolderLayout.height == "number") {
7736
+ item.placeHolderLayout = Object.assign({}, measuresObj.placeHolderLayout);
7737
+ } else {
7738
+ item.placeHolderLayout = {
7739
+ left: 0,
7740
+ top: 0,
7741
+ width: item.renderStyle.width - (props.placeHolderSetting.gap ?? 0),
7742
+ height: item.renderStyle.height - (props.placeHolderSetting.gap ?? 0)
7743
+ };
7744
+ }
7745
+ }
7415
7746
  innerData.push(item);
7416
7747
  if (item.itemConfig.permanent) {
7417
7748
  permanentItemList.push({
@@ -7439,8 +7770,8 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7439
7770
  if (ev.ownerNode == exportObject) {
7440
7771
  return false;
7441
7772
  }
7442
- const focusItem = getItemById(focusId);
7443
- if (focusItem.itemConfig.itemSlide !== METRO_WIDGET.ITEM_SLIDE.ACT_FOCUS_RECT_EVENT) {
7773
+ const focusItem2 = getItemById(focusId);
7774
+ if (focusItem2.itemConfig.itemSlide !== METRO_WIDGET.ITEM_SLIDE.ACT_FOCUS_RECT_EVENT) {
7444
7775
  return;
7445
7776
  }
7446
7777
  let item_div = ev.element;
@@ -7458,7 +7789,9 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7458
7789
  direction = 1;
7459
7790
  }
7460
7791
  }
7461
- const item_layout = item_div.jsvGetRelativePosition(toRaw(locateDiv.value));
7792
+ const item_layout = item_div.jsvGetRelativePosition(
7793
+ toRaw(locateDiv.value)
7794
+ );
7462
7795
  let fakeItem = {
7463
7796
  templateInfo: {
7464
7797
  left: item_layout.left,
@@ -7470,17 +7803,18 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7470
7803
  index: id2Index(focusId)
7471
7804
  }
7472
7805
  };
7473
- let cur_slide = _calculateVisibleStart(fakeItem.templateInfo, direction, fakeItem.templateInfo, visibleInfo);
7806
+ let cur_slide = _calculateVisibleStart(
7807
+ fakeItem.templateInfo,
7808
+ direction,
7809
+ fakeItem.templateInfo,
7810
+ visibleInfo
7811
+ );
7474
7812
  if (cur_slide != visibleInfo.start) {
7475
- slideToInner(
7476
- cur_slide,
7477
- true,
7478
- {
7479
- //250207 change: 为true时, 会导致不可见的item反复加载,释放, 所以改为false
7480
- //但之前设为true应该是为了保证滚动时的楼层不提前消失, 此后若再遇到这类问题再考虑
7481
- mergeTmp: false
7482
- }
7483
- );
7813
+ slideToInner(cur_slide, true, {
7814
+ //250207 change: 为true时, 会导致不可见的item反复加载,释放, 所以改为false
7815
+ //但之前设为true应该是为了保证滚动时的楼层不提前消失, 此后若再遇到这类问题再考虑
7816
+ mergeTmp: false
7817
+ });
7484
7818
  return true;
7485
7819
  }
7486
7820
  }
@@ -7488,8 +7822,12 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7488
7822
  };
7489
7823
  const _changeFocusId = (id, cache_pre = true) => {
7490
7824
  preFocusId = cache_pre ? focusId : -1;
7491
- focusId = id >= 0 && id < metroTemplate.size ? id : 0;
7492
- currentFocusIndex.value = id2Index(id);
7825
+ if (metroTemplate.size == 0) {
7826
+ focusId = -1;
7827
+ } else {
7828
+ focusId = id >= 0 && id < metroTemplate.size ? id : 0;
7829
+ }
7830
+ currentFocusIndex.value = id2Index(focusId);
7493
7831
  taskManager.addTask(TaskType.ON_FOCUS_CHANGE);
7494
7832
  };
7495
7833
  const _bubbleCustomEvent = (event) => {
@@ -7625,7 +7963,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7625
7963
  });
7626
7964
  }
7627
7965
  };
7628
- const normalizeVisibleStart = (origin, targetRect2, index, _visibleInfo) => {
7966
+ const normalizeVisibleStart = (origin, targetRect, index, _visibleInfo) => {
7629
7967
  let pos_key = vertical ? "top" : "left";
7630
7968
  let size_key = vertical ? "height" : "width";
7631
7969
  let visibleStart = origin;
@@ -7639,7 +7977,9 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7639
7977
  }
7640
7978
  }
7641
7979
  if ((innerSlideSetting.BoundaryProtect & SlideSetting.END_PROTECT) > 0) {
7642
- let lastTemplateInfo = getItemByIndex(metroTemplate.getTailItemIndex()).templateInfo;
7980
+ let lastTemplateInfo = getItemByIndex(
7981
+ metroTemplate.getTailItemIndex()
7982
+ ).templateInfo;
7643
7983
  const lastEnd = lastTemplateInfo[pos_key] + lastTemplateInfo[size_key];
7644
7984
  const lastVisibleStart = Math.max(lastEnd - vInfo.range, 0);
7645
7985
  if (vInfo.end <= lastEnd) {
@@ -7652,16 +7992,16 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7652
7992
  return visibleStart;
7653
7993
  };
7654
7994
  const mRectCache = new RectCache();
7655
- const _calculateVisibleStart = (targetRect2, _direction, templateInfo, vInfo, preInfo = null) => {
7656
- if (!targetRect2) {
7995
+ const _calculateVisibleStart = (targetRect, _direction, templateInfo, vInfo, preInfo = null) => {
7996
+ if (!targetRect) {
7657
7997
  console.error("MetroWidget: _calculateVisibleStart target item is null");
7658
7998
  return 0;
7659
7999
  }
7660
8000
  const curRect = {
7661
- left: targetRect2.left,
7662
- top: targetRect2.top,
7663
- width: targetRect2.width,
7664
- height: targetRect2.height,
8001
+ left: targetRect.left,
8002
+ top: targetRect.top,
8003
+ width: targetRect.width,
8004
+ height: targetRect.height,
7665
8005
  frameCount: Forge$2.sFrameCount.count
7666
8006
  };
7667
8007
  mRectCache.cache(curRect);
@@ -7682,14 +8022,20 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7682
8022
  switch (innerSlideSetting.Type) {
7683
8023
  case SlideSetting.Type.FIX_POSITION:
7684
8024
  if (innerSlideSetting.FixFirstPage) {
7685
- if (targetRect2[pos_key] + targetRect2[size_key] - 1 < vInfo.range) {
8025
+ if (targetRect[pos_key] + targetRect[size_key] - 1 < vInfo.range) {
7686
8026
  new_visible_start = 0;
7687
8027
  needCalculate = false;
7688
8028
  }
7689
8029
  }
7690
8030
  if (needCalculate) {
8031
+ let target = targetRect[pos_key] + targetRect[size_key] / 2;
8032
+ if (innerSlideSetting.Align == "start") {
8033
+ target = targetRect[pos_key];
8034
+ } else if (innerSlideSetting.Align == "end") {
8035
+ target = targetRect[pos_key] + targetRect[size_key];
8036
+ }
7691
8037
  new_visible_start = Math.ceil(
7692
- targetRect2[pos_key] + targetRect2[size_key] / 2 - vInfo.range * innerSlideSetting.FixPercent
8038
+ target - vInfo.range * innerSlideSetting.FixPercent
7693
8039
  );
7694
8040
  }
7695
8041
  break;
@@ -7704,15 +8050,15 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7704
8050
  break;
7705
8051
  case SlideSetting.Type.SEAMLESS:
7706
8052
  if (innerSlideSetting.FixFirstPage) {
7707
- if (targetRect2[pos_key] + targetRect2[size_key] - 1 < vInfo.range) {
8053
+ if (targetRect[pos_key] + targetRect[size_key] - 1 < vInfo.range) {
7708
8054
  new_visible_start = 0;
7709
8055
  needCalculate = false;
7710
8056
  }
7711
8057
  }
7712
8058
  if (needCalculate) {
7713
- const itemStart = targetRect2[pos_key];
7714
- const itemEnd = targetRect2[pos_key] + targetRect2[size_key] - 1;
7715
- const itemMainSize = targetRect2[size_key];
8059
+ const itemStart = targetRect[pos_key];
8060
+ const itemEnd = targetRect[pos_key] + targetRect[size_key] - 1;
8061
+ const itemMainSize = targetRect[size_key];
7716
8062
  if (preRect) {
7717
8063
  const rect0Start = vInfo.start;
7718
8064
  const rect0End = vInfo.start + vInfo.range * innerSlideSetting.StartPercent;
@@ -7721,7 +8067,10 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7721
8067
  const rect1End = vInfo.start + vInfo.range - 1;
7722
8068
  const rect1Range = rect1End - rect1Start + 1;
7723
8069
  let target0 = Math.min(preRect[pos_key], rect0End);
7724
- let target1 = Math.max(preRect[pos_key] + preRect[size_key] - 1, rect1Start);
8070
+ let target1 = Math.max(
8071
+ preRect[pos_key] + preRect[size_key] - 1,
8072
+ rect1Start
8073
+ );
7725
8074
  let rect0Result = void 0;
7726
8075
  let rect1Result = void 0;
7727
8076
  if (itemStart < rect0End) {
@@ -7751,7 +8100,9 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7751
8100
  const headSafeArea = innerSlideSetting.HeadSafeArea * vInfo.range;
7752
8101
  const tailSafeArea = innerSlideSetting.TailSafeArea * vInfo.range;
7753
8102
  if (itemMainSize > vInfo.range - headSafeArea - tailSafeArea) {
7754
- new_visible_start = Math.round(itemStart - (vInfo.range - itemMainSize) / 2);
8103
+ new_visible_start = Math.round(
8104
+ itemStart - (vInfo.range - itemMainSize) / 2
8105
+ );
7755
8106
  } else {
7756
8107
  if (itemStart < new_visible_start + headSafeArea) {
7757
8108
  new_visible_start = itemStart - headSafeArea;
@@ -7767,7 +8118,12 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7767
8118
  innerSlideSetting.Type
7768
8119
  );
7769
8120
  }
7770
- new_visible_start = normalizeVisibleStart(new_visible_start, targetRect2, templateInfo?.index, vInfo);
8121
+ new_visible_start = normalizeVisibleStart(
8122
+ new_visible_start,
8123
+ targetRect,
8124
+ templateInfo?.index,
8125
+ vInfo
8126
+ );
7771
8127
  return Math.round(new_visible_start);
7772
8128
  };
7773
8129
  const _onFocusableItemEdge = (edge_info) => {
@@ -7800,14 +8156,14 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7800
8156
  console.log(`MetroWidget: ${props.name} get focus while data is empty.`);
7801
8157
  return;
7802
8158
  }
7803
- let focus_id = typeof enterFocusId !== "undefined" && enterFocusId >= 0 && enterFocusId < metroTemplate.size ? enterFocusId : focusId;
8159
+ let focus_id = index2Id(gazeIndex);
8160
+ focus_id = typeof enterFocusId !== "undefined" && enterFocusId >= 0 && enterFocusId < metroTemplate.size ? enterFocusId : focus_id;
7804
8161
  focus_id = _ifValidEnterRect(enterFocusRect) ? _calculateNearestItemByRect(pageUpdater.getRange(), enterFocusRect) : focus_id;
7805
8162
  preEdgeRect = enterFocusRect;
7806
8163
  _changeFocusId(focus_id, false);
7807
8164
  enterFocusId = -1;
7808
8165
  enterFocusRect = null;
7809
8166
  firstOnItemFocusCalled = onItemFocus(getItemById(focusId), preEdgeRect);
7810
- ;
7811
8167
  props.onFocus?.();
7812
8168
  };
7813
8169
  const focusBlockOnBlur = () => {
@@ -7842,16 +8198,20 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7842
8198
  }
7843
8199
  };
7844
8200
  const _getVisibleFocusableItem = () => {
7845
- const focusItem = getItemById(focusId);
8201
+ let item = getItemByIndex(gazeIndex);
8202
+ if (rectVisibleState(item.templateInfo) == 2) {
8203
+ return item;
8204
+ }
8205
+ item = getItemById(focusId);
7846
8206
  if (rectVisibleState(focusItem.templateInfo) == 2) {
7847
8207
  return focusItem;
7848
- } else {
7849
- for (let item of renderData.value) {
7850
- if (item.templateInfo.focusable && rectVisibleState(item.templateInfo) == 2) {
7851
- return item;
7852
- }
8208
+ }
8209
+ for (let item2 of renderData.value) {
8210
+ if (item2.templateInfo.focusable && rectVisibleState(item2.templateInfo) == 2) {
8211
+ return item2;
7853
8212
  }
7854
8213
  }
8214
+ return null;
7855
8215
  };
7856
8216
  const _onScroll = () => {
7857
8217
  if (props.onScroll) {
@@ -7984,12 +8344,19 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
7984
8344
  };
7985
8345
  let passDownTouchInfo = nexusCustomData;
7986
8346
  actorController.run((cmds) => [
7987
- cmds.condition(TouchDownConditionGroup, false).offsetPosition(offsetThreshold.left, offsetThreshold.top, offsetThreshold.right, offsetThreshold.bottom).then([
8347
+ cmds.condition(TouchDownConditionGroup, false).offsetPosition(
8348
+ offsetThreshold.left,
8349
+ offsetThreshold.top,
8350
+ offsetThreshold.right,
8351
+ offsetThreshold.bottom
8352
+ ).then([
7988
8353
  cmds.state().touchLockSwitch(true, vertical ? 1 : 2, unlockThreshold)
7989
8354
  ]),
7990
- cmds.condition(TouchDownConditionGroup, false).startMove(true, true).then([SliderEditFuncReOrderWrap((d) => {
7991
- onDragStart(d, null, passDownTouchInfo);
7992
- })])
8355
+ cmds.condition(TouchDownConditionGroup, false).startMove(true, true).then([
8356
+ SliderEditFuncReOrderWrap((d) => {
8357
+ onDragStart(d, null, passDownTouchInfo);
8358
+ })
8359
+ ])
7993
8360
  ]);
7994
8361
  templateItemAdder.tryAddItemByPosition(visibleInfo.end + visibleInfo.range);
7995
8362
  const updater = pageUpdater.update(
@@ -8007,14 +8374,18 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
8007
8374
  let anchorPos = anchorSpacing;
8008
8375
  while (anchorPos < anchorArea) {
8009
8376
  anchorPosList.push(-visibleInfo.start + anchorPos);
8010
- anchorPosList.push(-visibleInfo.start - visibleInfo.range - anchorPos + 1);
8377
+ anchorPosList.push(
8378
+ -visibleInfo.start - visibleInfo.range - anchorPos + 1
8379
+ );
8011
8380
  anchorPos += anchorSpacing;
8012
8381
  }
8013
8382
  actorController.run((cmds) => {
8014
8383
  const reachConditionList = anchorPosList.map((pos) => {
8015
- return cmds.condition(reachAnchorGroup).reachPosition(pos, void 0).then([SliderEditFuncReOrderWrap((data2) => {
8016
- updateRenderItems(true, true);
8017
- })]);
8384
+ return cmds.condition(reachAnchorGroup).reachPosition(pos, void 0).then([
8385
+ SliderEditFuncReOrderWrap((data2) => {
8386
+ updateRenderItems(true, true);
8387
+ })
8388
+ ]);
8018
8389
  });
8019
8390
  reachConditionList.unshift(
8020
8391
  cmds.state().removeConditionByGroup(reachAnchorGroup)
@@ -8105,7 +8476,9 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
8105
8476
  return wall;
8106
8477
  };
8107
8478
  const updateRenderItems = (applyTmp, expand) => {
8108
- templateItemAdder.tryAddItemByPosition(visibleInfo.start + visibleInfo.range);
8479
+ templateItemAdder.tryAddItemByPosition(
8480
+ visibleInfo.start + visibleInfo.range
8481
+ );
8109
8482
  const updater = pageUpdater.update(
8110
8483
  metroTemplate,
8111
8484
  visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
@@ -8117,6 +8490,8 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
8117
8490
  applyTmp ? updater.applyTmp() : updater.apply();
8118
8491
  };
8119
8492
  const updateTouchBoxCondition = () => {
8493
+ if (mode.getMode() != TOUCH_MODE)
8494
+ return;
8120
8495
  if (actorController != null) {
8121
8496
  const walls = getTouchWall();
8122
8497
  actorController.run((cmds) => [
@@ -8195,7 +8570,14 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
8195
8570
  ]);
8196
8571
  }
8197
8572
  function safeProvideData() {
8198
- return props.provideData() ?? [];
8573
+ const d = props.provideData();
8574
+ if (d instanceof Array) {
8575
+ return d;
8576
+ }
8577
+ console.warn(
8578
+ `MetroWidget provideData must return an array. name:${props.name} provideData:${d}`
8579
+ );
8580
+ return [];
8199
8581
  }
8200
8582
  pageUpdater = new PageUpdater(_updatePage, props.name);
8201
8583
  visibleInfo.range = vertical ? widgetRectInfo.contentHeight : widgetRectInfo.contentWidth;
@@ -8228,7 +8610,12 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
8228
8610
  if (item) {
8229
8611
  init_focus_id = props.initFocusId;
8230
8612
  if (item.itemConfig.itemSlide == METRO_WIDGET.ITEM_SLIDE.ACT_ITEM_FOCUS) {
8231
- initVisibleStart = _calculateVisibleStart(item.templateInfo, 0, item.templateInfo, visibleInfo);
8613
+ initVisibleStart = _calculateVisibleStart(
8614
+ item.templateInfo,
8615
+ 0,
8616
+ item.templateInfo,
8617
+ visibleInfo
8618
+ );
8232
8619
  }
8233
8620
  }
8234
8621
  }
@@ -8307,7 +8694,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
8307
8694
  /*
8308
8695
  + @file {@link file://./../../../../utils/JsViewEngineWidget/MetroWidget/SlotComponent.vue}
8309
8696
  */
8310
- const _sfc_main$T = {
8697
+ const _sfc_main$X = {
8311
8698
  __name: "SlotComponent",
8312
8699
  setup(__props) {
8313
8700
  onBeforeUpdate(() => {
@@ -8348,7 +8735,7 @@ const _sfc_main$T = {
8348
8735
  * onAnimationEnd { Function } (选填)animation动画结束的回调
8349
8736
  * imageBlendType {String} (选填) alpha合并模式,默认为普通合成,可设置"alphaOverride", 用于Video挖洞操作
8350
8737
  */
8351
- const _sfc_main$S = {
8738
+ const _sfc_main$W = {
8352
8739
  __name: "JsvNinePatch",
8353
8740
  props: {
8354
8741
  style: {
@@ -8441,7 +8828,7 @@ const _sfc_main$S = {
8441
8828
  /*
8442
8829
  + @file {@link file://./../../../../utils/JsViewEngineWidget/MetroWidget/DebugFrame.vue}
8443
8830
  */
8444
- const _sfc_main$R = {
8831
+ const _sfc_main$V = {
8445
8832
  __name: "DebugFrame",
8446
8833
  props: {
8447
8834
  width: Number,
@@ -8451,7 +8838,7 @@ const _sfc_main$R = {
8451
8838
  setup(__props) {
8452
8839
  const props = __props;
8453
8840
  return (_ctx, _cache) => {
8454
- return openBlock(), createBlock(_sfc_main$S, {
8841
+ return openBlock(), createBlock(_sfc_main$W, {
8455
8842
  style: normalizeStyle({
8456
8843
  width: __props.width,
8457
8844
  height: __props.height
@@ -8523,6 +8910,9 @@ const _sfc_main$R = {
8523
8910
  focusBackgroundColor: 获焦时的颜色
8524
8911
  borderRadius: 占位符圆角设置
8525
8912
  gap: 占位符之间的gap
8913
+ logoUrl: 占位符logo的url
8914
+ logoWidth: 占位符logo的宽度
8915
+ logoHeight: 占位符logo的高度
8526
8916
  }
8527
8917
  * sendFocusRectEvent {boolean} item获焦时在焦点树上冒泡一个事件, MetroWidget接收到事件时会触发滚动操作, 一般用于嵌套
8528
8918
  时的滚动
@@ -8550,6 +8940,8 @@ const _sfc_main$R = {
8550
8940
  permanent {boolean}: 出去与是否保留
8551
8941
  enableTap {boolean}: 是否接受触控tap
8552
8942
  showSkeleton {boolean}: 打断描画时, 是否显示骨架图, 默认为true
8943
+ enableLongPress {boolean}: item是否支持长按, 默认值为props.enableLongPress
8944
+ placeHolderLayout{{left: number, top: number, width: number, height: number}}: 占位符的布局信息
8553
8945
  }
8554
8946
  *
8555
8947
  * onFocus {function} 控件获取焦点的回调
@@ -8565,6 +8957,7 @@ const _sfc_main$R = {
8565
8957
  totalSize: 所有item的总长
8566
8958
  * onFocusRectChange {() => void} 焦点区域变化的回调
8567
8959
  * onAllItemResizeDone {() => void} 所有item resize完成的回调
8960
+ * onFocusChange {(id: number) => void} 焦点变化的回调
8568
8961
  * loadAll {boolean} 加载不显示的view,触控场景使用
8569
8962
  * flingPageWidth {}
8570
8963
  * flingPageEdge {}
@@ -8749,7 +9142,7 @@ const _sfc_main$R = {
8749
9142
  * 注意点:
8750
9143
  * 1. MetroWidget中存在一些处理依赖vue的callback执行顺序, 因此涉及更改MetroWidget状态的处理不要在watchPostEffect中调用
8751
9144
  */
8752
- const _sfc_main$Q = {
9145
+ const _sfc_main$U = {
8753
9146
  __name: "MetroWidget",
8754
9147
  props: {
8755
9148
  padding: {
@@ -8911,8 +9304,17 @@ const _sfc_main$Q = {
8911
9304
  height: 0
8912
9305
  });
8913
9306
  const normalizedPlaceHolder = computed(() => {
9307
+ let logoInfo = null;
9308
+ if (typeof props.placeHolderSetting.logoUrl == "string" && typeof props.placeHolderSetting.logoWidth == "number" && typeof props.placeHolderSetting.logoHeight == "number") {
9309
+ logoInfo = {
9310
+ url: props.placeHolderSetting.logoUrl,
9311
+ width: props.placeHolderSetting.logoWidth,
9312
+ height: props.placeHolderSetting.logoHeight
9313
+ };
9314
+ }
8914
9315
  return {
8915
9316
  gap: props.placeHolderSetting.gap ?? 0,
9317
+ logoInfo,
8916
9318
  borderRadius: props.placeHolderSetting.borderRadius ?? 0,
8917
9319
  backgroundColor: props.placeHolderSetting.backgroundColor,
8918
9320
  focusBackgroundColor: props.placeHolderSetting.focusBackgroundColor ?? props.placeHolderSetting.backgroundColor
@@ -9042,7 +9444,7 @@ const _sfc_main$Q = {
9042
9444
  }),
9043
9445
  onClick: item.onTap.value
9044
9446
  }, [
9045
- __props.enableDebug ? (openBlock(), createBlock(_sfc_main$R, {
9447
+ __props.enableDebug ? (openBlock(), createBlock(_sfc_main$V, {
9046
9448
  key: 0,
9047
9449
  width: item.templateInfo.width,
9048
9450
  height: item.templateInfo.height,
@@ -9054,7 +9456,7 @@ const _sfc_main$Q = {
9054
9456
  ref: item.slotRef,
9055
9457
  id: `${__props.name}_${index}`
9056
9458
  }, [
9057
- createVNode(_sfc_main$T, { key: "__QcodeJsviewFreezeComponent" }, {
9459
+ createVNode(_sfc_main$X, { key: "__QcodeJsviewFreezeComponent" }, {
9058
9460
  default: withCtx(() => [
9059
9461
  renderSlot(_ctx.$slots, "renderItem", {
9060
9462
  data: item.customerData,
@@ -9070,12 +9472,25 @@ const _sfc_main$Q = {
9070
9472
  __props.enableItemRenderBreak && __props.placeHolderSetting && !item.mounted.value && item.itemConfig.showSkeleton ? (openBlock(), createElementBlock("div", {
9071
9473
  key: 2,
9072
9474
  style: normalizeStyle({
9073
- width: item.renderStyle.width - unref(normalizedPlaceHolder).gap,
9074
- height: item.renderStyle.height - unref(normalizedPlaceHolder).gap,
9475
+ left: item.placeHolderLayout.left,
9476
+ top: item.placeHolderLayout.top,
9477
+ width: item.placeHolderLayout.width,
9478
+ height: item.placeHolderLayout.height,
9075
9479
  backgroundColor: unref(currentFocusIndex) == item.index && unref(modeForExport) == 2 ? unref(normalizedPlaceHolder).focusBackgroundColor : unref(normalizedPlaceHolder).backgroundColor,
9076
9480
  borderRadius: unref(normalizedPlaceHolder).borderRadius
9077
9481
  })
9078
- }, null, 4)) : createCommentVNode("", true)
9482
+ }, [
9483
+ unref(normalizedPlaceHolder).logoInfo ? (openBlock(), createElementBlock("img", {
9484
+ key: 0,
9485
+ src: `url(${unref(normalizedPlaceHolder).logoInfo.url})`,
9486
+ style: normalizeStyle({
9487
+ left: (item.placeHolderLayout.width - unref(normalizedPlaceHolder).logoInfo.width) / 2,
9488
+ top: (item.placeHolderLayout.height - unref(normalizedPlaceHolder).logoInfo.height) / 2,
9489
+ width: unref(normalizedPlaceHolder).logoInfo.width,
9490
+ height: unref(normalizedPlaceHolder).logoInfo.height
9491
+ })
9492
+ }, null, 12, ["src"])) : createCommentVNode("", true)
9493
+ ], 4)) : createCommentVNode("", true)
9079
9494
  ], 12, ["onClick"]);
9080
9495
  }), 128))
9081
9496
  ]),
@@ -9099,7 +9514,7 @@ const _sfc_main$Q = {
9099
9514
  /*
9100
9515
  * @file 只显示单列/行的MetroWidget
9101
9516
  */
9102
- const _sfc_main$P = {
9517
+ const _sfc_main$T = {
9103
9518
  __name: "ListWidget",
9104
9519
  props: {
9105
9520
  padding: {
@@ -9391,7 +9806,7 @@ const _sfc_main$P = {
9391
9806
  }),
9392
9807
  onClick: item.onTap.value
9393
9808
  }, [
9394
- __props.enableDebug ? (openBlock(), createBlock(_sfc_main$R, {
9809
+ __props.enableDebug ? (openBlock(), createBlock(_sfc_main$V, {
9395
9810
  key: 0,
9396
9811
  width: item.templateInfo.width,
9397
9812
  height: item.templateInfo.height,
@@ -9480,7 +9895,8 @@ class JsvFocusHubApi {
9480
9895
  * getCurrentFocus
9481
9896
  *
9482
9897
  * 获取当前焦点的的 focusName 信息,用于后续的进行的 setFocus 操作
9483
- * (注意, 不带NameSpace)
9898
+ * (注意1: 获取的NameSpace不带NameSpace)
9899
+ * (注意2: 如果当前状态所设焦点还没Mounted时,也会返回null)
9484
9900
  *
9485
9901
  * @return {string} 当前焦点的focusName
9486
9902
  */
@@ -9548,6 +9964,29 @@ class JsvFocusHubApi {
9548
9964
  getCurrentFocusStack() {
9549
9965
  return this._FocusHub.getCurrentFocusStack();
9550
9966
  }
9967
+ /**
9968
+ * addFocusChangeListener
9969
+ *
9970
+ * 添加焦点变化监听器, 主要用来追踪焦点name的变化,例如路由切换的场景
9971
+ *
9972
+ * @param {Function} listener 焦点变化监听器, 参数为 {focusName: string}
9973
+ * @param {boolean} onRequest 监听时机,true: 在focus请求时即回调,无论节点是否存在;
9974
+ * false: 在节点真实存在后,确认进行focus时才回调(在正准备Focus()调用前)
9975
+ */
9976
+ addFocusChangeListener(listener, onRequest = false) {
9977
+ this._FocusHub.addFocusChangeListener(listener, onRequest);
9978
+ }
9979
+ /**
9980
+ * removeFocusChangeListener
9981
+ *
9982
+ * 删除焦点变化监听器
9983
+ *
9984
+ * @param {Function} listener 由addFocusChangeListener添加的变化监听器
9985
+ * @param {boolean} onRequest 和addFocusChangeListener时设置的参数要完全对应
9986
+ */
9987
+ removeFocusChangeListener(listener, onRequest = false) {
9988
+ this._FocusHub.delFocusChangeListener(listener, onRequest);
9989
+ }
9551
9990
  }
9552
9991
  const ROOT_HUB_PROVIDE_NAME = "__jsvFocusRootHub__";
9553
9992
  const HUB_NS_PROVIDE_NAME = "__jsvFocusNameSpace__";
@@ -9584,7 +10023,7 @@ const HUB_NS_PROVIDE_NAME = "__jsvFocusNameSpace__";
9584
10023
  @description 赋予焦点
9585
10024
  @params {boolean} passToChild 焦点由子往父时是否保持子的焦点
9586
10025
  */
9587
- const _sfc_main$O = {
10026
+ const _sfc_main$S = {
9588
10027
  __name: "JsvFocusBlock",
9589
10028
  props: {
9590
10029
  style: Object,
@@ -9812,7 +10251,7 @@ class JsvFocusManager {
9812
10251
  }
9813
10252
  const doAppMount = this.$_hookMount(app, options[0]);
9814
10253
  app.mount = doAppMount;
9815
- app.component("JsvFocusBlock", _sfc_main$O);
10254
+ app.component("JsvFocusBlock", _sfc_main$S);
9816
10255
  app.config.globalProperties.$jsvFocusManager = this;
9817
10256
  app.provide(HUB_NS_PROVIDE_NAME, null);
9818
10257
  app.provide(ROOT_HUB_PROVIDE_NAME, new JsvFocusHubApi(this.$_topFDiv.getHub()));
@@ -10690,7 +11129,7 @@ class AudioProxy {
10690
11129
  /*
10691
11130
  + @file {@link file://./../../../../utils/JsViewPlugin/JsvAudio/JsvAudio.vue}
10692
11131
  */
10693
- const _sfc_main$N = {
11132
+ const _sfc_main$R = {
10694
11133
  __name: "JsvAudio",
10695
11134
  props: {
10696
11135
  /**
@@ -10833,7 +11272,7 @@ const _sfc_main$N = {
10833
11272
  /*
10834
11273
  + @file {@link file://./../../../../utils/JsViewPlugin/JsvAudio/JsvAudioProxy.vue}
10835
11274
  */
10836
- const _sfc_main$M = {
11275
+ const _sfc_main$Q = {
10837
11276
  __name: "JsvAudioProxy",
10838
11277
  setup(__props) {
10839
11278
  const AsyncComp = defineAsyncComponent(() => {
@@ -10843,7 +11282,7 @@ const _sfc_main$M = {
10843
11282
  const BrowserAudio = import('./browser/BrowserAudio.vue.mjs');
10844
11283
  resolve(BrowserAudio);
10845
11284
  } else {
10846
- resolve(_sfc_main$N);
11285
+ resolve(_sfc_main$R);
10847
11286
  }
10848
11287
  });
10849
11288
  });
@@ -11116,7 +11555,7 @@ const cssColor2Android = (cssColor) => {
11116
11555
  * [注意事项]
11117
11556
  * 1. 盒子端的字符串是直接作为数学公式解析的, 所以需要将\n替换为\\, 需要前端自己处理, 这里提供了一个辅助方法processLatexStr来处理简单的情况
11118
11557
  */
11119
- const _sfc_main$L = {
11558
+ const _sfc_main$P = {
11120
11559
  __name: "JsvLatex",
11121
11560
  props: {
11122
11561
  latexStr: {
@@ -11240,7 +11679,7 @@ const _sfc_main$L = {
11240
11679
  /*
11241
11680
  + @file {@link file://./../../../../utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue}
11242
11681
  */
11243
- const _sfc_main$K = {
11682
+ const _sfc_main$O = {
11244
11683
  __name: "JsvLatexProxy",
11245
11684
  setup(__props) {
11246
11685
  const AsyncComp = defineAsyncComponent(() => {
@@ -11250,7 +11689,7 @@ const _sfc_main$K = {
11250
11689
  const BrowserJsvLatex = import('./browser/BrowserJsvLatex.vue.mjs');
11251
11690
  resolve(BrowserJsvLatex);
11252
11691
  } else {
11253
- resolve(_sfc_main$L);
11692
+ resolve(_sfc_main$P);
11254
11693
  }
11255
11694
  });
11256
11695
  });
@@ -11856,7 +12295,7 @@ class JsvActorMoveControl extends ActorControlBase {
11856
12295
  * 功能: 将由moveToX, moveToY, scrollMoveAlongX, scrollMoveAlongY 发起的直线运动进行均匀变速
11857
12296
 
11858
12297
  */
11859
- const _sfc_main$J = {
12298
+ const _sfc_main$N = {
11860
12299
  __name: "JsvActorMove",
11861
12300
  props: {
11862
12301
  control: {
@@ -11911,7 +12350,7 @@ const _sfc_main$J = {
11911
12350
  * expose说明:
11912
12351
  * control: Object 控制器句柄,具体参考 ActorControl
11913
12352
  */
11914
- const _sfc_main$I = {
12353
+ const _sfc_main$M = {
11915
12354
  __name: "FreeMoveActor",
11916
12355
  props: {
11917
12356
  // div的style设置,
@@ -12019,7 +12458,7 @@ const KeepFlags = {
12019
12458
  * 意味着此FreeMoveAnimation碰撞任何一个EnvBlocker的GID=2的边都会触发回调
12020
12459
  *
12021
12460
  */
12022
- const _sfc_main$H = {
12461
+ const _sfc_main$L = {
12023
12462
  __name: "JsvEnvBlocker",
12024
12463
  props: {
12025
12464
  // (支持reactive)位置信息
@@ -12255,7 +12694,7 @@ let FreeMoveFunc = {
12255
12694
  * getHeight(): 当askSize或者onSize生效时,获取元素的高度
12256
12695
  *
12257
12696
  */
12258
- const _sfc_main$G = {
12697
+ const _sfc_main$K = {
12259
12698
  __name: "JsvFlexDiv",
12260
12699
  props: {
12261
12700
  style: Object,
@@ -12359,7 +12798,7 @@ const _sfc_main$G = {
12359
12798
  * getHeight(): 当askSize或者onSize生效时,获取元素的高度
12360
12799
  *
12361
12800
  */
12362
- const _sfc_main$F = {
12801
+ const _sfc_main$J = {
12363
12802
  __name: "JsvScreenFlex",
12364
12803
  props: {
12365
12804
  style: Object,
@@ -12442,7 +12881,7 @@ const _sfc_main$F = {
12442
12881
  });
12443
12882
  return (_ctx, _cache) => {
12444
12883
  return openBlock(), createElementBlock("div", { "data-jsv-vw-innerview": unref(vViewId) }, [
12445
- createVNode(_sfc_main$G, mergeProps({
12884
+ createVNode(_sfc_main$K, mergeProps({
12446
12885
  ref_key: "rStretchedFlex",
12447
12886
  ref: rStretchedFlex
12448
12887
  }, { ...unref(rConfig) }), {
@@ -12476,7 +12915,7 @@ const _sfc_main$F = {
12476
12915
  * getHeight(): onSize生效时,获取元素的高度
12477
12916
  *
12478
12917
  */
12479
- const _sfc_main$E = {
12918
+ const _sfc_main$I = {
12480
12919
  __name: "JsvFullScrAdjust",
12481
12920
  props: {
12482
12921
  childWidth: {
@@ -12571,7 +13010,7 @@ const _sfc_main$E = {
12571
13010
  }
12572
13011
  });
12573
13012
  return (_ctx, _cache) => {
12574
- return openBlock(), createBlock(_sfc_main$F, {
13013
+ return openBlock(), createBlock(_sfc_main$J, {
12575
13014
  style: {
12576
13015
  flexDirection: "row",
12577
13016
  justifyContent: "center",
@@ -12588,7 +13027,9 @@ const _sfc_main$E = {
12588
13027
  transform: unref(rScaleSet)
12589
13028
  })
12590
13029
  }, [
12591
- renderSlot(_ctx.$slots, "default")
13030
+ createElementVNode("div", { "data-jsv-vw-as-bound-anchor": "true" }, [
13031
+ renderSlot(_ctx.$slots, "default")
13032
+ ])
12592
13033
  ], 4)
12593
13034
  ]),
12594
13035
  _: 3
@@ -12626,7 +13067,7 @@ const LoopType$1 = {
12626
13067
  LOOP_PART: 3,
12627
13068
  LOOP_SINGLE: 4
12628
13069
  };
12629
- const _sfc_main$D = {
13070
+ const _sfc_main$H = {
12630
13071
  props: {
12631
13072
  src: String,
12632
13073
  style: Object,
@@ -12727,7 +13168,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
12727
13168
  style: normalizeStyle($props.style)
12728
13169
  }, null, 12, ["src"]);
12729
13170
  }
12730
- const JsvApic = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$7]]);
13171
+ const JsvApic = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$7]]);
12731
13172
 
12732
13173
  /*
12733
13174
  + @file {@link file://./../../../../../utils/JsViewVueWidget/JsvApic/JsvApic/index.js}
@@ -12768,7 +13209,7 @@ const LoopType = {
12768
13209
  LOOP_PART: 3,
12769
13210
  LOOP_SINGLE: 4
12770
13211
  };
12771
- const _sfc_main$C = {
13212
+ const _sfc_main$G = {
12772
13213
  props: {
12773
13214
  src: String,
12774
13215
  style: Object,
@@ -12866,7 +13307,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
12866
13307
  style: normalizeStyle($props.style)
12867
13308
  }, null, 12, ["src"]);
12868
13309
  }
12869
- const JsvApic2 = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$6]]);
13310
+ const JsvApic2 = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$6]]);
12870
13311
 
12871
13312
  /*
12872
13313
  + @file {@link file://./../../../../../utils/JsViewVueWidget/JsvApic/JsvApic2/index.js}
@@ -12877,7 +13318,7 @@ const index = JsvApic2;
12877
13318
  /*
12878
13319
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvInput/Cursor.vue}
12879
13320
  */
12880
- const _sfc_main$B = {
13321
+ const _sfc_main$F = {
12881
13322
  __name: "Cursor",
12882
13323
  props: {
12883
13324
  left: {
@@ -13443,9 +13884,9 @@ class EditViewOperator {
13443
13884
  }
13444
13885
 
13445
13886
  /*
13446
- + @file {@link file://./../../../../utils/JsViewVueWidget/JsvInput/JsvInput.vue?vue&type=style&index=0&scoped=3de0c16d&lang.css}
13887
+ + @file {@link file://./../../../../utils/JsViewVueWidget/JsvInput/JsvInput.vue?vue&type=style&index=0&scoped=8d88074e&lang.css}
13447
13888
  */
13448
- const JsvInput_vue_vue_type_style_index_0_scoped_3de0c16d_lang = "";
13889
+ const JsvInput_vue_vue_type_style_index_0_scoped_8d88074e_lang = "";
13449
13890
 
13450
13891
  /*
13451
13892
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvInput/JsvInput.vue}
@@ -13499,7 +13940,7 @@ const JsvInput_vue_vue_type_style_index_0_scoped_3de0c16d_lang = "";
13499
13940
  * clear
13500
13941
  * @description 清空文字
13501
13942
  */
13502
- const _sfc_main$A = {
13943
+ const _sfc_main$E = {
13503
13944
  __name: "JsvInput",
13504
13945
  props: {
13505
13946
  name: {
@@ -13597,6 +14038,7 @@ const _sfc_main$A = {
13597
14038
  );
13598
14039
  rInputFinalText.value = dsp_text;
13599
14040
  rInputFinalTextLenth.value = dsp_text.length;
14041
+ rProps.onTextChange?.(dsp_text);
13600
14042
  }
13601
14043
  function _OnCursorPositionChanged(text_left, cursor_left) {
13602
14044
  rTextPosLeft.value = text_left;
@@ -13760,7 +14202,7 @@ const _sfc_main$A = {
13760
14202
  })
13761
14203
  }, toDisplayString(rProps.placeholder), 5)) : createCommentVNode("", true)
13762
14204
  ], 4),
13763
- rProps.cursorShow ? (openBlock(), createBlock(_sfc_main$B, {
14205
+ rProps.cursorShow ? (openBlock(), createBlock(_sfc_main$F, {
13764
14206
  key: 0,
13765
14207
  ref_key: "rCursorRef",
13766
14208
  ref: rCursorRef,
@@ -13782,9 +14224,9 @@ const _sfc_main$A = {
13782
14224
  };
13783
14225
  }
13784
14226
  };
13785
- const styleSheetsContent$2 = { "3de0c16d": { ".testColor": '{"backgroundColor":"#5d5c76"}' } };
14227
+ const styleSheetsContent$2 = { "8d88074e": { ".testColor": '{"backgroundColor":"#5d5c76"}' } };
13786
14228
  window.JsvCode.Dom.DeclareStyleSheets(styleSheetsContent$2);
13787
- const JsvInput = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-3de0c16d"]]);
14229
+ const JsvInput = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-8d88074e"]]);
13788
14230
 
13789
14231
  /*
13790
14232
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvInput/index.js}
@@ -13852,7 +14294,7 @@ const buildDownloadInfo = (url, net_setting = null, get_image_size) => {
13852
14294
  // 用于格式校验
13853
14295
  };
13854
14296
  };
13855
- const _sfc_main$z = {
14297
+ const _sfc_main$D = {
13856
14298
  __name: "JsvPreload",
13857
14299
  props: {
13858
14300
  preloadList: Object,
@@ -13964,13 +14406,11 @@ const _sfc_main$z = {
13964
14406
  return;
13965
14407
  }
13966
14408
  const callback_token = texture.RegisterLoadImageCallback(null, (params) => {
13967
- console.log(`preload succeed ${image_url}`, params);
13968
14409
  preloadStateList[index] = true;
13969
14410
  preloadResultMap[item.url] = {
13970
14411
  width: params.width,
13971
14412
  height: params.height
13972
14413
  };
13973
- console.log(`preload succeed ${item.url}, params:${params}`);
13974
14414
  _checkPreload();
13975
14415
  });
13976
14416
  texture.EnableBackgroundLoad();
@@ -14133,7 +14573,7 @@ const _sfc_main$z = {
14133
14573
  * height {int} logo的高度
14134
14574
  * }
14135
14575
  */
14136
- const _sfc_main$y = {
14576
+ const _sfc_main$C = {
14137
14577
  props: {
14138
14578
  value: String,
14139
14579
  size: Number,
@@ -14266,7 +14706,7 @@ const _sfc_main$y = {
14266
14706
  function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
14267
14707
  return openBlock(), createElementBlock("div", { "data-jsv-vw-innerview": $data.innerViewId }, null, 8, ["data-jsv-vw-innerview"]);
14268
14708
  }
14269
- const JsvQrcode = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$5]]);
14709
+ const JsvQrcode = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$5]]);
14270
14710
 
14271
14711
  /*
14272
14712
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvSpray/JsvSpray.vue}
@@ -14313,7 +14753,7 @@ const JsvQrcode = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_rend
14313
14753
  * @descripe 停止喷射
14314
14754
  * @param immediate { boolean } 是否立即消除粒子, false时会停止喷射,等待已有粒子消失
14315
14755
  */
14316
- const _sfc_main$x = {
14756
+ const _sfc_main$B = {
14317
14757
  __name: "JsvSpray",
14318
14758
  props: {
14319
14759
  pointRes: {
@@ -14710,7 +15150,7 @@ const JsvSpriteAnim_vue_vue_type_style_index_0_scoped_a0fb356d_lang = "";
14710
15150
  * 参数表:
14711
15151
  * index : 目标帧index/"start"/"end"
14712
15152
  */
14713
- const _sfc_main$w = {
15153
+ const _sfc_main$A = {
14714
15154
  __name: "JsvSpriteAnim",
14715
15155
  props: {
14716
15156
  spriteInfo: Object,
@@ -15042,7 +15482,7 @@ const _sfc_main$w = {
15042
15482
  };
15043
15483
  const styleSheetsContent$1 = { "0": { "sprite-tag-a0fb356d": "@keyframes sprite-tag-a0fb356d {}" } };
15044
15484
  window.JsvCode.Dom.DeclareStyleSheets(styleSheetsContent$1);
15045
- const JsvSpriteAnim = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-a0fb356d"]]);
15485
+ const JsvSpriteAnim = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-a0fb356d"]]);
15046
15486
 
15047
15487
  /*
15048
15488
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue}
@@ -15058,7 +15498,7 @@ const JsvSpriteAnim = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "d
15058
15498
  * onConfigReady: config文件下载完成后的回调(data, PromiseResolve)
15059
15499
  * noNeedResource: 是否需要等待imageUrl和json记载完毕后再激活子内容, 默认为false, 可设置为true
15060
15500
  */
15061
- const _sfc_main$v = {
15501
+ const _sfc_main$z = {
15062
15502
  __name: "JsvSpriteLoader",
15063
15503
  props: {
15064
15504
  imageUrl: String,
@@ -15135,7 +15575,7 @@ const _sfc_main$v = {
15135
15575
  id: "sprite-loader",
15136
15576
  key: unref(resetId)
15137
15577
  }, [
15138
- createVNode(unref(_sfc_main$z), {
15578
+ createVNode(unref(_sfc_main$D), {
15139
15579
  preloadList: unref(preloadInfo),
15140
15580
  onPreloadDone: unref(_onPreloadDone)
15141
15581
  }, null, 8, ["preloadList", "onPreloadDone"]),
@@ -15261,7 +15701,7 @@ let JsvSpriteTools = {
15261
15701
  * callback {function} (必须, 可响应式)可视变化时的回调处理, 参数
15262
15702
  * (old_horizantal_visible, new_horizantal_visible, old_vertical_visible, new_vertical_visible)
15263
15703
  */
15264
- const _sfc_main$u = {
15704
+ const _sfc_main$y = {
15265
15705
  __name: "JsvVisibleSensor",
15266
15706
  props: {
15267
15707
  // (支持reactive)可视区域设定
@@ -15384,7 +15824,7 @@ const _sfc_main$u = {
15384
15824
 
15385
15825
  var JsvVisibleSensor$1 = /*#__PURE__*/Object.freeze({
15386
15826
  __proto__: null,
15387
- default: _sfc_main$u
15827
+ default: _sfc_main$y
15388
15828
  });
15389
15829
 
15390
15830
  /*
@@ -15456,8 +15896,8 @@ const keyCode2EdgeDirection = (keyCode) => {
15456
15896
  return null;
15457
15897
  }
15458
15898
  };
15459
- const _sfc_main$t = {
15460
- components: { JsvActorMove: _sfc_main$J, JsvVisibleSensor },
15899
+ const _sfc_main$x = {
15900
+ components: { JsvActorMove: _sfc_main$N, JsvVisibleSensor },
15461
15901
  props: {
15462
15902
  showIndicator: {
15463
15903
  type: Boolean,
@@ -15766,6 +16206,7 @@ const _sfc_main$t = {
15766
16206
  },
15767
16207
  _startAnimation(direction, smooth = false) {
15768
16208
  let duration = this.animation.duration;
16209
+ let easing = this.animation.easing ? this.animation.easing : "linear";
15769
16210
  let curViewAnimation;
15770
16211
  let preViewAnimation;
15771
16212
  switch (this.swipeType) {
@@ -15795,7 +16236,7 @@ const _sfc_main$t = {
15795
16236
  this.vertical ? direction * this.layoutInfo.height : 0,
15796
16237
  0,
15797
16238
  duration,
15798
- null
16239
+ Forge$2.Easing.str2Easing(easing)
15799
16240
  );
15800
16241
  preViewAnimation = new Forge$2.TranslateAnimation(
15801
16242
  this.vertical ? 0 : direction * this.layoutInfo.width,
@@ -15803,7 +16244,7 @@ const _sfc_main$t = {
15803
16244
  this.vertical ? direction * this.layoutInfo.height : 0,
15804
16245
  0,
15805
16246
  duration,
15806
- null
16247
+ Forge$2.Easing.str2Easing(easing)
15807
16248
  );
15808
16249
  }
15809
16250
  break;
@@ -15870,81 +16311,1181 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
15870
16311
  onBlur: $options._onBlur,
15871
16312
  onKeyDown: $options._onKeyDown
15872
16313
  }
15873
- }, {
15874
- default: withCtx(() => [
15875
- $props.totalFrame == 1 ? (openBlock(), createElementBlock("div", { key: 0 }, [
15876
- renderSlot(_ctx.$slots, "itemView", {
15877
- currentIndex: 0,
15878
- dataIndex: 0,
15879
- focused: $setup.focused
15880
- })
15881
- ])) : (openBlock(), createElementBlock("div", {
15882
- key: 1,
15883
- style: normalizeStyle({
15884
- width: $props.layoutInfo.width,
15885
- height: $props.layoutInfo.height,
15886
- overflow: "hidden"
15887
- })
15888
- }, [
15889
- createElementVNode("div", { style: {
15890
- zIndex: 0
15891
- } }, [
15892
- createElementVNode("div", null, [
15893
- (openBlock(true), createElementBlock(Fragment, null, renderList($options.viewInfoList, (item, index) => {
15894
- return openBlock(), createElementBlock("div", {
15895
- key: index,
15896
- style: normalizeStyle(item.style),
15897
- ref_for: true,
15898
- ref: "element"
15899
- }, [
15900
- (openBlock(), createElementBlock("div", {
15901
- key: item.dataIndex
15902
- }, [
15903
- renderSlot(_ctx.$slots, "itemView", {
15904
- currentIndex: $options.currentDataIndex,
15905
- dataIndex: item.dataIndex,
15906
- focused: $setup.focused
15907
- })
15908
- ]))
15909
- ], 4);
15910
- }), 128))
15911
- ])
15912
- ]),
15913
- $props.showIndicator ? (openBlock(), createElementBlock("div", {
15914
- key: 0,
15915
- style: normalizeStyle($options.indicatorLayout)
16314
+ }, {
16315
+ default: withCtx(() => [
16316
+ $props.totalFrame == 1 ? (openBlock(), createElementBlock("div", { key: 0 }, [
16317
+ renderSlot(_ctx.$slots, "itemView", {
16318
+ currentIndex: 0,
16319
+ dataIndex: 0,
16320
+ focused: $setup.focused
16321
+ })
16322
+ ])) : (openBlock(), createElementBlock("div", {
16323
+ key: 1,
16324
+ style: normalizeStyle({
16325
+ width: $props.layoutInfo.width,
16326
+ height: $props.layoutInfo.height,
16327
+ overflow: "hidden"
16328
+ })
16329
+ }, [
16330
+ createElementVNode("div", { style: {
16331
+ zIndex: 0
16332
+ } }, [
16333
+ createElementVNode("div", null, [
16334
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.viewInfoList, (item, index) => {
16335
+ return openBlock(), createElementBlock("div", {
16336
+ key: index,
16337
+ style: normalizeStyle(item.style),
16338
+ ref_for: true,
16339
+ ref: "element"
16340
+ }, [
16341
+ (openBlock(), createElementBlock("div", {
16342
+ key: item.dataIndex
16343
+ }, [
16344
+ renderSlot(_ctx.$slots, "itemView", {
16345
+ currentIndex: $options.currentDataIndex,
16346
+ dataIndex: item.dataIndex,
16347
+ focused: $setup.focused
16348
+ })
16349
+ ]))
16350
+ ], 4);
16351
+ }), 128))
16352
+ ])
16353
+ ]),
16354
+ $props.showIndicator ? (openBlock(), createElementBlock("div", {
16355
+ key: 0,
16356
+ style: normalizeStyle($options.indicatorLayout)
16357
+ }, [
16358
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.indexList, (index) => {
16359
+ return openBlock(), createElementBlock("div", {
16360
+ key: index,
16361
+ style: normalizeStyle(
16362
+ $props.vertical ? { top: $options.indicatorDotSize * index } : { left: $options.indicatorDotSize * index }
16363
+ )
16364
+ }, [
16365
+ renderSlot(_ctx.$slots, "indicatorDot", {
16366
+ dataIndex: index,
16367
+ currentIndex: $options.currentDataIndex,
16368
+ focused: $setup.focused
16369
+ }, () => [
16370
+ createElementVNode("div", {
16371
+ style: normalizeStyle({
16372
+ width: $props.dotSize,
16373
+ height: $props.dotSize,
16374
+ backgroundColor: index == $options.currentDataIndex ? "rgba(50, 50, 50, 1.0)" : "rgba(100, 100, 100, 0.7)",
16375
+ borderRadius: Math.round($props.dotSize / 2) + "px"
16376
+ })
16377
+ }, null, 4)
16378
+ ])
16379
+ ], 4);
16380
+ }), 128))
16381
+ ], 4)) : createCommentVNode("", true)
16382
+ ], 4))
16383
+ ]),
16384
+ _: 3
16385
+ }, 8, ["name", "style", "onAction"])
16386
+ ], 64);
16387
+ }
16388
+ const JsvSwiper = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$4]]);
16389
+
16390
+ /*
16391
+ + @file {@link file://./../../../../utils/JsViewVueWidget/JsvSwiper/JsvSwiper2.vue}
16392
+ */
16393
+ /*
16394
+ * @file
16395
+ *
16396
+ * 【模块 export 内容】
16397
+ * JsvSwiper:Vue高阶组件,图片轮播组件
16398
+ * props说明:
16399
+ * showIndicator {boolean} 是否显示指示点,默认显示
16400
+ * dotSize {int} 指示点大小,默认为10px
16401
+ * dotGap {int} 指示点之间间隔,默认为10px
16402
+ * indicatorPos {int} 指示点位置, 横向时为距顶端的位置,默认为高的80%;
16403
+ 纵向时为距左端的位置,默认为宽的80%
16404
+ * indicatorAlign {String} 指示面板的 align, 值为 start / middle / end,默认为middle
16405
+ * totalFrame {int} (必需)item 的个数
16406
+ * firstFrame {int} 初始 item 的 index,默认为0
16407
+ * layoutInfo {Object} (必需)组件的大小及位置 {top: 0, left: 0, width: 0, height: 0}
16408
+ * onClick {Function} 点击事件 function () {}
16409
+ * onChange {Function} 滚动事件 function (index) {}
16410
+ * onEdge {Function} 到达边缘事件 ({direction: EdgeDirection}) => Void
16411
+ * autoplayInterval {int} 自动滚动的时间(毫秒),等于0时不自动滚动, 默认为5000
16412
+ * animation {Object} 滚动动画设置 {duration: 0, easing: "linear"}
16413
+ * vertical {boolean} 组件是否为纵向的,默认为 false
16414
+ * name {String} 组件获得焦点的 name
16415
+ * onFocus {Function} 获得焦点的回调
16416
+ * onBlur {Function} 失去焦点的回调
16417
+ * swipeType {String} 切换方式,目前只支持 translate,之后可能会添加 opacity 等方式
16418
+ * smoothTranslate {boolean} 平滑模式动画开关
16419
+ * reverseSwipe {boolean} 反转滚动方向,默认值为false. 默认滚动方向是正向, 既向index增大的方向, 反转后为反向, 既向index减小的方向
16420
+ * disableLoopWhenFocus {boolean} 获焦时按键是否循环滚动
16421
+ * public methods:
16422
+ * slideTo
16423
+ * @description 滚动到指定id
16424
+ @params {int} id 目标id
16425
+ @params {int} 方向, 1为正向, -1为负向
16426
+ */
16427
+ const _sfc_main$w = {
16428
+ __name: "JsvSwiper2",
16429
+ props: {
16430
+ showIndicator: {
16431
+ type: Boolean,
16432
+ default: true
16433
+ },
16434
+ dotSize: {
16435
+ type: Number,
16436
+ default: 10
16437
+ },
16438
+ dotGap: {
16439
+ type: Number,
16440
+ default: 10
16441
+ },
16442
+ indicatorPos: {
16443
+ type: Number,
16444
+ default: -1
16445
+ },
16446
+ indicatorAlign: {
16447
+ type: String,
16448
+ validator(value) {
16449
+ return ["start", "middle", "end"].includes(value);
16450
+ },
16451
+ default: "middle"
16452
+ },
16453
+ totalFrame: {
16454
+ type: Number,
16455
+ required: true
16456
+ },
16457
+ firstFrame: {
16458
+ type: Number,
16459
+ default: 0
16460
+ },
16461
+ layoutInfo: {
16462
+ type: Object,
16463
+ required: true
16464
+ },
16465
+ onClick: {
16466
+ type: Function
16467
+ },
16468
+ onChange: {
16469
+ type: Function
16470
+ },
16471
+ onEdge: {
16472
+ type: Function
16473
+ },
16474
+ autoplayInterval: {
16475
+ type: Number,
16476
+ default: 5e3
16477
+ },
16478
+ animation: {
16479
+ type: Object,
16480
+ default() {
16481
+ return {
16482
+ duration: 200,
16483
+ easing: "linear"
16484
+ };
16485
+ }
16486
+ },
16487
+ vertical: {
16488
+ type: Boolean,
16489
+ default: false
16490
+ },
16491
+ name: {
16492
+ type: String
16493
+ },
16494
+ onFocus: {
16495
+ type: Function
16496
+ },
16497
+ onBlur: {
16498
+ type: Function
16499
+ },
16500
+ swipeType: {
16501
+ type: String,
16502
+ default: "translate"
16503
+ },
16504
+ smoothTranslate: {
16505
+ type: Boolean,
16506
+ default: false
16507
+ },
16508
+ reverseSwipe: {
16509
+ type: Boolean,
16510
+ default: false
16511
+ },
16512
+ disableLoopWhenFocus: {
16513
+ type: Boolean,
16514
+ default: false
16515
+ },
16516
+ itemSize: {
16517
+ type: Object
16518
+ },
16519
+ itemGap: {
16520
+ type: Number,
16521
+ default: 0
16522
+ }
16523
+ },
16524
+ setup(__props, { expose }) {
16525
+ const props = __props;
16526
+ function modToRange(value, mod, start = 0) {
16527
+ let m = value % mod;
16528
+ if (m < start) {
16529
+ m += mod;
16530
+ } else if (m >= start + mod) {
16531
+ m -= mod;
16532
+ }
16533
+ return m;
16534
+ }
16535
+ const keyCode2EdgeDirection = (keyCode) => {
16536
+ switch (keyCode) {
16537
+ case 37:
16538
+ return EdgeDirection.left;
16539
+ case 38:
16540
+ return EdgeDirection.top;
16541
+ case 39:
16542
+ return EdgeDirection.right;
16543
+ case 40:
16544
+ return EdgeDirection.bottom;
16545
+ default:
16546
+ console.error("not direction key", keyCode);
16547
+ return null;
16548
+ }
16549
+ };
16550
+ const innerItemSize = computed(() => {
16551
+ return props.itemSize || {
16552
+ width: props.layoutInfo.width,
16553
+ height: props.layoutInfo.height
16554
+ };
16555
+ });
16556
+ const visibleCount = computed(() => {
16557
+ if (props.vertical) {
16558
+ return Math.ceil(
16559
+ (props.layoutInfo.height - innerItemSize.value.height) / 2 / (innerItemSize.value.height + props.itemGap)
16560
+ ) * 2 + 1;
16561
+ } else {
16562
+ return Math.ceil(
16563
+ (props.layoutInfo.width - innerItemSize.value.width) / 2 / (innerItemSize.value.width + props.itemGap)
16564
+ ) * 2 + 1;
16565
+ }
16566
+ });
16567
+ const viewNum = computed(() => {
16568
+ return visibleCount.value + 2;
16569
+ });
16570
+ let controllerList = new Array(viewNum.value);
16571
+ if (props.smoothTranslate) {
16572
+ for (let i = 0; i < controllerList.length; i++) {
16573
+ controllerList[i] = new JsvActorMoveControl();
16574
+ }
16575
+ }
16576
+ const focusBlock = ref();
16577
+ let preOffset = ref(-1);
16578
+ const offset = ref(0);
16579
+ const focused = ref(false);
16580
+ let timeoutHandler = -1;
16581
+ let autoplay = ref(false);
16582
+ const element = ref([]);
16583
+ const indexList = computed(() => {
16584
+ return new Array(props.totalFrame).fill(0).map((_, index) => {
16585
+ return index;
16586
+ });
16587
+ });
16588
+ const indicatorLayout = computed(() => {
16589
+ let indicatorSize = props.totalFrame * (props.dotSize + props.dotGap) - props.dotGap;
16590
+ if (props.vertical) {
16591
+ let top;
16592
+ if (props.indicatorAlign === "start") {
16593
+ top = props.dotGap;
16594
+ } else if (props.indicatorAlign === "end") {
16595
+ top = props.layoutInfo.height - indicatorSize - props.dotGap;
16596
+ } else {
16597
+ top = (props.layoutInfo.height - indicatorSize) / 2;
16598
+ }
16599
+ return {
16600
+ left: props.indicatorPos < 0 ? props.layoutInfo.width * 0.8 : props.indicatorPos,
16601
+ top,
16602
+ zIndex: 1
16603
+ };
16604
+ } else {
16605
+ let left;
16606
+ if (props.indicatorAlign === "start") {
16607
+ left = props.dotGap;
16608
+ } else if (props.indicatorAlign === "end") {
16609
+ left = props.layoutInfo.width - indicatorSize - props.dotGap;
16610
+ } else {
16611
+ left = (props.layoutInfo.width - indicatorSize) / 2;
16612
+ }
16613
+ return {
16614
+ left,
16615
+ top: props.indicatorPos < 0 ? props.layoutInfo.height * 0.8 : props.indicatorPos,
16616
+ zIndex: 1
16617
+ };
16618
+ }
16619
+ });
16620
+ const indicatorDotSize = computed(() => {
16621
+ return props.dotSize + props.dotGap;
16622
+ });
16623
+ const currentDataIndex = computed(() => {
16624
+ return modToRange(props.firstFrame + offset.value, props.totalFrame);
16625
+ });
16626
+ const currentViewIndex = computed(() => {
16627
+ return modToRange(
16628
+ offset.value + Math.floor(viewNum.value / 2),
16629
+ viewNum.value
16630
+ );
16631
+ });
16632
+ const viewInfoList = computed(() => {
16633
+ let viewList = [];
16634
+ let widgetSize = props.vertical ? props.layoutInfo.height : props.layoutInfo.width;
16635
+ let itemSize = props.vertical ? innerItemSize.value.height : innerItemSize.value.width;
16636
+ let totalSize = itemSize * viewNum.value + props.itemGap * (viewNum.value - 1);
16637
+ let min = (widgetSize - totalSize) / 2;
16638
+ let centerIndex = Math.floor(viewNum.value / 2);
16639
+ for (let i = 0; i < viewNum.value; i++) {
16640
+ let pos = modToRange(i - offset.value, viewNum.value);
16641
+ const style = {
16642
+ top: props.vertical ? min + pos * itemSize + pos * props.itemGap : 0,
16643
+ left: props.vertical ? 0 : min + pos * itemSize + pos * props.itemGap,
16644
+ width: props.layoutInfo.width,
16645
+ height: props.layoutInfo.height
16646
+ };
16647
+ viewList.push({
16648
+ dataIndex: modToRange(
16649
+ currentDataIndex.value + (pos - centerIndex),
16650
+ props.totalFrame
16651
+ ),
16652
+ style,
16653
+ distanceToCenter: pos - centerIndex
16654
+ });
16655
+ }
16656
+ return viewList;
16657
+ });
16658
+ watch(offset, (newValue) => {
16659
+ props.onChange?.(modToRange(props.firstFrame + newValue, props.totalFrame));
16660
+ });
16661
+ watch(() => currentDataIndex.value, (newVal, oldVal) => {
16662
+ console.log("currentDataIndex变化:", oldVal, "->", newVal);
16663
+ });
16664
+ const getFocusBlockRef = () => {
16665
+ return focusBlock;
16666
+ };
16667
+ const stopAutoplay = () => {
16668
+ autoplay.value = false;
16669
+ clearInterval(timeoutHandler);
16670
+ timeoutHandler = -1;
16671
+ };
16672
+ const startAutoplay = () => {
16673
+ if (props.autoplayInterval > 0 && props.totalFrame > 1) {
16674
+ autoplay.value = true;
16675
+ if (timeoutHandler > 0) {
16676
+ clearInterval(timeoutHandler);
16677
+ }
16678
+ timeoutHandler = setInterval(() => {
16679
+ _trigger(props.reverseSwipe ? -1 : 1);
16680
+ }, props.autoplayInterval);
16681
+ }
16682
+ };
16683
+ const slideTo = (id, direction = 0) => {
16684
+ const curId = modToRange(props.firstFrame + offset.value, props.totalFrame);
16685
+ if (curId != id) {
16686
+ let d;
16687
+ if (direction != 0) {
16688
+ d = direction;
16689
+ } else {
16690
+ d = id - curId;
16691
+ }
16692
+ _trigger(
16693
+ modToRange(
16694
+ id - curId,
16695
+ props.totalFrame,
16696
+ d > 0 ? 0 : -props.totalFrame + 1
16697
+ )
16698
+ );
16699
+ }
16700
+ };
16701
+ const _onKeyDown = (ev) => {
16702
+ let direction = 0;
16703
+ switch (ev.keyCode) {
16704
+ case 37:
16705
+ if (!props.vertical) {
16706
+ direction = -1;
16707
+ }
16708
+ break;
16709
+ case 38:
16710
+ if (props.vertical) {
16711
+ direction = -1;
16712
+ }
16713
+ break;
16714
+ case 39:
16715
+ if (!props.vertical) {
16716
+ direction = 1;
16717
+ }
16718
+ break;
16719
+ case 40:
16720
+ if (props.vertical) {
16721
+ direction = 1;
16722
+ }
16723
+ break;
16724
+ case 13:
16725
+ props.onClick?.(currentDataIndex.value);
16726
+ return true;
16727
+ default:
16728
+ return false;
16729
+ }
16730
+ if (direction !== 0) {
16731
+ if (!props.disableLoopWhenFocus) {
16732
+ _trigger(direction);
16733
+ return true;
16734
+ } else {
16735
+ if (currentDataIndex.value + direction >= 0 && currentDataIndex.value + direction < props.totalFrame) {
16736
+ _trigger(direction);
16737
+ return true;
16738
+ }
16739
+ }
16740
+ }
16741
+ props.onEdge?.({
16742
+ direction: keyCode2EdgeDirection(ev.keyCode),
16743
+ rect: {
16744
+ x: props.layoutInfo.left,
16745
+ y: props.layoutInfo.top,
16746
+ width: props.layoutInfo.width,
16747
+ height: props.layoutInfo.height
16748
+ }
16749
+ });
16750
+ return true;
16751
+ };
16752
+ const _onAnimationEnd = () => {
16753
+ };
16754
+ const _onFocus = () => {
16755
+ focused.value = true;
16756
+ stopAutoplay();
16757
+ props.onFocus?.();
16758
+ };
16759
+ const _onBlur = () => {
16760
+ focused.value = false;
16761
+ startAutoplay();
16762
+ props.onBlur?.();
16763
+ };
16764
+ const _getAnimation = (direction, smooth, addListener) => {
16765
+ let easing = props.animation.easing ? props.animation.easing : "linear";
16766
+ let anim;
16767
+ if (smooth) {
16768
+ const speed = (props.vertical ? props.layoutInfo.height : props.layoutInfo.width) / props.animation.duration * 1e3;
16769
+ anim = new Forge$2.TranslateFrameAnimation(
16770
+ props.vertical ? direction * (props.itemSize.height + props.itemGap) : direction * (props.itemSize.width + props.itemGap),
16771
+ 0,
16772
+ speed,
16773
+ !props.vertical,
16774
+ props.vertical ? 0 : direction * (props.itemSize.width + props.itemGap),
16775
+ props.vertical ? direction * (props.itemSize.height + props.itemGap) : 0
16776
+ );
16777
+ } else {
16778
+ anim = new Forge$2.TranslateAnimation(
16779
+ props.vertical ? 0 : direction * (props.itemSize.width + props.itemGap),
16780
+ 0,
16781
+ props.vertical ? direction * (props.itemSize.height + props.itemGap) : 0,
16782
+ 0,
16783
+ props.animation.duration,
16784
+ Forge$2.Easing.str2Easing(easing)
16785
+ );
16786
+ }
16787
+ if (addListener) {
16788
+ anim.SetAnimationListener(
16789
+ new Forge$2.AnimationListener(null, _onAnimationEnd, null)
16790
+ );
16791
+ }
16792
+ return anim;
16793
+ };
16794
+ const _startAnimation = (direction, smooth = false) => {
16795
+ switch (props.swipeType) {
16796
+ case "translate":
16797
+ let startIndex = currentViewIndex.value - (visibleCount.value - 1) / 2 + (direction > 0 ? -1 : 0);
16798
+ let endIndex = currentViewIndex.value + (visibleCount.value - 1) / 2 + (direction > 0 ? 0 : 1);
16799
+ for (let i = startIndex; i <= endIndex; ++i) {
16800
+ element.value?.[i == currentViewIndex.value ? currentViewIndex.value : modToRange(i, viewNum.value)]?.jsvGetProxyView(true).StartAnimation(
16801
+ _getAnimation(direction, smooth, i == currentViewIndex.value)
16802
+ );
16803
+ }
16804
+ break;
16805
+ case "opacity":
16806
+ break;
16807
+ default:
16808
+ break;
16809
+ }
16810
+ };
16811
+ const _trigger = (direction) => {
16812
+ if (props.totalFrame <= 1)
16813
+ return;
16814
+ preOffset.value = offset.value;
16815
+ offset.value += direction;
16816
+ _startAnimation(direction > 0 ? 1 : -1, props.smoothTranslate);
16817
+ };
16818
+ const onBeVisible = (old_h, new_h, old_v, new_v) => {
16819
+ if (old_h && !new_h || old_v && !new_h) {
16820
+ stopAutoplay();
16821
+ } else if (!old_h && new_h || !old_v && new_h) {
16822
+ if (!focused.value) {
16823
+ startAutoplay();
16824
+ }
16825
+ }
16826
+ };
16827
+ onMounted(() => {
16828
+ if (!focused.value) {
16829
+ startAutoplay();
16830
+ }
16831
+ });
16832
+ onBeforeUnmount(() => {
16833
+ stopAutoplay();
16834
+ });
16835
+ expose({
16836
+ getFocusBlockRef,
16837
+ slideTo
16838
+ });
16839
+ return (_ctx, _cache) => {
16840
+ const _component_jsv_focus_block = resolveComponent("jsv-focus-block");
16841
+ return openBlock(), createElementBlock(Fragment, null, [
16842
+ createVNode(unref(JsvVisibleSensor), {
16843
+ horizonShown: 0.2,
16844
+ verticalShown: 0.2,
16845
+ width: __props.layoutInfo.width,
16846
+ height: __props.layoutInfo.height,
16847
+ enable: true,
16848
+ callback: onBeVisible
16849
+ }, null, 8, ["horizonShown", "verticalShown", "width", "height"]),
16850
+ createVNode(_component_jsv_focus_block, {
16851
+ ref_key: "focusBlock",
16852
+ ref: focusBlock,
16853
+ name: __props.name,
16854
+ style: normalizeStyle({
16855
+ left: __props.layoutInfo.left,
16856
+ top: __props.layoutInfo.top,
16857
+ width: __props.layoutInfo.width,
16858
+ height: __props.layoutInfo.height
16859
+ }),
16860
+ onAction: {
16861
+ onFocus: _onFocus,
16862
+ onBlur: _onBlur,
16863
+ onKeyDown: _onKeyDown
16864
+ }
16865
+ }, {
16866
+ default: withCtx(() => [
16867
+ createElementVNode("div", {
16868
+ style: normalizeStyle({
16869
+ width: __props.layoutInfo.width,
16870
+ height: __props.layoutInfo.height,
16871
+ overflow: "hidden"
16872
+ })
16873
+ }, [
16874
+ createElementVNode("div", { style: {
16875
+ zIndex: 0
16876
+ } }, [
16877
+ createElementVNode("div", null, [
16878
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(viewInfoList), (item, index) => {
16879
+ return openBlock(), createElementBlock("div", {
16880
+ key: index,
16881
+ style: normalizeStyle(item.style),
16882
+ ref_for: true,
16883
+ ref_key: "element",
16884
+ ref: element
16885
+ }, [
16886
+ (openBlock(), createElementBlock("div", {
16887
+ key: item.dataIndex
16888
+ }, [
16889
+ renderSlot(_ctx.$slots, "itemView", {
16890
+ currentIndex: unref(currentDataIndex),
16891
+ dataIndex: item.dataIndex,
16892
+ focused: focused.value,
16893
+ distanceToCenter: item.distanceToCenter
16894
+ })
16895
+ ]))
16896
+ ], 4);
16897
+ }), 128))
16898
+ ])
16899
+ ]),
16900
+ __props.showIndicator ? (openBlock(), createElementBlock("div", {
16901
+ key: 0,
16902
+ style: normalizeStyle(unref(indicatorLayout))
16903
+ }, [
16904
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(indexList), (index) => {
16905
+ return openBlock(), createElementBlock("div", {
16906
+ key: index,
16907
+ style: normalizeStyle(
16908
+ __props.vertical ? { top: unref(indicatorDotSize) * index } : { left: unref(indicatorDotSize) * index }
16909
+ )
16910
+ }, [
16911
+ renderSlot(_ctx.$slots, "indicatorDot", {
16912
+ dataIndex: index,
16913
+ currentIndex: unref(currentDataIndex),
16914
+ focused: focused.value
16915
+ }, () => [
16916
+ createElementVNode("div", {
16917
+ style: normalizeStyle({
16918
+ width: __props.dotSize,
16919
+ height: __props.dotSize,
16920
+ backgroundColor: index == unref(currentDataIndex) ? "rgba(50, 50, 50, 1.0)" : "rgba(100, 100, 100, 0.7)",
16921
+ borderRadius: Math.round(__props.dotSize / 2) + "px"
16922
+ })
16923
+ }, null, 4)
16924
+ ])
16925
+ ], 4);
16926
+ }), 128))
16927
+ ], 4)) : createCommentVNode("", true)
16928
+ ], 4)
16929
+ ]),
16930
+ _: 3
16931
+ }, 8, ["name", "style", "onAction"])
16932
+ ], 64);
16933
+ };
16934
+ }
16935
+ };
16936
+
16937
+ /*
16938
+ + @file {@link file://./../../../utils/JsViewVueWidget/JsvSmoothSlideContainer.vue}
16939
+ */
16940
+ const _sfc_main$v = {
16941
+ __name: "JsvSmoothSlideContainer",
16942
+ props: {
16943
+ initPosition: {
16944
+ type: Array,
16945
+ default: () => [0, 0]
16946
+ }
16947
+ },
16948
+ setup(__props, { expose }) {
16949
+ const props = __props;
16950
+ const ReachConditionGroup = 2;
16951
+ const root = shallowRef();
16952
+ const actorControl = new ActorControl();
16953
+ let preTarget = props.initPosition;
16954
+ let curTarget = props.initPosition;
16955
+ onMounted(() => {
16956
+ actorControl.bindForgeView(root.value.jsvGetProxyView(), true);
16957
+ actorControl.run((cmds) => [
16958
+ cmds.action().teleportTo(props.initPosition[0], props.initPosition[1])
16959
+ ]);
16960
+ });
16961
+ let curSpeed = 0;
16962
+ const moveTo = (speed, x, y, onReach, prex, prey, onPreReach) => {
16963
+ if (x == curTarget[0] && y == curTarget[1] && curSpeed == speed) {
16964
+ return;
16965
+ }
16966
+ curSpeed = speed;
16967
+ let targetX = void 0;
16968
+ let targetY = void 0;
16969
+ let preTargetX = void 0;
16970
+ let preTargetY = void 0;
16971
+ let speedX = void 0;
16972
+ let speedY = void 0;
16973
+ preTarget = [curTarget[0], curTarget[1]];
16974
+ curTarget = [x, y];
16975
+ const vec = [x - preTarget[0], y - preTarget[1]];
16976
+ const module = Math.sqrt(vec[0] * vec[0] + vec[1] * vec[1]);
16977
+ if (vec[0] != 0) {
16978
+ speedX = vec[0] / module * speed;
16979
+ targetX = x;
16980
+ preTargetX = prex;
16981
+ } else if (vec[1] != 0) {
16982
+ speedY = vec[1] / module * speed;
16983
+ targetY = y;
16984
+ preTargetY = prey;
16985
+ }
16986
+ actorControl.run((cmds) => [
16987
+ cmds.state().removeConditionByGroup(ReachConditionGroup),
16988
+ cmds.action(0, 0).setSpeed(speedX, speedY),
16989
+ cmds.condition(ReachConditionGroup).reachPosition(preTargetX, preTargetY).then([onPreReach]),
16990
+ cmds.condition(ReachConditionGroup).reachPosition(targetX, targetY).then([onReach])
16991
+ ]);
16992
+ };
16993
+ const brakeTo = (x, y) => {
16994
+ actorControl.run((cmds) => [cmds.action(3, 0).brakeToPosition(x, y)]);
16995
+ };
16996
+ const stop = () => {
16997
+ actorControl.run((cmds) => [cmds.action().setSpeed(0, 0)]);
16998
+ };
16999
+ const setSpeed = (speedX, speedY) => {
17000
+ actorControl.run((cmds) => [cmds.action().setSpeed(speedX, speedY)]);
17001
+ };
17002
+ expose({
17003
+ moveTo,
17004
+ brakeTo,
17005
+ stop,
17006
+ setSpeed
17007
+ });
17008
+ return (_ctx, _cache) => {
17009
+ return openBlock(), createElementBlock("div", {
17010
+ ref_key: "root",
17011
+ ref: root
17012
+ }, [
17013
+ renderSlot(_ctx.$slots, "default")
17014
+ ], 512);
17015
+ };
17016
+ }
17017
+ };
17018
+
17019
+ /*
17020
+ + @file {@link file://./../../../../utils/JsViewVueWidget/JsvSwiper/JsvSmoothSwiper.vue}
17021
+ */
17022
+ /*
17023
+ * @file
17024
+ *
17025
+ * 【模块 export 内容】
17026
+ * JsvSmoothSwiper:Vue高阶组件,平滑滚动轮播组件
17027
+ * props说明:
17028
+ * totalFrame {int} (必需)item 的个数
17029
+ * firstFrame {int} 初始 item 的 index,默认为0
17030
+ * layoutInfo {Object} (必需)组件的大小及位置 {top: 0, left: 0, width: 0, height: 0}
17031
+ * onClick {Function} 点击事件 function () {}
17032
+ * onChange {Function} 滚动事件 function (index) {}
17033
+ * onEdge {Function} 到达边缘事件 ({direction: EdgeDirection}) => Void
17034
+ * autoplayInterval {int} 自动滚动的时间(毫秒),等于0时不自动滚动, 默认为5000
17035
+ * enableAutoplay {boolean} 是否启用自动滚动,默认为false
17036
+ * animation {Object} 滚动动画设置 {duration: 0, easing: "linear"}
17037
+ * vertical {boolean} 组件是否为纵向的,默认为 false
17038
+ * name {String} 组件获得焦点的 name
17039
+ * onFocus {Function} 获得焦点的回调
17040
+ * onBlur {Function} 失去焦点的回调
17041
+ * reverseSwipe {boolean} 反转滚动方向,默认值为false. 默认滚动方向是正向, 既向index增大的方向, 反转后为反向, 既向index减小的方向
17042
+ * itemSize {Object} item的大小 {width: 0, height: 0}
17043
+ * itemGap {int} item之间的间隔,默认为0
17044
+ * padding {Object} 内边距 {left: 0, top: 0, right: 0, bottom: 0}
17045
+ */
17046
+ const _sfc_main$u = {
17047
+ __name: "JsvSmoothSwiper",
17048
+ props: {
17049
+ totalFrame: {
17050
+ type: Number,
17051
+ required: true
17052
+ },
17053
+ firstFrame: {
17054
+ type: Number,
17055
+ default: 0
17056
+ },
17057
+ layoutInfo: {
17058
+ type: Object,
17059
+ required: true
17060
+ },
17061
+ onClick: {
17062
+ type: Function
17063
+ },
17064
+ onChange: {
17065
+ type: Function
17066
+ },
17067
+ onEdge: {
17068
+ type: Function
17069
+ },
17070
+ autoplayInterval: {
17071
+ type: Number,
17072
+ default: 5e3
17073
+ },
17074
+ enableAutoplay: {
17075
+ type: Boolean,
17076
+ default: false
17077
+ },
17078
+ animation: {
17079
+ type: Object,
17080
+ default() {
17081
+ return {
17082
+ duration: 200,
17083
+ easing: "linear"
17084
+ };
17085
+ }
17086
+ },
17087
+ vertical: {
17088
+ type: Boolean,
17089
+ default: false
17090
+ },
17091
+ name: {
17092
+ type: String
17093
+ },
17094
+ onFocus: {
17095
+ type: Function
17096
+ },
17097
+ onBlur: {
17098
+ type: Function
17099
+ },
17100
+ reverseSwipe: {
17101
+ type: Boolean,
17102
+ default: false
17103
+ },
17104
+ itemSize: {
17105
+ type: Object
17106
+ },
17107
+ itemGap: {
17108
+ type: Number,
17109
+ default: 0
17110
+ },
17111
+ padding: {
17112
+ type: Object
17113
+ }
17114
+ },
17115
+ setup(__props) {
17116
+ const props = __props;
17117
+ const root = shallowRef();
17118
+ const childDivList = ref([]);
17119
+ window.test = childDivList;
17120
+ const focused = shallowRef(false);
17121
+ const currentIndex = shallowRef(props.firstFrame);
17122
+ const targetIndex = shallowRef(props.firstFrame);
17123
+ const currentDataIndex = computed(() => {
17124
+ return modToRange(currentIndex.value, props.totalFrame);
17125
+ });
17126
+ const keyCode2EdgeDirection = (keyCode) => {
17127
+ switch (keyCode) {
17128
+ case 37:
17129
+ return EdgeDirection.left;
17130
+ case 38:
17131
+ return EdgeDirection.top;
17132
+ case 39:
17133
+ return EdgeDirection.right;
17134
+ case 40:
17135
+ return EdgeDirection.bottom;
17136
+ default:
17137
+ console.error("not direction key", keyCode);
17138
+ return null;
17139
+ }
17140
+ };
17141
+ function modToRange(value, mod, start = 0) {
17142
+ let m = value % mod;
17143
+ if (m < start) {
17144
+ m += mod;
17145
+ } else if (m >= start + mod) {
17146
+ m -= mod;
17147
+ }
17148
+ return m;
17149
+ }
17150
+ const innerPadding = computed(() => {
17151
+ return Object.assign(
17152
+ {
17153
+ left: 0,
17154
+ top: 0,
17155
+ right: 0,
17156
+ bottom: 0
17157
+ },
17158
+ props.padding
17159
+ );
17160
+ });
17161
+ const innerItemSize = computed(() => {
17162
+ return props.itemSize || {
17163
+ width: props.layoutInfo.width,
17164
+ height: props.layoutInfo.height
17165
+ };
17166
+ });
17167
+ const centerOffset = computed(() => {
17168
+ return props.vertical ? (props.layoutInfo.height - (innerPadding.value.top + innerPadding.value.bottom) - innerItemSize.value.height) / 2 : (props.layoutInfo.width - (innerPadding.value.left + innerPadding.value.right) - innerItemSize.value.width) / 2;
17169
+ });
17170
+ const itemStart = (index) => {
17171
+ return props.vertical ? index * props.itemSize.height + index * props.itemGap : index * props.itemSize.width + index * props.itemGap;
17172
+ };
17173
+ const visibleCount = computed(() => {
17174
+ if (props.vertical) {
17175
+ return Math.ceil(
17176
+ (props.layoutInfo.height - innerItemSize.value.height) / 2 / (innerItemSize.value.height + props.itemGap)
17177
+ ) * 2 + 1;
17178
+ } else {
17179
+ return Math.ceil(
17180
+ (props.layoutInfo.width - innerItemSize.value.width) / 2 / (innerItemSize.value.width + props.itemGap)
17181
+ ) * 2 + 1;
17182
+ }
17183
+ });
17184
+ const viewNum = computed(() => {
17185
+ return visibleCount.value + 2;
17186
+ });
17187
+ const viewNumOneSide = computed(() => {
17188
+ return Math.floor(viewNum.value / 2);
17189
+ });
17190
+ let xInitPosition = 0;
17191
+ let yInitPosition = 0;
17192
+ if (props.vertical) {
17193
+ yInitPosition = -itemStart(currentIndex.value) + centerOffset.value;
17194
+ } else {
17195
+ xInitPosition = -itemStart(currentIndex.value) + centerOffset.value;
17196
+ }
17197
+ const initDivList = () => {
17198
+ prepareDiv(currentIndex.value, -1);
17199
+ prepareDiv(currentIndex.value, 1);
17200
+ };
17201
+ const addDiv = (divInfo) => {
17202
+ for (let i of childDivList.value) {
17203
+ if (i.id === divInfo.id) {
17204
+ return;
17205
+ }
17206
+ }
17207
+ childDivList.value.push(divInfo);
17208
+ };
17209
+ const cleanInvisibleDiv = () => {
17210
+ childDivList.value = childDivList.value.filter(
17211
+ (item) => item.id >= currentIndex.value - viewNumOneSide.value && item.id <= currentIndex.value + viewNumOneSide.value
17212
+ );
17213
+ };
17214
+ const prepareDiv = (index, toward = 1) => {
17215
+ const start = Math.min(index, index + toward * viewNumOneSide.value);
17216
+ const end = Math.max(index, index + toward * viewNumOneSide.value);
17217
+ for (let i = start; i <= end; ++i) {
17218
+ const divInfo = {
17219
+ id: i,
17220
+ left: itemStart(i),
17221
+ top: 0,
17222
+ width: props.itemSize.width,
17223
+ height: props.itemSize.height,
17224
+ dataIndex: modToRange(i, props.totalFrame)
17225
+ };
17226
+ addDiv(divInfo);
17227
+ }
17228
+ };
17229
+ let intervalId = null;
17230
+ const startAutoplay = () => {
17231
+ intervalId = setInterval(() => {
17232
+ const toward = props.reverseSwipe ? -1 : 1;
17233
+ moveTo(curTargetIndex + toward, lowSpeed.value);
17234
+ }, props.autoplayInterval);
17235
+ };
17236
+ const stopAutoplay = () => {
17237
+ clearInterval(intervalId);
17238
+ };
17239
+ const onFocus = () => {
17240
+ focused.value = true;
17241
+ stopAutoplay();
17242
+ };
17243
+ const onBlur = () => {
17244
+ focused.value = false;
17245
+ if (props.enableAutoplay && props.autoplayInterval > 0) {
17246
+ startAutoplay();
17247
+ }
17248
+ };
17249
+ const getSlidePosByIndex = (index) => {
17250
+ return -itemStart(index) + centerOffset.value;
17251
+ };
17252
+ let preTargetIndex = props.firstFrame;
17253
+ let curTargetIndex = props.firstFrame;
17254
+ let curMoveDirection = 0;
17255
+ let moveSpeed = 0;
17256
+ let moveDirection = 0;
17257
+ const moveTo = (index, speed) => {
17258
+ if (index == curTargetIndex && speed == moveSpeed) {
17259
+ return;
17260
+ }
17261
+ moveSpeed = speed;
17262
+ if (index != curTargetIndex) {
17263
+ preTargetIndex = curTargetIndex;
17264
+ curTargetIndex = index;
17265
+ }
17266
+ moveDirection = Math.sign(curTargetIndex - preTargetIndex);
17267
+ let targetX = 0;
17268
+ let targetY = 0;
17269
+ let halfTargetX = 0;
17270
+ let halfTargetY = 0;
17271
+ if (props.vertical) {
17272
+ targetY = getSlidePosByIndex(curTargetIndex);
17273
+ let preTargetY = getSlidePosByIndex(preTargetIndex);
17274
+ halfTargetY = (targetY + preTargetY) / 2;
17275
+ } else {
17276
+ targetX = getSlidePosByIndex(curTargetIndex);
17277
+ let preTargetX = getSlidePosByIndex(preTargetIndex);
17278
+ halfTargetX = (targetX + preTargetX) / 2;
17279
+ }
17280
+ prepareDiv(index, moveDirection);
17281
+ root.value.moveTo(
17282
+ speed,
17283
+ targetX,
17284
+ targetY,
17285
+ onReach(index, curMoveDirection),
17286
+ halfTargetX,
17287
+ halfTargetY,
17288
+ onBeforeReach(index, curMoveDirection)
17289
+ );
17290
+ moveInfo.moving = true;
17291
+ };
17292
+ const brakeTo = (index) => {
17293
+ let targetX = void 0;
17294
+ let targetY = void 0;
17295
+ if (props.vertical) {
17296
+ targetY = getSlidePosByIndex(index);
17297
+ } else {
17298
+ targetX = getSlidePosByIndex(index);
17299
+ }
17300
+ root.value.brakeTo(targetX, targetY);
17301
+ };
17302
+ const onReach = (index, toward) => {
17303
+ return () => {
17304
+ moveInfo.reachedIndex = index;
17305
+ if (keyInfo.keyRepeat) {
17306
+ moveTo(
17307
+ curTargetIndex + Math.sign(curTargetIndex - preTargetIndex),
17308
+ moveSpeed
17309
+ );
17310
+ } else {
17311
+ moveInfo.moving = false;
17312
+ moveSpeed = 0;
17313
+ cleanInvisibleDiv();
17314
+ if (curTargetIndex === index) {
17315
+ root.value?.stop();
17316
+ }
17317
+ }
17318
+ };
17319
+ };
17320
+ const onBeforeReach = (index, toward) => {
17321
+ return () => {
17322
+ currentIndex.value = index;
17323
+ props.onChange?.(currentDataIndex.value);
17324
+ if (!keyInfo.keyRepeat) {
17325
+ if (curTargetIndex === index) {
17326
+ brakeTo(index);
17327
+ }
17328
+ }
17329
+ };
17330
+ };
17331
+ let moveInfo = {
17332
+ reachedIndex: props.firstFrame,
17333
+ preReached: false,
17334
+ toward: 0,
17335
+ moving: false,
17336
+ moveSpeed: 0,
17337
+ targetIndex: 0
17338
+ };
17339
+ const lowSpeed = computed(() => {
17340
+ return (props.verticals ? props.itemSize.height : props.itemSize.width) / (60 * props.animation.duration / 1e3);
17341
+ });
17342
+ const highSpeed = computed(() => {
17343
+ return 2 * lowSpeed.value;
17344
+ });
17345
+ const keyInfo = {
17346
+ keyCode: 0,
17347
+ keyRepeat: false
17348
+ };
17349
+ const onKeyDown = (ev) => {
17350
+ if (ev.keyCode == 13) {
17351
+ if (!moveInfo.moving) {
17352
+ props.onClick?.(currentDataIndex.value);
17353
+ }
17354
+ return true;
17355
+ }
17356
+ if (ev.keyCode != 37 && ev.keyCode != 38 && ev.keyCode != 39 && ev.keyCode != 40) {
17357
+ return false;
17358
+ }
17359
+ let toward = 0;
17360
+ if (props.vertical) {
17361
+ toward = ev.keyCode == 38 ? -1 : ev.keyCode == 40 ? 1 : 0;
17362
+ } else {
17363
+ toward = ev.keyCode == 37 ? -1 : ev.keyCode == 39 ? 1 : 0;
17364
+ }
17365
+ if (toward == 0) {
17366
+ props.onEdge?.({
17367
+ direction: keyCode2EdgeDirection(ev.keyCode),
17368
+ rect: {
17369
+ x: props.layoutInfo.left,
17370
+ y: props.layoutInfo.top,
17371
+ width: props.layoutInfo.width,
17372
+ height: props.layoutInfo.height
17373
+ }
17374
+ });
17375
+ return true;
17376
+ }
17377
+ keyInfo.keyCode = ev.keyCode;
17378
+ keyInfo.keyRepeat = ev.repeat;
17379
+ if (moveInfo.moving) {
17380
+ if (ev.repeat) {
17381
+ if (moveSpeed != highSpeed.value) {
17382
+ moveSpeed = highSpeed.value;
17383
+ root.value?.setSpeed(
17384
+ props.vertical ? void 0 : -toward * highSpeed.value,
17385
+ props.vertical ? -toward * highSpeed.value : void 0
17386
+ );
17387
+ }
17388
+ return true;
17389
+ }
17390
+ if (toward == moveDirection) {
17391
+ if (currentIndex.value == curTargetIndex) {
17392
+ moveTo(curTargetIndex + toward, highSpeed.value);
17393
+ }
17394
+ } else {
17395
+ moveTo(curTargetIndex + toward, lowSpeed.value);
17396
+ }
17397
+ } else {
17398
+ moveTo(curTargetIndex + toward, lowSpeed.value);
17399
+ }
17400
+ return true;
17401
+ };
17402
+ const onKeyUp = (ev) => {
17403
+ let targetKey = false;
17404
+ switch (ev.keyCode) {
17405
+ case 37:
17406
+ targetKey = true;
17407
+ break;
17408
+ case 39:
17409
+ targetKey = true;
17410
+ break;
17411
+ case 38:
17412
+ targetKey = true;
17413
+ break;
17414
+ case 40:
17415
+ targetKey = true;
17416
+ break;
17417
+ default:
17418
+ break;
17419
+ }
17420
+ if (targetKey) {
17421
+ if (keyInfo.keyCode != ev.keyCode) {
17422
+ return true;
17423
+ }
17424
+ keyInfo.keyRepeat = false;
17425
+ if (moveInfo.moving) {
17426
+ brakeTo(curTargetIndex);
17427
+ }
17428
+ return true;
17429
+ }
17430
+ return false;
17431
+ };
17432
+ onMounted(() => {
17433
+ initDivList();
17434
+ });
17435
+ return (_ctx, _cache) => {
17436
+ const _component_jsv_focus_block = resolveComponent("jsv-focus-block");
17437
+ return openBlock(), createBlock(_component_jsv_focus_block, {
17438
+ name: __props.name,
17439
+ onAction: { onFocus, onBlur, onKeyDown, onKeyUp }
17440
+ }, {
17441
+ default: withCtx(() => [
17442
+ createElementVNode("div", {
17443
+ style: normalizeStyle({
17444
+ width: props.layoutInfo.width,
17445
+ height: props.layoutInfo.height,
17446
+ overflow: "hidden"
17447
+ })
15916
17448
  }, [
15917
- (openBlock(true), createElementBlock(Fragment, null, renderList($options.indexList, (index) => {
15918
- return openBlock(), createElementBlock("div", {
15919
- key: index,
15920
- style: normalizeStyle(
15921
- $props.vertical ? { top: $options.indicatorDotSize * index } : { left: $options.indicatorDotSize * index }
15922
- )
15923
- }, [
15924
- renderSlot(_ctx.$slots, "indicatorDot", {
15925
- dataIndex: index,
15926
- currentIndex: $options.currentDataIndex,
15927
- focused: $setup.focused
15928
- }, () => [
15929
- createElementVNode("div", {
15930
- style: normalizeStyle({
15931
- width: $props.dotSize,
15932
- height: $props.dotSize,
15933
- backgroundColor: index == $options.currentDataIndex ? "rgba(50, 50, 50, 1.0)" : "rgba(100, 100, 100, 0.7)",
15934
- borderRadius: Math.round($props.dotSize / 2) + "px"
15935
- })
15936
- }, null, 4)
15937
- ])
15938
- ], 4);
15939
- }), 128))
15940
- ], 4)) : createCommentVNode("", true)
15941
- ], 4))
15942
- ]),
15943
- _: 3
15944
- }, 8, ["name", "style", "onAction"])
15945
- ], 64);
15946
- }
15947
- const JsvSwiper = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$4]]);
17449
+ createElementVNode("div", {
17450
+ style: normalizeStyle({
17451
+ left: unref(innerPadding).left,
17452
+ top: unref(innerPadding).top
17453
+ })
17454
+ }, [
17455
+ createVNode(_sfc_main$v, {
17456
+ ref_key: "root",
17457
+ ref: root,
17458
+ initPosition: [unref(xInitPosition), unref(yInitPosition)]
17459
+ }, {
17460
+ default: withCtx(() => [
17461
+ (openBlock(true), createElementBlock(Fragment, null, renderList(childDivList.value, (item) => {
17462
+ return openBlock(), createElementBlock("div", {
17463
+ key: item.id,
17464
+ style: normalizeStyle({
17465
+ left: item.left,
17466
+ top: item.top,
17467
+ width: item.width,
17468
+ height: item.height
17469
+ })
17470
+ }, [
17471
+ renderSlot(_ctx.$slots, "itemView", {
17472
+ currentIndex: unref(currentDataIndex),
17473
+ dataIndex: item.dataIndex,
17474
+ focused: unref(focused)
17475
+ })
17476
+ ], 4);
17477
+ }), 128))
17478
+ ]),
17479
+ _: 3
17480
+ }, 8, ["initPosition"])
17481
+ ], 4)
17482
+ ], 4)
17483
+ ]),
17484
+ _: 3
17485
+ }, 8, ["name", "onAction"]);
17486
+ };
17487
+ }
17488
+ };
15948
17489
 
15949
17490
  /*
15950
17491
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvSwiper/index.js}
@@ -15972,7 +17513,7 @@ const JsvSwiper = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_rend
15972
17513
  * sideScale {float} 边缘缩小倍数
15973
17514
  * initItemStyle {Object} (必需)中间最大项的style{width,height}
15974
17515
  */
15975
- const _sfc_main$s = {
17516
+ const _sfc_main$t = {
15976
17517
  __name: "JsvSwiper",
15977
17518
  props: {
15978
17519
  dispNumber: { type: Number, require: true },
@@ -16411,7 +17952,7 @@ const STATE_IDLE = 0;
16411
17952
  const STATE_RUNNING = 1;
16412
17953
  const STATE_PAUSED = 2;
16413
17954
  const STATE_END = 3;
16414
- const _sfc_main$r = {
17955
+ const _sfc_main$s = {
16415
17956
  props: {
16416
17957
  src: String,
16417
17958
  top: Number,
@@ -16451,6 +17992,11 @@ const _sfc_main$r = {
16451
17992
  this._updateTexCoord();
16452
17993
  },
16453
17994
  deep: true
17995
+ },
17996
+ transform: {
17997
+ handler(newValue, oldValue) {
17998
+ this.innerView.ResetTextureCssTransform(newValue, this.transformOrigin);
17999
+ }
16454
18000
  }
16455
18001
  },
16456
18002
  setup() {
@@ -16559,7 +18105,7 @@ const _sfc_main$r = {
16559
18105
  if (normal_end) {
16560
18106
  this.runningState = STATE_END;
16561
18107
  }
16562
- this.onAnimationEnd?.();
18108
+ this.onAnimationEnd?.(normal_end);
16563
18109
  },
16564
18110
  _updateTexCoord() {
16565
18111
  if (this.texCoord) {
@@ -16579,12 +18125,12 @@ const _sfc_main$r = {
16579
18125
  }
16580
18126
  }
16581
18127
  },
16582
- _buildAnimation() {
16583
- if (this.animation) {
18128
+ _buildAnimation(a) {
18129
+ if (a) {
16584
18130
  let anim = new Forge$2.CssKeyframeAnimation(
16585
- "@keyframes texAnimDef" + this.animation,
18131
+ "@keyframes texAnimDef" + a,
16586
18132
  this.duration,
16587
- null,
18133
+ Forge$2.Easing.str2Easing(this.easing),
16588
18134
  1,
16589
18135
  1
16590
18136
  );
@@ -16598,9 +18144,10 @@ const _sfc_main$r = {
16598
18144
  return null;
16599
18145
  }
16600
18146
  },
16601
- start() {
18147
+ start(customAnim) {
16602
18148
  if (this.innerView) {
16603
- let anim = this._buildAnimation();
18149
+ const a = customAnim ?? this.animation;
18150
+ let anim = this._buildAnimation(a);
16604
18151
  if (anim) {
16605
18152
  this.runningState = STATE_RUNNING;
16606
18153
  this.innerView.StartTextureAnimation(anim);
@@ -16654,7 +18201,7 @@ const _sfc_main$r = {
16654
18201
  },
16655
18202
  activated() {
16656
18203
  if (this.innerView && this.runningState == STATE_PAUSED) {
16657
- let anim = this._buildAnimation();
18204
+ let anim = this._buildAnimation(this.animation);
16658
18205
  this.innerView.StartTextureAnimation(anim);
16659
18206
  }
16660
18207
  },
@@ -16679,7 +18226,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
16679
18226
  "data-jsv-vw-innerview": $setup.innerViewId
16680
18227
  }, null, 12, ["data-jsv-vw-innerview"]);
16681
18228
  }
16682
- const JsvTextureAnim = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$3]]);
18229
+ const JsvTextureAnim = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$3]]);
16683
18230
 
16684
18231
  /*
16685
18232
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvTextureAnim/index.js}
@@ -16703,7 +18250,7 @@ const TexAlignAnchor = JsvTextureAnim.TexAlignAnchor;
16703
18250
  * null: 无滤镜
16704
18251
  * "gray-down": 黑白滤镜(公祭日滤镜)
16705
18252
  */
16706
- const _sfc_main$q = {
18253
+ const _sfc_main$r = {
16707
18254
  __name: "JsvFilterView",
16708
18255
  props: {
16709
18256
  width: {
@@ -16854,7 +18401,7 @@ class LineType extends UpdateType {
16854
18401
  this.end = end;
16855
18402
  }
16856
18403
  }
16857
- const _sfc_main$p = {
18404
+ const _sfc_main$q = {
16858
18405
  props: {
16859
18406
  left: {
16860
18407
  type: Number
@@ -17354,7 +18901,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
17354
18901
  _: 3
17355
18902
  }, 8, ["name", "onAction", "style"]);
17356
18903
  }
17357
- const JsvGrid = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$2]]);
18904
+ const JsvGrid = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$2]]);
17358
18905
 
17359
18906
  /*
17360
18907
  + @file {@link file://./../../../utils/JsViewVueWidget/JsvNativeSharedDiv.vue}
@@ -17372,7 +18919,7 @@ const JsvGrid = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render
17372
18919
  * @param {number} oversize 为了去除黑边的调整选项,让native video的尺寸信息比扣洞大多少, 默认为0
17373
18920
  * @param {boolean} frontLayer 视图是在JsView界面前方,不是需要扣洞的后方,默认为false
17374
18921
  */
17375
- const _sfc_main$o = {
18922
+ const _sfc_main$p = {
17376
18923
  __name: "JsvNativeSharedDiv",
17377
18924
  props: {
17378
18925
  style: {
@@ -17459,7 +19006,7 @@ const _sfc_main$o = {
17459
19006
  top: __props.style.top
17460
19007
  })
17461
19008
  }, [
17462
- unref(vNinePatchSet) != null ? (openBlock(), createBlock(_sfc_main$S, {
19009
+ unref(vNinePatchSet) != null ? (openBlock(), createBlock(_sfc_main$W, {
17463
19010
  key: 0,
17464
19011
  style: normalizeStyle({
17465
19012
  width: __props.style.width,
@@ -17517,7 +19064,7 @@ const _sfc_main$o = {
17517
19064
  * 说明
17518
19065
  * JsvMarquee会识别阿拉伯字符自动设置direction
17519
19066
  */
17520
- const _sfc_main$n = {
19067
+ const _sfc_main$o = {
17521
19068
  __name: "JsvMarquee",
17522
19069
  props: {
17523
19070
  text: {
@@ -17921,7 +19468,7 @@ const _sfc_main$n = {
17921
19468
  * maskHeight{double} 蒙版相对于被遮罩图片高度的百分比(蒙版的高度 / 被遮罩图片的宽)
17922
19469
  *
17923
19470
  */
17924
- const _sfc_main$m = {
19471
+ const _sfc_main$n = {
17925
19472
  props: {
17926
19473
  class: {
17927
19474
  type: String
@@ -18057,7 +19604,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
18057
19604
  })
18058
19605
  }, null, 12, ["data-jsv-vw-innerview"]);
18059
19606
  }
18060
- const JsvMaskClipDiv = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$1]]);
19607
+ const JsvMaskClipDiv = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$1]]);
18061
19608
 
18062
19609
  /*
18063
19610
  + @file {@link file://./../../../utils/JsViewVueWidget/JsvPosterDiv.vue}
@@ -18075,7 +19622,7 @@ const JsvMaskClipDiv = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc
18075
19622
  * 的style设置
18076
19623
  * enableAA: {boolean} 启用非全局的抗锯齿处理,不过这个处理会使绘制的矩形比原尺寸每边少2~3像素点
18077
19624
  */
18078
- const _sfc_main$l = {
19625
+ const _sfc_main$m = {
18079
19626
  __name: "JsvPosterDiv",
18080
19627
  props: {
18081
19628
  style: Object,
@@ -18134,7 +19681,7 @@ const _sfc_main$l = {
18134
19681
  * isPosterImage: 标识是否用于海报位,对于海报位的内容,可以有下载线程控制等策略来优化整体体验
18135
19682
  * enableAA: {boolean} 启用非全局的抗锯齿处理,不过这个处理会使绘制的矩形比原尺寸每边少2~3像素点
18136
19683
  */
18137
- const _sfc_main$k = {
19684
+ const _sfc_main$l = {
18138
19685
  __name: "JsvPosterImage",
18139
19686
  props: {
18140
19687
  colorSpace: {
@@ -18232,7 +19779,7 @@ const _sfc_main$k = {
18232
19779
  * definitionScale 内部文字被放大的倍数,写法为"1.0x", "1.6x"
18233
19780
  * 其他 同div的其他props,例如style, class等
18234
19781
  */
18235
- const _sfc_main$j = {
19782
+ const _sfc_main$k = {
18236
19783
  props: {
18237
19784
  definitionScale: {
18238
19785
  type: String
@@ -18244,7 +19791,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
18244
19791
  renderSlot(_ctx.$slots, "default")
18245
19792
  ], 8, ["data-jsv-vw-text-definition"]);
18246
19793
  }
18247
- const JsvScaleTextBox = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render]]);
19794
+ const JsvScaleTextBox = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render]]);
18248
19795
 
18249
19796
  /*
18250
19797
  + @file {@link file://./../../../utils/JsViewVueWidget/JsvSoundPool.js}
@@ -18256,20 +19803,52 @@ class AudioController {
18256
19803
  this._SoundId = soundId;
18257
19804
  this._Url = url;
18258
19805
  this._StreamId = -1;
19806
+ this._StreamStartTime = 0;
19807
+ this._SubStreamId = -1;
19808
+ this._SubStreamStartTime = 0;
19809
+ this._LatestStreamStartTime = 0;
18259
19810
  this._Rate = 1;
18260
19811
  this._Loop = 0;
18261
19812
  this._LeftVolume = 1;
18262
19813
  this._RightVolume = 1;
18263
19814
  this._Priority = 0;
19815
+ this._FastRepeatGap = 0;
19816
+ }
19817
+ enableFastRepeat(mini_gap) {
19818
+ this._FastRepeatGap = mini_gap;
18264
19819
  }
18265
19820
  /**
18266
19821
  * @description: 播放音频
18267
19822
  */
18268
19823
  play() {
19824
+ if (this._FastRepeatGap == 0) {
19825
+ this._playMainStream(0);
19826
+ } else {
19827
+ let now = Date.now();
19828
+ if (now - this._LatestStreamStartTime > this._FastRepeatGap / 2 && now - this._StreamStartTime > this._FastRepeatGap) {
19829
+ this._playMainStream(now);
19830
+ } else {
19831
+ if (now - this._LatestStreamStartTime > this._FastRepeatGap / 2 && now - this._SubStreamStartTime > this._FastRepeatGap) {
19832
+ this._playSubStream(now);
19833
+ }
19834
+ }
19835
+ }
19836
+ }
19837
+ _playMainStream(now) {
18269
19838
  if (this._StreamId !== -1) {
18270
19839
  this._SoundPool.stop(this._StreamId);
18271
19840
  }
18272
19841
  this._StreamId = this._SoundPool.play(this._SoundId, this._LeftVolume, this._RightVolume, this._Priority, this._Loop, this._Rate);
19842
+ this._StreamStartTime = now;
19843
+ this._LatestStreamStartTime = now;
19844
+ }
19845
+ _playSubStream(now) {
19846
+ if (this._SubStreamId !== -1) {
19847
+ this._SoundPool.stop(this._SubStreamId);
19848
+ }
19849
+ this._SubStreamId = this._SoundPool.play(this._SoundId, this._LeftVolume, this._RightVolume, this._Priority, this._Loop, this._Rate);
19850
+ this._SubStreamStartTime = now;
19851
+ this._LatestStreamStartTime = now;
18273
19852
  }
18274
19853
  /**
18275
19854
  * @description: 暂停音频(Android4.0不支持)
@@ -18278,6 +19857,10 @@ class AudioController {
18278
19857
  if (this._StreamId !== -1) {
18279
19858
  this._SoundPool.pause(this._StreamId);
18280
19859
  }
19860
+ if (this._SubStreamId !== -1) {
19861
+ this._SoundPool.stop(this._SubStreamId);
19862
+ this._SubStreamId = -1;
19863
+ }
18281
19864
  }
18282
19865
  /**
18283
19866
  * @description: 恢复播放音频(Android4.0不支持)
@@ -18295,6 +19878,10 @@ class AudioController {
18295
19878
  this._SoundPool.stop(this._StreamId);
18296
19879
  this._StreamId = -1;
18297
19880
  }
19881
+ if (this._SubStreamId !== -1) {
19882
+ this._SoundPool.stop(this._SubStreamId);
19883
+ this._SubStreamId = -1;
19884
+ }
18298
19885
  }
18299
19886
  /**
18300
19887
  * @description: 设置播放速度
@@ -18302,9 +19889,6 @@ class AudioController {
18302
19889
  */
18303
19890
  setRate(rate) {
18304
19891
  this._Rate = rate;
18305
- if (this._Streamid !== -1) {
18306
- this._SoundPool.setRate(this._StreamId, this._Rate);
18307
- }
18308
19892
  }
18309
19893
  /**
18310
19894
  * @description: 设置音量
@@ -18314,9 +19898,6 @@ class AudioController {
18314
19898
  setVolume(leftVolume, rightVolume) {
18315
19899
  this._LeftVolume = leftVolume;
18316
19900
  this._RightVolume = rightVolume;
18317
- if (this._StreamId !== -1) {
18318
- this._SoundPool.setVolume(this._StreamId, this._LeftVolume, this._RightVolume);
18319
- }
18320
19901
  }
18321
19902
  /**
18322
19903
  * @description: 设置循环次数, 注意: 循环一次表示总共播两次
@@ -18324,9 +19905,6 @@ class AudioController {
18324
19905
  */
18325
19906
  setLoop(loop) {
18326
19907
  this._Loop = loop;
18327
- if (this._StreamId !== -1) {
18328
- this._SoundPool.setLoop(this._StreamId, this._Loop);
18329
- }
18330
19908
  }
18331
19909
  /**
18332
19910
  * @description: 设置优先级
@@ -18334,9 +19912,6 @@ class AudioController {
18334
19912
  */
18335
19913
  setPriority(priority) {
18336
19914
  this._Priority = priority;
18337
- if (this._StreamId !== -1) {
18338
- this._SoundPool.setPriority(this._StreamId, this._Priority);
18339
- }
18340
19915
  }
18341
19916
  }
18342
19917
  class JsvSoundPool {
@@ -18358,6 +19933,28 @@ class JsvSoundPool {
18358
19933
  * @param {function} callback 资源加载完成回调 function(int state, AudioController controller) {}
18359
19934
  */
18360
19935
  request(url, netSetting, priority, callback) {
19936
+ this._request(url, 0, netSetting, priority, callback);
19937
+ }
19938
+ /**
19939
+ * @description: 准备音频资源
19940
+ * @param {string} url 音频url
19941
+ * @param {int} fastRepeatGap 最小间隔时间, 如果不为0则启用快速重复播放, 用两路音轨解决快速播放的漏音问题
19942
+ * @param {string} netSetting http请求配置
19943
+ * @param {int} priority 优先级
19944
+ * @param {function} callback 资源加载完成回调 function(int state, AudioController controller) {}
19945
+ */
19946
+ requestInRepeatMode(url, fastRepeatGap, netSetting, priority, callback) {
19947
+ this._request(url, fastRepeatGap, netSetting, priority, callback);
19948
+ }
19949
+ /**
19950
+ * @description: 准备音频资源
19951
+ * @param {string} url 音频url
19952
+ * @param {int} repeatFastMiniGap 最小间隔时间, 如果不为0则启用快速重复播放, 用两路音轨解决快速播放的漏音问题
19953
+ * @param {string} netSetting http请求配置
19954
+ * @param {int} priority 优先级
19955
+ * @param {function} callback 资源加载完成回调 function(int state, AudioController controller) {}
19956
+ */
19957
+ _request(url, repeatFastMiniGap, netSetting, priority, callback) {
18361
19958
  if (!supportSoundPool) {
18362
19959
  callback(-1, null);
18363
19960
  console.log("not support sound pool.");
@@ -18377,6 +19974,9 @@ class JsvSoundPool {
18377
19974
  referCount: 1
18378
19975
  };
18379
19976
  const controller = new AudioController(this._SoundPool, sound_id, realUrl);
19977
+ if (repeatFastMiniGap > 0) {
19978
+ controller.enableFastRepeat(repeatFastMiniGap);
19979
+ }
18380
19980
  this._StreamIdMap.add(controller);
18381
19981
  callback(state, controller);
18382
19982
  } else {
@@ -18453,7 +20053,7 @@ class JsvSoundPool {
18453
20053
  * latex混合样式样例
18454
20054
  * "测试\\textcolor{#FF0000}{红色并且\\textb{加粗}}文字"
18455
20055
  */
18456
- const _sfc_main$i = {
20056
+ const _sfc_main$j = {
18457
20057
  __name: "JsvTextBox",
18458
20058
  props: {
18459
20059
  style: Object,
@@ -18499,7 +20099,7 @@ const _sfc_main$i = {
18499
20099
  return props.enableLatex ? 1 : 0;
18500
20100
  });
18501
20101
  return (_ctx, _cache) => {
18502
- return openBlock(), createBlock(unref(_sfc_main$G), {
20102
+ return openBlock(), createBlock(unref(_sfc_main$K), {
18503
20103
  style: normalizeStyle({
18504
20104
  ...props.style,
18505
20105
  flexDirection: "row",
@@ -18547,7 +20147,7 @@ const _sfc_main$i = {
18547
20147
  * 补充说明:
18548
20148
  * 该控件以左上角为顶点旋转渲染,所以图片中带边框的正三角形的三个顶点应该为:左上,右上,左下;请调整图的朝向。
18549
20149
  */
18550
- const _sfc_main$h = {
20150
+ const _sfc_main$i = {
18551
20151
  __name: "JsvRadarChart",
18552
20152
  props: {
18553
20153
  style: {
@@ -18789,7 +20389,7 @@ const JsvRippleShape = {
18789
20389
  * 参数:
18790
20390
  * token: 波源的token
18791
20391
  */
18792
- const _sfc_main$g = {
20392
+ const _sfc_main$h = {
18793
20393
  __name: "JsvRipple",
18794
20394
  props: {
18795
20395
  width: {
@@ -18958,7 +20558,7 @@ const JsvLine_vue_vue_type_style_index_0_scoped_5a074e31_lang = "";
18958
20558
  * borderRadius {Number} 圆角半径
18959
20559
  *
18960
20560
  */
18961
- const _sfc_main$f = {
20561
+ const _sfc_main$g = {
18962
20562
  __name: "JsvLine",
18963
20563
  props: {
18964
20564
  startPos: { type: Object, require: true },
@@ -19019,7 +20619,7 @@ const _sfc_main$f = {
19019
20619
  };
19020
20620
  const styleSheetsContent = { "0": { "fadeIn-5a074e31": "@keyframes fadeIn-5a074e31 {0%{opacity:0;}100%{opacity:1;}}", "fadeOut-5a074e31": "@keyframes fadeOut-5a074e31 {0%{opacity:1;}100%{opacity:0;}}" } };
19021
20621
  window.JsvCode.Dom.DeclareStyleSheets(styleSheetsContent);
19022
- const JsvLine = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-5a074e31"]]);
20622
+ const JsvLine = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-5a074e31"]]);
19023
20623
 
19024
20624
  /*
19025
20625
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvLine/index.js}
@@ -19041,7 +20641,7 @@ const JsvLine = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
19041
20641
  * extraTime {Number} 可选配置(饼图用)扇形运动额外时间
19042
20642
  *
19043
20643
  */
19044
- const _sfc_main$e = {
20644
+ const _sfc_main$f = {
19045
20645
  __name: "JsvSector",
19046
20646
  props: {
19047
20647
  centerPosition: { type: Object, require: true },
@@ -19150,7 +20750,7 @@ const _sfc_main$e = {
19150
20750
  * data {Array} 数组对象,包含百分比和颜色。例如:[{color:'#FFFFFF',percent:20}]
19151
20751
  * 说明:传入的数组要为响应式,且保证所有项的percent都是大于0并且相加等于100
19152
20752
  */
19153
- const _sfc_main$d = {
20753
+ const _sfc_main$e = {
19154
20754
  __name: "JsvPieChart",
19155
20755
  props: {
19156
20756
  centerPosition: { type: Object, required: true },
@@ -19236,7 +20836,7 @@ const _sfc_main$d = {
19236
20836
  }, [
19237
20837
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(finalData).slice().reverse(), (item, index) => {
19238
20838
  return openBlock(), createElementBlock("div", null, [
19239
- (openBlock(), createBlock(_sfc_main$e, {
20839
+ (openBlock(), createBlock(_sfc_main$f, {
19240
20840
  radius: props.radius,
19241
20841
  config: {
19242
20842
  startAngle: Number(item.startAngle),
@@ -19340,7 +20940,7 @@ class ConnectLineTexture {
19340
20940
  * RoundSet {Object} 圆角配置对象,可选开始拐点和结束拐点,false代表不配置,true代表配置。属性值:start,end
19341
20941
  *
19342
20942
  */
19343
- const _sfc_main$c = {
20943
+ const _sfc_main$d = {
19344
20944
  __name: "JsvConnectLine",
19345
20945
  props: {
19346
20946
  startPos: {
@@ -19606,7 +21206,7 @@ const _sfc_main$c = {
19606
21206
  * progress {Number} (可选) 进度条的百分比进度。有效值:0-100
19607
21207
  * isCanvas {Boolean} (可选) 进度条的展示样式:①点九 ②clipView 默认为true,即点九样式。
19608
21208
  */
19609
- const _sfc_main$b = {
21209
+ const _sfc_main$c = {
19610
21210
  __name: "JsvProgressBar",
19611
21211
  props: {
19612
21212
  width: { type: Number, required: true },
@@ -19683,7 +21283,7 @@ const _sfc_main$b = {
19683
21283
  return openBlock(), createElementBlock(Fragment, null, [
19684
21284
  props.isCanvas ? (openBlock(), createElementBlock("div", { key: 0 }, [
19685
21285
  withDirectives(createElementVNode("div", null, [
19686
- createVNode(_sfc_main$S, {
21286
+ createVNode(_sfc_main$W, {
19687
21287
  style: normalizeStyle({
19688
21288
  left: 0,
19689
21289
  top: 0,
@@ -19725,7 +21325,7 @@ const _sfc_main$b = {
19725
21325
  }, null, 4)
19726
21326
  ], 4)
19727
21327
  ])),
19728
- createVNode(_sfc_main$S, {
21328
+ createVNode(_sfc_main$W, {
19729
21329
  style: normalizeStyle({
19730
21330
  left: 0,
19731
21331
  top: 0,
@@ -19747,7 +21347,7 @@ const _sfc_main$b = {
19747
21347
  /*
19748
21348
  + @file {@link file://./../../../utils/JsViewVueWidget/JsvEnableRenderBreak.vue}
19749
21349
  */
19750
- const _sfc_main$a = {
21350
+ const _sfc_main$b = {
19751
21351
  __name: "JsvEnableRenderBreak",
19752
21352
  setup(__props) {
19753
21353
  const itemMounted = shallowRef(false);
@@ -20910,7 +22510,7 @@ function multiSelect(arr, left, right, n, compare) {
20910
22510
  * 获取当前拖拽块的位置
20911
22511
  *
20912
22512
  */
20913
- const _sfc_main$9 = {
22513
+ const _sfc_main$a = {
20914
22514
  __name: "JsvDragBox",
20915
22515
  props: {
20916
22516
  boxRect: {
@@ -21152,7 +22752,7 @@ const _sfc_main$9 = {
21152
22752
  * layer模式的节点, 有一个子方向, 其子方向是所有子所在的一侧方向(只有上下左右四侧), 若无子, 则父方向的反向为子方向. 确定了父方向和子方向后, 剩余两个方向则寻找该方向最近的兄弟节点, 若无则寻找最近分支上最近的同级或者叶节点
21153
22753
  * star模式的节点, 除了父方向, 剩余三个方向均寻找相应方向的最近子节点, 若未找到则按layer寻找兄弟节点相同的逻辑寻找同级节点
21154
22754
  */
21155
- const _sfc_main$8 = {
22755
+ const _sfc_main$9 = {
21156
22756
  __name: "JsvMindMap",
21157
22757
  props: {
21158
22758
  name: {
@@ -21799,7 +23399,7 @@ const ScrollInnerStyle = {
21799
23399
  /*
21800
23400
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue?vue&type=script&setup=true&lang.ts}
21801
23401
  */
21802
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
23402
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
21803
23403
  __name: "JsvScrollBox",
21804
23404
  props: {
21805
23405
  // 底座的尺寸
@@ -22181,7 +23781,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
22181
23781
  /*
22182
23782
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue?vue&type=script&setup=true&lang.ts}
22183
23783
  */
22184
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
23784
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
22185
23785
  __name: "JsvScrollFollow",
22186
23786
  props: {
22187
23787
  proxyType: null,
@@ -22481,7 +24081,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
22481
24081
  key: 1,
22482
24082
  ref_key: "rSliderViewRef",
22483
24083
  ref: rSliderViewRef
22484
- }, unref(rSizeDivProps)), null, 16)) : unref(cProxyType) == unref(ScrollBoxStyle).JsvNinePatch ? (openBlock(), createBlock(_sfc_main$S, mergeProps({
24084
+ }, unref(rSizeDivProps)), null, 16)) : unref(cProxyType) == unref(ScrollBoxStyle).JsvNinePatch ? (openBlock(), createBlock(_sfc_main$W, mergeProps({
22485
24085
  key: 2,
22486
24086
  onDivRef: onNinePatchRef
22487
24087
  }, unref(rNinePatchMergedProps)), null, 16)) : createCommentVNode("", true);
@@ -22544,6 +24144,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
22544
24144
  * @prop {Array} uniforms uniform参数, [{ name: string, value: number }]
22545
24145
  * @prop {Array} textures texture参数, [{ name: string, resource: string }]
22546
24146
  * @prop {() => void} onStart 动画开始回调
24147
+ * @prop {boolean} reverseAnimate 是否反向动画
22547
24148
  * @prop {(int,boolean) => void} onEnd
22548
24149
  * 动画结束回调,
22549
24150
  * 返回值1号 int: 回到参数为动画的序列号,和startAnim的返回值匹配
@@ -22571,7 +24172,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
22571
24172
  * * 由于坐标系的差异, texture()采样函数需要替换为jsvTexture2D()
22572
24173
  * * 盒子端的精度有限, 可能会出现精度导致的计算错误
22573
24174
  */
22574
- const _sfc_main$5 = {
24175
+ const _sfc_main$6 = {
22575
24176
  __name: "JsvFragShaderView",
22576
24177
  props: {
22577
24178
  style: {
@@ -22586,6 +24187,10 @@ const _sfc_main$5 = {
22586
24187
  type: Boolean,
22587
24188
  default: false
22588
24189
  },
24190
+ reverseAnimate: {
24191
+ type: Boolean,
24192
+ default: false
24193
+ },
22589
24194
  shaderStr: {
22590
24195
  type: String,
22591
24196
  required: true
@@ -22608,7 +24213,6 @@ const _sfc_main$5 = {
22608
24213
  setup(__props, { expose }) {
22609
24214
  const rProps = __props;
22610
24215
  JsvUseFeature("JsvFragShaderView", FeatureNames.CustomFragShader);
22611
- console.log("LudlDebug using JsvFragShaderView...");
22612
24216
  let rAnimRunning = shallowRef(false);
22613
24217
  let vPreloadHandler = null;
22614
24218
  let vPreloadDone = false;
@@ -22648,19 +24252,19 @@ const _sfc_main$5 = {
22648
24252
  });
22649
24253
  preload_textures.push(new JsvTextureLoadTool.ItemSet(image_url));
22650
24254
  }
22651
- vPreloadHandler = JsvTextureLoadTool.preload(preload_textures, () => {
22652
- vPreloadDone = true;
22653
- vPreloadHandler.recycleResource();
22654
- vPreloadHandler = null;
22655
- if (vStartingPromise != null) {
22656
- vStartingPromise.resolve();
22657
- }
22658
- });
22659
- if (vPreloadHandler == null) {
22660
- vPreloadDone = true;
22661
- if (vStartingPromise != null) {
22662
- vStartingPromise.resolve();
22663
- }
24255
+ }
24256
+ vPreloadHandler = JsvTextureLoadTool.preload(preload_textures, () => {
24257
+ vPreloadDone = true;
24258
+ vPreloadHandler.recycleResource();
24259
+ vPreloadHandler = null;
24260
+ if (vStartingPromise != null) {
24261
+ vStartingPromise.resolve();
24262
+ }
24263
+ });
24264
+ if (vPreloadHandler == null) {
24265
+ vPreloadDone = true;
24266
+ if (vStartingPromise != null) {
24267
+ vStartingPromise.resolve();
22664
24268
  }
22665
24269
  }
22666
24270
  }
@@ -22682,7 +24286,7 @@ const _sfc_main$5 = {
22682
24286
  vStartAnimTimeoutId = -1;
22683
24287
  }
22684
24288
  }
22685
- const startAnim = (alt_duration, on_timeout_func) => {
24289
+ const startAnim = (alt_duration, on_timeout_func, reverse = false) => {
22686
24290
  vStartingPromise = null;
22687
24291
  rAnimRunning.value = false;
22688
24292
  vStartToken++;
@@ -22713,7 +24317,9 @@ const _sfc_main$5 = {
22713
24317
  vStartingPromise = null;
22714
24318
  if (duration > 0) {
22715
24319
  let shaderAnimation = new Forge$2.ShaderAnimation(duration, null);
22716
- shaderAnimation.Enable(1);
24320
+ shaderAnimation.Enable(
24321
+ 1 | (reverse ? Forge$2.AnimationEnable.Reverse : 0)
24322
+ );
22717
24323
  shaderAnimation.SetAnimationListener(
22718
24324
  new Forge$2.AnimationListener(
22719
24325
  null,
@@ -22747,7 +24353,7 @@ const _sfc_main$5 = {
22747
24353
  };
22748
24354
  onMounted(() => {
22749
24355
  if (rProps.autoplay) {
22750
- startAnim(rProps.duration);
24356
+ startAnim(rProps.duration, void 0, rProps.reverseAnimate);
22751
24357
  }
22752
24358
  });
22753
24359
  onUnmounted(() => {
@@ -22783,7 +24389,7 @@ const _sfc_main$5 = {
22783
24389
  /*
22784
24390
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue?vue&type=script&setup=true&lang.ts}
22785
24391
  */
22786
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
24392
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
22787
24393
  __name: "JsvClipDiv",
22788
24394
  props: {
22789
24395
  style: null
@@ -22831,7 +24437,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
22831
24437
  /*
22832
24438
  + @file {@link file://./../../../../utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue?vue&type=script&setup=true&lang.ts}
22833
24439
  */
22834
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
24440
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
22835
24441
  __name: "JsvDriftScope",
22836
24442
  props: {
22837
24443
  top: { default: 0 },
@@ -22858,7 +24464,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
22858
24464
  style: normalizeStyle(unref(rMergedFrameStyle)),
22859
24465
  "data-jsv-vw-mask-drift": "true"
22860
24466
  }, [
22861
- createVNode(_sfc_main$4, {
24467
+ createVNode(_sfc_main$5, {
22862
24468
  style: normalizeStyle(rProps.scopeStyle)
22863
24469
  }, {
22864
24470
  default: withCtx(() => [
@@ -22926,7 +24532,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
22926
24532
  * 在MetroWidget的item中,如需监听交互模式变动, 为了避免过多回调, 一般在onFocus中注册, 在onBlur中注销
22927
24533
  *
22928
24534
  */
22929
- const _sfc_main$2 = {
24535
+ const _sfc_main$3 = {
22930
24536
  __name: "JsvTouchModeSwitcher",
22931
24537
  props: {
22932
24538
  width: {
@@ -23012,7 +24618,7 @@ const _sfc_main$2 = {
23012
24618
  /*
23013
24619
  + @file {@link file://./../../../utils/JsViewVueWidget/Jsv3dDiv.vue?vue&type=script&setup=true&lang.ts}
23014
24620
  */
23015
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
24621
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
23016
24622
  __name: "Jsv3dDiv",
23017
24623
  props: {
23018
24624
  style: { default: null },
@@ -23077,7 +24683,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23077
24683
  /*
23078
24684
  + @file {@link file://./../../../utils/JsViewVueWidget/Jsv3dStage.vue?vue&type=script&setup=true&lang.ts}
23079
24685
  */
23080
- const _sfc_main = /* @__PURE__ */ defineComponent({
24686
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23081
24687
  __name: "Jsv3dStage",
23082
24688
  props: {
23083
24689
  style: { default: {
@@ -23124,6 +24730,134 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23124
24730
  透视效果适中的场景: 1000~2000
23125
24731
  */
23126
24732
 
24733
+ /*
24734
+ + @file {@link file://./../../../utils/JsViewVueWidget/JsvDashPath.vue}
24735
+ */
24736
+ /*
24737
+ * @file
24738
+ *
24739
+ * 【模块 export 内容】
24740
+ * JsvDashPath:Vue组件,用于绘制虚线路径
24741
+ * layout {Object}: (必填)组件位置,格式为 {left: number, top: number}
24742
+ * points {Array}: (必填)点数组,每个点包含 x 和 y 坐标,坐标是相对于layout中指定的left和top
24743
+ * 格式为 [{x: number, y: number}, ...]
24744
+ * dash {Array}: 虚线配置数组,例如 [10, 5] 表示10px实线,5px空白,默认值 [10, 10]
24745
+ * phase {Number}: 虚线起始位置偏移,默认值 0
24746
+ * color {String}: 线条颜色,默认值 "#FFFFFF"
24747
+ * lineWidth {Number}: 线条宽度,默认值 2
24748
+ *
24749
+ * 注意事项:
24750
+ * 组件会根据传入的points自动计算所需画布大小
24751
+ * 组件会在卸载时自动清理创建的纹理资源
24752
+ */
24753
+ const _sfc_main = {
24754
+ __name: "JsvDashPath",
24755
+ props: {
24756
+ // 组件位置 {left: number, top: number}
24757
+ layout: {
24758
+ type: Object,
24759
+ required: true
24760
+ },
24761
+ // 点数组,每个点包含 x 和 y 坐标, 坐标是相对与layout中指定的left和top
24762
+ points: {
24763
+ type: Array,
24764
+ required: true,
24765
+ validator: (value) => {
24766
+ return value.every((point) => "x" in point && "y" in point);
24767
+ }
24768
+ },
24769
+ // 虚线配置,例如 [10, 5] 表示10px实线,5px空白
24770
+ dash: {
24771
+ type: Array,
24772
+ default: () => [10, 10]
24773
+ },
24774
+ // 虚线起始位置偏移
24775
+ phase: {
24776
+ type: Number,
24777
+ default: 0
24778
+ },
24779
+ // 线条颜色
24780
+ color: {
24781
+ type: String,
24782
+ default: "#FFFFFF"
24783
+ },
24784
+ // 线条宽度
24785
+ lineWidth: {
24786
+ type: Number,
24787
+ default: 2
24788
+ }
24789
+ },
24790
+ setup(__props) {
24791
+ const props = __props;
24792
+ const canvasInfo = computed(() => {
24793
+ const xValues = props.points.map((p) => p.x);
24794
+ const yValues = props.points.map((p) => p.y);
24795
+ const minX = Math.min(...xValues);
24796
+ const minY = Math.min(...yValues);
24797
+ const lineOffset = Math.ceil(props.lineWidth / 2);
24798
+ const width = Math.max(...xValues) - minX + props.lineWidth * 2;
24799
+ const height = Math.max(...yValues) - minY + props.lineWidth * 2;
24800
+ return {
24801
+ minX,
24802
+ minY,
24803
+ lineOffset,
24804
+ width,
24805
+ height
24806
+ };
24807
+ });
24808
+ let sourceId = "";
24809
+ const canvasRef = sTextureStoreApi.canvasTexture(
24810
+ canvasInfo.value.width,
24811
+ canvasInfo.value.height
24812
+ );
24813
+ canvasRef.drawColor("rgba(0,0,0,0)");
24814
+ const path = canvasRef.customPath();
24815
+ if (props.points.length > 0) {
24816
+ const firstPoint = props.points[0];
24817
+ path.moveTo(
24818
+ firstPoint.x - canvasInfo.value.minX + canvasInfo.value.lineOffset,
24819
+ firstPoint.y - canvasInfo.value.minY + canvasInfo.value.lineOffset
24820
+ );
24821
+ for (let i = 1; i < props.points.length; i++) {
24822
+ const point = props.points[i];
24823
+ path.lineTo(
24824
+ point.x - canvasInfo.value.minX + canvasInfo.value.lineOffset,
24825
+ point.y - canvasInfo.value.minY + canvasInfo.value.lineOffset
24826
+ );
24827
+ }
24828
+ path.close();
24829
+ }
24830
+ path.strokeWithSetting({
24831
+ lineWidth: props.lineWidth,
24832
+ color: props.color,
24833
+ dash: props.dash,
24834
+ phase: props.phase
24835
+ });
24836
+ sourceId = canvasRef.commit();
24837
+ onBeforeUnmount(() => {
24838
+ sTextureStoreApi.deleteTexture(sourceId);
24839
+ });
24840
+ return (_ctx, _cache) => {
24841
+ return openBlock(), createElementBlock("div", {
24842
+ style: normalizeStyle({
24843
+ left: __props.layout.left,
24844
+ top: __props.layout.top
24845
+ })
24846
+ }, [
24847
+ createElementVNode("div", {
24848
+ style: normalizeStyle({
24849
+ left: unref(canvasInfo).minX,
24850
+ top: unref(canvasInfo).minY,
24851
+ width: unref(canvasInfo).width,
24852
+ height: unref(canvasInfo).height,
24853
+ backgroundImage: `url(jsvtexturestore://${unref(sourceId)})`
24854
+ })
24855
+ }, null, 4)
24856
+ ], 4);
24857
+ };
24858
+ }
24859
+ };
24860
+
23127
24861
  /*
23128
24862
  + @file {@link file://./../../../utils/JsViewVueWidget/index.js}
23129
24863
  */
@@ -23132,4 +24866,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23132
24866
  + @file {@link file://./../../utils/index.js}
23133
24867
  */
23134
24868
 
23135
- export { BaseDispatcher, DECORATE_BORDER_RADIUS, DECORATE_NINEPATCH_ALPHA_MIX, DebugObjectRefer, DebugTools, DebugWrap81ErrorStack, DebugWrap81WarnStack, DefaultKeyCodeMap, EdgeDirection, FeatureNames, FixPositionSlide, FocusMoveType, ForgeConst, ForgeTextureApis, FreeMoveDef, FreeMoveFunc, HORIZONTAL, InputType, instance as JSBridge, _sfc_main$1 as Jsv3dDiv, _sfc_main as Jsv3dStage, JsvAccount, JsvActiveFeature, _sfc_main$J as JsvActorMove, JsvActorMoveControl, index$1 as JsvApic, index as JsvApic2, _sfc_main$M as JsvAudio, _sfc_main$4 as JsvClipDiv, _sfc_main$c as JsvConnectLine, _sfc_main$9 as JsvDragBox, _sfc_main$3 as JsvDriftScope, _sfc_main$a as JsvEnableRenderBreak, _sfc_main$H as JsvEnvBlocker, FeatureNames as JsvFeatureNames, JsvFederationTools, _sfc_main$q as JsvFilterView, _sfc_main$G as JsvFlexDiv, _sfc_main$O as JsvFocusBlock, _sfc_main$5 as JsvFragShaderView, _sfc_main$I as JsvFreeMoveActor, _sfc_main$I as JsvFreeMoveDiv, _sfc_main$E as JsvFullScrAdjust, JsvGrid, _sfc_main$o as JsvHole, JsvInput, _sfc_main$K as JsvLatex, JsvLine, _sfc_main$n as JsvMarquee, JsvMaskClipDiv, _sfc_main$8 as JsvMindMap, _sfc_main$o as JsvNativeSharedDiv, _sfc_main$S as JsvNinePatch, JsvPerformance, _sfc_main$d as JsvPieChart, _sfc_main$l as JsvPosterDiv, _sfc_main$k as JsvPosterImage, exportObj as JsvPreDownloader, _sfc_main$z as JsvPreload, _sfc_main$b as JsvProgressBar, JsvQrcode, _sfc_main$h as JsvRadarChart, _sfc_main$g as JsvRipple, JsvRippleShape, JsvScaleTextBox, _sfc_main$F as JsvScreenFlex, _sfc_main$7 as JsvScrollBox, _sfc_main$6 as JsvScrollFollow, _sfc_main$e as JsvSector, JsvShutdownFeatures, JsvSoundPool, _sfc_main$x as JsvSpray, JsvSpriteAnim, _sfc_main$v as JsvSpriteLoader, JsvSpriteAnim as JsvSpriteStatic, JsvSpriteTools, JsvStyleClass, JsvStyleSheetsDeclarer, JsvSwiper, _sfc_main$s as JsvSwiper3D, _sfc_main$i as JsvTextBox, JsvTextStyleClass, JsvTextureAnim, sJsvTextureConst as JsvTextureConst, JsvTextureLoadTool, sTextureStoreApi as JsvTextureStoreApi, _sfc_main$2 as JsvTouchModeSwitcher, _sfc_main$o as JsvTransparentDiv, JsvUseFeature, JsvVisibleSensor, LineType, _sfc_main$P as ListWidget, METRO_WIDGET, METRO_WIDGET as METRO_WIDGET_CONST, _sfc_main$Q as MetroWidget, PageType, RENDER_ITEM_BREAK_KEY, Dispatcher as SWidgetDispatcher, ScrollBoxStyle, SeamlessSlide, _sfc_main$Q as SimpleWidget, SlideSetting, SlideStyle, SpriteController, TexAlignAnchor, TextTools, TextureInstantType, VERTICAL, WholePageSlide, buildDownloadInfo, buildPreloadInfo, combinedStyles, createImpactAutoFroze, createImpactCallback, createImpactTracer, getCssStyleGroup, getCurFrameCount, getKeyFramesGroup, getMeasureObj, getPositionRelativeToView, getTextWidth, globalLoadJsvAudioPlugin, globalLoadJsvLatexPlugin, bridge as jJsvRuntimeBridge, jsvCreateFocusManager, jsvCreateHashHistory, numberCheckSet, processLatexStr, toHtmlBorderSet, toNinePatchForgeViewSet, updateImpactAutoFroze, urlCheckSet, useFocusHub };
24869
+ export { BaseDispatcher, CaptureProcessType, DECORATE_BORDER_RADIUS, DECORATE_NINEPATCH_ALPHA_MIX, DebugObjectRefer, DebugTools, DebugWrap81ErrorStack, DebugWrap81WarnStack, DefaultKeyCodeMap, EdgeDirection, FeatureNames, FixPositionSlide, FocusMoveType, ForgeConst, ForgeTextureApis, FreeMoveDef, FreeMoveFunc, HORIZONTAL, InputType, instance as JSBridge, _sfc_main$2 as Jsv3dDiv, _sfc_main$1 as Jsv3dStage, JsvAccount, JsvActiveFeature, _sfc_main$N as JsvActorMove, JsvActorMoveControl, index$1 as JsvApic, index as JsvApic2, _sfc_main$Q as JsvAudio, _sfc_main$5 as JsvClipDiv, _sfc_main$d as JsvConnectLine, _sfc_main as JsvDashPath, _sfc_main$a as JsvDragBox, _sfc_main$4 as JsvDriftScope, _sfc_main$b as JsvEnableRenderBreak, _sfc_main$L as JsvEnvBlocker, FeatureNames as JsvFeatureNames, JsvFederationTools, _sfc_main$r as JsvFilterView, _sfc_main$K as JsvFlexDiv, _sfc_main$S as JsvFocusBlock, _sfc_main$6 as JsvFragShaderView, _sfc_main$M as JsvFreeMoveActor, _sfc_main$M as JsvFreeMoveDiv, _sfc_main$I as JsvFullScrAdjust, JsvGrid, _sfc_main$p as JsvHole, JsvInput, _sfc_main$O as JsvLatex, JsvLine, _sfc_main$o as JsvMarquee, JsvMaskClipDiv, _sfc_main$9 as JsvMindMap, _sfc_main$p as JsvNativeSharedDiv, _sfc_main$W as JsvNinePatch, JsvPerformance, _sfc_main$e as JsvPieChart, _sfc_main$m as JsvPosterDiv, _sfc_main$l as JsvPosterImage, exportObj as JsvPreDownloader, _sfc_main$D as JsvPreload, _sfc_main$c as JsvProgressBar, JsvQrcode, _sfc_main$i as JsvRadarChart, _sfc_main$h as JsvRipple, JsvRippleShape, JsvScaleTextBox, _sfc_main$J as JsvScreenFlex, _sfc_main$8 as JsvScrollBox, _sfc_main$7 as JsvScrollFollow, _sfc_main$f as JsvSector, JsvShutdownFeatures, _sfc_main$u as JsvSmoothSwiper, JsvSoundPool, _sfc_main$B as JsvSpray, JsvSpriteAnim, _sfc_main$z as JsvSpriteLoader, JsvSpriteAnim as JsvSpriteStatic, JsvSpriteTools, JsvStyleClass, JsvStyleSheetsDeclarer, JsvSwiper, _sfc_main$w as JsvSwiper2, _sfc_main$t as JsvSwiper3D, _sfc_main$j as JsvTextBox, JsvTextStyleClass, JsvTextureAnim, sJsvTextureConst as JsvTextureConst, JsvTextureLoadTool, sTextureStoreApi as JsvTextureStoreApi, _sfc_main$3 as JsvTouchModeSwitcher, _sfc_main$p as JsvTransparentDiv, JsvUseFeature, JsvVisibleSensor, LineType, _sfc_main$T as ListWidget, METRO_WIDGET, METRO_WIDGET as METRO_WIDGET_CONST, _sfc_main$U as MetroWidget, PageType, RENDER_ITEM_BREAK_KEY, Dispatcher as SWidgetDispatcher, ScrollBoxStyle, SeamlessSlide, _sfc_main$U as SimpleWidget, SlideSetting, SlideStyle, SpriteController, TexAlignAnchor, TextTools, TextureInstantType, VERTICAL, WholePageSlide, buildDownloadInfo, buildPreloadInfo, combinedStyles, createImpactAutoFroze, createImpactCallback, createImpactTracer, getCssStyleGroup, getCurFrameCount, getKeyFramesGroup, getMeasureObj, getPositionRelativeToView, getTextWidth, globalLoadJsvAudioPlugin, globalLoadJsvLatexPlugin, bridge as jJsvRuntimeBridge, jsvCreateFocusManager, jsvCreateHashHistory, numberCheckSet, processLatexStr, toHtmlBorderSet, toNinePatchForgeViewSet, updateImpactAutoFroze, urlCheckSet, useFocusHub };