@shijiu/jsview-vue 2.3.151-test.0 → 3.0.0-test.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/browser/BrowserAudio.mjs +200 -0
- package/bin/browser/BrowserJsvLatex.mjs +61 -0
- package/bin/export-sfc.mjs +8 -9
- package/bin/jsview-vue-common.mjs +9 -35
- package/bin/jsview-vue.mjs +22246 -23643
- package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +9 -71
- package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +18 -2
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/Const.d.ts +4 -1
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/DebugFrame.vue.d.ts +10 -7
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +19 -178
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +19 -178
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +24 -3
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +7 -1
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +25 -5
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/SlotComponent.vue.d.ts +9 -47
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/TaskManager.d.ts +2 -1
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/Utils.d.ts +2 -0
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +1 -1
- package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue.d.ts +40 -0
- package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.d.ts +24 -0
- package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.d.ts +19 -0
- package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.d.ts +42 -0
- package/bin/types/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +2 -1
- package/bin/types/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +2 -1
- package/bin/types/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +6 -4
- package/bin/types/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +9 -7
- package/bin/types/utils/JsViewEngineWidget/WidgetCommon.d.ts +17 -7
- package/bin/types/utils/JsViewEngineWidget/index.d.ts +3 -1
- package/bin/types/utils/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +140 -7
- package/bin/types/utils/JsViewPlugin/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +12 -11
- package/bin/types/utils/JsViewPlugin/JsvAudio/Events.d.ts +10 -10
- package/bin/types/utils/JsViewPlugin/JsvAudio/JsvAudio.vue.d.ts +204 -17
- package/bin/types/utils/JsViewPlugin/JsvAudio/JsvAudioProxy.vue.d.ts +2 -1
- package/bin/types/utils/JsViewPlugin/JsvAudio/version.d.mts +11 -11
- package/bin/types/utils/JsViewPlugin/JsvAudio/version.d.ts +11 -11
- package/bin/types/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +0 -1
- package/bin/types/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue.d.ts +75 -12
- package/bin/types/utils/JsViewPlugin/JsvLatex/GetVersion.d.ts +14 -0
- package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +88 -13
- package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +1 -0
- package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +5 -1
- package/bin/types/utils/JsViewPlugin/JsvLatex/version.d.mts +39 -12
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMedia.d.ts +120 -17
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.d.ts +62 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue.d.ts +108 -29
- package/bin/types/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer-0.9.vue.d.ts → JsvPlayerBrowser-0.9.vue.d.ts} +8 -7
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-wasm.vue.d.ts +614 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer.vue.d.ts → JsvPlayerBrowser.vue.d.ts} +36 -34
- package/bin/types/utils/JsViewPlugin/JsvPlayer/index-0.9.d.ts +89 -30
- package/bin/types/utils/JsViewPlugin/JsvPlayer/index.d.ts +89 -30
- package/bin/types/utils/JsViewPlugin/JsvPlayer/version.d.mts +11 -11
- package/bin/types/utils/JsViewVueTools/BlobApi.d.ts +38 -0
- package/bin/types/utils/JsViewVueTools/DebugTool.d.ts +1 -1
- package/bin/types/utils/JsViewVueTools/DefaultKeyMap.d.ts +7 -7
- package/bin/types/utils/JsViewVueTools/FeatureActive.d.ts +1 -0
- package/bin/types/utils/JsViewVueTools/JsvInteractionMode.d.ts +6 -0
- package/bin/types/utils/JsViewVueTools/JsvRuntimeBridge.d.ts +3 -3
- package/bin/types/utils/JsViewVueTools/JsvTextTools.d.ts +1 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.d.ts +43 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +1 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.d.ts +54 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +13 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +2 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +76 -26
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.d.ts +49 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/index.d.ts +2 -0
- package/bin/types/utils/JsViewVueTools/index.d.ts +4 -1
- package/bin/types/utils/JsViewVueWidget/Jsv3dDiv.vue.d.ts +10 -98
- package/bin/types/utils/JsViewVueWidget/Jsv3dStage.vue.d.ts +10 -114
- package/bin/types/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue.d.ts +20 -61
- package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue.d.ts +44 -13
- package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue.d.ts +12 -11
- package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic/index.d.ts +5 -5
- package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +16 -10
- package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +21 -17
- package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +19 -16
- package/bin/types/utils/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.d.ts +7 -7
- package/bin/types/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue.d.ts +12 -66
- package/bin/types/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue.d.ts +73 -12
- package/bin/types/utils/JsViewVueWidget/JsvDashPath.vue.d.ts +59 -10
- package/bin/types/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue.d.ts +41 -81
- package/bin/types/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue.d.ts +17 -100
- package/bin/types/utils/JsViewVueWidget/JsvEnableRenderBreak.vue.d.ts +13 -50
- package/bin/types/utils/JsViewVueWidget/JsvFilterView.vue.d.ts +50 -70
- package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue.d.ts +32 -68
- package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvFullScrAdjust.vue.d.ts +57 -74
- package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue.d.ts +41 -71
- package/bin/types/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +83 -14
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +151 -18
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +79 -83
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/JsvFreeMoveActor.vue.d.ts +70 -0
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +20 -0
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +108 -5
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +88 -3
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +6 -1
- package/bin/types/utils/JsViewVueWidget/JsvGrid.vue.d.ts +19 -18
- package/bin/types/utils/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +34 -11
- package/bin/types/utils/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +4 -1
- package/bin/types/utils/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +193 -6
- package/bin/types/utils/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +54 -11
- package/bin/types/utils/JsViewVueWidget/JsvMarquee.vue.d.ts +89 -11
- package/bin/types/utils/JsViewVueWidget/JsvMaskClipDiv.vue.d.ts +9 -8
- package/bin/types/utils/JsViewVueWidget/JsvMindMap/Geometry.d.ts +2 -2
- package/bin/types/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue.d.ts +170 -138
- package/bin/types/utils/JsViewVueWidget/JsvMindMap/rtree.d.ts +5 -5
- package/bin/types/utils/JsViewVueWidget/JsvNativeSharedDiv.vue.d.ts +48 -72
- package/bin/types/utils/JsViewVueWidget/JsvNinePatch.vue.d.ts +139 -20
- package/bin/types/utils/JsViewVueWidget/JsvPieChart.vue.d.ts +56 -8
- package/bin/types/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +20 -11
- package/bin/types/utils/JsViewVueWidget/JsvProgressBar.vue.d.ts +63 -11
- package/bin/types/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +8 -7
- package/bin/types/utils/JsViewVueWidget/JsvRadarChart.vue.d.ts +95 -12
- package/bin/types/utils/JsViewVueWidget/JsvRipple/Constant.d.ts +2 -2
- package/bin/types/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue.d.ts +51 -78
- package/bin/types/utils/JsViewVueWidget/JsvScaleTextBox.vue.d.ts +5 -4
- package/bin/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +84 -193
- package/bin/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue.d.ts +23 -148
- package/bin/types/utils/JsViewVueWidget/JsvSector.vue.d.ts +56 -9
- package/bin/types/utils/JsViewVueWidget/JsvSmoothSlideContainer.vue.d.ts +22 -67
- package/bin/types/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue.d.ts +44 -10
- package/bin/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +47 -14
- package/bin/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +26 -67
- package/bin/types/utils/JsViewVueWidget/JsvSwiper/Indicator.vue.d.ts +7 -6
- package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSmoothSwiper.vue.d.ts +147 -109
- package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue.d.ts +173 -16
- package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper2.vue.d.ts +216 -139
- package/bin/types/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue.d.ts +7 -6
- package/bin/types/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue.d.ts +101 -96
- package/bin/types/utils/JsViewVueWidget/JsvTextBox.vue.d.ts +89 -74
- package/bin/types/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +21 -20
- package/bin/types/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +43 -70
- package/bin/types/utils/JsViewVueWidget/JsvVideo.vue.d.ts +6 -5
- package/bin/types/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +62 -82
- package/bin/types/utils/JsViewVueWidget/JsvVisibleSensor/index.d.ts +95 -74
- package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvPosterDiv.vue.d.ts +51 -0
- package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvPosterImage.vue.d.ts +105 -0
- package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue.d.ts +51 -0
- package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue.d.ts +105 -0
- package/bin/types/utils/JsViewVueWidget/index.d.ts +5 -3
- package/package.json +2 -2
- package/tools/jsview-vue-build.mjs +13 -9
- package/tsconfig.json +2 -2
- package/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue +32 -16
- package/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.ts +24 -2
- package/utils/JsViewEngineWidget/MetroWidget/Const.ts +5 -0
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +183 -89
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +269 -122
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +989 -357
- package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.ts +41 -23
- package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +138 -41
- package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +1 -0
- package/utils/JsViewEngineWidget/MetroWidget/Utils.ts +6 -0
- package/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.ts +2 -1
- package/utils/JsViewEngineWidget/RectUtils.js +1 -1
- package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue +50 -0
- package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.ts +260 -0
- package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.ts +32 -0
- package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.ts +236 -0
- package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +342 -174
- package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +101 -27
- package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +12 -5
- package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +109 -41
- package/utils/JsViewEngineWidget/WidgetCommon.ts +17 -7
- package/utils/JsViewEngineWidget/index.ts +7 -2
- package/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.js +46 -46
- package/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue +54 -41
- package/utils/JsViewPlugin/JsvLatex/GetVersion.js +65 -0
- package/utils/JsViewPlugin/JsvLatex/JsvLatex.vue +54 -12
- package/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.js +10 -0
- package/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue +15 -2
- package/utils/JsViewPlugin/JsvLatex/PluginLoader.js +63 -31
- package/utils/JsViewPlugin/JsvLatex/version.mjs +26 -13
- package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +2 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +402 -23
- package/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.js +100 -0
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +363 -468
- package/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer.vue → JsvPlayerBrowser-wasm.vue} +60 -10
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +511 -0
- package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +52 -10
- package/utils/JsViewPlugin/JsvPlayer/index.js +58 -9
- package/utils/JsViewPlugin/JsvPlayer/package.json +8 -0
- package/utils/JsViewVueTools/BlobApi.ts +55 -0
- package/utils/JsViewVueTools/FeatureActive.ts +3 -0
- package/utils/JsViewVueTools/ForgeHandles.ts +3 -0
- package/utils/JsViewVueTools/JsvInteractionMode.js +16 -0
- package/utils/JsViewVueTools/JsvPreDownloader.ts +2 -2
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +25 -18
- package/utils/JsViewVueTools/JsvTextTools.ts +9 -1
- package/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.ts +180 -0
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.ts +1 -0
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.ts +304 -0
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.ts +38 -0
- package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +16 -1
- package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +154 -69
- package/utils/JsViewVueTools/JsvTextureStore/Store.ts +1 -1
- package/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.ts +92 -0
- package/utils/JsViewVueTools/JsvTextureStore/index.js +2 -0
- package/utils/JsViewVueTools/index.js +3 -1
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +111 -86
- package/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue +11 -2
- package/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue +1 -1
- package/utils/JsViewVueWidget/JsvEnableRenderBreak.vue +6 -0
- package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +11 -5
- package/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue +3 -1
- package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +23 -11
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +242 -25
- package/utils/JsViewVueWidget/JsvFreeMoveActor/{FreeMoveActor.vue → JsvFreeMoveActor.vue} +1 -1
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +11 -5
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +118 -6
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +56 -14
- package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +2 -1
- package/utils/JsViewVueWidget/JsvInput/EditViewOperator.ts +11 -2
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +30 -2
- package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +24 -7
- package/utils/JsViewVueWidget/JsvMarquee.vue +1 -1
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +12 -10
- package/utils/JsViewVueWidget/JsvNinePatch.vue +13 -8
- package/utils/JsViewVueWidget/JsvPieChart.vue +93 -70
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +32 -29
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +2 -1
- package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue +25 -3
- package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue +0 -3
- package/utils/JsViewVueWidget/JsvSector.vue +66 -28
- package/utils/JsViewVueWidget/JsvTextBox.vue +30 -1
- package/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue +56 -14
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +8 -6
- package/utils/JsViewVueWidget/TypesDiv/JsvPosterDiv.vue +54 -0
- package/utils/JsViewVueWidget/TypesDiv/JsvPosterImage.vue +88 -0
- package/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue +177 -0
- package/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue +267 -0
- package/utils/JsViewVueWidget/index.js +6 -2
- package/bin/browser/BrowserAudio.vue.mjs +0 -258
- package/bin/browser/BrowserJsvLatex.vue.mjs +0 -145
- package/bin/types/utils/JsViewPlugin/JsvLatex/version.d.ts +0 -10
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.d.ts +0 -7
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue.d.ts +0 -78
- package/bin/types/utils/JsViewVueWidget/JsvPosterDiv.vue.d.ts +0 -63
- package/bin/types/utils/JsViewVueWidget/JsvPosterImage.vue.d.ts +0 -78
- package/utils/JsViewPlugin/JsvLatex/version.js +0 -24
- package/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.ts +0 -36
- package/utils/JsViewVueWidget/JsvPosterDiv.vue +0 -56
- package/utils/JsViewVueWidget/JsvPosterImage.vue +0 -105
- /package/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer-0.9.vue → JsvPlayerBrowser-0.9.vue} +0 -0
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
import { MetroTemplate, TemplateItem, MeasureInfo } from "./MetroTemplate"
|
|
2
|
-
import {
|
|
1
|
+
import { MetroTemplate, TemplateItem, MeasureInfo } from "./MetroTemplate";
|
|
2
|
+
import {
|
|
3
|
+
VERTICAL,
|
|
4
|
+
HORIZONTAL,
|
|
5
|
+
FocusMoveType,
|
|
6
|
+
getCurFrameCount,
|
|
7
|
+
} from "../WidgetCommon";
|
|
3
8
|
|
|
4
9
|
const TAG = "ListMetroTemplate";
|
|
5
10
|
|
|
6
11
|
/** 单行/单列 */
|
|
7
12
|
class ListMetroTemplate extends MetroTemplate {
|
|
8
|
-
constructor(
|
|
9
|
-
|
|
13
|
+
constructor(
|
|
14
|
+
direction: Symbol,
|
|
15
|
+
lineMax: number,
|
|
16
|
+
pageSize: number,
|
|
17
|
+
layoutType: string,
|
|
18
|
+
supportHistoryPath: boolean,
|
|
19
|
+
errorLogger: Function
|
|
20
|
+
) {
|
|
21
|
+
super(direction, lineMax, pageSize, layoutType, false, errorLogger);
|
|
10
22
|
}
|
|
11
23
|
|
|
12
|
-
public calculateNeighborWhenAddStop(): void {
|
|
24
|
+
public calculateNeighborWhenAddStop(): void {}
|
|
13
25
|
|
|
14
26
|
public addItemInner(itemObj: MeasureInfo): TemplateItem {
|
|
15
|
-
const templateItem =
|
|
27
|
+
const templateItem = this.getTemplateItem(itemObj);
|
|
16
28
|
this._addTemplateItem(templateItem);
|
|
17
29
|
this.tailItemIndex = templateItem.index;
|
|
18
30
|
return templateItem;
|
|
@@ -21,7 +33,10 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
21
33
|
private _addTemplateItem(templateItem: TemplateItem): void {
|
|
22
34
|
let sizeKey = this.direction == VERTICAL ? "width" : "height";
|
|
23
35
|
if ((templateItem as any)[sizeKey] > this.lineMax) {
|
|
24
|
-
|
|
36
|
+
this.errorLogger(TAG, "parse template error");
|
|
37
|
+
throw new Error(
|
|
38
|
+
`item size is ${templateItem.width}x${templateItem.height}, large than lineMax ${this.lineMax}`
|
|
39
|
+
);
|
|
25
40
|
}
|
|
26
41
|
|
|
27
42
|
const preItem = this.getItemByIndex(this.size - 1);
|
|
@@ -31,7 +46,9 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
31
46
|
//position
|
|
32
47
|
if (this.layoutType == "relative") {
|
|
33
48
|
templateItem.left = 0;
|
|
34
|
-
templateItem.top = preItem
|
|
49
|
+
templateItem.top = preItem
|
|
50
|
+
? preItem.top + preItem.height + preItem.marginBottom
|
|
51
|
+
: 0;
|
|
35
52
|
}
|
|
36
53
|
//neighbor
|
|
37
54
|
if (preItem) {
|
|
@@ -41,15 +58,19 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
41
58
|
} else {
|
|
42
59
|
if (this.layoutType == "relative") {
|
|
43
60
|
templateItem.top = 0;
|
|
44
|
-
templateItem.left = preItem
|
|
61
|
+
templateItem.left = preItem
|
|
62
|
+
? preItem.left + preItem.width + preItem.marginRight
|
|
63
|
+
: 0;
|
|
45
64
|
}
|
|
46
65
|
if (preItem) {
|
|
47
66
|
templateItem.neighborIndexList.left.push(preItem.index);
|
|
48
67
|
preItem.neighborIndexList.right.push(templateItem.index);
|
|
49
68
|
}
|
|
50
69
|
}
|
|
51
|
-
templateItem.centerXPos =
|
|
52
|
-
|
|
70
|
+
templateItem.centerXPos =
|
|
71
|
+
Math.floor(templateItem.left + templateItem.width / 2) - 1;
|
|
72
|
+
templateItem.centerYPos =
|
|
73
|
+
Math.floor(templateItem.top + templateItem.height / 2) - 1;
|
|
53
74
|
|
|
54
75
|
//分页相关的计算
|
|
55
76
|
let curPageNumber = 0;
|
|
@@ -63,8 +84,9 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
63
84
|
positionKey = "top";
|
|
64
85
|
sizeKey = "height";
|
|
65
86
|
}
|
|
66
|
-
const curPageStart =
|
|
67
|
-
|
|
87
|
+
const curPageStart = (this.templateList as any)[curPageHeadIndex][
|
|
88
|
+
positionKey
|
|
89
|
+
];
|
|
68
90
|
if (
|
|
69
91
|
(templateItem as any)[positionKey] + (templateItem as any)[sizeKey] >
|
|
70
92
|
curPageStart + this.pageSize
|
|
@@ -79,8 +101,12 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
79
101
|
templateItem.pageHeadIndex = curPageHeadIndex;
|
|
80
102
|
}
|
|
81
103
|
|
|
82
|
-
public getNextItem(
|
|
83
|
-
|
|
104
|
+
public getNextItem(
|
|
105
|
+
baseId: number,
|
|
106
|
+
vOffset: number,
|
|
107
|
+
hOffset: number,
|
|
108
|
+
moveType: number
|
|
109
|
+
): TemplateItem | null {
|
|
84
110
|
const item = this.getItemById(baseId) as any;
|
|
85
111
|
if (item) {
|
|
86
112
|
let neighborDirection: "left" | "right" | "bottom" | "top" | null = null;
|
|
@@ -99,13 +125,17 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
99
125
|
}
|
|
100
126
|
if (neighborDirection !== null) {
|
|
101
127
|
if (item.neighborIndexList[neighborDirection].length === 0) return null;
|
|
102
|
-
let target = this.getItemByIndex(
|
|
128
|
+
let target = this.getItemByIndex(
|
|
129
|
+
item.neighborIndexList[neighborDirection][0]
|
|
130
|
+
);
|
|
103
131
|
while (target) {
|
|
104
132
|
if (target.focusable) {
|
|
105
133
|
break;
|
|
106
134
|
} else {
|
|
107
135
|
if (target.neighborIndexList[neighborDirection].length > 0) {
|
|
108
|
-
target = this.getItemByIndex(
|
|
136
|
+
target = this.getItemByIndex(
|
|
137
|
+
target.neighborIndexList[neighborDirection][0]
|
|
138
|
+
);
|
|
109
139
|
} else {
|
|
110
140
|
return null;
|
|
111
141
|
}
|
|
@@ -117,21 +147,31 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
117
147
|
return null;
|
|
118
148
|
}
|
|
119
149
|
|
|
120
|
-
public getVisibleItemList(
|
|
121
|
-
|
|
150
|
+
public getVisibleItemList(
|
|
151
|
+
visibleStart: number,
|
|
152
|
+
visibleEnd: number,
|
|
153
|
+
baseId: number
|
|
154
|
+
): [number, number] {
|
|
122
155
|
const positionKey = this.direction == VERTICAL ? "top" : "left";
|
|
123
156
|
const sizeKey = this.direction == VERTICAL ? "height" : "width";
|
|
124
157
|
//template is empty
|
|
125
|
-
if (this.size == 0) {
|
|
158
|
+
if (this.size == 0) {
|
|
159
|
+
return [-1, -1];
|
|
160
|
+
}
|
|
126
161
|
const lastItem = this.templateList[this.templateList.length - 1];
|
|
127
162
|
// invalid visible range
|
|
128
|
-
if (
|
|
129
|
-
|
|
163
|
+
if (
|
|
164
|
+
visibleStart >= visibleEnd ||
|
|
165
|
+
visibleEnd < 0 ||
|
|
166
|
+
visibleStart >= lastItem[positionKey] + lastItem[sizeKey]
|
|
167
|
+
) {
|
|
168
|
+
return [-1, -1];
|
|
130
169
|
}
|
|
131
170
|
|
|
132
171
|
let item = this.getItemById(baseId);
|
|
133
172
|
const startIndex = item ? item.index : Math.round(this.size / 2);
|
|
134
|
-
let start = -1,
|
|
173
|
+
let start = -1,
|
|
174
|
+
end = -1;
|
|
135
175
|
let index = startIndex;
|
|
136
176
|
|
|
137
177
|
//forward
|
|
@@ -180,9 +220,15 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
180
220
|
i.pathHistory.bottom = -1;
|
|
181
221
|
}
|
|
182
222
|
|
|
183
|
-
public updateItemSize(
|
|
223
|
+
public updateItemSize(
|
|
224
|
+
index: number,
|
|
225
|
+
newSize: { width: number; height: number }
|
|
226
|
+
): void {
|
|
184
227
|
const item = this.templateList[index];
|
|
185
|
-
if (
|
|
228
|
+
if (
|
|
229
|
+
!item ||
|
|
230
|
+
(item.width == newSize.width && item.height == newSize.height)
|
|
231
|
+
) {
|
|
186
232
|
return;
|
|
187
233
|
}
|
|
188
234
|
const needChangeList = this.templateList.splice(index);
|
|
@@ -204,9 +250,37 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
204
250
|
width: i.width,
|
|
205
251
|
height: i.height,
|
|
206
252
|
frameCount: getCurFrameCount(),
|
|
207
|
-
})
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
public removeItemTo(index: number): void {
|
|
258
|
+
if (index < 0 || index >= this.templateList.length) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
this.templateList.splice(index);
|
|
262
|
+
const lastItem = this.templateList[this.templateList.length - 1];
|
|
263
|
+
if (this.direction === VERTICAL) {
|
|
264
|
+
lastItem.neighborIndexList.bottom = [];
|
|
265
|
+
lastItem.tmpNeighborIndexList.bottom = [];
|
|
266
|
+
lastItem.pathHistory.bottom = -1;
|
|
267
|
+
} else {
|
|
268
|
+
lastItem.neighborIndexList.right = [];
|
|
269
|
+
lastItem.tmpNeighborIndexList.right = [];
|
|
270
|
+
lastItem.pathHistory.right = -1;
|
|
271
|
+
}
|
|
272
|
+
for (let i = this.idsMap.length - 1; i >= 0; --i) {
|
|
273
|
+
if (this.idsMap[i] >= index) {
|
|
274
|
+
this.idsMap.splice(i, 1);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
this.tailItemIndex = this.templateList.length - 1;
|
|
278
|
+
for (let uid in this.uidMap) {
|
|
279
|
+
if ((this.uidMap as any)[uid].index >= index) {
|
|
280
|
+
delete (this.uidMap as any)[uid];
|
|
281
|
+
}
|
|
208
282
|
}
|
|
209
283
|
}
|
|
210
284
|
}
|
|
211
285
|
|
|
212
|
-
export { ListMetroTemplate };
|
|
286
|
+
export { ListMetroTemplate };
|
|
@@ -123,7 +123,7 @@ const measureObjectDefine = {
|
|
|
123
123
|
},
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
interface NeighborInfo {
|
|
126
|
+
export interface NeighborInfo {
|
|
127
127
|
left: Array<number>,
|
|
128
128
|
top: Array<number>,
|
|
129
129
|
bottom: Array<number>,
|
|
@@ -192,8 +192,9 @@ abstract class MetroTemplate {
|
|
|
192
192
|
public readonly layoutType: string;
|
|
193
193
|
protected tailItemIndex: number = -1;
|
|
194
194
|
private cachedLayoutRange: Array<[number, number]> = [];
|
|
195
|
+
protected errorLogger: Function = console.error;
|
|
195
196
|
|
|
196
|
-
constructor(direction: Symbol, lineMax: number, pageSize: number, layoutType: string, supportHistoryPath: boolean) {
|
|
197
|
+
constructor(direction: Symbol, lineMax: number, pageSize: number, layoutType: string, supportHistoryPath: boolean, errorLogger: Function) {
|
|
197
198
|
this.idsMap = [];
|
|
198
199
|
this.templateList = [];
|
|
199
200
|
this.direction = direction;
|
|
@@ -202,6 +203,9 @@ abstract class MetroTemplate {
|
|
|
202
203
|
this.pageSize = pageSize;
|
|
203
204
|
this.supportHistoryPath = supportHistoryPath;
|
|
204
205
|
this.uidMap = {};
|
|
206
|
+
if (errorLogger) {
|
|
207
|
+
this.errorLogger = errorLogger;
|
|
208
|
+
}
|
|
205
209
|
}
|
|
206
210
|
|
|
207
211
|
get size(): number {
|
|
@@ -311,9 +315,10 @@ abstract class MetroTemplate {
|
|
|
311
315
|
return this.tailItemIndex;
|
|
312
316
|
}
|
|
313
317
|
|
|
314
|
-
protected
|
|
318
|
+
protected getTemplateItem(itemObj: MeasureInfo): TemplateItem {
|
|
315
319
|
const valid = this.checkMeasureObject(itemObj);
|
|
316
320
|
if (!valid) {
|
|
321
|
+
this.errorLogger(TAG, "check measure object failed.");
|
|
317
322
|
throw new Error("check measure object failed.");
|
|
318
323
|
}
|
|
319
324
|
|
|
@@ -356,10 +361,10 @@ abstract class MetroTemplate {
|
|
|
356
361
|
}
|
|
357
362
|
}
|
|
358
363
|
|
|
359
|
-
private
|
|
364
|
+
private checkMeasureObject(obj: object): boolean {
|
|
360
365
|
let result = true;
|
|
361
366
|
const errorLog = (errorInfo: any) => {
|
|
362
|
-
|
|
367
|
+
this.errorLogger(TAG, "measure obj check error: ", errorInfo, ". raw object", obj);
|
|
363
368
|
}
|
|
364
369
|
for (let key in measureObjectDefine) {
|
|
365
370
|
const defineInfo = (measureObjectDefine as any)[key];
|
|
@@ -383,6 +388,8 @@ abstract class MetroTemplate {
|
|
|
383
388
|
}
|
|
384
389
|
return result;
|
|
385
390
|
}
|
|
391
|
+
|
|
392
|
+
public abstract removeItemTo(index: number): void;
|
|
386
393
|
}
|
|
387
394
|
|
|
388
395
|
export {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { MetroTemplate, TemplateItem, MeasureInfo } from "./MetroTemplate";
|
|
3
2
|
import { HORIZONTAL } from "../WidgetCommon";
|
|
4
3
|
import { METRO_WIDGET_CONST } from "../MetroWidget/Const";
|
|
@@ -13,6 +12,7 @@ class TemplateItemAdder {
|
|
|
13
12
|
private _Key: string;
|
|
14
13
|
private _ID: number;
|
|
15
14
|
private _OnAddDone: Function | null;
|
|
15
|
+
private _ErrorLogger: Function = console.error;
|
|
16
16
|
|
|
17
17
|
constructor(
|
|
18
18
|
template_parser: MetroTemplate,
|
|
@@ -22,6 +22,7 @@ class TemplateItemAdder {
|
|
|
22
22
|
side_effect: Function,
|
|
23
23
|
id: number,
|
|
24
24
|
onAddDone: Function | null = null,
|
|
25
|
+
errorLogger: Function | null
|
|
25
26
|
) {
|
|
26
27
|
this._MetroTemplate = template_parser;
|
|
27
28
|
this._Data = data;
|
|
@@ -31,11 +32,11 @@ class TemplateItemAdder {
|
|
|
31
32
|
this._CurPage = 0;
|
|
32
33
|
this._SideEffect = side_effect;
|
|
33
34
|
this._OnAddDone = onAddDone;
|
|
34
|
-
this._Key =
|
|
35
|
-
this._MetroTemplate.direction === HORIZONTAL
|
|
36
|
-
? "left"
|
|
37
|
-
: "top";
|
|
35
|
+
this._Key = this._MetroTemplate.direction === HORIZONTAL ? "left" : "top";
|
|
38
36
|
this._ID = id;
|
|
37
|
+
if (errorLogger) {
|
|
38
|
+
this._ErrorLogger = errorLogger;
|
|
39
|
+
}
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
private addDataToTemplate(data: Array<object>, index: number) {
|
|
@@ -44,9 +45,12 @@ class TemplateItemAdder {
|
|
|
44
45
|
|
|
45
46
|
//过期属性警告
|
|
46
47
|
if (typeof measureObj.doSlide !== "undefined") {
|
|
47
|
-
measureObj.itemSlide = measureObj.doSlide
|
|
48
|
-
METRO_WIDGET_CONST.ITEM_SLIDE.ACT_ITEM_FOCUS
|
|
49
|
-
|
|
48
|
+
measureObj.itemSlide = measureObj.doSlide
|
|
49
|
+
? METRO_WIDGET_CONST.ITEM_SLIDE.ACT_ITEM_FOCUS
|
|
50
|
+
: METRO_WIDGET_CONST.ITEM_SLIDE.ACT_FOCUS_RECT_EVENT;
|
|
51
|
+
console.warn(
|
|
52
|
+
"MetroWidget: doSlide will be deprecated soon. use itemSlide instead."
|
|
53
|
+
);
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
let templateItem = this._MetroTemplate.addItem(measureObj);
|
|
@@ -54,8 +58,14 @@ class TemplateItemAdder {
|
|
|
54
58
|
return { templateObj: templateItem, measureObj: measureObj };
|
|
55
59
|
}
|
|
56
60
|
|
|
57
|
-
public tryAddItem(
|
|
58
|
-
|
|
61
|
+
public tryAddItem(
|
|
62
|
+
cur_item: TemplateItem | null = null,
|
|
63
|
+
page_num: number = 1,
|
|
64
|
+
onAddDone?: Function
|
|
65
|
+
) {
|
|
66
|
+
if (!this._Data || this._Data.length <= 0) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
59
69
|
|
|
60
70
|
let added = false;
|
|
61
71
|
if (
|
|
@@ -65,14 +75,20 @@ class TemplateItemAdder {
|
|
|
65
75
|
) {
|
|
66
76
|
while (this._CurIndex < this._Data.length) {
|
|
67
77
|
try {
|
|
68
|
-
let { templateObj } = this.addDataToTemplate(
|
|
78
|
+
let { templateObj } = this.addDataToTemplate(
|
|
79
|
+
this._Data,
|
|
80
|
+
this._CurIndex
|
|
81
|
+
);
|
|
69
82
|
this._CurIndex++;
|
|
70
|
-
if (
|
|
83
|
+
if (
|
|
84
|
+
(templateObj as any)[this._Key] >=
|
|
85
|
+
(this._CurPage + page_num) * this._PageRange
|
|
86
|
+
) {
|
|
71
87
|
this._CurPage += page_num;
|
|
72
88
|
break;
|
|
73
89
|
}
|
|
74
90
|
} catch (e) {
|
|
75
|
-
|
|
91
|
+
this._ErrorLogger(
|
|
76
92
|
`MetroWidget: ${this._ID} parse template item ${this._CurIndex} failed. data: `,
|
|
77
93
|
this._Data
|
|
78
94
|
);
|
|
@@ -82,35 +98,48 @@ class TemplateItemAdder {
|
|
|
82
98
|
this._MetroTemplate.calculateNeighborWhenAddStop();
|
|
83
99
|
added = true;
|
|
84
100
|
}
|
|
85
|
-
|
|
101
|
+
if (onAddDone) {
|
|
102
|
+
onAddDone()
|
|
103
|
+
} else {
|
|
104
|
+
this._OnAddDone?.();
|
|
105
|
+
}
|
|
86
106
|
// 添加完成需要计算neighbor
|
|
87
107
|
return added;
|
|
88
108
|
}
|
|
89
109
|
|
|
90
|
-
tryAddItemByPosition(position: number) {
|
|
91
|
-
if (!this._Data || this._Data.length <= 0) {
|
|
110
|
+
tryAddItemByPosition(position: number, onAddDone?: Function) {
|
|
111
|
+
if (!this._Data || this._Data.length <= 0) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
92
114
|
|
|
93
115
|
const page_num = Math.ceil(position / this._PageRange + 1);
|
|
94
116
|
if (page_num > this._CurPage) {
|
|
95
|
-
this.tryAddItem(null, page_num - this._CurPage);
|
|
117
|
+
this.tryAddItem(null, page_num - this._CurPage, onAddDone);
|
|
96
118
|
}
|
|
97
|
-
this._OnAddDone?.();
|
|
98
119
|
}
|
|
99
120
|
|
|
100
|
-
tryAddItemByIndex(index: number) {
|
|
101
|
-
if (!this._Data || this._Data.length <= 0) {
|
|
121
|
+
tryAddItemByIndex(index: number, onAddDone?: Function) {
|
|
122
|
+
if (!this._Data || this._Data.length <= 0) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
102
125
|
let _index = Math.min(index, this._Data.length - 1);
|
|
103
126
|
let added = false;
|
|
104
127
|
while (this._CurIndex <= _index) {
|
|
105
128
|
added = true;
|
|
106
129
|
try {
|
|
107
|
-
let { templateObj } = this.addDataToTemplate(
|
|
130
|
+
let { templateObj } = this.addDataToTemplate(
|
|
131
|
+
this._Data,
|
|
132
|
+
this._CurIndex
|
|
133
|
+
);
|
|
108
134
|
this._CurIndex++;
|
|
109
|
-
if (
|
|
135
|
+
if (
|
|
136
|
+
(templateObj as any)[this._Key] >=
|
|
137
|
+
(this._CurPage + 1) * this._PageRange
|
|
138
|
+
) {
|
|
110
139
|
this._CurPage++;
|
|
111
140
|
}
|
|
112
141
|
} catch (e) {
|
|
113
|
-
|
|
142
|
+
this._ErrorLogger(
|
|
114
143
|
`MetroWidget: ${this._ID} parse template item ${this._CurIndex} failed. data:`,
|
|
115
144
|
this._Data
|
|
116
145
|
);
|
|
@@ -121,12 +150,13 @@ class TemplateItemAdder {
|
|
|
121
150
|
this._MetroTemplate.calculateNeighborWhenAddStop();
|
|
122
151
|
}
|
|
123
152
|
//再添加一屏
|
|
124
|
-
this.tryAddItem(this._MetroTemplate.getItemByIndex(index), 2);
|
|
125
|
-
this._OnAddDone?.();
|
|
153
|
+
this.tryAddItem(this._MetroTemplate.getItemByIndex(index), 2, onAddDone);
|
|
126
154
|
}
|
|
127
155
|
|
|
128
|
-
tryAddItemById(id: number) {
|
|
129
|
-
if (!this._Data || this._Data.length <= 0) {
|
|
156
|
+
tryAddItemById(id: number, onAddDone?: Function) {
|
|
157
|
+
if (!this._Data || this._Data.length <= 0) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
130
160
|
let _id = Math.min(id, this._Data.length - 1); // id小于等于index, 因此为了避免过界取小值
|
|
131
161
|
const last_id = this._MetroTemplate.focusableSize - 1;
|
|
132
162
|
if (last_id < _id) {
|
|
@@ -135,14 +165,20 @@ class TemplateItemAdder {
|
|
|
135
165
|
while (cur_id < _id && this._CurIndex < this._Data.length) {
|
|
136
166
|
added = true;
|
|
137
167
|
try {
|
|
138
|
-
let { templateObj } = this.addDataToTemplate(
|
|
168
|
+
let { templateObj } = this.addDataToTemplate(
|
|
169
|
+
this._Data,
|
|
170
|
+
this._CurIndex
|
|
171
|
+
);
|
|
139
172
|
cur_id = templateObj.id;
|
|
140
|
-
if (
|
|
173
|
+
if (
|
|
174
|
+
(templateObj as any)[this._Key] >=
|
|
175
|
+
(this._CurPage + 1) * this._PageRange
|
|
176
|
+
) {
|
|
141
177
|
this._CurPage++;
|
|
142
178
|
}
|
|
143
179
|
this._CurIndex++;
|
|
144
180
|
} catch (e) {
|
|
145
|
-
|
|
181
|
+
this._ErrorLogger(
|
|
146
182
|
`MetroWidget: ${this._ID} parse template item ${this._CurIndex} failed. data:`,
|
|
147
183
|
this._Data
|
|
148
184
|
);
|
|
@@ -154,12 +190,13 @@ class TemplateItemAdder {
|
|
|
154
190
|
}
|
|
155
191
|
}
|
|
156
192
|
//再添加一屏
|
|
157
|
-
this.tryAddItem(this._MetroTemplate.getItemById(id), 2);
|
|
158
|
-
this._OnAddDone?.();
|
|
193
|
+
this.tryAddItem(this._MetroTemplate.getItemById(id), 2, onAddDone);
|
|
159
194
|
}
|
|
160
195
|
|
|
161
|
-
tryAddItemByUid(uid: string) {
|
|
162
|
-
if (!this._Data || this._Data.length <= 0) {
|
|
196
|
+
tryAddItemByUid(uid: string, onAddDone?: Function) {
|
|
197
|
+
if (!this._Data || this._Data.length <= 0) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
163
200
|
if (this._MetroTemplate.getItemByUid(uid)) {
|
|
164
201
|
//已经添加
|
|
165
202
|
return;
|
|
@@ -169,16 +206,22 @@ class TemplateItemAdder {
|
|
|
169
206
|
while (!targetItem && this._CurIndex < this._Data.length) {
|
|
170
207
|
added = true;
|
|
171
208
|
try {
|
|
172
|
-
let { templateObj, measureObj } = this.addDataToTemplate(
|
|
209
|
+
let { templateObj, measureObj } = this.addDataToTemplate(
|
|
210
|
+
this._Data,
|
|
211
|
+
this._CurIndex
|
|
212
|
+
);
|
|
173
213
|
if (measureObj.uid == uid) {
|
|
174
214
|
targetItem = templateObj;
|
|
175
215
|
}
|
|
176
216
|
this._CurIndex++;
|
|
177
|
-
if (
|
|
217
|
+
if (
|
|
218
|
+
(templateObj as any)[this._Key] >=
|
|
219
|
+
(this._CurPage + 1) * this._PageRange
|
|
220
|
+
) {
|
|
178
221
|
this._CurPage++;
|
|
179
222
|
}
|
|
180
223
|
} catch (e) {
|
|
181
|
-
|
|
224
|
+
this._ErrorLogger(
|
|
182
225
|
`MetroWidget: ${this._ID} parse template item ${this._CurIndex} failed. data:`,
|
|
183
226
|
this._Data
|
|
184
227
|
);
|
|
@@ -189,15 +232,40 @@ class TemplateItemAdder {
|
|
|
189
232
|
this._MetroTemplate.calculateNeighborWhenAddStop();
|
|
190
233
|
}
|
|
191
234
|
if (targetItem) {
|
|
192
|
-
this.tryAddItem(targetItem, 2);
|
|
235
|
+
this.tryAddItem(targetItem, 2, onAddDone);
|
|
236
|
+
} else {
|
|
237
|
+
if (onAddDone) {
|
|
238
|
+
onAddDone()
|
|
239
|
+
} else {
|
|
240
|
+
this._OnAddDone?.();
|
|
241
|
+
}
|
|
193
242
|
}
|
|
194
243
|
}
|
|
195
244
|
|
|
196
245
|
updateData(data: Array<object>) {
|
|
197
246
|
this._Data = data;
|
|
198
247
|
}
|
|
248
|
+
|
|
249
|
+
removeItemTo(index: number) {
|
|
250
|
+
if (index < 0 || index >= this._Data.length) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
this._Data.splice(index);
|
|
254
|
+
if (index >= this._CurIndex) {
|
|
255
|
+
//还未添加到模板中,只更新data即可
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
this._MetroTemplate.removeItemTo(index);
|
|
259
|
+
this._CurIndex = index;
|
|
260
|
+
const lastItem = this._MetroTemplate.getItemByIndex(-1);
|
|
261
|
+
if (lastItem) {
|
|
262
|
+
this._CurPage = Math.floor(
|
|
263
|
+
(this._MetroTemplate.direction === HORIZONTAL
|
|
264
|
+
? lastItem.left + lastItem.width
|
|
265
|
+
: lastItem.top + lastItem.height) / this._PageRange
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
199
269
|
}
|
|
200
270
|
|
|
201
|
-
export {
|
|
202
|
-
TemplateItemAdder,
|
|
203
|
-
}
|
|
271
|
+
export { TemplateItemAdder };
|
|
@@ -154,22 +154,32 @@ export class WholePageSlide extends SlideSetting {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
157
|
+
* 无缝滚动的设置类
|
|
158
158
|
*
|
|
159
159
|
* @public
|
|
160
160
|
* @constructor SeamlessSlide
|
|
161
161
|
* @extends SlideSetting
|
|
162
162
|
* @param {Object} settings 设置,结构为{
|
|
163
163
|
* startPercent: 左/上侧触发滚动的比例 0-1
|
|
164
|
-
*
|
|
164
|
+
* endPercent: 右/下侧触发滚动的比例 0-1, 从起点计数, 末尾为1.0
|
|
165
165
|
* headRange: 左/上按键触发滚动的区域比例 0-1
|
|
166
|
-
* tailRange: 右/下按键触发滚动的区域比例 0-1
|
|
166
|
+
* tailRange: 右/下按键触发滚动的区域比例 0-1, 从终点计数,末尾为0
|
|
167
|
+
* startPercent/endPercent 和 headRange/tailRange 二选一
|
|
167
168
|
* headSafeArea: 保证头部item完整显示的安全区域大小
|
|
168
169
|
* tailSafeArea: 保证尾部item完整显示的安全区域大小
|
|
169
|
-
* speed:
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
170
|
+
* speed: 像素/毫秒, 用于计算duration的辅助值, 因为MetroWidget每个行间可能距离不一样,
|
|
171
|
+
* 使用时根据speed, 按匀速反算duration
|
|
172
|
+
* duration: 动画时长(毫秒)。当 duration 为 number 时优先于 speed;
|
|
173
|
+
* 若为 null/不传则按 speed 计算时长
|
|
174
|
+
* easing(String): 滚动动画的easing,可不填(实现中默认为空字符串);
|
|
175
|
+
* 非匀速时推荐为 "cubic-bezier(X, X, X, X)"
|
|
176
|
+
* boundaryProtect: 确定滚动位置能否小于0或者大于最大长度,默认值为 START_PROTECT | END_PROTECT,即都开启
|
|
177
|
+
* START_PROTECT: 是否要让头部卡在边缘而不是滚动到 headRange 的位置
|
|
178
|
+
* END_PROTECT: 是否要让尾部卡在边缘而不是滚动到 tailRange 的位置
|
|
179
|
+
* 若不开启,则 slide 出来的项目可能不是完整的项目,而是以焦点元素的边缘对齐 range(head 或 tail)的百分比位置;
|
|
180
|
+
* 对齐策略为:往 head 滑动时,用起始边缘对准 headRange,往 tail 滑动时,用起始边缘对准 tailRange
|
|
181
|
+
* fixFirstPage: 默认为false, 代表第一屏不滚动, 当到第一屏边缘开始才按照正常的无缝滚动逻辑滚动,
|
|
182
|
+
若回到第一屏区域时则会把第一屏完整的滚动回来
|
|
173
183
|
* }
|
|
174
184
|
**/
|
|
175
185
|
export class SeamlessSlide extends SlideSetting {
|
|
@@ -8,10 +8,15 @@
|
|
|
8
8
|
export * from "./WidgetCommon";
|
|
9
9
|
export * from "./MetroWidget/Dispatcher";
|
|
10
10
|
|
|
11
|
+
// SimpleWidget is deprecated, please use MetroWidget instead
|
|
11
12
|
export { default as SimpleWidget } from "./MetroWidget/MetroWidget.vue";
|
|
13
|
+
|
|
12
14
|
export { default as MetroWidget } from "./MetroWidget/MetroWidget.vue";
|
|
13
15
|
export { default as ListWidget } from "./MetroWidget/ListWidget.vue";
|
|
14
|
-
export { METRO_WIDGET, METRO_WIDGET_CONST } from "./MetroWidget/Const";
|
|
16
|
+
export { METRO_WIDGET, METRO_WIDGET_CONST, ONEDGE_TYPE } from "./MetroWidget/Const";
|
|
15
17
|
|
|
16
18
|
export { default as JsvFocusBlock } from "./JsvFocus/JsvFocusBlock.vue";
|
|
17
|
-
export { jsvCreateFocusManager, useFocusHub } from "./JsvFocus/JsvFocusManager";
|
|
19
|
+
export { jsvCreateFocusManager, useFocusHub } from "./JsvFocus/JsvFocusManager";
|
|
20
|
+
|
|
21
|
+
export { default as SpatialNavProvider } from "./SpatialNavigator/SpatialNavProvider.vue";
|
|
22
|
+
export { SPATIAL_NAV_PROVIDER_NAME } from "./SpatialNavigator/SpatialNavigator";
|