nemesischart 2.0.1 → 2.0.3
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.
- package/dist/nemesischart.js +568 -554
- package/dist/nemesischart.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/nemesischart.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { Chart as $t, Title as zt, Tooltip as Ft, Legend as Tt, Filler as Lt, LineController as Vt, LineElement as
|
|
3
|
-
const
|
|
1
|
+
import { ref as tt, shallowRef as Et, onMounted as qt, onBeforeUnmount as Rt, watch as vt, openBlock as l, createElementBlock as n, normalizeStyle as u, createElementVNode as p, computed as R, unref as o, normalizeClass as at, renderSlot as k, createTextVNode as j, toDisplayString as x, createCommentVNode as i, createVNode as ct, Fragment as ft, renderList as gt } from "vue";
|
|
2
|
+
import { Chart as $t, Title as zt, Tooltip as Ft, Legend as Tt, Filler as Lt, LineController as Vt, LineElement as jt, PointElement as Nt, BarController as Ht, BarElement as _t, PieController as Mt, PolarAreaController as Dt, ArcElement as Pt, CategoryScale as Ot, LinearScale as It, RadialLinearScale as Wt } from "chart.js";
|
|
3
|
+
const et = (t, y) => {
|
|
4
4
|
const a = t.__vccOpts || t;
|
|
5
5
|
for (const [d, e] of y)
|
|
6
6
|
a[d] = e;
|
|
@@ -22,76 +22,76 @@ const Z = (t, y) => {
|
|
|
22
22
|
Tt,
|
|
23
23
|
Lt,
|
|
24
24
|
Vt,
|
|
25
|
+
jt,
|
|
25
26
|
Nt,
|
|
26
|
-
|
|
27
|
+
Ht,
|
|
27
28
|
_t,
|
|
28
29
|
Mt,
|
|
29
|
-
|
|
30
|
+
Dt,
|
|
30
31
|
Pt,
|
|
31
32
|
Ot,
|
|
32
33
|
It,
|
|
33
|
-
Wt
|
|
34
|
-
jt
|
|
34
|
+
Wt
|
|
35
35
|
);
|
|
36
|
-
const a = t, d =
|
|
36
|
+
const a = t, d = tt(null), e = Et(null), w = {
|
|
37
37
|
responsive: !0,
|
|
38
38
|
maintainAspectRatio: !1,
|
|
39
39
|
plugins: {
|
|
40
40
|
legend: { position: "top" }
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
function
|
|
44
|
-
return { ...
|
|
43
|
+
function v() {
|
|
44
|
+
return { ...w, ...a.options };
|
|
45
45
|
}
|
|
46
46
|
function z() {
|
|
47
47
|
d.value && (e.value = new $t(d.value, {
|
|
48
48
|
type: a.type,
|
|
49
49
|
data: a.data,
|
|
50
|
-
options:
|
|
50
|
+
options: v(),
|
|
51
51
|
plugins: a.plugins
|
|
52
52
|
}));
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function D() {
|
|
55
55
|
e.value && (e.value.destroy(), e.value = null);
|
|
56
56
|
}
|
|
57
|
-
return qt(z), Rt(
|
|
57
|
+
return qt(z), Rt(D), vt(
|
|
58
58
|
() => a.data,
|
|
59
|
-
(
|
|
59
|
+
(O) => {
|
|
60
60
|
if (!e.value) return;
|
|
61
|
-
e.value.data.labels =
|
|
62
|
-
const
|
|
63
|
-
|
|
61
|
+
e.value.data.labels = O.labels;
|
|
62
|
+
const E = e.value.data.datasets, T = O.datasets;
|
|
63
|
+
E.length !== T.length ? e.value.data.datasets = T : T.forEach((I, W) => Object.assign(E[W], I)), e.value.update();
|
|
64
64
|
},
|
|
65
65
|
{ deep: !0 }
|
|
66
|
-
),
|
|
66
|
+
), vt(
|
|
67
67
|
() => a.options,
|
|
68
68
|
() => {
|
|
69
|
-
e.value && (e.value.options =
|
|
69
|
+
e.value && (e.value.options = v(), e.value.update());
|
|
70
70
|
},
|
|
71
71
|
{ deep: !0 }
|
|
72
|
-
), y({ chart: e }), (
|
|
73
|
-
class: "nc-chart-wrapper",
|
|
72
|
+
), y({ chart: e }), (O, E) => (l(), n("div", {
|
|
73
|
+
class: "nc-chart-wrapper w-full",
|
|
74
74
|
style: u({
|
|
75
75
|
height: typeof t.height == "number" ? `${t.height}px` : t.height,
|
|
76
76
|
width: t.width ? typeof t.width == "number" ? `${t.width}px` : t.width : "100%"
|
|
77
77
|
})
|
|
78
78
|
}, [
|
|
79
|
-
|
|
79
|
+
p("canvas", {
|
|
80
80
|
ref_key: "canvasRef",
|
|
81
81
|
ref: d
|
|
82
82
|
}, null, 512)
|
|
83
83
|
], 4));
|
|
84
84
|
}
|
|
85
|
-
},
|
|
85
|
+
}, ot = /* @__PURE__ */ et(Xt, [["__scopeId", "data-v-9828990e"]]), Yt = {
|
|
86
86
|
light: { bg: "#ffffff", text: "#000000", muted: "#64748B", grid: "rgba(15,23,42,0.06)" },
|
|
87
87
|
dark: { bg: "#000000", text: "#ffffff", muted: "#94A3B8", grid: "rgba(255,255,255,0.08)" },
|
|
88
88
|
transparent: { bg: "transparent", text: "inherit", muted: "#94A3B8", grid: "rgba(127,127,127,0.15)" }
|
|
89
89
|
};
|
|
90
|
-
function
|
|
90
|
+
function V(t, y) {
|
|
91
91
|
if (!t) return `rgba(59,130,246,${y})`;
|
|
92
92
|
if (t.startsWith("#")) {
|
|
93
|
-
const a = t.replace("#", ""), d = a.length === 3 ? a.split("").map((z) => z + z).join("") : a, e = parseInt(d.slice(0, 2), 16),
|
|
94
|
-
return `rgba(${e},${
|
|
93
|
+
const a = t.replace("#", ""), d = a.length === 3 ? a.split("").map((z) => z + z).join("") : a, e = parseInt(d.slice(0, 2), 16), w = parseInt(d.slice(2, 4), 16), v = parseInt(d.slice(4, 6), 16);
|
|
94
|
+
return `rgba(${e},${w},${v},${y})`;
|
|
95
95
|
}
|
|
96
96
|
if (t.startsWith("rgb")) {
|
|
97
97
|
const a = t.match(/[\d.]+/g);
|
|
@@ -99,9 +99,9 @@ function L(t, y) {
|
|
|
99
99
|
}
|
|
100
100
|
return t;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function rt(t) {
|
|
103
103
|
const y = R(() => {
|
|
104
|
-
const d =
|
|
104
|
+
const d = Yt[t.tema], e = d ? { ...d, bg: t.corFundo || d.bg } : { bg: t.corFundo || t.tema, text: "#F8FAFC", muted: "#94A3B8", grid: "rgba(255,255,255,0.08)" };
|
|
105
105
|
return {
|
|
106
106
|
...e,
|
|
107
107
|
text: t.corTexto || e.text,
|
|
@@ -114,7 +114,7 @@ function ot(t) {
|
|
|
114
114
|
boxShadow: t.sombra,
|
|
115
115
|
border: t.corBorda ? `1px solid ${t.corBorda}` : "none"
|
|
116
116
|
}));
|
|
117
|
-
return { palette: y, cardStyle: a, toRgba:
|
|
117
|
+
return { palette: y, cardStyle: a, toRgba: V };
|
|
118
118
|
}
|
|
119
119
|
function ut(t) {
|
|
120
120
|
const y = R(() => t.tipoValor === "moeda" ? new Intl.NumberFormat(t.locale, { style: "currency", currency: t.moeda }) : t.tipoValor === "percentual" ? new Intl.NumberFormat(t.locale, { style: "percent", maximumFractionDigits: 2 }) : new Intl.NumberFormat(t.locale, { maximumFractionDigits: 2 }));
|
|
@@ -125,7 +125,7 @@ function ut(t) {
|
|
|
125
125
|
}
|
|
126
126
|
return { formatador: y, formatar: a };
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function pt(t, { caretFlexivel: y = !1 } = {}) {
|
|
129
129
|
let a = t.querySelector(".nc-tt");
|
|
130
130
|
if (a) return a;
|
|
131
131
|
a = document.createElement("div"), a.className = "nc-tt", Object.assign(a.style, {
|
|
@@ -161,8 +161,8 @@ function ft(t, { caretFlexivel: y = !1 } = {}) {
|
|
|
161
161
|
borderRight: "1px solid rgba(15,23,42,.06)",
|
|
162
162
|
borderBottom: "1px solid rgba(15,23,42,.06)"
|
|
163
163
|
}), a.appendChild(d);
|
|
164
|
-
const
|
|
165
|
-
return
|
|
164
|
+
const w = document.createElement("div");
|
|
165
|
+
return w.className = "nc-tt__content", Object.assign(w.style, { position: "relative", background: "#fff", borderRadius: "8px" }), a.appendChild(w), t.appendChild(a), a;
|
|
166
166
|
}
|
|
167
167
|
function it(t) {
|
|
168
168
|
const y = t.canvas.parentNode;
|
|
@@ -176,73 +176,73 @@ function St(t, y) {
|
|
|
176
176
|
const a = window.getComputedStyle(t);
|
|
177
177
|
let d = "";
|
|
178
178
|
for (let e = 0; e < a.length; e++) {
|
|
179
|
-
const
|
|
180
|
-
let
|
|
181
|
-
if (
|
|
182
|
-
if (
|
|
183
|
-
|
|
179
|
+
const w = a[e];
|
|
180
|
+
let v = a.getPropertyValue(w);
|
|
181
|
+
if (v && v.indexOf("url(") !== -1 && !/url\(["']?data:/.test(v))
|
|
182
|
+
if (w === "background-image" || w === "background" || w === "mask-image" || w === "border-image" || w === "border-image-source")
|
|
183
|
+
v = "none";
|
|
184
184
|
else
|
|
185
185
|
continue;
|
|
186
|
-
d += `${
|
|
186
|
+
d += `${w}:${v};`;
|
|
187
187
|
}
|
|
188
188
|
y.setAttribute("style", d);
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function Jt(t, y) {
|
|
191
191
|
St(t, y);
|
|
192
192
|
const a = t.querySelectorAll("*"), d = y.querySelectorAll("*");
|
|
193
193
|
for (let e = 0; e < a.length; e++)
|
|
194
194
|
d[e] && St(a[e], d[e]);
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Qt(t, y) {
|
|
197
197
|
const a = t.querySelectorAll("canvas"), d = y.querySelectorAll("canvas");
|
|
198
|
-
a.forEach((e,
|
|
199
|
-
if (!d[
|
|
200
|
-
const
|
|
198
|
+
a.forEach((e, w) => {
|
|
199
|
+
if (!d[w]) return;
|
|
200
|
+
const v = document.createElement("img");
|
|
201
201
|
try {
|
|
202
|
-
|
|
202
|
+
v.src = e.toDataURL("image/png");
|
|
203
203
|
} catch {
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
206
|
const z = e.getBoundingClientRect();
|
|
207
|
-
|
|
207
|
+
v.setAttribute("style", `width:${z.width}px;height:${z.height}px;display:block;`), d[w].replaceWith(v);
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
|
-
async function
|
|
210
|
+
async function lt(t, y = {}) {
|
|
211
211
|
if (!t) return;
|
|
212
212
|
const {
|
|
213
213
|
nomeArquivo: a = "componente.png",
|
|
214
214
|
escala: d = 2,
|
|
215
215
|
corFundo: e = null
|
|
216
|
-
} = y,
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
await new Promise((
|
|
220
|
-
|
|
216
|
+
} = y, w = t.getBoundingClientRect(), v = Math.ceil(w.width), z = Math.ceil(w.height), D = t.cloneNode(!0);
|
|
217
|
+
Jt(t, D), Qt(t, D), D.style.margin = "0", D.style.transform = "none";
|
|
218
|
+
const O = new XMLSerializer().serializeToString(D), E = `<svg xmlns="http://www.w3.org/2000/svg" width="${v}" height="${z}"><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="width:${v}px;height:${z}px;">` + O + "</div></foreignObject></svg>", I = "data:image/svg+xml;base64," + (typeof window < "u" && window.btoa ? window.btoa(unescape(encodeURIComponent(E))) : ""), W = new Image();
|
|
219
|
+
await new Promise((B, S) => {
|
|
220
|
+
W.onload = B, W.onerror = S, W.src = I;
|
|
221
221
|
});
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
const
|
|
225
|
-
|
|
222
|
+
const Q = document.createElement("canvas");
|
|
223
|
+
Q.width = v * d, Q.height = z * d;
|
|
224
|
+
const m = Q.getContext("2d");
|
|
225
|
+
m.scale(d, d), e && (m.fillStyle = e, m.fillRect(0, 0, v, z)), m.drawImage(W, 0, 0);
|
|
226
226
|
let r;
|
|
227
227
|
try {
|
|
228
|
-
r =
|
|
229
|
-
} catch (
|
|
230
|
-
console.error("Falha ao exportar imagem: canvas contaminado.",
|
|
228
|
+
r = Q.toDataURL("image/png");
|
|
229
|
+
} catch (B) {
|
|
230
|
+
console.error("Falha ao exportar imagem: canvas contaminado.", B);
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
233
|
const $ = document.createElement("a");
|
|
234
234
|
$.download = a, $.href = r, document.body.appendChild($), $.click(), document.body.removeChild($);
|
|
235
235
|
}
|
|
236
|
-
const
|
|
236
|
+
const nt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>', Ut = { class: "card-linhas__header flex flex-column" }, Gt = { class: "card-linhas__topo flex align-items-start justify-content-between gap-3" }, Zt = {
|
|
237
237
|
key: 0,
|
|
238
|
-
class: "card-linhas__legendas"
|
|
238
|
+
class: "card-linhas__legendas flex flex-column"
|
|
239
239
|
}, Kt = {
|
|
240
240
|
key: 1,
|
|
241
|
-
class: "card-linhas__actions"
|
|
241
|
+
class: "card-linhas__actions inline-flex align-items-center gap-2"
|
|
242
242
|
}, te = ["innerHTML"], ee = {
|
|
243
243
|
key: 0,
|
|
244
|
-
class: "card-linhas__titulos mt-3 mb-2"
|
|
245
|
-
}, ae = { class: "card-linhas__chart" }, oe = {
|
|
244
|
+
class: "card-linhas__titulos mt-3 mb-2 flex flex-column"
|
|
245
|
+
}, ae = { class: "card-linhas__chart flex-1" }, oe = {
|
|
246
246
|
key: 0,
|
|
247
247
|
class: "card-linhas__footer mt-3"
|
|
248
248
|
}, re = {
|
|
@@ -296,27 +296,27 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
296
296
|
},
|
|
297
297
|
emits: ["botaoAcao", "exportado"],
|
|
298
298
|
setup(t, { emit: y }) {
|
|
299
|
-
const a = t, d = y, { palette: e, cardStyle:
|
|
300
|
-
async function
|
|
301
|
-
await
|
|
299
|
+
const a = t, d = y, { palette: e, cardStyle: w } = rt(a), { formatar: v } = ut(a), z = tt(null), D = nt;
|
|
300
|
+
async function O() {
|
|
301
|
+
await lt(z.value, {
|
|
302
302
|
nomeArquivo: a.nomeArquivoExport,
|
|
303
303
|
corFundo: e.value.bg !== "transparent" ? e.value.bg : null
|
|
304
304
|
}), d("exportado");
|
|
305
305
|
}
|
|
306
|
-
const
|
|
307
|
-
labels: a.data.map((
|
|
306
|
+
const E = R(() => `card-linhas--${a.direcao}`), T = R(() => ({
|
|
307
|
+
labels: a.data.map((m) => m.rotulo),
|
|
308
308
|
datasets: [
|
|
309
309
|
{
|
|
310
|
-
data: a.data.map((
|
|
310
|
+
data: a.data.map((m) => m.quantidade),
|
|
311
311
|
borderColor: a.corDetalhes,
|
|
312
312
|
borderWidth: 3,
|
|
313
313
|
borderJoinStyle: "round",
|
|
314
314
|
borderCapStyle: "round",
|
|
315
|
-
backgroundColor: (
|
|
316
|
-
const { chart: r } =
|
|
317
|
-
if (!
|
|
318
|
-
const
|
|
319
|
-
return N.addColorStop(0.16,
|
|
315
|
+
backgroundColor: (m) => {
|
|
316
|
+
const { chart: r } = m, { ctx: $, chartArea: B } = r;
|
|
317
|
+
if (!B) return "transparent";
|
|
318
|
+
const S = a.corDetalhes || "#0400FF", c = "#7C7C7C", N = $.createLinearGradient(0, B.top, 0, B.bottom);
|
|
319
|
+
return N.addColorStop(0.16, V(S, 0.2)), N.addColorStop(1, V(c, 0)), N;
|
|
320
320
|
},
|
|
321
321
|
fill: !0,
|
|
322
322
|
tension: 0.45,
|
|
@@ -329,49 +329,63 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
329
329
|
}
|
|
330
330
|
]
|
|
331
331
|
}));
|
|
332
|
-
function
|
|
333
|
-
const { chart: r, tooltip: $ } =
|
|
334
|
-
if (!
|
|
335
|
-
const
|
|
332
|
+
function I(m) {
|
|
333
|
+
const { chart: r, tooltip: $ } = m, B = it(r);
|
|
334
|
+
if (!B) return;
|
|
335
|
+
const S = pt(B);
|
|
336
336
|
if ($.opacity === 0) {
|
|
337
|
-
|
|
337
|
+
S.style.opacity = "0";
|
|
338
338
|
return;
|
|
339
339
|
}
|
|
340
|
-
const c = $.title || [], N = ($.body || []).flatMap((
|
|
341
|
-
F.innerHTML = `<div style="font-size:9px;font-weight:500;color:#94A3B8;letter-spacing:.04em;text-transform:uppercase;line-height:1;margin-bottom:4px;">${c.join(" ")}</div><div style="display:flex;align-items:center;gap:6px;"><span style="width:6px;height:6px;border-radius:999px;background:${
|
|
342
|
-
const { offsetLeft:
|
|
343
|
-
|
|
344
|
-
const s =
|
|
345
|
-
let
|
|
346
|
-
|
|
347
|
-
|
|
340
|
+
const c = $.title || [], N = ($.body || []).flatMap((Z) => Z.lines), F = S.querySelector(".nc-tt__content"), U = a.corDetalhes || "#3B82F6";
|
|
341
|
+
F.innerHTML = `<div style="font-size:9px;font-weight:500;color:#94A3B8;letter-spacing:.04em;text-transform:uppercase;line-height:1;margin-bottom:4px;">${c.join(" ")}</div><div style="display:flex;align-items:center;gap:6px;"><span style="width:6px;height:6px;border-radius:999px;background:${U};box-shadow:0 0 0 2px ${V(U, 0.15)};flex:0 0 auto;"></span><span style="font-size:12px;font-weight:700;color:#0F172A;letter-spacing:-.01em;line-height:1.1;">${N.join(" ")}</span></div>`;
|
|
342
|
+
const { offsetLeft: f, offsetTop: b } = r.canvas;
|
|
343
|
+
S.style.opacity = "1", S.style.visibility = "hidden", S.style.left = "0px", S.style.top = "0px";
|
|
344
|
+
const s = S.offsetWidth, h = S.offsetHeight, g = 4, L = f + $.caretX, C = b + $.caretY, q = dt(L, s, B.clientWidth, g), A = h + 16 + g, X = C < A;
|
|
345
|
+
let K;
|
|
346
|
+
X ? (S.style.transform = "translateX(-50%) translateY(16px)", K = C) : (S.style.transform = "translate(-50%, calc(-100% - 16px))", K = C), S.style.left = q + "px", S.style.top = K + "px";
|
|
347
|
+
const M = S.querySelector(".nc-tt__caret");
|
|
348
|
+
if (M) {
|
|
349
|
+
const Z = L - q, G = s / 2, P = Math.max(-G + 8, Math.min(G - 8, Z));
|
|
350
|
+
M.style.left = `calc(50% + ${P}px)`, X ? (M.style.bottom = "", M.style.top = "-5px", M.style.borderRight = "", M.style.borderBottom = "", M.style.borderLeft = "1px solid rgba(15,23,42,.06)", M.style.borderTop = "1px solid rgba(15,23,42,.06)") : (M.style.top = "", M.style.bottom = "-5px", M.style.borderLeft = "", M.style.borderTop = "", M.style.borderRight = "1px solid rgba(15,23,42,.06)", M.style.borderBottom = "1px solid rgba(15,23,42,.06)");
|
|
351
|
+
}
|
|
352
|
+
S.style.visibility = "visible";
|
|
348
353
|
}
|
|
349
|
-
const
|
|
354
|
+
const W = R(() => ({
|
|
350
355
|
responsive: !0,
|
|
351
356
|
maintainAspectRatio: !1,
|
|
352
357
|
interaction: { intersect: !1, mode: "index" },
|
|
353
358
|
layout: {
|
|
354
|
-
padding: { top:
|
|
359
|
+
padding: { top: 0, right: 0, bottom: 0, left: 0 }
|
|
355
360
|
},
|
|
356
361
|
plugins: {
|
|
357
362
|
legend: { display: !1 },
|
|
358
363
|
tooltip: {
|
|
359
364
|
enabled: !1,
|
|
360
|
-
external:
|
|
365
|
+
external: I,
|
|
361
366
|
callbacks: {
|
|
362
|
-
title: (
|
|
367
|
+
title: (m) => {
|
|
363
368
|
var r;
|
|
364
|
-
return ((r =
|
|
369
|
+
return ((r = m[0]) == null ? void 0 : r.label) ?? "";
|
|
365
370
|
},
|
|
366
|
-
label: (
|
|
371
|
+
label: (m) => v(m.parsed.y)
|
|
367
372
|
}
|
|
368
373
|
}
|
|
369
374
|
},
|
|
370
375
|
scales: {
|
|
371
376
|
x: {
|
|
377
|
+
display: !0,
|
|
378
|
+
afterFit: (m) => {
|
|
379
|
+
m.paddingLeft = 0, m.paddingRight = 0;
|
|
380
|
+
},
|
|
372
381
|
grid: { display: !1, drawBorder: !1 },
|
|
373
382
|
border: { display: !1 },
|
|
374
|
-
ticks: {
|
|
383
|
+
ticks: {
|
|
384
|
+
color: e.value.muted,
|
|
385
|
+
font: { size: 10, family: "'Inter', sans-serif" },
|
|
386
|
+
padding: 8,
|
|
387
|
+
align: "inner"
|
|
388
|
+
}
|
|
375
389
|
},
|
|
376
390
|
y: {
|
|
377
391
|
display: !1,
|
|
@@ -380,107 +394,107 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
380
394
|
}
|
|
381
395
|
}
|
|
382
396
|
}));
|
|
383
|
-
function
|
|
397
|
+
function Q() {
|
|
384
398
|
d("botaoAcao");
|
|
385
399
|
}
|
|
386
|
-
return (
|
|
400
|
+
return (m, r) => (l(), n("div", {
|
|
387
401
|
ref_key: "cardRef",
|
|
388
402
|
ref: z,
|
|
389
|
-
class:
|
|
390
|
-
style: u(o(
|
|
403
|
+
class: at(["card-linhas p-4 flex", E.value]),
|
|
404
|
+
style: u(o(w))
|
|
391
405
|
}, [
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
406
|
+
p("div", Ut, [
|
|
407
|
+
p("div", Gt, [
|
|
408
|
+
m.$slots.legenda || t.legenda || m.$slots.sublegenda || t.sublegenda ? (l(), n("div", Zt, [
|
|
409
|
+
m.$slots.legenda || t.legenda ? (l(), n("div", {
|
|
396
410
|
key: 0,
|
|
397
|
-
class: "text-
|
|
411
|
+
class: "text-xs font-medium",
|
|
398
412
|
style: u({ color: o(e).text, opacity: 0.85 })
|
|
399
413
|
}, [
|
|
400
|
-
|
|
401
|
-
|
|
414
|
+
k(m.$slots, "legenda", {}, () => [
|
|
415
|
+
j(x(t.legenda), 1)
|
|
402
416
|
], !0)
|
|
403
417
|
], 4)) : i("", !0),
|
|
404
|
-
|
|
418
|
+
m.$slots.sublegenda || t.sublegenda ? (l(), n("div", {
|
|
405
419
|
key: 1,
|
|
406
420
|
class: "text-xs",
|
|
407
421
|
style: u({ color: o(e).muted })
|
|
408
422
|
}, [
|
|
409
|
-
|
|
410
|
-
|
|
423
|
+
k(m.$slots, "sublegenda", {}, () => [
|
|
424
|
+
j(x(t.sublegenda), 1)
|
|
411
425
|
], !0)
|
|
412
426
|
], 4)) : i("", !0)
|
|
413
427
|
])) : i("", !0),
|
|
414
|
-
|
|
415
|
-
|
|
428
|
+
m.$slots.actions || t.botaoVisivel || t.exportar ? (l(), n("div", Kt, [
|
|
429
|
+
k(m.$slots, "actions", {}, () => [
|
|
416
430
|
t.botaoVisivel ? (l(), n("button", {
|
|
417
431
|
key: 0,
|
|
418
|
-
class: "card-linhas__btn",
|
|
419
|
-
style: u({ color: o(e).text, borderColor: o(
|
|
420
|
-
onClick:
|
|
432
|
+
class: "card-linhas__btn inline-flex align-items-center",
|
|
433
|
+
style: u({ color: o(e).text, borderColor: o(V)(o(e).text, 0.18) }),
|
|
434
|
+
onClick: Q
|
|
421
435
|
}, [
|
|
422
|
-
|
|
436
|
+
p("span", null, x(t.textoBotao), 1)
|
|
423
437
|
], 4)) : i("", !0)
|
|
424
438
|
], !0),
|
|
425
439
|
t.exportar ? (l(), n("button", {
|
|
426
440
|
key: 0,
|
|
427
441
|
type: "button",
|
|
428
|
-
class: "card-linhas__exportar",
|
|
429
|
-
style: u({ color: o(e).muted, borderColor: o(
|
|
442
|
+
class: "card-linhas__exportar inline-flex align-items-center justify-content-center",
|
|
443
|
+
style: u({ color: o(e).muted, borderColor: o(V)(o(e).text, 0.18) }),
|
|
430
444
|
title: "Exportar como imagem",
|
|
431
445
|
"aria-label": "Exportar como imagem",
|
|
432
|
-
onClick:
|
|
433
|
-
innerHTML: o(
|
|
446
|
+
onClick: O,
|
|
447
|
+
innerHTML: o(D)
|
|
434
448
|
}, null, 12, te)) : i("", !0)
|
|
435
449
|
])) : i("", !0)
|
|
436
450
|
]),
|
|
437
|
-
|
|
438
|
-
|
|
451
|
+
m.$slots.titulo || t.titulo || m.$slots.descricao || t.descricao ? (l(), n("div", ee, [
|
|
452
|
+
m.$slots.titulo || t.titulo ? (l(), n("div", {
|
|
439
453
|
key: 0,
|
|
440
|
-
class: "text-
|
|
441
|
-
style: u({ color: o(e).text })
|
|
454
|
+
class: "m-0 text-3xl font-semibold",
|
|
455
|
+
style: u({ color: o(e).text, lineHeight: "33px", letterSpacing: "-1px" })
|
|
442
456
|
}, [
|
|
443
|
-
|
|
444
|
-
|
|
457
|
+
k(m.$slots, "titulo", {}, () => [
|
|
458
|
+
j(x(t.titulo), 1)
|
|
445
459
|
], !0)
|
|
446
460
|
], 4)) : i("", !0),
|
|
447
|
-
|
|
461
|
+
m.$slots.descricao || t.descricao ? (l(), n("div", {
|
|
448
462
|
key: 1,
|
|
449
463
|
class: "text-sm mt-1",
|
|
450
464
|
style: u({ color: o(e).muted })
|
|
451
465
|
}, [
|
|
452
|
-
|
|
453
|
-
|
|
466
|
+
k(m.$slots, "descricao", {}, () => [
|
|
467
|
+
j(x(t.descricao), 1)
|
|
454
468
|
], !0)
|
|
455
469
|
], 4)) : i("", !0)
|
|
456
470
|
])) : i("", !0)
|
|
457
471
|
]),
|
|
458
|
-
|
|
459
|
-
ct(
|
|
472
|
+
p("div", ae, [
|
|
473
|
+
ct(ot, {
|
|
460
474
|
type: "line",
|
|
461
475
|
data: T.value,
|
|
462
|
-
options:
|
|
476
|
+
options: W.value,
|
|
463
477
|
height: t.height
|
|
464
478
|
}, null, 8, ["data", "options", "height"])
|
|
465
479
|
]),
|
|
466
|
-
|
|
467
|
-
|
|
480
|
+
m.$slots.footer ? (l(), n("div", oe, [
|
|
481
|
+
k(m.$slots, "footer", {}, void 0, !0)
|
|
468
482
|
])) : i("", !0)
|
|
469
483
|
], 6));
|
|
470
484
|
}
|
|
471
|
-
}, le = /* @__PURE__ */
|
|
485
|
+
}, le = /* @__PURE__ */ et(re, [["__scopeId", "data-v-2ab2b571"]]), ne = { class: "card-pizza__topo flex align-items-start justify-content-between gap-3" }, se = {
|
|
472
486
|
key: 0,
|
|
473
|
-
class: "card-pizza__legendas"
|
|
487
|
+
class: "card-pizza__legendas flex flex-column"
|
|
474
488
|
}, ie = {
|
|
475
489
|
key: 1,
|
|
476
|
-
class: "card-pizza__actions"
|
|
477
|
-
}, de = ["innerHTML"], ce = { class: "card-pizza__corpo" }, ue = { class: "card-pizza__tabela" },
|
|
490
|
+
class: "card-pizza__actions inline-flex align-items-center gap-2"
|
|
491
|
+
}, de = ["innerHTML"], ce = { class: "card-pizza__corpo flex align-items-center gap-4" }, ue = { class: "card-pizza__tabela flex flex-column" }, fe = { class: "card-pizza__tabela-valor" }, pe = { class: "card-pizza__tabela-rotulo inline-flex align-items-center gap-2" }, ge = { class: "card-pizza__tabela-valor" }, ye = { class: "card-pizza__chart-wrap flex align-items-center justify-content-center" }, me = { class: "card-pizza__chart" }, be = {
|
|
478
492
|
key: 0,
|
|
479
|
-
class: "card-pizza__centro"
|
|
493
|
+
class: "card-pizza__centro flex flex-column align-items-center justify-content-center"
|
|
480
494
|
}, he = {
|
|
481
495
|
key: 0,
|
|
482
496
|
class: "card-pizza__footer mt-3"
|
|
483
|
-
},
|
|
497
|
+
}, xe = {
|
|
484
498
|
__name: "CardPizza",
|
|
485
499
|
props: {
|
|
486
500
|
legenda: { type: String, default: null },
|
|
@@ -533,21 +547,21 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
533
547
|
},
|
|
534
548
|
emits: ["botaoAcao", "exportado"],
|
|
535
549
|
setup(t, { emit: y }) {
|
|
536
|
-
const a = t, d = y, { palette: e, cardStyle:
|
|
537
|
-
async function
|
|
538
|
-
await
|
|
550
|
+
const a = t, d = y, { palette: e, cardStyle: w } = rt(a), { formatar: v } = ut(a), z = tt(null);
|
|
551
|
+
async function D() {
|
|
552
|
+
await lt(z.value, {
|
|
539
553
|
nomeArquivo: a.nomeArquivoExport,
|
|
540
554
|
corFundo: e.value.bg !== "transparent" ? e.value.bg : null
|
|
541
555
|
}), d("exportado");
|
|
542
556
|
}
|
|
543
|
-
const
|
|
557
|
+
const O = R(() => `card-pizza--${a.direcao}`), E = R(
|
|
544
558
|
() => a.data.map((r, $) => a.cores[$ % a.cores.length])
|
|
545
559
|
), T = R(() => ({
|
|
546
560
|
labels: a.data.map((r) => r.rotulo),
|
|
547
561
|
datasets: [
|
|
548
562
|
{
|
|
549
563
|
data: a.data.map((r) => r.quantidade),
|
|
550
|
-
backgroundColor:
|
|
564
|
+
backgroundColor: E.value,
|
|
551
565
|
borderWidth: 0,
|
|
552
566
|
borderColor: "transparent",
|
|
553
567
|
hoverOffset: 6,
|
|
@@ -556,24 +570,24 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
556
570
|
}
|
|
557
571
|
]
|
|
558
572
|
}));
|
|
559
|
-
function
|
|
560
|
-
const { chart: $, tooltip:
|
|
561
|
-
if (!
|
|
562
|
-
const c =
|
|
563
|
-
if (
|
|
573
|
+
function I(r) {
|
|
574
|
+
const { chart: $, tooltip: B } = r, S = it($);
|
|
575
|
+
if (!S) return;
|
|
576
|
+
const c = pt(S);
|
|
577
|
+
if (B.opacity === 0) {
|
|
564
578
|
c.style.opacity = "0";
|
|
565
579
|
return;
|
|
566
580
|
}
|
|
567
|
-
const N =
|
|
568
|
-
|
|
569
|
-
const { offsetLeft: s, offsetTop:
|
|
581
|
+
const N = B.title || [], F = B.dataPoints && B.dataPoints[0], U = F ? E.value[F.dataIndex] : "#3B82F6", f = F ? v(F.parsed) : "", b = c.querySelector(".nc-tt__content");
|
|
582
|
+
b.innerHTML = `<div style="font-size:9px;font-weight:500;color:#94A3B8;letter-spacing:.04em;text-transform:uppercase;line-height:1;margin-bottom:4px;">${N.join(" ")}</div><div style="display:flex;align-items:center;gap:6px;"><span style="width:6px;height:6px;border-radius:999px;background:${U};box-shadow:0 0 0 2px ${V(U, 0.15)};flex:0 0 auto;"></span><span style="font-size:12px;font-weight:700;color:#0F172A;letter-spacing:-.01em;line-height:1.1;">${f}</span></div>`;
|
|
583
|
+
const { offsetLeft: s, offsetTop: h } = $.canvas;
|
|
570
584
|
c.style.opacity = "1", c.style.visibility = "hidden", c.style.left = "0px", c.style.top = "0px";
|
|
571
|
-
const g = c.offsetWidth,
|
|
572
|
-
let
|
|
573
|
-
const
|
|
574
|
-
|
|
585
|
+
const g = c.offsetWidth, L = c.offsetHeight, C = 4, q = dt(s + B.caretX, g, S.clientWidth, C);
|
|
586
|
+
let A = h + B.caretY;
|
|
587
|
+
const X = L + 16 + C;
|
|
588
|
+
A < X && (A = X), c.style.left = q + "px", c.style.top = A + "px", c.style.visibility = "visible";
|
|
575
589
|
}
|
|
576
|
-
const
|
|
590
|
+
const W = R(() => ({
|
|
577
591
|
responsive: !0,
|
|
578
592
|
maintainAspectRatio: !1,
|
|
579
593
|
cutout: a.cutout,
|
|
@@ -582,36 +596,36 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
582
596
|
legend: { display: !1 },
|
|
583
597
|
tooltip: {
|
|
584
598
|
enabled: !1,
|
|
585
|
-
external:
|
|
599
|
+
external: I,
|
|
586
600
|
callbacks: {
|
|
587
601
|
title: (r) => {
|
|
588
602
|
var $;
|
|
589
603
|
return (($ = r[0]) == null ? void 0 : $.label) ?? "";
|
|
590
604
|
},
|
|
591
|
-
label: (r) =>
|
|
605
|
+
label: (r) => v(r.parsed)
|
|
592
606
|
}
|
|
593
607
|
}
|
|
594
608
|
}
|
|
595
609
|
}));
|
|
596
|
-
function
|
|
610
|
+
function Q() {
|
|
597
611
|
d("botaoAcao");
|
|
598
612
|
}
|
|
599
|
-
const
|
|
613
|
+
const m = nt;
|
|
600
614
|
return (r, $) => (l(), n("div", {
|
|
601
615
|
ref_key: "cardRef",
|
|
602
616
|
ref: z,
|
|
603
|
-
class:
|
|
604
|
-
style: u(o(
|
|
617
|
+
class: at(["card-pizza p-4 flex flex-column", O.value]),
|
|
618
|
+
style: u(o(w))
|
|
605
619
|
}, [
|
|
606
|
-
|
|
620
|
+
p("div", ne, [
|
|
607
621
|
r.$slots.legenda || t.legenda || r.$slots.sublegenda || t.sublegenda ? (l(), n("div", se, [
|
|
608
622
|
r.$slots.legenda || t.legenda ? (l(), n("div", {
|
|
609
623
|
key: 0,
|
|
610
|
-
class: "text-
|
|
624
|
+
class: "text-xs font-medium",
|
|
611
625
|
style: u({ color: o(e).text, opacity: 0.95 })
|
|
612
626
|
}, [
|
|
613
|
-
|
|
614
|
-
|
|
627
|
+
k(r.$slots, "legenda", {}, () => [
|
|
628
|
+
j(x(t.legenda), 1)
|
|
615
629
|
], !0)
|
|
616
630
|
], 4)) : i("", !0),
|
|
617
631
|
r.$slots.sublegenda || t.sublegenda ? (l(), n("div", {
|
|
@@ -619,75 +633,75 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
619
633
|
class: "text-xs",
|
|
620
634
|
style: u({ color: o(e).muted })
|
|
621
635
|
}, [
|
|
622
|
-
|
|
623
|
-
|
|
636
|
+
k(r.$slots, "sublegenda", {}, () => [
|
|
637
|
+
j(x(t.sublegenda), 1)
|
|
624
638
|
], !0)
|
|
625
639
|
], 4)) : i("", !0)
|
|
626
640
|
])) : i("", !0),
|
|
627
641
|
r.$slots.actions || t.botaoVisivel || t.exportar ? (l(), n("div", ie, [
|
|
628
|
-
|
|
642
|
+
k(r.$slots, "actions", {}, () => [
|
|
629
643
|
t.botaoVisivel ? (l(), n("button", {
|
|
630
644
|
key: 0,
|
|
631
|
-
class: "card-pizza__btn",
|
|
632
|
-
style: u({ color: o(e).text, borderColor: o(
|
|
633
|
-
onClick:
|
|
645
|
+
class: "card-pizza__btn inline-flex align-items-center",
|
|
646
|
+
style: u({ color: o(e).text, borderColor: o(V)(o(e).text, 0.18) }),
|
|
647
|
+
onClick: Q
|
|
634
648
|
}, [
|
|
635
|
-
|
|
649
|
+
p("span", null, x(t.textoBotao), 1)
|
|
636
650
|
], 4)) : i("", !0)
|
|
637
651
|
], !0),
|
|
638
652
|
t.exportar ? (l(), n("button", {
|
|
639
653
|
key: 0,
|
|
640
654
|
type: "button",
|
|
641
|
-
class: "card-pizza__exportar",
|
|
642
|
-
style: u({ color: o(e).muted, borderColor: o(
|
|
655
|
+
class: "card-pizza__exportar inline-flex align-items-center justify-content-center",
|
|
656
|
+
style: u({ color: o(e).muted, borderColor: o(V)(o(e).text, 0.18) }),
|
|
643
657
|
title: "Exportar como imagem",
|
|
644
658
|
"aria-label": "Exportar como imagem",
|
|
645
|
-
onClick:
|
|
646
|
-
innerHTML: o(
|
|
659
|
+
onClick: D,
|
|
660
|
+
innerHTML: o(m)
|
|
647
661
|
}, null, 12, de)) : i("", !0)
|
|
648
662
|
])) : i("", !0)
|
|
649
663
|
]),
|
|
650
|
-
|
|
651
|
-
|
|
664
|
+
p("div", ce, [
|
|
665
|
+
p("div", ue, [
|
|
652
666
|
t.mostrarCabecalho ? (l(), n("div", {
|
|
653
667
|
key: 0,
|
|
654
|
-
class: "card-pizza__tabela-cab",
|
|
655
|
-
style: u({ color: o(e).muted, borderColor: o(
|
|
668
|
+
class: "card-pizza__tabela-cab flex align-items-center justify-content-between",
|
|
669
|
+
style: u({ color: o(e).muted, borderColor: o(V)(o(e).muted, 0.25) })
|
|
656
670
|
}, [
|
|
657
|
-
|
|
658
|
-
|
|
671
|
+
p("span", null, x(t.rotuloCategoria), 1),
|
|
672
|
+
p("span", fe, x(t.rotuloQuantidade), 1)
|
|
659
673
|
], 4)) : i("", !0),
|
|
660
|
-
(l(!0), n(
|
|
661
|
-
key:
|
|
662
|
-
class: "card-pizza__tabela-linha",
|
|
674
|
+
(l(!0), n(ft, null, gt(t.data, (B, S) => (l(), n("div", {
|
|
675
|
+
key: S,
|
|
676
|
+
class: "card-pizza__tabela-linha flex align-items-center justify-content-between",
|
|
663
677
|
style: u({ color: o(e).text })
|
|
664
678
|
}, [
|
|
665
|
-
|
|
666
|
-
|
|
679
|
+
p("span", pe, [
|
|
680
|
+
p("span", {
|
|
667
681
|
class: "card-pizza__bolinha",
|
|
668
|
-
style: u({ background:
|
|
682
|
+
style: u({ background: E.value[S] })
|
|
669
683
|
}, null, 4),
|
|
670
|
-
|
|
684
|
+
p("span", null, x(B.rotulo), 1)
|
|
671
685
|
]),
|
|
672
|
-
|
|
686
|
+
p("span", ge, x(o(v)(B.quantidade)), 1)
|
|
673
687
|
], 4))), 128))
|
|
674
688
|
]),
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
ct(
|
|
689
|
+
p("div", ye, [
|
|
690
|
+
p("div", me, [
|
|
691
|
+
ct(ot, {
|
|
678
692
|
type: "doughnut",
|
|
679
693
|
data: T.value,
|
|
680
|
-
options:
|
|
694
|
+
options: W.value,
|
|
681
695
|
height: t.height
|
|
682
696
|
}, null, 8, ["data", "options", "height"]),
|
|
683
697
|
r.$slots.titulo || t.titulo || r.$slots.descricao || t.descricao ? (l(), n("div", be, [
|
|
684
698
|
r.$slots.titulo || t.titulo ? (l(), n("div", {
|
|
685
699
|
key: 0,
|
|
686
|
-
class: "card-pizza__centro-titulo",
|
|
700
|
+
class: "card-pizza__centro-titulo m-0 font-semibold",
|
|
687
701
|
style: u({ color: o(e).text })
|
|
688
702
|
}, [
|
|
689
|
-
|
|
690
|
-
|
|
703
|
+
k(r.$slots, "titulo", {}, () => [
|
|
704
|
+
j(x(t.titulo), 1)
|
|
691
705
|
], !0)
|
|
692
706
|
], 4)) : i("", !0),
|
|
693
707
|
r.$slots.descricao || t.descricao ? (l(), n("div", {
|
|
@@ -695,8 +709,8 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
695
709
|
class: "card-pizza__centro-desc",
|
|
696
710
|
style: u({ color: o(e).muted })
|
|
697
711
|
}, [
|
|
698
|
-
|
|
699
|
-
|
|
712
|
+
k(r.$slots, "descricao", {}, () => [
|
|
713
|
+
j(x(t.descricao), 1)
|
|
700
714
|
], !0)
|
|
701
715
|
], 4)) : i("", !0)
|
|
702
716
|
])) : i("", !0)
|
|
@@ -704,20 +718,20 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
704
718
|
])
|
|
705
719
|
]),
|
|
706
720
|
r.$slots.footer ? (l(), n("div", he, [
|
|
707
|
-
|
|
721
|
+
k(r.$slots, "footer", {}, void 0, !0)
|
|
708
722
|
])) : i("", !0)
|
|
709
723
|
], 6));
|
|
710
724
|
}
|
|
711
|
-
},
|
|
725
|
+
}, ve = /* @__PURE__ */ et(xe, [["__scopeId", "data-v-fd01f68b"]]), $e = { class: "card-barra__header flex flex-column" }, Se = { class: "card-barra__topo flex align-items-start justify-content-between gap-3" }, ke = {
|
|
712
726
|
key: 0,
|
|
713
|
-
class: "card-barra__legendas"
|
|
727
|
+
class: "card-barra__legendas flex flex-column"
|
|
714
728
|
}, Be = {
|
|
715
729
|
key: 1,
|
|
716
|
-
class: "card-barra__actions"
|
|
730
|
+
class: "card-barra__actions inline-flex align-items-center gap-2"
|
|
717
731
|
}, Ce = ["innerHTML"], Ae = {
|
|
718
732
|
key: 0,
|
|
719
|
-
class: "card-barra__titulos mt-3 mb-2"
|
|
720
|
-
},
|
|
733
|
+
class: "card-barra__titulos mt-3 mb-2 flex flex-column"
|
|
734
|
+
}, we = { class: "card-barra__chart flex-1" }, Ee = {
|
|
721
735
|
key: 0,
|
|
722
736
|
class: "card-barra__footer mt-3"
|
|
723
737
|
}, qe = {
|
|
@@ -786,61 +800,61 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
786
800
|
},
|
|
787
801
|
emits: ["botaoAcao", "exportado"],
|
|
788
802
|
setup(t, { emit: y }) {
|
|
789
|
-
const a = t, d = y, { palette: e, cardStyle:
|
|
790
|
-
async function
|
|
791
|
-
await
|
|
803
|
+
const a = t, d = y, { palette: e, cardStyle: w } = rt(a), { formatar: v } = ut(a), z = tt(null), D = nt;
|
|
804
|
+
async function O() {
|
|
805
|
+
await lt(z.value, {
|
|
792
806
|
nomeArquivo: a.nomeArquivoExport,
|
|
793
807
|
corFundo: e.value.bg !== "transparent" ? e.value.bg : null
|
|
794
808
|
}), d("exportado");
|
|
795
809
|
}
|
|
796
|
-
const
|
|
797
|
-
nome:
|
|
798
|
-
cor:
|
|
799
|
-
dados: Array.isArray(
|
|
800
|
-
})) : [{ nome: a.legenda || "Valores", cor: a.corDetalhes, dados: a.data }]),
|
|
801
|
-
const
|
|
802
|
-
return
|
|
803
|
-
}),
|
|
804
|
-
const
|
|
805
|
-
function
|
|
806
|
-
if (!a.empilhado ||
|
|
807
|
-
const q =
|
|
810
|
+
const E = R(() => `card-barra--${a.direcao}`), T = R(() => a.orientacao === "horizontal"), I = R(() => Array.isArray(a.series) && a.series.length > 0 ? a.series.map((f, b) => ({
|
|
811
|
+
nome: f.nome ?? `Série ${b + 1}`,
|
|
812
|
+
cor: f.cor || a.cores[b % a.cores.length],
|
|
813
|
+
dados: Array.isArray(f.dados) ? f.dados : []
|
|
814
|
+
})) : [{ nome: a.legenda || "Valores", cor: a.corDetalhes, dados: a.data }]), W = R(() => {
|
|
815
|
+
const f = I.value[0];
|
|
816
|
+
return f ? f.dados.map((b) => b.rotulo) : [];
|
|
817
|
+
}), Q = R(() => {
|
|
818
|
+
const f = I.value, b = f.length - 1, s = typeof a.larguraBarra == "number" ? a.larguraBarra : Number(a.larguraBarra) || 0.6, h = a.raioBarra, g = T.value;
|
|
819
|
+
function L(C) {
|
|
820
|
+
if (!a.empilhado || f.length === 1) return h;
|
|
821
|
+
const q = C === 0, A = C === b;
|
|
808
822
|
return g ? {
|
|
809
|
-
topLeft: q ?
|
|
810
|
-
bottomLeft: q ?
|
|
811
|
-
topRight:
|
|
812
|
-
bottomRight:
|
|
823
|
+
topLeft: q ? h : 0,
|
|
824
|
+
bottomLeft: q ? h : 0,
|
|
825
|
+
topRight: A ? h : 0,
|
|
826
|
+
bottomRight: A ? h : 0
|
|
813
827
|
} : {
|
|
814
|
-
bottomLeft: q ?
|
|
815
|
-
bottomRight: q ?
|
|
816
|
-
topLeft:
|
|
817
|
-
topRight:
|
|
828
|
+
bottomLeft: q ? h : 0,
|
|
829
|
+
bottomRight: q ? h : 0,
|
|
830
|
+
topLeft: A ? h : 0,
|
|
831
|
+
topRight: A ? h : 0
|
|
818
832
|
};
|
|
819
833
|
}
|
|
820
834
|
return {
|
|
821
|
-
labels:
|
|
822
|
-
datasets:
|
|
823
|
-
label:
|
|
824
|
-
data:
|
|
825
|
-
backgroundColor:
|
|
826
|
-
hoverBackgroundColor:
|
|
835
|
+
labels: W.value,
|
|
836
|
+
datasets: f.map((C, q) => ({
|
|
837
|
+
label: C.nome,
|
|
838
|
+
data: C.dados.map((A) => A.quantidade),
|
|
839
|
+
backgroundColor: C.cor,
|
|
840
|
+
hoverBackgroundColor: C.cor,
|
|
827
841
|
borderWidth: 0,
|
|
828
|
-
borderRadius:
|
|
842
|
+
borderRadius: L(q),
|
|
829
843
|
borderSkipped: !1,
|
|
830
844
|
categoryPercentage: 0.9,
|
|
831
845
|
barPercentage: s
|
|
832
846
|
}))
|
|
833
847
|
};
|
|
834
848
|
});
|
|
835
|
-
function
|
|
836
|
-
|
|
849
|
+
function m(f, b) {
|
|
850
|
+
b ? Object.assign(f.style, {
|
|
837
851
|
top: "-5px",
|
|
838
852
|
bottom: "auto",
|
|
839
853
|
borderTop: "1px solid rgba(15,23,42,.06)",
|
|
840
854
|
borderLeft: "1px solid rgba(15,23,42,.06)",
|
|
841
855
|
borderRight: "none",
|
|
842
856
|
borderBottom: "none"
|
|
843
|
-
}) : Object.assign(
|
|
857
|
+
}) : Object.assign(f.style, {
|
|
844
858
|
bottom: "-5px",
|
|
845
859
|
top: "auto",
|
|
846
860
|
borderRight: "1px solid rgba(15,23,42,.06)",
|
|
@@ -850,32 +864,32 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
850
864
|
});
|
|
851
865
|
}
|
|
852
866
|
let r = null;
|
|
853
|
-
function $(
|
|
854
|
-
const { chart:
|
|
855
|
-
if (!
|
|
856
|
-
const g =
|
|
867
|
+
function $(f) {
|
|
868
|
+
const { chart: b, tooltip: s } = f, h = it(b);
|
|
869
|
+
if (!h) return;
|
|
870
|
+
const g = pt(h, { caretFlexivel: !0 });
|
|
857
871
|
if (s.opacity === 0 || r) {
|
|
858
872
|
g.style.opacity = "0";
|
|
859
873
|
return;
|
|
860
874
|
}
|
|
861
|
-
const
|
|
862
|
-
var
|
|
863
|
-
const ht = ((
|
|
864
|
-
return `<div style="display:flex;align-items:center;gap:6px;margin-top:2px;"><span style="width:6px;height:6px;border-radius:999px;background:${ht};box-shadow:0 0 0 2px ${
|
|
875
|
+
const L = s.title || [], C = s.dataPoints || [], q = g.querySelector(".nc-tt__content"), A = C.map((st) => {
|
|
876
|
+
var xt;
|
|
877
|
+
const ht = ((xt = I.value[st.datasetIndex]) == null ? void 0 : xt.cor) || a.corDetalhes, At = v(T.value ? st.parsed.x : st.parsed.y), wt = st.dataset.label && I.value.length > 1 ? `<span style="font-size:11px;color:#64748B;margin-right:6px;">${st.dataset.label}</span>` : "";
|
|
878
|
+
return `<div style="display:flex;align-items:center;gap:6px;margin-top:2px;"><span style="width:6px;height:6px;border-radius:999px;background:${ht};box-shadow:0 0 0 2px ${V(ht, 0.15)};flex:0 0 auto;"></span>` + wt + `<span style="font-size:12px;font-weight:700;color:#0F172A;letter-spacing:-.01em;line-height:1.1;margin-left:auto;">${At}</span></div>`;
|
|
865
879
|
}).join("");
|
|
866
|
-
q.innerHTML = `<div style="font-size:9px;font-weight:500;color:#94A3B8;letter-spacing:.04em;text-transform:uppercase;line-height:1;margin-bottom:4px;">${
|
|
867
|
-
const { offsetLeft:
|
|
880
|
+
q.innerHTML = `<div style="font-size:9px;font-weight:500;color:#94A3B8;letter-spacing:.04em;text-transform:uppercase;line-height:1;margin-bottom:4px;">${L.join(" ")}</div>` + A;
|
|
881
|
+
const { offsetLeft: X, offsetTop: K } = b.canvas;
|
|
868
882
|
g.style.opacity = "1", g.style.visibility = "hidden", g.style.left = "0px", g.style.top = "0px";
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
const Bt =
|
|
872
|
-
bt.style.left = Ct + "px", g.style.left =
|
|
883
|
+
const M = g.offsetWidth, Z = g.offsetHeight, G = 4, P = X + s.caretX, J = K + s.caretY, Y = dt(P, M, h.clientWidth, G), H = M / 2, _ = 14, yt = J - _ - Z, mt = yt < G, kt = mt ? J + _ : yt, bt = g.querySelector(".nc-tt__caret");
|
|
884
|
+
m(bt, mt);
|
|
885
|
+
const Bt = P - (Y - H), Ct = Math.max(10, Math.min(M - 10, Bt));
|
|
886
|
+
bt.style.left = Ct + "px", g.style.left = Y + "px", g.style.top = kt + "px", g.style.visibility = "visible";
|
|
873
887
|
}
|
|
874
|
-
const
|
|
875
|
-
const
|
|
888
|
+
const B = R(() => {
|
|
889
|
+
const f = T.value, b = {
|
|
876
890
|
grid: { display: !1, drawBorder: !1 },
|
|
877
891
|
border: { display: !1 },
|
|
878
|
-
ticks: { color: e.value.muted, font: { size:
|
|
892
|
+
ticks: { color: e.value.muted, font: { size: 10, family: "'Inter', sans-serif" }, padding: 8 },
|
|
879
893
|
stacked: a.empilhado
|
|
880
894
|
}, s = {
|
|
881
895
|
display: !1,
|
|
@@ -886,19 +900,19 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
886
900
|
return {
|
|
887
901
|
responsive: !0,
|
|
888
902
|
maintainAspectRatio: !1,
|
|
889
|
-
indexAxis:
|
|
890
|
-
interaction: { intersect: !1, mode: "index", axis:
|
|
903
|
+
indexAxis: f ? "y" : "x",
|
|
904
|
+
interaction: { intersect: !1, mode: "index", axis: f ? "y" : "x" },
|
|
891
905
|
layout: {
|
|
892
906
|
padding: {
|
|
893
|
-
top: c.value.length && !
|
|
894
|
-
right:
|
|
907
|
+
top: c.value.length && !f ? 24 : 12,
|
|
908
|
+
right: f ? 12 : 0,
|
|
895
909
|
bottom: 0,
|
|
896
|
-
left: c.value.length &&
|
|
910
|
+
left: c.value.length && f ? 60 : 0
|
|
897
911
|
}
|
|
898
912
|
},
|
|
899
913
|
plugins: {
|
|
900
914
|
legend: {
|
|
901
|
-
display: a.mostrarLegendaSeries &&
|
|
915
|
+
display: a.mostrarLegendaSeries && I.value.length > 1,
|
|
902
916
|
position: "bottom",
|
|
903
917
|
align: "start",
|
|
904
918
|
labels: {
|
|
@@ -907,7 +921,7 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
907
921
|
boxHeight: 8,
|
|
908
922
|
usePointStyle: !0,
|
|
909
923
|
pointStyle: "circle",
|
|
910
|
-
font: { size:
|
|
924
|
+
font: { size: 10, family: "'Inter', sans-serif" },
|
|
911
925
|
padding: 12
|
|
912
926
|
}
|
|
913
927
|
},
|
|
@@ -915,91 +929,91 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
915
929
|
enabled: !1,
|
|
916
930
|
external: $,
|
|
917
931
|
callbacks: {
|
|
918
|
-
title: (
|
|
932
|
+
title: (h) => {
|
|
919
933
|
var g;
|
|
920
|
-
return ((g =
|
|
934
|
+
return ((g = h[0]) == null ? void 0 : g.label) ?? "";
|
|
921
935
|
},
|
|
922
|
-
label: (
|
|
936
|
+
label: (h) => v(f ? h.parsed.x : h.parsed.y)
|
|
923
937
|
}
|
|
924
938
|
}
|
|
925
939
|
},
|
|
926
940
|
scales: {
|
|
927
|
-
x:
|
|
928
|
-
y:
|
|
941
|
+
x: f ? s : b,
|
|
942
|
+
y: f ? b : s
|
|
929
943
|
}
|
|
930
944
|
};
|
|
931
945
|
});
|
|
932
|
-
function
|
|
946
|
+
function S() {
|
|
933
947
|
d("botaoAcao");
|
|
934
948
|
}
|
|
935
|
-
const c = R(() => a.linhasReferencia ? (Array.isArray(a.linhasReferencia) ? a.linhasReferencia : [a.linhasReferencia]).filter((
|
|
936
|
-
valor:
|
|
937
|
-
rotulo:
|
|
938
|
-
cor:
|
|
939
|
-
corRotulo:
|
|
940
|
-
corTexto:
|
|
941
|
-
tracejado:
|
|
942
|
-
espessura:
|
|
949
|
+
const c = R(() => a.linhasReferencia ? (Array.isArray(a.linhasReferencia) ? a.linhasReferencia : [a.linhasReferencia]).filter((b) => b && (typeof b == "number" || typeof b.valor == "number")).map((b) => typeof b == "number" ? { valor: b, rotulo: null, cor: "#0F172A", corRotulo: "#0F172A", corTexto: "#FFFFFF", tracejado: [6, 6], espessura: 1 } : {
|
|
950
|
+
valor: b.valor,
|
|
951
|
+
rotulo: b.rotulo ?? null,
|
|
952
|
+
cor: b.cor || "#0F172A",
|
|
953
|
+
corRotulo: b.corRotulo || b.cor || "#0F172A",
|
|
954
|
+
corTexto: b.corTexto || "#FFFFFF",
|
|
955
|
+
tracejado: b.tracejado || [6, 6],
|
|
956
|
+
espessura: b.espessura ?? 1
|
|
943
957
|
}) : []), N = [], F = {
|
|
944
958
|
id: "linhaReferencia",
|
|
945
|
-
afterDatasetsDraw(
|
|
946
|
-
const
|
|
947
|
-
if (N.length = 0, !
|
|
948
|
-
const { ctx: s, chartArea:
|
|
949
|
-
|
|
950
|
-
const
|
|
951
|
-
if (N.push({ linha: q, pos:
|
|
952
|
-
if (
|
|
959
|
+
afterDatasetsDraw(f) {
|
|
960
|
+
const b = c.value;
|
|
961
|
+
if (N.length = 0, !b.length) return;
|
|
962
|
+
const { ctx: s, chartArea: h, scales: g } = f, L = T.value, C = L ? g.x : g.y;
|
|
963
|
+
C && b.forEach((q) => {
|
|
964
|
+
const A = C.getPixelForValue(q.valor);
|
|
965
|
+
if (N.push({ linha: q, pos: A, horizontal: L, chartArea: h }), s.save(), s.beginPath(), s.setLineDash(q.tracejado), s.lineWidth = q.espessura, s.strokeStyle = q.cor, L) {
|
|
966
|
+
if (A < h.left || A > h.right) {
|
|
953
967
|
s.restore();
|
|
954
968
|
return;
|
|
955
969
|
}
|
|
956
|
-
s.moveTo(
|
|
970
|
+
s.moveTo(A, h.top), s.lineTo(A, h.bottom);
|
|
957
971
|
} else {
|
|
958
|
-
if (
|
|
972
|
+
if (A < h.top || A > h.bottom) {
|
|
959
973
|
s.restore();
|
|
960
974
|
return;
|
|
961
975
|
}
|
|
962
|
-
s.moveTo(
|
|
976
|
+
s.moveTo(h.left, A), s.lineTo(h.right, A);
|
|
963
977
|
}
|
|
964
978
|
if (s.stroke(), s.setLineDash([]), q.rotulo) {
|
|
965
979
|
s.font = "600 11px 'Inter', sans-serif";
|
|
966
|
-
const
|
|
967
|
-
let
|
|
968
|
-
|
|
980
|
+
const X = 8, K = 5, Z = s.measureText(q.rotulo).width, G = 12, P = Z + X * 2, J = G + K * 2, Y = J / 2;
|
|
981
|
+
let H, _;
|
|
982
|
+
L ? (H = A - P / 2, _ = h.top - J - 6, _ < 0 && (_ = h.top + 6)) : (H = h.left - P - 6, _ = A - J / 2, H < 0 && (H = h.left + 6)), s.fillStyle = q.corRotulo, s.beginPath(), s.roundRect ? s.roundRect(H, _, P, J, Y) : (s.moveTo(H + Y, _), s.lineTo(H + P - Y, _), s.quadraticCurveTo(H + P, _, H + P, _ + Y), s.lineTo(H + P, _ + J - Y), s.quadraticCurveTo(H + P, _ + J, H + P - Y, _ + J), s.lineTo(H + Y, _ + J), s.quadraticCurveTo(H, _ + J, H, _ + J - Y), s.lineTo(H, _ + Y), s.quadraticCurveTo(H, _, H + Y, _)), s.fill(), s.fillStyle = q.corTexto, s.textBaseline = "middle", s.textAlign = "center", s.fillText(q.rotulo, H + P / 2, _ + J / 2);
|
|
969
983
|
}
|
|
970
984
|
s.restore();
|
|
971
985
|
});
|
|
972
986
|
},
|
|
973
|
-
beforeEvent(
|
|
987
|
+
beforeEvent(f, b) {
|
|
974
988
|
if (!N.length) {
|
|
975
989
|
r = null;
|
|
976
990
|
return;
|
|
977
991
|
}
|
|
978
|
-
const s =
|
|
992
|
+
const s = b.event;
|
|
979
993
|
if (!s || s.type === "mouseout" || s.x == null || s.y == null) {
|
|
980
994
|
r = null;
|
|
981
995
|
return;
|
|
982
996
|
}
|
|
983
|
-
const
|
|
984
|
-
let g = null,
|
|
985
|
-
for (const
|
|
986
|
-
const q =
|
|
987
|
-
q <=
|
|
997
|
+
const h = 8;
|
|
998
|
+
let g = null, L = 1 / 0;
|
|
999
|
+
for (const C of N) {
|
|
1000
|
+
const q = C.horizontal ? Math.abs(s.x - C.pos) : Math.abs(s.y - C.pos), A = C.horizontal ? s.y >= C.chartArea.top && s.y <= C.chartArea.bottom : s.x >= C.chartArea.left && s.x <= C.chartArea.right;
|
|
1001
|
+
q <= h && A && q < L && (L = q, g = C);
|
|
988
1002
|
}
|
|
989
1003
|
r = g;
|
|
990
1004
|
},
|
|
991
|
-
afterEvent(
|
|
1005
|
+
afterEvent(f, b) {
|
|
992
1006
|
if (!N.length) return;
|
|
993
|
-
const s =
|
|
1007
|
+
const s = b.event;
|
|
994
1008
|
if (!s) return;
|
|
995
|
-
const
|
|
996
|
-
if (!
|
|
997
|
-
let g =
|
|
1009
|
+
const h = it(f);
|
|
1010
|
+
if (!h) return;
|
|
1011
|
+
let g = h.querySelector(".nc-tt-linhaRef");
|
|
998
1012
|
if (!r) {
|
|
999
1013
|
g && (g.style.opacity = "0");
|
|
1000
1014
|
return;
|
|
1001
1015
|
}
|
|
1002
|
-
const
|
|
1016
|
+
const L = r;
|
|
1003
1017
|
g || (g = document.createElement("div"), g.className = "nc-tt-linhaRef", Object.assign(g.style, {
|
|
1004
1018
|
position: "absolute",
|
|
1005
1019
|
pointerEvents: "none",
|
|
@@ -1015,119 +1029,119 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1015
1029
|
zIndex: "11",
|
|
1016
1030
|
fontFamily: "'Inter', sans-serif",
|
|
1017
1031
|
textAlign: "left"
|
|
1018
|
-
}),
|
|
1019
|
-
const
|
|
1020
|
-
g.innerHTML = (
|
|
1021
|
-
const
|
|
1032
|
+
}), h.appendChild(g));
|
|
1033
|
+
const C = L.linha.cor || "#0F172A", q = v(L.linha.valor), A = L.linha.rotulo;
|
|
1034
|
+
g.innerHTML = (A ? `<div style="font-size:9px;font-weight:500;color:#94A3B8;letter-spacing:.04em;text-transform:uppercase;line-height:1;margin-bottom:4px;">${A}</div>` : "") + `<div style="display:flex;align-items:center;gap:6px;"><span style="width:6px;height:6px;border-radius:999px;background:${C};box-shadow:0 0 0 2px ${V(C, 0.15)};flex:0 0 auto;"></span><span style="font-size:12px;font-weight:700;color:#0F172A;letter-spacing:-.01em;line-height:1.1;">${q}</span></div>`;
|
|
1035
|
+
const X = f.canvas;
|
|
1022
1036
|
g.style.opacity = "1", g.style.visibility = "hidden", g.style.left = "0px", g.style.top = "0px";
|
|
1023
|
-
const
|
|
1024
|
-
let
|
|
1025
|
-
|
|
1026
|
-
const
|
|
1027
|
-
let
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1037
|
+
const K = g.offsetWidth, M = g.offsetHeight, Z = 4;
|
|
1038
|
+
let G, P;
|
|
1039
|
+
L.horizontal ? (G = X.offsetLeft + L.pos, P = X.offsetTop + s.y) : (G = X.offsetLeft + s.x, P = X.offsetTop + L.pos);
|
|
1040
|
+
const J = dt(G, K, h.clientWidth, Z);
|
|
1041
|
+
let Y = P;
|
|
1042
|
+
const H = M + 16 + Z;
|
|
1043
|
+
Y < H && (Y = H), g.style.left = J + "px", g.style.top = Y + "px", g.style.visibility = "visible";
|
|
1030
1044
|
}
|
|
1031
|
-
},
|
|
1032
|
-
return (
|
|
1045
|
+
}, U = R(() => c.value.length ? [F] : []);
|
|
1046
|
+
return (f, b) => (l(), n("div", {
|
|
1033
1047
|
ref_key: "cardRef",
|
|
1034
1048
|
ref: z,
|
|
1035
|
-
class:
|
|
1036
|
-
style: u(o(
|
|
1049
|
+
class: at(["card-barra p-4 flex", E.value]),
|
|
1050
|
+
style: u(o(w))
|
|
1037
1051
|
}, [
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1052
|
+
p("div", $e, [
|
|
1053
|
+
p("div", Se, [
|
|
1054
|
+
f.$slots.legenda || t.legenda || f.$slots.sublegenda || t.sublegenda ? (l(), n("div", ke, [
|
|
1055
|
+
f.$slots.legenda || t.legenda ? (l(), n("div", {
|
|
1042
1056
|
key: 0,
|
|
1043
|
-
class: "text-
|
|
1057
|
+
class: "text-xs font-medium",
|
|
1044
1058
|
style: u({ color: o(e).text, opacity: 0.85 })
|
|
1045
1059
|
}, [
|
|
1046
|
-
|
|
1047
|
-
|
|
1060
|
+
k(f.$slots, "legenda", {}, () => [
|
|
1061
|
+
j(x(t.legenda), 1)
|
|
1048
1062
|
], !0)
|
|
1049
1063
|
], 4)) : i("", !0),
|
|
1050
|
-
|
|
1064
|
+
f.$slots.sublegenda || t.sublegenda ? (l(), n("div", {
|
|
1051
1065
|
key: 1,
|
|
1052
1066
|
class: "text-xs",
|
|
1053
1067
|
style: u({ color: o(e).muted })
|
|
1054
1068
|
}, [
|
|
1055
|
-
|
|
1056
|
-
|
|
1069
|
+
k(f.$slots, "sublegenda", {}, () => [
|
|
1070
|
+
j(x(t.sublegenda), 1)
|
|
1057
1071
|
], !0)
|
|
1058
1072
|
], 4)) : i("", !0)
|
|
1059
1073
|
])) : i("", !0),
|
|
1060
|
-
|
|
1061
|
-
|
|
1074
|
+
f.$slots.actions || t.botaoVisivel || t.exportar ? (l(), n("div", Be, [
|
|
1075
|
+
k(f.$slots, "actions", {}, () => [
|
|
1062
1076
|
t.botaoVisivel ? (l(), n("button", {
|
|
1063
1077
|
key: 0,
|
|
1064
|
-
class: "card-barra__btn",
|
|
1065
|
-
style: u({ color: o(e).text, borderColor: o(
|
|
1066
|
-
onClick:
|
|
1078
|
+
class: "card-barra__btn inline-flex align-items-center",
|
|
1079
|
+
style: u({ color: o(e).text, borderColor: o(V)(o(e).text, 0.18) }),
|
|
1080
|
+
onClick: S
|
|
1067
1081
|
}, [
|
|
1068
|
-
|
|
1082
|
+
p("span", null, x(t.textoBotao), 1)
|
|
1069
1083
|
], 4)) : i("", !0)
|
|
1070
1084
|
], !0),
|
|
1071
1085
|
t.exportar ? (l(), n("button", {
|
|
1072
1086
|
key: 0,
|
|
1073
1087
|
type: "button",
|
|
1074
|
-
class: "card-barra__exportar",
|
|
1075
|
-
style: u({ color: o(e).muted, borderColor: o(
|
|
1088
|
+
class: "card-barra__exportar inline-flex align-items-center justify-content-center",
|
|
1089
|
+
style: u({ color: o(e).muted, borderColor: o(V)(o(e).text, 0.18) }),
|
|
1076
1090
|
title: "Exportar como imagem",
|
|
1077
1091
|
"aria-label": "Exportar como imagem",
|
|
1078
|
-
onClick:
|
|
1079
|
-
innerHTML: o(
|
|
1092
|
+
onClick: O,
|
|
1093
|
+
innerHTML: o(D)
|
|
1080
1094
|
}, null, 12, Ce)) : i("", !0)
|
|
1081
1095
|
])) : i("", !0)
|
|
1082
1096
|
]),
|
|
1083
|
-
|
|
1084
|
-
|
|
1097
|
+
f.$slots.titulo || t.titulo || f.$slots.descricao || t.descricao ? (l(), n("div", Ae, [
|
|
1098
|
+
f.$slots.titulo || t.titulo ? (l(), n("div", {
|
|
1085
1099
|
key: 0,
|
|
1086
|
-
class: "text-
|
|
1087
|
-
style: u({ color: o(e).text })
|
|
1100
|
+
class: "m-0 text-3xl font-semibold",
|
|
1101
|
+
style: u({ color: o(e).text, lineHeight: "33px", letterSpacing: "-1px" })
|
|
1088
1102
|
}, [
|
|
1089
|
-
|
|
1090
|
-
|
|
1103
|
+
k(f.$slots, "titulo", {}, () => [
|
|
1104
|
+
j(x(t.titulo), 1)
|
|
1091
1105
|
], !0)
|
|
1092
1106
|
], 4)) : i("", !0),
|
|
1093
|
-
|
|
1107
|
+
f.$slots.descricao || t.descricao ? (l(), n("div", {
|
|
1094
1108
|
key: 1,
|
|
1095
1109
|
class: "text-sm mt-1",
|
|
1096
1110
|
style: u({ color: o(e).muted })
|
|
1097
1111
|
}, [
|
|
1098
|
-
|
|
1099
|
-
|
|
1112
|
+
k(f.$slots, "descricao", {}, () => [
|
|
1113
|
+
j(x(t.descricao), 1)
|
|
1100
1114
|
], !0)
|
|
1101
1115
|
], 4)) : i("", !0)
|
|
1102
1116
|
])) : i("", !0)
|
|
1103
1117
|
]),
|
|
1104
|
-
|
|
1105
|
-
ct(
|
|
1118
|
+
p("div", we, [
|
|
1119
|
+
ct(ot, {
|
|
1106
1120
|
type: "bar",
|
|
1107
|
-
data:
|
|
1108
|
-
options:
|
|
1109
|
-
plugins:
|
|
1121
|
+
data: Q.value,
|
|
1122
|
+
options: B.value,
|
|
1123
|
+
plugins: U.value,
|
|
1110
1124
|
height: t.height
|
|
1111
1125
|
}, null, 8, ["data", "options", "plugins", "height"])
|
|
1112
1126
|
]),
|
|
1113
|
-
|
|
1114
|
-
|
|
1127
|
+
f.$slots.footer ? (l(), n("div", Ee, [
|
|
1128
|
+
k(f.$slots, "footer", {}, void 0, !0)
|
|
1115
1129
|
])) : i("", !0)
|
|
1116
1130
|
], 6));
|
|
1117
1131
|
}
|
|
1118
|
-
}, Re = /* @__PURE__ */
|
|
1132
|
+
}, Re = /* @__PURE__ */ et(qe, [["__scopeId", "data-v-e1f47bcc"]]), ze = { class: "card-polar__topo flex align-items-start justify-content-between gap-3" }, Fe = {
|
|
1119
1133
|
key: 0,
|
|
1120
|
-
class: "card-polar__legendas"
|
|
1134
|
+
class: "card-polar__legendas flex flex-column"
|
|
1121
1135
|
}, Te = {
|
|
1122
1136
|
key: 1,
|
|
1123
|
-
class: "card-polar__actions"
|
|
1124
|
-
}, Le = ["innerHTML"], Ve = { class: "card-polar__corpo" },
|
|
1137
|
+
class: "card-polar__actions inline-flex align-items-center gap-2"
|
|
1138
|
+
}, Le = ["innerHTML"], Ve = { class: "card-polar__corpo flex align-items-center gap-4" }, je = { class: "card-polar__tabela flex flex-column" }, Ne = { class: "card-polar__tabela-valor" }, He = { class: "card-polar__tabela-rotulo inline-flex align-items-center gap-2" }, _e = { class: "card-polar__tabela-valor" }, Me = { class: "card-polar__chart-wrap flex align-items-center justify-content-center" }, De = { class: "card-polar__chart" }, Pe = {
|
|
1125
1139
|
key: 0,
|
|
1126
1140
|
class: "card-polar__centro-bottom"
|
|
1127
|
-
},
|
|
1141
|
+
}, Oe = {
|
|
1128
1142
|
key: 0,
|
|
1129
1143
|
class: "card-polar__footer mt-3"
|
|
1130
|
-
},
|
|
1144
|
+
}, Ie = {
|
|
1131
1145
|
__name: "CardPolar",
|
|
1132
1146
|
props: {
|
|
1133
1147
|
legenda: { type: String, default: null },
|
|
@@ -1180,16 +1194,16 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1180
1194
|
},
|
|
1181
1195
|
emits: ["botaoAcao", "exportado"],
|
|
1182
1196
|
setup(t, { emit: y }) {
|
|
1183
|
-
const a = t, d = y, { palette: e, cardStyle:
|
|
1184
|
-
async function
|
|
1185
|
-
await
|
|
1197
|
+
const a = t, d = y, { palette: e, cardStyle: w } = rt(a), { formatar: v } = ut(a), z = tt(null), D = nt;
|
|
1198
|
+
async function O() {
|
|
1199
|
+
await lt(z.value, {
|
|
1186
1200
|
nomeArquivo: a.nomeArquivoExport,
|
|
1187
1201
|
corFundo: e.value.bg !== "transparent" ? e.value.bg : null
|
|
1188
1202
|
}), d("exportado");
|
|
1189
1203
|
}
|
|
1190
|
-
const
|
|
1204
|
+
const E = R(() => `card-polar--${a.direcao}`), T = R(
|
|
1191
1205
|
() => a.data.map((r, $) => a.cores[$ % a.cores.length])
|
|
1192
|
-
),
|
|
1206
|
+
), I = R(() => ({
|
|
1193
1207
|
labels: a.data.map((r) => r.rotulo),
|
|
1194
1208
|
datasets: [
|
|
1195
1209
|
{
|
|
@@ -1201,24 +1215,24 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1201
1215
|
}
|
|
1202
1216
|
]
|
|
1203
1217
|
}));
|
|
1204
|
-
function
|
|
1205
|
-
const { chart: $, tooltip:
|
|
1206
|
-
if (!
|
|
1207
|
-
const c =
|
|
1208
|
-
if (
|
|
1218
|
+
function W(r) {
|
|
1219
|
+
const { chart: $, tooltip: B } = r, S = it($);
|
|
1220
|
+
if (!S) return;
|
|
1221
|
+
const c = pt(S);
|
|
1222
|
+
if (B.opacity === 0) {
|
|
1209
1223
|
c.style.opacity = "0";
|
|
1210
1224
|
return;
|
|
1211
1225
|
}
|
|
1212
|
-
const N =
|
|
1213
|
-
|
|
1214
|
-
const { offsetLeft: s, offsetTop:
|
|
1226
|
+
const N = B.title || [], F = B.dataPoints && B.dataPoints[0], U = F ? T.value[F.dataIndex] : "#3B82F6", f = F ? v(F.parsed.r ?? F.parsed) : "", b = c.querySelector(".nc-tt__content");
|
|
1227
|
+
b.innerHTML = `<div style="font-size:9px;font-weight:500;color:#94A3B8;letter-spacing:.04em;text-transform:uppercase;line-height:1;margin-bottom:4px;">${N.join(" ")}</div><div style="display:flex;align-items:center;gap:6px;"><span style="width:6px;height:6px;border-radius:999px;background:${U};box-shadow:0 0 0 2px ${V(U, 0.15)};flex:0 0 auto;"></span><span style="font-size:12px;font-weight:700;color:#0F172A;letter-spacing:-.01em;line-height:1.1;">${f}</span></div>`;
|
|
1228
|
+
const { offsetLeft: s, offsetTop: h } = $.canvas;
|
|
1215
1229
|
c.style.opacity = "1", c.style.visibility = "hidden", c.style.left = "0px", c.style.top = "0px";
|
|
1216
|
-
const g = c.offsetWidth,
|
|
1217
|
-
let
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1230
|
+
const g = c.offsetWidth, L = c.offsetHeight, C = 4, q = dt(s + B.caretX, g, S.clientWidth, C);
|
|
1231
|
+
let A = h + B.caretY;
|
|
1232
|
+
const X = L + 16 + C;
|
|
1233
|
+
A < X && (A = X), c.style.left = q + "px", c.style.top = A + "px", c.style.visibility = "visible";
|
|
1220
1234
|
}
|
|
1221
|
-
const
|
|
1235
|
+
const Q = R(() => ({
|
|
1222
1236
|
responsive: !0,
|
|
1223
1237
|
maintainAspectRatio: !1,
|
|
1224
1238
|
layout: { padding: 4 },
|
|
@@ -1228,11 +1242,11 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1228
1242
|
ticks: { display: !1, backdropColor: "transparent" },
|
|
1229
1243
|
grid: {
|
|
1230
1244
|
display: a.mostrarLinhasGrade,
|
|
1231
|
-
color:
|
|
1245
|
+
color: V(e.value.muted, 0.18)
|
|
1232
1246
|
},
|
|
1233
1247
|
angleLines: {
|
|
1234
1248
|
display: a.mostrarLinhasGrade,
|
|
1235
|
-
color:
|
|
1249
|
+
color: V(e.value.muted, 0.18)
|
|
1236
1250
|
},
|
|
1237
1251
|
pointLabels: { display: !1 }
|
|
1238
1252
|
}
|
|
@@ -1241,7 +1255,7 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1241
1255
|
legend: { display: !1 },
|
|
1242
1256
|
tooltip: {
|
|
1243
1257
|
enabled: !1,
|
|
1244
|
-
external:
|
|
1258
|
+
external: W,
|
|
1245
1259
|
callbacks: {
|
|
1246
1260
|
title: (r) => {
|
|
1247
1261
|
var $;
|
|
@@ -1249,30 +1263,30 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1249
1263
|
},
|
|
1250
1264
|
label: (r) => {
|
|
1251
1265
|
var $;
|
|
1252
|
-
return
|
|
1266
|
+
return v((($ = r.parsed) == null ? void 0 : $.r) ?? r.parsed);
|
|
1253
1267
|
}
|
|
1254
1268
|
}
|
|
1255
1269
|
}
|
|
1256
1270
|
}
|
|
1257
1271
|
}));
|
|
1258
|
-
function
|
|
1272
|
+
function m() {
|
|
1259
1273
|
d("botaoAcao");
|
|
1260
1274
|
}
|
|
1261
1275
|
return (r, $) => (l(), n("div", {
|
|
1262
1276
|
ref_key: "cardRef",
|
|
1263
1277
|
ref: z,
|
|
1264
|
-
class:
|
|
1265
|
-
style: u(o(
|
|
1278
|
+
class: at(["card-polar p-4 flex flex-column", E.value]),
|
|
1279
|
+
style: u(o(w))
|
|
1266
1280
|
}, [
|
|
1267
|
-
|
|
1281
|
+
p("div", ze, [
|
|
1268
1282
|
r.$slots.legenda || t.legenda || r.$slots.sublegenda || t.sublegenda ? (l(), n("div", Fe, [
|
|
1269
1283
|
r.$slots.legenda || t.legenda ? (l(), n("div", {
|
|
1270
1284
|
key: 0,
|
|
1271
|
-
class: "text-
|
|
1285
|
+
class: "text-xs font-medium",
|
|
1272
1286
|
style: u({ color: o(e).text, opacity: 0.95 })
|
|
1273
1287
|
}, [
|
|
1274
|
-
|
|
1275
|
-
|
|
1288
|
+
k(r.$slots, "legenda", {}, () => [
|
|
1289
|
+
j(x(t.legenda), 1)
|
|
1276
1290
|
], !0)
|
|
1277
1291
|
], 4)) : i("", !0),
|
|
1278
1292
|
r.$slots.sublegenda || t.sublegenda ? (l(), n("div", {
|
|
@@ -1280,75 +1294,75 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1280
1294
|
class: "text-xs",
|
|
1281
1295
|
style: u({ color: o(e).muted })
|
|
1282
1296
|
}, [
|
|
1283
|
-
|
|
1284
|
-
|
|
1297
|
+
k(r.$slots, "sublegenda", {}, () => [
|
|
1298
|
+
j(x(t.sublegenda), 1)
|
|
1285
1299
|
], !0)
|
|
1286
1300
|
], 4)) : i("", !0)
|
|
1287
1301
|
])) : i("", !0),
|
|
1288
1302
|
r.$slots.actions || t.botaoVisivel || t.exportar ? (l(), n("div", Te, [
|
|
1289
|
-
|
|
1303
|
+
k(r.$slots, "actions", {}, () => [
|
|
1290
1304
|
t.botaoVisivel ? (l(), n("button", {
|
|
1291
1305
|
key: 0,
|
|
1292
|
-
class: "card-polar__btn",
|
|
1293
|
-
style: u({ color: o(e).text, borderColor: o(
|
|
1294
|
-
onClick:
|
|
1306
|
+
class: "card-polar__btn inline-flex align-items-center",
|
|
1307
|
+
style: u({ color: o(e).text, borderColor: o(V)(o(e).text, 0.18) }),
|
|
1308
|
+
onClick: m
|
|
1295
1309
|
}, [
|
|
1296
|
-
|
|
1310
|
+
p("span", null, x(t.textoBotao), 1)
|
|
1297
1311
|
], 4)) : i("", !0)
|
|
1298
1312
|
], !0),
|
|
1299
1313
|
t.exportar ? (l(), n("button", {
|
|
1300
1314
|
key: 0,
|
|
1301
1315
|
type: "button",
|
|
1302
|
-
class: "card-polar__exportar",
|
|
1303
|
-
style: u({ color: o(e).muted, borderColor: o(
|
|
1316
|
+
class: "card-polar__exportar inline-flex align-items-center justify-content-center",
|
|
1317
|
+
style: u({ color: o(e).muted, borderColor: o(V)(o(e).text, 0.18) }),
|
|
1304
1318
|
title: "Exportar como imagem",
|
|
1305
1319
|
"aria-label": "Exportar como imagem",
|
|
1306
|
-
onClick:
|
|
1307
|
-
innerHTML: o(
|
|
1320
|
+
onClick: O,
|
|
1321
|
+
innerHTML: o(D)
|
|
1308
1322
|
}, null, 12, Le)) : i("", !0)
|
|
1309
1323
|
])) : i("", !0)
|
|
1310
1324
|
]),
|
|
1311
|
-
|
|
1312
|
-
|
|
1325
|
+
p("div", Ve, [
|
|
1326
|
+
p("div", je, [
|
|
1313
1327
|
t.mostrarCabecalho ? (l(), n("div", {
|
|
1314
1328
|
key: 0,
|
|
1315
|
-
class: "card-polar__tabela-cab",
|
|
1316
|
-
style: u({ color: o(e).muted, borderColor: o(
|
|
1329
|
+
class: "card-polar__tabela-cab flex align-items-center justify-content-between",
|
|
1330
|
+
style: u({ color: o(e).muted, borderColor: o(V)(o(e).muted, 0.25) })
|
|
1317
1331
|
}, [
|
|
1318
|
-
|
|
1319
|
-
|
|
1332
|
+
p("span", null, x(t.rotuloCategoria), 1),
|
|
1333
|
+
p("span", Ne, x(t.rotuloQuantidade), 1)
|
|
1320
1334
|
], 4)) : i("", !0),
|
|
1321
|
-
(l(!0), n(
|
|
1322
|
-
key:
|
|
1323
|
-
class: "card-polar__tabela-linha",
|
|
1335
|
+
(l(!0), n(ft, null, gt(t.data, (B, S) => (l(), n("div", {
|
|
1336
|
+
key: S,
|
|
1337
|
+
class: "card-polar__tabela-linha flex align-items-center justify-content-between",
|
|
1324
1338
|
style: u({ color: o(e).text })
|
|
1325
1339
|
}, [
|
|
1326
|
-
|
|
1327
|
-
|
|
1340
|
+
p("span", He, [
|
|
1341
|
+
p("span", {
|
|
1328
1342
|
class: "card-polar__bolinha",
|
|
1329
|
-
style: u({ background: T.value[
|
|
1343
|
+
style: u({ background: T.value[S] })
|
|
1330
1344
|
}, null, 4),
|
|
1331
|
-
|
|
1345
|
+
p("span", null, x(B.rotulo), 1)
|
|
1332
1346
|
]),
|
|
1333
|
-
|
|
1347
|
+
p("span", _e, x(o(v)(B.quantidade)), 1)
|
|
1334
1348
|
], 4))), 128))
|
|
1335
1349
|
]),
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
ct(
|
|
1350
|
+
p("div", Me, [
|
|
1351
|
+
p("div", De, [
|
|
1352
|
+
ct(ot, {
|
|
1339
1353
|
type: "polarArea",
|
|
1340
|
-
data:
|
|
1341
|
-
options:
|
|
1354
|
+
data: I.value,
|
|
1355
|
+
options: Q.value,
|
|
1342
1356
|
height: t.height
|
|
1343
1357
|
}, null, 8, ["data", "options", "height"]),
|
|
1344
|
-
r.$slots.titulo || t.titulo || r.$slots.descricao || t.descricao ? (l(), n("div",
|
|
1358
|
+
r.$slots.titulo || t.titulo || r.$slots.descricao || t.descricao ? (l(), n("div", Pe, [
|
|
1345
1359
|
r.$slots.titulo || t.titulo ? (l(), n("div", {
|
|
1346
1360
|
key: 0,
|
|
1347
|
-
class: "card-polar__centro-titulo",
|
|
1348
|
-
style: u({ color: o(e).text })
|
|
1361
|
+
class: "card-polar__centro-titulo m-0 text-3xl font-semibold",
|
|
1362
|
+
style: u({ color: o(e).text, lineHeight: "33px", letterSpacing: "-1px" })
|
|
1349
1363
|
}, [
|
|
1350
|
-
|
|
1351
|
-
|
|
1364
|
+
k(r.$slots, "titulo", {}, () => [
|
|
1365
|
+
j(x(t.titulo), 1)
|
|
1352
1366
|
], !0)
|
|
1353
1367
|
], 4)) : i("", !0),
|
|
1354
1368
|
r.$slots.descricao || t.descricao ? (l(), n("div", {
|
|
@@ -1356,32 +1370,32 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1356
1370
|
class: "card-polar__centro-desc",
|
|
1357
1371
|
style: u({ color: o(e).muted })
|
|
1358
1372
|
}, [
|
|
1359
|
-
|
|
1360
|
-
|
|
1373
|
+
k(r.$slots, "descricao", {}, () => [
|
|
1374
|
+
j(x(t.descricao), 1)
|
|
1361
1375
|
], !0)
|
|
1362
1376
|
], 4)) : i("", !0)
|
|
1363
1377
|
])) : i("", !0)
|
|
1364
1378
|
])
|
|
1365
1379
|
])
|
|
1366
1380
|
]),
|
|
1367
|
-
r.$slots.footer ? (l(), n("div",
|
|
1368
|
-
|
|
1381
|
+
r.$slots.footer ? (l(), n("div", Oe, [
|
|
1382
|
+
k(r.$slots, "footer", {}, void 0, !0)
|
|
1369
1383
|
])) : i("", !0)
|
|
1370
1384
|
], 6));
|
|
1371
1385
|
}
|
|
1372
|
-
},
|
|
1386
|
+
}, We = /* @__PURE__ */ et(Ie, [["__scopeId", "data-v-32e940e9"]]), Xe = { class: "card-progresso__topo flex align-items-start justify-content-between gap-3" }, Ye = {
|
|
1373
1387
|
key: 0,
|
|
1374
|
-
class: "card-progresso__legendas"
|
|
1375
|
-
},
|
|
1388
|
+
class: "card-progresso__legendas flex flex-column"
|
|
1389
|
+
}, Je = {
|
|
1376
1390
|
key: 1,
|
|
1377
|
-
class: "card-progresso__actions"
|
|
1378
|
-
},
|
|
1391
|
+
class: "card-progresso__actions inline-flex align-items-center gap-2"
|
|
1392
|
+
}, Qe = ["innerHTML"], Ue = {
|
|
1379
1393
|
key: 0,
|
|
1380
|
-
class: "card-progresso__titulos mt-3 mb-2"
|
|
1381
|
-
}, Ge = { class: "card-progresso__corpo" }, Ze = {
|
|
1394
|
+
class: "card-progresso__titulos mt-3 mb-2 flex flex-column"
|
|
1395
|
+
}, Ge = { class: "card-progresso__corpo flex align-items-center gap-4 flex-wrap" }, Ze = {
|
|
1382
1396
|
key: 0,
|
|
1383
|
-
class: "card-progresso__chart-wrap"
|
|
1384
|
-
}, Ke = { class: "card-progresso__chart" }, ta = { class: "card-progresso__centro" }, ea = { class: "card-progresso__lista" }, aa = { class: "card-progresso__item-cab" }, oa = {
|
|
1397
|
+
class: "card-progresso__chart-wrap flex align-items-center justify-content-center"
|
|
1398
|
+
}, Ke = { class: "card-progresso__chart" }, ta = { class: "card-progresso__centro flex flex-column align-items-center justify-content-center" }, ea = { class: "card-progresso__lista flex flex-column" }, aa = { class: "card-progresso__item-cab flex align-items-center justify-content-between" }, oa = {
|
|
1385
1399
|
key: 1,
|
|
1386
1400
|
class: "card-progresso__footer mt-3"
|
|
1387
1401
|
}, ra = {
|
|
@@ -1442,30 +1456,30 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1442
1456
|
},
|
|
1443
1457
|
emits: ["botaoAcao", "exportado"],
|
|
1444
1458
|
setup(t, { emit: y }) {
|
|
1445
|
-
const a = t, d = y, { palette: e, cardStyle:
|
|
1446
|
-
async function
|
|
1447
|
-
await
|
|
1459
|
+
const a = t, d = y, { palette: e, cardStyle: w } = rt(a), { formatar: v } = ut(a), z = tt(null), D = nt;
|
|
1460
|
+
async function O() {
|
|
1461
|
+
await lt(z.value, {
|
|
1448
1462
|
nomeArquivo: a.nomeArquivoExport,
|
|
1449
1463
|
corFundo: e.value.bg !== "transparent" ? e.value.bg : null
|
|
1450
1464
|
}), d("exportado");
|
|
1451
1465
|
}
|
|
1452
|
-
const
|
|
1466
|
+
const E = R(() => `card-progresso--${a.direcao}`), T = R(
|
|
1453
1467
|
() => a.data.map((c, N) => {
|
|
1454
|
-
const F = Number(c.meta ?? a.metaPadrao) || 0,
|
|
1455
|
-
return { rotulo: c.rotulo, quantidade:
|
|
1468
|
+
const F = Number(c.meta ?? a.metaPadrao) || 0, U = Number(c.quantidade) || 0, f = c.cor || a.cores[N % a.cores.length], b = F > 0 ? Math.max(0, Math.min(100, U / F * 100)) : 0;
|
|
1469
|
+
return { rotulo: c.rotulo, quantidade: U, meta: F, cor: f, percentual: b };
|
|
1456
1470
|
})
|
|
1457
|
-
), O = R(
|
|
1458
|
-
() => typeof a.alturaBarra == "number" ? `${a.alturaBarra}px` : a.alturaBarra
|
|
1459
1471
|
), I = R(
|
|
1472
|
+
() => typeof a.alturaBarra == "number" ? `${a.alturaBarra}px` : a.alturaBarra
|
|
1473
|
+
), W = R(
|
|
1460
1474
|
() => typeof a.raioBarra == "number" ? `${a.raioBarra}px` : a.raioBarra
|
|
1461
|
-
),
|
|
1475
|
+
), Q = R(() => T.value.reduce((c, N) => c + N.quantidade, 0)), m = R(() => T.value.reduce((c, N) => c + N.meta, 0)), r = R(() => m.value <= 0 ? 0 : Math.max(0, Math.min(100, Q.value / m.value * 100))), $ = R(() => {
|
|
1462
1476
|
const c = Math.max(0, 100 - r.value), N = a.corDetalhes;
|
|
1463
1477
|
return {
|
|
1464
1478
|
labels: ["Progresso", "Restante"],
|
|
1465
1479
|
datasets: [
|
|
1466
1480
|
{
|
|
1467
1481
|
data: [r.value, c],
|
|
1468
|
-
backgroundColor: [N,
|
|
1482
|
+
backgroundColor: [N, V(e.value.muted, 0.15)],
|
|
1469
1483
|
borderWidth: 0,
|
|
1470
1484
|
borderColor: "transparent",
|
|
1471
1485
|
hoverOffset: 0,
|
|
@@ -1473,7 +1487,7 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1473
1487
|
}
|
|
1474
1488
|
]
|
|
1475
1489
|
};
|
|
1476
|
-
}),
|
|
1490
|
+
}), B = R(() => ({
|
|
1477
1491
|
responsive: !0,
|
|
1478
1492
|
maintainAspectRatio: !1,
|
|
1479
1493
|
cutout: a.cutout,
|
|
@@ -1485,24 +1499,24 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1485
1499
|
tooltip: { enabled: !1 }
|
|
1486
1500
|
}
|
|
1487
1501
|
}));
|
|
1488
|
-
function
|
|
1502
|
+
function S() {
|
|
1489
1503
|
d("botaoAcao");
|
|
1490
1504
|
}
|
|
1491
1505
|
return (c, N) => (l(), n("div", {
|
|
1492
1506
|
ref_key: "cardRef",
|
|
1493
1507
|
ref: z,
|
|
1494
|
-
class:
|
|
1495
|
-
style: u(o(
|
|
1508
|
+
class: at(["card-progresso p-4 flex flex-column", E.value]),
|
|
1509
|
+
style: u(o(w))
|
|
1496
1510
|
}, [
|
|
1497
|
-
|
|
1498
|
-
c.$slots.legenda || t.legenda || c.$slots.sublegenda || t.sublegenda ? (l(), n("div",
|
|
1511
|
+
p("div", Xe, [
|
|
1512
|
+
c.$slots.legenda || t.legenda || c.$slots.sublegenda || t.sublegenda ? (l(), n("div", Ye, [
|
|
1499
1513
|
c.$slots.legenda || t.legenda ? (l(), n("div", {
|
|
1500
1514
|
key: 0,
|
|
1501
|
-
class: "text-
|
|
1515
|
+
class: "text-xs font-medium",
|
|
1502
1516
|
style: u({ color: o(e).text, opacity: 0.95 })
|
|
1503
1517
|
}, [
|
|
1504
|
-
|
|
1505
|
-
|
|
1518
|
+
k(c.$slots, "legenda", {}, () => [
|
|
1519
|
+
j(x(t.legenda), 1)
|
|
1506
1520
|
], !0)
|
|
1507
1521
|
], 4)) : i("", !0),
|
|
1508
1522
|
c.$slots.sublegenda || t.sublegenda ? (l(), n("div", {
|
|
@@ -1510,42 +1524,42 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1510
1524
|
class: "text-xs",
|
|
1511
1525
|
style: u({ color: o(e).muted })
|
|
1512
1526
|
}, [
|
|
1513
|
-
|
|
1514
|
-
|
|
1527
|
+
k(c.$slots, "sublegenda", {}, () => [
|
|
1528
|
+
j(x(t.sublegenda), 1)
|
|
1515
1529
|
], !0)
|
|
1516
1530
|
], 4)) : i("", !0)
|
|
1517
1531
|
])) : i("", !0),
|
|
1518
|
-
c.$slots.actions || t.botaoVisivel || t.exportar ? (l(), n("div",
|
|
1519
|
-
|
|
1532
|
+
c.$slots.actions || t.botaoVisivel || t.exportar ? (l(), n("div", Je, [
|
|
1533
|
+
k(c.$slots, "actions", {}, () => [
|
|
1520
1534
|
t.botaoVisivel ? (l(), n("button", {
|
|
1521
1535
|
key: 0,
|
|
1522
|
-
class: "card-progresso__btn",
|
|
1523
|
-
style: u({ color: o(e).text, borderColor: o(
|
|
1524
|
-
onClick:
|
|
1536
|
+
class: "card-progresso__btn inline-flex align-items-center",
|
|
1537
|
+
style: u({ color: o(e).text, borderColor: o(V)(o(e).text, 0.18) }),
|
|
1538
|
+
onClick: S
|
|
1525
1539
|
}, [
|
|
1526
|
-
|
|
1540
|
+
p("span", null, x(t.textoBotao), 1)
|
|
1527
1541
|
], 4)) : i("", !0)
|
|
1528
1542
|
], !0),
|
|
1529
1543
|
t.exportar ? (l(), n("button", {
|
|
1530
1544
|
key: 0,
|
|
1531
1545
|
type: "button",
|
|
1532
|
-
class: "card-progresso__exportar",
|
|
1533
|
-
style: u({ color: o(e).muted, borderColor: o(
|
|
1546
|
+
class: "card-progresso__exportar inline-flex align-items-center justify-content-center",
|
|
1547
|
+
style: u({ color: o(e).muted, borderColor: o(V)(o(e).text, 0.18) }),
|
|
1534
1548
|
title: "Exportar como imagem",
|
|
1535
1549
|
"aria-label": "Exportar como imagem",
|
|
1536
|
-
onClick:
|
|
1537
|
-
innerHTML: o(
|
|
1538
|
-
}, null, 12,
|
|
1550
|
+
onClick: O,
|
|
1551
|
+
innerHTML: o(D)
|
|
1552
|
+
}, null, 12, Qe)) : i("", !0)
|
|
1539
1553
|
])) : i("", !0)
|
|
1540
1554
|
]),
|
|
1541
1555
|
c.$slots.titulo || t.titulo || c.$slots.descricao || t.descricao ? (l(), n("div", Ue, [
|
|
1542
1556
|
c.$slots.titulo || t.titulo ? (l(), n("div", {
|
|
1543
1557
|
key: 0,
|
|
1544
|
-
class: "text-
|
|
1545
|
-
style: u({ color: o(e).text })
|
|
1558
|
+
class: "m-0 text-3xl font-semibold",
|
|
1559
|
+
style: u({ color: o(e).text, lineHeight: "33px", letterSpacing: "-1px" })
|
|
1546
1560
|
}, [
|
|
1547
|
-
|
|
1548
|
-
|
|
1561
|
+
k(c.$slots, "titulo", {}, () => [
|
|
1562
|
+
j(x(t.titulo), 1)
|
|
1549
1563
|
], !0)
|
|
1550
1564
|
], 4)) : i("", !0),
|
|
1551
1565
|
c.$slots.descricao || t.descricao ? (l(), n("div", {
|
|
@@ -1553,97 +1567,97 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1553
1567
|
class: "text-sm mt-1",
|
|
1554
1568
|
style: u({ color: o(e).muted })
|
|
1555
1569
|
}, [
|
|
1556
|
-
|
|
1557
|
-
|
|
1570
|
+
k(c.$slots, "descricao", {}, () => [
|
|
1571
|
+
j(x(t.descricao), 1)
|
|
1558
1572
|
], !0)
|
|
1559
1573
|
], 4)) : i("", !0)
|
|
1560
1574
|
])) : i("", !0),
|
|
1561
|
-
|
|
1575
|
+
p("div", Ge, [
|
|
1562
1576
|
t.formato === "circular" ? (l(), n("div", Ze, [
|
|
1563
|
-
|
|
1564
|
-
ct(
|
|
1577
|
+
p("div", Ke, [
|
|
1578
|
+
ct(ot, {
|
|
1565
1579
|
type: "doughnut",
|
|
1566
1580
|
data: $.value,
|
|
1567
|
-
options:
|
|
1581
|
+
options: B.value,
|
|
1568
1582
|
height: t.height
|
|
1569
1583
|
}, null, 8, ["data", "options", "height"]),
|
|
1570
|
-
|
|
1571
|
-
|
|
1584
|
+
p("div", ta, [
|
|
1585
|
+
p("div", {
|
|
1572
1586
|
class: "card-progresso__centro-valor",
|
|
1573
1587
|
style: u({ color: o(e).text })
|
|
1574
|
-
},
|
|
1575
|
-
|
|
1588
|
+
}, x(Math.round(r.value)) + "% ", 5),
|
|
1589
|
+
p("div", {
|
|
1576
1590
|
class: "card-progresso__centro-desc",
|
|
1577
1591
|
style: u({ color: o(e).muted })
|
|
1578
|
-
},
|
|
1592
|
+
}, x(o(v)(Q.value)) + " / " + x(o(v)(m.value)), 5)
|
|
1579
1593
|
])
|
|
1580
1594
|
])
|
|
1581
1595
|
])) : i("", !0),
|
|
1582
|
-
|
|
1583
|
-
(l(!0), n(
|
|
1584
|
-
key:
|
|
1585
|
-
class: "card-progresso__item"
|
|
1596
|
+
p("div", ea, [
|
|
1597
|
+
(l(!0), n(ft, null, gt(T.value, (F, U) => (l(), n("div", {
|
|
1598
|
+
key: U,
|
|
1599
|
+
class: "card-progresso__item flex flex-column"
|
|
1586
1600
|
}, [
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
class: "card-progresso__item-rotulo",
|
|
1601
|
+
p("div", aa, [
|
|
1602
|
+
p("span", {
|
|
1603
|
+
class: "card-progresso__item-rotulo inline-flex align-items-center gap-2",
|
|
1590
1604
|
style: u({ color: o(e).text })
|
|
1591
1605
|
}, [
|
|
1592
|
-
|
|
1606
|
+
p("span", {
|
|
1593
1607
|
class: "card-progresso__bolinha",
|
|
1594
1608
|
style: u({ background: F.cor })
|
|
1595
1609
|
}, null, 4),
|
|
1596
|
-
|
|
1610
|
+
p("span", null, x(F.rotulo), 1)
|
|
1597
1611
|
], 4),
|
|
1598
1612
|
t.mostrarValor || t.mostrarPercentual ? (l(), n("span", {
|
|
1599
1613
|
key: 0,
|
|
1600
|
-
class: "card-progresso__item-valor",
|
|
1614
|
+
class: "card-progresso__item-valor inline-flex align-items-baseline gap-2",
|
|
1601
1615
|
style: u({ color: o(e).text })
|
|
1602
1616
|
}, [
|
|
1603
|
-
t.mostrarValor ? (l(), n(
|
|
1604
|
-
|
|
1617
|
+
t.mostrarValor ? (l(), n(ft, { key: 0 }, [
|
|
1618
|
+
j(x(o(v)(F.quantidade)), 1),
|
|
1605
1619
|
F.meta ? (l(), n("span", {
|
|
1606
1620
|
key: 0,
|
|
1607
1621
|
style: u({ color: o(e).muted })
|
|
1608
|
-
}, " / " +
|
|
1622
|
+
}, " / " + x(o(v)(F.meta)), 5)) : i("", !0)
|
|
1609
1623
|
], 64)) : i("", !0),
|
|
1610
1624
|
t.mostrarPercentual ? (l(), n("span", {
|
|
1611
1625
|
key: 1,
|
|
1612
1626
|
class: "card-progresso__item-pct",
|
|
1613
1627
|
style: u({ color: o(e).muted })
|
|
1614
|
-
},
|
|
1628
|
+
}, x(Math.round(F.percentual)) + "% ", 5)) : i("", !0)
|
|
1615
1629
|
], 4)) : i("", !0)
|
|
1616
1630
|
]),
|
|
1617
|
-
|
|
1618
|
-
class: "card-progresso__trilha",
|
|
1619
|
-
style: u({ height:
|
|
1631
|
+
p("div", {
|
|
1632
|
+
class: "card-progresso__trilha w-full",
|
|
1633
|
+
style: u({ height: I.value, borderRadius: W.value, background: o(V)(o(e).muted, 0.15) })
|
|
1620
1634
|
}, [
|
|
1621
|
-
|
|
1635
|
+
p("div", {
|
|
1622
1636
|
class: "card-progresso__preenchimento",
|
|
1623
|
-
style: u({ width: F.percentual + "%", background: F.cor, borderRadius:
|
|
1637
|
+
style: u({ width: F.percentual + "%", background: F.cor, borderRadius: W.value })
|
|
1624
1638
|
}, null, 4)
|
|
1625
1639
|
], 4)
|
|
1626
1640
|
]))), 128))
|
|
1627
1641
|
])
|
|
1628
1642
|
]),
|
|
1629
1643
|
c.$slots.footer ? (l(), n("div", oa, [
|
|
1630
|
-
|
|
1644
|
+
k(c.$slots, "footer", {}, void 0, !0)
|
|
1631
1645
|
])) : i("", !0)
|
|
1632
1646
|
], 6));
|
|
1633
1647
|
}
|
|
1634
|
-
}, la = /* @__PURE__ */
|
|
1648
|
+
}, la = /* @__PURE__ */ et(ra, [["__scopeId", "data-v-b5d915fb"]]), na = {
|
|
1635
1649
|
key: 0,
|
|
1636
1650
|
class: "card-base__topo"
|
|
1637
|
-
}, sa = ["innerHTML"], ia = { class: "card-base__legendas" }, da = {
|
|
1651
|
+
}, sa = ["innerHTML"], ia = { class: "card-base__legendas flex flex-column" }, da = {
|
|
1638
1652
|
key: 1,
|
|
1639
|
-
class: "card-base__titulos"
|
|
1653
|
+
class: "card-base__titulos flex flex-column"
|
|
1640
1654
|
}, ca = {
|
|
1641
1655
|
key: 2,
|
|
1642
|
-
class: "card-base__acao"
|
|
1656
|
+
class: "card-base__acao flex"
|
|
1643
1657
|
}, ua = {
|
|
1644
1658
|
key: 3,
|
|
1645
1659
|
class: "card-base__footer"
|
|
1646
|
-
},
|
|
1660
|
+
}, fa = {
|
|
1647
1661
|
__name: "CardBase",
|
|
1648
1662
|
props: {
|
|
1649
1663
|
legenda: { type: String, default: null },
|
|
@@ -1668,107 +1682,107 @@ const lt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1668
1682
|
},
|
|
1669
1683
|
emits: ["botaoAcao", "exportado"],
|
|
1670
1684
|
setup(t, { emit: y }) {
|
|
1671
|
-
const a = t, d = y, { palette: e, cardStyle:
|
|
1672
|
-
function
|
|
1685
|
+
const a = t, d = y, { palette: e, cardStyle: w } = rt(a), v = tt(null), z = nt;
|
|
1686
|
+
function D() {
|
|
1673
1687
|
d("botaoAcao");
|
|
1674
1688
|
}
|
|
1675
|
-
async function
|
|
1676
|
-
await
|
|
1689
|
+
async function O() {
|
|
1690
|
+
await lt(v.value, {
|
|
1677
1691
|
nomeArquivo: a.nomeArquivoExport,
|
|
1678
1692
|
corFundo: e.value.bg !== "transparent" ? e.value.bg : null
|
|
1679
1693
|
}), d("exportado");
|
|
1680
1694
|
}
|
|
1681
|
-
return (
|
|
1695
|
+
return (E, T) => (l(), n("div", {
|
|
1682
1696
|
ref_key: "cardRef",
|
|
1683
|
-
ref:
|
|
1684
|
-
class:
|
|
1685
|
-
style: u(o(
|
|
1697
|
+
ref: v,
|
|
1698
|
+
class: at(["card-base p-4 flex flex-column", `card-base--${t.alinhamento}`]),
|
|
1699
|
+
style: u(o(w))
|
|
1686
1700
|
}, [
|
|
1687
1701
|
t.exportar ? (l(), n("div", na, [
|
|
1688
|
-
|
|
1702
|
+
p("button", {
|
|
1689
1703
|
type: "button",
|
|
1690
|
-
class: "card-base__exportar",
|
|
1691
|
-
style: u({ color: o(e).muted, borderColor: o(
|
|
1704
|
+
class: "card-base__exportar inline-flex align-items-center justify-content-center",
|
|
1705
|
+
style: u({ color: o(e).muted, borderColor: o(V)(o(e).text === "inherit" ? "#0F172A" : o(e).text, 0.18) }),
|
|
1692
1706
|
title: "Exportar como imagem",
|
|
1693
1707
|
"aria-label": "Exportar como imagem",
|
|
1694
|
-
onClick:
|
|
1708
|
+
onClick: O,
|
|
1695
1709
|
innerHTML: o(z)
|
|
1696
1710
|
}, null, 12, sa)
|
|
1697
1711
|
])) : i("", !0),
|
|
1698
|
-
|
|
1699
|
-
|
|
1712
|
+
p("div", ia, [
|
|
1713
|
+
E.$slots.legenda || t.legenda ? (l(), n("div", {
|
|
1700
1714
|
key: 0,
|
|
1701
|
-
class: "card-base__legenda",
|
|
1715
|
+
class: "card-base__legenda text-xs",
|
|
1702
1716
|
style: u({ color: o(e).text })
|
|
1703
1717
|
}, [
|
|
1704
|
-
|
|
1705
|
-
|
|
1718
|
+
k(E.$slots, "legenda", {}, () => [
|
|
1719
|
+
j(x(t.legenda), 1)
|
|
1706
1720
|
], !0)
|
|
1707
1721
|
], 4)) : i("", !0),
|
|
1708
|
-
|
|
1722
|
+
E.$slots.sublegenda || t.sublegenda ? (l(), n("div", {
|
|
1709
1723
|
key: 1,
|
|
1710
|
-
class: "card-base__sublegenda",
|
|
1724
|
+
class: "card-base__sublegenda text-xs",
|
|
1711
1725
|
style: u({ color: o(e).muted })
|
|
1712
1726
|
}, [
|
|
1713
|
-
|
|
1714
|
-
|
|
1727
|
+
k(E.$slots, "sublegenda", {}, () => [
|
|
1728
|
+
j(x(t.sublegenda), 1)
|
|
1715
1729
|
], !0)
|
|
1716
1730
|
], 4)) : i("", !0)
|
|
1717
1731
|
]),
|
|
1718
|
-
|
|
1719
|
-
|
|
1732
|
+
E.$slots.titulo || t.titulo || E.$slots.descricao || t.descricao ? (l(), n("div", da, [
|
|
1733
|
+
E.$slots.titulo || t.titulo ? (l(), n("div", {
|
|
1720
1734
|
key: 0,
|
|
1721
|
-
class: "card-base__titulo",
|
|
1722
|
-
style: u({ color: o(e).text })
|
|
1735
|
+
class: "card-base__titulo m-0 text-3xl font-semibold",
|
|
1736
|
+
style: u({ color: o(e).text, lineHeight: "33px", letterSpacing: "-1px" })
|
|
1723
1737
|
}, [
|
|
1724
|
-
|
|
1725
|
-
|
|
1738
|
+
k(E.$slots, "titulo", {}, () => [
|
|
1739
|
+
j(x(t.titulo), 1)
|
|
1726
1740
|
], !0)
|
|
1727
1741
|
], 4)) : i("", !0),
|
|
1728
|
-
|
|
1742
|
+
E.$slots.descricao || t.descricao ? (l(), n("div", {
|
|
1729
1743
|
key: 1,
|
|
1730
1744
|
class: "card-base__descricao",
|
|
1731
1745
|
style: u({ color: o(e).muted })
|
|
1732
1746
|
}, [
|
|
1733
|
-
|
|
1734
|
-
|
|
1747
|
+
k(E.$slots, "descricao", {}, () => [
|
|
1748
|
+
j(x(t.descricao), 1)
|
|
1735
1749
|
], !0)
|
|
1736
1750
|
], 4)) : i("", !0)
|
|
1737
1751
|
])) : i("", !0),
|
|
1738
|
-
|
|
1739
|
-
|
|
1752
|
+
E.$slots.acao || t.botaoVisivel ? (l(), n("div", ca, [
|
|
1753
|
+
k(E.$slots, "acao", {}, () => [
|
|
1740
1754
|
t.botaoVisivel ? (l(), n("button", {
|
|
1741
1755
|
key: 0,
|
|
1742
1756
|
type: "button",
|
|
1743
|
-
class: "card-base__link",
|
|
1757
|
+
class: "card-base__link text-xs inline-flex align-items-center",
|
|
1744
1758
|
style: u({ color: o(e).text }),
|
|
1745
|
-
onClick:
|
|
1759
|
+
onClick: D
|
|
1746
1760
|
}, [
|
|
1747
|
-
|
|
1748
|
-
T[0] || (T[0] =
|
|
1761
|
+
p("span", null, x(t.textoBotao), 1),
|
|
1762
|
+
T[0] || (T[0] = p("span", {
|
|
1749
1763
|
class: "card-base__chevron",
|
|
1750
1764
|
"aria-hidden": "true"
|
|
1751
1765
|
}, "›", -1))
|
|
1752
1766
|
], 4)) : i("", !0)
|
|
1753
1767
|
], !0)
|
|
1754
1768
|
])) : i("", !0),
|
|
1755
|
-
|
|
1756
|
-
|
|
1769
|
+
E.$slots.footer ? (l(), n("div", ua, [
|
|
1770
|
+
k(E.$slots, "footer", {}, void 0, !0)
|
|
1757
1771
|
])) : i("", !0)
|
|
1758
1772
|
], 6));
|
|
1759
1773
|
}
|
|
1760
|
-
},
|
|
1774
|
+
}, pa = /* @__PURE__ */ et(fa, [["__scopeId", "data-v-9a0b17f7"]]), ma = {
|
|
1761
1775
|
install(t) {
|
|
1762
|
-
t.component("ChartBase",
|
|
1776
|
+
t.component("ChartBase", ot), t.component("CardBase", pa), t.component("CardLinhas", le), t.component("CardPizza", ve), t.component("CardBarra", Re), t.component("CardPolar", We), t.component("CardProgresso", la);
|
|
1763
1777
|
}
|
|
1764
1778
|
};
|
|
1765
1779
|
export {
|
|
1766
1780
|
Re as CardBarra,
|
|
1767
|
-
|
|
1781
|
+
pa as CardBase,
|
|
1768
1782
|
le as CardLinhas,
|
|
1769
|
-
|
|
1770
|
-
|
|
1783
|
+
ve as CardPizza,
|
|
1784
|
+
We as CardPolar,
|
|
1771
1785
|
la as CardProgresso,
|
|
1772
|
-
|
|
1786
|
+
ot as ChartBase,
|
|
1773
1787
|
ma as default
|
|
1774
1788
|
};
|