@gearbox-protocol/permissionless-ui 1.24.2 → 1.26.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/cjs/components/graph/formatters.cjs +1 -1
- package/dist/cjs/components/graph/graph-view.cjs +1 -1
- package/dist/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/components/graph/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/tab-control/tab-control.cjs +1 -1
- package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/graph/formatters.js +101 -80
- package/dist/esm/components/graph/graph-view.js +114 -97
- package/dist/esm/components/graph/graph.js +378 -299
- package/dist/esm/components/graph/index.js +15 -14
- package/dist/esm/components/index.js +447 -446
- package/dist/esm/components/tab-control/tab-control.js +63 -72
- package/dist/esm/components/trading-view/trading-view.js +175 -107
- package/dist/esm/index.js +583 -582
- package/dist/globals.css +1 -1
- package/dist/types/components/graph/formatters.d.ts +8 -1
- package/dist/types/components/graph/graph-view.d.ts +11 -1
- package/dist/types/components/graph/graph.d.ts +35 -3
- package/dist/types/components/graph/index.d.ts +1 -1
- package/dist/types/components/graph/plugins/vertical-line.d.ts +2 -0
- package/dist/types/components/trading-view/trading-view.d.ts +30 -1
- package/package.json +2 -2
|
@@ -1,126 +1,147 @@
|
|
|
1
|
-
import { DateTime as
|
|
2
|
-
import { isBelowDisplayThreshold as
|
|
3
|
-
const { MIN_DISPLAY_THRESHOLD:
|
|
4
|
-
if (
|
|
5
|
-
return e ? `<${
|
|
1
|
+
import { DateTime as D } from "luxon";
|
|
2
|
+
import { isBelowDisplayThreshold as L, FORMAT_CONSTANTS as G, toSignificantDigits as I, formatNumberWithSuffix as R } from "../../utils/format-number.js";
|
|
3
|
+
const { MIN_DISPLAY_THRESHOLD: f, MAX_EXPONENTIAL_THRESHOLD: p } = G, C = (t, e, r = "full") => {
|
|
4
|
+
if (L(t))
|
|
5
|
+
return e ? `<${f}${e}` : `<${f}`;
|
|
6
6
|
if (t === 0)
|
|
7
7
|
return e ? `0${e}` : "0";
|
|
8
|
-
const
|
|
9
|
-
maxExponentialThreshold:
|
|
8
|
+
const a = R(t, {
|
|
9
|
+
maxExponentialThreshold: p,
|
|
10
10
|
minimumFractionDigits: 0,
|
|
11
11
|
maximumFractionDigits: r === "short" ? 1 : 0,
|
|
12
12
|
format: r,
|
|
13
13
|
adaptiveDecimals: r === "short"
|
|
14
14
|
});
|
|
15
|
-
return e ? `${
|
|
16
|
-
},
|
|
17
|
-
if (
|
|
18
|
-
return e ? `<${
|
|
15
|
+
return e ? `${a}${e}` : a;
|
|
16
|
+
}, X = 2, H = (t, e) => {
|
|
17
|
+
if (L(t))
|
|
18
|
+
return e ? `<${f}${e}` : `<${f}`;
|
|
19
19
|
if (t === 0)
|
|
20
20
|
return e ? `0${e}` : "0";
|
|
21
|
-
const r =
|
|
21
|
+
const r = I(t, X);
|
|
22
22
|
return e ? `${r}${e}` : r;
|
|
23
|
-
},
|
|
24
|
-
if (
|
|
25
|
-
return `<${
|
|
23
|
+
}, P = 4, b = (t) => {
|
|
24
|
+
if (L(t))
|
|
25
|
+
return `<${f}`;
|
|
26
26
|
if (t === 0)
|
|
27
27
|
return "0";
|
|
28
28
|
const e = Math.round(t), r = Math.abs(t - e);
|
|
29
|
-
return r > 0 && r < 0.01 ? t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "") :
|
|
30
|
-
},
|
|
31
|
-
if (
|
|
32
|
-
return e ? `<${
|
|
29
|
+
return r > 0 && r < 0.01 ? t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "") : I(t, P);
|
|
30
|
+
}, Y = (t, e) => {
|
|
31
|
+
if (L(t))
|
|
32
|
+
return e ? `<${f} ${e}` : `<${f}`;
|
|
33
33
|
if (t === 0)
|
|
34
34
|
return e ? `0 ${e}` : "0";
|
|
35
|
-
const r = Number.isInteger(t),
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
return e ? `${
|
|
35
|
+
const r = Number.isInteger(t), a = Math.abs(t), s = r && a >= 1e3, u = Math.round(t), d = Math.abs(t - u);
|
|
36
|
+
if (d > 0 && d < 0.01 && !s) {
|
|
37
|
+
const h = t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "");
|
|
38
|
+
return e ? `${h} ${e}` : h;
|
|
39
39
|
}
|
|
40
|
-
const
|
|
41
|
-
maxExponentialThreshold:
|
|
40
|
+
const $ = R(t, {
|
|
41
|
+
maxExponentialThreshold: p,
|
|
42
42
|
minimumFractionDigits: r ? 0 : 2,
|
|
43
43
|
maximumFractionDigits: s ? 1 : r ? 0 : 2,
|
|
44
44
|
format: s ? "short" : "full",
|
|
45
45
|
adaptiveDecimals: s
|
|
46
46
|
});
|
|
47
|
-
return e ? `${
|
|
48
|
-
},
|
|
49
|
-
"%":
|
|
50
|
-
$:
|
|
51
|
-
token:
|
|
52
|
-
none:
|
|
53
|
-
},
|
|
54
|
-
function
|
|
47
|
+
return e ? `${$} ${e}` : $;
|
|
48
|
+
}, N = {
|
|
49
|
+
"%": H,
|
|
50
|
+
$: C,
|
|
51
|
+
token: Y,
|
|
52
|
+
none: b
|
|
53
|
+
}, q = (t) => N[t] || N.token;
|
|
54
|
+
function J(t, e, r = 4) {
|
|
55
55
|
if (t === 0)
|
|
56
56
|
return e ? `0 ${e}` : "0";
|
|
57
|
-
const
|
|
57
|
+
const a = t.toLocaleString("en-US", {
|
|
58
58
|
minimumFractionDigits: 0,
|
|
59
59
|
maximumFractionDigits: r
|
|
60
60
|
});
|
|
61
|
-
return e ? `${
|
|
61
|
+
return e ? `${a} ${e}` : a;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
function Q(t, e, r) {
|
|
64
|
+
const a = r?.yScaleMin;
|
|
65
|
+
let s = t.length > 0 ? Math.min(...t) : 0, u = t.length > 0 ? Math.max(...t) : 0, d = !1, F = [];
|
|
66
|
+
const $ = () => {
|
|
67
|
+
const n = u - s, o = (s + u) / 2;
|
|
67
68
|
let i = 1, m = "";
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
let
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
|
|
69
|
+
o >= 1e9 ? (i = 1e9, m = "B") : o >= 1e6 ? (i = 1e6, m = "M") : o >= 1e3 && (i = 1e3, m = "K");
|
|
70
|
+
const M = n / 10 / i;
|
|
71
|
+
let S = 1;
|
|
72
|
+
if (M > 0) {
|
|
73
|
+
const x = Math.floor(Math.log10(M));
|
|
74
|
+
S = Math.max(1, -x), S = Math.min(S, 4);
|
|
74
75
|
}
|
|
75
|
-
return { scale: i, suffix: m, decimals:
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
return { scale: i, suffix: m, decimals: S };
|
|
77
|
+
}, h = (n, o, i) => {
|
|
78
|
+
const m = o > 1 ? n / o : n, g = Math.abs(m) >= 1 ? 1 : 4;
|
|
79
|
+
return o > 1 ? `${(n / o).toLocaleString("en-US", {
|
|
80
|
+
minimumFractionDigits: 0,
|
|
81
|
+
maximumFractionDigits: g,
|
|
82
|
+
useGrouping: !1
|
|
83
|
+
})}${i}` : n.toLocaleString("en-US", {
|
|
84
|
+
minimumFractionDigits: 0,
|
|
85
|
+
maximumFractionDigits: g,
|
|
86
|
+
useGrouping: !1
|
|
87
|
+
});
|
|
88
|
+
}, O = 0.12, U = 0.02;
|
|
89
|
+
return { formatter: (n) => {
|
|
90
|
+
if (a !== void 0 && n < a) return "";
|
|
91
|
+
if (n === 0)
|
|
92
|
+
return d ? "" : (d = !0, "0");
|
|
93
|
+
n > 0 && (d = !1);
|
|
94
|
+
const { scale: o, suffix: i, decimals: m } = $(), g = u - s, l = g > 0 ? F.filter(
|
|
95
|
+
(c) => Math.abs(c) >= g * U
|
|
96
|
+
) : F, M = Math.abs(n) * 1e-10 || 1e-10;
|
|
97
|
+
if (l.some(
|
|
98
|
+
(c) => Math.abs(c - n) < M
|
|
99
|
+
))
|
|
100
|
+
return h(n, o, i);
|
|
101
|
+
if (l.length > 0) {
|
|
102
|
+
const c = l.reduce(
|
|
103
|
+
(E, A) => Math.abs(A - n) < Math.abs(E - n) ? A : E
|
|
104
|
+
);
|
|
105
|
+
if (Math.abs(n - c) / (Math.abs(c) || 1e-10) < O)
|
|
106
|
+
return h(c, o, i);
|
|
107
|
+
}
|
|
108
|
+
const x = o > 1 ? n / o : n, T = Math.abs(x) >= 1 ? Math.min(1, m) : m;
|
|
109
|
+
return o > 1 ? `${(n / o).toLocaleString("en-US", {
|
|
89
110
|
minimumFractionDigits: 0,
|
|
90
|
-
maximumFractionDigits:
|
|
111
|
+
maximumFractionDigits: T,
|
|
91
112
|
useGrouping: !1
|
|
92
|
-
})}${i}` :
|
|
113
|
+
})}${i}` : n.toLocaleString("en-US", {
|
|
93
114
|
minimumFractionDigits: 0,
|
|
94
|
-
maximumFractionDigits:
|
|
115
|
+
maximumFractionDigits: T,
|
|
95
116
|
useGrouping: !1
|
|
96
117
|
});
|
|
97
|
-
}, updateVisibleRange: (
|
|
98
|
-
|
|
99
|
-
}, updateLastValues: (
|
|
100
|
-
|
|
118
|
+
}, updateVisibleRange: (n) => {
|
|
119
|
+
n.length > 0 && (s = Math.min(...n), u = Math.max(...n));
|
|
120
|
+
}, updateLastValues: (n) => {
|
|
121
|
+
F = [...n];
|
|
101
122
|
} };
|
|
102
123
|
}
|
|
103
|
-
const
|
|
124
|
+
const k = (t) => D.fromSeconds(Number(t)).toFormat("dd/LL/yyyy HH:mm"), w = (t) => D.fromSeconds(Number(t)).toFormat("HH:mm"), z = () => {
|
|
104
125
|
let t = null;
|
|
105
126
|
return (e) => {
|
|
106
|
-
const r =
|
|
107
|
-
return
|
|
127
|
+
const r = D.fromSeconds(Number(e)), a = r.toFormat("yyyy-MM-dd");
|
|
128
|
+
return a !== t ? (t = a, r.toFormat("dd MMM")) : r.toFormat("HH:mm");
|
|
108
129
|
};
|
|
109
|
-
},
|
|
110
|
-
time:
|
|
111
|
-
"%":
|
|
112
|
-
},
|
|
130
|
+
}, B = (t, e) => H(Number(t), e), _ = {
|
|
131
|
+
time: k,
|
|
132
|
+
"%": B
|
|
133
|
+
}, v = (t, e) => {
|
|
113
134
|
if (t === "time" && e && e.length > 0) {
|
|
114
|
-
const r =
|
|
135
|
+
const r = D.fromSeconds(Number(e[0].time)), a = D.fromSeconds(
|
|
115
136
|
Number(e[e.length - 1].time)
|
|
116
137
|
);
|
|
117
|
-
return r.hasSame(
|
|
138
|
+
return r.hasSame(a, "day") ? w : z();
|
|
118
139
|
}
|
|
119
|
-
return
|
|
140
|
+
return _[t] || _.time;
|
|
120
141
|
};
|
|
121
142
|
export {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
143
|
+
Q as createAdaptiveYAxisFormatter,
|
|
144
|
+
J as formatExactValue,
|
|
145
|
+
v as getXFormatter,
|
|
146
|
+
q as getYFormatter
|
|
126
147
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cva as
|
|
3
|
-
import * as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Graph as
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cva as A } from "class-variance-authority";
|
|
3
|
+
import * as B from "react";
|
|
4
|
+
import { useMemo as D, useRef as N, useState as M, useEffect as E } from "react";
|
|
5
|
+
import { cn as j } from "../../utils/cn.js";
|
|
6
|
+
import { Graph as I } from "./graph.js";
|
|
7
|
+
const O = A(
|
|
8
8
|
"relative w-full overflow-hidden rounded-lg border-border border bg-card text-card-foreground",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
@@ -34,45 +34,45 @@ const A = W(
|
|
|
34
34
|
padding: "default"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
),
|
|
37
|
+
), R = B.forwardRef(
|
|
38
38
|
({
|
|
39
|
-
className:
|
|
40
|
-
variant:
|
|
41
|
-
size:
|
|
39
|
+
className: n,
|
|
40
|
+
variant: t,
|
|
41
|
+
size: l,
|
|
42
42
|
padding: o,
|
|
43
43
|
title: a,
|
|
44
|
-
description:
|
|
45
|
-
toolbar:
|
|
46
|
-
loading:
|
|
47
|
-
emptyMessage:
|
|
48
|
-
error:
|
|
49
|
-
children:
|
|
50
|
-
...
|
|
51
|
-
},
|
|
52
|
-
const
|
|
53
|
-
return /* @__PURE__ */
|
|
44
|
+
description: r,
|
|
45
|
+
toolbar: s,
|
|
46
|
+
loading: i = !1,
|
|
47
|
+
emptyMessage: d,
|
|
48
|
+
error: c,
|
|
49
|
+
children: f,
|
|
50
|
+
...x
|
|
51
|
+
}, p) => {
|
|
52
|
+
const u = a || r || s;
|
|
53
|
+
return /* @__PURE__ */ m(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
|
-
ref:
|
|
57
|
-
className:
|
|
56
|
+
ref: p,
|
|
57
|
+
className: j(
|
|
58
58
|
"flex flex-col",
|
|
59
|
-
|
|
59
|
+
O({ variant: t, size: l, padding: o, className: n })
|
|
60
60
|
),
|
|
61
|
-
...
|
|
61
|
+
...x,
|
|
62
62
|
children: [
|
|
63
|
-
|
|
64
|
-
(a ||
|
|
63
|
+
u && /* @__PURE__ */ m("div", { className: "mb-4 flex items-start justify-between gap-4 shrink-0", children: [
|
|
64
|
+
(a || r) && /* @__PURE__ */ m("div", { className: "flex-1", children: [
|
|
65
65
|
a && /* @__PURE__ */ e("h3", { className: "text-base sm:text-lg font-semibold leading-none tracking-tight", children: a }),
|
|
66
|
-
|
|
66
|
+
r && /* @__PURE__ */ e("p", { className: "mt-1 text-xs sm:text-sm text-muted-foreground", children: r })
|
|
67
67
|
] }),
|
|
68
|
-
|
|
68
|
+
s && /* @__PURE__ */ e("div", { className: "shrink-0 w-full", children: s })
|
|
69
69
|
] }),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
70
|
+
/* @__PURE__ */ m("div", { className: "relative flex-1 w-full min-h-0", children: [
|
|
71
|
+
i && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center opacity-0 animate-delayed-fade-in", children: /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-2", children: [
|
|
72
72
|
/* @__PURE__ */ e("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" }),
|
|
73
73
|
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm text-muted-foreground", children: "Loading..." })
|
|
74
74
|
] }) }),
|
|
75
|
-
|
|
75
|
+
c && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-2 text-destructive", children: [
|
|
76
76
|
/* @__PURE__ */ e(
|
|
77
77
|
"svg",
|
|
78
78
|
{
|
|
@@ -92,9 +92,9 @@ const A = W(
|
|
|
92
92
|
)
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
|
-
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children:
|
|
95
|
+
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: c })
|
|
96
96
|
] }) }),
|
|
97
|
-
!
|
|
97
|
+
!c && !f && d && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
|
|
98
98
|
/* @__PURE__ */ e(
|
|
99
99
|
"svg",
|
|
100
100
|
{
|
|
@@ -114,16 +114,16 @@ const A = W(
|
|
|
114
114
|
)
|
|
115
115
|
}
|
|
116
116
|
),
|
|
117
|
-
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm", children:
|
|
117
|
+
/* @__PURE__ */ e("span", { className: "text-xs sm:text-sm", children: d })
|
|
118
118
|
] }) }),
|
|
119
119
|
/* @__PURE__ */ e(
|
|
120
120
|
"div",
|
|
121
121
|
{
|
|
122
|
-
className:
|
|
122
|
+
className: j(
|
|
123
123
|
"w-full h-full transition-[filter] duration-300 delay-300",
|
|
124
|
-
|
|
124
|
+
i && "blur-sm pointer-events-none"
|
|
125
125
|
),
|
|
126
|
-
children: !
|
|
126
|
+
children: !c && f
|
|
127
127
|
}
|
|
128
128
|
)
|
|
129
129
|
] })
|
|
@@ -132,79 +132,96 @@ const A = W(
|
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
134
|
);
|
|
135
|
-
|
|
136
|
-
function
|
|
137
|
-
series:
|
|
138
|
-
data:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
135
|
+
R.displayName = "GraphView";
|
|
136
|
+
function Q({
|
|
137
|
+
series: n,
|
|
138
|
+
data: t,
|
|
139
|
+
lineColor: l,
|
|
140
|
+
color: o,
|
|
141
|
+
topColor: a,
|
|
142
|
+
bottomColor: r,
|
|
143
|
+
graphId: s,
|
|
144
|
+
onUnselectSeries: i,
|
|
145
|
+
loading: d,
|
|
146
|
+
title: c,
|
|
147
|
+
description: f,
|
|
148
|
+
toolbar: x,
|
|
149
|
+
emptyMessage: p = "No data available",
|
|
150
|
+
error: u,
|
|
151
|
+
containerClassName: V,
|
|
152
|
+
variant: W,
|
|
153
|
+
size: G,
|
|
154
|
+
padding: z,
|
|
151
155
|
yMeasureUnit: g,
|
|
152
|
-
|
|
156
|
+
showCurrentValue: b,
|
|
157
|
+
...L
|
|
153
158
|
}) {
|
|
154
|
-
const h =
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
const h = D(() => {
|
|
160
|
+
if (n && n.length > 0)
|
|
161
|
+
return n;
|
|
162
|
+
if (t && t.length > 0) {
|
|
163
|
+
const y = l ?? o;
|
|
164
|
+
return [
|
|
165
|
+
{
|
|
166
|
+
data: t.map((v) => ({
|
|
167
|
+
time: typeof v.time == "number" ? v.time : Number(v.time),
|
|
168
|
+
value: v.value
|
|
169
|
+
})),
|
|
170
|
+
label: "Value",
|
|
171
|
+
yMeasureUnit: g,
|
|
172
|
+
...y && { lineColor: y },
|
|
173
|
+
...a && { topColor: a },
|
|
174
|
+
...r && { bottomColor: r }
|
|
175
|
+
}
|
|
176
|
+
];
|
|
162
177
|
}
|
|
163
|
-
|
|
164
|
-
h.length
|
|
165
|
-
|
|
178
|
+
return [];
|
|
179
|
+
}, [n, t, g, l, o, a, r]), H = !d && h.length === 0, w = N(h);
|
|
180
|
+
h.length > 0 && (w.current = h);
|
|
181
|
+
const k = d && h.length === 0 ? w.current : h, S = k.length > 0;
|
|
166
182
|
return /* @__PURE__ */ e(
|
|
167
|
-
|
|
183
|
+
R,
|
|
168
184
|
{
|
|
169
|
-
className:
|
|
170
|
-
variant:
|
|
171
|
-
size:
|
|
172
|
-
padding:
|
|
173
|
-
title:
|
|
174
|
-
description:
|
|
175
|
-
toolbar:
|
|
176
|
-
loading:
|
|
177
|
-
error:
|
|
178
|
-
emptyMessage:
|
|
179
|
-
children:
|
|
180
|
-
|
|
185
|
+
className: V,
|
|
186
|
+
variant: W,
|
|
187
|
+
size: G,
|
|
188
|
+
padding: z,
|
|
189
|
+
title: c,
|
|
190
|
+
description: f,
|
|
191
|
+
toolbar: x,
|
|
192
|
+
loading: d,
|
|
193
|
+
error: u,
|
|
194
|
+
emptyMessage: H ? p : void 0,
|
|
195
|
+
children: S && !u && /* @__PURE__ */ e(
|
|
196
|
+
I,
|
|
181
197
|
{
|
|
182
|
-
series:
|
|
198
|
+
series: k,
|
|
183
199
|
yMeasureUnit: g,
|
|
184
|
-
...
|
|
185
|
-
...
|
|
200
|
+
...i ? { onUnselectSeries: i } : {},
|
|
201
|
+
...b !== void 0 ? { showCurrentValue: b } : {},
|
|
202
|
+
...L
|
|
186
203
|
}
|
|
187
204
|
)
|
|
188
205
|
}
|
|
189
206
|
);
|
|
190
207
|
}
|
|
191
|
-
function
|
|
192
|
-
const
|
|
193
|
-
return
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
197
|
-
a(
|
|
208
|
+
function T(n = 0) {
|
|
209
|
+
const t = N(null), l = N(null), [o, a] = M(null);
|
|
210
|
+
return E(() => {
|
|
211
|
+
const r = () => {
|
|
212
|
+
if (t.current && l.current) {
|
|
213
|
+
const d = l.current.clientWidth, c = t.current.clientWidth;
|
|
214
|
+
a(d - c - n);
|
|
198
215
|
}
|
|
199
|
-
},
|
|
200
|
-
return
|
|
201
|
-
|
|
216
|
+
}, s = l.current, i = s ? new ResizeObserver(r) : null;
|
|
217
|
+
return s && i?.observe(s), () => {
|
|
218
|
+
s && i?.unobserve(s);
|
|
202
219
|
};
|
|
203
|
-
}, [
|
|
220
|
+
}, [n]), { graphWidth: o, parentRef: l, asideRef: t };
|
|
204
221
|
}
|
|
205
222
|
export {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
223
|
+
R as GraphView,
|
|
224
|
+
Q as GraphViewWithData,
|
|
225
|
+
O as graphViewVariants,
|
|
226
|
+
T as useGraphAside
|
|
210
227
|
};
|