@anov/3d-ability 0.0.139 → 0.0.141

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 (265) hide show
  1. package/dist/business/Animation/motion/index.js +35 -56
  2. package/dist/business/Animation/motion/index.js.map +1 -1
  3. package/dist/business/Animation/type.js +2 -2
  4. package/dist/business/Area/Fence/FenceBase.js +146 -187
  5. package/dist/business/Area/Fence/FenceBase.js.map +1 -1
  6. package/dist/business/Area/Fence/fence_base_01.js +120 -112
  7. package/dist/business/Area/Fence/fence_base_01.js.map +1 -1
  8. package/dist/business/Area/Fence/fence_feeting_01.js +218 -130
  9. package/dist/business/Area/Fence/fence_feeting_01.js.map +1 -1
  10. package/dist/business/Area/Fence/fence_roll_01.js +140 -130
  11. package/dist/business/Area/Fence/fence_roll_01.js.map +1 -1
  12. package/dist/business/Area/FillArea/FillAreaBase.js +87 -126
  13. package/dist/business/Area/FillArea/FillAreaBase.js.map +1 -1
  14. package/dist/business/Area/FillArea/fillArea_face_01.js +72 -98
  15. package/dist/business/Area/FillArea/fillArea_face_01.js.map +1 -1
  16. package/dist/business/Area/FillArea/fillArea_line_01.js +66 -94
  17. package/dist/business/Area/FillArea/fillArea_line_01.js.map +1 -1
  18. package/dist/business/Area/index.js +267 -483
  19. package/dist/business/Area/index.js.map +1 -1
  20. package/dist/business/Area/tool.js +14 -26
  21. package/dist/business/Area/tool.js.map +1 -1
  22. package/dist/business/Base/ObjectLayer.js +21 -46
  23. package/dist/business/Base/ObjectLayer.js.map +1 -1
  24. package/dist/business/Batch/index.js +189 -234
  25. package/dist/business/Batch/index.js.map +1 -1
  26. package/dist/business/Box/index.js +52 -81
  27. package/dist/business/Box/index.js.map +1 -1
  28. package/dist/business/Cylinder/index.js +51 -79
  29. package/dist/business/Cylinder/index.js.map +1 -1
  30. package/dist/business/Flyline/bubble/CircleBubble.js +1 -9
  31. package/dist/business/Flyline/bubble/CircleBubble.js.map +1 -1
  32. package/dist/business/Flyline/bubble/index.js +7 -21
  33. package/dist/business/Flyline/bubble/index.js.map +1 -1
  34. package/dist/business/Flyline/index.js +96 -162
  35. package/dist/business/Flyline/index.js.map +1 -1
  36. package/dist/business/Flyline/line/ArcLine.js +208 -291
  37. package/dist/business/Flyline/line/ArcLine.js.map +1 -1
  38. package/dist/business/Flyline/line/index.js +8 -22
  39. package/dist/business/Flyline/line/index.js.map +1 -1
  40. package/dist/business/HeatMap/HeatMap.js +380 -467
  41. package/dist/business/HeatMap/HeatMap.js.map +1 -1
  42. package/dist/business/HeatMap/core.js +405 -525
  43. package/dist/business/HeatMap/core.js.map +1 -1
  44. package/dist/business/HeatMap/shader.js +69 -3
  45. package/dist/business/HeatMap/shader.js.map +1 -1
  46. package/dist/business/InfoPanel/index.js +201 -242
  47. package/dist/business/InfoPanel/index.js.map +1 -1
  48. package/dist/business/Line/index.js +55 -88
  49. package/dist/business/Line/index.js.map +1 -1
  50. package/dist/business/Mark/KeyframeAnimation.js +145 -176
  51. package/dist/business/Mark/KeyframeAnimation.js.map +1 -1
  52. package/dist/business/Mark/index.js +196 -294
  53. package/dist/business/Mark/index.js.map +1 -1
  54. package/dist/business/Mark/shader/tanhao.js +36 -3
  55. package/dist/business/Mark/shader/tanhao.js.map +1 -1
  56. package/dist/business/Mark/type.js +1 -1
  57. package/dist/business/MaterialSwitch/MaterialSwitchSystem.js +377 -551
  58. package/dist/business/MaterialSwitch/MaterialSwitchSystem.js.map +1 -1
  59. package/dist/business/MaterialSwitch/inject.js +92 -58
  60. package/dist/business/MaterialSwitch/inject.js.map +1 -1
  61. package/dist/business/MaterialSwitch/shader/finalFade.js +74 -2
  62. package/dist/business/MaterialSwitch/shader/finalFade.js.map +1 -1
  63. package/dist/business/MaterialSwitch/shader/ground.js +95 -16
  64. package/dist/business/MaterialSwitch/shader/ground.js.map +1 -1
  65. package/dist/business/MaterialSwitch/shader/groundBase64.js +9 -3
  66. package/dist/business/MaterialSwitch/shader/groundBase64.js.map +1 -1
  67. package/dist/business/MaterialSwitch/shader/realFade.js +48 -9
  68. package/dist/business/MaterialSwitch/shader/realFade.js.map +1 -1
  69. package/dist/business/Plane/index.js +51 -78
  70. package/dist/business/Plane/index.js.map +1 -1
  71. package/dist/business/Poi/index.d.ts +5 -0
  72. package/dist/business/Poi/index.js +256 -295
  73. package/dist/business/Poi/index.js.map +1 -1
  74. package/dist/business/Poi/link/Cylinder.js +56 -89
  75. package/dist/business/Poi/link/Cylinder.js.map +1 -1
  76. package/dist/business/Poi/link/Pyramid.js +104 -165
  77. package/dist/business/Poi/link/Pyramid.js.map +1 -1
  78. package/dist/business/Poi/link/index.d.ts +1 -1
  79. package/dist/business/Poi/link/index.js +54 -114
  80. package/dist/business/Poi/link/index.js.map +1 -1
  81. package/dist/business/Poi/panel/index.d.ts +124 -0
  82. package/dist/business/Poi/panel/index.js +474 -0
  83. package/dist/business/Poi/panel/index.js.map +1 -0
  84. package/dist/business/Poi/panel/interfaces.d.ts +67 -0
  85. package/dist/business/Poi/panel/interfaces.js +2 -0
  86. package/dist/business/Poi/panel/interfaces.js.map +1 -0
  87. package/dist/business/Poi/panel/utils.d.ts +72 -0
  88. package/dist/business/Poi/panel/utils.js +126 -0
  89. package/dist/business/Poi/panel/utils.js.map +1 -0
  90. package/dist/business/Poi/particle/DoubleCircle.js +71 -107
  91. package/dist/business/Poi/particle/DoubleCircle.js.map +1 -1
  92. package/dist/business/Poi/particle/DynamicCircle.js +75 -111
  93. package/dist/business/Poi/particle/DynamicCircle.js.map +1 -1
  94. package/dist/business/Poi/particle/SingleCircle.js +62 -98
  95. package/dist/business/Poi/particle/SingleCircle.js.map +1 -1
  96. package/dist/business/Poi/particle/index.js +49 -117
  97. package/dist/business/Poi/particle/index.js.map +1 -1
  98. package/dist/business/Poi/shader/circle.js +31 -3
  99. package/dist/business/Poi/shader/circle.js.map +1 -1
  100. package/dist/business/Poi/shader/cylinder.js +37 -3
  101. package/dist/business/Poi/shader/cylinder.js.map +1 -1
  102. package/dist/business/Poi/shader/doubleCircle.js +55 -3
  103. package/dist/business/Poi/shader/doubleCircle.js.map +1 -1
  104. package/dist/business/Poi/shader/dynamicCircle.js +67 -3
  105. package/dist/business/Poi/shader/dynamicCircle.js.map +1 -1
  106. package/dist/business/Poi/title/Border.js +7 -27
  107. package/dist/business/Poi/title/Border.js.map +1 -1
  108. package/dist/business/Poi/title/Ellipse.js +7 -27
  109. package/dist/business/Poi/title/Ellipse.js.map +1 -1
  110. package/dist/business/Poi/title/index.js +208 -292
  111. package/dist/business/Poi/title/index.js.map +1 -1
  112. package/dist/business/Poi/tools.js +22 -19
  113. package/dist/business/Poi/tools.js.map +1 -1
  114. package/dist/business/Poi/types.d.ts +3 -0
  115. package/dist/business/Poi/types.js.map +1 -1
  116. package/dist/business/Sphere/index.js +47 -72
  117. package/dist/business/Sphere/index.js.map +1 -1
  118. package/dist/business/Spline/index.js +190 -245
  119. package/dist/business/Spline/index.js.map +1 -1
  120. package/dist/business/SplitBuilding/index.js +327 -536
  121. package/dist/business/SplitBuilding/index.js.map +1 -1
  122. package/dist/business/SplitBuilding/type.js +2 -2
  123. package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js +218 -275
  124. package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js.map +1 -1
  125. package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js +132 -177
  126. package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js.map +1 -1
  127. package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js +51 -1
  128. package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js.map +1 -1
  129. package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js +6 -1
  130. package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js.map +1 -1
  131. package/dist/business/TrafficComponents/base.js +32 -55
  132. package/dist/business/TrafficComponents/base.js.map +1 -1
  133. package/dist/business/TrafficComponents/utils.js +25 -24
  134. package/dist/business/TrafficComponents/utils.js.map +1 -1
  135. package/dist/business/Utils/Curve.js +40 -56
  136. package/dist/business/Utils/Curve.js.map +1 -1
  137. package/dist/business/Utils/constant.js +1 -1
  138. package/dist/business/Utils/constant.js.map +1 -1
  139. package/dist/business/Utils/defineProps.js +13 -14
  140. package/dist/business/Utils/defineProps.js.map +1 -1
  141. package/dist/business/Utils/round-curve.js +127 -153
  142. package/dist/business/Utils/round-curve.js.map +1 -1
  143. package/dist/business/VideoPanel/index.js +258 -319
  144. package/dist/business/VideoPanel/index.js.map +1 -1
  145. package/dist/business/Water/index.js +78 -108
  146. package/dist/business/Water/index.js.map +1 -1
  147. package/dist/business/Water/types.js +1 -1
  148. package/dist/business/Water/types.js.map +1 -1
  149. package/dist/core/Camera/PerspectiveCamera/CameraExpand.js +383 -449
  150. package/dist/core/Camera/PerspectiveCamera/CameraExpand.js.map +1 -1
  151. package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js +107 -142
  152. package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js.map +1 -1
  153. package/dist/core/Controls/FirstViewControl/index.js +84 -96
  154. package/dist/core/Controls/FirstViewControl/index.js.map +1 -1
  155. package/dist/core/Controls/ThirdViewControl/action/input.js +77 -98
  156. package/dist/core/Controls/ThirdViewControl/action/input.js.map +1 -1
  157. package/dist/core/Controls/ThirdViewControl/config/constants.js +1 -1
  158. package/dist/core/Controls/ThirdViewControl/config/constants.js.map +1 -1
  159. package/dist/core/Controls/ThirdViewControl/index.js +19 -28
  160. package/dist/core/Controls/ThirdViewControl/index.js.map +1 -1
  161. package/dist/core/Controls/ThirdViewControl/player/animation.js +126 -155
  162. package/dist/core/Controls/ThirdViewControl/player/animation.js.map +1 -1
  163. package/dist/core/Controls/ThirdViewControl/player/camera.js +47 -63
  164. package/dist/core/Controls/ThirdViewControl/player/camera.js.map +1 -1
  165. package/dist/core/Controls/ThirdViewControl/player/control.js +39 -49
  166. package/dist/core/Controls/ThirdViewControl/player/control.js.map +1 -1
  167. package/dist/core/Controls/ThirdViewControl/player.js +66 -91
  168. package/dist/core/Controls/ThirdViewControl/player.js.map +1 -1
  169. package/dist/core/Controls/base.js +14 -30
  170. package/dist/core/Controls/base.js.map +1 -1
  171. package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js +92 -131
  172. package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js.map +1 -1
  173. package/dist/core/Debug/PerformanceInfo/Performance.js +22 -47
  174. package/dist/core/Debug/PerformanceInfo/Performance.js.map +1 -1
  175. package/dist/core/Light/PointLight/PointLightExt.js +4 -21
  176. package/dist/core/Light/PointLight/PointLightExt.js.map +1 -1
  177. package/dist/core/Material/FinirMaterial/FinirMaterial.js +37 -57
  178. package/dist/core/Material/FinirMaterial/FinirMaterial.js.map +1 -1
  179. package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js +116 -153
  180. package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js.map +1 -1
  181. package/dist/core/Material/PristineGridMaterial/shader/fragment.js +95 -1
  182. package/dist/core/Material/PristineGridMaterial/shader/fragment.js.map +1 -1
  183. package/dist/core/Material/PristineGridMaterial/shader/vertex.js +26 -1
  184. package/dist/core/Material/PristineGridMaterial/shader/vertex.js.map +1 -1
  185. package/dist/core/Material/SurfaceMaterial/index.js +76 -172
  186. package/dist/core/Material/SurfaceMaterial/index.js.map +1 -1
  187. package/dist/core/Material/decorators.js +6 -11
  188. package/dist/core/Material/decorators.js.map +1 -1
  189. package/dist/core/PostEffects/addACESFilmicToneMappingPass.js +16 -12
  190. package/dist/core/PostEffects/addACESFilmicToneMappingPass.js.map +1 -1
  191. package/dist/core/PostEffects/addBrightnessContrastPass.js +17 -13
  192. package/dist/core/PostEffects/addBrightnessContrastPass.js.map +1 -1
  193. package/dist/core/PostEffects/bloomPass.js +17 -10
  194. package/dist/core/PostEffects/bloomPass.js.map +1 -1
  195. package/dist/core/PostEffects/bloomSelect.js +60 -43
  196. package/dist/core/PostEffects/bloomSelect.js.map +1 -1
  197. package/dist/core/PostEffects/colorifyPass.js +17 -13
  198. package/dist/core/PostEffects/colorifyPass.js.map +1 -1
  199. package/dist/core/PostEffects/index.js +28 -22
  200. package/dist/core/PostEffects/index.js.map +1 -1
  201. package/dist/core/PostEffects/outlinePass.js +37 -50
  202. package/dist/core/PostEffects/outlinePass.js.map +1 -1
  203. package/dist/core/PostEffects/postprocessing.js +14 -12
  204. package/dist/core/PostEffects/postprocessing.js.map +1 -1
  205. package/dist/core/PostEffects/saoPass.js +15 -10
  206. package/dist/core/PostEffects/saoPass.js.map +1 -1
  207. package/dist/core/PostEffects/shader/colorify.js +22 -3
  208. package/dist/core/PostEffects/shader/colorify.js.map +1 -1
  209. package/dist/core/PostEffects/shader/gammaCorrectionShader.js +27 -3
  210. package/dist/core/PostEffects/shader/gammaCorrectionShader.js.map +1 -1
  211. package/dist/core/PostEffects/shader/mapping.js +66 -3
  212. package/dist/core/PostEffects/shader/mapping.js.map +1 -1
  213. package/dist/core/PostEffects/shader/thermalMaging.js +28 -3
  214. package/dist/core/PostEffects/shader/thermalMaging.js.map +1 -1
  215. package/dist/core/SceneEffect/grow/grow.js +85 -101
  216. package/dist/core/SceneEffect/grow/grow.js.map +1 -1
  217. package/dist/core/SceneEffect/grow/style_down.js +60 -77
  218. package/dist/core/SceneEffect/grow/style_down.js.map +1 -1
  219. package/dist/core/SceneEffect/grow/style_up.js +64 -81
  220. package/dist/core/SceneEffect/grow/style_up.js.map +1 -1
  221. package/dist/core/SceneEffect/grow/type.js +2 -2
  222. package/dist/core/SceneEffect/grow/type.js.map +1 -1
  223. package/dist/core/WeatherSystem/DynamicWeatherSystem.js +51 -76
  224. package/dist/core/WeatherSystem/DynamicWeatherSystem.js.map +1 -1
  225. package/dist/core/WeatherSystem/hdr/index.js +69 -105
  226. package/dist/core/WeatherSystem/hdr/index.js.map +1 -1
  227. package/dist/core/WeatherSystem/index.js +77 -124
  228. package/dist/core/WeatherSystem/index.js.map +1 -1
  229. package/dist/core/WeatherSystem/objects/fog/index.js +52 -80
  230. package/dist/core/WeatherSystem/objects/fog/index.js.map +1 -1
  231. package/dist/core/WeatherSystem/objects/rain/index.js +72 -84
  232. package/dist/core/WeatherSystem/objects/rain/index.js.map +1 -1
  233. package/dist/core/WeatherSystem/objects/rain/lineRain.js +88 -118
  234. package/dist/core/WeatherSystem/objects/rain/lineRain.js.map +1 -1
  235. package/dist/core/WeatherSystem/objects/rain/plane.js +116 -146
  236. package/dist/core/WeatherSystem/objects/rain/plane.js.map +1 -1
  237. package/dist/core/WeatherSystem/objects/rain/point.js +100 -148
  238. package/dist/core/WeatherSystem/objects/rain/point.js.map +1 -1
  239. package/dist/core/WeatherSystem/objects/sky/cloud.js +71 -104
  240. package/dist/core/WeatherSystem/objects/sky/cloud.js.map +1 -1
  241. package/dist/core/WeatherSystem/objects/sky/index.js +66 -84
  242. package/dist/core/WeatherSystem/objects/sky/index.js.map +1 -1
  243. package/dist/core/WeatherSystem/objects/sky/outline.js +25 -45
  244. package/dist/core/WeatherSystem/objects/sky/outline.js.map +1 -1
  245. package/dist/core/WeatherSystem/shaders/cloud.js +74 -3
  246. package/dist/core/WeatherSystem/shaders/cloud.js.map +1 -1
  247. package/dist/core/WeatherSystem/shaders/fog.js +103 -3
  248. package/dist/core/WeatherSystem/shaders/fog.js.map +1 -1
  249. package/dist/core/WeatherSystem/shaders/rain.js +206 -7
  250. package/dist/core/WeatherSystem/shaders/rain.js.map +1 -1
  251. package/dist/core/WeatherSystem/shaders/sky.js +87 -3
  252. package/dist/core/WeatherSystem/shaders/sky.js.map +1 -1
  253. package/dist/core/WeatherSystem/sky/index.js +104 -135
  254. package/dist/core/WeatherSystem/sky/index.js.map +1 -1
  255. package/dist/core/WeatherSystem/utils/constant.js +44 -38
  256. package/dist/core/WeatherSystem/utils/constant.js.map +1 -1
  257. package/dist/core/WeatherSystem/utils/math.js +18 -25
  258. package/dist/core/WeatherSystem/utils/math.js.map +1 -1
  259. package/dist/core/WeatherSystem/utils/type.js +1 -1
  260. package/dist/core/WeatherSystem/utils/type.js.map +1 -1
  261. package/dist/core/WeatherSystem/weather/index.js +96 -141
  262. package/dist/core/WeatherSystem/weather/index.js.map +1 -1
  263. package/dist/utils/index.js +1 -1
  264. package/dist/utils/index.js.map +1 -1
  265. package/package.json +3 -3
@@ -1,27 +1,10 @@
1
- var _excluded = ["value"],
1
+ const _excluded = ["value"],
2
2
  _excluded2 = ["value"];
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
9
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
11
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
14
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
15
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
16
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
17
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
18
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
19
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
20
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
21
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
24
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
25
8
  /**
26
9
  * @file index.ts
27
10
  * @description 信息面板
@@ -33,7 +16,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
16
  import ObjectLayer from "../Base/ObjectLayer";
34
17
  import _ from 'lodash';
35
18
  import { Group, Vector3, createLabel } from '@anov/3d-core';
36
- var DEFAULT_OPTION = {
19
+ const DEFAULT_OPTION = {
37
20
  position: [0, 0, 0],
38
21
  type: 'info',
39
22
  title: {
@@ -51,238 +34,214 @@ var DEFAULT_OPTION = {
51
34
  closable: true,
52
35
  padding: '10px'
53
36
  };
54
- var InfoPanel = /*#__PURE__*/function (_ObjectLayer) {
55
- _inherits(InfoPanel, _ObjectLayer);
56
- var _super = _createSuper(InfoPanel);
57
- function InfoPanel(option) {
58
- var _this;
59
- _classCallCheck(this, InfoPanel);
60
- _this = _super.call(this);
61
- _defineProperty(_assertThisInitialized(_this), "_title", void 0);
62
- _defineProperty(_assertThisInitialized(_this), "_content", void 0);
63
- _defineProperty(_assertThisInitialized(_this), "_width", void 0);
64
- _defineProperty(_assertThisInitialized(_this), "_height", void 0);
65
- _defineProperty(_assertThisInitialized(_this), "_bgColor", void 0);
66
- _defineProperty(_assertThisInitialized(_this), "_position", void 0);
67
- _defineProperty(_assertThisInitialized(_this), "_type", void 0);
68
- _defineProperty(_assertThisInitialized(_this), "_borderRadius", 10);
69
- _defineProperty(_assertThisInitialized(_this), "_bgUrl", void 0);
70
- _defineProperty(_assertThisInitialized(_this), "_className", void 0);
71
- _defineProperty(_assertThisInitialized(_this), "_customStyle", void 0);
72
- _defineProperty(_assertThisInitialized(_this), "_closeable", void 0);
73
- _defineProperty(_assertThisInitialized(_this), "_padding", void 0);
74
- _defineProperty(_assertThisInitialized(_this), "_group", void 0);
75
- _defineProperty(_assertThisInitialized(_this), "_onClose", void 0);
76
- _defineProperty(_assertThisInitialized(_this), "visible", false);
77
- var params = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option);
78
- var _title = params.title,
79
- _content = params.content,
80
- _width = params.width,
81
- _height = params.height,
82
- _bgColor = params.bgColor,
83
- _position = params.position,
84
- _type = params.type,
85
- _bgUrl = params.bgUrl,
86
- _className = params.className,
87
- _customStyle = params.customStyle,
88
- _borderRadius = params.borderRadius,
89
- _padding = params.padding,
90
- _closeable = params.closable,
91
- _onClose = params.onClose;
92
- Object.assign(_assertThisInitialized(_this), {
93
- _title: _title,
94
- _content: _content,
95
- _width: _width,
96
- _height: _height,
97
- _bgColor: _bgColor,
98
- _position: _position,
99
- _type: _type,
100
- _bgUrl: _bgUrl,
101
- _className: _className,
102
- _customStyle: _customStyle,
103
- _borderRadius: _borderRadius,
104
- _padding: _padding,
105
- _closeable: _closeable,
106
- _onClose: _onClose
37
+ class InfoPanel extends ObjectLayer {
38
+ constructor(option) {
39
+ super();
40
+ _defineProperty(this, "_title", void 0);
41
+ _defineProperty(this, "_content", void 0);
42
+ _defineProperty(this, "_width", void 0);
43
+ _defineProperty(this, "_height", void 0);
44
+ _defineProperty(this, "_bgColor", void 0);
45
+ _defineProperty(this, "_position", void 0);
46
+ _defineProperty(this, "_type", void 0);
47
+ _defineProperty(this, "_borderRadius", 10);
48
+ _defineProperty(this, "_bgUrl", void 0);
49
+ _defineProperty(this, "_className", void 0);
50
+ _defineProperty(this, "_customStyle", void 0);
51
+ _defineProperty(this, "_closeable", void 0);
52
+ _defineProperty(this, "_padding", void 0);
53
+ _defineProperty(this, "_group", void 0);
54
+ _defineProperty(this, "_onClose", void 0);
55
+ _defineProperty(this, "visible", false);
56
+ const params = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option);
57
+ const {
58
+ title: _title,
59
+ content: _content,
60
+ width: _width,
61
+ height: _height,
62
+ bgColor: _bgColor,
63
+ position: _position,
64
+ type: _type,
65
+ bgUrl: _bgUrl,
66
+ className: _className,
67
+ customStyle: _customStyle,
68
+ borderRadius: _borderRadius,
69
+ padding: _padding,
70
+ closable: _closeable,
71
+ onClose: _onClose
72
+ } = params;
73
+ Object.assign(this, {
74
+ _title,
75
+ _content,
76
+ _width,
77
+ _height,
78
+ _bgColor,
79
+ _position,
80
+ _type,
81
+ _bgUrl,
82
+ _className,
83
+ _customStyle,
84
+ _borderRadius,
85
+ _padding,
86
+ _closeable,
87
+ _onClose
107
88
  });
108
- _this._group = new Group();
109
- _this._group.visible = _this.visible;
110
- _this.init();
111
- return _this;
89
+ this._group = new Group();
90
+ this._group.visible = this.visible;
91
+ this.init();
112
92
  }
113
- _createClass(InfoPanel, [{
114
- key: "init",
115
- value: function init() {
116
- this.createBox();
117
- }
118
- }, {
119
- key: "createBox",
120
- value: function createBox() {
121
- // 使用 DocumentFragment 减少重排
122
- // const fragment = document.createDocumentFragment();
123
- var bgDom = this.createBgDom(); //创建容器盒子
124
- var headerDom = this.createHeaderDom(); //创建头部盒子
125
-
126
- // 创建内容
127
- var contentDom = document.createElement('div');
128
- contentDom.className = 'panel-content';
129
- if (typeof this._content.value === 'string') {
130
- contentDom.textContent = this._content.value;
131
- } else if (this._content.value instanceof HTMLElement) {
132
- contentDom.appendChild(this._content.value);
133
- }
134
- var _this$_content = this._content,
135
- value = _this$_content.value,
136
- contentStyle = _objectWithoutProperties(_this$_content, _excluded);
137
- // 正确设置样式的方式
138
- Object.assign(contentDom.style, contentStyle); //待测试
93
+ init() {
94
+ this.createBox();
95
+ }
96
+ createBox() {
97
+ // 使用 DocumentFragment 减少重排
98
+ // const fragment = document.createDocumentFragment();
99
+ const bgDom = this.createBgDom(); //创建容器盒子
100
+ const headerDom = this.createHeaderDom(); //创建头部盒子
139
101
 
140
- bgDom.appendChild(headerDom);
141
- bgDom.appendChild(contentDom);
142
- var bgObject = createLabel(bgDom);
143
- bgObject.position.set(0, 0, 0);
144
- bgObject.center.set(0, 0);
145
- this._group.add(bgObject);
146
- this.add(this._group);
147
- this.applyPosition(); // 初始化自动定位
148
- }
149
- /** 创建背景 */
150
- }, {
151
- key: "createBgDom",
152
- value: function createBgDom() {
153
- //创建容器盒子
154
- var bgDom = document.createElement('div');
155
- Object.assign(bgDom.style, {
156
- width: "".concat(this._width, "px"),
157
- height: "".concat(this._height, "px"),
158
- // left: `${this._position[0]}px`,
159
- // top: `${this._position[1]}px`,
160
- overflow: 'hidden',
161
- padding: this._padding,
162
- borderRadius: this._bgUrl ? '' : "".concat(this._borderRadius, "px"),
163
- backgroundColor: this._bgUrl ? '' : this._bgColor,
164
- backgroundImage: this._bgUrl ? "url(".concat(this._bgUrl, ")") : '',
165
- backgroundSize: this._bgUrl ? 'contain' : '',
166
- backgroundRepeat: this._bgUrl ? 'no-repeat' : '',
167
- boxSizing: 'border-box'
168
- });
169
- if (this._className) bgDom.className = this._className;
170
- if (this._customStyle) Object.assign(bgDom.style, this._customStyle);
171
- return bgDom;
102
+ // 创建内容
103
+ const contentDom = document.createElement('div');
104
+ contentDom.className = 'panel-content';
105
+ if (typeof this._content.value === 'string') {
106
+ contentDom.textContent = this._content.value;
107
+ } else if (this._content.value instanceof HTMLElement) {
108
+ contentDom.appendChild(this._content.value);
172
109
  }
173
- /** 创建头部 */
174
- }, {
175
- key: "createHeaderDom",
176
- value: function createHeaderDom() {
177
- var _this2 = this;
178
- var headerDom = document.createElement('div');
179
- headerDom.className = 'panel-header';
180
- headerDom.style.display = 'flex';
181
- headerDom.style.alignItems = 'center';
182
- // 创建标题
183
- var titleDom = document.createElement('p');
184
- titleDom.className = 'panel-title';
185
- titleDom.style.display = 'flex';
186
- titleDom.style.flex = '1';
187
- titleDom.textContent = this._title.value;
188
- var _this$_title = this._title,
189
- titleValue = _this$_title.value,
190
- titleStyle = _objectWithoutProperties(_this$_title, _excluded2);
191
- // 正确设置样式的方式
192
- Object.assign(titleDom.style, titleStyle); //待测试
110
+ const _this$_content = this._content,
111
+ {
112
+ value
113
+ } = _this$_content,
114
+ contentStyle = _objectWithoutProperties(_this$_content, _excluded);
115
+ // 正确设置样式的方式
116
+ Object.assign(contentDom.style, contentStyle); //待测试
193
117
 
194
- headerDom.appendChild(titleDom);
118
+ bgDom.appendChild(headerDom);
119
+ bgDom.appendChild(contentDom);
120
+ const bgObject = createLabel(bgDom);
121
+ bgObject.position.set(0, 0, 0);
122
+ bgObject.center.set(0, 0);
123
+ this._group.add(bgObject);
124
+ this.add(this._group);
125
+ this.applyPosition(); // 初始化自动定位
126
+ }
127
+ /** 创建背景 */
128
+ createBgDom() {
129
+ //创建容器盒子
130
+ const bgDom = document.createElement('div');
131
+ Object.assign(bgDom.style, {
132
+ width: `${this._width}px`,
133
+ height: `${this._height}px`,
134
+ // left: `${this._position[0]}px`,
135
+ // top: `${this._position[1]}px`,
136
+ overflow: 'hidden',
137
+ padding: this._padding,
138
+ borderRadius: this._bgUrl ? '' : `${this._borderRadius}px`,
139
+ backgroundColor: this._bgUrl ? '' : this._bgColor,
140
+ backgroundImage: this._bgUrl ? `url(${this._bgUrl})` : '',
141
+ backgroundSize: this._bgUrl ? 'contain' : '',
142
+ backgroundRepeat: this._bgUrl ? 'no-repeat' : '',
143
+ boxSizing: 'border-box'
144
+ });
145
+ if (this._className) bgDom.className = this._className;
146
+ if (this._customStyle) Object.assign(bgDom.style, this._customStyle);
147
+ return bgDom;
148
+ }
149
+ /** 创建头部 */
150
+ createHeaderDom() {
151
+ const headerDom = document.createElement('div');
152
+ headerDom.className = 'panel-header';
153
+ headerDom.style.display = 'flex';
154
+ headerDom.style.alignItems = 'center';
155
+ // 创建标题
156
+ const titleDom = document.createElement('p');
157
+ titleDom.className = 'panel-title';
158
+ titleDom.style.display = 'flex';
159
+ titleDom.style.flex = '1';
160
+ titleDom.textContent = this._title.value;
161
+ const _this$_title = this._title,
162
+ {
163
+ value: titleValue
164
+ } = _this$_title,
165
+ titleStyle = _objectWithoutProperties(_this$_title, _excluded2);
166
+ // 正确设置样式的方式
167
+ Object.assign(titleDom.style, titleStyle); //待测试
195
168
 
196
- // 创建关闭按钮
197
- if (this._closeable) {
198
- var closeDom = document.createElement('div');
199
- closeDom.className = 'panel-close';
200
- closeDom.style.cursor = 'pointer';
201
- closeDom.style.fontSize = this._title.fontSize;
202
- closeDom.style.color = this._title.color;
203
- closeDom.textContent = 'x';
204
- closeDom.style.pointerEvents = 'auto';
205
- closeDom.onclick = function () {
206
- _this2.close();
207
- };
208
- headerDom.appendChild(closeDom);
209
- }
210
- return headerDom;
211
- }
169
+ headerDom.appendChild(titleDom);
212
170
 
213
- /** 自动定位面板 */
214
- }, {
215
- key: "applyPosition",
216
- value: function applyPosition() {
217
- var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Vector3(0, 0, 0);
218
- if (Array.isArray(this._position)) {
219
- // 如果是数组 [x, y]
220
- var _this$_position = _slicedToArray(this._position, 3),
221
- x = _this$_position[0],
222
- y = _this$_position[1],
223
- z = _this$_position[2];
224
- this._group.position.set(x, y, z); // 注意y轴取反
225
- }
171
+ // 创建关闭按钮
172
+ if (this._closeable) {
173
+ const closeDom = document.createElement('div');
174
+ closeDom.className = 'panel-close';
175
+ closeDom.style.cursor = 'pointer';
176
+ closeDom.style.fontSize = this._title.fontSize;
177
+ closeDom.style.color = this._title.color;
178
+ closeDom.textContent = 'x';
179
+ closeDom.style.pointerEvents = 'auto';
180
+ closeDom.onclick = () => {
181
+ this.close();
182
+ };
183
+ headerDom.appendChild(closeDom);
226
184
  }
227
- }, {
228
- key: "open",
229
- value: function open() {
230
- this.visible = true;
231
- this._group.visible = true;
185
+ return headerDom;
186
+ }
232
187
 
233
- // 同步 DOM 节点显示
234
- // this._group.children.forEach((child: any) => {
235
- // if (child.element) {
236
- // child.element.style.display = 'block';
237
- // }
238
- // });
188
+ /** 自动定位面板 */
189
+ applyPosition(offset = new Vector3(0, 0, 0)) {
190
+ if (Array.isArray(this._position)) {
191
+ // 如果是数组 [x, y]
192
+ const [x, y, z] = this._position;
193
+ this._group.position.set(x, y, z); // 注意y轴取反
239
194
  }
240
- }, {
241
- key: "close",
242
- value: function close() {
243
- this.visible = false;
244
- this._group.visible = false;
195
+ }
196
+ open() {
197
+ this.visible = true;
198
+ this._group.visible = true;
245
199
 
246
- // 同步 DOM 节点隐藏
247
- // this._group.children.forEach((child: any) => {
248
- // if (child.element) {
249
- // child.element.style.display = 'none';
250
- // }
251
- // });
252
- if (this._onClose) {
253
- this._onClose();
254
- }
255
- }
256
- }, {
257
- key: "update",
258
- value: function update(option) {
259
- var merged = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option);
260
- this._title = merged.title;
261
- this._content = merged.content;
262
- this._width = merged.width;
263
- this._height = merged.height;
264
- this._bgColor = merged.bgColor;
265
- this._borderRadius = merged.borderRadius || 0;
266
- this._bgUrl = merged.bgUrl;
267
- this._className = merged.className;
268
- this._customStyle = merged.style;
269
- this._group.clear();
270
- this.init();
271
- }
272
- }, {
273
- key: "destroy",
274
- value: function destroy() {
275
- this._group.clear();
276
- this.remove(this._group);
277
- // 清理DOM引用
278
- this._group.children.forEach(function (child) {
279
- if (child.element && child.element.parentNode) {
280
- child.element.parentNode.removeChild(child.element);
281
- }
282
- });
200
+ // 同步 DOM 节点显示
201
+ // this._group.children.forEach((child: any) => {
202
+ // if (child.element) {
203
+ // child.element.style.display = 'block';
204
+ // }
205
+ // });
206
+ }
207
+ close() {
208
+ this.visible = false;
209
+ this._group.visible = false;
210
+
211
+ // 同步 DOM 节点隐藏
212
+ // this._group.children.forEach((child: any) => {
213
+ // if (child.element) {
214
+ // child.element.style.display = 'none';
215
+ // }
216
+ // });
217
+ if (this._onClose) {
218
+ this._onClose();
283
219
  }
284
- }]);
285
- return InfoPanel;
286
- }(ObjectLayer);
220
+ }
221
+ update(option) {
222
+ const merged = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option);
223
+ this._title = merged.title;
224
+ this._content = merged.content;
225
+ this._width = merged.width;
226
+ this._height = merged.height;
227
+ this._bgColor = merged.bgColor;
228
+ this._borderRadius = merged.borderRadius || 0;
229
+ this._bgUrl = merged.bgUrl;
230
+ this._className = merged.className;
231
+ this._customStyle = merged.style;
232
+ this._group.clear();
233
+ this.init();
234
+ }
235
+ destroy() {
236
+ this._group.clear();
237
+ this.remove(this._group);
238
+ // 清理DOM引用
239
+ this._group.children.forEach(child => {
240
+ if (child.element && child.element.parentNode) {
241
+ child.element.parentNode.removeChild(child.element);
242
+ }
243
+ });
244
+ }
245
+ }
287
246
  export { InfoPanel };
288
247
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ObjectLayer","_","Group","Vector3","createLabel","DEFAULT_OPTION","position","type","title","value","fontSize","content","width","height","bgColor","borderRadius","closable","padding","InfoPanel","_ObjectLayer","_inherits","_super","_createSuper","option","_this","_classCallCheck","call","_defineProperty","_assertThisInitialized","params","mergeWith","cloneDeep","_title","_content","_width","_height","_bgColor","_position","_type","_bgUrl","bgUrl","_className","className","_customStyle","customStyle","_borderRadius","_padding","_closeable","_onClose","onClose","Object","assign","_group","visible","init","_createClass","key","createBox","bgDom","createBgDom","headerDom","createHeaderDom","contentDom","document","createElement","textContent","HTMLElement","appendChild","_this$_content","contentStyle","_objectWithoutProperties","_excluded","style","bgObject","set","center","add","applyPosition","concat","overflow","backgroundColor","backgroundImage","backgroundSize","backgroundRepeat","boxSizing","_this2","display","alignItems","titleDom","flex","_this$_title","titleValue","titleStyle","_excluded2","closeDom","cursor","color","pointerEvents","onclick","close","offset","arguments","length","undefined","Array","isArray","_this$_position","_slicedToArray","x","y","z","open","update","merged","clear","destroy","remove","children","forEach","child","element","parentNode","removeChild"],"sources":["../../../src/business/InfoPanel/index.ts"],"sourcesContent":["/**\n * @file index.ts\n * @description 信息面板\n * @author xingwei\n * @createTime 2025-08-22\n * @lastEditTime 2025-08-22\n */\n\n\nimport ObjectLayer from \"../Base/ObjectLayer\";\nimport _ from 'lodash'\nimport { Group, Vector3, createLabel, CSS2DRenderer, Mesh, SphereGeometry, MeshBasicMaterial } from '@anov/3d-core'\nimport type {Option, TitleOption, ContentOption, PanelType, PanelPosition} from './type'\nimport { IPanel } from './type'\n\nconst DEFAULT_OPTION = {\n position: [0, 0, 0],\n type: 'info',\n title: {\n value: '面板标题',\n fontSize: '20px',\n },\n content: {\n value: '面板内容',\n fontSize: '16px',\n },\n width: 300,\n height: 200,\n bgColor: '#fff',\n borderRadius: 8,\n closable: true,\n padding: '10px'\n}\n\nclass InfoPanel extends ObjectLayer implements IPanel{\n private _title: TitleOption\n private _content: ContentOption\n private _width: number\n private _height: number\n private _bgColor: string\n private _position: Array<number>\n private _type: PanelType\n private _borderRadius: number = 10\n private _bgUrl: string\n private _className: string\n private _customStyle: any\n private _closeable: boolean\n private _padding: string \n private _group: Group\n private _onClose: Function\n visible: boolean = false;\n\n constructor(option: Option) {\n super();\n const params = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option)\n const {\n title: _title,\n content: _content,\n width: _width,\n height: _height,\n bgColor: _bgColor,\n position: _position,\n type: _type,\n bgUrl: _bgUrl,\n className: _className,\n customStyle: _customStyle,\n borderRadius: _borderRadius,\n padding: _padding,\n closable: _closeable,\n onClose: _onClose\n } = params;\n\n Object.assign(this, {\n _title, _content, _width, _height, _bgColor, _position, _type,\n _bgUrl, _className, _customStyle, _borderRadius, _padding,_closeable, _onClose\n });\n \n this._group = new Group()\n this._group.visible = this.visible\n this.init()\n }\n private init(){\n this.createBox()\n \n }\n\n\n private createBox(){\n\n // 使用 DocumentFragment 减少重排\n // const fragment = document.createDocumentFragment();\n const bgDom = this.createBgDom() //创建容器盒子\n const headerDom = this.createHeaderDom() //创建头部盒子\n\n\n // 创建内容\n const contentDom = document.createElement('div')\n contentDom.className = 'panel-content'\n if(typeof this._content.value === 'string'){\n contentDom.textContent = this._content.value\n }else if(this._content.value instanceof HTMLElement){\n contentDom.appendChild(this._content.value)\n }\n \n const {value, ...contentStyle} = this._content\n // 正确设置样式的方式\n Object.assign(contentDom.style, contentStyle) //待测试\n\n bgDom.appendChild(headerDom)\n bgDom.appendChild(contentDom)\n\n\n const bgObject = createLabel(bgDom);\n bgObject.position.set(0, 0, 0);\n bgObject.center.set(0, 0);\n\n this._group.add(bgObject);\n\n this.add(this._group)\n this.applyPosition(); // 初始化自动定位\n }\n /** 创建背景 */\n private createBgDom(){\n //创建容器盒子\n const bgDom = document.createElement('div');\n Object.assign(bgDom.style, {\n width: `${this._width}px`,\n height: `${this._height}px`,\n // left: `${this._position[0]}px`,\n // top: `${this._position[1]}px`,\n overflow: 'hidden',\n padding: this._padding,\n borderRadius: this._bgUrl ? '' : `${this._borderRadius}px`,\n backgroundColor: this._bgUrl ? '' : this._bgColor,\n backgroundImage: this._bgUrl ? `url(${this._bgUrl})` : '',\n backgroundSize: this._bgUrl ? 'contain' : '',\n backgroundRepeat: this._bgUrl ? 'no-repeat' : '',\n boxSizing: 'border-box'\n \n });\n if (this._className) bgDom.className = this._className;\n if (this._customStyle) Object.assign(bgDom.style, this._customStyle);\n return bgDom;\n }\n /** 创建头部 */\n private createHeaderDom(){\n const headerDom = document.createElement('div')\n headerDom.className = 'panel-header'\n headerDom.style.display = 'flex'\n headerDom.style.alignItems = 'center'\n // 创建标题\n const titleDom = document.createElement('p')\n titleDom.className = 'panel-title'\n titleDom.style.display = 'flex'\n titleDom.style.flex = '1'\n titleDom.textContent = this._title.value\n const {value: titleValue, ...titleStyle} = this._title\n // 正确设置样式的方式\n Object.assign(titleDom.style, titleStyle) //待测试\n\n headerDom.appendChild(titleDom)\n\n // 创建关闭按钮\n if(this._closeable){\n const closeDom = document.createElement('div')\n closeDom.className = 'panel-close'\n closeDom.style.cursor = 'pointer'\n closeDom.style.fontSize = this._title.fontSize\n closeDom.style.color = this._title.color\n closeDom.textContent = 'x'\n closeDom.style.pointerEvents = 'auto'\n closeDom.onclick = () => {\n this.close()\n }\n headerDom.appendChild(closeDom)\n }\n return headerDom\n }\n\n /** 自动定位面板 */\n private applyPosition(offset: Vector3 = new Vector3(0, 0, 0)) {\n if (Array.isArray(this._position)) {\n // 如果是数组 [x, y]\n const [x, y, z] = this._position;\n this._group.position.set(x, y, z); // 注意y轴取反\n }\n }\n\n public open(){\n this.visible = true\n this._group.visible = true;\n\n // 同步 DOM 节点显示\n // this._group.children.forEach((child: any) => {\n // if (child.element) {\n // child.element.style.display = 'block';\n // }\n // });\n }\n public close(){\n this.visible = false\n this._group.visible = false;\n\n // 同步 DOM 节点隐藏\n // this._group.children.forEach((child: any) => {\n // if (child.element) {\n // child.element.style.display = 'none';\n // }\n // });\n if(this._onClose){\n this._onClose()\n }\n }\n public update(option: Option){\n const merged = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option);\n this._title = merged.title;\n this._content = merged.content;\n this._width = merged.width;\n this._height = merged.height;\n this._bgColor = merged.bgColor;\n this._borderRadius = merged.borderRadius || 0;\n this._bgUrl = merged.bgUrl;\n this._className = merged.className;\n this._customStyle = merged.style;\n\n this._group.clear();\n this.init();\n }\n destroy(): void {\n this._group.clear();\n this.remove(this._group)\n // 清理DOM引用\n this._group.children.forEach((child: any) => {\n if (child.element && child.element.parentNode) {\n child.element.parentNode.removeChild(child.element);\n }\n });\n }\n}\n\nexport {InfoPanel}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,WAAW;AAClB,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,KAAK,EAAEC,OAAO,EAAEC,WAAW,QAAgE,eAAe;AAInH,IAAMC,cAAc,GAAG;EACnBC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACnBC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;IACHC,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE;EACd,CAAC;EACDC,OAAO,EAAE;IACLF,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE;EACd,CAAC;EACDE,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE,GAAG;EACXC,OAAO,EAAE,MAAM;EACfC,YAAY,EAAE,CAAC;EACfC,QAAQ,EAAE,IAAI;EACdC,OAAO,EAAE;AACb,CAAC;AAAA,IAEKC,SAAS,0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,CAAC1B,cAAc,CAAC,EAAEkB,MAAM,CAAC;MAC/D,IAAI,CAACS,MAAM,GAAGiF,MAAM,CAACzG,KAAK;MAC1B,IAAI,CAACyB,QAAQ,GAAGgF,MAAM,CAACtG,OAAO;MAC9B,IAAI,CAACuB,MAAM,GAAG+E,MAAM,CAACrG,KAAK;MAC1B,IAAI,CAACuB,OAAO,GAAG8E,MAAM,CAACpG,MAAM;MAC5B,IAAI,CAACuB,QAAQ,GAAG6E,MAAM,CAACnG,OAAO;MAC9B,IAAI,CAAC+B,aAAa,GAAGoE,MAAM,CAAClG,YAAY,IAAI,CAAC;MAC7C,IAAI,CAACwB,MAAM,GAAG0E,MAAM,CAACzE,KAAK;MAC1B,IAAI,CAACC,UAAU,GAAGwE,MAAM,CAACvE,SAAS;MAClC,IAAI,CAACC,YAAY,GAAGsE,MAAM,CAACzC,KAAK;MAEhC,IAAI,CAACpB,MAAM,CAAC8D,KAAK,CAAC,CAAC;MACnB,IAAI,CAAC5D,IAAI,CAAC,CAAC;IACf;EAAC;IAAAE,GAAA;IAAA/C,KAAA,EACD,SAAA0G,QAAA,EAAgB;MACZ,IAAI,CAAC/D,MAAM,CAAC8D,KAAK,CAAC,CAAC;MACnB,IAAI,CAACE,MAAM,CAAC,IAAI,CAAChE,MAAM,CAAC;MACxB;MACA,IAAI,CAACA,MAAM,CAACiE,QAAQ,CAACC,OAAO,CAAC,UAACC,KAAU,EAAK;QACzC,IAAIA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACC,OAAO,CAACC,UAAU,EAAE;UAC3CF,KAAK,CAACC,OAAO,CAACC,UAAU,CAACC,WAAW,CAACH,KAAK,CAACC,OAAO,CAAC;QACvD;MACJ,CAAC,CAAC;IACN;EAAC;EAAA,OAAAtG,SAAA;AAAA,EA3MmBlB,WAAW;AA8MnC,SAAQkB,SAAS"}
1
+ {"version":3,"names":["ObjectLayer","_","Group","Vector3","createLabel","DEFAULT_OPTION","position","type","title","value","fontSize","content","width","height","bgColor","borderRadius","closable","padding","InfoPanel","constructor","option","_defineProperty","params","mergeWith","cloneDeep","_title","_content","_width","_height","_bgColor","_position","_type","bgUrl","_bgUrl","className","_className","customStyle","_customStyle","_borderRadius","_padding","_closeable","onClose","_onClose","Object","assign","_group","visible","init","createBox","bgDom","createBgDom","headerDom","createHeaderDom","contentDom","document","createElement","textContent","HTMLElement","appendChild","_this$_content","contentStyle","_objectWithoutProperties","_excluded","style","bgObject","set","center","add","applyPosition","overflow","backgroundColor","backgroundImage","backgroundSize","backgroundRepeat","boxSizing","display","alignItems","titleDom","flex","_this$_title","titleValue","titleStyle","_excluded2","closeDom","cursor","color","pointerEvents","onclick","close","offset","Array","isArray","x","y","z","open","update","merged","clear","destroy","remove","children","forEach","child","element","parentNode","removeChild"],"sources":["../../../src/business/InfoPanel/index.ts"],"sourcesContent":["/**\n * @file index.ts\n * @description 信息面板\n * @author xingwei\n * @createTime 2025-08-22\n * @lastEditTime 2025-08-22\n */\n\n\nimport ObjectLayer from \"../Base/ObjectLayer\";\nimport _ from 'lodash'\nimport { Group, Vector3, createLabel, CSS2DRenderer, Mesh, SphereGeometry, MeshBasicMaterial } from '@anov/3d-core'\nimport type {Option, TitleOption, ContentOption, PanelType, PanelPosition} from './type'\nimport { IPanel } from './type'\n\nconst DEFAULT_OPTION = {\n position: [0, 0, 0],\n type: 'info',\n title: {\n value: '面板标题',\n fontSize: '20px',\n },\n content: {\n value: '面板内容',\n fontSize: '16px',\n },\n width: 300,\n height: 200,\n bgColor: '#fff',\n borderRadius: 8,\n closable: true,\n padding: '10px'\n}\n\nclass InfoPanel extends ObjectLayer implements IPanel{\n private _title: TitleOption\n private _content: ContentOption\n private _width: number\n private _height: number\n private _bgColor: string\n private _position: Array<number>\n private _type: PanelType\n private _borderRadius: number = 10\n private _bgUrl: string\n private _className: string\n private _customStyle: any\n private _closeable: boolean\n private _padding: string \n private _group: Group\n private _onClose: Function\n visible: boolean = false;\n\n constructor(option: Option) {\n super();\n const params = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option)\n const {\n title: _title,\n content: _content,\n width: _width,\n height: _height,\n bgColor: _bgColor,\n position: _position,\n type: _type,\n bgUrl: _bgUrl,\n className: _className,\n customStyle: _customStyle,\n borderRadius: _borderRadius,\n padding: _padding,\n closable: _closeable,\n onClose: _onClose\n } = params;\n\n Object.assign(this, {\n _title, _content, _width, _height, _bgColor, _position, _type,\n _bgUrl, _className, _customStyle, _borderRadius, _padding,_closeable, _onClose\n });\n \n this._group = new Group()\n this._group.visible = this.visible\n this.init()\n }\n private init(){\n this.createBox()\n \n }\n\n\n private createBox(){\n\n // 使用 DocumentFragment 减少重排\n // const fragment = document.createDocumentFragment();\n const bgDom = this.createBgDom() //创建容器盒子\n const headerDom = this.createHeaderDom() //创建头部盒子\n\n\n // 创建内容\n const contentDom = document.createElement('div')\n contentDom.className = 'panel-content'\n if(typeof this._content.value === 'string'){\n contentDom.textContent = this._content.value\n }else if(this._content.value instanceof HTMLElement){\n contentDom.appendChild(this._content.value)\n }\n \n const {value, ...contentStyle} = this._content\n // 正确设置样式的方式\n Object.assign(contentDom.style, contentStyle) //待测试\n\n bgDom.appendChild(headerDom)\n bgDom.appendChild(contentDom)\n\n\n const bgObject = createLabel(bgDom);\n bgObject.position.set(0, 0, 0);\n bgObject.center.set(0, 0);\n\n this._group.add(bgObject);\n\n this.add(this._group)\n this.applyPosition(); // 初始化自动定位\n }\n /** 创建背景 */\n private createBgDom(){\n //创建容器盒子\n const bgDom = document.createElement('div');\n Object.assign(bgDom.style, {\n width: `${this._width}px`,\n height: `${this._height}px`,\n // left: `${this._position[0]}px`,\n // top: `${this._position[1]}px`,\n overflow: 'hidden',\n padding: this._padding,\n borderRadius: this._bgUrl ? '' : `${this._borderRadius}px`,\n backgroundColor: this._bgUrl ? '' : this._bgColor,\n backgroundImage: this._bgUrl ? `url(${this._bgUrl})` : '',\n backgroundSize: this._bgUrl ? 'contain' : '',\n backgroundRepeat: this._bgUrl ? 'no-repeat' : '',\n boxSizing: 'border-box'\n \n });\n if (this._className) bgDom.className = this._className;\n if (this._customStyle) Object.assign(bgDom.style, this._customStyle);\n return bgDom;\n }\n /** 创建头部 */\n private createHeaderDom(){\n const headerDom = document.createElement('div')\n headerDom.className = 'panel-header'\n headerDom.style.display = 'flex'\n headerDom.style.alignItems = 'center'\n // 创建标题\n const titleDom = document.createElement('p')\n titleDom.className = 'panel-title'\n titleDom.style.display = 'flex'\n titleDom.style.flex = '1'\n titleDom.textContent = this._title.value\n const {value: titleValue, ...titleStyle} = this._title\n // 正确设置样式的方式\n Object.assign(titleDom.style, titleStyle) //待测试\n\n headerDom.appendChild(titleDom)\n\n // 创建关闭按钮\n if(this._closeable){\n const closeDom = document.createElement('div')\n closeDom.className = 'panel-close'\n closeDom.style.cursor = 'pointer'\n closeDom.style.fontSize = this._title.fontSize\n closeDom.style.color = this._title.color\n closeDom.textContent = 'x'\n closeDom.style.pointerEvents = 'auto'\n closeDom.onclick = () => {\n this.close()\n }\n headerDom.appendChild(closeDom)\n }\n return headerDom\n }\n\n /** 自动定位面板 */\n private applyPosition(offset: Vector3 = new Vector3(0, 0, 0)) {\n if (Array.isArray(this._position)) {\n // 如果是数组 [x, y]\n const [x, y, z] = this._position;\n this._group.position.set(x, y, z); // 注意y轴取反\n }\n }\n\n public open(){\n this.visible = true\n this._group.visible = true;\n\n // 同步 DOM 节点显示\n // this._group.children.forEach((child: any) => {\n // if (child.element) {\n // child.element.style.display = 'block';\n // }\n // });\n }\n public close(){\n this.visible = false\n this._group.visible = false;\n\n // 同步 DOM 节点隐藏\n // this._group.children.forEach((child: any) => {\n // if (child.element) {\n // child.element.style.display = 'none';\n // }\n // });\n if(this._onClose){\n this._onClose()\n }\n }\n public update(option: Option){\n const merged = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option);\n this._title = merged.title;\n this._content = merged.content;\n this._width = merged.width;\n this._height = merged.height;\n this._bgColor = merged.bgColor;\n this._borderRadius = merged.borderRadius || 0;\n this._bgUrl = merged.bgUrl;\n this._className = merged.className;\n this._customStyle = merged.style;\n\n this._group.clear();\n this.init();\n }\n destroy(): void {\n this._group.clear();\n this.remove(this._group)\n // 清理DOM引用\n this._group.children.forEach((child: any) => {\n if (child.element && child.element.parentNode) {\n child.element.parentNode.removeChild(child.element);\n }\n });\n }\n}\n\nexport {InfoPanel}"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,WAAW;AAClB,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,KAAK,EAAEC,OAAO,EAAEC,WAAW,QAAgE,eAAe;AAInH,MAAMC,cAAc,GAAG;EACnBC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACnBC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;IACHC,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE;EACd,CAAC;EACDC,OAAO,EAAE;IACLF,KAAK,EAAE,MAAM;IACbC,QAAQ,EAAE;EACd,CAAC;EACDE,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE,GAAG;EACXC,OAAO,EAAE,MAAM;EACfC,YAAY,EAAE,CAAC;EACfC,QAAQ,EAAE,IAAI;EACdC,OAAO,EAAE;AACb,CAAC;AAED,MAAMC,SAAS,SAASlB,WAAW,CAAkB;EAkBjDmB,WAAWA,CAACC,MAAc,EAAE;IACxB,KAAK,CAAC,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,wBAXoB,EAAE;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,kBAQf,KAAK;IAIpB,MAAMC,MAAM,GAAGrB,CAAC,CAACsB,SAAS,CAACtB,CAAC,CAACuB,SAAS,CAACnB,cAAc,CAAC,EAAEe,MAAM,CAAC;IAC/D,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