@shijiu/jsview-vue 2.2.201 → 2.2.373

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/bin/browser/BrowserApic.vue.mjs +2 -13
  2. package/bin/browser/BrowserApic2.vue.mjs +2 -13
  3. package/bin/browser/BrowserApicLib.mjs +24 -24
  4. package/bin/browser/BrowserAudio.vue.mjs +2 -10
  5. package/bin/browser/BrowserJsvFragShaderView.vue.mjs +21 -5
  6. package/bin/browser/BrowserJsvLatex.vue.mjs +39 -16
  7. package/bin/browser/BrowserPreload.vue.mjs +1 -5
  8. package/bin/browser/BrowserQrcode.vue.mjs +1 -5
  9. package/bin/browser/BrowserSpray.vue.mjs +2 -12
  10. package/bin/browser/BrowserTextureAnim.vue.mjs +2 -12
  11. package/bin/export-sfc.mjs +3 -3
  12. package/bin/jsview-vue-common.mjs +3 -3
  13. package/bin/jsview-vue.mjs +3216 -2086
  14. package/bin/types/JsViewEngineWidget/CheckType.d.ts +4 -0
  15. package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +37 -33
  16. package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +4 -0
  17. package/bin/types/JsViewEngineWidget/JsvFocus/JsvFocusManager.d.ts +15 -2
  18. package/bin/types/JsViewEngineWidget/MetroWidget/Const.d.ts +4 -0
  19. package/bin/types/JsViewEngineWidget/MetroWidget/Dispatcher.d.ts +4 -0
  20. package/bin/types/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +14 -3
  21. package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +280 -3
  22. package/bin/types/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +7 -1
  23. package/bin/types/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +4 -0
  24. package/bin/types/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +4 -0
  25. package/bin/types/JsViewEngineWidget/MetroWidget/Slide.d.ts +4 -0
  26. package/bin/types/JsViewEngineWidget/MetroWidget/SlotComponent.vue.d.ts +4 -0
  27. package/bin/types/JsViewEngineWidget/MetroWidget/VisibleInfo.d.ts +4 -0
  28. package/bin/types/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +4 -0
  29. package/bin/types/JsViewEngineWidget/RangeModel.d.ts +4 -0
  30. package/bin/types/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +4 -0
  31. package/bin/types/JsViewEngineWidget/TemplateParser/Fence.d.ts +4 -0
  32. package/bin/types/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +4 -0
  33. package/bin/types/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +4 -0
  34. package/bin/types/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +4 -0
  35. package/bin/types/JsViewEngineWidget/TemplateParser/index.d.ts +4 -0
  36. package/bin/types/JsViewEngineWidget/WidgetCommon.d.ts +4 -0
  37. package/bin/types/JsViewEngineWidget/index.d.ts +5 -1
  38. package/bin/types/JsViewPlugin/JsvAccount/JsvAccount.d.ts +4 -0
  39. package/bin/types/JsViewPlugin/JsvAudio/AudioProxy.d.ts +4 -0
  40. package/bin/types/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +4 -0
  41. package/bin/types/JsViewPlugin/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +4 -0
  42. package/bin/types/JsViewPlugin/JsvAudio/CheckType.d.ts +4 -0
  43. package/bin/types/JsViewPlugin/JsvAudio/Events.d.ts +4 -0
  44. package/bin/types/JsViewPlugin/JsvAudio/JsvAudio.vue.d.ts +4 -0
  45. package/bin/types/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.d.ts +4 -0
  46. package/bin/types/JsViewPlugin/JsvAudio/JsvAudioProxy.vue.d.ts +4 -0
  47. package/bin/types/JsViewPlugin/JsvAudio/PluginLoader.d.ts +4 -0
  48. package/bin/types/JsViewPlugin/JsvAudio/ScreenLockManager.d.ts +4 -0
  49. package/bin/types/JsViewPlugin/JsvAudio/index.d.ts +4 -0
  50. package/bin/types/JsViewPlugin/JsvAudio/version.d.ts +5 -0
  51. package/bin/types/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +4 -0
  52. package/bin/types/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue.d.ts +4 -0
  53. package/bin/types/JsViewPlugin/JsvLatex/Color.d.ts +4 -0
  54. package/bin/types/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +24 -0
  55. package/bin/types/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +4 -0
  56. package/bin/types/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +4 -0
  57. package/bin/types/JsViewPlugin/JsvLatex/PluginLoader.d.ts +4 -0
  58. package/bin/types/JsViewPlugin/JsvLatex/index.d.ts +5 -0
  59. package/bin/types/JsViewPlugin/JsvLatex/version.d.ts +4 -0
  60. package/bin/types/JsViewPlugin/index.d.ts +4 -0
  61. package/bin/types/JsViewVueTools/ConstSymbol.d.ts +4 -0
  62. package/bin/types/JsViewVueTools/DebugContentShellJBridge.d.ts +4 -0
  63. package/bin/types/JsViewVueTools/DebugTool.d.ts +4 -0
  64. package/bin/types/JsViewVueTools/DefaultKeyMap.d.ts +4 -0
  65. package/bin/types/JsViewVueTools/FeatureActive.d.ts +14 -0
  66. package/bin/types/JsViewVueTools/ForgeConstDefine.d.ts +4 -0
  67. package/bin/types/JsViewVueTools/ForgeHandles.d.ts +7 -3
  68. package/bin/types/JsViewVueTools/JsvDemoTester.d.ts +4 -0
  69. package/bin/types/JsViewVueTools/JsvDynamicCssStyle.d.ts +20 -1
  70. package/bin/types/JsViewVueTools/JsvDynamicKeyFrames.d.ts +21 -2
  71. package/bin/types/JsViewVueTools/JsvFederationTools.d.ts +4 -0
  72. package/bin/types/JsViewVueTools/JsvHashHistory.d.ts +4 -0
  73. package/bin/types/JsViewVueTools/JsvImpactTracer.d.ts +8 -4
  74. package/bin/types/JsViewVueTools/JsvPerformance.d.ts +4 -0
  75. package/bin/types/JsViewVueTools/JsvPreDownloader.d.ts +24 -2
  76. package/bin/types/JsViewVueTools/JsvRefTaker.d.ts +28 -3
  77. package/bin/types/JsViewVueTools/JsvRuntimeBridge.d.ts +50 -0
  78. package/bin/types/JsViewVueTools/JsvStyleClass.d.ts +4 -0
  79. package/bin/types/JsViewVueTools/JsvStyleSheetsDeclarer.d.ts +21 -1
  80. package/bin/types/JsViewVueTools/JsvTextTools.d.ts +85 -27
  81. package/bin/types/JsViewVueTools/JsvTextureDefines.d.ts +4 -0
  82. package/bin/types/JsViewVueTools/JsvTextureLoadTool.d.ts +67 -0
  83. package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.d.ts +4 -0
  84. package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +4 -0
  85. package/bin/types/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +4 -0
  86. package/bin/types/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +4 -0
  87. package/bin/types/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +30 -4
  88. package/bin/types/JsViewVueTools/JsvTextureStore/Store.d.ts +4 -0
  89. package/bin/types/JsViewVueTools/JsvTextureStore/Texture.d.ts +4 -0
  90. package/bin/types/JsViewVueTools/NinePatchHelper.d.ts +5 -1
  91. package/bin/types/JsViewVueTools/TextureManagerTools.d.ts +11 -0
  92. package/bin/types/JsViewVueTools/TypeCheckAndSet.d.ts +4 -0
  93. package/bin/types/JsViewVueTools/index.d.ts +7 -0
  94. package/bin/types/JsViewVueWidget/JsvActorMove/ActorControlBase.d.ts +4 -0
  95. package/bin/types/JsViewVueWidget/JsvActorMove/JsvActorMove.vue.d.ts +38 -0
  96. package/bin/types/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.d.ts +4 -0
  97. package/bin/types/JsViewVueWidget/JsvActorMove/index.d.ts +4 -0
  98. package/bin/types/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue.d.ts +4 -0
  99. package/bin/types/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue.d.ts +27 -0
  100. package/bin/types/JsViewVueWidget/JsvApic/JsvApic/index.d.ts +4 -0
  101. package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +4 -0
  102. package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +28 -0
  103. package/bin/types/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +4 -0
  104. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/ApicDataBase.d.ts +4 -0
  105. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/BrowserApicLib.d.ts +4 -0
  106. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/GifData.d.ts +4 -0
  107. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/NormalLoopTool.d.ts +4 -0
  108. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/PartLoopTool.d.ts +4 -0
  109. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/SingleLoopTool.d.ts +4 -0
  110. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.d.ts +4 -0
  111. package/bin/types/JsViewVueWidget/JsvApic/JsvBrowserApicLib/WebpData.d.ts +4 -0
  112. package/bin/types/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.d.ts +4 -0
  113. package/bin/types/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue.d.ts +4 -0
  114. package/bin/types/JsViewVueWidget/JsvClipDiv/index.d.ts +4 -0
  115. package/bin/types/JsViewVueWidget/JsvConnectLine/ArcLineManager.d.ts +4 -0
  116. package/bin/types/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue.d.ts +21 -0
  117. package/bin/types/JsViewVueWidget/JsvConnectLine/index.d.ts +4 -0
  118. package/bin/types/JsViewVueWidget/JsvDragBox/JsvDragBox.vue.d.ts +109 -0
  119. package/bin/types/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue.d.ts +4 -0
  120. package/bin/types/JsViewVueWidget/JsvDriftScope/index.d.ts +4 -0
  121. package/bin/types/JsViewVueWidget/JsvEnableRenderBreak.vue.d.ts +4 -0
  122. package/bin/types/JsViewVueWidget/JsvFilterView.vue.d.ts +19 -0
  123. package/bin/types/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue.d.ts +34 -0
  124. package/bin/types/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue.d.ts +106 -0
  125. package/bin/types/JsViewVueWidget/JsvFlexCell/index.d.ts +6 -2
  126. package/bin/types/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue.d.ts +6 -0
  127. package/bin/types/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +48 -1
  128. package/bin/types/JsViewVueWidget/JsvFragShaderView/index.d.ts +4 -0
  129. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +4 -0
  130. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.d.ts +4 -0
  131. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.d.ts +4 -0
  132. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue.d.ts +25 -0
  133. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +22 -0
  134. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/NexusNode.d.ts +4 -0
  135. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +4 -0
  136. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +4 -0
  137. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +4 -0
  138. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/SyncLinkManager.d.ts +4 -0
  139. package/bin/types/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +4 -0
  140. package/bin/types/JsViewVueWidget/JsvGrid.vue.d.ts +73 -0
  141. package/bin/types/JsViewVueWidget/JsvHole.d.ts +17 -0
  142. package/bin/types/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +14 -34
  143. package/bin/types/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +48 -0
  144. package/bin/types/JsViewVueWidget/JsvInput/EditVisibleArea.d.ts +27 -0
  145. package/bin/types/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +64 -209
  146. package/bin/types/JsViewVueWidget/JsvInput/SharedDefine.d.ts +17 -0
  147. package/bin/types/JsViewVueWidget/JsvInput/SystemTextTools.d.ts +14 -0
  148. package/bin/types/JsViewVueWidget/JsvInput/index.d.ts +4 -0
  149. package/bin/types/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +20 -0
  150. package/bin/types/JsViewVueWidget/JsvLine/LineManager.d.ts +4 -0
  151. package/bin/types/JsViewVueWidget/JsvLine/index.d.ts +4 -0
  152. package/bin/types/JsViewVueWidget/JsvMarquee.vue.d.ts +21 -0
  153. package/bin/types/JsViewVueWidget/JsvMaskClipDiv.vue.d.ts +20 -0
  154. package/bin/types/JsViewVueWidget/JsvMindMap/Constant.d.ts +4 -0
  155. package/bin/types/JsViewVueWidget/JsvMindMap/DataTree.d.ts +7 -1
  156. package/bin/types/JsViewVueWidget/JsvMindMap/Geometry.d.ts +4 -0
  157. package/bin/types/JsViewVueWidget/JsvMindMap/JsvMindMap.vue.d.ts +90 -0
  158. package/bin/types/JsViewVueWidget/JsvMindMap/index.d.ts +4 -0
  159. package/bin/types/JsViewVueWidget/JsvMindMap/rtree.d.ts +4 -0
  160. package/bin/types/JsViewVueWidget/JsvNativeSharedDiv.vue.d.ts +24 -0
  161. package/bin/types/JsViewVueWidget/JsvNinePatch.vue.d.ts +30 -0
  162. package/bin/types/JsViewVueWidget/JsvPieChart.vue.d.ts +17 -0
  163. package/bin/types/JsViewVueWidget/JsvPosterDiv.vue.d.ts +17 -0
  164. package/bin/types/JsViewVueWidget/JsvPosterImage.vue.d.ts +18 -0
  165. package/bin/types/JsViewVueWidget/JsvPreload/BrowserPreload.vue.d.ts +4 -0
  166. package/bin/types/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +42 -0
  167. package/bin/types/JsViewVueWidget/JsvPreload/index.d.ts +4 -0
  168. package/bin/types/JsViewVueWidget/JsvProgressBar.vue.d.ts +19 -0
  169. package/bin/types/JsViewVueWidget/JsvQrcode/BrowserQrcode.vue.d.ts +4 -0
  170. package/bin/types/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +25 -0
  171. package/bin/types/JsViewVueWidget/JsvQrcode/index.d.ts +4 -0
  172. package/bin/types/JsViewVueWidget/JsvRadarChart.vue.d.ts +24 -0
  173. package/bin/types/JsViewVueWidget/JsvRipple/Constant.d.ts +4 -0
  174. package/bin/types/JsViewVueWidget/JsvRipple/JsvRipple.vue.d.ts +45 -0
  175. package/bin/types/JsViewVueWidget/JsvRipple/index.d.ts +4 -0
  176. package/bin/types/JsViewVueWidget/JsvScaleTextBox.vue.d.ts +18 -0
  177. package/bin/types/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +4 -0
  178. package/bin/types/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue.d.ts +4 -0
  179. package/bin/types/JsViewVueWidget/JsvScrollBox/ScrollInnerSymbol.d.ts +4 -0
  180. package/bin/types/JsViewVueWidget/JsvScrollBox/ScrollSymbol.d.ts +4 -0
  181. package/bin/types/JsViewVueWidget/JsvScrollBox/index.d.ts +4 -0
  182. package/bin/types/JsViewVueWidget/JsvSector.vue.d.ts +18 -0
  183. package/bin/types/JsViewVueWidget/JsvSoundPool.d.ts +42 -0
  184. package/bin/types/JsViewVueWidget/JsvSpray/BrowserSpray.vue.d.ts +4 -0
  185. package/bin/types/JsViewVueWidget/JsvSpray/JsvSpray.vue.d.ts +40 -0
  186. package/bin/types/JsViewVueWidget/JsvSpray/index.d.ts +4 -0
  187. package/bin/types/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.d.ts +4 -0
  188. package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +52 -0
  189. package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +16 -0
  190. package/bin/types/JsViewVueWidget/JsvSpriteAnim/JsvSpriteTools.d.ts +4 -0
  191. package/bin/types/JsViewVueWidget/JsvSpriteAnim/SpriteController.d.ts +4 -0
  192. package/bin/types/JsViewVueWidget/JsvSpriteAnim/index.d.ts +4 -0
  193. package/bin/types/JsViewVueWidget/JsvSpriteAnim/sAnimationToken.d.ts +4 -0
  194. package/bin/types/JsViewVueWidget/JsvSwiper/JsvSwiper.vue.d.ts +39 -0
  195. package/bin/types/JsViewVueWidget/JsvSwiper/index.d.ts +4 -0
  196. package/bin/types/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue.d.ts +24 -0
  197. package/bin/types/JsViewVueWidget/JsvSwiper3D/index.d.ts +4 -0
  198. package/bin/types/JsViewVueWidget/JsvTextBox.vue.d.ts +26 -0
  199. package/bin/types/JsViewVueWidget/JsvTextureAnim/BrowserTextureAnim.vue.d.ts +4 -0
  200. package/bin/types/JsViewVueWidget/JsvTextureAnim/CommonType.d.ts +4 -0
  201. package/bin/types/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +7 -2
  202. package/bin/types/JsViewVueWidget/JsvTextureAnim/index.d.ts +4 -0
  203. package/bin/types/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +100 -0
  204. package/bin/types/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +25 -0
  205. package/bin/types/JsViewVueWidget/JsvVisibleSensor/index.d.ts +4 -0
  206. package/bin/types/JsViewVueWidget/index.d.ts +6 -0
  207. package/bin/types/index.d.ts +4 -0
  208. package/index.d.ts +8 -0
  209. package/package.json +1 -1
  210. package/tools/config/toolkit.mjs +81 -0
  211. package/tools/config/tsconfig.json +1 -0
  212. package/tools/config/vite.config.ts +24 -14
  213. package/tools/jsview-vue-build.mjs +66 -21
  214. package/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue +6 -2
  215. package/utils/JsViewEngineWidget/JsvFocus/JsvFocusManager.ts +22 -3
  216. package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +3 -1
  217. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +12 -5
  218. package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +208 -84
  219. package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +15 -9
  220. package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +2 -2
  221. package/utils/JsViewPlugin/JsvAudio/version.js +1 -1
  222. package/utils/JsViewPlugin/JsvAudio/version.mjs +1 -1
  223. package/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.js +13 -3
  224. package/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue +27 -6
  225. package/utils/JsViewPlugin/JsvLatex/JsvLatex.vue +34 -28
  226. package/utils/JsViewPlugin/JsvLatex/index.js +22 -0
  227. package/utils/JsViewVueTools/FeatureActive.ts +84 -0
  228. package/utils/JsViewVueTools/ForgeHandles.ts +7 -3
  229. package/utils/JsViewVueTools/JsvDynamicCssStyle.js +2 -0
  230. package/utils/JsViewVueTools/JsvDynamicKeyFrames.ts +2 -0
  231. package/utils/JsViewVueTools/JsvImpactTracer.js +2 -0
  232. package/utils/JsViewVueTools/JsvPreDownloader.ts +2 -1
  233. package/utils/JsViewVueTools/JsvRefTaker.js +1 -2
  234. package/utils/JsViewVueTools/JsvRuntimeBridge.js +67 -1
  235. package/utils/JsViewVueTools/JsvStyleClass.js +2 -0
  236. package/utils/JsViewVueTools/JsvStyleSheetsDeclarer.js +2 -0
  237. package/utils/JsViewVueTools/JsvTextTools.ts +223 -0
  238. package/utils/JsViewVueTools/JsvTextureLoadTool.ts +233 -0
  239. package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +4 -1
  240. package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +7 -3
  241. package/utils/JsViewVueTools/JsvTextureStore/Texture.ts +1 -0
  242. package/utils/JsViewVueTools/TextureManagerTools.ts +17 -0
  243. package/utils/JsViewVueTools/index.js +3 -0
  244. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +2 -0
  245. package/utils/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue +10 -2
  246. package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +12 -1
  247. package/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue +4 -2
  248. package/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue +2 -0
  249. package/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue +219 -0
  250. package/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue +11 -9
  251. package/utils/JsViewVueWidget/JsvFilterView.vue +2 -0
  252. package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +5 -2
  253. package/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue +145 -0
  254. package/utils/JsViewVueWidget/JsvFlexCell/index.js +2 -5
  255. package/utils/JsViewVueWidget/JsvFragShaderView/BrowserJsvFragShaderView.vue +39 -12
  256. package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +210 -62
  257. package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +9 -0
  258. package/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue +2 -0
  259. package/utils/JsViewVueWidget/JsvGrid.vue +2 -0
  260. package/utils/JsViewVueWidget/JsvHole.js +2 -0
  261. package/utils/JsViewVueWidget/JsvInput/Cursor.vue +49 -45
  262. package/utils/JsViewVueWidget/JsvInput/EditViewOperator.ts +320 -0
  263. package/utils/JsViewVueWidget/JsvInput/EditVisibleArea.ts +222 -0
  264. package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +281 -681
  265. package/utils/JsViewVueWidget/JsvInput/SharedDefine.ts +17 -0
  266. package/utils/JsViewVueWidget/JsvInput/SystemTextTools.ts +47 -0
  267. package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +2 -0
  268. package/utils/JsViewVueWidget/JsvMarquee.vue +2 -0
  269. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +2 -0
  270. package/utils/JsViewVueWidget/JsvMindMap/DataTree.ts +14 -1
  271. package/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue +277 -117
  272. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +91 -68
  273. package/utils/JsViewVueWidget/JsvNinePatch.vue +5 -0
  274. package/utils/JsViewVueWidget/JsvPieChart.vue +2 -0
  275. package/utils/JsViewVueWidget/JsvPosterDiv.vue +2 -0
  276. package/utils/JsViewVueWidget/JsvPosterImage.vue +2 -0
  277. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +2 -0
  278. package/utils/JsViewVueWidget/JsvProgressBar.vue +2 -0
  279. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +10 -11
  280. package/utils/JsViewVueWidget/JsvRadarChart.vue +2 -0
  281. package/utils/JsViewVueWidget/JsvRipple/Constant.js +2 -2
  282. package/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue +3 -1
  283. package/utils/JsViewVueWidget/JsvScaleTextBox.vue +2 -0
  284. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue +9 -0
  285. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue +9 -0
  286. package/utils/JsViewVueWidget/JsvSector.vue +2 -0
  287. package/utils/JsViewVueWidget/JsvSoundPool.js +2 -0
  288. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +30 -13
  289. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -0
  290. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue +2 -0
  291. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +2 -0
  292. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +2 -0
  293. package/utils/JsViewVueWidget/JsvTextBox.vue +2 -4
  294. package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +44 -41
  295. package/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue +101 -0
  296. package/utils/JsViewVueWidget/JsvVideo.vue +2 -2
  297. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +2 -0
  298. package/utils/JsViewVueWidget/index.js +2 -0
  299. package/utils/JsViewVueTools/JsvTextTools.js +0 -89
@@ -0,0 +1,17 @@
1
+ import { Forge } from "@shijiu/jsview/dom/jsv-forge-define.mjs";
2
+
3
+ export const InputType = {
4
+ TEXT: Forge.TextInputType.TEXT,
5
+ NUMBER: Forge.TextInputType.NUMBER,
6
+ PASSWORD: Forge.TextInputType.PASSWORD,
7
+ };
8
+
9
+ export declare interface FontStyleDefine {
10
+ fontSize: number,
11
+ fontFamily: string,
12
+ textAlign: string,
13
+ fontStyle: string,
14
+ fontWeight: string
15
+ }
16
+
17
+ export const MAX_WIDTH = 2000;
@@ -0,0 +1,47 @@
1
+ import { TextTools, getTextWidth } from "../../JsViewVueTools/JsvTextTools"
2
+ import { MAX_WIDTH } from "./SharedDefine";
3
+
4
+ declare interface FontStyleDefine {
5
+ fontSize: number,
6
+ fontFamily: string,
7
+ textAlign: string,
8
+ fontStyle: string,
9
+ fontWeight: string
10
+ }
11
+
12
+ // 获取单行输入框光标所在位置
13
+ export function calculateCursorPosition(
14
+ display_text: string,
15
+ cursor_offset: number,
16
+ rect_width: number,
17
+ rect_height: number,
18
+ line_height: number,
19
+ font_style: FontStyleDefine) {
20
+
21
+ const target_str = display_text;
22
+ const font_params = _getPackedFontParams(font_style);
23
+ const max_width = MAX_WIDTH; // 最大宽度为1920*2, 根据texture的最大宽度设定
24
+ const text_attr = TextTools.PackTextAttrs("none", "none");
25
+ const cur_pos = TextTools.GetCursorPosition(
26
+ target_str,
27
+ { width: rect_width, height: rect_height },
28
+ font_params,
29
+ text_attr,
30
+ line_height,
31
+ cursor_offset
32
+ );
33
+ return cur_pos.x;
34
+ }
35
+
36
+ export function getTextDisplayWidth(text: string, font_style: FontStyleDefine) {
37
+ return getTextWidth(text, font_style);
38
+ }
39
+
40
+ function _getPackedFontParams(font_style: FontStyleDefine): any {
41
+ const size = font_style.fontSize ? font_style.fontSize : 12;
42
+ const font = font_style.fontFamily;
43
+ const alignment = font_style.textAlign;
44
+ const italic = font_style.fontStyle === "italic";
45
+ const bold = font_style.fontWeight === "bold";
46
+ return TextTools.PackFontParams(font!, size, bold, italic, alignment!, null)
47
+ }
@@ -1,4 +1,6 @@
1
1
  <!--
2
+ * @file
3
+ *
2
4
  * 【模块 export 内容】
3
5
  * JsvLine:Vue高阶组件,用于划线。支持横线、竖线和斜线。
4
6
  * props说明:(注意:全部属性非响应式, 需要变更时用 key 来触发重绘)
@@ -1,4 +1,6 @@
1
1
  <!--
2
+ * @file
3
+ *
2
4
  * 【模块 export 内容】
3
5
  * JsvMarquee:Vue高阶组件,文字跑马灯
4
6
  * props说明:
@@ -1,4 +1,6 @@
1
1
  <!--
2
+ * @file
3
+ *
2
4
  *
3
5
  * JsvMaskClipDiv:蒙版遮罩处理组件
4
6
  * props说明:
@@ -2,6 +2,8 @@ import { Rect, Line } from "./Geometry";
2
2
  import * as CONST from "./Constant"
3
3
  import { Direction } from "./CommonType";
4
4
  import { opposite } from "./Geometry";
5
+ import { computed } from "vue"
6
+ import { ForgeConst } from "../../JsViewVueTools/ForgeConstDefine";
5
7
 
6
8
  type MoveType = "star" | "layer" | "inherit"
7
9
  const NO_NEIGHBOR = Symbol("noNeighbor");
@@ -40,12 +42,13 @@ export class DataNode {
40
42
  bottom: null,
41
43
  }
42
44
 
43
- constructor(rect: Rect, depth: number, id: string, data: any, moveType: MoveType = "inherit") {
45
+ constructor(rect: Rect, depth: number, id: string, data: any, moveType: MoveType = "inherit", enableTap: boolean = false) {
44
46
  this.rect = rect;
45
47
  this.depth = depth;
46
48
  this.customerData = data;
47
49
  this.moveType = moveType;
48
50
  this.customerId = id;
51
+ this.enableTap = enableTap;
49
52
  }
50
53
 
51
54
  //>>>>为了对接rtree库>>>>
@@ -349,6 +352,11 @@ export class DataNode {
349
352
  private focused: boolean = false;
350
353
  private divRef: any = null;
351
354
  private lineStyle: any = null;
355
+ public enableTap: boolean = false;
356
+
357
+ public onTap = computed(() => {
358
+ return this.enableTap ? this.onClick.bind(this) : null;
359
+ });
352
360
 
353
361
  public setLineStyle(style: any) {
354
362
  this.lineStyle = style;
@@ -384,6 +392,11 @@ export class DataNode {
384
392
  if (this.focused) {
385
393
  this.customerListener.onFocus?.();
386
394
  }
395
+
396
+ if (this.enableTap && divRef) {
397
+ const divView = (divRef as any).jsvGetProxyView();
398
+ divView.DragEnables?.(ForgeConst.DragFlags.TOUCH_RECV_CLICK_BIT); // 只激活tap
399
+ }
387
400
  } else if (this.divRef != null && !divRef) {
388
401
  // unmounted
389
402
  this.divRef = null;
@@ -5,88 +5,96 @@
5
5
  -->
6
6
 
7
7
  <!--
8
- [界面概述]
9
- 思维导图控件
10
-
11
- [控件介绍]
12
- JsvMindMap:
13
- props:
14
- name: {string} 焦点name
15
- provideData: {function} 提供数据的函数
16
- width: {number} 组件宽
17
- height: {number} 组件高
18
- formatNode: {function} 接受数据, 返回标准格式节点信息的函数
19
- {
20
- left: number, left(必需)
21
- top: number, top(必需)
22
- width: number, width(必需)
23
- height: number, height(必需)
24
- id: string, 节点的唯一id(必需)
25
- childrenList: Array<any>, 子数据列表
26
- moveType: "star" | "layer" | "inherit", 节点布局类型(可选)
27
- lineStyle: object 此节点线的style
28
- {
29
- lineWidth: number, 线宽
30
- backgroundColor: string, 线的颜色(与backgroundImage互斥)
31
- backgroundImage: string, 线的图片(与backgroundColor互斥)
32
- borderRadius: string | number, 线的圆角设置
33
- }
34
- }
35
- left: {number} 组件left
36
- top: {number} 组件top
37
- slideAnim: {object} 滚动动画设置, { duration: number, easing?: string }, duration为毫秒
38
- onEdge: {function} 到达边缘回调
39
- focusRectPadding: {number} 焦点区域内边距
40
- renderRectMargin: {number} 描画区域外边距
41
- methods:
42
- getCurFocusNode
43
- @description 获取当前焦点的数据
44
- @return {object} 当前焦点节点的数据
45
- getCurFocusId
46
- @description 获取当前焦点的id
47
- @return {string} 当前节点的id
48
- getCurVisibleRect
49
- @description 获取当前的可视区域
50
- @return {object} 可视区域{x: number, y: number, width: number, height: number}
51
- slideTo
52
- @description 滚动到指定位置
53
- @params {int} x x坐标
54
- @params {int} y y坐标
55
- @params {object} animInfo 动画设置, 为null时不做动画. {duration: number, easing: string, onEnd: function}
56
- setFocusTo
57
- @description 设置焦点
58
- @params {string} id 目标节点的id
59
- @params {boolean} needSlide 是否需要滚动
60
- @params {object} animInfo 滚动动画设置
61
- moveInItem
62
- @description 把指定节点移入焦点区域
63
- @params {string} id 目标节点的id
64
- @params {object} animInfo 动画信息
65
- moveFocus
66
- @description 往指定方向移动焦点
67
- @params {string} direction 移动方向 "left" | "top" | "right" | "bottom"
68
- getEntireTreeBoundingSize
69
- @description 获取整个树的包围框宽高
70
- @return {object} 宽高 {width: number, height: number}
71
- refreshData
72
- @description 刷新数据
73
-
74
- [额外说明]
75
- 1. 焦点移动逻辑
76
- 每个节点首先有个父方向, 若父节点是star模式, 则父方向由父节点相对位置决定, 若父节点是layer模式, 则父方向为父节点子方向的反向
77
- layer模式的节点, 有一个子方向, 其子方向是所有子所在的一侧方向(只有上下左右四侧), 若无子, 则父方向的反向为子方向. 确定了父方向和子方向后, 剩余两个方向则寻找该方向最近的兄弟节点, 若无则寻找最近分支上最近的同级或者叶节点
78
- star模式的节点, 除了父方向, 剩余三个方向均寻找相应方向的最近子节点, 若未找到则按layer寻找兄弟节点相同的逻辑寻找同级节点
8
+ * @file
9
+ *
10
+ * [界面概述]
11
+ * 思维导图控件
12
+ *
13
+ * [控件介绍]
14
+ * JsvMindMap:
15
+ * props:
16
+ * name: {string} 焦点name
17
+ * provideData: {function} 提供数据的函数
18
+ * width: {number} 组件宽
19
+ * height: {number} 组件高
20
+ * formatNode: {function} 接受数据, 返回标准格式节点信息的函数
21
+ * {
22
+ * left: number, left(必需)
23
+ * top: number, top(必需)
24
+ * width: number, width(必需)
25
+ * height: number, height(必需)
26
+ * id: string, 节点的唯一id(必需)
27
+ * childrenList: Array<any>, 子数据列表
28
+ * moveType: "star" | "layer" | "inherit", 节点布局类型(可选)
29
+ * lineStyle: object 此节点线的style
30
+ * {
31
+ * lineWidth: number, 线宽
32
+ * backgroundColor: string, 线的颜色(与backgroundImage互斥)
33
+ * backgroundImage: string, 线的图片(与backgroundColor互斥)
34
+ * borderRadius: string | number, 线的圆角设置
35
+ * }
36
+ * enableTap: boolean, 是否支持点击
37
+ * }
38
+ * left: {number} 组件left
39
+ * top: {number} 组件top
40
+ * slideAnim: {object} 滚动动画设置, { duration: number, easing?: string }, duration为毫秒
41
+ * onEdge: {function} 到达边缘回调
42
+ * focusRectPadding: {number} 焦点区域内边距
43
+ * renderRectMargin: {number} 描画区域外边距
44
+ * methods:
45
+ * getCurFocusNode
46
+ * @description 获取当前焦点的数据
47
+ * @return {object} 当前焦点节点的数据
48
+ * getCurFocusId
49
+ * @description 获取当前焦点的id
50
+ * @return {string} 当前节点的id
51
+ * getCurVisibleRect
52
+ * @description 获取当前的可视区域
53
+ * @return {object} 可视区域{x: number, y: number, width: number, height: number}
54
+ * slideTo
55
+ * @description 滚动到指定位置
56
+ * @params {int} x x坐标
57
+ * @params {int} y y坐标
58
+ * @params {object} animInfo 动画设置, 为null时不做动画. {duration: number, easing: string, onEnd: function}
59
+ * setFocusTo
60
+ * @description 设置焦点
61
+ * @params {string} id 目标节点的id
62
+ * @params {boolean} needSlide 是否需要滚动
63
+ * @params {object} animInfo 滚动动画设置
64
+ * moveInItem
65
+ * @description 把指定节点移入焦点区域
66
+ * @params {string} id 目标节点的id
67
+ * @params {object} animInfo 动画信息
68
+ * moveFocus
69
+ * @description 往指定方向移动焦点
70
+ * @params {string} direction 移动方向 "left" | "top" | "right" | "bottom"
71
+ * getEntireTreeBoundingSize
72
+ * @description 获取整个树的包围框宽高
73
+ * @return {object} 宽高 {width: number, height: number}
74
+ * refreshData
75
+ * @description 刷新数据
76
+ * setSensor {(callback: ({left: number, top: number}) => void, sensitivity: number) => void}
77
+ * 设置运动后触发的回调, sensitivity为回调敏感度, 每移动多少像素进行回调,适当放大(推荐10以上)可以极大减小对js回调过多引起的性能降低
78
+ *
79
+ * [额外说明]
80
+ * 1. 焦点移动逻辑
81
+ * 每个节点首先有个父方向, 若父节点是star模式, 则父方向由父节点相对位置决定, 若父节点是layer模式, 则父方向为父节点子方向的反向
82
+ * layer模式的节点, 有一个子方向, 其子方向是所有子所在的一侧方向(只有上下左右四侧), 若无子, 则父方向的反向为子方向. 确定了父方向和子方向后, 剩余两个方向则寻找该方向最近的兄弟节点, 若无则寻找最近分支上最近的同级或者叶节点
83
+ * star模式的节点, 除了父方向, 剩余三个方向均寻找相应方向的最近子节点, 若未找到则按layer寻找兄弟节点相同的逻辑寻找同级节点
79
84
  -->
80
85
  <script setup>
81
- import { ref, shallowRef, reactive } from "vue";
86
+ import { ref, shallowRef, reactive, computed, onMounted } from "vue";
82
87
  import { DataNode } from "./DataTree";
83
88
  import { Rect, opposite } from "./Geometry";
84
89
  import RBush from "./rtree.js";
85
90
  import { EdgeDirection } from "../../JsViewEngineWidget/WidgetCommon";
86
91
  import JsvLine from "../JsvLine";
92
+ import JsvDragBox from "../JsvDragBox/JsvDragBox.vue";
93
+ import ActorControl from "../JsvFreeMoveActor/ActorControl.ts";
94
+ import { ForgeConst } from "../../JsViewVueTools/ForgeConstDefine.ts";
87
95
 
88
96
  const TAG = "JsvMindMap";
89
- const dirMap = {
97
+ const dirMap = {
90
98
  37: "left",
91
99
  38: "top",
92
100
  39: "right",
@@ -180,8 +188,25 @@ const props = defineProps({
180
188
  type: Number,
181
189
  default: 100,
182
190
  },
191
+ touchFlag: {
192
+ /*
193
+ * 触控模式
194
+ * 0: 关闭
195
+ * 1: 支持拖拽
196
+ */
197
+ type: Number,
198
+ default: 0,
199
+ },
183
200
  });
184
201
 
202
+ const enableTouch = computed(() => {
203
+ return props.touchFlag == 1;
204
+ });
205
+
206
+ const KEY_MODE = 1;
207
+ const TOUCH_MODE = 2;
208
+ let mode = KEY_MODE;
209
+
185
210
  let rootNode = null;
186
211
  const currentFocusId = ref(0);
187
212
  let preFocusNode = null;
@@ -200,6 +225,8 @@ const slideAnimInfo = {
200
225
  };
201
226
  const viewPortRect = new Rect(0, 0, widgetWidth, widgetHeight); // 组件的可视范围
202
227
 
228
+ let actorController = null;
229
+
203
230
  // 描画范围
204
231
  const getRenderRect = () => {
205
232
  return new Rect(
@@ -236,7 +263,8 @@ const buildNode = (root, data) => {
236
263
  depth,
237
264
  formatedData.id,
238
265
  data,
239
- formatedData.moveType ?? "layer"
266
+ formatedData.moveType ?? "layer",
267
+ formatedData.enableTap ?? false
240
268
  );
241
269
  dataNode.setLineStyle(formatedData.lineStyle ?? defaultLineStyle);
242
270
  if (root == null) {
@@ -252,7 +280,20 @@ const buildNode = (root, data) => {
252
280
  }
253
281
  };
254
282
 
283
+ const locateDivWidth = ref(0);
284
+ const locateDivHeight = ref(0);
285
+
255
286
  //构建树
287
+ let boundingBox = new Rect(0, 0, 0, 0);
288
+ function updateBoundingBox(rTreeRect) {
289
+ boundingBox.x = rTreeRect.minX;
290
+ boundingBox.y = rTreeRect.minY;
291
+ boundingBox.width = rTreeRect.maxX - rTreeRect.minX + 1;
292
+ boundingBox.height = rTreeRect.maxY - rTreeRect.minY + 1;
293
+ locateDivWidth.value = boundingBox.right + 100;
294
+ locateDivHeight.value = boundingBox.bottom + 100;
295
+ }
296
+
256
297
  const buildTree = () => {
257
298
  //clean old tree
258
299
  rootNode = null;
@@ -264,6 +305,7 @@ const buildTree = () => {
264
305
  allNodeList.forEach((i) => i.calculateMoveInfo());
265
306
  rTree = new RBush();
266
307
  allNodeList.forEach((node) => rTree.insert(node));
308
+ updateBoundingBox(rTree.data);
267
309
 
268
310
  //线的处理必须在moveInfo计算完成后处理
269
311
  for (let i = 1; i < allNodeList.length; ++i) {
@@ -356,46 +398,48 @@ const focusToNext = (keyCode) => {
356
398
  }
357
399
  };
358
400
 
401
+ let preLeft = viewPortRect.x;
402
+ let preTop = viewPortRect.y;
359
403
  const locateDivPos = reactive({
360
404
  left: viewPortRect.x,
361
405
  top: viewPortRect.y,
362
406
  });
363
407
 
408
+ function updateVisibielPosition(info) {
409
+ viewPortRect.x = info.x;
410
+ viewPortRect.y = info.y;
411
+ preLeft = locateDivPos.left;
412
+ preTop = locateDivPos.top;
413
+ locateDivPos.left = -viewPortRect.x;
414
+ locateDivPos.top = -viewPortRect.y;
415
+ visibleListStore.setCurList(rTree.search(getRenderRect()));
416
+ }
417
+
364
418
  const moveTo = (info, animInfo) => {
365
419
  if (!info) return;
366
420
  //info: {left: number, top: number} 新的focusRect的x, y
367
421
  if (info.x != viewPortRect.x || info.y != viewPortRect.y) {
368
- viewPortRect.x = info.x;
369
- viewPortRect.y = info.y;
370
- const preLeft = locateDivPos.left,
371
- preTop = locateDivPos.top;
372
- locateDivPos.left = -viewPortRect.x;
373
- locateDivPos.top = -viewPortRect.y;
374
-
375
- visibleListStore.setCurList(rTree.search(getRenderRect()));
422
+ updateVisibielPosition(info);
376
423
 
377
424
  if (animInfo && !isNaN(animInfo.duration)) {
378
- const forgeAnim = new Forge.TranslateAnimation(
379
- preLeft - locateDivPos.left,
380
- 0,
381
- preTop - locateDivPos.top,
382
- 0,
383
- animInfo.duration,
384
- animInfo.easing
385
- );
386
- forgeAnim.SetAnimationListener(
387
- new Forge.AnimationListener(
388
- null,
389
- () => {
390
- updateVisible(visibleListStore.getCur());
391
- animInfo.onEnd?.();
392
- },
393
- null
394
- )
395
- );
396
- locateDiv.value?.jsvGetProxyView(true).StartAnimation(forgeAnim);
425
+ let deltaX = locateDivPos.left - preLeft;
426
+ let deltaY = locateDivPos.top - preTop;
427
+ let frameNum = (60 * animInfo.duration) / 1000;
428
+ let edgeX = Math.abs(deltaX) > 1e-2 ? locateDivPos.left : undefined;
429
+ let edgeY = Math.abs(deltaY) > 1e-2 ? locateDivPos.top : undefined;
430
+ let speedX = Math.abs(deltaX) > 1e-2 ? Math.abs(deltaX) / frameNum : undefined;
431
+ let speedY = Math.abs(deltaY) > 1e-2 ? Math.abs(deltaY) / frameNum : undefined;
432
+ actorController.run((cmds) => [
433
+ cmds.action().moveTo(edgeX, edgeY, speedX, speedY, () => {
434
+ updateVisible(visibleListStore.getCur());
435
+ animInfo.onEnd?.();
436
+ }),
437
+ ]);
397
438
  updateVisible(visibleListStore.getTmp());
398
439
  } else {
440
+ actorController.run((cmds) => [
441
+ cmds.action().teleportTo(locateDivPos.left, locateDivPos.top),
442
+ ]);
399
443
  updateVisible(visibleListStore.getCur());
400
444
  }
401
445
  }
@@ -446,7 +490,23 @@ const focusBlockOnBlur = () => {
446
490
  curFocusNode?.onBlur();
447
491
  };
448
492
 
493
+ function findVisibleFocusNode() {
494
+ if (
495
+ curFocusNode !== null &&
496
+ renderNodeList.value.find((item) => item.idToken == curFocusNode.idToken)
497
+ ) {
498
+ return curFocusNode;
499
+ } else {
500
+ return renderNodeList.value[0];
501
+ }
502
+ }
503
+
449
504
  const onKeyDown = (ev) => {
505
+ if (mode == TOUCH_MODE) {
506
+ curFocusNode = findVisibleFocusNode();
507
+ mode = KEY_MODE;
508
+ return true;
509
+ }
450
510
  switch (ev.keyCode) {
451
511
  case 37:
452
512
  case 38:
@@ -464,18 +524,6 @@ const onKeyDown = (ev) => {
464
524
  }
465
525
  };
466
526
 
467
- //init
468
- {
469
- buildTree();
470
- //初始焦点放置在屏幕中间
471
- const center = curFocusNode.rect.center;
472
- const viewPortPos = {
473
- x: Math.round(center.x - viewPortRect.width / 2),
474
- y: Math.round(center.y - viewPortRect.height / 2),
475
- };
476
- moveTo(viewPortPos);
477
- }
478
-
479
527
  // expose methos
480
528
  /**
481
529
  * 获取当前获焦的节点
@@ -577,6 +625,111 @@ const refreshData = () => {
577
625
  moveTo(viewPortPos);
578
626
  };
579
627
 
628
+ /* touch */
629
+ function getDragBoxRect() {
630
+ return new Rect(
631
+ Math.min(viewPortRect.width - locateDivWidth.value, 0),
632
+ Math.min(viewPortRect.height - locateDivHeight.value, 0),
633
+ Math.max(
634
+ viewPortRect.width - locateDivWidth.value,
635
+ locateDivWidth.value - viewPortRect.width
636
+ ),
637
+ Math.max(
638
+ viewPortRect.height - locateDivHeight.value,
639
+ locateDivHeight.value - viewPortRect.height
640
+ )
641
+ );
642
+ }
643
+ function onTouchDown() {
644
+ mode = TOUCH_MODE;
645
+ // console.log("mindmap onTouchDown");
646
+ }
647
+ function onTouchRelease() {
648
+ // console.log("mindmap onTouchRelease");
649
+ }
650
+ function onDragStart() {
651
+ // console.log("mindmap onDragStart");
652
+ }
653
+ function onDragEnd(pos) {
654
+ // console.log("mindmap onDragEnd");
655
+ onSensor(pos);
656
+ }
657
+ const WALL_GROUP_ID = 1;
658
+ function setDragWall(wallInfo) {
659
+ actorController.run((cmds) => [
660
+ cmds
661
+ .condition(WALL_GROUP_ID, true)
662
+ .boxPosition(wallInfo.left, wallInfo.top, wallInfo.right, wallInfo.bottom)
663
+ .then([cmds.state().setHitWallOverflow()]),
664
+ ]);
665
+ }
666
+ const SENSOR_GROUP_ID = 2;
667
+ let customOnSensor = null;
668
+ function onSensor(pos) {
669
+ updateVisibielPosition({
670
+ x: -pos.xPos,
671
+ y: -pos.yPos,
672
+ });
673
+ updateVisible(visibleListStore.getCur());
674
+ customOnSensor?.({
675
+ left: pos.xPos,
676
+ top: pos.yPos,
677
+ });
678
+ }
679
+ let sensitivityCache = 0;
680
+ function innerSetSensor(s = 10) {
681
+ sensitivityCache = s;
682
+ actorController.run((cmds) => [
683
+ cmds.state().removeConditionByGroup(SENSOR_GROUP_ID),
684
+ cmds
685
+ .condition(SENSOR_GROUP_ID, true)
686
+ .onMovement(s) // 默认设置x或y移动超过10时才触发回调,以此减少回调的频次,规避js的性能影响
687
+ .then([onSensor]),
688
+ ]);
689
+ }
690
+ function initTouch() {
691
+ console.log("initTouch");
692
+ const divView = locateDiv.value.jsvGetProxyView();
693
+ divView.DragEnables?.(
694
+ ForgeConst.DragFlags.TOUCH_RECV_MOVE_BIT |
695
+ ForgeConst.DragFlags.TOUCH_RECV_FIRST_START |
696
+ ForgeConst.DragFlags.TOUCH_RECV_LAST_END
697
+ ); // 激活 Move | TouchDown | TouchEnd
698
+ // touch callback
699
+ actorController.run((cmds) => [
700
+ cmds.condition(undefined, true).onTouchDown().then([onTouchDown]),
701
+ cmds.condition(undefined, true).onDragStart().then([onDragStart]),
702
+ cmds.condition(undefined, true).onDragEnd().then([onDragEnd]),
703
+ cmds.condition(undefined, true).onTouchRelease().then([onTouchRelease]),
704
+ ]);
705
+ // wall condition
706
+ const wallBox = getDragBoxRect();
707
+ setDragWall(wallBox);
708
+ innerSetSensor();
709
+ }
710
+
711
+ //init
712
+ function init() {
713
+ buildTree();
714
+ //初始焦点放置在屏幕中间
715
+ const center = curFocusNode.rect.center;
716
+ const viewPortPos = {
717
+ x: Math.round(center.x - viewPortRect.width / 2),
718
+ y: Math.round(center.y - viewPortRect.height / 2),
719
+ };
720
+ moveTo(viewPortPos);
721
+ if (enableTouch.value) {
722
+ initTouch();
723
+ }
724
+ }
725
+
726
+ function setSensor(callback, sensitivity = 10) {
727
+ if (sensitivity !== sensitivityCache) {
728
+ innerSetSensor(sensitivity);
729
+ }
730
+ customOnSensor = callback;
731
+ }
732
+
580
733
  const exposeObj = {
581
734
  getCurFocusNode,
582
735
  getCurFocusId,
@@ -587,9 +740,17 @@ const exposeObj = {
587
740
  moveFocus,
588
741
  getEntireTreeBoundingSize,
589
742
  refreshData,
743
+ setSensor,
590
744
  };
591
745
  defineExpose(exposeObj);
592
746
 
747
+ onMounted(() => {
748
+ actorController = new ActorControl();
749
+ const divView = locateDiv.value.jsvGetProxyView();
750
+ actorController.bindForgeView(divView, true);
751
+ init();
752
+ });
753
+
593
754
  //debug code
594
755
  // window.rTree = rTree;
595
756
  // window.dataTree = rootNode;
@@ -609,10 +770,8 @@ defineExpose(exposeObj);
609
770
  <div
610
771
  ref="locateDiv"
611
772
  :style="{
612
- left: locateDivPos.left,
613
- top: locateDivPos.top,
614
- width: viewPortRect.width,
615
- height: viewPortRect.height,
773
+ width: locateDivWidth,
774
+ height: locateDivHeight,
616
775
  }"
617
776
  >
618
777
  <slot name="background"></slot>
@@ -640,6 +799,7 @@ defineExpose(exposeObj);
640
799
  width: item.rect.width,
641
800
  height: item.rect.height,
642
801
  }"
802
+ @click="item.onTap.value"
643
803
  >
644
804
  <slot
645
805
  :data="item.customerData"