@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
@@ -1,33 +1,8 @@
1
- <!--
2
- * @Author: ChenChanghua
3
- * @Date: 2022-01-20 10:35:56
4
- * @LastEditTime: 2023-02-01 13:47:26
5
- * @Description: file content
6
- -->
7
1
  <script>
8
- import { EdgeDirection } from "../../JsViewEngineWidget";
9
- import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
10
- import CursorVue from "./Cursor.vue";
11
-
12
- const InputType = {
13
- TEXT: Forge.TextInputType.TEXT,
14
- NUMBER: Forge.TextInputType.NUMBER,
15
- PASSWORD: Forge.TextInputType.PASSWORD,
16
- };
17
- const ifDigital = (char) =>
18
- "0".charCodeAt() <= char.charCodeAt() &&
19
- char.charCodeAt() <= "9".charCodeAt();
20
- const ifDirectionKeyCode = (code) => code >= 37 && code <= 40;
21
- const edgeMap = {
22
- 37: EdgeDirection.left,
23
- 38: EdgeDirection.top,
24
- 39: EdgeDirection.right,
25
- 40: EdgeDirection.bottom,
26
- };
27
- const MAX_WIDTH = 1920;
28
- /*
2
+ /**
3
+ * @file
29
4
  * JsvInput:文字的输入控件
30
- * props说明:
5
+ * @props 说明:
31
6
  * left {number} 组件的x
32
7
  * top {number} 组件的y
33
8
  * width {number} 组件的宽
@@ -35,7 +10,7 @@ const MAX_WIDTH = 1920;
35
10
  * type Input.type.TEXT 若为number类型,则输入时,非number无法输入
36
11
  * placeholder {string} 文字颜色值为灰色,默认值为"请输入文字"
37
12
  * placeholderColor {string} 默认文字颜色,默认值为灰色
38
- * maxLength {number} 最大字符长度, 默认100,支持单行最大宽度为1920*2,
13
+ * maxLength {number} 最大字符长度, 默认100,支持单行最大宽度为1920*2,
39
14
  * fontsize为30,则字数大约为1920*2/30 = 100个左右
40
15
  * readonly {bool} 属性规定输入字段是只读的, 默认false
41
16
  * value {string} 输入的字符串
@@ -49,11 +24,15 @@ const MAX_WIDTH = 1920;
49
24
  * onEdge {function} 方向键到达边缘回调
50
25
  * @oarams edge_info 边缘信息
51
26
  * {
52
- * direction: EdgeDirection,
27
+ * direction: EdgeDirection,
53
28
  * rect: {x: value,y: value, widht: value,height: value}
54
29
  * }
55
30
  * onTextChange {function} 文字改动回调
56
31
  * @params string 当前文字
32
+ * onBackKey {function} 收到返回键时的决策,根据返回值决定是吞掉还是放过,
33
+ * 返回true时可以规避ime显示后有时会吐出返回键导致整体退出的问题
34
+ * @params isUp {boolean} 是down(false)还是up(true)
35
+ * @return {boolean}
57
36
  *
58
37
  * InputDispatcher dispatch支持事件:
59
38
  * add
@@ -62,698 +41,319 @@ const MAX_WIDTH = 1920;
62
41
  * public methods:
63
42
  * add
64
43
  * @description 添加文字
65
- @params {String} string 添加文字
44
+ * @params {String} string 添加文字
66
45
  * delete
67
- @description 删除文字
46
+ * @description 删除文字
68
47
  * clear
69
- @description 清空文字
48
+ * @description 清空文字
70
49
  */
71
-
50
+ import { InputType } from "./SharedDefine";
72
51
  export { InputType };
73
- export default {
74
- components: {
75
- CursorVue,
52
+ </script>
53
+
54
+ <script setup>
55
+ import { EdgeDirection } from "../../JsViewEngineWidget";
56
+ import CursorVue from "./Cursor.vue";
57
+ import { watchEffect, computed, onMounted, onUnmounted, shallowRef } from "vue";
58
+ import { EditViewOperator } from "./EditViewOperator";
59
+
60
+ const rProps = defineProps({
61
+ name: {
62
+ type: String,
76
63
  },
77
- props: {
78
- name: {
79
- type: String,
80
- },
81
- left: {
82
- type: Number,
83
- default: 0,
84
- },
85
- top: {
86
- type: Number,
87
- default: 0,
88
- },
89
- width: {
90
- type: Number,
91
- default: 100,
92
- },
93
- height: {
94
- type: Number,
95
- default: 20,
96
- },
97
- type: {
98
- type: Number,
99
- default: InputType.TEXT,
100
- },
101
- placeholder: {
102
- type: String,
103
- default: "请输入",
104
- },
105
- placeholderColor: {
106
- type: String,
107
- default: "#CDCCD6",
108
- },
109
- maxLength: {
110
- type: Number,
111
- default: 100,
112
- },
113
- readonly: {
114
- type: Boolean,
115
- default: false,
116
- },
117
- value: {
118
- type: String,
119
- default: "",
120
- },
121
- fontStyle: {
122
- type: [Object, Array],
123
- default() {
124
- return {
125
- textAlign: "left",
126
- fontSize: 12,
127
- color: "#000000",
128
- };
129
- },
130
- },
131
- cursorShow: {
132
- type: Boolean,
133
- default: true,
134
- },
135
- cursorWidth: {
136
- type: Number,
137
- default: 2,
138
- },
139
- cursorColor: {
140
- type: String,
141
- default: "",
142
- },
143
- onTextOverflow: {
144
- type: Function,
145
- },
146
- onTextChange: {
147
- type: Function,
148
- },
149
- onEdge: {
150
- type: Function,
151
- },
64
+ left: {
65
+ type: Number,
66
+ default: 0,
152
67
  },
153
- data() {
154
- return {
155
- fullString: this.value,
156
- curOffset: this.value.length,
157
- textWidth: 0,
158
- textLeft: 0,
159
- };
68
+ top: {
69
+ type: Number,
70
+ default: 0,
160
71
  },
161
- setup() {
162
- return {
163
- editControlView: null,
164
- editControlViewId: -1,
165
- isFocus: false,
166
- visibleAreaCurStart: 0,
167
- visibleAreaCurPos: 0,
168
- visibleAreaCurEnd: 0,
169
- cursorPauseTimeoutToken: -1,
170
- };
72
+ width: {
73
+ type: Number,
74
+ default: 100,
171
75
  },
172
- computed: {
173
- realText() {
174
- return this.type === InputType.PASSWORD
175
- ? this.fullString.replace(/\w/g, "*")
176
- : this.fullString;
177
- },
178
- placeholderVisible() {
179
- return this.fullString.length === 0 && this.placeholder.length > 0;
180
- },
181
- cursorLeft() {
182
- return (
183
- this._calculateCursorPosition(this.realText, this.curOffset) +
184
- this.textLeft
185
- );
186
- },
187
- cursorColorInner() {
188
- return this.cursorColor ? this.cursorColor : this.fontStyle.color;
189
- },
76
+ height: {
77
+ type: Number,
78
+ default: 20,
190
79
  },
191
- methods: {
192
- _updateTextWidth(text) {
193
- if (text.length !== this.fullString.length) {
194
- if (text.length === 0) {
195
- this.textWidth = this.width;
196
- } else {
197
- this.textWidth = this._calculateCursorPosition(text, text.length);
198
- if (this.textWidth < this.width) {
199
- this.textWidth = this.width;
200
- }
201
- }
202
- }
203
- },
204
-
205
- _onTextChanged(text, cursor_pos, moved) {
206
- if (moved) {
207
- // 移动时,光标不闪烁
208
- this.pauseCursorBlink();
209
- } else {
210
- if (text.length >= this.maxLength) {
211
- text = this.fullString;
212
- if (this.editControlView && this.isFocus) {
213
- this.editControlView.updateCursorOffset(
214
- this.fullString,
215
- this.curOffset
216
- );
217
- }
218
- return;
219
- }
220
- }
221
- if (text.length > 0) {
222
- const start = cursor_pos - 1;
223
- const end = cursor_pos;
224
- const add_text = text.slice(start, end);
225
- if (
226
- add_text &&
227
- !ifDigital(add_text) &&
228
- this.type === InputType.NUMBER
229
- ) {
230
- // console.log(
231
- // `onTextChanged add text failed, add_text:${add_text}, when input type is number!`
232
- // );
233
- if (this.editControlView) {
234
- this.editControlView.updateCursorOffset(
235
- this.fullString,
236
- this.curOffset
237
- );
238
- }
239
- return;
240
- }
241
- }
242
-
243
- this._updateTextWidth(text);
244
- this.textLeft = this._calculateSlide(
245
- this.fullString,
246
- text,
247
- cursor_pos,
248
- moved
249
- );
250
- this.fullString = text;
251
- this.curOffset = cursor_pos;
252
- this.onTextChange?.(text);
253
- },
254
-
255
- // 1:shown 0:hidden
256
- _onStatusChanged(status) {
257
- // console.log("OnStatusChanged status", status);
258
- },
259
-
260
- _getStringWithFont(str) {
261
- const size = this.fontStyle.fontSize ? this.fontStyle.fontSize : 12;
262
- const font = this.fontStyle.fontFamily;
263
- const alignment = this.fontStyle.textAlign;
264
- const italic = this.fontStyle.fontStyle === "italic";
265
- const bold = this.fontStyle.fontWeight === "bold";
266
- return Forge.sTextUtils.StringWithFont(
267
- str,
268
- size,
269
- font,
270
- alignment,
271
- "middle",
272
- null,
273
- italic,
274
- bold
275
- );
276
- },
277
- _getFullStringLength(str) {
278
- return Forge.sTextUtils.GetTextWidth(this._getStringWithFont(str));
279
- },
280
-
281
- add(string) {
282
- if (this.type === InputType.NUMBER && !ifDigital(string)) {
283
- // console.log(`The input data:${string} is not number`);
284
- return;
285
- }
286
- const pre_full_str = this.fullString;
287
- const pre_index = this.curOffset;
288
- if (this.fullString.length < this.maxLength) {
289
- const new_str =
290
- pre_full_str.slice(0, pre_index) +
291
- string +
292
- pre_full_str.slice(pre_index);
293
- const new_index = pre_index + string.length;
294
- this._onTextChanged(new_str, new_index);
295
- } else {
296
- if (this.onTextOverflow) {
297
- this.onTextOverflow();
298
- }
299
- }
300
- },
301
-
302
- delete() {
303
- const pre_full_str = this.fullString;
304
- const pre_index = this.curOffset;
305
- if (pre_index > 0) {
306
- const new_str =
307
- pre_full_str.slice(0, pre_index - 1) + pre_full_str.slice(pre_index);
308
- const new_index = pre_index - 1;
309
- this._onTextChanged(new_str, new_index);
310
- }
311
- },
312
-
313
- clear() {
314
- this._onTextChanged("", 0);
315
- },
316
-
317
- replace(string) {
318
- this._onTextChanged(string, string.length);
319
- },
320
-
321
- _calculateCursorPosition(full_str, cursor_offset) {
322
- const target_str = this._GetRealText(full_str);
323
- const font_params = this._getStringWithFont(target_str);
324
- const max_width = MAX_WIDTH; // 最大宽度为1920*2, 根据texture的最大宽度设定
325
- const max_rect = new Forge.RectArea(0, 0, max_width, this.height);
326
- const text_attr = Forge.sTextUtils.TextAttr("none", "none");
327
- const cur_pos = Forge.sTextUtils.GetCursorPosition(
328
- target_str,
329
- max_rect,
330
- font_params,
331
- text_attr,
332
- this.height,
333
- cursor_offset
334
- );
335
- return cur_pos.x;
336
- },
337
-
338
- _getLeftWithDelChar(current_cursor_position, target_str) {
339
- let new_left = this.textLeft;
340
- let offset = 0;
341
- if (current_cursor_position === 0) {
342
- offset = -new_left;
343
- new_left = 0;
344
- } else if (
345
- current_cursor_position - this.cursorWidth > 0 &&
346
- current_cursor_position - this.cursorWidth <= this.visibleAreaCurStart
347
- ) {
348
- offset = this.visibleAreaCurPos - current_cursor_position;
349
- if (new_left < 0 && new_left + offset + this.textWidth < this.width) {
350
- // 删除字符时,可视区域内字符串显示不全,对left做调整
351
- offset = this.width - (new_left + this.textWidth);
352
- }
353
- new_left += offset;
354
- if (new_left > 0) {
355
- new_left = 0;
356
- } else {
357
- if (this.fontStyle.textAlign === "right") {
358
- const text_real_width = this._getFullStringLength(target_str);
359
- if (new_left > text_real_width - MAX_WIDTH) {
360
- new_left = text_real_width - MAX_WIDTH;
361
- offset = this.visibleAreaCurStart + new_left;
362
- }
363
- }
364
- }
365
- } else {
366
- if (new_left < 0 && new_left + this.textWidth < this.width) {
367
- // 删除字符时,可视区域内字符串显示不全,对left做调整
368
- offset = this.width - (new_left + this.textWidth);
369
- new_left = this.width - this.textWidth;
370
- } else {
371
- if (this.fontStyle.textAlign === "right") {
372
- const text_real_width = this._getFullStringLength(target_str);
373
- if (text_real_width >= this.width) {
374
- if (new_left > text_real_width - MAX_WIDTH) {
375
- new_left = text_real_width - MAX_WIDTH;
376
- offset = this.visibleAreaCurStart + new_left;
377
- }
378
- } else {
379
- new_left = this.width - MAX_WIDTH;
380
- offset = this.visibleAreaCurStart + new_left;
381
- }
382
- }
383
- }
384
- }
385
-
386
- this._updateVisibleAreaCursor(-offset);
387
- // console.log(` _getLeftWithDelChar2 target_str:${target_str}, new_left:${new_left}, this.textWidth:${this.textWidth}`);
388
-
389
- return new_left;
390
- },
391
-
392
- _getLeftWithMoveRight() {
393
- let new_left = this.textLeft;
394
- let offset = this.width / 2;
395
- // 边界检测
396
- if (this.textWidth + (new_left - offset) < this.width) {
397
- new_left = this.width - this.textWidth;
398
- offset = -new_left - this.visibleAreaCurStart;
399
- } else {
400
- new_left -= offset;
401
- }
402
-
403
- this._updateVisibleAreaCursor(offset);
404
- return new_left;
405
- },
406
-
407
- _getLeftWithMoveLeft() {
408
- let new_left = this.textLeft;
409
- let offset = this.width / 2;
410
- new_left += offset;
411
- // 边界检测
412
- if (new_left > 0) {
413
- new_left = 0;
414
- offset = this.visibleAreaCurStart;
415
- } else {
416
- if (this.fontStyle.textAlign === "right") {
417
- const text_real_width = this._getFullStringLength(
418
- this._GetShowText()
419
- );
420
- if (new_left > text_real_width - MAX_WIDTH) {
421
- new_left = text_real_width - MAX_WIDTH;
422
- offset = this.visibleAreaCurStart + new_left;
423
- }
424
- }
425
- }
426
- this._updateVisibleAreaCursor(-offset);
427
- return new_left;
428
- },
429
-
430
- _updateVisibleAreaCursor(offset) {
431
- this.visibleAreaCurStart += offset;
432
- if (this.visibleAreaCurStart < 0) {
433
- this.visibleAreaCurStart = 0;
434
- }
435
- this.visibleAreaCurEnd = this.visibleAreaCurStart + this.width;
436
- },
437
-
438
- _getLeftWithAddChar(current_cursor_position, end_add) {
439
- let new_left = this.textLeft;
440
- if (
441
- current_cursor_position + this.cursorWidth >=
442
- this.visibleAreaCurEnd
443
- ) {
444
- let offset = current_cursor_position - this.visibleAreaCurPos;
445
- new_left -= offset;
446
- if (end_add) {
447
- // 尾部追加,对齐坐标
448
- if (this.fontStyle.textAlign === "right") {
449
- new_left = this.width - MAX_WIDTH;
450
- offset = -this.visibleAreaCurStart - new_left;
451
- } else {
452
- new_left = this.width - this.textWidth;
453
- offset = -this.visibleAreaCurStart - new_left;
454
- }
455
- }
456
-
457
- this._updateVisibleAreaCursor(offset);
458
- }
459
-
460
- return new_left;
461
- },
462
-
463
- _calculateSlide(pre_str, target_str, cur_index, moved) {
464
- if (target_str.length === 0) {
465
- if (this.fontStyle.textAlign === "right") {
466
- const offset = MAX_WIDTH - this.width - this.visibleAreaCurStart;
467
- this._updateVisibleAreaCursor(offset);
468
- this.visibleAreaCurPos = this.visibleAreaCurEnd;
469
- return this.width - MAX_WIDTH;
470
- }
471
- const offset = -this.visibleAreaCurStart;
472
- this._updateVisibleAreaCursor(offset);
473
- this.visibleAreaCurPos = this.visibleAreaCurEnd;
474
- return 0;
475
- }
476
-
477
- let new_left = this.textLeft;
478
- const current_cursor_position = this._calculateCursorPosition(
479
- target_str,
480
- cur_index
481
- );
482
- let option_mode = "op_vis_normal"; // 可视区域内移动
483
- // 计算模式
484
- if (pre_str.length > target_str.length) {
485
- option_mode = "op_del"; // 字符删除
486
- } else if (pre_str.length < target_str.length) {
487
- option_mode = "op_add"; // 字符追加
488
- } else {
489
- if (moved) {
490
- if (current_cursor_position <= this.visibleAreaCurStart) {
491
- option_mode = "op_move_left"; // 边界左移动
492
- } else if (current_cursor_position >= this.visibleAreaCurEnd) {
493
- option_mode = "op_move_right"; // 边界右移动
494
- }
495
- }
496
- }
497
-
498
- // 根据用户动作,区分计算方法
499
- switch (option_mode) {
500
- case "op_del":
501
- new_left = this._getLeftWithDelChar(
502
- current_cursor_position,
503
- target_str
504
- );
505
- break;
506
- case "op_add":
507
- new_left = this._getLeftWithAddChar(
508
- current_cursor_position,
509
- target_str.length === cur_index
510
- );
511
- break;
512
- case "op_move_left":
513
- new_left = this._getLeftWithMoveLeft(current_cursor_position);
514
- break;
515
- case "op_move_right":
516
- new_left = this._getLeftWithMoveRight(current_cursor_position);
517
- break;
518
- case "op_vis_normal":
519
- default:
520
- break;
521
- }
522
-
523
- // 更新可视区域光标位置
524
- this.visibleAreaCurPos = current_cursor_position;
525
- return new_left;
526
- },
527
-
528
- onFocus() {
529
- // console.log("Input Focus");
530
- this.isFocus = true;
531
- this.$refs.cursor?.startBlink();
532
- if (this.editControlView && !this.readonly) {
533
- this.editControlView.showIme(
534
- this.type,
535
- this.fullString,
536
- this.curOffset
537
- );
538
- }
539
- },
540
-
541
- onBlur() {
542
- this.isFocus = false;
543
- // console.log("Input Blur");
544
- if (this.editControlView && !this.readonly) {
545
- this.editControlView.hideIme();
546
- }
547
- },
548
-
549
- clearCursorPauseTimer() {
550
- if (this.cursorPauseTimeoutToken) {
551
- clearTimeout(this.cursorPauseTimeoutToken);
552
- this.cursorPauseTimeoutToken = -1;
553
- }
554
- },
555
- pauseCursorBlink() {
556
- if (this.$refs.cursor) {
557
- this.$refs.cursor?.stopBlink(true);
558
- }
559
- this.clearCursorPauseTimer();
560
- this.cursorPauseTimeoutToken = setTimeout(() => {
561
- this.$refs.cursor?.startBlink();
562
- }, 500);
563
- },
564
- onKeyDown(keyEvent) {
565
- let key_used = false;
566
- let pre_index = this.curOffset;
567
- let cur_index;
568
- let valid_move = false;
569
-
570
- switch (keyEvent.keyCode) {
571
- case 37: // left
572
- this.pauseCursorBlink();
573
- if (pre_index !== 0) {
574
- valid_move = true;
575
- cur_index = --pre_index;
576
- key_used = true;
577
- }
578
- break;
579
- case 39: // right
580
- this.pauseCursorBlink();
581
- if (pre_index < this.fullString.length) {
582
- valid_move = true;
583
- cur_index = ++pre_index;
584
- key_used = true;
585
- }
586
- break;
587
- case 38: // up
588
- case 40: // down
589
- break;
590
- case 13:
591
- // 显示键盘
592
- this.editControlView.showIme(
593
- this.type,
594
- this.fullString,
595
- this.curOffset
596
- );
597
- key_used = true;
598
- break;
599
- case 27:
600
- case 10000:
601
- //返回键吐出
602
- key_used = false;
603
- break;
604
- default:
605
- // 浏览器中,点击浏览器时input焦点丢失,JsvInput收到任意按键获取焦点
606
- if (!window.JsView) {
607
- // 显示键盘
608
- this.editControlView.showIme(
609
- this.type,
610
- this.fullString,
611
- this.curOffset
612
- );
613
- key_used = true;
614
- }
615
- break;
616
- }
617
-
618
- if (ifDirectionKeyCode(keyEvent.keyCode)) {
619
- if (valid_move) {
620
- this.curOffset = cur_index;
621
- this.textLeft = this._calculateSlide(
622
- this.fullString,
623
- this.fullString,
624
- cur_index,
625
- true
626
- );
627
- if (this.editControlView) {
628
- this.editControlView.updateCursorOffset(this.fullString, cur_index);
629
- }
630
- } else {
631
- if (this.onEdge && edgeMap[keyEvent.keyCode]) {
632
- this.onEdge({
633
- direction: edgeMap[keyEvent.keyCode],
634
- rect: {
635
- x: this.left,
636
- y: this.top,
637
- width: this.width,
638
- height: this.height,
639
- },
640
- });
641
- // if (!on_edged && !window.JsView) {
642
- // // 重获焦点
643
- // this.editControlView.showIme(
644
- // this.type,
645
- // this.fullString,
646
- // this.curOffset
647
- // );
648
- // }
649
- }
650
- }
651
- }
652
- return key_used;
653
- },
654
- _GetRealText(src_str) {
655
- let value = src_str;
656
- if (this.type === Forge.TextInputType.PASSWORD) {
657
- // password
658
- value = value.replace(/\w/g, "*");
659
- }
660
-
661
- return value;
662
- },
663
- _GetShowText() {
664
- return this._GetRealText(this.fullString);
80
+ type: {
81
+ type: Number,
82
+ default: InputType.TEXT,
83
+ },
84
+ placeholder: {
85
+ type: String,
86
+ default: "请输入",
87
+ },
88
+ placeholderColor: {
89
+ type: String,
90
+ default: "#CDCCD6",
91
+ },
92
+ maxLength: {
93
+ type: Number,
94
+ default: 100,
95
+ },
96
+ readonly: {
97
+ type: Boolean,
98
+ default: false,
99
+ },
100
+ value: {
101
+ type: String,
102
+ default: "",
103
+ },
104
+ fontStyle: {
105
+ type: [Object, Array],
106
+ default() {
107
+ return {
108
+ textAlign: "left",
109
+ fontSize: 12,
110
+ color: "#000000",
111
+ };
665
112
  },
666
113
  },
667
- created() {
668
- this.editControlView = new Forge.EditControlView();
669
- this.editControlView.OnTextChanged = this._onTextChanged;
670
- this.editControlView.OnStatusChanged = this._onStatusChanged;
671
-
672
- this.editControlViewId = Forge.sViewStore.add(
673
- new Forge.ViewInfo(this.editControlView)
674
- );
675
- const cur_position = this._calculateCursorPosition(
676
- this.value,
677
- this.value.length
678
- );
679
- this.visibleAreaCurEnd =
680
- cur_position > this.width ? cur_position : this.width; // 可视区域光标结束位置,当光标位置超出这个范围,则更新start&end,并更新text left
681
- this.visibleAreaCurStart = this.visibleAreaCurEnd - this.width; // 可视区域光标起始位置
682
- this.visibleAreaCurPos = cur_position;
683
-
684
- // 文字的描画长度,默认为可视区域的长度
685
- // 文字内容变化时,文字显示宽度变化,最小为可视区域的长度
686
- this.textWidth = cur_position > this.width ? cur_position : this.width;
687
- this.textLeft = this._calculateSlide("", this.value, this.value.length);
114
+ cursorShow: {
115
+ type: Boolean,
116
+ default: true,
688
117
  },
689
- mounted() {
690
- this.$refs.cursor?.startBlink();
118
+ cursorWidth: {
119
+ type: Number,
120
+ default: 2,
691
121
  },
692
- beforeUnmount() {
693
- if (this.editControlViewId != -1) {
694
- Forge.sViewStore.remove(this.editControlViewId);
695
- this.editControlViewId = -1;
696
- }
697
- this.clearCursorPauseTimer();
122
+ cursorColor: {
123
+ type: String,
124
+ default: "",
125
+ },
126
+ onTextOverflow: {
127
+ type: Function,
128
+ },
129
+ onTextChange: {
130
+ type: Function,
698
131
  },
132
+ onEdge: {
133
+ type: Function,
134
+ },
135
+ onBackKey: {
136
+ Type: Function,
137
+ },
138
+ });
139
+
140
+ let rCursorRef = shallowRef(null);
141
+ let rInputFinalText = shallowRef("");
142
+ let rInputFinalTextLenth = shallowRef(0);
143
+ let rTextPosLeft = shallowRef(0);
144
+ let rCursorLeft = shallowRef(0);
145
+
146
+ function _OnTextChanged(input_final_text, dsp_text) {
147
+ console.log(
148
+ "_OnTextChanged input_final_text=" +
149
+ input_final_text +
150
+ " dsp_text=" +
151
+ dsp_text
152
+ );
153
+ rInputFinalText.value = dsp_text;
154
+ rInputFinalTextLenth.value = dsp_text.length;
155
+ }
156
+
157
+ function _OnCursorPositionChanged(text_left, cursor_left) {
158
+ console.log(
159
+ "_OnCursorPositionChanged text_left=" +
160
+ text_left +
161
+ " cursor_left=" +
162
+ cursor_left
163
+ );
164
+ rTextPosLeft.value = text_left;
165
+ rCursorLeft.value = cursor_left + text_left;
166
+ }
167
+
168
+ // 创建Forge的EditView控制处理
169
+ let cEditViewOperator = new EditViewOperator(
170
+ _OnTextChanged,
171
+ _OnCursorPositionChanged,
172
+ rProps.onTextOverflow
173
+ );
174
+ let vEditViewInnerId = cEditViewOperator.generateView(); // 建立Forge.EditView
175
+ cEditViewOperator.updateInputConfig(
176
+ rProps.width,
177
+ rProps.height,
178
+ rProps.cursorWidth,
179
+ rProps.fontStyle,
180
+ rProps.type,
181
+ rProps.maxLength,
182
+ rProps.readonly
183
+ );
184
+
185
+ function _FocusBlockOnFocus() {
186
+ cEditViewOperator.updateFocus(true);
187
+ }
188
+
189
+ function _FocusBlockOnBlur() {
190
+ cEditViewOperator.updateFocus(false);
191
+ }
192
+
193
+ // 按键处理
194
+ const fncIfDirectionKeyCode = (code) => code >= 37 && code <= 40;
195
+ const cEdgeMap = {
196
+ 37: EdgeDirection.left,
197
+ 38: EdgeDirection.top,
198
+ 39: EdgeDirection.right,
199
+ 40: EdgeDirection.bottom,
699
200
  };
201
+ function _FocusBlockOnKeyDown(keyEvent) {
202
+ let key_used = false;
203
+ let valid_move = false;
204
+
205
+ switch (keyEvent.keyCode) {
206
+ case 37: // left
207
+ valid_move = cEditViewOperator.moveCursorOffset(-1);
208
+ key_used = true;
209
+ break;
210
+ case 39: // right
211
+ valid_move = cEditViewOperator.moveCursorOffset(1);
212
+ key_used = true;
213
+ break;
214
+ case 38: // up
215
+ case 40: // down
216
+ break;
217
+ case 13:
218
+ // 显示键盘
219
+ cEditViewOperator.showSoftIme();
220
+ key_used = true;
221
+ break;
222
+ case 27:
223
+ case 10000:
224
+ //返回键吐出
225
+ key_used = !!rProps.onBackKey?.(false);
226
+ break;
227
+ default:
228
+ // 浏览器中,点击浏览器时input焦点丢失,JsvInput收到任意按键获取焦点
229
+ if (!window.JsView) {
230
+ // 显示键盘
231
+ cEditViewOperator.showSoftIme();
232
+ key_used = true;
233
+ }
234
+ break;
235
+ }
236
+
237
+ if (fncIfDirectionKeyCode(keyEvent.keyCode) && !valid_move) {
238
+ // 跳出当前输入框
239
+ if (rProps.onEdge && cEdgeMap[keyEvent.keyCode]) {
240
+ rProps.onEdge({
241
+ direction: cEdgeMap[keyEvent.keyCode],
242
+ rect: {
243
+ x: rProps.left,
244
+ y: rProps.top,
245
+ width: rProps.width,
246
+ height: rProps.height,
247
+ },
248
+ });
249
+ }
250
+ }
251
+ return key_used;
252
+ }
253
+
254
+ function _FocusBlockOnKeyUp(ev) {
255
+ if (keyEvent.keyCode == 10000) {
256
+ return !!rProps.onBackKey?.(true);
257
+ }
258
+
259
+ return false;
260
+ }
261
+
262
+ const rPlaceholderVisible = computed(() => {
263
+ return rInputFinalTextLenth.length === 0 && rProps.placeholder.length > 0;
264
+ });
265
+
266
+ const rCursorColorInner = computed(() => {
267
+ return rProps.cursorColor ? rProps.cursorColor : rProps.fontStyle.color;
268
+ });
269
+
270
+ // rProps.text改动跟进
271
+ watchEffect(() => {
272
+ cEditViewOperator.replaceText(rProps.text);
273
+ });
274
+
275
+ onMounted(() => {
276
+ cEditViewOperator.setCursorRef(rCursorRef.value);
277
+ });
278
+
279
+ onUnmounted(() => {
280
+ cEditViewOperator.onUnmounted();
281
+ vEditViewInnerId = -1;
282
+ cEditViewOperator.setCursorRef(null);
283
+ cEditViewOperator = null;
284
+ });
285
+
286
+ defineExpose({
287
+ add: (text) => {
288
+ cEditViewOperator?.addText(text);
289
+ },
290
+ delete: () => {
291
+ cEditViewOperator?.deleteText();
292
+ },
293
+ clear: () => {
294
+ cEditViewOperator?.clearText();
295
+ },
296
+ replace: (text) => {
297
+ cEditViewOperator?.replaceText(text);
298
+ },
299
+ });
700
300
  </script>
701
301
 
702
302
  <template>
703
303
  <jsv-focus-block
704
- :name="name"
304
+ :name="rProps.name"
705
305
  :onAction="{
706
- onFocus: onFocus,
707
- onBlur: onBlur,
708
- onKeyDown: onKeyDown
306
+ onFocus: _FocusBlockOnFocus,
307
+ onBlur: _FocusBlockOnBlur,
308
+ onKeyDown: _FocusBlockOnKeyDown,
309
+ onKeyUp: _FocusBlockOnKeyUp,
709
310
  }"
710
311
  :style="{
711
- left: left,
712
- top: top,
713
- width: width,
714
- height: height,
312
+ left: rProps.left,
313
+ top: rProps.top,
314
+ width: rProps.width,
315
+ height: rProps.height,
715
316
  }"
716
317
  >
717
318
  <div
718
319
  :style="{
719
- width: width,
720
- height: height,
320
+ width: rProps.width,
321
+ height: rProps.height,
721
322
  overflow: 'hidden',
722
323
  }"
723
324
  >
724
325
  <div
725
326
  :style="{
726
- left: this.textLeft,
727
- width: this.textWidth,
728
- height: height,
729
- lineHeight: height,
730
- ...this.fontStyle,
327
+ left: rTextPosLeft,
328
+ height: rProps.height,
329
+ lineHeight: rProps.height,
330
+ ...rProps.fontStyle,
731
331
  }"
732
332
  >
733
- {{ realText }}
333
+ {{ rInputFinalText }}
734
334
  </div>
735
335
  <div
736
- v-if="placeholderVisible"
336
+ v-if="rPlaceholderVisible"
737
337
  :style="{
738
338
  left: 0,
739
- width: width,
740
- height: height,
741
- lineHeight: height,
742
- ...fontStyle,
743
- color: placeholderColor,
339
+ width: rProps.width,
340
+ height: rProps.height,
341
+ lineHeight: rProps.height,
342
+ ...rProps.fontStyle,
343
+ color: rProps.placeholderColor,
744
344
  }"
745
345
  >
746
- {{ placeholder }}
346
+ {{ rProps.placeholder }}
747
347
  </div>
748
348
  </div>
749
349
  <cursor-vue
750
- v-if="cursorShow"
751
- ref="cursor"
752
- :left="cursorLeft"
753
- :height="height"
754
- :color="cursorColorInner"
755
- :width="cursorWidth"
350
+ v-if="rProps.cursorShow"
351
+ ref="rCursorRef"
352
+ :left="rCursorLeft"
353
+ :height="rProps.height"
354
+ :color="rCursorColorInner"
355
+ :width="rProps.cursorWidth"
756
356
  />
757
- <div :data-jsv-vw-innerview="editControlViewId" />
357
+ <div :data-jsv-vw-innerview="vEditViewInnerId" />
758
358
  </jsv-focus-block>
759
- </template>
359
+ </template>