@gearbox-protocol/ui-kit 3.14.0-next.34 → 3.14.0-next.36
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/assets-list-cell/assets-list-cell.cjs +1 -1
- package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
- package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
- package/dist/cjs/components/composites/credit-account-history/body.cjs +1 -0
- package/dist/cjs/components/composites/credit-account-history/cells/details.cjs +1 -0
- package/dist/cjs/components/composites/credit-account-history/cells/hash.cjs +1 -0
- package/dist/cjs/components/composites/credit-account-history/cells/index.cjs +1 -0
- package/dist/cjs/components/composites/credit-account-history/cells/protocol.cjs +1 -0
- package/dist/cjs/components/composites/credit-account-history/cells/token-list.cjs +1 -0
- package/dist/cjs/components/composites/credit-account-history/credit-account-history.cjs +1 -0
- package/dist/cjs/components/composites/credit-account-history/index.cjs +1 -0
- package/dist/cjs/components/composites/credit-account-history/line.cjs +1 -0
- package/dist/cjs/components/composites/credit-account-history/types.cjs +1 -0
- package/dist/cjs/components/composites/index.cjs +1 -1
- package/dist/cjs/components/composites/pool-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/preview/OperationPreviewContent.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/operations/OperationsCard.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/operations/PoolDepositView.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/operations/PoolWithdrawView.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/state-change/BalanceChangeGroup.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/state-change/StateChangeCard.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/graph/formatters.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/markdown-viewer/markdown-viewer.cjs +1 -1
- package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
- package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -1
- package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +3 -2
- package/dist/esm/components/block-sync/block-sync.js +3 -2
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +3 -2
- package/dist/esm/components/checkbox/checkbox-labeled.js +1 -0
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -0
- package/dist/esm/components/complex-input/complex-input.js +3 -2
- package/dist/esm/components/composites/credit-account-history/body.js +73 -0
- package/dist/esm/components/composites/credit-account-history/cells/details.js +22 -0
- package/dist/esm/components/composites/credit-account-history/cells/hash.js +24 -0
- package/dist/esm/components/composites/credit-account-history/cells/index.js +10 -0
- package/dist/esm/components/composites/credit-account-history/cells/protocol.js +25 -0
- package/dist/esm/components/composites/credit-account-history/cells/token-list.js +43 -0
- package/dist/esm/components/composites/credit-account-history/credit-account-history.js +46 -0
- package/dist/esm/components/composites/credit-account-history/index.js +8 -0
- package/dist/esm/components/composites/credit-account-history/line.js +125 -0
- package/dist/esm/components/composites/credit-account-history/types.js +9 -0
- package/dist/esm/components/composites/index.js +85 -79
- package/dist/esm/components/composites/pool-table/columns.js +19 -18
- package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +3 -2
- package/dist/esm/components/composites/tx-preview/confirm/preview/OperationPreviewContent.js +3 -2
- package/dist/esm/components/composites/tx-preview/operations/OperationsCard.js +3 -2
- package/dist/esm/components/composites/tx-preview/operations/PoolDepositView.js +3 -2
- package/dist/esm/components/composites/tx-preview/operations/PoolWithdrawView.js +3 -2
- package/dist/esm/components/composites/tx-preview/state-change/BalanceChangeGroup.js +3 -2
- package/dist/esm/components/composites/tx-preview/state-change/StateChangeCard.js +3 -2
- package/dist/esm/components/compound-apy/compound-apy.js +3 -2
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +1 -0
- package/dist/esm/components/graph/formatters.js +48 -47
- package/dist/esm/components/graph/graph.js +586 -483
- package/dist/esm/components/graph/index.js +19 -18
- package/dist/esm/components/index.js +687 -680
- package/dist/esm/components/markdown-viewer/markdown-viewer.js +3 -2
- package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +1 -0
- package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +3 -2
- package/dist/esm/components/trading-view/trading-view.js +164 -147
- package/dist/esm/components/with-copy/with-copy.js +3 -2
- package/dist/esm/index.js +855 -848
- package/dist/esm/locale/en.json.js +3 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/composites/credit-account-history/body.d.ts +14 -0
- package/dist/types/components/composites/credit-account-history/cells/details.d.ts +9 -0
- package/dist/types/components/composites/credit-account-history/cells/hash.d.ts +6 -0
- package/dist/types/components/composites/credit-account-history/cells/index.d.ts +4 -0
- package/dist/types/components/composites/credit-account-history/cells/protocol.d.ts +7 -0
- package/dist/types/components/composites/credit-account-history/cells/token-list.d.ts +9 -0
- package/dist/types/components/composites/credit-account-history/credit-account-history.d.ts +15 -0
- package/dist/types/components/composites/credit-account-history/index.d.ts +2 -0
- package/dist/types/components/composites/credit-account-history/line.d.ts +18 -0
- package/dist/types/components/composites/credit-account-history/types.d.ts +36 -0
- package/dist/types/components/composites/index.d.ts +1 -0
- package/dist/types/components/graph/graph.d.ts +45 -3
- package/dist/types/components/graph/index.d.ts +1 -1
- package/dist/types/components/trading-view/trading-view.d.ts +15 -1
- package/dist/types/locale/en.json.d.ts +4 -0
- package/package.json +2 -2
|
@@ -60,6 +60,7 @@ import "../input/input.js";
|
|
|
60
60
|
import "../with-title/with-title.js";
|
|
61
61
|
import "../smart-number-input/balance-indicator.js";
|
|
62
62
|
import "../smart-number-input/smart-number-input.js";
|
|
63
|
+
import "../composites/credit-account-history/credit-account-history.js";
|
|
63
64
|
import "../table/grid-table.js";
|
|
64
65
|
import "../token-symbol/token-symbol.js";
|
|
65
66
|
import "../typography/typography.js";
|
|
@@ -184,7 +185,7 @@ function a(o) {
|
|
|
184
185
|
}
|
|
185
186
|
return { id: T(l), displayText: o };
|
|
186
187
|
}
|
|
187
|
-
function
|
|
188
|
+
function Er({
|
|
188
189
|
content: o,
|
|
189
190
|
title: l,
|
|
190
191
|
backButton: s,
|
|
@@ -396,5 +397,5 @@ function zr({
|
|
|
396
397
|
return c ? d : /* @__PURE__ */ r(w, { title: l || "", backButton: s, children: d });
|
|
397
398
|
}
|
|
398
399
|
export {
|
|
399
|
-
|
|
400
|
+
Er as MarkdownViewer
|
|
400
401
|
};
|
|
@@ -48,6 +48,7 @@ import "../input/input.js";
|
|
|
48
48
|
import "../with-title/with-title.js";
|
|
49
49
|
import "../smart-number-input/balance-indicator.js";
|
|
50
50
|
import "../smart-number-input/smart-number-input.js";
|
|
51
|
+
import "../composites/credit-account-history/credit-account-history.js";
|
|
51
52
|
import "../table/grid-table.js";
|
|
52
53
|
import "../token-symbol/token-symbol.js";
|
|
53
54
|
import "../typography/typography.js";
|
|
@@ -47,6 +47,7 @@ import "../input/input.js";
|
|
|
47
47
|
import "../with-title/with-title.js";
|
|
48
48
|
import "../smart-number-input/balance-indicator.js";
|
|
49
49
|
import "../smart-number-input/smart-number-input.js";
|
|
50
|
+
import "../composites/credit-account-history/credit-account-history.js";
|
|
50
51
|
import "../table/grid-table.js";
|
|
51
52
|
import { getSymbolOrIcon as P } from "../token-symbol/token-symbol.js";
|
|
52
53
|
import "../typography/typography.js";
|
|
@@ -163,7 +164,7 @@ import "../theme-provider.js";
|
|
|
163
164
|
import "../time-to-liquidation/time-to-liquidation.js";
|
|
164
165
|
import "../toggle/toggle.js";
|
|
165
166
|
import "../with-filter-button/with-filter-button.js";
|
|
166
|
-
function
|
|
167
|
+
function Dr({
|
|
167
168
|
balances: a,
|
|
168
169
|
tokensList: l,
|
|
169
170
|
maxAssets: p = 3,
|
|
@@ -226,5 +227,5 @@ function Br({
|
|
|
226
227
|
] });
|
|
227
228
|
}
|
|
228
229
|
export {
|
|
229
|
-
|
|
230
|
+
Dr as TokensListCell
|
|
230
231
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { toast as
|
|
4
|
-
import { useIsMobile as
|
|
1
|
+
import { jsxs as h, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as g, useCallback as ce, useRef as N } from "react";
|
|
3
|
+
import { toast as ue } from "sonner";
|
|
4
|
+
import { useIsMobile as me } from "../../hooks/use-media-query.js";
|
|
5
5
|
import "@gearbox-protocol/sdk";
|
|
6
|
-
import { cn as
|
|
6
|
+
import { cn as de } from "../../utils/cn.js";
|
|
7
7
|
import "@gearbox-protocol/sdk/common-utils";
|
|
8
8
|
import "luxon";
|
|
9
9
|
import "../../utils/z-index.js";
|
|
10
|
-
import { RangeButtons as
|
|
11
|
-
import { DEFAULT_SERIES_COLORS as
|
|
12
|
-
import { GraphViewWithData as
|
|
13
|
-
import { GraphDropdown as
|
|
14
|
-
const
|
|
10
|
+
import { RangeButtons as fe } from "../buttons/range-buttons/range-buttons.js";
|
|
11
|
+
import { DEFAULT_SERIES_COLORS as j, getSeriesColorPalette as ae, GraphLegend as we } from "../graph/graph.js";
|
|
12
|
+
import { GraphViewWithData as xe } from "../graph/graph-view.js";
|
|
13
|
+
import { GraphDropdown as ve } from "./graph-dropdown.js";
|
|
14
|
+
const pe = ({ size: e = 16 }) => /* @__PURE__ */ h(
|
|
15
15
|
"svg",
|
|
16
16
|
{
|
|
17
17
|
width: e,
|
|
@@ -24,11 +24,11 @@ const de = ({ size: e = 16 }) => /* @__PURE__ */ S(
|
|
|
24
24
|
strokeLinejoin: "round",
|
|
25
25
|
"aria-label": "Expand fullscreen",
|
|
26
26
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ i("title", { children: "Expand fullscreen" }),
|
|
28
|
+
/* @__PURE__ */ i("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" })
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
|
-
),
|
|
31
|
+
), be = ({ size: e = 16 }) => /* @__PURE__ */ h(
|
|
32
32
|
"svg",
|
|
33
33
|
{
|
|
34
34
|
width: e,
|
|
@@ -41,177 +41,194 @@ const de = ({ size: e = 16 }) => /* @__PURE__ */ S(
|
|
|
41
41
|
strokeLinejoin: "round",
|
|
42
42
|
"aria-label": "Exit fullscreen",
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ i("title", { children: "Exit fullscreen" }),
|
|
45
|
+
/* @__PURE__ */ i("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" })
|
|
46
46
|
]
|
|
47
47
|
}
|
|
48
|
-
),
|
|
49
|
-
function
|
|
48
|
+
), $ = "ui-kit:tradingview-series-colors:";
|
|
49
|
+
function L(e) {
|
|
50
50
|
if (typeof window > "u" || !window.localStorage)
|
|
51
51
|
return /* @__PURE__ */ new Map();
|
|
52
52
|
try {
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
55
|
-
const c = JSON.parse(
|
|
53
|
+
const o = window.localStorage.getItem($ + e);
|
|
54
|
+
if (!o) return /* @__PURE__ */ new Map();
|
|
55
|
+
const c = JSON.parse(o);
|
|
56
56
|
return c == null || typeof c != "object" ? /* @__PURE__ */ new Map() : new Map(
|
|
57
57
|
Object.entries(c).filter(
|
|
58
|
-
([,
|
|
58
|
+
([, r]) => typeof r == "number" && r >= 0 && r < j.length
|
|
59
59
|
)
|
|
60
60
|
);
|
|
61
61
|
} catch {
|
|
62
62
|
return /* @__PURE__ */ new Map();
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function ye(e, o) {
|
|
66
66
|
if (!(typeof window > "u" || !window.localStorage))
|
|
67
67
|
try {
|
|
68
68
|
window.localStorage.setItem(
|
|
69
|
-
|
|
70
|
-
JSON.stringify(Object.fromEntries(
|
|
69
|
+
$ + e,
|
|
70
|
+
JSON.stringify(Object.fromEntries(o))
|
|
71
71
|
);
|
|
72
72
|
} catch {
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
if (
|
|
77
|
-
const c =
|
|
78
|
-
for (const [
|
|
79
|
-
c.set(
|
|
80
|
-
|
|
75
|
+
function J(e, o) {
|
|
76
|
+
if (o.size === 0) return;
|
|
77
|
+
const c = L(e);
|
|
78
|
+
for (const [r, v] of o)
|
|
79
|
+
c.set(r, v);
|
|
80
|
+
ye(e, c);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function ze({
|
|
83
83
|
data: e,
|
|
84
|
-
yMeasureUnit:
|
|
84
|
+
yMeasureUnit: o,
|
|
85
85
|
height: c = 306,
|
|
86
|
-
defaultGraph:
|
|
86
|
+
defaultGraph: r,
|
|
87
87
|
onGraphSelected: v,
|
|
88
|
-
graphs:
|
|
89
|
-
isMultipleSelect:
|
|
90
|
-
range:
|
|
91
|
-
rangeList:
|
|
92
|
-
setRange:
|
|
93
|
-
onGraphExpanded:
|
|
94
|
-
isGraphExpanded:
|
|
95
|
-
onUnselectSeries:
|
|
96
|
-
graphsWithNoData:
|
|
97
|
-
loadingGraphs:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
88
|
+
graphs: f,
|
|
89
|
+
isMultipleSelect: X,
|
|
90
|
+
range: q,
|
|
91
|
+
rangeList: R,
|
|
92
|
+
setRange: Q,
|
|
93
|
+
onGraphExpanded: I,
|
|
94
|
+
isGraphExpanded: Y,
|
|
95
|
+
onUnselectSeries: O,
|
|
96
|
+
graphsWithNoData: Z,
|
|
97
|
+
loadingGraphs: A,
|
|
98
|
+
isLoading: T,
|
|
99
|
+
noDataMessage: _ = "No data available for this graph",
|
|
100
|
+
currentValueDecimals: D,
|
|
101
|
+
containerClassName: U,
|
|
102
|
+
useSharedPriceScale: K,
|
|
103
|
+
showCurrentValue: P,
|
|
104
|
+
yScaleMin: G,
|
|
105
|
+
yScaleMinMultiple: ee,
|
|
105
106
|
seriesColorPersistenceKey: u,
|
|
106
|
-
...
|
|
107
|
+
...z
|
|
107
108
|
}) {
|
|
108
|
-
const
|
|
109
|
-
(w,
|
|
110
|
-
|
|
109
|
+
const p = g(() => Array.isArray(e) ? e : e ? [e] : [], [e]), C = g(() => Array.isArray(e) && e.length > 1, [e]), F = me(), te = ce(
|
|
110
|
+
(w, y) => {
|
|
111
|
+
ue.error(_);
|
|
111
112
|
},
|
|
112
|
-
[
|
|
113
|
-
),
|
|
114
|
-
if (
|
|
115
|
-
return Array.isArray(
|
|
116
|
-
}, [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
onNoDataSelected: K
|
|
127
|
-
}
|
|
128
|
-
) }),
|
|
129
|
-
/* @__PURE__ */ S("div", { className: "flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1", children: [
|
|
130
|
-
/* @__PURE__ */ l(ce, { range: T, rangeList: N, setRange: D }),
|
|
131
|
-
!O && A && /* @__PURE__ */ l(
|
|
132
|
-
"button",
|
|
133
|
-
{
|
|
134
|
-
type: "button",
|
|
135
|
-
className: "px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",
|
|
136
|
-
onClick: A,
|
|
137
|
-
children: W ? /* @__PURE__ */ l(ae, { size: 16 }) : /* @__PURE__ */ l(de, { size: 16 })
|
|
138
|
-
}
|
|
139
|
-
)
|
|
140
|
-
] })
|
|
141
|
-
] }), i = E(/* @__PURE__ */ new Map()), a = E(0), _ = E(!1);
|
|
142
|
-
if (d && d.length > 0 && !_.current) {
|
|
143
|
-
_.current = !0;
|
|
144
|
-
const w = u ? j(u) : /* @__PURE__ */ new Map(), g = String(d[0].value);
|
|
145
|
-
i.current.set(g, 0), a.current = 1;
|
|
146
|
-
for (let r = 1; r < d.length; r++) {
|
|
147
|
-
const m = String(d[r].value);
|
|
148
|
-
if (i.current.has(m)) continue;
|
|
149
|
-
const p = w.get(m) ?? r;
|
|
150
|
-
i.current.set(m, p), a.current = Math.max(a.current, p + 1);
|
|
113
|
+
[_]
|
|
114
|
+
), oe = g(() => {
|
|
115
|
+
if (o)
|
|
116
|
+
return Array.isArray(o) ? o[0] : o;
|
|
117
|
+
}, [o]), V = !!(v && f && r), l = N(/* @__PURE__ */ new Map()), a = N(0), B = N(!1);
|
|
118
|
+
if (f && f.length > 0 && !B.current) {
|
|
119
|
+
B.current = !0;
|
|
120
|
+
const w = u ? L(u) : /* @__PURE__ */ new Map(), y = String(f[0].value);
|
|
121
|
+
l.current.set(y, 0), a.current = 1;
|
|
122
|
+
for (let t = 1; t < f.length; t++) {
|
|
123
|
+
const m = String(f[t].value);
|
|
124
|
+
if (l.current.has(m)) continue;
|
|
125
|
+
const b = w.get(m) ?? t;
|
|
126
|
+
l.current.set(m, b), a.current = Math.max(a.current, b + 1);
|
|
151
127
|
}
|
|
152
|
-
u &&
|
|
128
|
+
u && J(
|
|
153
129
|
u,
|
|
154
|
-
|
|
130
|
+
l.current
|
|
155
131
|
);
|
|
156
132
|
}
|
|
157
|
-
const
|
|
158
|
-
const w = Array.isArray(
|
|
133
|
+
const W = g(() => {
|
|
134
|
+
const w = Array.isArray(o) ? o : void 0;
|
|
159
135
|
if (u) {
|
|
160
|
-
const
|
|
161
|
-
for (const [m, x] of
|
|
162
|
-
|
|
136
|
+
const t = L(u);
|
|
137
|
+
for (const [m, x] of t)
|
|
138
|
+
l.current.has(m) || (l.current.set(m, x), a.current = Math.max(
|
|
163
139
|
a.current,
|
|
164
140
|
x + 1
|
|
165
141
|
));
|
|
166
142
|
}
|
|
167
|
-
const
|
|
168
|
-
const x =
|
|
169
|
-
if (!
|
|
143
|
+
const y = p.map((t, m) => {
|
|
144
|
+
const x = t?.title || `Series ${m + 1}`, b = r != null ? Array.isArray(r) ? r[0]?.value ?? r[0] : typeof r == "object" && "value" in r ? r.value : r : null, E = p.length === 1 ? b != null ? String(b) : "single" : t?.id || x;
|
|
145
|
+
if (!l.current.has(E)) {
|
|
170
146
|
const n = new Set(
|
|
171
|
-
Array.from(
|
|
147
|
+
Array.from(l.current.values())
|
|
172
148
|
);
|
|
173
149
|
let s = a.current;
|
|
174
|
-
for (let
|
|
175
|
-
const
|
|
176
|
-
if (!n.has(
|
|
177
|
-
s =
|
|
150
|
+
for (let d = 0; d < j.length; d++) {
|
|
151
|
+
const S = (a.current + d) % j.length;
|
|
152
|
+
if (!n.has(S)) {
|
|
153
|
+
s = S;
|
|
178
154
|
break;
|
|
179
155
|
}
|
|
180
156
|
}
|
|
181
|
-
|
|
157
|
+
l.current.set(E, s), a.current = s + 1;
|
|
182
158
|
}
|
|
183
|
-
const
|
|
184
|
-
const
|
|
185
|
-
return
|
|
159
|
+
const le = l.current.get(E) ?? 0, k = ae(le), se = [...t?.data || []].sort((n, s) => {
|
|
160
|
+
const d = typeof n.time == "number" ? n.time : Number(n.time), S = typeof s.time == "number" ? s.time : Number(s.time);
|
|
161
|
+
return d - S;
|
|
186
162
|
}).reduce((n, s) => {
|
|
187
|
-
const
|
|
188
|
-
return n.length === 0 || n[n.length - 1].time !==
|
|
189
|
-
}, []),
|
|
163
|
+
const d = s.time;
|
|
164
|
+
return n.length === 0 || n[n.length - 1].time !== d ? n.push({ time: d, value: s.value }) : n[n.length - 1] = { time: d, value: s.value }, n;
|
|
165
|
+
}, []), H = t?.lineColor ?? t?.color ?? void 0;
|
|
190
166
|
return {
|
|
191
|
-
data:
|
|
167
|
+
data: se,
|
|
192
168
|
label: x,
|
|
193
|
-
yMeasureUnit: w?.[m] ?? (Array.isArray(
|
|
194
|
-
...
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
169
|
+
yMeasureUnit: w?.[m] ?? (Array.isArray(o) ? void 0 : o),
|
|
170
|
+
...t?.priceScaleId != null && {
|
|
171
|
+
priceScaleId: t.priceScaleId
|
|
172
|
+
},
|
|
173
|
+
...t?.seriesType != null && {
|
|
174
|
+
seriesType: t.seriesType
|
|
175
|
+
},
|
|
176
|
+
...t?.lineStyle != null && {
|
|
177
|
+
lineStyle: t.lineStyle
|
|
178
|
+
},
|
|
179
|
+
...H != null ? {
|
|
180
|
+
lineColor: H,
|
|
181
|
+
...t?.topColor != null && {
|
|
182
|
+
topColor: t.topColor
|
|
198
183
|
},
|
|
199
|
-
...
|
|
200
|
-
bottomColor:
|
|
184
|
+
...t?.bottomColor != null && {
|
|
185
|
+
bottomColor: t.bottomColor
|
|
201
186
|
}
|
|
202
187
|
} : {
|
|
203
|
-
color:
|
|
204
|
-
topColor:
|
|
205
|
-
bottomColor:
|
|
188
|
+
color: k.line,
|
|
189
|
+
topColor: k.top,
|
|
190
|
+
bottomColor: k.bottom
|
|
206
191
|
}
|
|
207
192
|
};
|
|
208
193
|
});
|
|
209
|
-
return u &&
|
|
194
|
+
return u && l.current.size > 0 && J(
|
|
210
195
|
u,
|
|
211
|
-
|
|
212
|
-
),
|
|
213
|
-
}, [
|
|
214
|
-
|
|
196
|
+
l.current
|
|
197
|
+
), y;
|
|
198
|
+
}, [p, r, o, u]), re = T !== void 0 ? T : A !== void 0 ? A.size > 0 : C && p.length > 0 ? p.some((w) => !w) : !e, ne = z.title, M = C && !V && !ne, ie = (!F && I || R.length > 0 || V || M) && /* @__PURE__ */ h("div", { className: "z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2", children: [
|
|
199
|
+
/* @__PURE__ */ i("div", { className: "min-w-0", children: v && f && r ? /* @__PURE__ */ i(
|
|
200
|
+
ve,
|
|
201
|
+
{
|
|
202
|
+
onSelected: v,
|
|
203
|
+
items: f,
|
|
204
|
+
defaultItem: r,
|
|
205
|
+
multiple: X,
|
|
206
|
+
graphsWithNoData: Z,
|
|
207
|
+
loadingGraphs: A,
|
|
208
|
+
onNoDataSelected: te
|
|
209
|
+
}
|
|
210
|
+
) : M ? /* @__PURE__ */ i(
|
|
211
|
+
we,
|
|
212
|
+
{
|
|
213
|
+
series: W,
|
|
214
|
+
onUnselect: O,
|
|
215
|
+
inline: !0
|
|
216
|
+
}
|
|
217
|
+
) : null }),
|
|
218
|
+
/* @__PURE__ */ h("div", { className: "flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1", children: [
|
|
219
|
+
/* @__PURE__ */ i(fe, { range: q, rangeList: R, setRange: Q }),
|
|
220
|
+
!F && I && /* @__PURE__ */ i(
|
|
221
|
+
"button",
|
|
222
|
+
{
|
|
223
|
+
type: "button",
|
|
224
|
+
className: "px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",
|
|
225
|
+
onClick: I,
|
|
226
|
+
children: Y ? /* @__PURE__ */ i(be, { size: 16 }) : /* @__PURE__ */ i(pe, { size: 16 })
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
] })
|
|
230
|
+
] });
|
|
231
|
+
return /* @__PURE__ */ i(
|
|
215
232
|
"div",
|
|
216
233
|
{
|
|
217
234
|
style: {
|
|
@@ -219,28 +236,28 @@ function Re({
|
|
|
219
236
|
height: c ? `${c}px` : void 0
|
|
220
237
|
},
|
|
221
238
|
className: "w-full",
|
|
222
|
-
children: /* @__PURE__ */
|
|
223
|
-
|
|
239
|
+
children: /* @__PURE__ */ i(
|
|
240
|
+
xe,
|
|
224
241
|
{
|
|
225
|
-
series:
|
|
226
|
-
loading:
|
|
227
|
-
toolbar:
|
|
242
|
+
series: W,
|
|
243
|
+
loading: re,
|
|
244
|
+
toolbar: ie,
|
|
228
245
|
size: c ? "full" : "default",
|
|
229
|
-
containerClassName:
|
|
230
|
-
showLegend:
|
|
231
|
-
onUnselectSeries:
|
|
232
|
-
yMeasureUnit:
|
|
233
|
-
currentValueDecimals:
|
|
234
|
-
useSharedPriceScale:
|
|
235
|
-
showCurrentValue:
|
|
236
|
-
yScaleMin:
|
|
237
|
-
yScaleMinMultiple:
|
|
238
|
-
...
|
|
246
|
+
containerClassName: de("h-full", U),
|
|
247
|
+
showLegend: C && !M,
|
|
248
|
+
onUnselectSeries: O,
|
|
249
|
+
yMeasureUnit: oe,
|
|
250
|
+
currentValueDecimals: D,
|
|
251
|
+
useSharedPriceScale: K,
|
|
252
|
+
showCurrentValue: P,
|
|
253
|
+
yScaleMin: G,
|
|
254
|
+
yScaleMinMultiple: ee,
|
|
255
|
+
...z
|
|
239
256
|
}
|
|
240
257
|
)
|
|
241
258
|
}
|
|
242
259
|
);
|
|
243
260
|
}
|
|
244
261
|
export {
|
|
245
|
-
|
|
262
|
+
ze as TradingView
|
|
246
263
|
};
|
|
@@ -47,6 +47,7 @@ import "../input/input.js";
|
|
|
47
47
|
import "../with-title/with-title.js";
|
|
48
48
|
import "../smart-number-input/balance-indicator.js";
|
|
49
49
|
import "../smart-number-input/smart-number-input.js";
|
|
50
|
+
import "../composites/credit-account-history/credit-account-history.js";
|
|
50
51
|
import "../table/grid-table.js";
|
|
51
52
|
import "../token-symbol/token-symbol.js";
|
|
52
53
|
import "../typography/typography.js";
|
|
@@ -163,7 +164,7 @@ import "../theme-provider.js";
|
|
|
163
164
|
import "../time-to-liquidation/time-to-liquidation.js";
|
|
164
165
|
import "../toggle/toggle.js";
|
|
165
166
|
import "../with-filter-button/with-filter-button.js";
|
|
166
|
-
function
|
|
167
|
+
function Rr({
|
|
167
168
|
toCopy: u,
|
|
168
169
|
children: d,
|
|
169
170
|
onCopySuccess: f,
|
|
@@ -245,5 +246,5 @@ function Kr({
|
|
|
245
246
|
return a ? /* @__PURE__ */ t(T, { placement: "top", triangle: !0, title: c(), children: a }) : c();
|
|
246
247
|
}
|
|
247
248
|
export {
|
|
248
|
-
|
|
249
|
+
Rr as WithCopy
|
|
249
250
|
};
|