@shijiu/jsview-vue 2.2.201 → 2.2.426-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/BrowserApic.vue.mjs +2 -13
- package/bin/browser/BrowserApic2.vue.mjs +2 -13
- package/bin/browser/BrowserApicLib.mjs +24 -24
- package/bin/browser/BrowserAudio.vue.mjs +2 -10
- package/bin/browser/BrowserJsvLatex.vue.mjs +39 -16
- package/bin/export-sfc.mjs +3 -3
- package/bin/jsview-vue-common.mjs +3 -3
- package/bin/jsview-vue.mjs +3288 -2312
- package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +72 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/ListWidget.vue.d.ts +6 -3
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/MetroWidget.vue.d.ts +6 -3
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/MetroWidgetSetup.d.ts +3 -1
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/TaskManager.d.ts +64 -0
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/TokenGenerator.d.ts +4 -0
- package/bin/types/utils/JsViewEngineWidget/RectUtils.d.ts +61 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/Fence.d.ts +2 -2
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/MetroTemplate.d.ts +3 -3
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/index.d.ts +1 -1
- package/bin/types/utils/JsViewPlugin/JsvAudio/version.d.mts +13 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/index.d.ts +1 -0
- package/bin/types/utils/JsViewPlugin/JsvLatex/version.d.mts +13 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/BrowserJsvPlayer-0.9.vue.d.ts +45 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/BrowserJsvPlayer.vue.d.ts +597 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/GetVersion.d.ts +13 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMedia.d.ts +420 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.d.ts +57 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue.d.ts +588 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/index-0.9.d.ts +358 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/index.d.ts +358 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/version.d.mts +14 -0
- package/bin/types/utils/JsViewVueTools/FeatureActive.d.ts +10 -0
- package/bin/types/utils/JsViewVueTools/ForgeHandles.d.ts +6 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvDynamicCssStyle.d.ts +3 -1
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvDynamicKeyFrames.d.ts +4 -2
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvImpactTracer.d.ts +4 -4
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvPreDownloader.d.ts +3 -2
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvRefTaker.d.ts +2 -3
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvRuntimeBridge.d.ts +42 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvStyleSheetsDeclarer.d.ts +3 -1
- package/bin/types/utils/JsViewVueTools/JsvTextTools.d.ts +61 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureLoadTool.d.ts +63 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/JsvTextureStore.d.ts +8 -4
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/NinePatchHelper.d.ts +1 -1
- package/bin/types/utils/JsViewVueTools/TextureManagerTools.d.ts +7 -0
- package/bin/types/utils/JsViewVueTools/TypeCheckAndSet.d.ts +3 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/index.d.ts +3 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic/JsvApic.vue.d.ts +7 -0
- package/bin/types/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue.d.ts +84 -0
- package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue.d.ts +75 -0
- package/bin/types/utils/JsViewVueWidget/JsvFlexCell/index.d.ts +2 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFragShaderView/JsvFragShaderView.vue.d.ts +3 -1
- package/bin/types/utils/JsViewVueWidget/JsvFragShaderView/index.d.ts +1 -0
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/KeepFlags.d.ts +7 -0
- package/bin/types/utils/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +12 -0
- package/bin/types/utils/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +45 -0
- package/bin/types/utils/JsViewVueWidget/JsvInput/EditVisibleArea.d.ts +26 -0
- package/bin/types/{JsViewVueWidget/JsvPreload/BrowserPreload.vue.d.ts → utils/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts} +7 -5
- package/bin/types/utils/JsViewVueWidget/JsvInput/SharedDefine.d.ts +13 -0
- package/bin/types/utils/JsViewVueWidget/JsvInput/SystemTextTools.d.ts +16 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMaskClipDiv.vue.d.ts +0 -2
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/DataTree.d.ts +3 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/Geometry.d.ts +2 -2
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/JsvMindMap.vue.d.ts +16 -9
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvNativeSharedDiv.vue.d.ts +6 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvNinePatch.vue.d.ts +2 -1
- package/bin/types/utils/JsViewVueWidget/JsvPreload/index.d.ts +2 -0
- package/bin/types/utils/JsViewVueWidget/JsvSwiper/Indicator.vue.d.ts +16 -0
- package/bin/types/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue.d.ts +16 -0
- package/bin/types/utils/JsViewVueWidget/JsvTextureAnim/index.d.ts +4 -0
- package/bin/types/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +75 -0
- package/bin/types/utils/JsViewVueWidget/JsvVideo.vue.d.ts +23 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/index.d.ts +4 -2
- package/index.d.ts +9 -1
- package/package.json +1 -1
- package/tools/config/toolkit.mjs +81 -0
- package/tools/config/vite.config.ts +24 -14
- package/tools/jsview-vue-build.mjs +67 -21
- package/tsconfig.json +27 -0
- package/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue +6 -2
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +3 -1
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +12 -5
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +175 -65
- package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +1 -1
- package/utils/JsViewEngineWidget/TemplateParser/Fence.ts +2 -2
- package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +15 -9
- package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +4 -6
- 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/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/JsvHashHistory.js +26 -29
- package/utils/JsViewVueTools/JsvImpactTracer.js +2 -0
- package/utils/JsViewVueTools/JsvPreDownloader.ts +2 -1
- package/utils/JsViewVueTools/JsvRefTaker.js +1 -2
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +125 -59
- package/utils/JsViewVueTools/JsvStyleClass.js +2 -0
- package/utils/JsViewVueTools/JsvStyleSheetsDeclarer.js +2 -0
- package/utils/JsViewVueTools/JsvTextTools.ts +156 -0
- package/utils/JsViewVueTools/JsvTextureLoadTool.ts +233 -0
- package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +4 -1
- package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +7 -3
- package/utils/JsViewVueTools/JsvTextureStore/Texture.ts +1 -0
- package/utils/JsViewVueTools/TextureManagerTools.ts +17 -0
- package/utils/JsViewVueTools/TypeCheckAndSet.ts +66 -0
- package/utils/JsViewVueTools/index.js +4 -1
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +2 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue +10 -2
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +12 -1
- package/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue +4 -2
- package/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue +2 -0
- package/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue +219 -0
- package/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue +11 -9
- package/utils/JsViewVueWidget/JsvFilterView.vue +2 -0
- package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +5 -2
- package/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue +140 -0
- package/utils/JsViewVueWidget/JsvFlexCell/index.js +2 -5
- package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +214 -63
- package/utils/JsViewVueWidget/JsvFragShaderView/index.js +2 -9
- package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +9 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue +2 -0
- 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 +353 -0
- package/utils/JsViewVueWidget/JsvInput/EditVisibleArea.ts +255 -0
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +294 -681
- package/utils/JsViewVueWidget/JsvInput/SharedDefine.ts +17 -0
- package/utils/JsViewVueWidget/JsvInput/SystemTextTools.ts +61 -0
- package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +2 -0
- package/utils/JsViewVueWidget/JsvMarquee.vue +2 -0
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +5 -48
- 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 +5 -0
- package/utils/JsViewVueWidget/JsvPieChart.vue +2 -0
- package/utils/JsViewVueWidget/JsvPosterDiv.vue +2 -0
- package/utils/JsViewVueWidget/JsvPosterImage.vue +3 -2
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +23 -44
- package/utils/JsViewVueWidget/JsvPreload/index.js +2 -13
- package/utils/JsViewVueWidget/JsvProgressBar.vue +2 -0
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +12 -12
- 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 +9 -0
- package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue +9 -0
- package/utils/JsViewVueWidget/JsvSector.vue +2 -0
- package/utils/JsViewVueWidget/JsvSoundPool.js +5 -7
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +43 -23
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -5
- 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 +48 -50
- package/utils/JsViewVueWidget/JsvTextureAnim/index.js +2 -9
- 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 +4 -2
- package/bin/browser/BrowserJsvFragShaderView.vue.mjs +0 -63
- package/bin/browser/BrowserPreload.vue.mjs +0 -143
- package/bin/browser/BrowserQrcode.vue.mjs +0 -180
- package/bin/browser/BrowserSpray.vue.mjs +0 -66
- package/bin/browser/BrowserTextureAnim.vue.mjs +0 -332
- package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +0 -102
- package/bin/types/JsViewVueTools/ForgeHandles.d.ts +0 -6
- package/bin/types/JsViewVueTools/JsvTextTools.d.ts +0 -37
- package/bin/types/JsViewVueTools/TypeCheckAndSet.d.ts +0 -2
- package/bin/types/JsViewVueWidget/JsvFlexCell/index.d.ts +0 -2
- package/bin/types/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue.d.ts +0 -13
- package/bin/types/JsViewVueWidget/JsvFragShaderView/index.d.ts +0 -2
- package/bin/types/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +0 -36
- package/bin/types/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +0 -210
- package/bin/types/JsViewVueWidget/JsvPreload/index.d.ts +0 -17
- package/bin/types/JsViewVueWidget/JsvQrcode/BrowserQrcode.vue.d.ts +0 -11
- package/bin/types/JsViewVueWidget/JsvQrcode/index.d.ts +0 -2
- package/bin/types/JsViewVueWidget/JsvSpray/BrowserSpray.vue.d.ts +0 -25
- package/bin/types/JsViewVueWidget/JsvSpray/index.d.ts +0 -2
- package/bin/types/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue.d.ts +0 -151
- package/bin/types/JsViewVueWidget/JsvTextureAnim/index.d.ts +0 -14
- package/tools/config/tsconfig.json +0 -15
- package/utils/JsViewVueTools/JsvTextTools.js +0 -89
- package/utils/JsViewVueTools/TypeCheckAndSet.js +0 -27
- package/utils/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue +0 -48
- package/utils/JsViewVueWidget/JsvPreload/BrowserPreload.vue +0 -144
- package/utils/JsViewVueWidget/JsvQrcode/BrowserQrcode.vue +0 -189
- package/utils/JsViewVueWidget/JsvQrcode/index.js +0 -18
- package/utils/JsViewVueWidget/JsvSpray/BrowserSpray.vue +0 -55
- package/utils/JsViewVueWidget/JsvSpray/index.js +0 -17
- package/utils/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue +0 -359
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/CheckType.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/JsvFocus/JsvFocusHub.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/JsvFocus/JsvFocusManager.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/Const.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/Dispatcher.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/PageUpdater.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/RenderItem.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/Slide.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/SlotComponent.vue.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/VisibleInfo.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/MetroWidget/WidgetRectInfo.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/RangeModel.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/CommonMetroTemplate.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/ListMetroTemplate.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/TemplateItemAdder.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/TemplateParser/index.d.ts +0 -0
- package/bin/types/{JsViewEngineWidget → utils/JsViewEngineWidget}/WidgetCommon.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAccount/JsvAccount.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/AudioProxy.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +4 -4
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/CheckType.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/Events.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/JsvAudio.vue.d.ts +4 -4
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/JsvAudioBridgeProxy.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/JsvAudioProxy.vue.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/PluginLoader.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/ScreenLockManager.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/index.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvAudio/version.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/BrowserDomBuilder.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/BrowserJsvLatex.vue.d.ts +4 -4
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/Color.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/JsvLatex.vue.d.ts +4 -4
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/JsvLatexBridgeProxy.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/JsvLatexProxy.vue.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/PluginLoader.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/JsvLatex/version.d.ts +0 -0
- package/bin/types/{JsViewPlugin → utils/JsViewPlugin}/index.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/ConstSymbol.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/DebugContentShellJBridge.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/DebugTool.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/DefaultKeyMap.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/ForgeConstDefine.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvDemoTester.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvFederationTools.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvHashHistory.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvPerformance.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvStyleClass.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureDefines.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/CanvasTexture/CanvasTexture.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/CanvasTexture/CommandList.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/CanvasTexture/Path.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/Store.d.ts +0 -0
- package/bin/types/{JsViewVueTools → utils/JsViewVueTools}/JsvTextureStore/Texture.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvActorMove/ActorControlBase.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvActorMove/JsvActorMove.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvActorMove/JsvActorMoveControl.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvActorMove/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic/BrowserApic.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic2/JsvApic2.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvApic2/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/ApicDataBase.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/BrowserApicLib.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/GifData.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/NormalLoopTool.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/PartLoopTool.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/SingleLoopTool.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/Viewer.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvBrowserApicLib/WebpData.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvApic/JsvCommonLoopToolBase.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvClipDiv/JsvClipDiv.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvClipDiv/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvConnectLine/ArcLineManager.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvConnectLine/JsvConnectLine.vue.d.ts +2 -2
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvConnectLine/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvDriftScope/JsvDriftScope.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvDriftScope/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvEnableRenderBreak.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFilterView.vue.d.ts +3 -3
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFlexCell/JsvFlexDiv.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/ActionRefObject.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/ActorControl.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/ActorState.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/CallbackManager.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/ForgeTypeDefine.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/FreeMoveActor.vue.d.ts +9 -9
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +3 -3
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/NexusNode.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/SetAction.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/SetCondition.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/SetState.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/SyncLinkManager.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvFreeMoveActor/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvGrid.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvHole.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvInput/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvLine/JsvLine.vue.d.ts +3 -3
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvLine/LineManager.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvLine/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMarquee.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/CommonType.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/Constant.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvMindMap/rtree.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvPieChart.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvPosterDiv.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvPosterImage.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvPreload/JsvPreload.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvProgressBar.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvQrcode/JsvQrcode.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvRadarChart.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvRipple/Constant.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvRipple/JsvRipple.vue.d.ts +3 -3
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvRipple/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScaleTextBox.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScrollBox/JsvScrollBox.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScrollBox/JsvScrollFollow.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScrollBox/ScrollInnerSymbol.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScrollBox/ScrollSymbol.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvScrollBox/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSector.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSoundPool.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpray/JsvSpray.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/FrameBuidler.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/JsvSpriteTools.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/SpriteController.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSpriteAnim/sAnimationToken.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSwiper/JsvSwiper.vue.d.ts +1 -1
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSwiper/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSwiper3D/JsvSwiper.vue.d.ts +3 -3
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvSwiper3D/index.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvTextBox.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvTextureAnim/CommonType.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvTextureAnim/JsvTextureAnim.vue.d.ts +0 -0
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +6 -6
- package/bin/types/{JsViewVueWidget → utils/JsViewVueWidget}/JsvVisibleSensor/index.d.ts +6 -6
- /package/bin/types/{index.d.ts → utils/index.d.ts} +0 -0
|
@@ -4,50 +4,54 @@
|
|
|
4
4
|
* @LastEditTime: 2023-02-01 13:47:13
|
|
5
5
|
* @Description: file content
|
|
6
6
|
-->
|
|
7
|
-
<script>
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
top: { type: Number, default: 0 },
|
|
16
|
-
width: Number,
|
|
17
|
-
height: Number,
|
|
18
|
-
color: String,
|
|
19
|
-
},
|
|
20
|
-
setup() {
|
|
21
|
-
return {
|
|
22
|
-
intervalToken: -1,
|
|
23
|
-
visible: ref(false),
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
methods: {
|
|
27
|
-
_cleanInterval() {
|
|
28
|
-
if (this.intervalToken > 0) {
|
|
29
|
-
clearInterval(this.intervalToken);
|
|
30
|
-
this.intervalToken = -1;
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
startBlink() {
|
|
34
|
-
this._cleanInterval();
|
|
35
|
-
this.intervalToken = setInterval(() => {
|
|
36
|
-
this.visible = !this.visible;
|
|
37
|
-
}, 750);
|
|
38
|
-
},
|
|
39
|
-
stopBlink(show) {
|
|
40
|
-
this._cleanInterval();
|
|
41
|
-
this.visible = show;
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
mounted() {
|
|
45
|
-
this.startBlink();
|
|
46
|
-
},
|
|
47
|
-
beforeUnmount() {
|
|
48
|
-
this._cleanInterval();
|
|
7
|
+
<script setup>
|
|
8
|
+
import { shallowRef, onUnmounted, onMounted } from "vue";
|
|
9
|
+
|
|
10
|
+
const rProps = defineProps({
|
|
11
|
+
left: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 0,
|
|
49
14
|
},
|
|
50
|
-
}
|
|
15
|
+
top: { type: Number, default: 0 },
|
|
16
|
+
width: Number,
|
|
17
|
+
height: Number,
|
|
18
|
+
color: String,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
let vIntervalToken = -1;
|
|
22
|
+
let rVisible = shallowRef(false);
|
|
23
|
+
|
|
24
|
+
function _CleanInterval() {
|
|
25
|
+
if (vIntervalToken > 0) {
|
|
26
|
+
clearInterval(vIntervalToken);
|
|
27
|
+
vIntervalToken = -1;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function startBlink() {
|
|
32
|
+
_CleanInterval();
|
|
33
|
+
vIntervalToken = setInterval(() => {
|
|
34
|
+
rVisible.value = !rVisible.value;
|
|
35
|
+
}, 750);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function stopBlink(show) {
|
|
39
|
+
_CleanInterval();
|
|
40
|
+
rVisible.value = show;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
onMounted(() => {
|
|
44
|
+
startBlink();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
onUnmounted(() => {
|
|
48
|
+
_CleanInterval();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
defineExpose({
|
|
52
|
+
startBlink,
|
|
53
|
+
stopBlink,
|
|
54
|
+
});
|
|
51
55
|
</script>
|
|
52
56
|
|
|
53
57
|
<template>
|
|
@@ -58,7 +62,7 @@ export default {
|
|
|
58
62
|
width,
|
|
59
63
|
height,
|
|
60
64
|
backgroundColor: color,
|
|
61
|
-
visibility:
|
|
65
|
+
visibility: rVisible ? 'inherit' : 'hidden',
|
|
62
66
|
}"
|
|
63
67
|
/>
|
|
64
|
-
</template>
|
|
68
|
+
</template>
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define.mjs";
|
|
2
|
+
import { EditVisibleArea } from "./EditVisibleArea";
|
|
3
|
+
import { FontStyleDefine, InputType } from "./SharedDefine";
|
|
4
|
+
import { getTextDisplayWidth } from "./SystemTextTools";
|
|
5
|
+
|
|
6
|
+
export const CHAR_CODE_OF_0 = "0".charCodeAt(0);
|
|
7
|
+
export const CHAR_CODE_OF_9 = "9".charCodeAt(0);
|
|
8
|
+
|
|
9
|
+
function ifDigital(char: string) {
|
|
10
|
+
let char_code = char.charCodeAt(0);
|
|
11
|
+
return CHAR_CODE_OF_0 <= char_code && char_code <= CHAR_CODE_OF_9
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare interface CursorOperater {
|
|
15
|
+
startBlink: () => void;
|
|
16
|
+
stopBlink: (show: boolean) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare type TextChangedFunc = (final_text: string, dsp_text: string) => void;
|
|
20
|
+
declare type CursorMovedFunc = (new_text_start_index: number, new_cursor_left: number) => void;
|
|
21
|
+
declare type TextOverflowFunc = (origin_text: string, new_text: string) => void;
|
|
22
|
+
|
|
23
|
+
export class EditViewOperator {
|
|
24
|
+
private _EditViewHandle: any = null;
|
|
25
|
+
private _CursorHandle: CursorOperater | null = null;
|
|
26
|
+
private _EditViewId: number = -1;
|
|
27
|
+
private _CursorResumeTimeoutToken: number = -1;
|
|
28
|
+
|
|
29
|
+
private _InputType: number = 0;
|
|
30
|
+
private _FontStyle: FontStyleDefine | null = null
|
|
31
|
+
private _TextLeft: number = 0; // 文字在可视区域内的左坐标, 超出部分被视觉上clip掉
|
|
32
|
+
private _MaxInputLenth: number = 128;
|
|
33
|
+
private _TextReadOnly: boolean = false;
|
|
34
|
+
private _CurrentFullText: string = "";
|
|
35
|
+
private _CurrentDspText: string = "";
|
|
36
|
+
private _CurrentDspWith: number = 0;
|
|
37
|
+
|
|
38
|
+
private _CurrentCursorOffset: number = 0; // 相对可视区域的左边缘的焦点显示位置
|
|
39
|
+
|
|
40
|
+
private _IsFocus: boolean = false;
|
|
41
|
+
|
|
42
|
+
private _EditVisibleArea?: EditVisibleArea;
|
|
43
|
+
|
|
44
|
+
private _TextChangedCount: number = 0; // 记录文字变化的次数,可用于确认文字是否变化,当style变化或者文字内容变化时+1
|
|
45
|
+
|
|
46
|
+
// Callback
|
|
47
|
+
private _OnTextChangedCallback: TextChangedFunc;
|
|
48
|
+
private _OnCursorMoved: CursorMovedFunc;
|
|
49
|
+
private _TextOverflowFunc: TextOverflowFunc | undefined;
|
|
50
|
+
|
|
51
|
+
constructor(
|
|
52
|
+
text_changed_callback: TextChangedFunc,
|
|
53
|
+
cursor_moved: CursorMovedFunc,
|
|
54
|
+
text_overflow: TextOverflowFunc | undefined = undefined
|
|
55
|
+
) {
|
|
56
|
+
this._OnTextChangedCallback = text_changed_callback;
|
|
57
|
+
this._OnCursorMoved = cursor_moved;
|
|
58
|
+
this._TextOverflowFunc = text_overflow;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// 当前是否为焦点
|
|
62
|
+
// 焦点状态显示光标并激活输入状态
|
|
63
|
+
updateFocus(is_focus: boolean) {
|
|
64
|
+
if (is_focus) {
|
|
65
|
+
if (!this._IsFocus) {
|
|
66
|
+
// 非聚焦转化为聚焦状态
|
|
67
|
+
this._IsFocus = true;
|
|
68
|
+
this._CursorHandle?.startBlink();
|
|
69
|
+
if (this._EditViewHandle && !this._TextReadOnly) {
|
|
70
|
+
this._EditViewHandle.showIme(
|
|
71
|
+
this._InputType,
|
|
72
|
+
this._CurrentFullText,
|
|
73
|
+
this._CurrentCursorOffset,
|
|
74
|
+
Math.ceil(-this._TextLeft),
|
|
75
|
+
0
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
if (this._IsFocus) {
|
|
81
|
+
// 变为非聚焦状态
|
|
82
|
+
this._IsFocus = false;
|
|
83
|
+
// console.log("Input Blur");
|
|
84
|
+
if (this._EditViewHandle && !this._TextReadOnly) {
|
|
85
|
+
this._EditViewHandle.hideIme();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
showSoftIme() {
|
|
92
|
+
this._EditViewHandle.showIme(
|
|
93
|
+
this._InputType,
|
|
94
|
+
this._CurrentFullText,
|
|
95
|
+
this._CurrentCursorOffset,
|
|
96
|
+
Math.ceil(-this._TextLeft),
|
|
97
|
+
0
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
updateInputConfig(
|
|
102
|
+
box_width: number, box_height: number,
|
|
103
|
+
cursor_width: number,
|
|
104
|
+
font_style: FontStyleDefine,
|
|
105
|
+
input_type: number,
|
|
106
|
+
max_input_lenth: number,
|
|
107
|
+
text_read_only: boolean,
|
|
108
|
+
editorTextColor: string,
|
|
109
|
+
editorBackground: string
|
|
110
|
+
) {
|
|
111
|
+
|
|
112
|
+
// format fontStyle
|
|
113
|
+
this._FontStyle = {
|
|
114
|
+
fontSize: !font_style.fontSize || isNaN(font_style.fontSize) ? Forge.TextUtils.sDefaultFontSize : font_style.fontSize,
|
|
115
|
+
fontFamily: !font_style.fontFamily ? Forge.TextUtils.sDefaultFontSize : font_style.fontFamily,
|
|
116
|
+
textAlign: font_style.textAlign,
|
|
117
|
+
fontStyle: font_style.fontStyle,
|
|
118
|
+
fontWeight: font_style.fontWeight
|
|
119
|
+
}
|
|
120
|
+
this._FontStyle = font_style;
|
|
121
|
+
this._InputType = input_type;
|
|
122
|
+
this._MaxInputLenth = max_input_lenth;
|
|
123
|
+
this._TextReadOnly = text_read_only;
|
|
124
|
+
|
|
125
|
+
this._EditVisibleArea = new EditVisibleArea(
|
|
126
|
+
box_width, box_height,
|
|
127
|
+
cursor_width,
|
|
128
|
+
font_style,
|
|
129
|
+
font_style.textAlign === "right"
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
this._EditViewHandle.setEditorStyle(
|
|
133
|
+
this._FontStyle.fontSize,
|
|
134
|
+
this._FontStyle.textAlign,
|
|
135
|
+
editorTextColor,
|
|
136
|
+
editorBackground
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
generateView(): number {
|
|
141
|
+
// 构建EditControlView来处理输入
|
|
142
|
+
this._EditViewHandle = new Forge.EditControlView();
|
|
143
|
+
this._EditViewHandle.addImeEventListener({
|
|
144
|
+
OnTextChanged: this._OnTextChanged.bind(this),
|
|
145
|
+
OnStatusChanged: this._OnStatusChanged.bind(this),
|
|
146
|
+
OnEditAction: null
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
this._EditViewId = Forge.sViewStore.add(
|
|
150
|
+
new Forge.ViewInfo(this._EditViewHandle)
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
return this._EditViewId;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
setCursorRef(cursor_ref: any) {
|
|
157
|
+
this._CursorHandle = cursor_ref;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
moveCursorOffset(moved_gap: number): boolean {
|
|
161
|
+
let cursor_moved = false;
|
|
162
|
+
|
|
163
|
+
if (moved_gap != 0) {
|
|
164
|
+
this._PauseCursorBlink(); // 开始移动后停止光标闪动
|
|
165
|
+
|
|
166
|
+
let pre_cursor_index = this._CurrentCursorOffset;
|
|
167
|
+
let new_cursor_index = pre_cursor_index + moved_gap;
|
|
168
|
+
|
|
169
|
+
// 控制边界
|
|
170
|
+
if (new_cursor_index < 0) {
|
|
171
|
+
new_cursor_index = 0;
|
|
172
|
+
}
|
|
173
|
+
if (new_cursor_index > this._CurrentFullText.length) {
|
|
174
|
+
new_cursor_index = this._CurrentFullText.length;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
cursor_moved = (pre_cursor_index != new_cursor_index);
|
|
178
|
+
|
|
179
|
+
if (cursor_moved) {
|
|
180
|
+
let new_text_left = this._EditVisibleArea!.calculateSlide(
|
|
181
|
+
this._CurrentDspText,
|
|
182
|
+
this._CurrentDspText,
|
|
183
|
+
this._CurrentDspWith,
|
|
184
|
+
this._CurrentDspWith,
|
|
185
|
+
new_cursor_index,
|
|
186
|
+
true,
|
|
187
|
+
this._TextChangedCount
|
|
188
|
+
);
|
|
189
|
+
this._UpdateDispay(new_text_left, new_cursor_index)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return cursor_moved;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
private _UpdateDispay(new_text_start_index: number, new_cursor_left: number) {
|
|
197
|
+
if (this._TextLeft != new_text_start_index || this._CurrentCursorOffset != new_cursor_left) {
|
|
198
|
+
this._TextLeft = new_text_start_index;
|
|
199
|
+
this._CurrentCursorOffset = new_cursor_left;
|
|
200
|
+
this._OnCursorMoved?.(this._TextLeft, this._EditVisibleArea!.getCursorPosition());
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
onUnmounted() {
|
|
205
|
+
this._EditViewHandle?.releaseResource();
|
|
206
|
+
this._EditVisibleArea!.releaseResource();
|
|
207
|
+
if (this._EditViewId != -1) {
|
|
208
|
+
Forge.sViewStore.remove(this._EditViewId);
|
|
209
|
+
this._EditViewId = -1;
|
|
210
|
+
}
|
|
211
|
+
this._ClearCursorResumeTimer();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
private _PauseCursorBlink() {
|
|
215
|
+
// 暂停光标闪动,暂停800ms
|
|
216
|
+
|
|
217
|
+
this._CursorHandle?.stopBlink(true);
|
|
218
|
+
|
|
219
|
+
// reset cursor timer
|
|
220
|
+
this._ClearCursorResumeTimer();
|
|
221
|
+
this._CursorResumeTimeoutToken = setTimeout(() => {
|
|
222
|
+
this._CursorHandle?.startBlink();
|
|
223
|
+
}, 800);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
private _ClearCursorResumeTimer() {
|
|
227
|
+
if (this._CursorResumeTimeoutToken) {
|
|
228
|
+
clearTimeout(this._CursorResumeTimeoutToken);
|
|
229
|
+
this._CursorResumeTimeoutToken = -1;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// EditControlView当输入变化时的回调
|
|
234
|
+
private _OnTextChanged(text: string, cursor_index: number, scroll_left?: number) {
|
|
235
|
+
let p = {
|
|
236
|
+
text,
|
|
237
|
+
cursor_index,
|
|
238
|
+
scroll_left
|
|
239
|
+
}
|
|
240
|
+
if (typeof text != 'string' || text.length >= this._MaxInputLenth) {
|
|
241
|
+
// 非法输入或者输入限制,超输入限制,文字内容不改变
|
|
242
|
+
if (this._EditViewHandle && this._IsFocus) {
|
|
243
|
+
this._EditViewHandle.updateCursorOffset(
|
|
244
|
+
this._CurrentDspText,
|
|
245
|
+
this._CurrentCursorOffset,
|
|
246
|
+
Math.ceil(-this._TextLeft),
|
|
247
|
+
0
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (text.length > 0) {
|
|
254
|
+
const start = cursor_index - 1;
|
|
255
|
+
const end = cursor_index;
|
|
256
|
+
const add_text = text.slice(start, end);
|
|
257
|
+
if (add_text && !ifDigital(add_text) && this._InputType === InputType.NUMBER) {
|
|
258
|
+
// console.log(
|
|
259
|
+
// `onTextChanged add text failed, add_text:${add_text}, when input type is number!`
|
|
260
|
+
// );
|
|
261
|
+
// 输入内容非法,不更换内容
|
|
262
|
+
this._EditViewHandle!.updateCursorOffset(
|
|
263
|
+
this._CurrentDspText,
|
|
264
|
+
this._CurrentCursorOffset,
|
|
265
|
+
Math.ceil(-this._TextLeft),
|
|
266
|
+
0
|
|
267
|
+
);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// 更新文字记录信息
|
|
273
|
+
let text_changed = this._CurrentFullText != text;
|
|
274
|
+
let origin_dsp_text = this._CurrentDspText;
|
|
275
|
+
let origin_dsp_width = this._CurrentDspWith;
|
|
276
|
+
if (text_changed) {
|
|
277
|
+
this._CurrentFullText = text;
|
|
278
|
+
// 更新显示字符串信息
|
|
279
|
+
if (this._InputType === Forge.TextInputType.PASSWORD) {
|
|
280
|
+
// password
|
|
281
|
+
this._CurrentDspText = text.replace(/\w/g, "*");
|
|
282
|
+
} else {
|
|
283
|
+
this._CurrentDspText = text;
|
|
284
|
+
}
|
|
285
|
+
this._CurrentDspWith = getTextDisplayWidth(this._CurrentDspText, this._FontStyle!);
|
|
286
|
+
this._TextChangedCount++; // 记录文字信息发生了变化
|
|
287
|
+
} else {
|
|
288
|
+
// 仅由EditView发出来的光标移动事件
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// 在文字信息更新后,重算显示位置
|
|
292
|
+
let new_text_left = this._EditVisibleArea!.calculateSlide(
|
|
293
|
+
origin_dsp_text,
|
|
294
|
+
this._CurrentDspText,
|
|
295
|
+
origin_dsp_width,
|
|
296
|
+
this._CurrentDspWith,
|
|
297
|
+
cursor_index,
|
|
298
|
+
false,
|
|
299
|
+
this._TextChangedCount
|
|
300
|
+
);
|
|
301
|
+
|
|
302
|
+
this._UpdateDispay(new_text_left, cursor_index);
|
|
303
|
+
|
|
304
|
+
if (text_changed) {
|
|
305
|
+
this._OnTextChangedCallback?.(this._CurrentFullText, this._CurrentDspText);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
private _OnStatusChanged(visible: boolean) {
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
public addText(text: string) {
|
|
313
|
+
if (this._InputType === InputType.NUMBER && !ifDigital(text)) {
|
|
314
|
+
// console.log(`The input data:${string} is not number`);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const pre_full_str = this._CurrentFullText;
|
|
318
|
+
const pre_index = this._CurrentCursorOffset;
|
|
319
|
+
|
|
320
|
+
const new_str =
|
|
321
|
+
pre_full_str.slice(0, pre_index) +
|
|
322
|
+
text +
|
|
323
|
+
pre_full_str.slice(pre_index);
|
|
324
|
+
|
|
325
|
+
if (new_str.length > this._MaxInputLenth) {
|
|
326
|
+
this._TextOverflowFunc?.(pre_full_str, new_str);
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const new_index = pre_index + text.length;
|
|
331
|
+
this._OnTextChanged(new_str, new_index);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
public deleteText() {
|
|
335
|
+
const pre_full_str = this._CurrentFullText;
|
|
336
|
+
const pre_index = this._CurrentCursorOffset;
|
|
337
|
+
if (pre_index > 0) {
|
|
338
|
+
const new_str =
|
|
339
|
+
pre_full_str.slice(0, pre_index - 1) + pre_full_str.slice(pre_index);
|
|
340
|
+
const new_index = pre_index - 1;
|
|
341
|
+
this._OnTextChanged(new_str, new_index);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
public clearText() {
|
|
346
|
+
this._OnTextChanged("", 0);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
public replaceText(text: string) {
|
|
350
|
+
// 全部内容替换
|
|
351
|
+
this._OnTextChanged(text, text?.length);
|
|
352
|
+
}
|
|
353
|
+
}
|