@shijiu/jsview-vue 2.1.482-test.0 → 2.2.35
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/browser/BrowserTextureAnim.vue.mjs +8 -1
- package/bin/jsview-vue.mjs +274 -119
- package/bin/types/JsViewEngineWidget/CheckType.d.ts +3 -0
- package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +102 -0
- package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +88 -0
- package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusManager.d.ts +10 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/Const.d.ts +16 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/Dispatcher.d.ts +14 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +158 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +158 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +46 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +21 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +46 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/SlotComponent.vue.d.ts +48 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/VisibleInfo.d.ts +16 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +17 -0
- package/bin/types/JsViewEngineWidget/RangeModel.d.ts +162 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +37 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/Fence.d.ts +58 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +15 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +97 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +22 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/index.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/WidgetCommon.d.ts +137 -0
- package/bin/types/JsViewEngineWidget/index.d.ts +6 -0
- package/bin/types/JsViewPlugin/JsvAccount/JsvAccount.d.ts +42 -0
- package/bin/types/JsViewPlugin/JsvAudio/AudioProxy.d.ts +2 -0
- package/bin/types/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +18 -0
- package/bin/types/JsViewPlugin/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +208 -0
- package/bin/types/JsViewPlugin/JsvAudio/CheckType.d.ts +2 -0
- package/bin/types/JsViewPlugin/JsvAudio/Events.d.ts +13 -0
- package/bin/types/JsViewPlugin/JsvAudio/JsvAudio.vue.d.ts +18 -0
- package/bin/types/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.d.ts +8 -0
- package/bin/types/JsViewPlugin/JsvAudio/JsvAudioProxy.vue.d.ts +2 -0
- package/bin/types/JsViewPlugin/JsvAudio/PluginLoader.d.ts +1 -0
- package/bin/types/JsViewPlugin/JsvAudio/ScreenLockManager.d.ts +5 -0
- package/bin/types/JsViewPlugin/JsvAudio/index.d.ts +3 -0
- package/bin/types/JsViewPlugin/JsvAudio/version.d.ts +10 -0
- package/bin/types/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +1 -0
- package/bin/types/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue.d.ts +13 -0
- package/bin/types/JsViewPlugin/JsvLatex/Color.d.ts +1 -0
- package/bin/types/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +17 -0
- package/bin/types/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +3 -0
- package/bin/types/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +2 -0
- package/bin/types/JsViewPlugin/JsvLatex/PluginLoader.d.ts +1 -0
- package/bin/types/JsViewPlugin/JsvLatex/index.d.ts +3 -0
- package/bin/types/JsViewPlugin/JsvLatex/version.d.ts +10 -0
- package/bin/types/JsViewPlugin/index.d.ts +3 -0
- package/bin/types/JsViewVueTools/DebugContentShellJBridge.d.ts +6 -0
- package/bin/types/JsViewVueTools/DebugTool.d.ts +8 -0
- package/bin/types/JsViewVueTools/DefaultKeyMap.d.ts +10 -0
- package/bin/types/JsViewVueTools/ForgeHandles.d.ts +6 -0
- package/bin/types/JsViewVueTools/JsvDemoTester.d.ts +2 -0
- package/bin/types/JsViewVueTools/JsvDynamicCssStyle.d.ts +14 -0
- package/bin/types/JsViewVueTools/JsvDynamicKeyFrames.d.ts +21 -0
- package/bin/types/JsViewVueTools/JsvHashHistory.d.ts +16 -0
- package/bin/types/JsViewVueTools/JsvImpactTracer.d.ts +40 -0
- package/bin/types/JsViewVueTools/JsvRefTaker.d.ts +27 -0
- package/bin/types/JsViewVueTools/JsvRuntimeBridge.d.ts +223 -0
- package/bin/types/JsViewVueTools/JsvStyleClass.d.ts +31 -0
- package/bin/types/JsViewVueTools/JsvStyleSheetsDeclarer.d.ts +15 -0
- package/bin/types/JsViewVueTools/JsvTextTools.d.ts +37 -0
- package/bin/types/JsViewVueTools/JsvTextureDefines.d.ts +6 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.d.ts +95 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +15 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +75 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +24 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/Store.d.ts +10 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/Texture.d.ts +15 -0
- package/bin/types/JsViewVueTools/NinePatchHelper.d.ts +21 -0
- package/bin/types/JsViewVueTools/TypeCheckAndSet.d.ts +2 -0
- package/bin/types/JsViewVueTools/index.d.ts +14 -0
- package/bin/types/JsViewVueWidget/JsvActorMove/ActorControlBase.d.ts +31 -0
- package/bin/types/JsViewVueWidget/JsvActorMove/JsvActorMove.vue.d.ts +64 -0
- package/bin/types/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.d.ts +33 -0
- package/bin/types/JsViewVueWidget/JsvActorMove/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue.d.ts +15 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue.d.ts +50 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +13 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +23 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/ApicDataBase.d.ts +13 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/BrowserApicLib.d.ts +3 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/GifData.d.ts +5 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/NormalLoopTool.d.ts +7 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/PartLoopTool.d.ts +12 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/SingleLoopTool.d.ts +5 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.d.ts +19 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/WebpData.d.ts +5 -0
- package/bin/types/{jsview-vue-common.d.mts → JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.d.ts} +12 -13
- package/bin/types/JsViewVueWidget/JsvConnectLine/ArcLineManager.d.ts +1 -0
- package/bin/types/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue.d.ts +13 -0
- package/bin/types/JsViewVueWidget/JsvConnectLine/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvEnableRenderBreak.vue.d.ts +51 -0
- package/bin/types/JsViewVueWidget/JsvFilterView.vue.d.ts +72 -0
- package/bin/types/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue.d.ts +72 -0
- package/bin/types/JsViewVueWidget/JsvFlexCell/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue.d.ts +72 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +84 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/NexusNode.d.ts +6 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +11 -0
- package/bin/types/JsViewVueWidget/JsvGrid.vue.d.ts +168 -0
- package/bin/types/JsViewVueWidget/JsvHole.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +36 -0
- package/bin/types/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +210 -0
- package/bin/types/JsViewVueWidget/JsvInput/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +12 -0
- package/bin/types/JsViewVueWidget/JsvLine/LineManager.d.ts +1 -0
- package/bin/types/JsViewVueWidget/JsvLine/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvMarquee.vue.d.ts +12 -0
- package/bin/types/JsViewVueWidget/JsvMaskClipDiv.vue.d.ts +83 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/CommonType.d.ts +1 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/Constant.d.ts +9 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/DataTree.d.ts +69 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/Geometry.d.ts +68 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/JsvMindMap.vue.d.ts +145 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/index.d.ts +1 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/rtree.d.ts +40 -0
- package/bin/types/JsViewVueWidget/JsvNativeSharedDiv.vue.d.ts +31 -0
- package/bin/types/JsViewVueWidget/JsvNinePatch.vue.d.ts +18 -0
- package/bin/types/JsViewVueWidget/JsvPieChart.vue.d.ts +9 -0
- package/bin/types/JsViewVueWidget/JsvPosterDiv.vue.d.ts +60 -0
- package/bin/types/JsViewVueWidget/JsvPosterImage.vue.d.ts +75 -0
- package/bin/types/JsViewVueWidget/JsvPreload/BrowserPreload.vue.d.ts +10 -0
- package/bin/types/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +25 -0
- package/bin/types/JsViewVueWidget/JsvPreload/index.d.ts +17 -0
- package/bin/types/JsViewVueWidget/JsvProgressBar.vue.d.ts +12 -0
- package/bin/types/JsViewVueWidget/JsvQrcode/BrowserQrcode.vue.d.ts +11 -0
- package/bin/types/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +60 -0
- package/bin/types/JsViewVueWidget/JsvQrcode/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvRadarChart.vue.d.ts +13 -0
- package/bin/types/JsViewVueWidget/JsvRipple/Constant.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvRipple/JsvRipple.vue.d.ts +84 -0
- package/bin/types/JsViewVueWidget/JsvRipple/index.d.ts +3 -0
- package/bin/types/JsViewVueWidget/JsvScaleTextBox.vue.d.ts +10 -0
- package/bin/types/JsViewVueWidget/JsvSector.vue.d.ts +10 -0
- package/bin/types/JsViewVueWidget/JsvSoundPool.d.ts +84 -0
- package/bin/types/JsViewVueWidget/JsvSpray/BrowserSpray.vue.d.ts +25 -0
- package/bin/types/JsViewVueWidget/JsvSpray/JsvSpray.vue.d.ts +38 -0
- package/bin/types/JsViewVueWidget/JsvSpray/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.d.ts +14 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +18 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +69 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteTools.d.ts +11 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/SpriteController.d.ts +17 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/index.d.ts +5 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/sAnimationToken.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvSwiper/JsvSwiper.vue.d.ts +209 -0
- package/bin/types/JsViewVueWidget/JsvSwiper/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue.d.ts +97 -0
- package/bin/types/JsViewVueWidget/JsvSwiper3D/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvTextBox.vue.d.ts +75 -0
- package/bin/types/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue.d.ts +151 -0
- package/bin/types/JsViewVueWidget/JsvTextureAnim/CommonType.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +107 -0
- package/bin/types/JsViewVueWidget/JsvTextureAnim/index.d.ts +14 -0
- package/bin/types/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +84 -0
- package/bin/types/JsViewVueWidget/JsvVisibleSensor/index.d.ts +84 -0
- package/bin/types/JsViewVueWidget/index.d.ts +37 -0
- package/bin/types/index.d.ts +4 -0
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/tools/config/tsconfig.json +6 -6
- package/tools/jsview-vue-build.mjs +13 -4
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +7 -4
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +18 -5
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +255 -145
- package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +2 -2
- package/utils/JsViewEngineWidget/MetroWidget/VisibleInfo.ts +1 -1
- package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +21 -21
- package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +4 -4
- package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +10 -10
- package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +6 -6
- package/utils/JsViewEngineWidget/WidgetCommon.ts +18 -2
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +2 -6
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +8 -0
- package/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue +1 -1
- package/utils/JsViewVueWidget/JsvMindMap/rtree.js +1 -1
- package/utils/JsViewVueWidget/JsvTextBox.vue +14 -2
- package/utils/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue +18 -3
- package/bin/types/browser/BrowserApic.vue.d.mts +0 -33
- package/bin/types/browser/BrowserApic2.vue.d.mts +0 -16
- package/bin/types/browser/BrowserApicLib.d.mts +0 -56
- package/bin/types/browser/BrowserAudio.vue.d.mts +0 -2
- package/bin/types/browser/BrowserJsvLatex.vue.d.mts +0 -55
- package/bin/types/browser/BrowserPreload.vue.d.mts +0 -14
- package/bin/types/browser/BrowserQrcode.vue.d.mts +0 -29
- package/bin/types/browser/BrowserSpray.vue.d.mts +0 -2
- package/bin/types/browser/BrowserTextureAnim.vue.d.mts +0 -2
- package/bin/types/export-sfc.d.mts +0 -2
- package/bin/types/jsview-vue.d.mts +0 -2511
|
@@ -108,6 +108,19 @@ export const setup = (
|
|
|
108
108
|
FLING: 3,
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
+
let innerKeepTraceRange = 0;
|
|
112
|
+
if (typeof props.keepTraceRange > 0) {
|
|
113
|
+
innerKeepTraceRange = props.keepTraceRange;
|
|
114
|
+
} else {
|
|
115
|
+
if (props.touchFlag > 0) {
|
|
116
|
+
//触控默认3屏
|
|
117
|
+
innerKeepTraceRange = 3;
|
|
118
|
+
} else {
|
|
119
|
+
//按键模式默认0屏
|
|
120
|
+
innerKeepTraceRange = 0;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
111
124
|
const modeForExport = ref(FOCUS_MODE);
|
|
112
125
|
const mode = {
|
|
113
126
|
_mode: FOCUS_MODE,
|
|
@@ -171,6 +184,7 @@ export const setup = (
|
|
|
171
184
|
let visibleInfo = new VisibleInfo();
|
|
172
185
|
let preSlideDirection = 0;
|
|
173
186
|
let alreadyCallItemFocus = false;
|
|
187
|
+
let innerSlideSetting = props.slideSetting
|
|
174
188
|
const currentFocusIndex = ref(0);
|
|
175
189
|
|
|
176
190
|
const DEFAULT_ANIMATION_DURATION = 200;
|
|
@@ -292,8 +306,8 @@ export const setup = (
|
|
|
292
306
|
easing: "",
|
|
293
307
|
onStart: null,
|
|
294
308
|
onEnd: null,
|
|
295
|
-
speed:
|
|
296
|
-
duration:
|
|
309
|
+
speed: innerSlideSetting.Speed,
|
|
310
|
+
duration: innerSlideSetting.Duration,
|
|
297
311
|
}
|
|
298
312
|
}
|
|
299
313
|
}
|
|
@@ -314,8 +328,8 @@ export const setup = (
|
|
|
314
328
|
taskManager.run(() => {
|
|
315
329
|
updateHandler = pageUpdater.update(
|
|
316
330
|
metroTemplate,
|
|
317
|
-
visibleInfo.startWithPadding -
|
|
318
|
-
visibleInfo.endWithPadding +
|
|
331
|
+
visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
|
|
332
|
+
visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
|
|
319
333
|
focusId,
|
|
320
334
|
mergeTmp,
|
|
321
335
|
permanentItemList
|
|
@@ -454,7 +468,7 @@ export const setup = (
|
|
|
454
468
|
}
|
|
455
469
|
|
|
456
470
|
const _slideTo = (target, animObj, updateParam = { mergeTmp: false }) => {
|
|
457
|
-
if (slideLock) {
|
|
471
|
+
if (slideLock || target == visibleInfo.start) {
|
|
458
472
|
return
|
|
459
473
|
};
|
|
460
474
|
taskManager.addTask(TaskType.SLIDE, { target: -target, animObj, updateParam });
|
|
@@ -686,10 +700,10 @@ export const setup = (
|
|
|
686
700
|
let animObj = null;
|
|
687
701
|
if (doAnim) {
|
|
688
702
|
animObj = {
|
|
689
|
-
easing:
|
|
703
|
+
easing: innerSlideSetting.Easing,
|
|
690
704
|
onStart: null,
|
|
691
|
-
speed:
|
|
692
|
-
duration:
|
|
705
|
+
speed: innerSlideSetting.Speed,
|
|
706
|
+
duration: innerSlideSetting.Duration,
|
|
693
707
|
};
|
|
694
708
|
}
|
|
695
709
|
_slideTo(position, animObj);
|
|
@@ -742,8 +756,8 @@ export const setup = (
|
|
|
742
756
|
_slideTo(cur_slide, doAnim ? {
|
|
743
757
|
easing: "",
|
|
744
758
|
onStart: null,
|
|
745
|
-
speed:
|
|
746
|
-
duration:
|
|
759
|
+
speed: innerSlideSetting.Speed,
|
|
760
|
+
duration: innerSlideSetting.Duration,
|
|
747
761
|
onEnd: null,
|
|
748
762
|
} : null);
|
|
749
763
|
}
|
|
@@ -822,8 +836,8 @@ export const setup = (
|
|
|
822
836
|
}
|
|
823
837
|
const updater = pageUpdater.update(
|
|
824
838
|
metroTemplate,
|
|
825
|
-
visibleInfo.startWithPadding -
|
|
826
|
-
visibleInfo.endWithPadding +
|
|
839
|
+
visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
|
|
840
|
+
visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
|
|
827
841
|
focusId,
|
|
828
842
|
false,
|
|
829
843
|
permanentItemList
|
|
@@ -831,6 +845,8 @@ export const setup = (
|
|
|
831
845
|
updater.apply();
|
|
832
846
|
onItemFocus(getItemById(focusId), null);
|
|
833
847
|
slideToItem(id2Index(focusId), false);
|
|
848
|
+
//template和slideDivStyle均确定后再次重设box condition
|
|
849
|
+
updateTouchBoxCondition();
|
|
834
850
|
};
|
|
835
851
|
|
|
836
852
|
const getVisibleItems = () => {
|
|
@@ -886,6 +902,14 @@ export const setup = (
|
|
|
886
902
|
slideLock = false;
|
|
887
903
|
}
|
|
888
904
|
|
|
905
|
+
const setSlideSetting = (setting) => {
|
|
906
|
+
if (!setting) {
|
|
907
|
+
innerSlideSetting = props.slideSetting;
|
|
908
|
+
} else {
|
|
909
|
+
innerSlideSetting = setting;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
889
913
|
const exportObject = {
|
|
890
914
|
lockSlide,
|
|
891
915
|
unlockSlide,
|
|
@@ -907,6 +931,7 @@ export const setup = (
|
|
|
907
931
|
getCurrentFocusIndex,
|
|
908
932
|
getCurMode,
|
|
909
933
|
getTemplatePosition,
|
|
934
|
+
setSlideSetting
|
|
910
935
|
};
|
|
911
936
|
|
|
912
937
|
const _calculateNearestItemByRect = (visibleSet, enter_rect_info) => {
|
|
@@ -1160,6 +1185,8 @@ export const setup = (
|
|
|
1160
1185
|
metroTemplate.getTailItemIndex()
|
|
1161
1186
|
)?.templateInfo;
|
|
1162
1187
|
if (lastTemplateInfo) {
|
|
1188
|
+
let preTouchW = touchDivSize.width;
|
|
1189
|
+
let preTouchH = touchDivSize.height;
|
|
1163
1190
|
if (vertical) {
|
|
1164
1191
|
touchDivSize.width = props.width;
|
|
1165
1192
|
touchDivSize.height = lastTemplateInfo.top + lastTemplateInfo.height - 1;
|
|
@@ -1167,7 +1194,9 @@ export const setup = (
|
|
|
1167
1194
|
touchDivSize.width = lastTemplateInfo.left + lastTemplateInfo.width - 1;
|
|
1168
1195
|
touchDivSize.height = props.height;
|
|
1169
1196
|
}
|
|
1170
|
-
|
|
1197
|
+
if (preTouchW !== touchDivSize.width || preTouchH !== touchDivSize.height) {
|
|
1198
|
+
updateTouchBoxCondition();
|
|
1199
|
+
}
|
|
1171
1200
|
}
|
|
1172
1201
|
}
|
|
1173
1202
|
|
|
@@ -1301,8 +1330,8 @@ export const setup = (
|
|
|
1301
1330
|
{
|
|
1302
1331
|
easing: "",
|
|
1303
1332
|
onStart: null,
|
|
1304
|
-
speed:
|
|
1305
|
-
duration:
|
|
1333
|
+
speed: innerSlideSetting.Speed,
|
|
1334
|
+
duration: innerSlideSetting.Duration,
|
|
1306
1335
|
},
|
|
1307
1336
|
{
|
|
1308
1337
|
mergeTmp: true
|
|
@@ -1402,28 +1431,33 @@ export const setup = (
|
|
|
1402
1431
|
onItemBlur(preFocusItem);
|
|
1403
1432
|
onItemFocus(next_focus_item, preEdgeRect);
|
|
1404
1433
|
|
|
1405
|
-
|
|
1406
|
-
if (
|
|
1407
|
-
|
|
1434
|
+
|
|
1435
|
+
if (next_focus_item.itemConfig.itemSlide == METRO_WIDGET_CONST.ITEM_SLIDE.ACT_ITEM_FOCUS) {
|
|
1436
|
+
let cur_visible_start = _calculateVisibleStart(
|
|
1437
|
+
next_focus_item.templateInfo,
|
|
1438
|
+
vertical ? vertical_direction : horizontal_direction,
|
|
1439
|
+
preFocusItem.templateInfo,
|
|
1440
|
+
);
|
|
1441
|
+
if (visibleInfo.start !== cur_visible_start) {
|
|
1408
1442
|
let animObj = {
|
|
1409
1443
|
easing: "",
|
|
1410
1444
|
onStart: null,
|
|
1411
|
-
speed:
|
|
1412
|
-
duration:
|
|
1445
|
+
speed: innerSlideSetting.Speed,
|
|
1446
|
+
duration: innerSlideSetting.Duration,
|
|
1413
1447
|
};
|
|
1414
1448
|
_slideTo(cur_visible_start, animObj, { mergeTmp: false });
|
|
1415
|
-
} else {
|
|
1416
|
-
const updater = pageUpdater.update(
|
|
1417
|
-
metroTemplate,
|
|
1418
|
-
visibleInfo.startWithPadding - props.keepTraceRange * pageRange,
|
|
1419
|
-
visibleInfo.endWithPadding + props.keepTraceRange * pageRange,
|
|
1420
|
-
next_focus_item.id,
|
|
1421
|
-
false,
|
|
1422
|
-
permanentItemList
|
|
1423
|
-
);
|
|
1424
|
-
//不做滚动时,保证获焦的item创建. 为了避免提前隐藏, 使用applyTmp
|
|
1425
|
-
updater.applyTmp();
|
|
1426
1449
|
}
|
|
1450
|
+
} else {
|
|
1451
|
+
const updater = pageUpdater.update(
|
|
1452
|
+
metroTemplate,
|
|
1453
|
+
visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
|
|
1454
|
+
visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
|
|
1455
|
+
next_focus_item.id,
|
|
1456
|
+
false,
|
|
1457
|
+
permanentItemList
|
|
1458
|
+
);
|
|
1459
|
+
//不做滚动时,保证获焦的item创建. 为了避免提前隐藏, 使用applyTmp
|
|
1460
|
+
updater.applyTmp();
|
|
1427
1461
|
}
|
|
1428
1462
|
} else {
|
|
1429
1463
|
//到达边缘
|
|
@@ -1474,48 +1508,58 @@ export const setup = (
|
|
|
1474
1508
|
const normalizeVisibleStart = (origin, targetItem = null) => {
|
|
1475
1509
|
let pos_key = vertical ? "top" : "left";
|
|
1476
1510
|
let size_key = vertical ? "height" : "width";
|
|
1477
|
-
let
|
|
1478
|
-
if ((
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1511
|
+
let visibleStart = origin;
|
|
1512
|
+
if ((innerSlideSetting.BoundaryProtect & SlideSetting.START_PROTECT) > 0) {
|
|
1513
|
+
if (visibleInfo.start >= 0) {
|
|
1514
|
+
let boundary = 0;
|
|
1515
|
+
//首个元素是占位符时, 在保证获焦区域完全展示的前提下要保证首个不可获焦元素的完全展示
|
|
1516
|
+
const headTemplateInfo = getItemByIndex(0).templateInfo;
|
|
1517
|
+
if (
|
|
1518
|
+
targetItem
|
|
1519
|
+
&& (!headTemplateInfo.focusable || targetItem.index == headTemplateInfo.index)
|
|
1520
|
+
&& targetItem[pos_key] + targetItem[size_key] <=
|
|
1521
|
+
visibleInfo.range
|
|
1522
|
+
) {
|
|
1523
|
+
boundary = headTemplateInfo[size_key];
|
|
1524
|
+
}
|
|
1525
|
+
visibleStart = visibleStart < boundary ? 0 : visibleStart;
|
|
1526
|
+
} else {
|
|
1527
|
+
// 以最后一个item的位置作为动态的保护边界
|
|
1528
|
+
visibleStart = visibleStart < visibleInfo.start ? visibleInfo.start : visibleStart;
|
|
1489
1529
|
}
|
|
1490
|
-
visible_start = visible_start < boundary ? 0 : visible_start;
|
|
1491
1530
|
}
|
|
1492
|
-
if ((
|
|
1531
|
+
if ((innerSlideSetting.BoundaryProtect & SlideSetting.END_PROTECT) > 0) {
|
|
1493
1532
|
let lastTemplateInfo = getItemByIndex(metroTemplate.getTailItemIndex()).templateInfo;
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1533
|
+
const lastEnd = lastTemplateInfo[pos_key] + lastTemplateInfo[size_key];
|
|
1534
|
+
const lastVisibleStart = Math.max(lastEnd - visibleInfo.range, 0);
|
|
1535
|
+
//边界必须大于等于0, 同时若最后一个缩进时, 边界采用最后一个item的位置
|
|
1536
|
+
if (visibleInfo.end <= lastEnd) {
|
|
1537
|
+
let boundary = lastVisibleStart;
|
|
1538
|
+
if (
|
|
1539
|
+
targetItem
|
|
1540
|
+
&& (!lastTemplateInfo.focusable || targetItem.index == lastTemplateInfo.index)
|
|
1541
|
+
&& targetItem[pos_key] - lastVisibleStart >= 0
|
|
1542
|
+
) {
|
|
1543
|
+
boundary = lastTemplateInfo[pos_key] - visibleInfo.range;
|
|
1544
|
+
}
|
|
1545
|
+
visibleStart = visibleStart > boundary ? lastVisibleStart : visibleStart;
|
|
1546
|
+
} else {
|
|
1547
|
+
// 以最后一个item的位置作为动态的保护边界
|
|
1548
|
+
visibleStart = visibleStart > visibleInfo.start ? visibleInfo.start : visibleStart;
|
|
1507
1549
|
}
|
|
1508
|
-
visible_start =
|
|
1509
|
-
visible_start > boundary ? last_visible_start : visible_start;
|
|
1510
1550
|
}
|
|
1511
|
-
return
|
|
1551
|
+
return visibleStart;
|
|
1512
1552
|
}
|
|
1513
1553
|
|
|
1514
|
-
|
|
1554
|
+
let preTemplateInfo = null;
|
|
1555
|
+
const _calculateVisibleStart = (targetTemplateInfo, direction, preInfo = null) => {
|
|
1515
1556
|
if (!targetTemplateInfo) {
|
|
1516
1557
|
console.error("MetroWidget: _calculateVisibleStart target item is null");
|
|
1517
1558
|
return 0;
|
|
1518
1559
|
}
|
|
1560
|
+
if (preInfo) {
|
|
1561
|
+
preTemplateInfo = preInfo;
|
|
1562
|
+
}
|
|
1519
1563
|
|
|
1520
1564
|
preSlideDirection = direction;
|
|
1521
1565
|
preAnchorItemIndex = targetTemplateInfo.index;
|
|
@@ -1525,12 +1569,14 @@ export const setup = (
|
|
|
1525
1569
|
let new_visible_start = visibleInfo.start;
|
|
1526
1570
|
|
|
1527
1571
|
let needCalculate = true;
|
|
1528
|
-
|
|
1572
|
+
|
|
1573
|
+
switch (innerSlideSetting.Type) {
|
|
1529
1574
|
case SlideSetting.Type.FIX_POSITION:
|
|
1575
|
+
//TODO 当item的size和widget的size相同时, 滚动速度会出现未预期的变化
|
|
1530
1576
|
//FIX_POSITION 模式会将当前 item 的中心固定到指定位置
|
|
1531
1577
|
|
|
1532
1578
|
//首页不滚动
|
|
1533
|
-
if (
|
|
1579
|
+
if (innerSlideSetting.FixFirstPage) {
|
|
1534
1580
|
if (targetTemplateInfo[pos_key] + targetTemplateInfo[size_key] - 1 < visibleInfo.range) {
|
|
1535
1581
|
new_visible_start = 0;
|
|
1536
1582
|
needCalculate = false;
|
|
@@ -1540,7 +1586,7 @@ export const setup = (
|
|
|
1540
1586
|
if (needCalculate) {
|
|
1541
1587
|
new_visible_start = Math.ceil(
|
|
1542
1588
|
targetTemplateInfo[center_key] -
|
|
1543
|
-
visibleInfo.range *
|
|
1589
|
+
visibleInfo.range * innerSlideSetting.FixPercent
|
|
1544
1590
|
);
|
|
1545
1591
|
}
|
|
1546
1592
|
break;
|
|
@@ -1558,68 +1604,93 @@ export const setup = (
|
|
|
1558
1604
|
break;
|
|
1559
1605
|
case SlideSetting.Type.SEAMLESS:
|
|
1560
1606
|
//首页不滚动
|
|
1561
|
-
if (
|
|
1607
|
+
if (innerSlideSetting.FixFirstPage) {
|
|
1562
1608
|
if (targetTemplateInfo[pos_key] + targetTemplateInfo[size_key] - 1 < visibleInfo.range) {
|
|
1563
1609
|
new_visible_start = 0;
|
|
1564
1610
|
needCalculate = false;
|
|
1565
1611
|
}
|
|
1566
1612
|
}
|
|
1613
|
+
|
|
1567
1614
|
if (needCalculate) {
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1615
|
+
/**
|
|
1616
|
+
* seamless滚动规则:
|
|
1617
|
+
* 0-start: 焦点往右时不处理, 往左的时候更新position以保持焦点的start位置一致
|
|
1618
|
+
* end-1.0: 焦点往左时不处理, 往右的时候更新position以保持焦点的end位置一致
|
|
1619
|
+
* 重合区域: 保持焦点的中心位置一致
|
|
1620
|
+
*/
|
|
1621
|
+
const rect0Start = visibleInfo.start;
|
|
1622
|
+
const rect0End = visibleInfo.start + visibleInfo.range * innerSlideSetting.StartPercent;
|
|
1623
|
+
const rect1Start = visibleInfo.start + visibleInfo.range * innerSlideSetting.EndPercent;
|
|
1624
|
+
const rect1End = visibleInfo.end;
|
|
1625
|
+
|
|
1626
|
+
const itemStart = targetTemplateInfo[pos_key];
|
|
1627
|
+
const itemEnd = targetTemplateInfo[pos_key] + targetTemplateInfo[size_key] - 1;
|
|
1628
|
+
|
|
1629
|
+
let targetStart;
|
|
1630
|
+
let targetEnd;
|
|
1631
|
+
if (preTemplateInfo != null) {
|
|
1632
|
+
targetStart = preTemplateInfo[pos_key];
|
|
1633
|
+
targetEnd = preTemplateInfo[pos_key] + preTemplateInfo[size_key] - 1;
|
|
1576
1634
|
} else {
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
visibleInfo.range * props.slideSetting.StartPercent;
|
|
1635
|
+
targetStart = rect0End;
|
|
1636
|
+
targetEnd = rect1Start;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
let rect0Result = undefined;
|
|
1640
|
+
let rect1Result = undefined;
|
|
1641
|
+
if (itemStart < rect0End) {
|
|
1642
|
+
if (targetStart < rect0Start) {
|
|
1643
|
+
rect0Result = itemStart;
|
|
1644
|
+
} else {
|
|
1645
|
+
//inRect0, 只处理往左/往上
|
|
1646
|
+
if (direction <= 0) {
|
|
1647
|
+
let pre;
|
|
1648
|
+
if (targetStart < rect0End) {
|
|
1649
|
+
pre = targetStart;
|
|
1650
|
+
} else {
|
|
1651
|
+
pre = rect0End;
|
|
1652
|
+
}
|
|
1653
|
+
rect0Result = visibleInfo.start + (itemStart - pre);
|
|
1597
1654
|
}
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
if (itemEnd > rect1Start) {
|
|
1658
|
+
if (targetEnd > rect1End) {
|
|
1659
|
+
rect1Result = itemEnd - visibleInfo.range;
|
|
1598
1660
|
} else {
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
new_visible_start =
|
|
1609
|
-
targetTemplateInfo[pos_key] +
|
|
1610
|
-
targetTemplateInfo[size_key] -
|
|
1611
|
-
visibleInfo.range * props.slideSetting.EndPercent;
|
|
1661
|
+
//inRect1, 只处理往右/往下
|
|
1662
|
+
let pre;
|
|
1663
|
+
if (targetEnd > rect1Start) {
|
|
1664
|
+
pre = targetEnd;
|
|
1665
|
+
} else {
|
|
1666
|
+
pre = rect1Start;
|
|
1667
|
+
}
|
|
1668
|
+
if (direction >= 0) {
|
|
1669
|
+
rect1Result = visibleInfo.start + (itemEnd - pre);
|
|
1612
1670
|
}
|
|
1613
1671
|
}
|
|
1672
|
+
} else {
|
|
1673
|
+
//不移动
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
if (typeof rect0Result !== "undefined" && typeof rect1Result !== "undefined") {
|
|
1677
|
+
//重叠区域
|
|
1678
|
+
new_visible_start = rect0Result;
|
|
1679
|
+
} else if (typeof rect0Result !== "undefined") {
|
|
1680
|
+
new_visible_start = rect0Result;
|
|
1681
|
+
} else if (typeof rect1Result !== "undefined") {
|
|
1682
|
+
new_visible_start = rect1Result;
|
|
1614
1683
|
}
|
|
1615
1684
|
}
|
|
1616
1685
|
break;
|
|
1617
1686
|
default:
|
|
1618
1687
|
console.error(
|
|
1619
1688
|
"MetroWidget: undefined slide type",
|
|
1620
|
-
|
|
1689
|
+
innerSlideSetting.Type
|
|
1621
1690
|
);
|
|
1622
1691
|
}
|
|
1692
|
+
|
|
1693
|
+
preTemplateInfo = targetTemplateInfo;
|
|
1623
1694
|
new_visible_start = normalizeVisibleStart(new_visible_start, targetTemplateInfo);
|
|
1624
1695
|
return Math.round(new_visible_start);
|
|
1625
1696
|
};
|
|
@@ -1747,8 +1818,20 @@ export const setup = (
|
|
|
1747
1818
|
}
|
|
1748
1819
|
}
|
|
1749
1820
|
|
|
1821
|
+
const getTouchCount = (nexusCustomData) => {
|
|
1822
|
+
let touchCount = -1;
|
|
1823
|
+
if (nexusCustomData) {
|
|
1824
|
+
try {
|
|
1825
|
+
touchCount = JSON.parse(nexusCustomData).tc;
|
|
1826
|
+
} catch (e) {
|
|
1827
|
+
touchCount = -1;
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
return touchCount;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1750
1833
|
const mergeTouchSlideToSlideDiv = (touchCount) => {
|
|
1751
|
-
// console.log("
|
|
1834
|
+
// console.log("testtest", props.name, `touchToDiv div: ${slideDivTop.value}, visibleStart:${visibleInfo.start} swapCount: ${Forge.sFrameCount.count}`)
|
|
1752
1835
|
if (vertical) {
|
|
1753
1836
|
slideDivTop.value = -visibleInfo.start;
|
|
1754
1837
|
} else {
|
|
@@ -1780,6 +1863,13 @@ export const setup = (
|
|
|
1780
1863
|
}
|
|
1781
1864
|
|
|
1782
1865
|
const onTouchDown = (data, customData, nexusCustomData) => {
|
|
1866
|
+
touchRecorder.reset();
|
|
1867
|
+
let touchCount = getTouchCount(nexusCustomData);
|
|
1868
|
+
touchRecorder.setTouchCount(touchCount);
|
|
1869
|
+
if (mode.getMode() == FOCUS_MODE) {
|
|
1870
|
+
//模式切换, 更新boxPosition
|
|
1871
|
+
updateTouchBoxCondition();
|
|
1872
|
+
}
|
|
1783
1873
|
mode.touchStart();
|
|
1784
1874
|
mode.flingEnd();
|
|
1785
1875
|
// console.log("touchtest", `${props.name} animId:${debugAnimId} viewId:${debugViewId}`,
|
|
@@ -1791,6 +1881,7 @@ export const setup = (
|
|
|
1791
1881
|
top: vertical ? t : undefined,
|
|
1792
1882
|
bottom: vertical ? t : undefined,
|
|
1793
1883
|
}
|
|
1884
|
+
|
|
1794
1885
|
actorController.run([
|
|
1795
1886
|
actorController
|
|
1796
1887
|
.condition(undefined, false)
|
|
@@ -1809,8 +1900,8 @@ export const setup = (
|
|
|
1809
1900
|
|
|
1810
1901
|
const updater = pageUpdater.update(
|
|
1811
1902
|
metroTemplate,
|
|
1812
|
-
visibleInfo.startWithPadding -
|
|
1813
|
-
visibleInfo.endWithPadding +
|
|
1903
|
+
visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
|
|
1904
|
+
visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
|
|
1814
1905
|
0,
|
|
1815
1906
|
false,
|
|
1816
1907
|
permanentItemList
|
|
@@ -1844,35 +1935,32 @@ export const setup = (
|
|
|
1844
1935
|
//只点击, 没有移动或者fling
|
|
1845
1936
|
updateRenderItems(false, false);
|
|
1846
1937
|
mode.touchEnd();
|
|
1938
|
+
} else {
|
|
1939
|
+
if (touchRecorder.moved && !mode.duringFling()) {
|
|
1940
|
+
mergeTouchSlideToSlideDiv(touchRecorder.touchCount);
|
|
1941
|
+
updateRenderItems(false, false);
|
|
1942
|
+
mode.touchEnd()
|
|
1943
|
+
}
|
|
1847
1944
|
}
|
|
1848
1945
|
}
|
|
1849
1946
|
|
|
1947
|
+
const exportOnTouchRelease = props.touchFlag > 0 ? onTouchRelease : undefined;
|
|
1948
|
+
|
|
1850
1949
|
const onDragStart = (data, customData, nexusCustomData) => {
|
|
1950
|
+
touchRecorder.move();
|
|
1851
1951
|
mode.dragStart()
|
|
1852
1952
|
visibleInfo.start = getVisibleStart(data);
|
|
1853
1953
|
}
|
|
1854
1954
|
|
|
1855
1955
|
const onDragEnd = (data, customData, nexusCustomData) => {
|
|
1856
1956
|
visibleInfo.start = getVisibleStart(data);
|
|
1857
|
-
// console.log("touchtest", props.name + " animId:" + debugAnimId,
|
|
1858
|
-
// `onDragEnd ${visibleInfo.start}`)
|
|
1859
1957
|
actorController.run([
|
|
1860
1958
|
actorController.state().removeConditionByGroup(reachAnchorGroup),
|
|
1861
1959
|
]);
|
|
1862
|
-
let touchCount = -1;
|
|
1863
|
-
if (nexusCustomData) {
|
|
1864
|
-
try {
|
|
1865
|
-
touchCount = JSON.parse(nexusCustomData).tc;
|
|
1866
|
-
} catch (e) {
|
|
1867
|
-
touchCount = -1;
|
|
1868
|
-
}
|
|
1869
|
-
}
|
|
1870
|
-
mergeTouchSlideToSlideDiv(touchCount);
|
|
1871
|
-
updateRenderItems(false, false);
|
|
1872
|
-
mode.touchEnd()
|
|
1873
1960
|
}
|
|
1874
1961
|
|
|
1875
1962
|
const onFlingStart = (data, customData, nexusCustomData) => {
|
|
1963
|
+
touchRecorder.move();
|
|
1876
1964
|
mode.flingStart();
|
|
1877
1965
|
visibleInfo.start = getVisibleStart(data);
|
|
1878
1966
|
updateRenderItems(true, true);
|
|
@@ -1885,17 +1973,9 @@ export const setup = (
|
|
|
1885
1973
|
|
|
1886
1974
|
const onFlingEnd = (data, customData, nexusCustomData) => {
|
|
1887
1975
|
visibleInfo.start = getVisibleStart(data);
|
|
1888
|
-
// console.log("touchtest", props.name, `onFlingEnd ${visibleInfo.start}`, data, customData, nexusCustomData)
|
|
1889
1976
|
//记录拖拽的距离
|
|
1890
1977
|
if (mode.duringFling()) {
|
|
1891
|
-
let touchCount =
|
|
1892
|
-
if (nexusCustomData) {
|
|
1893
|
-
try {
|
|
1894
|
-
touchCount = JSON.parse(nexusCustomData).tc;
|
|
1895
|
-
} catch (e) {
|
|
1896
|
-
touchCount = -1;
|
|
1897
|
-
}
|
|
1898
|
-
}
|
|
1978
|
+
let touchCount = getTouchCount(nexusCustomData);
|
|
1899
1979
|
mergeTouchSlideToSlideDiv(touchCount);
|
|
1900
1980
|
updateRenderItems(false, false);
|
|
1901
1981
|
mode.flingEnd();
|
|
@@ -1903,6 +1983,10 @@ export const setup = (
|
|
|
1903
1983
|
}
|
|
1904
1984
|
}
|
|
1905
1985
|
|
|
1986
|
+
const onFlingDrop = (data, customData, nexusCustomData) => {
|
|
1987
|
+
visibleInfo.start = getVisibleStart(data);
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1906
1990
|
const getTouchWall = () => {
|
|
1907
1991
|
const boxSize = metroTemplate.getBoundingBoxSize();
|
|
1908
1992
|
let wall = {
|
|
@@ -1914,9 +1998,15 @@ export const setup = (
|
|
|
1914
1998
|
if (vertical) {
|
|
1915
1999
|
wall.top = -boxSize.height + props.height - slideDivTop.value;
|
|
1916
2000
|
wall.bottom = -slideDivTop.value;
|
|
2001
|
+
if (wall.top > wall.bottom) {
|
|
2002
|
+
wall.top = wall.bottom;
|
|
2003
|
+
}
|
|
1917
2004
|
} else {
|
|
1918
2005
|
wall.left = -boxSize.width + props.width - slideDivLeft.value;
|
|
1919
2006
|
wall.right = -slideDivLeft.value;
|
|
2007
|
+
if (wall.left > wall.right) {
|
|
2008
|
+
wall.left = wall.right;
|
|
2009
|
+
}
|
|
1920
2010
|
}
|
|
1921
2011
|
return wall;
|
|
1922
2012
|
}
|
|
@@ -1925,8 +2015,8 @@ export const setup = (
|
|
|
1925
2015
|
templateItemAdder.tryAddItemByPosition(visibleInfo.start + visibleInfo.range);
|
|
1926
2016
|
const updater = pageUpdater.update(
|
|
1927
2017
|
metroTemplate,
|
|
1928
|
-
visibleInfo.startWithPadding -
|
|
1929
|
-
visibleInfo.endWithPadding +
|
|
2018
|
+
visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
|
|
2019
|
+
visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
|
|
1930
2020
|
0,
|
|
1931
2021
|
true,
|
|
1932
2022
|
permanentItemList
|
|
@@ -1934,9 +2024,10 @@ export const setup = (
|
|
|
1934
2024
|
applyTmp ? updater.applyTmp() : updater.apply();
|
|
1935
2025
|
}
|
|
1936
2026
|
|
|
1937
|
-
const
|
|
2027
|
+
const updateTouchBoxCondition = () => {
|
|
1938
2028
|
if (actorController != null) {
|
|
1939
2029
|
const walls = getTouchWall();
|
|
2030
|
+
|
|
1940
2031
|
//更新wall设置
|
|
1941
2032
|
actorController.run([
|
|
1942
2033
|
actorController.state().removeConditionByGroup(wallConditionGroup),
|
|
@@ -1948,6 +2039,21 @@ export const setup = (
|
|
|
1948
2039
|
}
|
|
1949
2040
|
}
|
|
1950
2041
|
|
|
2042
|
+
const touchRecorder = {
|
|
2043
|
+
moved: false,
|
|
2044
|
+
touchCount: -1,
|
|
2045
|
+
reset: function () {
|
|
2046
|
+
this.moved = false;
|
|
2047
|
+
this.touchCount = -1;
|
|
2048
|
+
},
|
|
2049
|
+
move: function () {
|
|
2050
|
+
this.moved = true;
|
|
2051
|
+
},
|
|
2052
|
+
setTouchCount: function (count) {
|
|
2053
|
+
this.touchCount = count;
|
|
2054
|
+
}
|
|
2055
|
+
};
|
|
2056
|
+
|
|
1951
2057
|
//TODO debug
|
|
1952
2058
|
// let debugAnimId = -1;
|
|
1953
2059
|
// let debugViewId = -1
|
|
@@ -1958,7 +2064,7 @@ export const setup = (
|
|
|
1958
2064
|
divView.DragEnables?.(4 | 0x08 | 0x10); // 只激活drag
|
|
1959
2065
|
// debugAnimId = actorController.debugGetAnimId();
|
|
1960
2066
|
// debugViewId = divView.ViewId;
|
|
1961
|
-
// console.log("
|
|
2067
|
+
// console.log("testtest", props.name, `animId:${debugAnimId} viewId:${debugViewId}`);
|
|
1962
2068
|
const walls = getTouchWall();
|
|
1963
2069
|
//注册回调
|
|
1964
2070
|
actorController.run([
|
|
@@ -1966,10 +2072,10 @@ export const setup = (
|
|
|
1966
2072
|
.condition(undefined, true)
|
|
1967
2073
|
.onTouchDown()
|
|
1968
2074
|
.then([onTouchDown]),
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
2075
|
+
actorController
|
|
2076
|
+
.condition(undefined, true)
|
|
2077
|
+
.onDragStart()
|
|
2078
|
+
.then([onDragStart]),
|
|
1973
2079
|
actorController
|
|
1974
2080
|
.condition(undefined, true)
|
|
1975
2081
|
.onDragEnd()
|
|
@@ -1986,6 +2092,10 @@ export const setup = (
|
|
|
1986
2092
|
.condition(undefined, true)
|
|
1987
2093
|
.onFlingEnd()
|
|
1988
2094
|
.then([onFlingEnd]),
|
|
2095
|
+
actorController
|
|
2096
|
+
.condition(undefined, true)
|
|
2097
|
+
.onFlingDrop()
|
|
2098
|
+
.then([onFlingDrop]),
|
|
1989
2099
|
actorController
|
|
1990
2100
|
.condition(undefined, true)
|
|
1991
2101
|
.onTouchRelease()
|
|
@@ -2037,7 +2147,7 @@ export const setup = (
|
|
|
2037
2147
|
if (item) {
|
|
2038
2148
|
init_focus_id = props.initFocusId;
|
|
2039
2149
|
if (item.itemConfig.itemSlide == METRO_WIDGET_CONST.ITEM_SLIDE.ACT_ITEM_FOCUS) {
|
|
2040
|
-
cur_visible_start = _calculateVisibleStart(item.templateInfo,
|
|
2150
|
+
cur_visible_start = _calculateVisibleStart(item.templateInfo, 0);
|
|
2041
2151
|
}
|
|
2042
2152
|
}
|
|
2043
2153
|
}
|
|
@@ -2058,8 +2168,8 @@ export const setup = (
|
|
|
2058
2168
|
const delayLoadHandler = setTimeout(() => {
|
|
2059
2169
|
const updateHandler = pageUpdater.update(
|
|
2060
2170
|
metroTemplate,
|
|
2061
|
-
visibleInfo.startWithPadding -
|
|
2062
|
-
visibleInfo.endWithPadding +
|
|
2171
|
+
visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
|
|
2172
|
+
visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
|
|
2063
2173
|
focusId,
|
|
2064
2174
|
false,
|
|
2065
2175
|
permanentItemList
|
|
@@ -2107,7 +2217,7 @@ export const setup = (
|
|
|
2107
2217
|
exportObject,
|
|
2108
2218
|
setZIndex,
|
|
2109
2219
|
onTouchDown,
|
|
2110
|
-
onTouchRelease,
|
|
2220
|
+
onTouchRelease: exportOnTouchRelease,
|
|
2111
2221
|
currentFocusIndex,
|
|
2112
2222
|
modeForExport,
|
|
2113
2223
|
}
|