vue-data-ui 2.2.92 → 2.2.93

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 (58) hide show
  1. package/dist/index-DZlxUin4.js +57288 -0
  2. package/dist/{index.es-Dc9Fd4o6.js → index.es-Cgqo-FBk.js} +1 -1
  3. package/dist/style.css +1 -1
  4. package/dist/vue-data-ui.js +61 -455
  5. package/package.json +1 -1
  6. package/dist/data-table-d-VcuH-r.js +0 -1488
  7. package/dist/legend-DJCYLsl_.js +0 -61
  8. package/dist/themes-lgjsYHsH.js +0 -4967
  9. package/dist/title-BF-9Qcni.js +0 -56
  10. package/dist/tooltip-D85WEOKi.js +0 -94
  11. package/dist/user-options-DZgCz8UA.js +0 -415
  12. package/dist/vue-ui-3d-bar-DW7kGJSz.js +0 -20360
  13. package/dist/vue-ui-age-pyramid-4hcuKpFY.js +0 -781
  14. package/dist/vue-ui-annotator-C83FVvl8.js +0 -2175
  15. package/dist/vue-ui-candlestick-diclGj95.js +0 -807
  16. package/dist/vue-ui-chestnut-ACetHLdG.js +0 -1049
  17. package/dist/vue-ui-cursor-Rx7UNaYT.js +0 -229
  18. package/dist/vue-ui-dashboard-B3PlN0ks.js +0 -231
  19. package/dist/vue-ui-digits-CxMXID42.js +0 -154
  20. package/dist/vue-ui-donut-DMiwVXNd.js +0 -1534
  21. package/dist/vue-ui-dumbbell-B_X1T8TR.js +0 -621
  22. package/dist/vue-ui-flow-B72wzQ6V.js +0 -451
  23. package/dist/vue-ui-galaxy-DXX5yivT.js +0 -482
  24. package/dist/vue-ui-gauge-Cs9PDurH.js +0 -466
  25. package/dist/vue-ui-heatmap-PcoNSLdN.js +0 -581
  26. package/dist/vue-ui-kpi-DchEmPtB.js +0 -55
  27. package/dist/vue-ui-mini-loader-DltJLkqy.js +0 -131
  28. package/dist/vue-ui-molecule-CWvukBzs.js +0 -746
  29. package/dist/vue-ui-mood-radar-DEfdtIi8.js +0 -544
  30. package/dist/vue-ui-nested-donuts-9URpqgXE.js +0 -768
  31. package/dist/vue-ui-onion-C0eowUT6.js +0 -551
  32. package/dist/vue-ui-parallel-coordinate-plot-Bc_pAaPJ.js +0 -647
  33. package/dist/vue-ui-quadrant-_ddVAm9V.js +0 -1174
  34. package/dist/vue-ui-quick-chart-Cio0hDYO.js +0 -1310
  35. package/dist/vue-ui-radar-Dyg38i33.js +0 -853
  36. package/dist/vue-ui-rating-CE1Lmwd2.js +0 -271
  37. package/dist/vue-ui-relation-circle-BMlB3k3d.js +0 -303
  38. package/dist/vue-ui-rings-BuXeijvb.js +0 -507
  39. package/dist/vue-ui-scatter-B1hZfOua.js +0 -870
  40. package/dist/vue-ui-screenshot-0QXgxzGs.js +0 -160
  41. package/dist/vue-ui-smiley-B7kR7exr.js +0 -763
  42. package/dist/vue-ui-spark-trend-BmL2KiYL.js +0 -245
  43. package/dist/vue-ui-sparkgauge-BMzFv14L.js +0 -158
  44. package/dist/vue-ui-sparkhistogram-DWpOXqHm.js +0 -243
  45. package/dist/vue-ui-sparkstackbar-DB9VQXlc.js +0 -244
  46. package/dist/vue-ui-strip-plot-DyN6P0JO.js +0 -614
  47. package/dist/vue-ui-table-DM3zL89q.js +0 -2180
  48. package/dist/vue-ui-table-heatmap-gWx0Nslu.js +0 -237
  49. package/dist/vue-ui-thermometer-Bcqv5kd_.js +0 -384
  50. package/dist/vue-ui-timer-BIFxjujK.js +0 -451
  51. package/dist/vue-ui-tiremarks-zBwHpED_.js +0 -248
  52. package/dist/vue-ui-treemap-BaplVc_z.js +0 -719
  53. package/dist/vue-ui-vertical-bar-CdK6ZJPM.js +0 -734
  54. package/dist/vue-ui-waffle-COOzH7M3.js +0 -635
  55. package/dist/vue-ui-wheel-BEpuVTBk.js +0 -226
  56. package/dist/vue-ui-word-cloud-DNqxAAiX.js +0 -344
  57. package/dist/vue-ui-xy-_mHq-czW.js +0 -2058
  58. package/dist/vue-ui-xy-canvas-DqX8Gee5.js +0 -1003
@@ -1,853 +0,0 @@
1
- import { computed as p, ref as v, onMounted as Te, openBlock as u, createElementBlock as n, normalizeStyle as P, unref as g, renderSlot as T, normalizeProps as Q, mergeProps as Ge, createCommentVNode as y, createElementVNode as k, toDisplayString as F, Fragment as N, renderList as M, guardReactiveProps as re, createBlock as K, onBeforeUnmount as We, normalizeClass as J, createVNode as oe, createSlots as je, withCtx as w, createTextVNode as $e, nextTick as Xe } from "vue";
2
- import { e as Pe, f as Se, p as S, g as Fe, i as Oe, j as R, k as he, h as pe, o as W, n as G, X as Ae, x as Ne, _ as qe, b as xe, L as we, D as He, y as Ye, z as Je, v as Ke, w as Qe } from "./data-table-d-VcuH-r.js";
3
- import { t as Ze, u as et } from "./vue-ui-age-pyramid-4hcuKpFY.js";
4
- import { t as Ie } from "./themes-lgjsYHsH.js";
5
- import { u as se, _ as tt } from "./title-BF-9Qcni.js";
6
- import { U as at } from "./user-options-DZgCz8UA.js";
7
- import { _ as lt } from "./tooltip-D85WEOKi.js";
8
- import { u as ze, S as Le, a as ot, A as rt } from "./vue-ui-3d-bar-DW7kGJSz.js";
9
- import { L as st } from "./legend-DJCYLsl_.js";
10
- const ut = ["onClick"], nt = { key: 1 }, it = ["xmlns", "viewBox"], dt = ["id"], ct = ["stop-color"], vt = ["stop-color"], gt = ["height", "width", "fill", "rx"], ht = ["height", "width", "fill", "rx"], pt = ["height", "width", "fill", "rx"], Me = {
11
- __name: "vue-ui-sparkbar",
12
- props: {
13
- config: {
14
- type: Object,
15
- default() {
16
- return {};
17
- }
18
- },
19
- dataset: {
20
- type: Array,
21
- default() {
22
- return [];
23
- }
24
- },
25
- /**
26
- * Used in VueUiRadar's tooltip exclusively
27
- */
28
- backgroundOpacity: {
29
- type: Number,
30
- default: 100
31
- }
32
- },
33
- emits: ["selectDatapoint"],
34
- setup(j, { emit: ue }) {
35
- const _ = j, { vue_ui_sparkbar: f } = ze(), Z = p(() => !!_.dataset && _.dataset.length), I = v(Pe()), o = p(() => {
36
- const r = se({
37
- userConfig: _.config,
38
- defaultConfig: f
39
- });
40
- return r.theme ? {
41
- ...se({
42
- userConfig: Ie.vue_ui_sparkbar[r.theme] || _.config,
43
- defaultConfig: r
44
- }),
45
- customPalette: Se[r.theme] || S
46
- } : r;
47
- }), ne = p(() => Fe(o.value.customPalette)), z = v(_.dataset.map((r) => ({
48
- ...r,
49
- value: o.value.style.animation.show ? 0 : r.value || 0
50
- })));
51
- Te(() => {
52
- if (Oe(_.dataset) && R({
53
- componentName: "VueUiSparkbar",
54
- type: "dataset"
55
- }), o.value.style.animation.show) {
56
- let q = function() {
57
- O += i / r, O < i ? (z.value = z.value.map((h, V) => ({
58
- ...h,
59
- value: h.value += x[V]
60
- })), requestAnimationFrame(q)) : z.value = _.dataset.map((h) => ({
61
- ...h,
62
- value: h.value || 0
63
- }));
64
- };
65
- const r = o.value.style.animation.animationFrames, x = _.dataset.map((h, V) => h.value / r), i = _.dataset.map((h) => h.value || 0).reduce((h, V) => h + V, 0);
66
- let O = 0;
67
- q();
68
- }
69
- });
70
- const C = v({
71
- width: 500,
72
- height: 16
73
- }), ee = p(() => Math.max(..._.dataset.map((r) => r.value))), U = p(() => (_.dataset.forEach((r, x) => {
74
- he({
75
- datasetObject: r,
76
- requiredAttributes: ["name", "value"]
77
- }).forEach((i) => {
78
- R({
79
- componentName: "VueUiSparkbar",
80
- type: "datasetSerieAttribute",
81
- property: i,
82
- index: x
83
- });
84
- });
85
- }), z.value.map((r, x) => ({
86
- ...r,
87
- value: r.value || 0,
88
- color: pe(r.color) || ne.value[x] || S[x] || S[x % S.length]
89
- }))));
90
- function te(r) {
91
- return r / ee.value;
92
- }
93
- function X(r) {
94
- return o.value.style.layout.independant ? r.target ? r.value / r.target : o.value.style.layout.percentage ? r.value / 100 : o.value.style.layout.target === 0 ? 1 : r.value / o.value.style.layout.target : te(r.value);
95
- }
96
- function e(r) {
97
- return o.value.style.layout.independant && r.target || o.value.style.layout.target;
98
- }
99
- function D(r, x) {
100
- ue("selectDatapoint", { datapoint: r, index: x });
101
- }
102
- return (r, x) => (u(), n("div", {
103
- style: P({
104
- width: "100%",
105
- fontFamily: o.value.style.fontFamily,
106
- background: o.value.style.backgroundColor + g(W)[_.backgroundOpacity]
107
- })
108
- }, [
109
- r.$slots.title ? T(r.$slots, "title", Q(Ge({ key: 0 }, { title: { ...r.title, title: o.value.style.title.text, subtitle: o.value.style.title.subtitle.text } }))) : y("", !0),
110
- !r.$slots.title && o.value.style.title.text ? (u(), n("div", {
111
- key: 1,
112
- class: "vue-ui-sparkbar-title-container",
113
- style: P({
114
- background: o.value.style.title.backgroundColor,
115
- margin: o.value.style.title.margin,
116
- textAlign: o.value.style.title.textAlign
117
- })
118
- }, [
119
- k("div", {
120
- class: "vue-ui-sparkbar-title",
121
- style: P({
122
- fontSize: o.value.style.title.fontSize + "px",
123
- color: o.value.style.title.color,
124
- fontWeight: o.value.style.title.bold ? "bold" : "normal"
125
- })
126
- }, F(o.value.style.title.text), 5),
127
- o.value.style.title.subtitle.text ? (u(), n("div", {
128
- key: 0,
129
- class: "vue-ui-sparkbar-subtitle",
130
- style: P({
131
- fontSize: o.value.style.title.subtitle.fontSize + "px",
132
- color: o.value.style.title.subtitle.color,
133
- fontWeight: o.value.style.title.subtitle.bold ? "bold" : "normal"
134
- })
135
- }, F(o.value.style.title.subtitle.text), 5)) : y("", !0)
136
- ], 4)) : y("", !0),
137
- (u(!0), n(N, null, M(U.value, (i, O) => (u(), n(N, null, [
138
- Z.value ? (u(), n("div", {
139
- key: 0,
140
- style: P(`display:flex !important;${["left", "right"].includes(o.value.style.labels.name.position) ? "flex-direction:row !important" : "flex-direction:column !important"};gap:${o.value.style.gap}px !important;${o.value.style.labels.name.position === "right" ? "row-reverse !important" : ""};align-items:center;${j.dataset.length > 0 && O !== j.dataset.length - 1 ? "margin-bottom:6px" : ""}`),
141
- onClick: () => D(i, O)
142
- }, [
143
- T(r.$slots, "data-label", Q(re({ bar: {
144
- ...i,
145
- target: e(i),
146
- valueLabel: g(G)({
147
- p: i.prefix || "",
148
- v: i.value,
149
- s: i.suffix || "",
150
- r: i.rounding || 0
151
- }),
152
- targetLabel: g(G)({
153
- p: i.prefix || "",
154
- v: e(i),
155
- s: i.suffix || "",
156
- r: i.rounding || 0
157
- })
158
- } }))),
159
- r.$slots["data-label"] ? y("", !0) : (u(), n("div", {
160
- key: 0,
161
- style: P(`width:${o.value.style.labels.name.width};${["right", "top"].includes(o.value.style.labels.name.position) ? "text-align:left" : "text-align:right"};color:${o.value.style.labels.name.color};font-size:${o.value.style.labels.fontSize}px;font-weight:${o.value.style.labels.name.bold ? "bold" : "normal"}`)
162
- }, [
163
- k("span", null, F(i.name), 1),
164
- o.value.style.labels.value.show ? (u(), n("span", {
165
- key: 0,
166
- style: P(`font-weight:${o.value.style.labels.value.bold ? "bold" : "normal"}`)
167
- }, ": " + F(g(G)({
168
- p: i.prefix || "",
169
- v: i.value,
170
- s: i.suffix || "",
171
- r: i.rounding || 0
172
- })), 5)) : y("", !0),
173
- o.value.style.layout.showTargetValue ? (u(), n("span", nt, F(" " + o.value.style.layout.targetValueText) + " " + F(g(G)({
174
- p: i.prefix || "",
175
- v: e(i),
176
- s: i.suffix || "",
177
- r: i.rounding || 0
178
- })), 1)) : y("", !0)
179
- ], 4)),
180
- (u(), n("svg", {
181
- xmlns: g(Ae),
182
- viewBox: `0 0 ${C.value.width} ${C.value.height}`,
183
- width: "100%"
184
- }, [
185
- k("defs", null, [
186
- k("linearGradient", {
187
- x1: "0%",
188
- y1: "0%",
189
- x2: "100%",
190
- y2: "0%",
191
- id: `sparkbar_gradient_${O}_${I.value}`
192
- }, [
193
- k("stop", {
194
- offset: "0%",
195
- "stop-color": `${g(Ne)(i.color, 0.03)}${g(W)[100 - o.value.style.bar.gradient.intensity]}`
196
- }, null, 8, ct),
197
- k("stop", {
198
- offset: "100%",
199
- "stop-color": i.color
200
- }, null, 8, vt)
201
- ], 8, dt)
202
- ]),
203
- k("rect", {
204
- height: C.value.height,
205
- width: C.value.width,
206
- x: 0,
207
- y: 0,
208
- fill: `${o.value.style.gutter.backgroundColor}${g(W)[o.value.style.gutter.opacity]}`,
209
- rx: C.value.height / 2
210
- }, null, 8, gt),
211
- k("rect", {
212
- height: C.value.height,
213
- width: C.value.width * X(i),
214
- x: 0,
215
- y: 0,
216
- fill: o.value.style.bar.gradient.underlayerColor,
217
- rx: C.value.height / 2
218
- }, null, 8, ht),
219
- k("rect", {
220
- height: C.value.height,
221
- width: C.value.width * X(i),
222
- x: 0,
223
- y: 0,
224
- fill: o.value.style.bar.gradient.show ? `url(#sparkbar_gradient_${O}_${I.value})` : i.color,
225
- rx: C.value.height / 2
226
- }, null, 8, pt)
227
- ], 8, it))
228
- ], 12, ut)) : y("", !0)
229
- ], 64))), 256)),
230
- Z.value ? y("", !0) : (u(), K(Le, {
231
- key: 2,
232
- config: {
233
- type: "sparkbar",
234
- style: {
235
- backgroundColor: o.value.style.backgroundColor,
236
- sparkbar: {
237
- color: "#CCCCCC"
238
- }
239
- }
240
- }
241
- }, null, 8, ["config"]))
242
- ], 4));
243
- }
244
- }, Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
245
- __proto__: null,
246
- default: Me
247
- }, Symbol.toStringTag, { value: "Module" })), yt = ["id"], ft = ["xmlns", "viewBox"], mt = ["id"], bt = ["stop-color"], kt = ["stop-color"], Ct = { key: 0 }, _t = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], $t = { key: 0 }, xt = ["d", "stroke", "stroke-width"], wt = ["d", "stroke", "stroke-width"], Tt = { key: 1 }, Pt = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], St = ["points", "stroke", "stroke-width"], Ft = ["points", "stroke", "stroke-width", "fill"], Ot = { key: 2 }, At = ["cx", "cy", "fill", "r", "stroke"], Nt = ["onClick"], It = {
248
- key: 0,
249
- style: { "max-width": "200px", margin: "0 auto" }
250
- }, zt = {
251
- __name: "vue-ui-radar",
252
- props: {
253
- config: {
254
- type: Object,
255
- default() {
256
- return {};
257
- }
258
- },
259
- dataset: {
260
- type: Object,
261
- default() {
262
- return {};
263
- }
264
- }
265
- },
266
- emits: ["selectLegend"],
267
- setup(j, { expose: ue, emit: _ }) {
268
- const f = j, { vue_ui_radar: Z } = ze(), I = p(() => !!f.dataset && Object.keys(f.dataset).length), o = v(Pe()), ne = v(null), z = v(!1), C = v(""), ee = v(0), U = v(null), te = v(null), X = v(null), e = p(() => {
269
- const t = se({
270
- userConfig: f.config,
271
- defaultConfig: Z
272
- });
273
- return t.theme ? {
274
- ...se({
275
- userConfig: Ie.vue_ui_radar[t.theme] || f.config,
276
- defaultConfig: t
277
- }),
278
- customPalette: Se[t.theme] || S
279
- } : t;
280
- }), D = v(null);
281
- Te(() => {
282
- if (Oe(f.dataset) && R({
283
- componentName: "VueUiRadar",
284
- type: "dataset"
285
- }), e.value.responsive) {
286
- const t = Ze(() => {
287
- const { width: a, height: l } = et({
288
- chart: U.value,
289
- title: e.value.style.chart.title.text ? te.value : null,
290
- legend: e.value.style.chart.legend.show ? X.value : null
291
- });
292
- c.value.width = a, c.value.height = l;
293
- });
294
- D.value = new ResizeObserver(t), D.value.observe(U.value.parentNode);
295
- }
296
- }), We(() => {
297
- D.value && D.value.disconnect();
298
- });
299
- const { isPrinting: r, isImaging: x, generatePdf: i, generateImage: O } = ot({
300
- elementId: `vue-ui-radar_${o.value}`,
301
- fileName: e.value.style.chart.title.text || "vue-ui-radar"
302
- }), q = p(() => Fe(e.value.customPalette)), h = v({
303
- dataLabels: {
304
- show: e.value.style.chart.layout.labels.dataLabels.show
305
- },
306
- showTable: e.value.table.show,
307
- showTooltip: e.value.style.chart.tooltip.show
308
- }), V = p(() => ({
309
- style: {
310
- backgroundColor: e.value.style.chart.tooltip.backgroundColor,
311
- animation: {
312
- show: e.value.style.chart.tooltip.animation.show,
313
- animationFrames: e.value.style.chart.tooltip.animation.animationFrames
314
- },
315
- labels: {
316
- fontSize: e.value.style.chart.tooltip.fontSize,
317
- name: {
318
- color: e.value.style.chart.tooltip.color
319
- }
320
- },
321
- gutter: {
322
- backgroundColor: "#CCCCCC",
323
- opacity: 30
324
- }
325
- }
326
- })), c = v({
327
- height: 312,
328
- width: 512
329
- }), m = v([]), H = v(null), E = v(!1);
330
- function ye(t) {
331
- E.value = !0, m.value.includes(t) ? (H.value = t, m.value = m.value.filter((a) => a !== t), setTimeout(() => {
332
- E.value = !1, H.value = null;
333
- }, 500)) : (m.value.push(t), setTimeout(() => {
334
- E.value = !1;
335
- }, 500)), _("selectLegend", B.value.filter((a, l) => !m.value.includes(l)).map((a) => ({
336
- name: a.name,
337
- color: a.color,
338
- proportion: a.totalProportion
339
- })));
340
- }
341
- function Re() {
342
- return B.value.map((t) => ({
343
- name: t.name,
344
- color: t.color,
345
- proportion: t.totalProportion
346
- }));
347
- }
348
- const $ = p(() => [null, void 0].includes(f.dataset.categories) ? (R({
349
- componentName: "VueUiRadar",
350
- type: "datasetAttribute",
351
- property: "categories ({ name: string; prefix?: string; suffix?: string}[])"
352
- }), []) : (f.dataset.categories.length === 0 ? R({
353
- componentName: "VueUiRadar",
354
- type: "datasetAttributeEmpty",
355
- property: "categories"
356
- }) : f.dataset.categories.forEach((t, a) => {
357
- he({
358
- datasetObject: t,
359
- requiredAttributes: ["name"]
360
- }).forEach((l) => {
361
- R({
362
- componentName: "VueUiRadar",
363
- type: "datasetAttribute",
364
- property: `category.${l} at index ${a}`,
365
- index: a
366
- });
367
- });
368
- }), [null, void 0].includes(f.dataset.series) ? R({
369
- componentName: "VueUiRadar",
370
- type: "datasetAttribute",
371
- property: "series ({ name: string; values: number[]; color?: string; target: number}[])"
372
- }) : f.dataset.series.forEach((t, a) => {
373
- he({
374
- datasetObject: t,
375
- requiredAttributes: ["name", "values", "target"]
376
- }).forEach((l) => {
377
- R({
378
- componentName: "VueUiRadar",
379
- type: "datasetSerieAttribute",
380
- key: "series",
381
- property: l,
382
- index: a
383
- });
384
- });
385
- }), f.dataset.categories.map((t, a) => ({
386
- name: t.name,
387
- categoryId: `radar_category_${o.value}_${a}`,
388
- color: pe(t.color) || q.value[a] || S[a] || S[a % S.length],
389
- prefix: t.prefix ?? "",
390
- suffix: t.suffix ?? ""
391
- })))), A = p(() => I.value ? f.dataset.series.map((t, a) => ({
392
- ...t,
393
- color: pe(t.color) || q.value[a] || S[a] || S[a % S.length],
394
- serieId: `radar_serie_${o.value}_${a}`
395
- })) : []), fe = p(() => Math.max(...A.value.flatMap((t) => t.values))), me = p(() => A.value.length), ie = p(() => Math.min(c.value.width, c.value.height) / 3), be = p(() => xe({
396
- plot: { x: c.value.width / 2, y: c.value.height / 2 },
397
- radius: ie.value,
398
- sides: me.value,
399
- rotation: 0
400
- })), Ue = p(() => {
401
- const t = [];
402
- for (let a = 0; a < ie.value; a += ie.value / e.value.style.chart.layout.grid.graduations)
403
- t.push(a);
404
- return t;
405
- }), L = p(() => be.value.coordinates.map((t, a) => {
406
- const l = A.value[a].values.map((s) => De({
407
- centerX: c.value.width / 2,
408
- centerY: c.value.height / 2,
409
- apexX: t.x,
410
- apexY: t.y,
411
- proportion: s / (A.value[a].target || fe.value)
412
- }));
413
- return {
414
- ...t,
415
- ...A.value[a],
416
- plots: l
417
- };
418
- }));
419
- function de({ x: t, y: a }) {
420
- let l = "middle";
421
- return t = Math.round(t), a = Math.round(a), t > c.value.width / 2 && (t += 12, l = "start"), t < c.value.width / 2 && (t -= 12, l = "end"), a > c.value.height / 2 && (a += 20), a < c.value.height / 2 && (a -= 12), a === c.value.height / 2 && (a += 4), { x: t, y: a, anchor: l };
422
- }
423
- function De({ centerX: t, centerY: a, apexX: l, apexY: s, proportion: d }) {
424
- return {
425
- x: t + (l - t) * d,
426
- y: a + (s - a) * d
427
- };
428
- }
429
- const B = p(() => {
430
- const t = A.value.map((a, l) => a.values.map((s) => s / (a.target || fe.value)));
431
- return $.value.map((a, l) => ({
432
- ...a,
433
- totalProportion: t.map((s) => s[l]).reduce((s, d) => s + d, 0) / A.value.length,
434
- shape: "circle",
435
- opacity: m.value.includes(l) ? 0.5 : 1,
436
- segregate: () => ye(l),
437
- isSegregated: m.value.includes(l)
438
- }));
439
- }), Ve = p(() => ({
440
- cy: "radar-div-legend",
441
- backgroundColor: e.value.style.chart.legend.backgroundColor,
442
- color: e.value.style.chart.legend.color,
443
- fontSize: e.value.style.chart.legend.fontSize,
444
- paddingBottom: 12,
445
- fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
446
- })), ae = p(() => {
447
- const t = [
448
- { name: e.value.translations.datapoint, color: "" },
449
- { name: e.value.translations.target, color: "" },
450
- ...B.value
451
- ], a = f.dataset.series.map((s) => [
452
- s.name,
453
- s.target,
454
- ...s.values.map((d, b) => `${G({ p: $.value[b].prefix, v: d, s: $.value[b].suffix, r: e.value.table.td.roundingValue })} (${isNaN(d / s.target) ? "" : (d / s.target * 100).toFixed(e.value.table.td.roundingPercentage)}%)`)
455
- ]), l = {
456
- th: {
457
- backgroundColor: e.value.table.th.backgroundColor,
458
- color: e.value.table.th.color,
459
- outline: e.value.table.th.outline
460
- },
461
- td: {
462
- backgroundColor: e.value.table.td.backgroundColor,
463
- color: e.value.table.td.color,
464
- outline: e.value.table.td.outline
465
- },
466
- breakpoint: e.value.table.responsiveBreakpoint
467
- };
468
- return { head: t, body: a, config: l, colNames: t };
469
- }), le = v(null), ce = v([]), ve = v(null);
470
- function Ee(t, a) {
471
- ce.value = [], le.value = a, z.value = !0;
472
- let l = "";
473
- ve.value = {
474
- datapoint: t,
475
- seriesIndex: a,
476
- series: {
477
- categories: $.value,
478
- datapoints: A.value,
479
- radar: L.value
480
- },
481
- config: e.value
482
- };
483
- const s = e.value.style.chart.tooltip.customFormat;
484
- if (Ye(s) && Je(() => s({
485
- seriesIndex: a,
486
- datapoint: t,
487
- series: { categories: $.value, datapoints: A.value, radar: L.value },
488
- config: e.value
489
- })))
490
- C.value = s({
491
- seriesIndex: a,
492
- datapoint: t,
493
- series: { categories: $.value, datapoints: A.value, radar: L.value },
494
- config: e.value
495
- });
496
- else {
497
- l += `<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>`;
498
- for (let d = 0; d < t.values.length; d += 1)
499
- m.value.includes(d) || ce.value.push({
500
- name: $.value[d].name,
501
- value: t.values[d] / t.target * 100,
502
- color: $.value[d].color,
503
- suffix: "%)",
504
- prefix: `${G({ p: $.value[d].prefix ?? "", v: t.values[d], s: $.value[d].suffix ?? "", r: e.value.style.chart.tooltip.roundingValue })} (`,
505
- rounding: e.value.style.chart.tooltip.roundingPercentage
506
- });
507
- C.value = l;
508
- }
509
- }
510
- function ke() {
511
- Xe(() => {
512
- const t = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], a = [[""], [e.value.translations.target], ...B.value.flatMap((b) => [[b.name], ["%"]])], l = f.dataset.series.map((b, Mt) => [b.name, b.target, ...b.values.flatMap((ge) => [
513
- ge,
514
- isNaN(ge / b.target) ? "" : ge / b.target * 100
515
- ])]), s = t.concat([a]).concat(l), d = Ke(s);
516
- Qe({ csvContent: d, title: e.value.style.chart.title.text || "vue-ui-radar" });
517
- });
518
- }
519
- const Y = v(!1);
520
- function Be(t) {
521
- Y.value = t, ee.value += 1;
522
- }
523
- function Ce() {
524
- h.value.showTable = !h.value.showTable;
525
- }
526
- function _e() {
527
- h.value.showTooltip = !h.value.showTooltip;
528
- }
529
- return ue({
530
- getData: Re,
531
- generatePdf: i,
532
- generateCsv: ke,
533
- generateImage: O,
534
- toggleTable: Ce,
535
- toggleTooltip: _e
536
- }), (t, a) => (u(), n("div", {
537
- class: J(`vue-ui-radar ${Y.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
538
- ref_key: "radarChart",
539
- ref: U,
540
- id: `vue-ui-radar_${o.value}`,
541
- style: P(`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}`)
542
- }, [
543
- e.value.style.chart.title.text ? (u(), n("div", {
544
- key: 0,
545
- ref_key: "chartTitle",
546
- ref: te,
547
- style: P(`width:100%;background:${e.value.style.chart.backgroundColor};padding-bottom:12px`)
548
- }, [
549
- oe(tt, {
550
- config: {
551
- title: {
552
- cy: "radar-div-title",
553
- ...e.value.style.chart.title
554
- },
555
- subtitle: {
556
- cy: "radar-div-subtitle",
557
- ...e.value.style.chart.title.subtitle
558
- }
559
- }
560
- }, null, 8, ["config"])
561
- ], 4)) : y("", !0),
562
- e.value.userOptions.show && I.value ? (u(), K(at, {
563
- ref_key: "details",
564
- ref: ne,
565
- key: `user_options_${ee.value}`,
566
- backgroundColor: e.value.style.chart.backgroundColor,
567
- color: e.value.style.chart.color,
568
- isImaging: g(x),
569
- isPrinting: g(r),
570
- uid: o.value,
571
- hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
572
- hasPdf: e.value.userOptions.buttons.pdf,
573
- hasImg: e.value.userOptions.buttons.img,
574
- hasXls: e.value.userOptions.buttons.csv,
575
- hasTable: e.value.userOptions.buttons.table,
576
- hasFullscreen: e.value.userOptions.buttons.fullscreen,
577
- isFullscreen: Y.value,
578
- isTooltip: h.value.showTooltip,
579
- titles: { ...e.value.userOptions.buttonTitles },
580
- chartElement: U.value,
581
- onToggleFullscreen: Be,
582
- onGeneratePdf: g(i),
583
- onGenerateCsv: ke,
584
- onGenerateImage: g(O),
585
- onToggleTable: Ce,
586
- onToggleTooltip: _e
587
- }, je({ _: 2 }, [
588
- t.$slots.optionTooltip ? {
589
- name: "optionTooltip",
590
- fn: w(() => [
591
- T(t.$slots, "optionTooltip", {}, void 0, !0)
592
- ]),
593
- key: "0"
594
- } : void 0,
595
- t.$slots.optionPdf ? {
596
- name: "optionPdf",
597
- fn: w(() => [
598
- T(t.$slots, "optionPdf", {}, void 0, !0)
599
- ]),
600
- key: "1"
601
- } : void 0,
602
- t.$slots.optionCsv ? {
603
- name: "optionCsv",
604
- fn: w(() => [
605
- T(t.$slots, "optionCsv", {}, void 0, !0)
606
- ]),
607
- key: "2"
608
- } : void 0,
609
- t.$slots.optionImg ? {
610
- name: "optionImg",
611
- fn: w(() => [
612
- T(t.$slots, "optionImg", {}, void 0, !0)
613
- ]),
614
- key: "3"
615
- } : void 0,
616
- t.$slots.optionTable ? {
617
- name: "optionTable",
618
- fn: w(() => [
619
- T(t.$slots, "optionTable", {}, void 0, !0)
620
- ]),
621
- key: "4"
622
- } : void 0,
623
- t.$slots.optionFullscreen ? {
624
- name: "optionFullscreen",
625
- fn: w(({ toggleFullscreen: l, isFullscreen: s }) => [
626
- T(t.$slots, "optionFullscreen", Q(re({ toggleFullscreen: l, isFullscreen: s })), void 0, !0)
627
- ]),
628
- key: "5"
629
- } : void 0
630
- ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : y("", !0),
631
- I.value ? (u(), n("svg", {
632
- key: 2,
633
- xmlns: g(Ae),
634
- class: J({ "vue-data-ui-fullscreen--on": Y.value, "vue-data-ui-fulscreen--off": !Y.value }),
635
- viewBox: `0 0 ${c.value.width <= 0 ? 10 : c.value.width} ${c.value.height <= 0 ? 10 : c.value.height}`,
636
- style: P(`max-width:100%;overflow:visible;background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color}`)
637
- }, [
638
- k("defs", null, [
639
- (u(!0), n(N, null, M($.value, (l, s) => (u(), n("radialGradient", {
640
- cx: "50%",
641
- cy: "50%",
642
- r: "50%",
643
- fx: "50%",
644
- fy: "50%",
645
- id: `radar_gradient_${o.value}_${s}`
646
- }, [
647
- k("stop", {
648
- offset: "0%",
649
- "stop-color": `${g(Ne)(l.color, 0.05)}${g(W)[e.value.style.chart.layout.dataPolygon.opacity]}`
650
- }, null, 8, bt),
651
- k("stop", {
652
- offset: "100%",
653
- "stop-color": l.color + g(W)[e.value.style.chart.layout.dataPolygon.opacity]
654
- }, null, 8, kt)
655
- ], 8, mt))), 256))
656
- ]),
657
- e.value.style.chart.layout.grid.show ? (u(), n("g", Ct, [
658
- (u(!0), n(N, null, M(L.value, (l) => (u(), n("line", {
659
- x1: c.value.width / 2,
660
- y1: c.value.height / 2,
661
- x2: l.x,
662
- y2: l.y,
663
- stroke: e.value.style.chart.layout.grid.stroke,
664
- "stroke-width": e.value.style.chart.layout.grid.strokeWidth
665
- }, null, 8, _t))), 256)),
666
- e.value.style.chart.layout.grid.graduations > 0 ? (u(), n("g", $t, [
667
- (u(!0), n(N, null, M(Ue.value, (l) => (u(), n("path", {
668
- d: g(xe)({
669
- plot: { x: c.value.width / 2, y: c.value.height / 2 },
670
- radius: l,
671
- sides: me.value,
672
- rotation: 0
673
- }).path,
674
- fill: "none",
675
- stroke: e.value.style.chart.layout.grid.stroke,
676
- "stroke-width": e.value.style.chart.layout.grid.strokeWidth
677
- }, null, 8, xt))), 256))
678
- ])) : y("", !0)
679
- ])) : y("", !0),
680
- k("path", {
681
- d: be.value.path,
682
- fill: "none",
683
- stroke: e.value.style.chart.layout.outerPolygon.stroke,
684
- "stroke-width": e.value.style.chart.layout.outerPolygon.strokeWidth,
685
- "stroke-linejoin": "round",
686
- "stroke-linecap": "round"
687
- }, null, 8, wt),
688
- e.value.style.chart.layout.labels.dataLabels.show ? (u(), n("g", Tt, [
689
- (u(!0), n(N, null, M(L.value, (l, s) => (u(), n("text", {
690
- x: de(l).x,
691
- y: de(l).y,
692
- "text-anchor": de(l).anchor,
693
- "font-size": e.value.style.chart.layout.labels.dataLabels.fontSize,
694
- fill: e.value.style.chart.layout.labels.dataLabels.color,
695
- onMouseenter: (d) => Ee(l, s),
696
- onMouseleave: a[0] || (a[0] = (d) => {
697
- z.value = !1, le.value = null;
698
- })
699
- }, F(l.name), 41, Pt))), 256))
700
- ])) : y("", !0),
701
- (u(!0), n(N, null, M($.value, (l, s) => (u(), n("g", null, [
702
- k("g", null, [
703
- e.value.useCssAnimation || !e.value.useCssAnimation && !m.value.includes(s) ? (u(), n("polygon", {
704
- key: 0,
705
- "data-cy-radar-path": "",
706
- points: g(we)(L.value.map((d) => d.plots[s]), !1, !0),
707
- stroke: e.value.style.chart.backgroundColor,
708
- "stroke-width": e.value.style.chart.layout.dataPolygon.strokeWidth + 1,
709
- fill: "none",
710
- class: J({ "animated-out": m.value.includes(s) && e.value.useCssAnimation, "animated-in": E.value && H.value === s && e.value.useCssAnimation })
711
- }, null, 10, St)) : y("", !0),
712
- e.value.useCssAnimation || !e.value.useCssAnimation && !m.value.includes(s) ? (u(), n("polygon", {
713
- key: 1,
714
- "data-cy-radar-path": "",
715
- points: g(we)(L.value.map((d) => d.plots[s]), !1, !0),
716
- stroke: l.color,
717
- "stroke-width": e.value.style.chart.layout.dataPolygon.strokeWidth,
718
- fill: e.value.style.chart.layout.dataPolygon.transparent ? "transparent" : e.value.style.chart.layout.dataPolygon.useGradient ? `url(#radar_gradient_${o.value}_${s})` : l.color + g(W)[e.value.style.chart.layout.dataPolygon.opacity],
719
- class: J({ "animated-out": m.value.includes(s) && e.value.useCssAnimation, "animated-in": E.value && H.value === s && e.value.useCssAnimation })
720
- }, null, 10, Ft)) : y("", !0)
721
- ])
722
- ]))), 256)),
723
- e.value.style.chart.layout.plots.show ? (u(), n("g", Ot, [
724
- (u(!0), n(N, null, M(L.value, (l, s) => (u(), n("g", null, [
725
- (u(!0), n(N, null, M(l.plots, (d, b) => (u(), n("circle", {
726
- cx: d.x,
727
- cy: d.y,
728
- fill: m.value.includes(b) ? "transparent" : $.value[b].color,
729
- r: le.value !== null && le.value === s ? e.value.style.chart.layout.plots.radius * 1.6 : e.value.style.chart.layout.plots.radius,
730
- stroke: m.value.includes(b) ? "transparent" : e.value.style.chart.backgroundColor,
731
- "stroke-width": 0.5,
732
- class: J({ "animated-out": m.value.includes(b) && e.value.useCssAnimation, "animated-in": E.value && H.value === b && e.value.useCssAnimation })
733
- }, null, 10, At))), 256))
734
- ]))), 256))
735
- ])) : y("", !0),
736
- T(t.$slots, "svg", { svg: c.value }, void 0, !0)
737
- ], 14, ft)) : y("", !0),
738
- I.value ? y("", !0) : (u(), K(Le, {
739
- key: 3,
740
- config: {
741
- type: "radar",
742
- style: {
743
- backgroundColor: e.value.style.chart.backgroundColor,
744
- radar: {
745
- grid: {
746
- color: e.value.style.chart.layout.outerPolygon.stroke
747
- },
748
- shapes: {
749
- color: e.value.style.chart.layout.outerPolygon.stroke
750
- }
751
- }
752
- }
753
- }
754
- }, null, 8, ["config"])),
755
- k("div", {
756
- ref_key: "chartLegend",
757
- ref: X
758
- }, [
759
- e.value.style.chart.legend.show ? (u(), K(st, {
760
- key: 0,
761
- legendSet: B.value,
762
- config: Ve.value,
763
- onClickMarker: a[1] || (a[1] = ({ i: l }) => ye(l))
764
- }, {
765
- item: w(({ legend: l, index: s }) => [
766
- k("div", {
767
- "data-cy-legend-item": "",
768
- onClick: (d) => l.segregate(),
769
- style: P(`opacity:${m.value.includes(s) ? 0.5 : 1}`)
770
- }, F(l.name) + ": " + F((l.totalProportion * 100).toFixed(e.value.style.chart.legend.roundingPercentage)) + "% ", 13, Nt)
771
- ]),
772
- _: 1
773
- }, 8, ["legendSet", "config"])) : T(t.$slots, "legend", {
774
- key: 1,
775
- legend: B.value
776
- }, void 0, !0)
777
- ], 512),
778
- oe(lt, {
779
- show: h.value.showTooltip && z.value,
780
- backgroundColor: e.value.style.chart.tooltip.backgroundColor,
781
- color: e.value.style.chart.tooltip.color,
782
- borderRadius: e.value.style.chart.tooltip.borderRadius,
783
- borderColor: e.value.style.chart.tooltip.borderColor,
784
- borderWidth: e.value.style.chart.tooltip.borderWidth,
785
- backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
786
- fontSize: e.value.style.chart.tooltip.fontSize,
787
- parent: U.value,
788
- content: C.value,
789
- isCustom: e.value.style.chart.tooltip.customFormat && typeof e.value.style.chart.tooltip.customFormat == "function"
790
- }, {
791
- "tooltip-before": w(() => [
792
- T(t.$slots, "tooltip-before", Q(re({ ...ve.value })), void 0, !0)
793
- ]),
794
- "tooltip-after": w(() => [
795
- ["function"].includes(typeof e.value.style.chart.tooltip.customFormat) ? y("", !0) : (u(), n("div", It, [
796
- oe(Me, {
797
- dataset: ce.value,
798
- config: V.value,
799
- backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity
800
- }, null, 8, ["dataset", "config", "backgroundOpacity"])
801
- ])),
802
- T(t.$slots, "tooltip-after", Q(re({ ...ve.value })), void 0, !0)
803
- ]),
804
- _: 3
805
- }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "fontSize", "parent", "content", "isCustom"]),
806
- I.value ? (u(), K(rt, {
807
- key: 4,
808
- hideDetails: "",
809
- config: {
810
- open: h.value.showTable,
811
- maxHeight: 1e4,
812
- body: {
813
- backgroundColor: e.value.style.chart.backgroundColor,
814
- color: e.value.style.chart.color
815
- },
816
- head: {
817
- backgroundColor: e.value.style.chart.backgroundColor,
818
- color: e.value.style.chart.color
819
- }
820
- }
821
- }, {
822
- content: w(() => [
823
- oe(He, {
824
- colNames: ae.value.colNames,
825
- head: ae.value.head,
826
- body: ae.value.body,
827
- config: ae.value.config,
828
- title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
829
- onClose: a[2] || (a[2] = (l) => h.value.showTable = !1)
830
- }, {
831
- th: w(({ th: l }) => [
832
- $e(F(l.name), 1)
833
- ]),
834
- td: w(({ td: l }) => [
835
- $e(F(l), 1)
836
- ]),
837
- _: 1
838
- }, 8, ["colNames", "head", "body", "config", "title"])
839
- ]),
840
- _: 1
841
- }, 8, ["config"])) : y("", !0)
842
- ], 14, yt));
843
- }
844
- }, Lt = /* @__PURE__ */ qe(zt, [["__scopeId", "data-v-f89a8c0a"]]), qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
845
- __proto__: null,
846
- default: Lt
847
- }, Symbol.toStringTag, { value: "Module" }));
848
- export {
849
- Me as _,
850
- Xt as a,
851
- qt as b,
852
- Lt as v
853
- };