vue-data-ui 2.3.3 → 2.3.4

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 (148) hide show
  1. package/dist/Arrow-B6gJebT9.js +101 -0
  2. package/dist/Arrow-C5yj6zwY.cjs +1 -0
  3. package/dist/BaseIcon-7_g11dRj.js +174 -0
  4. package/dist/BaseIcon-JtWoVorZ.cjs +1 -0
  5. package/dist/DataTable-CwaOlAsy.js +127 -0
  6. package/dist/DataTable-Rm9II-m2.cjs +1 -0
  7. package/dist/Legend-CxvJTjEm.js +62 -0
  8. package/dist/Legend-D59FIuMs.cjs +1 -0
  9. package/dist/Shape-CVItL3vh.cjs +1 -0
  10. package/dist/Shape-CjLV0scA.js +107 -0
  11. package/dist/Slicer-Bxg5niHl.js +156 -0
  12. package/dist/Slicer-Cdss5Rus.cjs +1 -0
  13. package/dist/Title-2iks1ziC.js +46 -0
  14. package/dist/Title-Bb-A5OSV.cjs +1 -0
  15. package/dist/Tooltip-C3phqKuU.js +94 -0
  16. package/dist/Tooltip-C_UE6y-E.cjs +1 -0
  17. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  18. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  19. package/dist/html2canvas.esm-BA_v9SIU.cjs +22 -0
  20. package/dist/html2canvas.esm-d2sM-0Wm.js +4870 -0
  21. package/dist/index-p5gfZSvB.cjs +4 -0
  22. package/dist/index-uOtklCCx.js +10268 -0
  23. package/dist/{index.es-ypwniJN8.js → index.es-YufTdp0y.js} +1 -1
  24. package/dist/{index.es-Dnua3tHc.cjs → index.es-uyeSCnWE.cjs} +1 -1
  25. package/dist/jspdf.es.min-C660YX78.js +8038 -0
  26. package/dist/jspdf.es.min-DLYY9DTT.cjs +243 -0
  27. package/dist/pdf-97UbtKC2.js +44 -0
  28. package/dist/pdf-Cz3729tZ.cjs +1 -0
  29. package/dist/style.css +1 -1
  30. package/dist/useNestedProp-2kIU-7On.cjs +1 -0
  31. package/dist/useNestedProp-BgWkUab_.js +13 -0
  32. package/dist/usePrinter-B6xQCyL-.js +464 -0
  33. package/dist/usePrinter-fZlsJid8.cjs +1 -0
  34. package/dist/useResponsive-B3TrDDIG.cjs +1 -0
  35. package/dist/useResponsive-NZB-WLRF.js +187 -0
  36. package/dist/vue-data-ui-Be0rgmbA.cjs +9 -0
  37. package/dist/vue-data-ui-Ccy6rBZN.js +246 -0
  38. package/dist/vue-data-ui.cjs +1 -1
  39. package/dist/vue-data-ui.js +62 -61
  40. package/dist/vue-ui-3d-bar-BKMPFDi2.js +1085 -0
  41. package/dist/vue-ui-3d-bar-CKa4UXq4.cjs +19 -0
  42. package/dist/vue-ui-accordion-C_pwrAJl.cjs +1 -0
  43. package/dist/vue-ui-accordion-HJPf7My0.js +77 -0
  44. package/dist/vue-ui-age-pyramid-CE1xnA-8.cjs +1 -0
  45. package/dist/vue-ui-age-pyramid-DB_CL-gu.js +596 -0
  46. package/dist/vue-ui-annotator-BAMZcPlH.cjs +371 -0
  47. package/dist/vue-ui-annotator-DQsAL-nZ.js +2177 -0
  48. package/dist/vue-ui-candlestick-DCl8fpNu.js +657 -0
  49. package/dist/vue-ui-candlestick-Duv6oG79.cjs +2 -0
  50. package/dist/vue-ui-chestnut-BYHA6MT4.js +1051 -0
  51. package/dist/vue-ui-chestnut-mIZ4-ZEM.cjs +6 -0
  52. package/dist/vue-ui-cursor-C96IChA3.js +229 -0
  53. package/dist/vue-ui-cursor-De7dy4Mo.cjs +1 -0
  54. package/dist/vue-ui-dashboard-B2Yz41yO.js +232 -0
  55. package/dist/vue-ui-dashboard-BMGwKr0K.cjs +1 -0
  56. package/dist/vue-ui-digits-BnxLp7zQ.js +153 -0
  57. package/dist/vue-ui-digits-DSWyL-5K.cjs +1 -0
  58. package/dist/vue-ui-donut-1kei9ws5.cjs +1 -0
  59. package/dist/vue-ui-donut-B9iXisHK.js +743 -0
  60. package/dist/vue-ui-donut-evolution-B7Sun8sw.js +799 -0
  61. package/dist/vue-ui-donut-evolution-yv17DnGy.cjs +1 -0
  62. package/dist/vue-ui-dumbbell-BJEf_JEq.cjs +9 -0
  63. package/dist/vue-ui-dumbbell-DIsDnD1d.js +624 -0
  64. package/dist/vue-ui-flow-BTivYoGd.js +454 -0
  65. package/dist/vue-ui-flow-DOxJa8di.cjs +1 -0
  66. package/dist/vue-ui-galaxy-BEmywfFB.js +485 -0
  67. package/dist/vue-ui-galaxy-CHGOwCwM.cjs +1 -0
  68. package/dist/vue-ui-gauge-QAfMl-8t.cjs +1 -0
  69. package/dist/vue-ui-gauge-o4rDOqF3.js +466 -0
  70. package/dist/vue-ui-heatmap-BS4EzedX.cjs +1 -0
  71. package/dist/vue-ui-heatmap-DwqQqEsk.js +598 -0
  72. package/dist/vue-ui-kpi-F4qkJ_U-.cjs +1 -0
  73. package/dist/vue-ui-kpi-h8elYTcA.js +54 -0
  74. package/dist/vue-ui-mini-loader-C_8B2Pm6.cjs +1 -0
  75. package/dist/vue-ui-mini-loader-Cgoi9rhH.js +131 -0
  76. package/dist/vue-ui-molecule-Bmv76SWz.js +750 -0
  77. package/dist/vue-ui-molecule-C5CY_YYc.cjs +1 -0
  78. package/dist/vue-ui-mood-radar-BN0dzlfp.cjs +1 -0
  79. package/dist/vue-ui-mood-radar-DeMouUIe.js +548 -0
  80. package/dist/vue-ui-nested-donuts-ZyFoV-Zn.cjs +16 -0
  81. package/dist/vue-ui-nested-donuts-wOUkSVyZ.js +771 -0
  82. package/dist/vue-ui-onion-DCOKG2wG.js +554 -0
  83. package/dist/vue-ui-onion-VmTUo7TR.cjs +1 -0
  84. package/dist/vue-ui-parallel-coordinate-plot-BGtO2P4a.js +651 -0
  85. package/dist/vue-ui-parallel-coordinate-plot-BziXRF8E.cjs +8 -0
  86. package/dist/vue-ui-quadrant--JOTjPZh.js +1178 -0
  87. package/dist/vue-ui-quadrant-DawUUrur.cjs +1 -0
  88. package/dist/vue-ui-quick-chart-LXKfaJgS.js +1310 -0
  89. package/dist/vue-ui-quick-chart-jFlFtiNV.cjs +13 -0
  90. package/dist/vue-ui-radar-CWNIqvcA.js +614 -0
  91. package/dist/vue-ui-radar-VGH-lhaT.cjs +1 -0
  92. package/dist/vue-ui-rating-BNrIoJHN.js +271 -0
  93. package/dist/vue-ui-rating-Dtu6pwGx.cjs +1 -0
  94. package/dist/vue-ui-relation-circle-B3NKudOy.js +304 -0
  95. package/dist/vue-ui-relation-circle-Dwpx9o18.cjs +1 -0
  96. package/dist/vue-ui-rings-CsUngX_F.js +510 -0
  97. package/dist/vue-ui-rings-D9_OG--0.cjs +1 -0
  98. package/dist/vue-ui-scatter-DUsuh7bd.cjs +1 -0
  99. package/dist/vue-ui-scatter-DgxTz4Jx.js +874 -0
  100. package/dist/vue-ui-screenshot-51H_VrYY.js +160 -0
  101. package/dist/vue-ui-screenshot-C2Dz7CAe.cjs +3 -0
  102. package/dist/vue-ui-skeleton-BM9rwmxY.js +2064 -0
  103. package/dist/vue-ui-skeleton-sjfOtCZr.cjs +41 -0
  104. package/dist/vue-ui-smiley-DNnBtHht.cjs +2 -0
  105. package/dist/vue-ui-smiley-H5rSN-1B.js +763 -0
  106. package/dist/vue-ui-spark-trend-CLXZDYlk.js +246 -0
  107. package/dist/vue-ui-spark-trend-R4JJvfry.cjs +1 -0
  108. package/dist/vue-ui-sparkbar-C0k4ah-7.js +242 -0
  109. package/dist/vue-ui-sparkbar-CEUDIw0A.cjs +1 -0
  110. package/dist/vue-ui-sparkgauge-BHj00A07.js +157 -0
  111. package/dist/vue-ui-sparkgauge-CaEw6nmI.cjs +1 -0
  112. package/dist/vue-ui-sparkhistogram-B6GuavEu.cjs +1 -0
  113. package/dist/vue-ui-sparkhistogram-DbMLYKqE.js +244 -0
  114. package/dist/vue-ui-sparkline-CJydanLS.cjs +1 -0
  115. package/dist/vue-ui-sparkline-CYova9x3.js +333 -0
  116. package/dist/vue-ui-sparkstackbar-Df__yM5b.cjs +1 -0
  117. package/dist/vue-ui-sparkstackbar-N5rVBM2h.js +244 -0
  118. package/dist/vue-ui-strip-plot-DJJ1vEWz.js +618 -0
  119. package/dist/vue-ui-strip-plot-b5lhB35d.cjs +1 -0
  120. package/dist/vue-ui-table-NHhOVDbs.cjs +14 -0
  121. package/dist/vue-ui-table-heatmap-Cro2etCY.js +237 -0
  122. package/dist/vue-ui-table-heatmap-DlL2nCqz.cjs +1 -0
  123. package/dist/vue-ui-table-sparkline-Bw2Gc_ur.cjs +1 -0
  124. package/dist/vue-ui-table-sparkline-DppMitqF.js +420 -0
  125. package/dist/vue-ui-table-xSvwJIa7.js +1430 -0
  126. package/dist/vue-ui-thermometer-M2kdp1x5.js +385 -0
  127. package/dist/vue-ui-thermometer-Q_3PX2V3.cjs +1 -0
  128. package/dist/vue-ui-timer-BtSDeIRp.cjs +64 -0
  129. package/dist/vue-ui-timer-CAaQ-QD6.js +453 -0
  130. package/dist/vue-ui-tiremarks-CbGOSEvD.cjs +1 -0
  131. package/dist/vue-ui-tiremarks-JFv4JLP0.js +249 -0
  132. package/dist/vue-ui-treemap-BqDX-bPf.cjs +1 -0
  133. package/dist/vue-ui-treemap-DCnv-xYr.js +722 -0
  134. package/dist/vue-ui-vertical-bar-CEbApJZl.js +737 -0
  135. package/dist/vue-ui-vertical-bar-CJB_KXyr.cjs +4 -0
  136. package/dist/vue-ui-waffle-CTS6C7gu.js +638 -0
  137. package/dist/vue-ui-waffle-IMEbGe-b.cjs +1 -0
  138. package/dist/vue-ui-wheel-CuOmEWMQ.cjs +1 -0
  139. package/dist/vue-ui-wheel-_zyCdFiI.js +227 -0
  140. package/dist/vue-ui-word-cloud-RDlXBEAN.js +346 -0
  141. package/dist/vue-ui-word-cloud-Y7Yk7uUJ.cjs +1 -0
  142. package/dist/vue-ui-xy-BZJQBKnU.cjs +3 -0
  143. package/dist/vue-ui-xy-DsvN9EIQ.js +2064 -0
  144. package/dist/vue-ui-xy-canvas-D_dnbyFS.cjs +9 -0
  145. package/dist/vue-ui-xy-canvas-Dbcw8-9Q.js +1006 -0
  146. package/package.json +1 -1
  147. package/dist/index-BcMihqI4.cjs +0 -843
  148. package/dist/index-C7FeCQ7K.js +0 -57303
@@ -0,0 +1,554 @@
1
+ import { computed as d, ref as n, onMounted as _e, onBeforeUnmount as Oe, watch as Pe, openBlock as u, createElementBlock as i, normalizeClass as A, normalizeStyle as D, createVNode as E, createCommentVNode as b, createBlock as L, unref as x, createSlots as Fe, withCtx as v, renderSlot as g, normalizeProps as H, guardReactiveProps as W, Fragment as F, renderList as I, createElementVNode as C, toDisplayString as T, createTextVNode as Ie, nextTick as Se } from "vue";
2
+ import { u as Me, c as Ne, t as Re, a as Ae, p as re, b as De, o as Le, e as j, d as ze, X as Be, v as ue, n as Ve, q as Xe, w as Ge, f as ne } from "./index-uOtklCCx.js";
3
+ import { t as Ue, u as Ye } from "./useResponsive-NZB-WLRF.js";
4
+ import { _ as Ee } from "./Title-2iks1ziC.js";
5
+ import { u as He, U as We } from "./usePrinter-B6xQCyL-.js";
6
+ import { L as je } from "./Legend-CxvJTjEm.js";
7
+ import { D as qe } from "./DataTable-CwaOlAsy.js";
8
+ import { _ as Je } from "./Tooltip-C3phqKuU.js";
9
+ import Ke from "./vue-ui-skeleton-BM9rwmxY.js";
10
+ import Qe from "./vue-ui-accordion-HJPf7My0.js";
11
+ import { u as se } from "./useNestedProp-BgWkUab_.js";
12
+ import { _ as Ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
+ const et = ["id"], tt = ["xmlns", "viewBox"], at = ["cx", "cy", "r", "stroke", "stroke-width", "stroke-dasharray", "stroke-dashoffset"], lt = ["cx", "cy", "r", "stroke", "stroke-width", "stroke-dasharray", "stroke-dashoffset"], ot = ["id"], rt = ["stdDeviation"], ut = ["filter"], nt = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke-dashoffset"], st = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke-dashoffset", "onMouseenter"], it = { key: 1 }, ct = ["onMouseenter"], dt = ["x", "y", "font-size", "fill", "font-weight"], vt = ["onClick"], ht = ["innerHTML"], gt = {
14
+ __name: "vue-ui-onion",
15
+ props: {
16
+ config: {
17
+ type: Object,
18
+ default() {
19
+ return {};
20
+ }
21
+ },
22
+ dataset: {
23
+ type: Array,
24
+ default() {
25
+ return [];
26
+ }
27
+ }
28
+ },
29
+ emits: ["selectLegend"],
30
+ setup(ie, { expose: ce, emit: de }) {
31
+ const k = ie, { vue_ui_onion: ve } = Me(), S = d(() => !!k.dataset && k.dataset.length), w = n(Ne()), he = n(null), q = n(0), M = n(!1), z = n(""), h = n([]), _ = n(null), J = n(null), K = n(null), e = d(() => {
32
+ const a = se({
33
+ userConfig: k.config,
34
+ defaultConfig: ve
35
+ });
36
+ return a.theme ? {
37
+ ...se({
38
+ userConfig: Re.vue_ui_onion[a.theme] || k.config,
39
+ defaultConfig: a
40
+ }),
41
+ customPalette: Ae[a.theme] || re
42
+ } : a;
43
+ }), { isPrinting: ge, isImaging: fe, generatePdf: Q, generateImage: Z } = He({
44
+ elementId: `vue-ui-onion_${w.value}`,
45
+ fileName: e.value.style.chart.title.text || "vue-ui-onion"
46
+ }), pe = d(() => De(e.value.customPalette)), m = n({
47
+ showTable: e.value.table.show,
48
+ showTooltip: e.value.style.chart.tooltip.show
49
+ }), r = n({
50
+ height: 512,
51
+ width: 512,
52
+ padding: {
53
+ top: 64,
54
+ left: 64,
55
+ right: 64,
56
+ bottom: 64
57
+ },
58
+ minRadius: 64
59
+ }), N = n(null);
60
+ _e(() => {
61
+ if (Le(k.dataset) && j({
62
+ componentName: "VueUiOnion",
63
+ type: "dataset"
64
+ }), e.value.responsive) {
65
+ const o = Ue(() => {
66
+ const { width: t, height: l } = Ye({
67
+ chart: _.value,
68
+ title: e.value.style.chart.title.text ? J.value : null,
69
+ legend: e.value.style.chart.legend.show ? K.value : null
70
+ });
71
+ r.value.width = t, r.value.height = l, r.value.padding.top = Math.max(t, l) * 0.125, r.value.padding.right = Math.max(t, l) * 0.125, r.value.padding.bottom = Math.max(t, l) * 0.125, r.value.padding.left = Math.max(t, l) * 0.125, r.value.minRadius = Math.min(t, l) * 0.125;
72
+ });
73
+ N.value = new ResizeObserver(o), N.value.observe(_.value.parentNode);
74
+ }
75
+ }), Oe(() => {
76
+ N.value && N.value.disconnect();
77
+ });
78
+ const s = d(() => ({
79
+ top: r.value.padding.top,
80
+ left: r.value.padding.left,
81
+ right: r.value.width - r.value.padding.right,
82
+ bottom: r.value.height - r.value.padding.bottom,
83
+ centerX: r.value.width / 2,
84
+ centerY: r.value.height / 2,
85
+ width: r.value.width - r.value.padding.right - r.value.padding.left,
86
+ height: r.value.height - r.value.padding.bottom - r.value.padding.top,
87
+ minRadius: r.value.minRadius,
88
+ maxRadius: Math.min(r.value.width, r.value.height) - r.value.padding.top * 2
89
+ })), c = d(() => (k.dataset.forEach((a, o) => {
90
+ [null, void 0].includes(a.name) && j({
91
+ componentName: "VueUiOnion",
92
+ type: "datasetSerieAttribute",
93
+ property: "name",
94
+ index: o
95
+ }), [void 0].includes(a.percentage) && j({
96
+ componentName: "VueUiOnion",
97
+ type: "datasetSerieAttribute",
98
+ property: "percentage",
99
+ index: o
100
+ });
101
+ }), k.dataset.map((a, o) => {
102
+ const t = `onion_serie_${o}_${w.value}`;
103
+ return {
104
+ ...a,
105
+ percentage: a.percentage || 0,
106
+ targetPercentage: a.percentage || 0,
107
+ color: ze(a.color) || pe.value[o] || re[o],
108
+ id: t,
109
+ shape: "circle",
110
+ opacity: h.value.includes(t) ? 0.5 : 1,
111
+ absoluteIndex: o,
112
+ segregate: () => ee(t),
113
+ isSegregated: h.value.includes(t)
114
+ };
115
+ }))), O = n(c.value), ye = d(() => e.value.useStartAnimation), me = n(null), be = d(() => Math.max(...c.value.map((a) => a.percentage))), B = n(!1);
116
+ Pe(() => c.value, ke, { immediate: !0 });
117
+ function ke() {
118
+ if (ye.value && !B.value) {
119
+ let o = function() {
120
+ a >= be.value ? (cancelAnimationFrame(me.value), O.value = c.value, B.value = !0) : (O.value = c.value.map((t) => ({
121
+ ...t,
122
+ percentage: a < t.targetPercentage ? a : t.targetPercentage
123
+ })), a += 1, requestAnimationFrame(o), B.value = !0);
124
+ };
125
+ O.value = c.value.map((t) => ({
126
+ ...t,
127
+ percentage: 0
128
+ }));
129
+ let a = 0;
130
+ o();
131
+ } else
132
+ O.value = c.value;
133
+ }
134
+ const $e = d(() => ({
135
+ cy: "onion-div-legend",
136
+ backgroundColor: e.value.style.chart.legend.backgroundColor,
137
+ color: e.value.style.chart.legend.color,
138
+ fontSize: e.value.style.chart.legend.fontSize,
139
+ paddingBottom: 12,
140
+ fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
141
+ })), we = d(() => c.value.filter((a) => !h.value.includes(a.id)).length), $ = d(() => {
142
+ const a = Math.min(s.value.width, s.value.height) / 2 / c.value.length;
143
+ return {
144
+ gutter: (a > e.value.style.chart.layout.maxThickness ? e.value.style.chart.layout.maxThickness : a) * e.value.style.chart.layout.gutter.width,
145
+ track: (a > e.value.style.chart.layout.maxThickness ? e.value.style.chart.layout.maxThickness : a) * e.value.style.chart.layout.track.width
146
+ };
147
+ }), f = d(() => O.value.filter((a) => !h.value.includes(a.id)).map((a, o) => {
148
+ const t = (s.value.maxRadius - $.value.track) / we.value / 2 * (1 + o), l = s.value.centerY - t;
149
+ return {
150
+ percentage: a.percentage || 0,
151
+ ...a,
152
+ labelY: l,
153
+ radius: t,
154
+ path: xe(t, a.percentage || 0)
155
+ };
156
+ }));
157
+ function xe(a, o) {
158
+ const t = a * (1.5 + (o / 100 > 0.3333333333333333 ? 0 : 1 - o / 100)) * Math.PI, l = a * 1.5 * Math.PI;
159
+ return {
160
+ bgDashArray: `${l} ${l}`,
161
+ bgDashOffset: l - o / 100 * l,
162
+ dashArray: `${t} ${t}`,
163
+ dashOffset: t - o / 100 * t,
164
+ fullOffset: 0,
165
+ active: `M${s.value.centerX},${s.value.centerY} A ${a},${a} 0 0 0 ${s.value.right},${s.value.top}`
166
+ };
167
+ }
168
+ function ee(a) {
169
+ h.value.includes(a) ? h.value = h.value.filter((o) => o !== a) : h.value.push(a), de("selectLegend", f.value);
170
+ }
171
+ function Ce() {
172
+ return f.value;
173
+ }
174
+ const V = d(() => {
175
+ const a = [e.value.table.translations.serie, e.value.table.translations.percentage, e.value.table.translations.value], o = f.value.map((t) => [
176
+ t.name,
177
+ t.percentage,
178
+ t.value
179
+ ]);
180
+ return { head: a, body: o };
181
+ }), R = d(() => {
182
+ const a = V.value.head, o = f.value.map((l) => [
183
+ `<span style="color:${l.color}">⬤</span> ${l.name}`,
184
+ `${Number(l.percentage ?? 0).toFixed(e.value.table.td.roundingPercentage).toLocaleString()}%`,
185
+ `${l.prefix || ""}${[null, void 0, NaN, "NaN"].includes(l.value) ? "-" : l.value.toFixed(e.value.table.td.roundingValue).toLocaleString()}${l.suffix || ""}`
186
+ ]), t = {
187
+ th: {
188
+ backgroundColor: e.value.table.th.backgroundColor,
189
+ color: e.value.table.th.color,
190
+ outline: e.value.table.th.outline
191
+ },
192
+ td: {
193
+ backgroundColor: e.value.table.td.backgroundColor,
194
+ color: e.value.table.td.color,
195
+ outline: e.value.table.td.outline
196
+ },
197
+ breakpoint: e.value.table.responsiveBreakpoint
198
+ };
199
+ return { head: a, body: o, config: t, colNames: a };
200
+ });
201
+ function te() {
202
+ Se(() => {
203
+ const a = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], o = V.value.head, t = V.value.body, l = a.concat([o]).concat(t), y = Ve(l);
204
+ Xe({ csvContent: y, title: e.value.style.chart.title.text || "vue-ui-onion" });
205
+ });
206
+ }
207
+ const p = n(void 0), P = n(!1);
208
+ function Te(a) {
209
+ P.value = a, q.value += 1;
210
+ }
211
+ const X = n(null);
212
+ function ae({ datapoint: a, seriesIndex: o, show: t = !0 }) {
213
+ const l = a.absoluteIndex;
214
+ p.value = o, X.value = {
215
+ datapoint: a,
216
+ seriesIndex: l,
217
+ series: c.value,
218
+ config: e.value
219
+ }, M.value = t;
220
+ let y = "";
221
+ const G = e.value.style.chart.tooltip.customFormat;
222
+ if (ue(G) && Ge(() => G({
223
+ seriesIndex: l,
224
+ datapoint: a,
225
+ series: c.value,
226
+ config: e.value
227
+ })))
228
+ z.value = G({
229
+ seriesIndex: l,
230
+ datapoint: a,
231
+ series: c.value,
232
+ config: e.value
233
+ });
234
+ else {
235
+ const U = e.value.style.chart.tooltip.showPercentage, Y = e.value.style.chart.tooltip.showValue;
236
+ y += `<div style="width: 100%; border-bottom: 1px solid ${e.value.style.chart.tooltip.borderColor}; padding-bottom: 6px;margin-bottom:3px;display:flex;flex-direction:row;gap:3px;align-items:center"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg><span></span>${a.name}</span></div>`, y += `<div style="width:100%;text-align:left;"><b>${U ? ne({ p: "", v: a.percentage, s: "%", r: e.value.style.chart.tooltip.roundingPercentage }) : ""}</b> ${U && Y ? "(" : ""}${Y ? ne({ p: a.prefix || "", v: a.value, s: a.suffix || "", r: e.value.style.chart.tooltip.roundingValue }) : ""}${U && Y ? ")" : ""}</div>`, z.value = `<div>${y}</div>`;
237
+ }
238
+ }
239
+ function le() {
240
+ m.value.showTable = !m.value.showTable;
241
+ }
242
+ function oe() {
243
+ m.value.showTooltip = !m.value.showTooltip;
244
+ }
245
+ return ce({
246
+ getData: Ce,
247
+ generatePdf: Q,
248
+ generateCsv: te,
249
+ generateImage: Z,
250
+ toggleTable: le,
251
+ toggleTooltip: oe
252
+ }), (a, o) => (u(), i("div", {
253
+ class: A(`vue-ui-onion ${P.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
254
+ ref_key: "onionChart",
255
+ ref: _,
256
+ id: `vue-ui-onion_${w.value}`,
257
+ style: D(`font-family:${e.value.style.fontFamily};width:100%; ${e.value.responsive ? "height: 100%;" : ""} text-align:center;background:${e.value.style.chart.backgroundColor}`)
258
+ }, [
259
+ e.value.style.chart.title.text ? (u(), i("div", {
260
+ key: 0,
261
+ ref_key: "chartTitle",
262
+ ref: J,
263
+ style: D(`width:100%;background:${e.value.style.chart.backgroundColor}`)
264
+ }, [
265
+ E(Ee, {
266
+ config: {
267
+ title: {
268
+ cy: "onion-div-title",
269
+ ...e.value.style.chart.title
270
+ },
271
+ subtitle: {
272
+ cy: "onion-div-subtitle",
273
+ ...e.value.style.chart.title.subtitle
274
+ }
275
+ }
276
+ }, null, 8, ["config"])
277
+ ], 4)) : b("", !0),
278
+ e.value.userOptions.show && S.value ? (u(), L(We, {
279
+ ref_key: "details",
280
+ ref: he,
281
+ key: `user_options${q.value}`,
282
+ backgroundColor: e.value.style.chart.backgroundColor,
283
+ color: e.value.style.chart.color,
284
+ isImaging: x(fe),
285
+ isPrinting: x(ge),
286
+ uid: w.value,
287
+ hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
288
+ hasPdf: e.value.userOptions.buttons.pdf,
289
+ hasImg: e.value.userOptions.buttons.img,
290
+ hasXls: e.value.userOptions.buttons.csv,
291
+ hasTable: e.value.userOptions.buttons.table,
292
+ hasFullscreen: e.value.userOptions.buttons.fullscreen,
293
+ isFullscreen: P.value,
294
+ isTooltip: m.value.showTooltip,
295
+ titles: { ...e.value.userOptions.buttonTitles },
296
+ chartElement: _.value,
297
+ onToggleFullscreen: Te,
298
+ onGeneratePdf: x(Q),
299
+ onGenerateCsv: te,
300
+ onGenerateImage: x(Z),
301
+ onToggleTable: le,
302
+ onToggleTooltip: oe
303
+ }, Fe({ _: 2 }, [
304
+ a.$slots.optionTooltip ? {
305
+ name: "optionTooltip",
306
+ fn: v(() => [
307
+ g(a.$slots, "optionTooltip", {}, void 0, !0)
308
+ ]),
309
+ key: "0"
310
+ } : void 0,
311
+ a.$slots.optionPdf ? {
312
+ name: "optionPdf",
313
+ fn: v(() => [
314
+ g(a.$slots, "optionPdf", {}, void 0, !0)
315
+ ]),
316
+ key: "1"
317
+ } : void 0,
318
+ a.$slots.optionCsv ? {
319
+ name: "optionCsv",
320
+ fn: v(() => [
321
+ g(a.$slots, "optionCsv", {}, void 0, !0)
322
+ ]),
323
+ key: "2"
324
+ } : void 0,
325
+ a.$slots.optionImg ? {
326
+ name: "optionImg",
327
+ fn: v(() => [
328
+ g(a.$slots, "optionImg", {}, void 0, !0)
329
+ ]),
330
+ key: "3"
331
+ } : void 0,
332
+ a.$slots.optionTable ? {
333
+ name: "optionTable",
334
+ fn: v(() => [
335
+ g(a.$slots, "optionTable", {}, void 0, !0)
336
+ ]),
337
+ key: "4"
338
+ } : void 0,
339
+ a.$slots.optionFullscreen ? {
340
+ name: "optionFullscreen",
341
+ fn: v(({ toggleFullscreen: t, isFullscreen: l }) => [
342
+ g(a.$slots, "optionFullscreen", H(W({ toggleFullscreen: t, isFullscreen: l })), void 0, !0)
343
+ ]),
344
+ key: "5"
345
+ } : void 0
346
+ ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : b("", !0),
347
+ S.value ? (u(), i("svg", {
348
+ key: 2,
349
+ xmlns: x(Be),
350
+ class: A({ "vue-data-ui-fullscreen--on": P.value, "vue-data-ui-fulscreen--off": !P.value }),
351
+ viewBox: `0 0 ${r.value.width <= 0 ? 1e-4 : r.value.width} ${r.value.height <= 0 ? 1e-4 : r.value.height}`,
352
+ style: D(`max-width:100%;overflow:visible;background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color}`)
353
+ }, [
354
+ (u(!0), i(F, null, I(f.value, (t, l) => (u(), i("circle", {
355
+ cx: s.value.centerX,
356
+ cy: s.value.centerY,
357
+ r: t.radius <= 0 ? 1e-4 : t.radius,
358
+ stroke: e.value.style.chart.layout.gutter.color,
359
+ "stroke-width": $.value.gutter,
360
+ fill: "none",
361
+ "stroke-dasharray": t.path.bgDashArray,
362
+ "stroke-dashoffset": t.path.fullOffset,
363
+ "stroke-linecap": "round",
364
+ class: A({ "vue-ui-onion-path": !0, "vue-ui-onion-blur": e.value.useBlurOnHover && ![null, void 0].includes(p.value) && p.value !== l }),
365
+ style: { transform: "rotate(-90deg)", "transform-origin": "50% 50%" }
366
+ }, null, 10, at))), 256)),
367
+ (u(!0), i(F, null, I(f.value, (t, l) => (u(), i("circle", {
368
+ cx: s.value.centerX,
369
+ cy: s.value.centerY,
370
+ r: t.radius < 0 ? 1e-4 : t.radius,
371
+ stroke: `${t.color}`,
372
+ "stroke-width": $.value.track,
373
+ fill: "none",
374
+ "stroke-dasharray": t.path.dashArray,
375
+ "stroke-dashoffset": t.path.dashOffset,
376
+ class: A({ "vue-ui-onion-path": !0, "vue-ui-onion-blur": e.value.useBlurOnHover && ![null, void 0].includes(p.value) && p.value !== l }),
377
+ "stroke-linecap": "round",
378
+ style: { transform: "rotate(-90deg)", "transform-origin": "50% 50%" }
379
+ }, null, 10, lt))), 256)),
380
+ C("defs", null, [
381
+ C("filter", {
382
+ id: `blur_${w.value}`,
383
+ x: "-50%",
384
+ y: "-50%",
385
+ width: "200%",
386
+ height: "200%"
387
+ }, [
388
+ C("feGaussianBlur", {
389
+ in: "SourceGraphic",
390
+ stdDeviation: 100 / e.value.style.chart.gradientIntensity
391
+ }, null, 8, rt)
392
+ ], 8, ot)
393
+ ]),
394
+ e.value.style.chart.useGradient ? (u(), i("g", {
395
+ key: 0,
396
+ filter: `url(#blur_${w.value})`
397
+ }, [
398
+ (u(!0), i(F, null, I(f.value, (t, l) => (u(), i("circle", {
399
+ cx: s.value.centerX,
400
+ cy: s.value.centerY,
401
+ r: t.radius <= 0 ? 1e-4 : t.radius,
402
+ stroke: "white",
403
+ "stroke-width": $.value.track / 3,
404
+ fill: "none",
405
+ "stroke-linecap": "round",
406
+ "stroke-dasharray": t.path.dashArray,
407
+ "stroke-dashoffset": t.path.dashOffset,
408
+ style: { transform: "rotate(-90deg)", "transform-origin": "50% 50%" }
409
+ }, null, 8, nt))), 256))
410
+ ], 8, ut)) : b("", !0),
411
+ (u(!0), i(F, null, I(f.value, (t, l) => (u(), i("circle", {
412
+ "data-cy-trap": "",
413
+ cx: s.value.centerX,
414
+ cy: s.value.centerY,
415
+ r: t.radius <= 0 ? 1e-4 : t.radius,
416
+ stroke: "transparent",
417
+ "stroke-width": Math.max($.value.track, $.value.gutter),
418
+ fill: "none",
419
+ "stroke-dasharray": t.path.bgDashArray,
420
+ "stroke-dashoffset": t.path.fullOffset,
421
+ "stroke-linecap": "round",
422
+ class: "vue-ui-onion-path",
423
+ style: { transform: "rotate(-90deg)", "transform-origin": "50% 50%" },
424
+ onMouseenter: (y) => ae({
425
+ datapoint: t,
426
+ show: !0,
427
+ seriesIndex: l
428
+ }),
429
+ onMouseleave: o[0] || (o[0] = (y) => {
430
+ p.value = void 0, M.value = !1;
431
+ })
432
+ }, null, 40, st))), 256)),
433
+ e.value.style.chart.layout.labels.show ? (u(), i("g", it, [
434
+ (u(!0), i(F, null, I(f.value, (t, l) => (u(), i("g", {
435
+ onMouseenter: (y) => ae({
436
+ datapoint: t,
437
+ show: !0,
438
+ seriesIndex: l
439
+ }),
440
+ onMouseleave: o[1] || (o[1] = (y) => {
441
+ p.value = void 0, M.value = !1;
442
+ })
443
+ }, [
444
+ h.value.includes(t.id) ? b("", !0) : (u(), i("text", {
445
+ key: 0,
446
+ x: r.value.width / 2 - $.value.gutter * 0.8 + e.value.style.chart.layout.labels.offsetX,
447
+ y: t.labelY + e.value.style.chart.layout.labels.offsetY,
448
+ "text-anchor": "end",
449
+ "font-size": e.value.style.chart.layout.labels.fontSize,
450
+ fill: e.value.useBlurOnHover && ![null, void 0].includes(p.value) && p.value === l ? t.color : e.value.style.chart.layout.labels.color,
451
+ "font-weight": e.value.style.chart.layout.labels.bold ? "bold" : "normal"
452
+ }, T(t.name ? t.name + ": " : "") + " " + T(e.value.style.chart.layout.labels.percentage.show ? `${(t.percentage || 0).toFixed(e.value.style.chart.layout.labels.roundingPercentage)}%` : "") + " " + T(!e.value.style.chart.layout.labels.percentage.show && e.value.style.chart.layout.labels.value.show ? ` : ${t.value ? `${t.prefix || ""}${t.value.toFixed(e.value.style.chart.layout.labels.roundingValue)}${t.suffix || ""}` : ""}` : `${e.value.style.chart.layout.labels.value.show && t.value ? `(${t.prefix || ""}${t.value.toFixed(e.value.style.chart.layout.labels.roundingValue)}${t.suffix || ""})` : ""}`), 9, dt))
453
+ ], 40, ct))), 256))
454
+ ])) : b("", !0),
455
+ g(a.$slots, "svg", { svg: r.value }, void 0, !0)
456
+ ], 14, tt)) : b("", !0),
457
+ S.value ? b("", !0) : (u(), L(Ke, {
458
+ key: 3,
459
+ config: {
460
+ type: "onion",
461
+ style: {
462
+ backgroundColor: e.value.style.chart.backgroundColor,
463
+ onion: {
464
+ color: e.value.style.chart.layout.gutter.color
465
+ }
466
+ }
467
+ }
468
+ }, null, 8, ["config"])),
469
+ C("div", {
470
+ ref_key: "chartLegend",
471
+ ref: K
472
+ }, [
473
+ e.value.style.chart.legend.show ? (u(), L(je, {
474
+ key: 0,
475
+ legendSet: c.value,
476
+ config: $e.value,
477
+ onClickMarker: o[2] || (o[2] = ({ legend: t }) => ee(t.id))
478
+ }, {
479
+ item: v(({ legend: t }) => [
480
+ C("div", {
481
+ "data-cy-legend-item": "",
482
+ onClick: (l) => t.segregate(),
483
+ style: D(`opacity:${h.value.includes(t.id) ? 0.5 : 1}`)
484
+ }, T(t.name ? t.name + ": " : "") + " " + T((t.percentage || 0).toFixed(e.value.style.chart.legend.roundingPercentage)) + "% ", 13, vt)
485
+ ]),
486
+ _: 1
487
+ }, 8, ["legendSet", "config"])) : g(a.$slots, "legend", {
488
+ key: 1,
489
+ legend: c.value
490
+ }, void 0, !0)
491
+ ], 512),
492
+ E(Je, {
493
+ show: m.value.showTooltip && M.value,
494
+ backgroundColor: e.value.style.chart.tooltip.backgroundColor,
495
+ color: e.value.style.chart.tooltip.color,
496
+ borderRadius: e.value.style.chart.tooltip.borderRadius,
497
+ borderColor: e.value.style.chart.tooltip.borderColor,
498
+ borderWidth: e.value.style.chart.tooltip.borderWidth,
499
+ fontSize: e.value.style.chart.tooltip.fontSize,
500
+ backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
501
+ parent: _.value,
502
+ content: z.value,
503
+ isCustom: x(ue)(e.value.style.chart.tooltip.customFormat)
504
+ }, {
505
+ "tooltip-before": v(() => [
506
+ g(a.$slots, "tooltip-before", H(W({ ...X.value })), void 0, !0)
507
+ ]),
508
+ "tooltip-after": v(() => [
509
+ g(a.$slots, "tooltip-after", H(W({ ...X.value })), void 0, !0)
510
+ ]),
511
+ _: 3
512
+ }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "parent", "content", "isCustom"]),
513
+ S.value ? (u(), L(Qe, {
514
+ key: 4,
515
+ hideDetails: "",
516
+ config: {
517
+ open: m.value.showTable,
518
+ maxHeight: 1e4,
519
+ head: {
520
+ backgroundColor: e.value.style.chart.backgroundColor,
521
+ color: e.value.style.chart.color
522
+ },
523
+ body: {
524
+ backgroundColor: e.value.style.chart.backgroundColor,
525
+ color: e.value.style.chart.color
526
+ }
527
+ }
528
+ }, {
529
+ content: v(() => [
530
+ E(qe, {
531
+ colNames: R.value.colNames,
532
+ head: R.value.head,
533
+ body: R.value.body,
534
+ config: R.value.config,
535
+ title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
536
+ onClose: o[3] || (o[3] = (t) => m.value.showTable = !1)
537
+ }, {
538
+ th: v(({ th: t }) => [
539
+ Ie(T(t), 1)
540
+ ]),
541
+ td: v(({ td: t }) => [
542
+ C("div", { innerHTML: t }, null, 8, ht)
543
+ ]),
544
+ _: 1
545
+ }, 8, ["colNames", "head", "body", "config", "title"])
546
+ ]),
547
+ _: 1
548
+ }, 8, ["config"])) : b("", !0)
549
+ ], 14, et));
550
+ }
551
+ }, Ot = /* @__PURE__ */ Ze(gt, [["__scopeId", "data-v-2ee9d4d0"]]);
552
+ export {
553
+ Ot as default
554
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-p5gfZSvB.cjs"),q=require("./useResponsive-B3TrDDIG.cjs"),se=require("./Title-Bb-A5OSV.cjs"),U=require("./usePrinter-fZlsJid8.cjs"),ie=require("./Legend-D59FIuMs.cjs"),ce=require("./DataTable-Rm9II-m2.cjs"),de=require("./Tooltip-C_UE6y-E.cjs"),ve=require("./vue-ui-skeleton-sjfOtCZr.cjs"),he=require("./vue-ui-accordion-C_pwrAJl.cjs"),X=require("./useNestedProp-2kIU-7On.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),pe=["id"],fe=["xmlns","viewBox"],me=["cx","cy","r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset"],ye=["cx","cy","r","stroke","stroke-width","stroke-dasharray","stroke-dashoffset"],be=["id"],ke=["stdDeviation"],we=["filter"],Ce=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset"],xe=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset","onMouseenter"],$e={key:1},Te=["onMouseenter"],Be=["x","y","font-size","fill","font-weight"],Se=["onClick"],_e=["innerHTML"],Pe={__name:"vue-ui-onion",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(G,{expose:Y,emit:H}){const p=G,{vue_ui_onion:W}=u.useConfig(),w=e.computed(()=>!!p.dataset&&p.dataset.length),m=e.ref(u.createUid()),j=e.ref(null),O=e.ref(0),C=e.ref(!1),T=e.ref(""),c=e.ref([]),y=e.ref(null),I=e.ref(null),V=e.ref(null),t=e.computed(()=>{const a=X.useNestedProp({userConfig:p.config,defaultConfig:W});return a.theme?{...X.useNestedProp({userConfig:u.themes.vue_ui_onion[a.theme]||p.config,defaultConfig:a}),customPalette:u.themePalettes[a.theme]||u.palette}:a}),{isPrinting:J,isImaging:K,generatePdf:E,generateImage:M}=U.usePrinter({elementId:`vue-ui-onion_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-onion"}),Q=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),n=e.ref({height:512,width:512,padding:{top:64,left:64,right:64,bottom:64},minRadius:64}),x=e.ref(null);e.onMounted(()=>{if(u.objectIsEmpty(p.dataset)&&u.error({componentName:"VueUiOnion",type:"dataset"}),t.value.responsive){const r=q.throttle(()=>{const{width:l,height:o}=q.useResponsive({chart:y.value,title:t.value.style.chart.title.text?I.value:null,legend:t.value.style.chart.legend.show?V.value:null});n.value.width=l,n.value.height=o,n.value.padding.top=Math.max(l,o)*.125,n.value.padding.right=Math.max(l,o)*.125,n.value.padding.bottom=Math.max(l,o)*.125,n.value.padding.left=Math.max(l,o)*.125,n.value.minRadius=Math.min(l,o)*.125});x.value=new ResizeObserver(r),x.value.observe(y.value.parentNode)}}),e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});const s=e.computed(()=>({top:n.value.padding.top,left:n.value.padding.left,right:n.value.width-n.value.padding.right,bottom:n.value.height-n.value.padding.bottom,centerX:n.value.width/2,centerY:n.value.height/2,width:n.value.width-n.value.padding.right-n.value.padding.left,height:n.value.height-n.value.padding.bottom-n.value.padding.top,minRadius:n.value.minRadius,maxRadius:Math.min(n.value.width,n.value.height)-n.value.padding.top*2})),i=e.computed(()=>(p.dataset.forEach((a,r)=>{[null,void 0].includes(a.name)&&u.error({componentName:"VueUiOnion",type:"datasetSerieAttribute",property:"name",index:r}),[void 0].includes(a.percentage)&&u.error({componentName:"VueUiOnion",type:"datasetSerieAttribute",property:"percentage",index:r})}),p.dataset.map((a,r)=>{const l=`onion_serie_${r}_${m.value}`;return{...a,percentage:a.percentage||0,targetPercentage:a.percentage||0,color:u.convertColorToHex(a.color)||Q.value[r]||u.palette[r],id:l,shape:"circle",opacity:c.value.includes(l)?.5:1,absoluteIndex:r,segregate:()=>R(l),isSegregated:c.value.includes(l)}}))),b=e.ref(i.value),Z=e.computed(()=>t.value.useStartAnimation),ee=e.ref(null),te=e.computed(()=>Math.max(...i.value.map(a=>a.percentage))),B=e.ref(!1);e.watch(()=>i.value,le,{immediate:!0});function le(){if(Z.value&&!B.value){let r=function(){a>=te.value?(cancelAnimationFrame(ee.value),b.value=i.value,B.value=!0):(b.value=i.value.map(l=>({...l,percentage:a<l.targetPercentage?a:l.targetPercentage})),a+=1,requestAnimationFrame(r),B.value=!0)};b.value=i.value.map(l=>({...l,percentage:0}));let a=0;r()}else b.value=i.value}const ae=e.computed(()=>({cy:"onion-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),oe=e.computed(()=>i.value.filter(a=>!c.value.includes(a.id)).length),f=e.computed(()=>{const a=Math.min(s.value.width,s.value.height)/2/i.value.length;return{gutter:(a>t.value.style.chart.layout.maxThickness?t.value.style.chart.layout.maxThickness:a)*t.value.style.chart.layout.gutter.width,track:(a>t.value.style.chart.layout.maxThickness?t.value.style.chart.layout.maxThickness:a)*t.value.style.chart.layout.track.width}}),d=e.computed(()=>b.value.filter(a=>!c.value.includes(a.id)).map((a,r)=>{const l=(s.value.maxRadius-f.value.track)/oe.value/2*(1+r),o=s.value.centerY-l;return{percentage:a.percentage||0,...a,labelY:o,radius:l,path:re(l,a.percentage||0)}}));function re(a,r){const l=a*(1.5+(r/100>.3333333333333333?0:1-r/100))*Math.PI,o=a*1.5*Math.PI;return{bgDashArray:`${o} ${o}`,bgDashOffset:o-r/100*o,dashArray:`${l} ${l}`,dashOffset:l-r/100*l,fullOffset:0,active:`M${s.value.centerX},${s.value.centerY} A ${a},${a} 0 0 0 ${s.value.right},${s.value.top}`}}function R(a){c.value.includes(a)?c.value=c.value.filter(r=>r!==a):c.value.push(a),H("selectLegend",d.value)}function ne(){return d.value}const S=e.computed(()=>{const a=[t.value.table.translations.serie,t.value.table.translations.percentage,t.value.table.translations.value],r=d.value.map(l=>[l.name,l.percentage,l.value]);return{head:a,body:r}}),$=e.computed(()=>{const a=S.value.head,r=d.value.map(o=>[`<span style="color:${o.color}">⬤</span> ${o.name}`,`${Number(o.percentage??0).toFixed(t.value.table.td.roundingPercentage).toLocaleString()}%`,`${o.prefix||""}${[null,void 0,NaN,"NaN"].includes(o.value)?"-":o.value.toFixed(t.value.table.td.roundingValue).toLocaleString()}${o.suffix||""}`]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:a,body:r,config:l,colNames:a}});function z(){e.nextTick(()=>{const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],r=S.value.head,l=S.value.body,o=a.concat([r]).concat(l),h=u.createCsvContent(o);u.downloadCsv({csvContent:h,title:t.value.style.chart.title.text||"vue-ui-onion"})})}const v=e.ref(void 0),k=e.ref(!1);function ue(a){k.value=a,O.value+=1}const _=e.ref(null);function D({datapoint:a,seriesIndex:r,show:l=!0}){const o=a.absoluteIndex;v.value=r,_.value={datapoint:a,seriesIndex:o,series:i.value,config:t.value},C.value=l;let h="";const P=t.value.style.chart.tooltip.customFormat;if(u.isFunction(P)&&u.functionReturnsString(()=>P({seriesIndex:o,datapoint:a,series:i.value,config:t.value})))T.value=P({seriesIndex:o,datapoint:a,series:i.value,config:t.value});else{const N=t.value.style.chart.tooltip.showPercentage,F=t.value.style.chart.tooltip.showValue;h+=`<div style="width: 100%; border-bottom: 1px solid ${t.value.style.chart.tooltip.borderColor}; padding-bottom: 6px;margin-bottom:3px;display:flex;flex-direction:row;gap:3px;align-items:center"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg><span></span>${a.name}</span></div>`,h+=`<div style="width:100%;text-align:left;"><b>${N?u.dataLabel({p:"",v:a.percentage,s:"%",r:t.value.style.chart.tooltip.roundingPercentage}):""}</b> ${N&&F?"(":""}${F?u.dataLabel({p:a.prefix||"",v:a.value,s:a.suffix||"",r:t.value.style.chart.tooltip.roundingValue}):""}${N&&F?")":""}</div>`,T.value=`<div>${h}</div>`}}function L(){g.value.showTable=!g.value.showTable}function A(){g.value.showTooltip=!g.value.showTooltip}return Y({getData:ne,generatePdf:E,generateCsv:z,generateImage:M,toggleTable:L,toggleTooltip:A}),(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-onion ${k.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"onionChart",ref:y,id:`vue-ui-onion_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:I,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`)},[e.createVNode(se._sfc_main,{config:{title:{cy:"onion-div-title",...t.value.style.chart.title},subtitle:{cy:"onion-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&w.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:j,key:`user_options${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(K),isPrinting:e.unref(J),uid:m.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:k.value,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,onToggleFullscreen:ue,onGeneratePdf:e.unref(E),onGenerateCsv:z,onGenerateImage:e.unref(M),onToggleTable:L,onToggleTooltip:A},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${n.value.width<=0?1e-4:n.value.width} ${n.value.height<=0?1e-4:n.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:t.value.style.chart.layout.gutter.color,"stroke-width":f.value.gutter,fill:"none","stroke-dasharray":l.path.bgDashArray,"stroke-dashoffset":l.path.fullOffset,"stroke-linecap":"round",class:e.normalizeClass({"vue-ui-onion-path":!0,"vue-ui-onion-blur":t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value!==o}),style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,10,me))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<0?1e-4:l.radius,stroke:`${l.color}`,"stroke-width":f.value.track,fill:"none","stroke-dasharray":l.path.dashArray,"stroke-dashoffset":l.path.dashOffset,class:e.normalizeClass({"vue-ui-onion-path":!0,"vue-ui-onion-blur":t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value!==o}),"stroke-linecap":"round",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,10,ye))),256)),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${m.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.gradientIntensity},null,8,ke)],8,be)]),t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("g",{key:0,filter:`url(#blur_${m.value})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:"white","stroke-width":f.value.track/3,fill:"none","stroke-linecap":"round","stroke-dasharray":l.path.dashArray,"stroke-dashoffset":l.path.dashOffset,style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,Ce))),256))],8,we)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{"data-cy-trap":"",cx:s.value.centerX,cy:s.value.centerY,r:l.radius<=0?1e-4:l.radius,stroke:"transparent","stroke-width":Math.max(f.value.track,f.value.gutter),fill:"none","stroke-dasharray":l.path.bgDashArray,"stroke-dashoffset":l.path.fullOffset,"stroke-linecap":"round",class:"vue-ui-onion-path",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"},onMouseenter:h=>D({datapoint:l,show:!0,seriesIndex:o}),onMouseleave:r[0]||(r[0]=h=>{v.value=void 0,C.value=!1})},null,40,xe))),256)),t.value.style.chart.layout.labels.show?(e.openBlock(),e.createElementBlock("g",$e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("g",{onMouseenter:h=>D({datapoint:l,show:!0,seriesIndex:o}),onMouseleave:r[1]||(r[1]=h=>{v.value=void 0,C.value=!1})},[c.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("text",{key:0,x:n.value.width/2-f.value.gutter*.8+t.value.style.chart.layout.labels.offsetX,y:l.labelY+t.value.style.chart.layout.labels.offsetY,"text-anchor":"end","font-size":t.value.style.chart.layout.labels.fontSize,fill:t.value.useBlurOnHover&&![null,void 0].includes(v.value)&&v.value===o?l.color:t.value.style.chart.layout.labels.color,"font-weight":t.value.style.chart.layout.labels.bold?"bold":"normal"},e.toDisplayString(l.name?l.name+": ":"")+" "+e.toDisplayString(t.value.style.chart.layout.labels.percentage.show?`${(l.percentage||0).toFixed(t.value.style.chart.layout.labels.roundingPercentage)}%`:"")+" "+e.toDisplayString(!t.value.style.chart.layout.labels.percentage.show&&t.value.style.chart.layout.labels.value.show?` : ${l.value?`${l.prefix||""}${l.value.toFixed(t.value.style.chart.layout.labels.roundingValue)}${l.suffix||""}`:""}`:`${t.value.style.chart.layout.labels.value.show&&l.value?`(${l.prefix||""}${l.value.toFixed(t.value.style.chart.layout.labels.roundingValue)}${l.suffix||""})`:""}`),9,Be))],40,Te))),256))])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:n.value},void 0,!0)],14,fe)):e.createCommentVNode("",!0),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:3,config:{type:"onion",style:{backgroundColor:t.value.style.chart.backgroundColor,onion:{color:t.value.style.chart.layout.gutter.color}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:V},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ie.Legend,{key:0,legendSet:i.value,config:ae.value,onClickMarker:r[2]||(r[2]=({legend:l})=>R(l.id))},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:o=>l.segregate(),style:e.normalizeStyle(`opacity:${c.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name?l.name+": ":"")+" "+e.toDisplayString((l.percentage||0).toFixed(t.value.style.chart.legend.roundingPercentage))+"% ",13,Se)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:i.value},void 0,!0)],512),e.createVNode(de._sfc_main,{show:g.value.showTooltip&&C.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,parent:y.value,content:T.value,isCustom:e.unref(u.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({..._.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({..._.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),w.value?(e.openBlock(),e.createBlock(he.default,{key:4,hideDetails:"",config:{open:g.value.showTable,maxHeight:1e4,head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ce.DataTable,{colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[3]||(r[3]=l=>g.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),td:e.withCtx(({td:l})=>[e.createElementVNode("div",{innerHTML:l},null,8,_e)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,pe))}},Ne=ge._export_sfc(Pe,[["__scopeId","data-v-2ee9d4d0"]]);exports.default=Ne;