nemesischart 2.0.8 → 2.0.10
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/README.md +30 -15
- package/dist/nemesischart.js +1339 -1419
- package/dist/nemesischart.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -15
package/dist/nemesischart.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { Chart as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
for (const [
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
},
|
|
1
|
+
import { ref as ne, shallowRef as _e, onMounted as et, onBeforeUnmount as tt, watch as ie, openBlock as y, createElementBlock as v, normalizeStyle as q, createElementVNode as E, computed as F, renderSlot as $, createTextVNode as j, toDisplayString as L, createCommentVNode as S, unref as g, normalizeClass as Q, createVNode as P, createSlots as J, withCtx as z, createBlock as ce, Fragment as Me, renderList as De, withKeys as Fe, withModifiers as Ie, useCssVars as at } from "vue";
|
|
2
|
+
import { Chart as Le, Title as ot, Tooltip as nt, Legend as rt, Filler as lt, LineController as st, LineElement as it, PointElement as ct, BarController as dt, BarElement as ut, PieController as pt, PolarAreaController as ft, ArcElement as gt, CategoryScale as mt, LinearScale as ht, RadialLinearScale as yt } from "chart.js";
|
|
3
|
+
const W = (e, r) => {
|
|
4
|
+
const t = e.__vccOpts || e;
|
|
5
|
+
for (const [n, a] of r)
|
|
6
|
+
t[n] = a;
|
|
7
|
+
return t;
|
|
8
|
+
}, vt = {
|
|
9
9
|
__name: "ChartBase",
|
|
10
10
|
props: {
|
|
11
11
|
type: { type: String, required: !0 },
|
|
@@ -15,144 +15,317 @@ const at = (t, y) => {
|
|
|
15
15
|
height: { type: [String, Number], default: 300 },
|
|
16
16
|
width: { type: [String, Number], default: null }
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
setup(e, { expose: r }) {
|
|
19
|
+
Le.register(
|
|
20
|
+
ot,
|
|
21
|
+
nt,
|
|
22
|
+
rt,
|
|
23
|
+
lt,
|
|
24
|
+
st,
|
|
25
|
+
it,
|
|
26
|
+
ct,
|
|
27
|
+
dt,
|
|
28
|
+
ut,
|
|
29
|
+
pt,
|
|
30
|
+
ft,
|
|
31
|
+
gt,
|
|
32
|
+
mt,
|
|
33
|
+
ht,
|
|
34
|
+
yt
|
|
35
35
|
);
|
|
36
|
-
const
|
|
36
|
+
const t = e, n = ne(null), a = _e(null), u = {
|
|
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 c() {
|
|
44
|
+
return { ...u, ...t.options };
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
type:
|
|
49
|
-
data:
|
|
50
|
-
options:
|
|
51
|
-
plugins:
|
|
46
|
+
function p() {
|
|
47
|
+
n.value && (a.value = new Le(n.value, {
|
|
48
|
+
type: t.type,
|
|
49
|
+
data: t.data,
|
|
50
|
+
options: c(),
|
|
51
|
+
plugins: t.plugins
|
|
52
52
|
}));
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
54
|
+
function m() {
|
|
55
|
+
a.value && (a.value.destroy(), a.value = null);
|
|
56
56
|
}
|
|
57
|
-
return
|
|
58
|
-
() =>
|
|
59
|
-
(
|
|
60
|
-
if (!
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
57
|
+
return et(p), tt(m), ie(
|
|
58
|
+
() => t.data,
|
|
59
|
+
(l) => {
|
|
60
|
+
if (!a.value) return;
|
|
61
|
+
a.value.data.labels = l.labels;
|
|
62
|
+
const d = a.value.data.datasets, h = l.datasets;
|
|
63
|
+
d.length !== h.length ? a.value.data.datasets = h : h.forEach((b, A) => Object.assign(d[A], b)), a.value.update();
|
|
64
64
|
},
|
|
65
65
|
{ deep: !0 }
|
|
66
|
-
),
|
|
67
|
-
() =>
|
|
66
|
+
), ie(
|
|
67
|
+
() => t.options,
|
|
68
68
|
() => {
|
|
69
|
-
|
|
69
|
+
a.value && (a.value.options = c(), a.value.update());
|
|
70
70
|
},
|
|
71
71
|
{ deep: !0 }
|
|
72
|
-
),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
), ie(
|
|
73
|
+
() => t.type,
|
|
74
|
+
() => {
|
|
75
|
+
m(), p();
|
|
76
|
+
}
|
|
77
|
+
), r({ chart: a }), (l, d) => (y(), v("div", {
|
|
78
|
+
class: "nc-chart-wrapper",
|
|
79
|
+
style: q({
|
|
80
|
+
height: typeof e.height == "number" ? `${e.height}px` : e.height,
|
|
81
|
+
width: e.width ? typeof e.width == "number" ? `${e.width}px` : e.width : "100%"
|
|
77
82
|
})
|
|
78
83
|
}, [
|
|
79
|
-
|
|
84
|
+
E("canvas", {
|
|
80
85
|
ref_key: "canvasRef",
|
|
81
|
-
ref:
|
|
86
|
+
ref: n
|
|
82
87
|
}, null, 512)
|
|
83
88
|
], 4));
|
|
84
89
|
}
|
|
85
|
-
},
|
|
86
|
-
function
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
90
|
-
let
|
|
91
|
-
return
|
|
90
|
+
}, Y = /* @__PURE__ */ W(vt, [["__scopeId", "data-v-cafc7888"]]);
|
|
91
|
+
function bt(e) {
|
|
92
|
+
const r = e.replace("#", ""), t = r.length === 3 ? r.split("").map((b) => b + b).join("") : r, n = parseInt(t.slice(0, 2), 16) / 255, a = parseInt(t.slice(2, 4), 16) / 255, u = parseInt(t.slice(4, 6), 16) / 255, c = Math.max(n, a, u), p = Math.min(n, a, u), m = (c + p) / 2;
|
|
93
|
+
if (c === p) return [0, 0, m * 100];
|
|
94
|
+
const l = c - p, d = m > 0.5 ? l / (2 - c - p) : l / (c + p);
|
|
95
|
+
let h;
|
|
96
|
+
return c === n ? h = ((a - u) / l + (a < u ? 6 : 0)) / 6 : c === a ? h = ((u - n) / l + 2) / 6 : h = ((n - a) / l + 4) / 6, [h * 360, d * 100, m * 100];
|
|
92
97
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
return "#" + [
|
|
98
|
+
function xt(e, r, t) {
|
|
99
|
+
e /= 360, r /= 100, t /= 100;
|
|
100
|
+
const n = t < 0.5 ? t * (1 + r) : t + r - t * r, a = 2 * t - n, u = (l) => (l < 0 && (l += 1), l > 1 && (l -= 1), l < 1 / 6 ? a + (n - a) * 6 * l : l < 1 / 2 ? n : l < 2 / 3 ? a + (n - a) * (2 / 3 - l) * 6 : a), c = r === 0 ? t : u(e + 1 / 3), p = r === 0 ? t : u(e), m = r === 0 ? t : u(e - 1 / 3);
|
|
101
|
+
return "#" + [c, p, m].map((l) => Math.round(l * 255).toString(16).padStart(2, "0")).join("");
|
|
97
102
|
}
|
|
98
|
-
function
|
|
99
|
-
if (!(
|
|
100
|
-
const [
|
|
101
|
-
return Array.from({ length:
|
|
102
|
-
const
|
|
103
|
-
return
|
|
103
|
+
function de(e, r = 7) {
|
|
104
|
+
if (!(e != null && e.startsWith("#"))) return Array.from({ length: r }, () => e ?? "#3B82F6");
|
|
105
|
+
const [t, n] = bt(e), a = 20, u = 72;
|
|
106
|
+
return Array.from({ length: r }, (c, p) => {
|
|
107
|
+
const m = r === 1 ? 0.5 : p / (r - 1), l = a + m * (u - a), d = Math.max(50, n - Math.max(0, l - 55) * 0.6);
|
|
108
|
+
return xt(t, d, l);
|
|
104
109
|
});
|
|
105
110
|
}
|
|
106
|
-
const
|
|
111
|
+
const $t = {
|
|
107
112
|
light: { bg: "#ffffff", text: "#000000", muted: "#64748B", grid: "rgba(15,23,42,0.06)" },
|
|
108
113
|
dark: { bg: "#000000", text: "#ffffff", muted: "#7b7b7b", grid: "rgba(255,255,255,0.08)" },
|
|
109
114
|
transparent: { bg: "transparent", text: "inherit", muted: "#7b7b7b", grid: "rgba(127,127,127,0.15)" }
|
|
110
115
|
};
|
|
111
|
-
function D(
|
|
112
|
-
if (!
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
return `rgba(${
|
|
116
|
+
function D(e, r) {
|
|
117
|
+
if (!e) return `rgba(59,130,246,${r})`;
|
|
118
|
+
if (e.startsWith("#")) {
|
|
119
|
+
const t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((p) => p + p).join("") : t, a = parseInt(n.slice(0, 2), 16), u = parseInt(n.slice(2, 4), 16), c = parseInt(n.slice(4, 6), 16);
|
|
120
|
+
return `rgba(${a},${u},${c},${r})`;
|
|
116
121
|
}
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
122
|
+
if (e.startsWith("rgb")) {
|
|
123
|
+
const t = e.match(/[\d.]+/g);
|
|
124
|
+
if (t && t.length >= 3) return `rgba(${t[0]},${t[1]},${t[2]},${r})`;
|
|
120
125
|
}
|
|
121
|
-
return
|
|
126
|
+
return e;
|
|
122
127
|
}
|
|
123
|
-
function
|
|
124
|
-
const
|
|
125
|
-
const
|
|
128
|
+
function G(e) {
|
|
129
|
+
const r = F(() => {
|
|
130
|
+
const n = $t[e.tema], a = n ? { ...n, bg: e.corFundo || n.bg } : { bg: e.corFundo || e.tema, text: "#F8FAFC", muted: "#7b7b7b", grid: "rgba(255,255,255,0.08)" };
|
|
126
131
|
return {
|
|
127
|
-
...
|
|
128
|
-
text:
|
|
129
|
-
muted:
|
|
132
|
+
...a,
|
|
133
|
+
text: e.corTexto || a.text,
|
|
134
|
+
muted: e.corTexto || a.muted
|
|
130
135
|
};
|
|
131
|
-
}),
|
|
132
|
-
background:
|
|
133
|
-
color:
|
|
134
|
-
borderRadius: typeof
|
|
135
|
-
boxShadow:
|
|
136
|
-
border:
|
|
136
|
+
}), t = F(() => ({
|
|
137
|
+
background: r.value.bg,
|
|
138
|
+
color: r.value.text,
|
|
139
|
+
borderRadius: typeof e.borderRadius == "number" ? `${e.borderRadius}px` : e.borderRadius,
|
|
140
|
+
boxShadow: e.sombra,
|
|
141
|
+
border: e.corBorda ? `1px solid ${e.corBorda}` : "none"
|
|
137
142
|
}));
|
|
138
|
-
return { palette:
|
|
143
|
+
return { palette: r, cardStyle: t, toRgba: D };
|
|
139
144
|
}
|
|
140
|
-
function
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
|
|
145
|
+
function ze(e, r) {
|
|
146
|
+
const t = window.getComputedStyle(e);
|
|
147
|
+
let n = "";
|
|
148
|
+
for (let a = 0; a < t.length; a++) {
|
|
149
|
+
const u = t[a];
|
|
150
|
+
let c = t.getPropertyValue(u);
|
|
151
|
+
if (c && c.indexOf("url(") !== -1 && !/url\(["']?data:/.test(c))
|
|
152
|
+
if (u === "background-image" || u === "background" || u === "mask-image" || u === "border-image" || u === "border-image-source")
|
|
153
|
+
c = "none";
|
|
154
|
+
else
|
|
155
|
+
continue;
|
|
156
|
+
n += `${u}:${c};`;
|
|
146
157
|
}
|
|
147
|
-
|
|
158
|
+
r.setAttribute("style", n);
|
|
159
|
+
}
|
|
160
|
+
function Ct(e, r) {
|
|
161
|
+
ze(e, r);
|
|
162
|
+
const t = e.querySelectorAll("*"), n = r.querySelectorAll("*");
|
|
163
|
+
for (let a = 0; a < t.length; a++)
|
|
164
|
+
n[a] && ze(t[a], n[a]);
|
|
148
165
|
}
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
166
|
+
function kt(e, r) {
|
|
167
|
+
const t = e.querySelectorAll("canvas"), n = r.querySelectorAll("canvas");
|
|
168
|
+
t.forEach((a, u) => {
|
|
169
|
+
if (!n[u]) return;
|
|
170
|
+
const c = document.createElement("img");
|
|
171
|
+
try {
|
|
172
|
+
c.src = a.toDataURL("image/png");
|
|
173
|
+
} catch {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const p = a.getBoundingClientRect();
|
|
177
|
+
c.setAttribute("style", `width:${p.width}px;height:${p.height}px;display:block;`), n[u].replaceWith(c);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
async function St(e, r = {}) {
|
|
181
|
+
if (!e) return;
|
|
182
|
+
const {
|
|
183
|
+
nomeArquivo: t = "componente.png",
|
|
184
|
+
escala: n = 2,
|
|
185
|
+
corFundo: a = null
|
|
186
|
+
} = r, u = e.getBoundingClientRect(), c = Math.ceil(u.width), p = Math.ceil(u.height), m = e.cloneNode(!0);
|
|
187
|
+
Ct(e, m), kt(e, m), m.style.margin = "0", m.style.transform = "none";
|
|
188
|
+
const l = new XMLSerializer().serializeToString(m), d = `<svg xmlns="http://www.w3.org/2000/svg" width="${c}" height="${p}"><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="width:${c}px;height:${p}px;">` + l + "</div></foreignObject></svg>", b = "data:image/svg+xml;base64," + (typeof window < "u" && window.btoa ? window.btoa(unescape(encodeURIComponent(d))) : ""), A = new Image();
|
|
189
|
+
await new Promise((s, x) => {
|
|
190
|
+
A.onload = s, A.onerror = x, A.src = b;
|
|
191
|
+
});
|
|
192
|
+
const k = document.createElement("canvas");
|
|
193
|
+
k.width = c * n, k.height = p * n;
|
|
194
|
+
const R = k.getContext("2d");
|
|
195
|
+
R.scale(n, n), a && (R.fillStyle = a, R.fillRect(0, 0, c, p)), R.drawImage(A, 0, 0);
|
|
196
|
+
let M;
|
|
197
|
+
try {
|
|
198
|
+
M = k.toDataURL("image/png");
|
|
199
|
+
} catch (s) {
|
|
200
|
+
console.error("Falha ao exportar imagem: canvas contaminado.", s);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const o = document.createElement("a");
|
|
204
|
+
o.download = t, o.href = M, document.body.appendChild(o), o.click(), document.body.removeChild(o);
|
|
205
|
+
}
|
|
206
|
+
const Ne = '<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>';
|
|
207
|
+
function K(e, r, t) {
|
|
208
|
+
const n = ne(null);
|
|
209
|
+
async function a() {
|
|
210
|
+
await St(n.value, {
|
|
211
|
+
nomeArquivo: e.nomeArquivoExport,
|
|
212
|
+
corFundo: r.value.bg !== "transparent" ? r.value.bg : null
|
|
213
|
+
}), t("exportado");
|
|
214
|
+
}
|
|
215
|
+
return { cardRef: n, onExportar: a, iconeExportar: Ne };
|
|
216
|
+
}
|
|
217
|
+
const At = { class: "nc-topo nc-flex nc-align-items-start nc-justify-content-between nc-gap-3" }, Bt = {
|
|
218
|
+
key: 0,
|
|
219
|
+
class: "nc-legendas-flex nc-flex nc-flex-column"
|
|
220
|
+
}, Rt = {
|
|
221
|
+
key: 1,
|
|
222
|
+
class: "nc-actions nc-inline-flex nc-align-items-center nc-gap-2"
|
|
223
|
+
}, qt = ["innerHTML"], wt = {
|
|
224
|
+
__name: "CardCabecalho",
|
|
225
|
+
props: {
|
|
226
|
+
legenda: { type: String, default: null },
|
|
227
|
+
sublegenda: { type: String, default: null },
|
|
228
|
+
palette: { type: Object, required: !0 },
|
|
229
|
+
textoBotao: { type: String, default: "Ver mais" },
|
|
230
|
+
botaoVisivel: { type: Boolean, default: !1 },
|
|
231
|
+
exportar: { type: Boolean, default: !1 },
|
|
232
|
+
opacidadeLegenda: { type: [Number, String], default: 0.95 }
|
|
233
|
+
},
|
|
234
|
+
emits: ["botaoAcao", "exportar"],
|
|
235
|
+
setup(e, { emit: r }) {
|
|
236
|
+
const t = r, n = Ne;
|
|
237
|
+
return (a, u) => (y(), v("div", At, [
|
|
238
|
+
a.$slots.legenda || e.legenda || a.$slots.sublegenda || e.sublegenda ? (y(), v("div", Bt, [
|
|
239
|
+
a.$slots.legenda || e.legenda ? (y(), v("div", {
|
|
240
|
+
key: 0,
|
|
241
|
+
class: "nc-text-xs nc-font-medium",
|
|
242
|
+
style: q({ color: e.palette.text, opacity: e.opacidadeLegenda })
|
|
243
|
+
}, [
|
|
244
|
+
$(a.$slots, "legenda", {}, () => [
|
|
245
|
+
j(L(e.legenda), 1)
|
|
246
|
+
], !0)
|
|
247
|
+
], 4)) : S("", !0),
|
|
248
|
+
a.$slots.sublegenda || e.sublegenda ? (y(), v("div", {
|
|
249
|
+
key: 1,
|
|
250
|
+
class: "nc-text-xs",
|
|
251
|
+
style: q({ color: e.palette.muted })
|
|
252
|
+
}, [
|
|
253
|
+
$(a.$slots, "sublegenda", {}, () => [
|
|
254
|
+
j(L(e.sublegenda), 1)
|
|
255
|
+
], !0)
|
|
256
|
+
], 4)) : S("", !0)
|
|
257
|
+
])) : S("", !0),
|
|
258
|
+
a.$slots.actions || e.botaoVisivel || e.exportar ? (y(), v("div", Rt, [
|
|
259
|
+
$(a.$slots, "actions", {}, () => [
|
|
260
|
+
e.botaoVisivel ? (y(), v("button", {
|
|
261
|
+
key: 0,
|
|
262
|
+
class: "nc-btn nc-inline-flex nc-align-items-center",
|
|
263
|
+
style: q({ color: e.palette.text, borderColor: g(D)(e.palette.text, 0.18) }),
|
|
264
|
+
onClick: u[0] || (u[0] = (c) => t("botaoAcao"))
|
|
265
|
+
}, [
|
|
266
|
+
E("span", null, L(e.textoBotao), 1)
|
|
267
|
+
], 4)) : S("", !0)
|
|
268
|
+
], !0),
|
|
269
|
+
e.exportar ? (y(), v("button", {
|
|
270
|
+
key: 0,
|
|
271
|
+
type: "button",
|
|
272
|
+
class: "nc-exportar nc-inline-flex nc-align-items-center nc-justify-content-center",
|
|
273
|
+
style: q({ color: e.palette.muted, borderColor: g(D)(e.palette.text, 0.18) }),
|
|
274
|
+
title: "Exportar como imagem",
|
|
275
|
+
"aria-label": "Exportar como imagem",
|
|
276
|
+
onClick: u[1] || (u[1] = (c) => t("exportar")),
|
|
277
|
+
innerHTML: g(n)
|
|
278
|
+
}, null, 12, qt)) : S("", !0)
|
|
279
|
+
])) : S("", !0)
|
|
280
|
+
]));
|
|
281
|
+
}
|
|
282
|
+
}, _ = /* @__PURE__ */ W(wt, [["__scopeId", "data-v-35f0d105"]]), Tt = { class: "nc-titulos nc-flex nc-flex-column" }, ue = {
|
|
283
|
+
__name: "CardTitulos",
|
|
284
|
+
props: {
|
|
285
|
+
titulo: { type: String, default: null },
|
|
286
|
+
descricao: { type: String, default: null },
|
|
287
|
+
palette: { type: Object, required: !0 }
|
|
288
|
+
},
|
|
289
|
+
setup(e) {
|
|
290
|
+
return (r, t) => (y(), v("div", Tt, [
|
|
291
|
+
r.$slots.titulo || e.titulo ? (y(), v("div", {
|
|
292
|
+
key: 0,
|
|
293
|
+
class: "nc-m-0 nc-text-3xl nc-font-semibold",
|
|
294
|
+
style: q({ color: e.palette.text, lineHeight: "33px", letterSpacing: "-1px" })
|
|
295
|
+
}, [
|
|
296
|
+
$(r.$slots, "titulo", {}, () => [
|
|
297
|
+
j(L(e.titulo), 1)
|
|
298
|
+
])
|
|
299
|
+
], 4)) : S("", !0),
|
|
300
|
+
r.$slots.descricao || e.descricao ? (y(), v("div", {
|
|
301
|
+
key: 1,
|
|
302
|
+
class: "nc-text-sm nc-mt-1",
|
|
303
|
+
style: q({ color: e.palette.muted })
|
|
304
|
+
}, [
|
|
305
|
+
$(r.$slots, "descricao", {}, () => [
|
|
306
|
+
j(L(e.descricao), 1)
|
|
307
|
+
])
|
|
308
|
+
], 4)) : S("", !0)
|
|
309
|
+
]));
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
function ee(e) {
|
|
313
|
+
const r = F(() => e.tipoValor === "moeda" ? new Intl.NumberFormat(e.locale, { style: "currency", currency: e.moeda }) : e.tipoValor === "percentual" ? new Intl.NumberFormat(e.locale, { style: "percent", maximumFractionDigits: 2 }) : new Intl.NumberFormat(e.locale, { maximumFractionDigits: 2 }));
|
|
314
|
+
function t(n) {
|
|
315
|
+
if (n == null) return "";
|
|
316
|
+
const a = Number(n);
|
|
317
|
+
return Number.isNaN(a) ? String(n) : e.tipoValor === "percentual" ? r.value.format(a / 100) : r.value.format(a);
|
|
318
|
+
}
|
|
319
|
+
return { formatador: r, formatar: t };
|
|
320
|
+
}
|
|
321
|
+
const oe = "1px solid rgba(15,23,42,.06)";
|
|
322
|
+
function pe(e, { caretFlexivel: r = !1 } = {}) {
|
|
323
|
+
let t = e.querySelector(".nc-tt");
|
|
324
|
+
if (t) return t;
|
|
325
|
+
t = document.createElement("div"), t.className = "nc-tt", Object.assign(t.style, {
|
|
153
326
|
position: "absolute",
|
|
154
327
|
pointerEvents: "none",
|
|
155
|
-
transform:
|
|
328
|
+
transform: r ? "translateX(-50%)" : "translate(-50%, calc(-100% - 16px))",
|
|
156
329
|
transition: "opacity .18s ease, left .12s ease, top .12s ease",
|
|
157
330
|
opacity: "0",
|
|
158
331
|
background: "#ffffff",
|
|
@@ -166,9 +339,9 @@ function gt(t, { caretFlexivel: y = !1 } = {}) {
|
|
|
166
339
|
fontFamily: "inherit",
|
|
167
340
|
textAlign: "left"
|
|
168
341
|
});
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
const
|
|
342
|
+
const n = document.createElement("div");
|
|
343
|
+
n.className = "nc-tt__caret";
|
|
344
|
+
const a = {
|
|
172
345
|
position: "absolute",
|
|
173
346
|
left: "50%",
|
|
174
347
|
width: "10px",
|
|
@@ -177,120 +350,249 @@ function gt(t, { caretFlexivel: y = !1 } = {}) {
|
|
|
177
350
|
transform: "translateX(-50%) rotate(45deg)",
|
|
178
351
|
borderRadius: "2px"
|
|
179
352
|
};
|
|
180
|
-
|
|
353
|
+
r ? Object.assign(n.style, a) : Object.assign(n.style, a, {
|
|
181
354
|
bottom: "-5px",
|
|
182
355
|
borderRight: "1px solid rgba(15,23,42,.06)",
|
|
183
356
|
borderBottom: "1px solid rgba(15,23,42,.06)"
|
|
184
|
-
}),
|
|
185
|
-
const
|
|
186
|
-
return
|
|
357
|
+
}), t.appendChild(n);
|
|
358
|
+
const u = document.createElement("div");
|
|
359
|
+
return u.className = "nc-tt__content", Object.assign(u.style, { position: "relative", background: "#fff", borderRadius: "8px" }), t.appendChild(u), e.appendChild(t), t;
|
|
187
360
|
}
|
|
188
|
-
function
|
|
189
|
-
const
|
|
190
|
-
return
|
|
361
|
+
function fe(e) {
|
|
362
|
+
const r = e.canvas.parentNode;
|
|
363
|
+
return r ? (getComputedStyle(r).position === "static" && (r.style.position = "relative"), r) : null;
|
|
191
364
|
}
|
|
192
|
-
function
|
|
193
|
-
const
|
|
194
|
-
return
|
|
365
|
+
function ge(e, r, t, n = 4) {
|
|
366
|
+
const a = r / 2;
|
|
367
|
+
return e - a < n ? a + n : e + a > t - n ? t - a - n : e;
|
|
195
368
|
}
|
|
196
|
-
function
|
|
197
|
-
|
|
198
|
-
let d = "";
|
|
199
|
-
for (let o = 0; o < e.length; o++) {
|
|
200
|
-
const B = e[o];
|
|
201
|
-
let $ = e.getPropertyValue(B);
|
|
202
|
-
if ($ && $.indexOf("url(") !== -1 && !/url\(["']?data:/.test($))
|
|
203
|
-
if (B === "background-image" || B === "background" || B === "mask-image" || B === "border-image" || B === "border-image-source")
|
|
204
|
-
$ = "none";
|
|
205
|
-
else
|
|
206
|
-
continue;
|
|
207
|
-
d += `${B}:${$};`;
|
|
208
|
-
}
|
|
209
|
-
y.setAttribute("style", d);
|
|
369
|
+
function me(e) {
|
|
370
|
+
return e ? `<div style="font-size:9px;font-weight:500;color:#94A3B8;letter-spacing:.04em;text-transform:uppercase;line-height:1;margin-bottom:4px;">${e}</div>` : "";
|
|
210
371
|
}
|
|
211
|
-
function
|
|
212
|
-
|
|
213
|
-
const e = t.querySelectorAll("*"), d = y.querySelectorAll("*");
|
|
214
|
-
for (let o = 0; o < e.length; o++)
|
|
215
|
-
d[o] && wt(e[o], d[o]);
|
|
372
|
+
function Oe(e) {
|
|
373
|
+
return e ? `<div style="font-size:11px;font-weight:500;color:#64748B;line-height:1.3;margin-top:3px;">${e}</div>` : "";
|
|
216
374
|
}
|
|
217
|
-
function
|
|
218
|
-
const
|
|
219
|
-
e
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
375
|
+
function he(e, r, { nome: t = "", alinharDireita: n = !1, margemTopo: a = !1 } = {}) {
|
|
376
|
+
const u = t ? `<span style="font-size:11px;color:#64748B;margin-right:6px;">${t}</span>` : "";
|
|
377
|
+
return `<div style="display:flex;align-items:center;gap:6px;${a ? "margin-top:2px;" : ""}"><span style="width:6px;height:6px;border-radius:999px;background:${e};box-shadow:0 0 0 2px ${D(e, 0.15)};flex:0 0 auto;"></span>` + u + `<span style="font-size:12px;font-weight:700;color:#0F172A;letter-spacing:-.01em;line-height:1.1;${n ? "margin-left:auto;" : ""}">${r}</span></div>`;
|
|
378
|
+
}
|
|
379
|
+
function je(e, r) {
|
|
380
|
+
e && (r ? Object.assign(e.style, {
|
|
381
|
+
top: "-5px",
|
|
382
|
+
bottom: "",
|
|
383
|
+
borderLeft: oe,
|
|
384
|
+
borderTop: oe,
|
|
385
|
+
borderRight: "",
|
|
386
|
+
borderBottom: ""
|
|
387
|
+
}) : Object.assign(e.style, {
|
|
388
|
+
top: "",
|
|
389
|
+
bottom: "-5px",
|
|
390
|
+
borderRight: oe,
|
|
391
|
+
borderBottom: oe,
|
|
392
|
+
borderLeft: "",
|
|
393
|
+
borderTop: ""
|
|
394
|
+
}));
|
|
395
|
+
}
|
|
396
|
+
function ye({ corDe: e, valorDe: r, linhasExtrasDe: t = null, deveOcultar: n = () => !1 }) {
|
|
397
|
+
return function(u) {
|
|
398
|
+
const { chart: c, tooltip: p } = u, m = fe(c);
|
|
399
|
+
if (!m) return;
|
|
400
|
+
const l = pe(m);
|
|
401
|
+
if (p.opacity === 0 || n()) {
|
|
402
|
+
l.style.opacity = "0";
|
|
225
403
|
return;
|
|
226
404
|
}
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
405
|
+
const d = p.dataPoints && p.dataPoints[0], h = l.querySelector(".nc-tt__content"), b = d && t ? t(d) : [], A = (Array.isArray(b) ? b : [b]).filter(Boolean);
|
|
406
|
+
h.innerHTML = me((p.title || []).join(" ")) + he(d ? e(d) : "#3B82F6", d ? r(d) : "") + A.map((T) => Oe(T)).join("");
|
|
407
|
+
const { offsetLeft: k, offsetTop: R } = c.canvas;
|
|
408
|
+
l.style.opacity = "1", l.style.visibility = "hidden", l.style.left = "0px", l.style.top = "0px";
|
|
409
|
+
const M = l.offsetWidth, o = l.offsetHeight, s = 4, x = k + p.caretX, f = R + p.caretY, C = ge(x, M, m.clientWidth, s), i = f < o + 16 + s;
|
|
410
|
+
l.style.transform = i ? "translate(-50%, 16px)" : "translate(-50%, calc(-100% - 16px))";
|
|
411
|
+
const B = l.querySelector(".nc-tt__caret");
|
|
412
|
+
if (je(B, i), B) {
|
|
413
|
+
const T = x - C, w = M / 2, I = Math.max(-w + 8, Math.min(w - 8, T));
|
|
414
|
+
B.style.left = `calc(50% + ${I}px)`;
|
|
415
|
+
}
|
|
416
|
+
l.style.left = C + "px", l.style.top = f + "px", l.style.visibility = "visible";
|
|
417
|
+
};
|
|
230
418
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const {
|
|
234
|
-
nomeArquivo: e = "componente.png",
|
|
235
|
-
escala: d = 2,
|
|
236
|
-
corFundo: o = null
|
|
237
|
-
} = y, B = t.getBoundingClientRect(), $ = Math.ceil(B.width), R = Math.ceil(B.height), I = t.cloneNode(!0);
|
|
238
|
-
re(t, I), ne(t, I), I.style.margin = "0", I.style.transform = "none";
|
|
239
|
-
const w = new XMLSerializer().serializeToString(I), F = `<svg xmlns="http://www.w3.org/2000/svg" width="${$}" height="${R}"><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="width:${$}px;height:${R}px;">` + w + "</div></foreignObject></svg>", Q = "data:image/svg+xml;base64," + (typeof window < "u" && window.btoa ? window.btoa(unescape(encodeURIComponent(F))) : ""), X = new Image();
|
|
240
|
-
await new Promise((j, G) => {
|
|
241
|
-
X.onload = j, X.onerror = G, X.src = Q;
|
|
242
|
-
});
|
|
243
|
-
const _ = document.createElement("canvas");
|
|
244
|
-
_.width = $ * d, _.height = R * d;
|
|
245
|
-
const K = _.getContext("2d");
|
|
246
|
-
K.scale(d, d), o && (K.fillStyle = o, K.fillRect(0, 0, $, R)), K.drawImage(X, 0, 0);
|
|
247
|
-
let p;
|
|
248
|
-
try {
|
|
249
|
-
p = _.toDataURL("image/png");
|
|
250
|
-
} catch (j) {
|
|
251
|
-
console.error("Falha ao exportar imagem: canvas contaminado.", j);
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
const E = document.createElement("a");
|
|
255
|
-
E.download = e, E.href = p, document.body.appendChild(E), E.click(), document.body.removeChild(E);
|
|
419
|
+
function Et(e, r, t, n, a, u, c) {
|
|
420
|
+
e.fillStyle = r.corRotulo, e.beginPath(), e.roundRect ? e.roundRect(t, n, a, u, c) : (e.moveTo(t + c, n), e.lineTo(t + a - c, n), e.quadraticCurveTo(t + a, n, t + a, n + c), e.lineTo(t + a, n + u - c), e.quadraticCurveTo(t + a, n + u, t + a - c, n + u), e.lineTo(t + c, n + u), e.quadraticCurveTo(t, n + u, t, n + u - c), e.lineTo(t, n + c), e.quadraticCurveTo(t, n, t + c, n)), e.fill(), e.fillStyle = r.corTexto, e.textBaseline = "middle", e.textAlign = "center", e.fillText(r.rotulo, t + a / 2, n + u / 2);
|
|
256
421
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
422
|
+
function Ft(e) {
|
|
423
|
+
let r = e.querySelector(".nc-tt-linhaRef");
|
|
424
|
+
return r || (r = document.createElement("div"), r.className = "nc-tt-linhaRef", Object.assign(r.style, {
|
|
425
|
+
position: "absolute",
|
|
426
|
+
pointerEvents: "none",
|
|
427
|
+
transform: "translate(-50%, calc(-100% - 12px))",
|
|
428
|
+
transition: "opacity .18s ease, left .12s ease, top .12s ease",
|
|
429
|
+
opacity: "0",
|
|
430
|
+
background: "#ffffff",
|
|
431
|
+
borderRadius: "10px",
|
|
432
|
+
padding: "8px 11px",
|
|
433
|
+
boxShadow: "0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.12)",
|
|
434
|
+
border: "1px solid rgba(15,23,42,.06)",
|
|
435
|
+
whiteSpace: "nowrap",
|
|
436
|
+
zIndex: "11",
|
|
437
|
+
fontFamily: "'Inter', sans-serif",
|
|
438
|
+
textAlign: "left"
|
|
439
|
+
}), e.appendChild(r), r);
|
|
440
|
+
}
|
|
441
|
+
function Pe({ linhasReferencia: e, horizontal: r = () => !1, formatar: t }) {
|
|
442
|
+
const n = F(() => {
|
|
443
|
+
const p = e();
|
|
444
|
+
return p ? (Array.isArray(p) ? p : [p]).filter((l) => l && (typeof l == "number" || typeof l.valor == "number")).map((l) => typeof l == "number" ? { valor: l, rotulo: null, cor: "#0F172A", corRotulo: "#0F172A", corTexto: "#FFFFFF", tracejado: [6, 6], espessura: 1 } : {
|
|
445
|
+
valor: l.valor,
|
|
446
|
+
rotulo: l.rotulo ?? null,
|
|
447
|
+
cor: l.cor || "#0F172A",
|
|
448
|
+
corRotulo: l.corRotulo || l.cor || "#0F172A",
|
|
449
|
+
corTexto: l.corTexto || "#FFFFFF",
|
|
450
|
+
tracejado: l.tracejado || [6, 6],
|
|
451
|
+
espessura: l.espessura ?? 1
|
|
452
|
+
}) : [];
|
|
453
|
+
}), a = [];
|
|
454
|
+
let u = null;
|
|
455
|
+
return {
|
|
456
|
+
linhasNormalizadas: n,
|
|
457
|
+
pluginLinhaReferencia: {
|
|
458
|
+
id: "linhaReferencia",
|
|
459
|
+
afterDatasetsDraw(p) {
|
|
460
|
+
const m = n.value;
|
|
461
|
+
if (a.length = 0, !m.length) return;
|
|
462
|
+
const { ctx: l, chartArea: d, scales: h } = p, b = r(), A = b ? h.x : h.y;
|
|
463
|
+
A && m.forEach((k) => {
|
|
464
|
+
const R = A.getPixelForValue(k.valor);
|
|
465
|
+
if (a.push({ linha: k, pos: R, horizontal: b, chartArea: d }), l.save(), l.beginPath(), l.setLineDash(k.tracejado), l.lineWidth = k.espessura, l.strokeStyle = k.cor, b) {
|
|
466
|
+
if (R < d.left || R > d.right) {
|
|
467
|
+
l.restore();
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
l.moveTo(R, d.top), l.lineTo(R, d.bottom);
|
|
471
|
+
} else {
|
|
472
|
+
if (R < d.top || R > d.bottom) {
|
|
473
|
+
l.restore();
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
l.moveTo(d.left, R), l.lineTo(d.right, R);
|
|
477
|
+
}
|
|
478
|
+
if (l.stroke(), l.setLineDash([]), k.rotulo) {
|
|
479
|
+
l.font = "600 11px 'Inter', sans-serif";
|
|
480
|
+
const M = 8, o = 5, x = l.measureText(k.rotulo).width, f = 12, C = x + M * 2, i = f + o * 2, B = i / 2;
|
|
481
|
+
let T, w;
|
|
482
|
+
b ? (T = R - C / 2, w = d.top - i - 6, w < 0 && (w = d.top + 6)) : (T = d.left - C - 6, w = R - i / 2, T < 0 && (T = d.left + 6)), Et(l, k, T, w, C, i, B);
|
|
483
|
+
}
|
|
484
|
+
l.restore();
|
|
485
|
+
});
|
|
486
|
+
},
|
|
487
|
+
beforeEvent(p, m) {
|
|
488
|
+
if (!a.length) {
|
|
489
|
+
u = null;
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
const l = m.event;
|
|
493
|
+
if (!l || l.type === "mouseout" || l.x == null || l.y == null) {
|
|
494
|
+
u = null;
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
const d = 8;
|
|
498
|
+
let h = null, b = 1 / 0;
|
|
499
|
+
for (const A of a) {
|
|
500
|
+
const k = A.horizontal ? Math.abs(l.x - A.pos) : Math.abs(l.y - A.pos), R = A.horizontal ? l.y >= A.chartArea.top && l.y <= A.chartArea.bottom : l.x >= A.chartArea.left && l.x <= A.chartArea.right;
|
|
501
|
+
k <= d && R && k < b && (b = k, h = A);
|
|
502
|
+
}
|
|
503
|
+
u = h;
|
|
504
|
+
},
|
|
505
|
+
afterEvent(p, m) {
|
|
506
|
+
if (!a.length) return;
|
|
507
|
+
const l = m.event;
|
|
508
|
+
if (!l) return;
|
|
509
|
+
const d = fe(p);
|
|
510
|
+
if (!d) return;
|
|
511
|
+
if (!u) {
|
|
512
|
+
const B = d.querySelector(".nc-tt-linhaRef");
|
|
513
|
+
B && (B.style.opacity = "0");
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
const h = u, b = Ft(d), A = h.linha.cor || "#0F172A";
|
|
517
|
+
b.innerHTML = me(h.linha.rotulo) + he(A, t(h.linha.valor));
|
|
518
|
+
const k = p.canvas;
|
|
519
|
+
b.style.opacity = "1", b.style.visibility = "hidden", b.style.left = "0px", b.style.top = "0px";
|
|
520
|
+
const R = b.offsetWidth, M = b.offsetHeight, o = 4;
|
|
521
|
+
let s, x;
|
|
522
|
+
h.horizontal ? (s = k.offsetLeft + h.pos, x = k.offsetTop + l.y) : (s = k.offsetLeft + l.x, x = k.offsetTop + h.pos);
|
|
523
|
+
const f = ge(s, R, d.clientWidth, o);
|
|
524
|
+
let C = x;
|
|
525
|
+
const i = M + 16 + o;
|
|
526
|
+
C < i && (C = i), b.style.left = f + "px", b.style.top = C + "px", b.style.visibility = "visible";
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
temLinhaHover: () => !!u
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
const It = "0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06)";
|
|
533
|
+
function ve(e, r) {
|
|
534
|
+
if (!r) return e;
|
|
535
|
+
const t = { ...e };
|
|
536
|
+
for (const [n, a] of Object.entries(r))
|
|
537
|
+
t[n] && (t[n] = { ...t[n], default: a });
|
|
538
|
+
return t;
|
|
539
|
+
}
|
|
540
|
+
function Z(e) {
|
|
541
|
+
return ve({
|
|
272
542
|
legenda: { type: String, default: null },
|
|
273
543
|
sublegenda: { type: String, default: null },
|
|
274
544
|
titulo: { type: String, default: null },
|
|
275
545
|
descricao: { type: String, default: null },
|
|
276
546
|
tema: { type: String, default: "light" },
|
|
277
547
|
corFundo: { type: String, default: null },
|
|
278
|
-
corDetalhes: { type: String, default: "#3B82F6" },
|
|
279
548
|
corTexto: { type: String, default: null },
|
|
549
|
+
corBorda: { type: String, default: "#EAE8E8" },
|
|
550
|
+
borderRadius: { type: [String, Number], default: "0.75rem" },
|
|
551
|
+
sombra: { type: String, default: It },
|
|
280
552
|
textoBotao: { type: String, default: "Ver mais" },
|
|
281
|
-
direcao: {
|
|
282
|
-
type: String,
|
|
283
|
-
default: "top",
|
|
284
|
-
validator: (t) => ["top", "bottom", "left", "right"].includes(t)
|
|
285
|
-
},
|
|
286
553
|
botaoVisivel: { type: Boolean, default: !1 },
|
|
554
|
+
exportar: { type: Boolean, default: !1 },
|
|
555
|
+
nomeArquivoExport: { type: String, default: "card.png" }
|
|
556
|
+
}, e);
|
|
557
|
+
}
|
|
558
|
+
function te(e) {
|
|
559
|
+
return ve({
|
|
287
560
|
tipoValor: {
|
|
288
561
|
type: String,
|
|
289
562
|
default: "numero",
|
|
290
|
-
validator: (
|
|
563
|
+
validator: (r) => ["numero", "moeda", "percentual"].includes(r)
|
|
291
564
|
},
|
|
292
565
|
locale: { type: String, default: "pt-BR" },
|
|
293
|
-
moeda: { type: String, default: "BRL" }
|
|
566
|
+
moeda: { type: String, default: "BRL" }
|
|
567
|
+
}, e);
|
|
568
|
+
}
|
|
569
|
+
function ae(e = "top") {
|
|
570
|
+
return {
|
|
571
|
+
direcao: {
|
|
572
|
+
type: String,
|
|
573
|
+
default: e,
|
|
574
|
+
validator: (r) => ["top", "bottom", "left", "right"].includes(r)
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
function Ve(e) {
|
|
579
|
+
return ve({
|
|
580
|
+
rotuloCategoria: { type: String, default: "Categoria" },
|
|
581
|
+
rotuloQuantidade: { type: String, default: "Quantidade" },
|
|
582
|
+
mostrarCabecalho: { type: Boolean, default: !0 },
|
|
583
|
+
itensClicaveis: { type: Boolean, default: !1 }
|
|
584
|
+
}, e);
|
|
585
|
+
}
|
|
586
|
+
const Lt = { class: "card-linhas__header nc-flex nc-flex-column" }, zt = { class: "card-linhas__chart nc-flex-1" }, Mt = {
|
|
587
|
+
key: 0,
|
|
588
|
+
class: "card-linhas__footer nc-mt-3"
|
|
589
|
+
}, Dt = {
|
|
590
|
+
__name: "CardLinhas",
|
|
591
|
+
props: {
|
|
592
|
+
...Z({ nomeArquivoExport: "card-linhas.png" }),
|
|
593
|
+
...te(),
|
|
594
|
+
...ae("top"),
|
|
595
|
+
corDetalhes: { type: String, default: "#3B82F6" },
|
|
294
596
|
data: {
|
|
295
597
|
type: Array,
|
|
296
598
|
default: () => [
|
|
@@ -309,187 +611,77 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
309
611
|
]
|
|
310
612
|
},
|
|
311
613
|
height: { type: [String, Number], default: 280 },
|
|
312
|
-
borderRadius: { type: [String, Number], default: "0.75rem" },
|
|
313
|
-
sombra: { type: String, default: "0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06)" },
|
|
314
|
-
corBorda: { type: String, default: "#EAE8E8" },
|
|
315
614
|
linhasReferencia: { type: [Object, Array], default: null },
|
|
316
|
-
|
|
317
|
-
|
|
615
|
+
// Recebe o item original de `data` e retorna texto(s) extra(s) exibidos no
|
|
616
|
+
// tooltip abaixo do valor. Pode devolver uma string ou um array de strings.
|
|
617
|
+
detalheTooltip: { type: Function, default: null }
|
|
318
618
|
},
|
|
319
619
|
emits: ["botaoAcao", "exportado"],
|
|
320
|
-
setup(
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}), d("exportado");
|
|
327
|
-
}
|
|
328
|
-
const F = M(() => `card-linhas--${e.direcao}`), z = M(() => e.linhasReferencia ? (Array.isArray(e.linhasReferencia) ? e.linhasReferencia : [e.linhasReferencia]).filter((c) => c && (typeof c == "number" || typeof c.valor == "number")).map((c) => typeof c == "number" ? { valor: c, rotulo: null, cor: "#0F172A", corRotulo: "#0F172A", corTexto: "#FFFFFF", tracejado: [6, 6], espessura: 1 } : {
|
|
329
|
-
valor: c.valor,
|
|
330
|
-
rotulo: c.rotulo ?? null,
|
|
331
|
-
cor: c.cor || "#0F172A",
|
|
332
|
-
corRotulo: c.corRotulo || c.cor || "#0F172A",
|
|
333
|
-
corTexto: c.corTexto || "#FFFFFF",
|
|
334
|
-
tracejado: c.tracejado || [6, 6],
|
|
335
|
-
espessura: c.espessura ?? 1
|
|
336
|
-
}) : []), Q = [];
|
|
337
|
-
let X = null;
|
|
338
|
-
const K = [{
|
|
339
|
-
id: "linhaReferencia",
|
|
340
|
-
afterDatasetsDraw(u) {
|
|
341
|
-
const c = z.value;
|
|
342
|
-
if (Q.length = 0, !c.length) return;
|
|
343
|
-
const { ctx: a, chartArea: b, scales: v } = u, i = v.y;
|
|
344
|
-
i && c.forEach((f) => {
|
|
345
|
-
const n = i.getPixelForValue(f.valor);
|
|
346
|
-
if (Q.push({ linha: f, pos: n, chartArea: b }), a.save(), a.beginPath(), a.setLineDash(f.tracejado), a.lineWidth = f.espessura, a.strokeStyle = f.cor, n < b.top || n > b.bottom) {
|
|
347
|
-
a.restore();
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
if (a.moveTo(b.left, n), a.lineTo(b.right, n), a.stroke(), a.setLineDash([]), f.rotulo) {
|
|
351
|
-
a.font = "600 11px 'Inter', sans-serif";
|
|
352
|
-
const m = 8, h = 5, T = a.measureText(f.rotulo).width, q = 12, C = T + m * 2, V = q + h * 2, S = V / 2;
|
|
353
|
-
let P = b.left - C - 6, O = n - V / 2;
|
|
354
|
-
P < 0 && (P = b.left + 6), a.fillStyle = f.corRotulo, a.beginPath(), a.roundRect ? a.roundRect(P, O, C, V, S) : (a.moveTo(P + S, O), a.lineTo(P + C - S, O), a.quadraticCurveTo(P + C, O, P + C, O + S), a.lineTo(P + C, O + V - S), a.quadraticCurveTo(P + C, O + V, P + C - S, O + V), a.lineTo(P + S, O + V), a.quadraticCurveTo(P, O + V, P, O + V - S), a.lineTo(P, O + S), a.quadraticCurveTo(P, O, P + S, O)), a.fill(), a.fillStyle = f.corTexto, a.textBaseline = "middle", a.textAlign = "center", a.fillText(f.rotulo, P + C / 2, O + V / 2);
|
|
355
|
-
}
|
|
356
|
-
a.restore();
|
|
357
|
-
});
|
|
358
|
-
},
|
|
359
|
-
beforeEvent(u, c) {
|
|
360
|
-
if (!Q.length) {
|
|
361
|
-
X = null;
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
const a = c.event;
|
|
365
|
-
if (!a || a.type === "mouseout" || a.x == null || a.y == null) {
|
|
366
|
-
X = null;
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
const b = 8;
|
|
370
|
-
let v = null, i = 1 / 0;
|
|
371
|
-
for (const f of Q) {
|
|
372
|
-
const n = Math.abs(a.y - f.pos), m = a.x >= f.chartArea.left && a.x <= f.chartArea.right;
|
|
373
|
-
n <= b && m && n < i && (i = n, v = f);
|
|
374
|
-
}
|
|
375
|
-
X = v;
|
|
376
|
-
},
|
|
377
|
-
afterEvent(u, c) {
|
|
378
|
-
if (!Q.length) return;
|
|
379
|
-
const a = c.event;
|
|
380
|
-
if (!a) return;
|
|
381
|
-
const b = rt(u);
|
|
382
|
-
if (!b) return;
|
|
383
|
-
let v = b.querySelector(".nc-tt-linhaRef");
|
|
384
|
-
if (!X) {
|
|
385
|
-
v && (v.style.opacity = "0");
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
const i = X;
|
|
389
|
-
v || (v = document.createElement("div"), v.className = "nc-tt-linhaRef", Object.assign(v.style, {
|
|
390
|
-
position: "absolute",
|
|
391
|
-
pointerEvents: "none",
|
|
392
|
-
transform: "translate(-50%, calc(-100% - 12px))",
|
|
393
|
-
transition: "opacity .18s ease, left .12s ease, top .12s ease",
|
|
394
|
-
opacity: "0",
|
|
395
|
-
background: "#ffffff",
|
|
396
|
-
borderRadius: "10px",
|
|
397
|
-
padding: "8px 11px",
|
|
398
|
-
boxShadow: "0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.12)",
|
|
399
|
-
border: "1px solid rgba(15,23,42,.06)",
|
|
400
|
-
whiteSpace: "nowrap",
|
|
401
|
-
zIndex: "11",
|
|
402
|
-
fontFamily: "'Inter', sans-serif",
|
|
403
|
-
textAlign: "left"
|
|
404
|
-
}), b.appendChild(v));
|
|
405
|
-
const f = i.linha.cor || "#0F172A", n = $(i.linha.valor), m = i.linha.rotulo;
|
|
406
|
-
v.innerHTML = (m ? `<div style="font-size:9px;font-weight:500;color:#94A3B8;letter-spacing:.04em;text-transform:uppercase;line-height:1;margin-bottom:4px;">${m}</div>` : "") + `<div style="display:flex;align-items:center;gap:6px;"><span style="width:6px;height:6px;border-radius:999px;background:${f};box-shadow:0 0 0 2px ${D(f, 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}</span></div>`;
|
|
407
|
-
const h = u.canvas;
|
|
408
|
-
v.style.opacity = "1", v.style.visibility = "hidden", v.style.left = "0px", v.style.top = "0px";
|
|
409
|
-
const H = v.offsetWidth, T = v.offsetHeight, q = 4, C = h.offsetLeft + a.x, V = h.offsetTop + i.pos, S = nt(C, H, b.clientWidth, q);
|
|
410
|
-
let P = V;
|
|
411
|
-
const O = T + 16 + q;
|
|
412
|
-
P < O && (P = O), v.style.left = S + "px", v.style.top = P + "px", v.style.visibility = "visible";
|
|
413
|
-
}
|
|
414
|
-
}], p = M(() => ({
|
|
415
|
-
labels: e.data.map((u) => u.rotulo),
|
|
620
|
+
setup(e, { emit: r }) {
|
|
621
|
+
const t = e, n = r, { palette: a, cardStyle: u } = G(t), { formatar: c } = ee(t), { cardRef: p, onExportar: m, iconeExportar: l } = K(t, a, n), d = F(() => `card-linhas--${t.direcao}`), { linhasNormalizadas: h, pluginLinhaReferencia: b, temLinhaHover: A } = Pe({
|
|
622
|
+
linhasReferencia: () => t.linhasReferencia,
|
|
623
|
+
formatar: c
|
|
624
|
+
}), k = [b], R = F(() => ({
|
|
625
|
+
labels: t.data.map((s) => s.rotulo),
|
|
416
626
|
datasets: [
|
|
417
627
|
{
|
|
418
|
-
data:
|
|
419
|
-
borderColor:
|
|
628
|
+
data: t.data.map((s) => s.quantidade),
|
|
629
|
+
borderColor: t.corDetalhes,
|
|
420
630
|
borderWidth: 3,
|
|
421
631
|
borderJoinStyle: "round",
|
|
422
632
|
borderCapStyle: "round",
|
|
423
|
-
backgroundColor: (
|
|
424
|
-
const { chart:
|
|
425
|
-
if (!
|
|
426
|
-
const
|
|
427
|
-
return
|
|
633
|
+
backgroundColor: (s) => {
|
|
634
|
+
const { chart: x } = s, { ctx: f, chartArea: C } = x;
|
|
635
|
+
if (!C) return "transparent";
|
|
636
|
+
const i = t.corDetalhes || "#0400FF", B = "#7C7C7C", T = f.createLinearGradient(0, C.top, 0, C.bottom);
|
|
637
|
+
return T.addColorStop(0.16, D(i, 0.2)), T.addColorStop(1, D(B, 0)), T;
|
|
428
638
|
},
|
|
429
639
|
fill: !0,
|
|
430
640
|
tension: 0.45,
|
|
431
641
|
pointRadius: 0,
|
|
432
642
|
pointHoverRadius: 6,
|
|
433
643
|
pointHoverBorderWidth: 3,
|
|
434
|
-
pointHoverBackgroundColor:
|
|
435
|
-
pointHoverBorderColor:
|
|
644
|
+
pointHoverBackgroundColor: t.corDetalhes,
|
|
645
|
+
pointHoverBorderColor: a.value.bg === "transparent" ? "#fff" : a.value.bg,
|
|
436
646
|
clip: !1
|
|
437
647
|
}
|
|
438
648
|
]
|
|
439
|
-
}))
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
v.style.opacity = "0";
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
const i = a.title || [], f = (a.body || []).flatMap((Z) => Z.lines), n = v.querySelector(".nc-tt__content"), m = e.corDetalhes || "#3B82F6";
|
|
449
|
-
n.innerHTML = `<div style="font-size:9px;font-weight:500;color:#94A3B8;letter-spacing:.04em;text-transform:uppercase;line-height:1;margin-bottom:4px;">${i.join(" ")}</div><div style="display:flex;align-items:center;gap:6px;"><span style="width:6px;height:6px;border-radius:999px;background:${m};box-shadow:0 0 0 2px ${D(m, 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.join(" ")}</span></div>`;
|
|
450
|
-
const { offsetLeft: h, offsetTop: H } = c.canvas;
|
|
451
|
-
v.style.opacity = "1", v.style.visibility = "hidden", v.style.left = "0px", v.style.top = "0px";
|
|
452
|
-
const T = v.offsetWidth, q = v.offsetHeight, C = 4, V = h + a.caretX, S = H + a.caretY, P = nt(V, T, b.clientWidth, C), O = q + 16 + C, tt = S < O;
|
|
453
|
-
let U;
|
|
454
|
-
tt ? (v.style.transform = "translateX(-50%) translateY(16px)", U = S) : (v.style.transform = "translate(-50%, calc(-100% - 16px))", U = S), v.style.left = P + "px", v.style.top = U + "px";
|
|
455
|
-
const N = v.querySelector(".nc-tt__caret");
|
|
456
|
-
if (N) {
|
|
457
|
-
const Z = V - P, W = T / 2, J = Math.max(-W + 8, Math.min(W - 8, Z));
|
|
458
|
-
N.style.left = `calc(50% + ${J}px)`, tt ? (N.style.bottom = "", N.style.top = "-5px", N.style.borderRight = "", N.style.borderBottom = "", N.style.borderLeft = "1px solid rgba(15,23,42,.06)", N.style.borderTop = "1px solid rgba(15,23,42,.06)") : (N.style.top = "", N.style.bottom = "-5px", N.style.borderLeft = "", N.style.borderTop = "", N.style.borderRight = "1px solid rgba(15,23,42,.06)", N.style.borderBottom = "1px solid rgba(15,23,42,.06)");
|
|
459
|
-
}
|
|
460
|
-
v.style.visibility = "visible";
|
|
461
|
-
}
|
|
462
|
-
const j = M(() => ({
|
|
649
|
+
})), M = ye({
|
|
650
|
+
corDe: () => t.corDetalhes || "#3B82F6",
|
|
651
|
+
valorDe: (s) => c(s.parsed.y),
|
|
652
|
+
linhasExtrasDe: t.detalheTooltip ? (s) => t.detalheTooltip(t.data[s.dataIndex], s.dataIndex) : null,
|
|
653
|
+
deveOcultar: A
|
|
654
|
+
}), o = F(() => ({
|
|
463
655
|
responsive: !0,
|
|
464
656
|
maintainAspectRatio: !1,
|
|
465
657
|
interaction: { intersect: !1, mode: "index" },
|
|
466
658
|
layout: {
|
|
467
|
-
padding: { top:
|
|
659
|
+
padding: { top: h.value.length ? 24 : 0, right: 0, bottom: 0, left: 0 }
|
|
468
660
|
},
|
|
469
661
|
plugins: {
|
|
470
662
|
legend: { display: !1 },
|
|
471
663
|
tooltip: {
|
|
472
664
|
enabled: !1,
|
|
473
|
-
external:
|
|
665
|
+
external: M,
|
|
474
666
|
callbacks: {
|
|
475
|
-
title: (
|
|
476
|
-
var
|
|
477
|
-
return ((
|
|
667
|
+
title: (s) => {
|
|
668
|
+
var x;
|
|
669
|
+
return ((x = s[0]) == null ? void 0 : x.label) ?? "";
|
|
478
670
|
},
|
|
479
|
-
label: (
|
|
671
|
+
label: (s) => c(s.parsed.y)
|
|
480
672
|
}
|
|
481
673
|
}
|
|
482
674
|
},
|
|
483
675
|
scales: {
|
|
484
676
|
x: {
|
|
485
677
|
display: !0,
|
|
486
|
-
afterFit: (
|
|
487
|
-
|
|
678
|
+
afterFit: (s) => {
|
|
679
|
+
s.paddingLeft = 0, s.paddingRight = 0;
|
|
488
680
|
},
|
|
489
681
|
grid: { display: !1, drawBorder: !1 },
|
|
490
682
|
border: { display: !1 },
|
|
491
683
|
ticks: {
|
|
492
|
-
color:
|
|
684
|
+
color: a.value.muted,
|
|
493
685
|
font: { size: 10, family: "'Inter', sans-serif" },
|
|
494
686
|
padding: 8,
|
|
495
687
|
align: "inner"
|
|
@@ -499,142 +691,167 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
499
691
|
display: !1,
|
|
500
692
|
grid: { display: !1 },
|
|
501
693
|
beginAtZero: !0,
|
|
502
|
-
suggestedMax:
|
|
694
|
+
suggestedMax: h.value.length ? Math.max(...h.value.map((s) => s.valor)) : void 0
|
|
503
695
|
}
|
|
504
696
|
}
|
|
505
697
|
}));
|
|
506
|
-
|
|
507
|
-
d("botaoAcao");
|
|
508
|
-
}
|
|
509
|
-
return (u, c) => (l(), s("div", {
|
|
698
|
+
return (s, x) => (y(), v("div", {
|
|
510
699
|
ref_key: "cardRef",
|
|
511
|
-
ref:
|
|
512
|
-
class:
|
|
513
|
-
style:
|
|
700
|
+
ref: p,
|
|
701
|
+
class: Q(["card-linhas nc-p-4 nc-flex", d.value]),
|
|
702
|
+
style: q(g(u))
|
|
514
703
|
}, [
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
key: 0
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
],
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
class: "text-sm mt-1",
|
|
573
|
-
style: x({ color: r(o).muted })
|
|
574
|
-
}, [
|
|
575
|
-
L(u.$slots, "descricao", {}, () => [
|
|
576
|
-
Y(A(t.descricao), 1)
|
|
577
|
-
], !0)
|
|
578
|
-
], 4)) : g("", !0)
|
|
579
|
-
])) : g("", !0)
|
|
704
|
+
E("div", Lt, [
|
|
705
|
+
P(_, {
|
|
706
|
+
class: "card-linhas__topo",
|
|
707
|
+
legenda: s.legenda,
|
|
708
|
+
sublegenda: s.sublegenda,
|
|
709
|
+
palette: g(a),
|
|
710
|
+
"texto-botao": s.textoBotao,
|
|
711
|
+
"botao-visivel": s.botaoVisivel,
|
|
712
|
+
exportar: s.exportar,
|
|
713
|
+
"opacidade-legenda": "0.85",
|
|
714
|
+
onBotaoAcao: x[0] || (x[0] = (f) => n("botaoAcao")),
|
|
715
|
+
onExportar: g(m)
|
|
716
|
+
}, J({ _: 2 }, [
|
|
717
|
+
s.$slots.legenda ? {
|
|
718
|
+
name: "legenda",
|
|
719
|
+
fn: z(() => [
|
|
720
|
+
$(s.$slots, "legenda", {}, void 0, !0)
|
|
721
|
+
]),
|
|
722
|
+
key: "0"
|
|
723
|
+
} : void 0,
|
|
724
|
+
s.$slots.sublegenda ? {
|
|
725
|
+
name: "sublegenda",
|
|
726
|
+
fn: z(() => [
|
|
727
|
+
$(s.$slots, "sublegenda", {}, void 0, !0)
|
|
728
|
+
]),
|
|
729
|
+
key: "1"
|
|
730
|
+
} : void 0,
|
|
731
|
+
s.$slots.actions ? {
|
|
732
|
+
name: "actions",
|
|
733
|
+
fn: z(() => [
|
|
734
|
+
$(s.$slots, "actions", {}, void 0, !0)
|
|
735
|
+
]),
|
|
736
|
+
key: "2"
|
|
737
|
+
} : void 0
|
|
738
|
+
]), 1032, ["legenda", "sublegenda", "palette", "texto-botao", "botao-visivel", "exportar", "onExportar"]),
|
|
739
|
+
s.$slots.titulo || s.titulo || s.$slots.descricao || s.descricao ? (y(), ce(ue, {
|
|
740
|
+
key: 0,
|
|
741
|
+
class: "card-linhas__titulos nc-mt-3 nc-mb-2",
|
|
742
|
+
titulo: s.titulo,
|
|
743
|
+
descricao: s.descricao,
|
|
744
|
+
palette: g(a)
|
|
745
|
+
}, J({ _: 2 }, [
|
|
746
|
+
s.$slots.titulo ? {
|
|
747
|
+
name: "titulo",
|
|
748
|
+
fn: z(() => [
|
|
749
|
+
$(s.$slots, "titulo", {}, void 0, !0)
|
|
750
|
+
]),
|
|
751
|
+
key: "0"
|
|
752
|
+
} : void 0,
|
|
753
|
+
s.$slots.descricao ? {
|
|
754
|
+
name: "descricao",
|
|
755
|
+
fn: z(() => [
|
|
756
|
+
$(s.$slots, "descricao", {}, void 0, !0)
|
|
757
|
+
]),
|
|
758
|
+
key: "1"
|
|
759
|
+
} : void 0
|
|
760
|
+
]), 1032, ["titulo", "descricao", "palette"])) : S("", !0)
|
|
580
761
|
]),
|
|
581
|
-
|
|
582
|
-
|
|
762
|
+
E("div", zt, [
|
|
763
|
+
P(Y, {
|
|
583
764
|
type: "line",
|
|
584
|
-
data:
|
|
585
|
-
options:
|
|
586
|
-
plugins:
|
|
587
|
-
height:
|
|
765
|
+
data: R.value,
|
|
766
|
+
options: o.value,
|
|
767
|
+
plugins: k,
|
|
768
|
+
height: e.height
|
|
588
769
|
}, null, 8, ["data", "options", "height"])
|
|
589
770
|
]),
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
])) :
|
|
771
|
+
s.$slots.footer ? (y(), v("div", Mt, [
|
|
772
|
+
$(s.$slots, "footer", {}, void 0, !0)
|
|
773
|
+
])) : S("", !0)
|
|
593
774
|
], 6));
|
|
594
775
|
}
|
|
595
|
-
},
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
776
|
+
}, Nt = /* @__PURE__ */ W(Dt, [["__scopeId", "data-v-7715a094"]]), Ot = { class: "nc-tabela-valor" }, jt = ["role", "tabindex", "onMouseenter", "onFocus", "onClick", "onKeydown"], Pt = { class: "nc-tabela-rotulo nc-inline-flex nc-align-items-center nc-gap-2" }, Vt = { class: "nc-tabela-valor" }, Ht = {
|
|
777
|
+
__name: "TabelaDados",
|
|
778
|
+
props: {
|
|
779
|
+
data: { type: Array, required: !0 },
|
|
780
|
+
coresAplicadas: { type: Array, required: !0 },
|
|
781
|
+
palette: { type: Object, required: !0 },
|
|
782
|
+
formatar: { type: Function, required: !0 },
|
|
783
|
+
rotuloCategoria: { type: String, default: "Categoria" },
|
|
784
|
+
rotuloQuantidade: { type: String, default: "Quantidade" },
|
|
785
|
+
mostrarCabecalho: { type: Boolean, default: !0 },
|
|
786
|
+
itensClicaveis: { type: Boolean, default: !1 },
|
|
787
|
+
hoverIndex: { type: Number, default: null },
|
|
788
|
+
/** padding-inline aplicado à linha em hover/ativa (difere entre cards). */
|
|
789
|
+
padAtiva: { type: String, default: "0.40rem" }
|
|
790
|
+
},
|
|
791
|
+
emits: ["update:hoverIndex", "itemClicado"],
|
|
792
|
+
setup(e, { emit: r }) {
|
|
793
|
+
const t = e, n = r;
|
|
794
|
+
function a(u, c) {
|
|
795
|
+
t.itensClicaveis && n("itemClicado", { item: u, index: c, cor: t.coresAplicadas[c] });
|
|
796
|
+
}
|
|
797
|
+
return (u, c) => (y(), v("div", {
|
|
798
|
+
class: "nc-tabela nc-flex nc-flex-column",
|
|
799
|
+
style: q({ "--nc-tabela-pad-ativa": e.padAtiva })
|
|
800
|
+
}, [
|
|
801
|
+
e.mostrarCabecalho ? (y(), v("div", {
|
|
802
|
+
key: 0,
|
|
803
|
+
class: "nc-tabela-cab nc-flex nc-align-items-center nc-justify-content-between",
|
|
804
|
+
style: q({ color: e.palette.muted, borderColor: g(D)(e.palette.muted, 0.25) })
|
|
805
|
+
}, [
|
|
806
|
+
E("span", null, L(e.rotuloCategoria), 1),
|
|
807
|
+
E("span", Ot, L(e.rotuloQuantidade), 1)
|
|
808
|
+
], 4)) : S("", !0),
|
|
809
|
+
(y(!0), v(Me, null, De(e.data, (p, m) => (y(), v("div", {
|
|
810
|
+
key: m,
|
|
811
|
+
class: Q(["nc-tabela-linha nc-flex nc-align-items-center nc-justify-content-between", { "nc-tabela-linha--clicavel": e.itensClicaveis, "nc-tabela-linha--ativa": e.hoverIndex === m }]),
|
|
812
|
+
style: q({
|
|
813
|
+
color: e.palette.text,
|
|
814
|
+
cursor: e.itensClicaveis ? "pointer" : "default",
|
|
815
|
+
"--nc-linha-bg": g(D)(e.coresAplicadas[m], 0.05),
|
|
816
|
+
"--nc-linha-bg-forte": g(D)(e.coresAplicadas[m], 0.08)
|
|
817
|
+
}),
|
|
818
|
+
role: e.itensClicaveis ? "button" : null,
|
|
819
|
+
tabindex: e.itensClicaveis ? 0 : null,
|
|
820
|
+
onMouseenter: (l) => n("update:hoverIndex", m),
|
|
821
|
+
onMouseleave: c[0] || (c[0] = (l) => n("update:hoverIndex", null)),
|
|
822
|
+
onFocus: (l) => n("update:hoverIndex", m),
|
|
823
|
+
onBlur: c[1] || (c[1] = (l) => n("update:hoverIndex", null)),
|
|
824
|
+
onClick: (l) => a(p, m),
|
|
825
|
+
onKeydown: [
|
|
826
|
+
Fe(Ie((l) => a(p, m), ["prevent"]), ["enter"]),
|
|
827
|
+
Fe(Ie((l) => a(p, m), ["prevent"]), ["space"])
|
|
828
|
+
]
|
|
829
|
+
}, [
|
|
830
|
+
E("span", Pt, [
|
|
831
|
+
E("span", {
|
|
832
|
+
class: "nc-bolinha",
|
|
833
|
+
style: q({ background: e.coresAplicadas[m] })
|
|
834
|
+
}, null, 4),
|
|
835
|
+
E("span", null, L(p.rotulo), 1)
|
|
836
|
+
]),
|
|
837
|
+
E("span", Vt, L(e.formatar(p.quantidade)), 1)
|
|
838
|
+
], 46, jt))), 128))
|
|
839
|
+
], 4));
|
|
840
|
+
}
|
|
841
|
+
}, He = /* @__PURE__ */ W(Ht, [["__scopeId", "data-v-4b3f9e42"]]), Wt = { class: "card-pizza__corpo nc-flex nc-align-items-center" }, Xt = { class: "card-pizza__chart-wrap nc-flex nc-align-items-center nc-justify-content-center" }, Ut = { class: "card-pizza__chart" }, Jt = {
|
|
602
842
|
key: 0,
|
|
603
|
-
class: "nc-centro flex flex-column align-items-center justify-content-center"
|
|
604
|
-
},
|
|
843
|
+
class: "nc-centro nc-flex nc-flex-column nc-align-items-center nc-justify-content-center"
|
|
844
|
+
}, Qt = {
|
|
605
845
|
key: 0,
|
|
606
|
-
class: "card-pizza__footer mt-3"
|
|
607
|
-
},
|
|
846
|
+
class: "card-pizza__footer nc-mt-3"
|
|
847
|
+
}, Yt = {
|
|
608
848
|
__name: "CardPizza",
|
|
609
849
|
props: {
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
tema: { type: String, default: "light" },
|
|
615
|
-
corFundo: { type: String, default: null },
|
|
616
|
-
corTexto: { type: String, default: null },
|
|
617
|
-
corBorda: { type: String, default: "#EAE8E8" },
|
|
618
|
-
borderRadius: { type: [String, Number], default: "0.75rem" },
|
|
619
|
-
sombra: { type: String, default: "0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06)" },
|
|
850
|
+
...Z({ nomeArquivoExport: "card-pizza.png" }),
|
|
851
|
+
...te(),
|
|
852
|
+
...ae("right"),
|
|
853
|
+
...Ve(),
|
|
620
854
|
corDetalhes: { type: String, default: "#3B82F6" },
|
|
621
|
-
textoBotao: { type: String, default: "Ver mais" },
|
|
622
|
-
botaoVisivel: { type: Boolean, default: !1 },
|
|
623
|
-
direcao: {
|
|
624
|
-
type: String,
|
|
625
|
-
default: "right",
|
|
626
|
-
validator: (t) => ["left", "right", "top", "bottom"].includes(t)
|
|
627
|
-
},
|
|
628
|
-
rotuloCategoria: { type: String, default: "Categoria" },
|
|
629
|
-
rotuloQuantidade: { type: String, default: "Quantidade" },
|
|
630
|
-
mostrarCabecalho: { type: Boolean, default: !0 },
|
|
631
|
-
tipoValor: {
|
|
632
|
-
type: String,
|
|
633
|
-
default: "numero",
|
|
634
|
-
validator: (t) => ["numero", "moeda", "percentual"].includes(t)
|
|
635
|
-
},
|
|
636
|
-
locale: { type: String, default: "pt-BR" },
|
|
637
|
-
moeda: { type: String, default: "BRL" },
|
|
638
855
|
data: {
|
|
639
856
|
type: Array,
|
|
640
857
|
default: () => [
|
|
@@ -649,27 +866,21 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
649
866
|
},
|
|
650
867
|
height: { type: [String, Number], default: 260 },
|
|
651
868
|
cutout: { type: [String, Number], default: "70%" },
|
|
652
|
-
|
|
653
|
-
|
|
869
|
+
// Recebe o item original de `data` e retorna texto(s) extra(s) exibidos no
|
|
870
|
+
// tooltip abaixo do valor. Pode devolver uma string ou um array de strings.
|
|
871
|
+
detalheTooltip: { type: Function, default: null }
|
|
654
872
|
},
|
|
655
|
-
emits: ["botaoAcao", "exportado"],
|
|
656
|
-
setup(
|
|
657
|
-
const
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
}), d("exportado");
|
|
663
|
-
}
|
|
664
|
-
const w = M(() => `card-pizza--${e.direcao}`), F = M(() => {
|
|
665
|
-
const p = bt(e.corDetalhes, e.data.length);
|
|
666
|
-
return e.data.map((E, j) => E.cor ?? p[j]);
|
|
667
|
-
}), z = M(() => ({
|
|
668
|
-
labels: e.data.map((p) => p.rotulo),
|
|
873
|
+
emits: ["botaoAcao", "exportado", "itemClicado"],
|
|
874
|
+
setup(e, { emit: r }) {
|
|
875
|
+
const t = e, n = r, { palette: a, cardStyle: u } = G(t), { formatar: c } = ee(t), { cardRef: p, onExportar: m, iconeExportar: l } = K(t, a, n), d = F(() => `card-pizza--${t.direcao}`), h = F(() => {
|
|
876
|
+
const o = de(t.corDetalhes, t.data.length);
|
|
877
|
+
return t.data.map((s, x) => s.cor ?? o[x]);
|
|
878
|
+
}), b = F(() => ({
|
|
879
|
+
labels: t.data.map((o) => o.rotulo),
|
|
669
880
|
datasets: [
|
|
670
881
|
{
|
|
671
|
-
data:
|
|
672
|
-
backgroundColor:
|
|
882
|
+
data: t.data.map((o) => o.quantidade),
|
|
883
|
+
backgroundColor: h.value,
|
|
673
884
|
borderWidth: 0,
|
|
674
885
|
borderColor: "transparent",
|
|
675
886
|
hoverOffset: 6,
|
|
@@ -677,196 +888,141 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
677
888
|
spacing: 0
|
|
678
889
|
}
|
|
679
890
|
]
|
|
680
|
-
}))
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
return;
|
|
688
|
-
}
|
|
689
|
-
const c = j.title || [], a = j.dataPoints && j.dataPoints[0], b = a ? F.value[a.dataIndex] : "#3B82F6", v = a ? $(a.parsed) : "", i = u.querySelector(".nc-tt__content");
|
|
690
|
-
i.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:${b};box-shadow:0 0 0 2px ${D(b, 0.15)};flex:0 0 auto;"></span><span style="font-size:12px;font-weight:700;color:#0F172A;letter-spacing:-.01em;line-height:1.1;">${v}</span></div>`;
|
|
691
|
-
const { offsetLeft: f, offsetTop: n } = E.canvas;
|
|
692
|
-
u.style.opacity = "1", u.style.visibility = "hidden", u.style.left = "0px", u.style.top = "0px";
|
|
693
|
-
const m = u.offsetWidth, h = u.offsetHeight, H = 4, T = f + j.caretX, q = n + j.caretY, C = nt(T, m, G.clientWidth, H), V = q < h + 16 + H;
|
|
694
|
-
u.style.transform = V ? "translate(-50%, 16px)" : "translate(-50%, calc(-100% - 16px))";
|
|
695
|
-
const S = u.querySelector(".nc-tt__caret");
|
|
696
|
-
S && (V ? (S.style.bottom = "", S.style.top = "-5px", S.style.borderRight = "", S.style.borderBottom = "", S.style.borderLeft = "1px solid rgba(15,23,42,.06)", S.style.borderTop = "1px solid rgba(15,23,42,.06)") : (S.style.top = "", S.style.bottom = "-5px", S.style.borderLeft = "", S.style.borderTop = "", S.style.borderRight = "1px solid rgba(15,23,42,.06)", S.style.borderBottom = "1px solid rgba(15,23,42,.06)")), u.style.left = C + "px", u.style.top = q + "px", u.style.visibility = "visible";
|
|
891
|
+
})), A = ye({
|
|
892
|
+
corDe: (o) => h.value[o.dataIndex],
|
|
893
|
+
valorDe: (o) => c(o.parsed),
|
|
894
|
+
linhasExtrasDe: t.detalheTooltip ? (o) => t.detalheTooltip(t.data[o.dataIndex], o.dataIndex) : null
|
|
895
|
+
}), k = ne(null);
|
|
896
|
+
function R(o) {
|
|
897
|
+
n("itemClicado", o);
|
|
697
898
|
}
|
|
698
|
-
const
|
|
899
|
+
const M = F(() => ({
|
|
699
900
|
responsive: !0,
|
|
700
901
|
maintainAspectRatio: !1,
|
|
701
|
-
cutout:
|
|
902
|
+
cutout: t.cutout,
|
|
702
903
|
layout: { padding: 4 },
|
|
904
|
+
onHover: (o, s, x) => {
|
|
905
|
+
k.value = s.length ? s[0].index : null, x.canvas.style.cursor = t.itensClicaveis && s.length ? "pointer" : "default";
|
|
906
|
+
},
|
|
907
|
+
onClick: (o, s) => {
|
|
908
|
+
if (!t.itensClicaveis || !s.length) return;
|
|
909
|
+
const x = s[0].index, f = t.data[x];
|
|
910
|
+
f && R({ item: f, index: x, cor: h.value[x] });
|
|
911
|
+
},
|
|
703
912
|
plugins: {
|
|
704
913
|
legend: { display: !1 },
|
|
705
914
|
tooltip: {
|
|
706
915
|
enabled: !1,
|
|
707
|
-
external:
|
|
916
|
+
external: A,
|
|
708
917
|
callbacks: {
|
|
709
|
-
title: (
|
|
710
|
-
var
|
|
711
|
-
return ((
|
|
918
|
+
title: (o) => {
|
|
919
|
+
var s;
|
|
920
|
+
return ((s = o[0]) == null ? void 0 : s.label) ?? "";
|
|
712
921
|
},
|
|
713
|
-
label: (
|
|
922
|
+
label: (o) => c(o.parsed)
|
|
714
923
|
}
|
|
715
924
|
}
|
|
716
925
|
}
|
|
717
926
|
}));
|
|
718
|
-
|
|
719
|
-
d("botaoAcao");
|
|
720
|
-
}
|
|
721
|
-
const K = dt;
|
|
722
|
-
return (p, E) => (l(), s("div", {
|
|
927
|
+
return (o, s) => (y(), v("div", {
|
|
723
928
|
ref_key: "cardRef",
|
|
724
|
-
ref:
|
|
725
|
-
class:
|
|
726
|
-
style:
|
|
929
|
+
ref: p,
|
|
930
|
+
class: Q(["card-pizza nc-p-4 nc-flex nc-flex-column", d.value]),
|
|
931
|
+
style: q(g(u))
|
|
727
932
|
}, [
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
},
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
}, [
|
|
779
|
-
k("span", null, A(t.rotuloCategoria), 1),
|
|
780
|
-
k("span", Se, A(t.rotuloQuantidade), 1)
|
|
781
|
-
], 4)) : g("", !0),
|
|
782
|
-
(l(!0), s(yt, null, mt(t.data, (j, G) => (l(), s("div", {
|
|
783
|
-
key: G,
|
|
784
|
-
class: "nc-tabela-linha flex align-items-center justify-content-between",
|
|
785
|
-
style: x({ color: r(o).text })
|
|
786
|
-
}, [
|
|
787
|
-
k("span", ke, [
|
|
788
|
-
k("span", {
|
|
789
|
-
class: "nc-bolinha",
|
|
790
|
-
style: x({ background: F.value[G] })
|
|
791
|
-
}, null, 4),
|
|
792
|
-
k("span", null, A(j.rotulo), 1)
|
|
793
|
-
]),
|
|
794
|
-
k("span", Ce, A(r($)(j.quantidade)), 1)
|
|
795
|
-
], 4))), 128))
|
|
796
|
-
]),
|
|
797
|
-
k("div", Be, [
|
|
798
|
-
k("div", Ae, [
|
|
799
|
-
ft(st, {
|
|
933
|
+
P(_, {
|
|
934
|
+
class: "card-pizza__topo",
|
|
935
|
+
legenda: o.legenda,
|
|
936
|
+
sublegenda: o.sublegenda,
|
|
937
|
+
palette: g(a),
|
|
938
|
+
"texto-botao": o.textoBotao,
|
|
939
|
+
"botao-visivel": o.botaoVisivel,
|
|
940
|
+
exportar: o.exportar,
|
|
941
|
+
onBotaoAcao: s[0] || (s[0] = (x) => n("botaoAcao")),
|
|
942
|
+
onExportar: g(m)
|
|
943
|
+
}, J({ _: 2 }, [
|
|
944
|
+
o.$slots.legenda ? {
|
|
945
|
+
name: "legenda",
|
|
946
|
+
fn: z(() => [
|
|
947
|
+
$(o.$slots, "legenda", {}, void 0, !0)
|
|
948
|
+
]),
|
|
949
|
+
key: "0"
|
|
950
|
+
} : void 0,
|
|
951
|
+
o.$slots.sublegenda ? {
|
|
952
|
+
name: "sublegenda",
|
|
953
|
+
fn: z(() => [
|
|
954
|
+
$(o.$slots, "sublegenda", {}, void 0, !0)
|
|
955
|
+
]),
|
|
956
|
+
key: "1"
|
|
957
|
+
} : void 0,
|
|
958
|
+
o.$slots.actions ? {
|
|
959
|
+
name: "actions",
|
|
960
|
+
fn: z(() => [
|
|
961
|
+
$(o.$slots, "actions", {}, void 0, !0)
|
|
962
|
+
]),
|
|
963
|
+
key: "2"
|
|
964
|
+
} : void 0
|
|
965
|
+
]), 1032, ["legenda", "sublegenda", "palette", "texto-botao", "botao-visivel", "exportar", "onExportar"]),
|
|
966
|
+
E("div", Wt, [
|
|
967
|
+
P(He, {
|
|
968
|
+
data: e.data,
|
|
969
|
+
"cores-aplicadas": h.value,
|
|
970
|
+
palette: g(a),
|
|
971
|
+
formatar: g(c),
|
|
972
|
+
"rotulo-categoria": o.rotuloCategoria,
|
|
973
|
+
"rotulo-quantidade": o.rotuloQuantidade,
|
|
974
|
+
"mostrar-cabecalho": o.mostrarCabecalho,
|
|
975
|
+
"itens-clicaveis": o.itensClicaveis,
|
|
976
|
+
"hover-index": k.value,
|
|
977
|
+
"onUpdate:hoverIndex": s[1] || (s[1] = (x) => k.value = x),
|
|
978
|
+
onItemClicado: R
|
|
979
|
+
}, null, 8, ["data", "cores-aplicadas", "palette", "formatar", "rotulo-categoria", "rotulo-quantidade", "mostrar-cabecalho", "itens-clicaveis", "hover-index"]),
|
|
980
|
+
E("div", Xt, [
|
|
981
|
+
E("div", Ut, [
|
|
982
|
+
P(Y, {
|
|
800
983
|
type: "doughnut",
|
|
801
|
-
data:
|
|
802
|
-
options:
|
|
803
|
-
height:
|
|
984
|
+
data: b.value,
|
|
985
|
+
options: M.value,
|
|
986
|
+
height: e.height
|
|
804
987
|
}, null, 8, ["data", "options", "height"]),
|
|
805
|
-
|
|
806
|
-
|
|
988
|
+
o.$slots.titulo || o.titulo || o.$slots.descricao || o.descricao ? (y(), v("div", Jt, [
|
|
989
|
+
o.$slots.titulo || o.titulo ? (y(), v("div", {
|
|
807
990
|
key: 0,
|
|
808
|
-
class: "nc-centro-titulo m-0 font-semibold",
|
|
809
|
-
style:
|
|
991
|
+
class: "nc-centro-titulo nc-m-0 nc-font-semibold",
|
|
992
|
+
style: q({ color: g(a).text })
|
|
810
993
|
}, [
|
|
811
|
-
|
|
812
|
-
|
|
994
|
+
$(o.$slots, "titulo", {}, () => [
|
|
995
|
+
j(L(o.titulo), 1)
|
|
813
996
|
], !0)
|
|
814
|
-
], 4)) :
|
|
815
|
-
|
|
997
|
+
], 4)) : S("", !0),
|
|
998
|
+
o.$slots.descricao || o.descricao ? (y(), v("div", {
|
|
816
999
|
key: 1,
|
|
817
1000
|
class: "nc-centro-desc",
|
|
818
|
-
style:
|
|
1001
|
+
style: q({ color: g(a).muted })
|
|
819
1002
|
}, [
|
|
820
|
-
|
|
821
|
-
|
|
1003
|
+
$(o.$slots, "descricao", {}, () => [
|
|
1004
|
+
j(L(o.descricao), 1)
|
|
822
1005
|
], !0)
|
|
823
|
-
], 4)) :
|
|
824
|
-
])) :
|
|
1006
|
+
], 4)) : S("", !0)
|
|
1007
|
+
])) : S("", !0)
|
|
825
1008
|
])
|
|
826
1009
|
])
|
|
827
1010
|
]),
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
])) :
|
|
1011
|
+
o.$slots.footer ? (y(), v("div", Qt, [
|
|
1012
|
+
$(o.$slots, "footer", {}, void 0, !0)
|
|
1013
|
+
])) : S("", !0)
|
|
831
1014
|
], 6));
|
|
832
1015
|
}
|
|
833
|
-
},
|
|
834
|
-
key: 0,
|
|
835
|
-
class: "nc-legendas-flex flex flex-column"
|
|
836
|
-
}, ze = {
|
|
837
|
-
key: 1,
|
|
838
|
-
class: "nc-actions inline-flex align-items-center gap-2"
|
|
839
|
-
}, Me = ["innerHTML"], je = {
|
|
840
|
-
key: 0,
|
|
841
|
-
class: "card-barra__titulos mt-3 mb-2 flex flex-column"
|
|
842
|
-
}, He = { class: "card-barra__chart flex-1" }, Ve = {
|
|
1016
|
+
}, Gt = /* @__PURE__ */ W(Yt, [["__scopeId", "data-v-1cdb6aec"]]), Kt = { class: "card-barra__header nc-flex nc-flex-column" }, Zt = { class: "card-barra__chart nc-flex-1" }, _t = {
|
|
843
1017
|
key: 0,
|
|
844
|
-
class: "card-barra__footer mt-3"
|
|
845
|
-
},
|
|
1018
|
+
class: "card-barra__footer nc-mt-3"
|
|
1019
|
+
}, ea = {
|
|
846
1020
|
__name: "CardBarra",
|
|
847
1021
|
props: {
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
descricao: { type: String, default: null },
|
|
852
|
-
tema: { type: String, default: "light" },
|
|
853
|
-
corFundo: { type: String, default: null },
|
|
1022
|
+
...Z({ nomeArquivoExport: "card-barra.png" }),
|
|
1023
|
+
...te(),
|
|
1024
|
+
...ae("top"),
|
|
854
1025
|
corDetalhes: { type: String, default: "#3B82F6" },
|
|
855
|
-
corTexto: { type: String, default: null },
|
|
856
|
-
textoBotao: { type: String, default: "Ver mais" },
|
|
857
|
-
direcao: {
|
|
858
|
-
type: String,
|
|
859
|
-
default: "top",
|
|
860
|
-
validator: (t) => ["top", "bottom", "left", "right"].includes(t)
|
|
861
|
-
},
|
|
862
|
-
botaoVisivel: { type: Boolean, default: !1 },
|
|
863
|
-
tipoValor: {
|
|
864
|
-
type: String,
|
|
865
|
-
default: "numero",
|
|
866
|
-
validator: (t) => ["numero", "moeda", "percentual"].includes(t)
|
|
867
|
-
},
|
|
868
|
-
locale: { type: String, default: "pt-BR" },
|
|
869
|
-
moeda: { type: String, default: "BRL" },
|
|
870
1026
|
data: {
|
|
871
1027
|
type: Array,
|
|
872
1028
|
default: () => [
|
|
@@ -892,137 +1048,125 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
892
1048
|
orientacao: {
|
|
893
1049
|
type: String,
|
|
894
1050
|
default: "vertical",
|
|
895
|
-
validator: (
|
|
1051
|
+
validator: (e) => ["vertical", "horizontal"].includes(e)
|
|
896
1052
|
},
|
|
897
1053
|
empilhado: { type: Boolean, default: !1 },
|
|
898
1054
|
mostrarLegendaSeries: { type: Boolean, default: !0 },
|
|
899
1055
|
height: { type: [String, Number], default: 280 },
|
|
900
|
-
borderRadius: { type: [String, Number], default: "0.75rem" },
|
|
901
|
-
sombra: { type: String, default: "0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06)" },
|
|
902
|
-
corBorda: { type: String, default: "#EAE8E8" },
|
|
903
1056
|
larguraBarra: { type: [String, Number], default: 0.92 },
|
|
904
1057
|
raioBarra: { type: Number, default: 6 },
|
|
905
1058
|
linhasReferencia: { type: [Object, Array], default: null },
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
1059
|
+
corHover: { type: String, default: null },
|
|
1060
|
+
// Recebe o item original (da 1ª série em `data`/`series`) e o índice, e
|
|
1061
|
+
// retorna texto(s) extra(s) exibidos no tooltip abaixo dos valores. Pode
|
|
1062
|
+
// devolver uma string ou um array de strings.
|
|
1063
|
+
detalheTooltip: { type: Function, default: null }
|
|
909
1064
|
},
|
|
910
1065
|
emits: ["botaoAcao", "exportado"],
|
|
911
|
-
setup(
|
|
912
|
-
|
|
913
|
-
|
|
1066
|
+
setup(e, { emit: r }) {
|
|
1067
|
+
at((i) => ({
|
|
1068
|
+
v655f41dd: h.value
|
|
914
1069
|
}));
|
|
915
|
-
const
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
), Q = M(() => e.orientacao === "horizontal"), X = M(() => Array.isArray(e.series) && e.series.length > 0 ? e.series.map((i, f) => ({
|
|
925
|
-
nome: i.nome ?? `Série ${f + 1}`,
|
|
926
|
-
cor: i.cor || e.cores[f % e.cores.length],
|
|
1070
|
+
const t = e, n = r, { palette: a, cardStyle: u } = G(t), { formatar: c } = ee(t), { cardRef: p, onExportar: m, iconeExportar: l } = K(t, a, n), d = F(() => `card-barra--${t.direcao}`), h = F(
|
|
1071
|
+
() => typeof t.height == "number" ? `${t.height}px` : t.height
|
|
1072
|
+
), b = F(() => t.orientacao === "horizontal"), { linhasNormalizadas: A, pluginLinhaReferencia: k, temLinhaHover: R } = Pe({
|
|
1073
|
+
linhasReferencia: () => t.linhasReferencia,
|
|
1074
|
+
horizontal: () => b.value,
|
|
1075
|
+
formatar: c
|
|
1076
|
+
}), M = [k], o = F(() => Array.isArray(t.series) && t.series.length > 0 ? t.series.map((i, B) => ({
|
|
1077
|
+
nome: i.nome ?? `Série ${B + 1}`,
|
|
1078
|
+
cor: i.cor || t.cores[B % t.cores.length],
|
|
927
1079
|
dados: Array.isArray(i.dados) ? i.dados : []
|
|
928
|
-
})) : [{ nome:
|
|
929
|
-
const i =
|
|
930
|
-
return i ? i.dados.map((
|
|
931
|
-
}),
|
|
932
|
-
const i =
|
|
933
|
-
function H(
|
|
934
|
-
if (!
|
|
935
|
-
const
|
|
936
|
-
return
|
|
937
|
-
topLeft:
|
|
938
|
-
bottomLeft:
|
|
939
|
-
topRight:
|
|
940
|
-
bottomRight:
|
|
1080
|
+
})) : [{ nome: t.legenda || "Valores", cor: t.corDetalhes, dados: t.data }]), s = F(() => {
|
|
1081
|
+
const i = o.value[0];
|
|
1082
|
+
return i ? i.dados.map((B) => B.rotulo) : [];
|
|
1083
|
+
}), x = F(() => {
|
|
1084
|
+
const i = o.value, B = i.length - 1, T = typeof t.larguraBarra == "number" ? t.larguraBarra : Number(t.larguraBarra) || 0.6, w = t.raioBarra, I = b.value;
|
|
1085
|
+
function H(N) {
|
|
1086
|
+
if (!t.empilhado || i.length === 1) return w;
|
|
1087
|
+
const V = N === 0, O = N === B;
|
|
1088
|
+
return I ? {
|
|
1089
|
+
topLeft: V ? w : 0,
|
|
1090
|
+
bottomLeft: V ? w : 0,
|
|
1091
|
+
topRight: O ? w : 0,
|
|
1092
|
+
bottomRight: O ? w : 0
|
|
941
1093
|
} : {
|
|
942
|
-
bottomLeft:
|
|
943
|
-
bottomRight:
|
|
944
|
-
topLeft:
|
|
945
|
-
topRight:
|
|
1094
|
+
bottomLeft: V ? w : 0,
|
|
1095
|
+
bottomRight: V ? w : 0,
|
|
1096
|
+
topLeft: O ? w : 0,
|
|
1097
|
+
topRight: O ? w : 0
|
|
946
1098
|
};
|
|
947
1099
|
}
|
|
948
1100
|
return {
|
|
949
|
-
labels:
|
|
950
|
-
datasets: i.map((
|
|
951
|
-
label:
|
|
952
|
-
data:
|
|
953
|
-
previstos:
|
|
954
|
-
backgroundColor: D(
|
|
955
|
-
hoverBackgroundColor:
|
|
1101
|
+
labels: s.value,
|
|
1102
|
+
datasets: i.map((N, V) => ({
|
|
1103
|
+
label: N.nome,
|
|
1104
|
+
data: N.dados.map((O) => O.quantidade),
|
|
1105
|
+
previstos: N.dados.map((O) => O.previsto != null ? O.previsto : null),
|
|
1106
|
+
backgroundColor: D(N.cor, 0.72),
|
|
1107
|
+
hoverBackgroundColor: t.corHover || N.cor,
|
|
956
1108
|
borderWidth: 0,
|
|
957
|
-
borderRadius: H(
|
|
1109
|
+
borderRadius: H(V),
|
|
958
1110
|
borderSkipped: !1,
|
|
959
1111
|
categoryPercentage: 1,
|
|
960
|
-
barPercentage:
|
|
1112
|
+
barPercentage: T
|
|
961
1113
|
}))
|
|
962
1114
|
};
|
|
963
1115
|
});
|
|
964
|
-
function
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
borderBottom: "none"
|
|
972
|
-
}) : Object.assign(i.style, {
|
|
973
|
-
bottom: "-5px",
|
|
974
|
-
top: "auto",
|
|
975
|
-
borderRight: "1px solid rgba(15,23,42,.06)",
|
|
976
|
-
borderBottom: "1px solid rgba(15,23,42,.06)",
|
|
977
|
-
borderTop: "none",
|
|
978
|
-
borderLeft: "none"
|
|
979
|
-
});
|
|
980
|
-
}
|
|
981
|
-
let E = null;
|
|
982
|
-
function j(i) {
|
|
983
|
-
var kt, Ct;
|
|
984
|
-
const { chart: f, tooltip: n } = i, m = rt(f);
|
|
985
|
-
if (!m) return;
|
|
986
|
-
const h = gt(m, { caretFlexivel: !0 });
|
|
987
|
-
if (n.opacity === 0 || E) {
|
|
988
|
-
h.style.opacity = "0";
|
|
1116
|
+
function f(i) {
|
|
1117
|
+
var qe, we, Te;
|
|
1118
|
+
const { chart: B, tooltip: T } = i, w = fe(B);
|
|
1119
|
+
if (!w) return;
|
|
1120
|
+
const I = pe(w, { caretFlexivel: !0 });
|
|
1121
|
+
if (T.opacity === 0 || R()) {
|
|
1122
|
+
I.style.opacity = "0";
|
|
989
1123
|
return;
|
|
990
1124
|
}
|
|
991
|
-
const H =
|
|
992
|
-
var
|
|
993
|
-
const
|
|
994
|
-
return
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1125
|
+
const H = T.dataPoints || [], N = o.value.length > 1, V = H.map((X) => {
|
|
1126
|
+
var Ee;
|
|
1127
|
+
const U = ((Ee = o.value[X.datasetIndex]) == null ? void 0 : Ee.cor) || t.corDetalhes, se = c(b.value ? X.parsed.x : X.parsed.y);
|
|
1128
|
+
return he(U, se, {
|
|
1129
|
+
nome: N ? X.dataset.label : "",
|
|
1130
|
+
alinharDireita: !0,
|
|
1131
|
+
margemTopo: !0
|
|
1132
|
+
});
|
|
1133
|
+
}).join(""), O = (qe = H[0]) == null ? void 0 : qe.dataIndex;
|
|
1134
|
+
let re = null;
|
|
1135
|
+
if (O != null)
|
|
1136
|
+
for (const X of B.data.datasets) {
|
|
1137
|
+
const U = (we = X.previstos) == null ? void 0 : we[O];
|
|
1138
|
+
if (U != null) {
|
|
1139
|
+
re = U;
|
|
1002
1140
|
break;
|
|
1003
1141
|
}
|
|
1004
1142
|
}
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
const
|
|
1012
|
-
|
|
1143
|
+
const We = re != null ? `<div style="display:flex;align-items:center;gap:6px;margin-top:6px;padding-top:4px;border-top:1px dashed rgba(15,23,42,.08);"><span style="font-size:11px;color:#64748B;margin-right:6px;">Previsto</span><span style="font-size:12px;font-weight:700;color:#0F172A;letter-spacing:-.01em;line-height:1.1;margin-left:auto;">${c(re)}</span></div>` : "";
|
|
1144
|
+
let be = "";
|
|
1145
|
+
if (t.detalheTooltip && O != null) {
|
|
1146
|
+
const X = (Te = o.value[0]) == null ? void 0 : Te.dados[O], U = t.detalheTooltip(X, O);
|
|
1147
|
+
be = (Array.isArray(U) ? U : [U]).filter(Boolean).map((se) => Oe(se)).join("");
|
|
1148
|
+
}
|
|
1149
|
+
const Xe = I.querySelector(".nc-tt__content");
|
|
1150
|
+
Xe.innerHTML = me((T.title || []).join(" ")) + V + We + be;
|
|
1151
|
+
const { offsetLeft: Ue, offsetTop: Je } = B.canvas;
|
|
1152
|
+
I.style.opacity = "1", I.style.visibility = "hidden", I.style.left = "0px", I.style.top = "0px";
|
|
1153
|
+
const le = I.offsetWidth, Qe = I.offsetHeight, xe = 4, $e = Ue + T.caretX, Ce = Je + T.caretY, ke = ge($e, le, w.clientWidth, xe), Ye = le / 2, Se = 14, Ae = Ce - Se - Qe, Be = Ae < xe, Ge = Be ? Ce + Se : Ae, Re = I.querySelector(".nc-tt__caret");
|
|
1154
|
+
je(Re, Be);
|
|
1155
|
+
const Ke = $e - (ke - Ye), Ze = Math.max(10, Math.min(le - 10, Ke));
|
|
1156
|
+
Re.style.left = Ze + "px", I.style.left = ke + "px", I.style.top = Ge + "px", I.style.visibility = "visible";
|
|
1013
1157
|
}
|
|
1014
|
-
const
|
|
1015
|
-
const i =
|
|
1158
|
+
const C = F(() => {
|
|
1159
|
+
const i = b.value, B = {
|
|
1016
1160
|
grid: { display: !1, drawBorder: !1 },
|
|
1017
1161
|
border: { display: !1 },
|
|
1018
|
-
ticks: { color:
|
|
1019
|
-
stacked:
|
|
1020
|
-
},
|
|
1162
|
+
ticks: { color: a.value.muted, font: { size: 10, family: "'Inter', sans-serif" }, padding: 8 },
|
|
1163
|
+
stacked: t.empilhado
|
|
1164
|
+
}, T = {
|
|
1021
1165
|
display: !1,
|
|
1022
1166
|
grid: { display: !1 },
|
|
1023
1167
|
beginAtZero: !0,
|
|
1024
|
-
stacked:
|
|
1025
|
-
suggestedMax:
|
|
1168
|
+
stacked: t.empilhado,
|
|
1169
|
+
suggestedMax: A.value.length ? Math.max(...A.value.map((w) => w.valor)) : void 0
|
|
1026
1170
|
};
|
|
1027
1171
|
return {
|
|
1028
1172
|
responsive: !0,
|
|
@@ -1031,19 +1175,19 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1031
1175
|
interaction: { intersect: !1, mode: "index", axis: i ? "y" : "x" },
|
|
1032
1176
|
layout: {
|
|
1033
1177
|
padding: {
|
|
1034
|
-
top:
|
|
1178
|
+
top: A.value.length && !i ? 24 : 12,
|
|
1035
1179
|
right: i ? 12 : 0,
|
|
1036
1180
|
bottom: 0,
|
|
1037
|
-
left:
|
|
1181
|
+
left: A.value.length && i ? 60 : 0
|
|
1038
1182
|
}
|
|
1039
1183
|
},
|
|
1040
1184
|
plugins: {
|
|
1041
1185
|
legend: {
|
|
1042
|
-
display:
|
|
1186
|
+
display: t.mostrarLegendaSeries && o.value.length > 1,
|
|
1043
1187
|
position: "bottom",
|
|
1044
1188
|
align: "start",
|
|
1045
1189
|
labels: {
|
|
1046
|
-
color:
|
|
1190
|
+
color: a.value.muted,
|
|
1047
1191
|
boxWidth: 8,
|
|
1048
1192
|
boxHeight: 8,
|
|
1049
1193
|
usePointStyle: !0,
|
|
@@ -1054,251 +1198,114 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1054
1198
|
},
|
|
1055
1199
|
tooltip: {
|
|
1056
1200
|
enabled: !1,
|
|
1057
|
-
external:
|
|
1201
|
+
external: f,
|
|
1058
1202
|
callbacks: {
|
|
1059
|
-
title: (
|
|
1060
|
-
var
|
|
1061
|
-
return ((
|
|
1203
|
+
title: (w) => {
|
|
1204
|
+
var I;
|
|
1205
|
+
return ((I = w[0]) == null ? void 0 : I.label) ?? "";
|
|
1062
1206
|
},
|
|
1063
|
-
label: (
|
|
1207
|
+
label: (w) => c(i ? w.parsed.x : w.parsed.y)
|
|
1064
1208
|
}
|
|
1065
1209
|
}
|
|
1066
1210
|
},
|
|
1067
1211
|
scales: {
|
|
1068
|
-
x: i ?
|
|
1069
|
-
y: i ?
|
|
1212
|
+
x: i ? T : B,
|
|
1213
|
+
y: i ? B : T
|
|
1070
1214
|
}
|
|
1071
1215
|
};
|
|
1072
1216
|
});
|
|
1073
|
-
|
|
1074
|
-
d("botaoAcao");
|
|
1075
|
-
}
|
|
1076
|
-
const c = M(() => e.linhasReferencia ? (Array.isArray(e.linhasReferencia) ? e.linhasReferencia : [e.linhasReferencia]).filter((f) => f && (typeof f == "number" || typeof f.valor == "number")).map((f) => typeof f == "number" ? { valor: f, rotulo: null, cor: "#0F172A", corRotulo: "#0F172A", corTexto: "#FFFFFF", tracejado: [6, 6], espessura: 1 } : {
|
|
1077
|
-
valor: f.valor,
|
|
1078
|
-
rotulo: f.rotulo ?? null,
|
|
1079
|
-
cor: f.cor || "#0F172A",
|
|
1080
|
-
corRotulo: f.corRotulo || f.cor || "#0F172A",
|
|
1081
|
-
corTexto: f.corTexto || "#FFFFFF",
|
|
1082
|
-
tracejado: f.tracejado || [6, 6],
|
|
1083
|
-
espessura: f.espessura ?? 1
|
|
1084
|
-
}) : []), a = [], b = {
|
|
1085
|
-
id: "linhaReferencia",
|
|
1086
|
-
afterDatasetsDraw(i) {
|
|
1087
|
-
const f = c.value;
|
|
1088
|
-
if (a.length = 0, !f.length) return;
|
|
1089
|
-
const { ctx: n, chartArea: m, scales: h } = i, H = Q.value, T = H ? h.x : h.y;
|
|
1090
|
-
T && f.forEach((q) => {
|
|
1091
|
-
const C = T.getPixelForValue(q.valor);
|
|
1092
|
-
if (a.push({ linha: q, pos: C, horizontal: H, chartArea: m }), n.save(), n.beginPath(), n.setLineDash(q.tracejado), n.lineWidth = q.espessura, n.strokeStyle = q.cor, H) {
|
|
1093
|
-
if (C < m.left || C > m.right) {
|
|
1094
|
-
n.restore();
|
|
1095
|
-
return;
|
|
1096
|
-
}
|
|
1097
|
-
n.moveTo(C, m.top), n.lineTo(C, m.bottom);
|
|
1098
|
-
} else {
|
|
1099
|
-
if (C < m.top || C > m.bottom) {
|
|
1100
|
-
n.restore();
|
|
1101
|
-
return;
|
|
1102
|
-
}
|
|
1103
|
-
n.moveTo(m.left, C), n.lineTo(m.right, C);
|
|
1104
|
-
}
|
|
1105
|
-
if (n.stroke(), n.setLineDash([]), q.rotulo) {
|
|
1106
|
-
n.font = "600 11px 'Inter', sans-serif";
|
|
1107
|
-
const V = 8, S = 5, O = n.measureText(q.rotulo).width, tt = 12, U = O + V * 2, N = tt + S * 2, Z = N / 2;
|
|
1108
|
-
let W, J;
|
|
1109
|
-
H ? (W = C - U / 2, J = m.top - N - 6, J < 0 && (J = m.top + 6)) : (W = m.left - U - 6, J = C - N / 2, W < 0 && (W = m.left + 6)), n.fillStyle = q.corRotulo, n.beginPath(), n.roundRect ? n.roundRect(W, J, U, N, Z) : (n.moveTo(W + Z, J), n.lineTo(W + U - Z, J), n.quadraticCurveTo(W + U, J, W + U, J + Z), n.lineTo(W + U, J + N - Z), n.quadraticCurveTo(W + U, J + N, W + U - Z, J + N), n.lineTo(W + Z, J + N), n.quadraticCurveTo(W, J + N, W, J + N - Z), n.lineTo(W, J + Z), n.quadraticCurveTo(W, J, W + Z, J)), n.fill(), n.fillStyle = q.corTexto, n.textBaseline = "middle", n.textAlign = "center", n.fillText(q.rotulo, W + U / 2, J + N / 2);
|
|
1110
|
-
}
|
|
1111
|
-
n.restore();
|
|
1112
|
-
});
|
|
1113
|
-
},
|
|
1114
|
-
beforeEvent(i, f) {
|
|
1115
|
-
if (!a.length) {
|
|
1116
|
-
E = null;
|
|
1117
|
-
return;
|
|
1118
|
-
}
|
|
1119
|
-
const n = f.event;
|
|
1120
|
-
if (!n || n.type === "mouseout" || n.x == null || n.y == null) {
|
|
1121
|
-
E = null;
|
|
1122
|
-
return;
|
|
1123
|
-
}
|
|
1124
|
-
const m = 8;
|
|
1125
|
-
let h = null, H = 1 / 0;
|
|
1126
|
-
for (const T of a) {
|
|
1127
|
-
const q = T.horizontal ? Math.abs(n.x - T.pos) : Math.abs(n.y - T.pos), C = T.horizontal ? n.y >= T.chartArea.top && n.y <= T.chartArea.bottom : n.x >= T.chartArea.left && n.x <= T.chartArea.right;
|
|
1128
|
-
q <= m && C && q < H && (H = q, h = T);
|
|
1129
|
-
}
|
|
1130
|
-
E = h;
|
|
1131
|
-
},
|
|
1132
|
-
afterEvent(i, f) {
|
|
1133
|
-
if (!a.length) return;
|
|
1134
|
-
const n = f.event;
|
|
1135
|
-
if (!n) return;
|
|
1136
|
-
const m = rt(i);
|
|
1137
|
-
if (!m) return;
|
|
1138
|
-
let h = m.querySelector(".nc-tt-linhaRef");
|
|
1139
|
-
if (!E) {
|
|
1140
|
-
h && (h.style.opacity = "0");
|
|
1141
|
-
return;
|
|
1142
|
-
}
|
|
1143
|
-
const H = E;
|
|
1144
|
-
h || (h = document.createElement("div"), h.className = "nc-tt-linhaRef", Object.assign(h.style, {
|
|
1145
|
-
position: "absolute",
|
|
1146
|
-
pointerEvents: "none",
|
|
1147
|
-
transform: "translate(-50%, calc(-100% - 12px))",
|
|
1148
|
-
transition: "opacity .18s ease, left .12s ease, top .12s ease",
|
|
1149
|
-
opacity: "0",
|
|
1150
|
-
background: "#ffffff",
|
|
1151
|
-
borderRadius: "10px",
|
|
1152
|
-
padding: "8px 11px",
|
|
1153
|
-
boxShadow: "0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.12)",
|
|
1154
|
-
border: "1px solid rgba(15,23,42,.06)",
|
|
1155
|
-
whiteSpace: "nowrap",
|
|
1156
|
-
zIndex: "11",
|
|
1157
|
-
fontFamily: "'Inter', sans-serif",
|
|
1158
|
-
textAlign: "left"
|
|
1159
|
-
}), m.appendChild(h));
|
|
1160
|
-
const T = H.linha.cor || "#0F172A", q = $(H.linha.valor), C = H.linha.rotulo;
|
|
1161
|
-
h.innerHTML = (C ? `<div style="font-size:9px;font-weight:500;color:#94A3B8;letter-spacing:.04em;text-transform:uppercase;line-height:1;margin-bottom:4px;">${C}</div>` : "") + `<div style="display:flex;align-items:center;gap:6px;"><span style="width:6px;height:6px;border-radius:999px;background:${T};box-shadow:0 0 0 2px ${D(T, 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>`;
|
|
1162
|
-
const V = i.canvas;
|
|
1163
|
-
h.style.opacity = "1", h.style.visibility = "hidden", h.style.left = "0px", h.style.top = "0px";
|
|
1164
|
-
const S = h.offsetWidth, P = h.offsetHeight, O = 4;
|
|
1165
|
-
let tt, U;
|
|
1166
|
-
H.horizontal ? (tt = V.offsetLeft + H.pos, U = V.offsetTop + n.y) : (tt = V.offsetLeft + n.x, U = V.offsetTop + H.pos);
|
|
1167
|
-
const N = nt(tt, S, m.clientWidth, O);
|
|
1168
|
-
let Z = U;
|
|
1169
|
-
const W = P + 16 + O;
|
|
1170
|
-
Z < W && (Z = W), h.style.left = N + "px", h.style.top = Z + "px", h.style.visibility = "visible";
|
|
1171
|
-
}
|
|
1172
|
-
}, v = M(() => c.value.length ? [b] : []);
|
|
1173
|
-
return (i, f) => (l(), s("div", {
|
|
1217
|
+
return (i, B) => (y(), v("div", {
|
|
1174
1218
|
ref_key: "cardRef",
|
|
1175
|
-
ref:
|
|
1176
|
-
class:
|
|
1177
|
-
style:
|
|
1219
|
+
ref: p,
|
|
1220
|
+
class: Q(["card-barra nc-p-4 nc-flex", d.value]),
|
|
1221
|
+
style: q(g(u))
|
|
1178
1222
|
}, [
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
key: 0
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
],
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
class: "text-sm mt-1",
|
|
1237
|
-
style: x({ color: r(o).muted })
|
|
1238
|
-
}, [
|
|
1239
|
-
L(i.$slots, "descricao", {}, () => [
|
|
1240
|
-
Y(A(t.descricao), 1)
|
|
1241
|
-
], !0)
|
|
1242
|
-
], 4)) : g("", !0)
|
|
1243
|
-
])) : g("", !0)
|
|
1223
|
+
E("div", Kt, [
|
|
1224
|
+
P(_, {
|
|
1225
|
+
class: "card-barra__topo",
|
|
1226
|
+
legenda: i.legenda,
|
|
1227
|
+
sublegenda: i.sublegenda,
|
|
1228
|
+
palette: g(a),
|
|
1229
|
+
"texto-botao": i.textoBotao,
|
|
1230
|
+
"botao-visivel": i.botaoVisivel,
|
|
1231
|
+
exportar: i.exportar,
|
|
1232
|
+
"opacidade-legenda": "0.85",
|
|
1233
|
+
onBotaoAcao: B[0] || (B[0] = (T) => n("botaoAcao")),
|
|
1234
|
+
onExportar: g(m)
|
|
1235
|
+
}, J({ _: 2 }, [
|
|
1236
|
+
i.$slots.legenda ? {
|
|
1237
|
+
name: "legenda",
|
|
1238
|
+
fn: z(() => [
|
|
1239
|
+
$(i.$slots, "legenda", {}, void 0, !0)
|
|
1240
|
+
]),
|
|
1241
|
+
key: "0"
|
|
1242
|
+
} : void 0,
|
|
1243
|
+
i.$slots.sublegenda ? {
|
|
1244
|
+
name: "sublegenda",
|
|
1245
|
+
fn: z(() => [
|
|
1246
|
+
$(i.$slots, "sublegenda", {}, void 0, !0)
|
|
1247
|
+
]),
|
|
1248
|
+
key: "1"
|
|
1249
|
+
} : void 0,
|
|
1250
|
+
i.$slots.actions ? {
|
|
1251
|
+
name: "actions",
|
|
1252
|
+
fn: z(() => [
|
|
1253
|
+
$(i.$slots, "actions", {}, void 0, !0)
|
|
1254
|
+
]),
|
|
1255
|
+
key: "2"
|
|
1256
|
+
} : void 0
|
|
1257
|
+
]), 1032, ["legenda", "sublegenda", "palette", "texto-botao", "botao-visivel", "exportar", "onExportar"]),
|
|
1258
|
+
i.$slots.titulo || i.titulo || i.$slots.descricao || i.descricao ? (y(), ce(ue, {
|
|
1259
|
+
key: 0,
|
|
1260
|
+
class: "card-barra__titulos nc-mt-3 nc-mb-2",
|
|
1261
|
+
titulo: i.titulo,
|
|
1262
|
+
descricao: i.descricao,
|
|
1263
|
+
palette: g(a)
|
|
1264
|
+
}, J({ _: 2 }, [
|
|
1265
|
+
i.$slots.titulo ? {
|
|
1266
|
+
name: "titulo",
|
|
1267
|
+
fn: z(() => [
|
|
1268
|
+
$(i.$slots, "titulo", {}, void 0, !0)
|
|
1269
|
+
]),
|
|
1270
|
+
key: "0"
|
|
1271
|
+
} : void 0,
|
|
1272
|
+
i.$slots.descricao ? {
|
|
1273
|
+
name: "descricao",
|
|
1274
|
+
fn: z(() => [
|
|
1275
|
+
$(i.$slots, "descricao", {}, void 0, !0)
|
|
1276
|
+
]),
|
|
1277
|
+
key: "1"
|
|
1278
|
+
} : void 0
|
|
1279
|
+
]), 1032, ["titulo", "descricao", "palette"])) : S("", !0)
|
|
1244
1280
|
]),
|
|
1245
|
-
|
|
1246
|
-
|
|
1281
|
+
E("div", Zt, [
|
|
1282
|
+
P(Y, {
|
|
1247
1283
|
type: "bar",
|
|
1248
|
-
data:
|
|
1249
|
-
options:
|
|
1250
|
-
plugins:
|
|
1284
|
+
data: x.value,
|
|
1285
|
+
options: C.value,
|
|
1286
|
+
plugins: M,
|
|
1251
1287
|
height: "100%"
|
|
1252
|
-
}, null, 8, ["data", "options"
|
|
1288
|
+
}, null, 8, ["data", "options"])
|
|
1253
1289
|
]),
|
|
1254
|
-
i.$slots.footer ? (
|
|
1255
|
-
|
|
1256
|
-
])) :
|
|
1290
|
+
i.$slots.footer ? (y(), v("div", _t, [
|
|
1291
|
+
$(i.$slots, "footer", {}, void 0, !0)
|
|
1292
|
+
])) : S("", !0)
|
|
1257
1293
|
], 6));
|
|
1258
1294
|
}
|
|
1259
|
-
},
|
|
1260
|
-
key: 0,
|
|
1261
|
-
class: "nc-legendas-flex flex flex-column"
|
|
1262
|
-
}, We = {
|
|
1263
|
-
key: 1,
|
|
1264
|
-
class: "nc-actions inline-flex align-items-center gap-2"
|
|
1265
|
-
}, Oe = ["innerHTML"], Xe = { class: "card-polar__corpo flex align-items-center" }, Ye = { class: "nc-tabela flex flex-column" }, Je = { class: "nc-tabela-valor" }, Qe = { class: "nc-tabela-rotulo inline-flex align-items-center gap-2" }, Ue = { class: "nc-tabela-valor" }, Ge = { class: "card-polar__chart-wrap flex align-items-center justify-content-center" }, Ze = { class: "card-polar__chart" }, Ke = {
|
|
1295
|
+
}, ta = /* @__PURE__ */ W(ea, [["__scopeId", "data-v-857f5e5b"]]), aa = { class: "card-polar__corpo nc-flex nc-align-items-center" }, oa = { class: "card-polar__chart-wrap nc-flex nc-align-items-center nc-justify-content-center" }, na = { class: "card-polar__chart" }, ra = {
|
|
1266
1296
|
key: 0,
|
|
1267
1297
|
class: "card-polar__centro-bottom"
|
|
1268
|
-
},
|
|
1298
|
+
}, la = {
|
|
1269
1299
|
key: 0,
|
|
1270
|
-
class: "card-polar__footer mt-3"
|
|
1271
|
-
},
|
|
1300
|
+
class: "card-polar__footer nc-mt-3"
|
|
1301
|
+
}, sa = {
|
|
1272
1302
|
__name: "CardPolar",
|
|
1273
1303
|
props: {
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
tema: { type: String, default: "light" },
|
|
1279
|
-
corFundo: { type: String, default: null },
|
|
1280
|
-
corTexto: { type: String, default: null },
|
|
1281
|
-
corBorda: { type: String, default: "#EAE8E8" },
|
|
1282
|
-
borderRadius: { type: [String, Number], default: "0.75rem" },
|
|
1283
|
-
sombra: { type: String, default: "0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06)" },
|
|
1304
|
+
...Z({ nomeArquivoExport: "card-polar.png" }),
|
|
1305
|
+
...te(),
|
|
1306
|
+
...ae("right"),
|
|
1307
|
+
...Ve(),
|
|
1284
1308
|
corDetalhes: { type: String, default: "#3B82F6" },
|
|
1285
|
-
textoBotao: { type: String, default: "Ver mais" },
|
|
1286
|
-
botaoVisivel: { type: Boolean, default: !1 },
|
|
1287
|
-
direcao: {
|
|
1288
|
-
type: String,
|
|
1289
|
-
default: "right",
|
|
1290
|
-
validator: (t) => ["left", "right", "top", "bottom"].includes(t)
|
|
1291
|
-
},
|
|
1292
|
-
rotuloCategoria: { type: String, default: "Categoria" },
|
|
1293
|
-
rotuloQuantidade: { type: String, default: "Quantidade" },
|
|
1294
|
-
mostrarCabecalho: { type: Boolean, default: !0 },
|
|
1295
|
-
tipoValor: {
|
|
1296
|
-
type: String,
|
|
1297
|
-
default: "numero",
|
|
1298
|
-
validator: (t) => ["numero", "moeda", "percentual"].includes(t)
|
|
1299
|
-
},
|
|
1300
|
-
locale: { type: String, default: "pt-BR" },
|
|
1301
|
-
moeda: { type: String, default: "BRL" },
|
|
1302
1309
|
data: {
|
|
1303
1310
|
type: Array,
|
|
1304
1311
|
default: () => [
|
|
@@ -1313,65 +1320,57 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1313
1320
|
},
|
|
1314
1321
|
height: { type: [String, Number], default: 260 },
|
|
1315
1322
|
mostrarLinhasGrade: { type: Boolean, default: !0 },
|
|
1316
|
-
|
|
1317
|
-
|
|
1323
|
+
// Recebe o item original de `data` e retorna texto(s) extra(s) exibidos no
|
|
1324
|
+
// tooltip abaixo do valor. Pode devolver uma string ou um array de strings.
|
|
1325
|
+
detalheTooltip: { type: Function, default: null }
|
|
1318
1326
|
},
|
|
1319
|
-
emits: ["botaoAcao", "exportado"],
|
|
1320
|
-
setup(
|
|
1321
|
-
const
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
}), d("exportado");
|
|
1327
|
-
}
|
|
1328
|
-
const F = M(() => `card-polar--${e.direcao}`), z = M(() => {
|
|
1329
|
-
const p = bt(e.corDetalhes, e.data.length);
|
|
1330
|
-
return e.data.map((E, j) => E.cor ?? p[j]);
|
|
1331
|
-
}), Q = M(() => ({
|
|
1332
|
-
labels: e.data.map((p) => p.rotulo),
|
|
1327
|
+
emits: ["botaoAcao", "exportado", "itemClicado"],
|
|
1328
|
+
setup(e, { emit: r }) {
|
|
1329
|
+
const t = e, n = r, { palette: a, cardStyle: u } = G(t), { formatar: c } = ee(t), { cardRef: p, onExportar: m, iconeExportar: l } = K(t, a, n), d = F(() => `card-polar--${t.direcao}`), h = F(() => {
|
|
1330
|
+
const o = de(t.corDetalhes, t.data.length);
|
|
1331
|
+
return t.data.map((s, x) => s.cor ?? o[x]);
|
|
1332
|
+
}), b = F(() => ({
|
|
1333
|
+
labels: t.data.map((o) => o.rotulo),
|
|
1333
1334
|
datasets: [
|
|
1334
1335
|
{
|
|
1335
|
-
data:
|
|
1336
|
-
backgroundColor:
|
|
1337
|
-
borderColor:
|
|
1336
|
+
data: t.data.map((o) => o.quantidade),
|
|
1337
|
+
backgroundColor: h.value,
|
|
1338
|
+
borderColor: h.value,
|
|
1338
1339
|
borderWidth: 0,
|
|
1339
1340
|
hoverOffset: 6
|
|
1340
1341
|
}
|
|
1341
1342
|
]
|
|
1342
|
-
}))
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
return;
|
|
1350
|
-
}
|
|
1351
|
-
const c = j.title || [], a = j.dataPoints && j.dataPoints[0], b = a ? z.value[a.dataIndex] : "#3B82F6", v = a ? $(a.parsed.r ?? a.parsed) : "", i = u.querySelector(".nc-tt__content");
|
|
1352
|
-
i.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:${b};box-shadow:0 0 0 2px ${D(b, 0.15)};flex:0 0 auto;"></span><span style="font-size:12px;font-weight:700;color:#0F172A;letter-spacing:-.01em;line-height:1.1;">${v}</span></div>`;
|
|
1353
|
-
const { offsetLeft: f, offsetTop: n } = E.canvas;
|
|
1354
|
-
u.style.opacity = "1", u.style.visibility = "hidden", u.style.left = "0px", u.style.top = "0px";
|
|
1355
|
-
const m = u.offsetWidth, h = u.offsetHeight, H = 4, T = f + j.caretX, q = n + j.caretY, C = nt(T, m, G.clientWidth, H), V = q < h + 16 + H;
|
|
1356
|
-
u.style.transform = V ? "translate(-50%, 16px)" : "translate(-50%, calc(-100% - 16px))";
|
|
1357
|
-
const S = u.querySelector(".nc-tt__caret");
|
|
1358
|
-
S && (V ? (S.style.bottom = "", S.style.top = "-5px", S.style.borderRight = "", S.style.borderBottom = "", S.style.borderLeft = "1px solid rgba(15,23,42,.06)", S.style.borderTop = "1px solid rgba(15,23,42,.06)") : (S.style.top = "", S.style.bottom = "-5px", S.style.borderLeft = "", S.style.borderTop = "", S.style.borderRight = "1px solid rgba(15,23,42,.06)", S.style.borderBottom = "1px solid rgba(15,23,42,.06)")), u.style.left = C + "px", u.style.top = q + "px", u.style.visibility = "visible";
|
|
1343
|
+
})), A = ye({
|
|
1344
|
+
corDe: (o) => h.value[o.dataIndex],
|
|
1345
|
+
valorDe: (o) => c(o.parsed.r ?? o.parsed),
|
|
1346
|
+
linhasExtrasDe: t.detalheTooltip ? (o) => t.detalheTooltip(t.data[o.dataIndex], o.dataIndex) : null
|
|
1347
|
+
}), k = ne(null);
|
|
1348
|
+
function R(o) {
|
|
1349
|
+
n("itemClicado", o);
|
|
1359
1350
|
}
|
|
1360
|
-
const
|
|
1351
|
+
const M = F(() => ({
|
|
1361
1352
|
responsive: !0,
|
|
1362
1353
|
maintainAspectRatio: !1,
|
|
1363
1354
|
layout: { padding: 4 },
|
|
1355
|
+
onHover: (o, s, x) => {
|
|
1356
|
+
k.value = s.length ? s[0].index : null, x.canvas.style.cursor = t.itensClicaveis && s.length ? "pointer" : "default";
|
|
1357
|
+
},
|
|
1358
|
+
onClick: (o, s) => {
|
|
1359
|
+
if (!t.itensClicaveis || !s.length) return;
|
|
1360
|
+
const x = s[0].index, f = t.data[x];
|
|
1361
|
+
f && R({ item: f, index: x, cor: h.value[x] });
|
|
1362
|
+
},
|
|
1364
1363
|
scales: {
|
|
1365
1364
|
r: {
|
|
1366
1365
|
beginAtZero: !0,
|
|
1367
1366
|
ticks: { display: !1, backdropColor: "transparent" },
|
|
1368
1367
|
grid: {
|
|
1369
|
-
display:
|
|
1370
|
-
color: D(
|
|
1368
|
+
display: t.mostrarLinhasGrade,
|
|
1369
|
+
color: D(a.value.muted, 0.18)
|
|
1371
1370
|
},
|
|
1372
1371
|
angleLines: {
|
|
1373
|
-
display:
|
|
1374
|
-
color: D(
|
|
1372
|
+
display: t.mostrarLinhasGrade,
|
|
1373
|
+
color: D(a.value.muted, 0.18)
|
|
1375
1374
|
},
|
|
1376
1375
|
pointLabels: { display: !1 }
|
|
1377
1376
|
}
|
|
@@ -1380,186 +1379,132 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1380
1379
|
legend: { display: !1 },
|
|
1381
1380
|
tooltip: {
|
|
1382
1381
|
enabled: !1,
|
|
1383
|
-
external:
|
|
1382
|
+
external: A,
|
|
1384
1383
|
callbacks: {
|
|
1385
|
-
title: (
|
|
1386
|
-
var
|
|
1387
|
-
return ((
|
|
1384
|
+
title: (o) => {
|
|
1385
|
+
var s;
|
|
1386
|
+
return ((s = o[0]) == null ? void 0 : s.label) ?? "";
|
|
1388
1387
|
},
|
|
1389
|
-
label: (
|
|
1390
|
-
var
|
|
1391
|
-
return
|
|
1388
|
+
label: (o) => {
|
|
1389
|
+
var s;
|
|
1390
|
+
return c(((s = o.parsed) == null ? void 0 : s.r) ?? o.parsed);
|
|
1392
1391
|
}
|
|
1393
1392
|
}
|
|
1394
1393
|
}
|
|
1395
1394
|
}
|
|
1396
1395
|
}));
|
|
1397
|
-
|
|
1398
|
-
d("botaoAcao");
|
|
1399
|
-
}
|
|
1400
|
-
return (p, E) => (l(), s("div", {
|
|
1396
|
+
return (o, s) => (y(), v("div", {
|
|
1401
1397
|
ref_key: "cardRef",
|
|
1402
|
-
ref:
|
|
1403
|
-
class:
|
|
1404
|
-
style:
|
|
1398
|
+
ref: p,
|
|
1399
|
+
class: Q(["card-polar nc-p-4 nc-flex nc-flex-column", d.value]),
|
|
1400
|
+
style: q(g(u))
|
|
1405
1401
|
}, [
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
},
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
k("span", null, A(t.rotuloCategoria), 1),
|
|
1458
|
-
k("span", Je, A(t.rotuloQuantidade), 1)
|
|
1459
|
-
], 4)) : g("", !0),
|
|
1460
|
-
(l(!0), s(yt, null, mt(t.data, (j, G) => (l(), s("div", {
|
|
1461
|
-
key: G,
|
|
1462
|
-
class: "nc-tabela-linha flex align-items-center justify-content-between",
|
|
1463
|
-
style: x({ color: r(o).text })
|
|
1464
|
-
}, [
|
|
1465
|
-
k("span", Qe, [
|
|
1466
|
-
k("span", {
|
|
1467
|
-
class: "nc-bolinha",
|
|
1468
|
-
style: x({ background: z.value[G] })
|
|
1469
|
-
}, null, 4),
|
|
1470
|
-
k("span", null, A(j.rotulo), 1)
|
|
1471
|
-
]),
|
|
1472
|
-
k("span", Ue, A(r($)(j.quantidade)), 1)
|
|
1473
|
-
], 4))), 128))
|
|
1474
|
-
]),
|
|
1475
|
-
k("div", Ge, [
|
|
1476
|
-
k("div", Ze, [
|
|
1477
|
-
ft(st, {
|
|
1402
|
+
P(_, {
|
|
1403
|
+
class: "card-polar__topo",
|
|
1404
|
+
legenda: o.legenda,
|
|
1405
|
+
sublegenda: o.sublegenda,
|
|
1406
|
+
palette: g(a),
|
|
1407
|
+
"texto-botao": o.textoBotao,
|
|
1408
|
+
"botao-visivel": o.botaoVisivel,
|
|
1409
|
+
exportar: o.exportar,
|
|
1410
|
+
onBotaoAcao: s[0] || (s[0] = (x) => n("botaoAcao")),
|
|
1411
|
+
onExportar: g(m)
|
|
1412
|
+
}, J({ _: 2 }, [
|
|
1413
|
+
o.$slots.legenda ? {
|
|
1414
|
+
name: "legenda",
|
|
1415
|
+
fn: z(() => [
|
|
1416
|
+
$(o.$slots, "legenda", {}, void 0, !0)
|
|
1417
|
+
]),
|
|
1418
|
+
key: "0"
|
|
1419
|
+
} : void 0,
|
|
1420
|
+
o.$slots.sublegenda ? {
|
|
1421
|
+
name: "sublegenda",
|
|
1422
|
+
fn: z(() => [
|
|
1423
|
+
$(o.$slots, "sublegenda", {}, void 0, !0)
|
|
1424
|
+
]),
|
|
1425
|
+
key: "1"
|
|
1426
|
+
} : void 0,
|
|
1427
|
+
o.$slots.actions ? {
|
|
1428
|
+
name: "actions",
|
|
1429
|
+
fn: z(() => [
|
|
1430
|
+
$(o.$slots, "actions", {}, void 0, !0)
|
|
1431
|
+
]),
|
|
1432
|
+
key: "2"
|
|
1433
|
+
} : void 0
|
|
1434
|
+
]), 1032, ["legenda", "sublegenda", "palette", "texto-botao", "botao-visivel", "exportar", "onExportar"]),
|
|
1435
|
+
E("div", aa, [
|
|
1436
|
+
P(He, {
|
|
1437
|
+
data: e.data,
|
|
1438
|
+
"cores-aplicadas": h.value,
|
|
1439
|
+
palette: g(a),
|
|
1440
|
+
formatar: g(c),
|
|
1441
|
+
"rotulo-categoria": o.rotuloCategoria,
|
|
1442
|
+
"rotulo-quantidade": o.rotuloQuantidade,
|
|
1443
|
+
"mostrar-cabecalho": o.mostrarCabecalho,
|
|
1444
|
+
"itens-clicaveis": o.itensClicaveis,
|
|
1445
|
+
"pad-ativa": "0.25rem",
|
|
1446
|
+
"hover-index": k.value,
|
|
1447
|
+
"onUpdate:hoverIndex": s[1] || (s[1] = (x) => k.value = x),
|
|
1448
|
+
onItemClicado: R
|
|
1449
|
+
}, null, 8, ["data", "cores-aplicadas", "palette", "formatar", "rotulo-categoria", "rotulo-quantidade", "mostrar-cabecalho", "itens-clicaveis", "hover-index"]),
|
|
1450
|
+
E("div", oa, [
|
|
1451
|
+
E("div", na, [
|
|
1452
|
+
P(Y, {
|
|
1478
1453
|
type: "polarArea",
|
|
1479
|
-
data:
|
|
1480
|
-
options:
|
|
1481
|
-
height:
|
|
1454
|
+
data: b.value,
|
|
1455
|
+
options: M.value,
|
|
1456
|
+
height: e.height
|
|
1482
1457
|
}, null, 8, ["data", "options", "height"]),
|
|
1483
|
-
|
|
1484
|
-
|
|
1458
|
+
o.$slots.titulo || o.titulo || o.$slots.descricao || o.descricao ? (y(), v("div", ra, [
|
|
1459
|
+
o.$slots.titulo || o.titulo ? (y(), v("div", {
|
|
1485
1460
|
key: 0,
|
|
1486
|
-
class: "card-polar__centro-titulo m-0 text-3xl font-semibold",
|
|
1487
|
-
style:
|
|
1461
|
+
class: "card-polar__centro-titulo nc-m-0 nc-text-3xl nc-font-semibold",
|
|
1462
|
+
style: q({ color: g(a).text, lineHeight: "33px", letterSpacing: "-1px" })
|
|
1488
1463
|
}, [
|
|
1489
|
-
|
|
1490
|
-
|
|
1464
|
+
$(o.$slots, "titulo", {}, () => [
|
|
1465
|
+
j(L(o.titulo), 1)
|
|
1491
1466
|
], !0)
|
|
1492
|
-
], 4)) :
|
|
1493
|
-
|
|
1467
|
+
], 4)) : S("", !0),
|
|
1468
|
+
o.$slots.descricao || o.descricao ? (y(), v("div", {
|
|
1494
1469
|
key: 1,
|
|
1495
1470
|
class: "card-polar__centro-desc",
|
|
1496
|
-
style:
|
|
1471
|
+
style: q({ color: g(a).muted })
|
|
1497
1472
|
}, [
|
|
1498
|
-
|
|
1499
|
-
|
|
1473
|
+
$(o.$slots, "descricao", {}, () => [
|
|
1474
|
+
j(L(o.descricao), 1)
|
|
1500
1475
|
], !0)
|
|
1501
|
-
], 4)) :
|
|
1502
|
-
])) :
|
|
1476
|
+
], 4)) : S("", !0)
|
|
1477
|
+
])) : S("", !0)
|
|
1503
1478
|
])
|
|
1504
1479
|
])
|
|
1505
1480
|
]),
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
])) :
|
|
1481
|
+
o.$slots.footer ? (y(), v("div", la, [
|
|
1482
|
+
$(o.$slots, "footer", {}, void 0, !0)
|
|
1483
|
+
])) : S("", !0)
|
|
1509
1484
|
], 6));
|
|
1510
1485
|
}
|
|
1511
|
-
},
|
|
1512
|
-
key: 0,
|
|
1513
|
-
class: "nc-legendas-flex flex flex-column"
|
|
1514
|
-
}, ro = {
|
|
1515
|
-
key: 1,
|
|
1516
|
-
class: "nc-actions inline-flex align-items-center gap-2"
|
|
1517
|
-
}, no = ["innerHTML"], lo = {
|
|
1518
|
-
key: 0,
|
|
1519
|
-
class: "card-progresso__titulos mt-3 mb-2 flex flex-column"
|
|
1520
|
-
}, so = { class: "card-progresso__corpo flex align-items-center flex-wrap" }, io = {
|
|
1486
|
+
}, ia = /* @__PURE__ */ W(sa, [["__scopeId", "data-v-2316171d"]]), ca = { class: "card-progresso__corpo nc-flex nc-align-items-center nc-flex-wrap" }, da = {
|
|
1521
1487
|
key: 0,
|
|
1522
|
-
class: "card-progresso__chart-wrap flex align-items-center justify-content-center"
|
|
1523
|
-
},
|
|
1488
|
+
class: "card-progresso__chart-wrap nc-flex nc-align-items-center nc-justify-content-center"
|
|
1489
|
+
}, ua = { class: "card-progresso__chart" }, pa = { class: "nc-centro nc-flex nc-flex-column nc-align-items-center nc-justify-content-center" }, fa = { class: "card-progresso__lista nc-flex nc-flex-column" }, ga = { class: "card-progresso__item-cab nc-flex nc-align-items-center nc-justify-content-between" }, ma = {
|
|
1524
1490
|
key: 0,
|
|
1525
|
-
class: "card-progresso__item-valor inline-flex align-items-center gap-2"
|
|
1526
|
-
},
|
|
1491
|
+
class: "card-progresso__item-valor nc-inline-flex nc-align-items-center nc-gap-2"
|
|
1492
|
+
}, ha = { key: 0 }, ya = {
|
|
1527
1493
|
key: 1,
|
|
1528
|
-
class: "card-progresso__footer mt-3"
|
|
1529
|
-
},
|
|
1494
|
+
class: "card-progresso__footer nc-mt-3"
|
|
1495
|
+
}, va = {
|
|
1530
1496
|
__name: "CardProgresso",
|
|
1531
1497
|
props: {
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
descricao: { type: String, default: null },
|
|
1536
|
-
tema: { type: String, default: "light" },
|
|
1537
|
-
corFundo: { type: String, default: null },
|
|
1538
|
-
corTexto: { type: String, default: null },
|
|
1539
|
-
corBorda: { type: String, default: "#EAE8E8" },
|
|
1540
|
-
borderRadius: { type: [String, Number], default: "0.75rem" },
|
|
1541
|
-
sombra: { type: String, default: "0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06)" },
|
|
1498
|
+
...Z({ nomeArquivoExport: "card-progresso.png" }),
|
|
1499
|
+
...te(),
|
|
1500
|
+
...ae("top"),
|
|
1542
1501
|
corDetalhes: { type: String, default: "#3B82F6" },
|
|
1543
1502
|
corExcesso: { type: String, default: "#EF4444" },
|
|
1544
|
-
textoBotao: { type: String, default: "Ver mais" },
|
|
1545
|
-
botaoVisivel: { type: Boolean, default: !1 },
|
|
1546
|
-
direcao: {
|
|
1547
|
-
type: String,
|
|
1548
|
-
default: "top",
|
|
1549
|
-
validator: (t) => ["top", "bottom", "left", "right"].includes(t)
|
|
1550
|
-
},
|
|
1551
1503
|
formato: {
|
|
1552
1504
|
type: String,
|
|
1553
1505
|
default: "linear",
|
|
1554
|
-
validator: (
|
|
1555
|
-
},
|
|
1556
|
-
tipoValor: {
|
|
1557
|
-
type: String,
|
|
1558
|
-
default: "numero",
|
|
1559
|
-
validator: (t) => ["numero", "moeda", "percentual"].includes(t)
|
|
1506
|
+
validator: (e) => ["linear", "circular"].includes(e)
|
|
1560
1507
|
},
|
|
1561
|
-
locale: { type: String, default: "pt-BR" },
|
|
1562
|
-
moeda: { type: String, default: "BRL" },
|
|
1563
1508
|
data: {
|
|
1564
1509
|
type: Array,
|
|
1565
1510
|
default: () => [
|
|
@@ -1575,45 +1520,34 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1575
1520
|
alturaBarra: { type: [String, Number], default: 8 },
|
|
1576
1521
|
raioBarra: { type: [String, Number], default: "999px" },
|
|
1577
1522
|
height: { type: [String, Number], default: 220 },
|
|
1578
|
-
cutout: { type: [String, Number], default: "78%" }
|
|
1579
|
-
exportar: { type: Boolean, default: !1 },
|
|
1580
|
-
nomeArquivoExport: { type: String, default: "card-progresso.png" }
|
|
1523
|
+
cutout: { type: [String, Number], default: "78%" }
|
|
1581
1524
|
},
|
|
1582
1525
|
emits: ["botaoAcao", "exportado"],
|
|
1583
|
-
setup(
|
|
1584
|
-
const
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
const c = bt(e.corDetalhes, e.data.length);
|
|
1593
|
-
return e.data.map((a, b) => {
|
|
1594
|
-
const v = Number(a.meta ?? e.metaPadrao) || 0, i = Number(a.quantidade) || 0, f = a.cor ?? c[b], n = a.modo === "reducao";
|
|
1595
|
-
let m;
|
|
1596
|
-
if (n) {
|
|
1597
|
-
const h = Number(a.valor_referencia) || 0, H = h - v;
|
|
1598
|
-
m = H > 0 ? Math.max(0, Math.min(100, (h - i) / H * 100)) : 0;
|
|
1526
|
+
setup(e, { emit: r }) {
|
|
1527
|
+
const t = e, n = r, { palette: a, cardStyle: u } = G(t), { formatar: c } = ee(t), { cardRef: p, onExportar: m, iconeExportar: l } = K(t, a, n), d = F(() => `card-progresso--${t.direcao}`), h = F(() => {
|
|
1528
|
+
const f = de(t.corDetalhes, t.data.length);
|
|
1529
|
+
return t.data.map((C, i) => {
|
|
1530
|
+
const B = Number(C.meta ?? t.metaPadrao) || 0, T = Number(C.quantidade) || 0, w = C.cor ?? f[i], I = C.modo === "reducao";
|
|
1531
|
+
let H;
|
|
1532
|
+
if (I) {
|
|
1533
|
+
const N = Number(C.valor_referencia) || 0, V = N - B;
|
|
1534
|
+
H = V > 0 ? Math.max(0, Math.min(100, (N - T) / V * 100)) : 0;
|
|
1599
1535
|
} else
|
|
1600
|
-
|
|
1601
|
-
return { rotulo:
|
|
1536
|
+
H = B > 0 ? Math.max(0, Math.min(100, T / B * 100)) : 0;
|
|
1537
|
+
return { rotulo: C.rotulo, quantidade: T, meta: B, valorReferencia: C.valor_referencia ?? null, cor: w, percentual: H, reducao: I };
|
|
1602
1538
|
});
|
|
1603
|
-
}),
|
|
1604
|
-
() => typeof
|
|
1605
|
-
),
|
|
1606
|
-
() => typeof
|
|
1607
|
-
)
|
|
1608
|
-
|
|
1609
|
-
const _ = M(() => z.value.length ? z.value.reduce((c, a) => c + a.percentual, 0) / z.value.length : 0), K = M(() => z.value.every((c) => c.reducao)), p = M(() => {
|
|
1610
|
-
const c = Math.min(_.value, 100), a = Math.max(0, 100 - c), b = K.value ? e.corExcesso : e.corDetalhes;
|
|
1539
|
+
}), b = F(
|
|
1540
|
+
() => typeof t.alturaBarra == "number" ? `${t.alturaBarra}px` : t.alturaBarra
|
|
1541
|
+
), A = F(
|
|
1542
|
+
() => typeof t.raioBarra == "number" ? `${t.raioBarra}px` : t.raioBarra
|
|
1543
|
+
), k = F(() => h.value.length ? h.value.reduce((f, C) => f + C.percentual, 0) / h.value.length : 0), R = F(() => h.value.every((f) => f.reducao)), M = F(() => {
|
|
1544
|
+
const f = Math.min(k.value, 100), C = Math.max(0, 100 - f), i = R.value ? t.corExcesso : t.corDetalhes;
|
|
1611
1545
|
return {
|
|
1612
1546
|
labels: ["Progresso", "Restante"],
|
|
1613
1547
|
datasets: [
|
|
1614
1548
|
{
|
|
1615
|
-
data: [
|
|
1616
|
-
backgroundColor: [
|
|
1549
|
+
data: [f, C],
|
|
1550
|
+
backgroundColor: [i, D(a.value.muted, 0.15)],
|
|
1617
1551
|
borderWidth: 0,
|
|
1618
1552
|
borderColor: "transparent",
|
|
1619
1553
|
hoverOffset: 0,
|
|
@@ -1621,10 +1555,10 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1621
1555
|
}
|
|
1622
1556
|
]
|
|
1623
1557
|
};
|
|
1624
|
-
}),
|
|
1558
|
+
}), o = F(() => ({
|
|
1625
1559
|
responsive: !0,
|
|
1626
1560
|
maintainAspectRatio: !1,
|
|
1627
|
-
cutout:
|
|
1561
|
+
cutout: t.cutout,
|
|
1628
1562
|
rotation: -90,
|
|
1629
1563
|
circumference: 360,
|
|
1630
1564
|
layout: { padding: 4 },
|
|
@@ -1633,328 +1567,314 @@ const dt = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewB
|
|
|
1633
1567
|
tooltip: { enabled: !1 }
|
|
1634
1568
|
}
|
|
1635
1569
|
}));
|
|
1636
|
-
function
|
|
1637
|
-
const
|
|
1638
|
-
if (!
|
|
1639
|
-
getComputedStyle(
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1642
|
-
const
|
|
1643
|
-
|
|
1644
|
-
const
|
|
1645
|
-
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1570
|
+
function s(f) {
|
|
1571
|
+
const C = p.value;
|
|
1572
|
+
if (!C) return;
|
|
1573
|
+
getComputedStyle(C).position === "static" && (C.style.position = "relative");
|
|
1574
|
+
const i = pe(C);
|
|
1575
|
+
i.style.whiteSpace = "normal";
|
|
1576
|
+
const B = i.querySelector(".nc-tt__content");
|
|
1577
|
+
B.innerHTML = '<span style="font-size:11px;color:#0F172A;display:block;max-width:140px;line-height:1.5;"><strong>Modo Redução</strong>: o progresso aumenta conforme o valor diminui</span>', i.style.opacity = "1", i.style.visibility = "hidden", i.style.left = "0px", i.style.top = "0px";
|
|
1578
|
+
const T = f.currentTarget.getBoundingClientRect(), w = C.getBoundingClientRect(), I = T.left - w.left + T.width / 2, H = T.top - w.top;
|
|
1579
|
+
i.style.transform = "translate(-50%, calc(-100% - 8px))";
|
|
1580
|
+
const N = i.querySelector(".nc-tt__caret");
|
|
1581
|
+
N && Object.assign(N.style, {
|
|
1648
1582
|
top: "",
|
|
1649
1583
|
bottom: "-5px",
|
|
1650
1584
|
borderLeft: "",
|
|
1651
1585
|
borderTop: "",
|
|
1652
1586
|
borderRight: "1px solid rgba(15,23,42,.06)",
|
|
1653
1587
|
borderBottom: "1px solid rgba(15,23,42,.06)"
|
|
1654
|
-
}),
|
|
1588
|
+
}), i.style.left = I + "px", i.style.top = H + "px", i.style.visibility = "visible";
|
|
1655
1589
|
}
|
|
1656
|
-
function
|
|
1657
|
-
var
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1590
|
+
function x() {
|
|
1591
|
+
var C;
|
|
1592
|
+
const f = (C = p.value) == null ? void 0 : C.querySelector(".nc-tt");
|
|
1593
|
+
f && (f.style.opacity = "0");
|
|
1660
1594
|
}
|
|
1661
|
-
|
|
1662
|
-
d("botaoAcao");
|
|
1663
|
-
}
|
|
1664
|
-
return (c, a) => (l(), s("div", {
|
|
1595
|
+
return (f, C) => (y(), v("div", {
|
|
1665
1596
|
ref_key: "cardRef",
|
|
1666
|
-
ref:
|
|
1667
|
-
class:
|
|
1668
|
-
style:
|
|
1597
|
+
ref: p,
|
|
1598
|
+
class: Q(["card-progresso nc-p-4 nc-flex nc-flex-column", d.value]),
|
|
1599
|
+
style: q(g(u))
|
|
1669
1600
|
}, [
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
},
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
L(c.$slots, "descricao", {}, () => [
|
|
1730
|
-
Y(A(t.descricao), 1)
|
|
1731
|
-
], !0)
|
|
1732
|
-
], 4)) : g("", !0)
|
|
1733
|
-
])) : g("", !0),
|
|
1734
|
-
k("div", so, [
|
|
1735
|
-
t.formato === "circular" ? (l(), s("div", io, [
|
|
1736
|
-
k("div", co, [
|
|
1737
|
-
ft(st, {
|
|
1601
|
+
P(_, {
|
|
1602
|
+
class: "card-progresso__topo",
|
|
1603
|
+
legenda: f.legenda,
|
|
1604
|
+
sublegenda: f.sublegenda,
|
|
1605
|
+
palette: g(a),
|
|
1606
|
+
"texto-botao": f.textoBotao,
|
|
1607
|
+
"botao-visivel": f.botaoVisivel,
|
|
1608
|
+
exportar: f.exportar,
|
|
1609
|
+
onBotaoAcao: C[0] || (C[0] = (i) => n("botaoAcao")),
|
|
1610
|
+
onExportar: g(m)
|
|
1611
|
+
}, J({ _: 2 }, [
|
|
1612
|
+
f.$slots.legenda ? {
|
|
1613
|
+
name: "legenda",
|
|
1614
|
+
fn: z(() => [
|
|
1615
|
+
$(f.$slots, "legenda", {}, void 0, !0)
|
|
1616
|
+
]),
|
|
1617
|
+
key: "0"
|
|
1618
|
+
} : void 0,
|
|
1619
|
+
f.$slots.sublegenda ? {
|
|
1620
|
+
name: "sublegenda",
|
|
1621
|
+
fn: z(() => [
|
|
1622
|
+
$(f.$slots, "sublegenda", {}, void 0, !0)
|
|
1623
|
+
]),
|
|
1624
|
+
key: "1"
|
|
1625
|
+
} : void 0,
|
|
1626
|
+
f.$slots.actions ? {
|
|
1627
|
+
name: "actions",
|
|
1628
|
+
fn: z(() => [
|
|
1629
|
+
$(f.$slots, "actions", {}, void 0, !0)
|
|
1630
|
+
]),
|
|
1631
|
+
key: "2"
|
|
1632
|
+
} : void 0
|
|
1633
|
+
]), 1032, ["legenda", "sublegenda", "palette", "texto-botao", "botao-visivel", "exportar", "onExportar"]),
|
|
1634
|
+
f.$slots.titulo || f.titulo || f.$slots.descricao || f.descricao ? (y(), ce(ue, {
|
|
1635
|
+
key: 0,
|
|
1636
|
+
class: "card-progresso__titulos nc-mt-3 nc-mb-2",
|
|
1637
|
+
titulo: f.titulo,
|
|
1638
|
+
descricao: f.descricao,
|
|
1639
|
+
palette: g(a)
|
|
1640
|
+
}, J({ _: 2 }, [
|
|
1641
|
+
f.$slots.titulo ? {
|
|
1642
|
+
name: "titulo",
|
|
1643
|
+
fn: z(() => [
|
|
1644
|
+
$(f.$slots, "titulo", {}, void 0, !0)
|
|
1645
|
+
]),
|
|
1646
|
+
key: "0"
|
|
1647
|
+
} : void 0,
|
|
1648
|
+
f.$slots.descricao ? {
|
|
1649
|
+
name: "descricao",
|
|
1650
|
+
fn: z(() => [
|
|
1651
|
+
$(f.$slots, "descricao", {}, void 0, !0)
|
|
1652
|
+
]),
|
|
1653
|
+
key: "1"
|
|
1654
|
+
} : void 0
|
|
1655
|
+
]), 1032, ["titulo", "descricao", "palette"])) : S("", !0),
|
|
1656
|
+
E("div", ca, [
|
|
1657
|
+
e.formato === "circular" ? (y(), v("div", da, [
|
|
1658
|
+
E("div", ua, [
|
|
1659
|
+
P(Y, {
|
|
1738
1660
|
type: "doughnut",
|
|
1739
|
-
data:
|
|
1740
|
-
options:
|
|
1741
|
-
height:
|
|
1661
|
+
data: M.value,
|
|
1662
|
+
options: o.value,
|
|
1663
|
+
height: e.height
|
|
1742
1664
|
}, null, 8, ["data", "options", "height"]),
|
|
1743
|
-
|
|
1744
|
-
|
|
1665
|
+
E("div", pa, [
|
|
1666
|
+
E("div", {
|
|
1745
1667
|
class: "nc-centro-titulo",
|
|
1746
|
-
style:
|
|
1747
|
-
},
|
|
1668
|
+
style: q({ color: R.value ? t.corExcesso : g(a).text })
|
|
1669
|
+
}, L(Math.round(k.value)) + "% ", 5)
|
|
1748
1670
|
])
|
|
1749
1671
|
])
|
|
1750
|
-
])) :
|
|
1751
|
-
|
|
1752
|
-
(
|
|
1753
|
-
key:
|
|
1754
|
-
class: "card-progresso__item flex flex-column"
|
|
1672
|
+
])) : S("", !0),
|
|
1673
|
+
E("div", fa, [
|
|
1674
|
+
(y(!0), v(Me, null, De(h.value, (i, B) => (y(), v("div", {
|
|
1675
|
+
key: B,
|
|
1676
|
+
class: "card-progresso__item nc-flex nc-flex-column"
|
|
1755
1677
|
}, [
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
class: "card-progresso__item-rotulo inline-flex align-items-center gap-2",
|
|
1759
|
-
style:
|
|
1678
|
+
E("div", ga, [
|
|
1679
|
+
E("span", {
|
|
1680
|
+
class: "card-progresso__item-rotulo nc-inline-flex nc-align-items-center nc-gap-2",
|
|
1681
|
+
style: q({ color: g(a).text })
|
|
1760
1682
|
}, [
|
|
1761
|
-
|
|
1683
|
+
E("span", {
|
|
1762
1684
|
class: "nc-bolinha",
|
|
1763
|
-
style:
|
|
1685
|
+
style: q({ background: i.cor })
|
|
1764
1686
|
}, null, 4),
|
|
1765
|
-
|
|
1766
|
-
|
|
1687
|
+
E("span", null, L(i.rotulo), 1),
|
|
1688
|
+
i.reducao ? (y(), v("span", {
|
|
1767
1689
|
key: 0,
|
|
1768
1690
|
class: "card-progresso__item-modo",
|
|
1769
|
-
style:
|
|
1770
|
-
onMouseenter:
|
|
1771
|
-
onMouseleave:
|
|
1772
|
-
}, "↓", 36)) :
|
|
1691
|
+
style: q({ color: g(a).muted }),
|
|
1692
|
+
onMouseenter: s,
|
|
1693
|
+
onMouseleave: x
|
|
1694
|
+
}, "↓", 36)) : S("", !0)
|
|
1773
1695
|
], 4),
|
|
1774
|
-
|
|
1775
|
-
|
|
1696
|
+
e.mostrarValor || e.mostrarPercentual ? (y(), v("span", ma, [
|
|
1697
|
+
e.mostrarValor ? (y(), v("span", {
|
|
1776
1698
|
key: 0,
|
|
1777
1699
|
class: "card-progresso__item-nums",
|
|
1778
|
-
style:
|
|
1700
|
+
style: q({ color: g(a).muted })
|
|
1779
1701
|
}, [
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
], 4)) :
|
|
1783
|
-
|
|
1702
|
+
j(L(g(c)(i.quantidade)), 1),
|
|
1703
|
+
i.meta ? (y(), v("span", ha, " / " + L(g(c)(i.meta)), 1)) : S("", !0)
|
|
1704
|
+
], 4)) : S("", !0),
|
|
1705
|
+
e.mostrarPercentual ? (y(), v("span", {
|
|
1784
1706
|
key: 1,
|
|
1785
1707
|
class: "card-progresso__item-pct",
|
|
1786
|
-
style:
|
|
1787
|
-
},
|
|
1788
|
-
])) :
|
|
1708
|
+
style: q({ background: g(D)(i.cor, 0.12), color: i.cor })
|
|
1709
|
+
}, L(Math.round(i.percentual)) + "% ", 5)) : S("", !0)
|
|
1710
|
+
])) : S("", !0)
|
|
1789
1711
|
]),
|
|
1790
|
-
|
|
1791
|
-
class: "card-progresso__trilha w-full",
|
|
1792
|
-
style:
|
|
1793
|
-
height:
|
|
1794
|
-
borderRadius:
|
|
1795
|
-
background:
|
|
1712
|
+
E("div", {
|
|
1713
|
+
class: "card-progresso__trilha nc-w-full",
|
|
1714
|
+
style: q({
|
|
1715
|
+
height: b.value,
|
|
1716
|
+
borderRadius: A.value,
|
|
1717
|
+
background: i.reducao ? g(D)(t.corExcesso, 0.18) : g(D)(g(a).muted, 0.15)
|
|
1796
1718
|
})
|
|
1797
1719
|
}, [
|
|
1798
|
-
|
|
1720
|
+
E("div", {
|
|
1799
1721
|
class: "card-progresso__preenchimento",
|
|
1800
|
-
style:
|
|
1722
|
+
style: q({ width: i.percentual + "%", background: i.cor, borderRadius: A.value })
|
|
1801
1723
|
}, null, 4)
|
|
1802
1724
|
], 4)
|
|
1803
1725
|
]))), 128))
|
|
1804
1726
|
])
|
|
1805
1727
|
]),
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
])) :
|
|
1728
|
+
f.$slots.footer ? (y(), v("div", ya, [
|
|
1729
|
+
$(f.$slots, "footer", {}, void 0, !0)
|
|
1730
|
+
])) : S("", !0)
|
|
1809
1731
|
], 6));
|
|
1810
1732
|
}
|
|
1811
|
-
},
|
|
1733
|
+
}, ba = /* @__PURE__ */ W(va, [["__scopeId", "data-v-8002d271"]]), xa = {
|
|
1812
1734
|
key: 0,
|
|
1813
1735
|
class: "card-base__topo"
|
|
1814
|
-
},
|
|
1736
|
+
}, $a = ["innerHTML"], Ca = { class: "card-base__legendas nc-flex nc-flex-column" }, ka = {
|
|
1815
1737
|
key: 1,
|
|
1816
|
-
class: "card-base__titulos flex flex-column"
|
|
1817
|
-
},
|
|
1738
|
+
class: "card-base__titulos nc-flex nc-flex-column"
|
|
1739
|
+
}, Sa = {
|
|
1818
1740
|
key: 2,
|
|
1819
|
-
class: "card-base__acao flex"
|
|
1820
|
-
},
|
|
1741
|
+
class: "card-base__acao nc-flex"
|
|
1742
|
+
}, Aa = {
|
|
1821
1743
|
key: 3,
|
|
1822
1744
|
class: "card-base__footer"
|
|
1823
|
-
},
|
|
1745
|
+
}, Ba = {
|
|
1824
1746
|
__name: "CardBase",
|
|
1825
1747
|
props: {
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
corTexto: { type: String, default: null },
|
|
1833
|
-
corBorda: { type: String, default: "#EAE8E8" },
|
|
1834
|
-
borderRadius: { type: [String, Number], default: "0.75rem" },
|
|
1835
|
-
sombra: { type: String, default: "none" },
|
|
1836
|
-
textoBotao: { type: String, default: "Ver Todos" },
|
|
1837
|
-
botaoVisivel: { type: Boolean, default: !0 },
|
|
1748
|
+
...Z({
|
|
1749
|
+
sombra: "none",
|
|
1750
|
+
textoBotao: "Ver Todos",
|
|
1751
|
+
botaoVisivel: !0,
|
|
1752
|
+
nomeArquivoExport: "card-base.png"
|
|
1753
|
+
}),
|
|
1838
1754
|
alinhamento: {
|
|
1839
1755
|
type: String,
|
|
1840
1756
|
default: "left",
|
|
1841
|
-
validator: (
|
|
1842
|
-
}
|
|
1843
|
-
exportar: { type: Boolean, default: !1 },
|
|
1844
|
-
nomeArquivoExport: { type: String, default: "card-base.png" }
|
|
1757
|
+
validator: (e) => ["left", "center", "right"].includes(e)
|
|
1758
|
+
}
|
|
1845
1759
|
},
|
|
1846
1760
|
emits: ["botaoAcao", "exportado"],
|
|
1847
|
-
setup(
|
|
1848
|
-
const
|
|
1849
|
-
function
|
|
1850
|
-
|
|
1851
|
-
}
|
|
1852
|
-
async function w() {
|
|
1853
|
-
await ct($.value, {
|
|
1854
|
-
nomeArquivo: e.nomeArquivoExport,
|
|
1855
|
-
corFundo: o.value.bg !== "transparent" ? o.value.bg : null
|
|
1856
|
-
}), d("exportado");
|
|
1761
|
+
setup(e, { emit: r }) {
|
|
1762
|
+
const t = e, n = r, { palette: a, cardStyle: u } = G(t), { cardRef: c, onExportar: p, iconeExportar: m } = K(t, a, n);
|
|
1763
|
+
function l() {
|
|
1764
|
+
n("botaoAcao");
|
|
1857
1765
|
}
|
|
1858
|
-
return (
|
|
1766
|
+
return (d, h) => (y(), v("div", {
|
|
1859
1767
|
ref_key: "cardRef",
|
|
1860
|
-
ref:
|
|
1861
|
-
class:
|
|
1862
|
-
style:
|
|
1768
|
+
ref: c,
|
|
1769
|
+
class: Q(["card-base nc-flex nc-flex-column", `card-base--${e.alinhamento}`]),
|
|
1770
|
+
style: q(g(u))
|
|
1863
1771
|
}, [
|
|
1864
|
-
|
|
1865
|
-
|
|
1772
|
+
d.exportar ? (y(), v("div", xa, [
|
|
1773
|
+
E("button", {
|
|
1866
1774
|
type: "button",
|
|
1867
|
-
class: "nc-exportar card-base__exportar inline-flex align-items-center justify-content-center",
|
|
1868
|
-
style:
|
|
1775
|
+
class: "nc-exportar card-base__exportar nc-inline-flex nc-align-items-center nc-justify-content-center",
|
|
1776
|
+
style: q({ color: g(a).muted, borderColor: g(D)(g(a).text === "inherit" ? "#0F172A" : g(a).text, 0.18) }),
|
|
1869
1777
|
title: "Exportar como imagem",
|
|
1870
1778
|
"aria-label": "Exportar como imagem",
|
|
1871
|
-
onClick:
|
|
1872
|
-
innerHTML:
|
|
1873
|
-
}, null, 12,
|
|
1874
|
-
])) :
|
|
1875
|
-
|
|
1876
|
-
|
|
1779
|
+
onClick: h[0] || (h[0] = (...b) => g(p) && g(p)(...b)),
|
|
1780
|
+
innerHTML: g(m)
|
|
1781
|
+
}, null, 12, $a)
|
|
1782
|
+
])) : S("", !0),
|
|
1783
|
+
E("div", Ca, [
|
|
1784
|
+
d.$slots.legenda || d.legenda ? (y(), v("div", {
|
|
1877
1785
|
key: 0,
|
|
1878
|
-
class: "card-base__legenda font-medium text-xs",
|
|
1879
|
-
style:
|
|
1786
|
+
class: "card-base__legenda nc-font-medium nc-text-xs",
|
|
1787
|
+
style: q({ color: g(a).text })
|
|
1880
1788
|
}, [
|
|
1881
|
-
|
|
1882
|
-
|
|
1789
|
+
$(d.$slots, "legenda", {}, () => [
|
|
1790
|
+
j(L(d.legenda), 1)
|
|
1883
1791
|
], !0)
|
|
1884
|
-
], 4)) :
|
|
1885
|
-
|
|
1792
|
+
], 4)) : S("", !0),
|
|
1793
|
+
d.$slots.sublegenda || d.sublegenda ? (y(), v("div", {
|
|
1886
1794
|
key: 1,
|
|
1887
|
-
class: "card-base__sublegenda text-xs",
|
|
1888
|
-
style:
|
|
1795
|
+
class: "card-base__sublegenda nc-text-xs",
|
|
1796
|
+
style: q({ color: g(a).muted })
|
|
1889
1797
|
}, [
|
|
1890
|
-
|
|
1891
|
-
|
|
1798
|
+
$(d.$slots, "sublegenda", {}, () => [
|
|
1799
|
+
j(L(d.sublegenda), 1)
|
|
1892
1800
|
], !0)
|
|
1893
|
-
], 4)) :
|
|
1801
|
+
], 4)) : S("", !0)
|
|
1894
1802
|
]),
|
|
1895
|
-
|
|
1896
|
-
|
|
1803
|
+
d.$slots.titulo || d.titulo || d.$slots.descricao || d.descricao ? (y(), v("div", ka, [
|
|
1804
|
+
d.$slots.titulo || d.titulo ? (y(), v("div", {
|
|
1897
1805
|
key: 0,
|
|
1898
|
-
class: "card-base__titulo m-0 text-3xl font-semibold",
|
|
1899
|
-
style:
|
|
1806
|
+
class: "card-base__titulo nc-m-0 nc-text-3xl nc-font-semibold",
|
|
1807
|
+
style: q({ color: g(a).text, lineHeight: "33px", letterSpacing: "-1px" })
|
|
1900
1808
|
}, [
|
|
1901
|
-
|
|
1902
|
-
|
|
1809
|
+
$(d.$slots, "titulo", {}, () => [
|
|
1810
|
+
j(L(d.titulo), 1)
|
|
1903
1811
|
], !0)
|
|
1904
|
-
], 4)) :
|
|
1905
|
-
|
|
1812
|
+
], 4)) : S("", !0),
|
|
1813
|
+
d.$slots.descricao || d.descricao ? (y(), v("div", {
|
|
1906
1814
|
key: 1,
|
|
1907
|
-
class: "text-sm",
|
|
1908
|
-
style:
|
|
1815
|
+
class: "nc-text-sm",
|
|
1816
|
+
style: q({ color: g(a).muted })
|
|
1909
1817
|
}, [
|
|
1910
|
-
|
|
1911
|
-
|
|
1818
|
+
$(d.$slots, "descricao", {}, () => [
|
|
1819
|
+
j(L(d.descricao), 1)
|
|
1912
1820
|
], !0)
|
|
1913
|
-
], 4)) :
|
|
1914
|
-
])) :
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1821
|
+
], 4)) : S("", !0)
|
|
1822
|
+
])) : S("", !0),
|
|
1823
|
+
d.$slots.acao || d.botaoVisivel ? (y(), v("div", Sa, [
|
|
1824
|
+
$(d.$slots, "acao", {}, () => [
|
|
1825
|
+
d.botaoVisivel ? (y(), v("button", {
|
|
1918
1826
|
key: 0,
|
|
1919
1827
|
type: "button",
|
|
1920
|
-
class: "card-base__link text-xs inline-flex align-items-center",
|
|
1921
|
-
style:
|
|
1922
|
-
onClick:
|
|
1828
|
+
class: "card-base__link nc-text-xs nc-inline-flex nc-align-items-center",
|
|
1829
|
+
style: q({ color: g(a).text }),
|
|
1830
|
+
onClick: l
|
|
1923
1831
|
}, [
|
|
1924
|
-
|
|
1925
|
-
|
|
1832
|
+
E("span", null, L(d.textoBotao), 1),
|
|
1833
|
+
h[1] || (h[1] = E("span", {
|
|
1926
1834
|
class: "card-base__chevron",
|
|
1927
1835
|
"aria-hidden": "true"
|
|
1928
1836
|
}, "›", -1))
|
|
1929
|
-
], 4)) :
|
|
1837
|
+
], 4)) : S("", !0)
|
|
1930
1838
|
], !0)
|
|
1931
|
-
])) :
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
])) :
|
|
1839
|
+
])) : S("", !0),
|
|
1840
|
+
d.$slots.footer ? (y(), v("div", Aa, [
|
|
1841
|
+
$(d.$slots, "footer", {}, void 0, !0)
|
|
1842
|
+
])) : S("", !0)
|
|
1935
1843
|
], 6));
|
|
1936
1844
|
}
|
|
1937
|
-
},
|
|
1938
|
-
install(
|
|
1939
|
-
|
|
1845
|
+
}, Ra = /* @__PURE__ */ W(Ba, [["__scopeId", "data-v-6fe4b0aa"]]), Ta = {
|
|
1846
|
+
install(e) {
|
|
1847
|
+
e.component("ChartBase", Y), e.component("CardBase", Ra), e.component("CardLinhas", Nt), e.component("CardPizza", Gt), e.component("CardBarra", ta), e.component("CardPolar", ia), e.component("CardProgresso", ba);
|
|
1940
1848
|
}
|
|
1941
1849
|
};
|
|
1942
1850
|
export {
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1851
|
+
ta as CardBarra,
|
|
1852
|
+
Ra as CardBase,
|
|
1853
|
+
Nt as CardLinhas,
|
|
1854
|
+
Gt as CardPizza,
|
|
1855
|
+
ia as CardPolar,
|
|
1856
|
+
ba as CardProgresso,
|
|
1857
|
+
Y as ChartBase,
|
|
1858
|
+
Ne as ICONE_EXPORTAR_SVG,
|
|
1859
|
+
It as SOMBRA_PADRAO,
|
|
1860
|
+
je as aplicarCaretFlip,
|
|
1861
|
+
ge as clampHorizontal,
|
|
1862
|
+
pe as criarTooltipEl,
|
|
1863
|
+
ye as criarTooltipExternoPadrao,
|
|
1864
|
+
Ta as default,
|
|
1865
|
+
St as exportarElementoComoImagem,
|
|
1866
|
+
de as gerarPaleta,
|
|
1867
|
+
fe as prepararTooltipParent,
|
|
1868
|
+
Z as propsCartao,
|
|
1869
|
+
ae as propsDirecao,
|
|
1870
|
+
Ve as propsTabela,
|
|
1871
|
+
te as propsValor,
|
|
1957
1872
|
D as toRgba,
|
|
1958
|
-
|
|
1959
|
-
|
|
1873
|
+
Oe as ttLinhaTexto,
|
|
1874
|
+
he as ttLinhaValor,
|
|
1875
|
+
me as ttTitulo,
|
|
1876
|
+
K as useExportarCard,
|
|
1877
|
+
ee as useFormatadorValor,
|
|
1878
|
+
Pe as useLinhasReferencia,
|
|
1879
|
+
G as useTema
|
|
1960
1880
|
};
|