@shijiu/jsview-vue 2.3.151-test.0 → 3.0.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.
Files changed (244) hide show
  1. package/bin/browser/BrowserAudio.mjs +200 -0
  2. package/bin/browser/BrowserJsvLatex.mjs +61 -0
  3. package/bin/export-sfc.mjs +8 -9
  4. package/bin/jsview-vue-common.mjs +9 -35
  5. package/bin/jsview-vue.mjs +22246 -23643
  6. package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue.d.ts +9 -71
  7. package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.d.ts +18 -2
  8. package/bin/types/utils/JsViewEngineWidget/MetroWidget/Const.d.ts +4 -1
  9. package/bin/types/utils/JsViewEngineWidget/MetroWidget/DebugFrame.vue.d.ts +10 -7
  10. package/bin/types/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +19 -178
  11. package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +19 -178
  12. package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +24 -3
  13. package/bin/types/utils/JsViewEngineWidget/MetroWidget/PageUpdater.d.ts +7 -1
  14. package/bin/types/utils/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +25 -5
  15. package/bin/types/utils/JsViewEngineWidget/MetroWidget/SlotComponent.vue.d.ts +9 -47
  16. package/bin/types/utils/JsViewEngineWidget/MetroWidget/TaskManager.d.ts +2 -1
  17. package/bin/types/utils/JsViewEngineWidget/MetroWidget/Utils.d.ts +2 -0
  18. package/bin/types/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.d.ts +1 -1
  19. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue.d.ts +40 -0
  20. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.d.ts +24 -0
  21. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.d.ts +19 -0
  22. package/bin/types/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.d.ts +42 -0
  23. package/bin/types/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.d.ts +2 -1
  24. package/bin/types/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.d.ts +2 -1
  25. package/bin/types/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.d.ts +6 -4
  26. package/bin/types/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.d.ts +9 -7
  27. package/bin/types/utils/JsViewEngineWidget/WidgetCommon.d.ts +17 -7
  28. package/bin/types/utils/JsViewEngineWidget/index.d.ts +3 -1
  29. package/bin/types/utils/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue.d.ts +140 -7
  30. package/bin/types/utils/JsViewPlugin/JsvAudio/BrowserAudio/JsvSystemAudio.vue.d.ts +12 -11
  31. package/bin/types/utils/JsViewPlugin/JsvAudio/Events.d.ts +10 -10
  32. package/bin/types/utils/JsViewPlugin/JsvAudio/JsvAudio.vue.d.ts +204 -17
  33. package/bin/types/utils/JsViewPlugin/JsvAudio/JsvAudioProxy.vue.d.ts +2 -1
  34. package/bin/types/utils/JsViewPlugin/JsvAudio/version.d.mts +11 -11
  35. package/bin/types/utils/JsViewPlugin/JsvAudio/version.d.ts +11 -11
  36. package/bin/types/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.d.ts +0 -1
  37. package/bin/types/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue.d.ts +75 -12
  38. package/bin/types/utils/JsViewPlugin/JsvLatex/GetVersion.d.ts +14 -0
  39. package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +88 -13
  40. package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.d.ts +1 -0
  41. package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue.d.ts +5 -1
  42. package/bin/types/utils/JsViewPlugin/JsvLatex/version.d.mts +39 -12
  43. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMedia.d.ts +120 -17
  44. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.d.ts +62 -0
  45. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue.d.ts +108 -29
  46. package/bin/types/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer-0.9.vue.d.ts → JsvPlayerBrowser-0.9.vue.d.ts} +8 -7
  47. package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-wasm.vue.d.ts +614 -0
  48. package/bin/types/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer.vue.d.ts → JsvPlayerBrowser.vue.d.ts} +36 -34
  49. package/bin/types/utils/JsViewPlugin/JsvPlayer/index-0.9.d.ts +89 -30
  50. package/bin/types/utils/JsViewPlugin/JsvPlayer/index.d.ts +89 -30
  51. package/bin/types/utils/JsViewPlugin/JsvPlayer/version.d.mts +11 -11
  52. package/bin/types/utils/JsViewVueTools/BlobApi.d.ts +38 -0
  53. package/bin/types/utils/JsViewVueTools/DebugTool.d.ts +1 -1
  54. package/bin/types/utils/JsViewVueTools/DefaultKeyMap.d.ts +7 -7
  55. package/bin/types/utils/JsViewVueTools/FeatureActive.d.ts +1 -0
  56. package/bin/types/utils/JsViewVueTools/JsvInteractionMode.d.ts +6 -0
  57. package/bin/types/utils/JsViewVueTools/JsvRuntimeBridge.d.ts +3 -3
  58. package/bin/types/utils/JsViewVueTools/JsvTextTools.d.ts +1 -0
  59. package/bin/types/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.d.ts +43 -0
  60. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.d.ts +1 -0
  61. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.d.ts +54 -0
  62. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +13 -0
  63. package/bin/types/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.d.ts +2 -0
  64. package/bin/types/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +76 -26
  65. package/bin/types/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.d.ts +49 -0
  66. package/bin/types/utils/JsViewVueTools/JsvTextureStore/index.d.ts +2 -0
  67. package/bin/types/utils/JsViewVueTools/index.d.ts +4 -1
  68. package/bin/types/utils/JsViewVueWidget/Jsv3dDiv.vue.d.ts +10 -98
  69. package/bin/types/utils/JsViewVueWidget/Jsv3dStage.vue.d.ts +10 -114
  70. package/bin/types/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue.d.ts +20 -61
  71. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic/BrowserApic.vue.d.ts +44 -13
  72. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic/JsvApic.vue.d.ts +12 -11
  73. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic/index.d.ts +5 -5
  74. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue.d.ts +16 -10
  75. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue.d.ts +21 -17
  76. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +19 -16
  77. package/bin/types/utils/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.d.ts +7 -7
  78. package/bin/types/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue.d.ts +12 -66
  79. package/bin/types/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue.d.ts +73 -12
  80. package/bin/types/utils/JsViewVueWidget/JsvDashPath.vue.d.ts +59 -10
  81. package/bin/types/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue.d.ts +41 -81
  82. package/bin/types/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue.d.ts +17 -100
  83. package/bin/types/utils/JsViewVueWidget/JsvEnableRenderBreak.vue.d.ts +13 -50
  84. package/bin/types/utils/JsViewVueWidget/JsvFilterView.vue.d.ts +50 -70
  85. package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue.d.ts +32 -68
  86. package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvFullScrAdjust.vue.d.ts +57 -74
  87. package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue.d.ts +41 -71
  88. package/bin/types/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue.d.ts +83 -14
  89. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.d.ts +151 -18
  90. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +79 -83
  91. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/JsvFreeMoveActor.vue.d.ts +70 -0
  92. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.d.ts +20 -0
  93. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.d.ts +108 -5
  94. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +88 -3
  95. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/index.d.ts +6 -1
  96. package/bin/types/utils/JsViewVueWidget/JsvGrid.vue.d.ts +19 -18
  97. package/bin/types/utils/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +34 -11
  98. package/bin/types/utils/JsViewVueWidget/JsvInput/EditViewOperator.d.ts +4 -1
  99. package/bin/types/utils/JsViewVueWidget/JsvInput/JsvInput.vue.d.ts +193 -6
  100. package/bin/types/utils/JsViewVueWidget/JsvLine/JsvLine.vue.d.ts +54 -11
  101. package/bin/types/utils/JsViewVueWidget/JsvMarquee.vue.d.ts +89 -11
  102. package/bin/types/utils/JsViewVueWidget/JsvMaskClipDiv.vue.d.ts +9 -8
  103. package/bin/types/utils/JsViewVueWidget/JsvMindMap/Geometry.d.ts +2 -2
  104. package/bin/types/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue.d.ts +170 -138
  105. package/bin/types/utils/JsViewVueWidget/JsvMindMap/rtree.d.ts +5 -5
  106. package/bin/types/utils/JsViewVueWidget/JsvNativeSharedDiv.vue.d.ts +48 -72
  107. package/bin/types/utils/JsViewVueWidget/JsvNinePatch.vue.d.ts +139 -20
  108. package/bin/types/utils/JsViewVueWidget/JsvPieChart.vue.d.ts +56 -8
  109. package/bin/types/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue.d.ts +20 -11
  110. package/bin/types/utils/JsViewVueWidget/JsvProgressBar.vue.d.ts +63 -11
  111. package/bin/types/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue.d.ts +8 -7
  112. package/bin/types/utils/JsViewVueWidget/JsvRadarChart.vue.d.ts +95 -12
  113. package/bin/types/utils/JsViewVueWidget/JsvRipple/Constant.d.ts +2 -2
  114. package/bin/types/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue.d.ts +51 -78
  115. package/bin/types/utils/JsViewVueWidget/JsvScaleTextBox.vue.d.ts +5 -4
  116. package/bin/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue.d.ts +84 -193
  117. package/bin/types/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue.d.ts +23 -148
  118. package/bin/types/utils/JsViewVueWidget/JsvSector.vue.d.ts +56 -9
  119. package/bin/types/utils/JsViewVueWidget/JsvSmoothSlideContainer.vue.d.ts +22 -67
  120. package/bin/types/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue.d.ts +44 -10
  121. package/bin/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +47 -14
  122. package/bin/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue.d.ts +26 -67
  123. package/bin/types/utils/JsViewVueWidget/JsvSwiper/Indicator.vue.d.ts +7 -6
  124. package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSmoothSwiper.vue.d.ts +147 -109
  125. package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue.d.ts +173 -16
  126. package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper2.vue.d.ts +216 -139
  127. package/bin/types/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue.d.ts +7 -6
  128. package/bin/types/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue.d.ts +101 -96
  129. package/bin/types/utils/JsViewVueWidget/JsvTextBox.vue.d.ts +89 -74
  130. package/bin/types/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +21 -20
  131. package/bin/types/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue.d.ts +43 -70
  132. package/bin/types/utils/JsViewVueWidget/JsvVideo.vue.d.ts +6 -5
  133. package/bin/types/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +62 -82
  134. package/bin/types/utils/JsViewVueWidget/JsvVisibleSensor/index.d.ts +95 -74
  135. package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvPosterDiv.vue.d.ts +51 -0
  136. package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvPosterImage.vue.d.ts +105 -0
  137. package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue.d.ts +51 -0
  138. package/bin/types/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue.d.ts +105 -0
  139. package/bin/types/utils/JsViewVueWidget/index.d.ts +5 -3
  140. package/package.json +2 -2
  141. package/tools/jsview-vue-build.mjs +13 -9
  142. package/tsconfig.json +2 -2
  143. package/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue +32 -16
  144. package/utils/JsViewEngineWidget/JsvFocus/JsvFocusHub.ts +24 -2
  145. package/utils/JsViewEngineWidget/MetroWidget/Const.ts +5 -0
  146. package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +183 -89
  147. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +269 -122
  148. package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +989 -357
  149. package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.ts +41 -23
  150. package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +138 -41
  151. package/utils/JsViewEngineWidget/MetroWidget/TaskManager.ts +1 -0
  152. package/utils/JsViewEngineWidget/MetroWidget/Utils.ts +6 -0
  153. package/utils/JsViewEngineWidget/MetroWidget/WidgetRectInfo.ts +2 -1
  154. package/utils/JsViewEngineWidget/RectUtils.js +1 -1
  155. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavProvider.vue +50 -0
  156. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationAlgorithm.ts +260 -0
  157. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigationNode.ts +32 -0
  158. package/utils/JsViewEngineWidget/SpatialNavigator/SpatialNavigator.ts +236 -0
  159. package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +342 -174
  160. package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +101 -27
  161. package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +12 -5
  162. package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +109 -41
  163. package/utils/JsViewEngineWidget/WidgetCommon.ts +17 -7
  164. package/utils/JsViewEngineWidget/index.ts +7 -2
  165. package/utils/JsViewPlugin/JsvLatex/BrowserDomBuilder.js +46 -46
  166. package/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue +54 -41
  167. package/utils/JsViewPlugin/JsvLatex/GetVersion.js +65 -0
  168. package/utils/JsViewPlugin/JsvLatex/JsvLatex.vue +54 -12
  169. package/utils/JsViewPlugin/JsvLatex/JsvLatexBridgeProxy.js +10 -0
  170. package/utils/JsViewPlugin/JsvLatex/JsvLatexProxy.vue +15 -2
  171. package/utils/JsViewPlugin/JsvLatex/PluginLoader.js +63 -31
  172. package/utils/JsViewPlugin/JsvLatex/version.mjs +26 -13
  173. package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +2 -1
  174. package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +402 -23
  175. package/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.js +100 -0
  176. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +363 -468
  177. package/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer.vue → JsvPlayerBrowser-wasm.vue} +60 -10
  178. package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +511 -0
  179. package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +52 -10
  180. package/utils/JsViewPlugin/JsvPlayer/index.js +58 -9
  181. package/utils/JsViewPlugin/JsvPlayer/package.json +8 -0
  182. package/utils/JsViewVueTools/BlobApi.ts +55 -0
  183. package/utils/JsViewVueTools/FeatureActive.ts +3 -0
  184. package/utils/JsViewVueTools/ForgeHandles.ts +3 -0
  185. package/utils/JsViewVueTools/JsvInteractionMode.js +16 -0
  186. package/utils/JsViewVueTools/JsvPreDownloader.ts +2 -2
  187. package/utils/JsViewVueTools/JsvRuntimeBridge.js +25 -18
  188. package/utils/JsViewVueTools/JsvTextTools.ts +9 -1
  189. package/utils/JsViewVueTools/JsvTextureStore/BitPalette/BitPalette.ts +180 -0
  190. package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.ts +1 -0
  191. package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/DrawHelper.ts +304 -0
  192. package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.ts +38 -0
  193. package/utils/JsViewVueTools/JsvTextureStore/CapturedTexture/CapturedTexture.ts +16 -1
  194. package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +154 -69
  195. package/utils/JsViewVueTools/JsvTextureStore/Store.ts +1 -1
  196. package/utils/JsViewVueTools/JsvTextureStore/TextureBuilder.ts +92 -0
  197. package/utils/JsViewVueTools/JsvTextureStore/index.js +2 -0
  198. package/utils/JsViewVueTools/index.js +3 -1
  199. package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +111 -86
  200. package/utils/JsViewVueWidget/JsvClipDiv/JsvClipDiv.vue +1 -1
  201. package/utils/JsViewVueWidget/JsvDragBox/JsvDragBox.vue +11 -2
  202. package/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue +1 -1
  203. package/utils/JsViewVueWidget/JsvEnableRenderBreak.vue +6 -0
  204. package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +11 -5
  205. package/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue +3 -1
  206. package/utils/JsViewVueWidget/JsvFragShaderView/JsvFragShaderView.vue +23 -11
  207. package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +242 -25
  208. package/utils/JsViewVueWidget/JsvFreeMoveActor/{FreeMoveActor.vue → JsvFreeMoveActor.vue} +1 -1
  209. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +11 -5
  210. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +118 -6
  211. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +56 -14
  212. package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +2 -1
  213. package/utils/JsViewVueWidget/JsvInput/EditViewOperator.ts +11 -2
  214. package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +30 -2
  215. package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +24 -7
  216. package/utils/JsViewVueWidget/JsvMarquee.vue +1 -1
  217. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +12 -10
  218. package/utils/JsViewVueWidget/JsvNinePatch.vue +13 -8
  219. package/utils/JsViewVueWidget/JsvPieChart.vue +93 -70
  220. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +32 -29
  221. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +2 -1
  222. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollBox.vue +25 -3
  223. package/utils/JsViewVueWidget/JsvScrollBox/JsvScrollFollow.vue +0 -3
  224. package/utils/JsViewVueWidget/JsvSector.vue +66 -28
  225. package/utils/JsViewVueWidget/JsvTextBox.vue +30 -1
  226. package/utils/JsViewVueWidget/JsvTouchModeSwitcher.vue +56 -14
  227. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +8 -6
  228. package/utils/JsViewVueWidget/TypesDiv/JsvPosterDiv.vue +54 -0
  229. package/utils/JsViewVueWidget/TypesDiv/JsvPosterImage.vue +88 -0
  230. package/utils/JsViewVueWidget/TypesDiv/JsvSmartDiv.vue +177 -0
  231. package/utils/JsViewVueWidget/TypesDiv/JsvSmartImage.vue +267 -0
  232. package/utils/JsViewVueWidget/index.js +6 -2
  233. package/bin/browser/BrowserAudio.vue.mjs +0 -258
  234. package/bin/browser/BrowserJsvLatex.vue.mjs +0 -145
  235. package/bin/types/utils/JsViewPlugin/JsvLatex/version.d.ts +0 -10
  236. package/bin/types/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.d.ts +0 -7
  237. package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue.d.ts +0 -78
  238. package/bin/types/utils/JsViewVueWidget/JsvPosterDiv.vue.d.ts +0 -63
  239. package/bin/types/utils/JsViewVueWidget/JsvPosterImage.vue.d.ts +0 -78
  240. package/utils/JsViewPlugin/JsvLatex/version.js +0 -24
  241. package/utils/JsViewVueTools/JsvTextureStore/DominantColor/GetDominantColor.ts +0 -36
  242. package/utils/JsViewVueWidget/JsvPosterDiv.vue +0 -56
  243. package/utils/JsViewVueWidget/JsvPosterImage.vue +0 -105
  244. /package/utils/JsViewPlugin/JsvPlayer/{BrowserJsvPlayer-0.9.vue → JsvPlayerBrowser-0.9.vue} +0 -0
@@ -6,6 +6,8 @@
6
6
  * props说明:
7
7
  * centerPosition {Object} 圆心坐标,属性:{x,y}
8
8
  * radius {Number} 半径
9
+ * subRadius {Number} 内半径,默认0
10
+ * radiusScale {Number} 缩放比例, 默认为0.5, 目的是兼容老版本传的radius为实际情况的2倍问题
9
11
  * animationTime {Number} 动画变化时间,单位 /秒
10
12
  * data {Array} 数组对象,包含百分比和颜色。例如:[{color:'#FFFFFF',percent:20}]
11
13
  * 说明:传入的数组要为响应式,且保证所有项的percent都是大于0并且相加等于100
@@ -15,7 +17,8 @@
15
17
  <div :key="'pie-' + finalData.length">
16
18
  <div v-for="(item, index) in finalData.slice().reverse()">
17
19
  <JsvSector
18
- :radius="props.radius"
20
+ :radius="Math.floor(props.radius * props.radiusScale)"
21
+ :subRadius="Math.floor(props.subRadius * props.radiusScale)"
19
22
  :config="{
20
23
  startAngle: Number(item.startAngle),
21
24
  sweepAngle:
@@ -34,93 +37,113 @@
34
37
  </template>
35
38
 
36
39
  <script setup>
37
- import { reactive,watchEffect } from "vue";
40
+ import { ref, watch } from "vue";
38
41
  import JsvSector from "./JsvSector.vue";
39
42
  const props = defineProps({
40
43
  centerPosition: { type: Object, required: true },
41
44
  data: { type: Array, required: true },
42
45
  radius: { type: Number, required: true },
43
- animationTime: { type: Number, default: 1 },
46
+ subRadius: { type: Number, default: 0 },
47
+ radiusScale: { type: Number, default: 0.5 },
48
+ animationTime: { type: Number, default: 0 },
44
49
  });
45
- let myData = props.data;
46
- //比较百分比数组
47
- let previousPercent = [];
48
- //额外时间数组
49
- let extraTimeArray = [];
50
- myData.forEach((item, index) => {
51
- previousPercent.push(item.percent);
52
- extraTimeArray.push(0);
53
- });
54
- //验证数据
55
- const CheckData = (data) => {
56
- let totalPercent = 0;
50
+ // 保存上一次的 percent,用于计算 extraTime
51
+ const previousPercent = ref([]);
52
+ const finalData = ref([]);
53
+
54
+ // 验证数据
55
+ const checkData = (data) => {
56
+ let isValid = true;
57
+
57
58
  data.forEach((item) => {
58
- if (!item.hasOwnProperty("percent")) {
59
+ if (!Object.prototype.hasOwnProperty.call(item, "percent")) {
59
60
  console.error("每一项必须包含percent属性");
61
+ isValid = false;
62
+ return;
60
63
  }
61
64
  if (item.percent < 0 || item.percent > 100) {
62
65
  console.error("每一项percent必须大于0或者小于等于100!");
66
+ isValid = false;
63
67
  }
64
- totalPercent += item.percent;
65
68
  });
66
- if (totalPercent < 99 || totalPercent > 101) {
67
- console.error("percent属性值总和必须等于100!");
68
- }
69
- return true;
69
+
70
+ return isValid;
70
71
  };
71
- CheckData(props.data);
72
- //过滤数据
73
- let finalData = reactive([]);
74
- let TempAngleArray = [];
75
- const filterData = (data) => {
76
- data.forEach((item, index) => {
77
- if (item.percent > previousPercent[index]) {
78
- extraTimeArray[index] = -0.1;
79
- } else if (item.percent < previousPercent[index]) {
80
- extraTimeArray[index] = 0.1;
81
- } else {
82
- extraTimeArray[index] = 0;
83
- }
84
- TempAngleArray.push(((item.percent / 100) * 360).toFixed(2));
85
- if (index == 0) {
86
- finalData.push({
87
- startAngle: Number(0).toFixed(2),
88
- sweepAngle: Number((item.percent / 100) * 360).toFixed(2),
89
- color: item.color,
90
- index: index,
91
- extraTime: extraTimeArray[0],
92
- });
72
+
73
+ // 当总和不为100时,从最后一项开始补齐/回收,不足时依次向前分摊
74
+ const normalizeDataPercent = (data) => {
75
+ const normalizedData = data.map((item) => ({
76
+ ...item,
77
+ percent: Number(item.percent),
78
+ }));
79
+
80
+ const totalPercent = normalizedData.reduce((sum, item) => sum + item.percent, 0);
81
+ let delta = Number((100 - totalPercent).toFixed(6));
82
+
83
+ if (delta === 0) return normalizedData;
84
+
85
+ for (let i = normalizedData.length - 1; i >= 0 && delta !== 0; i--) {
86
+ const currentPercent = normalizedData[i].percent;
87
+
88
+ if (delta > 0) {
89
+ const canAdd = 100 - currentPercent;
90
+ if (canAdd <= 0) continue;
91
+
92
+ const addValue = Math.min(canAdd, delta);
93
+ normalizedData[i].percent = Number((currentPercent + addValue).toFixed(6));
94
+ delta = Number((delta - addValue).toFixed(6));
93
95
  } else {
94
- finalData.push({
95
- startAngle: (
96
- Number(finalData[index - 1].startAngle) +
97
- Number(finalData[index - 1].sweepAngle)
98
- ).toFixed(2),
99
- sweepAngle: Number(TempAngleArray[index]).toFixed(2),
100
- color: item.color,
101
- index: index,
102
- extraTime: extraTimeArray[index],
103
- });
96
+ const canReduce = currentPercent;
97
+ if (canReduce <= 0) continue;
98
+
99
+ const reduceValue = Math.min(canReduce, Math.abs(delta));
100
+ normalizedData[i].percent = Number((currentPercent - reduceValue).toFixed(6));
101
+ delta = Number((delta + reduceValue).toFixed(6));
104
102
  }
105
- });
106
- //处理结束清理临时角度数组
107
- TempAngleArray=[]
103
+ }
104
+
105
+ if (delta !== 0) {
106
+ console.warn(
107
+ `[JsvPieChart] percent总和无法精确修正到100,剩余偏差: ${delta.toFixed(6)}`
108
+ );
109
+ }
110
+
111
+ return normalizedData;
108
112
  };
109
- filterData(myData);
110
-
111
- watchEffect(()=>{
112
- if(CheckData(props.data)){
113
- finalData.splice(0, finalData.length);
114
- filterData(props.data);
115
- myData = props.data;
116
- previousPercent = [];
117
- extraTimeArray = [];
118
- myData.forEach((item, index) => {
119
- previousPercent.push(item.percent);
120
- extraTimeArray.push(0);
113
+
114
+ const buildFinalData = (data, prevPercentList) => {
115
+ let currentStartAngle = 0;
116
+
117
+ return data.map((item, index) => {
118
+ const sweepAngle = Number(((item.percent / 100) * 360).toFixed(2));
119
+ const prevPercent = prevPercentList[index] ?? item.percent;
120
+ const extraTime =
121
+ item.percent > prevPercent ? -0.1 : item.percent < prevPercent ? 0.1 : 0;
122
+
123
+ const sector = {
124
+ startAngle: currentStartAngle.toFixed(2),
125
+ sweepAngle: sweepAngle.toFixed(2),
126
+ color: item.color,
127
+ index,
128
+ extraTime,
129
+ };
130
+
131
+ currentStartAngle += sweepAngle;
132
+ return sector;
121
133
  });
122
- }
123
- })
134
+ };
135
+
136
+ watch(
137
+ () => props.data,
138
+ (data) => {
139
+ if (!checkData(data)) return;
140
+
141
+ const normalizedData = normalizeDataPercent(data);
142
+ finalData.value = buildFinalData(normalizedData, previousPercent.value);
143
+ previousPercent.value = normalizedData.map((item) => item.percent);
144
+ },
145
+ { deep: true, immediate: true }
146
+ );
124
147
  </script>
125
148
 
126
149
  <style lang="scss" scoped></style>
@@ -2,15 +2,14 @@
2
2
  * @file
3
3
  *
4
4
  * 【模块 export 内容】
5
- * JsvPreload:Vue高阶组件,图片预加载的控件
6
- * preloadList {ObjectArray}: 预加载的信息列表,单个内容通过buildPreloadInfo构建
5
+ * JsvPreload(同时又名: JsvPicKeepAlive):图片预加载的控件,同时也会将加载的内容保持在内存中!
6
+ * preloadList/loadList {ObjectArray}: (属性二选一)加载的信息列表,单个内容通过buildLoadInfo构建
7
7
  * 列表中的图片会被进行下载,解码并将解码结果存储在内存中,内存占用的周期同JsvPreload组件声明周期
8
8
  * downloadList {ObjectArray}: 预下载的信息列表,单个内容通过buildDownloadInfo构建
9
9
  * 列表的内容可以是图片,音频等任何网络资源,下载后缓存在本地,归入本地缓存管理(LRU清理策略)
10
10
  * onPreloading {Function(float percent)}: 预加载中回调,返回预加载进度
11
- * onPreloadDone {Function(sizeArray)}: 预加载完成回调,sizeArray(格式Object[]),每个的格式为{width, height}
12
- * onDownloadDone {Function(pathesArray, extra)}: 预下载完成回调,pathesArray(格式为String[])为下载好回调的地址,
13
- * 其中pathesArray为存储位置的路径列表, extra为额外信息(目前只有下载图片时的尺寸)
11
+ * onPreloadDone {Function(info: {[url]: {width: number, height: number}}})}: 预加载完成回调
12
+ * onDownloadDone {Function(info: {[url]: {path: string, width: number, height: number}})}: 预下载完成回调
14
13
  *
15
14
  * 注意事项:
16
15
  * 指定加载时的尺寸(0为不指定),与img标签中的 jsv_img_scaledown_tex 属性一起使用
@@ -19,7 +18,7 @@
19
18
  * 对应着各自不同的图片内存缓存
20
19
  *
21
20
  * 静态函数:
22
- * buildPreloadInfo: 静态函数,创建预加载信息项,用于制作JsvPreload的preloadList属性列表信息
21
+ * buildLoadInfo/buildPreloadInfo: 静态函数,创建预加载信息项,用于制作JsvPreload的preloadList属性列表信息
23
22
  * 参数:
24
23
  * url {string}: (必填)图片url
25
24
  * width {int}: 图片内存存储区域宽度,默认为0(同图片源文件宽度)
@@ -30,10 +29,9 @@
30
29
  * buildDownloadInfo: 函数,创建预下载信息项,用于制作JsvPreload的downloadList属性列表信息
31
30
  * 参数:
32
31
  * url {string}: (必填)图片url
33
- * width {int}: 图片内存存储区域宽度,默认为0(同图片源文件宽度)
34
- * height {int}: 图片内存存储区域宽度,默认为0(同图片源文件宽度)
35
- * color_type {string}: 图片存储颜色空间,去掉alpha通道可节省内存,例如"RGB_565"等,与img标签jsv_img_color_space配合,默认值"RGBA_8888"
36
- * net_setting {object}: (未实现)网络加载参数,cookie, refer等,默认值 null
32
+ * netSetting {string}: 下载网络设置
33
+ * getImageSize {boolean}: 是否获取图片尺寸
34
+ * preDecode {boolean}: 是否预解码
37
35
  -->
38
36
  <script>
39
37
  const CONST_FORMAT_TOKEN = "_JsvP_";
@@ -56,16 +54,17 @@ const buildPreloadInfo = (
56
54
  };
57
55
  };
58
56
 
59
- const buildDownloadInfo = (url, net_setting = null, get_image_size) => {
57
+ const buildDownloadInfo = (url, net_setting = null, get_image_size = false, preDecode = false) => {
60
58
  return {
61
59
  url,
62
60
  netSetting: net_setting,
63
61
  getImageSize: get_image_size,
64
62
  magicToken: CONST_FORMAT_TOKEN, // 用于格式校验
63
+ preDecode: preDecode,
65
64
  };
66
65
  };
67
66
 
68
- export { buildPreloadInfo, buildDownloadInfo };
67
+ export { buildPreloadInfo, buildPreloadInfo as buildLoadInfo, buildDownloadInfo };
69
68
  </script>
70
69
  <script setup>
71
70
  import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
@@ -75,6 +74,7 @@ import { urlCheckSet } from "../../JsViewVueTools";
75
74
 
76
75
  const props = defineProps({
77
76
  preloadList: Object,
77
+ loadList: Object,
78
78
  downloadList: Object,
79
79
  onPreloading: Function,
80
80
  onPreloadDone: Function,
@@ -148,12 +148,13 @@ const _checkPreload = () => {
148
148
  };
149
149
 
150
150
  const _getPreloadViewIdList = () => {
151
- if (!props.preloadList) {
151
+ if (!props.preloadList && !props.loadList) {
152
152
  return;
153
153
  }
154
- preloadStateList = new Array(props.preloadList.length).fill(false);
154
+ // 优先使用loadList,如果loadList为空,则使用preloadList
155
+ let preloadListData = props.loadList || props.preloadList;
156
+ preloadStateList = new Array(preloadListData.length).fill(false);
155
157
  // 直接在map前将为null的值删除掉
156
- let preloadListData = props.preloadList;
157
158
  for (let i = 0; i < preloadListData.length; i++) {
158
159
  if (!preloadListData[i] || !preloadListData[i].url) {
159
160
  preloadListData.splice(i, 1);
@@ -226,7 +227,7 @@ const _checkDownload = () => {
226
227
  props.onDownloadDone &&
227
228
  loadedNum === downloadStateList.length - downloadIsNullNum
228
229
  ) {
229
- props.onDownloadDone(downloadStateList, downloadResultMap);
230
+ props.onDownloadDone(downloadResultMap);
230
231
  }
231
232
  };
232
233
 
@@ -235,7 +236,7 @@ const _getDownloadViewIdList = () => {
235
236
  return;
236
237
  }
237
238
  // 直接在map前将url为null的值清除掉
238
- downloadStateList = new Array(props.downloadList.length).fill(null);
239
+ downloadStateList = new Array(props.downloadList.length).fill(false);
239
240
  let downloadListData = props.downloadList;
240
241
  for (let i = 0; i < downloadListData.length; i++) {
241
242
  if (!downloadListData[i] || !downloadListData[i].url) {
@@ -250,32 +251,34 @@ const _getDownloadViewIdList = () => {
250
251
  "Error:format mismatch, data should comes from function buildDownloadInfo()"
251
252
  );
252
253
  }
253
- console.log(`OnDownload get${index} url=${item.url}`);
254
+ // console.log(`OnDownload get${index} url=${item.url}`);
254
255
  let image_url = urlCheckSet(item.url);
255
256
  const texture = ForgeHandles.TextureManager.GetDownloadTexture(
256
257
  image_url,
257
258
  null,
258
- item.getImageSize
259
+ item.getImageSize,
260
+ item.preDecode
259
261
  );
260
262
  if (!texture) {
261
263
  console.error("Error: Down view build texture failed for " + image_url);
262
264
  // 无法创建texture的图片先认为加载完成
263
- downloadStateList[index] = "invalid";
265
+ downloadStateList[index] = true;
264
266
  return;
265
267
  }
266
268
  const callback_token = texture.RegisterLoadImageCallback(
267
269
  null,
268
270
  (texture_info) => {
269
- console.log(`OnDownload done index${index}`);
270
- downloadStateList[index] = texture_info.extra.absolutePath;
271
+ // console.log(`OnDownload done index${index}`, texture_info);
272
+ downloadStateList[index] = true;
271
273
  if (
272
274
  item.getImageSize &&
273
- texture_info.extra.width &&
274
- texture_info.extra.height
275
+ texture_info.width &&
276
+ texture_info.height
275
277
  ) {
276
- downloadResultMap[texture_info.extra.absolutePath] = {
277
- width: texture_info.extra.width,
278
- height: texture_info.extra.height,
278
+ downloadResultMap[item.url] = {
279
+ width: texture_info.width,
280
+ height: texture_info.height,
281
+ path: texture_info.extra?.absolutePath,
279
282
  };
280
283
  }
281
284
  _checkDownload();
@@ -296,8 +299,8 @@ const _getDownloadViewIdList = () => {
296
299
  _releaseForgeView();
297
300
 
298
301
  watchEffect(() => {
299
- if (props.preloadList) {
300
- console.log("JsvPreload: update preloadList");
302
+ if (props.preloadList || props.loadList) {
303
+ console.log("JsvPreload: update preloadList/loadList");
301
304
  preloadIsNullNum = 0;
302
305
  _releasePreloadView();
303
306
  _getPreloadViewIdList();
@@ -9,7 +9,7 @@
9
9
  * fgColor {string} 二维码前景色,默认值"#000000",黑色
10
10
  * bgColor {string} 二维码背景色,默认值"#ffffff",白色
11
11
  * level {string} 二维码的容错能力,可选值{'L':低, 'M':中, 'H':高, 'Q':最精细},默认值'L'
12
- * instant {string} 是否立即加载(auto, sync, async), auto = async
12
+ * sync {string} 是否立即加载(auto, sync, async), auto = async
13
13
  * 是否当前帧限制(默认为非当前帧显示,不影响按键响应,但是会闪)
14
14
  * imageSettings {Object} 设置中心logo图片,默认值为null,设置格式为:
15
15
  * {
@@ -122,6 +122,7 @@ export default {
122
122
  // Add new QRCode
123
123
  this.qrCodeView = view;
124
124
  this.jsvBaseView.AddView(this.qrCodeView, lp_params);
125
+ this.jsvBaseView.MarkFlexSizeFromChild(this.qrCodeView.ViewId);
125
126
  },
126
127
  },
127
128
  created() {
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * 【模块 export 内容】
5
5
  * JsvScrollBox:Vue高阶组件,支持触控拖动的滚动型组件。
6
+ * 注意: 本组件进行rotate操作后,触控处理会出现坐标不对问题,所以不要进行rotate操作(其父节点也不能做rotate操作)
6
7
  * props说明:
7
8
  * style {Object} (必填,响应式) 其中的width/height为必填项目, 决定scroll固定的底座的尺寸
8
9
  * sliderSize {Object} (必填,响应式) 滑动区域的尺寸,滑块的尺寸在非滑动方向不能大于组件尺寸
@@ -24,7 +25,8 @@
24
25
  * (选填,响应式) 决定syncWith的联动模式,当syncWith设置后才能生效
25
26
  * SyncForward(默认值): 同进同退, mySelf = sourcePercent
26
27
  * SyncReverse: 进退反向, mySelf = (1 - sourcePercent)
27
- *
28
+ * enableMouseWheel {boolean} (选填,非响应式) 是否需要支持鼠标滚轮滚动
29
+ * mouseWheelRate {number} (选填,非响应式) 鼠标滚轮滚动速度比率,默认为10
28
30
  * template说明:
29
31
  * FixedBox={boxWidth, boxHeight}: 以本组件底座左上角0,0对齐的一个slot
30
32
  * SliderBox={boxWidth, boxHeight}: 以滑块div的左上角0,0对齐的一个slot,
@@ -80,8 +82,6 @@ import {
80
82
  watchEffect,
81
83
  onMounted,
82
84
  onUnmounted,
83
- defineExpose,
84
- defineProps,
85
85
  } from "vue";
86
86
  import ActControl from "../../JsViewVueWidget/JsvFreeMoveActor/ActorControl";
87
87
  import { VERTICAL, HORIZONTAL } from "../../JsViewVueTools/ConstSymbol";
@@ -150,6 +150,14 @@ let rProps = defineProps({
150
150
  type: Symbol,
151
151
  default: ScrollBoxStyle.SyncForward,
152
152
  },
153
+ enableMouseWheel: {
154
+ type: Boolean,
155
+ default: false,
156
+ },
157
+ mouseWheelRate: {
158
+ type: Number,
159
+ default: 10,
160
+ },
153
161
  });
154
162
 
155
163
  // 激活引擎中的功能支持
@@ -461,6 +469,9 @@ function currentPercent(): number {
461
469
  return vCurrentPercent;
462
470
  }
463
471
 
472
+ function onMouseWheelScrollProgress(pointInfo: any) {
473
+ }
474
+
464
475
  onMounted(() => {
465
476
  vMounted = true;
466
477
 
@@ -474,6 +485,17 @@ onMounted(() => {
474
485
  ForgeConst.DragFlags.TOUCH_RECV_LAST_END
475
486
  ); // 激活 Move | TouchDown | TouchEnd
476
487
 
488
+ if (rProps.enableMouseWheel) {
489
+ sliderView.HoverEnables(2);
490
+ sliderView.SetMouseWheelRate(rProps.mouseWheelRate ?? 10.0);
491
+ cSliderActor.run((cmds) => [
492
+ cmds
493
+ .condition(undefined, true)
494
+ .onMouseWheelScrollProgress()
495
+ .then([onMouseWheelScrollProgress]),
496
+ ]);
497
+ }
498
+
477
499
  // 设置初始进度
478
500
  if (cInitPercent != 0) {
479
501
  updatePercent(cInitPercent);
@@ -56,9 +56,6 @@ import {
56
56
  watchEffect,
57
57
  onMounted,
58
58
  onUnmounted,
59
- defineExpose,
60
- withDefaults,
61
- defineProps,
62
59
  } from "vue";
63
60
  import ActControl from "../JsvFreeMoveActor/ActorControl";
64
61
  import { ScrollBoxStyle } from "./ScrollSymbol";
@@ -6,6 +6,7 @@
6
6
  * props说明:
7
7
  * centerPosition {Object} 圆心坐标,属性:{x,y}
8
8
  * radius {Number} 半径
9
+ * subRadius {Number} 内半径,默认0;当0<subRadius<radius时绘制半圆圆弧
9
10
  * animationTime {Number} 动画变化时间,单位 /秒
10
11
  * config {Object} 配置信息对象,包含初始角度,扫过的角度以及颜色。属性:{startAngle,sweepAngle,color}
11
12
  * extraTime {Number} 可选配置(饼图用)扇形运动额外时间
@@ -13,97 +14,134 @@
13
14
  -->
14
15
  <template>
15
16
  <div
16
- :style="{
17
- width: props.radius,
18
- height: props.radius,
19
- transform: `rotate3d(0,0,1,${props.config.startAngle}deg)`,
20
- transformOrigin: `center center`,
21
- transition: `transform ${props.animationTime}s`,
22
- left: props.centerPosition.x / 2,
23
- top: props.centerPosition.y / 2,
24
- }"
17
+ :style="rootStyle"
25
18
  >
26
19
  <div
27
20
  :style="{
28
- width: props.radius,
29
- height: props.radius / 2,
30
- top: props.radius / 2,
21
+ width: props.radius * 2,
22
+ height: props.radius,
23
+ top: props.radius,
31
24
  left: 0,
32
25
  transform: `rotate3d(0,0,1,${upAngle}deg)`,
33
26
  transformOrigin: `center top`,
34
27
  overflow: 'hidden',
35
- transition: `transform ${props.animationTime}s`,
28
+ transition: baseTransition,
36
29
  }"
37
30
  >
38
31
  <div
39
32
  :style="{
40
- width: props.radius,
33
+ width: props.radius * 2,
41
34
  height: props.radius,
42
35
  backgroundImage: `jsvtexturestore://${sourceId}`,
43
36
  transform: `rotate3d(0,0,1,${downAngle}deg)`,
44
37
  transformOrigin: `center top`,
45
- transition: `transform ${props.animationTime + props.extraTime}s`,
38
+ transition: sweepTransition,
46
39
  }"
47
40
  ></div>
48
41
  </div>
49
42
  <div
50
43
  :style="{
51
- width: props.radius,
52
- height: props.radius / 2,
53
- top: props.radius / 2,
44
+ width: props.radius * 2,
45
+ height: props.radius,
46
+ top: props.radius,
54
47
  left: 0,
55
48
  overflow: 'hidden',
56
49
  }"
57
50
  >
58
51
  <div
59
52
  :style="{
60
- width: props.radius,
53
+ width: props.radius * 2,
61
54
  height: props.radius,
62
55
  backgroundImage: `jsvtexturestore://${sourceId}`,
63
56
  transform: `rotate3d(0,0,1,${downAngle}deg)`,
64
57
  transformOrigin: `center top`,
65
- transition: `transform ${props.animationTime+props.extraTime}s`,
58
+ transition: sweepTransition,
66
59
  }"></div>
67
60
  </div>
68
61
  </div>
69
62
  </template>
70
63
 
71
64
  <script setup>
72
- import { shallowRef, onBeforeUnmount, watch } from "vue";
65
+ import { shallowRef, onBeforeUnmount, watch, computed } from "vue";
73
66
  import { JsvTextureStoreApi } from "../JsViewVueTools";
74
67
  let sourceId = shallowRef("");
75
68
  const props = defineProps({
76
69
  centerPosition: { type: Object, require: true },
77
70
  radius: { type: Number, require: true },
71
+ subRadius: { type: Number, default: 0 },
78
72
  config: { type: Object, require: true },
79
73
  animationTime: { type: Number, default: 1 },
80
74
  extraTime: { type: Number, default: 0 },
81
75
  });
82
76
 
77
+ const normalizedSubRadius = Math.min(
78
+ props.radius,
79
+ Math.max(0, Number(props.subRadius) || 0)
80
+ );
81
+
83
82
  let canvasRef = JsvTextureStoreApi.canvasTexture(
84
83
  2 * props.radius,
85
- 2 * props.radius
84
+ props.radius
86
85
  );
87
86
  let customPath = canvasRef.customPath();
88
87
  customPath.arcTo(0, -props.radius, 2 * props.radius, props.radius, 0, 180);
89
- // 闭合路径,绘制实心扇形
88
+ if (normalizedSubRadius > 0 && normalizedSubRadius < props.radius) {
89
+ const innerLeft = props.radius - normalizedSubRadius;
90
+ const innerRight = props.radius + normalizedSubRadius;
91
+ customPath.arcTo(
92
+ innerLeft,
93
+ -normalizedSubRadius,
94
+ innerRight,
95
+ normalizedSubRadius,
96
+ 180,
97
+ -180
98
+ );
99
+ }
100
+ // subRadius=0时为实心扇形;subRadius生效时为半圆圆弧
90
101
  customPath.close();
91
102
  customPath.fill(props.config.color);
92
103
  sourceId.value = canvasRef.commit();
104
+
93
105
  //旋转角度
94
106
  let upAngle = shallowRef(0);
95
107
  let downAngle = shallowRef(0);
96
- const judge = () => {
97
- downAngle.value = -(180 - props.config.sweepAngle / 2);
98
- upAngle.value = props.config.sweepAngle / 2;
108
+ const judge = (sweepAngle) => {
109
+ if (sweepAngle > 360) {
110
+ sweepAngle = 360;
111
+ } else if (sweepAngle < 0) {
112
+ sweepAngle = 0;
113
+ }
114
+ downAngle.value = -Number((180 - sweepAngle / 2).toFixed(3));
115
+ upAngle.value = Number((sweepAngle / 2).toFixed(3));
116
+
117
+ console.log("LudlDebugCSS sweepAngle:", sweepAngle, " color:", props.config.color, " downAngle:", downAngle.value, " upAngle:", upAngle.value);
99
118
  };
100
- judge();
119
+ judge(props.config.sweepAngle);
101
120
  watch(props, (n, o) => {
102
- judge();
121
+ judge(props.config.sweepAngle);
103
122
  });
104
123
  onBeforeUnmount(() => {
105
124
  JsvTextureStoreApi.deleteTexture(sourceId.value);
106
125
  });
126
+
127
+ const baseTransition = computed(() =>
128
+ props.animationTime === 0 ? "" : `transform ${props.animationTime}s`
129
+ );
130
+ const sweepTransition = computed(() =>
131
+ props.animationTime === 0 ? "" : `transform ${props.animationTime + props.extraTime}s`
132
+ );
133
+
134
+ let rootStyle = computed(() => {
135
+ return {
136
+ width: props.radius * 2,
137
+ height: props.radius * 2,
138
+ transform: `rotate3d(0,0,1,${props.config.startAngle}deg)`,
139
+ transformOrigin: `center center`,
140
+ transition: baseTransition.value,
141
+ left: props.centerPosition.x - props.radius,
142
+ top: props.centerPosition.y - props.radius,
143
+ }
144
+ });
107
145
  </script>
108
146
 
109
147
  <style lang="scss" scoped></style>