@shijiu/jsview-vue 2.1.367-test.0 → 2.1.435
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/jsview-vue.mjs +654 -460
- package/package.json +1 -1
- package/tools/config/vite.config.ts +1 -0
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +4 -8
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +8 -10
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +194 -167
- package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.ts +7 -3
- package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +8 -5
- package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +173 -0
- package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +4 -0
- package/utils/JsViewVueTools/JsvTextureDefines.ts +11 -0
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.ts +27 -3
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.ts +1 -1
- package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +0 -28
- package/utils/JsViewVueTools/index.js +1 -0
- package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +118 -0
- package/utils/JsViewVueWidget/JsvFlexCell/index.js +6 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +29 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +4 -0
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +26 -25
- package/utils/JsViewVueWidget/JsvPieChart.vue +37 -37
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +29 -9
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +41 -30
- package/utils/JsViewVueWidget/JsvTextBox.vue +20 -34
- package/utils/JsViewVueWidget/index.js +1 -0
- package/utils/JsViewEngineWidget/MetroWidget/AnimationManager.ts +0 -189
package/bin/jsview-vue.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ref, computed, toRaw, reactive, nextTick, onMounted, onUpdated, onBeforeUnmount, onBeforeUpdate, openBlock, createElementBlock, renderSlot, shallowRef, resolveComponent, normalizeStyle, createElementVNode, unref, createVNode, withCtx, Fragment, renderList, createCommentVNode, inject, provide, onUnmounted, onActivated, onDeactivated, createBlock, watchEffect, toDisplayString, watch,
|
|
1
|
+
import { ref, computed, toRaw, reactive, nextTick, onMounted, onUpdated, onBeforeUnmount, onBeforeUpdate, openBlock, createElementBlock, renderSlot, shallowRef, resolveComponent, normalizeStyle, createElementVNode, unref, createVNode, withCtx, Fragment, renderList, createCommentVNode, inject, provide, onUnmounted, onActivated, onDeactivated, createBlock, watchEffect, mergeProps, toDisplayString, watch, shallowReactive, withDirectives, vShow } from 'vue';
|
|
2
2
|
import { Forge as Forge$1, ForgeExtension } from '@shijiu/jsview/dom/jsv-forge-define';
|
|
3
3
|
import { L as LoopType } from './jsview-vue-common.mjs';
|
|
4
4
|
export { A as ApicEndState } from './jsview-vue-common.mjs';
|
|
5
5
|
import { _ as _export_sfc } from './export-sfc.mjs';
|
|
6
|
+
import { Forge as Forge$2 } from '@shijiu/jsview/dom/jsv-forge-define.mjs';
|
|
6
7
|
import { createWebHashHistory, createMemoryHistory } from 'vue-router';
|
|
7
8
|
|
|
8
9
|
//!
|
|
@@ -2183,6 +2184,10 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
2183
2184
|
return [start, end];
|
|
2184
2185
|
}
|
|
2185
2186
|
updateItemSize(index, newSize) {
|
|
2187
|
+
const item = this.templateList[index];
|
|
2188
|
+
if (!item || item.width == newSize.width && item.height == newSize.height) {
|
|
2189
|
+
return;
|
|
2190
|
+
}
|
|
2186
2191
|
const needChangeList = this.templateList.splice(index);
|
|
2187
2192
|
needChangeList[0].width = newSize.width;
|
|
2188
2193
|
needChangeList[0].height = newSize.height;
|
|
@@ -2264,11 +2269,14 @@ class PageUpdater {
|
|
|
2264
2269
|
this.applyTmp();
|
|
2265
2270
|
} else {
|
|
2266
2271
|
}
|
|
2272
|
+
},
|
|
2273
|
+
recover: () => {
|
|
2274
|
+
this.rangeSet = preRangeSet;
|
|
2275
|
+
this.tmpRangeSet = preTmpRangeSet;
|
|
2267
2276
|
}
|
|
2268
2277
|
};
|
|
2269
2278
|
}
|
|
2270
2279
|
apply() {
|
|
2271
|
-
this.tmpRangeSet.clear();
|
|
2272
2280
|
this.updateFunc(this.rangeSet);
|
|
2273
2281
|
}
|
|
2274
2282
|
applyTmp() {
|
|
@@ -2289,7 +2297,7 @@ class PageUpdater {
|
|
|
2289
2297
|
//!
|
|
2290
2298
|
;
|
|
2291
2299
|
class RenderItem {
|
|
2292
|
-
divMountedCallback =
|
|
2300
|
+
divMountedCallback = /* @__PURE__ */ new Set();
|
|
2293
2301
|
customerData;
|
|
2294
2302
|
templateInfo;
|
|
2295
2303
|
renderStyle;
|
|
@@ -2378,18 +2386,20 @@ class RenderItem {
|
|
|
2378
2386
|
}
|
|
2379
2387
|
}
|
|
2380
2388
|
addDivMountedListener(cbk) {
|
|
2381
|
-
this.divMountedCallback.
|
|
2382
|
-
|
|
2389
|
+
this.divMountedCallback.add(cbk);
|
|
2390
|
+
return () => {
|
|
2391
|
+
this.divMountedCallback.delete(cbk);
|
|
2392
|
+
};
|
|
2383
2393
|
}
|
|
2384
2394
|
onDivMounted() {
|
|
2385
|
-
if (this.divMountedCallback.
|
|
2395
|
+
if (this.divMountedCallback.size > 0) {
|
|
2386
2396
|
this.divMountedCallback.forEach((cbk) => {
|
|
2387
2397
|
if (this.rootDiv) {
|
|
2388
2398
|
cbk(this.rootDiv);
|
|
2389
2399
|
}
|
|
2390
2400
|
});
|
|
2391
2401
|
}
|
|
2392
|
-
this.divMountedCallback
|
|
2402
|
+
this.divMountedCallback.clear();
|
|
2393
2403
|
if (this.enableTap && this.rootDiv) {
|
|
2394
2404
|
const divView = this.rootDiv.jsvGetProxyView();
|
|
2395
2405
|
divView.DragEnables?.(1);
|
|
@@ -2397,7 +2407,7 @@ class RenderItem {
|
|
|
2397
2407
|
}
|
|
2398
2408
|
onDivUnmounted() {
|
|
2399
2409
|
this.touchInit = false;
|
|
2400
|
-
this.divMountedCallback
|
|
2410
|
+
this.divMountedCallback.clear();
|
|
2401
2411
|
}
|
|
2402
2412
|
}
|
|
2403
2413
|
|
|
@@ -2478,144 +2488,6 @@ class WidgetRectInfo {
|
|
|
2478
2488
|
}
|
|
2479
2489
|
}
|
|
2480
2490
|
|
|
2481
|
-
//!
|
|
2482
|
-
//! utils/JsViewEngineWidget/MetroWidget/AnimationManager.ts;
|
|
2483
|
-
//!
|
|
2484
|
-
var TaskType = /* @__PURE__ */ ((TaskType2) => {
|
|
2485
|
-
TaskType2[TaskType2["RESIZE_ITEM"] = 0] = "RESIZE_ITEM";
|
|
2486
|
-
TaskType2[TaskType2["SLIDE"] = 1] = "SLIDE";
|
|
2487
|
-
TaskType2[TaskType2["ON_FOCUS_CHANGE"] = 2] = "ON_FOCUS_CHANGE";
|
|
2488
|
-
return TaskType2;
|
|
2489
|
-
})(TaskType || {});
|
|
2490
|
-
class MacroEndTaskManager {
|
|
2491
|
-
taskList = [];
|
|
2492
|
-
frameCount;
|
|
2493
|
-
customerOnFlushTakEnd;
|
|
2494
|
-
customerOnBreak;
|
|
2495
|
-
mTaskToken = ref(0);
|
|
2496
|
-
mToken = 0;
|
|
2497
|
-
mFlushedFrameCount = -1;
|
|
2498
|
-
constructor(onFlushTask, onBreak) {
|
|
2499
|
-
this.customerOnBreak = onBreak;
|
|
2500
|
-
this.customerOnFlushTakEnd = onFlushTask;
|
|
2501
|
-
}
|
|
2502
|
-
getToken() {
|
|
2503
|
-
if (this.mToken < Number.MAX_SAFE_INTEGER) {
|
|
2504
|
-
++this.mToken;
|
|
2505
|
-
} else {
|
|
2506
|
-
this.mToken = 1;
|
|
2507
|
-
}
|
|
2508
|
-
return this.mToken;
|
|
2509
|
-
}
|
|
2510
|
-
addTask(type, params) {
|
|
2511
|
-
if (this.mFlushedFrameCount == Forge$1.sFrameCount.count) {
|
|
2512
|
-
console.log("MetroWidget: tasks in currnet frame flushed. ignore task", type, params);
|
|
2513
|
-
return;
|
|
2514
|
-
}
|
|
2515
|
-
this.taskList.push({
|
|
2516
|
-
type,
|
|
2517
|
-
params,
|
|
2518
|
-
frameCount: Forge$1.sFrameCount.count
|
|
2519
|
-
});
|
|
2520
|
-
if (this.frameCount !== Forge$1.sFrameCount.count) {
|
|
2521
|
-
this.frameCount = Forge$1.sFrameCount.count;
|
|
2522
|
-
const breakList = [];
|
|
2523
|
-
for (let i = this.taskList.length - 1; i >= 0; --i) {
|
|
2524
|
-
if (this.taskList[i].frameCount != this.frameCount) {
|
|
2525
|
-
let t = this.taskList.splice(i, 1);
|
|
2526
|
-
breakList.push(t[0]);
|
|
2527
|
-
}
|
|
2528
|
-
}
|
|
2529
|
-
this.onBreak(breakList);
|
|
2530
|
-
}
|
|
2531
|
-
this.mTaskToken.value = this.getToken();
|
|
2532
|
-
let selfToken = this.mTaskToken.value;
|
|
2533
|
-
Promise.resolve().then(() => {
|
|
2534
|
-
if (selfToken == this.mTaskToken.value) {
|
|
2535
|
-
this.onFlushTask();
|
|
2536
|
-
this.mFlushedFrameCount = this.frameCount;
|
|
2537
|
-
Forge$1.sRenderBridge.RequestSwap();
|
|
2538
|
-
} else {
|
|
2539
|
-
}
|
|
2540
|
-
});
|
|
2541
|
-
}
|
|
2542
|
-
onFlushTask() {
|
|
2543
|
-
if (this.taskList.length > 0) {
|
|
2544
|
-
this.customerOnFlushTakEnd(this.taskList);
|
|
2545
|
-
this.taskList = [];
|
|
2546
|
-
}
|
|
2547
|
-
}
|
|
2548
|
-
onBreak(taskList) {
|
|
2549
|
-
this.customerOnBreak(taskList);
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
|
-
class AnimObject {
|
|
2553
|
-
frameCount;
|
|
2554
|
-
forgeAnim;
|
|
2555
|
-
element;
|
|
2556
|
-
animSetting;
|
|
2557
|
-
constructor(frameCount, element, from, to, setting) {
|
|
2558
|
-
this.frameCount = frameCount;
|
|
2559
|
-
this.animSetting = setting;
|
|
2560
|
-
this.element = element;
|
|
2561
|
-
let duration = 0;
|
|
2562
|
-
if (typeof setting.duration == "number") {
|
|
2563
|
-
duration = setting.duration;
|
|
2564
|
-
} else if (typeof setting.speed == "number") {
|
|
2565
|
-
duration = Math.round(Math.max(Math.abs(to[0] - from[0]), Math.abs(to[1] - from[1])) / setting.speed);
|
|
2566
|
-
}
|
|
2567
|
-
this.forgeAnim = new Forge$1.TranslateAnimation(
|
|
2568
|
-
from[0],
|
|
2569
|
-
to[0],
|
|
2570
|
-
from[1],
|
|
2571
|
-
to[1],
|
|
2572
|
-
duration,
|
|
2573
|
-
setting.easing
|
|
2574
|
-
);
|
|
2575
|
-
this.forgeAnim.SetAnimationListener(
|
|
2576
|
-
new Forge$1.AnimationListener(this.onStart.bind(this), this.onEnd.bind(this), null)
|
|
2577
|
-
);
|
|
2578
|
-
}
|
|
2579
|
-
start() {
|
|
2580
|
-
this.element?.jsvGetProxyView(true).StartAnimation(this.forgeAnim);
|
|
2581
|
-
}
|
|
2582
|
-
stop() {
|
|
2583
|
-
this.element?.jsvGetProxyView(true).StopAnimation();
|
|
2584
|
-
}
|
|
2585
|
-
getFrameCount() {
|
|
2586
|
-
return this.frameCount;
|
|
2587
|
-
}
|
|
2588
|
-
onStart() {
|
|
2589
|
-
this.animSetting?.onStart?.();
|
|
2590
|
-
}
|
|
2591
|
-
onEnd(done) {
|
|
2592
|
-
this.animSetting?.onEnd?.(done);
|
|
2593
|
-
}
|
|
2594
|
-
}
|
|
2595
|
-
class AnimationManager {
|
|
2596
|
-
animList = [];
|
|
2597
|
-
frameCount = 0;
|
|
2598
|
-
startSlideAnim(element, from, to, setting) {
|
|
2599
|
-
let curFrameCount = Forge$1.sFrameCount.count;
|
|
2600
|
-
if (curFrameCount != this.frameCount) {
|
|
2601
|
-
this.tryCleanOldAnim();
|
|
2602
|
-
this.frameCount = curFrameCount;
|
|
2603
|
-
}
|
|
2604
|
-
const obj = new AnimObject(curFrameCount, element, from, to, setting);
|
|
2605
|
-
this.animList.push(obj);
|
|
2606
|
-
obj.start();
|
|
2607
|
-
}
|
|
2608
|
-
tryCleanOldAnim() {
|
|
2609
|
-
for (let i = this.animList.length - 1; i >= 0; --i) {
|
|
2610
|
-
const anim = this.animList[i];
|
|
2611
|
-
if (anim.getFrameCount() != this.frameCount) {
|
|
2612
|
-
this.animList.splice(i, 1);
|
|
2613
|
-
anim.stop();
|
|
2614
|
-
}
|
|
2615
|
-
}
|
|
2616
|
-
}
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2619
2491
|
//!
|
|
2620
2492
|
//! utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.ts;
|
|
2621
2493
|
//!
|
|
@@ -2703,6 +2575,27 @@ class ConditionPackBuilder {
|
|
|
2703
2575
|
this._CommonInfoValid = false;
|
|
2704
2576
|
return this._BuildPack(ConditionSetBuilder.BoxPosition(left, top, right, bottom, this._CommonInfo));
|
|
2705
2577
|
}
|
|
2578
|
+
offsetPosition(left, top, right, bottom) {
|
|
2579
|
+
if (!this._CheckCommonInfo()) {
|
|
2580
|
+
return null;
|
|
2581
|
+
}
|
|
2582
|
+
this._CommonInfoValid = false;
|
|
2583
|
+
return this._BuildPack(ConditionSetBuilder.OffsetPosition(left, top, right, bottom, this._CommonInfo));
|
|
2584
|
+
}
|
|
2585
|
+
startMove(xEnable, yEnable) {
|
|
2586
|
+
if (!this._CheckCommonInfo()) {
|
|
2587
|
+
return null;
|
|
2588
|
+
}
|
|
2589
|
+
this._CommonInfoValid = false;
|
|
2590
|
+
let direction = 0;
|
|
2591
|
+
if (xEnable) {
|
|
2592
|
+
direction |= 1;
|
|
2593
|
+
}
|
|
2594
|
+
if (yEnable) {
|
|
2595
|
+
direction |= 2;
|
|
2596
|
+
}
|
|
2597
|
+
return this._BuildPack(ConditionSetBuilder.StartMove(direction, this._CommonInfo));
|
|
2598
|
+
}
|
|
2706
2599
|
/**
|
|
2707
2600
|
* AcrossPosition
|
|
2708
2601
|
* 获取 AcrossPosition 的condition
|
|
@@ -2814,6 +2707,13 @@ class ConditionPackBuilder {
|
|
|
2814
2707
|
this._CommonInfoValid = false;
|
|
2815
2708
|
return this._BuildPack(ConditionSetBuilder.OnFlingEnd(this._CommonInfo, this._ContorlSlefNexus.token));
|
|
2816
2709
|
}
|
|
2710
|
+
onFlingCancel() {
|
|
2711
|
+
if (!this._CheckCommonInfo()) {
|
|
2712
|
+
return null;
|
|
2713
|
+
}
|
|
2714
|
+
this._CommonInfoValid = false;
|
|
2715
|
+
return this._BuildPack(ConditionSetBuilder.OnFlingCancel(this._CommonInfo, this._ContorlSlefNexus.token));
|
|
2716
|
+
}
|
|
2817
2717
|
_CheckCommonInfo() {
|
|
2818
2718
|
if (!this._CommonInfoValid) {
|
|
2819
2719
|
console.error("Error: must call from new conditoin()");
|
|
@@ -3243,6 +3143,9 @@ class StatePackBuilder {
|
|
|
3243
3143
|
setHitWallOverflow() {
|
|
3244
3144
|
return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.SetHitWallOverflow());
|
|
3245
3145
|
}
|
|
3146
|
+
touchLockSwitch(isLock, direction, unlockThreshold = -1) {
|
|
3147
|
+
return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.TouchLockSwitch(isLock, direction, unlockThreshold));
|
|
3148
|
+
}
|
|
3246
3149
|
/*
|
|
3247
3150
|
* fireNexusEvent 发出Nexus event
|
|
3248
3151
|
*/
|
|
@@ -3453,6 +3356,137 @@ class ActorControl {
|
|
|
3453
3356
|
}
|
|
3454
3357
|
}
|
|
3455
3358
|
|
|
3359
|
+
//!
|
|
3360
|
+
//! utils/JsViewEngineWidget/MetroWidget/TaskManager.ts;
|
|
3361
|
+
//!
|
|
3362
|
+
class SlideAnimWrapper {
|
|
3363
|
+
frameCount;
|
|
3364
|
+
forgeAnim;
|
|
3365
|
+
element;
|
|
3366
|
+
animSetting;
|
|
3367
|
+
constructor(frameCount, element, from, to, setting) {
|
|
3368
|
+
this.frameCount = frameCount;
|
|
3369
|
+
this.animSetting = setting;
|
|
3370
|
+
this.element = element;
|
|
3371
|
+
let duration = 0;
|
|
3372
|
+
if (typeof setting.duration == "number") {
|
|
3373
|
+
duration = setting.duration;
|
|
3374
|
+
} else if (typeof setting.speed == "number") {
|
|
3375
|
+
duration = Math.round(Math.max(Math.abs(to[0] - from[0]), Math.abs(to[1] - from[1])) / setting.speed);
|
|
3376
|
+
}
|
|
3377
|
+
this.forgeAnim = new Forge$1.TranslateAnimation(
|
|
3378
|
+
from[0],
|
|
3379
|
+
to[0],
|
|
3380
|
+
from[1],
|
|
3381
|
+
to[1],
|
|
3382
|
+
duration,
|
|
3383
|
+
setting.easing
|
|
3384
|
+
);
|
|
3385
|
+
this.forgeAnim.SetAnimationListener(
|
|
3386
|
+
new Forge$1.AnimationListener(this.onStart.bind(this), this.onEnd.bind(this), null)
|
|
3387
|
+
);
|
|
3388
|
+
}
|
|
3389
|
+
start() {
|
|
3390
|
+
this.element?.jsvGetProxyView(true).StartAnimation(this.forgeAnim);
|
|
3391
|
+
}
|
|
3392
|
+
removeListener() {
|
|
3393
|
+
this.forgeAnim?.RemoveAnimationListener();
|
|
3394
|
+
}
|
|
3395
|
+
stop() {
|
|
3396
|
+
this.element?.jsvGetProxyView(true).StopAnimation();
|
|
3397
|
+
}
|
|
3398
|
+
getFrameCount() {
|
|
3399
|
+
return this.frameCount;
|
|
3400
|
+
}
|
|
3401
|
+
onStart() {
|
|
3402
|
+
this.animSetting?.onStart?.();
|
|
3403
|
+
}
|
|
3404
|
+
onEnd(done) {
|
|
3405
|
+
this.animSetting?.onEnd?.(done);
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3408
|
+
class AnimationManager {
|
|
3409
|
+
animList = [];
|
|
3410
|
+
frameCount = 0;
|
|
3411
|
+
startSlideAnim(element, from, to, setting) {
|
|
3412
|
+
let curFrameCount = Forge$1.sFrameCount.count;
|
|
3413
|
+
if (curFrameCount != this.frameCount) {
|
|
3414
|
+
this.tryCleanOldAnim();
|
|
3415
|
+
this.frameCount = curFrameCount;
|
|
3416
|
+
}
|
|
3417
|
+
const obj = new SlideAnimWrapper(curFrameCount, element, from, to, setting);
|
|
3418
|
+
this.animList.push(obj);
|
|
3419
|
+
obj.start();
|
|
3420
|
+
return () => {
|
|
3421
|
+
if (obj.getFrameCount() == Forge$1.sFrameCount.count) {
|
|
3422
|
+
obj.removeListener();
|
|
3423
|
+
}
|
|
3424
|
+
obj.stop();
|
|
3425
|
+
};
|
|
3426
|
+
}
|
|
3427
|
+
tryCleanOldAnim() {
|
|
3428
|
+
for (let i = this.animList.length - 1; i >= 0; --i) {
|
|
3429
|
+
const anim = this.animList[i];
|
|
3430
|
+
if (anim.getFrameCount() != this.frameCount) {
|
|
3431
|
+
this.animList.splice(i, 1);
|
|
3432
|
+
anim.stop();
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
3437
|
+
class CancellableRunner {
|
|
3438
|
+
cancelHandler = null;
|
|
3439
|
+
runner = null;
|
|
3440
|
+
constructor(r) {
|
|
3441
|
+
this.runner = r;
|
|
3442
|
+
}
|
|
3443
|
+
run() {
|
|
3444
|
+
if (this.runner) {
|
|
3445
|
+
this.cancelHandler = this.runner();
|
|
3446
|
+
}
|
|
3447
|
+
}
|
|
3448
|
+
cancel() {
|
|
3449
|
+
this.cancelHandler?.();
|
|
3450
|
+
this.runner = null;
|
|
3451
|
+
this.cancelHandler = null;
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
var TaskType = /* @__PURE__ */ ((TaskType2) => {
|
|
3455
|
+
TaskType2[TaskType2["RESIZE_ITEM"] = 0] = "RESIZE_ITEM";
|
|
3456
|
+
TaskType2[TaskType2["SLIDE"] = 1] = "SLIDE";
|
|
3457
|
+
TaskType2[TaskType2["ON_FOCUS_CHANGE"] = 2] = "ON_FOCUS_CHANGE";
|
|
3458
|
+
return TaskType2;
|
|
3459
|
+
})(TaskType || {});
|
|
3460
|
+
class TaskManager {
|
|
3461
|
+
constructor(onAddTask) {
|
|
3462
|
+
this.onAddTask = onAddTask;
|
|
3463
|
+
}
|
|
3464
|
+
frameCount = -1;
|
|
3465
|
+
widgetTaskCacheList = [];
|
|
3466
|
+
cancellableRunnerList = [];
|
|
3467
|
+
addTask(type, params) {
|
|
3468
|
+
if (this.frameCount != Forge$1.sFrameCount.count) {
|
|
3469
|
+
this.widgetTaskCacheList = [];
|
|
3470
|
+
this.cancellableRunnerList = [];
|
|
3471
|
+
this.frameCount = Forge$1.sFrameCount.count;
|
|
3472
|
+
}
|
|
3473
|
+
this.cancellableRunnerList.forEach((t) => {
|
|
3474
|
+
t.cancel();
|
|
3475
|
+
});
|
|
3476
|
+
this.widgetTaskCacheList.push({
|
|
3477
|
+
type,
|
|
3478
|
+
params,
|
|
3479
|
+
frameCount: Forge$1.sFrameCount.count
|
|
3480
|
+
});
|
|
3481
|
+
this.onAddTask(this.widgetTaskCacheList);
|
|
3482
|
+
}
|
|
3483
|
+
run(func) {
|
|
3484
|
+
const cancellableRunner = new CancellableRunner(func);
|
|
3485
|
+
this.cancellableRunnerList.push(cancellableRunner);
|
|
3486
|
+
cancellableRunner.run();
|
|
3487
|
+
}
|
|
3488
|
+
}
|
|
3489
|
+
|
|
3456
3490
|
//!
|
|
3457
3491
|
//! utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js;
|
|
3458
3492
|
//!
|
|
@@ -3510,6 +3544,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3510
3544
|
DRAG: 2,
|
|
3511
3545
|
FLING: 3
|
|
3512
3546
|
};
|
|
3547
|
+
const modeForExport = ref(FOCUS_MODE);
|
|
3513
3548
|
const mode = {
|
|
3514
3549
|
_mode: FOCUS_MODE,
|
|
3515
3550
|
_touchState: TouchState.IDLE,
|
|
@@ -3517,6 +3552,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3517
3552
|
_duringFling: false,
|
|
3518
3553
|
touchStart() {
|
|
3519
3554
|
this._mode = TOUCH_MODE;
|
|
3555
|
+
modeForExport.value = TOUCH_MODE;
|
|
3520
3556
|
this._touchState = TouchState.TAP;
|
|
3521
3557
|
},
|
|
3522
3558
|
touchEnd() {
|
|
@@ -3534,6 +3570,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3534
3570
|
},
|
|
3535
3571
|
keyDown() {
|
|
3536
3572
|
this._mode = FOCUS_MODE;
|
|
3573
|
+
modeForExport.value = FOCUS_MODE;
|
|
3537
3574
|
this._touchState = TouchState.IDLE;
|
|
3538
3575
|
},
|
|
3539
3576
|
duringFling() {
|
|
@@ -3577,13 +3614,14 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3577
3614
|
let size_key = vertical ? "height" : "width";
|
|
3578
3615
|
return item.templateInfo[pos_key] >= visibleInfo.start && item.templateInfo[pos_key] + item.templateInfo[size_key] - 1 < visibleInfo.end;
|
|
3579
3616
|
};
|
|
3580
|
-
|
|
3617
|
+
let templateCacheFrameCount = -1;
|
|
3581
3618
|
const onMacroTaskEnd = (taskList) => {
|
|
3582
3619
|
let resizeList = [];
|
|
3583
3620
|
let resizeTaskMap = {};
|
|
3584
3621
|
let slideTask = null;
|
|
3585
3622
|
let minIndex = Infinity;
|
|
3586
3623
|
let slideInfo = null;
|
|
3624
|
+
let mergeTmp = false;
|
|
3587
3625
|
let anchorInfo = null;
|
|
3588
3626
|
let duration = 200;
|
|
3589
3627
|
let easing = null;
|
|
@@ -3591,8 +3629,19 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3591
3629
|
let size_key = vertical ? "height" : "width";
|
|
3592
3630
|
let doAnim = false;
|
|
3593
3631
|
let existOnFocusChange = false;
|
|
3632
|
+
let targetVisibleStart = visibleInfo.start;
|
|
3633
|
+
taskList.forEach((i) => {
|
|
3634
|
+
if (i.type == TaskType.SLIDE) {
|
|
3635
|
+
slideTask = i;
|
|
3636
|
+
mergeTmp = mergeTmp || i.params?.updateParam?.mergeTmp;
|
|
3637
|
+
if (!isNaN(i.params?.target)) {
|
|
3638
|
+
targetVisibleStart = -i.params.target;
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
});
|
|
3594
3642
|
for (let task of taskList) {
|
|
3595
3643
|
if (task.type == TaskType.RESIZE_ITEM) {
|
|
3644
|
+
mergeTmp = mergeTmp || task.params?.updateParam?.mergeTmp;
|
|
3596
3645
|
resizeTaskMap[task.params.index] = task;
|
|
3597
3646
|
resizeList.push(task);
|
|
3598
3647
|
const { index, animInfo } = task.params;
|
|
@@ -3603,12 +3652,10 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3603
3652
|
if (index == id2Index(focusId) && typeof animInfo?.anchor != "undefined") {
|
|
3604
3653
|
const item = getItemByIndex(index);
|
|
3605
3654
|
anchorInfo = {
|
|
3606
|
-
anchorPosition: item.templateInfo[pos_key] + item.templateInfo[size_key] * animInfo.anchor - 1 -
|
|
3655
|
+
anchorPosition: item.templateInfo[pos_key] + item.templateInfo[size_key] * animInfo.anchor - 1 - targetVisibleStart,
|
|
3607
3656
|
anchor: animInfo.anchor
|
|
3608
3657
|
};
|
|
3609
3658
|
}
|
|
3610
|
-
} else if (task.type == TaskType.SLIDE) {
|
|
3611
|
-
slideTask = task;
|
|
3612
3659
|
} else if (task.type == TaskType.ON_FOCUS_CHANGE) {
|
|
3613
3660
|
existOnFocusChange = true;
|
|
3614
3661
|
}
|
|
@@ -3622,33 +3669,33 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3622
3669
|
let existItemResize = false;
|
|
3623
3670
|
if (resizeList.length > 0) {
|
|
3624
3671
|
existItemResize = true;
|
|
3625
|
-
|
|
3672
|
+
if (templateCacheFrameCount != Forge$1.sFrameCount.count) {
|
|
3673
|
+
metroTemplate.cacheLayout(minIndex, minIndex + 20);
|
|
3674
|
+
templateCacheFrameCount = Forge$1.sFrameCount.count;
|
|
3675
|
+
}
|
|
3626
3676
|
resizeList.forEach((task) => {
|
|
3627
3677
|
metroTemplate.updateItemSize(task.params.index, {
|
|
3628
3678
|
width: task.params.width,
|
|
3629
3679
|
height: task.params.height
|
|
3630
3680
|
});
|
|
3631
3681
|
});
|
|
3632
|
-
let preVisibleStart = visibleInfo.start;
|
|
3633
3682
|
if (anchorInfo) {
|
|
3634
3683
|
const focusItem = getItemById(focusId);
|
|
3635
3684
|
const start = focusItem.templateInfo[pos_key] + focusItem.templateInfo[size_key] * anchorInfo.anchor - 1 - anchorInfo.anchorPosition;
|
|
3636
|
-
|
|
3685
|
+
targetVisibleStart = normalizeVisibleStart(start, focusItem.templateInfo);
|
|
3637
3686
|
} else {
|
|
3638
|
-
|
|
3687
|
+
targetVisibleStart = _calculateVisibleStart(getItemById(focusId).templateInfo, preSlideDirection);
|
|
3639
3688
|
}
|
|
3640
|
-
if (
|
|
3689
|
+
if (visibleInfo.start != targetVisibleStart) {
|
|
3641
3690
|
slideInfo = {
|
|
3642
|
-
target: -
|
|
3691
|
+
target: -targetVisibleStart
|
|
3643
3692
|
};
|
|
3644
3693
|
if (doAnim) {
|
|
3645
3694
|
slideInfo.animObj = {
|
|
3646
3695
|
easing: "",
|
|
3647
3696
|
onStart: null,
|
|
3648
3697
|
speed: null,
|
|
3649
|
-
duration
|
|
3650
|
-
onEnd: (animDone) => {
|
|
3651
|
-
}
|
|
3698
|
+
duration
|
|
3652
3699
|
};
|
|
3653
3700
|
} else {
|
|
3654
3701
|
if (slideTask) {
|
|
@@ -3665,15 +3712,35 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3665
3712
|
}
|
|
3666
3713
|
}
|
|
3667
3714
|
}
|
|
3668
|
-
|
|
3715
|
+
}
|
|
3716
|
+
if (targetVisibleStart != visibleInfo.start) {
|
|
3717
|
+
taskManager.run(() => {
|
|
3718
|
+
const preVisibleStart = visibleInfo.start;
|
|
3719
|
+
visibleInfo.start = targetVisibleStart;
|
|
3720
|
+
return () => {
|
|
3721
|
+
visibleInfo.start = preVisibleStart;
|
|
3722
|
+
};
|
|
3723
|
+
});
|
|
3724
|
+
}
|
|
3725
|
+
let updateHandler;
|
|
3726
|
+
taskManager.run(() => {
|
|
3727
|
+
updateHandler = pageUpdater.update(
|
|
3669
3728
|
metroTemplate,
|
|
3670
|
-
visibleInfo.startWithPadding,
|
|
3671
|
-
|
|
3729
|
+
visibleInfo.startWithPadding - props.keepTraceRange * pageRange,
|
|
3730
|
+
Math.min(
|
|
3731
|
+
visibleInfo.startMax + visibleInfo.range + visibleInfo.padding.end - 1,
|
|
3732
|
+
visibleInfo.endWithPadding + props.keepTraceRange * pageRange
|
|
3733
|
+
),
|
|
3672
3734
|
focusId,
|
|
3673
|
-
|
|
3735
|
+
mergeTmp,
|
|
3674
3736
|
permanentItemList
|
|
3675
3737
|
);
|
|
3676
|
-
|
|
3738
|
+
return () => {
|
|
3739
|
+
updateHandler.recover();
|
|
3740
|
+
};
|
|
3741
|
+
});
|
|
3742
|
+
if (resizeList.length > 0) {
|
|
3743
|
+
updateHandler.applyTmp();
|
|
3677
3744
|
if (doAnim) {
|
|
3678
3745
|
const visibleIndexList = Array.from(pageUpdater.getTmpRange());
|
|
3679
3746
|
for (let index of visibleIndexList) {
|
|
@@ -3681,21 +3748,27 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3681
3748
|
const { left, top } = renderItem.templateInfo;
|
|
3682
3749
|
if (index >= minIndex) {
|
|
3683
3750
|
const layoutCache = renderItem.templateInfo.layoutCache;
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
[layoutCache.left - left, layoutCache.top - top],
|
|
3688
|
-
[0, 0],
|
|
3689
|
-
resizeTaskMap[index] ? resizeTaskMap[index].params.animInfo : { duration }
|
|
3690
|
-
);
|
|
3691
|
-
} else {
|
|
3692
|
-
renderItem.addDivMountedListener((div) => {
|
|
3693
|
-
animationManager.startSlideAnim(
|
|
3751
|
+
const doItemSlide = (div) => {
|
|
3752
|
+
taskManager.run(() => {
|
|
3753
|
+
const cancel = animationManager.startSlideAnim(
|
|
3694
3754
|
div,
|
|
3695
3755
|
[layoutCache.left - left, layoutCache.top - top],
|
|
3696
3756
|
[0, 0],
|
|
3697
3757
|
resizeTaskMap[index] ? resizeTaskMap[index].params.animInfo : { duration }
|
|
3698
3758
|
);
|
|
3759
|
+
return () => {
|
|
3760
|
+
cancel();
|
|
3761
|
+
};
|
|
3762
|
+
});
|
|
3763
|
+
};
|
|
3764
|
+
if (renderItem.mounted.value) {
|
|
3765
|
+
doItemSlide(renderItem.rootDiv);
|
|
3766
|
+
} else {
|
|
3767
|
+
taskManager.run(() => {
|
|
3768
|
+
const unregister = renderItem.addDivMountedListener((div) => {
|
|
3769
|
+
doItemSlide(div);
|
|
3770
|
+
});
|
|
3771
|
+
return unregister;
|
|
3699
3772
|
});
|
|
3700
3773
|
}
|
|
3701
3774
|
}
|
|
@@ -3704,68 +3777,77 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3704
3777
|
}
|
|
3705
3778
|
let viewSlid = false;
|
|
3706
3779
|
if (slideInfo) {
|
|
3707
|
-
|
|
3708
|
-
viewSlid = executeSlide(target, slideInfo);
|
|
3780
|
+
viewSlid = executeSlide(slideInfo, updateHandler);
|
|
3709
3781
|
}
|
|
3710
|
-
if (existItemResize) {
|
|
3711
|
-
|
|
3782
|
+
if (existItemResize && props.onAllItemResizeDone) {
|
|
3783
|
+
taskManager.run(() => {
|
|
3784
|
+
const handler = setTimeout(() => {
|
|
3785
|
+
props.onAllItemResizeDone();
|
|
3786
|
+
}, 0);
|
|
3787
|
+
return () => {
|
|
3788
|
+
clearTimeout(handler);
|
|
3789
|
+
};
|
|
3790
|
+
});
|
|
3712
3791
|
}
|
|
3713
|
-
if (viewSlid || existOnFocusChange) {
|
|
3714
|
-
|
|
3792
|
+
if ((viewSlid || existOnFocusChange) && props.onFocusRectChange) {
|
|
3793
|
+
taskManager.run(() => {
|
|
3794
|
+
const handler = setTimeout(() => {
|
|
3795
|
+
props.onFocusRectChange();
|
|
3796
|
+
}, 0);
|
|
3797
|
+
return () => {
|
|
3798
|
+
clearTimeout(handler);
|
|
3799
|
+
};
|
|
3800
|
+
});
|
|
3715
3801
|
}
|
|
3716
3802
|
};
|
|
3717
|
-
const
|
|
3803
|
+
const taskManager = new TaskManager(onMacroTaskEnd);
|
|
3804
|
+
const animationManager = new AnimationManager();
|
|
3805
|
+
const executeSlide = (slideInfo, updateHandler) => {
|
|
3718
3806
|
let preLeft = slideDivLeft.value;
|
|
3719
3807
|
let preTop = slideDivTop.value;
|
|
3720
|
-
|
|
3721
|
-
|
|
3808
|
+
taskManager.run(() => {
|
|
3809
|
+
slideDivLeft.value = vertical ? 0 : -visibleInfo.start;
|
|
3810
|
+
slideDivTop.value = vertical ? -visibleInfo.start : 0;
|
|
3811
|
+
return () => {
|
|
3812
|
+
slideDivLeft.value = preLeft;
|
|
3813
|
+
slideDivTop.value = preTop;
|
|
3814
|
+
};
|
|
3815
|
+
});
|
|
3722
3816
|
let viewSlid = preLeft != slideDivLeft.value || preTop != slideDivTop.value;
|
|
3723
|
-
visibleInfo.start = -target;
|
|
3724
|
-
const updater2 = pageUpdater.update(
|
|
3725
|
-
metroTemplate,
|
|
3726
|
-
visibleInfo.startWithPadding - props.keepTraceRange * pageRange,
|
|
3727
|
-
Math.min(
|
|
3728
|
-
visibleInfo.startMax + visibleInfo.range + visibleInfo.padding.end - 1,
|
|
3729
|
-
visibleInfo.endWithPadding + props.keepTraceRange * pageRange
|
|
3730
|
-
),
|
|
3731
|
-
focusId,
|
|
3732
|
-
true,
|
|
3733
|
-
permanentItemList
|
|
3734
|
-
);
|
|
3735
3817
|
if (slideInfo.animObj) {
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3818
|
+
updateHandler.applyTmp();
|
|
3819
|
+
taskManager.run(() => {
|
|
3820
|
+
const from = vertical ? [0, preTop - slideDivTop.value] : [preLeft - slideDivLeft.value, 0];
|
|
3821
|
+
const cancel = animationManager.startSlideAnim(
|
|
3822
|
+
slideDiv.value,
|
|
3823
|
+
from,
|
|
3824
|
+
[0, 0],
|
|
3825
|
+
{
|
|
3826
|
+
...slideInfo.animObj,
|
|
3827
|
+
onEnd: () => {
|
|
3828
|
+
updateHandler.apply();
|
|
3829
|
+
}
|
|
3745
3830
|
}
|
|
3746
|
-
|
|
3747
|
-
|
|
3831
|
+
);
|
|
3832
|
+
return () => {
|
|
3833
|
+
cancel();
|
|
3834
|
+
};
|
|
3835
|
+
});
|
|
3748
3836
|
} else {
|
|
3749
|
-
|
|
3837
|
+
updateHandler.apply();
|
|
3750
3838
|
}
|
|
3751
|
-
|
|
3839
|
+
taskManager.run(() => {
|
|
3840
|
+
const handler = setTimeout(() => {
|
|
3841
|
+
_onScroll();
|
|
3842
|
+
}, 0);
|
|
3843
|
+
return () => {
|
|
3844
|
+
clearTimeout(handler);
|
|
3845
|
+
};
|
|
3846
|
+
});
|
|
3752
3847
|
return viewSlid;
|
|
3753
3848
|
};
|
|
3754
|
-
const onMacroEndTaskBreak = (list) => {
|
|
3755
|
-
if (list) {
|
|
3756
|
-
list.forEach((task) => {
|
|
3757
|
-
if (task.type == TaskType.RESIZE_ITEM) {
|
|
3758
|
-
metroTemplate.updateItemSize(task.params.index, {
|
|
3759
|
-
width: task.params.width,
|
|
3760
|
-
height: task.params.height
|
|
3761
|
-
});
|
|
3762
|
-
}
|
|
3763
|
-
});
|
|
3764
|
-
}
|
|
3765
|
-
};
|
|
3766
|
-
const macroEndTaskManager = new MacroEndTaskManager(onMacroTaskEnd, onMacroEndTaskBreak);
|
|
3767
3849
|
const updateItemSize = (index, newSize, animInfo) => {
|
|
3768
|
-
|
|
3850
|
+
taskManager.addTask(
|
|
3769
3851
|
TaskType.RESIZE_ITEM,
|
|
3770
3852
|
{
|
|
3771
3853
|
index,
|
|
@@ -3775,12 +3857,12 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3775
3857
|
}
|
|
3776
3858
|
);
|
|
3777
3859
|
};
|
|
3778
|
-
const _slideTo = (target, animObj) => {
|
|
3860
|
+
const _slideTo = (target, animObj, updateParam = { mergeTmp: false }) => {
|
|
3779
3861
|
if (slideLock) {
|
|
3780
3862
|
return;
|
|
3781
3863
|
}
|
|
3782
3864
|
;
|
|
3783
|
-
|
|
3865
|
+
taskManager.addTask(TaskType.SLIDE, { target: -target, animObj, updateParam });
|
|
3784
3866
|
};
|
|
3785
3867
|
let callFocusAfterUpdate = false;
|
|
3786
3868
|
const _onFocusChange = (id) => {
|
|
@@ -3976,32 +4058,17 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
3976
4058
|
};
|
|
3977
4059
|
const slideTo = (position, doAnim) => {
|
|
3978
4060
|
templateItemAdder.tryAddItemByPosition(position);
|
|
3979
|
-
if (typeof position !== "undefined" && position != null
|
|
3980
|
-
visibleInfo.start = position;
|
|
3981
|
-
const updater2 = pageUpdater.update(
|
|
3982
|
-
metroTemplate,
|
|
3983
|
-
visibleInfo.startWithPadding,
|
|
3984
|
-
visibleInfo.endWithPadding,
|
|
3985
|
-
focusId,
|
|
3986
|
-
false,
|
|
3987
|
-
permanentItemList
|
|
3988
|
-
);
|
|
4061
|
+
if (typeof position !== "undefined" && position != null) {
|
|
3989
4062
|
let animObj = null;
|
|
3990
4063
|
if (doAnim) {
|
|
3991
4064
|
animObj = {
|
|
3992
4065
|
easing: props.slideSetting.Easing,
|
|
3993
4066
|
onStart: null,
|
|
3994
4067
|
speed: props.slideSetting.Speed,
|
|
3995
|
-
duration: props.slideSetting.Duration
|
|
3996
|
-
onEnd: () => {
|
|
3997
|
-
updater2.apply();
|
|
3998
|
-
}
|
|
4068
|
+
duration: props.slideSetting.Duration
|
|
3999
4069
|
};
|
|
4000
|
-
pageUpdater.applyTmp();
|
|
4001
|
-
} else {
|
|
4002
|
-
pageUpdater.apply();
|
|
4003
4070
|
}
|
|
4004
|
-
_slideTo(
|
|
4071
|
+
_slideTo(position, animObj);
|
|
4005
4072
|
}
|
|
4006
4073
|
};
|
|
4007
4074
|
const setZIndex = (index, normalZIndex, focusZIndex) => {
|
|
@@ -4115,7 +4182,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4115
4182
|
templateItemAdder.tryAddItemById(focusId);
|
|
4116
4183
|
}
|
|
4117
4184
|
}
|
|
4118
|
-
const
|
|
4185
|
+
const updater = pageUpdater.update(
|
|
4119
4186
|
metroTemplate,
|
|
4120
4187
|
visibleInfo.startWithPadding - props.keepTraceRange * pageRange,
|
|
4121
4188
|
Math.min(
|
|
@@ -4126,7 +4193,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4126
4193
|
false,
|
|
4127
4194
|
permanentItemList
|
|
4128
4195
|
);
|
|
4129
|
-
|
|
4196
|
+
updater.apply();
|
|
4130
4197
|
onItemFocus(getItemById(focusId), null);
|
|
4131
4198
|
slideToItem(id2Index(focusId), false);
|
|
4132
4199
|
};
|
|
@@ -4504,28 +4571,18 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4504
4571
|
};
|
|
4505
4572
|
let cur_slide = _calculateVisibleStart(fakeItem.templateInfo, direction);
|
|
4506
4573
|
if (cur_slide != visibleInfo.start) {
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
permanentItemList
|
|
4518
|
-
);
|
|
4519
|
-
updater2.applyTmp();
|
|
4520
|
-
_slideTo(visibleInfo.start, {
|
|
4521
|
-
easing: "",
|
|
4522
|
-
onStart: null,
|
|
4523
|
-
speed: props.slideSetting.Speed,
|
|
4524
|
-
duration: props.slideSetting.Duration,
|
|
4525
|
-
onEnd: () => {
|
|
4526
|
-
updater2.apply();
|
|
4574
|
+
_slideTo(
|
|
4575
|
+
cur_slide,
|
|
4576
|
+
{
|
|
4577
|
+
easing: "",
|
|
4578
|
+
onStart: null,
|
|
4579
|
+
speed: props.slideSetting.Speed,
|
|
4580
|
+
duration: props.slideSetting.Duration
|
|
4581
|
+
},
|
|
4582
|
+
{
|
|
4583
|
+
mergeTmp: true
|
|
4527
4584
|
}
|
|
4528
|
-
|
|
4585
|
+
);
|
|
4529
4586
|
return true;
|
|
4530
4587
|
}
|
|
4531
4588
|
}
|
|
@@ -4535,7 +4592,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4535
4592
|
preFocusId = cache_pre ? focusId : -1;
|
|
4536
4593
|
focusId = id;
|
|
4537
4594
|
currentFocusIndex.value = id2Index(id);
|
|
4538
|
-
|
|
4595
|
+
taskManager.addTask(TaskType.ON_FOCUS_CHANGE);
|
|
4539
4596
|
};
|
|
4540
4597
|
const _bubbleCustomEvent = (event) => {
|
|
4541
4598
|
if (props.sendFocusRectEvent && event) {
|
|
@@ -4612,31 +4669,15 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4612
4669
|
let cur_visible_start2 = _calculateVisibleStart(next_focus_item.templateInfo, vertical ? vertical_direction : horizontal_direction);
|
|
4613
4670
|
if (visibleInfo.start !== cur_visible_start2) {
|
|
4614
4671
|
if (next_focus_item.itemConfig.itemSlide == METRO_WIDGET.ITEM_SLIDE.ACT_ITEM_FOCUS) {
|
|
4615
|
-
visibleInfo.start = cur_visible_start2;
|
|
4616
|
-
const updater2 = pageUpdater.update(
|
|
4617
|
-
metroTemplate,
|
|
4618
|
-
visibleInfo.startWithPadding - props.keepTraceRange * pageRange,
|
|
4619
|
-
Math.min(
|
|
4620
|
-
visibleInfo.startMax + visibleInfo.range + visibleInfo.padding.end - 1,
|
|
4621
|
-
visibleInfo.endWithPadding + props.keepTraceRange * pageRange
|
|
4622
|
-
),
|
|
4623
|
-
next_focus_item.id,
|
|
4624
|
-
false,
|
|
4625
|
-
permanentItemList
|
|
4626
|
-
);
|
|
4627
|
-
updater2.applyTmp();
|
|
4628
4672
|
let animObj = {
|
|
4629
4673
|
easing: "",
|
|
4630
4674
|
onStart: null,
|
|
4631
4675
|
speed: props.slideSetting.Speed,
|
|
4632
|
-
duration: props.slideSetting.Duration
|
|
4633
|
-
onEnd: (animDone) => {
|
|
4634
|
-
updater2.apply();
|
|
4635
|
-
}
|
|
4676
|
+
duration: props.slideSetting.Duration
|
|
4636
4677
|
};
|
|
4637
|
-
_slideTo(
|
|
4678
|
+
_slideTo(cur_visible_start2, animObj, { mergeTmp: false });
|
|
4638
4679
|
} else {
|
|
4639
|
-
const
|
|
4680
|
+
const updater = pageUpdater.update(
|
|
4640
4681
|
metroTemplate,
|
|
4641
4682
|
cur_visible_start2,
|
|
4642
4683
|
cur_visible_start2 + visibleInfo.range + visibleInfo.padding.end - 1,
|
|
@@ -4644,7 +4685,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4644
4685
|
false,
|
|
4645
4686
|
permanentItemList
|
|
4646
4687
|
);
|
|
4647
|
-
|
|
4688
|
+
updater.applyTmp();
|
|
4648
4689
|
}
|
|
4649
4690
|
}
|
|
4650
4691
|
} else {
|
|
@@ -4879,11 +4920,16 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4879
4920
|
const touchLoadItemRect = visibleInfo.range;
|
|
4880
4921
|
const reachAnchorGroup = 2;
|
|
4881
4922
|
const wallConditionGroup = 1;
|
|
4923
|
+
let divPos = -1;
|
|
4924
|
+
let frameCount = -1;
|
|
4882
4925
|
const getVisibleStart = (moveInfo) => {
|
|
4926
|
+
if (frameCount != Forge$1.sFrameCount.count) {
|
|
4927
|
+
divPos = vertical ? slideDivTop.value : slideDivLeft.value;
|
|
4928
|
+
}
|
|
4883
4929
|
if (vertical) {
|
|
4884
|
-
return -(
|
|
4930
|
+
return -(divPos + Math.round(moveInfo.yPos));
|
|
4885
4931
|
} else {
|
|
4886
|
-
return -(
|
|
4932
|
+
return -(divPos + Math.round(moveInfo.xPos));
|
|
4887
4933
|
}
|
|
4888
4934
|
};
|
|
4889
4935
|
const mergeTouchSlideToSlideDiv = () => {
|
|
@@ -4903,10 +4949,20 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4903
4949
|
const onTouchDown = (data) => {
|
|
4904
4950
|
mode.touchStart();
|
|
4905
4951
|
mode.flingEnd();
|
|
4952
|
+
const t = 100;
|
|
4953
|
+
const offsetThreshold = {
|
|
4954
|
+
left: vertical ? void 0 : t,
|
|
4955
|
+
right: vertical ? void 0 : t,
|
|
4956
|
+
top: vertical ? t : void 0,
|
|
4957
|
+
bottom: vertical ? t : void 0
|
|
4958
|
+
};
|
|
4959
|
+
actorController.run([
|
|
4960
|
+
actorController.condition(void 0, false).offsetPosition(offsetThreshold.left, offsetThreshold.top, offsetThreshold.right, offsetThreshold.bottom).then([actorController.state().touchLockSwitch(true, vertical ? 1 : 2, t)]),
|
|
4961
|
+
actorController.condition(void 0, false).startMove(true, true).then([onDragStart])
|
|
4962
|
+
]);
|
|
4906
4963
|
onItemBlur(getItemById(focusId));
|
|
4907
|
-
visibleInfo.start = getVisibleStart(data);
|
|
4908
4964
|
templateItemAdder.tryAddItemByPosition(visibleInfo.end + visibleInfo.range);
|
|
4909
|
-
const
|
|
4965
|
+
const updater = pageUpdater.update(
|
|
4910
4966
|
metroTemplate,
|
|
4911
4967
|
visibleInfo.startWithPadding - visibleInfo.range,
|
|
4912
4968
|
visibleInfo.endWithPadding + visibleInfo.range,
|
|
@@ -4914,7 +4970,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4914
4970
|
false,
|
|
4915
4971
|
permanentItemList
|
|
4916
4972
|
);
|
|
4917
|
-
|
|
4973
|
+
updater.apply();
|
|
4918
4974
|
const anchorArea = 2 * Forge$1.sRenderBridge.GetScreenInfo().designedWidth;
|
|
4919
4975
|
let anchorPosList = [];
|
|
4920
4976
|
let anchorSpacing = visibleInfo.range * 2 / 3;
|
|
@@ -4936,7 +4992,6 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4936
4992
|
};
|
|
4937
4993
|
const onTouchRelease = () => {
|
|
4938
4994
|
if (mode.getTouchState() == TouchState.TAP) {
|
|
4939
|
-
mergeTouchSlideToSlideDiv();
|
|
4940
4995
|
updateRenderItems(false, false);
|
|
4941
4996
|
mode.touchEnd();
|
|
4942
4997
|
}
|
|
@@ -4991,7 +5046,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4991
5046
|
};
|
|
4992
5047
|
const updateRenderItems = (applyTmp, expand) => {
|
|
4993
5048
|
templateItemAdder.tryAddItemByPosition(visibleInfo.start + visibleInfo.range);
|
|
4994
|
-
const
|
|
5049
|
+
const updater = pageUpdater.update(
|
|
4995
5050
|
metroTemplate,
|
|
4996
5051
|
expand ? visibleInfo.start - visibleInfo.range : visibleInfo.startWithPadding,
|
|
4997
5052
|
expand ? visibleInfo.start + 2 * visibleInfo.range : visibleInfo.endWithPadding,
|
|
@@ -4999,7 +5054,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
4999
5054
|
true,
|
|
5000
5055
|
permanentItemList
|
|
5001
5056
|
);
|
|
5002
|
-
applyTmp ?
|
|
5057
|
+
applyTmp ? updater.applyTmp() : updater.apply();
|
|
5003
5058
|
};
|
|
5004
5059
|
const resetDragRect = () => {
|
|
5005
5060
|
if (actorController != null) {
|
|
@@ -5019,11 +5074,15 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
5019
5074
|
const walls = getTouchWall();
|
|
5020
5075
|
actorController.run([
|
|
5021
5076
|
actorController.condition(void 0, true).onTouchDown().then([onTouchDown]),
|
|
5022
|
-
actorController
|
|
5077
|
+
// actorController
|
|
5078
|
+
// .condition(undefined, true)
|
|
5079
|
+
// .onDragStart()
|
|
5080
|
+
// .then([onDragStart]),
|
|
5023
5081
|
actorController.condition(void 0, true).onDragEnd().then([onDragEnd]),
|
|
5024
5082
|
actorController.condition(void 0, true).onFlingStart().then([onFlingStart]),
|
|
5025
5083
|
actorController.condition(void 0, true).onFlingProgress().then([onFlingProgress]),
|
|
5026
5084
|
actorController.condition(void 0, true).onFlingEnd().then([onFlingEnd]),
|
|
5085
|
+
actorController.condition(void 0, true).onTouchRelease().then([actorController.state().touchLockSwitch(false, vertical ? 1 : 2)]),
|
|
5027
5086
|
actorController.condition(wallConditionGroup, true).boxPosition(walls.left, walls.top, walls.right, walls.bottom).then([actorController.state().setHitWallOverflow()])
|
|
5028
5087
|
//TODO 通过prop设置哪个方向overflow
|
|
5029
5088
|
]);
|
|
@@ -5064,7 +5123,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
5064
5123
|
}
|
|
5065
5124
|
focusId = init_focus_id;
|
|
5066
5125
|
visibleInfo.start = cur_visible_start;
|
|
5067
|
-
const
|
|
5126
|
+
const initUpdater = pageUpdater.update(
|
|
5068
5127
|
metroTemplate,
|
|
5069
5128
|
visibleInfo.startWithPadding,
|
|
5070
5129
|
visibleInfo.endWithPadding,
|
|
@@ -5072,7 +5131,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
5072
5131
|
false,
|
|
5073
5132
|
permanentItemList
|
|
5074
5133
|
);
|
|
5075
|
-
|
|
5134
|
+
initUpdater.apply();
|
|
5076
5135
|
onMounted(() => {
|
|
5077
5136
|
_changeFocusId(focusId, false);
|
|
5078
5137
|
mounted = true;
|
|
@@ -5087,7 +5146,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
5087
5146
|
itemRender.value = true;
|
|
5088
5147
|
});
|
|
5089
5148
|
}
|
|
5090
|
-
if (props.
|
|
5149
|
+
if (props.touchFlag === 1) {
|
|
5091
5150
|
initTouch();
|
|
5092
5151
|
}
|
|
5093
5152
|
});
|
|
@@ -5107,7 +5166,8 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
5107
5166
|
setZIndex,
|
|
5108
5167
|
onTouchDown,
|
|
5109
5168
|
onTouchRelease,
|
|
5110
|
-
currentFocusIndex
|
|
5169
|
+
currentFocusIndex,
|
|
5170
|
+
modeForExport
|
|
5111
5171
|
};
|
|
5112
5172
|
};
|
|
5113
5173
|
|
|
@@ -5120,7 +5180,7 @@ const setup = (props, itemRender, locateDiv, renderData, slideDiv, slideDivLeft,
|
|
|
5120
5180
|
|
|
5121
5181
|
|
|
5122
5182
|
*/
|
|
5123
|
-
const _sfc_main$
|
|
5183
|
+
const _sfc_main$G = {
|
|
5124
5184
|
__name: "SlotComponent",
|
|
5125
5185
|
setup(__props) {
|
|
5126
5186
|
onBeforeUpdate(() => {
|
|
@@ -5211,6 +5271,7 @@ const _sfc_main$F = {
|
|
|
5211
5271
|
METRO_WIDGET_CONST.ITEM_SLIDE.ACT_FOCUS_RECT_EVENT 按照子组件发送的focusRect事件滚动
|
|
5212
5272
|
zIndex {int | object}: item的zIndex, 为object时可以分别设置{focus: 0, normal: 0}, 为number时则同时设置获焦和不获焦的zIndex,
|
|
5213
5273
|
uid {string}: item的uid, 可以通过uid来设置焦点
|
|
5274
|
+
permanent {boolean}: 出去与是否保留
|
|
5214
5275
|
}
|
|
5215
5276
|
*
|
|
5216
5277
|
* onFocus {function} 控件获取焦点的回调
|
|
@@ -5379,7 +5440,7 @@ const _sfc_main$F = {
|
|
|
5379
5440
|
|
|
5380
5441
|
|
|
5381
5442
|
*/
|
|
5382
|
-
const _sfc_main$
|
|
5443
|
+
const _sfc_main$F = {
|
|
5383
5444
|
__name: "MetroWidget",
|
|
5384
5445
|
props: {
|
|
5385
5446
|
padding: {
|
|
@@ -5405,10 +5466,6 @@ const _sfc_main$E = {
|
|
|
5405
5466
|
type: Number,
|
|
5406
5467
|
required: true
|
|
5407
5468
|
},
|
|
5408
|
-
loopFocus: {
|
|
5409
|
-
type: Boolean,
|
|
5410
|
-
default: false
|
|
5411
|
-
},
|
|
5412
5469
|
onEdge: {
|
|
5413
5470
|
type: Function,
|
|
5414
5471
|
default: null
|
|
@@ -5514,11 +5571,11 @@ const _sfc_main$E = {
|
|
|
5514
5571
|
},
|
|
5515
5572
|
onAllItemResizeDone: {
|
|
5516
5573
|
type: Function
|
|
5574
|
+
},
|
|
5575
|
+
touchFlag: {
|
|
5576
|
+
type: Number,
|
|
5577
|
+
default: 0
|
|
5517
5578
|
}
|
|
5518
|
-
// enableTouch: {
|
|
5519
|
-
// type: Boolean,
|
|
5520
|
-
// default: false,
|
|
5521
|
-
// },
|
|
5522
5579
|
},
|
|
5523
5580
|
setup(__props, { expose }) {
|
|
5524
5581
|
const props = __props;
|
|
@@ -5554,7 +5611,8 @@ const _sfc_main$E = {
|
|
|
5554
5611
|
exportObject,
|
|
5555
5612
|
onTouchDown,
|
|
5556
5613
|
onTouchRelease,
|
|
5557
|
-
currentFocusIndex
|
|
5614
|
+
currentFocusIndex,
|
|
5615
|
+
modeForExport
|
|
5558
5616
|
} = setup(
|
|
5559
5617
|
props,
|
|
5560
5618
|
itemRender,
|
|
@@ -5645,7 +5703,7 @@ const _sfc_main$E = {
|
|
|
5645
5703
|
ref: item.slotRef,
|
|
5646
5704
|
id: `${__props.name}_${index}`
|
|
5647
5705
|
}, [
|
|
5648
|
-
createVNode(_sfc_main$
|
|
5706
|
+
createVNode(_sfc_main$G, { key: "__QcodeJsviewFreezeComponent" }, {
|
|
5649
5707
|
default: withCtx(() => [
|
|
5650
5708
|
renderSlot(_ctx.$slots, "renderItem", {
|
|
5651
5709
|
data: item.customerData,
|
|
@@ -5663,7 +5721,7 @@ const _sfc_main$E = {
|
|
|
5663
5721
|
style: normalizeStyle({
|
|
5664
5722
|
width: item.renderStyle.width - unref(normalizedPlaceHolder).gap,
|
|
5665
5723
|
height: item.renderStyle.height - unref(normalizedPlaceHolder).gap,
|
|
5666
|
-
backgroundColor: unref(currentFocusIndex) == item.index ? unref(normalizedPlaceHolder).focusBackgroundColor : unref(normalizedPlaceHolder).backgroundColor,
|
|
5724
|
+
backgroundColor: unref(currentFocusIndex) == item.index && unref(modeForExport) == 2 ? unref(normalizedPlaceHolder).focusBackgroundColor : unref(normalizedPlaceHolder).backgroundColor,
|
|
5667
5725
|
borderRadius: unref(normalizedPlaceHolder).borderRadius
|
|
5668
5726
|
})
|
|
5669
5727
|
}, null, 4)) : createCommentVNode("", true)
|
|
@@ -5694,7 +5752,7 @@ const _sfc_main$E = {
|
|
|
5694
5752
|
|
|
5695
5753
|
|
|
5696
5754
|
*/
|
|
5697
|
-
const _sfc_main$
|
|
5755
|
+
const _sfc_main$E = {
|
|
5698
5756
|
__name: "ListWidget",
|
|
5699
5757
|
props: {
|
|
5700
5758
|
padding: {
|
|
@@ -5720,10 +5778,6 @@ const _sfc_main$D = {
|
|
|
5720
5778
|
type: Number,
|
|
5721
5779
|
required: true
|
|
5722
5780
|
},
|
|
5723
|
-
loopFocus: {
|
|
5724
|
-
type: Boolean,
|
|
5725
|
-
default: false
|
|
5726
|
-
},
|
|
5727
5781
|
onEdge: {
|
|
5728
5782
|
type: Function,
|
|
5729
5783
|
default: null
|
|
@@ -5829,11 +5883,11 @@ const _sfc_main$D = {
|
|
|
5829
5883
|
},
|
|
5830
5884
|
onAllItemResizeDone: {
|
|
5831
5885
|
type: Function
|
|
5886
|
+
},
|
|
5887
|
+
touchFlag: {
|
|
5888
|
+
type: Number,
|
|
5889
|
+
default: 0
|
|
5832
5890
|
}
|
|
5833
|
-
// enableTouch: {
|
|
5834
|
-
// type: Boolean,
|
|
5835
|
-
// default: false,
|
|
5836
|
-
// },
|
|
5837
5891
|
},
|
|
5838
5892
|
setup(__props, { expose }) {
|
|
5839
5893
|
const props = __props;
|
|
@@ -6144,7 +6198,7 @@ const HUB_NS_PROVIDE_NAME = "__jsvFocusNameSpace__";
|
|
|
6144
6198
|
|
|
6145
6199
|
|
|
6146
6200
|
*/
|
|
6147
|
-
const _sfc_main$
|
|
6201
|
+
const _sfc_main$D = {
|
|
6148
6202
|
__name: "JsvFocusBlock",
|
|
6149
6203
|
props: {
|
|
6150
6204
|
name: String,
|
|
@@ -6352,7 +6406,7 @@ class JsvFocusManager {
|
|
|
6352
6406
|
}
|
|
6353
6407
|
const doAppMount = this.$_hookMount(app, options[0]);
|
|
6354
6408
|
app.mount = doAppMount;
|
|
6355
|
-
app.component("JsvFocusBlock", _sfc_main$
|
|
6409
|
+
app.component("JsvFocusBlock", _sfc_main$D);
|
|
6356
6410
|
app.config.globalProperties.$jsvFocusManager = this;
|
|
6357
6411
|
app.provide(HUB_NS_PROVIDE_NAME, null);
|
|
6358
6412
|
app.provide(ROOT_HUB_PROVIDE_NAME, new JsvFocusHubApi(this.$_topFDiv.getHub()));
|
|
@@ -8776,7 +8830,7 @@ class JsvActorMoveControl extends ActorControlBase {
|
|
|
8776
8830
|
|
|
8777
8831
|
|
|
8778
8832
|
*/
|
|
8779
|
-
const _sfc_main$
|
|
8833
|
+
const _sfc_main$C = {
|
|
8780
8834
|
__name: "JsvActorMove",
|
|
8781
8835
|
props: {
|
|
8782
8836
|
control: {
|
|
@@ -8829,7 +8883,7 @@ const _sfc_main$B = {
|
|
|
8829
8883
|
|
|
8830
8884
|
|
|
8831
8885
|
*/
|
|
8832
|
-
const _sfc_main$
|
|
8886
|
+
const _sfc_main$B = {
|
|
8833
8887
|
__name: "FreeMoveActor",
|
|
8834
8888
|
props: {
|
|
8835
8889
|
// 设置给父节点,动画节点必须top/left为0, 以保证PC端模拟通过style直接获取当前位置信息的逻辑能通过
|
|
@@ -8915,7 +8969,7 @@ const KeepFlags = {
|
|
|
8915
8969
|
|
|
8916
8970
|
|
|
8917
8971
|
*/
|
|
8918
|
-
const _sfc_main$
|
|
8972
|
+
const _sfc_main$A = {
|
|
8919
8973
|
__name: "JsvEnvBlocker",
|
|
8920
8974
|
props: {
|
|
8921
8975
|
// (支持reactive)位置信息
|
|
@@ -9025,6 +9079,125 @@ let FreeMoveFunc = {
|
|
|
9025
9079
|
newNexus
|
|
9026
9080
|
};
|
|
9027
9081
|
|
|
9082
|
+
//!
|
|
9083
|
+
//! utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue;
|
|
9084
|
+
//!
|
|
9085
|
+
/*! <!--
|
|
9086
|
+
* @Author: donglin.lu@qcast.cn
|
|
9087
|
+
* @Date: 2024-01-26 17:24:00
|
|
9088
|
+
* @LastEditors: donglin.lu@qcast.cn
|
|
9089
|
+
* @Description: file content
|
|
9090
|
+
-->
|
|
9091
|
+
|
|
9092
|
+
<!--
|
|
9093
|
+
* 【模块 export 内容】
|
|
9094
|
+
* JsvFlexDiv: 包装成一个支持flex属性的div
|
|
9095
|
+
* props说明:
|
|
9096
|
+
* class: 等同于div的class设置(目前未实装,后续支持...)
|
|
9097
|
+
* style: 等同于div的style,关于flex的属性支持如下:
|
|
9098
|
+
* 作为container:
|
|
9099
|
+
* flexDirection: row|row-reverse|column|column-reverse 默认row, 决定主轴为行还是列,正向还是反向
|
|
9100
|
+
* flexWrap: nowrap|wrap 默认nowrap, 主轴方向是否换行
|
|
9101
|
+
* justifyContent: flex-start|flex-end|center 默认flex-start
|
|
9102
|
+
* 主轴对齐方式(与direction相关决定start为左还是右)
|
|
9103
|
+
* alignItems: flex-start|flex-end|center|stretch 默认center
|
|
9104
|
+
* 副轴方向单行内的对齐方式,例如主轴为行时,项目在每行中竖直方向的对齐
|
|
9105
|
+
* alignContent: flex-start|flex-end|center 默认flex-start
|
|
9106
|
+
* 副轴方向多行内容总体的对齐方式,例如主轴为行时,项目在每行中竖直方向的对齐
|
|
9107
|
+
* 作为item(二级container):
|
|
9108
|
+
* alignSelf: auto|flex-start|flex-end|center|stretch 默认auto, 覆盖container的alignItems设置
|
|
9109
|
+
* 特别注意: 这些属性会引起位置对齐问题, 所以会自动去掉: "overflow:hidden"
|
|
9110
|
+
* askSize: boolean 设置会跟进flex的尺寸变化,但会降低性能
|
|
9111
|
+
* onSized: Function 比askSize更进一步,可以通过回调知道尺寸变化后的时机,回调参数(width, height)为flex后的尺寸
|
|
9112
|
+
*
|
|
9113
|
+
* expose说明:
|
|
9114
|
+
* getWidth(): 当askSize或者onSize生效时,获取元素的宽度
|
|
9115
|
+
* getHeight(): 当askSize或者onSize生效时,获取元素的高度
|
|
9116
|
+
*
|
|
9117
|
+
-->
|
|
9118
|
+
|
|
9119
|
+
|
|
9120
|
+
|
|
9121
|
+
*/
|
|
9122
|
+
const _sfc_main$z = {
|
|
9123
|
+
__name: "JsvFlexDiv",
|
|
9124
|
+
props: {
|
|
9125
|
+
style: Object,
|
|
9126
|
+
askSize: {
|
|
9127
|
+
type: Boolean,
|
|
9128
|
+
default: false
|
|
9129
|
+
},
|
|
9130
|
+
onSized: {
|
|
9131
|
+
type: Function,
|
|
9132
|
+
default: null
|
|
9133
|
+
}
|
|
9134
|
+
},
|
|
9135
|
+
setup(__props, { expose }) {
|
|
9136
|
+
const props = __props;
|
|
9137
|
+
let config = shallowRef({});
|
|
9138
|
+
config.value["data-jsv-flex-container"] = true;
|
|
9139
|
+
watchEffect(() => {
|
|
9140
|
+
config.value.style = { flexWrap: "nowrap", ...props.style, overflow: "" };
|
|
9141
|
+
});
|
|
9142
|
+
let SizeX = shallowRef(void 0);
|
|
9143
|
+
let SizeY = shallowRef(void 0);
|
|
9144
|
+
let SizeWidth = shallowRef(void 0);
|
|
9145
|
+
let SizeHeight = shallowRef(void 0);
|
|
9146
|
+
let onSizeCallback = (x, y, width, height) => {
|
|
9147
|
+
SizeX.value = x;
|
|
9148
|
+
SizeY.value = y;
|
|
9149
|
+
SizeWidth.value = width;
|
|
9150
|
+
SizeHeight.value = height;
|
|
9151
|
+
if (width != 0 && height != 0) {
|
|
9152
|
+
props.onSized?.(width, height);
|
|
9153
|
+
}
|
|
9154
|
+
};
|
|
9155
|
+
let containerRef = shallowRef(null);
|
|
9156
|
+
let flexCallbackRegisted = false;
|
|
9157
|
+
watchEffect(() => {
|
|
9158
|
+
if ((props.askSize || props.onSized != null) && containerRef.value != null) {
|
|
9159
|
+
if (!flexCallbackRegisted) {
|
|
9160
|
+
containerRef.value.jsvGetProxyView().RegisterFlexAssigned(onSizeCallback);
|
|
9161
|
+
flexCallbackRegisted = true;
|
|
9162
|
+
}
|
|
9163
|
+
} else {
|
|
9164
|
+
if (flexCallbackRegisted) {
|
|
9165
|
+
containerRef.value.jsvGetProxyView().RegisterFlexAssigned(null);
|
|
9166
|
+
flexCallbackRegisted = false;
|
|
9167
|
+
}
|
|
9168
|
+
}
|
|
9169
|
+
});
|
|
9170
|
+
expose({
|
|
9171
|
+
// TODO: PC模拟环境中目前没有浏览器的类似ResizeObserver接口
|
|
9172
|
+
// 可以监听到left/ top变化,所以先关闭Left / Top的获取
|
|
9173
|
+
// getLeft: () => {
|
|
9174
|
+
// return SizeX.value;
|
|
9175
|
+
// },
|
|
9176
|
+
// getTop: () => {
|
|
9177
|
+
// return SizeY.value;
|
|
9178
|
+
// },
|
|
9179
|
+
getWidth: () => {
|
|
9180
|
+
return SizeWidth.value;
|
|
9181
|
+
},
|
|
9182
|
+
getHeight: () => {
|
|
9183
|
+
return SizeHeight.value;
|
|
9184
|
+
}
|
|
9185
|
+
});
|
|
9186
|
+
return (_ctx, _cache) => {
|
|
9187
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
9188
|
+
ref_key: "containerRef",
|
|
9189
|
+
ref: containerRef
|
|
9190
|
+
}, { ..._ctx.$attrs, ...unref(config) }), [
|
|
9191
|
+
renderSlot(_ctx.$slots, "default")
|
|
9192
|
+
], 16);
|
|
9193
|
+
};
|
|
9194
|
+
}
|
|
9195
|
+
};
|
|
9196
|
+
|
|
9197
|
+
//!
|
|
9198
|
+
//! utils/JsViewVueWidget/JsvFlexCell/index.js;
|
|
9199
|
+
//!
|
|
9200
|
+
|
|
9028
9201
|
//!
|
|
9029
9202
|
//! utils/JsViewVueTools/ForgeHandles.js;
|
|
9030
9203
|
//!
|
|
@@ -10390,6 +10563,15 @@ let buildPreloadInfo = buildPreloadInfo$1;
|
|
|
10390
10563
|
let buildDownloadInfo = buildDownloadInfo$1;
|
|
10391
10564
|
const JsvPreload = _JsvPreload;
|
|
10392
10565
|
|
|
10566
|
+
//!
|
|
10567
|
+
//! utils/JsViewVueTools/JsvTextureDefines.ts;
|
|
10568
|
+
//!
|
|
10569
|
+
class TextureInstantType {
|
|
10570
|
+
static Auto = Forge$2.TextureInstantLoad.AUTO;
|
|
10571
|
+
static Sync = Forge$2.TextureInstantLoad.SYNC;
|
|
10572
|
+
static Async = Forge$2.TextureInstantLoad.ASYNC;
|
|
10573
|
+
}
|
|
10574
|
+
|
|
10393
10575
|
//!
|
|
10394
10576
|
//! utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue;
|
|
10395
10577
|
//!
|
|
@@ -10402,6 +10584,8 @@ const JsvPreload = _JsvPreload;
|
|
|
10402
10584
|
* fgColor {string} 二维码前景色,默认值"#000000",黑色
|
|
10403
10585
|
* bgColor {string} 二维码背景色,默认值"#ffffff",白色
|
|
10404
10586
|
* level {string} 二维码的容错能力,可选值{'L':低, 'M':中, 'H':高, 'Q':最精细},默认值'L'
|
|
10587
|
+
* instant {string} 是否立即加载(auto, sync, async), auto = async
|
|
10588
|
+
* 是否当前帧限制(默认为非当前帧显示,不影响按键响应,但是会闪)
|
|
10405
10589
|
* imageSettings {Object} 设置中心logo图片,默认值为null,设置格式为:
|
|
10406
10590
|
* {
|
|
10407
10591
|
* src {string} logo的url地址
|
|
@@ -10409,9 +10593,8 @@ const JsvPreload = _JsvPreload;
|
|
|
10409
10593
|
* height {int} logo的高度
|
|
10410
10594
|
* }
|
|
10411
10595
|
-->
|
|
10412
|
-
|
|
10413
10596
|
|
|
10414
|
-
|
|
10597
|
+
|
|
10415
10598
|
|
|
10416
10599
|
*/
|
|
10417
10600
|
const _sfc_main$t = {
|
|
@@ -10431,6 +10614,12 @@ const _sfc_main$t = {
|
|
|
10431
10614
|
// ,容错级别,分别是L(7%)、M(15%)、Q(25%)、H(30%),
|
|
10432
10615
|
default: "L"
|
|
10433
10616
|
},
|
|
10617
|
+
sync: {
|
|
10618
|
+
// 是否当前帧限制(默认为非当前帧显示,不影响按键响应,但是会闪)
|
|
10619
|
+
type: String,
|
|
10620
|
+
default: "auto"
|
|
10621
|
+
// QrCode的 auto = async
|
|
10622
|
+
},
|
|
10434
10623
|
imageSettings: Object
|
|
10435
10624
|
},
|
|
10436
10625
|
methods: {
|
|
@@ -10452,10 +10641,23 @@ const _sfc_main$t = {
|
|
|
10452
10641
|
let view = null;
|
|
10453
10642
|
let lp_params = null;
|
|
10454
10643
|
const texture_manager = handles.TextureManager;
|
|
10644
|
+
let instantLoad;
|
|
10645
|
+
switch (this.sync) {
|
|
10646
|
+
case "sync":
|
|
10647
|
+
instantLoad = TextureInstantType.Sync;
|
|
10648
|
+
break;
|
|
10649
|
+
case "async":
|
|
10650
|
+
instantLoad = TextureInstantType.Async;
|
|
10651
|
+
break;
|
|
10652
|
+
case "auto":
|
|
10653
|
+
default:
|
|
10654
|
+
instantLoad = TextureInstantType.Auto;
|
|
10655
|
+
}
|
|
10455
10656
|
const qrcode_texture = texture_manager.GetQRCodeTexture(
|
|
10456
10657
|
this.value,
|
|
10457
10658
|
this.size,
|
|
10458
10659
|
this.size,
|
|
10660
|
+
instantLoad,
|
|
10459
10661
|
Forge$1.QRCodeLevel[this.level],
|
|
10460
10662
|
this.bgColor,
|
|
10461
10663
|
this.fgColor
|
|
@@ -11667,7 +11869,7 @@ const keyCode2EdgeDirection = (keyCode) => {
|
|
|
11667
11869
|
}
|
|
11668
11870
|
};
|
|
11669
11871
|
const _sfc_main$o = {
|
|
11670
|
-
components: { JsvActorMove: _sfc_main$
|
|
11872
|
+
components: { JsvActorMove: _sfc_main$C, JsvVisibleSensor },
|
|
11671
11873
|
props: {
|
|
11672
11874
|
showIndicator: {
|
|
11673
11875
|
type: Boolean,
|
|
@@ -12199,14 +12401,18 @@ const _sfc_main$n = {
|
|
|
12199
12401
|
},
|
|
12200
12402
|
setup(__props) {
|
|
12201
12403
|
const props = __props;
|
|
12404
|
+
let showNumber = props.dispNumber < 3 ? 3 : props.dispNumber;
|
|
12405
|
+
if (showNumber % 2 == 0) {
|
|
12406
|
+
showNumber = showNumber + 1;
|
|
12407
|
+
}
|
|
12408
|
+
let items = shallowReactive(new Array(showNumber + 2));
|
|
12202
12409
|
let currentId;
|
|
12203
12410
|
let preFocusedIdx;
|
|
12204
12411
|
if (props.initIndex == void 0) {
|
|
12205
|
-
currentId = Math.floor(
|
|
12412
|
+
currentId = Math.floor(showNumber / 2);
|
|
12206
12413
|
} else {
|
|
12207
12414
|
currentId = props.initIndex;
|
|
12208
12415
|
}
|
|
12209
|
-
let items = reactive(new Array(props.dispNumber + 2));
|
|
12210
12416
|
let allItems = [];
|
|
12211
12417
|
let length = props.ItemArray.length;
|
|
12212
12418
|
if (length < props.dispNumber) {
|
|
@@ -12214,17 +12420,22 @@ const _sfc_main$n = {
|
|
|
12214
12420
|
} else {
|
|
12215
12421
|
for (let i = 0; i < props.ItemArray.length; i++) {
|
|
12216
12422
|
allItems.push({
|
|
12217
|
-
|
|
12218
|
-
dataIndex: i
|
|
12423
|
+
propsItem: props.ItemArray[i],
|
|
12424
|
+
dataIndex: i,
|
|
12425
|
+
defineSize: {
|
|
12426
|
+
top: null,
|
|
12427
|
+
width: null,
|
|
12428
|
+
height: null
|
|
12429
|
+
}
|
|
12219
12430
|
});
|
|
12220
12431
|
}
|
|
12221
12432
|
}
|
|
12222
12433
|
let space = shallowRef(0);
|
|
12223
12434
|
let direction = "left";
|
|
12224
12435
|
let focusedIdx = currentId;
|
|
12225
|
-
let prevNumber = Math.floor(
|
|
12436
|
+
let prevNumber = Math.floor(showNumber / 2) + 1;
|
|
12226
12437
|
const move1 = () => {
|
|
12227
|
-
for (let i = 0; i <
|
|
12438
|
+
for (let i = 0; i < showNumber + 2; i++) {
|
|
12228
12439
|
let itemIdx = focusedIdx - prevNumber + i;
|
|
12229
12440
|
if (itemIdx < 0) {
|
|
12230
12441
|
itemIdx += props.ItemArray.length;
|
|
@@ -12255,7 +12466,7 @@ const _sfc_main$n = {
|
|
|
12255
12466
|
if (index == items.length - 2) {
|
|
12256
12467
|
let startPosX = props.layoutInfo.width / 2;
|
|
12257
12468
|
let endPosX = props.layoutInfo.width - width / 2;
|
|
12258
|
-
space.value = (endPosX - startPosX) / ((
|
|
12469
|
+
space.value = (endPosX - startPosX) / ((showNumber - 1) / 2);
|
|
12259
12470
|
}
|
|
12260
12471
|
leftArray[index] = { index, width };
|
|
12261
12472
|
}
|
|
@@ -12291,12 +12502,12 @@ const _sfc_main$n = {
|
|
|
12291
12502
|
if (index == items.length - 2) {
|
|
12292
12503
|
let startPosX = props.layoutInfo.width / 2;
|
|
12293
12504
|
let endPosX = props.layoutInfo.width - width / 2;
|
|
12294
|
-
space.value = (endPosX - startPosX) / ((
|
|
12505
|
+
space.value = (endPosX - startPosX) / ((showNumber - 1) / 2);
|
|
12295
12506
|
}
|
|
12296
12507
|
left = leftArray[index].left;
|
|
12297
|
-
items[index].top = top;
|
|
12298
|
-
items[index].width = width;
|
|
12299
|
-
items[index].height = height;
|
|
12508
|
+
items[index].defineSize.top = top;
|
|
12509
|
+
items[index].defineSize.width = width;
|
|
12510
|
+
items[index].defineSize.height = height;
|
|
12300
12511
|
return {
|
|
12301
12512
|
zIndex,
|
|
12302
12513
|
left,
|
|
@@ -12309,10 +12520,8 @@ const _sfc_main$n = {
|
|
|
12309
12520
|
const scaleItemStyle = (index) => {
|
|
12310
12521
|
const currentIndex = Math.abs(index - Math.floor(items.length / 2));
|
|
12311
12522
|
const scale = 1 - currentIndex * props.sideScale;
|
|
12312
|
-
const backgroundImage = items[index].image;
|
|
12313
12523
|
const width = props.initItemStyle.width * scale;
|
|
12314
12524
|
const height = props.initItemStyle.height * scale;
|
|
12315
|
-
items[index].backgroundImage = backgroundImage;
|
|
12316
12525
|
if (direction == "left") {
|
|
12317
12526
|
return {
|
|
12318
12527
|
width,
|
|
@@ -12562,7 +12771,7 @@ const _sfc_main$n = {
|
|
|
12562
12771
|
}, [
|
|
12563
12772
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item, index) => {
|
|
12564
12773
|
return openBlock(), createElementBlock("div", {
|
|
12565
|
-
key: item
|
|
12774
|
+
key: item + `${index}`,
|
|
12566
12775
|
style: normalizeStyle(getItemStyle(index))
|
|
12567
12776
|
}, [
|
|
12568
12777
|
createElementVNode("div", {
|
|
@@ -12570,7 +12779,8 @@ const _sfc_main$n = {
|
|
|
12570
12779
|
}, [
|
|
12571
12780
|
renderSlot(_ctx.$slots, "itemView", {
|
|
12572
12781
|
dataIndex: item.dataIndex,
|
|
12573
|
-
item
|
|
12782
|
+
propsItem: item.propsItem,
|
|
12783
|
+
defineSize: item.defineSize
|
|
12574
12784
|
})
|
|
12575
12785
|
], 4)
|
|
12576
12786
|
], 4);
|
|
@@ -15100,7 +15310,7 @@ const CMD_DRAW_CIRCLE_WITH_PAINT = 12;
|
|
|
15100
15310
|
const CMD_DRAW_RECT_WITH_PAINT = 13;
|
|
15101
15311
|
const CMD_DRAW_PATH_WITH_PAINT = 14;
|
|
15102
15312
|
const CMD_DRAW_LINE = 15;
|
|
15103
|
-
const
|
|
15313
|
+
const CMD_DRAW_LINEAR_GRADIENT_RECT = 16;
|
|
15104
15314
|
//! Path的子命令
|
|
15105
15315
|
const PATH_CMD_MOVE_TO = 30;
|
|
15106
15316
|
const PATH_CMD_LINE_TO = 31;
|
|
@@ -15289,6 +15499,7 @@ class CanvasTexture extends TextureBase {
|
|
|
15289
15499
|
drawCommands = [];
|
|
15290
15500
|
commited = false;
|
|
15291
15501
|
// commit只能执行一次, 执行过后无法再更改texture内容
|
|
15502
|
+
instantLoad = TextureInstantType.Sync;
|
|
15292
15503
|
/**
|
|
15293
15504
|
* canvasTexture
|
|
15294
15505
|
*
|
|
@@ -15408,9 +15619,13 @@ class CanvasTexture extends TextureBase {
|
|
|
15408
15619
|
* @param {Array<String>} colorArray 颜色设定的数组
|
|
15409
15620
|
* @param {Array<double>} stopsArray 与color数组个数相同,颜色基准点位置
|
|
15410
15621
|
*/
|
|
15411
|
-
|
|
15622
|
+
drawLinearGradientRect(fromX, fromY, toX, toY, colorArray, stopsArray) {
|
|
15623
|
+
if (!colorArray || !stopsArray || colorArray.length !== stopsArray.length) {
|
|
15624
|
+
console.error("CanvasTexture error: drawLinearGradientRect colorArray.length must be equal to stopsArray.length. Current array is:", Array.from(colorArray), Array.from(stopsArray));
|
|
15625
|
+
return;
|
|
15626
|
+
}
|
|
15412
15627
|
this.drawCommands?.push({
|
|
15413
|
-
"cmd":
|
|
15628
|
+
"cmd": CMD_DRAW_LINEAR_GRADIENT_RECT,
|
|
15414
15629
|
"x0": fromX,
|
|
15415
15630
|
"y0": fromY,
|
|
15416
15631
|
"x1": toX,
|
|
@@ -15419,10 +15634,27 @@ class CanvasTexture extends TextureBase {
|
|
|
15419
15634
|
"stops": stopsArray
|
|
15420
15635
|
});
|
|
15421
15636
|
}
|
|
15637
|
+
/**
|
|
15638
|
+
* setAsyncLoad
|
|
15639
|
+
* texture异步加载,让界面不会卡顿
|
|
15640
|
+
*
|
|
15641
|
+
* @param {int} fromX 绘制起点X
|
|
15642
|
+
* @param {int} fromY 绘制起点Y
|
|
15643
|
+
* @param {int} toX 绘制终点X
|
|
15644
|
+
* @param {int} toY 绘制终点Y
|
|
15645
|
+
* @param {Array<String>} colorArray 颜色设定的数组
|
|
15646
|
+
* @param {Array<double>} stopsArray 与color数组个数相同,颜色基准点位置
|
|
15647
|
+
*/
|
|
15648
|
+
setAsyncLoad() {
|
|
15649
|
+
this.instantLoad = TextureInstantType.Async;
|
|
15650
|
+
}
|
|
15422
15651
|
// override
|
|
15423
15652
|
commit() {
|
|
15424
15653
|
if (!this.commited) {
|
|
15425
|
-
this.textureRef = handles.TextureManager.GetCanvasTexture(
|
|
15654
|
+
this.textureRef = handles.TextureManager.GetCanvasTexture(
|
|
15655
|
+
JSON.stringify(this.drawCommands),
|
|
15656
|
+
this.instantLoad
|
|
15657
|
+
);
|
|
15426
15658
|
this.addToStore();
|
|
15427
15659
|
this.commited = true;
|
|
15428
15660
|
this.drawCommands = null;
|
|
@@ -15472,26 +15704,6 @@ let sTextureStoreApi = {
|
|
|
15472
15704
|
canvasTexture: (width, height, baseName) => {
|
|
15473
15705
|
return new CanvasTexture(width, height, baseName);
|
|
15474
15706
|
},
|
|
15475
|
-
/**
|
|
15476
|
-
* getLinearGradientTexture
|
|
15477
|
-
* 按照要求创建一个绘制渐变色的纹理,
|
|
15478
|
-
* 绘制从起始位置到终止位置的一条线,
|
|
15479
|
-
* 例如从右边上的中点绘制到上边缘的中点的直线: RIGHT:0.5 -> TOP:0.5
|
|
15480
|
-
* 返回值为访问名
|
|
15481
|
-
*
|
|
15482
|
-
* @param {int} startSide JsvTextureConst的 LEFT/TOP/RIGHT/BOTTOM, 起始位置
|
|
15483
|
-
* @param {double} startSidePercent 起始点在所在边的比例位置
|
|
15484
|
-
* @param {int} endSide JsvTextureConst的 LEFT/TOP/RIGHT/BOTTOM, 终止位置
|
|
15485
|
-
* @param {double} endSidePercent 终止点在所在边的比例位置
|
|
15486
|
-
* @param {Array<String>} colorArray 颜色基准点的颜色队列
|
|
15487
|
-
* @param {int} stopsDenominator stops信息百分比的分母,值越小其texture越省内存
|
|
15488
|
-
* @param {Array<int>} stopsArray 颜色基准点的百分比的分子队列
|
|
15489
|
-
*
|
|
15490
|
-
* @return {String} 此Texture的访问名,可以在 img.src 或者 div.backgroundImage 通过 "texturestore://访问名"使用
|
|
15491
|
-
*/
|
|
15492
|
-
getLinearGradientTexture: (startSide, startSidePercent, endSide, endSidePercent, colorArray, stopsDenominator, stopsArray) => {
|
|
15493
|
-
return "";
|
|
15494
|
-
},
|
|
15495
15707
|
/**
|
|
15496
15708
|
* deleteTexture
|
|
15497
15709
|
* 删除commit后的texture
|
|
@@ -16025,11 +16237,11 @@ const _sfc_main$h = {
|
|
|
16025
16237
|
},
|
|
16026
16238
|
_initForHtml() {
|
|
16027
16239
|
let _this = this;
|
|
16028
|
-
this.$refs.
|
|
16240
|
+
this.$refs.innerViewDiv?.jsvGetProxyView(true).RegisterOnProxyReady(() => {
|
|
16029
16241
|
const canvas = window.originDocument.createElement("canvas");
|
|
16030
16242
|
canvas.style.width = _this.style.width + "px";
|
|
16031
16243
|
canvas.style.height = _this.style.height + "px";
|
|
16032
|
-
_this.$refs.
|
|
16244
|
+
_this.$refs.innerViewDiv?.jsvGetProxyView(true).HtmlGetElement().appendChild(canvas);
|
|
16033
16245
|
const clip_image = new Image();
|
|
16034
16246
|
const bg_image = new Image();
|
|
16035
16247
|
clip_image.src = _this.maskSrc;
|
|
@@ -16097,14 +16309,13 @@ const _sfc_main$h = {
|
|
|
16097
16309
|
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
16098
16310
|
return $setup.html ? (openBlock(), createElementBlock("div", {
|
|
16099
16311
|
key: 0,
|
|
16100
|
-
ref: "
|
|
16312
|
+
ref: "innerViewDiv",
|
|
16101
16313
|
style: normalizeStyle({
|
|
16102
16314
|
top: $props.style.top,
|
|
16103
16315
|
left: $props.style.left
|
|
16104
16316
|
})
|
|
16105
16317
|
}, null, 4)) : (openBlock(), createElementBlock("div", {
|
|
16106
16318
|
key: 1,
|
|
16107
|
-
ref: "innerView",
|
|
16108
16319
|
"data-jsv-vw-innerview": $setup.innerViewId,
|
|
16109
16320
|
style: normalizeStyle({
|
|
16110
16321
|
top: $props.style.top,
|
|
@@ -16636,53 +16847,39 @@ const _sfc_main$c = {
|
|
|
16636
16847
|
},
|
|
16637
16848
|
setup(__props) {
|
|
16638
16849
|
const props = __props;
|
|
16639
|
-
const
|
|
16640
|
-
|
|
16641
|
-
|
|
16642
|
-
|
|
16643
|
-
|
|
16644
|
-
|
|
16645
|
-
|
|
16850
|
+
const computeAlignItems = computed(() => {
|
|
16851
|
+
switch (props.verticalAlign) {
|
|
16852
|
+
case "top":
|
|
16853
|
+
return "flex-start";
|
|
16854
|
+
case "bottom":
|
|
16855
|
+
return "flex-end";
|
|
16856
|
+
default:
|
|
16857
|
+
case "center":
|
|
16858
|
+
return "center";
|
|
16646
16859
|
}
|
|
16647
|
-
return result;
|
|
16648
16860
|
});
|
|
16649
|
-
const disable = window.JsvDisableReactWrapper;
|
|
16650
16861
|
return (_ctx, _cache) => {
|
|
16651
|
-
return openBlock(),
|
|
16652
|
-
|
|
16653
|
-
|
|
16654
|
-
|
|
16655
|
-
|
|
16656
|
-
|
|
16657
|
-
|
|
16658
|
-
|
|
16659
|
-
|
|
16660
|
-
|
|
16661
|
-
|
|
16662
|
-
|
|
16663
|
-
|
|
16664
|
-
|
|
16665
|
-
|
|
16666
|
-
|
|
16667
|
-
|
|
16668
|
-
|
|
16669
|
-
|
|
16670
|
-
|
|
16671
|
-
|
|
16672
|
-
key: 1,
|
|
16673
|
-
className: __props.className,
|
|
16674
|
-
style: normalizeStyle({
|
|
16675
|
-
...__props.style,
|
|
16676
|
-
JsvTextLatex: __props.enableLatex ? 1 : 0,
|
|
16677
|
-
JsvTextVerticalAlign: __props.verticalAlign,
|
|
16678
|
-
JsvTextLineAlign: __props.lineAlign,
|
|
16679
|
-
JsvTextInnerDirection: __props.textDirection
|
|
16680
|
-
}),
|
|
16681
|
-
"jsv-inherit-class": "1"
|
|
16682
|
-
}, [
|
|
16683
|
-
renderSlot(_ctx.$slots, "default")
|
|
16684
|
-
], 12, ["className"]))
|
|
16685
|
-
]);
|
|
16862
|
+
return openBlock(), createBlock(unref(_sfc_main$z), {
|
|
16863
|
+
style: normalizeStyle({
|
|
16864
|
+
...props.style,
|
|
16865
|
+
flexDirection: "row",
|
|
16866
|
+
alignItems: unref(computeAlignItems)
|
|
16867
|
+
})
|
|
16868
|
+
}, {
|
|
16869
|
+
default: withCtx(() => [
|
|
16870
|
+
createElementVNode("div", {
|
|
16871
|
+
style: normalizeStyle({
|
|
16872
|
+
width: props.style.width,
|
|
16873
|
+
JsvTextLatex: __props.enableLatex ? 1 : 0,
|
|
16874
|
+
JsvTextLineAlign: __props.lineAlign,
|
|
16875
|
+
JsvTextInnerDirection: __props.textDirection
|
|
16876
|
+
})
|
|
16877
|
+
}, [
|
|
16878
|
+
renderSlot(_ctx.$slots, "default")
|
|
16879
|
+
], 4)
|
|
16880
|
+
]),
|
|
16881
|
+
_: 3
|
|
16882
|
+
}, 8, ["style"]);
|
|
16686
16883
|
};
|
|
16687
16884
|
}
|
|
16688
16885
|
};
|
|
@@ -17349,20 +17546,21 @@ const _sfc_main$7 = {
|
|
|
17349
17546
|
let totalPercent = 0;
|
|
17350
17547
|
data.forEach((item) => {
|
|
17351
17548
|
if (!item.hasOwnProperty("percent")) {
|
|
17352
|
-
|
|
17549
|
+
console.error("每一项必须包含percent属性");
|
|
17353
17550
|
}
|
|
17354
|
-
if (item.percent
|
|
17355
|
-
|
|
17551
|
+
if (item.percent < 0 || item.percent > 100) {
|
|
17552
|
+
console.error("每一项percent必须大于0或者小于等于100!");
|
|
17356
17553
|
}
|
|
17357
17554
|
totalPercent += item.percent;
|
|
17358
17555
|
});
|
|
17359
17556
|
if (totalPercent < 99 || totalPercent > 101) {
|
|
17360
|
-
|
|
17557
|
+
console.error("percent属性值总和必须等于100!");
|
|
17361
17558
|
}
|
|
17362
17559
|
return true;
|
|
17363
17560
|
};
|
|
17364
17561
|
CheckData(props.data);
|
|
17365
17562
|
let finalData = reactive([]);
|
|
17563
|
+
let TempAngleArray = [];
|
|
17366
17564
|
const filterData = (data) => {
|
|
17367
17565
|
data.forEach((item, index) => {
|
|
17368
17566
|
if (item.percent > previousPercent[index]) {
|
|
@@ -17372,7 +17570,7 @@ const _sfc_main$7 = {
|
|
|
17372
17570
|
} else {
|
|
17373
17571
|
extraTimeArray[index] = 0;
|
|
17374
17572
|
}
|
|
17375
|
-
|
|
17573
|
+
TempAngleArray.push((item.percent / 100 * 360).toFixed(2));
|
|
17376
17574
|
if (index == 0) {
|
|
17377
17575
|
finalData.push({
|
|
17378
17576
|
startAngle: Number(0).toFixed(2),
|
|
@@ -17384,54 +17582,50 @@ const _sfc_main$7 = {
|
|
|
17384
17582
|
} else {
|
|
17385
17583
|
finalData.push({
|
|
17386
17584
|
startAngle: (Number(finalData[index - 1].startAngle) + Number(finalData[index - 1].sweepAngle)).toFixed(2),
|
|
17387
|
-
sweepAngle: Number(
|
|
17585
|
+
sweepAngle: Number(TempAngleArray[index]).toFixed(2),
|
|
17388
17586
|
color: item.color,
|
|
17389
17587
|
index,
|
|
17390
17588
|
extraTime: extraTimeArray[index]
|
|
17391
17589
|
});
|
|
17392
17590
|
}
|
|
17393
17591
|
});
|
|
17592
|
+
TempAngleArray = [];
|
|
17394
17593
|
};
|
|
17395
17594
|
filterData(myData);
|
|
17396
|
-
|
|
17397
|
-
props.data
|
|
17398
|
-
|
|
17399
|
-
|
|
17400
|
-
|
|
17401
|
-
|
|
17402
|
-
|
|
17403
|
-
|
|
17404
|
-
|
|
17405
|
-
|
|
17406
|
-
|
|
17407
|
-
|
|
17408
|
-
previousPercent = [];
|
|
17409
|
-
extraTimeArray = [];
|
|
17410
|
-
myData.forEach((item, index) => {
|
|
17411
|
-
previousPercent.push(item.percent);
|
|
17412
|
-
extraTimeArray.push(0);
|
|
17413
|
-
});
|
|
17414
|
-
n.forEach((item, index) => {
|
|
17415
|
-
previousPercent.push(item.percent);
|
|
17416
|
-
});
|
|
17595
|
+
watchEffect(() => {
|
|
17596
|
+
if (CheckData(props.data)) {
|
|
17597
|
+
finalData.splice(0, finalData.length);
|
|
17598
|
+
filterData(props.data);
|
|
17599
|
+
myData = props.data;
|
|
17600
|
+
previousPercent = [];
|
|
17601
|
+
extraTimeArray = [];
|
|
17602
|
+
myData.forEach((item, index) => {
|
|
17603
|
+
previousPercent.push(item.percent);
|
|
17604
|
+
extraTimeArray.push(0);
|
|
17605
|
+
});
|
|
17606
|
+
}
|
|
17417
17607
|
});
|
|
17418
17608
|
return (_ctx, _cache) => {
|
|
17419
|
-
return openBlock(
|
|
17420
|
-
|
|
17421
|
-
|
|
17422
|
-
|
|
17423
|
-
|
|
17424
|
-
|
|
17425
|
-
|
|
17426
|
-
|
|
17427
|
-
|
|
17428
|
-
|
|
17429
|
-
|
|
17430
|
-
|
|
17431
|
-
|
|
17432
|
-
|
|
17433
|
-
|
|
17434
|
-
|
|
17609
|
+
return openBlock(), createElementBlock("div", {
|
|
17610
|
+
key: "pie-" + unref(finalData).length
|
|
17611
|
+
}, [
|
|
17612
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(finalData).slice().reverse(), (item, index) => {
|
|
17613
|
+
return openBlock(), createElementBlock("div", null, [
|
|
17614
|
+
(openBlock(), createBlock(_sfc_main$8, {
|
|
17615
|
+
radius: props.radius,
|
|
17616
|
+
config: {
|
|
17617
|
+
startAngle: Number(item.startAngle),
|
|
17618
|
+
sweepAngle: unref(finalData).length == 1 || item.sweepAngle == 360 ? Number(item.sweepAngle) : Number(item.sweepAngle) + 1,
|
|
17619
|
+
color: item.color
|
|
17620
|
+
},
|
|
17621
|
+
key: `indexZ${index}`,
|
|
17622
|
+
animationTime: props.animationTime,
|
|
17623
|
+
centerPosition: props.centerPosition,
|
|
17624
|
+
extraTime: item.extraTime
|
|
17625
|
+
}, null, 8, ["radius", "config", "animationTime", "centerPosition", "extraTime"]))
|
|
17626
|
+
]);
|
|
17627
|
+
}), 256))
|
|
17628
|
+
]);
|
|
17435
17629
|
};
|
|
17436
17630
|
}
|
|
17437
17631
|
};
|
|
@@ -21206,4 +21400,4 @@ if (!window.JsView) {
|
|
|
21206
21400
|
//! utils/index.js;
|
|
21207
21401
|
//!
|
|
21208
21402
|
|
|
21209
|
-
export { BaseDispatcher, DECORATE_BORDER_RADIUS, DECORATE_NINEPATCH_ALPHA_MIX, DebugObjectRefer, DebugTools, DebugWrap81ErrorStack, DebugWrap81WarnStack, DefaultKeyCodeMap, EdgeDirection, FixPositionSlide, FocusMoveType, FreeMoveDef, FreeMoveFunc, HORIZONTAL, InputType, instance as JSBridge, JsvAccount, _sfc_main$
|
|
21403
|
+
export { BaseDispatcher, DECORATE_BORDER_RADIUS, DECORATE_NINEPATCH_ALPHA_MIX, DebugObjectRefer, DebugTools, DebugWrap81ErrorStack, DebugWrap81WarnStack, DefaultKeyCodeMap, EdgeDirection, FixPositionSlide, FocusMoveType, FreeMoveDef, FreeMoveFunc, HORIZONTAL, InputType, instance as JSBridge, JsvAccount, _sfc_main$C as JsvActorMove, JsvActorMoveControl, _JsvApic$1 as JsvApic, _JsvApic2$1 as JsvApic2, _JsvAudio as JsvAudio, _sfc_main$6 as JsvConnectLine, _sfc_main$4 as JsvEnableRenderBreak, _sfc_main$A as JsvEnvBlocker, _sfc_main$l as JsvFilterView, _sfc_main$z as JsvFlexDiv, _sfc_main$D as JsvFocusBlock, _sfc_main$B as JsvFreeMoveActor, JsvGrid, JsvNativeSharedDiv as JsvHole, JsvInput, _JsvLatex as JsvLatex, JsvLine, _sfc_main$i as JsvMarquee, JsvMaskClipDiv, _sfc_main$3 as JsvMindMap, JsvNativeSharedDiv, _sfc_main$g as JsvNinePatch, JsvPerformance, _sfc_main$7 as JsvPieChart, _JsvPlayer as JsvPlayer, _sfc_main$f as JsvPosterDiv, _sfc_main$e as JsvPosterImage, exportObj as JsvPreDownloader, JsvPreload, _sfc_main$5 as JsvProgressBar, _JsvQrcode$1 as JsvQrcode, _sfc_main$b as JsvRadarChart, _sfc_main$a as JsvRipple, JsvRippleShape, JsvScaleTextBox, _sfc_main$8 as JsvSector, JsvSoundPool, _JsvSpray$1 as JsvSpray, JsvSpriteAnim, _sfc_main$q as JsvSpriteLoader, JsvStyleClass, JsvStyleSheetsDeclarer, JsvSwiper, _sfc_main$n as JsvSwiper3D, _sfc_main$c as JsvTextBox, JsvTextStyleClass, _JsvTextureAnim$1 as JsvTextureAnim, sJsvTextureConst as JsvTextureConst, sTextureStoreApi as JsvTextureStoreApi, JsvNativeSharedDiv as JsvTransparentDiv, JsvVisibleSensor, LineType, _sfc_main$E as ListWidget, LoopType, METRO_WIDGET, METRO_WIDGET as METRO_WIDGET_CONST, _sfc_main$F as MetroWidget, PageType, RENDER_ITEM_BREAK_KEY, Dispatcher as SWidgetDispatcher, SeamlessSlide, _sfc_main$F as SimpleWidget, SlideSetting, SlideStyle, SpriteController, TexAlignAnchor, TextTools, TextureInstantType, VERTICAL, WholePageSlide, buildDownloadInfo, buildPreloadInfo, combinedStyles, createImpactAutoFroze, createImpactCallback, createImpactTracer, disableNativeViewListener, enableNativeViewListener, getCssStyleGroup, getJsvPlayerCapabilitySet, getJsvPlayerRunningNum, getKeyFramesGroup, getMeasureObj, getPositionRelativeToView, getTextWidth, globalLoadJsvAudioPlugin, globalLoadJsvLatexPlugin, globalLoadJsvPlayerPlugin, globalLoadSetOperator, globalPreLoadJsvPlayerPlugin, bridge as jJsvRuntimeBridge, jsvCreateFocusManager, jsvCreateHashHistory, numberCheckSet, setJsvPlayerDebugMode, toHtmlBorderSet, toNinePatchForgeViewSet, updateImpactAutoFroze, urlCheckSet, useFocusHub };
|