@selectwin/kit 0.1.228 → 0.1.230
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 +6 -1
- package/dist/SelectCarousel.js +46 -46
- package/dist/SelectConfirmModal.js +27 -30
- package/dist/SelectDonut.d.ts +14 -1
- package/dist/SelectDonut.js +119 -75
- package/dist/SelectFormModal.d.ts +3 -1
- package/dist/SelectFormModal.js +35 -37
- package/dist/SelectKpiBand.d.ts +2 -0
- package/dist/SelectKpiBand.js +8 -8
- package/dist/SelectLocale.d.ts +4 -0
- package/dist/SelectLocale.js +2 -0
- package/dist/SelectModal.d.ts +14 -1
- package/dist/SelectModal.js +110 -100
- package/dist/SelectSetupGuide.d.ts +5 -0
- package/dist/SelectSetupGuide.js +83 -72
- package/dist/index.d.ts +1 -1
- package/dist/index.js +130 -130
- package/dist/style.css +1 -1
- package/package.json +67 -67
package/dist/SelectCarousel.d.ts
CHANGED
|
@@ -16,7 +16,12 @@ type SelectCarouselOwnProps = {
|
|
|
16
16
|
label?: string;
|
|
17
17
|
/** De quanto em quanto tempo passa sozinho, em ms (padrão 7000). */
|
|
18
18
|
interval?: number;
|
|
19
|
+
/**
|
|
20
|
+
* 0.1.230: o carrossel ocupa a largura de quem o contém (a coluna de uma grade), sem o teto de 20rem do destaque do
|
|
21
|
+
* cabeçalho.
|
|
22
|
+
*/
|
|
23
|
+
fluid?: boolean;
|
|
19
24
|
};
|
|
20
25
|
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;
|
|
26
|
+
export declare function SelectCarousel({ slides, label, interval, fluid, className, ...rest }: SelectCarouselProps): import("react").JSX.Element | null;
|
|
22
27
|
export {};
|
package/dist/SelectCarousel.js
CHANGED
|
@@ -7,56 +7,56 @@ import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
|
7
7
|
import { Link as m } from "react-router-dom";
|
|
8
8
|
//#region src/SelectCarousel.tsx
|
|
9
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,
|
|
11
|
-
let
|
|
10
|
+
function g({ slides: g, label: _, interval: v = 7e3, fluid: y = !1, className: b, ...x }) {
|
|
11
|
+
let S = c().carousel, C = s(), w = g.length, [T, E] = d(0), [D, O] = d(!1), [k, A] = d(() => !h()), [j, M] = d(!1), N = u(null), P = Math.min(T, Math.max(0, w - 1)), F = k && !j && w > 1;
|
|
12
12
|
l(() => {
|
|
13
|
-
if (!
|
|
13
|
+
if (!F) return;
|
|
14
14
|
let e = window.setTimeout(() => {
|
|
15
|
-
|
|
15
|
+
O(!1), E((e) => (e + 1) % w);
|
|
16
16
|
}, v);
|
|
17
17
|
return () => window.clearTimeout(e);
|
|
18
18
|
}, [
|
|
19
|
-
|
|
20
|
-
C,
|
|
19
|
+
F,
|
|
21
20
|
w,
|
|
21
|
+
T,
|
|
22
22
|
v
|
|
23
23
|
]);
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
if (!
|
|
28
|
-
let
|
|
29
|
-
href:
|
|
24
|
+
let I = (e) => {
|
|
25
|
+
O(e < P), E((e % w + w) % w);
|
|
26
|
+
}, L = g[P];
|
|
27
|
+
if (!L) return null;
|
|
28
|
+
let R = e(L.to ?? L.href), z = R === void 0 ? null : L.to == null ? /* @__PURE__ */ f("a", {
|
|
29
|
+
href: R,
|
|
30
30
|
className: "select-carousel__go",
|
|
31
|
-
"aria-label":
|
|
31
|
+
"aria-label": S.open(L.title),
|
|
32
32
|
children: /* @__PURE__ */ f(t, {})
|
|
33
33
|
}) : /* @__PURE__ */ f(m, {
|
|
34
|
-
to:
|
|
34
|
+
to: R,
|
|
35
35
|
className: "select-carousel__go",
|
|
36
|
-
"aria-label":
|
|
36
|
+
"aria-label": S.open(L.title),
|
|
37
37
|
children: /* @__PURE__ */ f(t, {})
|
|
38
38
|
});
|
|
39
39
|
return /* @__PURE__ */ p("section", {
|
|
40
|
-
...
|
|
41
|
-
className: `select-carousel${y ? " " +
|
|
42
|
-
"aria-roledescription":
|
|
43
|
-
"aria-label": _ ??
|
|
44
|
-
onMouseEnter: () =>
|
|
45
|
-
onMouseLeave: () =>
|
|
46
|
-
onFocus: () =>
|
|
40
|
+
...x,
|
|
41
|
+
className: `select-carousel${y ? " select-carousel--fluid" : ""}${b ? " " + b : ""}`,
|
|
42
|
+
"aria-roledescription": S.carousel,
|
|
43
|
+
"aria-label": _ ?? S.label,
|
|
44
|
+
onMouseEnter: () => M(!0),
|
|
45
|
+
onMouseLeave: () => M(!1),
|
|
46
|
+
onFocus: () => M(!0),
|
|
47
47
|
onBlur: (e) => {
|
|
48
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
48
|
+
e.currentTarget.contains(e.relatedTarget) || M(!1);
|
|
49
49
|
},
|
|
50
50
|
onKeyDown: (e) => {
|
|
51
|
-
|
|
51
|
+
w < 2 || e.key !== "ArrowRight" && e.key !== "ArrowLeft" || (e.preventDefault(), I(P + (e.key === "ArrowRight" ? 1 : -1)));
|
|
52
52
|
},
|
|
53
53
|
onPointerDown: (e) => {
|
|
54
|
-
e.pointerType !== "mouse" && (
|
|
54
|
+
e.pointerType !== "mouse" && (N.current = e.clientX);
|
|
55
55
|
},
|
|
56
56
|
onPointerUp: (e) => {
|
|
57
|
-
if (
|
|
58
|
-
let t = e.clientX -
|
|
59
|
-
|
|
57
|
+
if (N.current === null) return;
|
|
58
|
+
let t = e.clientX - N.current;
|
|
59
|
+
N.current = null, w > 1 && Math.abs(t) > 40 && I(P + (t < 0 ? 1 : -1));
|
|
60
60
|
},
|
|
61
61
|
children: [
|
|
62
62
|
/* @__PURE__ */ f("span", {
|
|
@@ -71,30 +71,30 @@ function g({ slides: g, label: _, interval: v = 7e3, className: y, ...b }) {
|
|
|
71
71
|
className: "select-carousel__card",
|
|
72
72
|
children: [/* @__PURE__ */ f("div", {
|
|
73
73
|
className: "select-carousel__slides",
|
|
74
|
-
"aria-live":
|
|
74
|
+
"aria-live": F ? "off" : "polite",
|
|
75
75
|
children: /* @__PURE__ */ p("div", {
|
|
76
|
-
className: `select-carousel__slide${
|
|
76
|
+
className: `select-carousel__slide${D ? " is-back" : ""}`,
|
|
77
77
|
role: "group",
|
|
78
|
-
"aria-roledescription":
|
|
79
|
-
"aria-label":
|
|
78
|
+
"aria-roledescription": S.slide,
|
|
79
|
+
"aria-label": S.position(o(P + 1, C), o(w, C)),
|
|
80
80
|
children: [/* @__PURE__ */ p("span", {
|
|
81
81
|
className: "select-carousel__head",
|
|
82
|
-
children: [/* @__PURE__ */ f("span", { children:
|
|
82
|
+
children: [/* @__PURE__ */ f("span", { children: L.title }), z]
|
|
83
83
|
}), /* @__PURE__ */ f("span", {
|
|
84
84
|
className: "select-carousel__text",
|
|
85
|
-
children:
|
|
85
|
+
children: L.text
|
|
86
86
|
})]
|
|
87
|
-
},
|
|
88
|
-
}),
|
|
87
|
+
}, L.key)
|
|
88
|
+
}), w > 1 && /* @__PURE__ */ p("div", {
|
|
89
89
|
className: "select-carousel__nav",
|
|
90
90
|
children: [/* @__PURE__ */ f("span", {
|
|
91
91
|
className: "select-carousel__dots",
|
|
92
92
|
children: g.map((e, t) => /* @__PURE__ */ f("button", {
|
|
93
93
|
type: "button",
|
|
94
94
|
className: "select-carousel__dot",
|
|
95
|
-
"aria-label": `${o(t + 1,
|
|
96
|
-
"aria-current": t ===
|
|
97
|
-
onClick: () =>
|
|
95
|
+
"aria-label": `${o(t + 1, C)}: ${e.title}`,
|
|
96
|
+
"aria-current": t === P ? "true" : void 0,
|
|
97
|
+
onClick: () => I(t)
|
|
98
98
|
}, e.key))
|
|
99
99
|
}), /* @__PURE__ */ p("span", {
|
|
100
100
|
className: "select-carousel__ctrl",
|
|
@@ -102,22 +102,22 @@ function g({ slides: g, label: _, interval: v = 7e3, className: y, ...b }) {
|
|
|
102
102
|
/* @__PURE__ */ f("button", {
|
|
103
103
|
type: "button",
|
|
104
104
|
className: "select-carousel__btn",
|
|
105
|
-
"aria-label":
|
|
106
|
-
onClick: () =>
|
|
105
|
+
"aria-label": S.previous,
|
|
106
|
+
onClick: () => I(P - 1),
|
|
107
107
|
children: /* @__PURE__ */ f(n, {})
|
|
108
108
|
}),
|
|
109
109
|
/* @__PURE__ */ f("button", {
|
|
110
110
|
type: "button",
|
|
111
111
|
className: "select-carousel__btn",
|
|
112
|
-
"aria-label":
|
|
113
|
-
onClick: () =>
|
|
114
|
-
children: f(
|
|
112
|
+
"aria-label": k ? S.pause : S.play,
|
|
113
|
+
onClick: () => A((e) => !e),
|
|
114
|
+
children: f(k ? i : a, {})
|
|
115
115
|
}),
|
|
116
116
|
/* @__PURE__ */ f("button", {
|
|
117
117
|
type: "button",
|
|
118
118
|
className: "select-carousel__btn",
|
|
119
|
-
"aria-label":
|
|
120
|
-
onClick: () =>
|
|
119
|
+
"aria-label": S.next,
|
|
120
|
+
onClick: () => I(P + 1),
|
|
121
121
|
children: /* @__PURE__ */ f(r, {})
|
|
122
122
|
})
|
|
123
123
|
]
|
|
@@ -1,42 +1,39 @@
|
|
|
1
1
|
import { SelectButton as e } from "./SelectButton.js";
|
|
2
2
|
import { useSelectMessages as t } from "./SelectLocale.js";
|
|
3
3
|
import { detectSelectTheme as n } from "./detectSelectTheme.js";
|
|
4
|
-
import { SelectModal as r } from "./SelectModal.js";
|
|
5
|
-
import { jsx as
|
|
4
|
+
import { SelectModal as r, SelectModalActions as i } from "./SelectModal.js";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
6
|
//#region src/SelectConfirmModal.tsx
|
|
7
|
-
function
|
|
8
|
-
let
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
open:
|
|
11
|
-
onClose:
|
|
12
|
-
title:
|
|
7
|
+
function s({ open: s, onClose: c, onConfirm: l, title: u, children: d, confirmLabel: f, cancelLabel: p, destructive: m = !1, loading: h = !1, theme: g }) {
|
|
8
|
+
let _ = t().common, v = f ?? _.confirm, y = p ?? _.cancel;
|
|
9
|
+
return /* @__PURE__ */ a(r, {
|
|
10
|
+
open: s,
|
|
11
|
+
onClose: c,
|
|
12
|
+
title: u,
|
|
13
13
|
size: "sm",
|
|
14
|
-
theme:
|
|
15
|
-
footer: /* @__PURE__ */ a(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})]
|
|
32
|
-
}),
|
|
33
|
-
children: u != null && u !== !1 && /* @__PURE__ */ i("div", {
|
|
14
|
+
theme: g ?? n(),
|
|
15
|
+
footer: /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(e, {
|
|
16
|
+
variant: "secondary",
|
|
17
|
+
size: "sm",
|
|
18
|
+
inline: !0,
|
|
19
|
+
onClick: c,
|
|
20
|
+
disabled: h,
|
|
21
|
+
children: y
|
|
22
|
+
}), /* @__PURE__ */ a(e, {
|
|
23
|
+
variant: m ? "danger" : "primary",
|
|
24
|
+
size: "sm",
|
|
25
|
+
inline: !0,
|
|
26
|
+
loading: h,
|
|
27
|
+
onClick: l,
|
|
28
|
+
children: v
|
|
29
|
+
})] }),
|
|
30
|
+
children: d != null && d !== !1 && /* @__PURE__ */ a("div", {
|
|
34
31
|
className: "select-confirm__message",
|
|
35
|
-
children:
|
|
32
|
+
children: d
|
|
36
33
|
})
|
|
37
34
|
});
|
|
38
35
|
}
|
|
39
36
|
//#endregion
|
|
40
|
-
export {
|
|
37
|
+
export { s as SelectConfirmModal };
|
|
41
38
|
|
|
42
39
|
//# sourceMappingURL=SelectConfirmModal.js.map
|
package/dist/SelectDonut.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import { SelectDonutSegment } from './chartUtils';
|
|
3
3
|
type SelectDonutOwnProps = {
|
|
4
4
|
segments: SelectDonutSegment[];
|
|
@@ -11,6 +11,19 @@ type SelectDonutOwnProps = {
|
|
|
11
11
|
gap?: number;
|
|
12
12
|
/** Render a full pie (no center hole) instead of a ring. */
|
|
13
13
|
pie?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 0.1.230: o nome do gráfico para quem lê tela ("Como terminaram as 13.262 mensagens"). Com ele, o anel recebe o foco
|
|
16
|
+
* e as setas andam pelas fatias.
|
|
17
|
+
*/
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
/** 0.1.230: a parte de cada fatia, na legenda e na dica ("96,6%"). */
|
|
20
|
+
percent?: boolean;
|
|
21
|
+
/** 0.1.230: o texto da parte (o valor e o total). Padrão: a porcentagem no idioma do kit, com uma casa. */
|
|
22
|
+
formatShare?: (value: number, total: number) => string;
|
|
23
|
+
/** 0.1.230: o rótulo da linha da dica. Padrão: "Valor" (no idioma do kit). */
|
|
24
|
+
valueLabel?: ReactNode;
|
|
25
|
+
/** 0.1.230: `bottom` = a legenda embaixo da rosca, na largura toda. Padrão: ao lado, e embaixo quando não cabe. */
|
|
26
|
+
legendPosition?: 'auto' | 'bottom';
|
|
14
27
|
};
|
|
15
28
|
export type SelectDonutProps = SelectDonutOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectDonutOwnProps>;
|
|
16
29
|
export declare const SelectDonut: import('react').ForwardRefExoticComponent<SelectDonutOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectDonutOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
|
package/dist/SelectDonut.js
CHANGED
|
@@ -1,103 +1,147 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { selectIntlLocale as e, useSelectLocale as t, useSelectMessages as n } from "./SelectLocale.js";
|
|
3
|
+
import { chartColor as r, donutSegment as i, formatCompact as a, useMeasuredWidth as o } from "./chartUtils.js";
|
|
4
|
+
import { ChartTooltip as s } from "./chartTip.js";
|
|
5
|
+
import { forwardRef as c, useId as l, useRef as u, useState as d } from "react";
|
|
6
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
6
7
|
//#region src/SelectDonut.tsx
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
function m(t, n, r) {
|
|
9
|
+
if (n <= 0) return "—";
|
|
10
|
+
let i = t / n * 100, a = (t) => t.toLocaleString(e(r), { maximumFractionDigits: 1 });
|
|
11
|
+
return t > 0 && i < .1 ? `<${a(.1)}%` : `${a(i)}%`;
|
|
12
|
+
}
|
|
13
|
+
var h = c(function({ segments: e, size: c = 200, thickness: h = 26, format: g = a, centerLabel: _, legend: v = !0, gap: y = 2, pie: b = !1, ariaLabel: x, percent: S = !1, formatShare: C, valueLabel: w, legendPosition: T = "auto", className: E, ...D }, O) {
|
|
14
|
+
let k = n(), A = t(), j = l(), M = u(null), [N, P] = d(null), F = o(M, c), I = e.reduce((e, t) => e + t.value, 0), L = I || 1, R = F / 2, z = F / 2, B = F / 2 - 2, V = b ? 0 : B - h, H = (e) => C ? C(e, I) : m(e, I, A), U = 0, W = e.map((e, t) => {
|
|
15
|
+
let n = U / L * 360;
|
|
16
|
+
return U += e.value, {
|
|
17
|
+
...e,
|
|
18
|
+
index: t,
|
|
19
|
+
color: e.color ?? r(t),
|
|
20
|
+
start: n,
|
|
21
|
+
end: U / L * 360
|
|
22
|
+
};
|
|
23
|
+
}), G = W.filter((e) => e.value > 0), K = x != null && G.length > 0, q = N == null ? void 0 : W[N], J = q && q.value > 0 ? ((e) => {
|
|
24
|
+
let t = ((e.start + e.end) / 2 - 90) * Math.PI / 180, n = R + (B + 6) * Math.cos(t), r = z + (B + 6) * Math.sin(t), i = M.current;
|
|
25
|
+
return {
|
|
26
|
+
x: n + ((i == null ? void 0 : i.offsetLeft) ?? 0),
|
|
27
|
+
y: r + ((i == null ? void 0 : i.offsetTop) ?? 0),
|
|
28
|
+
place: r <= z ? "top" : "bottom",
|
|
29
|
+
title: e.label,
|
|
30
|
+
rows: [{
|
|
31
|
+
label: w ?? k.chart.value,
|
|
32
|
+
value: S ? `${g(e.value)} · ${H(e.value)}` : g(e.value),
|
|
33
|
+
color: e.color
|
|
34
|
+
}]
|
|
35
|
+
};
|
|
36
|
+
})(q) : null, Y = (e) => {
|
|
37
|
+
if (e.key === "Escape") {
|
|
38
|
+
P(null);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
let t = G.map((e) => e.index), n = N == null ? -1 : t.indexOf(N), r = {
|
|
42
|
+
ArrowRight: n + 1,
|
|
43
|
+
ArrowDown: n + 1,
|
|
44
|
+
ArrowLeft: n - 1,
|
|
45
|
+
ArrowUp: n - 1,
|
|
46
|
+
Home: 0,
|
|
47
|
+
End: t.length - 1
|
|
48
|
+
}[e.key];
|
|
49
|
+
r !== void 0 && (e.preventDefault(), P(t[Math.min(t.length - 1, Math.max(0, r))]));
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ p("div", {
|
|
52
|
+
ref: O,
|
|
53
|
+
...D,
|
|
54
|
+
className: `select-donut-wrap${T === "bottom" ? " select-donut-wrap--bottom" : ""}${E ? " " + E : ""}`,
|
|
13
55
|
children: [
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
ref:
|
|
16
|
-
className:
|
|
56
|
+
/* @__PURE__ */ p("div", {
|
|
57
|
+
ref: M,
|
|
58
|
+
className: `select-donut-ring${q ? " has-active" : ""}`,
|
|
17
59
|
style: {
|
|
18
|
-
width: `${
|
|
60
|
+
width: `${c / 16}rem`,
|
|
19
61
|
aspectRatio: "1"
|
|
20
62
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
63
|
+
...K ? {
|
|
64
|
+
tabIndex: 0,
|
|
65
|
+
role: "img",
|
|
66
|
+
"aria-label": `${x}: ${G.map((e) => `${e.label} ${g(e.value)} (${H(e.value)})`).join(", ")}`,
|
|
67
|
+
onKeyDown: Y,
|
|
68
|
+
onFocus: () => P((e) => e ?? G[0].index),
|
|
69
|
+
onBlur: () => P(null)
|
|
70
|
+
} : {},
|
|
71
|
+
children: [/* @__PURE__ */ p("svg", {
|
|
72
|
+
width: F,
|
|
73
|
+
height: F,
|
|
74
|
+
viewBox: `0 0 ${F} ${F}`,
|
|
25
75
|
className: "select-chart select-donut",
|
|
26
76
|
"aria-hidden": "true",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
className: "select-chart__seg",
|
|
54
|
-
onMouseEnter: () => {
|
|
55
|
-
let e = ((i + a) / 2 - 90) * Math.PI / 180, t = E + (O + 6) * Math.cos(e), r = D + (O + 6) * Math.sin(e);
|
|
56
|
-
x.show({
|
|
57
|
-
x: t,
|
|
58
|
-
y: r,
|
|
59
|
-
place: r <= D ? "top" : "bottom",
|
|
60
|
-
title: n.label,
|
|
61
|
-
rows: [{
|
|
62
|
-
label: "Valor",
|
|
63
|
-
value: p(n.value),
|
|
64
|
-
color: o
|
|
65
|
-
}]
|
|
66
|
-
});
|
|
67
|
-
},
|
|
68
|
-
onMouseLeave: x.hide
|
|
69
|
-
}, r);
|
|
77
|
+
children: [/* @__PURE__ */ f("defs", { children: W.map((e) => /* @__PURE__ */ p("linearGradient", {
|
|
78
|
+
id: `${j}-s${e.index}`,
|
|
79
|
+
gradientUnits: "userSpaceOnUse",
|
|
80
|
+
x1: "0",
|
|
81
|
+
y1: "0",
|
|
82
|
+
x2: "0",
|
|
83
|
+
y2: F,
|
|
84
|
+
children: [/* @__PURE__ */ f("stop", {
|
|
85
|
+
offset: "0%",
|
|
86
|
+
stopColor: e.color,
|
|
87
|
+
stopOpacity: 1
|
|
88
|
+
}), /* @__PURE__ */ f("stop", {
|
|
89
|
+
offset: "100%",
|
|
90
|
+
stopColor: e.color,
|
|
91
|
+
stopOpacity: .6
|
|
92
|
+
})]
|
|
93
|
+
}, e.index)) }), G.map((e) => {
|
|
94
|
+
let t = e.end - e.start > y * 1.5 ? y / 2 : 0, n = e.start + t, r = Math.max(n + .01, e.end - t);
|
|
95
|
+
return /* @__PURE__ */ f("path", {
|
|
96
|
+
d: i(R, z, B, V, n, r),
|
|
97
|
+
fill: `url(#${j}-s${e.index})`,
|
|
98
|
+
className: `select-chart__seg${N === e.index ? " is-on" : ""}`,
|
|
99
|
+
onMouseEnter: () => P(e.index),
|
|
100
|
+
onMouseLeave: () => P(null),
|
|
101
|
+
onPointerDown: () => P(e.index)
|
|
102
|
+
}, e.index);
|
|
70
103
|
})]
|
|
71
|
-
}),
|
|
104
|
+
}), _ != null && /* @__PURE__ */ f("div", {
|
|
72
105
|
className: "select-donut__center",
|
|
73
|
-
children:
|
|
106
|
+
children: _
|
|
74
107
|
})]
|
|
75
108
|
}),
|
|
76
|
-
|
|
109
|
+
v && /* @__PURE__ */ f("ul", {
|
|
77
110
|
className: "select-donut__legend",
|
|
78
|
-
children:
|
|
79
|
-
className:
|
|
111
|
+
children: W.map((e) => /* @__PURE__ */ p("li", {
|
|
112
|
+
className: `select-donut__legitem${q && N !== e.index ? " is-dim" : ""}`,
|
|
113
|
+
onMouseEnter: e.value > 0 ? () => P(e.index) : void 0,
|
|
114
|
+
onMouseLeave: e.value > 0 ? () => P(null) : void 0,
|
|
80
115
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ f("span", {
|
|
82
117
|
className: "select-donut__dot",
|
|
83
|
-
style: { background:
|
|
118
|
+
style: { background: e.color }
|
|
84
119
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ f("span", {
|
|
86
121
|
className: "select-donut__leglabel",
|
|
87
|
-
children:
|
|
122
|
+
children: e.label
|
|
88
123
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ f("span", {
|
|
90
125
|
className: "select-donut__legval",
|
|
91
|
-
children:
|
|
126
|
+
children: g(e.value)
|
|
127
|
+
}),
|
|
128
|
+
S && /* @__PURE__ */ f("span", {
|
|
129
|
+
className: "select-donut__legpct",
|
|
130
|
+
children: H(e.value)
|
|
92
131
|
})
|
|
93
132
|
]
|
|
94
|
-
},
|
|
133
|
+
}, e.index))
|
|
134
|
+
}),
|
|
135
|
+
K && /* @__PURE__ */ f("span", {
|
|
136
|
+
className: "select-visually-hidden",
|
|
137
|
+
"aria-live": "polite",
|
|
138
|
+
children: q ? `${q.label}: ${g(q.value)} (${H(q.value)})` : ""
|
|
95
139
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ f(s, { tip: J })
|
|
97
141
|
]
|
|
98
142
|
});
|
|
99
143
|
});
|
|
100
144
|
//#endregion
|
|
101
|
-
export {
|
|
145
|
+
export { h as SelectDonut };
|
|
102
146
|
|
|
103
147
|
//# sourceMappingURL=SelectDonut.js.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export declare function SelectFormModal({ open, onClose, onSubmit, title, subtitle, children, submitLabel: submitLabelProp, cancelLabel: cancelLabelProp, submitting, submitDisabled, submitVariant, error, size, theme, }: {
|
|
2
|
+
export declare function SelectFormModal({ open, onClose, onSubmit, title, subtitle, description, children, submitLabel: submitLabelProp, cancelLabel: cancelLabelProp, submitting, submitDisabled, submitVariant, error, size, theme, }: {
|
|
3
3
|
open: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
onSubmit: () => void;
|
|
6
6
|
title: ReactNode;
|
|
7
7
|
subtitle?: ReactNode;
|
|
8
|
+
/** 0.1.230: a descrição no começo do corpo (o lugar dela no modal novo; o `subtitle` fica na cabeça). */
|
|
9
|
+
description?: ReactNode;
|
|
8
10
|
children: ReactNode;
|
|
9
11
|
submitLabel?: string;
|
|
10
12
|
cancelLabel?: string;
|
package/dist/SelectFormModal.js
CHANGED
|
@@ -2,52 +2,50 @@ import { SelectButton as e } from "./SelectButton.js";
|
|
|
2
2
|
import { useSelectMessages as t } from "./SelectLocale.js";
|
|
3
3
|
import { SelectAlert as n } from "./SelectAlert.js";
|
|
4
4
|
import { detectSelectTheme as r } from "./detectSelectTheme.js";
|
|
5
|
-
import { SelectModal as i } from "./SelectModal.js";
|
|
6
|
-
import { jsx as
|
|
5
|
+
import { SelectModal as i, SelectModalActions as a } from "./SelectModal.js";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
7
|
//#region src/SelectFormModal.tsx
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
open:
|
|
12
|
-
onClose:
|
|
13
|
-
title:
|
|
14
|
-
subtitle:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}),
|
|
36
|
-
children: [v != null && v !== !1 && /* @__PURE__ */ a("div", {
|
|
8
|
+
function c({ open: c, onClose: l, onSubmit: u, title: d, subtitle: f, description: p, children: m, submitLabel: h, cancelLabel: g, submitting: _ = !1, submitDisabled: v = !1, submitVariant: y = "primary", error: b, size: x = "md", theme: S }) {
|
|
9
|
+
let C = t().common, w = h ?? C.save, T = g ?? C.cancel;
|
|
10
|
+
return /* @__PURE__ */ s(i, {
|
|
11
|
+
open: c,
|
|
12
|
+
onClose: l,
|
|
13
|
+
title: d,
|
|
14
|
+
subtitle: f,
|
|
15
|
+
description: p,
|
|
16
|
+
size: x,
|
|
17
|
+
theme: S ?? r(),
|
|
18
|
+
footer: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(e, {
|
|
19
|
+
variant: "secondary",
|
|
20
|
+
size: "sm",
|
|
21
|
+
inline: !0,
|
|
22
|
+
onClick: l,
|
|
23
|
+
disabled: _,
|
|
24
|
+
children: T
|
|
25
|
+
}), /* @__PURE__ */ o(e, {
|
|
26
|
+
variant: y,
|
|
27
|
+
size: "sm",
|
|
28
|
+
inline: !0,
|
|
29
|
+
loading: _,
|
|
30
|
+
disabled: v,
|
|
31
|
+
onClick: () => u(),
|
|
32
|
+
children: w
|
|
33
|
+
})] }),
|
|
34
|
+
children: [b != null && b !== !1 && /* @__PURE__ */ o("div", {
|
|
37
35
|
className: "select-formmodal__error",
|
|
38
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ o(n, {
|
|
39
37
|
tone: "critical",
|
|
40
|
-
children:
|
|
38
|
+
children: b
|
|
41
39
|
})
|
|
42
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ o("form", {
|
|
43
41
|
onSubmit: (e) => {
|
|
44
|
-
e.preventDefault(),
|
|
42
|
+
e.preventDefault(), u();
|
|
45
43
|
},
|
|
46
|
-
children:
|
|
44
|
+
children: m
|
|
47
45
|
})]
|
|
48
46
|
});
|
|
49
47
|
}
|
|
50
48
|
//#endregion
|
|
51
|
-
export {
|
|
49
|
+
export { c as SelectFormModal };
|
|
52
50
|
|
|
53
51
|
//# sourceMappingURL=SelectFormModal.js.map
|
package/dist/SelectKpiBand.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ type SelectKpiBandOwnProps = {
|
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
/** 0.1.210: `dl` para a faixa de números só de leitura (os `SelectKpiCard` viram `<dt>` e `<dd>`). Padrão `div`. */
|
|
5
5
|
as?: 'div' | 'dl';
|
|
6
|
+
/** 0.1.230: as colunas da faixa (4 → 4/2/1, 3 → 3/1, 2 → 2/1), sem o buraco da grade. Padrão: quebra sozinha. */
|
|
7
|
+
columns?: 2 | 3 | 4;
|
|
6
8
|
};
|
|
7
9
|
export type SelectKpiBandProps = SelectKpiBandOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectKpiBandOwnProps>;
|
|
8
10
|
export declare const SelectKpiBand: import('react').ForwardRefExoticComponent<SelectKpiBandOwnProps & Omit<Omit<import('react').DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectKpiBandOwnProps> & import('react').RefAttributes<HTMLDivElement>>;
|
package/dist/SelectKpiBand.js
CHANGED
|
@@ -4,21 +4,21 @@ import { KpiListContext as t } from "./internal/kpiList.js";
|
|
|
4
4
|
import { forwardRef as n } from "react";
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
6
6
|
//#region src/SelectKpiBand.tsx
|
|
7
|
-
var i = n(function({ children: n, as: i = "div",
|
|
8
|
-
let
|
|
7
|
+
var i = n(function({ children: n, as: i = "div", columns: a, className: o, ...s }, c) {
|
|
8
|
+
let l = e(), u = `select-kpiband${l ? " select-kpiband--nested" : ""}${a && !l ? ` select-kpiband--cols-${a}` : ""}${o ? " " + o : ""}`;
|
|
9
9
|
return i === "dl" ? /* @__PURE__ */ r(t.Provider, {
|
|
10
10
|
value: !0,
|
|
11
11
|
children: /* @__PURE__ */ r("dl", {
|
|
12
|
-
ref:
|
|
13
|
-
...
|
|
14
|
-
className:
|
|
12
|
+
ref: c,
|
|
13
|
+
...s,
|
|
14
|
+
className: u,
|
|
15
15
|
children: n
|
|
16
16
|
})
|
|
17
17
|
}) : /* @__PURE__ */ r("div", {
|
|
18
|
-
ref:
|
|
18
|
+
ref: c,
|
|
19
19
|
role: "group",
|
|
20
|
-
...
|
|
21
|
-
className:
|
|
20
|
+
...s,
|
|
21
|
+
className: u,
|
|
22
22
|
children: n
|
|
23
23
|
});
|
|
24
24
|
});
|