@shjjs/visual-ui 1.0.39 → 1.0.40

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 (170) hide show
  1. package/es/commons/core/earth/main.vue.mjs +7 -7
  2. package/es/commons/core/useChart.mjs +301 -301
  3. package/es/commons/utils/parseDataset.mjs +19 -19
  4. package/es/commons/utils/typescript.d.ts +5 -5
  5. package/es/components/chart/commons/components/common-chart/index.vue.mjs +269 -269
  6. package/es/components/chart/commons/components/common-chart-map/index.vue.mjs +247 -247
  7. package/es/components/chart/commons/hooks/useChart.mjs +316 -316
  8. package/es/components/chart-other-candlestick-basic/index.vue.mjs +261 -261
  9. package/es/components/chart-other-candlestick-demo/index.vue.mjs +260 -260
  10. package/es/components/chart-other-candlestick-shanghai/index.vue.mjs +260 -260
  11. package/es/components/chart-other-circular-graph/index.vue.mjs +260 -260
  12. package/es/components/chart-other-force/index.vue.mjs +260 -260
  13. package/es/components/chart-other-force2/index.vue.mjs +260 -260
  14. package/es/components/chart-other-funnel/index.vue.mjs +260 -260
  15. package/es/components/chart-other-funnel-contrast/index.vue.mjs +260 -260
  16. package/es/components/chart-other-funnel-split/index.vue.mjs +260 -260
  17. package/es/components/chart-other-funnel2/index.vue.mjs +260 -260
  18. package/es/components/chart-other-gauge/index.vue.mjs +260 -260
  19. package/es/components/chart-other-gauge-grade/index.vue.mjs +260 -260
  20. package/es/components/chart-other-gauge-stage/index.vue.mjs +260 -260
  21. package/es/components/chart-other-graph-basic/index.vue.mjs +260 -260
  22. package/es/components/chart-other-graph-basic2/index.vue.mjs +260 -260
  23. package/es/components/chart-other-graph-calendar/index.vue.mjs +260 -260
  24. package/es/components/chart-other-grid-percentage/index.vue.mjs +266 -266
  25. package/es/components/chart-other-heatmap/index.vue.mjs +260 -260
  26. package/es/components/chart-other-label-gauge/index.vue.mjs +262 -262
  27. package/es/components/chart-other-liquidfill/index.vue.mjs +259 -259
  28. package/es/components/chart-other-parallel-basic/index.vue.mjs +260 -260
  29. package/es/components/chart-other-parallel-mul/index.vue.mjs +260 -260
  30. package/es/components/chart-other-radar/index.vue.mjs +281 -281
  31. package/es/components/chart-other-radar-stack/index.vue.mjs +261 -261
  32. package/es/components/chart-other-sunburst-basic/index.vue.mjs +260 -260
  33. package/es/components/chart-other-sunburst-basic2/index.vue.mjs +260 -260
  34. package/es/components/chart-other-sunburst-basic3/index.vue.mjs +260 -260
  35. package/es/components/chart-other-sunburst-basic4/index.vue.mjs +260 -260
  36. package/es/components/chart-other-sunburst-book/index.vue.mjs +260 -260
  37. package/es/components/chart-other-sunburst-flavors/index.vue.mjs +260 -260
  38. package/es/components/chart-other-sunburst-radius/index.vue.mjs +260 -260
  39. package/es/components/chart-other-theme-river/index.vue.mjs +265 -265
  40. package/es/components/chart-other-tree/index.vue.mjs +259 -259
  41. package/es/components/chart-other-tree-line/index.vue.mjs +259 -259
  42. package/es/components/chart-other-treemap/index.vue.mjs +259 -259
  43. package/es/components/chart-other-treemap-basic/index.vue.mjs +259 -259
  44. package/es/components/chart-other-word-cloud/index.vue.mjs +259 -259
  45. package/es/components/commons/custom-component-render/index.d.ts +76 -76
  46. package/es/components/commons/custom-component-render/index.vue.d.ts +76 -76
  47. package/es/components/commons/custom-component-render/index.vue.mjs +7 -7
  48. package/es/components/commons/custom-component-render/index.vue2.mjs +280 -280
  49. package/es/components/commons-echarts/compileAndRunEcharts.mjs +279 -279
  50. package/es/components/commons-gaussian-splatting-view/index.vue.mjs +7 -7
  51. package/es/components/commons-loop-iterator/index.vue.mjs +7 -7
  52. package/es/components/commons-loop-iterator/index.vue2.mjs +315 -315
  53. package/es/components/commons-product-model/index.vue.mjs +7 -7
  54. package/es/components/commons-product-model/index.vue2.mjs +424 -424
  55. package/es/components/commons-qrcode/index.vue.d.ts +90 -90
  56. package/es/components/commons-qrcode/index.vue.mjs +7 -7
  57. package/es/components/commons-three-loader/index.vue.mjs +7 -7
  58. package/es/components/commons-three-loader/index.vue2.mjs +410 -410
  59. package/es/components/commons-three-loader3/index.vue.mjs +7 -7
  60. package/es/components/commons-three-loader3/index.vue2.mjs +387 -387
  61. package/es/components/commons-weather/index.vue.mjs +7 -7
  62. package/es/components/commons-weather/index.vue2.mjs +297 -297
  63. package/es/components/commons-weather-dynamic/index.vue.mjs +7 -7
  64. package/es/components/commons-weather-dynamic/index.vue2.mjs +305 -305
  65. package/es/components/graphical-circle/index.vue.mjs +7 -7
  66. package/es/components/graphical-diamond/index.vue.mjs +7 -7
  67. package/es/components/graphical-hexagon/index.vue.mjs +7 -7
  68. package/es/components/graphical-isosceles-triangle/index.vue.mjs +7 -7
  69. package/es/components/graphical-pentagon/index.vue.mjs +7 -7
  70. package/es/components/graphical-rect/index.vue.mjs +7 -7
  71. package/es/components/graphical-right-triangle/index.vue.mjs +7 -7
  72. package/es/components/index.d.ts +113 -113
  73. package/es/components/index.mjs +364 -364
  74. package/es/components/interaction/button/index.vue.mjs +7 -7
  75. package/es/components/interaction/button/index.vue2.mjs +280 -280
  76. package/es/components/interaction/date-picker/components/common-date-picker/index.vue.mjs +7 -7
  77. package/es/components/interaction/date-picker/components/common-date-picker/index.vue2.mjs +409 -409
  78. package/es/components/interaction/date-picker/src/date-picker/index.d.ts +186 -186
  79. package/es/components/interaction/date-picker/src/date-picker/index.vue.d.ts +186 -186
  80. package/es/components/interaction/date-picker/src/date-picker-range/index.d.ts +186 -186
  81. package/es/components/interaction/date-picker/src/date-picker-range/index.vue.d.ts +186 -186
  82. package/es/components/interaction/tabs/index.vue.mjs +272 -272
  83. package/es/components/interaction/tabs-icon/index.vue.mjs +277 -277
  84. package/es/components/interaction-button/index.vue.mjs +7 -7
  85. package/es/components/interaction-button-image/index.vue.mjs +7 -7
  86. package/es/components/interaction-button-refresh/index.vue.mjs +7 -7
  87. package/es/components/interaction-data-picker/index.vue.mjs +7 -7
  88. package/es/components/interaction-input/index.vue.mjs +7 -7
  89. package/es/components/interaction-input/index.vue2.mjs +286 -286
  90. package/es/components/interaction-select/index.vue.mjs +7 -7
  91. package/es/components/interaction-select/index.vue2.mjs +422 -422
  92. package/es/components/interaction-slider/index.vue.mjs +7 -7
  93. package/es/components/interaction-slider/index.vue2.mjs +283 -283
  94. package/es/components/interaction-switch/index.vue.mjs +7 -7
  95. package/es/components/interaction-switch/index.vue2.mjs +244 -244
  96. package/es/components/interaction-tabs/index.vue.mjs +7 -7
  97. package/es/components/interaction-tabs/index.vue2.mjs +255 -255
  98. package/es/components/interaction-tabs2/index.vue.mjs +7 -7
  99. package/es/components/interaction-tabs2/index.vue2.mjs +255 -255
  100. package/es/components/map-earth-basic/index.vue.mjs +332 -332
  101. package/es/components/map-earth-cool-tech/index.vue.mjs +332 -332
  102. package/es/components/map-earth-fly-line/index.vue.mjs +332 -332
  103. package/es/components/map-earth-hacker/index.vue.mjs +332 -332
  104. package/es/components/map-earth-particle/index.vue.mjs +332 -332
  105. package/es/components/media-audio/index.vue.mjs +7 -7
  106. package/es/components/media-audio/index.vue2.mjs +277 -277
  107. package/es/components/media-audio-dynamic/index.vue.mjs +7 -7
  108. package/es/components/media-audio-dynamic/index.vue2.mjs +296 -296
  109. package/es/components/media-carousel/index.vue.mjs +7 -7
  110. package/es/components/media-carousel-slides/index.vue.mjs +7 -7
  111. package/es/components/media-flv/index.vue.mjs +284 -284
  112. package/es/components/media-iframe/index.vue.mjs +7 -7
  113. package/es/components/media-iframe/index.vue2.mjs +217 -217
  114. package/es/components/media-iframe-carousel/index.vue.mjs +7 -7
  115. package/es/components/media-iframe-dynamic/index.vue.mjs +7 -7
  116. package/es/components/media-iframe-dynamic/index.vue2.mjs +261 -261
  117. package/es/components/media-image/index.vue.mjs +7 -7
  118. package/es/components/media-image-dynamic/index.vue.mjs +7 -7
  119. package/es/components/media-image-dynamic/index.vue2.mjs +236 -236
  120. package/es/components/media-m3u8/index.vue.mjs +302 -302
  121. package/es/components/media-m3u8-dynamic/index.vue.mjs +319 -319
  122. package/es/components/media-video/index.vue.mjs +7 -7
  123. package/es/components/media-video/index.vue2.mjs +258 -258
  124. package/es/components/media-video-dynamic/index.vue.mjs +7 -7
  125. package/es/components/media-video-dynamic/index.vue2.mjs +280 -280
  126. package/es/components/media-wavesurfer/index.vue.mjs +7 -7
  127. package/es/components/scene-amap2d/index.vue.mjs +7 -7
  128. package/es/components/scene-amap2d/index.vue2.mjs +627 -627
  129. package/es/components/scene-amap3d/index.vue.mjs +7 -7
  130. package/es/components/scene-amap3d/index.vue2.mjs +752 -752
  131. package/es/components/scene-default/index.vue.mjs +7 -7
  132. package/es/components/scene-default/index.vue2.mjs +221 -221
  133. package/es/components/scene-map3d/index.vue.mjs +8 -8
  134. package/es/components/scene-map3d/index.vue2.mjs +480 -480
  135. package/es/components/scene-ue-iframe/index.vue.mjs +7 -7
  136. package/es/components/scene-ue-iframe/index.vue2.mjs +242 -242
  137. package/es/components/scene-ue-shj/index.vue.mjs +7 -7
  138. package/es/components/scene-ue-shj/index.vue2.mjs +219 -219
  139. package/es/components/scene-unity-iframe/index.vue.mjs +7 -7
  140. package/es/components/scene-unity-iframe/index.vue2.mjs +224 -224
  141. package/es/components/scene-unity-webgl/index.vue.mjs +7 -7
  142. package/es/components/scene-unity-webgl/index.vue2.mjs +226 -226
  143. package/es/components/scene-vr/index.d.ts +101 -101
  144. package/es/components/scene-vr/index.vue.d.ts +102 -102
  145. package/es/components/scene-vr/index.vue.mjs +7 -7
  146. package/es/components/scene-vr/index.vue2.mjs +543 -543
  147. package/es/components/text/list/index.vue.mjs +295 -295
  148. package/es/components/text-carousel/index.vue.mjs +7 -7
  149. package/es/components/text-count-down/index.vue.mjs +7 -7
  150. package/es/components/text-count-down/index.vue2.mjs +284 -284
  151. package/es/components/text-over-number/index.vue.mjs +7 -7
  152. package/es/components/text-over-number/index.vue2.mjs +286 -286
  153. package/es/components/text-real-time/index.vue.mjs +7 -7
  154. package/es/components/text-real-time/index.vue2.mjs +241 -241
  155. package/es/components/text-row-scroll/index.vue.mjs +7 -7
  156. package/es/components/text-row-scroll/index.vue2.mjs +352 -352
  157. package/es/components/text-table-basic/index.vue.mjs +7 -7
  158. package/es/components/text-table-basic/index.vue2.mjs +366 -366
  159. package/es/components/text-table-scroll/index.vue.mjs +7 -7
  160. package/es/components/text-table-scroll/index.vue2.mjs +356 -356
  161. package/es/components/text-text-basic/index.vue.mjs +7 -7
  162. package/es/components/text-text-dynamic/index.vue.mjs +7 -7
  163. package/es/components/text-text-dynamic/index.vue2.mjs +242 -242
  164. package/es/components/text-title/index.vue.mjs +7 -7
  165. package/es/index.mjs +388 -388
  166. package/es/plugins/datasource/index.mjs +216 -216
  167. package/es/widgets.css +1 -1
  168. package/package.json +2 -2
  169. package/umd/index.js +33660 -0
  170. package/umd/widgets.css +1 -0
@@ -1,424 +1,424 @@
1
- var _ = Object.defineProperty;
2
- var U = (p, m, c) => m in p ? _(p, m, { enumerable: !0, configurable: !0, writable: !0, value: c }) : p[m] = c;
3
- var l = (p, m, c) => U(p, typeof m != "symbol" ? m + "" : m, c);
4
- import { defineComponent as T, watch as h, createElementBlock as B, openBlock as D, createElementVNode as V, createCommentVNode as K, normalizeClass as W, unref as P, toDisplayString as q, ref as S, onMounted as N, onBeforeUnmount as Y } from "vue";
5
- import "@babylonjs/loaders/glTF";
6
- import { cloneDeep as u, isEqual as f } from "lodash";
7
- import { useResizeObserver as J } from "@vueuse/core";
8
- import { Engine as j, Scene as Q, Color4 as w, Color3 as b, DefaultRenderingPipeline as X, DepthOfFieldEffectBlurLevel as A, Vector3 as v, DirectionalLight as Z, ShadowGenerator as $, Tools as G, SceneLoader as O } from "@babylonjs/core";
9
- import "../text-text-basic/index.mjs";
10
- import "../text-table-basic/index.mjs";
11
- import "../chart-other-gauge/index.mjs";
12
- import "../chart-other-gauge-stage/index.mjs";
13
- import "../chart-other-gauge-grade/index.mjs";
14
- import "../chart-other-word-cloud/index.mjs";
15
- import "../chart-other-liquidfill/index.mjs";
16
- import "../chart-other-funnel/index.mjs";
17
- import "../chart-other-force/index.mjs";
18
- import "../chart-other-radar/index.mjs";
19
- import "../chart-other-funnel-split/index.mjs";
20
- import "../chart-other-funnel-contrast/index.mjs";
21
- import "../chart-other-candlestick-basic/index.mjs";
22
- import "../chart-other-candlestick-shanghai/index.mjs";
23
- import "../chart-other-candlestick-demo/index.mjs";
24
- import "../chart-other-heatmap/index.mjs";
25
- import "../chart-other-force2/index.mjs";
26
- import "../chart-other-graph-basic/index.mjs";
27
- import "../chart-other-graph-basic2/index.mjs";
28
- import "../chart-other-graph-calendar/index.mjs";
29
- import "../chart-other-tree-line/index.mjs";
30
- import "../chart-other-treemap-basic/index.mjs";
31
- import "../chart-other-sunburst-basic/index.mjs";
32
- import "../chart-other-sunburst-basic2/index.mjs";
33
- import "../chart-other-sunburst-basic3/index.mjs";
34
- import "../chart-other-sunburst-basic4/index.mjs";
35
- import "../chart-other-sunburst-book/index.mjs";
36
- import "../chart-other-sunburst-radius/index.mjs";
37
- import "../chart-other-sunburst-flavors/index.mjs";
38
- import "../chart-other-parallel-basic/index.mjs";
39
- import "../chart-other-parallel-mul/index.mjs";
40
- import "../chart-other-circular-graph/index.mjs";
41
- import "../map-earth-basic/index.mjs";
42
- import "../map-earth-cool-tech/index.mjs";
43
- import "../map-earth-particle/index.mjs";
44
- import "../map-earth-hacker/index.mjs";
45
- import "../map-earth-fly-line/index.mjs";
46
- import "../chart-other-grid-percentage/index.mjs";
47
- import "../chart-other-radar-stack/index.mjs";
48
- import "../chart-other-funnel2/index.mjs";
49
- import "../chart-other-label-gauge/index.mjs";
50
- import "../chart-other-theme-river/index.mjs";
51
- import "../chart-other-tree/index.mjs";
52
- import "../chart-other-treemap/index.mjs";
53
- import "./index.mjs";
54
- import "../commons-vr-photo/index.mjs";
55
- import "../commons-vr-video/index.mjs";
56
- import "../commons-three-loader/index.mjs";
57
- import "../commons-three-loader3/index.mjs";
58
- import "../commons-loop-iterator/index.mjs";
59
- import "../commons-gaussian-splatting-view/index.mjs";
60
- import "../commons-babylon/index.mjs";
61
- import "../commons-svg/index.mjs";
62
- import "../commons-weather/index.mjs";
63
- import "../commons-weather-dynamic/index.mjs";
64
- import "../media-wavesurfer/index.mjs";
65
- import "../interaction-tabs/index.mjs";
66
- import "../interaction-tabs2/index.mjs";
67
- import "../interaction-button/index.mjs";
68
- import "../interaction-button-image/index.mjs";
69
- import "../interaction-select/index.mjs";
70
- import "../interaction-input/index.mjs";
71
- import "../interaction-radio/index.mjs";
72
- import "../interaction-slider/index.mjs";
73
- import "../interaction-switch/index.mjs";
74
- import "../interaction-data-picker/index.mjs";
75
- import "../interaction-button-refresh/index.mjs";
76
- import "../media-image/index.mjs";
77
- import "../text-title/index.mjs";
78
- import "../commons-qrcode/index.mjs";
79
- import "../media-video/index.mjs";
80
- import "../media-audio/index.mjs";
81
- import "../text-real-time/index.mjs";
82
- import "../media-carousel/index.mjs";
83
- import "../media-carousel-slides/index.mjs";
84
- import "../media-iframe-carousel/index.mjs";
85
- import "../media-iframe/index.mjs";
86
- import "../media-m3u8/index.mjs";
87
- import "../media-m3u8-dynamic/index.mjs";
88
- import "../media-audio-dynamic/index.mjs";
89
- import "../media-video-dynamic/index.mjs";
90
- import "../media-image-dynamic/index.mjs";
91
- import "../media-iframe-dynamic/index.mjs";
92
- import "../media-flv/index.mjs";
93
- import "../commons-echarts/index.mjs";
94
- import "../text-over-number/index.mjs";
95
- import "../text-table-scroll/index.mjs";
96
- import "../text-carousel/index.mjs";
97
- import "../text-row-scroll/index.mjs";
98
- import "../text-text-dynamic/index.mjs";
99
- import "../text-count-down/index.mjs";
100
- import "../graphical-circle/index.mjs";
101
- import "../graphical-diamond/index.mjs";
102
- import "../graphical-hexagon/index.mjs";
103
- import "../graphical-isosceles-triangle/index.mjs";
104
- import "../graphical-pentagon/index.mjs";
105
- import "../graphical-rect/index.mjs";
106
- import "../graphical-right-triangle/index.mjs";
107
- import "../scene-map3d/index.mjs";
108
- import "../scene-amap2d/index.mjs";
109
- import "../scene-amap3d/index.mjs";
110
- import "../scene-vr/index.mjs";
111
- import "../scene-unity-iframe/index.mjs";
112
- import "../scene-unity-webgl/index.mjs";
113
- import "../scene-ue-iframe/index.mjs";
114
- import "../scene-ue-shj/index.mjs";
115
- import "../scene-default/index.mjs";
116
- import "../interaction/tabs/index.mjs";
117
- import "../interaction/tabs-icon/index.mjs";
118
- import "../interaction/button/index.mjs";
119
- import "../interaction/date-picker/src/date-picker/index.mjs";
120
- import "../interaction/date-picker/src/date-picker-range/index.mjs";
121
- import "../text/list/index.mjs";
122
- import "../chart/src/bar/basic/index.mjs";
123
- import "../chart/src/bar/animation/index.mjs";
124
- import "../chart/src/bar/contrast/index.mjs";
125
- import "../chart/src/bar/contrast2/index.mjs";
126
- import "../chart/src/bar/contrast3/index.mjs";
127
- import "../chart/src/bar/gradient-column-chart/index.mjs";
128
- import "../chart/src/bar/horizontal/index.mjs";
129
- import "../chart/src/bar/horizontal-stack/index.mjs";
130
- import "../chart/src/bar/line-bar/index.mjs";
131
- import "../chart/src/bar/line-bar2/index.mjs";
132
- import "../chart/src/bar/loop/index.mjs";
133
- import "../chart/src/bar/mini/index.mjs";
134
- import "../chart/src/bar/polar/index.mjs";
135
- import "../chart/src/bar/polar-stack/index.mjs";
136
- import "../chart/src/bar/polar2/index.mjs";
137
- import "../chart/src/bar/radius-circle/index.mjs";
138
- import "../chart/src/bar/rank/index.mjs";
139
- import "../chart/src/bar/segmented-progress/index.mjs";
140
- import "../chart/src/bar/spire/index.mjs";
141
- import "../chart/src/bar/stack/index.mjs";
142
- import "../chart/src/bar/stack-line/index.mjs";
143
- import "../chart/src/bar/stack2/index.mjs";
144
- import "../chart/src/bar/stack3/index.mjs";
145
- import "../chart/src/bar/staggered/index.mjs";
146
- import "../chart/src/bar/three/index.mjs";
147
- import "../chart/src/bar/waterfall/index.mjs";
148
- import "../chart/src/bar/zebra/index.mjs";
149
- import "../chart/src/line/area-gradient/index.mjs";
150
- import "../chart/src/line/area-highlight/index.mjs";
151
- import "../chart/src/line/area-highlight2/index.mjs";
152
- import "../chart/src/line/basic/index.mjs";
153
- import "../chart/src/line/bump/index.mjs";
154
- import "../chart/src/line/dashed/index.mjs";
155
- import "../chart/src/line/ladder/index.mjs";
156
- import "../chart/src/line/logarithm/index.mjs";
157
- import "../chart/src/line/multix/index.mjs";
158
- import "../chart/src/line/polar-double/index.mjs";
159
- import "../chart/src/line/rain-flow/index.mjs";
160
- import "../chart/src/line/scale/index.mjs";
161
- import "../chart/src/line/smooth/index.mjs";
162
- import "../chart/src/line/smooth-area/index.mjs";
163
- import "../chart/src/line/stack/index.mjs";
164
- import "../chart/src/line/stack-area/index.mjs";
165
- import "../chart/src/line/temp/index.mjs";
166
- import "../chart/src/line/vertical/index.mjs";
167
- import "../chart/src/map/basic/index.mjs";
168
- import "../chart/src/map/bmap-basic/index.mjs";
169
- import "../chart/src/map/bmap-heatmap/index.mjs";
170
- import "../chart/src/map/bmap-rich/index.mjs";
171
- import "../chart/src/map/customize/index.mjs";
172
- import "../chart/src/map/lines/index.mjs";
173
- import "../chart/src/map/scatter/index.mjs";
174
- import "../chart/src/pie/3d/index.mjs";
175
- import "../chart/src/pie/basic/index.mjs";
176
- import "../chart/src/pie/basic2/index.mjs";
177
- import "../chart/src/pie/customized/index.mjs";
178
- import "../chart/src/pie/index/index.mjs";
179
- import "../chart/src/pie/interval/index.mjs";
180
- import "../chart/src/pie/legend-scroll/index.mjs";
181
- import "../chart/src/pie/radius/index.mjs";
182
- import "../chart/src/pie/rose/index.mjs";
183
- import "../chart/src/pie/round/index.mjs";
184
- import "../chart/src/pie/sunburst/index.mjs";
185
- import "../chart/src/scatter/basic/index.mjs";
186
- import "../chart/src/scatter/basic2/index.mjs";
187
- import "../chart/src/scatter/bubble/index.mjs";
188
- import "../chart/src/scatter/ripples/index.mjs";
189
- import "../commons/custom-component-render/index.mjs";
190
- /* empty css */
191
- /* empty css */
192
- import "../../plugins/datasource/utils/request.mjs";
193
- import "../../plugins/datasource/utils/wsManager.mjs";
194
- import { SHJParseEvent as z } from "../../plugins/event/index.mjs";
195
- const ee = { class: "zerov-widget" }, ie = T({ name: "zv-commons-product-model" }), Go = /* @__PURE__ */ T({
196
- ...ie,
197
- props: {
198
- basicOption: {},
199
- basicEvents: {},
200
- useEvents: {}
201
- },
202
- emits: [
203
- "on-load-success",
204
- "on-play-animation"
205
- ],
206
- setup(p, { expose: m, emit: c }) {
207
- const x = c, a = p, H = (i, o) => {
208
- const d = S(), y = S(), E = S(!0);
209
- class I {
210
- // eslint-disable-next-line no-useless-constructor
211
- constructor(e) {
212
- // optional, but needed due to interface definitions
213
- l(this, "loadingUIBackgroundColor");
214
- this.loadingUIText = e;
215
- }
216
- displayLoadingUI() {
217
- d.value && (E.value = !0);
218
- }
219
- hideLoadingUI() {
220
- d.value && (E.value = !1);
221
- }
222
- }
223
- class M {
224
- constructor(e, t, s) {
225
- l(this, "scene");
226
- l(this, "engine");
227
- // 默认环境
228
- l(this, "environmentHelper");
229
- l(this, "shadowsLight");
230
- // 全局阴影
231
- l(this, "shadowGenerator");
232
- // 默认后期
233
- l(this, "defaultPipeline");
234
- this.canvas = e, this.option = t, this.events = s;
235
- try {
236
- this.engine = new j(this.canvas, !0, {}, !1), this.engine.loadingScreen = new I(""), window.addEventListener("resize", () => {
237
- this.engine.resize();
238
- }), this.scene = this.createScene();
239
- } catch {
240
- }
241
- }
242
- createScene() {
243
- return this.engine.displayLoadingUI(), this.scene = new Q(this.engine), this.option.scene.colorShow ? this.scene.clearColor = w.FromHexString(this.option.scene.color || "#000000") : this.scene.clearColor = new w(0, 0, 0, 0), this.scene.fogEnabled = this.option.scene.fogEnabled, this.scene.fogMode = this.option.scene.fogMode || 1, this.scene.fogColor = b.FromHexString(this.option.scene.fogColor || "#ffffff"), this.scene.fogEnd = this.option.scene.fogEnd || 60, this.scene.fogStart = this.option.scene.fogStart || 1, this.scene.fogDensity = this.option.scene.fogDensity || 0.1, this.scene.createDefaultCamera(!0, !1, !0), this.updateMeshs(this.scene), this.scene;
244
- }
245
- updateScenePipeline(e) {
246
- this.scene.activeCamera && e && (e.enabled ? (this.defaultPipeline || (this.defaultPipeline = new X(
247
- "defaultPipeline",
248
- !0,
249
- this.scene,
250
- [this.scene.activeCamera]
251
- )), this.defaultPipeline.samples = e.samples ? 4 : 1, this.defaultPipeline.fxaaEnabled = e.fxaaEnabled, this.defaultPipeline.grainEnabled = e.grainEnabled, this.defaultPipeline.grain.intensity = e.grainIntensity, this.defaultPipeline.grain.animated = e.grainAnimated, this.defaultPipeline.bloomEnabled = e.bloomEnabled, this.defaultPipeline.bloomThreshold = e.bloomThreshold, this.defaultPipeline.bloomWeight = e.bloomWeight, this.defaultPipeline.bloomKernel = e.bloomKernel, this.defaultPipeline.bloomScale = e.bloomScale, this.defaultPipeline.depthOfFieldEnabled = e.depthOfFieldEnabled, e.depthOfFieldBlurLevel < 1 ? this.defaultPipeline.depthOfFieldBlurLevel = A.Low : e.depthOfFieldBlurLevel < 2 ? this.defaultPipeline.depthOfFieldBlurLevel = A.Medium : e.depthOfFieldBlurLevel < 3 && (this.defaultPipeline.depthOfFieldBlurLevel = A.High), this.defaultPipeline.depthOfField.focusDistance = e.depthOfFieldFocusDistance, this.defaultPipeline.depthOfField.fStop = e.depthOfFieldFStop, this.defaultPipeline.depthOfField.focalLength = e.depthOfFieldFocalLength, this.defaultPipeline.chromaticAberrationEnabled = e.chromaticAberrationEnabled, this.defaultPipeline.chromaticAberration.aberrationAmount = e.chromaticAberrationAberrationAmount, this.defaultPipeline.chromaticAberration.radialIntensity = e.chromaticAberrationRadialIntensity, e.chromaticAberrationDirection === 0 ? (this.defaultPipeline.chromaticAberration.direction.x = 0, this.defaultPipeline.chromaticAberration.direction.y = 0) : (this.defaultPipeline.chromaticAberration.direction.x = Math.sin(e.chromaticAberrationDirection), this.defaultPipeline.chromaticAberration.direction.y = Math.cos(e.chromaticAberrationDirection)), this.defaultPipeline.sharpenEnabled = e.sharpenEnabled, this.defaultPipeline.sharpen.edgeAmount = e.sharpenEdgeAmount, this.defaultPipeline.sharpen.colorAmount = e.sharpenColorAmount) : this.defaultPipeline && (this.defaultPipeline.dispose(), this.defaultPipeline = null));
252
- }
253
- updateScene(e) {
254
- e.colorShow ? this.scene.clearColor = w.FromHexString(e.color || "#000000") : this.scene.clearColor = new w(0, 0, 0, 0), this.scene.fogEnabled = e.fogEnabled, this.scene.fogMode = e.fogMode || 1, this.scene.fogColor = b.FromHexString(e.fogColor || "#ffffff"), this.scene.fogEnd = e.fogEnd || 60, this.scene.fogStart = e.fogStart || 1, this.scene.fogDensity = e.fogDensity || 0.1;
255
- }
256
- updateShadowsLight(e) {
257
- if (e.show) {
258
- if (this.shadowsLight) {
259
- this.shadowsLight.direction = new v(...e.direction), this.shadowsLight.position = new v(...e.position), this.shadowsLight.intensity = e.intensity, this.shadowsLight.diffuse = b.FromHexString(e.diffuse || "#ffffff"), this.shadowGenerator.mapSize = e.mapSize;
260
- return;
261
- }
262
- this.shadowsLight = new Z("shadowsLight", new v(...e.direction), this.scene), this.shadowsLight.intensity = e.intensity || 0.6, this.shadowsLight.diffuse = b.FromHexString(e.diffuse || "#ffffff"), this.shadowsLight.position = new v(...e.position), this.shadowGenerator = new $(e.mapSize, this.shadowsLight);
263
- } else
264
- this.shadowsLight && (this.shadowsLight.dispose(), this.shadowsLight = null);
265
- }
266
- updateCamera(e) {
267
- const t = this.scene.activeCamera;
268
- t && (e.radius && (t.radius = e.radius), t.beta = G.ToRadians(e.beta), t.alpha = G.ToRadians(e.alpha), t.useAutoRotationBehavior = e.autoRotation, t.wheelDeltaPercentage = e.wheelDeltaPercentage || 0.01, t.panningSensibility = 1 / (e.panningSensibility || 0.01), t.lowerRadiusLimit = e.lowerRadiusLimit, t.upperRadiusLimit = e.upperRadiusLimit, t.lowerBetaLimit = 0, t.upperBetaLimit = Math.PI / 2.1);
269
- }
270
- updateDefaultEnvironment(e) {
271
- this.environmentHelper && this.environmentHelper.dispose(), this.environmentHelper = this.scene.createDefaultEnvironment({
272
- // 是否创建地面
273
- createGround: e.createGround,
274
- // 地面颜色
275
- groundColor: b.FromHexString(e.groundColor || "#ffffff"),
276
- // 地面大小
277
- groundSize: e.groundSize || 15,
278
- // 地面透明度
279
- groundOpacity: e.groundOpacity || 1,
280
- // 使地面能够接收阴影。
281
- enableGroundShadow: e.enableGroundShadow,
282
- // 接收阴影等级
283
- groundShadowLevel: e.groundShadowLevel || 0.5,
284
- // 地面反射
285
- enableGroundMirror: e.enableGroundMirror === void 0 ? !0 : e.enableGroundMirror,
286
- // 地面反射大小比率
287
- groundMirrorSizeRatio: e.groundMirrorSizeRatio || 0.3,
288
- // 地面反射模糊大小
289
- groundMirrorBlurKernel: e.groundMirrorBlurKernel || 64,
290
- // 指定地面反射镜的可见性。
291
- groundMirrorAmount: e.groundMirrorAmount || 1,
292
- // 指定地面镜反射率权重。这使用背景材质的标准重量来设置菲涅耳效果的镜子。
293
- groundMirrorFresnelWeight: e.groundMirrorFresnelWeight || 1,
294
- // 指定应用于地面垂直位置的偏移
295
- groundYBias: e.groundYBias || 0,
296
- // 创建天空盒
297
- createSkybox: e.createSkybox,
298
- // 天空盒大小
299
- skyboxSize: e.skyboxSize || 20,
300
- ...e.skyboxTexture ? { skyboxTexture: e.skyboxTexture } : {},
301
- // 天空盒颜色
302
- // 自动计算元素的大小以最适合场景。
303
- sizeAuto: !0,
304
- // 如果autoSize不为true,rootMesh的默认位置。
305
- // rootPosition: Vector3,
306
- // 环境贴图
307
- ...e.environmentTexture ? { environmentTexture: e.environmentTexture } : {},
308
- // 相机曝光
309
- cameraExposure: e.cameraExposure || 0.6,
310
- // 相机对比度
311
- cameraContrast: e.cameraContrast || 1.6
312
- }), this.environmentHelper.ground && (this.environmentHelper.ground.position.y += 0.01);
313
- }
314
- updateMeshs(e) {
315
- e.meshes.forEach((t) => setTimeout(() => t.dispose())), O.ImportMeshAsync("", this.option.meshs.url, "", e, (t) => {
316
- y.value = (t.loaded / t.total * 100).toFixed(2);
317
- }).then((t) => {
318
- const s = t.meshes;
319
- if (this.option.animationGroups = e.animationGroups.map((n) => ({
320
- uniqueId: n.uniqueId,
321
- name: n.name
322
- })), this.events && (this.events.function[0].args[0].select = e.animationGroups.map((n) => ({
323
- name: n.name,
324
- value: n.name
325
- }))), this.option.defaultAnimation && this.option.defaultAnimation.name ? this.playAnimation(this.option.defaultAnimation.name, {
326
- loop: this.option.defaultAnimation.loop,
327
- speedRatio: this.option.defaultAnimation.speedRatio
328
- }) : e.animationGroups && e.animationGroups[0] && e.animationGroups[0].stop(), this.updateShadowsLight(this.option.shadow), e.createDefaultCamera(!0, !0, !0), this.updateCamera(this.option.camera), this.updateScenePipeline(this.option.pipelineOption), this.updateDefaultEnvironment(this.option.environment), this.option.meshs.isCasterShadow && this.shadowGenerator) {
329
- this.shadowGenerator.addShadowCaster(e.meshes[0], !0);
330
- for (let n = 0; n < s.length; n++)
331
- s[n].receiveShadows = !1;
332
- }
333
- s[0].position = new v(...this.option.meshs.position), setTimeout(() => {
334
- this.engine.hideLoadingUI(), x("on-load-success"), z.parseEvents(a.useEvents, "on-load-success");
335
- }, 100);
336
- });
337
- }
338
- run() {
339
- return this.engine.runRenderLoop(() => {
340
- this.scene.render();
341
- }), this;
342
- }
343
- dispose() {
344
- this.scene && this.engine && (this.scene.dispose(), this.engine.dispose());
345
- }
346
- playAnimation(e, t = {
347
- loop: !1,
348
- speedRatio: 1
349
- }) {
350
- if (this.scene) {
351
- this.scene.stopAllAnimations();
352
- const s = this.scene.getAnimationGroupByName(e);
353
- s && (x("on-play-animation"), z.parseEvents(a.useEvents, "on-play-animation"), s.start(t.loop, t.speedRatio, s.from, s.to, !1));
354
- }
355
- }
356
- }
357
- const g = S();
358
- return N(() => {
359
- i.meshs && (g.value = new M(d.value, i, o).run(), J(d.value, (R) => {
360
- g.value && g.value.engine.resize();
361
- }));
362
- }), Y(() => {
363
- g.value && g.value.dispose();
364
- }), {
365
- canvasRef: d,
366
- babylon: g,
367
- Babylon: M,
368
- babylonLoadingStatus: E,
369
- babylonLoadingTitle: y
370
- };
371
- }, { canvasRef: L, babylon: r, Babylon: C, babylonLoadingStatus: F, babylonLoadingTitle: k } = H(a.basicOption, a.basicEvents);
372
- return m({
373
- playAnimation: (i, o) => {
374
- const d = o[0].value, y = {
375
- loop: o[1].keys[0].defaultValue,
376
- speedRatio: o[1].keys[1].defaultValue
377
- };
378
- r.value.playAnimation(d, y);
379
- }
380
- }), h(() => u(a.basicOption.environment), (i, o) => {
381
- !f(i, o) && r.value && r.value.updateDefaultEnvironment(i);
382
- }, {
383
- deep: !0
384
- }), h(() => u(a.basicOption.shadow), (i, o) => {
385
- !f(i, o) && r.value && r.value.updateShadowsLight(i);
386
- }, {
387
- deep: !0
388
- }), h(() => u(a.basicOption.camera), (i, o) => {
389
- !f(i, o) && r.value && r.value.updateCamera(i);
390
- }, {
391
- deep: !0
392
- }), h(() => u(a.basicOption.meshs), (i, o) => {
393
- !f(i, o) && r.value && (r.value.dispose(), r.value = new C(L.value, a.basicOption, a.basicEvents).run());
394
- }, {
395
- deep: !0
396
- }), h(() => u(a.basicOption.defaultAnimation), (i, o) => {
397
- !f(i, o) && r.value && (r.value.dispose(), r.value = new C(L.value, a.basicOption, a.basicEvents).run());
398
- }, {
399
- deep: !0
400
- }), h(() => u(a.basicOption.scene), (i, o) => {
401
- !f(i, o) && r.value && r.value.updateScene(i);
402
- }, {
403
- deep: !0
404
- }), h(() => u(a.basicOption.pipelineOption), (i, o) => {
405
- !f(i, o) && r.value && r.value.updateScenePipeline(i);
406
- }, {
407
- deep: !0
408
- }), (i, o) => (D(), B("div", ee, [
409
- V("canvas", {
410
- ref_key: "canvasRef",
411
- ref: L,
412
- class: W(["widget", { show: !P(F) }])
413
- }, null, 2),
414
- P(F) ? (D(), B("div", {
415
- key: 0,
416
- ref: "babylonLoadingRef",
417
- class: "babylon-loading"
418
- }, " 正在加载模型...(" + q(P(k)) + "%) ", 513)) : K("", !0)
419
- ]));
420
- }
421
- });
422
- export {
423
- Go as default
424
- };
1
+ var _ = Object.defineProperty;
2
+ var U = (p, m, c) => m in p ? _(p, m, { enumerable: !0, configurable: !0, writable: !0, value: c }) : p[m] = c;
3
+ var l = (p, m, c) => U(p, typeof m != "symbol" ? m + "" : m, c);
4
+ import { defineComponent as T, watch as h, createElementBlock as B, openBlock as D, createElementVNode as V, createCommentVNode as K, normalizeClass as W, unref as P, toDisplayString as q, ref as S, onMounted as N, onBeforeUnmount as Y } from "vue";
5
+ import "@babylonjs/loaders/glTF";
6
+ import { cloneDeep as u, isEqual as f } from "lodash";
7
+ import { useResizeObserver as J } from "@vueuse/core";
8
+ import { Engine as j, Scene as Q, Color4 as w, Color3 as b, DefaultRenderingPipeline as X, DepthOfFieldEffectBlurLevel as A, Vector3 as v, DirectionalLight as Z, ShadowGenerator as $, Tools as G, SceneLoader as O } from "@babylonjs/core";
9
+ import "../text-text-basic/index.mjs";
10
+ import "../text-table-basic/index.mjs";
11
+ import "../chart-other-gauge/index.mjs";
12
+ import "../chart-other-gauge-stage/index.mjs";
13
+ import "../chart-other-gauge-grade/index.mjs";
14
+ import "../chart-other-word-cloud/index.mjs";
15
+ import "../chart-other-liquidfill/index.mjs";
16
+ import "../chart-other-funnel/index.mjs";
17
+ import "../chart-other-force/index.mjs";
18
+ import "../chart-other-radar/index.mjs";
19
+ import "../chart-other-funnel-split/index.mjs";
20
+ import "../chart-other-funnel-contrast/index.mjs";
21
+ import "../chart-other-candlestick-basic/index.mjs";
22
+ import "../chart-other-candlestick-shanghai/index.mjs";
23
+ import "../chart-other-candlestick-demo/index.mjs";
24
+ import "../chart-other-heatmap/index.mjs";
25
+ import "../chart-other-force2/index.mjs";
26
+ import "../chart-other-graph-basic/index.mjs";
27
+ import "../chart-other-graph-basic2/index.mjs";
28
+ import "../chart-other-graph-calendar/index.mjs";
29
+ import "../chart-other-tree-line/index.mjs";
30
+ import "../chart-other-treemap-basic/index.mjs";
31
+ import "../chart-other-sunburst-basic/index.mjs";
32
+ import "../chart-other-sunburst-basic2/index.mjs";
33
+ import "../chart-other-sunburst-basic3/index.mjs";
34
+ import "../chart-other-sunburst-basic4/index.mjs";
35
+ import "../chart-other-sunburst-book/index.mjs";
36
+ import "../chart-other-sunburst-radius/index.mjs";
37
+ import "../chart-other-sunburst-flavors/index.mjs";
38
+ import "../chart-other-parallel-basic/index.mjs";
39
+ import "../chart-other-parallel-mul/index.mjs";
40
+ import "../chart-other-circular-graph/index.mjs";
41
+ import "../map-earth-basic/index.mjs";
42
+ import "../map-earth-cool-tech/index.mjs";
43
+ import "../map-earth-particle/index.mjs";
44
+ import "../map-earth-hacker/index.mjs";
45
+ import "../map-earth-fly-line/index.mjs";
46
+ import "../chart-other-grid-percentage/index.mjs";
47
+ import "../chart-other-radar-stack/index.mjs";
48
+ import "../chart-other-funnel2/index.mjs";
49
+ import "../chart-other-label-gauge/index.mjs";
50
+ import "../chart-other-theme-river/index.mjs";
51
+ import "../chart-other-tree/index.mjs";
52
+ import "../chart-other-treemap/index.mjs";
53
+ import "./index.mjs";
54
+ import "../commons-vr-photo/index.mjs";
55
+ import "../commons-vr-video/index.mjs";
56
+ import "../commons-three-loader/index.mjs";
57
+ import "../commons-three-loader3/index.mjs";
58
+ import "../commons-loop-iterator/index.mjs";
59
+ import "../commons-gaussian-splatting-view/index.mjs";
60
+ import "../commons-babylon/index.mjs";
61
+ import "../commons-svg/index.mjs";
62
+ import "../commons-weather/index.mjs";
63
+ import "../commons-weather-dynamic/index.mjs";
64
+ import "../media-wavesurfer/index.mjs";
65
+ import "../interaction-tabs/index.mjs";
66
+ import "../interaction-tabs2/index.mjs";
67
+ import "../interaction-button/index.mjs";
68
+ import "../interaction-button-image/index.mjs";
69
+ import "../interaction-select/index.mjs";
70
+ import "../interaction-input/index.mjs";
71
+ import "../interaction-radio/index.mjs";
72
+ import "../interaction-slider/index.mjs";
73
+ import "../interaction-switch/index.mjs";
74
+ import "../interaction-data-picker/index.mjs";
75
+ import "../interaction-button-refresh/index.mjs";
76
+ import "../media-image/index.mjs";
77
+ import "../text-title/index.mjs";
78
+ import "../commons-qrcode/index.mjs";
79
+ import "../media-video/index.mjs";
80
+ import "../media-audio/index.mjs";
81
+ import "../text-real-time/index.mjs";
82
+ import "../media-carousel/index.mjs";
83
+ import "../media-carousel-slides/index.mjs";
84
+ import "../media-iframe-carousel/index.mjs";
85
+ import "../media-iframe/index.mjs";
86
+ import "../media-m3u8/index.mjs";
87
+ import "../media-m3u8-dynamic/index.mjs";
88
+ import "../media-audio-dynamic/index.mjs";
89
+ import "../media-video-dynamic/index.mjs";
90
+ import "../media-image-dynamic/index.mjs";
91
+ import "../media-iframe-dynamic/index.mjs";
92
+ import "../media-flv/index.mjs";
93
+ import "../commons-echarts/index.mjs";
94
+ import "../text-over-number/index.mjs";
95
+ import "../text-table-scroll/index.mjs";
96
+ import "../text-carousel/index.mjs";
97
+ import "../text-row-scroll/index.mjs";
98
+ import "../text-text-dynamic/index.mjs";
99
+ import "../text-count-down/index.mjs";
100
+ import "../graphical-circle/index.mjs";
101
+ import "../graphical-diamond/index.mjs";
102
+ import "../graphical-hexagon/index.mjs";
103
+ import "../graphical-isosceles-triangle/index.mjs";
104
+ import "../graphical-pentagon/index.mjs";
105
+ import "../graphical-rect/index.mjs";
106
+ import "../graphical-right-triangle/index.mjs";
107
+ import "../scene-map3d/index.mjs";
108
+ import "../scene-amap2d/index.mjs";
109
+ import "../scene-amap3d/index.mjs";
110
+ import "../scene-vr/index.mjs";
111
+ import "../scene-unity-iframe/index.mjs";
112
+ import "../scene-unity-webgl/index.mjs";
113
+ import "../scene-ue-iframe/index.mjs";
114
+ import "../scene-ue-shj/index.mjs";
115
+ import "../scene-default/index.mjs";
116
+ import "../interaction/tabs/index.mjs";
117
+ import "../interaction/tabs-icon/index.mjs";
118
+ import "../interaction/button/index.mjs";
119
+ import "../interaction/date-picker/src/date-picker/index.mjs";
120
+ import "../interaction/date-picker/src/date-picker-range/index.mjs";
121
+ import "../text/list/index.mjs";
122
+ import "../chart/src/bar/basic/index.mjs";
123
+ import "../chart/src/bar/animation/index.mjs";
124
+ import "../chart/src/bar/contrast/index.mjs";
125
+ import "../chart/src/bar/contrast2/index.mjs";
126
+ import "../chart/src/bar/contrast3/index.mjs";
127
+ import "../chart/src/bar/gradient-column-chart/index.mjs";
128
+ import "../chart/src/bar/horizontal/index.mjs";
129
+ import "../chart/src/bar/horizontal-stack/index.mjs";
130
+ import "../chart/src/bar/line-bar/index.mjs";
131
+ import "../chart/src/bar/line-bar2/index.mjs";
132
+ import "../chart/src/bar/loop/index.mjs";
133
+ import "../chart/src/bar/mini/index.mjs";
134
+ import "../chart/src/bar/polar/index.mjs";
135
+ import "../chart/src/bar/polar-stack/index.mjs";
136
+ import "../chart/src/bar/polar2/index.mjs";
137
+ import "../chart/src/bar/radius-circle/index.mjs";
138
+ import "../chart/src/bar/rank/index.mjs";
139
+ import "../chart/src/bar/segmented-progress/index.mjs";
140
+ import "../chart/src/bar/spire/index.mjs";
141
+ import "../chart/src/bar/stack/index.mjs";
142
+ import "../chart/src/bar/stack-line/index.mjs";
143
+ import "../chart/src/bar/stack2/index.mjs";
144
+ import "../chart/src/bar/stack3/index.mjs";
145
+ import "../chart/src/bar/staggered/index.mjs";
146
+ import "../chart/src/bar/three/index.mjs";
147
+ import "../chart/src/bar/waterfall/index.mjs";
148
+ import "../chart/src/bar/zebra/index.mjs";
149
+ import "../chart/src/line/area-gradient/index.mjs";
150
+ import "../chart/src/line/area-highlight/index.mjs";
151
+ import "../chart/src/line/area-highlight2/index.mjs";
152
+ import "../chart/src/line/basic/index.mjs";
153
+ import "../chart/src/line/bump/index.mjs";
154
+ import "../chart/src/line/dashed/index.mjs";
155
+ import "../chart/src/line/ladder/index.mjs";
156
+ import "../chart/src/line/logarithm/index.mjs";
157
+ import "../chart/src/line/multix/index.mjs";
158
+ import "../chart/src/line/polar-double/index.mjs";
159
+ import "../chart/src/line/rain-flow/index.mjs";
160
+ import "../chart/src/line/scale/index.mjs";
161
+ import "../chart/src/line/smooth/index.mjs";
162
+ import "../chart/src/line/smooth-area/index.mjs";
163
+ import "../chart/src/line/stack/index.mjs";
164
+ import "../chart/src/line/stack-area/index.mjs";
165
+ import "../chart/src/line/temp/index.mjs";
166
+ import "../chart/src/line/vertical/index.mjs";
167
+ import "../chart/src/map/basic/index.mjs";
168
+ import "../chart/src/map/bmap-basic/index.mjs";
169
+ import "../chart/src/map/bmap-heatmap/index.mjs";
170
+ import "../chart/src/map/bmap-rich/index.mjs";
171
+ import "../chart/src/map/customize/index.mjs";
172
+ import "../chart/src/map/lines/index.mjs";
173
+ import "../chart/src/map/scatter/index.mjs";
174
+ import "../chart/src/pie/3d/index.mjs";
175
+ import "../chart/src/pie/basic/index.mjs";
176
+ import "../chart/src/pie/basic2/index.mjs";
177
+ import "../chart/src/pie/customized/index.mjs";
178
+ import "../chart/src/pie/index/index.mjs";
179
+ import "../chart/src/pie/interval/index.mjs";
180
+ import "../chart/src/pie/legend-scroll/index.mjs";
181
+ import "../chart/src/pie/radius/index.mjs";
182
+ import "../chart/src/pie/rose/index.mjs";
183
+ import "../chart/src/pie/round/index.mjs";
184
+ import "../chart/src/pie/sunburst/index.mjs";
185
+ import "../chart/src/scatter/basic/index.mjs";
186
+ import "../chart/src/scatter/basic2/index.mjs";
187
+ import "../chart/src/scatter/bubble/index.mjs";
188
+ import "../chart/src/scatter/ripples/index.mjs";
189
+ import "../commons/custom-component-render/index.mjs";
190
+ /* empty css */
191
+ /* empty css */
192
+ import "../../plugins/datasource/utils/request.mjs";
193
+ import "../../plugins/datasource/utils/wsManager.mjs";
194
+ import { SHJParseEvent as z } from "../../plugins/event/index.mjs";
195
+ const ee = { class: "zerov-widget" }, ie = T({ name: "zv-commons-product-model" }), Go = /* @__PURE__ */ T({
196
+ ...ie,
197
+ props: {
198
+ basicOption: {},
199
+ basicEvents: {},
200
+ useEvents: {}
201
+ },
202
+ emits: [
203
+ "on-load-success",
204
+ "on-play-animation"
205
+ ],
206
+ setup(p, { expose: m, emit: c }) {
207
+ const x = c, a = p, H = (i, o) => {
208
+ const d = S(), y = S(), E = S(!0);
209
+ class I {
210
+ // eslint-disable-next-line no-useless-constructor
211
+ constructor(e) {
212
+ // optional, but needed due to interface definitions
213
+ l(this, "loadingUIBackgroundColor");
214
+ this.loadingUIText = e;
215
+ }
216
+ displayLoadingUI() {
217
+ d.value && (E.value = !0);
218
+ }
219
+ hideLoadingUI() {
220
+ d.value && (E.value = !1);
221
+ }
222
+ }
223
+ class M {
224
+ constructor(e, t, s) {
225
+ l(this, "scene");
226
+ l(this, "engine");
227
+ // 默认环境
228
+ l(this, "environmentHelper");
229
+ l(this, "shadowsLight");
230
+ // 全局阴影
231
+ l(this, "shadowGenerator");
232
+ // 默认后期
233
+ l(this, "defaultPipeline");
234
+ this.canvas = e, this.option = t, this.events = s;
235
+ try {
236
+ this.engine = new j(this.canvas, !0, {}, !1), this.engine.loadingScreen = new I(""), window.addEventListener("resize", () => {
237
+ this.engine.resize();
238
+ }), this.scene = this.createScene();
239
+ } catch {
240
+ }
241
+ }
242
+ createScene() {
243
+ return this.engine.displayLoadingUI(), this.scene = new Q(this.engine), this.option.scene.colorShow ? this.scene.clearColor = w.FromHexString(this.option.scene.color || "#000000") : this.scene.clearColor = new w(0, 0, 0, 0), this.scene.fogEnabled = this.option.scene.fogEnabled, this.scene.fogMode = this.option.scene.fogMode || 1, this.scene.fogColor = b.FromHexString(this.option.scene.fogColor || "#ffffff"), this.scene.fogEnd = this.option.scene.fogEnd || 60, this.scene.fogStart = this.option.scene.fogStart || 1, this.scene.fogDensity = this.option.scene.fogDensity || 0.1, this.scene.createDefaultCamera(!0, !1, !0), this.updateMeshs(this.scene), this.scene;
244
+ }
245
+ updateScenePipeline(e) {
246
+ this.scene.activeCamera && e && (e.enabled ? (this.defaultPipeline || (this.defaultPipeline = new X(
247
+ "defaultPipeline",
248
+ !0,
249
+ this.scene,
250
+ [this.scene.activeCamera]
251
+ )), this.defaultPipeline.samples = e.samples ? 4 : 1, this.defaultPipeline.fxaaEnabled = e.fxaaEnabled, this.defaultPipeline.grainEnabled = e.grainEnabled, this.defaultPipeline.grain.intensity = e.grainIntensity, this.defaultPipeline.grain.animated = e.grainAnimated, this.defaultPipeline.bloomEnabled = e.bloomEnabled, this.defaultPipeline.bloomThreshold = e.bloomThreshold, this.defaultPipeline.bloomWeight = e.bloomWeight, this.defaultPipeline.bloomKernel = e.bloomKernel, this.defaultPipeline.bloomScale = e.bloomScale, this.defaultPipeline.depthOfFieldEnabled = e.depthOfFieldEnabled, e.depthOfFieldBlurLevel < 1 ? this.defaultPipeline.depthOfFieldBlurLevel = A.Low : e.depthOfFieldBlurLevel < 2 ? this.defaultPipeline.depthOfFieldBlurLevel = A.Medium : e.depthOfFieldBlurLevel < 3 && (this.defaultPipeline.depthOfFieldBlurLevel = A.High), this.defaultPipeline.depthOfField.focusDistance = e.depthOfFieldFocusDistance, this.defaultPipeline.depthOfField.fStop = e.depthOfFieldFStop, this.defaultPipeline.depthOfField.focalLength = e.depthOfFieldFocalLength, this.defaultPipeline.chromaticAberrationEnabled = e.chromaticAberrationEnabled, this.defaultPipeline.chromaticAberration.aberrationAmount = e.chromaticAberrationAberrationAmount, this.defaultPipeline.chromaticAberration.radialIntensity = e.chromaticAberrationRadialIntensity, e.chromaticAberrationDirection === 0 ? (this.defaultPipeline.chromaticAberration.direction.x = 0, this.defaultPipeline.chromaticAberration.direction.y = 0) : (this.defaultPipeline.chromaticAberration.direction.x = Math.sin(e.chromaticAberrationDirection), this.defaultPipeline.chromaticAberration.direction.y = Math.cos(e.chromaticAberrationDirection)), this.defaultPipeline.sharpenEnabled = e.sharpenEnabled, this.defaultPipeline.sharpen.edgeAmount = e.sharpenEdgeAmount, this.defaultPipeline.sharpen.colorAmount = e.sharpenColorAmount) : this.defaultPipeline && (this.defaultPipeline.dispose(), this.defaultPipeline = null));
252
+ }
253
+ updateScene(e) {
254
+ e.colorShow ? this.scene.clearColor = w.FromHexString(e.color || "#000000") : this.scene.clearColor = new w(0, 0, 0, 0), this.scene.fogEnabled = e.fogEnabled, this.scene.fogMode = e.fogMode || 1, this.scene.fogColor = b.FromHexString(e.fogColor || "#ffffff"), this.scene.fogEnd = e.fogEnd || 60, this.scene.fogStart = e.fogStart || 1, this.scene.fogDensity = e.fogDensity || 0.1;
255
+ }
256
+ updateShadowsLight(e) {
257
+ if (e.show) {
258
+ if (this.shadowsLight) {
259
+ this.shadowsLight.direction = new v(...e.direction), this.shadowsLight.position = new v(...e.position), this.shadowsLight.intensity = e.intensity, this.shadowsLight.diffuse = b.FromHexString(e.diffuse || "#ffffff"), this.shadowGenerator.mapSize = e.mapSize;
260
+ return;
261
+ }
262
+ this.shadowsLight = new Z("shadowsLight", new v(...e.direction), this.scene), this.shadowsLight.intensity = e.intensity || 0.6, this.shadowsLight.diffuse = b.FromHexString(e.diffuse || "#ffffff"), this.shadowsLight.position = new v(...e.position), this.shadowGenerator = new $(e.mapSize, this.shadowsLight);
263
+ } else
264
+ this.shadowsLight && (this.shadowsLight.dispose(), this.shadowsLight = null);
265
+ }
266
+ updateCamera(e) {
267
+ const t = this.scene.activeCamera;
268
+ t && (e.radius && (t.radius = e.radius), t.beta = G.ToRadians(e.beta), t.alpha = G.ToRadians(e.alpha), t.useAutoRotationBehavior = e.autoRotation, t.wheelDeltaPercentage = e.wheelDeltaPercentage || 0.01, t.panningSensibility = 1 / (e.panningSensibility || 0.01), t.lowerRadiusLimit = e.lowerRadiusLimit, t.upperRadiusLimit = e.upperRadiusLimit, t.lowerBetaLimit = 0, t.upperBetaLimit = Math.PI / 2.1);
269
+ }
270
+ updateDefaultEnvironment(e) {
271
+ this.environmentHelper && this.environmentHelper.dispose(), this.environmentHelper = this.scene.createDefaultEnvironment({
272
+ // 是否创建地面
273
+ createGround: e.createGround,
274
+ // 地面颜色
275
+ groundColor: b.FromHexString(e.groundColor || "#ffffff"),
276
+ // 地面大小
277
+ groundSize: e.groundSize || 15,
278
+ // 地面透明度
279
+ groundOpacity: e.groundOpacity || 1,
280
+ // 使地面能够接收阴影。
281
+ enableGroundShadow: e.enableGroundShadow,
282
+ // 接收阴影等级
283
+ groundShadowLevel: e.groundShadowLevel || 0.5,
284
+ // 地面反射
285
+ enableGroundMirror: e.enableGroundMirror === void 0 ? !0 : e.enableGroundMirror,
286
+ // 地面反射大小比率
287
+ groundMirrorSizeRatio: e.groundMirrorSizeRatio || 0.3,
288
+ // 地面反射模糊大小
289
+ groundMirrorBlurKernel: e.groundMirrorBlurKernel || 64,
290
+ // 指定地面反射镜的可见性。
291
+ groundMirrorAmount: e.groundMirrorAmount || 1,
292
+ // 指定地面镜反射率权重。这使用背景材质的标准重量来设置菲涅耳效果的镜子。
293
+ groundMirrorFresnelWeight: e.groundMirrorFresnelWeight || 1,
294
+ // 指定应用于地面垂直位置的偏移
295
+ groundYBias: e.groundYBias || 0,
296
+ // 创建天空盒
297
+ createSkybox: e.createSkybox,
298
+ // 天空盒大小
299
+ skyboxSize: e.skyboxSize || 20,
300
+ ...e.skyboxTexture ? { skyboxTexture: e.skyboxTexture } : {},
301
+ // 天空盒颜色
302
+ // 自动计算元素的大小以最适合场景。
303
+ sizeAuto: !0,
304
+ // 如果autoSize不为true,rootMesh的默认位置。
305
+ // rootPosition: Vector3,
306
+ // 环境贴图
307
+ ...e.environmentTexture ? { environmentTexture: e.environmentTexture } : {},
308
+ // 相机曝光
309
+ cameraExposure: e.cameraExposure || 0.6,
310
+ // 相机对比度
311
+ cameraContrast: e.cameraContrast || 1.6
312
+ }), this.environmentHelper.ground && (this.environmentHelper.ground.position.y += 0.01);
313
+ }
314
+ updateMeshs(e) {
315
+ e.meshes.forEach((t) => setTimeout(() => t.dispose())), O.ImportMeshAsync("", this.option.meshs.url, "", e, (t) => {
316
+ y.value = (t.loaded / t.total * 100).toFixed(2);
317
+ }).then((t) => {
318
+ const s = t.meshes;
319
+ if (this.option.animationGroups = e.animationGroups.map((n) => ({
320
+ uniqueId: n.uniqueId,
321
+ name: n.name
322
+ })), this.events && (this.events.function[0].args[0].select = e.animationGroups.map((n) => ({
323
+ name: n.name,
324
+ value: n.name
325
+ }))), this.option.defaultAnimation && this.option.defaultAnimation.name ? this.playAnimation(this.option.defaultAnimation.name, {
326
+ loop: this.option.defaultAnimation.loop,
327
+ speedRatio: this.option.defaultAnimation.speedRatio
328
+ }) : e.animationGroups && e.animationGroups[0] && e.animationGroups[0].stop(), this.updateShadowsLight(this.option.shadow), e.createDefaultCamera(!0, !0, !0), this.updateCamera(this.option.camera), this.updateScenePipeline(this.option.pipelineOption), this.updateDefaultEnvironment(this.option.environment), this.option.meshs.isCasterShadow && this.shadowGenerator) {
329
+ this.shadowGenerator.addShadowCaster(e.meshes[0], !0);
330
+ for (let n = 0; n < s.length; n++)
331
+ s[n].receiveShadows = !1;
332
+ }
333
+ s[0].position = new v(...this.option.meshs.position), setTimeout(() => {
334
+ this.engine.hideLoadingUI(), x("on-load-success"), z.parseEvents(a.useEvents, "on-load-success");
335
+ }, 100);
336
+ });
337
+ }
338
+ run() {
339
+ return this.engine.runRenderLoop(() => {
340
+ this.scene.render();
341
+ }), this;
342
+ }
343
+ dispose() {
344
+ this.scene && this.engine && (this.scene.dispose(), this.engine.dispose());
345
+ }
346
+ playAnimation(e, t = {
347
+ loop: !1,
348
+ speedRatio: 1
349
+ }) {
350
+ if (this.scene) {
351
+ this.scene.stopAllAnimations();
352
+ const s = this.scene.getAnimationGroupByName(e);
353
+ s && (x("on-play-animation"), z.parseEvents(a.useEvents, "on-play-animation"), s.start(t.loop, t.speedRatio, s.from, s.to, !1));
354
+ }
355
+ }
356
+ }
357
+ const g = S();
358
+ return N(() => {
359
+ i.meshs && (g.value = new M(d.value, i, o).run(), J(d.value, (R) => {
360
+ g.value && g.value.engine.resize();
361
+ }));
362
+ }), Y(() => {
363
+ g.value && g.value.dispose();
364
+ }), {
365
+ canvasRef: d,
366
+ babylon: g,
367
+ Babylon: M,
368
+ babylonLoadingStatus: E,
369
+ babylonLoadingTitle: y
370
+ };
371
+ }, { canvasRef: L, babylon: r, Babylon: C, babylonLoadingStatus: F, babylonLoadingTitle: k } = H(a.basicOption, a.basicEvents);
372
+ return m({
373
+ playAnimation: (i, o) => {
374
+ const d = o[0].value, y = {
375
+ loop: o[1].keys[0].defaultValue,
376
+ speedRatio: o[1].keys[1].defaultValue
377
+ };
378
+ r.value.playAnimation(d, y);
379
+ }
380
+ }), h(() => u(a.basicOption.environment), (i, o) => {
381
+ !f(i, o) && r.value && r.value.updateDefaultEnvironment(i);
382
+ }, {
383
+ deep: !0
384
+ }), h(() => u(a.basicOption.shadow), (i, o) => {
385
+ !f(i, o) && r.value && r.value.updateShadowsLight(i);
386
+ }, {
387
+ deep: !0
388
+ }), h(() => u(a.basicOption.camera), (i, o) => {
389
+ !f(i, o) && r.value && r.value.updateCamera(i);
390
+ }, {
391
+ deep: !0
392
+ }), h(() => u(a.basicOption.meshs), (i, o) => {
393
+ !f(i, o) && r.value && (r.value.dispose(), r.value = new C(L.value, a.basicOption, a.basicEvents).run());
394
+ }, {
395
+ deep: !0
396
+ }), h(() => u(a.basicOption.defaultAnimation), (i, o) => {
397
+ !f(i, o) && r.value && (r.value.dispose(), r.value = new C(L.value, a.basicOption, a.basicEvents).run());
398
+ }, {
399
+ deep: !0
400
+ }), h(() => u(a.basicOption.scene), (i, o) => {
401
+ !f(i, o) && r.value && r.value.updateScene(i);
402
+ }, {
403
+ deep: !0
404
+ }), h(() => u(a.basicOption.pipelineOption), (i, o) => {
405
+ !f(i, o) && r.value && r.value.updateScenePipeline(i);
406
+ }, {
407
+ deep: !0
408
+ }), (i, o) => (D(), B("div", ee, [
409
+ V("canvas", {
410
+ ref_key: "canvasRef",
411
+ ref: L,
412
+ class: W(["widget", { show: !P(F) }])
413
+ }, null, 2),
414
+ P(F) ? (D(), B("div", {
415
+ key: 0,
416
+ ref: "babylonLoadingRef",
417
+ class: "babylon-loading"
418
+ }, " 正在加载模型...(" + q(P(k)) + "%) ", 513)) : K("", !0)
419
+ ]));
420
+ }
421
+ });
422
+ export {
423
+ Go as default
424
+ };