@selectwin/kit 0.1.218 → 0.1.220
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/SelectCarousel.d.ts +22 -0
- package/dist/SelectCarousel.js +133 -0
- package/dist/SelectColumnChart.d.ts +15 -1
- package/dist/SelectColumnChart.js +215 -187
- package/dist/SelectLocale.d.ts +12 -0
- package/dist/SelectLocale.js +22 -0
- package/dist/SelectSetupGuide.d.ts +6 -0
- package/dist/SelectSetupGuide.js +108 -92
- package/dist/SelectSparkBars.d.ts +19 -0
- package/dist/SelectSparkBars.js +98 -0
- package/dist/chartTip.d.ts +2 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +44 -41
- package/dist/index.d.ts +4 -0
- package/dist/index.js +215 -213
- package/dist/internal/chartPointer.d.ts +15 -0
- package/dist/internal/chartPointer.js +47 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export interface SelectCarouselSlide {
|
|
3
|
+
key: string;
|
|
4
|
+
/** O título do slide ("Entrega no período"): o cabeçalho dele e o nome do ponto que leva até ele. */
|
|
5
|
+
title: string;
|
|
6
|
+
/** A análise em uma frase. */
|
|
7
|
+
text: ReactNode;
|
|
8
|
+
/** Para onde a seta leva: um endereço do app (o `<Link>` do roteador). */
|
|
9
|
+
to?: string;
|
|
10
|
+
/** Ou um endereço de fora. */
|
|
11
|
+
href?: string;
|
|
12
|
+
}
|
|
13
|
+
type SelectCarouselOwnProps = {
|
|
14
|
+
slides: readonly SelectCarouselSlide[];
|
|
15
|
+
/** O nome do carrossel ("Análises do período"); padrão: "Destaques". */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** De quanto em quanto tempo passa sozinho, em ms (padrão 7000). */
|
|
18
|
+
interval?: number;
|
|
19
|
+
};
|
|
20
|
+
export type SelectCarouselProps = SelectCarouselOwnProps & Omit<ComponentPropsWithoutRef<'section'>, keyof SelectCarouselOwnProps>;
|
|
21
|
+
export declare function SelectCarousel({ slides, label, interval, className, ...rest }: SelectCarouselProps): import("react").JSX.Element | null;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { safeHref as e } from "./internal/safeHref.js";
|
|
3
|
+
import { ArrowUpRightIcon as t, ChevronLeftIcon as n, ChevronRightIcon as r, PauseIcon as i, PlayIcon as a } from "./icons.js";
|
|
4
|
+
import { formatSelectNumber as o, useSelectLocale as s, useSelectMessages as c } from "./SelectLocale.js";
|
|
5
|
+
import { useEffect as l, useRef as u, useState as d } from "react";
|
|
6
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
|
+
import { Link as m } from "react-router-dom";
|
|
8
|
+
//#region src/SelectCarousel.tsx
|
|
9
|
+
var h = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
10
|
+
function g({ slides: g, label: _, interval: v = 7e3, className: y, ...b }) {
|
|
11
|
+
let x = c().carousel, S = s(), C = g.length, [w, T] = d(0), [E, D] = d(!1), [O, k] = d(() => !h()), [A, j] = d(!1), M = u(null), N = Math.min(w, Math.max(0, C - 1)), P = O && !A && C > 1;
|
|
12
|
+
l(() => {
|
|
13
|
+
if (!P) return;
|
|
14
|
+
let e = window.setTimeout(() => {
|
|
15
|
+
D(!1), T((e) => (e + 1) % C);
|
|
16
|
+
}, v);
|
|
17
|
+
return () => window.clearTimeout(e);
|
|
18
|
+
}, [
|
|
19
|
+
P,
|
|
20
|
+
C,
|
|
21
|
+
w,
|
|
22
|
+
v
|
|
23
|
+
]);
|
|
24
|
+
let F = (e) => {
|
|
25
|
+
D(e < N), T((e % C + C) % C);
|
|
26
|
+
}, I = g[N];
|
|
27
|
+
if (!I) return null;
|
|
28
|
+
let L = e(I.to ?? I.href), R = L === void 0 ? null : I.to == null ? /* @__PURE__ */ f("a", {
|
|
29
|
+
href: L,
|
|
30
|
+
className: "select-carousel__go",
|
|
31
|
+
"aria-label": x.open(I.title),
|
|
32
|
+
children: /* @__PURE__ */ f(t, {})
|
|
33
|
+
}) : /* @__PURE__ */ f(m, {
|
|
34
|
+
to: L,
|
|
35
|
+
className: "select-carousel__go",
|
|
36
|
+
"aria-label": x.open(I.title),
|
|
37
|
+
children: /* @__PURE__ */ f(t, {})
|
|
38
|
+
});
|
|
39
|
+
return /* @__PURE__ */ p("section", {
|
|
40
|
+
...b,
|
|
41
|
+
className: `select-carousel${y ? " " + y : ""}`,
|
|
42
|
+
"aria-roledescription": x.carousel,
|
|
43
|
+
"aria-label": _ ?? x.label,
|
|
44
|
+
onMouseEnter: () => j(!0),
|
|
45
|
+
onMouseLeave: () => j(!1),
|
|
46
|
+
onFocus: () => j(!0),
|
|
47
|
+
onBlur: (e) => {
|
|
48
|
+
e.currentTarget.contains(e.relatedTarget) || j(!1);
|
|
49
|
+
},
|
|
50
|
+
onKeyDown: (e) => {
|
|
51
|
+
C < 2 || e.key !== "ArrowRight" && e.key !== "ArrowLeft" || (e.preventDefault(), F(N + (e.key === "ArrowRight" ? 1 : -1)));
|
|
52
|
+
},
|
|
53
|
+
onPointerDown: (e) => {
|
|
54
|
+
e.pointerType !== "mouse" && (M.current = e.clientX);
|
|
55
|
+
},
|
|
56
|
+
onPointerUp: (e) => {
|
|
57
|
+
if (M.current === null) return;
|
|
58
|
+
let t = e.clientX - M.current;
|
|
59
|
+
M.current = null, C > 1 && Math.abs(t) > 40 && F(N + (t < 0 ? 1 : -1));
|
|
60
|
+
},
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ f("span", {
|
|
63
|
+
className: "select-carousel__layer",
|
|
64
|
+
"aria-hidden": "true"
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ f("span", {
|
|
67
|
+
className: "select-carousel__layer select-carousel__layer--2",
|
|
68
|
+
"aria-hidden": "true"
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ p("div", {
|
|
71
|
+
className: "select-carousel__card",
|
|
72
|
+
children: [/* @__PURE__ */ f("div", {
|
|
73
|
+
className: "select-carousel__slides",
|
|
74
|
+
"aria-live": P ? "off" : "polite",
|
|
75
|
+
children: /* @__PURE__ */ p("div", {
|
|
76
|
+
className: `select-carousel__slide${E ? " is-back" : ""}`,
|
|
77
|
+
role: "group",
|
|
78
|
+
"aria-roledescription": x.slide,
|
|
79
|
+
"aria-label": x.position(o(N + 1, S), o(C, S)),
|
|
80
|
+
children: [/* @__PURE__ */ p("span", {
|
|
81
|
+
className: "select-carousel__head",
|
|
82
|
+
children: [/* @__PURE__ */ f("span", { children: I.title }), R]
|
|
83
|
+
}), /* @__PURE__ */ f("span", {
|
|
84
|
+
className: "select-carousel__text",
|
|
85
|
+
children: I.text
|
|
86
|
+
})]
|
|
87
|
+
}, I.key)
|
|
88
|
+
}), C > 1 && /* @__PURE__ */ p("div", {
|
|
89
|
+
className: "select-carousel__nav",
|
|
90
|
+
children: [/* @__PURE__ */ f("span", {
|
|
91
|
+
className: "select-carousel__dots",
|
|
92
|
+
children: g.map((e, t) => /* @__PURE__ */ f("button", {
|
|
93
|
+
type: "button",
|
|
94
|
+
className: "select-carousel__dot",
|
|
95
|
+
"aria-label": `${o(t + 1, S)}: ${e.title}`,
|
|
96
|
+
"aria-current": t === N ? "true" : void 0,
|
|
97
|
+
onClick: () => F(t)
|
|
98
|
+
}, e.key))
|
|
99
|
+
}), /* @__PURE__ */ p("span", {
|
|
100
|
+
className: "select-carousel__ctrl",
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ f("button", {
|
|
103
|
+
type: "button",
|
|
104
|
+
className: "select-carousel__btn",
|
|
105
|
+
"aria-label": x.previous,
|
|
106
|
+
onClick: () => F(N - 1),
|
|
107
|
+
children: /* @__PURE__ */ f(n, {})
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ f("button", {
|
|
110
|
+
type: "button",
|
|
111
|
+
className: "select-carousel__btn",
|
|
112
|
+
"aria-label": O ? x.pause : x.play,
|
|
113
|
+
onClick: () => k((e) => !e),
|
|
114
|
+
children: f(O ? i : a, {})
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ f("button", {
|
|
117
|
+
type: "button",
|
|
118
|
+
className: "select-carousel__btn",
|
|
119
|
+
"aria-label": x.next,
|
|
120
|
+
onClick: () => F(N + 1),
|
|
121
|
+
children: /* @__PURE__ */ f(r, {})
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
})]
|
|
125
|
+
})]
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { g as SelectCarousel };
|
|
132
|
+
|
|
133
|
+
//# sourceMappingURL=SelectCarousel.js.map
|
|
@@ -3,10 +3,12 @@ import { SelectChartSeries } from './chartUtils';
|
|
|
3
3
|
/** What the hover card shows for one slot (see `tooltip`). */
|
|
4
4
|
export interface SelectColumnTooltip {
|
|
5
5
|
title?: ReactNode;
|
|
6
|
+
/** `total` (0.1.219): a linha da soma, sem o ponto da cor e com o fio acima. */
|
|
6
7
|
rows: {
|
|
7
8
|
label: ReactNode;
|
|
8
9
|
value: ReactNode;
|
|
9
10
|
color?: string;
|
|
11
|
+
total?: boolean;
|
|
10
12
|
}[];
|
|
11
13
|
}
|
|
12
14
|
type SelectColumnChartOwnProps = {
|
|
@@ -36,7 +38,19 @@ type SelectColumnChartOwnProps = {
|
|
|
36
38
|
average?: boolean | {
|
|
37
39
|
label?: string;
|
|
38
40
|
};
|
|
41
|
+
/** 0.1.219: o nome do gráfico ("Mensagens por dia, por canal"). Com ele, o gráfico entra no Tab e anda pelas setas. */
|
|
42
|
+
label?: string;
|
|
43
|
+
/** 0.1.219: o ponto que o foco do teclado acende primeiro (padrão: o último, o mais recente). */
|
|
44
|
+
start?: number;
|
|
45
|
+
/** 0.1.219: o nome inteiro de cada ponto ("24/10, 14h–15h"), na dica e na tabela; o eixo segue com `labels`. */
|
|
46
|
+
titles?: string[];
|
|
47
|
+
/** 0.1.219: os números da dica e da tabela ("1.204"); o eixo segue com `format` ("1,2 mil"). Padrão: `format`. */
|
|
48
|
+
formatValue?: (n: number) => string;
|
|
49
|
+
/** 0.1.219: a linha da soma na dica padrão, com este rótulo ("no total"). */
|
|
50
|
+
total?: string;
|
|
51
|
+
/** 0.1.219: com `label`, a tabela escondida com todos os números; o texto é o cabeçalho da 1ª coluna ("Dia"). */
|
|
52
|
+
table?: string;
|
|
39
53
|
};
|
|
40
54
|
export type SelectColumnChartProps = SelectColumnChartOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectColumnChartOwnProps>;
|
|
41
|
-
export declare function SelectColumnChart({ series, labels, height, format, stacked, marker, tooltip, compare, average, className, ...rest }: SelectColumnChartProps): import("react").JSX.Element;
|
|
55
|
+
export declare function SelectColumnChart({ series, labels, height, format, stacked, marker, tooltip, compare, average, label, start, titles, formatValue, total, table, className, ...rest }: SelectColumnChartProps): import("react").JSX.Element;
|
|
42
56
|
export {};
|
|
@@ -1,222 +1,250 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { CHART_PAD as e, chartColor as t, formatCompact as n, niceTicks as r, useChartSize as i, yAxisPad as a } from "./chartUtils.js";
|
|
3
|
-
import { ChartTooltip as o
|
|
4
|
-
import {
|
|
3
|
+
import { ChartTooltip as o } from "./chartTip.js";
|
|
4
|
+
import { tipSpeech as ee, useChartPointer as te } from "./internal/chartPointer.js";
|
|
5
|
+
import { useId as ne } from "react";
|
|
5
6
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
7
|
//#region src/SelectColumnChart.tsx
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
var
|
|
10
|
-
let { ref:
|
|
8
|
+
var re = 6.4, ie = 12, ae = .45, l = 3;
|
|
9
|
+
function u({ series: u, labels: d, height: f = 240, format: p = n, stacked: m = !1, marker: h, tooltip: g, compare: _, average: v, label: y, start: oe, titles: b, formatValue: x = p, total: S, table: C, className: w, ...se }) {
|
|
10
|
+
var T;
|
|
11
|
+
let { ref: E, width: D } = i(f), O = ne(), k = d.length, A = u.length || 1, j = d.map((e, t) => u.reduce((e, n) => e + (n.data[t] ?? 0), 0)), M = _ ? d.map((e, t) => _.data[t] ?? 0) : [], ce = Math.max(0, ...m ? j : u.flatMap((e) => e.data), ...M), { max: N, values: P } = r(ce, 4), F = {
|
|
11
12
|
...e,
|
|
12
|
-
left: a(
|
|
13
|
-
},
|
|
13
|
+
left: a(P.map(p), E.current)
|
|
14
|
+
}, I = Math.max(0, D - F.left - F.right), L = f - F.top - F.bottom, R = F.top + L, z = k ? I / k : 0, B = (e) => R - e / N * L, V = _ ? 1.45 : 1, le = Math.min(z * .72, A * 40 * V), H = Math.min(z * (_ ? .62 : .5) / V, 44), U = m ? H : le / V / A, W = _ ? (m ? H : U * A) * ae : 0, G = Math.min(30, 600 / Math.max(1, k)), K = (e, t) => e.pattern === "hatch" ? `url(#${O}-p${t})` : `url(#${O}-c${t})`, q = (e) => e.edge ? {
|
|
14
15
|
stroke: e.edge,
|
|
15
16
|
strokeWidth: 1
|
|
16
|
-
} : {},
|
|
17
|
-
if (
|
|
18
|
-
let t =
|
|
17
|
+
} : {}, J = h && k > 0 ? Math.min(k - 1, Math.max(0, h.index)) : null, ue = d.reduce((e, t) => Math.max(e, t.length), 0), Y = z > 0 ? Math.max(1, Math.ceil((ue * re + ie) / z)) : 1, de = J ?? 0, fe = (e) => Y === 1 || ((e - de) % Y + Y) % Y === 0, X = m ? j : ((T = u[0]) == null ? void 0 : T.data) ?? [], Z = v && X.length > 0 ? X.reduce((e, t) => e + (t ?? 0), 0) / X.length : null, pe = typeof v == "object" && v.label ? v.label : "Média", me = (e, n) => {
|
|
18
|
+
if (g) {
|
|
19
|
+
let t = g(e);
|
|
19
20
|
return t ? {
|
|
20
21
|
title: t.title ?? n,
|
|
21
22
|
rows: t.rows
|
|
22
23
|
} : null;
|
|
23
24
|
}
|
|
24
|
-
let r =
|
|
25
|
+
let r = u.map((n, r) => ({
|
|
25
26
|
label: n.name,
|
|
26
|
-
value:
|
|
27
|
+
value: x(n.data[e] ?? 0),
|
|
27
28
|
color: n.color ?? t(r)
|
|
28
29
|
}));
|
|
29
|
-
return
|
|
30
|
-
label:
|
|
31
|
-
value:
|
|
30
|
+
return _ && r.push({
|
|
31
|
+
label: _.name,
|
|
32
|
+
value: x(M[e] ?? 0),
|
|
32
33
|
color: "var(--select-chart-compare)"
|
|
34
|
+
}), S != null && r.push({
|
|
35
|
+
label: S,
|
|
36
|
+
value: x(j[e] ?? 0),
|
|
37
|
+
total: !0
|
|
33
38
|
}), {
|
|
34
39
|
title: n,
|
|
35
40
|
rows: r
|
|
36
41
|
};
|
|
37
|
-
},
|
|
42
|
+
}, { active: Q, props: he } = te({
|
|
43
|
+
count: k,
|
|
44
|
+
indexAt: (e) => z > 0 && e >= F.left ? Math.min(k - 1, Math.floor((e - F.left) / z)) : null,
|
|
45
|
+
start: oe,
|
|
46
|
+
focusable: y != null
|
|
47
|
+
}), ge = (e) => {
|
|
48
|
+
let t = m ? B(j[e] ?? 0) : Math.min(...u.map((t) => B(t.data[e] ?? 0)));
|
|
49
|
+
return _ ? Math.min(t, B(M[e] ?? 0)) : t;
|
|
50
|
+
}, $ = Q == null ? null : me(Q, (b == null ? void 0 : b[Q]) ?? d[Q] ?? ""), _e = (e) => `select-chart__slot${Q != null && Q !== e ? " select-chart__slot--dim" : ""}`;
|
|
38
51
|
return /* @__PURE__ */ c("div", {
|
|
39
|
-
...
|
|
40
|
-
className: `select-chart-wrap${
|
|
41
|
-
ref:
|
|
42
|
-
children: [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
...se,
|
|
53
|
+
className: `select-chart-wrap${w ? " " + w : ""}`,
|
|
54
|
+
ref: E,
|
|
55
|
+
children: [
|
|
56
|
+
D > 0 && /* @__PURE__ */ c("svg", {
|
|
57
|
+
width: D,
|
|
58
|
+
height: f,
|
|
59
|
+
className: "select-chart",
|
|
60
|
+
...y == null ? {} : {
|
|
61
|
+
role: "img",
|
|
62
|
+
"aria-label": y
|
|
63
|
+
},
|
|
64
|
+
...he,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ s("defs", { children: u.map((e, n) => {
|
|
67
|
+
let r = e.color ?? t(n);
|
|
68
|
+
return e.pattern === "hatch" ? /* @__PURE__ */ c("pattern", {
|
|
69
|
+
id: `${O}-p${n}`,
|
|
56
70
|
width: 6,
|
|
57
71
|
height: 6,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
72
|
+
patternUnits: "userSpaceOnUse",
|
|
73
|
+
patternTransform: "rotate(45)",
|
|
74
|
+
children: [/* @__PURE__ */ s("rect", {
|
|
75
|
+
width: 6,
|
|
76
|
+
height: 6,
|
|
77
|
+
fill: r,
|
|
78
|
+
fillOpacity: .16
|
|
79
|
+
}), /* @__PURE__ */ s("line", {
|
|
80
|
+
x1: 0,
|
|
81
|
+
y1: 0,
|
|
82
|
+
x2: 0,
|
|
83
|
+
y2: 6,
|
|
84
|
+
stroke: r,
|
|
85
|
+
strokeWidth: 2.5
|
|
86
|
+
})]
|
|
87
|
+
}, n) : /* @__PURE__ */ c("linearGradient", {
|
|
88
|
+
id: `${O}-c${n}`,
|
|
89
|
+
x1: "0",
|
|
90
|
+
y1: "0",
|
|
91
|
+
x2: "0",
|
|
92
|
+
y2: "1",
|
|
93
|
+
children: [/* @__PURE__ */ s("stop", {
|
|
94
|
+
offset: "0%",
|
|
95
|
+
stopColor: r,
|
|
96
|
+
stopOpacity: 1
|
|
97
|
+
}), /* @__PURE__ */ s("stop", {
|
|
98
|
+
offset: "100%",
|
|
99
|
+
stopColor: r,
|
|
100
|
+
stopOpacity: .62
|
|
101
|
+
})]
|
|
102
|
+
}, n);
|
|
103
|
+
}) }),
|
|
104
|
+
P.map((e, t) => /* @__PURE__ */ c("g", { children: [/* @__PURE__ */ s("line", {
|
|
105
|
+
x1: F.left,
|
|
106
|
+
x2: D - F.right,
|
|
107
|
+
y1: B(e),
|
|
108
|
+
y2: B(e),
|
|
109
|
+
className: t === 0 ? "select-chart__axis" : "select-chart__grid"
|
|
110
|
+
}), /* @__PURE__ */ s("text", {
|
|
111
|
+
x: F.left - 8,
|
|
112
|
+
y: B(e),
|
|
113
|
+
className: "select-chart__ylabel",
|
|
114
|
+
dominantBaseline: "middle",
|
|
115
|
+
textAnchor: "end",
|
|
116
|
+
children: p(e)
|
|
117
|
+
})] }, t)),
|
|
118
|
+
d.map((e, t) => {
|
|
119
|
+
let n = F.left + z * t, r = (m ? U : U * A) + (_ ? W + l : 0), i = n + z / 2 - r / 2, a = i + (_ ? W + l : 0), o = _ ? /* @__PURE__ */ s("rect", {
|
|
120
|
+
x: i,
|
|
121
|
+
y: B(M[t] ?? 0),
|
|
122
|
+
width: W,
|
|
123
|
+
height: Math.max(0, R - B(M[t] ?? 0)),
|
|
124
|
+
rx: Math.min(3, W / 2),
|
|
125
|
+
className: "select-chart__compare",
|
|
126
|
+
style: { animationDelay: `${Math.round(t * G)}ms` }
|
|
127
|
+
}) : null;
|
|
128
|
+
if (m) {
|
|
129
|
+
let e = 0;
|
|
130
|
+
return /* @__PURE__ */ c("g", {
|
|
131
|
+
className: _e(t),
|
|
132
|
+
children: [o, u.map((n, r) => {
|
|
133
|
+
let i = (n.data[t] ?? 0) / N * L, o = R - e - i;
|
|
134
|
+
return e += i, i <= 0 ? null : /* @__PURE__ */ s("rect", {
|
|
135
|
+
x: a,
|
|
136
|
+
y: o,
|
|
137
|
+
width: U,
|
|
138
|
+
height: i,
|
|
139
|
+
rx: Math.min(3, U / 2),
|
|
140
|
+
fill: K(n, r),
|
|
141
|
+
...q(n),
|
|
142
|
+
className: "select-chart__bar",
|
|
143
|
+
style: { animationDelay: `${Math.round(t * G)}ms` }
|
|
144
|
+
}, r);
|
|
145
|
+
})]
|
|
146
|
+
}, t);
|
|
147
|
+
}
|
|
111
148
|
return /* @__PURE__ */ c("g", {
|
|
112
|
-
className:
|
|
113
|
-
children: [o,
|
|
114
|
-
let
|
|
115
|
-
return
|
|
116
|
-
x: a,
|
|
117
|
-
y:
|
|
118
|
-
width:
|
|
119
|
-
height:
|
|
120
|
-
rx:
|
|
121
|
-
fill:
|
|
122
|
-
...
|
|
149
|
+
className: _e(t),
|
|
150
|
+
children: [o, u.map((e, n) => {
|
|
151
|
+
let r = (e.data[t] ?? 0) / N * L;
|
|
152
|
+
return /* @__PURE__ */ s("rect", {
|
|
153
|
+
x: a + n * U + U * .1,
|
|
154
|
+
y: R - r,
|
|
155
|
+
width: U * .8,
|
|
156
|
+
height: Math.max(0, r),
|
|
157
|
+
rx: 3,
|
|
158
|
+
fill: K(e, n),
|
|
159
|
+
...q(e),
|
|
123
160
|
className: "select-chart__bar",
|
|
124
|
-
style: { animationDelay: `${Math.round(t *
|
|
125
|
-
},
|
|
161
|
+
style: { animationDelay: `${Math.round((t + n / A) * G)}ms` }
|
|
162
|
+
}, n);
|
|
126
163
|
})]
|
|
127
164
|
}, t);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
className: $(t),
|
|
131
|
-
children: [o, f.map((e, n) => {
|
|
132
|
-
let r = (e.data[t] ?? 0) / P * R;
|
|
133
|
-
return /* @__PURE__ */ s("rect", {
|
|
134
|
-
x: a + n * W + W * .1,
|
|
135
|
-
y: z - r,
|
|
136
|
-
width: W * .8,
|
|
137
|
-
height: Math.max(0, r),
|
|
138
|
-
rx: 3,
|
|
139
|
-
fill: q(e, n),
|
|
140
|
-
...J(e),
|
|
141
|
-
className: "select-chart__bar",
|
|
142
|
-
style: { animationDelay: `${Math.round((t + n / j) * K)}ms` }
|
|
143
|
-
}, n);
|
|
144
|
-
})]
|
|
145
|
-
}, t);
|
|
146
|
-
}),
|
|
147
|
-
Q != null && Q > 0 && /* @__PURE__ */ c("g", {
|
|
148
|
-
pointerEvents: "none",
|
|
149
|
-
children: [/* @__PURE__ */ s("line", {
|
|
150
|
-
x1: I.left,
|
|
151
|
-
x2: T - I.right,
|
|
152
|
-
y1: V(Q),
|
|
153
|
-
y2: V(Q),
|
|
154
|
-
className: "select-chart__avg"
|
|
155
|
-
}), /* @__PURE__ */ s("text", {
|
|
156
|
-
x: I.left + 6,
|
|
157
|
-
y: V(Q) - 6,
|
|
158
|
-
className: "select-chart__avglabel",
|
|
159
|
-
children: `${le} ${h(Q)}`
|
|
160
|
-
})]
|
|
161
|
-
}),
|
|
162
|
-
_ && Y != null && (() => {
|
|
163
|
-
let e = I.left + B * Y + (_.edge === "end" ? B : B / 2), t = e > T - I.right - 44;
|
|
164
|
-
return /* @__PURE__ */ c("g", {
|
|
165
|
-
className: "select-chart__marker",
|
|
165
|
+
}),
|
|
166
|
+
Z != null && Z > 0 && /* @__PURE__ */ c("g", {
|
|
166
167
|
pointerEvents: "none",
|
|
167
168
|
children: [/* @__PURE__ */ s("line", {
|
|
168
|
-
x1:
|
|
169
|
-
x2:
|
|
170
|
-
y1:
|
|
171
|
-
y2:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
169
|
+
x1: F.left,
|
|
170
|
+
x2: D - F.right,
|
|
171
|
+
y1: B(Z),
|
|
172
|
+
y2: B(Z),
|
|
173
|
+
className: "select-chart__avg"
|
|
174
|
+
}), /* @__PURE__ */ s("text", {
|
|
175
|
+
x: F.left + 6,
|
|
176
|
+
y: B(Z) - 6,
|
|
177
|
+
className: "select-chart__avglabel",
|
|
178
|
+
children: `${pe} ${p(Z)}`
|
|
177
179
|
})]
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
180
|
+
}),
|
|
181
|
+
h && J != null && (() => {
|
|
182
|
+
let e = F.left + z * J + (h.edge === "end" ? z : z / 2), t = e > D - F.right - 44;
|
|
183
|
+
return /* @__PURE__ */ c("g", {
|
|
184
|
+
className: "select-chart__marker",
|
|
185
|
+
pointerEvents: "none",
|
|
186
|
+
children: [/* @__PURE__ */ s("line", {
|
|
187
|
+
x1: e,
|
|
188
|
+
x2: e,
|
|
189
|
+
y1: F.top - 4,
|
|
190
|
+
y2: R
|
|
191
|
+
}), h.label && /* @__PURE__ */ s("text", {
|
|
192
|
+
x: t ? e - 6 : e + 6,
|
|
193
|
+
y: F.top + 6,
|
|
194
|
+
textAnchor: t ? "end" : "start",
|
|
195
|
+
children: h.label
|
|
196
|
+
})]
|
|
197
|
+
});
|
|
198
|
+
})(),
|
|
199
|
+
d.map((e, t) => fe(t) ? /* @__PURE__ */ s("text", {
|
|
200
|
+
x: F.left + z * t + z / 2,
|
|
201
|
+
y: f - F.bottom + 16,
|
|
202
|
+
className: "select-chart__xlabel",
|
|
203
|
+
textAnchor: "middle",
|
|
204
|
+
children: e
|
|
205
|
+
}, t) : null),
|
|
206
|
+
/* @__PURE__ */ s("rect", {
|
|
207
|
+
x: F.left,
|
|
208
|
+
y: F.top,
|
|
209
|
+
width: I,
|
|
210
|
+
height: L,
|
|
211
|
+
fill: "transparent"
|
|
212
|
+
})
|
|
213
|
+
]
|
|
214
|
+
}),
|
|
215
|
+
/* @__PURE__ */ s(o, { tip: $ && Q != null ? {
|
|
216
|
+
x: F.left + z * Q + z / 2,
|
|
217
|
+
y: ge(Q),
|
|
218
|
+
place: ge(Q) < F.top + 52 ? "bottom" : "top",
|
|
219
|
+
title: $.title,
|
|
220
|
+
rows: $.rows
|
|
221
|
+
} : null }),
|
|
222
|
+
y != null && /* @__PURE__ */ s("span", {
|
|
223
|
+
className: "select-visually-hidden",
|
|
224
|
+
"aria-live": "polite",
|
|
225
|
+
children: $ ? ee($.title, $.rows) : ""
|
|
226
|
+
}),
|
|
227
|
+
y != null && C != null && /* @__PURE__ */ c("table", {
|
|
228
|
+
className: "select-visually-hidden",
|
|
229
|
+
children: [
|
|
230
|
+
/* @__PURE__ */ s("caption", { children: y }),
|
|
231
|
+
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ c("tr", { children: [/* @__PURE__ */ s("th", {
|
|
232
|
+
scope: "col",
|
|
233
|
+
children: C
|
|
234
|
+
}), u.map((e, t) => /* @__PURE__ */ s("th", {
|
|
235
|
+
scope: "col",
|
|
236
|
+
children: e.name
|
|
237
|
+
}, t))] }) }),
|
|
238
|
+
/* @__PURE__ */ s("tbody", { children: d.map((e, t) => /* @__PURE__ */ c("tr", { children: [/* @__PURE__ */ s("th", {
|
|
239
|
+
scope: "row",
|
|
240
|
+
children: (b == null ? void 0 : b[t]) ?? e
|
|
241
|
+
}), u.map((e, n) => /* @__PURE__ */ s("td", { children: x(e.data[t] ?? 0) }, n))] }, t)) })
|
|
242
|
+
]
|
|
243
|
+
})
|
|
244
|
+
]
|
|
217
245
|
});
|
|
218
246
|
}
|
|
219
247
|
//#endregion
|
|
220
|
-
export {
|
|
248
|
+
export { u as SelectColumnChart };
|
|
221
249
|
|
|
222
250
|
//# sourceMappingURL=SelectColumnChart.js.map
|
package/dist/SelectLocale.d.ts
CHANGED
|
@@ -84,6 +84,18 @@ export interface SelectKitMessages {
|
|
|
84
84
|
sideNav: {
|
|
85
85
|
pending: (hint: string) => string;
|
|
86
86
|
};
|
|
87
|
+
/** 0.1.220: o SelectCarousel — o nome, o papel, a posição e os botões. */
|
|
88
|
+
carousel: {
|
|
89
|
+
label: string;
|
|
90
|
+
carousel: string;
|
|
91
|
+
slide: string;
|
|
92
|
+
position: (at: string, count: string) => string;
|
|
93
|
+
previous: string;
|
|
94
|
+
next: string;
|
|
95
|
+
pause: string;
|
|
96
|
+
play: string;
|
|
97
|
+
open: (title: string) => string;
|
|
98
|
+
};
|
|
87
99
|
/** 0.1.201: o SelectFeeBreakdown — os rótulos de sempre e a legenda da barra. */
|
|
88
100
|
fees: {
|
|
89
101
|
gross: string;
|