@shijiu/jsview-vue 2.2.128 → 2.2.373
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/BrowserApic.vue.mjs +4 -15
- package/bin/browser/BrowserApic2.vue.mjs +4 -15
- package/bin/browser/BrowserApicLib.mjs +32 -26
- package/bin/browser/BrowserAudio.vue.mjs +2 -10
- package/bin/browser/BrowserJsvFragShaderView.vue.mjs +79 -0
- package/bin/browser/BrowserJsvLatex.vue.mjs +39 -16
- package/bin/browser/BrowserPreload.vue.mjs +1 -5
- package/bin/browser/BrowserQrcode.vue.mjs +1 -5
- package/bin/browser/BrowserSpray.vue.mjs +2 -12
- package/bin/browser/BrowserTextureAnim.vue.mjs +2 -12
- package/bin/export-sfc.mjs +3 -3
- package/bin/jsview-vue-common.mjs +3 -3
- package/bin/jsview-vue.mjs +4636 -2325
- package/bin/types/JsViewEngineWidget/CheckType.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +37 -33
- package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusManager.d.ts +21 -6
- package/bin/types/JsViewEngineWidget/MetroWidget/Const.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/Dispatcher.d.ts +14 -12
- package/bin/types/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +17 -6
- package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +283 -6
- package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +9 -3
- package/bin/types/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +7 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/Slide.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/SlotComponent.vue.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/VisibleInfo.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/RangeModel.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/Fence.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +5 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +5 -1
- package/bin/types/JsViewEngineWidget/TemplateParser/index.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/WidgetCommon.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/index.d.ts +14 -1
- package/bin/types/JsViewPlugin/JsvAccount/JsvAccount.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/AudioProxy.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/CheckType.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/Events.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/JsvAudio.vue.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/JsvAudioProxy.vue.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/PluginLoader.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/ScreenLockManager.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/index.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvAudio/version.d.ts +5 -0
- package/bin/types/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvLatex/Color.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +24 -0
- package/bin/types/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvLatex/PluginLoader.d.ts +4 -0
- package/bin/types/JsViewPlugin/JsvLatex/index.d.ts +5 -0
- package/bin/types/JsViewPlugin/JsvLatex/version.d.ts +4 -0
- package/bin/types/JsViewPlugin/index.d.ts +4 -0
- package/bin/types/JsViewVueTools/ConstSymbol.d.ts +6 -2
- package/bin/types/JsViewVueTools/DebugContentShellJBridge.d.ts +4 -0
- package/bin/types/JsViewVueTools/DebugTool.d.ts +4 -0
- package/bin/types/JsViewVueTools/DefaultKeyMap.d.ts +4 -0
- package/bin/types/JsViewVueTools/FeatureActive.d.ts +14 -0
- package/bin/types/JsViewVueTools/ForgeConstDefine.d.ts +4 -0
- package/bin/types/JsViewVueTools/ForgeHandles.d.ts +7 -3
- package/bin/types/JsViewVueTools/JsvDemoTester.d.ts +4 -0
- package/bin/types/JsViewVueTools/JsvDynamicCssStyle.d.ts +20 -1
- package/bin/types/JsViewVueTools/JsvDynamicKeyFrames.d.ts +21 -2
- package/bin/types/JsViewVueTools/JsvFederationTools.d.ts +20 -0
- package/bin/types/JsViewVueTools/JsvHashHistory.d.ts +4 -0
- package/bin/types/JsViewVueTools/JsvImpactTracer.d.ts +8 -4
- package/bin/types/JsViewVueTools/JsvPerformance.d.ts +9 -0
- package/bin/types/JsViewVueTools/JsvPreDownloader.d.ts +55 -0
- package/bin/types/JsViewVueTools/JsvRefTaker.d.ts +28 -3
- package/bin/types/JsViewVueTools/JsvRuntimeBridge.d.ts +50 -0
- package/bin/types/JsViewVueTools/JsvStyleClass.d.ts +4 -0
- package/bin/types/JsViewVueTools/JsvStyleSheetsDeclarer.d.ts +21 -1
- package/bin/types/JsViewVueTools/JsvTextTools.d.ts +85 -27
- package/bin/types/JsViewVueTools/JsvTextureDefines.d.ts +4 -0
- package/bin/types/JsViewVueTools/JsvTextureLoadTool.d.ts +67 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.d.ts +4 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +4 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +4 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +4 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +73 -3
- package/bin/types/JsViewVueTools/JsvTextureStore/Store.d.ts +4 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/Texture.d.ts +4 -0
- package/bin/types/JsViewVueTools/NinePatchHelper.d.ts +5 -1
- package/bin/types/JsViewVueTools/TextureManagerTools.d.ts +11 -0
- package/bin/types/JsViewVueTools/TypeCheckAndSet.d.ts +4 -0
- package/bin/types/JsViewVueTools/index.d.ts +26 -11
- package/bin/types/JsViewVueWidget/JsvActorMove/ActorControlBase.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvActorMove/JsvActorMove.vue.d.ts +38 -0
- package/bin/types/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvActorMove/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue.d.ts +5 -1
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue.d.ts +28 -1
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +5 -1
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +29 -1
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/ApicDataBase.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/BrowserApicLib.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/GifData.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/NormalLoopTool.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/PartLoopTool.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/SingleLoopTool.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.d.ts +6 -1
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/WebpData.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue.d.ts +74 -0
- package/bin/types/JsViewVueWidget/JsvClipDiv/index.d.ts +5 -0
- package/bin/types/JsViewVueWidget/JsvConnectLine/ArcLineManager.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue.d.ts +21 -0
- package/bin/types/JsViewVueWidget/JsvConnectLine/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvDragBox/JsvDragBox.vue.d.ts +109 -0
- package/bin/types/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue.d.ts +108 -0
- package/bin/types/JsViewVueWidget/JsvDriftScope/index.d.ts +5 -0
- package/bin/types/JsViewVueWidget/JsvEnableRenderBreak.vue.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvFilterView.vue.d.ts +19 -0
- package/bin/types/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue.d.ts +34 -0
- package/bin/types/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue.d.ts +106 -0
- package/bin/types/JsViewVueWidget/JsvFlexCell/index.d.ts +6 -2
- package/bin/types/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue.d.ts +19 -0
- package/bin/types/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +60 -0
- package/bin/types/JsViewVueWidget/JsvFragShaderView/index.d.ts +6 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +47 -17
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue.d.ts +25 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +22 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/NexusNode.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +9 -5
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +8 -2
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +11 -7
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SyncLinkManager.d.ts +22 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +6 -0
- package/bin/types/JsViewVueWidget/JsvGrid.vue.d.ts +73 -0
- package/bin/types/JsViewVueWidget/JsvHole.d.ts +17 -0
- package/bin/types/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +14 -34
- package/bin/types/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +48 -0
- package/bin/types/JsViewVueWidget/JsvInput/EditVisibleArea.d.ts +27 -0
- package/bin/types/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +64 -209
- package/bin/types/JsViewVueWidget/JsvInput/SharedDefine.d.ts +17 -0
- package/bin/types/JsViewVueWidget/JsvInput/SystemTextTools.d.ts +14 -0
- package/bin/types/JsViewVueWidget/JsvInput/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +20 -0
- package/bin/types/JsViewVueWidget/JsvLine/LineManager.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvLine/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvMarquee.vue.d.ts +21 -0
- package/bin/types/JsViewVueWidget/JsvMaskClipDiv.vue.d.ts +20 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/Constant.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/DataTree.d.ts +7 -1
- package/bin/types/JsViewVueWidget/JsvMindMap/Geometry.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/JsvMindMap.vue.d.ts +90 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/rtree.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvNativeSharedDiv.vue.d.ts +24 -0
- package/bin/types/JsViewVueWidget/JsvNinePatch.vue.d.ts +31 -0
- package/bin/types/JsViewVueWidget/JsvPieChart.vue.d.ts +17 -0
- package/bin/types/JsViewVueWidget/JsvPosterDiv.vue.d.ts +17 -0
- package/bin/types/JsViewVueWidget/JsvPosterImage.vue.d.ts +18 -0
- package/bin/types/JsViewVueWidget/JsvPreload/BrowserPreload.vue.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +42 -0
- package/bin/types/JsViewVueWidget/JsvPreload/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvProgressBar.vue.d.ts +19 -0
- package/bin/types/JsViewVueWidget/JsvQrcode/BrowserQrcode.vue.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +25 -0
- package/bin/types/JsViewVueWidget/JsvQrcode/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvRadarChart.vue.d.ts +24 -0
- package/bin/types/JsViewVueWidget/JsvRipple/Constant.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvRipple/JsvRipple.vue.d.ts +45 -0
- package/bin/types/JsViewVueWidget/JsvRipple/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvScaleTextBox.vue.d.ts +18 -0
- package/bin/types/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +65 -1
- package/bin/types/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue.d.ts +157 -0
- package/bin/types/JsViewVueWidget/JsvScrollBox/ScrollInnerSymbol.d.ts +8 -0
- package/bin/types/JsViewVueWidget/JsvScrollBox/ScrollSymbol.d.ts +13 -4
- package/bin/types/JsViewVueWidget/JsvScrollBox/index.d.ts +6 -0
- package/bin/types/JsViewVueWidget/JsvSector.vue.d.ts +18 -0
- package/bin/types/JsViewVueWidget/JsvSoundPool.d.ts +42 -0
- package/bin/types/JsViewVueWidget/JsvSpray/BrowserSpray.vue.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvSpray/JsvSpray.vue.d.ts +40 -0
- package/bin/types/JsViewVueWidget/JsvSpray/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +52 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +16 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteTools.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/SpriteController.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/sAnimationToken.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvSwiper/JsvSwiper.vue.d.ts +39 -0
- package/bin/types/JsViewVueWidget/JsvSwiper/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue.d.ts +24 -0
- package/bin/types/JsViewVueWidget/JsvSwiper3D/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvTextBox.vue.d.ts +26 -0
- package/bin/types/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvTextureAnim/CommonType.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +7 -2
- package/bin/types/JsViewVueWidget/JsvTextureAnim/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +100 -0
- package/bin/types/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +25 -0
- package/bin/types/JsViewVueWidget/JsvVisibleSensor/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/index.d.ts +9 -0
- package/bin/types/index.d.ts +4 -0
- package/index.d.ts +8 -0
- package/package.json +1 -1
- package/tools/config/rollup.config.mjs +1 -0
- package/tools/config/toolkit.mjs +81 -0
- package/tools/config/tsconfig.json +1 -0
- package/tools/config/vite.config.ts +24 -14
- package/tools/jsview-vue-build.mjs +66 -21
- package/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue +6 -2
- package/utils/JsViewEngineWidget/JsvFocus/{JsvFocusManager.js → JsvFocusManager.ts} +34 -15
- package/utils/JsViewEngineWidget/MetroWidget/Dispatcher.ts +20 -0
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +30 -11
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +54 -15
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +509 -268
- package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +11 -0
- package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +8 -0
- package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +20 -10
- package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +33 -9
- package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +2 -2
- package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +7 -0
- package/utils/JsViewEngineWidget/{index.js → index.ts} +1 -1
- package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +21 -2
- package/utils/JsViewPlugin/JsvAudio/version.js +1 -1
- package/utils/JsViewPlugin/JsvAudio/version.mjs +1 -1
- package/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.js +13 -3
- package/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue +27 -6
- package/utils/JsViewPlugin/JsvLatex/JsvLatex.vue +34 -28
- package/utils/JsViewPlugin/JsvLatex/index.js +22 -0
- package/utils/JsViewVueTools/ConstSymbol.ts +2 -2
- package/utils/JsViewVueTools/FeatureActive.ts +84 -0
- package/utils/JsViewVueTools/ForgeHandles.ts +7 -3
- package/utils/JsViewVueTools/JsvDynamicCssStyle.js +2 -0
- package/utils/JsViewVueTools/JsvDynamicKeyFrames.ts +2 -0
- package/utils/JsViewVueTools/JsvImpactTracer.js +2 -0
- package/utils/JsViewVueTools/JsvPreDownloader.ts +5 -4
- package/utils/JsViewVueTools/JsvRefTaker.js +1 -2
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +67 -1
- package/utils/JsViewVueTools/JsvStyleClass.js +2 -0
- package/utils/JsViewVueTools/JsvStyleSheetsDeclarer.js +2 -0
- package/utils/JsViewVueTools/JsvTextTools.ts +223 -0
- package/utils/JsViewVueTools/JsvTextureLoadTool.ts +233 -0
- package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +4 -1
- package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +8 -4
- package/utils/JsViewVueTools/JsvTextureStore/Texture.ts +1 -0
- package/utils/JsViewVueTools/TextureManagerTools.ts +17 -0
- package/utils/JsViewVueTools/index.js +22 -19
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +2 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue +2 -2
- package/utils/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue +13 -5
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue +2 -2
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +15 -4
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.js +8 -3
- package/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue +44 -0
- package/utils/JsViewVueWidget/JsvClipDiv/index.ts +1 -0
- package/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue +7 -1
- package/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue +219 -0
- package/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue +84 -0
- package/utils/JsViewVueWidget/JsvDriftScope/index.ts +1 -0
- package/utils/JsViewVueWidget/JsvFilterView.vue +2 -0
- package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +5 -2
- package/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue +145 -0
- package/utils/JsViewVueWidget/JsvFlexCell/index.js +2 -5
- package/utils/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue +75 -0
- package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +293 -0
- package/utils/JsViewVueWidget/JsvFragShaderView/index.js +18 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +142 -63
- package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +9 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue +2 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +15 -6
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +19 -7
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +15 -11
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SyncLinkManager.ts +120 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +5 -1
- package/utils/JsViewVueWidget/JsvGrid.vue +2 -0
- package/utils/JsViewVueWidget/JsvHole.js +2 -0
- package/utils/JsViewVueWidget/JsvInput/Cursor.vue +49 -45
- package/utils/JsViewVueWidget/JsvInput/EditViewOperator.ts +320 -0
- package/utils/JsViewVueWidget/JsvInput/EditVisibleArea.ts +222 -0
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +281 -681
- package/utils/JsViewVueWidget/JsvInput/SharedDefine.ts +17 -0
- package/utils/JsViewVueWidget/JsvInput/SystemTextTools.ts +47 -0
- package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +2 -0
- package/utils/JsViewVueWidget/JsvMarquee.vue +2 -0
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +2 -0
- package/utils/JsViewVueWidget/JsvMindMap/DataTree.ts +14 -1
- package/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue +277 -117
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +91 -68
- package/utils/JsViewVueWidget/JsvNinePatch.vue +18 -1
- package/utils/JsViewVueWidget/JsvPieChart.vue +2 -0
- package/utils/JsViewVueWidget/JsvPosterDiv.vue +2 -0
- package/utils/JsViewVueWidget/JsvPosterImage.vue +2 -0
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +2 -0
- package/utils/JsViewVueWidget/JsvProgressBar.vue +2 -0
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +10 -11
- package/utils/JsViewVueWidget/JsvRadarChart.vue +2 -0
- package/utils/JsViewVueWidget/JsvRipple/Constant.js +2 -2
- package/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue +3 -1
- package/utils/JsViewVueWidget/JsvScaleTextBox.vue +2 -0
- package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue +266 -48
- package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue +477 -0
- package/utils/JsViewVueWidget/JsvScrollBox/ScrollInnerSymbol.ts +9 -0
- package/utils/JsViewVueWidget/JsvScrollBox/ScrollSymbol.ts +13 -4
- package/utils/JsViewVueWidget/JsvScrollBox/index.ts +3 -0
- package/utils/JsViewVueWidget/JsvSector.vue +2 -0
- package/utils/JsViewVueWidget/JsvSoundPool.js +2 -0
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +30 -13
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -0
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue +2 -0
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +2 -0
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +2 -0
- package/utils/JsViewVueWidget/JsvTextBox.vue +2 -4
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +44 -41
- package/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue +101 -0
- package/utils/JsViewVueWidget/JsvVideo.vue +2 -2
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +2 -0
- package/utils/JsViewVueWidget/index.js +5 -0
- package/utils/JsViewEngineWidget/MetroWidget/Dispatcher.js +0 -19
- package/utils/JsViewVueTools/JsvTextTools.js +0 -89
- package/utils/JsViewVueWidget/JsvScrollBox/index.js +0 -2
|
@@ -27,12 +27,15 @@ import { RenderItem } from "./RenderItem";
|
|
|
27
27
|
import { VisibleInfo } from "./VisibleInfo";
|
|
28
28
|
import { WidgetRectInfo } from "./WidgetRectInfo";
|
|
29
29
|
import ActorControl from "../../JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts";
|
|
30
|
-
import { TaskType,
|
|
30
|
+
import { TaskType, TaskManager, AnimationManager, SlideTaskType } from "./TaskManager.ts";
|
|
31
31
|
import { getDirectionByRect, RectCache } from "./Slide.ts";
|
|
32
32
|
import { ForgeConst } from "../../JsViewVueTools/ForgeConstDefine.ts";
|
|
33
|
+
import { FeatureNames, JsvUseFeature } from "../../JsViewVueTools/FeatureActive.ts";
|
|
33
34
|
|
|
34
35
|
const TAG = "MetroWidget";
|
|
35
36
|
|
|
37
|
+
let metroWidgetTokenGen = 1;
|
|
38
|
+
|
|
36
39
|
const _getMetroTemplate = function (
|
|
37
40
|
widgetRectInfo,
|
|
38
41
|
direction,
|
|
@@ -115,6 +118,9 @@ export const setup = (
|
|
|
115
118
|
innerKeepTraceRange = props.keepTraceRange;
|
|
116
119
|
} else {
|
|
117
120
|
if (props.touchFlag > 0) {
|
|
121
|
+
// 激活引擎功能的支持
|
|
122
|
+
JsvUseFeature('MetroWidget', FeatureNames.TouchReceiver);
|
|
123
|
+
|
|
118
124
|
//触控默认3屏
|
|
119
125
|
innerKeepTraceRange = 3;
|
|
120
126
|
} else {
|
|
@@ -127,25 +133,38 @@ export const setup = (
|
|
|
127
133
|
const mode = {
|
|
128
134
|
_mode: FOCUS_MODE,
|
|
129
135
|
_touchState: TouchState.IDLE,
|
|
136
|
+
_touchCount: 0, // 触控流流程ID,解决fling等事件晚于新的touchDown时引起的混乱问题
|
|
130
137
|
|
|
131
138
|
_duringTouch: false,
|
|
132
139
|
_duringFling: false,
|
|
133
|
-
touchStart() {
|
|
140
|
+
touchStart(touchCount) {
|
|
134
141
|
this._mode = TOUCH_MODE;
|
|
135
142
|
modeForExport.value = TOUCH_MODE;
|
|
136
143
|
this._touchState = TouchState.TAP;
|
|
144
|
+
this._touchCount = touchCount;
|
|
137
145
|
},
|
|
138
|
-
touchEnd() {
|
|
139
|
-
this.
|
|
146
|
+
touchEnd(touchCount) {
|
|
147
|
+
if (touchCount == this._touchCount) {
|
|
148
|
+
this._touchState = TouchState.IDLE;
|
|
149
|
+
}
|
|
140
150
|
},
|
|
141
|
-
flingStart() {
|
|
142
|
-
this.
|
|
151
|
+
flingStart(touchCount) {
|
|
152
|
+
if (touchCount == this._touchCount) {
|
|
153
|
+
this._touchState = TouchState.FLING;
|
|
154
|
+
}
|
|
143
155
|
},
|
|
144
|
-
flingEnd() {
|
|
145
|
-
|
|
146
|
-
|
|
156
|
+
flingEnd(touchCount) {
|
|
157
|
+
if (touchCount == this._touchCount) {
|
|
158
|
+
this._touchState = TouchState.IDLE;
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
dragStart(touchCount) {
|
|
162
|
+
if (touchCount == this._touchCount) {
|
|
163
|
+
this._touchState = TouchState.DRAG;
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
dragEnd(touchCount) {
|
|
147
167
|
},
|
|
148
|
-
dragEnd() { },
|
|
149
168
|
keyDown() {
|
|
150
169
|
this._mode = FOCUS_MODE;
|
|
151
170
|
modeForExport.value = FOCUS_MODE;
|
|
@@ -162,6 +181,9 @@ export const setup = (
|
|
|
162
181
|
},
|
|
163
182
|
getTouchState() {
|
|
164
183
|
return this._touchState;
|
|
184
|
+
},
|
|
185
|
+
getTouchCount() {
|
|
186
|
+
return this._touchCount;
|
|
165
187
|
}
|
|
166
188
|
}
|
|
167
189
|
|
|
@@ -187,6 +209,10 @@ export const setup = (
|
|
|
187
209
|
let innerSlideSetting = props.slideSetting
|
|
188
210
|
const currentFocusIndex = ref(0);
|
|
189
211
|
|
|
212
|
+
// 当sliderDiv变化时,渲染端在响应此变化前的gap记录,用于准确计算getVisibleStart
|
|
213
|
+
let freeMoveSlideGapTop = 0;
|
|
214
|
+
let freeMoveSlideGapLeft = 0;
|
|
215
|
+
|
|
190
216
|
const DEFAULT_ANIMATION_DURATION = 200;
|
|
191
217
|
|
|
192
218
|
const isItemVisible = (item) => {
|
|
@@ -205,6 +231,7 @@ export const setup = (
|
|
|
205
231
|
}
|
|
206
232
|
|
|
207
233
|
const onAddTask = (allTask) => {
|
|
234
|
+
if (!innerData || innerData.length <= 0) { return; }
|
|
208
235
|
let resizeTaskMap = {};
|
|
209
236
|
//统一处理itemResize和slide动画
|
|
210
237
|
let minIndex = Infinity;
|
|
@@ -218,7 +245,6 @@ export const setup = (
|
|
|
218
245
|
let slideDoAnim = false;
|
|
219
246
|
|
|
220
247
|
mRectCache.cacheManually();
|
|
221
|
-
|
|
222
248
|
/**
|
|
223
249
|
* 处理resize
|
|
224
250
|
*/
|
|
@@ -246,6 +272,9 @@ export const setup = (
|
|
|
246
272
|
})
|
|
247
273
|
});
|
|
248
274
|
|
|
275
|
+
//更新touch的size
|
|
276
|
+
updateTouchDivSize();
|
|
277
|
+
|
|
249
278
|
//使用上一帧的状态计算anchorPosition
|
|
250
279
|
if (resizeTaskMap[id2Index(focusId)]) {
|
|
251
280
|
const task = resizeTaskMap[id2Index(focusId)];
|
|
@@ -272,12 +301,14 @@ export const setup = (
|
|
|
272
301
|
let direction = undefined;
|
|
273
302
|
|
|
274
303
|
let validSlideTask = false;
|
|
304
|
+
let forceSlide = false;
|
|
275
305
|
if (allTask.slide.length > 0) {
|
|
276
306
|
validSlideTask = true;
|
|
277
307
|
//有滚动时, 取消延时加载
|
|
278
308
|
tryCancelDelayLoad();
|
|
279
309
|
let slideTask = lastOfArray(allTask.slide);
|
|
280
310
|
slideDoAnim = slideTask.params.doAnim;
|
|
311
|
+
forceSlide = slideTask.params.force;
|
|
281
312
|
switch (slideTask.subType) {
|
|
282
313
|
case SlideTaskType.SLIDE_BY_DIV: {
|
|
283
314
|
const div = slideTask.params.div;
|
|
@@ -332,8 +363,10 @@ export const setup = (
|
|
|
332
363
|
if (anchorInfo) {
|
|
333
364
|
//保持anchor
|
|
334
365
|
const focusItem = getItemById(focusId);
|
|
335
|
-
|
|
336
|
-
|
|
366
|
+
let start = focusItem.templateInfo[pos_key] + focusItem.templateInfo[size_key] * anchorInfo.anchor - 1 - anchorInfo.anchorPosition;
|
|
367
|
+
let totalSize = metroTemplate.getBoundingBoxSize();
|
|
368
|
+
start = Math.min(Math.max(0, start), totalSize[size_key] - visibleInfo.range)
|
|
369
|
+
targetVisibleStart = normalizeVisibleStart(start, focusItem.templateInfo, focusItem.templateInfo.index, visibleInfo);
|
|
337
370
|
} else {
|
|
338
371
|
targetRect = getItemById(focusId).templateInfo;
|
|
339
372
|
}
|
|
@@ -347,8 +380,9 @@ export const setup = (
|
|
|
347
380
|
//存在resize时, 需要调整targetRect
|
|
348
381
|
preInfo = mRectCache.getPreRect();
|
|
349
382
|
if (preInfo) {
|
|
350
|
-
|
|
351
|
-
|
|
383
|
+
let totalSize = metroTemplate.getBoundingBoxSize();
|
|
384
|
+
v.start = Math.min(Math.max(0, targetRect[pos_key] - preInfo[pos_key] + v.start), Math.max(0, totalSize[size_key] - v.range));
|
|
385
|
+
preInfo[pos_key] += (v.start - visibleInfo.start);
|
|
352
386
|
}
|
|
353
387
|
}
|
|
354
388
|
targetVisibleStart = _calculateVisibleStart(targetRect, direction, targetRect, v, preInfo);
|
|
@@ -441,7 +475,7 @@ export const setup = (
|
|
|
441
475
|
}
|
|
442
476
|
|
|
443
477
|
//处理滚动动画
|
|
444
|
-
if (needSlide) {
|
|
478
|
+
if (forceSlide || needSlide) {
|
|
445
479
|
let animInfo = undefined;
|
|
446
480
|
if (slideDoAnim) {
|
|
447
481
|
animInfo = {
|
|
@@ -638,7 +672,7 @@ export const setup = (
|
|
|
638
672
|
|
|
639
673
|
const onItemFocus = (focusItem, rect) => {
|
|
640
674
|
//触控模式不触发item的onFocus
|
|
641
|
-
if (!focusItem
|
|
675
|
+
if (!focusItem) return;
|
|
642
676
|
setItemZIndex(focusItem, innerData.length, true);
|
|
643
677
|
if (isFocus) {
|
|
644
678
|
_itemOnFocusSideEffect(focusItem, rect);
|
|
@@ -652,7 +686,7 @@ export const setup = (
|
|
|
652
686
|
};
|
|
653
687
|
|
|
654
688
|
const setFocusByUid = (uid, needSlide = true, doAnim = false, extraSetting) => {
|
|
655
|
-
if (!uid) { return; }
|
|
689
|
+
if (!uid || innerData.length <= 0) { return; }
|
|
656
690
|
//添加item
|
|
657
691
|
templateItemAdder.tryAddItemByUid(uid);
|
|
658
692
|
const item = metroTemplate.getItemByUid(uid);
|
|
@@ -665,7 +699,7 @@ export const setup = (
|
|
|
665
699
|
}
|
|
666
700
|
|
|
667
701
|
const setFocusId = (id, needSlide = true, doAnim = false, extraSetting) => {
|
|
668
|
-
if (id == focusId) {
|
|
702
|
+
if (id == focusId || innerData.length <= 0) {
|
|
669
703
|
return;
|
|
670
704
|
}
|
|
671
705
|
//有外部触发的滚动时, 取消load
|
|
@@ -782,7 +816,7 @@ export const setup = (
|
|
|
782
816
|
}
|
|
783
817
|
};
|
|
784
818
|
|
|
785
|
-
const slideToItemInner = (index, doAnim, direction = undefined, preItem = undefined) => {
|
|
819
|
+
const slideToItemInner = (index, doAnim, direction = undefined, preItem = undefined, force = false) => {
|
|
786
820
|
taskManager.addTask(
|
|
787
821
|
TaskType.SLIDE,
|
|
788
822
|
{
|
|
@@ -790,6 +824,7 @@ export const setup = (
|
|
|
790
824
|
doAnim,
|
|
791
825
|
direction,
|
|
792
826
|
preItem,
|
|
827
|
+
force,
|
|
793
828
|
},
|
|
794
829
|
SlideTaskType.SLIDE_BY_ITEM);
|
|
795
830
|
};
|
|
@@ -812,111 +847,179 @@ export const setup = (
|
|
|
812
847
|
SlideTaskType.SLIDE_BY_DIV);
|
|
813
848
|
}
|
|
814
849
|
}
|
|
815
|
-
const
|
|
816
|
-
if (rect
|
|
817
|
-
&& typeof rect.left == 'number'
|
|
818
|
-
&& typeof rect.top == 'number'
|
|
819
|
-
&& typeof rect.width == 'number'
|
|
820
|
-
&& typeof rect.height == 'number') {
|
|
850
|
+
const slideToRectInner = (rect, doAnim, direction, force) => {
|
|
851
|
+
if (rect && typeof rect.left == "number" && typeof rect.top == "number" && typeof rect.width == "number" && typeof rect.height == "number") {
|
|
821
852
|
taskManager.addTask(
|
|
822
853
|
TaskType.SLIDE,
|
|
823
854
|
{
|
|
824
855
|
rect,
|
|
825
856
|
doAnim,
|
|
826
857
|
direction,
|
|
858
|
+
force
|
|
827
859
|
},
|
|
828
|
-
SlideTaskType.SLIDE_BY_RECT
|
|
860
|
+
SlideTaskType.SLIDE_BY_RECT
|
|
861
|
+
);
|
|
829
862
|
}
|
|
830
863
|
}
|
|
864
|
+
const slideToRect = (rect, doAnim, direction = undefined) => {
|
|
865
|
+
slideToRectInner(rect, doAnim, direction, false);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
function ifLayoutChange(type, oldMeasureItem, newMeasureItem) {
|
|
869
|
+
let changed = newMeasureItem.width !== oldMeasureItem.width
|
|
870
|
+
|| newMeasureItem.height !== oldMeasureItem.height
|
|
871
|
+
|| newMeasureItem.focusable !== oldMeasureItem.focusable
|
|
872
|
+
|| newMeasureItem.marginRight !== oldMeasureItem.marginRight
|
|
873
|
+
|| newMeasureItem.marginBottom !== oldMeasureItem.marginBottom;
|
|
874
|
+
if (type !== "relative") {
|
|
875
|
+
changed = changed
|
|
876
|
+
|| newMeasureItem.left !== oldMeasureItem.left
|
|
877
|
+
|| newMeasureItem.top !== oldMeasureItem.top
|
|
878
|
+
}
|
|
879
|
+
return changed;
|
|
880
|
+
}
|
|
831
881
|
|
|
832
|
-
const
|
|
882
|
+
const DATA_ID_KEY = "jsvKey";
|
|
883
|
+
const refreshData = (forceUpdate) => {
|
|
833
884
|
//由于data不支持reactive, 因此数据的更新只通过provideData
|
|
834
885
|
if (!props.provideData) {
|
|
835
886
|
console.error("refreshData: provideData is null.");
|
|
836
887
|
return;
|
|
837
888
|
}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
889
|
+
try {
|
|
890
|
+
let newData = toRaw(props.provideData()).concat();
|
|
891
|
+
if (newData instanceof Array) {
|
|
892
|
+
let maxSameIndex = -1;
|
|
893
|
+
let layoutChange = false;
|
|
894
|
+
let onlyDataChangeList = [];
|
|
895
|
+
let targetFocusId = focusId
|
|
896
|
+
if (focusId >= newData.length) {
|
|
897
|
+
targetFocusId = newData.length - 1
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
if (!forceUpdate) {
|
|
901
|
+
for (let i = 0; i < dataList.length; ++i) {
|
|
902
|
+
let oldItem = dataList[i];
|
|
903
|
+
let newItem = newData[i];
|
|
904
|
+
if (newItem) {
|
|
905
|
+
if (newItem === oldItem
|
|
906
|
+
|| (typeof newItem[DATA_ID_KEY] !== "undefined" && typeof oldItem[DATA_ID_KEY] !== "undefined" && newItem[DATA_ID_KEY] === oldItem[DATA_ID_KEY])) {
|
|
907
|
+
//相同的item
|
|
908
|
+
maxSameIndex = Math.max(maxSameIndex, i);
|
|
909
|
+
} else {
|
|
910
|
+
const newMeasureItem = props.measures(newItem);
|
|
911
|
+
const oldMeasureItem = props.measures(oldItem);
|
|
912
|
+
layoutChange = ifLayoutChange(props.layoutType, oldMeasureItem, newMeasureItem);
|
|
913
|
+
if (layoutChange) {
|
|
914
|
+
break;
|
|
915
|
+
} else {
|
|
916
|
+
if (i < innerData.length) {
|
|
917
|
+
onlyDataChangeList.push({
|
|
918
|
+
templateInfo: innerData[i].templateInfo,
|
|
919
|
+
measureObj: newMeasureItem,
|
|
920
|
+
data: newItem,
|
|
921
|
+
index: i,
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
} else {
|
|
927
|
+
if (i >= newData.length) {
|
|
928
|
+
//item减少需要布局改变
|
|
929
|
+
layoutChange = true;
|
|
930
|
+
break;
|
|
931
|
+
} else {
|
|
932
|
+
//数据中存在undefined item
|
|
933
|
+
throw new Error("undefined item in data list.", i, newData);
|
|
934
|
+
}
|
|
935
|
+
}
|
|
854
936
|
}
|
|
855
937
|
}
|
|
856
|
-
|
|
857
|
-
|
|
938
|
+
|
|
939
|
+
dataList = newData;
|
|
940
|
+
if (forceUpdate || layoutChange) {
|
|
941
|
+
//需要更新布局
|
|
942
|
+
pageUpdateToken.value++;
|
|
943
|
+
//数据更改
|
|
944
|
+
permanentItemList = [];
|
|
945
|
+
metroTemplate = _getMetroTemplate(
|
|
946
|
+
widgetRectInfo,
|
|
947
|
+
props.direction,
|
|
948
|
+
props.supportHistoryPath,
|
|
949
|
+
props.layoutType,
|
|
950
|
+
templateMode
|
|
951
|
+
);
|
|
952
|
+
innerData = [];
|
|
953
|
+
templateItemAdder = new TemplateItemAdder(
|
|
954
|
+
metroTemplate,
|
|
955
|
+
dataList,
|
|
956
|
+
props.measures,
|
|
957
|
+
pageRange,
|
|
958
|
+
_onTemplateItemAdd,
|
|
959
|
+
props.name,
|
|
960
|
+
_onTemplateAddDone
|
|
961
|
+
);
|
|
962
|
+
if (props.onScroll) {
|
|
963
|
+
templateItemAdder.tryAddItemByIndex(dataList.length - 1);
|
|
964
|
+
} else {
|
|
965
|
+
templateItemAdder.tryAddItemById(targetFocusId);
|
|
966
|
+
}
|
|
967
|
+
} else {
|
|
968
|
+
if (maxSameIndex < newData.length - 1) {
|
|
969
|
+
//追加数据
|
|
970
|
+
templateItemAdder.updateData(newData);
|
|
971
|
+
if (props.onScroll) {
|
|
972
|
+
templateItemAdder.tryAddItemByIndex(dataList.length - 1);
|
|
973
|
+
} else {
|
|
974
|
+
templateItemAdder.tryAddItemById(targetFocusId);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
//仅用户数据变更
|
|
979
|
+
if (onlyDataChangeList.length > 0) {
|
|
980
|
+
for (let i of onlyDataChangeList) {
|
|
981
|
+
if (i.index < innerData.length) {
|
|
982
|
+
innerData[i.index].updateCustomData(i.data, _getItemConfigFromMeasursObj(i.measureObj));
|
|
983
|
+
innerData[i.index].enableTap = i.measureObj.enableTap ?? false;
|
|
984
|
+
} else {
|
|
985
|
+
//之后的数据未布局, 尚未添加到innerData中
|
|
986
|
+
break;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
}
|
|
858
990
|
}
|
|
991
|
+
|
|
992
|
+
if (targetFocusId != focusId) {
|
|
993
|
+
//重置所有的滚动信息
|
|
994
|
+
_changeFocusId(targetFocusId, false);
|
|
995
|
+
visibleInfo = visibleInfo.copy();
|
|
996
|
+
visibleInfo.start = 0;
|
|
997
|
+
visibleInfo._startMax = 0;
|
|
998
|
+
slideDivLeft.value = 0;
|
|
999
|
+
slideDivTop.value = 0;
|
|
1000
|
+
}
|
|
1001
|
+
const updater = pageUpdater.update(
|
|
1002
|
+
metroTemplate,
|
|
1003
|
+
visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
|
|
1004
|
+
visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
|
|
1005
|
+
focusId,
|
|
1006
|
+
false,
|
|
1007
|
+
permanentItemList
|
|
1008
|
+
);
|
|
1009
|
+
updater.apply();
|
|
1010
|
+
onItemFocus(getItemById(focusId), null);
|
|
1011
|
+
let targetRect = mRectCache.getCurRect() ?? mRectCache.getPreRect();
|
|
1012
|
+
if (targetRect) {
|
|
1013
|
+
slideToRectInner(targetRect, false, 0, true);
|
|
1014
|
+
} else {
|
|
1015
|
+
slideToItemInner(id2Index(focusId), false, 0, 0, true);
|
|
1016
|
+
}
|
|
1017
|
+
//template和slideDivStyle均确定后再次重设box condition
|
|
1018
|
+
updateTouchBoxCondition();
|
|
859
1019
|
}
|
|
1020
|
+
} catch (e) {
|
|
1021
|
+
console.log(TAG, "refresh error", e)
|
|
860
1022
|
}
|
|
861
|
-
let need_update_content = false;
|
|
862
|
-
if (!_force_update && new_index === metroTemplate.size) {
|
|
863
|
-
//原始数据都在
|
|
864
|
-
if (new_index !== new_list.length) {
|
|
865
|
-
//增加数据
|
|
866
|
-
need_update_content = true;
|
|
867
|
-
templateItemAdder.updateData(new_list);
|
|
868
|
-
} else {
|
|
869
|
-
//数据没变
|
|
870
|
-
}
|
|
871
|
-
} else {
|
|
872
|
-
pageUpdateToken.value++;
|
|
873
|
-
//数据更改
|
|
874
|
-
permanentItemList = [];
|
|
875
|
-
need_update_content = true;
|
|
876
|
-
metroTemplate = _getMetroTemplate(
|
|
877
|
-
widgetRectInfo,
|
|
878
|
-
props.direction,
|
|
879
|
-
props.supportHistoryPath,
|
|
880
|
-
props.layoutType,
|
|
881
|
-
templateMode
|
|
882
|
-
);
|
|
883
|
-
innerData = [];
|
|
884
|
-
dataList = new_list;
|
|
885
|
-
templateItemAdder = new TemplateItemAdder(
|
|
886
|
-
metroTemplate,
|
|
887
|
-
dataList,
|
|
888
|
-
props.measures,
|
|
889
|
-
pageRange,
|
|
890
|
-
_onTemplateItemAdd,
|
|
891
|
-
props.name,
|
|
892
|
-
_onTemplateAddDone
|
|
893
|
-
);
|
|
894
|
-
}
|
|
895
|
-
if (need_update_content) {
|
|
896
|
-
if (props.onScroll) {
|
|
897
|
-
templateItemAdder.tryAddItemByIndex(dataList.length - 1);
|
|
898
|
-
} else {
|
|
899
|
-
templateItemAdder.tryAddItemById(focusId);
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
const updater = pageUpdater.update(
|
|
903
|
-
metroTemplate,
|
|
904
|
-
visibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
|
|
905
|
-
visibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
|
|
906
|
-
focusId,
|
|
907
|
-
false,
|
|
908
|
-
permanentItemList
|
|
909
|
-
);
|
|
910
|
-
updater.apply();
|
|
911
|
-
onItemFocus(getItemById(focusId), null);
|
|
912
|
-
let targetRect = mRectCache.getCurRect() ?? mRectCache.getPreRect();
|
|
913
|
-
if (targetRect) {
|
|
914
|
-
slideToRect(targetRect, false);
|
|
915
|
-
} else {
|
|
916
|
-
slideToItem(id2Index(focusId), false);
|
|
917
|
-
}
|
|
918
|
-
//template和slideDivStyle均确定后再次重设box condition
|
|
919
|
-
updateTouchBoxCondition();
|
|
920
1023
|
};
|
|
921
1024
|
|
|
922
1025
|
const getVisibleItems = () => {
|
|
@@ -933,6 +1036,7 @@ export const setup = (
|
|
|
933
1036
|
};
|
|
934
1037
|
|
|
935
1038
|
const moveFocus = (direction) => {
|
|
1039
|
+
if (innerData.length <= 0) { return; }
|
|
936
1040
|
//有外部触发的滚动时, 取消load
|
|
937
1041
|
tryCancelDelayLoad();
|
|
938
1042
|
if (direction == "left" || direction == 37 || direction == EdgeDirection.left) {
|
|
@@ -956,10 +1060,6 @@ export const setup = (
|
|
|
956
1060
|
return id2Index(focusId);
|
|
957
1061
|
}
|
|
958
1062
|
|
|
959
|
-
const getCurMode = () => {
|
|
960
|
-
return mode.getMode();
|
|
961
|
-
}
|
|
962
|
-
|
|
963
1063
|
const getTemplatePosition = (index) => {
|
|
964
1064
|
return _getTemplatePosition(index);
|
|
965
1065
|
}
|
|
@@ -980,6 +1080,13 @@ export const setup = (
|
|
|
980
1080
|
}
|
|
981
1081
|
}
|
|
982
1082
|
|
|
1083
|
+
const tryCancelDelayLoad = () => {
|
|
1084
|
+
if (delayLoadHandler > 0) {
|
|
1085
|
+
clearTimeout(delayLoadHandler);
|
|
1086
|
+
delayLoadHandler = -1;
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
|
|
983
1090
|
const exportObject = {
|
|
984
1091
|
lockSlide,
|
|
985
1092
|
unlockSlide,
|
|
@@ -999,9 +1106,10 @@ export const setup = (
|
|
|
999
1106
|
getVisibleItems,
|
|
1000
1107
|
getCustomerDataSize,
|
|
1001
1108
|
getCurrentFocusIndex,
|
|
1002
|
-
getCurMode,
|
|
1003
1109
|
getTemplatePosition,
|
|
1004
|
-
setSlideSetting
|
|
1110
|
+
setSlideSetting,
|
|
1111
|
+
cancelDelayLoad: tryCancelDelayLoad,
|
|
1112
|
+
setSensorSensitivity,
|
|
1005
1113
|
};
|
|
1006
1114
|
|
|
1007
1115
|
const _calculateNearestItemByRect = (visibleSet, enter_rect_info) => {
|
|
@@ -1199,6 +1307,24 @@ export const setup = (
|
|
|
1199
1307
|
}
|
|
1200
1308
|
};
|
|
1201
1309
|
|
|
1310
|
+
const onDispatchKeyDown = (ev) => {
|
|
1311
|
+
if (mode.getMode() == TOUCH_MODE && !mode.duringTouch()) {
|
|
1312
|
+
if (ev.keyCode == 37 || ev.keyCode == 38 || ev.keyCode == 39 || ev.keyCode == 40) {
|
|
1313
|
+
//只有在上下左右键切换为focus_mode
|
|
1314
|
+
mode.keyDown();
|
|
1315
|
+
//touch切换为focus的首次按键只显示焦点
|
|
1316
|
+
const focusItem = _getVisibleFocusableItem();
|
|
1317
|
+
const preFocusItem = getItemById(focusId);
|
|
1318
|
+
_changeFocusId(focusItem.id, false);
|
|
1319
|
+
if (preFocusItem.id !== focusItem.id) {
|
|
1320
|
+
onItemBlur(preFocusItem);
|
|
1321
|
+
}
|
|
1322
|
+
onItemFocus(focusItem);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
return false;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1202
1328
|
const focusBlockOnKeyDown = (ev) => {
|
|
1203
1329
|
if (onKeyDownLock) {
|
|
1204
1330
|
return true;
|
|
@@ -1208,14 +1334,6 @@ export const setup = (
|
|
|
1208
1334
|
if (mode.duringTouch()) {
|
|
1209
1335
|
//touch过程中的按键不处理
|
|
1210
1336
|
return true;
|
|
1211
|
-
} else {
|
|
1212
|
-
//切换为focus_mode
|
|
1213
|
-
mode.keyDown();
|
|
1214
|
-
//touch切换为focus的首次按键只显示焦点
|
|
1215
|
-
const focusItem = _getVisibleFocusableItem();
|
|
1216
|
-
_changeFocusId(focusItem.id, false);
|
|
1217
|
-
onItemFocus(focusItem);
|
|
1218
|
-
return true;
|
|
1219
1337
|
}
|
|
1220
1338
|
}
|
|
1221
1339
|
|
|
@@ -1249,14 +1367,11 @@ export const setup = (
|
|
|
1249
1367
|
);
|
|
1250
1368
|
};
|
|
1251
1369
|
|
|
1252
|
-
|
|
1253
|
-
//update slideDiv size
|
|
1370
|
+
function updateTouchDivSize() {
|
|
1254
1371
|
const lastTemplateInfo = getItemByIndex(
|
|
1255
1372
|
metroTemplate.getTailItemIndex()
|
|
1256
1373
|
)?.templateInfo;
|
|
1257
1374
|
if (lastTemplateInfo) {
|
|
1258
|
-
let preTouchW = touchDivSize.width;
|
|
1259
|
-
let preTouchH = touchDivSize.height;
|
|
1260
1375
|
if (vertical) {
|
|
1261
1376
|
touchDivSize.width = props.width;
|
|
1262
1377
|
touchDivSize.height = lastTemplateInfo.top + lastTemplateInfo.height - 1;
|
|
@@ -1264,13 +1379,20 @@ export const setup = (
|
|
|
1264
1379
|
touchDivSize.width = lastTemplateInfo.left + lastTemplateInfo.width - 1;
|
|
1265
1380
|
touchDivSize.height = props.height;
|
|
1266
1381
|
}
|
|
1267
|
-
if (preTouchW !== touchDivSize.width || preTouchH !== touchDivSize.height) {
|
|
1268
|
-
updateTouchBoxCondition();
|
|
1269
|
-
}
|
|
1270
1382
|
}
|
|
1271
1383
|
}
|
|
1272
1384
|
|
|
1273
|
-
const
|
|
1385
|
+
const _onTemplateAddDone = () => {
|
|
1386
|
+
//update slideDiv size
|
|
1387
|
+
let preTouchW = touchDivSize.width;
|
|
1388
|
+
let preTouchH = touchDivSize.height;
|
|
1389
|
+
updateTouchDivSize();
|
|
1390
|
+
if (preTouchW !== touchDivSize.width || preTouchH !== touchDivSize.height) {
|
|
1391
|
+
updateTouchBoxCondition();
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
const _getItemConfigFromMeasursObj = (measuresObj) => {
|
|
1274
1396
|
let focusZIndex = -1,
|
|
1275
1397
|
normalZIndex = -1;
|
|
1276
1398
|
if (
|
|
@@ -1289,12 +1411,17 @@ export const setup = (
|
|
|
1289
1411
|
normalZIndex = measuresObj["zIndex"];
|
|
1290
1412
|
}
|
|
1291
1413
|
}
|
|
1292
|
-
|
|
1414
|
+
return {
|
|
1293
1415
|
focusZIndex,
|
|
1294
1416
|
normalZIndex,
|
|
1295
1417
|
permanent: measuresObj.permanent ?? false,
|
|
1296
1418
|
itemSlide: measuresObj.itemSlide ?? METRO_WIDGET_CONST.ITEM_SLIDE.ACT_ITEM_FOCUS,
|
|
1419
|
+
showSkeleton: measuresObj.showSkeleton ?? true,
|
|
1297
1420
|
};
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
const _onTemplateItemAdd = (customerData, templateItem, measuresObj) => {
|
|
1424
|
+
let itemConfig = _getItemConfigFromMeasursObj(measuresObj);
|
|
1298
1425
|
|
|
1299
1426
|
const renderStyle = reactive({
|
|
1300
1427
|
left: templateItem.left,
|
|
@@ -1560,55 +1687,55 @@ export const setup = (
|
|
|
1560
1687
|
}
|
|
1561
1688
|
};
|
|
1562
1689
|
|
|
1563
|
-
const normalizeVisibleStart = (origin, targetRect
|
|
1690
|
+
const normalizeVisibleStart = (origin, targetRect, index, _visibleInfo) => {
|
|
1564
1691
|
let pos_key = vertical ? "top" : "left";
|
|
1565
1692
|
let size_key = vertical ? "height" : "width";
|
|
1566
1693
|
let visibleStart = origin;
|
|
1694
|
+
let vInfo = _visibleInfo;
|
|
1567
1695
|
|
|
1568
1696
|
if ((innerSlideSetting.BoundaryProtect & SlideSetting.START_PROTECT) > 0) {
|
|
1569
|
-
if (
|
|
1697
|
+
if (vInfo.start >= 0) {
|
|
1570
1698
|
let boundary = 0;
|
|
1571
|
-
//首个元素是占位符时, 在保证获焦区域完全展示的前提下要保证首个不可获焦元素的完全展示
|
|
1572
1699
|
const headTemplateInfo = getItemByIndex(0).templateInfo;
|
|
1573
1700
|
if (
|
|
1574
1701
|
targetRect
|
|
1575
|
-
&& (
|
|
1702
|
+
&& (index == headTemplateInfo.index)
|
|
1576
1703
|
&& targetRect[pos_key] + targetRect[size_key] <=
|
|
1577
|
-
|
|
1704
|
+
vInfo.range
|
|
1578
1705
|
) {
|
|
1579
1706
|
boundary = headTemplateInfo[size_key];
|
|
1580
1707
|
}
|
|
1581
1708
|
visibleStart = visibleStart < boundary ? 0 : visibleStart;
|
|
1582
1709
|
} else {
|
|
1583
1710
|
// 以最后一个item的位置作为动态的保护边界
|
|
1584
|
-
visibleStart = visibleStart <
|
|
1711
|
+
visibleStart = visibleStart < vInfo.start ? vInfo.start : visibleStart;
|
|
1585
1712
|
}
|
|
1586
1713
|
}
|
|
1587
1714
|
if ((innerSlideSetting.BoundaryProtect & SlideSetting.END_PROTECT) > 0) {
|
|
1588
1715
|
let lastTemplateInfo = getItemByIndex(metroTemplate.getTailItemIndex()).templateInfo;
|
|
1589
1716
|
const lastEnd = lastTemplateInfo[pos_key] + lastTemplateInfo[size_key];
|
|
1590
|
-
const lastVisibleStart = Math.max(lastEnd -
|
|
1717
|
+
const lastVisibleStart = Math.max(lastEnd - vInfo.range, 0);
|
|
1591
1718
|
//边界必须大于等于0, 同时若最后一个缩进时, 边界采用最后一个item的位置
|
|
1592
|
-
if (
|
|
1719
|
+
if (vInfo.end <= lastEnd) {
|
|
1593
1720
|
let boundary = lastVisibleStart;
|
|
1594
1721
|
if (
|
|
1595
1722
|
targetRect
|
|
1596
|
-
&& (
|
|
1723
|
+
&& (index == lastTemplateInfo.index)
|
|
1597
1724
|
&& targetRect[pos_key] - lastVisibleStart >= 0
|
|
1598
1725
|
) {
|
|
1599
|
-
boundary = lastTemplateInfo[pos_key] -
|
|
1726
|
+
boundary = lastTemplateInfo[pos_key] - vInfo.range;
|
|
1600
1727
|
}
|
|
1601
1728
|
visibleStart = visibleStart > boundary ? lastVisibleStart : visibleStart;
|
|
1602
1729
|
} else {
|
|
1603
1730
|
// 以最后一个item的位置作为动态的保护边界
|
|
1604
|
-
visibleStart = visibleStart >
|
|
1731
|
+
visibleStart = visibleStart > vInfo.start ? vInfo.start : visibleStart;
|
|
1605
1732
|
}
|
|
1606
1733
|
}
|
|
1607
1734
|
return visibleStart;
|
|
1608
1735
|
}
|
|
1609
1736
|
|
|
1610
1737
|
const mRectCache = new RectCache();
|
|
1611
|
-
const _calculateVisibleStart = (targetRect, _direction, templateInfo,
|
|
1738
|
+
const _calculateVisibleStart = (targetRect, _direction, templateInfo, vInfo, preInfo = null) => {
|
|
1612
1739
|
if (!targetRect) {
|
|
1613
1740
|
console.error("MetroWidget: _calculateVisibleStart target item is null");
|
|
1614
1741
|
return 0;
|
|
@@ -1635,7 +1762,7 @@ export const setup = (
|
|
|
1635
1762
|
let pos_key = vertical ? "top" : "left";
|
|
1636
1763
|
let size_key = vertical ? "height" : "width";
|
|
1637
1764
|
let center_key = vertical ? "centerYPos" : "centerXPos";
|
|
1638
|
-
let new_visible_start =
|
|
1765
|
+
let new_visible_start = vInfo.start;
|
|
1639
1766
|
|
|
1640
1767
|
let needCalculate = true;
|
|
1641
1768
|
|
|
@@ -1646,7 +1773,7 @@ export const setup = (
|
|
|
1646
1773
|
|
|
1647
1774
|
//首页不滚动
|
|
1648
1775
|
if (innerSlideSetting.FixFirstPage) {
|
|
1649
|
-
if (targetRect[pos_key] + targetRect[size_key] - 1 <
|
|
1776
|
+
if (targetRect[pos_key] + targetRect[size_key] - 1 < vInfo.range) {
|
|
1650
1777
|
new_visible_start = 0;
|
|
1651
1778
|
needCalculate = false;
|
|
1652
1779
|
}
|
|
@@ -1655,7 +1782,7 @@ export const setup = (
|
|
|
1655
1782
|
if (needCalculate) {
|
|
1656
1783
|
new_visible_start = Math.ceil(
|
|
1657
1784
|
targetRect[pos_key] + targetRect[size_key] / 2 -
|
|
1658
|
-
|
|
1785
|
+
vInfo.range * innerSlideSetting.FixPercent
|
|
1659
1786
|
);
|
|
1660
1787
|
}
|
|
1661
1788
|
break;
|
|
@@ -1674,7 +1801,7 @@ export const setup = (
|
|
|
1674
1801
|
case SlideSetting.Type.SEAMLESS:
|
|
1675
1802
|
//首页不滚动
|
|
1676
1803
|
if (innerSlideSetting.FixFirstPage) {
|
|
1677
|
-
if (targetRect[pos_key] + targetRect[size_key] - 1 <
|
|
1804
|
+
if (targetRect[pos_key] + targetRect[size_key] - 1 < vInfo.range) {
|
|
1678
1805
|
new_visible_start = 0;
|
|
1679
1806
|
needCalculate = false;
|
|
1680
1807
|
}
|
|
@@ -1692,11 +1819,11 @@ export const setup = (
|
|
|
1692
1819
|
const itemMainSize = targetRect[size_key];
|
|
1693
1820
|
|
|
1694
1821
|
if (preRect) {
|
|
1695
|
-
const rect0Start =
|
|
1696
|
-
const rect0End =
|
|
1822
|
+
const rect0Start = vInfo.start;
|
|
1823
|
+
const rect0End = vInfo.start + vInfo.range * innerSlideSetting.StartPercent;
|
|
1697
1824
|
const rect0Range = rect0End - rect0Start + 1
|
|
1698
|
-
const rect1Start =
|
|
1699
|
-
const rect1End =
|
|
1825
|
+
const rect1Start = vInfo.start + vInfo.range * innerSlideSetting.EndPercent;
|
|
1826
|
+
const rect1End = vInfo.start + vInfo.range - 1;
|
|
1700
1827
|
const rect1Range = rect1End - rect1Start + 1;
|
|
1701
1828
|
|
|
1702
1829
|
let target0 = Math.min(preRect[pos_key], rect0End);
|
|
@@ -1713,7 +1840,7 @@ export const setup = (
|
|
|
1713
1840
|
} else {
|
|
1714
1841
|
if (direction <= 0) {
|
|
1715
1842
|
//inRect0, 只处理往左/往上
|
|
1716
|
-
rect0Result =
|
|
1843
|
+
rect0Result = vInfo.start + (itemStart - target0)
|
|
1717
1844
|
}
|
|
1718
1845
|
}
|
|
1719
1846
|
}
|
|
@@ -1726,7 +1853,7 @@ export const setup = (
|
|
|
1726
1853
|
} else {
|
|
1727
1854
|
if (direction >= 0) {
|
|
1728
1855
|
//inRect1, 只处理往右/往下
|
|
1729
|
-
rect1Result =
|
|
1856
|
+
rect1Result = vInfo.start + (itemEnd - target1);
|
|
1730
1857
|
}
|
|
1731
1858
|
}
|
|
1732
1859
|
}
|
|
@@ -1742,16 +1869,16 @@ export const setup = (
|
|
|
1742
1869
|
}
|
|
1743
1870
|
|
|
1744
1871
|
//保证item处于safe area范围
|
|
1745
|
-
const headSafeArea = innerSlideSetting.HeadSafeArea *
|
|
1746
|
-
const tailSafeArea = innerSlideSetting.TailSafeArea *
|
|
1747
|
-
if (itemMainSize >
|
|
1872
|
+
const headSafeArea = innerSlideSetting.HeadSafeArea * vInfo.range;
|
|
1873
|
+
const tailSafeArea = innerSlideSetting.TailSafeArea * vInfo.range;
|
|
1874
|
+
if (itemMainSize > vInfo.range - headSafeArea - tailSafeArea) {
|
|
1748
1875
|
// 大item
|
|
1749
|
-
new_visible_start = Math.round(itemStart - (
|
|
1876
|
+
new_visible_start = Math.round(itemStart - (vInfo.range - itemMainSize) / 2)
|
|
1750
1877
|
} else {
|
|
1751
1878
|
if (itemStart < new_visible_start + headSafeArea) {
|
|
1752
1879
|
new_visible_start = itemStart - headSafeArea;
|
|
1753
|
-
} else if (itemEnd > new_visible_start +
|
|
1754
|
-
new_visible_start = itemEnd -
|
|
1880
|
+
} else if (itemEnd > new_visible_start + vInfo.range - 1 - tailSafeArea) {
|
|
1881
|
+
new_visible_start = itemEnd - vInfo.range + tailSafeArea;
|
|
1755
1882
|
}
|
|
1756
1883
|
}
|
|
1757
1884
|
}
|
|
@@ -1763,7 +1890,7 @@ export const setup = (
|
|
|
1763
1890
|
);
|
|
1764
1891
|
}
|
|
1765
1892
|
|
|
1766
|
-
new_visible_start = normalizeVisibleStart(new_visible_start, targetRect, templateInfo?.index);
|
|
1893
|
+
new_visible_start = normalizeVisibleStart(new_visible_start, targetRect, templateInfo?.index, vInfo);
|
|
1767
1894
|
return Math.round(new_visible_start);
|
|
1768
1895
|
};
|
|
1769
1896
|
|
|
@@ -1885,17 +2012,18 @@ export const setup = (
|
|
|
1885
2012
|
|
|
1886
2013
|
//touch setting
|
|
1887
2014
|
let actorController = null;
|
|
1888
|
-
const touchLoadItemRect = visibleInfo.range;
|
|
1889
2015
|
const reachAnchorGroup = 2;
|
|
1890
2016
|
const wallConditionGroup = 1;
|
|
1891
|
-
const
|
|
2017
|
+
const ScensorCondigionGroup = 3;
|
|
2018
|
+
const TouchDownConditionGroup = 4;
|
|
1892
2019
|
|
|
1893
2020
|
let divPos = -1;
|
|
1894
2021
|
let frameCount = -1;
|
|
2022
|
+
const DEFAULT_SENSITIVITY = 10;
|
|
2023
|
+
let onMoveSensitivity = -1;
|
|
2024
|
+
|
|
1895
2025
|
const getVisibleStart = (moveInfo) => {
|
|
1896
|
-
|
|
1897
|
-
divPos = vertical ? slideDivTop.value : slideDivLeft.value;
|
|
1898
|
-
}
|
|
2026
|
+
divPos = vertical ? slideDivTop.value + freeMoveSlideGapTop : slideDivLeft.value + freeMoveSlideGapLeft;
|
|
1899
2027
|
if (vertical) {
|
|
1900
2028
|
return -(divPos + Math.round(moveInfo.yPos));
|
|
1901
2029
|
} else {
|
|
@@ -1903,6 +2031,51 @@ export const setup = (
|
|
|
1903
2031
|
}
|
|
1904
2032
|
}
|
|
1905
2033
|
|
|
2034
|
+
function onSensor(pos) {
|
|
2035
|
+
const lastTemplateInfo = getItemByIndex(
|
|
2036
|
+
metroTemplate.getTailItemIndex()
|
|
2037
|
+
)?.templateInfo;
|
|
2038
|
+
let totalWidth = 0;
|
|
2039
|
+
if (lastTemplateInfo) {
|
|
2040
|
+
if (vertical) {
|
|
2041
|
+
totalWidth = lastTemplateInfo.top + lastTemplateInfo.height - 1;
|
|
2042
|
+
} else {
|
|
2043
|
+
totalWidth = lastTemplateInfo.left + lastTemplateInfo.width - 1;
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
props.onScroll?.(
|
|
2047
|
+
vertical ? -(pos.yPos + slideDivTop.value + freeMoveSlideGapTop) : -(pos.xPos + slideDivLeft.value + freeMoveSlideGapLeft),
|
|
2048
|
+
visibleInfo.range,
|
|
2049
|
+
totalWidth
|
|
2050
|
+
);
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
function setOnMovement(sensitivity) {
|
|
2054
|
+
onMoveSensitivity = sensitivity;
|
|
2055
|
+
actorController.run((cmds) => [
|
|
2056
|
+
cmds.state().removeConditionByGroup(ScensorCondigionGroup),
|
|
2057
|
+
cmds
|
|
2058
|
+
.condition(ScensorCondigionGroup, true)
|
|
2059
|
+
.onMovement(sensitivity) // 设置x或y移动超过10时才触发回调,以此减少回调的频次,规避js的性能影响
|
|
2060
|
+
.then([onSensor]),
|
|
2061
|
+
]);
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
function setSensorSensitivity(sensitivity = DEFAULT_SENSITIVITY) {
|
|
2065
|
+
if (!actorController) { return }
|
|
2066
|
+
if (sensitivity <= 0) {
|
|
2067
|
+
actorController.run((cmds) => [
|
|
2068
|
+
cmds.state().removeConditionByGroup(ScensorCondigionGroup),
|
|
2069
|
+
]);
|
|
2070
|
+
return;
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
if (sensitivity != onMoveSensitivity) {
|
|
2074
|
+
setOnMovement(sensitivity)
|
|
2075
|
+
}
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
|
|
1906
2079
|
const getTouchCount = (nexusCustomData) => {
|
|
1907
2080
|
let touchCount = -1;
|
|
1908
2081
|
if (nexusCustomData) {
|
|
@@ -1916,69 +2089,76 @@ export const setup = (
|
|
|
1916
2089
|
}
|
|
1917
2090
|
|
|
1918
2091
|
const mergeTouchSlideToSlideDiv = (touchCount) => {
|
|
2092
|
+
let originSlideDivTop = slideDivTop.value;
|
|
2093
|
+
let originSlideDivLeft = slideDivLeft.value;
|
|
1919
2094
|
if (vertical) {
|
|
1920
2095
|
slideDivTop.value = -visibleInfo.start;
|
|
1921
2096
|
} else {
|
|
1922
2097
|
slideDivLeft.value = -visibleInfo.start;
|
|
1923
2098
|
}
|
|
2099
|
+
let newSlideGapTop = originSlideDivTop - slideDivTop.value;
|
|
2100
|
+
let newSlideGapLeft = originSlideDivLeft - slideDivLeft.value;
|
|
2101
|
+
freeMoveSlideGapTop += newSlideGapTop; // 累计slider变化的gap,等待同步完毕时消除gap
|
|
2102
|
+
freeMoveSlideGapLeft += newSlideGapLeft;
|
|
1924
2103
|
|
|
1925
2104
|
const walls = getTouchWall();
|
|
1926
|
-
actorController.run([
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
.condition(wallConditionGroup, true)
|
|
2105
|
+
actorController.run((cmds) => [
|
|
2106
|
+
cmds.state().removeConditionByGroup(wallConditionGroup),
|
|
2107
|
+
cmds.condition(wallConditionGroup, true)
|
|
1930
2108
|
.boxPosition(walls.left, walls.top, walls.right, walls.bottom)
|
|
1931
|
-
.then([
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
.teleportTo(0, 0)
|
|
1939
|
-
])
|
|
1940
|
-
]);
|
|
1941
|
-
//下一帧删除touchCount
|
|
1942
|
-
actorController.run([
|
|
1943
|
-
actorController.condition().onNextTick().then([
|
|
1944
|
-
actorController.state().removeConditionByGroup(touchCountGroup),
|
|
2109
|
+
.then([cmds.state().setHitWallOverflow()]), //TODO 通过prop设置哪个方向overflow
|
|
2110
|
+
cmds.state().setStartOffsetPos(newSlideGapLeft, newSlideGapTop), // 将div的位置调整回馈给FreeMove计量系统
|
|
2111
|
+
cmds.condition().onNextTick(0).then([
|
|
2112
|
+
SliderEditFuncReOrderWrap(() => {
|
|
2113
|
+
freeMoveSlideGapTop -= newSlideGapTop;
|
|
2114
|
+
freeMoveSlideGapLeft -= newSlideGapLeft;
|
|
2115
|
+
}, true) // Slide调整回调要放在其他事件之前,调整slide的gap值
|
|
1945
2116
|
])
|
|
1946
|
-
])
|
|
2117
|
+
]);
|
|
2118
|
+
}
|
|
2119
|
+
function onTouchActionDone(touchCount) {
|
|
2120
|
+
//一次触控动作结束
|
|
2121
|
+
mergeTouchSlideToSlideDiv(touchCount);
|
|
2122
|
+
//由于movement的监听是有帧数间隔的, 所以结束时需要再调用一次onScroll
|
|
2123
|
+
_onScroll();
|
|
1947
2124
|
}
|
|
1948
2125
|
|
|
1949
2126
|
const onTouchDown = (data, customData, nexusCustomData) => {
|
|
1950
2127
|
touchRecorder.reset();
|
|
1951
2128
|
let touchCount = getTouchCount(nexusCustomData);
|
|
1952
2129
|
touchRecorder.setTouchCount(touchCount);
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
}
|
|
1957
|
-
mode.touchStart();
|
|
1958
|
-
mode.flingEnd();
|
|
2130
|
+
updateTouchBoxCondition();
|
|
2131
|
+
|
|
2132
|
+
mode.touchStart(touchCount);
|
|
1959
2133
|
// console.log("touchtest", `${props.name} animId:${debugAnimId} viewId:${debugViewId}`,
|
|
1960
2134
|
// "onTouchDown", data, customData, nexusCustomData)
|
|
1961
|
-
|
|
2135
|
+
|
|
2136
|
+
// 运动方向锁定机制
|
|
2137
|
+
// 当MetroWidget在某一方向拖动后,讲另一方向的移动进行锁定
|
|
2138
|
+
const lockThreshhold = 10;
|
|
2139
|
+
const unlockThreshold = 100;
|
|
1962
2140
|
const offsetThreshold = {
|
|
1963
|
-
left: vertical ? undefined :
|
|
1964
|
-
right: vertical ? undefined :
|
|
1965
|
-
top: vertical ?
|
|
1966
|
-
bottom: vertical ?
|
|
2141
|
+
left: vertical ? undefined : lockThreshhold,
|
|
2142
|
+
right: vertical ? undefined : lockThreshhold,
|
|
2143
|
+
top: vertical ? lockThreshhold : undefined,
|
|
2144
|
+
bottom: vertical ? lockThreshhold : undefined,
|
|
1967
2145
|
}
|
|
1968
2146
|
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
2147
|
+
let passDownTouchInfo = nexusCustomData;
|
|
2148
|
+
actorController.run((cmds) => [
|
|
2149
|
+
cmds
|
|
2150
|
+
.condition(TouchDownConditionGroup, false)
|
|
1972
2151
|
.offsetPosition(offsetThreshold.left, offsetThreshold.top, offsetThreshold.right, offsetThreshold.bottom)
|
|
1973
|
-
.then([
|
|
1974
|
-
|
|
1975
|
-
|
|
2152
|
+
.then([
|
|
2153
|
+
cmds.state().touchLockSwitch(true, vertical ? 1 : 2, unlockThreshold)]),
|
|
2154
|
+
cmds
|
|
2155
|
+
.condition(TouchDownConditionGroup, false)
|
|
1976
2156
|
.startMove(true, true)
|
|
1977
|
-
.then([onDragStart]),
|
|
2157
|
+
.then([SliderEditFuncReOrderWrap((d) => { onDragStart(d, null, passDownTouchInfo) })]),
|
|
1978
2158
|
])
|
|
1979
2159
|
|
|
1980
2160
|
//blur item
|
|
1981
|
-
onItemBlur(getItemById(focusId));
|
|
2161
|
+
// onItemBlur(getItemById(focusId));
|
|
1982
2162
|
|
|
1983
2163
|
templateItemAdder.tryAddItemByPosition(visibleInfo.end + visibleInfo.range);
|
|
1984
2164
|
|
|
@@ -2002,55 +2182,69 @@ export const setup = (
|
|
|
2002
2182
|
anchorPosList.push(-visibleInfo.start - visibleInfo.range - anchorPos + 1);
|
|
2003
2183
|
anchorPos += anchorSpacing;
|
|
2004
2184
|
}
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2185
|
+
actorController.run((cmds) => {
|
|
2186
|
+
const reachConditionList = anchorPosList.map(pos => {
|
|
2187
|
+
return cmds
|
|
2188
|
+
.condition(reachAnchorGroup)
|
|
2189
|
+
.reachPosition(pos, undefined)
|
|
2190
|
+
.then([SliderEditFuncReOrderWrap((data) => { updateRenderItems(true, true) })])
|
|
2191
|
+
})
|
|
2192
|
+
reachConditionList.unshift(
|
|
2193
|
+
cmds.state().removeConditionByGroup(reachAnchorGroup),
|
|
2194
|
+
)
|
|
2195
|
+
return reachConditionList
|
|
2196
|
+
});
|
|
2015
2197
|
}
|
|
2016
2198
|
|
|
2017
|
-
const onTouchRelease = () => {
|
|
2199
|
+
const onTouchRelease = (touchCount) => {
|
|
2018
2200
|
if (mode.getTouchState() == TouchState.TAP) {
|
|
2019
2201
|
//只点击, 没有移动或者fling
|
|
2020
2202
|
updateRenderItems(false, false);
|
|
2021
|
-
mode.touchEnd();
|
|
2203
|
+
mode.touchEnd(touchCount);
|
|
2022
2204
|
} else {
|
|
2023
2205
|
if (touchRecorder.moved && !mode.duringFling()) {
|
|
2024
|
-
|
|
2206
|
+
onTouchActionDone(touchRecorder.touchCount);
|
|
2025
2207
|
updateRenderItems(false, false);
|
|
2026
|
-
mode.touchEnd()
|
|
2208
|
+
mode.touchEnd(touchCount)
|
|
2027
2209
|
}
|
|
2028
2210
|
}
|
|
2211
|
+
actorController.run((cmds) => [
|
|
2212
|
+
cmds.state().removeConditionByGroup(TouchDownConditionGroup),
|
|
2213
|
+
cmds.state().touchLockSwitch(false, vertical ? 1 : 2)
|
|
2214
|
+
])
|
|
2029
2215
|
}
|
|
2030
2216
|
|
|
2031
2217
|
const exportOnTouchRelease = props.touchFlag > 0 ? onTouchRelease : undefined;
|
|
2032
2218
|
|
|
2033
2219
|
const onDragStart = (data, customData, nexusCustomData) => {
|
|
2220
|
+
let touchCount = getTouchCount(nexusCustomData);
|
|
2034
2221
|
touchRecorder.move();
|
|
2035
|
-
mode.
|
|
2222
|
+
if (!(mode.getTouchCount() == touchCount && mode.duringFling())) {
|
|
2223
|
+
//dragStart event may be triggered after fling event because of sending it when startMove condition is satisfied
|
|
2224
|
+
mode.dragStart(touchCount)
|
|
2225
|
+
}
|
|
2036
2226
|
visibleInfo.start = getVisibleStart(data);
|
|
2037
2227
|
}
|
|
2038
2228
|
|
|
2039
2229
|
const onDragEnd = (data, customData, nexusCustomData) => {
|
|
2230
|
+
let touchCount = getTouchCount(nexusCustomData);
|
|
2231
|
+
mode.dragEnd(touchCount);
|
|
2040
2232
|
visibleInfo.start = getVisibleStart(data);
|
|
2041
|
-
actorController.run([
|
|
2042
|
-
|
|
2233
|
+
actorController.run((cmds) => [
|
|
2234
|
+
cmds.state().removeConditionByGroup(reachAnchorGroup),
|
|
2043
2235
|
]);
|
|
2044
2236
|
}
|
|
2045
2237
|
|
|
2046
2238
|
const onFlingStart = (data, customData, nexusCustomData) => {
|
|
2239
|
+
let touchCount = getTouchCount(nexusCustomData);
|
|
2047
2240
|
touchRecorder.move();
|
|
2048
|
-
mode.flingStart();
|
|
2241
|
+
mode.flingStart(touchCount);
|
|
2049
2242
|
visibleInfo.start = getVisibleStart(data);
|
|
2050
2243
|
updateRenderItems(true, true);
|
|
2051
2244
|
}
|
|
2052
2245
|
|
|
2053
2246
|
const onFlingProgress = (data, customData, nexusCustomData) => {
|
|
2247
|
+
let touchCount = getTouchCount(nexusCustomData);
|
|
2054
2248
|
visibleInfo.start = getVisibleStart(data);
|
|
2055
2249
|
updateRenderItems(true, true);
|
|
2056
2250
|
}
|
|
@@ -2060,14 +2254,15 @@ export const setup = (
|
|
|
2060
2254
|
//记录拖拽的距离
|
|
2061
2255
|
if (mode.duringFling()) {
|
|
2062
2256
|
let touchCount = getTouchCount(nexusCustomData);
|
|
2063
|
-
|
|
2257
|
+
onTouchActionDone(touchCount);
|
|
2064
2258
|
updateRenderItems(false, false);
|
|
2065
|
-
mode.flingEnd();
|
|
2066
|
-
mode.touchEnd();
|
|
2259
|
+
mode.flingEnd(touchCount);
|
|
2260
|
+
mode.touchEnd(touchCount);
|
|
2067
2261
|
}
|
|
2068
2262
|
}
|
|
2069
2263
|
|
|
2070
2264
|
const onFlingDrop = (data, customData, nexusCustomData) => {
|
|
2265
|
+
let touchCount = getTouchCount(nexusCustomData);
|
|
2071
2266
|
visibleInfo.start = getVisibleStart(data);
|
|
2072
2267
|
}
|
|
2073
2268
|
|
|
@@ -2080,18 +2275,19 @@ export const setup = (
|
|
|
2080
2275
|
bottom: 0,
|
|
2081
2276
|
}
|
|
2082
2277
|
if (vertical) {
|
|
2083
|
-
wall.top = -boxSize.height + props.height - slideDivTop.value;
|
|
2278
|
+
wall.top = -boxSize.height + props.height - slideDivTop.value - (widgetRectInfo.padding.top + widgetRectInfo.padding.bottom);
|
|
2084
2279
|
wall.bottom = -slideDivTop.value;
|
|
2085
2280
|
if (wall.top > wall.bottom) {
|
|
2086
2281
|
wall.top = wall.bottom;
|
|
2087
2282
|
}
|
|
2088
2283
|
} else {
|
|
2089
|
-
wall.left = -boxSize.width + props.width - slideDivLeft.value;
|
|
2284
|
+
wall.left = -boxSize.width + props.width - slideDivLeft.value - (widgetRectInfo.padding.left + widgetRectInfo.padding.right);
|
|
2090
2285
|
wall.right = -slideDivLeft.value;
|
|
2091
2286
|
if (wall.left > wall.right) {
|
|
2092
2287
|
wall.left = wall.right;
|
|
2093
2288
|
}
|
|
2094
2289
|
}
|
|
2290
|
+
|
|
2095
2291
|
return wall;
|
|
2096
2292
|
}
|
|
2097
2293
|
|
|
@@ -2113,12 +2309,12 @@ export const setup = (
|
|
|
2113
2309
|
const walls = getTouchWall();
|
|
2114
2310
|
|
|
2115
2311
|
//更新wall设置
|
|
2116
|
-
actorController.run([
|
|
2117
|
-
|
|
2118
|
-
|
|
2312
|
+
actorController.run((cmds) => [
|
|
2313
|
+
cmds.state().removeConditionByGroup(wallConditionGroup),
|
|
2314
|
+
cmds
|
|
2119
2315
|
.condition(wallConditionGroup, true)
|
|
2120
2316
|
.boxPosition(walls.left, walls.top, walls.right, walls.bottom)
|
|
2121
|
-
.then([
|
|
2317
|
+
.then([cmds.state().setHitWallOverflow()]), //TODO 通过prop设置哪个方向overflow
|
|
2122
2318
|
]);
|
|
2123
2319
|
}
|
|
2124
2320
|
}
|
|
@@ -2138,62 +2334,102 @@ export const setup = (
|
|
|
2138
2334
|
}
|
|
2139
2335
|
};
|
|
2140
2336
|
|
|
2337
|
+
const metroWidgetToken = metroWidgetTokenGen++;
|
|
2338
|
+
|
|
2339
|
+
let orderTouchSlideCallbacks;
|
|
2340
|
+
const SliderEditFuncReOrderWrap = (callback, addHeader = false) => {
|
|
2341
|
+
return (...args) => {
|
|
2342
|
+
let pkg = { cb: callback, a: args }
|
|
2343
|
+
if (addHeader) {
|
|
2344
|
+
orderTouchSlideCallbacks.splice(0, 0, pkg);
|
|
2345
|
+
} else {
|
|
2346
|
+
orderTouchSlideCallbacks.push(pkg);
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2141
2351
|
//TODO debug
|
|
2142
2352
|
// let debugAnimId = -1;
|
|
2143
2353
|
// let debugViewId = -1
|
|
2354
|
+
let touchInited = false;
|
|
2144
2355
|
const initTouch = () => {
|
|
2356
|
+
touchInited = true;
|
|
2145
2357
|
actorController = new ActorControl();
|
|
2146
2358
|
const divView = touchDiv.value.jsvGetProxyView();
|
|
2147
2359
|
actorController.bindForgeView(divView, true);
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2360
|
+
|
|
2361
|
+
// 对触控回调进行顺序管理
|
|
2362
|
+
orderTouchSlideCallbacks = new Array();
|
|
2363
|
+
actorController.addCondCycleListener(
|
|
2364
|
+
// starter
|
|
2365
|
+
() => {
|
|
2366
|
+
// TODO: condtion回调的开始处理时机,预留函数为了加打印追踪
|
|
2367
|
+
},
|
|
2368
|
+
// finish
|
|
2369
|
+
() => {
|
|
2370
|
+
// 按照排好的顺序,进行cb调用
|
|
2371
|
+
for (let pkg of orderTouchSlideCallbacks) {
|
|
2372
|
+
pkg.cb(...pkg.a);
|
|
2373
|
+
}
|
|
2374
|
+
// 执行结束后进行清理
|
|
2375
|
+
orderTouchSlideCallbacks.length = 0;
|
|
2376
|
+
}
|
|
2377
|
+
)
|
|
2378
|
+
|
|
2153
2379
|
// debugAnimId = actorController.debugGetAnimId();
|
|
2154
2380
|
// debugViewId = divView.ViewId;
|
|
2155
2381
|
// console.log("testtest", props.name, `animId:${debugAnimId} viewId:${debugViewId}`);
|
|
2156
2382
|
const walls = getTouchWall();
|
|
2157
2383
|
//注册回调
|
|
2158
|
-
actorController.run([
|
|
2159
|
-
|
|
2384
|
+
actorController.run((cmds) => [
|
|
2385
|
+
cmds
|
|
2160
2386
|
.condition(undefined, true)
|
|
2161
2387
|
.onTouchDown()
|
|
2162
|
-
.then([onTouchDown]),
|
|
2163
|
-
|
|
2388
|
+
.then([SliderEditFuncReOrderWrap(onTouchDown)]),
|
|
2389
|
+
cmds
|
|
2164
2390
|
.condition(undefined, true)
|
|
2165
2391
|
.onDragStart()
|
|
2166
|
-
.then([onDragStart]),
|
|
2167
|
-
|
|
2392
|
+
.then([SliderEditFuncReOrderWrap(onDragStart)]),
|
|
2393
|
+
cmds
|
|
2168
2394
|
.condition(undefined, true)
|
|
2169
2395
|
.onDragEnd()
|
|
2170
|
-
.then([onDragEnd]),
|
|
2171
|
-
|
|
2396
|
+
.then([SliderEditFuncReOrderWrap(onDragEnd)]),
|
|
2397
|
+
cmds
|
|
2172
2398
|
.condition(undefined, true)
|
|
2173
2399
|
.onFlingStart()
|
|
2174
|
-
.then([onFlingStart]),
|
|
2175
|
-
|
|
2400
|
+
.then([SliderEditFuncReOrderWrap(onFlingStart)]),
|
|
2401
|
+
cmds
|
|
2176
2402
|
.condition(undefined, true)
|
|
2177
2403
|
.onFlingProgress()
|
|
2178
|
-
.then([onFlingProgress]),
|
|
2179
|
-
|
|
2404
|
+
.then([SliderEditFuncReOrderWrap(onFlingProgress)]),
|
|
2405
|
+
cmds
|
|
2180
2406
|
.condition(undefined, true)
|
|
2181
2407
|
.onFlingEnd()
|
|
2182
|
-
.then([onFlingEnd]),
|
|
2183
|
-
|
|
2408
|
+
.then([SliderEditFuncReOrderWrap(onFlingEnd)]),
|
|
2409
|
+
cmds
|
|
2184
2410
|
.condition(undefined, true)
|
|
2185
2411
|
.onFlingDrop()
|
|
2186
|
-
.then([onFlingDrop]),
|
|
2187
|
-
|
|
2412
|
+
.then([SliderEditFuncReOrderWrap(onFlingDrop)]),
|
|
2413
|
+
cmds
|
|
2188
2414
|
.condition(undefined, true)
|
|
2189
2415
|
.onTouchRelease()
|
|
2190
|
-
.then([
|
|
2191
|
-
|
|
2192
|
-
actorController
|
|
2416
|
+
.then([cmds.state().touchLockSwitch(false, vertical ? 1 : 2)]),
|
|
2417
|
+
cmds
|
|
2193
2418
|
.condition(wallConditionGroup, true)
|
|
2194
2419
|
.boxPosition(walls.left, walls.top, walls.right, walls.bottom)
|
|
2195
|
-
.then([
|
|
2420
|
+
.then([cmds.state().setHitWallOverflow()]), //TODO 通过prop设置哪个方向overflow
|
|
2196
2421
|
]);
|
|
2422
|
+
|
|
2423
|
+
if (props.onScroll) {
|
|
2424
|
+
setOnMovement(DEFAULT_SENSITIVITY);
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
function cleanTouch() {
|
|
2429
|
+
actorController.run((cmds) => [
|
|
2430
|
+
cmds.state().clearAllConditions(),
|
|
2431
|
+
cmds.state().touchLockSwitch(false, vertical ? 1 : 2)
|
|
2432
|
+
])
|
|
2197
2433
|
}
|
|
2198
2434
|
|
|
2199
2435
|
//init
|
|
@@ -2206,9 +2442,9 @@ export const setup = (
|
|
|
2206
2442
|
: { start: widgetRectInfo.padding.left, end: widgetRectInfo.padding.right };
|
|
2207
2443
|
|
|
2208
2444
|
if (props.provideData) {
|
|
2209
|
-
dataList = toRaw(props.provideData());
|
|
2445
|
+
dataList = toRaw(props.provideData())?.concat();
|
|
2210
2446
|
} else if (props.data) {
|
|
2211
|
-
dataList = toRaw(props.data);
|
|
2447
|
+
dataList = toRaw(props.data)?.concat();
|
|
2212
2448
|
}
|
|
2213
2449
|
|
|
2214
2450
|
templateItemAdder = new TemplateItemAdder(
|
|
@@ -2253,20 +2489,20 @@ export const setup = (
|
|
|
2253
2489
|
permanentItemList
|
|
2254
2490
|
);
|
|
2255
2491
|
initUpdater.apply();
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2492
|
+
//触控时, 延时加载剩余屏
|
|
2493
|
+
let delayLoadHandler = -1;
|
|
2494
|
+
if (props.touchFlag > 0) {
|
|
2495
|
+
delayLoadHandler = setTimeout(() => {
|
|
2496
|
+
const updateHandler = pageUpdater.update(
|
|
2497
|
+
metroTemplate,
|
|
2498
|
+
initVisibleInfo.startWithPadding - innerKeepTraceRange * pageRange,
|
|
2499
|
+
initVisibleInfo.endWithPadding + innerKeepTraceRange * pageRange,
|
|
2500
|
+
focusId,
|
|
2501
|
+
false,
|
|
2502
|
+
permanentItemList
|
|
2503
|
+
);
|
|
2504
|
+
updateHandler.apply();
|
|
2505
|
+
}, 200);
|
|
2270
2506
|
}
|
|
2271
2507
|
|
|
2272
2508
|
onMounted(() => {
|
|
@@ -2292,8 +2528,12 @@ export const setup = (
|
|
|
2292
2528
|
onUpdated(() => { });
|
|
2293
2529
|
|
|
2294
2530
|
onBeforeUnmount(() => {
|
|
2531
|
+
taskManager.cancelAllTask();
|
|
2295
2532
|
tryCancelDelayLoad();
|
|
2296
2533
|
mounted = false;
|
|
2534
|
+
if (touchInited) {
|
|
2535
|
+
cleanTouch();
|
|
2536
|
+
}
|
|
2297
2537
|
});
|
|
2298
2538
|
|
|
2299
2539
|
return {
|
|
@@ -2309,5 +2549,6 @@ export const setup = (
|
|
|
2309
2549
|
onTouchRelease: exportOnTouchRelease,
|
|
2310
2550
|
currentFocusIndex,
|
|
2311
2551
|
modeForExport,
|
|
2552
|
+
onDispatchKeyDown
|
|
2312
2553
|
}
|
|
2313
2554
|
}
|