@shijiu/jsview-vue 2.1.482-test.0 → 2.2.128
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 +2 -1
- package/bin/browser/BrowserApic2.vue.mjs +2 -1
- package/bin/browser/BrowserApicLib.mjs +2 -1
- package/bin/browser/BrowserQrcode.vue.mjs +3 -1
- package/bin/browser/BrowserTextureAnim.vue.mjs +15 -7
- package/bin/jsview-vue.mjs +1734 -916
- package/bin/types/JsViewEngineWidget/CheckType.d.ts +3 -0
- package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +102 -0
- package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +88 -0
- package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusManager.d.ts +10 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/Const.d.ts +16 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/Dispatcher.d.ts +14 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +158 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +158 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +46 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +21 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +46 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/Slide.d.ts +21 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/SlotComponent.vue.d.ts +48 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/VisibleInfo.d.ts +16 -0
- package/bin/types/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +17 -0
- package/bin/types/JsViewEngineWidget/RangeModel.d.ts +162 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +37 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/Fence.d.ts +58 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +15 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +91 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +22 -0
- package/bin/types/JsViewEngineWidget/TemplateParser/index.d.ts +4 -0
- package/bin/types/JsViewEngineWidget/WidgetCommon.d.ts +143 -0
- package/bin/types/JsViewEngineWidget/index.d.ts +6 -0
- package/bin/types/JsViewPlugin/JsvAccount/JsvAccount.d.ts +42 -0
- package/bin/types/JsViewPlugin/JsvAudio/AudioProxy.d.ts +2 -0
- package/bin/types/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +18 -0
- package/bin/types/JsViewPlugin/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +208 -0
- package/bin/types/JsViewPlugin/JsvAudio/CheckType.d.ts +2 -0
- package/bin/types/JsViewPlugin/JsvAudio/Events.d.ts +13 -0
- package/bin/types/JsViewPlugin/JsvAudio/JsvAudio.vue.d.ts +18 -0
- package/bin/types/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.d.ts +8 -0
- package/bin/types/JsViewPlugin/JsvAudio/JsvAudioProxy.vue.d.ts +2 -0
- package/bin/types/JsViewPlugin/JsvAudio/PluginLoader.d.ts +1 -0
- package/bin/types/JsViewPlugin/JsvAudio/ScreenLockManager.d.ts +5 -0
- package/bin/types/JsViewPlugin/JsvAudio/index.d.ts +3 -0
- package/bin/types/JsViewPlugin/JsvAudio/version.d.ts +10 -0
- package/bin/types/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +1 -0
- package/bin/types/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue.d.ts +13 -0
- package/bin/types/JsViewPlugin/JsvLatex/Color.d.ts +1 -0
- package/bin/types/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +17 -0
- package/bin/types/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +3 -0
- package/bin/types/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +2 -0
- package/bin/types/JsViewPlugin/JsvLatex/PluginLoader.d.ts +1 -0
- package/bin/types/JsViewPlugin/JsvLatex/index.d.ts +3 -0
- package/bin/types/JsViewPlugin/JsvLatex/version.d.ts +10 -0
- package/bin/types/JsViewPlugin/index.d.ts +3 -0
- package/bin/types/JsViewVueTools/ConstSymbol.d.ts +2 -0
- package/bin/types/JsViewVueTools/DebugContentShellJBridge.d.ts +6 -0
- package/bin/types/JsViewVueTools/DebugTool.d.ts +8 -0
- package/bin/types/JsViewVueTools/DefaultKeyMap.d.ts +10 -0
- package/bin/types/JsViewVueTools/ForgeConstDefine.d.ts +11 -0
- package/bin/types/JsViewVueTools/ForgeHandles.d.ts +6 -0
- package/bin/types/JsViewVueTools/JsvDemoTester.d.ts +2 -0
- package/bin/types/JsViewVueTools/JsvDynamicCssStyle.d.ts +14 -0
- package/bin/types/JsViewVueTools/JsvDynamicKeyFrames.d.ts +21 -0
- package/bin/types/JsViewVueTools/JsvHashHistory.d.ts +16 -0
- package/bin/types/JsViewVueTools/JsvImpactTracer.d.ts +40 -0
- package/bin/types/JsViewVueTools/JsvRefTaker.d.ts +27 -0
- package/bin/types/JsViewVueTools/JsvRuntimeBridge.d.ts +279 -0
- package/bin/types/JsViewVueTools/JsvStyleClass.d.ts +31 -0
- package/bin/types/JsViewVueTools/JsvStyleSheetsDeclarer.d.ts +15 -0
- package/bin/types/JsViewVueTools/JsvTextTools.d.ts +37 -0
- package/bin/types/JsViewVueTools/JsvTextureDefines.d.ts +6 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.d.ts +95 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +15 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +75 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +11 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +24 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/Store.d.ts +10 -0
- package/bin/types/JsViewVueTools/JsvTextureStore/Texture.d.ts +23 -0
- package/bin/types/JsViewVueTools/NinePatchHelper.d.ts +21 -0
- package/bin/types/JsViewVueTools/TypeCheckAndSet.d.ts +2 -0
- package/bin/types/JsViewVueTools/index.d.ts +14 -0
- package/bin/types/JsViewVueWidget/JsvActorMove/ActorControlBase.d.ts +31 -0
- package/bin/types/JsViewVueWidget/JsvActorMove/JsvActorMove.vue.d.ts +64 -0
- package/bin/types/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.d.ts +33 -0
- package/bin/types/JsViewVueWidget/JsvActorMove/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue.d.ts +15 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue.d.ts +50 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +13 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +23 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/ApicDataBase.d.ts +13 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/BrowserApicLib.d.ts +3 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/GifData.d.ts +5 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/NormalLoopTool.d.ts +7 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/PartLoopTool.d.ts +12 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/SingleLoopTool.d.ts +5 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.d.ts +19 -0
- package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/WebpData.d.ts +5 -0
- package/bin/types/{jsview-vue-common.d.mts → JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.d.ts} +12 -13
- package/bin/types/JsViewVueWidget/JsvConnectLine/ArcLineManager.d.ts +1 -0
- package/bin/types/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue.d.ts +13 -0
- package/bin/types/JsViewVueWidget/JsvConnectLine/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvEnableRenderBreak.vue.d.ts +51 -0
- package/bin/types/JsViewVueWidget/JsvFilterView.vue.d.ts +72 -0
- package/bin/types/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue.d.ts +72 -0
- package/bin/types/JsViewVueWidget/JsvFlexCell/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/ActionRefObject.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +65 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/ActorState.d.ts +6 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.d.ts +11 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.d.ts +15 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue.d.ts +78 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +84 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/NexusNode.d.ts +6 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +71 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +95 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +62 -0
- package/bin/types/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +12 -0
- package/bin/types/JsViewVueWidget/JsvGrid.vue.d.ts +168 -0
- package/bin/types/JsViewVueWidget/JsvHole.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +36 -0
- package/bin/types/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +210 -0
- package/bin/types/JsViewVueWidget/JsvInput/index.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +12 -0
- package/bin/types/JsViewVueWidget/JsvLine/LineManager.d.ts +1 -0
- package/bin/types/JsViewVueWidget/JsvLine/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvMarquee.vue.d.ts +12 -0
- package/bin/types/JsViewVueWidget/JsvMaskClipDiv.vue.d.ts +83 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/CommonType.d.ts +1 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/Constant.d.ts +9 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/DataTree.d.ts +69 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/Geometry.d.ts +68 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/JsvMindMap.vue.d.ts +145 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/index.d.ts +1 -0
- package/bin/types/JsViewVueWidget/JsvMindMap/rtree.d.ts +40 -0
- package/bin/types/JsViewVueWidget/JsvNativeSharedDiv.vue.d.ts +69 -0
- package/bin/types/JsViewVueWidget/JsvNinePatch.vue.d.ts +19 -0
- package/bin/types/JsViewVueWidget/JsvPieChart.vue.d.ts +9 -0
- package/bin/types/JsViewVueWidget/JsvPosterDiv.vue.d.ts +60 -0
- package/bin/types/JsViewVueWidget/JsvPosterImage.vue.d.ts +75 -0
- package/bin/types/JsViewVueWidget/JsvPreload/BrowserPreload.vue.d.ts +10 -0
- package/bin/types/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +25 -0
- package/bin/types/JsViewVueWidget/JsvPreload/index.d.ts +17 -0
- package/bin/types/JsViewVueWidget/JsvProgressBar.vue.d.ts +12 -0
- package/bin/types/JsViewVueWidget/JsvQrcode/BrowserQrcode.vue.d.ts +11 -0
- package/bin/types/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +60 -0
- package/bin/types/JsViewVueWidget/JsvQrcode/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvRadarChart.vue.d.ts +13 -0
- package/bin/types/JsViewVueWidget/JsvRipple/Constant.d.ts +4 -0
- package/bin/types/JsViewVueWidget/JsvRipple/JsvRipple.vue.d.ts +84 -0
- package/bin/types/JsViewVueWidget/JsvRipple/index.d.ts +3 -0
- package/bin/types/JsViewVueWidget/JsvScaleTextBox.vue.d.ts +10 -0
- package/bin/types/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +176 -0
- package/bin/types/JsViewVueWidget/JsvScrollBox/ScrollSymbol.d.ts +7 -0
- package/bin/types/JsViewVueWidget/JsvScrollBox/index.d.ts +1 -0
- package/bin/types/JsViewVueWidget/JsvSector.vue.d.ts +10 -0
- package/bin/types/JsViewVueWidget/JsvSoundPool.d.ts +84 -0
- package/bin/types/JsViewVueWidget/JsvSpray/BrowserSpray.vue.d.ts +25 -0
- package/bin/types/JsViewVueWidget/JsvSpray/JsvSpray.vue.d.ts +38 -0
- package/bin/types/JsViewVueWidget/JsvSpray/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.d.ts +14 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +18 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +69 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteTools.d.ts +11 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/SpriteController.d.ts +17 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/index.d.ts +5 -0
- package/bin/types/JsViewVueWidget/JsvSpriteAnim/sAnimationToken.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvSwiper/JsvSwiper.vue.d.ts +209 -0
- package/bin/types/JsViewVueWidget/JsvSwiper/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue.d.ts +97 -0
- package/bin/types/JsViewVueWidget/JsvSwiper3D/index.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvTextBox.vue.d.ts +75 -0
- package/bin/types/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue.d.ts +151 -0
- package/bin/types/JsViewVueWidget/JsvTextureAnim/CommonType.d.ts +2 -0
- package/bin/types/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +107 -0
- package/bin/types/JsViewVueWidget/JsvTextureAnim/index.d.ts +14 -0
- package/bin/types/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +84 -0
- package/bin/types/JsViewVueWidget/JsvVisibleSensor/index.d.ts +84 -0
- package/bin/types/JsViewVueWidget/index.d.ts +38 -0
- package/bin/types/index.d.ts +4 -0
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/tools/config/tsconfig.json +6 -6
- package/tools/jsview-vue-build.mjs +13 -4
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +7 -4
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +28 -6
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +568 -369
- package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +4 -3
- package/utils/JsViewEngineWidget/MetroWidget/Slide.ts +56 -0
- package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +51 -10
- package/utils/JsViewEngineWidget/MetroWidget/TokenGenerator.ts +10 -0
- package/utils/JsViewEngineWidget/MetroWidget/VisibleInfo.ts +1 -1
- package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +21 -21
- package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +13 -7
- package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +35 -45
- package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +6 -6
- package/utils/JsViewEngineWidget/WidgetCommon.ts +34 -5
- package/utils/JsViewPlugin/JsvPlayer/BrowserJsvPlayer.vue +13 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +470 -338
- package/utils/JsViewVueTools/ConstSymbol.ts +3 -0
- package/utils/JsViewVueTools/ForgeConstDefine.ts +11 -0
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +166 -48
- package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +62 -0
- package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +41 -7
- package/utils/JsViewVueTools/JsvTextureStore/Texture.ts +15 -1
- package/utils/JsViewVueTools/index.js +2 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue +6 -6
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue +5 -6
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/ApicDataBase.js +5 -1
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ActionRefObject.ts +1 -1
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +23 -1
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorState.ts +4 -4
- package/utils/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.ts +6 -6
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.ts +1 -1
- package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +43 -9
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +24 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +58 -1
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +56 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +3 -0
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +6 -1
- package/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue +1 -1
- package/utils/JsViewVueWidget/JsvMindMap/rtree.js +1 -1
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +121 -68
- package/utils/JsViewVueWidget/JsvNinePatch.vue +4 -1
- package/utils/JsViewVueWidget/JsvPosterImage.vue +22 -9
- package/utils/JsViewVueWidget/JsvQrcode/BrowserQrcode.vue +6 -2
- package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue +309 -0
- package/utils/JsViewVueWidget/JsvScrollBox/ScrollSymbol.ts +15 -0
- package/utils/JsViewVueWidget/JsvScrollBox/index.js +2 -0
- package/utils/JsViewVueWidget/JsvTextBox.vue +24 -4
- package/utils/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue +27 -9
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +2 -0
- package/utils/JsViewVueWidget/index.js +1 -0
- package/bin/types/browser/BrowserApic.vue.d.mts +0 -33
- package/bin/types/browser/BrowserApic2.vue.d.mts +0 -16
- package/bin/types/browser/BrowserApicLib.d.mts +0 -56
- package/bin/types/browser/BrowserAudio.vue.d.mts +0 -2
- package/bin/types/browser/BrowserJsvLatex.vue.d.mts +0 -55
- package/bin/types/browser/BrowserPreload.vue.d.mts +0 -14
- package/bin/types/browser/BrowserQrcode.vue.d.mts +0 -29
- package/bin/types/browser/BrowserSpray.vue.d.mts +0 -2
- package/bin/types/browser/BrowserTextureAnim.vue.d.mts +0 -2
- package/bin/types/export-sfc.d.mts +0 -2
- package/bin/types/jsview-vue.d.mts +0 -2511
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ref, computed } from "vue";
|
|
2
2
|
import type { Ref } from "vue";
|
|
3
3
|
import { TemplateItem } from "../TemplateParser/MetroTemplate"
|
|
4
|
+
import { ForgeConst } from "../../JsViewVueTools/ForgeConstDefine";
|
|
4
5
|
|
|
5
6
|
interface RenderItemStyle {
|
|
6
7
|
zIndex: number,
|
|
@@ -89,11 +90,11 @@ export class RenderItem {
|
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
public register(name: string, callback: Function) {
|
|
92
|
-
this.customerCallbackMap[name] = callback;
|
|
93
|
+
(this.customerCallbackMap as any)[name] = callback;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
public unregister(name: string) {
|
|
96
|
-
delete this.customerCallbackMap[name];
|
|
97
|
+
delete (this.customerCallbackMap as any)[name];
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
public onFocus(rect: object): boolean {
|
|
@@ -154,7 +155,7 @@ export class RenderItem {
|
|
|
154
155
|
this.divMountedCallback.clear();
|
|
155
156
|
if (this.enableTap && this.rootDiv) {
|
|
156
157
|
const divView = (this.rootDiv as any).jsvGetProxyView();
|
|
157
|
-
divView.DragEnables?.(
|
|
158
|
+
divView.DragEnables?.(ForgeConst.DragFlags.TOUCH_RECV_CLICK_BIT); // 只激活tap
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
161
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { getCurFrameCount } from "../WidgetCommon";
|
|
2
|
+
|
|
3
|
+
export interface TargetRectInfo {
|
|
4
|
+
left: number,
|
|
5
|
+
top: number,
|
|
6
|
+
width: number,
|
|
7
|
+
height: number,
|
|
8
|
+
frameCount: number,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class RectCache {
|
|
12
|
+
private preRect: TargetRectInfo | null = null;
|
|
13
|
+
private curRect: TargetRectInfo | null = null;
|
|
14
|
+
|
|
15
|
+
public cache(rect: TargetRectInfo) {
|
|
16
|
+
if (this.curRect && this.curRect.frameCount < rect?.frameCount) {
|
|
17
|
+
this.preRect = this.curRect;
|
|
18
|
+
}
|
|
19
|
+
this.curRect = rect;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public cacheManually() {
|
|
23
|
+
if (this.curRect && this.curRect.frameCount < getCurFrameCount()) {
|
|
24
|
+
this.preRect = this.curRect;
|
|
25
|
+
this.curRect = null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public getCurRect(): TargetRectInfo | null {
|
|
30
|
+
return this.curRect ? { ...this.curRect } : null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public getPreRect(): TargetRectInfo | null {
|
|
34
|
+
return this.preRect ? { ...this.preRect } : null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public updatePre(key: "left" | "top" | "width" | "height", value: number) {
|
|
38
|
+
if (this.preRect) {
|
|
39
|
+
let p = this.preRect[key];
|
|
40
|
+
this.preRect[key] = value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public clean() {
|
|
45
|
+
this.preRect = null;
|
|
46
|
+
this.curRect = null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const getDirectionByRect = (curRect: TargetRectInfo, preRect: TargetRectInfo) => {
|
|
51
|
+
if (!preRect || !curRect) return { horizontal: 0, vertical: 0 };
|
|
52
|
+
return {
|
|
53
|
+
horizontal: curRect.left < preRect.left ? -1 : (curRect.left > preRect.left ? 1 : 0),
|
|
54
|
+
vertical: curRect.top < preRect.top ? -1 : (curRect.top > preRect.top ? 1 : 0),
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -107,7 +107,7 @@ export type TaskRunner = () => CancelFunc;
|
|
|
107
107
|
class CancellableRunner {
|
|
108
108
|
private cancelHandler: CancelFunc | null = null;
|
|
109
109
|
private runner: TaskRunner | null = null;
|
|
110
|
-
constructor(r: TaskRunner) {
|
|
110
|
+
constructor(r: TaskRunner) {
|
|
111
111
|
this.runner = r;
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -126,29 +126,55 @@ class CancellableRunner {
|
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
export enum TaskType {
|
|
129
|
-
RESIZE_ITEM,
|
|
129
|
+
RESIZE_ITEM = 1,
|
|
130
130
|
SLIDE,
|
|
131
131
|
ON_FOCUS_CHANGE,
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
export enum SlideTaskType {
|
|
135
|
+
SLIDE_BY_POS = 1,
|
|
136
|
+
SLIDE_BY_ITEM,
|
|
137
|
+
SLIDE_BY_DIV,
|
|
138
|
+
SLIDE_BY_RECT,
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
type SubType = SlideTaskType | null;
|
|
142
|
+
|
|
134
143
|
interface Task {
|
|
135
144
|
frameCount: number,
|
|
136
145
|
type: TaskType,
|
|
146
|
+
subType: SubType,
|
|
137
147
|
params: any,
|
|
138
148
|
}
|
|
139
149
|
|
|
140
|
-
export
|
|
141
|
-
|
|
150
|
+
export interface AllTaskList {
|
|
151
|
+
slide: Array<Task>,
|
|
152
|
+
focus: Array<Task>,
|
|
153
|
+
resize: Array<Task>,
|
|
154
|
+
}
|
|
155
|
+
export type AddTaskCallback = (taskList: AllTaskList) => void;
|
|
142
156
|
export class TaskManager {
|
|
143
157
|
private frameCount: number = -1;
|
|
144
|
-
private widgetTaskCacheList: Array<Task> = [];
|
|
145
158
|
private cancellableRunnerList: Array<CancellableRunner> = [];
|
|
146
159
|
|
|
160
|
+
//三类task: 1.slide, 2.resize, 3.focus
|
|
161
|
+
private allTaskList: AllTaskList = {
|
|
162
|
+
slide: [],
|
|
163
|
+
focus: [],
|
|
164
|
+
resize: [],
|
|
165
|
+
}
|
|
166
|
+
|
|
147
167
|
constructor(private onAddTask: AddTaskCallback) { }
|
|
148
168
|
|
|
149
|
-
|
|
169
|
+
private cleanTaskCache(): void {
|
|
170
|
+
this.allTaskList.slide = [];
|
|
171
|
+
this.allTaskList.focus = [];
|
|
172
|
+
this.allTaskList.resize = [];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
public addTask(type: TaskType, params: any, subtype: SubType = null) {
|
|
150
176
|
if (this.frameCount != Forge.sFrameCount.count) {
|
|
151
|
-
this.
|
|
177
|
+
this.cleanTaskCache();
|
|
152
178
|
this.cancellableRunnerList = [];
|
|
153
179
|
this.frameCount = Forge.sFrameCount.count;
|
|
154
180
|
}
|
|
@@ -157,12 +183,27 @@ export class TaskManager {
|
|
|
157
183
|
t.cancel();
|
|
158
184
|
});
|
|
159
185
|
|
|
160
|
-
|
|
186
|
+
const tObj = {
|
|
161
187
|
type,
|
|
188
|
+
subType: subtype,
|
|
162
189
|
params,
|
|
163
190
|
frameCount: Forge.sFrameCount.count,
|
|
164
|
-
}
|
|
165
|
-
|
|
191
|
+
}
|
|
192
|
+
switch (type) {
|
|
193
|
+
case TaskType.SLIDE:
|
|
194
|
+
this.allTaskList.slide.push(tObj)
|
|
195
|
+
break;
|
|
196
|
+
case TaskType.ON_FOCUS_CHANGE:
|
|
197
|
+
this.allTaskList.focus.push(tObj)
|
|
198
|
+
break;
|
|
199
|
+
case TaskType.RESIZE_ITEM:
|
|
200
|
+
this.allTaskList.resize.push(tObj)
|
|
201
|
+
break;
|
|
202
|
+
default:
|
|
203
|
+
console.error("undefined type")
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
this.onAddTask(this.allTaskList);
|
|
166
207
|
}
|
|
167
208
|
|
|
168
209
|
public run(func: TaskRunner) {
|
|
@@ -186,23 +186,23 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
186
186
|
|
|
187
187
|
private _FindFocusableNeighbor(direction: string, item: TemplateItem) {
|
|
188
188
|
if (
|
|
189
|
-
item.neighborIndexList[direction].length > 0 &&
|
|
190
|
-
!this._CheckIdsHasFocusable(item.neighborIndexList[direction])
|
|
189
|
+
(item.neighborIndexList as any)[direction].length > 0 &&
|
|
190
|
+
!this._CheckIdsHasFocusable((item.neighborIndexList as any)[direction])
|
|
191
191
|
) {
|
|
192
192
|
const lastItemId =
|
|
193
|
-
item.neighborIndexList[direction][
|
|
194
|
-
item.neighborIndexList[direction].length - 1
|
|
193
|
+
(item.neighborIndexList as any)[direction][
|
|
194
|
+
(item.neighborIndexList as any)[direction].length - 1
|
|
195
195
|
];
|
|
196
196
|
const idx = this._GetValidNeighborIndex(item.id, lastItemId, direction); // 查找其左右邻居
|
|
197
197
|
if (idx !== -1) {
|
|
198
|
-
item.neighborIndexList[direction] = []; // 清除无效项
|
|
199
|
-
item.neighborIndexList[direction].push(idx);
|
|
198
|
+
(item.neighborIndexList as any)[direction] = []; // 清除无效项
|
|
199
|
+
(item.neighborIndexList as any)[direction].push(idx);
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
public addItemInner(itemObj: MeasureInfo): TemplateItem {
|
|
205
|
-
const templateItem = MetroTemplate.getTemplateItem(itemObj);
|
|
205
|
+
const templateItem: any = MetroTemplate.getTemplateItem(itemObj);
|
|
206
206
|
// Layout template items
|
|
207
207
|
const fenceStack = this._FenceStack;
|
|
208
208
|
const itemWidth = templateItem.width;
|
|
@@ -292,7 +292,7 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
292
292
|
sizeKey = "height";
|
|
293
293
|
}
|
|
294
294
|
const curPageStart =
|
|
295
|
-
this.templateList[curPageHeadIndex][positionKey];
|
|
295
|
+
(this.templateList as any)[curPageHeadIndex][positionKey];
|
|
296
296
|
if (
|
|
297
297
|
templateItem[positionKey] + templateItem[sizeKey] >
|
|
298
298
|
curPageStart + this.pageSize
|
|
@@ -465,8 +465,8 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
465
465
|
|
|
466
466
|
|
|
467
467
|
private getNextItemInner(index: number, offset: number,
|
|
468
|
-
vertical: boolean, useHistory: boolean, checkAnchor: number = -1) {
|
|
469
|
-
const templateList = this.templateList;
|
|
468
|
+
vertical: boolean, useHistory: boolean, checkAnchor: number = -1): any {
|
|
469
|
+
const templateList: any = this.templateList;
|
|
470
470
|
const baseItem = templateList[index];
|
|
471
471
|
if (checkAnchor < 0) {
|
|
472
472
|
// let checkAnchor = -1;
|
|
@@ -645,8 +645,8 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
645
645
|
);
|
|
646
646
|
}
|
|
647
647
|
|
|
648
|
-
private _GetTotalNeighbor(index: number, direction: string) {
|
|
649
|
-
const item = this.templateList[index];
|
|
648
|
+
private _GetTotalNeighbor(index: number, direction: string): any {
|
|
649
|
+
const item: any = this.templateList[index];
|
|
650
650
|
return item.neighborIndexList[direction].concat(
|
|
651
651
|
item.tmpNeighborIndexList[direction]
|
|
652
652
|
);
|
|
@@ -666,7 +666,7 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
666
666
|
return nearestIndex;
|
|
667
667
|
}
|
|
668
668
|
|
|
669
|
-
private _GetNextLoopItem(index: number, offset: number, isVertical: boolean) {
|
|
669
|
+
private _GetNextLoopItem(index: number, offset: number, isVertical: boolean): TemplateItem | null {
|
|
670
670
|
const templateList = this.templateList;
|
|
671
671
|
const baseItem = templateList[index];
|
|
672
672
|
let searchDirection = isVertical ? "right" : "bottom";
|
|
@@ -953,7 +953,7 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
953
953
|
}
|
|
954
954
|
|
|
955
955
|
// 查找与交叉项上下左右最近的各项目,做交叉
|
|
956
|
-
const neighbor = this._FindNearestNeighbor(crossItem);
|
|
956
|
+
const neighbor: any = this._FindNearestNeighbor(crossItem);
|
|
957
957
|
// console.log(
|
|
958
958
|
// "%c cchtest find nearest neighbor",
|
|
959
959
|
// "color:red;",
|
|
@@ -1005,8 +1005,8 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
1005
1005
|
console.log(`_IfBlockedByOtherNeighbor unknown direction:${direction}`);
|
|
1006
1006
|
break;
|
|
1007
1007
|
}
|
|
1008
|
-
const crossTemplateItem = this.getItemByIndex(crossItem.index);
|
|
1009
|
-
const targetTemplateItem = this.getItemByIndex(targetItem.index);
|
|
1008
|
+
const crossTemplateItem: any = this.getItemByIndex(crossItem.index);
|
|
1009
|
+
const targetTemplateItem: any = this.getItemByIndex(targetItem.index);
|
|
1010
1010
|
|
|
1011
1011
|
let valid = true;
|
|
1012
1012
|
if (crossTemplateItem && targetTemplateItem) {
|
|
@@ -1015,7 +1015,7 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
1015
1015
|
const targetStart = targetTemplateItem[positionKey];
|
|
1016
1016
|
const targetEnd = targetStart + targetTemplateItem[sizeKey] - 1;
|
|
1017
1017
|
for (let i = crossNeighborList.length - 1; i >= 0; i--) {
|
|
1018
|
-
const item = this.getItemByIndex(crossNeighborList[i]);
|
|
1018
|
+
const item: any = this.getItemByIndex(crossNeighborList[i]);
|
|
1019
1019
|
|
|
1020
1020
|
if (item == null) continue;
|
|
1021
1021
|
|
|
@@ -1046,8 +1046,8 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
|
|
1048
1048
|
private _CheckNeighborItemMatching(direction: string, crossItem: EdgeInfo, targetItem: EdgeInfo) {
|
|
1049
|
-
const crossEdgeObj = crossItem.edgeObj;
|
|
1050
|
-
const targetEdgeObj = targetItem.edgeObj;
|
|
1049
|
+
const crossEdgeObj: any = crossItem.edgeObj;
|
|
1050
|
+
const targetEdgeObj: any = targetItem.edgeObj;
|
|
1051
1051
|
let targetEdgeName = "rightEdge";
|
|
1052
1052
|
let crossEdgeName = "leftEdge";
|
|
1053
1053
|
switch (direction) {
|
|
@@ -1255,7 +1255,7 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
|
|
1257
1257
|
private _TryUpdateItemNeighbor(tmpNeighbor: boolean, direction: string, crossItem: EdgeInfo, targetItem: EdgeInfo) {
|
|
1258
|
-
const keyMap = {
|
|
1258
|
+
const keyMap: any = {
|
|
1259
1259
|
target: {
|
|
1260
1260
|
left: "right",
|
|
1261
1261
|
right: "left",
|
|
@@ -1277,7 +1277,7 @@ class CommonMetroTemplate extends MetroTemplate {
|
|
|
1277
1277
|
|
|
1278
1278
|
const targetIndex = targetItem.index;
|
|
1279
1279
|
const crossItemIndex = crossItem.index;
|
|
1280
|
-
const templateList = this.templateList;
|
|
1280
|
+
const templateList: any = this.templateList;
|
|
1281
1281
|
if (this._IfBlockedByOtherNeighbor(direction, crossItem, targetItem)) {
|
|
1282
1282
|
if (!tmpNeighbor) {
|
|
1283
1283
|
this._CheckNeighborItemMatching(direction, crossItem, targetItem);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MetroTemplate, TemplateItem, MeasureInfo } from "./MetroTemplate"
|
|
2
|
-
import { VERTICAL, HORIZONTAL, FocusMoveType } from "../WidgetCommon";
|
|
2
|
+
import { VERTICAL, HORIZONTAL, FocusMoveType, getCurFrameCount } from "../WidgetCommon";
|
|
3
3
|
|
|
4
4
|
const TAG = "ListMetroTemplate";
|
|
5
5
|
|
|
@@ -20,7 +20,7 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
20
20
|
|
|
21
21
|
private _addTemplateItem(templateItem: TemplateItem): void {
|
|
22
22
|
let sizeKey = this.direction == VERTICAL ? "width" : "height";
|
|
23
|
-
if (templateItem[sizeKey] > this.lineMax) {
|
|
23
|
+
if ((templateItem as any)[sizeKey] > this.lineMax) {
|
|
24
24
|
throw new Error(`item size is ${templateItem.width}x${templateItem.height}, large than lineMax ${this.lineMax}`);
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -64,9 +64,9 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
64
64
|
sizeKey = "height";
|
|
65
65
|
}
|
|
66
66
|
const curPageStart =
|
|
67
|
-
this.templateList[curPageHeadIndex][positionKey];
|
|
67
|
+
(this.templateList as any)[curPageHeadIndex][positionKey];
|
|
68
68
|
if (
|
|
69
|
-
templateItem[positionKey] + templateItem[sizeKey] >
|
|
69
|
+
(templateItem as any)[positionKey] + (templateItem as any)[sizeKey] >
|
|
70
70
|
curPageStart + this.pageSize
|
|
71
71
|
) {
|
|
72
72
|
//新的页
|
|
@@ -81,7 +81,7 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
81
81
|
|
|
82
82
|
public getNextItem(baseId: number, vOffset: number,
|
|
83
83
|
hOffset: number, moveType: number): TemplateItem | null {
|
|
84
|
-
const item = this.getItemById(baseId);
|
|
84
|
+
const item = this.getItemById(baseId) as any;
|
|
85
85
|
if (item) {
|
|
86
86
|
let neighborDirection: string | null = null;
|
|
87
87
|
if (this.direction == VERTICAL) {
|
|
@@ -123,8 +123,6 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
123
123
|
return [-1, -1]
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
128
126
|
let item = this.getItemById(baseId);
|
|
129
127
|
const startIndex = item ? item.index : Math.round(this.size / 2);
|
|
130
128
|
let start = -1, end = -1;
|
|
@@ -173,8 +171,16 @@ class ListMetroTemplate extends MetroTemplate {
|
|
|
173
171
|
break;
|
|
174
172
|
}
|
|
175
173
|
}
|
|
174
|
+
//TODO 不是一次性加载全部, 可视区域外的懒惰加载
|
|
176
175
|
for (let i of needChangeList) {
|
|
177
176
|
this._addTemplateItem(i);
|
|
177
|
+
i.layoutCache.cache({
|
|
178
|
+
left: i.left,
|
|
179
|
+
top: i.top,
|
|
180
|
+
width: i.width,
|
|
181
|
+
height: i.height,
|
|
182
|
+
frameCount: getCurFrameCount(),
|
|
183
|
+
})
|
|
178
184
|
}
|
|
179
185
|
}
|
|
180
186
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { checkType, toRawType, getTypeName } from "../CheckType.js";
|
|
2
2
|
import { METRO_WIDGET } from "../MetroWidget/Const";
|
|
3
|
-
import { VERTICAL } from "../WidgetCommon";
|
|
3
|
+
import { VERTICAL, getCurFrameCount } from "../WidgetCommon";
|
|
4
|
+
import { RectCache } from "../MetroWidget/Slide";
|
|
4
5
|
|
|
5
6
|
const TAG = "MetroTemplate";
|
|
6
7
|
|
|
@@ -86,7 +87,7 @@ const measureObjectDefine = {
|
|
|
86
87
|
findNextAnchor: {
|
|
87
88
|
type: [Object, null],
|
|
88
89
|
default: null,
|
|
89
|
-
validator(value, errorLogger) {
|
|
90
|
+
validator(value: any, errorLogger: any) {
|
|
90
91
|
if (value) {
|
|
91
92
|
if (!checkType(value.left, Number)) {
|
|
92
93
|
errorLogger(`findNextAnchor.left expected integer, got ${toRawType(value.left)}. value is ${value.left}`)
|
|
@@ -160,7 +161,7 @@ interface TemplateItem {
|
|
|
160
161
|
bottom: number,
|
|
161
162
|
}
|
|
162
163
|
findNextAnchor: FindNextAnchor | null,
|
|
163
|
-
layoutCache:
|
|
164
|
+
layoutCache: RectCache,
|
|
164
165
|
uid?: string,
|
|
165
166
|
}
|
|
166
167
|
|
|
@@ -253,7 +254,7 @@ abstract class MetroTemplate {
|
|
|
253
254
|
}
|
|
254
255
|
|
|
255
256
|
public getItemByUid(uid: string): TemplateItem | null {
|
|
256
|
-
return this.uidMap[uid];
|
|
257
|
+
return (this.uidMap as any)[uid];
|
|
257
258
|
}
|
|
258
259
|
|
|
259
260
|
public abstract calculateNeighborWhenAddStop(): void;
|
|
@@ -264,8 +265,16 @@ abstract class MetroTemplate {
|
|
|
264
265
|
const item = this.addItemInner(itemObj);
|
|
265
266
|
//检查uid
|
|
266
267
|
if (itemObj.uid) {
|
|
267
|
-
this.uidMap[itemObj.uid] = item;
|
|
268
|
+
(this.uidMap as any)[itemObj.uid] = item;
|
|
268
269
|
}
|
|
270
|
+
//初次缓存rect, 为resize准备
|
|
271
|
+
item.layoutCache.cache({
|
|
272
|
+
left: item.left,
|
|
273
|
+
top: item.top,
|
|
274
|
+
width: item.width,
|
|
275
|
+
height: item.height,
|
|
276
|
+
frameCount: getCurFrameCount(),
|
|
277
|
+
})
|
|
269
278
|
return item;
|
|
270
279
|
}
|
|
271
280
|
|
|
@@ -278,15 +287,22 @@ abstract class MetroTemplate {
|
|
|
278
287
|
|
|
279
288
|
public getBoundingBoxSize() {
|
|
280
289
|
const lastItem = this.templateList[this.templateList.length - 1];
|
|
281
|
-
if (
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
290
|
+
if (lastItem) {
|
|
291
|
+
if (this.direction == VERTICAL) {
|
|
292
|
+
return {
|
|
293
|
+
width: this.lineMax,
|
|
294
|
+
height: lastItem.height + lastItem.top - 1,
|
|
295
|
+
}
|
|
296
|
+
} else {
|
|
297
|
+
return {
|
|
298
|
+
height: this.lineMax,
|
|
299
|
+
width: lastItem.width + lastItem.left - 1,
|
|
300
|
+
}
|
|
285
301
|
}
|
|
286
302
|
} else {
|
|
287
303
|
return {
|
|
288
|
-
|
|
289
|
-
|
|
304
|
+
width: 0,
|
|
305
|
+
height: 0,
|
|
290
306
|
}
|
|
291
307
|
}
|
|
292
308
|
}
|
|
@@ -295,32 +311,6 @@ abstract class MetroTemplate {
|
|
|
295
311
|
return this.tailItemIndex;
|
|
296
312
|
}
|
|
297
313
|
|
|
298
|
-
public cacheLayout(start: number, end: number) {
|
|
299
|
-
if (typeof end == "undefined") {
|
|
300
|
-
end = this.templateList.length;
|
|
301
|
-
}
|
|
302
|
-
end = Math.min(end, this.templateList.length);
|
|
303
|
-
for (let i = start; i < end; ++i) {
|
|
304
|
-
let item = this.templateList[i];
|
|
305
|
-
item.layoutCache = {
|
|
306
|
-
left: item.left,
|
|
307
|
-
top: item.top,
|
|
308
|
-
width: item.width,
|
|
309
|
-
height: item.height,
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
this.cachedLayoutRange.push([start, end]);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
public cleanLayoutCache() {
|
|
316
|
-
for (let r of this.cachedLayoutRange) {
|
|
317
|
-
for (let i = r[0]; i < r[1]; ++i) {
|
|
318
|
-
this.templateList[i].layoutCache = null;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
this.cachedLayoutRange = [];
|
|
322
|
-
}
|
|
323
|
-
|
|
324
314
|
protected static getTemplateItem(itemObj: MeasureInfo): TemplateItem {
|
|
325
315
|
const valid = this.checkMeasureObject(itemObj);
|
|
326
316
|
if (!valid) {
|
|
@@ -362,32 +352,32 @@ abstract class MetroTemplate {
|
|
|
362
352
|
top: -1,
|
|
363
353
|
bottom: -1,
|
|
364
354
|
},
|
|
365
|
-
layoutCache:
|
|
355
|
+
layoutCache: new RectCache(),
|
|
366
356
|
}
|
|
367
357
|
}
|
|
368
358
|
|
|
369
359
|
private static checkMeasureObject(obj: object): boolean {
|
|
370
360
|
let result = true;
|
|
371
|
-
const errorLog = (errorInfo) => {
|
|
361
|
+
const errorLog = (errorInfo: any) => {
|
|
372
362
|
console.error(TAG, "measure obj check error: ", errorInfo, ". raw object", obj);
|
|
373
363
|
}
|
|
374
364
|
for (let key in measureObjectDefine) {
|
|
375
|
-
const defineInfo = measureObjectDefine[key];
|
|
376
|
-
if (typeof obj[key] == "undefined") {
|
|
365
|
+
const defineInfo = (measureObjectDefine as any)[key];
|
|
366
|
+
if (typeof (obj as any)[key] == "undefined") {
|
|
377
367
|
if (typeof defineInfo.default != "undefined") {
|
|
378
|
-
obj[key] = typeof defineInfo.default == "function" ? defineInfo.default() : defineInfo.default;
|
|
368
|
+
(obj as any)[key] = typeof defineInfo.default == "function" ? defineInfo.default() : defineInfo.default;
|
|
379
369
|
}
|
|
380
370
|
}
|
|
381
|
-
if (checkType(obj[key], defineInfo.type)) {
|
|
371
|
+
if (checkType((obj as any)[key], defineInfo.type)) {
|
|
382
372
|
if (typeof defineInfo.validator != "undefined") {
|
|
383
|
-
if (!defineInfo.validator(obj[key], errorLog)) {
|
|
373
|
+
if (!defineInfo.validator((obj as any)[key], errorLog)) {
|
|
384
374
|
result = false;
|
|
385
375
|
break;
|
|
386
376
|
}
|
|
387
377
|
}
|
|
388
378
|
} else {
|
|
389
379
|
result = false;
|
|
390
|
-
errorLog(`prop ${key} expected ${getTypeName(defineInfo.type)} value, got ${toRawType(obj[key])}`)
|
|
380
|
+
errorLog(`prop ${key} expected ${getTypeName(defineInfo.type)} value, got ${toRawType((obj as any)[key])}`)
|
|
391
381
|
break;
|
|
392
382
|
}
|
|
393
383
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { MetroTemplate, TemplateItem } from "./MetroTemplate";
|
|
2
|
+
import { MetroTemplate, TemplateItem, MeasureInfo } from "./MetroTemplate";
|
|
3
3
|
import { HORIZONTAL } from "../WidgetCommon";
|
|
4
4
|
import { METRO_WIDGET_CONST } from "../MetroWidget/Const";
|
|
5
5
|
class TemplateItemAdder {
|
|
@@ -59,13 +59,13 @@ class TemplateItemAdder {
|
|
|
59
59
|
if (
|
|
60
60
|
this._CurIndex < this._Data.length &&
|
|
61
61
|
(!cur_item ||
|
|
62
|
-
cur_item[this._Key] >= (this._CurPage - 1) * this._PageRange)
|
|
62
|
+
(cur_item as any)[this._Key] >= (this._CurPage - 1) * this._PageRange)
|
|
63
63
|
) {
|
|
64
64
|
while (this._CurIndex < this._Data.length) {
|
|
65
65
|
try {
|
|
66
66
|
let { templateObj } = this.addDataToTemplate(this._Data, this._CurIndex);
|
|
67
67
|
this._CurIndex++;
|
|
68
|
-
if (templateObj[this._Key] >= (this._CurPage + page_num) * this._PageRange) {
|
|
68
|
+
if ((templateObj as any)[this._Key] >= (this._CurPage + page_num) * this._PageRange) {
|
|
69
69
|
this._CurPage += page_num;
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
@@ -101,7 +101,7 @@ class TemplateItemAdder {
|
|
|
101
101
|
try {
|
|
102
102
|
let { templateObj } = this.addDataToTemplate(this._Data, this._CurIndex);
|
|
103
103
|
this._CurIndex++;
|
|
104
|
-
if (templateObj[this._Key] >= (this._CurPage + 1) * this._PageRange) {
|
|
104
|
+
if ((templateObj as any)[this._Key] >= (this._CurPage + 1) * this._PageRange) {
|
|
105
105
|
this._CurPage++;
|
|
106
106
|
}
|
|
107
107
|
} catch (e) {
|
|
@@ -131,7 +131,7 @@ class TemplateItemAdder {
|
|
|
131
131
|
try {
|
|
132
132
|
let { templateObj } = this.addDataToTemplate(this._Data, this._CurIndex);
|
|
133
133
|
cur_id = templateObj.id;
|
|
134
|
-
if (templateObj[this._Key] >= (this._CurPage + 1) * this._PageRange) {
|
|
134
|
+
if ((templateObj as any)[this._Key] >= (this._CurPage + 1) * this._PageRange) {
|
|
135
135
|
this._CurPage++;
|
|
136
136
|
}
|
|
137
137
|
this._CurIndex++;
|
|
@@ -167,7 +167,7 @@ class TemplateItemAdder {
|
|
|
167
167
|
targetItem = templateObj;
|
|
168
168
|
}
|
|
169
169
|
this._CurIndex++;
|
|
170
|
-
if (templateObj[this._Key] >= (this._CurPage + 1) * this._PageRange) {
|
|
170
|
+
if ((templateObj as any)[this._Key] >= (this._CurPage + 1) * this._PageRange) {
|
|
171
171
|
this._CurPage++;
|
|
172
172
|
}
|
|
173
173
|
} catch (e) {
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
* @LastEditTime: 2022-12-01 16:49:21
|
|
6
6
|
* @Description: file content
|
|
7
7
|
*/
|
|
8
|
+
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define.mjs";
|
|
9
|
+
|
|
10
|
+
export const getCurFrameCount = () => {
|
|
11
|
+
return Forge.sFrameCount.count;
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
export class BaseDispatcher {
|
|
9
15
|
private _Component: any;
|
|
10
16
|
|
|
@@ -92,8 +98,7 @@ export const SlideStyle = {
|
|
|
92
98
|
endBoundaryProtect: 2,
|
|
93
99
|
};
|
|
94
100
|
|
|
95
|
-
export
|
|
96
|
-
export const HORIZONTAL = Symbol("horizontal");
|
|
101
|
+
export { VERTICAL, HORIZONTAL } from "../JsViewVueTools/ConstSymbol";
|
|
97
102
|
|
|
98
103
|
const defaultSpeed = 1.5;
|
|
99
104
|
const defaultEasing = "";
|
|
@@ -155,8 +160,12 @@ export class WholePageSlide extends SlideSetting {
|
|
|
155
160
|
* @constructor SeamlessSlide
|
|
156
161
|
* @extends SlideSetting
|
|
157
162
|
* @param {Object} settings 设置,结构为{
|
|
158
|
-
* startPercent: 左/上侧触发滚动的比例
|
|
159
|
-
* endPercennt: 右/下侧触发滚动的比例
|
|
163
|
+
* startPercent: 左/上侧触发滚动的比例 0-1
|
|
164
|
+
* endPercennt: 右/下侧触发滚动的比例 0-1
|
|
165
|
+
* headRange: 左/上按键触发滚动的区域比例 0-1
|
|
166
|
+
* tailRange: 右/下按键触发滚动的区域比例 0-1
|
|
167
|
+
* headSafeArea: 保证头部item完整显示的安全区域大小
|
|
168
|
+
* tailSafeArea: 保证尾部item完整显示的安全区域大小
|
|
160
169
|
* speed: 滚动速度, 像素/毫秒
|
|
161
170
|
* easing: 滚动动画的easing
|
|
162
171
|
* boundaryProtect: 确定滚动位置能否小于0或者大于最大长度
|
|
@@ -167,10 +176,16 @@ export class SeamlessSlide extends SlideSetting {
|
|
|
167
176
|
public readonly StartPercent: number;
|
|
168
177
|
public readonly EndPercent: number;
|
|
169
178
|
public readonly FixFirstPage: boolean;
|
|
179
|
+
public readonly HeadSafeArea: number;
|
|
180
|
+
public readonly TailSafeArea: number;
|
|
170
181
|
|
|
171
182
|
constructor({
|
|
172
183
|
startPercent = 0.2,
|
|
173
184
|
endPercent = 0.8,
|
|
185
|
+
headRange = undefined,
|
|
186
|
+
tailRange = undefined,
|
|
187
|
+
headSafeArea = 0.1,
|
|
188
|
+
tailSafeArea = 0.1,
|
|
174
189
|
speed = defaultSpeed,
|
|
175
190
|
duration = null,
|
|
176
191
|
easing = defaultEasing,
|
|
@@ -180,6 +195,20 @@ export class SeamlessSlide extends SlideSetting {
|
|
|
180
195
|
super(SlideSetting.Type.SEAMLESS, speed, duration, easing, boundaryProtect);
|
|
181
196
|
this.StartPercent = startPercent;
|
|
182
197
|
this.EndPercent = endPercent;
|
|
198
|
+
if (typeof headRange !== "undefined") {
|
|
199
|
+
this.StartPercent = headRange;
|
|
200
|
+
}
|
|
201
|
+
if (typeof tailRange !== "undefined") {
|
|
202
|
+
this.EndPercent = 1 - tailRange;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (this.StartPercent < 0 || this.StartPercent > 1 || this.EndPercent < 0 || this.EndPercent > 1) {
|
|
206
|
+
console.error(`SeamlessSlideSetting error: invalide value, startPercent(${this.StartPercent}) and endPercent(${this.EndPercent}) must between 0 and 1.`);
|
|
207
|
+
this.StartPercent = 0.3;
|
|
208
|
+
this.EndPercent = 0.7;
|
|
209
|
+
}
|
|
210
|
+
this.HeadSafeArea = headSafeArea;
|
|
211
|
+
this.TailSafeArea = tailSafeArea;
|
|
183
212
|
this.FixFirstPage = fixFirstPage;
|
|
184
213
|
}
|
|
185
214
|
}
|
|
@@ -224,4 +253,4 @@ export const FocusMoveType = {
|
|
|
224
253
|
ROW_FIND_NEAR: 0x00000001 << 3,
|
|
225
254
|
};
|
|
226
255
|
|
|
227
|
-
export const RENDER_ITEM_BREAK_KEY = "__QcodeJsviewMetroWidgetSlot";
|
|
256
|
+
export const RENDER_ITEM_BREAK_KEY = "__QcodeJsviewMetroWidgetSlot";
|