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.
@@ -3,35 +3,35 @@ 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
4
  import { useChartAnimation as s, useChartReveal as c } from "../composables/chart-reveal.js";
5
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 te } from "vue";
6
+ import { lineChartTheme as ee } from "../theme/line-chart.js";
7
+ import { Fragment as u, computed as d, createBlock as te, createCommentVNode as f, createElementBlock as p, createElementVNode as m, defineComponent as h, guardReactiveProps as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, openBlock as b, ref as x, renderList as S, renderSlot as C, toDisplayString as w, unref as T, useId as E } from "vue";
8
8
  //#region src/components/LineChart.vue?vue&type=script&setup=true&lang.ts
9
- var ne = ["role", "aria-label"], re = [
9
+ var ne = ["role", "aria-label"], D = [
10
10
  "width",
11
11
  "height",
12
12
  "viewBox"
13
- ], ie = [
13
+ ], re = [
14
14
  "x1",
15
15
  "y1",
16
16
  "x2",
17
17
  "y2"
18
- ], ae = ["x", "y"], oe = [
18
+ ], ie = ["x", "y"], ae = [
19
19
  "x",
20
20
  "y",
21
21
  "width",
22
22
  "height"
23
- ], se = [
23
+ ], oe = [
24
24
  "x1",
25
25
  "y1",
26
26
  "x2",
27
27
  "y2"
28
- ], ce = ["clip-path"], le = ["d", "fill"], ue = ["d"], de = ["d"], fe = ["cx", "cy"], pe = ["cx", "cy"], me = ["x", "y"], he = [
28
+ ], se = ["clip-path"], ce = ["d", "fill"], le = ["d"], ue = ["d"], de = ["cx", "cy"], fe = ["cx", "cy"], pe = ["x", "y"], me = [
29
29
  "x",
30
30
  "y",
31
31
  "width",
32
32
  "height",
33
33
  "onPointerenter"
34
- ], ge = { scope: "row" }, D = /*@__PURE__*/ g({
34
+ ], he = { scope: "row" }, O = /*@__PURE__*/ h({
35
35
  __name: "LineChart",
36
36
  props: {
37
37
  data: { default: () => [] },
@@ -75,47 +75,47 @@ var ne = ["role", "aria-label"], re = [
75
75
  ] },
76
76
  ui: {}
77
77
  },
78
- setup(g) {
79
- let D = g, _e = e(), O = f(() => D.unstyled ?? _e.unstyled), k = S(), { width: A } = t(k), ve = f(() => new Intl.NumberFormat(D.locale, D.format));
80
- function j(e) {
81
- return ve.value.format(e);
78
+ setup(h) {
79
+ let O = h, ge = e(), k = d(() => O.unstyled ?? ge.unstyled), A = x(), { width: j } = t(A), _e = d(() => new Intl.NumberFormat(O.locale, O.format));
80
+ function M(e) {
81
+ return _e.value.format(e);
82
82
  }
83
- let M = f(() => {
84
- let e = D.series?.length ? [...D.series] : [{ key: "value" }];
83
+ let N = d(() => {
84
+ let e = O.series?.length ? [...O.series] : [{ key: "value" }];
85
85
  return o(e.length), e;
86
- }), N = f(() => M.value.length > 1), ye = f(() => N.value || D.legend && M.value[0].name != null);
87
- function P(e, t) {
86
+ }), P = d(() => N.value.length > 1), ve = d(() => P.value || O.legend && N.value[0].name != null);
87
+ function F(e, t) {
88
88
  let n = e[t];
89
89
  return typeof n == "number" && Number.isFinite(n) ? n : null;
90
90
  }
91
- let F = f(() => D.variant === "stacked" && N.value), I = f(() => D.data.map((e) => M.value.reduce((t, n) => {
91
+ let I = d(() => O.variant === "stacked" && P.value), L = d(() => O.data.map((e) => N.value.reduce((t, n) => {
92
92
  let r = t[t.length - 1] ?? 0;
93
- return t.push(r + (P(e, n.key) ?? 0)), t;
94
- }, []))), L = f(() => n({
95
- values: F.value ? I.value.map((e) => e[e.length - 1]) : D.data.flatMap((e) => M.value.map((t) => P(e, t.key))),
96
- categories: D.data.length,
97
- longestLabel: Math.max(...D.data.map((e) => e.label.length), 1),
98
- width: A.value,
99
- height: D.height,
100
- tickCount: D.ticks,
101
- showAxis: D.axis,
102
- formatTick: j,
103
- includeZero: D.zero || F.value
93
+ return t.push(r + (F(e, n.key) ?? 0)), t;
94
+ }, []))), R = d(() => n({
95
+ values: I.value ? L.value.map((e) => e[e.length - 1]) : O.data.flatMap((e) => N.value.map((t) => F(e, t.key))),
96
+ categories: O.data.length,
97
+ longestLabel: Math.max(...O.data.map((e) => e.label.length), 1),
98
+ width: j.value,
99
+ height: O.height,
100
+ tickCount: O.ticks,
101
+ showAxis: O.axis,
102
+ formatTick: M,
103
+ includeZero: O.zero || I.value
104
104
  }));
105
- function R(e) {
105
+ function z(e) {
106
106
  return Math.round(e * 100) / 100;
107
107
  }
108
- let z = f(() => A.value ? M.value.map((e, t) => {
108
+ let B = d(() => j.value ? N.value.map((e, t) => {
109
109
  let n = [], r = [];
110
- return D.data.forEach((i, a) => {
111
- let o = F.value ? I.value[a][t] : P(i, e.key);
110
+ return O.data.forEach((i, a) => {
111
+ let o = I.value ? L.value[a][t] : F(i, e.key);
112
112
  if (o == null) {
113
113
  r.length && n.push(r), r = [];
114
114
  return;
115
115
  }
116
116
  r.push({
117
- x: R(L.value.pointAt(a)),
118
- y: R(L.value.y(o)),
117
+ x: z(R.value.pointAt(a)),
118
+ y: z(R.value.y(o)),
119
119
  index: a
120
120
  });
121
121
  }), r.length && n.push(r), {
@@ -123,57 +123,72 @@ var ne = ["role", "aria-label"], re = [
123
123
  color: i(a(e, t)),
124
124
  seriesIndex: t
125
125
  };
126
- }) : []), B = f(() => (D.variant === "area" || D.variant === "stacked") && !N.value && z.value.length > 0), be = f(() => !F.value || !A.value ? [] : M.value.map((e, t) => ({
127
- top: D.data.map((e, n) => ({
128
- x: R(L.value.pointAt(n)),
129
- y: R(L.value.y(I.value[n][t])),
126
+ }) : []), V = d(() => (O.variant === "area" || O.variant === "stacked") && !P.value && B.value.length > 0), ye = d(() => !I.value || !j.value ? [] : N.value.map((e, t) => ({
127
+ top: O.data.map((e, n) => ({
128
+ x: z(R.value.pointAt(n)),
129
+ y: z(R.value.y(L.value[n][t])),
130
130
  index: n
131
131
  })),
132
- base: D.data.map((e, n) => ({
133
- x: R(L.value.pointAt(n)),
134
- y: R(L.value.y(t === 0 ? 0 : I.value[n][t - 1])),
132
+ base: O.data.map((e, n) => ({
133
+ x: z(R.value.pointAt(n)),
134
+ y: z(R.value.y(t === 0 ? 0 : L.value[n][t - 1])),
135
135
  index: n
136
136
  })),
137
137
  color: i(a(e, t)),
138
138
  seriesIndex: t
139
- }))), V = f(() => {
140
- let e = D.data?.length ?? 0;
139
+ }))), be = d(() => {
140
+ let e = O.data?.length ?? 0;
141
141
  return {
142
- first: e ? R(L.value.pointAt(0)) : 0,
143
- last: e ? R(L.value.pointAt(e - 1)) : 0,
144
- left: R(L.value.plot.left),
145
- right: R(L.value.plot.left + L.value.plot.width)
142
+ first: e ? z(R.value.pointAt(0)) : 0,
143
+ last: e ? z(R.value.pointAt(e - 1)) : 0,
144
+ left: z(R.value.plot.left),
145
+ right: z(R.value.plot.left + R.value.plot.width)
146
146
  };
147
147
  });
148
148
  function H(e) {
149
- return D.flush && e.x === V.value.last ? `L${V.value.right} ${e.y}` : "";
150
- }
151
- let U = f(() => Math.min(Math.max(D.tension, 0), 1) / 6);
152
- function W(e) {
153
- let t = e[0], n = e[e.length - 1], r = D.flush && t.x === V.value.first ? `M${V.value.left} ${t.y} L${t.x} ${t.y}` : `M${t.x} ${t.y}`;
154
- if (U.value === 0 || e.length < 2) return [
155
- r,
156
- ...e.slice(1).map((e) => `L${e.x} ${e.y}`),
157
- H(n)
158
- ].filter(Boolean).join(" ");
159
- let i = (e, t, n) => Math.min(Math.max(e, Math.min(t, n)), Math.max(t, n));
149
+ let t = e[0], n = e[e.length - 1];
150
+ if (!O.flush) return e;
151
+ let { first: r, last: i, left: a, right: o } = be.value, s = t.x === r ? a : t.x === i ? o : void 0, c = n.x === i ? o : n.x === r ? a : void 0;
160
152
  return [
161
- r,
162
- ...e.slice(1).map((t, n) => {
163
- 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);
164
- return `C${R(c)} ${R(l)}, ${R(u)} ${R(d)}, ${o.x} ${o.y}`;
165
- }),
166
- H(n)
167
- ].filter(Boolean).join(" ");
153
+ ...s != null && s !== t.x ? [{
154
+ ...t,
155
+ x: s
156
+ }] : [],
157
+ ...e,
158
+ ...c != null && c !== n.x ? [{
159
+ ...n,
160
+ x: c
161
+ }] : []
162
+ ];
168
163
  }
164
+ let U = d(() => Math.min(Math.max(O.tension, 0), 1));
169
165
  function xe(e) {
170
- let t = L.value.plot.top + L.value.plot.height, n = e[0], r = e[e.length - 1], i = D.flush && n.x === V.value.first ? V.value.left : n.x, a = D.flush && r.x === V.value.last ? V.value.right : r.x;
171
- return `${W(e)} L${a} ${t} L${i} ${t} Z`;
166
+ let t = e.slice(1).map((t, n) => (t.y - e[n].y) / (t.x - e[n].x || 1));
167
+ return e.map((n, r) => {
168
+ let i = t[r - 1], a = t[r];
169
+ if (i == null || a == null) return i ?? a ?? 0;
170
+ if (i * a <= 0) return 0;
171
+ let o = e[r - 1], s = e[r + 1], c = (s.y - o.y) / (s.x - o.x), l = 3 * Math.min(Math.abs(i), Math.abs(a));
172
+ return Math.sign(c) * Math.min(Math.abs(c), l);
173
+ });
172
174
  }
173
- function Se(e, t) {
175
+ function W(e) {
176
+ let t = H(e), n = `M${t[0].x} ${t[0].y}`;
177
+ if (U.value === 0 || t.length < 2) return [n, ...t.slice(1).map((e) => `L${e.x} ${e.y}`)].join(" ");
178
+ let r = xe(t);
179
+ return [n, ...t.slice(1).map((e, n) => {
180
+ let i = t[n], a = (e.x - i.x) / 3 * U.value, o = i.x + a, s = i.y + r[n] * a, c = e.x - a, l = e.y - r[n + 1] * a;
181
+ return `C${z(o)} ${z(s)}, ${z(c)} ${z(l)}, ${e.x} ${e.y}`;
182
+ })].join(" ");
183
+ }
184
+ function Se(e) {
185
+ let t = R.value.plot.top + R.value.plot.height, n = H(e);
186
+ return `${W(e)} L${n[n.length - 1].x} ${t} L${n[0].x} ${t} Z`;
187
+ }
188
+ function Ce(e, t) {
174
189
  return `${W(e)} ${W([...t].reverse()).replace("M", "L")} Z`;
175
190
  }
176
- let G = `iryx-area-${te()}`, K = `iryx-plot-clip-${te()}`, q = S(), J = f(() => q.value == null ? [] : z.value.flatMap((e) => {
191
+ let G = `iryx-area-${E()}`, K = `iryx-plot-clip-${E()}`, q = x(), J = d(() => q.value == null ? [] : B.value.flatMap((e) => {
177
192
  for (let t of e.runs) {
178
193
  let n = t.find((e) => e.index === q.value);
179
194
  if (n) return [{
@@ -182,184 +197,184 @@ var ne = ["role", "aria-label"], re = [
182
197
  }];
183
198
  }
184
199
  return [];
185
- })), Y = f(() => q.value == null ? void 0 : R(L.value.pointAt(q.value))), X = f(() => {
200
+ })), Y = d(() => q.value == null ? void 0 : z(R.value.pointAt(q.value))), X = d(() => {
186
201
  if (q.value == null) return;
187
- let e = D.data[q.value];
202
+ let e = O.data[q.value];
188
203
  if (!e) return;
189
- let t = M.value.map((t, n) => ({
204
+ let t = N.value.map((t, n) => ({
190
205
  name: t.name ?? t.key,
191
206
  color: i(a(t, n)),
192
- value: P(e, t.key)
207
+ value: F(e, t.key)
193
208
  })).filter((e) => e.value != null).map((e) => ({
194
209
  ...e,
195
- value: j(e.value)
210
+ value: M(e.value)
196
211
  }));
197
212
  if (!t.length) return;
198
- let n = N.value ? Math.max(e.label.length, ...t.map((e) => e.name.length + e.value.length + 3)) : e.label.length + t[0].value.length + 2;
213
+ let n = P.value ? Math.max(e.label.length, ...t.map((e) => e.name.length + e.value.length + 3)) : e.label.length + t[0].value.length + 2;
199
214
  return {
200
215
  label: e.label,
201
216
  rows: t,
202
- multi: N.value,
203
- x: r(L.value.pointAt(q.value), "x".repeat(n), A.value),
204
- y: Math.min(...J.value.map((e) => e.y), L.value.plot.top + L.value.plot.height)
217
+ multi: P.value,
218
+ x: r(R.value.pointAt(q.value), "x".repeat(n), j.value),
219
+ y: Math.min(...J.value.map((e) => e.y), R.value.plot.top + R.value.plot.height)
205
220
  };
206
- }), Z = s(f(() => D.animate)), { revealed: Ce } = c(f(() => !!(A.value && z.value.length)), Z), we = f(() => ({
207
- transform: `scaleX(${+!!Ce.value})`,
208
- transformOrigin: `${L.value.plot.left}px 0px`,
221
+ }), Z = s(d(() => O.animate)), { revealed: we } = c(d(() => !!(j.value && B.value.length)), Z), Te = d(() => ({
222
+ transform: `scaleX(${+!!we.value})`,
223
+ transformOrigin: `${R.value.plot.left}px 0px`,
209
224
  transition: `transform ${Z.value.duration}ms ${Z.value.css}`
210
- })), Q = f(() => u());
225
+ })), Q = d(() => ee());
211
226
  function $(e, t) {
212
- let n = D.ui?.[e];
213
- return O.value ? [n, t] : Q.value[e]({ class: [n, t] });
227
+ let n = O.ui?.[e];
228
+ return k.value ? [n, t] : Q.value[e]({ class: [n, t] });
214
229
  }
215
- return (e, t) => (x(), m("div", {
230
+ return (e, t) => (b(), p("div", {
216
231
  ref_key: "root",
217
- ref: k,
218
- role: D.label ? "figure" : void 0,
219
- "aria-label": D.label,
220
- class: v($("root", D.class))
232
+ ref: A,
233
+ role: O.label ? "figure" : void 0,
234
+ "aria-label": O.label,
235
+ class: _($("root", O.class))
221
236
  }, [
222
- ye.value ? (x(), ee(l, {
237
+ ve.value ? (b(), te(l, {
223
238
  key: 0,
224
- series: M.value,
225
- unstyled: D.unstyled
226
- }, null, 8, ["series", "unstyled"])) : p("", !0),
227
- h("div", { class: v(O.value ? void 0 : Q.value.plot()) }, [(x(), m("svg", {
228
- width: E(A),
229
- height: D.height,
230
- viewBox: `0 0 ${E(A)} ${D.height}`,
239
+ series: N.value,
240
+ unstyled: O.unstyled
241
+ }, null, 8, ["series", "unstyled"])) : f("", !0),
242
+ m("div", { class: _(k.value ? void 0 : Q.value.plot()) }, [(b(), p("svg", {
243
+ width: T(j),
244
+ height: O.height,
245
+ viewBox: `0 0 ${T(j)} ${O.height}`,
231
246
  "aria-hidden": "true",
232
- class: v($("svg"))
247
+ class: _($("svg"))
233
248
  }, [
234
- D.axis ? (x(!0), m(d, { key: 0 }, C(L.value.ticks, (e) => (x(), m("g", { key: `tick-${e}` }, [h("line", {
235
- x1: L.value.plot.left,
236
- y1: L.value.y(e),
237
- x2: L.value.plot.left + L.value.plot.width,
238
- y2: L.value.y(e),
249
+ O.axis ? (b(!0), p(u, { key: 0 }, S(R.value.ticks, (e) => (b(), p("g", { key: `tick-${e}` }, [m("line", {
250
+ x1: R.value.plot.left,
251
+ y1: R.value.y(e),
252
+ x2: R.value.plot.left + R.value.plot.width,
253
+ y2: R.value.y(e),
239
254
  "stroke-width": "1",
240
- class: v($("grid"))
241
- }, null, 10, ie), h("text", {
242
- x: L.value.plot.left - E(8),
243
- y: L.value.y(e),
255
+ class: _($("grid"))
256
+ }, null, 10, re), m("text", {
257
+ x: R.value.plot.left - T(8),
258
+ y: R.value.y(e),
244
259
  "text-anchor": "end",
245
260
  "dominant-baseline": "middle",
246
- class: v($("tick"))
247
- }, T(j(e)), 11, ae)]))), 128)) : p("", !0),
248
- w(e.$slots, "underlay", y(_(L.value))),
249
- h("defs", null, [B.value ? (x(), m("linearGradient", {
261
+ class: _($("tick"))
262
+ }, w(M(e)), 11, ie)]))), 128)) : f("", !0),
263
+ C(e.$slots, "underlay", v(g(R.value))),
264
+ m("defs", null, [V.value ? (b(), p("linearGradient", {
250
265
  key: 0,
251
266
  id: G,
252
267
  x1: "0",
253
268
  y1: "0",
254
269
  x2: "0",
255
270
  y2: "1"
256
- }, [...t[1] ||= [h("stop", {
271
+ }, [...t[1] ||= [m("stop", {
257
272
  offset: "0%",
258
273
  "stop-color": "currentColor",
259
274
  "stop-opacity": "0.35"
260
- }, null, -1), h("stop", {
275
+ }, null, -1), m("stop", {
261
276
  offset: "100%",
262
277
  "stop-color": "currentColor",
263
278
  "stop-opacity": "0"
264
- }, null, -1)]])) : p("", !0), h("clipPath", { id: K }, [h("rect", {
265
- x: L.value.plot.left,
266
- y: L.value.plot.top,
267
- width: L.value.plot.width,
268
- height: L.value.plot.height,
269
- style: b(we.value)
270
- }, null, 12, oe)])]),
271
- Y.value == null ? p("", !0) : (x(), m("line", {
279
+ }, null, -1)]])) : f("", !0), m("clipPath", { id: K }, [m("rect", {
280
+ x: R.value.plot.left,
281
+ y: R.value.plot.top,
282
+ width: R.value.plot.width,
283
+ height: R.value.plot.height,
284
+ style: y(Te.value)
285
+ }, null, 12, ae)])]),
286
+ Y.value == null ? f("", !0) : (b(), p("line", {
272
287
  key: 1,
273
288
  x1: Y.value,
274
- y1: L.value.plot.top,
289
+ y1: R.value.plot.top,
275
290
  x2: Y.value,
276
- y2: L.value.plot.top + L.value.plot.height,
291
+ y2: R.value.plot.top + R.value.plot.height,
277
292
  "stroke-width": "1",
278
- class: v($("crosshair"))
279
- }, null, 10, se)),
280
- h("g", { "clip-path": `url(#${K})` }, [
281
- (x(!0), m(d, null, C(B.value ? z.value[0].runs : [], (e, t) => (x(), m("path", {
293
+ class: _($("crosshair"))
294
+ }, null, 10, oe)),
295
+ m("g", { "clip-path": `url(#${K})` }, [
296
+ (b(!0), p(u, null, S(V.value ? B.value[0].runs : [], (e, t) => (b(), p("path", {
282
297
  key: `area-${t}`,
283
- d: xe(e),
298
+ d: Se(e),
284
299
  fill: `url(#${G})`,
285
- style: b({ color: z.value[0].color }),
286
- class: v($("area"))
287
- }, null, 14, le))), 128)),
288
- (x(!0), m(d, null, C(be.value, (e) => (x(), m("path", {
300
+ style: y({ color: B.value[0].color }),
301
+ class: _($("area"))
302
+ }, null, 14, ce))), 128)),
303
+ (b(!0), p(u, null, S(ye.value, (e) => (b(), p("path", {
289
304
  key: `band-${e.seriesIndex}`,
290
- d: Se(e.top, e.base),
291
- style: b({ fill: e.color }),
292
- class: v($("band"))
293
- }, null, 14, ue))), 128)),
294
- (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", {
305
+ d: Ce(e.top, e.base),
306
+ style: y({ fill: e.color }),
307
+ class: _($("band"))
308
+ }, null, 14, le))), 128)),
309
+ (b(!0), p(u, null, S(B.value, (e) => (b(), p(u, { key: `series-${e.seriesIndex}` }, [(b(!0), p(u, null, S(e.runs, (t, n) => (b(), p("path", {
295
310
  key: `line-${e.seriesIndex}-${n}`,
296
311
  d: W(t),
297
- style: b({ stroke: e.color }),
298
- class: v($("line"))
299
- }, null, 14, de))), 128))], 64))), 128))
300
- ], 8, ce),
301
- (x(!0), m(d, null, C(J.value, (e, t) => (x(), m(d, { key: `marker-${t}` }, [h("circle", {
312
+ style: y({ stroke: e.color }),
313
+ class: _($("line"))
314
+ }, null, 14, ue))), 128))], 64))), 128))
315
+ ], 8, se),
316
+ (b(!0), p(u, null, S(J.value, (e, t) => (b(), p(u, { key: `marker-${t}` }, [m("circle", {
302
317
  cx: e.x,
303
318
  cy: e.y,
304
319
  r: "6",
305
- class: v($("markerRing"))
306
- }, null, 10, fe), h("circle", {
320
+ class: _($("markerRing"))
321
+ }, null, 10, de), m("circle", {
307
322
  cx: e.x,
308
323
  cy: e.y,
309
324
  r: "4",
310
- style: b({ fill: e.color }),
311
- class: v($("marker"))
312
- }, null, 14, pe)], 64))), 128)),
313
- (x(!0), m(d, null, C(D.data, (e, t) => (x(), m(d, { key: `label-${e.label}-${t}` }, [t % L.value.labelStep === 0 ? (x(), m("text", {
325
+ style: y({ fill: e.color }),
326
+ class: _($("marker"))
327
+ }, null, 14, fe)], 64))), 128)),
328
+ (b(!0), p(u, null, S(O.data, (e, t) => (b(), p(u, { key: `label-${e.label}-${t}` }, [t % R.value.labelStep === 0 ? (b(), p("text", {
314
329
  key: 0,
315
- x: L.value.pointAt(t),
316
- y: L.value.plot.top + L.value.plot.height + 14,
330
+ x: R.value.pointAt(t),
331
+ y: R.value.plot.top + R.value.plot.height + 14,
317
332
  "text-anchor": "middle",
318
- class: v($("category"))
319
- }, T(e.label), 11, me)) : p("", !0)], 64))), 128)),
320
- w(e.$slots, "overlay", y(_(L.value))),
321
- (x(!0), m(d, null, C(D.data, (e, n) => (x(), m("rect", {
333
+ class: _($("category"))
334
+ }, w(e.label), 11, pe)) : f("", !0)], 64))), 128)),
335
+ C(e.$slots, "overlay", v(g(R.value))),
336
+ (b(!0), p(u, null, S(O.data, (e, n) => (b(), p("rect", {
322
337
  key: `hit-${e.label}-${n}`,
323
- x: L.value.plot.left + L.value.bandWidth * n,
324
- y: L.value.plot.top,
325
- width: L.value.bandWidth,
326
- height: L.value.plot.height,
327
- class: v(O.value ? void 0 : Q.value.hit()),
338
+ x: R.value.plot.left + R.value.bandWidth * n,
339
+ y: R.value.plot.top,
340
+ width: R.value.bandWidth,
341
+ height: R.value.plot.height,
342
+ class: _(k.value ? void 0 : Q.value.hit()),
328
343
  onPointerenter: (e) => q.value = n,
329
344
  onPointerleave: t[0] ||= (e) => q.value = void 0
330
- }, null, 42, he))), 128))
331
- ], 10, re)), X.value ? (x(), m("div", {
345
+ }, null, 42, me))), 128))
346
+ ], 10, D)), X.value ? (b(), p("div", {
332
347
  key: 0,
333
- class: v($("tooltip", X.value.multi ? "flex-col items-start gap-1" : void 0)),
334
- style: b({
348
+ class: _($("tooltip", X.value.multi ? "flex-col items-start gap-1" : void 0)),
349
+ style: y({
335
350
  left: `${X.value.x}px`,
336
351
  top: `${X.value.y}px`,
337
352
  transform: "translate(-50%, -100%) translateY(-12px)"
338
353
  })
339
- }, [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", {
354
+ }, [m("span", { class: _($("tooltipLabel")) }, w(X.value.label), 3), X.value.multi ? (b(!0), p(u, { key: 0 }, S(X.value.rows, (e) => (b(), p("span", {
340
355
  key: e.name,
341
356
  class: "flex items-center gap-1.5"
342
357
  }, [
343
- h("span", {
358
+ m("span", {
344
359
  class: "size-2 shrink-0 rounded-full",
345
- style: b({ background: e.color })
360
+ style: y({ background: e.color })
346
361
  }, null, 4),
347
- h("span", { class: v($("tooltipLabel")) }, T(e.name), 3),
348
- h("span", { class: v($("tooltipValue")) }, T(e.value), 3)
349
- ]))), 128)) : (x(), m("span", {
362
+ m("span", { class: _($("tooltipLabel")) }, w(e.name), 3),
363
+ m("span", { class: _($("tooltipValue")) }, w(e.value), 3)
364
+ ]))), 128)) : (b(), p("span", {
350
365
  key: 1,
351
- class: v($("tooltipValue"))
352
- }, T(X.value.rows[0].value), 3))], 6)) : p("", !0)], 2),
353
- h("div", { class: v($("table")) }, [h("table", null, [
354
- h("caption", null, T(D.label), 1),
355
- h("thead", null, [h("tr", null, [t[2] ||= h("th", { scope: "col" }, " Category ", -1), (x(!0), m(d, null, C(M.value, (e) => (x(), m("th", {
366
+ class: _($("tooltipValue"))
367
+ }, w(X.value.rows[0].value), 3))], 6)) : f("", !0)], 2),
368
+ m("div", { class: _($("table")) }, [m("table", null, [
369
+ m("caption", null, w(O.label), 1),
370
+ m("thead", null, [m("tr", null, [t[2] ||= m("th", { scope: "col" }, " Category ", -1), (b(!0), p(u, null, S(N.value, (e) => (b(), p("th", {
356
371
  key: e.key,
357
372
  scope: "col"
358
- }, T(e.name ?? "Value"), 1))), 128))])]),
359
- h("tbody", null, [(x(!0), m(d, null, C(D.data, (e, t) => (x(), m("tr", { key: `row-${e.label}-${t}` }, [h("th", ge, T(e.label), 1), (x(!0), m(d, null, C(M.value, (t) => (x(), m("td", { key: t.key }, T(P(e, t.key) == null ? "—" : j(P(e, t.key))), 1))), 128))]))), 128))])
373
+ }, w(e.name ?? "Value"), 1))), 128))])]),
374
+ m("tbody", null, [(b(!0), p(u, null, S(O.data, (e, t) => (b(), p("tr", { key: `row-${e.label}-${t}` }, [m("th", he, w(e.label), 1), (b(!0), p(u, null, S(N.value, (t) => (b(), p("td", { key: t.key }, w(F(e, t.key) == null ? "—" : M(F(e, t.key))), 1))), 128))]))), 128))])
360
375
  ])], 2)
361
376
  ], 10, ne));
362
377
  }
363
378
  });
364
379
  //#endregion
365
- export { D as default };
380
+ export { O as default };
@@ -18,6 +18,8 @@ export interface SelectProps extends SelectRootProps {
18
18
  */
19
19
  items?: SelectItems;
20
20
  placeholder?: string;
21
+ /** Arrow keys wrap from the last option to the first and back. */
22
+ loop?: boolean;
21
23
  size?: 'sm' | 'md' | 'lg';
22
24
  /** Lands on the trigger, so a `<label for>` names the control. */
23
25
  id?: string;
@@ -12,6 +12,7 @@ var F = /*@__PURE__*/ d({
12
12
  props: {
13
13
  items: {},
14
14
  placeholder: {},
15
+ loop: { type: Boolean },
15
16
  size: {},
16
17
  id: {},
17
18
  invalid: {
@@ -45,8 +46,8 @@ var F = /*@__PURE__*/ d({
45
46
  emits: ["update:modelValue", "update:open"],
46
47
  setup(d, { emit: F }) {
47
48
  let I = d, L = F, R = P(a(() => {
48
- let { items: e, placeholder: t, size: n, id: r, invalid: i, unstyled: a, class: o, ui: s, ...c } = I;
49
- return c;
49
+ let { items: e, placeholder: t, loop: n, size: r, id: i, invalid: a, unstyled: o, class: s, ui: c, ...l } = I;
50
+ return l;
50
51
  }), L);
51
52
  function z(e) {
52
53
  return typeof e == "string" ? {
@@ -94,7 +95,8 @@ var F = /*@__PURE__*/ d({
94
95
  ]), u(b(ee), null, {
95
96
  default: x(() => [u(b(w), {
96
97
  class: m(X.value),
97
- position: "item-aligned"
98
+ position: "item-aligned",
99
+ loop: I.loop
98
100
  }, {
99
101
  default: x(() => [u(b(N), { class: m(Z.value) }, {
100
102
  default: x(() => [v(e.$slots, "default", {}, () => [V.value ? (g(!0), c(i, { key: 0 }, _(V.value, (e, n) => (g(), o(b(T), {
@@ -149,7 +151,7 @@ var F = /*@__PURE__*/ d({
149
151
  _: 3
150
152
  }, 8, ["class"])]),
151
153
  _: 3
152
- }, 8, ["class"])]),
154
+ }, 8, ["class", "loop"])]),
153
155
  _: 3
154
156
  })]),
155
157
  _: 3
@@ -1,5 +1,6 @@
1
1
  import type { ClassValue } from '../class-value';
2
2
  import type { SidebarItems, SidebarLink } from '../composables/sidebar';
3
+ import type { DropdownMenuProps } from './DropdownMenu.vue';
3
4
  export interface SidebarProps {
4
5
  /** Links, optionally grouped into labelled sections. */
5
6
  items?: SidebarItems;
@@ -28,6 +29,8 @@ export interface SidebarProps {
28
29
  groupIcon?: string;
29
30
  groupContent?: string;
30
31
  groupInner?: string;
32
+ /** Passed to the menu a collapsed group opens. */
33
+ menu?: DropdownMenuProps['ui'];
31
34
  };
32
35
  }
33
36
  type __VLS_Props = SidebarProps;