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