iryx-ui 0.14.0 → 0.16.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/README.md +3 -1
- package/dist/component-names.d.ts +1 -1
- package/dist/component-names.js +1 -1
- package/dist/components/AppShell.vue.d.ts +31 -6
- package/dist/components/AppShell.vue_vue_type_script_setup_true_lang.js +68 -28
- package/dist/components/BarChart.vue.d.ts +10 -0
- package/dist/components/BarChart.vue_vue_type_script_setup_true_lang.js +170 -152
- package/dist/components/DonutChart.js +5 -0
- package/dist/components/DonutChart.vue.d.ts +96 -0
- package/dist/components/DonutChart.vue_vue_type_script_setup_true_lang.js +234 -0
- package/dist/components/Drawer.vue.d.ts +1 -1
- package/dist/components/LineChart.vue.d.ts +26 -0
- package/dist/components/LineChart.vue_vue_type_script_setup_true_lang.js +205 -139
- package/dist/components/Popover.vue.d.ts +1 -1
- package/dist/components/Sparkline.vue.d.ts +9 -0
- package/dist/components/Sparkline.vue_vue_type_script_setup_true_lang.js +90 -53
- package/dist/components/Stat.vue.d.ts +1 -1
- package/dist/components/Stat.vue_vue_type_script_setup_true_lang.js +13 -13
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +140 -138
- package/dist/composables/cartesian.d.ts +17 -2
- package/dist/composables/cartesian.js +6 -1
- package/dist/composables/chart-reveal.d.ts +45 -0
- package/dist/composables/chart-reveal.js +93 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +147 -144
- package/dist/theme/app-shell.d.ts +42 -0
- package/dist/theme/app-shell.js +13 -1
- package/dist/theme/bar-chart.js +1 -1
- package/dist/theme/button.d.ts +2 -2
- package/dist/theme/button.js +1 -1
- package/dist/theme/command-palette.d.ts +3 -3
- package/dist/theme/donut-chart.d.ts +104 -0
- package/dist/theme/donut-chart.js +17 -0
- package/dist/theme/form.js +1 -1
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/line-chart.js +2 -2
- package/dist/theme/sidebar.js +1 -1
- package/dist/theme/sparkline.js +1 -1
- package/package.json +1 -1
|
@@ -1,42 +1,57 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import { useElementSize as t } from "../composables/element-size.js";
|
|
3
3
|
import { cartesianLayout as n, clampTooltip as r, seriesColor as i, slotOf as a, warnOnSlotOverflow as o } from "../composables/cartesian.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import { useChartAnimation as s, useChartReveal as c } from "../composables/chart-reveal.js";
|
|
5
|
+
import l from "./ChartLegend.js";
|
|
6
|
+
import { lineChartTheme as u } from "../theme/line-chart.js";
|
|
7
|
+
import { Fragment as d, computed as f, createBlock as ee, createCommentVNode as p, createElementBlock as m, createElementVNode as h, defineComponent as g, guardReactiveProps as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, openBlock as x, ref as S, renderList as C, renderSlot as w, toDisplayString as T, unref as E, useId as D } from "vue";
|
|
7
8
|
//#region src/components/LineChart.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
9
|
+
var te = ["role", "aria-label"], ne = [
|
|
9
10
|
"width",
|
|
10
11
|
"height",
|
|
11
12
|
"viewBox"
|
|
12
|
-
],
|
|
13
|
+
], O = [
|
|
13
14
|
"x1",
|
|
14
15
|
"y1",
|
|
15
16
|
"x2",
|
|
16
17
|
"y2"
|
|
17
|
-
],
|
|
18
|
+
], re = ["x", "y"], ie = { key: 1 }, ae = [
|
|
19
|
+
"x",
|
|
20
|
+
"y",
|
|
21
|
+
"width",
|
|
22
|
+
"height"
|
|
23
|
+
], oe = [
|
|
18
24
|
"x1",
|
|
19
25
|
"y1",
|
|
20
26
|
"x2",
|
|
21
27
|
"y2"
|
|
22
|
-
],
|
|
28
|
+
], se = ["clip-path"], ce = ["d", "fill"], le = ["d"], ue = ["cx", "cy"], de = ["cx", "cy"], fe = ["x", "y"], pe = [
|
|
23
29
|
"x",
|
|
24
30
|
"y",
|
|
25
31
|
"width",
|
|
26
32
|
"height",
|
|
27
33
|
"onPointerenter"
|
|
28
|
-
],
|
|
34
|
+
], me = { scope: "row" }, k = /*@__PURE__*/ g({
|
|
29
35
|
__name: "LineChart",
|
|
30
36
|
props: {
|
|
31
37
|
data: { default: () => [] },
|
|
32
38
|
series: {},
|
|
33
39
|
variant: { default: "line" },
|
|
40
|
+
tension: { default: 0 },
|
|
41
|
+
flush: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: void 0
|
|
44
|
+
},
|
|
34
45
|
height: { default: 240 },
|
|
35
46
|
ticks: { default: 5 },
|
|
36
47
|
axis: {
|
|
37
48
|
type: Boolean,
|
|
38
49
|
default: !0
|
|
39
50
|
},
|
|
51
|
+
animate: {
|
|
52
|
+
type: [Boolean, Object],
|
|
53
|
+
default: !0
|
|
54
|
+
},
|
|
40
55
|
legend: {
|
|
41
56
|
type: Boolean,
|
|
42
57
|
default: !0
|
|
@@ -55,44 +70,44 @@ var w = ["role", "aria-label"], T = [
|
|
|
55
70
|
class: {},
|
|
56
71
|
ui: {}
|
|
57
72
|
},
|
|
58
|
-
setup(
|
|
59
|
-
let
|
|
60
|
-
function
|
|
61
|
-
return
|
|
73
|
+
setup(g) {
|
|
74
|
+
let k = g, he = e(), A = f(() => k.unstyled ?? he.unstyled), j = S(), { width: M } = t(j), ge = f(() => new Intl.NumberFormat(k.locale, k.format));
|
|
75
|
+
function N(e) {
|
|
76
|
+
return ge.value.format(e);
|
|
62
77
|
}
|
|
63
|
-
let
|
|
64
|
-
let e =
|
|
78
|
+
let P = f(() => {
|
|
79
|
+
let e = k.series?.length ? [...k.series] : [{ key: "value" }];
|
|
65
80
|
return o(e.length), e;
|
|
66
|
-
}),
|
|
67
|
-
function
|
|
81
|
+
}), F = f(() => P.value.length > 1), _e = f(() => F.value || k.legend && P.value[0].name != null);
|
|
82
|
+
function I(e, t) {
|
|
68
83
|
let n = e[t];
|
|
69
84
|
return typeof n == "number" && Number.isFinite(n) ? n : null;
|
|
70
85
|
}
|
|
71
|
-
let
|
|
72
|
-
values:
|
|
73
|
-
categories:
|
|
74
|
-
longestLabel: Math.max(...
|
|
75
|
-
width:
|
|
76
|
-
height:
|
|
77
|
-
tickCount:
|
|
78
|
-
showAxis:
|
|
79
|
-
formatTick:
|
|
80
|
-
includeZero:
|
|
86
|
+
let L = f(() => n({
|
|
87
|
+
values: k.data.flatMap((e) => P.value.map((t) => I(e, t.key))),
|
|
88
|
+
categories: k.data.length,
|
|
89
|
+
longestLabel: Math.max(...k.data.map((e) => e.label.length), 1),
|
|
90
|
+
width: M.value,
|
|
91
|
+
height: k.height,
|
|
92
|
+
tickCount: k.ticks,
|
|
93
|
+
showAxis: k.axis,
|
|
94
|
+
formatTick: N,
|
|
95
|
+
includeZero: k.zero
|
|
81
96
|
}));
|
|
82
|
-
function
|
|
97
|
+
function R(e) {
|
|
83
98
|
return Math.round(e * 100) / 100;
|
|
84
99
|
}
|
|
85
|
-
let
|
|
100
|
+
let z = f(() => M.value ? P.value.map((e, t) => {
|
|
86
101
|
let n = [], r = [];
|
|
87
|
-
return
|
|
88
|
-
let a =
|
|
102
|
+
return k.data.forEach((t, i) => {
|
|
103
|
+
let a = I(t, e.key);
|
|
89
104
|
if (a == null) {
|
|
90
105
|
r.length && n.push(r), r = [];
|
|
91
106
|
return;
|
|
92
107
|
}
|
|
93
108
|
r.push({
|
|
94
|
-
x:
|
|
95
|
-
y:
|
|
109
|
+
x: R(L.value.pointAt(i)),
|
|
110
|
+
y: R(L.value.y(a)),
|
|
96
111
|
index: i
|
|
97
112
|
});
|
|
98
113
|
}), r.length && n.push(r), {
|
|
@@ -100,166 +115,217 @@ var w = ["role", "aria-label"], T = [
|
|
|
100
115
|
color: i(a(e, t)),
|
|
101
116
|
seriesIndex: t
|
|
102
117
|
};
|
|
103
|
-
}) : []),
|
|
104
|
-
|
|
105
|
-
return
|
|
118
|
+
}) : []), B = f(() => k.variant === "area" && !F.value && z.value.length > 0), V = f(() => {
|
|
119
|
+
let e = k.data?.length ?? 0;
|
|
120
|
+
return {
|
|
121
|
+
first: e ? R(L.value.pointAt(0)) : 0,
|
|
122
|
+
last: e ? R(L.value.pointAt(e - 1)) : 0,
|
|
123
|
+
left: R(L.value.plot.left),
|
|
124
|
+
right: R(L.value.plot.left + L.value.plot.width)
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
function H(e) {
|
|
128
|
+
return k.flush && e.x === V.value.last ? `L${V.value.right} ${e.y}` : "";
|
|
106
129
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
130
|
+
let U = f(() => Math.min(Math.max(k.tension, 0), 1) / 6);
|
|
131
|
+
function W(e) {
|
|
132
|
+
let t = e[0], n = e[e.length - 1], r = k.flush && t.x === V.value.first ? `M${V.value.left} ${t.y} L${t.x} ${t.y}` : `M${t.x} ${t.y}`;
|
|
133
|
+
if (U.value === 0 || e.length < 2) return [
|
|
134
|
+
r,
|
|
135
|
+
...e.slice(1).map((e) => `L${e.x} ${e.y}`),
|
|
136
|
+
H(n)
|
|
137
|
+
].filter(Boolean).join(" ");
|
|
138
|
+
let i = (e, t, n) => Math.min(Math.max(e, Math.min(t, n)), Math.max(t, n));
|
|
139
|
+
return [
|
|
140
|
+
r,
|
|
141
|
+
...e.slice(1).map((t, n) => {
|
|
142
|
+
let r = e[n], a = e[n - 1] ?? r, o = t, s = e[n + 2] ?? o, c = r.x + (o.x - a.x) * U.value, l = i(r.y + (o.y - a.y) * U.value, r.y, o.y), u = o.x - (s.x - r.x) * U.value, d = i(o.y - (s.y - r.y) * U.value, r.y, o.y);
|
|
143
|
+
return `C${R(c)} ${R(l)}, ${R(u)} ${R(d)}, ${o.x} ${o.y}`;
|
|
144
|
+
}),
|
|
145
|
+
H(n)
|
|
146
|
+
].filter(Boolean).join(" ");
|
|
147
|
+
}
|
|
148
|
+
function ve(e) {
|
|
149
|
+
let t = L.value.plot.top + L.value.plot.height, n = e[0], r = e[e.length - 1], i = k.flush && n.x === V.value.first ? V.value.left : n.x, a = k.flush && r.x === V.value.last ? V.value.right : r.x;
|
|
150
|
+
return `${W(e)} L${a} ${t} L${i} ${t} Z`;
|
|
110
151
|
}
|
|
111
|
-
let
|
|
152
|
+
let G = `iryx-area-${D()}`, K = `iryx-plot-clip-${D()}`, q = S(), J = f(() => q.value == null ? [] : z.value.flatMap((e) => {
|
|
112
153
|
for (let t of e.runs) {
|
|
113
|
-
let n = t.find((e) => e.index ===
|
|
154
|
+
let n = t.find((e) => e.index === q.value);
|
|
114
155
|
if (n) return [{
|
|
115
156
|
...n,
|
|
116
157
|
color: e.color
|
|
117
158
|
}];
|
|
118
159
|
}
|
|
119
160
|
return [];
|
|
120
|
-
})),
|
|
121
|
-
if (
|
|
122
|
-
let e =
|
|
161
|
+
})), Y = f(() => q.value == null ? void 0 : R(L.value.pointAt(q.value))), X = f(() => {
|
|
162
|
+
if (q.value == null) return;
|
|
163
|
+
let e = k.data[q.value];
|
|
123
164
|
if (!e) return;
|
|
124
|
-
let t =
|
|
165
|
+
let t = P.value.map((t, n) => ({
|
|
125
166
|
name: t.name ?? t.key,
|
|
126
167
|
color: i(a(t, n)),
|
|
127
|
-
value:
|
|
168
|
+
value: I(e, t.key)
|
|
128
169
|
})).filter((e) => e.value != null).map((e) => ({
|
|
129
170
|
...e,
|
|
130
|
-
value:
|
|
171
|
+
value: N(e.value)
|
|
131
172
|
}));
|
|
132
173
|
if (!t.length) return;
|
|
133
|
-
let n =
|
|
174
|
+
let n = F.value ? Math.max(e.label.length, ...t.map((e) => e.name.length + e.value.length + 3)) : e.label.length + t[0].value.length + 2;
|
|
134
175
|
return {
|
|
135
176
|
label: e.label,
|
|
136
177
|
rows: t,
|
|
137
|
-
multi:
|
|
138
|
-
x: r(
|
|
139
|
-
y: Math.min(...
|
|
178
|
+
multi: F.value,
|
|
179
|
+
x: r(L.value.pointAt(q.value), "x".repeat(n), M.value),
|
|
180
|
+
y: Math.min(...J.value.map((e) => e.y), L.value.plot.top + L.value.plot.height)
|
|
140
181
|
};
|
|
141
|
-
}),
|
|
182
|
+
}), Z = s(f(() => k.animate)), { revealed: ye } = c(f(() => !!(M.value && z.value.length)), Z), be = f(() => ({
|
|
183
|
+
transform: `scaleX(${+!!ye.value})`,
|
|
184
|
+
transformOrigin: `${L.value.plot.left}px 0px`,
|
|
185
|
+
transition: `transform ${Z.value.duration}ms ${Z.value.css}`
|
|
186
|
+
})), Q = f(() => u());
|
|
142
187
|
function $(e, t) {
|
|
143
|
-
let n =
|
|
144
|
-
return
|
|
188
|
+
let n = k.ui?.[e];
|
|
189
|
+
return A.value ? [n, t] : Q.value[e]({ class: [n, t] });
|
|
145
190
|
}
|
|
146
|
-
return (e, t) => (
|
|
191
|
+
return (e, t) => (x(), m("div", {
|
|
147
192
|
ref_key: "root",
|
|
148
|
-
ref:
|
|
149
|
-
role:
|
|
150
|
-
"aria-label":
|
|
151
|
-
class:
|
|
193
|
+
ref: j,
|
|
194
|
+
role: k.label ? "figure" : void 0,
|
|
195
|
+
"aria-label": k.label,
|
|
196
|
+
class: v($("root", k.class))
|
|
152
197
|
}, [
|
|
153
|
-
|
|
198
|
+
_e.value ? (x(), ee(l, {
|
|
154
199
|
key: 0,
|
|
155
|
-
series:
|
|
156
|
-
unstyled:
|
|
157
|
-
}, null, 8, ["series", "unstyled"])) :
|
|
158
|
-
|
|
159
|
-
width:
|
|
160
|
-
height:
|
|
161
|
-
viewBox: `0 0 ${
|
|
200
|
+
series: P.value,
|
|
201
|
+
unstyled: k.unstyled
|
|
202
|
+
}, null, 8, ["series", "unstyled"])) : p("", !0),
|
|
203
|
+
h("div", { class: v(A.value ? void 0 : Q.value.plot()) }, [(x(), m("svg", {
|
|
204
|
+
width: E(M),
|
|
205
|
+
height: k.height,
|
|
206
|
+
viewBox: `0 0 ${E(M)} ${k.height}`,
|
|
162
207
|
"aria-hidden": "true",
|
|
163
|
-
class:
|
|
208
|
+
class: v($("svg"))
|
|
164
209
|
}, [
|
|
165
|
-
|
|
166
|
-
x1:
|
|
167
|
-
y1:
|
|
168
|
-
x2:
|
|
169
|
-
y2:
|
|
210
|
+
k.axis ? (x(!0), m(d, { key: 0 }, C(L.value.ticks, (e) => (x(), m("g", { key: `tick-${e}` }, [h("line", {
|
|
211
|
+
x1: L.value.plot.left,
|
|
212
|
+
y1: L.value.y(e),
|
|
213
|
+
x2: L.value.plot.left + L.value.plot.width,
|
|
214
|
+
y2: L.value.y(e),
|
|
170
215
|
"stroke-width": "1",
|
|
171
|
-
class:
|
|
172
|
-
}, null, 10,
|
|
173
|
-
x:
|
|
174
|
-
y:
|
|
216
|
+
class: v($("grid"))
|
|
217
|
+
}, null, 10, O), h("text", {
|
|
218
|
+
x: L.value.plot.left - E(8),
|
|
219
|
+
y: L.value.y(e),
|
|
175
220
|
"text-anchor": "end",
|
|
176
221
|
"dominant-baseline": "middle",
|
|
177
|
-
class:
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
222
|
+
class: v($("tick"))
|
|
223
|
+
}, T(N(e)), 11, re)]))), 128)) : p("", !0),
|
|
224
|
+
w(e.$slots, "underlay", y(_(L.value))),
|
|
225
|
+
B.value ? (x(), m("defs", ie, [h("linearGradient", {
|
|
226
|
+
id: G,
|
|
227
|
+
x1: "0",
|
|
228
|
+
y1: "0",
|
|
229
|
+
x2: "0",
|
|
230
|
+
y2: "1"
|
|
231
|
+
}, [...t[1] ||= [h("stop", {
|
|
232
|
+
offset: "0%",
|
|
233
|
+
"stop-color": "currentColor",
|
|
234
|
+
"stop-opacity": "0.35"
|
|
235
|
+
}, null, -1), h("stop", {
|
|
236
|
+
offset: "100%",
|
|
237
|
+
"stop-color": "currentColor",
|
|
238
|
+
"stop-opacity": "0"
|
|
239
|
+
}, null, -1)]]), h("clipPath", { id: K }, [h("rect", {
|
|
240
|
+
x: L.value.plot.left,
|
|
241
|
+
y: L.value.plot.top,
|
|
242
|
+
width: L.value.plot.width,
|
|
243
|
+
height: L.value.plot.height,
|
|
244
|
+
style: b(be.value)
|
|
245
|
+
}, null, 12, ae)])])) : p("", !0),
|
|
246
|
+
Y.value == null ? p("", !0) : (x(), m("line", {
|
|
187
247
|
key: 2,
|
|
188
|
-
x1:
|
|
189
|
-
y1:
|
|
190
|
-
x2:
|
|
191
|
-
y2:
|
|
248
|
+
x1: Y.value,
|
|
249
|
+
y1: L.value.plot.top,
|
|
250
|
+
x2: Y.value,
|
|
251
|
+
y2: L.value.plot.top + L.value.plot.height,
|
|
192
252
|
"stroke-width": "1",
|
|
193
|
-
class:
|
|
194
|
-
}, null, 10,
|
|
195
|
-
(
|
|
253
|
+
class: v($("crosshair"))
|
|
254
|
+
}, null, 10, oe)),
|
|
255
|
+
h("g", { "clip-path": `url(#${K})` }, [(x(!0), m(d, null, C(B.value ? z.value[0].runs : [], (e, t) => (x(), m("path", {
|
|
256
|
+
key: `area-${t}`,
|
|
257
|
+
d: ve(e),
|
|
258
|
+
fill: `url(#${G})`,
|
|
259
|
+
style: b({ color: z.value[0].color }),
|
|
260
|
+
class: v($("area"))
|
|
261
|
+
}, null, 14, ce))), 128)), (x(!0), m(d, null, C(z.value, (e) => (x(), m(d, { key: `series-${e.seriesIndex}` }, [(x(!0), m(d, null, C(e.runs, (t, n) => (x(), m("path", {
|
|
196
262
|
key: `line-${e.seriesIndex}-${n}`,
|
|
197
|
-
d:
|
|
198
|
-
style:
|
|
199
|
-
class:
|
|
200
|
-
}, null, 14,
|
|
201
|
-
(
|
|
263
|
+
d: W(t),
|
|
264
|
+
style: b({ stroke: e.color }),
|
|
265
|
+
class: v($("line"))
|
|
266
|
+
}, null, 14, le))), 128))], 64))), 128))], 8, se),
|
|
267
|
+
(x(!0), m(d, null, C(J.value, (e, t) => (x(), m(d, { key: `marker-${t}` }, [h("circle", {
|
|
202
268
|
cx: e.x,
|
|
203
269
|
cy: e.y,
|
|
204
270
|
r: "6",
|
|
205
|
-
class:
|
|
206
|
-
}, null, 10,
|
|
271
|
+
class: v($("markerRing"))
|
|
272
|
+
}, null, 10, ue), h("circle", {
|
|
207
273
|
cx: e.x,
|
|
208
274
|
cy: e.y,
|
|
209
275
|
r: "4",
|
|
210
|
-
style:
|
|
211
|
-
class:
|
|
212
|
-
}, null, 14,
|
|
213
|
-
(
|
|
276
|
+
style: b({ fill: e.color }),
|
|
277
|
+
class: v($("marker"))
|
|
278
|
+
}, null, 14, de)], 64))), 128)),
|
|
279
|
+
(x(!0), m(d, null, C(k.data, (e, t) => (x(), m(d, { key: `label-${e.label}-${t}` }, [t % L.value.labelStep === 0 ? (x(), m("text", {
|
|
214
280
|
key: 0,
|
|
215
|
-
x:
|
|
216
|
-
y:
|
|
281
|
+
x: L.value.pointAt(t),
|
|
282
|
+
y: L.value.plot.top + L.value.plot.height + 14,
|
|
217
283
|
"text-anchor": "middle",
|
|
218
|
-
class:
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
-
(
|
|
284
|
+
class: v($("category"))
|
|
285
|
+
}, T(e.label), 11, fe)) : p("", !0)], 64))), 128)),
|
|
286
|
+
w(e.$slots, "overlay", y(_(L.value))),
|
|
287
|
+
(x(!0), m(d, null, C(k.data, (e, n) => (x(), m("rect", {
|
|
222
288
|
key: `hit-${e.label}-${n}`,
|
|
223
|
-
x:
|
|
224
|
-
y:
|
|
225
|
-
width:
|
|
226
|
-
height:
|
|
227
|
-
class:
|
|
228
|
-
onPointerenter: (e) =>
|
|
229
|
-
onPointerleave: t[0] ||= (e) =>
|
|
230
|
-
}, null, 42,
|
|
231
|
-
], 10,
|
|
289
|
+
x: L.value.plot.left + L.value.bandWidth * n,
|
|
290
|
+
y: L.value.plot.top,
|
|
291
|
+
width: L.value.bandWidth,
|
|
292
|
+
height: L.value.plot.height,
|
|
293
|
+
class: v(A.value ? void 0 : Q.value.hit()),
|
|
294
|
+
onPointerenter: (e) => q.value = n,
|
|
295
|
+
onPointerleave: t[0] ||= (e) => q.value = void 0
|
|
296
|
+
}, null, 42, pe))), 128))
|
|
297
|
+
], 10, ne)), X.value ? (x(), m("div", {
|
|
232
298
|
key: 0,
|
|
233
|
-
class:
|
|
234
|
-
style:
|
|
235
|
-
left: `${
|
|
236
|
-
top: `${
|
|
299
|
+
class: v($("tooltip", X.value.multi ? "flex-col items-start gap-1" : void 0)),
|
|
300
|
+
style: b({
|
|
301
|
+
left: `${X.value.x}px`,
|
|
302
|
+
top: `${X.value.y}px`,
|
|
237
303
|
transform: "translate(-50%, -100%) translateY(-12px)"
|
|
238
304
|
})
|
|
239
|
-
}, [
|
|
305
|
+
}, [h("span", { class: v($("tooltipLabel")) }, T(X.value.label), 3), X.value.multi ? (x(!0), m(d, { key: 0 }, C(X.value.rows, (e) => (x(), m("span", {
|
|
240
306
|
key: e.name,
|
|
241
307
|
class: "flex items-center gap-1.5"
|
|
242
308
|
}, [
|
|
243
|
-
|
|
309
|
+
h("span", {
|
|
244
310
|
class: "size-2 shrink-0 rounded-full",
|
|
245
|
-
style:
|
|
311
|
+
style: b({ background: e.color })
|
|
246
312
|
}, null, 4),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
]))), 128)) : (
|
|
313
|
+
h("span", { class: v($("tooltipLabel")) }, T(e.name), 3),
|
|
314
|
+
h("span", { class: v($("tooltipValue")) }, T(e.value), 3)
|
|
315
|
+
]))), 128)) : (x(), m("span", {
|
|
250
316
|
key: 1,
|
|
251
|
-
class:
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
317
|
+
class: v($("tooltipValue"))
|
|
318
|
+
}, T(X.value.rows[0].value), 3))], 6)) : p("", !0)], 2),
|
|
319
|
+
h("div", { class: v($("table")) }, [h("table", null, [
|
|
320
|
+
h("caption", null, T(k.label), 1),
|
|
321
|
+
h("thead", null, [h("tr", null, [t[2] ||= h("th", { scope: "col" }, " Category ", -1), (x(!0), m(d, null, C(P.value, (e) => (x(), m("th", {
|
|
256
322
|
key: e.key,
|
|
257
323
|
scope: "col"
|
|
258
|
-
},
|
|
259
|
-
|
|
260
|
-
], 2)
|
|
261
|
-
], 10,
|
|
324
|
+
}, T(e.name ?? "Value"), 1))), 128))])]),
|
|
325
|
+
h("tbody", null, [(x(!0), m(d, null, C(k.data, (e, t) => (x(), m("tr", { key: `row-${e.label}-${t}` }, [h("th", me, T(e.label), 1), (x(!0), m(d, null, C(P.value, (t) => (x(), m("td", { key: t.key }, T(I(e, t.key) == null ? "—" : N(I(e, t.key))), 1))), 128))]))), 128))])
|
|
326
|
+
])], 2)
|
|
327
|
+
], 10, te));
|
|
262
328
|
}
|
|
263
329
|
});
|
|
264
330
|
//#endregion
|
|
265
|
-
export {
|
|
331
|
+
export { k as default };
|
|
@@ -61,8 +61,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
61
61
|
}>, {
|
|
62
62
|
unstyled: boolean;
|
|
63
63
|
closeLabel: string;
|
|
64
|
-
align: "start" | "center" | "end";
|
|
65
64
|
side: "top" | "right" | "bottom" | "left";
|
|
65
|
+
align: "start" | "center" | "end";
|
|
66
66
|
sideOffset: number;
|
|
67
67
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
68
68
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChartAnimate } from '../composables/chart-reveal';
|
|
1
2
|
import type { SparseValue } from '../composables/scale';
|
|
2
3
|
export interface SparklineProps {
|
|
3
4
|
/** Values, oldest first. `null` is a gap in the series, not a zero. */
|
|
@@ -21,6 +22,13 @@ export interface SparklineProps {
|
|
|
21
22
|
label?: string;
|
|
22
23
|
/** Rendered height in px. Width always fills the container. */
|
|
23
24
|
height?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Draw the line on across the box on the first paint. Off by default here,
|
|
27
|
+
* unlike the full-size charts: a sparkline usually sits inside a stat tile
|
|
28
|
+
* or a table row, and a page of them animating at once is a distraction
|
|
29
|
+
* rather than an arrival.
|
|
30
|
+
*/
|
|
31
|
+
animate?: ChartAnimate;
|
|
24
32
|
/** Skip built-in classes; you take over styling entirely. */
|
|
25
33
|
unstyled?: boolean;
|
|
26
34
|
class?: string;
|
|
@@ -31,6 +39,7 @@ declare const __VLS_export: import("vue").DefineComponent<SparklineProps, {}, {}
|
|
|
31
39
|
variant: "line" | "area";
|
|
32
40
|
unstyled: boolean;
|
|
33
41
|
data: readonly SparseValue[];
|
|
42
|
+
animate: ChartAnimate;
|
|
34
43
|
height: number;
|
|
35
44
|
baseline: "min" | "zero";
|
|
36
45
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|