@bdsoft/element 1.1.8 → 1.1.11

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 (243) hide show
  1. package/dist/BdElement.js +23111 -0
  2. package/package.json +2 -1
  3. package/global/index.ts +0 -6
  4. package/global/register-properties.ts +0 -10
  5. package/index.html +0 -13
  6. package/package-form/core/components/formCreate.js +0 -274
  7. package/package-form/core/components/fragment.js +0 -12
  8. package/package-form/core/factory/context.js +0 -257
  9. package/package-form/core/factory/creator.js +0 -63
  10. package/package-form/core/factory/maker.js +0 -17
  11. package/package-form/core/factory/manager.js +0 -79
  12. package/package-form/core/factory/node.js +0 -85
  13. package/package-form/core/factory/parser.js +0 -28
  14. package/package-form/core/frame/api.js +0 -599
  15. package/package-form/core/frame/attrs.js +0 -12
  16. package/package-form/core/frame/dataDriver.js +0 -76
  17. package/package-form/core/frame/fetch.js +0 -119
  18. package/package-form/core/frame/formCreate.js +0 -274
  19. package/package-form/core/frame/index.js +0 -760
  20. package/package-form/core/frame/provider.js +0 -288
  21. package/package-form/core/frame/util.js +0 -274
  22. package/package-form/core/handler/context.js +0 -380
  23. package/package-form/core/handler/effect.js +0 -122
  24. package/package-form/core/handler/index.js +0 -111
  25. package/package-form/core/handler/inject.js +0 -145
  26. package/package-form/core/handler/input.js +0 -197
  27. package/package-form/core/handler/lifecycle.js +0 -43
  28. package/package-form/core/handler/loader.js +0 -373
  29. package/package-form/core/handler/page.js +0 -46
  30. package/package-form/core/handler/render.js +0 -29
  31. package/package-form/core/index.js +0 -12
  32. package/package-form/core/package.json +0 -15
  33. package/package-form/core/parser/html.js +0 -17
  34. package/package-form/core/render/cache.js +0 -47
  35. package/package-form/core/render/index.js +0 -31
  36. package/package-form/core/render/render.js +0 -393
  37. package/package-form/element-form/components/checkbox/package.json +0 -17
  38. package/package-form/element-form/components/checkbox/src/component.jsx +0 -110
  39. package/package-form/element-form/components/checkbox/src/index.js +0 -3
  40. package/package-form/element-form/components/frame/package.json +0 -17
  41. package/package-form/element-form/components/frame/src/IconCircleClose.vue +0 -14
  42. package/package-form/element-form/components/frame/src/IconDelete.vue +0 -12
  43. package/package-form/element-form/components/frame/src/IconDocument.vue +0 -12
  44. package/package-form/element-form/components/frame/src/IconFolderOpened.vue +0 -12
  45. package/package-form/element-form/components/frame/src/IconView.vue +0 -12
  46. package/package-form/element-form/components/frame/src/component.jsx +0 -349
  47. package/package-form/element-form/components/frame/src/index.js +0 -3
  48. package/package-form/element-form/components/frame/src/style.css +0 -66
  49. package/package-form/element-form/components/group/package.json +0 -17
  50. package/package-form/element-form/components/group/src/component.jsx +0 -314
  51. package/package-form/element-form/components/group/src/index.js +0 -3
  52. package/package-form/element-form/components/group/src/style.css +0 -125
  53. package/package-form/element-form/components/index.js +0 -22
  54. package/package-form/element-form/components/radio/package.json +0 -17
  55. package/package-form/element-form/components/radio/src/component.jsx +0 -101
  56. package/package-form/element-form/components/radio/src/index.js +0 -3
  57. package/package-form/element-form/components/select/package.json +0 -17
  58. package/package-form/element-form/components/select/src/component.jsx +0 -52
  59. package/package-form/element-form/components/select/src/index.js +0 -3
  60. package/package-form/element-form/components/subform/package.json +0 -14
  61. package/package-form/element-form/components/subform/src/component.jsx +0 -76
  62. package/package-form/element-form/components/subform/src/index.js +0 -3
  63. package/package-form/element-form/components/tree/package.json +0 -17
  64. package/package-form/element-form/components/tree/src/component.jsx +0 -62
  65. package/package-form/element-form/components/tree/src/index.js +0 -3
  66. package/package-form/element-form/components/upload/package.json +0 -17
  67. package/package-form/element-form/components/upload/src/IconUpload.vue +0 -12
  68. package/package-form/element-form/components/upload/src/component.jsx +0 -129
  69. package/package-form/element-form/components/upload/src/index.js +0 -3
  70. package/package-form/element-form/components/upload/src/style.css +0 -11
  71. package/package-form/element-form/index.js +0 -8
  72. package/package-form/element-form/package.json +0 -16
  73. package/package-form/element-form/src/components/icon/IconWarning.vue +0 -12
  74. package/package-form/element-form/src/components/index.js +0 -22
  75. package/package-form/element-form/src/core/alias.js +0 -34
  76. package/package-form/element-form/src/core/api.js +0 -208
  77. package/package-form/element-form/src/core/config.js +0 -62
  78. package/package-form/element-form/src/core/index.js +0 -60
  79. package/package-form/element-form/src/core/maker.js +0 -76
  80. package/package-form/element-form/src/core/manager.js +0 -315
  81. package/package-form/element-form/src/core/provider.js +0 -79
  82. package/package-form/element-form/src/parsers/datePicker.js +0 -31
  83. package/package-form/element-form/src/parsers/hidden.js +0 -12
  84. package/package-form/element-form/src/parsers/index.js +0 -17
  85. package/package-form/element-form/src/parsers/input.js +0 -21
  86. package/package-form/element-form/src/parsers/row.js +0 -10
  87. package/package-form/element-form/src/parsers/select.js +0 -15
  88. package/package-form/element-form/src/parsers/slider.js +0 -21
  89. package/package-form/element-form/src/parsers/timePicker.js +0 -17
  90. package/package-form/element-form/src/style/index.css +0 -52
  91. package/src/App.vue +0 -28
  92. package/src/assets/css/element.scss +0 -196
  93. package/src/assets/css/layout.scss +0 -215
  94. package/src/assets/css/tailwind.scss +0 -67
  95. package/src/assets/images/banner.gif +0 -0
  96. package/src/assets/images/banner.png +0 -0
  97. package/src/assets/images/bg1.svg +0 -22
  98. package/src/assets/images/bg2.png +0 -0
  99. package/src/assets/images/ff.png +0 -0
  100. package/src/assets/images/home-file1.png +0 -0
  101. package/src/assets/images/ky.png +0 -0
  102. package/src/assets/images/menu/add.png +0 -0
  103. package/src/assets/images/menu/del.png +0 -0
  104. package/src/assets/images/menu/down.png +0 -0
  105. package/src/assets/images/menu/dr.png +0 -0
  106. package/src/assets/images/menu/edit.png +0 -0
  107. package/src/assets/images/menu/kx.png +0 -0
  108. package/src/assets/images/menu/mb.png +0 -0
  109. package/src/assets/images/menu/pz.png +0 -0
  110. package/src/assets/images/menu/save.png +0 -0
  111. package/src/assets/images/menu/sj.png +0 -0
  112. package/src/assets/images/menu/sjk.png +0 -0
  113. package/src/assets/images/menu/up.png +0 -0
  114. package/src/assets/images/po-i.png +0 -0
  115. package/src/assets/images/po1-i1.png +0 -0
  116. package/src/assets/images/po1-i2.png +0 -0
  117. package/src/assets/images/po1-i3.png +0 -0
  118. package/src/assets/images/po1-i4.png +0 -0
  119. package/src/assets/images/po1-i5.png +0 -0
  120. package/src/assets/images/po1-i6.png +0 -0
  121. package/src/assets/images/po1-i7.png +0 -0
  122. package/src/assets/images/po1-i8.png +0 -0
  123. package/src/assets/images/po2-i1.png +0 -0
  124. package/src/assets/images/po2-i2.png +0 -0
  125. package/src/assets/images/po3-i1.png +0 -0
  126. package/src/assets/images/po4-i1.png +0 -0
  127. package/src/assets/images/po5-i1.png +0 -0
  128. package/src/assets/images/po6-i1.png +0 -0
  129. package/src/assets/images/po6-i2.png +0 -0
  130. package/src/assets/images/po7-i1.png +0 -0
  131. package/src/assets/images/tj1.png +0 -0
  132. package/src/assets/images/tj2.png +0 -0
  133. package/src/assets/images/tj3.png +0 -0
  134. package/src/components/3dcloudwords/index.js +0 -346
  135. package/src/components/3dcloudwords/index.vue +0 -99
  136. package/src/components/3dcloudwords/readme.md +0 -66
  137. package/src/components/badge/index.js +0 -167
  138. package/src/components/badge/index.scss +0 -166
  139. package/src/components/badge/index.vue +0 -98
  140. package/src/components/badge/readme.md +0 -18
  141. package/src/components/basic/Finish.vue +0 -107
  142. package/src/components/basic/button.vue +0 -19
  143. package/src/components/basic/readme.md +0 -7
  144. package/src/components/button/index.vue +0 -48
  145. package/src/components/button/readme.md +0 -62
  146. package/src/components/carousel/index.vue +0 -104
  147. package/src/components/carousel/readme.md +0 -12
  148. package/src/components/chartconfig/index.vue +0 -141
  149. package/src/components/chartconfig/readme.md +0 -25
  150. package/src/components/contextMenu/hookContxtMenu.js +0 -41
  151. package/src/components/contextMenu/index.vue +0 -245
  152. package/src/components/contextMenu/readme.md +0 -55
  153. package/src/components/contextMenu/useElementBounding.js +0 -40
  154. package/src/components/countup/countUp.js +0 -196
  155. package/src/components/countup/index.vue +0 -114
  156. package/src/components/countup/readme.md +0 -9
  157. package/src/components/empty/assets/build.png +0 -0
  158. package/src/components/empty/assets/emptybg.gif +0 -0
  159. package/src/components/empty/assets/emptybg.png +0 -0
  160. package/src/components/empty/assets/emptybg2.jpg +0 -0
  161. package/src/components/empty/assets/emptybg3.jpg +0 -0
  162. package/src/components/empty/assets/wuxiao.png +0 -0
  163. package/src/components/empty/assets/wuxiao.webp +0 -0
  164. package/src/components/empty/building.vue +0 -117
  165. package/src/components/empty/empty.vue +0 -120
  166. package/src/components/empty/index.js +0 -12
  167. package/src/components/empty/invalid.vue +0 -56
  168. package/src/components/error/Error.vue +0 -79
  169. package/src/components/error/readme.md +0 -20
  170. package/src/components/form/Form.vue +0 -84
  171. package/src/components/form/FormItem.vue +0 -143
  172. package/src/components/form/data.js +0 -52
  173. package/src/components/form/readme.md +0 -69
  174. package/src/components/layout/banner.vue +0 -412
  175. package/src/components/layout/bar.vue +0 -43
  176. package/src/components/layout/layout1.vue +0 -60
  177. package/src/components/layout/layout2.vue +0 -134
  178. package/src/components/layout/layout3.vue +0 -107
  179. package/src/components/layout/layout4.vue +0 -66
  180. package/src/components/layout/nav.vue +0 -333
  181. package/src/components/layout/readme.md +0 -61
  182. package/src/components/loading/index.vue +0 -122
  183. package/src/components/loading/readme.md +0 -6
  184. package/src/components/notice/NoticeList.vue +0 -198
  185. package/src/components/notice/NoticeListPaging.vue +0 -281
  186. package/src/components/notice/NoticeView.vue +0 -92
  187. package/src/components/notice/readme.md +0 -1
  188. package/src/components/pagination/index.vue +0 -100
  189. package/src/components/pagination/readme.md +0 -19
  190. package/src/components/pagination/scroll-to.js +0 -51
  191. package/src/components/progress/bar.vue +0 -72
  192. package/src/components/progress/progress.vue +0 -58
  193. package/src/components/screenfull/index.js +0 -3
  194. package/src/components/screenfull/index.vue +0 -65
  195. package/src/components/screenfull/package.json +0 -15
  196. package/src/components/screenfull/readme.md +0 -6
  197. package/src/components/statisticalCount/index.vue +0 -80
  198. package/src/components/statisticalCount/readme.md +0 -21
  199. package/src/components/username/index.vue +0 -79
  200. package/src/components/username/readme.md +0 -22
  201. package/src/components/username//346/225/210/346/236/234/345/233/276.png +0 -0
  202. package/src/index.js +0 -88
  203. package/src/utils/index.js +0 -32
  204. package/src/xm_components/HeadSearch/hook/hookSearch.js +0 -96
  205. package/src/xm_components/HeadSearch/index.vue +0 -206
  206. package/src/xm_components/HeadSearch/readme.md +0 -12
  207. package/src/xm_components/HeadSearch//346/220/234/347/264/242/345/210/227/350/241/250.png +0 -0
  208. package/src/xm_components/Milestone/index.vue +0 -213
  209. package/src/xm_components/Milestone/readme.md +0 -15
  210. package/src/xm_components/MultiStatisticalCard/image.png +0 -0
  211. package/src/xm_components/MultiStatisticalCard/index.vue +0 -114
  212. package/src/xm_components/MultiStatisticalCard/readme.md +0 -29
  213. package/src/xm_components/StatisticalCard/image.png +0 -0
  214. package/src/xm_components/StatisticalCard/index.vue +0 -196
  215. package/src/xm_components/StatisticalCard/readme.md +0 -41
  216. package/src/xm_components/readme.md +0 -1
  217. package/utils/coms/load.jsx +0 -10
  218. package/utils/func.js +0 -32
  219. package/utils/hookDialog.js +0 -38
  220. package/utils/hookPage.js +0 -49
  221. package/utils/index.js +0 -5
  222. package/utils/lib/console.js +0 -39
  223. package/utils/lib/debounce.js +0 -19
  224. package/utils/lib/deepextend.js +0 -51
  225. package/utils/lib/deepset.js +0 -14
  226. package/utils/lib/extend.js +0 -28
  227. package/utils/lib/index.js +0 -13
  228. package/utils/lib/json.js +0 -90
  229. package/utils/lib/mergeprops.js +0 -62
  230. package/utils/lib/mitt.js +0 -43
  231. package/utils/lib/modify.js +0 -8
  232. package/utils/lib/slot.js +0 -19
  233. package/utils/lib/toarray.js +0 -5
  234. package/utils/lib/tocase.js +0 -11
  235. package/utils/lib/todate.js +0 -10
  236. package/utils/lib/toline.js +0 -10
  237. package/utils/lib/tostring.js +0 -7
  238. package/utils/lib/type.js +0 -45
  239. package/utils/lib/unique.js +0 -6
  240. package/utils/message.js +0 -164
  241. package/utils/package.json +0 -16
  242. package/utils/type.js +0 -45
  243. package/vite.config.js +0 -51
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,346 +0,0 @@
1
- var S = Object.defineProperty;
2
- var C = (f, t, i) => t in f ? S(f, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : f[t] = i;
3
- var n = (f, t, i) => C(f, typeof t != "symbol" ? t + "" : t, i);
4
- const w = [
5
- "#23bcfe",
6
- // Sky Blue
7
- "#ff6f61",
8
- // Coral
9
- "#6a5acd",
10
- // Slate Blue
11
- "#3cb371",
12
- // Medium Sea Green
13
- "#ffcc00",
14
- // Golden Yellow
15
- "#ff1493",
16
- // Deep Pink
17
- "#20b2aa",
18
- // Light Sea Green
19
- "#ff4500",
20
- // Orange Red
21
- "#9370db",
22
- // Medium Purple
23
- "#f08080"
24
- // Light Coral
25
- ], M = {
26
- children: [],
27
- width: 480,
28
- height: 480,
29
- radius: "70%",
30
- radiusMin: 75,
31
- isDrawSvgBg: !0,
32
- svgBgColor: "#000",
33
- opacityOver: 1,
34
- opacityOut: 0.05,
35
- opacitySpeed: 6,
36
- fov: 800,
37
- speed: 0.5,
38
- fontFamily: "Arial, sans-serif",
39
- fontSize: "12",
40
- fontColor: "#fff",
41
- fontWeight: "normal",
42
- //bold
43
- fontStyle: "normal",
44
- //italic
45
- fontStretch: "normal",
46
- //wider, narrower, ultra-condensed, extra-condensed, condensed, semi-condensed, semi-expanded, expanded, extra-expanded, ultra-expanded
47
- fontToUpperCase: !1,
48
- tooltipFontFamily: "Arial, sans-serif",
49
- tooltipFontSize: "15",
50
- tooltipFontColor: "#fff",
51
- tooltipFontWeight: "normal",
52
- //bold
53
- tooltipFontStyle: "normal",
54
- //italic
55
- tooltipFontStretch: "normal",
56
- //wider, narrower, ultra-condensed, extra-condensed, condensed, semi-condensed, semi-expanded, expanded, extra-expanded, ultra-expanded
57
- tooltipFontToUpperCase: !1,
58
- tooltipTextAnchor: "left",
59
- tooltipDiffX: 0,
60
- tooltipDiffY: 10,
61
- animatingSpeed: 0.1,
62
- animatingRadiusLimit: 1.3
63
- };
64
- class p {
65
- constructor(t, i) {
66
- n(this, "containerEl");
67
- n(this, "settings");
68
- n(this, "childHolder", []);
69
- n(this, "tooltipEl", null);
70
- n(this, "radius", 0);
71
- n(this, "diameter", 0);
72
- n(this, "mouseReact", !0);
73
- n(this, "mousePos", { x: 0, y: 0 });
74
- n(this, "center2D", { x: 0, y: 0 });
75
- n(this, "center3D", { x: 0, y: 0, z: 0 });
76
- n(this, "speed", { x: 0, y: 0 });
77
- n(this, "position", { sx: 0, cx: 0, sy: 0, cy: 0 });
78
- n(this, "MATHPI180", Math.PI / 180);
79
- n(this, "svgEl", null);
80
- n(this, "svgNS", "http://www.w3.org/2000/svg");
81
- n(this, "svgBg", null);
82
- n(this, "animFrameId", null);
83
- n(this, "radius_factor", 1);
84
- n(this, "animOut_cb", null);
85
- n(this, "animIn_cb", null);
86
- n(this, "animating", !1);
87
- n(this, "onScreenResizeHandler", () => {
88
- this.setParams();
89
- });
90
- n(this, "onMouseMoveHandler", (t) => {
91
- this.mousePos = this.getMousePos(this.svgEl, t);
92
- });
93
- n(this, "mouseOverHandler", (t) => {
94
- this.mouseReact = !1;
95
- const i = t.target, o = this.getChildByElement(i);
96
- o && (this.highlightChild(o), this.showTooltip(o));
97
- });
98
- n(this, "mouseOutHandler", (t) => {
99
- this.mouseReact = !0;
100
- const i = t.target;
101
- this.getChildByElement(i) && this.hideTooltip();
102
- });
103
- // start to render the tag cloud component
104
- n(this, "build", () => {
105
- this.settings.children.length && (this.setSvgElAndSvgBgEl(), this.addChildren(), this.setParams(), this.animationLoopStart(), window.addEventListener("resize", this.onScreenResizeHandler));
106
- });
107
- this.containerEl = t, this.settings = { ...M, ...i }, this.bindMethods();
108
- }
109
- bindMethods() {
110
- this.animationLoopStart = this.animationLoopStart.bind(this), this._animIn = this._animIn.bind(this), this._animOut = this._animOut.bind(this);
111
- }
112
- setAttributes(t, i) {
113
- for (const [o, a] of Object.entries(i))
114
- t.setAttribute(o, a);
115
- }
116
- getFontColor(t = 0, i = [], o = "#fff") {
117
- const a = i.length;
118
- return a > 0 ? i[t % a] : o;
119
- }
120
- getMousePos(t, i) {
121
- if (!t) return { x: 0, y: 0 };
122
- const o = t.getBoundingClientRect();
123
- return { x: i.clientX - o.left, y: i.clientY - o.top };
124
- }
125
- setChildPosition(t, i) {
126
- if (!t.vectorPosition) return;
127
- const { x: o, y: a, z: h } = t.vectorPosition, r = o - this.center3D.x, l = a - this.center3D.y, c = h - this.center3D.z, s = Math.sqrt(r * r + l * l + c * c);
128
- Object.assign(t.vectorPosition, {
129
- x: o / s * i,
130
- y: a / s * i,
131
- z: h / s * i
132
- });
133
- }
134
- setChildPositions(t) {
135
- this.childHolder.forEach((i) => this.setChildPosition(i, t));
136
- }
137
- setParams() {
138
- var m, u;
139
- const { innerWidth: t, innerHeight: i } = window, { documentElement: o, body: a } = document, {
140
- width: h,
141
- height: r,
142
- radius: l = "65%",
143
- speed: c = 0,
144
- radiusMin: s = 1,
145
- isDrawSvgBg: g
146
- } = this.settings;
147
- let e = t || o.clientWidth || a.clientWidth, d = i || o.clientHeight || a.clientHeight;
148
- typeof h == "string" && h.includes("%") ? (e = Math.round(
149
- this.containerEl.offsetWidth / 100 * parseInt(h)
150
- ), d = Math.round(e / 100 * parseInt(r))) : (e = h, d = r), e = Math.min(e, t || 0), d = Math.min(d, i || 0), this.center2D = { x: e / 2, y: d / 2 }, this.speed = { x: c / this.center2D.x, y: c / this.center2D.y }, this.diameter = Math.min(d, e) * (parseInt(`${l}`) / 100), this.diameter = Math.max(this.diameter, 1), this.radius = Math.max(this.diameter / 2, s), this.diameter = this.radius * 2, (m = this.svgEl) == null || m.setAttribute("width", `${e}`), (u = this.svgEl) == null || u.setAttribute("height", `${d}`), g && this.svgBg && (this.svgBg.setAttribute("width", `${e}`), this.svgBg.setAttribute("height", `${d}`)), this.setChildPositions(this.radius * this.radius_factor);
151
- }
152
- addChild(t, i, o, a, h) {
153
- var g;
154
- const { settings: r, svgNS: l } = this, c = this.getFontColor(t, w, r.fontColor), s = {
155
- index: t,
156
- mouseOver: !1,
157
- fontColor: c,
158
- vectorPosition: { x: o, y: a, z: h },
159
- vector2D: { x: 0, y: 0 },
160
- ...i
161
- };
162
- if (i.label) {
163
- const e = {
164
- x: "0",
165
- y: "0",
166
- fill: s.fontColor,
167
- "font-family": s.fontFamily || r.fontFamily,
168
- "font-size": `${i.fontSize || r.fontSize}`,
169
- "font-weight": s.fontWeight || r.fontWeight,
170
- "font-style": s.fontStyle || r.fontStyle,
171
- "font-stretch": s.fontStretch || r.fontStretch,
172
- "text-anchor": "middle"
173
- };
174
- s.element = document.createElementNS(l, "text"), this.setAttributes(s.element, e), s.element.textContent = r.fontToUpperCase ? i.label.toUpperCase() : i.label;
175
- } else if (i.image)
176
- s.element = document.createElementNS(l, "image"), s.element.setAttributeNS(
177
- "http://www.w3.org/1999/xlink",
178
- "href",
179
- i.image
180
- ), this.setAttributes(s.element, {
181
- x: "0",
182
- y: "0",
183
- width: `${i.width || "0"}`,
184
- height: `${i.height || "0"}`
185
- }), s.diffX = i.width / 2, s.diffY = i.height / 2;
186
- else
187
- return;
188
- s.link = document.createElementNS(l, "a"),
189
- this.setAttributes(s.link, {
190
- href: i.url || "#",
191
- target: i.target || ""
192
- }),
193
- s.link.appendChild(s.element),
194
- s.link.addEventListener(
195
- "mouseover",
196
- this.mouseOverHandler,
197
- !0
198
- ), s.link.addEventListener(
199
- "mouseout",
200
- this.mouseOutHandler,
201
- !0
202
- ), i.tooltip ? (s.tooltipLabel = r.tooltipFontToUpperCase ? i.tooltip.toUpperCase() : i.tooltip, s.tooltip = s.tooltipLabel) : s.tooltip = "", (g = this.svgEl) == null || g.appendChild(s.link), this.childHolder.push(s);
203
- }
204
- addTooltip() {
205
- var c;
206
- const {
207
- tooltipFontColor: t,
208
- tooltipFontFamily: i,
209
- tooltipFontSize: o,
210
- tooltipFontWeight: a,
211
- tooltipFontStyle: h,
212
- tooltipFontStretch: r,
213
- tooltipTextAnchor: l
214
- } = this.settings;
215
- this.tooltipEl = document.createElementNS(this.svgNS, "text"), this.setAttributes(this.tooltipEl, {
216
- x: "0",
217
- y: "0",
218
- fill: `${t}`,
219
- "font-family": `${i}`,
220
- "font-size": `${o}`,
221
- "font-weight": `${a}`,
222
- "font-style": `${h}`,
223
- "font-stretch": `${r}`,
224
- "text-anchor": `${l}`
225
- }), (c = this.svgEl) == null || c.appendChild(this.tooltipEl);
226
- }
227
- showTooltip(t) {
228
- if (t.tooltip && this.tooltipEl && t.vector2D) {
229
- const { tooltipDiffX: i, tooltipDiffY: o, tooltipFontToUpperCase: a } = this.settings;
230
- this.setAttributes(this.tooltipEl, {
231
- x: `${t.vector2D.x - (i || 0)}`,
232
- y: `${t.vector2D.y - (o || 0)}`,
233
- opacity: "1.0"
234
- }), this.tooltipEl.textContent = a ? (t.tooltipLabel || "").toUpperCase() : t.tooltipLabel || "";
235
- }
236
- }
237
- hideTooltip() {
238
- var t;
239
- (t = this.tooltipEl) == null || t.setAttribute("opacity", "0.0");
240
- }
241
- addChildren() {
242
- let t = !1;
243
- this.settings.children.forEach((i, o) => {
244
- const a = this.settings.children.length + 1, h = Math.acos(-1 + 2 * (o + 1) / a), r = Math.sqrt(a * Math.PI) * h, l = Math.cos(r) * Math.sin(h), c = Math.sin(r) * Math.sin(h), s = Math.cos(h);
245
- this.addChild(o, i, l, c, s), i.tooltip && (t = !0);
246
- }), t && this.addTooltip();
247
- }
248
- highlightChild(t) {
249
- this.childHolder.forEach((i) => i.mouseOver = i.index === t.index);
250
- }
251
- getChildByElement(t) {
252
- return this.childHolder.find(
253
- (i) => {
254
- var o;
255
- return (o = i.element) == null ? void 0 : o.isEqualNode(t);
256
- }
257
- );
258
- }
259
- render() {
260
- const {
261
- speed: t = 0,
262
- opacityOut: i = 0.1,
263
- opacityOver: o = 1,
264
- opacitySpeed: a = 5,
265
- fov: h = 0,
266
- animatingRadiusLimit: r = 1.3
267
- } = this.settings, l = this.speed.x * this.mousePos.x - t, c = t - this.speed.y * this.mousePos.y, s = l * this.MATHPI180, g = c * this.MATHPI180;
268
- this.position = {
269
- sx: Math.sin(s),
270
- cx: Math.cos(s),
271
- sy: Math.sin(g),
272
- cy: Math.cos(g)
273
- }, this.childHolder.forEach((e) => {
274
- if (!e.element || !e.vectorPosition || !e.vector2D) return;
275
- if (this.mouseReact) {
276
- const { x: v, y, z: x } = e.vectorPosition, E = y * this.position.sy + x * this.position.cy;
277
- e.vectorPosition.x = v * this.position.cx + E * this.position.sx, e.vectorPosition.y = y * this.position.cy + x * -this.position.sy, e.vectorPosition.z = v * -this.position.sx + E * this.position.cx;
278
- }
279
- const d = h / (h + e.vectorPosition.z);
280
- e.vector2D.x = e.vectorPosition.x * d + this.center2D.x, e.vector2D.y = e.vectorPosition.y * d + this.center2D.y, e.diffX && e.diffY && (e.vector2D.x -= e.diffX, e.vector2D.y -= e.diffY), e.element.setAttribute("x", `${e.vector2D.x}`), e.element.setAttribute("y", `${e.vector2D.y}`);
281
- let m = this.mouseReact ? (this.radius - e.vectorPosition.z) / this.diameter : parseFloat(e.element.getAttribute("opacity") || "1");
282
- m = this.mouseReact ? Math.max(m, i) : e.mouseOver ? m + (o - m) / a : m + (i - m) / a;
283
- const u = 1 - (this.radius_factor - 1) / (r - 1);
284
- e.element.setAttribute("opacity", `${m * u}`);
285
- }), this.childHolder.sort((e, d) => d.vectorPosition.z - e.vectorPosition.z);
286
- }
287
- animationLoopStart() {
288
- this.animFrameId = window.requestAnimationFrame(() => {
289
- this.render(), this.animationLoopStart();
290
- });
291
- }
292
- _animIn() {
293
- (this.animating = this.radius_factor > 1) ? (this.setRadiusFactor(
294
- this.radius_factor - (this.settings.animatingSpeed || 0.1)
295
- ), window.requestAnimationFrame(this._animIn)) : this.animIn_cb && (this.animIn_cb(), this.animIn_cb = null);
296
- }
297
- _animOut() {
298
- (this.animating = this.radius_factor < (this.settings.animatingRadiusLimit || 1.3)) ? (this.setRadiusFactor(
299
- this.radius_factor + (this.settings.animatingSpeed || 0.1)
300
- ), window.requestAnimationFrame(this._animOut)) : this.animOut_cb && (this.animOut_cb(), this.animOut_cb = null);
301
- }
302
- setRadiusFactor(t) {
303
- this.radius_factor = Math.min(
304
- Math.max(t, 1),
305
- this.settings.animatingRadiusLimit || 1.3
306
- ), this.setParams();
307
- }
308
- resetRadiusFactor() {
309
- this.setRadiusFactor(1);
310
- }
311
- animOut(t) {
312
- this.animating || (this.radius_factor = 1, this.animOut_cb = t, this._animOut());
313
- }
314
- animIn(t) {
315
- this.animating || (this.radius_factor = this.settings.animatingRadiusLimit || 1.3, this.animIn_cb = t, this._animIn());
316
- }
317
- setChildren(t) {
318
- this.destroy(), this.settings.children = t, this.build();
319
- }
320
- setSvgElAndSvgBgEl() {
321
- this.svgEl = document.createElementNS(this.svgNS, "svg"), this.svgEl.addEventListener("mousemove", this.onMouseMoveHandler), this.containerEl.appendChild(this.svgEl), this.settings.isDrawSvgBg && (this.svgBg = document.createElementNS(
322
- this.svgNS,
323
- "rect"
324
- ), this.setAttributes(this.svgBg, {
325
- x: "0",
326
- y: "0",
327
- fill: `${this.settings.svgBgColor}`
328
- }), this.svgEl.appendChild(this.svgBg));
329
- }
330
- // destroy the element when component is removed;
331
- destroy() {
332
- var t;
333
- this.animFrameId && window.cancelAnimationFrame(this.animFrameId), window.removeEventListener("resize", this.onScreenResizeHandler), this.svgBg && ((t = this.svgEl) == null || t.removeChild(this.svgBg)), this.svgEl && (this.containerEl.removeChild(this.svgEl), this.svgEl.removeEventListener("mousemove", this.onMouseMoveHandler), this.svgEl = null);
334
- }
335
- static __VERSION() {
336
- console.log(
337
- "%c [ __VERSION ]-573",
338
- "font-size:13px; background:pink; color:#bf2c9f;",
339
- "v0.0.19_Bt: 10/16/2024, 9:49:51 AM"
340
- );
341
- }
342
- }
343
- window && (window.SVG3DTagCloud = p, window.SVG3dTagCloud = p, window.Svg3dTagCloud = p);
344
- export {
345
- p as default
346
- };
@@ -1,99 +0,0 @@
1
- <script setup>
2
- import wordclouds from './index.js'
3
- import { ref, onMounted, computed, onUnmounted } from 'vue'
4
- const emits = defineEmits(['svgClick'])
5
- const props = defineProps({
6
- // 数据项
7
- datas: {
8
- type: Array,
9
- default: () => []
10
- },
11
- // 配置项
12
- settings: {
13
- type: Object,
14
- default: () => {}
15
- }
16
- })
17
-
18
- const cloudContainerRef = ref()
19
- // 数据格式 需要包含 label、url、target、color 四个字段,label是必填项,其余字段可选
20
- // const entries = [
21
- // { label: 'Vue', url: 'https://vuejs.org', target: '_top', color: '#42b983' }
22
- // ]
23
- let settings = {
24
- children: props.datas, // 选择文本或图像标签
25
- width: 400, // 默认宽度
26
- height: 400, // 默认高度
27
- radius: '65%', // 标签云的半径百分比
28
- radiusMin: 75, // 标签云的最小半径(像素)
29
- isDrawSvgBg: true, // 是否绘制SVG背景
30
- svgBgColor: '#fff', // 背景颜色
31
- opacityOver: 1.0, // 悬停时的不透明度
32
- opacityOut: 0.3, // 未悬停时的不透明度
33
- opacitySpeed: 6, // 不透明度过渡速度
34
- fov: 800, // 摄像机视场
35
- speed: 0.2, // 旋转速度
36
- fontFamily: 'Oswald, Arial, sans-serif', // 字体系列
37
- fontSize: '14', // 字体大小
38
- fontColor: '#fff', // 字体颜色
39
- fontWeight: 'bold', // 字体粗细
40
- fontStyle: 'normal', // 字体样式
41
- fontStretch: 'narrower', // 字体拉伸
42
- fontToUpperCase: true, // 将文本转换为大写
43
- tooltipFontFamily: 'Oswald, Arial, sans-serif', // 工具提示的字体系列
44
- tooltipFontSize: '12', // 工具提示的字体大小
45
- tooltipFontColor: '#fff', // 工具提示的字体颜色
46
- tooltipFontWeight: 'normal', // 工具提示的字体粗细
47
- tooltipFontStyle: 'italic', // 工具提示的字体样式
48
- tooltipFontStretch: 'normal', // 工具提示的字体拉伸
49
- tooltipFontToUpperCase: false, // 工具提示文本是否转换为大写
50
- tooltipTextAnchor: 'center', // 工具提示的文本锚点
51
- tooltipDiffX: 10, // 工具提示的水平偏移量
52
- tooltipDiffY: 10, // 工具提示的垂直偏移量
53
- animatingSpeed: 0.01, // 动画速度
54
- animatingRadiusLimit: 1.3 // 动画的最大半径
55
- }
56
-
57
- const _settings = computed(() => {
58
- let s = {
59
- ...settings,
60
- ...props.settings
61
- }
62
-
63
- return s
64
- })
65
- //点击事件
66
- const handleTextClick = (event) => {
67
-
68
- // 检查点击的元素是否是 <text> 标签
69
- if (event.target.tagName === 'text' || event.target.tagName === 'TEXT') {
70
- // 获取 <text> 标签的文本内容
71
- const textContent = event.target.textContent
72
- if(textContent){
73
- emits('svgClick',textContent)
74
- }
75
- }
76
- }
77
- onMounted(() => {
78
- new wordclouds(document.getElementById('bd_cloud_container'), _settings.value).build()
79
-
80
- if (cloudContainerRef.value) {
81
-
82
- cloudContainerRef.value.addEventListener('click', handleTextClick)
83
- }
84
- })
85
- onUnmounted(() => {
86
-
87
- if (cloudContainerRef.value) {
88
- cloudContainerRef.value.removeEventListener('click', handleTextClick)
89
- }
90
- })
91
- </script>
92
-
93
- <template>
94
- <div>
95
- <div id="bd_cloud_container" ref="cloudContainerRef"></div>
96
- </div>
97
- </template>
98
-
99
- <style scoped></style>
@@ -1,66 +0,0 @@
1
-
2
- # 3D词云组件 使用说明
3
-
4
-
5
- ```
6
- import {BdWordsCloud} from '@bdsoft/element'
7
-
8
- // 词云点击事件
9
- const handleSvgClick = (title)=>{
10
- debugger
11
- }
12
-
13
- <BdWordsCloud @svgClick="handleSvgClick" :datas="wordscloudData" :settings="{ width: 300,height:300 }"></BdWordsCloud>
14
-
15
- // 测试数据 --数据格式 需要包含 label、url、target、color 四个字段,label是必填项,其余字段可选
16
- const entries = [
17
- { label: 'Vue', url: 'https://vuejs.org', target: '_top', color: '#42b983' },
18
- { label: 'Three.js', url: 'https://threejs.org', target: '_top', color: '#ff6347' },
19
- { label: '3D', url: '#', target: '_top', color: '#1e90ff' },
20
- { label: 'JavaScript', url: 'https://develoavaScript', target: '_top', color: '#f0db4f' },
21
- ]
22
-
23
- ```
24
- ## 配置说明
25
- ```
26
- // 配置项说明(英文翻译为中文)
27
- const settingsDescription = {
28
- children: "代表要显示的标签的对象数组。",
29
- width: "标签云的宽度,以像素为单位。默认值为400。",
30
- height: "标签云的高度,以像素为单位。默认值为400。",
31
- radius: "标签云的半径。可以是像素值或容器大小的百分比。默认值为'65%'。",
32
- radiusMin: "标签云的最小半径,以像素为单位。默认值为75。",
33
- isDrawSvgBg: "是否绘制SVG背景。默认值为false。",
34
- svgBgColor: "SVG背景的颜色。默认值为'#fff'。",
35
- opacityOver: "悬停时标签云的不透明度。默认值为1.0。",
36
- opacityOut: "标签未悬停时的不透明度。默认值为0.3。",
37
- opacitySpeed: "不透明度过渡的速度。默认值为6。",
38
- fov: "摄像机的视场。默认值为800。",
39
- speed: "标签云的旋转速度。默认值为0.1。",
40
- fontFamily: "标签使用的字体系列。默认值为'Oswald, Arial, sans-serif'。",
41
- fontSize: "标签的字体大小。默认值为'15'。",
42
- fontColor: "标签的字体颜色。默认值为'#fff'。",
43
- fontWeight: "标签的字体粗细。默认值为'normal'。",
44
- fontStyle: "标签的字体样式。默认值为'normal'。",
45
- fontStretch: "标签的字体拉伸。默认值为'narrower'。",
46
- fontToUpperCase: "是否将标签文本转换为大写。默认值为true。",
47
- tooltipFontFamily: "工具提示的字体系列。默认值为'Oswald, Arial, sans-serif'。",
48
- tooltipFontSize: "工具提示的字体大小。默认值为'12'。",
49
- tooltipFontColor: "工具提示的字体颜色。默认值为'#fff'。",
50
- tooltipFontWeight: "工具提示的字体粗细。默认值为'normal'。",
51
- tooltipFontStyle: "工具提示的字体样式。默认值为'italic'。",
52
- tooltipFontStretch: "工具提示的字体拉伸。默认值为'normal'。",
53
- tooltipFontToUpperCase: "是否将工具提示文本转换为大写。默认值为false。",
54
- tooltipTextAnchor: "工具提示的文本锚点。默认值为'left'。",
55
- tooltipDiffX: "工具提示的水平偏移量。默认值为10。",
56
- tooltipDiffY: "工具提示的垂直偏移量。默认值为10。",
57
- animatingSpeed: "动画速度。默认值为0.01。",
58
- animatingRadiusLimit: "动画的最大半径。默认值为1.3。"
59
- };
60
- ```
61
-
62
-
63
-
64
-
65
-
66
- https://www.npmjs.com/package/svg-3d-tag-cloud?activeTab=readme