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,638 @@
1
+ import { computed as c, ref as v, onMounted as Ve, onBeforeUnmount as Me, openBlock as s, createElementBlock as n, normalizeClass as ge, normalizeStyle as U, createVNode as te, createCommentVNode as w, createBlock as X, unref as f, createSlots as Be, withCtx as y, renderSlot as g, normalizeProps as Y, guardReactiveProps as J, createElementVNode as m, Fragment as $, renderList as M, toDisplayString as T, createTextVNode as me, nextTick as De, pushScopeId as Ee, popScopeId as Ge } from "vue";
2
+ import { u as Re, c as Ue, t as je, a as We, p as O, o as He, e as le, g as qe, b as Xe, d as Ye, f as I, X as Je, s as Ke, r as Qe, C as Ze, E as et, v as tt, w as lt, n as at, q as ot } from "./index-uOtklCCx.js";
3
+ import { t as ut, u as rt } from "./useResponsive-NZB-WLRF.js";
4
+ import { _ as st } from "./Title-2iks1ziC.js";
5
+ import { u as nt, U as it } from "./usePrinter-B6xQCyL-.js";
6
+ import { _ as ct } from "./Tooltip-C3phqKuU.js";
7
+ import { D as vt } from "./DataTable-CwaOlAsy.js";
8
+ import { L as dt } from "./Legend-CxvJTjEm.js";
9
+ import ht from "./vue-ui-skeleton-BM9rwmxY.js";
10
+ import pt from "./vue-ui-accordion-HJPf7My0.js";
11
+ import { u as be } from "./useNestedProp-BgWkUab_.js";
12
+ import { _ as ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
+ const we = (B) => (Ee("data-v-e4e6d49b"), B = B(), Ge(), B), yt = ["id"], gt = ["xmlns", "viewBox"], mt = ["id"], bt = ["stop-color"], wt = ["stop-color"], xt = ["id"], kt = /* @__PURE__ */ we(() => /* @__PURE__ */ m("feGaussianBlur", {
14
+ in: "SourceGraphic",
15
+ stdDeviation: 2
16
+ }, null, -1)), Ct = /* @__PURE__ */ we(() => /* @__PURE__ */ m("feColorMatrix", {
17
+ type: "saturate",
18
+ values: "0"
19
+ }, null, -1)), _t = [
20
+ kt,
21
+ Ct
22
+ ], $t = ["x", "y", "height", "width"], Tt = ["rx", "x", "y", "height", "width", "stroke", "stroke-width", "filter"], It = ["rx", "x", "y", "height", "width", "fill", "stroke", "stroke-width", "filter"], St = ["x", "y", "height", "width", "filter"], Ft = { key: 0 }, zt = { key: 1 }, Pt = { key: 2 }, Nt = { key: 3 }, Lt = ["onMouseover", "x", "y", "height", "width"], Ot = ["onClick"], At = { key: 0 }, Vt = { key: 1 }, Mt = ["innerHTML"], Bt = {
23
+ __name: "vue-ui-waffle",
24
+ props: {
25
+ config: {
26
+ type: Object,
27
+ default() {
28
+ return {};
29
+ }
30
+ },
31
+ dataset: {
32
+ type: Array,
33
+ default() {
34
+ return [];
35
+ }
36
+ }
37
+ },
38
+ emits: ["selectLegend"],
39
+ setup(B, { expose: xe, emit: ke }) {
40
+ const b = B, { vue_ui_waffle: Ce } = Re(), j = c(() => !!b.dataset && b.dataset.length), S = v(Ue()), _e = v(null), K = v(!1), Q = v(""), A = v(null), ae = v(0), D = v(null), oe = v(null), ue = v(null), e = c(() => {
41
+ const t = be({
42
+ userConfig: b.config,
43
+ defaultConfig: Ce
44
+ });
45
+ return t.theme ? {
46
+ ...be({
47
+ userConfig: je.vue_ui_waffle[t.theme] || b.config,
48
+ defaultConfig: t
49
+ }),
50
+ customPalette: We[t.theme] || O
51
+ } : t;
52
+ }), W = v(null);
53
+ Ve(() => {
54
+ if (He(b.dataset) ? le({
55
+ componentName: "VueUiWaffle",
56
+ type: "dataset"
57
+ }) : b.dataset.forEach((t, a) => {
58
+ qe({
59
+ datasetObject: t,
60
+ requiredAttributes: ["name", "values"]
61
+ }).forEach((l) => {
62
+ le({
63
+ componentName: "VueUiWaffle",
64
+ type: "datasetSerieAttribute",
65
+ property: l,
66
+ index: a
67
+ });
68
+ });
69
+ }), e.value.responsive) {
70
+ const t = ut(() => {
71
+ const { width: a, height: l } = rt({
72
+ chart: D.value,
73
+ title: e.value.style.chart.title.text ? oe.value : null,
74
+ legend: e.value.style.chart.legend.show ? ue.value : null
75
+ });
76
+ F.value.width = a, F.value.height = l, z.value.width = a, z.value.height = l;
77
+ });
78
+ W.value = new ResizeObserver(t), W.value.observe(D.value.parentNode);
79
+ }
80
+ }), Me(() => {
81
+ W.value && W.value.disconnect();
82
+ });
83
+ const { isPrinting: $e, isImaging: Te, generatePdf: re, generateImage: se } = nt({
84
+ elementId: `vue-ui-waffle_${S.value}`,
85
+ fileName: e.value.style.chart.title.text || "vue-ui-waffle"
86
+ }), ne = c(() => Xe(e.value.customPalette)), C = v({
87
+ showTable: e.value.table.show,
88
+ showTooltip: e.value.style.chart.tooltip.show
89
+ }), F = v({
90
+ height: 512,
91
+ width: 512
92
+ }), z = v({
93
+ top: 0,
94
+ left: 0,
95
+ height: 512,
96
+ width: 512
97
+ }), P = c(() => (z.value.width - e.value.style.chart.layout.grid.size * e.value.style.chart.layout.grid.spaceBetween) / e.value.style.chart.layout.grid.size), N = c(() => (z.value.height - e.value.style.chart.layout.grid.size * e.value.style.chart.layout.grid.spaceBetween) / e.value.style.chart.layout.grid.size), E = c(() => z.value.width / e.value.style.chart.layout.grid.size), H = c(() => z.value.height / e.value.style.chart.layout.grid.size);
98
+ function ie(t) {
99
+ const a = t.reduce((u, r) => u + r, 0), l = t.map((u) => Math.round(u / a * 100) / 100), o = l.reduce((u, r) => u + r, 0);
100
+ if (o !== 1) {
101
+ const u = l.length - 1;
102
+ l[u] += 1 - o, l[u] = Math.round(l[u] * 100) / 100;
103
+ }
104
+ return l;
105
+ }
106
+ const ce = c(() => b.dataset.map((t, a) => ({
107
+ ...t,
108
+ color: Ye(t.color) || ne.value[a] || O[a] || O[a % O.length],
109
+ uid: `serie_${a}`,
110
+ absoluteIndex: a
111
+ }))), h = v(ce.value), Ie = c(() => {
112
+ const t = h.value.filter((a, l) => !p.value.includes(a.uid)).map((a, l) => (a.values || []).reduce((o, u) => o + u, 0));
113
+ return ie(t);
114
+ }), Se = c(() => {
115
+ const t = h.value.map((a, l) => (a.values || []).reduce((o, u) => o + u));
116
+ return ie(t);
117
+ }), x = c(() => (b.dataset.forEach((t, a) => {
118
+ [null, void 0].includes(t.values) && le({
119
+ componentName: "VueUiWaffle",
120
+ type: "datasetSerieAttribute",
121
+ property: "values (number[])",
122
+ index: a
123
+ });
124
+ }), h.value.filter((t, a) => !p.value.includes(t.uid)).map((t, a) => ({
125
+ absoluteIndex: t.absoluteIndex,
126
+ uid: t.uid,
127
+ name: t.name,
128
+ color: t.color,
129
+ value: (t.values || []).reduce((l, o) => l + o, 0),
130
+ absoluteValues: t.values || [],
131
+ proportion: Ie.value[a] * Math.pow(e.value.style.chart.layout.grid.size, 2)
132
+ })))), Fe = c(() => h.value.map((t, a) => ({
133
+ absoluteIndex: t.absoluteIndex,
134
+ uid: t.uid,
135
+ name: t.name,
136
+ color: t.color,
137
+ value: (t.values || []).reduce((l, o) => l + o, 0),
138
+ absoluteValues: t.values || [],
139
+ proportion: Se.value[a] * Math.pow(e.value.style.chart.layout.grid.size, 2)
140
+ })));
141
+ function ze() {
142
+ return Fe.value.map((t) => ({
143
+ name: t.name,
144
+ color: t.color,
145
+ value: t.value,
146
+ proportion: t.proportion / Math.pow(e.value.style.chart.layout.grid.size, 2)
147
+ }));
148
+ }
149
+ const Pe = c(() => x.value.map((t, a) => {
150
+ const l = a > 0 ? x.value.filter((r, d) => d < a).map((r) => r.proportion).reduce((r, d) => r + d) + t.proportion - x.value[a - 1].proportion : t.proportion - t.proportion, o = l + t.proportion, u = [];
151
+ for (let r = l; r <= o; r += 1)
152
+ u.push(r);
153
+ return {
154
+ ...t,
155
+ start: a > 0 ? x.value.filter((r, d) => d < a).map((r) => r.proportion).reduce((r, d) => r + d) + t.proportion - x.value[a - 1].proportion : t.proportion - t.proportion,
156
+ rects: u
157
+ };
158
+ })), i = c(() => Pe.value.flatMap((t, a) => t.rects.map((l, o) => ({
159
+ isFirst: o === 0,
160
+ isLongEnough: l.length > 2,
161
+ name: t.name,
162
+ color: t.color,
163
+ value: t.value,
164
+ serieIndex: a,
165
+ absoluteStartIndex: o < 3,
166
+ serieId: t.uid,
167
+ ...t
168
+ }))).map((t, a) => ({
169
+ ...t,
170
+ isAbsoluteFirst: a % e.value.style.chart.layout.grid.size === 0
171
+ }))), G = c(() => {
172
+ const t = [];
173
+ for (let a = 0; a < e.value.style.chart.layout.grid.size; a += 1)
174
+ for (let l = 0; l < e.value.style.chart.layout.grid.size; l += 1)
175
+ t.push({
176
+ isStartOfLine: l === 0,
177
+ position: e.value.style.chart.layout.grid.vertical ? a : l,
178
+ x: (e.value.style.chart.layout.grid.vertical ? a : l) * (P.value + e.value.style.chart.layout.grid.spaceBetween),
179
+ y: (e.value.style.chart.layout.grid.vertical ? l : a) * (N.value + e.value.style.chart.layout.grid.spaceBetween) + z.value.top
180
+ });
181
+ return t;
182
+ }), p = v([]), L = v(!1), ve = v(null), de = v(null);
183
+ function he(t) {
184
+ if (!e.value.useAnimation) {
185
+ p.value.includes(t) ? p.value = p.value.filter((u) => u !== t) : p.value.length < V.value.length - 1 && V.value.length > 1 && p.value.push(t);
186
+ return;
187
+ }
188
+ const a = ce.value.find((u) => u.uid === t).values.reduce((u, r) => u + r, 0);
189
+ let o = h.value.find((u) => u.uid === t).values.reduce((u, r) => u + r, 0);
190
+ if (p.value.includes(t)) {
191
+ let r = function() {
192
+ o > u ? (cancelAnimationFrame(ve.value), h.value = h.value.map((d, Ae) => d.uid === t ? {
193
+ ...d,
194
+ values: [u]
195
+ } : d), L.value = !1) : (L.value = !0, o += u * 0.025, h.value = h.value.map((d, Ae) => d.uid === t ? {
196
+ ...d,
197
+ values: [o]
198
+ } : d), ve.value = requestAnimationFrame(r));
199
+ };
200
+ p.value = p.value.filter((d) => d !== t);
201
+ const u = a;
202
+ r();
203
+ } else if (p.value.length < V.value.length - 1 && V.value.length > 1) {
204
+ let u = function() {
205
+ o < 0.1 ? (cancelAnimationFrame(de.value), p.value.push(t), h.value = h.value.map((r, d) => r.uid === t ? {
206
+ ...r,
207
+ values: [0]
208
+ } : r), L.value = !1) : (L.value = !0, o /= 1.5, h.value = h.value.map((r, d) => r.uid === t ? {
209
+ ...r,
210
+ values: [o]
211
+ } : r), de.value = requestAnimationFrame(u));
212
+ };
213
+ u();
214
+ }
215
+ ke("selectLegend", x.value.map((u) => ({
216
+ name: u.name,
217
+ color: u.color,
218
+ value: u.value,
219
+ proportion: u.proportion / Math.pow(e.value.style.chart.layout.grid.size, 2)
220
+ })));
221
+ }
222
+ const V = c(() => h.value.map((t, a) => ({
223
+ name: t.name,
224
+ color: t.color || ne[a] || O[a] || O[a % O.length],
225
+ value: (t.values || []).reduce((l, o) => l + o, 0),
226
+ uid: t.uid,
227
+ shape: "square"
228
+ })).map((t, a) => ({
229
+ ...t,
230
+ proportion: t.value / h.value.map((l) => (l.values || []).reduce((o, u) => o + u, 0)).reduce((l, o) => l + o, 0),
231
+ opacity: p.value.includes(t.uid) ? 0.5 : 1,
232
+ segregate: () => he(t.uid),
233
+ isSegregated: p.value.includes(t.uid)
234
+ }))), Ne = c(() => ({
235
+ cy: "waffle-div-legend",
236
+ backgroundColor: e.value.style.chart.legend.backgroundColor,
237
+ color: e.value.style.chart.legend.color,
238
+ fontSize: e.value.style.chart.legend.fontSize,
239
+ paddingBottom: 12,
240
+ fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
241
+ })), k = c(() => x.value.map((t) => t.value).reduce((t, a) => t + a, 0)), Z = v(null);
242
+ function Le(t) {
243
+ if (p.value.length === b.dataset.length) return;
244
+ const a = i.value[t];
245
+ Z.value = {
246
+ datapoint: a,
247
+ seriesIndex: a.absoluteIndex,
248
+ series: h.value,
249
+ config: e.value
250
+ }, K.value = !0, A.value = i.value[t].serieIndex;
251
+ const l = e.value.style.chart.tooltip.customFormat;
252
+ if (tt(l) && lt(() => l({
253
+ seriesIndex: i.value[t].absoluteIndex,
254
+ datapoint: a,
255
+ series: h.value,
256
+ config: e.value
257
+ })))
258
+ Q.value = l({
259
+ seriesIndex: i.value[t].absoluteIndex,
260
+ datapoint: a,
261
+ series: h.value,
262
+ config: e.value
263
+ });
264
+ else {
265
+ let o = "";
266
+ o += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`, o += `<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" rx="1" fill="${a.color}" /></svg>`, e.value.style.chart.tooltip.showValue && (o += `<b>${I({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: a.value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.style.chart.tooltip.roundingValue })}</b>`), e.value.style.chart.tooltip.showPercentage && (e.value.style.chart.tooltip.showValue ? o += `<span>(${(a.value / k.value * 100).toFixed(e.value.style.chart.tooltip.roundingPercentage)}%)</span></div>` : o += `<b>${(a.value / k.value * 100).toFixed(e.value.style.chart.tooltip.roundingPercentage)}%</b></div>`), Q.value = o;
267
+ }
268
+ }
269
+ const _ = c(() => {
270
+ const t = x.value.map((l) => ({
271
+ name: l.name,
272
+ color: l.color
273
+ })), a = x.value.map((l) => l.value);
274
+ return { head: t, body: a };
275
+ });
276
+ function ee(t) {
277
+ return e.value.useBlurOnHover && ![null, void 0].includes(A.value) && A.value !== t ? `url(#blur_${S.value})` : "";
278
+ }
279
+ function pe() {
280
+ De(() => {
281
+ const t = _.value.head.map((o, u) => [[
282
+ o.name
283
+ ], [_.value.body[u]], [isNaN(_.value.body[u] / k.value) ? "-" : _.value.body[u] / k.value * 100]]), a = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(t), l = at(a);
284
+ ot({ csvContent: l, title: e.value.style.chart.title.text || "vue-ui-waffle" });
285
+ });
286
+ }
287
+ const q = c(() => {
288
+ const t = [
289
+ ' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',
290
+ I({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: k.value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
291
+ "100%"
292
+ ], a = _.value.head.map((u, r) => [
293
+ {
294
+ color: u.color,
295
+ name: u.name
296
+ },
297
+ I({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: _.value.body[r], s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
298
+ isNaN(_.value.body[r] / k.value) ? "-" : (_.value.body[r] / k.value * 100).toFixed(e.value.table.td.roundingPercentage) + "%"
299
+ ]), l = {
300
+ th: {
301
+ backgroundColor: e.value.table.th.backgroundColor,
302
+ color: e.value.table.th.color,
303
+ outline: e.value.table.th.outline
304
+ },
305
+ td: {
306
+ backgroundColor: e.value.table.td.backgroundColor,
307
+ color: e.value.table.td.color,
308
+ outline: e.value.table.td.outline
309
+ },
310
+ shape: "square",
311
+ breakpoint: e.value.table.responsiveBreakpoint
312
+ }, o = [
313
+ e.value.table.columnNames.series,
314
+ e.value.table.columnNames.value,
315
+ e.value.table.columnNames.percentage
316
+ ];
317
+ return {
318
+ head: t,
319
+ body: a,
320
+ config: l,
321
+ colNames: o
322
+ };
323
+ }), R = v(!1);
324
+ function Oe(t) {
325
+ R.value = t, ae.value += 1;
326
+ }
327
+ function fe() {
328
+ C.value.showTable = !C.value.showTable;
329
+ }
330
+ function ye() {
331
+ C.value.showTooltip = !C.value.showTooltip;
332
+ }
333
+ return xe({
334
+ getData: ze,
335
+ generatePdf: re,
336
+ generateCsv: pe,
337
+ generateImage: se,
338
+ toggleTable: fe,
339
+ toggleTooltip: ye
340
+ }), (t, a) => (s(), n("div", {
341
+ class: ge(`vue-ui-waffle ${R.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
342
+ ref_key: "waffleChart",
343
+ ref: D,
344
+ id: `vue-ui-waffle_${S.value}`,
345
+ style: U(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.chart.title.text ? "" : "padding-top:36px"};background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height: 100%" : ""}`)
346
+ }, [
347
+ e.value.style.chart.title.text ? (s(), n("div", {
348
+ key: 0,
349
+ ref_key: "chartTitle",
350
+ ref: oe,
351
+ style: U(`width:100%;background:${e.value.style.chart.backgroundColor};padding-bottom:12px`)
352
+ }, [
353
+ te(st, {
354
+ config: {
355
+ title: {
356
+ cy: "waffle-title",
357
+ ...e.value.style.chart.title
358
+ },
359
+ subtitle: {
360
+ cy: "waffle-subtitle",
361
+ ...e.value.style.chart.title.subtitle
362
+ }
363
+ }
364
+ }, null, 8, ["config"])
365
+ ], 4)) : w("", !0),
366
+ e.value.userOptions.show && j.value ? (s(), X(it, {
367
+ ref_key: "details",
368
+ ref: _e,
369
+ key: `user_options_${ae.value}`,
370
+ backgroundColor: e.value.style.chart.backgroundColor,
371
+ color: e.value.style.chart.color,
372
+ isPrinting: f($e),
373
+ isImaging: f(Te),
374
+ uid: S.value,
375
+ hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
376
+ hasPdf: e.value.userOptions.buttons.pdf,
377
+ hasImg: e.value.userOptions.buttons.img,
378
+ hasXls: e.value.userOptions.buttons.csv,
379
+ hasTable: e.value.userOptions.buttons.table,
380
+ hasFullscreen: e.value.userOptions.buttons.fullscreen,
381
+ isFullscreen: R.value,
382
+ isTooltip: C.value.showTooltip,
383
+ titles: { ...e.value.userOptions.buttonTitles },
384
+ chartElement: D.value,
385
+ onToggleFullscreen: Oe,
386
+ onGeneratePdf: f(re),
387
+ onGenerateCsv: pe,
388
+ onGenerateImage: f(se),
389
+ onToggleTable: fe,
390
+ onToggleTooltip: ye
391
+ }, Be({ _: 2 }, [
392
+ t.$slots.optionTooltip ? {
393
+ name: "optionTooltip",
394
+ fn: y(() => [
395
+ g(t.$slots, "optionTooltip", {}, void 0, !0)
396
+ ]),
397
+ key: "0"
398
+ } : void 0,
399
+ t.$slots.optionPdf ? {
400
+ name: "optionPdf",
401
+ fn: y(() => [
402
+ g(t.$slots, "optionPdf", {}, void 0, !0)
403
+ ]),
404
+ key: "1"
405
+ } : void 0,
406
+ t.$slots.optionCsv ? {
407
+ name: "optionCsv",
408
+ fn: y(() => [
409
+ g(t.$slots, "optionCsv", {}, void 0, !0)
410
+ ]),
411
+ key: "2"
412
+ } : void 0,
413
+ t.$slots.optionImg ? {
414
+ name: "optionImg",
415
+ fn: y(() => [
416
+ g(t.$slots, "optionImg", {}, void 0, !0)
417
+ ]),
418
+ key: "3"
419
+ } : void 0,
420
+ t.$slots.optionTable ? {
421
+ name: "optionTable",
422
+ fn: y(() => [
423
+ g(t.$slots, "optionTable", {}, void 0, !0)
424
+ ]),
425
+ key: "4"
426
+ } : void 0,
427
+ t.$slots.optionFullscreen ? {
428
+ name: "optionFullscreen",
429
+ fn: y(({ toggleFullscreen: l, isFullscreen: o }) => [
430
+ g(t.$slots, "optionFullscreen", Y(J({ toggleFullscreen: l, isFullscreen: o })), void 0, !0)
431
+ ]),
432
+ key: "5"
433
+ } : void 0
434
+ ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : w("", !0),
435
+ j.value ? (s(), n("svg", {
436
+ key: 2,
437
+ xmlns: f(Je),
438
+ class: ge({ "vue-data-ui-fullscreen--on": R.value, "vue-data-ui-fulscreen--off": !R.value }),
439
+ viewBox: `0 0 ${F.value.width <= 0 ? 10 : F.value.width} ${F.value.height <= 0 ? 10 : F.value.height}`,
440
+ style: U(`max-width:100%;overflow:visible;background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color}`)
441
+ }, [
442
+ m("defs", null, [
443
+ (s(!0), n($, null, M(i.value, (l, o) => (s(), n("radialGradient", {
444
+ cx: "50%",
445
+ cy: "50%",
446
+ r: "50%",
447
+ fx: "50%",
448
+ fy: "50%",
449
+ id: `gradient_${S.value}_${o}`
450
+ }, [
451
+ m("stop", {
452
+ offset: "0%",
453
+ "stop-color": `${f(Ke)(l.color, 0.05)}${f(Qe)[100 - e.value.style.chart.layout.rect.gradientIntensity]}`
454
+ }, null, 8, bt),
455
+ m("stop", {
456
+ offset: "100%",
457
+ "stop-color": l.color
458
+ }, null, 8, wt)
459
+ ], 8, mt))), 256))
460
+ ]),
461
+ m("defs", null, [
462
+ m("filter", {
463
+ id: `blur_${S.value}`,
464
+ x: "-50%",
465
+ y: "-50%",
466
+ width: "200%",
467
+ height: "200%"
468
+ }, _t, 8, xt)
469
+ ]),
470
+ e.value.useCustomCells ? (s(!0), n($, { key: 0 }, M(G.value, (l, o) => (s(), n("foreignObject", {
471
+ x: l.x,
472
+ y: l.y,
473
+ height: N.value <= 0 ? 1e-4 : N.value,
474
+ width: P.value <= 0 ? 1e-4 : P.value,
475
+ class: "vue-ui-waffle-custom-cell-foreignObject"
476
+ }, [
477
+ g(t.$slots, "cell", Y(J({ cell: { ...l, color: i.value[o].color, ...i.value[o] }, isSelected: [null, void 0].includes(A.value) ? !0 : i.value[o].serieIndex === A.value })), void 0, !0)
478
+ ], 8, $t))), 256)) : (s(), n($, { key: 1 }, [
479
+ (s(!0), n($, null, M(G.value, (l, o) => (s(), n("rect", {
480
+ rx: e.value.style.chart.layout.rect.rounded ? e.value.style.chart.layout.rect.rounding : 0,
481
+ x: l.x,
482
+ y: l.y,
483
+ height: N.value <= 0 ? 1e-4 : N.value,
484
+ width: P.value <= 0 ? 1e-4 : P.value,
485
+ fill: "white",
486
+ stroke: e.value.style.chart.layout.rect.stroke,
487
+ "stroke-width": e.value.style.chart.layout.rect.strokeWidth,
488
+ filter: ee(i.value[o].serieIndex)
489
+ }, null, 8, Tt))), 256)),
490
+ (s(!0), n($, null, M(G.value, (l, o) => (s(), n("rect", {
491
+ rx: e.value.style.chart.layout.rect.rounded ? e.value.style.chart.layout.rect.rounding : 0,
492
+ x: l.x,
493
+ y: l.y,
494
+ height: N.value <= 0 ? 1e-4 : N.value,
495
+ width: P.value <= 0 ? 1e-4 : P.value,
496
+ fill: e.value.style.chart.layout.rect.useGradient && e.value.style.chart.layout.rect.gradientIntensity > 0 ? `url(#gradient_${S.value}_${o})` : i.value[o].color,
497
+ stroke: e.value.style.chart.layout.rect.stroke,
498
+ "stroke-width": e.value.style.chart.layout.rect.strokeWidth,
499
+ filter: ee(i.value[o].serieIndex)
500
+ }, null, 8, It))), 256))
501
+ ], 64)),
502
+ (s(!0), n($, null, M(G.value, (l, o) => (s(), n($, null, [
503
+ !L.value && !e.value.style.chart.layout.grid.vertical && e.value.style.chart.layout.labels.captions.show && (i.value[o].isFirst && l.position < e.value.style.chart.layout.grid.size - 2 || i.value[o].isAbsoluteFirst && o % e.value.style.chart.layout.grid.size === 0 && i.value[o].absoluteStartIndex) ? (s(), n("foreignObject", {
504
+ key: 0,
505
+ x: l.x + e.value.style.chart.layout.labels.captions.offsetX,
506
+ y: l.y + e.value.style.chart.layout.labels.captions.offsetY,
507
+ height: H.value <= 0 ? 1e-4 : H.value,
508
+ width: E.value * e.value.style.chart.layout.grid.size <= 0 ? 1e-4 : E.value * e.value.style.chart.layout.grid.size,
509
+ filter: ee(i.value[o].serieIndex)
510
+ }, [
511
+ m("div", {
512
+ class: "vue-ui-waffle-caption",
513
+ style: U(`height: 100%; width: 100%; font-size:${e.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${E.value / 12}px;color:${f(Ze)(i.value[o].color)};gap:2px`)
514
+ }, [
515
+ e.value.style.chart.layout.labels.captions.showSerieName ? (s(), n("span", Ft, T(e.value.style.chart.layout.labels.captions.serieNameAbbreviation ? f(et)({ source: i.value[o].name, length: e.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize }) : i.value[o].name) + ": ", 1)) : w("", !0),
516
+ e.value.style.chart.layout.labels.captions.showPercentage ? (s(), n("span", zt, T(f(I)({ v: i.value[o].proportion, s: "%", r: e.value.style.chart.layout.labels.captions.roundingPercentage })), 1)) : w("", !0),
517
+ e.value.style.chart.layout.labels.captions.showPercentage && e.value.style.chart.layout.labels.captions.showValue ? (s(), n("span", Pt, " (" + T(f(I)({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: i.value[o].value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.style.chart.layout.labels.captions.roundingValue })) + ") ", 1)) : w("", !0),
518
+ !e.value.style.chart.layout.labels.captions.showPercentage && e.value.style.chart.layout.labels.captions.showValue ? (s(), n("span", Nt, T(f(I)({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: i.value[o].value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.style.chart.layout.labels.captions.roundingValue })), 1)) : w("", !0)
519
+ ], 4)
520
+ ], 8, St)) : w("", !0)
521
+ ], 64))), 256)),
522
+ (s(!0), n($, null, M(G.value, (l, o) => (s(), n("rect", {
523
+ onMouseover: (u) => Le(o),
524
+ onMouseleave: a[0] || (a[0] = (u) => {
525
+ K.value = !1, A.value = null;
526
+ }),
527
+ x: l.x,
528
+ y: l.y,
529
+ height: H.value <= 0 ? 1e-4 : H.value,
530
+ width: E.value <= 0 ? 1e-4 : E.value,
531
+ fill: "transparent",
532
+ stroke: "none"
533
+ }, null, 40, Lt))), 256)),
534
+ g(t.$slots, "svg", { svg: F.value }, void 0, !0)
535
+ ], 14, gt)) : w("", !0),
536
+ j.value ? w("", !0) : (s(), X(ht, {
537
+ key: 3,
538
+ config: {
539
+ type: "waffle",
540
+ style: {
541
+ backgroundColor: e.value.style.chart.backgroundColor,
542
+ waffle: {
543
+ color: "#CCCCCC"
544
+ }
545
+ }
546
+ }
547
+ }, null, 8, ["config"])),
548
+ m("div", {
549
+ ref_key: "chartLegend",
550
+ ref: ue
551
+ }, [
552
+ e.value.style.chart.legend.show ? (s(), X(dt, {
553
+ key: 0,
554
+ legendSet: V.value,
555
+ config: Ne.value,
556
+ onClickMarker: a[1] || (a[1] = ({ legend: l }) => he(l.uid))
557
+ }, {
558
+ item: y(({ legend: l }) => [
559
+ m("div", {
560
+ onClick: (o) => l.segregate(),
561
+ style: U(`opacity:${p.value.includes(l.uid) ? 0.5 : 1}`)
562
+ }, [
563
+ me(T(l.name) + ": " + T(f(I)({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: l.value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.style.chart.legend.roundingValue, isAnimating: L.value })) + " ", 1),
564
+ p.value.includes(l.uid) ? (s(), n("span", Vt, " ( - % ) ")) : (s(), n("span", At, " (" + T(isNaN(l.value / k.value) ? "-" : f(I)({ v: l.value / k.value * 100, s: "%", r: e.value.style.chart.legend.roundingPercentage, isAnimating: L.value })) + ") ", 1))
565
+ ], 12, Ot)
566
+ ]),
567
+ _: 1
568
+ }, 8, ["legendSet", "config"])) : g(t.$slots, "legend", {
569
+ key: 1,
570
+ legend: V.value
571
+ }, void 0, !0)
572
+ ], 512),
573
+ te(ct, {
574
+ show: C.value.showTooltip && K.value && p.value.length < b.dataset.length,
575
+ backgroundColor: e.value.style.chart.tooltip.backgroundColor,
576
+ color: e.value.style.chart.tooltip.color,
577
+ borderRadius: e.value.style.chart.tooltip.borderRadius,
578
+ borderColor: e.value.style.chart.tooltip.borderColor,
579
+ borderWidth: e.value.style.chart.tooltip.borderWidth,
580
+ backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
581
+ parent: D.value,
582
+ content: Q.value,
583
+ isCustom: e.value.style.chart.tooltip.customFormat && typeof e.value.style.chart.tooltip.customFormat == "function",
584
+ fontSize: e.value.style.chart.tooltip.fontSize
585
+ }, {
586
+ "tooltip-before": y(() => [
587
+ g(t.$slots, "tooltip-before", Y(J({ ...Z.value })), void 0, !0)
588
+ ]),
589
+ "tooltip-after": y(() => [
590
+ g(t.$slots, "tooltip-after", Y(J({ ...Z.value })), void 0, !0)
591
+ ]),
592
+ _: 3
593
+ }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "parent", "content", "isCustom", "fontSize"]),
594
+ j.value ? (s(), X(pt, {
595
+ key: 4,
596
+ hideDetails: "",
597
+ config: {
598
+ open: C.value.showTable,
599
+ maxHeight: 1e4,
600
+ body: {
601
+ backgroundColor: e.value.style.chart.backgroundColor,
602
+ color: e.value.style.chart.color
603
+ },
604
+ head: {
605
+ backgroundColor: e.value.style.chart.backgroundColor,
606
+ color: e.value.style.chart.color
607
+ }
608
+ }
609
+ }, {
610
+ content: y(() => [
611
+ te(vt, {
612
+ colNames: q.value.colNames,
613
+ head: q.value.head,
614
+ body: q.value.body,
615
+ config: q.value.config,
616
+ title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
617
+ onClose: a[2] || (a[2] = (l) => C.value.showTable = !1)
618
+ }, {
619
+ th: y(({ th: l }) => [
620
+ m("div", {
621
+ innerHTML: l,
622
+ style: { display: "flex", "align-items": "center" }
623
+ }, null, 8, Mt)
624
+ ]),
625
+ td: y(({ td: l }) => [
626
+ me(T(l.name || l), 1)
627
+ ]),
628
+ _: 1
629
+ }, 8, ["colNames", "head", "body", "config", "title"])
630
+ ]),
631
+ _: 1
632
+ }, 8, ["config"])) : w("", !0)
633
+ ], 14, yt));
634
+ }
635
+ }, Kt = /* @__PURE__ */ ft(Bt, [["__scopeId", "data-v-e4e6d49b"]]);
636
+ export {
637
+ Kt as default
638
+ };