@actionexec/dashboards 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/SearchableSelect.d.ts +9 -0
- package/dist/{index-9CTE7kHo.js → index-BXIn44vr.js} +250 -166
- package/dist/index-BXIn44vr.js.map +1 -0
- package/dist/index.js +249 -238
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +1 -0
- package/dist/internals.js +19 -18
- package/dist/styles.css +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/index-9CTE7kHo.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
options: string[];
|
|
3
|
+
value: string;
|
|
4
|
+
multi: boolean;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function SearchableSelect({ options, value, multi, onChange, placeholder }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as l, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import C from "react-datepicker";
|
|
3
|
+
import { useState as N, useRef as P, useMemo as w, useEffect as $ } from "react";
|
|
4
|
+
const k = "https://action-data-api-7mbrztperq-rj.a.run.app", R = "/external/dashboards";
|
|
5
|
+
let v = k;
|
|
6
|
+
function X(e) {
|
|
7
|
+
v = e.replace(/\/$/, "");
|
|
7
8
|
}
|
|
8
|
-
class
|
|
9
|
+
class F extends Error {
|
|
9
10
|
constructor(t, r, a) {
|
|
10
11
|
super(t), this.status = r, this.payload = a, this.name = "ApiError";
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
async function
|
|
14
|
-
const a = new URL(`${
|
|
14
|
+
async function L(e, t, r) {
|
|
15
|
+
const a = new URL(`${v}${R}${e}`);
|
|
15
16
|
if (r)
|
|
16
17
|
for (const [n, i] of Object.entries(r)) a.searchParams.set(n, i);
|
|
17
18
|
const s = await fetch(a.toString(), {
|
|
@@ -23,7 +24,7 @@ async function y(e, t, r) {
|
|
|
23
24
|
n = await s.json();
|
|
24
25
|
} catch {
|
|
25
26
|
}
|
|
26
|
-
throw new
|
|
27
|
+
throw new F(
|
|
27
28
|
`Requisicao falhou (${s.status}) em ${e}`,
|
|
28
29
|
s.status,
|
|
29
30
|
n
|
|
@@ -31,7 +32,7 @@ async function y(e, t, r) {
|
|
|
31
32
|
}
|
|
32
33
|
return await s.json();
|
|
33
34
|
}
|
|
34
|
-
const
|
|
35
|
+
const Z = (e) => L("/layout", e), ee = (e, t) => L("/render", e, t), d = {
|
|
35
36
|
series0: 0,
|
|
36
37
|
series1: 1,
|
|
37
38
|
series2: 2,
|
|
@@ -45,7 +46,7 @@ const J = (e) => y("/layout", e), z = (e, t) => y("/render", e, t), o = {
|
|
|
45
46
|
accent: 10,
|
|
46
47
|
success: 11,
|
|
47
48
|
error: 12
|
|
48
|
-
},
|
|
49
|
+
}, I = 5, E = 13, U = {
|
|
49
50
|
series0: "Série 1",
|
|
50
51
|
series1: "Série 2",
|
|
51
52
|
series2: "Série 3",
|
|
@@ -59,7 +60,7 @@ const J = (e) => y("/layout", e), z = (e, t) => y("/render", e, t), o = {
|
|
|
59
60
|
accent: "Destaque",
|
|
60
61
|
success: "Sucesso",
|
|
61
62
|
error: "Erro"
|
|
62
|
-
},
|
|
63
|
+
}, y = {
|
|
63
64
|
action: {
|
|
64
65
|
label: "Action",
|
|
65
66
|
colors: [
|
|
@@ -150,36 +151,36 @@ const J = (e) => y("/layout", e), z = (e, t) => y("/render", e, t), o = {
|
|
|
150
151
|
"#e11d48"
|
|
151
152
|
]
|
|
152
153
|
}
|
|
153
|
-
},
|
|
154
|
-
function
|
|
155
|
-
const t =
|
|
154
|
+
}, M = y.action.colors;
|
|
155
|
+
function D(e) {
|
|
156
|
+
const t = M;
|
|
156
157
|
if (!e || e.length === 0) return [...t];
|
|
157
|
-
if (e.length >=
|
|
158
|
+
if (e.length >= E) return e.slice(0, E);
|
|
158
159
|
const r = [...e];
|
|
159
|
-
for (let a = e.length; a <
|
|
160
|
+
for (let a = e.length; a < E; a++) r.push(t[a]);
|
|
160
161
|
return r;
|
|
161
162
|
}
|
|
162
|
-
function
|
|
163
|
-
return
|
|
163
|
+
function Y(e) {
|
|
164
|
+
return D(e).slice(0, I);
|
|
164
165
|
}
|
|
165
|
-
function
|
|
166
|
-
const t =
|
|
166
|
+
function te(e) {
|
|
167
|
+
const t = D(e);
|
|
167
168
|
return {
|
|
168
|
-
"--bg-dark": t[
|
|
169
|
-
"--bg-paper": t[
|
|
170
|
-
"--bg-elevated": t[
|
|
171
|
-
"--text-primary": t[
|
|
172
|
-
"--text-secondary": t[
|
|
173
|
-
"--text-muted": t[
|
|
174
|
-
"--action-orange": t[
|
|
175
|
-
"--action-green": t[
|
|
176
|
-
"--color-success": t[
|
|
177
|
-
"--color-error": t[
|
|
178
|
-
"--color-info": t[
|
|
179
|
-
"--color-warning": t[
|
|
169
|
+
"--bg-dark": t[d.bgDark],
|
|
170
|
+
"--bg-paper": t[d.bgPaper],
|
|
171
|
+
"--bg-elevated": t[d.bgElevated],
|
|
172
|
+
"--text-primary": t[d.textPrimary],
|
|
173
|
+
"--text-secondary": t[d.textMuted],
|
|
174
|
+
"--text-muted": t[d.textMuted],
|
|
175
|
+
"--action-orange": t[d.accent],
|
|
176
|
+
"--action-green": t[d.success],
|
|
177
|
+
"--color-success": t[d.success],
|
|
178
|
+
"--color-error": t[d.error],
|
|
179
|
+
"--color-info": t[d.series2],
|
|
180
|
+
"--color-warning": t[d.series3]
|
|
180
181
|
};
|
|
181
182
|
}
|
|
182
|
-
const
|
|
183
|
+
const ae = [
|
|
183
184
|
"Jan",
|
|
184
185
|
"Fev",
|
|
185
186
|
"Mar",
|
|
@@ -192,7 +193,7 @@ const V = [
|
|
|
192
193
|
"Out",
|
|
193
194
|
"Nov",
|
|
194
195
|
"Dez"
|
|
195
|
-
],
|
|
196
|
+
], re = [
|
|
196
197
|
"Janeiro",
|
|
197
198
|
"Fevereiro",
|
|
198
199
|
"Marco",
|
|
@@ -206,79 +207,79 @@ const V = [
|
|
|
206
207
|
"Novembro",
|
|
207
208
|
"Dezembro"
|
|
208
209
|
];
|
|
209
|
-
function
|
|
210
|
+
function se(e) {
|
|
210
211
|
return { start: `${e}-01-01`, end: `${e}-12-31` };
|
|
211
212
|
}
|
|
212
|
-
function
|
|
213
|
+
function ne(e) {
|
|
213
214
|
if (!e) return null;
|
|
214
215
|
const t = e.match(/^(\d{4})/);
|
|
215
216
|
return t ? { year: parseInt(t[1]) } : null;
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
+
function oe(e, t) {
|
|
218
219
|
const r = new Date(e, t, 0).getDate(), a = (s) => String(s).padStart(2, "0");
|
|
219
220
|
return {
|
|
220
221
|
start: `${e}-${a(t)}-01`,
|
|
221
222
|
end: `${e}-${a(t)}-${a(r)}`
|
|
222
223
|
};
|
|
223
224
|
}
|
|
224
|
-
function
|
|
225
|
+
function x(e) {
|
|
225
226
|
const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()));
|
|
226
227
|
t.setUTCDate(t.getUTCDate() + 4 - (t.getUTCDay() || 7));
|
|
227
228
|
const r = new Date(Date.UTC(t.getUTCFullYear(), 0, 1));
|
|
228
229
|
return Math.ceil(((t.getTime() - r.getTime()) / 864e5 + 1) / 7);
|
|
229
230
|
}
|
|
230
|
-
function
|
|
231
|
-
const r = new Date(e, 0, 4), a = (r.getDay() + 6) % 7, s = new Date(r.getTime() - a * 864e5), n = new Date(s.getTime() + (t - 1) * 7 * 864e5), i = new Date(n.getTime() + 6 * 864e5), f = (g) => String(g).padStart(2, "0"),
|
|
232
|
-
return { start:
|
|
231
|
+
function ce(e, t) {
|
|
232
|
+
const r = new Date(e, 0, 4), a = (r.getDay() + 6) % 7, s = new Date(r.getTime() - a * 864e5), n = new Date(s.getTime() + (t - 1) * 7 * 864e5), i = new Date(n.getTime() + 6 * 864e5), f = (g) => String(g).padStart(2, "0"), p = (g) => `${g.getFullYear()}-${f(g.getMonth() + 1)}-${f(g.getDate())}`;
|
|
233
|
+
return { start: p(n), end: p(i) };
|
|
233
234
|
}
|
|
234
|
-
function
|
|
235
|
+
function le(e, t) {
|
|
235
236
|
const r = /* @__PURE__ */ new Set(), a = new Date(e, t, 0).getDate();
|
|
236
237
|
for (let s = 1; s <= a; s++)
|
|
237
|
-
r.add(
|
|
238
|
+
r.add(x(new Date(e, t - 1, s)));
|
|
238
239
|
return Array.from(r).sort((s, n) => s - n);
|
|
239
240
|
}
|
|
240
|
-
function
|
|
241
|
+
function ie(e, t) {
|
|
241
242
|
const r = new Date(e, t, 0).getDate(), a = (f) => String(f).padStart(2, "0"), s = [];
|
|
242
243
|
let n = 1, i = 1;
|
|
243
244
|
for (; n <= r; ) {
|
|
244
|
-
const f = n,
|
|
245
|
-
s.push({ index: i, startDay: f, endDay:
|
|
245
|
+
const f = n, p = Math.min(n + 6, r), g = `${e}-${a(t)}-${a(f)}`, o = `${e}-${a(t)}-${a(p)}`, u = `${i}° Semana (${a(f)}/${a(t)} - ${a(p)}/${a(t)})`;
|
|
246
|
+
s.push({ index: i, startDay: f, endDay: p, start: g, end: o, label: u }), n = p + 1, i++;
|
|
246
247
|
}
|
|
247
248
|
return s;
|
|
248
249
|
}
|
|
249
|
-
function
|
|
250
|
+
function ue(e, t, r) {
|
|
250
251
|
if (!e) return 1;
|
|
251
252
|
const a = (i) => String(i).padStart(2, "0"), s = e.match(new RegExp(`^${t}-${a(r)}-(\\d{2})`));
|
|
252
253
|
if (!s) return 1;
|
|
253
254
|
const n = parseInt(s[1]);
|
|
254
255
|
return Math.ceil(n / 7);
|
|
255
256
|
}
|
|
256
|
-
function
|
|
257
|
+
function de(e) {
|
|
257
258
|
if (!e) return null;
|
|
258
259
|
const t = e.match(/^(\d{4})-(\d{2})/);
|
|
259
260
|
return t ? { year: parseInt(t[1]), month: parseInt(t[2]) } : null;
|
|
260
261
|
}
|
|
261
|
-
function
|
|
262
|
+
function fe(e) {
|
|
262
263
|
if (!e) return null;
|
|
263
264
|
const t = /* @__PURE__ */ new Date(e + "T00:00:00");
|
|
264
|
-
return isNaN(t.getTime()) ? null : { year: t.getFullYear(), week:
|
|
265
|
+
return isNaN(t.getTime()) ? null : { year: t.getFullYear(), week: x(t) };
|
|
265
266
|
}
|
|
266
|
-
function
|
|
267
|
+
function ge(e) {
|
|
267
268
|
const t = /* @__PURE__ */ new Date(), r = e != null && e.min ? parseInt(e.min.slice(0, 4)) : t.getFullYear() - 2, a = e != null && e.max ? parseInt(e.max.slice(0, 4)) : t.getFullYear(), s = [];
|
|
268
269
|
for (let n = a; n >= r; n--) s.push(n);
|
|
269
270
|
return s;
|
|
270
271
|
}
|
|
271
|
-
function
|
|
272
|
+
function T(e) {
|
|
272
273
|
if (!e) return null;
|
|
273
274
|
const [t, r, a] = e.split("-").map(Number);
|
|
274
275
|
return !t || !r || !a ? null : new Date(t, r - 1, a);
|
|
275
276
|
}
|
|
276
|
-
function
|
|
277
|
+
function G(e) {
|
|
277
278
|
if (!e) return "";
|
|
278
279
|
const t = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"), a = String(e.getDate()).padStart(2, "0");
|
|
279
280
|
return `${t}-${r}-${a}`;
|
|
280
281
|
}
|
|
281
|
-
function
|
|
282
|
+
function pe({
|
|
282
283
|
value: e,
|
|
283
284
|
onChange: t,
|
|
284
285
|
minIso: r,
|
|
@@ -287,56 +288,138 @@ function ne({
|
|
|
287
288
|
selectsStart: n,
|
|
288
289
|
selectsEnd: i,
|
|
289
290
|
startIso: f,
|
|
290
|
-
endIso:
|
|
291
|
+
endIso: p,
|
|
291
292
|
className: g,
|
|
292
|
-
disabled:
|
|
293
|
+
disabled: o
|
|
293
294
|
}) {
|
|
294
|
-
return /* @__PURE__ */
|
|
295
|
-
|
|
295
|
+
return /* @__PURE__ */ l("div", { className: `ddp-field ${g ?? ""}`, children: /* @__PURE__ */ l(
|
|
296
|
+
C,
|
|
296
297
|
{
|
|
297
|
-
selected:
|
|
298
|
-
onChange: (
|
|
298
|
+
selected: T(e),
|
|
299
|
+
onChange: (u) => t(G(u)),
|
|
299
300
|
selectsStart: n,
|
|
300
301
|
selectsEnd: i,
|
|
301
|
-
startDate:
|
|
302
|
-
endDate:
|
|
303
|
-
minDate:
|
|
304
|
-
maxDate:
|
|
302
|
+
startDate: T(f) ?? void 0,
|
|
303
|
+
endDate: T(p) ?? void 0,
|
|
304
|
+
minDate: T(r) ?? void 0,
|
|
305
|
+
maxDate: T(a) ?? void 0,
|
|
305
306
|
dateFormat: "dd/MM/yyyy",
|
|
306
307
|
placeholderText: s ?? "Selecione...",
|
|
307
|
-
disabled:
|
|
308
|
+
disabled: o,
|
|
308
309
|
portalId: "ddp-portal",
|
|
309
310
|
popperPlacement: "bottom-start",
|
|
310
311
|
popperModifiers: [
|
|
311
312
|
{
|
|
312
313
|
name: "flip",
|
|
313
314
|
options: { fallbackPlacements: ["bottom-end", "top-start", "top-end"] },
|
|
314
|
-
fn: (
|
|
315
|
+
fn: (u) => u
|
|
315
316
|
}
|
|
316
317
|
]
|
|
317
318
|
}
|
|
318
319
|
) });
|
|
319
320
|
}
|
|
320
|
-
|
|
321
|
-
o
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
321
|
+
function me({ options: e, value: t, multi: r, onChange: a, placeholder: s }) {
|
|
322
|
+
const [n, i] = N(!1), [f, p] = N(""), g = P(null), o = w(
|
|
323
|
+
() => t ? t.split(",").filter(Boolean) : [],
|
|
324
|
+
[t]
|
|
325
|
+
), u = w(() => {
|
|
326
|
+
const c = f.trim().toLowerCase();
|
|
327
|
+
return c ? e.filter((S) => S.toLowerCase().includes(c)) : e;
|
|
328
|
+
}, [e, f]);
|
|
329
|
+
$(() => {
|
|
330
|
+
if (!n) return;
|
|
331
|
+
const c = (S) => {
|
|
332
|
+
g.current && !g.current.contains(S.target) && i(!1);
|
|
333
|
+
};
|
|
334
|
+
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
335
|
+
}, [n]);
|
|
336
|
+
const m = (c) => {
|
|
337
|
+
a(c), p(""), i(!1);
|
|
338
|
+
}, b = (c) => {
|
|
339
|
+
const S = o.includes(c) ? o.filter((A) => A !== c) : [...o, c];
|
|
340
|
+
a(S.join(","));
|
|
341
|
+
}, _ = r ? o.length > 0 : !!t, O = r ? o.length > 0 ? `${o.length} selecionado(s)` : s || "Todos" : t || s || "Todos";
|
|
342
|
+
return /* @__PURE__ */ h("div", { ref: g, className: "widget-filter__search", children: [
|
|
343
|
+
/* @__PURE__ */ h(
|
|
344
|
+
"button",
|
|
345
|
+
{
|
|
346
|
+
type: "button",
|
|
347
|
+
className: "widget-filter__search-trigger",
|
|
348
|
+
onClick: () => i((c) => !c),
|
|
349
|
+
children: [
|
|
350
|
+
/* @__PURE__ */ l("span", { className: `widget-filter__search-value${_ ? "" : " is-placeholder"}`, children: O }),
|
|
351
|
+
/* @__PURE__ */ l("span", { className: "widget-filter__search-caret", "aria-hidden": !0, children: "▾" })
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
),
|
|
355
|
+
n && /* @__PURE__ */ h("div", { className: "widget-filter__search-panel", children: [
|
|
356
|
+
/* @__PURE__ */ l(
|
|
357
|
+
"input",
|
|
358
|
+
{
|
|
359
|
+
type: "text",
|
|
360
|
+
className: "widget-filter__search-input",
|
|
361
|
+
autoFocus: !0,
|
|
362
|
+
value: f,
|
|
363
|
+
placeholder: "Buscar...",
|
|
364
|
+
onChange: (c) => p(c.target.value)
|
|
365
|
+
}
|
|
366
|
+
),
|
|
367
|
+
/* @__PURE__ */ h("div", { className: "widget-filter__search-list", children: [
|
|
368
|
+
!r && /* @__PURE__ */ l(
|
|
369
|
+
"button",
|
|
370
|
+
{
|
|
371
|
+
type: "button",
|
|
372
|
+
className: `widget-filter__search-option${t ? "" : " is-selected"}`,
|
|
373
|
+
onClick: () => m(""),
|
|
374
|
+
children: "Todos"
|
|
375
|
+
}
|
|
376
|
+
),
|
|
377
|
+
u.length === 0 ? /* @__PURE__ */ l("span", { className: "widget-filter__search-empty", children: "Nenhuma opção" }) : u.map(
|
|
378
|
+
(c) => r ? /* @__PURE__ */ h("label", { className: "widget-filter__search-option", children: [
|
|
379
|
+
/* @__PURE__ */ l(
|
|
380
|
+
"input",
|
|
381
|
+
{
|
|
382
|
+
type: "checkbox",
|
|
383
|
+
checked: o.includes(c),
|
|
384
|
+
onChange: () => b(c)
|
|
385
|
+
}
|
|
386
|
+
),
|
|
387
|
+
c
|
|
388
|
+
] }, c) : /* @__PURE__ */ l(
|
|
389
|
+
"button",
|
|
390
|
+
{
|
|
391
|
+
type: "button",
|
|
392
|
+
className: `widget-filter__search-option${t === c ? " is-selected" : ""}`,
|
|
393
|
+
onClick: () => m(c),
|
|
394
|
+
children: c
|
|
395
|
+
},
|
|
396
|
+
c
|
|
397
|
+
)
|
|
398
|
+
)
|
|
399
|
+
] })
|
|
400
|
+
] })
|
|
401
|
+
] });
|
|
402
|
+
}
|
|
403
|
+
const W = [
|
|
404
|
+
d.bgDark,
|
|
405
|
+
d.bgPaper,
|
|
406
|
+
d.bgElevated,
|
|
407
|
+
d.accent,
|
|
408
|
+
d.success
|
|
326
409
|
];
|
|
327
|
-
function
|
|
410
|
+
function j(e) {
|
|
328
411
|
if (!e) return !0;
|
|
329
|
-
const t =
|
|
330
|
-
return Object.values(
|
|
412
|
+
const t = D(e);
|
|
413
|
+
return Object.values(y).some(
|
|
331
414
|
(r) => JSON.stringify(r.colors) === JSON.stringify(t)
|
|
332
415
|
);
|
|
333
416
|
}
|
|
334
|
-
const
|
|
417
|
+
const J = [
|
|
335
418
|
{ label: "Series", slots: ["series0", "series1", "series2", "series3", "series4"] },
|
|
336
419
|
{ label: "Tema", slots: ["bgDark", "bgPaper", "bgElevated", "textPrimary", "textMuted"] },
|
|
337
420
|
{ label: "Estados", slots: ["accent", "success", "error"] }
|
|
338
421
|
];
|
|
339
|
-
function
|
|
422
|
+
function he({
|
|
340
423
|
selected: e,
|
|
341
424
|
onSelect: t,
|
|
342
425
|
customMode: r,
|
|
@@ -344,176 +427,177 @@ function oe({
|
|
|
344
427
|
disabled: s
|
|
345
428
|
}) {
|
|
346
429
|
var g;
|
|
347
|
-
const n = r ?? !
|
|
348
|
-
([,
|
|
349
|
-
)) == null ? void 0 : g[0],
|
|
350
|
-
const
|
|
351
|
-
for (;
|
|
352
|
-
|
|
430
|
+
const n = r ?? !j(e), i = D(e), f = n || (g = Object.entries(y).find(
|
|
431
|
+
([, o]) => JSON.stringify(o.colors) === JSON.stringify(i)
|
|
432
|
+
)) == null ? void 0 : g[0], p = (o, u) => {
|
|
433
|
+
const m = [...i];
|
|
434
|
+
for (; m.length < E; ) m.push("#000000");
|
|
435
|
+
m[o] = u, t(m);
|
|
353
436
|
};
|
|
354
437
|
return /* @__PURE__ */ h("div", { className: `palette-selector ${s ? "palette-selector--disabled" : ""}`, children: [
|
|
355
438
|
a && /* @__PURE__ */ h("label", { className: "config-panel__checkbox", children: [
|
|
356
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ l(
|
|
357
440
|
"input",
|
|
358
441
|
{
|
|
359
442
|
type: "checkbox",
|
|
360
443
|
checked: n,
|
|
361
|
-
onChange: (
|
|
444
|
+
onChange: (o) => a(o.target.checked),
|
|
362
445
|
disabled: s
|
|
363
446
|
}
|
|
364
447
|
),
|
|
365
448
|
"Customizar"
|
|
366
449
|
] }),
|
|
367
|
-
n ? /* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
const
|
|
371
|
-
return /* @__PURE__ */
|
|
450
|
+
n ? /* @__PURE__ */ l("div", { className: "palette-selector__custom", children: J.map((o) => /* @__PURE__ */ h("div", { className: "palette-selector__row", children: [
|
|
451
|
+
/* @__PURE__ */ l("span", { className: "palette-selector__row-label", children: o.label }),
|
|
452
|
+
/* @__PURE__ */ l("div", { className: "palette-selector__row-slots", children: o.slots.map((u) => {
|
|
453
|
+
const m = d[u];
|
|
454
|
+
return /* @__PURE__ */ l(
|
|
372
455
|
"input",
|
|
373
456
|
{
|
|
374
457
|
type: "color",
|
|
375
458
|
className: "palette-selector__color-input",
|
|
376
|
-
value: i[
|
|
377
|
-
onChange: (b) =>
|
|
459
|
+
value: i[m] || "#000000",
|
|
460
|
+
onChange: (b) => p(m, b.target.value),
|
|
378
461
|
disabled: s,
|
|
379
|
-
title:
|
|
462
|
+
title: U[u]
|
|
380
463
|
},
|
|
381
|
-
|
|
464
|
+
u
|
|
382
465
|
);
|
|
383
466
|
}) })
|
|
384
|
-
] },
|
|
385
|
-
const
|
|
467
|
+
] }, o.label)) }) : /* @__PURE__ */ l("div", { className: "palette-selector__options", children: Object.entries(y).map(([o, u]) => {
|
|
468
|
+
const m = D(u.colors);
|
|
386
469
|
return /* @__PURE__ */ h(
|
|
387
470
|
"button",
|
|
388
471
|
{
|
|
389
|
-
className: `palette-selector__option ${f ===
|
|
390
|
-
onClick: () => t(
|
|
472
|
+
className: `palette-selector__option ${f === o ? "palette-selector__option--active" : ""}`,
|
|
473
|
+
onClick: () => t(u.colors),
|
|
391
474
|
disabled: s,
|
|
392
475
|
children: [
|
|
393
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ l("div", { className: "palette-selector__bar", children: Y(u.colors).map((b, _) => /* @__PURE__ */ l(
|
|
394
477
|
"span",
|
|
395
478
|
{
|
|
396
479
|
className: "palette-selector__swatch",
|
|
397
480
|
style: { backgroundColor: b }
|
|
398
481
|
},
|
|
399
|
-
|
|
482
|
+
_
|
|
400
483
|
)) }),
|
|
401
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ l("div", { className: "palette-selector__bar palette-selector__bar--theme", children: W.map((b, _) => /* @__PURE__ */ l(
|
|
402
485
|
"span",
|
|
403
486
|
{
|
|
404
487
|
className: "palette-selector__swatch",
|
|
405
|
-
style: { backgroundColor:
|
|
488
|
+
style: { backgroundColor: m[b] }
|
|
406
489
|
},
|
|
407
|
-
|
|
490
|
+
_
|
|
408
491
|
)) }),
|
|
409
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ l("span", { className: "palette-selector__label", children: u.label })
|
|
410
493
|
]
|
|
411
494
|
},
|
|
412
|
-
|
|
495
|
+
o
|
|
413
496
|
);
|
|
414
497
|
}) })
|
|
415
498
|
] });
|
|
416
499
|
}
|
|
417
|
-
const
|
|
418
|
-
gridColumns:
|
|
419
|
-
gridRows:
|
|
500
|
+
const z = M, q = 30, H = 10, be = {
|
|
501
|
+
gridColumns: q,
|
|
502
|
+
gridRows: H,
|
|
420
503
|
widgets: []
|
|
421
|
-
},
|
|
504
|
+
}, _e = {
|
|
422
505
|
kpi_card: "KPI Card",
|
|
423
506
|
gauge: "Gauge",
|
|
424
507
|
chart: "Gráfico",
|
|
425
508
|
filter: "Filtro",
|
|
426
509
|
variable: "Variável",
|
|
427
510
|
color_palette: "Paleta de Cores"
|
|
428
|
-
},
|
|
511
|
+
}, Se = ["kpi_card", "gauge", "chart"], Te = ["filter", "variable", "color_palette"], De = /* @__PURE__ */ new Set(["filter", "variable", "color_palette"]), Ee = {
|
|
429
512
|
sum: "Soma",
|
|
430
513
|
avg: "Média",
|
|
431
514
|
count: "Contagem",
|
|
432
515
|
min: "Mínimo",
|
|
433
516
|
max: "Máximo",
|
|
434
517
|
count_distinct: "Contagem Distinta"
|
|
435
|
-
},
|
|
518
|
+
}, V = {
|
|
436
519
|
currency: "Moeda (R$)",
|
|
437
520
|
number: "Número",
|
|
438
521
|
integer: "Inteiro",
|
|
439
522
|
percentage: "Porcentagem",
|
|
440
523
|
date: "Data",
|
|
441
524
|
text: "Texto"
|
|
442
|
-
},
|
|
525
|
+
}, ye = Object.entries(V).filter(([e]) => e !== "date" && e !== "text"), Ne = {
|
|
443
526
|
yoy: "vs Ano Anterior",
|
|
444
527
|
mom: "vs Mês Anterior",
|
|
445
528
|
target: "vs Meta",
|
|
446
529
|
none: "Nenhuma"
|
|
447
|
-
},
|
|
530
|
+
}, we = {
|
|
448
531
|
bar: "Barras",
|
|
449
532
|
line: "Linhas",
|
|
450
533
|
area: "Área",
|
|
451
534
|
pie: "Pizza"
|
|
452
|
-
},
|
|
535
|
+
}, ve = {
|
|
453
536
|
date_range: "Periodo",
|
|
454
537
|
select: "Seleção Única",
|
|
455
538
|
multi_select: "Seleção Múltipla"
|
|
456
|
-
},
|
|
539
|
+
}, Le = {
|
|
457
540
|
kpi_card: { x: 0, y: 0, w: 6, h: 3 },
|
|
458
541
|
gauge: { x: 0, y: 0, w: 6, h: 5 },
|
|
459
542
|
chart: { x: 0, y: 0, w: 6, h: 6 },
|
|
460
543
|
filter: { x: 0, y: 0, w: 4, h: 2 },
|
|
461
544
|
variable: { x: 0, y: 0, w: 4, h: 2 },
|
|
462
545
|
color_palette: { x: 0, y: 0, w: 4, h: 2 }
|
|
463
|
-
},
|
|
546
|
+
}, Me = {
|
|
464
547
|
kpi_card: { label: "Novo KPI", aggregation: "sum", format: "number" },
|
|
465
548
|
gauge: { label: "Novo Gauge", aggregation: "sum" },
|
|
466
549
|
chart: { label: "Novo Grafico", chartType: "bar", xAxis: { column: "", granularity: "day" }, series: [] },
|
|
467
550
|
filter: { label: "Novo Filtro", filterType: "select" },
|
|
468
551
|
variable: { label: "Nova Variavel", variableValue: 0, variableFormat: "number", locked: !1 },
|
|
469
|
-
color_palette: { label: "Paleta de Cores", paletteColors:
|
|
552
|
+
color_palette: { label: "Paleta de Cores", paletteColors: z, locked: !1 }
|
|
470
553
|
};
|
|
471
554
|
export {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
he as
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
V as
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
555
|
+
Ee as A,
|
|
556
|
+
ge as B,
|
|
557
|
+
we as C,
|
|
558
|
+
Se as D,
|
|
559
|
+
be as E,
|
|
560
|
+
ve as F,
|
|
561
|
+
T as G,
|
|
562
|
+
de as H,
|
|
563
|
+
ue as I,
|
|
564
|
+
fe as J,
|
|
565
|
+
ne as K,
|
|
566
|
+
X as L,
|
|
567
|
+
re as M,
|
|
568
|
+
ye as N,
|
|
569
|
+
Z as O,
|
|
570
|
+
y as P,
|
|
571
|
+
ee as Q,
|
|
572
|
+
F as R,
|
|
573
|
+
I as S,
|
|
574
|
+
E as T,
|
|
575
|
+
_e as W,
|
|
576
|
+
Ne as a,
|
|
577
|
+
De as b,
|
|
578
|
+
Te as c,
|
|
579
|
+
he as d,
|
|
580
|
+
Me as e,
|
|
581
|
+
Le as f,
|
|
582
|
+
q as g,
|
|
583
|
+
H as h,
|
|
584
|
+
z as i,
|
|
585
|
+
M as j,
|
|
586
|
+
pe as k,
|
|
587
|
+
V as l,
|
|
588
|
+
ae as m,
|
|
589
|
+
d as n,
|
|
590
|
+
U as o,
|
|
591
|
+
me as p,
|
|
592
|
+
G as q,
|
|
593
|
+
D as r,
|
|
594
|
+
se as s,
|
|
595
|
+
x as t,
|
|
596
|
+
oe as u,
|
|
597
|
+
ie as v,
|
|
598
|
+
te as w,
|
|
599
|
+
Y as x,
|
|
600
|
+
ce as y,
|
|
601
|
+
le as z
|
|
518
602
|
};
|
|
519
|
-
//# sourceMappingURL=index-
|
|
603
|
+
//# sourceMappingURL=index-BXIn44vr.js.map
|