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