@actionexec/dashboards 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/ColorPaletteSelector-nBO_fbbj.js.map +1 -1
- package/dist/hooks/useCollapse.d.ts +2 -4
- package/dist/index.js +705 -755
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +1 -1
- package/dist/internals.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/statement.d.ts +22 -6
- package/package.json +1 -1
- package/dist/utils/statementOutline.d.ts +0 -40
- /package/dist/{utils/statementOutline.test.d.ts → hooks/useCollapse.test.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,245 +1,245 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as T, useRef as R, useEffect as F, useCallback as x, useMemo as
|
|
3
|
-
import { M as
|
|
4
|
-
import { E as
|
|
5
|
-
import { LineChart as
|
|
1
|
+
import { jsxs as g, jsx as a, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { useState as T, useRef as R, useEffect as F, useCallback as x, useMemo as O, memo as Oe } from "react";
|
|
3
|
+
import { M as B, f as Fe, a as Ie, c as ae, b as se, d as We, e as be, i as le, g as D, p as ze, h as J, j as ve, k as we, l as Y, m as De, r as He, D as ie, n as Ve, o as je, S as ye, C as Ge, q as Ke, s as Ne, t as Ye, u as Ue, v as Be, G as qe, w as oe, x as Xe, y as Qe, z as Ze, A as Je, B as et } from "./ColorPaletteSelector-nBO_fbbj.js";
|
|
4
|
+
import { E as Wr } from "./ColorPaletteSelector-nBO_fbbj.js";
|
|
5
|
+
import { LineChart as tt, Line as rt, AreaChart as nt, Area as at, BarChart as Se, Bar as q, CartesianGrid as ke, XAxis as Ce, YAxis as Re, Tooltip as X, Legend as st, Cell as ce, PieChart as lt, Pie as it } from "recharts";
|
|
6
6
|
function H(e, t = {}) {
|
|
7
|
-
const
|
|
8
|
-
for (const [
|
|
7
|
+
const n = {};
|
|
8
|
+
for (const [r, s] of Object.entries(e))
|
|
9
9
|
if (s.includes("|")) {
|
|
10
|
-
const [l,
|
|
11
|
-
l && (
|
|
10
|
+
const [l, i] = s.split("|");
|
|
11
|
+
l && (n.f_date_start = l), i && (n.f_date_end = i);
|
|
12
12
|
} else
|
|
13
|
-
|
|
14
|
-
for (const [
|
|
15
|
-
|
|
16
|
-
return
|
|
13
|
+
n[`f_${r}`] = s;
|
|
14
|
+
for (const [r, s] of Object.entries(t))
|
|
15
|
+
n[`v_${r}`] = String(s);
|
|
16
|
+
return n;
|
|
17
17
|
}
|
|
18
18
|
function j(e) {
|
|
19
19
|
return Object.keys(e).sort().map((t) => `${t}=${e[t]}`).join("&");
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
return
|
|
21
|
+
function $e(e, t) {
|
|
22
|
+
const n = Object.keys(e);
|
|
23
|
+
return n.length !== Object.keys(t).length ? !1 : n.every((r) => e[r] === t[r]);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function xe(e) {
|
|
26
26
|
const t = {};
|
|
27
|
-
for (const [
|
|
28
|
-
if (
|
|
29
|
-
const s =
|
|
30
|
-
t[
|
|
31
|
-
} else Array.isArray(
|
|
27
|
+
for (const [n, r] of Object.entries(e))
|
|
28
|
+
if (r && typeof r == "object" && "start" in r) {
|
|
29
|
+
const s = r;
|
|
30
|
+
t[n] = `${s.start || ""}|${s.end || ""}`;
|
|
31
|
+
} else Array.isArray(r) ? t[n] = r.join(B) : typeof r == "string" && (t[n] = r);
|
|
32
32
|
return t;
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
function
|
|
36
|
-
const [t,
|
|
34
|
+
const ot = 300;
|
|
35
|
+
function ct(e) {
|
|
36
|
+
const [t, n] = T(null), [r, s] = T(null), [l, i] = T({}), [o, m] = T({}), [c, u] = T(null), [d, f] = T(!0), [p, h] = T(null), v = R(), k = R(!1), w = R(null), y = R(!1);
|
|
37
37
|
F(() => {
|
|
38
38
|
let b = !1;
|
|
39
|
-
return k.current = !1,
|
|
40
|
-
b ||
|
|
41
|
-
}).catch((
|
|
42
|
-
b || h(
|
|
39
|
+
return k.current = !1, w.current = null, y.current = !1, Fe(e).then((_) => {
|
|
40
|
+
b || n(_);
|
|
41
|
+
}).catch((_) => {
|
|
42
|
+
b || h(_.message);
|
|
43
43
|
}), () => {
|
|
44
44
|
b = !0;
|
|
45
45
|
};
|
|
46
46
|
}, [e]), F(() => {
|
|
47
47
|
if (!t) return;
|
|
48
48
|
if (t.widgets.length === 0) {
|
|
49
|
-
|
|
49
|
+
f(!1);
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
const b = H(l,
|
|
53
|
-
if (
|
|
52
|
+
const b = H(l, o), _ = j(b);
|
|
53
|
+
if (_ === w.current) return;
|
|
54
54
|
v.current && clearTimeout(v.current);
|
|
55
|
-
const N =
|
|
55
|
+
const N = y.current ? ot : 0;
|
|
56
56
|
return v.current = setTimeout(() => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const S = { ...
|
|
60
|
-
return
|
|
57
|
+
f(!0), Ie(e, b).then((A) => {
|
|
58
|
+
w.current = _, y.current = !0, s(A), !k.current && A.applied && (k.current = !0, i((M) => {
|
|
59
|
+
const S = { ...xe(A.applied), ...M };
|
|
60
|
+
return $e(S, M) ? M : (w.current = j(H(S, o)), S);
|
|
61
61
|
})), h(null);
|
|
62
|
-
}).catch((A) => h(A.message)).finally(() =>
|
|
62
|
+
}).catch((A) => h(A.message)).finally(() => f(!1));
|
|
63
63
|
}, N), () => {
|
|
64
64
|
v.current && clearTimeout(v.current);
|
|
65
65
|
};
|
|
66
|
-
}, [e, t, l,
|
|
67
|
-
const C = x((b,
|
|
68
|
-
|
|
69
|
-
}, []), $ = x((b,
|
|
70
|
-
|
|
66
|
+
}, [e, t, l, o]);
|
|
67
|
+
const C = x((b, _) => {
|
|
68
|
+
i((N) => ({ ...N, [b]: _ }));
|
|
69
|
+
}, []), $ = x((b, _) => {
|
|
70
|
+
m((N) => ({ ...N, [b]: _ }));
|
|
71
71
|
}, []), P = x((b) => {
|
|
72
72
|
u(b);
|
|
73
|
-
}, []), E =
|
|
73
|
+
}, []), E = O(
|
|
74
74
|
() => c ?? (t == null ? void 0 : t.palette) ?? [],
|
|
75
75
|
[c, t]
|
|
76
76
|
);
|
|
77
77
|
return {
|
|
78
78
|
layout: t,
|
|
79
|
-
renderData:
|
|
80
|
-
loading:
|
|
81
|
-
error:
|
|
79
|
+
renderData: r,
|
|
80
|
+
loading: d,
|
|
81
|
+
error: p,
|
|
82
82
|
filters: l,
|
|
83
|
-
variables:
|
|
83
|
+
variables: o,
|
|
84
84
|
palette: E,
|
|
85
85
|
setFilter: C,
|
|
86
86
|
setVariable: $,
|
|
87
87
|
setPalette: P
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
const
|
|
91
|
-
var t,
|
|
92
|
-
return ((
|
|
93
|
-
},
|
|
94
|
-
var t,
|
|
95
|
-
return ((
|
|
90
|
+
const dt = (e) => {
|
|
91
|
+
var t, n;
|
|
92
|
+
return ((n = (t = e.borderBoxSize) == null ? void 0 : t[0]) == null ? void 0 : n.inlineSize) ?? e.target.offsetWidth;
|
|
93
|
+
}, ut = (e) => {
|
|
94
|
+
var t, n;
|
|
95
|
+
return ((n = (t = e.borderBoxSize) == null ? void 0 : t[0]) == null ? void 0 : n.blockSize) ?? e.target.offsetHeight;
|
|
96
96
|
};
|
|
97
|
-
function
|
|
98
|
-
return e === void 0 ? 0 : e === "auto" ?
|
|
97
|
+
function mt(e, t, n) {
|
|
98
|
+
return e === void 0 ? 0 : e === "auto" ? We(t, n) : Math.max(0, e);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function ht(e) {
|
|
101
101
|
let t = e.parentElement;
|
|
102
102
|
for (; t && t !== document.body && t !== document.documentElement; ) {
|
|
103
|
-
const { overflowY:
|
|
104
|
-
if (
|
|
105
|
-
return
|
|
103
|
+
const { overflowY: n } = getComputedStyle(t);
|
|
104
|
+
if (n !== "visible")
|
|
105
|
+
return n === "hidden" || n === "clip" ? t : null;
|
|
106
106
|
t = t.parentElement;
|
|
107
107
|
}
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function ft(e) {
|
|
111
111
|
const t = R(e);
|
|
112
112
|
t.current = e;
|
|
113
|
-
const
|
|
114
|
-
const
|
|
115
|
-
if (u.current || t.current.silenceWarnings || !
|
|
116
|
-
const N =
|
|
113
|
+
const n = R(null), r = R(null), s = R(null), l = R(null), i = R(null), o = R(0), m = R(0), c = R(!1), u = R(!1), d = R(-1), [f, p] = T(!1), h = x((b) => {
|
|
114
|
+
const _ = r.current;
|
|
115
|
+
if (u.current || t.current.silenceWarnings || !_) return;
|
|
116
|
+
const N = ht(_);
|
|
117
117
|
!N || N.clientHeight >= b.gridHeight || (u.current = !0, console.warn(
|
|
118
118
|
`[@actionexec/dashboards] O dashboard esta sendo cortado: o container precisa de ${Math.ceil(b.gridHeight)}px de altura, mas o ancestral com overflow oculto tem ${N.clientHeight}px. A altura do dashboard varia com a largura — use a prop onGeometryChange para dimensionar o container, ou troque o overflow para auto. Passe silenceWarnings para desligar este aviso.`
|
|
119
119
|
));
|
|
120
120
|
}, []), v = x(() => {
|
|
121
|
-
var L,
|
|
122
|
-
if (!
|
|
123
|
-
const { columns: b, cellAspect:
|
|
121
|
+
var L, I;
|
|
122
|
+
if (!n.current) return;
|
|
123
|
+
const { columns: b, cellAspect: _ } = t.current, N = o.current, A = se(N, b), M = {
|
|
124
124
|
containerWidth: N,
|
|
125
125
|
cellWidth: A,
|
|
126
|
-
cellHeight:
|
|
127
|
-
gridHeight:
|
|
126
|
+
cellHeight: ae(A, _),
|
|
127
|
+
gridHeight: m.current,
|
|
128
128
|
stacked: c.current
|
|
129
|
-
}, S =
|
|
130
|
-
S && S.containerWidth === M.containerWidth && S.cellWidth === M.cellWidth && S.cellHeight === M.cellHeight && S.gridHeight === M.gridHeight && S.stacked === M.stacked || (
|
|
129
|
+
}, S = i.current;
|
|
130
|
+
S && S.containerWidth === M.containerWidth && S.cellWidth === M.cellWidth && S.cellHeight === M.cellHeight && S.gridHeight === M.gridHeight && S.stacked === M.stacked || (i.current = M, (I = (L = t.current).onGeometryChange) == null || I.call(L, M), h(M));
|
|
131
131
|
}, [h]), k = x((b = !1) => {
|
|
132
|
-
const
|
|
133
|
-
if (!
|
|
134
|
-
const N =
|
|
135
|
-
if (!b && N ===
|
|
136
|
-
|
|
137
|
-
const { columns: A, cellAspect: M, stackBelow: S } = t.current, z =
|
|
138
|
-
|
|
139
|
-
const L =
|
|
140
|
-
|
|
141
|
-
}, []), y = x(() => {
|
|
142
|
-
l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
132
|
+
const _ = n.current;
|
|
133
|
+
if (!_) return;
|
|
134
|
+
const N = o.current;
|
|
135
|
+
if (!b && N === d.current) return;
|
|
136
|
+
d.current = N;
|
|
137
|
+
const { columns: A, cellAspect: M, stackBelow: S } = t.current, z = se(N, A);
|
|
138
|
+
_.style.setProperty("--dash-cell-h", `${ae(z, M)}px`);
|
|
139
|
+
const L = mt(S, A, M), I = L > 0 && N > 0 && N < L;
|
|
140
|
+
I !== c.current && (c.current = I, p(I));
|
|
143
141
|
}, []), w = x(() => {
|
|
142
|
+
l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
143
|
+
}, []), y = x(() => {
|
|
144
144
|
l.current === null && (l.current = requestAnimationFrame(() => {
|
|
145
145
|
l.current = null, k(), v();
|
|
146
146
|
}));
|
|
147
147
|
}, [k, v]), C = x((b) => {
|
|
148
|
-
for (const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}, [
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
}, [k, $,
|
|
155
|
-
const
|
|
156
|
-
if (
|
|
157
|
-
|
|
148
|
+
for (const _ of b)
|
|
149
|
+
_.target === n.current ? o.current = Math.round(dt(_)) : _.target === r.current && (m.current = ut(_));
|
|
150
|
+
y();
|
|
151
|
+
}, [y]), $ = x(() => s.current ? s.current : typeof ResizeObserver > "u" ? null : (s.current = new ResizeObserver(C), s.current), [C]), P = x((b) => {
|
|
152
|
+
const _ = $();
|
|
153
|
+
n.current && (_ == null || _.unobserve(n.current)), n.current = b, b && (_ == null || _.observe(b), o.current = Math.round(b.getBoundingClientRect().width), k(!0), y());
|
|
154
|
+
}, [k, $, y]), E = x((b) => {
|
|
155
|
+
const _ = $();
|
|
156
|
+
if (r.current && (_ == null || _.unobserve(r.current)), r.current = b, !b) {
|
|
157
|
+
m.current = 0;
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
-
|
|
161
|
-
}, [$,
|
|
160
|
+
_ == null || _.observe(b), m.current = b.getBoundingClientRect().height, y();
|
|
161
|
+
}, [$, y]);
|
|
162
162
|
return F(() => {
|
|
163
163
|
const b = $();
|
|
164
|
-
return
|
|
165
|
-
var
|
|
166
|
-
(
|
|
164
|
+
return n.current && (b == null || b.observe(n.current)), r.current && (b == null || b.observe(r.current)), () => {
|
|
165
|
+
var _;
|
|
166
|
+
(_ = s.current) == null || _.disconnect(), s.current = null, w();
|
|
167
167
|
};
|
|
168
|
-
}, [$,
|
|
169
|
-
|
|
170
|
-
}, [e.columns, e.cellAspect, e.stackBelow, k,
|
|
168
|
+
}, [$, w]), F(() => {
|
|
169
|
+
n.current && (k(!0), y());
|
|
170
|
+
}, [e.columns, e.cellAspect, e.stackBelow, k, y]), { rootRef: P, gridRef: E, stacked: f };
|
|
171
171
|
}
|
|
172
|
-
const
|
|
172
|
+
const pt = {
|
|
173
173
|
empty: "Sem dados",
|
|
174
174
|
error: "Não foi possível carregar",
|
|
175
175
|
loading: "Carregando...",
|
|
176
176
|
unconfigured: "Widget não configurado"
|
|
177
177
|
};
|
|
178
|
-
function
|
|
179
|
-
return /* @__PURE__ */ a("div", { className: `widget__state widget__state--${e}`, role: e === "error" ? "alert" : void 0, children: t ||
|
|
178
|
+
function ee({ kind: e, message: t }) {
|
|
179
|
+
return /* @__PURE__ */ a("div", { className: `widget__state widget__state--${e}`, role: e === "error" ? "alert" : void 0, children: t || pt[e] });
|
|
180
180
|
}
|
|
181
|
-
function W({ name: e, title: t, state:
|
|
182
|
-
return /* @__PURE__ */
|
|
181
|
+
function W({ name: e, title: t, state: n, stateMessage: r, toolbar: s, children: l }) {
|
|
182
|
+
return /* @__PURE__ */ g("div", { className: `widget widget-${e}`, children: [
|
|
183
183
|
t && /* @__PURE__ */ a("span", { className: "widget__title", children: t }),
|
|
184
184
|
s,
|
|
185
|
-
|
|
185
|
+
n ? /* @__PURE__ */ a(ee, { kind: n, message: r }) : l
|
|
186
186
|
] });
|
|
187
187
|
}
|
|
188
|
-
const
|
|
189
|
-
function
|
|
188
|
+
const _t = { up: "↑", down: "↓" };
|
|
189
|
+
function Te(e) {
|
|
190
190
|
return Array.isArray(e) ? e.filter(
|
|
191
191
|
(t) => t && t.status === "ok" && t.formatted && t.formatted !== "-"
|
|
192
192
|
) : [];
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
const
|
|
196
|
-
return /* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
|
|
194
|
+
function gt({ comparison: e, primary: t }) {
|
|
195
|
+
const n = e.sentiment ?? "neutral", r = _t[e.trend ?? ""] ?? "";
|
|
196
|
+
return /* @__PURE__ */ g("div", { className: `widget-kpi__trend widget-kpi__trend--${n}${t ? "" : " widget-kpi__trend--muted"}`, children: [
|
|
197
|
+
/* @__PURE__ */ g("span", { className: "widget-kpi__variance", children: [
|
|
198
|
+
r,
|
|
199
199
|
" ",
|
|
200
200
|
e.formatted
|
|
201
201
|
] }),
|
|
202
202
|
e.label && /* @__PURE__ */ a("span", { className: "widget-kpi__trend-label", children: e.label })
|
|
203
203
|
] });
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
const
|
|
207
|
-
return /* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */ a("span", { className: "widget-kpi__value", children:
|
|
209
|
-
s.map((l,
|
|
205
|
+
function bt({ data: e, label: t }) {
|
|
206
|
+
const n = t || String(e.label || ""), r = String(e.formatted || "-"), s = Te(e.comparisons);
|
|
207
|
+
return /* @__PURE__ */ g(W, { name: "kpi", title: n, children: [
|
|
208
|
+
/* @__PURE__ */ a("span", { className: "widget-kpi__value", children: r }),
|
|
209
|
+
s.map((l, i) => /* @__PURE__ */ a(gt, { comparison: l, primary: i === 0 }, l.id || i))
|
|
210
210
|
] });
|
|
211
211
|
}
|
|
212
|
-
const
|
|
212
|
+
const vt = "var(--bg-elevated)", wt = [
|
|
213
213
|
[1, "var(--color-success)"],
|
|
214
214
|
[0.7, ""],
|
|
215
215
|
// vazio = cor da serie 1 (destaque do dashboard)
|
|
216
216
|
[0.4, "var(--color-warning)"],
|
|
217
217
|
[0, "var(--color-error)"]
|
|
218
218
|
];
|
|
219
|
-
function
|
|
220
|
-
if (
|
|
221
|
-
if (
|
|
222
|
-
return `M ${e -
|
|
223
|
-
const s =
|
|
224
|
-
return `M ${e -
|
|
225
|
-
}
|
|
226
|
-
function
|
|
227
|
-
const
|
|
228
|
-
return /* @__PURE__ */ a(W, { name: "gauge", title:
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
/* @__PURE__ */ a("path", { d:
|
|
231
|
-
h > 0 && /* @__PURE__ */ a("path", { d:
|
|
219
|
+
function de(e, t, n, r) {
|
|
220
|
+
if (r <= 0) return "";
|
|
221
|
+
if (r >= 1)
|
|
222
|
+
return `M ${e - n} ${t} A ${n} ${n} 0 0 1 ${e} ${t - n} A ${n} ${n} 0 0 1 ${e + n} ${t}`;
|
|
223
|
+
const s = r * Math.PI;
|
|
224
|
+
return `M ${e - n} ${t} A ${n} ${n} 0 0 1 ${e - n * Math.cos(s)} ${t - n * Math.sin(s)}`;
|
|
225
|
+
}
|
|
226
|
+
function yt({ data: e, palette: t, label: n }) {
|
|
227
|
+
const r = n || String(e.label || ""), s = typeof e.ratio == "number" ? e.ratio : 0, l = typeof e.format == "string" ? e.format : void 0, i = String(e.value_formatted || be(e.value, l)), o = String(e.formatted || "-"), m = Te(e.comparisons), [c, ...u] = m, d = String((c == null ? void 0 : c.baseline_formatted) || "-"), f = (c == null ? void 0 : c.label) ?? null, p = s >= 1, h = Math.min(Math.max(s, 0), 1), v = wt.find(([P]) => s >= P), k = (v == null ? void 0 : v[1]) || t[0] || "var(--color-info)", w = 50, y = 50, C = 44, $ = 10;
|
|
228
|
+
return /* @__PURE__ */ a(W, { name: "gauge", title: r, children: /* @__PURE__ */ g("div", { className: "widget-gauge__chart", children: [
|
|
229
|
+
/* @__PURE__ */ g("svg", { viewBox: "0 0 100 56", preserveAspectRatio: "xMidYMax meet", role: "img", "aria-label": `${o} da meta`, children: [
|
|
230
|
+
/* @__PURE__ */ a("path", { d: de(w, y, C, 1), fill: "none", stroke: vt, strokeWidth: $, strokeLinecap: "butt" }),
|
|
231
|
+
h > 0 && /* @__PURE__ */ a("path", { d: de(w, y, C, h), fill: "none", stroke: k, strokeWidth: $, strokeLinecap: "butt" })
|
|
232
232
|
] }),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */ a("span", { className: "widget-gauge__percent", children:
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
|
|
233
|
+
/* @__PURE__ */ g("div", { className: "widget-gauge__center", children: [
|
|
234
|
+
/* @__PURE__ */ a("span", { className: "widget-gauge__percent", children: o }),
|
|
235
|
+
/* @__PURE__ */ g("span", { className: "widget-gauge__comparison", children: [
|
|
236
|
+
i,
|
|
237
237
|
" / ",
|
|
238
|
-
|
|
238
|
+
d
|
|
239
239
|
] }),
|
|
240
|
-
|
|
241
|
-
!
|
|
242
|
-
u.map((P, E) => /* @__PURE__ */
|
|
240
|
+
p && /* @__PURE__ */ a("span", { className: "widget-gauge__badge", children: f || "Meta batida" }),
|
|
241
|
+
!p && f && /* @__PURE__ */ a("span", { className: "widget-gauge__comparison", children: f }),
|
|
242
|
+
u.map((P, E) => /* @__PURE__ */ g("span", { className: "widget-gauge__comparison", children: [
|
|
243
243
|
P.formatted,
|
|
244
244
|
" ",
|
|
245
245
|
P.label
|
|
@@ -247,112 +247,112 @@ function Nt({ data: e, palette: t, label: r }) {
|
|
|
247
247
|
] })
|
|
248
248
|
] }) });
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
const [t,
|
|
250
|
+
function te(e) {
|
|
251
|
+
const [t, n] = T({ width: 0, height: 0 });
|
|
252
252
|
return F(() => {
|
|
253
|
-
const
|
|
254
|
-
if (!
|
|
253
|
+
const r = e.current;
|
|
254
|
+
if (!r) return;
|
|
255
255
|
const s = new ResizeObserver(([l]) => {
|
|
256
|
-
const { width:
|
|
257
|
-
|
|
258
|
-
(
|
|
256
|
+
const { width: i, height: o } = l.contentRect;
|
|
257
|
+
n(
|
|
258
|
+
(m) => m.width !== Math.floor(i) || m.height !== Math.floor(o) ? { width: Math.floor(i), height: Math.floor(o) } : m
|
|
259
259
|
);
|
|
260
260
|
});
|
|
261
|
-
return s.observe(
|
|
261
|
+
return s.observe(r), () => s.disconnect();
|
|
262
262
|
}, [e]), t;
|
|
263
263
|
}
|
|
264
|
-
const
|
|
264
|
+
const ue = { fontSize: 10, fill: "var(--text-muted)" }, Nt = "var(--bg-elevated)", St = {
|
|
265
265
|
backgroundColor: "var(--bg-elevated)",
|
|
266
266
|
border: "1px solid var(--bg-paper)",
|
|
267
267
|
borderRadius: "6px",
|
|
268
268
|
color: "var(--text-primary)"
|
|
269
|
-
},
|
|
269
|
+
}, kt = {
|
|
270
270
|
color: "var(--text-primary)",
|
|
271
271
|
fontWeight: 600
|
|
272
272
|
};
|
|
273
|
-
function
|
|
273
|
+
function Ct(e, t) {
|
|
274
274
|
var s;
|
|
275
|
-
const
|
|
276
|
-
return typeof
|
|
277
|
-
}
|
|
278
|
-
function
|
|
279
|
-
return /* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */ a(
|
|
281
|
-
/* @__PURE__ */ a(
|
|
282
|
-
/* @__PURE__ */ a(
|
|
275
|
+
const n = Array.isArray(t) ? t[0] : void 0, r = (s = n == null ? void 0 : n.payload) == null ? void 0 : s.tooltipLabel;
|
|
276
|
+
return typeof r == "string" && r ? r : String(e ?? "");
|
|
277
|
+
}
|
|
278
|
+
function U({ Chart: e, chartData: t, xKey: n, series: r, palette: s, renderSeries: l, width: i, height: o }) {
|
|
279
|
+
return /* @__PURE__ */ g(e, { data: t, width: i, height: o, children: [
|
|
280
|
+
/* @__PURE__ */ a(ke, { strokeDasharray: "3 3", stroke: Nt }),
|
|
281
|
+
/* @__PURE__ */ a(Ce, { dataKey: n, tick: ue }),
|
|
282
|
+
/* @__PURE__ */ a(Re, { tick: ue }),
|
|
283
283
|
/* @__PURE__ */ a(
|
|
284
|
-
|
|
284
|
+
X,
|
|
285
285
|
{
|
|
286
|
-
contentStyle:
|
|
287
|
-
labelStyle:
|
|
288
|
-
labelFormatter:
|
|
286
|
+
contentStyle: St,
|
|
287
|
+
labelStyle: kt,
|
|
288
|
+
labelFormatter: Ct,
|
|
289
289
|
cursor: { fill: "var(--bg-paper)", opacity: 0.3 }
|
|
290
290
|
}
|
|
291
291
|
),
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
r.length > 1 && /* @__PURE__ */ a(st, {}),
|
|
293
|
+
r.map((m, c) => l(m, s[c % s.length], c))
|
|
294
294
|
] });
|
|
295
295
|
}
|
|
296
|
-
function
|
|
297
|
-
const
|
|
296
|
+
function Rt({ data: e, palette: t, label: n }) {
|
|
297
|
+
const r = String(e.chartType || "bar"), s = n || String(e.label || ""), l = String(e.xKey || "label"), i = e.series || [], o = e.data || [], m = R(null), { width: c, height: u } = te(m), d = () => {
|
|
298
298
|
if (c <= 0 || u <= 0) return null;
|
|
299
|
-
const
|
|
300
|
-
return
|
|
301
|
-
|
|
299
|
+
const f = { chartData: o, xKey: l, series: i, palette: t, width: c, height: u };
|
|
300
|
+
return r === "line" ? /* @__PURE__ */ a(U, { ...f, Chart: tt, renderSeries: (p, h) => /* @__PURE__ */ a(
|
|
301
|
+
rt,
|
|
302
302
|
{
|
|
303
303
|
type: "monotone",
|
|
304
|
-
dataKey:
|
|
305
|
-
name:
|
|
304
|
+
dataKey: p.key,
|
|
305
|
+
name: p.label,
|
|
306
306
|
stroke: h,
|
|
307
307
|
strokeWidth: 2,
|
|
308
|
-
dot:
|
|
308
|
+
dot: o.length <= 31
|
|
309
309
|
},
|
|
310
|
-
|
|
311
|
-
) }) :
|
|
312
|
-
|
|
310
|
+
p.key
|
|
311
|
+
) }) : r === "area" ? /* @__PURE__ */ a(U, { ...f, Chart: nt, renderSeries: (p, h) => /* @__PURE__ */ a(
|
|
312
|
+
at,
|
|
313
313
|
{
|
|
314
314
|
type: "monotone",
|
|
315
|
-
dataKey:
|
|
316
|
-
name:
|
|
315
|
+
dataKey: p.key,
|
|
316
|
+
name: p.label,
|
|
317
317
|
fill: h,
|
|
318
318
|
stroke: h,
|
|
319
319
|
fillOpacity: 0.3
|
|
320
320
|
},
|
|
321
|
-
|
|
322
|
-
) }) : /* @__PURE__ */ a(
|
|
323
|
-
|
|
321
|
+
p.key
|
|
322
|
+
) }) : /* @__PURE__ */ a(U, { ...f, Chart: Se, renderSeries: (p, h) => /* @__PURE__ */ a(
|
|
323
|
+
q,
|
|
324
324
|
{
|
|
325
|
-
dataKey:
|
|
326
|
-
name:
|
|
325
|
+
dataKey: p.key,
|
|
326
|
+
name: p.label,
|
|
327
327
|
fill: h,
|
|
328
328
|
radius: [3, 3, 0, 0]
|
|
329
329
|
},
|
|
330
|
-
|
|
330
|
+
p.key
|
|
331
331
|
) });
|
|
332
332
|
};
|
|
333
|
-
return /* @__PURE__ */ a(W, { name: "chart", title: s, children: /* @__PURE__ */ a("div", { ref:
|
|
333
|
+
return /* @__PURE__ */ a(W, { name: "chart", title: s, children: /* @__PURE__ */ a("div", { ref: m, className: "widget-chart__container", children: o.length === 0 ? /* @__PURE__ */ a(ee, { kind: "empty" }) : d() }) });
|
|
334
334
|
}
|
|
335
|
-
const
|
|
336
|
-
function
|
|
335
|
+
const me = { fontSize: 10, fill: "var(--text-muted)" }, $t = "var(--bg-elevated)", xt = { fill: "var(--bg-paper)", opacity: 0.3 };
|
|
336
|
+
function Tt(e) {
|
|
337
337
|
return e.kind === "anchor" ? "var(--color-accent)" : e.kind === "residual" ? "var(--color-warning)" : e.value < 0 ? "var(--color-error)" : "var(--color-success)";
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
var
|
|
341
|
-
const
|
|
342
|
-
return
|
|
343
|
-
/* @__PURE__ */ a("span", { className: "widget-composition__tooltip-label", children:
|
|
344
|
-
/* @__PURE__ */ a("span", { className: "widget-composition__tooltip-value", children:
|
|
339
|
+
function he({ active: e, payload: t }) {
|
|
340
|
+
var r;
|
|
341
|
+
const n = e ? (r = t == null ? void 0 : t[0]) == null ? void 0 : r.payload : void 0;
|
|
342
|
+
return n ? /* @__PURE__ */ g("div", { className: "widget-composition__tooltip", children: [
|
|
343
|
+
/* @__PURE__ */ a("span", { className: "widget-composition__tooltip-label", children: n.label }),
|
|
344
|
+
/* @__PURE__ */ a("span", { className: "widget-composition__tooltip-value", children: n.formatted })
|
|
345
345
|
] }) : null;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
const
|
|
349
|
-
/* @__PURE__ */ a(
|
|
350
|
-
/* @__PURE__ */ a(
|
|
351
|
-
/* @__PURE__ */ a(
|
|
352
|
-
/* @__PURE__ */ a(
|
|
353
|
-
/* @__PURE__ */ a(
|
|
354
|
-
/* @__PURE__ */ a(
|
|
355
|
-
] }),
|
|
347
|
+
function Pt({ data: e, palette: t, label: n }) {
|
|
348
|
+
const r = n || String(e.label || ""), s = String(e.display || "pie"), l = e.data || [], i = typeof e.format == "string" ? e.format : void 0, o = R(null), { width: m, height: c } = te(o), u = () => /* @__PURE__ */ g(Se, { data: l, width: m, height: c, children: [
|
|
349
|
+
/* @__PURE__ */ a(ke, { strokeDasharray: "3 3", stroke: $t }),
|
|
350
|
+
/* @__PURE__ */ a(Ce, { dataKey: "label", tick: me, interval: 0 }),
|
|
351
|
+
/* @__PURE__ */ a(Re, { tick: me, tickFormatter: (f) => be(f, i) }),
|
|
352
|
+
/* @__PURE__ */ a(X, { content: /* @__PURE__ */ a(he, {}), cursor: xt }),
|
|
353
|
+
/* @__PURE__ */ a(q, { dataKey: "base", stackId: "bridge", fill: "none", fillOpacity: 0, isAnimationActive: !1 }),
|
|
354
|
+
/* @__PURE__ */ a(q, { dataKey: "span", stackId: "bridge", radius: [3, 3, 0, 0], children: l.map((f, p) => /* @__PURE__ */ a(ce, { fill: Tt(f) }, p)) })
|
|
355
|
+
] }), d = () => /* @__PURE__ */ g(lt, { width: m, height: c, children: [
|
|
356
356
|
/* @__PURE__ */ a(
|
|
357
357
|
it,
|
|
358
358
|
{
|
|
@@ -362,75 +362,75 @@ function At({ data: e, palette: t, label: r }) {
|
|
|
362
362
|
cx: "50%",
|
|
363
363
|
cy: "50%",
|
|
364
364
|
outerRadius: "75%",
|
|
365
|
-
label: ({ name:
|
|
365
|
+
label: ({ name: f, percent: p }) => `${f}: ${(p * 100).toFixed(0)}%`,
|
|
366
366
|
labelLine: !1,
|
|
367
|
-
children: l.map((
|
|
367
|
+
children: l.map((f, p) => /* @__PURE__ */ a(ce, { fill: t[p % t.length] }, p))
|
|
368
368
|
}
|
|
369
369
|
),
|
|
370
|
-
/* @__PURE__ */ a(
|
|
370
|
+
/* @__PURE__ */ a(X, { content: /* @__PURE__ */ a(he, {}) })
|
|
371
371
|
] });
|
|
372
|
-
return /* @__PURE__ */ a(W, { name: "composition", title:
|
|
372
|
+
return /* @__PURE__ */ a(W, { name: "composition", title: r, children: /* @__PURE__ */ a("div", { ref: o, className: "widget-composition__container", children: l.length === 0 || m <= 0 || c <= 0 ? /* @__PURE__ */ a(ee, { kind: "empty" }) : s === "bridge" ? u() : d() }) });
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function At(e, t) {
|
|
375
375
|
if (t !== "percentage") return "";
|
|
376
|
-
const
|
|
377
|
-
return Number.isNaN(
|
|
376
|
+
const n = Number(e);
|
|
377
|
+
return Number.isNaN(n) || n === 0 ? "" : n > 0 ? " widget-table__td--up" : " widget-table__td--down";
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
const s = (
|
|
379
|
+
function Mt(e, t, n, r) {
|
|
380
|
+
const s = (r == null ? void 0 : r.offsetHeight) ?? 0;
|
|
381
381
|
if (e === 0 || t <= 0 || s <= 0) return e;
|
|
382
|
-
const l = Math.floor((t - ((
|
|
382
|
+
const l = Math.floor((t - ((n == null ? void 0 : n.offsetHeight) ?? 0)) / s);
|
|
383
383
|
return Math.max(0, Math.min(e, l));
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
var
|
|
387
|
-
const
|
|
388
|
-
|
|
385
|
+
function Et({ data: e, label: t }) {
|
|
386
|
+
var f;
|
|
387
|
+
const n = e.columns || [], r = e.rows || [], s = e.overflow === "clip", l = e.indexColumn === !0, i = t || String(e.label || ""), o = R(null), m = R(null), c = R(null), { height: u } = te(o), d = s ? r.slice(0, Mt(
|
|
388
|
+
r.length,
|
|
389
389
|
u,
|
|
390
|
-
|
|
391
|
-
((
|
|
392
|
-
)) :
|
|
393
|
-
return
|
|
390
|
+
m.current,
|
|
391
|
+
((f = c.current) == null ? void 0 : f.firstElementChild) ?? null
|
|
392
|
+
)) : r;
|
|
393
|
+
return n.length === 0 ? /* @__PURE__ */ a(
|
|
394
394
|
W,
|
|
395
395
|
{
|
|
396
396
|
name: "table",
|
|
397
|
-
title:
|
|
397
|
+
title: i,
|
|
398
398
|
state: "unconfigured",
|
|
399
399
|
stateMessage: "Configure as colunas da tabela."
|
|
400
400
|
}
|
|
401
|
-
) : /* @__PURE__ */ a(W, { name: "table", title:
|
|
401
|
+
) : /* @__PURE__ */ a(W, { name: "table", title: i, children: /* @__PURE__ */ a(
|
|
402
402
|
"div",
|
|
403
403
|
{
|
|
404
|
-
ref:
|
|
404
|
+
ref: o,
|
|
405
405
|
className: `widget-table__scroll${s ? " widget-table__scroll--clip" : ""}`,
|
|
406
|
-
children: /* @__PURE__ */
|
|
406
|
+
children: /* @__PURE__ */ g(
|
|
407
407
|
"table",
|
|
408
408
|
{
|
|
409
|
-
className: `widget-table__table${s &&
|
|
409
|
+
className: `widget-table__table${s && d.length < r.length ? "" : " widget-table__table--fill"}`,
|
|
410
410
|
children: [
|
|
411
|
-
/* @__PURE__ */ a("thead", { ref:
|
|
411
|
+
/* @__PURE__ */ a("thead", { ref: m, children: /* @__PURE__ */ g("tr", { children: [
|
|
412
412
|
l && /* @__PURE__ */ a("th", { className: "widget-table__th widget-table__th--index", children: "#" }),
|
|
413
|
-
|
|
413
|
+
n.map((p) => /* @__PURE__ */ a(
|
|
414
414
|
"th",
|
|
415
415
|
{
|
|
416
|
-
className: `widget-table__th${
|
|
417
|
-
children:
|
|
416
|
+
className: `widget-table__th${le(p.format) ? " widget-table__th--num" : ""}`,
|
|
417
|
+
children: p.label || p.key
|
|
418
418
|
},
|
|
419
|
-
|
|
419
|
+
p.key
|
|
420
420
|
))
|
|
421
421
|
] }) }),
|
|
422
|
-
/* @__PURE__ */ a("tbody", { ref: c, children:
|
|
422
|
+
/* @__PURE__ */ a("tbody", { ref: c, children: d.length === 0 ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
|
|
423
423
|
"td",
|
|
424
424
|
{
|
|
425
425
|
className: "widget-table__td widget-table__td--placeholder",
|
|
426
|
-
colSpan:
|
|
426
|
+
colSpan: n.length + (l ? 1 : 0),
|
|
427
427
|
children: "Sem dados"
|
|
428
428
|
}
|
|
429
|
-
) }) :
|
|
429
|
+
) }) : d.map((p, h) => /* @__PURE__ */ g("tr", { children: [
|
|
430
430
|
l && /* @__PURE__ */ a("td", { className: "widget-table__td widget-table__td--index", children: h + 1 }),
|
|
431
|
-
|
|
432
|
-
const k =
|
|
433
|
-
return /* @__PURE__ */ a("td", { className: `widget-table__td${
|
|
431
|
+
n.map((v) => {
|
|
432
|
+
const k = p[v.key], w = le(v.format) ? " widget-table__td--num" : "";
|
|
433
|
+
return /* @__PURE__ */ a("td", { className: `widget-table__td${w}${At(k, v.format)}`, children: D(k, v.format) }, v.key);
|
|
434
434
|
})
|
|
435
435
|
] }, h)) })
|
|
436
436
|
]
|
|
@@ -439,151 +439,151 @@ function It({ data: e, label: t }) {
|
|
|
439
439
|
}
|
|
440
440
|
) });
|
|
441
441
|
}
|
|
442
|
-
function
|
|
443
|
-
return e === "yearly" ? /* @__PURE__ */ a(
|
|
442
|
+
function Pe({ mode: e, value: t, dateBounds: n, rangeUnit: r, onChange: s }) {
|
|
443
|
+
return e === "yearly" ? /* @__PURE__ */ a(Ft, { value: t, dateBounds: n, onChange: s }) : e === "monthly" ? /* @__PURE__ */ a(It, { value: t, dateBounds: n, onChange: s }) : e === "weekly" ? /* @__PURE__ */ a(Wt, { value: t, dateBounds: n, onChange: s }) : r && r !== "day" ? /* @__PURE__ */ a(
|
|
444
444
|
Lt,
|
|
445
445
|
{
|
|
446
446
|
value: t,
|
|
447
|
-
dateBounds:
|
|
448
|
-
unit:
|
|
447
|
+
dateBounds: n,
|
|
448
|
+
unit: r,
|
|
449
449
|
onChange: s
|
|
450
450
|
}
|
|
451
|
-
) : /* @__PURE__ */ a(
|
|
451
|
+
) : /* @__PURE__ */ a(Ot, { value: t, dateBounds: n, onChange: s });
|
|
452
452
|
}
|
|
453
|
-
function Lt({ value: e, dateBounds: t, unit:
|
|
454
|
-
const [s, l] = e ? e.split("|") : ["", ""],
|
|
453
|
+
function Lt({ value: e, dateBounds: t, unit: n, onChange: r }) {
|
|
454
|
+
const [s, l] = e ? e.split("|") : ["", ""], i = He(n, t), o = (c) => {
|
|
455
455
|
var u;
|
|
456
|
-
return ((u =
|
|
457
|
-
},
|
|
458
|
-
const
|
|
459
|
-
|
|
456
|
+
return ((u = i.find((d) => c >= d.start && c <= d.end)) == null ? void 0 : u.key) ?? "";
|
|
457
|
+
}, m = (c, u) => {
|
|
458
|
+
const d = i.find((f) => f.key === u);
|
|
459
|
+
d && r(c === "start" ? `${d.start}|${!l || l < d.end ? d.end : l}` : `${!s || s > d.start ? d.start : s}|${d.end}`);
|
|
460
460
|
};
|
|
461
|
-
return /* @__PURE__ */
|
|
462
|
-
/* @__PURE__ */
|
|
461
|
+
return /* @__PURE__ */ g("div", { className: "widget-filter__date-range widget-filter__date-range--period", children: [
|
|
462
|
+
/* @__PURE__ */ g(
|
|
463
463
|
"select",
|
|
464
464
|
{
|
|
465
465
|
className: "widget-filter__select",
|
|
466
466
|
"aria-label": "Período inicial",
|
|
467
|
-
value:
|
|
468
|
-
onChange: (c) =>
|
|
467
|
+
value: o(s),
|
|
468
|
+
onChange: (c) => m("start", c.target.value),
|
|
469
469
|
children: [
|
|
470
|
-
!
|
|
471
|
-
|
|
470
|
+
!o(s) && /* @__PURE__ */ a("option", { value: "", children: "De..." }),
|
|
471
|
+
i.map((c) => /* @__PURE__ */ a("option", { value: c.key, children: c.label }, c.key))
|
|
472
472
|
]
|
|
473
473
|
}
|
|
474
474
|
),
|
|
475
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ g(
|
|
476
476
|
"select",
|
|
477
477
|
{
|
|
478
478
|
className: "widget-filter__select",
|
|
479
479
|
"aria-label": "Período final",
|
|
480
|
-
value:
|
|
481
|
-
onChange: (c) =>
|
|
480
|
+
value: o(l),
|
|
481
|
+
onChange: (c) => m("end", c.target.value),
|
|
482
482
|
children: [
|
|
483
|
-
!
|
|
484
|
-
|
|
483
|
+
!o(l) && /* @__PURE__ */ a("option", { value: "", children: "Até..." }),
|
|
484
|
+
i.map((c) => /* @__PURE__ */ a("option", { value: c.key, children: c.label }, c.key))
|
|
485
485
|
]
|
|
486
486
|
}
|
|
487
487
|
)
|
|
488
488
|
] });
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
const [
|
|
492
|
-
return /* @__PURE__ */
|
|
490
|
+
function Ot({ value: e, dateBounds: t, onChange: n }) {
|
|
491
|
+
const [r, s] = e ? e.split("|") : ["", ""];
|
|
492
|
+
return /* @__PURE__ */ g("div", { className: "widget-filter__date-range widget-filter__date-range--stacked", children: [
|
|
493
493
|
/* @__PURE__ */ a(
|
|
494
494
|
ie,
|
|
495
495
|
{
|
|
496
|
-
value:
|
|
496
|
+
value: r,
|
|
497
497
|
minIso: t == null ? void 0 : t.min,
|
|
498
498
|
maxIso: s || (t == null ? void 0 : t.max),
|
|
499
499
|
selectsStart: !0,
|
|
500
|
-
startIso:
|
|
500
|
+
startIso: r,
|
|
501
501
|
endIso: s,
|
|
502
502
|
placeholder: "Data inicial",
|
|
503
|
-
onChange: (l) =>
|
|
503
|
+
onChange: (l) => n(`${l}|${s}`)
|
|
504
504
|
}
|
|
505
505
|
),
|
|
506
506
|
/* @__PURE__ */ a(
|
|
507
507
|
ie,
|
|
508
508
|
{
|
|
509
509
|
value: s,
|
|
510
|
-
minIso:
|
|
510
|
+
minIso: r || (t == null ? void 0 : t.min),
|
|
511
511
|
maxIso: t == null ? void 0 : t.max,
|
|
512
512
|
selectsEnd: !0,
|
|
513
|
-
startIso:
|
|
513
|
+
startIso: r,
|
|
514
514
|
endIso: s,
|
|
515
515
|
placeholder: "Data final",
|
|
516
|
-
onChange: (l) =>
|
|
516
|
+
onChange: (l) => n(`${r}|${l}`)
|
|
517
517
|
}
|
|
518
518
|
)
|
|
519
519
|
] });
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
const [
|
|
523
|
-
const u =
|
|
524
|
-
|
|
521
|
+
function Ft({ value: e, dateBounds: t, onChange: n }) {
|
|
522
|
+
const [r] = e ? e.split("|") : [""], s = ze(r), l = /* @__PURE__ */ new Date(), i = (s == null ? void 0 : s.year) ?? l.getFullYear(), o = J(t), m = (c) => {
|
|
523
|
+
const u = je(c);
|
|
524
|
+
n(`${u.start}|${u.end}`);
|
|
525
525
|
};
|
|
526
526
|
return /* @__PURE__ */ a("div", { className: "widget-filter__date-range widget-filter__date-range--year", children: /* @__PURE__ */ a(
|
|
527
527
|
"select",
|
|
528
528
|
{
|
|
529
529
|
className: "widget-filter__select",
|
|
530
|
-
value:
|
|
531
|
-
onChange: (c) =>
|
|
532
|
-
children:
|
|
530
|
+
value: i,
|
|
531
|
+
onChange: (c) => m(parseInt(c.target.value)),
|
|
532
|
+
children: o.map((c) => /* @__PURE__ */ a("option", { value: c, children: c }, c))
|
|
533
533
|
}
|
|
534
534
|
) });
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
const [
|
|
538
|
-
const
|
|
539
|
-
|
|
536
|
+
function It({ value: e, dateBounds: t, onChange: n }) {
|
|
537
|
+
const [r] = e ? e.split("|") : [""], s = ve(r), l = /* @__PURE__ */ new Date(), i = (s == null ? void 0 : s.year) ?? l.getFullYear(), o = (s == null ? void 0 : s.month) ?? l.getMonth() + 1, m = J(t), c = (u, d) => {
|
|
538
|
+
const f = Ve(u, d);
|
|
539
|
+
n(`${f.start}|${f.end}`);
|
|
540
540
|
};
|
|
541
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ g("div", { className: "widget-filter__date-range widget-filter__date-range--month", children: [
|
|
542
542
|
/* @__PURE__ */ a(
|
|
543
543
|
"select",
|
|
544
544
|
{
|
|
545
545
|
className: "widget-filter__select",
|
|
546
|
-
value:
|
|
547
|
-
onChange: (u) => c(
|
|
548
|
-
children: we.map((u,
|
|
546
|
+
value: o,
|
|
547
|
+
onChange: (u) => c(i, parseInt(u.target.value)),
|
|
548
|
+
children: we.map((u, d) => /* @__PURE__ */ a("option", { value: d + 1, children: u }, d + 1))
|
|
549
549
|
}
|
|
550
550
|
),
|
|
551
551
|
/* @__PURE__ */ a(
|
|
552
552
|
"select",
|
|
553
553
|
{
|
|
554
554
|
className: "widget-filter__select",
|
|
555
|
-
value:
|
|
556
|
-
onChange: (u) => c(parseInt(u.target.value),
|
|
557
|
-
children:
|
|
555
|
+
value: i,
|
|
556
|
+
onChange: (u) => c(parseInt(u.target.value), o),
|
|
557
|
+
children: m.map((u) => /* @__PURE__ */ a("option", { value: u, children: u }, u))
|
|
558
558
|
}
|
|
559
559
|
)
|
|
560
560
|
] });
|
|
561
561
|
}
|
|
562
|
-
function
|
|
563
|
-
const [
|
|
564
|
-
return /* @__PURE__ */
|
|
562
|
+
function Wt({ value: e, dateBounds: t, onChange: n }) {
|
|
563
|
+
const [r] = e ? e.split("|") : [""], s = ve(r), l = /* @__PURE__ */ new Date(), i = (s == null ? void 0 : s.year) ?? l.getFullYear(), o = (s == null ? void 0 : s.month) ?? l.getMonth() + 1, m = J(t), c = Y(i, o), u = De(r, i, o) || 1;
|
|
564
|
+
return /* @__PURE__ */ g("div", { className: "widget-filter__date-range widget-filter__date-range--week", children: [
|
|
565
565
|
/* @__PURE__ */ a(
|
|
566
566
|
"select",
|
|
567
567
|
{
|
|
568
568
|
className: "widget-filter__select",
|
|
569
|
-
value:
|
|
570
|
-
onChange: (
|
|
571
|
-
const
|
|
572
|
-
h &&
|
|
569
|
+
value: i,
|
|
570
|
+
onChange: (d) => {
|
|
571
|
+
const f = parseInt(d.target.value), h = Y(f, o)[0];
|
|
572
|
+
h && n(`${h.start}|${h.end}`);
|
|
573
573
|
},
|
|
574
|
-
children:
|
|
574
|
+
children: m.map((d) => /* @__PURE__ */ a("option", { value: d, children: d }, d))
|
|
575
575
|
}
|
|
576
576
|
),
|
|
577
577
|
/* @__PURE__ */ a(
|
|
578
578
|
"select",
|
|
579
579
|
{
|
|
580
580
|
className: "widget-filter__select",
|
|
581
|
-
value:
|
|
582
|
-
onChange: (
|
|
583
|
-
const
|
|
584
|
-
h &&
|
|
581
|
+
value: o,
|
|
582
|
+
onChange: (d) => {
|
|
583
|
+
const f = parseInt(d.target.value), h = Y(i, f)[0];
|
|
584
|
+
h && n(`${h.start}|${h.end}`);
|
|
585
585
|
},
|
|
586
|
-
children: we.map((
|
|
586
|
+
children: we.map((d, f) => /* @__PURE__ */ a("option", { value: f + 1, children: d }, f + 1))
|
|
587
587
|
}
|
|
588
588
|
),
|
|
589
589
|
/* @__PURE__ */ a(
|
|
@@ -591,32 +591,32 @@ function zt({ value: e, dateBounds: t, onChange: r }) {
|
|
|
591
591
|
{
|
|
592
592
|
className: "widget-filter__select",
|
|
593
593
|
value: u,
|
|
594
|
-
onChange: (
|
|
595
|
-
const
|
|
596
|
-
|
|
594
|
+
onChange: (d) => {
|
|
595
|
+
const f = c[parseInt(d.target.value) - 1];
|
|
596
|
+
f && n(`${f.start}|${f.end}`);
|
|
597
597
|
},
|
|
598
|
-
children: c.map((
|
|
598
|
+
children: c.map((d) => /* @__PURE__ */ a("option", { value: d.index, children: d.label }, d.index))
|
|
599
599
|
}
|
|
600
600
|
)
|
|
601
601
|
] });
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
const l = e.filterType || "select",
|
|
605
|
-
return /* @__PURE__ */
|
|
606
|
-
/* @__PURE__ */ a("label", { className: "widget-filter__label", children:
|
|
603
|
+
function zt({ config: e, value: t, options: n = [], dateBounds: r, onChange: s }) {
|
|
604
|
+
const l = e.filterType || "select", i = e.label || "Filtro", o = e.dateFilterMode || "range";
|
|
605
|
+
return /* @__PURE__ */ g("div", { className: "widget-filter", children: [
|
|
606
|
+
/* @__PURE__ */ a("label", { className: "widget-filter__label", children: i }),
|
|
607
607
|
l === "date_range" ? /* @__PURE__ */ a(
|
|
608
|
-
|
|
608
|
+
Pe,
|
|
609
609
|
{
|
|
610
|
-
mode:
|
|
610
|
+
mode: o,
|
|
611
611
|
value: t,
|
|
612
|
-
dateBounds:
|
|
612
|
+
dateBounds: r,
|
|
613
613
|
onChange: s
|
|
614
614
|
}
|
|
615
615
|
) : /* @__PURE__ */ a(
|
|
616
|
-
|
|
616
|
+
Dt,
|
|
617
617
|
{
|
|
618
618
|
value: t,
|
|
619
|
-
options:
|
|
619
|
+
options: n,
|
|
620
620
|
multi: l === "multi_select",
|
|
621
621
|
searchable: e.searchable || !1,
|
|
622
622
|
onChange: s
|
|
@@ -624,23 +624,23 @@ function Dt({ config: e, value: t, options: r = [], dateBounds: n, onChange: s }
|
|
|
624
624
|
)
|
|
625
625
|
] });
|
|
626
626
|
}
|
|
627
|
-
function
|
|
628
|
-
if (
|
|
627
|
+
function Dt({ value: e, options: t, multi: n, searchable: r, onChange: s }) {
|
|
628
|
+
if (r)
|
|
629
629
|
return /* @__PURE__ */ a(
|
|
630
|
-
|
|
630
|
+
ye,
|
|
631
631
|
{
|
|
632
632
|
value: e,
|
|
633
633
|
options: t,
|
|
634
|
-
multi:
|
|
634
|
+
multi: n,
|
|
635
635
|
onChange: s
|
|
636
636
|
}
|
|
637
637
|
);
|
|
638
|
-
if (
|
|
639
|
-
const l = e ? e.split(
|
|
640
|
-
const
|
|
641
|
-
s(
|
|
638
|
+
if (n) {
|
|
639
|
+
const l = e ? e.split(B) : [], i = (o) => {
|
|
640
|
+
const m = l.includes(o) ? l.filter((c) => c !== o) : [...l, o];
|
|
641
|
+
s(m.join(B));
|
|
642
642
|
};
|
|
643
|
-
return /* @__PURE__ */
|
|
643
|
+
return /* @__PURE__ */ g("div", { className: "widget-filter__multi", children: [
|
|
644
644
|
l.length > 0 && /* @__PURE__ */ a(
|
|
645
645
|
"button",
|
|
646
646
|
{
|
|
@@ -650,20 +650,20 @@ function Ht({ value: e, options: t, multi: r, searchable: n, onChange: s }) {
|
|
|
650
650
|
children: "Limpar filtro"
|
|
651
651
|
}
|
|
652
652
|
),
|
|
653
|
-
t.map((
|
|
653
|
+
t.map((o) => /* @__PURE__ */ g("label", { className: "widget-filter__multi-option", children: [
|
|
654
654
|
/* @__PURE__ */ a(
|
|
655
655
|
"input",
|
|
656
656
|
{
|
|
657
657
|
type: "checkbox",
|
|
658
|
-
checked: l.includes(
|
|
659
|
-
onChange: () => o
|
|
658
|
+
checked: l.includes(o),
|
|
659
|
+
onChange: () => i(o)
|
|
660
660
|
}
|
|
661
661
|
),
|
|
662
|
-
|
|
663
|
-
] },
|
|
662
|
+
o
|
|
663
|
+
] }, o))
|
|
664
664
|
] });
|
|
665
665
|
}
|
|
666
|
-
return /* @__PURE__ */
|
|
666
|
+
return /* @__PURE__ */ g(
|
|
667
667
|
"select",
|
|
668
668
|
{
|
|
669
669
|
className: "widget-filter__select",
|
|
@@ -676,52 +676,52 @@ function Ht({ value: e, options: t, multi: r, searchable: n, onChange: s }) {
|
|
|
676
676
|
}
|
|
677
677
|
);
|
|
678
678
|
}
|
|
679
|
-
const
|
|
679
|
+
const Ht = {
|
|
680
680
|
currency: "R$",
|
|
681
681
|
percentage: "%"
|
|
682
682
|
};
|
|
683
|
-
function
|
|
684
|
-
const
|
|
685
|
-
return /* @__PURE__ */
|
|
686
|
-
/* @__PURE__ */ a("label", { className: "widget-variable__label", children:
|
|
687
|
-
/* @__PURE__ */
|
|
683
|
+
function Vt({ config: e, value: t, onChange: n }) {
|
|
684
|
+
const r = e.label || "Variavel", s = e.locked || !1, l = e.variableFormat || "number", i = Ht[l] || "";
|
|
685
|
+
return /* @__PURE__ */ g("div", { className: `widget-variable ${s ? "widget-variable--locked" : ""}`, children: [
|
|
686
|
+
/* @__PURE__ */ a("label", { className: "widget-variable__label", children: r }),
|
|
687
|
+
/* @__PURE__ */ g("div", { className: "widget-variable__input-wrapper", children: [
|
|
688
688
|
/* @__PURE__ */ a(
|
|
689
689
|
"input",
|
|
690
690
|
{
|
|
691
691
|
className: "widget-variable__input",
|
|
692
692
|
type: "number",
|
|
693
693
|
value: t,
|
|
694
|
-
onChange: (
|
|
694
|
+
onChange: (o) => n(parseFloat(o.target.value) || 0),
|
|
695
695
|
disabled: s,
|
|
696
696
|
step: l === "integer" ? 1 : 0.01
|
|
697
697
|
}
|
|
698
698
|
),
|
|
699
|
-
|
|
699
|
+
i && /* @__PURE__ */ a("span", { className: "widget-variable__suffix", children: i })
|
|
700
700
|
] }),
|
|
701
701
|
s && /* @__PURE__ */ a("span", { className: "widget-variable__lock-icon", title: "Bloqueado", children: "🔒" })
|
|
702
702
|
] });
|
|
703
703
|
}
|
|
704
|
-
function
|
|
705
|
-
const
|
|
706
|
-
return /* @__PURE__ */
|
|
707
|
-
/* @__PURE__ */ a("label", { className: "widget-palette__label", children:
|
|
708
|
-
/* @__PURE__ */ a(
|
|
704
|
+
function jt({ config: e, palette: t, onChange: n }) {
|
|
705
|
+
const r = e.label || "Cores", s = e.locked || !1;
|
|
706
|
+
return /* @__PURE__ */ g("div", { className: `widget-palette ${s ? "widget-palette--locked" : ""}`, children: [
|
|
707
|
+
/* @__PURE__ */ a("label", { className: "widget-palette__label", children: r }),
|
|
708
|
+
/* @__PURE__ */ a(Ge, { selected: t, onSelect: n, customMode: !0, disabled: s }),
|
|
709
709
|
s && /* @__PURE__ */ a("span", { className: "widget-palette__lock-icon", title: "Bloqueado", children: "🔒" })
|
|
710
710
|
] });
|
|
711
711
|
}
|
|
712
|
-
const
|
|
712
|
+
const Gt = {
|
|
713
713
|
failed_to_compute: "Não foi possível calcular este widget"
|
|
714
714
|
};
|
|
715
|
-
function
|
|
715
|
+
function Kt({
|
|
716
716
|
type: e,
|
|
717
717
|
computed: t,
|
|
718
|
-
palette:
|
|
719
|
-
config:
|
|
718
|
+
palette: n,
|
|
719
|
+
config: r,
|
|
720
720
|
filterValue: s,
|
|
721
721
|
filterOptions: l,
|
|
722
|
-
dateBounds:
|
|
723
|
-
onFilterChange:
|
|
724
|
-
variableValue:
|
|
722
|
+
dateBounds: i,
|
|
723
|
+
onFilterChange: o,
|
|
724
|
+
variableValue: m,
|
|
725
725
|
onVariableChange: c,
|
|
726
726
|
onPaletteChange: u
|
|
727
727
|
}) {
|
|
@@ -730,51 +730,51 @@ function Yt({
|
|
|
730
730
|
W,
|
|
731
731
|
{
|
|
732
732
|
name: e.replace("_", "-"),
|
|
733
|
-
title:
|
|
733
|
+
title: r == null ? void 0 : r.label,
|
|
734
734
|
state: "error",
|
|
735
|
-
stateMessage:
|
|
735
|
+
stateMessage: Gt[String(t.error)]
|
|
736
736
|
}
|
|
737
737
|
);
|
|
738
|
-
const
|
|
738
|
+
const d = Ke(n);
|
|
739
739
|
switch (e) {
|
|
740
740
|
case "kpi_card":
|
|
741
|
-
return /* @__PURE__ */ a(
|
|
741
|
+
return /* @__PURE__ */ a(bt, { data: t, label: r == null ? void 0 : r.label });
|
|
742
742
|
case "gauge":
|
|
743
|
-
return /* @__PURE__ */ a(
|
|
743
|
+
return /* @__PURE__ */ a(yt, { data: t, palette: d, label: r == null ? void 0 : r.label });
|
|
744
744
|
case "chart":
|
|
745
|
-
return /* @__PURE__ */ a(
|
|
745
|
+
return /* @__PURE__ */ a(Rt, { data: t, palette: d, label: r == null ? void 0 : r.label });
|
|
746
746
|
case "composition":
|
|
747
|
-
return /* @__PURE__ */ a(
|
|
747
|
+
return /* @__PURE__ */ a(Pt, { data: t, palette: d, label: r == null ? void 0 : r.label });
|
|
748
748
|
case "table":
|
|
749
|
-
return /* @__PURE__ */ a(
|
|
749
|
+
return /* @__PURE__ */ a(Et, { data: t, label: r == null ? void 0 : r.label });
|
|
750
750
|
case "filter":
|
|
751
|
-
return
|
|
752
|
-
|
|
751
|
+
return r && o ? /* @__PURE__ */ a(
|
|
752
|
+
zt,
|
|
753
753
|
{
|
|
754
|
-
config:
|
|
754
|
+
config: r,
|
|
755
755
|
value: s || "",
|
|
756
756
|
options: l,
|
|
757
|
-
dateBounds:
|
|
758
|
-
onChange:
|
|
757
|
+
dateBounds: i,
|
|
758
|
+
onChange: o
|
|
759
759
|
}
|
|
760
760
|
) : null;
|
|
761
761
|
case "variable": {
|
|
762
|
-
const
|
|
763
|
-
return
|
|
764
|
-
|
|
762
|
+
const f = r;
|
|
763
|
+
return f && c ? /* @__PURE__ */ a(
|
|
764
|
+
Vt,
|
|
765
765
|
{
|
|
766
|
-
config:
|
|
767
|
-
value:
|
|
766
|
+
config: f,
|
|
767
|
+
value: m ?? f.variableValue ?? 0,
|
|
768
768
|
onChange: c
|
|
769
769
|
}
|
|
770
770
|
) : null;
|
|
771
771
|
}
|
|
772
772
|
case "color_palette":
|
|
773
|
-
return
|
|
774
|
-
|
|
773
|
+
return r && u ? /* @__PURE__ */ a(
|
|
774
|
+
jt,
|
|
775
775
|
{
|
|
776
|
-
config:
|
|
777
|
-
palette:
|
|
776
|
+
config: r,
|
|
777
|
+
palette: n,
|
|
778
778
|
onChange: u
|
|
779
779
|
}
|
|
780
780
|
) : null;
|
|
@@ -782,127 +782,127 @@ function Yt({
|
|
|
782
782
|
return /* @__PURE__ */ a(W, { name: "unknown", state: "unconfigured" });
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
|
-
const
|
|
786
|
-
function
|
|
785
|
+
const Yt = Oe(Kt), Ut = (e, t) => e.grid.y - t.grid.y || e.grid.x - t.grid.x, Bt = {}, fe = [];
|
|
786
|
+
function Lr({
|
|
787
787
|
token: e,
|
|
788
|
-
cellAspect: t =
|
|
789
|
-
stackBelow:
|
|
790
|
-
onGeometryChange:
|
|
788
|
+
cellAspect: t = Xe,
|
|
789
|
+
stackBelow: n,
|
|
790
|
+
onGeometryChange: r,
|
|
791
791
|
silenceWarnings: s,
|
|
792
792
|
className: l
|
|
793
793
|
}) {
|
|
794
794
|
const {
|
|
795
|
-
layout:
|
|
796
|
-
renderData:
|
|
797
|
-
loading:
|
|
795
|
+
layout: i,
|
|
796
|
+
renderData: o,
|
|
797
|
+
loading: m,
|
|
798
798
|
error: c,
|
|
799
799
|
filters: u,
|
|
800
|
-
variables:
|
|
801
|
-
palette:
|
|
802
|
-
setFilter:
|
|
800
|
+
variables: d,
|
|
801
|
+
palette: f,
|
|
802
|
+
setFilter: p,
|
|
803
803
|
setVariable: h,
|
|
804
804
|
setPalette: v
|
|
805
|
-
} =
|
|
806
|
-
columns: (
|
|
805
|
+
} = ct(e), { rootRef: k, gridRef: w, stacked: y } = ft({
|
|
806
|
+
columns: (i == null ? void 0 : i.gridColumns) ?? 0,
|
|
807
807
|
cellAspect: t,
|
|
808
|
-
stackBelow:
|
|
809
|
-
onGeometryChange:
|
|
808
|
+
stackBelow: n,
|
|
809
|
+
onGeometryChange: r,
|
|
810
810
|
silenceWarnings: s
|
|
811
|
-
}), C =
|
|
812
|
-
const
|
|
813
|
-
return
|
|
814
|
-
}, [
|
|
815
|
-
const
|
|
811
|
+
}), C = O(() => {
|
|
812
|
+
const _ = (i == null ? void 0 : i.widgets) ?? [];
|
|
813
|
+
return y ? [..._].sort(Ut) : _;
|
|
814
|
+
}, [i == null ? void 0 : i.widgets, y]), $ = O(() => {
|
|
815
|
+
const _ = {};
|
|
816
816
|
for (const N of C)
|
|
817
|
-
|
|
818
|
-
onFilter: (A) =>
|
|
817
|
+
_[N.id] = {
|
|
818
|
+
onFilter: (A) => p(N.id, A),
|
|
819
819
|
onVariable: (A) => h(N.id, A)
|
|
820
820
|
};
|
|
821
|
-
return
|
|
822
|
-
}, [C,
|
|
823
|
-
"--dash-gap": `${
|
|
824
|
-
"--dash-pad": `${
|
|
821
|
+
return _;
|
|
822
|
+
}, [C, p, h]), P = {
|
|
823
|
+
"--dash-gap": `${oe}px`,
|
|
824
|
+
"--dash-pad": `${qe}px`
|
|
825
825
|
}, E = ["preview-tab", l].filter(Boolean).join(" ");
|
|
826
826
|
let b;
|
|
827
|
-
if (c && !
|
|
827
|
+
if (c && !i)
|
|
828
828
|
b = /* @__PURE__ */ a("div", { className: "preview-tab__error", children: c });
|
|
829
|
-
else if (!
|
|
829
|
+
else if (!i)
|
|
830
830
|
b = /* @__PURE__ */ a("div", { className: "preview-tab__loading", children: "Carregando dashboard..." });
|
|
831
|
-
else if (
|
|
831
|
+
else if (i.widgets.length === 0)
|
|
832
832
|
b = /* @__PURE__ */ a("div", { className: "preview-tab__empty", children: "Este dashboard nao possui widgets." });
|
|
833
833
|
else {
|
|
834
|
-
const
|
|
835
|
-
"--dash-cols":
|
|
836
|
-
"--dash-rows":
|
|
837
|
-
...
|
|
838
|
-
}, M = ["preview-tab__grid",
|
|
839
|
-
b = /* @__PURE__ */
|
|
840
|
-
c && !
|
|
841
|
-
|
|
842
|
-
var
|
|
843
|
-
const z =
|
|
834
|
+
const _ = (o == null ? void 0 : o.widgets) ?? {}, N = (o == null ? void 0 : o.date_bounds) ?? null, A = {
|
|
835
|
+
"--dash-cols": i.gridColumns,
|
|
836
|
+
"--dash-rows": i.gridRows,
|
|
837
|
+
...Ne(f)
|
|
838
|
+
}, M = ["preview-tab__grid", y && "preview-tab__grid--stacked"].filter(Boolean).join(" ");
|
|
839
|
+
b = /* @__PURE__ */ g(V, { children: [
|
|
840
|
+
c && !o && /* @__PURE__ */ a("div", { className: "preview-tab__error", children: c }),
|
|
841
|
+
o && /* @__PURE__ */ a("div", { className: M, style: A, ref: w, children: C.map((S) => {
|
|
842
|
+
var re, ne;
|
|
843
|
+
const z = Ye.has(S.type), L = _[S.id], I = y ? {
|
|
844
844
|
gridColumn: 1,
|
|
845
|
-
aspectRatio: `${
|
|
846
|
-
minHeight: `${
|
|
845
|
+
aspectRatio: `${Be(S.grid.w, S.grid.h, t)}`,
|
|
846
|
+
minHeight: `${Ue(S.grid.h, Qe, oe, 0)}px`
|
|
847
847
|
} : {
|
|
848
848
|
gridColumn: `${S.grid.x + 1} / span ${S.grid.w}`,
|
|
849
849
|
gridRow: `${S.grid.y + 1} / span ${S.grid.h}`
|
|
850
|
-
}, Le = S.type === "variable" ?
|
|
850
|
+
}, Le = S.type === "variable" ? d[S.id] ?? (L == null ? void 0 : L.value) ?? S.config.variableValue ?? 0 : void 0;
|
|
851
851
|
return /* @__PURE__ */ a(
|
|
852
852
|
"div",
|
|
853
853
|
{
|
|
854
854
|
className: `preview-tab__widget ${z ? "preview-tab__widget--control" : ""}`,
|
|
855
|
-
style:
|
|
855
|
+
style: I,
|
|
856
856
|
children: z || L ? /* @__PURE__ */ a(
|
|
857
|
-
|
|
857
|
+
Yt,
|
|
858
858
|
{
|
|
859
859
|
type: S.type,
|
|
860
|
-
computed: L ||
|
|
861
|
-
palette:
|
|
860
|
+
computed: L || Bt,
|
|
861
|
+
palette: f,
|
|
862
862
|
config: S.config,
|
|
863
863
|
filterValue: u[S.id] || "",
|
|
864
864
|
filterOptions: (
|
|
865
865
|
// Estruturais: vem do /layout (cacheavel), nao do /render —
|
|
866
866
|
// recalcula-los a cada render custaria um DISTINCT por filtro.
|
|
867
|
-
S.type === "filter" ? S.config.availableValues ??
|
|
867
|
+
S.type === "filter" ? S.config.availableValues ?? fe : fe
|
|
868
868
|
),
|
|
869
869
|
dateBounds: N,
|
|
870
|
-
onFilterChange: (
|
|
870
|
+
onFilterChange: (re = $[S.id]) == null ? void 0 : re.onFilter,
|
|
871
871
|
variableValue: Le,
|
|
872
|
-
onVariableChange: (
|
|
872
|
+
onVariableChange: (ne = $[S.id]) == null ? void 0 : ne.onVariable,
|
|
873
873
|
onPaletteChange: v
|
|
874
874
|
}
|
|
875
|
-
) : /* @__PURE__ */ a("div", { className: "preview-tab__widget-loading", children:
|
|
875
|
+
) : /* @__PURE__ */ a("div", { className: "preview-tab__widget-loading", children: m ? "Carregando..." : "Sem dados" })
|
|
876
876
|
},
|
|
877
877
|
S.id
|
|
878
878
|
);
|
|
879
879
|
}) }),
|
|
880
|
-
|
|
880
|
+
m && o && /* @__PURE__ */ a("div", { className: "preview-tab__recalculating", children: "Atualizando..." })
|
|
881
881
|
] });
|
|
882
882
|
}
|
|
883
883
|
return /* @__PURE__ */ a("div", { className: E, style: P, ref: k, children: b });
|
|
884
884
|
}
|
|
885
|
-
function
|
|
886
|
-
const
|
|
887
|
-
|
|
885
|
+
function qt(e, t) {
|
|
886
|
+
const n = URL.createObjectURL(e), r = document.createElement("a");
|
|
887
|
+
r.href = n, r.download = t, document.body.appendChild(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 0);
|
|
888
888
|
}
|
|
889
|
-
const
|
|
890
|
-
function
|
|
889
|
+
const Xt = 768, Qt = 879;
|
|
890
|
+
function Zt(e) {
|
|
891
891
|
return Array.from(e.normalize("NFD")).filter((t) => {
|
|
892
|
-
const
|
|
893
|
-
return
|
|
892
|
+
const n = t.codePointAt(0) ?? 0;
|
|
893
|
+
return n < Xt || n > Qt;
|
|
894
894
|
}).join("");
|
|
895
895
|
}
|
|
896
|
-
function
|
|
897
|
-
return `${
|
|
896
|
+
function Jt(e, t) {
|
|
897
|
+
return `${Zt(e).replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "").toLowerCase() || "documento"}.${t}`;
|
|
898
898
|
}
|
|
899
|
-
const
|
|
900
|
-
function
|
|
901
|
-
const [t,
|
|
899
|
+
const er = 300;
|
|
900
|
+
function tr(e) {
|
|
901
|
+
const [t, n] = T(null), [r, s] = T(null), [l, i] = T({}), [o, m] = T(!0), [c, u] = T(null), [d, f] = T(!1), p = R(), h = R(!1), v = R(null), k = R(!1);
|
|
902
902
|
F(() => {
|
|
903
903
|
let C = !1;
|
|
904
|
-
return h.current = !1, v.current = null, k.current = !1,
|
|
905
|
-
C ||
|
|
904
|
+
return h.current = !1, v.current = null, k.current = !1, Ze(e).then(($) => {
|
|
905
|
+
C || n($);
|
|
906
906
|
}).catch(($) => {
|
|
907
907
|
C || u($.message);
|
|
908
908
|
}), () => {
|
|
@@ -912,192 +912,148 @@ function rr(e) {
|
|
|
912
912
|
if (!t) return;
|
|
913
913
|
const C = H(l), $ = j(C);
|
|
914
914
|
if ($ === v.current) return;
|
|
915
|
-
|
|
916
|
-
const P = k.current ?
|
|
917
|
-
return
|
|
918
|
-
|
|
919
|
-
v.current = $, k.current = !0, s(E), !h.current && E.applied && (h.current = !0,
|
|
920
|
-
const
|
|
921
|
-
return
|
|
915
|
+
p.current && clearTimeout(p.current);
|
|
916
|
+
const P = k.current ? er : 0;
|
|
917
|
+
return p.current = setTimeout(() => {
|
|
918
|
+
m(!0), Je(e, C).then((E) => {
|
|
919
|
+
v.current = $, k.current = !0, s(E), !h.current && E.applied && (h.current = !0, i((b) => {
|
|
920
|
+
const _ = { ...xe(E.applied), ...b };
|
|
921
|
+
return $e(_, b) ? b : (v.current = j(H(_)), _);
|
|
922
922
|
})), u(null);
|
|
923
|
-
}).catch((E) => u(E.message)).finally(() =>
|
|
923
|
+
}).catch((E) => u(E.message)).finally(() => m(!1));
|
|
924
924
|
}, P), () => {
|
|
925
|
-
|
|
925
|
+
p.current && clearTimeout(p.current);
|
|
926
926
|
};
|
|
927
927
|
}, [e, t, l]);
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
}, []),
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
}).catch((C) => u(C.message)).finally(() =>
|
|
928
|
+
const w = x((C, $) => {
|
|
929
|
+
i((P) => ({ ...P, [C]: $ }));
|
|
930
|
+
}, []), y = x(() => {
|
|
931
|
+
f(!0), et(e, H(l)).then((C) => {
|
|
932
|
+
qt(C, Jt((t == null ? void 0 : t.name) ?? "demonstrativo", "pdf")), u(null);
|
|
933
|
+
}).catch((C) => u(C.message)).finally(() => f(!1));
|
|
934
934
|
}, [e, l, t == null ? void 0 : t.name]);
|
|
935
935
|
return {
|
|
936
936
|
layout: t,
|
|
937
|
-
renderData:
|
|
938
|
-
loading:
|
|
937
|
+
renderData: r,
|
|
938
|
+
loading: o,
|
|
939
939
|
error: c,
|
|
940
940
|
filters: l,
|
|
941
|
-
setFilter:
|
|
942
|
-
downloadPdf:
|
|
943
|
-
downloading:
|
|
941
|
+
setFilter: w,
|
|
942
|
+
downloadPdf: y,
|
|
943
|
+
downloading: d
|
|
944
944
|
};
|
|
945
945
|
}
|
|
946
|
-
const
|
|
947
|
-
function
|
|
948
|
-
let
|
|
949
|
-
for (const [l,
|
|
950
|
-
if (
|
|
951
|
-
if (
|
|
952
|
-
|
|
946
|
+
const rr = [0, 0.25, 0.5, 0.75, 1];
|
|
947
|
+
function nr(e, t, n) {
|
|
948
|
+
let r = null, s = 0;
|
|
949
|
+
for (const [l, i] of e) {
|
|
950
|
+
if (i <= 0) continue;
|
|
951
|
+
if (r === null || i > s) {
|
|
952
|
+
r = l, s = i;
|
|
953
953
|
continue;
|
|
954
954
|
}
|
|
955
|
-
if (
|
|
956
|
-
const
|
|
957
|
-
(
|
|
955
|
+
if (i < s) continue;
|
|
956
|
+
const o = l === n, m = r !== n && (t.get(l) ?? 1 / 0) < (t.get(r) ?? 1 / 0);
|
|
957
|
+
(o || m) && (r = l);
|
|
958
958
|
}
|
|
959
|
-
return
|
|
959
|
+
return r;
|
|
960
960
|
}
|
|
961
|
-
function
|
|
962
|
-
const [
|
|
961
|
+
function ar(e, t) {
|
|
962
|
+
const [n, r] = T(null);
|
|
963
963
|
return F(() => {
|
|
964
964
|
const s = e.current;
|
|
965
965
|
if (!s || t.length === 0 || typeof IntersectionObserver > "u") {
|
|
966
|
-
|
|
966
|
+
r(null);
|
|
967
967
|
return;
|
|
968
968
|
}
|
|
969
969
|
const l = Array.from(s.querySelectorAll("th[data-period]"));
|
|
970
970
|
if (l.length === 0) {
|
|
971
|
-
|
|
971
|
+
r(null);
|
|
972
972
|
return;
|
|
973
973
|
}
|
|
974
|
-
const
|
|
974
|
+
const i = /* @__PURE__ */ new Map(), o = new Map(t.map((c, u) => [c, u])), m = new IntersectionObserver((c) => {
|
|
975
975
|
for (const u of c) {
|
|
976
|
-
const
|
|
977
|
-
|
|
976
|
+
const d = u.target.dataset.period;
|
|
977
|
+
d != null && i.set(d, u.isIntersecting ? u.intersectionRatio : 0);
|
|
978
978
|
}
|
|
979
|
-
|
|
980
|
-
}, { root: s, threshold:
|
|
981
|
-
return l.forEach((c) =>
|
|
982
|
-
}, [e, t]),
|
|
983
|
-
}
|
|
984
|
-
function lr(e, t) {
|
|
985
|
-
return e.type === "separator" || e.indent > t.indent ? !1 : !(t.type === "header" && e.type === "data" && e.indent === t.indent);
|
|
986
|
-
}
|
|
987
|
-
function Y(e, t) {
|
|
988
|
-
const r = e[t];
|
|
989
|
-
if (!r || r.type === "separator") return null;
|
|
990
|
-
let n = t + 1;
|
|
991
|
-
for (; n < e.length && !lr(e[n], r); )
|
|
992
|
-
n += 1;
|
|
993
|
-
return n === t + 1 || !e.slice(t + 1, n).some((l) => l.type !== "separator") ? null : { from: t + 1, to: n };
|
|
994
|
-
}
|
|
995
|
-
function or(e) {
|
|
996
|
-
const t = [];
|
|
997
|
-
for (let r = 0; r < e.length; r += 1)
|
|
998
|
-
Y(e, r) && t.push(e[r].id);
|
|
999
|
-
return t;
|
|
979
|
+
r((u) => nr(i, o, u));
|
|
980
|
+
}, { root: s, threshold: rr });
|
|
981
|
+
return l.forEach((c) => m.observe(c)), () => m.disconnect();
|
|
982
|
+
}, [e, t]), n;
|
|
1000
983
|
}
|
|
1001
|
-
function
|
|
984
|
+
function sr(e) {
|
|
985
|
+
var n;
|
|
1002
986
|
const t = /* @__PURE__ */ new Map();
|
|
1003
|
-
|
|
1004
|
-
const
|
|
1005
|
-
|
|
1006
|
-
});
|
|
1007
|
-
const r = [];
|
|
1008
|
-
for (const [n, s] of t) {
|
|
1009
|
-
let l = !0;
|
|
1010
|
-
for (const o of t.keys())
|
|
1011
|
-
if (o >= s.from && o < s.to) {
|
|
1012
|
-
l = !1;
|
|
1013
|
-
break;
|
|
1014
|
-
}
|
|
1015
|
-
l && r.push(e[n].id);
|
|
987
|
+
for (const r of e) {
|
|
988
|
+
const s = ((n = r.collapse) == null ? void 0 : n.hides) ?? [];
|
|
989
|
+
s.length > 0 && t.set(r.id, new Set(s));
|
|
1016
990
|
}
|
|
1017
|
-
return
|
|
991
|
+
return t;
|
|
1018
992
|
}
|
|
1019
|
-
function
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
e[s].type === "data" && (n += 1);
|
|
1025
|
-
return n;
|
|
993
|
+
function lr(e) {
|
|
994
|
+
const t = /* @__PURE__ */ new Set();
|
|
995
|
+
for (const [n, r] of e)
|
|
996
|
+
[...r].some((s) => e.has(s)) || t.add(n);
|
|
997
|
+
return t;
|
|
1026
998
|
}
|
|
1027
|
-
function
|
|
1028
|
-
const
|
|
1029
|
-
for (const
|
|
1030
|
-
const s
|
|
1031
|
-
|
|
1032
|
-
const l = Y(e, s);
|
|
1033
|
-
if (l)
|
|
1034
|
-
for (let o = l.from; o < l.to; o += 1)
|
|
1035
|
-
r.add(e[o].id);
|
|
1036
|
-
}
|
|
1037
|
-
return r;
|
|
999
|
+
function ir(e, t) {
|
|
1000
|
+
const n = /* @__PURE__ */ new Set();
|
|
1001
|
+
for (const r of t)
|
|
1002
|
+
for (const s of e.get(r) ?? []) n.add(s);
|
|
1003
|
+
return n;
|
|
1038
1004
|
}
|
|
1039
|
-
function
|
|
1040
|
-
const t =
|
|
1041
|
-
(
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
() => new Set(ir(t)),
|
|
1045
|
-
[t]
|
|
1046
|
-
), l = I(
|
|
1047
|
-
() => new Map(t.map((f, h) => [f.id, cr(t, h)])),
|
|
1048
|
-
[t]
|
|
1049
|
-
), [o, i] = T(null), d = o ?? s, c = I(() => dr(t, d), [t, d]), u = x((f) => {
|
|
1050
|
-
i((h) => {
|
|
1051
|
-
const v = new Set(h ?? s);
|
|
1052
|
-
return v.has(f) ? v.delete(f) : v.add(f), v;
|
|
1005
|
+
function or(e) {
|
|
1006
|
+
const t = O(() => sr(e), [e]), n = O(() => new Set(t.keys()), [t]), r = O(() => lr(t), [t]), [s, l] = T(null), i = s ?? r, o = O(() => ir(t, i), [t, i]), m = x((d) => {
|
|
1007
|
+
l((f) => {
|
|
1008
|
+
const p = new Set(f ?? r);
|
|
1009
|
+
return p.has(d) ? p.delete(d) : p.add(d), p;
|
|
1053
1010
|
});
|
|
1054
|
-
}, [
|
|
1055
|
-
return
|
|
1011
|
+
}, [r]), c = x(() => l(r), [r]), u = x(() => l(/* @__PURE__ */ new Set()), []);
|
|
1012
|
+
return O(() => ({
|
|
1056
1013
|
collapsible: n,
|
|
1057
|
-
collapsed:
|
|
1058
|
-
hidden:
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
return ((r = (t = e.contentBoxSize) == null ? void 0 : t[0]) == null ? void 0 : r.inlineSize) ?? e.contentRect.width;
|
|
1014
|
+
collapsed: i,
|
|
1015
|
+
hidden: o,
|
|
1016
|
+
hasSections: n.size > 0,
|
|
1017
|
+
toggle: m,
|
|
1018
|
+
collapseToSummary: c,
|
|
1019
|
+
expandAll: u
|
|
1020
|
+
}), [n, i, o, m, c, u]);
|
|
1021
|
+
}
|
|
1022
|
+
const cr = 600, dr = (e) => {
|
|
1023
|
+
var t, n;
|
|
1024
|
+
return ((n = (t = e.contentBoxSize) == null ? void 0 : t[0]) == null ? void 0 : n.inlineSize) ?? e.contentRect.width;
|
|
1069
1025
|
};
|
|
1070
|
-
function
|
|
1071
|
-
const [
|
|
1072
|
-
|
|
1073
|
-
}, [t]),
|
|
1074
|
-
s.current =
|
|
1026
|
+
function ur(e, t = cr) {
|
|
1027
|
+
const [n, r] = T(!1), s = R(null), l = x((o) => {
|
|
1028
|
+
r(o > 0 && o < t);
|
|
1029
|
+
}, [t]), i = x((o) => {
|
|
1030
|
+
s.current = o, o && e && l(o.getBoundingClientRect().width);
|
|
1075
1031
|
}, [e, l]);
|
|
1076
1032
|
return F(() => {
|
|
1077
|
-
const
|
|
1078
|
-
if (!e || !
|
|
1079
|
-
const
|
|
1033
|
+
const o = s.current;
|
|
1034
|
+
if (!e || !o || typeof ResizeObserver > "u") return;
|
|
1035
|
+
const m = new ResizeObserver((c) => {
|
|
1080
1036
|
for (const u of c)
|
|
1081
|
-
u.target ===
|
|
1037
|
+
u.target === o && l(dr(u));
|
|
1082
1038
|
});
|
|
1083
|
-
return
|
|
1084
|
-
}, [e, l]), { ref:
|
|
1039
|
+
return m.observe(o), () => m.disconnect();
|
|
1040
|
+
}, [e, l]), { ref: i, narrow: e && n };
|
|
1085
1041
|
}
|
|
1086
|
-
const
|
|
1087
|
-
function
|
|
1088
|
-
return { paddingLeft: `${
|
|
1042
|
+
const mr = 8, hr = 14, pe = 10;
|
|
1043
|
+
function fr(e, t = hr) {
|
|
1044
|
+
return { paddingLeft: `${mr + e * t}px` };
|
|
1089
1045
|
}
|
|
1090
|
-
function
|
|
1046
|
+
function pr(e) {
|
|
1091
1047
|
const t = {};
|
|
1092
1048
|
return e != null && e.accent && (t["--stmt-accent"] = e.accent), e != null && e.positive && (t["--stmt-positive"] = e.positive), e != null && e.negative && (t["--stmt-negative"] = e.negative), t;
|
|
1093
1049
|
}
|
|
1094
|
-
function
|
|
1050
|
+
function Q(e) {
|
|
1095
1051
|
return e == null || e === 0 ? "stmt__number" : `stmt__number stmt__number--${e > 0 ? "pos" : "neg"}`;
|
|
1096
1052
|
}
|
|
1097
|
-
function
|
|
1053
|
+
function _e(e) {
|
|
1098
1054
|
return e == null || e === 0 ? "stmt__aux" : `stmt__aux stmt__aux--${e > 0 ? "up" : "down"}`;
|
|
1099
1055
|
}
|
|
1100
|
-
const
|
|
1056
|
+
const _r = {
|
|
1101
1057
|
day: "day",
|
|
1102
1058
|
week: "week",
|
|
1103
1059
|
month: "month",
|
|
@@ -1105,37 +1061,37 @@ const vr = {
|
|
|
1105
1061
|
year: "year",
|
|
1106
1062
|
total: "month"
|
|
1107
1063
|
};
|
|
1108
|
-
function
|
|
1064
|
+
function gr({ definition: e, value: t, options: n, bounds: r, rangeUnit: s, onChange: l }) {
|
|
1109
1065
|
if (e.type === "date_range") {
|
|
1110
|
-
const
|
|
1111
|
-
return /* @__PURE__ */
|
|
1066
|
+
const i = e.dateFilterMode ?? "range";
|
|
1067
|
+
return /* @__PURE__ */ g("div", { className: `stmt__filter stmt__filter--date stmt__filter--${i}`, children: [
|
|
1112
1068
|
/* @__PURE__ */ a("span", { className: "stmt__filter-label", children: e.label }),
|
|
1113
1069
|
/* @__PURE__ */ a(
|
|
1114
|
-
|
|
1070
|
+
Pe,
|
|
1115
1071
|
{
|
|
1116
|
-
mode:
|
|
1072
|
+
mode: i,
|
|
1117
1073
|
value: t,
|
|
1118
|
-
dateBounds:
|
|
1074
|
+
dateBounds: r,
|
|
1119
1075
|
rangeUnit: s,
|
|
1120
1076
|
onChange: l
|
|
1121
1077
|
}
|
|
1122
1078
|
)
|
|
1123
1079
|
] });
|
|
1124
1080
|
}
|
|
1125
|
-
return /* @__PURE__ */
|
|
1081
|
+
return /* @__PURE__ */ g("div", { className: "stmt__filter", children: [
|
|
1126
1082
|
/* @__PURE__ */ a("span", { className: "stmt__filter-label", children: e.label }),
|
|
1127
1083
|
/* @__PURE__ */ a(
|
|
1128
|
-
|
|
1084
|
+
ye,
|
|
1129
1085
|
{
|
|
1130
1086
|
value: t,
|
|
1131
|
-
options:
|
|
1087
|
+
options: n,
|
|
1132
1088
|
multi: e.type === "multi_select",
|
|
1133
1089
|
onChange: l
|
|
1134
1090
|
}
|
|
1135
1091
|
)
|
|
1136
1092
|
] });
|
|
1137
1093
|
}
|
|
1138
|
-
const
|
|
1094
|
+
const br = 13, vr = [], wr = [], ge = {
|
|
1139
1095
|
day: ["dia", "dias"],
|
|
1140
1096
|
week: ["semana", "semanas"],
|
|
1141
1097
|
month: ["mês", "meses"],
|
|
@@ -1143,14 +1099,14 @@ const wr = 13, Nr = [], Sr = [], be = {
|
|
|
1143
1099
|
year: ["ano", "anos"],
|
|
1144
1100
|
total: ["período", "períodos"]
|
|
1145
1101
|
};
|
|
1146
|
-
function
|
|
1147
|
-
const [
|
|
1148
|
-
return `Variação sobre ${e} ${e === 1 ?
|
|
1102
|
+
function yr(e, t) {
|
|
1103
|
+
const [n, r] = ge[t] ?? ge.total;
|
|
1104
|
+
return `Variação sobre ${e} ${e === 1 ? n : r} atrás`;
|
|
1149
1105
|
}
|
|
1150
|
-
function
|
|
1106
|
+
function Nr({
|
|
1151
1107
|
label: e,
|
|
1152
1108
|
collapsed: t,
|
|
1153
|
-
onToggle:
|
|
1109
|
+
onToggle: n
|
|
1154
1110
|
}) {
|
|
1155
1111
|
return /* @__PURE__ */ a(
|
|
1156
1112
|
"button",
|
|
@@ -1159,73 +1115,67 @@ function Cr({
|
|
|
1159
1115
|
className: "stmt__toggle",
|
|
1160
1116
|
"aria-expanded": !t,
|
|
1161
1117
|
"aria-label": t ? `Expandir ${e}` : `Recolher ${e}`,
|
|
1162
|
-
onClick: (
|
|
1163
|
-
|
|
1118
|
+
onClick: (r) => {
|
|
1119
|
+
r.stopPropagation(), n();
|
|
1164
1120
|
},
|
|
1165
1121
|
children: /* @__PURE__ */ a("span", { className: "stmt__caret", "aria-hidden": "true" })
|
|
1166
1122
|
}
|
|
1167
1123
|
);
|
|
1168
1124
|
}
|
|
1169
|
-
function
|
|
1125
|
+
function Ae(e, t) {
|
|
1170
1126
|
return {
|
|
1171
1127
|
collapsible: t.collapsible.has(e.id),
|
|
1172
1128
|
collapsed: t.collapsed.has(e.id),
|
|
1173
|
-
hiddenCount: t.accountCounts.get(e.id) ?? 0,
|
|
1174
1129
|
onToggle: () => t.toggle(e.id)
|
|
1175
1130
|
};
|
|
1176
1131
|
}
|
|
1177
|
-
function G({ line: e, section: t, indentStep:
|
|
1178
|
-
const { collapsible:
|
|
1179
|
-
return /* @__PURE__ */
|
|
1132
|
+
function G({ line: e, section: t, indentStep: n }) {
|
|
1133
|
+
const { collapsible: r, collapsed: s, onToggle: l } = t;
|
|
1134
|
+
return /* @__PURE__ */ g(
|
|
1180
1135
|
"th",
|
|
1181
1136
|
{
|
|
1182
1137
|
scope: "row",
|
|
1183
|
-
style:
|
|
1184
|
-
onClick:
|
|
1138
|
+
style: fr(e.style.indent, n),
|
|
1139
|
+
onClick: r ? l : void 0,
|
|
1185
1140
|
children: [
|
|
1186
|
-
|
|
1187
|
-
e.label
|
|
1188
|
-
n && s && l > 0 && /* @__PURE__ */ _("span", { className: "stmt__count", children: [
|
|
1189
|
-
l,
|
|
1190
|
-
" ",
|
|
1191
|
-
l === 1 ? "conta" : "contas"
|
|
1192
|
-
] })
|
|
1141
|
+
r && /* @__PURE__ */ a(Nr, { label: e.label, collapsed: s, onToggle: l }),
|
|
1142
|
+
e.label
|
|
1193
1143
|
]
|
|
1194
1144
|
}
|
|
1195
1145
|
);
|
|
1196
1146
|
}
|
|
1197
|
-
function K(e, t,
|
|
1147
|
+
function K(e, t, n = { bold: !0 }) {
|
|
1198
1148
|
return [
|
|
1199
1149
|
"stmt__row",
|
|
1200
1150
|
`stmt__row--${e.type}`,
|
|
1201
|
-
|
|
1151
|
+
n.bold && e.style.bold && "stmt__row--bold",
|
|
1202
1152
|
t.collapsible && "stmt__row--section",
|
|
1203
1153
|
t.collapsed && "stmt__row--collapsed"
|
|
1204
1154
|
].filter(Boolean).join(" ");
|
|
1205
1155
|
}
|
|
1206
|
-
function
|
|
1156
|
+
function Me(e) {
|
|
1207
1157
|
return e.type === "header" && e.formatted.length === 0;
|
|
1208
1158
|
}
|
|
1209
|
-
function
|
|
1159
|
+
function Sr({
|
|
1210
1160
|
line: e,
|
|
1211
1161
|
columnCount: t,
|
|
1212
|
-
showTotal:
|
|
1213
|
-
showVertical:
|
|
1162
|
+
showTotal: n,
|
|
1163
|
+
showVertical: r,
|
|
1214
1164
|
showHorizontal: s,
|
|
1215
1165
|
comparisonLabel: l,
|
|
1216
|
-
section:
|
|
1166
|
+
section: i
|
|
1217
1167
|
}) {
|
|
1218
|
-
return e.type === "separator" ? /* @__PURE__ */ a("tr", { className: "stmt__row stmt__row--separator", children: /* @__PURE__ */ a("td", { colSpan: t }) }) :
|
|
1219
|
-
/* @__PURE__ */ a(G, { line: e, section:
|
|
1168
|
+
return e.type === "separator" ? /* @__PURE__ */ a("tr", { className: "stmt__row stmt__row--separator", children: /* @__PURE__ */ a("td", { colSpan: t }) }) : Me(e) ? /* @__PURE__ */ g("tr", { className: K(e, i, { bold: !1 }), children: [
|
|
1169
|
+
/* @__PURE__ */ a(G, { line: e, section: i }),
|
|
1220
1170
|
/* @__PURE__ */ a("td", { colSpan: t - 1 })
|
|
1221
|
-
] }) : /* @__PURE__ */
|
|
1222
|
-
/* @__PURE__ */ a(G, { line: e, section:
|
|
1223
|
-
e.formatted.map((
|
|
1224
|
-
var
|
|
1225
|
-
const c = e.horizontalAnalysis[
|
|
1226
|
-
return /* @__PURE__ */
|
|
1227
|
-
/* @__PURE__ */ a("span", { className:
|
|
1228
|
-
|
|
1171
|
+
] }) : /* @__PURE__ */ g("tr", { className: K(e, i), children: [
|
|
1172
|
+
/* @__PURE__ */ a(G, { line: e, section: i }),
|
|
1173
|
+
e.formatted.map((o, m) => {
|
|
1174
|
+
var d;
|
|
1175
|
+
const c = e.horizontalAnalysis[m], u = (d = e.comparison) == null ? void 0 : d[m];
|
|
1176
|
+
return /* @__PURE__ */ g("td", { className: "stmt__value", children: [
|
|
1177
|
+
/* @__PURE__ */ a("span", { className: Q(e.values[m]), children: o }),
|
|
1178
|
+
r && e.verticalAnalysis[m] != null && /* @__PURE__ */ a("span", { className: "stmt__aux", title: "Análise vertical", children: D(e.verticalAnalysis[m], "percentage") }),
|
|
1229
1179
|
s && c != null && /* @__PURE__ */ a(
|
|
1230
1180
|
"span",
|
|
1231
1181
|
{
|
|
@@ -1234,7 +1184,7 @@ function Rr({
|
|
|
1234
1184
|
children: D(c, "percentage")
|
|
1235
1185
|
}
|
|
1236
1186
|
),
|
|
1237
|
-
l && u != null && /* @__PURE__ */
|
|
1187
|
+
l && u != null && /* @__PURE__ */ g(
|
|
1238
1188
|
"span",
|
|
1239
1189
|
{
|
|
1240
1190
|
className: `stmt__aux stmt__aux--${u < 0 ? "down" : "up"}`,
|
|
@@ -1245,31 +1195,31 @@ function Rr({
|
|
|
1245
1195
|
]
|
|
1246
1196
|
}
|
|
1247
1197
|
)
|
|
1248
|
-
] },
|
|
1198
|
+
] }, m);
|
|
1249
1199
|
}),
|
|
1250
|
-
|
|
1200
|
+
n && /* @__PURE__ */ a("td", { className: "stmt__value stmt__value--total", children: /* @__PURE__ */ a("span", { className: Q(e.total), children: e.totalFormatted ?? "-" }) })
|
|
1251
1201
|
] });
|
|
1252
1202
|
}
|
|
1253
|
-
function
|
|
1203
|
+
function kr({
|
|
1254
1204
|
name: e,
|
|
1255
1205
|
columns: t,
|
|
1256
|
-
lines:
|
|
1257
|
-
showTotal:
|
|
1206
|
+
lines: n,
|
|
1207
|
+
showTotal: r,
|
|
1258
1208
|
totalLabel: s,
|
|
1259
1209
|
showVertical: l,
|
|
1260
|
-
showHorizontal:
|
|
1261
|
-
comparisonLabel:
|
|
1262
|
-
collapse:
|
|
1210
|
+
showHorizontal: i,
|
|
1211
|
+
comparisonLabel: o,
|
|
1212
|
+
collapse: m
|
|
1263
1213
|
}) {
|
|
1264
|
-
const c = R(null), u =
|
|
1214
|
+
const c = R(null), u = O(() => t.map((h) => h.key), [t]), d = ar(c, u), f = x((h) => {
|
|
1265
1215
|
const v = c.current;
|
|
1266
1216
|
if (!v) return;
|
|
1267
1217
|
const k = v.querySelector(`[data-period="${CSS.escape(h)}"]`);
|
|
1268
1218
|
k == null || k.scrollIntoView({ inline: "center", block: "nearest", behavior: "smooth" });
|
|
1269
|
-
}, []),
|
|
1270
|
-
return /* @__PURE__ */
|
|
1219
|
+
}, []), p = 1 + t.length + (r ? 1 : 0);
|
|
1220
|
+
return /* @__PURE__ */ g(V, { children: [
|
|
1271
1221
|
t.length > 1 && /* @__PURE__ */ a("nav", { className: "stmt__periods", "aria-label": "Períodos", children: t.map((h) => {
|
|
1272
|
-
const v = h.key ===
|
|
1222
|
+
const v = h.key === d;
|
|
1273
1223
|
return /* @__PURE__ */ a(
|
|
1274
1224
|
"button",
|
|
1275
1225
|
{
|
|
@@ -1277,14 +1227,14 @@ function $r({
|
|
|
1277
1227
|
className: v ? "stmt__period stmt__period--current" : "stmt__period",
|
|
1278
1228
|
"aria-current": v ? "true" : void 0,
|
|
1279
1229
|
title: `${h.start} a ${h.end}`,
|
|
1280
|
-
onClick: () =>
|
|
1230
|
+
onClick: () => f(h.key),
|
|
1281
1231
|
children: h.label
|
|
1282
1232
|
},
|
|
1283
1233
|
h.key
|
|
1284
1234
|
);
|
|
1285
1235
|
}) }),
|
|
1286
|
-
/* @__PURE__ */ a("div", { className: "stmt__scroll", ref: c, children: /* @__PURE__ */
|
|
1287
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ a("div", { className: "stmt__scroll", ref: c, children: /* @__PURE__ */ g("table", { className: "stmt__table", children: [
|
|
1237
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ g("tr", { children: [
|
|
1288
1238
|
/* @__PURE__ */ a("th", { className: "stmt__corner", scope: "col", children: e }),
|
|
1289
1239
|
t.map((h) => /* @__PURE__ */ a(
|
|
1290
1240
|
"th",
|
|
@@ -1296,34 +1246,34 @@ function $r({
|
|
|
1296
1246
|
},
|
|
1297
1247
|
h.key
|
|
1298
1248
|
)),
|
|
1299
|
-
|
|
1249
|
+
r && /* @__PURE__ */ a("th", { scope: "col", className: "stmt__total-head", children: s })
|
|
1300
1250
|
] }) }),
|
|
1301
|
-
/* @__PURE__ */ a("tbody", { children:
|
|
1302
|
-
|
|
1251
|
+
/* @__PURE__ */ a("tbody", { children: n.map((h) => m.hidden.has(h.id) ? null : /* @__PURE__ */ a(
|
|
1252
|
+
Sr,
|
|
1303
1253
|
{
|
|
1304
1254
|
line: h,
|
|
1305
|
-
columnCount:
|
|
1306
|
-
showTotal:
|
|
1255
|
+
columnCount: p,
|
|
1256
|
+
showTotal: r,
|
|
1307
1257
|
showVertical: l,
|
|
1308
|
-
showHorizontal:
|
|
1309
|
-
comparisonLabel:
|
|
1310
|
-
section:
|
|
1258
|
+
showHorizontal: i,
|
|
1259
|
+
comparisonLabel: o,
|
|
1260
|
+
section: Ae(h, m)
|
|
1311
1261
|
},
|
|
1312
1262
|
h.id
|
|
1313
1263
|
)) })
|
|
1314
1264
|
] }) })
|
|
1315
1265
|
] });
|
|
1316
1266
|
}
|
|
1317
|
-
function
|
|
1267
|
+
function Z(e) {
|
|
1318
1268
|
return e.kind === "total" ? "total" : `period:${e.column.key}`;
|
|
1319
1269
|
}
|
|
1320
|
-
function
|
|
1270
|
+
function Ee(e) {
|
|
1321
1271
|
return e.kind === "total" ? e.label : e.column.label;
|
|
1322
1272
|
}
|
|
1323
|
-
function
|
|
1324
|
-
const
|
|
1325
|
-
return /* @__PURE__ */
|
|
1326
|
-
|
|
1273
|
+
function Cr({ slots: e, selected: t, onSelect: n }) {
|
|
1274
|
+
const r = () => n(Math.max(0, t - 1)), s = () => n(Math.min(e.length - 1, t + 1));
|
|
1275
|
+
return /* @__PURE__ */ g("div", { className: "stmt__picker", role: "group", "aria-label": "Seleção de período", onKeyDown: (i) => {
|
|
1276
|
+
i.key === "ArrowLeft" ? (i.preventDefault(), r()) : i.key === "ArrowRight" && (i.preventDefault(), s());
|
|
1327
1277
|
}, children: [
|
|
1328
1278
|
/* @__PURE__ */ a(
|
|
1329
1279
|
"button",
|
|
@@ -1331,7 +1281,7 @@ function xr({ slots: e, selected: t, onSelect: r }) {
|
|
|
1331
1281
|
type: "button",
|
|
1332
1282
|
className: "stmt__picker-arrow",
|
|
1333
1283
|
"aria-label": "Período anterior",
|
|
1334
|
-
onClick:
|
|
1284
|
+
onClick: r,
|
|
1335
1285
|
disabled: t <= 0,
|
|
1336
1286
|
children: /* @__PURE__ */ a("span", { "aria-hidden": "true", children: "‹" })
|
|
1337
1287
|
}
|
|
@@ -1342,8 +1292,8 @@ function xr({ slots: e, selected: t, onSelect: r }) {
|
|
|
1342
1292
|
className: "stmt__picker-select",
|
|
1343
1293
|
"aria-label": "Período",
|
|
1344
1294
|
value: String(t),
|
|
1345
|
-
onChange: (
|
|
1346
|
-
children: e.map((
|
|
1295
|
+
onChange: (i) => n(Number(i.target.value)),
|
|
1296
|
+
children: e.map((i, o) => /* @__PURE__ */ a("option", { value: String(o), children: Ee(i) }, Z(i)))
|
|
1347
1297
|
}
|
|
1348
1298
|
),
|
|
1349
1299
|
/* @__PURE__ */ a(
|
|
@@ -1359,143 +1309,143 @@ function xr({ slots: e, selected: t, onSelect: r }) {
|
|
|
1359
1309
|
)
|
|
1360
1310
|
] });
|
|
1361
1311
|
}
|
|
1362
|
-
function
|
|
1363
|
-
const
|
|
1364
|
-
if (
|
|
1365
|
-
return /* @__PURE__ */
|
|
1366
|
-
/* @__PURE__ */ a("span", { className: "stmt__aux-number", children: D(
|
|
1312
|
+
function Rr({ line: e, index: t, previous: n }) {
|
|
1313
|
+
const r = e.horizontalAnalysis[t];
|
|
1314
|
+
if (r != null)
|
|
1315
|
+
return /* @__PURE__ */ g("span", { className: _e(r), title: `Variação sobre ${n.label}`, children: [
|
|
1316
|
+
/* @__PURE__ */ a("span", { className: "stmt__aux-number", children: D(r, "percentage") }),
|
|
1367
1317
|
" ",
|
|
1368
|
-
/* @__PURE__ */
|
|
1318
|
+
/* @__PURE__ */ g("span", { className: "stmt__aux-label", children: [
|
|
1369
1319
|
"vs ",
|
|
1370
|
-
|
|
1320
|
+
n.label
|
|
1371
1321
|
] })
|
|
1372
1322
|
] });
|
|
1373
1323
|
const s = e.formatted[t - 1];
|
|
1374
|
-
return s == null ? null : /* @__PURE__ */
|
|
1375
|
-
/* @__PURE__ */
|
|
1376
|
-
|
|
1324
|
+
return s == null ? null : /* @__PURE__ */ g("span", { className: _e(e.values[t - 1]), title: `Valor em ${n.label}`, children: [
|
|
1325
|
+
/* @__PURE__ */ g("span", { className: "stmt__aux-label", children: [
|
|
1326
|
+
n.label,
|
|
1377
1327
|
":"
|
|
1378
1328
|
] }),
|
|
1379
1329
|
" ",
|
|
1380
1330
|
/* @__PURE__ */ a("span", { className: "stmt__aux-number", children: s })
|
|
1381
1331
|
] });
|
|
1382
1332
|
}
|
|
1383
|
-
function
|
|
1333
|
+
function $r({ line: e, slot: t, previous: n, compare: r, section: s }) {
|
|
1384
1334
|
if (e.type === "separator")
|
|
1385
1335
|
return /* @__PURE__ */ a("tr", { className: "stmt__row stmt__row--separator", children: /* @__PURE__ */ a("td", { colSpan: 2 }) });
|
|
1386
|
-
if (
|
|
1387
|
-
return /* @__PURE__ */
|
|
1388
|
-
/* @__PURE__ */ a(G, { line: e, section: s, indentStep:
|
|
1336
|
+
if (Me(e))
|
|
1337
|
+
return /* @__PURE__ */ g("tr", { className: K(e, s, { bold: !1 }), children: [
|
|
1338
|
+
/* @__PURE__ */ a(G, { line: e, section: s, indentStep: pe }),
|
|
1389
1339
|
/* @__PURE__ */ a("td", {})
|
|
1390
1340
|
] });
|
|
1391
|
-
const l = t.kind === "total",
|
|
1392
|
-
return /* @__PURE__ */
|
|
1393
|
-
/* @__PURE__ */ a(G, { line: e, section: s, indentStep:
|
|
1394
|
-
/* @__PURE__ */
|
|
1395
|
-
/* @__PURE__ */ a("span", { className:
|
|
1396
|
-
|
|
1341
|
+
const l = t.kind === "total", i = l ? e.total : e.values[t.index], o = l ? e.totalFormatted ?? "-" : e.formatted[t.index];
|
|
1342
|
+
return /* @__PURE__ */ g("tr", { className: K(e, s), children: [
|
|
1343
|
+
/* @__PURE__ */ a(G, { line: e, section: s, indentStep: pe }),
|
|
1344
|
+
/* @__PURE__ */ g("td", { className: l ? "stmt__value stmt__value--total" : "stmt__value", children: [
|
|
1345
|
+
/* @__PURE__ */ a("span", { className: Q(i), children: o }),
|
|
1346
|
+
r && t.kind === "period" && n && /* @__PURE__ */ a(Rr, { line: e, index: t.index, previous: n })
|
|
1397
1347
|
] })
|
|
1398
1348
|
] });
|
|
1399
1349
|
}
|
|
1400
|
-
function
|
|
1401
|
-
const
|
|
1402
|
-
const
|
|
1403
|
-
return
|
|
1404
|
-
}, [t,
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1407
|
-
}, [
|
|
1408
|
-
return /* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */ a(
|
|
1410
|
-
/* @__PURE__ */
|
|
1350
|
+
function xr({ name: e, columns: t, lines: n, showTotal: r, totalLabel: s, collapse: l }) {
|
|
1351
|
+
const i = O(() => {
|
|
1352
|
+
const w = t.map((y, C) => ({ kind: "period", index: C, column: y }));
|
|
1353
|
+
return r && w.push({ kind: "total", label: s }), w;
|
|
1354
|
+
}, [t, r, s]), [o, m] = T(null), [c, u] = T(!0), d = t.length - 1, f = o == null ? -1 : i.findIndex((w) => Z(w) === o), p = f >= 0 ? f : d, h = i[p], v = h.kind === "period" && h.index > 0 ? t[h.index - 1] : null, k = x((w) => {
|
|
1355
|
+
const y = i[w];
|
|
1356
|
+
y && m(Z(y));
|
|
1357
|
+
}, [i]);
|
|
1358
|
+
return /* @__PURE__ */ g(V, { children: [
|
|
1359
|
+
/* @__PURE__ */ a(Cr, { slots: i, selected: p, onSelect: k }),
|
|
1360
|
+
/* @__PURE__ */ g("label", { className: "stmt__compare", children: [
|
|
1411
1361
|
/* @__PURE__ */ a(
|
|
1412
1362
|
"input",
|
|
1413
1363
|
{
|
|
1414
1364
|
type: "checkbox",
|
|
1415
1365
|
checked: c,
|
|
1416
|
-
onChange: (
|
|
1366
|
+
onChange: (w) => u(w.target.checked)
|
|
1417
1367
|
}
|
|
1418
1368
|
),
|
|
1419
1369
|
"Comparar com o anterior"
|
|
1420
1370
|
] }),
|
|
1421
|
-
/* @__PURE__ */ a("div", { className: "stmt__scroll", children: /* @__PURE__ */
|
|
1422
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */
|
|
1371
|
+
/* @__PURE__ */ a("div", { className: "stmt__scroll", children: /* @__PURE__ */ g("table", { className: "stmt__list", children: [
|
|
1372
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ g("tr", { children: [
|
|
1423
1373
|
/* @__PURE__ */ a("th", { scope: "col", className: "stmt__list-name", children: e }),
|
|
1424
|
-
/* @__PURE__ */ a("th", { scope: "col", className: "stmt__list-period", "aria-live": "polite", "aria-atomic": "true", children:
|
|
1374
|
+
/* @__PURE__ */ a("th", { scope: "col", className: "stmt__list-period", "aria-live": "polite", "aria-atomic": "true", children: Ee(h) })
|
|
1425
1375
|
] }) }),
|
|
1426
|
-
/* @__PURE__ */ a("tbody", { children:
|
|
1427
|
-
|
|
1376
|
+
/* @__PURE__ */ a("tbody", { children: n.map((w) => l.hidden.has(w.id) ? null : /* @__PURE__ */ a(
|
|
1377
|
+
$r,
|
|
1428
1378
|
{
|
|
1429
|
-
line:
|
|
1379
|
+
line: w,
|
|
1430
1380
|
slot: h,
|
|
1431
1381
|
previous: v,
|
|
1432
1382
|
compare: c,
|
|
1433
|
-
section:
|
|
1383
|
+
section: Ae(w, l)
|
|
1434
1384
|
},
|
|
1435
|
-
|
|
1385
|
+
w.id
|
|
1436
1386
|
)) })
|
|
1437
1387
|
] }) })
|
|
1438
1388
|
] });
|
|
1439
1389
|
}
|
|
1440
|
-
function
|
|
1390
|
+
function Tr({
|
|
1441
1391
|
layout: e,
|
|
1442
1392
|
renderData: t,
|
|
1443
|
-
loading:
|
|
1444
|
-
error:
|
|
1393
|
+
loading: n,
|
|
1394
|
+
error: r,
|
|
1445
1395
|
filters: s,
|
|
1446
1396
|
setFilter: l,
|
|
1447
|
-
downloadPdf:
|
|
1448
|
-
downloading:
|
|
1449
|
-
showDownload:
|
|
1397
|
+
downloadPdf: i,
|
|
1398
|
+
downloading: o,
|
|
1399
|
+
showDownload: m,
|
|
1450
1400
|
mode: c
|
|
1451
1401
|
}) {
|
|
1452
|
-
const u = (t == null ? void 0 : t.dateBounds) ?? e.dateBounds,
|
|
1402
|
+
const u = (t == null ? void 0 : t.dateBounds) ?? e.dateBounds, d = e.periods.showTotal, f = (t == null ? void 0 : t.columns) ?? vr, p = (t == null ? void 0 : t.lines) ?? wr, h = or(p), [v, k] = T(!1), w = p.some((N) => N.verticalAnalysis.length > 0), y = p.some((N) => N.horizontalAnalysis.length > 0), C = e.periods.comparisonOffset, $ = C ? yr(C, e.periods.granularity) : void 0, P = br - (d ? 1 : 0), E = Math.max(0, f.length - P), b = /* @__PURE__ */ g("span", { className: "stmt__meta stmt__bounds", children: [
|
|
1453
1403
|
"Base: ",
|
|
1454
1404
|
u.min,
|
|
1455
1405
|
" a ",
|
|
1456
1406
|
u.max
|
|
1457
1407
|
] });
|
|
1458
|
-
let
|
|
1459
|
-
return t ?
|
|
1460
|
-
|
|
1408
|
+
let _;
|
|
1409
|
+
return t ? f.length === 0 ? _ = /* @__PURE__ */ a("div", { className: "stmt__state", children: "Nenhum período na janela selecionada." }) : p.length === 0 ? _ = /* @__PURE__ */ a("div", { className: "stmt__state", children: "Este demonstrativo não possui linhas." }) : c === "periods" ? _ = /* @__PURE__ */ a(
|
|
1410
|
+
xr,
|
|
1461
1411
|
{
|
|
1462
1412
|
name: t.name,
|
|
1463
|
-
columns:
|
|
1464
|
-
lines:
|
|
1465
|
-
showTotal:
|
|
1413
|
+
columns: f,
|
|
1414
|
+
lines: p,
|
|
1415
|
+
showTotal: d,
|
|
1466
1416
|
totalLabel: e.periods.totalLabel,
|
|
1467
1417
|
collapse: h
|
|
1468
1418
|
}
|
|
1469
|
-
) :
|
|
1470
|
-
|
|
1419
|
+
) : _ = /* @__PURE__ */ a(
|
|
1420
|
+
kr,
|
|
1471
1421
|
{
|
|
1472
1422
|
name: t.name,
|
|
1473
|
-
columns:
|
|
1474
|
-
lines:
|
|
1475
|
-
showTotal:
|
|
1423
|
+
columns: f,
|
|
1424
|
+
lines: p,
|
|
1425
|
+
showTotal: d,
|
|
1476
1426
|
totalLabel: e.periods.totalLabel,
|
|
1477
|
-
showVertical:
|
|
1478
|
-
showHorizontal:
|
|
1427
|
+
showVertical: w,
|
|
1428
|
+
showHorizontal: y,
|
|
1479
1429
|
comparisonLabel: $,
|
|
1480
1430
|
collapse: h
|
|
1481
1431
|
}
|
|
1482
|
-
) :
|
|
1483
|
-
/* @__PURE__ */
|
|
1432
|
+
) : _ = /* @__PURE__ */ a("div", { className: "stmt__state", children: "Calculando..." }), /* @__PURE__ */ g(V, { children: [
|
|
1433
|
+
/* @__PURE__ */ g("div", { className: "stmt__toolbar", children: [
|
|
1484
1434
|
e.filters.map((N) => /* @__PURE__ */ a(
|
|
1485
|
-
|
|
1435
|
+
gr,
|
|
1486
1436
|
{
|
|
1487
1437
|
definition: N,
|
|
1488
1438
|
value: s[N.id] ?? "",
|
|
1489
1439
|
options: e.filterOptions[N.id] ?? [],
|
|
1490
1440
|
bounds: u,
|
|
1491
|
-
rangeUnit:
|
|
1441
|
+
rangeUnit: _r[e.periods.granularity] ?? "day",
|
|
1492
1442
|
onChange: (A) => l(N.id, A)
|
|
1493
1443
|
},
|
|
1494
1444
|
N.id
|
|
1495
1445
|
)),
|
|
1496
|
-
/* @__PURE__ */
|
|
1446
|
+
/* @__PURE__ */ g("div", { className: "stmt__toolbar-end", children: [
|
|
1497
1447
|
c === "table" && b,
|
|
1498
|
-
h.hasSections && /* @__PURE__ */
|
|
1448
|
+
h.hasSections && /* @__PURE__ */ g(V, { children: [
|
|
1499
1449
|
/* @__PURE__ */ a(
|
|
1500
1450
|
"button",
|
|
1501
1451
|
{
|
|
@@ -1515,7 +1465,7 @@ function Mr({
|
|
|
1515
1465
|
}
|
|
1516
1466
|
)
|
|
1517
1467
|
] }),
|
|
1518
|
-
|
|
1468
|
+
m && /* @__PURE__ */ a(
|
|
1519
1469
|
"button",
|
|
1520
1470
|
{
|
|
1521
1471
|
type: "button",
|
|
@@ -1525,77 +1475,77 @@ function Mr({
|
|
|
1525
1475
|
k(!0);
|
|
1526
1476
|
return;
|
|
1527
1477
|
}
|
|
1528
|
-
k(!1),
|
|
1478
|
+
k(!1), i();
|
|
1529
1479
|
},
|
|
1530
|
-
disabled:
|
|
1480
|
+
disabled: o || !t,
|
|
1531
1481
|
title: "Baixar o documento em PDF",
|
|
1532
|
-
children:
|
|
1482
|
+
children: o ? "Gerando..." : "Baixar PDF"
|
|
1533
1483
|
}
|
|
1534
1484
|
)
|
|
1535
1485
|
] })
|
|
1536
1486
|
] }),
|
|
1537
|
-
|
|
1538
|
-
v && E > 0 && /* @__PURE__ */
|
|
1487
|
+
r && /* @__PURE__ */ a("div", { className: "stmt__error", children: r }),
|
|
1488
|
+
v && E > 0 && /* @__PURE__ */ g("div", { className: "stmt__warning", children: [
|
|
1539
1489
|
"O PDF cabe ",
|
|
1540
1490
|
P,
|
|
1541
1491
|
" períodos e este documento tem ",
|
|
1542
|
-
|
|
1492
|
+
f.length,
|
|
1543
1493
|
": o arquivo sairá com os ",
|
|
1544
1494
|
P,
|
|
1545
1495
|
" mais recentes",
|
|
1546
|
-
|
|
1496
|
+
d && ", e a coluna de total seguirá cobrindo a janela inteira",
|
|
1547
1497
|
'. Clique em "Baixar PDF" de novo para gerar assim, ou reduza o período.'
|
|
1548
1498
|
] }),
|
|
1549
|
-
(t == null ? void 0 : t.truncated) && /* @__PURE__ */
|
|
1499
|
+
(t == null ? void 0 : t.truncated) && /* @__PURE__ */ g("div", { className: "stmt__warning", children: [
|
|
1550
1500
|
"A janela pedida excede o limite de colunas: o documento mostra as primeiras ",
|
|
1551
|
-
|
|
1501
|
+
f.length,
|
|
1552
1502
|
". Escolha um período menor ou uma coluna mais larga."
|
|
1553
1503
|
] }),
|
|
1554
|
-
|
|
1504
|
+
_,
|
|
1555
1505
|
c === "periods" && b,
|
|
1556
|
-
|
|
1506
|
+
n && t && /* @__PURE__ */ a("div", { className: "stmt__recalculating", children: "Atualizando..." })
|
|
1557
1507
|
] });
|
|
1558
1508
|
}
|
|
1559
|
-
function
|
|
1509
|
+
function Or({
|
|
1560
1510
|
token: e,
|
|
1561
1511
|
palette: t,
|
|
1562
|
-
showDownload:
|
|
1563
|
-
layout:
|
|
1512
|
+
showDownload: n = !0,
|
|
1513
|
+
layout: r = "auto",
|
|
1564
1514
|
className: s
|
|
1565
1515
|
}) {
|
|
1566
1516
|
const {
|
|
1567
1517
|
layout: l,
|
|
1568
|
-
renderData:
|
|
1569
|
-
loading:
|
|
1570
|
-
error:
|
|
1518
|
+
renderData: i,
|
|
1519
|
+
loading: o,
|
|
1520
|
+
error: m,
|
|
1571
1521
|
filters: c,
|
|
1572
1522
|
setFilter: u,
|
|
1573
|
-
downloadPdf:
|
|
1574
|
-
downloading:
|
|
1575
|
-
} =
|
|
1576
|
-
...t ?
|
|
1577
|
-
...
|
|
1523
|
+
downloadPdf: d,
|
|
1524
|
+
downloading: f
|
|
1525
|
+
} = tr(e), { ref: p, narrow: h } = ur(r === "auto"), v = r === "auto" ? h ? "periods" : "table" : r, k = ["stmt", `stmt--${v}`, s].filter(Boolean).join(" "), w = {
|
|
1526
|
+
...t ? Ne(t) : {},
|
|
1527
|
+
...pr(l == null ? void 0 : l.colors)
|
|
1578
1528
|
};
|
|
1579
|
-
let
|
|
1580
|
-
return
|
|
1581
|
-
|
|
1529
|
+
let y;
|
|
1530
|
+
return m && !l ? y = /* @__PURE__ */ a("div", { className: "stmt__error", children: m }) : l ? y = /* @__PURE__ */ a(
|
|
1531
|
+
Tr,
|
|
1582
1532
|
{
|
|
1583
1533
|
layout: l,
|
|
1584
|
-
renderData:
|
|
1585
|
-
loading:
|
|
1586
|
-
error:
|
|
1534
|
+
renderData: i,
|
|
1535
|
+
loading: o,
|
|
1536
|
+
error: m,
|
|
1587
1537
|
filters: c,
|
|
1588
1538
|
setFilter: u,
|
|
1589
|
-
downloadPdf:
|
|
1590
|
-
downloading:
|
|
1591
|
-
showDownload:
|
|
1539
|
+
downloadPdf: d,
|
|
1540
|
+
downloading: f,
|
|
1541
|
+
showDownload: n,
|
|
1592
1542
|
mode: v
|
|
1593
1543
|
}
|
|
1594
|
-
) :
|
|
1544
|
+
) : y = /* @__PURE__ */ a("div", { className: "stmt__state", children: "Carregando demonstrativo..." }), /* @__PURE__ */ a("div", { ref: p, className: k, style: w, children: y });
|
|
1595
1545
|
}
|
|
1596
1546
|
export {
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1547
|
+
Wr as ApiError,
|
|
1548
|
+
Lr as Dashboard,
|
|
1549
|
+
Or as Statement
|
|
1600
1550
|
};
|
|
1601
1551
|
//# sourceMappingURL=index.js.map
|