nemesischart 2.0.8 → 2.0.10

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