iryx-ui 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppShell.vue.d.ts +13 -7
- package/dist/components/AppShell.vue_vue_type_script_setup_true_lang.js +58 -48
- package/dist/components/Combobox.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/DonutChart.vue.d.ts +9 -0
- package/dist/components/DonutChart.vue_vue_type_script_setup_true_lang.js +73 -65
- package/dist/components/Input.vue.d.ts +1 -1
- package/dist/components/LineChart.vue_vue_type_script_setup_true_lang.js +192 -177
- package/dist/components/Select.vue.d.ts +2 -0
- package/dist/components/Select.vue_vue_type_script_setup_true_lang.js +6 -4
- package/dist/components/Sidebar.vue.d.ts +3 -0
- package/dist/components/Sidebar.vue_vue_type_script_setup_true_lang.js +65 -62
- package/dist/components/Stat.vue.d.ts +12 -2
- package/dist/components/Stat.vue_vue_type_script_setup_true_lang.js +16 -3
- package/dist/components/Textarea.vue.d.ts +1 -1
- package/dist/components/ToggleGroup.vue.d.ts +1 -1
- package/dist/components/ToggleGroup.vue_vue_type_script_setup_true_lang.js +35 -29
- package/dist/composables/character-count.d.ts +1 -1
- package/dist/composables/character-count.js +8 -5
- package/dist/composables/sidebar.d.ts +11 -1
- package/dist/composables/sidebar.js +24 -13
- package/dist/index.js +166 -166
- package/dist/nuxt.js +3 -2
- package/dist/theme/app-shell.d.ts +3 -0
- package/dist/theme/app-shell.js +2 -1
- package/dist/theme/stat.d.ts +3 -0
- package/dist/theme/stat.js +2 -1
- package/package.json +2 -2
- package/theme.css +2 -2
|
@@ -22,6 +22,7 @@ export interface AppShellProps {
|
|
|
22
22
|
/** Override classes per element, e.g. `{ main: 'p-8' }`. */
|
|
23
23
|
ui?: {
|
|
24
24
|
root?: string;
|
|
25
|
+
topbar?: string;
|
|
25
26
|
header?: string;
|
|
26
27
|
body?: string;
|
|
27
28
|
sidebar?: string;
|
|
@@ -37,22 +38,27 @@ export interface AppShellProps {
|
|
|
37
38
|
}
|
|
38
39
|
declare var __VLS_20: {
|
|
39
40
|
inDrawer: boolean;
|
|
40
|
-
},
|
|
41
|
+
}, __VLS_22: {
|
|
42
|
+
navOpen: boolean;
|
|
43
|
+
toggleNav: () => boolean;
|
|
44
|
+
}, __VLS_30: {
|
|
41
45
|
inDrawer: boolean;
|
|
42
|
-
},
|
|
46
|
+
}, __VLS_37: {
|
|
43
47
|
navOpen: boolean;
|
|
44
48
|
toggleNav: () => boolean;
|
|
45
|
-
},
|
|
49
|
+
}, __VLS_39: {}, __VLS_41: {};
|
|
46
50
|
type __VLS_Slots = {} & {
|
|
47
51
|
sidebar?: (props: typeof __VLS_20) => any;
|
|
48
52
|
} & {
|
|
49
|
-
|
|
53
|
+
topbar?: (props: typeof __VLS_22) => any;
|
|
54
|
+
} & {
|
|
55
|
+
sidebar?: (props: typeof __VLS_30) => any;
|
|
50
56
|
} & {
|
|
51
|
-
header?: (props: typeof
|
|
57
|
+
header?: (props: typeof __VLS_37) => any;
|
|
52
58
|
} & {
|
|
53
|
-
default?: (props: typeof
|
|
59
|
+
default?: (props: typeof __VLS_39) => any;
|
|
54
60
|
} & {
|
|
55
|
-
footer?: (props: typeof
|
|
61
|
+
footer?: (props: typeof __VLS_41) => any;
|
|
56
62
|
};
|
|
57
63
|
declare const __VLS_base: import("vue").DefineComponent<AppShellProps, {
|
|
58
64
|
/** Open or close the mobile navigation drawer from the outside. */
|
|
@@ -56,57 +56,67 @@ var w = ["aria-label", "aria-expanded"], T = /*@__PURE__*/ f({
|
|
|
56
56
|
style: m(N.value),
|
|
57
57
|
class: p(A.value ? [D.ui?.root, D.class] : L.value.root({ class: [D.ui?.root, D.class] }))
|
|
58
58
|
}, {
|
|
59
|
-
default: x(() => [
|
|
60
|
-
|
|
61
|
-
open: P.value,
|
|
62
|
-
"onUpdate:open": n[0] ||= (e) => P.value = e,
|
|
63
|
-
side: "left",
|
|
64
|
-
size: "sm",
|
|
65
|
-
class: p(R("navDrawer")),
|
|
66
|
-
ui: {
|
|
67
|
-
body: R("navDrawerBody"),
|
|
68
|
-
overlay: "md:hidden",
|
|
69
|
-
content: "md:hidden"
|
|
70
|
-
}
|
|
71
|
-
}, {
|
|
72
|
-
default: x(() => [d(y(F), { placement: "drawer" }, {
|
|
73
|
-
default: x(() => [v(e.$slots, "sidebar", { inDrawer: !0 })]),
|
|
74
|
-
_: 3
|
|
75
|
-
})]),
|
|
76
|
-
_: 3
|
|
77
|
-
}, 8, [
|
|
78
|
-
"open",
|
|
79
|
-
"class",
|
|
80
|
-
"ui"
|
|
81
|
-
])) : c("", !0), u("div", { class: p(R("body")) }, [e.$slots.sidebar ? (h(), l("div", {
|
|
82
|
-
key: 0,
|
|
83
|
-
class: p(R("sidebar"))
|
|
84
|
-
}, [d(y(F), { placement: "column" }, {
|
|
85
|
-
default: x(() => [v(e.$slots, "sidebar", { inDrawer: !1 })]),
|
|
86
|
-
_: 3
|
|
87
|
-
})], 2)) : c("", !0), u("div", { class: p(R("panel")) }, [
|
|
88
|
-
e.$slots.header ? (h(), l("div", {
|
|
89
|
-
key: 0,
|
|
90
|
-
ref_key: "header",
|
|
91
|
-
ref: j,
|
|
92
|
-
class: p(R("header"))
|
|
93
|
-
}, [u("div", { class: p(R("headerRow")) }, [I.value ? (h(), l("button", {
|
|
59
|
+
default: x(() => [
|
|
60
|
+
I.value ? (h(), s(a, {
|
|
94
61
|
key: 0,
|
|
95
|
-
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
62
|
+
open: P.value,
|
|
63
|
+
"onUpdate:open": n[0] ||= (e) => P.value = e,
|
|
64
|
+
side: "left",
|
|
65
|
+
size: "sm",
|
|
66
|
+
class: p(R("navDrawer")),
|
|
67
|
+
ui: {
|
|
68
|
+
body: R("navDrawerBody"),
|
|
69
|
+
overlay: "md:hidden",
|
|
70
|
+
content: "md:hidden"
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
default: x(() => [d(y(F), { placement: "drawer" }, {
|
|
74
|
+
default: x(() => [v(e.$slots, "sidebar", { inDrawer: !0 })]),
|
|
75
|
+
_: 3
|
|
76
|
+
})]),
|
|
77
|
+
_: 3
|
|
78
|
+
}, 8, [
|
|
79
|
+
"open",
|
|
80
|
+
"class",
|
|
81
|
+
"ui"
|
|
82
|
+
])) : c("", !0),
|
|
83
|
+
e.$slots.topbar ? (h(), l("div", {
|
|
84
|
+
key: 1,
|
|
85
|
+
class: p(R("topbar"))
|
|
86
|
+
}, [v(e.$slots, "topbar", {
|
|
101
87
|
navOpen: P.value,
|
|
102
88
|
toggleNav: () => P.value = !P.value
|
|
103
|
-
})], 2)
|
|
104
|
-
u("
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
89
|
+
})], 2)) : c("", !0),
|
|
90
|
+
u("div", { class: p(R("body")) }, [e.$slots.sidebar ? (h(), l("div", {
|
|
91
|
+
key: 0,
|
|
92
|
+
class: p(R("sidebar"))
|
|
93
|
+
}, [d(y(F), { placement: "column" }, {
|
|
94
|
+
default: x(() => [v(e.$slots, "sidebar", { inDrawer: !1 })]),
|
|
95
|
+
_: 3
|
|
96
|
+
})], 2)) : c("", !0), u("div", { class: p(R("panel")) }, [
|
|
97
|
+
e.$slots.header ? (h(), l("div", {
|
|
98
|
+
key: 0,
|
|
99
|
+
ref_key: "header",
|
|
100
|
+
ref: j,
|
|
101
|
+
class: p(R("header"))
|
|
102
|
+
}, [u("div", { class: p(R("headerRow")) }, [I.value ? (h(), l("button", {
|
|
103
|
+
key: 0,
|
|
104
|
+
type: "button",
|
|
105
|
+
"aria-label": D.navLabel,
|
|
106
|
+
"aria-expanded": P.value,
|
|
107
|
+
class: p(R("navTrigger")),
|
|
108
|
+
onClick: n[1] ||= (e) => P.value = !0
|
|
109
|
+
}, [d(t, { icon: y(S) }, null, 8, ["icon"])], 10, w)) : c("", !0), u("div", { class: p(R("headerContent")) }, [v(e.$slots, "header", {
|
|
110
|
+
navOpen: P.value,
|
|
111
|
+
toggleNav: () => P.value = !P.value
|
|
112
|
+
})], 2)], 2)], 2)) : c("", !0),
|
|
113
|
+
u("main", { class: p(R("main")) }, [v(e.$slots, "default")], 2),
|
|
114
|
+
e.$slots.footer ? (h(), l("div", {
|
|
115
|
+
key: 1,
|
|
116
|
+
class: p(R("footer"))
|
|
117
|
+
}, [v(e.$slots, "footer")], 2)) : c("", !0)
|
|
118
|
+
], 2)], 2)
|
|
119
|
+
]),
|
|
110
120
|
_: 3
|
|
111
121
|
}, 8, [
|
|
112
122
|
"as",
|
|
@@ -71,6 +71,7 @@ var E = /*@__PURE__*/ u({
|
|
|
71
71
|
openOnClick: { type: Boolean },
|
|
72
72
|
ignoreFilter: { type: Boolean },
|
|
73
73
|
resetModelValueOnClear: { type: Boolean },
|
|
74
|
+
unmountOnHide: { type: Boolean },
|
|
74
75
|
modelValue: {},
|
|
75
76
|
defaultValue: {},
|
|
76
77
|
dir: {},
|
|
@@ -79,6 +80,7 @@ var E = /*@__PURE__*/ u({
|
|
|
79
80
|
default: void 0
|
|
80
81
|
},
|
|
81
82
|
highlightOnHover: { type: Boolean },
|
|
83
|
+
loop: { type: Boolean },
|
|
82
84
|
by: {},
|
|
83
85
|
asChild: { type: Boolean },
|
|
84
86
|
as: {},
|
|
@@ -48,6 +48,14 @@ export interface DonutChartProps {
|
|
|
48
48
|
* meet before they reach it.
|
|
49
49
|
*/
|
|
50
50
|
gap?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Corner radius of each slice, in px — 4 by default, matching `IBarChart`. `0` keeps them square.
|
|
53
|
+
*
|
|
54
|
+
* Drawn as a round-joined stroke in the slice's own colour around a shape
|
|
55
|
+
* shrunk by the same amount, so the outline still lands on the ring and the
|
|
56
|
+
* gap stays `gap` wide. Clamped to half the band.
|
|
57
|
+
*/
|
|
58
|
+
radius?: number;
|
|
51
59
|
/**
|
|
52
60
|
* Sweep the ring open on the first paint. Skipped for a reader who has
|
|
53
61
|
* asked for reduced motion, and played once — not again when the data
|
|
@@ -86,6 +94,7 @@ declare const __VLS_base: import("vue").DefineComponent<DonutChartProps, {}, {},
|
|
|
86
94
|
legend: boolean;
|
|
87
95
|
animate: ChartAnimate;
|
|
88
96
|
gap: number;
|
|
97
|
+
radius: number;
|
|
89
98
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
90
99
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
91
100
|
declare const _default: typeof __VLS_export;
|
|
@@ -6,18 +6,18 @@ import c from "./ChartLegend.js";
|
|
|
6
6
|
import { donutChartTheme as l } from "../theme/donut-chart.js";
|
|
7
7
|
import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, defineComponent as g, normalizeClass as _, normalizeStyle as v, openBlock as y, ref as b, renderList as x, renderSlot as ee, toDisplayString as S, unref as C } from "vue";
|
|
8
8
|
//#region src/components/DonutChart.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var te = ["role", "aria-label"],
|
|
9
|
+
var te = ["role", "aria-label"], ne = [
|
|
10
10
|
"width",
|
|
11
11
|
"height",
|
|
12
12
|
"viewBox"
|
|
13
|
-
],
|
|
13
|
+
], re = [
|
|
14
14
|
"cx",
|
|
15
15
|
"cy",
|
|
16
16
|
"r",
|
|
17
17
|
"fill",
|
|
18
18
|
"stroke",
|
|
19
19
|
"stroke-width"
|
|
20
|
-
],
|
|
20
|
+
], ie = ["d", "onPointerenter"], ae = { scope: "row" }, w = /*@__PURE__*/ g({
|
|
21
21
|
__name: "DonutChart",
|
|
22
22
|
props: {
|
|
23
23
|
data: { default: () => [] },
|
|
@@ -25,6 +25,7 @@ var te = ["role", "aria-label"], w = [
|
|
|
25
25
|
thickness: {},
|
|
26
26
|
pie: { type: Boolean },
|
|
27
27
|
gap: { default: 2 },
|
|
28
|
+
radius: { default: 4 },
|
|
28
29
|
animate: {
|
|
29
30
|
type: [Boolean, Object],
|
|
30
31
|
default: !0
|
|
@@ -49,24 +50,24 @@ var te = ["role", "aria-label"], w = [
|
|
|
49
50
|
ui: {}
|
|
50
51
|
},
|
|
51
52
|
setup(g) {
|
|
52
|
-
let
|
|
53
|
+
let w = g, T = e(), E = d(() => w.unstyled ?? T.unstyled), D = b(), { width: O } = t(D), oe = d(() => new Intl.NumberFormat(w.locale, w.format));
|
|
53
54
|
function k(e) {
|
|
54
55
|
return oe.value.format(e);
|
|
55
56
|
}
|
|
56
|
-
let A = d(() => new Intl.NumberFormat(
|
|
57
|
+
let A = d(() => new Intl.NumberFormat(w.locale, {
|
|
57
58
|
style: "percent",
|
|
58
59
|
maximumFractionDigits: 1
|
|
59
60
|
})), j = !1;
|
|
60
|
-
function
|
|
61
|
+
function se() {
|
|
61
62
|
j || process.env.NODE_ENV === "production" || (j = !0, console.warn("[iryx-ui] IDonutChart dropped a negative value. A share of a whole cannot be negative — plot the magnitudes, or use IBarChart, which has a baseline."));
|
|
62
63
|
}
|
|
63
|
-
let
|
|
64
|
-
let e =
|
|
64
|
+
let M = d(() => {
|
|
65
|
+
let e = w.data.map((e, t) => ({
|
|
65
66
|
datum: e,
|
|
66
67
|
index: t
|
|
67
68
|
})).filter(({ datum: e }) => {
|
|
68
69
|
let t = e.value;
|
|
69
|
-
return typeof t != "number" || !Number.isFinite(t) || t === 0 ? !1 : t < 0 ? (
|
|
70
|
+
return typeof t != "number" || !Number.isFinite(t) || t === 0 ? !1 : t < 0 ? (se(), !1) : !0;
|
|
70
71
|
});
|
|
71
72
|
a(e.length);
|
|
72
73
|
let t = e.reduce((e, { datum: t }) => e + t.value, 0);
|
|
@@ -77,62 +78,62 @@ var te = ["role", "aria-label"], w = [
|
|
|
77
78
|
color: r(i(e, n)),
|
|
78
79
|
index: n
|
|
79
80
|
}));
|
|
80
|
-
}),
|
|
81
|
+
}), N = d(() => M.value.reduce((e, t) => e + t.value, 0)), ce = d(() => M.value.map((e) => ({
|
|
81
82
|
key: `${e.index}-${e.label}`,
|
|
82
83
|
name: e.label,
|
|
83
|
-
slot:
|
|
84
|
-
}))),
|
|
84
|
+
slot: w.data[e.index]?.slot ?? e.index
|
|
85
|
+
}))), le = d(() => w.legend && M.value.length > 0), P = d(() => ({
|
|
85
86
|
x: O.value / 2,
|
|
86
|
-
y:
|
|
87
|
-
})),
|
|
88
|
-
if (
|
|
89
|
-
let e = Math.min(
|
|
90
|
-
return Math.max(
|
|
91
|
-
}),
|
|
87
|
+
y: w.size / 2
|
|
88
|
+
})), F = d(() => Math.max(Math.min(O.value, w.size) / 2, 0)), I = d(() => {
|
|
89
|
+
if (w.pie) return 0;
|
|
90
|
+
let e = Math.min(w.thickness ?? F.value * .4, F.value);
|
|
91
|
+
return Math.max(F.value - e, 0);
|
|
92
|
+
}), L = -Math.PI / 2, R = d(() => Math.min(Math.max(w.radius, 0), (F.value - I.value) / 2)), z = d(() => Math.max(w.gap, 0) / 2 + R.value), B = d(() => F.value - R.value), V = d(() => I.value ? I.value + R.value : 0);
|
|
92
93
|
function H(e) {
|
|
93
94
|
return Math.round(e * 100) / 100;
|
|
94
95
|
}
|
|
95
96
|
function U(e, t) {
|
|
96
|
-
return [H(
|
|
97
|
+
return [H(P.value.x + e * Math.cos(t)), H(P.value.y + e * Math.sin(t))];
|
|
97
98
|
}
|
|
98
|
-
let W = d(() => !!(O.value &&
|
|
99
|
+
let W = d(() => !!(O.value && F.value && M.value.length)), { progress: G } = s(W, o(d(() => w.animate))), K = d(() => {
|
|
99
100
|
if (!W.value) return [];
|
|
100
|
-
let e = G.value, t =
|
|
101
|
-
return
|
|
101
|
+
let e = G.value, t = L;
|
|
102
|
+
return M.value.flatMap((n) => {
|
|
102
103
|
let r = n.share * Math.PI * 2, i = t;
|
|
103
104
|
t += r;
|
|
104
|
-
let a =
|
|
105
|
+
let a = L + (i - L) * e, o = r * e;
|
|
105
106
|
return o <= 0 ? [] : [{
|
|
106
107
|
...n,
|
|
107
108
|
mid: i + r / 2,
|
|
108
|
-
path:
|
|
109
|
+
path: ue(a, a + o)
|
|
109
110
|
}];
|
|
110
111
|
});
|
|
111
112
|
});
|
|
112
113
|
function q(e, t) {
|
|
113
|
-
let n =
|
|
114
|
+
let n = z.value;
|
|
114
115
|
return !n || e <= n ? 0 : Math.min(Math.asin(n / e), t / 3);
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
-
let n = t - e, r = !
|
|
117
|
+
function ue(e, t) {
|
|
118
|
+
let n = t - e, r = !I.value, i = M.value.length < 2 ? 0 : q(B.value, n), a = e + i, o = t - i, s = +(o - a > Math.PI), [c, l] = U(B.value, a), [u, d] = U(B.value, o);
|
|
118
119
|
if (r) {
|
|
119
|
-
let [t, r] = U(i ? Math.min(
|
|
120
|
-
return `M${c} ${l} A${H(
|
|
120
|
+
let [t, r] = U(i ? Math.min(z.value / Math.sin(n / 2), B.value / 2) : 0, e + n / 2);
|
|
121
|
+
return `M${c} ${l} A${H(B.value)} ${H(B.value)} 0 ${s} 1 ${u} ${d} L${t} ${r} Z`;
|
|
121
122
|
}
|
|
122
|
-
let f = i ? q(
|
|
123
|
-
return `M${c} ${l} A${H(
|
|
123
|
+
let f = i ? q(V.value, n) : 0, p = +(n - f * 2 > Math.PI), [m, h] = U(V.value, t - f), [g, _] = U(V.value, e + f);
|
|
124
|
+
return `M${c} ${l} A${H(B.value)} ${H(B.value)} 0 ${s} 1 ${u} ${d} L${m} ${h} A${H(V.value)} ${H(V.value)} 0 ${p} 0 ${g} ${_} Z`;
|
|
124
125
|
}
|
|
125
126
|
let J = d(() => {
|
|
126
|
-
if (!(K.value.length !== 1 || !
|
|
127
|
+
if (!(K.value.length !== 1 || !F.value || G.value < 1)) return {
|
|
127
128
|
...K.value[0],
|
|
128
|
-
radius:
|
|
129
|
-
strokeWidth:
|
|
129
|
+
radius: I.value ? (F.value + I.value) / 2 : F.value,
|
|
130
|
+
strokeWidth: F.value - I.value
|
|
130
131
|
};
|
|
131
|
-
}),
|
|
132
|
+
}), de = d(() => J.value ? [] : K.value), Y = b(), X = d(() => {
|
|
132
133
|
if (Y.value == null) return;
|
|
133
134
|
let e = K.value.find((e) => e.index === Y.value);
|
|
134
135
|
if (!e) return;
|
|
135
|
-
let t = k(e.value), r = A.value.format(e.share), [i, a] = U(
|
|
136
|
+
let t = k(e.value), r = A.value.format(e.share), [i, a] = U(I.value ? (F.value + I.value) / 2 : F.value / 2, e.mid);
|
|
136
137
|
return {
|
|
137
138
|
label: e.label,
|
|
138
139
|
value: t,
|
|
@@ -142,25 +143,25 @@ var te = ["role", "aria-label"], w = [
|
|
|
142
143
|
};
|
|
143
144
|
}), Z = d(() => l());
|
|
144
145
|
function Q(e, t) {
|
|
145
|
-
let n =
|
|
146
|
+
let n = w.ui?.[e];
|
|
146
147
|
return E.value ? [n, t] : Z.value[e]({ class: [n, t] });
|
|
147
148
|
}
|
|
148
149
|
function $(e) {
|
|
149
150
|
let t = Y.value != null && Y.value !== e;
|
|
150
|
-
return E.value ? [
|
|
151
|
+
return E.value ? [w.ui?.slice] : Z.value.slice({ class: [w.ui?.slice, t ? Z.value.faded() : void 0] });
|
|
151
152
|
}
|
|
152
153
|
return (e, t) => (y(), m("div", {
|
|
153
154
|
ref_key: "root",
|
|
154
155
|
ref: D,
|
|
155
|
-
role:
|
|
156
|
-
"aria-label":
|
|
157
|
-
class: _(Q("root",
|
|
156
|
+
role: w.label ? "figure" : void 0,
|
|
157
|
+
"aria-label": w.label,
|
|
158
|
+
class: _(Q("root", w.class))
|
|
158
159
|
}, [
|
|
159
|
-
|
|
160
|
+
le.value ? (y(), f(c, {
|
|
160
161
|
key: 0,
|
|
161
|
-
series:
|
|
162
|
-
active: Y.value == null ? void 0 :
|
|
163
|
-
unstyled:
|
|
162
|
+
series: ce.value,
|
|
163
|
+
active: Y.value == null ? void 0 : M.value.findIndex((e) => e.index === Y.value),
|
|
164
|
+
unstyled: w.unstyled
|
|
164
165
|
}, null, 8, [
|
|
165
166
|
"series",
|
|
166
167
|
"active",
|
|
@@ -169,41 +170,48 @@ var te = ["role", "aria-label"], w = [
|
|
|
169
170
|
h("div", { class: _(E.value ? void 0 : Z.value.plot()) }, [
|
|
170
171
|
(y(), m("svg", {
|
|
171
172
|
width: C(O),
|
|
172
|
-
height:
|
|
173
|
-
viewBox: `0 0 ${C(O)} ${
|
|
173
|
+
height: w.size,
|
|
174
|
+
viewBox: `0 0 ${C(O)} ${w.size}`,
|
|
174
175
|
"aria-hidden": "true",
|
|
175
176
|
class: _(Q("svg"))
|
|
176
177
|
}, [J.value ? (y(), m("circle", {
|
|
177
178
|
key: 0,
|
|
178
|
-
cx:
|
|
179
|
-
cy:
|
|
179
|
+
cx: P.value.x,
|
|
180
|
+
cy: P.value.y,
|
|
180
181
|
r: J.value.radius,
|
|
181
|
-
fill:
|
|
182
|
-
stroke:
|
|
183
|
-
"stroke-width":
|
|
182
|
+
fill: I.value ? "none" : J.value.color,
|
|
183
|
+
stroke: I.value ? J.value.color : "none",
|
|
184
|
+
"stroke-width": I.value ? J.value.strokeWidth : 0,
|
|
184
185
|
class: _($(J.value.index)),
|
|
185
186
|
onPointerenter: t[0] ||= (e) => Y.value = J.value.index,
|
|
186
187
|
onPointerleave: t[1] ||= (e) => Y.value = void 0
|
|
187
|
-
}, null, 42,
|
|
188
|
+
}, null, 42, re)) : p("", !0), (y(!0), m(u, null, x(de.value, (e) => (y(), m("path", {
|
|
188
189
|
key: `slice-${e.index}`,
|
|
189
190
|
d: e.path,
|
|
190
|
-
style: v({
|
|
191
|
+
style: v({
|
|
192
|
+
fill: e.color,
|
|
193
|
+
...R.value ? {
|
|
194
|
+
stroke: e.color,
|
|
195
|
+
strokeWidth: R.value * 2,
|
|
196
|
+
strokeLinejoin: "round"
|
|
197
|
+
} : {}
|
|
198
|
+
}),
|
|
191
199
|
class: _($(e.index)),
|
|
192
200
|
onPointerenter: (t) => Y.value = e.index,
|
|
193
201
|
onPointerleave: t[2] ||= (e) => Y.value = void 0
|
|
194
|
-
}, null, 46,
|
|
195
|
-
e.$slots.center &&
|
|
202
|
+
}, null, 46, ie))), 128))], 10, ne)),
|
|
203
|
+
e.$slots.center && I.value ? (y(), m("div", {
|
|
196
204
|
key: 0,
|
|
197
205
|
class: _(Q("center")),
|
|
198
206
|
style: v({
|
|
199
|
-
left: `${
|
|
200
|
-
top: `${
|
|
201
|
-
width: `${
|
|
207
|
+
left: `${P.value.x}px`,
|
|
208
|
+
top: `${P.value.y}px`,
|
|
209
|
+
width: `${I.value * 2 * .82}px`,
|
|
202
210
|
transform: "translate(-50%, -50%)"
|
|
203
211
|
})
|
|
204
212
|
}, [ee(e.$slots, "center", {
|
|
205
|
-
total:
|
|
206
|
-
formatted: k(
|
|
213
|
+
total: N.value,
|
|
214
|
+
formatted: k(N.value)
|
|
207
215
|
})], 6)) : p("", !0),
|
|
208
216
|
X.value ? (y(), m("div", {
|
|
209
217
|
key: 1,
|
|
@@ -220,14 +228,14 @@ var te = ["role", "aria-label"], w = [
|
|
|
220
228
|
], 6)) : p("", !0)
|
|
221
229
|
], 2),
|
|
222
230
|
h("div", { class: _(Q("table")) }, [h("table", null, [
|
|
223
|
-
h("caption", null, S(
|
|
231
|
+
h("caption", null, S(w.label), 1),
|
|
224
232
|
t[3] ||= h("thead", null, [h("tr", null, [
|
|
225
233
|
h("th", { scope: "col" }, " Category "),
|
|
226
234
|
h("th", { scope: "col" }, " Value "),
|
|
227
235
|
h("th", { scope: "col" }, " Share ")
|
|
228
236
|
])], -1),
|
|
229
|
-
h("tbody", null, [(y(!0), m(u, null, x(
|
|
230
|
-
h("th",
|
|
237
|
+
h("tbody", null, [(y(!0), m(u, null, x(M.value, (e) => (y(), m("tr", { key: `row-${e.index}` }, [
|
|
238
|
+
h("th", ae, S(e.label), 1),
|
|
231
239
|
h("td", null, S(k(e.value)), 1),
|
|
232
240
|
h("td", null, S(A.value.format(e.share)), 1)
|
|
233
241
|
]))), 128))])
|
|
@@ -236,4 +244,4 @@ var te = ["role", "aria-label"], w = [
|
|
|
236
244
|
}
|
|
237
245
|
});
|
|
238
246
|
//#endregion
|
|
239
|
-
export {
|
|
247
|
+
export { w as default };
|
|
@@ -21,7 +21,7 @@ export interface InputProps {
|
|
|
21
21
|
/** Accessible name for the clear button — override for non-English apps. */
|
|
22
22
|
clearLabel?: string;
|
|
23
23
|
/** Hard limit in characters, enforced by the browser. */
|
|
24
|
-
maxlength?: number;
|
|
24
|
+
maxlength?: number | string;
|
|
25
25
|
/**
|
|
26
26
|
* Show a character count in the trailing area — "12/50" with `maxlength`,
|
|
27
27
|
* turning red within the last tenth of the limit.
|