vue-data-ui 2.3.3 → 2.3.5

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 (154) hide show
  1. package/README.md +19 -15
  2. package/dist/Arrow-BSOdhAJO.cjs +1 -0
  3. package/dist/Arrow-BjDVSrfA.js +101 -0
  4. package/dist/BaseIcon-BoKtpbrI.cjs +1 -0
  5. package/dist/BaseIcon-vmmfWlyR.js +174 -0
  6. package/dist/DataTable-CaB7GIwQ.js +127 -0
  7. package/dist/DataTable-ssrNbONo.cjs +1 -0
  8. package/dist/Legend-DHpoRTAE.js +62 -0
  9. package/dist/Legend-Dl5IYoxK.cjs +1 -0
  10. package/dist/Shape-CQT4S7N-.js +107 -0
  11. package/dist/Shape-CaF4pvOn.cjs +1 -0
  12. package/dist/Slicer-Bdb1BlrC.js +156 -0
  13. package/dist/Slicer-QC8nTm24.cjs +1 -0
  14. package/dist/Title-BNPZwnkp.js +46 -0
  15. package/dist/Title-Cj_xubjI.cjs +1 -0
  16. package/dist/Tooltip-CdJ5hegk.cjs +1 -0
  17. package/dist/Tooltip-ZnJAz6dl.js +94 -0
  18. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  19. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  20. package/dist/documentation/installation.md +14 -13
  21. package/dist/html2canvas.esm-BA_v9SIU.cjs +22 -0
  22. package/dist/html2canvas.esm-d2sM-0Wm.js +4870 -0
  23. package/dist/index-BMCvLyab.js +10369 -0
  24. package/dist/index-BkomIE9L.cjs +4 -0
  25. package/dist/{index.es-ypwniJN8.js → index.es-YufTdp0y.js} +1 -1
  26. package/dist/{index.es-Dnua3tHc.cjs → index.es-uyeSCnWE.cjs} +1 -1
  27. package/dist/jspdf.es.min-C660YX78.js +8038 -0
  28. package/dist/jspdf.es.min-DLYY9DTT.cjs +243 -0
  29. package/dist/pdf-97UbtKC2.js +44 -0
  30. package/dist/pdf-Cz3729tZ.cjs +1 -0
  31. package/dist/style.css +1 -1
  32. package/dist/types/vue-data-ui.d.cts +105 -5
  33. package/dist/types/vue-data-ui.d.ts +105 -5
  34. package/dist/useNestedProp-BMxXyPbW.cjs +1 -0
  35. package/dist/useNestedProp-CkP8xhG_.js +13 -0
  36. package/dist/usePrinter-BuuBz5JR.js +513 -0
  37. package/dist/usePrinter-r6uHYEcR.cjs +1 -0
  38. package/dist/useResponsive-B3TrDDIG.cjs +1 -0
  39. package/dist/useResponsive-NZB-WLRF.js +187 -0
  40. package/dist/vue-data-ui-Bc5U1cOP.cjs +9 -0
  41. package/dist/vue-data-ui-DxeO0iaC.js +254 -0
  42. package/dist/vue-data-ui.cjs +1 -1
  43. package/dist/vue-data-ui.js +61 -59
  44. package/dist/vue-ui-3d-bar-32wM0tiX.js +1085 -0
  45. package/dist/vue-ui-3d-bar-CgB0fLQT.cjs +19 -0
  46. package/dist/vue-ui-accordion-CLlVxx3Q.js +77 -0
  47. package/dist/vue-ui-accordion-SXsobrUt.cjs +1 -0
  48. package/dist/vue-ui-age-pyramid-D_CY99xF.js +596 -0
  49. package/dist/vue-ui-age-pyramid-DqiwcOIr.cjs +1 -0
  50. package/dist/vue-ui-annotator-DvP-IxDm.js +2177 -0
  51. package/dist/vue-ui-annotator-mntqd3q_.cjs +371 -0
  52. package/dist/vue-ui-candlestick-C-5u3i-1.js +657 -0
  53. package/dist/vue-ui-candlestick-C_TvUQvH.cjs +2 -0
  54. package/dist/vue-ui-carousel-table-BCePqkuz.cjs +1 -0
  55. package/dist/vue-ui-carousel-table-CAqhsLVx.js +304 -0
  56. package/dist/vue-ui-chestnut-DhWlw2MD.cjs +6 -0
  57. package/dist/vue-ui-chestnut-DylSfYMB.js +1051 -0
  58. package/dist/vue-ui-cursor-B04HJQVl.cjs +1 -0
  59. package/dist/vue-ui-cursor-DTYEMgbU.js +229 -0
  60. package/dist/vue-ui-dashboard-Bd0-cmSZ.js +232 -0
  61. package/dist/vue-ui-dashboard-DFIYwP1s.cjs +1 -0
  62. package/dist/vue-ui-digits-CW5qNMIk.js +153 -0
  63. package/dist/vue-ui-digits-Ced5mBJZ.cjs +1 -0
  64. package/dist/vue-ui-donut-DIhhgvWp.cjs +1 -0
  65. package/dist/vue-ui-donut-EeVmrVJs.js +743 -0
  66. package/dist/vue-ui-donut-evolution-BN08Y2hy.js +799 -0
  67. package/dist/vue-ui-donut-evolution-Ct6KAzs-.cjs +1 -0
  68. package/dist/vue-ui-dumbbell-BMlxS1Nq.js +624 -0
  69. package/dist/vue-ui-dumbbell-pextarqH.cjs +9 -0
  70. package/dist/vue-ui-flow-BXVsbmyb.cjs +1 -0
  71. package/dist/vue-ui-flow-CHmkgfyb.js +454 -0
  72. package/dist/vue-ui-galaxy-D4xyd-J1.cjs +1 -0
  73. package/dist/vue-ui-galaxy-kiVOZOBz.js +485 -0
  74. package/dist/vue-ui-gauge-BcO-z97J.js +466 -0
  75. package/dist/vue-ui-gauge-DPFBsbFj.cjs +1 -0
  76. package/dist/vue-ui-heatmap-DBOKYaJz.cjs +1 -0
  77. package/dist/vue-ui-heatmap-DD-Bzddj.js +598 -0
  78. package/dist/vue-ui-kpi-BEgf5yDv.cjs +1 -0
  79. package/dist/vue-ui-kpi-BS0o7zb9.js +54 -0
  80. package/dist/vue-ui-mini-loader-Bm5EJxtG.cjs +1 -0
  81. package/dist/vue-ui-mini-loader-DJEvG6ju.js +131 -0
  82. package/dist/vue-ui-molecule-DdwnFEBJ.js +750 -0
  83. package/dist/vue-ui-molecule-DzUqcaxd.cjs +1 -0
  84. package/dist/vue-ui-mood-radar-B9Gczs_Z.js +548 -0
  85. package/dist/vue-ui-mood-radar-DbB7m4Ku.cjs +1 -0
  86. package/dist/vue-ui-nested-donuts-BSINf8hd.cjs +16 -0
  87. package/dist/vue-ui-nested-donuts-CVQ1CaXo.js +771 -0
  88. package/dist/vue-ui-onion-D3-6Tv4u.cjs +1 -0
  89. package/dist/vue-ui-onion-Ut75t7hB.js +554 -0
  90. package/dist/vue-ui-parallel-coordinate-plot-Bjo09ZTX.js +651 -0
  91. package/dist/vue-ui-parallel-coordinate-plot-CJGkoIgN.cjs +8 -0
  92. package/dist/vue-ui-quadrant-CzCvejGn.cjs +1 -0
  93. package/dist/vue-ui-quadrant-Du9PKvlO.js +1178 -0
  94. package/dist/vue-ui-quick-chart-BsxsPbjz.cjs +13 -0
  95. package/dist/vue-ui-quick-chart-u0cPmD3q.js +1310 -0
  96. package/dist/vue-ui-radar-CBrpuE5r.js +614 -0
  97. package/dist/vue-ui-radar-DIpCrj1h.cjs +1 -0
  98. package/dist/vue-ui-rating-CaeGGlCw.js +271 -0
  99. package/dist/vue-ui-rating-D8fJC8Yt.cjs +1 -0
  100. package/dist/vue-ui-relation-circle-5DNf880s.js +304 -0
  101. package/dist/vue-ui-relation-circle-Ky3nPk6S.cjs +1 -0
  102. package/dist/vue-ui-rings-CffZ4T2S.cjs +1 -0
  103. package/dist/vue-ui-rings-IE3IdNRF.js +510 -0
  104. package/dist/vue-ui-scatter-C4GCZm0V.js +874 -0
  105. package/dist/vue-ui-scatter-TsX5dW9l.cjs +1 -0
  106. package/dist/vue-ui-screenshot-Bl3oooKI.js +160 -0
  107. package/dist/vue-ui-screenshot-Bzpg6yof.cjs +3 -0
  108. package/dist/vue-ui-skeleton-BisWX1sO.js +2064 -0
  109. package/dist/vue-ui-skeleton-JmGp11-u.cjs +41 -0
  110. package/dist/vue-ui-smiley-BhSrt9f-.cjs +2 -0
  111. package/dist/vue-ui-smiley-Sth2pqG1.js +763 -0
  112. package/dist/vue-ui-spark-trend-C8NSz4l8.cjs +1 -0
  113. package/dist/vue-ui-spark-trend-DAqO0TW2.js +246 -0
  114. package/dist/vue-ui-sparkbar-B0zX7NU7.js +242 -0
  115. package/dist/vue-ui-sparkbar-hL1Q6ObK.cjs +1 -0
  116. package/dist/vue-ui-sparkgauge-CWR8zJnU.js +157 -0
  117. package/dist/vue-ui-sparkgauge-tbVqaLCK.cjs +1 -0
  118. package/dist/vue-ui-sparkhistogram-Dv-lml4g.cjs +1 -0
  119. package/dist/vue-ui-sparkhistogram-DxqCtDpw.js +244 -0
  120. package/dist/vue-ui-sparkline-B6pvaBY_.cjs +1 -0
  121. package/dist/vue-ui-sparkline-BpL1jn7F.js +333 -0
  122. package/dist/vue-ui-sparkstackbar-BzbuBNIV.js +244 -0
  123. package/dist/vue-ui-sparkstackbar-CQ2TEi4p.cjs +1 -0
  124. package/dist/vue-ui-strip-plot-DCC6F4VM.cjs +1 -0
  125. package/dist/vue-ui-strip-plot-DCcbD6UE.js +618 -0
  126. package/dist/vue-ui-table-CFqIWfxl.js +1430 -0
  127. package/dist/vue-ui-table-CseaFWgX.cjs +14 -0
  128. package/dist/vue-ui-table-heatmap-Bwut-V1D.cjs +1 -0
  129. package/dist/vue-ui-table-heatmap-Bz8KYDxr.js +237 -0
  130. package/dist/vue-ui-table-sparkline-CJBU3y8-.cjs +1 -0
  131. package/dist/vue-ui-table-sparkline-z29ND2lq.js +420 -0
  132. package/dist/vue-ui-thermometer-BNAITzJa.js +385 -0
  133. package/dist/vue-ui-thermometer-DM2IKhqN.cjs +1 -0
  134. package/dist/vue-ui-timer-DLfXuW8T.cjs +64 -0
  135. package/dist/vue-ui-timer-DV6lQVHU.js +453 -0
  136. package/dist/vue-ui-tiremarks-B1bd1jPf.cjs +1 -0
  137. package/dist/vue-ui-tiremarks-WyQPg7yo.js +249 -0
  138. package/dist/vue-ui-treemap-BZGmoDHb.cjs +1 -0
  139. package/dist/vue-ui-treemap-DKmBhzV-.js +722 -0
  140. package/dist/vue-ui-vertical-bar-Bi-0rRN3.cjs +4 -0
  141. package/dist/vue-ui-vertical-bar-C-ySfrhJ.js +737 -0
  142. package/dist/vue-ui-waffle-CGRWu-da.js +638 -0
  143. package/dist/vue-ui-waffle-VLYkR-YZ.cjs +1 -0
  144. package/dist/vue-ui-wheel-D2q5vy5V.cjs +1 -0
  145. package/dist/vue-ui-wheel-Pj9OPk9f.js +227 -0
  146. package/dist/vue-ui-word-cloud-8Vr-jo1p.js +346 -0
  147. package/dist/vue-ui-word-cloud-Ba4BjatU.cjs +1 -0
  148. package/dist/vue-ui-xy-C4QW5Lfl.cjs +3 -0
  149. package/dist/vue-ui-xy-canvas-Be-Da_0x.cjs +9 -0
  150. package/dist/vue-ui-xy-canvas-DnLWrf0e.js +1006 -0
  151. package/dist/vue-ui-xy-qToggEfh.js +2064 -0
  152. package/package.json +1 -1
  153. package/dist/index-BcMihqI4.cjs +0 -843
  154. package/dist/index-C7FeCQ7K.js +0 -57303
@@ -0,0 +1,271 @@
1
+ import { ref as f, computed as $, onMounted as G, openBlock as l, createElementBlock as i, normalizeStyle as a, createElementVNode as n, toDisplayString as p, createCommentVNode as d, Fragment as E, renderList as L, unref as m, withKeys as U, createTextVNode as D } from "vue";
2
+ import { u as K, c as T, o as H, e as P, X as _, s as N, O as F } from "./index-BMCvLyab.js";
3
+ import { u as W } from "./useNestedProp-CkP8xhG_.js";
4
+ import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ const J = {
6
+ key: 0,
7
+ class: "vue-ui-rating-title",
8
+ style: { width: "100%" }
9
+ }, Q = ["src", "height", "width"], Z = ["xmlns", "height", "width"], tt = ["id"], et = ["stop-color"], lt = ["stop-color"], it = ["points", "fill", "stroke", "stroke-width"], at = ["src", "alt", "height", "width", "id"], ot = ["xmlns", "viewBox", "height", "id"], st = ["id"], nt = ["stop-color"], rt = ["stop-color"], ut = ["points", "fill", "stroke"], vt = ["xmlns", "height"], dt = ["onClick", "onMouseenter", "onKeyup"], yt = ["onMouseenter"], pt = {
10
+ __name: "vue-ui-rating",
11
+ props: {
12
+ config: {
13
+ type: Object,
14
+ default() {
15
+ return {};
16
+ }
17
+ },
18
+ dataset: {
19
+ type: Object,
20
+ default() {
21
+ return {};
22
+ }
23
+ }
24
+ },
25
+ emits: ["rate"],
26
+ setup(M, { expose: A, emit: V }) {
27
+ const v = M, { vue_ui_rating: R } = K(), x = f(T()), b = f(!1), u = f(void 0), w = f([]), t = $(() => W({
28
+ userConfig: v.config,
29
+ defaultConfig: R
30
+ })), X = $(() => typeof v.dataset.rating == "object" && !Array.isArray(v.dataset.rating) ? B(v.dataset.rating) : v.dataset.rating), j = $(() => typeof v.dataset.rating == "object" && !Array.isArray(v.dataset.rating)), r = f(X.value), k = f(t.value.type === "image"), c = f(t.value.readonly);
31
+ function B(o) {
32
+ let s = 0, e = 0;
33
+ for (const y in o) {
34
+ const Y = parseInt(y), C = o[y];
35
+ s += Y * C, e += C;
36
+ }
37
+ if (e === 0)
38
+ return 0;
39
+ const g = s / e;
40
+ return Math.min(t.value.to, Math.max(t.value.from, g));
41
+ }
42
+ G(() => {
43
+ H(v.dataset) && P({
44
+ componentName: "VueUiRating",
45
+ type: "dataset"
46
+ });
47
+ for (let o = t.value.from; o <= t.value.to; o += 1)
48
+ w.value.push(o);
49
+ });
50
+ function h(o, s = !1) {
51
+ return o > u.value || c.value ? s ? t.value.style.image.inactiveOpacity : t.value.style.star.inactiveColor : s ? 1 : t.value.style.star.useGradient ? `url(#star_gradient_under_${x.value})` : t.value.style.star.activeColor;
52
+ }
53
+ function z(o, s = !1) {
54
+ const e = r.value - o, g = s ? 1 : 100;
55
+ switch (!0) {
56
+ case e <= 0:
57
+ return 1e-3;
58
+ case e > 1:
59
+ return 1 * g;
60
+ default:
61
+ return e * g;
62
+ }
63
+ }
64
+ function S(o) {
65
+ c.value || (r.value = o, V("rate", o));
66
+ }
67
+ function I() {
68
+ return r.value;
69
+ }
70
+ function O(o = !0) {
71
+ c.value = o;
72
+ }
73
+ return A({
74
+ getData: I,
75
+ toggleReadonly: O
76
+ }), (o, s) => (l(), i("div", {
77
+ style: a(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),
78
+ class: "vue-ui-rating",
79
+ onMouseover: s[2] || (s[2] = (e) => b.value = !0),
80
+ onMouseleave: s[3] || (s[3] = (e) => {
81
+ b.value = !1, u.value = void 0;
82
+ })
83
+ }, [
84
+ t.value.style.title.text ? (l(), i("div", J, [
85
+ n("div", {
86
+ style: a(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold ? "bold" : "normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)
87
+ }, p(t.value.style.title.text), 5),
88
+ t.value.style.title.subtitle.text ? (l(), i("div", {
89
+ key: 0,
90
+ style: a(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold ? "bold" : "normal"}`)
91
+ }, p(t.value.style.title.subtitle.text), 5)) : d("", !0)
92
+ ])) : d("", !0),
93
+ t.value.style.rating.show && t.value.style.rating.position === "top" ? (l(), i("div", {
94
+ key: 1,
95
+ style: a(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold ? "bold" : "normal"};margin-left:${t.value.style.rating.offsetX}px`)
96
+ }, p(isNaN(r.value) ? "" : r.value.toFixed(t.value.style.rating.roundingValue)), 5)) : d("", !0),
97
+ n("div", {
98
+ class: "vue-ui-rating-wrapper",
99
+ style: a(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)
100
+ }, [
101
+ t.value.style.rating.show && t.value.style.rating.position === "left" ? (l(), i("div", {
102
+ key: 0,
103
+ style: a(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold ? "bold" : "normal"};padding-right:${t.value.style.rating.offsetX}px`)
104
+ }, p(isNaN(r.value) ? "" : r.value.toFixed(t.value.style.rating.roundingValue)), 5)) : d("", !0),
105
+ (l(!0), i(E, null, L(w.value, (e, g) => (l(), i("div", {
106
+ class: "vue-ui-rating-unit-container",
107
+ style: a(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)
108
+ }, [
109
+ k.value ? (l(), i("img", {
110
+ key: 0,
111
+ src: t.value.style.image.src,
112
+ height: t.value.style.itemSize,
113
+ width: t.value.style.itemSize,
114
+ class: "vue-ui-rating-unit",
115
+ style: a(`position:absolute;top:0;left:0;opacity:${isNaN(u.value) ? t.value.style.image.inactiveOpacity : h(e, !0)}`)
116
+ }, null, 12, Q)) : (l(), i("svg", {
117
+ key: 1,
118
+ xmlns: m(_),
119
+ viewBox: "0 0 100 100",
120
+ height: t.value.style.itemSize,
121
+ width: t.value.style.itemSize,
122
+ class: "vue-ui-rating-unit"
123
+ }, [
124
+ n("defs", null, [
125
+ n("radialGradient", {
126
+ cx: "50%",
127
+ cy: "50%",
128
+ r: "50%",
129
+ fx: "50%",
130
+ fy: "50%",
131
+ id: `star_gradient_under_${x.value}`
132
+ }, [
133
+ n("stop", {
134
+ offset: "0%",
135
+ "stop-color": `${m(N)(t.value.style.star.activeColor, 0.05)}`
136
+ }, null, 8, et),
137
+ n("stop", {
138
+ offset: "100%",
139
+ "stop-color": t.value.style.star.activeColor
140
+ }, null, 8, lt)
141
+ ], 8, tt)
142
+ ]),
143
+ n("polygon", {
144
+ points: m(F)({
145
+ plot: { x: 50, y: 50 },
146
+ radius: 30,
147
+ apexes: t.value.style.star.apexes
148
+ }),
149
+ fill: isNaN(u.value) ? t.value.style.star.inactiveColor : h(e),
150
+ stroke: t.value.style.star.borderColor ? t.value.style.star.borderColor : u.value ? h(e) : t.value.style.star.inactiveColor,
151
+ "stroke-width": t.value.style.star.borderWidth,
152
+ "stroke-linecap": "round",
153
+ "stroke-linejoin": "round"
154
+ }, null, 8, it)
155
+ ], 8, Z)),
156
+ k.value ? (l(), i("img", {
157
+ key: 2,
158
+ src: t.value.style.image.src,
159
+ alt: `${t.value.style.image.alt} ${e}`,
160
+ height: t.value.style.itemSize,
161
+ width: t.value.style.itemSize,
162
+ id: `active_${x.value}_${e}`,
163
+ class: "vue-ui-rating-unit",
164
+ style: a(`position:absolute;top:0;left:0;clip:rect(0px,${z(g, !0) * t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)
165
+ }, null, 12, at)) : (l(), i("svg", {
166
+ key: 3,
167
+ xmlns: m(_),
168
+ viewBox: `0 0 ${z(g)} 100`,
169
+ height: t.value.style.itemSize,
170
+ class: "vue-ui-rating-unit",
171
+ id: `active_${x.value}_${e}`,
172
+ style: { position: "absolute", top: "0", left: "0" }
173
+ }, [
174
+ n("defs", null, [
175
+ n("radialGradient", {
176
+ cx: "50%",
177
+ cy: "50%",
178
+ r: "50%",
179
+ fx: "50%",
180
+ fy: "50%",
181
+ id: `star_gradient_over_${x.value}`
182
+ }, [
183
+ n("stop", {
184
+ offset: "0%",
185
+ "stop-color": `${m(N)(t.value.style.star.activeColor, 0.05)}`
186
+ }, null, 8, nt),
187
+ n("stop", {
188
+ offset: "100%",
189
+ "stop-color": t.value.style.star.activeColor
190
+ }, null, 8, rt)
191
+ ], 8, st)
192
+ ]),
193
+ n("polygon", {
194
+ points: m(F)({
195
+ plot: { x: 50, y: 50 },
196
+ radius: 30,
197
+ apexes: t.value.style.star.apexes
198
+ }),
199
+ fill: t.value.style.star.useGradient ? `url(#star_gradient_over_${x.value})` : t.value.style.star.activeColor,
200
+ stroke: t.value.style.star.activeColor
201
+ }, null, 8, ut)
202
+ ], 8, ot)),
203
+ (l(), i("svg", {
204
+ xmlns: m(_),
205
+ viewBox: "0 0 100 100",
206
+ height: t.value.style.itemSize,
207
+ class: "vue-ui-rating-unit",
208
+ style: a(`position:absolute;top:0;left:0;${c.value ? "" : "cursor:pointer"}`)
209
+ }, [
210
+ c.value ? d("", !0) : (l(), i("rect", {
211
+ key: 0,
212
+ class: "vue-ui-rating-mouse-trap",
213
+ x: 0,
214
+ y: 0,
215
+ width: 100,
216
+ height: 100,
217
+ fill: "transparent",
218
+ onClick: (y) => S(e),
219
+ onMouseenter: (y) => u.value = e,
220
+ onMouseleave: s[0] || (s[0] = (y) => u.value = void 0),
221
+ tabindex: "0",
222
+ onKeyup: U((y) => S(e), ["enter"])
223
+ }, null, 40, dt)),
224
+ c.value ? (l(), i("rect", {
225
+ key: 1,
226
+ class: "vue-ui-rating-mouse-trap",
227
+ x: 0,
228
+ y: 0,
229
+ width: 100,
230
+ height: 100,
231
+ fill: "transparent",
232
+ onMouseenter: (y) => u.value = e,
233
+ onMouseleave: s[1] || (s[1] = (y) => u.value = void 0)
234
+ }, null, 40, yt)) : d("", !0)
235
+ ], 12, vt)),
236
+ t.value.style.tooltip.show && j.value && c.value ? (l(), i("div", {
237
+ key: 4,
238
+ class: "vue-ui-rating-tooltip",
239
+ style: a(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48 + t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${u.value === e ? "block" : "none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)
240
+ }, [
241
+ n("div", {
242
+ style: a(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)
243
+ }, [
244
+ n("span", {
245
+ style: a(`font-size:${t.value.style.tooltip.fontSize}px`)
246
+ }, p(e), 5),
247
+ D(" : "),
248
+ n("span", {
249
+ style: a(`font-weight:${t.value.style.tooltip.bold ? "bold" : "normal"};font-size:${t.value.style.tooltip.fontSize}px`)
250
+ }, p(v.dataset.rating[e]), 5),
251
+ n("div", {
252
+ style: a(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)
253
+ }, " ▼ ", 4)
254
+ ], 4)
255
+ ], 4)) : d("", !0)
256
+ ], 4))), 256)),
257
+ t.value.style.rating.show && t.value.style.rating.position === "right" ? (l(), i("div", {
258
+ key: 1,
259
+ style: a(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold ? "bold" : "normal"};padding-left:${t.value.style.rating.offsetX}px`)
260
+ }, p(isNaN(r.value) ? "" : r.value.toFixed(t.value.style.rating.roundingValue)), 5)) : d("", !0)
261
+ ], 4),
262
+ t.value.style.rating.show && t.value.style.rating.position === "bottom" ? (l(), i("div", {
263
+ key: 2,
264
+ style: a(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold ? "bold" : "normal"};margin-left:${t.value.style.rating.offsetX}px`)
265
+ }, p(isNaN(r.value) ? "" : r.value.toFixed(t.value.style.rating.roundingValue)), 5)) : d("", !0)
266
+ ], 36));
267
+ }
268
+ }, xt = /* @__PURE__ */ q(pt, [["__scopeId", "data-v-86ced882"]]);
269
+ export {
270
+ xt as default
271
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BkomIE9L.cjs"),C=require("./useNestedProp-BMxXyPbW.cjs"),V=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},F=["src","height","width"],A=["xmlns","height","width"],D=["id"],R=["stop-color"],X=["stop-color"],j=["points","fill","stroke","stroke-width"],I=["src","alt","height","width","id"],O=["xmlns","viewBox","height","id"],Y=["id"],G=["stop-color"],L=["stop-color"],q=["points","fill","stroke"],T=["xmlns","height"],U=["onClick","onMouseenter","onKeyup"],H=["onMouseenter"],K={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup($,{expose:k,emit:S}){const s=$,{vue_ui_rating:_}=n.useConfig(),d=e.ref(n.createUid()),p=e.ref(!1),r=e.ref(void 0),g=e.ref([]),t=e.computed(()=>C.useNestedProp({userConfig:s.config,defaultConfig:_})),b=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)?z(s.dataset.rating):s.dataset.rating),N=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)),i=e.ref(b.value),f=e.ref(t.value.type==="image"),c=e.ref(t.value.readonly);function z(o){let a=0,l=0;for(const u in o){const E=parseInt(u),h=o[u];a+=E*h,l+=h}if(l===0)return 0;const v=a/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{n.objectIsEmpty(s.dataset)&&n.error({componentName:"VueUiRating",type:"dataset"});for(let o=t.value.from;o<=t.value.to;o+=1)g.value.push(o)});function y(o,a=!1){return o>r.value||c.value?a?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:a?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function m(o,a=!1){const l=i.value-o,v=a?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function x(o){c.value||(i.value=o,S("rate",o))}function w(){return i.value}function B(o=!0){c.value=o}return k({getData:w,toggleReadonly:B}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:a[2]||(a[2]=l=>p.value=!0),onMouseleave:a[3]||(a[3]=l=>{p.value=!1,r.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(r.value)?t.value.style.image.inactiveOpacity:y(l,!0)}`)},null,12,F)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,X)],8,D)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(r.value)?t.value.style.star.inactiveColor:y(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:r.value?y(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,j)],8,A)),f.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${m(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,I)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${m(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,L)],8,Y)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,q)],8,O)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(n.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>x(l),onMouseenter:u=>r.value=l,onMouseleave:a[0]||(a[0]=u=>r.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>x(l),["enter"])},null,40,U)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>r.value=l,onMouseleave:a[1]||(a[1]=u=>r.value=void 0)},null,40,H)):e.createCommentVNode("",!0)],12,T)),t.value.style.tooltip.show&&N.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${r.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l),5),e.createTextVNode(" : "),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(s.dataset.rating[l]),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],36))}},P=V._export_sfc(K,[["__scopeId","data-v-86ced882"]]);exports.default=P;
@@ -0,0 +1,304 @@
1
+ import { useCssVars as ge, computed as c, ref as u, onMounted as he, onBeforeUnmount as ye, openBlock as a, createElementBlock as o, normalizeStyle as g, createVNode as me, createCommentVNode as C, createBlock as W, unref as _, createSlots as ke, withCtx as E, renderSlot as b, normalizeProps as _e, guardReactiveProps as pe, normalizeClass as z, createElementVNode as $e, Fragment as w, renderList as O, toDisplayString as xe } from "vue";
2
+ import { u as Ce, c as be, t as we, a as Oe, p as X, b as Pe, o as Ae, e as Y, g as Ie, X as Fe } from "./index-BMCvLyab.js";
3
+ import { t as Ee, u as ze } from "./useResponsive-NZB-WLRF.js";
4
+ import { _ as Le } from "./Title-BNPZwnkp.js";
5
+ import { u as Ne, U as Re } from "./usePrinter-BuuBz5JR.js";
6
+ import Se from "./vue-ui-skeleton-BisWX1sO.js";
7
+ import { u as q } from "./useNestedProp-CkP8xhG_.js";
8
+ import { _ as Te } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
+ const Me = ["id"], je = ["xmlns", "viewBox"], Be = ["cx", "cy", "r", "stroke", "stroke-width"], Ge = { key: 0 }, Ue = ["stroke", "d", "stroke-width"], De = { key: 1 }, Ve = ["stroke", "x1", "x2", "y1", "y2"], We = ["text-anchor", "transform", "x", "y", "onClick", "font-weight", "font-size", "fill"], Xe = ["cx", "cy", "fill", "onClick", "r"], Ye = {
10
+ __name: "vue-ui-relation-circle",
11
+ props: {
12
+ dataset: {
13
+ type: Array,
14
+ default() {
15
+ return [];
16
+ }
17
+ },
18
+ config: {
19
+ type: Object,
20
+ default() {
21
+ return {};
22
+ }
23
+ }
24
+ },
25
+ setup(H, { expose: J }) {
26
+ const v = H;
27
+ ge((e) => ({
28
+ "69fb0529": re.value,
29
+ "3158da88": le.value,
30
+ "2b571f2c": se.value
31
+ }));
32
+ const { vue_ui_relation_circle: K } = Ce(), P = c(() => !!v.dataset && Object.keys(v.dataset).length), y = u(be()), L = u(0), p = u(null), N = u(null), l = c(() => {
33
+ const e = q({
34
+ userConfig: v.config,
35
+ defaultConfig: K
36
+ });
37
+ return e.theme ? {
38
+ ...q({
39
+ userConfig: we.vue_ui_relation_circle[e.theme] || v.config,
40
+ defaultConfig: e
41
+ }),
42
+ customPalette: Oe[e.theme] || X
43
+ } : e;
44
+ }), { isPrinting: Q, isImaging: Z, generatePdf: R, generateImage: S } = Ne({
45
+ elementId: `relation_circle_${y.value}`,
46
+ fileName: l.value.style.title.text || "vue-ui-relation-circle"
47
+ }), T = c(() => Pe(l.value.customPalette)), h = u([]), m = u([]), n = u({}), d = u([]), ee = u(0), A = c(() => v.dataset.slice(0, l.value.style.limit)), I = u(l.value.style.size), i = u({
48
+ height: l.value.style.size,
49
+ width: l.value.style.size
50
+ }), f = c({
51
+ get() {
52
+ return I.value * l.value.style.circle.radiusProportion;
53
+ },
54
+ set(e) {
55
+ return e;
56
+ }
57
+ }), te = c(() => l.value.style.links.curved), le = c(() => `${l.value.style.animation.speedMs}ms`), re = c(() => f.value * 2), se = c(() => f.value * 4), $ = u(null);
58
+ he(() => {
59
+ if (Ae(v.dataset) ? Y({
60
+ componentName: "VueUiRelationCircle",
61
+ type: "dataset"
62
+ }) : v.dataset.forEach((s, t) => {
63
+ Ie({
64
+ datasetObject: s,
65
+ requiredAttributes: ["id", "label", "relations", "weights"]
66
+ }).forEach((r) => {
67
+ Y({
68
+ componentName: "VueUiRelationCircle",
69
+ type: "datasetSerieAttribute",
70
+ property: r,
71
+ index: t
72
+ });
73
+ });
74
+ }), l.value.responsive) {
75
+ const s = Ee(() => {
76
+ const { width: t, height: r } = ze({
77
+ chart: p.value,
78
+ title: l.value.style.title.text ? N.value : null
79
+ });
80
+ I.value = Math.min(t, r), i.value.width = t, i.value.height = r, f.value = I.value * l.value.style.circle.radiusProportion, h.value = [], m.value = [], j(), B();
81
+ });
82
+ $.value = new ResizeObserver(s), $.value.observe(p.value.parentNode);
83
+ } else
84
+ j(), B();
85
+ document.getElementById(`relation_circle_${y.value}`).addEventListener("click", M);
86
+ }), ye(() => {
87
+ document.getElementById(`relation_circle_${y.value}`).removeEventListener("click", M), $.value && $.value.disconnect();
88
+ });
89
+ function M(e) {
90
+ const s = e.target;
91
+ s && Array.from(s.classList).includes("vue-ui-user-options") || s && Array.from(s.classList).includes("vue-ui-user-options-summary") || s && Array.from(s.classList).includes("vue-data-ui-button") || s && Array.from(s.classList).includes("vue-ui-relation-circle-legend") || (n.value = {}, d.value = []);
92
+ }
93
+ function j() {
94
+ const e = 6.28319 / A.value.length, s = 360 / A.value.length;
95
+ let t = 0, r = 0;
96
+ A.value.forEach((k, F) => {
97
+ const ve = f.value * Math.cos(t) + i.value.width / 2, fe = f.value * Math.sin(t) + i.value.height / 2 + l.value.style.circle.offsetY;
98
+ h.value.push({ x: ve, y: fe, ...k, color: k.color ? k.color : T.value[F] ? T.value[F] : X[F], regAngle: r }), t += e, r += s;
99
+ });
100
+ }
101
+ function B() {
102
+ h.value.forEach((e) => {
103
+ h.value.filter((t) => t.relations.includes(e.id)).forEach((t, r) => {
104
+ m.value.push({
105
+ weight: e.weights && e.weights[r] ? e.weights[r] : 1,
106
+ relationId: `${e.id}_${t.id}`,
107
+ x1: e.x,
108
+ y1: e.y,
109
+ x2: t.x,
110
+ y2: t.y,
111
+ colorSource: e.color,
112
+ colorTarget: t.color,
113
+ ...e
114
+ });
115
+ });
116
+ });
117
+ }
118
+ const ne = c(() => Math.max(...m.value.map((e) => e.weight)));
119
+ function ie(e) {
120
+ return Object.hasOwn(n.value, "x") ? d.value.includes(e.id) ? "opacity:1" : "opacity:0.1" : "opacity:1";
121
+ }
122
+ function G(e) {
123
+ return Object.hasOwn(n.value, "x") ? e.colorTarget : e.colorSource;
124
+ }
125
+ function U(e) {
126
+ return Object.hasOwn(n.value, "x") ? d.value.includes(e.id) && e.relationId === `${e.id}_${n.value.id}` || e.relationId === `${n.value.id}_${e.id}` ? `opacity:1;stroke-width:${V(e)}` : "opacity: 0" : "opacity: 1";
127
+ }
128
+ function ae(e) {
129
+ return e.regAngle > 90 && e.regAngle < 270 ? "end" : "start";
130
+ }
131
+ function ue(e) {
132
+ return e.regAngle > 90 && e.regAngle < 270 ? e.x - 5 : e.x + 5;
133
+ }
134
+ function oe(e) {
135
+ return Object.hasOwn(n.value, "x") ? n.value.id === e.id || d.value.includes(e.id) ? "opacity:1" : "opacity:0.2" : "opacity:1";
136
+ }
137
+ function ce(e) {
138
+ return e.regAngle > 90 && e.regAngle < 270 ? `rotate(${e.regAngle + 180},${e.x},${e.y})` : `rotate(${e.regAngle},${e.x},${e.y})`;
139
+ }
140
+ function D(e) {
141
+ ee.value = 360 - e.regAngle, n.value.id && e.id === n.value.id ? (n.value = {}, d.value = []) : (n.value = e, d.value = [...e.relations]);
142
+ }
143
+ function V(e) {
144
+ return e.weight / ne.value * l.value.style.links.maxWidth;
145
+ }
146
+ const x = u(!1);
147
+ function de(e) {
148
+ x.value = e, L.value += 1;
149
+ }
150
+ return J({
151
+ generatePdf: R,
152
+ generateImage: S
153
+ }), (e, s) => (a(), o("div", {
154
+ ref_key: "relationCircleChart",
155
+ ref: p,
156
+ class: "vue-ui-relation-circle",
157
+ style: g(`width:100%;background:${l.value.style.backgroundColor};text-align:center;${l.value.responsive ? "height: 100%" : ""}`),
158
+ id: `relation_circle_${y.value}`
159
+ }, [
160
+ l.value.style.title.text ? (a(), o("div", {
161
+ key: 0,
162
+ ref_key: "chartTitle",
163
+ ref: N,
164
+ style: g(`width:100%;background:${l.value.style.backgroundColor}`)
165
+ }, [
166
+ me(Le, {
167
+ config: {
168
+ title: {
169
+ cy: "relation-div-title",
170
+ ...l.value.style.title
171
+ },
172
+ subtitle: {
173
+ cy: "relation-div-subtitle",
174
+ ...l.value.style.title.subtitle
175
+ }
176
+ }
177
+ }, null, 8, ["config"])
178
+ ], 4)) : C("", !0),
179
+ l.value.userOptions.show && P.value ? (a(), W(Re, {
180
+ ref: "details",
181
+ key: `user_options_${L.value}`,
182
+ backgroundColor: l.value.style.backgroundColor,
183
+ color: l.value.style.color,
184
+ isPrinting: _(Q),
185
+ isImaging: _(Z),
186
+ uid: y.value,
187
+ hasPdf: l.value.userOptions.buttons.pdf,
188
+ hasImg: l.value.userOptions.buttons.img,
189
+ hasFullscreen: l.value.userOptions.buttons.img,
190
+ hasXls: !1,
191
+ isFullscreen: x.value,
192
+ titles: { ...l.value.userOptions.buttonTitles },
193
+ chartElement: p.value,
194
+ onToggleFullscreen: de,
195
+ onGeneratePdf: _(R),
196
+ onGenerateImage: _(S)
197
+ }, ke({ _: 2 }, [
198
+ e.$slots.optionPdf ? {
199
+ name: "optionPdf",
200
+ fn: E(() => [
201
+ b(e.$slots, "optionPdf", {}, void 0, !0)
202
+ ]),
203
+ key: "0"
204
+ } : void 0,
205
+ e.$slots.optionImg ? {
206
+ name: "optionImg",
207
+ fn: E(() => [
208
+ b(e.$slots, "optionImg", {}, void 0, !0)
209
+ ]),
210
+ key: "1"
211
+ } : void 0,
212
+ e.$slots.optionFullscreen ? {
213
+ name: "optionFullscreen",
214
+ fn: E(({ toggleFullscreen: t, isFullscreen: r }) => [
215
+ b(e.$slots, "optionFullscreen", _e(pe({ toggleFullscreen: t, isFullscreen: r })), void 0, !0)
216
+ ]),
217
+ key: "2"
218
+ } : void 0
219
+ ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasImg", "hasFullscreen", "isFullscreen", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : C("", !0),
220
+ P.value ? (a(), o("svg", {
221
+ key: 2,
222
+ xmlns: _(Fe),
223
+ class: z([{ "vue-data-ui-fullscreen--on": x.value, "vue-data-ui-fulscreen--off": !x.value }, "relation-circle"]),
224
+ viewBox: `0 0 ${i.value.width <= 0 ? 10 : i.value.width} ${i.value.height <= 0 ? 10 : i.value.height}`,
225
+ width: "100%",
226
+ style: g(`user-select:none; background:${l.value.style.backgroundColor}`)
227
+ }, [
228
+ $e("circle", {
229
+ cx: (i.value.width <= 0 ? 1e-4 : i.value.width) / 2,
230
+ cy: (i.value.height <= 0 ? 1e-4 : i.value.height) / 2 + l.value.style.circle.offsetY,
231
+ r: f.value <= 0 ? 1e-4 : f.value,
232
+ stroke: l.value.style.circle.stroke,
233
+ "stroke-width": l.value.style.circle.strokeWidth,
234
+ fill: "transparent",
235
+ class: "main-circle"
236
+ }, null, 8, Be),
237
+ te.value ? (a(), o("g", Ge, [
238
+ (a(!0), o(w, null, O(m.value, (t, r) => (a(), o("path", {
239
+ key: `relation_${r}`,
240
+ style: g(U(t)),
241
+ stroke: G(t),
242
+ class: z(["relation", { "vue-ui-relation-circle-selected": n.value.hasOwnProperty("id") && d.value.includes(t.id) }]),
243
+ d: `M${t.x1},${t.y1} C${t.x1},${t.y1} ${i.value.width / 2},${i.value.height / 2 + l.value.style.circle.offsetY} ${t.x2},${t.y2}`,
244
+ fill: "none",
245
+ "stroke-width": V(t),
246
+ "stroke-linecap": "round"
247
+ }, null, 14, Ue))), 128))
248
+ ])) : (a(), o("g", De, [
249
+ (a(!0), o(w, null, O(m.value, (t, r) => (a(), o("line", {
250
+ key: `relation_${r}`,
251
+ stroke: G(t),
252
+ style: g(U(t)),
253
+ x1: t.x1,
254
+ x2: t.x2,
255
+ y1: t.y1,
256
+ y2: t.y2,
257
+ class: z({ "vue-ui-relation-circle-selected": n.value.hasOwnProperty("id") && d.value.includes(t.id) }),
258
+ "stroke-linecap": "round"
259
+ }, null, 14, Ve))), 128))
260
+ ])),
261
+ (a(!0), o(w, null, O(h.value, (t, r) => (a(), o("text", {
262
+ key: `plot_text_${r}`,
263
+ "text-anchor": ae(t),
264
+ transform: ce(t),
265
+ x: ue(t),
266
+ y: t.y + 5,
267
+ onClick: (k) => D(t),
268
+ class: "vue-ui-relation-circle-legend",
269
+ "transform-origin": "start",
270
+ "font-weight": n.value.id === t.id ? "900" : "400",
271
+ style: g(`font-family:${l.value.style.fontFamily};${oe(t)}`),
272
+ "font-size": l.value.style.labels.fontSize,
273
+ fill: l.value.style.labels.color
274
+ }, xe(t.label), 13, We))), 128)),
275
+ (a(!0), o(w, null, O(h.value, (t, r) => (a(), o("circle", {
276
+ cx: t.x,
277
+ cy: t.y,
278
+ key: `plot_${r}`,
279
+ style: g(ie(t)),
280
+ class: "vue-ui-relation-circle-plot",
281
+ fill: l.value.style.plot.color,
282
+ onClick: (k) => D(t),
283
+ r: l.value.style.plot.radius
284
+ }, null, 12, Xe))), 128)),
285
+ b(e.$slots, "svg", { svg: i.value }, void 0, !0)
286
+ ], 14, je)) : C("", !0),
287
+ P.value ? C("", !0) : (a(), W(Se, {
288
+ key: 3,
289
+ config: {
290
+ type: "relationCircle",
291
+ style: {
292
+ backgroundColor: l.value.style.backgroundColor,
293
+ relationCircle: {
294
+ color: "#CCCCCC"
295
+ }
296
+ }
297
+ }
298
+ }, null, 8, ["config"]))
299
+ ], 12, Me));
300
+ }
301
+ }, lt = /* @__PURE__ */ Te(Ye, [["__scopeId", "data-v-44982e30"]]);
302
+ export {
303
+ lt as default
304
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BkomIE9L.cjs"),N=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title-Cj_xubjI.cjs"),L=require("./usePrinter-r6uHYEcR.cjs"),ne=require("./vue-ui-skeleton-JmGp11-u.cjs"),T=require("./useNestedProp-BMxXyPbW.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),se=["id"],ae=["xmlns","viewBox"],oe=["cx","cy","r","stroke","stroke-width"],ue={key:0},ce=["stroke","d","stroke-width"],de={key:1},ve=["stroke","x1","x2","y1","y2"],fe=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],ge=["cx","cy","fill","onClick","r"],ye={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(R,{expose:M}){const c=R;e.useCssVars(t=>({"69fb0529":W.value,"3158da88":D.value,"2b571f2c":X.value}));const{vue_ui_relation_circle:V}=o.useConfig(),p=e.computed(()=>!!c.dataset&&Object.keys(c.dataset).length),f=e.ref(o.createUid()),$=e.ref(0),m=e.ref(null),b=e.ref(null),r=e.computed(()=>{const t=T.useNestedProp({userConfig:c.config,defaultConfig:V});return t.theme?{...T.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||c.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}),{isPrinting:j,isImaging:q,generatePdf:w,generateImage:B}=L.usePrinter({elementId:`relation_circle_${f.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),P=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),v=e.ref([]),g=e.ref([]),s=e.ref({}),u=e.ref([]),G=e.ref(0),_=e.computed(()=>c.dataset.slice(0,r.value.style.limit)),x=e.ref(r.value.style.size),a=e.ref({height:r.value.style.size,width:r.value.style.size}),d=e.computed({get(){return x.value*r.value.style.circle.radiusProportion},set(t){return t}}),U=e.computed(()=>r.value.style.links.curved),D=e.computed(()=>`${r.value.style.animation.speedMs}ms`),W=e.computed(()=>d.value*2),X=e.computed(()=>d.value*4),h=e.ref(null);e.onMounted(()=>{if(o.objectIsEmpty(c.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):c.dataset.forEach((i,l)=>{o.getMissingDatasetAttributes({datasetObject:i,requiredAttributes:["id","label","relations","weights"]}).forEach(n=>{o.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:n,index:l})})}),r.value.responsive){const i=N.throttle(()=>{const{width:l,height:n}=N.useResponsive({chart:m.value,title:r.value.style.title.text?b.value:null});x.value=Math.min(l,n),a.value.width=l,a.value.height=n,d.value=x.value*r.value.style.circle.radiusProportion,v.value=[],g.value=[],E(),A()});h.value=new ResizeObserver(i),h.value.observe(m.value.parentNode)}else E(),A();document.getElementById(`relation_circle_${f.value}`).addEventListener("click",O)}),e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${f.value}`).removeEventListener("click",O),h.value&&h.value.disconnect()});function O(t){const i=t.target;i&&Array.from(i.classList).includes("vue-ui-user-options")||i&&Array.from(i.classList).includes("vue-ui-user-options-summary")||i&&Array.from(i.classList).includes("vue-data-ui-button")||i&&Array.from(i.classList).includes("vue-ui-relation-circle-legend")||(s.value={},u.value=[])}function E(){const t=6.28319/_.value.length,i=360/_.value.length;let l=0,n=0;_.value.forEach((y,C)=>{const te=d.value*Math.cos(l)+a.value.width/2,le=d.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;v.value.push({x:te,y:le,...y,color:y.color?y.color:P.value[C]?P.value[C]:o.palette[C],regAngle:n}),l+=t,n+=i})}function A(){v.value.forEach(t=>{v.value.filter(l=>l.relations.includes(t.id)).forEach((l,n)=>{g.value.push({weight:t.weights&&t.weights[n]?t.weights[n]:1,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,...t})})})}const Y=e.computed(()=>Math.max(...g.value.map(t=>t.weight)));function H(t){return Object.hasOwn(s.value,"x")?u.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function I(t){return Object.hasOwn(s.value,"x")?t.colorTarget:t.colorSource}function S(t){return Object.hasOwn(s.value,"x")?u.value.includes(t.id)&&t.relationId===`${t.id}_${s.value.id}`||t.relationId===`${s.value.id}_${t.id}`?`opacity:1;stroke-width:${F(t)}`:"opacity: 0":"opacity: 1"}function J(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function K(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function Q(t){return Object.hasOwn(s.value,"x")?s.value.id===t.id||u.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function Z(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function z(t){G.value=360-t.regAngle,s.value.id&&t.id===s.value.id?(s.value={},u.value=[]):(s.value=t,u.value=[...t.relations])}function F(t){return t.weight/Y.value*r.value.style.links.maxWidth}const k=e.ref(!1);function ee(t){k.value=t,$.value+=1}return M({generatePdf:w,generateImage:B}),(t,i)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:m,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor};text-align:center;${r.value.responsive?"height: 100%":""}`),id:`relation_circle_${f.value}`},[r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:b,style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor}`)},[e.createVNode(re._sfc_main,{config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),r.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref:"details",key:`user_options_${$.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(j),isImaging:e.unref(q),uid:f.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:k.value,titles:{...r.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:ee,onGeneratePdf:e.unref(w),onGenerateImage:e.unref(B)},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:n})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value},"relation-circle"]),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,width:"100%",style:e.normalizeStyle(`user-select:none; background:${r.value.style.backgroundColor}`)},[e.createElementVNode("circle",{cx:(a.value.width<=0?1e-4:a.value.width)/2,cy:(a.value.height<=0?1e-4:a.value.height)/2+r.value.style.circle.offsetY,r:d.value<=0?1e-4:d.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,oe),U.value?(e.openBlock(),e.createElementBlock("g",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,n)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${n}`,style:e.normalizeStyle(S(l)),stroke:I(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":s.value.hasOwnProperty("id")&&u.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${a.value.width/2},${a.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":F(l),"stroke-linecap":"round"},null,14,ce))),128))])):(e.openBlock(),e.createElementBlock("g",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,n)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${n}`,stroke:I(l),style:e.normalizeStyle(S(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":s.value.hasOwnProperty("id")&&u.value.includes(l.id)}),"stroke-linecap":"round"},null,14,ve))),128))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,n)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${n}`,"text-anchor":J(l),transform:Z(l),x:K(l),y:l.y+5,onClick:y=>z(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":s.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${Q(l)}`),"font-size":r.value.style.labels.fontSize,fill:r.value.style.labels.color},e.toDisplayString(l.label),13,fe))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,n)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${n}`,style:e.normalizeStyle(H(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.color,onClick:y=>z(l),r:r.value.style.plot.radius},null,12,ge))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ne.default,{key:3,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,se))}},me=ie._export_sfc(ye,[["__scopeId","data-v-44982e30"]]);exports.default=me;