vue-data-ui 2.3.2 → 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-BoVO5twe.js → index.es-YufTdp0y.js} +1 -1
  24. package/dist/{index.es-w_iDpZ-o.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-C6KVJkgd.cjs +0 -843
  148. package/dist/index-bDBuMYfe.js +0 -57303
@@ -0,0 +1,722 @@
1
+ import { computed as w, ref as y, onMounted as He, onBeforeUnmount as Ee, openBlock as m, createElementBlock as x, normalizeClass as Ce, normalizeStyle as D, createVNode as ne, createCommentVNode as H, createBlock as ee, unref as T, createSlots as Ue, withCtx as $, renderSlot as _, normalizeProps as j, guardReactiveProps as Y, Fragment as ke, renderList as xe, createElementVNode as O, toDisplayString as G, createTextVNode as $e, nextTick as Ge, pushScopeId as Xe, popScopeId as qe } from "vue";
2
+ import { u as je, c as Te, t as Ye, a as Ze, p as C, b as Je, o as Ke, e as Qe, d as te, f as le, X as et, l as _e, C as Oe, v as Se, w as tt, n as lt, q as ot } from "./index-uOtklCCx.js";
3
+ import { _ as at } from "./Title-2iks1ziC.js";
4
+ import { u as nt, U as st } from "./usePrinter-B6xQCyL-.js";
5
+ import { _ as rt } from "./Tooltip-C3phqKuU.js";
6
+ import { L as ut } from "./Legend-CxvJTjEm.js";
7
+ import it from "./vue-ui-skeleton-BM9rwmxY.js";
8
+ import { D as ct } from "./DataTable-CwaOlAsy.js";
9
+ import dt from "./vue-ui-accordion-HJPf7My0.js";
10
+ import { t as vt, u as ht } from "./useResponsive-NZB-WLRF.js";
11
+ import { u as Ne } from "./useNestedProp-BgWkUab_.js";
12
+ import { _ as ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
+ function ze(a, i) {
14
+ const s = a.length;
15
+ if (s === 0)
16
+ throw new Error(`Max aspect ratio cannot be computed: ${a} is an empty array`);
17
+ {
18
+ let n = 1 / 0, r = -1 / 0, c = 0;
19
+ for (let h = 0; h < s; h += 1) {
20
+ const v = a[h].normalizedValue;
21
+ v < n && (n = v), v > r && (r = v), c += v;
22
+ }
23
+ return Math.max(
24
+ i ** 2 * r / c ** 2,
25
+ c ** 2 / (i ** 2 * n)
26
+ );
27
+ }
28
+ }
29
+ function Ie(a) {
30
+ const { xOffset: i, yOffset: s, width: n, height: r } = a;
31
+ return {
32
+ x0: i,
33
+ y0: s,
34
+ x1: i + n,
35
+ y1: s + r
36
+ };
37
+ }
38
+ function pt(a, i, s) {
39
+ if (a.length === 0)
40
+ return !0;
41
+ {
42
+ const n = a.concat(i), r = ze(
43
+ a,
44
+ s
45
+ ), c = ze(n, s);
46
+ return r >= c;
47
+ }
48
+ }
49
+ function gt(a) {
50
+ const i = [], s = a.length;
51
+ for (let n = 0; n < s; n += 1) {
52
+ const r = a[n], c = r.length;
53
+ for (let d = 0; d < c; d += 1)
54
+ i.push(r[d]);
55
+ }
56
+ return i;
57
+ }
58
+ function yt(a, i) {
59
+ const s = {
60
+ ...i,
61
+ children: a
62
+ };
63
+ return Pe(s);
64
+ }
65
+ function mt(a) {
66
+ return (a.x1 - a.x0) * (a.y1 - a.y0);
67
+ }
68
+ function Fe(a, i) {
69
+ const { width: s, height: n, xOffset: r, yOffset: c } = se(i), d = a.length, h = a.map((p) => p.normalizedValue || 0).reduce((p, k) => p + k, 0), v = h / n, S = h / s;
70
+ let b = r, N = c;
71
+ const f = [];
72
+ if (s >= n) {
73
+ for (let p = 0; p < d; p += 1) {
74
+ const k = a[p], z = N + k.normalizedValue / v, e = {
75
+ x0: b,
76
+ y0: N,
77
+ x1: b + v,
78
+ y1: z
79
+ }, P = Object.assign({}, k, e);
80
+ N = z, f.push(P);
81
+ }
82
+ return f;
83
+ } else {
84
+ for (let p = 0; p < d; p += 1) {
85
+ const k = a[p], z = b + k.normalizedValue / S, e = {
86
+ x0: b,
87
+ y0: N,
88
+ x1: z,
89
+ y1: N + S
90
+ }, P = Object.assign({}, k, e);
91
+ b = z, f.push(P);
92
+ }
93
+ return f;
94
+ }
95
+ }
96
+ function bt(a) {
97
+ const i = se(a), s = i.width, n = i.height;
98
+ return Math.min(s, n);
99
+ }
100
+ function wt(a, i) {
101
+ const s = a.length, n = a.map((v) => v.value ?? 0).reduce((v, S) => v + S, 0), r = i / n, c = [];
102
+ let d, h;
103
+ for (let v = 0; v < s; v += 1)
104
+ h = a[v], d = Object.assign({}, h, {
105
+ normalizedValue: h.value * (r || 0)
106
+ }), c.push(d);
107
+ return c;
108
+ }
109
+ function se(a) {
110
+ const { x0: i, y0: s, x1: n, y1: r } = a;
111
+ return {
112
+ xOffset: i,
113
+ yOffset: s,
114
+ width: n - i,
115
+ height: r - s
116
+ };
117
+ }
118
+ function Ct(a, i, s, n) {
119
+ let r = a, c = i, d = s, h = n;
120
+ for (; ; ) {
121
+ const v = r.length;
122
+ if (v === 0) {
123
+ const f = Fe(c, d);
124
+ return h.concat(f);
125
+ }
126
+ const S = bt(d), b = r[0], N = r.slice(1, v);
127
+ if (pt(c, b, S)) {
128
+ const f = c.concat(b);
129
+ r = N, c = f, d = d, h = h;
130
+ } else {
131
+ const f = c.length;
132
+ let p = 0;
133
+ for (let P = 0; P < f; P += 1)
134
+ p += c[P].normalizedValue;
135
+ const k = kt(d, p), z = Fe(c, d), e = h.concat(z);
136
+ r = r, c = [], d = k, h = e;
137
+ }
138
+ }
139
+ }
140
+ function Pe(a) {
141
+ if (typeof a.children > "u" || !a.children.length)
142
+ return [a];
143
+ {
144
+ const i = wt(
145
+ a.children,
146
+ mt(a)
147
+ ), s = Ct(i, [], a, []), n = s.length, r = [];
148
+ for (let d = 0; d < n; d += 1)
149
+ r.push(Pe(s[d]));
150
+ return gt(r);
151
+ }
152
+ }
153
+ function kt(a, i) {
154
+ const { width: s, height: n, xOffset: r, yOffset: c } = se(a);
155
+ if (s >= n) {
156
+ const d = i / n, h = s - d, v = {
157
+ xOffset: r + d,
158
+ yOffset: c,
159
+ width: h,
160
+ height: n
161
+ };
162
+ return Ie(v);
163
+ } else {
164
+ const d = i / s, h = n - d, v = {
165
+ xOffset: r,
166
+ yOffset: c + d,
167
+ width: s,
168
+ height: h
169
+ };
170
+ return Ie(v);
171
+ }
172
+ }
173
+ const xt = (a) => (Xe("data-v-7489c985"), a = a(), qe(), a), $t = ["id"], Tt = ["xmlns", "viewBox"], _t = { key: 0 }, Ot = ["id"], St = ["stop-color"], Nt = ["stop-color"], zt = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width", "onClick", "onMouseenter"], It = ["x", "y", "height", "width"], Ft = {
174
+ style: { width: "100%", height: "100%" },
175
+ class: "vue-ui-treemap-cell"
176
+ }, Pt = /* @__PURE__ */ xt(() => /* @__PURE__ */ O("br", null, null, -1)), Lt = ["onClick"], Rt = { key: 0 }, At = { key: 1 }, Dt = ["innerHTML"], Mt = {
177
+ __name: "vue-ui-treemap",
178
+ props: {
179
+ config: {
180
+ type: Object,
181
+ default() {
182
+ return {};
183
+ }
184
+ },
185
+ dataset: {
186
+ type: Array,
187
+ default() {
188
+ return [];
189
+ }
190
+ }
191
+ },
192
+ emits: ["selectLegend", "selectDatapoint"],
193
+ setup(a, { expose: i, emit: s }) {
194
+ const n = a, { vue_ui_treemap: r } = je(), c = w(() => !!n.dataset && n.dataset.length), d = w(() => /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), h = y(Te()), v = y(!1), S = y(""), b = y(!1), N = y(0), f = y([]), p = y(null), k = y(null), z = y(null), e = w(() => {
195
+ const t = Ne({
196
+ userConfig: n.config,
197
+ defaultConfig: r
198
+ });
199
+ return t.theme ? {
200
+ ...Ne({
201
+ userConfig: Ye.vue_ui_treemap[t.theme] || n.config,
202
+ defaultConfig: t
203
+ }),
204
+ customPalette: Ze[t.theme] || C
205
+ } : t;
206
+ }), { isPrinting: P, isImaging: Le, generatePdf: re, generateImage: ue } = nt({
207
+ elementId: `treemap_${h.value}`,
208
+ fileName: e.value.style.chart.title.text || "vue-ui-treemap"
209
+ }), Z = w(() => Je(e.value.customPalette)), L = y({
210
+ showTable: e.value.table.show,
211
+ showTooltip: e.value.style.chart.tooltip.show
212
+ }), R = y({
213
+ height: e.value.style.chart.height,
214
+ width: e.value.style.chart.width
215
+ }), M = w(() => ({
216
+ bottom: R.value.height - e.value.style.chart.padding.bottom,
217
+ height: R.value.height - e.value.style.chart.padding.top - e.value.style.chart.padding.bottom,
218
+ left: e.value.style.chart.padding.left,
219
+ right: R.value.width - e.value.style.chart.padding.right,
220
+ top: e.value.style.chart.padding.top,
221
+ vbHeight: R.value.height,
222
+ vbWidth: R.value.width,
223
+ width: R.value.width - e.value.style.chart.padding.left - e.value.style.chart.padding.right
224
+ }));
225
+ function ie(t) {
226
+ t.forEach((o, l) => {
227
+ o.id = Te(), o.color = te(o.color) || Z.value[l] || C[l] || C[l % C.length], o.children && (o.children.forEach((u) => {
228
+ u.parentId = o.id, u.color = o.color;
229
+ }), ie(o.children));
230
+ });
231
+ }
232
+ const V = y(n.dataset), J = y(null);
233
+ He(() => {
234
+ if (Ke(n.dataset) && Qe({
235
+ componentName: "VueUiTreemap",
236
+ type: "dataset"
237
+ }), ie(V.value), e.value.responsive) {
238
+ const t = vt(() => {
239
+ const { width: o, height: l } = ht({
240
+ chart: p.value,
241
+ title: e.value.style.chart.title.text ? k.value : null,
242
+ legend: e.value.style.chart.legend.show ? z.value : null
243
+ });
244
+ R.value.width = o, R.value.height = l;
245
+ });
246
+ J.value = new ResizeObserver(t), J.value.observe(p.value.parentNode);
247
+ }
248
+ }), Ee(() => {
249
+ J.value && J.value.disconnect();
250
+ });
251
+ const oe = y(V.value), X = w(() => oe.value.map((t, o) => ({
252
+ ...t,
253
+ color: te(t.color) || Z.value[o] || C[o] || C[o % C.length]
254
+ })).filter((t) => !f.value.includes(t.id))), E = w(() => V.value.filter((t) => !f.value.includes(t.id)).map((t) => t.value || 0).reduce((t, o) => t + o, 0)), ce = w({
255
+ get() {
256
+ let t = [...X.value];
257
+ return e.value.style.chart.layout.sorted && (t = [...X.value].sort((o, l) => l.value - o.value)), t.map((o) => ({
258
+ ...o
259
+ }));
260
+ },
261
+ set(t) {
262
+ return t;
263
+ }
264
+ });
265
+ function de(t, o) {
266
+ return t.value / o;
267
+ }
268
+ function Re(t, o, l) {
269
+ const u = e.value.style.chart.layout.rects.colorRatio - de(o, l);
270
+ return _e(t, u < 0 ? 0 : u);
271
+ }
272
+ function ve(t, o, l, u) {
273
+ return t.map((g, W) => {
274
+ const Q = Re(te(o) || Z.value[W] || C[W] || C[W % C.length], g, u), We = de(g, u);
275
+ return {
276
+ ...g,
277
+ color: Q,
278
+ proportion: We,
279
+ parentName: l,
280
+ children: g.children ? ve(g.children, Q, g.name, u) : void 0
281
+ };
282
+ });
283
+ }
284
+ const q = w(() => yt(
285
+ ce.value.map((t, o) => {
286
+ const l = t.children ? t.children.reduce((u, g) => u + g.value, 0) : t.value;
287
+ return {
288
+ value: t.value,
289
+ id: t.id,
290
+ children: t.children ? ve(t.children.sort((u, g) => g.value - u.value), t.color, t.name, l) : void 0,
291
+ color: t.color,
292
+ name: t.name
293
+ };
294
+ }),
295
+ { x0: M.value.left * 2, y0: M.value.top, x1: M.value.width, y1: M.value.height }
296
+ ));
297
+ function he({ y0: t, y1: o }) {
298
+ return o - t <= 0 ? 1e-4 : o - t;
299
+ }
300
+ function fe({ x0: t, x1: o }) {
301
+ return o - t <= 0 ? 1e-4 : o - t;
302
+ }
303
+ function B(t) {
304
+ const o = e.value.style.chart.layout.labels.fontSize * (t.proportion * 2 > 1 ? 1 : t.proportion * 2);
305
+ return o < e.value.style.chart.layout.labels.minFontSize ? e.value.style.chart.layout.labels.minFontSize : o;
306
+ }
307
+ function Ae(t) {
308
+ b.value = t, N.value += 1;
309
+ }
310
+ const U = w(() => ({
311
+ startX: 0,
312
+ startY: 0,
313
+ width: M.value.vbWidth,
314
+ height: M.value.vbHeight
315
+ })), I = y(!1);
316
+ function pe(t, o = V.value) {
317
+ for (const l of o) {
318
+ if (l.id === t)
319
+ return l;
320
+ if (l.children) {
321
+ const u = pe(t, l.children);
322
+ if (u)
323
+ return u;
324
+ }
325
+ }
326
+ return null;
327
+ }
328
+ function De(t) {
329
+ I.value ? (s("selectDatapoint", void 0), oe.value = V.value) : (s("selectDatapoint", t), oe.value = [pe(t.parentId)]), I.value = !I.value;
330
+ }
331
+ const F = y(null), ge = w(() => V.value.map((t, o) => ({
332
+ ...t,
333
+ color: te(t.color) || Z.value[o] || C[o] || C[o % C.length],
334
+ shape: "square"
335
+ })).sort((t, o) => o.value - t.value).map((t, o) => ({
336
+ ...t,
337
+ proportion: t.value / V.value.map((l) => l.value).reduce((l, u) => l + u, 0),
338
+ opacity: f.value.includes(t.id) ? 0.5 : 1
339
+ }))), Me = w(() => ({
340
+ cy: "treemap-div-legend",
341
+ backgroundColor: e.value.style.chart.legend.backgroundColor,
342
+ color: e.value.style.chart.legend.color,
343
+ fontSize: e.value.style.chart.legend.fontSize,
344
+ paddingBottom: 12,
345
+ fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
346
+ }));
347
+ function ye(t) {
348
+ I.value = !1, F.value = null, f.value.includes(t.id) ? f.value = f.value.filter((o) => o !== t.id) : f.value.length < n.dataset.length - 1 && f.value.push(t.id), s("selectLegend", ce.value);
349
+ }
350
+ const ae = y(null);
351
+ function Ve({ datapoint: t, seriesIndex: o }) {
352
+ F.value = t, ae.value = { datapoint: t, seriesIndex: o, config: e.value, series: X.value };
353
+ const l = e.value.style.chart.tooltip.customFormat;
354
+ if (Se(l) && tt(() => l({
355
+ seriesIndex: o,
356
+ datapoint: t,
357
+ series: X.value,
358
+ config: e.value
359
+ })))
360
+ S.value = l({
361
+ seriesIndex: o,
362
+ datapoint: t,
363
+ series: X.value,
364
+ config: e.value
365
+ });
366
+ else {
367
+ let u = "";
368
+ u += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${t.name}</div>`, u += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${t.color}"/></svg>`, u += `<b>${le({ p: e.value.style.chart.layout.labels.prefix, v: t.value, s: e.value.style.chart.layout.labels.suffix, r: e.value.style.chart.tooltip.roundingValue })}</b>`, S.value = `<div>${u}</div>`;
369
+ }
370
+ v.value = !0;
371
+ }
372
+ const A = w(() => {
373
+ const t = q.value.map((l) => ({
374
+ name: l.name,
375
+ color: l.color
376
+ })), o = q.value.map((l) => l.value);
377
+ return { head: t, body: o };
378
+ });
379
+ function me() {
380
+ Ge(() => {
381
+ const t = A.value.head.map((u, g) => [[
382
+ u.name
383
+ ], [A.value.body[g]], [isNaN(A.value.body[g] / E.value) ? "-" : A.value.body[g] / E.value * 100]]), o = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(t), l = lt(o);
384
+ ot({ csvContent: l, title: e.value.style.chart.title.text || "vue-ui-treemap" });
385
+ });
386
+ }
387
+ const K = w(() => {
388
+ const t = [
389
+ e.value.table.columnNames.series,
390
+ e.value.table.columnNames.value,
391
+ e.value.table.columnNames.percentage
392
+ ], o = A.value.head.map((g, W) => {
393
+ const Q = le({ p: e.value.style.chart.layout.labels.prefix, v: A.value.body[W], s: e.value.style.chart.layout.labels.suffix, r: e.value.table.td.roundingValue });
394
+ return [
395
+ {
396
+ color: g.color,
397
+ name: g.name,
398
+ shape: "square"
399
+ },
400
+ Q,
401
+ isNaN(A.value.body[W] / E.value) ? "-" : (A.value.body[W] / E.value * 100).toFixed(e.value.table.td.roundingPercentage) + "%"
402
+ ];
403
+ }), l = {
404
+ th: {
405
+ backgroundColor: e.value.table.th.backgroundColor,
406
+ color: e.value.table.th.color,
407
+ outline: e.value.table.th.outline
408
+ },
409
+ td: {
410
+ backgroundColor: e.value.table.td.backgroundColor,
411
+ color: e.value.table.td.color,
412
+ outline: e.value.table.td.outline
413
+ },
414
+ breakpoint: e.value.table.responsiveBreakpoint
415
+ };
416
+ return {
417
+ colNames: [
418
+ e.value.table.columnNames.series,
419
+ e.value.table.columnNames.value
420
+ ],
421
+ head: t,
422
+ body: o,
423
+ config: l
424
+ };
425
+ });
426
+ function Be() {
427
+ return q.value;
428
+ }
429
+ function be() {
430
+ L.value.showTable = !L.value.showTable;
431
+ }
432
+ function we() {
433
+ L.value.showTooltip = !L.value.showTooltip;
434
+ }
435
+ return i({
436
+ getData: Be,
437
+ generateCsv: me,
438
+ generateImage: ue,
439
+ generatePdf: re,
440
+ toggleTable: be,
441
+ toggleTooltip: we
442
+ }), (t, o) => (m(), x("div", {
443
+ ref_key: "treemapChart",
444
+ ref: p,
445
+ class: Ce(`vue-ui-treemap ${b.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
446
+ style: D(`font-family:${e.value.style.fontFamily};width:100%; ${e.value.responsive ? "height: 100%;" : ""} text-align:center;${e.value.style.chart.title.text ? "" : "padding-top:36px"};background:${e.value.style.chart.backgroundColor}`),
447
+ id: `treemap_${h.value}`
448
+ }, [
449
+ e.value.style.chart.title.text ? (m(), x("div", {
450
+ key: 0,
451
+ ref_key: "chartTitle",
452
+ ref: k,
453
+ style: D(`width:100%;background:${e.value.style.chart.backgroundColor};padding-bottom:6px`)
454
+ }, [
455
+ ne(at, {
456
+ config: {
457
+ title: {
458
+ cy: "treemap-div-title",
459
+ ...e.value.style.chart.title
460
+ },
461
+ subtitle: {
462
+ cy: "treemap-div-subtitle",
463
+ ...e.value.style.chart.title.subtitle
464
+ }
465
+ }
466
+ }, null, 8, ["config"])
467
+ ], 4)) : H("", !0),
468
+ e.value.userOptions.show && c.value ? (m(), ee(st, {
469
+ ref: "details",
470
+ key: `user_option_${N.value}`,
471
+ backgroundColor: e.value.style.chart.backgroundColor,
472
+ color: e.value.style.chart.color,
473
+ isPrinting: T(P),
474
+ isImaging: T(Le),
475
+ uid: h.value,
476
+ hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
477
+ hasPdf: e.value.userOptions.buttons.pdf,
478
+ hasXls: e.value.userOptions.buttons.csv,
479
+ hasImg: e.value.userOptions.buttons.img,
480
+ hasTable: e.value.userOptions.buttons.table,
481
+ hasFullscreen: e.value.userOptions.buttons.fullscreen,
482
+ isFullscreen: b.value,
483
+ isTooltip: L.value.showTooltip,
484
+ titles: { ...e.value.userOptions.buttonTitles },
485
+ chartElement: p.value,
486
+ onToggleFullscreen: Ae,
487
+ onGeneratePdf: T(re),
488
+ onGenerateCsv: me,
489
+ onGenerateImage: T(ue),
490
+ onToggleTable: be,
491
+ onToggleTooltip: we
492
+ }, Ue({ _: 2 }, [
493
+ t.$slots.optionTooltip ? {
494
+ name: "optionTooltip",
495
+ fn: $(() => [
496
+ _(t.$slots, "optionTooltip", {}, void 0, !0)
497
+ ]),
498
+ key: "0"
499
+ } : void 0,
500
+ t.$slots.optionPdf ? {
501
+ name: "optionPdf",
502
+ fn: $(() => [
503
+ _(t.$slots, "optionPdf", {}, void 0, !0)
504
+ ]),
505
+ key: "1"
506
+ } : void 0,
507
+ t.$slots.optionCsv ? {
508
+ name: "optionCsv",
509
+ fn: $(() => [
510
+ _(t.$slots, "optionCsv", {}, void 0, !0)
511
+ ]),
512
+ key: "2"
513
+ } : void 0,
514
+ t.$slots.optionImg ? {
515
+ name: "optionImg",
516
+ fn: $(() => [
517
+ _(t.$slots, "optionImg", {}, void 0, !0)
518
+ ]),
519
+ key: "3"
520
+ } : void 0,
521
+ t.$slots.optionTable ? {
522
+ name: "optionTable",
523
+ fn: $(() => [
524
+ _(t.$slots, "optionTable", {}, void 0, !0)
525
+ ]),
526
+ key: "4"
527
+ } : void 0,
528
+ t.$slots.optionFullscreen ? {
529
+ name: "optionFullscreen",
530
+ fn: $(({ toggleFullscreen: l, isFullscreen: u }) => [
531
+ _(t.$slots, "optionFullscreen", j(Y({ toggleFullscreen: l, isFullscreen: u })), void 0, !0)
532
+ ]),
533
+ key: "5"
534
+ } : void 0
535
+ ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : H("", !0),
536
+ c.value ? (m(), x("svg", {
537
+ key: 2,
538
+ xmlns: T(et),
539
+ class: Ce({ "vue-data-ui-fullscreen--on": b.value, "vue-data-ui-fulscreen--off": !b.value, "vue-data-ui-zoom-plus": !I.value, "vue-data-ui-zoom-minus": I.value }),
540
+ viewBox: `${U.value.startX} ${U.value.startY} ${U.value.width <= 0 ? 10 : U.value.width} ${U.value.height <= 0 ? 10 : U.value.height}`,
541
+ style: D(`max-width:100%; overflow: hidden; background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color}`)
542
+ }, [
543
+ (m(!0), x(ke, null, xe(q.value, (l, u) => (m(), x("g", null, [
544
+ e.value.style.chart.layout.rects.gradient.show ? (m(), x("defs", _t, [
545
+ O("radialGradient", {
546
+ id: `tgrad_${l.id}`,
547
+ gradientTransform: "translate(-1, -1.000001) scale(2, 2)"
548
+ }, [
549
+ O("stop", {
550
+ offset: "18%",
551
+ "stop-color": l.color
552
+ }, null, 8, St),
553
+ O("stop", {
554
+ offset: "100%",
555
+ "stop-color": T(_e)(l.color, e.value.style.chart.layout.rects.gradient.intensity / 100)
556
+ }, null, 8, Nt)
557
+ ], 8, Ot)
558
+ ])) : H("", !0)
559
+ ]))), 256)),
560
+ (m(!0), x(ke, null, xe(q.value, (l, u) => (m(), x("g", null, [
561
+ O("rect", {
562
+ x: l.x0,
563
+ y: l.y0,
564
+ height: he(l),
565
+ width: fe(l),
566
+ fill: d.value ? l.color : e.value.style.chart.layout.rects.gradient.show ? `url(#tgrad_${l.id})` : l.color,
567
+ rx: e.value.style.chart.layout.rects.borderRadius,
568
+ stroke: F.value && F.value.id === l.id ? e.value.style.chart.layout.rects.selected.stroke : e.value.style.chart.layout.rects.stroke,
569
+ "stroke-width": F.value && F.value.id === l.id ? e.value.style.chart.layout.rects.selected.strokeWidth : e.value.style.chart.layout.rects.strokeWidth,
570
+ onClick: (g) => De(l),
571
+ onMouseenter: () => Ve({
572
+ datapoint: l,
573
+ seriesIndex: u
574
+ }),
575
+ onMouseleave: o[0] || (o[0] = (g) => {
576
+ F.value = null, v.value = !1;
577
+ }),
578
+ style: D(`opacity:${F.value ? F.value.id === l.id ? 1 : e.value.style.chart.layout.rects.selected.unselectedOpacity : 1}`),
579
+ class: "vue-ui-treemap-rect"
580
+ }, null, 44, zt),
581
+ (m(), x("foreignObject", {
582
+ x: l.x0,
583
+ y: l.y0,
584
+ height: he(l),
585
+ width: fe(l),
586
+ class: "vue-ui-treemap-cell-foreignObject"
587
+ }, [
588
+ O("div", Ft, [
589
+ e.value.style.chart.layout.labels.showDefaultLabels && (l.proportion > e.value.style.chart.layout.labels.hideUnderProportion || I.value) ? (m(), x("div", {
590
+ key: 0,
591
+ class: "vue-ui-treemap-cell-default",
592
+ style: D(`width:calc(100% - ${B(l) / 1.5}px);text-align:left;line-height:${B(l) < 14 ? 14 : B(l)}px;padding:${B(l) / 3}px; color:${T(Oe)(l.color)}`)
593
+ }, [
594
+ O("span", {
595
+ style: D(`width:100%;font-size:${B(l)}px;`)
596
+ }, G(l.name), 5),
597
+ Pt,
598
+ O("span", {
599
+ style: D(`width:100%;font-size:${B(l)}px;`)
600
+ }, G(T(le)({
601
+ p: e.value.style.chart.layout.labels.prefix,
602
+ v: l.value,
603
+ s: e.value.style.chart.layout.labels.suffix,
604
+ r: e.value.style.chart.layout.labels.rounding
605
+ })), 5)
606
+ ], 4)) : H("", !0),
607
+ _(t.$slots, "rect", j(Y({
608
+ rect: l,
609
+ shouldShow: l.proportion > e.value.style.chart.layout.labels.hideUnderProportion || I.value,
610
+ fontSize: B(l),
611
+ isZoom: I.value,
612
+ textColor: T(Oe)(l.color)
613
+ })), void 0, !0)
614
+ ])
615
+ ], 8, It))
616
+ ]))), 256)),
617
+ _(t.$slots, "svg", j(Y({ svg: M.value, isZoom: I.value, rect: F.value, config: e.value })), void 0, !0)
618
+ ], 14, Tt)) : H("", !0),
619
+ c.value ? H("", !0) : (m(), ee(it, {
620
+ key: 3,
621
+ config: {
622
+ type: "treemap",
623
+ style: {
624
+ backgroundColor: e.value.style.chart.backgroundColor,
625
+ treemap: {
626
+ color: "#CCCCCC"
627
+ }
628
+ }
629
+ }
630
+ }, null, 8, ["config"])),
631
+ O("div", {
632
+ ref_key: "chartLegend",
633
+ ref: z
634
+ }, [
635
+ e.value.style.chart.legend.show ? (m(), ee(ut, {
636
+ key: 0,
637
+ legendSet: ge.value,
638
+ config: Me.value,
639
+ id: `treemap_legend_${h.value}`,
640
+ onClickMarker: o[1] || (o[1] = ({ legend: l }) => ye(l))
641
+ }, {
642
+ item: $(({ legend: l, index: u }) => [
643
+ O("div", {
644
+ onClick: (g) => ye(l),
645
+ style: D(`opacity:${f.value.includes(l.id) ? 0.5 : 1}`)
646
+ }, [
647
+ $e(G(l.name) + ": " + G(T(le)({ p: e.value.style.chart.layout.labels.prefix, v: l.value, s: e.value.style.chart.layout.labels.suffix, r: e.value.style.chart.legend.roundingValue })) + " ", 1),
648
+ f.value.includes(l.id) ? (m(), x("span", At, " ( - % ) ")) : (m(), x("span", Rt, " (" + G(isNaN(l.value / E.value) ? "-" : (l.value / E.value * 100).toFixed(e.value.style.chart.legend.roundingPercentage)) + "%) ", 1))
649
+ ], 12, Lt)
650
+ ]),
651
+ _: 1
652
+ }, 8, ["legendSet", "config", "id"])) : _(t.$slots, "legend", {
653
+ key: 1,
654
+ legend: ge.value
655
+ }, void 0, !0)
656
+ ], 512),
657
+ ne(rt, {
658
+ show: L.value.showTooltip && v.value,
659
+ backgroundColor: e.value.style.chart.tooltip.backgroundColor,
660
+ color: e.value.style.chart.tooltip.color,
661
+ fontSize: e.value.style.chart.tooltip.fontSize,
662
+ borderRadius: e.value.style.chart.tooltip.borderRadius,
663
+ borderColor: e.value.style.chart.tooltip.borderColor,
664
+ borderWidth: e.value.style.chart.tooltip.borderWidth,
665
+ backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
666
+ parent: p.value,
667
+ content: S.value,
668
+ isCustom: T(Se)(e.value.style.chart.tooltip.customFormat)
669
+ }, {
670
+ "tooltip-before": $(() => [
671
+ _(t.$slots, "tooltip-before", j(Y({ ...ae.value })), void 0, !0)
672
+ ]),
673
+ "tooltip-after": $(() => [
674
+ _(t.$slots, "tooltip-after", j(Y({ ...ae.value })), void 0, !0)
675
+ ]),
676
+ _: 3
677
+ }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "parent", "content", "isCustom"]),
678
+ c.value ? (m(), ee(dt, {
679
+ key: 4,
680
+ hideDetails: "",
681
+ config: {
682
+ open: L.value.showTable,
683
+ maxHeight: 1e4,
684
+ body: {
685
+ backgroundColor: e.value.style.chart.backgroundColor,
686
+ color: e.value.style.chart.color
687
+ },
688
+ head: {
689
+ backgroundColor: e.value.style.chart.backgroundColor,
690
+ color: e.value.style.chart.color
691
+ }
692
+ }
693
+ }, {
694
+ content: $(() => [
695
+ ne(ct, {
696
+ colNames: K.value.colNames,
697
+ head: K.value.head,
698
+ body: K.value.body,
699
+ config: K.value.config,
700
+ title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
701
+ onClose: o[2] || (o[2] = (l) => L.value.showTable = !1)
702
+ }, {
703
+ th: $(({ th: l }) => [
704
+ O("div", {
705
+ innerHTML: l,
706
+ style: { display: "flex", "align-items": "center" }
707
+ }, null, 8, Dt)
708
+ ]),
709
+ td: $(({ td: l }) => [
710
+ $e(G(l.name || l), 1)
711
+ ]),
712
+ _: 1
713
+ }, 8, ["colNames", "head", "body", "config", "title"])
714
+ ]),
715
+ _: 1
716
+ }, 8, ["config"])) : H("", !0)
717
+ ], 14, $t));
718
+ }
719
+ }, Jt = /* @__PURE__ */ ft(Mt, [["__scopeId", "data-v-7489c985"]]);
720
+ export {
721
+ Jt as default
722
+ };