@selectwin/kit 0.1.217 → 0.1.219
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/SelectChartTipRows.d.ts +13 -0
- package/dist/SelectChartTipRows.js +31 -0
- package/dist/SelectColumnChart.d.ts +15 -1
- package/dist/SelectColumnChart.js +215 -187
- package/dist/SelectGauge.d.ts +8 -1
- package/dist/SelectGauge.js +47 -37
- package/dist/SelectShareBar.d.ts +8 -1
- package/dist/SelectShareBar.js +99 -60
- package/dist/SelectSparkBars.d.ts +19 -0
- package/dist/SelectSparkBars.js +98 -0
- package/dist/SelectTooltip.d.ts +6 -1
- package/dist/SelectTooltip.js +37 -37
- package/dist/chartTip.d.ts +2 -0
- package/dist/chartTip.js +29 -44
- package/dist/index.d.ts +4 -0
- package/dist/index.js +91 -89
- package/dist/internal/chartPointer.d.ts +15 -0
- package/dist/internal/chartPointer.js +47 -0
- package/dist/style.css +1 -1
- package/package.json +67 -67
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SelectChartTipRow {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
value: ReactNode;
|
|
5
|
+
/** A cor da série ou da parte (o ponto à esquerda). */
|
|
6
|
+
color?: string;
|
|
7
|
+
/** A linha da soma: sem o ponto, com o espaço dele. */
|
|
8
|
+
total?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function SelectChartTipRows({ title, rows }: {
|
|
11
|
+
title?: ReactNode;
|
|
12
|
+
rows: readonly SelectChartTipRow[];
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/SelectChartTipRows.tsx
|
|
4
|
+
function r({ title: r, rows: i }) {
|
|
5
|
+
let a = i.some((e) => e.color != null);
|
|
6
|
+
return /* @__PURE__ */ n(e, { children: [r != null && /* @__PURE__ */ t("span", {
|
|
7
|
+
className: "select-chart__tiptitle",
|
|
8
|
+
children: r
|
|
9
|
+
}), i.map((e, r) => /* @__PURE__ */ n("span", {
|
|
10
|
+
className: `select-chart__tiprow${e.total ? " select-chart__tiprow--total" : ""}`,
|
|
11
|
+
children: [
|
|
12
|
+
a && /* @__PURE__ */ t("span", {
|
|
13
|
+
className: "select-chart__tipdot",
|
|
14
|
+
style: e.color != null && !e.total ? { background: e.color } : { visibility: "hidden" },
|
|
15
|
+
"aria-hidden": "true"
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ t("span", {
|
|
18
|
+
className: "select-chart__tiplabel",
|
|
19
|
+
children: e.label
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ t("span", {
|
|
22
|
+
className: "select-chart__tipval",
|
|
23
|
+
children: e.value
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
}, r))] });
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { r as SelectChartTipRows };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=SelectChartTipRows.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/SelectGauge.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
type SelectGaugeOwnProps = {
|
|
3
3
|
/** Percentage 0–100 (drives the arc sweep). */
|
|
4
4
|
value: number;
|
|
@@ -12,6 +12,13 @@ type SelectGaugeOwnProps = {
|
|
|
12
12
|
color?: string;
|
|
13
13
|
/** Format the center number (default "NN%"). */
|
|
14
14
|
format?: (n: number) => string;
|
|
15
|
+
/**
|
|
16
|
+
* 0.1.218: os números por trás da proporção ("1.204 entregues · 3 a caminho"), numa dica que abre no mouse, no foco do
|
|
17
|
+
* teclado (o medidor entra na ordem do Tab) e no toque, e fecha no Esc. Para quem lê tela, é a descrição do medidor.
|
|
18
|
+
*/
|
|
19
|
+
tip?: ReactNode;
|
|
20
|
+
/** 0.1.218: o nome do medidor para o leitor de tela ("98% entregues"); padrão: o número e o `label`. */
|
|
21
|
+
ariaLabel?: string;
|
|
15
22
|
};
|
|
16
23
|
export type SelectGaugeProps = SelectGaugeOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectGaugeOwnProps>;
|
|
17
24
|
export declare const SelectGauge: import('react').ForwardRefExoticComponent<SelectGaugeOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectGaugeOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
|